From: Andrea Cuccaro Date: Thu, 30 Sep 2021 11:55:33 +0000 (+0200) Subject: Built motion from commit d62f9d50.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=5dd76022c410ff31604fbdd97ee40a775d45fa00;p=motion2.git Built motion from commit d62f9d50.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 66b72cd..f770e17 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-30T10:43:46.011Z", + "time": "2021-09-30T11:46:34.300Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 95347cc..b52ed09 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-30T10:43:46.011Z", + "time": "2021-09-30T11:46:34.300Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 144609c..2f67b29 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 _0x5255=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0xbda849,_0x2dcb1a){var _0x2d3e9d=function(_0x2c8f10){while(--_0x2c8f10){_0xbda849['push'](_0xbda849['shift']());}};_0x2d3e9d(++_0x2dcb1a);}(_0x5255,0xad));var _0x5525=function(_0x209510,_0x13f7f1){_0x209510=_0x209510-0x0;var _0x3fc7af=_0x5255[_0x209510];return _0x3fc7af;};'use strict';var Sequelize=require(_0x5525('0x0'));module[_0x5525('0x1')]={'name':{'type':Sequelize[_0x5525('0x2')],'get':function(_0x53d45d){return this[_0x5525('0x3')](_0x5525('0x4'));}},'action':{'type':Sequelize[_0x5525('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5525('0x6'),_0x5525('0x7'),_0x5525('0x8'),_0x5525('0x9'),_0x5525('0xa'),_0x5525('0xb'),_0x5525('0xc'),_0x5525('0xd')]],'msg':_0x5525('0xe')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5525('0xf')},'data2':{'type':Sequelize[_0x5525('0x5')](0x1000),'comment':_0x5525('0x10')},'data3':{'type':Sequelize[_0x5525('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x5525('0x5')](0x1000),'comments':_0x5525('0x11')},'data5':{'type':Sequelize[_0x5525('0x5')](0x1000),'comments':_0x5525('0x12')},'data6':{'type':Sequelize[_0x5525('0x5')],'comments':_0x5525('0x13')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5525('0x14')}}; \ No newline at end of file +var _0x37c0=['motionbar','urlForward','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x39576d,_0x594060){var _0x3edb71=function(_0x20a452){while(--_0x20a452){_0x39576d['push'](_0x39576d['shift']());}};_0x3edb71(++_0x594060);}(_0x37c0,0xe7));var _0x037c=function(_0x479fe6,_0x4b8a78){_0x479fe6=_0x479fe6-0x0;var _0x2221ae=_0x37c0[_0x479fe6];return _0x2221ae;};'use strict';var Sequelize=require('sequelize');module[_0x037c('0x0')]={'name':{'type':Sequelize[_0x037c('0x1')],'get':function(_0x31bdec){return this[_0x037c('0x2')](_0x037c('0x3'));}},'action':{'type':Sequelize[_0x037c('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x037c('0x5'),_0x037c('0x6'),_0x037c('0x7'),'jscripty',_0x037c('0x8'),'browser','bot','script']],'msg':_0x037c('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x037c('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x037c('0xa')},'data3':{'type':Sequelize[_0x037c('0x4')](0x1000),'comment':_0x037c('0xb')},'data4':{'type':Sequelize[_0x037c('0x4')](0x1000),'comments':_0x037c('0xc')},'data5':{'type':Sequelize[_0x037c('0x4')](0x1000),'comments':_0x037c('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0x037c('0xe')},'data7':{'type':Sequelize[_0x037c('0xf')],'comments':_0x037c('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 409b313..3f47d41 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 _0x54fb=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','destroy','end','error','name','send','body','Action','find','params','then','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x54fb,0x159));var _0xb54f=function(_0x5d2810,_0x2d30e7){_0x5d2810=_0x5d2810-0x0;var _0x169653=_0x54fb[_0x5d2810];return _0x169653;};'use strict';var emlformat=require(_0xb54f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb54f('0x1'));var jsonpatch=require(_0xb54f('0x2'));var rp=require(_0xb54f('0x3'));var moment=require(_0xb54f('0x4'));var BPromise=require(_0xb54f('0x5'));var Mustache=require(_0xb54f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb54f('0x7'));var csv=require(_0xb54f('0x8'));var ejs=require(_0xb54f('0x9'));var fs=require('fs');var fs_extra=require(_0xb54f('0xa'));var _=require(_0xb54f('0xb'));var squel=require(_0xb54f('0xc'));var crypto=require(_0xb54f('0xd'));var jsforce=require(_0xb54f('0xe'));var deskjs=require(_0xb54f('0xf'));var toCsv=require(_0xb54f('0x8'));var querystring=require(_0xb54f('0x10'));var Papa=require('papaparse');var Redis=require(_0xb54f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb54f('0x12'));var as=require(_0xb54f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb54f('0x14'))('api');var utils=require(_0xb54f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb54f('0x16'));var db=require(_0xb54f('0x17'))['db'];function respondWithStatusCode(_0x44a51b,_0x582657){_0x582657=_0x582657||0xcc;return function(_0x191f66){if(_0x191f66){return _0x44a51b[_0xb54f('0x18')](_0x582657);}return _0x44a51b[_0xb54f('0x19')](_0x582657)['end']();};}function respondWithResult(_0x47857f,_0x48bbb4){_0x48bbb4=_0x48bbb4||0xc8;return function(_0x29f58c){if(_0x29f58c){return _0x47857f[_0xb54f('0x19')](_0x48bbb4)[_0xb54f('0x1a')](_0x29f58c);}};}function respondWithFilteredResult(_0x581e71,_0x322afe){return function(_0x2fe6b6){if(_0x2fe6b6){var _0xde5058=typeof _0x322afe[_0xb54f('0x1b')]==='undefined'&&typeof _0x322afe['limit']===_0xb54f('0x1c');var _0x359f93=_0x2fe6b6['count'];var _0x5e7ac7=_0xde5058?0x0:_0x322afe[_0xb54f('0x1b')];var _0x37a5da=_0xde5058?_0x2fe6b6[_0xb54f('0x1d')]:_0x322afe['offset']+_0x322afe[_0xb54f('0x1e')];var _0x48c12d;if(_0x37a5da>=_0x359f93){_0x37a5da=_0x359f93;_0x48c12d=0xc8;}else{_0x48c12d=0xce;}_0x581e71[_0xb54f('0x19')](_0x48c12d);return _0x581e71[_0xb54f('0x1f')]('Content-Range',_0x5e7ac7+'-'+_0x37a5da+'/'+_0x359f93)['json'](_0x2fe6b6);}return null;};}function patchUpdates(_0x215433){return function(_0x19882c){try{jsonpatch[_0xb54f('0x20')](_0x19882c,_0x215433,!![]);}catch(_0x172d3c){return BPromise['reject'](_0x172d3c);}return _0x19882c[_0xb54f('0x21')]();};}function saveUpdates(_0x1f2651,_0x3fcfe9){return function(_0x575f3b){if(_0x575f3b){return _0x575f3b['update'](_0x1f2651)['then'](function(_0x23f249){return _0x23f249;});}return null;};}function removeEntity(_0x5b1c6f,_0x447b4e){return function(_0x216ea1){if(_0x216ea1){return _0x216ea1[_0xb54f('0x22')]()['then'](function(){_0x5b1c6f[_0xb54f('0x19')](0xcc)[_0xb54f('0x23')]();});}};}function handleEntityNotFound(_0x4605bf,_0xf069ac){return function(_0x33d671){if(!_0x33d671){_0x4605bf[_0xb54f('0x18')](0x194);}return _0x33d671;};}function handleError(_0x2c459,_0x3ad3b3){_0x3ad3b3=_0x3ad3b3||0x1f4;return function(_0x554654){logger[_0xb54f('0x24')](_0x554654['stack']);if(_0x554654[_0xb54f('0x25')]){delete _0x554654[_0xb54f('0x25')];}_0x2c459[_0xb54f('0x19')](_0x3ad3b3)[_0xb54f('0x26')](_0x554654);};}exports['update']=function(_0x38c77b,_0x1c47a3){if(_0x38c77b[_0xb54f('0x27')]['id']){delete _0x38c77b[_0xb54f('0x27')]['id'];}return db[_0xb54f('0x28')][_0xb54f('0x29')]({'where':{'id':_0x38c77b[_0xb54f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1c47a3,null))[_0xb54f('0x2b')](saveUpdates(_0x38c77b[_0xb54f('0x27')],null))['then'](respondWithResult(_0x1c47a3,null))[_0xb54f('0x2c')](handleError(_0x1c47a3,null));};exports[_0xb54f('0x22')]=function(_0x4c004b,_0x387cc6){return db[_0xb54f('0x28')][_0xb54f('0x29')]({'where':{'id':_0x4c004b[_0xb54f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x387cc6,null))['then'](removeEntity(_0x387cc6,null))[_0xb54f('0x2c')](handleError(_0x387cc6,null));}; \ No newline at end of file +var _0xb93c=['params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0xb93c,0x159));var _0xcb93=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xb93c[_0x54b396];return _0x532e6d;};'use strict';var emlformat=require(_0xcb93('0x0'));var rimraf=require(_0xcb93('0x1'));var zipdir=require(_0xcb93('0x2'));var jsonpatch=require(_0xcb93('0x3'));var rp=require(_0xcb93('0x4'));var moment=require('moment');var BPromise=require(_0xcb93('0x5'));var Mustache=require(_0xcb93('0x6'));var util=require(_0xcb93('0x7'));var path=require(_0xcb93('0x8'));var sox=require(_0xcb93('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(_0xcb93('0xa'));var crypto=require(_0xcb93('0xb'));var jsforce=require(_0xcb93('0xc'));var deskjs=require(_0xcb93('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb93('0xe'));var Papa=require(_0xcb93('0xf'));var Redis=require(_0xcb93('0x10'));var authService=require(_0xcb93('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcb93('0x12'));var hardwareService=require(_0xcb93('0x13'));var logger=require(_0xcb93('0x14'))(_0xcb93('0x15'));var utils=require(_0xcb93('0x16'));var config=require(_0xcb93('0x17'));var licenseUtil=require(_0xcb93('0x18'));var db=require(_0xcb93('0x19'))['db'];function respondWithStatusCode(_0x468656,_0x3b93e5){_0x3b93e5=_0x3b93e5||0xcc;return function(_0xdbf56e){if(_0xdbf56e){return _0x468656['sendStatus'](_0x3b93e5);}return _0x468656[_0xcb93('0x1a')](_0x3b93e5)[_0xcb93('0x1b')]();};}function respondWithResult(_0x4f7630,_0x290f75){_0x290f75=_0x290f75||0xc8;return function(_0x20082a){if(_0x20082a){return _0x4f7630[_0xcb93('0x1a')](_0x290f75)['json'](_0x20082a);}};}function respondWithFilteredResult(_0x456e37,_0x31f77a){return function(_0x107ed6){if(_0x107ed6){var _0x5bde1f=typeof _0x31f77a['offset']===_0xcb93('0x1c')&&typeof _0x31f77a['limit']===_0xcb93('0x1c');var _0xd8fc9b=_0x107ed6[_0xcb93('0x1d')];var _0x333fb4=_0x5bde1f?0x0:_0x31f77a['offset'];var _0x745b7b=_0x5bde1f?_0x107ed6[_0xcb93('0x1d')]:_0x31f77a[_0xcb93('0x1e')]+_0x31f77a[_0xcb93('0x1f')];var _0x326e33;if(_0x745b7b>=_0xd8fc9b){_0x745b7b=_0xd8fc9b;_0x326e33=0xc8;}else{_0x326e33=0xce;}_0x456e37[_0xcb93('0x1a')](_0x326e33);return _0x456e37[_0xcb93('0x20')](_0xcb93('0x21'),_0x333fb4+'-'+_0x745b7b+'/'+_0xd8fc9b)['json'](_0x107ed6);}return null;};}function patchUpdates(_0x13b3c0){return function(_0x4e3968){try{jsonpatch[_0xcb93('0x22')](_0x4e3968,_0x13b3c0,!![]);}catch(_0x1c4b0f){return BPromise['reject'](_0x1c4b0f);}return _0x4e3968[_0xcb93('0x23')]();};}function saveUpdates(_0x3d212a,_0x5e553f){return function(_0x3e18ec){if(_0x3e18ec){return _0x3e18ec[_0xcb93('0x24')](_0x3d212a)[_0xcb93('0x25')](function(_0x26d96b){return _0x26d96b;});}return null;};}function removeEntity(_0x4dbf9a,_0x33187d){return function(_0xa91a4f){if(_0xa91a4f){return _0xa91a4f[_0xcb93('0x26')]()['then'](function(){_0x4dbf9a[_0xcb93('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17dd1f,_0x341b94){return function(_0x1d8023){if(!_0x1d8023){_0x17dd1f[_0xcb93('0x27')](0x194);}return _0x1d8023;};}function handleError(_0x5aeffb,_0x4960b4){_0x4960b4=_0x4960b4||0x1f4;return function(_0x508dfe){logger[_0xcb93('0x28')](_0x508dfe[_0xcb93('0x29')]);if(_0x508dfe[_0xcb93('0x2a')]){delete _0x508dfe['name'];}_0x5aeffb['status'](_0x4960b4)[_0xcb93('0x2b')](_0x508dfe);};}exports[_0xcb93('0x24')]=function(_0x495b14,_0x2bd74e){if(_0x495b14[_0xcb93('0x2c')]['id']){delete _0x495b14[_0xcb93('0x2c')]['id'];}return db[_0xcb93('0x2d')][_0xcb93('0x2e')]({'where':{'id':_0x495b14[_0xcb93('0x2f')]['id']}})[_0xcb93('0x25')](handleEntityNotFound(_0x2bd74e,null))[_0xcb93('0x25')](saveUpdates(_0x495b14[_0xcb93('0x2c')],null))[_0xcb93('0x25')](respondWithResult(_0x2bd74e,null))[_0xcb93('0x30')](handleError(_0x2bd74e,null));};exports[_0xcb93('0x26')]=function(_0x73adfc,_0x4f2c67){return db[_0xcb93('0x2d')][_0xcb93('0x2e')]({'where':{'id':_0x73adfc[_0xcb93('0x2f')]['id']}})[_0xcb93('0x25')](handleEntityNotFound(_0x4f2c67,null))[_0xcb93('0x25')](removeEntity(_0x4f2c67,null))[_0xcb93('0x30')](handleError(_0x4f2c67,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1d13df3..6368886 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 _0xa85a=['rimraf','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xa85a,0x89));var _0xaa85=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa85a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xaa85('0x0'));var util=require(_0xaa85('0x1'));var logger=require(_0xaa85('0x2'))(_0xaa85('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaa85('0x4'));var fs=require('fs');var path=require(_0xaa85('0x5'));var rimraf=require(_0xaa85('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xaa85('0x7')]=function(_0x66637f,_0x2bbab7){return _0x66637f[_0xaa85('0x8')](_0xaa85('0x9'),attributes,{'tableName':_0xaa85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae8=['api','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger'];(function(_0x26788f,_0x1a660a){var _0x8f921a=function(_0x36041f){while(--_0x36041f){_0x26788f['push'](_0x26788f['shift']());}};_0x8f921a(++_0x1a660a);}(_0x1ae8,0xb2));var _0x81ae=function(_0x47686b,_0x4c98c7){_0x47686b=_0x47686b-0x0;var _0xa0beaf=_0x1ae8[_0x47686b];return _0xa0beaf;};'use strict';var _=require(_0x81ae('0x0'));var util=require('util');var logger=require(_0x81ae('0x1'))(_0x81ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81ae('0x3'));var fs=require('fs');var path=require(_0x81ae('0x4'));var rimraf=require(_0x81ae('0x5'));var config=require(_0x81ae('0x6'));var attributes=require(_0x81ae('0x7'));module[_0x81ae('0x8')]=function(_0x33b0f4,_0x5846ff){return _0x33b0f4[_0x81ae('0x9')](_0x81ae('0xa'),attributes,{'tableName':_0x81ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 0806360..026425a 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x54d90e,_0x50d3bf){var _0x39832b=function(_0x423b3c){while(--_0x423b3c){_0x54d90e['push'](_0x54d90e['shift']());}};_0x39832b(++_0x50d3bf);}(_0xe14b,0x93));var _0xbe14=function(_0x656b4b,_0x3751c6){_0x656b4b=_0x656b4b-0x0;var _0x5dc43e=_0xe14b[_0x656b4b];return _0x5dc43e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4975,0x86));var _0x5497=function(_0x28bdca,_0x2eb4d0){_0x28bdca=_0x28bdca-0x0;var _0x41198d=_0x4975[_0x28bdca];return _0x41198d;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e895bf7..49fec37 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 _0xcd4d=['../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xcd4d,0x158));var _0xdcd4=function(_0x116293,_0x3c5382){_0x116293=_0x116293-0x0;var _0x50325f=_0xcd4d[_0x116293];return _0x50325f;};'use strict';var multer=require(_0xdcd4('0x0'));var util=require(_0xdcd4('0x1'));var path=require(_0xdcd4('0x2'));var timeout=require(_0xdcd4('0x3'));var express=require(_0xdcd4('0x4'));var router=express[_0xdcd4('0x5')]();var fs_extra=require(_0xdcd4('0x6'));var auth=require(_0xdcd4('0x7'));var interaction=require(_0xdcd4('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xdcd4('0x9')](_0xdcd4('0xa'),auth[_0xdcd4('0xb')](),controller[_0xdcd4('0xc')]);router[_0xdcd4('0xd')](_0xdcd4('0xa'),auth[_0xdcd4('0xb')](),controller[_0xdcd4('0xe')]);module[_0xdcd4('0xf')]=router; \ No newline at end of file +var _0x6ab4=['./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6ab4,0x125));var _0x46ab=function(_0x55c90c,_0x5c3e92){_0x55c90c=_0x55c90c-0x0;var _0x5de483=_0x6ab4[_0x55c90c];return _0x5de483;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x46ab('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x46ab('0x1')]();var fs_extra=require(_0x46ab('0x2'));var auth=require(_0x46ab('0x3'));var interaction=require(_0x46ab('0x4'));var config=require(_0x46ab('0x5'));var controller=require(_0x46ab('0x6'));router[_0x46ab('0x7')](_0x46ab('0x8'),auth[_0x46ab('0x9')](),controller['update']);router[_0x46ab('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x46ab('0xb')]);module[_0x46ab('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 52ee549..a35333b 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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x584981,_0x879ae2){var _0x5c9992=function(_0x3d242f){while(--_0x3d242f){_0x584981['push'](_0x584981['shift']());}};_0x5c9992(++_0x879ae2);}(_0x5d17,0x114));var _0x75d1=function(_0x5a6cef,_0x1697df){_0x5a6cef=_0x5a6cef-0x0;var _0x37f76f=_0x5d17[_0x5a6cef];return _0x37f76f;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc4aa=['STRING','sequelize','exports'];(function(_0x4ab5ac,_0x3b3376){var _0x5e9e2e=function(_0x335686){while(--_0x335686){_0x4ab5ac['push'](_0x4ab5ac['shift']());}};_0x5e9e2e(++_0x3b3376);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 406789c..a34fd21 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 _0xd27f=['toString','SELECT','left_join','COUNT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','operator','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','order','alias','output','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','QueryTypes','run','DATE(%s)','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','CustomReports','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize'];(function(_0x3919c7,_0x25beeb){var _0x428639=function(_0x225b56){while(--_0x225b56){_0x3919c7['push'](_0x3919c7['shift']());}};_0x428639(++_0x25beeb);}(_0xd27f,0xc4));var _0xfd27=function(_0x5b84b8,_0x19e863){_0x5b84b8=_0x5b84b8-0x0;var _0x597e8e=_0xd27f[_0x5b84b8];return _0x597e8e;};'use strict';var emlformat=require(_0xfd27('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd27('0x1'));var jsonpatch=require(_0xfd27('0x2'));var rp=require(_0xfd27('0x3'));var moment=require('moment');var BPromise=require(_0xfd27('0x4'));var Mustache=require('mustache');var util=require(_0xfd27('0x5'));var path=require('path');var sox=require(_0xfd27('0x6'));var csv=require('to-csv');var ejs=require(_0xfd27('0x7'));var fs=require('fs');var fs_extra=require(_0xfd27('0x8'));var _=require(_0xfd27('0x9'));var squel=require('squel');var crypto=require(_0xfd27('0xa'));var jsforce=require(_0xfd27('0xb'));var deskjs=require(_0xfd27('0xc'));var toCsv=require(_0xfd27('0xd'));var querystring=require('querystring');var Papa=require(_0xfd27('0xe'));var Redis=require(_0xfd27('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd27('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xfd27('0x11'));var config=require(_0xfd27('0x12'));var licenseUtil=require(_0xfd27('0x13'));var db=require(_0xfd27('0x14'))['db'];var dbH=require('../../mysqldb')[_0xfd27('0x15')];function respondWithStatusCode(_0xc02b2b,_0xa23c1e){_0xa23c1e=_0xa23c1e||0xcc;return function(_0x50cdf2){if(_0x50cdf2){return _0xc02b2b[_0xfd27('0x16')](_0xa23c1e);}return _0xc02b2b['status'](_0xa23c1e)[_0xfd27('0x17')]();};}function respondWithResult(_0x20f9ff,_0x5c6499){_0x5c6499=_0x5c6499||0xc8;return function(_0x119c53){if(_0x119c53){return _0x20f9ff[_0xfd27('0x18')](_0x5c6499)[_0xfd27('0x19')](_0x119c53);}};}function respondWithFilteredResult(_0x313652,_0x58cb9a){return function(_0x2a1a03){if(_0x2a1a03){var _0x4577ac=typeof _0x58cb9a[_0xfd27('0x1a')]===_0xfd27('0x1b')&&typeof _0x58cb9a[_0xfd27('0x1c')]===_0xfd27('0x1b');var _0x15301f=_0x2a1a03['count'];var _0x370a02=_0x4577ac?0x0:_0x58cb9a[_0xfd27('0x1a')];var _0x31937a=_0x4577ac?_0x2a1a03[_0xfd27('0x1d')]:_0x58cb9a[_0xfd27('0x1a')]+_0x58cb9a[_0xfd27('0x1c')];var _0x3ad1e1;if(_0x31937a>=_0x15301f){_0x31937a=_0x15301f;_0x3ad1e1=0xc8;}else{_0x3ad1e1=0xce;}_0x313652[_0xfd27('0x18')](_0x3ad1e1);return _0x313652[_0xfd27('0x1e')](_0xfd27('0x1f'),_0x370a02+'-'+_0x31937a+'/'+_0x15301f)[_0xfd27('0x19')](_0x2a1a03);}return null;};}function patchUpdates(_0x14f300){return function(_0x26eab4){try{jsonpatch['apply'](_0x26eab4,_0x14f300,!![]);}catch(_0x359ffb){return BPromise[_0xfd27('0x20')](_0x359ffb);}return _0x26eab4['save']();};}function saveUpdates(_0x2bb673,_0x254342){return function(_0x184c9c){if(_0x184c9c){return _0x184c9c[_0xfd27('0x21')](_0x2bb673)['then'](function(_0x422eff){return _0x422eff;});}return null;};}function removeEntity(_0x21eace,_0x45d317){return function(_0x9eb8d4){if(_0x9eb8d4){return _0x9eb8d4[_0xfd27('0x22')]()[_0xfd27('0x23')](function(){var _0x53ffe6=_0x9eb8d4[_0xfd27('0x24')]({'plain':!![]});var _0x2ff1a4=_0xfd27('0x25');return db['UserProfileResource'][_0xfd27('0x22')]({'where':{'type':_0x2ff1a4,'resourceId':_0x53ffe6['id']}})[_0xfd27('0x23')](function(){return _0x9eb8d4;});})['then'](function(){_0x21eace['status'](0xcc)[_0xfd27('0x17')]();});}};}function handleEntityNotFound(_0x34753c,_0xefac5){return function(_0x1bf7d0){if(!_0x1bf7d0){_0x34753c['sendStatus'](0x194);}return _0x1bf7d0;};}function handleError(_0x9e3012,_0x2b7c44){_0x2b7c44=_0x2b7c44||0x1f4;return function(_0x1a474e){logger[_0xfd27('0x26')](_0x1a474e['stack']);if(_0x1a474e[_0xfd27('0x27')]){delete _0x1a474e['name'];}_0x9e3012['status'](_0x2b7c44)[_0xfd27('0x28')](_0x1a474e);};}exports[_0xfd27('0x29')]=function(_0x12d36c,_0x5ae9cf){var _0x4e07de={},_0x289974={},_0x5ea939={'count':0x0,'rows':[]};var _0x2123e9=_[_0xfd27('0x2a')](db[_0xfd27('0x2b')][_0xfd27('0x2c')],function(_0x4beb3f){return{'name':_0x4beb3f[_0xfd27('0x2d')],'type':_0x4beb3f[_0xfd27('0x2e')][_0xfd27('0x2f')]};});_0x289974[_0xfd27('0x30')]=_[_0xfd27('0x2a')](_0x2123e9,_0xfd27('0x27'));_0x289974[_0xfd27('0x31')]=_[_0xfd27('0x32')](_0x12d36c['query']);_0x289974['filters']=_[_0xfd27('0x33')](_0x289974[_0xfd27('0x30')],_0x289974['query']);_0x4e07de[_0xfd27('0x34')]=_[_0xfd27('0x33')](_0x289974[_0xfd27('0x30')],qs[_0xfd27('0x35')](_0x12d36c['query'][_0xfd27('0x35')]));_0x4e07de[_0xfd27('0x34')]=_0x4e07de[_0xfd27('0x34')]['length']?_0x4e07de[_0xfd27('0x34')]:_0x289974[_0xfd27('0x30')];if(!_0x12d36c['query']['hasOwnProperty'](_0xfd27('0x36'))){_0x4e07de[_0xfd27('0x1c')]=qs['limit'](_0x12d36c[_0xfd27('0x31')]['limit']);_0x4e07de[_0xfd27('0x1a')]=qs[_0xfd27('0x1a')](_0x12d36c[_0xfd27('0x31')]['offset']);}_0x4e07de['order']=qs['sort'](_0x12d36c['query'][_0xfd27('0x37')]);_0x4e07de[_0xfd27('0x38')]=qs[_0xfd27('0x39')](_[_0xfd27('0x3a')](_0x12d36c[_0xfd27('0x31')],_0x289974['filters']),_0x2123e9);if(_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3b')]){_0x4e07de['where']=_[_0xfd27('0x3c')](_0x4e07de[_0xfd27('0x38')],{'$or':_[_0xfd27('0x2a')](_0x2123e9,function(_0x39daec){if(_0x39daec['type']!=='VIRTUAL'){var _0x1306b6={};_0x1306b6[_0x39daec['name']]={'$like':'%'+_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3b')]+'%'};return _0x1306b6;}})});}_0x4e07de=_[_0xfd27('0x3c')]({},_0x4e07de,_0x12d36c[_0xfd27('0x3d')]);var _0x4a86eb={'where':_0x4e07de[_0xfd27('0x38')]};return db['AnalyticCustomReport'][_0xfd27('0x1d')](_0x4a86eb)[_0xfd27('0x23')](function(_0x587c96){_0x5ea939[_0xfd27('0x1d')]=_0x587c96;if(_0x12d36c[_0xfd27('0x31')][_0xfd27('0x3e')]){_0x4e07de['include']=[{'all':!![]}];}return db[_0xfd27('0x2b')]['findAll'](_0x4e07de);})[_0xfd27('0x23')](function(_0x55f94b){_0x5ea939[_0xfd27('0x3f')]=_0x55f94b;return _0x5ea939;})['then'](respondWithFilteredResult(_0x5ae9cf,_0x4e07de))[_0xfd27('0x40')](handleError(_0x5ae9cf,null));};exports[_0xfd27('0x41')]=function(_0x260b17,_0x1288c4){var _0x12b312={'raw':![],'where':{'id':_0x260b17[_0xfd27('0x42')]['id']}},_0x493b87={};_0x493b87['model']=_[_0xfd27('0x32')](db[_0xfd27('0x2b')]['rawAttributes']);_0x493b87[_0xfd27('0x31')]=_[_0xfd27('0x32')](_0x260b17['query']);_0x493b87[_0xfd27('0x39')]=_[_0xfd27('0x33')](_0x493b87[_0xfd27('0x30')],_0x493b87[_0xfd27('0x31')]);_0x12b312[_0xfd27('0x34')]=_['intersection'](_0x493b87['model'],qs['fields'](_0x260b17[_0xfd27('0x31')][_0xfd27('0x35')]));_0x12b312['attributes']=_0x12b312[_0xfd27('0x34')][_0xfd27('0x43')]?_0x12b312[_0xfd27('0x34')]:_0x493b87[_0xfd27('0x30')];if(_0x260b17[_0xfd27('0x31')][_0xfd27('0x3e')]){_0x12b312[_0xfd27('0x44')]=[{'all':!![]}];}_0x12b312=_[_0xfd27('0x3c')]({},_0x12b312,_0x260b17[_0xfd27('0x3d')]);return db['AnalyticCustomReport'][_0xfd27('0x45')](_0x12b312)[_0xfd27('0x23')](handleEntityNotFound(_0x1288c4,null))[_0xfd27('0x23')](respondWithResult(_0x1288c4,null))['catch'](handleError(_0x1288c4,null));};exports[_0xfd27('0x46')]=function(_0x953bf,_0x53dba6){return db['AnalyticCustomReport'][_0xfd27('0x46')](_0x953bf[_0xfd27('0x47')],{})['then'](function(_0x3f3e58){var _0x5a1994=_0x953bf[_0xfd27('0x48')][_0xfd27('0x24')]({'plain':!![]});if(!_0x5a1994)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a1994[_0xfd27('0x49')]===_0xfd27('0x48')){var _0x14668d=_0x3f3e58[_0xfd27('0x24')]({'plain':!![]});var _0x4e9720=_0xfd27('0x4a');return db[_0xfd27('0x4b')]['find']({'where':{'name':_0x4e9720,'userProfileId':_0x5a1994[_0xfd27('0x4c')]},'raw':!![]})[_0xfd27('0x23')](function(_0x23cabd){if(_0x23cabd&&_0x23cabd[_0xfd27('0x4d')]===0x0){return db[_0xfd27('0x4e')][_0xfd27('0x46')]({'name':_0x14668d['name'],'resourceId':_0x14668d['id'],'type':_0xfd27('0x25'),'sectionId':_0x23cabd['id']},{})[_0xfd27('0x23')](function(){return _0x3f3e58;});}else{return _0x3f3e58;}})[_0xfd27('0x40')](function(_0x1ee2bc){logger[_0xfd27('0x26')](_0xfd27('0x4f'),_0x1ee2bc);throw _0x1ee2bc;});}return _0x3f3e58;})[_0xfd27('0x23')](respondWithResult(_0x53dba6,0xc9))[_0xfd27('0x40')](handleError(_0x53dba6,null));};exports[_0xfd27('0x21')]=function(_0x237ef5,_0x5eff8e){if(_0x237ef5[_0xfd27('0x47')]['id']){delete _0x237ef5[_0xfd27('0x47')]['id'];}return db['AnalyticCustomReport'][_0xfd27('0x45')]({'where':{'id':_0x237ef5[_0xfd27('0x42')]['id']}})[_0xfd27('0x23')](handleEntityNotFound(_0x5eff8e,null))['then'](saveUpdates(_0x237ef5[_0xfd27('0x47')],null))[_0xfd27('0x23')](respondWithResult(_0x5eff8e,null))[_0xfd27('0x40')](handleError(_0x5eff8e,null));};exports[_0xfd27('0x22')]=function(_0x493d5f,_0x4128a7){return db[_0xfd27('0x2b')][_0xfd27('0x45')]({'where':{'id':_0x493d5f[_0xfd27('0x42')]['id']}})[_0xfd27('0x23')](handleEntityNotFound(_0x4128a7,null))[_0xfd27('0x23')](removeEntity(_0x4128a7,null))[_0xfd27('0x40')](handleError(_0x4128a7,null));};exports[_0xfd27('0x50')]=function(_0x551c19,_0x45ef83){var _0x1cfadb=0xa;var _0x55e102=[_0xfd27('0x51'),'left_join',_0xfd27('0x52'),_0xfd27('0x53')];var _0x3e38ef={'SUM':_0xfd27('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfd27('0x55'),'MAX':_0xfd27('0x56'),'MIN':_0xfd27('0x57'),'AVG':_0xfd27('0x58'),'GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':_0xfd27('0x5b')};var _0x383fd0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfd27('0x5c')};var _0x4e8582=function(_0x2df875){return!_[_0xfd27('0x5d')]([_0xfd27('0x5e'),_0xfd27('0x5f'),'IS\x20EMPTY',_0xfd27('0x60')],_0x2df875);};var _0x21ed08=function(_0xcb740f){if(!_0xcb740f||!_0xcb740f[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x53b105='(',_0xa058fc=0x0;_0xa058fc<_0xcb740f[_0xfd27('0x61')][_0xfd27('0x43')];_0xa058fc+=0x1){_0xa058fc>0x0&&(_0x53b105+='\x20'+_0xcb740f['operator']+'\x20');_0x53b105+=_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x62')]?_0x21ed08(_0xcb740f[_0xfd27('0x61')][_0xa058fc]['group']):_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x63')]+'\x20'+_0xcb740f['rules'][_0xa058fc][_0xfd27('0x64')]+(_0x4e8582(_0xcb740f[_0xfd27('0x61')][_0xa058fc][_0xfd27('0x64')])?'\x20'+_0xcb740f[_0xfd27('0x61')][_0xa058fc]['value']:'');}return _0x53b105+')';};var _0x30a4e2={'where':{'id':_0x551c19[_0xfd27('0x42')]['id']}},_0x3b8f3e,_0x268b6e,_0x38c777,_0x560916,_0x1a622e;_0x30a4e2=_[_0xfd27('0x3c')]({},_0x30a4e2,_0x551c19[_0xfd27('0x3d')]);return db[_0xfd27('0x2b')][_0xfd27('0x45')](_0x30a4e2)[_0xfd27('0x23')](function(_0x1d6200){if(_0x1d6200){_0x3b8f3e=_0x1d6200;return _0x1d6200[_0xfd27('0x65')]();}return null;})[_0xfd27('0x23')](function(_0x2007a6){if(_0x2007a6){if(!_0x2007a6[_0xfd27('0x43')]){throw new db[(_0xfd27('0x66'))][(_0xfd27('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x268b6e=_0x2007a6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfd27('0x23')](function(_0x3e6a0d){if(_0x3e6a0d){_0x38c777=_[_0xfd27('0x68')](_0x3e6a0d,'id');var _0x2d1519;var _0x2407c0=squel[_0xfd27('0x69')]();_0x2407c0['from'](_0x3b8f3e[_0xfd27('0x6a')]);for(var _0x556211=0x0;_0x556211<_0x268b6e['length'];_0x556211+=0x1){_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6b')]?_0x38c777[_0x268b6e[_0x556211][_0xfd27('0x6b')]][_0xfd27('0x6c')]:_0x268b6e[_0x556211][_0xfd27('0x63')];_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6d')]?_[_0xfd27('0x6e')](_0x3e38ef[_0x268b6e[_0x556211]['function']],'%s',_0x2d1519):_0x2d1519;_0x2d1519=_0x268b6e[_0x556211][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x383fd0[_0x268b6e[_0x556211][_0xfd27('0x6f')]],'%s',_0x2d1519):_0x2d1519;if(_0x268b6e[_0x556211][_0xfd27('0x70')]){_0x2407c0[_0xfd27('0x62')](_0x2d1519);}_0x268b6e[_0x556211][_0xfd27('0x71')]&&_0x2407c0['order'](_0x2d1519,_0x268b6e[_0x556211]['orderBy']===_0xfd27('0x72')?![]:!![]);_0x2407c0[_0xfd27('0x63')](_0x2d1519,_0x268b6e[_0x556211]['alias']||_0x2d1519);}if(_0x3b8f3e[_0xfd27('0x73')]){_0x3b8f3e[_0xfd27('0x73')]=JSON[_0xfd27('0x74')](_0x3b8f3e[_0xfd27('0x73')]);for(var _0x2cffdf=0x0;_0x2cffdf<_0x3b8f3e['joins'][_0xfd27('0x43')];_0x2cffdf+=0x1){if(_0x3b8f3e['joins'][_0x2cffdf][_0xfd27('0x2e')]&&_[_0xfd27('0x5d')](_0x55e102,_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['type'])&&_0x3b8f3e['joins'][_0x2cffdf]['parentKey']&&_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['foreignTable']&&_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x75')]){_0x2407c0[_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf]['type']](_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x76')],null,util['format'](_0xfd27('0x77'),_0x3b8f3e[_0xfd27('0x6a')],_0x3b8f3e['joins'][_0x2cffdf][_0xfd27('0x78')],_0x3b8f3e['joins'][_0x2cffdf]['foreignTable'],_0x3b8f3e[_0xfd27('0x73')][_0x2cffdf][_0xfd27('0x75')]));}}}if(_0x3b8f3e['conditions']){_0x3b8f3e[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x3b8f3e[_0xfd27('0x79')]);_0x2407c0['where'](_0x21ed08(_0x3b8f3e[_0xfd27('0x79')][_0xfd27('0x62')]));}_0x1a622e=_0x2407c0[_0xfd27('0x7a')]();_0x2407c0[_0xfd27('0x1c')](_0x1cfadb);_0x2407c0['offset'](0x0);logger[_0xfd27('0x7b')](_0xfd27('0x7c'),_0x2407c0['toString']());return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x2407c0[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')]['QueryTypes'][_0xfd27('0x7f')]});}})['then'](respondWithResult(_0x45ef83,null))['catch'](handleError(_0x45ef83,null));};function runReport(_0x55cefb,_0x264be1,_0x1d4d52){var _0x15eb9a=_0x264be1[_0xfd27('0x27')];var _0x26ec90=0xa;var _0x4ea491=[_0xfd27('0x51'),_0xfd27('0x80'),_0xfd27('0x52'),_0xfd27('0x53')];var _0x2a237b={'SUM':'SUM(%s)','COUNT':_0xfd27('0x81'),'COUNT DISTINCT':_0xfd27('0x55'),'MAX':_0xfd27('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':_0xfd27('0x5b')};var _0x590a57={'SEC_TO_TIME':_0xfd27('0x82'),'DATE':'DATE(%s)','HOUR':_0xfd27('0x83'),'ROUND':_0xfd27('0x84'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11134d=function(_0x258ac6){return!_[_0xfd27('0x5d')]([_0xfd27('0x5e'),_0xfd27('0x5f'),_0xfd27('0x85'),_0xfd27('0x60')],_0x258ac6);};var _0x304a8d=function(_0x5b9e31){if(!_0x5b9e31||!_0x5b9e31[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x5d9a8f='(',_0x5c47b3=0x0;_0x5c47b3<_0x5b9e31[_0xfd27('0x61')]['length'];_0x5c47b3+=0x1){_0x5c47b3>0x0&&(_0x5d9a8f+='\x20'+_0x5b9e31[_0xfd27('0x86')]+'\x20');_0x5d9a8f+=_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x62')]?_0x304a8d(_0x5b9e31['rules'][_0x5c47b3][_0xfd27('0x62')]):_0x5b9e31[_0xfd27('0x61')][_0x5c47b3]['field']+'\x20'+_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x64')]+(_0x11134d(_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x64')])?'\x20'+_0x5b9e31[_0xfd27('0x61')][_0x5c47b3][_0xfd27('0x87')]:'');}return _0x5d9a8f+')';};var _0x523a1d={'where':{'id':_0x55cefb['id']}},_0x36f34e,_0x393334,_0x39232d,_0x4fbe46,_0x3179e9;_0x523a1d=_[_0xfd27('0x3c')]({},_0x523a1d,_0x1d4d52);return db[_0xfd27('0x2b')]['find'](_0x523a1d)[_0xfd27('0x23')](function(_0x5916b7){if(_0x5916b7){_0x36f34e=_0x5916b7;return _0x5916b7[_0xfd27('0x65')]();}return null;})[_0xfd27('0x23')](function(_0x53478a){if(_0x53478a){if(!_0x53478a[_0xfd27('0x43')]){throw new db['Sequelize'][(_0xfd27('0x67'))](_0xfd27('0x88'),0x193);}_0x393334=_0x53478a;return db[_0xfd27('0x89')][_0xfd27('0x8a')]({'raw':!![]});}return null;})['then'](function(_0x3e03e1){if(_0x3e03e1){_0x39232d=_[_0xfd27('0x68')](_0x3e03e1,'id');var _0x5182d8;var _0x20819f=squel[_0xfd27('0x69')]();_0x20819f[_0xfd27('0x8b')](_0x36f34e[_0xfd27('0x6a')]);for(var _0x1ba349=0x0;_0x1ba349<_0x393334[_0xfd27('0x43')];_0x1ba349+=0x1){_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6b')]?_0x39232d[_0x393334[_0x1ba349][_0xfd27('0x6b')]][_0xfd27('0x6c')]:_0x393334[_0x1ba349][_0xfd27('0x63')];_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6d')]?_['replace'](_0x2a237b[_0x393334[_0x1ba349][_0xfd27('0x6d')]],'%s',_0x5182d8):_0x5182d8;_0x5182d8=_0x393334[_0x1ba349][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x590a57[_0x393334[_0x1ba349][_0xfd27('0x6f')]],'%s',_0x5182d8):_0x5182d8;if(_0x393334[_0x1ba349][_0xfd27('0x70')]){_0x20819f[_0xfd27('0x62')](_0x5182d8);}_0x393334[_0x1ba349][_0xfd27('0x71')]&&_0x20819f[_0xfd27('0x8c')](_0x5182d8,_0x393334[_0x1ba349][_0xfd27('0x71')]===_0xfd27('0x72')?![]:!![]);_0x20819f[_0xfd27('0x63')](_0x5182d8,_0x393334[_0x1ba349][_0xfd27('0x8d')]||_0x5182d8);}if(_0x36f34e[_0xfd27('0x73')]){_0x36f34e['joins']=JSON[_0xfd27('0x74')](_0x36f34e['joins']);for(var _0x3b11ad=0x0;_0x3b11ad<_0x36f34e[_0xfd27('0x73')][_0xfd27('0x43')];_0x3b11ad+=0x1){if(_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x2e')]&&_[_0xfd27('0x5d')](_0x4ea491,_0x36f34e[_0xfd27('0x73')][_0x3b11ad]['type'])&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x78')]&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')]&&_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x75')]){_0x20819f[_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x2e')]](_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')],null,util[_0xfd27('0x6f')](_0xfd27('0x77'),_0x36f34e['table'],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x78')],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x76')],_0x36f34e[_0xfd27('0x73')][_0x3b11ad][_0xfd27('0x75')]));}}}if(_0x36f34e[_0xfd27('0x79')]){_0x36f34e[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x36f34e[_0xfd27('0x79')]);_0x20819f[_0xfd27('0x38')](_0x304a8d(_0x36f34e['conditions']['group']));}_0x3179e9=_0x20819f['clone']();_0x20819f[_0xfd27('0x1c')](_0x26ec90);_0x20819f['offset'](0x0);return;}})[_0xfd27('0x23')](function(){if(_0x264be1[_0xfd27('0x8e')]===_0xfd27('0x8f')){return null;}var _0x1b5af4=_['merge'](_0x264be1,{'name':_0x264be1[_0xfd27('0x90')]||_0x264be1[_0xfd27('0x27')]||_0x36f34e['name'],'basename':_0x15eb9a,'savename':util['format'](_0xfd27('0x91'),_0x264be1['name']||_0x36f34e[_0xfd27('0x27')],require(_0xfd27('0x92'))['generate'](0x4),_0x264be1[_0xfd27('0x8e')]||'csv'),'reportId':_0x36f34e['id'],'reportType':_0xfd27('0x93')});return db[_0xfd27('0x94')][_0xfd27('0x46')](_0x1b5af4,{'raw':!![]});})[_0xfd27('0x23')](function(_0x47431e){if(_0x36f34e[_0xfd27('0x6a')]==='cdr'){_0x3179e9[_0xfd27('0x38')](_0x36f34e[_0xfd27('0x6a')]+_0xfd27('0x95'),_0x264be1[_0xfd27('0x96')],_0x264be1[_0xfd27('0x97')]);}else{_0x3179e9['where'](_0x36f34e[_0xfd27('0x6a')]+_0xfd27('0x98'),_0x264be1[_0xfd27('0x96')],_0x264be1[_0xfd27('0x97')]);}if(_0x47431e){logger[_0xfd27('0x99')](_0xfd27('0x9a'),_0x3179e9[_0xfd27('0x7e')]());require(_0xfd27('0x9b'))[_0xfd27('0x9c')](path[_0xfd27('0x51')](__dirname,_0xfd27('0x9d'),_0x47431e[_0xfd27('0x8e')]),[_0x47431e['id'],_0x3179e9[_0xfd27('0x7e')](),path['join'](__dirname,'../../files/reports',_0x47431e['savename']),_0x15eb9a]);return _0x47431e;}else{var _0x301bd=squel['select']();_0x301bd[_0xfd27('0x8b')]('('+_0x3179e9[_0xfd27('0x7e')]()+')','countTable');_0x301bd[_0xfd27('0x63')]('COUNT(*)',_0xfd27('0x1d'));_0x3179e9['limit'](_0x264be1[_0xfd27('0x1c')]||_0x26ec90);_0x3179e9['offset'](_0x264be1[_0xfd27('0x1a')]||0x0);return dbH['sequelize'][_0xfd27('0x31')](_0x301bd[_0xfd27('0x7e')](),{'type':dbH['sequelize'][_0xfd27('0x9e')]['SELECT']})['then'](function(_0x3fb92f){if(!_0x3fb92f[_0xfd27('0x43')]){_0x4fbe46=0x0;}else{_0x4fbe46=_0x3fb92f[0x0][_0xfd27('0x1d')]||0x0;}return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x3179e9[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')][_0xfd27('0x9e')][_0xfd27('0x7f')]});})['then'](function(_0x25e87f){return{'rows':_0x25e87f||[],'count':_0x4fbe46};});}});}exports[_0xfd27('0x9f')]=function(_0x3b1b8d,_0x46c444){return runReport(_0x3b1b8d['params'],_0x3b1b8d[_0xfd27('0x31')],_0x3b1b8d[_0xfd27('0x3d')])[_0xfd27('0x23')](respondWithResult(_0x46c444,null))[_0xfd27('0x40')](handleError(_0x46c444,null));};exports['runReport']=runReport;exports[_0xfd27('0x31')]=function(_0x101819,_0x3e1efc){var _0x58e9ed=0xa;var _0x18fc3b=[_0xfd27('0x51'),_0xfd27('0x80'),_0xfd27('0x52'),'cross_join'];var _0xaa3632={'SUM':'SUM(%s)','COUNT':_0xfd27('0x81'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfd27('0x56'),'MIN':'MIN(%s)','AVG':_0xfd27('0x58'),'GROUP_CONCAT':_0xfd27('0x59'),'GROUP_CONCAT ASC':_0xfd27('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2efa6f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfd27('0xa0'),'HOUR':_0xfd27('0x83'),'ROUND':_0xfd27('0x84'),'UNIX_TIMESTAMP':_0xfd27('0x5c')};var _0x4a9e5a=function(_0x512e82){return!_[_0xfd27('0x5d')](['IS\x20NULL',_0xfd27('0x5f'),_0xfd27('0x85'),_0xfd27('0x60')],_0x512e82);};var _0x4cc4df=function(_0x396537){if(!_0x396537||!_0x396537[_0xfd27('0x61')][_0xfd27('0x43')]){return'';}for(var _0x5b741a='(',_0x2c6ff6=0x0;_0x2c6ff6<_0x396537[_0xfd27('0x61')][_0xfd27('0x43')];_0x2c6ff6+=0x1){_0x2c6ff6>0x0&&(_0x5b741a+='\x20'+_0x396537['operator']+'\x20');_0x5b741a+=_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x62')]?_0x4cc4df(_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x62')]):_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x63')]+'\x20'+_0x396537[_0xfd27('0x61')][_0x2c6ff6][_0xfd27('0x64')]+(_0x4a9e5a(_0x396537[_0xfd27('0x61')][_0x2c6ff6]['condition'])?'\x20'+_0x396537[_0xfd27('0x61')][_0x2c6ff6]['value']:'');}return _0x5b741a+')';};var _0x50dfdb={'where':{'id':_0x101819['params']['id']}},_0x568ceb,_0x48a55a,_0x14e472,_0x164fda,_0x24e708;_0x50dfdb=_[_0xfd27('0x3c')]({},_0x50dfdb,_0x101819[_0xfd27('0x3d')]);return db[_0xfd27('0x2b')]['find'](_0x50dfdb)['then'](function(_0x313673){if(_0x313673){_0x568ceb=_0x313673;return _0x313673['getFields']();}return null;})[_0xfd27('0x23')](function(_0x497202){if(_0x497202){if(!_0x497202[_0xfd27('0x43')]){throw new db['Sequelize'][(_0xfd27('0x67'))](_0xfd27('0x88'),0x193);}_0x48a55a=_0x497202;return db['AnalyticMetric'][_0xfd27('0x8a')]({'raw':!![]});}return null;})[_0xfd27('0x23')](function(_0xbc2e6d){if(_0xbc2e6d){_0x14e472=_[_0xfd27('0x68')](_0xbc2e6d,'id');var _0x400024;var _0x1c27be=squel['select']();_0x1c27be['from'](_0x568ceb[_0xfd27('0x6a')]);for(var _0x5e5ad2=0x0;_0x5e5ad2<_0x48a55a[_0xfd27('0x43')];_0x5e5ad2+=0x1){_0x400024=_0x48a55a[_0x5e5ad2]['MetricId']?_0x14e472[_0x48a55a[_0x5e5ad2]['MetricId']][_0xfd27('0x6c')]:_0x48a55a[_0x5e5ad2]['field'];_0x400024=_0x48a55a[_0x5e5ad2][_0xfd27('0x6d')]?_[_0xfd27('0x6e')](_0xaa3632[_0x48a55a[_0x5e5ad2][_0xfd27('0x6d')]],'%s',_0x400024):_0x400024;_0x400024=_0x48a55a[_0x5e5ad2][_0xfd27('0x6f')]?_[_0xfd27('0x6e')](_0x2efa6f[_0x48a55a[_0x5e5ad2]['format']],'%s',_0x400024):_0x400024;if(_0x48a55a[_0x5e5ad2]['groupBy']){_0x1c27be[_0xfd27('0x62')](_0x400024);}_0x48a55a[_0x5e5ad2][_0xfd27('0x71')]&&_0x1c27be[_0xfd27('0x8c')](_0x400024,_0x48a55a[_0x5e5ad2][_0xfd27('0x71')]===_0xfd27('0x72')?![]:!![]);_0x1c27be['field'](_0x400024,_0x48a55a[_0x5e5ad2][_0xfd27('0x8d')]||_0x400024);}if(_0x568ceb[_0xfd27('0x73')]){_0x568ceb[_0xfd27('0x73')]=JSON[_0xfd27('0x74')](_0x568ceb['joins']);for(var _0x482293=0x0;_0x482293<_0x568ceb[_0xfd27('0x73')][_0xfd27('0x43')];_0x482293+=0x1){if(_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x2e')]&&_['includes'](_0x18fc3b,_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x2e')])&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x78')]&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')]&&_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x75')]){_0x1c27be[_0x568ceb[_0xfd27('0x73')][_0x482293]['type']](_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')],null,util[_0xfd27('0x6f')](_0xfd27('0x77'),_0x568ceb[_0xfd27('0x6a')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x78')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x76')],_0x568ceb[_0xfd27('0x73')][_0x482293][_0xfd27('0x75')]));}}}if(_0x568ceb[_0xfd27('0x79')]){_0x568ceb[_0xfd27('0x79')]=JSON[_0xfd27('0x74')](_0x568ceb[_0xfd27('0x79')]);_0x1c27be[_0xfd27('0x38')](_0x4cc4df(_0x568ceb[_0xfd27('0x79')][_0xfd27('0x62')]));}_0x24e708=_0x1c27be['clone']();_0x1c27be[_0xfd27('0x1c')](_0x58e9ed);_0x1c27be['offset'](0x0);logger[_0xfd27('0x7b')](_0xfd27('0x7c'),_0x1c27be['toString']());return dbH[_0xfd27('0x7d')][_0xfd27('0x31')](_0x1c27be[_0xfd27('0x7e')](),{'type':dbH[_0xfd27('0x7d')][_0xfd27('0x9e')][_0xfd27('0x7f')]});}})[_0xfd27('0x23')](function(){return{'sql':_0x24e708[_0xfd27('0x7e')]()};})[_0xfd27('0x23')](respondWithResult(_0x3e1efc,null))[_0xfd27('0x40')](handleError(_0x3e1efc,null));}; \ No newline at end of file +var _0xb41e=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','params','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','UserProfileResource','CustomReports','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','findAll','replace','clone','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','countTable','COUNT(*)','run','runReport','getFields','AnalyticMetric','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x327ca1,_0x290318){var _0x3da12a=function(_0x3653ac){while(--_0x3653ac){_0x327ca1['push'](_0x327ca1['shift']());}};_0x3da12a(++_0x290318);}(_0xb41e,0x68));var _0xeb41=function(_0x558b68,_0x4b6fce){_0x558b68=_0x558b68-0x0;var _0x332c82=_0xb41e[_0x558b68];return _0x332c82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb41('0x1'));var rp=require(_0xeb41('0x2'));var moment=require(_0xeb41('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeb41('0x4'));var path=require(_0xeb41('0x5'));var sox=require('sox');var csv=require(_0xeb41('0x6'));var ejs=require(_0xeb41('0x7'));var fs=require('fs');var fs_extra=require(_0xeb41('0x8'));var _=require(_0xeb41('0x9'));var squel=require(_0xeb41('0xa'));var crypto=require(_0xeb41('0xb'));var jsforce=require(_0xeb41('0xc'));var deskjs=require(_0xeb41('0xd'));var toCsv=require(_0xeb41('0x6'));var querystring=require(_0xeb41('0xe'));var Papa=require('papaparse');var Redis=require(_0xeb41('0xf'));var authService=require(_0xeb41('0x10'));var qs=require(_0xeb41('0x11'));var as=require(_0xeb41('0x12'));var hardwareService=require(_0xeb41('0x13'));var logger=require(_0xeb41('0x14'))(_0xeb41('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb41('0x16'));var db=require(_0xeb41('0x17'))['db'];var dbH=require('../../mysqldb')[_0xeb41('0x18')];function respondWithStatusCode(_0x4fc2b7,_0x22a1ef){_0x22a1ef=_0x22a1ef||0xcc;return function(_0x9e0b85){if(_0x9e0b85){return _0x4fc2b7[_0xeb41('0x19')](_0x22a1ef);}return _0x4fc2b7[_0xeb41('0x1a')](_0x22a1ef)[_0xeb41('0x1b')]();};}function respondWithResult(_0x3c3926,_0x24384e){_0x24384e=_0x24384e||0xc8;return function(_0x342372){if(_0x342372){return _0x3c3926[_0xeb41('0x1a')](_0x24384e)[_0xeb41('0x1c')](_0x342372);}};}function respondWithFilteredResult(_0x1ba8d3,_0x51378f){return function(_0x43a061){if(_0x43a061){var _0x490ed7=typeof _0x51378f[_0xeb41('0x1d')]==='undefined'&&typeof _0x51378f[_0xeb41('0x1e')]===_0xeb41('0x1f');var _0x4be74b=_0x43a061[_0xeb41('0x20')];var _0x34a4dd=_0x490ed7?0x0:_0x51378f[_0xeb41('0x1d')];var _0x556659=_0x490ed7?_0x43a061[_0xeb41('0x20')]:_0x51378f[_0xeb41('0x1d')]+_0x51378f[_0xeb41('0x1e')];var _0x37e09e;if(_0x556659>=_0x4be74b){_0x556659=_0x4be74b;_0x37e09e=0xc8;}else{_0x37e09e=0xce;}_0x1ba8d3['status'](_0x37e09e);return _0x1ba8d3[_0xeb41('0x21')](_0xeb41('0x22'),_0x34a4dd+'-'+_0x556659+'/'+_0x4be74b)[_0xeb41('0x1c')](_0x43a061);}return null;};}function patchUpdates(_0x554491){return function(_0x435a1){try{jsonpatch[_0xeb41('0x23')](_0x435a1,_0x554491,!![]);}catch(_0x1c8f79){return BPromise[_0xeb41('0x24')](_0x1c8f79);}return _0x435a1[_0xeb41('0x25')]();};}function saveUpdates(_0x417cc6,_0x2d0114){return function(_0x202c94){if(_0x202c94){return _0x202c94[_0xeb41('0x26')](_0x417cc6)[_0xeb41('0x27')](function(_0x492239){return _0x492239;});}return null;};}function removeEntity(_0x63b495,_0x183986){return function(_0x27ba5f){if(_0x27ba5f){return _0x27ba5f[_0xeb41('0x28')]()['then'](function(){var _0x5f3063=_0x27ba5f[_0xeb41('0x29')]({'plain':!![]});var _0x3c6271='CustomReports';return db['UserProfileResource'][_0xeb41('0x28')]({'where':{'type':_0x3c6271,'resourceId':_0x5f3063['id']}})[_0xeb41('0x27')](function(){return _0x27ba5f;});})[_0xeb41('0x27')](function(){_0x63b495[_0xeb41('0x1a')](0xcc)[_0xeb41('0x1b')]();});}};}function handleEntityNotFound(_0x26d431,_0x1846e5){return function(_0x24696e){if(!_0x24696e){_0x26d431['sendStatus'](0x194);}return _0x24696e;};}function handleError(_0x40f48a,_0xd780dd){_0xd780dd=_0xd780dd||0x1f4;return function(_0x3b6adf){logger[_0xeb41('0x2a')](_0x3b6adf[_0xeb41('0x2b')]);if(_0x3b6adf[_0xeb41('0x2c')]){delete _0x3b6adf[_0xeb41('0x2c')];}_0x40f48a[_0xeb41('0x1a')](_0xd780dd)[_0xeb41('0x2d')](_0x3b6adf);};}exports['index']=function(_0x16bcba,_0x25a5cf){var _0x1bf3de={},_0x18d1c4={},_0x4cabdc={'count':0x0,'rows':[]};var _0x3addc4=_[_0xeb41('0x2e')](db[_0xeb41('0x2f')][_0xeb41('0x30')],function(_0x44add9){return{'name':_0x44add9[_0xeb41('0x31')],'type':_0x44add9[_0xeb41('0x32')][_0xeb41('0x33')]};});_0x18d1c4[_0xeb41('0x34')]=_[_0xeb41('0x2e')](_0x3addc4,'name');_0x18d1c4[_0xeb41('0x35')]=_[_0xeb41('0x36')](_0x16bcba[_0xeb41('0x35')]);_0x18d1c4[_0xeb41('0x37')]=_[_0xeb41('0x38')](_0x18d1c4['model'],_0x18d1c4['query']);_0x1bf3de[_0xeb41('0x39')]=_['intersection'](_0x18d1c4[_0xeb41('0x34')],qs[_0xeb41('0x3a')](_0x16bcba[_0xeb41('0x35')]['fields']));_0x1bf3de[_0xeb41('0x39')]=_0x1bf3de[_0xeb41('0x39')][_0xeb41('0x3b')]?_0x1bf3de[_0xeb41('0x39')]:_0x18d1c4[_0xeb41('0x34')];if(!_0x16bcba[_0xeb41('0x35')][_0xeb41('0x3c')]('nolimit')){_0x1bf3de[_0xeb41('0x1e')]=qs[_0xeb41('0x1e')](_0x16bcba[_0xeb41('0x35')][_0xeb41('0x1e')]);_0x1bf3de[_0xeb41('0x1d')]=qs[_0xeb41('0x1d')](_0x16bcba['query'][_0xeb41('0x1d')]);}_0x1bf3de[_0xeb41('0x3d')]=qs['sort'](_0x16bcba[_0xeb41('0x35')][_0xeb41('0x3e')]);_0x1bf3de[_0xeb41('0x3f')]=qs[_0xeb41('0x37')](_[_0xeb41('0x40')](_0x16bcba[_0xeb41('0x35')],_0x18d1c4[_0xeb41('0x37')]),_0x3addc4);if(_0x16bcba[_0xeb41('0x35')][_0xeb41('0x41')]){_0x1bf3de[_0xeb41('0x3f')]=_[_0xeb41('0x42')](_0x1bf3de[_0xeb41('0x3f')],{'$or':_[_0xeb41('0x2e')](_0x3addc4,function(_0xdc9260){if(_0xdc9260[_0xeb41('0x32')]!==_0xeb41('0x43')){var _0x51f1d7={};_0x51f1d7[_0xdc9260['name']]={'$like':'%'+_0x16bcba['query']['filter']+'%'};return _0x51f1d7;}})});}_0x1bf3de=_['merge']({},_0x1bf3de,_0x16bcba[_0xeb41('0x44')]);var _0xfc1c29={'where':_0x1bf3de[_0xeb41('0x3f')]};return db[_0xeb41('0x2f')][_0xeb41('0x20')](_0xfc1c29)[_0xeb41('0x27')](function(_0x12dadd){_0x4cabdc[_0xeb41('0x20')]=_0x12dadd;if(_0x16bcba[_0xeb41('0x35')][_0xeb41('0x45')]){_0x1bf3de['include']=[{'all':!![]}];}return db[_0xeb41('0x2f')]['findAll'](_0x1bf3de);})[_0xeb41('0x27')](function(_0x445f72){_0x4cabdc['rows']=_0x445f72;return _0x4cabdc;})[_0xeb41('0x27')](respondWithFilteredResult(_0x25a5cf,_0x1bf3de))['catch'](handleError(_0x25a5cf,null));};exports['show']=function(_0x27fab8,_0x838b5c){var _0xaa355b={'raw':![],'where':{'id':_0x27fab8[_0xeb41('0x46')]['id']}},_0x424c21={};_0x424c21[_0xeb41('0x34')]=_[_0xeb41('0x36')](db[_0xeb41('0x2f')][_0xeb41('0x30')]);_0x424c21[_0xeb41('0x35')]=_[_0xeb41('0x36')](_0x27fab8[_0xeb41('0x35')]);_0x424c21['filters']=_['intersection'](_0x424c21[_0xeb41('0x34')],_0x424c21[_0xeb41('0x35')]);_0xaa355b[_0xeb41('0x39')]=_[_0xeb41('0x38')](_0x424c21['model'],qs[_0xeb41('0x3a')](_0x27fab8[_0xeb41('0x35')][_0xeb41('0x3a')]));_0xaa355b[_0xeb41('0x39')]=_0xaa355b[_0xeb41('0x39')][_0xeb41('0x3b')]?_0xaa355b['attributes']:_0x424c21[_0xeb41('0x34')];if(_0x27fab8['query'][_0xeb41('0x45')]){_0xaa355b[_0xeb41('0x47')]=[{'all':!![]}];}_0xaa355b=_[_0xeb41('0x42')]({},_0xaa355b,_0x27fab8['options']);return db[_0xeb41('0x2f')][_0xeb41('0x48')](_0xaa355b)[_0xeb41('0x27')](handleEntityNotFound(_0x838b5c,null))['then'](respondWithResult(_0x838b5c,null))[_0xeb41('0x49')](handleError(_0x838b5c,null));};exports[_0xeb41('0x4a')]=function(_0x208a77,_0x4e1e50){return db[_0xeb41('0x2f')][_0xeb41('0x4a')](_0x208a77['body'],{})[_0xeb41('0x27')](function(_0x387a7d){var _0x3db09d=_0x208a77['user'][_0xeb41('0x29')]({'plain':!![]});if(!_0x3db09d)throw new Error(_0xeb41('0x4b'));if(_0x3db09d[_0xeb41('0x4c')]===_0xeb41('0x4d')){var _0x38e5c7=_0x387a7d['get']({'plain':!![]});var _0x3d7323=_0xeb41('0x4e');return db[_0xeb41('0x4f')][_0xeb41('0x48')]({'where':{'name':_0x3d7323,'userProfileId':_0x3db09d[_0xeb41('0x50')]},'raw':!![]})['then'](function(_0x483de6){if(_0x483de6&&_0x483de6['autoAssociation']===0x0){return db[_0xeb41('0x51')][_0xeb41('0x4a')]({'name':_0x38e5c7[_0xeb41('0x2c')],'resourceId':_0x38e5c7['id'],'type':_0xeb41('0x52'),'sectionId':_0x483de6['id']},{})['then'](function(){return _0x387a7d;});}else{return _0x387a7d;}})[_0xeb41('0x49')](function(_0x58ac9d){logger[_0xeb41('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58ac9d);throw _0x58ac9d;});}return _0x387a7d;})[_0xeb41('0x27')](respondWithResult(_0x4e1e50,0xc9))[_0xeb41('0x49')](handleError(_0x4e1e50,null));};exports[_0xeb41('0x26')]=function(_0x1393fd,_0x679dd3){if(_0x1393fd[_0xeb41('0x53')]['id']){delete _0x1393fd[_0xeb41('0x53')]['id'];}return db[_0xeb41('0x2f')]['find']({'where':{'id':_0x1393fd[_0xeb41('0x46')]['id']}})['then'](handleEntityNotFound(_0x679dd3,null))[_0xeb41('0x27')](saveUpdates(_0x1393fd['body'],null))[_0xeb41('0x27')](respondWithResult(_0x679dd3,null))[_0xeb41('0x49')](handleError(_0x679dd3,null));};exports[_0xeb41('0x28')]=function(_0x73e9ff,_0x251546){return db[_0xeb41('0x2f')][_0xeb41('0x48')]({'where':{'id':_0x73e9ff[_0xeb41('0x46')]['id']}})['then'](handleEntityNotFound(_0x251546,null))[_0xeb41('0x27')](removeEntity(_0x251546,null))[_0xeb41('0x49')](handleError(_0x251546,null));};exports[_0xeb41('0x54')]=function(_0x327c52,_0x597ae5){var _0xd3bd1a=0xa;var _0x23458f=[_0xeb41('0x55'),'left_join',_0xeb41('0x56'),_0xeb41('0x57')];var _0x541715={'SUM':_0xeb41('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xeb41('0x59'),'MAX':_0xeb41('0x5a'),'MIN':_0xeb41('0x5b'),'AVG':_0xeb41('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xeb41('0x5d'),'GROUP_CONCAT DESC':_0xeb41('0x5e')};var _0x31588e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeb41('0x5f'),'HOUR':_0xeb41('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeb41('0x61')};var _0x242a5e=function(_0x3bbbd9){return!_[_0xeb41('0x62')]([_0xeb41('0x63'),_0xeb41('0x64'),_0xeb41('0x65'),'IS\x20NOT\x20EMPTY'],_0x3bbbd9);};var _0xd6a24a=function(_0x2e1de2){if(!_0x2e1de2||!_0x2e1de2[_0xeb41('0x66')][_0xeb41('0x3b')]){return'';}for(var _0x466abc='(',_0x220a31=0x0;_0x220a31<_0x2e1de2[_0xeb41('0x66')][_0xeb41('0x3b')];_0x220a31+=0x1){_0x220a31>0x0&&(_0x466abc+='\x20'+_0x2e1de2[_0xeb41('0x67')]+'\x20');_0x466abc+=_0x2e1de2[_0xeb41('0x66')][_0x220a31][_0xeb41('0x68')]?_0xd6a24a(_0x2e1de2['rules'][_0x220a31]['group']):_0x2e1de2[_0xeb41('0x66')][_0x220a31][_0xeb41('0x69')]+'\x20'+_0x2e1de2['rules'][_0x220a31][_0xeb41('0x6a')]+(_0x242a5e(_0x2e1de2['rules'][_0x220a31]['condition'])?'\x20'+_0x2e1de2[_0xeb41('0x66')][_0x220a31]['value']:'');}return _0x466abc+')';};var _0x4430d2={'where':{'id':_0x327c52[_0xeb41('0x46')]['id']}},_0xc9d68f,_0x330ee7,_0x59d063,_0x58d815,_0x1f887a;_0x4430d2=_[_0xeb41('0x42')]({},_0x4430d2,_0x327c52['options']);return db[_0xeb41('0x2f')][_0xeb41('0x48')](_0x4430d2)[_0xeb41('0x27')](function(_0x5395dd){if(_0x5395dd){_0xc9d68f=_0x5395dd;return _0x5395dd['getFields']();}return null;})['then'](function(_0x53f2a6){if(_0x53f2a6){if(!_0x53f2a6[_0xeb41('0x3b')]){throw new db[(_0xeb41('0x6b'))]['ValidationErrorItem'](_0xeb41('0x6c'),0x193);}_0x330ee7=_0x53f2a6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0xedc3fb){if(_0xedc3fb){_0x59d063=_[_0xeb41('0x6d')](_0xedc3fb,'id');var _0x31a993;var _0x2b7dc4=squel[_0xeb41('0x6e')]();_0x2b7dc4[_0xeb41('0x6f')](_0xc9d68f[_0xeb41('0x70')]);for(var _0x459e40=0x0;_0x459e40<_0x330ee7[_0xeb41('0x3b')];_0x459e40+=0x1){_0x31a993=_0x330ee7[_0x459e40][_0xeb41('0x71')]?_0x59d063[_0x330ee7[_0x459e40][_0xeb41('0x71')]][_0xeb41('0x72')]:_0x330ee7[_0x459e40][_0xeb41('0x69')];_0x31a993=_0x330ee7[_0x459e40][_0xeb41('0x73')]?_['replace'](_0x541715[_0x330ee7[_0x459e40][_0xeb41('0x73')]],'%s',_0x31a993):_0x31a993;_0x31a993=_0x330ee7[_0x459e40][_0xeb41('0x74')]?_['replace'](_0x31588e[_0x330ee7[_0x459e40][_0xeb41('0x74')]],'%s',_0x31a993):_0x31a993;if(_0x330ee7[_0x459e40][_0xeb41('0x75')]){_0x2b7dc4[_0xeb41('0x68')](_0x31a993);}_0x330ee7[_0x459e40][_0xeb41('0x76')]&&_0x2b7dc4['order'](_0x31a993,_0x330ee7[_0x459e40][_0xeb41('0x76')]===_0xeb41('0x77')?![]:!![]);_0x2b7dc4['field'](_0x31a993,_0x330ee7[_0x459e40][_0xeb41('0x78')]||_0x31a993);}if(_0xc9d68f[_0xeb41('0x79')]){_0xc9d68f['joins']=JSON[_0xeb41('0x7a')](_0xc9d68f[_0xeb41('0x79')]);for(var _0x406dfe=0x0;_0x406dfe<_0xc9d68f[_0xeb41('0x79')][_0xeb41('0x3b')];_0x406dfe+=0x1){if(_0xc9d68f['joins'][_0x406dfe][_0xeb41('0x32')]&&_[_0xeb41('0x62')](_0x23458f,_0xc9d68f['joins'][_0x406dfe][_0xeb41('0x32')])&&_0xc9d68f['joins'][_0x406dfe][_0xeb41('0x7b')]&&_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x7c')]&&_0xc9d68f[_0xeb41('0x79')][_0x406dfe]['foreignKey']){_0x2b7dc4[_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x32')]](_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x7c')],null,util[_0xeb41('0x74')](_0xeb41('0x7d'),_0xc9d68f[_0xeb41('0x70')],_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x7b')],_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x7c')],_0xc9d68f[_0xeb41('0x79')][_0x406dfe][_0xeb41('0x7e')]));}}}if(_0xc9d68f[_0xeb41('0x7f')]){_0xc9d68f[_0xeb41('0x7f')]=JSON[_0xeb41('0x7a')](_0xc9d68f[_0xeb41('0x7f')]);_0x2b7dc4[_0xeb41('0x3f')](_0xd6a24a(_0xc9d68f[_0xeb41('0x7f')][_0xeb41('0x68')]));}_0x1f887a=_0x2b7dc4['clone']();_0x2b7dc4[_0xeb41('0x1e')](_0xd3bd1a);_0x2b7dc4[_0xeb41('0x1d')](0x0);logger[_0xeb41('0x80')](_0xeb41('0x81'),_0x2b7dc4[_0xeb41('0x82')]());return dbH['sequelize'][_0xeb41('0x35')](_0x2b7dc4[_0xeb41('0x82')](),{'type':dbH[_0xeb41('0x83')][_0xeb41('0x84')][_0xeb41('0x85')]});}})[_0xeb41('0x27')](respondWithResult(_0x597ae5,null))['catch'](handleError(_0x597ae5,null));};function runReport(_0x2e200a,_0x20a695,_0x1576c0){var _0x3c9c36=_0x20a695[_0xeb41('0x2c')];var _0x5b2beb=0xa;var _0x1d19aa=[_0xeb41('0x55'),_0xeb41('0x86'),'right_join',_0xeb41('0x57')];var _0x2abbb0={'SUM':_0xeb41('0x58'),'COUNT':_0xeb41('0x87'),'COUNT DISTINCT':_0xeb41('0x59'),'MAX':_0xeb41('0x5a'),'MIN':_0xeb41('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeb41('0x88'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeb41('0x5e')};var _0xb56446={'SEC_TO_TIME':_0xeb41('0x89'),'DATE':_0xeb41('0x5f'),'HOUR':_0xeb41('0x60'),'ROUND':_0xeb41('0x8a'),'UNIX_TIMESTAMP':_0xeb41('0x61')};var _0x4004fd=function(_0x476b9e){return!_[_0xeb41('0x62')](['IS\x20NULL',_0xeb41('0x64'),_0xeb41('0x65'),_0xeb41('0x8b')],_0x476b9e);};var _0x2bc51b=function(_0x59a73b){if(!_0x59a73b||!_0x59a73b[_0xeb41('0x66')][_0xeb41('0x3b')]){return'';}for(var _0x4b03d7='(',_0x55874a=0x0;_0x55874a<_0x59a73b[_0xeb41('0x66')][_0xeb41('0x3b')];_0x55874a+=0x1){_0x55874a>0x0&&(_0x4b03d7+='\x20'+_0x59a73b[_0xeb41('0x67')]+'\x20');_0x4b03d7+=_0x59a73b[_0xeb41('0x66')][_0x55874a][_0xeb41('0x68')]?_0x2bc51b(_0x59a73b[_0xeb41('0x66')][_0x55874a][_0xeb41('0x68')]):_0x59a73b[_0xeb41('0x66')][_0x55874a][_0xeb41('0x69')]+'\x20'+_0x59a73b[_0xeb41('0x66')][_0x55874a][_0xeb41('0x6a')]+(_0x4004fd(_0x59a73b['rules'][_0x55874a]['condition'])?'\x20'+_0x59a73b[_0xeb41('0x66')][_0x55874a][_0xeb41('0x8c')]:'');}return _0x4b03d7+')';};var _0x448d5f={'where':{'id':_0x2e200a['id']}},_0x234d56,_0x238544,_0x287b41,_0x51ca88,_0x40228c;_0x448d5f=_[_0xeb41('0x42')]({},_0x448d5f,_0x1576c0);return db[_0xeb41('0x2f')][_0xeb41('0x48')](_0x448d5f)[_0xeb41('0x27')](function(_0xd28d71){if(_0xd28d71){_0x234d56=_0xd28d71;return _0xd28d71['getFields']();}return null;})[_0xeb41('0x27')](function(_0xafb31d){if(_0xafb31d){if(!_0xafb31d[_0xeb41('0x3b')]){throw new db[(_0xeb41('0x6b'))][(_0xeb41('0x8d'))](_0xeb41('0x6c'),0x193);}_0x238544=_0xafb31d;return db['AnalyticMetric'][_0xeb41('0x8e')]({'raw':!![]});}return null;})[_0xeb41('0x27')](function(_0x387b3d){if(_0x387b3d){_0x287b41=_['keyBy'](_0x387b3d,'id');var _0x137a7f;var _0x33ca9f=squel[_0xeb41('0x6e')]();_0x33ca9f['from'](_0x234d56[_0xeb41('0x70')]);for(var _0x35eaa7=0x0;_0x35eaa7<_0x238544['length'];_0x35eaa7+=0x1){_0x137a7f=_0x238544[_0x35eaa7][_0xeb41('0x71')]?_0x287b41[_0x238544[_0x35eaa7][_0xeb41('0x71')]][_0xeb41('0x72')]:_0x238544[_0x35eaa7][_0xeb41('0x69')];_0x137a7f=_0x238544[_0x35eaa7][_0xeb41('0x73')]?_[_0xeb41('0x8f')](_0x2abbb0[_0x238544[_0x35eaa7][_0xeb41('0x73')]],'%s',_0x137a7f):_0x137a7f;_0x137a7f=_0x238544[_0x35eaa7][_0xeb41('0x74')]?_['replace'](_0xb56446[_0x238544[_0x35eaa7][_0xeb41('0x74')]],'%s',_0x137a7f):_0x137a7f;if(_0x238544[_0x35eaa7][_0xeb41('0x75')]){_0x33ca9f[_0xeb41('0x68')](_0x137a7f);}_0x238544[_0x35eaa7][_0xeb41('0x76')]&&_0x33ca9f['order'](_0x137a7f,_0x238544[_0x35eaa7][_0xeb41('0x76')]==='DESC'?![]:!![]);_0x33ca9f['field'](_0x137a7f,_0x238544[_0x35eaa7][_0xeb41('0x78')]||_0x137a7f);}if(_0x234d56[_0xeb41('0x79')]){_0x234d56[_0xeb41('0x79')]=JSON['parse'](_0x234d56[_0xeb41('0x79')]);for(var _0x2243d7=0x0;_0x2243d7<_0x234d56[_0xeb41('0x79')][_0xeb41('0x3b')];_0x2243d7+=0x1){if(_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x32')]&&_[_0xeb41('0x62')](_0x1d19aa,_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x32')])&&_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7b')]&&_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7c')]&&_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7e')]){_0x33ca9f[_0x234d56[_0xeb41('0x79')][_0x2243d7]['type']](_0x234d56['joins'][_0x2243d7][_0xeb41('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x234d56['table'],_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7b')],_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7c')],_0x234d56[_0xeb41('0x79')][_0x2243d7][_0xeb41('0x7e')]));}}}if(_0x234d56[_0xeb41('0x7f')]){_0x234d56['conditions']=JSON[_0xeb41('0x7a')](_0x234d56[_0xeb41('0x7f')]);_0x33ca9f[_0xeb41('0x3f')](_0x2bc51b(_0x234d56[_0xeb41('0x7f')]['group']));}_0x40228c=_0x33ca9f[_0xeb41('0x90')]();_0x33ca9f['limit'](_0x5b2beb);_0x33ca9f[_0xeb41('0x1d')](0x0);return;}})['then'](function(){if(_0x20a695[_0xeb41('0x91')]===_0xeb41('0x92')){return null;}var _0x480dc1=_[_0xeb41('0x42')](_0x20a695,{'name':_0x20a695[_0xeb41('0x93')]||_0x20a695[_0xeb41('0x2c')]||_0x234d56['name'],'basename':_0x3c9c36,'savename':util['format']('%s-%s.%s',_0x20a695[_0xeb41('0x2c')]||_0x234d56['name'],require(_0xeb41('0x94'))[_0xeb41('0x95')](0x4),_0x20a695[_0xeb41('0x91')]||_0xeb41('0x96')),'reportId':_0x234d56['id'],'reportType':'custom'});return db[_0xeb41('0x97')][_0xeb41('0x4a')](_0x480dc1,{'raw':!![]});})[_0xeb41('0x27')](function(_0x5013de){if(_0x234d56['table']===_0xeb41('0x98')){_0x40228c[_0xeb41('0x3f')](_0x234d56[_0xeb41('0x70')]+_0xeb41('0x99'),_0x20a695[_0xeb41('0x9a')],_0x20a695[_0xeb41('0x9b')]);}else{_0x40228c['where'](_0x234d56['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x20a695[_0xeb41('0x9a')],_0x20a695[_0xeb41('0x9b')]);}if(_0x5013de){logger[_0xeb41('0x9c')]('Run\x20Query:',_0x40228c[_0xeb41('0x82')]());require(_0xeb41('0x9d'))['fork'](path['join'](__dirname,_0xeb41('0x9e'),_0x5013de['output']),[_0x5013de['id'],_0x40228c[_0xeb41('0x82')](),path[_0xeb41('0x55')](__dirname,'../../files/reports',_0x5013de['savename']),_0x3c9c36]);return _0x5013de;}else{var _0x29d487=squel[_0xeb41('0x6e')]();_0x29d487['from']('('+_0x40228c[_0xeb41('0x82')]()+')',_0xeb41('0x9f'));_0x29d487['field'](_0xeb41('0xa0'),_0xeb41('0x20'));_0x40228c[_0xeb41('0x1e')](_0x20a695['limit']||_0x5b2beb);_0x40228c[_0xeb41('0x1d')](_0x20a695['offset']||0x0);return dbH[_0xeb41('0x83')][_0xeb41('0x35')](_0x29d487[_0xeb41('0x82')](),{'type':dbH[_0xeb41('0x83')]['QueryTypes']['SELECT']})['then'](function(_0x210a10){if(!_0x210a10[_0xeb41('0x3b')]){_0x51ca88=0x0;}else{_0x51ca88=_0x210a10[0x0][_0xeb41('0x20')]||0x0;}return dbH[_0xeb41('0x83')]['query'](_0x40228c[_0xeb41('0x82')](),{'type':dbH['sequelize'][_0xeb41('0x84')][_0xeb41('0x85')]});})[_0xeb41('0x27')](function(_0x4a0cde){return{'rows':_0x4a0cde||[],'count':_0x51ca88};});}});}exports[_0xeb41('0xa1')]=function(_0x1046e4,_0x35c2ec){return runReport(_0x1046e4[_0xeb41('0x46')],_0x1046e4[_0xeb41('0x35')],_0x1046e4[_0xeb41('0x44')])[_0xeb41('0x27')](respondWithResult(_0x35c2ec,null))['catch'](handleError(_0x35c2ec,null));};exports[_0xeb41('0xa2')]=runReport;exports[_0xeb41('0x35')]=function(_0x22d9f8,_0x21c894){var _0x3381fd=0xa;var _0x41d91b=[_0xeb41('0x55'),_0xeb41('0x86'),_0xeb41('0x56'),_0xeb41('0x57')];var _0x232e8d={'SUM':_0xeb41('0x58'),'COUNT':_0xeb41('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeb41('0x5a'),'MIN':_0xeb41('0x5b'),'AVG':_0xeb41('0x5c'),'GROUP_CONCAT':_0xeb41('0x88'),'GROUP_CONCAT ASC':_0xeb41('0x5d'),'GROUP_CONCAT DESC':_0xeb41('0x5e')};var _0x205d38={'SEC_TO_TIME':_0xeb41('0x89'),'DATE':'DATE(%s)','HOUR':_0xeb41('0x60'),'ROUND':_0xeb41('0x8a'),'UNIX_TIMESTAMP':_0xeb41('0x61')};var _0x25eb7b=function(_0xfc8218){return!_[_0xeb41('0x62')]([_0xeb41('0x63'),_0xeb41('0x64'),_0xeb41('0x65'),_0xeb41('0x8b')],_0xfc8218);};var _0x15cb0c=function(_0x3d7887){if(!_0x3d7887||!_0x3d7887['rules'][_0xeb41('0x3b')]){return'';}for(var _0x227431='(',_0x59051e=0x0;_0x59051e<_0x3d7887[_0xeb41('0x66')]['length'];_0x59051e+=0x1){_0x59051e>0x0&&(_0x227431+='\x20'+_0x3d7887[_0xeb41('0x67')]+'\x20');_0x227431+=_0x3d7887[_0xeb41('0x66')][_0x59051e][_0xeb41('0x68')]?_0x15cb0c(_0x3d7887[_0xeb41('0x66')][_0x59051e][_0xeb41('0x68')]):_0x3d7887[_0xeb41('0x66')][_0x59051e][_0xeb41('0x69')]+'\x20'+_0x3d7887['rules'][_0x59051e]['condition']+(_0x25eb7b(_0x3d7887[_0xeb41('0x66')][_0x59051e]['condition'])?'\x20'+_0x3d7887[_0xeb41('0x66')][_0x59051e]['value']:'');}return _0x227431+')';};var _0x5d6a8a={'where':{'id':_0x22d9f8[_0xeb41('0x46')]['id']}},_0x53b742,_0x9a4b18,_0x700d28,_0x2f2964,_0x49fe59;_0x5d6a8a=_['merge']({},_0x5d6a8a,_0x22d9f8[_0xeb41('0x44')]);return db[_0xeb41('0x2f')][_0xeb41('0x48')](_0x5d6a8a)[_0xeb41('0x27')](function(_0x595eeb){if(_0x595eeb){_0x53b742=_0x595eeb;return _0x595eeb[_0xeb41('0xa3')]();}return null;})[_0xeb41('0x27')](function(_0x29d748){if(_0x29d748){if(!_0x29d748['length']){throw new db[(_0xeb41('0x6b'))][(_0xeb41('0x8d'))](_0xeb41('0x6c'),0x193);}_0x9a4b18=_0x29d748;return db[_0xeb41('0xa4')][_0xeb41('0x8e')]({'raw':!![]});}return null;})[_0xeb41('0x27')](function(_0x5dd3f9){if(_0x5dd3f9){_0x700d28=_[_0xeb41('0x6d')](_0x5dd3f9,'id');var _0x2cdad6;var _0x2fede6=squel[_0xeb41('0x6e')]();_0x2fede6[_0xeb41('0x6f')](_0x53b742['table']);for(var _0x3f70bc=0x0;_0x3f70bc<_0x9a4b18['length'];_0x3f70bc+=0x1){_0x2cdad6=_0x9a4b18[_0x3f70bc][_0xeb41('0x71')]?_0x700d28[_0x9a4b18[_0x3f70bc][_0xeb41('0x71')]][_0xeb41('0x72')]:_0x9a4b18[_0x3f70bc]['field'];_0x2cdad6=_0x9a4b18[_0x3f70bc][_0xeb41('0x73')]?_[_0xeb41('0x8f')](_0x232e8d[_0x9a4b18[_0x3f70bc]['function']],'%s',_0x2cdad6):_0x2cdad6;_0x2cdad6=_0x9a4b18[_0x3f70bc][_0xeb41('0x74')]?_[_0xeb41('0x8f')](_0x205d38[_0x9a4b18[_0x3f70bc][_0xeb41('0x74')]],'%s',_0x2cdad6):_0x2cdad6;if(_0x9a4b18[_0x3f70bc]['groupBy']){_0x2fede6['group'](_0x2cdad6);}_0x9a4b18[_0x3f70bc][_0xeb41('0x76')]&&_0x2fede6[_0xeb41('0x3d')](_0x2cdad6,_0x9a4b18[_0x3f70bc][_0xeb41('0x76')]===_0xeb41('0x77')?![]:!![]);_0x2fede6[_0xeb41('0x69')](_0x2cdad6,_0x9a4b18[_0x3f70bc][_0xeb41('0x78')]||_0x2cdad6);}if(_0x53b742['joins']){_0x53b742[_0xeb41('0x79')]=JSON[_0xeb41('0x7a')](_0x53b742[_0xeb41('0x79')]);for(var _0x18b78f=0x0;_0x18b78f<_0x53b742['joins'][_0xeb41('0x3b')];_0x18b78f+=0x1){if(_0x53b742[_0xeb41('0x79')][_0x18b78f]['type']&&_[_0xeb41('0x62')](_0x41d91b,_0x53b742['joins'][_0x18b78f][_0xeb41('0x32')])&&_0x53b742[_0xeb41('0x79')][_0x18b78f][_0xeb41('0x7b')]&&_0x53b742['joins'][_0x18b78f][_0xeb41('0x7c')]&&_0x53b742[_0xeb41('0x79')][_0x18b78f]['foreignKey']){_0x2fede6[_0x53b742[_0xeb41('0x79')][_0x18b78f][_0xeb41('0x32')]](_0x53b742[_0xeb41('0x79')][_0x18b78f][_0xeb41('0x7c')],null,util[_0xeb41('0x74')](_0xeb41('0x7d'),_0x53b742[_0xeb41('0x70')],_0x53b742['joins'][_0x18b78f][_0xeb41('0x7b')],_0x53b742[_0xeb41('0x79')][_0x18b78f]['foreignTable'],_0x53b742[_0xeb41('0x79')][_0x18b78f][_0xeb41('0x7e')]));}}}if(_0x53b742[_0xeb41('0x7f')]){_0x53b742[_0xeb41('0x7f')]=JSON[_0xeb41('0x7a')](_0x53b742[_0xeb41('0x7f')]);_0x2fede6[_0xeb41('0x3f')](_0x15cb0c(_0x53b742[_0xeb41('0x7f')][_0xeb41('0x68')]));}_0x49fe59=_0x2fede6[_0xeb41('0x90')]();_0x2fede6['limit'](_0x3381fd);_0x2fede6['offset'](0x0);logger[_0xeb41('0x80')](_0xeb41('0x81'),_0x2fede6[_0xeb41('0x82')]());return dbH[_0xeb41('0x83')][_0xeb41('0x35')](_0x2fede6[_0xeb41('0x82')](),{'type':dbH[_0xeb41('0x83')]['QueryTypes'][_0xeb41('0x85')]});}})['then'](function(){return{'sql':_0x49fe59[_0xeb41('0x82')]()};})[_0xeb41('0x27')](respondWithResult(_0x21c894,null))[_0xeb41('0x49')](handleError(_0x21c894,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 604453f..39ab993 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 _0x6cfa=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6cfa,0x1c2));var _0xa6cf=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x6cfa[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xa6cf('0x0'));var util=require(_0xa6cf('0x1'));var logger=require(_0xa6cf('0x2'))('api');var moment=require(_0xa6cf('0x3'));var BPromise=require(_0xa6cf('0x4'));var rp=require(_0xa6cf('0x5'));var fs=require('fs');var path=require(_0xa6cf('0x6'));var rimraf=require(_0xa6cf('0x7'));var config=require(_0xa6cf('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xa6cf('0x9')]=function(_0x466087,_0x5d8084){return _0x466087[_0xa6cf('0xa')](_0xa6cf('0xb'),attributes,{'tableName':_0xa6cf('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c75=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x5c75,0xca));var _0x55c7=function(_0x32b50d,_0x4e0723){_0x32b50d=_0x32b50d-0x0;var _0x1b4bfd=_0x5c75[_0x32b50d];return _0x1b4bfd;};'use strict';var _=require(_0x55c7('0x0'));var util=require(_0x55c7('0x1'));var logger=require(_0x55c7('0x2'))('api');var moment=require(_0x55c7('0x3'));var BPromise=require(_0x55c7('0x4'));var rp=require(_0x55c7('0x5'));var fs=require('fs');var path=require(_0x55c7('0x6'));var rimraf=require(_0x55c7('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x55c7('0x8')]=function(_0x3093cf,_0x5be4c3){return _0x3093cf[_0x55c7('0x9')](_0x55c7('0xa'),attributes,{'tableName':_0x55c7('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 3ff132b..75e3fdc 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 _0xae2a=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xae2a,0x18a));var _0xaae2=function(_0x2d9a8d,_0x21b8ea){_0x2d9a8d=_0x2d9a8d-0x0;var _0x11039e=_0xae2a[_0x2d9a8d];return _0x11039e;};'use strict';var _=require('lodash');var util=require(_0xaae2('0x0'));var moment=require(_0xaae2('0x1'));var BPromise=require(_0xaae2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaae2('0x3'));var db=require(_0xaae2('0x4'))['db'];var utils=require(_0xaae2('0x5'));var logger=require(_0xaae2('0x6'))(_0xaae2('0x7'));var config=require(_0xaae2('0x8'));var jayson=require(_0xaae2('0x9'));var client=jayson['client'][_0xaae2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5410ae,_0x50abf7,_0x5c738c){return new BPromise(function(_0x4ca7c5,_0x3f8412){return client[_0xaae2('0xb')](_0x5410ae,_0x5c738c)[_0xaae2('0xc')](function(_0x52fafc){logger[_0xaae2('0xd')](_0xaae2('0xe'),_0x50abf7,_0xaae2('0xf'));logger[_0xaae2('0x10')](_0xaae2('0x11'),_0x50abf7,'request\x20sent',JSON['stringify'](_0x52fafc));if(_0x52fafc[_0xaae2('0x12')]){if(_0x52fafc[_0xaae2('0x12')]['code']===0x1f4){logger[_0xaae2('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x50abf7,_0x52fafc['error'][_0xaae2('0x13')]);return _0x3f8412(_0x52fafc['error']['message']);}logger['error'](_0xaae2('0xe'),_0x50abf7,_0x52fafc[_0xaae2('0x12')]['message']);return _0x4ca7c5(_0x52fafc['error'][_0xaae2('0x13')]);}else{logger['info'](_0xaae2('0xe'),_0x50abf7,'request\x20sent');_0x4ca7c5(_0x52fafc[_0xaae2('0x14')]['message']);}})[_0xaae2('0x15')](function(_0x3488a3){logger[_0xaae2('0x12')](_0xaae2('0xe'),_0x50abf7,_0x3488a3);_0x3f8412(_0x3488a3);});});} \ No newline at end of file +var _0x3ddf=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3ddf,0x164));var _0xf3dd=function(_0x1e46e1,_0x169d16){_0x1e46e1=_0x1e46e1-0x0;var _0x5bdd4c=_0x3ddf[_0x1e46e1];return _0x5bdd4c;};'use strict';var _=require(_0xf3dd('0x0'));var util=require(_0xf3dd('0x1'));var moment=require(_0xf3dd('0x2'));var BPromise=require(_0xf3dd('0x3'));var rs=require(_0xf3dd('0x4'));var fs=require('fs');var Redis=require(_0xf3dd('0x5'));var db=require(_0xf3dd('0x6'))['db'];var utils=require(_0xf3dd('0x7'));var logger=require(_0xf3dd('0x8'))(_0xf3dd('0x9'));var config=require('../../config/environment');var jayson=require(_0xf3dd('0xa'));var client=jayson[_0xf3dd('0xb')][_0xf3dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2409d8,_0x5d1156,_0x2c2a2f){return new BPromise(function(_0x42ebe5,_0x4ddb71){return client[_0xf3dd('0xd')](_0x2409d8,_0x2c2a2f)['then'](function(_0x42e5b1){logger[_0xf3dd('0xe')](_0xf3dd('0xf'),_0x5d1156,_0xf3dd('0x10'));logger[_0xf3dd('0x11')](_0xf3dd('0x12'),_0x5d1156,_0xf3dd('0x10'),JSON['stringify'](_0x42e5b1));if(_0x42e5b1[_0xf3dd('0x13')]){if(_0x42e5b1[_0xf3dd('0x13')]['code']===0x1f4){logger[_0xf3dd('0x13')](_0xf3dd('0xf'),_0x5d1156,_0x42e5b1[_0xf3dd('0x13')]['message']);return _0x4ddb71(_0x42e5b1[_0xf3dd('0x13')][_0xf3dd('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5d1156,_0x42e5b1['error']['message']);return _0x42ebe5(_0x42e5b1[_0xf3dd('0x13')]['message']);}else{logger[_0xf3dd('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d1156,'request\x20sent');_0x42ebe5(_0x42e5b1[_0xf3dd('0x15')]['message']);}})['catch'](function(_0x1a8cec){logger[_0xf3dd('0x13')](_0xf3dd('0xf'),_0x5d1156,_0x1a8cec);_0x4ddb71(_0x1a8cec);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 085d271..93a0745 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 _0xb0e8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','isAuthenticated','preview','get','/:id/run','run','/:id/query','query','post','create','put','delete','exports','util','path'];(function(_0x3e9a33,_0x1463e9){var _0x586459=function(_0x5ba81c){while(--_0x5ba81c){_0x3e9a33['push'](_0x3e9a33['shift']());}};_0x586459(++_0x1463e9);}(_0xb0e8,0x1ae));var _0x8b0e=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0xb0e8[_0x788a54];return _0x8b73a4;};'use strict';var multer=require('multer');var util=require(_0x8b0e('0x0'));var path=require(_0x8b0e('0x1'));var timeout=require(_0x8b0e('0x2'));var express=require(_0x8b0e('0x3'));var router=express[_0x8b0e('0x4')]();var fs_extra=require(_0x8b0e('0x5'));var auth=require(_0x8b0e('0x6'));var interaction=require(_0x8b0e('0x7'));var config=require(_0x8b0e('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8b0e('0x9')]);router['get'](_0x8b0e('0xa'),auth['isAuthenticated'](),controller[_0x8b0e('0xb')]);router['get']('/:id/preview',auth[_0x8b0e('0xc')](),controller[_0x8b0e('0xd')]);router[_0x8b0e('0xe')](_0x8b0e('0xf'),auth[_0x8b0e('0xc')](),controller[_0x8b0e('0x10')]);router[_0x8b0e('0xe')](_0x8b0e('0x11'),auth['isAuthenticated'](),controller[_0x8b0e('0x12')]);router[_0x8b0e('0x13')]('/',auth[_0x8b0e('0xc')](),controller[_0x8b0e('0x14')]);router[_0x8b0e('0x15')]('/:id',auth[_0x8b0e('0xc')](),controller['update']);router[_0x8b0e('0x16')](_0x8b0e('0xa'),auth[_0x8b0e('0xc')](),controller['destroy']);module[_0x8b0e('0x17')]=router; \ No newline at end of file +var _0xc976=['destroy','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','query','create','update','delete'];(function(_0x48ddea,_0xd57c33){var _0x441dc8=function(_0x957a4d){while(--_0x957a4d){_0x48ddea['push'](_0x48ddea['shift']());}};_0x441dc8(++_0xd57c33);}(_0xc976,0x12d));var _0x6c97=function(_0x37290d,_0x1bea51){_0x37290d=_0x37290d-0x0;var _0x320ef8=_0xc976[_0x37290d];return _0x320ef8;};'use strict';var multer=require('multer');var util=require(_0x6c97('0x0'));var path=require('path');var timeout=require(_0x6c97('0x1'));var express=require(_0x6c97('0x2'));var router=express['Router']();var fs_extra=require(_0x6c97('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6c97('0x4'));var config=require(_0x6c97('0x5'));var controller=require(_0x6c97('0x6'));router[_0x6c97('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c97('0x8')]);router[_0x6c97('0x7')](_0x6c97('0x9'),auth[_0x6c97('0xa')](),controller[_0x6c97('0xb')]);router[_0x6c97('0x7')](_0x6c97('0xc'),auth[_0x6c97('0xa')](),controller['preview']);router[_0x6c97('0x7')](_0x6c97('0xd'),auth[_0x6c97('0xa')](),controller[_0x6c97('0xe')]);router[_0x6c97('0x7')]('/:id/query',auth[_0x6c97('0xa')](),controller[_0x6c97('0xf')]);router['post']('/',auth[_0x6c97('0xa')](),controller[_0x6c97('0x10')]);router['put'](_0x6c97('0x9'),auth[_0x6c97('0xa')](),controller[_0x6c97('0x11')]);router[_0x6c97('0x12')](_0x6c97('0x9'),auth[_0x6c97('0xa')](),controller[_0x6c97('0x13')]);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 c740d19..0dc17b1 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x2675,0x75));var _0x5267=function(_0x27218f,_0x44b3f7){_0x27218f=_0x27218f-0x0;var _0x1949f9=_0x2675[_0x27218f];return _0x1949f9;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x43e2e4,_0x4ad3b4){_0x43e2e4=_0x43e2e4-0x0;var _0x1b71d0=_0xfdbd[_0x43e2e4];return _0x1b71d0;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 1a46c13..6e71ea2 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 _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x6b57b5,_0x6386ca){var _0x127d96=function(_0x24abc8){while(--_0x24abc8){_0x6b57b5['push'](_0x6b57b5['shift']());}};_0x127d96(++_0x6386ca);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x2ef3,0xba));var _0x32ef=function(_0x570a16,_0x35c704){_0x570a16=_0x570a16-0x0;var _0x40f8f5=_0x2ef3[_0x570a16];return _0x40f8f5;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 0eb9de8..c0b3838 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 _0x06da=['../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd93834,_0x86798a){var _0x22dd47=function(_0xa5f866){while(--_0xa5f866){_0xd93834['push'](_0xd93834['shift']());}};_0x22dd47(++_0x86798a);}(_0x06da,0x7d));var _0xa06d=function(_0x3ae5f8,_0x26c8bc){_0x3ae5f8=_0x3ae5f8-0x0;var _0x205b12=_0x06da[_0x3ae5f8];return _0x205b12;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa06d('0x0'))(_0xa06d('0x1'));var moment=require(_0xa06d('0x2'));var BPromise=require(_0xa06d('0x3'));var rp=require(_0xa06d('0x4'));var fs=require('fs');var path=require(_0xa06d('0x5'));var rimraf=require(_0xa06d('0x6'));var config=require(_0xa06d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3b3b37,_0x43a2c9){return _0x3b3b37[_0xa06d('0x8')](_0xa06d('0x9'),attributes,{'tableName':_0xa06d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ede=['lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports'];(function(_0x31aa74,_0x446eea){var _0x1dadc5=function(_0x41ccfb){while(--_0x41ccfb){_0x31aa74['push'](_0x31aa74['shift']());}};_0x1dadc5(++_0x446eea);}(_0x9ede,0x117));var _0xe9ed=function(_0x38423a,_0x16033d){_0x38423a=_0x38423a-0x0;var _0x990508=_0x9ede[_0x38423a];return _0x990508;};'use strict';var _=require(_0xe9ed('0x0'));var util=require('util');var logger=require(_0xe9ed('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe9ed('0x2'));var fs=require('fs');var path=require(_0xe9ed('0x3'));var rimraf=require(_0xe9ed('0x4'));var config=require(_0xe9ed('0x5'));var attributes=require(_0xe9ed('0x6'));module[_0xe9ed('0x7')]=function(_0x529723,_0x4655f8){return _0x529723['define']('AnalyticDefaultReport',attributes,{'tableName':_0xe9ed('0x8'),'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 dca9445..c2abd4e 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 _0x5cb5=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5cb5,0x7a));var _0x55cb=function(_0x211530,_0x3ea767){_0x211530=_0x211530-0x0;var _0x3b5427=_0x5cb5[_0x211530];return _0x3b5427;};'use strict';var _=require(_0x55cb('0x0'));var util=require(_0x55cb('0x1'));var moment=require(_0x55cb('0x2'));var BPromise=require(_0x55cb('0x3'));var rs=require(_0x55cb('0x4'));var fs=require('fs');var Redis=require(_0x55cb('0x5'));var db=require(_0x55cb('0x6'))['db'];var utils=require(_0x55cb('0x7'));var logger=require(_0x55cb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x55cb('0x9'));var client=jayson[_0x55cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f986c,_0x526023,_0x1c5427){return new BPromise(function(_0x12eebb,_0x21a3ba){return client[_0x55cb('0xb')](_0x1f986c,_0x1c5427)[_0x55cb('0xc')](function(_0x56ef01){logger[_0x55cb('0xd')](_0x55cb('0xe'),_0x526023,'request\x20sent');logger[_0x55cb('0xf')](_0x55cb('0x10'),_0x526023,'request\x20sent',JSON[_0x55cb('0x11')](_0x56ef01));if(_0x56ef01[_0x55cb('0x12')]){if(_0x56ef01[_0x55cb('0x12')][_0x55cb('0x13')]===0x1f4){logger[_0x55cb('0x12')](_0x55cb('0xe'),_0x526023,_0x56ef01['error'][_0x55cb('0x14')]);return _0x21a3ba(_0x56ef01[_0x55cb('0x12')][_0x55cb('0x14')]);}logger[_0x55cb('0x12')](_0x55cb('0xe'),_0x526023,_0x56ef01[_0x55cb('0x12')][_0x55cb('0x14')]);return _0x12eebb(_0x56ef01['error'][_0x55cb('0x14')]);}else{logger[_0x55cb('0xd')](_0x55cb('0xe'),_0x526023,_0x55cb('0x15'));_0x12eebb(_0x56ef01['result'][_0x55cb('0x14')]);}})[_0x55cb('0x16')](function(_0x1c53bd){logger['error'](_0x55cb('0xe'),_0x526023,_0x1c53bd);_0x21a3ba(_0x1c53bd);});});} \ No newline at end of file +var _0xfc61=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x41044d,_0x557434){var _0x314486=function(_0x3085fc){while(--_0x3085fc){_0x41044d['push'](_0x41044d['shift']());}};_0x314486(++_0x557434);}(_0xfc61,0x11b));var _0x1fc6=function(_0x3cc270,_0x1e66d6){_0x3cc270=_0x3cc270-0x0;var _0xcf5896=_0xfc61[_0x3cc270];return _0xcf5896;};'use strict';var _=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var moment=require(_0x1fc6('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fc6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fc6('0x4'))['db'];var utils=require(_0x1fc6('0x5'));var logger=require('../../config/logger')(_0x1fc6('0x6'));var config=require(_0x1fc6('0x7'));var jayson=require(_0x1fc6('0x8'));var client=jayson[_0x1fc6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1162b6,_0x3c03b9,_0x1fe3cf){return new BPromise(function(_0x127282,_0x5c1858){return client[_0x1fc6('0xa')](_0x1162b6,_0x1fe3cf)[_0x1fc6('0xb')](function(_0xb54dba){logger['info'](_0x1fc6('0xc'),_0x3c03b9,_0x1fc6('0xd'));logger['debug'](_0x1fc6('0xe'),_0x3c03b9,_0x1fc6('0xd'),JSON[_0x1fc6('0xf')](_0xb54dba));if(_0xb54dba[_0x1fc6('0x10')]){if(_0xb54dba['error'][_0x1fc6('0x11')]===0x1f4){logger[_0x1fc6('0x10')](_0x1fc6('0xc'),_0x3c03b9,_0xb54dba[_0x1fc6('0x10')][_0x1fc6('0x12')]);return _0x5c1858(_0xb54dba[_0x1fc6('0x10')]['message']);}logger[_0x1fc6('0x10')](_0x1fc6('0xc'),_0x3c03b9,_0xb54dba[_0x1fc6('0x10')][_0x1fc6('0x12')]);return _0x127282(_0xb54dba[_0x1fc6('0x10')][_0x1fc6('0x12')]);}else{logger['info'](_0x1fc6('0xc'),_0x3c03b9,'request\x20sent');_0x127282(_0xb54dba['result'][_0x1fc6('0x12')]);}})['catch'](function(_0x398383){logger[_0x1fc6('0x10')](_0x1fc6('0xc'),_0x3c03b9,_0x398383);_0x5c1858(_0x398383);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 4ce900c..111594e 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 _0x2471=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b8a30,_0x425c5f){var _0x4edde5=function(_0x2a098d){while(--_0x2a098d){_0x4b8a30['push'](_0x4b8a30['shift']());}};_0x4edde5(++_0x425c5f);}(_0x2471,0x70));var _0x1247=function(_0x8d13fa,_0x2a7e7b){_0x8d13fa=_0x8d13fa-0x0;var _0x3d207b=_0x2471[_0x8d13fa];return _0x3d207b;};'use strict';var multer=require('multer');var util=require(_0x1247('0x0'));var path=require(_0x1247('0x1'));var timeout=require(_0x1247('0x2'));var express=require(_0x1247('0x3'));var router=express[_0x1247('0x4')]();var fs_extra=require(_0x1247('0x5'));var auth=require(_0x1247('0x6'));var interaction=require(_0x1247('0x7'));var config=require(_0x1247('0x8'));var controller=require(_0x1247('0x9'));router[_0x1247('0xa')]('/',auth[_0x1247('0xb')](),controller[_0x1247('0xc')]);router[_0x1247('0xa')](_0x1247('0xd'),auth[_0x1247('0xb')](),controller['show']);router[_0x1247('0xa')]('/:id/preview',auth[_0x1247('0xb')](),controller[_0x1247('0xe')]);router[_0x1247('0xa')](_0x1247('0xf'),auth['isAuthenticated'](),controller[_0x1247('0x10')]);router['get'](_0x1247('0x11'),auth['isAuthenticated'](),controller['query']);router[_0x1247('0x12')]('/',auth[_0x1247('0xb')](),controller[_0x1247('0x13')]);router['put']('/:id',auth[_0x1247('0xb')](),controller[_0x1247('0x14')]);router[_0x1247('0x15')](_0x1247('0xd'),auth['isAuthenticated'](),controller[_0x1247('0x16')]);module[_0x1247('0x17')]=router; \ No newline at end of file +var _0xdbd3=['run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run'];(function(_0x1cdc7a,_0x421804){var _0x57a225=function(_0x4a9e41){while(--_0x4a9e41){_0x1cdc7a['push'](_0x1cdc7a['shift']());}};_0x57a225(++_0x421804);}(_0xdbd3,0xa0));var _0x3dbd=function(_0x311374,_0x132c28){_0x311374=_0x311374-0x0;var _0x1bf041=_0xdbd3[_0x311374];return _0x1bf041;};'use strict';var multer=require(_0x3dbd('0x0'));var util=require(_0x3dbd('0x1'));var path=require(_0x3dbd('0x2'));var timeout=require(_0x3dbd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3dbd('0x4'));var interaction=require(_0x3dbd('0x5'));var config=require(_0x3dbd('0x6'));var controller=require(_0x3dbd('0x7'));router[_0x3dbd('0x8')]('/',auth[_0x3dbd('0x9')](),controller[_0x3dbd('0xa')]);router['get'](_0x3dbd('0xb'),auth['isAuthenticated'](),controller[_0x3dbd('0xc')]);router[_0x3dbd('0x8')]('/:id/preview',auth[_0x3dbd('0x9')](),controller[_0x3dbd('0xd')]);router[_0x3dbd('0x8')](_0x3dbd('0xe'),auth[_0x3dbd('0x9')](),controller[_0x3dbd('0xf')]);router['get'](_0x3dbd('0x10'),auth['isAuthenticated'](),controller[_0x3dbd('0x11')]);router[_0x3dbd('0x12')]('/',auth[_0x3dbd('0x9')](),controller[_0x3dbd('0x13')]);router[_0x3dbd('0x14')](_0x3dbd('0xb'),auth['isAuthenticated'](),controller[_0x3dbd('0x15')]);router[_0x3dbd('0x16')](_0x3dbd('0xb'),auth[_0x3dbd('0x9')](),controller[_0x3dbd('0x17')]);module[_0x3dbd('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 36baf10..0ea6691 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 _0x9b55=['DATE','Loading','ENUM','manual','scheduled','INTEGER','moment','STRING','csv','xlsx'];(function(_0x1c324d,_0x2daa7c){var _0x33347f=function(_0x438dc6){while(--_0x438dc6){_0x1c324d['push'](_0x1c324d['shift']());}};_0x33347f(++_0x2daa7c);}(_0x9b55,0x114));var _0x59b5=function(_0x55c831,_0x104040){_0x55c831=_0x55c831-0x0;var _0x2f96ef=_0x9b55[_0x55c831];return _0x2f96ef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x59b5('0x0'));module['exports']={'name':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x59b5('0x2'),'pdf',_0x59b5('0x3')),'allowNull':![],'defaultValue':_0x59b5('0x2')},'savename':{'type':Sequelize[_0x59b5('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x59b5('0x4')]},'endDate':{'type':Sequelize[_0x59b5('0x4')]},'status':{'type':Sequelize[_0x59b5('0x1')],'defaultValue':_0x59b5('0x5')},'type':{'type':Sequelize[_0x59b5('0x6')](_0x59b5('0x7'),_0x59b5('0x8')),'allowNull':![],'defaultValue':_0x59b5('0x7')},'reportId':{'type':Sequelize[_0x59b5('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe6dd=['STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x10e5c8,_0x5e6458){var _0x55c99f=function(_0x47e393){while(--_0x47e393){_0x10e5c8['push'](_0x10e5c8['shift']());}};_0x55c99f(++_0x5e6458);}(_0xe6dd,0x8c));var _0xde6d=function(_0x4c0efa,_0x43bc32){_0x4c0efa=_0x4c0efa-0x0;var _0x5d0e53=_0xe6dd[_0x4c0efa];return _0x5d0e53;};'use strict';var Sequelize=require(_0xde6d('0x0'));var moment=require(_0xde6d('0x1'));module[_0xde6d('0x2')]={'name':{'type':Sequelize[_0xde6d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xde6d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xde6d('0x4')](_0xde6d('0x5'),_0xde6d('0x6'),_0xde6d('0x7')),'allowNull':![],'defaultValue':_0xde6d('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xde6d('0x8')]},'endDate':{'type':Sequelize[_0xde6d('0x8')]},'status':{'type':Sequelize[_0xde6d('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xde6d('0x4')](_0xde6d('0x9'),_0xde6d('0xa')),'allowNull':![],'defaultValue':_0xde6d('0x9')},'reportId':{'type':Sequelize[_0xde6d('0xb')](0xb)[_0xde6d('0xc')]},'reportType':{'type':Sequelize[_0xde6d('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 3001d40..cbfda21 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 _0x5050=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','status','end','json','undefined','count','offset','apply','save','destroy','then','get','ExtractedReports','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','exists','root','format','%s.%s','toLowerCase'];(function(_0x5799fa,_0x42b294){var _0x52deab=function(_0x268eb9){while(--_0x268eb9){_0x5799fa['push'](_0x5799fa['shift']());}};_0x52deab(++_0x42b294);}(_0x5050,0x10e));var _0x0505=function(_0x3b5970,_0x4ad259){_0x3b5970=_0x3b5970-0x0;var _0x5e4979=_0x5050[_0x3b5970];return _0x5e4979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0505('0x0'));var zipdir=require(_0x0505('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0505('0x2'));var moment=require('moment');var BPromise=require(_0x0505('0x3'));var Mustache=require(_0x0505('0x4'));var util=require('util');var path=require(_0x0505('0x5'));var sox=require(_0x0505('0x6'));var csv=require(_0x0505('0x7'));var ejs=require(_0x0505('0x8'));var fs=require('fs');var fs_extra=require(_0x0505('0x9'));var _=require('lodash');var squel=require(_0x0505('0xa'));var crypto=require('crypto');var jsforce=require(_0x0505('0xb'));var deskjs=require(_0x0505('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0505('0xd'));var Redis=require(_0x0505('0xe'));var authService=require(_0x0505('0xf'));var qs=require(_0x0505('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0505('0x11'));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('../../mysqldb')['db'];function respondWithStatusCode(_0xd15727,_0xd4e261){_0xd4e261=_0xd4e261||0xcc;return function(_0xfa0070){if(_0xfa0070){return _0xd15727[_0x0505('0x12')](_0xd4e261);}return _0xd15727[_0x0505('0x13')](_0xd4e261)[_0x0505('0x14')]();};}function respondWithResult(_0xc062,_0x420bf2){_0x420bf2=_0x420bf2||0xc8;return function(_0x155459){if(_0x155459){return _0xc062[_0x0505('0x13')](_0x420bf2)[_0x0505('0x15')](_0x155459);}};}function respondWithFilteredResult(_0x398c5a,_0x427624){return function(_0x570f73){if(_0x570f73){var _0x13de00=typeof _0x427624['offset']===_0x0505('0x16')&&typeof _0x427624['limit']===_0x0505('0x16');var _0x135b81=_0x570f73[_0x0505('0x17')];var _0x1a8204=_0x13de00?0x0:_0x427624[_0x0505('0x18')];var _0x100139=_0x13de00?_0x570f73[_0x0505('0x17')]:_0x427624[_0x0505('0x18')]+_0x427624['limit'];var _0x43aa66;if(_0x100139>=_0x135b81){_0x100139=_0x135b81;_0x43aa66=0xc8;}else{_0x43aa66=0xce;}_0x398c5a[_0x0505('0x13')](_0x43aa66);return _0x398c5a['set']('Content-Range',_0x1a8204+'-'+_0x100139+'/'+_0x135b81)[_0x0505('0x15')](_0x570f73);}return null;};}function patchUpdates(_0x3481b0){return function(_0x560f86){try{jsonpatch[_0x0505('0x19')](_0x560f86,_0x3481b0,!![]);}catch(_0x121437){return BPromise['reject'](_0x121437);}return _0x560f86[_0x0505('0x1a')]();};}function saveUpdates(_0x4b8d16,_0x25cdc9){return function(_0x433972){if(_0x433972){return _0x433972['update'](_0x4b8d16)['then'](function(_0x5a976d){return _0x5a976d;});}return null;};}function removeEntity(_0x118586,_0x1c6b3f){return function(_0x4ba494){if(_0x4ba494){return _0x4ba494[_0x0505('0x1b')]()[_0x0505('0x1c')](function(){var _0x5c593c=_0x4ba494[_0x0505('0x1d')]({'plain':!![]});var _0x4fe910=_0x0505('0x1e');return db[_0x0505('0x1f')]['destroy']({'where':{'type':_0x4fe910,'resourceId':_0x5c593c['id']}})[_0x0505('0x1c')](function(){return _0x4ba494;});})[_0x0505('0x1c')](function(){_0x118586[_0x0505('0x13')](0xcc)[_0x0505('0x14')]();});}};}function handleEntityNotFound(_0x172259,_0x1168e1){return function(_0xa9fb20){if(!_0xa9fb20){_0x172259['sendStatus'](0x194);}return _0xa9fb20;};}function handleError(_0x220a3b,_0x2a6038){_0x2a6038=_0x2a6038||0x1f4;return function(_0x3941a0){logger['error'](_0x3941a0['stack']);if(_0x3941a0[_0x0505('0x20')]){delete _0x3941a0[_0x0505('0x20')];}_0x220a3b[_0x0505('0x13')](_0x2a6038)[_0x0505('0x21')](_0x3941a0);};}exports[_0x0505('0x22')]=function(_0x30d6d7,_0x5eb43e){var _0xe2ec49={},_0x21b87d={},_0x3928fe={'count':0x0,'rows':[]};var _0x4067bd=_['map'](db['AnalyticExtractedReport'][_0x0505('0x23')],function(_0x381931){return{'name':_0x381931[_0x0505('0x24')],'type':_0x381931[_0x0505('0x25')][_0x0505('0x26')]};});_0x21b87d[_0x0505('0x27')]=_[_0x0505('0x28')](_0x4067bd,_0x0505('0x20'));_0x21b87d['query']=_[_0x0505('0x29')](_0x30d6d7[_0x0505('0x2a')]);_0x21b87d['filters']=_[_0x0505('0x2b')](_0x21b87d['model'],_0x21b87d[_0x0505('0x2a')]);_0xe2ec49['attributes']=_[_0x0505('0x2b')](_0x21b87d['model'],qs[_0x0505('0x2c')](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x2c')]));_0xe2ec49[_0x0505('0x2d')]=_0xe2ec49['attributes']['length']?_0xe2ec49['attributes']:_0x21b87d[_0x0505('0x27')];if(!_0x30d6d7['query'][_0x0505('0x2e')](_0x0505('0x2f'))){_0xe2ec49[_0x0505('0x30')]=qs[_0x0505('0x30')](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x30')]);_0xe2ec49['offset']=qs['offset'](_0x30d6d7['query'][_0x0505('0x18')]);}_0xe2ec49[_0x0505('0x31')]=qs['sort'](_0x30d6d7[_0x0505('0x2a')][_0x0505('0x32')]);_0xe2ec49[_0x0505('0x33')]=qs[_0x0505('0x34')](_[_0x0505('0x35')](_0x30d6d7['query'],_0x21b87d[_0x0505('0x34')]),_0x4067bd);if(_0x30d6d7['query']['filter']){_0xe2ec49[_0x0505('0x33')]=_[_0x0505('0x36')](_0xe2ec49['where'],{'$or':_[_0x0505('0x28')](_0x4067bd,function(_0x5357ee){if(_0x5357ee['type']!==_0x0505('0x37')){var _0x25e0fe={};_0x25e0fe[_0x5357ee['name']]={'$like':'%'+_0x30d6d7[_0x0505('0x2a')][_0x0505('0x38')]+'%'};return _0x25e0fe;}})});}_0xe2ec49=_[_0x0505('0x36')]({},_0xe2ec49,_0x30d6d7['options']);var _0x310069={'where':_0xe2ec49[_0x0505('0x33')]};return db[_0x0505('0x39')][_0x0505('0x17')](_0x310069)[_0x0505('0x1c')](function(_0x88551d){_0x3928fe[_0x0505('0x17')]=_0x88551d;if(_0x30d6d7[_0x0505('0x2a')][_0x0505('0x3a')]){_0xe2ec49['include']=[{'all':!![]}];}return db[_0x0505('0x39')][_0x0505('0x3b')](_0xe2ec49);})['then'](function(_0x4ab59d){_0x3928fe[_0x0505('0x3c')]=_0x4ab59d;return _0x3928fe;})[_0x0505('0x1c')](respondWithFilteredResult(_0x5eb43e,_0xe2ec49))[_0x0505('0x3d')](handleError(_0x5eb43e,null));};exports[_0x0505('0x3e')]=function(_0x2a4504,_0x500a92){var _0xeb92e={'raw':!![],'where':{'id':_0x2a4504[_0x0505('0x3f')]['id']}},_0x1d191a={};_0x1d191a['model']=_[_0x0505('0x29')](db[_0x0505('0x39')]['rawAttributes']);_0x1d191a['query']=_[_0x0505('0x29')](_0x2a4504[_0x0505('0x2a')]);_0x1d191a[_0x0505('0x34')]=_[_0x0505('0x2b')](_0x1d191a[_0x0505('0x27')],_0x1d191a[_0x0505('0x2a')]);_0xeb92e[_0x0505('0x2d')]=_['intersection'](_0x1d191a[_0x0505('0x27')],qs[_0x0505('0x2c')](_0x2a4504[_0x0505('0x2a')][_0x0505('0x2c')]));_0xeb92e['attributes']=_0xeb92e[_0x0505('0x2d')]['length']?_0xeb92e['attributes']:_0x1d191a['model'];if(_0x2a4504[_0x0505('0x2a')]['includeAll']){_0xeb92e[_0x0505('0x40')]=[{'all':!![]}];}_0xeb92e=_['merge']({},_0xeb92e,_0x2a4504[_0x0505('0x41')]);return db['AnalyticExtractedReport'][_0x0505('0x42')](_0xeb92e)['then'](handleEntityNotFound(_0x500a92,null))[_0x0505('0x1c')](respondWithResult(_0x500a92,null))[_0x0505('0x3d')](handleError(_0x500a92,null));};exports['create']=function(_0x3eec99,_0x272312){return db[_0x0505('0x39')][_0x0505('0x43')](_0x3eec99[_0x0505('0x44')],{})[_0x0505('0x1c')](function(_0x586513){var _0x785cbd=_0x3eec99['user'][_0x0505('0x1d')]({'plain':!![]});if(!_0x785cbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x785cbd[_0x0505('0x45')]===_0x0505('0x46')){var _0x2991bd=_0x586513[_0x0505('0x1d')]({'plain':!![]});var _0x3743d1='ExtractedReports';return db[_0x0505('0x47')][_0x0505('0x42')]({'where':{'name':_0x3743d1,'userProfileId':_0x785cbd[_0x0505('0x48')]},'raw':!![]})['then'](function(_0x61d6f1){if(_0x61d6f1&&_0x61d6f1[_0x0505('0x49')]===0x0){return db[_0x0505('0x1f')][_0x0505('0x43')]({'name':_0x2991bd['name'],'resourceId':_0x2991bd['id'],'type':_0x61d6f1['name'],'sectionId':_0x61d6f1['id']},{})[_0x0505('0x1c')](function(){return _0x586513;});}else{return _0x586513;}})[_0x0505('0x3d')](function(_0x46aaf6){logger['error'](_0x0505('0x4a'),_0x46aaf6);throw _0x46aaf6;});}return _0x586513;})['then'](respondWithResult(_0x272312,0xc9))[_0x0505('0x3d')](handleError(_0x272312,null));};exports[_0x0505('0x4b')]=function(_0x8600b4,_0xc2e1d1){if(_0x8600b4[_0x0505('0x44')]['id']){delete _0x8600b4[_0x0505('0x44')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x8600b4[_0x0505('0x3f')]['id']}})[_0x0505('0x1c')](handleEntityNotFound(_0xc2e1d1,null))[_0x0505('0x1c')](saveUpdates(_0x8600b4[_0x0505('0x44')],null))[_0x0505('0x1c')](respondWithResult(_0xc2e1d1,null))['catch'](handleError(_0xc2e1d1,null));};exports[_0x0505('0x1b')]=function(_0x35ed16,_0x44fcd1){return db[_0x0505('0x39')]['find']({'where':{'id':_0x35ed16['params']['id']}})[_0x0505('0x1c')](handleEntityNotFound(_0x44fcd1,null))[_0x0505('0x1c')](removeEntity(_0x44fcd1,null))[_0x0505('0x3d')](handleError(_0x44fcd1,null));};exports[_0x0505('0x4c')]=function(_0x9e0de7,_0x7cbf34,_0x1859c6){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x9e0de7['params']['id']},'attributes':[_0x0505('0x20'),_0x0505('0x4d'),'savename',_0x0505('0x4e')],'raw':!![]})[_0x0505('0x1c')](handleEntityNotFound(_0x7cbf34,null))[_0x0505('0x1c')](function(_0x4b0787){if(_0x4b0787){if(!fs[_0x0505('0x4f')](path[_0x0505('0x50')](config['root'],_0x0505('0x51'),_0x4b0787[_0x0505('0x52')]))){throw new db[(_0x0505('0x53'))][(_0x0505('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x9e0de7[_0x0505('0x2a')][_0x0505('0x55')]){return _0x7cbf34[_0x0505('0x12')](0xc8);}return _0x7cbf34[_0x0505('0x4c')](path[_0x0505('0x50')](config[_0x0505('0x56')],_0x0505('0x51'),_0x4b0787[_0x0505('0x52')]),util[_0x0505('0x57')](_0x0505('0x58'),_0x4b0787[_0x0505('0x4d')]||_0x4b0787['name'],_0x4b0787[_0x0505('0x4e')][_0x0505('0x59')]()));}})[_0x0505('0x3d')](handleError(_0x7cbf34,null));}; \ No newline at end of file +var _0x5785=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','keys','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','get','ExtractedReports','error','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x332c05,_0x349d07){var _0x1297fc=function(_0x591139){while(--_0x591139){_0x332c05['push'](_0x332c05['shift']());}};_0x1297fc(++_0x349d07);}(_0x5785,0x7b));var _0x5578=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5785[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x5578('0x0'));var rimraf=require(_0x5578('0x1'));var zipdir=require(_0x5578('0x2'));var jsonpatch=require(_0x5578('0x3'));var rp=require('request-promise');var moment=require(_0x5578('0x4'));var BPromise=require(_0x5578('0x5'));var Mustache=require(_0x5578('0x6'));var util=require(_0x5578('0x7'));var path=require(_0x5578('0x8'));var sox=require('sox');var csv=require(_0x5578('0x9'));var ejs=require(_0x5578('0xa'));var fs=require('fs');var fs_extra=require(_0x5578('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5578('0xc'));var jsforce=require(_0x5578('0xd'));var deskjs=require(_0x5578('0xe'));var toCsv=require(_0x5578('0x9'));var querystring=require(_0x5578('0xf'));var Papa=require(_0x5578('0x10'));var Redis=require(_0x5578('0x11'));var authService=require(_0x5578('0x12'));var qs=require(_0x5578('0x13'));var as=require(_0x5578('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5578('0x15'))(_0x5578('0x16'));var utils=require('../../config/utils');var config=require(_0x5578('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5578('0x18'))['db'];function respondWithStatusCode(_0x5a22ed,_0x43cccb){_0x43cccb=_0x43cccb||0xcc;return function(_0x4f4733){if(_0x4f4733){return _0x5a22ed[_0x5578('0x19')](_0x43cccb);}return _0x5a22ed[_0x5578('0x1a')](_0x43cccb)[_0x5578('0x1b')]();};}function respondWithResult(_0x51b3b2,_0x129c22){_0x129c22=_0x129c22||0xc8;return function(_0x302882){if(_0x302882){return _0x51b3b2[_0x5578('0x1a')](_0x129c22)[_0x5578('0x1c')](_0x302882);}};}function respondWithFilteredResult(_0x1bba86,_0x424fff){return function(_0x460b0d){if(_0x460b0d){var _0x1a3603=typeof _0x424fff['offset']===_0x5578('0x1d')&&typeof _0x424fff[_0x5578('0x1e')]===_0x5578('0x1d');var _0x4e392b=_0x460b0d[_0x5578('0x1f')];var _0x288e61=_0x1a3603?0x0:_0x424fff[_0x5578('0x20')];var _0x1ba9af=_0x1a3603?_0x460b0d['count']:_0x424fff[_0x5578('0x20')]+_0x424fff[_0x5578('0x1e')];var _0x816d0b;if(_0x1ba9af>=_0x4e392b){_0x1ba9af=_0x4e392b;_0x816d0b=0xc8;}else{_0x816d0b=0xce;}_0x1bba86['status'](_0x816d0b);return _0x1bba86[_0x5578('0x21')](_0x5578('0x22'),_0x288e61+'-'+_0x1ba9af+'/'+_0x4e392b)[_0x5578('0x1c')](_0x460b0d);}return null;};}function patchUpdates(_0x22efa3){return function(_0x424e4a){try{jsonpatch['apply'](_0x424e4a,_0x22efa3,!![]);}catch(_0xbf41bf){return BPromise['reject'](_0xbf41bf);}return _0x424e4a[_0x5578('0x23')]();};}function saveUpdates(_0x532ffc,_0x4e325b){return function(_0x21822f){if(_0x21822f){return _0x21822f[_0x5578('0x24')](_0x532ffc)['then'](function(_0x316a6b){return _0x316a6b;});}return null;};}function removeEntity(_0x2b9837,_0x277085){return function(_0x38ff6f){if(_0x38ff6f){return _0x38ff6f[_0x5578('0x25')]()[_0x5578('0x26')](function(){var _0x4a987e=_0x38ff6f[_0x5578('0x27')]({'plain':!![]});var _0x2711b6=_0x5578('0x28');return db['UserProfileResource'][_0x5578('0x25')]({'where':{'type':_0x2711b6,'resourceId':_0x4a987e['id']}})['then'](function(){return _0x38ff6f;});})[_0x5578('0x26')](function(){_0x2b9837['status'](0xcc)[_0x5578('0x1b')]();});}};}function handleEntityNotFound(_0xb831f7,_0x2dbbc1){return function(_0x31de6f){if(!_0x31de6f){_0xb831f7[_0x5578('0x19')](0x194);}return _0x31de6f;};}function handleError(_0x246d23,_0x10a07d){_0x10a07d=_0x10a07d||0x1f4;return function(_0xd60e65){logger[_0x5578('0x29')](_0xd60e65['stack']);if(_0xd60e65[_0x5578('0x2a')]){delete _0xd60e65[_0x5578('0x2a')];}_0x246d23[_0x5578('0x1a')](_0x10a07d)['send'](_0xd60e65);};}exports['index']=function(_0x6cf891,_0x1f6462){var _0x1e278f={},_0xea61b0={},_0x21c971={'count':0x0,'rows':[]};var _0x13ae4f=_[_0x5578('0x2b')](db[_0x5578('0x2c')][_0x5578('0x2d')],function(_0xf97a04){return{'name':_0xf97a04[_0x5578('0x2e')],'type':_0xf97a04[_0x5578('0x2f')]['key']};});_0xea61b0[_0x5578('0x30')]=_['map'](_0x13ae4f,_0x5578('0x2a'));_0xea61b0[_0x5578('0x31')]=_['keys'](_0x6cf891[_0x5578('0x31')]);_0xea61b0[_0x5578('0x32')]=_[_0x5578('0x33')](_0xea61b0[_0x5578('0x30')],_0xea61b0['query']);_0x1e278f[_0x5578('0x34')]=_[_0x5578('0x33')](_0xea61b0['model'],qs[_0x5578('0x35')](_0x6cf891['query']['fields']));_0x1e278f[_0x5578('0x34')]=_0x1e278f['attributes'][_0x5578('0x36')]?_0x1e278f[_0x5578('0x34')]:_0xea61b0[_0x5578('0x30')];if(!_0x6cf891[_0x5578('0x31')][_0x5578('0x37')](_0x5578('0x38'))){_0x1e278f[_0x5578('0x1e')]=qs[_0x5578('0x1e')](_0x6cf891['query'][_0x5578('0x1e')]);_0x1e278f[_0x5578('0x20')]=qs[_0x5578('0x20')](_0x6cf891[_0x5578('0x31')][_0x5578('0x20')]);}_0x1e278f[_0x5578('0x39')]=qs['sort'](_0x6cf891[_0x5578('0x31')][_0x5578('0x3a')]);_0x1e278f['where']=qs['filters'](_[_0x5578('0x3b')](_0x6cf891['query'],_0xea61b0[_0x5578('0x32')]),_0x13ae4f);if(_0x6cf891[_0x5578('0x31')][_0x5578('0x3c')]){_0x1e278f[_0x5578('0x3d')]=_[_0x5578('0x3e')](_0x1e278f[_0x5578('0x3d')],{'$or':_[_0x5578('0x2b')](_0x13ae4f,function(_0x2e14b4){if(_0x2e14b4[_0x5578('0x2f')]!=='VIRTUAL'){var _0x1ec567={};_0x1ec567[_0x2e14b4['name']]={'$like':'%'+_0x6cf891[_0x5578('0x31')][_0x5578('0x3c')]+'%'};return _0x1ec567;}})});}_0x1e278f=_[_0x5578('0x3e')]({},_0x1e278f,_0x6cf891['options']);var _0x1d4bd6={'where':_0x1e278f['where']};return db[_0x5578('0x2c')][_0x5578('0x1f')](_0x1d4bd6)[_0x5578('0x26')](function(_0x16b40b){_0x21c971[_0x5578('0x1f')]=_0x16b40b;if(_0x6cf891[_0x5578('0x31')][_0x5578('0x3f')]){_0x1e278f[_0x5578('0x40')]=[{'all':!![]}];}return db[_0x5578('0x2c')]['findAll'](_0x1e278f);})[_0x5578('0x26')](function(_0x586f96){_0x21c971[_0x5578('0x41')]=_0x586f96;return _0x21c971;})[_0x5578('0x26')](respondWithFilteredResult(_0x1f6462,_0x1e278f))[_0x5578('0x42')](handleError(_0x1f6462,null));};exports[_0x5578('0x43')]=function(_0x4cde49,_0x3a8431){var _0x46cdfb={'raw':!![],'where':{'id':_0x4cde49[_0x5578('0x44')]['id']}},_0x1049e6={};_0x1049e6[_0x5578('0x30')]=_[_0x5578('0x45')](db['AnalyticExtractedReport'][_0x5578('0x2d')]);_0x1049e6['query']=_[_0x5578('0x45')](_0x4cde49[_0x5578('0x31')]);_0x1049e6['filters']=_['intersection'](_0x1049e6['model'],_0x1049e6[_0x5578('0x31')]);_0x46cdfb[_0x5578('0x34')]=_['intersection'](_0x1049e6[_0x5578('0x30')],qs['fields'](_0x4cde49[_0x5578('0x31')][_0x5578('0x35')]));_0x46cdfb['attributes']=_0x46cdfb[_0x5578('0x34')][_0x5578('0x36')]?_0x46cdfb[_0x5578('0x34')]:_0x1049e6[_0x5578('0x30')];if(_0x4cde49[_0x5578('0x31')][_0x5578('0x3f')]){_0x46cdfb[_0x5578('0x40')]=[{'all':!![]}];}_0x46cdfb=_[_0x5578('0x3e')]({},_0x46cdfb,_0x4cde49[_0x5578('0x46')]);return db['AnalyticExtractedReport'][_0x5578('0x47')](_0x46cdfb)[_0x5578('0x26')](handleEntityNotFound(_0x3a8431,null))['then'](respondWithResult(_0x3a8431,null))['catch'](handleError(_0x3a8431,null));};exports['create']=function(_0x417e1f,_0x49224d){return db[_0x5578('0x2c')]['create'](_0x417e1f[_0x5578('0x48')],{})['then'](function(_0x2b8acf){var _0x1ebe2c=_0x417e1f['user'][_0x5578('0x27')]({'plain':!![]});if(!_0x1ebe2c)throw new Error(_0x5578('0x49'));if(_0x1ebe2c['role']==='user'){var _0x48576a=_0x2b8acf[_0x5578('0x27')]({'plain':!![]});var _0x148c45=_0x5578('0x28');return db[_0x5578('0x4a')][_0x5578('0x47')]({'where':{'name':_0x148c45,'userProfileId':_0x1ebe2c['userProfileId']},'raw':!![]})[_0x5578('0x26')](function(_0x150b30){if(_0x150b30&&_0x150b30['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x48576a[_0x5578('0x2a')],'resourceId':_0x48576a['id'],'type':_0x150b30['name'],'sectionId':_0x150b30['id']},{})[_0x5578('0x26')](function(){return _0x2b8acf;});}else{return _0x2b8acf;}})[_0x5578('0x42')](function(_0x40fcbc){logger['error'](_0x5578('0x4b'),_0x40fcbc);throw _0x40fcbc;});}return _0x2b8acf;})[_0x5578('0x26')](respondWithResult(_0x49224d,0xc9))[_0x5578('0x42')](handleError(_0x49224d,null));};exports['update']=function(_0x4602c1,_0xd067d4){if(_0x4602c1['body']['id']){delete _0x4602c1['body']['id'];}return db[_0x5578('0x2c')][_0x5578('0x47')]({'where':{'id':_0x4602c1['params']['id']}})['then'](handleEntityNotFound(_0xd067d4,null))[_0x5578('0x26')](saveUpdates(_0x4602c1[_0x5578('0x48')],null))[_0x5578('0x26')](respondWithResult(_0xd067d4,null))['catch'](handleError(_0xd067d4,null));};exports[_0x5578('0x25')]=function(_0x1b1e5a,_0xb45d55){return db[_0x5578('0x2c')]['find']({'where':{'id':_0x1b1e5a[_0x5578('0x44')]['id']}})[_0x5578('0x26')](handleEntityNotFound(_0xb45d55,null))[_0x5578('0x26')](removeEntity(_0xb45d55,null))[_0x5578('0x42')](handleError(_0xb45d55,null));};exports['download']=function(_0x2f6d15,_0x34e5f7,_0x29bc19){return db[_0x5578('0x2c')][_0x5578('0x47')]({'where':{'id':_0x2f6d15[_0x5578('0x44')]['id']},'attributes':[_0x5578('0x2a'),_0x5578('0x4c'),'savename',_0x5578('0x4d')],'raw':!![]})[_0x5578('0x26')](handleEntityNotFound(_0x34e5f7,null))['then'](function(_0x416df1){if(_0x416df1){if(!fs[_0x5578('0x4e')](path['join'](config[_0x5578('0x4f')],_0x5578('0x50'),_0x416df1[_0x5578('0x51')]))){throw new db[(_0x5578('0x52'))]['ValidationError'](_0x5578('0x53'));}if(_0x2f6d15[_0x5578('0x31')][_0x5578('0x54')]){return _0x34e5f7[_0x5578('0x19')](0xc8);}return _0x34e5f7[_0x5578('0x55')](path['join'](config[_0x5578('0x4f')],_0x5578('0x50'),_0x416df1['savename']),util[_0x5578('0x56')](_0x5578('0x57'),_0x416df1[_0x5578('0x4c')]||_0x416df1['name'],_0x416df1[_0x5578('0x4d')][_0x5578('0x58')]()));}})[_0x5578('0x42')](handleError(_0x34e5f7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index e2e9e59..0adb29d 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 _0xf554=['rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x52d753,_0x360501){var _0x3675a7=function(_0x27bf3a){while(--_0x27bf3a){_0x52d753['push'](_0x52d753['shift']());}};_0x3675a7(++_0x360501);}(_0xf554,0x179));var _0x4f55=function(_0x4a9089,_0x21689c){_0x4a9089=_0x4a9089-0x0;var _0x1ec4dd=_0xf554[_0x4a9089];return _0x1ec4dd;};'use strict';var _=require(_0x4f55('0x0'));var util=require(_0x4f55('0x1'));var logger=require(_0x4f55('0x2'))(_0x4f55('0x3'));var moment=require(_0x4f55('0x4'));var BPromise=require(_0x4f55('0x5'));var rp=require(_0x4f55('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f55('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f55('0x8'));module['exports']=function(_0x25cab8,_0x2577b0){return _0x25cab8[_0x4f55('0x9')](_0x4f55('0xa'),attributes,{'tableName':_0x4f55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1d4=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd1d4,0xa0));var _0x4d1d=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xd1d4[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var logger=require(_0x4d1d('0x2'))(_0x4d1d('0x3'));var moment=require(_0x4d1d('0x4'));var BPromise=require(_0x4d1d('0x5'));var rp=require(_0x4d1d('0x6'));var fs=require('fs');var path=require(_0x4d1d('0x7'));var rimraf=require(_0x4d1d('0x8'));var config=require(_0x4d1d('0x9'));var attributes=require(_0x4d1d('0xa'));module[_0x4d1d('0xb')]=function(_0x4bf5e0,_0x3b50e4){return _0x4bf5e0[_0x4d1d('0xc')](_0x4d1d('0xd'),attributes,{'tableName':_0x4d1d('0xe'),'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 8405ead..393b314 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 _0x0dd7=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x508c13,_0x55c30a){var _0x3b694a=function(_0x4f1147){while(--_0x4f1147){_0x508c13['push'](_0x508c13['shift']());}};_0x3b694a(++_0x55c30a);}(_0x0dd7,0x1eb));var _0x70dd=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x0dd7[_0x295a3d];return _0x23a732;};'use strict';var _=require('lodash');var util=require(_0x70dd('0x0'));var moment=require(_0x70dd('0x1'));var BPromise=require(_0x70dd('0x2'));var rs=require(_0x70dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x70dd('0x4'))(_0x70dd('0x5'));var config=require('../../config/environment');var jayson=require(_0x70dd('0x6'));var client=jayson[_0x70dd('0x7')][_0x70dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f2428,_0x58acd2,_0x47fb84){return new BPromise(function(_0x1b2785,_0x1c89c9){return client[_0x70dd('0x9')](_0x4f2428,_0x47fb84)[_0x70dd('0xa')](function(_0xda1823){logger[_0x70dd('0xb')](_0x70dd('0xc'),_0x58acd2,_0x70dd('0xd'));logger[_0x70dd('0xe')](_0x70dd('0xf'),_0x58acd2,'request\x20sent',JSON[_0x70dd('0x10')](_0xda1823));if(_0xda1823['error']){if(_0xda1823[_0x70dd('0x11')]['code']===0x1f4){logger['error'](_0x70dd('0xc'),_0x58acd2,_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);return _0x1c89c9(_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);}logger[_0x70dd('0x11')](_0x70dd('0xc'),_0x58acd2,_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);return _0x1b2785(_0xda1823[_0x70dd('0x11')][_0x70dd('0x12')]);}else{logger['info'](_0x70dd('0xc'),_0x58acd2,'request\x20sent');_0x1b2785(_0xda1823[_0x70dd('0x13')][_0x70dd('0x12')]);}})[_0x70dd('0x14')](function(_0x42142b){logger[_0x70dd('0x11')](_0x70dd('0xc'),_0x58acd2,_0x42142b);_0x1c89c9(_0x42142b);});});} \ No newline at end of file +var _0x9d9a=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x110346,_0x376aa7){var _0x4f5944=function(_0x3868fd){while(--_0x3868fd){_0x110346['push'](_0x110346['shift']());}};_0x4f5944(++_0x376aa7);}(_0x9d9a,0x15b));var _0xa9d9=function(_0x144d3c,_0x1c8394){_0x144d3c=_0x144d3c-0x0;var _0x25af78=_0x9d9a[_0x144d3c];return _0x25af78;};'use strict';var _=require(_0xa9d9('0x0'));var util=require('util');var moment=require(_0xa9d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9d9('0x2'));var fs=require('fs');var Redis=require(_0xa9d9('0x3'));var db=require(_0xa9d9('0x4'))['db'];var utils=require(_0xa9d9('0x5'));var logger=require(_0xa9d9('0x6'))('rpc');var config=require(_0xa9d9('0x7'));var jayson=require(_0xa9d9('0x8'));var client=jayson[_0xa9d9('0x9')][_0xa9d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539d46,_0x2b94b5,_0x2499bd){return new BPromise(function(_0x227037,_0x3bd180){return client[_0xa9d9('0xb')](_0x539d46,_0x2499bd)[_0xa9d9('0xc')](function(_0x4b1d67){logger[_0xa9d9('0xd')](_0xa9d9('0xe'),_0x2b94b5,_0xa9d9('0xf'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2b94b5,_0xa9d9('0xf'),JSON[_0xa9d9('0x10')](_0x4b1d67));if(_0x4b1d67[_0xa9d9('0x11')]){if(_0x4b1d67[_0xa9d9('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2b94b5,_0x4b1d67['error']['message']);return _0x3bd180(_0x4b1d67['error']['message']);}logger[_0xa9d9('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2b94b5,_0x4b1d67[_0xa9d9('0x11')][_0xa9d9('0x12')]);return _0x227037(_0x4b1d67['error'][_0xa9d9('0x12')]);}else{logger[_0xa9d9('0xd')](_0xa9d9('0xe'),_0x2b94b5,_0xa9d9('0xf'));_0x227037(_0x4b1d67[_0xa9d9('0x13')][_0xa9d9('0x12')]);}})['catch'](function(_0x1b773e){logger[_0xa9d9('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2b94b5,_0x1b773e);_0x3bd180(_0x1b773e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 76afee9..bacdc68 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 _0x1919=['isAuthenticated','index','download','post','create','put','/:id','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get'];(function(_0x31adf9,_0x511868){var _0x4412b5=function(_0x192d84){while(--_0x192d84){_0x31adf9['push'](_0x31adf9['shift']());}};_0x4412b5(++_0x511868);}(_0x1919,0xe6));var _0x9191=function(_0x2c57e6,_0x3d81b0){_0x2c57e6=_0x2c57e6-0x0;var _0x2a0e49=_0x1919[_0x2c57e6];return _0x2a0e49;};'use strict';var multer=require(_0x9191('0x0'));var util=require(_0x9191('0x1'));var path=require(_0x9191('0x2'));var timeout=require('connect-timeout');var express=require(_0x9191('0x3'));var router=express['Router']();var fs_extra=require(_0x9191('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9191('0x5'));var config=require('../../config/environment');var controller=require(_0x9191('0x6'));router[_0x9191('0x7')]('/',auth[_0x9191('0x8')](),controller[_0x9191('0x9')]);router[_0x9191('0x7')]('/:id',auth[_0x9191('0x8')](),controller['show']);router[_0x9191('0x7')]('/:id/download',auth[_0x9191('0x8')](),controller[_0x9191('0xa')]);router[_0x9191('0xb')]('/',auth[_0x9191('0x8')](),controller[_0x9191('0xc')]);router[_0x9191('0xd')](_0x9191('0xe'),auth[_0x9191('0x8')](),controller['update']);router[_0x9191('0xf')](_0x9191('0xe'),auth[_0x9191('0x8')](),controller['destroy']);module[_0x9191('0x10')]=router; \ No newline at end of file +var _0x40ac=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put'];(function(_0x207bb0,_0x35db80){var _0x96729e=function(_0x502f5e){while(--_0x502f5e){_0x207bb0['push'](_0x207bb0['shift']());}};_0x96729e(++_0x35db80);}(_0x40ac,0x87));var _0xc40a=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x40ac[_0xe501ff];return _0x17135d;};'use strict';var multer=require(_0xc40a('0x0'));var util=require(_0xc40a('0x1'));var path=require(_0xc40a('0x2'));var timeout=require(_0xc40a('0x3'));var express=require('express');var router=express[_0xc40a('0x4')]();var fs_extra=require(_0xc40a('0x5'));var auth=require(_0xc40a('0x6'));var interaction=require(_0xc40a('0x7'));var config=require(_0xc40a('0x8'));var controller=require(_0xc40a('0x9'));router[_0xc40a('0xa')]('/',auth[_0xc40a('0xb')](),controller[_0xc40a('0xc')]);router[_0xc40a('0xa')](_0xc40a('0xd'),auth[_0xc40a('0xb')](),controller[_0xc40a('0xe')]);router[_0xc40a('0xa')](_0xc40a('0xf'),auth[_0xc40a('0xb')](),controller['download']);router[_0xc40a('0x10')]('/',auth['isAuthenticated'](),controller[_0xc40a('0x11')]);router[_0xc40a('0x12')]('/:id',auth[_0xc40a('0xb')](),controller[_0xc40a('0x13')]);router['delete'](_0xc40a('0xd'),auth[_0xc40a('0xb')](),controller[_0xc40a('0x14')]);module[_0xc40a('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0c2a1f2..12e1518 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 _0x9f4b=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5ba53d,_0x4ccc51){var _0x5636d4=function(_0xa18adb){while(--_0xa18adb){_0x5ba53d['push'](_0x5ba53d['shift']());}};_0x5636d4(++_0x4ccc51);}(_0x9f4b,0x1dd));var _0xb9f4=function(_0x17ad94,_0x726a31){_0x17ad94=_0x17ad94-0x0;var _0x914400=_0x9f4b[_0x17ad94];return _0x914400;};'use strict';var Sequelize=require(_0xb9f4('0x0'));module[_0xb9f4('0x1')]={'field':{'type':Sequelize[_0xb9f4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb9f4('0x3')]},'format':{'type':Sequelize[_0xb9f4('0x3')]},'groupBy':{'type':Sequelize[_0xb9f4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb9f4('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5732=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x313005,_0x146871){var _0xa15008=function(_0x196e45){while(--_0x196e45){_0x313005['push'](_0x313005['shift']());}};_0xa15008(++_0x146871);}(_0x5732,0x1f3));var _0x2573=function(_0x110a23,_0x46b308){_0x110a23=_0x110a23-0x0;var _0x30305d=_0x5732[_0x110a23];return _0x30305d;};'use strict';var Sequelize=require(_0x2573('0x0'));module[_0x2573('0x1')]={'field':{'type':Sequelize[_0x2573('0x2')]},'alias':{'type':Sequelize[_0x2573('0x3')]},'function':{'type':Sequelize[_0x2573('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x2573('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2573('0x3')]},'custom':{'type':Sequelize[_0x2573('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 95fa70b..34cc1d6 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 _0xe7be=['../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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'];(function(_0x310514,_0x36e0d8){var _0x61c6a9=function(_0x25509e){while(--_0x25509e){_0x310514['push'](_0x310514['shift']());}};_0x61c6a9(++_0x36e0d8);}(_0xe7be,0x144));var _0xee7b=function(_0x26b1b8,_0x35bfd4){_0x26b1b8=_0x26b1b8-0x0;var _0x401762=_0xe7be[_0x26b1b8];return _0x401762;};'use strict';var emlformat=require(_0xee7b('0x0'));var rimraf=require(_0xee7b('0x1'));var zipdir=require(_0xee7b('0x2'));var jsonpatch=require(_0xee7b('0x3'));var rp=require(_0xee7b('0x4'));var moment=require(_0xee7b('0x5'));var BPromise=require(_0xee7b('0x6'));var Mustache=require(_0xee7b('0x7'));var util=require(_0xee7b('0x8'));var path=require(_0xee7b('0x9'));var sox=require(_0xee7b('0xa'));var csv=require(_0xee7b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee7b('0xc'));var _=require(_0xee7b('0xd'));var squel=require('squel');var crypto=require(_0xee7b('0xe'));var jsforce=require(_0xee7b('0xf'));var deskjs=require(_0xee7b('0x10'));var toCsv=require(_0xee7b('0xb'));var querystring=require(_0xee7b('0x11'));var Papa=require(_0xee7b('0x12'));var Redis=require(_0xee7b('0x13'));var authService=require(_0xee7b('0x14'));var qs=require(_0xee7b('0x15'));var as=require(_0xee7b('0x16'));var hardwareService=require(_0xee7b('0x17'));var logger=require(_0xee7b('0x18'))(_0xee7b('0x19'));var utils=require('../../config/utils');var config=require(_0xee7b('0x1a'));var licenseUtil=require(_0xee7b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247b06,_0x3914e6){_0x3914e6=_0x3914e6||0xcc;return function(_0x19da8f){if(_0x19da8f){return _0x247b06[_0xee7b('0x1c')](_0x3914e6);}return _0x247b06[_0xee7b('0x1d')](_0x3914e6)['end']();};}function respondWithResult(_0x501ede,_0x23e465){_0x23e465=_0x23e465||0xc8;return function(_0x258137){if(_0x258137){return _0x501ede[_0xee7b('0x1d')](_0x23e465)['json'](_0x258137);}};}function respondWithFilteredResult(_0x3fd048,_0x131bb2){return function(_0x542ce2){if(_0x542ce2){var _0x19c5af=typeof _0x131bb2[_0xee7b('0x1e')]===_0xee7b('0x1f')&&typeof _0x131bb2[_0xee7b('0x20')]==='undefined';var _0x11460d=_0x542ce2['count'];var _0x184041=_0x19c5af?0x0:_0x131bb2['offset'];var _0x218c8d=_0x19c5af?_0x542ce2[_0xee7b('0x21')]:_0x131bb2['offset']+_0x131bb2[_0xee7b('0x20')];var _0x272720;if(_0x218c8d>=_0x11460d){_0x218c8d=_0x11460d;_0x272720=0xc8;}else{_0x272720=0xce;}_0x3fd048['status'](_0x272720);return _0x3fd048[_0xee7b('0x22')]('Content-Range',_0x184041+'-'+_0x218c8d+'/'+_0x11460d)['json'](_0x542ce2);}return null;};}function patchUpdates(_0x286919){return function(_0x55f637){try{jsonpatch[_0xee7b('0x23')](_0x55f637,_0x286919,!![]);}catch(_0x57776c){return BPromise[_0xee7b('0x24')](_0x57776c);}return _0x55f637[_0xee7b('0x25')]();};}function saveUpdates(_0x1d9c41,_0x10b917){return function(_0x11b0cc){if(_0x11b0cc){return _0x11b0cc[_0xee7b('0x26')](_0x1d9c41)[_0xee7b('0x27')](function(_0x283e51){return _0x283e51;});}return null;};}function removeEntity(_0x3132a7,_0x3b0b5c){return function(_0x3527c6){if(_0x3527c6){return _0x3527c6['destroy']()[_0xee7b('0x27')](function(){_0x3132a7['status'](0xcc)[_0xee7b('0x28')]();});}};}function handleEntityNotFound(_0x5bd76c,_0x123bae){return function(_0x38db7b){if(!_0x38db7b){_0x5bd76c[_0xee7b('0x1c')](0x194);}return _0x38db7b;};}function handleError(_0x1dbee9,_0x413e4c){_0x413e4c=_0x413e4c||0x1f4;return function(_0x25f913){logger[_0xee7b('0x29')](_0x25f913[_0xee7b('0x2a')]);if(_0x25f913[_0xee7b('0x2b')]){delete _0x25f913[_0xee7b('0x2b')];}_0x1dbee9['status'](_0x413e4c)[_0xee7b('0x2c')](_0x25f913);};}exports[_0xee7b('0x2d')]=function(_0x40ea00,_0x5451e6){var _0x1d1055={},_0x45fa88={},_0x9525e7={'count':0x0,'rows':[]};var _0xd64897=_[_0xee7b('0x2e')](db[_0xee7b('0x2f')][_0xee7b('0x30')],function(_0x57e289){return{'name':_0x57e289['fieldName'],'type':_0x57e289[_0xee7b('0x31')][_0xee7b('0x32')]};});_0x45fa88[_0xee7b('0x33')]=_[_0xee7b('0x2e')](_0xd64897,_0xee7b('0x2b'));_0x45fa88[_0xee7b('0x34')]=_[_0xee7b('0x35')](_0x40ea00[_0xee7b('0x34')]);_0x45fa88[_0xee7b('0x36')]=_[_0xee7b('0x37')](_0x45fa88['model'],_0x45fa88['query']);_0x1d1055['attributes']=_['intersection'](_0x45fa88[_0xee7b('0x33')],qs[_0xee7b('0x38')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x38')]));_0x1d1055[_0xee7b('0x39')]=_0x1d1055['attributes'][_0xee7b('0x3a')]?_0x1d1055[_0xee7b('0x39')]:_0x45fa88[_0xee7b('0x33')];if(!_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3b')](_0xee7b('0x3c'))){_0x1d1055['limit']=qs[_0xee7b('0x20')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x20')]);_0x1d1055[_0xee7b('0x1e')]=qs[_0xee7b('0x1e')](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x1e')]);}_0x1d1055['order']=qs['sort'](_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3d')]);_0x1d1055['where']=qs[_0xee7b('0x36')](_[_0xee7b('0x3e')](_0x40ea00[_0xee7b('0x34')],_0x45fa88[_0xee7b('0x36')]),_0xd64897);if(_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3f')]){_0x1d1055[_0xee7b('0x40')]=_['merge'](_0x1d1055[_0xee7b('0x40')],{'$or':_[_0xee7b('0x2e')](_0xd64897,function(_0x3f1a3f){if(_0x3f1a3f[_0xee7b('0x31')]!==_0xee7b('0x41')){var _0x316b20={};_0x316b20[_0x3f1a3f[_0xee7b('0x2b')]]={'$like':'%'+_0x40ea00[_0xee7b('0x34')][_0xee7b('0x3f')]+'%'};return _0x316b20;}})});}_0x1d1055=_[_0xee7b('0x42')]({},_0x1d1055,_0x40ea00[_0xee7b('0x43')]);var _0x2050b1={'where':_0x1d1055[_0xee7b('0x40')]};return db[_0xee7b('0x2f')][_0xee7b('0x21')](_0x2050b1)['then'](function(_0x10e119){_0x9525e7[_0xee7b('0x21')]=_0x10e119;if(_0x40ea00['query'][_0xee7b('0x44')]){_0x1d1055[_0xee7b('0x45')]=[{'all':!![]}];}return db[_0xee7b('0x2f')][_0xee7b('0x46')](_0x1d1055);})[_0xee7b('0x27')](function(_0x349ae9){_0x9525e7[_0xee7b('0x47')]=_0x349ae9;return _0x9525e7;})['then'](respondWithFilteredResult(_0x5451e6,_0x1d1055))[_0xee7b('0x48')](handleError(_0x5451e6,null));};exports[_0xee7b('0x49')]=function(_0x293afd,_0x2e200f){var _0x3367c0={'raw':![],'where':{'id':_0x293afd[_0xee7b('0x4a')]['id']}},_0x46ffbe={};_0x46ffbe[_0xee7b('0x33')]=_['keys'](db[_0xee7b('0x2f')]['rawAttributes']);_0x46ffbe[_0xee7b('0x34')]=_[_0xee7b('0x35')](_0x293afd[_0xee7b('0x34')]);_0x46ffbe[_0xee7b('0x36')]=_['intersection'](_0x46ffbe[_0xee7b('0x33')],_0x46ffbe[_0xee7b('0x34')]);_0x3367c0[_0xee7b('0x39')]=_[_0xee7b('0x37')](_0x46ffbe[_0xee7b('0x33')],qs[_0xee7b('0x38')](_0x293afd['query']['fields']));_0x3367c0['attributes']=_0x3367c0[_0xee7b('0x39')]['length']?_0x3367c0[_0xee7b('0x39')]:_0x46ffbe[_0xee7b('0x33')];if(_0x293afd[_0xee7b('0x34')][_0xee7b('0x44')]){_0x3367c0['include']=[{'all':!![]}];}_0x3367c0=_[_0xee7b('0x42')]({},_0x3367c0,_0x293afd[_0xee7b('0x43')]);return db[_0xee7b('0x2f')][_0xee7b('0x4b')](_0x3367c0)[_0xee7b('0x27')](handleEntityNotFound(_0x2e200f,null))[_0xee7b('0x27')](respondWithResult(_0x2e200f,null))[_0xee7b('0x48')](handleError(_0x2e200f,null));};exports[_0xee7b('0x4c')]=function(_0x43fb3c,_0x3f5ce5){return db[_0xee7b('0x2f')][_0xee7b('0x4c')](_0x43fb3c[_0xee7b('0x4d')],{})['then'](respondWithResult(_0x3f5ce5,0xc9))[_0xee7b('0x48')](handleError(_0x3f5ce5,null));};exports[_0xee7b('0x4e')]=function(_0x6491b6,_0x24a88b){return db['AnalyticFieldReport']['bulkCreate'](_0x6491b6[_0xee7b('0x4d')],{'raw':![],'individualHooks':!![]})[_0xee7b('0x27')](respondWithResult(_0x24a88b,0xc9))['catch'](handleError(_0x24a88b,null));};exports['update']=function(_0x561f05,_0x50b5ba){if(_0x561f05[_0xee7b('0x4d')]['id']){delete _0x561f05[_0xee7b('0x4d')]['id'];}return db['AnalyticFieldReport'][_0xee7b('0x4b')]({'where':{'id':_0x561f05[_0xee7b('0x4a')]['id']}})[_0xee7b('0x27')](handleEntityNotFound(_0x50b5ba,null))[_0xee7b('0x27')](saveUpdates(_0x561f05[_0xee7b('0x4d')],null))['then'](respondWithResult(_0x50b5ba,null))[_0xee7b('0x48')](handleError(_0x50b5ba,null));};exports[_0xee7b('0x4f')]=function(_0x248849,_0xa94594){return db[_0xee7b('0x2f')][_0xee7b('0x4b')]({'where':{'id':_0x248849[_0xee7b('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa94594,null))['then'](removeEntity(_0xa94594,null))['catch'](handleError(_0xa94594,null));};exports[_0xee7b('0x50')]=function(_0x56fb34,_0x51ba53){return db[_0xee7b('0x2f')][_0xee7b('0x4f')]({'where':{'id':_0x56fb34[_0xee7b('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xee7b('0x27')](respondWithResult(_0x51ba53,0xcc))[_0xee7b('0x48')](handleError(_0x51ba53,null));};exports[_0xee7b('0x51')]=function(_0x470182,_0x219310,_0x12fa28){return db[_0xee7b('0x52')][_0xee7b('0x53')]({'where':{'id':_0x470182[_0xee7b('0x4a')]['id']}})[_0xee7b('0x27')](handleEntityNotFound(_0x219310,null))[_0xee7b('0x27')](function(_0x4a6f79){if(_0x4a6f79){return db[_0xee7b('0x54')][_0xee7b('0x55')](function(_0x35d4d7){return db[_0xee7b('0x2f')][_0xee7b('0x4f')]({'where':{'CustomReportId':_0x470182[_0xee7b('0x4a')]['id']},'transaction':_0x35d4d7})[_0xee7b('0x27')](function(_0x310fb0){var _0x54a0ca=_[_0xee7b('0x2e')](_0x470182['body'],function(_0x2a0275){delete _0x2a0275['id'];_0x2a0275[_0xee7b('0x56')]=_0x470182['params']['id'];return _0x2a0275;});return db['AnalyticFieldReport'][_0xee7b('0x4e')](_0x54a0ca,{'transaction':_0x35d4d7});});})[_0xee7b('0x27')](function(){return db['AnalyticFieldReport'][_0xee7b('0x46')]({'where':{'CustomReportId':_0x470182[_0xee7b('0x4a')]['id']}});});}})[_0xee7b('0x27')](respondWithResult(_0x219310,null))[_0xee7b('0x48')](handleError(_0x219310,null));}; \ No newline at end of file +var _0x31df=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','params','rawAttributes','fields','length','options','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x1644e5,_0x31ac5f){var _0x5bc914=function(_0x2302a1){while(--_0x2302a1){_0x1644e5['push'](_0x1644e5['shift']());}};_0x5bc914(++_0x31ac5f);}(_0x31df,0xf0));var _0xf31d=function(_0x2b6069,_0x4788a4){_0x2b6069=_0x2b6069-0x0;var _0x23b3b5=_0x31df[_0x2b6069];return _0x23b3b5;};'use strict';var emlformat=require(_0xf31d('0x0'));var rimraf=require(_0xf31d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf31d('0x2'));var rp=require(_0xf31d('0x3'));var moment=require(_0xf31d('0x4'));var BPromise=require(_0xf31d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf31d('0x6'));var sox=require(_0xf31d('0x7'));var csv=require('to-csv');var ejs=require(_0xf31d('0x8'));var fs=require('fs');var fs_extra=require(_0xf31d('0x9'));var _=require(_0xf31d('0xa'));var squel=require(_0xf31d('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31d('0xc'));var deskjs=require(_0xf31d('0xd'));var toCsv=require(_0xf31d('0xe'));var querystring=require(_0xf31d('0xf'));var Papa=require(_0xf31d('0x10'));var Redis=require(_0xf31d('0x11'));var authService=require(_0xf31d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf31d('0x13'));var hardwareService=require(_0xf31d('0x14'));var logger=require(_0xf31d('0x15'))(_0xf31d('0x16'));var utils=require(_0xf31d('0x17'));var config=require(_0xf31d('0x18'));var licenseUtil=require(_0xf31d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4793f3,_0x492de6){_0x492de6=_0x492de6||0xcc;return function(_0x4efccd){if(_0x4efccd){return _0x4793f3[_0xf31d('0x1a')](_0x492de6);}return _0x4793f3[_0xf31d('0x1b')](_0x492de6)[_0xf31d('0x1c')]();};}function respondWithResult(_0x21dca1,_0x355a23){_0x355a23=_0x355a23||0xc8;return function(_0x4bdede){if(_0x4bdede){return _0x21dca1[_0xf31d('0x1b')](_0x355a23)[_0xf31d('0x1d')](_0x4bdede);}};}function respondWithFilteredResult(_0x499866,_0x57c486){return function(_0x26d2f8){if(_0x26d2f8){var _0x264538=typeof _0x57c486['offset']===_0xf31d('0x1e')&&typeof _0x57c486[_0xf31d('0x1f')]==='undefined';var _0x86c1af=_0x26d2f8[_0xf31d('0x20')];var _0x495828=_0x264538?0x0:_0x57c486['offset'];var _0x2abee6=_0x264538?_0x26d2f8[_0xf31d('0x20')]:_0x57c486[_0xf31d('0x21')]+_0x57c486[_0xf31d('0x1f')];var _0x1655a2;if(_0x2abee6>=_0x86c1af){_0x2abee6=_0x86c1af;_0x1655a2=0xc8;}else{_0x1655a2=0xce;}_0x499866[_0xf31d('0x1b')](_0x1655a2);return _0x499866[_0xf31d('0x22')](_0xf31d('0x23'),_0x495828+'-'+_0x2abee6+'/'+_0x86c1af)[_0xf31d('0x1d')](_0x26d2f8);}return null;};}function patchUpdates(_0x4333a7){return function(_0x1bab1f){try{jsonpatch[_0xf31d('0x24')](_0x1bab1f,_0x4333a7,!![]);}catch(_0x54066e){return BPromise['reject'](_0x54066e);}return _0x1bab1f[_0xf31d('0x25')]();};}function saveUpdates(_0x25ed26,_0xba8fea){return function(_0x428fe6){if(_0x428fe6){return _0x428fe6[_0xf31d('0x26')](_0x25ed26)[_0xf31d('0x27')](function(_0x50742f){return _0x50742f;});}return null;};}function removeEntity(_0x29db22,_0x17e532){return function(_0x7d7d37){if(_0x7d7d37){return _0x7d7d37[_0xf31d('0x28')]()['then'](function(){_0x29db22['status'](0xcc)[_0xf31d('0x1c')]();});}};}function handleEntityNotFound(_0x35a347,_0x1f42f6){return function(_0x5c8d36){if(!_0x5c8d36){_0x35a347[_0xf31d('0x1a')](0x194);}return _0x5c8d36;};}function handleError(_0x4372f0,_0xeaf0a5){_0xeaf0a5=_0xeaf0a5||0x1f4;return function(_0x35a180){logger[_0xf31d('0x29')](_0x35a180[_0xf31d('0x2a')]);if(_0x35a180[_0xf31d('0x2b')]){delete _0x35a180['name'];}_0x4372f0[_0xf31d('0x1b')](_0xeaf0a5)[_0xf31d('0x2c')](_0x35a180);};}exports['index']=function(_0xa682c7,_0x211a6a){var _0x46a765={},_0x1c6068={},_0x5b8343={'count':0x0,'rows':[]};var _0x2d0c64=_[_0xf31d('0x2d')](db[_0xf31d('0x2e')]['rawAttributes'],function(_0x1cbdf7){return{'name':_0x1cbdf7[_0xf31d('0x2f')],'type':_0x1cbdf7[_0xf31d('0x30')][_0xf31d('0x31')]};});_0x1c6068[_0xf31d('0x32')]=_['map'](_0x2d0c64,_0xf31d('0x2b'));_0x1c6068['query']=_[_0xf31d('0x33')](_0xa682c7[_0xf31d('0x34')]);_0x1c6068[_0xf31d('0x35')]=_[_0xf31d('0x36')](_0x1c6068['model'],_0x1c6068[_0xf31d('0x34')]);_0x46a765[_0xf31d('0x37')]=_[_0xf31d('0x36')](_0x1c6068['model'],qs['fields'](_0xa682c7[_0xf31d('0x34')]['fields']));_0x46a765[_0xf31d('0x37')]=_0x46a765[_0xf31d('0x37')]['length']?_0x46a765[_0xf31d('0x37')]:_0x1c6068[_0xf31d('0x32')];if(!_0xa682c7[_0xf31d('0x34')][_0xf31d('0x38')](_0xf31d('0x39'))){_0x46a765[_0xf31d('0x1f')]=qs[_0xf31d('0x1f')](_0xa682c7[_0xf31d('0x34')][_0xf31d('0x1f')]);_0x46a765[_0xf31d('0x21')]=qs[_0xf31d('0x21')](_0xa682c7[_0xf31d('0x34')][_0xf31d('0x21')]);}_0x46a765[_0xf31d('0x3a')]=qs[_0xf31d('0x3b')](_0xa682c7[_0xf31d('0x34')][_0xf31d('0x3b')]);_0x46a765[_0xf31d('0x3c')]=qs[_0xf31d('0x35')](_[_0xf31d('0x3d')](_0xa682c7[_0xf31d('0x34')],_0x1c6068['filters']),_0x2d0c64);if(_0xa682c7[_0xf31d('0x34')][_0xf31d('0x3e')]){_0x46a765['where']=_['merge'](_0x46a765[_0xf31d('0x3c')],{'$or':_[_0xf31d('0x2d')](_0x2d0c64,function(_0x434a30){if(_0x434a30['type']!==_0xf31d('0x3f')){var _0x1db699={};_0x1db699[_0x434a30[_0xf31d('0x2b')]]={'$like':'%'+_0xa682c7[_0xf31d('0x34')][_0xf31d('0x3e')]+'%'};return _0x1db699;}})});}_0x46a765=_[_0xf31d('0x40')]({},_0x46a765,_0xa682c7['options']);var _0x1ad1d9={'where':_0x46a765[_0xf31d('0x3c')]};return db['AnalyticFieldReport'][_0xf31d('0x20')](_0x1ad1d9)[_0xf31d('0x27')](function(_0x5abac6){_0x5b8343[_0xf31d('0x20')]=_0x5abac6;if(_0xa682c7[_0xf31d('0x34')][_0xf31d('0x41')]){_0x46a765[_0xf31d('0x42')]=[{'all':!![]}];}return db[_0xf31d('0x2e')]['findAll'](_0x46a765);})[_0xf31d('0x27')](function(_0x12cf24){_0x5b8343['rows']=_0x12cf24;return _0x5b8343;})['then'](respondWithFilteredResult(_0x211a6a,_0x46a765))[_0xf31d('0x43')](handleError(_0x211a6a,null));};exports['show']=function(_0x1f5455,_0x5a2bf6){var _0x5becc1={'raw':![],'where':{'id':_0x1f5455[_0xf31d('0x44')]['id']}},_0x2362b1={};_0x2362b1['model']=_[_0xf31d('0x33')](db[_0xf31d('0x2e')][_0xf31d('0x45')]);_0x2362b1[_0xf31d('0x34')]=_['keys'](_0x1f5455['query']);_0x2362b1[_0xf31d('0x35')]=_[_0xf31d('0x36')](_0x2362b1[_0xf31d('0x32')],_0x2362b1[_0xf31d('0x34')]);_0x5becc1['attributes']=_[_0xf31d('0x36')](_0x2362b1['model'],qs[_0xf31d('0x46')](_0x1f5455[_0xf31d('0x34')][_0xf31d('0x46')]));_0x5becc1[_0xf31d('0x37')]=_0x5becc1[_0xf31d('0x37')][_0xf31d('0x47')]?_0x5becc1[_0xf31d('0x37')]:_0x2362b1[_0xf31d('0x32')];if(_0x1f5455[_0xf31d('0x34')]['includeAll']){_0x5becc1[_0xf31d('0x42')]=[{'all':!![]}];}_0x5becc1=_[_0xf31d('0x40')]({},_0x5becc1,_0x1f5455[_0xf31d('0x48')]);return db[_0xf31d('0x2e')][_0xf31d('0x49')](_0x5becc1)[_0xf31d('0x27')](handleEntityNotFound(_0x5a2bf6,null))[_0xf31d('0x27')](respondWithResult(_0x5a2bf6,null))[_0xf31d('0x43')](handleError(_0x5a2bf6,null));};exports['create']=function(_0x2de21d,_0x3c422c){return db[_0xf31d('0x2e')][_0xf31d('0x4a')](_0x2de21d['body'],{})[_0xf31d('0x27')](respondWithResult(_0x3c422c,0xc9))[_0xf31d('0x43')](handleError(_0x3c422c,null));};exports[_0xf31d('0x4b')]=function(_0x167ba2,_0x5d3de4){return db[_0xf31d('0x2e')]['bulkCreate'](_0x167ba2[_0xf31d('0x4c')],{'raw':![],'individualHooks':!![]})[_0xf31d('0x27')](respondWithResult(_0x5d3de4,0xc9))[_0xf31d('0x43')](handleError(_0x5d3de4,null));};exports[_0xf31d('0x26')]=function(_0x198a3e,_0xdeccee){if(_0x198a3e[_0xf31d('0x4c')]['id']){delete _0x198a3e[_0xf31d('0x4c')]['id'];}return db[_0xf31d('0x2e')][_0xf31d('0x49')]({'where':{'id':_0x198a3e[_0xf31d('0x44')]['id']}})[_0xf31d('0x27')](handleEntityNotFound(_0xdeccee,null))[_0xf31d('0x27')](saveUpdates(_0x198a3e[_0xf31d('0x4c')],null))[_0xf31d('0x27')](respondWithResult(_0xdeccee,null))[_0xf31d('0x43')](handleError(_0xdeccee,null));};exports[_0xf31d('0x28')]=function(_0x4a5954,_0x589c48){return db['AnalyticFieldReport'][_0xf31d('0x49')]({'where':{'id':_0x4a5954['params']['id']}})[_0xf31d('0x27')](handleEntityNotFound(_0x589c48,null))[_0xf31d('0x27')](removeEntity(_0x589c48,null))[_0xf31d('0x43')](handleError(_0x589c48,null));};exports[_0xf31d('0x4d')]=function(_0x1b39c4,_0x204811){return db[_0xf31d('0x2e')][_0xf31d('0x28')]({'where':{'id':_0x1b39c4[_0xf31d('0x34')][_0xf31d('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xf31d('0x27')](respondWithResult(_0x204811,0xcc))['catch'](handleError(_0x204811,null));};exports[_0xf31d('0x4f')]=function(_0x526619,_0x208f34,_0x390c4f){return db[_0xf31d('0x50')][_0xf31d('0x51')]({'where':{'id':_0x526619[_0xf31d('0x44')]['id']}})[_0xf31d('0x27')](handleEntityNotFound(_0x208f34,null))['then'](function(_0x36354d){if(_0x36354d){return db[_0xf31d('0x52')][_0xf31d('0x53')](function(_0x6b0c12){return db[_0xf31d('0x2e')][_0xf31d('0x28')]({'where':{'CustomReportId':_0x526619[_0xf31d('0x44')]['id']},'transaction':_0x6b0c12})[_0xf31d('0x27')](function(_0x53ee9f){var _0x1171cb=_[_0xf31d('0x2d')](_0x526619[_0xf31d('0x4c')],function(_0x4fec1f){delete _0x4fec1f['id'];_0x4fec1f[_0xf31d('0x54')]=_0x526619['params']['id'];return _0x4fec1f;});return db[_0xf31d('0x2e')][_0xf31d('0x4b')](_0x1171cb,{'transaction':_0x6b0c12});});})[_0xf31d('0x27')](function(){return db[_0xf31d('0x2e')]['findAll']({'where':{'CustomReportId':_0x526619['params']['id']}});});}})['then'](respondWithResult(_0x208f34,null))[_0xf31d('0x43')](handleError(_0x208f34,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0b04f50..458810d 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 _0xbd66=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticFieldReport.attributes'];(function(_0x2c54db,_0x4decb4){var _0x40c4e4=function(_0x22acbc){while(--_0x22acbc){_0x2c54db['push'](_0x2c54db['shift']());}};_0x40c4e4(++_0x4decb4);}(_0xbd66,0x1a4));var _0x6bd6=function(_0x565cc0,_0x21eda8){_0x565cc0=_0x565cc0-0x0;var _0x38a572=_0xbd66[_0x565cc0];return _0x38a572;};'use strict';var _=require(_0x6bd6('0x0'));var util=require(_0x6bd6('0x1'));var logger=require(_0x6bd6('0x2'))(_0x6bd6('0x3'));var moment=require(_0x6bd6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6bd6('0x5'));var fs=require('fs');var path=require(_0x6bd6('0x6'));var rimraf=require(_0x6bd6('0x7'));var config=require('../../config/environment');var attributes=require(_0x6bd6('0x8'));module[_0x6bd6('0x9')]=function(_0x4a433d,_0x204124){return _0x4a433d[_0x6bd6('0xa')](_0x6bd6('0xb'),attributes,{'tableName':_0x6bd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22bd=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x22bd,0x9d));var _0xd22b=function(_0xc9f95b,_0x317464){_0xc9f95b=_0xc9f95b-0x0;var _0x145cf1=_0x22bd[_0xc9f95b];return _0x145cf1;};'use strict';var _=require('lodash');var util=require(_0xd22b('0x0'));var logger=require(_0xd22b('0x1'))(_0xd22b('0x2'));var moment=require(_0xd22b('0x3'));var BPromise=require(_0xd22b('0x4'));var rp=require(_0xd22b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd22b('0x6'));var config=require(_0xd22b('0x7'));var attributes=require(_0xd22b('0x8'));module[_0xd22b('0x9')]=function(_0x4f823b,_0x31ede9){return _0x4f823b[_0xd22b('0xa')](_0xd22b('0xb'),attributes,{'tableName':_0xd22b('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 fde5a93..63d9a9a 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 _0x31a2=['info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x2a3922,_0x225dd2){var _0x3ccc8c=function(_0x3d972a){while(--_0x3d972a){_0x2a3922['push'](_0x2a3922['shift']());}};_0x3ccc8c(++_0x225dd2);}(_0x31a2,0x74));var _0x231a=function(_0x4578ec,_0x3ffc5f){_0x4578ec=_0x4578ec-0x0;var _0x20d678=_0x31a2[_0x4578ec];return _0x20d678;};'use strict';var _=require(_0x231a('0x0'));var util=require('util');var moment=require(_0x231a('0x1'));var BPromise=require('bluebird');var rs=require(_0x231a('0x2'));var fs=require('fs');var Redis=require(_0x231a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x231a('0x4'));var logger=require(_0x231a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x231a('0x6'));var client=jayson[_0x231a('0x7')][_0x231a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf137,_0x24e71d,_0x2fbf8f){return new BPromise(function(_0x2bb4c4,_0x3e2a4d){return client['request'](_0x1bf137,_0x2fbf8f)[_0x231a('0x9')](function(_0x11fc14){logger[_0x231a('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x231a('0xb'));logger[_0x231a('0xc')](_0x231a('0xd'),_0x24e71d,_0x231a('0xb'),JSON[_0x231a('0xe')](_0x11fc14));if(_0x11fc14['error']){if(_0x11fc14[_0x231a('0xf')][_0x231a('0x10')]===0x1f4){logger['error'](_0x231a('0x11'),_0x24e71d,_0x11fc14['error'][_0x231a('0x12')]);return _0x3e2a4d(_0x11fc14[_0x231a('0xf')][_0x231a('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x11fc14[_0x231a('0xf')]['message']);return _0x2bb4c4(_0x11fc14['error'][_0x231a('0x12')]);}else{logger[_0x231a('0xa')](_0x231a('0x11'),_0x24e71d,'request\x20sent');_0x2bb4c4(_0x11fc14[_0x231a('0x13')][_0x231a('0x12')]);}})[_0x231a('0x14')](function(_0x2c4c43){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x24e71d,_0x2c4c43);_0x3e2a4d(_0x2c4c43);});});} \ No newline at end of file +var _0xed25=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4c8d89,_0x352a35){var _0x3605b8=function(_0x30dc3d){while(--_0x30dc3d){_0x4c8d89['push'](_0x4c8d89['shift']());}};_0x3605b8(++_0x352a35);}(_0xed25,0x8a));var _0x5ed2=function(_0x34947e,_0x45c404){_0x34947e=_0x34947e-0x0;var _0x87404f=_0xed25[_0x34947e];return _0x87404f;};'use strict';var _=require(_0x5ed2('0x0'));var util=require(_0x5ed2('0x1'));var moment=require(_0x5ed2('0x2'));var BPromise=require(_0x5ed2('0x3'));var rs=require(_0x5ed2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ed2('0x5'))['db'];var utils=require(_0x5ed2('0x6'));var logger=require(_0x5ed2('0x7'))(_0x5ed2('0x8'));var config=require(_0x5ed2('0x9'));var jayson=require(_0x5ed2('0xa'));var client=jayson[_0x5ed2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x562d49,_0x4d48dc,_0x53035e){return new BPromise(function(_0xaa0735,_0x715e4f){return client['request'](_0x562d49,_0x53035e)[_0x5ed2('0xc')](function(_0x5bd013){logger[_0x5ed2('0xd')](_0x5ed2('0xe'),_0x4d48dc,_0x5ed2('0xf'));logger[_0x5ed2('0x10')](_0x5ed2('0x11'),_0x4d48dc,_0x5ed2('0xf'),JSON['stringify'](_0x5bd013));if(_0x5bd013['error']){if(_0x5bd013[_0x5ed2('0x12')][_0x5ed2('0x13')]===0x1f4){logger[_0x5ed2('0x12')](_0x5ed2('0xe'),_0x4d48dc,_0x5bd013[_0x5ed2('0x12')]['message']);return _0x715e4f(_0x5bd013[_0x5ed2('0x12')][_0x5ed2('0x14')]);}logger[_0x5ed2('0x12')](_0x5ed2('0xe'),_0x4d48dc,_0x5bd013[_0x5ed2('0x12')][_0x5ed2('0x14')]);return _0xaa0735(_0x5bd013[_0x5ed2('0x12')]['message']);}else{logger[_0x5ed2('0xd')](_0x5ed2('0xe'),_0x4d48dc,'request\x20sent');_0xaa0735(_0x5bd013['result']['message']);}})[_0x5ed2('0x15')](function(_0x3170ed){logger['error'](_0x5ed2('0xe'),_0x4d48dc,_0x3170ed);_0x715e4f(_0x3170ed);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c268212..e56ed21 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(_0x3314fc,_0x458af5){var _0xe4b348=function(_0x51fd7b){while(--_0x51fd7b){_0x3314fc['push'](_0x3314fc['shift']());}};_0xe4b348(++_0x458af5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x583947,_0x2b02fd){var _0x1a84d2=function(_0x257c90){while(--_0x257c90){_0x583947['push'](_0x583947['shift']());}};_0x1a84d2(++_0x2b02fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 818932e..2637ff7 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 _0x4517=['TEXT','exports','STRING'];(function(_0x346392,_0x32b724){var _0xd76262=function(_0x9d1a6d){while(--_0x9d1a6d){_0x346392['push'](_0x346392['shift']());}};_0xd76262(++_0x32b724);}(_0x4517,0x112));var _0x7451=function(_0x4b7d89,_0x5bc779){_0x4b7d89=_0x4b7d89-0x0;var _0x32e3f5=_0x4517[_0x4b7d89];return _0x32e3f5;};'use strict';var Sequelize=require('sequelize');module[_0x7451('0x0')]={'name':{'type':Sequelize[_0x7451('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7451('0x1')]},'metric':{'type':Sequelize[_0x7451('0x2')]},'description':{'type':Sequelize[_0x7451('0x1')]}}; \ No newline at end of file +var _0x6e6c=['exports','name','STRING','sequelize'];(function(_0x401205,_0x6604b){var _0xb2c28e=function(_0x573b5e){while(--_0x573b5e){_0x401205['push'](_0x401205['shift']());}};_0xb2c28e(++_0x6604b);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc6e6('0x2')},'table':{'type':Sequelize[_0xc6e6('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7864ae7..d2aa438 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 _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x57a071,_0x3bdfec){var _0x25173b=function(_0x4127a1){while(--_0x4127a1){_0x57a071['push'](_0x57a071['shift']());}};_0x25173b(++_0x3bdfec);}(_0x8ef6,0xf2));var _0x68ef=function(_0x22e1a1,_0x5495bf){_0x22e1a1=_0x22e1a1-0x0;var _0x591c52=_0x8ef6[_0x22e1a1];return _0x591c52;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file +var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0x81bd,0x7c));var _0xd81b=function(_0x43186d,_0x4b40ec){_0x43186d=_0x43186d-0x0;var _0x5f562c=_0x81bd[_0x43186d];return _0x5f562c;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index eb07b37..9ff6a1b 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 _0xc949=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics'];(function(_0x108b48,_0x831aa4){var _0x50cb8a=function(_0x50facc){while(--_0x50facc){_0x108b48['push'](_0x108b48['shift']());}};_0x50cb8a(++_0x831aa4);}(_0xc949,0x181));var _0x9c94=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xc949[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x9c94('0x0'));var util=require('util');var logger=require(_0x9c94('0x1'))(_0x9c94('0x2'));var moment=require(_0x9c94('0x3'));var BPromise=require(_0x9c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c94('0x5'));var rimraf=require(_0x9c94('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c94('0x7'));module[_0x9c94('0x8')]=function(_0x46d560,_0x1357ac){return _0x46d560['define'](_0x9c94('0x9'),attributes,{'tableName':_0x9c94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x7217,0x19e));var _0x7721=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7217[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index daf9808..b77beb7 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 _0x5124=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x51986b,_0x264a62){var _0x290fec=function(_0x4ebeed){while(--_0x4ebeed){_0x51986b['push'](_0x51986b['shift']());}};_0x290fec(++_0x264a62);}(_0x5124,0x19e));var _0x4512=function(_0x1bb949,_0x440e54){_0x1bb949=_0x1bb949-0x0;var _0x2fee3f=_0x5124[_0x1bb949];return _0x2fee3f;};'use strict';var _=require(_0x4512('0x0'));var util=require(_0x4512('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4512('0x2'));var fs=require('fs');var Redis=require(_0x4512('0x3'));var db=require(_0x4512('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4512('0x5'))(_0x4512('0x6'));var config=require(_0x4512('0x7'));var jayson=require(_0x4512('0x8'));var client=jayson[_0x4512('0x9')][_0x4512('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51bed9,_0x524eaa,_0x431ce2){return new BPromise(function(_0x5641e0,_0x2ea6f1){return client[_0x4512('0xb')](_0x51bed9,_0x431ce2)[_0x4512('0xc')](function(_0x3eb169){logger[_0x4512('0xd')](_0x4512('0xe'),_0x524eaa,_0x4512('0xf'));logger[_0x4512('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x524eaa,'request\x20sent',JSON[_0x4512('0x11')](_0x3eb169));if(_0x3eb169[_0x4512('0x12')]){if(_0x3eb169['error'][_0x4512('0x13')]===0x1f4){logger[_0x4512('0x12')](_0x4512('0xe'),_0x524eaa,_0x3eb169[_0x4512('0x12')][_0x4512('0x14')]);return _0x2ea6f1(_0x3eb169['error'][_0x4512('0x14')]);}logger['error'](_0x4512('0xe'),_0x524eaa,_0x3eb169['error'][_0x4512('0x14')]);return _0x5641e0(_0x3eb169[_0x4512('0x12')][_0x4512('0x14')]);}else{logger[_0x4512('0xd')](_0x4512('0xe'),_0x524eaa,'request\x20sent');_0x5641e0(_0x3eb169[_0x4512('0x15')][_0x4512('0x14')]);}})[_0x4512('0x16')](function(_0x1adac6){logger[_0x4512('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x524eaa,_0x1adac6);_0x2ea6f1(_0x1adac6);});});} \ No newline at end of file +var _0x103a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x103a,0x140));var _0xa103=function(_0x4898bb,_0x3038d8){_0x4898bb=_0x4898bb-0x0;var _0x48cfd0=_0x103a[_0x4898bb];return _0x48cfd0;};'use strict';var _=require(_0xa103('0x0'));var util=require(_0xa103('0x1'));var moment=require(_0xa103('0x2'));var BPromise=require('bluebird');var rs=require(_0xa103('0x3'));var fs=require('fs');var Redis=require(_0xa103('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa103('0x5'));var logger=require(_0xa103('0x6'))(_0xa103('0x7'));var config=require(_0xa103('0x8'));var jayson=require(_0xa103('0x9'));var client=jayson[_0xa103('0xa')][_0xa103('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1782d1,_0x2a9d68,_0x45fce1){return new BPromise(function(_0x4c71fb,_0x30bebd){return client[_0xa103('0xc')](_0x1782d1,_0x45fce1)[_0xa103('0xd')](function(_0x431de8){logger['info'](_0xa103('0xe'),_0x2a9d68,'request\x20sent');logger[_0xa103('0xf')](_0xa103('0x10'),_0x2a9d68,_0xa103('0x11'),JSON[_0xa103('0x12')](_0x431de8));if(_0x431de8['error']){if(_0x431de8[_0xa103('0x13')][_0xa103('0x14')]===0x1f4){logger[_0xa103('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x2a9d68,_0x431de8[_0xa103('0x13')]['message']);return _0x30bebd(_0x431de8[_0xa103('0x13')][_0xa103('0x15')]);}logger[_0xa103('0x13')](_0xa103('0xe'),_0x2a9d68,_0x431de8[_0xa103('0x13')][_0xa103('0x15')]);return _0x4c71fb(_0x431de8[_0xa103('0x13')][_0xa103('0x15')]);}else{logger[_0xa103('0x16')](_0xa103('0xe'),_0x2a9d68,_0xa103('0x11'));_0x4c71fb(_0x431de8[_0xa103('0x17')][_0xa103('0x15')]);}})[_0xa103('0x18')](function(_0x587262){logger[_0xa103('0x13')](_0xa103('0xe'),_0x2a9d68,_0x587262);_0x30bebd(_0x587262);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f57eef0..ceb5ae8 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 _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x4624d7,_0x3240a9){var _0x47c4a6=function(_0x77cd61){while(--_0x77cd61){_0x4624d7['push'](_0x4624d7['shift']());}};_0x47c4a6(++_0x3240a9);}(_0x85d0,0x164));var _0x085d=function(_0x31d211,_0x1228b6){_0x31d211=_0x31d211-0x0;var _0x51d5d3=_0x85d0[_0x31d211];return _0x51d5d3;};'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('./analyticMetric.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0xa')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')](_0x085d('0x8'),auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);module[_0x085d('0x11')]=router; \ No newline at end of file +var _0x78b7=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x69498d,_0x52da2c){var _0x249216=function(_0x4d952f){while(--_0x4d952f){_0x69498d['push'](_0x69498d['shift']());}};_0x249216(++_0x52da2c);}(_0x78b7,0x194));var _0x778b=function(_0x299a9f,_0x1d08ef){_0x299a9f=_0x299a9f-0x0;var _0x10b86f=_0x78b7[_0x299a9f];return _0x10b86f;};'use strict';var multer=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var path=require('path');var timeout=require(_0x778b('0x2'));var express=require(_0x778b('0x3'));var router=express[_0x778b('0x4')]();var fs_extra=require(_0x778b('0x5'));var auth=require(_0x778b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x778b('0x7'));router[_0x778b('0x8')]('/',auth[_0x778b('0x9')](),controller[_0x778b('0xa')]);router[_0x778b('0x8')](_0x778b('0xb'),auth['isAuthenticated'](),controller[_0x778b('0xc')]);router[_0x778b('0xd')]('/',auth[_0x778b('0x9')](),controller[_0x778b('0xe')]);router[_0x778b('0xf')]('/:id',auth[_0x778b('0x9')](),controller[_0x778b('0x10')]);router['delete'](_0x778b('0xb'),auth[_0x778b('0x9')](),controller[_0x778b('0x11')]);module[_0x778b('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5a23cf0..cea0715 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 _0x79b6=['TEXT','sequelize'];(function(_0x4e39ad,_0x5516de){var _0x127035=function(_0x5a95db){while(--_0x5a95db){_0x4e39ad['push'](_0x4e39ad['shift']());}};_0x127035(++_0x5516de);}(_0x79b6,0x103));var _0x679b=function(_0x2a3d48,_0x5202fe){_0x2a3d48=_0x2a3d48-0x0;var _0xfc12=_0x79b6[_0x2a3d48];return _0xfc12;};'use strict';var Sequelize=require(_0x679b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x679b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb81c=['TEXT','exports'];(function(_0x3d7299,_0x1b9b59){var _0x164c83=function(_0x38e371){while(--_0x38e371){_0x3d7299['push'](_0x3d7299['shift']());}};_0x164c83(++_0x1b9b59);}(_0xb81c,0x11f));var _0xcb81=function(_0x292150,_0x23c46f){_0x292150=_0x292150-0x0;var _0x2b827e=_0xb81c[_0x292150];return _0x2b827e;};'use strict';var Sequelize=require('sequelize');module[_0xcb81('0x0')]={'tree':{'type':Sequelize[_0xcb81('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a1d8cc9..d4ab1ec 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 _0xb2a4=['sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0xc525c7,_0x75f8b8){var _0x2cf314=function(_0x3c0463){while(--_0x3c0463){_0xc525c7['push'](_0xc525c7['shift']());}};_0x2cf314(++_0x75f8b8);}(_0xb2a4,0x13e));var _0x4b2a=function(_0xae7acf,_0x5913eb){_0xae7acf=_0xae7acf-0x0;var _0x260263=_0xb2a4[_0xae7acf];return _0x260263;};'use strict';var emlformat=require(_0x4b2a('0x0'));var rimraf=require(_0x4b2a('0x1'));var zipdir=require(_0x4b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b2a('0x3'));var moment=require('moment');var BPromise=require(_0x4b2a('0x4'));var Mustache=require('mustache');var util=require(_0x4b2a('0x5'));var path=require(_0x4b2a('0x6'));var sox=require('sox');var csv=require(_0x4b2a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b2a('0x8'));var _=require('lodash');var squel=require(_0x4b2a('0x9'));var crypto=require(_0x4b2a('0xa'));var jsforce=require(_0x4b2a('0xb'));var deskjs=require(_0x4b2a('0xc'));var toCsv=require(_0x4b2a('0x7'));var querystring=require(_0x4b2a('0xd'));var Papa=require(_0x4b2a('0xe'));var Redis=require(_0x4b2a('0xf'));var authService=require(_0x4b2a('0x10'));var qs=require(_0x4b2a('0x11'));var as=require(_0x4b2a('0x12'));var hardwareService=require(_0x4b2a('0x13'));var logger=require(_0x4b2a('0x14'))('api');var utils=require(_0x4b2a('0x15'));var config=require(_0x4b2a('0x16'));var licenseUtil=require(_0x4b2a('0x17'));var db=require(_0x4b2a('0x18'))['db'];function respondWithStatusCode(_0x2281f2,_0x22dbb5){_0x22dbb5=_0x22dbb5||0xcc;return function(_0x3e555c){if(_0x3e555c){return _0x2281f2['sendStatus'](_0x22dbb5);}return _0x2281f2[_0x4b2a('0x19')](_0x22dbb5)[_0x4b2a('0x1a')]();};}function respondWithResult(_0x55483e,_0x2fde5c){_0x2fde5c=_0x2fde5c||0xc8;return function(_0x2185ea){if(_0x2185ea){return _0x55483e['status'](_0x2fde5c)[_0x4b2a('0x1b')](_0x2185ea);}};}function respondWithFilteredResult(_0x4ac727,_0x5aa4a0){return function(_0x822bdb){if(_0x822bdb){var _0x130610=typeof _0x5aa4a0[_0x4b2a('0x1c')]==='undefined'&&typeof _0x5aa4a0['limit']===_0x4b2a('0x1d');var _0x188d6c=_0x822bdb[_0x4b2a('0x1e')];var _0x1b1a42=_0x130610?0x0:_0x5aa4a0['offset'];var _0x2b0c12=_0x130610?_0x822bdb[_0x4b2a('0x1e')]:_0x5aa4a0['offset']+_0x5aa4a0[_0x4b2a('0x1f')];var _0x55e430;if(_0x2b0c12>=_0x188d6c){_0x2b0c12=_0x188d6c;_0x55e430=0xc8;}else{_0x55e430=0xce;}_0x4ac727['status'](_0x55e430);return _0x4ac727[_0x4b2a('0x20')](_0x4b2a('0x21'),_0x1b1a42+'-'+_0x2b0c12+'/'+_0x188d6c)['json'](_0x822bdb);}return null;};}function patchUpdates(_0x541a83){return function(_0x10986f){try{jsonpatch['apply'](_0x10986f,_0x541a83,!![]);}catch(_0x2baf67){return BPromise[_0x4b2a('0x22')](_0x2baf67);}return _0x10986f[_0x4b2a('0x23')]();};}function saveUpdates(_0x271733,_0x2fff8b){return function(_0x290da8){if(_0x290da8){return _0x290da8[_0x4b2a('0x24')](_0x271733)['then'](function(_0x3009a9){return _0x3009a9;});}return null;};}function removeEntity(_0x257140,_0xa3b344){return function(_0xf2b7f0){if(_0xf2b7f0){return _0xf2b7f0[_0x4b2a('0x25')]()[_0x4b2a('0x26')](function(){_0x257140[_0x4b2a('0x19')](0xcc)[_0x4b2a('0x1a')]();});}};}function handleEntityNotFound(_0x3c3a92,_0x575bed){return function(_0x1a9354){if(!_0x1a9354){_0x3c3a92[_0x4b2a('0x27')](0x194);}return _0x1a9354;};}function handleError(_0x4fe633,_0x1ba199){_0x1ba199=_0x1ba199||0x1f4;return function(_0x2dc68c){logger['error'](_0x2dc68c[_0x4b2a('0x28')]);if(_0x2dc68c[_0x4b2a('0x29')]){delete _0x2dc68c[_0x4b2a('0x29')];}_0x4fe633[_0x4b2a('0x19')](_0x1ba199)[_0x4b2a('0x2a')](_0x2dc68c);};}exports[_0x4b2a('0x2b')]=function(_0x4c908d,_0x561140){var _0x2dcc4f={},_0x4a9c73={},_0x1396ab={'count':0x0,'rows':[]};var _0x10c124=_[_0x4b2a('0x2c')](db[_0x4b2a('0x2d')]['rawAttributes'],function(_0x59b9b2){return{'name':_0x59b9b2[_0x4b2a('0x2e')],'type':_0x59b9b2[_0x4b2a('0x2f')]['key']};});_0x4a9c73[_0x4b2a('0x30')]=_[_0x4b2a('0x2c')](_0x10c124,_0x4b2a('0x29'));_0x4a9c73[_0x4b2a('0x31')]=_[_0x4b2a('0x32')](_0x4c908d[_0x4b2a('0x31')]);_0x4a9c73[_0x4b2a('0x33')]=_[_0x4b2a('0x34')](_0x4a9c73['model'],_0x4a9c73['query']);_0x2dcc4f[_0x4b2a('0x35')]=_['intersection'](_0x4a9c73[_0x4b2a('0x30')],qs[_0x4b2a('0x36')](_0x4c908d[_0x4b2a('0x31')][_0x4b2a('0x36')]));_0x2dcc4f[_0x4b2a('0x35')]=_0x2dcc4f[_0x4b2a('0x35')]['length']?_0x2dcc4f[_0x4b2a('0x35')]:_0x4a9c73['model'];if(!_0x4c908d['query'][_0x4b2a('0x37')]('nolimit')){_0x2dcc4f[_0x4b2a('0x1f')]=qs[_0x4b2a('0x1f')](_0x4c908d['query']['limit']);_0x2dcc4f[_0x4b2a('0x1c')]=qs[_0x4b2a('0x1c')](_0x4c908d[_0x4b2a('0x31')]['offset']);}_0x2dcc4f[_0x4b2a('0x38')]=qs[_0x4b2a('0x39')](_0x4c908d[_0x4b2a('0x31')][_0x4b2a('0x39')]);_0x2dcc4f[_0x4b2a('0x3a')]=qs[_0x4b2a('0x33')](_[_0x4b2a('0x3b')](_0x4c908d[_0x4b2a('0x31')],_0x4a9c73[_0x4b2a('0x33')]),_0x10c124);if(_0x4c908d['query'][_0x4b2a('0x3c')]){_0x2dcc4f[_0x4b2a('0x3a')]=_['merge'](_0x2dcc4f[_0x4b2a('0x3a')],{'$or':_['map'](_0x10c124,function(_0x3add48){if(_0x3add48[_0x4b2a('0x2f')]!==_0x4b2a('0x3d')){var _0xd0f2f1={};_0xd0f2f1[_0x3add48['name']]={'$like':'%'+_0x4c908d[_0x4b2a('0x31')]['filter']+'%'};return _0xd0f2f1;}})});}_0x2dcc4f=_[_0x4b2a('0x3e')]({},_0x2dcc4f,_0x4c908d['options']);var _0x1776da={'where':_0x2dcc4f['where']};return db[_0x4b2a('0x2d')][_0x4b2a('0x1e')](_0x1776da)['then'](function(_0x39e0ff){_0x1396ab[_0x4b2a('0x1e')]=_0x39e0ff;if(_0x4c908d['query'][_0x4b2a('0x3f')]){_0x2dcc4f[_0x4b2a('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4b2a('0x41')](_0x2dcc4f);})[_0x4b2a('0x26')](function(_0x2c67c6){_0x1396ab[_0x4b2a('0x42')]=_0x2c67c6;return _0x1396ab;})[_0x4b2a('0x26')](respondWithFilteredResult(_0x561140,_0x2dcc4f))[_0x4b2a('0x43')](handleError(_0x561140,null));};exports[_0x4b2a('0x44')]=function(_0x5ba740,_0x5c9ef8){var _0x3266b5={'raw':!![],'where':{'id':_0x5ba740[_0x4b2a('0x45')]['id']}},_0x5ddfc8={};_0x5ddfc8[_0x4b2a('0x30')]=_[_0x4b2a('0x32')](db[_0x4b2a('0x2d')][_0x4b2a('0x46')]);_0x5ddfc8[_0x4b2a('0x31')]=_[_0x4b2a('0x32')](_0x5ba740['query']);_0x5ddfc8[_0x4b2a('0x33')]=_['intersection'](_0x5ddfc8[_0x4b2a('0x30')],_0x5ddfc8[_0x4b2a('0x31')]);_0x3266b5[_0x4b2a('0x35')]=_[_0x4b2a('0x34')](_0x5ddfc8[_0x4b2a('0x30')],qs[_0x4b2a('0x36')](_0x5ba740['query'][_0x4b2a('0x36')]));_0x3266b5[_0x4b2a('0x35')]=_0x3266b5['attributes'][_0x4b2a('0x47')]?_0x3266b5['attributes']:_0x5ddfc8[_0x4b2a('0x30')];if(_0x5ba740[_0x4b2a('0x31')]['includeAll']){_0x3266b5['include']=[{'all':!![]}];}_0x3266b5=_['merge']({},_0x3266b5,_0x5ba740[_0x4b2a('0x48')]);return db[_0x4b2a('0x2d')]['find'](_0x3266b5)[_0x4b2a('0x26')](handleEntityNotFound(_0x5c9ef8,null))[_0x4b2a('0x26')](respondWithResult(_0x5c9ef8,null))['catch'](handleError(_0x5c9ef8,null));};exports[_0x4b2a('0x49')]=function(_0x22c2a9,_0x504fcf){return db[_0x4b2a('0x2d')]['create'](_0x22c2a9[_0x4b2a('0x4a')],{})['then'](respondWithResult(_0x504fcf,0xc9))['catch'](handleError(_0x504fcf,null));};exports[_0x4b2a('0x24')]=function(_0x16714f,_0x3c9d79){if(_0x16714f[_0x4b2a('0x4a')]['id']){delete _0x16714f['body']['id'];}return db[_0x4b2a('0x2d')]['find']({'where':{'id':_0x16714f[_0x4b2a('0x45')]['id']}})[_0x4b2a('0x26')](handleEntityNotFound(_0x3c9d79,null))[_0x4b2a('0x26')](saveUpdates(_0x16714f['body'],null))[_0x4b2a('0x26')](respondWithResult(_0x3c9d79,null))[_0x4b2a('0x43')](handleError(_0x3c9d79,null));};exports[_0x4b2a('0x25')]=function(_0x1105f0,_0x57175b){return db[_0x4b2a('0x2d')]['find']({'where':{'id':_0x1105f0[_0x4b2a('0x45')]['id']}})['then'](handleEntityNotFound(_0x57175b,null))[_0x4b2a('0x26')](removeEntity(_0x57175b,null))[_0x4b2a('0x43')](handleError(_0x57175b,null));}; \ No newline at end of file +var _0x4a49=['include','options','create','body','find','destroy','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','end','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params'];(function(_0xead519,_0x212f82){var _0x213a07=function(_0x4b1d0a){while(--_0x4b1d0a){_0xead519['push'](_0xead519['shift']());}};_0x213a07(++_0x212f82);}(_0x4a49,0x98));var _0x94a4=function(_0x588d0d,_0xd5bc32){_0x588d0d=_0x588d0d-0x0;var _0x3b271a=_0x4a49[_0x588d0d];return _0x3b271a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94a4('0x0'));var rp=require(_0x94a4('0x1'));var moment=require(_0x94a4('0x2'));var BPromise=require(_0x94a4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x94a4('0x4'));var csv=require(_0x94a4('0x5'));var ejs=require(_0x94a4('0x6'));var fs=require('fs');var fs_extra=require(_0x94a4('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x94a4('0x8'));var jsforce=require(_0x94a4('0x9'));var deskjs=require(_0x94a4('0xa'));var toCsv=require(_0x94a4('0x5'));var querystring=require('querystring');var Papa=require(_0x94a4('0xb'));var Redis=require('ioredis');var authService=require(_0x94a4('0xc'));var qs=require(_0x94a4('0xd'));var as=require(_0x94a4('0xe'));var hardwareService=require(_0x94a4('0xf'));var logger=require(_0x94a4('0x10'))(_0x94a4('0x11'));var utils=require(_0x94a4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x94a4('0x13'));var db=require(_0x94a4('0x14'))['db'];function respondWithStatusCode(_0x4efde2,_0x127f9e){_0x127f9e=_0x127f9e||0xcc;return function(_0x4f3beb){if(_0x4f3beb){return _0x4efde2['sendStatus'](_0x127f9e);}return _0x4efde2[_0x94a4('0x15')](_0x127f9e)['end']();};}function respondWithResult(_0x4ef358,_0x1b21a0){_0x1b21a0=_0x1b21a0||0xc8;return function(_0x1a292d){if(_0x1a292d){return _0x4ef358[_0x94a4('0x15')](_0x1b21a0)['json'](_0x1a292d);}};}function respondWithFilteredResult(_0x21b594,_0x8bb0ff){return function(_0x6af704){if(_0x6af704){var _0x30253c=typeof _0x8bb0ff[_0x94a4('0x16')]==='undefined'&&typeof _0x8bb0ff[_0x94a4('0x17')]===_0x94a4('0x18');var _0x8f1d3f=_0x6af704['count'];var _0x2ca3a4=_0x30253c?0x0:_0x8bb0ff[_0x94a4('0x16')];var _0x25815f=_0x30253c?_0x6af704[_0x94a4('0x19')]:_0x8bb0ff[_0x94a4('0x16')]+_0x8bb0ff['limit'];var _0x444ee0;if(_0x25815f>=_0x8f1d3f){_0x25815f=_0x8f1d3f;_0x444ee0=0xc8;}else{_0x444ee0=0xce;}_0x21b594[_0x94a4('0x15')](_0x444ee0);return _0x21b594[_0x94a4('0x1a')](_0x94a4('0x1b'),_0x2ca3a4+'-'+_0x25815f+'/'+_0x8f1d3f)[_0x94a4('0x1c')](_0x6af704);}return null;};}function patchUpdates(_0x10d77f){return function(_0x48e4ac){try{jsonpatch['apply'](_0x48e4ac,_0x10d77f,!![]);}catch(_0x307038){return BPromise[_0x94a4('0x1d')](_0x307038);}return _0x48e4ac[_0x94a4('0x1e')]();};}function saveUpdates(_0x36e0b2,_0x46338){return function(_0x402f5b){if(_0x402f5b){return _0x402f5b[_0x94a4('0x1f')](_0x36e0b2)[_0x94a4('0x20')](function(_0x5f0df5){return _0x5f0df5;});}return null;};}function removeEntity(_0x9ba74a,_0x40b81d){return function(_0x11d00f){if(_0x11d00f){return _0x11d00f['destroy']()[_0x94a4('0x20')](function(){_0x9ba74a[_0x94a4('0x15')](0xcc)[_0x94a4('0x21')]();});}};}function handleEntityNotFound(_0x43b46c,_0x153db2){return function(_0x30540a){if(!_0x30540a){_0x43b46c[_0x94a4('0x22')](0x194);}return _0x30540a;};}function handleError(_0x3cd442,_0x3fa2ea){_0x3fa2ea=_0x3fa2ea||0x1f4;return function(_0x43e862){logger['error'](_0x43e862[_0x94a4('0x23')]);if(_0x43e862[_0x94a4('0x24')]){delete _0x43e862[_0x94a4('0x24')];}_0x3cd442[_0x94a4('0x15')](_0x3fa2ea)[_0x94a4('0x25')](_0x43e862);};}exports['index']=function(_0x5d32d1,_0x24b5e2){var _0x388da9={},_0x54f06b={},_0x3d4ea={'count':0x0,'rows':[]};var _0x58ec13=_[_0x94a4('0x26')](db[_0x94a4('0x27')][_0x94a4('0x28')],function(_0x4a1436){return{'name':_0x4a1436[_0x94a4('0x29')],'type':_0x4a1436[_0x94a4('0x2a')][_0x94a4('0x2b')]};});_0x54f06b[_0x94a4('0x2c')]=_[_0x94a4('0x26')](_0x58ec13,_0x94a4('0x24'));_0x54f06b[_0x94a4('0x2d')]=_[_0x94a4('0x2e')](_0x5d32d1[_0x94a4('0x2d')]);_0x54f06b[_0x94a4('0x2f')]=_[_0x94a4('0x30')](_0x54f06b[_0x94a4('0x2c')],_0x54f06b[_0x94a4('0x2d')]);_0x388da9[_0x94a4('0x31')]=_['intersection'](_0x54f06b[_0x94a4('0x2c')],qs[_0x94a4('0x32')](_0x5d32d1[_0x94a4('0x2d')][_0x94a4('0x32')]));_0x388da9[_0x94a4('0x31')]=_0x388da9[_0x94a4('0x31')][_0x94a4('0x33')]?_0x388da9[_0x94a4('0x31')]:_0x54f06b[_0x94a4('0x2c')];if(!_0x5d32d1['query'][_0x94a4('0x34')](_0x94a4('0x35'))){_0x388da9[_0x94a4('0x17')]=qs['limit'](_0x5d32d1[_0x94a4('0x2d')]['limit']);_0x388da9['offset']=qs[_0x94a4('0x16')](_0x5d32d1[_0x94a4('0x2d')]['offset']);}_0x388da9[_0x94a4('0x36')]=qs[_0x94a4('0x37')](_0x5d32d1[_0x94a4('0x2d')]['sort']);_0x388da9[_0x94a4('0x38')]=qs['filters'](_[_0x94a4('0x39')](_0x5d32d1[_0x94a4('0x2d')],_0x54f06b['filters']),_0x58ec13);if(_0x5d32d1[_0x94a4('0x2d')][_0x94a4('0x3a')]){_0x388da9[_0x94a4('0x38')]=_[_0x94a4('0x3b')](_0x388da9['where'],{'$or':_[_0x94a4('0x26')](_0x58ec13,function(_0x140c67){if(_0x140c67['type']!==_0x94a4('0x3c')){var _0x34eb78={};_0x34eb78[_0x140c67['name']]={'$like':'%'+_0x5d32d1[_0x94a4('0x2d')]['filter']+'%'};return _0x34eb78;}})});}_0x388da9=_['merge']({},_0x388da9,_0x5d32d1['options']);var _0x3d50be={'where':_0x388da9[_0x94a4('0x38')]};return db[_0x94a4('0x27')][_0x94a4('0x19')](_0x3d50be)[_0x94a4('0x20')](function(_0x503d39){_0x3d4ea[_0x94a4('0x19')]=_0x503d39;if(_0x5d32d1[_0x94a4('0x2d')][_0x94a4('0x3d')]){_0x388da9['include']=[{'all':!![]}];}return db[_0x94a4('0x27')][_0x94a4('0x3e')](_0x388da9);})[_0x94a4('0x20')](function(_0x248226){_0x3d4ea[_0x94a4('0x3f')]=_0x248226;return _0x3d4ea;})['then'](respondWithFilteredResult(_0x24b5e2,_0x388da9))[_0x94a4('0x40')](handleError(_0x24b5e2,null));};exports[_0x94a4('0x41')]=function(_0x24ca93,_0xd5a70b){var _0x1be3c4={'raw':!![],'where':{'id':_0x24ca93[_0x94a4('0x42')]['id']}},_0x32bc38={};_0x32bc38['model']=_['keys'](db['AnalyticTreeReport'][_0x94a4('0x28')]);_0x32bc38[_0x94a4('0x2d')]=_['keys'](_0x24ca93[_0x94a4('0x2d')]);_0x32bc38[_0x94a4('0x2f')]=_[_0x94a4('0x30')](_0x32bc38[_0x94a4('0x2c')],_0x32bc38['query']);_0x1be3c4[_0x94a4('0x31')]=_[_0x94a4('0x30')](_0x32bc38[_0x94a4('0x2c')],qs['fields'](_0x24ca93[_0x94a4('0x2d')][_0x94a4('0x32')]));_0x1be3c4[_0x94a4('0x31')]=_0x1be3c4[_0x94a4('0x31')][_0x94a4('0x33')]?_0x1be3c4[_0x94a4('0x31')]:_0x32bc38[_0x94a4('0x2c')];if(_0x24ca93['query'][_0x94a4('0x3d')]){_0x1be3c4[_0x94a4('0x43')]=[{'all':!![]}];}_0x1be3c4=_[_0x94a4('0x3b')]({},_0x1be3c4,_0x24ca93[_0x94a4('0x44')]);return db[_0x94a4('0x27')]['find'](_0x1be3c4)[_0x94a4('0x20')](handleEntityNotFound(_0xd5a70b,null))['then'](respondWithResult(_0xd5a70b,null))['catch'](handleError(_0xd5a70b,null));};exports[_0x94a4('0x45')]=function(_0x33fa13,_0x1b237b){return db['AnalyticTreeReport'][_0x94a4('0x45')](_0x33fa13[_0x94a4('0x46')],{})[_0x94a4('0x20')](respondWithResult(_0x1b237b,0xc9))[_0x94a4('0x40')](handleError(_0x1b237b,null));};exports[_0x94a4('0x1f')]=function(_0xcfa9f2,_0x418018){if(_0xcfa9f2[_0x94a4('0x46')]['id']){delete _0xcfa9f2['body']['id'];}return db[_0x94a4('0x27')][_0x94a4('0x47')]({'where':{'id':_0xcfa9f2[_0x94a4('0x42')]['id']}})[_0x94a4('0x20')](handleEntityNotFound(_0x418018,null))[_0x94a4('0x20')](saveUpdates(_0xcfa9f2[_0x94a4('0x46')],null))['then'](respondWithResult(_0x418018,null))['catch'](handleError(_0x418018,null));};exports[_0x94a4('0x48')]=function(_0x1480bf,_0x3fe87d){return db['AnalyticTreeReport'][_0x94a4('0x47')]({'where':{'id':_0x1480bf[_0x94a4('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fe87d,null))[_0x94a4('0x20')](removeEntity(_0x3fe87d,null))['catch'](handleError(_0x3fe87d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 9d98ae5..b79eea3 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 _0x7dac=['moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','define','lodash','util','../../config/logger'];(function(_0x187ff5,_0x5d4344){var _0x2f1541=function(_0x28b74b){while(--_0x28b74b){_0x187ff5['push'](_0x187ff5['shift']());}};_0x2f1541(++_0x5d4344);}(_0x7dac,0x197));var _0xc7da=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7dac[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xc7da('0x0'));var util=require(_0xc7da('0x1'));var logger=require(_0xc7da('0x2'))('api');var moment=require(_0xc7da('0x3'));var BPromise=require(_0xc7da('0x4'));var rp=require(_0xc7da('0x5'));var fs=require('fs');var path=require(_0xc7da('0x6'));var rimraf=require(_0xc7da('0x7'));var config=require('../../config/environment');var attributes=require(_0xc7da('0x8'));module['exports']=function(_0x17f945,_0x32fbdc){return _0x17f945[_0xc7da('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b1=['analytics_report_trees','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x3e2551,_0x43246c){var _0x2ba3c7=function(_0x2afa52){while(--_0x2afa52){_0x3e2551['push'](_0x3e2551['shift']());}};_0x2ba3c7(++_0x43246c);}(_0x04b1,0x85));var _0x104b=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x04b1[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0x104b('0x0'));var util=require(_0x104b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x104b('0x2'));var BPromise=require(_0x104b('0x3'));var rp=require(_0x104b('0x4'));var fs=require('fs');var path=require(_0x104b('0x5'));var rimraf=require(_0x104b('0x6'));var config=require(_0x104b('0x7'));var attributes=require(_0x104b('0x8'));module[_0x104b('0x9')]=function(_0x5e3f70,_0x29d55b){return _0x5e3f70[_0x104b('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x104b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index f7502cb..9dcf24e 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(_0x25fe20,_0x5c4098){var _0x5684d0=function(_0x221f80){while(--_0x221f80){_0x25fe20['push'](_0x25fe20['shift']());}};_0x5684d0(++_0x5c4098);}(_0xadb5,0xad));var _0x5adb=function(_0x72620c,_0x6f8efc){_0x72620c=_0x72620c-0x0;var _0x4bbce3=_0xadb5[_0x72620c];return _0x4bbce3;};'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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xf5472f,_0x11d486){_0xf5472f=_0xf5472f-0x0;var _0x5a4c54=_0x7a54[_0xf5472f];return _0x5a4c54;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index a1d4e1e..85d6528 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 _0xb175=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','update','delete'];(function(_0x28208d,_0x341c35){var _0x479c64=function(_0x4f7320){while(--_0x4f7320){_0x28208d['push'](_0x28208d['shift']());}};_0x479c64(++_0x341c35);}(_0xb175,0xce));var _0x5b17=function(_0x4d905a,_0x20e963){_0x4d905a=_0x4d905a-0x0;var _0x13fc18=_0xb175[_0x4d905a];return _0x13fc18;};'use strict';var multer=require(_0x5b17('0x0'));var util=require('util');var path=require(_0x5b17('0x1'));var timeout=require(_0x5b17('0x2'));var express=require('express');var router=express[_0x5b17('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5b17('0x4'));var interaction=require(_0x5b17('0x5'));var config=require(_0x5b17('0x6'));var controller=require(_0x5b17('0x7'));router[_0x5b17('0x8')]('/',auth[_0x5b17('0x9')](),controller[_0x5b17('0xa')]);router['get'](_0x5b17('0xb'),auth[_0x5b17('0x9')](),controller['show']);router['post']('/',auth[_0x5b17('0x9')](),controller[_0x5b17('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5b17('0xd')]);router[_0x5b17('0xe')](_0x5b17('0xb'),auth[_0x5b17('0x9')](),controller[_0x5b17('0xf')]);module[_0x5b17('0x10')]=router; \ No newline at end of file +var _0xc42c=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x375529,_0x57fddc){var _0x439ebf=function(_0x15c725){while(--_0x15c725){_0x375529['push'](_0x375529['shift']());}};_0x439ebf(++_0x57fddc);}(_0xc42c,0xeb));var _0xcc42=function(_0x3fe6be,_0xb9ac6d){_0x3fe6be=_0x3fe6be-0x0;var _0x4514ff=_0xc42c[_0x3fe6be];return _0x4514ff;};'use strict';var multer=require(_0xcc42('0x0'));var util=require(_0xcc42('0x1'));var path=require(_0xcc42('0x2'));var timeout=require(_0xcc42('0x3'));var express=require(_0xcc42('0x4'));var router=express[_0xcc42('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc42('0x6'));var interaction=require(_0xcc42('0x7'));var config=require(_0xcc42('0x8'));var controller=require(_0xcc42('0x9'));router[_0xcc42('0xa')]('/',auth[_0xcc42('0xb')](),controller[_0xcc42('0xc')]);router[_0xcc42('0xa')]('/:id',auth[_0xcc42('0xb')](),controller[_0xcc42('0xd')]);router[_0xcc42('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc42('0xf')]);router[_0xcc42('0x10')](_0xcc42('0x11'),auth['isAuthenticated'](),controller[_0xcc42('0x12')]);router[_0xcc42('0x13')](_0xcc42('0x11'),auth[_0xcc42('0xb')](),controller['destroy']);module[_0xcc42('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 51ff96d..e0258dc 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 _0x02ef=['sequelize','STRING'];(function(_0x529632,_0x11f931){var _0x3c6745=function(_0x4023af){while(--_0x4023af){_0x529632['push'](_0x529632['shift']());}};_0x3c6745(++_0x11f931);}(_0x02ef,0x11a));var _0xf02e=function(_0x5bae5f,_0x3dee66){_0x5bae5f=_0x5bae5f-0x0;var _0x1742e1=_0x02ef[_0x5bae5f];return _0x1742e1;};'use strict';var Sequelize=require(_0xf02e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf02e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf02e('0x1')]}}; \ No newline at end of file +var _0xf25a=['sequelize','exports','STRING'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf25a,0x195));var _0xaf25=function(_0xc3a57e,_0x5eec3e){_0xc3a57e=_0xc3a57e-0x0;var _0x1da4b5=_0xf25a[_0xc3a57e];return _0x1da4b5;};'use strict';var Sequelize=require(_0xaf25('0x0'));module[_0xaf25('0x1')]={'name':{'type':Sequelize[_0xaf25('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf25('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d10249e..dc25d06 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 _0xf350=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','index','map','Attachment','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','clone','createdAt','updatedAt','omit','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/logger','../../config/utils'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf350,0x151));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require(_0x0f35('0x1'));var zipdir=require(_0x0f35('0x2'));var jsonpatch=require(_0x0f35('0x3'));var rp=require('request-promise');var moment=require(_0x0f35('0x4'));var BPromise=require(_0x0f35('0x5'));var Mustache=require(_0x0f35('0x6'));var util=require('util');var path=require(_0x0f35('0x7'));var sox=require(_0x0f35('0x8'));var csv=require(_0x0f35('0x9'));var ejs=require(_0x0f35('0xa'));var fs=require('fs');var fs_extra=require(_0x0f35('0xb'));var _=require(_0x0f35('0xc'));var squel=require('squel');var crypto=require(_0x0f35('0xd'));var jsforce=require(_0x0f35('0xe'));var deskjs=require(_0x0f35('0xf'));var toCsv=require(_0x0f35('0x9'));var querystring=require(_0x0f35('0x10'));var Papa=require('papaparse');var Redis=require(_0x0f35('0x11'));var authService=require(_0x0f35('0x12'));var qs=require(_0x0f35('0x13'));var as=require(_0x0f35('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f35('0x15'))('api');var utils=require(_0x0f35('0x16'));var config=require(_0x0f35('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f35('0x18'))['db'];function respondWithStatusCode(_0x39b7d4,_0xe0c757){_0xe0c757=_0xe0c757||0xcc;return function(_0x4133e2){if(_0x4133e2){return _0x39b7d4[_0x0f35('0x19')](_0xe0c757);}return _0x39b7d4[_0x0f35('0x1a')](_0xe0c757)[_0x0f35('0x1b')]();};}function respondWithResult(_0x125d96,_0x326fa6){_0x326fa6=_0x326fa6||0xc8;return function(_0x3afe18){if(_0x3afe18){return _0x125d96[_0x0f35('0x1a')](_0x326fa6)[_0x0f35('0x1c')](_0x3afe18);}};}function respondWithFilteredResult(_0x2c39dd,_0x342168){return function(_0x48289d){if(_0x48289d){var _0x209602=typeof _0x342168['offset']===_0x0f35('0x1d')&&typeof _0x342168[_0x0f35('0x1e')]===_0x0f35('0x1d');var _0x4ce798=_0x48289d[_0x0f35('0x1f')];var _0x1a86d2=_0x209602?0x0:_0x342168[_0x0f35('0x20')];var _0x24d09a=_0x209602?_0x48289d[_0x0f35('0x1f')]:_0x342168[_0x0f35('0x20')]+_0x342168[_0x0f35('0x1e')];var _0xd26d6f;if(_0x24d09a>=_0x4ce798){_0x24d09a=_0x4ce798;_0xd26d6f=0xc8;}else{_0xd26d6f=0xce;}_0x2c39dd[_0x0f35('0x1a')](_0xd26d6f);return _0x2c39dd[_0x0f35('0x21')]('Content-Range',_0x1a86d2+'-'+_0x24d09a+'/'+_0x4ce798)['json'](_0x48289d);}return null;};}function patchUpdates(_0x51ff6e){return function(_0x50cf9f){try{jsonpatch[_0x0f35('0x22')](_0x50cf9f,_0x51ff6e,!![]);}catch(_0x51e699){return BPromise[_0x0f35('0x23')](_0x51e699);}return _0x50cf9f[_0x0f35('0x24')]();};}function saveUpdates(_0x116740,_0x239a4e){return function(_0x4e2a32){if(_0x4e2a32){return _0x4e2a32[_0x0f35('0x25')](_0x116740)[_0x0f35('0x26')](function(_0x139c8d){return _0x139c8d;});}return null;};}function removeEntity(_0x2d3ce4,_0x443d32){return function(_0x3f3cdd){if(_0x3f3cdd){return _0x3f3cdd[_0x0f35('0x27')]()[_0x0f35('0x26')](function(){_0x2d3ce4[_0x0f35('0x1a')](0xcc)[_0x0f35('0x1b')]();});}};}function handleEntityNotFound(_0x2d1072,_0xdd8cfc){return function(_0x13bc79){if(!_0x13bc79){_0x2d1072[_0x0f35('0x19')](0x194);}return _0x13bc79;};}function handleError(_0x23940c,_0x42b1f7){_0x42b1f7=_0x42b1f7||0x1f4;return function(_0x1d5745){logger[_0x0f35('0x28')](_0x1d5745[_0x0f35('0x29')]);if(_0x1d5745['name']){delete _0x1d5745['name'];}_0x23940c['status'](_0x42b1f7)['send'](_0x1d5745);};}exports[_0x0f35('0x2a')]=function(_0x13698e,_0x4d8a65){var _0x95381c={},_0x3e36de={},_0x3ed822={'count':0x0,'rows':[]};var _0x1f348d=_[_0x0f35('0x2b')](db[_0x0f35('0x2c')][_0x0f35('0x2d')],function(_0x21161d){return{'name':_0x21161d['fieldName'],'type':_0x21161d[_0x0f35('0x2e')][_0x0f35('0x2f')]};});_0x3e36de[_0x0f35('0x30')]=_[_0x0f35('0x2b')](_0x1f348d,_0x0f35('0x31'));_0x3e36de[_0x0f35('0x32')]=_[_0x0f35('0x33')](_0x13698e[_0x0f35('0x32')]);_0x3e36de[_0x0f35('0x34')]=_[_0x0f35('0x35')](_0x3e36de[_0x0f35('0x30')],_0x3e36de[_0x0f35('0x32')]);_0x95381c[_0x0f35('0x36')]=_[_0x0f35('0x35')](_0x3e36de[_0x0f35('0x30')],qs['fields'](_0x13698e[_0x0f35('0x32')][_0x0f35('0x37')]));_0x95381c[_0x0f35('0x36')]=_0x95381c[_0x0f35('0x36')]['length']?_0x95381c[_0x0f35('0x36')]:_0x3e36de['model'];if(!_0x13698e[_0x0f35('0x32')][_0x0f35('0x38')](_0x0f35('0x39'))){_0x95381c['limit']=qs['limit'](_0x13698e[_0x0f35('0x32')][_0x0f35('0x1e')]);_0x95381c[_0x0f35('0x20')]=qs['offset'](_0x13698e['query']['offset']);}_0x95381c[_0x0f35('0x3a')]=qs['sort'](_0x13698e[_0x0f35('0x32')]['sort']);_0x95381c[_0x0f35('0x3b')]=qs[_0x0f35('0x34')](_['pick'](_0x13698e['query'],_0x3e36de[_0x0f35('0x34')]),_0x1f348d);if(_0x13698e[_0x0f35('0x32')]['filter']){_0x95381c[_0x0f35('0x3b')]=_[_0x0f35('0x3c')](_0x95381c['where'],{'$or':_[_0x0f35('0x2b')](_0x1f348d,function(_0x56ed29){if(_0x56ed29[_0x0f35('0x2e')]!==_0x0f35('0x3d')){var _0x441202={};_0x441202[_0x56ed29['name']]={'$like':'%'+_0x13698e[_0x0f35('0x32')][_0x0f35('0x3e')]+'%'};return _0x441202;}})});}_0x95381c=_[_0x0f35('0x3c')]({},_0x95381c,_0x13698e[_0x0f35('0x3f')]);var _0x19b90f={'where':_0x95381c[_0x0f35('0x3b')]};return db['Attachment']['count'](_0x19b90f)[_0x0f35('0x26')](function(_0x5c3a02){_0x3ed822[_0x0f35('0x1f')]=_0x5c3a02;if(_0x13698e[_0x0f35('0x32')][_0x0f35('0x40')]){_0x95381c[_0x0f35('0x41')]=[{'all':!![]}];}return db[_0x0f35('0x2c')][_0x0f35('0x42')](_0x95381c);})['then'](function(_0x130bdb){_0x3ed822[_0x0f35('0x43')]=_0x130bdb;return _0x3ed822;})[_0x0f35('0x26')](respondWithFilteredResult(_0x4d8a65,_0x95381c))[_0x0f35('0x44')](handleError(_0x4d8a65,null));};exports[_0x0f35('0x45')]=function(_0x337063,_0x4cf3e8){var _0x3b3067={'raw':!![],'where':{'id':_0x337063[_0x0f35('0x46')]['id']}},_0x538971={};_0x538971[_0x0f35('0x30')]=_['keys'](db[_0x0f35('0x2c')][_0x0f35('0x2d')]);_0x538971[_0x0f35('0x32')]=_[_0x0f35('0x33')](_0x337063['query']);_0x538971['filters']=_['intersection'](_0x538971['model'],_0x538971[_0x0f35('0x32')]);_0x3b3067['attributes']=_[_0x0f35('0x35')](_0x538971[_0x0f35('0x30')],qs['fields'](_0x337063[_0x0f35('0x32')][_0x0f35('0x37')]));_0x3b3067['attributes']=_0x3b3067[_0x0f35('0x36')][_0x0f35('0x47')]?_0x3b3067[_0x0f35('0x36')]:_0x538971['model'];if(_0x337063['query'][_0x0f35('0x40')]){_0x3b3067[_0x0f35('0x41')]=[{'all':!![]}];}_0x3b3067=_[_0x0f35('0x3c')]({},_0x3b3067,_0x337063[_0x0f35('0x3f')]);return db['Attachment'][_0x0f35('0x48')](_0x3b3067)[_0x0f35('0x26')](handleEntityNotFound(_0x4cf3e8,null))['then'](respondWithResult(_0x4cf3e8,null))[_0x0f35('0x44')](handleError(_0x4cf3e8,null));};exports[_0x0f35('0x49')]=function(_0x1ca91f,_0x1acc21){var _0x26157d={'where':{'id':_0x1ca91f[_0x0f35('0x46')]['id']}},_0x1fb495={};_0x1fb495[_0x0f35('0x30')]=_[_0x0f35('0x33')](db[_0x0f35('0x2c')][_0x0f35('0x2d')]);_0x26157d['attributes']=_[_0x0f35('0x35')](_0x1fb495[_0x0f35('0x30')],qs[_0x0f35('0x37')](_0x1ca91f['query'][_0x0f35('0x37')]));_0x26157d[_0x0f35('0x36')]=_0x26157d[_0x0f35('0x36')]['length']?_0x26157d[_0x0f35('0x36')]:_0x1fb495[_0x0f35('0x30')];if(_0x1ca91f[_0x0f35('0x32')]['includeAll']){_0x26157d[_0x0f35('0x41')]=[{'all':!![]}];}_0x26157d=_[_0x0f35('0x3c')]({},_0x26157d,_0x1ca91f['options']);return db[_0x0f35('0x2c')]['find'](_0x26157d)['then'](handleEntityNotFound(_0x1acc21,null))['then'](function(_0x2b3025){if(_0x2b3025){var _0x144bff=_0x2b3025['get']({'plain':!![]});_0x144bff=qs['omit'](_0x144bff,['id',_0x0f35('0x4a'),_0x0f35('0x4b')]);_0x1ca91f['body']=_[_0x0f35('0x4c')](_0x1ca91f[_0x0f35('0x4d')],['id',_0x0f35('0x4a'),_0x0f35('0x4b')]);return db[_0x0f35('0x2c')][_0x0f35('0x4e')](_[_0x0f35('0x3c')](_0x144bff,_0x1ca91f['body']),{'include':_0x1ca91f['query'][_0x0f35('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1acc21,0xc9))[_0x0f35('0x44')](handleError(_0x1acc21,null));};exports[_0x0f35('0x25')]=function(_0x44b13f,_0x4fc013){if(_0x44b13f[_0x0f35('0x4d')]['id']){delete _0x44b13f[_0x0f35('0x4d')]['id'];}return db['Attachment'][_0x0f35('0x48')]({'where':{'id':_0x44b13f[_0x0f35('0x46')]['id']}})[_0x0f35('0x26')](handleEntityNotFound(_0x4fc013,null))['then'](saveUpdates(_0x44b13f[_0x0f35('0x4d')],null))['then'](respondWithResult(_0x4fc013,null))['catch'](handleError(_0x4fc013,null));};exports[_0x0f35('0x27')]=function(_0x36945c,_0xaef879){return db[_0x0f35('0x2c')][_0x0f35('0x48')]({'where':{'id':_0x36945c[_0x0f35('0x46')]['id']}})['then'](handleEntityNotFound(_0xaef879,null))[_0x0f35('0x26')](removeEntity(_0xaef879,null))[_0x0f35('0x44')](handleError(_0xaef879,null));};exports['create']=function(_0x46ac26,_0x126160,_0x6311fe){_0x46ac26[_0x0f35('0x4d')]['name']=_0x46ac26[_0x0f35('0x4f')][_0x0f35('0x50')];_0x46ac26['body'][_0x0f35('0x51')]=_0x46ac26[_0x0f35('0x4f')][_0x0f35('0x52')];_0x46ac26[_0x0f35('0x4d')][_0x0f35('0x2e')]=_0x46ac26['file'][_0x0f35('0x53')];return db['Attachment'][_0x0f35('0x4e')](_0x46ac26[_0x0f35('0x4d')])[_0x0f35('0x26')](respondWithResult(_0x126160,0xc9))[_0x0f35('0x44')](handleError(_0x126160,null));};exports[_0x0f35('0x54')]=function(_0x4f0a22,_0x325d52,_0x4f7581){return db['Attachment']['findOne']({'where':{'id':_0x4f0a22['params']['id']},'raw':!![]})[_0x0f35('0x26')](handleEntityNotFound(_0x325d52,null))[_0x0f35('0x26')](function(_0x93c1e7){if(_0x93c1e7){var _0x519cba=_0x93c1e7[_0x0f35('0x55')]!==null;var _0x1a5c7c=path[_0x0f35('0x56')](config[_0x0f35('0x57')],_0x0f35('0x58'));if(_0x519cba){_0x1a5c7c=path[_0x0f35('0x56')](_0x1a5c7c,_0x0f35('0x59'));}var _0x3df38f=path[_0x0f35('0x56')](_0x1a5c7c,_0x93c1e7[_0x0f35('0x51')]);return _0x325d52['download'](_0x3df38f);}})[_0x0f35('0x44')](handleError(_0x325d52,null));}; \ No newline at end of file +var _0xb9e3=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','omit','createdAt','body','updatedAt','create','catch','file','originalname','filename','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb9e3,0x1e5));var _0x3b9e=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xb9e3[_0x4ed4d2];return _0x15ae2e;};'use strict';var emlformat=require(_0x3b9e('0x0'));var rimraf=require(_0x3b9e('0x1'));var zipdir=require(_0x3b9e('0x2'));var jsonpatch=require(_0x3b9e('0x3'));var rp=require(_0x3b9e('0x4'));var moment=require(_0x3b9e('0x5'));var BPromise=require(_0x3b9e('0x6'));var Mustache=require(_0x3b9e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3b9e('0x8'));var csv=require(_0x3b9e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3b9e('0xa'));var crypto=require(_0x3b9e('0xb'));var jsforce=require(_0x3b9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b9e('0xd'));var Redis=require(_0x3b9e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3b9e('0xf'));var as=require(_0x3b9e('0x10'));var hardwareService=require(_0x3b9e('0x11'));var logger=require('../../config/logger')(_0x3b9e('0x12'));var utils=require(_0x3b9e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3b9e('0x14'));var db=require(_0x3b9e('0x15'))['db'];function respondWithStatusCode(_0x3c36c0,_0x1bf17b){_0x1bf17b=_0x1bf17b||0xcc;return function(_0x49a074){if(_0x49a074){return _0x3c36c0[_0x3b9e('0x16')](_0x1bf17b);}return _0x3c36c0['status'](_0x1bf17b)[_0x3b9e('0x17')]();};}function respondWithResult(_0x51b040,_0x4f0abe){_0x4f0abe=_0x4f0abe||0xc8;return function(_0x370f88){if(_0x370f88){return _0x51b040[_0x3b9e('0x18')](_0x4f0abe)[_0x3b9e('0x19')](_0x370f88);}};}function respondWithFilteredResult(_0x3cd876,_0x45e42e){return function(_0xe91676){if(_0xe91676){var _0x75e041=typeof _0x45e42e[_0x3b9e('0x1a')]===_0x3b9e('0x1b')&&typeof _0x45e42e['limit']==='undefined';var _0x5a971d=_0xe91676[_0x3b9e('0x1c')];var _0x29d0d6=_0x75e041?0x0:_0x45e42e[_0x3b9e('0x1a')];var _0x1171d8=_0x75e041?_0xe91676['count']:_0x45e42e[_0x3b9e('0x1a')]+_0x45e42e[_0x3b9e('0x1d')];var _0x473489;if(_0x1171d8>=_0x5a971d){_0x1171d8=_0x5a971d;_0x473489=0xc8;}else{_0x473489=0xce;}_0x3cd876[_0x3b9e('0x18')](_0x473489);return _0x3cd876[_0x3b9e('0x1e')](_0x3b9e('0x1f'),_0x29d0d6+'-'+_0x1171d8+'/'+_0x5a971d)['json'](_0xe91676);}return null;};}function patchUpdates(_0x21fd5d){return function(_0x301d82){try{jsonpatch[_0x3b9e('0x20')](_0x301d82,_0x21fd5d,!![]);}catch(_0x34d16c){return BPromise[_0x3b9e('0x21')](_0x34d16c);}return _0x301d82[_0x3b9e('0x22')]();};}function saveUpdates(_0x2566fb,_0x1eae1d){return function(_0x1088b0){if(_0x1088b0){return _0x1088b0[_0x3b9e('0x23')](_0x2566fb)['then'](function(_0x111bab){return _0x111bab;});}return null;};}function removeEntity(_0x3ad06c,_0x1175ca){return function(_0x2bf22f){if(_0x2bf22f){return _0x2bf22f[_0x3b9e('0x24')]()[_0x3b9e('0x25')](function(){_0x3ad06c['status'](0xcc)[_0x3b9e('0x17')]();});}};}function handleEntityNotFound(_0x8a165,_0x2a7699){return function(_0x404557){if(!_0x404557){_0x8a165[_0x3b9e('0x16')](0x194);}return _0x404557;};}function handleError(_0x3ff4e4,_0x2cf0fb){_0x2cf0fb=_0x2cf0fb||0x1f4;return function(_0x23b442){logger[_0x3b9e('0x26')](_0x23b442[_0x3b9e('0x27')]);if(_0x23b442[_0x3b9e('0x28')]){delete _0x23b442[_0x3b9e('0x28')];}_0x3ff4e4[_0x3b9e('0x18')](_0x2cf0fb)[_0x3b9e('0x29')](_0x23b442);};}exports[_0x3b9e('0x2a')]=function(_0x3b1804,_0x93becc){var _0x413d76={},_0xe6575d={},_0x66810={'count':0x0,'rows':[]};var _0x5c8d7d=_['map'](db[_0x3b9e('0x2b')][_0x3b9e('0x2c')],function(_0x3b1965){return{'name':_0x3b1965['fieldName'],'type':_0x3b1965[_0x3b9e('0x2d')]['key']};});_0xe6575d[_0x3b9e('0x2e')]=_[_0x3b9e('0x2f')](_0x5c8d7d,_0x3b9e('0x28'));_0xe6575d[_0x3b9e('0x30')]=_['keys'](_0x3b1804[_0x3b9e('0x30')]);_0xe6575d[_0x3b9e('0x31')]=_[_0x3b9e('0x32')](_0xe6575d[_0x3b9e('0x2e')],_0xe6575d[_0x3b9e('0x30')]);_0x413d76[_0x3b9e('0x33')]=_[_0x3b9e('0x32')](_0xe6575d[_0x3b9e('0x2e')],qs[_0x3b9e('0x34')](_0x3b1804[_0x3b9e('0x30')]['fields']));_0x413d76[_0x3b9e('0x33')]=_0x413d76[_0x3b9e('0x33')]['length']?_0x413d76[_0x3b9e('0x33')]:_0xe6575d[_0x3b9e('0x2e')];if(!_0x3b1804[_0x3b9e('0x30')][_0x3b9e('0x35')](_0x3b9e('0x36'))){_0x413d76[_0x3b9e('0x1d')]=qs['limit'](_0x3b1804[_0x3b9e('0x30')][_0x3b9e('0x1d')]);_0x413d76[_0x3b9e('0x1a')]=qs[_0x3b9e('0x1a')](_0x3b1804[_0x3b9e('0x30')]['offset']);}_0x413d76[_0x3b9e('0x37')]=qs[_0x3b9e('0x38')](_0x3b1804['query'][_0x3b9e('0x38')]);_0x413d76[_0x3b9e('0x39')]=qs[_0x3b9e('0x31')](_[_0x3b9e('0x3a')](_0x3b1804[_0x3b9e('0x30')],_0xe6575d[_0x3b9e('0x31')]),_0x5c8d7d);if(_0x3b1804['query'][_0x3b9e('0x3b')]){_0x413d76[_0x3b9e('0x39')]=_[_0x3b9e('0x3c')](_0x413d76['where'],{'$or':_[_0x3b9e('0x2f')](_0x5c8d7d,function(_0x117bde){if(_0x117bde[_0x3b9e('0x2d')]!=='VIRTUAL'){var _0x47b8ff={};_0x47b8ff[_0x117bde[_0x3b9e('0x28')]]={'$like':'%'+_0x3b1804['query'][_0x3b9e('0x3b')]+'%'};return _0x47b8ff;}})});}_0x413d76=_[_0x3b9e('0x3c')]({},_0x413d76,_0x3b1804[_0x3b9e('0x3d')]);var _0x2bd1b0={'where':_0x413d76[_0x3b9e('0x39')]};return db[_0x3b9e('0x2b')][_0x3b9e('0x1c')](_0x2bd1b0)[_0x3b9e('0x25')](function(_0x4ccb28){_0x66810[_0x3b9e('0x1c')]=_0x4ccb28;if(_0x3b1804[_0x3b9e('0x30')][_0x3b9e('0x3e')]){_0x413d76[_0x3b9e('0x3f')]=[{'all':!![]}];}return db[_0x3b9e('0x2b')][_0x3b9e('0x40')](_0x413d76);})[_0x3b9e('0x25')](function(_0x1005af){_0x66810[_0x3b9e('0x41')]=_0x1005af;return _0x66810;})[_0x3b9e('0x25')](respondWithFilteredResult(_0x93becc,_0x413d76))['catch'](handleError(_0x93becc,null));};exports[_0x3b9e('0x42')]=function(_0xb3e0c7,_0x13b347){var _0x32ab85={'raw':!![],'where':{'id':_0xb3e0c7[_0x3b9e('0x43')]['id']}},_0x557bfd={};_0x557bfd['model']=_[_0x3b9e('0x44')](db[_0x3b9e('0x2b')][_0x3b9e('0x2c')]);_0x557bfd['query']=_[_0x3b9e('0x44')](_0xb3e0c7['query']);_0x557bfd[_0x3b9e('0x31')]=_[_0x3b9e('0x32')](_0x557bfd[_0x3b9e('0x2e')],_0x557bfd[_0x3b9e('0x30')]);_0x32ab85[_0x3b9e('0x33')]=_['intersection'](_0x557bfd[_0x3b9e('0x2e')],qs[_0x3b9e('0x34')](_0xb3e0c7['query'][_0x3b9e('0x34')]));_0x32ab85[_0x3b9e('0x33')]=_0x32ab85[_0x3b9e('0x33')][_0x3b9e('0x45')]?_0x32ab85[_0x3b9e('0x33')]:_0x557bfd[_0x3b9e('0x2e')];if(_0xb3e0c7[_0x3b9e('0x30')][_0x3b9e('0x3e')]){_0x32ab85[_0x3b9e('0x3f')]=[{'all':!![]}];}_0x32ab85=_[_0x3b9e('0x3c')]({},_0x32ab85,_0xb3e0c7['options']);return db[_0x3b9e('0x2b')][_0x3b9e('0x46')](_0x32ab85)[_0x3b9e('0x25')](handleEntityNotFound(_0x13b347,null))[_0x3b9e('0x25')](respondWithResult(_0x13b347,null))['catch'](handleError(_0x13b347,null));};exports['clone']=function(_0x26e574,_0x188289){var _0x402a6f={'where':{'id':_0x26e574[_0x3b9e('0x43')]['id']}},_0x7b56a0={};_0x7b56a0['model']=_[_0x3b9e('0x44')](db[_0x3b9e('0x2b')]['rawAttributes']);_0x402a6f[_0x3b9e('0x33')]=_['intersection'](_0x7b56a0[_0x3b9e('0x2e')],qs[_0x3b9e('0x34')](_0x26e574[_0x3b9e('0x30')][_0x3b9e('0x34')]));_0x402a6f[_0x3b9e('0x33')]=_0x402a6f[_0x3b9e('0x33')][_0x3b9e('0x45')]?_0x402a6f['attributes']:_0x7b56a0['model'];if(_0x26e574['query'][_0x3b9e('0x3e')]){_0x402a6f[_0x3b9e('0x3f')]=[{'all':!![]}];}_0x402a6f=_['merge']({},_0x402a6f,_0x26e574['options']);return db['Attachment'][_0x3b9e('0x46')](_0x402a6f)[_0x3b9e('0x25')](handleEntityNotFound(_0x188289,null))[_0x3b9e('0x25')](function(_0x46a191){if(_0x46a191){var _0x65833d=_0x46a191['get']({'plain':!![]});_0x65833d=qs[_0x3b9e('0x47')](_0x65833d,['id',_0x3b9e('0x48'),'updatedAt']);_0x26e574[_0x3b9e('0x49')]=_['omit'](_0x26e574[_0x3b9e('0x49')],['id',_0x3b9e('0x48'),_0x3b9e('0x4a')]);return db[_0x3b9e('0x2b')][_0x3b9e('0x4b')](_[_0x3b9e('0x3c')](_0x65833d,_0x26e574['body']),{'include':_0x26e574['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x3b9e('0x25')](respondWithResult(_0x188289,0xc9))[_0x3b9e('0x4c')](handleError(_0x188289,null));};exports[_0x3b9e('0x23')]=function(_0x507d8b,_0x53fbc8){if(_0x507d8b[_0x3b9e('0x49')]['id']){delete _0x507d8b['body']['id'];}return db[_0x3b9e('0x2b')][_0x3b9e('0x46')]({'where':{'id':_0x507d8b[_0x3b9e('0x43')]['id']}})[_0x3b9e('0x25')](handleEntityNotFound(_0x53fbc8,null))[_0x3b9e('0x25')](saveUpdates(_0x507d8b['body'],null))[_0x3b9e('0x25')](respondWithResult(_0x53fbc8,null))[_0x3b9e('0x4c')](handleError(_0x53fbc8,null));};exports[_0x3b9e('0x24')]=function(_0x208f5c,_0x5c620b){return db[_0x3b9e('0x2b')][_0x3b9e('0x46')]({'where':{'id':_0x208f5c[_0x3b9e('0x43')]['id']}})[_0x3b9e('0x25')](handleEntityNotFound(_0x5c620b,null))['then'](removeEntity(_0x5c620b,null))[_0x3b9e('0x4c')](handleError(_0x5c620b,null));};exports[_0x3b9e('0x4b')]=function(_0x19f35d,_0x1ad6b1,_0x259f6b){_0x19f35d[_0x3b9e('0x49')][_0x3b9e('0x28')]=_0x19f35d[_0x3b9e('0x4d')][_0x3b9e('0x4e')];_0x19f35d['body']['basename']=_0x19f35d[_0x3b9e('0x4d')][_0x3b9e('0x4f')];_0x19f35d[_0x3b9e('0x49')][_0x3b9e('0x2d')]=_0x19f35d['file']['mimetype'];return db[_0x3b9e('0x2b')]['create'](_0x19f35d[_0x3b9e('0x49')])[_0x3b9e('0x25')](respondWithResult(_0x1ad6b1,0xc9))[_0x3b9e('0x4c')](handleError(_0x1ad6b1,null));};exports['download']=function(_0x20e52a,_0x1e9365,_0x3bf3dc){return db[_0x3b9e('0x2b')]['findOne']({'where':{'id':_0x20e52a[_0x3b9e('0x43')]['id']},'raw':!![]})[_0x3b9e('0x25')](handleEntityNotFound(_0x1e9365,null))[_0x3b9e('0x25')](function(_0x53d0b0){if(_0x53d0b0){var _0x2083fb=_0x53d0b0[_0x3b9e('0x50')]!==null;var _0x3599a5=path[_0x3b9e('0x51')](config[_0x3b9e('0x52')],_0x3b9e('0x53'));if(_0x2083fb){_0x3599a5=path[_0x3b9e('0x51')](_0x3599a5,_0x3b9e('0x54'));}var _0x43b989=path[_0x3b9e('0x51')](_0x3599a5,_0x53d0b0['basename']);return _0x1e9365[_0x3b9e('0x55')](_0x43b989);}})[_0x3b9e('0x4c')](handleError(_0x1e9365,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 84f956a..0c714a4 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 _0xb7c6=['define','Attachment','attachments','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports'];(function(_0x4a5760,_0x134c15){var _0x2994b=function(_0x9c3df8){while(--_0x9c3df8){_0x4a5760['push'](_0x4a5760['shift']());}};_0x2994b(++_0x134c15);}(_0xb7c6,0x158));var _0x6b7c=function(_0x4b7a2f,_0x314f8d){_0x4b7a2f=_0x4b7a2f-0x0;var _0x33d71a=_0xb7c6[_0x4b7a2f];return _0x33d71a;};'use strict';var _=require(_0x6b7c('0x0'));var util=require(_0x6b7c('0x1'));var logger=require(_0x6b7c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6b7c('0x3'));var rp=require(_0x6b7c('0x4'));var fs=require('fs');var path=require(_0x6b7c('0x5'));var rimraf=require(_0x6b7c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x6b7c('0x7')]=function(_0x5f8b2f,_0x3dbd0c){return _0x5f8b2f[_0x6b7c('0x8')](_0x6b7c('0x9'),attributes,{'tableName':_0x6b7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc606=['attachments','util','api','moment','bluebird','request-promise','rimraf','./attachment.attributes','define','Attachment'];(function(_0xb4f04,_0x4388b8){var _0x236640=function(_0x27d4fc){while(--_0x27d4fc){_0xb4f04['push'](_0xb4f04['shift']());}};_0x236640(++_0x4388b8);}(_0xc606,0x65));var _0x6c60=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xc606[_0x4aba15];return _0x1c8122;};'use strict';var _=require('lodash');var util=require(_0x6c60('0x0'));var logger=require('../../config/logger')(_0x6c60('0x1'));var moment=require(_0x6c60('0x2'));var BPromise=require(_0x6c60('0x3'));var rp=require(_0x6c60('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c60('0x5'));var config=require('../../config/environment');var attributes=require(_0x6c60('0x6'));module['exports']=function(_0x280bf7,_0x534164){return _0x280bf7[_0x6c60('0x7')](_0x6c60('0x8'),attributes,{'tableName':_0x6c60('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 655b064..9066f8a 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 _0x4d46=['debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','Attachment','create','body','options','raw','then','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent'];(function(_0x3a218d,_0x340ffa){var _0x23580d=function(_0x2c4dbb){while(--_0x2c4dbb){_0x3a218d['push'](_0x3a218d['shift']());}};_0x23580d(++_0x340ffa);}(_0x4d46,0x197));var _0x64d4=function(_0x62d15,_0x34a398){_0x62d15=_0x62d15-0x0;var _0x45bbe9=_0x4d46[_0x62d15];return _0x45bbe9;};'use strict';var _=require(_0x64d4('0x0'));var util=require(_0x64d4('0x1'));var moment=require(_0x64d4('0x2'));var BPromise=require(_0x64d4('0x3'));var rs=require(_0x64d4('0x4'));var fs=require('fs');var Redis=require(_0x64d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64d4('0x6'));var logger=require(_0x64d4('0x7'))(_0x64d4('0x8'));var config=require(_0x64d4('0x9'));var jayson=require(_0x64d4('0xa'));var client=jayson[_0x64d4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x321a51,_0x33b72d,_0x51faf7){return new BPromise(function(_0x45158d,_0x34d00a){return client['request'](_0x321a51,_0x51faf7)['then'](function(_0x4d9e23){logger['info']('Attachment,\x20%s,\x20%s',_0x33b72d,_0x64d4('0xc'));logger[_0x64d4('0xd')](_0x64d4('0xe'),_0x33b72d,_0x64d4('0xc'),JSON[_0x64d4('0xf')](_0x4d9e23));if(_0x4d9e23[_0x64d4('0x10')]){if(_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x11')]===0x1f4){logger[_0x64d4('0x10')]('Attachment,\x20%s,\x20%s',_0x33b72d,_0x4d9e23[_0x64d4('0x10')]['message']);return _0x34d00a(_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x12')]);}logger[_0x64d4('0x10')](_0x64d4('0x13'),_0x33b72d,_0x4d9e23[_0x64d4('0x10')][_0x64d4('0x12')]);return _0x45158d(_0x4d9e23['error'][_0x64d4('0x12')]);}else{logger[_0x64d4('0x14')](_0x64d4('0x13'),_0x33b72d,_0x64d4('0xc'));_0x45158d(_0x4d9e23[_0x64d4('0x15')][_0x64d4('0x12')]);}})[_0x64d4('0x16')](function(_0x4b3335){logger[_0x64d4('0x10')](_0x64d4('0x13'),_0x33b72d,_0x4b3335);_0x34d00a(_0x4b3335);});});}exports['CreateAttachment']=function(_0x1bbaf0){var _0x155b60=this;return new Promise(function(_0x13900e,_0xe79978){return db[_0x64d4('0x17')][_0x64d4('0x18')](_0x1bbaf0[_0x64d4('0x19')],{'raw':_0x1bbaf0[_0x64d4('0x1a')]?_0x1bbaf0['options'][_0x64d4('0x1b')]===undefined?!![]:![]:!![]})[_0x64d4('0x1c')](function(_0x35ee04){logger[_0x64d4('0x14')]('CreateAttachment',_0x1bbaf0);logger['debug'](_0x64d4('0x1d'),_0x1bbaf0,JSON[_0x64d4('0xf')](_0x35ee04));_0x13900e(_0x35ee04);})[_0x64d4('0x16')](function(_0x4c0b0b){logger[_0x64d4('0x10')](_0x64d4('0x1d'),_0x4c0b0b[_0x64d4('0x12')],_0x1bbaf0);_0xe79978(_0x155b60[_0x64d4('0x10')](0x1f4,_0x4c0b0b[_0x64d4('0x12')]));});});}; \ No newline at end of file +var _0xe130=['Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0xe130,0x127));var _0x0e13=function(_0x14e571,_0x37d3ea){_0x14e571=_0x14e571-0x0;var _0x4ed16d=_0xe130[_0x14e571];return _0x4ed16d;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1774a5,_0x5f0d09,_0x567031){return new BPromise(function(_0x5aaa22,_0x2faf49){return client[_0x0e13('0xb')](_0x1774a5,_0x567031)['then'](function(_0x5d066a){logger[_0x0e13('0xc')](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));logger[_0x0e13('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5f0d09,'request\x20sent',JSON[_0x0e13('0x10')](_0x5d066a));if(_0x5d066a[_0x0e13('0x11')]){if(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x12')]===0x1f4){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x5d066a['error'][_0x0e13('0x13')]);return _0x2faf49(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}logger[_0x0e13('0x11')](_0x0e13('0xd'),_0x5f0d09,_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);return _0x5aaa22(_0x5d066a[_0x0e13('0x11')][_0x0e13('0x13')]);}else{logger['info'](_0x0e13('0xd'),_0x5f0d09,_0x0e13('0xe'));_0x5aaa22(_0x5d066a[_0x0e13('0x14')][_0x0e13('0x13')]);}})[_0x0e13('0x15')](function(_0x32f76a){logger['error'](_0x0e13('0xd'),_0x5f0d09,_0x32f76a);_0x2faf49(_0x32f76a);});});}exports[_0x0e13('0x16')]=function(_0x510a2b){var _0x487e2c=this;return new Promise(function(_0x3b85fd,_0x5001aa){return db[_0x0e13('0x17')]['create'](_0x510a2b[_0x0e13('0x18')],{'raw':_0x510a2b[_0x0e13('0x19')]?_0x510a2b[_0x0e13('0x19')][_0x0e13('0x1a')]===undefined?!![]:![]:!![]})[_0x0e13('0x1b')](function(_0x5ef062){logger['info']('CreateAttachment',_0x510a2b);logger[_0x0e13('0xf')](_0x0e13('0x16'),_0x510a2b,JSON['stringify'](_0x5ef062));_0x3b85fd(_0x5ef062);})['catch'](function(_0x295eb0){logger[_0x0e13('0x11')](_0x0e13('0x16'),_0x295eb0['message'],_0x510a2b);_0x5001aa(_0x487e2c[_0x0e13('0x11')](0x1f4,_0x295eb0[_0x0e13('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b96c4ec..6954c64 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x52befc,_0x4423c6){var _0x1c5ccd=function(_0xc2330f){while(--_0xc2330f){_0x52befc['push'](_0x52befc['shift']());}};_0x1c5ccd(++_0x4423c6);}(_0x2032,0xd9));var _0x2203=function(_0x3a8f25,_0x3f9776){_0x3a8f25=_0x3a8f25-0x0;var _0x2be387=_0x2032[_0x3a8f25];return _0x2be387;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x4beaa1,_0x2d0d1f){_0x4beaa1=_0x4beaa1-0x0;var _0x524719=_0xdb28[_0x4beaa1];return _0x524719;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0ec8959..290920c 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 _0x7f74=['blocked','blockDuration','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','profile','callback','/login','clientID','allowedLoginAttempts','then','User','find','map','emails','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b402c,_0x11fe62){var _0x4ba066=function(_0xdc977d){while(--_0xdc977d){_0x1b402c['push'](_0x1b402c['shift']());}};_0x4ba066(++_0x11fe62);}(_0x7f74,0x17e));var _0x47f7=function(_0x597aaf,_0x3f4538){_0x597aaf=_0x597aaf-0x0;var _0x53c251=_0x7f74[_0x597aaf];return _0x53c251;};'use strict';var _=require(_0x47f7('0x0'));var passport=require(_0x47f7('0x1'));var GoogleStrategy=require(_0x47f7('0x2'))['Strategy'];var moment=require(_0x47f7('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x47f7('0x4'));var signToken=require(_0x47f7('0x5'))[_0x47f7('0x6')];var utils=require('../../config/utils');exports[_0x47f7('0x7')]=passport[_0x47f7('0x8')](_0x47f7('0x9'),{'failureRedirect':'/login','scope':[_0x47f7('0xa'),'email'],'session':![]});exports[_0x47f7('0xb')]=passport[_0x47f7('0x8')](_0x47f7('0x9'),{'failureRedirect':_0x47f7('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x47f7('0x9')]?config['google'][_0x47f7('0xd')]:'id','clientSecret':config[_0x47f7('0x9')]?config[_0x47f7('0x9')]['clientSecret']:'secret','callbackURL':config[_0x47f7('0x9')]?config[_0x47f7('0x9')]['callbackURL']:''},function(_0x369970,_0xdf3f4c,_0x2f3404,_0x4c85ab){var _0x28789a,_0x20f89f;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x47f7('0xe'),'blockDuration'],'raw':!![]})[_0x47f7('0xf')](function(_0x7cc0a1){_0x28789a=_0x7cc0a1;return db[_0x47f7('0x10')][_0x47f7('0x11')]({'where':{'email':_[_0x47f7('0x12')](_0x2f3404[_0x47f7('0x13')],'value'),'role':{'$or':[_0x47f7('0x14'),'user',_0x47f7('0x15')]}}});})[_0x47f7('0xf')](function(_0x45983e){_0x20f89f=_0x45983e;if(_0x20f89f){if(_0x20f89f[_0x47f7('0x16')]){return _0x4c85ab(_0x47f7('0x17'));}else if(_0x28789a['blockDuration']>0x0){if(_0x20f89f[_0x47f7('0x18')]){if(moment(_0x20f89f['blockedAt'])['add'](_0x28789a[_0x47f7('0x19')],_0x47f7('0x1a'))>moment()){return _0x4c85ab(_0x47f7('0x17'));}else{return utils[_0x47f7('0x1b')](_0x20f89f,0x0,![],null)[_0x47f7('0xf')](function(){return utils[_0x47f7('0x1c')](_0x20f89f);})[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}else{return utils[_0x47f7('0x1c')](_0x20f89f)[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}else{return utils[_0x47f7('0x1c')](_0x20f89f)[_0x47f7('0xf')](function(){return _0x4c85ab(null,_0x20f89f);});}}return _0x4c85ab(_0x47f7('0x17'));})['catch'](function(_0x4936fe){_0x4c85ab(_0x4936fe);});})); \ No newline at end of file +var _0x2e76=['value','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','Setting','findOne','then','User','find','map','emails'];(function(_0x120b02,_0x1295de){var _0x347a9a=function(_0x3783a6){while(--_0x3783a6){_0x120b02['push'](_0x120b02['shift']());}};_0x347a9a(++_0x1295de);}(_0x2e76,0xf0));var _0x62e7=function(_0x259676,_0x56f02e){_0x259676=_0x259676-0x0;var _0x540803=_0x2e76[_0x259676];return _0x540803;};'use strict';var _=require(_0x62e7('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x62e7('0x1'))['Strategy'];var moment=require(_0x62e7('0x2'));var db=require(_0x62e7('0x3'))['db'];var config=require(_0x62e7('0x4'));var signToken=require(_0x62e7('0x5'))[_0x62e7('0x6')];var utils=require('../../config/utils');exports['login']=passport['authenticate'](_0x62e7('0x7'),{'failureRedirect':_0x62e7('0x8'),'scope':[_0x62e7('0x9'),_0x62e7('0xa')],'session':![]});exports[_0x62e7('0xb')]=passport[_0x62e7('0xc')](_0x62e7('0x7'),{'failureRedirect':'/login','session':![]});passport[_0x62e7('0xd')](new GoogleStrategy({'clientID':config[_0x62e7('0x7')]?config['google'][_0x62e7('0xe')]:'id','clientSecret':config[_0x62e7('0x7')]?config['google'][_0x62e7('0xf')]:_0x62e7('0x10'),'callbackURL':config['google']?config[_0x62e7('0x7')]['callbackURL']:''},function(_0x4a983f,_0x166c85,_0x486ad9,_0x48d133){var _0x52f6b4,_0x37c8e4;return db[_0x62e7('0x11')][_0x62e7('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x62e7('0x13')](function(_0x3a1428){_0x52f6b4=_0x3a1428;return db[_0x62e7('0x14')][_0x62e7('0x15')]({'where':{'email':_[_0x62e7('0x16')](_0x486ad9[_0x62e7('0x17')],_0x62e7('0x18')),'role':{'$or':['admin','user','agent']}}});})[_0x62e7('0x13')](function(_0x3078d2){_0x37c8e4=_0x3078d2;if(_0x37c8e4){if(_0x37c8e4[_0x62e7('0x19')]){return _0x48d133(_0x62e7('0x1a'));}else if(_0x52f6b4['blockDuration']>0x0){if(_0x37c8e4[_0x62e7('0x1b')]){if(moment(_0x37c8e4[_0x62e7('0x1c')])[_0x62e7('0x1d')](_0x52f6b4['blockDuration'],_0x62e7('0x1e'))>moment()){return _0x48d133(_0x62e7('0x1a'));}else{return utils['clearBlockUser'](_0x37c8e4,0x0,![],null)['then'](function(){return utils[_0x62e7('0x1f')](_0x37c8e4);})[_0x62e7('0x13')](function(){return _0x48d133(null,_0x37c8e4);});}}else{return utils[_0x62e7('0x1f')](_0x37c8e4)['then'](function(){return _0x48d133(null,_0x37c8e4);});}}else{return utils[_0x62e7('0x1f')](_0x37c8e4)[_0x62e7('0x13')](function(){return _0x48d133(null,_0x37c8e4);});}}return _0x48d133('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x62e7('0x20')](function(_0x536733){_0x48d133(_0x536733);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 19319ef..7c0ef94 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 _0x9400=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x47501c,_0x76443c){var _0xc930e5=function(_0x752e7e){while(--_0x752e7e){_0x47501c['push'](_0x47501c['shift']());}};_0xc930e5(++_0x76443c);}(_0x9400,0x152));var _0x0940=function(_0x379caf,_0x2f2e4e){_0x379caf=_0x379caf-0x0;var _0xd45786=_0x9400[_0x379caf];return _0xd45786;};'use strict';var express=require(_0x0940('0x0'));var passport=require(_0x0940('0x1'));var router=express[_0x0940('0x2')]();var controller=require(_0x0940('0x3'));var userController=require(_0x0940('0x4'));var authService=require(_0x0940('0x5'));router['get']('/',controller[_0x0940('0x6')]);router[_0x0940('0x7')](_0x0940('0x8'),controller[_0x0940('0x9')],authService[_0x0940('0xa')],userController[_0x0940('0x6')],authService[_0x0940('0xb')]);module[_0x0940('0xc')]=router; \ No newline at end of file +var _0xef2e=['setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware'];(function(_0x4302f0,_0x4fd3f2){var _0xbaaff5=function(_0x1c75be){while(--_0x1c75be){_0x4302f0['push'](_0x4302f0['shift']());}};_0xbaaff5(++_0x4fd3f2);}(_0xef2e,0x141));var _0xeef2=function(_0x340fdf,_0x48ad2b){_0x340fdf=_0x340fdf-0x0;var _0x1a04c2=_0xef2e[_0x340fdf];return _0x1a04c2;};'use strict';var express=require('express');var passport=require(_0xeef2('0x0'));var router=express[_0xeef2('0x1')]();var controller=require(_0xeef2('0x2'));var userController=require(_0xeef2('0x3'));var authService=require(_0xeef2('0x4'));router[_0xeef2('0x5')]('/',controller[_0xeef2('0x6')]);router[_0xeef2('0x5')](_0xeef2('0x7'),controller['callback'],authService[_0xeef2('0x8')],userController[_0xeef2('0x6')],authService[_0xeef2('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ea9de95..86ec169 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 _0x1157=['validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','Strategy','lodash','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','status','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords'];(function(_0x2b355e,_0x5d2107){var _0x1543fc=function(_0x4ff175){while(--_0x4ff175){_0x2b355e['push'](_0x2b355e['shift']());}};_0x1543fc(++_0x5d2107);}(_0x1157,0x1a8));var _0x7115=function(_0x1102d4,_0x144af5){_0x1102d4=_0x1102d4-0x0;var _0x120f26=_0x1157[_0x1102d4];return _0x120f26;};'use strict';var util=require(_0x7115('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7115('0x1'))[_0x7115('0x2')];var jayson=require('jayson/promise');var _=require(_0x7115('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x7115('0x4'));var client=jayson[_0x7115('0x5')][_0x7115('0x6')]({'port':0x232b});function localAuthenticate(_0x4b33a5,_0x532682,_0x4e6c50,_0x471244){var _0x4a3524,_0x127997;return db[_0x7115('0x7')][_0x7115('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7115('0x9')],'raw':!![]})[_0x7115('0xa')](function(_0x3dd03c){_0x4a3524=_0x3dd03c;return _0x4b33a5['findOne']({'attributes':['id',_0x7115('0xb'),_0x7115('0xc'),_0x7115('0xd'),_0x7115('0xe'),'disabled',_0x7115('0xf'),_0x7115('0x10'),_0x7115('0x11')],'where':{'name':_0x532682,'role':{'$or':[_0x7115('0x12'),_0x7115('0x13'),_0x7115('0x14')]}}});})[_0x7115('0xa')](function(_0x48730e){if(!_0x48730e||_0x48730e&&_0x48730e[_0x7115('0xb')]!==_0x532682){throw new Error(_0x7115('0x15'));}else{_0x127997=_0x48730e;return _0x127997;}})[_0x7115('0xa')](function(){_0x127997['authenticate'](_0x4e6c50,function(_0x6d8d84,_0x434d56){var _0x55f01b=_0x127997['loginAttempts']+0x1;if(_0x6d8d84){return _0x471244(_0x6d8d84);}else if(!_0x434d56){if(_0x127997[_0x7115('0x16')]){return _0x471244(null,![],{'message':_0x7115('0x15')});}else if(_0x4a3524[_0x7115('0x17')]>0x0){if(_0x127997['blocked']){if(_0x4a3524[_0x7115('0x9')]>0x0){if(moment(_0x127997[_0x7115('0x10')])[_0x7115('0x18')](_0x4a3524[_0x7115('0x9')],_0x7115('0x19'))>moment()){return _0x471244(null,![],{'message':_0x7115('0x15')});}else{return utils['clearBlockUser'](_0x127997,_0x55f01b,![],null)[_0x7115('0xa')](function(){return _0x471244(null,![],{'message':_0x7115('0x15')});});}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{if(_0x55f01b>=_0x4a3524[_0x7115('0x17')]){return utils['clearBlockUser'](_0x127997,0x0,!![],moment())[_0x7115('0xa')](function(){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7115('0x1a')](_0x127997,_0x55f01b,![],null)['then'](function(){return _0x471244(null,![],{'message':_0x7115('0x15')});});}}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{if(_0x127997[_0x7115('0x16')]){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4a3524[_0x7115('0x17')]>0x0){if(_0x127997[_0x7115('0xf')]){if(_0x4a3524[_0x7115('0x9')]>0x0){if(moment(_0x127997[_0x7115('0x10')])[_0x7115('0x18')](_0x4a3524[_0x7115('0x9')],_0x7115('0x19'))>moment()){return _0x471244(null,![],{'message':_0x7115('0x15')});}else{return utils[_0x7115('0x1a')](_0x127997,0x0,![],null)[_0x7115('0xa')](function(){return utils[_0x7115('0x1b')](_0x127997);})['then'](function(){return _0x471244(null,_0x127997);});}}else{return _0x471244(null,![],{'message':_0x7115('0x15')});}}else{return utils['clearBlockUser'](_0x127997,0x0,![],null)[_0x7115('0xa')](function(){return utils[_0x7115('0x1b')](_0x127997);})[_0x7115('0xa')](function(){return _0x471244(null,_0x127997);})[_0x7115('0x1c')](function(_0x53e942){return _0x471244(null,![],_0x53e942);});}}else{if(_0x127997[_0x7115('0xf')]){return _0x471244(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x127997)[_0x7115('0xa')](function(){return _0x471244(null,_0x127997);});}}}});})['catch'](function(_0x1e1ae0){return _0x471244(null,![],_0x1e1ae0);});}function sendServiceMail(_0x1488c0){return db[_0x7115('0x1d')][_0x7115('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x7115('0xb'),_0x7115('0x1f')],'include':[{'model':db[_0x7115('0x20')],'as':_0x7115('0x21')}]})[_0x7115('0xa')](function(_0x3550ab){if(!_0x3550ab){throw new Error(_0x7115('0x22'));}var _0x2fa810={'tls':{'rejectUnauthorized':![]}};if(_0x3550ab[_0x7115('0x21')][_0x7115('0x23')]){_0x2fa810['service']=_0x3550ab[_0x7115('0x21')][_0x7115('0x23')];}else{_0x2fa810[_0x7115('0x24')]=_0x3550ab[_0x7115('0x21')][_0x7115('0x24')];_0x2fa810[_0x7115('0x25')]=_0x3550ab['Smtp']['port'];_0x2fa810[_0x7115('0x26')]=_0x3550ab[_0x7115('0x21')][_0x7115('0x26')];}if(_0x3550ab['Smtp'][_0x7115('0x27')]){_0x2fa810[_0x7115('0x28')]={'user':_0x3550ab['Smtp'][_0x7115('0x13')],'pass':_0x3550ab[_0x7115('0x21')]['pass']};}var _0x50a2c1={'account':_0x2fa810,'message':_[_0x7115('0x29')]({'from':util[_0x7115('0x2a')](_0x7115('0x2b'),_0x3550ab[_0x7115('0xb')],_0x3550ab[_0x7115('0x1f')]||_0x3550ab[_0x7115('0x21')][_0x7115('0x13')])},_0x1488c0)};return client[_0x7115('0x2c')](_0x7115('0x2d'),_0x50a2c1);})[_0x7115('0xa')](function(_0x531d01){if(_0x531d01[_0x7115('0x2e')]){throw new Error(util[_0x7115('0x2a')](_0x7115('0x2f'),_0x531d01[_0x7115('0x2e')][_0x7115('0x30')]||JSON['stringify'](_0x531d01[_0x7115('0x2e')])));}return!![];});}function handleError(_0x2ddd4d,_0x17c0cd,_0x218887){return _0x2ddd4d['status'](_0x17c0cd||0x1f4)[_0x7115('0x31')]({'message':_0x218887?_0x218887[_0x7115('0x30')]||_0x218887:''});}exports['login']=function(_0x4414f2,_0x50fe67,_0x2fb724){passport[_0x7115('0x32')]('local',function(_0x3e3250,_0x54d663,_0x15278e){var _0x18f7c4=_0x3e3250||_0x15278e;if(_0x18f7c4){return handleError(_0x50fe67,0x191,_0x18f7c4);}if(!_0x54d663){return handleError(_0x50fe67,0x194,{'message':_0x7115('0x33')});}else{var _0x36488b={'payload':{'id':_0x54d663['id'],'role':_0x54d663[_0x7115('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x7115('0x34')](_0x36488b)['then'](function(_0x5cedf8){_0x50fe67[_0x7115('0x35')]({'id':_0x54d663['id'],'token':_0x5cedf8,'statusCall':'','isAlreadyLogged':_0x54d663[_0x7115('0x36')]});});}})(_0x4414f2,_0x50fe67,_0x2fb724);};exports[_0x7115('0x37')]=function(_0x4cc6fa,_0x3a15ea,_0x394dce){if(!_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')]){return handleError(_0x3a15ea,0x1f4,{'message':_0x7115('0x39')});}var _0x12b6c6=rs[_0x7115('0x3a')]();_0x4cc6fa['body'][_0x7115('0x1f')]=_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')][_0x7115('0x3b')]()['toLowerCase']();var _0x1d9c0a;return db['Setting'][_0x7115('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7115('0x9')],'raw':!![]})[_0x7115('0xa')](function(_0x585143){_0x1d9c0a=_0x585143;return db[_0x7115('0x3c')][_0x7115('0x1e')]({'where':{'email':_0x4cc6fa['body'][_0x7115('0x1f')]}});})[_0x7115('0xa')](function(_0x1e6afc){if(!_0x1e6afc){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1e6afc[_0x7115('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1e6afc['blocked']){if(moment(_0x1e6afc[_0x7115('0x10')])[_0x7115('0x18')](_0x1d9c0a[_0x7115('0x9')],_0x7115('0x19'))>moment()){throw new Error(_0x7115('0x3d'));}else{_0x1e6afc[_0x7115('0xf')]=![];_0x1e6afc['blockedAt']=null;}}_0x1e6afc[_0x7115('0x3e')]=_0x12b6c6;_0x1e6afc[_0x7115('0x3f')]=Date['now']()+0x36ee80;return _0x1e6afc[_0x7115('0x40')]();})[_0x7115('0xa')](function(){return sendServiceMail({'to':_0x4cc6fa[_0x7115('0x38')][_0x7115('0x1f')],'subject':_0x7115('0x41'),'text':_0x7115('0x42')+_0x7115('0x43')+_0x7115('0x44')+_0x4cc6fa[_0x7115('0x45')][_0x7115('0x24')]+'/reset/'+_0x12b6c6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3a15ea[_0x7115('0x46')](0xc8)[_0x7115('0x31')]({'message':_0x7115('0x47')});})['catch'](function(_0x25d108){return handleError(_0x3a15ea,0x1f4,_0x25d108);});};exports['reset']=function(_0x1132c9,_0x1b8328,_0xd5b8c1){return db['User'][_0x7115('0x1e')]({'where':{'resetPasswordToken':_0x1132c9[_0x7115('0x48')][_0x7115('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7115('0x4a')]()}}})['then'](function(_0x5cab2f){if(!_0x5cab2f){throw new Error(_0x7115('0x4b'));}return db[_0x7115('0x7')][_0x7115('0x8')]({'attributes':['id',_0x7115('0x4c'),_0x7115('0x4d'),'passwordHistoryLimit']})[_0x7115('0xa')](function(_0x515be4){if(_0x515be4[_0x7115('0x4c')])authService[_0x7115('0x4e')](_0x1132c9[_0x7115('0x38')][_0x7115('0xc')]);if(!_0x515be4[_0x7115('0x4d')]||!_0x5cab2f[_0x7115('0x4f')])return _0x5cab2f;authService[_0x7115('0x50')](_0x1132c9[_0x7115('0x38')][_0x7115('0xc')],_0x5cab2f[_0x7115('0x4f')],_0x515be4[_0x7115('0x51')]);return _0x5cab2f;})[_0x7115('0xa')](function(){_0x5cab2f[_0x7115('0xc')]=_0x1132c9[_0x7115('0x38')][_0x7115('0xc')];_0x5cab2f[_0x7115('0x3e')]=null;_0x5cab2f[_0x7115('0x3f')]=null;return _0x5cab2f[_0x7115('0x40')]();});})[_0x7115('0xa')](function(){_0x1b8328[_0x7115('0x46')](0xc8)[_0x7115('0x31')]({'message':_0x7115('0x52')});})[_0x7115('0x1c')](function(_0x390bff){return handleError(_0x1b8328,0x1f4,_0x390bff);});};passport[_0x7115('0x53')](new LocalStrategy({'usernameField':_0x7115('0xb'),'passwordField':_0x7115('0xc')},function(_0x14c207,_0x1ec478,_0x21b492){return localAuthenticate(db['User'],_0x14c207,_0x1ec478,_0x21b492);})); \ No newline at end of file +var _0xe356=['Setting','allowedLoginAttempts','then','name','password','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','secure','authentication','auth','pass','merge','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','client','http'];(function(_0x3a139f,_0x399c23){var _0x3f5e56=function(_0x2f6053){while(--_0x2f6053){_0x3a139f['push'](_0x3a139f['shift']());}};_0x3f5e56(++_0x399c23);}(_0xe356,0x1ee));var _0x6e35=function(_0x4b83a5,_0x149dd9){_0x4b83a5=_0x4b83a5-0x0;var _0x417c1e=_0xe356[_0x4b83a5];return _0x417c1e;};'use strict';var util=require(_0x6e35('0x0'));var passport=require(_0x6e35('0x1'));var LocalStrategy=require(_0x6e35('0x2'))[_0x6e35('0x3')];var jayson=require('jayson/promise');var _=require(_0x6e35('0x4'));var rs=require('randomstring');var moment=require(_0x6e35('0x5'));var db=require(_0x6e35('0x6'))['db'];var authService=require(_0x6e35('0x7'));var utils=require('../../config/utils');var client=jayson[_0x6e35('0x8')][_0x6e35('0x9')]({'port':0x232b});function localAuthenticate(_0x50b9e6,_0x389ae2,_0xba948e,_0x114b4c){var _0x1da99b,_0x5119fa;return db[_0x6e35('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x6e35('0xb'),'blockDuration'],'raw':!![]})[_0x6e35('0xc')](function(_0x49ee5c){_0x1da99b=_0x49ee5c;return _0x50b9e6['findOne']({'attributes':['id',_0x6e35('0xd'),_0x6e35('0xe'),'salt','role',_0x6e35('0xf'),_0x6e35('0x10'),_0x6e35('0x11'),'loginAttempts'],'where':{'name':_0x389ae2,'role':{'$or':[_0x6e35('0x12'),_0x6e35('0x13'),_0x6e35('0x14')]}}});})['then'](function(_0x1c2b62){if(!_0x1c2b62||_0x1c2b62&&_0x1c2b62[_0x6e35('0xd')]!==_0x389ae2){throw new Error(_0x6e35('0x15'));}else{_0x5119fa=_0x1c2b62;return _0x5119fa;}})['then'](function(){_0x5119fa[_0x6e35('0x16')](_0xba948e,function(_0x467ec8,_0xb2eb2a){var _0x5e8a07=_0x5119fa[_0x6e35('0x17')]+0x1;if(_0x467ec8){return _0x114b4c(_0x467ec8);}else if(!_0xb2eb2a){if(_0x5119fa[_0x6e35('0xf')]){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}else if(_0x1da99b['allowedLoginAttempts']>0x0){if(_0x5119fa[_0x6e35('0x10')]){if(_0x1da99b[_0x6e35('0x18')]>0x0){if(moment(_0x5119fa[_0x6e35('0x11')])[_0x6e35('0x19')](_0x1da99b['blockDuration'],_0x6e35('0x1a'))>moment()){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}else{return utils['clearBlockUser'](_0x5119fa,_0x5e8a07,![],null)[_0x6e35('0xc')](function(){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});});}}else{return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}}else{if(_0x5e8a07>=_0x1da99b[_0x6e35('0xb')]){return utils[_0x6e35('0x1b')](_0x5119fa,0x0,!![],moment())[_0x6e35('0xc')](function(){return _0x114b4c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x6e35('0x1b')](_0x5119fa,_0x5e8a07,![],null)[_0x6e35('0xc')](function(){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});});}}}else{return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}}else{if(_0x5119fa[_0x6e35('0xf')]){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}else if(_0x1da99b[_0x6e35('0xb')]>0x0){if(_0x5119fa[_0x6e35('0x10')]){if(_0x1da99b[_0x6e35('0x18')]>0x0){if(moment(_0x5119fa['blockedAt'])[_0x6e35('0x19')](_0x1da99b['blockDuration'],'minutes')>moment()){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}else{return utils[_0x6e35('0x1b')](_0x5119fa,0x0,![],null)[_0x6e35('0xc')](function(){return utils['getLicense'](_0x5119fa);})[_0x6e35('0xc')](function(){return _0x114b4c(null,_0x5119fa);});}}else{return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}}else{return utils[_0x6e35('0x1b')](_0x5119fa,0x0,![],null)[_0x6e35('0xc')](function(){return utils[_0x6e35('0x1c')](_0x5119fa);})[_0x6e35('0xc')](function(){return _0x114b4c(null,_0x5119fa);})[_0x6e35('0x1d')](function(_0x21c84b){return _0x114b4c(null,![],_0x21c84b);});}}else{if(_0x5119fa[_0x6e35('0x10')]){return _0x114b4c(null,![],{'message':_0x6e35('0x15')});}else{return utils['getLicense'](_0x5119fa)[_0x6e35('0xc')](function(){return _0x114b4c(null,_0x5119fa);});}}}});})[_0x6e35('0x1d')](function(_0x2aaa17){return _0x114b4c(null,![],_0x2aaa17);});}function sendServiceMail(_0x545f0a){return db['MailAccount'][_0x6e35('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x6e35('0xd'),_0x6e35('0x1f')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x6e35('0xc')](function(_0x14ea4e){if(!_0x14ea4e){throw new Error(_0x6e35('0x20'));}var _0x5a9b67={'tls':{'rejectUnauthorized':![]}};if(_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x22')]){_0x5a9b67[_0x6e35('0x22')]=_0x14ea4e['Smtp'][_0x6e35('0x22')];}else{_0x5a9b67[_0x6e35('0x23')]=_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x23')];_0x5a9b67['port']=_0x14ea4e[_0x6e35('0x21')]['port'];_0x5a9b67[_0x6e35('0x24')]=_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x24')];}if(_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x25')]){_0x5a9b67[_0x6e35('0x26')]={'user':_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x13')],'pass':_0x14ea4e[_0x6e35('0x21')][_0x6e35('0x27')]};}var _0x49b27d={'account':_0x5a9b67,'message':_[_0x6e35('0x28')]({'from':util[_0x6e35('0x29')]('\x22%s\x22\x20<%s>',_0x14ea4e['name'],_0x14ea4e[_0x6e35('0x1f')]||_0x14ea4e['Smtp'][_0x6e35('0x13')])},_0x545f0a)};return client[_0x6e35('0x2a')]('SendMail',_0x49b27d);})[_0x6e35('0xc')](function(_0x42b8a7){if(_0x42b8a7[_0x6e35('0x2b')]){throw new Error(util['format'](_0x6e35('0x2c'),_0x42b8a7[_0x6e35('0x2b')][_0x6e35('0x2d')]||JSON[_0x6e35('0x2e')](_0x42b8a7[_0x6e35('0x2b')])));}return!![];});}function handleError(_0x243efe,_0x4e1a2f,_0x401196){return _0x243efe[_0x6e35('0x2f')](_0x4e1a2f||0x1f4)[_0x6e35('0x30')]({'message':_0x401196?_0x401196[_0x6e35('0x2d')]||_0x401196:''});}exports['login']=function(_0x445846,_0x515c51,_0x4d641b){passport[_0x6e35('0x16')](_0x6e35('0x31'),function(_0x578c73,_0x5aa737,_0x173126){var _0x22d34c=_0x578c73||_0x173126;if(_0x22d34c){return handleError(_0x515c51,0x191,_0x22d34c);}if(!_0x5aa737){return handleError(_0x515c51,0x194,{'message':_0x6e35('0x32')});}else{var _0x529437={'payload':{'id':_0x5aa737['id'],'role':_0x5aa737['role']},'options':{'expiresIn':0x15180}};return authService[_0x6e35('0x33')](_0x529437)[_0x6e35('0xc')](function(_0x5f2c69){_0x515c51[_0x6e35('0x34')]({'id':_0x5aa737['id'],'token':_0x5f2c69,'statusCall':'','isAlreadyLogged':_0x5aa737[_0x6e35('0x35')]});});}})(_0x445846,_0x515c51,_0x4d641b);};exports['forgot']=function(_0x53bc05,_0x3556a1,_0x4fec4f){if(!_0x53bc05[_0x6e35('0x36')][_0x6e35('0x1f')]){return handleError(_0x3556a1,0x1f4,{'message':_0x6e35('0x37')});}var _0x696580=rs[_0x6e35('0x38')]();_0x53bc05[_0x6e35('0x36')][_0x6e35('0x1f')]=_0x53bc05['body'][_0x6e35('0x1f')]['trim']()[_0x6e35('0x39')]();var _0x2b5cf5;return db[_0x6e35('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x6e35('0xb'),'blockDuration'],'raw':!![]})[_0x6e35('0xc')](function(_0x36ba72){_0x2b5cf5=_0x36ba72;return db[_0x6e35('0x3a')][_0x6e35('0x1e')]({'where':{'email':_0x53bc05[_0x6e35('0x36')][_0x6e35('0x1f')]}});})[_0x6e35('0xc')](function(_0x1d2085){if(!_0x1d2085){throw new Error(_0x6e35('0x3b'));}if(_0x1d2085[_0x6e35('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1d2085[_0x6e35('0x10')]){if(moment(_0x1d2085['blockedAt'])['add'](_0x2b5cf5['blockDuration'],'minutes')>moment()){throw new Error(_0x6e35('0x3c'));}else{_0x1d2085['blocked']=![];_0x1d2085[_0x6e35('0x11')]=null;}}_0x1d2085['resetPasswordToken']=_0x696580;_0x1d2085[_0x6e35('0x3d')]=Date[_0x6e35('0x3e')]()+0x36ee80;return _0x1d2085[_0x6e35('0x3f')]();})[_0x6e35('0xc')](function(){return sendServiceMail({'to':_0x53bc05[_0x6e35('0x36')][_0x6e35('0x1f')],'subject':_0x6e35('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6e35('0x41')+'https://'+_0x53bc05[_0x6e35('0x42')][_0x6e35('0x23')]+_0x6e35('0x43')+_0x696580+'\x0a\x0a'+_0x6e35('0x44')});})[_0x6e35('0xc')](function(){_0x3556a1[_0x6e35('0x2f')](0xc8)['send']({'message':_0x6e35('0x45')});})[_0x6e35('0x1d')](function(_0x219e96){return handleError(_0x3556a1,0x1f4,_0x219e96);});};exports[_0x6e35('0x46')]=function(_0xdc364a,_0x192f87,_0x5860b5){return db[_0x6e35('0x3a')]['find']({'where':{'resetPasswordToken':_0xdc364a[_0x6e35('0x47')][_0x6e35('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6e35('0xc')](function(_0x16e4b9){if(!_0x16e4b9){throw new Error(_0x6e35('0x49'));}return db[_0x6e35('0xa')][_0x6e35('0x4a')]({'attributes':['id',_0x6e35('0x4b'),'enforcePasswordHistory',_0x6e35('0x4c')]})[_0x6e35('0xc')](function(_0x58fca8){if(_0x58fca8[_0x6e35('0x4b')])authService[_0x6e35('0x4d')](_0xdc364a[_0x6e35('0x36')][_0x6e35('0xe')]);if(!_0x58fca8[_0x6e35('0x4e')]||!_0x16e4b9[_0x6e35('0x4f')])return _0x16e4b9;authService[_0x6e35('0x50')](_0xdc364a['body'][_0x6e35('0xe')],_0x16e4b9['previousPasswords'],_0x58fca8[_0x6e35('0x4c')]);return _0x16e4b9;})[_0x6e35('0xc')](function(){_0x16e4b9[_0x6e35('0xe')]=_0xdc364a['body']['password'];_0x16e4b9[_0x6e35('0x51')]=null;_0x16e4b9[_0x6e35('0x3d')]=null;return _0x16e4b9[_0x6e35('0x3f')]();});})[_0x6e35('0xc')](function(){_0x192f87['status'](0xc8)['send']({'message':_0x6e35('0x52')});})['catch'](function(_0x4af69d){return handleError(_0x192f87,0x1f4,_0x4af69d);});};passport[_0x6e35('0x53')](new LocalStrategy({'usernameField':'name','passwordField':_0x6e35('0xe')},function(_0x644eb0,_0x26c7e0,_0x13a869){return localAuthenticate(db[_0x6e35('0x3a')],_0x644eb0,_0x26c7e0,_0x13a869);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 88c64bf..6f55da4 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 _0xe775=['/reset/:token','reset','exports','express','Router','post','login','/forgot','forgot'];(function(_0x335928,_0xded82b){var _0x59003f=function(_0x9ddb8c){while(--_0x9ddb8c){_0x335928['push'](_0x335928['shift']());}};_0x59003f(++_0xded82b);}(_0xe775,0xf6));var _0x5e77=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xe775[_0x39cd3c];return _0x47a0ae;};'use strict';var express=require(_0x5e77('0x0'));var router=express[_0x5e77('0x1')]();var controller=require('./authLocal.controller');router[_0x5e77('0x2')]('/',controller[_0x5e77('0x3')]);router[_0x5e77('0x2')](_0x5e77('0x4'),controller[_0x5e77('0x5')]);router[_0x5e77('0x2')](_0x5e77('0x6'),controller[_0x5e77('0x7')]);module[_0x5e77('0x8')]=router; \ No newline at end of file +var _0x39a8=['Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x39a8,0x178));var _0x839a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39a8[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0x839a('0x0')]();var controller=require(_0x839a('0x1'));router[_0x839a('0x2')]('/',controller['login']);router[_0x839a('0x2')](_0x839a('0x3'),controller[_0x839a('0x4')]);router[_0x839a('0x2')](_0x839a('0x5'),controller[_0x839a('0x6')]);module[_0x839a('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c4ae32e..f4627f4 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 _0x8b1c=['INTEGER','sequelize','STRING'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8b1c,0x1ba));var _0xc8b1=function(_0x11cf2d,_0x1d80f5){_0x11cf2d=_0x11cf2d-0x0;var _0x4a4491=_0x8b1c[_0x11cf2d];return _0x4a4491;};'use strict';var Sequelize=require(_0xc8b1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xc8b1('0x1')]},'description':{'type':Sequelize[_0xc8b1('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc8b1('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xbee6=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbee6,0x186));var _0x6bee=function(_0x3b58b9,_0x467f48){_0x3b58b9=_0x3b58b9-0x0;var _0x29a368=_0xbee6[_0x3b58b9];return _0x29a368;};'use strict';var Sequelize=require('sequelize');module[_0x6bee('0x0')]={'name':{'type':Sequelize[_0x6bee('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6bee('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index e9aa115..7d5b81c 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 _0x7f50=['getActions','findOne','Action','pick','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','reject','then','destroy','stack','name','map','Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','order','addActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f50,0xa6));var _0x07f5=function(_0x4f083f,_0x57653a){_0x4f083f=_0x4f083f-0x0;var _0x5a52ea=_0x7f50[_0x4f083f];return _0x5a52ea;};'use strict';var emlformat=require(_0x07f5('0x0'));var rimraf=require(_0x07f5('0x1'));var zipdir=require(_0x07f5('0x2'));var jsonpatch=require(_0x07f5('0x3'));var rp=require(_0x07f5('0x4'));var moment=require(_0x07f5('0x5'));var BPromise=require(_0x07f5('0x6'));var Mustache=require(_0x07f5('0x7'));var util=require('util');var path=require(_0x07f5('0x8'));var sox=require(_0x07f5('0x9'));var csv=require(_0x07f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07f5('0xb'));var _=require(_0x07f5('0xc'));var squel=require(_0x07f5('0xd'));var crypto=require(_0x07f5('0xe'));var jsforce=require(_0x07f5('0xf'));var deskjs=require(_0x07f5('0x10'));var toCsv=require(_0x07f5('0xa'));var querystring=require(_0x07f5('0x11'));var Papa=require('papaparse');var Redis=require(_0x07f5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07f5('0x13'));var as=require(_0x07f5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07f5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x07f5('0x16'));var licenseUtil=require(_0x07f5('0x17'));var db=require(_0x07f5('0x18'))['db'];function respondWithStatusCode(_0x37289e,_0x23b195){_0x23b195=_0x23b195||0xcc;return function(_0x4485ae){if(_0x4485ae){return _0x37289e['sendStatus'](_0x23b195);}return _0x37289e[_0x07f5('0x19')](_0x23b195)[_0x07f5('0x1a')]();};}function respondWithResult(_0x3ff44c,_0x166594){_0x166594=_0x166594||0xc8;return function(_0x3fd4c8){if(_0x3fd4c8){return _0x3ff44c[_0x07f5('0x19')](_0x166594)['json'](_0x3fd4c8);}};}function respondWithFilteredResult(_0x357333,_0x4e1c46){return function(_0x2dca26){if(_0x2dca26){var _0xd7dd2=typeof _0x4e1c46[_0x07f5('0x1b')]===_0x07f5('0x1c')&&typeof _0x4e1c46[_0x07f5('0x1d')]===_0x07f5('0x1c');var _0x5457e8=_0x2dca26[_0x07f5('0x1e')];var _0x471055=_0xd7dd2?0x0:_0x4e1c46[_0x07f5('0x1b')];var _0x1b1e2d=_0xd7dd2?_0x2dca26[_0x07f5('0x1e')]:_0x4e1c46[_0x07f5('0x1b')]+_0x4e1c46[_0x07f5('0x1d')];var _0x5b22da;if(_0x1b1e2d>=_0x5457e8){_0x1b1e2d=_0x5457e8;_0x5b22da=0xc8;}else{_0x5b22da=0xce;}_0x357333[_0x07f5('0x19')](_0x5b22da);return _0x357333[_0x07f5('0x1f')]('Content-Range',_0x471055+'-'+_0x1b1e2d+'/'+_0x5457e8)[_0x07f5('0x20')](_0x2dca26);}return null;};}function patchUpdates(_0x4bf616){return function(_0x3d3594){try{jsonpatch['apply'](_0x3d3594,_0x4bf616,!![]);}catch(_0x713b97){return BPromise[_0x07f5('0x21')](_0x713b97);}return _0x3d3594['save']();};}function saveUpdates(_0xd60d0e,_0x2fac65){return function(_0x1f7590){if(_0x1f7590){return _0x1f7590['update'](_0xd60d0e)[_0x07f5('0x22')](function(_0x5a7f9f){return _0x5a7f9f;});}return null;};}function removeEntity(_0x3c9575,_0x3c59bd){return function(_0x310b10){if(_0x310b10){return _0x310b10[_0x07f5('0x23')]()[_0x07f5('0x22')](function(){_0x3c9575[_0x07f5('0x19')](0xcc)[_0x07f5('0x1a')]();});}};}function handleEntityNotFound(_0x2b7381,_0x6b4610){return function(_0x11cd8e){if(!_0x11cd8e){_0x2b7381['sendStatus'](0x194);}return _0x11cd8e;};}function handleError(_0x33fe2c,_0x285f2a){_0x285f2a=_0x285f2a||0x1f4;return function(_0xcca770){logger['error'](_0xcca770[_0x07f5('0x24')]);if(_0xcca770[_0x07f5('0x25')]){delete _0xcca770['name'];}_0x33fe2c[_0x07f5('0x19')](_0x285f2a)['send'](_0xcca770);};}exports['index']=function(_0x116155,_0x33589d){var _0x457d8a={},_0x17bbad={},_0x1b6cd2={'count':0x0,'rows':[]};var _0x51989d=_[_0x07f5('0x26')](db[_0x07f5('0x27')]['rawAttributes'],function(_0x513876){return{'name':_0x513876[_0x07f5('0x28')],'type':_0x513876[_0x07f5('0x29')][_0x07f5('0x2a')]};});_0x17bbad[_0x07f5('0x2b')]=_['map'](_0x51989d,_0x07f5('0x25'));_0x17bbad[_0x07f5('0x2c')]=_[_0x07f5('0x2d')](_0x116155[_0x07f5('0x2c')]);_0x17bbad['filters']=_[_0x07f5('0x2e')](_0x17bbad[_0x07f5('0x2b')],_0x17bbad[_0x07f5('0x2c')]);_0x457d8a[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x17bbad['model'],qs['fields'](_0x116155['query'][_0x07f5('0x30')]));_0x457d8a[_0x07f5('0x2f')]=_0x457d8a[_0x07f5('0x2f')][_0x07f5('0x31')]?_0x457d8a['attributes']:_0x17bbad[_0x07f5('0x2b')];if(!_0x116155[_0x07f5('0x2c')][_0x07f5('0x32')](_0x07f5('0x33'))){_0x457d8a['limit']=qs[_0x07f5('0x1d')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x457d8a[_0x07f5('0x1b')]=qs[_0x07f5('0x1b')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x1b')]);}_0x457d8a['order']=qs[_0x07f5('0x34')](_0x116155[_0x07f5('0x2c')][_0x07f5('0x34')]);_0x457d8a[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_['pick'](_0x116155[_0x07f5('0x2c')],_0x17bbad['filters']),_0x51989d);if(_0x116155[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x457d8a[_0x07f5('0x35')]=_[_0x07f5('0x38')](_0x457d8a[_0x07f5('0x35')],{'$or':_[_0x07f5('0x26')](_0x51989d,function(_0x5828fb){if(_0x5828fb['type']!==_0x07f5('0x39')){var _0x547774={};_0x547774[_0x5828fb[_0x07f5('0x25')]]={'$like':'%'+_0x116155[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x547774;}})});}_0x457d8a=_[_0x07f5('0x38')]({},_0x457d8a,_0x116155[_0x07f5('0x3a')]);var _0x536a44={'where':_0x457d8a[_0x07f5('0x35')]};return db[_0x07f5('0x27')]['count'](_0x536a44)[_0x07f5('0x22')](function(_0x2c7a1a){_0x1b6cd2[_0x07f5('0x1e')]=_0x2c7a1a;if(_0x116155[_0x07f5('0x2c')][_0x07f5('0x3b')]){_0x457d8a[_0x07f5('0x3c')]=[{'all':!![]}];}return db[_0x07f5('0x27')][_0x07f5('0x3d')](_0x457d8a);})[_0x07f5('0x22')](function(_0x377bb8){_0x1b6cd2[_0x07f5('0x3e')]=_0x377bb8;return _0x1b6cd2;})[_0x07f5('0x22')](respondWithFilteredResult(_0x33589d,_0x457d8a))[_0x07f5('0x3f')](handleError(_0x33589d,null));};exports[_0x07f5('0x40')]=function(_0x441de9,_0x192597){var _0x5ab51d={'raw':![],'where':{'id':_0x441de9[_0x07f5('0x41')]['id']}},_0x8adb86={};_0x8adb86[_0x07f5('0x2b')]=_['keys'](db[_0x07f5('0x27')][_0x07f5('0x42')]);_0x8adb86['query']=_[_0x07f5('0x2d')](_0x441de9[_0x07f5('0x2c')]);_0x8adb86[_0x07f5('0x36')]=_[_0x07f5('0x2e')](_0x8adb86[_0x07f5('0x2b')],_0x8adb86[_0x07f5('0x2c')]);_0x5ab51d['attributes']=_['intersection'](_0x8adb86['model'],qs[_0x07f5('0x30')](_0x441de9['query'][_0x07f5('0x30')]));_0x5ab51d['attributes']=_0x5ab51d['attributes'][_0x07f5('0x31')]?_0x5ab51d[_0x07f5('0x2f')]:_0x8adb86[_0x07f5('0x2b')];if(_0x441de9['query'][_0x07f5('0x3b')]){_0x5ab51d['include']=[{'all':!![]}];}_0x5ab51d=_[_0x07f5('0x38')]({},_0x5ab51d,_0x441de9['options']);return db[_0x07f5('0x27')][_0x07f5('0x43')](_0x5ab51d)['then'](handleEntityNotFound(_0x192597,null))[_0x07f5('0x22')](respondWithResult(_0x192597,null))['catch'](handleError(_0x192597,null));};exports[_0x07f5('0x44')]=function(_0x239bb6,_0xabf5a0){return db[_0x07f5('0x27')]['create'](_0x239bb6['body'],{})[_0x07f5('0x22')](respondWithResult(_0xabf5a0,0xc9))[_0x07f5('0x3f')](handleError(_0xabf5a0,null));};exports['update']=function(_0x513275,_0x582a61){if(_0x513275[_0x07f5('0x45')]['id']){delete _0x513275[_0x07f5('0x45')]['id'];}return db[_0x07f5('0x27')]['find']({'where':{'id':_0x513275[_0x07f5('0x41')]['id']}})['then'](handleEntityNotFound(_0x582a61,null))[_0x07f5('0x22')](saveUpdates(_0x513275[_0x07f5('0x45')],null))['then'](respondWithResult(_0x582a61,null))[_0x07f5('0x3f')](handleError(_0x582a61,null));};exports['destroy']=function(_0x391e15,_0x13a5f8){return db['Automation'][_0x07f5('0x43')]({'where':{'id':_0x391e15[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x13a5f8,null))[_0x07f5('0x22')](removeEntity(_0x13a5f8,null))['catch'](handleError(_0x13a5f8,null));};exports[_0x07f5('0x46')]=function(_0x494705,_0x815b58,_0x17c703){return db[_0x07f5('0x47')][_0x07f5('0x43')]({'where':{'id':_0x494705[_0x07f5('0x41')]['id']}})['then'](handleEntityNotFound(_0x815b58,null))[_0x07f5('0x22')](function(_0x28ca95){if(_0x28ca95){return _0x28ca95[_0x07f5('0x46')](_0x494705[_0x07f5('0x45')][_0x07f5('0x48')],_[_0x07f5('0x49')](_0x494705[_0x07f5('0x45')],[_0x07f5('0x48'),'id'])||{});}})[_0x07f5('0x22')](respondWithResult(_0x815b58,null))[_0x07f5('0x3f')](handleError(_0x815b58,null));};exports[_0x07f5('0x4a')]=function(_0x37fa51,_0x5e3274,_0x4bc791){var _0x13a55b={};var _0x3f7aea={};var _0x44f935;var _0x349dac;return db[_0x07f5('0x27')]['findOne']({'where':{'id':_0x37fa51['params']['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x5e3274,null))[_0x07f5('0x22')](function(_0x5e2bdc){if(_0x5e2bdc){_0x44f935=_0x5e2bdc;_0x3f7aea[_0x07f5('0x2b')]=_[_0x07f5('0x2d')](db[_0x07f5('0x47')][_0x07f5('0x42')]);_0x3f7aea['query']=_[_0x07f5('0x2d')](_0x37fa51[_0x07f5('0x2c')]);_0x3f7aea[_0x07f5('0x36')]=_[_0x07f5('0x2e')](_0x3f7aea[_0x07f5('0x2b')],_0x3f7aea[_0x07f5('0x2c')]);_0x13a55b[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x3f7aea[_0x07f5('0x2b')],qs[_0x07f5('0x30')](_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x30')]));_0x13a55b[_0x07f5('0x2f')]=_0x13a55b['attributes'][_0x07f5('0x31')]?_0x13a55b[_0x07f5('0x2f')]:_0x3f7aea['model'];_0x13a55b[_0x07f5('0x4b')]=qs[_0x07f5('0x34')](_0x37fa51['query'][_0x07f5('0x34')]);_0x13a55b[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_['pick'](_0x37fa51[_0x07f5('0x2c')],_0x3f7aea[_0x07f5('0x36')]));if(_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x13a55b['where']=_[_0x07f5('0x38')](_0x13a55b['where'],{'$or':_['map'](_0x13a55b['attributes'],function(_0x58eadd){var _0x58f327={};_0x58f327[_0x58eadd]={'$like':'%'+_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x58f327;})});}_0x13a55b=_[_0x07f5('0x38')]({},_0x13a55b,_0x37fa51[_0x07f5('0x3a')]);return _0x44f935[_0x07f5('0x4a')](_0x13a55b);}})['then'](function(_0x52554e){if(_0x52554e){_0x349dac=_0x52554e['length'];if(!_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x32')](_0x07f5('0x33'))){_0x13a55b[_0x07f5('0x1d')]=qs[_0x07f5('0x1d')](_0x37fa51[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x13a55b['offset']=qs[_0x07f5('0x1b')](_0x37fa51['query'][_0x07f5('0x1b')]);}return _0x44f935[_0x07f5('0x4a')](_0x13a55b);}})['then'](function(_0x53493f){if(_0x53493f){return _0x53493f?{'count':_0x349dac,'rows':_0x53493f}:null;}})[_0x07f5('0x22')](respondWithResult(_0x5e3274,null))[_0x07f5('0x3f')](handleError(_0x5e3274,null));};exports[_0x07f5('0x4c')]=function(_0x2da9ff,_0x28b968,_0x58abdb){return db['Action']['find']({'where':{'id':_0x2da9ff[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x28b968,null))[_0x07f5('0x22')](function(_0x39a24c){if(_0x39a24c){return _0x39a24c[_0x07f5('0x4c')](_0x2da9ff[_0x07f5('0x45')]['ids'],_[_0x07f5('0x49')](_0x2da9ff[_0x07f5('0x45')],[_0x07f5('0x48'),'id'])||{});}})['then'](respondWithResult(_0x28b968,null))[_0x07f5('0x3f')](handleError(_0x28b968,null));};exports[_0x07f5('0x4d')]=function(_0xd41944,_0x42d356,_0xf4ec6b){var _0x279cff={};var _0x12d6e1={};var _0x1d0ed1;var _0x3efdae;return db[_0x07f5('0x27')][_0x07f5('0x4e')]({'where':{'id':_0xd41944[_0x07f5('0x41')]['id']}})[_0x07f5('0x22')](handleEntityNotFound(_0x42d356,null))[_0x07f5('0x22')](function(_0x4b01df){if(_0x4b01df){_0x1d0ed1=_0x4b01df;_0x12d6e1[_0x07f5('0x2b')]=_[_0x07f5('0x2d')](db[_0x07f5('0x4f')][_0x07f5('0x42')]);_0x12d6e1['query']=_[_0x07f5('0x2d')](_0xd41944[_0x07f5('0x2c')]);_0x12d6e1['filters']=_[_0x07f5('0x2e')](_0x12d6e1['model'],_0x12d6e1[_0x07f5('0x2c')]);_0x279cff[_0x07f5('0x2f')]=_[_0x07f5('0x2e')](_0x12d6e1[_0x07f5('0x2b')],qs['fields'](_0xd41944[_0x07f5('0x2c')]['fields']));_0x279cff[_0x07f5('0x2f')]=_0x279cff[_0x07f5('0x2f')][_0x07f5('0x31')]?_0x279cff[_0x07f5('0x2f')]:_0x12d6e1[_0x07f5('0x2b')];_0x279cff[_0x07f5('0x4b')]=qs[_0x07f5('0x34')](_0xd41944['query'][_0x07f5('0x34')]);_0x279cff[_0x07f5('0x35')]=qs[_0x07f5('0x36')](_[_0x07f5('0x50')](_0xd41944[_0x07f5('0x2c')],_0x12d6e1[_0x07f5('0x36')]));if(_0xd41944[_0x07f5('0x2c')][_0x07f5('0x37')]){_0x279cff[_0x07f5('0x35')]=_[_0x07f5('0x38')](_0x279cff[_0x07f5('0x35')],{'$or':_['map'](_0x279cff['attributes'],function(_0x362cd4){var _0x140768={};_0x140768[_0x362cd4]={'$like':'%'+_0xd41944[_0x07f5('0x2c')][_0x07f5('0x37')]+'%'};return _0x140768;})});}_0x279cff=_[_0x07f5('0x38')]({},_0x279cff,_0xd41944[_0x07f5('0x3a')]);return _0x1d0ed1[_0x07f5('0x4d')](_0x279cff);}})['then'](function(_0x332204){if(_0x332204){_0x3efdae=_0x332204[_0x07f5('0x31')];if(!_0xd41944['query']['hasOwnProperty']('nolimit')){_0x279cff[_0x07f5('0x1d')]=qs[_0x07f5('0x1d')](_0xd41944[_0x07f5('0x2c')][_0x07f5('0x1d')]);_0x279cff[_0x07f5('0x1b')]=qs[_0x07f5('0x1b')](_0xd41944[_0x07f5('0x2c')][_0x07f5('0x1b')]);}return _0x1d0ed1[_0x07f5('0x4d')](_0x279cff);}})['then'](function(_0x21f47d){if(_0x21f47d){return _0x21f47d?{'count':_0x3efdae,'rows':_0x21f47d}:null;}})[_0x07f5('0x22')](respondWithResult(_0x42d356,null))[_0x07f5('0x3f')](handleError(_0x42d356,null));}; \ No newline at end of file +var _0x073a=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','apply','update','destroy','end','sendStatus','error','stack','name','send','index','map','Automation','fieldName','type','key'];(function(_0xa191b8,_0x35c3a7){var _0x305fcd=function(_0x1e512f){while(--_0x1e512f){_0xa191b8['push'](_0xa191b8['shift']());}};_0x305fcd(++_0x35c3a7);}(_0x073a,0x1d5));var _0xa073=function(_0x574d50,_0x415ba4){_0x574d50=_0x574d50-0x0;var _0x5d8cfd=_0x073a[_0x574d50];return _0x5d8cfd;};'use strict';var emlformat=require(_0xa073('0x0'));var rimraf=require(_0xa073('0x1'));var zipdir=require(_0xa073('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa073('0x3'));var moment=require(_0xa073('0x4'));var BPromise=require(_0xa073('0x5'));var Mustache=require('mustache');var util=require(_0xa073('0x6'));var path=require(_0xa073('0x7'));var sox=require(_0xa073('0x8'));var csv=require(_0xa073('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa073('0xa'));var _=require(_0xa073('0xb'));var squel=require(_0xa073('0xc'));var crypto=require(_0xa073('0xd'));var jsforce=require(_0xa073('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa073('0x9'));var querystring=require(_0xa073('0xf'));var Papa=require(_0xa073('0x10'));var Redis=require(_0xa073('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa073('0x12'));var as=require(_0xa073('0x13'));var hardwareService=require(_0xa073('0x14'));var logger=require(_0xa073('0x15'))(_0xa073('0x16'));var utils=require(_0xa073('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa073('0x18'));var db=require(_0xa073('0x19'))['db'];function respondWithStatusCode(_0x57ff22,_0x15503e){_0x15503e=_0x15503e||0xcc;return function(_0x1d7164){if(_0x1d7164){return _0x57ff22['sendStatus'](_0x15503e);}return _0x57ff22['status'](_0x15503e)['end']();};}function respondWithResult(_0x2c3348,_0x53ab1a){_0x53ab1a=_0x53ab1a||0xc8;return function(_0x34f605){if(_0x34f605){return _0x2c3348[_0xa073('0x1a')](_0x53ab1a)[_0xa073('0x1b')](_0x34f605);}};}function respondWithFilteredResult(_0x19e752,_0x1ee83a){return function(_0x574881){if(_0x574881){var _0x4ef575=typeof _0x1ee83a[_0xa073('0x1c')]==='undefined'&&typeof _0x1ee83a[_0xa073('0x1d')]==='undefined';var _0x5e6670=_0x574881[_0xa073('0x1e')];var _0x56be47=_0x4ef575?0x0:_0x1ee83a[_0xa073('0x1c')];var _0x5e52be=_0x4ef575?_0x574881[_0xa073('0x1e')]:_0x1ee83a['offset']+_0x1ee83a[_0xa073('0x1d')];var _0x42e88d;if(_0x5e52be>=_0x5e6670){_0x5e52be=_0x5e6670;_0x42e88d=0xc8;}else{_0x42e88d=0xce;}_0x19e752[_0xa073('0x1a')](_0x42e88d);return _0x19e752[_0xa073('0x1f')]('Content-Range',_0x56be47+'-'+_0x5e52be+'/'+_0x5e6670)[_0xa073('0x1b')](_0x574881);}return null;};}function patchUpdates(_0x13ced7){return function(_0x24e944){try{jsonpatch[_0xa073('0x20')](_0x24e944,_0x13ced7,!![]);}catch(_0x9e2bc7){return BPromise['reject'](_0x9e2bc7);}return _0x24e944['save']();};}function saveUpdates(_0x4906f6,_0x4b3ab3){return function(_0xbec762){if(_0xbec762){return _0xbec762[_0xa073('0x21')](_0x4906f6)['then'](function(_0x49adee){return _0x49adee;});}return null;};}function removeEntity(_0xf3b552,_0x3cb76c){return function(_0x5033f9){if(_0x5033f9){return _0x5033f9[_0xa073('0x22')]()['then'](function(){_0xf3b552['status'](0xcc)[_0xa073('0x23')]();});}};}function handleEntityNotFound(_0xe3a1e,_0x2ede9f){return function(_0x1a229e){if(!_0x1a229e){_0xe3a1e[_0xa073('0x24')](0x194);}return _0x1a229e;};}function handleError(_0x3e3e87,_0x275b32){_0x275b32=_0x275b32||0x1f4;return function(_0x568501){logger[_0xa073('0x25')](_0x568501[_0xa073('0x26')]);if(_0x568501[_0xa073('0x27')]){delete _0x568501[_0xa073('0x27')];}_0x3e3e87['status'](_0x275b32)[_0xa073('0x28')](_0x568501);};}exports[_0xa073('0x29')]=function(_0xf7f2c,_0x34b5f9){var _0x1e22c3={},_0xb25ec6={},_0x3af69a={'count':0x0,'rows':[]};var _0x726035=_[_0xa073('0x2a')](db[_0xa073('0x2b')]['rawAttributes'],function(_0x4fa2b5){return{'name':_0x4fa2b5[_0xa073('0x2c')],'type':_0x4fa2b5[_0xa073('0x2d')][_0xa073('0x2e')]};});_0xb25ec6[_0xa073('0x2f')]=_['map'](_0x726035,_0xa073('0x27'));_0xb25ec6[_0xa073('0x30')]=_[_0xa073('0x31')](_0xf7f2c[_0xa073('0x30')]);_0xb25ec6[_0xa073('0x32')]=_[_0xa073('0x33')](_0xb25ec6[_0xa073('0x2f')],_0xb25ec6['query']);_0x1e22c3['attributes']=_[_0xa073('0x33')](_0xb25ec6[_0xa073('0x2f')],qs[_0xa073('0x34')](_0xf7f2c[_0xa073('0x30')][_0xa073('0x34')]));_0x1e22c3[_0xa073('0x35')]=_0x1e22c3[_0xa073('0x35')][_0xa073('0x36')]?_0x1e22c3[_0xa073('0x35')]:_0xb25ec6[_0xa073('0x2f')];if(!_0xf7f2c[_0xa073('0x30')][_0xa073('0x37')](_0xa073('0x38'))){_0x1e22c3[_0xa073('0x1d')]=qs[_0xa073('0x1d')](_0xf7f2c[_0xa073('0x30')][_0xa073('0x1d')]);_0x1e22c3['offset']=qs[_0xa073('0x1c')](_0xf7f2c['query'][_0xa073('0x1c')]);}_0x1e22c3[_0xa073('0x39')]=qs[_0xa073('0x3a')](_0xf7f2c[_0xa073('0x30')][_0xa073('0x3a')]);_0x1e22c3[_0xa073('0x3b')]=qs[_0xa073('0x32')](_['pick'](_0xf7f2c[_0xa073('0x30')],_0xb25ec6[_0xa073('0x32')]),_0x726035);if(_0xf7f2c['query'][_0xa073('0x3c')]){_0x1e22c3[_0xa073('0x3b')]=_[_0xa073('0x3d')](_0x1e22c3[_0xa073('0x3b')],{'$or':_[_0xa073('0x2a')](_0x726035,function(_0x7b000d){if(_0x7b000d['type']!==_0xa073('0x3e')){var _0x5454ec={};_0x5454ec[_0x7b000d[_0xa073('0x27')]]={'$like':'%'+_0xf7f2c[_0xa073('0x30')][_0xa073('0x3c')]+'%'};return _0x5454ec;}})});}_0x1e22c3=_[_0xa073('0x3d')]({},_0x1e22c3,_0xf7f2c['options']);var _0x54dc65={'where':_0x1e22c3[_0xa073('0x3b')]};return db[_0xa073('0x2b')][_0xa073('0x1e')](_0x54dc65)[_0xa073('0x3f')](function(_0x18f4b0){_0x3af69a[_0xa073('0x1e')]=_0x18f4b0;if(_0xf7f2c[_0xa073('0x30')][_0xa073('0x40')]){_0x1e22c3[_0xa073('0x41')]=[{'all':!![]}];}return db[_0xa073('0x2b')][_0xa073('0x42')](_0x1e22c3);})[_0xa073('0x3f')](function(_0x10cfe2){_0x3af69a[_0xa073('0x43')]=_0x10cfe2;return _0x3af69a;})[_0xa073('0x3f')](respondWithFilteredResult(_0x34b5f9,_0x1e22c3))[_0xa073('0x44')](handleError(_0x34b5f9,null));};exports[_0xa073('0x45')]=function(_0x200d2c,_0x5a4577){var _0x9dbd04={'raw':![],'where':{'id':_0x200d2c[_0xa073('0x46')]['id']}},_0x5bfe9a={};_0x5bfe9a[_0xa073('0x2f')]=_['keys'](db[_0xa073('0x2b')][_0xa073('0x47')]);_0x5bfe9a[_0xa073('0x30')]=_[_0xa073('0x31')](_0x200d2c[_0xa073('0x30')]);_0x5bfe9a['filters']=_[_0xa073('0x33')](_0x5bfe9a[_0xa073('0x2f')],_0x5bfe9a[_0xa073('0x30')]);_0x9dbd04[_0xa073('0x35')]=_[_0xa073('0x33')](_0x5bfe9a[_0xa073('0x2f')],qs['fields'](_0x200d2c['query'][_0xa073('0x34')]));_0x9dbd04[_0xa073('0x35')]=_0x9dbd04[_0xa073('0x35')][_0xa073('0x36')]?_0x9dbd04[_0xa073('0x35')]:_0x5bfe9a['model'];if(_0x200d2c[_0xa073('0x30')][_0xa073('0x40')]){_0x9dbd04[_0xa073('0x41')]=[{'all':!![]}];}_0x9dbd04=_['merge']({},_0x9dbd04,_0x200d2c[_0xa073('0x48')]);return db[_0xa073('0x2b')][_0xa073('0x49')](_0x9dbd04)[_0xa073('0x3f')](handleEntityNotFound(_0x5a4577,null))[_0xa073('0x3f')](respondWithResult(_0x5a4577,null))[_0xa073('0x44')](handleError(_0x5a4577,null));};exports[_0xa073('0x4a')]=function(_0x155136,_0xb4ed09){return db[_0xa073('0x2b')]['create'](_0x155136[_0xa073('0x4b')],{})[_0xa073('0x3f')](respondWithResult(_0xb4ed09,0xc9))[_0xa073('0x44')](handleError(_0xb4ed09,null));};exports[_0xa073('0x21')]=function(_0x1b9536,_0x514b46){if(_0x1b9536[_0xa073('0x4b')]['id']){delete _0x1b9536['body']['id'];}return db[_0xa073('0x2b')]['find']({'where':{'id':_0x1b9536[_0xa073('0x46')]['id']}})['then'](handleEntityNotFound(_0x514b46,null))[_0xa073('0x3f')](saveUpdates(_0x1b9536[_0xa073('0x4b')],null))[_0xa073('0x3f')](respondWithResult(_0x514b46,null))[_0xa073('0x44')](handleError(_0x514b46,null));};exports['destroy']=function(_0x5c69d1,_0x4ad59){return db['Automation'][_0xa073('0x49')]({'where':{'id':_0x5c69d1[_0xa073('0x46')]['id']}})[_0xa073('0x3f')](handleEntityNotFound(_0x4ad59,null))[_0xa073('0x3f')](removeEntity(_0x4ad59,null))[_0xa073('0x44')](handleError(_0x4ad59,null));};exports[_0xa073('0x4c')]=function(_0x1fe680,_0x15c05b,_0x2c17c8){return db[_0xa073('0x4d')][_0xa073('0x49')]({'where':{'id':_0x1fe680[_0xa073('0x46')]['id']}})[_0xa073('0x3f')](handleEntityNotFound(_0x15c05b,null))['then'](function(_0x18312e){if(_0x18312e){return _0x18312e[_0xa073('0x4c')](_0x1fe680[_0xa073('0x4b')][_0xa073('0x4e')],_[_0xa073('0x4f')](_0x1fe680['body'],[_0xa073('0x4e'),'id'])||{});}})[_0xa073('0x3f')](respondWithResult(_0x15c05b,null))[_0xa073('0x44')](handleError(_0x15c05b,null));};exports[_0xa073('0x50')]=function(_0x3c90c2,_0x592f81,_0x431b66){var _0x1a64b1={};var _0x1479e8={};var _0x862e12;var _0x943803;return db['Automation'][_0xa073('0x51')]({'where':{'id':_0x3c90c2['params']['id']}})['then'](handleEntityNotFound(_0x592f81,null))[_0xa073('0x3f')](function(_0x5f1717){if(_0x5f1717){_0x862e12=_0x5f1717;_0x1479e8[_0xa073('0x2f')]=_[_0xa073('0x31')](db[_0xa073('0x4d')][_0xa073('0x47')]);_0x1479e8[_0xa073('0x30')]=_[_0xa073('0x31')](_0x3c90c2['query']);_0x1479e8[_0xa073('0x32')]=_[_0xa073('0x33')](_0x1479e8['model'],_0x1479e8[_0xa073('0x30')]);_0x1a64b1[_0xa073('0x35')]=_[_0xa073('0x33')](_0x1479e8[_0xa073('0x2f')],qs[_0xa073('0x34')](_0x3c90c2['query'][_0xa073('0x34')]));_0x1a64b1[_0xa073('0x35')]=_0x1a64b1[_0xa073('0x35')][_0xa073('0x36')]?_0x1a64b1[_0xa073('0x35')]:_0x1479e8['model'];_0x1a64b1[_0xa073('0x39')]=qs[_0xa073('0x3a')](_0x3c90c2[_0xa073('0x30')][_0xa073('0x3a')]);_0x1a64b1['where']=qs[_0xa073('0x32')](_[_0xa073('0x52')](_0x3c90c2[_0xa073('0x30')],_0x1479e8[_0xa073('0x32')]));if(_0x3c90c2[_0xa073('0x30')][_0xa073('0x3c')]){_0x1a64b1[_0xa073('0x3b')]=_[_0xa073('0x3d')](_0x1a64b1[_0xa073('0x3b')],{'$or':_[_0xa073('0x2a')](_0x1a64b1[_0xa073('0x35')],function(_0x351a7f){var _0x40874f={};_0x40874f[_0x351a7f]={'$like':'%'+_0x3c90c2[_0xa073('0x30')][_0xa073('0x3c')]+'%'};return _0x40874f;})});}_0x1a64b1=_[_0xa073('0x3d')]({},_0x1a64b1,_0x3c90c2['options']);return _0x862e12[_0xa073('0x50')](_0x1a64b1);}})[_0xa073('0x3f')](function(_0x38c990){if(_0x38c990){_0x943803=_0x38c990[_0xa073('0x36')];if(!_0x3c90c2[_0xa073('0x30')][_0xa073('0x37')](_0xa073('0x38'))){_0x1a64b1[_0xa073('0x1d')]=qs[_0xa073('0x1d')](_0x3c90c2['query']['limit']);_0x1a64b1[_0xa073('0x1c')]=qs[_0xa073('0x1c')](_0x3c90c2[_0xa073('0x30')]['offset']);}return _0x862e12[_0xa073('0x50')](_0x1a64b1);}})['then'](function(_0x51cde8){if(_0x51cde8){return _0x51cde8?{'count':_0x943803,'rows':_0x51cde8}:null;}})[_0xa073('0x3f')](respondWithResult(_0x592f81,null))[_0xa073('0x44')](handleError(_0x592f81,null));};exports[_0xa073('0x53')]=function(_0x23e369,_0x30d627,_0x1504e8){return db[_0xa073('0x54')][_0xa073('0x49')]({'where':{'id':_0x23e369['params']['id']}})['then'](handleEntityNotFound(_0x30d627,null))[_0xa073('0x3f')](function(_0x2ec0ef){if(_0x2ec0ef){return _0x2ec0ef['addActions'](_0x23e369[_0xa073('0x4b')][_0xa073('0x4e')],_[_0xa073('0x4f')](_0x23e369[_0xa073('0x4b')],[_0xa073('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x30d627,null))[_0xa073('0x44')](handleError(_0x30d627,null));};exports[_0xa073('0x55')]=function(_0x33763f,_0x41ee19,_0x1319f6){var _0x2f9ecc={};var _0x3310f2={};var _0x36a75a;var _0x2d19ce;return db[_0xa073('0x2b')][_0xa073('0x51')]({'where':{'id':_0x33763f[_0xa073('0x46')]['id']}})['then'](handleEntityNotFound(_0x41ee19,null))[_0xa073('0x3f')](function(_0x247779){if(_0x247779){_0x36a75a=_0x247779;_0x3310f2['model']=_[_0xa073('0x31')](db[_0xa073('0x54')][_0xa073('0x47')]);_0x3310f2[_0xa073('0x30')]=_[_0xa073('0x31')](_0x33763f[_0xa073('0x30')]);_0x3310f2[_0xa073('0x32')]=_[_0xa073('0x33')](_0x3310f2[_0xa073('0x2f')],_0x3310f2[_0xa073('0x30')]);_0x2f9ecc['attributes']=_['intersection'](_0x3310f2[_0xa073('0x2f')],qs['fields'](_0x33763f[_0xa073('0x30')][_0xa073('0x34')]));_0x2f9ecc['attributes']=_0x2f9ecc['attributes'][_0xa073('0x36')]?_0x2f9ecc[_0xa073('0x35')]:_0x3310f2[_0xa073('0x2f')];_0x2f9ecc[_0xa073('0x39')]=qs['sort'](_0x33763f['query'][_0xa073('0x3a')]);_0x2f9ecc[_0xa073('0x3b')]=qs['filters'](_[_0xa073('0x52')](_0x33763f[_0xa073('0x30')],_0x3310f2[_0xa073('0x32')]));if(_0x33763f[_0xa073('0x30')]['filter']){_0x2f9ecc[_0xa073('0x3b')]=_['merge'](_0x2f9ecc[_0xa073('0x3b')],{'$or':_[_0xa073('0x2a')](_0x2f9ecc[_0xa073('0x35')],function(_0x309887){var _0x56bd7a={};_0x56bd7a[_0x309887]={'$like':'%'+_0x33763f['query'][_0xa073('0x3c')]+'%'};return _0x56bd7a;})});}_0x2f9ecc=_[_0xa073('0x3d')]({},_0x2f9ecc,_0x33763f[_0xa073('0x48')]);return _0x36a75a[_0xa073('0x55')](_0x2f9ecc);}})[_0xa073('0x3f')](function(_0x3dcc86){if(_0x3dcc86){_0x2d19ce=_0x3dcc86['length'];if(!_0x33763f[_0xa073('0x30')][_0xa073('0x37')](_0xa073('0x38'))){_0x2f9ecc[_0xa073('0x1d')]=qs[_0xa073('0x1d')](_0x33763f[_0xa073('0x30')][_0xa073('0x1d')]);_0x2f9ecc[_0xa073('0x1c')]=qs[_0xa073('0x1c')](_0x33763f[_0xa073('0x30')][_0xa073('0x1c')]);}return _0x36a75a[_0xa073('0x55')](_0x2f9ecc);}})[_0xa073('0x3f')](function(_0x5c36c2){if(_0x5c36c2){return _0x5c36c2?{'count':_0x2d19ce,'rows':_0x5c36c2}:null;}})[_0xa073('0x3f')](respondWithResult(_0x41ee19,null))[_0xa073('0x44')](handleError(_0x41ee19,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0e4f31c..1792c04 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 _0x89c7=['request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x34daef,_0xc94fd2){var _0x50a193=function(_0x1c8956){while(--_0x1c8956){_0x34daef['push'](_0x34daef['shift']());}};_0x50a193(++_0xc94fd2);}(_0x89c7,0x19b));var _0x789c=function(_0x385eee,_0x270cca){_0x385eee=_0x385eee-0x0;var _0x41fd49=_0x89c7[_0x385eee];return _0x41fd49;};'use strict';var _=require(_0x789c('0x0'));var util=require(_0x789c('0x1'));var logger=require(_0x789c('0x2'))(_0x789c('0x3'));var moment=require('moment');var BPromise=require(_0x789c('0x4'));var rp=require(_0x789c('0x5'));var fs=require('fs');var path=require(_0x789c('0x6'));var rimraf=require(_0x789c('0x7'));var config=require('../../config/environment');var attributes=require(_0x789c('0x8'));module[_0x789c('0x9')]=function(_0xd73693,_0x1bfb09){return _0xd73693[_0x789c('0xa')](_0x789c('0xb'),attributes,{'tableName':_0x789c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf107=['../../config/environment','./automation.attributes','define','Automation','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x354bf4,_0x35aa3c){var _0x27ba47=function(_0x535717){while(--_0x535717){_0x354bf4['push'](_0x354bf4['shift']());}};_0x27ba47(++_0x35aa3c);}(_0xf107,0x1c0));var _0x7f10=function(_0x3844be,_0x1e4953){_0x3844be=_0x3844be-0x0;var _0x37d385=_0xf107[_0x3844be];return _0x37d385;};'use strict';var _=require('lodash');var util=require(_0x7f10('0x0'));var logger=require(_0x7f10('0x1'))(_0x7f10('0x2'));var moment=require(_0x7f10('0x3'));var BPromise=require(_0x7f10('0x4'));var rp=require(_0x7f10('0x5'));var fs=require('fs');var path=require(_0x7f10('0x6'));var rimraf=require(_0x7f10('0x7'));var config=require(_0x7f10('0x8'));var attributes=require(_0x7f10('0x9'));module['exports']=function(_0x7d1664,_0x2b0967){return _0x7d1664[_0x7f10('0xa')](_0x7f10('0xb'),attributes,{'tableName':'tools_automations','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 43aaec2..f56d1d2 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 _0xbee0=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0xbee0,0x147));var _0x0bee=function(_0x2a4a83,_0x5874a2){_0x2a4a83=_0x2a4a83-0x0;var _0x2934d3=_0xbee0[_0x2a4a83];return _0x2934d3;};'use strict';var _=require('lodash');var util=require(_0x0bee('0x0'));var moment=require(_0x0bee('0x1'));var BPromise=require(_0x0bee('0x2'));var rs=require(_0x0bee('0x3'));var fs=require('fs');var Redis=require(_0x0bee('0x4'));var db=require(_0x0bee('0x5'))['db'];var utils=require(_0x0bee('0x6'));var logger=require(_0x0bee('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bee('0x8')][_0x0bee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e499b,_0x430f89,_0x498d63){return new BPromise(function(_0x163a08,_0x123424){return client[_0x0bee('0xa')](_0x3e499b,_0x498d63)[_0x0bee('0xb')](function(_0x53a9af){logger[_0x0bee('0xc')](_0x0bee('0xd'),_0x430f89,_0x0bee('0xe'));logger[_0x0bee('0xf')](_0x0bee('0x10'),_0x430f89,_0x0bee('0xe'),JSON[_0x0bee('0x11')](_0x53a9af));if(_0x53a9af['error']){if(_0x53a9af[_0x0bee('0x12')]['code']===0x1f4){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);return _0x123424(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x430f89,_0x53a9af['error'][_0x0bee('0x13')]);return _0x163a08(_0x53a9af[_0x0bee('0x12')][_0x0bee('0x13')]);}else{logger[_0x0bee('0xc')]('Automation,\x20%s,\x20%s',_0x430f89,'request\x20sent');_0x163a08(_0x53a9af['result'][_0x0bee('0x13')]);}})[_0x0bee('0x14')](function(_0x50786a){logger[_0x0bee('0x12')](_0x0bee('0xd'),_0x430f89,_0x50786a);_0x123424(_0x50786a);});});} \ No newline at end of file +var _0xd5fc=['info','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x358847,_0x361f02){var _0x2a66bf=function(_0x1aa74b){while(--_0x1aa74b){_0x358847['push'](_0x358847['shift']());}};_0x2a66bf(++_0x361f02);}(_0xd5fc,0xae));var _0xcd5f=function(_0xb39746,_0x2b0469){_0xb39746=_0xb39746-0x0;var _0x307a90=_0xd5fc[_0xb39746];return _0x307a90;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x159b3f,_0x5af696,_0x58d65d){return new BPromise(function(_0x4e668e,_0x102ce9){return client['request'](_0x159b3f,_0x58d65d)[_0xcd5f('0x9')](function(_0x3e63d4){logger['info'](_0xcd5f('0xa'),_0x5af696,'request\x20sent');logger[_0xcd5f('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x5af696,_0xcd5f('0xc'),JSON[_0xcd5f('0xd')](_0x3e63d4));if(_0x3e63d4[_0xcd5f('0xe')]){if(_0x3e63d4[_0xcd5f('0xe')]['code']===0x1f4){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x102ce9(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x4e668e(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}else{logger[_0xcd5f('0x10')](_0xcd5f('0xa'),_0x5af696,_0xcd5f('0xc'));_0x4e668e(_0x3e63d4[_0xcd5f('0x11')]['message']);}})[_0xcd5f('0x12')](function(_0x33ab1a){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x33ab1a);_0x102ce9(_0x33ab1a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index fce36ae..967df46 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 _0x861c=['show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated'];(function(_0x3fb03e,_0x42bb53){var _0x55e681=function(_0x252f30){while(--_0x252f30){_0x3fb03e['push'](_0x3fb03e['shift']());}};_0x55e681(++_0x42bb53);}(_0x861c,0xdb));var _0xc861=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x861c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var path=require(_0xc861('0x2'));var timeout=require(_0xc861('0x3'));var express=require(_0xc861('0x4'));var router=express[_0xc861('0x5')]();var fs_extra=require(_0xc861('0x6'));var auth=require(_0xc861('0x7'));var interaction=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var controller=require(_0xc861('0xa'));router[_0xc861('0xb')]('/',auth['isAuthenticated'](),controller[_0xc861('0xc')]);router[_0xc861('0xb')](_0xc861('0xd'),auth[_0xc861('0xe')](),controller[_0xc861('0xf')]);router[_0xc861('0xb')](_0xc861('0x10'),auth[_0xc861('0xe')](),controller[_0xc861('0x11')]);router[_0xc861('0xb')](_0xc861('0x12'),auth[_0xc861('0xe')](),controller[_0xc861('0x13')]);router['post']('/',auth[_0xc861('0xe')](),controller[_0xc861('0x14')]);router[_0xc861('0x15')](_0xc861('0x10'),auth['isAuthenticated'](),controller[_0xc861('0x16')]);router[_0xc861('0x15')](_0xc861('0x12'),auth[_0xc861('0xe')](),controller['addActions']);router['put'](_0xc861('0xd'),auth[_0xc861('0xe')](),controller['update']);router[_0xc861('0x17')](_0xc861('0xd'),auth['isAuthenticated'](),controller[_0xc861('0x18')]);module[_0xc861('0x19')]=router; \ No newline at end of file +var _0xe77f=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','addActions','/:id','delete'];(function(_0x219b38,_0x48f334){var _0xb043f1=function(_0x4545bf){while(--_0x4545bf){_0x219b38['push'](_0x219b38['shift']());}};_0xb043f1(++_0x48f334);}(_0xe77f,0xba));var _0xfe77=function(_0x2d1934,_0x2d5638){_0x2d1934=_0x2d1934-0x0;var _0x4aec26=_0xe77f[_0x2d1934];return _0x4aec26;};'use strict';var multer=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var path=require('path');var timeout=require(_0xfe77('0x2'));var express=require(_0xfe77('0x3'));var router=express['Router']();var fs_extra=require(_0xfe77('0x4'));var auth=require(_0xfe77('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe77('0x6'));var controller=require(_0xfe77('0x7'));router[_0xfe77('0x8')]('/',auth[_0xfe77('0x9')](),controller[_0xfe77('0xa')]);router['get']('/:id',auth[_0xfe77('0x9')](),controller[_0xfe77('0xb')]);router[_0xfe77('0x8')](_0xfe77('0xc'),auth[_0xfe77('0x9')](),controller[_0xfe77('0xd')]);router['get']('/:id/actions',auth[_0xfe77('0x9')](),controller[_0xfe77('0xe')]);router[_0xfe77('0xf')]('/',auth[_0xfe77('0x9')](),controller['create']);router[_0xfe77('0xf')](_0xfe77('0xc'),auth[_0xfe77('0x9')](),controller[_0xfe77('0x10')]);router['post'](_0xfe77('0x11'),auth[_0xfe77('0x9')](),controller[_0xfe77('0x12')]);router['put'](_0xfe77('0x13'),auth[_0xfe77('0x9')](),controller['update']);router[_0xfe77('0x14')](_0xfe77('0x13'),auth[_0xfe77('0x9')](),controller[_0xfe77('0x15')]);module[_0xfe77('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index aeff1e1..664ba23 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 _0xd70e=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4b8b59,_0x31988f){var _0x4f7c8b=function(_0x1b9cfb){while(--_0x1b9cfb){_0x4b8b59['push'](_0x4b8b59['shift']());}};_0x4f7c8b(++_0x31988f);}(_0xd70e,0x157));var _0xed70=function(_0x27ffb5,_0x454d2a){_0x27ffb5=_0x27ffb5-0x0;var _0x5d3f31=_0xd70e[_0x27ffb5];return _0x5d3f31;};'use strict';var Sequelize=require(_0xed70('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xed70('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xed70('0x2')](_0xed70('0x3')),'allowNull':![],'defaultValue':_0xed70('0x3')},'description':{'type':Sequelize[_0xed70('0x4')]},'active':{'type':Sequelize[_0xed70('0x5')],'defaultValue':0x0,'comment':_0xed70('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xed70('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xed70('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xed70('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xed70('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xed70('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xed70('0xd')},'dialTimezone':{'type':Sequelize[_0xed70('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xed70('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xed70('0x2')](_0xed70('0xe'),'never',_0xed70('0xf')),'defaultValue':_0xed70('0xe')},'dialAMDActive':{'type':Sequelize[_0xed70('0x5')],'defaultValue':0x0,'comment':_0xed70('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed70('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xed70('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xed70('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed70('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xed70('0x9')](0x9)[_0xed70('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xed70('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xed70('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xed70('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xed70('0x16'),'ASC'),'defaultValue':_0xed70('0x16')},'dialPrefix':{'type':Sequelize[_0xed70('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed70('0x17')},'dialCutDigit':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed70('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xed70('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed70('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xed70('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xed70('0x9')](0x5)[_0xed70('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed70('0x21')}}; \ No newline at end of file +var _0xf6eb=['#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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x487833,_0xe5f6c7){var _0x1d9944=function(_0x486091){while(--_0x486091){_0x487833['push'](_0x487833['shift']());}};_0x1d9944(++_0xe5f6c7);}(_0xf6eb,0x1a7));var _0xbf6e=function(_0x4fa48d,_0x6bd28d){_0x4fa48d=_0x4fa48d-0x0;var _0x1606a4=_0xf6eb[_0x4fa48d];return _0x1606a4;};'use strict';var Sequelize=require(_0xbf6e('0x0'));module[_0xbf6e('0x1')]={'name':{'type':Sequelize[_0xbf6e('0x2')],'unique':_0xbf6e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xbf6e('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbf6e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xbf6e('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbf6e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf6e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbf6e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbf6e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xbf6e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbf6e('0x6')](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbf6e('0x2')],'defaultValue':_0xbf6e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xbf6e('0x10')](_0xbf6e('0x11'),_0xbf6e('0x12'),_0xbf6e('0x13')),'defaultValue':_0xbf6e('0x11')},'dialAMDActive':{'type':Sequelize[_0xbf6e('0x5')],'defaultValue':0x0,'comment':_0xbf6e('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf6e('0x6')](0x9)[_0xbf6e('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbf6e('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbf6e('0x6')](0x9)[_0xbf6e('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf6e('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf6e('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf6e('0x6')](0x9)[_0xbf6e('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf6e('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xbf6e('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbf6e('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf6e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xbf6e('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbf6e('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf6e('0x6')](0x9)[_0xbf6e('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf6e('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbf6e('0x10')](_0xbf6e('0x1c'),_0xbf6e('0x1d')),'defaultValue':_0xbf6e('0x1c')},'dialPrefix':{'type':Sequelize[_0xbf6e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xbf6e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbf6e('0x1e')},'dialCutDigit':{'type':Sequelize[_0xbf6e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xbf6e('0x6')](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xbf6e('0x6')](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf6e('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf6e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf6e('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf6e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbf6e('0x6')](0x5)['UNSIGNED'],'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 5bc14fb..493532b 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 _0xf1d0=['UserProfileSection','autoAssociation','clone','omit','updatedAt','body','createdAt','userProfileId','update','getHoppers','findOne','CmHopper','sort','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','fieldName','query','keys','filters','intersection','attributes','length','model','nolimit','order','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns'];(function(_0x15e0f2,_0x6cedd7){var _0x4fe6a8=function(_0x3b20ee){while(--_0x3b20ee){_0x15e0f2['push'](_0x15e0f2['shift']());}};_0x4fe6a8(++_0x6cedd7);}(_0xf1d0,0x14e));var _0x0f1d=function(_0x49a811,_0x190495){_0x49a811=_0x49a811-0x0;var _0xd8ff9d=_0xf1d0[_0x49a811];return _0xd8ff9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f1d('0x0'));var zipdir=require(_0x0f1d('0x1'));var jsonpatch=require(_0x0f1d('0x2'));var rp=require(_0x0f1d('0x3'));var moment=require(_0x0f1d('0x4'));var BPromise=require(_0x0f1d('0x5'));var Mustache=require('mustache');var util=require(_0x0f1d('0x6'));var path=require(_0x0f1d('0x7'));var sox=require(_0x0f1d('0x8'));var csv=require(_0x0f1d('0x9'));var ejs=require(_0x0f1d('0xa'));var fs=require('fs');var fs_extra=require(_0x0f1d('0xb'));var _=require(_0x0f1d('0xc'));var squel=require(_0x0f1d('0xd'));var crypto=require(_0x0f1d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f1d('0xf'));var toCsv=require(_0x0f1d('0x9'));var querystring=require(_0x0f1d('0x10'));var Papa=require(_0x0f1d('0x11'));var Redis=require(_0x0f1d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f1d('0x13'));var as=require(_0x0f1d('0x14'));var hardwareService=require(_0x0f1d('0x15'));var logger=require(_0x0f1d('0x16'))('api');var utils=require(_0x0f1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0f1d('0x18'));var db=require(_0x0f1d('0x19'))['db'];function respondWithStatusCode(_0xe97674,_0xae51ce){_0xae51ce=_0xae51ce||0xcc;return function(_0x588911){if(_0x588911){return _0xe97674['sendStatus'](_0xae51ce);}return _0xe97674[_0x0f1d('0x1a')](_0xae51ce)[_0x0f1d('0x1b')]();};}function respondWithResult(_0x110fe9,_0x4e8a30){_0x4e8a30=_0x4e8a30||0xc8;return function(_0x4c777a){if(_0x4c777a){return _0x110fe9[_0x0f1d('0x1a')](_0x4e8a30)[_0x0f1d('0x1c')](_0x4c777a);}};}function respondWithFilteredResult(_0x5c754e,_0x2d0c35){return function(_0x437515){if(_0x437515){var _0x15dd24=typeof _0x2d0c35[_0x0f1d('0x1d')]===_0x0f1d('0x1e')&&typeof _0x2d0c35[_0x0f1d('0x1f')]===_0x0f1d('0x1e');var _0x359efa=_0x437515[_0x0f1d('0x20')];var _0x2d2090=_0x15dd24?0x0:_0x2d0c35[_0x0f1d('0x1d')];var _0x1d7318=_0x15dd24?_0x437515[_0x0f1d('0x20')]:_0x2d0c35[_0x0f1d('0x1d')]+_0x2d0c35[_0x0f1d('0x1f')];var _0x5d6b9f;if(_0x1d7318>=_0x359efa){_0x1d7318=_0x359efa;_0x5d6b9f=0xc8;}else{_0x5d6b9f=0xce;}_0x5c754e[_0x0f1d('0x1a')](_0x5d6b9f);return _0x5c754e[_0x0f1d('0x21')](_0x0f1d('0x22'),_0x2d2090+'-'+_0x1d7318+'/'+_0x359efa)[_0x0f1d('0x1c')](_0x437515);}return null;};}function patchUpdates(_0x3aa54f){return function(_0x34def9){try{jsonpatch[_0x0f1d('0x23')](_0x34def9,_0x3aa54f,!![]);}catch(_0x4fd625){return BPromise[_0x0f1d('0x24')](_0x4fd625);}return _0x34def9[_0x0f1d('0x25')]();};}function saveUpdates(_0x431ebf,_0x332217){return function(_0xec17bc){if(_0xec17bc){return _0xec17bc['update'](_0x431ebf)[_0x0f1d('0x26')](function(_0x118d79){return _0x118d79;});}return null;};}function removeEntity(_0x366524,_0x410bc7){return function(_0x2b8f58){if(_0x2b8f58){return _0x2b8f58[_0x0f1d('0x27')]()[_0x0f1d('0x26')](function(){var _0x463b3d=_0x2b8f58['get']({'plain':!![]});var _0x2cfef6='IvrCampaigns';return db[_0x0f1d('0x28')][_0x0f1d('0x27')]({'where':{'type':_0x2cfef6,'resourceId':_0x463b3d['id']}})[_0x0f1d('0x26')](function(){return _0x2b8f58;});})['then'](function(){_0x366524[_0x0f1d('0x1a')](0xcc)[_0x0f1d('0x1b')]();});}};}function handleEntityNotFound(_0x5dd3ae,_0x3e4b55){return function(_0x4484c2){if(!_0x4484c2){_0x5dd3ae['sendStatus'](0x194);}return _0x4484c2;};}function handleError(_0x1eb399,_0xce6962){_0xce6962=_0xce6962||0x1f4;return function(_0x16a6cd){logger[_0x0f1d('0x29')](_0x16a6cd['stack']);if(_0x16a6cd[_0x0f1d('0x2a')]){delete _0x16a6cd[_0x0f1d('0x2a')];}_0x1eb399['status'](_0xce6962)[_0x0f1d('0x2b')](_0x16a6cd);};}exports[_0x0f1d('0x2c')]=function(_0x5b132c,_0x28d627){var _0x124e6b={},_0x249da2={},_0x1278a3={'count':0x0,'rows':[]};var _0x5653c0=_[_0x0f1d('0x2d')](db[_0x0f1d('0x2e')][_0x0f1d('0x2f')],function(_0x392251){return{'name':_0x392251[_0x0f1d('0x30')],'type':_0x392251['type']['key']};});_0x249da2['model']=_['map'](_0x5653c0,_0x0f1d('0x2a'));_0x249da2[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x5b132c[_0x0f1d('0x31')]);_0x249da2[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x249da2['model'],_0x249da2[_0x0f1d('0x31')]);_0x124e6b[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x249da2['model'],qs['fields'](_0x5b132c[_0x0f1d('0x31')]['fields']));_0x124e6b[_0x0f1d('0x35')]=_0x124e6b[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x124e6b[_0x0f1d('0x35')]:_0x249da2[_0x0f1d('0x37')];if(!_0x5b132c[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x124e6b[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x5b132c[_0x0f1d('0x31')]['limit']);_0x124e6b['offset']=qs[_0x0f1d('0x1d')](_0x5b132c['query'][_0x0f1d('0x1d')]);}_0x124e6b[_0x0f1d('0x39')]=qs['sort'](_0x5b132c['query']['sort']);_0x124e6b['where']=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x5b132c['query'],_0x249da2[_0x0f1d('0x33')]),_0x5653c0);if(_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x124e6b['where']=_[_0x0f1d('0x3c')](_0x124e6b['where'],{'$or':_[_0x0f1d('0x2d')](_0x5653c0,function(_0x5ecf4b){if(_0x5ecf4b[_0x0f1d('0x3d')]!==_0x0f1d('0x3e')){var _0x5ed744={};_0x5ed744[_0x5ecf4b[_0x0f1d('0x2a')]]={'$like':'%'+_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x5ed744;}})});}_0x124e6b=_['merge']({},_0x124e6b,_0x5b132c[_0x0f1d('0x3f')]);var _0x1452de={'where':_0x124e6b[_0x0f1d('0x40')]};return db[_0x0f1d('0x2e')][_0x0f1d('0x20')](_0x1452de)[_0x0f1d('0x26')](function(_0xcac3f7){_0x1278a3[_0x0f1d('0x20')]=_0xcac3f7;if(_0x5b132c[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x124e6b[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x2e')][_0x0f1d('0x43')](_0x124e6b);})[_0x0f1d('0x26')](function(_0x236ea6){_0x1278a3[_0x0f1d('0x44')]=_0x236ea6;return _0x1278a3;})[_0x0f1d('0x26')](respondWithFilteredResult(_0x28d627,_0x124e6b))[_0x0f1d('0x45')](handleError(_0x28d627,null));};exports[_0x0f1d('0x46')]=function(_0x55712d,_0x510cdc){var _0x1771c6={'raw':![],'where':{'id':_0x55712d[_0x0f1d('0x47')]['id']}},_0x35aab3={};_0x35aab3[_0x0f1d('0x37')]=_[_0x0f1d('0x32')](db['Campaign'][_0x0f1d('0x2f')]);_0x35aab3[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x55712d[_0x0f1d('0x31')]);_0x35aab3['filters']=_['intersection'](_0x35aab3['model'],_0x35aab3[_0x0f1d('0x31')]);_0x1771c6[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x35aab3[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x55712d['query'][_0x0f1d('0x48')]));_0x1771c6[_0x0f1d('0x35')]=_0x1771c6[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x1771c6[_0x0f1d('0x35')]:_0x35aab3[_0x0f1d('0x37')];if(_0x55712d[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x1771c6['include']=[{'all':!![]}];}_0x1771c6=_[_0x0f1d('0x3c')]({},_0x1771c6,_0x55712d[_0x0f1d('0x3f')]);return db[_0x0f1d('0x2e')][_0x0f1d('0x49')](_0x1771c6)['then'](handleEntityNotFound(_0x510cdc,null))[_0x0f1d('0x26')](respondWithResult(_0x510cdc,null))[_0x0f1d('0x45')](handleError(_0x510cdc,null));};exports[_0x0f1d('0x4a')]=function(_0x136f15,_0x217eaf){return db[_0x0f1d('0x2e')][_0x0f1d('0x4a')](_0x136f15['body'],{})[_0x0f1d('0x26')](function(_0x2fa8a2){var _0x2d89ed=_0x136f15[_0x0f1d('0x4b')][_0x0f1d('0x4c')]({'plain':!![]});if(!_0x2d89ed)throw new Error(_0x0f1d('0x4d'));if(_0x2d89ed[_0x0f1d('0x4e')]==='user'){var _0x236ab1=_0x2fa8a2[_0x0f1d('0x4c')]({'plain':!![]});var _0x8307d3=_0x0f1d('0x4f');return db[_0x0f1d('0x50')]['find']({'where':{'name':_0x8307d3,'userProfileId':_0x2d89ed['userProfileId']},'raw':!![]})[_0x0f1d('0x26')](function(_0x5e2405){if(_0x5e2405&&_0x5e2405[_0x0f1d('0x51')]===0x0){return db[_0x0f1d('0x28')][_0x0f1d('0x4a')]({'name':_0x236ab1['name'],'resourceId':_0x236ab1['id'],'type':_0x5e2405[_0x0f1d('0x2a')],'sectionId':_0x5e2405['id']},{})[_0x0f1d('0x26')](function(){return _0x2fa8a2;});}else{return _0x2fa8a2;}})[_0x0f1d('0x45')](function(_0x211d61){logger[_0x0f1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211d61);throw _0x211d61;});}return _0x2fa8a2;})[_0x0f1d('0x26')](respondWithResult(_0x217eaf,0xc9))[_0x0f1d('0x45')](handleError(_0x217eaf,null));};exports[_0x0f1d('0x52')]=function(_0x2d7aa8,_0x332d4c){var _0x474942={'where':{'id':_0x2d7aa8[_0x0f1d('0x47')]['id']}},_0x3e9c6e={};_0x3e9c6e[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x2e')][_0x0f1d('0x2f')]);_0x474942[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x3e9c6e[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x474942[_0x0f1d('0x35')]=_0x474942[_0x0f1d('0x35')]['length']?_0x474942[_0x0f1d('0x35')]:_0x3e9c6e['model'];if(_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x474942[_0x0f1d('0x42')]=[{'all':!![]}];}_0x474942=_[_0x0f1d('0x3c')]({},_0x474942,_0x2d7aa8[_0x0f1d('0x3f')]);return db[_0x0f1d('0x2e')][_0x0f1d('0x49')](_0x474942)[_0x0f1d('0x26')](handleEntityNotFound(_0x332d4c,null))[_0x0f1d('0x26')](function(_0x11b44b){if(_0x11b44b){var _0x3696de=_0x11b44b['get']({'plain':!![]});_0x3696de=qs[_0x0f1d('0x53')](_0x3696de,['id','createdAt',_0x0f1d('0x54')]);_0x2d7aa8[_0x0f1d('0x55')]=_[_0x0f1d('0x53')](_0x2d7aa8[_0x0f1d('0x55')],['id',_0x0f1d('0x56'),_0x0f1d('0x54')]);return db[_0x0f1d('0x2e')]['create'](_[_0x0f1d('0x3c')](_0x3696de,_0x2d7aa8[_0x0f1d('0x55')]),{'include':_0x2d7aa8[_0x0f1d('0x31')][_0x0f1d('0x41')]?[{'all':!![]}]:undefined})[_0x0f1d('0x26')](function(_0x294798){var _0x3456d3=_0x2d7aa8['user'][_0x0f1d('0x4c')]({'plain':!![]});if(!_0x3456d3)throw new Error(_0x0f1d('0x4d'));if(_0x3456d3[_0x0f1d('0x4e')]===_0x0f1d('0x4b')){var _0xd20992=_0x294798[_0x0f1d('0x4c')]({'plain':!![]});var _0x518dd4=_0x0f1d('0x4f');return db[_0x0f1d('0x50')][_0x0f1d('0x49')]({'where':{'name':_0x518dd4,'userProfileId':_0x3456d3[_0x0f1d('0x57')]},'raw':!![]})[_0x0f1d('0x26')](function(_0xda5fa0){if(_0xda5fa0&&_0xda5fa0[_0x0f1d('0x51')]===0x0){return db[_0x0f1d('0x28')]['create']({'name':_0xd20992[_0x0f1d('0x2a')],'resourceId':_0xd20992['id'],'type':_0xda5fa0[_0x0f1d('0x2a')],'sectionId':_0xda5fa0['id']},{})[_0x0f1d('0x26')](function(){return _0x294798;});}else{return _0x294798;}})[_0x0f1d('0x45')](function(_0x2847ab){logger[_0x0f1d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2847ab);throw _0x2847ab;});}return _0x294798;});}})[_0x0f1d('0x26')](respondWithResult(_0x332d4c,0xc9))['catch'](handleError(_0x332d4c,null));};exports[_0x0f1d('0x58')]=function(_0x44c696,_0x3dc8c0){if(_0x44c696['body']['id']){delete _0x44c696[_0x0f1d('0x55')]['id'];}return db['Campaign']['find']({'where':{'id':_0x44c696['params']['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x3dc8c0,null))[_0x0f1d('0x26')](saveUpdates(_0x44c696[_0x0f1d('0x55')],null))['then'](respondWithResult(_0x3dc8c0,null))[_0x0f1d('0x45')](handleError(_0x3dc8c0,null));};exports[_0x0f1d('0x27')]=function(_0x40e270,_0x1228a9){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x40e270[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x1228a9,null))['then'](removeEntity(_0x1228a9,null))['catch'](handleError(_0x1228a9,null));};exports[_0x0f1d('0x59')]=function(_0x546f14,_0xffa600,_0x138a1d){var _0x44b358={'raw':!![],'where':{}};var _0x7560d1={};var _0xd8bcd1={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x546f14[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0xffa600,null))[_0x0f1d('0x26')](function(_0x1ebb37){if(_0x1ebb37){_0x7560d1[_0x0f1d('0x37')]=_[_0x0f1d('0x32')](db[_0x0f1d('0x5b')][_0x0f1d('0x2f')]);_0x7560d1[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x546f14[_0x0f1d('0x31')]);_0x7560d1[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x7560d1[_0x0f1d('0x37')],_0x7560d1[_0x0f1d('0x31')]);_0x44b358[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x7560d1[_0x0f1d('0x37')],qs['fields'](_0x546f14['query'][_0x0f1d('0x48')]));_0x44b358[_0x0f1d('0x35')]=_0x44b358[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x44b358['attributes']:_0x7560d1[_0x0f1d('0x37')];if(!_0x546f14['query']['hasOwnProperty'](_0x0f1d('0x38'))){_0x44b358[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x546f14['query'][_0x0f1d('0x1f')]);_0x44b358['offset']=qs[_0x0f1d('0x1d')](_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x44b358[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x44b358['where']=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x546f14[_0x0f1d('0x31')],_0x7560d1[_0x0f1d('0x33')]));_0x44b358[_0x0f1d('0x40')][_0x0f1d('0x5d')]=_0x1ebb37['id'];if(_0x546f14[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x44b358[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x44b358['where'],{'$or':_[_0x0f1d('0x2d')](_0x44b358[_0x0f1d('0x35')],function(_0xcaee3c){var _0x244ae3={};_0x244ae3[_0xcaee3c]={'$like':'%'+_0x546f14[_0x0f1d('0x31')]['filter']+'%'};return _0x244ae3;})});}_0x44b358=_[_0x0f1d('0x3c')]({},_0x44b358,_0x546f14['options']);return db[_0x0f1d('0x5b')]['count']({'where':_0x44b358['where']})[_0x0f1d('0x26')](function(_0x1bd4c1){_0xd8bcd1['count']=_0x1bd4c1;if(_0x546f14[_0x0f1d('0x31')]['includeAll']){_0x44b358[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x5b')][_0x0f1d('0x43')](_0x44b358);})[_0x0f1d('0x26')](function(_0x6ca121){_0xd8bcd1[_0x0f1d('0x44')]=_0x6ca121;return _0xd8bcd1;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0xffa600,_0x44b358))[_0x0f1d('0x45')](handleError(_0xffa600,null));};exports[_0x0f1d('0x5e')]=function(_0x4540b4,_0x4f506c,_0x33c165){var _0x589c90={'raw':!![],'where':{}};var _0xc5c44={};var _0x757647={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x4540b4[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x4f506c,null))['then'](function(_0x2430b7){if(_0x2430b7){_0xc5c44[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x5f')][_0x0f1d('0x2f')]);_0xc5c44[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x4540b4[_0x0f1d('0x31')]);_0xc5c44[_0x0f1d('0x33')]=_['intersection'](_0xc5c44[_0x0f1d('0x37')],_0xc5c44['query']);_0x589c90[_0x0f1d('0x35')]=_['intersection'](_0xc5c44[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x4540b4['query'][_0x0f1d('0x48')]));_0x589c90[_0x0f1d('0x35')]=_0x589c90[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x589c90[_0x0f1d('0x35')]:_0xc5c44[_0x0f1d('0x37')];if(!_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x60')](_0x0f1d('0x38'))){_0x589c90[_0x0f1d('0x1f')]=qs['limit'](_0x4540b4[_0x0f1d('0x31')]['limit']);_0x589c90[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x4540b4[_0x0f1d('0x31')]['offset']);}_0x589c90[_0x0f1d('0x39')]=qs['sort'](_0x4540b4['query'][_0x0f1d('0x5c')]);_0x589c90[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x4540b4[_0x0f1d('0x31')],_0xc5c44[_0x0f1d('0x33')]));_0x589c90[_0x0f1d('0x40')]['CampaignId']=_0x2430b7['id'];if(_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x589c90[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x589c90[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x589c90['attributes'],function(_0x3ce615){var _0x1c7a3c={};_0x1c7a3c[_0x3ce615]={'$like':'%'+_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x1c7a3c;})});}_0x589c90=_['merge']({},_0x589c90,_0x4540b4[_0x0f1d('0x3f')]);return db[_0x0f1d('0x5f')][_0x0f1d('0x20')]({'where':_0x589c90['where']})[_0x0f1d('0x26')](function(_0x9a251a){_0x757647['count']=_0x9a251a;if(_0x4540b4[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x589c90[_0x0f1d('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0f1d('0x43')](_0x589c90);})[_0x0f1d('0x26')](function(_0x17472e){_0x757647['rows']=_0x17472e;return _0x757647;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0x4f506c,_0x589c90))[_0x0f1d('0x45')](handleError(_0x4f506c,null));};exports[_0x0f1d('0x61')]=function(_0xb4f8a1,_0xe42d28,_0x5af229){var _0x3d0ea9={'raw':!![],'where':{}};var _0x5272f9={};var _0xefe68a={'count':0x0,'rows':[]};return db['Campaign'][_0x0f1d('0x5a')]({'where':{'id':_0xb4f8a1['params']['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0xe42d28,null))['then'](function(_0x1b8926){if(_0x1b8926){_0x5272f9['model']=_['keys'](db[_0x0f1d('0x62')]['rawAttributes']);_0x5272f9[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0xb4f8a1[_0x0f1d('0x31')]);_0x5272f9[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x5272f9[_0x0f1d('0x37')],_0x5272f9[_0x0f1d('0x31')]);_0x3d0ea9[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x5272f9[_0x0f1d('0x37')],qs['fields'](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x3d0ea9[_0x0f1d('0x35')]=_0x3d0ea9[_0x0f1d('0x35')]['length']?_0x3d0ea9[_0x0f1d('0x35')]:_0x5272f9[_0x0f1d('0x37')];if(!_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x60')](_0x0f1d('0x38'))){_0x3d0ea9['limit']=qs[_0x0f1d('0x1f')](_0xb4f8a1['query'][_0x0f1d('0x1f')]);_0x3d0ea9[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x3d0ea9[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x3d0ea9[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_['pick'](_0xb4f8a1[_0x0f1d('0x31')],_0x5272f9[_0x0f1d('0x33')]));_0x3d0ea9[_0x0f1d('0x40')][_0x0f1d('0x5d')]=_0x1b8926['id'];if(_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x3d0ea9['where']=_['merge'](_0x3d0ea9[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x3d0ea9[_0x0f1d('0x35')],function(_0x5dd310){var _0x145d4c={};_0x145d4c[_0x5dd310]={'$like':'%'+_0xb4f8a1[_0x0f1d('0x31')]['filter']+'%'};return _0x145d4c;})});}_0x3d0ea9=_[_0x0f1d('0x3c')]({},_0x3d0ea9,_0xb4f8a1['options']);return db[_0x0f1d('0x62')][_0x0f1d('0x20')]({'where':_0x3d0ea9[_0x0f1d('0x40')]})['then'](function(_0xf50775){_0xefe68a[_0x0f1d('0x20')]=_0xf50775;if(_0xb4f8a1[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x3d0ea9[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x62')][_0x0f1d('0x43')](_0x3d0ea9);})[_0x0f1d('0x26')](function(_0x2c863d){_0xefe68a[_0x0f1d('0x44')]=_0x2c863d;return _0xefe68a;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0xe42d28,_0x3d0ea9))[_0x0f1d('0x45')](handleError(_0xe42d28,null));};exports[_0x0f1d('0x63')]=function(_0x3ca8a8,_0x50049c,_0x4d4070){var _0x5a68a6={'raw':!![],'where':{}};var _0x6b3321={};var _0x1911f4={'count':0x0,'rows':[]};return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x3ca8a8['params']['id']}})['then'](handleEntityNotFound(_0x50049c,null))[_0x0f1d('0x26')](function(_0x50bb67){if(_0x50bb67){_0x6b3321['model']=_['keys'](db['CmHopperBlack'][_0x0f1d('0x2f')]);_0x6b3321[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x3ca8a8[_0x0f1d('0x31')]);_0x6b3321[_0x0f1d('0x33')]=_['intersection'](_0x6b3321[_0x0f1d('0x37')],_0x6b3321[_0x0f1d('0x31')]);_0x5a68a6[_0x0f1d('0x35')]=_['intersection'](_0x6b3321[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x3ca8a8[_0x0f1d('0x31')]['fields']));_0x5a68a6[_0x0f1d('0x35')]=_0x5a68a6['attributes'][_0x0f1d('0x36')]?_0x5a68a6[_0x0f1d('0x35')]:_0x6b3321[_0x0f1d('0x37')];if(!_0x3ca8a8[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x5a68a6[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x3ca8a8['query'][_0x0f1d('0x1f')]);_0x5a68a6[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}_0x5a68a6[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x5a68a6[_0x0f1d('0x40')]=qs['filters'](_['pick'](_0x3ca8a8['query'],_0x6b3321[_0x0f1d('0x33')]));_0x5a68a6[_0x0f1d('0x40')]['CampaignId']=_0x50bb67['id'];if(_0x3ca8a8[_0x0f1d('0x31')]['filter']){_0x5a68a6[_0x0f1d('0x40')]=_['merge'](_0x5a68a6[_0x0f1d('0x40')],{'$or':_['map'](_0x5a68a6[_0x0f1d('0x35')],function(_0x5def1a){var _0x21e5bf={};_0x21e5bf[_0x5def1a]={'$like':'%'+_0x3ca8a8['query']['filter']+'%'};return _0x21e5bf;})});}_0x5a68a6=_[_0x0f1d('0x3c')]({},_0x5a68a6,_0x3ca8a8['options']);return db[_0x0f1d('0x64')]['count']({'where':_0x5a68a6[_0x0f1d('0x40')]})[_0x0f1d('0x26')](function(_0x34acfe){_0x1911f4[_0x0f1d('0x20')]=_0x34acfe;if(_0x3ca8a8[_0x0f1d('0x31')][_0x0f1d('0x41')]){_0x5a68a6[_0x0f1d('0x42')]=[{'all':!![]}];}return db[_0x0f1d('0x64')]['findAll'](_0x5a68a6);})[_0x0f1d('0x26')](function(_0x279497){_0x1911f4[_0x0f1d('0x44')]=_0x279497;return _0x1911f4;});}})[_0x0f1d('0x26')](respondWithFilteredResult(_0x50049c,_0x5a68a6))[_0x0f1d('0x45')](handleError(_0x50049c,null));};exports['getLists']=function(_0x2bd770,_0x5d5433,_0x5ccb46){var _0x2c910b={};var _0x147c0f={};var _0x1db61f;var _0x201075;return db[_0x0f1d('0x2e')]['findOne']({'where':{'id':_0x2bd770[_0x0f1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d5433,null))[_0x0f1d('0x26')](function(_0x1aeaa0){if(_0x1aeaa0){_0x1db61f=_0x1aeaa0;_0x147c0f['model']=_[_0x0f1d('0x32')](db['CmList'][_0x0f1d('0x2f')]);_0x147c0f[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x2bd770[_0x0f1d('0x31')]);_0x147c0f[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x147c0f[_0x0f1d('0x37')],_0x147c0f[_0x0f1d('0x31')]);_0x2c910b['attributes']=_['intersection'](_0x147c0f[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x48')]));_0x2c910b[_0x0f1d('0x35')]=_0x2c910b[_0x0f1d('0x35')]['length']?_0x2c910b['attributes']:_0x147c0f['model'];_0x2c910b[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x5c')]);_0x2c910b[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x2bd770[_0x0f1d('0x31')],_0x147c0f[_0x0f1d('0x33')]));if(_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x3b')]){_0x2c910b['where']=_[_0x0f1d('0x3c')](_0x2c910b[_0x0f1d('0x40')],{'$or':_[_0x0f1d('0x2d')](_0x2c910b[_0x0f1d('0x35')],function(_0x4eec68){var _0x496288={};_0x496288[_0x4eec68]={'$like':'%'+_0x2bd770[_0x0f1d('0x31')][_0x0f1d('0x3b')]+'%'};return _0x496288;})});}_0x2c910b=_['merge']({},_0x2c910b,_0x2bd770[_0x0f1d('0x3f')]);return _0x1db61f[_0x0f1d('0x65')](_0x2c910b);}})[_0x0f1d('0x26')](function(_0x27fb3d){if(_0x27fb3d){_0x201075=_0x27fb3d[_0x0f1d('0x36')];if(!_0x2bd770[_0x0f1d('0x31')]['hasOwnProperty'](_0x0f1d('0x38'))){_0x2c910b['limit']=qs[_0x0f1d('0x1f')](_0x2bd770['query'][_0x0f1d('0x1f')]);_0x2c910b['offset']=qs[_0x0f1d('0x1d')](_0x2bd770[_0x0f1d('0x31')]['offset']);}return _0x1db61f[_0x0f1d('0x65')](_0x2c910b);}})[_0x0f1d('0x26')](function(_0x1bac02){if(_0x1bac02){return _0x1bac02?{'count':_0x201075,'rows':_0x1bac02}:null;}})[_0x0f1d('0x26')](respondWithResult(_0x5d5433,null))[_0x0f1d('0x45')](handleError(_0x5d5433,null));};exports[_0x0f1d('0x66')]=function(_0x34c8eb,_0x16008b,_0x21056f){var _0x5ece51,_0x235e64;return db[_0x0f1d('0x2e')]['find']({'where':{'id':_0x34c8eb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x16008b,null))[_0x0f1d('0x26')](function(_0x34704a){if(_0x34704a){_0x235e64=_0x34704a;return _0x34704a[_0x0f1d('0x66')](_0x34c8eb[_0x0f1d('0x55')]['ids'],_[_0x0f1d('0x53')](_0x34c8eb['body'],[_0x0f1d('0x67'),'id'])||{});}return null;})[_0x0f1d('0x68')](function(_0x2a3910){var _0x3d2ea2;_0x5ece51=_0x2a3910||[];var _0x2c8be0=[];if(_0x2a3910){for(var _0x36d0f9=0x0;_0x36d0f9<_0x2a3910['length'];_0x36d0f9+=0x1){var _0x392d98=_0x2a3910[_0x36d0f9][_0x0f1d('0x4c')]({'plain':!![]});_0x235e64[_0x0f1d('0x69')]=_0x34c8eb[_0x0f1d('0x55')][_0x0f1d('0x69')]?_0x34c8eb['body'][_0x0f1d('0x69')]:_0x235e64[_0x0f1d('0x69')];switch(_0x235e64[_0x0f1d('0x69')]){case _0x0f1d('0x6a'):_0x3d2ea2=squel[_0x0f1d('0x6b')]()[_0x0f1d('0x6c')](_0x0f1d('0x6d'))[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x70'),_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),_0x0f1d('0x54')],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),'phone')['field'](_0x0f1d('0x75'),_0x0f1d('0x70'))['field']('id',_0x0f1d('0x71'))['field'](_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb['params']['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))[_0x0f1d('0x74')]('NOW()',_0x0f1d('0x56'))[_0x0f1d('0x74')]('NOW()','updatedAt')[_0x0f1d('0x78')](_0x0f1d('0x79'))[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x392d98[_0x0f1d('0x76')]['toString']())[_0x0f1d('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x7d'))['from'](_0x0f1d('0x7e'))[_0x0f1d('0x40')](_0x0f1d('0x7f'),_0x34c8eb['params']['id'][_0x0f1d('0x77')]()))[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x80'))['from'](_0x0f1d('0x6d'))[_0x0f1d('0x40')]('CampaignId\x20=\x20?',_0x34c8eb['params']['id'][_0x0f1d('0x77')]())))[_0x0f1d('0x77')]();break;case'onlyIfOpen':_0x3d2ea2=squel[_0x0f1d('0x6b')]()['into']('cm_hopper')['fromQuery']([_0x0f1d('0x6f'),'scheduledAt',_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),'updatedAt'],squel[_0x0f1d('0x73')]()['field'](_0x0f1d('0x6f'),_0x0f1d('0x6f'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x70'))[_0x0f1d('0x74')]('id',_0x0f1d('0x71'))[_0x0f1d('0x74')](_0x392d98['CmListId']['toString'](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))['field'](_0x0f1d('0x75'),_0x0f1d('0x56'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x54'))[_0x0f1d('0x78')]('cm_contacts')[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')]())['where'](_0x0f1d('0x81'))[_0x0f1d('0x40')](_0x0f1d('0x7c'),squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x80'))[_0x0f1d('0x78')](_0x0f1d('0x6d'))[_0x0f1d('0x40')](_0x0f1d('0x7f'),_0x34c8eb[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')]())))[_0x0f1d('0x77')]();break;default:_0x3d2ea2=squel[_0x0f1d('0x6b')]()[_0x0f1d('0x6c')](_0x0f1d('0x6d'))[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x70'),_0x0f1d('0x71'),_0x0f1d('0x72'),_0x0f1d('0x5d'),_0x0f1d('0x56'),'updatedAt'],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),_0x0f1d('0x6f'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x70'))[_0x0f1d('0x74')]('id',_0x0f1d('0x71'))[_0x0f1d('0x74')](_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x34c8eb[_0x0f1d('0x47')]['id']['toString'](),_0x0f1d('0x5d'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x56'))['field'](_0x0f1d('0x75'),_0x0f1d('0x54'))[_0x0f1d('0x78')]('cm_contacts')[_0x0f1d('0x40')]('deletedAt\x20IS\x20NULL')[_0x0f1d('0x40')]('ListId\x20=\x20?',_0x392d98[_0x0f1d('0x76')][_0x0f1d('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0f1d('0x77')]();}_0x2c8be0[_0x0f1d('0x82')](db[_0x0f1d('0x83')][_0x0f1d('0x31')](_0x3d2ea2));}return BPromise[_0x0f1d('0x84')](_0x2c8be0);}})[_0x0f1d('0x26')](function(){return _0x5ece51;})[_0x0f1d('0x26')](respondWithResult(_0x16008b,null))['catch'](handleError(_0x16008b,null));};exports[_0x0f1d('0x85')]=function(_0x41d26a,_0x741c37,_0x26c998){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x41d26a[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x741c37,null))[_0x0f1d('0x26')](function(_0x42539a){if(_0x42539a){return _0x42539a['removeLists'](_0x41d26a[_0x0f1d('0x31')]['ids']);}})[_0x0f1d('0x26')](function(_0xfea660){if(_0xfea660){return db[_0x0f1d('0x5b')][_0x0f1d('0x27')]({'where':{'ListId':_0x41d26a['query'][_0x0f1d('0x67')],'CampaignId':_0x41d26a[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](function(){return _0xfea660;});}})[_0x0f1d('0x26')](respondWithStatusCode(_0x741c37,null))[_0x0f1d('0x45')](handleError(_0x741c37,null));};exports[_0x0f1d('0x86')]=function(_0x49766a,_0x27cff1,_0x13ef10){var _0x3feab8={};var _0x9f1d0a={};var _0x18d46f;var _0xf906e6;return db[_0x0f1d('0x2e')][_0x0f1d('0x5a')]({'where':{'id':_0x49766a[_0x0f1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x27cff1,null))[_0x0f1d('0x26')](function(_0x5a8b0e){if(_0x5a8b0e){_0x18d46f=_0x5a8b0e;_0x9f1d0a[_0x0f1d('0x37')]=_['keys'](db[_0x0f1d('0x87')][_0x0f1d('0x2f')]);_0x9f1d0a[_0x0f1d('0x31')]=_[_0x0f1d('0x32')](_0x49766a['query']);_0x9f1d0a[_0x0f1d('0x33')]=_[_0x0f1d('0x34')](_0x9f1d0a['model'],_0x9f1d0a[_0x0f1d('0x31')]);_0x3feab8[_0x0f1d('0x35')]=_[_0x0f1d('0x34')](_0x9f1d0a[_0x0f1d('0x37')],qs[_0x0f1d('0x48')](_0x49766a['query'][_0x0f1d('0x48')]));_0x3feab8[_0x0f1d('0x35')]=_0x3feab8[_0x0f1d('0x35')][_0x0f1d('0x36')]?_0x3feab8[_0x0f1d('0x35')]:_0x9f1d0a[_0x0f1d('0x37')];_0x3feab8[_0x0f1d('0x39')]=qs[_0x0f1d('0x5c')](_0x49766a['query'][_0x0f1d('0x5c')]);_0x3feab8[_0x0f1d('0x40')]=qs[_0x0f1d('0x33')](_[_0x0f1d('0x3a')](_0x49766a[_0x0f1d('0x31')],_0x9f1d0a[_0x0f1d('0x33')]));if(_0x49766a['query'][_0x0f1d('0x3b')]){_0x3feab8[_0x0f1d('0x40')]=_[_0x0f1d('0x3c')](_0x3feab8['where'],{'$or':_[_0x0f1d('0x2d')](_0x3feab8['attributes'],function(_0x569cf7){var _0x2008e0={};_0x2008e0[_0x569cf7]={'$like':'%'+_0x49766a[_0x0f1d('0x31')]['filter']+'%'};return _0x2008e0;})});}_0x3feab8=_[_0x0f1d('0x3c')]({},_0x3feab8,_0x49766a[_0x0f1d('0x3f')]);return _0x18d46f['getBlackLists'](_0x3feab8);}})[_0x0f1d('0x26')](function(_0x4ae2a1){if(_0x4ae2a1){_0xf906e6=_0x4ae2a1[_0x0f1d('0x36')];if(!_0x49766a[_0x0f1d('0x31')]['hasOwnProperty']('nolimit')){_0x3feab8[_0x0f1d('0x1f')]=qs[_0x0f1d('0x1f')](_0x49766a[_0x0f1d('0x31')][_0x0f1d('0x1f')]);_0x3feab8[_0x0f1d('0x1d')]=qs[_0x0f1d('0x1d')](_0x49766a[_0x0f1d('0x31')][_0x0f1d('0x1d')]);}return _0x18d46f['getBlackLists'](_0x3feab8);}})[_0x0f1d('0x26')](function(_0x1fe2d1){if(_0x1fe2d1){return _0x1fe2d1?{'count':_0xf906e6,'rows':_0x1fe2d1}:null;}})[_0x0f1d('0x26')](respondWithResult(_0x27cff1,null))[_0x0f1d('0x45')](handleError(_0x27cff1,null));};exports[_0x0f1d('0x88')]=function(_0x37a03c,_0x3916a3,_0x2be678){var _0x35e251,_0x2e9ab3;return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x37a03c[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x3916a3,null))[_0x0f1d('0x26')](function(_0x50493d){if(_0x50493d){_0x2e9ab3=_0x50493d;return _0x50493d[_0x0f1d('0x88')](_0x37a03c[_0x0f1d('0x55')]['ids'],_[_0x0f1d('0x53')](_0x37a03c[_0x0f1d('0x55')],[_0x0f1d('0x67'),'id'])||{});}return null;})['spread'](function(_0x4eab12){var _0x80f96e;_0x35e251=_0x4eab12||[];var _0x2a8ff7=[];if(_0x4eab12){for(var _0x44d86b=0x0;_0x44d86b<_0x4eab12[_0x0f1d('0x36')];_0x44d86b+=0x1){var _0x3b15ac=_0x4eab12[_0x44d86b][_0x0f1d('0x4c')]({'plain':!![]});_0x80f96e=squel[_0x0f1d('0x6b')]()['into']('cm_hopper_black')[_0x0f1d('0x6e')]([_0x0f1d('0x6f'),_0x0f1d('0x71'),'ListId',_0x0f1d('0x5d'),_0x0f1d('0x56'),_0x0f1d('0x54')],squel[_0x0f1d('0x73')]()[_0x0f1d('0x74')](_0x0f1d('0x6f'),_0x0f1d('0x6f'))['field']('id','ContactId')['field'](_0x3b15ac['CmListId'][_0x0f1d('0x77')](),_0x0f1d('0x72'))[_0x0f1d('0x74')](_0x37a03c[_0x0f1d('0x47')]['id'][_0x0f1d('0x77')](),_0x0f1d('0x5d'))[_0x0f1d('0x74')](_0x0f1d('0x75'),_0x0f1d('0x56'))['field']('NOW()',_0x0f1d('0x54'))['from'](_0x0f1d('0x79'))[_0x0f1d('0x40')](_0x0f1d('0x7a'))[_0x0f1d('0x40')](_0x0f1d('0x7b'),_0x3b15ac[_0x0f1d('0x76')]['toString']())[_0x0f1d('0x40')](_0x0f1d('0x81')))['toString']();_0x2a8ff7[_0x0f1d('0x82')](db['sequelize'][_0x0f1d('0x31')](_0x80f96e));}return BPromise[_0x0f1d('0x84')](_0x2a8ff7);}})[_0x0f1d('0x26')](function(){return _0x35e251;})['then'](respondWithResult(_0x3916a3,null))[_0x0f1d('0x45')](handleError(_0x3916a3,null));};exports[_0x0f1d('0x89')]=function(_0x336fdb,_0x1ab2ce,_0x4f8c41){return db[_0x0f1d('0x2e')][_0x0f1d('0x49')]({'where':{'id':_0x336fdb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](handleEntityNotFound(_0x1ab2ce,null))[_0x0f1d('0x26')](function(_0x557c07){if(_0x557c07){return _0x557c07[_0x0f1d('0x89')](_0x336fdb[_0x0f1d('0x31')][_0x0f1d('0x67')]);}})[_0x0f1d('0x26')](function(_0x367852){if(_0x367852){return db['CmHopperBlack'][_0x0f1d('0x27')]({'where':{'ListId':_0x336fdb[_0x0f1d('0x31')][_0x0f1d('0x67')],'CampaignId':_0x336fdb[_0x0f1d('0x47')]['id']}})[_0x0f1d('0x26')](function(){return _0x367852;});}})[_0x0f1d('0x26')](respondWithStatusCode(_0x1ab2ce,null))[_0x0f1d('0x45')](handleError(_0x1ab2ce,null));}; \ No newline at end of file +var _0xc6c6=['nolimit','pick','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ListId','cm_contacts','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','UserProfileSection','userProfileId','getHoppers','findOne','CmHopper','sort','filter','getHopperHistories'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc6c6,0x1c0));var _0x6c6c=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xc6c6[_0x2431d6];return _0x4d0f9b;};'use strict';var emlformat=require(_0x6c6c('0x0'));var rimraf=require(_0x6c6c('0x1'));var zipdir=require(_0x6c6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c6c('0x4'));var util=require(_0x6c6c('0x5'));var path=require(_0x6c6c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c6c('0x7'));var fs=require('fs');var fs_extra=require(_0x6c6c('0x8'));var _=require('lodash');var squel=require(_0x6c6c('0x9'));var crypto=require(_0x6c6c('0xa'));var jsforce=require(_0x6c6c('0xb'));var deskjs=require(_0x6c6c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c6c('0xd'));var Redis=require(_0x6c6c('0xe'));var authService=require(_0x6c6c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6c6c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c6c('0x11'))(_0x6c6c('0x12'));var utils=require(_0x6c6c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6c6c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11eb84,_0x1e3c11){_0x1e3c11=_0x1e3c11||0xcc;return function(_0x2dc872){if(_0x2dc872){return _0x11eb84[_0x6c6c('0x15')](_0x1e3c11);}return _0x11eb84[_0x6c6c('0x16')](_0x1e3c11)[_0x6c6c('0x17')]();};}function respondWithResult(_0x8ce548,_0x10ed9b){_0x10ed9b=_0x10ed9b||0xc8;return function(_0x4700f3){if(_0x4700f3){return _0x8ce548[_0x6c6c('0x16')](_0x10ed9b)[_0x6c6c('0x18')](_0x4700f3);}};}function respondWithFilteredResult(_0x38ac16,_0x1ad0c8){return function(_0x1e9767){if(_0x1e9767){var _0x4c666d=typeof _0x1ad0c8['offset']===_0x6c6c('0x19')&&typeof _0x1ad0c8[_0x6c6c('0x1a')]===_0x6c6c('0x19');var _0x51eadb=_0x1e9767[_0x6c6c('0x1b')];var _0xc6d25d=_0x4c666d?0x0:_0x1ad0c8[_0x6c6c('0x1c')];var _0x5b06d4=_0x4c666d?_0x1e9767[_0x6c6c('0x1b')]:_0x1ad0c8[_0x6c6c('0x1c')]+_0x1ad0c8['limit'];var _0x3cbca5;if(_0x5b06d4>=_0x51eadb){_0x5b06d4=_0x51eadb;_0x3cbca5=0xc8;}else{_0x3cbca5=0xce;}_0x38ac16[_0x6c6c('0x16')](_0x3cbca5);return _0x38ac16[_0x6c6c('0x1d')]('Content-Range',_0xc6d25d+'-'+_0x5b06d4+'/'+_0x51eadb)['json'](_0x1e9767);}return null;};}function patchUpdates(_0x213de8){return function(_0x1bed9f){try{jsonpatch[_0x6c6c('0x1e')](_0x1bed9f,_0x213de8,!![]);}catch(_0x3b5a12){return BPromise['reject'](_0x3b5a12);}return _0x1bed9f[_0x6c6c('0x1f')]();};}function saveUpdates(_0x2c8f40,_0x15901c){return function(_0x193479){if(_0x193479){return _0x193479[_0x6c6c('0x20')](_0x2c8f40)[_0x6c6c('0x21')](function(_0x1b4b7a){return _0x1b4b7a;});}return null;};}function removeEntity(_0x2cf4b0,_0x2f9f60){return function(_0x7322aa){if(_0x7322aa){return _0x7322aa[_0x6c6c('0x22')]()[_0x6c6c('0x21')](function(){var _0x3f317f=_0x7322aa[_0x6c6c('0x23')]({'plain':!![]});var _0x2071db=_0x6c6c('0x24');return db[_0x6c6c('0x25')][_0x6c6c('0x22')]({'where':{'type':_0x2071db,'resourceId':_0x3f317f['id']}})[_0x6c6c('0x21')](function(){return _0x7322aa;});})['then'](function(){_0x2cf4b0['status'](0xcc)[_0x6c6c('0x17')]();});}};}function handleEntityNotFound(_0x2f31eb,_0x473edd){return function(_0xcc9d9b){if(!_0xcc9d9b){_0x2f31eb[_0x6c6c('0x15')](0x194);}return _0xcc9d9b;};}function handleError(_0x1f8114,_0x43c8dc){_0x43c8dc=_0x43c8dc||0x1f4;return function(_0x5452fb){logger[_0x6c6c('0x26')](_0x5452fb[_0x6c6c('0x27')]);if(_0x5452fb[_0x6c6c('0x28')]){delete _0x5452fb[_0x6c6c('0x28')];}_0x1f8114[_0x6c6c('0x16')](_0x43c8dc)[_0x6c6c('0x29')](_0x5452fb);};}exports[_0x6c6c('0x2a')]=function(_0x12c483,_0x19ad7e){var _0x4f0d73={},_0x4dc4b7={},_0x13468a={'count':0x0,'rows':[]};var _0x20ad02=_[_0x6c6c('0x2b')](db[_0x6c6c('0x2c')][_0x6c6c('0x2d')],function(_0x92deff){return{'name':_0x92deff[_0x6c6c('0x2e')],'type':_0x92deff['type'][_0x6c6c('0x2f')]};});_0x4dc4b7[_0x6c6c('0x30')]=_[_0x6c6c('0x2b')](_0x20ad02,_0x6c6c('0x28'));_0x4dc4b7[_0x6c6c('0x31')]=_[_0x6c6c('0x32')](_0x12c483[_0x6c6c('0x31')]);_0x4dc4b7['filters']=_[_0x6c6c('0x33')](_0x4dc4b7[_0x6c6c('0x30')],_0x4dc4b7[_0x6c6c('0x31')]);_0x4f0d73[_0x6c6c('0x34')]=_[_0x6c6c('0x33')](_0x4dc4b7[_0x6c6c('0x30')],qs[_0x6c6c('0x35')](_0x12c483[_0x6c6c('0x31')][_0x6c6c('0x35')]));_0x4f0d73[_0x6c6c('0x34')]=_0x4f0d73[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0x4f0d73[_0x6c6c('0x34')]:_0x4dc4b7[_0x6c6c('0x30')];if(!_0x12c483['query'][_0x6c6c('0x37')]('nolimit')){_0x4f0d73['limit']=qs['limit'](_0x12c483[_0x6c6c('0x31')][_0x6c6c('0x1a')]);_0x4f0d73[_0x6c6c('0x1c')]=qs[_0x6c6c('0x1c')](_0x12c483[_0x6c6c('0x31')][_0x6c6c('0x1c')]);}_0x4f0d73[_0x6c6c('0x38')]=qs['sort'](_0x12c483[_0x6c6c('0x31')]['sort']);_0x4f0d73[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_['pick'](_0x12c483[_0x6c6c('0x31')],_0x4dc4b7['filters']),_0x20ad02);if(_0x12c483[_0x6c6c('0x31')]['filter']){_0x4f0d73['where']=_[_0x6c6c('0x3b')](_0x4f0d73[_0x6c6c('0x39')],{'$or':_[_0x6c6c('0x2b')](_0x20ad02,function(_0x4ac87d){if(_0x4ac87d['type']!==_0x6c6c('0x3c')){var _0x16756a={};_0x16756a[_0x4ac87d['name']]={'$like':'%'+_0x12c483[_0x6c6c('0x31')]['filter']+'%'};return _0x16756a;}})});}_0x4f0d73=_[_0x6c6c('0x3b')]({},_0x4f0d73,_0x12c483[_0x6c6c('0x3d')]);var _0x1ecae0={'where':_0x4f0d73[_0x6c6c('0x39')]};return db[_0x6c6c('0x2c')][_0x6c6c('0x1b')](_0x1ecae0)[_0x6c6c('0x21')](function(_0x41762e){_0x13468a[_0x6c6c('0x1b')]=_0x41762e;if(_0x12c483[_0x6c6c('0x31')][_0x6c6c('0x3e')]){_0x4f0d73[_0x6c6c('0x3f')]=[{'all':!![]}];}return db[_0x6c6c('0x2c')][_0x6c6c('0x40')](_0x4f0d73);})[_0x6c6c('0x21')](function(_0x38e108){_0x13468a[_0x6c6c('0x41')]=_0x38e108;return _0x13468a;})['then'](respondWithFilteredResult(_0x19ad7e,_0x4f0d73))[_0x6c6c('0x42')](handleError(_0x19ad7e,null));};exports[_0x6c6c('0x43')]=function(_0x43562a,_0x1b86a5){var _0x8c7073={'raw':![],'where':{'id':_0x43562a[_0x6c6c('0x44')]['id']}},_0x32bc53={};_0x32bc53[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db[_0x6c6c('0x2c')]['rawAttributes']);_0x32bc53[_0x6c6c('0x31')]=_[_0x6c6c('0x32')](_0x43562a[_0x6c6c('0x31')]);_0x32bc53['filters']=_['intersection'](_0x32bc53[_0x6c6c('0x30')],_0x32bc53[_0x6c6c('0x31')]);_0x8c7073[_0x6c6c('0x34')]=_[_0x6c6c('0x33')](_0x32bc53[_0x6c6c('0x30')],qs[_0x6c6c('0x35')](_0x43562a[_0x6c6c('0x31')][_0x6c6c('0x35')]));_0x8c7073[_0x6c6c('0x34')]=_0x8c7073[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0x8c7073[_0x6c6c('0x34')]:_0x32bc53[_0x6c6c('0x30')];if(_0x43562a[_0x6c6c('0x31')][_0x6c6c('0x3e')]){_0x8c7073[_0x6c6c('0x3f')]=[{'all':!![]}];}_0x8c7073=_['merge']({},_0x8c7073,_0x43562a[_0x6c6c('0x3d')]);return db['Campaign'][_0x6c6c('0x45')](_0x8c7073)[_0x6c6c('0x21')](handleEntityNotFound(_0x1b86a5,null))[_0x6c6c('0x21')](respondWithResult(_0x1b86a5,null))['catch'](handleError(_0x1b86a5,null));};exports['create']=function(_0x2623c3,_0xe95c5a){return db['Campaign'][_0x6c6c('0x46')](_0x2623c3['body'],{})['then'](function(_0x497613){var _0x47a8d2=_0x2623c3[_0x6c6c('0x47')][_0x6c6c('0x23')]({'plain':!![]});if(!_0x47a8d2)throw new Error(_0x6c6c('0x48'));if(_0x47a8d2[_0x6c6c('0x49')]===_0x6c6c('0x47')){var _0x187cc9=_0x497613['get']({'plain':!![]});var _0x5ae10b=_0x6c6c('0x24');return db['UserProfileSection'][_0x6c6c('0x45')]({'where':{'name':_0x5ae10b,'userProfileId':_0x47a8d2['userProfileId']},'raw':!![]})[_0x6c6c('0x21')](function(_0x5aea9b){if(_0x5aea9b&&_0x5aea9b[_0x6c6c('0x4a')]===0x0){return db[_0x6c6c('0x25')][_0x6c6c('0x46')]({'name':_0x187cc9['name'],'resourceId':_0x187cc9['id'],'type':_0x5aea9b[_0x6c6c('0x28')],'sectionId':_0x5aea9b['id']},{})[_0x6c6c('0x21')](function(){return _0x497613;});}else{return _0x497613;}})[_0x6c6c('0x42')](function(_0x22a012){logger[_0x6c6c('0x26')](_0x6c6c('0x4b'),_0x22a012);throw _0x22a012;});}return _0x497613;})[_0x6c6c('0x21')](respondWithResult(_0xe95c5a,0xc9))[_0x6c6c('0x42')](handleError(_0xe95c5a,null));};exports['clone']=function(_0x58e4cd,_0x48b4c6){var _0x3668fc={'where':{'id':_0x58e4cd[_0x6c6c('0x44')]['id']}},_0x51c38a={};_0x51c38a[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db[_0x6c6c('0x2c')][_0x6c6c('0x2d')]);_0x3668fc['attributes']=_[_0x6c6c('0x33')](_0x51c38a[_0x6c6c('0x30')],qs['fields'](_0x58e4cd[_0x6c6c('0x31')][_0x6c6c('0x35')]));_0x3668fc[_0x6c6c('0x34')]=_0x3668fc[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0x3668fc[_0x6c6c('0x34')]:_0x51c38a[_0x6c6c('0x30')];if(_0x58e4cd[_0x6c6c('0x31')][_0x6c6c('0x3e')]){_0x3668fc[_0x6c6c('0x3f')]=[{'all':!![]}];}_0x3668fc=_['merge']({},_0x3668fc,_0x58e4cd[_0x6c6c('0x3d')]);return db[_0x6c6c('0x2c')][_0x6c6c('0x45')](_0x3668fc)[_0x6c6c('0x21')](handleEntityNotFound(_0x48b4c6,null))['then'](function(_0x349306){if(_0x349306){var _0x3d5558=_0x349306[_0x6c6c('0x23')]({'plain':!![]});_0x3d5558=qs[_0x6c6c('0x4c')](_0x3d5558,['id',_0x6c6c('0x4d'),'updatedAt']);_0x58e4cd[_0x6c6c('0x4e')]=_['omit'](_0x58e4cd[_0x6c6c('0x4e')],['id',_0x6c6c('0x4d'),_0x6c6c('0x4f')]);return db[_0x6c6c('0x2c')]['create'](_[_0x6c6c('0x3b')](_0x3d5558,_0x58e4cd['body']),{'include':_0x58e4cd[_0x6c6c('0x31')][_0x6c6c('0x3e')]?[{'all':!![]}]:undefined})[_0x6c6c('0x21')](function(_0x4f4a86){var _0x3b0a5b=_0x58e4cd['user'][_0x6c6c('0x23')]({'plain':!![]});if(!_0x3b0a5b)throw new Error(_0x6c6c('0x48'));if(_0x3b0a5b[_0x6c6c('0x49')]==='user'){var _0x8110e=_0x4f4a86[_0x6c6c('0x23')]({'plain':!![]});var _0x84c9a5='IvrCampaigns';return db[_0x6c6c('0x50')][_0x6c6c('0x45')]({'where':{'name':_0x84c9a5,'userProfileId':_0x3b0a5b[_0x6c6c('0x51')]},'raw':!![]})[_0x6c6c('0x21')](function(_0x410a43){if(_0x410a43&&_0x410a43[_0x6c6c('0x4a')]===0x0){return db['UserProfileResource'][_0x6c6c('0x46')]({'name':_0x8110e[_0x6c6c('0x28')],'resourceId':_0x8110e['id'],'type':_0x410a43[_0x6c6c('0x28')],'sectionId':_0x410a43['id']},{})['then'](function(){return _0x4f4a86;});}else{return _0x4f4a86;}})['catch'](function(_0x50a05c){logger[_0x6c6c('0x26')](_0x6c6c('0x4b'),_0x50a05c);throw _0x50a05c;});}return _0x4f4a86;});}})[_0x6c6c('0x21')](respondWithResult(_0x48b4c6,0xc9))[_0x6c6c('0x42')](handleError(_0x48b4c6,null));};exports['update']=function(_0x4989c6,_0x4f8b6c){if(_0x4989c6['body']['id']){delete _0x4989c6['body']['id'];}return db[_0x6c6c('0x2c')]['find']({'where':{'id':_0x4989c6['params']['id']}})['then'](handleEntityNotFound(_0x4f8b6c,null))[_0x6c6c('0x21')](saveUpdates(_0x4989c6[_0x6c6c('0x4e')],null))[_0x6c6c('0x21')](respondWithResult(_0x4f8b6c,null))[_0x6c6c('0x42')](handleError(_0x4f8b6c,null));};exports[_0x6c6c('0x22')]=function(_0xbaa3e0,_0x5de488){return db[_0x6c6c('0x2c')][_0x6c6c('0x45')]({'where':{'id':_0xbaa3e0['params']['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x5de488,null))['then'](removeEntity(_0x5de488,null))[_0x6c6c('0x42')](handleError(_0x5de488,null));};exports[_0x6c6c('0x52')]=function(_0x204b91,_0x3f82a2,_0x31d41e){var _0xcdb604={'raw':!![],'where':{}};var _0x4c16eb={};var _0x286662={'count':0x0,'rows':[]};return db[_0x6c6c('0x2c')][_0x6c6c('0x53')]({'where':{'id':_0x204b91[_0x6c6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f82a2,null))['then'](function(_0x38e45f){if(_0x38e45f){_0x4c16eb[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db[_0x6c6c('0x54')][_0x6c6c('0x2d')]);_0x4c16eb[_0x6c6c('0x31')]=_[_0x6c6c('0x32')](_0x204b91[_0x6c6c('0x31')]);_0x4c16eb[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x4c16eb[_0x6c6c('0x30')],_0x4c16eb['query']);_0xcdb604[_0x6c6c('0x34')]=_['intersection'](_0x4c16eb['model'],qs[_0x6c6c('0x35')](_0x204b91['query'][_0x6c6c('0x35')]));_0xcdb604[_0x6c6c('0x34')]=_0xcdb604[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0xcdb604[_0x6c6c('0x34')]:_0x4c16eb[_0x6c6c('0x30')];if(!_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x37')]('nolimit')){_0xcdb604[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x1a')]);_0xcdb604[_0x6c6c('0x1c')]=qs[_0x6c6c('0x1c')](_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x1c')]);}_0xcdb604[_0x6c6c('0x38')]=qs[_0x6c6c('0x55')](_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x55')]);_0xcdb604[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_['pick'](_0x204b91[_0x6c6c('0x31')],_0x4c16eb[_0x6c6c('0x3a')]));_0xcdb604[_0x6c6c('0x39')]['CampaignId']=_0x38e45f['id'];if(_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x56')]){_0xcdb604[_0x6c6c('0x39')]=_['merge'](_0xcdb604[_0x6c6c('0x39')],{'$or':_['map'](_0xcdb604['attributes'],function(_0x3303ca){var _0x3c5dd9={};_0x3c5dd9[_0x3303ca]={'$like':'%'+_0x204b91[_0x6c6c('0x31')][_0x6c6c('0x56')]+'%'};return _0x3c5dd9;})});}_0xcdb604=_['merge']({},_0xcdb604,_0x204b91[_0x6c6c('0x3d')]);return db[_0x6c6c('0x54')]['count']({'where':_0xcdb604[_0x6c6c('0x39')]})[_0x6c6c('0x21')](function(_0x169903){_0x286662['count']=_0x169903;if(_0x204b91[_0x6c6c('0x31')]['includeAll']){_0xcdb604[_0x6c6c('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x6c6c('0x40')](_0xcdb604);})[_0x6c6c('0x21')](function(_0x3750d8){_0x286662[_0x6c6c('0x41')]=_0x3750d8;return _0x286662;});}})[_0x6c6c('0x21')](respondWithFilteredResult(_0x3f82a2,_0xcdb604))[_0x6c6c('0x42')](handleError(_0x3f82a2,null));};exports[_0x6c6c('0x57')]=function(_0xdcec2,_0x56ece0,_0x29eb29){var _0x1234d5={'raw':!![],'where':{}};var _0x2c67fa={};var _0x339ed6={'count':0x0,'rows':[]};return db[_0x6c6c('0x2c')][_0x6c6c('0x53')]({'where':{'id':_0xdcec2[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x56ece0,null))['then'](function(_0xae0287){if(_0xae0287){_0x2c67fa['model']=_[_0x6c6c('0x32')](db['CmHopperHistory'][_0x6c6c('0x2d')]);_0x2c67fa[_0x6c6c('0x31')]=_['keys'](_0xdcec2['query']);_0x2c67fa[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x2c67fa[_0x6c6c('0x30')],_0x2c67fa[_0x6c6c('0x31')]);_0x1234d5['attributes']=_[_0x6c6c('0x33')](_0x2c67fa['model'],qs[_0x6c6c('0x35')](_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x35')]));_0x1234d5[_0x6c6c('0x34')]=_0x1234d5[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0x1234d5[_0x6c6c('0x34')]:_0x2c67fa[_0x6c6c('0x30')];if(!_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x37')](_0x6c6c('0x58'))){_0x1234d5[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x1a')]);_0x1234d5['offset']=qs['offset'](_0xdcec2['query'][_0x6c6c('0x1c')]);}_0x1234d5[_0x6c6c('0x38')]=qs[_0x6c6c('0x55')](_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x55')]);_0x1234d5[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_[_0x6c6c('0x59')](_0xdcec2[_0x6c6c('0x31')],_0x2c67fa[_0x6c6c('0x3a')]));_0x1234d5[_0x6c6c('0x39')][_0x6c6c('0x5a')]=_0xae0287['id'];if(_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x56')]){_0x1234d5[_0x6c6c('0x39')]=_[_0x6c6c('0x3b')](_0x1234d5[_0x6c6c('0x39')],{'$or':_[_0x6c6c('0x2b')](_0x1234d5[_0x6c6c('0x34')],function(_0x1c4467){var _0xa342c3={};_0xa342c3[_0x1c4467]={'$like':'%'+_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x56')]+'%'};return _0xa342c3;})});}_0x1234d5=_[_0x6c6c('0x3b')]({},_0x1234d5,_0xdcec2[_0x6c6c('0x3d')]);return db[_0x6c6c('0x5b')]['count']({'where':_0x1234d5[_0x6c6c('0x39')]})[_0x6c6c('0x21')](function(_0xa79537){_0x339ed6[_0x6c6c('0x1b')]=_0xa79537;if(_0xdcec2[_0x6c6c('0x31')][_0x6c6c('0x3e')]){_0x1234d5[_0x6c6c('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6c6c('0x40')](_0x1234d5);})[_0x6c6c('0x21')](function(_0x2446ca){_0x339ed6['rows']=_0x2446ca;return _0x339ed6;});}})[_0x6c6c('0x21')](respondWithFilteredResult(_0x56ece0,_0x1234d5))[_0x6c6c('0x42')](handleError(_0x56ece0,null));};exports[_0x6c6c('0x5c')]=function(_0x191a50,_0x4d646d,_0x14c3e1){var _0x51e2d9={'raw':!![],'where':{}};var _0x2c5045={};var _0x9bd987={'count':0x0,'rows':[]};return db[_0x6c6c('0x2c')]['findOne']({'where':{'id':_0x191a50[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x4d646d,null))['then'](function(_0x37a749){if(_0x37a749){_0x2c5045[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db[_0x6c6c('0x5d')][_0x6c6c('0x2d')]);_0x2c5045['query']=_[_0x6c6c('0x32')](_0x191a50[_0x6c6c('0x31')]);_0x2c5045[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x2c5045[_0x6c6c('0x30')],_0x2c5045[_0x6c6c('0x31')]);_0x51e2d9['attributes']=_[_0x6c6c('0x33')](_0x2c5045['model'],qs[_0x6c6c('0x35')](_0x191a50['query'][_0x6c6c('0x35')]));_0x51e2d9[_0x6c6c('0x34')]=_0x51e2d9['attributes'][_0x6c6c('0x36')]?_0x51e2d9[_0x6c6c('0x34')]:_0x2c5045['model'];if(!_0x191a50[_0x6c6c('0x31')][_0x6c6c('0x37')](_0x6c6c('0x58'))){_0x51e2d9[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0x191a50[_0x6c6c('0x31')]['limit']);_0x51e2d9[_0x6c6c('0x1c')]=qs[_0x6c6c('0x1c')](_0x191a50[_0x6c6c('0x31')][_0x6c6c('0x1c')]);}_0x51e2d9[_0x6c6c('0x38')]=qs[_0x6c6c('0x55')](_0x191a50[_0x6c6c('0x31')]['sort']);_0x51e2d9[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_['pick'](_0x191a50[_0x6c6c('0x31')],_0x2c5045['filters']));_0x51e2d9[_0x6c6c('0x39')][_0x6c6c('0x5a')]=_0x37a749['id'];if(_0x191a50[_0x6c6c('0x31')][_0x6c6c('0x56')]){_0x51e2d9[_0x6c6c('0x39')]=_[_0x6c6c('0x3b')](_0x51e2d9[_0x6c6c('0x39')],{'$or':_[_0x6c6c('0x2b')](_0x51e2d9['attributes'],function(_0xebd2ad){var _0x3c4e18={};_0x3c4e18[_0xebd2ad]={'$like':'%'+_0x191a50['query'][_0x6c6c('0x56')]+'%'};return _0x3c4e18;})});}_0x51e2d9=_[_0x6c6c('0x3b')]({},_0x51e2d9,_0x191a50[_0x6c6c('0x3d')]);return db[_0x6c6c('0x5d')][_0x6c6c('0x1b')]({'where':_0x51e2d9[_0x6c6c('0x39')]})[_0x6c6c('0x21')](function(_0x302af6){_0x9bd987[_0x6c6c('0x1b')]=_0x302af6;if(_0x191a50[_0x6c6c('0x31')][_0x6c6c('0x3e')]){_0x51e2d9[_0x6c6c('0x3f')]=[{'all':!![]}];}return db[_0x6c6c('0x5d')]['findAll'](_0x51e2d9);})[_0x6c6c('0x21')](function(_0x3cf10c){_0x9bd987[_0x6c6c('0x41')]=_0x3cf10c;return _0x9bd987;});}})[_0x6c6c('0x21')](respondWithFilteredResult(_0x4d646d,_0x51e2d9))[_0x6c6c('0x42')](handleError(_0x4d646d,null));};exports[_0x6c6c('0x5e')]=function(_0x3584c5,_0x54a357,_0x5c7478){var _0x27c996={'raw':!![],'where':{}};var _0x28536b={};var _0x336d7a={'count':0x0,'rows':[]};return db[_0x6c6c('0x2c')]['findOne']({'where':{'id':_0x3584c5['params']['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x54a357,null))[_0x6c6c('0x21')](function(_0x1a6a60){if(_0x1a6a60){_0x28536b[_0x6c6c('0x30')]=_['keys'](db['CmHopperBlack'][_0x6c6c('0x2d')]);_0x28536b[_0x6c6c('0x31')]=_[_0x6c6c('0x32')](_0x3584c5['query']);_0x28536b[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x28536b[_0x6c6c('0x30')],_0x28536b['query']);_0x27c996[_0x6c6c('0x34')]=_[_0x6c6c('0x33')](_0x28536b[_0x6c6c('0x30')],qs[_0x6c6c('0x35')](_0x3584c5['query']['fields']));_0x27c996[_0x6c6c('0x34')]=_0x27c996[_0x6c6c('0x34')][_0x6c6c('0x36')]?_0x27c996[_0x6c6c('0x34')]:_0x28536b['model'];if(!_0x3584c5['query']['hasOwnProperty'](_0x6c6c('0x58'))){_0x27c996[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0x3584c5[_0x6c6c('0x31')][_0x6c6c('0x1a')]);_0x27c996['offset']=qs[_0x6c6c('0x1c')](_0x3584c5[_0x6c6c('0x31')]['offset']);}_0x27c996['order']=qs[_0x6c6c('0x55')](_0x3584c5[_0x6c6c('0x31')][_0x6c6c('0x55')]);_0x27c996['where']=qs[_0x6c6c('0x3a')](_[_0x6c6c('0x59')](_0x3584c5[_0x6c6c('0x31')],_0x28536b[_0x6c6c('0x3a')]));_0x27c996[_0x6c6c('0x39')][_0x6c6c('0x5a')]=_0x1a6a60['id'];if(_0x3584c5[_0x6c6c('0x31')]['filter']){_0x27c996[_0x6c6c('0x39')]=_[_0x6c6c('0x3b')](_0x27c996[_0x6c6c('0x39')],{'$or':_[_0x6c6c('0x2b')](_0x27c996['attributes'],function(_0x336a2c){var _0xb3c1d4={};_0xb3c1d4[_0x336a2c]={'$like':'%'+_0x3584c5[_0x6c6c('0x31')][_0x6c6c('0x56')]+'%'};return _0xb3c1d4;})});}_0x27c996=_[_0x6c6c('0x3b')]({},_0x27c996,_0x3584c5[_0x6c6c('0x3d')]);return db[_0x6c6c('0x5f')]['count']({'where':_0x27c996[_0x6c6c('0x39')]})[_0x6c6c('0x21')](function(_0x122de7){_0x336d7a[_0x6c6c('0x1b')]=_0x122de7;if(_0x3584c5['query']['includeAll']){_0x27c996[_0x6c6c('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6c6c('0x40')](_0x27c996);})[_0x6c6c('0x21')](function(_0x5669e9){_0x336d7a['rows']=_0x5669e9;return _0x336d7a;});}})['then'](respondWithFilteredResult(_0x54a357,_0x27c996))['catch'](handleError(_0x54a357,null));};exports['getLists']=function(_0x165bd4,_0x43c4c8,_0x48fb89){var _0xe57e1={};var _0x11cf35={};var _0x1e27c2;var _0x30bd02;return db[_0x6c6c('0x2c')][_0x6c6c('0x53')]({'where':{'id':_0x165bd4[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x43c4c8,null))['then'](function(_0x3e72f1){if(_0x3e72f1){_0x1e27c2=_0x3e72f1;_0x11cf35[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db['CmList'][_0x6c6c('0x2d')]);_0x11cf35[_0x6c6c('0x31')]=_['keys'](_0x165bd4[_0x6c6c('0x31')]);_0x11cf35[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x11cf35[_0x6c6c('0x30')],_0x11cf35['query']);_0xe57e1['attributes']=_[_0x6c6c('0x33')](_0x11cf35[_0x6c6c('0x30')],qs['fields'](_0x165bd4[_0x6c6c('0x31')]['fields']));_0xe57e1[_0x6c6c('0x34')]=_0xe57e1['attributes'][_0x6c6c('0x36')]?_0xe57e1[_0x6c6c('0x34')]:_0x11cf35[_0x6c6c('0x30')];_0xe57e1['order']=qs[_0x6c6c('0x55')](_0x165bd4['query'][_0x6c6c('0x55')]);_0xe57e1[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_['pick'](_0x165bd4[_0x6c6c('0x31')],_0x11cf35[_0x6c6c('0x3a')]));if(_0x165bd4[_0x6c6c('0x31')][_0x6c6c('0x56')]){_0xe57e1[_0x6c6c('0x39')]=_[_0x6c6c('0x3b')](_0xe57e1[_0x6c6c('0x39')],{'$or':_[_0x6c6c('0x2b')](_0xe57e1[_0x6c6c('0x34')],function(_0x2779ba){var _0xa4adec={};_0xa4adec[_0x2779ba]={'$like':'%'+_0x165bd4['query'][_0x6c6c('0x56')]+'%'};return _0xa4adec;})});}_0xe57e1=_[_0x6c6c('0x3b')]({},_0xe57e1,_0x165bd4[_0x6c6c('0x3d')]);return _0x1e27c2[_0x6c6c('0x60')](_0xe57e1);}})[_0x6c6c('0x21')](function(_0x11ff42){if(_0x11ff42){_0x30bd02=_0x11ff42[_0x6c6c('0x36')];if(!_0x165bd4[_0x6c6c('0x31')]['hasOwnProperty'](_0x6c6c('0x58'))){_0xe57e1[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0x165bd4[_0x6c6c('0x31')][_0x6c6c('0x1a')]);_0xe57e1['offset']=qs[_0x6c6c('0x1c')](_0x165bd4[_0x6c6c('0x31')][_0x6c6c('0x1c')]);}return _0x1e27c2[_0x6c6c('0x60')](_0xe57e1);}})[_0x6c6c('0x21')](function(_0x168f7b){if(_0x168f7b){return _0x168f7b?{'count':_0x30bd02,'rows':_0x168f7b}:null;}})[_0x6c6c('0x21')](respondWithResult(_0x43c4c8,null))[_0x6c6c('0x42')](handleError(_0x43c4c8,null));};exports[_0x6c6c('0x61')]=function(_0x7964a3,_0x272477,_0x2d71bd){var _0x24e1c1,_0x6ec62a;return db[_0x6c6c('0x2c')][_0x6c6c('0x45')]({'where':{'id':_0x7964a3[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x272477,null))[_0x6c6c('0x21')](function(_0x25baa1){if(_0x25baa1){_0x6ec62a=_0x25baa1;return _0x25baa1[_0x6c6c('0x61')](_0x7964a3['body']['ids'],_['omit'](_0x7964a3[_0x6c6c('0x4e')],[_0x6c6c('0x62'),'id'])||{});}return null;})[_0x6c6c('0x63')](function(_0x3d8eb6){var _0x5eb871;_0x24e1c1=_0x3d8eb6||[];var _0x47023f=[];if(_0x3d8eb6){for(var _0x277090=0x0;_0x277090<_0x3d8eb6[_0x6c6c('0x36')];_0x277090+=0x1){var _0x3070b9=_0x3d8eb6[_0x277090][_0x6c6c('0x23')]({'plain':!![]});_0x6ec62a[_0x6c6c('0x64')]=_0x7964a3['body'][_0x6c6c('0x64')]?_0x7964a3['body'][_0x6c6c('0x64')]:_0x6ec62a[_0x6c6c('0x64')];switch(_0x6ec62a['dialCheckDuplicateType']){case _0x6c6c('0x65'):_0x5eb871=squel[_0x6c6c('0x66')]()[_0x6c6c('0x67')](_0x6c6c('0x68'))[_0x6c6c('0x69')]([_0x6c6c('0x6a'),_0x6c6c('0x6b'),_0x6c6c('0x6c'),'ListId',_0x6c6c('0x5a'),'createdAt',_0x6c6c('0x4f')],squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x6a'),'phone')[_0x6c6c('0x6e')](_0x6c6c('0x6f'),_0x6c6c('0x6b'))[_0x6c6c('0x6e')]('id',_0x6c6c('0x6c'))[_0x6c6c('0x6e')](_0x3070b9[_0x6c6c('0x70')]['toString'](),'ListId')[_0x6c6c('0x6e')](_0x7964a3[_0x6c6c('0x44')]['id']['toString'](),_0x6c6c('0x5a'))[_0x6c6c('0x6e')]('NOW()',_0x6c6c('0x4d'))['field'](_0x6c6c('0x6f'),_0x6c6c('0x4f'))[_0x6c6c('0x71')]('cm_contacts')[_0x6c6c('0x39')](_0x6c6c('0x72'))[_0x6c6c('0x39')](_0x6c6c('0x73'),_0x3070b9[_0x6c6c('0x70')][_0x6c6c('0x74')]())[_0x6c6c('0x39')](_0x6c6c('0x75'))[_0x6c6c('0x39')](_0x6c6c('0x76'),squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x77'))['from'](_0x6c6c('0x78'))[_0x6c6c('0x39')](_0x6c6c('0x79'),_0x7964a3[_0x6c6c('0x44')]['id']['toString']()))[_0x6c6c('0x39')](_0x6c6c('0x76'),squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x7a'))[_0x6c6c('0x71')](_0x6c6c('0x68'))[_0x6c6c('0x39')]('CampaignId\x20=\x20?',_0x7964a3[_0x6c6c('0x44')]['id'][_0x6c6c('0x74')]())))[_0x6c6c('0x74')]();break;case'onlyIfOpen':_0x5eb871=squel[_0x6c6c('0x66')]()['into'](_0x6c6c('0x68'))[_0x6c6c('0x69')]([_0x6c6c('0x6a'),'scheduledAt','ContactId','ListId','CampaignId',_0x6c6c('0x4d'),_0x6c6c('0x4f')],squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x6a'),_0x6c6c('0x6a'))[_0x6c6c('0x6e')]('NOW()',_0x6c6c('0x6b'))['field']('id',_0x6c6c('0x6c'))[_0x6c6c('0x6e')](_0x3070b9[_0x6c6c('0x70')][_0x6c6c('0x74')](),_0x6c6c('0x7b'))['field'](_0x7964a3[_0x6c6c('0x44')]['id'][_0x6c6c('0x74')](),'CampaignId')[_0x6c6c('0x6e')]('NOW()','createdAt')[_0x6c6c('0x6e')](_0x6c6c('0x6f'),'updatedAt')[_0x6c6c('0x71')](_0x6c6c('0x7c'))[_0x6c6c('0x39')](_0x6c6c('0x72'))[_0x6c6c('0x39')]('ListId\x20=\x20?',_0x3070b9[_0x6c6c('0x70')][_0x6c6c('0x74')]())[_0x6c6c('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x6c6c('0x39')](_0x6c6c('0x76'),squel[_0x6c6c('0x6d')]()['field'](_0x6c6c('0x7a'))[_0x6c6c('0x71')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x7964a3['params']['id'][_0x6c6c('0x74')]())))[_0x6c6c('0x74')]();break;default:_0x5eb871=squel[_0x6c6c('0x66')]()[_0x6c6c('0x67')](_0x6c6c('0x68'))[_0x6c6c('0x69')]([_0x6c6c('0x6a'),_0x6c6c('0x6b'),_0x6c6c('0x6c'),_0x6c6c('0x7b'),_0x6c6c('0x5a'),_0x6c6c('0x4d'),_0x6c6c('0x4f')],squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x6a'),_0x6c6c('0x6a'))['field'](_0x6c6c('0x6f'),'scheduledAt')['field']('id',_0x6c6c('0x6c'))[_0x6c6c('0x6e')](_0x3070b9[_0x6c6c('0x70')]['toString'](),_0x6c6c('0x7b'))['field'](_0x7964a3['params']['id']['toString'](),'CampaignId')[_0x6c6c('0x6e')](_0x6c6c('0x6f'),_0x6c6c('0x4d'))[_0x6c6c('0x6e')]('NOW()',_0x6c6c('0x4f'))[_0x6c6c('0x71')](_0x6c6c('0x7c'))[_0x6c6c('0x39')](_0x6c6c('0x72'))[_0x6c6c('0x39')]('ListId\x20=\x20?',_0x3070b9[_0x6c6c('0x70')][_0x6c6c('0x74')]())[_0x6c6c('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x6c6c('0x74')]();}_0x47023f[_0x6c6c('0x7d')](db[_0x6c6c('0x7e')]['query'](_0x5eb871));}return BPromise['all'](_0x47023f);}})[_0x6c6c('0x21')](function(){return _0x24e1c1;})[_0x6c6c('0x21')](respondWithResult(_0x272477,null))[_0x6c6c('0x42')](handleError(_0x272477,null));};exports[_0x6c6c('0x7f')]=function(_0x1704ae,_0x372cdf,_0x3bf653){return db[_0x6c6c('0x2c')][_0x6c6c('0x45')]({'where':{'id':_0x1704ae[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x372cdf,null))['then'](function(_0x382d53){if(_0x382d53){return _0x382d53[_0x6c6c('0x7f')](_0x1704ae[_0x6c6c('0x31')][_0x6c6c('0x62')]);}})[_0x6c6c('0x21')](function(_0x23ee53){if(_0x23ee53){return db[_0x6c6c('0x54')][_0x6c6c('0x22')]({'where':{'ListId':_0x1704ae[_0x6c6c('0x31')]['ids'],'CampaignId':_0x1704ae[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](function(){return _0x23ee53;});}})[_0x6c6c('0x21')](respondWithStatusCode(_0x372cdf,null))[_0x6c6c('0x42')](handleError(_0x372cdf,null));};exports[_0x6c6c('0x80')]=function(_0x488151,_0x5619a0,_0x5c2cac){var _0x1928c1={};var _0x427077={};var _0x2cd680;var _0x481193;return db['Campaign'][_0x6c6c('0x53')]({'where':{'id':_0x488151[_0x6c6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5619a0,null))[_0x6c6c('0x21')](function(_0x594903){if(_0x594903){_0x2cd680=_0x594903;_0x427077[_0x6c6c('0x30')]=_[_0x6c6c('0x32')](db[_0x6c6c('0x81')][_0x6c6c('0x2d')]);_0x427077[_0x6c6c('0x31')]=_[_0x6c6c('0x32')](_0x488151[_0x6c6c('0x31')]);_0x427077[_0x6c6c('0x3a')]=_[_0x6c6c('0x33')](_0x427077[_0x6c6c('0x30')],_0x427077[_0x6c6c('0x31')]);_0x1928c1[_0x6c6c('0x34')]=_['intersection'](_0x427077[_0x6c6c('0x30')],qs[_0x6c6c('0x35')](_0x488151[_0x6c6c('0x31')][_0x6c6c('0x35')]));_0x1928c1['attributes']=_0x1928c1['attributes'][_0x6c6c('0x36')]?_0x1928c1['attributes']:_0x427077[_0x6c6c('0x30')];_0x1928c1[_0x6c6c('0x38')]=qs['sort'](_0x488151[_0x6c6c('0x31')][_0x6c6c('0x55')]);_0x1928c1[_0x6c6c('0x39')]=qs[_0x6c6c('0x3a')](_[_0x6c6c('0x59')](_0x488151[_0x6c6c('0x31')],_0x427077[_0x6c6c('0x3a')]));if(_0x488151[_0x6c6c('0x31')][_0x6c6c('0x56')]){_0x1928c1[_0x6c6c('0x39')]=_[_0x6c6c('0x3b')](_0x1928c1[_0x6c6c('0x39')],{'$or':_['map'](_0x1928c1[_0x6c6c('0x34')],function(_0x2598ce){var _0x3c752a={};_0x3c752a[_0x2598ce]={'$like':'%'+_0x488151['query'][_0x6c6c('0x56')]+'%'};return _0x3c752a;})});}_0x1928c1=_[_0x6c6c('0x3b')]({},_0x1928c1,_0x488151[_0x6c6c('0x3d')]);return _0x2cd680[_0x6c6c('0x80')](_0x1928c1);}})[_0x6c6c('0x21')](function(_0x3b6225){if(_0x3b6225){_0x481193=_0x3b6225[_0x6c6c('0x36')];if(!_0x488151[_0x6c6c('0x31')][_0x6c6c('0x37')](_0x6c6c('0x58'))){_0x1928c1[_0x6c6c('0x1a')]=qs[_0x6c6c('0x1a')](_0x488151[_0x6c6c('0x31')]['limit']);_0x1928c1[_0x6c6c('0x1c')]=qs[_0x6c6c('0x1c')](_0x488151[_0x6c6c('0x31')]['offset']);}return _0x2cd680[_0x6c6c('0x80')](_0x1928c1);}})['then'](function(_0x55ce2f){if(_0x55ce2f){return _0x55ce2f?{'count':_0x481193,'rows':_0x55ce2f}:null;}})['then'](respondWithResult(_0x5619a0,null))[_0x6c6c('0x42')](handleError(_0x5619a0,null));};exports['addBlackLists']=function(_0x3f8585,_0x33b486,_0x20a630){var _0x205e80,_0x5ec0f3;return db[_0x6c6c('0x2c')]['find']({'where':{'id':_0x3f8585[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x33b486,null))[_0x6c6c('0x21')](function(_0x23485a){if(_0x23485a){_0x5ec0f3=_0x23485a;return _0x23485a[_0x6c6c('0x82')](_0x3f8585[_0x6c6c('0x4e')]['ids'],_[_0x6c6c('0x4c')](_0x3f8585[_0x6c6c('0x4e')],[_0x6c6c('0x62'),'id'])||{});}return null;})[_0x6c6c('0x63')](function(_0x3db6a9){var _0x3edd3e;_0x205e80=_0x3db6a9||[];var _0x415fd7=[];if(_0x3db6a9){for(var _0x568a14=0x0;_0x568a14<_0x3db6a9[_0x6c6c('0x36')];_0x568a14+=0x1){var _0x9dd1d5=_0x3db6a9[_0x568a14][_0x6c6c('0x23')]({'plain':!![]});_0x3edd3e=squel[_0x6c6c('0x66')]()[_0x6c6c('0x67')](_0x6c6c('0x83'))[_0x6c6c('0x69')]([_0x6c6c('0x6a'),_0x6c6c('0x6c'),'ListId',_0x6c6c('0x5a'),_0x6c6c('0x4d'),_0x6c6c('0x4f')],squel[_0x6c6c('0x6d')]()[_0x6c6c('0x6e')](_0x6c6c('0x6a'),_0x6c6c('0x6a'))[_0x6c6c('0x6e')]('id',_0x6c6c('0x6c'))[_0x6c6c('0x6e')](_0x9dd1d5[_0x6c6c('0x70')]['toString'](),_0x6c6c('0x7b'))[_0x6c6c('0x6e')](_0x3f8585[_0x6c6c('0x44')]['id'][_0x6c6c('0x74')](),_0x6c6c('0x5a'))['field'](_0x6c6c('0x6f'),_0x6c6c('0x4d'))[_0x6c6c('0x6e')](_0x6c6c('0x6f'),_0x6c6c('0x4f'))[_0x6c6c('0x71')]('cm_contacts')[_0x6c6c('0x39')](_0x6c6c('0x72'))[_0x6c6c('0x39')]('ListId\x20=\x20?',_0x9dd1d5[_0x6c6c('0x70')][_0x6c6c('0x74')]())[_0x6c6c('0x39')](_0x6c6c('0x75')))[_0x6c6c('0x74')]();_0x415fd7[_0x6c6c('0x7d')](db[_0x6c6c('0x7e')]['query'](_0x3edd3e));}return BPromise[_0x6c6c('0x84')](_0x415fd7);}})[_0x6c6c('0x21')](function(){return _0x205e80;})[_0x6c6c('0x21')](respondWithResult(_0x33b486,null))['catch'](handleError(_0x33b486,null));};exports['removeBlackLists']=function(_0x2f54a1,_0x3994b5,_0x521c93){return db[_0x6c6c('0x2c')][_0x6c6c('0x45')]({'where':{'id':_0x2f54a1[_0x6c6c('0x44')]['id']}})[_0x6c6c('0x21')](handleEntityNotFound(_0x3994b5,null))[_0x6c6c('0x21')](function(_0x520c07){if(_0x520c07){return _0x520c07[_0x6c6c('0x85')](_0x2f54a1[_0x6c6c('0x31')][_0x6c6c('0x62')]);}})[_0x6c6c('0x21')](function(_0x5db8be){if(_0x5db8be){return db[_0x6c6c('0x5f')][_0x6c6c('0x22')]({'where':{'ListId':_0x2f54a1[_0x6c6c('0x31')]['ids'],'CampaignId':_0x2f54a1['params']['id']}})[_0x6c6c('0x21')](function(){return _0x5db8be;});}})['then'](respondWithStatusCode(_0x3994b5,null))['catch'](handleError(_0x3994b5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 9f180d5..5e839f2 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(_0x99682f,_0x471920){var _0x58bebd=function(_0x4bb66f){while(--_0x4bb66f){_0x99682f['push'](_0x99682f['shift']());}};_0x58bebd(++_0x471920);}(_0x7a54,0x106));var _0x47a5=function(_0x156659,_0x2b90b1){_0x156659=_0x156659-0x0;var _0x1ea875=_0x7a54[_0x156659];return _0x1ea875;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 0da1501..8c33b42 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 _0xb2ff=['result','catch','Campaign','findAll','options','include','map','model','attributes','GetCampaign','debug','lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var moment=require('moment');var BPromise=require(_0xfb2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2f('0x3'));var logger=require('../../config/logger')(_0xfb2f('0x4'));var config=require(_0xfb2f('0x5'));var jayson=require(_0xfb2f('0x6'));var client=jayson[_0xfb2f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0fd7,_0x28cb13,_0x4ff2df){return new BPromise(function(_0x34c04e,_0x4588d6){return client[_0xfb2f('0x8')](_0x4a0fd7,_0x4ff2df)[_0xfb2f('0x9')](function(_0x5abcdb){logger[_0xfb2f('0xa')]('Campaign,\x20%s,\x20%s',_0x28cb13,_0xfb2f('0xb'));logger['debug'](_0xfb2f('0xc'),_0x28cb13,_0xfb2f('0xb'),JSON[_0xfb2f('0xd')](_0x5abcdb));if(_0x5abcdb[_0xfb2f('0xe')]){if(_0x5abcdb[_0xfb2f('0xe')]['code']===0x1f4){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);return _0x4588d6(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x5abcdb['error'][_0xfb2f('0x10')]);return _0x34c04e(_0x5abcdb[_0xfb2f('0xe')][_0xfb2f('0x10')]);}else{logger[_0xfb2f('0xa')](_0xfb2f('0xf'),_0x28cb13,'request\x20sent');_0x34c04e(_0x5abcdb[_0xfb2f('0x11')][_0xfb2f('0x10')]);}})[_0xfb2f('0x12')](function(_0x240b79){logger[_0xfb2f('0xe')](_0xfb2f('0xf'),_0x28cb13,_0x240b79);_0x4588d6(_0x240b79);});});}exports['GetCampaign']=function(_0x1d28e7){var _0x239a88=this;return new Promise(function(_0x507caa,_0x28bb16){return db[_0xfb2f('0x13')][_0xfb2f('0x14')]({'raw':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1d28e7['options']?_0x1d28e7[_0xfb2f('0x15')]['where']||null:null,'attributes':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7['options']['attributes']||null:null,'limit':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')]['limit']||null:null,'include':_0x1d28e7[_0xfb2f('0x15')]?_0x1d28e7[_0xfb2f('0x15')][_0xfb2f('0x16')]?_[_0xfb2f('0x17')](_0x1d28e7[_0xfb2f('0x15')]['include'],function(_0x3ed758){return{'model':db[_0x3ed758[_0xfb2f('0x18')]],'as':_0x3ed758['as'],'attributes':_0x3ed758['attributes'],'include':_0x3ed758[_0xfb2f('0x16')]?_['map'](_0x3ed758[_0xfb2f('0x16')],function(_0x5d612b){return{'model':db[_0x5d612b[_0xfb2f('0x18')]],'as':_0x5d612b['as'],'attributes':_0x5d612b[_0xfb2f('0x19')],'include':_0x5d612b[_0xfb2f('0x16')]?_['map'](_0x5d612b[_0xfb2f('0x16')],function(_0xed4b47){return{'model':db[_0xed4b47[_0xfb2f('0x18')]],'as':_0xed4b47['as'],'attributes':_0xed4b47[_0xfb2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfb2f('0x9')](function(_0x1d1ad4){logger['info'](_0xfb2f('0x1a'),_0x1d28e7);logger[_0xfb2f('0x1b')](_0xfb2f('0x1a'),_0x1d28e7,JSON[_0xfb2f('0xd')](_0x1d1ad4));_0x507caa(_0x1d1ad4);})['catch'](function(_0x53a728){logger[_0xfb2f('0xe')](_0xfb2f('0x1a'),_0x53a728[_0xfb2f('0x10')],_0x1d28e7);_0x28bb16(_0x239a88['error'](0x1f4,_0x53a728[_0xfb2f('0x10')]));});});}; \ No newline at end of file +var _0xfc65=['request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','attributes','limit','map','model','include','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x54ad98,_0x55411f){var _0x12b86d=function(_0x380582){while(--_0x380582){_0x54ad98['push'](_0x54ad98['shift']());}};_0x12b86d(++_0x55411f);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x3bc95c,_0x2e94ed){_0x3bc95c=_0x3bc95c-0x0;var _0x4a8218=_0xfc65[_0x3bc95c];return _0x4a8218;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rs=require(_0x5fc6('0x4'));var fs=require('fs');var Redis=require(_0x5fc6('0x5'));var db=require(_0x5fc6('0x6'))['db'];var utils=require(_0x5fc6('0x7'));var logger=require(_0x5fc6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26d89e,_0x1360cb,_0x5c93f7){return new BPromise(function(_0x5a47c1,_0x467f6b){return client[_0x5fc6('0xc')](_0x26d89e,_0x5c93f7)[_0x5fc6('0xd')](function(_0x52f28c){logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1360cb,'request\x20sent');logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x1360cb,'request\x20sent',JSON['stringify'](_0x52f28c));if(_0x52f28c[_0x5fc6('0x12')]){if(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x13')]===0x1f4){logger['error'](_0x5fc6('0xf'),_0x1360cb,_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);return _0x467f6b(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);}logger[_0x5fc6('0x12')]('Campaign,\x20%s,\x20%s',_0x1360cb,_0x52f28c[_0x5fc6('0x12')]['message']);return _0x5a47c1(_0x52f28c[_0x5fc6('0x12')][_0x5fc6('0x14')]);}else{logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1360cb,'request\x20sent');_0x5a47c1(_0x52f28c[_0x5fc6('0x15')]['message']);}})[_0x5fc6('0x16')](function(_0x585f13){logger['error'](_0x5fc6('0xf'),_0x1360cb,_0x585f13);_0x467f6b(_0x585f13);});});}exports[_0x5fc6('0x17')]=function(_0x1f6a14){var _0x7e73fc=this;return new Promise(function(_0x19e3b1,_0x3e3d2b){return db['Campaign'][_0x5fc6('0x18')]({'raw':_0x1f6a14[_0x5fc6('0x19')]?_0x1f6a14['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f6a14[_0x5fc6('0x19')]?_0x1f6a14[_0x5fc6('0x19')]['where']||null:null,'attributes':_0x1f6a14[_0x5fc6('0x19')]?_0x1f6a14[_0x5fc6('0x19')][_0x5fc6('0x1a')]||null:null,'limit':_0x1f6a14[_0x5fc6('0x19')]?_0x1f6a14[_0x5fc6('0x19')][_0x5fc6('0x1b')]||null:null,'include':_0x1f6a14['options']?_0x1f6a14['options']['include']?_[_0x5fc6('0x1c')](_0x1f6a14['options']['include'],function(_0x331512){return{'model':db[_0x331512[_0x5fc6('0x1d')]],'as':_0x331512['as'],'attributes':_0x331512[_0x5fc6('0x1a')],'include':_0x331512['include']?_['map'](_0x331512[_0x5fc6('0x1e')],function(_0x43f9c9){return{'model':db[_0x43f9c9[_0x5fc6('0x1d')]],'as':_0x43f9c9['as'],'attributes':_0x43f9c9[_0x5fc6('0x1a')],'include':_0x43f9c9[_0x5fc6('0x1e')]?_[_0x5fc6('0x1c')](_0x43f9c9[_0x5fc6('0x1e')],function(_0x32e911){return{'model':db[_0x32e911[_0x5fc6('0x1d')]],'as':_0x32e911['as'],'attributes':_0x32e911['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fc6('0xd')](function(_0x57d023){logger[_0x5fc6('0xe')](_0x5fc6('0x17'),_0x1f6a14);logger[_0x5fc6('0x10')](_0x5fc6('0x17'),_0x1f6a14,JSON[_0x5fc6('0x1f')](_0x57d023));_0x19e3b1(_0x57d023);})[_0x5fc6('0x16')](function(_0x6dc1da){logger[_0x5fc6('0x12')](_0x5fc6('0x17'),_0x6dc1da[_0x5fc6('0x14')],_0x1f6a14);_0x3e3d2b(_0x7e73fc[_0x5fc6('0x12')](0x1f4,_0x6dc1da['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ed0e6a8..24f2bef 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 _0x6d0b=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getLists','/:id/blacklists','getBlackLists','create','post','clone','/:id/lists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers'];(function(_0x2db153,_0x3ed67d){var _0x169607=function(_0x54ffc9){while(--_0x54ffc9){_0x2db153['push'](_0x2db153['shift']());}};_0x169607(++_0x3ed67d);}(_0x6d0b,0x71));var _0xb6d0=function(_0x40664c,_0x1d90f8){_0x40664c=_0x40664c-0x0;var _0x6f1edd=_0x6d0b[_0x40664c];return _0x6f1edd;};'use strict';var multer=require(_0xb6d0('0x0'));var util=require('util');var path=require(_0xb6d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb6d0('0x2'));var router=express[_0xb6d0('0x3')]();var fs_extra=require(_0xb6d0('0x4'));var auth=require(_0xb6d0('0x5'));var interaction=require(_0xb6d0('0x6'));var config=require(_0xb6d0('0x7'));var controller=require(_0xb6d0('0x8'));router['get']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xa')]);router[_0xb6d0('0xb')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xd')]);router[_0xb6d0('0xb')](_0xb6d0('0xe'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xf')]);router[_0xb6d0('0xb')](_0xb6d0('0x10'),auth['isAuthenticated'](),controller[_0xb6d0('0x11')]);router['get'](_0xb6d0('0x12'),auth[_0xb6d0('0x9')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xb6d0('0x9')](),controller['getHopperBlacks']);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xb6d0('0x13')]);router[_0xb6d0('0xb')](_0xb6d0('0x14'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb6d0('0x16')]);router[_0xb6d0('0x17')]('/:id/clone',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x18')]);router[_0xb6d0('0x17')](_0xb6d0('0x19'),auth[_0xb6d0('0x9')](),controller['addLists']);router['post'](_0xb6d0('0x14'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1a')]);router['put'](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1b')]);router[_0xb6d0('0x1c')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x1d')]);router[_0xb6d0('0x1c')]('/:id/lists',auth['isAuthenticated'](),controller[_0xb6d0('0x1e')]);router[_0xb6d0('0x1c')]('/:id/blacklists',auth[_0xb6d0('0x9')](),controller['removeBlackLists']);module[_0xb6d0('0x1f')]=router; \ No newline at end of file +var _0xfc02=['delete','/:id','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','Router','fs-extra','./campaign.controller','get','index','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','put'];(function(_0x16d077,_0x8e8163){var _0x5312aa=function(_0x2d33ed){while(--_0x2d33ed){_0x16d077['push'](_0x16d077['shift']());}};_0x5312aa(++_0x8e8163);}(_0xfc02,0x1da));var _0x2fc0=function(_0x5dde68,_0x4b1b35){_0x5dde68=_0x5dde68-0x0;var _0x3ba8fc=_0xfc02[_0x5dde68];return _0x3ba8fc;};'use strict';var multer=require(_0x2fc0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2fc0('0x1'));var express=require('express');var router=express[_0x2fc0('0x2')]();var fs_extra=require(_0x2fc0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2fc0('0x4'));router[_0x2fc0('0x5')]('/',auth['isAuthenticated'](),controller[_0x2fc0('0x6')]);router[_0x2fc0('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2fc0('0x5')]('/:id/hoppers',auth[_0x2fc0('0x7')](),controller[_0x2fc0('0x8')]);router[_0x2fc0('0x5')](_0x2fc0('0x9'),auth['isAuthenticated'](),controller[_0x2fc0('0xa')]);router['get']('/:id/hopper_finals',auth[_0x2fc0('0x7')](),controller[_0x2fc0('0xb')]);router[_0x2fc0('0x5')]('/:id/hopper_black',auth[_0x2fc0('0x7')](),controller[_0x2fc0('0xc')]);router[_0x2fc0('0x5')](_0x2fc0('0xd'),auth[_0x2fc0('0x7')](),controller['getLists']);router['get'](_0x2fc0('0xe'),auth[_0x2fc0('0x7')](),controller[_0x2fc0('0xf')]);router[_0x2fc0('0x10')]('/',auth[_0x2fc0('0x7')](),controller[_0x2fc0('0x11')]);router['post']('/:id/clone',auth[_0x2fc0('0x7')](),controller[_0x2fc0('0x12')]);router[_0x2fc0('0x10')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x2fc0('0x10')](_0x2fc0('0xe'),auth[_0x2fc0('0x7')](),controller['addBlackLists']);router[_0x2fc0('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2fc0('0x14')](_0x2fc0('0x15'),auth['isAuthenticated'](),controller[_0x2fc0('0x16')]);router[_0x2fc0('0x14')](_0x2fc0('0xd'),auth[_0x2fc0('0x7')](),controller[_0x2fc0('0x17')]);router[_0x2fc0('0x14')](_0x2fc0('0xe'),auth[_0x2fc0('0x7')](),controller[_0x2fc0('0x18')]);module[_0x2fc0('0x19')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e696c44..71529da 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 _0x6c0f=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x1d0a88,_0x4f873a){var _0x4e0cd1=function(_0x21d221){while(--_0x21d221){_0x1d0a88['push'](_0x1d0a88['shift']());}};_0x4e0cd1(++_0x4f873a);}(_0x6c0f,0x13b));var _0xf6c0=function(_0x20fca6,_0xf01e94){_0x20fca6=_0x20fca6-0x0;var _0x4dc6c2=_0x6c0f[_0x20fca6];return _0x4dc6c2;};'use strict';var Sequelize=require(_0xf6c0('0x0'));module[_0xf6c0('0x1')]={'key':{'type':Sequelize[_0xf6c0('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf6c0('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf6c0('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf6c0('0x4')](_0xf6c0('0x5'));}}}; \ No newline at end of file +var _0xe91c=['sequelize','STRING','getDataValue','key'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe91c,0x178));var _0xce91=function(_0x4801bd,_0x165d04){_0x4801bd=_0x4801bd-0x0;var _0x2b2681=_0xe91c[_0x4801bd];return _0x2b2681;};'use strict';var Sequelize=require(_0xce91('0x0'));module['exports']={'key':{'type':Sequelize[_0xce91('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xce91('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xce91('0x2')](_0xce91('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 249adb7..e74a0e4 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 _0x0dd5=['rows','catch','show','params','rawAttributes','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','stack','name','send','index','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','findAll'];(function(_0x1bfde0,_0x341ac8){var _0x5d195e=function(_0x4cd72d){while(--_0x4cd72d){_0x1bfde0['push'](_0x1bfde0['shift']());}};_0x5d195e(++_0x341ac8);}(_0x0dd5,0x122));var _0x50dd=function(_0x5ae343,_0x576870){_0x5ae343=_0x5ae343-0x0;var _0xda6a54=_0x0dd5[_0x5ae343];return _0xda6a54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50dd('0x0'));var zipdir=require(_0x50dd('0x1'));var jsonpatch=require(_0x50dd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50dd('0x3'));var util=require(_0x50dd('0x4'));var path=require(_0x50dd('0x5'));var sox=require('sox');var csv=require(_0x50dd('0x6'));var ejs=require(_0x50dd('0x7'));var fs=require('fs');var fs_extra=require(_0x50dd('0x8'));var _=require(_0x50dd('0x9'));var squel=require(_0x50dd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x50dd('0xb'));var toCsv=require(_0x50dd('0x6'));var querystring=require(_0x50dd('0xc'));var Papa=require('papaparse');var Redis=require(_0x50dd('0xd'));var authService=require(_0x50dd('0xe'));var qs=require(_0x50dd('0xf'));var as=require(_0x50dd('0x10'));var hardwareService=require(_0x50dd('0x11'));var logger=require(_0x50dd('0x12'))(_0x50dd('0x13'));var utils=require(_0x50dd('0x14'));var config=require(_0x50dd('0x15'));var licenseUtil=require(_0x50dd('0x16'));var db=require(_0x50dd('0x17'))['db'];function respondWithStatusCode(_0x37d300,_0x5bee97){_0x5bee97=_0x5bee97||0xcc;return function(_0x596b03){if(_0x596b03){return _0x37d300[_0x50dd('0x18')](_0x5bee97);}return _0x37d300[_0x50dd('0x19')](_0x5bee97)[_0x50dd('0x1a')]();};}function respondWithResult(_0x3a642f,_0x290f00){_0x290f00=_0x290f00||0xc8;return function(_0x157185){if(_0x157185){return _0x3a642f[_0x50dd('0x19')](_0x290f00)[_0x50dd('0x1b')](_0x157185);}};}function respondWithFilteredResult(_0x14bbdc,_0x57a269){return function(_0x47a85d){if(_0x47a85d){var _0x412669=typeof _0x57a269[_0x50dd('0x1c')]===_0x50dd('0x1d')&&typeof _0x57a269[_0x50dd('0x1e')]==='undefined';var _0x178741=_0x47a85d[_0x50dd('0x1f')];var _0x13cf7d=_0x412669?0x0:_0x57a269['offset'];var _0x3f071e=_0x412669?_0x47a85d[_0x50dd('0x1f')]:_0x57a269[_0x50dd('0x1c')]+_0x57a269[_0x50dd('0x1e')];var _0x21b791;if(_0x3f071e>=_0x178741){_0x3f071e=_0x178741;_0x21b791=0xc8;}else{_0x21b791=0xce;}_0x14bbdc[_0x50dd('0x19')](_0x21b791);return _0x14bbdc[_0x50dd('0x20')](_0x50dd('0x21'),_0x13cf7d+'-'+_0x3f071e+'/'+_0x178741)['json'](_0x47a85d);}return null;};}function patchUpdates(_0x472da1){return function(_0x2daff3){try{jsonpatch['apply'](_0x2daff3,_0x472da1,!![]);}catch(_0x39b454){return BPromise[_0x50dd('0x22')](_0x39b454);}return _0x2daff3[_0x50dd('0x23')]();};}function saveUpdates(_0x20ce9a,_0x29f91e){return function(_0x885a4c){if(_0x885a4c){return _0x885a4c[_0x50dd('0x24')](_0x20ce9a)[_0x50dd('0x25')](function(_0x1f12ab){return _0x1f12ab;});}return null;};}function removeEntity(_0x556c79,_0x4060ab){return function(_0x11a91a){if(_0x11a91a){return _0x11a91a['destroy']()[_0x50dd('0x25')](function(){var _0x425b63=_0x11a91a['get']({'plain':!![]});var _0x255437=_0x50dd('0x26');return db['UserProfileResource'][_0x50dd('0x27')]({'where':{'type':_0x255437,'resourceId':_0x425b63['id']}})[_0x50dd('0x25')](function(){return _0x11a91a;});})[_0x50dd('0x25')](function(){_0x556c79[_0x50dd('0x19')](0xcc)[_0x50dd('0x1a')]();});}};}function handleEntityNotFound(_0x1c6132,_0x4a9c07){return function(_0x325419){if(!_0x325419){_0x1c6132['sendStatus'](0x194);}return _0x325419;};}function handleError(_0x5c6197,_0xeade77){_0xeade77=_0xeade77||0x1f4;return function(_0x209bd8){logger['error'](_0x209bd8[_0x50dd('0x28')]);if(_0x209bd8[_0x50dd('0x29')]){delete _0x209bd8[_0x50dd('0x29')];}_0x5c6197['status'](_0xeade77)[_0x50dd('0x2a')](_0x209bd8);};}exports[_0x50dd('0x2b')]=function(_0x389bae,_0x2feb99){var _0x1f88fb={},_0xc8d045={},_0x3c0df1={'count':0x0,'rows':[]};var _0x5a9674=_[_0x50dd('0x2c')](db[_0x50dd('0x2d')]['rawAttributes'],function(_0x387be1){return{'name':_0x387be1[_0x50dd('0x2e')],'type':_0x387be1[_0x50dd('0x2f')][_0x50dd('0x30')]};});_0xc8d045['model']=_[_0x50dd('0x2c')](_0x5a9674,'name');_0xc8d045[_0x50dd('0x31')]=_[_0x50dd('0x32')](_0x389bae[_0x50dd('0x31')]);_0xc8d045[_0x50dd('0x33')]=_[_0x50dd('0x34')](_0xc8d045[_0x50dd('0x35')],_0xc8d045[_0x50dd('0x31')]);_0x1f88fb['attributes']=_[_0x50dd('0x34')](_0xc8d045[_0x50dd('0x35')],qs['fields'](_0x389bae['query'][_0x50dd('0x36')]));_0x1f88fb['attributes']=_0x1f88fb[_0x50dd('0x37')][_0x50dd('0x38')]?_0x1f88fb[_0x50dd('0x37')]:_0xc8d045[_0x50dd('0x35')];if(!_0x389bae[_0x50dd('0x31')][_0x50dd('0x39')](_0x50dd('0x3a'))){_0x1f88fb[_0x50dd('0x1e')]=qs['limit'](_0x389bae[_0x50dd('0x31')][_0x50dd('0x1e')]);_0x1f88fb['offset']=qs['offset'](_0x389bae['query'][_0x50dd('0x1c')]);}_0x1f88fb['order']=qs['sort'](_0x389bae[_0x50dd('0x31')]['sort']);_0x1f88fb[_0x50dd('0x3b')]=qs[_0x50dd('0x33')](_[_0x50dd('0x3c')](_0x389bae[_0x50dd('0x31')],_0xc8d045[_0x50dd('0x33')]),_0x5a9674);if(_0x389bae['query'][_0x50dd('0x3d')]){_0x1f88fb[_0x50dd('0x3b')]=_[_0x50dd('0x3e')](_0x1f88fb['where'],{'$or':[{'key':{'$like':'%'+_0x389bae['query'][_0x50dd('0x3d')]+'%'}},{'value':{'$like':'%'+_0x389bae[_0x50dd('0x31')]['filter']+'%'}}]});}_0x1f88fb=_['merge']({},_0x1f88fb,_0x389bae[_0x50dd('0x3f')]);var _0x51b031={'where':_0x1f88fb[_0x50dd('0x3b')]};return db[_0x50dd('0x2d')][_0x50dd('0x1f')](_0x51b031)[_0x50dd('0x25')](function(_0x38d157){_0x3c0df1[_0x50dd('0x1f')]=_0x38d157;if(_0x389bae[_0x50dd('0x31')][_0x50dd('0x40')]){_0x1f88fb['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x50dd('0x41')](_0x1f88fb);})[_0x50dd('0x25')](function(_0x3b903a){_0x3c0df1[_0x50dd('0x42')]=_0x3b903a;return _0x3c0df1;})[_0x50dd('0x25')](respondWithFilteredResult(_0x2feb99,_0x1f88fb))[_0x50dd('0x43')](handleError(_0x2feb99,null));};exports[_0x50dd('0x44')]=function(_0x4f52f1,_0x5a934e){var _0x342074={'raw':!![],'where':{'id':_0x4f52f1[_0x50dd('0x45')]['id']}},_0x11686a={};_0x11686a[_0x50dd('0x35')]=_['keys'](db[_0x50dd('0x2d')][_0x50dd('0x46')]);_0x11686a['query']=_['keys'](_0x4f52f1[_0x50dd('0x31')]);_0x11686a[_0x50dd('0x33')]=_[_0x50dd('0x34')](_0x11686a[_0x50dd('0x35')],_0x11686a['query']);_0x342074[_0x50dd('0x37')]=_[_0x50dd('0x34')](_0x11686a['model'],qs['fields'](_0x4f52f1[_0x50dd('0x31')]['fields']));_0x342074[_0x50dd('0x37')]=_0x342074[_0x50dd('0x37')][_0x50dd('0x38')]?_0x342074[_0x50dd('0x37')]:_0x11686a[_0x50dd('0x35')];if(_0x4f52f1[_0x50dd('0x31')][_0x50dd('0x40')]){_0x342074['include']=[{'all':!![]}];}_0x342074=_['merge']({},_0x342074,_0x4f52f1[_0x50dd('0x3f')]);return db[_0x50dd('0x2d')][_0x50dd('0x47')](_0x342074)['then'](handleEntityNotFound(_0x5a934e,null))['then'](respondWithResult(_0x5a934e,null))[_0x50dd('0x43')](handleError(_0x5a934e,null));};exports[_0x50dd('0x24')]=function(_0x24a83a,_0x3bc08f){if(_0x24a83a[_0x50dd('0x48')]['id']){delete _0x24a83a[_0x50dd('0x48')]['id'];}return db['CannedAnswer'][_0x50dd('0x47')]({'where':{'id':_0x24a83a[_0x50dd('0x45')]['id']}})[_0x50dd('0x25')](handleEntityNotFound(_0x3bc08f,null))[_0x50dd('0x25')](saveUpdates(_0x24a83a[_0x50dd('0x48')],null))[_0x50dd('0x25')](respondWithResult(_0x3bc08f,null))[_0x50dd('0x43')](handleError(_0x3bc08f,null));};exports[_0x50dd('0x27')]=function(_0x2ba821,_0x26d241){return db[_0x50dd('0x2d')]['find']({'where':{'id':_0x2ba821[_0x50dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x26d241,null))[_0x50dd('0x25')](removeEntity(_0x26d241,null))[_0x50dd('0x43')](handleError(_0x26d241,null));};exports['create']=function(_0x4da6ff,_0x5bf068){var _0x2d88b9={'key':_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x30')]};if(_0x4da6ff['body'][_0x50dd('0x49')]){_0x2d88b9['MailAccountId']=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x49')];}else if(_0x4da6ff['body'][_0x50dd('0x4a')]){_0x2d88b9[_0x50dd('0x4a')]=_0x4da6ff[_0x50dd('0x48')]['SmsAccountId'];}else if(_0x4da6ff['body'][_0x50dd('0x4b')]){_0x2d88b9['OpenchannelAccountId']=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4b')];}else if(_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4c')]){_0x2d88b9[_0x50dd('0x4c')]=_0x4da6ff[_0x50dd('0x48')][_0x50dd('0x4c')];}return db[_0x50dd('0x2d')]['find']({'where':_0x2d88b9})[_0x50dd('0x25')](function(_0x494be3){if(_0x494be3){throw new db[(_0x50dd('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x4da6ff['body']);})[_0x50dd('0x25')](function(_0x9641f7){var _0x85e829=_0x4da6ff[_0x50dd('0x4e')][_0x50dd('0x4f')]({'plain':!![]});if(!_0x85e829)throw new Error(_0x50dd('0x50'));if(_0x85e829[_0x50dd('0x51')]===_0x50dd('0x4e')){var _0x48f38f=_0x9641f7[_0x50dd('0x4f')]({'plain':!![]});return db[_0x50dd('0x52')][_0x50dd('0x47')]({'where':{'name':_0x50dd('0x26'),'userProfileId':_0x85e829[_0x50dd('0x53')]},'raw':!![]})[_0x50dd('0x25')](function(_0x2c054e){if(_0x2c054e&&_0x2c054e[_0x50dd('0x54')]===0x0){return db[_0x50dd('0x55')][_0x50dd('0x56')]({'name':_0x48f38f[_0x50dd('0x29')],'resourceId':_0x48f38f['id'],'type':_0x2c054e['name'],'sectionId':_0x2c054e['id']},{})[_0x50dd('0x25')](function(){return _0x9641f7;});}else{return _0x9641f7;}})[_0x50dd('0x43')](function(_0x4bdb0b){logger[_0x50dd('0x57')](_0x50dd('0x58'),_0x4bdb0b);throw _0x4bdb0b;});}return _0x9641f7;})[_0x50dd('0x25')](respondWithResult(_0x5bf068,0xc9))[_0x50dd('0x43')](handleError(_0x5bf068,null));}; \ No newline at end of file +var _0x47a2=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','findAll','rows','catch','show','params','body','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','role','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra'];(function(_0x501b85,_0x3cf729){var _0x3a6718=function(_0x276806){while(--_0x276806){_0x501b85['push'](_0x501b85['shift']());}};_0x3a6718(++_0x3cf729);}(_0x47a2,0xa5));var _0x247a=function(_0x3a02c5,_0x5970b9){_0x3a02c5=_0x3a02c5-0x0;var _0x2bfee8=_0x47a2[_0x3a02c5];return _0x2bfee8;};'use strict';var emlformat=require(_0x247a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x247a('0x1'));var jsonpatch=require(_0x247a('0x2'));var rp=require(_0x247a('0x3'));var moment=require(_0x247a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x247a('0x5'));var util=require(_0x247a('0x6'));var path=require(_0x247a('0x7'));var sox=require(_0x247a('0x8'));var csv=require('to-csv');var ejs=require(_0x247a('0x9'));var fs=require('fs');var fs_extra=require(_0x247a('0xa'));var _=require(_0x247a('0xb'));var squel=require(_0x247a('0xc'));var crypto=require(_0x247a('0xd'));var jsforce=require(_0x247a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x247a('0xf'));var Papa=require(_0x247a('0x10'));var Redis=require(_0x247a('0x11'));var authService=require(_0x247a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x247a('0x13'));var logger=require('../../config/logger')(_0x247a('0x14'));var utils=require(_0x247a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x247a('0x16'));var db=require(_0x247a('0x17'))['db'];function respondWithStatusCode(_0x18e943,_0x3a59ff){_0x3a59ff=_0x3a59ff||0xcc;return function(_0x33d495){if(_0x33d495){return _0x18e943[_0x247a('0x18')](_0x3a59ff);}return _0x18e943[_0x247a('0x19')](_0x3a59ff)[_0x247a('0x1a')]();};}function respondWithResult(_0x4fe8db,_0x3ccf83){_0x3ccf83=_0x3ccf83||0xc8;return function(_0x26f260){if(_0x26f260){return _0x4fe8db[_0x247a('0x19')](_0x3ccf83)['json'](_0x26f260);}};}function respondWithFilteredResult(_0x25ab2c,_0x275728){return function(_0x127037){if(_0x127037){var _0x9fe10a=typeof _0x275728[_0x247a('0x1b')]===_0x247a('0x1c')&&typeof _0x275728['limit']===_0x247a('0x1c');var _0x261b9a=_0x127037[_0x247a('0x1d')];var _0x33d44d=_0x9fe10a?0x0:_0x275728[_0x247a('0x1b')];var _0x2912d2=_0x9fe10a?_0x127037[_0x247a('0x1d')]:_0x275728[_0x247a('0x1b')]+_0x275728[_0x247a('0x1e')];var _0x55a5aa;if(_0x2912d2>=_0x261b9a){_0x2912d2=_0x261b9a;_0x55a5aa=0xc8;}else{_0x55a5aa=0xce;}_0x25ab2c['status'](_0x55a5aa);return _0x25ab2c['set'](_0x247a('0x1f'),_0x33d44d+'-'+_0x2912d2+'/'+_0x261b9a)['json'](_0x127037);}return null;};}function patchUpdates(_0x19b7b0){return function(_0x53c748){try{jsonpatch[_0x247a('0x20')](_0x53c748,_0x19b7b0,!![]);}catch(_0x225213){return BPromise[_0x247a('0x21')](_0x225213);}return _0x53c748[_0x247a('0x22')]();};}function saveUpdates(_0x466b48,_0x5772fb){return function(_0x24dceb){if(_0x24dceb){return _0x24dceb[_0x247a('0x23')](_0x466b48)[_0x247a('0x24')](function(_0x4acda9){return _0x4acda9;});}return null;};}function removeEntity(_0x43fec0,_0x4a939d){return function(_0x5dd80c){if(_0x5dd80c){return _0x5dd80c[_0x247a('0x25')]()[_0x247a('0x24')](function(){var _0x11ee34=_0x5dd80c[_0x247a('0x26')]({'plain':!![]});var _0x19bca6='CannedAnswers';return db[_0x247a('0x27')]['destroy']({'where':{'type':_0x19bca6,'resourceId':_0x11ee34['id']}})[_0x247a('0x24')](function(){return _0x5dd80c;});})[_0x247a('0x24')](function(){_0x43fec0['status'](0xcc)[_0x247a('0x1a')]();});}};}function handleEntityNotFound(_0x555358,_0x101301){return function(_0x2f42a5){if(!_0x2f42a5){_0x555358[_0x247a('0x18')](0x194);}return _0x2f42a5;};}function handleError(_0x5c7645,_0x2beb18){_0x2beb18=_0x2beb18||0x1f4;return function(_0x15c8c2){logger[_0x247a('0x28')](_0x15c8c2[_0x247a('0x29')]);if(_0x15c8c2['name']){delete _0x15c8c2[_0x247a('0x2a')];}_0x5c7645['status'](_0x2beb18)['send'](_0x15c8c2);};}exports[_0x247a('0x2b')]=function(_0x2ee0bb,_0x11e71d){var _0x42ad0e={},_0xa25575={},_0x2922aa={'count':0x0,'rows':[]};var _0x52736a=_['map'](db[_0x247a('0x2c')][_0x247a('0x2d')],function(_0xede733){return{'name':_0xede733[_0x247a('0x2e')],'type':_0xede733[_0x247a('0x2f')]['key']};});_0xa25575[_0x247a('0x30')]=_[_0x247a('0x31')](_0x52736a,_0x247a('0x2a'));_0xa25575[_0x247a('0x32')]=_[_0x247a('0x33')](_0x2ee0bb[_0x247a('0x32')]);_0xa25575[_0x247a('0x34')]=_[_0x247a('0x35')](_0xa25575['model'],_0xa25575[_0x247a('0x32')]);_0x42ad0e[_0x247a('0x36')]=_['intersection'](_0xa25575[_0x247a('0x30')],qs[_0x247a('0x37')](_0x2ee0bb['query']['fields']));_0x42ad0e[_0x247a('0x36')]=_0x42ad0e[_0x247a('0x36')][_0x247a('0x38')]?_0x42ad0e[_0x247a('0x36')]:_0xa25575[_0x247a('0x30')];if(!_0x2ee0bb['query'][_0x247a('0x39')](_0x247a('0x3a'))){_0x42ad0e[_0x247a('0x1e')]=qs[_0x247a('0x1e')](_0x2ee0bb[_0x247a('0x32')][_0x247a('0x1e')]);_0x42ad0e[_0x247a('0x1b')]=qs[_0x247a('0x1b')](_0x2ee0bb[_0x247a('0x32')][_0x247a('0x1b')]);}_0x42ad0e[_0x247a('0x3b')]=qs[_0x247a('0x3c')](_0x2ee0bb[_0x247a('0x32')]['sort']);_0x42ad0e['where']=qs[_0x247a('0x34')](_['pick'](_0x2ee0bb['query'],_0xa25575[_0x247a('0x34')]),_0x52736a);if(_0x2ee0bb[_0x247a('0x32')][_0x247a('0x3d')]){_0x42ad0e['where']=_[_0x247a('0x3e')](_0x42ad0e[_0x247a('0x3f')],{'$or':[{'key':{'$like':'%'+_0x2ee0bb[_0x247a('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x2ee0bb[_0x247a('0x32')][_0x247a('0x3d')]+'%'}}]});}_0x42ad0e=_[_0x247a('0x3e')]({},_0x42ad0e,_0x2ee0bb[_0x247a('0x40')]);var _0x4878de={'where':_0x42ad0e['where']};return db[_0x247a('0x2c')][_0x247a('0x1d')](_0x4878de)[_0x247a('0x24')](function(_0x5bfcf4){_0x2922aa[_0x247a('0x1d')]=_0x5bfcf4;if(_0x2ee0bb[_0x247a('0x32')][_0x247a('0x41')]){_0x42ad0e['include']=[{'all':!![]}];}return db[_0x247a('0x2c')][_0x247a('0x42')](_0x42ad0e);})['then'](function(_0x928c7d){_0x2922aa[_0x247a('0x43')]=_0x928c7d;return _0x2922aa;})[_0x247a('0x24')](respondWithFilteredResult(_0x11e71d,_0x42ad0e))[_0x247a('0x44')](handleError(_0x11e71d,null));};exports[_0x247a('0x45')]=function(_0x172536,_0x373605){var _0x31149b={'raw':!![],'where':{'id':_0x172536[_0x247a('0x46')]['id']}},_0x82666f={};_0x82666f[_0x247a('0x30')]=_[_0x247a('0x33')](db[_0x247a('0x2c')][_0x247a('0x2d')]);_0x82666f['query']=_['keys'](_0x172536[_0x247a('0x32')]);_0x82666f[_0x247a('0x34')]=_['intersection'](_0x82666f['model'],_0x82666f['query']);_0x31149b['attributes']=_[_0x247a('0x35')](_0x82666f[_0x247a('0x30')],qs[_0x247a('0x37')](_0x172536[_0x247a('0x32')]['fields']));_0x31149b[_0x247a('0x36')]=_0x31149b[_0x247a('0x36')][_0x247a('0x38')]?_0x31149b[_0x247a('0x36')]:_0x82666f[_0x247a('0x30')];if(_0x172536[_0x247a('0x32')][_0x247a('0x41')]){_0x31149b['include']=[{'all':!![]}];}_0x31149b=_[_0x247a('0x3e')]({},_0x31149b,_0x172536['options']);return db[_0x247a('0x2c')]['find'](_0x31149b)['then'](handleEntityNotFound(_0x373605,null))[_0x247a('0x24')](respondWithResult(_0x373605,null))[_0x247a('0x44')](handleError(_0x373605,null));};exports[_0x247a('0x23')]=function(_0x2cac45,_0x43d1c9){if(_0x2cac45[_0x247a('0x47')]['id']){delete _0x2cac45[_0x247a('0x47')]['id'];}return db[_0x247a('0x2c')][_0x247a('0x48')]({'where':{'id':_0x2cac45[_0x247a('0x46')]['id']}})[_0x247a('0x24')](handleEntityNotFound(_0x43d1c9,null))[_0x247a('0x24')](saveUpdates(_0x2cac45[_0x247a('0x47')],null))[_0x247a('0x24')](respondWithResult(_0x43d1c9,null))[_0x247a('0x44')](handleError(_0x43d1c9,null));};exports[_0x247a('0x25')]=function(_0x572740,_0x270779){return db['CannedAnswer'][_0x247a('0x48')]({'where':{'id':_0x572740[_0x247a('0x46')]['id']}})['then'](handleEntityNotFound(_0x270779,null))[_0x247a('0x24')](removeEntity(_0x270779,null))[_0x247a('0x44')](handleError(_0x270779,null));};exports[_0x247a('0x49')]=function(_0x543736,_0x254ece){var _0x47cf60={'key':_0x543736[_0x247a('0x47')][_0x247a('0x4a')]};if(_0x543736[_0x247a('0x47')]['MailAccountId']){_0x47cf60[_0x247a('0x4b')]=_0x543736[_0x247a('0x47')][_0x247a('0x4b')];}else if(_0x543736['body'][_0x247a('0x4c')]){_0x47cf60[_0x247a('0x4c')]=_0x543736['body'][_0x247a('0x4c')];}else if(_0x543736[_0x247a('0x47')]['OpenchannelAccountId']){_0x47cf60[_0x247a('0x4d')]=_0x543736[_0x247a('0x47')]['OpenchannelAccountId'];}else if(_0x543736[_0x247a('0x47')][_0x247a('0x4e')]){_0x47cf60[_0x247a('0x4e')]=_0x543736[_0x247a('0x47')][_0x247a('0x4e')];}return db[_0x247a('0x2c')][_0x247a('0x48')]({'where':_0x47cf60})['then'](function(_0x529bfe){if(_0x529bfe){throw new db[(_0x247a('0x4f'))]['ValidationError'](_0x247a('0x50'));}return db['CannedAnswer'][_0x247a('0x49')](_0x543736[_0x247a('0x47')]);})[_0x247a('0x24')](function(_0x4cc729){var _0x11c9fb=_0x543736['user'][_0x247a('0x26')]({'plain':!![]});if(!_0x11c9fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11c9fb[_0x247a('0x51')]===_0x247a('0x52')){var _0x28b44e=_0x4cc729['get']({'plain':!![]});return db[_0x247a('0x53')][_0x247a('0x48')]({'where':{'name':_0x247a('0x54'),'userProfileId':_0x11c9fb[_0x247a('0x55')]},'raw':!![]})[_0x247a('0x24')](function(_0x2904d9){if(_0x2904d9&&_0x2904d9[_0x247a('0x56')]===0x0){return db[_0x247a('0x27')][_0x247a('0x49')]({'name':_0x28b44e['name'],'resourceId':_0x28b44e['id'],'type':_0x2904d9[_0x247a('0x2a')],'sectionId':_0x2904d9['id']},{})[_0x247a('0x24')](function(){return _0x4cc729;});}else{return _0x4cc729;}})[_0x247a('0x44')](function(_0x116c37){logger['error'](_0x247a('0x57'),_0x116c37);throw _0x116c37;});}return _0x4cc729;})[_0x247a('0x24')](respondWithResult(_0x254ece,0xc9))['catch'](handleError(_0x254ece,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8396647..3cc9951 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 _0x453b=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x1a4668,_0x582e9c){var _0x336697=function(_0x101e12){while(--_0x101e12){_0x1a4668['push'](_0x1a4668['shift']());}};_0x336697(++_0x582e9c);}(_0x453b,0x164));var _0xb453=function(_0x392f82,_0x4dc713){_0x392f82=_0x392f82-0x0;var _0x3ad0b8=_0x453b[_0x392f82];return _0x3ad0b8;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var logger=require(_0xb453('0x2'))(_0xb453('0x3'));var moment=require(_0xb453('0x4'));var BPromise=require(_0xb453('0x5'));var rp=require(_0xb453('0x6'));var fs=require('fs');var path=require(_0xb453('0x7'));var rimraf=require(_0xb453('0x8'));var config=require(_0xb453('0x9'));var attributes=require(_0xb453('0xa'));module[_0xb453('0xb')]=function(_0x434695,_0x4d7c1e){return _0x434695[_0xb453('0xc')](_0xb453('0xd'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb453('0xe'),'collate':_0xb453('0xf')});}; \ No newline at end of file +var _0x4092=['moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4092,0x64));var _0x2409=function(_0x3dfbc3,_0x41a601){_0x3dfbc3=_0x3dfbc3-0x0;var _0x53fc9e=_0x4092[_0x3dfbc3];return _0x53fc9e;};'use strict';var _=require(_0x2409('0x0'));var util=require(_0x2409('0x1'));var logger=require(_0x2409('0x2'))(_0x2409('0x3'));var moment=require(_0x2409('0x4'));var BPromise=require(_0x2409('0x5'));var rp=require(_0x2409('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2409('0x7'));var config=require('../../config/environment');var attributes=require(_0x2409('0x8'));module[_0x2409('0x9')]=function(_0x1b3f02,_0x3056ca){return _0x1b3f02['define'](_0x2409('0xa'),attributes,{'tableName':_0x2409('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2409('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9e8e9d2..29a3a57 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(_0x402b9a,_0x2193bb){var _0x17baa3=function(_0x136c14){while(--_0x136c14){_0x402b9a['push'](_0x402b9a['shift']());}};_0x17baa3(++_0x2193bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x39c9bd,_0x1e9cb2){var _0x2d8504=function(_0x434e29){while(--_0x434e29){_0x39c9bd['push'](_0x39c9bd['shift']());}};_0x2d8504(++_0x1e9cb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index eba3a08..68f9181 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 _0x62da=['/:id','show','post','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x152bb4,_0x451113){var _0x3cb897=function(_0x55863b){while(--_0x55863b){_0x152bb4['push'](_0x152bb4['shift']());}};_0x3cb897(++_0x451113);}(_0x62da,0x1d6));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa62d('0x0'));var util=require(_0xa62d('0x1'));var path=require(_0xa62d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa62d('0x3')]();var fs_extra=require(_0xa62d('0x4'));var auth=require(_0xa62d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa62d('0x6'));var controller=require('./cannedAnswer.controller');router[_0xa62d('0x7')]('/',auth[_0xa62d('0x8')](),controller[_0xa62d('0x9')]);router[_0xa62d('0x7')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller[_0xa62d('0xb')]);router[_0xa62d('0xc')]('/',auth[_0xa62d('0x8')](),controller['create']);router[_0xa62d('0xd')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller['update']);router[_0xa62d('0xe')](_0xa62d('0xa'),auth[_0xa62d('0x8')](),controller[_0xa62d('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe859=['show','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x507efc,_0x9c1d0a){var _0x23810d=function(_0xd66e33){while(--_0xd66e33){_0x507efc['push'](_0x507efc['shift']());}};_0x23810d(++_0x9c1d0a);}(_0xe859,0x1b8));var _0x9e85=function(_0x4a0873,_0x20d853){_0x4a0873=_0x4a0873-0x0;var _0x44e7b6=_0xe859[_0x4a0873];return _0x44e7b6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e85('0x0'));var timeout=require(_0x9e85('0x1'));var express=require(_0x9e85('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e85('0x3'));var interaction=require(_0x9e85('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x9e85('0x5')]('/',auth[_0x9e85('0x6')](),controller[_0x9e85('0x7')]);router[_0x9e85('0x5')]('/:id',auth[_0x9e85('0x6')](),controller[_0x9e85('0x8')]);router['post']('/',auth[_0x9e85('0x6')](),controller['create']);router['put'](_0x9e85('0x9'),auth[_0x9e85('0x6')](),controller[_0x9e85('0xa')]);router[_0x9e85('0xb')](_0x9e85('0x9'),auth[_0x9e85('0x6')](),controller[_0x9e85('0xc')]);module[_0x9e85('0xd')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 0958799..857124a 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 _0x3c8e=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x3c8e,0x65));var _0xe3c8=function(_0x35ac80,_0x51ecd6){_0x35ac80=_0x35ac80-0x0;var _0x3faa82=_0x3c8e[_0x35ac80];return _0x3faa82;};'use strict';var Sequelize=require(_0xe3c8('0x0'));module[_0xe3c8('0x1')]={'calldate':{'type':Sequelize[_0xe3c8('0x2')],'allowNull':![],'defaultValue':_0xe3c8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xe3c8('0x4')]},'dcontext':{'type':Sequelize[_0xe3c8('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe3c8('0x4')]},'duration':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe3c8('0x4')]},'amaflags':{'type':Sequelize[_0xe3c8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xe3c8('0x4')]},'uniqueid':{'type':Sequelize[_0xe3c8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xe3c8('0x4')]},'peeraccount':{'type':Sequelize[_0xe3c8('0x4')]},'type':{'type':Sequelize[_0xe3c8('0x4')]},'tag':{'type':Sequelize[_0xe3c8('0x4')]}}; \ No newline at end of file +var _0x7860=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x39aeb2,_0x39be4b){var _0x208de1=function(_0x48f071){while(--_0x48f071){_0x39aeb2['push'](_0x39aeb2['shift']());}};_0x208de1(++_0x39be4b);}(_0x7860,0xe4));var _0x0786=function(_0x5c6c27,_0x26d3b6){_0x5c6c27=_0x5c6c27-0x0;var _0x24bd15=_0x7860[_0x5c6c27];return _0x24bd15;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0786('0x0')],'allowNull':![],'defaultValue':_0x0786('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0786('0x2')]},'dst':{'type':Sequelize[_0x0786('0x2')]},'dcontext':{'type':Sequelize[_0x0786('0x2')]},'channel':{'type':Sequelize[_0x0786('0x2')]},'dstchannel':{'type':Sequelize[_0x0786('0x2')]},'lastapp':{'type':Sequelize[_0x0786('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0786('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0786('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0786('0x2')]},'userfield':{'type':Sequelize[_0x0786('0x2')]},'uniqueid':{'type':Sequelize[_0x0786('0x2')]},'linkedid':{'type':Sequelize[_0x0786('0x2')]},'sequence':{'type':Sequelize[_0x0786('0x2')]},'peeraccount':{'type':Sequelize[_0x0786('0x2')]},'type':{'type':Sequelize[_0x0786('0x2')]},'tag':{'type':Sequelize[_0x0786('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index dbeafe2..d4d9562 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 _0x31af=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs'];(function(_0xba44ff,_0x2b3b1f){var _0x482616=function(_0x500a76){while(--_0x500a76){_0xba44ff['push'](_0xba44ff['shift']());}};_0x482616(++_0x2b3b1f);}(_0x31af,0xde));var _0xf31a=function(_0x353ffb,_0x2f216d){_0x353ffb=_0x353ffb-0x0;var _0x3c6d79=_0x31af[_0x353ffb];return _0x3c6d79;};'use strict';var emlformat=require(_0xf31a('0x0'));var rimraf=require(_0xf31a('0x1'));var zipdir=require(_0xf31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf31a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf31a('0x4'));var util=require(_0xf31a('0x5'));var path=require(_0xf31a('0x6'));var sox=require(_0xf31a('0x7'));var csv=require('to-csv');var ejs=require(_0xf31a('0x8'));var fs=require('fs');var fs_extra=require(_0xf31a('0x9'));var _=require(_0xf31a('0xa'));var squel=require(_0xf31a('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31a('0xc'));var deskjs=require(_0xf31a('0xd'));var toCsv=require(_0xf31a('0xe'));var querystring=require(_0xf31a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf31a('0x10'));var authService=require(_0xf31a('0x11'));var qs=require(_0xf31a('0x12'));var as=require(_0xf31a('0x13'));var hardwareService=require(_0xf31a('0x14'));var logger=require('../../config/logger')(_0xf31a('0x15'));var utils=require(_0xf31a('0x16'));var config=require(_0xf31a('0x17'));var licenseUtil=require(_0xf31a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b662,_0x26b85e){_0x26b85e=_0x26b85e||0xcc;return function(_0x57ed2f){if(_0x57ed2f){return _0x4b662[_0xf31a('0x19')](_0x26b85e);}return _0x4b662[_0xf31a('0x1a')](_0x26b85e)[_0xf31a('0x1b')]();};}function respondWithResult(_0x18d266,_0x451107){_0x451107=_0x451107||0xc8;return function(_0x203031){if(_0x203031){return _0x18d266[_0xf31a('0x1a')](_0x451107)[_0xf31a('0x1c')](_0x203031);}};}function respondWithFilteredResult(_0x3f7c35,_0x22522c){return function(_0x6ea6f1){if(_0x6ea6f1){var _0x1da226=typeof _0x22522c[_0xf31a('0x1d')]===_0xf31a('0x1e')&&typeof _0x22522c[_0xf31a('0x1f')]==='undefined';var _0x454836=_0x6ea6f1[_0xf31a('0x20')];var _0x251ca7=_0x1da226?0x0:_0x22522c[_0xf31a('0x1d')];var _0x4c3589=_0x1da226?_0x6ea6f1[_0xf31a('0x20')]:_0x22522c[_0xf31a('0x1d')]+_0x22522c[_0xf31a('0x1f')];var _0x208da3;if(_0x4c3589>=_0x454836){_0x4c3589=_0x454836;_0x208da3=0xc8;}else{_0x208da3=0xce;}_0x3f7c35[_0xf31a('0x1a')](_0x208da3);return _0x3f7c35['set'](_0xf31a('0x21'),_0x251ca7+'-'+_0x4c3589+'/'+_0x454836)[_0xf31a('0x1c')](_0x6ea6f1);}return null;};}function patchUpdates(_0x5861df){return function(_0x22c9c3){try{jsonpatch[_0xf31a('0x22')](_0x22c9c3,_0x5861df,!![]);}catch(_0x55da11){return BPromise[_0xf31a('0x23')](_0x55da11);}return _0x22c9c3[_0xf31a('0x24')]();};}function saveUpdates(_0x54f9b5,_0x5724b3){return function(_0x534317){if(_0x534317){return _0x534317[_0xf31a('0x25')](_0x54f9b5)[_0xf31a('0x26')](function(_0x5c23db){return _0x5c23db;});}return null;};}function removeEntity(_0x41d359,_0x2a8a22){return function(_0x5d08ee){if(_0x5d08ee){return _0x5d08ee[_0xf31a('0x27')]()['then'](function(){_0x41d359['status'](0xcc)[_0xf31a('0x1b')]();});}};}function handleEntityNotFound(_0x714292,_0x54ad77){return function(_0x4e115c){if(!_0x4e115c){_0x714292['sendStatus'](0x194);}return _0x4e115c;};}function handleError(_0x531179,_0x14c82e){_0x14c82e=_0x14c82e||0x1f4;return function(_0x45df36){logger[_0xf31a('0x28')](_0x45df36['stack']);if(_0x45df36[_0xf31a('0x29')]){delete _0x45df36[_0xf31a('0x29')];}_0x531179[_0xf31a('0x1a')](_0x14c82e)[_0xf31a('0x2a')](_0x45df36);};}exports[_0xf31a('0x2b')]=function(_0x5a55c6,_0xed9bfd){var _0x2ebc27={},_0x52f8aa={},_0x52da7d={'count':0x0,'rows':[]};var _0x203f28=_[_0xf31a('0x2c')](db['Cdr'][_0xf31a('0x2d')],function(_0x221048){return{'name':_0x221048[_0xf31a('0x2e')],'type':_0x221048['type'][_0xf31a('0x2f')]};});_0x52f8aa[_0xf31a('0x30')]=_[_0xf31a('0x2c')](_0x203f28,_0xf31a('0x29'));_0x52f8aa[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x5a55c6['query']);_0x52f8aa[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],_0x52f8aa[_0xf31a('0x31')]);_0x2ebc27[_0xf31a('0x35')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x36')]));_0x2ebc27[_0xf31a('0x35')]=_0x2ebc27[_0xf31a('0x35')][_0xf31a('0x37')]?_0x2ebc27[_0xf31a('0x35')]:_0x52f8aa[_0xf31a('0x30')];if(!_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x38')](_0xf31a('0x39'))){_0x2ebc27[_0xf31a('0x1f')]=qs['limit'](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x1f')]);_0x2ebc27[_0xf31a('0x1d')]=qs[_0xf31a('0x1d')](_0x5a55c6[_0xf31a('0x31')]['offset']);}_0x2ebc27[_0xf31a('0x3a')]=qs[_0xf31a('0x3b')](_0x5a55c6[_0xf31a('0x31')]['sort']);_0x2ebc27[_0xf31a('0x3c')]=qs[_0xf31a('0x33')](_[_0xf31a('0x3d')](_0x5a55c6[_0xf31a('0x31')],_0x52f8aa[_0xf31a('0x33')]),_0x203f28);if(_0x5a55c6['query'][_0xf31a('0x3e')]){_0x2ebc27['where']=_[_0xf31a('0x3f')](_0x2ebc27[_0xf31a('0x3c')],{'$or':_['map'](_0x203f28,function(_0x35d5b6){if(_0x35d5b6[_0xf31a('0x40')]!==_0xf31a('0x41')){var _0x481d92={};_0x481d92[_0x35d5b6[_0xf31a('0x29')]]={'$like':'%'+_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x3e')]+'%'};return _0x481d92;}})});}_0x2ebc27=_[_0xf31a('0x3f')]({},_0x2ebc27,_0x5a55c6[_0xf31a('0x42')]);var _0x2a240d={'where':_0x2ebc27[_0xf31a('0x3c')]};return db[_0xf31a('0x43')][_0xf31a('0x20')](_0x2a240d)['then'](function(_0x3b4aef){_0x52da7d[_0xf31a('0x20')]=_0x3b4aef;if(_0x5a55c6['query'][_0xf31a('0x44')]){_0x2ebc27[_0xf31a('0x45')]=[{'all':!![]}];}return db[_0xf31a('0x43')][_0xf31a('0x46')](_0x2ebc27);})['then'](function(_0x21b871){_0x52da7d[_0xf31a('0x47')]=_0x21b871;return _0x52da7d;})[_0xf31a('0x26')](respondWithFilteredResult(_0xed9bfd,_0x2ebc27))[_0xf31a('0x48')](handleError(_0xed9bfd,null));};exports['show']=function(_0x234e1a,_0x58163c){var _0x303066={'raw':!![],'where':{'id':_0x234e1a[_0xf31a('0x49')]['id']}},_0x172e1c={};_0x172e1c['model']=_[_0xf31a('0x32')](db['Cdr'][_0xf31a('0x2d')]);_0x172e1c[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x234e1a[_0xf31a('0x31')]);_0x172e1c[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x172e1c[_0xf31a('0x30')],_0x172e1c[_0xf31a('0x31')]);_0x303066[_0xf31a('0x35')]=_['intersection'](_0x172e1c[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x234e1a[_0xf31a('0x31')][_0xf31a('0x36')]));_0x303066[_0xf31a('0x35')]=_0x303066[_0xf31a('0x35')][_0xf31a('0x37')]?_0x303066['attributes']:_0x172e1c['model'];if(_0x234e1a[_0xf31a('0x31')][_0xf31a('0x44')]){_0x303066[_0xf31a('0x45')]=[{'all':!![]}];}_0x303066=_[_0xf31a('0x3f')]({},_0x303066,_0x234e1a[_0xf31a('0x42')]);return db[_0xf31a('0x43')]['find'](_0x303066)[_0xf31a('0x26')](handleEntityNotFound(_0x58163c,null))[_0xf31a('0x26')](respondWithResult(_0x58163c,null))[_0xf31a('0x48')](handleError(_0x58163c,null));};exports[_0xf31a('0x4a')]=function(_0x45b8ed,_0x287bc1){return db['Cdr'][_0xf31a('0x4a')](_0x45b8ed[_0xf31a('0x4b')],{})[_0xf31a('0x26')](respondWithResult(_0x287bc1,0xc9))[_0xf31a('0x48')](handleError(_0x287bc1,null));};exports[_0xf31a('0x25')]=function(_0x111f08,_0x20bd0c){if(_0x111f08[_0xf31a('0x4b')]['id']){delete _0x111f08[_0xf31a('0x4b')]['id'];}return db[_0xf31a('0x43')]['find']({'where':{'id':_0x111f08[_0xf31a('0x49')]['id']}})['then'](handleEntityNotFound(_0x20bd0c,null))[_0xf31a('0x26')](saveUpdates(_0x111f08[_0xf31a('0x4b')],null))[_0xf31a('0x26')](respondWithResult(_0x20bd0c,null))[_0xf31a('0x48')](handleError(_0x20bd0c,null));};exports[_0xf31a('0x27')]=function(_0x3a1a26,_0x25ad3d){return db[_0xf31a('0x43')]['find']({'where':{'id':_0x3a1a26[_0xf31a('0x49')]['id']}})[_0xf31a('0x26')](handleEntityNotFound(_0x25ad3d,null))[_0xf31a('0x26')](removeEntity(_0x25ad3d,null))[_0xf31a('0x48')](handleError(_0x25ad3d,null));};exports[_0xf31a('0x4c')]=function(_0x8c6795,_0x4d21ed){return db[_0xf31a('0x43')][_0xf31a('0x4c')]()[_0xf31a('0x26')](respondWithResult(_0x4d21ed,null))[_0xf31a('0x48')](handleError(_0x4d21ed,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x480bff,_0x2adcdc){var _0x3e4a76=function(_0x466952){while(--_0x466952){_0x480bff['push'](_0x480bff['shift']());}};_0x3e4a76(++_0x2adcdc);}(_0x3e74,0x175));var _0x43e7=function(_0x5ec688,_0x3b8f6d){_0x5ec688=_0x5ec688-0x0;var _0x3db4f9=_0x3e74[_0x5ec688];return _0x3db4f9;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['Cdr']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['Cdr']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['Cdr']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index cead21b..ed31e2f 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x553ea0,_0x1ece5e){var _0x5889c6=function(_0xedbe0a){while(--_0xedbe0a){_0x553ea0['push'](_0x553ea0['shift']());}};_0x5889c6(++_0x1ece5e);}(_0x7a54,0x106));var _0x47a5=function(_0x5cc2ed,_0x37258d){_0x5cc2ed=_0x5cc2ed-0x0;var _0x5bd8fe=_0x7a54[_0x5cc2ed];return _0x5bd8fe;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x214437,_0x1e70d6){var _0x202b99=function(_0xa62ce4){while(--_0xa62ce4){_0x214437['push'](_0x214437['shift']());}};_0x202b99(++_0x1e70d6);}(_0x7a54,0x106));var _0x47a5=function(_0x59939d,_0x5827de){_0x59939d=_0x59939d-0x0;var _0x3ff68d=_0x7a54[_0x59939d];return _0x3ff68d;};'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 41e38d0..bcb3f68 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 _0xacd2=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0xacd2,0x1e9));var _0x2acd=function(_0x3eefe3,_0x2157e2){_0x3eefe3=_0x3eefe3-0x0;var _0x1ec665=_0xacd2[_0x3eefe3];return _0x1ec665;};'use strict';var _=require(_0x2acd('0x0'));var util=require(_0x2acd('0x1'));var moment=require(_0x2acd('0x2'));var BPromise=require('bluebird');var rs=require(_0x2acd('0x3'));var fs=require('fs');var Redis=require(_0x2acd('0x4'));var db=require(_0x2acd('0x5'))['db'];var utils=require(_0x2acd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2acd('0x7'));var jayson=require(_0x2acd('0x8'));var client=jayson[_0x2acd('0x9')][_0x2acd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30ef04,_0x474a81,_0x8db95){return new BPromise(function(_0x44ecb7,_0x5d90f6){return client['request'](_0x30ef04,_0x8db95)['then'](function(_0x18bee8){logger[_0x2acd('0xb')](_0x2acd('0xc'),_0x474a81,_0x2acd('0xd'));logger[_0x2acd('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x474a81,_0x2acd('0xd'),JSON[_0x2acd('0xf')](_0x18bee8));if(_0x18bee8[_0x2acd('0x10')]){if(_0x18bee8[_0x2acd('0x10')]['code']===0x1f4){logger['error'](_0x2acd('0xc'),_0x474a81,_0x18bee8[_0x2acd('0x10')][_0x2acd('0x11')]);return _0x5d90f6(_0x18bee8['error']['message']);}logger['error'](_0x2acd('0xc'),_0x474a81,_0x18bee8['error']['message']);return _0x44ecb7(_0x18bee8['error'][_0x2acd('0x11')]);}else{logger[_0x2acd('0xb')](_0x2acd('0xc'),_0x474a81,'request\x20sent');_0x44ecb7(_0x18bee8[_0x2acd('0x12')][_0x2acd('0x11')]);}})['catch'](function(_0x49d05e){logger[_0x2acd('0x10')](_0x2acd('0xc'),_0x474a81,_0x49d05e);_0x5d90f6(_0x49d05e);});});} \ No newline at end of file +var _0xfa4e=['code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x7e1796,_0x40c0d9){var _0x55288b=function(_0x160e8b){while(--_0x160e8b){_0x7e1796['push'](_0x7e1796['shift']());}};_0x55288b(++_0x40c0d9);}(_0xfa4e,0x190));var _0xefa4=function(_0x2b9a36,_0x566b57){_0x2b9a36=_0x2b9a36-0x0;var _0x3a86ef=_0xfa4e[_0x2b9a36];return _0x3a86ef;};'use strict';var _=require(_0xefa4('0x0'));var util=require('util');var moment=require(_0xefa4('0x1'));var BPromise=require('bluebird');var rs=require(_0xefa4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefa4('0x3'))['db'];var utils=require(_0xefa4('0x4'));var logger=require(_0xefa4('0x5'))(_0xefa4('0x6'));var config=require(_0xefa4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xefa4('0x8')][_0xefa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cb33c,_0x3f82fa,_0x357856){return new BPromise(function(_0x3ac3af,_0x4f9186){return client['request'](_0x4cb33c,_0x357856)[_0xefa4('0xa')](function(_0x25126b){logger[_0xefa4('0xb')](_0xefa4('0xc'),_0x3f82fa,_0xefa4('0xd'));logger[_0xefa4('0xe')](_0xefa4('0xf'),_0x3f82fa,_0xefa4('0xd'),JSON[_0xefa4('0x10')](_0x25126b));if(_0x25126b['error']){if(_0x25126b[_0xefa4('0x11')][_0xefa4('0x12')]===0x1f4){logger[_0xefa4('0x11')](_0xefa4('0xc'),_0x3f82fa,_0x25126b['error'][_0xefa4('0x13')]);return _0x4f9186(_0x25126b[_0xefa4('0x11')][_0xefa4('0x13')]);}logger[_0xefa4('0x11')]('Cdr,\x20%s,\x20%s',_0x3f82fa,_0x25126b[_0xefa4('0x11')][_0xefa4('0x13')]);return _0x3ac3af(_0x25126b[_0xefa4('0x11')][_0xefa4('0x13')]);}else{logger[_0xefa4('0xb')](_0xefa4('0xc'),_0x3f82fa,_0xefa4('0xd'));_0x3ac3af(_0x25126b[_0xefa4('0x14')]['message']);}})[_0xefa4('0x15')](function(_0x28452c){logger[_0xefa4('0x11')](_0xefa4('0xc'),_0x3f82fa,_0x28452c);_0x4f9186(_0x28452c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1d6d0e0..dbf7959 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1fb788,_0x32164b){var _0x167cc0=function(_0x2d56e9){while(--_0x2d56e9){_0x1fb788['push'](_0x1fb788['shift']());}};_0x167cc0(++_0x32164b);}(_0xb10b,0x12a));var _0xbb10=function(_0x28b02a,_0x4bda86){_0x28b02a=_0x28b02a-0x0;var _0x1212ca=_0xb10b[_0x28b02a];return _0x1212ca;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +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(_0x4fc9c1,_0x570e05){var _0x15d7a1=function(_0xa5af50){while(--_0xa5af50){_0x4fc9c1['push'](_0x4fc9c1['shift']());}};_0x15d7a1(++_0x570e05);}(_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 2228420..a573634 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 _0x7ff8=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x420516,_0x5ce5ca){var _0x16484e=function(_0x18775b){while(--_0x18775b){_0x420516['push'](_0x420516['shift']());}};_0x16484e(++_0x5ce5ca);}(_0x7ff8,0x15b));var _0x87ff=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x7ff8[_0x40911a];return _0x27e8e3;};'use strict';var Sequelize=require('sequelize');module[_0x87ff('0x0')]={'priority':{'type':Sequelize[_0x87ff('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x87ff('0x2')],'allowNull':![],'defaultValue':_0x87ff('0x3')},'appdata':{'type':Sequelize[_0x87ff('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x87ff('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x18e6=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x18e6,0xfa));var _0x618e=function(_0x571acc,_0x4442ab){_0x571acc=_0x571acc-0x0;var _0x589b23=_0x18e6[_0x571acc];return _0x589b23;};'use strict';var Sequelize=require('sequelize');module[_0x618e('0x0')]={'priority':{'type':Sequelize[_0x618e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x618e('0x2')],'allowNull':![],'defaultValue':_0x618e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x618e('0x2')]},'interval':{'type':Sequelize[_0x618e('0x2')],'defaultValue':_0x618e('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 61bf625..7018472 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 _0x74fd=['reject','save','destroy','then','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','ChatApplication','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x484d32,_0x40a4f1){var _0xb6a25c=function(_0x551520){while(--_0x551520){_0x484d32['push'](_0x484d32['shift']());}};_0xb6a25c(++_0x40a4f1);}(_0x74fd,0x8f));var _0xd74f=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x74fd[_0x4ca6a4];return _0x120555;};'use strict';var emlformat=require(_0xd74f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd74f('0x1'));var jsonpatch=require(_0xd74f('0x2'));var rp=require(_0xd74f('0x3'));var moment=require(_0xd74f('0x4'));var BPromise=require(_0xd74f('0x5'));var Mustache=require(_0xd74f('0x6'));var util=require(_0xd74f('0x7'));var path=require(_0xd74f('0x8'));var sox=require(_0xd74f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd74f('0xa'));var _=require(_0xd74f('0xb'));var squel=require('squel');var crypto=require(_0xd74f('0xc'));var jsforce=require(_0xd74f('0xd'));var deskjs=require(_0xd74f('0xe'));var toCsv=require(_0xd74f('0xf'));var querystring=require(_0xd74f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd74f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd74f('0x12'));var logger=require(_0xd74f('0x13'))(_0xd74f('0x14'));var utils=require(_0xd74f('0x15'));var config=require(_0xd74f('0x16'));var licenseUtil=require(_0xd74f('0x17'));var db=require(_0xd74f('0x18'))['db'];function respondWithStatusCode(_0x29d351,_0x3f985c){_0x3f985c=_0x3f985c||0xcc;return function(_0x59998d){if(_0x59998d){return _0x29d351[_0xd74f('0x19')](_0x3f985c);}return _0x29d351[_0xd74f('0x1a')](_0x3f985c)[_0xd74f('0x1b')]();};}function respondWithResult(_0x1a0d70,_0x629925){_0x629925=_0x629925||0xc8;return function(_0x509ad5){if(_0x509ad5){return _0x1a0d70[_0xd74f('0x1a')](_0x629925)[_0xd74f('0x1c')](_0x509ad5);}};}function respondWithFilteredResult(_0x1bc6d9,_0x53207a){return function(_0x267d4d){if(_0x267d4d){var _0x297477=typeof _0x53207a['offset']===_0xd74f('0x1d')&&typeof _0x53207a[_0xd74f('0x1e')]===_0xd74f('0x1d');var _0x2be0c4=_0x267d4d[_0xd74f('0x1f')];var _0x8ce3f2=_0x297477?0x0:_0x53207a[_0xd74f('0x20')];var _0x535c4a=_0x297477?_0x267d4d[_0xd74f('0x1f')]:_0x53207a[_0xd74f('0x20')]+_0x53207a['limit'];var _0x893907;if(_0x535c4a>=_0x2be0c4){_0x535c4a=_0x2be0c4;_0x893907=0xc8;}else{_0x893907=0xce;}_0x1bc6d9[_0xd74f('0x1a')](_0x893907);return _0x1bc6d9[_0xd74f('0x21')]('Content-Range',_0x8ce3f2+'-'+_0x535c4a+'/'+_0x2be0c4)['json'](_0x267d4d);}return null;};}function patchUpdates(_0x586a75){return function(_0x46139b){try{jsonpatch['apply'](_0x46139b,_0x586a75,!![]);}catch(_0x5c0d80){return BPromise[_0xd74f('0x22')](_0x5c0d80);}return _0x46139b[_0xd74f('0x23')]();};}function saveUpdates(_0x51dcfc,_0x1ec24b){return function(_0x341585){if(_0x341585){return _0x341585['update'](_0x51dcfc)['then'](function(_0x313285){return _0x313285;});}return null;};}function removeEntity(_0x2406a7,_0x15a863){return function(_0x14bb84){if(_0x14bb84){return _0x14bb84[_0xd74f('0x24')]()[_0xd74f('0x25')](function(){_0x2406a7[_0xd74f('0x1a')](0xcc)[_0xd74f('0x1b')]();});}};}function handleEntityNotFound(_0x409536,_0x40a089){return function(_0x1abb89){if(!_0x1abb89){_0x409536[_0xd74f('0x19')](0x194);}return _0x1abb89;};}function handleError(_0x176169,_0x394443){_0x394443=_0x394443||0x1f4;return function(_0xd5dca0){logger['error'](_0xd5dca0['stack']);if(_0xd5dca0['name']){delete _0xd5dca0[_0xd74f('0x26')];}_0x176169[_0xd74f('0x1a')](_0x394443)[_0xd74f('0x27')](_0xd5dca0);};}exports[_0xd74f('0x28')]=function(_0x175c36,_0x256878){var _0x10ac39={'raw':!![],'where':{'id':_0x175c36[_0xd74f('0x29')]['id']}},_0xc39b90={};_0xc39b90[_0xd74f('0x2a')]=_[_0xd74f('0x2b')](db['ChatApplication'][_0xd74f('0x2c')]);_0xc39b90[_0xd74f('0x2d')]=_[_0xd74f('0x2b')](_0x175c36[_0xd74f('0x2d')]);_0xc39b90[_0xd74f('0x2e')]=_['intersection'](_0xc39b90[_0xd74f('0x2a')],_0xc39b90[_0xd74f('0x2d')]);_0x10ac39[_0xd74f('0x2f')]=_[_0xd74f('0x30')](_0xc39b90[_0xd74f('0x2a')],qs[_0xd74f('0x31')](_0x175c36[_0xd74f('0x2d')]['fields']));_0x10ac39[_0xd74f('0x2f')]=_0x10ac39[_0xd74f('0x2f')][_0xd74f('0x32')]?_0x10ac39[_0xd74f('0x2f')]:_0xc39b90['model'];if(_0x175c36['query'][_0xd74f('0x33')]){_0x10ac39[_0xd74f('0x34')]=[{'all':!![]}];}_0x10ac39=_[_0xd74f('0x35')]({},_0x10ac39,_0x175c36[_0xd74f('0x36')]);return db[_0xd74f('0x37')]['find'](_0x10ac39)[_0xd74f('0x25')](handleEntityNotFound(_0x256878,null))['then'](respondWithResult(_0x256878,null))[_0xd74f('0x38')](handleError(_0x256878,null));};exports['update']=function(_0x50ee8c,_0x2f8a33){if(_0x50ee8c[_0xd74f('0x39')]['id']){delete _0x50ee8c[_0xd74f('0x39')]['id'];}return db['ChatApplication'][_0xd74f('0x3a')]({'where':{'id':_0x50ee8c[_0xd74f('0x29')]['id']}})[_0xd74f('0x25')](handleEntityNotFound(_0x2f8a33,null))[_0xd74f('0x25')](saveUpdates(_0x50ee8c[_0xd74f('0x39')],null))[_0xd74f('0x25')](respondWithResult(_0x2f8a33,null))[_0xd74f('0x38')](handleError(_0x2f8a33,null));};exports[_0xd74f('0x24')]=function(_0x23fa3f,_0x3aa915){return db[_0xd74f('0x37')][_0xd74f('0x3a')]({'where':{'id':_0x23fa3f[_0xd74f('0x29')]['id']}})[_0xd74f('0x25')](handleEntityNotFound(_0x3aa915,null))[_0xd74f('0x25')](removeEntity(_0x3aa915,null))[_0xd74f('0x38')](handleError(_0x3aa915,null));}; \ No newline at end of file +var _0x0caf=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','query','attributes','intersection','fields','length','include','merge','options','catch','body','destroy','find','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x31e87a,_0x240bbb){var _0x5331fc=function(_0x2336a9){while(--_0x2336a9){_0x31e87a['push'](_0x31e87a['shift']());}};_0x5331fc(++_0x240bbb);}(_0x0caf,0x9f));var _0xf0ca=function(_0x15a86b,_0x196807){_0x15a86b=_0x15a86b-0x0;var _0x464332=_0x0caf[_0x15a86b];return _0x464332;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ca('0x0'));var rp=require(_0xf0ca('0x1'));var moment=require(_0xf0ca('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf0ca('0x3'));var path=require(_0xf0ca('0x4'));var sox=require('sox');var csv=require(_0xf0ca('0x5'));var ejs=require(_0xf0ca('0x6'));var fs=require('fs');var fs_extra=require(_0xf0ca('0x7'));var _=require('lodash');var squel=require(_0xf0ca('0x8'));var crypto=require(_0xf0ca('0x9'));var jsforce=require(_0xf0ca('0xa'));var deskjs=require(_0xf0ca('0xb'));var toCsv=require(_0xf0ca('0x5'));var querystring=require(_0xf0ca('0xc'));var Papa=require(_0xf0ca('0xd'));var Redis=require('ioredis');var authService=require(_0xf0ca('0xe'));var qs=require(_0xf0ca('0xf'));var as=require(_0xf0ca('0x10'));var hardwareService=require(_0xf0ca('0x11'));var logger=require(_0xf0ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf0ca('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf0ca('0x14'))['db'];function respondWithStatusCode(_0x582e00,_0x3c1332){_0x3c1332=_0x3c1332||0xcc;return function(_0x38c595){if(_0x38c595){return _0x582e00[_0xf0ca('0x15')](_0x3c1332);}return _0x582e00[_0xf0ca('0x16')](_0x3c1332)[_0xf0ca('0x17')]();};}function respondWithResult(_0x3f6251,_0x5c5875){_0x5c5875=_0x5c5875||0xc8;return function(_0x6d9157){if(_0x6d9157){return _0x3f6251['status'](_0x5c5875)['json'](_0x6d9157);}};}function respondWithFilteredResult(_0x4545db,_0x34ea00){return function(_0x3b1daa){if(_0x3b1daa){var _0x2b074e=typeof _0x34ea00[_0xf0ca('0x18')]==='undefined'&&typeof _0x34ea00['limit']===_0xf0ca('0x19');var _0x4d08f2=_0x3b1daa['count'];var _0x3245b2=_0x2b074e?0x0:_0x34ea00[_0xf0ca('0x18')];var _0x2473f0=_0x2b074e?_0x3b1daa[_0xf0ca('0x1a')]:_0x34ea00[_0xf0ca('0x18')]+_0x34ea00[_0xf0ca('0x1b')];var _0x48b114;if(_0x2473f0>=_0x4d08f2){_0x2473f0=_0x4d08f2;_0x48b114=0xc8;}else{_0x48b114=0xce;}_0x4545db[_0xf0ca('0x16')](_0x48b114);return _0x4545db['set'](_0xf0ca('0x1c'),_0x3245b2+'-'+_0x2473f0+'/'+_0x4d08f2)[_0xf0ca('0x1d')](_0x3b1daa);}return null;};}function patchUpdates(_0x50f742){return function(_0x24303d){try{jsonpatch[_0xf0ca('0x1e')](_0x24303d,_0x50f742,!![]);}catch(_0x3512b3){return BPromise[_0xf0ca('0x1f')](_0x3512b3);}return _0x24303d[_0xf0ca('0x20')]();};}function saveUpdates(_0x2e54bf,_0x3414eb){return function(_0x520863){if(_0x520863){return _0x520863[_0xf0ca('0x21')](_0x2e54bf)[_0xf0ca('0x22')](function(_0x1ba29d){return _0x1ba29d;});}return null;};}function removeEntity(_0x3d6bad,_0x5f31c6){return function(_0xd8312a){if(_0xd8312a){return _0xd8312a['destroy']()['then'](function(){_0x3d6bad[_0xf0ca('0x16')](0xcc)[_0xf0ca('0x17')]();});}};}function handleEntityNotFound(_0x8dbaed,_0x11916a){return function(_0x106f8e){if(!_0x106f8e){_0x8dbaed[_0xf0ca('0x15')](0x194);}return _0x106f8e;};}function handleError(_0x20bfbc,_0x30b5a3){_0x30b5a3=_0x30b5a3||0x1f4;return function(_0x4c2365){logger['error'](_0x4c2365[_0xf0ca('0x23')]);if(_0x4c2365[_0xf0ca('0x24')]){delete _0x4c2365['name'];}_0x20bfbc[_0xf0ca('0x16')](_0x30b5a3)[_0xf0ca('0x25')](_0x4c2365);};}exports[_0xf0ca('0x26')]=function(_0x2aaae9,_0x48bbf8){var _0xb41d0a={'raw':!![],'where':{'id':_0x2aaae9[_0xf0ca('0x27')]['id']}},_0xbefb0e={};_0xbefb0e[_0xf0ca('0x28')]=_[_0xf0ca('0x29')](db[_0xf0ca('0x2a')][_0xf0ca('0x2b')]);_0xbefb0e['query']=_[_0xf0ca('0x29')](_0x2aaae9['query']);_0xbefb0e[_0xf0ca('0x2c')]=_['intersection'](_0xbefb0e[_0xf0ca('0x28')],_0xbefb0e[_0xf0ca('0x2d')]);_0xb41d0a[_0xf0ca('0x2e')]=_[_0xf0ca('0x2f')](_0xbefb0e[_0xf0ca('0x28')],qs[_0xf0ca('0x30')](_0x2aaae9[_0xf0ca('0x2d')][_0xf0ca('0x30')]));_0xb41d0a[_0xf0ca('0x2e')]=_0xb41d0a[_0xf0ca('0x2e')][_0xf0ca('0x31')]?_0xb41d0a[_0xf0ca('0x2e')]:_0xbefb0e[_0xf0ca('0x28')];if(_0x2aaae9[_0xf0ca('0x2d')]['includeAll']){_0xb41d0a[_0xf0ca('0x32')]=[{'all':!![]}];}_0xb41d0a=_[_0xf0ca('0x33')]({},_0xb41d0a,_0x2aaae9[_0xf0ca('0x34')]);return db[_0xf0ca('0x2a')]['find'](_0xb41d0a)[_0xf0ca('0x22')](handleEntityNotFound(_0x48bbf8,null))['then'](respondWithResult(_0x48bbf8,null))[_0xf0ca('0x35')](handleError(_0x48bbf8,null));};exports['update']=function(_0x617b26,_0x2c218b){if(_0x617b26['body']['id']){delete _0x617b26[_0xf0ca('0x36')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x617b26[_0xf0ca('0x27')]['id']}})[_0xf0ca('0x22')](handleEntityNotFound(_0x2c218b,null))[_0xf0ca('0x22')](saveUpdates(_0x617b26[_0xf0ca('0x36')],null))[_0xf0ca('0x22')](respondWithResult(_0x2c218b,null))['catch'](handleError(_0x2c218b,null));};exports[_0xf0ca('0x37')]=function(_0x448969,_0x436273){return db[_0xf0ca('0x2a')][_0xf0ca('0x38')]({'where':{'id':_0x448969[_0xf0ca('0x27')]['id']}})['then'](handleEntityNotFound(_0x436273,null))[_0xf0ca('0x22')](removeEntity(_0x436273,null))[_0xf0ca('0x35')](handleError(_0x436273,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 54fdc91..5d89010 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 _0xb9c6=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb9c6,0x1d8));var _0x6b9c=function(_0x495f66,_0x3b27fe){_0x495f66=_0x495f66-0x0;var _0x54a2bb=_0xb9c6[_0x495f66];return _0x54a2bb;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var logger=require(_0x6b9c('0x2'))(_0x6b9c('0x3'));var moment=require(_0x6b9c('0x4'));var BPromise=require(_0x6b9c('0x5'));var rp=require(_0x6b9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b9c('0x7'));var attributes=require(_0x6b9c('0x8'));module['exports']=function(_0x5670f5,_0x4312d4){return _0x5670f5['define'](_0x6b9c('0x9'),attributes,{'tableName':_0x6b9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6b9c('0xb')});}; \ No newline at end of file +var _0x61ea=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x3b7b42,_0x31badd){var _0x1ebaad=function(_0x3655d9){while(--_0x3655d9){_0x3b7b42['push'](_0x3b7b42['shift']());}};_0x1ebaad(++_0x31badd);}(_0x61ea,0x1d5));var _0xa61e=function(_0x3ab3f4,_0x54c8c8){_0x3ab3f4=_0x3ab3f4-0x0;var _0x182f66=_0x61ea[_0x3ab3f4];return _0x182f66;};'use strict';var _=require(_0xa61e('0x0'));var util=require(_0xa61e('0x1'));var logger=require(_0xa61e('0x2'))(_0xa61e('0x3'));var moment=require('moment');var BPromise=require(_0xa61e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa61e('0x5'));var config=require('../../config/environment');var attributes=require(_0xa61e('0x6'));module[_0xa61e('0x7')]=function(_0x262cc4,_0x3ffec9){return _0x262cc4[_0xa61e('0x8')](_0xa61e('0x9'),attributes,{'tableName':_0xa61e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa61e('0xb'),'collate':_0xa61e('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 4d2c2d9..4de34cf 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 _0x2274=['code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4124b8,_0x39a5fb){var _0xdd927=function(_0x2fb8ab){while(--_0x2fb8ab){_0x4124b8['push'](_0x4124b8['shift']());}};_0xdd927(++_0x39a5fb);}(_0x2274,0x111));var _0x4227=function(_0x15dea9,_0x163d52){_0x15dea9=_0x15dea9-0x0;var _0x1b0cf0=_0x2274[_0x15dea9];return _0x1b0cf0;};'use strict';var _=require('lodash');var util=require(_0x4227('0x0'));var moment=require('moment');var BPromise=require(_0x4227('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4227('0x2'));var db=require(_0x4227('0x3'))['db'];var utils=require(_0x4227('0x4'));var logger=require('../../config/logger')(_0x4227('0x5'));var config=require(_0x4227('0x6'));var jayson=require(_0x4227('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16c8b5,_0x4244f2,_0x45a6a3){return new BPromise(function(_0x1930c5,_0x57b860){return client[_0x4227('0x8')](_0x16c8b5,_0x45a6a3)['then'](function(_0x4044c1){logger[_0x4227('0x9')](_0x4227('0xa'),_0x4244f2,'request\x20sent');logger['debug'](_0x4227('0xb'),_0x4244f2,_0x4227('0xc'),JSON[_0x4227('0xd')](_0x4044c1));if(_0x4044c1[_0x4227('0xe')]){if(_0x4044c1[_0x4227('0xe')][_0x4227('0xf')]===0x1f4){logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x4044c1[_0x4227('0xe')][_0x4227('0x10')]);return _0x57b860(_0x4044c1['error'][_0x4227('0x10')]);}logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x4044c1['error'][_0x4227('0x10')]);return _0x1930c5(_0x4044c1['error'][_0x4227('0x10')]);}else{logger[_0x4227('0x9')]('ChatApplication,\x20%s,\x20%s',_0x4244f2,_0x4227('0xc'));_0x1930c5(_0x4044c1['result'][_0x4227('0x10')]);}})[_0x4227('0x11')](function(_0x16469b){logger[_0x4227('0xe')](_0x4227('0xa'),_0x4244f2,_0x16469b);_0x57b860(_0x16469b);});});} \ No newline at end of file +var _0x12c0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5202a5,_0x1bf2d3){var _0x3a32a8=function(_0x566de0){while(--_0x566de0){_0x5202a5['push'](_0x5202a5['shift']());}};_0x3a32a8(++_0x1bf2d3);}(_0x12c0,0x14a));var _0x012c=function(_0x300cce,_0x2409b4){_0x300cce=_0x300cce-0x0;var _0x484c4f=_0x12c0[_0x300cce];return _0x484c4f;};'use strict';var _=require(_0x012c('0x0'));var util=require(_0x012c('0x1'));var moment=require(_0x012c('0x2'));var BPromise=require(_0x012c('0x3'));var rs=require(_0x012c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x012c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x012c('0x6'))(_0x012c('0x7'));var config=require(_0x012c('0x8'));var jayson=require(_0x012c('0x9'));var client=jayson[_0x012c('0xa')][_0x012c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48a043,_0x2a0683,_0x4a0389){return new BPromise(function(_0x508b97,_0xe581c3){return client['request'](_0x48a043,_0x4a0389)[_0x012c('0xc')](function(_0x2e72f8){logger[_0x012c('0xd')](_0x012c('0xe'),_0x2a0683,'request\x20sent');logger[_0x012c('0xf')](_0x012c('0x10'),_0x2a0683,_0x012c('0x11'),JSON[_0x012c('0x12')](_0x2e72f8));if(_0x2e72f8[_0x012c('0x13')]){if(_0x2e72f8[_0x012c('0x13')][_0x012c('0x14')]===0x1f4){logger[_0x012c('0x13')](_0x012c('0xe'),_0x2a0683,_0x2e72f8[_0x012c('0x13')][_0x012c('0x15')]);return _0xe581c3(_0x2e72f8['error'][_0x012c('0x15')]);}logger['error'](_0x012c('0xe'),_0x2a0683,_0x2e72f8['error']['message']);return _0x508b97(_0x2e72f8['error'][_0x012c('0x15')]);}else{logger[_0x012c('0xd')]('ChatApplication,\x20%s,\x20%s',_0x2a0683,_0x012c('0x11'));_0x508b97(_0x2e72f8[_0x012c('0x16')][_0x012c('0x15')]);}})[_0x012c('0x17')](function(_0x426d22){logger['error'](_0x012c('0xe'),_0x2a0683,_0x426d22);_0xe581c3(_0x426d22);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 498844a..9be21b6 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 _0xab45=['isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x32a0b4,_0x21e432){var _0x2f1523=function(_0x16fc69){while(--_0x16fc69){_0x32a0b4['push'](_0x32a0b4['shift']());}};_0x2f1523(++_0x21e432);}(_0xab45,0x74));var _0x5ab4=function(_0x515343,_0xe470f1){_0x515343=_0x515343-0x0;var _0x1ee29e=_0xab45[_0x515343];return _0x1ee29e;};'use strict';var multer=require(_0x5ab4('0x0'));var util=require(_0x5ab4('0x1'));var path=require(_0x5ab4('0x2'));var timeout=require(_0x5ab4('0x3'));var express=require('express');var router=express[_0x5ab4('0x4')]();var fs_extra=require(_0x5ab4('0x5'));var auth=require(_0x5ab4('0x6'));var interaction=require(_0x5ab4('0x7'));var config=require(_0x5ab4('0x8'));var controller=require(_0x5ab4('0x9'));router['get']('/:id',auth[_0x5ab4('0xa')](),controller[_0x5ab4('0xb')]);router[_0x5ab4('0xc')](_0x5ab4('0xd'),auth[_0x5ab4('0xa')](),controller[_0x5ab4('0xe')]);router[_0x5ab4('0xf')](_0x5ab4('0xd'),auth[_0x5ab4('0xa')](),controller[_0x5ab4('0x10')]);module[_0x5ab4('0x11')]=router; \ No newline at end of file +var _0xad40=['./chatApplication.controller','get','show','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x37cca8,_0x14827c){var _0x594b79=function(_0x113551){while(--_0x113551){_0x37cca8['push'](_0x37cca8['shift']());}};_0x594b79(++_0x14827c);}(_0xad40,0x1ad));var _0x0ad4=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xad40[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0ad4('0x0'));var util=require(_0x0ad4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ad4('0x2'));var router=express[_0x0ad4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0ad4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0ad4('0x5'));router[_0x0ad4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x0ad4('0x7')]);router[_0x0ad4('0x8')](_0x0ad4('0x9'),auth[_0x0ad4('0xa')](),controller['update']);router[_0x0ad4('0xb')]('/:id',auth[_0x0ad4('0xa')](),controller[_0x0ad4('0xc')]);module[_0x0ad4('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b5106ae..0555ae9 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 _0xb9f9=['STRING','BOOLEAN'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xb9f9,0x12c));var _0x9b9f=function(_0x193fae,_0x10a0fe){_0x193fae=_0x193fae-0x0;var _0x27595a=_0xb9f9[_0x193fae];return _0x27595a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9b9f('0x0')]},'write':{'type':Sequelize[_0x9b9f('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf981=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2a023a,_0x4556e1){var _0x11cee6=function(_0x136a76){while(--_0x136a76){_0x2a023a['push'](_0x2a023a['shift']());}};_0x11cee6(++_0x4556e1);}(_0xf981,0xe6));var _0x1f98=function(_0x298a28,_0x288a3c){_0x298a28=_0x298a28-0x0;var _0x577f05=_0xf981[_0x298a28];return _0x577f05;};'use strict';var Sequelize=require(_0x1f98('0x0'));module[_0x1f98('0x1')]={'name':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1f98('0x2')]},'write':{'type':Sequelize[_0x1f98('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 c24cb69..d5c6bf8 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 _0xf5f3=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','include','ChatGroup','rows','catch','show','params','find','create','body','describe','ChatInternalMessage','user','omit','ids','getMembers','findOne','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x53378f,_0x454e2d){var _0x46f24d=function(_0x56d707){while(--_0x56d707){_0x53378f['push'](_0x53378f['shift']());}};_0x46f24d(++_0x454e2d);}(_0xf5f3,0x103));var _0x3f5f=function(_0x3144c3,_0x10fad7){_0x3144c3=_0x3144c3-0x0;var _0x48b358=_0xf5f3[_0x3144c3];return _0x48b358;};'use strict';var emlformat=require(_0x3f5f('0x0'));var rimraf=require(_0x3f5f('0x1'));var zipdir=require(_0x3f5f('0x2'));var jsonpatch=require(_0x3f5f('0x3'));var rp=require(_0x3f5f('0x4'));var moment=require(_0x3f5f('0x5'));var BPromise=require(_0x3f5f('0x6'));var Mustache=require(_0x3f5f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3f5f('0x8'));var csv=require(_0x3f5f('0x9'));var ejs=require(_0x3f5f('0xa'));var fs=require('fs');var fs_extra=require(_0x3f5f('0xb'));var _=require(_0x3f5f('0xc'));var squel=require(_0x3f5f('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f5f('0xe'));var deskjs=require(_0x3f5f('0xf'));var toCsv=require(_0x3f5f('0x9'));var querystring=require(_0x3f5f('0x10'));var Papa=require(_0x3f5f('0x11'));var Redis=require('ioredis');var authService=require(_0x3f5f('0x12'));var qs=require(_0x3f5f('0x13'));var as=require(_0x3f5f('0x14'));var hardwareService=require(_0x3f5f('0x15'));var logger=require(_0x3f5f('0x16'))(_0x3f5f('0x17'));var utils=require(_0x3f5f('0x18'));var config=require(_0x3f5f('0x19'));var licenseUtil=require(_0x3f5f('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3f5f('0x1b')](config[_0x3f5f('0x1c')],{'host':_0x3f5f('0x1d'),'port':0x18eb});var socket=require(_0x3f5f('0x1e'))(new Redis(config[_0x3f5f('0x1c')]));require(_0x3f5f('0x1f'))[_0x3f5f('0x20')](socket);function respondWithStatusCode(_0x169c4e,_0x3324c6){_0x3324c6=_0x3324c6||0xcc;return function(_0x17c42c){if(_0x17c42c){return _0x169c4e[_0x3f5f('0x21')](_0x3324c6);}return _0x169c4e[_0x3f5f('0x22')](_0x3324c6)[_0x3f5f('0x23')]();};}function respondWithResult(_0x5eb8d9,_0x4cb085){_0x4cb085=_0x4cb085||0xc8;return function(_0x46b95b){if(_0x46b95b){return _0x5eb8d9[_0x3f5f('0x22')](_0x4cb085)[_0x3f5f('0x24')](_0x46b95b);}};}function respondWithFilteredResult(_0x70db4a,_0x230295){return function(_0x3f7de0){if(_0x3f7de0){var _0x5875d8=typeof _0x230295[_0x3f5f('0x25')]===_0x3f5f('0x26')&&typeof _0x230295[_0x3f5f('0x27')]===_0x3f5f('0x26');var _0x4ce717=_0x3f7de0[_0x3f5f('0x28')];var _0x2b538f=_0x5875d8?0x0:_0x230295[_0x3f5f('0x25')];var _0xdc24f8=_0x5875d8?_0x3f7de0[_0x3f5f('0x28')]:_0x230295[_0x3f5f('0x25')]+_0x230295['limit'];var _0x2bc593;if(_0xdc24f8>=_0x4ce717){_0xdc24f8=_0x4ce717;_0x2bc593=0xc8;}else{_0x2bc593=0xce;}_0x70db4a['status'](_0x2bc593);return _0x70db4a[_0x3f5f('0x29')](_0x3f5f('0x2a'),_0x2b538f+'-'+_0xdc24f8+'/'+_0x4ce717)[_0x3f5f('0x24')](_0x3f7de0);}return null;};}function patchUpdates(_0x563477){return function(_0x5d7369){try{jsonpatch[_0x3f5f('0x2b')](_0x5d7369,_0x563477,!![]);}catch(_0x2cabd7){return BPromise[_0x3f5f('0x2c')](_0x2cabd7);}return _0x5d7369[_0x3f5f('0x2d')]();};}function saveUpdates(_0x280d61,_0x4d05d3){return function(_0x9e4b){if(_0x9e4b){return _0x9e4b[_0x3f5f('0x2e')](_0x280d61)[_0x3f5f('0x2f')](function(_0x17caf2){return _0x17caf2;});}return null;};}function removeEntity(_0x31c1b4,_0x23fa45){return function(_0x3f432f){if(_0x3f432f){return _0x3f432f[_0x3f5f('0x30')]()['then'](function(){_0x31c1b4[_0x3f5f('0x22')](0xcc)[_0x3f5f('0x23')]();});}};}function handleEntityNotFound(_0x6d4c2b,_0x1d20dd){return function(_0x27931d){if(!_0x27931d){_0x6d4c2b[_0x3f5f('0x21')](0x194);}return _0x27931d;};}function handleError(_0x3183e5,_0x406f7a){_0x406f7a=_0x406f7a||0x1f4;return function(_0x3f9323){logger[_0x3f5f('0x31')](_0x3f9323[_0x3f5f('0x32')]);if(_0x3f9323['name']){delete _0x3f9323['name'];}_0x3183e5[_0x3f5f('0x22')](_0x406f7a)[_0x3f5f('0x33')](_0x3f9323);};}exports[_0x3f5f('0x34')]=function(_0x2bcebc,_0x183254){var _0x126222={},_0x1bc230={},_0x17b93e={'count':0x0,'rows':[]};var _0x1b3e76=_['map'](db['ChatGroup'][_0x3f5f('0x35')],function(_0x239add){return{'name':_0x239add['fieldName'],'type':_0x239add[_0x3f5f('0x36')][_0x3f5f('0x37')]};});_0x1bc230[_0x3f5f('0x38')]=_[_0x3f5f('0x39')](_0x1b3e76,_0x3f5f('0x3a'));_0x1bc230[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x2bcebc[_0x3f5f('0x3b')]);_0x1bc230[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x1bc230[_0x3f5f('0x38')],_0x1bc230[_0x3f5f('0x3b')]);_0x126222[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x1bc230['model'],qs[_0x3f5f('0x40')](_0x2bcebc[_0x3f5f('0x3b')]['fields']));_0x126222[_0x3f5f('0x3f')]=_0x126222[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x126222[_0x3f5f('0x3f')]:_0x1bc230['model'];if(!_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x42')](_0x3f5f('0x43'))){_0x126222[_0x3f5f('0x27')]=qs[_0x3f5f('0x27')](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x27')]);_0x126222[_0x3f5f('0x25')]=qs['offset'](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x25')]);}_0x126222[_0x3f5f('0x44')]=qs[_0x3f5f('0x45')](_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x45')]);_0x126222['where']=qs['filters'](_['pick'](_0x2bcebc['query'],_0x1bc230[_0x3f5f('0x3d')]),_0x1b3e76);if(_0x2bcebc[_0x3f5f('0x3b')][_0x3f5f('0x46')]){_0x126222['where']=_[_0x3f5f('0x47')](_0x126222['where'],{'$or':_[_0x3f5f('0x39')](_0x1b3e76,function(_0x113cb6){if(_0x113cb6[_0x3f5f('0x36')]!==_0x3f5f('0x48')){var _0x516f70={};_0x516f70[_0x113cb6[_0x3f5f('0x3a')]]={'$like':'%'+_0x2bcebc[_0x3f5f('0x3b')]['filter']+'%'};return _0x516f70;}})});}_0x126222=_[_0x3f5f('0x47')]({},_0x126222,_0x2bcebc[_0x3f5f('0x49')]);var _0x1010a6={'where':_0x126222[_0x3f5f('0x4a')]};return db['ChatGroup'][_0x3f5f('0x28')](_0x1010a6)[_0x3f5f('0x2f')](function(_0xa5f550){_0x17b93e['count']=_0xa5f550;if(_0x2bcebc['query']['includeAll']){_0x126222[_0x3f5f('0x4b')]=[{'all':!![]}];}return db[_0x3f5f('0x4c')]['findAll'](_0x126222);})[_0x3f5f('0x2f')](function(_0xd1aaf3){_0x17b93e[_0x3f5f('0x4d')]=_0xd1aaf3;return _0x17b93e;})[_0x3f5f('0x2f')](respondWithFilteredResult(_0x183254,_0x126222))[_0x3f5f('0x4e')](handleError(_0x183254,null));};exports[_0x3f5f('0x4f')]=function(_0x1c2355,_0x34cab6){var _0x5ad731={'raw':!![],'where':{'id':_0x1c2355[_0x3f5f('0x50')]['id']}},_0x18d187={};_0x18d187[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db[_0x3f5f('0x4c')][_0x3f5f('0x35')]);_0x18d187[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x1c2355[_0x3f5f('0x3b')]);_0x18d187[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x18d187[_0x3f5f('0x38')],_0x18d187[_0x3f5f('0x3b')]);_0x5ad731[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x18d187[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x1c2355['query'][_0x3f5f('0x40')]));_0x5ad731[_0x3f5f('0x3f')]=_0x5ad731[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x5ad731[_0x3f5f('0x3f')]:_0x18d187[_0x3f5f('0x38')];if(_0x1c2355[_0x3f5f('0x3b')]['includeAll']){_0x5ad731[_0x3f5f('0x4b')]=[{'all':!![]}];}_0x5ad731=_[_0x3f5f('0x47')]({},_0x5ad731,_0x1c2355['options']);return db[_0x3f5f('0x4c')][_0x3f5f('0x51')](_0x5ad731)[_0x3f5f('0x2f')](handleEntityNotFound(_0x34cab6,null))[_0x3f5f('0x2f')](respondWithResult(_0x34cab6,null))[_0x3f5f('0x4e')](handleError(_0x34cab6,null));};exports[_0x3f5f('0x52')]=function(_0x1d207f,_0x372958){return db[_0x3f5f('0x4c')][_0x3f5f('0x52')](_0x1d207f[_0x3f5f('0x53')],{})['then'](respondWithResult(_0x372958,0xc9))['catch'](handleError(_0x372958,null));};exports[_0x3f5f('0x2e')]=function(_0x51b04d,_0x3549a4){if(_0x51b04d[_0x3f5f('0x53')]['id']){delete _0x51b04d[_0x3f5f('0x53')]['id'];}return db[_0x3f5f('0x4c')]['find']({'where':{'id':_0x51b04d['params']['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x3549a4,null))['then'](saveUpdates(_0x51b04d['body'],null))[_0x3f5f('0x2f')](respondWithResult(_0x3549a4,null))['catch'](handleError(_0x3549a4,null));};exports[_0x3f5f('0x30')]=function(_0x7a3ba6,_0x91dc9e){return db[_0x3f5f('0x4c')]['find']({'where':{'id':_0x7a3ba6[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x91dc9e,null))[_0x3f5f('0x2f')](removeEntity(_0x91dc9e,null))[_0x3f5f('0x4e')](handleError(_0x91dc9e,null));};exports[_0x3f5f('0x54')]=function(_0x10a848,_0x2a075a){return db[_0x3f5f('0x4c')][_0x3f5f('0x54')]()['then'](respondWithResult(_0x2a075a,null))[_0x3f5f('0x4e')](handleError(_0x2a075a,null));};exports['getUnread']=function(_0x53fcb6,_0x43f71d,_0x1afe3d){return db[_0x3f5f('0x55')]['count']({'where':{'ChatGroupId':_0x53fcb6[_0x3f5f('0x50')]['id'],'ToId':_0x53fcb6[_0x3f5f('0x56')]['id'],'read':![]}})[_0x3f5f('0x2f')](function(_0x1f82c1){return{'id':_['toInteger'](_0x53fcb6[_0x3f5f('0x50')]['id']),'count':_0x1f82c1};})[_0x3f5f('0x2f')](respondWithResult(_0x43f71d,null))['catch'](handleError(_0x43f71d,null));};exports['addMembers']=function(_0xdabfa7,_0x43a505,_0x542d7b){return db[_0x3f5f('0x4c')][_0x3f5f('0x51')]({'where':{'id':_0xdabfa7[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x43a505,null))[_0x3f5f('0x2f')](function(_0x11e42e){if(_0x11e42e){return _0x11e42e['addMembers'](_0xdabfa7['body']['ids'],_[_0x3f5f('0x57')](_0xdabfa7[_0x3f5f('0x53')],[_0x3f5f('0x58'),'id'])||{});}})[_0x3f5f('0x2f')](respondWithResult(_0x43a505,null))[_0x3f5f('0x4e')](handleError(_0x43a505,null));};exports[_0x3f5f('0x59')]=function(_0x1c0633,_0x16eb7d,_0x460ae1){var _0x549b13={};var _0x59b43d={};var _0x343acb;var _0x502416;return db[_0x3f5f('0x4c')][_0x3f5f('0x5a')]({'where':{'id':_0x1c0633[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x16eb7d,null))[_0x3f5f('0x2f')](function(_0x1fb4bc){if(_0x1fb4bc){_0x343acb=_0x1fb4bc;_0x59b43d[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db['User'][_0x3f5f('0x35')]);_0x59b43d[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x1c0633['query']);_0x59b43d[_0x3f5f('0x3d')]=_['intersection'](_0x59b43d['model'],_0x59b43d[_0x3f5f('0x3b')]);_0x549b13[_0x3f5f('0x3f')]=_['intersection'](_0x59b43d[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x40')]));_0x549b13[_0x3f5f('0x3f')]=_0x549b13['attributes'][_0x3f5f('0x41')]?_0x549b13[_0x3f5f('0x3f')]:_0x59b43d[_0x3f5f('0x38')];_0x549b13['order']=qs[_0x3f5f('0x45')](_0x1c0633['query']['sort']);_0x549b13['where']=qs[_0x3f5f('0x3d')](_[_0x3f5f('0x5b')](_0x1c0633['query'],_0x59b43d[_0x3f5f('0x3d')]));if(_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x46')]){_0x549b13[_0x3f5f('0x4a')]=_[_0x3f5f('0x47')](_0x549b13['where'],{'$or':_[_0x3f5f('0x39')](_0x549b13[_0x3f5f('0x3f')],function(_0x410c80){var _0x3bd391={};_0x3bd391[_0x410c80]={'$like':'%'+_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x46')]+'%'};return _0x3bd391;})});}_0x549b13=_['merge']({},_0x549b13,_0x1c0633['options']);return _0x343acb[_0x3f5f('0x59')](_0x549b13);}})[_0x3f5f('0x2f')](function(_0x131b23){if(_0x131b23){_0x502416=_0x131b23[_0x3f5f('0x41')];if(!_0x1c0633[_0x3f5f('0x3b')]['hasOwnProperty'](_0x3f5f('0x43'))){_0x549b13[_0x3f5f('0x27')]=qs[_0x3f5f('0x27')](_0x1c0633[_0x3f5f('0x3b')][_0x3f5f('0x27')]);_0x549b13[_0x3f5f('0x25')]=qs['offset'](_0x1c0633[_0x3f5f('0x3b')]['offset']);}return _0x343acb[_0x3f5f('0x59')](_0x549b13);}})[_0x3f5f('0x2f')](function(_0x353cf8){if(_0x353cf8){return _0x353cf8?{'count':_0x502416,'rows':_0x353cf8}:null;}})[_0x3f5f('0x2f')](respondWithResult(_0x16eb7d,null))['catch'](handleError(_0x16eb7d,null));};exports[_0x3f5f('0x5c')]=function(_0x21e696,_0x330bc2,_0x36952d){return db[_0x3f5f('0x4c')][_0x3f5f('0x51')]({'where':{'id':_0x21e696[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x330bc2,null))[_0x3f5f('0x2f')](function(_0x358f16){if(_0x358f16){return _0x358f16[_0x3f5f('0x5c')](_0x21e696['query'][_0x3f5f('0x58')]);}})[_0x3f5f('0x2f')](respondWithStatusCode(_0x330bc2,null))[_0x3f5f('0x4e')](handleError(_0x330bc2,null));};exports[_0x3f5f('0x5d')]=function(_0x56319f,_0x20d648,_0x448b4d){if(_0x56319f[_0x3f5f('0x53')]['id']){delete _0x56319f[_0x3f5f('0x53')]['id'];}return db['ChatGroup'][_0x3f5f('0x51')]({'where':{'id':_0x56319f[_0x3f5f('0x50')]['id']}})[_0x3f5f('0x2f')](handleEntityNotFound(_0x20d648,null))['then'](function(_0x5792c9){if(_0x5792c9){_0x56319f[_0x3f5f('0x53')][_0x3f5f('0x5e')]=_0x5792c9['id'];return db[_0x3f5f('0x55')]['create'](_0x56319f[_0x3f5f('0x53')]);}})[_0x3f5f('0x2f')](respondWithResult(_0x20d648,null))['catch'](handleError(_0x20d648,null));};exports[_0x3f5f('0x5f')]=function(_0x276e2e,_0x4a290c,_0x55b193){var _0x5bcc41={};var _0x5267d7={};var _0x50af4a;var _0xee38a3;return db[_0x3f5f('0x4c')][_0x3f5f('0x5a')]({'where':{'id':_0x276e2e['params']['id']}})['then'](handleEntityNotFound(_0x4a290c,null))[_0x3f5f('0x2f')](function(_0x27823a){if(_0x27823a){_0x50af4a=_0x27823a;_0x5267d7[_0x3f5f('0x38')]=_[_0x3f5f('0x3c')](db[_0x3f5f('0x55')][_0x3f5f('0x35')]);_0x5267d7[_0x3f5f('0x3b')]=_[_0x3f5f('0x3c')](_0x276e2e[_0x3f5f('0x3b')]);_0x5267d7[_0x3f5f('0x3d')]=_[_0x3f5f('0x3e')](_0x5267d7[_0x3f5f('0x38')],_0x5267d7['query']);_0x5bcc41[_0x3f5f('0x3f')]=_[_0x3f5f('0x3e')](_0x5267d7[_0x3f5f('0x38')],qs[_0x3f5f('0x40')](_0x276e2e[_0x3f5f('0x3b')][_0x3f5f('0x40')]));_0x5bcc41['attributes']=_0x5bcc41[_0x3f5f('0x3f')][_0x3f5f('0x41')]?_0x5bcc41[_0x3f5f('0x3f')]:_0x5267d7[_0x3f5f('0x38')];_0x5bcc41[_0x3f5f('0x44')]=qs[_0x3f5f('0x45')](_0x276e2e[_0x3f5f('0x3b')]['sort']);_0x5bcc41[_0x3f5f('0x4a')]=qs[_0x3f5f('0x3d')](_[_0x3f5f('0x5b')](_0x276e2e['query'],_0x5267d7['filters']));if(_0x276e2e['query'][_0x3f5f('0x46')]){_0x5bcc41[_0x3f5f('0x4a')]=_['merge'](_0x5bcc41[_0x3f5f('0x4a')],{'$or':_[_0x3f5f('0x39')](_0x5bcc41['attributes'],function(_0x544c07){var _0x30db18={};_0x30db18[_0x544c07]={'$like':'%'+_0x276e2e['query'][_0x3f5f('0x46')]+'%'};return _0x30db18;})});}if(_0x276e2e['query'][_0x3f5f('0x60')]){var _0x24e0d9=_0x276e2e[_0x3f5f('0x3b')]['$gte'][_0x3f5f('0x61')](',');var _0x5dca77={};_0x5dca77[_0x24e0d9[0x0]]={'$gte':moment(_0x24e0d9[0x1])[_0x3f5f('0x62')](_0x3f5f('0x63'))};_0x5bcc41[_0x3f5f('0x4a')]=_[_0x3f5f('0x47')](_0x5bcc41[_0x3f5f('0x4a')],_0x5dca77);}_0x5bcc41=_['merge']({},_0x5bcc41,_0x276e2e[_0x3f5f('0x49')]);return _0x50af4a['getMessages'](_0x5bcc41);}})[_0x3f5f('0x2f')](function(_0x4882c1){if(_0x4882c1){_0xee38a3=_0x4882c1[_0x3f5f('0x41')];if(!_0x276e2e[_0x3f5f('0x3b')][_0x3f5f('0x42')](_0x3f5f('0x43'))){_0x5bcc41['limit']=qs[_0x3f5f('0x27')](_0x276e2e[_0x3f5f('0x3b')]['limit']);_0x5bcc41[_0x3f5f('0x25')]=qs['offset'](_0x276e2e[_0x3f5f('0x3b')]['offset']);}return _0x50af4a[_0x3f5f('0x5f')](_0x5bcc41);}})[_0x3f5f('0x2f')](function(_0x15b51d){if(_0x15b51d){return _0x15b51d?{'count':_0xee38a3,'rows':_0x15b51d}:null;}})[_0x3f5f('0x2f')](respondWithResult(_0x4a290c,null))[_0x3f5f('0x4e')](handleError(_0x4a290c,null));}; \ No newline at end of file +var _0x766a=['limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','user','toInteger','addMembers','getMembers','findOne','User','sort','removeMembers','ids','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x5713e3,_0x26a7b6){var _0x3fa356=function(_0x1e16b1){while(--_0x1e16b1){_0x5713e3['push'](_0x5713e3['shift']());}};_0x3fa356(++_0x26a7b6);}(_0x766a,0x1eb));var _0xa766=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0x766a[_0x53ad58];return _0x554b03;};'use strict';var emlformat=require(_0xa766('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa766('0x1'));var rp=require('request-promise');var moment=require(_0xa766('0x2'));var BPromise=require(_0xa766('0x3'));var Mustache=require(_0xa766('0x4'));var util=require(_0xa766('0x5'));var path=require(_0xa766('0x6'));var sox=require(_0xa766('0x7'));var csv=require(_0xa766('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa766('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa766('0xa'));var jsforce=require(_0xa766('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa766('0x8'));var querystring=require('querystring');var Papa=require(_0xa766('0xc'));var Redis=require(_0xa766('0xd'));var authService=require(_0xa766('0xe'));var qs=require(_0xa766('0xf'));var as=require(_0xa766('0x10'));var hardwareService=require(_0xa766('0x11'));var logger=require('../../config/logger')(_0xa766('0x12'));var utils=require('../../config/utils');var config=require(_0xa766('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa766('0x14')]=_[_0xa766('0x15')](config['redis'],{'host':_0xa766('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa766('0x14')]));require(_0xa766('0x17'))[_0xa766('0x18')](socket);function respondWithStatusCode(_0x382269,_0x2c2188){_0x2c2188=_0x2c2188||0xcc;return function(_0x4d2a7a){if(_0x4d2a7a){return _0x382269[_0xa766('0x19')](_0x2c2188);}return _0x382269[_0xa766('0x1a')](_0x2c2188)[_0xa766('0x1b')]();};}function respondWithResult(_0x29d314,_0x49bc0f){_0x49bc0f=_0x49bc0f||0xc8;return function(_0x3acc44){if(_0x3acc44){return _0x29d314[_0xa766('0x1a')](_0x49bc0f)[_0xa766('0x1c')](_0x3acc44);}};}function respondWithFilteredResult(_0x316667,_0x58e701){return function(_0x2bb1e8){if(_0x2bb1e8){var _0x545b5a=typeof _0x58e701[_0xa766('0x1d')]===_0xa766('0x1e')&&typeof _0x58e701[_0xa766('0x1f')]===_0xa766('0x1e');var _0x530179=_0x2bb1e8[_0xa766('0x20')];var _0x4e1338=_0x545b5a?0x0:_0x58e701[_0xa766('0x1d')];var _0x3374f9=_0x545b5a?_0x2bb1e8['count']:_0x58e701[_0xa766('0x1d')]+_0x58e701['limit'];var _0x149be1;if(_0x3374f9>=_0x530179){_0x3374f9=_0x530179;_0x149be1=0xc8;}else{_0x149be1=0xce;}_0x316667['status'](_0x149be1);return _0x316667[_0xa766('0x21')](_0xa766('0x22'),_0x4e1338+'-'+_0x3374f9+'/'+_0x530179)['json'](_0x2bb1e8);}return null;};}function patchUpdates(_0x46bfc0){return function(_0x111acd){try{jsonpatch[_0xa766('0x23')](_0x111acd,_0x46bfc0,!![]);}catch(_0x28e80a){return BPromise[_0xa766('0x24')](_0x28e80a);}return _0x111acd['save']();};}function saveUpdates(_0x3f1bc4,_0x1a3599){return function(_0x32b321){if(_0x32b321){return _0x32b321['update'](_0x3f1bc4)[_0xa766('0x25')](function(_0x1af044){return _0x1af044;});}return null;};}function removeEntity(_0x2c83ee,_0x1bef8a){return function(_0x1e9fe2){if(_0x1e9fe2){return _0x1e9fe2[_0xa766('0x26')]()[_0xa766('0x25')](function(){_0x2c83ee[_0xa766('0x1a')](0xcc)[_0xa766('0x1b')]();});}};}function handleEntityNotFound(_0x3d7bd8,_0x7c00cb){return function(_0x1dbda9){if(!_0x1dbda9){_0x3d7bd8[_0xa766('0x19')](0x194);}return _0x1dbda9;};}function handleError(_0x26f5f5,_0x88925d){_0x88925d=_0x88925d||0x1f4;return function(_0xb27ea3){logger[_0xa766('0x27')](_0xb27ea3['stack']);if(_0xb27ea3[_0xa766('0x28')]){delete _0xb27ea3[_0xa766('0x28')];}_0x26f5f5['status'](_0x88925d)[_0xa766('0x29')](_0xb27ea3);};}exports['index']=function(_0x3bb6f4,_0x54b802){var _0x35429d={},_0x522d77={},_0x113807={'count':0x0,'rows':[]};var _0x491578=_[_0xa766('0x2a')](db[_0xa766('0x2b')][_0xa766('0x2c')],function(_0x4501ff){return{'name':_0x4501ff['fieldName'],'type':_0x4501ff[_0xa766('0x2d')]['key']};});_0x522d77[_0xa766('0x2e')]=_[_0xa766('0x2a')](_0x491578,_0xa766('0x28'));_0x522d77[_0xa766('0x2f')]=_[_0xa766('0x30')](_0x3bb6f4[_0xa766('0x2f')]);_0x522d77[_0xa766('0x31')]=_[_0xa766('0x32')](_0x522d77[_0xa766('0x2e')],_0x522d77['query']);_0x35429d[_0xa766('0x33')]=_[_0xa766('0x32')](_0x522d77[_0xa766('0x2e')],qs['fields'](_0x3bb6f4[_0xa766('0x2f')][_0xa766('0x34')]));_0x35429d[_0xa766('0x33')]=_0x35429d[_0xa766('0x33')][_0xa766('0x35')]?_0x35429d['attributes']:_0x522d77[_0xa766('0x2e')];if(!_0x3bb6f4[_0xa766('0x2f')]['hasOwnProperty'](_0xa766('0x36'))){_0x35429d[_0xa766('0x1f')]=qs[_0xa766('0x1f')](_0x3bb6f4['query'][_0xa766('0x1f')]);_0x35429d[_0xa766('0x1d')]=qs['offset'](_0x3bb6f4[_0xa766('0x2f')][_0xa766('0x1d')]);}_0x35429d[_0xa766('0x37')]=qs['sort'](_0x3bb6f4[_0xa766('0x2f')]['sort']);_0x35429d[_0xa766('0x38')]=qs[_0xa766('0x31')](_[_0xa766('0x39')](_0x3bb6f4[_0xa766('0x2f')],_0x522d77[_0xa766('0x31')]),_0x491578);if(_0x3bb6f4[_0xa766('0x2f')][_0xa766('0x3a')]){_0x35429d[_0xa766('0x38')]=_[_0xa766('0x3b')](_0x35429d[_0xa766('0x38')],{'$or':_[_0xa766('0x2a')](_0x491578,function(_0x434aa7){if(_0x434aa7[_0xa766('0x2d')]!==_0xa766('0x3c')){var _0x5766a4={};_0x5766a4[_0x434aa7[_0xa766('0x28')]]={'$like':'%'+_0x3bb6f4[_0xa766('0x2f')][_0xa766('0x3a')]+'%'};return _0x5766a4;}})});}_0x35429d=_[_0xa766('0x3b')]({},_0x35429d,_0x3bb6f4['options']);var _0x422baf={'where':_0x35429d[_0xa766('0x38')]};return db[_0xa766('0x2b')][_0xa766('0x20')](_0x422baf)[_0xa766('0x25')](function(_0x5d5186){_0x113807[_0xa766('0x20')]=_0x5d5186;if(_0x3bb6f4[_0xa766('0x2f')][_0xa766('0x3d')]){_0x35429d['include']=[{'all':!![]}];}return db['ChatGroup'][_0xa766('0x3e')](_0x35429d);})[_0xa766('0x25')](function(_0x3f07ef){_0x113807[_0xa766('0x3f')]=_0x3f07ef;return _0x113807;})['then'](respondWithFilteredResult(_0x54b802,_0x35429d))[_0xa766('0x40')](handleError(_0x54b802,null));};exports[_0xa766('0x41')]=function(_0x4fc267,_0x29d9e4){var _0x146256={'raw':!![],'where':{'id':_0x4fc267[_0xa766('0x42')]['id']}},_0x3faea8={};_0x3faea8[_0xa766('0x2e')]=_[_0xa766('0x30')](db['ChatGroup'][_0xa766('0x2c')]);_0x3faea8['query']=_['keys'](_0x4fc267[_0xa766('0x2f')]);_0x3faea8[_0xa766('0x31')]=_[_0xa766('0x32')](_0x3faea8[_0xa766('0x2e')],_0x3faea8[_0xa766('0x2f')]);_0x146256['attributes']=_[_0xa766('0x32')](_0x3faea8[_0xa766('0x2e')],qs[_0xa766('0x34')](_0x4fc267['query'][_0xa766('0x34')]));_0x146256[_0xa766('0x33')]=_0x146256['attributes'][_0xa766('0x35')]?_0x146256[_0xa766('0x33')]:_0x3faea8[_0xa766('0x2e')];if(_0x4fc267[_0xa766('0x2f')][_0xa766('0x3d')]){_0x146256[_0xa766('0x43')]=[{'all':!![]}];}_0x146256=_['merge']({},_0x146256,_0x4fc267[_0xa766('0x44')]);return db[_0xa766('0x2b')]['find'](_0x146256)[_0xa766('0x25')](handleEntityNotFound(_0x29d9e4,null))[_0xa766('0x25')](respondWithResult(_0x29d9e4,null))['catch'](handleError(_0x29d9e4,null));};exports[_0xa766('0x45')]=function(_0x276147,_0x891da0){return db['ChatGroup'][_0xa766('0x45')](_0x276147[_0xa766('0x46')],{})[_0xa766('0x25')](respondWithResult(_0x891da0,0xc9))[_0xa766('0x40')](handleError(_0x891da0,null));};exports['update']=function(_0x1599f1,_0x3e002b){if(_0x1599f1[_0xa766('0x46')]['id']){delete _0x1599f1[_0xa766('0x46')]['id'];}return db['ChatGroup'][_0xa766('0x47')]({'where':{'id':_0x1599f1[_0xa766('0x42')]['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x3e002b,null))[_0xa766('0x25')](saveUpdates(_0x1599f1[_0xa766('0x46')],null))[_0xa766('0x25')](respondWithResult(_0x3e002b,null))[_0xa766('0x40')](handleError(_0x3e002b,null));};exports[_0xa766('0x26')]=function(_0x307063,_0x5907ca){return db[_0xa766('0x2b')][_0xa766('0x47')]({'where':{'id':_0x307063[_0xa766('0x42')]['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x5907ca,null))['then'](removeEntity(_0x5907ca,null))[_0xa766('0x40')](handleError(_0x5907ca,null));};exports['describe']=function(_0x3318f8,_0x36e437){return db[_0xa766('0x2b')]['describe']()['then'](respondWithResult(_0x36e437,null))[_0xa766('0x40')](handleError(_0x36e437,null));};exports['getUnread']=function(_0x1f3711,_0x3a13b4,_0x1bb74d){return db['ChatInternalMessage'][_0xa766('0x20')]({'where':{'ChatGroupId':_0x1f3711['params']['id'],'ToId':_0x1f3711[_0xa766('0x48')]['id'],'read':![]}})[_0xa766('0x25')](function(_0x3ad5f7){return{'id':_[_0xa766('0x49')](_0x1f3711[_0xa766('0x42')]['id']),'count':_0x3ad5f7};})[_0xa766('0x25')](respondWithResult(_0x3a13b4,null))['catch'](handleError(_0x3a13b4,null));};exports[_0xa766('0x4a')]=function(_0x5244a1,_0x9cba54,_0x2f0b21){return db[_0xa766('0x2b')][_0xa766('0x47')]({'where':{'id':_0x5244a1['params']['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x9cba54,null))[_0xa766('0x25')](function(_0x128fe0){if(_0x128fe0){return _0x128fe0[_0xa766('0x4a')](_0x5244a1['body']['ids'],_['omit'](_0x5244a1['body'],['ids','id'])||{});}})[_0xa766('0x25')](respondWithResult(_0x9cba54,null))[_0xa766('0x40')](handleError(_0x9cba54,null));};exports[_0xa766('0x4b')]=function(_0x599b53,_0x47546e,_0x45d1f4){var _0x30106c={};var _0x1b6514={};var _0x3def3e;var _0x11f854;return db[_0xa766('0x2b')][_0xa766('0x4c')]({'where':{'id':_0x599b53[_0xa766('0x42')]['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x47546e,null))[_0xa766('0x25')](function(_0x42f145){if(_0x42f145){_0x3def3e=_0x42f145;_0x1b6514[_0xa766('0x2e')]=_[_0xa766('0x30')](db[_0xa766('0x4d')][_0xa766('0x2c')]);_0x1b6514[_0xa766('0x2f')]=_[_0xa766('0x30')](_0x599b53['query']);_0x1b6514[_0xa766('0x31')]=_[_0xa766('0x32')](_0x1b6514[_0xa766('0x2e')],_0x1b6514[_0xa766('0x2f')]);_0x30106c[_0xa766('0x33')]=_[_0xa766('0x32')](_0x1b6514[_0xa766('0x2e')],qs[_0xa766('0x34')](_0x599b53[_0xa766('0x2f')][_0xa766('0x34')]));_0x30106c[_0xa766('0x33')]=_0x30106c[_0xa766('0x33')]['length']?_0x30106c[_0xa766('0x33')]:_0x1b6514[_0xa766('0x2e')];_0x30106c['order']=qs[_0xa766('0x4e')](_0x599b53[_0xa766('0x2f')][_0xa766('0x4e')]);_0x30106c['where']=qs[_0xa766('0x31')](_[_0xa766('0x39')](_0x599b53[_0xa766('0x2f')],_0x1b6514[_0xa766('0x31')]));if(_0x599b53[_0xa766('0x2f')]['filter']){_0x30106c[_0xa766('0x38')]=_[_0xa766('0x3b')](_0x30106c[_0xa766('0x38')],{'$or':_['map'](_0x30106c[_0xa766('0x33')],function(_0x4a03a1){var _0x3646ff={};_0x3646ff[_0x4a03a1]={'$like':'%'+_0x599b53[_0xa766('0x2f')]['filter']+'%'};return _0x3646ff;})});}_0x30106c=_[_0xa766('0x3b')]({},_0x30106c,_0x599b53[_0xa766('0x44')]);return _0x3def3e[_0xa766('0x4b')](_0x30106c);}})[_0xa766('0x25')](function(_0x417283){if(_0x417283){_0x11f854=_0x417283[_0xa766('0x35')];if(!_0x599b53[_0xa766('0x2f')]['hasOwnProperty'](_0xa766('0x36'))){_0x30106c[_0xa766('0x1f')]=qs['limit'](_0x599b53[_0xa766('0x2f')][_0xa766('0x1f')]);_0x30106c[_0xa766('0x1d')]=qs[_0xa766('0x1d')](_0x599b53[_0xa766('0x2f')][_0xa766('0x1d')]);}return _0x3def3e[_0xa766('0x4b')](_0x30106c);}})[_0xa766('0x25')](function(_0x34872c){if(_0x34872c){return _0x34872c?{'count':_0x11f854,'rows':_0x34872c}:null;}})['then'](respondWithResult(_0x47546e,null))[_0xa766('0x40')](handleError(_0x47546e,null));};exports[_0xa766('0x4f')]=function(_0x2308d6,_0x47d362,_0x51f519){return db[_0xa766('0x2b')][_0xa766('0x47')]({'where':{'id':_0x2308d6[_0xa766('0x42')]['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x47d362,null))['then'](function(_0x55748c){if(_0x55748c){return _0x55748c[_0xa766('0x4f')](_0x2308d6[_0xa766('0x2f')][_0xa766('0x50')]);}})[_0xa766('0x25')](respondWithStatusCode(_0x47d362,null))[_0xa766('0x40')](handleError(_0x47d362,null));};exports[_0xa766('0x51')]=function(_0x4070ae,_0x120229,_0x221b0b){if(_0x4070ae[_0xa766('0x46')]['id']){delete _0x4070ae[_0xa766('0x46')]['id'];}return db[_0xa766('0x2b')][_0xa766('0x47')]({'where':{'id':_0x4070ae[_0xa766('0x42')]['id']}})['then'](handleEntityNotFound(_0x120229,null))[_0xa766('0x25')](function(_0x45f6d4){if(_0x45f6d4){_0x4070ae[_0xa766('0x46')][_0xa766('0x52')]=_0x45f6d4['id'];return db[_0xa766('0x53')]['create'](_0x4070ae[_0xa766('0x46')]);}})[_0xa766('0x25')](respondWithResult(_0x120229,null))[_0xa766('0x40')](handleError(_0x120229,null));};exports[_0xa766('0x54')]=function(_0x3a4803,_0x5060ba,_0x2e8ce7){var _0x4641c1={};var _0x549685={};var _0x55216f;var _0x1de0fd;return db[_0xa766('0x2b')][_0xa766('0x4c')]({'where':{'id':_0x3a4803[_0xa766('0x42')]['id']}})[_0xa766('0x25')](handleEntityNotFound(_0x5060ba,null))[_0xa766('0x25')](function(_0x5a3094){if(_0x5a3094){_0x55216f=_0x5a3094;_0x549685[_0xa766('0x2e')]=_['keys'](db['ChatInternalMessage'][_0xa766('0x2c')]);_0x549685[_0xa766('0x2f')]=_[_0xa766('0x30')](_0x3a4803[_0xa766('0x2f')]);_0x549685[_0xa766('0x31')]=_['intersection'](_0x549685['model'],_0x549685['query']);_0x4641c1[_0xa766('0x33')]=_['intersection'](_0x549685['model'],qs[_0xa766('0x34')](_0x3a4803[_0xa766('0x2f')][_0xa766('0x34')]));_0x4641c1[_0xa766('0x33')]=_0x4641c1[_0xa766('0x33')][_0xa766('0x35')]?_0x4641c1[_0xa766('0x33')]:_0x549685[_0xa766('0x2e')];_0x4641c1[_0xa766('0x37')]=qs[_0xa766('0x4e')](_0x3a4803[_0xa766('0x2f')][_0xa766('0x4e')]);_0x4641c1['where']=qs[_0xa766('0x31')](_[_0xa766('0x39')](_0x3a4803[_0xa766('0x2f')],_0x549685[_0xa766('0x31')]));if(_0x3a4803[_0xa766('0x2f')]['filter']){_0x4641c1[_0xa766('0x38')]=_[_0xa766('0x3b')](_0x4641c1[_0xa766('0x38')],{'$or':_[_0xa766('0x2a')](_0x4641c1['attributes'],function(_0x36177a){var _0x11c61d={};_0x11c61d[_0x36177a]={'$like':'%'+_0x3a4803[_0xa766('0x2f')][_0xa766('0x3a')]+'%'};return _0x11c61d;})});}if(_0x3a4803['query'][_0xa766('0x55')]){var _0x3979a7=_0x3a4803[_0xa766('0x2f')][_0xa766('0x55')][_0xa766('0x56')](',');var _0x6a6b36={};_0x6a6b36[_0x3979a7[0x0]]={'$gte':moment(_0x3979a7[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4641c1[_0xa766('0x38')]=_[_0xa766('0x3b')](_0x4641c1[_0xa766('0x38')],_0x6a6b36);}_0x4641c1=_[_0xa766('0x3b')]({},_0x4641c1,_0x3a4803[_0xa766('0x44')]);return _0x55216f['getMessages'](_0x4641c1);}})[_0xa766('0x25')](function(_0x223205){if(_0x223205){_0x1de0fd=_0x223205[_0xa766('0x35')];if(!_0x3a4803['query']['hasOwnProperty'](_0xa766('0x36'))){_0x4641c1[_0xa766('0x1f')]=qs['limit'](_0x3a4803[_0xa766('0x2f')][_0xa766('0x1f')]);_0x4641c1['offset']=qs['offset'](_0x3a4803['query']['offset']);}return _0x55216f['getMessages'](_0x4641c1);}})[_0xa766('0x25')](function(_0x1bcfac){if(_0x1bcfac){return _0x1bcfac?{'count':_0x1de0fd,'rows':_0x1bcfac}:null;}})[_0xa766('0x25')](respondWithResult(_0x5060ba,null))['catch'](handleError(_0x5060ba,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1da8274..1631d76 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 _0xb89c=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0xb89c,0x198));var _0xcb89=function(_0x175d5b,_0xed7d1a){_0x175d5b=_0x175d5b-0x0;var _0x8ace7e=_0xb89c[_0x175d5b];return _0x8ace7e;};'use strict';var EventEmitter=require(_0xcb89('0x0'));var ChatGroup=require(_0xcb89('0x1'))['db'][_0xcb89('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcb89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb89('0x4'),'afterDestroy':_0xcb89('0x5')};function emitEvent(_0x57c08c){return function(_0x387b27,_0x777f33,_0x49bdbe){ChatGroupEvents['emit'](_0x57c08c+':'+_0x387b27['id'],_0x387b27);ChatGroupEvents['emit'](_0x57c08c,_0x387b27);_0x49bdbe(null);};}for(var e in events){if(events[_0xcb89('0x6')](e)){var event=events[e];ChatGroup[_0xcb89('0x7')](e,emitEvent(event));}}module[_0xcb89('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x58d5=['../../mysqldb','ChatGroup','save','update','remove','emit','exports','events'];(function(_0x3113ae,_0x2ec7a8){var _0x46a2ee=function(_0x516acb){while(--_0x516acb){_0x3113ae['push'](_0x3113ae['shift']());}};_0x46a2ee(++_0x2ec7a8);}(_0x58d5,0x107));var _0x558d=function(_0xc218f7,_0x2e25ba){_0xc218f7=_0xc218f7-0x0;var _0x1043a1=_0x58d5[_0xc218f7];return _0x1043a1;};'use strict';var EventEmitter=require(_0x558d('0x0'));var ChatGroup=require(_0x558d('0x1'))['db'][_0x558d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x558d('0x3'),'afterUpdate':_0x558d('0x4'),'afterDestroy':_0x558d('0x5')};function emitEvent(_0x34b2b0){return function(_0x52b448,_0x3ebb20,_0x1c07cd){ChatGroupEvents[_0x558d('0x6')](_0x34b2b0+':'+_0x52b448['id'],_0x52b448);ChatGroupEvents['emit'](_0x34b2b0,_0x52b448);_0x1c07cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x558d('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 9ff1622..39e89e1 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 _0xa9a1=['define','ChatGroup','chat_groups','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports'];(function(_0x39658b,_0xf72a7f){var _0xa37442=function(_0x2edfaf){while(--_0x2edfaf){_0x39658b['push'](_0x39658b['shift']());}};_0xa37442(++_0xf72a7f);}(_0xa9a1,0xcf));var _0x1a9a=function(_0xada965,_0x1a2235){_0xada965=_0xada965-0x0;var _0x59ef3a=_0xa9a1[_0xada965];return _0x59ef3a;};'use strict';var _=require('lodash');var util=require(_0x1a9a('0x0'));var logger=require('../../config/logger')(_0x1a9a('0x1'));var moment=require(_0x1a9a('0x2'));var BPromise=require(_0x1a9a('0x3'));var rp=require(_0x1a9a('0x4'));var fs=require('fs');var path=require(_0x1a9a('0x5'));var rimraf=require('rimraf');var config=require(_0x1a9a('0x6'));var attributes=require(_0x1a9a('0x7'));module[_0x1a9a('0x8')]=function(_0x2bca53,_0x2cc3e9){return _0x2bca53[_0x1a9a('0x9')](_0x1a9a('0xa'),attributes,{'tableName':_0x1a9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6624=['rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6624,0x1c9));var _0x4662=function(_0x29ca10,_0x3d030a){_0x29ca10=_0x29ca10-0x0;var _0xd50889=_0x6624[_0x29ca10];return _0xd50889;};'use strict';var _=require('lodash');var util=require(_0x4662('0x0'));var logger=require(_0x4662('0x1'))(_0x4662('0x2'));var moment=require(_0x4662('0x3'));var BPromise=require('bluebird');var rp=require(_0x4662('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4662('0x5'));var config=require('../../config/environment');var attributes=require(_0x4662('0x6'));module[_0x4662('0x7')]=function(_0x41092b,_0x47ae88){return _0x41092b[_0x4662('0x8')](_0x4662('0x9'),attributes,{'tableName':_0x4662('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 2c36939..2e9ffa3 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 _0xdb13=['request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x185629,_0x31ee6e){var _0x409e70=function(_0x5a4224){while(--_0x5a4224){_0x185629['push'](_0x185629['shift']());}};_0x409e70(++_0x31ee6e);}(_0xdb13,0x10c));var _0x3db1=function(_0x2adccd,_0x3d9c38){_0x2adccd=_0x2adccd-0x0;var _0x2fa4ee=_0xdb13[_0x2adccd];return _0x2fa4ee;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});config[_0x3db1('0xb')]=_[_0x3db1('0xc')](config[_0x3db1('0xb')],{'host':_0x3db1('0xd'),'port':0x18eb});var socket=require(_0x3db1('0xe'))(new Redis(config[_0x3db1('0xb')]));require(_0x3db1('0xf'))[_0x3db1('0x10')](socket);function respondWithRpcPromise(_0x2261bb,_0xe67f4b,_0x46f340){return new BPromise(function(_0xfd358f,_0x51d421){return client[_0x3db1('0x11')](_0x2261bb,_0x46f340)[_0x3db1('0x12')](function(_0x2bab87){logger[_0x3db1('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe67f4b,'request\x20sent');logger[_0x3db1('0x14')](_0x3db1('0x15'),_0xe67f4b,_0x3db1('0x16'),JSON[_0x3db1('0x17')](_0x2bab87));if(_0x2bab87[_0x3db1('0x18')]){if(_0x2bab87['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0xe67f4b,_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);return _0x51d421(_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);}logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x2bab87['error'][_0x3db1('0x19')]);return _0xfd358f(_0x2bab87[_0x3db1('0x18')]['message']);}else{logger[_0x3db1('0x13')](_0x3db1('0x1a'),_0xe67f4b,'request\x20sent');_0xfd358f(_0x2bab87[_0x3db1('0x1b')]['message']);}})[_0x3db1('0x1c')](function(_0x475208){logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x475208);_0x51d421(_0x475208);});});} \ No newline at end of file +var _0x3edc=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x3504a0,_0x3f770f){_0x3504a0=_0x3504a0-0x0;var _0x3dfca3=_0x3edc[_0x3504a0];return _0x3dfca3;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var moment=require(_0xc3ed('0x2'));var BPromise=require(_0xc3ed('0x3'));var rs=require(_0xc3ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3ed('0x6'))(_0xc3ed('0x7'));var config=require(_0xc3ed('0x8'));var jayson=require(_0xc3ed('0x9'));var client=jayson[_0xc3ed('0xa')]['http']({'port':0x232a});config[_0xc3ed('0xb')]=_[_0xc3ed('0xc')](config[_0xc3ed('0xb')],{'host':_0xc3ed('0xd'),'port':0x18eb});var socket=require(_0xc3ed('0xe'))(new Redis(config[_0xc3ed('0xb')]));require('./chatGroup.socket')[_0xc3ed('0xf')](socket);function respondWithRpcPromise(_0x32e102,_0x37c1fc,_0x51c2c4){return new BPromise(function(_0x57e75f,_0x5517a3){return client[_0xc3ed('0x10')](_0x32e102,_0x51c2c4)[_0xc3ed('0x11')](function(_0x1eb94b){logger[_0xc3ed('0x12')](_0xc3ed('0x13'),_0x37c1fc,_0xc3ed('0x14'));logger[_0xc3ed('0x15')](_0xc3ed('0x16'),_0x37c1fc,_0xc3ed('0x14'),JSON[_0xc3ed('0x17')](_0x1eb94b));if(_0x1eb94b['error']){if(_0x1eb94b[_0xc3ed('0x18')][_0xc3ed('0x19')]===0x1f4){logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1eb94b['error']['message']);return _0x5517a3(_0x1eb94b['error']['message']);}logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1eb94b['error'][_0xc3ed('0x1a')]);return _0x57e75f(_0x1eb94b[_0xc3ed('0x18')]['message']);}else{logger['info'](_0xc3ed('0x13'),_0x37c1fc,_0xc3ed('0x14'));_0x57e75f(_0x1eb94b['result'][_0xc3ed('0x1a')]);}})[_0xc3ed('0x1b')](function(_0x1db6e2){logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1db6e2);_0x5517a3(_0x1db6e2);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 4eff647..39efa20 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 _0x32cb=['update','removeListener','register','length','./chatGroup.events','save','remove'];(function(_0xaa620e,_0x645b8e){var _0x380150=function(_0x1f5029){while(--_0x1f5029){_0xaa620e['push'](_0xaa620e['shift']());}};_0x380150(++_0x645b8e);}(_0x32cb,0x177));var _0xb32c=function(_0x482cf5,_0x2bb93a){_0x482cf5=_0x482cf5-0x0;var _0xf06074=_0x32cb[_0x482cf5];return _0xf06074;};'use strict';var ChatGroupEvents=require(_0xb32c('0x0'));var events=[_0xb32c('0x1'),_0xb32c('0x2'),_0xb32c('0x3')];function createListener(_0x306515,_0x52d671){return function(_0x1237b2){_0x52d671['emit'](_0x306515,_0x1237b2);};}function removeListener(_0xf934c8,_0x5788cf){return function(){ChatGroupEvents[_0xb32c('0x4')](_0xf934c8,_0x5788cf);};}exports[_0xb32c('0x5')]=function(_0x53cd15){for(var _0xcb4e65=0x0,_0x509ef2=events[_0xb32c('0x6')];_0xcb4e65<_0x509ef2;_0xcb4e65++){var _0x4a8af0=events[_0xcb4e65];var _0x2f04cf=createListener('chatGroup:'+_0x4a8af0,_0x53cd15);ChatGroupEvents['on'](_0x4a8af0,_0x2f04cf);}}; \ No newline at end of file +var _0x99ca=['update','emit','register','chatGroup:','./chatGroup.events','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x99ca,0xd0));var _0xa99c=function(_0x8413ca,_0xe18ad6){_0x8413ca=_0x8413ca-0x0;var _0x259ddc=_0x99ca[_0x8413ca];return _0x259ddc;};'use strict';var ChatGroupEvents=require(_0xa99c('0x0'));var events=[_0xa99c('0x1'),'remove',_0xa99c('0x2')];function createListener(_0x1cf221,_0x4c9384){return function(_0x32ff83){_0x4c9384[_0xa99c('0x3')](_0x1cf221,_0x32ff83);};}function removeListener(_0x1dc98d,_0x14340e){return function(){ChatGroupEvents['removeListener'](_0x1dc98d,_0x14340e);};}exports[_0xa99c('0x4')]=function(_0x4d6514){for(var _0x3563fe=0x0,_0x3016bb=events['length'];_0x3563fe<_0x3016bb;_0x3563fe++){var _0x26dede=events[_0x3563fe];var _0x43d2f5=createListener(_0xa99c('0x5')+_0x26dede,_0x4d6514);ChatGroupEvents['on'](_0x26dede,_0x43d2f5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4b70efc..dd3aa96 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 _0xee96=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','update','delete','destroy','removeMembers','multer','express'];(function(_0x5c69fb,_0x3fb8d4){var _0xf252f8=function(_0x3a85c4){while(--_0x3a85c4){_0x5c69fb['push'](_0x5c69fb['shift']());}};_0xf252f8(++_0x3fb8d4);}(_0xee96,0x66));var _0x6ee9=function(_0x1753aa,_0x3432c4){_0x1753aa=_0x1753aa-0x0;var _0x394463=_0xee96[_0x1753aa];return _0x394463;};'use strict';var multer=require(_0x6ee9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6ee9('0x1'));var router=express[_0x6ee9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6ee9('0x3'));var interaction=require(_0x6ee9('0x4'));var config=require(_0x6ee9('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x7')]);router[_0x6ee9('0x8')](_0x6ee9('0x9'),auth['isAuthenticated'](),controller[_0x6ee9('0xa')]);router[_0x6ee9('0x8')](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0xc')]);router[_0x6ee9('0x8')]('/:id/unread',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0xd')]);router[_0x6ee9('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x6ee9('0xe')]);router[_0x6ee9('0x8')](_0x6ee9('0xf'),auth['isAuthenticated'](),controller[_0x6ee9('0x10')]);router[_0x6ee9('0x11')]('/',auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x12')]);router[_0x6ee9('0x11')](_0x6ee9('0x13'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x14')]);router['post'](_0x6ee9('0xf'),auth['isAuthenticated'](),controller[_0x6ee9('0x15')]);router['put'](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x16')]);router[_0x6ee9('0x17')](_0x6ee9('0xb'),auth[_0x6ee9('0x6')](),controller[_0x6ee9('0x18')]);router[_0x6ee9('0x17')](_0x6ee9('0x13'),auth['isAuthenticated'](),controller[_0x6ee9('0x19')]);module['exports']=router; \ No newline at end of file +var _0xb282=['put','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb282,0x19a));var _0x2b28=function(_0x3a6f3b,_0x570b8a){_0x3a6f3b=_0x3a6f3b-0x0;var _0x3594c7=_0xb282[_0x3a6f3b];return _0x3594c7;};'use strict';var multer=require(_0x2b28('0x0'));var util=require(_0x2b28('0x1'));var path=require(_0x2b28('0x2'));var timeout=require(_0x2b28('0x3'));var express=require('express');var router=express[_0x2b28('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b28('0x5'));var interaction=require(_0x2b28('0x6'));var config=require(_0x2b28('0x7'));var controller=require(_0x2b28('0x8'));router[_0x2b28('0x9')]('/',auth[_0x2b28('0xa')](),controller[_0x2b28('0xb')]);router[_0x2b28('0x9')](_0x2b28('0xc'),auth['isAuthenticated'](),controller[_0x2b28('0xd')]);router[_0x2b28('0x9')](_0x2b28('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x2b28('0x9')](_0x2b28('0xf'),auth[_0x2b28('0xa')](),controller[_0x2b28('0x10')]);router[_0x2b28('0x9')](_0x2b28('0x11'),auth['isAuthenticated'](),controller[_0x2b28('0x12')]);router[_0x2b28('0x9')]('/:id/messages',auth[_0x2b28('0xa')](),controller[_0x2b28('0x13')]);router[_0x2b28('0x14')]('/',auth[_0x2b28('0xa')](),controller[_0x2b28('0x15')]);router['post']('/:id/members',auth[_0x2b28('0xa')](),controller[_0x2b28('0x16')]);router['post'](_0x2b28('0x17'),auth[_0x2b28('0xa')](),controller[_0x2b28('0x18')]);router[_0x2b28('0x19')](_0x2b28('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2b28('0xe'),auth[_0x2b28('0xa')](),controller[_0x2b28('0x1a')]);router['delete'](_0x2b28('0x11'),auth[_0x2b28('0xa')](),controller[_0x2b28('0x1b')]);module[_0x2b28('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d09c4f2..99d6b01 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 _0xfff0=['STRING','long','DATE','ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','TEXT'];(function(_0x157aed,_0x4a9ea9){var _0x4eb49c=function(_0x164ca2){while(--_0x164ca2){_0x157aed['push'](_0x157aed['shift']());}};_0x4eb49c(++_0x4a9ea9);}(_0xfff0,0x139));var _0x0fff=function(_0x228666,_0x9319a1){_0x228666=_0x228666-0x0;var _0x66d005=_0xfff0[_0x228666];return _0x66d005;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'closed':{'type':Sequelize[_0x0fff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0fff('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x0fff('0x3'),_0x0fff('0x4')),'defaultValue':_0x0fff('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x0fff('0x5')]},'mailTranscript':{'type':Sequelize[_0x0fff('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0fff('0x6')]},'secondDisposition':{'type':Sequelize[_0x0fff('0x6')]},'thirdDisposition':{'type':Sequelize[_0x0fff('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0fff('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0fff('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0fff('0x6')]},'deviceVendor':{'type':Sequelize[_0x0fff('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0fff('0x5')]},'customerIp':{'type':Sequelize[_0x0fff('0x6')]},'formData':{'type':Sequelize[_0x0fff('0x5')](_0x0fff('0x7'))},'read1stAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0fff('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0fff('0x9')]('in',_0x0fff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0fff('0x6')]},'customerPort':{'type':Sequelize[_0x0fff('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x0fff('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x98e5=['long','DATE','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING'];(function(_0x394b7f,_0x2ab100){var _0x13da86=function(_0x5a396b){while(--_0x5a396b){_0x394b7f['push'](_0x394b7f['shift']());}};_0x13da86(++_0x2ab100);}(_0x98e5,0x8a));var _0x598e=function(_0x4c11fb,_0x32dbc0){_0x4c11fb=_0x4c11fb-0x0;var _0x4caf73=_0x98e5[_0x4c11fb];return _0x4caf73;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x598e('0x0')]},'ratingType':{'type':Sequelize[_0x598e('0x1')]('star',_0x598e('0x2')),'defaultValue':_0x598e('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x598e('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x598e('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x598e('0x5')]},'note':{'type':Sequelize[_0x598e('0x5')]},'browserName':{'type':Sequelize[_0x598e('0x5')]},'browserVersion':{'type':Sequelize[_0x598e('0x5')]},'osName':{'type':Sequelize[_0x598e('0x5')]},'osVersion':{'type':Sequelize[_0x598e('0x5')]},'deviceModel':{'type':Sequelize[_0x598e('0x5')]},'deviceVendor':{'type':Sequelize[_0x598e('0x5')]},'deviceType':{'type':Sequelize[_0x598e('0x5')]},'referer':{'type':Sequelize[_0x598e('0x4')]},'customerIp':{'type':Sequelize[_0x598e('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x598e('0x6'))},'read1stAt':{'type':Sequelize[_0x598e('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x598e('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x598e('0x5')]},'customerPort':{'type':Sequelize[_0x598e('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x598e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x598e('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index e66832a..84a0635 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 _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','concat','createdAt'];(function(_0x32bdc3,_0x4a6165){var _0x57ccb7=function(_0x4e5a22){while(--_0x4e5a22){_0x32bdc3['push'](_0x32bdc3['shift']());}};_0x57ccb7(++_0x4a6165);}(_0x7880,0x1f4));var _0x0788=function(_0xf237f7,_0xb11ac){_0xf237f7=_0xf237f7-0x0;var _0x2c183b=_0x7880[_0xf237f7];return _0x2c183b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));}; \ No newline at end of file +var _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x4e3daa,_0x4a6646){var _0x3ab71c=function(_0x42d9e9){while(--_0x42d9e9){_0x4e3daa['push'](_0x4e3daa['shift']());}};_0x3ab71c(++_0x4a6646);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xd0fb87,_0x4ae4db){_0xd0fb87=_0xd0fb87-0x0;var _0x462f4a=_0xdd4f[_0xd0fb87];return _0x462f4a;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3d39866..05da8ee 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 _0xf1fa=['map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','setDataValue','Users'];(function(_0x5d303d,_0x4775b2){var _0x525013=function(_0x4bd0b5){while(--_0x4bd0b5){_0x5d303d['push'](_0x5d303d['shift']());}};_0x525013(++_0x4775b2);}(_0xf1fa,0x6f));var _0xaf1f=function(_0x1be311,_0x358d12){_0x1be311=_0x1be311-0x0;var _0x30559f=_0xf1fa[_0x1be311];return _0x30559f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xaf1f('0x0')];var ChatMessage=require(_0xaf1f('0x1'))['db'][_0xaf1f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaf1f('0x3')](0x0);var events={'afterCreate':_0xaf1f('0x4'),'afterUpdate':'update','afterDestroy':_0xaf1f('0x5')};function emitEvent(_0x4d0be8){return function(_0x3483ad,_0x154f3f,_0x1f430d){_0x3483ad['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5e0a4a){_0x3483ad[_0xaf1f('0x6')](_0xaf1f('0x7'),_0x5e0a4a[_0xaf1f('0x8')](function(_0x2c4064){return{'id':_0x2c4064['id']};}));return ChatMessage[_0xaf1f('0x9')]({'where':{'ChatInteractionId':_0x3483ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaf1f('0xa')](function(_0xe0f3d5){_0x3483ad[_0xaf1f('0x6')](_0xaf1f('0xb'),_0xe0f3d5['length']);ChatInteractionEvents[_0xaf1f('0xc')](_0x4d0be8+':'+_0x3483ad['id'],_0x3483ad);ChatInteractionEvents[_0xaf1f('0xc')](_0x4d0be8,_0x3483ad);_0x1f430d(null);})[_0xaf1f('0xd')](_0x1f430d(null));};}for(var e in events){if(events[_0xaf1f('0xe')](e)){var event=events[e];ChatInteraction[_0xaf1f('0xf')](e,emitEvent(event));}}module[_0xaf1f('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x809f=['events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x809f,0x6c));var _0xf809=function(_0x1b333d,_0x119f28){_0x1b333d=_0x1b333d-0x0;var _0x1d95b7=_0x809f[_0x1b333d];return _0x1d95b7;};'use strict';var EventEmitter=require(_0xf809('0x0'));var ChatInteraction=require(_0xf809('0x1'))['db'][_0xf809('0x2')];var ChatMessage=require(_0xf809('0x1'))['db'][_0xf809('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf809('0x4'),'afterUpdate':_0xf809('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29a92c){return function(_0x49dd77,_0x898f3e,_0x498d2c){_0x49dd77[_0xf809('0x6')]({'attributes':['id'],'raw':!![]})[_0xf809('0x7')](function(_0x482fe5){_0x49dd77[_0xf809('0x8')](_0xf809('0x9'),_0x482fe5[_0xf809('0xa')](function(_0x460017){return{'id':_0x460017['id']};}));return ChatMessage[_0xf809('0xb')]({'where':{'ChatInteractionId':_0x49dd77['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5c2811){_0x49dd77[_0xf809('0x8')](_0xf809('0xc'),_0x5c2811[_0xf809('0xd')]);ChatInteractionEvents[_0xf809('0xe')](_0x29a92c+':'+_0x49dd77['id'],_0x49dd77);ChatInteractionEvents['emit'](_0x29a92c,_0x49dd77);_0x498d2c(null);})[_0xf809('0xf')](_0x498d2c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf809('0x10')](e,emitEvent(event));}}module[_0xf809('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index db47f94..50eb18a 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 _0xe115=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2d1b2e,_0x4a8299){var _0x583426=function(_0x3040e1){while(--_0x3040e1){_0x2d1b2e['push'](_0x2d1b2e['shift']());}};_0x583426(++_0x4a8299);}(_0xe115,0x160));var _0x5e11=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe115[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0x5e11('0x0'));var logger=require(_0x5e11('0x1'))(_0x5e11('0x2'));var moment=require('moment');var BPromise=require(_0x5e11('0x3'));var rp=require(_0x5e11('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e11('0x5'));var attributes=require(_0x5e11('0x6'));module[_0x5e11('0x7')]=function(_0x42a993,_0x9723d6){return _0x42a993[_0x5e11('0x8')](_0x5e11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e52c1,_0x3a4a4c,_0x5b322e){if(_0x3e52c1[_0x5e11('0xa')](_0x5e11('0xb'))){_0x3e52c1[_0x5e11('0xc')]=moment()[_0x5e11('0xd')](_0x5e11('0xe'));}_0x5b322e(null,_0x3e52c1);}},'charset':_0x5e11('0xf'),'collate':_0x5e11('0x10')});}; \ No newline at end of file +var _0x4b55=['changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions'];(function(_0x13a23d,_0x434850){var _0x1c72be=function(_0x19294c){while(--_0x19294c){_0x13a23d['push'](_0x13a23d['shift']());}};_0x1c72be(++_0x434850);}(_0x4b55,0x135));var _0x54b5=function(_0x17dae8,_0x162788){_0x17dae8=_0x17dae8-0x0;var _0x46d88b=_0x4b55[_0x17dae8];return _0x46d88b;};'use strict';var _=require(_0x54b5('0x0'));var util=require(_0x54b5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x54b5('0x2'));var rp=require(_0x54b5('0x3'));var fs=require('fs');var path=require(_0x54b5('0x4'));var rimraf=require(_0x54b5('0x5'));var config=require(_0x54b5('0x6'));var attributes=require(_0x54b5('0x7'));module[_0x54b5('0x8')]=function(_0x1a1c82,_0x1988e){return _0x1a1c82['define'](_0x54b5('0x9'),attributes,{'tableName':_0x54b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33b9aa,_0x4db785,_0x2fcf6c){if(_0x33b9aa[_0x54b5('0xb')]('closed')){_0x33b9aa[_0x54b5('0xc')]=moment()[_0x54b5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2fcf6c(null,_0x33b9aa);}},'charset':_0x54b5('0xe'),'collate':_0x54b5('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d9b723e..6330648 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 _0xa86e=['info','result','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','catch','AddTagsToChatInteraction','then','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','localhost','redis','./chatInteraction.socket','register','request','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x25288c,_0x18e487){var _0x13bc9a=function(_0x50c971){while(--_0x50c971){_0x25288c['push'](_0x25288c['shift']());}};_0x13bc9a(++_0x18e487);}(_0xa86e,0x194));var _0xea86=function(_0xb3c825,_0x48ef68){_0xb3c825=_0xb3c825-0x0;var _0x2e0ddf=_0xa86e[_0xb3c825];return _0x2e0ddf;};'use strict';var _=require(_0xea86('0x0'));var util=require(_0xea86('0x1'));var moment=require(_0xea86('0x2'));var BPromise=require(_0xea86('0x3'));var rs=require(_0xea86('0x4'));var fs=require('fs');var Redis=require(_0xea86('0x5'));var db=require(_0xea86('0x6'))['db'];var utils=require(_0xea86('0x7'));var logger=require(_0xea86('0x8'))(_0xea86('0x9'));var config=require(_0xea86('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xea86('0xb')]['http']({'port':0x232a});config['redis']=_[_0xea86('0xc')](config['redis'],{'host':_0xea86('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea86('0xe')]));require(_0xea86('0xf'))[_0xea86('0x10')](socket);function respondWithRpcPromise(_0x21d618,_0x20e8a0,_0x2b5d33){return new BPromise(function(_0x526e0f,_0x455737){return client[_0xea86('0x11')](_0x21d618,_0x2b5d33)['then'](function(_0x3aec0c){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x20e8a0,'request\x20sent');logger[_0xea86('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x20e8a0,_0xea86('0x13'),JSON[_0xea86('0x14')](_0x3aec0c));if(_0x3aec0c[_0xea86('0x15')]){if(_0x3aec0c[_0xea86('0x15')][_0xea86('0x16')]===0x1f4){logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x3aec0c[_0xea86('0x15')]['message']);return _0x455737(_0x3aec0c[_0xea86('0x15')][_0xea86('0x18')]);}logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x3aec0c['error'][_0xea86('0x18')]);return _0x526e0f(_0x3aec0c['error'][_0xea86('0x18')]);}else{logger[_0xea86('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x20e8a0,_0xea86('0x13'));_0x526e0f(_0x3aec0c[_0xea86('0x1a')]['message']);}})['catch'](function(_0x15c8f8){logger[_0xea86('0x15')](_0xea86('0x17'),_0x20e8a0,_0x15c8f8);_0x455737(_0x15c8f8);});});}exports[_0xea86('0x1b')]=function(_0x78a43d){var _0x2ec70c=this;return new Promise(function(_0x1d187b,_0x565a95){return db[_0xea86('0x1c')]['update'](_0x78a43d[_0xea86('0x1d')],{'raw':_0x78a43d[_0xea86('0x1e')]?_0x78a43d[_0xea86('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x78a43d['options']?_0x78a43d['options']['where']||null:null,'attributes':_0x78a43d['options']?_0x78a43d[_0xea86('0x1e')][_0xea86('0x1f')]||null:null,'limit':_0x78a43d['options']?_0x78a43d[_0xea86('0x1e')][_0xea86('0x20')]||null:null})['then'](function(_0x2b22e4){logger[_0xea86('0x19')]('UpdateChatInteraction',_0x78a43d);logger[_0xea86('0x12')](_0xea86('0x1b'),_0x78a43d,JSON[_0xea86('0x14')](_0x2b22e4));_0x1d187b(_0x2b22e4);})[_0xea86('0x21')](function(_0x255dc3){logger[_0xea86('0x15')](_0xea86('0x1b'),_0x255dc3[_0xea86('0x18')],_0x78a43d);_0x565a95(_0x2ec70c[_0xea86('0x15')](0x1f4,_0x255dc3['message']));});});};exports[_0xea86('0x22')]=function(_0xcce430){return new Promise(function(_0x576615,_0xd4936d){return db[_0xea86('0x1c')]['find']({'where':_0xcce430[_0xea86('0x1e')]?_0xcce430['options']['where']||null:null})[_0xea86('0x23')](function(_0x1cb49a){if(_0x1cb49a){return _0x1cb49a[_0xea86('0x24')](_0xcce430[_0xea86('0x1d')][_0xea86('0x25')],_['omit'](_0xcce430[_0xea86('0x1d')],[_0xea86('0x25'),'id'])||{});}})['spread'](function(_0x395cf9){logger[_0xea86('0x19')](_0xea86('0x26'),_0xcce430);logger[_0xea86('0x12')]('AddTags',_0xcce430,JSON[_0xea86('0x14')](_0x395cf9));_0x576615(_0x395cf9);})['catch'](function(_0x5b2f69){logger[_0xea86('0x15')](_0xea86('0x26'),_0x5b2f69[_0xea86('0x18')],_0xcce430);_0xd4936d(_this[_0xea86('0x15')](0x1f4,_0x5b2f69[_0xea86('0x18')]));});});}; \ No newline at end of file +var _0xd366=['where','UpdateChatInteraction','find','ids','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ChatInteraction','update','body','options','raw'];(function(_0x3efe4a,_0x22b55c){var _0x11e61e=function(_0x4cd240){while(--_0x4cd240){_0x3efe4a['push'](_0x3efe4a['shift']());}};_0x11e61e(++_0x22b55c);}(_0xd366,0x14f));var _0x6d36=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xd366[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6d36('0x0'));var BPromise=require(_0x6d36('0x1'));var rs=require(_0x6d36('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d36('0x3'))['db'];var utils=require(_0x6d36('0x4'));var logger=require(_0x6d36('0x5'))(_0x6d36('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d36('0x7')][_0x6d36('0x8')]({'port':0x232a});config[_0x6d36('0x9')]=_['defaults'](config[_0x6d36('0x9')],{'host':_0x6d36('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d36('0x9')]));require(_0x6d36('0xb'))[_0x6d36('0xc')](socket);function respondWithRpcPromise(_0x33b3bc,_0x21596c,_0x4bbb88){return new BPromise(function(_0x5e7f5b,_0x3c58e3){return client['request'](_0x33b3bc,_0x4bbb88)[_0x6d36('0xd')](function(_0x7ab967){logger[_0x6d36('0xe')](_0x6d36('0xf'),_0x21596c,'request\x20sent');logger[_0x6d36('0x10')](_0x6d36('0x11'),_0x21596c,_0x6d36('0x12'),JSON[_0x6d36('0x13')](_0x7ab967));if(_0x7ab967[_0x6d36('0x14')]){if(_0x7ab967['error']['code']===0x1f4){logger[_0x6d36('0x14')](_0x6d36('0xf'),_0x21596c,_0x7ab967[_0x6d36('0x14')]['message']);return _0x3c58e3(_0x7ab967['error']['message']);}logger['error'](_0x6d36('0xf'),_0x21596c,_0x7ab967[_0x6d36('0x14')]['message']);return _0x5e7f5b(_0x7ab967[_0x6d36('0x14')][_0x6d36('0x15')]);}else{logger[_0x6d36('0xe')](_0x6d36('0xf'),_0x21596c,_0x6d36('0x12'));_0x5e7f5b(_0x7ab967['result']['message']);}})[_0x6d36('0x16')](function(_0x5ce256){logger[_0x6d36('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x21596c,_0x5ce256);_0x3c58e3(_0x5ce256);});});}exports['UpdateChatInteraction']=function(_0x5d3d37){var _0x3c555b=this;return new Promise(function(_0xbde8f7,_0x3eb86d){return db[_0x6d36('0x17')][_0x6d36('0x18')](_0x5d3d37[_0x6d36('0x19')],{'raw':_0x5d3d37[_0x6d36('0x1a')]?_0x5d3d37[_0x6d36('0x1a')][_0x6d36('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d3d37[_0x6d36('0x1a')]?_0x5d3d37['options'][_0x6d36('0x1c')]||null:null,'attributes':_0x5d3d37[_0x6d36('0x1a')]?_0x5d3d37[_0x6d36('0x1a')]['attributes']||null:null,'limit':_0x5d3d37['options']?_0x5d3d37['options']['limit']||null:null})[_0x6d36('0xd')](function(_0x1e7d8e){logger[_0x6d36('0xe')](_0x6d36('0x1d'),_0x5d3d37);logger[_0x6d36('0x10')]('UpdateChatInteraction',_0x5d3d37,JSON[_0x6d36('0x13')](_0x1e7d8e));_0xbde8f7(_0x1e7d8e);})[_0x6d36('0x16')](function(_0x44d54e){logger[_0x6d36('0x14')](_0x6d36('0x1d'),_0x44d54e[_0x6d36('0x15')],_0x5d3d37);_0x3eb86d(_0x3c555b[_0x6d36('0x14')](0x1f4,_0x44d54e[_0x6d36('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x73f87e){return new Promise(function(_0x15b4c1,_0x3ee04f){return db['ChatInteraction'][_0x6d36('0x1e')]({'where':_0x73f87e[_0x6d36('0x1a')]?_0x73f87e[_0x6d36('0x1a')]['where']||null:null})['then'](function(_0x3c4c56){if(_0x3c4c56){return _0x3c4c56['addTags'](_0x73f87e[_0x6d36('0x19')][_0x6d36('0x1f')],_['omit'](_0x73f87e[_0x6d36('0x19')],['ids','id'])||{});}})['spread'](function(_0x1c8539){logger['info'](_0x6d36('0x20'),_0x73f87e);logger[_0x6d36('0x10')](_0x6d36('0x20'),_0x73f87e,JSON[_0x6d36('0x13')](_0x1c8539));_0x15b4c1(_0x1c8539);})[_0x6d36('0x16')](function(_0x13b6c9){logger[_0x6d36('0x14')](_0x6d36('0x20'),_0x13b6c9['message'],_0x73f87e);_0x3ee04f(_this['error'](0x1f4,_0x13b6c9[_0x6d36('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 670d1d9..e61fdfb 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 _0x70f3=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x5a7bb7,_0x3964f2){var _0x557b7f=function(_0x38facb){while(--_0x38facb){_0x5a7bb7['push'](_0x5a7bb7['shift']());}};_0x557b7f(++_0x3964f2);}(_0x70f3,0x1d5));var _0x370f=function(_0x48dc9d,_0x3fe9d0){_0x48dc9d=_0x48dc9d-0x0;var _0x3fca5a=_0x70f3[_0x48dc9d];return _0x3fca5a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x370f('0x0'),_0x370f('0x1'),_0x370f('0x2')];function createListener(_0x24debf,_0x5e37da){return function(_0x2911b5){_0x5e37da[_0x370f('0x3')](_0x24debf,_0x2911b5);};}function removeListener(_0x33282e,_0x4c4b37){return function(){ChatInteractionEvents[_0x370f('0x4')](_0x33282e,_0x4c4b37);};}exports[_0x370f('0x5')]=function(_0xe9904e){for(var _0x141691=0x0,_0x7e0ad9=events[_0x370f('0x6')];_0x141691<_0x7e0ad9;_0x141691++){var _0x5d72e7=events[_0x141691];var _0x4d98c4=createListener(_0x370f('0x7')+_0x5d72e7,_0xe9904e);ChatInteractionEvents['on'](_0x5d72e7,_0x4d98c4);}}; \ No newline at end of file +var _0xc389=['chatInteraction:','save','remove','update','length'];(function(_0x1b887f,_0x278abb){var _0x55b5ce=function(_0xb14581){while(--_0xb14581){_0x1b887f['push'](_0x1b887f['shift']());}};_0x55b5ce(++_0x278abb);}(_0xc389,0x164));var _0x9c38=function(_0x8016ac,_0x1b6dd5){_0x8016ac=_0x8016ac-0x0;var _0x32944e=_0xc389[_0x8016ac];return _0x32944e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x9c38('0x0'),_0x9c38('0x1'),_0x9c38('0x2')];function createListener(_0x440afa,_0x3e3aa8){return function(_0x82328e){_0x3e3aa8['emit'](_0x440afa,_0x82328e);};}function removeListener(_0x220631,_0x4c6504){return function(){ChatInteractionEvents['removeListener'](_0x220631,_0x4c6504);};}exports['register']=function(_0x52fe77){for(var _0x2ef172=0x0,_0x34adb8=events[_0x9c38('0x3')];_0x2ef172<_0x34adb8;_0x2ef172++){var _0x3df52a=events[_0x2ef172];var _0x4cd4a6=createListener(_0x9c38('0x4')+_0x3df52a,_0x52fe77);ChatInteractionEvents['on'](_0x3df52a,_0x4cd4a6);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c674cb0..a2637e9 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 _0xa73e=['removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy'];(function(_0x2ae8b5,_0x2a2cb6){var _0x29def1=function(_0x2a03a3){while(--_0x2a03a3){_0x2ae8b5['push'](_0x2ae8b5['shift']());}};_0x29def1(++_0x2a2cb6);}(_0xa73e,0xde));var _0xea73=function(_0x5c17c8,_0x472eb8){_0x5c17c8=_0x5c17c8-0x0;var _0x3afe0e=_0xa73e[_0x5c17c8];return _0x3afe0e;};'use strict';var multer=require(_0xea73('0x0'));var util=require(_0xea73('0x1'));var path=require(_0xea73('0x2'));var timeout=require(_0xea73('0x3'));var express=require(_0xea73('0x4'));var router=express[_0xea73('0x5')]();var fs_extra=require(_0xea73('0x6'));var auth=require(_0xea73('0x7'));var interaction=require(_0xea73('0x8'));var config=require('../../config/environment');var controller=require(_0xea73('0x9'));router['get']('/',auth[_0xea73('0xa')](),controller[_0xea73('0xb')]);router[_0xea73('0xc')](_0xea73('0xd'),auth[_0xea73('0xa')](),controller[_0xea73('0xe')]);router[_0xea73('0xc')]('/:id',auth[_0xea73('0xf')](),controller[_0xea73('0x10')]);router[_0xea73('0xc')](_0xea73('0x11'),auth[_0xea73('0xf')](),controller[_0xea73('0x12')]);router[_0xea73('0xc')](_0xea73('0x13'),auth[_0xea73('0xa')](),controller[_0xea73('0x14')]);router[_0xea73('0xc')](_0xea73('0x15'),auth[_0xea73('0xf')](),controller[_0xea73('0x16')]);router['get'](_0xea73('0x17'),auth['isAuthenticated'](),controller[_0xea73('0x18')]);router[_0xea73('0x19')]('/',auth[_0xea73('0xa')](),controller['create']);router[_0xea73('0x19')]('/:id/vidaoo',auth[_0xea73('0xa')](),controller[_0xea73('0x1a')]);var upload=multer({'storage':multer[_0xea73('0x1b')]({'destination':function(_0x480adf,_0x3438ec,_0x4830b8){_0x4830b8(null,path[_0xea73('0x1c')](config[_0xea73('0x1d')],_0xea73('0x1e')));},'filename':function(_0x10a128,_0x59006c,_0x3fe812){_0x3fe812(null,util['format'](_0xea73('0x1f'),Date[_0xea73('0x20')](),_0x59006c[_0xea73('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xea73('0x19')]('/:id/attachment_upload',upload['single'](_0xea73('0x22')),controller[_0xea73('0x23')]);router[_0xea73('0x19')](_0xea73('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xea73('0x24')]);router[_0xea73('0x19')](_0xea73('0x25'),auth[_0xea73('0xa')](),interaction[_0xea73('0x26')](_0xea73('0x27'),_0xea73('0x28')),controller['addTags']);router[_0xea73('0x29')](_0xea73('0x2a'),auth[_0xea73('0xa')](),interaction[_0xea73('0x26')](_0xea73('0x27'),_0xea73('0x2b')),controller[_0xea73('0x2c')]);router[_0xea73('0x29')](_0xea73('0x2d'),controller[_0xea73('0x2e')]);router[_0xea73('0x29')](_0xea73('0x2f'),auth[_0xea73('0xf')](),controller[_0xea73('0x30')]);router[_0xea73('0x29')](_0xea73('0x31'),controller['close']);router[_0xea73('0x32')](_0xea73('0x2a'),auth['isAuthenticated'](),interaction[_0xea73('0x26')]('chat',_0xea73('0x33')),controller[_0xea73('0x34')]);router[_0xea73('0x32')](_0xea73('0x25'),auth['isAuthenticated'](),controller[_0xea73('0x35')]);module[_0xea73('0x36')]=router; \ No newline at end of file +var _0xa598=['%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','put','/:id','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','root'];(function(_0x33a8b7,_0x1d18b6){var _0x4b3dc6=function(_0x163fc0){while(--_0x163fc0){_0x33a8b7['push'](_0x33a8b7['shift']());}};_0x4b3dc6(++_0x1d18b6);}(_0xa598,0x1a7));var _0x8a59=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xa598[_0x31ced5];return _0x10d9e5;};'use strict';var multer=require(_0x8a59('0x0'));var util=require(_0x8a59('0x1'));var path=require(_0x8a59('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a59('0x3'));var router=express[_0x8a59('0x4')]();var fs_extra=require(_0x8a59('0x5'));var auth=require(_0x8a59('0x6'));var interaction=require(_0x8a59('0x7'));var config=require(_0x8a59('0x8'));var controller=require('./chatInteraction.controller');router[_0x8a59('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a59('0xa')]);router[_0x8a59('0x9')](_0x8a59('0xb'),auth[_0x8a59('0xc')](),controller[_0x8a59('0xd')]);router[_0x8a59('0x9')]('/:id',auth[_0x8a59('0xe')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x8a59('0xe')](),controller[_0x8a59('0xf')]);router[_0x8a59('0x9')](_0x8a59('0x10'),auth[_0x8a59('0xc')](),controller[_0x8a59('0x11')]);router['get'](_0x8a59('0x12'),auth[_0x8a59('0xe')](),controller[_0x8a59('0x13')]);router['get'](_0x8a59('0x14'),auth[_0x8a59('0xc')](),controller['download']);router[_0x8a59('0x15')]('/',auth['isAuthenticated'](),controller[_0x8a59('0x16')]);router[_0x8a59('0x15')](_0x8a59('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x8a59('0x18')]({'destination':function(_0x5b5426,_0x3d0b5d,_0x316f4f){_0x316f4f(null,path[_0x8a59('0x19')](config[_0x8a59('0x1a')],'server/files/attachments/'));},'filename':function(_0x3630ff,_0x239e6e,_0x27d0ce){_0x27d0ce(null,util['format'](_0x8a59('0x1b'),Date['now'](),_0x239e6e[_0x8a59('0x1c')][_0x8a59('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8a59('0x15')](_0x8a59('0x1e'),upload[_0x8a59('0x1f')](_0x8a59('0x20')),controller[_0x8a59('0x21')]);router[_0x8a59('0x15')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x8a59('0x15')](_0x8a59('0x22'),auth[_0x8a59('0xc')](),interaction[_0x8a59('0x23')](_0x8a59('0x24'),'chatinteraction:addtags'),controller[_0x8a59('0x25')]);router[_0x8a59('0x26')](_0x8a59('0x27'),auth[_0x8a59('0xc')](),interaction[_0x8a59('0x23')](_0x8a59('0x24'),'chatinteraction:update'),controller['update']);router['put'](_0x8a59('0x28'),controller[_0x8a59('0x29')]);router[_0x8a59('0x26')](_0x8a59('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x8a59('0x2b')]);router[_0x8a59('0x26')](_0x8a59('0x2c'),controller[_0x8a59('0x2d')]);router[_0x8a59('0x2e')](_0x8a59('0x27'),auth[_0x8a59('0xc')](),interaction[_0x8a59('0x23')]('chat',_0x8a59('0x2f')),controller[_0x8a59('0x30')]);router['delete'](_0x8a59('0x22'),auth[_0x8a59('0xc')](),controller['removeTags']);module[_0x8a59('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 90282d2..8bacf9d 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 _0xb90d=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x3d2944,_0x410c3e){var _0x370d7b=function(_0x2c283d){while(--_0x2c283d){_0x3d2944['push'](_0x3d2944['shift']());}};_0x370d7b(++_0x410c3e);}(_0xb90d,0x8c));var _0xdb90=function(_0x1ca7ed,_0x2cccb4){_0x1ca7ed=_0x1ca7ed-0x0;var _0x5d706a=_0xb90d[_0x1ca7ed];return _0x5d706a;};'use strict';var Sequelize=require(_0xdb90('0x0'));module[_0xdb90('0x1')]={'body':{'type':Sequelize[_0xdb90('0x2')](_0xdb90('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdb90('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdb90('0x5')]}}; \ No newline at end of file +var _0xa68f=['TEXT','medium','BOOLEAN','exports'];(function(_0x48cf87,_0x182999){var _0x3b908a=function(_0x1f8008){while(--_0x1f8008){_0x48cf87['push'](_0x48cf87['shift']());}};_0x3b908a(++_0x182999);}(_0xa68f,0x15b));var _0xfa68=function(_0x10a360,_0x236971){_0x10a360=_0x10a360-0x0;var _0xbcc6ee=_0xa68f[_0x10a360];return _0xbcc6ee;};'use strict';var Sequelize=require('sequelize');module[_0xfa68('0x0')]={'body':{'type':Sequelize[_0xfa68('0x1')](_0xfa68('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfa68('0x3')],'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 a040761..8a7b1ac 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 _0xe520=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x15ce2a,_0x1345e3){var _0xd9cbbf=function(_0x45ac52){while(--_0x45ac52){_0x15ce2a['push'](_0x15ce2a['shift']());}};_0xd9cbbf(++_0x1345e3);}(_0xe520,0x140));var _0x0e52=function(_0xa465a2,_0x3a4590){_0xa465a2=_0xa465a2-0x0;var _0x4a6c16=_0xe520[_0xa465a2];return _0x4a6c16;};'use strict';var emlformat=require(_0x0e52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e52('0x1'));var jsonpatch=require(_0x0e52('0x2'));var rp=require(_0x0e52('0x3'));var moment=require('moment');var BPromise=require(_0x0e52('0x4'));var Mustache=require(_0x0e52('0x5'));var util=require(_0x0e52('0x6'));var path=require('path');var sox=require(_0x0e52('0x7'));var csv=require(_0x0e52('0x8'));var ejs=require(_0x0e52('0x9'));var fs=require('fs');var fs_extra=require(_0x0e52('0xa'));var _=require(_0x0e52('0xb'));var squel=require(_0x0e52('0xc'));var crypto=require(_0x0e52('0xd'));var jsforce=require(_0x0e52('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e52('0x8'));var querystring=require(_0x0e52('0xf'));var Papa=require(_0x0e52('0x10'));var Redis=require(_0x0e52('0x11'));var authService=require(_0x0e52('0x12'));var qs=require(_0x0e52('0x13'));var as=require(_0x0e52('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e52('0x15'))(_0x0e52('0x16'));var utils=require(_0x0e52('0x17'));var config=require(_0x0e52('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e52('0x19'))['db'];config[_0x0e52('0x1a')]=_[_0x0e52('0x1b')](config[_0x0e52('0x1a')],{'host':_0x0e52('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e52('0x1a')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x55a2c5,_0x545f54){_0x545f54=_0x545f54||0xcc;return function(_0x403a8f){if(_0x403a8f){return _0x55a2c5[_0x0e52('0x1d')](_0x545f54);}return _0x55a2c5[_0x0e52('0x1e')](_0x545f54)[_0x0e52('0x1f')]();};}function respondWithResult(_0x2ba2a2,_0x30681f){_0x30681f=_0x30681f||0xc8;return function(_0x23dd37){if(_0x23dd37){return _0x2ba2a2[_0x0e52('0x1e')](_0x30681f)[_0x0e52('0x20')](_0x23dd37);}};}function respondWithFilteredResult(_0x32bec8,_0x2f68c6){return function(_0x50b7f2){if(_0x50b7f2){var _0x13aeb2=typeof _0x2f68c6['offset']===_0x0e52('0x21')&&typeof _0x2f68c6[_0x0e52('0x22')]===_0x0e52('0x21');var _0x4c389a=_0x50b7f2['count'];var _0x230f9f=_0x13aeb2?0x0:_0x2f68c6[_0x0e52('0x23')];var _0x2e5697=_0x13aeb2?_0x50b7f2[_0x0e52('0x24')]:_0x2f68c6[_0x0e52('0x23')]+_0x2f68c6[_0x0e52('0x22')];var _0x2f18d8;if(_0x2e5697>=_0x4c389a){_0x2e5697=_0x4c389a;_0x2f18d8=0xc8;}else{_0x2f18d8=0xce;}_0x32bec8[_0x0e52('0x1e')](_0x2f18d8);return _0x32bec8[_0x0e52('0x25')](_0x0e52('0x26'),_0x230f9f+'-'+_0x2e5697+'/'+_0x4c389a)[_0x0e52('0x20')](_0x50b7f2);}return null;};}function patchUpdates(_0x4234b3){return function(_0x5d8154){try{jsonpatch[_0x0e52('0x27')](_0x5d8154,_0x4234b3,!![]);}catch(_0x9aafa3){return BPromise['reject'](_0x9aafa3);}return _0x5d8154[_0x0e52('0x28')]();};}function saveUpdates(_0x276e1b,_0x599d38){return function(_0x21e9df){if(_0x21e9df){return _0x21e9df[_0x0e52('0x29')](_0x276e1b)['then'](function(_0x2dff92){return _0x2dff92;});}return null;};}function removeEntity(_0x521234,_0x5a7a5e){return function(_0x5f4651){if(_0x5f4651){return _0x5f4651[_0x0e52('0x2a')]()[_0x0e52('0x2b')](function(){_0x521234['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39bf01,_0x120a25){return function(_0x37e2ea){if(!_0x37e2ea){_0x39bf01[_0x0e52('0x1d')](0x194);}return _0x37e2ea;};}function handleError(_0x553527,_0x332210){_0x332210=_0x332210||0x1f4;return function(_0x1907e4){logger['error'](_0x1907e4[_0x0e52('0x2c')]);if(_0x1907e4[_0x0e52('0x2d')]){delete _0x1907e4[_0x0e52('0x2d')];}_0x553527[_0x0e52('0x1e')](_0x332210)[_0x0e52('0x2e')](_0x1907e4);};}exports[_0x0e52('0x2f')]=function(_0xb5aa93,_0x3236b6){var _0x3693fe={},_0x7bfd64={},_0x12f276={'count':0x0,'rows':[]};var _0x4a7d35=_[_0x0e52('0x30')](db[_0x0e52('0x31')]['rawAttributes'],function(_0x51e036){return{'name':_0x51e036[_0x0e52('0x32')],'type':_0x51e036[_0x0e52('0x33')][_0x0e52('0x34')]};});_0x7bfd64[_0x0e52('0x35')]=_[_0x0e52('0x30')](_0x4a7d35,_0x0e52('0x2d'));_0x7bfd64[_0x0e52('0x36')]=_[_0x0e52('0x37')](_0xb5aa93[_0x0e52('0x36')]);_0x7bfd64['filters']=_[_0x0e52('0x38')](_0x7bfd64[_0x0e52('0x35')],_0x7bfd64[_0x0e52('0x36')]);_0x3693fe[_0x0e52('0x39')]=_[_0x0e52('0x38')](_0x7bfd64[_0x0e52('0x35')],qs['fields'](_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x3a')]));_0x3693fe[_0x0e52('0x39')]=_0x3693fe[_0x0e52('0x39')][_0x0e52('0x3b')]?_0x3693fe[_0x0e52('0x39')]:_0x7bfd64['model'];if(!_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x3c')](_0x0e52('0x3d'))){_0x3693fe[_0x0e52('0x22')]=qs['limit'](_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x22')]);_0x3693fe['offset']=qs[_0x0e52('0x23')](_0xb5aa93['query'][_0x0e52('0x23')]);}_0x3693fe['order']=qs[_0x0e52('0x3e')](_0xb5aa93['query'][_0x0e52('0x3e')]);_0x3693fe[_0x0e52('0x3f')]=qs[_0x0e52('0x40')](_['pick'](_0xb5aa93[_0x0e52('0x36')],_0x7bfd64[_0x0e52('0x40')]),_0x4a7d35);if(_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x41')]){_0x3693fe[_0x0e52('0x3f')]=_[_0x0e52('0x42')](_0x3693fe['where'],{'$or':_['map'](_0x4a7d35,function(_0x407dc4){if(_0x407dc4[_0x0e52('0x33')]!=='VIRTUAL'){var _0x400aee={};_0x400aee[_0x407dc4[_0x0e52('0x2d')]]={'$like':'%'+_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x41')]+'%'};return _0x400aee;}})});}_0x3693fe=_[_0x0e52('0x42')]({},_0x3693fe,_0xb5aa93[_0x0e52('0x43')]);var _0x5e2c5a={'where':_0x3693fe[_0x0e52('0x3f')]};return db[_0x0e52('0x31')][_0x0e52('0x24')](_0x5e2c5a)[_0x0e52('0x2b')](function(_0x336548){_0x12f276[_0x0e52('0x24')]=_0x336548;if(_0xb5aa93[_0x0e52('0x36')][_0x0e52('0x44')]){_0x3693fe['include']=[{'all':!![]}];}return db[_0x0e52('0x31')]['findAll'](_0x3693fe);})[_0x0e52('0x2b')](function(_0xa943b3){_0x12f276[_0x0e52('0x45')]=_0xa943b3;return _0x12f276;})['then'](respondWithFilteredResult(_0x3236b6,_0x3693fe))[_0x0e52('0x46')](handleError(_0x3236b6,null));};exports[_0x0e52('0x47')]=function(_0x38b108,_0x1068a6){var _0xe56009={'raw':!![],'where':{'id':_0x38b108[_0x0e52('0x48')]['id']}},_0x31f69a={};_0x31f69a['model']=_[_0x0e52('0x37')](db[_0x0e52('0x31')][_0x0e52('0x49')]);_0x31f69a[_0x0e52('0x36')]=_[_0x0e52('0x37')](_0x38b108[_0x0e52('0x36')]);_0x31f69a[_0x0e52('0x40')]=_['intersection'](_0x31f69a[_0x0e52('0x35')],_0x31f69a[_0x0e52('0x36')]);_0xe56009['attributes']=_[_0x0e52('0x38')](_0x31f69a[_0x0e52('0x35')],qs[_0x0e52('0x3a')](_0x38b108[_0x0e52('0x36')]['fields']));_0xe56009[_0x0e52('0x39')]=_0xe56009[_0x0e52('0x39')][_0x0e52('0x3b')]?_0xe56009[_0x0e52('0x39')]:_0x31f69a['model'];if(_0x38b108[_0x0e52('0x36')]['includeAll']){_0xe56009['include']=[{'all':!![]}];}_0xe56009=_[_0x0e52('0x42')]({},_0xe56009,_0x38b108['options']);return db['ChatInternalMessage'][_0x0e52('0x4a')](_0xe56009)['then'](handleEntityNotFound(_0x1068a6,null))['then'](respondWithResult(_0x1068a6,null))[_0x0e52('0x46')](handleError(_0x1068a6,null));};exports['create']=function(_0x3506fb,_0x645930){return db['ChatInternalMessage'][_0x0e52('0x4b')](_0x3506fb[_0x0e52('0x4c')],{})['then'](respondWithResult(_0x645930,0xc9))[_0x0e52('0x46')](handleError(_0x645930,null));};exports[_0x0e52('0x29')]=function(_0x233420,_0x54d32b){if(_0x233420['body']['id']){delete _0x233420[_0x0e52('0x4c')]['id'];}return db[_0x0e52('0x31')][_0x0e52('0x4a')]({'where':{'id':_0x233420['params']['id']}})[_0x0e52('0x2b')](handleEntityNotFound(_0x54d32b,null))['then'](saveUpdates(_0x233420[_0x0e52('0x4c')],null))[_0x0e52('0x2b')](respondWithResult(_0x54d32b,null))[_0x0e52('0x46')](handleError(_0x54d32b,null));};exports[_0x0e52('0x2a')]=function(_0x54b7a8,_0x50c8f9){return db['ChatInternalMessage'][_0x0e52('0x4a')]({'where':{'id':_0x54b7a8[_0x0e52('0x48')]['id']}})[_0x0e52('0x2b')](handleEntityNotFound(_0x50c8f9,null))['then'](removeEntity(_0x50c8f9,null))[_0x0e52('0x46')](handleError(_0x50c8f9,null));};exports[_0x0e52('0x4d')]=function(_0x5ad842,_0xc496c7){return db['ChatInternalMessage']['describe']()[_0x0e52('0x2b')](respondWithResult(_0xc496c7,null))[_0x0e52('0x46')](handleError(_0xc496c7,null));};function wrapUser(_0x4616d0){return function(_0x1b20b8){var _0x181fb8=_0x4616d0[_0x0e52('0x4e')]({'plain':!![]});_0x181fb8[_0x0e52('0x4f')]=[];if(_0x1b20b8){_0x181fb8[_0x0e52('0x50')]=_0x1b20b8[_0x0e52('0x51')];_0x181fb8[_0x0e52('0x52')]=_0x1b20b8;}else{_0x181fb8[_0x0e52('0x50')]=moment(0x0)[_0x0e52('0x53')](_0x0e52('0x54'));_0x181fb8[_0x0e52('0x52')]={};}return _0x181fb8;};}exports[_0x0e52('0x55')]=function(_0x1c4ea7,_0x5bcb68,_0x23d069){var _0x1e1705=[];return db['User'][_0x0e52('0x56')]({'where':{'role':[_0x0e52('0x57'),_0x0e52('0x58'),_0x0e52('0x59')]},'attributes':['id',_0x0e52('0x5a'),'name','role',_0x0e52('0x5b'),_0x0e52('0x5c'),_0x0e52('0x5d'),_0x0e52('0x5e'),_0x0e52('0x5f'),'showWebBar'],'order':qs[_0x0e52('0x3e')](_0x0e52('0x60')),'include':[{'model':db[_0x0e52('0x61')],'as':_0x0e52('0x62'),'attributes':['id',_0x0e52('0x2d'),_0x0e52('0x33')],'through':{'attributes':[]}}]})[_0x0e52('0x2b')](function(_0x5c20cc){if(_0x5c20cc){var _0xb03d4=_0x1c4ea7[_0x0e52('0x59')][_0x0e52('0x4e')]({'plain':!![]});if(!_0xb03d4)throw new Error(_0x0e52('0x63'));if(_0xb03d4[_0x0e52('0x64')]==='user'){return db[_0x0e52('0x65')][_0x0e52('0x4a')]({'where':{'name':'Agents','userProfileId':_0xb03d4[_0x0e52('0x66')]},'raw':!![]})[_0x0e52('0x2b')](function(_0x3aafa8){if(_0x3aafa8){if(_0x3aafa8[_0x0e52('0x67')]===0x0){return db[_0x0e52('0x68')][_0x0e52('0x56')]({'where':{'sectionId':_0x3aafa8['id']},'raw':!![]})[_0x0e52('0x2b')](function(_0x1789ab){var _0x5c7f8a=[];if(_[_0x0e52('0x69')](_0x1789ab)){_0x5c7f8a=_[_0x0e52('0x41')](_0x5c20cc,function(_0x26e21b){if(_0x26e21b[_0x0e52('0x64')]!=='agent'){return _0x26e21b;}});return _0x5c7f8a;}else{for(var _0x11a817=0x0;_0x11a817<_0x5c20cc[_0x0e52('0x3b')];_0x11a817++){var _0x2f7ede=_0x5c20cc[_0x11a817];if(_0x2f7ede[_0x0e52('0x64')]==='agent'){var _0x264671=_[_0x0e52('0x4a')](_0x1789ab,function(_0x37eb04){return _0x37eb04[_0x0e52('0x6a')]===_0x2f7ede['id'];});if(_0x264671)_0x5c7f8a[_0x0e52('0x6b')](_0x2f7ede);}else{_0x5c7f8a[_0x0e52('0x6b')](_0x2f7ede);}}return _0x5c7f8a;}});}else{return _0x5c20cc;}}else{var _0x3788af=_['filter'](_0x5c20cc,function(_0x407e27){if(_0x407e27[_0x0e52('0x64')]!=='agent'){return _0x407e27;}});return _0x3788af;}});}else{return _0x5c20cc;}}})[_0x0e52('0x2b')](function(_0x11f807){var _0x5857a6=[];if(_0x11f807){_0x1e1705=_0x11f807;for(var _0x6683fe=0x0;_0x6683fe<_0x11f807[_0x0e52('0x3b')];_0x6683fe+=0x1){_0x1e1705[_0x6683fe]['messages']=[];_0x5857a6['push'](db[_0x0e52('0x31')][_0x0e52('0x4a')]({'where':{'FromId':[_0x1c4ea7[_0x0e52('0x59')]['id'],_0x11f807[_0x6683fe]['id']],'ToId':[_0x1c4ea7[_0x0e52('0x59')]['id'],_0x11f807[_0x6683fe]['id']],'ChatGroupId':null},'attributes':['id',_0x0e52('0x51'),_0x0e52('0x6c'),_0x0e52('0x6d'),'read',_0x0e52('0x4c')],'order':qs['sort'](_0x0e52('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0e52('0x2b')](wrapUser(_0x11f807[_0x6683fe])));}return BPromise[_0x0e52('0x6f')](_0x5857a6);}return[];})['then'](function(_0x9f55c8){return{'rows':_0x9f55c8,'count':_0x9f55c8[_0x0e52('0x3b')]};})[_0x0e52('0x2b')](respondWithResult(_0x5bcb68,null))[_0x0e52('0x46')](handleError(_0x5bcb68,null));}; \ No newline at end of file +var _0xae90=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','catch','body','find','describe','get','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','findAll','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1f3cd9,_0x56f31b){var _0x355fbb=function(_0x57a282){while(--_0x57a282){_0x1f3cd9['push'](_0x1f3cd9['shift']());}};_0x355fbb(++_0x56f31b);}(_0xae90,0xd8));var _0x0ae9=function(_0x2d123c,_0x802d96){_0x2d123c=_0x2d123c-0x0;var _0x82923e=_0xae90[_0x2d123c];return _0x82923e;};'use strict';var emlformat=require(_0x0ae9('0x0'));var rimraf=require(_0x0ae9('0x1'));var zipdir=require(_0x0ae9('0x2'));var jsonpatch=require(_0x0ae9('0x3'));var rp=require(_0x0ae9('0x4'));var moment=require('moment');var BPromise=require(_0x0ae9('0x5'));var Mustache=require(_0x0ae9('0x6'));var util=require(_0x0ae9('0x7'));var path=require('path');var sox=require(_0x0ae9('0x8'));var csv=require(_0x0ae9('0x9'));var ejs=require(_0x0ae9('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae9('0xb'));var _=require(_0x0ae9('0xc'));var squel=require('squel');var crypto=require(_0x0ae9('0xd'));var jsforce=require(_0x0ae9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0ae9('0xf'));var Papa=require(_0x0ae9('0x10'));var Redis=require(_0x0ae9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0ae9('0x12'));var as=require(_0x0ae9('0x13'));var hardwareService=require(_0x0ae9('0x14'));var logger=require(_0x0ae9('0x15'))(_0x0ae9('0x16'));var utils=require(_0x0ae9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0ae9('0x18'));var db=require(_0x0ae9('0x19'))['db'];config[_0x0ae9('0x1a')]=_[_0x0ae9('0x1b')](config['redis'],{'host':_0x0ae9('0x1c'),'port':0x18eb});var socket=require(_0x0ae9('0x1d'))(new Redis(config[_0x0ae9('0x1a')]));require('./chatInternalMessage.socket')[_0x0ae9('0x1e')](socket);function respondWithStatusCode(_0x2ad677,_0x49354d){_0x49354d=_0x49354d||0xcc;return function(_0x4286ec){if(_0x4286ec){return _0x2ad677['sendStatus'](_0x49354d);}return _0x2ad677[_0x0ae9('0x1f')](_0x49354d)[_0x0ae9('0x20')]();};}function respondWithResult(_0x53c1df,_0x5ad805){_0x5ad805=_0x5ad805||0xc8;return function(_0x245f50){if(_0x245f50){return _0x53c1df['status'](_0x5ad805)[_0x0ae9('0x21')](_0x245f50);}};}function respondWithFilteredResult(_0x2f6e5c,_0x468083){return function(_0x5cecc2){if(_0x5cecc2){var _0x4f76af=typeof _0x468083['offset']===_0x0ae9('0x22')&&typeof _0x468083['limit']===_0x0ae9('0x22');var _0x4a70c7=_0x5cecc2['count'];var _0x340b1d=_0x4f76af?0x0:_0x468083['offset'];var _0xdbc884=_0x4f76af?_0x5cecc2[_0x0ae9('0x23')]:_0x468083['offset']+_0x468083[_0x0ae9('0x24')];var _0x49c7d8;if(_0xdbc884>=_0x4a70c7){_0xdbc884=_0x4a70c7;_0x49c7d8=0xc8;}else{_0x49c7d8=0xce;}_0x2f6e5c[_0x0ae9('0x1f')](_0x49c7d8);return _0x2f6e5c[_0x0ae9('0x25')](_0x0ae9('0x26'),_0x340b1d+'-'+_0xdbc884+'/'+_0x4a70c7)['json'](_0x5cecc2);}return null;};}function patchUpdates(_0x529475){return function(_0x32476f){try{jsonpatch[_0x0ae9('0x27')](_0x32476f,_0x529475,!![]);}catch(_0x4a022b){return BPromise[_0x0ae9('0x28')](_0x4a022b);}return _0x32476f['save']();};}function saveUpdates(_0x3eed2a,_0x542843){return function(_0x696498){if(_0x696498){return _0x696498[_0x0ae9('0x29')](_0x3eed2a)[_0x0ae9('0x2a')](function(_0x5e9d4f){return _0x5e9d4f;});}return null;};}function removeEntity(_0x24cb1e,_0x14d2b9){return function(_0x13a834){if(_0x13a834){return _0x13a834['destroy']()[_0x0ae9('0x2a')](function(){_0x24cb1e[_0x0ae9('0x1f')](0xcc)[_0x0ae9('0x20')]();});}};}function handleEntityNotFound(_0x30376a,_0x55bc2c){return function(_0x5e9b54){if(!_0x5e9b54){_0x30376a['sendStatus'](0x194);}return _0x5e9b54;};}function handleError(_0x4a85bb,_0x41c6ef){_0x41c6ef=_0x41c6ef||0x1f4;return function(_0x371672){logger[_0x0ae9('0x2b')](_0x371672[_0x0ae9('0x2c')]);if(_0x371672[_0x0ae9('0x2d')]){delete _0x371672[_0x0ae9('0x2d')];}_0x4a85bb[_0x0ae9('0x1f')](_0x41c6ef)[_0x0ae9('0x2e')](_0x371672);};}exports[_0x0ae9('0x2f')]=function(_0x323add,_0x59c018){var _0x494a01={},_0x453312={},_0x4bdc94={'count':0x0,'rows':[]};var _0x3de03e=_[_0x0ae9('0x30')](db[_0x0ae9('0x31')][_0x0ae9('0x32')],function(_0x16fc56){return{'name':_0x16fc56[_0x0ae9('0x33')],'type':_0x16fc56[_0x0ae9('0x34')][_0x0ae9('0x35')]};});_0x453312[_0x0ae9('0x36')]=_[_0x0ae9('0x30')](_0x3de03e,'name');_0x453312[_0x0ae9('0x37')]=_[_0x0ae9('0x38')](_0x323add[_0x0ae9('0x37')]);_0x453312[_0x0ae9('0x39')]=_[_0x0ae9('0x3a')](_0x453312[_0x0ae9('0x36')],_0x453312[_0x0ae9('0x37')]);_0x494a01['attributes']=_[_0x0ae9('0x3a')](_0x453312['model'],qs[_0x0ae9('0x3b')](_0x323add[_0x0ae9('0x37')][_0x0ae9('0x3b')]));_0x494a01['attributes']=_0x494a01[_0x0ae9('0x3c')][_0x0ae9('0x3d')]?_0x494a01[_0x0ae9('0x3c')]:_0x453312[_0x0ae9('0x36')];if(!_0x323add[_0x0ae9('0x37')][_0x0ae9('0x3e')]('nolimit')){_0x494a01[_0x0ae9('0x24')]=qs[_0x0ae9('0x24')](_0x323add['query'][_0x0ae9('0x24')]);_0x494a01['offset']=qs[_0x0ae9('0x3f')](_0x323add[_0x0ae9('0x37')][_0x0ae9('0x3f')]);}_0x494a01['order']=qs[_0x0ae9('0x40')](_0x323add[_0x0ae9('0x37')]['sort']);_0x494a01['where']=qs[_0x0ae9('0x39')](_[_0x0ae9('0x41')](_0x323add[_0x0ae9('0x37')],_0x453312[_0x0ae9('0x39')]),_0x3de03e);if(_0x323add[_0x0ae9('0x37')]['filter']){_0x494a01[_0x0ae9('0x42')]=_[_0x0ae9('0x43')](_0x494a01[_0x0ae9('0x42')],{'$or':_['map'](_0x3de03e,function(_0x233bf6){if(_0x233bf6[_0x0ae9('0x34')]!==_0x0ae9('0x44')){var _0x4f6a52={};_0x4f6a52[_0x233bf6['name']]={'$like':'%'+_0x323add[_0x0ae9('0x37')][_0x0ae9('0x45')]+'%'};return _0x4f6a52;}})});}_0x494a01=_[_0x0ae9('0x43')]({},_0x494a01,_0x323add[_0x0ae9('0x46')]);var _0x3955da={'where':_0x494a01['where']};return db['ChatInternalMessage'][_0x0ae9('0x23')](_0x3955da)[_0x0ae9('0x2a')](function(_0x4e9b44){_0x4bdc94['count']=_0x4e9b44;if(_0x323add[_0x0ae9('0x37')][_0x0ae9('0x47')]){_0x494a01[_0x0ae9('0x48')]=[{'all':!![]}];}return db[_0x0ae9('0x31')]['findAll'](_0x494a01);})[_0x0ae9('0x2a')](function(_0x1c76cb){_0x4bdc94[_0x0ae9('0x49')]=_0x1c76cb;return _0x4bdc94;})[_0x0ae9('0x2a')](respondWithFilteredResult(_0x59c018,_0x494a01))['catch'](handleError(_0x59c018,null));};exports['show']=function(_0x30caa3,_0x117dd7){var _0x5d9f0c={'raw':!![],'where':{'id':_0x30caa3[_0x0ae9('0x4a')]['id']}},_0x382333={};_0x382333[_0x0ae9('0x36')]=_[_0x0ae9('0x38')](db[_0x0ae9('0x31')][_0x0ae9('0x32')]);_0x382333[_0x0ae9('0x37')]=_[_0x0ae9('0x38')](_0x30caa3['query']);_0x382333[_0x0ae9('0x39')]=_['intersection'](_0x382333[_0x0ae9('0x36')],_0x382333[_0x0ae9('0x37')]);_0x5d9f0c[_0x0ae9('0x3c')]=_[_0x0ae9('0x3a')](_0x382333[_0x0ae9('0x36')],qs['fields'](_0x30caa3['query'][_0x0ae9('0x3b')]));_0x5d9f0c['attributes']=_0x5d9f0c[_0x0ae9('0x3c')]['length']?_0x5d9f0c[_0x0ae9('0x3c')]:_0x382333[_0x0ae9('0x36')];if(_0x30caa3['query']['includeAll']){_0x5d9f0c['include']=[{'all':!![]}];}_0x5d9f0c=_[_0x0ae9('0x43')]({},_0x5d9f0c,_0x30caa3[_0x0ae9('0x46')]);return db[_0x0ae9('0x31')]['find'](_0x5d9f0c)[_0x0ae9('0x2a')](handleEntityNotFound(_0x117dd7,null))[_0x0ae9('0x2a')](respondWithResult(_0x117dd7,null))[_0x0ae9('0x4b')](handleError(_0x117dd7,null));};exports['create']=function(_0x485d2b,_0x3b7079){return db[_0x0ae9('0x31')]['create'](_0x485d2b['body'],{})[_0x0ae9('0x2a')](respondWithResult(_0x3b7079,0xc9))[_0x0ae9('0x4b')](handleError(_0x3b7079,null));};exports[_0x0ae9('0x29')]=function(_0x4079ec,_0x376f5e){if(_0x4079ec[_0x0ae9('0x4c')]['id']){delete _0x4079ec[_0x0ae9('0x4c')]['id'];}return db[_0x0ae9('0x31')]['find']({'where':{'id':_0x4079ec[_0x0ae9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x376f5e,null))[_0x0ae9('0x2a')](saveUpdates(_0x4079ec[_0x0ae9('0x4c')],null))[_0x0ae9('0x2a')](respondWithResult(_0x376f5e,null))[_0x0ae9('0x4b')](handleError(_0x376f5e,null));};exports['destroy']=function(_0x5d9c93,_0x2884ca){return db[_0x0ae9('0x31')][_0x0ae9('0x4d')]({'where':{'id':_0x5d9c93[_0x0ae9('0x4a')]['id']}})[_0x0ae9('0x2a')](handleEntityNotFound(_0x2884ca,null))[_0x0ae9('0x2a')](removeEntity(_0x2884ca,null))['catch'](handleError(_0x2884ca,null));};exports[_0x0ae9('0x4e')]=function(_0x47e856,_0x10cb68){return db[_0x0ae9('0x31')]['describe']()[_0x0ae9('0x2a')](respondWithResult(_0x10cb68,null))[_0x0ae9('0x4b')](handleError(_0x10cb68,null));};function wrapUser(_0x5d4523){return function(_0x11443b){var _0x46569b=_0x5d4523[_0x0ae9('0x4f')]({'plain':!![]});_0x46569b['messages']=[];if(_0x11443b){_0x46569b['lastMessageAt']=_0x11443b[_0x0ae9('0x50')];_0x46569b['lastMessage']=_0x11443b;}else{_0x46569b[_0x0ae9('0x51')]=moment(0x0)[_0x0ae9('0x52')](_0x0ae9('0x53'));_0x46569b[_0x0ae9('0x54')]={};}return _0x46569b;};}exports['getUsers']=function(_0x10b140,_0x1c498e,_0x21f3be){var _0x82d0b6=[];return db[_0x0ae9('0x55')][_0x0ae9('0x56')]({'where':{'role':[_0x0ae9('0x57'),_0x0ae9('0x58'),_0x0ae9('0x59')]},'attributes':['id','fullname',_0x0ae9('0x2d'),_0x0ae9('0x5a'),_0x0ae9('0x5b'),'internal',_0x0ae9('0x5c'),_0x0ae9('0x5d'),_0x0ae9('0x5e'),_0x0ae9('0x5f')],'order':qs[_0x0ae9('0x40')](_0x0ae9('0x60')),'include':[{'model':db[_0x0ae9('0x61')],'as':'VoiceQueues','attributes':['id',_0x0ae9('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x0ae9('0x2a')](function(_0x129ad2){if(_0x129ad2){var _0x7b852b=_0x10b140[_0x0ae9('0x59')]['get']({'plain':!![]});if(!_0x7b852b)throw new Error(_0x0ae9('0x62'));if(_0x7b852b[_0x0ae9('0x5a')]==='user'){return db[_0x0ae9('0x63')][_0x0ae9('0x4d')]({'where':{'name':_0x0ae9('0x64'),'userProfileId':_0x7b852b[_0x0ae9('0x65')]},'raw':!![]})[_0x0ae9('0x2a')](function(_0x208698){if(_0x208698){if(_0x208698[_0x0ae9('0x66')]===0x0){return db[_0x0ae9('0x67')][_0x0ae9('0x56')]({'where':{'sectionId':_0x208698['id']},'raw':!![]})[_0x0ae9('0x2a')](function(_0x5c7e38){var _0x27f085=[];if(_['isEmpty'](_0x5c7e38)){_0x27f085=_[_0x0ae9('0x45')](_0x129ad2,function(_0x1667fe){if(_0x1667fe[_0x0ae9('0x5a')]!==_0x0ae9('0x57')){return _0x1667fe;}});return _0x27f085;}else{for(var _0x24138b=0x0;_0x24138b<_0x129ad2[_0x0ae9('0x3d')];_0x24138b++){var _0x2a7bf2=_0x129ad2[_0x24138b];if(_0x2a7bf2['role']===_0x0ae9('0x57')){var _0x344491=_[_0x0ae9('0x4d')](_0x5c7e38,function(_0x12b9b3){return _0x12b9b3[_0x0ae9('0x68')]===_0x2a7bf2['id'];});if(_0x344491)_0x27f085[_0x0ae9('0x69')](_0x2a7bf2);}else{_0x27f085[_0x0ae9('0x69')](_0x2a7bf2);}}return _0x27f085;}});}else{return _0x129ad2;}}else{var _0x4e7427=_[_0x0ae9('0x45')](_0x129ad2,function(_0x130b6a){if(_0x130b6a[_0x0ae9('0x5a')]!==_0x0ae9('0x57')){return _0x130b6a;}});return _0x4e7427;}});}else{return _0x129ad2;}}})['then'](function(_0x92758b){var _0x3a11a5=[];if(_0x92758b){_0x82d0b6=_0x92758b;for(var _0x508361=0x0;_0x508361<_0x92758b['length'];_0x508361+=0x1){_0x82d0b6[_0x508361][_0x0ae9('0x6a')]=[];_0x3a11a5[_0x0ae9('0x69')](db['ChatInternalMessage'][_0x0ae9('0x4d')]({'where':{'FromId':[_0x10b140[_0x0ae9('0x59')]['id'],_0x92758b[_0x508361]['id']],'ToId':[_0x10b140['user']['id'],_0x92758b[_0x508361]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x0ae9('0x6b'),'ToId','read',_0x0ae9('0x4c')],'order':qs[_0x0ae9('0x40')](_0x0ae9('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x92758b[_0x508361])));}return BPromise[_0x0ae9('0x6d')](_0x3a11a5);}return[];})[_0x0ae9('0x2a')](function(_0x206c95){return{'rows':_0x206c95,'count':_0x206c95[_0x0ae9('0x3d')]};})[_0x0ae9('0x2a')](respondWithResult(_0x1c498e,null))['catch'](handleError(_0x1c498e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f1679c8..a5c2993 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 _0xfd5b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xfd5b,0x15a));var _0xbfd5=function(_0x5078ab,_0x4422ca){_0x5078ab=_0x5078ab-0x0;var _0x248e42=_0xfd5b[_0x5078ab];return _0x248e42;};'use strict';var EventEmitter=require(_0xbfd5('0x0'));var ChatInternalMessage=require(_0xbfd5('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbfd5('0x2')](0x0);var events={'afterCreate':_0xbfd5('0x3'),'afterUpdate':_0xbfd5('0x4'),'afterDestroy':_0xbfd5('0x5')};function emitEvent(_0x154a10){return function(_0x37c974,_0x1fb6ba,_0x16738b){ChatInternalMessageEvents[_0xbfd5('0x6')](_0x154a10+':'+_0x37c974['id'],_0x37c974);ChatInternalMessageEvents[_0xbfd5('0x6')](_0x154a10,_0x37c974);_0x16738b(null);};}for(var e in events){if(events[_0xbfd5('0x7')](e)){var event=events[e];ChatInternalMessage[_0xbfd5('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x5e83=['hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x591df1,_0xd2030b){var _0x28f068=function(_0x38bbd8){while(--_0x38bbd8){_0x591df1['push'](_0x591df1['shift']());}};_0x28f068(++_0xd2030b);}(_0x5e83,0x198));var _0x35e8=function(_0x2cd718,_0x1ab5dd){_0x2cd718=_0x2cd718-0x0;var _0x4c02ba=_0x5e83[_0x2cd718];return _0x4c02ba;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x35e8('0x0'))['db'][_0x35e8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35e8('0x2'),'afterUpdate':_0x35e8('0x3'),'afterDestroy':_0x35e8('0x4')};function emitEvent(_0x424e52){return function(_0x21090a,_0x34bac5,_0x1e7d81){ChatInternalMessageEvents['emit'](_0x424e52+':'+_0x21090a['id'],_0x21090a);ChatInternalMessageEvents[_0x35e8('0x5')](_0x424e52,_0x21090a);_0x1e7d81(null);};}for(var e in events){if(events[_0x35e8('0x6')](e)){var event=events[e];ChatInternalMessage[_0x35e8('0x7')](e,emitEvent(event));}}module[_0x35e8('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 da696ee..8d209ec 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 _0x0c45=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x248170,_0x2caf89){var _0x401039=function(_0xf55a0a){while(--_0xf55a0a){_0x248170['push'](_0x248170['shift']());}};_0x401039(++_0x2caf89);}(_0x0c45,0x114));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require(_0x50c4('0x1'));var logger=require(_0x50c4('0x2'))(_0x50c4('0x3'));var moment=require(_0x50c4('0x4'));var BPromise=require(_0x50c4('0x5'));var rp=require(_0x50c4('0x6'));var fs=require('fs');var path=require(_0x50c4('0x7'));var rimraf=require('rimraf');var config=require(_0x50c4('0x8'));var attributes=require(_0x50c4('0x9'));module[_0x50c4('0xa')]=function(_0x5869af,_0x266633){return _0x5869af[_0x50c4('0xb')](_0x50c4('0xc'),attributes,{'tableName':_0x50c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50c4('0xe'),'collate':_0x50c4('0xf')});}; \ No newline at end of file +var _0xc3b0=['ChatInternalMessage','chat_internal_messages','util','api','moment','request-promise','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x3cb9bc,_0x1c95f5){var _0x5d13ec=function(_0x12feae){while(--_0x12feae){_0x3cb9bc['push'](_0x3cb9bc['shift']());}};_0x5d13ec(++_0x1c95f5);}(_0xc3b0,0xc8));var _0x0c3b=function(_0x42c995,_0x5e4e67){_0x42c995=_0x42c995-0x0;var _0x34f4d8=_0xc3b0[_0x42c995];return _0x34f4d8;};'use strict';var _=require('lodash');var util=require(_0x0c3b('0x0'));var logger=require('../../config/logger')(_0x0c3b('0x1'));var moment=require(_0x0c3b('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c3b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c3b('0x4'));var config=require('../../config/environment');var attributes=require(_0x0c3b('0x5'));module[_0x0c3b('0x6')]=function(_0x5a5449,_0x40f538){return _0x5a5449['define'](_0x0c3b('0x7'),attributes,{'tableName':_0x0c3b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6186b55..98bb738 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 _0x9b08=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x3a223a,_0x303433){var _0xb6ac7d=function(_0x4a076d){while(--_0x4a076d){_0x3a223a['push'](_0x3a223a['shift']());}};_0xb6ac7d(++_0x303433);}(_0x9b08,0x1ea));var _0x89b0=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x9b08[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89b0('0x2'));var fs=require('fs');var Redis=require(_0x89b0('0x3'));var db=require(_0x89b0('0x4'))['db'];var utils=require(_0x89b0('0x5'));var logger=require(_0x89b0('0x6'))(_0x89b0('0x7'));var config=require(_0x89b0('0x8'));var jayson=require(_0x89b0('0x9'));var client=jayson['client'][_0x89b0('0xa')]({'port':0x232a});config[_0x89b0('0xb')]=_[_0x89b0('0xc')](config[_0x89b0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x89b0('0xd'))(new Redis(config[_0x89b0('0xb')]));require(_0x89b0('0xe'))[_0x89b0('0xf')](socket);function respondWithRpcPromise(_0xa79c19,_0x204524,_0x4d3484){return new BPromise(function(_0x164c91,_0x50c267){return client[_0x89b0('0x10')](_0xa79c19,_0x4d3484)[_0x89b0('0x11')](function(_0x5f797){logger[_0x89b0('0x12')](_0x89b0('0x13'),_0x204524,_0x89b0('0x14'));logger[_0x89b0('0x15')](_0x89b0('0x16'),_0x204524,_0x89b0('0x14'),JSON[_0x89b0('0x17')](_0x5f797));if(_0x5f797[_0x89b0('0x18')]){if(_0x5f797[_0x89b0('0x18')][_0x89b0('0x19')]===0x1f4){logger[_0x89b0('0x18')](_0x89b0('0x13'),_0x204524,_0x5f797[_0x89b0('0x18')][_0x89b0('0x1a')]);return _0x50c267(_0x5f797[_0x89b0('0x18')]['message']);}logger[_0x89b0('0x18')](_0x89b0('0x13'),_0x204524,_0x5f797[_0x89b0('0x18')][_0x89b0('0x1a')]);return _0x164c91(_0x5f797['error'][_0x89b0('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x204524,_0x89b0('0x14'));_0x164c91(_0x5f797[_0x89b0('0x1b')][_0x89b0('0x1a')]);}})[_0x89b0('0x1c')](function(_0x125000){logger[_0x89b0('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x204524,_0x125000);_0x50c267(_0x125000);});});} \ No newline at end of file +var _0x06f4=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info'];(function(_0x34ab14,_0x228d49){var _0x52c36b=function(_0x170fc2){while(--_0x170fc2){_0x34ab14['push'](_0x34ab14['shift']());}};_0x52c36b(++_0x228d49);}(_0x06f4,0x136));var _0x406f=function(_0x3b7e19,_0x5f1c51){_0x3b7e19=_0x3b7e19-0x0;var _0x2b45bb=_0x06f4[_0x3b7e19];return _0x2b45bb;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var jayson=require(_0x406f('0x7'));var client=jayson[_0x406f('0x8')]['http']({'port':0x232a});config[_0x406f('0x9')]=_['defaults'](config[_0x406f('0x9')],{'host':_0x406f('0xa'),'port':0x18eb});var socket=require(_0x406f('0xb'))(new Redis(config['redis']));require(_0x406f('0xc'))['register'](socket);function respondWithRpcPromise(_0x5b46bf,_0xd817eb,_0x56edc2){return new BPromise(function(_0x28c5a5,_0x4e0e96){return client[_0x406f('0xd')](_0x5b46bf,_0x56edc2)['then'](function(_0xb2c62d){logger[_0x406f('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0xd817eb,_0x406f('0xf'));logger[_0x406f('0x10')](_0x406f('0x11'),_0xd817eb,_0x406f('0xf'),JSON[_0x406f('0x12')](_0xb2c62d));if(_0xb2c62d[_0x406f('0x13')]){if(_0xb2c62d[_0x406f('0x13')][_0x406f('0x14')]===0x1f4){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0xb2c62d[_0x406f('0x13')]['message']);return _0x4e0e96(_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);}logger[_0x406f('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xd817eb,_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);return _0x28c5a5(_0xb2c62d['error']['message']);}else{logger[_0x406f('0xe')](_0x406f('0x15'),_0xd817eb,'request\x20sent');_0x28c5a5(_0xb2c62d[_0x406f('0x17')]['message']);}})[_0x406f('0x18')](function(_0x3ad3fe){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0x3ad3fe);_0x4e0e96(_0x3ad3fe);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index b303f58..1dc7e5e 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 _0xd5b3=['length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener','register'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xd5b3,0x1c2));var _0x3d5b=function(_0x385314,_0x23ec21){_0x385314=_0x385314-0x0;var _0x5ed4e4=_0xd5b3[_0x385314];return _0x5ed4e4;};'use strict';var ChatInternalMessageEvents=require(_0x3d5b('0x0'));var events=[_0x3d5b('0x1'),'remove',_0x3d5b('0x2')];function createListener(_0x24e27f,_0x1e4241){return function(_0x168bc3){_0x1e4241[_0x3d5b('0x3')](_0x24e27f,_0x168bc3);};}function removeListener(_0x2bf06b,_0x47c029){return function(){ChatInternalMessageEvents[_0x3d5b('0x4')](_0x2bf06b,_0x47c029);};}exports[_0x3d5b('0x5')]=function(_0x342936){for(var _0x28a9bb=0x0,_0x175c8d=events[_0x3d5b('0x6')];_0x28a9bb<_0x175c8d;_0x28a9bb++){var _0x33cce5=events[_0x28a9bb];var _0x50971d=createListener(_0x3d5b('0x7')+_0x33cce5,_0x342936);ChatInternalMessageEvents['on'](_0x33cce5,_0x50971d);}}; \ No newline at end of file +var _0xe65b=['removeListener','register','length','chatInternalMessage:','save','remove','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe65b,0x15c));var _0xbe65=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe65b[_0x413feb];return _0x40ee88;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xbe65('0x0'),_0xbe65('0x1'),_0xbe65('0x2')];function createListener(_0x10507f,_0x486947){return function(_0x335065){_0x486947[_0xbe65('0x3')](_0x10507f,_0x335065);};}function removeListener(_0x4b2bfb,_0x182182){return function(){ChatInternalMessageEvents[_0xbe65('0x4')](_0x4b2bfb,_0x182182);};}exports[_0xbe65('0x5')]=function(_0x16ebcf){for(var _0x40e3aa=0x0,_0x552fe2=events[_0xbe65('0x6')];_0x40e3aa<_0x552fe2;_0x40e3aa++){var _0x492594=events[_0x40e3aa];var _0x16e13c=createListener(_0xbe65('0x7')+_0x492594,_0x16ebcf);ChatInternalMessageEvents['on'](_0x492594,_0x16e13c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8a6ba56..835bc04 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 _0x1bdd=['index','/describe','getUsers','show','post','create','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x1bdd,0x129));var _0xd1bd=function(_0x1654fc,_0x2a775d){_0x1654fc=_0x1654fc-0x0;var _0x2db2eb=_0x1bdd[_0x1654fc];return _0x2db2eb;};'use strict';var multer=require('multer');var util=require(_0xd1bd('0x0'));var path=require(_0xd1bd('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1bd('0x2'));var router=express[_0xd1bd('0x3')]();var fs_extra=require(_0xd1bd('0x4'));var auth=require(_0xd1bd('0x5'));var interaction=require(_0xd1bd('0x6'));var config=require(_0xd1bd('0x7'));var controller=require(_0xd1bd('0x8'));router[_0xd1bd('0x9')]('/',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xb')]);router[_0xd1bd('0x9')](_0xd1bd('0xc'),auth[_0xd1bd('0xa')](),controller['describe']);router[_0xd1bd('0x9')]('/users',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xd')]);router[_0xd1bd('0x9')]('/:id',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0xe')]);router[_0xd1bd('0xf')]('/',auth[_0xd1bd('0xa')](),controller[_0xd1bd('0x10')]);router[_0xd1bd('0x11')](_0xd1bd('0x12'),controller['update']);router[_0xd1bd('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd1bd('0x14')]);module[_0xd1bd('0x15')]=router; \ No newline at end of file +var _0x5fe8=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5cb25e,_0x45dd22){var _0x79fff=function(_0x49718d){while(--_0x49718d){_0x5cb25e['push'](_0x5cb25e['shift']());}};_0x79fff(++_0x45dd22);}(_0x5fe8,0x8c));var _0x85fe=function(_0x2b5b9c,_0x48c1fe){_0x2b5b9c=_0x2b5b9c-0x0;var _0x359604=_0x5fe8[_0x2b5b9c];return _0x359604;};'use strict';var multer=require(_0x85fe('0x0'));var util=require(_0x85fe('0x1'));var path=require('path');var timeout=require(_0x85fe('0x2'));var express=require(_0x85fe('0x3'));var router=express[_0x85fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x85fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x85fe('0x6'));var controller=require(_0x85fe('0x7'));router[_0x85fe('0x8')]('/',auth[_0x85fe('0x9')](),controller[_0x85fe('0xa')]);router[_0x85fe('0x8')](_0x85fe('0xb'),auth[_0x85fe('0x9')](),controller[_0x85fe('0xc')]);router[_0x85fe('0x8')](_0x85fe('0xd'),auth[_0x85fe('0x9')](),controller[_0x85fe('0xe')]);router[_0x85fe('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x85fe('0x9')](),controller['create']);router[_0x85fe('0xf')]('/:id',controller[_0x85fe('0x10')]);router[_0x85fe('0x11')](_0x85fe('0x12'),auth[_0x85fe('0x9')](),controller[_0x85fe('0x13')]);module[_0x85fe('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 6230a8d..0006668 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 _0x253d=['out','DATE','TEXT','sequelize','BOOLEAN','ENUM'];(function(_0x403c00,_0x14a828){var _0x57985c=function(_0xdd59e8){while(--_0xdd59e8){_0x403c00['push'](_0x403c00['shift']());}};_0x57985c(++_0x14a828);}(_0x253d,0x1b3));var _0xd253=function(_0x44e240,_0x4357a4){_0x44e240=_0x44e240-0x0;var _0x5670cf=_0x253d[_0x44e240];return _0x5670cf;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd253('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd253('0x2')]('in',_0xd253('0x3')),'defaultValue':_0xd253('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd253('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd253('0x5')]}}; \ No newline at end of file +var _0x8164=['out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x26a82e,_0x26eb8a){var _0x54d187=function(_0x16cb68){while(--_0x16cb68){_0x26a82e['push'](_0x26a82e['shift']());}};_0x54d187(++_0x26eb8a);}(_0x8164,0x170));var _0x4816=function(_0x127728,_0x11c9c5){_0x127728=_0x127728-0x0;var _0x3b6cfe=_0x8164[_0x127728];return _0x3b6cfe;};'use strict';var Sequelize=require(_0x4816('0x0'));module[_0x4816('0x1')]={'body':{'type':Sequelize[_0x4816('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4816('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4816('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4816('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4816('0x5')]},'providerName':{'type':Sequelize['STRING']},'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 ce9ebdc..ac7fd73 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 _0x41ff=['./chatMessage.socket','jayson/promise','client','http','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','then','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','contact','email','internal','reject','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','socket.io-emitter','redis'];(function(_0x47f8cb,_0x44459e){var _0x24a7d6=function(_0x33aa4e){while(--_0x33aa4e){_0x47f8cb['push'](_0x47f8cb['shift']());}};_0x24a7d6(++_0x44459e);}(_0x41ff,0x16c));var _0xf41f=function(_0x16c387,_0x19538a){_0x16c387=_0x16c387-0x0;var _0x45b8d6=_0x41ff[_0x16c387];return _0x45b8d6;};'use strict';var emlformat=require(_0xf41f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf41f('0x1'));var jsonpatch=require(_0xf41f('0x2'));var rp=require(_0xf41f('0x3'));var moment=require(_0xf41f('0x4'));var BPromise=require(_0xf41f('0x5'));var Mustache=require('mustache');var util=require(_0xf41f('0x6'));var path=require('path');var sox=require(_0xf41f('0x7'));var csv=require('to-csv');var ejs=require(_0xf41f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf41f('0x9'));var squel=require(_0xf41f('0xa'));var crypto=require(_0xf41f('0xb'));var jsforce=require(_0xf41f('0xc'));var deskjs=require(_0xf41f('0xd'));var toCsv=require(_0xf41f('0xe'));var querystring=require(_0xf41f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf41f('0x10'));var qs=require(_0xf41f('0x11'));var as=require(_0xf41f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf41f('0x13'))(_0xf41f('0x14'));var utils=require(_0xf41f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf41f('0x16'))['db'];config['redis']=_[_0xf41f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf41f('0x18'))(new Redis(config[_0xf41f('0x19')]));require(_0xf41f('0x1a'))['register'](socket);var jayson=require(_0xf41f('0x1b'));var client=jayson[_0xf41f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf41f('0x1c')][_0xf41f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x249b9b,_0x48ea42,_0x24abaf,_0x2e28e3){return new BPromise(function(_0x5035f0,_0x2eda3e){var _0x1d0324=_0x2e28e3||client;return _0x1d0324[_0xf41f('0x1e')](_0x249b9b,_0x24abaf)['then'](function(_0x3b53fc){logger[_0xf41f('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x48ea42,'request\x20sent');logger[_0xf41f('0x20')](_0xf41f('0x21'),_0x48ea42,_0xf41f('0x22'),JSON[_0xf41f('0x23')](_0x3b53fc));if(_0x3b53fc[_0xf41f('0x24')]){if(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x25')]===0x1f4){logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);return _0x2eda3e(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);}logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);return _0x5035f0(_0x3b53fc[_0xf41f('0x24')][_0xf41f('0x27')]);}else{logger[_0xf41f('0x1f')](_0xf41f('0x26'),_0x48ea42,_0xf41f('0x22'));_0x5035f0(_0x3b53fc[_0xf41f('0x28')][_0xf41f('0x27')]);}})['catch'](function(_0x19ef37){logger[_0xf41f('0x24')](_0xf41f('0x26'),_0x48ea42,_0x19ef37);_0x2eda3e(_0x19ef37);});});}function respondWithStatusCode(_0x99e029,_0x2db363){_0x2db363=_0x2db363||0xcc;return function(_0x3ba9bd){if(_0x3ba9bd){return _0x99e029[_0xf41f('0x29')](_0x2db363);}return _0x99e029[_0xf41f('0x2a')](_0x2db363)[_0xf41f('0x2b')]();};}function respondWithResult(_0x4ce728,_0x20ff8b){_0x20ff8b=_0x20ff8b||0xc8;return function(_0x54b3ae){if(_0x54b3ae){return _0x4ce728[_0xf41f('0x2a')](_0x20ff8b)[_0xf41f('0x2c')](_0x54b3ae);}};}function respondWithFilteredResult(_0x44d229,_0x212e55){return function(_0x4ff8b4){if(_0x4ff8b4){var _0x1b3ded=typeof _0x212e55['offset']==='undefined'&&typeof _0x212e55['limit']==='undefined';var _0x37a15d=_0x4ff8b4[_0xf41f('0x2d')];var _0x37f1ea=_0x1b3ded?0x0:_0x212e55[_0xf41f('0x2e')];var _0x4ef722=_0x1b3ded?_0x4ff8b4[_0xf41f('0x2d')]:_0x212e55[_0xf41f('0x2e')]+_0x212e55[_0xf41f('0x2f')];var _0x2cce8;if(_0x4ef722>=_0x37a15d){_0x4ef722=_0x37a15d;_0x2cce8=0xc8;}else{_0x2cce8=0xce;}_0x44d229['status'](_0x2cce8);return _0x44d229[_0xf41f('0x30')]('Content-Range',_0x37f1ea+'-'+_0x4ef722+'/'+_0x37a15d)['json'](_0x4ff8b4);}return null;};}function patchUpdates(_0x1af579){return function(_0x4de2a8){try{jsonpatch[_0xf41f('0x31')](_0x4de2a8,_0x1af579,!![]);}catch(_0x304302){return BPromise['reject'](_0x304302);}return _0x4de2a8[_0xf41f('0x32')]();};}function saveUpdates(_0xcf1c9d,_0x5297c1){return function(_0x19d979){if(_0x19d979){return _0x19d979[_0xf41f('0x33')](_0xcf1c9d)['then'](function(_0x4a46c2){return _0x4a46c2;});}return null;};}function removeEntity(_0x2d8ed6,_0x558c62){return function(_0x7aebb){if(_0x7aebb){return _0x7aebb[_0xf41f('0x34')]()[_0xf41f('0x35')](function(){_0x2d8ed6[_0xf41f('0x2a')](0xcc)[_0xf41f('0x2b')]();});}};}function handleEntityNotFound(_0x295ce6,_0x6321d0){return function(_0x425796){if(!_0x425796){_0x295ce6[_0xf41f('0x29')](0x194);}return _0x425796;};}function handleError(_0x45e65f,_0x366aba){_0x366aba=_0x366aba||0x1f4;return function(_0x4d5535){logger[_0xf41f('0x24')](_0x4d5535[_0xf41f('0x36')]);if(_0x4d5535[_0xf41f('0x37')]){delete _0x4d5535[_0xf41f('0x37')];}_0x45e65f['status'](_0x366aba)[_0xf41f('0x38')](_0x4d5535);};}exports['index']=function(_0x1da223,_0x39df75){var _0x2c5b6b={},_0x192f00={},_0xe0105a={'count':0x0,'rows':[]};var _0x8d7dec=_[_0xf41f('0x39')](db[_0xf41f('0x3a')][_0xf41f('0x3b')],function(_0x359822){return{'name':_0x359822[_0xf41f('0x3c')],'type':_0x359822['type'][_0xf41f('0x3d')]};});_0x192f00[_0xf41f('0x3e')]=_[_0xf41f('0x39')](_0x8d7dec,_0xf41f('0x37'));_0x192f00[_0xf41f('0x3f')]=_['keys'](_0x1da223['query']);_0x192f00['filters']=_['intersection'](_0x192f00[_0xf41f('0x3e')],_0x192f00['query']);_0x2c5b6b[_0xf41f('0x40')]=_[_0xf41f('0x41')](_0x192f00[_0xf41f('0x3e')],qs[_0xf41f('0x42')](_0x1da223[_0xf41f('0x3f')][_0xf41f('0x42')]));_0x2c5b6b['attributes']=_0x2c5b6b[_0xf41f('0x40')][_0xf41f('0x43')]?_0x2c5b6b['attributes']:_0x192f00['model'];if(!_0x1da223[_0xf41f('0x3f')][_0xf41f('0x44')]('nolimit')){_0x2c5b6b[_0xf41f('0x2f')]=qs[_0xf41f('0x2f')](_0x1da223[_0xf41f('0x3f')]['limit']);_0x2c5b6b[_0xf41f('0x2e')]=qs[_0xf41f('0x2e')](_0x1da223[_0xf41f('0x3f')][_0xf41f('0x2e')]);}_0x2c5b6b[_0xf41f('0x45')]=qs[_0xf41f('0x46')](_0x1da223[_0xf41f('0x3f')]['sort']);_0x2c5b6b[_0xf41f('0x47')]=qs[_0xf41f('0x48')](_['pick'](_0x1da223[_0xf41f('0x3f')],_0x192f00[_0xf41f('0x48')]),_0x8d7dec);if(_0x1da223[_0xf41f('0x3f')]['filter']){_0x2c5b6b[_0xf41f('0x47')]=_[_0xf41f('0x49')](_0x2c5b6b[_0xf41f('0x47')],{'$or':_[_0xf41f('0x39')](_0x8d7dec,function(_0x4e55f){if(_0x4e55f[_0xf41f('0x4a')]!==_0xf41f('0x4b')){var _0x1349a5={};_0x1349a5[_0x4e55f['name']]={'$like':'%'+_0x1da223['query'][_0xf41f('0x4c')]+'%'};return _0x1349a5;}})});}_0x2c5b6b=_[_0xf41f('0x49')]({},_0x2c5b6b,_0x1da223['options']);var _0x3c3750={'where':_0x2c5b6b[_0xf41f('0x47')]};return db[_0xf41f('0x3a')][_0xf41f('0x2d')](_0x3c3750)[_0xf41f('0x35')](function(_0x4f9f8e){_0xe0105a[_0xf41f('0x2d')]=_0x4f9f8e;if(_0x1da223[_0xf41f('0x3f')]['includeAll']){_0x2c5b6b[_0xf41f('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xf41f('0x4e')](_0x2c5b6b);})[_0xf41f('0x35')](function(_0x3404dc){_0xe0105a[_0xf41f('0x4f')]=_0x3404dc;return _0xe0105a;})['then'](respondWithFilteredResult(_0x39df75,_0x2c5b6b))[_0xf41f('0x50')](handleError(_0x39df75,null));};exports[_0xf41f('0x51')]=function(_0x37bc28,_0x1eb9e8){var _0x12dd47={'raw':!![],'where':{'id':_0x37bc28['params']['id']}},_0x494863={};_0x494863[_0xf41f('0x3e')]=_[_0xf41f('0x52')](db[_0xf41f('0x3a')][_0xf41f('0x3b')]);_0x494863[_0xf41f('0x3f')]=_[_0xf41f('0x52')](_0x37bc28[_0xf41f('0x3f')]);_0x494863['filters']=_['intersection'](_0x494863[_0xf41f('0x3e')],_0x494863[_0xf41f('0x3f')]);_0x12dd47[_0xf41f('0x40')]=_[_0xf41f('0x41')](_0x494863['model'],qs[_0xf41f('0x42')](_0x37bc28['query'][_0xf41f('0x42')]));_0x12dd47['attributes']=_0x12dd47[_0xf41f('0x40')][_0xf41f('0x43')]?_0x12dd47[_0xf41f('0x40')]:_0x494863[_0xf41f('0x3e')];if(_0x37bc28[_0xf41f('0x3f')][_0xf41f('0x53')]){_0x12dd47[_0xf41f('0x4d')]=[{'all':!![]}];}_0x12dd47=_['merge']({},_0x12dd47,_0x37bc28[_0xf41f('0x54')]);return db['ChatMessage'][_0xf41f('0x55')](_0x12dd47)[_0xf41f('0x35')](handleEntityNotFound(_0x1eb9e8,null))['then'](respondWithResult(_0x1eb9e8,null))[_0xf41f('0x50')](handleError(_0x1eb9e8,null));};exports[_0xf41f('0x56')]=function(_0x54d3e5,_0x5d067c){return db[_0xf41f('0x3a')][_0xf41f('0x56')](_0x54d3e5[_0xf41f('0x57')],{})['then'](respondWithResult(_0x5d067c,0xc9))[_0xf41f('0x50')](handleError(_0x5d067c,null));};exports[_0xf41f('0x33')]=function(_0x4218a4,_0x15e6d6){if(_0x4218a4['body']['id']){delete _0x4218a4[_0xf41f('0x57')]['id'];}return db[_0xf41f('0x3a')][_0xf41f('0x55')]({'where':{'id':_0x4218a4[_0xf41f('0x58')]['id']}})[_0xf41f('0x35')](handleEntityNotFound(_0x15e6d6,null))[_0xf41f('0x35')](saveUpdates(_0x4218a4[_0xf41f('0x57')],null))['then'](respondWithResult(_0x15e6d6,null))[_0xf41f('0x50')](handleError(_0x15e6d6,null));};exports[_0xf41f('0x34')]=function(_0x54b073,_0x3797cb){return db['ChatMessage'][_0xf41f('0x55')]({'where':{'id':_0x54b073['params']['id']}})['then'](handleEntityNotFound(_0x3797cb,null))['then'](removeEntity(_0x3797cb,null))[_0xf41f('0x50')](handleError(_0x3797cb,null));};exports[_0xf41f('0x59')]=function(_0x883eb7,_0x57b8c1){return db[_0xf41f('0x3a')][_0xf41f('0x59')]()[_0xf41f('0x35')](respondWithResult(_0x57b8c1,null))[_0xf41f('0x50')](handleError(_0x57b8c1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf41f('0x5a')]=function(_0x3fc4c7,_0x5f15f4,_0x1106eb){var _0x40a198={'agent':{},'channel':_0xf41f('0x5b')};if(_0x3fc4c7[_0xf41f('0x57')]['id']){delete _0x3fc4c7[_0xf41f('0x57')]['id'];}_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5c')]=!![];_0x3fc4c7[_0xf41f('0x57')]['readAt']=moment()[_0xf41f('0x5d')](_0xf41f('0x5e'));_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')]=_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')]||_0x3fc4c7[_0xf41f('0x60')]['id'];_0x40a198[_0xf41f('0x61')]['id']=_0x3fc4c7[_0xf41f('0x57')]['UserId'];return db[_0xf41f('0x3a')][_0xf41f('0x55')]({'where':{'id':_0x3fc4c7[_0xf41f('0x58')]['id'],'UserId':null}})[_0xf41f('0x35')](handleEntityNotFound(_0x5f15f4,null))['then'](saveUpdates(_0x3fc4c7['body'],null))[_0xf41f('0x35')](function(_0x22b6b8){if(_0x22b6b8){_0x40a198[_0xf41f('0x27')]=_0x22b6b8[_0xf41f('0x62')]({'plain':!![]});return db[_0xf41f('0x63')][_0xf41f('0x55')]({'where':{'id':_0x22b6b8['ChatInteractionId']}});}return null;})[_0xf41f('0x35')](handleEntityNotFound(_0x5f15f4,null))['then'](function(_0x589d3a){if(_0x589d3a){return _0x589d3a[_0xf41f('0x33')]({'UserId':_0x3fc4c7['body'][_0xf41f('0x5f')],'read1stAt':_['isNil'](_0x589d3a['read1stAt'])?moment()[_0xf41f('0x5d')](_0xf41f('0x5e')):undefined});}return null;})[_0xf41f('0x35')](function(_0x41c72d){if(_0x41c72d){_0x40a198[_0xf41f('0x64')]=_0x41c72d[_0xf41f('0x62')]({'plain':!![]});interaction_log['info'](_0xf41f('0x65'),_0x3fc4c7[_0xf41f('0x60')]['id'],_0x3fc4c7['user'][_0xf41f('0x37')],_0x3fc4c7['user'][_0xf41f('0x66')],_0x40a198['interaction']['id'],_0x3fc4c7['body']?JSON['stringify'](_0x3fc4c7[_0xf41f('0x57')]):_0xf41f('0x67'));return respondWithRpcPromise('AcceptMessage',_0xf41f('0x68'),_0x40a198);}return null;})[_0xf41f('0x35')](function(_0x16a598){var _0x538cee=_0xf41f('0x69')+_0x16a598['message'][_0xf41f('0x6a')];return db[_0xf41f('0x6b')][_0xf41f('0x3f')](_0x538cee,{'type':db[_0xf41f('0x6c')]['QueryTypes'][_0xf41f('0x6d')],'raw':!![]})[_0xf41f('0x35')](function(_0xf778e6){return _0xf778e6;});})[_0xf41f('0x35')](function(_0x58eeb6){if(_0x58eeb6){_0x40a198[_0xf41f('0x27')]['contact']=_0x58eeb6[0x0];if(!_0x3fc4c7[_0xf41f('0x57')][_0xf41f('0x5f')])return;return db[_0xf41f('0x6e')][_0xf41f('0x55')]({'where':{'id':_0x3fc4c7[_0xf41f('0x57')]['UserId'],'role':_0xf41f('0x61')},'attributes':['id',_0xf41f('0x37'),_0xf41f('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0xf41f('0x35')](function(_0x5ec29a){if(!_0x5ec29a)return null;_0x40a198[_0xf41f('0x27')]['agent']=_0x5ec29a;return _0x40a198;})[_0xf41f('0x35')](function(_0x246533){if(_0x246533){if(_0x3fc4c7['body'][_0xf41f('0x70')]){_0x40a198['message'][_0xf41f('0x71')]=util['format'](_0xf41f('0x72'),_0x3fc4c7[_0xf41f('0x60')][_0xf41f('0x37')]);_0x40a198['message'][_0xf41f('0x73')]=_0x40a198[_0xf41f('0x73')];_0x40a198[_0xf41f('0x27')]['motionChannel']=_0x40a198[_0xf41f('0x73')];_0x40a198['message']['event']=_0xf41f('0x5a');return respondWithRpcPromise('EventManager',_0xf41f('0x74'),{'event':_0xf41f('0x75'),'message':_[_0xf41f('0x49')](_0x40a198['message'],JSON[_0xf41f('0x76')](_0x40a198[_0xf41f('0x64')][_0xf41f('0x77')]))},client9002)['then'](function(){return _0x40a198;});}return _0x40a198;}return null;})[_0xf41f('0x35')](respondWithResult(_0x5f15f4,null))[_0xf41f('0x50')](handleError(_0x5f15f4,null));};var interaction_log=require(_0xf41f('0x13'))('chat-interactions');exports['reject']=function(_0x2da32a,_0x48deb0,_0x503212){var _0x4729be={'agent':{},'channel':_0xf41f('0x5b')};if(_0x2da32a[_0xf41f('0x57')]['id']){delete _0x2da32a[_0xf41f('0x57')]['id'];}_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')]=_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')]||_0x2da32a[_0xf41f('0x60')]['id'];_0x4729be[_0xf41f('0x61')]['id']=_0x2da32a[_0xf41f('0x57')][_0xf41f('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x2da32a[_0xf41f('0x58')]['id'],'UserId':null}})[_0xf41f('0x35')](handleEntityNotFound(_0x48deb0,null))[_0xf41f('0x35')](function(_0x22e7f5){if(_0x22e7f5){_0x4729be['message']=_0x22e7f5['get']({'plain':!![]});return db[_0xf41f('0x63')][_0xf41f('0x55')]({'where':{'id':_0x22e7f5[_0xf41f('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x48deb0,null))[_0xf41f('0x35')](function(_0x1b38bb){if(_0x1b38bb){_0x4729be[_0xf41f('0x64')]=_0x1b38bb['get']({'plain':!![]});interaction_log['info'](_0xf41f('0x79'),_0x2da32a['user']['id'],_0x2da32a[_0xf41f('0x60')][_0xf41f('0x37')],_0x2da32a[_0xf41f('0x60')][_0xf41f('0x66')],_0x4729be[_0xf41f('0x64')]['id'],_0x2da32a[_0xf41f('0x57')]?JSON[_0xf41f('0x23')](_0x2da32a[_0xf41f('0x57')]):_0xf41f('0x67'));return respondWithRpcPromise(_0xf41f('0x7a'),_0xf41f('0x7b'),_0x4729be);}return null;})['then'](function(_0x4a48e6){var _0x58d2fc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a48e6[_0xf41f('0x27')][_0xf41f('0x6a')];return db['sequelize'][_0xf41f('0x3f')](_0x58d2fc,{'type':db['Sequelize'][_0xf41f('0x7c')][_0xf41f('0x6d')],'raw':!![]})[_0xf41f('0x35')](function(_0x26c990){return _0x26c990;});})[_0xf41f('0x35')](function(_0x243133){if(_0x243133){_0x4729be[_0xf41f('0x27')][_0xf41f('0x7d')]=_0x243133[0x0];if(!_0x2da32a['body']['UserId'])return;return db[_0xf41f('0x6e')]['find']({'where':{'id':_0x2da32a[_0xf41f('0x57')]['UserId'],'role':_0xf41f('0x61')},'attributes':['id',_0xf41f('0x37'),_0xf41f('0x6f'),_0xf41f('0x7e'),_0xf41f('0x7f')],'raw':!![]});}return null;})[_0xf41f('0x35')](function(_0x2915ac){if(!_0x2915ac)return null;_0x4729be[_0xf41f('0x27')][_0xf41f('0x61')]=_0x2915ac;return _0x4729be;})[_0xf41f('0x35')](function(_0x3503b5){if(_0x3503b5){_0x3503b5[_0xf41f('0x27')]['interface']=util[_0xf41f('0x5d')](_0xf41f('0x72'),_0x2da32a['user'][_0xf41f('0x37')]);_0x3503b5[_0xf41f('0x27')]['channel']=_0x4729be[_0xf41f('0x73')];_0x3503b5[_0xf41f('0x27')]['motionChannel']=_0x4729be[_0xf41f('0x73')];_0x3503b5[_0xf41f('0x27')]['event']=_0xf41f('0x80');respondWithRpcPromise(_0xf41f('0x74'),_0xf41f('0x74'),{'event':_0xf41f('0x81'),'message':_['merge'](_0x4729be['message'],JSON[_0xf41f('0x76')](_0x4729be[_0xf41f('0x64')]['formData']))},client9002);return _0x4729be;}return null;})[_0xf41f('0x35')](respondWithResult(_0x48deb0,null))['catch'](handleError(_0x48deb0,null));}; \ No newline at end of file +var _0x1c9b=['query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','keys','includeAll','create','body','find','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','get','RejectMessage','rejectMessage','fullname','email','format','SIP/%s','rejectmessage','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','filters','intersection'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x1c9b,0x1cf));var _0xb1c9=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x1c9b[_0x413b4d];return _0x8b810a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb1c9('0x0'));var jsonpatch=require(_0xb1c9('0x1'));var rp=require(_0xb1c9('0x2'));var moment=require('moment');var BPromise=require(_0xb1c9('0x3'));var Mustache=require(_0xb1c9('0x4'));var util=require(_0xb1c9('0x5'));var path=require('path');var sox=require(_0xb1c9('0x6'));var csv=require('to-csv');var ejs=require(_0xb1c9('0x7'));var fs=require('fs');var fs_extra=require(_0xb1c9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb1c9('0x9'));var deskjs=require(_0xb1c9('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb1c9('0xb'));var Papa=require(_0xb1c9('0xc'));var Redis=require(_0xb1c9('0xd'));var authService=require(_0xb1c9('0xe'));var qs=require(_0xb1c9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1c9('0x10'));var logger=require(_0xb1c9('0x11'))(_0xb1c9('0x12'));var utils=require(_0xb1c9('0x13'));var config=require(_0xb1c9('0x14'));var licenseUtil=require(_0xb1c9('0x15'));var db=require(_0xb1c9('0x16'))['db'];config[_0xb1c9('0x17')]=_[_0xb1c9('0x18')](config['redis'],{'host':_0xb1c9('0x19'),'port':0x18eb});var socket=require(_0xb1c9('0x1a'))(new Redis(config[_0xb1c9('0x17')]));require(_0xb1c9('0x1b'))[_0xb1c9('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb1c9('0x1d')]({'port':0x232c});var client9002=jayson[_0xb1c9('0x1e')][_0xb1c9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5cd031,_0x28a798,_0x59b0f8,_0x13c352){return new BPromise(function(_0x4120aa,_0x438c77){var _0x1145f9=_0x13c352||client;return _0x1145f9[_0xb1c9('0x1f')](_0x5cd031,_0x59b0f8)['then'](function(_0x9411f5){logger[_0xb1c9('0x20')](_0xb1c9('0x21'),_0x28a798,_0xb1c9('0x22'));logger[_0xb1c9('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x28a798,_0xb1c9('0x22'),JSON[_0xb1c9('0x24')](_0x9411f5));if(_0x9411f5[_0xb1c9('0x25')]){if(_0x9411f5[_0xb1c9('0x25')][_0xb1c9('0x26')]===0x1f4){logger[_0xb1c9('0x25')](_0xb1c9('0x21'),_0x28a798,_0x9411f5[_0xb1c9('0x25')]['message']);return _0x438c77(_0x9411f5[_0xb1c9('0x25')][_0xb1c9('0x27')]);}logger[_0xb1c9('0x25')](_0xb1c9('0x21'),_0x28a798,_0x9411f5['error']['message']);return _0x4120aa(_0x9411f5[_0xb1c9('0x25')][_0xb1c9('0x27')]);}else{logger[_0xb1c9('0x20')]('ChatMessage,\x20%s,\x20%s',_0x28a798,'request\x20sent');_0x4120aa(_0x9411f5['result'][_0xb1c9('0x27')]);}})[_0xb1c9('0x28')](function(_0x44d3d8){logger[_0xb1c9('0x25')](_0xb1c9('0x21'),_0x28a798,_0x44d3d8);_0x438c77(_0x44d3d8);});});}function respondWithStatusCode(_0x516db2,_0x45f0e3){_0x45f0e3=_0x45f0e3||0xcc;return function(_0x41417d){if(_0x41417d){return _0x516db2[_0xb1c9('0x29')](_0x45f0e3);}return _0x516db2[_0xb1c9('0x2a')](_0x45f0e3)[_0xb1c9('0x2b')]();};}function respondWithResult(_0x27641f,_0x17ccf2){_0x17ccf2=_0x17ccf2||0xc8;return function(_0x1a39d3){if(_0x1a39d3){return _0x27641f[_0xb1c9('0x2a')](_0x17ccf2)['json'](_0x1a39d3);}};}function respondWithFilteredResult(_0x206197,_0x48b37d){return function(_0x2afcd6){if(_0x2afcd6){var _0x40c47a=typeof _0x48b37d[_0xb1c9('0x2c')]===_0xb1c9('0x2d')&&typeof _0x48b37d[_0xb1c9('0x2e')]===_0xb1c9('0x2d');var _0x19180e=_0x2afcd6[_0xb1c9('0x2f')];var _0x5f35f8=_0x40c47a?0x0:_0x48b37d['offset'];var _0x343471=_0x40c47a?_0x2afcd6[_0xb1c9('0x2f')]:_0x48b37d[_0xb1c9('0x2c')]+_0x48b37d[_0xb1c9('0x2e')];var _0x57fe6e;if(_0x343471>=_0x19180e){_0x343471=_0x19180e;_0x57fe6e=0xc8;}else{_0x57fe6e=0xce;}_0x206197[_0xb1c9('0x2a')](_0x57fe6e);return _0x206197[_0xb1c9('0x30')](_0xb1c9('0x31'),_0x5f35f8+'-'+_0x343471+'/'+_0x19180e)[_0xb1c9('0x32')](_0x2afcd6);}return null;};}function patchUpdates(_0xd3ab2b){return function(_0x47e40c){try{jsonpatch[_0xb1c9('0x33')](_0x47e40c,_0xd3ab2b,!![]);}catch(_0x584808){return BPromise[_0xb1c9('0x34')](_0x584808);}return _0x47e40c[_0xb1c9('0x35')]();};}function saveUpdates(_0x1c0f33,_0x38bcbb){return function(_0x4a8952){if(_0x4a8952){return _0x4a8952[_0xb1c9('0x36')](_0x1c0f33)['then'](function(_0x77650){return _0x77650;});}return null;};}function removeEntity(_0x4aa55f,_0x2cdeeb){return function(_0x477e36){if(_0x477e36){return _0x477e36[_0xb1c9('0x37')]()[_0xb1c9('0x38')](function(){_0x4aa55f[_0xb1c9('0x2a')](0xcc)[_0xb1c9('0x2b')]();});}};}function handleEntityNotFound(_0x562e43,_0x1af0ae){return function(_0x219008){if(!_0x219008){_0x562e43['sendStatus'](0x194);}return _0x219008;};}function handleError(_0x222344,_0x1f37a1){_0x1f37a1=_0x1f37a1||0x1f4;return function(_0x27f826){logger[_0xb1c9('0x25')](_0x27f826[_0xb1c9('0x39')]);if(_0x27f826[_0xb1c9('0x3a')]){delete _0x27f826[_0xb1c9('0x3a')];}_0x222344['status'](_0x1f37a1)[_0xb1c9('0x3b')](_0x27f826);};}exports[_0xb1c9('0x3c')]=function(_0x445099,_0x5318a8){var _0x1a4518={},_0xeba5aa={},_0x7efc66={'count':0x0,'rows':[]};var _0x382004=_[_0xb1c9('0x3d')](db[_0xb1c9('0x3e')][_0xb1c9('0x3f')],function(_0x2f7056){return{'name':_0x2f7056[_0xb1c9('0x40')],'type':_0x2f7056[_0xb1c9('0x41')][_0xb1c9('0x42')]};});_0xeba5aa['model']=_[_0xb1c9('0x3d')](_0x382004,'name');_0xeba5aa['query']=_['keys'](_0x445099['query']);_0xeba5aa[_0xb1c9('0x43')]=_[_0xb1c9('0x44')](_0xeba5aa['model'],_0xeba5aa[_0xb1c9('0x45')]);_0x1a4518['attributes']=_[_0xb1c9('0x44')](_0xeba5aa[_0xb1c9('0x46')],qs[_0xb1c9('0x47')](_0x445099[_0xb1c9('0x45')][_0xb1c9('0x47')]));_0x1a4518[_0xb1c9('0x48')]=_0x1a4518[_0xb1c9('0x48')][_0xb1c9('0x49')]?_0x1a4518[_0xb1c9('0x48')]:_0xeba5aa[_0xb1c9('0x46')];if(!_0x445099[_0xb1c9('0x45')][_0xb1c9('0x4a')](_0xb1c9('0x4b'))){_0x1a4518[_0xb1c9('0x2e')]=qs[_0xb1c9('0x2e')](_0x445099[_0xb1c9('0x45')][_0xb1c9('0x2e')]);_0x1a4518['offset']=qs['offset'](_0x445099[_0xb1c9('0x45')][_0xb1c9('0x2c')]);}_0x1a4518[_0xb1c9('0x4c')]=qs['sort'](_0x445099[_0xb1c9('0x45')][_0xb1c9('0x4d')]);_0x1a4518[_0xb1c9('0x4e')]=qs[_0xb1c9('0x43')](_[_0xb1c9('0x4f')](_0x445099[_0xb1c9('0x45')],_0xeba5aa['filters']),_0x382004);if(_0x445099[_0xb1c9('0x45')][_0xb1c9('0x50')]){_0x1a4518[_0xb1c9('0x4e')]=_[_0xb1c9('0x51')](_0x1a4518[_0xb1c9('0x4e')],{'$or':_['map'](_0x382004,function(_0x3ec630){if(_0x3ec630[_0xb1c9('0x41')]!==_0xb1c9('0x52')){var _0x257aa9={};_0x257aa9[_0x3ec630['name']]={'$like':'%'+_0x445099['query'][_0xb1c9('0x50')]+'%'};return _0x257aa9;}})});}_0x1a4518=_[_0xb1c9('0x51')]({},_0x1a4518,_0x445099[_0xb1c9('0x53')]);var _0x30745c={'where':_0x1a4518['where']};return db[_0xb1c9('0x3e')][_0xb1c9('0x2f')](_0x30745c)[_0xb1c9('0x38')](function(_0x1e9ae6){_0x7efc66[_0xb1c9('0x2f')]=_0x1e9ae6;if(_0x445099[_0xb1c9('0x45')]['includeAll']){_0x1a4518[_0xb1c9('0x54')]=[{'all':!![]}];}return db[_0xb1c9('0x3e')]['findAll'](_0x1a4518);})['then'](function(_0x59a161){_0x7efc66['rows']=_0x59a161;return _0x7efc66;})[_0xb1c9('0x38')](respondWithFilteredResult(_0x5318a8,_0x1a4518))[_0xb1c9('0x28')](handleError(_0x5318a8,null));};exports[_0xb1c9('0x55')]=function(_0xdd8ec3,_0x307f66){var _0x32eaf7={'raw':!![],'where':{'id':_0xdd8ec3[_0xb1c9('0x56')]['id']}},_0x2ee52a={};_0x2ee52a[_0xb1c9('0x46')]=_[_0xb1c9('0x57')](db[_0xb1c9('0x3e')][_0xb1c9('0x3f')]);_0x2ee52a['query']=_[_0xb1c9('0x57')](_0xdd8ec3['query']);_0x2ee52a['filters']=_['intersection'](_0x2ee52a[_0xb1c9('0x46')],_0x2ee52a['query']);_0x32eaf7[_0xb1c9('0x48')]=_[_0xb1c9('0x44')](_0x2ee52a[_0xb1c9('0x46')],qs[_0xb1c9('0x47')](_0xdd8ec3[_0xb1c9('0x45')]['fields']));_0x32eaf7[_0xb1c9('0x48')]=_0x32eaf7['attributes'][_0xb1c9('0x49')]?_0x32eaf7['attributes']:_0x2ee52a['model'];if(_0xdd8ec3['query'][_0xb1c9('0x58')]){_0x32eaf7[_0xb1c9('0x54')]=[{'all':!![]}];}_0x32eaf7=_[_0xb1c9('0x51')]({},_0x32eaf7,_0xdd8ec3[_0xb1c9('0x53')]);return db[_0xb1c9('0x3e')]['find'](_0x32eaf7)['then'](handleEntityNotFound(_0x307f66,null))[_0xb1c9('0x38')](respondWithResult(_0x307f66,null))[_0xb1c9('0x28')](handleError(_0x307f66,null));};exports[_0xb1c9('0x59')]=function(_0x449805,_0x4f5546){return db[_0xb1c9('0x3e')][_0xb1c9('0x59')](_0x449805[_0xb1c9('0x5a')],{})[_0xb1c9('0x38')](respondWithResult(_0x4f5546,0xc9))[_0xb1c9('0x28')](handleError(_0x4f5546,null));};exports[_0xb1c9('0x36')]=function(_0x3ff0d2,_0xf8b5f1){if(_0x3ff0d2[_0xb1c9('0x5a')]['id']){delete _0x3ff0d2[_0xb1c9('0x5a')]['id'];}return db[_0xb1c9('0x3e')][_0xb1c9('0x5b')]({'where':{'id':_0x3ff0d2['params']['id']}})[_0xb1c9('0x38')](handleEntityNotFound(_0xf8b5f1,null))[_0xb1c9('0x38')](saveUpdates(_0x3ff0d2[_0xb1c9('0x5a')],null))[_0xb1c9('0x38')](respondWithResult(_0xf8b5f1,null))[_0xb1c9('0x28')](handleError(_0xf8b5f1,null));};exports['destroy']=function(_0x204ca2,_0x25dc70){return db[_0xb1c9('0x3e')][_0xb1c9('0x5b')]({'where':{'id':_0x204ca2[_0xb1c9('0x56')]['id']}})['then'](handleEntityNotFound(_0x25dc70,null))[_0xb1c9('0x38')](removeEntity(_0x25dc70,null))['catch'](handleError(_0x25dc70,null));};exports['describe']=function(_0x1a70ee,_0x10ca0f){return db[_0xb1c9('0x3e')][_0xb1c9('0x5c')]()[_0xb1c9('0x38')](respondWithResult(_0x10ca0f,null))[_0xb1c9('0x28')](handleError(_0x10ca0f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xb1c9('0x5d')]=function(_0x147e3e,_0x2c5081,_0x1490d6){var _0x1df614={'agent':{},'channel':_0xb1c9('0x5e')};if(_0x147e3e[_0xb1c9('0x5a')]['id']){delete _0x147e3e['body']['id'];}_0x147e3e['body'][_0xb1c9('0x5f')]=!![];_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x60')]=moment()['format'](_0xb1c9('0x61'));_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x62')]=_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x62')]||_0x147e3e['user']['id'];_0x1df614[_0xb1c9('0x63')]['id']=_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x62')];return db['ChatMessage'][_0xb1c9('0x5b')]({'where':{'id':_0x147e3e[_0xb1c9('0x56')]['id'],'UserId':null}})[_0xb1c9('0x38')](handleEntityNotFound(_0x2c5081,null))[_0xb1c9('0x38')](saveUpdates(_0x147e3e['body'],null))[_0xb1c9('0x38')](function(_0xf2b2a8){if(_0xf2b2a8){_0x1df614[_0xb1c9('0x27')]=_0xf2b2a8['get']({'plain':!![]});return db[_0xb1c9('0x64')][_0xb1c9('0x5b')]({'where':{'id':_0xf2b2a8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2c5081,null))[_0xb1c9('0x38')](function(_0x2f914f){if(_0x2f914f){return _0x2f914f['update']({'UserId':_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x62')],'read1stAt':_[_0xb1c9('0x65')](_0x2f914f[_0xb1c9('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb1c9('0x38')](function(_0x19164b){if(_0x19164b){_0x1df614[_0xb1c9('0x67')]=_0x19164b['get']({'plain':!![]});interaction_log['info'](_0xb1c9('0x68'),_0x147e3e['user']['id'],_0x147e3e[_0xb1c9('0x69')][_0xb1c9('0x3a')],_0x147e3e['user']['role'],_0x1df614[_0xb1c9('0x67')]['id'],_0x147e3e[_0xb1c9('0x5a')]?JSON[_0xb1c9('0x24')](_0x147e3e[_0xb1c9('0x5a')]):_0xb1c9('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xb1c9('0x6b'),_0x1df614);}return null;})[_0xb1c9('0x38')](function(_0x4f8642){var _0x3b7726=_0xb1c9('0x6c')+_0x4f8642[_0xb1c9('0x27')][_0xb1c9('0x6d')];return db[_0xb1c9('0x6e')][_0xb1c9('0x45')](_0x3b7726,{'type':db[_0xb1c9('0x6f')][_0xb1c9('0x70')][_0xb1c9('0x71')],'raw':!![]})[_0xb1c9('0x38')](function(_0x585e2d){return _0x585e2d;});})['then'](function(_0x22284d){if(_0x22284d){_0x1df614[_0xb1c9('0x27')][_0xb1c9('0x72')]=_0x22284d[0x0];if(!_0x147e3e['body'][_0xb1c9('0x62')])return;return db[_0xb1c9('0x73')][_0xb1c9('0x5b')]({'where':{'id':_0x147e3e[_0xb1c9('0x5a')]['UserId'],'role':_0xb1c9('0x63')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xb1c9('0x38')](function(_0x11781c){if(!_0x11781c)return null;_0x1df614[_0xb1c9('0x27')][_0xb1c9('0x63')]=_0x11781c;return _0x1df614;})[_0xb1c9('0x38')](function(_0xb081a4){if(_0xb081a4){if(_0x147e3e[_0xb1c9('0x5a')][_0xb1c9('0x74')]){_0x1df614[_0xb1c9('0x27')][_0xb1c9('0x75')]=util['format']('SIP/%s',_0x147e3e[_0xb1c9('0x69')][_0xb1c9('0x3a')]);_0x1df614[_0xb1c9('0x27')]['channel']=_0x1df614['channel'];_0x1df614[_0xb1c9('0x27')][_0xb1c9('0x76')]=_0x1df614[_0xb1c9('0x77')];_0x1df614[_0xb1c9('0x27')][_0xb1c9('0x78')]=_0xb1c9('0x5d');return respondWithRpcPromise(_0xb1c9('0x79'),_0xb1c9('0x79'),{'event':_0xb1c9('0x7a'),'message':_[_0xb1c9('0x51')](_0x1df614[_0xb1c9('0x27')],JSON[_0xb1c9('0x7b')](_0x1df614[_0xb1c9('0x67')][_0xb1c9('0x7c')]))},client9002)[_0xb1c9('0x38')](function(){return _0x1df614;});}return _0x1df614;}return null;})[_0xb1c9('0x38')](respondWithResult(_0x2c5081,null))[_0xb1c9('0x28')](handleError(_0x2c5081,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x2088d3,_0x7e4e3e,_0x16753a){var _0x2baa7a={'agent':{},'channel':'chat'};if(_0x2088d3[_0xb1c9('0x5a')]['id']){delete _0x2088d3['body']['id'];}_0x2088d3[_0xb1c9('0x5a')][_0xb1c9('0x62')]=_0x2088d3['body'][_0xb1c9('0x62')]||_0x2088d3[_0xb1c9('0x69')]['id'];_0x2baa7a['agent']['id']=_0x2088d3[_0xb1c9('0x5a')][_0xb1c9('0x62')];return db['ChatMessage']['find']({'where':{'id':_0x2088d3[_0xb1c9('0x56')]['id'],'UserId':null}})[_0xb1c9('0x38')](handleEntityNotFound(_0x7e4e3e,null))[_0xb1c9('0x38')](function(_0x5724bd){if(_0x5724bd){_0x2baa7a[_0xb1c9('0x27')]=_0x5724bd[_0xb1c9('0x7d')]({'plain':!![]});return db[_0xb1c9('0x64')]['find']({'where':{'id':_0x5724bd['ChatInteractionId']}});}return null;})[_0xb1c9('0x38')](handleEntityNotFound(_0x7e4e3e,null))[_0xb1c9('0x38')](function(_0x187d1b){if(_0x187d1b){_0x2baa7a[_0xb1c9('0x67')]=_0x187d1b[_0xb1c9('0x7d')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2088d3['user']['id'],_0x2088d3[_0xb1c9('0x69')][_0xb1c9('0x3a')],_0x2088d3[_0xb1c9('0x69')]['role'],_0x2baa7a[_0xb1c9('0x67')]['id'],_0x2088d3[_0xb1c9('0x5a')]?JSON[_0xb1c9('0x24')](_0x2088d3[_0xb1c9('0x5a')]):_0xb1c9('0x6a'));return respondWithRpcPromise(_0xb1c9('0x7e'),_0xb1c9('0x7f'),_0x2baa7a);}return null;})[_0xb1c9('0x38')](function(_0x2cd06a){var _0x2115fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cd06a['message'][_0xb1c9('0x6d')];return db[_0xb1c9('0x6e')][_0xb1c9('0x45')](_0x2115fa,{'type':db[_0xb1c9('0x6f')][_0xb1c9('0x70')][_0xb1c9('0x71')],'raw':!![]})[_0xb1c9('0x38')](function(_0x5a9fbd){return _0x5a9fbd;});})[_0xb1c9('0x38')](function(_0x10d3b9){if(_0x10d3b9){_0x2baa7a[_0xb1c9('0x27')][_0xb1c9('0x72')]=_0x10d3b9[0x0];if(!_0x2088d3[_0xb1c9('0x5a')]['UserId'])return;return db['User'][_0xb1c9('0x5b')]({'where':{'id':_0x2088d3[_0xb1c9('0x5a')]['UserId'],'role':_0xb1c9('0x63')},'attributes':['id',_0xb1c9('0x3a'),_0xb1c9('0x80'),_0xb1c9('0x81'),'internal'],'raw':!![]});}return null;})[_0xb1c9('0x38')](function(_0x3148d6){if(!_0x3148d6)return null;_0x2baa7a[_0xb1c9('0x27')][_0xb1c9('0x63')]=_0x3148d6;return _0x2baa7a;})['then'](function(_0x53d3ce){if(_0x53d3ce){_0x53d3ce['message'][_0xb1c9('0x75')]=util[_0xb1c9('0x82')](_0xb1c9('0x83'),_0x2088d3['user'][_0xb1c9('0x3a')]);_0x53d3ce['message'][_0xb1c9('0x77')]=_0x2baa7a[_0xb1c9('0x77')];_0x53d3ce[_0xb1c9('0x27')][_0xb1c9('0x76')]=_0x2baa7a[_0xb1c9('0x77')];_0x53d3ce['message'][_0xb1c9('0x78')]=_0xb1c9('0x34');respondWithRpcPromise(_0xb1c9('0x79'),_0xb1c9('0x79'),{'event':_0xb1c9('0x84'),'message':_[_0xb1c9('0x51')](_0x2baa7a[_0xb1c9('0x27')],JSON['parse'](_0x2baa7a['interaction'][_0xb1c9('0x7c')]))},client9002);return _0x2baa7a;}return null;})[_0xb1c9('0x38')](respondWithResult(_0x7e4e3e,null))[_0xb1c9('0x28')](handleError(_0x7e4e3e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 2d8df85..e41be18 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 _0x6265=['hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5d9c37,_0x518b93){var _0x1ba9eb=function(_0xae2d11){while(--_0xae2d11){_0x5d9c37['push'](_0x5d9c37['shift']());}};_0x1ba9eb(++_0x518b93);}(_0x6265,0x88));var _0x5626=function(_0x5cca84,_0x3889cd){_0x5cca84=_0x5cca84-0x0;var _0x129dad=_0x6265[_0x5cca84];return _0x129dad;};'use strict';var EventEmitter=require(_0x5626('0x0'));var ChatMessage=require(_0x5626('0x1'))['db'][_0x5626('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5626('0x3')](0x0);var events={'afterCreate':_0x5626('0x4'),'afterUpdate':_0x5626('0x5'),'afterDestroy':_0x5626('0x6')};function emitEvent(_0x6a6bda){return function(_0x42a202,_0x7bb7d3,_0x55daa2){ChatMessageEvents[_0x5626('0x7')](_0x6a6bda+':'+_0x42a202['id'],_0x42a202);ChatMessageEvents[_0x5626('0x7')](_0x6a6bda,_0x42a202);_0x55daa2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x5626('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xe2e3=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x2c1dd0,_0x1be0c5){var _0x58cf35=function(_0x5aa669){while(--_0x5aa669){_0x2c1dd0['push'](_0x2c1dd0['shift']());}};_0x58cf35(++_0x1be0c5);}(_0xe2e3,0x117));var _0x3e2e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xe2e3[_0x243b2f];return _0xcb3c2d;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3e2e('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3e2e('0x1')](0x0);var events={'afterCreate':_0x3e2e('0x2'),'afterUpdate':'update','afterDestroy':_0x3e2e('0x3')};function emitEvent(_0x296ffd){return function(_0x3941ff,_0x53d799,_0x32de60){ChatMessageEvents[_0x3e2e('0x4')](_0x296ffd+':'+_0x3941ff['id'],_0x3941ff);ChatMessageEvents['emit'](_0x296ffd,_0x3941ff);_0x32de60(null);};}for(var e in events){if(events[_0x3e2e('0x5')](e)){var event=events[e];ChatMessage[_0x3e2e('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 c821171..1fba9ba 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 _0xd9c6=['api','bluebird','request-promise','path','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3e5a96,_0x26eb95){var _0x3ffb85=function(_0x5731a2){while(--_0x5731a2){_0x3e5a96['push'](_0x3e5a96['shift']());}};_0x3ffb85(++_0x26eb95);}(_0xd9c6,0x99));var _0x6d9c=function(_0x5193c8,_0x2baa95){_0x5193c8=_0x5193c8-0x0;var _0x895c20=_0xd9c6[_0x5193c8];return _0x895c20;};'use strict';var _=require(_0x6d9c('0x0'));var util=require(_0x6d9c('0x1'));var logger=require(_0x6d9c('0x2'))(_0x6d9c('0x3'));var moment=require('moment');var BPromise=require(_0x6d9c('0x4'));var rp=require(_0x6d9c('0x5'));var fs=require('fs');var path=require(_0x6d9c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d9c('0x7'));module['exports']=function(_0x37f03e,_0x5e00ab){return _0x37f03e[_0x6d9c('0x8')](_0x6d9c('0x9'),attributes,{'tableName':_0x6d9c('0xa'),'paranoid':![],'indexes':[{'name':_0x6d9c('0xb'),'fields':[_0x6d9c('0xc')],'type':_0x6d9c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12df36,_0x45318d,_0x1e61af){var _0x37a7a5=_0x37f03e['models'];var _0x72200=_0x12df36['get']({'plain':!![]});if(_0x72200[_0x6d9c('0xe')][_0x6d9c('0xf')]()==='in'||_0x72200['direction'][_0x6d9c('0xf')]()==='out'&&!_0x72200[_0x6d9c('0x10')]&&!_[_0x6d9c('0x11')](_0x72200['UserId'])){_0x37a7a5[_0x6d9c('0x12')][_0x6d9c('0x13')]({'where':{'id':_0x72200[_0x6d9c('0x14')]}})[_0x6d9c('0x15')](function(_0x3ab250){if(_0x3ab250){_0x3ab250['update']({'lastMsgAt':_0x72200[_0x6d9c('0x16')],'lastMsgDirection':_0x72200[_0x6d9c('0xe')][_0x6d9c('0xf')]()});}})[_0x6d9c('0x17')](function(_0x2393fd){console['error'](_0x2393fd);});}_0x1e61af();}},'charset':_0x6d9c('0x18'),'collate':_0x6d9c('0x19')});}; \ No newline at end of file +var _0x2f7a=['findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x5a97ab,_0x1645d9){var _0x49b846=function(_0x1cdfe7){while(--_0x1cdfe7){_0x5a97ab['push'](_0x5a97ab['shift']());}};_0x49b846(++_0x1645d9);}(_0x2f7a,0x151));var _0xa2f7=function(_0x48f483,_0x25803b){_0x48f483=_0x48f483-0x0;var _0x29acf4=_0x2f7a[_0x48f483];return _0x29acf4;};'use strict';var _=require(_0xa2f7('0x0'));var util=require(_0xa2f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa2f7('0x2'));var BPromise=require(_0xa2f7('0x3'));var rp=require(_0xa2f7('0x4'));var fs=require('fs');var path=require(_0xa2f7('0x5'));var rimraf=require(_0xa2f7('0x6'));var config=require(_0xa2f7('0x7'));var attributes=require(_0xa2f7('0x8'));module[_0xa2f7('0x9')]=function(_0x180fc4,_0x8cc2c){return _0x180fc4[_0xa2f7('0xa')](_0xa2f7('0xb'),attributes,{'tableName':_0xa2f7('0xc'),'paranoid':![],'indexes':[{'name':_0xa2f7('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13316b,_0x4dc8e6,_0x5003ab){var _0x132bd8=_0x180fc4[_0xa2f7('0xe')];var _0x4ca0fa=_0x13316b[_0xa2f7('0xf')]({'plain':!![]});if(_0x4ca0fa[_0xa2f7('0x10')][_0xa2f7('0x11')]()==='in'||_0x4ca0fa[_0xa2f7('0x10')]['toLowerCase']()===_0xa2f7('0x12')&&!_0x4ca0fa[_0xa2f7('0x13')]&&!_[_0xa2f7('0x14')](_0x4ca0fa[_0xa2f7('0x15')])){_0x132bd8[_0xa2f7('0x16')][_0xa2f7('0x17')]({'where':{'id':_0x4ca0fa[_0xa2f7('0x18')]}})[_0xa2f7('0x19')](function(_0x4cb00f){if(_0x4cb00f){_0x4cb00f['update']({'lastMsgAt':_0x4ca0fa[_0xa2f7('0x1a')],'lastMsgDirection':_0x4ca0fa[_0xa2f7('0x10')][_0xa2f7('0x11')]()});}})[_0xa2f7('0x1b')](function(_0x2898f9){console[_0xa2f7('0x1c')](_0x2898f9);});}_0x5003ab();}},'charset':_0xa2f7('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 76a3a6d..657c4d5 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 _0x0880=['localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateChatMessage','lodash','moment','randomstring','../../config/logger','redis','defaults'];(function(_0x163cc2,_0x553c3d){var _0x58541d=function(_0xe9a17d){while(--_0xe9a17d){_0x163cc2['push'](_0x163cc2['shift']());}};_0x58541d(++_0x553c3d);}(_0x0880,0x7c));var _0x0088=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x0880[_0x540dcb];return _0x49353c;};'use strict';var _=require(_0x0088('0x0'));var util=require('util');var moment=require(_0x0088('0x1'));var BPromise=require('bluebird');var rs=require(_0x0088('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0088('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0088('0x4')]=_[_0x0088('0x5')](config[_0x0088('0x4')],{'host':_0x0088('0x6'),'port':0x18eb});var socket=require(_0x0088('0x7'))(new Redis(config['redis']));require(_0x0088('0x8'))[_0x0088('0x9')](socket);function respondWithRpcPromise(_0x55d37d,_0x7c0c4a,_0x209b3d){return new BPromise(function(_0x5c3bb7,_0x57ada2){return client[_0x0088('0xa')](_0x55d37d,_0x209b3d)[_0x0088('0xb')](function(_0x11b395){logger[_0x0088('0xc')](_0x0088('0xd'),_0x7c0c4a,_0x0088('0xe'));logger[_0x0088('0xf')](_0x0088('0x10'),_0x7c0c4a,_0x0088('0xe'),JSON[_0x0088('0x11')](_0x11b395));if(_0x11b395[_0x0088('0x12')]){if(_0x11b395[_0x0088('0x12')][_0x0088('0x13')]===0x1f4){logger[_0x0088('0x12')](_0x0088('0xd'),_0x7c0c4a,_0x11b395[_0x0088('0x12')][_0x0088('0x14')]);return _0x57ada2(_0x11b395[_0x0088('0x12')][_0x0088('0x14')]);}logger['error'](_0x0088('0xd'),_0x7c0c4a,_0x11b395['error'][_0x0088('0x14')]);return _0x5c3bb7(_0x11b395['error'][_0x0088('0x14')]);}else{logger[_0x0088('0xc')](_0x0088('0xd'),_0x7c0c4a,_0x0088('0xe'));_0x5c3bb7(_0x11b395[_0x0088('0x15')][_0x0088('0x14')]);}})[_0x0088('0x16')](function(_0x10128b){logger[_0x0088('0x12')]('ChatMessage,\x20%s,\x20%s',_0x7c0c4a,_0x10128b);_0x57ada2(_0x10128b);});});}exports['CreateChatMessage']=function(_0x3dbc35){var _0x46f764=this;return new Promise(function(_0x69d1c7,_0x9447f){return db['ChatMessage']['create'](_0x3dbc35['body'],{'raw':_0x3dbc35[_0x0088('0x17')]?_0x3dbc35['options'][_0x0088('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x33aa1b){logger[_0x0088('0xc')](_0x0088('0x19'),_0x3dbc35);logger[_0x0088('0xf')](_0x0088('0x19'),_0x3dbc35,JSON[_0x0088('0x11')](_0x33aa1b));_0x69d1c7(_0x33aa1b);})[_0x0088('0x16')](function(_0x393b0d){logger[_0x0088('0x12')](_0x0088('0x19'),_0x393b0d[_0x0088('0x14')],_0x3dbc35);_0x9447f(_0x46f764[_0x0088('0x12')](0x1f4,_0x393b0d[_0x0088('0x14')]));});});}; \ No newline at end of file +var _0xa143=['socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa143,0x9c));var _0x3a14=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa143[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3a14('0x0'));var util=require('util');var moment=require(_0x3a14('0x1'));var BPromise=require(_0x3a14('0x2'));var rs=require(_0x3a14('0x3'));var fs=require('fs');var Redis=require(_0x3a14('0x4'));var db=require(_0x3a14('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a14('0x6'));var config=require(_0x3a14('0x7'));var jayson=require(_0x3a14('0x8'));var client=jayson[_0x3a14('0x9')][_0x3a14('0xa')]({'port':0x232a});config[_0x3a14('0xb')]=_[_0x3a14('0xc')](config[_0x3a14('0xb')],{'host':_0x3a14('0xd'),'port':0x18eb});var socket=require(_0x3a14('0xe'))(new Redis(config['redis']));require(_0x3a14('0xf'))['register'](socket);function respondWithRpcPromise(_0xc250e,_0x231c26,_0xc2e891){return new BPromise(function(_0x5b0c1b,_0x51c9c3){return client[_0x3a14('0x10')](_0xc250e,_0xc2e891)[_0x3a14('0x11')](function(_0x56c93c){logger[_0x3a14('0x12')](_0x3a14('0x13'),_0x231c26,'request\x20sent');logger[_0x3a14('0x14')](_0x3a14('0x15'),_0x231c26,_0x3a14('0x16'),JSON[_0x3a14('0x17')](_0x56c93c));if(_0x56c93c['error']){if(_0x56c93c[_0x3a14('0x18')][_0x3a14('0x19')]===0x1f4){logger[_0x3a14('0x18')](_0x3a14('0x13'),_0x231c26,_0x56c93c['error']['message']);return _0x51c9c3(_0x56c93c[_0x3a14('0x18')][_0x3a14('0x1a')]);}logger[_0x3a14('0x18')](_0x3a14('0x13'),_0x231c26,_0x56c93c[_0x3a14('0x18')][_0x3a14('0x1a')]);return _0x5b0c1b(_0x56c93c[_0x3a14('0x18')]['message']);}else{logger[_0x3a14('0x12')](_0x3a14('0x13'),_0x231c26,'request\x20sent');_0x5b0c1b(_0x56c93c[_0x3a14('0x1b')][_0x3a14('0x1a')]);}})[_0x3a14('0x1c')](function(_0x149fe3){logger[_0x3a14('0x18')]('ChatMessage,\x20%s,\x20%s',_0x231c26,_0x149fe3);_0x51c9c3(_0x149fe3);});});}exports[_0x3a14('0x1d')]=function(_0xc462bb){var _0x709210=this;return new Promise(function(_0x51d87d,_0x57e23a){return db[_0x3a14('0x1e')][_0x3a14('0x1f')](_0xc462bb['body'],{'raw':_0xc462bb[_0x3a14('0x20')]?_0xc462bb[_0x3a14('0x20')][_0x3a14('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x50690b){logger[_0x3a14('0x12')](_0x3a14('0x1d'),_0xc462bb);logger[_0x3a14('0x14')]('CreateChatMessage',_0xc462bb,JSON[_0x3a14('0x17')](_0x50690b));_0x51d87d(_0x50690b);})[_0x3a14('0x1c')](function(_0x3587de){logger[_0x3a14('0x18')](_0x3a14('0x1d'),_0x3587de[_0x3a14('0x1a')],_0xc462bb);_0x57e23a(_0x709210[_0x3a14('0x18')](0x1f4,_0x3587de[_0x3a14('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 549f259..25dc7a2 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 _0x1224=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1950b7,_0x297593){var _0x38a95a=function(_0x2f519c){while(--_0x2f519c){_0x1950b7['push'](_0x1950b7['shift']());}};_0x38a95a(++_0x297593);}(_0x1224,0x10d));var _0x4122=function(_0xda0001,_0x5d3e28){_0xda0001=_0xda0001-0x0;var _0x3c1c06=_0x1224[_0xda0001];return _0x3c1c06;};'use strict';var ChatMessageEvents=require(_0x4122('0x0'));var events=[_0x4122('0x1'),_0x4122('0x2'),_0x4122('0x3')];function createListener(_0x488f55,_0x3d42a9){return function(_0x51632b){_0x3d42a9[_0x4122('0x4')](_0x488f55,_0x51632b);};}function removeListener(_0x1f1533,_0x2f506b){return function(){ChatMessageEvents['removeListener'](_0x1f1533,_0x2f506b);};}exports[_0x4122('0x5')]=function(_0x76278c){for(var _0xc6dfaf=0x0,_0x40b5e4=events[_0x4122('0x6')];_0xc6dfaf<_0x40b5e4;_0xc6dfaf++){var _0x431470=events[_0xc6dfaf];var _0x2444a3=createListener(_0x4122('0x7')+_0x431470,_0x76278c);ChatMessageEvents['on'](_0x431470,_0x2444a3);}}; \ No newline at end of file +var _0xcd59=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x44c26c,_0x1a2085){var _0x4ae13b=function(_0x57b733){while(--_0x57b733){_0x44c26c['push'](_0x44c26c['shift']());}};_0x4ae13b(++_0x1a2085);}(_0xcd59,0x14b));var _0x9cd5=function(_0x1f53c3,_0x4e8a17){_0x1f53c3=_0x1f53c3-0x0;var _0x454280=_0xcd59[_0x1f53c3];return _0x454280;};'use strict';var ChatMessageEvents=require(_0x9cd5('0x0'));var events=[_0x9cd5('0x1'),_0x9cd5('0x2'),_0x9cd5('0x3')];function createListener(_0x271070,_0x302b21){return function(_0x4b93b9){_0x302b21[_0x9cd5('0x4')](_0x271070,_0x4b93b9);};}function removeListener(_0x191236,_0xf96efa){return function(){ChatMessageEvents[_0x9cd5('0x5')](_0x191236,_0xf96efa);};}exports[_0x9cd5('0x6')]=function(_0x2db192){for(var _0x46277c=0x0,_0x2cd19a=events[_0x9cd5('0x7')];_0x46277c<_0x2cd19a;_0x46277c++){var _0x3f888f=events[_0x46277c];var _0x545407=createListener(_0x9cd5('0x8')+_0x3f888f,_0x2db192);ChatMessageEvents['on'](_0x3f888f,_0x545407);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3bd29b2..3376a64 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 _0xf415=['chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked'];(function(_0x45a53f,_0x306600){var _0x17da07=function(_0xe0fba9){while(--_0xe0fba9){_0x45a53f['push'](_0x45a53f['shift']());}};_0x17da07(++_0x306600);}(_0xf415,0x11d));var _0x5f41=function(_0x2035a8,_0x3792f4){_0x2035a8=_0x2035a8-0x0;var _0x5ec3dd=_0xf415[_0x2035a8];return _0x5ec3dd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f41('0x0'));var timeout=require(_0x5f41('0x1'));var express=require(_0x5f41('0x2'));var router=express['Router']();var fs_extra=require(_0x5f41('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5f41('0x4'));var config=require(_0x5f41('0x5'));var controller=require(_0x5f41('0x6'));router[_0x5f41('0x7')]('/',auth['isAuthenticated'](),controller[_0x5f41('0x8')]);router['get'](_0x5f41('0x9'),auth[_0x5f41('0xa')](),controller[_0x5f41('0xb')]);router[_0x5f41('0x7')](_0x5f41('0xc'),auth['isAuthenticated'](),controller[_0x5f41('0xd')]);router['post']('/',auth[_0x5f41('0xa')](),interaction[_0x5f41('0xe')](_0x5f41('0xf'),_0x5f41('0x10')),controller[_0x5f41('0x11')]);router[_0x5f41('0x12')]('/:id',controller[_0x5f41('0x13')]);router[_0x5f41('0x12')](_0x5f41('0x14'),auth['isAuthenticated'](),controller[_0x5f41('0x15')]);router['put'](_0x5f41('0x16'),auth[_0x5f41('0xa')](),controller[_0x5f41('0x17')]);router['delete'](_0x5f41('0xc'),auth[_0x5f41('0xa')](),controller[_0x5f41('0x18')]);module['exports']=router; \ No newline at end of file +var _0x768d=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e4f42,_0x296563){var _0x24a54e=function(_0x3e2b49){while(--_0x3e2b49){_0x5e4f42['push'](_0x5e4f42['shift']());}};_0x24a54e(++_0x296563);}(_0x768d,0xb9));var _0xd768=function(_0x462afe,_0x18fb67){_0x462afe=_0x462afe-0x0;var _0x581984=_0x768d[_0x462afe];return _0x581984;};'use strict';var multer=require(_0xd768('0x0'));var util=require(_0xd768('0x1'));var path=require('path');var timeout=require(_0xd768('0x2'));var express=require(_0xd768('0x3'));var router=express[_0xd768('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd768('0x5'));var interaction=require(_0xd768('0x6'));var config=require(_0xd768('0x7'));var controller=require(_0xd768('0x8'));router[_0xd768('0x9')]('/',auth[_0xd768('0xa')](),controller[_0xd768('0xb')]);router[_0xd768('0x9')]('/describe',auth[_0xd768('0xa')](),controller[_0xd768('0xc')]);router[_0xd768('0x9')](_0xd768('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd768('0xa')](),interaction[_0xd768('0xe')]('chat',_0xd768('0xf')),controller[_0xd768('0x10')]);router[_0xd768('0x11')](_0xd768('0xd'),controller[_0xd768('0x12')]);router[_0xd768('0x11')](_0xd768('0x13'),auth[_0xd768('0xa')](),controller[_0xd768('0x14')]);router[_0xd768('0x11')](_0xd768('0x15'),auth[_0xd768('0xa')](),controller['reject']);router[_0xd768('0x16')]('/:id',auth[_0xd768('0xa')](),controller['destroy']);module[_0xd768('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 20486d0..6392f2a 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 _0x2f7a=['medium','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2f7a,0x124));var _0xa2f7=function(_0x830109,_0x5d4f7a){_0x830109=_0x830109-0x0;var _0x54963a=_0x2f7a[_0x830109];return _0x54963a;};'use strict';var Sequelize=require(_0xa2f7('0x0'));module[_0xa2f7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa2f7('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x9afc=['medium','sequelize','TEXT'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x9afc,0x1b4));var _0xc9af=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x9afc[_0x21aafd];return _0x9f2800;};'use strict';var Sequelize=require(_0xc9af('0x0'));module['exports']={'body':{'type':Sequelize[_0xc9af('0x1')](_0xc9af('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 f61d3df..13e31a9 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(_0x130405,_0x21dfa4){var _0x3c4c1a=function(_0x4a5bdb){while(--_0x4a5bdb){_0x130405['push'](_0x130405['shift']());}};_0x3c4c1a(++_0x21dfa4);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x9a978f,_0x302eab){_0x9a978f=_0x9a978f-0x0;var _0x30b9c6=_0x7a54[_0x9a978f];return _0x30b9c6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 730b77e..d9057c4 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 _0x0ba8=['util','api','bluebird','request-promise','path','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x5d7925,_0x5d7914){var _0xb487ab=function(_0x3f051c){while(--_0x3f051c){_0x5d7925['push'](_0x5d7925['shift']());}};_0xb487ab(++_0x5d7914);}(_0x0ba8,0x1b7));var _0x80ba=function(_0x4ac76c,_0x305b70){_0x4ac76c=_0x4ac76c-0x0;var _0x24d3f1=_0x0ba8[_0x4ac76c];return _0x24d3f1;};'use strict';var _=require(_0x80ba('0x0'));var util=require(_0x80ba('0x1'));var logger=require('../../config/logger')(_0x80ba('0x2'));var moment=require('moment');var BPromise=require(_0x80ba('0x3'));var rp=require(_0x80ba('0x4'));var fs=require('fs');var path=require(_0x80ba('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module[_0x80ba('0x6')]=function(_0x58e076,_0x5a1b0d){return _0x58e076[_0x80ba('0x7')](_0x80ba('0x8'),attributes,{'tableName':_0x80ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x80ba('0xa')});}; \ No newline at end of file +var _0x6a4a=['utf8mb4','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages'];(function(_0x3695a5,_0x14f39f){var _0x1d96fa=function(_0x274a85){while(--_0x274a85){_0x3695a5['push'](_0x3695a5['shift']());}};_0x1d96fa(++_0x14f39f);}(_0x6a4a,0x1a3));var _0xa6a4=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0x6a4a[_0x30faee];return _0x3a90ab;};'use strict';var _=require(_0xa6a4('0x0'));var util=require('util');var logger=require(_0xa6a4('0x1'))(_0xa6a4('0x2'));var moment=require('moment');var BPromise=require(_0xa6a4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6a4('0x4'));var rimraf=require(_0xa6a4('0x5'));var config=require(_0xa6a4('0x6'));var attributes=require(_0xa6a4('0x7'));module['exports']=function(_0x58c1d1,_0x3e4d42){return _0x58c1d1['define'](_0xa6a4('0x8'),attributes,{'tableName':_0xa6a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6a4('0xa'),'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 62373fc..d18f02d 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 _0x8147=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x53899e,_0x37d676){var _0x3fee35=function(_0x400314){while(--_0x400314){_0x53899e['push'](_0x53899e['shift']());}};_0x3fee35(++_0x37d676);}(_0x8147,0x179));var _0x7814=function(_0x599410,_0x3dcc3f){_0x599410=_0x599410-0x0;var _0x36566a=_0x8147[_0x599410];return _0x36566a;};'use strict';var _=require(_0x7814('0x0'));var util=require(_0x7814('0x1'));var moment=require('moment');var BPromise=require(_0x7814('0x2'));var rs=require(_0x7814('0x3'));var fs=require('fs');var Redis=require(_0x7814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7814('0x5'));var logger=require(_0x7814('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7814('0x7'));var client=jayson[_0x7814('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x499b1a,_0x41e3db,_0xa96628){return new BPromise(function(_0x4239e8,_0x50bd29){return client[_0x7814('0x9')](_0x499b1a,_0xa96628)['then'](function(_0x398b3a){logger[_0x7814('0xa')](_0x7814('0xb'),_0x41e3db,'request\x20sent');logger[_0x7814('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x41e3db,_0x7814('0xd'),JSON[_0x7814('0xe')](_0x398b3a));if(_0x398b3a['error']){if(_0x398b3a[_0x7814('0xf')][_0x7814('0x10')]===0x1f4){logger[_0x7814('0xf')](_0x7814('0xb'),_0x41e3db,_0x398b3a['error'][_0x7814('0x11')]);return _0x50bd29(_0x398b3a[_0x7814('0xf')][_0x7814('0x11')]);}logger[_0x7814('0xf')](_0x7814('0xb'),_0x41e3db,_0x398b3a[_0x7814('0xf')]['message']);return _0x4239e8(_0x398b3a[_0x7814('0xf')][_0x7814('0x11')]);}else{logger[_0x7814('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41e3db,_0x7814('0xd'));_0x4239e8(_0x398b3a[_0x7814('0x12')][_0x7814('0x11')]);}})[_0x7814('0x13')](function(_0x28451f){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x41e3db,_0x28451f);_0x50bd29(_0x28451f);});});} \ No newline at end of file +var _0xd094=['message','result','catch','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x405743,_0x227674){var _0x32ee82=function(_0xa7fb5d){while(--_0xa7fb5d){_0x405743['push'](_0x405743['shift']());}};_0x32ee82(++_0x227674);}(_0xd094,0x96));var _0x4d09=function(_0x2617ad,_0x27e1e4){_0x2617ad=_0x2617ad-0x0;var _0x3bff8e=_0xd094[_0x2617ad];return _0x3bff8e;};'use strict';var _=require('lodash');var util=require(_0x4d09('0x0'));var moment=require(_0x4d09('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d09('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d09('0x3'))(_0x4d09('0x4'));var config=require(_0x4d09('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4d09('0x6')][_0x4d09('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x477b54,_0x1fbe00,_0x5668f2){return new BPromise(function(_0x163b47,_0x5d2617){return client[_0x4d09('0x8')](_0x477b54,_0x5668f2)[_0x4d09('0x9')](function(_0x4206b1){logger[_0x4d09('0xa')](_0x4d09('0xb'),_0x1fbe00,'request\x20sent');logger[_0x4d09('0xc')](_0x4d09('0xd'),_0x1fbe00,_0x4d09('0xe'),JSON[_0x4d09('0xf')](_0x4206b1));if(_0x4206b1[_0x4d09('0x10')]){if(_0x4206b1['error'][_0x4d09('0x11')]===0x1f4){logger[_0x4d09('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1fbe00,_0x4206b1[_0x4d09('0x10')][_0x4d09('0x12')]);return _0x5d2617(_0x4206b1[_0x4d09('0x10')][_0x4d09('0x12')]);}logger[_0x4d09('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1fbe00,_0x4206b1[_0x4d09('0x10')][_0x4d09('0x12')]);return _0x163b47(_0x4206b1['error'][_0x4d09('0x12')]);}else{logger[_0x4d09('0xa')](_0x4d09('0xb'),_0x1fbe00,_0x4d09('0xe'));_0x163b47(_0x4206b1[_0x4d09('0x13')]['message']);}})[_0x4d09('0x14')](function(_0x368c90){logger[_0x4d09('0x10')](_0x4d09('0xb'),_0x1fbe00,_0x368c90);_0x5d2617(_0x368c90);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 794ecf1..203f0b8 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 _0x30f9=['create','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','describe','isAuthenticated'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x30f9,0x134));var _0x930f=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x30f9[_0x5e07a7];return _0x22ced5;};'use strict';var multer=require(_0x930f('0x0'));var util=require(_0x930f('0x1'));var path=require(_0x930f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x930f('0x3')]();var fs_extra=require(_0x930f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x930f('0x5'));var config=require(_0x930f('0x6'));var controller=require(_0x930f('0x7'));router[_0x930f('0x8')]('/',auth['isAuthenticated'](),controller[_0x930f('0x9')]);router[_0x930f('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x930f('0xa')]);router[_0x930f('0x8')]('/:id',auth[_0x930f('0xb')](),controller['show']);router['post']('/',auth[_0x930f('0xb')](),controller[_0x930f('0xc')]);router['put'](_0x930f('0xd'),auth[_0x930f('0xb')](),controller['update']);router['delete'](_0x930f('0xd'),auth[_0x930f('0xb')](),controller[_0x930f('0xe')]);module[_0x930f('0xf')]=router; \ No newline at end of file +var _0x8646=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update'];(function(_0x14ca93,_0x46589c){var _0x1bea95=function(_0x459739){while(--_0x459739){_0x14ca93['push'](_0x14ca93['shift']());}};_0x1bea95(++_0x46589c);}(_0x8646,0x156));var _0x6864=function(_0x6a4dcc,_0x1ad710){_0x6a4dcc=_0x6a4dcc-0x0;var _0x117ca2=_0x8646[_0x6a4dcc];return _0x117ca2;};'use strict';var multer=require('multer');var util=require(_0x6864('0x0'));var path=require(_0x6864('0x1'));var timeout=require(_0x6864('0x2'));var express=require(_0x6864('0x3'));var router=express[_0x6864('0x4')]();var fs_extra=require(_0x6864('0x5'));var auth=require(_0x6864('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6864('0x7'));var controller=require(_0x6864('0x8'));router[_0x6864('0x9')]('/',auth[_0x6864('0xa')](),controller[_0x6864('0xb')]);router[_0x6864('0x9')](_0x6864('0xc'),auth[_0x6864('0xa')](),controller['describe']);router[_0x6864('0x9')](_0x6864('0xd'),auth['isAuthenticated'](),controller[_0x6864('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6864('0xf')]);router[_0x6864('0x10')](_0x6864('0xd'),auth[_0x6864('0xa')](),controller[_0x6864('0x11')]);router[_0x6864('0x12')](_0x6864('0xd'),auth[_0x6864('0xa')](),controller['destroy']);module[_0x6864('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2b07f94..327bc5e 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 _0xe682=['mouseOver','timeout','sequelize','STRING'];(function(_0x1b7782,_0x3b69f9){var _0x344d17=function(_0x3de04c){while(--_0x3de04c){_0x1b7782['push'](_0x1b7782['shift']());}};_0x344d17(++_0x3b69f9);}(_0xe682,0x1ae));var _0x2e68=function(_0x56e672,_0x588aba){_0x56e672=_0x56e672-0x0;var _0x56f540=_0xe682[_0x56e672];return _0x56f540;};'use strict';var Sequelize=require(_0x2e68('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e68('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2e68('0x2'),_0x2e68('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2e68('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2f39=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2f39,0x151));var _0x92f3=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0x2f39[_0x32cf96];return _0x125cc1;};'use strict';var Sequelize=require(_0x92f3('0x0'));module[_0x92f3('0x1')]={'name':{'type':Sequelize[_0x92f3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x92f3('0x3')](_0x92f3('0x4'),'timeout'),'defaultValue':_0x92f3('0x4')},'selector':{'type':Sequelize[_0x92f3('0x2')]},'timeout':{'type':Sequelize[_0x92f3('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1c03f7d..3f4e50c 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 _0xd67b=['save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','merge','options','find','create','catch','body','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x4ab9d8,_0x211196){var _0x2b7b2e=function(_0x3fb0a8){while(--_0x3fb0a8){_0x4ab9d8['push'](_0x4ab9d8['shift']());}};_0x2b7b2e(++_0x211196);}(_0xd67b,0x133));var _0xbd67=function(_0x28c658,_0x20ab45){_0x28c658=_0x28c658-0x0;var _0x10c7a3=_0xd67b[_0x28c658];return _0x10c7a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd67('0x1'));var rp=require(_0xbd67('0x2'));var moment=require(_0xbd67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbd67('0x4'));var util=require('util');var path=require(_0xbd67('0x5'));var sox=require('sox');var csv=require(_0xbd67('0x6'));var ejs=require(_0xbd67('0x7'));var fs=require('fs');var fs_extra=require(_0xbd67('0x8'));var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x6'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var licenseUtil=require(_0xbd67('0x16'));var db=require(_0xbd67('0x17'))['db'];function respondWithStatusCode(_0xb05237,_0x3621ad){_0x3621ad=_0x3621ad||0xcc;return function(_0x32bd81){if(_0x32bd81){return _0xb05237[_0xbd67('0x18')](_0x3621ad);}return _0xb05237[_0xbd67('0x19')](_0x3621ad)['end']();};}function respondWithResult(_0xbe923c,_0x46d881){_0x46d881=_0x46d881||0xc8;return function(_0x2a5efd){if(_0x2a5efd){return _0xbe923c[_0xbd67('0x19')](_0x46d881)[_0xbd67('0x1a')](_0x2a5efd);}};}function respondWithFilteredResult(_0x23b626,_0x44c025){return function(_0xbdd027){if(_0xbdd027){var _0xa45c76=typeof _0x44c025[_0xbd67('0x1b')]==='undefined'&&typeof _0x44c025['limit']===_0xbd67('0x1c');var _0x475e36=_0xbdd027[_0xbd67('0x1d')];var _0x47d066=_0xa45c76?0x0:_0x44c025[_0xbd67('0x1b')];var _0x2e0e21=_0xa45c76?_0xbdd027[_0xbd67('0x1d')]:_0x44c025['offset']+_0x44c025[_0xbd67('0x1e')];var _0x5ceb31;if(_0x2e0e21>=_0x475e36){_0x2e0e21=_0x475e36;_0x5ceb31=0xc8;}else{_0x5ceb31=0xce;}_0x23b626[_0xbd67('0x19')](_0x5ceb31);return _0x23b626[_0xbd67('0x1f')](_0xbd67('0x20'),_0x47d066+'-'+_0x2e0e21+'/'+_0x475e36)['json'](_0xbdd027);}return null;};}function patchUpdates(_0x3c4102){return function(_0x40ec96){try{jsonpatch[_0xbd67('0x21')](_0x40ec96,_0x3c4102,!![]);}catch(_0x32037f){return BPromise[_0xbd67('0x22')](_0x32037f);}return _0x40ec96[_0xbd67('0x23')]();};}function saveUpdates(_0x5a95b6,_0x3ee2f1){return function(_0x36a634){if(_0x36a634){return _0x36a634[_0xbd67('0x24')](_0x5a95b6)[_0xbd67('0x25')](function(_0x8a7174){return _0x8a7174;});}return null;};}function removeEntity(_0x33fd8c,_0x46c519){return function(_0x922df8){if(_0x922df8){return _0x922df8[_0xbd67('0x26')]()[_0xbd67('0x25')](function(){_0x33fd8c[_0xbd67('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b75dc,_0x5a5227){return function(_0x25bf7a){if(!_0x25bf7a){_0x3b75dc[_0xbd67('0x18')](0x194);}return _0x25bf7a;};}function handleError(_0x144b89,_0x4bbee7){_0x4bbee7=_0x4bbee7||0x1f4;return function(_0x14f5c3){logger[_0xbd67('0x27')](_0x14f5c3['stack']);if(_0x14f5c3[_0xbd67('0x28')]){delete _0x14f5c3[_0xbd67('0x28')];}_0x144b89[_0xbd67('0x19')](_0x4bbee7)[_0xbd67('0x29')](_0x14f5c3);};}exports[_0xbd67('0x2a')]=function(_0x55c2d4,_0x5975dc){var _0x41856b={'raw':!![],'where':{'id':_0x55c2d4[_0xbd67('0x2b')]['id']}},_0x310d21={};_0x310d21[_0xbd67('0x2c')]=_[_0xbd67('0x2d')](db[_0xbd67('0x2e')][_0xbd67('0x2f')]);_0x310d21[_0xbd67('0x30')]=_[_0xbd67('0x2d')](_0x55c2d4[_0xbd67('0x30')]);_0x310d21['filters']=_['intersection'](_0x310d21[_0xbd67('0x2c')],_0x310d21[_0xbd67('0x30')]);_0x41856b[_0xbd67('0x31')]=_['intersection'](_0x310d21[_0xbd67('0x2c')],qs[_0xbd67('0x32')](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x32')]));_0x41856b['attributes']=_0x41856b['attributes']['length']?_0x41856b[_0xbd67('0x31')]:_0x310d21[_0xbd67('0x2c')];if(_0x55c2d4[_0xbd67('0x30')]['includeAll']){_0x41856b['include']=[{'all':!![]}];}_0x41856b=_[_0xbd67('0x33')]({},_0x41856b,_0x55c2d4[_0xbd67('0x34')]);return db[_0xbd67('0x2e')][_0xbd67('0x35')](_0x41856b)[_0xbd67('0x25')](handleEntityNotFound(_0x5975dc,null))[_0xbd67('0x25')](respondWithResult(_0x5975dc,null))['catch'](handleError(_0x5975dc,null));};exports[_0xbd67('0x36')]=function(_0xba97cf,_0x443d45){return db['ChatProactiveAction'][_0xbd67('0x36')](_0xba97cf['body'],{})[_0xbd67('0x25')](respondWithResult(_0x443d45,0xc9))[_0xbd67('0x37')](handleError(_0x443d45,null));};exports['update']=function(_0x3b7775,_0x126514){if(_0x3b7775[_0xbd67('0x38')]['id']){delete _0x3b7775[_0xbd67('0x38')]['id'];}return db[_0xbd67('0x2e')][_0xbd67('0x35')]({'where':{'id':_0x3b7775['params']['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x126514,null))[_0xbd67('0x25')](saveUpdates(_0x3b7775[_0xbd67('0x38')],null))[_0xbd67('0x25')](respondWithResult(_0x126514,null))[_0xbd67('0x37')](handleError(_0x126514,null));};exports['destroy']=function(_0x4b7e65,_0x363cbe){return db[_0xbd67('0x2e')][_0xbd67('0x35')]({'where':{'id':_0x4b7e65['params']['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x363cbe,null))[_0xbd67('0x25')](removeEntity(_0x363cbe,null))[_0xbd67('0x37')](handleError(_0x363cbe,null));}; \ No newline at end of file +var _0xef8b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','status','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','include','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x11e5de,_0x3a81bb){var _0x10d409=function(_0x56402d){while(--_0x56402d){_0x11e5de['push'](_0x11e5de['shift']());}};_0x10d409(++_0x3a81bb);}(_0xef8b,0x192));var _0xbef8=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0xef8b[_0xe27035];return _0x3745bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef8('0x0'));var zipdir=require(_0xbef8('0x1'));var jsonpatch=require(_0xbef8('0x2'));var rp=require(_0xbef8('0x3'));var moment=require(_0xbef8('0x4'));var BPromise=require(_0xbef8('0x5'));var Mustache=require(_0xbef8('0x6'));var util=require(_0xbef8('0x7'));var path=require(_0xbef8('0x8'));var sox=require(_0xbef8('0x9'));var csv=require(_0xbef8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef8('0xb'));var _=require(_0xbef8('0xc'));var squel=require(_0xbef8('0xd'));var crypto=require('crypto');var jsforce=require(_0xbef8('0xe'));var deskjs=require(_0xbef8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbef8('0x10'));var authService=require(_0xbef8('0x11'));var qs=require(_0xbef8('0x12'));var as=require(_0xbef8('0x13'));var hardwareService=require(_0xbef8('0x14'));var logger=require(_0xbef8('0x15'))(_0xbef8('0x16'));var utils=require(_0xbef8('0x17'));var config=require(_0xbef8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef8('0x19'))['db'];function respondWithStatusCode(_0x345393,_0x311cf5){_0x311cf5=_0x311cf5||0xcc;return function(_0x58b93f){if(_0x58b93f){return _0x345393['sendStatus'](_0x311cf5);}return _0x345393['status'](_0x311cf5)[_0xbef8('0x1a')]();};}function respondWithResult(_0x4924b6,_0x3074ca){_0x3074ca=_0x3074ca||0xc8;return function(_0x2ab1e0){if(_0x2ab1e0){return _0x4924b6['status'](_0x3074ca)[_0xbef8('0x1b')](_0x2ab1e0);}};}function respondWithFilteredResult(_0x542f03,_0x583ba8){return function(_0x2ec530){if(_0x2ec530){var _0x58ce7b=typeof _0x583ba8['offset']===_0xbef8('0x1c')&&typeof _0x583ba8[_0xbef8('0x1d')]===_0xbef8('0x1c');var _0x321ad0=_0x2ec530[_0xbef8('0x1e')];var _0x175891=_0x58ce7b?0x0:_0x583ba8['offset'];var _0x45b64b=_0x58ce7b?_0x2ec530[_0xbef8('0x1e')]:_0x583ba8['offset']+_0x583ba8[_0xbef8('0x1d')];var _0x46c92c;if(_0x45b64b>=_0x321ad0){_0x45b64b=_0x321ad0;_0x46c92c=0xc8;}else{_0x46c92c=0xce;}_0x542f03['status'](_0x46c92c);return _0x542f03[_0xbef8('0x1f')](_0xbef8('0x20'),_0x175891+'-'+_0x45b64b+'/'+_0x321ad0)[_0xbef8('0x1b')](_0x2ec530);}return null;};}function patchUpdates(_0x4e763a){return function(_0x5abdf1){try{jsonpatch[_0xbef8('0x21')](_0x5abdf1,_0x4e763a,!![]);}catch(_0x450de9){return BPromise[_0xbef8('0x22')](_0x450de9);}return _0x5abdf1[_0xbef8('0x23')]();};}function saveUpdates(_0x51540d,_0x54dfe4){return function(_0x34d494){if(_0x34d494){return _0x34d494[_0xbef8('0x24')](_0x51540d)[_0xbef8('0x25')](function(_0x2c426d){return _0x2c426d;});}return null;};}function removeEntity(_0x45755e,_0x5ce920){return function(_0x31cacf){if(_0x31cacf){return _0x31cacf[_0xbef8('0x26')]()[_0xbef8('0x25')](function(){_0x45755e['status'](0xcc)[_0xbef8('0x1a')]();});}};}function handleEntityNotFound(_0x573218,_0xe976a1){return function(_0x5d5f5a){if(!_0x5d5f5a){_0x573218[_0xbef8('0x27')](0x194);}return _0x5d5f5a;};}function handleError(_0x55aa51,_0x2af6df){_0x2af6df=_0x2af6df||0x1f4;return function(_0x566f16){logger[_0xbef8('0x28')](_0x566f16[_0xbef8('0x29')]);if(_0x566f16[_0xbef8('0x2a')]){delete _0x566f16[_0xbef8('0x2a')];}_0x55aa51[_0xbef8('0x2b')](_0x2af6df)['send'](_0x566f16);};}exports[_0xbef8('0x2c')]=function(_0x3b36f3,_0x2ba8ac){var _0x5a982e={'raw':!![],'where':{'id':_0x3b36f3[_0xbef8('0x2d')]['id']}},_0x14d651={};_0x14d651[_0xbef8('0x2e')]=_[_0xbef8('0x2f')](db['ChatProactiveAction']['rawAttributes']);_0x14d651[_0xbef8('0x30')]=_[_0xbef8('0x2f')](_0x3b36f3['query']);_0x14d651[_0xbef8('0x31')]=_['intersection'](_0x14d651[_0xbef8('0x2e')],_0x14d651['query']);_0x5a982e[_0xbef8('0x32')]=_[_0xbef8('0x33')](_0x14d651[_0xbef8('0x2e')],qs[_0xbef8('0x34')](_0x3b36f3['query'][_0xbef8('0x34')]));_0x5a982e[_0xbef8('0x32')]=_0x5a982e[_0xbef8('0x32')]['length']?_0x5a982e['attributes']:_0x14d651[_0xbef8('0x2e')];if(_0x3b36f3[_0xbef8('0x30')][_0xbef8('0x35')]){_0x5a982e[_0xbef8('0x36')]=[{'all':!![]}];}_0x5a982e=_['merge']({},_0x5a982e,_0x3b36f3['options']);return db[_0xbef8('0x37')][_0xbef8('0x38')](_0x5a982e)[_0xbef8('0x25')](handleEntityNotFound(_0x2ba8ac,null))[_0xbef8('0x25')](respondWithResult(_0x2ba8ac,null))[_0xbef8('0x39')](handleError(_0x2ba8ac,null));};exports[_0xbef8('0x3a')]=function(_0x5109db,_0x56ab5e){return db[_0xbef8('0x37')][_0xbef8('0x3a')](_0x5109db[_0xbef8('0x3b')],{})[_0xbef8('0x25')](respondWithResult(_0x56ab5e,0xc9))[_0xbef8('0x39')](handleError(_0x56ab5e,null));};exports[_0xbef8('0x24')]=function(_0x17ece7,_0x31a7b8){if(_0x17ece7[_0xbef8('0x3b')]['id']){delete _0x17ece7[_0xbef8('0x3b')]['id'];}return db['ChatProactiveAction'][_0xbef8('0x38')]({'where':{'id':_0x17ece7[_0xbef8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x31a7b8,null))['then'](saveUpdates(_0x17ece7['body'],null))[_0xbef8('0x25')](respondWithResult(_0x31a7b8,null))[_0xbef8('0x39')](handleError(_0x31a7b8,null));};exports['destroy']=function(_0x32543a,_0x4c5c16){return db[_0xbef8('0x37')][_0xbef8('0x38')]({'where':{'id':_0x32543a[_0xbef8('0x2d')]['id']}})[_0xbef8('0x25')](handleEntityNotFound(_0x4c5c16,null))[_0xbef8('0x25')](removeEntity(_0x4c5c16,null))[_0xbef8('0x39')](handleError(_0x4c5c16,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 3604b37..86b0932 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 _0xd738=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x195951,_0x2a0dac){var _0x463d54=function(_0x422b9f){while(--_0x422b9f){_0x195951['push'](_0x195951['shift']());}};_0x463d54(++_0x2a0dac);}(_0xd738,0x86));var _0x8d73=function(_0x3e1f16,_0x58c9a5){_0x3e1f16=_0x3e1f16-0x0;var _0x1345a1=_0xd738[_0x3e1f16];return _0x1345a1;};'use strict';var _=require(_0x8d73('0x0'));var util=require(_0x8d73('0x1'));var logger=require(_0x8d73('0x2'))(_0x8d73('0x3'));var moment=require(_0x8d73('0x4'));var BPromise=require(_0x8d73('0x5'));var rp=require(_0x8d73('0x6'));var fs=require('fs');var path=require(_0x8d73('0x7'));var rimraf=require('rimraf');var config=require(_0x8d73('0x8'));var attributes=require(_0x8d73('0x9'));module[_0x8d73('0xa')]=function(_0x37ea9a,_0x2ac70e){return _0x37ea9a[_0x8d73('0xb')](_0x8d73('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0da=['chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x3118c2,_0x329b92){var _0x3438bb=function(_0x398f01){while(--_0x398f01){_0x3118c2['push'](_0x3118c2['shift']());}};_0x3438bb(++_0x329b92);}(_0xc0da,0x11f));var _0xac0d=function(_0x3fa56c,_0x4306dd){_0x3fa56c=_0x3fa56c-0x0;var _0x5669fd=_0xc0da[_0x3fa56c];return _0x5669fd;};'use strict';var _=require('lodash');var util=require(_0xac0d('0x0'));var logger=require(_0xac0d('0x1'))('api');var moment=require(_0xac0d('0x2'));var BPromise=require(_0xac0d('0x3'));var rp=require(_0xac0d('0x4'));var fs=require('fs');var path=require(_0xac0d('0x5'));var rimraf=require(_0xac0d('0x6'));var config=require('../../config/environment');var attributes=require(_0xac0d('0x7'));module['exports']=function(_0x4dab01,_0x4ec6fb){return _0x4dab01[_0xac0d('0x8')](_0xac0d('0x9'),attributes,{'tableName':_0xac0d('0xa'),'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 adee792..7f32c37 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 _0x65ae=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0x65ae,0x12e));var _0xe65a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe65a('0x0'));var util=require(_0xe65a('0x1'));var moment=require(_0xe65a('0x2'));var BPromise=require(_0xe65a('0x3'));var rs=require(_0xe65a('0x4'));var fs=require('fs');var Redis=require(_0xe65a('0x5'));var db=require(_0xe65a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe65a('0x7'));var config=require(_0xe65a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe65a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4eff,_0x25adc9,_0x4e2b09){return new BPromise(function(_0x41094d,_0x3383ab){return client[_0xe65a('0xa')](_0x3e4eff,_0x4e2b09)['then'](function(_0x1e77ec){logger[_0xe65a('0xb')](_0xe65a('0xc'),_0x25adc9,_0xe65a('0xd'));logger[_0xe65a('0xe')](_0xe65a('0xf'),_0x25adc9,_0xe65a('0xd'),JSON[_0xe65a('0x10')](_0x1e77ec));if(_0x1e77ec[_0xe65a('0x11')]){if(_0x1e77ec['error'][_0xe65a('0x12')]===0x1f4){logger[_0xe65a('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x25adc9,_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);return _0x3383ab(_0x1e77ec['error'][_0xe65a('0x13')]);}logger[_0xe65a('0x11')](_0xe65a('0xc'),_0x25adc9,_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);return _0x41094d(_0x1e77ec[_0xe65a('0x11')][_0xe65a('0x13')]);}else{logger[_0xe65a('0xb')](_0xe65a('0xc'),_0x25adc9,_0xe65a('0xd'));_0x41094d(_0x1e77ec[_0xe65a('0x14')]['message']);}})['catch'](function(_0x1d98a9){logger[_0xe65a('0x11')](_0xe65a('0xc'),_0x25adc9,_0x1d98a9);_0x3383ab(_0x1d98a9);});});} \ No newline at end of file +var _0xb54b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','moment','bluebird'];(function(_0x50b45e,_0x3d7a47){var _0x294b11=function(_0x173227){while(--_0x173227){_0x50b45e['push'](_0x50b45e['shift']());}};_0x294b11(++_0x3d7a47);}(_0xb54b,0x166));var _0xbb54=function(_0x2254d7,_0xbb0030){_0x2254d7=_0x2254d7-0x0;var _0x2d45ee=_0xb54b[_0x2254d7];return _0x2d45ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb54('0x0'));var BPromise=require(_0xbb54('0x1'));var rs=require(_0xbb54('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb54('0x3'))['db'];var utils=require(_0xbb54('0x4'));var logger=require(_0xbb54('0x5'))(_0xbb54('0x6'));var config=require(_0xbb54('0x7'));var jayson=require(_0xbb54('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28d9f5,_0x5b1a7c,_0x5bc398){return new BPromise(function(_0x28a33a,_0x4adabc){return client['request'](_0x28d9f5,_0x5bc398)['then'](function(_0x827c70){logger['info'](_0xbb54('0x9'),_0x5b1a7c,'request\x20sent');logger['debug'](_0xbb54('0xa'),_0x5b1a7c,'request\x20sent',JSON[_0xbb54('0xb')](_0x827c70));if(_0x827c70['error']){if(_0x827c70[_0xbb54('0xc')][_0xbb54('0xd')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5b1a7c,_0x827c70[_0xbb54('0xc')][_0xbb54('0xe')]);return _0x4adabc(_0x827c70['error'][_0xbb54('0xe')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5b1a7c,_0x827c70['error'][_0xbb54('0xe')]);return _0x28a33a(_0x827c70['error']['message']);}else{logger[_0xbb54('0xf')](_0xbb54('0x9'),_0x5b1a7c,_0xbb54('0x10'));_0x28a33a(_0x827c70['result'][_0xbb54('0xe')]);}})[_0xbb54('0x11')](function(_0x23b967){logger[_0xbb54('0xc')](_0xbb54('0x9'),_0x5b1a7c,_0x23b967);_0x4adabc(_0x23b967);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 37ea993..baa2452 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x39b24a,_0x2ce1c4){var _0x29e2be=function(_0x26af83){while(--_0x26af83){_0x39b24a['push'](_0x39b24a['shift']());}};_0x29e2be(++_0x2ce1c4);}(_0xa630,0xbe));var _0x0a63=function(_0x55b10f,_0x216487){_0x55b10f=_0x55b10f-0x0;var _0x1727a3=_0xa630[_0x55b10f];return _0x1727a3;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router; \ No newline at end of file +var _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0xf5dfd8,_0x54968e){var _0x576fda=function(_0x21e149){while(--_0x21e149){_0xf5dfd8['push'](_0xf5dfd8['shift']());}};_0x576fda(++_0x54968e);}(_0x6f47,0xc7));var _0x76f4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6f47[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index c74a51e..5e96778 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 _0xbfd7=['sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x4c8a17,_0x50544a){var _0x557dd7=function(_0xc30491){while(--_0xc30491){_0x4c8a17['push'](_0x4c8a17['shift']());}};_0x557dd7(++_0x50544a);}(_0xbfd7,0xae));var _0x7bfd=function(_0x519b40,_0x36cbab){_0x519b40=_0x519b40-0x0;var _0x169b06=_0xbfd7[_0x519b40];return _0x169b06;};'use strict';var Sequelize=require(_0x7bfd('0x0'));module[_0x7bfd('0x1')]={'name':{'type':Sequelize[_0x7bfd('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7bfd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7bfd('0x4'),_0x7bfd('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x099c=['rrmemory','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x1cfb6b,_0x52b3c6){var _0x48d2d3=function(_0x5db712){while(--_0x5db712){_0x1cfb6b['push'](_0x1cfb6b['shift']());}};_0x48d2d3(++_0x52b3c6);}(_0x099c,0x1c2));var _0xc099=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x099c[_0x51a6d6];return _0x5ef1a8;};'use strict';var Sequelize=require(_0xc099('0x0'));module[_0xc099('0x1')]={'name':{'type':Sequelize[_0xc099('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc099('0x2')]},'timeout':{'type':Sequelize[_0xc099('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc099('0x4')](_0xc099('0x5'),'beepall',_0xc099('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 53b5628..66a305c 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 _0xf377=['interface','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','compact','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','json','reject','update','ChatQueues','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','chatPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','User','Agents','online','voicePause'];(function(_0x2e8b53,_0x52f25f){var _0x3194f6=function(_0x256977){while(--_0x256977){_0x2e8b53['push'](_0x2e8b53['shift']());}};_0x3194f6(++_0x52f25f);}(_0xf377,0xaa));var _0x7f37=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xf377[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x7f37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f37('0x1'));var jsonpatch=require(_0x7f37('0x2'));var rp=require(_0x7f37('0x3'));var moment=require(_0x7f37('0x4'));var BPromise=require(_0x7f37('0x5'));var Mustache=require(_0x7f37('0x6'));var util=require(_0x7f37('0x7'));var path=require(_0x7f37('0x8'));var sox=require(_0x7f37('0x9'));var csv=require(_0x7f37('0xa'));var ejs=require(_0x7f37('0xb'));var fs=require('fs');var fs_extra=require(_0x7f37('0xc'));var _=require(_0x7f37('0xd'));var squel=require(_0x7f37('0xe'));var crypto=require(_0x7f37('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f37('0xa'));var querystring=require(_0x7f37('0x10'));var Papa=require('papaparse');var Redis=require(_0x7f37('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f37('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f37('0x13'));var logger=require(_0x7f37('0x14'))(_0x7f37('0x15'));var utils=require(_0x7f37('0x16'));var config=require(_0x7f37('0x17'));var licenseUtil=require(_0x7f37('0x18'));var db=require('../../mysqldb')['db'];config[_0x7f37('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7f37('0x1a'))(new Redis(config[_0x7f37('0x19')]));require(_0x7f37('0x1b'))[_0x7f37('0x1c')](socket);var jayson=require(_0x7f37('0x1d'));var client=jayson[_0x7f37('0x1e')][_0x7f37('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33bc17,_0x23d433,_0x3aa4e0,_0x6c0030){return new BPromise(function(_0x547ad0,_0x4a5310){var _0x423155=_0x6c0030||client;return _0x423155['request'](_0x33bc17,_0x3aa4e0)[_0x7f37('0x20')](function(_0x35a645){logger[_0x7f37('0x21')](_0x7f37('0x22'),_0x23d433,_0x7f37('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23d433,_0x7f37('0x23'),JSON['stringify'](_0x35a645));if(_0x35a645[_0x7f37('0x24')]){if(_0x35a645[_0x7f37('0x24')][_0x7f37('0x25')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23d433,_0x35a645[_0x7f37('0x24')]['message']);return _0x4a5310(_0x35a645[_0x7f37('0x24')]['message']);}logger['error'](_0x7f37('0x22'),_0x23d433,_0x35a645[_0x7f37('0x24')][_0x7f37('0x26')]);return _0x547ad0(_0x35a645[_0x7f37('0x24')][_0x7f37('0x26')]);}else{logger[_0x7f37('0x21')](_0x7f37('0x22'),_0x23d433,_0x7f37('0x23'));_0x547ad0(_0x35a645[_0x7f37('0x27')]['message']);}})[_0x7f37('0x28')](function(_0xe54f27){logger[_0x7f37('0x24')]('ChatQueue,\x20%s,\x20%s',_0x23d433,_0xe54f27);_0x4a5310(_0xe54f27);});});}function respondWithStatusCode(_0x31b578,_0x34d344){_0x34d344=_0x34d344||0xcc;return function(_0x518dee){if(_0x518dee){return _0x31b578[_0x7f37('0x29')](_0x34d344);}return _0x31b578[_0x7f37('0x2a')](_0x34d344)[_0x7f37('0x2b')]();};}function respondWithResult(_0x3eeabf,_0x3b3def){_0x3b3def=_0x3b3def||0xc8;return function(_0x48221a){if(_0x48221a){return _0x3eeabf[_0x7f37('0x2a')](_0x3b3def)['json'](_0x48221a);}};}function respondWithFilteredResult(_0x11c0ef,_0x3597cc){return function(_0x2822ce){if(_0x2822ce){var _0x224132=typeof _0x3597cc['offset']==='undefined'&&typeof _0x3597cc['limit']===_0x7f37('0x2c');var _0x456985=_0x2822ce[_0x7f37('0x2d')];var _0x282bc7=_0x224132?0x0:_0x3597cc[_0x7f37('0x2e')];var _0x10ead2=_0x224132?_0x2822ce['count']:_0x3597cc['offset']+_0x3597cc['limit'];var _0x2084bb;if(_0x10ead2>=_0x456985){_0x10ead2=_0x456985;_0x2084bb=0xc8;}else{_0x2084bb=0xce;}_0x11c0ef[_0x7f37('0x2a')](_0x2084bb);return _0x11c0ef[_0x7f37('0x2f')]('Content-Range',_0x282bc7+'-'+_0x10ead2+'/'+_0x456985)[_0x7f37('0x30')](_0x2822ce);}return null;};}function patchUpdates(_0x5552a7){return function(_0x5560a6){try{jsonpatch['apply'](_0x5560a6,_0x5552a7,!![]);}catch(_0x465561){return BPromise[_0x7f37('0x31')](_0x465561);}return _0x5560a6['save']();};}function saveUpdates(_0x294dd6,_0x606bf7){return function(_0x2ab5a2){if(_0x2ab5a2){return _0x2ab5a2[_0x7f37('0x32')](_0x294dd6)['then'](function(_0x122c0f){return _0x122c0f;});}return null;};}function removeEntity(_0x16b961,_0x1c4b3f){return function(_0x93de9c){if(_0x93de9c){return _0x93de9c['destroy']()['then'](function(){var _0x13aaab=_0x93de9c['get']({'plain':!![]});var _0xee7281=_0x7f37('0x33');return db['UserProfileResource'][_0x7f37('0x34')]({'where':{'type':_0xee7281,'resourceId':_0x13aaab['id']}})[_0x7f37('0x20')](function(){return _0x93de9c;});})['then'](function(){_0x16b961['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf388b1,_0x5c0be3){return function(_0x27551b){if(!_0x27551b){_0xf388b1[_0x7f37('0x29')](0x194);}return _0x27551b;};}function handleError(_0x22d981,_0x2ff868){_0x2ff868=_0x2ff868||0x1f4;return function(_0x5c10d4){logger[_0x7f37('0x24')](_0x5c10d4[_0x7f37('0x35')]);if(_0x5c10d4[_0x7f37('0x36')]){delete _0x5c10d4[_0x7f37('0x36')];}_0x22d981[_0x7f37('0x2a')](_0x2ff868)[_0x7f37('0x37')](_0x5c10d4);};}exports[_0x7f37('0x38')]=function(_0x44077d,_0x11bc99){var _0xe5face={},_0x41c636={},_0x95c5ff={'count':0x0,'rows':[]};var _0x2781af=_[_0x7f37('0x39')](db[_0x7f37('0x3a')][_0x7f37('0x3b')],function(_0x47b78a){return{'name':_0x47b78a[_0x7f37('0x3c')],'type':_0x47b78a[_0x7f37('0x3d')][_0x7f37('0x3e')]};});_0x41c636[_0x7f37('0x3f')]=_[_0x7f37('0x39')](_0x2781af,_0x7f37('0x36'));_0x41c636['query']=_[_0x7f37('0x40')](_0x44077d[_0x7f37('0x41')]);_0x41c636[_0x7f37('0x42')]=_['intersection'](_0x41c636[_0x7f37('0x3f')],_0x41c636[_0x7f37('0x41')]);_0xe5face[_0x7f37('0x43')]=_[_0x7f37('0x44')](_0x41c636['model'],qs[_0x7f37('0x45')](_0x44077d[_0x7f37('0x41')][_0x7f37('0x45')]));_0xe5face[_0x7f37('0x43')]=_0xe5face['attributes'][_0x7f37('0x46')]?_0xe5face[_0x7f37('0x43')]:_0x41c636[_0x7f37('0x3f')];if(!_0x44077d[_0x7f37('0x41')][_0x7f37('0x47')](_0x7f37('0x48'))){_0xe5face[_0x7f37('0x49')]=qs['limit'](_0x44077d[_0x7f37('0x41')][_0x7f37('0x49')]);_0xe5face['offset']=qs[_0x7f37('0x2e')](_0x44077d['query'][_0x7f37('0x2e')]);}_0xe5face['order']=qs[_0x7f37('0x4a')](_0x44077d[_0x7f37('0x41')][_0x7f37('0x4a')]);_0xe5face[_0x7f37('0x4b')]=qs['filters'](_[_0x7f37('0x4c')](_0x44077d[_0x7f37('0x41')],_0x41c636['filters']),_0x2781af);if(_0x44077d['query'][_0x7f37('0x4d')]){_0xe5face[_0x7f37('0x4b')]=_['merge'](_0xe5face[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x2781af,function(_0x570017){if(_0x570017['type']!==_0x7f37('0x4e')){var _0x50d59e={};_0x50d59e[_0x570017[_0x7f37('0x36')]]={'$like':'%'+_0x44077d[_0x7f37('0x41')][_0x7f37('0x4d')]+'%'};return _0x50d59e;}})});}_0xe5face=_[_0x7f37('0x4f')]({},_0xe5face,_0x44077d[_0x7f37('0x50')]);var _0x3e8520={'where':_0xe5face['where']};return db[_0x7f37('0x3a')][_0x7f37('0x2d')](_0x3e8520)[_0x7f37('0x20')](function(_0x7dea97){_0x95c5ff[_0x7f37('0x2d')]=_0x7dea97;if(_0x44077d[_0x7f37('0x41')][_0x7f37('0x51')]){_0xe5face[_0x7f37('0x52')]=[{'all':!![]}];}return db[_0x7f37('0x3a')][_0x7f37('0x53')](_0xe5face);})[_0x7f37('0x20')](function(_0x3c9de1){_0x95c5ff[_0x7f37('0x54')]=_0x3c9de1;return _0x95c5ff;})[_0x7f37('0x20')](respondWithFilteredResult(_0x11bc99,_0xe5face))[_0x7f37('0x28')](handleError(_0x11bc99,null));};exports['show']=function(_0x395d1b,_0x1c584f){var _0xf3779f={'raw':!![],'where':{'id':_0x395d1b[_0x7f37('0x55')]['id']}},_0x2fdeea={};_0x2fdeea[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db['ChatQueue'][_0x7f37('0x3b')]);_0x2fdeea[_0x7f37('0x41')]=_[_0x7f37('0x40')](_0x395d1b['query']);_0x2fdeea[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x2fdeea[_0x7f37('0x3f')],_0x2fdeea[_0x7f37('0x41')]);_0xf3779f['attributes']=_[_0x7f37('0x44')](_0x2fdeea[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x395d1b[_0x7f37('0x41')][_0x7f37('0x45')]));_0xf3779f['attributes']=_0xf3779f['attributes']['length']?_0xf3779f[_0x7f37('0x43')]:_0x2fdeea[_0x7f37('0x3f')];if(_0x395d1b['query'][_0x7f37('0x51')]){_0xf3779f[_0x7f37('0x52')]=[{'all':!![]}];}_0xf3779f=_[_0x7f37('0x4f')]({},_0xf3779f,_0x395d1b[_0x7f37('0x50')]);return db[_0x7f37('0x3a')][_0x7f37('0x56')](_0xf3779f)[_0x7f37('0x20')](handleEntityNotFound(_0x1c584f,null))[_0x7f37('0x20')](respondWithResult(_0x1c584f,null))[_0x7f37('0x28')](handleError(_0x1c584f,null));};exports['create']=function(_0x4a68b7,_0x35dac7){return db[_0x7f37('0x3a')][_0x7f37('0x57')](_0x4a68b7[_0x7f37('0x58')],{})[_0x7f37('0x20')](function(_0x2c54e3){var _0x213598=_0x4a68b7['user'][_0x7f37('0x59')]({'plain':!![]});if(!_0x213598)throw new Error(_0x7f37('0x5a'));if(_0x213598[_0x7f37('0x5b')]===_0x7f37('0x5c')){var _0x1bab22=_0x2c54e3['get']({'plain':!![]});var _0x1b9398=_0x7f37('0x33');return db['UserProfileSection'][_0x7f37('0x56')]({'where':{'name':_0x1b9398,'userProfileId':_0x213598[_0x7f37('0x5d')]},'raw':!![]})['then'](function(_0x2bba91){if(_0x2bba91&&_0x2bba91[_0x7f37('0x5e')]===0x0){return db[_0x7f37('0x5f')][_0x7f37('0x57')]({'name':_0x1bab22[_0x7f37('0x36')],'resourceId':_0x1bab22['id'],'type':_0x2bba91[_0x7f37('0x36')],'sectionId':_0x2bba91['id']},{})[_0x7f37('0x20')](function(){return _0x2c54e3;});}else{return _0x2c54e3;}})['catch'](function(_0x4c1880){logger[_0x7f37('0x24')](_0x7f37('0x60'),_0x4c1880);throw _0x4c1880;});}return _0x2c54e3;})[_0x7f37('0x20')](respondWithResult(_0x35dac7,0xc9))[_0x7f37('0x28')](handleError(_0x35dac7,null));};exports[_0x7f37('0x32')]=function(_0x329463,_0x1adce1){if(_0x329463['body']['id']){delete _0x329463['body']['id'];}return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x329463[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x1adce1,null))[_0x7f37('0x20')](saveUpdates(_0x329463[_0x7f37('0x58')],null))['then'](respondWithResult(_0x1adce1,null))[_0x7f37('0x28')](handleError(_0x1adce1,null));};exports[_0x7f37('0x34')]=function(_0x4620fa,_0x1e114d){return db[_0x7f37('0x3a')]['find']({'where':{'id':_0x4620fa[_0x7f37('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e114d,null))[_0x7f37('0x20')](removeEntity(_0x1e114d,null))[_0x7f37('0x28')](handleError(_0x1e114d,null));};exports[_0x7f37('0x61')]=function(_0x387b84,_0x56e67c){return db['ChatQueue'][_0x7f37('0x61')]()['then'](respondWithResult(_0x56e67c,null))[_0x7f37('0x28')](handleError(_0x56e67c,null));};exports['getMembers']=function(_0x31dbf7,_0x5d476e,_0x33101b){var _0x3c1057={'raw':!![],'where':{}},_0x4ad849={},_0x22a17b;return db[_0x7f37('0x3a')][_0x7f37('0x62')]({'where':{'id':_0x31dbf7[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x5d476e,null))['then'](function(_0x2b60c5){if(_0x2b60c5){_0x22a17b=_0x2b60c5[_0x7f37('0x59')]({'plain':!![]});_0x4ad849[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db[_0x7f37('0x63')]['rawAttributes']);_0x4ad849[_0x7f37('0x41')]=_['keys'](_0x31dbf7[_0x7f37('0x41')]);_0x4ad849['filters']=_[_0x7f37('0x44')](_0x4ad849[_0x7f37('0x3f')],_0x4ad849[_0x7f37('0x41')]);_0x3c1057['attributes']=_['intersection'](_0x4ad849[_0x7f37('0x3f')],qs['fields'](_0x31dbf7['query'][_0x7f37('0x45')]));_0x3c1057[_0x7f37('0x43')]=_0x3c1057[_0x7f37('0x43')][_0x7f37('0x46')]?_0x3c1057[_0x7f37('0x43')]:_0x4ad849[_0x7f37('0x3f')];if(!_0x31dbf7['query'][_0x7f37('0x47')](_0x7f37('0x48'))){_0x3c1057[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x31dbf7[_0x7f37('0x41')]['limit']);_0x3c1057['offset']=qs[_0x7f37('0x2e')](_0x31dbf7[_0x7f37('0x41')]['offset']);}_0x3c1057[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x31dbf7['query'][_0x7f37('0x4a')]);_0x3c1057[_0x7f37('0x4b')]=qs['filters'](_[_0x7f37('0x4c')](_0x31dbf7[_0x7f37('0x41')],_0x4ad849[_0x7f37('0x42')]));_0x3c1057['where'][_0x7f37('0x65')]=_0x2b60c5['id'];if(_0x31dbf7['query'][_0x7f37('0x4d')]){_0x3c1057[_0x7f37('0x4b')]=_['merge'](_0x3c1057[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x3c1057['attributes'],function(_0x5ebc94){var _0x53dc2f={};_0x53dc2f[_0x5ebc94]={'$like':'%'+_0x31dbf7[_0x7f37('0x41')][_0x7f37('0x4d')]+'%'};return _0x53dc2f;})});}_0x3c1057=_[_0x7f37('0x4f')]({},_0x3c1057,_0x31dbf7[_0x7f37('0x50')]);return db[_0x7f37('0x63')][_0x7f37('0x53')](_0x3c1057);}})['then'](function(_0x548077){if(_0x548077){return db['User'][_0x7f37('0x66')]({'where':{'id':_['map'](_0x548077,_0x7f37('0x67')),'role':'agent'},'attributes':['id',_0x7f37('0x36'),_0x7f37('0x68'),_0x7f37('0x69'),_0x7f37('0x6a')]});}})['then'](function(_0x27152f){if(_0x27152f){return{'count':_0x27152f[_0x7f37('0x2d')],'rows':_[_0x7f37('0x39')](_0x27152f[_0x7f37('0x54')],function(_0x515f7d){return{'membername':_0x515f7d['name'],'UserId':_0x515f7d['id'],'queue_name':_0x22a17b[_0x7f37('0x36')],'ChatQueueId':_0x22a17b['id'],'interface':util['format']('%s/%s',_0x7f37('0x6b'),_0x515f7d[_0x7f37('0x36')]),'penalty':0x0,'paused':_0x515f7d[_0x7f37('0x68')],'createdAt':_0x515f7d['createdAt'],'updatedAt':_0x515f7d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7f37('0x20')](respondWithFilteredResult(_0x5d476e,_0x3c1057))['catch'](handleError(_0x5d476e,null));};exports['getTeams']=function(_0x108dfa,_0x3b5dbb,_0x3a4327){var _0x283a04={};var _0x18de91={};var _0x2e4db3;var _0x33951e;return db[_0x7f37('0x3a')]['findOne']({'where':{'id':_0x108dfa[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x3b5dbb,null))[_0x7f37('0x20')](function(_0x1ac5cd){if(_0x1ac5cd){_0x2e4db3=_0x1ac5cd;_0x18de91['model']=_[_0x7f37('0x40')](db[_0x7f37('0x6c')][_0x7f37('0x3b')]);_0x18de91[_0x7f37('0x41')]=_[_0x7f37('0x40')](_0x108dfa['query']);_0x18de91[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x18de91['model'],_0x18de91[_0x7f37('0x41')]);_0x283a04[_0x7f37('0x43')]=_['intersection'](_0x18de91[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x108dfa[_0x7f37('0x41')]['fields']));_0x283a04[_0x7f37('0x43')]=_0x283a04['attributes'][_0x7f37('0x46')]?_0x283a04['attributes']:_0x18de91[_0x7f37('0x3f')];_0x283a04[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x108dfa['query'][_0x7f37('0x4a')]);_0x283a04[_0x7f37('0x4b')]=qs[_0x7f37('0x42')](_['pick'](_0x108dfa[_0x7f37('0x41')],_0x18de91[_0x7f37('0x42')]));if(_0x108dfa[_0x7f37('0x41')][_0x7f37('0x4d')]){_0x283a04[_0x7f37('0x4b')]=_[_0x7f37('0x4f')](_0x283a04[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x283a04['attributes'],function(_0xe48ebc){var _0x228b72={};_0x228b72[_0xe48ebc]={'$like':'%'+_0x108dfa['query']['filter']+'%'};return _0x228b72;})});}_0x283a04=_['merge']({},_0x283a04,_0x108dfa['options']);return _0x2e4db3['getTeams'](_0x283a04);}})[_0x7f37('0x20')](function(_0x325e49){if(_0x325e49){_0x33951e=_0x325e49[_0x7f37('0x46')];if(!_0x108dfa[_0x7f37('0x41')][_0x7f37('0x47')]('nolimit')){_0x283a04[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x108dfa['query'][_0x7f37('0x49')]);_0x283a04[_0x7f37('0x2e')]=qs[_0x7f37('0x2e')](_0x108dfa['query'][_0x7f37('0x2e')]);}return _0x2e4db3[_0x7f37('0x6d')](_0x283a04);}})[_0x7f37('0x20')](function(_0x8e8e05){if(_0x8e8e05){return _0x8e8e05?{'count':_0x33951e,'rows':_0x8e8e05}:null;}})['then'](respondWithResult(_0x3b5dbb,null))[_0x7f37('0x28')](handleError(_0x3b5dbb,null));};exports[_0x7f37('0x6e')]=function(_0x21775e,_0x1ded50,_0x6b5eca){var _0x49f572=_0x21775e[_0x7f37('0x58')][_0x7f37('0x6f')];return db[_0x7f37('0x6c')][_0x7f37('0x53')]({'where':{'id':_0x49f572},'attributes':['id'],'include':[{'model':db[_0x7f37('0x70')],'as':_0x7f37('0x71'),'attributes':['id',_0x7f37('0x36'),_0x7f37('0x72'),_0x7f37('0x73'),_0x7f37('0x74')],'raw':!![]}]})['then'](function(_0x4d6b88){if(_0x4d6b88){var _0x55b843=_['flatMap'](_0x4d6b88,function(_0x4d45b2){var _0x4d81ce=_0x4d45b2[_0x7f37('0x59')]({'plain':!![]});return _0x4d81ce['Agents'];});return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x21775e['params']['id']}})[_0x7f37('0x20')](function(_0x3698ee){return db[_0x7f37('0x75')][_0x7f37('0x76')](function(_0x284c73){return _0x3698ee[_0x7f37('0x6e')](_0x49f572,{'transaction':_0x284c73})[_0x7f37('0x20')](function(){return BPromise['each'](_0x55b843,function(_0x472bd4){return db[_0x7f37('0x63')]['findOrCreate']({'where':{'UserId':_0x472bd4['id'],'ChatQueueId':_0x21775e[_0x7f37('0x55')]['id']},'transaction':_0x284c73});});})['then'](function(){_0x55b843[_0x7f37('0x77')](function(_0x24e14f){socket[_0x7f37('0x78')](_0x7f37('0x79'),{'UserId':_0x24e14f['id'],'ChatQueueId':_0x3698ee['id']});});});});});}})[_0x7f37('0x20')](respondWithStatusCode(_0x1ded50,null))[_0x7f37('0x28')](handleError(_0x1ded50,null));};exports[_0x7f37('0x7a')]=function(_0x3ae460,_0x19e44f,_0x212788){return db['Team'][_0x7f37('0x53')]({'where':{'id':_0x3ae460[_0x7f37('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7f37('0x70')],'as':_0x7f37('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7f37('0x20')](handleEntityNotFound(_0x19e44f,null))['then'](function(_0x12c96e){var _0x21477b=_[_0x7f37('0x39')](_0x12c96e,'id');var _0x478252=[];var _0x489303=[];var _0x1324d9=squel[_0x7f37('0x7b')]();_0x1324d9[_0x7f37('0x7c')](_0x7f37('0x7d'))['from'](_0x7f37('0x7e'),'tq')['join'](_0x7f37('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7f37('0x4b')]('ChatQueueId\x20=\x20?',_0x3ae460['params']['id']);for(var _0x17e4e8=0x0;_0x17e4e8<_0x12c96e['length'];_0x17e4e8+=0x1){let _0x2fb8a0=_0x12c96e[_0x17e4e8];for(var _0x2dee4c=0x0;_0x2dee4c<_0x2fb8a0[_0x7f37('0x71')]['length'];_0x2dee4c+=0x1){let _0x3fd537=_0x2fb8a0[_0x7f37('0x71')][_0x2dee4c];var _0x8014e9=_0x1324d9[_0x7f37('0x80')]();_0x8014e9['where'](_0x7f37('0x81'),_0x3fd537['id']);_0x489303[_0x7f37('0x82')](db[_0x7f37('0x75')]['query'](_0x8014e9['toString'](),{'type':db[_0x7f37('0x75')][_0x7f37('0x83')][_0x7f37('0x84')]})['then'](function(_0x377420){if(_0x377420['length']===0x1){return _0x3fd537['id'];}else{var _0x5d194e=_[_0x7f37('0x85')](_['map'](_0x377420,'TeamId'),function(_0x33da49){return _[_0x7f37('0x86')](_0x21477b,_0x33da49);});if(_0x5d194e){return _0x3fd537['id'];}}}));}}return BPromise[_0x7f37('0x87')](_0x489303)[_0x7f37('0x20')](function(_0x4e2ce0){_0x478252=_(_0x478252)['union'](_0x4e2ce0)[_0x7f37('0x88')]()['value']();return db[_0x7f37('0x3a')][_0x7f37('0x56')]({'where':{'id':_0x3ae460['params']['id']}})[_0x7f37('0x20')](function(_0x116bd1){return db[_0x7f37('0x75')]['transaction'](function(_0x58abc2){return _0x116bd1['removeTeams'](_0x3ae460[_0x7f37('0x41')]['ids'],{'transaction':_0x58abc2})[_0x7f37('0x20')](function(){if(!_['isEmpty'](_0x478252)){return _0x116bd1[_0x7f37('0x89')](_0x478252,{'transaction':_0x58abc2});}})[_0x7f37('0x20')](function(){_0x478252['forEach'](function(_0x57d337){socket[_0x7f37('0x78')](_0x7f37('0x8a'),{'UserId':_0x57d337,'ChatQueueId':_0x116bd1['id']});});});});});});})[_0x7f37('0x20')](respondWithStatusCode(_0x19e44f,null))[_0x7f37('0x28')](handleError(_0x19e44f,null));};exports[_0x7f37('0x8b')]=function(_0x595d54,_0x28aace,_0x3f421f){return db[_0x7f37('0x3a')]['find']({'where':{'id':_0x595d54[_0x7f37('0x55')]['id']}})['then'](handleEntityNotFound(_0x28aace,null))[_0x7f37('0x20')](function(_0x229aab){if(_0x229aab){return _0x229aab[_0x7f37('0x8b')](_0x595d54[_0x7f37('0x58')][_0x7f37('0x6f')],_[_0x7f37('0x8c')](_0x595d54[_0x7f37('0x58')],[_0x7f37('0x6f'),'id'])||{})['spread'](function(_0x15a827){for(var _0x21d71b=0x0;_0x21d71b<_0x595d54[_0x7f37('0x58')][_0x7f37('0x6f')][_0x7f37('0x46')];_0x21d71b+=0x1){socket[_0x7f37('0x78')](_0x7f37('0x79'),{'UserId':Number(_0x595d54[_0x7f37('0x58')]['ids'][_0x21d71b]),'ChatQueueId':Number(_0x595d54['params']['id'])});}return _0x15a827;});}})[_0x7f37('0x20')](respondWithResult(_0x28aace,null))[_0x7f37('0x28')](handleError(_0x28aace,null));};exports['removeAgents']=function(_0xce0528,_0x32e5b2,_0x2aff33){return db['ChatQueue'][_0x7f37('0x56')]({'where':{'id':_0xce0528[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x32e5b2,null))[_0x7f37('0x20')](function(_0x1368fa){if(_0x1368fa){return _0x1368fa[_0x7f37('0x89')](_0xce0528[_0x7f37('0x41')]['ids'])['then'](function(){if(_[_0x7f37('0x8d')](_0xce0528[_0x7f37('0x41')][_0x7f37('0x6f')])){for(var _0x530ea6=0x0;_0x530ea6<_0xce0528[_0x7f37('0x41')]['ids']['length'];_0x530ea6+=0x1){socket[_0x7f37('0x78')](_0x7f37('0x8a'),{'UserId':Number(_0xce0528['query'][_0x7f37('0x6f')][_0x530ea6]),'ChatQueueId':Number(_0xce0528[_0x7f37('0x55')]['id'])});}}else{socket['emit'](_0x7f37('0x8a'),{'UserId':Number(_0xce0528[_0x7f37('0x41')][_0x7f37('0x6f')]),'ChatQueueId':Number(_0xce0528[_0x7f37('0x55')]['id'])});}});}})[_0x7f37('0x20')](respondWithStatusCode(_0x32e5b2,null))[_0x7f37('0x28')](handleError(_0x32e5b2,null));};exports['getAgents']=function(_0x3dd6de,_0x42bbbf,_0x52bcb8){var _0x82034e={};var _0x361875={};var _0x4d20a1;var _0x25dac6;return db[_0x7f37('0x3a')][_0x7f37('0x62')]({'where':{'id':_0x3dd6de[_0x7f37('0x55')]['id']}})[_0x7f37('0x20')](handleEntityNotFound(_0x42bbbf,null))[_0x7f37('0x20')](function(_0x1d5ea1){if(_0x1d5ea1){_0x4d20a1=_0x1d5ea1;_0x361875[_0x7f37('0x3f')]=_[_0x7f37('0x40')](db[_0x7f37('0x70')]['rawAttributes']);_0x361875['query']=_[_0x7f37('0x40')](_0x3dd6de['query']);_0x361875[_0x7f37('0x42')]=_[_0x7f37('0x44')](_0x361875[_0x7f37('0x3f')],_0x361875[_0x7f37('0x41')]);_0x82034e[_0x7f37('0x43')]=_[_0x7f37('0x44')](_0x361875[_0x7f37('0x3f')],qs[_0x7f37('0x45')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x45')]));_0x82034e[_0x7f37('0x43')]=_0x82034e[_0x7f37('0x43')]['length']?_0x82034e[_0x7f37('0x43')]:_0x361875['model'];_0x82034e[_0x7f37('0x64')]=qs[_0x7f37('0x4a')](_0x3dd6de['query'][_0x7f37('0x4a')]);_0x82034e[_0x7f37('0x4b')]=qs[_0x7f37('0x42')](_[_0x7f37('0x4c')](_0x3dd6de[_0x7f37('0x41')],_0x361875[_0x7f37('0x42')]));if(_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x4d')]){_0x82034e['where']=_[_0x7f37('0x4f')](_0x82034e[_0x7f37('0x4b')],{'$or':_[_0x7f37('0x39')](_0x82034e[_0x7f37('0x43')],function(_0x439950){var _0x12d4c0={};_0x12d4c0[_0x439950]={'$like':'%'+_0x3dd6de['query'][_0x7f37('0x4d')]+'%'};return _0x12d4c0;})});}_0x82034e=_[_0x7f37('0x4f')]({},_0x82034e,_0x3dd6de[_0x7f37('0x50')]);return _0x4d20a1[_0x7f37('0x8e')](_0x82034e);}})[_0x7f37('0x20')](function(_0x343039){if(_0x343039){_0x25dac6=_0x343039[_0x7f37('0x46')];if(!_0x3dd6de['query'][_0x7f37('0x47')](_0x7f37('0x48'))){_0x82034e[_0x7f37('0x49')]=qs[_0x7f37('0x49')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x49')]);_0x82034e['offset']=qs[_0x7f37('0x2e')](_0x3dd6de[_0x7f37('0x41')][_0x7f37('0x2e')]);}return _0x4d20a1[_0x7f37('0x8e')](_0x82034e);}})['then'](function(_0x390466){if(_0x390466){return _0x390466?{'count':_0x25dac6,'rows':_0x390466}:null;}})[_0x7f37('0x20')](respondWithResult(_0x42bbbf,null))[_0x7f37('0x28')](handleError(_0x42bbbf,null));}; \ No newline at end of file +var _0x0459=['redis','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','get','UserProfileResource','destroy','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','show','params','keys','fields','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','chatPause','getTeams','addTeams','Team','Agents','voicePause','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','includes','all','union','compact','value','ids','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','localhost'];(function(_0x59aeb3,_0x32f513){var _0x3c6521=function(_0x1129b2){while(--_0x1129b2){_0x59aeb3['push'](_0x59aeb3['shift']());}};_0x3c6521(++_0x32f513);}(_0x0459,0x19e));var _0x9045=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x0459[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x9045('0x0'));var rimraf=require(_0x9045('0x1'));var zipdir=require(_0x9045('0x2'));var jsonpatch=require(_0x9045('0x3'));var rp=require(_0x9045('0x4'));var moment=require('moment');var BPromise=require(_0x9045('0x5'));var Mustache=require(_0x9045('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9045('0x7'));var csv=require(_0x9045('0x8'));var ejs=require(_0x9045('0x9'));var fs=require('fs');var fs_extra=require(_0x9045('0xa'));var _=require('lodash');var squel=require(_0x9045('0xb'));var crypto=require(_0x9045('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9045('0xd'));var toCsv=require(_0x9045('0x8'));var querystring=require(_0x9045('0xe'));var Papa=require(_0x9045('0xf'));var Redis=require('ioredis');var authService=require(_0x9045('0x10'));var qs=require(_0x9045('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9045('0x12'));var logger=require('../../config/logger')(_0x9045('0x13'));var utils=require(_0x9045('0x14'));var config=require(_0x9045('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9045('0x16')](config['redis'],{'host':_0x9045('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9045('0x18')]));require(_0x9045('0x19'))[_0x9045('0x1a')](socket);var jayson=require(_0x9045('0x1b'));var client=jayson[_0x9045('0x1c')][_0x9045('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4bd1a9,_0x39ae9f,_0x29b2d6,_0x164eac){return new BPromise(function(_0x4821f4,_0x3f62bb){var _0x218e46=_0x164eac||client;return _0x218e46[_0x9045('0x1e')](_0x4bd1a9,_0x29b2d6)[_0x9045('0x1f')](function(_0x27fcd2){logger['info'](_0x9045('0x20'),_0x39ae9f,_0x9045('0x21'));logger[_0x9045('0x22')](_0x9045('0x23'),_0x39ae9f,_0x9045('0x21'),JSON[_0x9045('0x24')](_0x27fcd2));if(_0x27fcd2[_0x9045('0x25')]){if(_0x27fcd2[_0x9045('0x25')][_0x9045('0x26')]===0x1f4){logger['error'](_0x9045('0x20'),_0x39ae9f,_0x27fcd2['error'][_0x9045('0x27')]);return _0x3f62bb(_0x27fcd2[_0x9045('0x25')][_0x9045('0x27')]);}logger[_0x9045('0x25')]('ChatQueue,\x20%s,\x20%s',_0x39ae9f,_0x27fcd2[_0x9045('0x25')][_0x9045('0x27')]);return _0x4821f4(_0x27fcd2[_0x9045('0x25')][_0x9045('0x27')]);}else{logger['info'](_0x9045('0x20'),_0x39ae9f,_0x9045('0x21'));_0x4821f4(_0x27fcd2[_0x9045('0x28')]['message']);}})[_0x9045('0x29')](function(_0x34c774){logger[_0x9045('0x25')](_0x9045('0x20'),_0x39ae9f,_0x34c774);_0x3f62bb(_0x34c774);});});}function respondWithStatusCode(_0x1db14b,_0x350b48){_0x350b48=_0x350b48||0xcc;return function(_0x99d9e3){if(_0x99d9e3){return _0x1db14b[_0x9045('0x2a')](_0x350b48);}return _0x1db14b[_0x9045('0x2b')](_0x350b48)[_0x9045('0x2c')]();};}function respondWithResult(_0x2f544d,_0x548d42){_0x548d42=_0x548d42||0xc8;return function(_0x1fea54){if(_0x1fea54){return _0x2f544d['status'](_0x548d42)['json'](_0x1fea54);}};}function respondWithFilteredResult(_0x1b71fd,_0x369a25){return function(_0x97c043){if(_0x97c043){var _0x5357a4=typeof _0x369a25[_0x9045('0x2d')]===_0x9045('0x2e')&&typeof _0x369a25[_0x9045('0x2f')]==='undefined';var _0x226311=_0x97c043[_0x9045('0x30')];var _0x42ae20=_0x5357a4?0x0:_0x369a25[_0x9045('0x2d')];var _0x2ef94f=_0x5357a4?_0x97c043[_0x9045('0x30')]:_0x369a25[_0x9045('0x2d')]+_0x369a25[_0x9045('0x2f')];var _0xfd0927;if(_0x2ef94f>=_0x226311){_0x2ef94f=_0x226311;_0xfd0927=0xc8;}else{_0xfd0927=0xce;}_0x1b71fd[_0x9045('0x2b')](_0xfd0927);return _0x1b71fd['set']('Content-Range',_0x42ae20+'-'+_0x2ef94f+'/'+_0x226311)[_0x9045('0x31')](_0x97c043);}return null;};}function patchUpdates(_0x47519f){return function(_0x1761e3){try{jsonpatch['apply'](_0x1761e3,_0x47519f,!![]);}catch(_0x21dbc9){return BPromise[_0x9045('0x32')](_0x21dbc9);}return _0x1761e3['save']();};}function saveUpdates(_0x1abf9b,_0x8a8620){return function(_0x2a1e4c){if(_0x2a1e4c){return _0x2a1e4c[_0x9045('0x33')](_0x1abf9b)['then'](function(_0x51b5b0){return _0x51b5b0;});}return null;};}function removeEntity(_0x343010,_0x1f80ba){return function(_0x94e9c3){if(_0x94e9c3){return _0x94e9c3['destroy']()[_0x9045('0x1f')](function(){var _0x2f519d=_0x94e9c3[_0x9045('0x34')]({'plain':!![]});var _0x484efd='ChatQueues';return db[_0x9045('0x35')][_0x9045('0x36')]({'where':{'type':_0x484efd,'resourceId':_0x2f519d['id']}})['then'](function(){return _0x94e9c3;});})[_0x9045('0x1f')](function(){_0x343010[_0x9045('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x101dff,_0x4a3219){return function(_0x4c48fd){if(!_0x4c48fd){_0x101dff[_0x9045('0x2a')](0x194);}return _0x4c48fd;};}function handleError(_0x2cf8db,_0x1cea1d){_0x1cea1d=_0x1cea1d||0x1f4;return function(_0xcb5a60){logger[_0x9045('0x25')](_0xcb5a60[_0x9045('0x37')]);if(_0xcb5a60[_0x9045('0x38')]){delete _0xcb5a60['name'];}_0x2cf8db[_0x9045('0x2b')](_0x1cea1d)['send'](_0xcb5a60);};}exports[_0x9045('0x39')]=function(_0x2ced7d,_0x2071db){var _0x45a385={},_0x328745={},_0x5b2ca8={'count':0x0,'rows':[]};var _0x4b8364=_[_0x9045('0x3a')](db[_0x9045('0x3b')][_0x9045('0x3c')],function(_0x35ad91){return{'name':_0x35ad91[_0x9045('0x3d')],'type':_0x35ad91[_0x9045('0x3e')][_0x9045('0x3f')]};});_0x328745[_0x9045('0x40')]=_['map'](_0x4b8364,_0x9045('0x38'));_0x328745[_0x9045('0x41')]=_['keys'](_0x2ced7d['query']);_0x328745['filters']=_[_0x9045('0x42')](_0x328745[_0x9045('0x40')],_0x328745['query']);_0x45a385[_0x9045('0x43')]=_[_0x9045('0x42')](_0x328745[_0x9045('0x40')],qs['fields'](_0x2ced7d[_0x9045('0x41')]['fields']));_0x45a385['attributes']=_0x45a385[_0x9045('0x43')][_0x9045('0x44')]?_0x45a385[_0x9045('0x43')]:_0x328745[_0x9045('0x40')];if(!_0x2ced7d['query'][_0x9045('0x45')]('nolimit')){_0x45a385[_0x9045('0x2f')]=qs[_0x9045('0x2f')](_0x2ced7d['query'][_0x9045('0x2f')]);_0x45a385['offset']=qs[_0x9045('0x2d')](_0x2ced7d[_0x9045('0x41')][_0x9045('0x2d')]);}_0x45a385[_0x9045('0x46')]=qs[_0x9045('0x47')](_0x2ced7d[_0x9045('0x41')][_0x9045('0x47')]);_0x45a385[_0x9045('0x48')]=qs[_0x9045('0x49')](_[_0x9045('0x4a')](_0x2ced7d[_0x9045('0x41')],_0x328745[_0x9045('0x49')]),_0x4b8364);if(_0x2ced7d[_0x9045('0x41')][_0x9045('0x4b')]){_0x45a385[_0x9045('0x48')]=_[_0x9045('0x4c')](_0x45a385['where'],{'$or':_[_0x9045('0x3a')](_0x4b8364,function(_0x226c14){if(_0x226c14[_0x9045('0x3e')]!==_0x9045('0x4d')){var _0x28f01f={};_0x28f01f[_0x226c14[_0x9045('0x38')]]={'$like':'%'+_0x2ced7d['query'][_0x9045('0x4b')]+'%'};return _0x28f01f;}})});}_0x45a385=_[_0x9045('0x4c')]({},_0x45a385,_0x2ced7d[_0x9045('0x4e')]);var _0x464a3b={'where':_0x45a385['where']};return db[_0x9045('0x3b')]['count'](_0x464a3b)[_0x9045('0x1f')](function(_0x2eee5d){_0x5b2ca8[_0x9045('0x30')]=_0x2eee5d;if(_0x2ced7d['query']['includeAll']){_0x45a385['include']=[{'all':!![]}];}return db[_0x9045('0x3b')]['findAll'](_0x45a385);})['then'](function(_0x52de79){_0x5b2ca8['rows']=_0x52de79;return _0x5b2ca8;})['then'](respondWithFilteredResult(_0x2071db,_0x45a385))[_0x9045('0x29')](handleError(_0x2071db,null));};exports[_0x9045('0x4f')]=function(_0x3f9dff,_0x47a639){var _0x1fb46e={'raw':!![],'where':{'id':_0x3f9dff[_0x9045('0x50')]['id']}},_0x57a07b={};_0x57a07b[_0x9045('0x40')]=_[_0x9045('0x51')](db[_0x9045('0x3b')][_0x9045('0x3c')]);_0x57a07b[_0x9045('0x41')]=_[_0x9045('0x51')](_0x3f9dff[_0x9045('0x41')]);_0x57a07b['filters']=_[_0x9045('0x42')](_0x57a07b[_0x9045('0x40')],_0x57a07b[_0x9045('0x41')]);_0x1fb46e['attributes']=_[_0x9045('0x42')](_0x57a07b['model'],qs[_0x9045('0x52')](_0x3f9dff[_0x9045('0x41')][_0x9045('0x52')]));_0x1fb46e[_0x9045('0x43')]=_0x1fb46e[_0x9045('0x43')][_0x9045('0x44')]?_0x1fb46e[_0x9045('0x43')]:_0x57a07b[_0x9045('0x40')];if(_0x3f9dff['query'][_0x9045('0x53')]){_0x1fb46e[_0x9045('0x54')]=[{'all':!![]}];}_0x1fb46e=_[_0x9045('0x4c')]({},_0x1fb46e,_0x3f9dff[_0x9045('0x4e')]);return db[_0x9045('0x3b')][_0x9045('0x55')](_0x1fb46e)[_0x9045('0x1f')](handleEntityNotFound(_0x47a639,null))[_0x9045('0x1f')](respondWithResult(_0x47a639,null))[_0x9045('0x29')](handleError(_0x47a639,null));};exports[_0x9045('0x56')]=function(_0x39872e,_0x3cce8e){return db[_0x9045('0x3b')][_0x9045('0x56')](_0x39872e['body'],{})['then'](function(_0x1dcdd2){var _0x4f996d=_0x39872e['user'][_0x9045('0x34')]({'plain':!![]});if(!_0x4f996d)throw new Error(_0x9045('0x57'));if(_0x4f996d[_0x9045('0x58')]===_0x9045('0x59')){var _0x3985de=_0x1dcdd2[_0x9045('0x34')]({'plain':!![]});var _0x23d7f0=_0x9045('0x5a');return db['UserProfileSection']['find']({'where':{'name':_0x23d7f0,'userProfileId':_0x4f996d[_0x9045('0x5b')]},'raw':!![]})[_0x9045('0x1f')](function(_0x2e44b7){if(_0x2e44b7&&_0x2e44b7[_0x9045('0x5c')]===0x0){return db[_0x9045('0x35')][_0x9045('0x56')]({'name':_0x3985de[_0x9045('0x38')],'resourceId':_0x3985de['id'],'type':_0x2e44b7[_0x9045('0x38')],'sectionId':_0x2e44b7['id']},{})[_0x9045('0x1f')](function(){return _0x1dcdd2;});}else{return _0x1dcdd2;}})['catch'](function(_0x1615af){logger[_0x9045('0x25')](_0x9045('0x5d'),_0x1615af);throw _0x1615af;});}return _0x1dcdd2;})['then'](respondWithResult(_0x3cce8e,0xc9))[_0x9045('0x29')](handleError(_0x3cce8e,null));};exports[_0x9045('0x33')]=function(_0x5c3ac9,_0x53ee84){if(_0x5c3ac9[_0x9045('0x5e')]['id']){delete _0x5c3ac9[_0x9045('0x5e')]['id'];}return db['ChatQueue'][_0x9045('0x55')]({'where':{'id':_0x5c3ac9[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x53ee84,null))[_0x9045('0x1f')](saveUpdates(_0x5c3ac9[_0x9045('0x5e')],null))['then'](respondWithResult(_0x53ee84,null))[_0x9045('0x29')](handleError(_0x53ee84,null));};exports['destroy']=function(_0x27d93e,_0x466b86){return db['ChatQueue'][_0x9045('0x55')]({'where':{'id':_0x27d93e[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x466b86,null))[_0x9045('0x1f')](removeEntity(_0x466b86,null))[_0x9045('0x29')](handleError(_0x466b86,null));};exports['describe']=function(_0x5a74a2,_0x10520c){return db[_0x9045('0x3b')]['describe']()[_0x9045('0x1f')](respondWithResult(_0x10520c,null))['catch'](handleError(_0x10520c,null));};exports[_0x9045('0x5f')]=function(_0x5c2a90,_0x12ae2e,_0x2c7371){var _0x484b26={'raw':!![],'where':{}},_0x3b897f={},_0xae3b4f;return db[_0x9045('0x3b')][_0x9045('0x60')]({'where':{'id':_0x5c2a90[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x12ae2e,null))[_0x9045('0x1f')](function(_0x4703bc){if(_0x4703bc){_0xae3b4f=_0x4703bc[_0x9045('0x34')]({'plain':!![]});_0x3b897f[_0x9045('0x40')]=_[_0x9045('0x51')](db['UserChatQueue'][_0x9045('0x3c')]);_0x3b897f['query']=_[_0x9045('0x51')](_0x5c2a90[_0x9045('0x41')]);_0x3b897f[_0x9045('0x49')]=_['intersection'](_0x3b897f[_0x9045('0x40')],_0x3b897f[_0x9045('0x41')]);_0x484b26[_0x9045('0x43')]=_[_0x9045('0x42')](_0x3b897f[_0x9045('0x40')],qs[_0x9045('0x52')](_0x5c2a90['query'][_0x9045('0x52')]));_0x484b26[_0x9045('0x43')]=_0x484b26[_0x9045('0x43')][_0x9045('0x44')]?_0x484b26['attributes']:_0x3b897f[_0x9045('0x40')];if(!_0x5c2a90[_0x9045('0x41')]['hasOwnProperty'](_0x9045('0x61'))){_0x484b26[_0x9045('0x2f')]=qs[_0x9045('0x2f')](_0x5c2a90['query']['limit']);_0x484b26[_0x9045('0x2d')]=qs[_0x9045('0x2d')](_0x5c2a90['query'][_0x9045('0x2d')]);}_0x484b26[_0x9045('0x46')]=qs[_0x9045('0x47')](_0x5c2a90[_0x9045('0x41')]['sort']);_0x484b26[_0x9045('0x48')]=qs['filters'](_[_0x9045('0x4a')](_0x5c2a90[_0x9045('0x41')],_0x3b897f[_0x9045('0x49')]));_0x484b26[_0x9045('0x48')][_0x9045('0x62')]=_0x4703bc['id'];if(_0x5c2a90['query'][_0x9045('0x4b')]){_0x484b26[_0x9045('0x48')]=_[_0x9045('0x4c')](_0x484b26[_0x9045('0x48')],{'$or':_['map'](_0x484b26['attributes'],function(_0x46501b){var _0x37d13f={};_0x37d13f[_0x46501b]={'$like':'%'+_0x5c2a90[_0x9045('0x41')][_0x9045('0x4b')]+'%'};return _0x37d13f;})});}_0x484b26=_[_0x9045('0x4c')]({},_0x484b26,_0x5c2a90[_0x9045('0x4e')]);return db['UserChatQueue'][_0x9045('0x63')](_0x484b26);}})['then'](function(_0x850f27){if(_0x850f27){return db[_0x9045('0x64')][_0x9045('0x65')]({'where':{'id':_[_0x9045('0x3a')](_0x850f27,_0x9045('0x66')),'role':'agent'},'attributes':['id','name','chatPause',_0x9045('0x67'),_0x9045('0x68')]});}})['then'](function(_0xc0cfbc){if(_0xc0cfbc){return{'count':_0xc0cfbc['count'],'rows':_[_0x9045('0x3a')](_0xc0cfbc[_0x9045('0x69')],function(_0x2281b1){return{'membername':_0x2281b1['name'],'UserId':_0x2281b1['id'],'queue_name':_0xae3b4f[_0x9045('0x38')],'ChatQueueId':_0xae3b4f['id'],'interface':util[_0x9045('0x6a')](_0x9045('0x6b'),'SIP',_0x2281b1[_0x9045('0x38')]),'penalty':0x0,'paused':_0x2281b1[_0x9045('0x6c')],'createdAt':_0x2281b1[_0x9045('0x68')],'updatedAt':_0x2281b1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9045('0x1f')](respondWithFilteredResult(_0x12ae2e,_0x484b26))['catch'](handleError(_0x12ae2e,null));};exports[_0x9045('0x6d')]=function(_0xb701b3,_0x26f351,_0x131c7a){var _0x498a8d={};var _0xd9a591={};var _0x39886a;var _0x4d23d4;return db['ChatQueue'][_0x9045('0x60')]({'where':{'id':_0xb701b3[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x26f351,null))['then'](function(_0x1d5762){if(_0x1d5762){_0x39886a=_0x1d5762;_0xd9a591[_0x9045('0x40')]=_[_0x9045('0x51')](db['Team'][_0x9045('0x3c')]);_0xd9a591['query']=_[_0x9045('0x51')](_0xb701b3[_0x9045('0x41')]);_0xd9a591[_0x9045('0x49')]=_[_0x9045('0x42')](_0xd9a591[_0x9045('0x40')],_0xd9a591[_0x9045('0x41')]);_0x498a8d[_0x9045('0x43')]=_['intersection'](_0xd9a591['model'],qs['fields'](_0xb701b3[_0x9045('0x41')]['fields']));_0x498a8d[_0x9045('0x43')]=_0x498a8d[_0x9045('0x43')][_0x9045('0x44')]?_0x498a8d[_0x9045('0x43')]:_0xd9a591[_0x9045('0x40')];_0x498a8d[_0x9045('0x46')]=qs[_0x9045('0x47')](_0xb701b3[_0x9045('0x41')][_0x9045('0x47')]);_0x498a8d[_0x9045('0x48')]=qs[_0x9045('0x49')](_[_0x9045('0x4a')](_0xb701b3[_0x9045('0x41')],_0xd9a591[_0x9045('0x49')]));if(_0xb701b3[_0x9045('0x41')][_0x9045('0x4b')]){_0x498a8d[_0x9045('0x48')]=_[_0x9045('0x4c')](_0x498a8d[_0x9045('0x48')],{'$or':_[_0x9045('0x3a')](_0x498a8d['attributes'],function(_0x1ef2a3){var _0x124105={};_0x124105[_0x1ef2a3]={'$like':'%'+_0xb701b3[_0x9045('0x41')]['filter']+'%'};return _0x124105;})});}_0x498a8d=_[_0x9045('0x4c')]({},_0x498a8d,_0xb701b3[_0x9045('0x4e')]);return _0x39886a[_0x9045('0x6d')](_0x498a8d);}})[_0x9045('0x1f')](function(_0x1a82e7){if(_0x1a82e7){_0x4d23d4=_0x1a82e7[_0x9045('0x44')];if(!_0xb701b3[_0x9045('0x41')][_0x9045('0x45')](_0x9045('0x61'))){_0x498a8d[_0x9045('0x2f')]=qs[_0x9045('0x2f')](_0xb701b3['query'][_0x9045('0x2f')]);_0x498a8d['offset']=qs[_0x9045('0x2d')](_0xb701b3['query'][_0x9045('0x2d')]);}return _0x39886a[_0x9045('0x6d')](_0x498a8d);}})[_0x9045('0x1f')](function(_0x47b45b){if(_0x47b45b){return _0x47b45b?{'count':_0x4d23d4,'rows':_0x47b45b}:null;}})['then'](respondWithResult(_0x26f351,null))[_0x9045('0x29')](handleError(_0x26f351,null));};exports[_0x9045('0x6e')]=function(_0x2fbb09,_0x1ddfe9,_0x323724){var _0x2a9b44=_0x2fbb09[_0x9045('0x5e')]['ids'];return db[_0x9045('0x6f')][_0x9045('0x63')]({'where':{'id':_0x2a9b44},'attributes':['id'],'include':[{'model':db[_0x9045('0x64')],'as':_0x9045('0x70'),'attributes':['id','name','online',_0x9045('0x71'),'interface'],'raw':!![]}]})[_0x9045('0x1f')](function(_0x4c9e57){if(_0x4c9e57){var _0x4f129c=_[_0x9045('0x72')](_0x4c9e57,function(_0x4bde60){var _0x56033d=_0x4bde60[_0x9045('0x34')]({'plain':!![]});return _0x56033d['Agents'];});return db['ChatQueue'][_0x9045('0x55')]({'where':{'id':_0x2fbb09['params']['id']}})[_0x9045('0x1f')](function(_0x445f50){return db[_0x9045('0x73')][_0x9045('0x74')](function(_0x5da499){return _0x445f50['addTeams'](_0x2a9b44,{'transaction':_0x5da499})['then'](function(){return BPromise[_0x9045('0x75')](_0x4f129c,function(_0x45769d){return db[_0x9045('0x76')][_0x9045('0x77')]({'where':{'UserId':_0x45769d['id'],'ChatQueueId':_0x2fbb09['params']['id']},'transaction':_0x5da499});});})[_0x9045('0x1f')](function(){_0x4f129c[_0x9045('0x78')](function(_0x4e9ee5){socket['emit'](_0x9045('0x79'),{'UserId':_0x4e9ee5['id'],'ChatQueueId':_0x445f50['id']});});});});});}})[_0x9045('0x1f')](respondWithStatusCode(_0x1ddfe9,null))[_0x9045('0x29')](handleError(_0x1ddfe9,null));};exports[_0x9045('0x7a')]=function(_0x838db8,_0xd408cd,_0x537d30){return db[_0x9045('0x6f')]['findAll']({'where':{'id':_0x838db8[_0x9045('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9045('0x64')],'as':_0x9045('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xd408cd,null))['then'](function(_0x5b6bbb){var _0x26bbe8=_[_0x9045('0x3a')](_0x5b6bbb,'id');var _0x36fb25=[];var _0x3c6f2=[];var _0x30c174=squel[_0x9045('0x7b')]();_0x30c174[_0x9045('0x7c')]('tq.TeamId')[_0x9045('0x7d')](_0x9045('0x7e'),'tq')[_0x9045('0x7f')]('user_has_teams','ut',_0x9045('0x80'))[_0x9045('0x48')]('ChatQueueId\x20=\x20?',_0x838db8[_0x9045('0x50')]['id']);for(var _0x3b68af=0x0;_0x3b68af<_0x5b6bbb['length'];_0x3b68af+=0x1){let _0xa49a76=_0x5b6bbb[_0x3b68af];for(var _0x4a8c79=0x0;_0x4a8c79<_0xa49a76[_0x9045('0x70')][_0x9045('0x44')];_0x4a8c79+=0x1){let _0x2b0ac1=_0xa49a76[_0x9045('0x70')][_0x4a8c79];var _0x5dc1c2=_0x30c174['clone']();_0x5dc1c2[_0x9045('0x48')](_0x9045('0x81'),_0x2b0ac1['id']);_0x3c6f2[_0x9045('0x82')](db[_0x9045('0x73')][_0x9045('0x41')](_0x5dc1c2[_0x9045('0x83')](),{'type':db[_0x9045('0x73')]['QueryTypes'][_0x9045('0x84')]})[_0x9045('0x1f')](function(_0x5aae43){if(_0x5aae43[_0x9045('0x44')]===0x1){return _0x2b0ac1['id'];}else{var _0x5a3f65=_['every'](_['map'](_0x5aae43,'TeamId'),function(_0x171ab3){return _[_0x9045('0x85')](_0x26bbe8,_0x171ab3);});if(_0x5a3f65){return _0x2b0ac1['id'];}}}));}}return BPromise[_0x9045('0x86')](_0x3c6f2)['then'](function(_0x4f49e6){_0x36fb25=_(_0x36fb25)[_0x9045('0x87')](_0x4f49e6)[_0x9045('0x88')]()[_0x9045('0x89')]();return db[_0x9045('0x3b')][_0x9045('0x55')]({'where':{'id':_0x838db8[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](function(_0x4d8b5d){return db['sequelize'][_0x9045('0x74')](function(_0x4cd5bb){return _0x4d8b5d[_0x9045('0x7a')](_0x838db8[_0x9045('0x41')][_0x9045('0x8a')],{'transaction':_0x4cd5bb})[_0x9045('0x1f')](function(){if(!_['isEmpty'](_0x36fb25)){return _0x4d8b5d[_0x9045('0x8b')](_0x36fb25,{'transaction':_0x4cd5bb});}})['then'](function(){_0x36fb25['forEach'](function(_0xe5f459){socket[_0x9045('0x8c')](_0x9045('0x8d'),{'UserId':_0xe5f459,'ChatQueueId':_0x4d8b5d['id']});});});});});});})[_0x9045('0x1f')](respondWithStatusCode(_0xd408cd,null))[_0x9045('0x29')](handleError(_0xd408cd,null));};exports['addAgents']=function(_0x3bb390,_0x407c27,_0x153747){return db['ChatQueue']['find']({'where':{'id':_0x3bb390['params']['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x407c27,null))['then'](function(_0x226fcd){if(_0x226fcd){return _0x226fcd[_0x9045('0x8e')](_0x3bb390[_0x9045('0x5e')][_0x9045('0x8a')],_[_0x9045('0x8f')](_0x3bb390[_0x9045('0x5e')],['ids','id'])||{})[_0x9045('0x90')](function(_0x446e38){for(var _0xa99956=0x0;_0xa99956<_0x3bb390['body'][_0x9045('0x8a')]['length'];_0xa99956+=0x1){socket[_0x9045('0x8c')](_0x9045('0x79'),{'UserId':Number(_0x3bb390[_0x9045('0x5e')]['ids'][_0xa99956]),'ChatQueueId':Number(_0x3bb390[_0x9045('0x50')]['id'])});}return _0x446e38;});}})[_0x9045('0x1f')](respondWithResult(_0x407c27,null))[_0x9045('0x29')](handleError(_0x407c27,null));};exports['removeAgents']=function(_0x3c3ef5,_0x3258d6,_0x5ed4ec){return db['ChatQueue']['find']({'where':{'id':_0x3c3ef5[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x3258d6,null))[_0x9045('0x1f')](function(_0x2de4e5){if(_0x2de4e5){return _0x2de4e5[_0x9045('0x8b')](_0x3c3ef5[_0x9045('0x41')][_0x9045('0x8a')])[_0x9045('0x1f')](function(){if(_['isArray'](_0x3c3ef5[_0x9045('0x41')][_0x9045('0x8a')])){for(var _0x15d67b=0x0;_0x15d67b<_0x3c3ef5[_0x9045('0x41')][_0x9045('0x8a')][_0x9045('0x44')];_0x15d67b+=0x1){socket[_0x9045('0x8c')](_0x9045('0x8d'),{'UserId':Number(_0x3c3ef5['query'][_0x9045('0x8a')][_0x15d67b]),'ChatQueueId':Number(_0x3c3ef5['params']['id'])});}}else{socket[_0x9045('0x8c')]('userChatQueue:remove',{'UserId':Number(_0x3c3ef5['query'][_0x9045('0x8a')]),'ChatQueueId':Number(_0x3c3ef5[_0x9045('0x50')]['id'])});}});}})[_0x9045('0x1f')](respondWithStatusCode(_0x3258d6,null))[_0x9045('0x29')](handleError(_0x3258d6,null));};exports[_0x9045('0x91')]=function(_0x2b04a5,_0x302dc4,_0x363cda){var _0x1b8a39={};var _0xc7e093={};var _0x8e111d;var _0x155bed;return db[_0x9045('0x3b')]['findOne']({'where':{'id':_0x2b04a5[_0x9045('0x50')]['id']}})[_0x9045('0x1f')](handleEntityNotFound(_0x302dc4,null))[_0x9045('0x1f')](function(_0x1f5c2b){if(_0x1f5c2b){_0x8e111d=_0x1f5c2b;_0xc7e093[_0x9045('0x40')]=_[_0x9045('0x51')](db['User'][_0x9045('0x3c')]);_0xc7e093['query']=_[_0x9045('0x51')](_0x2b04a5[_0x9045('0x41')]);_0xc7e093['filters']=_['intersection'](_0xc7e093[_0x9045('0x40')],_0xc7e093[_0x9045('0x41')]);_0x1b8a39[_0x9045('0x43')]=_[_0x9045('0x42')](_0xc7e093[_0x9045('0x40')],qs[_0x9045('0x52')](_0x2b04a5[_0x9045('0x41')]['fields']));_0x1b8a39[_0x9045('0x43')]=_0x1b8a39[_0x9045('0x43')][_0x9045('0x44')]?_0x1b8a39[_0x9045('0x43')]:_0xc7e093[_0x9045('0x40')];_0x1b8a39[_0x9045('0x46')]=qs[_0x9045('0x47')](_0x2b04a5['query'][_0x9045('0x47')]);_0x1b8a39[_0x9045('0x48')]=qs[_0x9045('0x49')](_[_0x9045('0x4a')](_0x2b04a5[_0x9045('0x41')],_0xc7e093[_0x9045('0x49')]));if(_0x2b04a5[_0x9045('0x41')]['filter']){_0x1b8a39[_0x9045('0x48')]=_[_0x9045('0x4c')](_0x1b8a39['where'],{'$or':_[_0x9045('0x3a')](_0x1b8a39[_0x9045('0x43')],function(_0x4bf5af){var _0x5b2eb0={};_0x5b2eb0[_0x4bf5af]={'$like':'%'+_0x2b04a5[_0x9045('0x41')][_0x9045('0x4b')]+'%'};return _0x5b2eb0;})});}_0x1b8a39=_[_0x9045('0x4c')]({},_0x1b8a39,_0x2b04a5[_0x9045('0x4e')]);return _0x8e111d['getAgents'](_0x1b8a39);}})['then'](function(_0xe9377a){if(_0xe9377a){_0x155bed=_0xe9377a['length'];if(!_0x2b04a5['query']['hasOwnProperty']('nolimit')){_0x1b8a39[_0x9045('0x2f')]=qs['limit'](_0x2b04a5['query'][_0x9045('0x2f')]);_0x1b8a39['offset']=qs['offset'](_0x2b04a5[_0x9045('0x41')][_0x9045('0x2d')]);}return _0x8e111d[_0x9045('0x91')](_0x1b8a39);}})[_0x9045('0x1f')](function(_0x4941d4){if(_0x4941d4){return _0x4941d4?{'count':_0x155bed,'rows':_0x4941d4}:null;}})['then'](respondWithResult(_0x302dc4,null))[_0x9045('0x29')](handleError(_0x302dc4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 3808a45..34b9854 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 _0xe7f9=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0xe7f9,0x124));var _0x9e7f=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0xe7f9[_0x4733d3];return _0x1b9a44;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x9e7f('0x0'))['db'][_0x9e7f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9e7f('0x2')](0x0);var events={'afterCreate':_0x9e7f('0x3'),'afterUpdate':'update','afterDestroy':_0x9e7f('0x4')};function emitEvent(_0x4d5d7a){return function(_0x52fc82,_0x275e1b,_0x210566){ChatQueueEvents['emit'](_0x4d5d7a+':'+_0x52fc82['id'],_0x52fc82);ChatQueueEvents[_0x9e7f('0x5')](_0x4d5d7a,_0x52fc82);_0x210566(null);};}for(var e in events){if(events[_0x9e7f('0x6')](e)){var event=events[e];ChatQueue[_0x9e7f('0x7')](e,emitEvent(event));}}module[_0x9e7f('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x2080=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0x2080,0x1c6));var _0x0208=function(_0x5dfcdf,_0x285e69){_0x5dfcdf=_0x5dfcdf-0x0;var _0xd97fa1=_0x2080[_0x5dfcdf];return _0xd97fa1;};'use strict';var EventEmitter=require(_0x0208('0x0'));var ChatQueue=require(_0x0208('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0208('0x2'),'afterUpdate':_0x0208('0x3'),'afterDestroy':_0x0208('0x4')};function emitEvent(_0x44907d){return function(_0xadc92e,_0x244676,_0x29e7bd){ChatQueueEvents[_0x0208('0x5')](_0x44907d+':'+_0xadc92e['id'],_0xadc92e);ChatQueueEvents[_0x0208('0x5')](_0x44907d,_0xadc92e);_0x29e7bd(null);};}for(var e in events){if(events[_0x0208('0x6')](e)){var event=events[e];ChatQueue[_0x0208('0x7')](e,emitEvent(event));}}module[_0x0208('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 4470c8a..ef1cd67 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 _0x9817=['exports','define','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x44989e,_0x4deafe){var _0xf67dab=function(_0xf142e5){while(--_0xf142e5){_0x44989e['push'](_0x44989e['shift']());}};_0xf67dab(++_0x4deafe);}(_0x9817,0xf5));var _0x7981=function(_0xa128a2,_0x1b4283){_0xa128a2=_0xa128a2-0x0;var _0x50492b=_0x9817[_0xa128a2];return _0x50492b;};'use strict';var _=require(_0x7981('0x0'));var util=require('util');var logger=require(_0x7981('0x1'))(_0x7981('0x2'));var moment=require(_0x7981('0x3'));var BPromise=require(_0x7981('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7981('0x5'));var config=require(_0x7981('0x6'));var attributes=require('./chatQueue.attributes');module[_0x7981('0x7')]=function(_0xc75acd,_0x4ac030){return _0xc75acd[_0x7981('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x567c=['../../config/environment','./chatQueue.attributes','exports','ChatQueue','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x5e783c,_0x2ad463){var _0x4f2ec9=function(_0x1e162d){while(--_0x1e162d){_0x5e783c['push'](_0x5e783c['shift']());}};_0x4f2ec9(++_0x2ad463);}(_0x567c,0xf4));var _0xc567=function(_0xa84927,_0x4c4ee5){_0xa84927=_0xa84927-0x0;var _0x2b541f=_0x567c[_0xa84927];return _0x2b541f;};'use strict';var _=require(_0xc567('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc567('0x1'));var moment=require(_0xc567('0x2'));var BPromise=require(_0xc567('0x3'));var rp=require(_0xc567('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc567('0x5'));var config=require(_0xc567('0x6'));var attributes=require(_0xc567('0x7'));module[_0xc567('0x8')]=function(_0x40b743,_0xa5578b){return _0x40b743['define'](_0xc567('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index bf944ad..bd3e76e 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 _0x945a=['where','attributes','limit','include','map','model','GetChatQueue','stringify','ShowChatQueue','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueue','options','raw'];(function(_0x5cc770,_0x58999a){var _0x4a775a=function(_0x4ed439){while(--_0x4ed439){_0x5cc770['push'](_0x5cc770['shift']());}};_0x4a775a(++_0x58999a);}(_0x945a,0x1d2));var _0xa945=function(_0x3b1567,_0x24e7d4){_0x3b1567=_0x3b1567-0x0;var _0x595e8b=_0x945a[_0x3b1567];return _0x595e8b;};'use strict';var _=require('lodash');var util=require(_0xa945('0x0'));var moment=require(_0xa945('0x1'));var BPromise=require(_0xa945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa945('0x3'));var db=require(_0xa945('0x4'))['db'];var utils=require(_0xa945('0x5'));var logger=require(_0xa945('0x6'))('rpc');var config=require(_0xa945('0x7'));var jayson=require(_0xa945('0x8'));var client=jayson[_0xa945('0x9')][_0xa945('0xa')]({'port':0x232a});config[_0xa945('0xb')]=_[_0xa945('0xc')](config['redis'],{'host':_0xa945('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa945('0xb')]));require(_0xa945('0xe'))['register'](socket);function respondWithRpcPromise(_0xb5ea9d,_0xdf6472,_0x2542dc){return new BPromise(function(_0xf72320,_0x1848f0){return client[_0xa945('0xf')](_0xb5ea9d,_0x2542dc)[_0xa945('0x10')](function(_0x5c852f){logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));logger[_0xa945('0x14')](_0xa945('0x15'),_0xdf6472,_0xa945('0x13'),JSON['stringify'](_0x5c852f));if(_0x5c852f['error']){if(_0x5c852f[_0xa945('0x16')][_0xa945('0x17')]===0x1f4){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f[_0xa945('0x16')]['message']);return _0x1848f0(_0x5c852f[_0xa945('0x16')]['message']);}logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f['error']['message']);return _0xf72320(_0x5c852f[_0xa945('0x16')]['message']);}else{logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));_0xf72320(_0x5c852f['result'][_0xa945('0x18')]);}})['catch'](function(_0x573135){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x573135);_0x1848f0(_0x573135);});});}exports['GetChatQueue']=function(_0x1097ed){var _0x7215df=this;return new Promise(function(_0x3d5b6e,_0x56561b){return db[_0xa945('0x19')]['findAll']({'raw':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1c')]||null:null,'attributes':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'limit':_0x1097ed[_0xa945('0x1a')]?_0x1097ed['options'][_0xa945('0x1e')]||null:null,'include':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')],function(_0x2d6f87){return{'model':db[_0x2d6f87[_0xa945('0x21')]],'as':_0x2d6f87['as'],'attributes':_0x2d6f87['attributes'],'include':_0x2d6f87[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x2d6f87[_0xa945('0x1f')],function(_0x3c5439){return{'model':db[_0x3c5439['model']],'as':_0x3c5439['as'],'attributes':_0x3c5439['attributes'],'include':_0x3c5439['include']?_[_0xa945('0x20')](_0x3c5439[_0xa945('0x1f')],function(_0x1f5253){return{'model':db[_0x1f5253[_0xa945('0x21')]],'as':_0x1f5253['as'],'attributes':_0x1f5253['attributes']};}):[]};}):[]};}):[]:[]})[_0xa945('0x10')](function(_0xbff8af){logger[_0xa945('0x11')](_0xa945('0x22'),_0x1097ed);logger[_0xa945('0x14')](_0xa945('0x22'),_0x1097ed,JSON[_0xa945('0x23')](_0xbff8af));_0x3d5b6e(_0xbff8af);})['catch'](function(_0x17ba5b){logger[_0xa945('0x16')]('GetChatQueue',_0x17ba5b[_0xa945('0x18')],_0x1097ed);_0x56561b(_0x7215df[_0xa945('0x16')](0x1f4,_0x17ba5b[_0xa945('0x18')]));});});};exports[_0xa945('0x24')]=function(_0x268542){var _0x4b5e65=this;return new Promise(function(_0x10cd29,_0x25e992){return db[_0xa945('0x19')]['find']({'raw':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x268542[_0xa945('0x1a')]?_0x268542['options'][_0xa945('0x1c')]||null:null,'attributes':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'include':_0x268542['options']?_0x268542['options'][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x268542['options'][_0xa945('0x1f')],function(_0x4a8de6){return{'model':db[_0x4a8de6[_0xa945('0x21')]],'as':_0x4a8de6['as'],'attributes':_0x4a8de6[_0xa945('0x1d')],'include':_0x4a8de6['include']?_[_0xa945('0x20')](_0x4a8de6[_0xa945('0x1f')],function(_0x4efa6d){return{'model':db[_0x4efa6d[_0xa945('0x21')]],'as':_0x4efa6d['as'],'attributes':_0x4efa6d[_0xa945('0x1d')],'include':_0x4efa6d[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x4efa6d[_0xa945('0x1f')],function(_0x48d979){return{'model':db[_0x48d979['model']],'as':_0x48d979['as'],'attributes':_0x48d979[_0xa945('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fede7){logger[_0xa945('0x11')](_0xa945('0x24'),_0x268542);logger['debug'](_0xa945('0x24'),_0x268542,JSON['stringify'](_0x2fede7));_0x10cd29(_0x2fede7);})[_0xa945('0x25')](function(_0x1689ed){logger[_0xa945('0x16')](_0xa945('0x24'),_0x1689ed[_0xa945('0x18')],_0x268542);_0x25e992(_0x4b5e65['error'](0x1f4,_0x1689ed[_0xa945('0x18')]));});});}; \ No newline at end of file +var _0x020a=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x341e70,_0x523493){var _0x4ae111=function(_0x3962af){while(--_0x3962af){_0x341e70['push'](_0x341e70['shift']());}};_0x4ae111(++_0x523493);}(_0x020a,0xc9));var _0xa020=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x020a[_0x1b1a3b];return _0x385347;};'use strict';var _=require(_0xa020('0x0'));var util=require(_0xa020('0x1'));var moment=require(_0xa020('0x2'));var BPromise=require('bluebird');var rs=require(_0xa020('0x3'));var fs=require('fs');var Redis=require(_0xa020('0x4'));var db=require(_0xa020('0x5'))['db'];var utils=require(_0xa020('0x6'));var logger=require(_0xa020('0x7'))(_0xa020('0x8'));var config=require(_0xa020('0x9'));var jayson=require(_0xa020('0xa'));var client=jayson[_0xa020('0xb')][_0xa020('0xc')]({'port':0x232a});config['redis']=_[_0xa020('0xd')](config[_0xa020('0xe')],{'host':_0xa020('0xf'),'port':0x18eb});var socket=require(_0xa020('0x10'))(new Redis(config['redis']));require(_0xa020('0x11'))[_0xa020('0x12')](socket);function respondWithRpcPromise(_0x133c26,_0x10d945,_0x3bb4b6){return new BPromise(function(_0x1f42ed,_0x1cf52a){return client['request'](_0x133c26,_0x3bb4b6)['then'](function(_0x22bf19){logger[_0xa020('0x13')](_0xa020('0x14'),_0x10d945,_0xa020('0x15'));logger[_0xa020('0x16')](_0xa020('0x17'),_0x10d945,_0xa020('0x15'),JSON[_0xa020('0x18')](_0x22bf19));if(_0x22bf19[_0xa020('0x19')]){if(_0x22bf19[_0xa020('0x19')][_0xa020('0x1a')]===0x1f4){logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x22bf19[_0xa020('0x19')]['message']);return _0x1cf52a(_0x22bf19[_0xa020('0x19')][_0xa020('0x1b')]);}logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x22bf19[_0xa020('0x19')][_0xa020('0x1b')]);return _0x1f42ed(_0x22bf19[_0xa020('0x19')]['message']);}else{logger[_0xa020('0x13')](_0xa020('0x14'),_0x10d945,_0xa020('0x15'));_0x1f42ed(_0x22bf19[_0xa020('0x1c')][_0xa020('0x1b')]);}})['catch'](function(_0x2ae88d){logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x2ae88d);_0x1cf52a(_0x2ae88d);});});}exports[_0xa020('0x1d')]=function(_0x59c001){var _0x5a18c7=this;return new Promise(function(_0x4ce464,_0x2704b4){return db[_0xa020('0x1e')][_0xa020('0x1f')]({'raw':_0x59c001[_0xa020('0x20')]?_0x59c001['options'][_0xa020('0x21')]===undefined?!![]:![]:!![],'where':_0x59c001['options']?_0x59c001[_0xa020('0x20')][_0xa020('0x22')]||null:null,'attributes':_0x59c001[_0xa020('0x20')]?_0x59c001[_0xa020('0x20')][_0xa020('0x23')]||null:null,'limit':_0x59c001[_0xa020('0x20')]?_0x59c001[_0xa020('0x20')][_0xa020('0x24')]||null:null,'include':_0x59c001[_0xa020('0x20')]?_0x59c001['options'][_0xa020('0x25')]?_[_0xa020('0x26')](_0x59c001[_0xa020('0x20')]['include'],function(_0x30fa91){return{'model':db[_0x30fa91[_0xa020('0x27')]],'as':_0x30fa91['as'],'attributes':_0x30fa91[_0xa020('0x23')],'include':_0x30fa91['include']?_['map'](_0x30fa91[_0xa020('0x25')],function(_0x44f771){return{'model':db[_0x44f771[_0xa020('0x27')]],'as':_0x44f771['as'],'attributes':_0x44f771[_0xa020('0x23')],'include':_0x44f771['include']?_['map'](_0x44f771[_0xa020('0x25')],function(_0x241a8c){return{'model':db[_0x241a8c['model']],'as':_0x241a8c['as'],'attributes':_0x241a8c[_0xa020('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa020('0x28')](function(_0x2567e8){logger[_0xa020('0x13')]('GetChatQueue',_0x59c001);logger['debug'](_0xa020('0x1d'),_0x59c001,JSON['stringify'](_0x2567e8));_0x4ce464(_0x2567e8);})[_0xa020('0x29')](function(_0x39e8cb){logger[_0xa020('0x19')]('GetChatQueue',_0x39e8cb[_0xa020('0x1b')],_0x59c001);_0x2704b4(_0x5a18c7[_0xa020('0x19')](0x1f4,_0x39e8cb[_0xa020('0x1b')]));});});};exports[_0xa020('0x2a')]=function(_0x34cc23){var _0x2298d0=this;return new Promise(function(_0x552a1e,_0x490e82){return db[_0xa020('0x1e')][_0xa020('0x2b')]({'raw':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x21')]===undefined?!![]:![]:!![],'where':_0x34cc23[_0xa020('0x20')]?_0x34cc23['options']['where']||null:null,'attributes':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x23')]||null:null,'include':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x25')]?_[_0xa020('0x26')](_0x34cc23[_0xa020('0x20')]['include'],function(_0x16a433){return{'model':db[_0x16a433['model']],'as':_0x16a433['as'],'attributes':_0x16a433[_0xa020('0x23')],'include':_0x16a433[_0xa020('0x25')]?_[_0xa020('0x26')](_0x16a433[_0xa020('0x25')],function(_0xaca9f1){return{'model':db[_0xaca9f1[_0xa020('0x27')]],'as':_0xaca9f1['as'],'attributes':_0xaca9f1['attributes'],'include':_0xaca9f1[_0xa020('0x25')]?_['map'](_0xaca9f1['include'],function(_0x13beb2){return{'model':db[_0x13beb2['model']],'as':_0x13beb2['as'],'attributes':_0x13beb2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa020('0x28')](function(_0x209d5e){logger['info'](_0xa020('0x2a'),_0x34cc23);logger['debug'](_0xa020('0x2a'),_0x34cc23,JSON[_0xa020('0x18')](_0x209d5e));_0x552a1e(_0x209d5e);})[_0xa020('0x29')](function(_0x1e4294){logger['error'](_0xa020('0x2a'),_0x1e4294[_0xa020('0x1b')],_0x34cc23);_0x490e82(_0x2298d0[_0xa020('0x19')](0x1f4,_0x1e4294['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 000b121..5831e91 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 _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0x52042e,_0x5be829){var _0x98e4da=function(_0x472342){while(--_0x472342){_0x52042e['push'](_0x52042e['shift']());}};_0x98e4da(++_0x5be829);}(_0x57d4,0x78));var _0x457d=function(_0x2532d4,_0x4327e1){_0x2532d4=_0x2532d4-0x0;var _0x2e936b=_0x57d4[_0x2532d4];return _0x2e936b;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}}; \ No newline at end of file +var _0x2d17=['update','emit','register','chatQueue:','./chatQueue.events','save'];(function(_0x24fa8c,_0x5aca89){var _0xb77233=function(_0x577c3e){while(--_0x577c3e){_0x24fa8c['push'](_0x24fa8c['shift']());}};_0xb77233(++_0x5aca89);}(_0x2d17,0x17e));var _0x72d1=function(_0x287093,_0x53b8ca){_0x287093=_0x287093-0x0;var _0x25e754=_0x2d17[_0x287093];return _0x25e754;};'use strict';var ChatQueueEvents=require(_0x72d1('0x0'));var events=[_0x72d1('0x1'),'remove',_0x72d1('0x2')];function createListener(_0x4727f9,_0x531f4e){return function(_0x3687bc){_0x531f4e[_0x72d1('0x3')](_0x4727f9,_0x3687bc);};}function removeListener(_0x55b722,_0x1dd6d8){return function(){ChatQueueEvents['removeListener'](_0x55b722,_0x1dd6d8);};}exports[_0x72d1('0x4')]=function(_0x50f551){for(var _0x139ba0=0x0,_0x239d1f=events['length'];_0x139ba0<_0x239d1f;_0x139ba0++){var _0x477264=events[_0x139ba0];var _0x422f5a=createListener(_0x72d1('0x5')+_0x477264,_0x50f551);ChatQueueEvents['on'](_0x477264,_0x422f5a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 87d877e..f495e46 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x55ca,0x126));var _0xa55c=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x55ca[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a0241,_0x5b214c){var _0x37c5b9=function(_0x35622b){while(--_0x35622b){_0x2a0241['push'](_0x2a0241['shift']());}};_0x37c5b9(++_0x5b214c);}(_0x008c,0x188));var _0xc008=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x008c[_0x233716];return _0x302298;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 383ea2c..bee2457 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 _0xfd7b=['exports','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd7b,0x1b3));var _0xbfd7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xfd7b[_0x4b7b62];return _0x2280df;};'use strict';var moment=require('moment');var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbfd7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbfd7('0x3')]},'acceptAt':{'type':Sequelize[_0xbfd7('0x3')]},'exitAt':{'type':Sequelize[_0xbfd7('0x3')]},'reason':{'type':Sequelize[_0xbfd7('0x2')]}}; \ No newline at end of file +var _0x7e17=['DATE','sequelize','exports','STRING'];(function(_0x2248c4,_0x2f73be){var _0x573531=function(_0x2de380){while(--_0x2de380){_0x2248c4['push'](_0x2248c4['shift']());}};_0x573531(++_0x2f73be);}(_0x7e17,0x89));var _0x77e1=function(_0x58f65e,_0x467d61){_0x58f65e=_0x58f65e-0x0;var _0x35684b=_0x7e17[_0x58f65e];return _0x35684b;};'use strict';var moment=require('moment');var Sequelize=require(_0x77e1('0x0'));module[_0x77e1('0x1')]={'uniqueid':{'type':Sequelize[_0x77e1('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x77e1('0x3')]},'leaveAt':{'type':Sequelize[_0x77e1('0x3')]},'acceptAt':{'type':Sequelize[_0x77e1('0x3')]},'exitAt':{'type':Sequelize[_0x77e1('0x3')]},'reason':{'type':Sequelize[_0x77e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 866db0e..939aa6c 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 _0x7a2f=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','create','body','find'];(function(_0x59ea1c,_0x4be6c3){var _0x2736d3=function(_0x2a173c){while(--_0x2a173c){_0x59ea1c['push'](_0x59ea1c['shift']());}};_0x2736d3(++_0x4be6c3);}(_0x7a2f,0x99));var _0xf7a2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a2f[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xf7a2('0x0'));var rimraf=require(_0xf7a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a2('0x2'));var rp=require(_0xf7a2('0x3'));var moment=require(_0xf7a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7a2('0x5'));var util=require(_0xf7a2('0x6'));var path=require(_0xf7a2('0x7'));var sox=require(_0xf7a2('0x8'));var csv=require(_0xf7a2('0x9'));var ejs=require(_0xf7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf7a2('0x9'));var querystring=require(_0xf7a2('0xf'));var Papa=require(_0xf7a2('0x10'));var Redis=require(_0xf7a2('0x11'));var authService=require(_0xf7a2('0x12'));var qs=require(_0xf7a2('0x13'));var as=require(_0xf7a2('0x14'));var hardwareService=require(_0xf7a2('0x15'));var logger=require('../../config/logger')(_0xf7a2('0x16'));var utils=require(_0xf7a2('0x17'));var config=require(_0xf7a2('0x18'));var licenseUtil=require(_0xf7a2('0x19'));var db=require(_0xf7a2('0x1a'))['db'];function respondWithStatusCode(_0x4f960f,_0x4bf293){_0x4bf293=_0x4bf293||0xcc;return function(_0x4d01db){if(_0x4d01db){return _0x4f960f[_0xf7a2('0x1b')](_0x4bf293);}return _0x4f960f[_0xf7a2('0x1c')](_0x4bf293)[_0xf7a2('0x1d')]();};}function respondWithResult(_0x35a006,_0x3b46f1){_0x3b46f1=_0x3b46f1||0xc8;return function(_0x1de4ef){if(_0x1de4ef){return _0x35a006[_0xf7a2('0x1c')](_0x3b46f1)['json'](_0x1de4ef);}};}function respondWithFilteredResult(_0x4eedb3,_0x53c32e){return function(_0x16b0dc){if(_0x16b0dc){var _0x5ef0aa=typeof _0x53c32e['offset']===_0xf7a2('0x1e')&&typeof _0x53c32e[_0xf7a2('0x1f')]===_0xf7a2('0x1e');var _0x3147b2=_0x16b0dc[_0xf7a2('0x20')];var _0x5f2147=_0x5ef0aa?0x0:_0x53c32e['offset'];var _0x5de0f1=_0x5ef0aa?_0x16b0dc[_0xf7a2('0x20')]:_0x53c32e[_0xf7a2('0x21')]+_0x53c32e[_0xf7a2('0x1f')];var _0x2a3fef;if(_0x5de0f1>=_0x3147b2){_0x5de0f1=_0x3147b2;_0x2a3fef=0xc8;}else{_0x2a3fef=0xce;}_0x4eedb3[_0xf7a2('0x1c')](_0x2a3fef);return _0x4eedb3['set'](_0xf7a2('0x22'),_0x5f2147+'-'+_0x5de0f1+'/'+_0x3147b2)['json'](_0x16b0dc);}return null;};}function patchUpdates(_0x1f2b26){return function(_0x3a0334){try{jsonpatch[_0xf7a2('0x23')](_0x3a0334,_0x1f2b26,!![]);}catch(_0x1ade67){return BPromise[_0xf7a2('0x24')](_0x1ade67);}return _0x3a0334[_0xf7a2('0x25')]();};}function saveUpdates(_0x39c941,_0x5265e0){return function(_0x4b1a06){if(_0x4b1a06){return _0x4b1a06[_0xf7a2('0x26')](_0x39c941)[_0xf7a2('0x27')](function(_0x59217f){return _0x59217f;});}return null;};}function removeEntity(_0x31349c,_0x2bbffd){return function(_0x3592ba){if(_0x3592ba){return _0x3592ba[_0xf7a2('0x28')]()[_0xf7a2('0x27')](function(){_0x31349c['status'](0xcc)[_0xf7a2('0x1d')]();});}};}function handleEntityNotFound(_0x484874,_0x30ec1e){return function(_0x143895){if(!_0x143895){_0x484874[_0xf7a2('0x1b')](0x194);}return _0x143895;};}function handleError(_0x48a4d8,_0x34af9b){_0x34af9b=_0x34af9b||0x1f4;return function(_0x5c53fb){logger[_0xf7a2('0x29')](_0x5c53fb['stack']);if(_0x5c53fb[_0xf7a2('0x2a')]){delete _0x5c53fb[_0xf7a2('0x2a')];}_0x48a4d8[_0xf7a2('0x1c')](_0x34af9b)[_0xf7a2('0x2b')](_0x5c53fb);};}exports[_0xf7a2('0x2c')]=function(_0x234359,_0xe7d318){var _0x5d64d1={},_0x1c764b={},_0x154ee5={'count':0x0,'rows':[]};var _0x481007=_['map'](db['ChatQueueReport'][_0xf7a2('0x2d')],function(_0x25551f){return{'name':_0x25551f[_0xf7a2('0x2e')],'type':_0x25551f[_0xf7a2('0x2f')][_0xf7a2('0x30')]};});_0x1c764b['model']=_[_0xf7a2('0x31')](_0x481007,_0xf7a2('0x2a'));_0x1c764b['query']=_['keys'](_0x234359[_0xf7a2('0x32')]);_0x1c764b[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x1c764b['model'],_0x1c764b[_0xf7a2('0x32')]);_0x5d64d1[_0xf7a2('0x35')]=_[_0xf7a2('0x34')](_0x1c764b[_0xf7a2('0x36')],qs[_0xf7a2('0x37')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x5d64d1[_0xf7a2('0x35')]=_0x5d64d1[_0xf7a2('0x35')][_0xf7a2('0x38')]?_0x5d64d1[_0xf7a2('0x35')]:_0x1c764b[_0xf7a2('0x36')];if(!_0x234359[_0xf7a2('0x32')][_0xf7a2('0x39')](_0xf7a2('0x3a'))){_0x5d64d1[_0xf7a2('0x1f')]=qs[_0xf7a2('0x1f')](_0x234359['query']['limit']);_0x5d64d1[_0xf7a2('0x21')]=qs[_0xf7a2('0x21')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x21')]);}_0x5d64d1['order']=qs[_0xf7a2('0x3b')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x3b')]);_0x5d64d1['where']=qs[_0xf7a2('0x33')](_[_0xf7a2('0x3c')](_0x234359['query'],_0x1c764b['filters']),_0x481007);if(_0x234359[_0xf7a2('0x32')]['filter']){_0x5d64d1[_0xf7a2('0x3d')]=_[_0xf7a2('0x3e')](_0x5d64d1['where'],{'$or':_['map'](_0x481007,function(_0x1a220d){if(_0x1a220d['type']!==_0xf7a2('0x3f')){var _0x211f29={};_0x211f29[_0x1a220d[_0xf7a2('0x2a')]]={'$like':'%'+_0x234359['query']['filter']+'%'};return _0x211f29;}})});}_0x5d64d1=_[_0xf7a2('0x3e')]({},_0x5d64d1,_0x234359[_0xf7a2('0x40')]);var _0x46b06c={'where':_0x5d64d1['where']};return db[_0xf7a2('0x41')]['count'](_0x46b06c)['then'](function(_0x4a42d3){_0x154ee5[_0xf7a2('0x20')]=_0x4a42d3;if(_0x234359['query'][_0xf7a2('0x42')]){_0x5d64d1[_0xf7a2('0x43')]=[{'all':!![]}];}return db[_0xf7a2('0x41')][_0xf7a2('0x44')](_0x5d64d1);})[_0xf7a2('0x27')](function(_0xca3996){_0x154ee5[_0xf7a2('0x45')]=_0xca3996;return _0x154ee5;})[_0xf7a2('0x27')](respondWithFilteredResult(_0xe7d318,_0x5d64d1))[_0xf7a2('0x46')](handleError(_0xe7d318,null));};exports['show']=function(_0x499a01,_0x46f0f9){var _0x12c562={'raw':!![],'where':{'id':_0x499a01[_0xf7a2('0x47')]['id']}},_0x12f13e={};_0x12f13e['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x12f13e['query']=_['keys'](_0x499a01[_0xf7a2('0x32')]);_0x12f13e[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x12f13e[_0xf7a2('0x36')],_0x12f13e[_0xf7a2('0x32')]);_0x12c562['attributes']=_[_0xf7a2('0x34')](_0x12f13e['model'],qs[_0xf7a2('0x37')](_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x12c562[_0xf7a2('0x35')]=_0x12c562['attributes'][_0xf7a2('0x38')]?_0x12c562[_0xf7a2('0x35')]:_0x12f13e[_0xf7a2('0x36')];if(_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x42')]){_0x12c562[_0xf7a2('0x43')]=[{'all':!![]}];}_0x12c562=_[_0xf7a2('0x3e')]({},_0x12c562,_0x499a01[_0xf7a2('0x40')]);return db[_0xf7a2('0x41')]['find'](_0x12c562)['then'](handleEntityNotFound(_0x46f0f9,null))['then'](respondWithResult(_0x46f0f9,null))[_0xf7a2('0x46')](handleError(_0x46f0f9,null));};exports[_0xf7a2('0x48')]=function(_0x1b8ce0,_0x2e4dac){return db[_0xf7a2('0x41')]['create'](_0x1b8ce0[_0xf7a2('0x49')],{})['then'](respondWithResult(_0x2e4dac,0xc9))[_0xf7a2('0x46')](handleError(_0x2e4dac,null));};exports[_0xf7a2('0x26')]=function(_0x401948,_0x4d40ba){if(_0x401948['body']['id']){delete _0x401948[_0xf7a2('0x49')]['id'];}return db[_0xf7a2('0x41')][_0xf7a2('0x4a')]({'where':{'id':_0x401948[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x4d40ba,null))[_0xf7a2('0x27')](saveUpdates(_0x401948[_0xf7a2('0x49')],null))[_0xf7a2('0x27')](respondWithResult(_0x4d40ba,null))[_0xf7a2('0x46')](handleError(_0x4d40ba,null));};exports[_0xf7a2('0x28')]=function(_0x588d30,_0x3e8cbe){return db['ChatQueueReport'][_0xf7a2('0x4a')]({'where':{'id':_0x588d30[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x3e8cbe,null))[_0xf7a2('0x27')](removeEntity(_0x3e8cbe,null))[_0xf7a2('0x46')](handleError(_0x3e8cbe,null));};exports[_0xf7a2('0x4b')]=function(_0x4ae537,_0x5a544e){return db[_0xf7a2('0x41')][_0xf7a2('0x4b')]()[_0xf7a2('0x27')](respondWithResult(_0x5a544e,null))[_0xf7a2('0x46')](handleError(_0x5a544e,null));}; \ No newline at end of file +var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','ChatQueueReport','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(_0x2ff8af,_0xd48e8){var _0x1d7758=function(_0x262c89){while(--_0x262c89){_0x2ff8af['push'](_0x2ff8af['shift']());}};_0x1d7758(++_0xd48e8);}(_0x2542,0x169));var _0x2254=function(_0x316ab4,_0x45a1f5){_0x316ab4=_0x316ab4-0x0;var _0x12e5df=_0x2542[_0x316ab4];return _0x12e5df;};'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['ChatQueueReport'][_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 diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index cb22493..df5e3b4 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(_0xc3212e,_0x30e7ec){var _0x2fc81e=function(_0x380980){while(--_0x380980){_0xc3212e['push'](_0xc3212e['shift']());}};_0x2fc81e(++_0x30e7ec);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xb9883d,_0x26c019){var _0x3247d2=function(_0x4438cd){while(--_0x4438cd){_0xb9883d['push'](_0xb9883d['shift']());}};_0x3247d2(++_0x26c019);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index a2a9a02..6ae902f 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 _0xf63e=['moment','bluebird','../../mysqldb','../../config/utils','rpc','client','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','body','options','raw','UpdateChatQueueReport','update','limit','then','lodash','util'];(function(_0x29df2a,_0x421ad2){var _0x16d077=function(_0x5378c1){while(--_0x5378c1){_0x29df2a['push'](_0x29df2a['shift']());}};_0x16d077(++_0x421ad2);}(_0xf63e,0x103));var _0xef63=function(_0x441c2f,_0x563d27){_0x441c2f=_0x441c2f-0x0;var _0xd016c2=_0xf63e[_0x441c2f];return _0xd016c2;};'use strict';var _=require(_0xef63('0x0'));var util=require(_0xef63('0x1'));var moment=require(_0xef63('0x2'));var BPromise=require(_0xef63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef63('0x4'))['db'];var utils=require(_0xef63('0x5'));var logger=require('../../config/logger')(_0xef63('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef63('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7c873,_0x4998a1,_0x24e7ac){return new BPromise(function(_0xd19c1e,_0x59d5c4){return client['request'](_0xa7c873,_0x24e7ac)['then'](function(_0x5247e9){logger[_0xef63('0x8')](_0xef63('0x9'),_0x4998a1,_0xef63('0xa'));logger[_0xef63('0xb')](_0xef63('0xc'),_0x4998a1,_0xef63('0xa'),JSON[_0xef63('0xd')](_0x5247e9));if(_0x5247e9['error']){if(_0x5247e9[_0xef63('0xe')][_0xef63('0xf')]===0x1f4){logger[_0xef63('0xe')](_0xef63('0x9'),_0x4998a1,_0x5247e9['error'][_0xef63('0x10')]);return _0x59d5c4(_0x5247e9[_0xef63('0xe')]['message']);}logger['error'](_0xef63('0x9'),_0x4998a1,_0x5247e9[_0xef63('0xe')][_0xef63('0x10')]);return _0xd19c1e(_0x5247e9[_0xef63('0xe')][_0xef63('0x10')]);}else{logger[_0xef63('0x8')](_0xef63('0x9'),_0x4998a1,'request\x20sent');_0xd19c1e(_0x5247e9[_0xef63('0x11')]['message']);}})[_0xef63('0x12')](function(_0x163e87){logger[_0xef63('0xe')](_0xef63('0x9'),_0x4998a1,_0x163e87);_0x59d5c4(_0x163e87);});});}exports[_0xef63('0x13')]=function(_0x430bfc){var _0x2b294e=this;return new Promise(function(_0xb37e4e,_0x24f4cb){return db[_0xef63('0x14')][_0xef63('0x15')](_0x430bfc[_0xef63('0x16')],{'raw':_0x430bfc['options']?_0x430bfc[_0xef63('0x17')][_0xef63('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1c9c4c){logger[_0xef63('0x8')]('CreateChatQueueReport',_0x430bfc);logger[_0xef63('0xb')](_0xef63('0x13'),_0x430bfc,JSON['stringify'](_0x1c9c4c));_0xb37e4e(_0x1c9c4c);})[_0xef63('0x12')](function(_0x701b5c){logger[_0xef63('0xe')]('CreateChatQueueReport',_0x701b5c['message'],_0x430bfc);_0x24f4cb(_0x2b294e[_0xef63('0xe')](0x1f4,_0x701b5c[_0xef63('0x10')]));});});};exports[_0xef63('0x19')]=function(_0x10a573){var _0xa63ced=this;return new Promise(function(_0x270256,_0x5497e5){return db['ChatQueueReport'][_0xef63('0x1a')](_0x10a573[_0xef63('0x16')],{'raw':_0x10a573['options']?_0x10a573[_0xef63('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a573[_0xef63('0x17')]?_0x10a573['options']['where']||null:null,'attributes':_0x10a573[_0xef63('0x17')]?_0x10a573[_0xef63('0x17')]['attributes']||null:null,'limit':_0x10a573['options']?_0x10a573[_0xef63('0x17')][_0xef63('0x1b')]||null:null})[_0xef63('0x1c')](function(_0x1ce3f8){logger[_0xef63('0x8')](_0xef63('0x19'),_0x10a573);logger[_0xef63('0xb')](_0xef63('0x19'),_0x10a573,JSON[_0xef63('0xd')](_0x1ce3f8));_0x270256(_0x1ce3f8);})[_0xef63('0x12')](function(_0x4f913b){logger[_0xef63('0xe')](_0xef63('0x19'),_0x4f913b[_0xef63('0x10')],_0x10a573);_0x5497e5(_0xa63ced[_0xef63('0xe')](0x1f4,_0x4f913b[_0xef63('0x10')]));});});}; \ No newline at end of file +var _0xf324=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xf324,0x139));var _0x4f32=function(_0x4b68ab,_0x1c0763){_0x4b68ab=_0x4b68ab-0x0;var _0x1c789b=_0xf324[_0x4b68ab];return _0x1c789b;};'use strict';var _=require(_0x4f32('0x0'));var util=require('util');var moment=require(_0x4f32('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f32('0x2'));var fs=require('fs');var Redis=require(_0x4f32('0x3'));var db=require(_0x4f32('0x4'))['db'];var utils=require(_0x4f32('0x5'));var logger=require(_0x4f32('0x6'))(_0x4f32('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f32('0x8'));var client=jayson[_0x4f32('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301c27,_0x1cfa2e,_0x2d6ef3){return new BPromise(function(_0x431d7a,_0x1695d3){return client[_0x4f32('0xa')](_0x301c27,_0x2d6ef3)[_0x4f32('0xb')](function(_0x523ef5){logger[_0x4f32('0xc')](_0x4f32('0xd'),_0x1cfa2e,_0x4f32('0xe'));logger[_0x4f32('0xf')](_0x4f32('0x10'),_0x1cfa2e,_0x4f32('0xe'),JSON['stringify'](_0x523ef5));if(_0x523ef5['error']){if(_0x523ef5[_0x4f32('0x11')][_0x4f32('0x12')]===0x1f4){logger[_0x4f32('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x1cfa2e,_0x523ef5['error']['message']);return _0x1695d3(_0x523ef5[_0x4f32('0x11')][_0x4f32('0x13')]);}logger[_0x4f32('0x11')](_0x4f32('0xd'),_0x1cfa2e,_0x523ef5['error'][_0x4f32('0x13')]);return _0x431d7a(_0x523ef5[_0x4f32('0x11')][_0x4f32('0x13')]);}else{logger[_0x4f32('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1cfa2e,_0x4f32('0xe'));_0x431d7a(_0x523ef5[_0x4f32('0x14')][_0x4f32('0x13')]);}})[_0x4f32('0x15')](function(_0x5543d7){logger[_0x4f32('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x1cfa2e,_0x5543d7);_0x1695d3(_0x5543d7);});});}exports[_0x4f32('0x16')]=function(_0x14d065){var _0x20015c=this;return new Promise(function(_0x1a8ddb,_0x30cc53){return db[_0x4f32('0x17')][_0x4f32('0x18')](_0x14d065[_0x4f32('0x19')],{'raw':_0x14d065[_0x4f32('0x1a')]?_0x14d065[_0x4f32('0x1a')][_0x4f32('0x1b')]===undefined?!![]:![]:!![]})[_0x4f32('0xb')](function(_0xc604a4){logger[_0x4f32('0xc')](_0x4f32('0x16'),_0x14d065);logger['debug'](_0x4f32('0x16'),_0x14d065,JSON['stringify'](_0xc604a4));_0x1a8ddb(_0xc604a4);})[_0x4f32('0x15')](function(_0x4a0a51){logger[_0x4f32('0x11')](_0x4f32('0x16'),_0x4a0a51[_0x4f32('0x13')],_0x14d065);_0x30cc53(_0x20015c[_0x4f32('0x11')](0x1f4,_0x4a0a51[_0x4f32('0x13')]));});});};exports[_0x4f32('0x1c')]=function(_0x1d89b5){var _0x4101aa=this;return new Promise(function(_0x2c3774,_0x241e7f){return db[_0x4f32('0x17')][_0x4f32('0x1d')](_0x1d89b5[_0x4f32('0x19')],{'raw':_0x1d89b5[_0x4f32('0x1a')]?_0x1d89b5[_0x4f32('0x1a')][_0x4f32('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d89b5[_0x4f32('0x1a')]?_0x1d89b5[_0x4f32('0x1a')]['where']||null:null,'attributes':_0x1d89b5[_0x4f32('0x1a')]?_0x1d89b5[_0x4f32('0x1a')][_0x4f32('0x1e')]||null:null,'limit':_0x1d89b5[_0x4f32('0x1a')]?_0x1d89b5[_0x4f32('0x1a')][_0x4f32('0x1f')]||null:null})[_0x4f32('0xb')](function(_0x25085f){logger[_0x4f32('0xc')](_0x4f32('0x1c'),_0x1d89b5);logger['debug']('UpdateChatQueueReport',_0x1d89b5,JSON[_0x4f32('0x20')](_0x25085f));_0x2c3774(_0x25085f);})[_0x4f32('0x15')](function(_0x557d9f){logger[_0x4f32('0x11')](_0x4f32('0x1c'),_0x557d9f[_0x4f32('0x13')],_0x1d89b5);_0x241e7f(_0x4101aa[_0x4f32('0x11')](0x1f4,_0x557d9f[_0x4f32('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 6c01491..ca8d063 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 _0x9906=['put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create'];(function(_0x55d143,_0x4836e2){var _0x29c2f7=function(_0xa65606){while(--_0xa65606){_0x55d143['push'](_0x55d143['shift']());}};_0x29c2f7(++_0x4836e2);}(_0x9906,0x11c));var _0x6990=function(_0x15fdf2,_0x172680){_0x15fdf2=_0x15fdf2-0x0;var _0x1eff96=_0x9906[_0x15fdf2];return _0x1eff96;};'use strict';var multer=require(_0x6990('0x0'));var util=require('util');var path=require(_0x6990('0x1'));var timeout=require('connect-timeout');var express=require(_0x6990('0x2'));var router=express[_0x6990('0x3')]();var fs_extra=require(_0x6990('0x4'));var auth=require(_0x6990('0x5'));var interaction=require(_0x6990('0x6'));var config=require(_0x6990('0x7'));var controller=require(_0x6990('0x8'));router[_0x6990('0x9')]('/',auth[_0x6990('0xa')](),controller[_0x6990('0xb')]);router[_0x6990('0x9')](_0x6990('0xc'),auth['isAuthenticated'](),controller[_0x6990('0xd')]);router[_0x6990('0x9')](_0x6990('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6990('0xa')](),controller[_0x6990('0xf')]);router[_0x6990('0x10')]('/:id',auth[_0x6990('0xa')](),controller[_0x6990('0x11')]);router[_0x6990('0x12')](_0x6990('0xe'),auth['isAuthenticated'](),controller[_0x6990('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9390=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0x9390,0x85));var _0x0939=function(_0x108920,_0x4ea282){_0x108920=_0x108920-0x0;var _0x3a10f2=_0x9390[_0x108920];return _0x3a10f2;};'use strict';var multer=require(_0x0939('0x0'));var util=require('util');var path=require(_0x0939('0x1'));var timeout=require(_0x0939('0x2'));var express=require(_0x0939('0x3'));var router=express[_0x0939('0x4')]();var fs_extra=require(_0x0939('0x5'));var auth=require(_0x0939('0x6'));var interaction=require(_0x0939('0x7'));var config=require(_0x0939('0x8'));var controller=require(_0x0939('0x9'));router[_0x0939('0xa')]('/',auth[_0x0939('0xb')](),controller[_0x0939('0xc')]);router[_0x0939('0xa')](_0x0939('0xd'),auth[_0x0939('0xb')](),controller[_0x0939('0xe')]);router[_0x0939('0xa')]('/:id',auth[_0x0939('0xb')](),controller[_0x0939('0xf')]);router['post']('/',auth[_0x0939('0xb')](),controller[_0x0939('0x10')]);router[_0x0939('0x11')](_0x0939('0x12'),auth[_0x0939('0xb')](),controller[_0x0939('0x13')]);router[_0x0939('0x14')](_0x0939('0x12'),auth[_0x0939('0xb')](),controller[_0x0939('0x15')]);module[_0x0939('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e669b1e..06179c6 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x16fdcb,_0x46f499){var _0x42cd8c=function(_0xff5574){while(--_0xff5574){_0x16fdcb['push'](_0x16fdcb['shift']());}};_0x42cd8c(++_0x46f499);}(_0x00bb,0x1d8));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x159508,_0xe9011f){var _0x39c048=function(_0x37f1a7){while(--_0x37f1a7){_0x159508['push'](_0x159508['shift']());}};_0x39c048(++_0xe9011f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1bb067,_0x540701){_0x1bb067=_0x1bb067-0x0;var _0x511a52=_0xf4eb[_0x1bb067];return _0x511a52;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 46d643c..eae4e78 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 _0x40ce=['includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','ChatTransferReport','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40ce,0x1a3));var _0xe40c=function(_0x1d011f,_0x40f24e){_0x1d011f=_0x1d011f-0x0;var _0x27068c=_0x40ce[_0x1d011f];return _0x27068c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe40c('0x0'));var zipdir=require(_0xe40c('0x1'));var jsonpatch=require(_0xe40c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe40c('0x3'));var util=require(_0xe40c('0x4'));var path=require('path');var sox=require(_0xe40c('0x5'));var csv=require(_0xe40c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe40c('0x7'));var _=require('lodash');var squel=require(_0xe40c('0x8'));var crypto=require(_0xe40c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe40c('0xa'));var Papa=require(_0xe40c('0xb'));var Redis=require(_0xe40c('0xc'));var authService=require(_0xe40c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe40c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe40c('0xf'))('api');var utils=require(_0xe40c('0x10'));var config=require(_0xe40c('0x11'));var licenseUtil=require(_0xe40c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bdb6c,_0x1bfa50){_0x1bfa50=_0x1bfa50||0xcc;return function(_0x2f3c2e){if(_0x2f3c2e){return _0x4bdb6c[_0xe40c('0x13')](_0x1bfa50);}return _0x4bdb6c[_0xe40c('0x14')](_0x1bfa50)['end']();};}function respondWithResult(_0x306328,_0x14f86a){_0x14f86a=_0x14f86a||0xc8;return function(_0x103e1e){if(_0x103e1e){return _0x306328[_0xe40c('0x14')](_0x14f86a)[_0xe40c('0x15')](_0x103e1e);}};}function respondWithFilteredResult(_0x4f8cb2,_0x10f36){return function(_0x24954e){if(_0x24954e){var _0x92f9b5=typeof _0x10f36['offset']===_0xe40c('0x16')&&typeof _0x10f36[_0xe40c('0x17')]===_0xe40c('0x16');var _0x29d706=_0x24954e['count'];var _0xe6d121=_0x92f9b5?0x0:_0x10f36['offset'];var _0x2728fc=_0x92f9b5?_0x24954e[_0xe40c('0x18')]:_0x10f36[_0xe40c('0x19')]+_0x10f36[_0xe40c('0x17')];var _0x373a2f;if(_0x2728fc>=_0x29d706){_0x2728fc=_0x29d706;_0x373a2f=0xc8;}else{_0x373a2f=0xce;}_0x4f8cb2[_0xe40c('0x14')](_0x373a2f);return _0x4f8cb2[_0xe40c('0x1a')](_0xe40c('0x1b'),_0xe6d121+'-'+_0x2728fc+'/'+_0x29d706)[_0xe40c('0x15')](_0x24954e);}return null;};}function patchUpdates(_0x5578af){return function(_0x116ec7){try{jsonpatch[_0xe40c('0x1c')](_0x116ec7,_0x5578af,!![]);}catch(_0x26faf8){return BPromise['reject'](_0x26faf8);}return _0x116ec7[_0xe40c('0x1d')]();};}function saveUpdates(_0x23ee03,_0x9f08cf){return function(_0x217cf5){if(_0x217cf5){return _0x217cf5[_0xe40c('0x1e')](_0x23ee03)[_0xe40c('0x1f')](function(_0x87685a){return _0x87685a;});}return null;};}function removeEntity(_0x1219c2,_0x13afb3){return function(_0x3231d1){if(_0x3231d1){return _0x3231d1[_0xe40c('0x20')]()['then'](function(){_0x1219c2[_0xe40c('0x14')](0xcc)[_0xe40c('0x21')]();});}};}function handleEntityNotFound(_0x32b87e,_0x623dfd){return function(_0x27a44f){if(!_0x27a44f){_0x32b87e[_0xe40c('0x13')](0x194);}return _0x27a44f;};}function handleError(_0x1b1e89,_0x2c3d2c){_0x2c3d2c=_0x2c3d2c||0x1f4;return function(_0x3cdd4a){logger[_0xe40c('0x22')](_0x3cdd4a[_0xe40c('0x23')]);if(_0x3cdd4a['name']){delete _0x3cdd4a[_0xe40c('0x24')];}_0x1b1e89[_0xe40c('0x14')](_0x2c3d2c)['send'](_0x3cdd4a);};}exports[_0xe40c('0x25')]=function(_0x4f97b3,_0x1af1b4){var _0x1d2a0a={},_0x1559e0={},_0x4c68f4={'count':0x0,'rows':[]};var _0x25e2b8=_[_0xe40c('0x26')](db[_0xe40c('0x27')]['rawAttributes'],function(_0x383677){return{'name':_0x383677[_0xe40c('0x28')],'type':_0x383677['type']['key']};});_0x1559e0[_0xe40c('0x29')]=_[_0xe40c('0x26')](_0x25e2b8,_0xe40c('0x24'));_0x1559e0[_0xe40c('0x2a')]=_['keys'](_0x4f97b3[_0xe40c('0x2a')]);_0x1559e0['filters']=_[_0xe40c('0x2b')](_0x1559e0[_0xe40c('0x29')],_0x1559e0[_0xe40c('0x2a')]);_0x1d2a0a[_0xe40c('0x2c')]=_[_0xe40c('0x2b')](_0x1559e0[_0xe40c('0x29')],qs[_0xe40c('0x2d')](_0x4f97b3['query']['fields']));_0x1d2a0a[_0xe40c('0x2c')]=_0x1d2a0a['attributes'][_0xe40c('0x2e')]?_0x1d2a0a[_0xe40c('0x2c')]:_0x1559e0['model'];if(!_0x4f97b3['query'][_0xe40c('0x2f')](_0xe40c('0x30'))){_0x1d2a0a[_0xe40c('0x17')]=qs[_0xe40c('0x17')](_0x4f97b3[_0xe40c('0x2a')][_0xe40c('0x17')]);_0x1d2a0a['offset']=qs['offset'](_0x4f97b3['query'][_0xe40c('0x19')]);}_0x1d2a0a['order']=qs[_0xe40c('0x31')](_0x4f97b3['query'][_0xe40c('0x31')]);_0x1d2a0a[_0xe40c('0x32')]=qs[_0xe40c('0x33')](_[_0xe40c('0x34')](_0x4f97b3['query'],_0x1559e0[_0xe40c('0x33')]),_0x25e2b8);if(_0x4f97b3[_0xe40c('0x2a')][_0xe40c('0x35')]){_0x1d2a0a[_0xe40c('0x32')]=_[_0xe40c('0x36')](_0x1d2a0a[_0xe40c('0x32')],{'$or':_[_0xe40c('0x26')](_0x25e2b8,function(_0x2f8271){if(_0x2f8271['type']!==_0xe40c('0x37')){var _0x4efcd2={};_0x4efcd2[_0x2f8271[_0xe40c('0x24')]]={'$like':'%'+_0x4f97b3['query'][_0xe40c('0x35')]+'%'};return _0x4efcd2;}})});}_0x1d2a0a=_[_0xe40c('0x36')]({},_0x1d2a0a,_0x4f97b3[_0xe40c('0x38')]);var _0x4b0f4f={'where':_0x1d2a0a[_0xe40c('0x32')]};return db[_0xe40c('0x27')][_0xe40c('0x18')](_0x4b0f4f)[_0xe40c('0x1f')](function(_0x3f396f){_0x4c68f4[_0xe40c('0x18')]=_0x3f396f;if(_0x4f97b3[_0xe40c('0x2a')]['includeAll']){_0x1d2a0a[_0xe40c('0x39')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe40c('0x3a')](_0x1d2a0a);})[_0xe40c('0x1f')](function(_0x3e69cc){_0x4c68f4[_0xe40c('0x3b')]=_0x3e69cc;return _0x4c68f4;})[_0xe40c('0x1f')](respondWithFilteredResult(_0x1af1b4,_0x1d2a0a))[_0xe40c('0x3c')](handleError(_0x1af1b4,null));};exports[_0xe40c('0x3d')]=function(_0x1e3c2f,_0x4b85b4){var _0x5e6d03={'raw':!![],'where':{'id':_0x1e3c2f[_0xe40c('0x3e')]['id']}},_0x468566={};_0x468566['model']=_[_0xe40c('0x3f')](db[_0xe40c('0x27')]['rawAttributes']);_0x468566['query']=_[_0xe40c('0x3f')](_0x1e3c2f[_0xe40c('0x2a')]);_0x468566['filters']=_[_0xe40c('0x2b')](_0x468566['model'],_0x468566[_0xe40c('0x2a')]);_0x5e6d03['attributes']=_[_0xe40c('0x2b')](_0x468566[_0xe40c('0x29')],qs[_0xe40c('0x2d')](_0x1e3c2f[_0xe40c('0x2a')][_0xe40c('0x2d')]));_0x5e6d03['attributes']=_0x5e6d03['attributes']['length']?_0x5e6d03[_0xe40c('0x2c')]:_0x468566[_0xe40c('0x29')];if(_0x1e3c2f[_0xe40c('0x2a')][_0xe40c('0x40')]){_0x5e6d03[_0xe40c('0x39')]=[{'all':!![]}];}_0x5e6d03=_['merge']({},_0x5e6d03,_0x1e3c2f['options']);return db[_0xe40c('0x27')][_0xe40c('0x41')](_0x5e6d03)[_0xe40c('0x1f')](handleEntityNotFound(_0x4b85b4,null))[_0xe40c('0x1f')](respondWithResult(_0x4b85b4,null))[_0xe40c('0x3c')](handleError(_0x4b85b4,null));};exports[_0xe40c('0x42')]=function(_0x505159,_0x51aebd){return db['ChatTransferReport'][_0xe40c('0x42')](_0x505159[_0xe40c('0x43')],{})[_0xe40c('0x1f')](respondWithResult(_0x51aebd,0xc9))['catch'](handleError(_0x51aebd,null));};exports[_0xe40c('0x1e')]=function(_0x120ada,_0x4be3d4){if(_0x120ada[_0xe40c('0x43')]['id']){delete _0x120ada[_0xe40c('0x43')]['id'];}return db[_0xe40c('0x27')]['find']({'where':{'id':_0x120ada['params']['id']}})[_0xe40c('0x1f')](handleEntityNotFound(_0x4be3d4,null))['then'](saveUpdates(_0x120ada[_0xe40c('0x43')],null))[_0xe40c('0x1f')](respondWithResult(_0x4be3d4,null))[_0xe40c('0x3c')](handleError(_0x4be3d4,null));};exports[_0xe40c('0x20')]=function(_0x287f28,_0x61eff9){return db[_0xe40c('0x27')][_0xe40c('0x41')]({'where':{'id':_0x287f28[_0xe40c('0x3e')]['id']}})[_0xe40c('0x1f')](handleEntityNotFound(_0x61eff9,null))[_0xe40c('0x1f')](removeEntity(_0x61eff9,null))[_0xe40c('0x3c')](handleError(_0x61eff9,null));};exports[_0xe40c('0x44')]=function(_0x3dc67c,_0x3be907){return db[_0xe40c('0x27')]['describe']()[_0xe40c('0x1f')](respondWithResult(_0x3be907,null))[_0xe40c('0x3c')](handleError(_0x3be907,null));}; \ No newline at end of file +var _0x913e=['pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort'];(function(_0x553d24,_0x54d18a){var _0x24b179=function(_0x50a2fe){while(--_0x50a2fe){_0x553d24['push'](_0x553d24['shift']());}};_0x24b179(++_0x54d18a);}(_0x913e,0x14d));var _0xe913=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x913e[_0x53bcc3];return _0x47c959;};'use strict';var emlformat=require(_0xe913('0x0'));var rimraf=require(_0xe913('0x1'));var zipdir=require(_0xe913('0x2'));var jsonpatch=require(_0xe913('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe913('0x4'));var Mustache=require(_0xe913('0x5'));var util=require(_0xe913('0x6'));var path=require(_0xe913('0x7'));var sox=require(_0xe913('0x8'));var csv=require('to-csv');var ejs=require(_0xe913('0x9'));var fs=require('fs');var fs_extra=require(_0xe913('0xa'));var _=require(_0xe913('0xb'));var squel=require(_0xe913('0xc'));var crypto=require('crypto');var jsforce=require(_0xe913('0xd'));var deskjs=require(_0xe913('0xe'));var toCsv=require(_0xe913('0xf'));var querystring=require(_0xe913('0x10'));var Papa=require(_0xe913('0x11'));var Redis=require('ioredis');var authService=require(_0xe913('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe913('0x13'));var hardwareService=require(_0xe913('0x14'));var logger=require(_0xe913('0x15'))(_0xe913('0x16'));var utils=require(_0xe913('0x17'));var config=require(_0xe913('0x18'));var licenseUtil=require(_0xe913('0x19'));var db=require(_0xe913('0x1a'))['db'];function respondWithStatusCode(_0x2b7377,_0x15f101){_0x15f101=_0x15f101||0xcc;return function(_0x1f4916){if(_0x1f4916){return _0x2b7377[_0xe913('0x1b')](_0x15f101);}return _0x2b7377['status'](_0x15f101)['end']();};}function respondWithResult(_0x1d5292,_0xdea937){_0xdea937=_0xdea937||0xc8;return function(_0x2e8de8){if(_0x2e8de8){return _0x1d5292[_0xe913('0x1c')](_0xdea937)[_0xe913('0x1d')](_0x2e8de8);}};}function respondWithFilteredResult(_0x537e42,_0x48c0af){return function(_0x138863){if(_0x138863){var _0x3f7140=typeof _0x48c0af['offset']===_0xe913('0x1e')&&typeof _0x48c0af[_0xe913('0x1f')]===_0xe913('0x1e');var _0x2a06d4=_0x138863[_0xe913('0x20')];var _0x34eff2=_0x3f7140?0x0:_0x48c0af['offset'];var _0x424cf6=_0x3f7140?_0x138863[_0xe913('0x20')]:_0x48c0af['offset']+_0x48c0af['limit'];var _0xf7b05f;if(_0x424cf6>=_0x2a06d4){_0x424cf6=_0x2a06d4;_0xf7b05f=0xc8;}else{_0xf7b05f=0xce;}_0x537e42['status'](_0xf7b05f);return _0x537e42['set'](_0xe913('0x21'),_0x34eff2+'-'+_0x424cf6+'/'+_0x2a06d4)['json'](_0x138863);}return null;};}function patchUpdates(_0x5943a5){return function(_0x150a30){try{jsonpatch[_0xe913('0x22')](_0x150a30,_0x5943a5,!![]);}catch(_0x770365){return BPromise[_0xe913('0x23')](_0x770365);}return _0x150a30[_0xe913('0x24')]();};}function saveUpdates(_0x21b4b6,_0x23b15b){return function(_0x9264b3){if(_0x9264b3){return _0x9264b3[_0xe913('0x25')](_0x21b4b6)['then'](function(_0x53ab03){return _0x53ab03;});}return null;};}function removeEntity(_0x3e2c93,_0x475229){return function(_0x25894f){if(_0x25894f){return _0x25894f['destroy']()[_0xe913('0x26')](function(){_0x3e2c93['status'](0xcc)[_0xe913('0x27')]();});}};}function handleEntityNotFound(_0x43d2d3,_0x32ecfb){return function(_0x12c62d){if(!_0x12c62d){_0x43d2d3[_0xe913('0x1b')](0x194);}return _0x12c62d;};}function handleError(_0x3ad0c5,_0x38b9b8){_0x38b9b8=_0x38b9b8||0x1f4;return function(_0xf03b02){logger[_0xe913('0x28')](_0xf03b02[_0xe913('0x29')]);if(_0xf03b02[_0xe913('0x2a')]){delete _0xf03b02['name'];}_0x3ad0c5[_0xe913('0x1c')](_0x38b9b8)[_0xe913('0x2b')](_0xf03b02);};}exports[_0xe913('0x2c')]=function(_0x2a6e6d,_0x3d91ac){var _0x17808e={},_0x22fbc3={},_0xb840b3={'count':0x0,'rows':[]};var _0x7a5bbb=_[_0xe913('0x2d')](db[_0xe913('0x2e')][_0xe913('0x2f')],function(_0x5cd698){return{'name':_0x5cd698[_0xe913('0x30')],'type':_0x5cd698[_0xe913('0x31')][_0xe913('0x32')]};});_0x22fbc3[_0xe913('0x33')]=_[_0xe913('0x2d')](_0x7a5bbb,_0xe913('0x2a'));_0x22fbc3[_0xe913('0x34')]=_['keys'](_0x2a6e6d['query']);_0x22fbc3[_0xe913('0x35')]=_[_0xe913('0x36')](_0x22fbc3[_0xe913('0x33')],_0x22fbc3[_0xe913('0x34')]);_0x17808e[_0xe913('0x37')]=_[_0xe913('0x36')](_0x22fbc3[_0xe913('0x33')],qs['fields'](_0x2a6e6d[_0xe913('0x34')][_0xe913('0x38')]));_0x17808e['attributes']=_0x17808e[_0xe913('0x37')][_0xe913('0x39')]?_0x17808e[_0xe913('0x37')]:_0x22fbc3[_0xe913('0x33')];if(!_0x2a6e6d[_0xe913('0x34')][_0xe913('0x3a')](_0xe913('0x3b'))){_0x17808e['limit']=qs['limit'](_0x2a6e6d[_0xe913('0x34')]['limit']);_0x17808e[_0xe913('0x3c')]=qs[_0xe913('0x3c')](_0x2a6e6d['query'][_0xe913('0x3c')]);}_0x17808e['order']=qs[_0xe913('0x3d')](_0x2a6e6d[_0xe913('0x34')][_0xe913('0x3d')]);_0x17808e['where']=qs[_0xe913('0x35')](_[_0xe913('0x3e')](_0x2a6e6d[_0xe913('0x34')],_0x22fbc3[_0xe913('0x35')]),_0x7a5bbb);if(_0x2a6e6d[_0xe913('0x34')]['filter']){_0x17808e[_0xe913('0x3f')]=_[_0xe913('0x40')](_0x17808e[_0xe913('0x3f')],{'$or':_[_0xe913('0x2d')](_0x7a5bbb,function(_0x2849ce){if(_0x2849ce['type']!==_0xe913('0x41')){var _0x2bc7d4={};_0x2bc7d4[_0x2849ce['name']]={'$like':'%'+_0x2a6e6d[_0xe913('0x34')]['filter']+'%'};return _0x2bc7d4;}})});}_0x17808e=_[_0xe913('0x40')]({},_0x17808e,_0x2a6e6d[_0xe913('0x42')]);var _0x590a9e={'where':_0x17808e['where']};return db[_0xe913('0x2e')][_0xe913('0x20')](_0x590a9e)[_0xe913('0x26')](function(_0x3c61e5){_0xb840b3['count']=_0x3c61e5;if(_0x2a6e6d[_0xe913('0x34')][_0xe913('0x43')]){_0x17808e[_0xe913('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe913('0x45')](_0x17808e);})[_0xe913('0x26')](function(_0x180c6c){_0xb840b3[_0xe913('0x46')]=_0x180c6c;return _0xb840b3;})[_0xe913('0x26')](respondWithFilteredResult(_0x3d91ac,_0x17808e))['catch'](handleError(_0x3d91ac,null));};exports['show']=function(_0xc1388,_0x3e8f54){var _0x4dd1e5={'raw':!![],'where':{'id':_0xc1388[_0xe913('0x47')]['id']}},_0x2cb5d7={};_0x2cb5d7['model']=_[_0xe913('0x48')](db[_0xe913('0x2e')][_0xe913('0x2f')]);_0x2cb5d7[_0xe913('0x34')]=_[_0xe913('0x48')](_0xc1388[_0xe913('0x34')]);_0x2cb5d7['filters']=_['intersection'](_0x2cb5d7[_0xe913('0x33')],_0x2cb5d7[_0xe913('0x34')]);_0x4dd1e5[_0xe913('0x37')]=_[_0xe913('0x36')](_0x2cb5d7[_0xe913('0x33')],qs[_0xe913('0x38')](_0xc1388[_0xe913('0x34')]['fields']));_0x4dd1e5[_0xe913('0x37')]=_0x4dd1e5[_0xe913('0x37')]['length']?_0x4dd1e5[_0xe913('0x37')]:_0x2cb5d7[_0xe913('0x33')];if(_0xc1388[_0xe913('0x34')]['includeAll']){_0x4dd1e5[_0xe913('0x44')]=[{'all':!![]}];}_0x4dd1e5=_[_0xe913('0x40')]({},_0x4dd1e5,_0xc1388['options']);return db[_0xe913('0x2e')][_0xe913('0x49')](_0x4dd1e5)[_0xe913('0x26')](handleEntityNotFound(_0x3e8f54,null))[_0xe913('0x26')](respondWithResult(_0x3e8f54,null))[_0xe913('0x4a')](handleError(_0x3e8f54,null));};exports['create']=function(_0x28bfbe,_0x18b811){return db[_0xe913('0x2e')][_0xe913('0x4b')](_0x28bfbe[_0xe913('0x4c')],{})[_0xe913('0x26')](respondWithResult(_0x18b811,0xc9))[_0xe913('0x4a')](handleError(_0x18b811,null));};exports[_0xe913('0x25')]=function(_0x4cf78e,_0x423f07){if(_0x4cf78e['body']['id']){delete _0x4cf78e['body']['id'];}return db[_0xe913('0x2e')][_0xe913('0x49')]({'where':{'id':_0x4cf78e['params']['id']}})[_0xe913('0x26')](handleEntityNotFound(_0x423f07,null))[_0xe913('0x26')](saveUpdates(_0x4cf78e[_0xe913('0x4c')],null))[_0xe913('0x26')](respondWithResult(_0x423f07,null))[_0xe913('0x4a')](handleError(_0x423f07,null));};exports[_0xe913('0x4d')]=function(_0x1c67ec,_0x480579){return db[_0xe913('0x2e')][_0xe913('0x49')]({'where':{'id':_0x1c67ec['params']['id']}})['then'](handleEntityNotFound(_0x480579,null))[_0xe913('0x26')](removeEntity(_0x480579,null))[_0xe913('0x4a')](handleError(_0x480579,null));};exports[_0xe913('0x4e')]=function(_0x4bd8d2,_0x28cf29){return db[_0xe913('0x2e')][_0xe913('0x4e')]()['then'](respondWithResult(_0x28cf29,null))[_0xe913('0x4a')](handleError(_0x28cf29,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 54210cc..0c6ea2e 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 _0x47d0=['moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api'];(function(_0x5496ce,_0x1e672b){var _0x2f4057=function(_0x38b925){while(--_0x38b925){_0x5496ce['push'](_0x5496ce['shift']());}};_0x2f4057(++_0x1e672b);}(_0x47d0,0x1cb));var _0x047d=function(_0x484c14,_0x137a08){_0x484c14=_0x484c14-0x0;var _0x2d5bb9=_0x47d0[_0x484c14];return _0x2d5bb9;};'use strict';var _=require('lodash');var util=require(_0x047d('0x0'));var logger=require(_0x047d('0x1'))(_0x047d('0x2'));var moment=require(_0x047d('0x3'));var BPromise=require('bluebird');var rp=require(_0x047d('0x4'));var fs=require('fs');var path=require(_0x047d('0x5'));var rimraf=require(_0x047d('0x6'));var config=require(_0x047d('0x7'));var attributes=require(_0x047d('0x8'));module[_0x047d('0x9')]=function(_0x388f83,_0x3d118d){return _0x388f83[_0x047d('0xa')](_0x047d('0xb'),attributes,{'tableName':_0x047d('0xc'),'paranoid':![],'indexes':[{'name':_0x047d('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a96=['../../config/environment','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0x0a96,0xca));var _0x60a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a96[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x60a9('0x0'));var util=require(_0x60a9('0x1'));var logger=require(_0x60a9('0x2'))(_0x60a9('0x3'));var moment=require(_0x60a9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x60a9('0x5'));var rimraf=require(_0x60a9('0x6'));var config=require(_0x60a9('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x1405d4,_0x18a6a5){return _0x1405d4[_0x60a9('0x8')](_0x60a9('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x60a9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1e2fd0e..a95a811 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 _0x9092=['client','http','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x9092,0xf3));var _0x2909=function(_0x2a1f15,_0x22b8bb){_0x2a1f15=_0x2a1f15-0x0;var _0xc61205=_0x9092[_0x2a1f15];return _0xc61205;};'use strict';var _=require(_0x2909('0x0'));var util=require(_0x2909('0x1'));var moment=require('moment');var BPromise=require(_0x2909('0x2'));var rs=require(_0x2909('0x3'));var fs=require('fs');var Redis=require(_0x2909('0x4'));var db=require(_0x2909('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2909('0x6'))(_0x2909('0x7'));var config=require('../../config/environment');var jayson=require(_0x2909('0x8'));var client=jayson[_0x2909('0x9')][_0x2909('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d692,_0x470a39,_0x1972d2){return new BPromise(function(_0x5bd198,_0x1cd242){return client['request'](_0x30d692,_0x1972d2)[_0x2909('0xb')](function(_0x5bb118){logger['info'](_0x2909('0xc'),_0x470a39,_0x2909('0xd'));logger[_0x2909('0xe')](_0x2909('0xf'),_0x470a39,_0x2909('0xd'),JSON[_0x2909('0x10')](_0x5bb118));if(_0x5bb118[_0x2909('0x11')]){if(_0x5bb118[_0x2909('0x11')]['code']===0x1f4){logger[_0x2909('0x11')](_0x2909('0xc'),_0x470a39,_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);return _0x1cd242(_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);}logger[_0x2909('0x11')](_0x2909('0xc'),_0x470a39,_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);return _0x5bd198(_0x5bb118[_0x2909('0x11')][_0x2909('0x12')]);}else{logger['info'](_0x2909('0xc'),_0x470a39,_0x2909('0xd'));_0x5bd198(_0x5bb118[_0x2909('0x13')][_0x2909('0x12')]);}})[_0x2909('0x14')](function(_0x2eb0ab){logger[_0x2909('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x470a39,_0x2eb0ab);_0x1cd242(_0x2eb0ab);});});} \ No newline at end of file +var _0xcbc2=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x23e337,_0x1e3c57){var _0x45facf=function(_0x2abfa3){while(--_0x2abfa3){_0x23e337['push'](_0x23e337['shift']());}};_0x45facf(++_0x1e3c57);}(_0xcbc2,0x138));var _0x2cbc=function(_0x3d91fd,_0x3a768b){_0x3d91fd=_0x3d91fd-0x0;var _0x137a3a=_0xcbc2[_0x3d91fd];return _0x137a3a;};'use strict';var _=require('lodash');var util=require(_0x2cbc('0x0'));var moment=require(_0x2cbc('0x1'));var BPromise=require(_0x2cbc('0x2'));var rs=require(_0x2cbc('0x3'));var fs=require('fs');var Redis=require(_0x2cbc('0x4'));var db=require(_0x2cbc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cbc('0x6'))(_0x2cbc('0x7'));var config=require(_0x2cbc('0x8'));var jayson=require(_0x2cbc('0x9'));var client=jayson[_0x2cbc('0xa')][_0x2cbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5acbd7,_0x240eb1,_0x455b58){return new BPromise(function(_0x5d71fd,_0x1efcc5){return client[_0x2cbc('0xc')](_0x5acbd7,_0x455b58)[_0x2cbc('0xd')](function(_0x2fd5ab){logger[_0x2cbc('0xe')](_0x2cbc('0xf'),_0x240eb1,'request\x20sent');logger[_0x2cbc('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x240eb1,_0x2cbc('0x11'),JSON[_0x2cbc('0x12')](_0x2fd5ab));if(_0x2fd5ab[_0x2cbc('0x13')]){if(_0x2fd5ab['error'][_0x2cbc('0x14')]===0x1f4){logger[_0x2cbc('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x240eb1,_0x2fd5ab[_0x2cbc('0x13')][_0x2cbc('0x15')]);return _0x1efcc5(_0x2fd5ab[_0x2cbc('0x13')][_0x2cbc('0x15')]);}logger['error'](_0x2cbc('0xf'),_0x240eb1,_0x2fd5ab['error']['message']);return _0x5d71fd(_0x2fd5ab[_0x2cbc('0x13')][_0x2cbc('0x15')]);}else{logger['info'](_0x2cbc('0xf'),_0x240eb1,_0x2cbc('0x11'));_0x5d71fd(_0x2fd5ab[_0x2cbc('0x16')][_0x2cbc('0x15')]);}})[_0x2cbc('0x17')](function(_0x79aa15){logger['error'](_0x2cbc('0xf'),_0x240eb1,_0x79aa15);_0x1efcc5(_0x79aa15);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6faaf27..cb9f185 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 _0x4d07=['isAuthenticated','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','describe','/:id'];(function(_0x1df926,_0x2e903b){var _0x2aee5d=function(_0x3c09ef){while(--_0x3c09ef){_0x1df926['push'](_0x1df926['shift']());}};_0x2aee5d(++_0x2e903b);}(_0x4d07,0x1e2));var _0x74d0=function(_0x1256f7,_0x3e93fe){_0x1256f7=_0x1256f7-0x0;var _0x450597=_0x4d07[_0x1256f7];return _0x450597;};'use strict';var multer=require('multer');var util=require(_0x74d0('0x0'));var path=require(_0x74d0('0x1'));var timeout=require('connect-timeout');var express=require(_0x74d0('0x2'));var router=express[_0x74d0('0x3')]();var fs_extra=require(_0x74d0('0x4'));var auth=require(_0x74d0('0x5'));var interaction=require(_0x74d0('0x6'));var config=require('../../config/environment');var controller=require(_0x74d0('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x74d0('0x8')](_0x74d0('0x9'),auth['isAuthenticated'](),controller[_0x74d0('0xa')]);router['get'](_0x74d0('0xb'),auth[_0x74d0('0xc')](),controller['show']);router[_0x74d0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x74d0('0xe')]('/:id',auth[_0x74d0('0xc')](),controller[_0x74d0('0xf')]);router[_0x74d0('0x10')](_0x74d0('0xb'),auth[_0x74d0('0xc')](),controller[_0x74d0('0x11')]);module[_0x74d0('0x12')]=router; \ No newline at end of file +var _0xd009=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','destroy','exports','multer'];(function(_0x2919ed,_0x1acf5d){var _0x165044=function(_0x5f377f){while(--_0x5f377f){_0x2919ed['push'](_0x2919ed['shift']());}};_0x165044(++_0x1acf5d);}(_0xd009,0x1da));var _0x9d00=function(_0x2e8982,_0x208331){_0x2e8982=_0x2e8982-0x0;var _0x52d41f=_0xd009[_0x2e8982];return _0x52d41f;};'use strict';var multer=require(_0x9d00('0x0'));var util=require(_0x9d00('0x1'));var path=require(_0x9d00('0x2'));var timeout=require(_0x9d00('0x3'));var express=require(_0x9d00('0x4'));var router=express['Router']();var fs_extra=require(_0x9d00('0x5'));var auth=require(_0x9d00('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d00('0x7'));var controller=require(_0x9d00('0x8'));router[_0x9d00('0x9')]('/',auth[_0x9d00('0xa')](),controller['index']);router[_0x9d00('0x9')](_0x9d00('0xb'),auth[_0x9d00('0xa')](),controller['describe']);router[_0x9d00('0x9')](_0x9d00('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9d00('0xd')]('/',auth['isAuthenticated'](),controller[_0x9d00('0xe')]);router[_0x9d00('0xf')](_0x9d00('0xc'),auth[_0x9d00('0xa')](),controller[_0x9d00('0x10')]);router['delete'](_0x9d00('0xc'),auth[_0x9d00('0xa')](),controller[_0x9d00('0x11')]);module[_0x9d00('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 0afc066..016e1fb 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 _0x556d=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0x556d,0x17d));var _0xd556=function(_0x4a7f34,_0x21c40a){_0x4a7f34=_0x4a7f34-0x0;var _0x542ed1=_0x556d[_0x4a7f34];return _0x542ed1;};'use strict';var Sequelize=require(_0xd556('0x0'));var rs=require(_0xd556('0x1'));module[_0xd556('0x2')]={'name':{'type':Sequelize[_0xd556('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'unique':_0xd556('0x4')},'description':{'type':Sequelize[_0xd556('0x3')]},'mapKey':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x5')},'mapKeyOffline':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x5')},'key':{'type':Sequelize[_0xd556('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x6')},'customerAlias':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':_0xd556('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd556('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd556('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd556('0x9')](_0xd556('0xa'),_0xd556('0xb')),'defaultValue':_0xd556('0xa')},'header_online':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0xe')},'download_transcript':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd556('0x12')]},'closingQuestion':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x15')},'noteTitle':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x16')},'placeholderMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x17')},'closingMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x18')},'conditionAgreement':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x19')},'ratingType':{'type':Sequelize[_0xd556('0x9')]('star',_0xd556('0x1a')),'defaultValue':_0xd556('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd556('0x1c'),'variable':null,'config':{'placeholder':_0xd556('0x1d'),'type':_0xd556('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xd556('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd556('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd556('0x1f')]('onlineForm')?JSON['parse'](this[_0xd556('0x1f')](_0xd556('0x20'))):{};},'set':function(_0x2f9610){return this[_0xd556('0x21')](_0xd556('0x20'),JSON['stringify'](_0x2f9610));}},'offlineForm':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return JSON[_0xd556('0x22')]({'items':[{'type':_0xd556('0x1c'),'props':{'title':_0xd556('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd556('0x5'),'type':_0xd556('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd556('0x23')},'props':{'title':'Comments','helpText':_0xd556('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd556('0x25'))?JSON[_0xd556('0x26')](this['getDataValue'](_0xd556('0x25'))):{};},'set':function(_0x503c23){return this['setDataValue']('offlineForm',JSON[_0xd556('0x22')](_0x503c23));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd556('0x27')]();}},'autoclose':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd556('0x3')]},'forwardOffline':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x28')},'waitingMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x29')},'offlineMessageSubject':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd556('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x2b')},'enableCustomerAttachment':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd556('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd556('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd556('0x12')],'defaultValue':function(){return _0xd556('0x2c');}},'notificationSound':{'type':Sequelize[_0xd556('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2e')},'verticalAlignment':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x2f')},'defaultTitle':{'type':Sequelize[_0xd556('0x3')]},'customerAvatar':{'type':Sequelize[_0xd556('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd556('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd556('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd556('0x3')],'defaultValue':_0xd556('0x30')},'systemAvatar':{'type':Sequelize[_0xd556('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd556('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![],'comment':_0xd556('0x31'),'set':function(_0x5ec3f5){if(!_0x5ec3f5)this[_0xd556('0x21')](_0xd556('0x32'),null);this[_0xd556('0x21')](_0xd556('0x33'),_0x5ec3f5);}},'vidaooEscalation':{'type':Sequelize[_0xd556('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd556('0x3')]},'vidaooTopic':{'type':Sequelize[_0xd556('0x3')],'allowNull':![],'defaultValue':_0xd556('0x34')},'vidaooNote':{'type':Sequelize[_0xd556('0x3')],'defaultValue':function(){return _0xd556('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xd556('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd556('0x12')]}}; \ No newline at end of file +var _0x8357=['email','getDataValue','onlineForm','parse','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','#011F6A','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name'];(function(_0xba03c6,_0xdc5c90){var _0x1fb502=function(_0x330f23){while(--_0x330f23){_0xba03c6['push'](_0xba03c6['shift']());}};_0x1fb502(++_0xdc5c90);}(_0x8357,0x135));var _0x7835=function(_0x1d10f3,_0x3fc732){_0x1d10f3=_0x1d10f3-0x0;var _0x3ce255=_0x8357[_0x1d10f3];return _0x3ce255;};'use strict';var Sequelize=require(_0x7835('0x0'));var rs=require(_0x7835('0x1'));module[_0x7835('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x7835('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x7835('0x3')]},'mapKey':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x7835('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7835('0x3')],'allowNull':![],'defaultValue':_0x7835('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7835('0x3')],'allowNull':![],'defaultValue':_0x7835('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7835('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7835('0x3')]},'animation':{'type':Sequelize[_0x7835('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7835('0x7')]('rounded',_0x7835('0x8')),'defaultValue':_0x7835('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0xa')},'start_chat_button':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0xc')},'download_transcript':{'type':Sequelize[_0x7835('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x7835('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7835('0xe')]},'closingQuestion':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0x12')},'placeholderMessage':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x13')},'closingMessage':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x14')},'closingMessageButton':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0xb')},'skipMessageButton':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x15')},'conditionAgreement':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x7835('0x7')](_0x7835('0x16'),_0x7835('0x17')),'defaultValue':_0x7835('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x7835('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7835('0xe')],'defaultValue':function(){return JSON[_0x7835('0x18')]({'items':[{'type':_0x7835('0x19'),'variable':null,'config':{'placeholder':_0x7835('0x1a'),'type':'text','required':!![]},'props':{'title':_0x7835('0x1a'),'helpText':''}},{'type':_0x7835('0x19'),'props':{'title':_0x7835('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x7835('0x1b')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7835('0x1c')](_0x7835('0x1d'))?JSON[_0x7835('0x1e')](this[_0x7835('0x1c')]('onlineForm')):{};},'set':function(_0x2ece04){return this['setDataValue'](_0x7835('0x1d'),JSON[_0x7835('0x18')](_0x2ece04));}},'offlineForm':{'type':Sequelize[_0x7835('0xe')],'defaultValue':function(){return JSON[_0x7835('0x18')]({'items':[{'type':_0x7835('0x19'),'props':{'title':_0x7835('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x7835('0x1b'),'type':'email'},'variable':null},{'type':_0x7835('0x1f'),'config':{'placeholder':_0x7835('0x20')},'props':{'title':_0x7835('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x7835('0x1c')](_0x7835('0x21'))?JSON[_0x7835('0x1e')](this[_0x7835('0x1c')](_0x7835('0x21'))):{};},'set':function(_0x14c844){return this['setDataValue'](_0x7835('0x21'),JSON['stringify'](_0x14c844));}},'token':{'type':Sequelize[_0x7835('0x3')],'defaultValue':function(){return rs[_0x7835('0x22')]();}},'autoclose':{'type':Sequelize[_0x7835('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7835('0x3')]},'forwardOffline':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7835('0x3')]},'waitingTitle':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x23')},'waitingMessage':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x25')},'offlineMessageBody':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x26')},'skipUnmanaged':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x15')},'sendUnmanaged':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7835('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7835('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7835('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x7835('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7835('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x7835('0x5')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7835('0x27')},'defaultTitle':{'type':Sequelize[_0x7835('0x3')]},'customerAvatar':{'type':Sequelize[_0x7835('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7835('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7835('0x3')],'allowNull':![],'defaultValue':_0x7835('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7835('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7835('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7835('0x3')],'defaultValue':_0x7835('0x29')},'systemAvatar':{'type':Sequelize[_0x7835('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7835('0x5')],'comment':_0x7835('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1c3d63){if(!_0x1c3d63)this[_0x7835('0x2b')](_0x7835('0x2c'),null);this['setDataValue'](_0x7835('0x2d'),_0x1c3d63);}},'vidaooEscalation':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7835('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7835('0x2e')},'vidaooNote':{'type':Sequelize[_0x7835('0x3')],'defaultValue':function(){return _0x7835('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x7835('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7835('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7835('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b700298..aade4dd 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 _0x5a8c=['info','debug','stringify','error','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','result','catch','status','end','undefined','limit','count','apply','reject','save','then','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatWebsite','includeAll','findAll','show','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','rows','removeDispositions','ids','CannedAnswer','getAnswers','findOne','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','notify','setUA','headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','defaults','ListId','CmContact','customerIp','cf-connecting-ip','first','x-forwarded-for','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','hasOwnProperty','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','x-real-ip','referer','virtual','render','textColor','color_button','backgroundColor','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x5a8c,0x116));var _0xc5a8=function(_0x34198b,_0x237ae9){_0x34198b=_0x34198b-0x0;var _0x1cd59=_0x5a8c[_0x34198b];return _0x1cd59;};'use strict';var emlformat=require(_0xc5a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5a8('0x1'));var jsonpatch=require(_0xc5a8('0x2'));var rp=require('request-promise');var moment=require(_0xc5a8('0x3'));var BPromise=require(_0xc5a8('0x4'));var Mustache=require(_0xc5a8('0x5'));var util=require('util');var path=require(_0xc5a8('0x6'));var sox=require(_0xc5a8('0x7'));var csv=require(_0xc5a8('0x8'));var ejs=require(_0xc5a8('0x9'));var fs=require('fs');var fs_extra=require(_0xc5a8('0xa'));var _=require(_0xc5a8('0xb'));var squel=require(_0xc5a8('0xc'));var crypto=require(_0xc5a8('0xd'));var jsforce=require(_0xc5a8('0xe'));var deskjs=require(_0xc5a8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc5a8('0x10'));var Papa=require(_0xc5a8('0x11'));var Redis=require(_0xc5a8('0x12'));var authService=require(_0xc5a8('0x13'));var qs=require(_0xc5a8('0x14'));var as=require(_0xc5a8('0x15'));var hardwareService=require(_0xc5a8('0x16'));var logger=require(_0xc5a8('0x17'))(_0xc5a8('0x18'));var utils=require(_0xc5a8('0x19'));var config=require(_0xc5a8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc5a8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5a8('0x1c'))(new Redis(config[_0xc5a8('0x1b')]));require(_0xc5a8('0x1d'))[_0xc5a8('0x1e')](socket);var jayson=require(_0xc5a8('0x1f'));var client=jayson[_0xc5a8('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xc5a8('0x20')][_0xc5a8('0x21')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xc5a8('0x20')][_0xc5a8('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x5e7f8b,_0x5e7945,_0x1a0121,_0x48dd4c){return new BPromise(function(_0xfd3ddb,_0x12ce9c){var _0x5f0816=_0x48dd4c||client;return _0x5f0816[_0xc5a8('0x22')](_0x5e7f8b,_0x1a0121)['then'](function(_0x416a14){logger[_0xc5a8('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,'request\x20sent');logger[_0xc5a8('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5e7945,'request\x20sent',JSON[_0xc5a8('0x25')](_0x416a14));if(_0x416a14[_0xc5a8('0x26')]){if(_0x416a14[_0xc5a8('0x26')]['code']===0x1f4){logger[_0xc5a8('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x416a14[_0xc5a8('0x26')][_0xc5a8('0x27')]);return _0x12ce9c(_0x416a14[_0xc5a8('0x26')]['message']);}logger[_0xc5a8('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x416a14[_0xc5a8('0x26')]['message']);return _0xfd3ddb(_0x416a14[_0xc5a8('0x26')]['message']);}else{logger[_0xc5a8('0x23')](_0xc5a8('0x28'),_0x5e7945,_0xc5a8('0x29'));_0xfd3ddb(_0x416a14[_0xc5a8('0x2a')][_0xc5a8('0x27')]);}})[_0xc5a8('0x2b')](function(_0x1a0c4c){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5e7945,_0x1a0c4c);_0x12ce9c(_0x1a0c4c);});});}function respondWithStatusCode(_0x1badf6,_0x484ebc){_0x484ebc=_0x484ebc||0xcc;return function(_0x336fa0){if(_0x336fa0){return _0x1badf6['sendStatus'](_0x484ebc);}return _0x1badf6[_0xc5a8('0x2c')](_0x484ebc)[_0xc5a8('0x2d')]();};}function respondWithResult(_0xa38638,_0x4bae8a){_0x4bae8a=_0x4bae8a||0xc8;return function(_0x16f807){if(_0x16f807){return _0xa38638[_0xc5a8('0x2c')](_0x4bae8a)['json'](_0x16f807);}};}function respondWithFilteredResult(_0x5041c0,_0x56e898){return function(_0x59f39f){if(_0x59f39f){var _0x83fcfc=typeof _0x56e898['offset']===_0xc5a8('0x2e')&&typeof _0x56e898[_0xc5a8('0x2f')]==='undefined';var _0x469817=_0x59f39f['count'];var _0x3c9988=_0x83fcfc?0x0:_0x56e898['offset'];var _0xe86052=_0x83fcfc?_0x59f39f[_0xc5a8('0x30')]:_0x56e898['offset']+_0x56e898['limit'];var _0x201619;if(_0xe86052>=_0x469817){_0xe86052=_0x469817;_0x201619=0xc8;}else{_0x201619=0xce;}_0x5041c0[_0xc5a8('0x2c')](_0x201619);return _0x5041c0['set']('Content-Range',_0x3c9988+'-'+_0xe86052+'/'+_0x469817)['json'](_0x59f39f);}return null;};}function patchUpdates(_0x138417){return function(_0x3154b7){try{jsonpatch[_0xc5a8('0x31')](_0x3154b7,_0x138417,!![]);}catch(_0x29a570){return BPromise[_0xc5a8('0x32')](_0x29a570);}return _0x3154b7[_0xc5a8('0x33')]();};}function saveUpdates(_0x178c5e,_0x4b589e){return function(_0x7389de){if(_0x7389de){return _0x7389de['update'](_0x178c5e)[_0xc5a8('0x34')](function(_0x5b06b9){return _0x5b06b9;});}return null;};}function removeEntity(_0x491302,_0x39645e){return function(_0x47148d){if(_0x47148d){return _0x47148d[_0xc5a8('0x35')]()[_0xc5a8('0x34')](function(){var _0x3be15c=_0x47148d['get']({'plain':!![]});var _0x38f2c8=_0xc5a8('0x36');return db[_0xc5a8('0x37')][_0xc5a8('0x35')]({'where':{'type':_0x38f2c8,'resourceId':_0x3be15c['id']}})[_0xc5a8('0x34')](function(){return _0x47148d;});})[_0xc5a8('0x34')](function(){_0x491302['status'](0xcc)[_0xc5a8('0x2d')]();});}};}function handleEntityNotFound(_0x4d62cc,_0xeeac22){return function(_0x29c0c1){if(!_0x29c0c1){_0x4d62cc[_0xc5a8('0x38')](0x194);}return _0x29c0c1;};}function handleError(_0x4a8ac4,_0xaaa1fc){_0xaaa1fc=_0xaaa1fc||0x1f4;return function(_0x5013d6){logger[_0xc5a8('0x26')](_0x5013d6[_0xc5a8('0x39')]);if(_0x5013d6['name']){delete _0x5013d6[_0xc5a8('0x3a')];}_0x4a8ac4[_0xc5a8('0x2c')](_0xaaa1fc)[_0xc5a8('0x3b')](_0x5013d6);};}exports[_0xc5a8('0x3c')]=function(_0x1330e6,_0x39e663){var _0x4933d9={'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]},_0x9dd4ec={},_0xa19066={'count':0x0,'rows':[]};var _0x5ef3e6=_['map'](db['ChatWebsite'][_0xc5a8('0x3f')],function(_0x4cdbe0){return{'name':_0x4cdbe0['fieldName'],'type':_0x4cdbe0[_0xc5a8('0x40')]['key']};});_0x9dd4ec[_0xc5a8('0x41')]=_['map'](_0x5ef3e6,_0xc5a8('0x3a'));_0x9dd4ec[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x1330e6[_0xc5a8('0x42')]);_0x9dd4ec[_0xc5a8('0x44')]=_['intersection'](_0x9dd4ec['model'],_0x9dd4ec['query']);_0x4933d9[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x9dd4ec['model'],qs[_0xc5a8('0x47')](_0x1330e6['query'][_0xc5a8('0x47')]));_0x4933d9[_0xc5a8('0x45')]=_0x4933d9[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x4933d9[_0xc5a8('0x45')]:_0x9dd4ec[_0xc5a8('0x41')];if(!_0x1330e6[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x4933d9['limit']=qs[_0xc5a8('0x2f')](_0x1330e6['query'][_0xc5a8('0x2f')]);_0x4933d9[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0x4933d9['order']=qs['sort'](_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4933d9[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x1330e6[_0xc5a8('0x42')],_0x9dd4ec[_0xc5a8('0x44')]),_0x5ef3e6);if(_0x1330e6[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4933d9[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x4933d9[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x5ef3e6,function(_0x3b8c84){if(_0x3b8c84[_0xc5a8('0x40')]!==_0xc5a8('0x51')){var _0x495edf={};_0x495edf[_0x3b8c84['name']]={'$like':'%'+_0x1330e6['query']['filter']+'%'};return _0x495edf;}})});}_0x4933d9=_[_0xc5a8('0x4f')]({},_0x4933d9,_0x1330e6[_0xc5a8('0x52')]);var _0x437073={'where':_0x4933d9[_0xc5a8('0x4c')]};return db[_0xc5a8('0x53')][_0xc5a8('0x30')](_0x437073)[_0xc5a8('0x34')](function(_0x842bcd){_0xa19066[_0xc5a8('0x30')]=_0x842bcd;if(_0x1330e6['query'][_0xc5a8('0x54')]){_0x4933d9['include']=[{'all':!![]}];}return db[_0xc5a8('0x53')][_0xc5a8('0x55')](_0x4933d9);})[_0xc5a8('0x34')](function(_0x3b8112){_0xa19066['rows']=_0x3b8112;return _0xa19066;})[_0xc5a8('0x34')](respondWithFilteredResult(_0x39e663,_0x4933d9))['catch'](handleError(_0x39e663,null));};exports[_0xc5a8('0x56')]=function(_0xf0f4d,_0x320ff7){var _0x5bd427={'raw':![],'where':{'id':_0xf0f4d[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]},_0x1d646b={};_0x1d646b[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x53')][_0xc5a8('0x3f')]);_0x1d646b[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0xf0f4d[_0xc5a8('0x42')]);_0x1d646b['filters']=_[_0xc5a8('0x46')](_0x1d646b[_0xc5a8('0x41')],_0x1d646b[_0xc5a8('0x42')]);_0x5bd427[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x1d646b[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0xf0f4d[_0xc5a8('0x42')]['fields']));_0x5bd427['attributes']=_0x5bd427[_0xc5a8('0x45')]['length']?_0x5bd427['attributes']:_0x1d646b[_0xc5a8('0x41')];if(_0xf0f4d['query'][_0xc5a8('0x54')]){_0x5bd427[_0xc5a8('0x58')]=[{'all':!![]}];}_0x5bd427=_[_0xc5a8('0x4f')]({},_0x5bd427,_0xf0f4d['options']);return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x5bd427)[_0xc5a8('0x34')](handleEntityNotFound(_0x320ff7,null))[_0xc5a8('0x34')](respondWithResult(_0x320ff7,null))[_0xc5a8('0x2b')](handleError(_0x320ff7,null));};exports[_0xc5a8('0x5a')]=function(_0xbfc753,_0x533609){return db[_0xc5a8('0x53')][_0xc5a8('0x5a')](_0xbfc753[_0xc5a8('0x5b')],{})[_0xc5a8('0x34')](function(_0x5cfadc){var _0x501a6e=_0xbfc753['user'][_0xc5a8('0x5c')]({'plain':!![]});if(!_0x501a6e)throw new Error(_0xc5a8('0x5d'));if(_0x501a6e[_0xc5a8('0x5e')]===_0xc5a8('0x5f')){var _0x3d5576=_0x5cfadc[_0xc5a8('0x5c')]({'plain':!![]});var _0x1fea9d=_0xc5a8('0x36');return db[_0xc5a8('0x60')][_0xc5a8('0x59')]({'where':{'name':_0x1fea9d,'userProfileId':_0x501a6e['userProfileId']},'raw':!![]})[_0xc5a8('0x34')](function(_0x5bdb58){if(_0x5bdb58&&_0x5bdb58[_0xc5a8('0x61')]===0x0){return db[_0xc5a8('0x37')]['create']({'name':_0x3d5576['name'],'resourceId':_0x3d5576['id'],'type':_0x5bdb58['name'],'sectionId':_0x5bdb58['id']},{})[_0xc5a8('0x34')](function(){return _0x5cfadc;});}else{return _0x5cfadc;}})[_0xc5a8('0x2b')](function(_0x2e3365){logger[_0xc5a8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e3365);throw _0x2e3365;});}return _0x5cfadc;})[_0xc5a8('0x34')](respondWithResult(_0x533609,0xc9))[_0xc5a8('0x2b')](handleError(_0x533609,null));};exports[_0xc5a8('0x62')]=function(_0x28f103,_0x2c4529){if(_0x28f103['body']['id']){delete _0x28f103[_0xc5a8('0x5b')]['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x28f103[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x3d')],'as':_0xc5a8('0x3e')}]})['then'](handleEntityNotFound(_0x2c4529,null))[_0xc5a8('0x34')](saveUpdates(_0x28f103['body'],null))[_0xc5a8('0x34')](respondWithResult(_0x2c4529,null))[_0xc5a8('0x2b')](handleError(_0x2c4529,null));};exports[_0xc5a8('0x35')]=function(_0x428aad,_0x410131){return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x428aad[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x410131,null))[_0xc5a8('0x34')](removeEntity(_0x410131,null))[_0xc5a8('0x2b')](handleError(_0x410131,null));};exports['describe']=function(_0x31bf8b,_0x1e3bbe){return db[_0xc5a8('0x53')][_0xc5a8('0x63')]()[_0xc5a8('0x34')](respondWithResult(_0x1e3bbe,null))[_0xc5a8('0x2b')](handleError(_0x1e3bbe,null));};exports[_0xc5a8('0x64')]=function(_0x441faf,_0x50b5f0,_0x484ff8){if(_0x441faf[_0xc5a8('0x5b')]['id']){delete _0x441faf['body']['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x441faf[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x50b5f0,null))[_0xc5a8('0x34')](function(_0x5c7f8a){if(_0x5c7f8a){_0x441faf[_0xc5a8('0x5b')][_0xc5a8('0x65')]=_0x5c7f8a['id'];return db[_0xc5a8('0x66')][_0xc5a8('0x5a')](_0x441faf[_0xc5a8('0x5b')]);}})['then'](respondWithResult(_0x50b5f0,null))[_0xc5a8('0x2b')](handleError(_0x50b5f0,null));};exports[_0xc5a8('0x67')]=function(_0x55d2e6,_0x930e5b,_0xe6e144){var _0x34b7b7={'raw':![],'where':{}};var _0x599cb4={};var _0x26af97={'count':0x0,'rows':[]};return db[_0xc5a8('0x53')]['findOne']({'where':{'id':_0x55d2e6['params']['id']}})['then'](handleEntityNotFound(_0x930e5b,null))[_0xc5a8('0x34')](function(_0x31e1aa){if(_0x31e1aa){_0x599cb4[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x66')][_0xc5a8('0x3f')]);_0x599cb4[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x55d2e6['query']);_0x599cb4[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x599cb4[_0xc5a8('0x41')],_0x599cb4[_0xc5a8('0x42')]);_0x34b7b7['attributes']=_[_0xc5a8('0x46')](_0x599cb4[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x34b7b7['attributes']=_0x34b7b7[_0xc5a8('0x45')]['length']?_0x34b7b7[_0xc5a8('0x45')]:_0x599cb4[_0xc5a8('0x41')];if(!_0x55d2e6[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x34b7b7[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x34b7b7[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x55d2e6[_0xc5a8('0x42')]['offset']);}_0x34b7b7[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x55d2e6['query'][_0xc5a8('0x4b')]);_0x34b7b7[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x55d2e6[_0xc5a8('0x42')],_0x599cb4[_0xc5a8('0x44')]));_0x34b7b7[_0xc5a8('0x4c')][_0xc5a8('0x65')]=_0x31e1aa['id'];if(_0x55d2e6[_0xc5a8('0x42')]['filter']){_0x34b7b7[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x34b7b7['where'],{'$or':_['map'](_0x34b7b7[_0xc5a8('0x45')],function(_0x107835){var _0x468df8={};_0x468df8[_0x107835]={'$like':'%'+_0x55d2e6[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x468df8;})});}_0x34b7b7=_[_0xc5a8('0x4f')]({},_0x34b7b7,_0x55d2e6['options']);return db[_0xc5a8('0x66')][_0xc5a8('0x30')]({'where':_0x34b7b7['where']})[_0xc5a8('0x34')](function(_0x105bd3){_0x26af97[_0xc5a8('0x30')]=_0x105bd3;if(_0x55d2e6['query'][_0xc5a8('0x54')]){_0x34b7b7[_0xc5a8('0x58')]=[{'all':!![]}];}return db[_0xc5a8('0x66')][_0xc5a8('0x55')](_0x34b7b7);})[_0xc5a8('0x34')](function(_0x4b629a){_0x26af97[_0xc5a8('0x69')]=_0x4b629a;return _0x26af97;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x930e5b,_0x34b7b7))[_0xc5a8('0x2b')](handleError(_0x930e5b,null));};exports[_0xc5a8('0x6a')]=function(_0x42e70d,_0x10ace0,_0x263911){return db['ChatWebsite']['find']({'where':{'id':_0x42e70d[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x10ace0,null))[_0xc5a8('0x34')](function(_0x12adf7){if(_0x12adf7){return _0x12adf7[_0xc5a8('0x6a')](_0x42e70d[_0xc5a8('0x42')][_0xc5a8('0x6b')]);}})[_0xc5a8('0x34')](respondWithStatusCode(_0x10ace0,null))[_0xc5a8('0x2b')](handleError(_0x10ace0,null));};exports['addAnswer']=function(_0x29a6a0,_0x3e7745,_0x2e771c){if(_0x29a6a0['body']['id']){delete _0x29a6a0[_0xc5a8('0x5b')]['id'];}return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x29a6a0[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x3e7745,null))[_0xc5a8('0x34')](function(_0x2c984b){if(_0x2c984b){_0x29a6a0[_0xc5a8('0x5b')][_0xc5a8('0x65')]=_0x2c984b['id'];return db[_0xc5a8('0x6c')]['create'](_0x29a6a0['body']);}})[_0xc5a8('0x34')](respondWithResult(_0x3e7745,null))[_0xc5a8('0x2b')](handleError(_0x3e7745,null));};exports[_0xc5a8('0x6d')]=function(_0x38cbda,_0x587e7b,_0x34a63d){var _0x4ef396={'raw':![],'where':{}};var _0x477f83={};var _0x430585={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc5a8('0x6e')]({'where':{'id':_0x38cbda[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x587e7b,null))['then'](function(_0x5ad964){if(_0x5ad964){_0x477f83[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db['CannedAnswer'][_0xc5a8('0x3f')]);_0x477f83['query']=_[_0xc5a8('0x43')](_0x38cbda[_0xc5a8('0x42')]);_0x477f83['filters']=_[_0xc5a8('0x46')](_0x477f83[_0xc5a8('0x41')],_0x477f83[_0xc5a8('0x42')]);_0x4ef396[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x477f83[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x38cbda[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4ef396[_0xc5a8('0x45')]=_0x4ef396[_0xc5a8('0x45')]['length']?_0x4ef396['attributes']:_0x477f83[_0xc5a8('0x41')];if(!_0x38cbda[_0xc5a8('0x42')]['hasOwnProperty'](_0xc5a8('0x49'))){_0x4ef396[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x38cbda[_0xc5a8('0x42')]['limit']);_0x4ef396[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x38cbda['query'][_0xc5a8('0x4a')]);}_0x4ef396[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x38cbda[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4ef396['where']=qs[_0xc5a8('0x44')](_[_0xc5a8('0x4d')](_0x38cbda[_0xc5a8('0x42')],_0x477f83['filters']));_0x4ef396[_0xc5a8('0x4c')][_0xc5a8('0x65')]=_0x5ad964['id'];if(_0x38cbda[_0xc5a8('0x42')]['filter']){_0x4ef396['where']=_[_0xc5a8('0x4f')](_0x4ef396['where'],{'$or':_[_0xc5a8('0x50')](_0x4ef396[_0xc5a8('0x45')],function(_0x39f035){var _0x7d36df={};_0x7d36df[_0x39f035]={'$like':'%'+_0x38cbda[_0xc5a8('0x42')]['filter']+'%'};return _0x7d36df;})});}_0x4ef396=_[_0xc5a8('0x4f')]({},_0x4ef396,_0x38cbda[_0xc5a8('0x52')]);return db[_0xc5a8('0x6c')][_0xc5a8('0x30')]({'where':_0x4ef396[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0x26ed43){_0x430585['count']=_0x26ed43;if(_0x38cbda['query']['includeAll']){_0x4ef396['include']=[{'all':!![]}];}return db[_0xc5a8('0x6c')]['findAll'](_0x4ef396);})[_0xc5a8('0x34')](function(_0x127b14){_0x430585[_0xc5a8('0x69')]=_0x127b14;return _0x430585;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x587e7b,_0x4ef396))[_0xc5a8('0x2b')](handleError(_0x587e7b,null));};exports['removeAnswers']=function(_0x2133e7,_0x7f48cc,_0x218383){return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x2133e7['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x7f48cc,null))['then'](function(_0x416470){if(_0x416470){return _0x416470['removeAnswers'](_0x2133e7[_0xc5a8('0x42')][_0xc5a8('0x6b')]);}})[_0xc5a8('0x34')](respondWithStatusCode(_0x7f48cc,null))[_0xc5a8('0x2b')](handleError(_0x7f48cc,null));};exports[_0xc5a8('0x6f')]=function(_0x1ac031,_0x5b134a,_0x3e1a48){_0x1ac031[_0xc5a8('0x5b')][_0xc5a8('0x70')]=_0x1ac031[_0xc5a8('0x71')][_0xc5a8('0x72')];return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x1ac031[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b134a,null))['then'](saveUpdates(_0x1ac031['body'],null))[_0xc5a8('0x34')](respondWithResult(_0x5b134a,null))[_0xc5a8('0x2b')](handleError(_0x5b134a,null));};exports[_0xc5a8('0x73')]=function(_0x445356,_0x471c14,_0x51803d){_0x445356[_0xc5a8('0x5b')][_0xc5a8('0x74')]=_0x445356['file'][_0xc5a8('0x72')];return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x445356[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x471c14,null))['then'](saveUpdates(_0x445356[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x471c14,null))[_0xc5a8('0x2b')](handleError(_0x471c14,null));};exports['addCustomerAvatar']=function(_0x518aae,_0x5688cd,_0x5723b2){_0x518aae[_0xc5a8('0x5b')][_0xc5a8('0x75')]=_0x518aae['file'][_0xc5a8('0x72')];return db[_0xc5a8('0x53')]['find']({'where':{'id':_0x518aae[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5688cd,null))[_0xc5a8('0x34')](saveUpdates(_0x518aae[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x5688cd,null))[_0xc5a8('0x2b')](handleError(_0x5688cd,null));};exports[_0xc5a8('0x76')]=function(_0x1063bf,_0x16c389,_0x46c382){_0x1063bf['body'][_0xc5a8('0x77')]=_0x1063bf[_0xc5a8('0x71')][_0xc5a8('0x72')];return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x1063bf[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x16c389,null))[_0xc5a8('0x34')](saveUpdates(_0x1063bf[_0xc5a8('0x5b')],null))[_0xc5a8('0x34')](respondWithResult(_0x16c389,null))[_0xc5a8('0x2b')](handleError(_0x16c389,null));};exports['getLogo']=function(_0x539157,_0x3c4608,_0x1632c6){var _0x1ea4c2=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x79'));var _0x4e37a1={'where':{'id':_0x539157[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x70')],'raw':!![]};var _0x3653ff=![];return require(_0xc5a8('0x7a'))[_0xc5a8('0x7b')]()['then'](function(_0x4aa046){if(_0x4aa046){_0x3653ff=_0x4aa046[_0xc5a8('0x7c')];}})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x4e37a1);})['then'](handleEntityNotFound(_0x3c4608,null))['then'](function(_0x32ceb8){if(_0x32ceb8){if(!_[_0xc5a8('0x7d')](_0x32ceb8[_0xc5a8('0x70')])){if(fs['existsSync'](path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x7e'),_0x32ceb8[_0xc5a8('0x70')]))&&_0x3653ff){_0x1ea4c2=path[_0xc5a8('0x7f')](config['root'],_0xc5a8('0x7e'),_0x32ceb8[_0xc5a8('0x70')]);}}return _0x3c4608[_0xc5a8('0x80')](_0x1ea4c2);}})['catch'](handleError(_0x3c4608,null));};exports[_0xc5a8('0x81')]=function(_0x50c5af,_0xa2a510,_0x21424d){var _0xe4fc08=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x82'));var _0x597443={'where':{'id':_0x50c5af[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x74')],'raw':!![]};return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x597443)[_0xc5a8('0x34')](handleEntityNotFound(_0xa2a510,null))[_0xc5a8('0x34')](function(_0x252e5a){if(_0x252e5a){if(!_[_0xc5a8('0x7d')](_0x252e5a['agentAvatar'])){if(fs['existsSync'](path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0x252e5a[_0xc5a8('0x74')]))){_0xe4fc08=path['join'](config['root'],_0xc5a8('0x83'),_0x252e5a[_0xc5a8('0x74')]);}}return _0xa2a510['download'](_0xe4fc08);}})[_0xc5a8('0x2b')](handleError(_0xa2a510,null));};exports[_0xc5a8('0x84')]=function(_0x91bd31,_0x4d40d1,_0x11d2b4){var _0x5c87c5=path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0x85'));var _0x3ef62a={'where':{'id':_0x91bd31[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x75'),_0xc5a8('0x86')],'raw':!![]};return db[_0xc5a8('0x53')][_0xc5a8('0x59')](_0x3ef62a)['then'](handleEntityNotFound(_0x4d40d1,null))[_0xc5a8('0x34')](function(_0x203652){if(_0x203652){if(!_[_0xc5a8('0x7d')](_0x203652['customerAvatar'])){if(fs[_0xc5a8('0x87')](path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0x203652[_0xc5a8('0x75')]))&&_0x203652[_0xc5a8('0x86')]){_0x5c87c5=path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],'server/files/images/avatars/',_0x203652['customerAvatar']);}}return _0x4d40d1[_0xc5a8('0x80')](_0x5c87c5);}})[_0xc5a8('0x2b')](handleError(_0x4d40d1,null));};exports[_0xc5a8('0x88')]=function(_0x2b81ba,_0x2ba954,_0x10fcd0){var _0x1ad5aa=path['join'](config[_0xc5a8('0x78')],'server/files/images/avatars/system_avatar.png');var _0x3b5779={'where':{'id':_0x2b81ba[_0xc5a8('0x57')]['id']},'attributes':['id',_0xc5a8('0x77')],'raw':!![]};return db[_0xc5a8('0x53')]['find'](_0x3b5779)['then'](handleEntityNotFound(_0x2ba954,null))['then'](function(_0xec53){if(_0xec53){if(!_[_0xc5a8('0x7d')](_0xec53[_0xc5a8('0x77')])){if(fs[_0xc5a8('0x87')](path['join'](config['root'],_0xc5a8('0x83'),_0xec53[_0xc5a8('0x77')]))){_0x1ad5aa=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0x83'),_0xec53[_0xc5a8('0x77')]);}}return _0x2ba954[_0xc5a8('0x80')](_0x1ad5aa);}})[_0xc5a8('0x2b')](handleError(_0x2ba954,null));};exports[_0xc5a8('0x89')]=function(_0x448379,_0x4e034c,_0x338c99){var _0x3f7bd6=require('user-agent-parser');var _0x3879b5=new _0x3f7bd6();var _0x1ad5bf=_0x3879b5[_0xc5a8('0x8a')](_0x448379[_0xc5a8('0x8b')][_0xc5a8('0x8c')])[_0xc5a8('0x8d')]();var _0x1e0b37={'body':_0x448379['body'],'channel':_0xc5a8('0x8e')};var _0xcb490b=[];var _0x588c00=[];var _0x5170f1={};var _0x131767=![];return db['CmContact'][_0xc5a8('0x63')]()[_0xc5a8('0x34')](function(_0x238383){if(!_0x238383){throw new db['Sequelize'][(_0xc5a8('0x8f'))](_0xc5a8('0x90'));}_0xcb490b=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x238383),[_0xc5a8('0x92'),_0xc5a8('0x93')]);_0x588c00=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x238383),[_0xc5a8('0x92'),_0xc5a8('0x93'),_0xc5a8('0x94'),'ListId']);if(_0x448379['body']['id']){delete _0x448379[_0xc5a8('0x5b')]['id'];}if(_[_0xc5a8('0x7d')](_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x95')])){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))]('from\x20is\x20mandatory');}if(_[_0xc5a8('0x7d')](_0x448379['body'][_0xc5a8('0x5b')])||_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x5b')]===''){throw new db[(_0xc5a8('0x96'))]['ValidationError'](_0xc5a8('0x97'));}if(_[_0xc5a8('0x7d')](_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')])){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x99')+_0x588c00);}if(!_[_0xc5a8('0x9a')](_0x588c00,_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')])){throw new db[(_0xc5a8('0x96'))]['ValidationError'](_0xc5a8('0x9b')+_0x588c00);}_0x5170f1[_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')]]=_0x448379[_0xc5a8('0x5b')]['from'];})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x448379[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x9c')],'as':_0xc5a8('0x9d'),'include':[{'model':db['CmContact'],'as':_0xc5a8('0x9e'),'where':_0x5170f1,'limit':0x1,'order':[[_0xc5a8('0x93'),_0xc5a8('0x9f')]]}]},{'model':db['ChatApplication'],'as':_0xc5a8('0xa0')}]});})[_0xc5a8('0x34')](handleEntityNotFound(_0x4e034c,null))['then'](function(_0x208f4f){if(_0x208f4f&&_0x208f4f[_0xc5a8('0x9d')]){_0x1e0b37[_0xc5a8('0xa1')]=_0x208f4f;_0x1e0b37[_0xc5a8('0xa2')]=_0x208f4f[_0xc5a8('0xa0')];_0x1e0b37[_0xc5a8('0xa3')]=_0x208f4f[_0xc5a8('0x9d')];_0x1e0b37['applications']=_[_0xc5a8('0xa4')](_0x1e0b37['applications'],[_0xc5a8('0xa5')],[_0xc5a8('0xa6')]);if(_0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0xa0')]){delete _0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0xa0')];}if(_0x1e0b37[_0xc5a8('0xa1')][_0xc5a8('0x9d')]&&_0x1e0b37['account'][_0xc5a8('0x9d')][_0xc5a8('0x9e')][_0xc5a8('0x48')]){return _0x1e0b37[_0xc5a8('0xa1')]['List'][_0xc5a8('0x9e')][0x0];}var _0x25d53e=_[_0xc5a8('0xa7')](_0x448379['body'],{'firstName':_0x448379['body'][_0xc5a8('0x95')],'ListId':_0x208f4f[_0xc5a8('0xa8')]});_0x25d53e[_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x98')]]=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0x95')];return db[_0xc5a8('0xa9')][_0xc5a8('0x5a')](_0x25d53e,{'fields':_0xcb490b,'raw':!![]});}})['then'](handleEntityNotFound(_0x4e034c,null))['then'](function(_0x3e1943){_0x1e0b37['contact']=_0x3e1943;var _0x3b8b9f=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xaa')];if(_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xab')]){_0x3b8b9f=_0x448379[_0xc5a8('0x8b')]['cf-connecting-ip'];}else if(_0x448379[_0xc5a8('0x8b')]['x-forwarded-for']){_0x3b8b9f=_[_0xc5a8('0xac')](_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xad')]['split'](','));}if(_0x3e1943){var _0x4f245e={'ContactId':_0x3e1943['id'],'ChatWebsiteId':_0x448379[_0xc5a8('0x57')]['id'],'from':(_0x3e1943['firstName']||'')+'\x20'+(_0x3e1943[_0xc5a8('0xae')]||''),'customerIp':_0x3b8b9f,'customerPort':_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xaf')]?_0x448379[_0xc5a8('0x8b')][_0xc5a8('0xaf')]:null,'referer':_0x448379[_0xc5a8('0x5b')]['referer'],'browserName':_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0x3a')]&&_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0xb1')]?util[_0xc5a8('0xb2')](_0xc5a8('0xb3'),_0x1ad5bf['browser']['name'],_0x1ad5bf['browser'][_0xc5a8('0xb1')]):_0xc5a8('0xb4'),'browserVersion':_0x1ad5bf[_0xc5a8('0xb0')][_0xc5a8('0xb1')]||_0xc5a8('0xb4'),'osName':util[_0xc5a8('0xb2')]('%s\x20%s',_0x1ad5bf['os'][_0xc5a8('0x3a')],_0x1ad5bf['os'][_0xc5a8('0xb1')]),'osVersion':_0x1ad5bf['os'][_0xc5a8('0xb1')],'deviceModel':_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0x41')]&&_0x1ad5bf[_0xc5a8('0xb5')]['vendor']?util['format'](_0xc5a8('0xb6'),_0x1ad5bf['device'][_0xc5a8('0x41')],_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0xb7')],_0x1ad5bf['device'][_0xc5a8('0x40')]):null,'deviceVendor':_0x1ad5bf['device'][_0xc5a8('0xb7')],'deviceType':_0x1ad5bf[_0xc5a8('0xb5')][_0xc5a8('0x40')],'formData':JSON[_0xc5a8('0x25')](_0x448379[_0xc5a8('0x5b')])};var _0x49522b={'ChatWebsiteId':_0x448379['params']['id'],'closed':![]};if(_0x448379['body']['threadId']){_0x49522b[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xb8')];return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':_0x49522b})[_0xc5a8('0x34')](function(_0x3db08d){if(_0x3db08d){return[_0x3db08d,![]];}_0x4f245e[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')]['threadId'];_0x4f245e[_0xc5a8('0xba')]=_0x448379[_0xc5a8('0x5b')]['externalUrl'];return db[_0xc5a8('0xb9')]['create'](_0x4f245e)[_0xc5a8('0x34')](function(_0x2ae98a){return[_0x2ae98a,!![]];});});}_0x49522b[_0xc5a8('0xbb')]=_0x3e1943['id'];if(_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]&&_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]['id']){_0x49522b['id']=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbc')]['id'];return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':_0x49522b})[_0xc5a8('0x34')](function(_0x409387){if(_0x409387){return[_0x409387,![]];}return db['ChatInteraction'][_0xc5a8('0x5a')](_0x4f245e)[_0xc5a8('0x34')](function(_0x5a437e){return[_0x5a437e,!![]];});});}return db['ChatInteraction'][_0xc5a8('0x5a')](_0x4f245e)[_0xc5a8('0x34')](function(_0x526539){return[_0x526539,!![]];});}})['spread'](function(_0x757ebd,_0x4cbeed){if(_0x757ebd){_0x131767=_0x4cbeed;if(!_0x4cbeed){var _0x548f92={'from':(_0x1e0b37['contact'][_0xc5a8('0xbd')]||'')+'\x20'+(_0x1e0b37[_0xc5a8('0xbe')][_0xc5a8('0xae')]||'')};if(_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xb8')]&&_0x448379['body'][_0xc5a8('0xbf')]&&_0x448379[_0xc5a8('0x5b')]['threadId']!=_0x448379[_0xc5a8('0x5b')][_0xc5a8('0xbf')]){_0x548f92[_0xc5a8('0xb8')]=_0x448379[_0xc5a8('0x5b')]['messageId'];}return _0x757ebd[_0xc5a8('0x62')](_0x548f92);}else{return _0x757ebd;}}})[_0xc5a8('0x34')](function(_0x534bd2){_0x1e0b37[_0xc5a8('0xbc')]=_0x534bd2['get']({'plain':!![]});_0x1e0b37['interaction'][_0xc5a8('0xc0')]=_0x131767;if(_0x1e0b37[_0xc5a8('0xbc')][_0xc5a8('0xc0')]){if(_0x1e0b37['account'][_0xc5a8('0xc1')]){_0x1e0b37['applications'][_0xc5a8('0xc2')]({'id':0x0,'priority':_0x1e0b37[_0xc5a8('0xa2')][_0xc5a8('0x48')]+0x1,'app':_0xc5a8('0xc3'),'appdata':_0xc5a8('0xc4'),'interval':_0xc5a8('0xc5')});}}return db[_0xc5a8('0xc6')][_0xc5a8('0x5a')]({'body':_0x448379[_0xc5a8('0x5b')]['body'],'ChatWebsiteId':_0x448379[_0xc5a8('0x57')]['id'],'ChatInteractionId':_0x534bd2['id'],'direction':'in','ContactId':_0x1e0b37[_0xc5a8('0xbe')]['id'],'AttachmentId':_0x448379['body']['AttachmentId']});})[_0xc5a8('0x34')](function(_0x726eaa){_0x1e0b37[_0xc5a8('0x27')]=_0x726eaa;if(_0x1e0b37[_0xc5a8('0xbc')][_0xc5a8('0xc7')]){return db[_0xc5a8('0xc8')]['find']({'attributes':['id',_0xc5a8('0x3a')],'where':{'id':_0x1e0b37['interaction']['UserId']}})[_0xc5a8('0x34')](function(_0x5859e5){if(_0x5859e5){_0x1e0b37[_0xc5a8('0xa2')][_0xc5a8('0xc9')]({'id':0x0,'priority':0x0,'app':_0xc5a8('0xca'),'appdata':_0x5859e5[_0xc5a8('0x3a')]+','+(_0x1e0b37['account'][_0xc5a8('0xcb')]||0xa),'interval':_0xc5a8('0xc5')});_0x1e0b37[_0xc5a8('0xcc')]=!![];}return respondWithRpcPromise('Start',_0xc5a8('0xcd'),_0x1e0b37);});}return respondWithRpcPromise(_0xc5a8('0xce'),_0xc5a8('0xcd'),_0x1e0b37);})[_0xc5a8('0x34')](function(_0x15f7b4){respondWithRpcPromise('EventManager','EventManager',{'event':_0xc5a8('0x89'),'message':_0x15f7b4},client9002);return _0x15f7b4;})['then'](respondWithResult(_0x4e034c,null))[_0xc5a8('0x2b')](handleError(_0x4e034c,null));};exports[_0xc5a8('0xcf')]=function(_0x52d081,_0x8a24a2,_0x47fbc7){var _0x415b51,_0x584920,_0x220393;var _0x6981db=[];var _0xd9e10d=[];var _0x10a0bf={};var _0x237438=_0x52d081[_0xc5a8('0xd0')]||[];var _0x47b092=[];var _0xeea48;return db[_0xc5a8('0xa9')][_0xc5a8('0x63')]()[_0xc5a8('0x34')](function(_0x15f4c9){if(!_0x15f4c9){throw new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x90'));}_0xd9e10d=_[_0xc5a8('0x91')](_[_0xc5a8('0x43')](_0x15f4c9),['createdAt',_0xc5a8('0x93')]);_0x6981db=_[_0xc5a8('0x91')](_['keys'](_0x15f4c9),[_0xc5a8('0x92'),_0xc5a8('0x93'),'CompanyId',_0xc5a8('0xa8')]);if(_0x52d081[_0xc5a8('0x5b')]['id']){delete _0x52d081[_0xc5a8('0x5b')]['id'];}if(_['isNil'](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x95')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xc5a8('0x7d')](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x5b')])||_0x52d081[_0xc5a8('0x5b')]['body']===''){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0x97')));}if(_[_0xc5a8('0x7d')](_0x52d081['body'][_0xc5a8('0xd1')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db['Sequelize']['ValidationError'](_0xc5a8('0xd2')+_0x6981db));}if(!_[_0xc5a8('0x9a')](_0x6981db,_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0xd1')])){throw _0x8a24a2[_0xc5a8('0x2c')](0x1f4)[_0xc5a8('0x3b')](new db[(_0xc5a8('0x96'))][(_0xc5a8('0x8f'))](_0xc5a8('0xd3')+_0x6981db));}_0x10a0bf[_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0xd1')]]=_0x52d081['body'][_0xc5a8('0x95')];})['then'](function(){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x52d081[_0xc5a8('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0xc5a8('0x9d')},{'model':db[_0xc5a8('0xd4')],'as':_0xc5a8('0xd4')}]});})['then'](handleEntityNotFound(_0x8a24a2,null))[_0xc5a8('0x34')](function(_0x17459d){if(_0x17459d&&_0x17459d[_0xc5a8('0x9d')]){_0x584920=_0x17459d;var _0x13f4e2=_[_0xc5a8('0xa7')](_0x52d081[_0xc5a8('0x5b')],{'firstName':_0x52d081['body'][_0xc5a8('0x95')],'phone':_0x52d081[_0xc5a8('0x5b')]['from'],'ListId':_0x17459d[_0xc5a8('0xa8')]});_0x13f4e2[_0x52d081['body'][_0xc5a8('0xd1')]]=_0x52d081['body'][_0xc5a8('0x95')];return db[_0xc5a8('0xa9')][_0xc5a8('0xd5')]({'where':_0x10a0bf,'defaults':_0x13f4e2});}})['spread'](function(_0x317cc1){if(_0x317cc1){_0x220393=_0x317cc1;var _0x5bf8fe=fs[_0xc5a8('0xd6')](path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],_0xc5a8('0xd7')),'utf8');var _0x45ff65=ejs['render'](_0x5bf8fe,{'body':_[_0xc5a8('0xd8')](_0x52d081[_0xc5a8('0x5b')][_0xc5a8('0x5b')]),'bodyTitle':_0x584920['offlineMessageBody']});return db[_0xc5a8('0xd9')]['create']({'body':_0x45ff65,'ContactId':_0x317cc1['id'],'ChatWebsiteId':_0x584920['id']});}})['then'](function(_0x1d5734){_0xeea48=_0x1d5734;if(_0x237438[_0xc5a8('0x48')]){var _0x451513=_0x237438[_0xc5a8('0x50')](function(_0x409e66){return{'name':_0x409e66[_0xc5a8('0xda')],'basename':_0x409e66[_0xc5a8('0x72')],'type':_0x409e66[_0xc5a8('0xdb')],'ChatOfflineMessageId':_0x1d5734['id']};});_0x47b092=_0x451513[_0xc5a8('0x50')](_0x471e48=>{var _0x5ecaa1={'filename':_0x471e48['name'],'path':path[_0xc5a8('0x7f')](config[_0xc5a8('0x78')],'server','files','attachments',_0xc5a8('0xdc'),_0x471e48[_0xc5a8('0xdd')])};return _0x5ecaa1;});if(!_0x584920[_0xc5a8('0xde')]){return db[_0xc5a8('0xdf')][_0xc5a8('0xe0')](function(_0xefa1c){return db[_0xc5a8('0xe1')][_0xc5a8('0xe2')](_0x451513,{'transaction':_0xefa1c});});}}})[_0xc5a8('0x34')](function(){if(_0xeea48){_0x415b51=_0xeea48;return db['MailAccount'][_0xc5a8('0x6e')]({'where':{'active':!![]},'include':[{'model':db[_0xc5a8('0xe3')],'as':_0xc5a8('0xe4'),'raw':!![]}]});}})[_0xc5a8('0x34')](function(_0x422a26){if(_0x422a26&&_0x422a26[_0xc5a8('0xe4')]&&_0x584920[_0xc5a8('0xe5')]&&_0x584920[_0xc5a8('0xe6')]){var _0x3accab={'tls':{'rejectUnauthorized':![]}};if(_0x422a26['Smtp']['service']){_0x3accab[_0xc5a8('0xe7')]=_0x422a26['Smtp']['service'];}else{_0x3accab[_0xc5a8('0xe8')]=_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xe8')];_0x3accab[_0xc5a8('0xe9')]=_0x422a26['Smtp'][_0xc5a8('0xe9')];_0x3accab['secure']=_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xea')];}if(_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xeb')]){_0x3accab[_0xc5a8('0xec')]={'user':_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0x5f')],'pass':_0x422a26[_0xc5a8('0xe4')][_0xc5a8('0xed')]};}return respondWithRpcPromise(_0xc5a8('0xee'),_0xc5a8('0xef'),{'account':_0x3accab,'message':{'from':util['format'](_0xc5a8('0xf0'),_0x422a26['name'],_0x422a26[_0xc5a8('0xf1')]||_0x422a26['Smtp'][_0xc5a8('0x5f')]),'to':_0x584920[_0xc5a8('0xe6')],'subject':_0x584920['offlineMessageSubject'],'html':_0x415b51[_0xc5a8('0x5b')],'attachments':_0x47b092}},client9003)['then'](function(){return _0x415b51;})[_0xc5a8('0x2b')](function(_0x327585){console[_0xc5a8('0x26')](_0x327585);});}})['then'](function(){if(_0x584920&&_0x584920['openNewInteraction']&&_0x584920[_0xc5a8('0xf2')]){var _0x1d3f1d=[];if(_0x237438['length']){_0x1d3f1d=_0x237438[_0xc5a8('0x50')](function(_0x50a566){return{'name':_0x50a566['originalname'],'basename':_0x50a566['filename'],'type':_0x50a566[_0xc5a8('0xdb')],'ChatOfflineMessageId':_0xeea48['id']};});}var _0xc0c6b2;if(!_[_0xc5a8('0x7d')](_0x584920['subjectOffline'])){var _0x41cc37=_[_0xc5a8('0x50')](_0x52d081[_0xc5a8('0x5b')],function(_0x50f2cc){return _0x50f2cc;});var _0x1ff035=_[_0xc5a8('0xf3')](_0x41cc37)[0x0];var _0x1e9d35=_[_0xc5a8('0xf4')](_0x1ff035,function(_0x26e7ba){return _0x26e7ba;});_0xc0c6b2=_0x1e9d35[0x1][_0x584920[_0xc5a8('0xf5')]];}var _0x116298={'from':_0x220393['email'],'firstName':_0x220393[_0xc5a8('0xbd')],'lastName':_0x220393[_0xc5a8('0xae')],'mapKey':'email','message':{'from':_0x220393[_0xc5a8('0xf1')],'to':_0x584920[_0xc5a8('0xd4')][_0xc5a8('0xf1')],'cc':'','subject':_[_0xc5a8('0x7d')](_0xc0c6b2)?_0x584920[_0xc5a8('0xf6')]:_0xc0c6b2,'messageId':'','sentAt':new Date(),'attach':_0x1d3f1d['length'],'attachments':_0x1d3f1d,'originChannel':'Chat','ChatWebsiteId':_0x584920['id'],'ChatOfflineMessageId':_0x415b51['id'],'originTo':_0x584920[_0xc5a8('0xd4')]['email']},'body':_0x415b51[_0xc5a8('0x5b')]};var _0x32ecf8={'account':{'id':_0x584920[_0xc5a8('0xf2')]},'body':_0x116298,'log':_0xc5a8('0xf7')};return respondWithRpcPromise(_0xc5a8('0xf7'),_0xc5a8('0xf8'),_0x32ecf8,client9001)[_0xc5a8('0x34')](function(){return _0x415b51;})[_0xc5a8('0x2b')](function(_0x2b2db1){console['error'](_0x2b2db1);});}return;})[_0xc5a8('0x34')](function(){if(_0x415b51){return _0x415b51;}})['then'](respondWithResult(_0x8a24a2,null))[_0xc5a8('0x2b')](function(_0x5839d2){console[_0xc5a8('0x26')](_0xc5a8('0x2b'),_0x5839d2);for(var _0x2659bb of _0x237438){var _0x33ad3f=path['join'](config[_0xc5a8('0x78')],_0xc5a8('0xf9'),_0xc5a8('0xd0'),'attachments',_0xc5a8('0xdc'),_0x2659bb['filename']);fs_extra[_0xc5a8('0xfa')](_0x33ad3f)['catch'](function(_0x32bad5){console[_0xc5a8('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x33ad3f,_0x32bad5);});}});};exports[_0xc5a8('0xfb')]=function(_0x3d0979,_0x167b4c,_0x403ffd){return db[_0xc5a8('0xb9')][_0xc5a8('0x59')]({'where':{'id':_0x3d0979['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x167b4c,null))[_0xc5a8('0x34')](function(_0x18f9e5){if(_0x18f9e5){return _0x18f9e5['addInteraction'](_0x3d0979[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_[_0xc5a8('0xfc')](_0x3d0979[_0xc5a8('0x5b')],['ids','id'])||{});}})[_0xc5a8('0x34')](respondWithResult(_0x167b4c,null))[_0xc5a8('0x2b')](handleError(_0x167b4c,null));};exports[_0xc5a8('0xfd')]=function(_0x292a79,_0xf36d85,_0x1d8d68){var _0xaa0c6b={'raw':![],'where':{}};var _0x4df2f5={};var _0x5c02d2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc5a8('0x6e')]({'where':{'id':_0x292a79['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0xf36d85,null))[_0xc5a8('0x34')](function(_0x36dfaf){if(_0x36dfaf){_0x4df2f5[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0xb9')][_0xc5a8('0x3f')]);_0x4df2f5[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x292a79[_0xc5a8('0x42')]);_0x4df2f5[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x4df2f5['model'],_0x4df2f5[_0xc5a8('0x42')]);_0xaa0c6b[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x4df2f5[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x292a79['query'][_0xc5a8('0x47')]));_0xaa0c6b['attributes']=_0xaa0c6b['attributes'][_0xc5a8('0x48')]?_0xaa0c6b[_0xc5a8('0x45')]:_0x4df2f5[_0xc5a8('0x41')];if(!_0x292a79[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0xaa0c6b['limit']=qs['limit'](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0xaa0c6b['offset']=qs['offset'](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0xaa0c6b[_0xc5a8('0x68')]=qs[_0xc5a8('0x4b')](_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0xaa0c6b[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x292a79[_0xc5a8('0x42')],_0x4df2f5[_0xc5a8('0x44')]));_0xaa0c6b['where']['ChatWebsiteId']=_0x36dfaf['id'];if(_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0xaa0c6b['where']=_[_0xc5a8('0x4f')](_0xaa0c6b[_0xc5a8('0x4c')],{'$or':_['map'](_0xaa0c6b[_0xc5a8('0x45')],function(_0x41d811){var _0x59d419={};_0x59d419[_0x41d811]={'$like':'%'+_0x292a79['query'][_0xc5a8('0x4e')]+'%'};return _0x59d419;})});}_0xaa0c6b=_[_0xc5a8('0x4f')]({},_0xaa0c6b,_0x292a79[_0xc5a8('0x52')]);return db['ChatInteraction'][_0xc5a8('0x30')]({'where':_0xaa0c6b[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0x110fa6){_0x5c02d2[_0xc5a8('0x30')]=_0x110fa6;if(_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x54')]){_0xaa0c6b[_0xc5a8('0x58')]=[{'model':db[_0xc5a8('0xa9')],'as':_0xc5a8('0xff'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xc5a8('0x3a'),_0xc5a8('0x100'),_0xc5a8('0x101')],'required':![]},{'model':db[_0xc5a8('0x102')],'as':_0xc5a8('0x103'),'attributes':['id',_0xc5a8('0x3a'),_0xc5a8('0x104')],'where':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]?{'id':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]}:undefined,'required':_0x292a79[_0xc5a8('0x42')][_0xc5a8('0x105')]?!![]:![]}];}return db[_0xc5a8('0xb9')][_0xc5a8('0x55')](_0xaa0c6b);})[_0xc5a8('0x34')](function(_0x47f8da){_0x5c02d2['rows']=_0x47f8da;return _0x5c02d2;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0xf36d85,_0xaa0c6b))['catch'](handleError(_0xf36d85,null));};function iftimePromise(_0x1c4382,_0x6ea44c){return respondWithRpcPromise(_0xc5a8('0x106'),_0xc5a8('0x107'),{'command':_0x6ea44c['timezone']?util[_0xc5a8('0xb2')](_0xc5a8('0x108'),_0x1c4382[_0xc5a8('0x109')],_0x6ea44c['timezone']):util[_0xc5a8('0xb2')]('iftime\x20%s',_0x1c4382['interval'])},client9002)[_0xc5a8('0x34')](function(_0x483bff){var _0x3ccea9=_0x483bff&&_0x483bff[_0xc5a8('0x10a')](_0xc5a8('0x10b'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x6ea44c['id'],_0x1c4382['id'],_0x1c4382[_0xc5a8('0x109')],_0x3ccea9?_0xc5a8('0x10c'):_0xc5a8('0x10d'),_0x6ea44c[_0xc5a8('0x10e')]?_0x6ea44c['timezone']:_0xc5a8('0x10f'));return _0x3ccea9;})[_0xc5a8('0x2b')](function(_0x342a7d){logger['error'](_0xc5a8('0x110'),_0x6ea44c['id'],_0x1c4382['id'],_0x1c4382['interval'],util[_0xc5a8('0x111')](_0x342a7d,{'showHidden':![],'depth':null}),_0x6ea44c['timezone']?_0x6ea44c[_0xc5a8('0x10e')]:_0xc5a8('0x10f'));return![];});}exports[_0xc5a8('0x107')]=function(_0x3876f8,_0x9fd6f2,_0x1d482c){var _0xf454b5=0x0;var _0xf96dc8=0x0;var _0x302333=![];var _0x15de74;var _0x52239f;return db['ChatWebsite'][_0xc5a8('0x59')]({'where':{'id':_0x3876f8[_0xc5a8('0x57')]['id']},'include':[{'model':db[_0xc5a8('0x112')],'as':'Interval','include':[{'model':db[_0xc5a8('0x112')],'as':_0xc5a8('0x113'),'attributes':['id',_0xc5a8('0x109')],'raw':!![]}]}]})[_0xc5a8('0x34')](handleEntityNotFound(_0x9fd6f2,null))[_0xc5a8('0x34')](function(_0x4daeff){if(_0x4daeff){_0x15de74=_0x4daeff;return _0x4daeff['getProactiveActions']({'raw':!![]});}})[_0xc5a8('0x34')](function(_0x59d18c){if(_0x15de74){if(_0x59d18c){_0x52239f=_0x59d18c;}}return require(_0xc5a8('0x7a'))[_0xc5a8('0x7b')]();})[_0xc5a8('0x34')](function(_0x34eb0f){if(_0x34eb0f){_0xf96dc8=_0x34eb0f['virtual'];_0x302333=_0x34eb0f[_0xc5a8('0x7c')];}})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0xb9')][_0xc5a8('0x30')]({'where':{'closed':![]}});})[_0xc5a8('0x34')](function(_0x4e8cd1){_0xf454b5=_0x4e8cd1;if(_0xf96dc8&&_0x4e8cd1>_0xf96dc8){return db[_0xc5a8('0x114')][_0xc5a8('0x6e')]({'where':{'id':0x1}})[_0xc5a8('0x34')](function(_0x80cefb){if(_0x80cefb){_0x80cefb[_0xc5a8('0x115')](_0xc5a8('0x116'));}});}})[_0xc5a8('0x34')](function(){if(_0x15de74[_0xc5a8('0x112')]&&_0x15de74[_0xc5a8('0x112')]['Intervals']){var _0x4a3214=[];for(var _0x5b2f68=0x0;_0x5b2f68<_0x15de74[_0xc5a8('0x112')]['Intervals'][_0xc5a8('0x48')];_0x5b2f68++){var _0x501dcf=_0x15de74[_0xc5a8('0x112')][_0xc5a8('0x113')][_0x5b2f68][_0xc5a8('0x5c')]({'plain':!![]});_0x4a3214[_0xc5a8('0xc2')](iftimePromise(_0x501dcf,_0x15de74));}return BPromise[_0xc5a8('0x117')](_0x4a3214)[_0xc5a8('0x34')](function(_0x3e4e5f){return _[_0xc5a8('0x118')](_0x3e4e5f);});}else{return!![];}})[_0xc5a8('0x34')](function(_0x2bb2b2){var _0x5903be=fs[_0xc5a8('0xd6')](path[_0xc5a8('0x7f')](config['root'],_0xc5a8('0x119')),_0xc5a8('0x11a'));var _0x55680e={'remote':_0x15de74['remote'],'query':querystring[_0xc5a8('0x25')](_['merge'](_0x15de74['get']({'plain':!![]}),{'customerIp':_0x3876f8[_0xc5a8('0x8b')][_0xc5a8('0xad')]||_0x3876f8[_0xc5a8('0x8b')][_0xc5a8('0x11b')]||_0x3876f8['connection']['remoteAddress']||_0x3876f8['ip'],'referer':_0x3876f8['headers'][_0xc5a8('0x11c')],'openedInteractions':_0xf454b5,'maxInteractions':_0xf96dc8,'virtual':_0x302333[_0xc5a8('0x11d')],'online':_0x2bb2b2,'custom':_0x302333}))['replace'](/'/g,'\x5c\x27')};_0x9fd6f2[_0xc5a8('0x3b')](ejs[_0xc5a8('0x11e')](Mustache[_0xc5a8('0x11e')](_0x5903be,_0x55680e),{'proactiveActions':_0x52239f,'alignment':_0x15de74['alignment'],'verticalAlignment':_0x15de74['verticalAlignment'],'div_color':_0x15de74['color'],'text_color':_0x15de74[_0xc5a8('0x11f')],'button_color':_0x15de74[_0xc5a8('0x120')],'background_color':_0x15de74[_0xc5a8('0x121')]}));})[_0xc5a8('0x2b')](handleError(_0x9fd6f2,null));};exports['addApplications']=function(_0x58f01c,_0x25d6b4,_0x172cde){return db[_0xc5a8('0x53')]['findOne']({'where':{'id':_0x58f01c['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x25d6b4,null))['then'](function(_0x35809f){if(_0x35809f){return db[_0xc5a8('0xdf')]['transaction'](function(_0x429059){return db[_0xc5a8('0x122')][_0xc5a8('0x35')]({'where':{'ChatWebsiteId':_0x58f01c[_0xc5a8('0x57')]['id']},'transaction':_0x429059})[_0xc5a8('0x34')](function(_0xd81997){var _0x412ef6=_[_0xc5a8('0x50')](_0x58f01c['body'],function(_0x5ebf26){_0x5ebf26[_0xc5a8('0x65')]=_0x58f01c[_0xc5a8('0x57')]['id'];return _0x5ebf26;});return db['ChatApplication'][_0xc5a8('0xe2')](_0x412ef6,{'transaction':_0x429059});});})[_0xc5a8('0x34')](function(){return db[_0xc5a8('0x122')][_0xc5a8('0x123')]({'where':{'ChatWebsiteId':_0x58f01c[_0xc5a8('0x57')]['id']},'order':_0xc5a8('0xa5')});});}})[_0xc5a8('0x34')](respondWithResult(_0x25d6b4,null))[_0xc5a8('0x2b')](handleError(_0x25d6b4,null));};exports[_0xc5a8('0x124')]=function(_0x20ed33,_0xc26ee6,_0x47b320){var _0x4a366f={};var _0x19a28d={};var _0x2aec45;var _0x382880;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x20ed33[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0xc26ee6,null))[_0xc5a8('0x34')](function(_0x318982){if(_0x318982){_0x2aec45=_0x318982;_0x19a28d[_0xc5a8('0x41')]=_[_0xc5a8('0x43')](db[_0xc5a8('0x122')][_0xc5a8('0x3f')]);_0x19a28d[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x20ed33[_0xc5a8('0x42')]);_0x19a28d['filters']=_[_0xc5a8('0x46')](_0x19a28d[_0xc5a8('0x41')],_0x19a28d[_0xc5a8('0x42')]);_0x4a366f[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x19a28d[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4a366f['attributes']=_0x4a366f['attributes'][_0xc5a8('0x48')]?_0x4a366f['attributes']:_0x19a28d['model'];_0x4a366f[_0xc5a8('0x68')]=qs['sort'](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4a366f[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x20ed33[_0xc5a8('0x42')],_0x19a28d[_0xc5a8('0x44')]));if(_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4a366f['where']=_[_0xc5a8('0x4f')](_0x4a366f['where'],{'$or':_['map'](_0x4a366f[_0xc5a8('0x45')],function(_0x1d95d1){var _0x257fa3={};_0x257fa3[_0x1d95d1]={'$like':'%'+_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x257fa3;})});}_0x4a366f=_[_0xc5a8('0x4f')]({},_0x4a366f,_0x20ed33[_0xc5a8('0x52')]);return _0x2aec45[_0xc5a8('0x124')](_0x4a366f);}})[_0xc5a8('0x34')](function(_0x41ffd8){if(_0x41ffd8){_0x382880=_0x41ffd8['length'];if(!_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x4a366f[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x20ed33[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x4a366f[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x20ed33['query'][_0xc5a8('0x4a')]);}return _0x2aec45[_0xc5a8('0x124')](_0x4a366f);}})[_0xc5a8('0x34')](function(_0x37044d){if(_0x37044d){return _0x37044d?{'count':_0x382880,'rows':_0x37044d}:null;}})[_0xc5a8('0x34')](respondWithResult(_0xc26ee6,null))[_0xc5a8('0x2b')](handleError(_0xc26ee6,null));};exports[_0xc5a8('0x125')]=function(_0xbb0436,_0x1c8a34,_0xefb1ba){return db[_0xc5a8('0x126')][_0xc5a8('0x59')]({'where':{'id':_0xbb0436[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x1c8a34,null))[_0xc5a8('0x34')](function(_0x2da250){if(_0x2da250){return _0x2da250[_0xc5a8('0x125')](_0xbb0436[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_['omit'](_0xbb0436[_0xc5a8('0x5b')],[_0xc5a8('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x1c8a34,null))[_0xc5a8('0x2b')](handleError(_0x1c8a34,null));};exports[_0xc5a8('0x127')]=function(_0x180678,_0x8097b7,_0x2fdfc2){var _0x4e60b0={};var _0x2bbad6={};var _0xe4b41f;var _0x507ee5;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x180678[_0xc5a8('0x57')]['id']}})['then'](handleEntityNotFound(_0x8097b7,null))[_0xc5a8('0x34')](function(_0x8910e6){if(_0x8910e6){_0xe4b41f=_0x8910e6;_0x2bbad6['model']=_[_0xc5a8('0x43')](db[_0xc5a8('0x128')][_0xc5a8('0x3f')]);_0x2bbad6[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x180678[_0xc5a8('0x42')]);_0x2bbad6['filters']=_['intersection'](_0x2bbad6['model'],_0x2bbad6['query']);_0x4e60b0[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x2bbad6[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x4e60b0['attributes']=_0x4e60b0[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x4e60b0[_0xc5a8('0x45')]:_0x2bbad6[_0xc5a8('0x41')];_0x4e60b0['order']=qs[_0xc5a8('0x4b')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4b')]);_0x4e60b0[_0xc5a8('0x4c')]=qs[_0xc5a8('0x44')](_['pick'](_0x180678[_0xc5a8('0x42')],_0x2bbad6[_0xc5a8('0x44')]));if(_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4e')]){_0x4e60b0['where']=_[_0xc5a8('0x4f')](_0x4e60b0[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x4e60b0[_0xc5a8('0x45')],function(_0x47b849){var _0x3180bf={};_0x3180bf[_0x47b849]={'$like':'%'+_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x3180bf;})});}_0x4e60b0=_[_0xc5a8('0x4f')]({},_0x4e60b0,_0x180678[_0xc5a8('0x52')]);return _0xe4b41f[_0xc5a8('0x127')](_0x4e60b0);}})['then'](function(_0x1fc6ce){if(_0x1fc6ce){_0x507ee5=_0x1fc6ce[_0xc5a8('0x48')];if(!_0x180678[_0xc5a8('0x42')][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x4e60b0[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x180678['query']['limit']);_0x4e60b0[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x180678[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}return _0xe4b41f['getProactiveActions'](_0x4e60b0);}})[_0xc5a8('0x34')](function(_0x2f0b09){if(_0x2f0b09){return _0x2f0b09?{'count':_0x507ee5,'rows':_0x2f0b09}:null;}})[_0xc5a8('0x34')](respondWithResult(_0x8097b7,null))[_0xc5a8('0x2b')](handleError(_0x8097b7,null));};exports[_0xc5a8('0x129')]=function(_0x143d5b,_0x183f80,_0x13c5a6){var _0x98e31d=_0x143d5b[_0xc5a8('0x42')][_0xc5a8('0x12a')]===_0xc5a8('0x12b')?_0xc5a8('0x12c'):_0xc5a8('0x12d');return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'attributes':['id',_0x98e31d],'where':{'id':_0x143d5b[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x183f80,null))['then'](function(_0x24a61a){if(_0x24a61a){var _0x4639e0=_0x24a61a[_0x98e31d];var _0x2eaa8a=_0x4639e0&&_0x4639e0[_0xc5a8('0x12e')]?_0x4639e0[_0xc5a8('0x12e')]:[];_0x183f80[_0xc5a8('0x3b')]({'fromKey':_[_0xc5a8('0x7d')](_0x4639e0[_0xc5a8('0x12f')])?undefined:_0x4639e0[_0xc5a8('0x12f')],'count':_0x2eaa8a[_0xc5a8('0x48')],'rows':_0x2eaa8a});}})[_0xc5a8('0x2b')](handleError(_0x183f80,null));};exports[_0xc5a8('0x130')]=function(_0x49b92d,_0x3d35cb,_0x581904){var _0x3ae47a={'raw':![],'where':{}};var _0x1ed2fd={};var _0xed2ec8={'count':0x0,'rows':[]};return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x49b92d[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x3d35cb,null))[_0xc5a8('0x34')](function(_0x4c59de){if(_0x4c59de){_0x1ed2fd[_0xc5a8('0x41')]=_['keys'](db[_0xc5a8('0xd9')][_0xc5a8('0x3f')]);_0x1ed2fd[_0xc5a8('0x42')]=_['keys'](_0x49b92d[_0xc5a8('0x42')]);_0x1ed2fd[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x1ed2fd['model'],_0x1ed2fd['query']);_0x3ae47a[_0xc5a8('0x45')]=_[_0xc5a8('0x46')](_0x1ed2fd[_0xc5a8('0x41')],qs[_0xc5a8('0x47')](_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x3ae47a[_0xc5a8('0x45')]=_0x3ae47a['attributes']['length']?_0x3ae47a[_0xc5a8('0x45')]:_0x1ed2fd[_0xc5a8('0x41')];if(!_0x49b92d['query'][_0xc5a8('0xfe')](_0xc5a8('0x49'))){_0x3ae47a[_0xc5a8('0x2f')]=qs[_0xc5a8('0x2f')](_0x49b92d['query'][_0xc5a8('0x2f')]);_0x3ae47a[_0xc5a8('0x4a')]=qs['offset'](_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x4a')]);}_0x3ae47a['order']=qs[_0xc5a8('0x4b')](_0x49b92d[_0xc5a8('0x42')]['sort']);_0x3ae47a[_0xc5a8('0x4c')]=qs['filters'](_['pick'](_0x49b92d['query'],_0x1ed2fd[_0xc5a8('0x44')]));_0x3ae47a['where'][_0xc5a8('0x65')]=_0x4c59de['id'];if(_0x49b92d[_0xc5a8('0x42')]['filter']){_0x3ae47a[_0xc5a8('0x4c')]=_[_0xc5a8('0x4f')](_0x3ae47a[_0xc5a8('0x4c')],{'$or':_['map'](_0x3ae47a['attributes'],function(_0x5f4c67){var _0x34a651={};_0x34a651[_0x5f4c67]={'$like':'%'+_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x4e')]+'%'};return _0x34a651;})});}_0x3ae47a=_[_0xc5a8('0x4f')]({},_0x3ae47a,_0x49b92d[_0xc5a8('0x52')]);return db['ChatOfflineMessage'][_0xc5a8('0x30')]({'where':_0x3ae47a[_0xc5a8('0x4c')]})[_0xc5a8('0x34')](function(_0xaae80e){_0xed2ec8[_0xc5a8('0x30')]=_0xaae80e;if(_0x49b92d[_0xc5a8('0x42')][_0xc5a8('0x54')]){_0x3ae47a[_0xc5a8('0x58')]=[{'all':!![]}];}else{_0x3ae47a[_0xc5a8('0x58')]=[{'model':db[_0xc5a8('0xa9')],'as':'Contact','required':![]},{'model':db[_0xc5a8('0xe1')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3ae47a);})[_0xc5a8('0x34')](function(_0x3e0282){_0xed2ec8[_0xc5a8('0x69')]=_0x3e0282;return _0xed2ec8;});}})[_0xc5a8('0x34')](respondWithFilteredResult(_0x3d35cb,_0x3ae47a))['catch'](handleError(_0x3d35cb,null));};exports[_0xc5a8('0x131')]=function(_0xf47d84,_0xeeafeb,_0x392297){return db['ChatWebsite']['find']({'where':{'id':_0xf47d84['params']['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0xeeafeb,null))[_0xc5a8('0x34')](function(_0x44a909){if(_0x44a909){return _0x44a909[_0xc5a8('0x131')](_0xf47d84[_0xc5a8('0x5b')][_0xc5a8('0x6b')],_[_0xc5a8('0xfc')](_0xf47d84['body'],[_0xc5a8('0x6b'),'id'])||{})[_0xc5a8('0x132')](function(_0x3ccd7e){for(var _0x5bbc2b=0x0;_0x5bbc2b<_0xf47d84[_0xc5a8('0x5b')]['ids']['length'];_0x5bbc2b+=0x1){socket[_0xc5a8('0x133')](_0xc5a8('0x134'),{'UserId':Number(_0xf47d84[_0xc5a8('0x5b')]['ids'][_0x5bbc2b]),'ChatWebsiteId':Number(_0xf47d84[_0xc5a8('0x57')]['id'])});}return _0x3ccd7e;});}})[_0xc5a8('0x34')](respondWithResult(_0xeeafeb,null))[_0xc5a8('0x2b')](handleError(_0xeeafeb,null));};exports[_0xc5a8('0x135')]=function(_0x27675b,_0x4a1019,_0x332bdd){return db[_0xc5a8('0x53')][_0xc5a8('0x59')]({'where':{'id':_0x27675b[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x4a1019,null))[_0xc5a8('0x34')](function(_0x3c4a1a){if(_0x3c4a1a){return _0x3c4a1a[_0xc5a8('0x135')](_0x27675b[_0xc5a8('0x42')]['ids'])[_0xc5a8('0x34')](function(){if(_[_0xc5a8('0x136')](_0x27675b[_0xc5a8('0x42')][_0xc5a8('0x6b')])){for(var _0x58d6ef=0x0;_0x58d6ef<_0x27675b['query'][_0xc5a8('0x6b')][_0xc5a8('0x48')];_0x58d6ef+=0x1){socket[_0xc5a8('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x27675b[_0xc5a8('0x42')][_0xc5a8('0x6b')][_0x58d6ef]),'ChatWebsiteId':Number(_0x27675b[_0xc5a8('0x57')]['id'])});}}else{socket['emit'](_0xc5a8('0x137'),{'UserId':Number(_0x27675b['query']['ids']),'ChatWebsiteId':Number(_0x27675b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4a1019,null))['catch'](handleError(_0x4a1019,null));};exports['getAgents']=function(_0x5c75fc,_0x9796e8,_0x2ba712){var _0x149924={};var _0x368f63={};var _0x56ff61;var _0x496cd2;return db[_0xc5a8('0x53')][_0xc5a8('0x6e')]({'where':{'id':_0x5c75fc[_0xc5a8('0x57')]['id']}})[_0xc5a8('0x34')](handleEntityNotFound(_0x9796e8,null))['then'](function(_0xf58d9a){if(_0xf58d9a){_0x56ff61=_0xf58d9a;_0x368f63[_0xc5a8('0x41')]=_['keys'](db[_0xc5a8('0xc8')][_0xc5a8('0x3f')]);_0x368f63[_0xc5a8('0x42')]=_[_0xc5a8('0x43')](_0x5c75fc[_0xc5a8('0x42')]);_0x368f63[_0xc5a8('0x44')]=_[_0xc5a8('0x46')](_0x368f63[_0xc5a8('0x41')],_0x368f63[_0xc5a8('0x42')]);_0x149924['attributes']=_['intersection'](_0x368f63['model'],qs[_0xc5a8('0x47')](_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0x47')]));_0x149924[_0xc5a8('0x45')]=_0x149924[_0xc5a8('0x45')][_0xc5a8('0x48')]?_0x149924[_0xc5a8('0x45')]:_0x368f63[_0xc5a8('0x41')];_0x149924[_0xc5a8('0x68')]=qs['sort'](_0x5c75fc[_0xc5a8('0x42')]['sort']);_0x149924['where']=qs['filters'](_[_0xc5a8('0x4d')](_0x5c75fc['query'],_0x368f63['filters']));if(_0x5c75fc['query'][_0xc5a8('0x4e')]){_0x149924[_0xc5a8('0x4c')]=_['merge'](_0x149924[_0xc5a8('0x4c')],{'$or':_[_0xc5a8('0x50')](_0x149924[_0xc5a8('0x45')],function(_0x1070b0){var _0x302ab5={};_0x302ab5[_0x1070b0]={'$like':'%'+_0x5c75fc[_0xc5a8('0x42')]['filter']+'%'};return _0x302ab5;})});}_0x149924=_[_0xc5a8('0x4f')]({},_0x149924,_0x5c75fc['options']);return _0x56ff61[_0xc5a8('0x138')](_0x149924);}})[_0xc5a8('0x34')](function(_0x3b3bb1){if(_0x3b3bb1){_0x496cd2=_0x3b3bb1[_0xc5a8('0x48')];if(!_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0xfe')]('nolimit')){_0x149924['limit']=qs[_0xc5a8('0x2f')](_0x5c75fc[_0xc5a8('0x42')][_0xc5a8('0x2f')]);_0x149924[_0xc5a8('0x4a')]=qs[_0xc5a8('0x4a')](_0x5c75fc['query'][_0xc5a8('0x4a')]);}return _0x56ff61[_0xc5a8('0x138')](_0x149924);}})[_0xc5a8('0x34')](function(_0x3b9418){if(_0x3b9418){return _0x3b9418?{'count':_0x496cd2,'rows':_0x3b9418}:null;}})[_0xc5a8('0x34')](respondWithResult(_0x9796e8,null))[_0xc5a8('0x2b')](handleError(_0x9796e8,null));}; \ No newline at end of file +var _0x002c=['role','user','ChatWebsites','UserProfileSection','userProfileId','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','applications','list','orderBy','priority','account','Applications','from','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','contact','messageId','created','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','EventManager','offline','updatedAt','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','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','omit','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','render','alignment','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','UserProfileResource','destroy','stack','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x53e601,_0x491aa5){var _0x1959f3=function(_0x36a1ad){while(--_0x36a1ad){_0x53e601['push'](_0x53e601['shift']());}};_0x1959f3(++_0x491aa5);}(_0x002c,0xce));var _0xc002=function(_0x564878,_0x32b7db){_0x564878=_0x564878-0x0;var _0x26e2fb=_0x002c[_0x564878];return _0x26e2fb;};'use strict';var emlformat=require(_0xc002('0x0'));var rimraf=require(_0xc002('0x1'));var zipdir=require(_0xc002('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc002('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc002('0x4'));var sox=require('sox');var csv=require(_0xc002('0x5'));var ejs=require(_0xc002('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc002('0x7'));var jsforce=require(_0xc002('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc002('0x9'));var Papa=require(_0xc002('0xa'));var Redis=require('ioredis');var authService=require(_0xc002('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xc002('0xc'));var hardwareService=require(_0xc002('0xd'));var logger=require(_0xc002('0xe'))('api');var utils=require(_0xc002('0xf'));var config=require(_0xc002('0x10'));var licenseUtil=require(_0xc002('0x11'));var db=require(_0xc002('0x12'))['db'];config[_0xc002('0x13')]=_[_0xc002('0x14')](config[_0xc002('0x13')],{'host':_0xc002('0x15'),'port':0x18eb});var socket=require(_0xc002('0x16'))(new Redis(config[_0xc002('0x13')]));require(_0xc002('0x17'))[_0xc002('0x18')](socket);var jayson=require(_0xc002('0x19'));var client=jayson[_0xc002('0x1a')][_0xc002('0x1b')]({'port':0x232c});var client9002=jayson[_0xc002('0x1a')]['http']({'port':0x232a});var client9003=jayson[_0xc002('0x1a')][_0xc002('0x1b')]({'port':0x232b});var client9001=jayson[_0xc002('0x1a')][_0xc002('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x3165b5,_0x2f0786,_0x66f5dc,_0x18d6c6){return new BPromise(function(_0x1ec3aa,_0x11cfd1){var _0x31d783=_0x18d6c6||client;return _0x31d783['request'](_0x3165b5,_0x66f5dc)[_0xc002('0x1c')](function(_0x1cc82c){logger[_0xc002('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x2f0786,_0xc002('0x1e'));logger['debug'](_0xc002('0x1f'),_0x2f0786,_0xc002('0x1e'),JSON[_0xc002('0x20')](_0x1cc82c));if(_0x1cc82c[_0xc002('0x21')]){if(_0x1cc82c['error'][_0xc002('0x22')]===0x1f4){logger['error'](_0xc002('0x23'),_0x2f0786,_0x1cc82c[_0xc002('0x21')][_0xc002('0x24')]);return _0x11cfd1(_0x1cc82c[_0xc002('0x21')]['message']);}logger[_0xc002('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x2f0786,_0x1cc82c[_0xc002('0x21')]['message']);return _0x1ec3aa(_0x1cc82c['error'][_0xc002('0x24')]);}else{logger[_0xc002('0x1d')](_0xc002('0x23'),_0x2f0786,'request\x20sent');_0x1ec3aa(_0x1cc82c[_0xc002('0x25')]['message']);}})[_0xc002('0x26')](function(_0x4cf298){logger[_0xc002('0x21')](_0xc002('0x23'),_0x2f0786,_0x4cf298);_0x11cfd1(_0x4cf298);});});}function respondWithStatusCode(_0x34b1d3,_0x240ecc){_0x240ecc=_0x240ecc||0xcc;return function(_0xbf6c68){if(_0xbf6c68){return _0x34b1d3[_0xc002('0x27')](_0x240ecc);}return _0x34b1d3[_0xc002('0x28')](_0x240ecc)['end']();};}function respondWithResult(_0x3c78b3,_0xe0aa21){_0xe0aa21=_0xe0aa21||0xc8;return function(_0x454a2a){if(_0x454a2a){return _0x3c78b3[_0xc002('0x28')](_0xe0aa21)[_0xc002('0x29')](_0x454a2a);}};}function respondWithFilteredResult(_0x50bb33,_0xfd0674){return function(_0x1631b7){if(_0x1631b7){var _0x4c7416=typeof _0xfd0674[_0xc002('0x2a')]===_0xc002('0x2b')&&typeof _0xfd0674[_0xc002('0x2c')]==='undefined';var _0x5090fe=_0x1631b7[_0xc002('0x2d')];var _0x3b5e3b=_0x4c7416?0x0:_0xfd0674[_0xc002('0x2a')];var _0x197737=_0x4c7416?_0x1631b7['count']:_0xfd0674[_0xc002('0x2a')]+_0xfd0674[_0xc002('0x2c')];var _0x582d18;if(_0x197737>=_0x5090fe){_0x197737=_0x5090fe;_0x582d18=0xc8;}else{_0x582d18=0xce;}_0x50bb33[_0xc002('0x28')](_0x582d18);return _0x50bb33[_0xc002('0x2e')](_0xc002('0x2f'),_0x3b5e3b+'-'+_0x197737+'/'+_0x5090fe)[_0xc002('0x29')](_0x1631b7);}return null;};}function patchUpdates(_0x2cbaf8){return function(_0x41f2e1){try{jsonpatch[_0xc002('0x30')](_0x41f2e1,_0x2cbaf8,!![]);}catch(_0x90be77){return BPromise[_0xc002('0x31')](_0x90be77);}return _0x41f2e1['save']();};}function saveUpdates(_0x2edc83,_0x2f3078){return function(_0x24cea1){if(_0x24cea1){return _0x24cea1[_0xc002('0x32')](_0x2edc83)[_0xc002('0x1c')](function(_0x5008d2){return _0x5008d2;});}return null;};}function removeEntity(_0x502fe5,_0xfd0494){return function(_0x5c55eb){if(_0x5c55eb){return _0x5c55eb['destroy']()['then'](function(){var _0x224e59=_0x5c55eb[_0xc002('0x33')]({'plain':!![]});var _0x127d19='ChatWebsites';return db[_0xc002('0x34')][_0xc002('0x35')]({'where':{'type':_0x127d19,'resourceId':_0x224e59['id']}})['then'](function(){return _0x5c55eb;});})['then'](function(){_0x502fe5[_0xc002('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec27a,_0x1665ce){return function(_0x505d2c){if(!_0x505d2c){_0x4ec27a[_0xc002('0x27')](0x194);}return _0x505d2c;};}function handleError(_0x31ca40,_0x2cdedc){_0x2cdedc=_0x2cdedc||0x1f4;return function(_0x3f1d06){logger[_0xc002('0x21')](_0x3f1d06[_0xc002('0x36')]);if(_0x3f1d06['name']){delete _0x3f1d06['name'];}_0x31ca40[_0xc002('0x28')](_0x2cdedc)[_0xc002('0x37')](_0x3f1d06);};}exports[_0xc002('0x38')]=function(_0x16f95,_0x21f7f8){var _0x54238f={'include':[{'model':db[_0xc002('0x39')],'as':_0xc002('0x3a')}]},_0x349634={},_0x1e637c={'count':0x0,'rows':[]};var _0x330d68=_['map'](db[_0xc002('0x3b')][_0xc002('0x3c')],function(_0x2885e4){return{'name':_0x2885e4['fieldName'],'type':_0x2885e4[_0xc002('0x3d')][_0xc002('0x3e')]};});_0x349634['model']=_[_0xc002('0x3f')](_0x330d68,_0xc002('0x40'));_0x349634[_0xc002('0x41')]=_[_0xc002('0x42')](_0x16f95[_0xc002('0x41')]);_0x349634[_0xc002('0x43')]=_[_0xc002('0x44')](_0x349634[_0xc002('0x45')],_0x349634[_0xc002('0x41')]);_0x54238f[_0xc002('0x46')]=_[_0xc002('0x44')](_0x349634[_0xc002('0x45')],qs[_0xc002('0x47')](_0x16f95['query'][_0xc002('0x47')]));_0x54238f[_0xc002('0x46')]=_0x54238f['attributes'][_0xc002('0x48')]?_0x54238f[_0xc002('0x46')]:_0x349634[_0xc002('0x45')];if(!_0x16f95[_0xc002('0x41')][_0xc002('0x49')](_0xc002('0x4a'))){_0x54238f['limit']=qs[_0xc002('0x2c')](_0x16f95['query'][_0xc002('0x2c')]);_0x54238f[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x16f95['query'][_0xc002('0x2a')]);}_0x54238f['order']=qs[_0xc002('0x4b')](_0x16f95[_0xc002('0x41')][_0xc002('0x4b')]);_0x54238f[_0xc002('0x4c')]=qs[_0xc002('0x43')](_[_0xc002('0x4d')](_0x16f95['query'],_0x349634[_0xc002('0x43')]),_0x330d68);if(_0x16f95[_0xc002('0x41')][_0xc002('0x4e')]){_0x54238f[_0xc002('0x4c')]=_[_0xc002('0x4f')](_0x54238f[_0xc002('0x4c')],{'$or':_[_0xc002('0x3f')](_0x330d68,function(_0x346da3){if(_0x346da3[_0xc002('0x3d')]!==_0xc002('0x50')){var _0xbbd146={};_0xbbd146[_0x346da3[_0xc002('0x40')]]={'$like':'%'+_0x16f95[_0xc002('0x41')][_0xc002('0x4e')]+'%'};return _0xbbd146;}})});}_0x54238f=_[_0xc002('0x4f')]({},_0x54238f,_0x16f95[_0xc002('0x51')]);var _0x475486={'where':_0x54238f[_0xc002('0x4c')]};return db['ChatWebsite'][_0xc002('0x2d')](_0x475486)[_0xc002('0x1c')](function(_0x2e1756){_0x1e637c[_0xc002('0x2d')]=_0x2e1756;if(_0x16f95['query'][_0xc002('0x52')]){_0x54238f[_0xc002('0x53')]=[{'all':!![]}];}return db[_0xc002('0x3b')][_0xc002('0x54')](_0x54238f);})[_0xc002('0x1c')](function(_0x5daa46){_0x1e637c[_0xc002('0x55')]=_0x5daa46;return _0x1e637c;})[_0xc002('0x1c')](respondWithFilteredResult(_0x21f7f8,_0x54238f))[_0xc002('0x26')](handleError(_0x21f7f8,null));};exports[_0xc002('0x56')]=function(_0x16dd2c,_0x4ce3d8){var _0x2dd1cf={'raw':![],'where':{'id':_0x16dd2c['params']['id']},'include':[{'model':db['Pause'],'as':_0xc002('0x3a')}]},_0x3bca06={};_0x3bca06[_0xc002('0x45')]=_[_0xc002('0x42')](db[_0xc002('0x3b')][_0xc002('0x3c')]);_0x3bca06[_0xc002('0x41')]=_[_0xc002('0x42')](_0x16dd2c[_0xc002('0x41')]);_0x3bca06[_0xc002('0x43')]=_[_0xc002('0x44')](_0x3bca06[_0xc002('0x45')],_0x3bca06[_0xc002('0x41')]);_0x2dd1cf[_0xc002('0x46')]=_[_0xc002('0x44')](_0x3bca06[_0xc002('0x45')],qs[_0xc002('0x47')](_0x16dd2c[_0xc002('0x41')][_0xc002('0x47')]));_0x2dd1cf[_0xc002('0x46')]=_0x2dd1cf[_0xc002('0x46')]['length']?_0x2dd1cf['attributes']:_0x3bca06['model'];if(_0x16dd2c[_0xc002('0x41')][_0xc002('0x52')]){_0x2dd1cf[_0xc002('0x53')]=[{'all':!![]}];}_0x2dd1cf=_[_0xc002('0x4f')]({},_0x2dd1cf,_0x16dd2c[_0xc002('0x51')]);return db[_0xc002('0x3b')][_0xc002('0x57')](_0x2dd1cf)['then'](handleEntityNotFound(_0x4ce3d8,null))[_0xc002('0x1c')](respondWithResult(_0x4ce3d8,null))[_0xc002('0x26')](handleError(_0x4ce3d8,null));};exports[_0xc002('0x58')]=function(_0x4056a9,_0x2df5f9){return db[_0xc002('0x3b')][_0xc002('0x58')](_0x4056a9[_0xc002('0x59')],{})[_0xc002('0x1c')](function(_0xc2e67b){var _0x12b1d0=_0x4056a9['user'][_0xc002('0x33')]({'plain':!![]});if(!_0x12b1d0)throw new Error(_0xc002('0x5a'));if(_0x12b1d0[_0xc002('0x5b')]===_0xc002('0x5c')){var _0x418f52=_0xc2e67b[_0xc002('0x33')]({'plain':!![]});var _0x5a3301=_0xc002('0x5d');return db[_0xc002('0x5e')][_0xc002('0x57')]({'where':{'name':_0x5a3301,'userProfileId':_0x12b1d0[_0xc002('0x5f')]},'raw':!![]})[_0xc002('0x1c')](function(_0x5d84a5){if(_0x5d84a5&&_0x5d84a5['autoAssociation']===0x0){return db[_0xc002('0x34')][_0xc002('0x58')]({'name':_0x418f52['name'],'resourceId':_0x418f52['id'],'type':_0x5d84a5[_0xc002('0x40')],'sectionId':_0x5d84a5['id']},{})[_0xc002('0x1c')](function(){return _0xc2e67b;});}else{return _0xc2e67b;}})['catch'](function(_0x151d24){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x151d24);throw _0x151d24;});}return _0xc2e67b;})['then'](respondWithResult(_0x2df5f9,0xc9))[_0xc002('0x26')](handleError(_0x2df5f9,null));};exports[_0xc002('0x32')]=function(_0x376158,_0x2ced33){if(_0x376158[_0xc002('0x59')]['id']){delete _0x376158['body']['id'];}return db['ChatWebsite'][_0xc002('0x57')]({'where':{'id':_0x376158[_0xc002('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xc002('0x3a')}]})[_0xc002('0x1c')](handleEntityNotFound(_0x2ced33,null))[_0xc002('0x1c')](saveUpdates(_0x376158['body'],null))[_0xc002('0x1c')](respondWithResult(_0x2ced33,null))[_0xc002('0x26')](handleError(_0x2ced33,null));};exports['destroy']=function(_0x3c84d6,_0x51d4d2){return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x3c84d6[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x51d4d2,null))[_0xc002('0x1c')](removeEntity(_0x51d4d2,null))['catch'](handleError(_0x51d4d2,null));};exports[_0xc002('0x61')]=function(_0x5ef877,_0x28f4de){return db[_0xc002('0x3b')][_0xc002('0x61')]()[_0xc002('0x1c')](respondWithResult(_0x28f4de,null))[_0xc002('0x26')](handleError(_0x28f4de,null));};exports[_0xc002('0x62')]=function(_0x5c4c56,_0x2313fe,_0x4cf4d6){if(_0x5c4c56[_0xc002('0x59')]['id']){delete _0x5c4c56['body']['id'];}return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x5c4c56[_0xc002('0x60')]['id']}})['then'](handleEntityNotFound(_0x2313fe,null))[_0xc002('0x1c')](function(_0x227a58){if(_0x227a58){_0x5c4c56[_0xc002('0x59')][_0xc002('0x63')]=_0x227a58['id'];return db[_0xc002('0x64')][_0xc002('0x58')](_0x5c4c56[_0xc002('0x59')]);}})[_0xc002('0x1c')](respondWithResult(_0x2313fe,null))[_0xc002('0x26')](handleError(_0x2313fe,null));};exports[_0xc002('0x65')]=function(_0x522342,_0x52e1a5,_0x15b1c5){var _0x8f5a94={'raw':![],'where':{}};var _0x390b51={};var _0x27b4c7={'count':0x0,'rows':[]};return db[_0xc002('0x3b')][_0xc002('0x66')]({'where':{'id':_0x522342[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x52e1a5,null))[_0xc002('0x1c')](function(_0x50f86d){if(_0x50f86d){_0x390b51[_0xc002('0x45')]=_[_0xc002('0x42')](db[_0xc002('0x64')][_0xc002('0x3c')]);_0x390b51[_0xc002('0x41')]=_[_0xc002('0x42')](_0x522342[_0xc002('0x41')]);_0x390b51[_0xc002('0x43')]=_[_0xc002('0x44')](_0x390b51[_0xc002('0x45')],_0x390b51['query']);_0x8f5a94[_0xc002('0x46')]=_[_0xc002('0x44')](_0x390b51[_0xc002('0x45')],qs['fields'](_0x522342[_0xc002('0x41')][_0xc002('0x47')]));_0x8f5a94[_0xc002('0x46')]=_0x8f5a94[_0xc002('0x46')][_0xc002('0x48')]?_0x8f5a94[_0xc002('0x46')]:_0x390b51[_0xc002('0x45')];if(!_0x522342['query'][_0xc002('0x49')](_0xc002('0x4a'))){_0x8f5a94[_0xc002('0x2c')]=qs['limit'](_0x522342[_0xc002('0x41')]['limit']);_0x8f5a94[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x522342[_0xc002('0x41')]['offset']);}_0x8f5a94[_0xc002('0x67')]=qs['sort'](_0x522342[_0xc002('0x41')][_0xc002('0x4b')]);_0x8f5a94[_0xc002('0x4c')]=qs[_0xc002('0x43')](_[_0xc002('0x4d')](_0x522342[_0xc002('0x41')],_0x390b51['filters']));_0x8f5a94[_0xc002('0x4c')][_0xc002('0x63')]=_0x50f86d['id'];if(_0x522342[_0xc002('0x41')][_0xc002('0x4e')]){_0x8f5a94[_0xc002('0x4c')]=_[_0xc002('0x4f')](_0x8f5a94['where'],{'$or':_['map'](_0x8f5a94[_0xc002('0x46')],function(_0x5c2f49){var _0x5d589b={};_0x5d589b[_0x5c2f49]={'$like':'%'+_0x522342[_0xc002('0x41')][_0xc002('0x4e')]+'%'};return _0x5d589b;})});}_0x8f5a94=_[_0xc002('0x4f')]({},_0x8f5a94,_0x522342[_0xc002('0x51')]);return db[_0xc002('0x64')][_0xc002('0x2d')]({'where':_0x8f5a94[_0xc002('0x4c')]})['then'](function(_0x11f150){_0x27b4c7[_0xc002('0x2d')]=_0x11f150;if(_0x522342[_0xc002('0x41')][_0xc002('0x52')]){_0x8f5a94['include']=[{'all':!![]}];}return db[_0xc002('0x64')][_0xc002('0x54')](_0x8f5a94);})[_0xc002('0x1c')](function(_0x2e9d48){_0x27b4c7[_0xc002('0x55')]=_0x2e9d48;return _0x27b4c7;});}})['then'](respondWithFilteredResult(_0x52e1a5,_0x8f5a94))[_0xc002('0x26')](handleError(_0x52e1a5,null));};exports[_0xc002('0x68')]=function(_0x15c45b,_0x215409,_0x523c34){return db['ChatWebsite']['find']({'where':{'id':_0x15c45b[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x215409,null))[_0xc002('0x1c')](function(_0x103452){if(_0x103452){return _0x103452[_0xc002('0x68')](_0x15c45b[_0xc002('0x41')][_0xc002('0x69')]);}})[_0xc002('0x1c')](respondWithStatusCode(_0x215409,null))[_0xc002('0x26')](handleError(_0x215409,null));};exports[_0xc002('0x6a')]=function(_0x4c15c2,_0x10e94e,_0x3b160e){if(_0x4c15c2['body']['id']){delete _0x4c15c2[_0xc002('0x59')]['id'];}return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x4c15c2['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x10e94e,null))['then'](function(_0x3643d9){if(_0x3643d9){_0x4c15c2[_0xc002('0x59')][_0xc002('0x63')]=_0x3643d9['id'];return db[_0xc002('0x6b')][_0xc002('0x58')](_0x4c15c2['body']);}})['then'](respondWithResult(_0x10e94e,null))[_0xc002('0x26')](handleError(_0x10e94e,null));};exports[_0xc002('0x6c')]=function(_0x402e59,_0x21ce6,_0xba10f0){var _0x35bd64={'raw':![],'where':{}};var _0x1148f8={};var _0x53ee11={'count':0x0,'rows':[]};return db[_0xc002('0x3b')][_0xc002('0x66')]({'where':{'id':_0x402e59['params']['id']}})['then'](handleEntityNotFound(_0x21ce6,null))[_0xc002('0x1c')](function(_0x28fe2e){if(_0x28fe2e){_0x1148f8[_0xc002('0x45')]=_[_0xc002('0x42')](db[_0xc002('0x6b')][_0xc002('0x3c')]);_0x1148f8[_0xc002('0x41')]=_[_0xc002('0x42')](_0x402e59[_0xc002('0x41')]);_0x1148f8[_0xc002('0x43')]=_[_0xc002('0x44')](_0x1148f8['model'],_0x1148f8[_0xc002('0x41')]);_0x35bd64[_0xc002('0x46')]=_['intersection'](_0x1148f8[_0xc002('0x45')],qs[_0xc002('0x47')](_0x402e59[_0xc002('0x41')][_0xc002('0x47')]));_0x35bd64['attributes']=_0x35bd64[_0xc002('0x46')]['length']?_0x35bd64[_0xc002('0x46')]:_0x1148f8[_0xc002('0x45')];if(!_0x402e59[_0xc002('0x41')][_0xc002('0x49')]('nolimit')){_0x35bd64[_0xc002('0x2c')]=qs[_0xc002('0x2c')](_0x402e59['query'][_0xc002('0x2c')]);_0x35bd64[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x402e59['query'][_0xc002('0x2a')]);}_0x35bd64[_0xc002('0x67')]=qs['sort'](_0x402e59[_0xc002('0x41')][_0xc002('0x4b')]);_0x35bd64[_0xc002('0x4c')]=qs[_0xc002('0x43')](_[_0xc002('0x4d')](_0x402e59[_0xc002('0x41')],_0x1148f8[_0xc002('0x43')]));_0x35bd64[_0xc002('0x4c')][_0xc002('0x63')]=_0x28fe2e['id'];if(_0x402e59[_0xc002('0x41')][_0xc002('0x4e')]){_0x35bd64['where']=_[_0xc002('0x4f')](_0x35bd64[_0xc002('0x4c')],{'$or':_['map'](_0x35bd64[_0xc002('0x46')],function(_0x5c487c){var _0x43bd93={};_0x43bd93[_0x5c487c]={'$like':'%'+_0x402e59['query'][_0xc002('0x4e')]+'%'};return _0x43bd93;})});}_0x35bd64=_['merge']({},_0x35bd64,_0x402e59['options']);return db[_0xc002('0x6b')][_0xc002('0x2d')]({'where':_0x35bd64[_0xc002('0x4c')]})['then'](function(_0x30a9cc){_0x53ee11[_0xc002('0x2d')]=_0x30a9cc;if(_0x402e59[_0xc002('0x41')][_0xc002('0x52')]){_0x35bd64['include']=[{'all':!![]}];}return db[_0xc002('0x6b')]['findAll'](_0x35bd64);})[_0xc002('0x1c')](function(_0x1228bd){_0x53ee11[_0xc002('0x55')]=_0x1228bd;return _0x53ee11;});}})[_0xc002('0x1c')](respondWithFilteredResult(_0x21ce6,_0x35bd64))['catch'](handleError(_0x21ce6,null));};exports[_0xc002('0x6d')]=function(_0x1c3eeb,_0x5b0a77,_0x11a636){return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x1c3eeb[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x5b0a77,null))[_0xc002('0x1c')](function(_0x13f601){if(_0x13f601){return _0x13f601[_0xc002('0x6d')](_0x1c3eeb[_0xc002('0x41')]['ids']);}})[_0xc002('0x1c')](respondWithStatusCode(_0x5b0a77,null))[_0xc002('0x26')](handleError(_0x5b0a77,null));};exports['addLogo']=function(_0x4edee5,_0x125e39,_0x50732e){_0x4edee5[_0xc002('0x59')][_0xc002('0x6e')]=_0x4edee5[_0xc002('0x6f')][_0xc002('0x70')];return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x4edee5[_0xc002('0x60')]['id']}})['then'](handleEntityNotFound(_0x125e39,null))[_0xc002('0x1c')](saveUpdates(_0x4edee5[_0xc002('0x59')],null))[_0xc002('0x1c')](respondWithResult(_0x125e39,null))['catch'](handleError(_0x125e39,null));};exports['addAvatar']=function(_0x1d1283,_0x31b70f,_0x46757c){_0x1d1283['body']['agentAvatar']=_0x1d1283[_0xc002('0x6f')][_0xc002('0x70')];return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x1d1283['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x31b70f,null))[_0xc002('0x1c')](saveUpdates(_0x1d1283[_0xc002('0x59')],null))['then'](respondWithResult(_0x31b70f,null))[_0xc002('0x26')](handleError(_0x31b70f,null));};exports['addCustomerAvatar']=function(_0x43fd98,_0x1df112,_0x59ee66){_0x43fd98['body']['customerAvatar']=_0x43fd98[_0xc002('0x6f')][_0xc002('0x70')];return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x43fd98['params']['id']}})['then'](handleEntityNotFound(_0x1df112,null))[_0xc002('0x1c')](saveUpdates(_0x43fd98[_0xc002('0x59')],null))[_0xc002('0x1c')](respondWithResult(_0x1df112,null))[_0xc002('0x26')](handleError(_0x1df112,null));};exports[_0xc002('0x71')]=function(_0x5d1e07,_0x4a6470,_0x503525){_0x5d1e07[_0xc002('0x59')][_0xc002('0x72')]=_0x5d1e07[_0xc002('0x6f')]['filename'];return db['ChatWebsite'][_0xc002('0x57')]({'where':{'id':_0x5d1e07['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x4a6470,null))[_0xc002('0x1c')](saveUpdates(_0x5d1e07[_0xc002('0x59')],null))['then'](respondWithResult(_0x4a6470,null))[_0xc002('0x26')](handleError(_0x4a6470,null));};exports[_0xc002('0x73')]=function(_0x2cbbfb,_0x39c23d,_0x3dd9b5){var _0x52e255=path[_0xc002('0x74')](config[_0xc002('0x75')],'server/files/images/logos/default_logo.svg');var _0x255407={'where':{'id':_0x2cbbfb[_0xc002('0x60')]['id']},'attributes':['id',_0xc002('0x6e')],'raw':!![]};var _0x2f3177=![];return require(_0xc002('0x11'))[_0xc002('0x76')]()['then'](function(_0x417b21){if(_0x417b21){_0x2f3177=_0x417b21[_0xc002('0x77')];}})[_0xc002('0x1c')](function(){return db['ChatWebsite'][_0xc002('0x57')](_0x255407);})[_0xc002('0x1c')](handleEntityNotFound(_0x39c23d,null))[_0xc002('0x1c')](function(_0xfc952c){if(_0xfc952c){if(!_['isNil'](_0xfc952c['sitepic'])){if(fs[_0xc002('0x78')](path[_0xc002('0x74')](config['root'],_0xc002('0x79'),_0xfc952c[_0xc002('0x6e')]))&&_0x2f3177){_0x52e255=path[_0xc002('0x74')](config[_0xc002('0x75')],_0xc002('0x79'),_0xfc952c[_0xc002('0x6e')]);}}return _0x39c23d['download'](_0x52e255);}})[_0xc002('0x26')](handleError(_0x39c23d,null));};exports['getAvatar']=function(_0x2d8ae9,_0x31431d,_0x4d1913){var _0x1d6c99=path['join'](config['root'],_0xc002('0x7a'));var _0x572d01={'where':{'id':_0x2d8ae9[_0xc002('0x60')]['id']},'attributes':['id',_0xc002('0x7b')],'raw':!![]};return db[_0xc002('0x3b')]['find'](_0x572d01)[_0xc002('0x1c')](handleEntityNotFound(_0x31431d,null))[_0xc002('0x1c')](function(_0x1c4c79){if(_0x1c4c79){if(!_[_0xc002('0x7c')](_0x1c4c79[_0xc002('0x7b')])){if(fs[_0xc002('0x78')](path[_0xc002('0x74')](config[_0xc002('0x75')],_0xc002('0x7d'),_0x1c4c79[_0xc002('0x7b')]))){_0x1d6c99=path['join'](config[_0xc002('0x75')],_0xc002('0x7d'),_0x1c4c79[_0xc002('0x7b')]);}}return _0x31431d[_0xc002('0x7e')](_0x1d6c99);}})[_0xc002('0x26')](handleError(_0x31431d,null));};exports[_0xc002('0x7f')]=function(_0x69aca8,_0x385b56,_0x3ff0d4){var _0x18d2c0=path['join'](config['root'],_0xc002('0x80'));var _0x200025={'where':{'id':_0x69aca8['params']['id']},'attributes':['id',_0xc002('0x81'),_0xc002('0x82')],'raw':!![]};return db[_0xc002('0x3b')]['find'](_0x200025)[_0xc002('0x1c')](handleEntityNotFound(_0x385b56,null))['then'](function(_0x1102df){if(_0x1102df){if(!_[_0xc002('0x7c')](_0x1102df[_0xc002('0x81')])){if(fs[_0xc002('0x78')](path[_0xc002('0x74')](config[_0xc002('0x75')],_0xc002('0x7d'),_0x1102df[_0xc002('0x81')]))&&_0x1102df['showCustomerAvatar']){_0x18d2c0=path[_0xc002('0x74')](config['root'],_0xc002('0x7d'),_0x1102df['customerAvatar']);}}return _0x385b56[_0xc002('0x7e')](_0x18d2c0);}})['catch'](handleError(_0x385b56,null));};exports[_0xc002('0x83')]=function(_0x53b5c8,_0x577af0,_0x133b2a){var _0x3bff8e=path['join'](config['root'],_0xc002('0x84'));var _0x26dbd5={'where':{'id':_0x53b5c8['params']['id']},'attributes':['id',_0xc002('0x72')],'raw':!![]};return db[_0xc002('0x3b')][_0xc002('0x57')](_0x26dbd5)[_0xc002('0x1c')](handleEntityNotFound(_0x577af0,null))[_0xc002('0x1c')](function(_0x19e95b){if(_0x19e95b){if(!_[_0xc002('0x7c')](_0x19e95b['systemAvatar'])){if(fs[_0xc002('0x78')](path[_0xc002('0x74')](config[_0xc002('0x75')],_0xc002('0x7d'),_0x19e95b['systemAvatar']))){_0x3bff8e=path['join'](config[_0xc002('0x75')],'server/files/images/avatars/',_0x19e95b[_0xc002('0x72')]);}}return _0x577af0['download'](_0x3bff8e);}})[_0xc002('0x26')](handleError(_0x577af0,null));};exports[_0xc002('0x85')]=function(_0x2c10b0,_0x953374,_0xd1a354){var _0x2b76f3=require(_0xc002('0x86'));var _0x43a68a=new _0x2b76f3();var _0x40d118=_0x43a68a[_0xc002('0x87')](_0x2c10b0[_0xc002('0x88')][_0xc002('0x89')])['getResult']();var _0x13c88f={'body':_0x2c10b0[_0xc002('0x59')],'channel':_0xc002('0x8a')};var _0x1114cc=[];var _0x10668d=[];var _0x30cc16={};var _0x335893=![];return db[_0xc002('0x8b')][_0xc002('0x61')]()['then'](function(_0x3b2c3b){if(!_0x3b2c3b){throw new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0x8e'));}_0x1114cc=_[_0xc002('0x8f')](_[_0xc002('0x42')](_0x3b2c3b),[_0xc002('0x90'),'updatedAt']);_0x10668d=_[_0xc002('0x8f')](_[_0xc002('0x42')](_0x3b2c3b),[_0xc002('0x90'),'updatedAt',_0xc002('0x91'),_0xc002('0x92')]);if(_0x2c10b0['body']['id']){delete _0x2c10b0[_0xc002('0x59')]['id'];}if(_['isNil'](_0x2c10b0['body']['from'])){throw new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0x93'));}if(_['isNil'](_0x2c10b0[_0xc002('0x59')][_0xc002('0x59')])||_0x2c10b0[_0xc002('0x59')]['body']===''){throw new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2c10b0['body'][_0xc002('0x94')])){throw new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0x95')+_0x10668d);}if(!_[_0xc002('0x96')](_0x10668d,_0x2c10b0[_0xc002('0x59')][_0xc002('0x94')])){throw new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0x97')+_0x10668d);}_0x30cc16[_0x2c10b0[_0xc002('0x59')][_0xc002('0x94')]]=_0x2c10b0[_0xc002('0x59')]['from'];})['then'](function(){return db[_0xc002('0x3b')]['find']({'where':{'id':_0x2c10b0['params']['id']},'include':[{'model':db[_0xc002('0x98')],'as':_0xc002('0x99'),'include':[{'model':db[_0xc002('0x8b')],'as':_0xc002('0x9a'),'where':_0x30cc16,'limit':0x1,'order':[['updatedAt',_0xc002('0x9b')]]}]},{'model':db[_0xc002('0x9c')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x953374,null))[_0xc002('0x1c')](function(_0x524d89){if(_0x524d89&&_0x524d89[_0xc002('0x99')]){_0x13c88f['account']=_0x524d89;_0x13c88f[_0xc002('0x9d')]=_0x524d89['Applications'];_0x13c88f[_0xc002('0x9e')]=_0x524d89[_0xc002('0x99')];_0x13c88f['applications']=_[_0xc002('0x9f')](_0x13c88f[_0xc002('0x9d')],[_0xc002('0xa0')],['asc']);if(_0x13c88f[_0xc002('0xa1')][_0xc002('0xa2')]){delete _0x13c88f[_0xc002('0xa1')][_0xc002('0xa2')];}if(_0x13c88f[_0xc002('0xa1')][_0xc002('0x99')]&&_0x13c88f['account'][_0xc002('0x99')][_0xc002('0x9a')]['length']){return _0x13c88f['account'][_0xc002('0x99')][_0xc002('0x9a')][0x0];}var _0x3653d7=_[_0xc002('0x14')](_0x2c10b0[_0xc002('0x59')],{'firstName':_0x2c10b0[_0xc002('0x59')][_0xc002('0xa3')],'ListId':_0x524d89[_0xc002('0x92')]});_0x3653d7[_0x2c10b0[_0xc002('0x59')][_0xc002('0x94')]]=_0x2c10b0[_0xc002('0x59')][_0xc002('0xa3')];return db[_0xc002('0x8b')]['create'](_0x3653d7,{'fields':_0x1114cc,'raw':!![]});}})[_0xc002('0x1c')](handleEntityNotFound(_0x953374,null))['then'](function(_0x9b4953){_0x13c88f['contact']=_0x9b4953;var _0x41857d=_0x2c10b0[_0xc002('0x59')][_0xc002('0xa4')];if(_0x2c10b0[_0xc002('0x88')][_0xc002('0xa5')]){_0x41857d=_0x2c10b0[_0xc002('0x88')][_0xc002('0xa5')];}else if(_0x2c10b0[_0xc002('0x88')][_0xc002('0xa6')]){_0x41857d=_[_0xc002('0xa7')](_0x2c10b0['headers'][_0xc002('0xa6')][_0xc002('0xa8')](','));}if(_0x9b4953){var _0x354210={'ContactId':_0x9b4953['id'],'ChatWebsiteId':_0x2c10b0[_0xc002('0x60')]['id'],'from':(_0x9b4953[_0xc002('0xa9')]||'')+'\x20'+(_0x9b4953[_0xc002('0xaa')]||''),'customerIp':_0x41857d,'customerPort':_0x2c10b0['headers'][_0xc002('0xab')]?_0x2c10b0['headers'][_0xc002('0xab')]:null,'referer':_0x2c10b0['body']['referer'],'browserName':_0x40d118[_0xc002('0xac')][_0xc002('0x40')]&&_0x40d118[_0xc002('0xac')][_0xc002('0xad')]?util[_0xc002('0xae')](_0xc002('0xaf'),_0x40d118[_0xc002('0xac')][_0xc002('0x40')],_0x40d118[_0xc002('0xac')][_0xc002('0xad')]):_0xc002('0xb0'),'browserVersion':_0x40d118['browser'][_0xc002('0xad')]||_0xc002('0xb0'),'osName':util[_0xc002('0xae')](_0xc002('0xaf'),_0x40d118['os'][_0xc002('0x40')],_0x40d118['os'][_0xc002('0xad')]),'osVersion':_0x40d118['os'][_0xc002('0xad')],'deviceModel':_0x40d118['device'][_0xc002('0x45')]&&_0x40d118[_0xc002('0xb1')]['vendor']?util[_0xc002('0xae')]('%s\x20%s\x20%s',_0x40d118[_0xc002('0xb1')]['model'],_0x40d118['device']['vendor'],_0x40d118[_0xc002('0xb1')]['type']):null,'deviceVendor':_0x40d118[_0xc002('0xb1')][_0xc002('0xb2')],'deviceType':_0x40d118[_0xc002('0xb1')][_0xc002('0x3d')],'formData':JSON[_0xc002('0x20')](_0x2c10b0[_0xc002('0x59')])};var _0x4fa1c9={'ChatWebsiteId':_0x2c10b0[_0xc002('0x60')]['id'],'closed':![]};if(_0x2c10b0[_0xc002('0x59')][_0xc002('0xb3')]){_0x4fa1c9[_0xc002('0xb3')]=_0x2c10b0[_0xc002('0x59')][_0xc002('0xb3')];return db['ChatInteraction'][_0xc002('0x57')]({'where':_0x4fa1c9})[_0xc002('0x1c')](function(_0x5e0896){if(_0x5e0896){return[_0x5e0896,![]];}_0x354210[_0xc002('0xb3')]=_0x2c10b0[_0xc002('0x59')][_0xc002('0xb3')];_0x354210[_0xc002('0xb4')]=_0x2c10b0['body']['externalUrl'];return db[_0xc002('0xb5')][_0xc002('0x58')](_0x354210)['then'](function(_0x2ff718){return[_0x2ff718,!![]];});});}_0x4fa1c9[_0xc002('0xb6')]=_0x9b4953['id'];if(_0x2c10b0[_0xc002('0x59')][_0xc002('0xb7')]&&_0x2c10b0[_0xc002('0x59')][_0xc002('0xb7')]['id']){_0x4fa1c9['id']=_0x2c10b0[_0xc002('0x59')][_0xc002('0xb7')]['id'];return db[_0xc002('0xb5')][_0xc002('0x57')]({'where':_0x4fa1c9})[_0xc002('0x1c')](function(_0x4730c7){if(_0x4730c7){return[_0x4730c7,![]];}return db['ChatInteraction'][_0xc002('0x58')](_0x354210)[_0xc002('0x1c')](function(_0xd59bce){return[_0xd59bce,!![]];});});}return db[_0xc002('0xb5')][_0xc002('0x58')](_0x354210)[_0xc002('0x1c')](function(_0x5118fc){return[_0x5118fc,!![]];});}})['spread'](function(_0x354291,_0x5c2fe3){if(_0x354291){_0x335893=_0x5c2fe3;if(!_0x5c2fe3){var _0x1392cf={'from':(_0x13c88f[_0xc002('0xb8')][_0xc002('0xa9')]||'')+'\x20'+(_0x13c88f[_0xc002('0xb8')][_0xc002('0xaa')]||'')};if(_0x2c10b0[_0xc002('0x59')]['threadId']&&_0x2c10b0[_0xc002('0x59')]['messageId']&&_0x2c10b0[_0xc002('0x59')][_0xc002('0xb3')]!=_0x2c10b0[_0xc002('0x59')][_0xc002('0xb9')]){_0x1392cf[_0xc002('0xb3')]=_0x2c10b0[_0xc002('0x59')]['messageId'];}return _0x354291[_0xc002('0x32')](_0x1392cf);}else{return _0x354291;}}})[_0xc002('0x1c')](function(_0x171426){_0x13c88f[_0xc002('0xb7')]=_0x171426[_0xc002('0x33')]({'plain':!![]});_0x13c88f['interaction']['created']=_0x335893;if(_0x13c88f[_0xc002('0xb7')][_0xc002('0xba')]){if(_0x13c88f[_0xc002('0xa1')]['autoclose']){_0x13c88f['applications'][_0xc002('0xbb')]({'id':0x0,'priority':_0x13c88f[_0xc002('0x9d')]['length']+0x1,'app':_0xc002('0xbc'),'appdata':'unmanaged','interval':_0xc002('0xbd')});}}return db[_0xc002('0xbe')][_0xc002('0x58')]({'body':_0x2c10b0[_0xc002('0x59')]['body'],'ChatWebsiteId':_0x2c10b0[_0xc002('0x60')]['id'],'ChatInteractionId':_0x171426['id'],'direction':'in','ContactId':_0x13c88f[_0xc002('0xb8')]['id'],'AttachmentId':_0x2c10b0[_0xc002('0x59')][_0xc002('0xbf')]});})[_0xc002('0x1c')](function(_0x3c295f){_0x13c88f['message']=_0x3c295f;if(_0x13c88f[_0xc002('0xb7')][_0xc002('0xc0')]){return db['User'][_0xc002('0x57')]({'attributes':['id',_0xc002('0x40')],'where':{'id':_0x13c88f[_0xc002('0xb7')][_0xc002('0xc0')]}})[_0xc002('0x1c')](function(_0x3b3e1f){if(_0x3b3e1f){_0x13c88f['applications'][_0xc002('0xc1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b3e1f[_0xc002('0x40')]+','+(_0x13c88f[_0xc002('0xa1')][_0xc002('0xc2')]||0xa),'interval':_0xc002('0xbd')});_0x13c88f['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x13c88f);});}return respondWithRpcPromise(_0xc002('0xc3'),'startRouting',_0x13c88f);})['then'](function(_0x190139){respondWithRpcPromise(_0xc002('0xc4'),_0xc002('0xc4'),{'event':_0xc002('0x85'),'message':_0x190139},client9002);return _0x190139;})[_0xc002('0x1c')](respondWithResult(_0x953374,null))[_0xc002('0x26')](handleError(_0x953374,null));};exports[_0xc002('0xc5')]=function(_0x180526,_0x45b511,_0x40d01e){var _0x53049f,_0x1d0b4c,_0x2bf19a;var _0xbd9ec6=[];var _0x1ab11c=[];var _0x505537={};var _0x124e3f=_0x180526['files']||[];var _0x53d66a=[];var _0x33c238;return db[_0xc002('0x8b')][_0xc002('0x61')]()['then'](function(_0x16749f){if(!_0x16749f){throw new db['Sequelize'][(_0xc002('0x8d'))](_0xc002('0x8e'));}_0x1ab11c=_[_0xc002('0x8f')](_[_0xc002('0x42')](_0x16749f),[_0xc002('0x90'),_0xc002('0xc6')]);_0xbd9ec6=_[_0xc002('0x8f')](_['keys'](_0x16749f),[_0xc002('0x90'),_0xc002('0xc6'),'CompanyId',_0xc002('0x92')]);if(_0x180526['body']['id']){delete _0x180526[_0xc002('0x59')]['id'];}if(_['isNil'](_0x180526[_0xc002('0x59')]['from'])){throw _0x45b511[_0xc002('0x28')](0x1f4)['send'](new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0x93')));}if(_[_0xc002('0x7c')](_0x180526[_0xc002('0x59')][_0xc002('0x59')])||_0x180526['body'][_0xc002('0x59')]===''){throw _0x45b511[_0xc002('0x28')](0x1f4)[_0xc002('0x37')](new db['Sequelize']['ValidationError'](_0xc002('0xc7')));}if(_[_0xc002('0x7c')](_0x180526[_0xc002('0x59')][_0xc002('0xc8')])){throw _0x45b511[_0xc002('0x28')](0x1f4)[_0xc002('0x37')](new db[(_0xc002('0x8c'))]['ValidationError'](_0xc002('0xc9')+_0xbd9ec6));}if(!_[_0xc002('0x96')](_0xbd9ec6,_0x180526[_0xc002('0x59')]['mapKeyOffline'])){throw _0x45b511[_0xc002('0x28')](0x1f4)[_0xc002('0x37')](new db[(_0xc002('0x8c'))][(_0xc002('0x8d'))](_0xc002('0xca')+_0xbd9ec6));}_0x505537[_0x180526[_0xc002('0x59')]['mapKeyOffline']]=_0x180526[_0xc002('0x59')][_0xc002('0xa3')];})[_0xc002('0x1c')](function(){return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x180526['params']['id']},'include':[{'model':db[_0xc002('0x98')],'as':_0xc002('0x99')},{'model':db[_0xc002('0xcb')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x45b511,null))[_0xc002('0x1c')](function(_0x490619){if(_0x490619&&_0x490619[_0xc002('0x99')]){_0x1d0b4c=_0x490619;var _0x13d517=_[_0xc002('0x14')](_0x180526[_0xc002('0x59')],{'firstName':_0x180526['body'][_0xc002('0xa3')],'phone':_0x180526[_0xc002('0x59')][_0xc002('0xa3')],'ListId':_0x490619[_0xc002('0x92')]});_0x13d517[_0x180526[_0xc002('0x59')]['mapKeyOffline']]=_0x180526['body'][_0xc002('0xa3')];return db[_0xc002('0x8b')][_0xc002('0xcc')]({'where':_0x505537,'defaults':_0x13d517});}})[_0xc002('0xcd')](function(_0xbc01d0){if(_0xbc01d0){_0x2bf19a=_0xbc01d0;var _0x34c489=fs[_0xc002('0xce')](path['join'](config['root'],_0xc002('0xcf')),_0xc002('0xd0'));var _0x34b3c3=ejs['render'](_0x34c489,{'body':_[_0xc002('0xd1')](_0x180526['body'][_0xc002('0x59')]),'bodyTitle':_0x1d0b4c['offlineMessageBody']});return db[_0xc002('0xd2')][_0xc002('0x58')]({'body':_0x34b3c3,'ContactId':_0xbc01d0['id'],'ChatWebsiteId':_0x1d0b4c['id']});}})[_0xc002('0x1c')](function(_0xfb5df4){_0x33c238=_0xfb5df4;if(_0x124e3f[_0xc002('0x48')]){var _0x423ae5=_0x124e3f[_0xc002('0x3f')](function(_0x3acbbb){return{'name':_0x3acbbb[_0xc002('0xd3')],'basename':_0x3acbbb['filename'],'type':_0x3acbbb['mimetype'],'ChatOfflineMessageId':_0xfb5df4['id']};});_0x53d66a=_0x423ae5[_0xc002('0x3f')](_0x107385=>{var _0x4dd610={'filename':_0x107385[_0xc002('0x40')],'path':path[_0xc002('0x74')](config['root'],_0xc002('0xd4'),_0xc002('0xd5'),_0xc002('0xd6'),_0xc002('0xd7'),_0x107385['basename'])};return _0x4dd610;});if(!_0x1d0b4c['openNewInteraction']){return db[_0xc002('0xd8')]['transaction'](function(_0x4f2c6f){return db['Attachment'][_0xc002('0xd9')](_0x423ae5,{'transaction':_0x4f2c6f});});}}})[_0xc002('0x1c')](function(){if(_0x33c238){_0x53049f=_0x33c238;return db[_0xc002('0xcb')][_0xc002('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc002('0xda'),'raw':!![]}]});}})['then'](function(_0x42652e){if(_0x42652e&&_0x42652e[_0xc002('0xda')]&&_0x1d0b4c[_0xc002('0xdb')]&&_0x1d0b4c[_0xc002('0xdc')]){var _0x2537da={'tls':{'rejectUnauthorized':![]}};if(_0x42652e['Smtp']['service']){_0x2537da['service']=_0x42652e[_0xc002('0xda')][_0xc002('0xdd')];}else{_0x2537da[_0xc002('0xde')]=_0x42652e[_0xc002('0xda')][_0xc002('0xde')];_0x2537da['port']=_0x42652e[_0xc002('0xda')][_0xc002('0xdf')];_0x2537da[_0xc002('0xe0')]=_0x42652e[_0xc002('0xda')][_0xc002('0xe0')];}if(_0x42652e[_0xc002('0xda')]['authentication']){_0x2537da[_0xc002('0xe1')]={'user':_0x42652e[_0xc002('0xda')][_0xc002('0x5c')],'pass':_0x42652e['Smtp'][_0xc002('0xe2')]};}return respondWithRpcPromise(_0xc002('0xe3'),'sendMail',{'account':_0x2537da,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x42652e[_0xc002('0x40')],_0x42652e[_0xc002('0xe4')]||_0x42652e[_0xc002('0xda')][_0xc002('0x5c')]),'to':_0x1d0b4c[_0xc002('0xdc')],'subject':_0x1d0b4c[_0xc002('0xe5')],'html':_0x53049f['body'],'attachments':_0x53d66a}},client9003)[_0xc002('0x1c')](function(){return _0x53049f;})[_0xc002('0x26')](function(_0x21a41a){console['error'](_0x21a41a);});}})[_0xc002('0x1c')](function(){if(_0x1d0b4c&&_0x1d0b4c[_0xc002('0xe6')]&&_0x1d0b4c[_0xc002('0xe7')]){var _0x52a594=[];if(_0x124e3f[_0xc002('0x48')]){_0x52a594=_0x124e3f[_0xc002('0x3f')](function(_0x2d7415){return{'name':_0x2d7415[_0xc002('0xd3')],'basename':_0x2d7415[_0xc002('0x70')],'type':_0x2d7415[_0xc002('0xe8')],'ChatOfflineMessageId':_0x33c238['id']};});}var _0x340313;if(!_['isNil'](_0x1d0b4c['subjectOffline'])){var _0x3947bb=_[_0xc002('0x3f')](_0x180526[_0xc002('0x59')],function(_0x20cf4c){return _0x20cf4c;});var _0x1526ff=_[_0xc002('0xe9')](_0x3947bb)[0x0];var _0x1dcd10=_[_0xc002('0xea')](_0x1526ff,function(_0x95dda1){return _0x95dda1;});_0x340313=_0x1dcd10[0x1][_0x1d0b4c[_0xc002('0xeb')]];}var _0xf5041={'from':_0x2bf19a[_0xc002('0xe4')],'firstName':_0x2bf19a[_0xc002('0xa9')],'lastName':_0x2bf19a['lastName'],'mapKey':_0xc002('0xe4'),'message':{'from':_0x2bf19a['email'],'to':_0x1d0b4c['MailAccount'][_0xc002('0xe4')],'cc':'','subject':_[_0xc002('0x7c')](_0x340313)?_0x1d0b4c[_0xc002('0xe5')]:_0x340313,'messageId':'','sentAt':new Date(),'attach':_0x52a594[_0xc002('0x48')],'attachments':_0x52a594,'originChannel':_0xc002('0xec'),'ChatWebsiteId':_0x1d0b4c['id'],'ChatOfflineMessageId':_0x53049f['id'],'originTo':_0x1d0b4c[_0xc002('0xcb')]['email']},'body':_0x53049f[_0xc002('0x59')]};var _0x3e84a2={'account':{'id':_0x1d0b4c[_0xc002('0xe7')]},'body':_0xf5041,'log':_0xc002('0xed')};return respondWithRpcPromise(_0xc002('0xed'),_0xc002('0xee'),_0x3e84a2,client9001)['then'](function(){return _0x53049f;})[_0xc002('0x26')](function(_0x13be2f){console[_0xc002('0x21')](_0x13be2f);});}return;})['then'](function(){if(_0x53049f){return _0x53049f;}})[_0xc002('0x1c')](respondWithResult(_0x45b511,null))[_0xc002('0x26')](function(_0x558ce3){console[_0xc002('0x21')](_0xc002('0x26'),_0x558ce3);for(var _0x400b2e of _0x124e3f){var _0x4a9450=path['join'](config[_0xc002('0x75')],_0xc002('0xd4'),_0xc002('0xd5'),_0xc002('0xd6'),_0xc002('0xd7'),_0x400b2e['filename']);fs_extra['remove'](_0x4a9450)[_0xc002('0x26')](function(_0x2b41a2){console[_0xc002('0x21')](_0xc002('0xef'),_0x4a9450,_0x2b41a2);});}});};exports['addInteraction']=function(_0x3e4e2a,_0x2a46b1,_0x11e969){return db[_0xc002('0xb5')][_0xc002('0x57')]({'where':{'id':_0x3e4e2a['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x2a46b1,null))[_0xc002('0x1c')](function(_0x4b7d03){if(_0x4b7d03){return _0x4b7d03['addInteraction'](_0x3e4e2a[_0xc002('0x59')][_0xc002('0x69')],_[_0xc002('0xf0')](_0x3e4e2a[_0xc002('0x59')],[_0xc002('0x69'),'id'])||{});}})[_0xc002('0x1c')](respondWithResult(_0x2a46b1,null))[_0xc002('0x26')](handleError(_0x2a46b1,null));};exports['getInteractions']=function(_0x26a371,_0xaff63a,_0x19e30f){var _0x4c8777={'raw':![],'where':{}};var _0x37e301={};var _0x5f1b5e={'count':0x0,'rows':[]};return db[_0xc002('0x3b')]['findOne']({'where':{'id':_0x26a371[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0xaff63a,null))[_0xc002('0x1c')](function(_0x5709e5){if(_0x5709e5){_0x37e301['model']=_[_0xc002('0x42')](db[_0xc002('0xb5')][_0xc002('0x3c')]);_0x37e301[_0xc002('0x41')]=_[_0xc002('0x42')](_0x26a371[_0xc002('0x41')]);_0x37e301[_0xc002('0x43')]=_[_0xc002('0x44')](_0x37e301[_0xc002('0x45')],_0x37e301[_0xc002('0x41')]);_0x4c8777[_0xc002('0x46')]=_[_0xc002('0x44')](_0x37e301[_0xc002('0x45')],qs[_0xc002('0x47')](_0x26a371[_0xc002('0x41')][_0xc002('0x47')]));_0x4c8777[_0xc002('0x46')]=_0x4c8777['attributes'][_0xc002('0x48')]?_0x4c8777[_0xc002('0x46')]:_0x37e301[_0xc002('0x45')];if(!_0x26a371[_0xc002('0x41')][_0xc002('0x49')](_0xc002('0x4a'))){_0x4c8777[_0xc002('0x2c')]=qs[_0xc002('0x2c')](_0x26a371[_0xc002('0x41')][_0xc002('0x2c')]);_0x4c8777[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x26a371[_0xc002('0x41')][_0xc002('0x2a')]);}_0x4c8777[_0xc002('0x67')]=qs[_0xc002('0x4b')](_0x26a371[_0xc002('0x41')][_0xc002('0x4b')]);_0x4c8777['where']=qs[_0xc002('0x43')](_[_0xc002('0x4d')](_0x26a371[_0xc002('0x41')],_0x37e301[_0xc002('0x43')]));_0x4c8777['where'][_0xc002('0x63')]=_0x5709e5['id'];if(_0x26a371['query'][_0xc002('0x4e')]){_0x4c8777[_0xc002('0x4c')]=_[_0xc002('0x4f')](_0x4c8777[_0xc002('0x4c')],{'$or':_[_0xc002('0x3f')](_0x4c8777[_0xc002('0x46')],function(_0x1cafa4){var _0x25f86b={};_0x25f86b[_0x1cafa4]={'$like':'%'+_0x26a371[_0xc002('0x41')][_0xc002('0x4e')]+'%'};return _0x25f86b;})});}_0x4c8777=_['merge']({},_0x4c8777,_0x26a371[_0xc002('0x51')]);return db[_0xc002('0xb5')][_0xc002('0x2d')]({'where':_0x4c8777[_0xc002('0x4c')]})[_0xc002('0x1c')](function(_0x948d2a){_0x5f1b5e[_0xc002('0x2d')]=_0x948d2a;if(_0x26a371[_0xc002('0x41')]['includeAll']){_0x4c8777[_0xc002('0x53')]=[{'model':db[_0xc002('0x8b')],'as':_0xc002('0xf1'),'required':![]},{'model':db[_0xc002('0xf2')],'as':_0xc002('0xf3'),'attributes':['name',_0xc002('0xf4'),_0xc002('0xf5')],'required':![]},{'model':db[_0xc002('0xf6')],'as':_0xc002('0xf7'),'attributes':['id',_0xc002('0x40'),_0xc002('0xf8')],'where':_0x26a371[_0xc002('0x41')][_0xc002('0xf9')]?{'id':_0x26a371['query'][_0xc002('0xf9')]}:undefined,'required':_0x26a371[_0xc002('0x41')][_0xc002('0xf9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x4c8777);})['then'](function(_0x246db4){_0x5f1b5e[_0xc002('0x55')]=_0x246db4;return _0x5f1b5e;});}})[_0xc002('0x1c')](respondWithFilteredResult(_0xaff63a,_0x4c8777))[_0xc002('0x26')](handleError(_0xaff63a,null));};function iftimePromise(_0x13bdc9,_0x2569e5){return respondWithRpcPromise('Command','getSnippet',{'command':_0x2569e5[_0xc002('0xfa')]?util['format'](_0xc002('0xfb'),_0x13bdc9['interval'],_0x2569e5[_0xc002('0xfa')]):util[_0xc002('0xae')](_0xc002('0xfc'),_0x13bdc9[_0xc002('0xfd')])},client9002)['then'](function(_0x31beb9){var _0x200d76=_0x31beb9&&_0x31beb9[_0xc002('0xfe')](_0xc002('0xff'))>=0x0?!![]:![];logger[_0xc002('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2569e5['id'],_0x13bdc9['id'],_0x13bdc9['interval'],_0x200d76?'ONLINE':_0xc002('0x100'),_0x2569e5[_0xc002('0xfa')]?_0x2569e5[_0xc002('0xfa')]:_0xc002('0x101'));return _0x200d76;})[_0xc002('0x26')](function(_0x2491e1){logger[_0xc002('0x21')](_0xc002('0x102'),_0x2569e5['id'],_0x13bdc9['id'],_0x13bdc9[_0xc002('0xfd')],util[_0xc002('0x103')](_0x2491e1,{'showHidden':![],'depth':null}),_0x2569e5['timezone']?_0x2569e5[_0xc002('0xfa')]:'No\x20timezone');return![];});}exports[_0xc002('0x104')]=function(_0x4ee295,_0x197d4c,_0x11fe2d){var _0x4f0573=0x0;var _0x5e8f0f=0x0;var _0x5c91a6=![];var _0x16b360;var _0x363576;return db[_0xc002('0x3b')][_0xc002('0x57')]({'where':{'id':_0x4ee295[_0xc002('0x60')]['id']},'include':[{'model':db[_0xc002('0x105')],'as':_0xc002('0x105'),'include':[{'model':db[_0xc002('0x105')],'as':_0xc002('0x106'),'attributes':['id',_0xc002('0xfd')],'raw':!![]}]}]})[_0xc002('0x1c')](handleEntityNotFound(_0x197d4c,null))[_0xc002('0x1c')](function(_0x1d6684){if(_0x1d6684){_0x16b360=_0x1d6684;return _0x1d6684[_0xc002('0x107')]({'raw':!![]});}})[_0xc002('0x1c')](function(_0x55767a){if(_0x16b360){if(_0x55767a){_0x363576=_0x55767a;}}return require(_0xc002('0x11'))['getLicense']();})[_0xc002('0x1c')](function(_0x55fd66){if(_0x55fd66){_0x5e8f0f=_0x55fd66[_0xc002('0x108')];_0x5c91a6=_0x55fd66[_0xc002('0x77')];}})['then'](function(){return db[_0xc002('0xb5')][_0xc002('0x2d')]({'where':{'closed':![]}});})[_0xc002('0x1c')](function(_0x300bef){_0x4f0573=_0x300bef;if(_0x5e8f0f&&_0x300bef>_0x5e8f0f){return db[_0xc002('0x109')][_0xc002('0x66')]({'where':{'id':0x1}})[_0xc002('0x1c')](function(_0x287d52){if(_0x287d52){_0x287d52['increment'](_0xc002('0x10a'));}});}})[_0xc002('0x1c')](function(){if(_0x16b360[_0xc002('0x105')]&&_0x16b360[_0xc002('0x105')]['Intervals']){var _0x2a1496=[];for(var _0x5e7877=0x0;_0x5e7877<_0x16b360[_0xc002('0x105')][_0xc002('0x106')]['length'];_0x5e7877++){var _0xd826fd=_0x16b360['Interval'][_0xc002('0x106')][_0x5e7877][_0xc002('0x33')]({'plain':!![]});_0x2a1496[_0xc002('0xbb')](iftimePromise(_0xd826fd,_0x16b360));}return BPromise[_0xc002('0x10b')](_0x2a1496)[_0xc002('0x1c')](function(_0x353f45){return _[_0xc002('0x10c')](_0x353f45);});}else{return!![];}})[_0xc002('0x1c')](function(_0x10dcef){var _0x149351=fs['readFileSync'](path[_0xc002('0x74')](config[_0xc002('0x75')],_0xc002('0x10d')),'utf8');var _0x10f523={'remote':_0x16b360[_0xc002('0x10e')],'query':querystring[_0xc002('0x20')](_[_0xc002('0x4f')](_0x16b360[_0xc002('0x33')]({'plain':!![]}),{'customerIp':_0x4ee295[_0xc002('0x88')][_0xc002('0xa6')]||_0x4ee295['headers'][_0xc002('0x10f')]||_0x4ee295[_0xc002('0x110')]['remoteAddress']||_0x4ee295['ip'],'referer':_0x4ee295['headers']['referer'],'openedInteractions':_0x4f0573,'maxInteractions':_0x5e8f0f,'virtual':_0x5c91a6[_0xc002('0x108')],'online':_0x10dcef,'custom':_0x5c91a6}))[_0xc002('0x111')](/'/g,'\x5c\x27')};_0x197d4c[_0xc002('0x37')](ejs['render'](Mustache[_0xc002('0x112')](_0x149351,_0x10f523),{'proactiveActions':_0x363576,'alignment':_0x16b360[_0xc002('0x113')],'verticalAlignment':_0x16b360['verticalAlignment'],'div_color':_0x16b360[_0xc002('0xf8')],'text_color':_0x16b360['textColor'],'button_color':_0x16b360['color_button'],'background_color':_0x16b360[_0xc002('0x114')]}));})['catch'](handleError(_0x197d4c,null));};exports[_0xc002('0x115')]=function(_0x4de956,_0x3b12fa,_0x43719a){return db[_0xc002('0x3b')][_0xc002('0x66')]({'where':{'id':_0x4de956['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x3b12fa,null))[_0xc002('0x1c')](function(_0x5b55c2){if(_0x5b55c2){return db[_0xc002('0xd8')][_0xc002('0x116')](function(_0x273698){return db[_0xc002('0x9c')][_0xc002('0x35')]({'where':{'ChatWebsiteId':_0x4de956['params']['id']},'transaction':_0x273698})[_0xc002('0x1c')](function(_0x313be7){var _0x307190=_[_0xc002('0x3f')](_0x4de956[_0xc002('0x59')],function(_0x246492){_0x246492[_0xc002('0x63')]=_0x4de956[_0xc002('0x60')]['id'];return _0x246492;});return db['ChatApplication'][_0xc002('0xd9')](_0x307190,{'transaction':_0x273698});});})[_0xc002('0x1c')](function(){return db[_0xc002('0x9c')][_0xc002('0x117')]({'where':{'ChatWebsiteId':_0x4de956[_0xc002('0x60')]['id']},'order':_0xc002('0xa0')});});}})[_0xc002('0x1c')](respondWithResult(_0x3b12fa,null))['catch'](handleError(_0x3b12fa,null));};exports['getApplications']=function(_0x311f8a,_0x53e44d,_0x88f25c){var _0x165927={};var _0x4a0db2={};var _0x179810;var _0x46a3d4;return db[_0xc002('0x3b')][_0xc002('0x66')]({'where':{'id':_0x311f8a[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x53e44d,null))[_0xc002('0x1c')](function(_0x21df77){if(_0x21df77){_0x179810=_0x21df77;_0x4a0db2[_0xc002('0x45')]=_['keys'](db[_0xc002('0x9c')]['rawAttributes']);_0x4a0db2['query']=_[_0xc002('0x42')](_0x311f8a['query']);_0x4a0db2['filters']=_[_0xc002('0x44')](_0x4a0db2[_0xc002('0x45')],_0x4a0db2[_0xc002('0x41')]);_0x165927[_0xc002('0x46')]=_[_0xc002('0x44')](_0x4a0db2['model'],qs['fields'](_0x311f8a['query']['fields']));_0x165927[_0xc002('0x46')]=_0x165927[_0xc002('0x46')][_0xc002('0x48')]?_0x165927[_0xc002('0x46')]:_0x4a0db2['model'];_0x165927[_0xc002('0x67')]=qs[_0xc002('0x4b')](_0x311f8a['query'][_0xc002('0x4b')]);_0x165927['where']=qs[_0xc002('0x43')](_[_0xc002('0x4d')](_0x311f8a[_0xc002('0x41')],_0x4a0db2[_0xc002('0x43')]));if(_0x311f8a['query']['filter']){_0x165927[_0xc002('0x4c')]=_[_0xc002('0x4f')](_0x165927[_0xc002('0x4c')],{'$or':_[_0xc002('0x3f')](_0x165927['attributes'],function(_0x5d83c2){var _0x5cd059={};_0x5cd059[_0x5d83c2]={'$like':'%'+_0x311f8a[_0xc002('0x41')]['filter']+'%'};return _0x5cd059;})});}_0x165927=_[_0xc002('0x4f')]({},_0x165927,_0x311f8a[_0xc002('0x51')]);return _0x179810[_0xc002('0x118')](_0x165927);}})[_0xc002('0x1c')](function(_0x530baf){if(_0x530baf){_0x46a3d4=_0x530baf[_0xc002('0x48')];if(!_0x311f8a[_0xc002('0x41')][_0xc002('0x49')]('nolimit')){_0x165927['limit']=qs[_0xc002('0x2c')](_0x311f8a[_0xc002('0x41')]['limit']);_0x165927[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x311f8a[_0xc002('0x41')][_0xc002('0x2a')]);}return _0x179810[_0xc002('0x118')](_0x165927);}})[_0xc002('0x1c')](function(_0x41933e){if(_0x41933e){return _0x41933e?{'count':_0x46a3d4,'rows':_0x41933e}:null;}})[_0xc002('0x1c')](respondWithResult(_0x53e44d,null))['catch'](handleError(_0x53e44d,null));};exports[_0xc002('0x119')]=function(_0xfb0a03,_0x16dfe4,_0x51f389){return db['chatProactiveAction'][_0xc002('0x57')]({'where':{'id':_0xfb0a03[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x16dfe4,null))['then'](function(_0x562a36){if(_0x562a36){return _0x562a36[_0xc002('0x119')](_0xfb0a03[_0xc002('0x59')][_0xc002('0x69')],_[_0xc002('0xf0')](_0xfb0a03[_0xc002('0x59')],[_0xc002('0x69'),'id'])||{});}})[_0xc002('0x1c')](respondWithResult(_0x16dfe4,null))['catch'](handleError(_0x16dfe4,null));};exports[_0xc002('0x107')]=function(_0x6342bf,_0x355059,_0x1b8e97){var _0x542fa1={};var _0x1b1487={};var _0x1ec561;var _0x322a0b;return db[_0xc002('0x3b')]['findOne']({'where':{'id':_0x6342bf['params']['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x355059,null))['then'](function(_0x57d9fe){if(_0x57d9fe){_0x1ec561=_0x57d9fe;_0x1b1487[_0xc002('0x45')]=_[_0xc002('0x42')](db[_0xc002('0x11a')][_0xc002('0x3c')]);_0x1b1487[_0xc002('0x41')]=_[_0xc002('0x42')](_0x6342bf[_0xc002('0x41')]);_0x1b1487['filters']=_[_0xc002('0x44')](_0x1b1487[_0xc002('0x45')],_0x1b1487[_0xc002('0x41')]);_0x542fa1[_0xc002('0x46')]=_[_0xc002('0x44')](_0x1b1487[_0xc002('0x45')],qs[_0xc002('0x47')](_0x6342bf[_0xc002('0x41')][_0xc002('0x47')]));_0x542fa1[_0xc002('0x46')]=_0x542fa1[_0xc002('0x46')][_0xc002('0x48')]?_0x542fa1[_0xc002('0x46')]:_0x1b1487[_0xc002('0x45')];_0x542fa1[_0xc002('0x67')]=qs[_0xc002('0x4b')](_0x6342bf['query'][_0xc002('0x4b')]);_0x542fa1[_0xc002('0x4c')]=qs['filters'](_['pick'](_0x6342bf['query'],_0x1b1487[_0xc002('0x43')]));if(_0x6342bf[_0xc002('0x41')][_0xc002('0x4e')]){_0x542fa1[_0xc002('0x4c')]=_['merge'](_0x542fa1[_0xc002('0x4c')],{'$or':_[_0xc002('0x3f')](_0x542fa1[_0xc002('0x46')],function(_0x3244c){var _0x231c91={};_0x231c91[_0x3244c]={'$like':'%'+_0x6342bf[_0xc002('0x41')]['filter']+'%'};return _0x231c91;})});}_0x542fa1=_[_0xc002('0x4f')]({},_0x542fa1,_0x6342bf[_0xc002('0x51')]);return _0x1ec561[_0xc002('0x107')](_0x542fa1);}})[_0xc002('0x1c')](function(_0x44a566){if(_0x44a566){_0x322a0b=_0x44a566[_0xc002('0x48')];if(!_0x6342bf[_0xc002('0x41')][_0xc002('0x49')](_0xc002('0x4a'))){_0x542fa1[_0xc002('0x2c')]=qs[_0xc002('0x2c')](_0x6342bf[_0xc002('0x41')][_0xc002('0x2c')]);_0x542fa1[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x6342bf[_0xc002('0x41')]['offset']);}return _0x1ec561['getProactiveActions'](_0x542fa1);}})[_0xc002('0x1c')](function(_0x209fa5){if(_0x209fa5){return _0x209fa5?{'count':_0x322a0b,'rows':_0x209fa5}:null;}})['then'](respondWithResult(_0x355059,null))[_0xc002('0x26')](handleError(_0x355059,null));};exports[_0xc002('0x11b')]=function(_0x567845,_0x16a82f,_0x3aaaaf){var _0x56af10=_0x567845['query'][_0xc002('0x11c')]==='false'?_0xc002('0x11d'):_0xc002('0x11e');return db[_0xc002('0x3b')]['find']({'attributes':['id',_0x56af10],'where':{'id':_0x567845[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x16a82f,null))['then'](function(_0x3075ff){if(_0x3075ff){var _0x1f98e1=_0x3075ff[_0x56af10];var _0x351375=_0x1f98e1&&_0x1f98e1[_0xc002('0x11f')]?_0x1f98e1[_0xc002('0x11f')]:[];_0x16a82f['send']({'fromKey':_[_0xc002('0x7c')](_0x1f98e1['fromKey'])?undefined:_0x1f98e1['fromKey'],'count':_0x351375[_0xc002('0x48')],'rows':_0x351375});}})[_0xc002('0x26')](handleError(_0x16a82f,null));};exports[_0xc002('0x120')]=function(_0x1ed485,_0x3e42d2,_0x133847){var _0x2b7698={'raw':![],'where':{}};var _0x53df31={};var _0x32bc1f={'count':0x0,'rows':[]};return db[_0xc002('0x3b')]['findOne']({'where':{'id':_0x1ed485[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x3e42d2,null))[_0xc002('0x1c')](function(_0x468d01){if(_0x468d01){_0x53df31['model']=_[_0xc002('0x42')](db[_0xc002('0xd2')][_0xc002('0x3c')]);_0x53df31[_0xc002('0x41')]=_[_0xc002('0x42')](_0x1ed485[_0xc002('0x41')]);_0x53df31[_0xc002('0x43')]=_[_0xc002('0x44')](_0x53df31[_0xc002('0x45')],_0x53df31[_0xc002('0x41')]);_0x2b7698[_0xc002('0x46')]=_[_0xc002('0x44')](_0x53df31[_0xc002('0x45')],qs[_0xc002('0x47')](_0x1ed485[_0xc002('0x41')][_0xc002('0x47')]));_0x2b7698[_0xc002('0x46')]=_0x2b7698[_0xc002('0x46')]['length']?_0x2b7698[_0xc002('0x46')]:_0x53df31[_0xc002('0x45')];if(!_0x1ed485[_0xc002('0x41')][_0xc002('0x49')](_0xc002('0x4a'))){_0x2b7698[_0xc002('0x2c')]=qs[_0xc002('0x2c')](_0x1ed485[_0xc002('0x41')][_0xc002('0x2c')]);_0x2b7698['offset']=qs[_0xc002('0x2a')](_0x1ed485[_0xc002('0x41')][_0xc002('0x2a')]);}_0x2b7698[_0xc002('0x67')]=qs['sort'](_0x1ed485[_0xc002('0x41')]['sort']);_0x2b7698[_0xc002('0x4c')]=qs[_0xc002('0x43')](_['pick'](_0x1ed485[_0xc002('0x41')],_0x53df31[_0xc002('0x43')]));_0x2b7698[_0xc002('0x4c')]['ChatWebsiteId']=_0x468d01['id'];if(_0x1ed485[_0xc002('0x41')]['filter']){_0x2b7698[_0xc002('0x4c')]=_[_0xc002('0x4f')](_0x2b7698['where'],{'$or':_[_0xc002('0x3f')](_0x2b7698[_0xc002('0x46')],function(_0x7c7cb6){var _0x4ae76f={};_0x4ae76f[_0x7c7cb6]={'$like':'%'+_0x1ed485[_0xc002('0x41')][_0xc002('0x4e')]+'%'};return _0x4ae76f;})});}_0x2b7698=_[_0xc002('0x4f')]({},_0x2b7698,_0x1ed485[_0xc002('0x51')]);return db['ChatOfflineMessage']['count']({'where':_0x2b7698[_0xc002('0x4c')]})[_0xc002('0x1c')](function(_0x1265ff){_0x32bc1f['count']=_0x1265ff;if(_0x1ed485[_0xc002('0x41')][_0xc002('0x52')]){_0x2b7698[_0xc002('0x53')]=[{'all':!![]}];}else{_0x2b7698[_0xc002('0x53')]=[{'model':db['CmContact'],'as':_0xc002('0xf1'),'required':![]},{'model':db['Attachment'],'as':_0xc002('0x121'),'required':![]}];}return db[_0xc002('0xd2')][_0xc002('0x54')](_0x2b7698);})[_0xc002('0x1c')](function(_0x12cdd9){_0x32bc1f[_0xc002('0x55')]=_0x12cdd9;return _0x32bc1f;});}})[_0xc002('0x1c')](respondWithFilteredResult(_0x3e42d2,_0x2b7698))[_0xc002('0x26')](handleError(_0x3e42d2,null));};exports[_0xc002('0x122')]=function(_0x1cbc7f,_0x91d36e,_0x49cc6d){return db['ChatWebsite'][_0xc002('0x57')]({'where':{'id':_0x1cbc7f[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x91d36e,null))[_0xc002('0x1c')](function(_0x246460){if(_0x246460){return _0x246460['addAgents'](_0x1cbc7f[_0xc002('0x59')]['ids'],_[_0xc002('0xf0')](_0x1cbc7f['body'],[_0xc002('0x69'),'id'])||{})['spread'](function(_0x506880){for(var _0x139924=0x0;_0x139924<_0x1cbc7f[_0xc002('0x59')]['ids'][_0xc002('0x48')];_0x139924+=0x1){socket[_0xc002('0x123')](_0xc002('0x124'),{'UserId':Number(_0x1cbc7f[_0xc002('0x59')][_0xc002('0x69')][_0x139924]),'ChatWebsiteId':Number(_0x1cbc7f['params']['id'])});}return _0x506880;});}})['then'](respondWithResult(_0x91d36e,null))[_0xc002('0x26')](handleError(_0x91d36e,null));};exports[_0xc002('0x125')]=function(_0x45dd6c,_0x18ff0c,_0x3be630){return db['ChatWebsite'][_0xc002('0x57')]({'where':{'id':_0x45dd6c[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x18ff0c,null))['then'](function(_0x2e4db0){if(_0x2e4db0){return _0x2e4db0[_0xc002('0x125')](_0x45dd6c['query'][_0xc002('0x69')])['then'](function(){if(_[_0xc002('0x126')](_0x45dd6c[_0xc002('0x41')][_0xc002('0x69')])){for(var _0x47a6bd=0x0;_0x47a6bd<_0x45dd6c[_0xc002('0x41')]['ids']['length'];_0x47a6bd+=0x1){socket['emit'](_0xc002('0x127'),{'UserId':Number(_0x45dd6c['query'][_0xc002('0x69')][_0x47a6bd]),'ChatWebsiteId':Number(_0x45dd6c[_0xc002('0x60')]['id'])});}}else{socket[_0xc002('0x123')](_0xc002('0x127'),{'UserId':Number(_0x45dd6c[_0xc002('0x41')][_0xc002('0x69')]),'ChatWebsiteId':Number(_0x45dd6c[_0xc002('0x60')]['id'])});}});}})[_0xc002('0x1c')](respondWithStatusCode(_0x18ff0c,null))[_0xc002('0x26')](handleError(_0x18ff0c,null));};exports[_0xc002('0x128')]=function(_0x477315,_0x29964e,_0x2a0179){var _0x56d92f={};var _0x32c9ef={};var _0x2aa864;var _0x124890;return db[_0xc002('0x3b')]['findOne']({'where':{'id':_0x477315[_0xc002('0x60')]['id']}})[_0xc002('0x1c')](handleEntityNotFound(_0x29964e,null))['then'](function(_0x53792c){if(_0x53792c){_0x2aa864=_0x53792c;_0x32c9ef[_0xc002('0x45')]=_[_0xc002('0x42')](db[_0xc002('0xf2')]['rawAttributes']);_0x32c9ef['query']=_[_0xc002('0x42')](_0x477315['query']);_0x32c9ef[_0xc002('0x43')]=_[_0xc002('0x44')](_0x32c9ef[_0xc002('0x45')],_0x32c9ef['query']);_0x56d92f[_0xc002('0x46')]=_[_0xc002('0x44')](_0x32c9ef[_0xc002('0x45')],qs[_0xc002('0x47')](_0x477315[_0xc002('0x41')][_0xc002('0x47')]));_0x56d92f[_0xc002('0x46')]=_0x56d92f['attributes'][_0xc002('0x48')]?_0x56d92f[_0xc002('0x46')]:_0x32c9ef[_0xc002('0x45')];_0x56d92f[_0xc002('0x67')]=qs[_0xc002('0x4b')](_0x477315['query'][_0xc002('0x4b')]);_0x56d92f[_0xc002('0x4c')]=qs[_0xc002('0x43')](_['pick'](_0x477315[_0xc002('0x41')],_0x32c9ef[_0xc002('0x43')]));if(_0x477315['query'][_0xc002('0x4e')]){_0x56d92f[_0xc002('0x4c')]=_['merge'](_0x56d92f['where'],{'$or':_[_0xc002('0x3f')](_0x56d92f[_0xc002('0x46')],function(_0x111600){var _0x2523d7={};_0x2523d7[_0x111600]={'$like':'%'+_0x477315['query'][_0xc002('0x4e')]+'%'};return _0x2523d7;})});}_0x56d92f=_[_0xc002('0x4f')]({},_0x56d92f,_0x477315['options']);return _0x2aa864[_0xc002('0x128')](_0x56d92f);}})[_0xc002('0x1c')](function(_0x3a6677){if(_0x3a6677){_0x124890=_0x3a6677[_0xc002('0x48')];if(!_0x477315[_0xc002('0x41')][_0xc002('0x49')](_0xc002('0x4a'))){_0x56d92f['limit']=qs[_0xc002('0x2c')](_0x477315[_0xc002('0x41')][_0xc002('0x2c')]);_0x56d92f[_0xc002('0x2a')]=qs[_0xc002('0x2a')](_0x477315[_0xc002('0x41')]['offset']);}return _0x2aa864[_0xc002('0x128')](_0x56d92f);}})[_0xc002('0x1c')](function(_0xff2174){if(_0xff2174){return _0xff2174?{'count':_0x124890,'rows':_0xff2174}:null;}})[_0xc002('0x1c')](respondWithResult(_0x29964e,null))['catch'](handleError(_0x29964e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index a4813c6..5e5d63d 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6183=['emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x3ee33e,_0x2f0a2b){var _0x369fbd=function(_0x467b7d){while(--_0x467b7d){_0x3ee33e['push'](_0x3ee33e['shift']());}};_0x369fbd(++_0x2f0a2b);}(_0x6183,0x19b));var _0x3618=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x6183[_0x1597e2];return _0x4c8c0a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3618('0x0'))['db'][_0x3618('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3618('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3618('0x3'),'afterDestroy':_0x3618('0x4')};function emitEvent(_0x176f61){return function(_0x2d62a7,_0x21af62,_0x10918c){ChatWebsiteEvents[_0x3618('0x5')](_0x176f61+':'+_0x2d62a7['id'],_0x2d62a7);ChatWebsiteEvents[_0x3618('0x5')](_0x176f61,_0x2d62a7);_0x10918c(null);};}for(var e in events){if(events[_0x3618('0x6')](e)){var event=events[e];ChatWebsite[_0x3618('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x89fe=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x89fe,0x83));var _0xe89f=function(_0xe1758b,_0x1e9517){_0xe1758b=_0xe1758b-0x0;var _0x34ea7f=_0x89fe[_0xe1758b];return _0x34ea7f;};'use strict';var EventEmitter=require(_0xe89f('0x0'));var ChatWebsite=require(_0xe89f('0x1'))['db'][_0xe89f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe89f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe89f('0x4'),'afterDestroy':_0xe89f('0x5')};function emitEvent(_0x580dce){return function(_0x3d3aa8,_0x3d8b30,_0x159e6b){ChatWebsiteEvents[_0xe89f('0x6')](_0x580dce+':'+_0x3d3aa8['id'],_0x3d3aa8);ChatWebsiteEvents[_0xe89f('0x6')](_0x580dce,_0x3d3aa8);_0x159e6b(null);};}for(var e in events){if(events[_0xe89f('0x7')](e)){var event=events[e];ChatWebsite[_0xe89f('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4f54701..dc675ca 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 _0x6d4f=['api','bluebird','request-promise','path','rimraf','exports','define','chat_websites','lodash','../../config/logger'];(function(_0x3b7260,_0x1d2636){var _0x3cfa8e=function(_0x569b2a){while(--_0x569b2a){_0x3b7260['push'](_0x3b7260['shift']());}};_0x3cfa8e(++_0x1d2636);}(_0x6d4f,0x1c0));var _0xf6d4=function(_0x1f7a00,_0x341591){_0x1f7a00=_0x1f7a00-0x0;var _0x4b151c=_0x6d4f[_0x1f7a00];return _0x4b151c;};'use strict';var _=require(_0xf6d4('0x0'));var util=require('util');var logger=require(_0xf6d4('0x1'))(_0xf6d4('0x2'));var moment=require('moment');var BPromise=require(_0xf6d4('0x3'));var rp=require(_0xf6d4('0x4'));var fs=require('fs');var path=require(_0xf6d4('0x5'));var rimraf=require(_0xf6d4('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xf6d4('0x7')]=function(_0x1d6d9e,_0x5397dc){return _0x1d6d9e[_0xf6d4('0x8')]('ChatWebsite',attributes,{'tableName':_0xf6d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a0b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x4c307d,_0x396661){var _0x12b102=function(_0x37b021){while(--_0x37b021){_0x4c307d['push'](_0x4c307d['shift']());}};_0x12b102(++_0x396661);}(_0x7a0b,0x13f));var _0xb7a0=function(_0xc3241e,_0x1c9b20){_0xc3241e=_0xc3241e-0x0;var _0x34d977=_0x7a0b[_0xc3241e];return _0x34d977;};'use strict';var _=require(_0xb7a0('0x0'));var util=require(_0xb7a0('0x1'));var logger=require(_0xb7a0('0x2'))(_0xb7a0('0x3'));var moment=require(_0xb7a0('0x4'));var BPromise=require(_0xb7a0('0x5'));var rp=require(_0xb7a0('0x6'));var fs=require('fs');var path=require(_0xb7a0('0x7'));var rimraf=require(_0xb7a0('0x8'));var config=require(_0xb7a0('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xb7a0('0xa')]=function(_0x5594b9,_0x40aa34){return _0x5594b9['define']('ChatWebsite',attributes,{'tableName':_0xb7a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 1cf23af..cfb6ab2 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 _0x507e=['jayson/promise','client','http','defaults','redis','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x17c731,_0x5af764){var _0x1a4ac2=function(_0x354582){while(--_0x354582){_0x17c731['push'](_0x17c731['shift']());}};_0x1a4ac2(++_0x5af764);}(_0x507e,0x191));var _0xe507=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x507e[_0x5b34c0];return _0x242bd3;};'use strict';var _=require(_0xe507('0x0'));var util=require(_0xe507('0x1'));var moment=require(_0xe507('0x2'));var BPromise=require(_0xe507('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe507('0x4'));var db=require(_0xe507('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe507('0x6'));var config=require('../../config/environment');var jayson=require(_0xe507('0x7'));var client=jayson[_0xe507('0x8')][_0xe507('0x9')]({'port':0x232a});config['redis']=_[_0xe507('0xa')](config[_0xe507('0xb')],{'host':_0xe507('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe507('0xb')]));require(_0xe507('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ca94d,_0x45adc9,_0x7ff2cd){return new BPromise(function(_0x2d2181,_0x5daf19){return client[_0xe507('0xe')](_0x4ca94d,_0x7ff2cd)[_0xe507('0xf')](function(_0x36f71f){logger[_0xe507('0x10')](_0xe507('0x11'),_0x45adc9,'request\x20sent');logger['debug'](_0xe507('0x12'),_0x45adc9,_0xe507('0x13'),JSON['stringify'](_0x36f71f));if(_0x36f71f['error']){if(_0x36f71f['error']['code']===0x1f4){logger[_0xe507('0x14')](_0xe507('0x11'),_0x45adc9,_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);return _0x5daf19(_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);}logger[_0xe507('0x14')](_0xe507('0x11'),_0x45adc9,_0x36f71f['error'][_0xe507('0x15')]);return _0x2d2181(_0x36f71f[_0xe507('0x14')][_0xe507('0x15')]);}else{logger[_0xe507('0x10')](_0xe507('0x11'),_0x45adc9,'request\x20sent');_0x2d2181(_0x36f71f[_0xe507('0x16')]['message']);}})[_0xe507('0x17')](function(_0x4efe20){logger[_0xe507('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x45adc9,_0x4efe20);_0x5daf19(_0x4efe20);});});} \ No newline at end of file +var _0x6c5d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1918a8,_0x56f70a){var _0x194237=function(_0x38337c){while(--_0x38337c){_0x1918a8['push'](_0x1918a8['shift']());}};_0x194237(++_0x56f70a);}(_0x6c5d,0xa1));var _0xd6c5=function(_0x166833,_0x3762fa){_0x166833=_0x166833-0x0;var _0x2ebe30=_0x6c5d[_0x166833];return _0x2ebe30;};'use strict';var _=require(_0xd6c5('0x0'));var util=require(_0xd6c5('0x1'));var moment=require(_0xd6c5('0x2'));var BPromise=require(_0xd6c5('0x3'));var rs=require(_0xd6c5('0x4'));var fs=require('fs');var Redis=require(_0xd6c5('0x5'));var db=require(_0xd6c5('0x6'))['db'];var utils=require(_0xd6c5('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd6c5('0x8'));var client=jayson[_0xd6c5('0x9')][_0xd6c5('0xa')]({'port':0x232a});config['redis']=_[_0xd6c5('0xb')](config[_0xd6c5('0xc')],{'host':_0xd6c5('0xd'),'port':0x18eb});var socket=require(_0xd6c5('0xe'))(new Redis(config[_0xd6c5('0xc')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x663ed3,_0x111ea7,_0x5598d9){return new BPromise(function(_0x4b319f,_0x35e7f6){return client[_0xd6c5('0xf')](_0x663ed3,_0x5598d9)['then'](function(_0x12b8ac){logger[_0xd6c5('0x10')](_0xd6c5('0x11'),_0x111ea7,_0xd6c5('0x12'));logger[_0xd6c5('0x13')](_0xd6c5('0x14'),_0x111ea7,_0xd6c5('0x12'),JSON[_0xd6c5('0x15')](_0x12b8ac));if(_0x12b8ac['error']){if(_0x12b8ac[_0xd6c5('0x16')][_0xd6c5('0x17')]===0x1f4){logger[_0xd6c5('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x111ea7,_0x12b8ac[_0xd6c5('0x16')][_0xd6c5('0x18')]);return _0x35e7f6(_0x12b8ac[_0xd6c5('0x16')][_0xd6c5('0x18')]);}logger[_0xd6c5('0x16')](_0xd6c5('0x11'),_0x111ea7,_0x12b8ac['error'][_0xd6c5('0x18')]);return _0x4b319f(_0x12b8ac[_0xd6c5('0x16')][_0xd6c5('0x18')]);}else{logger['info'](_0xd6c5('0x11'),_0x111ea7,_0xd6c5('0x12'));_0x4b319f(_0x12b8ac[_0xd6c5('0x19')][_0xd6c5('0x18')]);}})[_0xd6c5('0x1a')](function(_0x3ea9e7){logger[_0xd6c5('0x16')](_0xd6c5('0x11'),_0x111ea7,_0x3ea9e7);_0x35e7f6(_0x3ea9e7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 72ceaac..13161be 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 _0x9bbf=['emit','removeListener','register','length','./chatWebsite.events','save','remove','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9bbf,0x164));var _0xf9bb=function(_0x5c28c1,_0x5b4296){_0x5c28c1=_0x5c28c1-0x0;var _0x284229=_0x9bbf[_0x5c28c1];return _0x284229;};'use strict';var ChatWebsiteEvents=require(_0xf9bb('0x0'));var events=[_0xf9bb('0x1'),_0xf9bb('0x2'),_0xf9bb('0x3')];function createListener(_0x360c80,_0xa7b2f8){return function(_0x49efad){_0xa7b2f8[_0xf9bb('0x4')](_0x360c80,_0x49efad);};}function removeListener(_0x15d3ac,_0x12e5bd){return function(){ChatWebsiteEvents[_0xf9bb('0x5')](_0x15d3ac,_0x12e5bd);};}exports[_0xf9bb('0x6')]=function(_0x52bcac){for(var _0x5e92a8=0x0,_0x4468f7=events[_0xf9bb('0x7')];_0x5e92a8<_0x4468f7;_0x5e92a8++){var _0x5487c1=events[_0x5e92a8];var _0x4cc8ad=createListener('chatWebsite:'+_0x5487c1,_0x52bcac);ChatWebsiteEvents['on'](_0x5487c1,_0x4cc8ad);}}; \ No newline at end of file +var _0x01f5=['register','chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener'];(function(_0xde00ae,_0x393852){var _0x4eafef=function(_0x455d19){while(--_0x455d19){_0xde00ae['push'](_0xde00ae['shift']());}};_0x4eafef(++_0x393852);}(_0x01f5,0xfe));var _0x501f=function(_0x20b294,_0x30c563){_0x20b294=_0x20b294-0x0;var _0x14f9bb=_0x01f5[_0x20b294];return _0x14f9bb;};'use strict';var ChatWebsiteEvents=require(_0x501f('0x0'));var events=['save',_0x501f('0x1'),_0x501f('0x2')];function createListener(_0x39e787,_0x1e9d2b){return function(_0x5f68c4){_0x1e9d2b[_0x501f('0x3')](_0x39e787,_0x5f68c4);};}function removeListener(_0x148817,_0xb669e7){return function(){ChatWebsiteEvents[_0x501f('0x4')](_0x148817,_0xb669e7);};}exports[_0x501f('0x5')]=function(_0x31824a){for(var _0x362679=0x0,_0x4ff487=events['length'];_0x362679<_0x4ff487;_0x362679++){var _0x29ccf5=events[_0x362679];var _0x6eacb0=createListener(_0x501f('0x6')+_0x29ccf5,_0x31824a);ChatWebsiteEvents['on'](_0x29ccf5,_0x6eacb0);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fbc4b39..e4b7182 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 _0x0a38=['post','create','addDisposition','/:id/canned_answers','diskStorage','join','root','format','%s-%s','originalname','server/files/images/avatars/','now','single','file','addAvatar','addCustomerAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents'];(function(_0x30428d,_0xa5efd4){var _0x1dd91f=function(_0x4e6ec9){while(--_0x4e6ec9){_0x30428d['push'](_0x30428d['shift']());}};_0x1dd91f(++_0xa5efd4);}(_0x0a38,0x18a));var _0x80a3=function(_0x30747b,_0x4f391a){_0x30747b=_0x30747b-0x0;var _0x240ee8=_0x0a38[_0x30747b];return _0x240ee8;};'use strict';var multer=require('multer');var util=require(_0x80a3('0x0'));var path=require(_0x80a3('0x1'));var timeout=require(_0x80a3('0x2'));var express=require('express');var router=express[_0x80a3('0x3')]();var fs_extra=require(_0x80a3('0x4'));var auth=require(_0x80a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x80a3('0x6'));var controller=require(_0x80a3('0x7'));router['get']('/',auth[_0x80a3('0x8')](),controller[_0x80a3('0x9')]);router[_0x80a3('0xa')](_0x80a3('0xb'),auth['isAuthenticated'](),controller[_0x80a3('0xc')]);router[_0x80a3('0xa')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller[_0x80a3('0xe')]);router[_0x80a3('0xa')](_0x80a3('0xf'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x10')]);router['get']('/:id/canned_answers',auth[_0x80a3('0x8')](),controller[_0x80a3('0x11')]);router[_0x80a3('0xa')](_0x80a3('0x12'),controller[_0x80a3('0x13')]);router[_0x80a3('0xa')](_0x80a3('0x14'),controller[_0x80a3('0x15')]);router['get'](_0x80a3('0x16'),controller[_0x80a3('0x17')]);router[_0x80a3('0xa')](_0x80a3('0x18'),controller['getSystemAvatar']);router[_0x80a3('0xa')](_0x80a3('0x19'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x1a')]);router[_0x80a3('0xa')](_0x80a3('0x1b'),controller[_0x80a3('0x1c')]);router[_0x80a3('0xa')]('/:id/applications',auth[_0x80a3('0x8')](),controller[_0x80a3('0x1d')]);router['get'](_0x80a3('0x1e'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x1f')]);router[_0x80a3('0xa')](_0x80a3('0x20'),controller[_0x80a3('0x21')]);router[_0x80a3('0xa')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x23')]);router[_0x80a3('0xa')](_0x80a3('0x24'),auth['isAuthenticated'](),controller[_0x80a3('0x25')]);router[_0x80a3('0x26')]('/',auth[_0x80a3('0x8')](),controller[_0x80a3('0x27')]);router[_0x80a3('0x26')]('/:id/dispositions',auth[_0x80a3('0x8')](),controller[_0x80a3('0x28')]);router['post'](_0x80a3('0x29'),auth[_0x80a3('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x27f990,_0x264731,_0x54c02a){_0x54c02a(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],'server/files/images/logos/'));},'filename':function(_0xf1abbc,_0x2cf6a1,_0x2e713b){_0x2e713b(null,util[_0x80a3('0x2d')](_0x80a3('0x2e'),Date['now'](),_0x2cf6a1[_0x80a3('0x2f')]));}})});router[_0x80a3('0x26')](_0x80a3('0x12'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x1271bf,_0x3ce520,_0x4ee2be){_0x4ee2be(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x2f187d,_0x54d7a3,_0x426f1d){_0x426f1d(null,util['format'](_0x80a3('0x2e'),Date[_0x80a3('0x31')](),_0x54d7a3['originalname']));}})});router['post'](_0x80a3('0x14'),upload[_0x80a3('0x32')](_0x80a3('0x33')),controller[_0x80a3('0x34')]);var upload=multer({'storage':multer[_0x80a3('0x2a')]({'destination':function(_0x55dee3,_0x555dbf,_0x5196c0){_0x5196c0(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x440d69,_0x12287a,_0x4bc1d6){_0x4bc1d6(null,util[_0x80a3('0x2d')]('%s-%s',Date[_0x80a3('0x31')](),_0x12287a['originalname']));}})});router['post'](_0x80a3('0x16'),upload[_0x80a3('0x32')](_0x80a3('0x33')),controller[_0x80a3('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1894ae,_0x5c7b30,_0xce3f21){_0xce3f21(null,path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x30')));},'filename':function(_0x3767fc,_0xf0f349,_0x5c802b){_0x5c802b(null,util[_0x80a3('0x2d')](_0x80a3('0x2e'),Date['now'](),_0xf0f349[_0x80a3('0x2f')]));}})});router[_0x80a3('0x26')](_0x80a3('0x18'),upload[_0x80a3('0x32')]('file'),controller['addSystemAvatar']);router[_0x80a3('0x26')](_0x80a3('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5e6226,_0x2f6884,_0xbbae41){const _0x3972b4=path[_0x80a3('0x2b')](config[_0x80a3('0x2c')],_0x80a3('0x37'),_0x80a3('0x38'),_0x80a3('0x39'));fs_extra[_0x80a3('0x3a')](_0x3972b4,function(){_0xbbae41(null,_0x3972b4);});},'filename':function(_0x873070,_0x20cc3e,_0x3aea4a){const _0x5586e5=_0x20cc3e[_0x80a3('0x2f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x192372=path[_0x80a3('0x3b')](_0x5586e5);const _0x1840d1=Date['now']()+'-'+_0x5586e5[_0x80a3('0x3c')](_0x192372,'')+_0x192372;_0x3aea4a(null,_0x1840d1);}})});router[_0x80a3('0x26')](_0x80a3('0x3d'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x80a3('0x19'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x3e')]);router['post'](_0x80a3('0x3f'),auth[_0x80a3('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x80a3('0x8')](),controller[_0x80a3('0x40')]);router[_0x80a3('0x26')]('/:id/users',auth[_0x80a3('0x8')](),controller[_0x80a3('0x41')]);router[_0x80a3('0x42')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller['update']);router[_0x80a3('0x43')](_0x80a3('0xd'),auth[_0x80a3('0x8')](),controller['destroy']);router[_0x80a3('0x43')](_0x80a3('0xf'),auth['isAuthenticated'](),controller[_0x80a3('0x44')]);router[_0x80a3('0x43')](_0x80a3('0x29'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x45')]);router[_0x80a3('0x43')](_0x80a3('0x24'),auth[_0x80a3('0x8')](),controller[_0x80a3('0x46')]);module[_0x80a3('0x47')]=router; \ No newline at end of file +var _0x5b23=['addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','diskStorage','server/files/images/avatars/','file','addAvatar','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','update','delete','removeAnswers','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','/:id','/:id/dispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post'];(function(_0x53d9cd,_0x574ebb){var _0x5e0580=function(_0x576aee){while(--_0x576aee){_0x53d9cd['push'](_0x53d9cd['shift']());}};_0x5e0580(++_0x574ebb);}(_0x5b23,0x1eb));var _0x35b2=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x5b23[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require(_0x35b2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x35b2('0x1'));var express=require(_0x35b2('0x2'));var router=express[_0x35b2('0x3')]();var fs_extra=require(_0x35b2('0x4'));var auth=require(_0x35b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x35b2('0x6'));var controller=require(_0x35b2('0x7'));router[_0x35b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x35b2('0x9')]);router[_0x35b2('0x8')](_0x35b2('0xa'),auth[_0x35b2('0xb')](),controller['describe']);router['get'](_0x35b2('0xc'),auth[_0x35b2('0xb')](),controller['show']);router[_0x35b2('0x8')](_0x35b2('0xd'),auth[_0x35b2('0xb')](),controller['getDispositions']);router[_0x35b2('0x8')](_0x35b2('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x35b2('0x8')]('/:id/logo',controller[_0x35b2('0xf')]);router['get'](_0x35b2('0x10'),controller[_0x35b2('0x11')]);router[_0x35b2('0x8')](_0x35b2('0x12'),controller[_0x35b2('0x13')]);router[_0x35b2('0x8')](_0x35b2('0x14'),controller[_0x35b2('0x15')]);router[_0x35b2('0x8')](_0x35b2('0x16'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x17')]);router[_0x35b2('0x8')](_0x35b2('0x18'),controller[_0x35b2('0x19')]);router[_0x35b2('0x8')](_0x35b2('0x1a'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x1b')]);router[_0x35b2('0x8')](_0x35b2('0x1c'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x1d')]);router['get'](_0x35b2('0x1e'),controller[_0x35b2('0x1f')]);router[_0x35b2('0x8')](_0x35b2('0x20'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x21')]);router[_0x35b2('0x8')](_0x35b2('0x22'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x23')]);router[_0x35b2('0x24')]('/',auth[_0x35b2('0xb')](),controller['create']);router[_0x35b2('0x24')](_0x35b2('0xd'),auth['isAuthenticated'](),controller[_0x35b2('0x25')]);router[_0x35b2('0x24')](_0x35b2('0xe'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x413139,_0x449f4c,_0x473c48){_0x473c48(null,path[_0x35b2('0x27')](config[_0x35b2('0x28')],_0x35b2('0x29')));},'filename':function(_0x4ff366,_0x4d2361,_0x4a249a){_0x4a249a(null,util[_0x35b2('0x2a')](_0x35b2('0x2b'),Date['now'](),_0x4d2361['originalname']));}})});router['post']('/:id/logo',upload[_0x35b2('0x2c')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x35b2('0x2d')]({'destination':function(_0x22ed14,_0xc9df1,_0x1a7bb0){_0x1a7bb0(null,path[_0x35b2('0x27')](config['root'],_0x35b2('0x2e')));},'filename':function(_0x1ec12e,_0x2a9d32,_0x3138e2){_0x3138e2(null,util[_0x35b2('0x2a')](_0x35b2('0x2b'),Date['now'](),_0x2a9d32['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x35b2('0x2f')),controller[_0x35b2('0x30')]);var upload=multer({'storage':multer[_0x35b2('0x2d')]({'destination':function(_0x467920,_0x5d1e12,_0x46f5a4){_0x46f5a4(null,path[_0x35b2('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x29eb93,_0x4462ac,_0xce4747){_0xce4747(null,util[_0x35b2('0x2a')](_0x35b2('0x2b'),Date[_0x35b2('0x31')](),_0x4462ac[_0x35b2('0x32')]));}})});router[_0x35b2('0x24')]('/:id/customer_avatar',upload[_0x35b2('0x2c')](_0x35b2('0x2f')),controller[_0x35b2('0x33')]);var upload=multer({'storage':multer[_0x35b2('0x2d')]({'destination':function(_0x89b72d,_0x31afee,_0x57eb65){_0x57eb65(null,path['join'](config['root'],_0x35b2('0x2e')));},'filename':function(_0xd9e75,_0xefc723,_0x4a806e){_0x4a806e(null,util[_0x35b2('0x2a')](_0x35b2('0x2b'),Date[_0x35b2('0x31')](),_0xefc723[_0x35b2('0x32')]));}})});router['post'](_0x35b2('0x14'),upload[_0x35b2('0x2c')](_0x35b2('0x2f')),controller[_0x35b2('0x34')]);router['post'](_0x35b2('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x35b2('0x2d')]({'destination':function(_0x3a3311,_0x2e327d,_0x17f18e){const _0x5b7f31=path[_0x35b2('0x27')](config[_0x35b2('0x28')],_0x35b2('0x36'),'attachments','offline-chat');fs_extra['ensureDir'](_0x5b7f31,function(){_0x17f18e(null,_0x5b7f31);});},'filename':function(_0x466790,_0x127e0f,_0x13ae97){const _0x4b35ab=_0x127e0f[_0x35b2('0x32')][_0x35b2('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x382fda=path['extname'](_0x4b35ab);const _0x2fdd66=Date[_0x35b2('0x31')]()+'-'+_0x4b35ab[_0x35b2('0x37')](_0x382fda,'')+_0x382fda;_0x13ae97(null,_0x2fdd66);}})});router['post'](_0x35b2('0x38'),offlineUploadMulter[_0x35b2('0x39')](),controller[_0x35b2('0x3a')]);router['post']('/:id/interactions',auth[_0x35b2('0xb')](),controller[_0x35b2('0x3b')]);router[_0x35b2('0x24')]('/:id/applications',auth[_0x35b2('0xb')](),controller[_0x35b2('0x3c')]);router[_0x35b2('0x24')]('/:id/proactive_actions',auth[_0x35b2('0xb')](),controller[_0x35b2('0x3d')]);router['post']('/:id/users',auth[_0x35b2('0xb')](),controller['addAgents']);router['put']('/:id',auth[_0x35b2('0xb')](),controller[_0x35b2('0x3e')]);router[_0x35b2('0x3f')](_0x35b2('0xc'),auth[_0x35b2('0xb')](),controller['destroy']);router['delete'](_0x35b2('0xd'),auth[_0x35b2('0xb')](),controller['removeDispositions']);router[_0x35b2('0x3f')](_0x35b2('0xe'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x40')]);router[_0x35b2('0x3f')](_0x35b2('0x22'),auth[_0x35b2('0xb')](),controller[_0x35b2('0x41')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 5b952ae..4431729 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 _0xd1f9=['STRING','ENUM','AmazonAWS','Google'];(function(_0xe910c9,_0x50dd2d){var _0x500749=function(_0x385cc3){while(--_0x385cc3){_0xe910c9['push'](_0xe910c9['shift']());}};_0x500749(++_0x50dd2d);}(_0xd1f9,0x88));var _0x9d1f=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0xd1f9[_0x77773a];return _0x1091a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9d1f('0x1')](_0x9d1f('0x2'),_0x9d1f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9d1f('0x0')]},'data2':{'type':Sequelize[_0x9d1f('0x0')]}}; \ No newline at end of file +var _0x6822=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0xa0579a,_0x46d750){var _0x118ff7=function(_0x3c5f7c){while(--_0x3c5f7c){_0xa0579a['push'](_0xa0579a['shift']());}};_0x118ff7(++_0x46d750);}(_0x6822,0xca));var _0x2682=function(_0x196b6c,_0x1922a8){_0x196b6c=_0x196b6c-0x0;var _0x33d620=_0x6822[_0x196b6c];return _0x33d620;};'use strict';var Sequelize=require(_0x2682('0x0'));module[_0x2682('0x1')]={'name':{'type':Sequelize[_0x2682('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2682('0x3')](_0x2682('0x4'),_0x2682('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2682('0x2')]},'data2':{'type':Sequelize[_0x2682('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8c8a704..ee776bd 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x233414,_0x1bfcdc){var _0xd18a80=function(_0x3654ca){while(--_0x3654ca){_0x233414['push'](_0x233414['shift']());}};_0xd18a80(++_0x1bfcdc);}(_0xdb28,0x106));var _0x8db2=function(_0x3bb66d,_0x2fc61c){_0x3bb66d=_0x3bb66d-0x0;var _0x8446ef=_0xdb28[_0x3bb66d];return _0x8446ef;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2947e8,_0x224ded){_0x2947e8=_0x2947e8-0x0;var _0x472ef1=_0x5f2f[_0x2947e8];return _0x472ef1;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e1f949d..7a4b7d3 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 _0x4893=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','cloud_providers','lodash'];(function(_0x47fbfb,_0x391da4){var _0x45b620=function(_0x31273d){while(--_0x31273d){_0x47fbfb['push'](_0x47fbfb['shift']());}};_0x45b620(++_0x391da4);}(_0x4893,0x153));var _0x3489=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x4893[_0x27beea];return _0x122645;};'use strict';var _=require(_0x3489('0x0'));var util=require(_0x3489('0x1'));var logger=require('../../config/logger')(_0x3489('0x2'));var moment=require(_0x3489('0x3'));var BPromise=require(_0x3489('0x4'));var rp=require(_0x3489('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3489('0x6'));var config=require(_0x3489('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0xd2394,_0x12b66e){return _0xd2394[_0x3489('0x8')]('CloudProvider',attributes,{'tableName':_0x3489('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b2b=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x52a57b,_0x3c634e){var _0x4189d4=function(_0x3c0ef9){while(--_0x3c0ef9){_0x52a57b['push'](_0x52a57b['shift']());}};_0x4189d4(++_0x3c634e);}(_0x1b2b,0xbd));var _0xb1b2=function(_0x53ec7a,_0x2c1f7e){_0x53ec7a=_0x53ec7a-0x0;var _0x3a1407=_0x1b2b[_0x53ec7a];return _0x3a1407;};'use strict';var _=require(_0xb1b2('0x0'));var util=require(_0xb1b2('0x1'));var logger=require(_0xb1b2('0x2'))(_0xb1b2('0x3'));var moment=require(_0xb1b2('0x4'));var BPromise=require(_0xb1b2('0x5'));var rp=require(_0xb1b2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1b2('0x7'));var config=require(_0xb1b2('0x8'));var attributes=require(_0xb1b2('0x9'));module[_0xb1b2('0xa')]=function(_0xa8a56b,_0x155735){return _0xa8a56b[_0xb1b2('0xb')](_0xb1b2('0xc'),attributes,{'tableName':_0xb1b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index cad5f2d..a768514 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 _0xbcae=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbcae,0xa9));var _0xebca=function(_0x5d0fe3,_0x385ac0){_0x5d0fe3=_0x5d0fe3-0x0;var _0x52c998=_0xbcae[_0x5d0fe3];return _0x52c998;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});} \ No newline at end of file +var _0xd878=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5e552e,_0x5520b9){var _0x1e8e0=function(_0x5dc899){while(--_0x5dc899){_0x5e552e['push'](_0x5e552e['shift']());}};_0x1e8e0(++_0x5520b9);}(_0xd878,0x118));var _0x8d87=function(_0x1728fc,_0x45486d){_0x1728fc=_0x1728fc-0x0;var _0x4b94f5=_0xd878[_0x1728fc];return _0x4b94f5;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var moment=require(_0x8d87('0x2'));var BPromise=require(_0x8d87('0x3'));var rs=require(_0x8d87('0x4'));var fs=require('fs');var Redis=require(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d87('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b504e,_0xcb4dae,_0x1eba92){return new BPromise(function(_0x38fded,_0x2c1bd0){return client[_0x8d87('0x9')](_0x1b504e,_0x1eba92)[_0x8d87('0xa')](function(_0xf6aa49){logger['info'](_0x8d87('0xb'),_0xcb4dae,'request\x20sent');logger['debug'](_0x8d87('0xc'),_0xcb4dae,_0x8d87('0xd'),JSON[_0x8d87('0xe')](_0xf6aa49));if(_0xf6aa49[_0x8d87('0xf')]){if(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x10')]===0x1f4){logger['error'](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x2c1bd0(_0xf6aa49['error'][_0x8d87('0x11')]);}logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x38fded(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x11')]);}else{logger[_0x8d87('0x12')](_0x8d87('0xb'),_0xcb4dae,_0x8d87('0xd'));_0x38fded(_0xf6aa49[_0x8d87('0x13')][_0x8d87('0x11')]);}})[_0x8d87('0x14')](function(_0x520df5){logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0x520df5);_0x2c1bd0(_0x520df5);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index d547c81..1488929 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 _0x87f9=['create','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x134387,_0x3bff4b){var _0x34b800=function(_0x522c8b){while(--_0x522c8b){_0x134387['push'](_0x134387['shift']());}};_0x34b800(++_0x3bff4b);}(_0x87f9,0x1a2));var _0x987f=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x87f9[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require('multer');var util=require(_0x987f('0x0'));var path=require(_0x987f('0x1'));var timeout=require(_0x987f('0x2'));var express=require(_0x987f('0x3'));var router=express[_0x987f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x987f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x987f('0x6'));var controller=require(_0x987f('0x7'));router[_0x987f('0x8')]('/',auth[_0x987f('0x9')](),controller[_0x987f('0xa')]);router[_0x987f('0x8')](_0x987f('0xb'),auth[_0x987f('0x9')](),controller[_0x987f('0xc')]);router[_0x987f('0xd')]('/',auth[_0x987f('0x9')](),controller[_0x987f('0xe')]);router['put']('/:id',auth[_0x987f('0x9')](),controller[_0x987f('0xf')]);router[_0x987f('0x10')](_0x987f('0xb'),auth[_0x987f('0x9')](),controller[_0x987f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0837=['isAuthenticated','/:id','show','post','create','put','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get'];(function(_0x461cd6,_0x1f2c68){var _0x368c81=function(_0x12eb9a){while(--_0x12eb9a){_0x461cd6['push'](_0x461cd6['shift']());}};_0x368c81(++_0x1f2c68);}(_0x0837,0x1db));var _0x7083=function(_0x51394f,_0x110f6e){_0x51394f=_0x51394f-0x0;var _0x414657=_0x0837[_0x51394f];return _0x414657;};'use strict';var multer=require(_0x7083('0x0'));var util=require(_0x7083('0x1'));var path=require(_0x7083('0x2'));var timeout=require('connect-timeout');var express=require(_0x7083('0x3'));var router=express[_0x7083('0x4')]();var fs_extra=require(_0x7083('0x5'));var auth=require(_0x7083('0x6'));var interaction=require(_0x7083('0x7'));var config=require(_0x7083('0x8'));var controller=require(_0x7083('0x9'));router[_0x7083('0xa')]('/',auth[_0x7083('0xb')](),controller['index']);router[_0x7083('0xa')](_0x7083('0xc'),auth[_0x7083('0xb')](),controller[_0x7083('0xd')]);router[_0x7083('0xe')]('/',auth[_0x7083('0xb')](),controller[_0x7083('0xf')]);router[_0x7083('0x10')](_0x7083('0xc'),auth[_0x7083('0xb')](),controller['update']);router['delete'](_0x7083('0xc'),auth['isAuthenticated'](),controller[_0x7083('0x11')]);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 f9ddd60..3d86673 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 _0x76aa=['exports','STRING','name'];(function(_0x58f477,_0x1d7d99){var _0x276381=function(_0x1bcf30){while(--_0x1bcf30){_0x58f477['push'](_0x58f477['shift']());}};_0x276381(++_0x1d7d99);}(_0x76aa,0xc0));var _0xa76a=function(_0x30c0e8,_0x14e4cc){_0x30c0e8=_0x30c0e8-0x0;var _0x2c0abb=_0x76aa[_0x30c0e8];return _0x2c0abb;};'use strict';var Sequelize=require('sequelize');module[_0xa76a('0x0')]={'name':{'type':Sequelize[_0xa76a('0x1')],'unique':_0xa76a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa76a('0x1')]},'companyId':{'type':Sequelize[_0xa76a('0x1')]},'website':{'type':Sequelize[_0xa76a('0x1')]},'phone':{'type':Sequelize[_0xa76a('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa76a('0x1')]},'street':{'type':Sequelize[_0xa76a('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa76a('0x1')]},'country':{'type':Sequelize[_0xa76a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa76a('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa76a('0x1')]},'sCountry':{'type':Sequelize[_0xa76a('0x1')]},'description':{'type':Sequelize[_0xa76a('0x1')]}}; \ No newline at end of file +var _0x3eb6=['name','exports','STRING'];(function(_0x203a81,_0x37aefa){var _0x5b45f8=function(_0x3e2061){while(--_0x3e2061){_0x203a81['push'](_0x203a81['shift']());}};_0x5b45f8(++_0x37aefa);}(_0x3eb6,0x1b7));var _0x63eb=function(_0x8ebc5a,_0x3b01c2){_0x8ebc5a=_0x8ebc5a-0x0;var _0x20d39f=_0x3eb6[_0x8ebc5a];return _0x20d39f;};'use strict';var Sequelize=require('sequelize');module[_0x63eb('0x0')]={'name':{'type':Sequelize[_0x63eb('0x1')],'unique':_0x63eb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x63eb('0x1')]},'companyId':{'type':Sequelize[_0x63eb('0x1')]},'website':{'type':Sequelize[_0x63eb('0x1')]},'phone':{'type':Sequelize[_0x63eb('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x63eb('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x63eb('0x1')]},'city':{'type':Sequelize[_0x63eb('0x1')]},'country':{'type':Sequelize[_0x63eb('0x1')]},'email':{'type':Sequelize[_0x63eb('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x63eb('0x1')]},'sPostalCode':{'type':Sequelize[_0x63eb('0x1')]},'sCity':{'type':Sequelize[_0x63eb('0x1')]},'sCountry':{'type':Sequelize[_0x63eb('0x1')]},'description':{'type':Sequelize[_0x63eb('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0c77131..373333d 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 _0x24ef=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','filters','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','getContacts','findOne','CmContact','order','sort','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5d8424,_0x4c4b47){var _0x39b72c=function(_0x1ec701){while(--_0x1ec701){_0x5d8424['push'](_0x5d8424['shift']());}};_0x39b72c(++_0x4c4b47);}(_0x24ef,0x142));var _0xf24e=function(_0x59b731,_0x52f8b3){_0x59b731=_0x59b731-0x0;var _0x23e313=_0x24ef[_0x59b731];return _0x23e313;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require(_0xf24e('0x1'));var zipdir=require(_0xf24e('0x2'));var jsonpatch=require(_0xf24e('0x3'));var rp=require(_0xf24e('0x4'));var moment=require(_0xf24e('0x5'));var BPromise=require(_0xf24e('0x6'));var Mustache=require('mustache');var util=require(_0xf24e('0x7'));var path=require(_0xf24e('0x8'));var sox=require(_0xf24e('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(_0xf24e('0xa'));var crypto=require(_0xf24e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf24e('0xc'));var querystring=require('querystring');var Papa=require(_0xf24e('0xd'));var Redis=require(_0xf24e('0xe'));var authService=require(_0xf24e('0xf'));var qs=require(_0xf24e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf24e('0x11'))(_0xf24e('0x12'));var utils=require(_0xf24e('0x13'));var config=require(_0xf24e('0x14'));var licenseUtil=require(_0xf24e('0x15'));var db=require(_0xf24e('0x16'))['db'];function respondWithStatusCode(_0x40f124,_0x51af54){_0x51af54=_0x51af54||0xcc;return function(_0x5474bd){if(_0x5474bd){return _0x40f124[_0xf24e('0x17')](_0x51af54);}return _0x40f124[_0xf24e('0x18')](_0x51af54)[_0xf24e('0x19')]();};}function respondWithResult(_0x203475,_0x584c8e){_0x584c8e=_0x584c8e||0xc8;return function(_0x55c920){if(_0x55c920){return _0x203475['status'](_0x584c8e)[_0xf24e('0x1a')](_0x55c920);}};}function respondWithFilteredResult(_0xf43f92,_0xca31e7){return function(_0x46d493){if(_0x46d493){var _0x2b2594=typeof _0xca31e7['offset']===_0xf24e('0x1b')&&typeof _0xca31e7[_0xf24e('0x1c')]===_0xf24e('0x1b');var _0x255352=_0x46d493[_0xf24e('0x1d')];var _0x58d5af=_0x2b2594?0x0:_0xca31e7[_0xf24e('0x1e')];var _0xb42ccb=_0x2b2594?_0x46d493['count']:_0xca31e7['offset']+_0xca31e7['limit'];var _0x12bc99;if(_0xb42ccb>=_0x255352){_0xb42ccb=_0x255352;_0x12bc99=0xc8;}else{_0x12bc99=0xce;}_0xf43f92[_0xf24e('0x18')](_0x12bc99);return _0xf43f92[_0xf24e('0x1f')](_0xf24e('0x20'),_0x58d5af+'-'+_0xb42ccb+'/'+_0x255352)['json'](_0x46d493);}return null;};}function patchUpdates(_0x54e56e){return function(_0x11622a){try{jsonpatch['apply'](_0x11622a,_0x54e56e,!![]);}catch(_0xdd0eda){return BPromise[_0xf24e('0x21')](_0xdd0eda);}return _0x11622a[_0xf24e('0x22')]();};}function saveUpdates(_0x22e9e4,_0x159bb6){return function(_0x2824ba){if(_0x2824ba){return _0x2824ba[_0xf24e('0x23')](_0x22e9e4)[_0xf24e('0x24')](function(_0x40b501){return _0x40b501;});}return null;};}function removeEntity(_0x4e47fc,_0x14335f){return function(_0x2be65a){if(_0x2be65a){return _0x2be65a[_0xf24e('0x25')]()[_0xf24e('0x24')](function(){var _0x462ee0=_0x2be65a[_0xf24e('0x26')]({'plain':!![]});var _0x42ce97=_0xf24e('0x27');return db[_0xf24e('0x28')]['destroy']({'where':{'type':_0x42ce97,'resourceId':_0x462ee0['id']}})[_0xf24e('0x24')](function(){return _0x2be65a;});})['then'](function(){_0x4e47fc['status'](0xcc)[_0xf24e('0x19')]();});}};}function handleEntityNotFound(_0x2faaed,_0x16d0de){return function(_0x50f91f){if(!_0x50f91f){_0x2faaed[_0xf24e('0x17')](0x194);}return _0x50f91f;};}function handleError(_0x3afdfb,_0x29034b){_0x29034b=_0x29034b||0x1f4;return function(_0x3f5798){logger['error'](_0x3f5798[_0xf24e('0x29')]);if(_0x3f5798[_0xf24e('0x2a')]){delete _0x3f5798[_0xf24e('0x2a')];}_0x3afdfb[_0xf24e('0x18')](_0x29034b)[_0xf24e('0x2b')](_0x3f5798);};}exports[_0xf24e('0x2c')]=function(_0x13d37e,_0x54af4a){var _0x973708={},_0x4cca11={},_0x44874d={'count':0x0,'rows':[]};return db[_0xf24e('0x2d')][_0xf24e('0x2e')]()[_0xf24e('0x24')](function(_0x53dcf3){_0x4cca11['model']=_[_0xf24e('0x2f')](_0x53dcf3);_0x4cca11[_0xf24e('0x30')]=_[_0xf24e('0x2f')](_0x13d37e['query']);_0x4cca11['filters']=_['intersection'](_0x4cca11[_0xf24e('0x31')],_0x4cca11[_0xf24e('0x30')]);_0x973708[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x4cca11[_0xf24e('0x31')],qs['fields'](_0x13d37e[_0xf24e('0x30')][_0xf24e('0x34')]));_0x973708[_0xf24e('0x32')]=_0x973708[_0xf24e('0x32')][_0xf24e('0x35')]?_0x973708[_0xf24e('0x32')]:_0x4cca11[_0xf24e('0x31')];if(!_0x13d37e[_0xf24e('0x30')][_0xf24e('0x36')]('nolimit')){_0x973708[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x13d37e['query'][_0xf24e('0x1c')]);_0x973708[_0xf24e('0x1e')]=qs['offset'](_0x13d37e[_0xf24e('0x30')][_0xf24e('0x1e')]);}_0x973708['order']=qs['sort'](_0x13d37e[_0xf24e('0x30')]['sort']);_0x973708['where']=qs[_0xf24e('0x37')](_['pick'](_0x13d37e[_0xf24e('0x30')],_0x4cca11[_0xf24e('0x37')]),_0x53dcf3);if(_0x13d37e[_0xf24e('0x30')][_0xf24e('0x38')]){_0x973708[_0xf24e('0x39')]=_[_0xf24e('0x3a')](_0x973708[_0xf24e('0x39')],{'$or':_[_0xf24e('0x3b')](_0x973708[_0xf24e('0x32')],function(_0x40feb0){var _0x370852={};_0x370852[_0x40feb0]={'$like':'%'+_0x13d37e[_0xf24e('0x30')][_0xf24e('0x38')]+'%'};return _0x370852;})});}_0x973708=_['merge']({},_0x973708,_0x13d37e[_0xf24e('0x3c')]);var _0x46ebac={'where':_0x973708[_0xf24e('0x39')]};return db[_0xf24e('0x2d')][_0xf24e('0x1d')](_0x46ebac)[_0xf24e('0x24')](function(_0x18b3fd){_0x44874d['count']=_0x18b3fd;if(_0x13d37e[_0xf24e('0x30')][_0xf24e('0x3d')]){_0x973708[_0xf24e('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x973708);})['then'](function(_0x2f622e){_0x44874d[_0xf24e('0x3f')]=_0x2f622e;return _0x44874d;})[_0xf24e('0x24')](respondWithFilteredResult(_0x54af4a,_0x973708))[_0xf24e('0x40')](handleError(_0x54af4a,null));})[_0xf24e('0x40')](handleError(_0x54af4a,null));};exports[_0xf24e('0x41')]=function(_0x92ecca,_0x4c2f83){var _0x21136a={'raw':![],'where':{'id':_0x92ecca[_0xf24e('0x42')]['id']}},_0x37e011={};_0x37e011[_0xf24e('0x31')]=_['keys'](db[_0xf24e('0x2d')][_0xf24e('0x43')]);_0x37e011[_0xf24e('0x30')]=_['keys'](_0x92ecca['query']);_0x37e011[_0xf24e('0x37')]=_[_0xf24e('0x33')](_0x37e011[_0xf24e('0x31')],_0x37e011['query']);_0x21136a[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x37e011[_0xf24e('0x31')],qs[_0xf24e('0x34')](_0x92ecca[_0xf24e('0x30')]['fields']));_0x21136a[_0xf24e('0x32')]=_0x21136a[_0xf24e('0x32')]['length']?_0x21136a[_0xf24e('0x32')]:_0x37e011[_0xf24e('0x31')];if(_0x92ecca['query'][_0xf24e('0x3d')]){_0x21136a['include']=[{'all':!![]}];}_0x21136a=_['merge']({},_0x21136a,_0x92ecca[_0xf24e('0x3c')]);return db[_0xf24e('0x2d')][_0xf24e('0x44')](_0x21136a)[_0xf24e('0x24')](handleEntityNotFound(_0x4c2f83,null))[_0xf24e('0x24')](respondWithResult(_0x4c2f83,null))[_0xf24e('0x40')](handleError(_0x4c2f83,null));};exports[_0xf24e('0x45')]=function(_0x439d8d,_0x114f36){return db[_0xf24e('0x2d')][_0xf24e('0x45')](_0x439d8d[_0xf24e('0x46')],{})['then'](function(_0xbc3d44){var _0x58cc25=_0x439d8d[_0xf24e('0x47')][_0xf24e('0x26')]({'plain':!![]});if(!_0x58cc25)throw new Error(_0xf24e('0x48'));if(_0x58cc25[_0xf24e('0x49')]===_0xf24e('0x47')){var _0xf3e402=_0xbc3d44[_0xf24e('0x26')]({'plain':!![]});var _0x3a694a=_0xf24e('0x27');return db[_0xf24e('0x4a')][_0xf24e('0x44')]({'where':{'name':_0x3a694a,'userProfileId':_0x58cc25[_0xf24e('0x4b')]},'raw':!![]})['then'](function(_0x4d6838){if(_0x4d6838&&_0x4d6838['autoAssociation']===0x0){return db[_0xf24e('0x28')][_0xf24e('0x45')]({'name':_0xf3e402[_0xf24e('0x2a')],'resourceId':_0xf3e402['id'],'type':_0x4d6838['name'],'sectionId':_0x4d6838['id']},{})[_0xf24e('0x24')](function(){return _0xbc3d44;});}else{return _0xbc3d44;}})['catch'](function(_0x11f66f){logger[_0xf24e('0x4c')](_0xf24e('0x4d'),_0x11f66f);throw _0x11f66f;});}return _0xbc3d44;})[_0xf24e('0x24')](respondWithResult(_0x114f36,0xc9))['catch'](handleError(_0x114f36,null));};exports[_0xf24e('0x23')]=function(_0x4550e7,_0x9a6253){if(_0x4550e7['body']['id']){delete _0x4550e7['body']['id'];}return db[_0xf24e('0x2d')][_0xf24e('0x44')]({'where':{'id':_0x4550e7[_0xf24e('0x42')]['id']}})['then'](handleEntityNotFound(_0x9a6253,null))[_0xf24e('0x24')](saveUpdates(_0x4550e7['body'],null))[_0xf24e('0x24')](respondWithResult(_0x9a6253,null))['catch'](handleError(_0x9a6253,null));};exports['destroy']=function(_0x46bd96,_0x575a5b){return db[_0xf24e('0x2d')][_0xf24e('0x44')]({'where':{'id':_0x46bd96[_0xf24e('0x42')]['id']}})['then'](handleEntityNotFound(_0x575a5b,null))[_0xf24e('0x24')](removeEntity(_0x575a5b,null))[_0xf24e('0x40')](handleError(_0x575a5b,null));};exports['describe']=function(_0x39a32d,_0x2c0b72){return db[_0xf24e('0x2d')][_0xf24e('0x2e')]()[_0xf24e('0x24')](respondWithResult(_0x2c0b72,null))[_0xf24e('0x40')](handleError(_0x2c0b72,null));};exports[_0xf24e('0x4e')]=function(_0x8dfe64,_0x34596a,_0x5fbff4){return db['CmContact'][_0xf24e('0x44')]({'where':{'id':_0x8dfe64[_0xf24e('0x42')]['id']}})[_0xf24e('0x24')](handleEntityNotFound(_0x34596a,null))[_0xf24e('0x24')](function(_0x6e15d8){if(_0x6e15d8){return _0x6e15d8['addContacts'](_0x8dfe64[_0xf24e('0x46')]['ids'],_[_0xf24e('0x4f')](_0x8dfe64[_0xf24e('0x46')],['ids','id'])||{});}})[_0xf24e('0x24')](respondWithResult(_0x34596a,null))['catch'](handleError(_0x34596a,null));};exports[_0xf24e('0x50')]=function(_0x18d134,_0x3319ee,_0x305392){var _0x357c12={};var _0x5b5385={};var _0x3c4f16;var _0x4dd4e7;return db['CmCompany'][_0xf24e('0x51')]({'where':{'id':_0x18d134[_0xf24e('0x42')]['id']}})[_0xf24e('0x24')](handleEntityNotFound(_0x3319ee,null))[_0xf24e('0x24')](function(_0xa364f1){if(_0xa364f1){_0x3c4f16=_0xa364f1;_0x5b5385[_0xf24e('0x31')]=_[_0xf24e('0x2f')](db[_0xf24e('0x52')][_0xf24e('0x43')]);_0x5b5385['query']=_[_0xf24e('0x2f')](_0x18d134['query']);_0x5b5385[_0xf24e('0x37')]=_[_0xf24e('0x33')](_0x5b5385['model'],_0x5b5385[_0xf24e('0x30')]);_0x357c12[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x5b5385[_0xf24e('0x31')],qs[_0xf24e('0x34')](_0x18d134[_0xf24e('0x30')]['fields']));_0x357c12[_0xf24e('0x32')]=_0x357c12[_0xf24e('0x32')][_0xf24e('0x35')]?_0x357c12['attributes']:_0x5b5385['model'];_0x357c12[_0xf24e('0x53')]=qs[_0xf24e('0x54')](_0x18d134['query'][_0xf24e('0x54')]);_0x357c12['where']=qs[_0xf24e('0x37')](_['pick'](_0x18d134[_0xf24e('0x30')],_0x5b5385[_0xf24e('0x37')]));if(_0x18d134[_0xf24e('0x30')][_0xf24e('0x38')]){_0x357c12[_0xf24e('0x39')]=_[_0xf24e('0x3a')](_0x357c12[_0xf24e('0x39')],{'$or':_[_0xf24e('0x3b')](_0x357c12[_0xf24e('0x32')],function(_0x1cbf53){var _0x251228={};_0x251228[_0x1cbf53]={'$like':'%'+_0x18d134[_0xf24e('0x30')][_0xf24e('0x38')]+'%'};return _0x251228;})});}_0x357c12=_[_0xf24e('0x3a')]({},_0x357c12,_0x18d134[_0xf24e('0x3c')]);return _0x3c4f16[_0xf24e('0x50')](_0x357c12);}})[_0xf24e('0x24')](function(_0x3b0584){if(_0x3b0584){_0x4dd4e7=_0x3b0584[_0xf24e('0x35')];if(!_0x18d134['query']['hasOwnProperty'](_0xf24e('0x55'))){_0x357c12[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x18d134[_0xf24e('0x30')][_0xf24e('0x1c')]);_0x357c12[_0xf24e('0x1e')]=qs[_0xf24e('0x1e')](_0x18d134['query'][_0xf24e('0x1e')]);}return _0x3c4f16['getContacts'](_0x357c12);}})[_0xf24e('0x24')](function(_0x17152d){if(_0x17152d){return _0x17152d?{'count':_0x4dd4e7,'rows':_0x17152d}:null;}})['then'](respondWithResult(_0x3319ee,null))[_0xf24e('0x40')](handleError(_0x3319ee,null));}; \ No newline at end of file +var _0x376b=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','CmContact','addContacts','ids','omit','getContacts','findOne','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5e61d7,_0x5951a1){var _0x1107f3=function(_0xbf3c23){while(--_0xbf3c23){_0x5e61d7['push'](_0x5e61d7['shift']());}};_0x1107f3(++_0x5951a1);}(_0x376b,0x19b));var _0xb376=function(_0x17646f,_0x1b81d6){_0x17646f=_0x17646f-0x0;var _0x21508b=_0x376b[_0x17646f];return _0x21508b;};'use strict';var emlformat=require(_0xb376('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb376('0x1'));var jsonpatch=require(_0xb376('0x2'));var rp=require('request-promise');var moment=require(_0xb376('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb376('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb376('0x5'));var csv=require(_0xb376('0x6'));var ejs=require(_0xb376('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb376('0x8'));var squel=require(_0xb376('0x9'));var crypto=require(_0xb376('0xa'));var jsforce=require(_0xb376('0xb'));var deskjs=require(_0xb376('0xc'));var toCsv=require(_0xb376('0x6'));var querystring=require(_0xb376('0xd'));var Papa=require(_0xb376('0xe'));var Redis=require('ioredis');var authService=require(_0xb376('0xf'));var qs=require(_0xb376('0x10'));var as=require(_0xb376('0x11'));var hardwareService=require(_0xb376('0x12'));var logger=require(_0xb376('0x13'))(_0xb376('0x14'));var utils=require('../../config/utils');var config=require(_0xb376('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x562cb0,_0x5a85e3){_0x5a85e3=_0x5a85e3||0xcc;return function(_0x283df6){if(_0x283df6){return _0x562cb0[_0xb376('0x16')](_0x5a85e3);}return _0x562cb0[_0xb376('0x17')](_0x5a85e3)[_0xb376('0x18')]();};}function respondWithResult(_0x2d7622,_0x331c16){_0x331c16=_0x331c16||0xc8;return function(_0x313c6d){if(_0x313c6d){return _0x2d7622[_0xb376('0x17')](_0x331c16)['json'](_0x313c6d);}};}function respondWithFilteredResult(_0x2211a2,_0x23d88b){return function(_0x5b3502){if(_0x5b3502){var _0x41528a=typeof _0x23d88b[_0xb376('0x19')]===_0xb376('0x1a')&&typeof _0x23d88b['limit']===_0xb376('0x1a');var _0x1febe1=_0x5b3502[_0xb376('0x1b')];var _0x1631e0=_0x41528a?0x0:_0x23d88b[_0xb376('0x19')];var _0x24889c=_0x41528a?_0x5b3502[_0xb376('0x1b')]:_0x23d88b[_0xb376('0x19')]+_0x23d88b[_0xb376('0x1c')];var _0x8d7756;if(_0x24889c>=_0x1febe1){_0x24889c=_0x1febe1;_0x8d7756=0xc8;}else{_0x8d7756=0xce;}_0x2211a2['status'](_0x8d7756);return _0x2211a2[_0xb376('0x1d')](_0xb376('0x1e'),_0x1631e0+'-'+_0x24889c+'/'+_0x1febe1)[_0xb376('0x1f')](_0x5b3502);}return null;};}function patchUpdates(_0x1d4b98){return function(_0x2eabff){try{jsonpatch['apply'](_0x2eabff,_0x1d4b98,!![]);}catch(_0x58d0e4){return BPromise['reject'](_0x58d0e4);}return _0x2eabff['save']();};}function saveUpdates(_0xd5c1f1,_0x4fed17){return function(_0x1d5a29){if(_0x1d5a29){return _0x1d5a29[_0xb376('0x20')](_0xd5c1f1)[_0xb376('0x21')](function(_0x33494a){return _0x33494a;});}return null;};}function removeEntity(_0x1ecc09,_0x5efc21){return function(_0x36dea6){if(_0x36dea6){return _0x36dea6['destroy']()['then'](function(){var _0x4d74db=_0x36dea6[_0xb376('0x22')]({'plain':!![]});var _0x2416d9=_0xb376('0x23');return db[_0xb376('0x24')]['destroy']({'where':{'type':_0x2416d9,'resourceId':_0x4d74db['id']}})['then'](function(){return _0x36dea6;});})[_0xb376('0x21')](function(){_0x1ecc09['status'](0xcc)[_0xb376('0x18')]();});}};}function handleEntityNotFound(_0x550951,_0x3c1e70){return function(_0xa74ee8){if(!_0xa74ee8){_0x550951['sendStatus'](0x194);}return _0xa74ee8;};}function handleError(_0x26a2fc,_0x437d25){_0x437d25=_0x437d25||0x1f4;return function(_0x1d94ef){logger['error'](_0x1d94ef[_0xb376('0x25')]);if(_0x1d94ef['name']){delete _0x1d94ef[_0xb376('0x26')];}_0x26a2fc[_0xb376('0x17')](_0x437d25)[_0xb376('0x27')](_0x1d94ef);};}exports[_0xb376('0x28')]=function(_0x2c72d8,_0x334a2a){var _0x367aea={},_0x1ef4d7={},_0x21d1be={'count':0x0,'rows':[]};return db[_0xb376('0x29')][_0xb376('0x2a')]()[_0xb376('0x21')](function(_0x39d9b3){_0x1ef4d7[_0xb376('0x2b')]=_['keys'](_0x39d9b3);_0x1ef4d7[_0xb376('0x2c')]=_[_0xb376('0x2d')](_0x2c72d8[_0xb376('0x2c')]);_0x1ef4d7[_0xb376('0x2e')]=_[_0xb376('0x2f')](_0x1ef4d7['model'],_0x1ef4d7[_0xb376('0x2c')]);_0x367aea[_0xb376('0x30')]=_[_0xb376('0x2f')](_0x1ef4d7['model'],qs['fields'](_0x2c72d8[_0xb376('0x2c')][_0xb376('0x31')]));_0x367aea[_0xb376('0x30')]=_0x367aea['attributes']['length']?_0x367aea['attributes']:_0x1ef4d7[_0xb376('0x2b')];if(!_0x2c72d8[_0xb376('0x2c')]['hasOwnProperty']('nolimit')){_0x367aea[_0xb376('0x1c')]=qs[_0xb376('0x1c')](_0x2c72d8[_0xb376('0x2c')][_0xb376('0x1c')]);_0x367aea[_0xb376('0x19')]=qs['offset'](_0x2c72d8[_0xb376('0x2c')][_0xb376('0x19')]);}_0x367aea[_0xb376('0x32')]=qs['sort'](_0x2c72d8[_0xb376('0x2c')][_0xb376('0x33')]);_0x367aea[_0xb376('0x34')]=qs[_0xb376('0x2e')](_[_0xb376('0x35')](_0x2c72d8[_0xb376('0x2c')],_0x1ef4d7['filters']),_0x39d9b3);if(_0x2c72d8[_0xb376('0x2c')]['filter']){_0x367aea['where']=_[_0xb376('0x36')](_0x367aea['where'],{'$or':_[_0xb376('0x37')](_0x367aea[_0xb376('0x30')],function(_0x19faea){var _0xc6073a={};_0xc6073a[_0x19faea]={'$like':'%'+_0x2c72d8[_0xb376('0x2c')][_0xb376('0x38')]+'%'};return _0xc6073a;})});}_0x367aea=_['merge']({},_0x367aea,_0x2c72d8[_0xb376('0x39')]);var _0x37eac5={'where':_0x367aea[_0xb376('0x34')]};return db['CmCompany'][_0xb376('0x1b')](_0x37eac5)[_0xb376('0x21')](function(_0x337082){_0x21d1be['count']=_0x337082;if(_0x2c72d8['query'][_0xb376('0x3a')]){_0x367aea['include']=[{'all':!![]}];}return db['CmCompany'][_0xb376('0x3b')](_0x367aea);})[_0xb376('0x21')](function(_0x19b320){_0x21d1be[_0xb376('0x3c')]=_0x19b320;return _0x21d1be;})['then'](respondWithFilteredResult(_0x334a2a,_0x367aea))['catch'](handleError(_0x334a2a,null));})[_0xb376('0x3d')](handleError(_0x334a2a,null));};exports[_0xb376('0x3e')]=function(_0x287c6f,_0x277533){var _0x1e8a58={'raw':![],'where':{'id':_0x287c6f[_0xb376('0x3f')]['id']}},_0x19c519={};_0x19c519[_0xb376('0x2b')]=_[_0xb376('0x2d')](db[_0xb376('0x29')][_0xb376('0x40')]);_0x19c519[_0xb376('0x2c')]=_[_0xb376('0x2d')](_0x287c6f[_0xb376('0x2c')]);_0x19c519[_0xb376('0x2e')]=_[_0xb376('0x2f')](_0x19c519['model'],_0x19c519[_0xb376('0x2c')]);_0x1e8a58[_0xb376('0x30')]=_[_0xb376('0x2f')](_0x19c519[_0xb376('0x2b')],qs[_0xb376('0x31')](_0x287c6f['query'][_0xb376('0x31')]));_0x1e8a58[_0xb376('0x30')]=_0x1e8a58['attributes'][_0xb376('0x41')]?_0x1e8a58[_0xb376('0x30')]:_0x19c519[_0xb376('0x2b')];if(_0x287c6f[_0xb376('0x2c')][_0xb376('0x3a')]){_0x1e8a58[_0xb376('0x42')]=[{'all':!![]}];}_0x1e8a58=_[_0xb376('0x36')]({},_0x1e8a58,_0x287c6f[_0xb376('0x39')]);return db['CmCompany'][_0xb376('0x43')](_0x1e8a58)[_0xb376('0x21')](handleEntityNotFound(_0x277533,null))['then'](respondWithResult(_0x277533,null))[_0xb376('0x3d')](handleError(_0x277533,null));};exports[_0xb376('0x44')]=function(_0x403c39,_0x1a24ce){return db[_0xb376('0x29')]['create'](_0x403c39['body'],{})[_0xb376('0x21')](function(_0x1008dd){var _0x19592=_0x403c39['user'][_0xb376('0x22')]({'plain':!![]});if(!_0x19592)throw new Error(_0xb376('0x45'));if(_0x19592[_0xb376('0x46')]===_0xb376('0x47')){var _0x2e27fb=_0x1008dd[_0xb376('0x22')]({'plain':!![]});var _0x317b22='Companies';return db[_0xb376('0x48')]['find']({'where':{'name':_0x317b22,'userProfileId':_0x19592[_0xb376('0x49')]},'raw':!![]})['then'](function(_0x59cc4a){if(_0x59cc4a&&_0x59cc4a[_0xb376('0x4a')]===0x0){return db[_0xb376('0x24')][_0xb376('0x44')]({'name':_0x2e27fb[_0xb376('0x26')],'resourceId':_0x2e27fb['id'],'type':_0x59cc4a['name'],'sectionId':_0x59cc4a['id']},{})[_0xb376('0x21')](function(){return _0x1008dd;});}else{return _0x1008dd;}})['catch'](function(_0x487202){logger['error'](_0xb376('0x4b'),_0x487202);throw _0x487202;});}return _0x1008dd;})[_0xb376('0x21')](respondWithResult(_0x1a24ce,0xc9))[_0xb376('0x3d')](handleError(_0x1a24ce,null));};exports['update']=function(_0x134781,_0x593d96){if(_0x134781[_0xb376('0x4c')]['id']){delete _0x134781[_0xb376('0x4c')]['id'];}return db[_0xb376('0x29')]['find']({'where':{'id':_0x134781[_0xb376('0x3f')]['id']}})[_0xb376('0x21')](handleEntityNotFound(_0x593d96,null))[_0xb376('0x21')](saveUpdates(_0x134781[_0xb376('0x4c')],null))['then'](respondWithResult(_0x593d96,null))[_0xb376('0x3d')](handleError(_0x593d96,null));};exports[_0xb376('0x4d')]=function(_0xecddc9,_0x3cfde5){return db[_0xb376('0x29')][_0xb376('0x43')]({'where':{'id':_0xecddc9['params']['id']}})[_0xb376('0x21')](handleEntityNotFound(_0x3cfde5,null))[_0xb376('0x21')](removeEntity(_0x3cfde5,null))[_0xb376('0x3d')](handleError(_0x3cfde5,null));};exports[_0xb376('0x2a')]=function(_0x3c2b89,_0x1be9fc){return db[_0xb376('0x29')][_0xb376('0x2a')]()[_0xb376('0x21')](respondWithResult(_0x1be9fc,null))['catch'](handleError(_0x1be9fc,null));};exports['addContacts']=function(_0x4bace0,_0x302d85,_0x34f0b2){return db[_0xb376('0x4e')][_0xb376('0x43')]({'where':{'id':_0x4bace0['params']['id']}})['then'](handleEntityNotFound(_0x302d85,null))['then'](function(_0x5ac146){if(_0x5ac146){return _0x5ac146[_0xb376('0x4f')](_0x4bace0[_0xb376('0x4c')][_0xb376('0x50')],_[_0xb376('0x51')](_0x4bace0[_0xb376('0x4c')],[_0xb376('0x50'),'id'])||{});}})[_0xb376('0x21')](respondWithResult(_0x302d85,null))[_0xb376('0x3d')](handleError(_0x302d85,null));};exports[_0xb376('0x52')]=function(_0x574cae,_0x56dfbf,_0x559231){var _0x523912={};var _0x39da07={};var _0x14eb40;var _0xa5a27;return db[_0xb376('0x29')][_0xb376('0x53')]({'where':{'id':_0x574cae[_0xb376('0x3f')]['id']}})[_0xb376('0x21')](handleEntityNotFound(_0x56dfbf,null))[_0xb376('0x21')](function(_0x478ead){if(_0x478ead){_0x14eb40=_0x478ead;_0x39da07['model']=_[_0xb376('0x2d')](db[_0xb376('0x4e')]['rawAttributes']);_0x39da07[_0xb376('0x2c')]=_[_0xb376('0x2d')](_0x574cae[_0xb376('0x2c')]);_0x39da07['filters']=_[_0xb376('0x2f')](_0x39da07[_0xb376('0x2b')],_0x39da07[_0xb376('0x2c')]);_0x523912[_0xb376('0x30')]=_['intersection'](_0x39da07[_0xb376('0x2b')],qs[_0xb376('0x31')](_0x574cae[_0xb376('0x2c')][_0xb376('0x31')]));_0x523912[_0xb376('0x30')]=_0x523912[_0xb376('0x30')][_0xb376('0x41')]?_0x523912['attributes']:_0x39da07['model'];_0x523912[_0xb376('0x32')]=qs[_0xb376('0x33')](_0x574cae['query'][_0xb376('0x33')]);_0x523912['where']=qs['filters'](_[_0xb376('0x35')](_0x574cae[_0xb376('0x2c')],_0x39da07['filters']));if(_0x574cae[_0xb376('0x2c')][_0xb376('0x38')]){_0x523912['where']=_[_0xb376('0x36')](_0x523912['where'],{'$or':_['map'](_0x523912[_0xb376('0x30')],function(_0x2fef8d){var _0x1e30a5={};_0x1e30a5[_0x2fef8d]={'$like':'%'+_0x574cae[_0xb376('0x2c')]['filter']+'%'};return _0x1e30a5;})});}_0x523912=_[_0xb376('0x36')]({},_0x523912,_0x574cae[_0xb376('0x39')]);return _0x14eb40[_0xb376('0x52')](_0x523912);}})[_0xb376('0x21')](function(_0x1c87c2){if(_0x1c87c2){_0xa5a27=_0x1c87c2[_0xb376('0x41')];if(!_0x574cae[_0xb376('0x2c')][_0xb376('0x54')]('nolimit')){_0x523912[_0xb376('0x1c')]=qs[_0xb376('0x1c')](_0x574cae[_0xb376('0x2c')]['limit']);_0x523912[_0xb376('0x19')]=qs[_0xb376('0x19')](_0x574cae[_0xb376('0x2c')][_0xb376('0x19')]);}return _0x14eb40[_0xb376('0x52')](_0x523912);}})[_0xb376('0x21')](function(_0x363bf5){if(_0x363bf5){return _0x363bf5?{'count':_0xa5a27,'rows':_0x363bf5}:null;}})[_0xb376('0x21')](respondWithResult(_0x56dfbf,null))[_0xb376('0x3d')](handleError(_0x56dfbf,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b8b93b8..5308afa 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 _0x55bc=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','CmCompany'];(function(_0x112439,_0x17560a){var _0x4e8140=function(_0x4ce95b){while(--_0x4ce95b){_0x112439['push'](_0x112439['shift']());}};_0x4e8140(++_0x17560a);}(_0x55bc,0x15e));var _0xc55b=function(_0x3cbe29,_0x9fc9ec){_0x3cbe29=_0x3cbe29-0x0;var _0x4ae129=_0x55bc[_0x3cbe29];return _0x4ae129;};'use strict';var _=require(_0xc55b('0x0'));var util=require(_0xc55b('0x1'));var logger=require('../../config/logger')(_0xc55b('0x2'));var moment=require(_0xc55b('0x3'));var BPromise=require(_0xc55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc55b('0x5'));var rimraf=require('rimraf');var config=require(_0xc55b('0x6'));var attributes=require('./cmCompany.attributes');module[_0xc55b('0x7')]=function(_0x3dcbfe,_0x4b2d1b){return _0x3dcbfe[_0xc55b('0x8')](_0xc55b('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfc1=['rimraf','../../config/environment','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b948f,_0x398e62){var _0x1237bc=function(_0x3c1843){while(--_0x3c1843){_0x2b948f['push'](_0x2b948f['shift']());}};_0x1237bc(++_0x398e62);}(_0xbfc1,0x87));var _0x1bfc=function(_0x401fc3,_0x2cedfd){_0x401fc3=_0x401fc3-0x0;var _0x302db3=_0xbfc1[_0x401fc3];return _0x302db3;};'use strict';var _=require(_0x1bfc('0x0'));var util=require(_0x1bfc('0x1'));var logger=require(_0x1bfc('0x2'))(_0x1bfc('0x3'));var moment=require(_0x1bfc('0x4'));var BPromise=require(_0x1bfc('0x5'));var rp=require(_0x1bfc('0x6'));var fs=require('fs');var path=require(_0x1bfc('0x7'));var rimraf=require(_0x1bfc('0x8'));var config=require(_0x1bfc('0x9'));var attributes=require('./cmCompany.attributes');module[_0x1bfc('0xa')]=function(_0x367ebc,_0x371dca){return _0x367ebc[_0x1bfc('0xb')]('CmCompany',attributes,{'tableName':_0x1bfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 0680d38..44db619 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 _0xa210=['message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xa210,0xa5));var _0x0a21=function(_0x5ec75a,_0x4e1a09){_0x5ec75a=_0x5ec75a-0x0;var _0x10add9=_0xa210[_0x5ec75a];return _0x10add9;};'use strict';var _=require(_0x0a21('0x0'));var util=require(_0x0a21('0x1'));var moment=require(_0x0a21('0x2'));var BPromise=require(_0x0a21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a21('0x5'))('rpc');var config=require(_0x0a21('0x6'));var jayson=require(_0x0a21('0x7'));var client=jayson['client'][_0x0a21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ca52a,_0x5834fa,_0x3294ac){return new BPromise(function(_0x46b61f,_0x4903e4){return client['request'](_0x4ca52a,_0x3294ac)[_0x0a21('0x9')](function(_0x4cfc24){logger['info'](_0x0a21('0xa'),_0x5834fa,_0x0a21('0xb'));logger[_0x0a21('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5834fa,_0x0a21('0xb'),JSON['stringify'](_0x4cfc24));if(_0x4cfc24[_0x0a21('0xd')]){if(_0x4cfc24['error'][_0x0a21('0xe')]===0x1f4){logger[_0x0a21('0xd')]('CmCompany,\x20%s,\x20%s',_0x5834fa,_0x4cfc24['error']['message']);return _0x4903e4(_0x4cfc24[_0x0a21('0xd')][_0x0a21('0xf')]);}logger[_0x0a21('0xd')](_0x0a21('0xa'),_0x5834fa,_0x4cfc24[_0x0a21('0xd')]['message']);return _0x46b61f(_0x4cfc24['error'][_0x0a21('0xf')]);}else{logger[_0x0a21('0x10')](_0x0a21('0xa'),_0x5834fa,'request\x20sent');_0x46b61f(_0x4cfc24['result'][_0x0a21('0xf')]);}})[_0x0a21('0x11')](function(_0x2e307a){logger[_0x0a21('0xd')](_0x0a21('0xa'),_0x5834fa,_0x2e307a);_0x4903e4(_0x2e307a);});});} \ No newline at end of file +var _0x56bb=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x56bb,0x181));var _0xb56b=function(_0x585d87,_0x2b0f33){_0x585d87=_0x585d87-0x0;var _0xb18540=_0x56bb[_0x585d87];return _0xb18540;};'use strict';var _=require(_0xb56b('0x0'));var util=require('util');var moment=require(_0xb56b('0x1'));var BPromise=require(_0xb56b('0x2'));var rs=require(_0xb56b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb56b('0x4'))['db'];var utils=require(_0xb56b('0x5'));var logger=require(_0xb56b('0x6'))(_0xb56b('0x7'));var config=require(_0xb56b('0x8'));var jayson=require(_0xb56b('0x9'));var client=jayson[_0xb56b('0xa')][_0xb56b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529ca,_0x1e01bc,_0x57e758){return new BPromise(function(_0x3041a6,_0x316e04){return client[_0xb56b('0xc')](_0x2529ca,_0x57e758)[_0xb56b('0xd')](function(_0x5bd9fe){logger[_0xb56b('0xe')](_0xb56b('0xf'),_0x1e01bc,'request\x20sent');logger['debug'](_0xb56b('0x10'),_0x1e01bc,_0xb56b('0x11'),JSON[_0xb56b('0x12')](_0x5bd9fe));if(_0x5bd9fe['error']){if(_0x5bd9fe['error'][_0xb56b('0x13')]===0x1f4){logger[_0xb56b('0x14')](_0xb56b('0xf'),_0x1e01bc,_0x5bd9fe[_0xb56b('0x14')][_0xb56b('0x15')]);return _0x316e04(_0x5bd9fe[_0xb56b('0x14')][_0xb56b('0x15')]);}logger[_0xb56b('0x14')](_0xb56b('0xf'),_0x1e01bc,_0x5bd9fe[_0xb56b('0x14')]['message']);return _0x3041a6(_0x5bd9fe['error']['message']);}else{logger[_0xb56b('0xe')]('CmCompany,\x20%s,\x20%s',_0x1e01bc,'request\x20sent');_0x3041a6(_0x5bd9fe[_0xb56b('0x16')]['message']);}})[_0xb56b('0x17')](function(_0x350a1b){logger[_0xb56b('0x14')]('CmCompany,\x20%s,\x20%s',_0x1e01bc,_0x350a1b);_0x316e04(_0x350a1b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 078f55a..dbe0912 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 _0xb898=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','create','addContacts','update','delete','destroy','exports','multer','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb898,0xcd));var _0x8b89=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0xb898[_0x5f3905];return _0x2923b1;};'use strict';var multer=require(_0x8b89('0x0'));var util=require(_0x8b89('0x1'));var path=require(_0x8b89('0x2'));var timeout=require(_0x8b89('0x3'));var express=require(_0x8b89('0x4'));var router=express[_0x8b89('0x5')]();var fs_extra=require(_0x8b89('0x6'));var auth=require(_0x8b89('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8b89('0x8'));var controller=require(_0x8b89('0x9'));router['get']('/',auth[_0x8b89('0xa')](),controller[_0x8b89('0xb')]);router['get'](_0x8b89('0xc'),auth['isAuthenticated'](),controller[_0x8b89('0xd')]);router['get'](_0x8b89('0xe'),auth['isAuthenticated'](),controller[_0x8b89('0xf')]);router['get'](_0x8b89('0x10'),auth[_0x8b89('0xa')](),controller['getContacts']);router['post']('/',auth[_0x8b89('0xa')](),controller[_0x8b89('0x11')]);router['post'](_0x8b89('0x10'),auth[_0x8b89('0xa')](),controller[_0x8b89('0x12')]);router['put'](_0x8b89('0xe'),auth[_0x8b89('0xa')](),controller[_0x8b89('0x13')]);router[_0x8b89('0x14')]('/:id',auth[_0x8b89('0xa')](),controller[_0x8b89('0x15')]);module[_0x8b89('0x16')]=router; \ No newline at end of file +var _0x39cc=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xcbbbc,_0x275987){var _0x86a40f=function(_0x5c8d06){while(--_0x5c8d06){_0xcbbbc['push'](_0xcbbbc['shift']());}};_0x86a40f(++_0x275987);}(_0x39cc,0x83));var _0xc39c=function(_0x8de143,_0x325ff5){_0x8de143=_0x8de143-0x0;var _0x43f886=_0x39cc[_0x8de143];return _0x43f886;};'use strict';var multer=require(_0xc39c('0x0'));var util=require('util');var path=require(_0xc39c('0x1'));var timeout=require(_0xc39c('0x2'));var express=require(_0xc39c('0x3'));var router=express[_0xc39c('0x4')]();var fs_extra=require(_0xc39c('0x5'));var auth=require(_0xc39c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc39c('0x7'));var controller=require(_0xc39c('0x8'));router[_0xc39c('0x9')]('/',auth[_0xc39c('0xa')](),controller[_0xc39c('0xb')]);router['get']('/describe',auth[_0xc39c('0xa')](),controller[_0xc39c('0xc')]);router['get'](_0xc39c('0xd'),auth[_0xc39c('0xa')](),controller[_0xc39c('0xe')]);router[_0xc39c('0x9')](_0xc39c('0xf'),auth[_0xc39c('0xa')](),controller[_0xc39c('0x10')]);router['post']('/',auth[_0xc39c('0xa')](),controller['create']);router[_0xc39c('0x11')]('/:id/contacts',auth[_0xc39c('0xa')](),controller[_0xc39c('0x12')]);router[_0xc39c('0x13')]('/:id',auth[_0xc39c('0xa')](),controller[_0xc39c('0x14')]);router['delete'](_0xc39c('0xd'),auth[_0xc39c('0xa')](),controller[_0xc39c('0x15')]);module[_0xc39c('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 68ffb47..2a84273 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 _0xfd46=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfd46,0x113));var _0x6fd4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfd46[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var Sequelize=require(_0x6fd4('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x6fd4('0x1')]},'street':{'type':Sequelize[_0x6fd4('0x1')]},'postalCode':{'type':Sequelize[_0x6fd4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6fd4('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6fd4('0x2')]},'phone':{'type':Sequelize[_0x6fd4('0x1')]},'mobile':{'type':Sequelize[_0x6fd4('0x1')]},'fax':{'type':Sequelize[_0x6fd4('0x1')]},'email':{'type':Sequelize[_0x6fd4('0x1')]},'url':{'type':Sequelize[_0x6fd4('0x1')]},'facebook':{'type':Sequelize[_0x6fd4('0x1')]},'fb_data':{'type':Sequelize[_0x6fd4('0x1')]},'twitter':{'type':Sequelize[_0x6fd4('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6fd4('0x1')]},'telegram':{'type':Sequelize[_0x6fd4('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x6fd4('0x3')](0x2)[_0x6fd4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6fd4('0x5')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xd9a6=['DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0xe87305,_0x512b65){var _0x1c318b=function(_0x295dbb){while(--_0x295dbb){_0xe87305['push'](_0xe87305['shift']());}};_0x1c318b(++_0x512b65);}(_0xd9a6,0x174));var _0x6d9a=function(_0x593b5d,_0x3d5178){_0x593b5d=_0x593b5d-0x0;var _0x388704=_0xd9a6[_0x593b5d];return _0x388704;};'use strict';var _=require(_0x6d9a('0x0'));var Sequelize=require(_0x6d9a('0x1'));module[_0x6d9a('0x2')]={'firstName':{'type':Sequelize[_0x6d9a('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6d9a('0x3')]},'street':{'type':Sequelize[_0x6d9a('0x3')]},'postalCode':{'type':Sequelize[_0x6d9a('0x3')]},'city':{'type':Sequelize[_0x6d9a('0x3')]},'country':{'type':Sequelize[_0x6d9a('0x3')]},'dateOfBirth':{'type':Sequelize[_0x6d9a('0x3')]},'description':{'type':Sequelize[_0x6d9a('0x4')]},'phone':{'type':Sequelize[_0x6d9a('0x3')]},'mobile':{'type':Sequelize[_0x6d9a('0x3')]},'fax':{'type':Sequelize[_0x6d9a('0x3')]},'email':{'type':Sequelize[_0x6d9a('0x3')]},'url':{'type':Sequelize[_0x6d9a('0x3')]},'facebook':{'type':Sequelize[_0x6d9a('0x3')]},'fb_data':{'type':Sequelize[_0x6d9a('0x3')]},'twitter':{'type':Sequelize[_0x6d9a('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x6d9a('0x3')]},'viber':{'type':Sequelize[_0x6d9a('0x3')]},'line':{'type':Sequelize[_0x6d9a('0x3')]},'wechat':{'type':Sequelize[_0x6d9a('0x3')]},'telegram':{'type':Sequelize[_0x6d9a('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x6d9a('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6d9a('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3b6650a..33a1684 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 _0xe7f3=['includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','path','meta','binding','phone','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','voice','channel','includes','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','startCase','closedAt','disposition','secondDisposition','thirdDisposition','key','browserName','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','Owner','all','flatten','sortBy','reverse','slice','moment','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','status','json','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','keys','length','cf_','push','CmCustomField','trimStart','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','isArray','tag','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','agent','some','c.ListId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','split','rows','catch','find','describe','tags','startsWith','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','findOrCreate','spread','show','omit','params','$and','pickBy','table','setFields','id\x20=\x20?','toParam','CmHopper','getTags','findOne','options','setTags','ids','getHoppers','ContactId','rawAttributes'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xe7f3,0x16d));var _0x3e7f=function(_0x4b9465,_0x348762){_0x4b9465=_0x4b9465-0x0;var _0x11bcf3=_0xe7f3[_0x4b9465];return _0x11bcf3;};'use strict';var moment=require(_0x3e7f('0x0'));var BPromise=require('bluebird');var util=require(_0x3e7f('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x3e7f('0x2'));var squel=require(_0x3e7f('0x3'));var Papa=require(_0x3e7f('0x4'));var Redis=require(_0x3e7f('0x5'));var qs=require(_0x3e7f('0x6'));var as=require(_0x3e7f('0x7'));var logger=require(_0x3e7f('0x8'))(_0x3e7f('0x9'));var config=require('../../config/environment');var db=require(_0x3e7f('0xa'))['db'];config[_0x3e7f('0xb')]=_[_0x3e7f('0xc')](config[_0x3e7f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e7f('0xd'))(new Redis(config[_0x3e7f('0xb')]));require(_0x3e7f('0xe'))['register'](socket);function respondWithResult(_0x5623d4,_0x37f447){_0x37f447=_0x37f447||0xc8;return function(_0x482d38){if(_0x482d38){return _0x5623d4[_0x3e7f('0xf')](_0x37f447)[_0x3e7f('0x10')](_0x482d38);}};}function respondWithFilteredResult(_0x3f4081,_0x28936d){return function(_0x5959b3){if(_0x5959b3){var _0x223819=typeof _0x28936d['offset']===_0x3e7f('0x11')&&typeof _0x28936d[_0x3e7f('0x12')]==='undefined';var _0x4315bd=_0x5959b3[_0x3e7f('0x13')];var _0x5a36e6=_0x223819?0x0:_0x28936d[_0x3e7f('0x14')];var _0xad4e18=_0x223819?_0x5959b3['count']:_0x28936d[_0x3e7f('0x14')]+_0x28936d['limit'];var _0xf2203e;if(_0xad4e18>=_0x4315bd){_0xad4e18=_0x4315bd;_0xf2203e=0xc8;}else{_0xf2203e=0xce;}_0x3f4081[_0x3e7f('0xf')](_0xf2203e);return _0x3f4081[_0x3e7f('0x15')]('Content-Range',_0x5a36e6+'-'+_0xad4e18+'/'+_0x4315bd)[_0x3e7f('0x10')](_0x5959b3);}return null;};}function saveUpdates(_0x4a2975){return function(_0x2bb819){if(_0x2bb819){return _0x2bb819[_0x3e7f('0x16')](_0x4a2975)[_0x3e7f('0x17')](function(_0xb2dede){return _0xb2dede;});}return null;};}function removeEntity(_0x1f8abc){return function(_0x100d23){if(_0x100d23){return _0x100d23[_0x3e7f('0x18')]()['then'](function(){_0x1f8abc[_0x3e7f('0xf')](0xcc)[_0x3e7f('0x19')]();});}};}function handleEntityNotFound(_0x1347f1){return function(_0x315883){if(!_0x315883){_0x1347f1[_0x3e7f('0x1a')](0x194);}return _0x315883;};}function handleError(_0x3f56d6,_0x488738){_0x488738=_0x488738||0x1f4;return function(_0x3c788c){logger[_0x3e7f('0x1b')](_0x3c788c[_0x3e7f('0x1c')]);if(_0x3c788c[_0x3e7f('0x1d')]){delete _0x3c788c['name'];}_0x3f56d6['status'](_0x488738)[_0x3e7f('0x1e')](_0x3c788c);};}exports[_0x3e7f('0x1f')]=function(_0x318240,_0x38a392){var _0xcfdcf7={},_0x456a25={},_0xed064f={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x3e7f('0x17')](function(_0x45fa8e){var _0x3d26df=[];for(var _0x5cc2fd=0x0;_0x5cc2fd0x1){_0x230dba['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3e7f('0x5c')](_0x2ba8cf),null);}else{if(qs[_0x3e7f('0x5d')](_0x2ba8cf)){_0x230dba['or'](_0x3e7f('0x5e'),_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x5f'),_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x60'),_0x2ba8cf+'%');_0x230dba['or']('c.fax\x20LIKE\x20?',_0x2ba8cf+'%');}else if(qs[_0x3e7f('0x61')](_0x2ba8cf)){_0x230dba['or']('c.email\x20LIKE\x20?',_0x2ba8cf+'%');}else{_0x230dba['or']('c.firstName\x20LIKE\x20?','%'+_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x62'),'%'+_0x2ba8cf+'%');_0x230dba['or'](_0x3e7f('0x63'),'%'+_0x2ba8cf+'%');}}}}_0x3605a8[_0x3e7f('0x32')](_0x230dba);_0x3605a8[_0x3e7f('0x64')](_0x3e7f('0x65'));var _0x898aa2={'type':db[_0x3e7f('0x66')][_0x3e7f('0x67')][_0x3e7f('0x68')],'raw':!![]};var _0x33f4b9=_0x3605a8[_0x3e7f('0x69')]()['field'](_0x3e7f('0x65'));if(_0xcfdcf7['order']){_0xcfdcf7[_0x3e7f('0x30')]['forEach'](function(_0x167e5e){_0x3605a8['order']('c.'+_0x167e5e[0x0],_0x167e5e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3e7f('0x55')](_0x2622ef)){_0x3605a8[_0x3e7f('0x6a')](_0x324cb5);_0x33f4b9['where']('t.id\x20IN\x20?',_0x2622ef);}BPromise[_0x3e7f('0x6b')]()[_0x3e7f('0x17')](function(){if(!_0x29d004)return;if(_0x318240[_0x3e7f('0x6c')]['role']!==_0x3e7f('0x6d'))return;if(!_[_0x3e7f('0x6e')](_0x29d004[_0x3e7f('0x43')],[_0x3e7f('0x34'),_0x3e7f('0x49')])){return _0x318240[_0x3e7f('0x6c')]['getLists']({'attributes':['id'],'raw':!![]})[_0x3e7f('0x17')](function(_0x1e66a3){if(_[_0x3e7f('0x55')](_0x1e66a3)){_0x33f4b9['where'](_0x3e7f('0x6f'));_0x3605a8['where'](_0x3e7f('0x6f'));}else{_0x33f4b9['where'](_0x3e7f('0x57'),_['map'](_0x1e66a3,'id'));_0x3605a8[_0x3e7f('0x32')](_0x3e7f('0x57'),_['map'](_0x1e66a3,'id'));}});}})[_0x3e7f('0x17')](function(){if(_0x318240[_0x3e7f('0x6c')][_0x3e7f('0x70')]===_0x3e7f('0x6d')&&!_0x29d004&&!_0x318240[_0x3e7f('0x28')][_0x3e7f('0x56')])return[];return db['sequelize'][_0x3e7f('0x28')](_0x33f4b9[_0x3e7f('0x71')](),_0x898aa2);})[_0x3e7f('0x17')](function(_0x579004){_0xed064f[_0x3e7f('0x13')]=_0x579004['length'];if(_0xed064f[_0x3e7f('0x13')]===0x0)return[];return db[_0x3e7f('0x72')]['query'](_0x5a0e82[_0x3e7f('0x71')](),_0x898aa2)['then'](function(_0x1da46f){_0x40f8fe=_[_0x3e7f('0x73')](_0x1da46f,'id');_0x898aa2=_[_0x3e7f('0x74')](_0x898aa2,{'model':db[_0x3e7f('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x318240[_0x3e7f('0x28')][_0x3e7f('0x2d')]){_0xcfdcf7[_0x3e7f('0x2c')][_0x3e7f('0x46')](function(_0xf3917f){_0x3605a8['field']('c.'+_0xf3917f);});}else{_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x65'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x76'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x77'));_0x3605a8['field'](_0x3e7f('0x78'));_0x3605a8[_0x3e7f('0x34')]('c.mobile');_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x79'));_0x3605a8[_0x3e7f('0x34')]('c.email');_0x3605a8['field'](_0x3e7f('0x7a'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x7b'));_0x3605a8[_0x3e7f('0x34')](_0x3e7f('0x7c'));_0x3605a8['field'](_0x3e7f('0x7d'));_0x3605a8[_0x3e7f('0x34')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3e7f('0x7e'));}if(_0xcfdcf7[_0x3e7f('0x12')])_0x3605a8[_0x3e7f('0x12')](_0xcfdcf7['limit']);if(_0xcfdcf7[_0x3e7f('0x14')])_0x3605a8[_0x3e7f('0x14')](_0xcfdcf7[_0x3e7f('0x14')]);return db[_0x3e7f('0x72')][_0x3e7f('0x28')](_0x3605a8['toString'](),_0x898aa2);});})[_0x3e7f('0x17')](function(_0x2d8fde){_0x2d8fde[_0x3e7f('0x46')](function(_0x35af85){if(_0x35af85[_0x3e7f('0x7e')]){_0x35af85[_0x3e7f('0x7f')]=[];_0x35af85['TagIds'][_0x3e7f('0x80')](',')[_0x3e7f('0x46')](function(_0x51b805){_0x35af85[_0x3e7f('0x7f')][_0x3e7f('0x23')](_0x40f8fe[_0x51b805]);});}delete _0x35af85['TagIds'];});_0xed064f[_0x3e7f('0x81')]=_0x2d8fde;return _0xed064f;})[_0x3e7f('0x17')](respondWithFilteredResult(_0x38a392,_0xcfdcf7));})[_0x3e7f('0x82')](handleError(_0x38a392,null));};exports['destroy']=function(_0xa875f,_0x2c3c21){return db['CmContact'][_0x3e7f('0x83')]({'where':{'id':_0xa875f['params']['id']}})[_0x3e7f('0x17')](handleEntityNotFound(_0x2c3c21,null))['then'](removeEntity(_0x2c3c21,null))[_0x3e7f('0x82')](handleError(_0x2c3c21,null));};exports[_0x3e7f('0x84')]=function(_0x173e36,_0x5dbd92){return db[_0x3e7f('0x75')][_0x3e7f('0x84')]()[_0x3e7f('0x17')](function(_0x24ea5d){delete _0x24ea5d[_0x3e7f('0x85')];for(var _0x490e05=0x0;_0x490e05=_0x54d900){_0x11853a=_0x54d900;_0x3069bb=0xc8;}else{_0x3069bb=0xce;}_0x8d165f[_0xc565('0x13')](_0x3069bb);return _0x8d165f[_0xc565('0x14')](_0xc565('0x15'),_0x505279+'-'+_0x11853a+'/'+_0x54d900)[_0xc565('0xe')](_0x374665);}return null;};}function saveUpdates(_0x29c1c1){return function(_0x4712d6){if(_0x4712d6){return _0x4712d6[_0xc565('0x16')](_0x29c1c1)[_0xc565('0x17')](function(_0x1de92c){return _0x1de92c;});}return null;};}function removeEntity(_0x14eec7){return function(_0x16cabe){if(_0x16cabe){return _0x16cabe[_0xc565('0x18')]()[_0xc565('0x17')](function(){_0x14eec7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b4beb){return function(_0x3b88b4){if(!_0x3b88b4){_0x3b4beb[_0xc565('0x19')](0x194);}return _0x3b88b4;};}function handleError(_0x1cd72d,_0x55f20c){_0x55f20c=_0x55f20c||0x1f4;return function(_0x3adbcd){logger[_0xc565('0x1a')](_0x3adbcd[_0xc565('0x1b')]);if(_0x3adbcd[_0xc565('0x1c')]){delete _0x3adbcd['name'];}_0x1cd72d[_0xc565('0x13')](_0x55f20c)[_0xc565('0x1d')](_0x3adbcd);};}exports[_0xc565('0x1e')]=function(_0x43769e,_0x36a386){var _0x298ebb={},_0x57d20d={},_0x4a2807={'count':0x0,'rows':[]};return db[_0xc565('0x1f')][_0xc565('0x20')]()[_0xc565('0x17')](function(_0x1c8e94){var _0x403811=[];for(var _0x4eee02=0x0;_0x4eee020x1){_0x307c26['or'](_0xc565('0x5f'),qs[_0xc565('0x60')](_0x54e337),null);}else{if(qs[_0xc565('0x61')](_0x54e337)){_0x307c26['or'](_0xc565('0x62'),_0x54e337+'%');_0x307c26['or'](_0xc565('0x63'),_0x54e337+'%');_0x307c26['or']('c.mobile\x20LIKE\x20?',_0x54e337+'%');_0x307c26['or'](_0xc565('0x64'),_0x54e337+'%');}else if(qs[_0xc565('0x65')](_0x54e337)){_0x307c26['or'](_0xc565('0x66'),_0x54e337+'%');}else{_0x307c26['or'](_0xc565('0x67'),'%'+_0x54e337+'%');_0x307c26['or'](_0xc565('0x68'),'%'+_0x54e337+'%');_0x307c26['or']('c.email\x20LIKE\x20?','%'+_0x54e337+'%');}}}}_0x2c906d[_0xc565('0x35')](_0x307c26);_0x2c906d[_0xc565('0x69')]('c.id');var _0x2b53e4={'type':db[_0xc565('0x6a')][_0xc565('0x6b')]['SELECT'],'raw':!![]};var _0x54c02a=_0x2c906d[_0xc565('0x6c')]()[_0xc565('0x38')](_0xc565('0x6d'));if(_0x298ebb['order']){_0x298ebb[_0xc565('0x33')][_0xc565('0x48')](function(_0x107986){_0x2c906d[_0xc565('0x33')]('c.'+_0x107986[0x0],_0x107986[0x1]===_0xc565('0x6e')?![]:!![]);});}if(!_[_0xc565('0x56')](_0x38df56)){_0x2c906d[_0xc565('0x6f')](_0x3965f6);_0x54c02a['where']('t.id\x20IN\x20?',_0x38df56);}BPromise[_0xc565('0x70')]()[_0xc565('0x17')](function(){if(!_0x229e58)return;if(_0x43769e[_0xc565('0x71')][_0xc565('0x72')]!==_0xc565('0x73'))return;if(!_[_0xc565('0x74')](_0x229e58[_0xc565('0x75')],[_0xc565('0x38'),'User'])){return _0x43769e[_0xc565('0x71')]['getLists']({'attributes':['id'],'raw':!![]})[_0xc565('0x17')](function(_0x240fbd){if(_[_0xc565('0x56')](_0x240fbd)){_0x54c02a['where'](_0xc565('0x76'));_0x2c906d[_0xc565('0x35')](_0xc565('0x76'));}else{_0x54c02a[_0xc565('0x35')](_0xc565('0x77'),_[_0xc565('0x47')](_0x240fbd,'id'));_0x2c906d[_0xc565('0x35')](_0xc565('0x77'),_[_0xc565('0x47')](_0x240fbd,'id'));}});}})[_0xc565('0x17')](function(){if(_0x43769e[_0xc565('0x71')][_0xc565('0x72')]==='agent'&&!_0x229e58&&!_0x43769e[_0xc565('0x2c')]['ListId'])return[];return db[_0xc565('0x78')][_0xc565('0x2c')](_0x54c02a['toString'](),_0x2b53e4);})['then'](function(_0x5e016f){_0x4a2807[_0xc565('0x12')]=_0x5e016f[_0xc565('0x21')];if(_0x4a2807[_0xc565('0x12')]===0x0)return[];return db[_0xc565('0x78')][_0xc565('0x2c')](_0x4254c1['toString'](),_0x2b53e4)[_0xc565('0x17')](function(_0x36a33b){_0x2c5fbd=_[_0xc565('0x79')](_0x36a33b,'id');_0x2b53e4=_['merge'](_0x2b53e4,{'model':db[_0xc565('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43769e[_0xc565('0x2c')][_0xc565('0x2f')]){_0x298ebb[_0xc565('0x30')]['forEach'](function(_0x184509){_0x2c906d['field']('c.'+_0x184509);});}else{_0x2c906d['field']('c.id');_0x2c906d[_0xc565('0x38')]('c.firstName');_0x2c906d[_0xc565('0x38')](_0xc565('0x7a'));_0x2c906d[_0xc565('0x38')](_0xc565('0x7b'));_0x2c906d[_0xc565('0x38')](_0xc565('0x7c'));_0x2c906d[_0xc565('0x38')](_0xc565('0x7d'));_0x2c906d[_0xc565('0x38')](_0xc565('0x7e'));_0x2c906d['field'](_0xc565('0x7f'));_0x2c906d[_0xc565('0x38')](_0xc565('0x80'));_0x2c906d[_0xc565('0x38')]('c.deletedAt');_0x2c906d[_0xc565('0x38')](_0xc565('0x81'));_0x2c906d['field'](_0xc565('0x82'),_0xc565('0x83'));}if(_0x298ebb[_0xc565('0x11')])_0x2c906d[_0xc565('0x11')](_0x298ebb[_0xc565('0x11')]);if(_0x298ebb[_0xc565('0xf')])_0x2c906d['offset'](_0x298ebb[_0xc565('0xf')]);return db[_0xc565('0x78')][_0xc565('0x2c')](_0x2c906d[_0xc565('0x84')](),_0x2b53e4);});})[_0xc565('0x17')](function(_0x51ff25){_0x51ff25[_0xc565('0x48')](function(_0x5c2107){if(_0x5c2107['TagIds']){_0x5c2107['Tags']=[];_0x5c2107['TagIds']['split'](',')['forEach'](function(_0x4f4ec4){_0x5c2107['Tags'][_0xc565('0x24')](_0x2c5fbd[_0x4f4ec4]);});}delete _0x5c2107[_0xc565('0x83')];});_0x4a2807[_0xc565('0x85')]=_0x51ff25;return _0x4a2807;})[_0xc565('0x17')](respondWithFilteredResult(_0x36a386,_0x298ebb));})[_0xc565('0x86')](handleError(_0x36a386,null));};exports[_0xc565('0x18')]=function(_0x3ad8c3,_0x4648a6){return db[_0xc565('0x1f')][_0xc565('0x45')]({'where':{'id':_0x3ad8c3[_0xc565('0x87')]['id']}})[_0xc565('0x17')](handleEntityNotFound(_0x4648a6,null))[_0xc565('0x17')](removeEntity(_0x4648a6,null))['catch'](handleError(_0x4648a6,null));};exports[_0xc565('0x20')]=function(_0x165f02,_0x567cc3){return db[_0xc565('0x1f')][_0xc565('0x20')]()[_0xc565('0x17')](function(_0x5e8b12){delete _0x5e8b12[_0xc565('0x88')];for(var _0x2bd3a6=0x0;_0x2bd3a6{}\s\\|]/g,'-');_0x311b9e(null,util[_0x5480('0x1d')]('%s-%s%s',path[_0x5480('0x1e')](_0x34acd7['originalname'],path['extname'](_0x34acd7[_0x5480('0x1c')])),Date[_0x5480('0x1f')](),path[_0x5480('0x20')](_0x34acd7[_0x5480('0x1c')])));}})});router[_0x5480('0x14')]('/csv',upload[_0x5480('0x21')](_0x5480('0x22')),controller[_0x5480('0x23')]);var upload=multer({'storage':multer[_0x5480('0x19')]({'destination':function(_0x1760b,_0x2a7d79,_0xff69be){_0xff69be(null,path[_0x5480('0x1a')](config[_0x5480('0x24')],_0x5480('0x1b')));},'filename':function(_0x5c93c4,_0x27b256,_0x579e81){_0x27b256['originalname']=_0x27b256['originalname'][_0x5480('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x579e81(null,util[_0x5480('0x1d')]('%s-%s%s',path[_0x5480('0x1e')](_0x27b256['originalname'],path[_0x5480('0x20')](_0x27b256['originalname'])),Date[_0x5480('0x1f')](),path[_0x5480('0x20')](_0x27b256[_0x5480('0x1c')])));}})});router[_0x5480('0x14')](_0x5480('0x26'),upload[_0x5480('0x21')](_0x5480('0x22')),controller[_0x5480('0x27')]);router[_0x5480('0x14')](_0x5480('0x28'),auth[_0x5480('0xa')](),controller['import']);router[_0x5480('0x29')](_0x5480('0x9'),auth[_0x5480('0xa')](),controller[_0x5480('0x2a')]);router[_0x5480('0x2b')]('/:id',auth[_0x5480('0xa')](),controller[_0x5480('0x2c')]);module[_0x5480('0x2d')]=router; \ No newline at end of file +var _0x4931=['basename','now','extname','/csv','single','file','server/files/tmp','%s-%s%s','upload','import','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','getHopperHistories','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','diskStorage','join','root','originalname','replace','format'];(function(_0x344f0e,_0xb5ccc){var _0x5a8328=function(_0x3acec5){while(--_0x3acec5){_0x344f0e['push'](_0x344f0e['shift']());}};_0x5a8328(++_0xb5ccc);}(_0x4931,0x1e6));var _0x1493=function(_0x48441b,_0x15d2ab){_0x48441b=_0x48441b-0x0;var _0x596032=_0x4931[_0x48441b];return _0x596032;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1493('0x0'));var timeout=require(_0x1493('0x1'));var express=require('express');var router=express[_0x1493('0x2')]();var fs_extra=require(_0x1493('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1493('0x4'));var config=require(_0x1493('0x5'));var controller=require('./cmContact.controller');router[_0x1493('0x6')]('/',auth[_0x1493('0x7')](),controller[_0x1493('0x8')]);router[_0x1493('0x6')](_0x1493('0x9'),auth[_0x1493('0x7')](),controller['describe']);router['get'](_0x1493('0xa'),auth[_0x1493('0x7')](),controller[_0x1493('0xb')]);router['get'](_0x1493('0xc'),auth[_0x1493('0x7')](),controller['getTags']);router['get'](_0x1493('0xd'),auth[_0x1493('0x7')](),controller[_0x1493('0xe')]);router[_0x1493('0x6')]('/:id/hopper_histories',auth[_0x1493('0x7')](),controller[_0x1493('0xf')]);router[_0x1493('0x6')]('/:id/hopper_finals',auth[_0x1493('0x7')](),controller['getHopperFinals']);router['get'](_0x1493('0x10'),auth[_0x1493('0x7')](),controller['getJscriptySessions']);router[_0x1493('0x6')](_0x1493('0x11'),auth[_0x1493('0x7')](),controller[_0x1493('0x12')]);router[_0x1493('0x13')](_0x1493('0x14'),auth[_0x1493('0x7')](),controller[_0x1493('0x15')]);router[_0x1493('0x13')]('/',auth[_0x1493('0x7')](),controller['create']);router[_0x1493('0x13')](_0x1493('0x16'),auth[_0x1493('0x7')](),controller[_0x1493('0x17')]);router[_0x1493('0x13')]('/:id/tags',auth[_0x1493('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0x1493('0x18')]({'destination':function(_0x4de6c0,_0x2d9e91,_0x196c6c){_0x196c6c(null,path[_0x1493('0x19')](config[_0x1493('0x1a')],'server/files/tmp'));},'filename':function(_0x13902a,_0x3eceba,_0x2c2773){_0x3eceba[_0x1493('0x1b')]=_0x3eceba[_0x1493('0x1b')][_0x1493('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c2773(null,util[_0x1493('0x1d')]('%s-%s%s',path[_0x1493('0x1e')](_0x3eceba['originalname'],path['extname'](_0x3eceba[_0x1493('0x1b')])),Date[_0x1493('0x1f')](),path[_0x1493('0x20')](_0x3eceba[_0x1493('0x1b')])));}})});router[_0x1493('0x13')](_0x1493('0x21'),upload[_0x1493('0x22')](_0x1493('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x1493('0x18')]({'destination':function(_0x7b757f,_0x3a56c3,_0x3b4804){_0x3b4804(null,path[_0x1493('0x19')](config[_0x1493('0x1a')],_0x1493('0x24')));},'filename':function(_0x47c527,_0x1a89f9,_0x309495){_0x1a89f9[_0x1493('0x1b')]=_0x1a89f9[_0x1493('0x1b')][_0x1493('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x309495(null,util[_0x1493('0x1d')](_0x1493('0x25'),path[_0x1493('0x1e')](_0x1a89f9[_0x1493('0x1b')],path[_0x1493('0x20')](_0x1a89f9[_0x1493('0x1b')])),Date['now'](),path[_0x1493('0x20')](_0x1a89f9[_0x1493('0x1b')])));}})});router[_0x1493('0x13')]('/upload',upload[_0x1493('0x22')](_0x1493('0x23')),controller[_0x1493('0x26')]);router['post']('/upload/:id',auth[_0x1493('0x7')](),controller[_0x1493('0x27')]);router['put'](_0x1493('0xa'),auth[_0x1493('0x7')](),controller[_0x1493('0x28')]);router['delete'](_0x1493('0xa'),auth[_0x1493('0x7')](),controller[_0x1493('0x29')]);module[_0x1493('0x2a')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 632c3ac..09f2cb3 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 _0xe803=['parse','values','isArray','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','select'];(function(_0x47c1f4,_0x4847a5){var _0x3e17b3=function(_0x437145){while(--_0x437145){_0x47c1f4['push'](_0x47c1f4['shift']());}};_0x3e17b3(++_0x4847a5);}(_0xe803,0x1d6));var _0x3e80=function(_0x119347,_0x343ef2){_0x119347=_0x119347-0x0;var _0x5932e2=_0xe803[_0x119347];return _0x5932e2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3e80('0x0'));module[_0x3e80('0x1')]={'name':{'type':Sequelize[_0x3e80('0x2')],'get':function(_0x41e70d){return this[_0x3e80('0x3')](_0x3e80('0x4'));}},'alias':{'type':Sequelize[_0x3e80('0x5')],'allowNull':![],'set':function(_0x5632d1){this[_0x3e80('0x6')](_0x3e80('0x4'),_0x5632d1?_0x5632d1:this[_0x3e80('0x3')](_0x3e80('0x7')));}},'type':{'type':Sequelize[_0x3e80('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x3e80('0x8')]('long'),'get':function(){if(this[_0x3e80('0x3')]('type')===_0x3e80('0x9')){return JSON[_0x3e80('0xa')](this['getDataValue'](_0x3e80('0xb')));}else{return this[_0x3e80('0x3')]('values');}},'set':function(_0x1920ad){if(Array[_0x3e80('0xc')](_0x1920ad)){this[_0x3e80('0x6')](_0x3e80('0xb'),JSON['stringify'](_0x1920ad));}else{this[_0x3e80('0x6')](_0x3e80('0xb'),_0x1920ad);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3e80('0xd')](_0x3e80('0xe'))}}; \ No newline at end of file +var _0xaa8e=['VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaa8e,0x130));var _0xeaa8=function(_0x20b8f3,_0x4e4871){_0x20b8f3=_0x20b8f3-0x0;var _0x15eae9=_0xaa8e[_0x20b8f3];return _0x15eae9;};'use strict';var Sequelize=require(_0xeaa8('0x0'));var _=require('lodash');module[_0xeaa8('0x1')]={'name':{'type':Sequelize[_0xeaa8('0x2')],'get':function(_0x7e4d6b){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xeaa8('0x3')],'allowNull':![],'set':function(_0x2fe80b){this[_0xeaa8('0x4')](_0xeaa8('0x5'),_0x2fe80b?_0x2fe80b:this[_0xeaa8('0x6')](_0xeaa8('0x7')));}},'type':{'type':Sequelize[_0xeaa8('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xeaa8('0x8')]('long'),'get':function(){if(this[_0xeaa8('0x6')](_0xeaa8('0x9'))===_0xeaa8('0xa')){return JSON[_0xeaa8('0xb')](this[_0xeaa8('0x6')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x28d442){if(Array['isArray'](_0x28d442)){this['setDataValue'](_0xeaa8('0xc'),JSON[_0xeaa8('0xd')](_0x28d442));}else{this['setDataValue'](_0xeaa8('0xc'),_0x28d442);}}},'required':{'type':Sequelize[_0xeaa8('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xeaa8('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xeaa8('0xf')](_0xeaa8('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 59be67b..b12ef65 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 _0x53b3=['count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','keys','length','include','find','body','params','sequelize','transaction','create','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x413792,_0x27a8e2){var _0x3f5bcd=function(_0x182738){while(--_0x182738){_0x413792['push'](_0x413792['shift']());}};_0x3f5bcd(++_0x27a8e2);}(_0x53b3,0x8f));var _0x353b=function(_0x2f04a5,_0x29fb54){_0x2f04a5=_0x2f04a5-0x0;var _0x48016a=_0x53b3[_0x2f04a5];return _0x48016a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x353b('0x0'));var jsonpatch=require(_0x353b('0x1'));var rp=require(_0x353b('0x2'));var moment=require(_0x353b('0x3'));var BPromise=require(_0x353b('0x4'));var Mustache=require(_0x353b('0x5'));var util=require('util');var path=require(_0x353b('0x6'));var sox=require(_0x353b('0x7'));var csv=require(_0x353b('0x8'));var ejs=require(_0x353b('0x9'));var fs=require('fs');var fs_extra=require(_0x353b('0xa'));var _=require(_0x353b('0xb'));var squel=require(_0x353b('0xc'));var crypto=require('crypto');var jsforce=require(_0x353b('0xd'));var deskjs=require(_0x353b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x353b('0xf'));var Redis=require(_0x353b('0x10'));var authService=require(_0x353b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x353b('0x12'));var hardwareService=require(_0x353b('0x13'));var logger=require(_0x353b('0x14'))('api');var utils=require(_0x353b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x353b('0x16'));var db=require(_0x353b('0x17'))['db'];function respondWithStatusCode(_0xda0cc8,_0x3d965c){_0x3d965c=_0x3d965c||0xcc;return function(_0x135bc3){if(_0x135bc3){return _0xda0cc8[_0x353b('0x18')](_0x3d965c);}return _0xda0cc8[_0x353b('0x19')](_0x3d965c)[_0x353b('0x1a')]();};}function respondWithResult(_0x28401d,_0x362194){_0x362194=_0x362194||0xc8;return function(_0x703411){if(_0x703411){return _0x28401d['status'](_0x362194)['json'](_0x703411);}};}function respondWithFilteredResult(_0x352fae,_0x2119e1){return function(_0x340fa0){if(_0x340fa0){var _0x569f4c=typeof _0x2119e1[_0x353b('0x1b')]===_0x353b('0x1c')&&typeof _0x2119e1['limit']===_0x353b('0x1c');var _0x5068a1=_0x340fa0[_0x353b('0x1d')];var _0x38113c=_0x569f4c?0x0:_0x2119e1[_0x353b('0x1b')];var _0x1271d4=_0x569f4c?_0x340fa0[_0x353b('0x1d')]:_0x2119e1[_0x353b('0x1b')]+_0x2119e1['limit'];var _0x1b15d6;if(_0x1271d4>=_0x5068a1){_0x1271d4=_0x5068a1;_0x1b15d6=0xc8;}else{_0x1b15d6=0xce;}_0x352fae[_0x353b('0x19')](_0x1b15d6);return _0x352fae[_0x353b('0x1e')](_0x353b('0x1f'),_0x38113c+'-'+_0x1271d4+'/'+_0x5068a1)[_0x353b('0x20')](_0x340fa0);}return null;};}function patchUpdates(_0x176c2e){return function(_0x3c1193){try{jsonpatch[_0x353b('0x21')](_0x3c1193,_0x176c2e,!![]);}catch(_0x3d1da6){return BPromise[_0x353b('0x22')](_0x3d1da6);}return _0x3c1193[_0x353b('0x23')]();};}function saveUpdates(_0xd4181,_0x376d31){return function(_0x5db0f4){if(_0x5db0f4){return _0x5db0f4[_0x353b('0x24')](_0xd4181)['then'](function(_0x3a9c94){return _0x3a9c94;});}return null;};}function removeEntity(_0x387bfe,_0x7ee64f){return function(_0x63f2ab){if(_0x63f2ab){return _0x63f2ab[_0x353b('0x25')]()[_0x353b('0x26')](function(){_0x387bfe[_0x353b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2633,_0x4364da){return function(_0x254b1d){if(!_0x254b1d){_0x2d2633[_0x353b('0x18')](0x194);}return _0x254b1d;};}function handleError(_0x1cc856,_0x23afff){_0x23afff=_0x23afff||0x1f4;return function(_0x15b8c5){logger[_0x353b('0x27')](_0x15b8c5[_0x353b('0x28')]);if(_0x15b8c5[_0x353b('0x29')]){delete _0x15b8c5['name'];}_0x1cc856[_0x353b('0x19')](_0x23afff)[_0x353b('0x2a')](_0x15b8c5);};}exports[_0x353b('0x2b')]=function(_0x146705,_0x30ac20){var _0x2da2a1={},_0xa91656={},_0x1335d0={'count':0x0,'rows':[]};var _0x5dee08=_[_0x353b('0x2c')](db[_0x353b('0x2d')][_0x353b('0x2e')],function(_0x16782a){return{'name':_0x16782a[_0x353b('0x2f')],'type':_0x16782a[_0x353b('0x30')]['key']};});_0xa91656[_0x353b('0x31')]=_['differenceBy'](_[_0x353b('0x2c')](_0x5dee08,_0x353b('0x29')),[_0x353b('0x29')]);_0xa91656['query']=_['keys'](_0x146705['query']);_0xa91656[_0x353b('0x32')]=_[_0x353b('0x33')](_0xa91656['model'],_0xa91656[_0x353b('0x34')]);_0x2da2a1[_0x353b('0x35')]=_[_0x353b('0x33')](_0xa91656[_0x353b('0x31')],qs['fields'](_0x146705[_0x353b('0x34')][_0x353b('0x36')]));_0x2da2a1[_0x353b('0x35')]=_0x2da2a1[_0x353b('0x35')]['length']?_0x2da2a1[_0x353b('0x35')]:_0xa91656['model'];if(!_0x146705[_0x353b('0x34')][_0x353b('0x37')](_0x353b('0x38'))){_0x2da2a1[_0x353b('0x39')]=qs['limit'](_0x146705[_0x353b('0x34')][_0x353b('0x39')]);_0x2da2a1[_0x353b('0x1b')]=qs[_0x353b('0x1b')](_0x146705[_0x353b('0x34')]['offset']);}_0x2da2a1['order']=qs[_0x353b('0x3a')](_0x146705[_0x353b('0x34')][_0x353b('0x3a')]);_0x2da2a1[_0x353b('0x3b')]=qs['filters'](_[_0x353b('0x3c')](_0x146705[_0x353b('0x34')],_0xa91656[_0x353b('0x32')]),_0x5dee08);if(_0x146705['query']['filter']){_0x2da2a1[_0x353b('0x3b')]=_[_0x353b('0x3d')](_0x2da2a1['where'],{'$or':_['map'](_0x5dee08,function(_0x1879bd){if(_0x1879bd[_0x353b('0x30')]!==_0x353b('0x3e')){var _0x495c28={};_0x495c28[_0x1879bd[_0x353b('0x29')]]={'$like':'%'+_0x146705[_0x353b('0x34')]['filter']+'%'};return _0x495c28;}})});}_0x2da2a1=_['merge']({},_0x2da2a1,_0x146705[_0x353b('0x3f')]);var _0x3a5f62={'where':_0x2da2a1[_0x353b('0x3b')]};return db[_0x353b('0x2d')]['count'](_0x3a5f62)[_0x353b('0x26')](function(_0x2e69be){_0x1335d0[_0x353b('0x1d')]=_0x2e69be;if(_0x146705['query'][_0x353b('0x40')]){_0x2da2a1['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x2da2a1);})[_0x353b('0x26')](function(_0x439fec){_0x1335d0['rows']=_0x439fec;return _0x1335d0;})[_0x353b('0x26')](respondWithFilteredResult(_0x30ac20,_0x2da2a1))[_0x353b('0x41')](handleError(_0x30ac20,null));};exports[_0x353b('0x42')]=function(_0x2628b7,_0x2c8bee){var _0x38e1f8={'raw':!![],'where':{'id':_0x2628b7['params']['id']}},_0x31a53e={};_0x31a53e[_0x353b('0x31')]=_[_0x353b('0x43')](db[_0x353b('0x2d')]['rawAttributes']);_0x31a53e[_0x353b('0x34')]=_[_0x353b('0x43')](_0x2628b7[_0x353b('0x34')]);_0x31a53e[_0x353b('0x32')]=_[_0x353b('0x33')](_0x31a53e[_0x353b('0x31')],_0x31a53e['query']);_0x38e1f8[_0x353b('0x35')]=_[_0x353b('0x33')](_0x31a53e['model'],qs[_0x353b('0x36')](_0x2628b7['query'][_0x353b('0x36')]));_0x38e1f8['attributes']=_0x38e1f8[_0x353b('0x35')][_0x353b('0x44')]?_0x38e1f8['attributes']:_0x31a53e['model'];if(_0x2628b7['query'][_0x353b('0x40')]){_0x38e1f8[_0x353b('0x45')]=[{'all':!![]}];}_0x38e1f8=_[_0x353b('0x3d')]({},_0x38e1f8,_0x2628b7[_0x353b('0x3f')]);return db[_0x353b('0x2d')][_0x353b('0x46')](_0x38e1f8)[_0x353b('0x26')](handleEntityNotFound(_0x2c8bee,null))[_0x353b('0x26')](respondWithResult(_0x2c8bee,null))[_0x353b('0x41')](handleError(_0x2c8bee,null));};exports[_0x353b('0x24')]=function(_0x1f699b,_0x569123){if(_0x1f699b['body']['id']){delete _0x1f699b[_0x353b('0x47')]['id'];}return db[_0x353b('0x2d')][_0x353b('0x46')]({'where':{'id':_0x1f699b[_0x353b('0x48')]['id']}})['then'](handleEntityNotFound(_0x569123,null))['then'](saveUpdates(_0x1f699b[_0x353b('0x47')],null))['then'](respondWithResult(_0x569123,null))[_0x353b('0x41')](handleError(_0x569123,null));};exports[_0x353b('0x25')]=function(_0x12d91f,_0x1e466a){return db[_0x353b('0x2d')][_0x353b('0x46')]({'where':{'id':_0x12d91f[_0x353b('0x48')]['id']}})[_0x353b('0x26')](handleEntityNotFound(_0x1e466a,null))['then'](removeEntity(_0x1e466a,null))[_0x353b('0x41')](handleError(_0x1e466a,null));};exports['create']=function(_0xac634d,_0x269979){var _0x5e6255;return db[_0x353b('0x49')][_0x353b('0x4a')](function(_0x3990c9){return db[_0x353b('0x2d')][_0x353b('0x4b')](_0xac634d[_0x353b('0x47')],{'transaction':_0x3990c9})[_0x353b('0x26')](function(_0x313d2f){_0x5e6255=_0x313d2f;var _0x477c3b={'type':db[_0x353b('0x4c')]['TEXT'],'transaction':_0x3990c9};switch(_0xac634d[_0x353b('0x47')][_0x353b('0x30')]){case _0x353b('0x4d'):_0x477c3b['type']=db['Sequelize'][_0x353b('0x4e')];break;case'number':_0x477c3b[_0x353b('0x30')]=db[_0x353b('0x4c')][_0x353b('0x4f')];break;case _0x353b('0x50'):_0x477c3b[_0x353b('0x30')]=db['Sequelize'][_0x353b('0x51')];_0x477c3b[_0x353b('0x52')]=![];break;default:}return db[_0x353b('0x49')][_0x353b('0x53')][_0x353b('0x54')](_0x353b('0x55'),util['format']('cf_%d',_0x5e6255['id']),_0x477c3b);})[_0x353b('0x26')](function(){return _0x5e6255;});})[_0x353b('0x26')](respondWithResult(_0x269979,0xc9))['catch'](handleError(_0x269979,null));}; \ No newline at end of file +var _0x3dd7=['CmCustomField','key','differenceBy','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','update','body','params','sequelize','transaction','create','Sequelize','TEXT','type','text','INTEGER','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','json','apply','reject','save','then','destroy','stack','name','index','map'];(function(_0x5d6674,_0x4e435c){var _0x1a4dc9=function(_0x35ad0f){while(--_0x35ad0f){_0x5d6674['push'](_0x5d6674['shift']());}};_0x1a4dc9(++_0x4e435c);}(_0x3dd7,0x17f));var _0x73dd=function(_0x13a6ce,_0x492f93){_0x13a6ce=_0x13a6ce-0x0;var _0x4b43bf=_0x3dd7[_0x13a6ce];return _0x4b43bf;};'use strict';var emlformat=require(_0x73dd('0x0'));var rimraf=require(_0x73dd('0x1'));var zipdir=require(_0x73dd('0x2'));var jsonpatch=require(_0x73dd('0x3'));var rp=require(_0x73dd('0x4'));var moment=require('moment');var BPromise=require(_0x73dd('0x5'));var Mustache=require(_0x73dd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x73dd('0x7'));var csv=require(_0x73dd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73dd('0x9'));var _=require(_0x73dd('0xa'));var squel=require(_0x73dd('0xb'));var crypto=require(_0x73dd('0xc'));var jsforce=require(_0x73dd('0xd'));var deskjs=require(_0x73dd('0xe'));var toCsv=require(_0x73dd('0x8'));var querystring=require(_0x73dd('0xf'));var Papa=require('papaparse');var Redis=require(_0x73dd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x73dd('0x11'));var as=require(_0x73dd('0x12'));var hardwareService=require(_0x73dd('0x13'));var logger=require(_0x73dd('0x14'))('api');var utils=require(_0x73dd('0x15'));var config=require(_0x73dd('0x16'));var licenseUtil=require(_0x73dd('0x17'));var db=require(_0x73dd('0x18'))['db'];function respondWithStatusCode(_0xd9e8a6,_0x36443c){_0x36443c=_0x36443c||0xcc;return function(_0x28881a){if(_0x28881a){return _0xd9e8a6[_0x73dd('0x19')](_0x36443c);}return _0xd9e8a6['status'](_0x36443c)[_0x73dd('0x1a')]();};}function respondWithResult(_0x1bef8a,_0x48bd68){_0x48bd68=_0x48bd68||0xc8;return function(_0xf4966c){if(_0xf4966c){return _0x1bef8a[_0x73dd('0x1b')](_0x48bd68)['json'](_0xf4966c);}};}function respondWithFilteredResult(_0x463119,_0x4496aa){return function(_0x265175){if(_0x265175){var _0x4ac721=typeof _0x4496aa['offset']==='undefined'&&typeof _0x4496aa[_0x73dd('0x1c')]===_0x73dd('0x1d');var _0x5ae10d=_0x265175[_0x73dd('0x1e')];var _0x1d430c=_0x4ac721?0x0:_0x4496aa[_0x73dd('0x1f')];var _0x374d32=_0x4ac721?_0x265175['count']:_0x4496aa['offset']+_0x4496aa[_0x73dd('0x1c')];var _0x545a67;if(_0x374d32>=_0x5ae10d){_0x374d32=_0x5ae10d;_0x545a67=0xc8;}else{_0x545a67=0xce;}_0x463119[_0x73dd('0x1b')](_0x545a67);return _0x463119['set']('Content-Range',_0x1d430c+'-'+_0x374d32+'/'+_0x5ae10d)[_0x73dd('0x20')](_0x265175);}return null;};}function patchUpdates(_0x2ecf8a){return function(_0x4dc8b6){try{jsonpatch[_0x73dd('0x21')](_0x4dc8b6,_0x2ecf8a,!![]);}catch(_0x3e9333){return BPromise[_0x73dd('0x22')](_0x3e9333);}return _0x4dc8b6[_0x73dd('0x23')]();};}function saveUpdates(_0x2d2e65,_0x5ce301){return function(_0x29a27d){if(_0x29a27d){return _0x29a27d['update'](_0x2d2e65)[_0x73dd('0x24')](function(_0x3e592c){return _0x3e592c;});}return null;};}function removeEntity(_0x9e402a,_0x50d248){return function(_0x2ce542){if(_0x2ce542){return _0x2ce542[_0x73dd('0x25')]()[_0x73dd('0x24')](function(){_0x9e402a[_0x73dd('0x1b')](0xcc)[_0x73dd('0x1a')]();});}};}function handleEntityNotFound(_0xfba950,_0x5f063c){return function(_0x3354d8){if(!_0x3354d8){_0xfba950[_0x73dd('0x19')](0x194);}return _0x3354d8;};}function handleError(_0x6a32,_0x2bef56){_0x2bef56=_0x2bef56||0x1f4;return function(_0x47a06a){logger['error'](_0x47a06a[_0x73dd('0x26')]);if(_0x47a06a[_0x73dd('0x27')]){delete _0x47a06a[_0x73dd('0x27')];}_0x6a32[_0x73dd('0x1b')](_0x2bef56)['send'](_0x47a06a);};}exports[_0x73dd('0x28')]=function(_0x10793f,_0x5978c2){var _0x191efc={},_0xf3ec59={},_0x13bfb3={'count':0x0,'rows':[]};var _0x3532a3=_[_0x73dd('0x29')](db[_0x73dd('0x2a')]['rawAttributes'],function(_0x3fd189){return{'name':_0x3fd189['fieldName'],'type':_0x3fd189['type'][_0x73dd('0x2b')]};});_0xf3ec59['model']=_[_0x73dd('0x2c')](_[_0x73dd('0x29')](_0x3532a3,_0x73dd('0x27')),[_0x73dd('0x27')]);_0xf3ec59[_0x73dd('0x2d')]=_['keys'](_0x10793f[_0x73dd('0x2d')]);_0xf3ec59[_0x73dd('0x2e')]=_[_0x73dd('0x2f')](_0xf3ec59[_0x73dd('0x30')],_0xf3ec59[_0x73dd('0x2d')]);_0x191efc[_0x73dd('0x31')]=_['intersection'](_0xf3ec59[_0x73dd('0x30')],qs[_0x73dd('0x32')](_0x10793f[_0x73dd('0x2d')][_0x73dd('0x32')]));_0x191efc[_0x73dd('0x31')]=_0x191efc[_0x73dd('0x31')][_0x73dd('0x33')]?_0x191efc[_0x73dd('0x31')]:_0xf3ec59[_0x73dd('0x30')];if(!_0x10793f[_0x73dd('0x2d')]['hasOwnProperty'](_0x73dd('0x34'))){_0x191efc[_0x73dd('0x1c')]=qs['limit'](_0x10793f[_0x73dd('0x2d')][_0x73dd('0x1c')]);_0x191efc[_0x73dd('0x1f')]=qs[_0x73dd('0x1f')](_0x10793f[_0x73dd('0x2d')]['offset']);}_0x191efc['order']=qs[_0x73dd('0x35')](_0x10793f[_0x73dd('0x2d')][_0x73dd('0x35')]);_0x191efc[_0x73dd('0x36')]=qs[_0x73dd('0x2e')](_[_0x73dd('0x37')](_0x10793f[_0x73dd('0x2d')],_0xf3ec59[_0x73dd('0x2e')]),_0x3532a3);if(_0x10793f[_0x73dd('0x2d')][_0x73dd('0x38')]){_0x191efc[_0x73dd('0x36')]=_[_0x73dd('0x39')](_0x191efc[_0x73dd('0x36')],{'$or':_[_0x73dd('0x29')](_0x3532a3,function(_0x5c37e1){if(_0x5c37e1['type']!==_0x73dd('0x3a')){var _0x1bdafc={};_0x1bdafc[_0x5c37e1[_0x73dd('0x27')]]={'$like':'%'+_0x10793f[_0x73dd('0x2d')][_0x73dd('0x38')]+'%'};return _0x1bdafc;}})});}_0x191efc=_[_0x73dd('0x39')]({},_0x191efc,_0x10793f[_0x73dd('0x3b')]);var _0x4a1d1a={'where':_0x191efc[_0x73dd('0x36')]};return db[_0x73dd('0x2a')]['count'](_0x4a1d1a)['then'](function(_0x34e6ff){_0x13bfb3[_0x73dd('0x1e')]=_0x34e6ff;if(_0x10793f['query'][_0x73dd('0x3c')]){_0x191efc[_0x73dd('0x3d')]=[{'all':!![]}];}return db[_0x73dd('0x2a')][_0x73dd('0x3e')](_0x191efc);})[_0x73dd('0x24')](function(_0xb0501c){_0x13bfb3[_0x73dd('0x3f')]=_0xb0501c;return _0x13bfb3;})[_0x73dd('0x24')](respondWithFilteredResult(_0x5978c2,_0x191efc))[_0x73dd('0x40')](handleError(_0x5978c2,null));};exports['show']=function(_0x448905,_0x29dd75){var _0x418398={'raw':!![],'where':{'id':_0x448905['params']['id']}},_0x4a11d0={};_0x4a11d0[_0x73dd('0x30')]=_[_0x73dd('0x41')](db[_0x73dd('0x2a')][_0x73dd('0x42')]);_0x4a11d0[_0x73dd('0x2d')]=_[_0x73dd('0x41')](_0x448905[_0x73dd('0x2d')]);_0x4a11d0[_0x73dd('0x2e')]=_['intersection'](_0x4a11d0[_0x73dd('0x30')],_0x4a11d0['query']);_0x418398[_0x73dd('0x31')]=_[_0x73dd('0x2f')](_0x4a11d0[_0x73dd('0x30')],qs[_0x73dd('0x32')](_0x448905['query'][_0x73dd('0x32')]));_0x418398[_0x73dd('0x31')]=_0x418398[_0x73dd('0x31')]['length']?_0x418398[_0x73dd('0x31')]:_0x4a11d0[_0x73dd('0x30')];if(_0x448905['query'][_0x73dd('0x3c')]){_0x418398[_0x73dd('0x3d')]=[{'all':!![]}];}_0x418398=_[_0x73dd('0x39')]({},_0x418398,_0x448905[_0x73dd('0x3b')]);return db[_0x73dd('0x2a')][_0x73dd('0x43')](_0x418398)[_0x73dd('0x24')](handleEntityNotFound(_0x29dd75,null))[_0x73dd('0x24')](respondWithResult(_0x29dd75,null))[_0x73dd('0x40')](handleError(_0x29dd75,null));};exports[_0x73dd('0x44')]=function(_0x3b92ad,_0xbaeb6){if(_0x3b92ad[_0x73dd('0x45')]['id']){delete _0x3b92ad['body']['id'];}return db[_0x73dd('0x2a')][_0x73dd('0x43')]({'where':{'id':_0x3b92ad[_0x73dd('0x46')]['id']}})[_0x73dd('0x24')](handleEntityNotFound(_0xbaeb6,null))['then'](saveUpdates(_0x3b92ad[_0x73dd('0x45')],null))[_0x73dd('0x24')](respondWithResult(_0xbaeb6,null))[_0x73dd('0x40')](handleError(_0xbaeb6,null));};exports[_0x73dd('0x25')]=function(_0x23e046,_0x4f2f4e){return db[_0x73dd('0x2a')][_0x73dd('0x43')]({'where':{'id':_0x23e046[_0x73dd('0x46')]['id']}})[_0x73dd('0x24')](handleEntityNotFound(_0x4f2f4e,null))[_0x73dd('0x24')](removeEntity(_0x4f2f4e,null))[_0x73dd('0x40')](handleError(_0x4f2f4e,null));};exports['create']=function(_0x539ff8,_0x3291bf){var _0x6c5e7f;return db[_0x73dd('0x47')][_0x73dd('0x48')](function(_0x4c6adf){return db[_0x73dd('0x2a')][_0x73dd('0x49')](_0x539ff8['body'],{'transaction':_0x4c6adf})[_0x73dd('0x24')](function(_0x5e546b){_0x6c5e7f=_0x5e546b;var _0x1f3ccf={'type':db[_0x73dd('0x4a')][_0x73dd('0x4b')],'transaction':_0x4c6adf};switch(_0x539ff8[_0x73dd('0x45')][_0x73dd('0x4c')]){case _0x73dd('0x4d'):_0x1f3ccf[_0x73dd('0x4c')]=db['Sequelize'][_0x73dd('0x4b')];break;case'number':_0x1f3ccf[_0x73dd('0x4c')]=db[_0x73dd('0x4a')][_0x73dd('0x4e')];break;case _0x73dd('0x4f'):_0x1f3ccf[_0x73dd('0x4c')]=db[_0x73dd('0x4a')]['BOOLEAN'];_0x1f3ccf[_0x73dd('0x50')]=![];break;default:}return db[_0x73dd('0x47')][_0x73dd('0x51')]['addColumn'](_0x73dd('0x52'),util[_0x73dd('0x53')](_0x73dd('0x54'),_0x6c5e7f['id']),_0x1f3ccf);})[_0x73dd('0x24')](function(){return _0x6c5e7f;});})['then'](respondWithResult(_0x3291bf,0xc9))['catch'](handleError(_0x3291bf,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 448595f..7149068 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 _0x7820=['util','api','moment','bluebird','path','./cmCustomField.attributes','define','cm_custom_fields'];(function(_0x2511aa,_0x587296){var _0x325080=function(_0x32b543){while(--_0x32b543){_0x2511aa['push'](_0x2511aa['shift']());}};_0x325080(++_0x587296);}(_0x7820,0xd8));var _0x0782=function(_0x13556f,_0x35b410){_0x13556f=_0x13556f-0x0;var _0x43b023=_0x7820[_0x13556f];return _0x43b023;};'use strict';var _=require('lodash');var util=require(_0x0782('0x0'));var logger=require('../../config/logger')(_0x0782('0x1'));var moment=require(_0x0782('0x2'));var BPromise=require(_0x0782('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0782('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0782('0x5'));module['exports']=function(_0x2a0c57,_0x638120){return _0x2a0c57[_0x0782('0x6')]('CmCustomField',attributes,{'tableName':_0x0782('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa466=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash','../../config/logger','api'];(function(_0x479d32,_0x300038){var _0x510824=function(_0x154b88){while(--_0x154b88){_0x479d32['push'](_0x479d32['shift']());}};_0x510824(++_0x300038);}(_0xa466,0x173));var _0x6a46=function(_0x4b4917,_0x1e2db1){_0x4b4917=_0x4b4917-0x0;var _0x5031b0=_0xa466[_0x4b4917];return _0x5031b0;};'use strict';var _=require(_0x6a46('0x0'));var util=require('util');var logger=require(_0x6a46('0x1'))(_0x6a46('0x2'));var moment=require(_0x6a46('0x3'));var BPromise=require(_0x6a46('0x4'));var rp=require(_0x6a46('0x5'));var fs=require('fs');var path=require(_0x6a46('0x6'));var rimraf=require(_0x6a46('0x7'));var config=require(_0x6a46('0x8'));var attributes=require(_0x6a46('0x9'));module['exports']=function(_0x1e51c8,_0x1dac2e){return _0x1e51c8['define'](_0x6a46('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 49297c0..64f187a 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 _0x98a3=['ioredis','../../config/logger','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring'];(function(_0x4a06e6,_0x5e81ef){var _0x1bdc90=function(_0xd07deb){while(--_0xd07deb){_0x4a06e6['push'](_0x4a06e6['shift']());}};_0x1bdc90(++_0x5e81ef);}(_0x98a3,0x18a));var _0x398a=function(_0x3c1d5b,_0xecd477){_0x3c1d5b=_0x3c1d5b-0x0;var _0x249fff=_0x98a3[_0x3c1d5b];return _0x249fff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x398a('0x0'));var BPromise=require('bluebird');var rs=require(_0x398a('0x1'));var fs=require('fs');var Redis=require(_0x398a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x398a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x398a('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb170,_0x119af7,_0xfd1dcb){return new BPromise(function(_0x176219,_0x1cbb8d){return client[_0x398a('0x5')](_0x4bb170,_0xfd1dcb)[_0x398a('0x6')](function(_0x5a56be){logger[_0x398a('0x7')](_0x398a('0x8'),_0x119af7,'request\x20sent');logger[_0x398a('0x9')](_0x398a('0xa'),_0x119af7,_0x398a('0xb'),JSON[_0x398a('0xc')](_0x5a56be));if(_0x5a56be[_0x398a('0xd')]){if(_0x5a56be[_0x398a('0xd')][_0x398a('0xe')]===0x1f4){logger[_0x398a('0xd')]('CmCustomField,\x20%s,\x20%s',_0x119af7,_0x5a56be[_0x398a('0xd')]['message']);return _0x1cbb8d(_0x5a56be[_0x398a('0xd')][_0x398a('0xf')]);}logger[_0x398a('0xd')](_0x398a('0x8'),_0x119af7,_0x5a56be[_0x398a('0xd')]['message']);return _0x176219(_0x5a56be[_0x398a('0xd')][_0x398a('0xf')]);}else{logger[_0x398a('0x7')](_0x398a('0x8'),_0x119af7,'request\x20sent');_0x176219(_0x5a56be[_0x398a('0x10')][_0x398a('0xf')]);}})[_0x398a('0x11')](function(_0x3de348){logger['error'](_0x398a('0x8'),_0x119af7,_0x3de348);_0x1cbb8d(_0x3de348);});});} \ No newline at end of file +var _0xf3ee=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf3ee,0x93));var _0xef3e=function(_0xf7c258,_0x1082c1){_0xf7c258=_0xf7c258-0x0;var _0xc4cc78=_0xf3ee[_0xf7c258];return _0xc4cc78;};'use strict';var _=require(_0xef3e('0x0'));var util=require(_0xef3e('0x1'));var moment=require(_0xef3e('0x2'));var BPromise=require(_0xef3e('0x3'));var rs=require(_0xef3e('0x4'));var fs=require('fs');var Redis=require(_0xef3e('0x5'));var db=require(_0xef3e('0x6'))['db'];var utils=require(_0xef3e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xef3e('0x8'));var jayson=require(_0xef3e('0x9'));var client=jayson[_0xef3e('0xa')][_0xef3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b4320,_0x15c3ba,_0x5bdc67){return new BPromise(function(_0x30b1d5,_0x2864a9){return client[_0xef3e('0xc')](_0x5b4320,_0x5bdc67)[_0xef3e('0xd')](function(_0x1d1354){logger[_0xef3e('0xe')](_0xef3e('0xf'),_0x15c3ba,'request\x20sent');logger['debug'](_0xef3e('0x10'),_0x15c3ba,_0xef3e('0x11'),JSON[_0xef3e('0x12')](_0x1d1354));if(_0x1d1354[_0xef3e('0x13')]){if(_0x1d1354[_0xef3e('0x13')]['code']===0x1f4){logger['error'](_0xef3e('0xf'),_0x15c3ba,_0x1d1354[_0xef3e('0x13')]['message']);return _0x2864a9(_0x1d1354['error'][_0xef3e('0x14')]);}logger[_0xef3e('0x13')]('CmCustomField,\x20%s,\x20%s',_0x15c3ba,_0x1d1354[_0xef3e('0x13')][_0xef3e('0x14')]);return _0x30b1d5(_0x1d1354[_0xef3e('0x13')]['message']);}else{logger[_0xef3e('0xe')](_0xef3e('0xf'),_0x15c3ba,_0xef3e('0x11'));_0x30b1d5(_0x1d1354[_0xef3e('0x15')][_0xef3e('0x14')]);}})['catch'](function(_0x355574){logger[_0xef3e('0x13')](_0xef3e('0xf'),_0x15c3ba,_0x355574);_0x2864a9(_0x355574);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d54f71b..62db5aa 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 _0xff3c=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xff3c,0x179));var _0xcff3=function(_0x5b83e5,_0xb0f98a){_0x5b83e5=_0x5b83e5-0x0;var _0x1c75b9=_0xff3c[_0x5b83e5];return _0x1c75b9;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['post']('/',auth[_0xcff3('0x9')](),controller[_0xcff3('0xc')]);router[_0xcff3('0xd')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xe')]);router[_0xcff3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);module[_0xcff3('0x11')]=router; \ No newline at end of file +var _0x289c=['./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x796ed7,_0x2543a7){var _0x4e29b5=function(_0x292a5a){while(--_0x292a5a){_0x796ed7['push'](_0x796ed7['shift']());}};_0x4e29b5(++_0x2543a7);}(_0x289c,0x110));var _0xc289=function(_0x215e14,_0x42e70e){_0x215e14=_0x215e14-0x0;var _0xa05a28=_0x289c[_0x215e14];return _0xa05a28;};'use strict';var multer=require(_0xc289('0x0'));var util=require(_0xc289('0x1'));var path=require(_0xc289('0x2'));var timeout=require(_0xc289('0x3'));var express=require('express');var router=express[_0xc289('0x4')]();var fs_extra=require(_0xc289('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc289('0x6'));var config=require(_0xc289('0x7'));var controller=require(_0xc289('0x8'));router['get']('/',auth[_0xc289('0x9')](),controller[_0xc289('0xa')]);router[_0xc289('0xb')](_0xc289('0xc'),auth[_0xc289('0x9')](),controller[_0xc289('0xd')]);router[_0xc289('0xe')]('/',auth[_0xc289('0x9')](),controller[_0xc289('0xf')]);router[_0xc289('0x10')]('/:id',auth[_0xc289('0x9')](),controller['update']);router[_0xc289('0x11')]('/:id',auth[_0xc289('0x9')](),controller[_0xc289('0x12')]);module[_0xc289('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 20f384f..524ab47 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 _0x05ca=['moment','sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','contactListQueue'];(function(_0x87eb24,_0x19556a){var _0x2527f3=function(_0xa56b77){while(--_0xa56b77){_0x87eb24['push'](_0x87eb24['shift']());}};_0x2527f3(++_0x19556a);}(_0x05ca,0x7e));var _0xa05c=function(_0x2ef09f,_0x56290b){_0x2ef09f=_0x2ef09f-0x0;var _0x1a6d36=_0x05ca[_0x2ef09f];return _0x1a6d36;};'use strict';var moment=require(_0xa05c('0x0'));var Sequelize=require(_0xa05c('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa05c('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa05c('0x3')],'defaultValue':moment()[_0xa05c('0x4')](_0xa05c('0x5'))},'countbusyretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa05c('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa05c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa05c('0x3')]},'priority':{'type':Sequelize[_0xa05c('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa05c('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'ListId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa05c('0x6')],'unique':_0xa05c('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa05c('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5d99=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN'];(function(_0x42bd97,_0x55f780){var _0x446eb0=function(_0x50fc6e){while(--_0x50fc6e){_0x42bd97['push'](_0x42bd97['shift']());}};_0x446eb0(++_0x55f780);}(_0x5d99,0x16f));var _0x95d9=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x5d99[_0x54eab6];return _0x1e7435;};'use strict';var moment=require(_0x95d9('0x0'));var Sequelize=require(_0x95d9('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x95d9('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x95d9('0x3')],'defaultValue':moment()[_0x95d9('0x4')](_0x95d9('0x5'))},'countbusyretry':{'type':Sequelize[_0x95d9('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x95d9('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x95d9('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x95d9('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x95d9('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x95d9('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x95d9('0x6')],'unique':_0x95d9('0x9')},'UserId':{'type':Sequelize[_0x95d9('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x95d9('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x95d9('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x95d9('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x95d9('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index ed4d23c..d9d2556 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 _0x4c88=['scheduledAt','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','literal','findOne','LOCK','UPDATE','CmCompany','Company','CmList','List','dialActive','getOpenContacts','outbound','entity\x20not\x20found','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','reject','update','destroy','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','$any','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','show','params','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','prev','hopperIds','priority'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4c88,0x12b));var _0x84c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4c88[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84c8('0x0'));var jsonpatch=require(_0x84c8('0x1'));var rp=require('request-promise');var moment=require(_0x84c8('0x2'));var BPromise=require(_0x84c8('0x3'));var Mustache=require('mustache');var util=require(_0x84c8('0x4'));var path=require(_0x84c8('0x5'));var sox=require(_0x84c8('0x6'));var csv=require(_0x84c8('0x7'));var ejs=require(_0x84c8('0x8'));var fs=require('fs');var fs_extra=require(_0x84c8('0x9'));var _=require('lodash');var squel=require(_0x84c8('0xa'));var crypto=require(_0x84c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x84c8('0xc'));var toCsv=require(_0x84c8('0x7'));var querystring=require(_0x84c8('0xd'));var Papa=require(_0x84c8('0xe'));var Redis=require(_0x84c8('0xf'));var authService=require(_0x84c8('0x10'));var qs=require(_0x84c8('0x11'));var as=require(_0x84c8('0x12'));var hardwareService=require(_0x84c8('0x13'));var logger=require('../../config/logger')(_0x84c8('0x14'));var utils=require(_0x84c8('0x15'));var config=require(_0x84c8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x84c8('0x17'))['db'];function respondWithStatusCode(_0x544f05,_0x16886e){_0x16886e=_0x16886e||0xcc;return function(_0x1f6051){if(_0x1f6051){return _0x544f05[_0x84c8('0x18')](_0x16886e);}return _0x544f05['status'](_0x16886e)[_0x84c8('0x19')]();};}function respondWithResult(_0x10fa02,_0x1b18d3){_0x1b18d3=_0x1b18d3||0xc8;return function(_0x44585c){if(_0x44585c){return _0x10fa02[_0x84c8('0x1a')](_0x1b18d3)[_0x84c8('0x1b')](_0x44585c);}};}function respondWithFilteredResult(_0x28069e,_0x5a221f){return function(_0x2b76d0){if(_0x2b76d0){var _0x206211=typeof _0x5a221f[_0x84c8('0x1c')]==='undefined'&&typeof _0x5a221f[_0x84c8('0x1d')]==='undefined';var _0x166d06=_0x2b76d0[_0x84c8('0x1e')];var _0xfad9a3=_0x206211?0x0:_0x5a221f[_0x84c8('0x1c')];var _0x4a4f27=_0x206211?_0x2b76d0['count']:_0x5a221f['offset']+_0x5a221f[_0x84c8('0x1d')];var _0x1612df;if(_0x4a4f27>=_0x166d06){_0x4a4f27=_0x166d06;_0x1612df=0xc8;}else{_0x1612df=0xce;}_0x28069e['status'](_0x1612df);return _0x28069e[_0x84c8('0x1f')]('Content-Range',_0xfad9a3+'-'+_0x4a4f27+'/'+_0x166d06)['json'](_0x2b76d0);}return null;};}function patchUpdates(_0x5cba62){return function(_0x3f1fbd){try{jsonpatch[_0x84c8('0x20')](_0x3f1fbd,_0x5cba62,!![]);}catch(_0x4530d1){return BPromise[_0x84c8('0x21')](_0x4530d1);}return _0x3f1fbd['save']();};}function saveUpdates(_0x29677c,_0xe819fa){return function(_0x144aa4){if(_0x144aa4){return _0x144aa4[_0x84c8('0x22')](_0x29677c)['then'](function(_0x153dc8){return _0x153dc8;});}return null;};}function removeEntity(_0x26b9d0,_0x1da55b){return function(_0x2603db){if(_0x2603db){return _0x2603db[_0x84c8('0x23')]()['then'](function(){_0x26b9d0[_0x84c8('0x1a')](0xcc)[_0x84c8('0x19')]();});}};}function handleEntityNotFound(_0x425e6b,_0x2e4ef2){return function(_0x1324bf){if(!_0x1324bf){_0x425e6b[_0x84c8('0x18')](0x194);}return _0x1324bf;};}function handleError(_0x1d4fdc,_0x35bef3){_0x35bef3=_0x35bef3||0x1f4;return function(_0x80beb4){logger[_0x84c8('0x24')](_0x80beb4[_0x84c8('0x25')]);if(_0x80beb4[_0x84c8('0x26')]){delete _0x80beb4[_0x84c8('0x26')];}_0x1d4fdc[_0x84c8('0x1a')](_0x35bef3)['send'](_0x80beb4);};}exports['index']=function(_0x31acbf,_0x25b115){var _0x277b72={},_0x494484={},_0x50f4f2={'count':0x0,'rows':[]};var _0x56474e=_[_0x84c8('0x27')](db[_0x84c8('0x28')][_0x84c8('0x29')],function(_0x437cbb){return{'name':_0x437cbb[_0x84c8('0x2a')],'type':_0x437cbb[_0x84c8('0x2b')][_0x84c8('0x2c')]};});_0x494484[_0x84c8('0x2d')]=_['map'](_0x56474e,_0x84c8('0x26'));_0x494484[_0x84c8('0x2e')]=_[_0x84c8('0x2f')](_0x31acbf['query']);_0x494484['filters']=_['intersection'](_0x494484[_0x84c8('0x2d')],_0x494484[_0x84c8('0x2e')]);_0x494484[_0x84c8('0x30')]=_[_0x84c8('0x31')](_0x494484[_0x84c8('0x30')],['$and',_0x84c8('0x32'),_0x84c8('0x33'),_0x84c8('0x34'),_0x84c8('0x35'),_0x84c8('0x36'),_0x84c8('0x37'),_0x84c8('0x38'),_0x84c8('0x39'),_0x84c8('0x3a'),_0x84c8('0x3b'),_0x84c8('0x3c'),'$notIn','$like',_0x84c8('0x3d'),_0x84c8('0x3e'),_0x84c8('0x3f'),'$like',_0x84c8('0x40'),'$contains','$contained',_0x84c8('0x41')]);_0x277b72['attributes']=_[_0x84c8('0x42')](_0x494484['model'],qs[_0x84c8('0x43')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x43')]));_0x277b72['attributes']=_0x277b72[_0x84c8('0x44')][_0x84c8('0x45')]?_0x277b72[_0x84c8('0x44')]:_0x494484['model'];if(!_0x31acbf[_0x84c8('0x2e')]['hasOwnProperty'](_0x84c8('0x46'))){_0x277b72['limit']=qs[_0x84c8('0x1d')](_0x31acbf['query'][_0x84c8('0x1d')]);_0x277b72[_0x84c8('0x1c')]=qs[_0x84c8('0x1c')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x1c')]);}_0x277b72[_0x84c8('0x47')]=qs[_0x84c8('0x48')](_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x48')]);_0x277b72[_0x84c8('0x49')]=qs[_0x84c8('0x30')](_[_0x84c8('0x4a')](_0x31acbf[_0x84c8('0x2e')],_0x494484[_0x84c8('0x30')]),_0x56474e);if(_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x4b')]){_0x277b72['where']=_[_0x84c8('0x4c')](_0x277b72[_0x84c8('0x49')],{'$or':_[_0x84c8('0x27')](_0x56474e,function(_0x303294){if(_0x303294[_0x84c8('0x2b')]!==_0x84c8('0x4d')){var _0x196dec={};_0x196dec[_0x303294[_0x84c8('0x26')]]={'$like':'%'+_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x4b')]+'%'};return _0x196dec;}})});}_0x277b72=_[_0x84c8('0x4c')]({},_0x277b72,_0x31acbf[_0x84c8('0x4e')]);var _0x1294de={'where':_0x277b72['where']};return db[_0x84c8('0x28')][_0x84c8('0x1e')](_0x1294de)[_0x84c8('0x4f')](function(_0x27b225){_0x50f4f2[_0x84c8('0x1e')]=_0x27b225;if(_0x31acbf[_0x84c8('0x2e')][_0x84c8('0x50')]){_0x277b72[_0x84c8('0x51')]=[{'all':!![]}];}return db[_0x84c8('0x28')]['findAll'](_0x277b72);})[_0x84c8('0x4f')](function(_0x932f98){_0x50f4f2[_0x84c8('0x52')]=_0x932f98;return _0x50f4f2;})[_0x84c8('0x4f')](respondWithFilteredResult(_0x25b115,_0x277b72))['catch'](handleError(_0x25b115,null));};exports[_0x84c8('0x53')]=function(_0x1a1ac8,_0x46c858){var _0x388605={'raw':!![],'where':{'id':_0x1a1ac8[_0x84c8('0x54')]['id']}},_0x102070={};_0x102070[_0x84c8('0x2d')]=_[_0x84c8('0x2f')](db[_0x84c8('0x28')][_0x84c8('0x29')]);_0x102070[_0x84c8('0x2e')]=_['keys'](_0x1a1ac8[_0x84c8('0x2e')]);_0x102070['filters']=_[_0x84c8('0x42')](_0x102070[_0x84c8('0x2d')],_0x102070[_0x84c8('0x2e')]);_0x388605['attributes']=_[_0x84c8('0x42')](_0x102070[_0x84c8('0x2d')],qs['fields'](_0x1a1ac8[_0x84c8('0x2e')][_0x84c8('0x43')]));_0x388605[_0x84c8('0x44')]=_0x388605[_0x84c8('0x44')][_0x84c8('0x45')]?_0x388605[_0x84c8('0x44')]:_0x102070['model'];if(_0x1a1ac8[_0x84c8('0x2e')][_0x84c8('0x50')]){_0x388605[_0x84c8('0x51')]=[{'all':!![]}];}_0x388605=_['merge']({},_0x388605,_0x1a1ac8[_0x84c8('0x4e')]);return db['CmHopper'][_0x84c8('0x55')](_0x388605)[_0x84c8('0x4f')](handleEntityNotFound(_0x46c858,null))[_0x84c8('0x4f')](respondWithResult(_0x46c858,null))[_0x84c8('0x56')](handleError(_0x46c858,null));};exports[_0x84c8('0x57')]=function(_0x48c6bc,_0x29127a){return db[_0x84c8('0x28')][_0x84c8('0x57')](_0x48c6bc[_0x84c8('0x58')],{})[_0x84c8('0x4f')](respondWithResult(_0x29127a,0xc9))[_0x84c8('0x56')](handleError(_0x29127a,null));};exports[_0x84c8('0x22')]=function(_0xa696c9,_0x5aa322){if(_0xa696c9[_0x84c8('0x58')]['id']){delete _0xa696c9['body']['id'];}return db[_0x84c8('0x28')]['find']({'where':{'id':_0xa696c9[_0x84c8('0x54')]['id']}})['then'](handleEntityNotFound(_0x5aa322,null))[_0x84c8('0x4f')](saveUpdates(_0xa696c9['body'],null))['then'](respondWithResult(_0x5aa322,null))[_0x84c8('0x56')](handleError(_0x5aa322,null));};exports[_0x84c8('0x59')]=function(_0x5c4405,_0x3463d4){return db[_0x84c8('0x28')]['describe']()[_0x84c8('0x4f')](respondWithResult(_0x3463d4,null))[_0x84c8('0x56')](handleError(_0x3463d4,null));};exports['destroy']=function(_0x42c7f4,_0x4ede5b){var _0x3c55e8;return db[_0x84c8('0x28')][_0x84c8('0x55')]({'where':{'id':_0x42c7f4['params']['id']}})['then'](handleEntityNotFound(_0x4ede5b,null))['then'](function(_0x1b51e8){if(_0x1b51e8){return _0x1b51e8['destroy']()[_0x84c8('0x4f')](function(_0x43da67){return _0x43da67;});}})['then'](function(_0x3e8d16){_0x3c55e8=_0x3e8d16;if(_0x3e8d16){if(_0x3e8d16[_0x84c8('0x5a')]||_0x3e8d16[_0x84c8('0x5b')]){return db[_0x3e8d16[_0x84c8('0x5a')]?_0x84c8('0x5c'):_0x84c8('0x5d')][_0x84c8('0x55')]({'where':{'id':_0x3e8d16['VoiceQueueId']?_0x3e8d16[_0x84c8('0x5a')]:_0x3e8d16[_0x84c8('0x5b')]},'attributes':['id',_0x84c8('0x26')],'raw':!![]});}}})[_0x84c8('0x4f')](function(_0x2973ef){var _0x598b8d={};if(_0x2973ef){_['merge'](_0x598b8d,_[_0x84c8('0x5e')](_0x3c55e8[_0x84c8('0x5f')],[_0x84c8('0x60'),_0x84c8('0x61'),'id']));_0x598b8d['state']=0x15;_0x598b8d['statedesc']=_0x84c8('0x62');_0x598b8d[_0x84c8('0x63')]=_0x2973ef[_0x84c8('0x26')];_0x598b8d['membername']=_0x42c7f4[_0x84c8('0x64')][_0x84c8('0x26')];_0x598b8d[_0x84c8('0x65')]=_0x42c7f4[_0x84c8('0x64')]['id'];_0x598b8d[_0x84c8('0x62')]=!![];_0x598b8d['deletedat']=moment()[_0x84c8('0x66')](_0x84c8('0x67'));_0x598b8d[_0x84c8('0x68')]=_0x3c55e8[_0x84c8('0x69')];_0x598b8d[_0x84c8('0x6a')]=_0x3c55e8[_0x84c8('0x5a')]?_0x84c8('0x6b'):_0x84c8('0x6c');return db[_0x84c8('0x6d')][_0x84c8('0x55')]({'where':{'id':_0x598b8d[_0x84c8('0x6e')]},'attributes':['firstName',_0x84c8('0x6f')]})[_0x84c8('0x4f')](function(_0x506b3f){if(!_[_0x84c8('0x70')](_0x4ede5b)&&!_['isNil'](_0x506b3f['firstName'])){_0x598b8d[_0x84c8('0x71')]=_0x506b3f['firstName'];if(!_[_0x84c8('0x70')](_0x506b3f[_0x84c8('0x6f')])){_0x598b8d[_0x84c8('0x71')]+='\x20'+_0x506b3f[_0x84c8('0x6f')];}}})[_0x84c8('0x72')](function(){return db[_0x84c8('0x73')]['create'](_0x598b8d);});}})['then'](function(){return _0x4ede5b['status'](0xcc)[_0x84c8('0x19')]();})[_0x84c8('0x56')](handleError(_0x4ede5b,null));};exports[_0x84c8('0x74')]=function(_0x23597a,_0x19f3f6,_0x21e833){var _0xd7962d=[];return db[_0x84c8('0x6d')][_0x84c8('0x59')]()[_0x84c8('0x4f')](function(_0x1a9b69){_0xd7962d=_[_0x84c8('0x2f')](_0x1a9b69);return _0x23597a[_0x84c8('0x64')][_0x84c8('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x84c8('0x76')},'attributes':['id',_0x84c8('0x77')],'raw':!![]});})[_0x84c8('0x4f')](function(_0xcef22c){if(_0xcef22c&&_0xcef22c['length']){return db[_0x84c8('0x78')]['transaction'](function(_0x5e5a40){var _0x52ed65={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x84c8('0x66')](_0x84c8('0x67'))},'VoiceQueueId':{'$in':_[_0x84c8('0x27')](_0xcef22c,'id')},'$or':[{'UserId':null},{'UserId':_0x23597a[_0x84c8('0x64')]['id']}]};var _0x5446af=[];if(_0x23597a['body']['direction']&&_0x23597a['body']['direction']===_0x84c8('0x79')){if(!_['isEmpty'](_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')])){_0x52ed65['id']={'$in':_0x23597a[_0x84c8('0x58')]['hopperIds']};}_0x5446af=[[_0x84c8('0x7b'),'ASC'],[_0x84c8('0x7c'),_0xcef22c[0x0][_0x84c8('0x77')]===_0x84c8('0x7d')?_0x84c8('0x7e'):_0x84c8('0x7d')],db['sequelize']['literal'](_0x84c8('0x7f')),['id','DESC']];}else{if(!_[_0x84c8('0x80')](_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')])){_0x52ed65['id']={'$notIn':_0x23597a[_0x84c8('0x58')][_0x84c8('0x7a')]};}_0x5446af=[[_0x84c8('0x7b'),_0x84c8('0x7e')],[_0x84c8('0x7c'),_0xcef22c[0x0][_0x84c8('0x77')]],db[_0x84c8('0x78')][_0x84c8('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x84c8('0x7d')]];}return db[_0x84c8('0x28')][_0x84c8('0x82')]({'attributes':['id','scheduledat'],'where':_0x52ed65,'order':_0x5446af,'transaction':_0x5e5a40,'lock':_0x5e5a40[_0x84c8('0x83')][_0x84c8('0x84')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0xd7962d,'include':[{'model':db[_0x84c8('0x85')],'as':_0x84c8('0x86'),'attributes':['id',_0x84c8('0x26')]}]},{'model':db[_0x84c8('0x87')],'as':_0x84c8('0x88'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x84c8('0x26'),_0x84c8('0x89')]}]})[_0x84c8('0x4f')](function(_0xb3889){if(_0xb3889){return _0xb3889[_0x84c8('0x22')]({'UserId':_0x23597a[_0x84c8('0x64')]['id']},{'transaction':_0x5e5a40});}});});}})[_0x84c8('0x4f')](handleEntityNotFound(_0x19f3f6,null))[_0x84c8('0x4f')](respondWithResult(_0x19f3f6,null))[_0x84c8('0x56')](handleError(_0x19f3f6,null));};exports[_0x84c8('0x8a')]=function(_0x1a17d3,_0xf5b0e9,_0x1e72ac){return _0x1a17d3['user'][_0x84c8('0x75')]({'where':{'type':_0x84c8('0x8b'),'dialActive':!![],'dialMethod':_0x84c8('0x76')},'attributes':['id'],'raw':!![]})[_0x84c8('0x4f')](function(_0x1922a9){if(_0x1922a9&&_0x1922a9[_0x84c8('0x45')]){return db[_0x84c8('0x28')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x84c8('0x66')](_0x84c8('0x67'))},'VoiceQueueId':{'$in':_[_0x84c8('0x27')](_0x1922a9,'id')},'$or':[{'UserId':null},{'UserId':_0x1a17d3[_0x84c8('0x64')]['id']}]}});}return 0x0;})[_0x84c8('0x4f')](function(_0x4f30d7){if(!_['isNil'](_0x4f30d7)&&_['isNumber'](_0x4f30d7)){return _0xf5b0e9['status'](0xc8)[_0x84c8('0x1b')]({'contacts':_0x4f30d7});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x84c8('0x8a'),0x194,_0x84c8('0x8c'));_0xf5b0e9['sendStatus'](0x194);}})[_0x84c8('0x56')](handleError(_0xf5b0e9,null));}; \ No newline at end of file +var _0x0f60=['catch','show','body','find','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','state','statedesc','campaign','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','create','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getOpenContacts','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','model','query','keys','filters','intersection','concat','$gt','$lt','$lte','$ne','$eq','$notBetween','$like','$notILike','$overlap','$contains','$any','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x0f60,0xcf));var _0x00f6=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x0f60[_0x2e5f9c];return _0x538b44;};'use strict';var emlformat=require(_0x00f6('0x0'));var rimraf=require(_0x00f6('0x1'));var zipdir=require(_0x00f6('0x2'));var jsonpatch=require(_0x00f6('0x3'));var rp=require(_0x00f6('0x4'));var moment=require(_0x00f6('0x5'));var BPromise=require(_0x00f6('0x6'));var Mustache=require(_0x00f6('0x7'));var util=require('util');var path=require(_0x00f6('0x8'));var sox=require(_0x00f6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00f6('0xa'));var squel=require('squel');var crypto=require(_0x00f6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x00f6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x00f6('0xd'));var Papa=require(_0x00f6('0xe'));var Redis=require(_0x00f6('0xf'));var authService=require(_0x00f6('0x10'));var qs=require(_0x00f6('0x11'));var as=require(_0x00f6('0x12'));var hardwareService=require(_0x00f6('0x13'));var logger=require('../../config/logger')(_0x00f6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00f6('0x15'));var db=require(_0x00f6('0x16'))['db'];function respondWithStatusCode(_0x4bf07e,_0x23d92b){_0x23d92b=_0x23d92b||0xcc;return function(_0x44b4fc){if(_0x44b4fc){return _0x4bf07e[_0x00f6('0x17')](_0x23d92b);}return _0x4bf07e['status'](_0x23d92b)[_0x00f6('0x18')]();};}function respondWithResult(_0x52b285,_0x1eece6){_0x1eece6=_0x1eece6||0xc8;return function(_0x3dc8f6){if(_0x3dc8f6){return _0x52b285[_0x00f6('0x19')](_0x1eece6)['json'](_0x3dc8f6);}};}function respondWithFilteredResult(_0x29ff49,_0x2b7174){return function(_0x2961fd){if(_0x2961fd){var _0x57d4d3=typeof _0x2b7174['offset']===_0x00f6('0x1a')&&typeof _0x2b7174[_0x00f6('0x1b')]===_0x00f6('0x1a');var _0x4e42cc=_0x2961fd[_0x00f6('0x1c')];var _0x46c6e2=_0x57d4d3?0x0:_0x2b7174[_0x00f6('0x1d')];var _0x1ab199=_0x57d4d3?_0x2961fd[_0x00f6('0x1c')]:_0x2b7174[_0x00f6('0x1d')]+_0x2b7174[_0x00f6('0x1b')];var _0x3fad1f;if(_0x1ab199>=_0x4e42cc){_0x1ab199=_0x4e42cc;_0x3fad1f=0xc8;}else{_0x3fad1f=0xce;}_0x29ff49['status'](_0x3fad1f);return _0x29ff49[_0x00f6('0x1e')](_0x00f6('0x1f'),_0x46c6e2+'-'+_0x1ab199+'/'+_0x4e42cc)['json'](_0x2961fd);}return null;};}function patchUpdates(_0x4bc5ec){return function(_0x2cfccc){try{jsonpatch['apply'](_0x2cfccc,_0x4bc5ec,!![]);}catch(_0x30b28c){return BPromise[_0x00f6('0x20')](_0x30b28c);}return _0x2cfccc[_0x00f6('0x21')]();};}function saveUpdates(_0x1d588a,_0x3fefdb){return function(_0x511653){if(_0x511653){return _0x511653[_0x00f6('0x22')](_0x1d588a)[_0x00f6('0x23')](function(_0x24ee93){return _0x24ee93;});}return null;};}function removeEntity(_0x48150e,_0x48ca43){return function(_0x54e656){if(_0x54e656){return _0x54e656[_0x00f6('0x24')]()[_0x00f6('0x23')](function(){_0x48150e['status'](0xcc)[_0x00f6('0x18')]();});}};}function handleEntityNotFound(_0x3cc922,_0x314904){return function(_0x4be873){if(!_0x4be873){_0x3cc922['sendStatus'](0x194);}return _0x4be873;};}function handleError(_0x5c99a7,_0x1d27f0){_0x1d27f0=_0x1d27f0||0x1f4;return function(_0x4550f2){logger[_0x00f6('0x25')](_0x4550f2[_0x00f6('0x26')]);if(_0x4550f2[_0x00f6('0x27')]){delete _0x4550f2[_0x00f6('0x27')];}_0x5c99a7[_0x00f6('0x19')](_0x1d27f0)['send'](_0x4550f2);};}exports[_0x00f6('0x28')]=function(_0x578703,_0x59c263){var _0x1c1798={},_0x2abb9b={},_0x3d0041={'count':0x0,'rows':[]};var _0x30991a=_[_0x00f6('0x29')](db[_0x00f6('0x2a')][_0x00f6('0x2b')],function(_0x5bffea){return{'name':_0x5bffea[_0x00f6('0x2c')],'type':_0x5bffea['type']['key']};});_0x2abb9b[_0x00f6('0x2d')]=_[_0x00f6('0x29')](_0x30991a,_0x00f6('0x27'));_0x2abb9b[_0x00f6('0x2e')]=_[_0x00f6('0x2f')](_0x578703['query']);_0x2abb9b[_0x00f6('0x30')]=_[_0x00f6('0x31')](_0x2abb9b[_0x00f6('0x2d')],_0x2abb9b[_0x00f6('0x2e')]);_0x2abb9b['filters']=_[_0x00f6('0x32')](_0x2abb9b[_0x00f6('0x30')],['$and','$or',_0x00f6('0x33'),'$gte',_0x00f6('0x34'),_0x00f6('0x35'),_0x00f6('0x36'),_0x00f6('0x37'),'$not','$between',_0x00f6('0x38'),'$in','$notIn',_0x00f6('0x39'),'$notLike','$iLike',_0x00f6('0x3a'),_0x00f6('0x39'),_0x00f6('0x3b'),_0x00f6('0x3c'),'$contained',_0x00f6('0x3d')]);_0x1c1798['attributes']=_['intersection'](_0x2abb9b[_0x00f6('0x2d')],qs[_0x00f6('0x3e')](_0x578703['query'][_0x00f6('0x3e')]));_0x1c1798['attributes']=_0x1c1798[_0x00f6('0x3f')][_0x00f6('0x40')]?_0x1c1798[_0x00f6('0x3f')]:_0x2abb9b[_0x00f6('0x2d')];if(!_0x578703['query']['hasOwnProperty'](_0x00f6('0x41'))){_0x1c1798[_0x00f6('0x1b')]=qs['limit'](_0x578703['query'][_0x00f6('0x1b')]);_0x1c1798['offset']=qs['offset'](_0x578703[_0x00f6('0x2e')][_0x00f6('0x1d')]);}_0x1c1798[_0x00f6('0x42')]=qs[_0x00f6('0x43')](_0x578703[_0x00f6('0x2e')]['sort']);_0x1c1798[_0x00f6('0x44')]=qs[_0x00f6('0x30')](_[_0x00f6('0x45')](_0x578703[_0x00f6('0x2e')],_0x2abb9b[_0x00f6('0x30')]),_0x30991a);if(_0x578703[_0x00f6('0x2e')]['filter']){_0x1c1798[_0x00f6('0x44')]=_[_0x00f6('0x46')](_0x1c1798[_0x00f6('0x44')],{'$or':_['map'](_0x30991a,function(_0x5f0c28){if(_0x5f0c28[_0x00f6('0x47')]!=='VIRTUAL'){var _0x399c10={};_0x399c10[_0x5f0c28['name']]={'$like':'%'+_0x578703['query'][_0x00f6('0x48')]+'%'};return _0x399c10;}})});}_0x1c1798=_[_0x00f6('0x46')]({},_0x1c1798,_0x578703[_0x00f6('0x49')]);var _0x56127b={'where':_0x1c1798[_0x00f6('0x44')]};return db['CmHopper'][_0x00f6('0x1c')](_0x56127b)['then'](function(_0x4859df){_0x3d0041['count']=_0x4859df;if(_0x578703[_0x00f6('0x2e')][_0x00f6('0x4a')]){_0x1c1798[_0x00f6('0x4b')]=[{'all':!![]}];}return db[_0x00f6('0x2a')][_0x00f6('0x4c')](_0x1c1798);})['then'](function(_0x2c9744){_0x3d0041['rows']=_0x2c9744;return _0x3d0041;})[_0x00f6('0x23')](respondWithFilteredResult(_0x59c263,_0x1c1798))[_0x00f6('0x4d')](handleError(_0x59c263,null));};exports[_0x00f6('0x4e')]=function(_0x12be8e,_0x1c2ca1){var _0x5d90b1={'raw':!![],'where':{'id':_0x12be8e['params']['id']}},_0x381a95={};_0x381a95['model']=_[_0x00f6('0x2f')](db[_0x00f6('0x2a')][_0x00f6('0x2b')]);_0x381a95[_0x00f6('0x2e')]=_['keys'](_0x12be8e[_0x00f6('0x2e')]);_0x381a95[_0x00f6('0x30')]=_[_0x00f6('0x31')](_0x381a95[_0x00f6('0x2d')],_0x381a95[_0x00f6('0x2e')]);_0x5d90b1[_0x00f6('0x3f')]=_[_0x00f6('0x31')](_0x381a95[_0x00f6('0x2d')],qs[_0x00f6('0x3e')](_0x12be8e['query'][_0x00f6('0x3e')]));_0x5d90b1['attributes']=_0x5d90b1[_0x00f6('0x3f')][_0x00f6('0x40')]?_0x5d90b1[_0x00f6('0x3f')]:_0x381a95[_0x00f6('0x2d')];if(_0x12be8e[_0x00f6('0x2e')][_0x00f6('0x4a')]){_0x5d90b1[_0x00f6('0x4b')]=[{'all':!![]}];}_0x5d90b1=_['merge']({},_0x5d90b1,_0x12be8e[_0x00f6('0x49')]);return db['CmHopper']['find'](_0x5d90b1)['then'](handleEntityNotFound(_0x1c2ca1,null))[_0x00f6('0x23')](respondWithResult(_0x1c2ca1,null))[_0x00f6('0x4d')](handleError(_0x1c2ca1,null));};exports['create']=function(_0x6f738e,_0x4cca20){return db['CmHopper']['create'](_0x6f738e[_0x00f6('0x4f')],{})[_0x00f6('0x23')](respondWithResult(_0x4cca20,0xc9))['catch'](handleError(_0x4cca20,null));};exports[_0x00f6('0x22')]=function(_0x1e317f,_0x20233c){if(_0x1e317f[_0x00f6('0x4f')]['id']){delete _0x1e317f[_0x00f6('0x4f')]['id'];}return db[_0x00f6('0x2a')][_0x00f6('0x50')]({'where':{'id':_0x1e317f[_0x00f6('0x51')]['id']}})[_0x00f6('0x23')](handleEntityNotFound(_0x20233c,null))['then'](saveUpdates(_0x1e317f['body'],null))['then'](respondWithResult(_0x20233c,null))[_0x00f6('0x4d')](handleError(_0x20233c,null));};exports[_0x00f6('0x52')]=function(_0x17d9d3,_0x4e09d6){return db['CmHopper']['describe']()[_0x00f6('0x23')](respondWithResult(_0x4e09d6,null))[_0x00f6('0x4d')](handleError(_0x4e09d6,null));};exports['destroy']=function(_0x1ff27f,_0x10281f){var _0x12b8fc;return db[_0x00f6('0x2a')][_0x00f6('0x50')]({'where':{'id':_0x1ff27f['params']['id']}})[_0x00f6('0x23')](handleEntityNotFound(_0x10281f,null))[_0x00f6('0x23')](function(_0x40d220){if(_0x40d220){return _0x40d220[_0x00f6('0x24')]()['then'](function(_0x2aec26){return _0x2aec26;});}})[_0x00f6('0x23')](function(_0x30320a){_0x12b8fc=_0x30320a;if(_0x30320a){if(_0x30320a[_0x00f6('0x53')]||_0x30320a[_0x00f6('0x54')]){return db[_0x30320a[_0x00f6('0x53')]?_0x00f6('0x55'):_0x00f6('0x56')][_0x00f6('0x50')]({'where':{'id':_0x30320a[_0x00f6('0x53')]?_0x30320a[_0x00f6('0x53')]:_0x30320a[_0x00f6('0x54')]},'attributes':['id',_0x00f6('0x27')],'raw':!![]});}}})['then'](function(_0xa12778){var _0x137612={};if(_0xa12778){_['merge'](_0x137612,_[_0x00f6('0x57')](_0x12b8fc[_0x00f6('0x58')],['createdAt','updatedAt','id']));_0x137612[_0x00f6('0x59')]=0x15;_0x137612[_0x00f6('0x5a')]='deleted';_0x137612[_0x00f6('0x5b')]=_0xa12778[_0x00f6('0x27')];_0x137612['membername']=_0x1ff27f['user'][_0x00f6('0x27')];_0x137612[_0x00f6('0x5c')]=_0x1ff27f[_0x00f6('0x5d')]['id'];_0x137612[_0x00f6('0x5e')]=!![];_0x137612[_0x00f6('0x5f')]=moment()[_0x00f6('0x60')](_0x00f6('0x61'));_0x137612[_0x00f6('0x62')]=_0x12b8fc[_0x00f6('0x63')];_0x137612['campaigntype']=_0x12b8fc['VoiceQueueId']?_0x00f6('0x64'):_0x00f6('0x65');return db[_0x00f6('0x66')][_0x00f6('0x50')]({'where':{'id':_0x137612[_0x00f6('0x67')]},'attributes':[_0x00f6('0x68'),_0x00f6('0x69')]})[_0x00f6('0x23')](function(_0x3de702){if(!_[_0x00f6('0x6a')](_0x10281f)&&!_['isNil'](_0x3de702[_0x00f6('0x68')])){_0x137612[_0x00f6('0x6b')]=_0x3de702['firstName'];if(!_[_0x00f6('0x6a')](_0x3de702[_0x00f6('0x69')])){_0x137612[_0x00f6('0x6b')]+='\x20'+_0x3de702[_0x00f6('0x69')];}}})[_0x00f6('0x6c')](function(){return db['CmHopperFinal'][_0x00f6('0x6d')](_0x137612);});}})[_0x00f6('0x23')](function(){return _0x10281f[_0x00f6('0x19')](0xcc)[_0x00f6('0x18')]();})[_0x00f6('0x4d')](handleError(_0x10281f,null));};exports[_0x00f6('0x6e')]=function(_0x5c2af3,_0xb89fb1,_0xa6ad4b){var _0xf142bd=[];return db[_0x00f6('0x66')]['describe']()[_0x00f6('0x23')](function(_0x136916){_0xf142bd=_['keys'](_0x136916);return _0x5c2af3['user'][_0x00f6('0x6f')]({'where':{'type':_0x00f6('0x70'),'dialActive':!![],'dialMethod':_0x00f6('0x71')},'attributes':['id',_0x00f6('0x72')],'raw':!![]});})[_0x00f6('0x23')](function(_0x3b3aa0){if(_0x3b3aa0&&_0x3b3aa0['length']){return db[_0x00f6('0x73')][_0x00f6('0x74')](function(_0x464b7e){var _0x28c1fd={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x00f6('0x60')](_0x00f6('0x61'))},'VoiceQueueId':{'$in':_[_0x00f6('0x29')](_0x3b3aa0,'id')},'$or':[{'UserId':null},{'UserId':_0x5c2af3[_0x00f6('0x5d')]['id']}]};var _0x336987=[];if(_0x5c2af3[_0x00f6('0x4f')][_0x00f6('0x75')]&&_0x5c2af3[_0x00f6('0x4f')][_0x00f6('0x75')]===_0x00f6('0x76')){if(!_[_0x00f6('0x77')](_0x5c2af3[_0x00f6('0x4f')][_0x00f6('0x78')])){_0x28c1fd['id']={'$in':_0x5c2af3['body'][_0x00f6('0x78')]};}_0x336987=[['priority',_0x00f6('0x79')],[_0x00f6('0x7a'),_0x3b3aa0[0x0][_0x00f6('0x72')]===_0x00f6('0x79')?_0x00f6('0x7b'):_0x00f6('0x79')],db[_0x00f6('0x73')][_0x00f6('0x7c')](_0x00f6('0x7d')),['id',_0x00f6('0x7b')]];}else{if(!_[_0x00f6('0x77')](_0x5c2af3[_0x00f6('0x4f')]['hopperIds'])){_0x28c1fd['id']={'$notIn':_0x5c2af3[_0x00f6('0x4f')]['hopperIds']};}_0x336987=[['priority','DESC'],['scheduledAt',_0x3b3aa0[0x0]['dialOrderByScheduledAt']],db[_0x00f6('0x73')][_0x00f6('0x7c')](_0x00f6('0x7e')),['id',_0x00f6('0x79')]];}return db[_0x00f6('0x2a')][_0x00f6('0x7f')]({'attributes':['id',_0x00f6('0x80')],'where':_0x28c1fd,'order':_0x336987,'transaction':_0x464b7e,'lock':_0x464b7e[_0x00f6('0x81')][_0x00f6('0x82')],'include':[{'model':db[_0x00f6('0x66')],'as':_0x00f6('0x83'),'attributes':_0xf142bd,'include':[{'model':db[_0x00f6('0x84')],'as':'Company','attributes':['id',_0x00f6('0x27')]}]},{'model':db[_0x00f6('0x85')],'as':_0x00f6('0x86'),'attributes':['id',_0x00f6('0x27')]},{'model':db[_0x00f6('0x55')],'as':_0x00f6('0x87'),'attributes':['id',_0x00f6('0x27'),_0x00f6('0x88')]}]})[_0x00f6('0x23')](function(_0x142354){if(_0x142354){return _0x142354[_0x00f6('0x22')]({'UserId':_0x5c2af3[_0x00f6('0x5d')]['id']},{'transaction':_0x464b7e});}});});}})[_0x00f6('0x23')](handleEntityNotFound(_0xb89fb1,null))[_0x00f6('0x23')](respondWithResult(_0xb89fb1,null))['catch'](handleError(_0xb89fb1,null));};exports[_0x00f6('0x89')]=function(_0x43a8e4,_0x1362e5,_0x22c673){return _0x43a8e4[_0x00f6('0x5d')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x00f6('0x71')},'attributes':['id'],'raw':!![]})[_0x00f6('0x23')](function(_0x5d209b){if(_0x5d209b&&_0x5d209b['length']){return db['CmHopper'][_0x00f6('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x00f6('0x60')](_0x00f6('0x61'))},'VoiceQueueId':{'$in':_[_0x00f6('0x29')](_0x5d209b,'id')},'$or':[{'UserId':null},{'UserId':_0x43a8e4[_0x00f6('0x5d')]['id']}]}});}return 0x0;})[_0x00f6('0x23')](function(_0x41f8c9){if(!_[_0x00f6('0x6a')](_0x41f8c9)&&_[_0x00f6('0x8a')](_0x41f8c9)){return _0x1362e5[_0x00f6('0x19')](0xc8)[_0x00f6('0x8b')]({'contacts':_0x41f8c9});}else{logger['error'](_0x00f6('0x8c'),_0x00f6('0x89'),0x194,_0x00f6('0x8d'));_0x1362e5[_0x00f6('0x17')](0x194);}})[_0x00f6('0x4d')](handleError(_0x1362e5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2e5c33a..32007bd 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 _0x2ef3=['path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d7a5d,_0x37741c){_0x4d7a5d=_0x4d7a5d-0x0;var _0x6dcc6=_0x2ef3[_0x4d7a5d];return _0x6dcc6;};'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')]},{'name':_0x32ef('0xe'),'fields':[_0x32ef('0xe')]},{'name':_0x32ef('0xf'),'fields':[_0x32ef('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x4b654a,_0x14c315){var _0x2db3ff=function(_0x16e292){while(--_0x16e292){_0x4b654a['push'](_0x4b654a['shift']());}};_0x2db3ff(++_0x14c315);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x2eb2[_0x3e112d];return _0x531c31;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 353edde..7d34bd3 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 _0x4593=['LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','update','push','all','transaction','CmHopperFinal','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','where','attributes','include','model','map','then','GetCmHopper','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','limit','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order'];(function(_0x2719c5,_0x4296c7){var _0xcee795=function(_0x26e8a1){while(--_0x26e8a1){_0x2719c5['push'](_0x2719c5['shift']());}};_0xcee795(++_0x4296c7);}(_0x4593,0x1b2));var _0x3459=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x4593[_0x2077c2];return _0x312f9f;};'use strict';var _=require('lodash');var util=require(_0x3459('0x0'));var moment=require(_0x3459('0x1'));var BPromise=require(_0x3459('0x2'));var rs=require(_0x3459('0x3'));var fs=require('fs');var Redis=require(_0x3459('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3459('0x5'));var logger=require(_0x3459('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3459('0x7'));var client=jayson[_0x3459('0x8')][_0x3459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21d908,_0x1c43ec,_0x527b9b){return new BPromise(function(_0x52a46e,_0x5c6d8d){return client['request'](_0x21d908,_0x527b9b)['then'](function(_0x2467a6){logger[_0x3459('0xa')](_0x3459('0xb'),_0x1c43ec,_0x3459('0xc'));logger[_0x3459('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1c43ec,_0x3459('0xc'),JSON[_0x3459('0xe')](_0x2467a6));if(_0x2467a6[_0x3459('0xf')]){if(_0x2467a6['error'][_0x3459('0x10')]===0x1f4){logger[_0x3459('0xf')](_0x3459('0xb'),_0x1c43ec,_0x2467a6[_0x3459('0xf')][_0x3459('0x11')]);return _0x5c6d8d(_0x2467a6['error'][_0x3459('0x11')]);}logger['error'](_0x3459('0xb'),_0x1c43ec,_0x2467a6['error']['message']);return _0x52a46e(_0x2467a6[_0x3459('0xf')][_0x3459('0x11')]);}else{logger[_0x3459('0xa')](_0x3459('0xb'),_0x1c43ec,'request\x20sent');_0x52a46e(_0x2467a6[_0x3459('0x12')]['message']);}})[_0x3459('0x13')](function(_0x56517f){logger[_0x3459('0xf')](_0x3459('0xb'),_0x1c43ec,_0x56517f);_0x5c6d8d(_0x56517f);});});}exports['GetCmHopper']=function(_0x1b25a6){var _0x5bfe75=this;return new Promise(function(_0x5969c1,_0x479f99){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x1b25a6['options']?_0x1b25a6[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')]['limit']||null:null,'include':_0x1b25a6[_0x3459('0x16')]?_0x1b25a6[_0x3459('0x16')][_0x3459('0x1a')]?_['map'](_0x1b25a6['options'][_0x3459('0x1a')],function(_0x234e31){return{'model':db[_0x234e31[_0x3459('0x1b')]],'as':_0x234e31['as'],'attributes':_0x234e31[_0x3459('0x19')],'include':_0x234e31[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x234e31[_0x3459('0x1a')],function(_0x5a69cb){return{'model':db[_0x5a69cb[_0x3459('0x1b')]],'as':_0x5a69cb['as'],'attributes':_0x5a69cb[_0x3459('0x19')],'include':_0x5a69cb[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x5a69cb['include'],function(_0x28b7ec){return{'model':db[_0x28b7ec['model']],'as':_0x28b7ec['as'],'attributes':_0x28b7ec[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x363cbd){logger[_0x3459('0xa')]('GetCmHopper',_0x1b25a6);logger[_0x3459('0xd')](_0x3459('0x1e'),_0x1b25a6,JSON[_0x3459('0xe')](_0x363cbd));_0x5969c1(_0x363cbd);})[_0x3459('0x13')](function(_0x542c77){logger[_0x3459('0xf')](_0x3459('0x1e'),_0x542c77['message'],_0x1b25a6);_0x479f99(_0x5bfe75[_0x3459('0xf')](0x1f4,_0x542c77[_0x3459('0x11')]));});});};exports[_0x3459('0x1f')]=function(_0xde02fa){var _0x488241=this;return new Promise(function(_0x47ec2f,_0x321259){return db[_0x3459('0x14')]['find']({'raw':_0xde02fa[_0x3459('0x16')]?_0xde02fa[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0xde02fa['options']?_0xde02fa[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0xde02fa[_0x3459('0x16')]?_0xde02fa['options'][_0x3459('0x19')]||null:null,'include':_0xde02fa[_0x3459('0x16')]?_0xde02fa[_0x3459('0x16')][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0xde02fa[_0x3459('0x16')][_0x3459('0x1a')],function(_0x271323){return{'model':db[_0x271323[_0x3459('0x1b')]],'as':_0x271323['as'],'attributes':_0x271323[_0x3459('0x19')],'include':_0x271323[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x271323[_0x3459('0x1a')],function(_0x56d624){return{'model':db[_0x56d624[_0x3459('0x1b')]],'as':_0x56d624['as'],'attributes':_0x56d624[_0x3459('0x19')],'include':_0x56d624[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x56d624['include'],function(_0x2bc2cd){return{'model':db[_0x2bc2cd[_0x3459('0x1b')]],'as':_0x2bc2cd['as'],'attributes':_0x2bc2cd[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x3a4ec7){logger[_0x3459('0xa')](_0x3459('0x1f'),_0xde02fa);logger[_0x3459('0xd')](_0x3459('0x1f'),_0xde02fa,JSON[_0x3459('0xe')](_0x3a4ec7));_0x47ec2f(_0x3a4ec7);})[_0x3459('0x13')](function(_0x5d0a12){logger[_0x3459('0xf')]('ShowCmHopper',_0x5d0a12['message'],_0xde02fa);_0x321259(_0x488241['error'](0x1f4,_0x5d0a12[_0x3459('0x11')]));});});};exports[_0x3459('0x20')]=function(_0x5d762a){var _0xa97449=this;return new Promise(function(_0x1f43d2,_0x4a7e44){return db['CmHopper']['create'](_0x5d762a[_0x3459('0x21')],{'raw':_0x5d762a[_0x3459('0x16')]?_0x5d762a['options'][_0x3459('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x14629d){logger['info'](_0x3459('0x20'),_0x5d762a);logger[_0x3459('0xd')](_0x3459('0x20'),_0x5d762a,JSON[_0x3459('0xe')](_0x14629d));_0x1f43d2(_0x14629d);})[_0x3459('0x13')](function(_0x37d1e3){logger['error'](_0x3459('0x20'),_0x37d1e3[_0x3459('0x11')],_0x5d762a);_0x4a7e44(_0xa97449['error'](0x1f4,_0x37d1e3['message']));});});};exports[_0x3459('0x22')]=function(_0x3feb72){var _0x44bc6e=this;return new Promise(function(_0x2444a3,_0x7a094f){return db[_0x3459('0x14')]['update'](_0x3feb72['body'],{'raw':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x3feb72[_0x3459('0x16')]?_0x3feb72[_0x3459('0x16')][_0x3459('0x23')]||null:null})[_0x3459('0x1d')](function(_0xf974c1){logger[_0x3459('0xa')](_0x3459('0x22'),_0x3feb72);logger[_0x3459('0xd')](_0x3459('0x22'),_0x3feb72,JSON[_0x3459('0xe')](_0xf974c1));_0x2444a3(_0xf974c1);})[_0x3459('0x13')](function(_0xbd13f2){logger['error'](_0x3459('0x22'),_0xbd13f2[_0x3459('0x11')],_0x3feb72);_0x7a094f(_0x44bc6e[_0x3459('0xf')](0x1f4,_0xbd13f2[_0x3459('0x11')]));});});};exports[_0x3459('0x24')]=function(_0x413c93){var _0x2d9c74=this;return new Promise(function(_0x540abb,_0x11b399){return db[_0x3459('0x14')]['destroy']({'where':_0x413c93[_0x3459('0x16')]?_0x413c93['options']['where']||null:null})['then'](function(_0x2aa5ab){logger[_0x3459('0xa')](_0x3459('0x24'),_0x413c93);logger[_0x3459('0xd')]('DestroyCmHopper',_0x413c93,JSON[_0x3459('0xe')](_0x2aa5ab));_0x540abb(_0x2aa5ab);})[_0x3459('0x13')](function(_0x427788){logger[_0x3459('0xf')](_0x3459('0x24'),_0x427788['message'],_0x413c93);_0x11b399(_0x2d9c74[_0x3459('0xf')](0x1f4,_0x427788[_0x3459('0x11')]));});});};exports[_0x3459('0x25')]=function(_0x1d428f){var _0x238457=this;return new Promise(function(_0x57ef01,_0x13c1f7){return db[_0x3459('0x26')][_0x3459('0x27')]()['then'](function(_0x3fd255){return db[_0x3459('0x28')]['transaction'](function(_0x377a07){return db['CmHopper'][_0x3459('0x15')]({'where':_0x1d428f['options']?_0x1d428f[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x19')]||null:null,'limit':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x23')]||null:null,'order':_0x1d428f[_0x3459('0x16')]?_0x1d428f[_0x3459('0x16')][_0x3459('0x29')]||null:null,'transaction':_0x377a07,'lock':_0x377a07[_0x3459('0x2a')][_0x3459('0x2b')],'include':[{'model':db[_0x3459('0x26')],'as':_0x3459('0x2c'),'attributes':_['keys'](_0x3fd255)},{'model':db[_0x3459('0x2d')],'as':_0x3459('0x2e'),'attributes':['id',_0x3459('0x2f'),_0x3459('0x30')]}]})[_0x3459('0x1d')](function(_0x4601a7){var _0x2e61c2=[];var _0x570117=[];for(var _0x3ba80c=0x0;_0x3ba80c<_0x4601a7[_0x3459('0x31')];_0x3ba80c+=0x1){var _0x3974b7=_0x4601a7[_0x3ba80c][_0x3459('0x32')];if(_0x3974b7===null){_0x2e61c2['push'](_0x4601a7[_0x3ba80c][_0x3459('0x33')](_0x1d428f['body'],{'transaction':_0x377a07}));}else if(!_0x570117['includes'](_0x3974b7)){_0x570117[_0x3459('0x34')](_0x3974b7);_0x2e61c2[_0x3459('0x34')](_0x4601a7[_0x3ba80c][_0x3459('0x33')](_0x1d428f[_0x3459('0x21')],{'transaction':_0x377a07}));}}return BPromise[_0x3459('0x35')](_0x2e61c2);});})[_0x3459('0x1d')](function(_0x19072c){logger[_0x3459('0xa')](_0x3459('0x25'),_0x1d428f);logger['debug'](_0x3459('0x25'),_0x1d428f,JSON[_0x3459('0xe')](_0x19072c));_0x57ef01(_0x19072c);})[_0x3459('0x13')](function(_0x371bd3){logger[_0x3459('0xf')](_0x3459('0x25'),_0x371bd3[_0x3459('0x11')],_0x1d428f);_0x13c1f7(_0x238457['error'](0x1f4,_0x371bd3[_0x3459('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x25714f){var _0xa5d25d=this;return new Promise(function(_0x3a0242,_0x53c76e){return db[_0x3459('0x28')][_0x3459('0x36')](function(_0x5c39ba){return db[_0x3459('0x37')]['create'](_0x25714f[_0x3459('0x21')],{'raw':_0x25714f[_0x3459('0x16')]?_0x25714f[_0x3459('0x16')][_0x3459('0x17')]===undefined?!![]:![]:!![],'transaction':_0x5c39ba})[_0x3459('0x1d')](function(){return db[_0x3459('0x14')][_0x3459('0x38')]({'where':_0x25714f[_0x3459('0x16')]?_0x25714f['options'][_0x3459('0x18')]||null:null,'transaction':_0x5c39ba});});})['then'](function(_0x111b2d){logger['info'](_0x3459('0x39'),_0x25714f);logger[_0x3459('0xd')](_0x3459('0x39'),_0x25714f,JSON[_0x3459('0xe')](_0x111b2d));_0x3a0242(_0x111b2d);})['catch'](function(_0x3c9a54){logger[_0x3459('0xf')](_0x3459('0x39'),_0x3c9a54['message'],_0x25714f);_0x53c76e(_0xa5d25d[_0x3459('0xf')](0x1f4,_0x3c9a54[_0x3459('0x11')]));});});};exports[_0x3459('0x3a')]=function(_0x6ec00a){var _0x94e2c9=this;return new Promise(function(_0x1345c5,_0x52ab30){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x6ec00a['options']?_0x6ec00a['options'][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x6ec00a[_0x3459('0x16')]?_0x6ec00a[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':[[db[_0x3459('0x28')]['fn'](_0x3459('0x3b'),db[_0x3459('0x28')]['fn']('IF',db[_0x3459('0x28')][_0x3459('0x3c')]('`scheduledat`\x20>=\x20'+util['format'](_0x3459('0x3d'),moment()['format'](_0x3459('0x3e')))+_0x3459('0x3f')))),_0x3459('0x40')]]})[_0x3459('0x1d')](function(_0x4893cb){logger[_0x3459('0xa')](_0x3459('0x3a'),_0x6ec00a);logger[_0x3459('0xd')](_0x3459('0x3a'),_0x6ec00a,JSON[_0x3459('0xe')](_0x4893cb));_0x1345c5(_0x4893cb);})[_0x3459('0x13')](function(_0x4bcd80){logger['error'](_0x3459('0x3a'),_0x4bcd80[_0x3459('0x11')],_0x6ec00a);_0x52ab30(_0x94e2c9[_0x3459('0xf')](0x1f4,_0x4bcd80[_0x3459('0x11')]));});});};exports[_0x3459('0x41')]=function(_0x29f71a){var _0x4b165c=this;return new Promise(function(_0x2e1248,_0x195476){return db[_0x3459('0x26')][_0x3459('0x27')]()[_0x3459('0x1d')](function(_0x4e683a){return db[_0x3459('0x28')]['transaction'](function(_0x22e385){return db[_0x3459('0x14')][_0x3459('0x15')]({'where':_0x29f71a['options']?_0x29f71a[_0x3459('0x16')][_0x3459('0x18')]||null:null,'attributes':_0x29f71a[_0x3459('0x16')]?_0x29f71a['options'][_0x3459('0x19')]||null:null,'limit':0x1,'order':_0x29f71a['options']?_0x29f71a['options'][_0x3459('0x29')]||null:null,'group':db[_0x3459('0x14')][_0x3459('0x32')],'transaction':_0x22e385,'lock':_0x22e385[_0x3459('0x2a')][_0x3459('0x2b')],'include':_0x29f71a[_0x3459('0x16')]?_0x29f71a[_0x3459('0x16')][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x29f71a[_0x3459('0x16')][_0x3459('0x1a')],function(_0x534cf2){return{'model':db[_0x534cf2[_0x3459('0x1b')]],'as':_0x534cf2['as'],'attributes':_0x534cf2[_0x3459('0x19')],'include':_0x534cf2['include']?_['map'](_0x534cf2[_0x3459('0x1a')],function(_0xae5ae7){return{'model':db[_0xae5ae7[_0x3459('0x1b')]],'as':_0xae5ae7['as'],'attributes':_0xae5ae7[_0x3459('0x19')],'include':_0xae5ae7[_0x3459('0x1a')]?_['map'](_0xae5ae7[_0x3459('0x1a')],function(_0x1827e0){return{'model':db[_0x1827e0[_0x3459('0x1b')]],'as':_0x1827e0['as'],'attributes':_0x1827e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3459('0x1d')](function(_0x47a362){var _0x478091=[];for(var _0x199fb9=0x0;_0x199fb9<_0x47a362['length'];_0x199fb9+=0x1){_0x478091[_0x3459('0x34')](_0x47a362[_0x199fb9]['update'](_0x29f71a['body'],{'transaction':_0x22e385}));}return BPromise[_0x3459('0x35')](_0x478091);});})[_0x3459('0x1d')](function(_0x531aa4){logger[_0x3459('0xa')]('GetContactRecallMe',_0x29f71a);logger[_0x3459('0xd')](_0x3459('0x41'),_0x29f71a,JSON[_0x3459('0xe')](_0x531aa4));_0x2e1248(_0x531aa4);})[_0x3459('0x13')](function(_0x12caa3){logger[_0x3459('0xf')](_0x3459('0x41'),_0x12caa3[_0x3459('0x11')],_0x29f71a);_0x195476(_0x4b165c[_0x3459('0xf')](0x1f4,_0x12caa3['message']));});});});};exports[_0x3459('0x42')]=function(_0x3a09e4){var _0x42f88e=this;return new Promise(function(_0x587bee,_0x12b798){db['CmContact'][_0x3459('0x27')]()[_0x3459('0x1d')](function(_0x263890){return db[_0x3459('0x14')][_0x3459('0x15')]({'raw':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x17')]===undefined?!![]:![]:!![],'where':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x18')]||null:null,'attributes':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x19')]||null:null,'limit':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options']['limit']||null:null,'include':_0x3a09e4[_0x3459('0x16')]?_0x3a09e4['options'][_0x3459('0x1a')]?_[_0x3459('0x1c')](_0x3a09e4[_0x3459('0x16')][_0x3459('0x1a')],function(_0x40910d){return{'model':db[_0x40910d[_0x3459('0x1b')]],'as':_0x40910d['as'],'attributes':_0x40910d['as']===_0x3459('0x2c')?_[_0x3459('0x43')](_0x263890):_0x40910d['attributes'],'include':_0x40910d[_0x3459('0x1a')]?_['map'](_0x40910d[_0x3459('0x1a')],function(_0xfdb14c){return{'model':db[_0xfdb14c[_0x3459('0x1b')]],'as':_0xfdb14c['as'],'attributes':_0xfdb14c[_0x3459('0x19')],'include':_0xfdb14c[_0x3459('0x1a')]?_[_0x3459('0x1c')](_0xfdb14c[_0x3459('0x1a')],function(_0x5828f9){return{'model':db[_0x5828f9[_0x3459('0x1b')]],'as':_0x5828f9['as'],'attributes':_0x5828f9[_0x3459('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5702e6){logger['info'](_0x3459('0x1e'),_0x3a09e4);logger[_0x3459('0xd')]('GetCmHopper',_0x3a09e4,JSON[_0x3459('0xe')](_0x5702e6));_0x587bee(_0x5702e6);})['catch'](function(_0x14d0ef){logger[_0x3459('0xf')]('GetCmHopper',_0x14d0ef['message'],_0x3a09e4);_0x12b798(_0x42f88e[_0x3459('0xf')](0x1f4,_0x14d0ef[_0x3459('0x11')]));});});});}; \ No newline at end of file +var _0xc67d=['length','UserId','push','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','raw','options','where','include','map','model','attributes','debug','catch','ShowCmHopper','find','CreateCmHopper','create','body','then','update','limit','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','keys','User','voicePause'];(function(_0x29d375,_0xbff8e6){var _0x141492=function(_0x49e9c0){while(--_0x49e9c0){_0x29d375['push'](_0x29d375['shift']());}};_0x141492(++_0xbff8e6);}(_0xc67d,0xdb));var _0xdc67=function(_0x44512e,_0x3c2c2c){_0x44512e=_0x44512e-0x0;var _0x3f78ea=_0xc67d[_0x44512e];return _0x3f78ea;};'use strict';var _=require(_0xdc67('0x0'));var util=require(_0xdc67('0x1'));var moment=require(_0xdc67('0x2'));var BPromise=require(_0xdc67('0x3'));var rs=require(_0xdc67('0x4'));var fs=require('fs');var Redis=require(_0xdc67('0x5'));var db=require(_0xdc67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc67('0x7'))(_0xdc67('0x8'));var config=require(_0xdc67('0x9'));var jayson=require(_0xdc67('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38697f,_0x127fac,_0x437e64){return new BPromise(function(_0x4a6d9c,_0x168413){return client['request'](_0x38697f,_0x437e64)['then'](function(_0x3a9341){logger[_0xdc67('0xb')](_0xdc67('0xc'),_0x127fac,_0xdc67('0xd'));logger['debug'](_0xdc67('0xe'),_0x127fac,_0xdc67('0xd'),JSON[_0xdc67('0xf')](_0x3a9341));if(_0x3a9341[_0xdc67('0x10')]){if(_0x3a9341[_0xdc67('0x10')][_0xdc67('0x11')]===0x1f4){logger['error'](_0xdc67('0xc'),_0x127fac,_0x3a9341['error'][_0xdc67('0x12')]);return _0x168413(_0x3a9341['error']['message']);}logger[_0xdc67('0x10')](_0xdc67('0xc'),_0x127fac,_0x3a9341[_0xdc67('0x10')][_0xdc67('0x12')]);return _0x4a6d9c(_0x3a9341['error'][_0xdc67('0x12')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x127fac,_0xdc67('0xd'));_0x4a6d9c(_0x3a9341[_0xdc67('0x13')][_0xdc67('0x12')]);}})['catch'](function(_0x2dbdb5){logger[_0xdc67('0x10')](_0xdc67('0xc'),_0x127fac,_0x2dbdb5);_0x168413(_0x2dbdb5);});});}exports[_0xdc67('0x14')]=function(_0x53ce0f){var _0x45f9c0=this;return new Promise(function(_0x47460e,_0x504027){return db[_0xdc67('0x15')][_0xdc67('0x16')]({'raw':_0x53ce0f['options']?_0x53ce0f['options'][_0xdc67('0x17')]===undefined?!![]:![]:!![],'where':_0x53ce0f['options']?_0x53ce0f[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':_0x53ce0f[_0xdc67('0x18')]?_0x53ce0f[_0xdc67('0x18')]['attributes']||null:null,'limit':_0x53ce0f[_0xdc67('0x18')]?_0x53ce0f[_0xdc67('0x18')]['limit']||null:null,'include':_0x53ce0f[_0xdc67('0x18')]?_0x53ce0f[_0xdc67('0x18')][_0xdc67('0x1a')]?_[_0xdc67('0x1b')](_0x53ce0f[_0xdc67('0x18')][_0xdc67('0x1a')],function(_0x3e0157){return{'model':db[_0x3e0157[_0xdc67('0x1c')]],'as':_0x3e0157['as'],'attributes':_0x3e0157[_0xdc67('0x1d')],'include':_0x3e0157['include']?_[_0xdc67('0x1b')](_0x3e0157[_0xdc67('0x1a')],function(_0x5e3b94){return{'model':db[_0x5e3b94[_0xdc67('0x1c')]],'as':_0x5e3b94['as'],'attributes':_0x5e3b94[_0xdc67('0x1d')],'include':_0x5e3b94['include']?_[_0xdc67('0x1b')](_0x5e3b94[_0xdc67('0x1a')],function(_0x2a9c04){return{'model':db[_0x2a9c04[_0xdc67('0x1c')]],'as':_0x2a9c04['as'],'attributes':_0x2a9c04[_0xdc67('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e2f36){logger[_0xdc67('0xb')](_0xdc67('0x14'),_0x53ce0f);logger[_0xdc67('0x1e')]('GetCmHopper',_0x53ce0f,JSON[_0xdc67('0xf')](_0x3e2f36));_0x47460e(_0x3e2f36);})[_0xdc67('0x1f')](function(_0x4e4fa8){logger[_0xdc67('0x10')](_0xdc67('0x14'),_0x4e4fa8['message'],_0x53ce0f);_0x504027(_0x45f9c0[_0xdc67('0x10')](0x1f4,_0x4e4fa8[_0xdc67('0x12')]));});});};exports[_0xdc67('0x20')]=function(_0x5bb472){var _0x77c53e=this;return new Promise(function(_0x5358b3,_0x4d3167){return db['CmHopper'][_0xdc67('0x21')]({'raw':_0x5bb472['options']?_0x5bb472[_0xdc67('0x18')][_0xdc67('0x17')]===undefined?!![]:![]:!![],'where':_0x5bb472[_0xdc67('0x18')]?_0x5bb472[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':_0x5bb472[_0xdc67('0x18')]?_0x5bb472[_0xdc67('0x18')]['attributes']||null:null,'include':_0x5bb472['options']?_0x5bb472[_0xdc67('0x18')]['include']?_[_0xdc67('0x1b')](_0x5bb472['options']['include'],function(_0x38a246){return{'model':db[_0x38a246[_0xdc67('0x1c')]],'as':_0x38a246['as'],'attributes':_0x38a246[_0xdc67('0x1d')],'include':_0x38a246['include']?_[_0xdc67('0x1b')](_0x38a246['include'],function(_0x5d78eb){return{'model':db[_0x5d78eb[_0xdc67('0x1c')]],'as':_0x5d78eb['as'],'attributes':_0x5d78eb[_0xdc67('0x1d')],'include':_0x5d78eb['include']?_[_0xdc67('0x1b')](_0x5d78eb['include'],function(_0x1a8dfb){return{'model':db[_0x1a8dfb[_0xdc67('0x1c')]],'as':_0x1a8dfb['as'],'attributes':_0x1a8dfb[_0xdc67('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22da91){logger[_0xdc67('0xb')](_0xdc67('0x20'),_0x5bb472);logger[_0xdc67('0x1e')](_0xdc67('0x20'),_0x5bb472,JSON[_0xdc67('0xf')](_0x22da91));_0x5358b3(_0x22da91);})[_0xdc67('0x1f')](function(_0x59017b){logger[_0xdc67('0x10')](_0xdc67('0x20'),_0x59017b[_0xdc67('0x12')],_0x5bb472);_0x4d3167(_0x77c53e[_0xdc67('0x10')](0x1f4,_0x59017b[_0xdc67('0x12')]));});});};exports[_0xdc67('0x22')]=function(_0x5bbbf2){var _0xbdffeb=this;return new Promise(function(_0x54ff82,_0x4ee4e9){return db[_0xdc67('0x15')][_0xdc67('0x23')](_0x5bbbf2[_0xdc67('0x24')],{'raw':_0x5bbbf2[_0xdc67('0x18')]?_0x5bbbf2[_0xdc67('0x18')][_0xdc67('0x17')]===undefined?!![]:![]:!![]})[_0xdc67('0x25')](function(_0x3f7b8f){logger[_0xdc67('0xb')]('CreateCmHopper',_0x5bbbf2);logger[_0xdc67('0x1e')](_0xdc67('0x22'),_0x5bbbf2,JSON[_0xdc67('0xf')](_0x3f7b8f));_0x54ff82(_0x3f7b8f);})[_0xdc67('0x1f')](function(_0x3c6ff5){logger['error']('CreateCmHopper',_0x3c6ff5[_0xdc67('0x12')],_0x5bbbf2);_0x4ee4e9(_0xbdffeb[_0xdc67('0x10')](0x1f4,_0x3c6ff5[_0xdc67('0x12')]));});});};exports['UpdateCmHopper']=function(_0x48e6eb){var _0x324332=this;return new Promise(function(_0x4cd3ad,_0x3a473d){return db['CmHopper'][_0xdc67('0x26')](_0x48e6eb[_0xdc67('0x24')],{'raw':_0x48e6eb[_0xdc67('0x18')]?_0x48e6eb['options'][_0xdc67('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48e6eb[_0xdc67('0x18')]?_0x48e6eb[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':_0x48e6eb[_0xdc67('0x18')]?_0x48e6eb[_0xdc67('0x18')]['attributes']||null:null,'limit':_0x48e6eb[_0xdc67('0x18')]?_0x48e6eb['options'][_0xdc67('0x27')]||null:null})[_0xdc67('0x25')](function(_0x36f51b){logger[_0xdc67('0xb')]('UpdateCmHopper',_0x48e6eb);logger[_0xdc67('0x1e')](_0xdc67('0x28'),_0x48e6eb,JSON['stringify'](_0x36f51b));_0x4cd3ad(_0x36f51b);})['catch'](function(_0x5948f9){logger[_0xdc67('0x10')](_0xdc67('0x28'),_0x5948f9[_0xdc67('0x12')],_0x48e6eb);_0x3a473d(_0x324332[_0xdc67('0x10')](0x1f4,_0x5948f9[_0xdc67('0x12')]));});});};exports[_0xdc67('0x29')]=function(_0x46a92b){var _0x1ed26f=this;return new Promise(function(_0x40239e,_0x6bd31b){return db[_0xdc67('0x15')][_0xdc67('0x2a')]({'where':_0x46a92b[_0xdc67('0x18')]?_0x46a92b[_0xdc67('0x18')][_0xdc67('0x19')]||null:null})[_0xdc67('0x25')](function(_0x4144a8){logger[_0xdc67('0xb')]('DestroyCmHopper',_0x46a92b);logger[_0xdc67('0x1e')](_0xdc67('0x29'),_0x46a92b,JSON['stringify'](_0x4144a8));_0x40239e(_0x4144a8);})[_0xdc67('0x1f')](function(_0x3f8651){logger[_0xdc67('0x10')](_0xdc67('0x29'),_0x3f8651[_0xdc67('0x12')],_0x46a92b);_0x6bd31b(_0x1ed26f[_0xdc67('0x10')](0x1f4,_0x3f8651['message']));});});};exports[_0xdc67('0x2b')]=function(_0x4485c5){var _0x1a6df9=this;return new Promise(function(_0x2459b7,_0x2498b2){return db[_0xdc67('0x2c')]['describe']()[_0xdc67('0x25')](function(_0xa27ddc){return db[_0xdc67('0x2d')][_0xdc67('0x2e')](function(_0x18f265){return db[_0xdc67('0x15')][_0xdc67('0x16')]({'where':_0x4485c5['options']?_0x4485c5[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':_0x4485c5['options']?_0x4485c5[_0xdc67('0x18')][_0xdc67('0x1d')]||null:null,'limit':_0x4485c5['options']?_0x4485c5[_0xdc67('0x18')]['limit']||null:null,'order':_0x4485c5[_0xdc67('0x18')]?_0x4485c5['options'][_0xdc67('0x2f')]||null:null,'transaction':_0x18f265,'lock':_0x18f265[_0xdc67('0x30')][_0xdc67('0x31')],'include':[{'model':db[_0xdc67('0x2c')],'as':'Contact','attributes':_[_0xdc67('0x32')](_0xa27ddc)},{'model':db[_0xdc67('0x33')],'as':'Agent','attributes':['id','name',_0xdc67('0x34')]}]})[_0xdc67('0x25')](function(_0x5dc8c2){var _0x5c963c=[];var _0xbae94c=[];for(var _0x20f3da=0x0;_0x20f3da<_0x5dc8c2[_0xdc67('0x35')];_0x20f3da+=0x1){var _0x293944=_0x5dc8c2[_0x20f3da][_0xdc67('0x36')];if(_0x293944===null){_0x5c963c[_0xdc67('0x37')](_0x5dc8c2[_0x20f3da]['update'](_0x4485c5[_0xdc67('0x24')],{'transaction':_0x18f265}));}else if(!_0xbae94c['includes'](_0x293944)){_0xbae94c['push'](_0x293944);_0x5c963c[_0xdc67('0x37')](_0x5dc8c2[_0x20f3da][_0xdc67('0x26')](_0x4485c5[_0xdc67('0x24')],{'transaction':_0x18f265}));}}return BPromise[_0xdc67('0x38')](_0x5c963c);});})[_0xdc67('0x25')](function(_0x313530){logger[_0xdc67('0xb')](_0xdc67('0x2b'),_0x4485c5);logger[_0xdc67('0x1e')](_0xdc67('0x2b'),_0x4485c5,JSON[_0xdc67('0xf')](_0x313530));_0x2459b7(_0x313530);})[_0xdc67('0x1f')](function(_0x4a38b8){logger[_0xdc67('0x10')](_0xdc67('0x2b'),_0x4a38b8[_0xdc67('0x12')],_0x4485c5);_0x2498b2(_0x1a6df9['error'](0x1f4,_0x4a38b8[_0xdc67('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x36f71e){var _0x35be8f=this;return new Promise(function(_0x5988b9,_0x4426ed){return db[_0xdc67('0x2d')]['transaction'](function(_0x5b1205){return db[_0xdc67('0x39')][_0xdc67('0x23')](_0x36f71e[_0xdc67('0x24')],{'raw':_0x36f71e[_0xdc67('0x18')]?_0x36f71e['options'][_0xdc67('0x17')]===undefined?!![]:![]:!![],'transaction':_0x5b1205})[_0xdc67('0x25')](function(){return db['CmHopper'][_0xdc67('0x2a')]({'where':_0x36f71e[_0xdc67('0x18')]?_0x36f71e['options']['where']||null:null,'transaction':_0x5b1205});});})[_0xdc67('0x25')](function(_0x2c4f9d){logger[_0xdc67('0xb')]('MoveContactManagedDialer',_0x36f71e);logger[_0xdc67('0x1e')](_0xdc67('0x3a'),_0x36f71e,JSON['stringify'](_0x2c4f9d));_0x5988b9(_0x2c4f9d);})[_0xdc67('0x1f')](function(_0x532f69){logger[_0xdc67('0x10')](_0xdc67('0x3a'),_0x532f69[_0xdc67('0x12')],_0x36f71e);_0x4426ed(_0x35be8f['error'](0x1f4,_0x532f69['message']));});});};exports[_0xdc67('0x3b')]=function(_0x4a3db0){var _0xa15502=this;return new Promise(function(_0x2f4625,_0x226bcd){return db['CmHopper'][_0xdc67('0x16')]({'raw':_0x4a3db0[_0xdc67('0x18')]?_0x4a3db0[_0xdc67('0x18')][_0xdc67('0x17')]===undefined?!![]:![]:!![],'where':_0x4a3db0['options']?_0x4a3db0[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':[[db[_0xdc67('0x2d')]['fn'](_0xdc67('0x3c'),db[_0xdc67('0x2d')]['fn']('IF',db[_0xdc67('0x2d')][_0xdc67('0x3d')]('`scheduledat`\x20>=\x20'+util['format'](_0xdc67('0x3e'),moment()[_0xdc67('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xdc67('0x40')))),_0xdc67('0x41')]]})[_0xdc67('0x25')](function(_0x422d79){logger[_0xdc67('0xb')](_0xdc67('0x3b'),_0x4a3db0);logger[_0xdc67('0x1e')](_0xdc67('0x3b'),_0x4a3db0,JSON[_0xdc67('0xf')](_0x422d79));_0x2f4625(_0x422d79);})[_0xdc67('0x1f')](function(_0x3be523){logger[_0xdc67('0x10')](_0xdc67('0x3b'),_0x3be523[_0xdc67('0x12')],_0x4a3db0);_0x226bcd(_0xa15502[_0xdc67('0x10')](0x1f4,_0x3be523[_0xdc67('0x12')]));});});};exports[_0xdc67('0x42')]=function(_0x22eae4){var _0x112aaf=this;return new Promise(function(_0x2375ea,_0x3563e8){return db[_0xdc67('0x2c')][_0xdc67('0x43')]()[_0xdc67('0x25')](function(_0xd106cf){return db['sequelize'][_0xdc67('0x2e')](function(_0x3c8238){return db[_0xdc67('0x15')][_0xdc67('0x16')]({'where':_0x22eae4['options']?_0x22eae4[_0xdc67('0x18')]['where']||null:null,'attributes':_0x22eae4[_0xdc67('0x18')]?_0x22eae4[_0xdc67('0x18')][_0xdc67('0x1d')]||null:null,'limit':0x1,'order':_0x22eae4[_0xdc67('0x18')]?_0x22eae4[_0xdc67('0x18')]['order']||null:null,'group':db[_0xdc67('0x15')][_0xdc67('0x36')],'transaction':_0x3c8238,'lock':_0x3c8238[_0xdc67('0x30')]['UPDATE'],'include':_0x22eae4[_0xdc67('0x18')]?_0x22eae4['options']['include']?_[_0xdc67('0x1b')](_0x22eae4['options'][_0xdc67('0x1a')],function(_0x4d2837){return{'model':db[_0x4d2837[_0xdc67('0x1c')]],'as':_0x4d2837['as'],'attributes':_0x4d2837[_0xdc67('0x1d')],'include':_0x4d2837[_0xdc67('0x1a')]?_[_0xdc67('0x1b')](_0x4d2837['include'],function(_0x2dcd13){return{'model':db[_0x2dcd13[_0xdc67('0x1c')]],'as':_0x2dcd13['as'],'attributes':_0x2dcd13['attributes'],'include':_0x2dcd13[_0xdc67('0x1a')]?_['map'](_0x2dcd13[_0xdc67('0x1a')],function(_0x4b7c0c){return{'model':db[_0x4b7c0c[_0xdc67('0x1c')]],'as':_0x4b7c0c['as'],'attributes':_0x4b7c0c[_0xdc67('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdc67('0x25')](function(_0x5ea49c){var _0x1a8d70=[];for(var _0x45f069=0x0;_0x45f069<_0x5ea49c['length'];_0x45f069+=0x1){_0x1a8d70[_0xdc67('0x37')](_0x5ea49c[_0x45f069][_0xdc67('0x26')](_0x22eae4[_0xdc67('0x24')],{'transaction':_0x3c8238}));}return BPromise['all'](_0x1a8d70);});})[_0xdc67('0x25')](function(_0x2053c8){logger[_0xdc67('0xb')]('GetContactRecallMe',_0x22eae4);logger['debug'](_0xdc67('0x42'),_0x22eae4,JSON['stringify'](_0x2053c8));_0x2375ea(_0x2053c8);})[_0xdc67('0x1f')](function(_0x33de30){logger[_0xdc67('0x10')](_0xdc67('0x42'),_0x33de30[_0xdc67('0x12')],_0x22eae4);_0x3563e8(_0x112aaf[_0xdc67('0x10')](0x1f4,_0x33de30[_0xdc67('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x5eb36b){var _0x5dbfd2=this;return new Promise(function(_0x4ea3ea,_0x39b5e3){db[_0xdc67('0x2c')][_0xdc67('0x43')]()['then'](function(_0x11a306){return db[_0xdc67('0x15')][_0xdc67('0x16')]({'raw':_0x5eb36b['options']?_0x5eb36b[_0xdc67('0x18')][_0xdc67('0x17')]===undefined?!![]:![]:!![],'where':_0x5eb36b[_0xdc67('0x18')]?_0x5eb36b[_0xdc67('0x18')][_0xdc67('0x19')]||null:null,'attributes':_0x5eb36b[_0xdc67('0x18')]?_0x5eb36b[_0xdc67('0x18')]['attributes']||null:null,'limit':_0x5eb36b[_0xdc67('0x18')]?_0x5eb36b['options'][_0xdc67('0x27')]||null:null,'include':_0x5eb36b[_0xdc67('0x18')]?_0x5eb36b[_0xdc67('0x18')][_0xdc67('0x1a')]?_['map'](_0x5eb36b[_0xdc67('0x18')][_0xdc67('0x1a')],function(_0x300b49){return{'model':db[_0x300b49[_0xdc67('0x1c')]],'as':_0x300b49['as'],'attributes':_0x300b49['as']==='Contact'?_['keys'](_0x11a306):_0x300b49[_0xdc67('0x1d')],'include':_0x300b49[_0xdc67('0x1a')]?_[_0xdc67('0x1b')](_0x300b49[_0xdc67('0x1a')],function(_0x3f416d){return{'model':db[_0x3f416d[_0xdc67('0x1c')]],'as':_0x3f416d['as'],'attributes':_0x3f416d[_0xdc67('0x1d')],'include':_0x3f416d[_0xdc67('0x1a')]?_['map'](_0x3f416d[_0xdc67('0x1a')],function(_0x241695){return{'model':db[_0x241695[_0xdc67('0x1c')]],'as':_0x241695['as'],'attributes':_0x241695[_0xdc67('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdc67('0x25')](function(_0x5820fe){logger['info'](_0xdc67('0x14'),_0x5eb36b);logger['debug'](_0xdc67('0x14'),_0x5eb36b,JSON[_0xdc67('0xf')](_0x5820fe));_0x4ea3ea(_0x5820fe);})[_0xdc67('0x1f')](function(_0x27acdf){logger[_0xdc67('0x10')](_0xdc67('0x14'),_0x27acdf[_0xdc67('0x12')],_0x5eb36b);_0x39b5e3(_0x5dbfd2['error'](0x1f4,_0x27acdf[_0xdc67('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 36cb674..ab61b2e 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 _0x89ea=['create','post','/preview','getPreview','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','show'];(function(_0x20c0f4,_0xf354e6){var _0x30e21d=function(_0x374959){while(--_0x374959){_0x20c0f4['push'](_0x20c0f4['shift']());}};_0x30e21d(++_0xf354e6);}(_0x89ea,0x180));var _0xa89e=function(_0x4cbdb7,_0x1b82f6){_0x4cbdb7=_0x4cbdb7-0x0;var _0x4ecb18=_0x89ea[_0x4cbdb7];return _0x4ecb18;};'use strict';var multer=require('multer');var util=require(_0xa89e('0x0'));var path=require(_0xa89e('0x1'));var timeout=require(_0xa89e('0x2'));var express=require(_0xa89e('0x3'));var router=express['Router']();var fs_extra=require(_0xa89e('0x4'));var auth=require(_0xa89e('0x5'));var interaction=require(_0xa89e('0x6'));var config=require(_0xa89e('0x7'));var controller=require(_0xa89e('0x8'));router[_0xa89e('0x9')]('/',auth[_0xa89e('0xa')](),controller[_0xa89e('0xb')]);router['get'](_0xa89e('0xc'),auth['isAuthenticated'](),controller[_0xa89e('0xd')]);router[_0xa89e('0x9')]('/opencontacts',auth[_0xa89e('0xa')](),controller[_0xa89e('0xe')]);router[_0xa89e('0x9')]('/:id',auth[_0xa89e('0xa')](),controller[_0xa89e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa89e('0x10')]);router[_0xa89e('0x11')](_0xa89e('0x12'),auth[_0xa89e('0xa')](),controller[_0xa89e('0x13')]);router['put'](_0xa89e('0x14'),auth['isAuthenticated'](),controller[_0xa89e('0x15')]);router[_0xa89e('0x16')](_0xa89e('0x14'),auth[_0xa89e('0xa')](),controller[_0xa89e('0x17')]);module[_0xa89e('0x18')]=router; \ No newline at end of file +var _0xc0d7=['../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','getOpenContacts','/:id','create','/preview','getPreview','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x58060b,_0x51b099){_0x58060b=_0x58060b-0x0;var _0x96ebc5=_0xc0d7[_0x58060b];return _0x96ebc5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var fs_extra=require(_0x7c0d('0x3'));var auth=require(_0x7c0d('0x4'));var interaction=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var controller=require(_0x7c0d('0x7'));router[_0x7c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x7c0d('0x9')]);router[_0x7c0d('0x8')](_0x7c0d('0xa'),auth[_0x7c0d('0xb')](),controller['describe']);router[_0x7c0d('0x8')](_0x7c0d('0xc'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xd')]);router['get'](_0x7c0d('0xe'),auth[_0x7c0d('0xb')](),controller['show']);router['post']('/',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xf')]);router['post'](_0x7c0d('0x10'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x11')]);router[_0x7c0d('0x12')](_0x7c0d('0xe'),auth[_0x7c0d('0xb')](),controller['update']);router[_0x7c0d('0x13')](_0x7c0d('0xe'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x14')]);module[_0x7c0d('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 5f0ea84..957d6a2 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 _0x46e1=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x548f15,_0x35f960){var _0x4dad27=function(_0x3e204f){while(--_0x3e204f){_0x548f15['push'](_0x548f15['shift']());}};_0x4dad27(++_0x35f960);}(_0x46e1,0x155));var _0x146e=function(_0x3a073b,_0x589c34){_0x3a073b=_0x3a073b-0x0;var _0x3ad1fd=_0x46e1[_0x3a073b];return _0x3ad1fd;};'use strict';var moment=require(_0x146e('0x0'));var Sequelize=require(_0x146e('0x1'));module[_0x146e('0x2')]={'phone':{'type':Sequelize[_0x146e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'ListId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')}}; \ No newline at end of file +var _0x82f8=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x574c0e,_0x596deb){var _0x23cdb5=function(_0x188eaa){while(--_0x188eaa){_0x574c0e['push'](_0x574c0e['shift']());}};_0x23cdb5(++_0x596deb);}(_0x82f8,0x157));var _0x882f=function(_0x1e1f45,_0x3bf59){_0x1e1f45=_0x1e1f45-0x0;var _0x362f11=_0x82f8[_0x1e1f45];return _0x362f11;};'use strict';var moment=require('moment');var Sequelize=require(_0x882f('0x0'));module[_0x882f('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')},'ListId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')},'VoiceQueueId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 3c9ed6c..165b368 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 _0x9300=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x9300,0x153));var _0x0930=function(_0x3881bf,_0x1b016){_0x3881bf=_0x3881bf-0x0;var _0x539015=_0x9300[_0x3881bf];return _0x539015;};'use strict';var emlformat=require(_0x0930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0930('0x1'));var rp=require(_0x0930('0x2'));var moment=require(_0x0930('0x3'));var BPromise=require(_0x0930('0x4'));var Mustache=require(_0x0930('0x5'));var util=require('util');var path=require(_0x0930('0x6'));var sox=require(_0x0930('0x7'));var csv=require('to-csv');var ejs=require(_0x0930('0x8'));var fs=require('fs');var fs_extra=require(_0x0930('0x9'));var _=require(_0x0930('0xa'));var squel=require(_0x0930('0xb'));var crypto=require(_0x0930('0xc'));var jsforce=require(_0x0930('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0930('0xe'));var Papa=require('papaparse');var Redis=require(_0x0930('0xf'));var authService=require(_0x0930('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0930('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0930('0x12'));var utils=require(_0x0930('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0930('0x14'))['db'];function respondWithStatusCode(_0x354fb1,_0x2020f0){_0x2020f0=_0x2020f0||0xcc;return function(_0x3ac35b){if(_0x3ac35b){return _0x354fb1[_0x0930('0x15')](_0x2020f0);}return _0x354fb1[_0x0930('0x16')](_0x2020f0)['end']();};}function respondWithResult(_0x5cf362,_0x53f425){_0x53f425=_0x53f425||0xc8;return function(_0x1b3e72){if(_0x1b3e72){return _0x5cf362['status'](_0x53f425)[_0x0930('0x17')](_0x1b3e72);}};}function respondWithFilteredResult(_0x2a496f,_0x255988){return function(_0x3af83f){if(_0x3af83f){var _0x37b0c5=typeof _0x255988[_0x0930('0x18')]==='undefined'&&typeof _0x255988[_0x0930('0x19')]===_0x0930('0x1a');var _0x4d26a9=_0x3af83f['count'];var _0x87318c=_0x37b0c5?0x0:_0x255988[_0x0930('0x18')];var _0x469be7=_0x37b0c5?_0x3af83f[_0x0930('0x1b')]:_0x255988[_0x0930('0x18')]+_0x255988['limit'];var _0x19b4e4;if(_0x469be7>=_0x4d26a9){_0x469be7=_0x4d26a9;_0x19b4e4=0xc8;}else{_0x19b4e4=0xce;}_0x2a496f[_0x0930('0x16')](_0x19b4e4);return _0x2a496f['set'](_0x0930('0x1c'),_0x87318c+'-'+_0x469be7+'/'+_0x4d26a9)[_0x0930('0x17')](_0x3af83f);}return null;};}function patchUpdates(_0xfc9eaf){return function(_0x284bb7){try{jsonpatch[_0x0930('0x1d')](_0x284bb7,_0xfc9eaf,!![]);}catch(_0xea7c6c){return BPromise['reject'](_0xea7c6c);}return _0x284bb7['save']();};}function saveUpdates(_0x3dbabe,_0x5061a5){return function(_0xd9a9df){if(_0xd9a9df){return _0xd9a9df[_0x0930('0x1e')](_0x3dbabe)[_0x0930('0x1f')](function(_0x4aac18){return _0x4aac18;});}return null;};}function removeEntity(_0x37e243,_0x48bdf5){return function(_0x6e9f46){if(_0x6e9f46){return _0x6e9f46[_0x0930('0x20')]()['then'](function(){_0x37e243['status'](0xcc)[_0x0930('0x21')]();});}};}function handleEntityNotFound(_0x8f676a,_0x413878){return function(_0x2eb598){if(!_0x2eb598){_0x8f676a[_0x0930('0x15')](0x194);}return _0x2eb598;};}function handleError(_0x8662a7,_0x50fae8){_0x50fae8=_0x50fae8||0x1f4;return function(_0x191333){logger[_0x0930('0x22')](_0x191333[_0x0930('0x23')]);if(_0x191333[_0x0930('0x24')]){delete _0x191333[_0x0930('0x24')];}_0x8662a7[_0x0930('0x16')](_0x50fae8)[_0x0930('0x25')](_0x191333);};}exports[_0x0930('0x26')]=function(_0x260bf1,_0x224074){var _0x4aa903={},_0x2a47f2={},_0x597851={'count':0x0,'rows':[]};var _0x421a95=_[_0x0930('0x27')](db[_0x0930('0x28')]['rawAttributes'],function(_0x15a81b){return{'name':_0x15a81b['fieldName'],'type':_0x15a81b['type'][_0x0930('0x29')]};});_0x2a47f2['model']=_[_0x0930('0x27')](_0x421a95,_0x0930('0x24'));_0x2a47f2[_0x0930('0x2a')]=_[_0x0930('0x2b')](_0x260bf1[_0x0930('0x2a')]);_0x2a47f2[_0x0930('0x2c')]=_['intersection'](_0x2a47f2['model'],_0x2a47f2[_0x0930('0x2a')]);_0x4aa903[_0x0930('0x2d')]=_[_0x0930('0x2e')](_0x2a47f2[_0x0930('0x2f')],qs[_0x0930('0x30')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x30')]));_0x4aa903[_0x0930('0x2d')]=_0x4aa903['attributes'][_0x0930('0x31')]?_0x4aa903[_0x0930('0x2d')]:_0x2a47f2[_0x0930('0x2f')];if(!_0x260bf1[_0x0930('0x2a')]['hasOwnProperty'](_0x0930('0x32'))){_0x4aa903[_0x0930('0x19')]=qs[_0x0930('0x19')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x19')]);_0x4aa903['offset']=qs['offset'](_0x260bf1[_0x0930('0x2a')][_0x0930('0x18')]);}_0x4aa903[_0x0930('0x33')]=qs[_0x0930('0x34')](_0x260bf1[_0x0930('0x2a')][_0x0930('0x34')]);_0x4aa903[_0x0930('0x35')]=qs[_0x0930('0x2c')](_[_0x0930('0x36')](_0x260bf1['query'],_0x2a47f2[_0x0930('0x2c')]),_0x421a95);if(_0x260bf1[_0x0930('0x2a')][_0x0930('0x37')]){_0x4aa903[_0x0930('0x35')]=_[_0x0930('0x38')](_0x4aa903[_0x0930('0x35')],{'$or':_[_0x0930('0x27')](_0x421a95,function(_0x35f988){if(_0x35f988[_0x0930('0x39')]!==_0x0930('0x3a')){var _0x1e237e={};_0x1e237e[_0x35f988[_0x0930('0x24')]]={'$like':'%'+_0x260bf1[_0x0930('0x2a')][_0x0930('0x37')]+'%'};return _0x1e237e;}})});}_0x4aa903=_[_0x0930('0x38')]({},_0x4aa903,_0x260bf1[_0x0930('0x3b')]);var _0x4a6e8b={'where':_0x4aa903['where']};return db['CmHopperBlack'][_0x0930('0x1b')](_0x4a6e8b)[_0x0930('0x1f')](function(_0x458dca){_0x597851[_0x0930('0x1b')]=_0x458dca;if(_0x260bf1[_0x0930('0x2a')][_0x0930('0x3c')]){_0x4aa903[_0x0930('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0930('0x3e')](_0x4aa903);})[_0x0930('0x1f')](function(_0x3476f8){_0x597851[_0x0930('0x3f')]=_0x3476f8;return _0x597851;})[_0x0930('0x1f')](respondWithFilteredResult(_0x224074,_0x4aa903))['catch'](handleError(_0x224074,null));};exports[_0x0930('0x40')]=function(_0x4f1e65,_0x23dbf9){var _0x33805a={'raw':!![],'where':{'id':_0x4f1e65[_0x0930('0x41')]['id']}},_0x4938fe={};_0x4938fe[_0x0930('0x2f')]=_[_0x0930('0x2b')](db[_0x0930('0x28')]['rawAttributes']);_0x4938fe[_0x0930('0x2a')]=_[_0x0930('0x2b')](_0x4f1e65['query']);_0x4938fe[_0x0930('0x2c')]=_[_0x0930('0x2e')](_0x4938fe[_0x0930('0x2f')],_0x4938fe['query']);_0x33805a[_0x0930('0x2d')]=_[_0x0930('0x2e')](_0x4938fe[_0x0930('0x2f')],qs[_0x0930('0x30')](_0x4f1e65[_0x0930('0x2a')][_0x0930('0x30')]));_0x33805a[_0x0930('0x2d')]=_0x33805a['attributes']['length']?_0x33805a[_0x0930('0x2d')]:_0x4938fe[_0x0930('0x2f')];if(_0x4f1e65['query'][_0x0930('0x3c')]){_0x33805a[_0x0930('0x3d')]=[{'all':!![]}];}_0x33805a=_[_0x0930('0x38')]({},_0x33805a,_0x4f1e65[_0x0930('0x3b')]);return db['CmHopperBlack'][_0x0930('0x42')](_0x33805a)['then'](handleEntityNotFound(_0x23dbf9,null))[_0x0930('0x1f')](respondWithResult(_0x23dbf9,null))[_0x0930('0x43')](handleError(_0x23dbf9,null));};exports[_0x0930('0x1e')]=function(_0x1d5645,_0x1539b5){if(_0x1d5645[_0x0930('0x44')]['id']){delete _0x1d5645[_0x0930('0x44')]['id'];}return db[_0x0930('0x28')][_0x0930('0x42')]({'where':{'id':_0x1d5645[_0x0930('0x41')]['id']}})[_0x0930('0x1f')](handleEntityNotFound(_0x1539b5,null))[_0x0930('0x1f')](saveUpdates(_0x1d5645[_0x0930('0x44')],null))[_0x0930('0x1f')](respondWithResult(_0x1539b5,null))[_0x0930('0x43')](handleError(_0x1539b5,null));};exports[_0x0930('0x20')]=function(_0x46568f,_0x4d7c69){return db[_0x0930('0x28')]['find']({'where':{'id':_0x46568f[_0x0930('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d7c69,null))[_0x0930('0x1f')](removeEntity(_0x4d7c69,null))[_0x0930('0x43')](handleError(_0x4d7c69,null));};exports['describe']=function(_0x3880ae,_0x1a455c){return db[_0x0930('0x28')][_0x0930('0x45')]()[_0x0930('0x1f')](respondWithResult(_0x1a455c,null))['catch'](handleError(_0x1a455c,null));}; \ No newline at end of file +var _0x7e70=['find','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options'];(function(_0xfe1483,_0x2893f2){var _0xd214ad=function(_0x411b3e){while(--_0x411b3e){_0xfe1483['push'](_0xfe1483['shift']());}};_0xd214ad(++_0x2893f2);}(_0x7e70,0x98));var _0x07e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e70[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07e7('0x0'));var zipdir=require(_0x07e7('0x1'));var jsonpatch=require(_0x07e7('0x2'));var rp=require(_0x07e7('0x3'));var moment=require(_0x07e7('0x4'));var BPromise=require(_0x07e7('0x5'));var Mustache=require('mustache');var util=require(_0x07e7('0x6'));var path=require(_0x07e7('0x7'));var sox=require(_0x07e7('0x8'));var csv=require(_0x07e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07e7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x07e7('0xb'));var jsforce=require(_0x07e7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x07e7('0xd'));var Papa=require(_0x07e7('0xe'));var Redis=require(_0x07e7('0xf'));var authService=require(_0x07e7('0x10'));var qs=require(_0x07e7('0x11'));var as=require(_0x07e7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07e7('0x13'))('api');var utils=require(_0x07e7('0x14'));var config=require(_0x07e7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x07e7('0x16'))['db'];function respondWithStatusCode(_0x1c83b2,_0x2f1513){_0x2f1513=_0x2f1513||0xcc;return function(_0xd9709){if(_0xd9709){return _0x1c83b2[_0x07e7('0x17')](_0x2f1513);}return _0x1c83b2['status'](_0x2f1513)[_0x07e7('0x18')]();};}function respondWithResult(_0x475754,_0x581d95){_0x581d95=_0x581d95||0xc8;return function(_0x141227){if(_0x141227){return _0x475754[_0x07e7('0x19')](_0x581d95)[_0x07e7('0x1a')](_0x141227);}};}function respondWithFilteredResult(_0xc663fc,_0x418860){return function(_0x2f408c){if(_0x2f408c){var _0x53a711=typeof _0x418860[_0x07e7('0x1b')]===_0x07e7('0x1c')&&typeof _0x418860[_0x07e7('0x1d')]===_0x07e7('0x1c');var _0x2b1a01=_0x2f408c[_0x07e7('0x1e')];var _0x466eb8=_0x53a711?0x0:_0x418860[_0x07e7('0x1b')];var _0x34819b=_0x53a711?_0x2f408c['count']:_0x418860[_0x07e7('0x1b')]+_0x418860['limit'];var _0x137efb;if(_0x34819b>=_0x2b1a01){_0x34819b=_0x2b1a01;_0x137efb=0xc8;}else{_0x137efb=0xce;}_0xc663fc[_0x07e7('0x19')](_0x137efb);return _0xc663fc['set'](_0x07e7('0x1f'),_0x466eb8+'-'+_0x34819b+'/'+_0x2b1a01)[_0x07e7('0x1a')](_0x2f408c);}return null;};}function patchUpdates(_0x4aa5fe){return function(_0x18a1fb){try{jsonpatch[_0x07e7('0x20')](_0x18a1fb,_0x4aa5fe,!![]);}catch(_0x2e7730){return BPromise[_0x07e7('0x21')](_0x2e7730);}return _0x18a1fb[_0x07e7('0x22')]();};}function saveUpdates(_0x5555bc,_0x59cb60){return function(_0x4abb62){if(_0x4abb62){return _0x4abb62[_0x07e7('0x23')](_0x5555bc)[_0x07e7('0x24')](function(_0x5ec840){return _0x5ec840;});}return null;};}function removeEntity(_0x252ef7,_0x4a3cc2){return function(_0x1be39f){if(_0x1be39f){return _0x1be39f['destroy']()['then'](function(){_0x252ef7['status'](0xcc)[_0x07e7('0x18')]();});}};}function handleEntityNotFound(_0x348962,_0x5cc39b){return function(_0x354c37){if(!_0x354c37){_0x348962[_0x07e7('0x17')](0x194);}return _0x354c37;};}function handleError(_0x91e01d,_0x496db4){_0x496db4=_0x496db4||0x1f4;return function(_0x16e231){logger[_0x07e7('0x25')](_0x16e231[_0x07e7('0x26')]);if(_0x16e231[_0x07e7('0x27')]){delete _0x16e231['name'];}_0x91e01d[_0x07e7('0x19')](_0x496db4)[_0x07e7('0x28')](_0x16e231);};}exports['index']=function(_0x1d1a21,_0x15e007){var _0x36d201={},_0x4b7d8f={},_0xb4e7a7={'count':0x0,'rows':[]};var _0x5a7fd5=_[_0x07e7('0x29')](db[_0x07e7('0x2a')][_0x07e7('0x2b')],function(_0x39ac6f){return{'name':_0x39ac6f[_0x07e7('0x2c')],'type':_0x39ac6f[_0x07e7('0x2d')][_0x07e7('0x2e')]};});_0x4b7d8f[_0x07e7('0x2f')]=_[_0x07e7('0x29')](_0x5a7fd5,'name');_0x4b7d8f[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0x1d1a21[_0x07e7('0x30')]);_0x4b7d8f['filters']=_[_0x07e7('0x32')](_0x4b7d8f[_0x07e7('0x2f')],_0x4b7d8f[_0x07e7('0x30')]);_0x36d201[_0x07e7('0x33')]=_['intersection'](_0x4b7d8f['model'],qs[_0x07e7('0x34')](_0x1d1a21[_0x07e7('0x30')][_0x07e7('0x34')]));_0x36d201['attributes']=_0x36d201[_0x07e7('0x33')]['length']?_0x36d201[_0x07e7('0x33')]:_0x4b7d8f[_0x07e7('0x2f')];if(!_0x1d1a21[_0x07e7('0x30')][_0x07e7('0x35')](_0x07e7('0x36'))){_0x36d201[_0x07e7('0x1d')]=qs[_0x07e7('0x1d')](_0x1d1a21['query'][_0x07e7('0x1d')]);_0x36d201[_0x07e7('0x1b')]=qs['offset'](_0x1d1a21[_0x07e7('0x30')]['offset']);}_0x36d201[_0x07e7('0x37')]=qs['sort'](_0x1d1a21[_0x07e7('0x30')]['sort']);_0x36d201['where']=qs[_0x07e7('0x38')](_[_0x07e7('0x39')](_0x1d1a21['query'],_0x4b7d8f[_0x07e7('0x38')]),_0x5a7fd5);if(_0x1d1a21[_0x07e7('0x30')][_0x07e7('0x3a')]){_0x36d201[_0x07e7('0x3b')]=_[_0x07e7('0x3c')](_0x36d201['where'],{'$or':_[_0x07e7('0x29')](_0x5a7fd5,function(_0x331586){if(_0x331586['type']!=='VIRTUAL'){var _0x1da4e4={};_0x1da4e4[_0x331586[_0x07e7('0x27')]]={'$like':'%'+_0x1d1a21[_0x07e7('0x30')]['filter']+'%'};return _0x1da4e4;}})});}_0x36d201=_[_0x07e7('0x3c')]({},_0x36d201,_0x1d1a21['options']);var _0x22f02c={'where':_0x36d201[_0x07e7('0x3b')]};return db[_0x07e7('0x2a')][_0x07e7('0x1e')](_0x22f02c)[_0x07e7('0x24')](function(_0xa7ca15){_0xb4e7a7[_0x07e7('0x1e')]=_0xa7ca15;if(_0x1d1a21[_0x07e7('0x30')][_0x07e7('0x3d')]){_0x36d201[_0x07e7('0x3e')]=[{'all':!![]}];}return db[_0x07e7('0x2a')][_0x07e7('0x3f')](_0x36d201);})[_0x07e7('0x24')](function(_0x1c16d9){_0xb4e7a7[_0x07e7('0x40')]=_0x1c16d9;return _0xb4e7a7;})['then'](respondWithFilteredResult(_0x15e007,_0x36d201))[_0x07e7('0x41')](handleError(_0x15e007,null));};exports[_0x07e7('0x42')]=function(_0x127cf8,_0x468226){var _0x2bf5f7={'raw':!![],'where':{'id':_0x127cf8[_0x07e7('0x43')]['id']}},_0x367793={};_0x367793['model']=_[_0x07e7('0x31')](db[_0x07e7('0x2a')][_0x07e7('0x2b')]);_0x367793[_0x07e7('0x30')]=_[_0x07e7('0x31')](_0x127cf8[_0x07e7('0x30')]);_0x367793[_0x07e7('0x38')]=_[_0x07e7('0x32')](_0x367793[_0x07e7('0x2f')],_0x367793['query']);_0x2bf5f7[_0x07e7('0x33')]=_[_0x07e7('0x32')](_0x367793[_0x07e7('0x2f')],qs[_0x07e7('0x34')](_0x127cf8[_0x07e7('0x30')][_0x07e7('0x34')]));_0x2bf5f7[_0x07e7('0x33')]=_0x2bf5f7['attributes'][_0x07e7('0x44')]?_0x2bf5f7['attributes']:_0x367793[_0x07e7('0x2f')];if(_0x127cf8[_0x07e7('0x30')][_0x07e7('0x3d')]){_0x2bf5f7[_0x07e7('0x3e')]=[{'all':!![]}];}_0x2bf5f7=_['merge']({},_0x2bf5f7,_0x127cf8[_0x07e7('0x45')]);return db[_0x07e7('0x2a')][_0x07e7('0x46')](_0x2bf5f7)['then'](handleEntityNotFound(_0x468226,null))['then'](respondWithResult(_0x468226,null))['catch'](handleError(_0x468226,null));};exports['update']=function(_0x4fadb6,_0xf0f714){if(_0x4fadb6['body']['id']){delete _0x4fadb6[_0x07e7('0x47')]['id'];}return db[_0x07e7('0x2a')]['find']({'where':{'id':_0x4fadb6['params']['id']}})[_0x07e7('0x24')](handleEntityNotFound(_0xf0f714,null))[_0x07e7('0x24')](saveUpdates(_0x4fadb6['body'],null))[_0x07e7('0x24')](respondWithResult(_0xf0f714,null))[_0x07e7('0x41')](handleError(_0xf0f714,null));};exports[_0x07e7('0x48')]=function(_0xdc4db1,_0x1ae6b5){return db[_0x07e7('0x2a')][_0x07e7('0x46')]({'where':{'id':_0xdc4db1[_0x07e7('0x43')]['id']}})[_0x07e7('0x24')](handleEntityNotFound(_0x1ae6b5,null))[_0x07e7('0x24')](removeEntity(_0x1ae6b5,null))[_0x07e7('0x41')](handleError(_0x1ae6b5,null));};exports[_0x07e7('0x49')]=function(_0x391fb6,_0x5a5753){return db['CmHopperBlack'][_0x07e7('0x49')]()[_0x07e7('0x24')](respondWithResult(_0x5a5753,null))[_0x07e7('0x41')](handleError(_0x5a5753,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 8410b9a..0fe1385 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 _0xb386=['rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','moment','bluebird','path'];(function(_0x10a28a,_0x1a49f7){var _0x10e391=function(_0x3e98ae){while(--_0x3e98ae){_0x10a28a['push'](_0x10a28a['shift']());}};_0x10e391(++_0x1a49f7);}(_0xb386,0x119));var _0x6b38=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xb386[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x6b38('0x0'));var util=require(_0x6b38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b38('0x2'));var BPromise=require(_0x6b38('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b38('0x4'));var rimraf=require(_0x6b38('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b38('0x6'));module[_0x6b38('0x7')]=function(_0x222d78,_0x157066){return _0x222d78[_0x6b38('0x8')](_0x6b38('0x9'),attributes,{'tableName':_0x6b38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fea=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','api','moment','bluebird','request-promise'];(function(_0x36381e,_0x4534a0){var _0x44b72b=function(_0x5199e7){while(--_0x5199e7){_0x36381e['push'](_0x36381e['shift']());}};_0x44b72b(++_0x4534a0);}(_0x2fea,0x10f));var _0xa2fe=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2fea[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa2fe('0x0'));var moment=require(_0xa2fe('0x1'));var BPromise=require(_0xa2fe('0x2'));var rp=require(_0xa2fe('0x3'));var fs=require('fs');var path=require(_0xa2fe('0x4'));var rimraf=require(_0xa2fe('0x5'));var config=require(_0xa2fe('0x6'));var attributes=require(_0xa2fe('0x7'));module[_0xa2fe('0x8')]=function(_0x432b57,_0x10b085){return _0x432b57['define'](_0xa2fe('0x9'),attributes,{'tableName':_0xa2fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index be56965..8e39835 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 _0x41e4=['lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','map','include','model','UpdateCmHopperBlack','update','body','limit','then','DestroyCmHopperBlack','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41e4,0xcc));var _0x441e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x41e4[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x441e('0x0'));var util=require(_0x441e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x441e('0x2'));var db=require(_0x441e('0x3'))['db'];var utils=require(_0x441e('0x4'));var logger=require('../../config/logger')(_0x441e('0x5'));var config=require(_0x441e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x441e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2169fe,_0x3203ee,_0x47a7ef){return new BPromise(function(_0x3573d0,_0x19f9af){return client[_0x441e('0x8')](_0x2169fe,_0x47a7ef)['then'](function(_0x968d9){logger[_0x441e('0x9')](_0x441e('0xa'),_0x3203ee,_0x441e('0xb'));logger[_0x441e('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3203ee,_0x441e('0xb'),JSON[_0x441e('0xd')](_0x968d9));if(_0x968d9[_0x441e('0xe')]){if(_0x968d9[_0x441e('0xe')][_0x441e('0xf')]===0x1f4){logger[_0x441e('0xe')](_0x441e('0xa'),_0x3203ee,_0x968d9['error'][_0x441e('0x10')]);return _0x19f9af(_0x968d9[_0x441e('0xe')]['message']);}logger[_0x441e('0xe')](_0x441e('0xa'),_0x3203ee,_0x968d9['error'][_0x441e('0x10')]);return _0x3573d0(_0x968d9[_0x441e('0xe')][_0x441e('0x10')]);}else{logger[_0x441e('0x9')](_0x441e('0xa'),_0x3203ee,_0x441e('0xb'));_0x3573d0(_0x968d9['result']['message']);}})[_0x441e('0x11')](function(_0x30cf3a){logger['error'](_0x441e('0xa'),_0x3203ee,_0x30cf3a);_0x19f9af(_0x30cf3a);});});}exports[_0x441e('0x12')]=function(_0x7c108){var _0x173298=this;return new Promise(function(_0x37d975,_0x1690f6){return db[_0x441e('0x13')]['findAll']({'raw':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x15')]===undefined?!![]:![]:!![],'where':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x16')]||null:null,'attributes':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')][_0x441e('0x17')]||null:null,'limit':_0x7c108[_0x441e('0x14')]?_0x7c108[_0x441e('0x14')]['limit']||null:null,'include':_0x7c108['options']?_0x7c108[_0x441e('0x14')]['include']?_[_0x441e('0x18')](_0x7c108[_0x441e('0x14')][_0x441e('0x19')],function(_0x1bb5d1){return{'model':db[_0x1bb5d1['model']],'as':_0x1bb5d1['as'],'attributes':_0x1bb5d1[_0x441e('0x17')],'include':_0x1bb5d1[_0x441e('0x19')]?_[_0x441e('0x18')](_0x1bb5d1[_0x441e('0x19')],function(_0x34e639){return{'model':db[_0x34e639[_0x441e('0x1a')]],'as':_0x34e639['as'],'attributes':_0x34e639[_0x441e('0x17')],'include':_0x34e639['include']?_[_0x441e('0x18')](_0x34e639[_0x441e('0x19')],function(_0x3e48c7){return{'model':db[_0x3e48c7[_0x441e('0x1a')]],'as':_0x3e48c7['as'],'attributes':_0x3e48c7[_0x441e('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45331e){logger[_0x441e('0x9')](_0x441e('0x12'),_0x7c108);logger[_0x441e('0xc')](_0x441e('0x12'),_0x7c108,JSON[_0x441e('0xd')](_0x45331e));_0x37d975(_0x45331e);})[_0x441e('0x11')](function(_0x34ae55){logger[_0x441e('0xe')](_0x441e('0x12'),_0x34ae55[_0x441e('0x10')],_0x7c108);_0x1690f6(_0x173298[_0x441e('0xe')](0x1f4,_0x34ae55[_0x441e('0x10')]));});});};exports[_0x441e('0x1b')]=function(_0x21bcdc){var _0x324061=this;return new Promise(function(_0x5141a1,_0x3e8b94){return db['CmHopperBlack'][_0x441e('0x1c')](_0x21bcdc[_0x441e('0x1d')],{'raw':_0x21bcdc['options']?_0x21bcdc['options'][_0x441e('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x16')]||null:null,'attributes':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x17')]||null:null,'limit':_0x21bcdc[_0x441e('0x14')]?_0x21bcdc[_0x441e('0x14')][_0x441e('0x1e')]||null:null})[_0x441e('0x1f')](function(_0x54a929){logger[_0x441e('0x9')]('UpdateCmHopperBlack',_0x21bcdc);logger[_0x441e('0xc')](_0x441e('0x1b'),_0x21bcdc,JSON[_0x441e('0xd')](_0x54a929));_0x5141a1(_0x54a929);})[_0x441e('0x11')](function(_0x532263){logger[_0x441e('0xe')](_0x441e('0x1b'),_0x532263[_0x441e('0x10')],_0x21bcdc);_0x3e8b94(_0x324061[_0x441e('0xe')](0x1f4,_0x532263['message']));});});};exports[_0x441e('0x20')]=function(_0x4960c9){var _0x4efcc3=this;return new Promise(function(_0x1955bb,_0x161ee6){return db['CmHopperBlack'][_0x441e('0x21')]({'where':_0x4960c9[_0x441e('0x14')]?_0x4960c9[_0x441e('0x14')][_0x441e('0x16')]||null:null})[_0x441e('0x1f')](function(_0x3be802){logger[_0x441e('0x9')]('DestroyCmHopperBlack',_0x4960c9);logger[_0x441e('0xc')](_0x441e('0x20'),_0x4960c9,JSON[_0x441e('0xd')](_0x3be802));_0x1955bb(_0x3be802);})[_0x441e('0x11')](function(_0x3be834){logger['error'](_0x441e('0x20'),_0x3be834[_0x441e('0x10')],_0x4960c9);_0x161ee6(_0x4efcc3[_0x441e('0xe')](0x1f4,_0x3be834[_0x441e('0x10')]));});});}; \ No newline at end of file +var _0x5239=['http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','model','attributes','map','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e25ed,_0x2b650a){var _0x260176=function(_0x10d47f){while(--_0x10d47f){_0x2e25ed['push'](_0x2e25ed['shift']());}};_0x260176(++_0x2b650a);}(_0x5239,0x1a2));var _0x9523=function(_0x23b998,_0x3e2786){_0x23b998=_0x23b998-0x0;var _0x510716=_0x5239[_0x23b998];return _0x510716;};'use strict';var _=require(_0x9523('0x0'));var util=require(_0x9523('0x1'));var moment=require(_0x9523('0x2'));var BPromise=require('bluebird');var rs=require(_0x9523('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9523('0x4'))['db'];var utils=require(_0x9523('0x5'));var logger=require(_0x9523('0x6'))(_0x9523('0x7'));var config=require(_0x9523('0x8'));var jayson=require(_0x9523('0x9'));var client=jayson[_0x9523('0xa')][_0x9523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1494f8,_0x3c30da,_0x5a15b4){return new BPromise(function(_0x24d507,_0x3aa6f0){return client[_0x9523('0xc')](_0x1494f8,_0x5a15b4)[_0x9523('0xd')](function(_0x576dc1){logger[_0x9523('0xe')](_0x9523('0xf'),_0x3c30da,_0x9523('0x10'));logger[_0x9523('0x11')](_0x9523('0x12'),_0x3c30da,_0x9523('0x10'),JSON[_0x9523('0x13')](_0x576dc1));if(_0x576dc1[_0x9523('0x14')]){if(_0x576dc1[_0x9523('0x14')]['code']===0x1f4){logger[_0x9523('0x14')](_0x9523('0xf'),_0x3c30da,_0x576dc1[_0x9523('0x14')][_0x9523('0x15')]);return _0x3aa6f0(_0x576dc1[_0x9523('0x14')]['message']);}logger[_0x9523('0x14')](_0x9523('0xf'),_0x3c30da,_0x576dc1[_0x9523('0x14')][_0x9523('0x15')]);return _0x24d507(_0x576dc1[_0x9523('0x14')][_0x9523('0x15')]);}else{logger[_0x9523('0xe')](_0x9523('0xf'),_0x3c30da,'request\x20sent');_0x24d507(_0x576dc1[_0x9523('0x16')]['message']);}})[_0x9523('0x17')](function(_0x215a8c){logger[_0x9523('0x14')](_0x9523('0xf'),_0x3c30da,_0x215a8c);_0x3aa6f0(_0x215a8c);});});}exports[_0x9523('0x18')]=function(_0x4b9154){var _0x1e0195=this;return new Promise(function(_0x1d81d8,_0x120863){return db[_0x9523('0x19')][_0x9523('0x1a')]({'raw':_0x4b9154[_0x9523('0x1b')]?_0x4b9154['options'][_0x9523('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b9154[_0x9523('0x1b')]?_0x4b9154[_0x9523('0x1b')]['where']||null:null,'attributes':_0x4b9154[_0x9523('0x1b')]?_0x4b9154[_0x9523('0x1b')]['attributes']||null:null,'limit':_0x4b9154[_0x9523('0x1b')]?_0x4b9154['options'][_0x9523('0x1d')]||null:null,'include':_0x4b9154[_0x9523('0x1b')]?_0x4b9154[_0x9523('0x1b')][_0x9523('0x1e')]?_['map'](_0x4b9154[_0x9523('0x1b')][_0x9523('0x1e')],function(_0x2d2314){return{'model':db[_0x2d2314[_0x9523('0x1f')]],'as':_0x2d2314['as'],'attributes':_0x2d2314[_0x9523('0x20')],'include':_0x2d2314[_0x9523('0x1e')]?_[_0x9523('0x21')](_0x2d2314[_0x9523('0x1e')],function(_0x45c790){return{'model':db[_0x45c790['model']],'as':_0x45c790['as'],'attributes':_0x45c790[_0x9523('0x20')],'include':_0x45c790[_0x9523('0x1e')]?_[_0x9523('0x21')](_0x45c790[_0x9523('0x1e')],function(_0x4f7658){return{'model':db[_0x4f7658['model']],'as':_0x4f7658['as'],'attributes':_0x4f7658[_0x9523('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301a0b){logger['info'](_0x9523('0x18'),_0x4b9154);logger[_0x9523('0x11')](_0x9523('0x18'),_0x4b9154,JSON[_0x9523('0x13')](_0x301a0b));_0x1d81d8(_0x301a0b);})[_0x9523('0x17')](function(_0x553ef0){logger[_0x9523('0x14')](_0x9523('0x18'),_0x553ef0[_0x9523('0x15')],_0x4b9154);_0x120863(_0x1e0195[_0x9523('0x14')](0x1f4,_0x553ef0[_0x9523('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x26912a){var _0x5e291e=this;return new Promise(function(_0x4bb76d,_0x112001){return db[_0x9523('0x19')]['update'](_0x26912a[_0x9523('0x22')],{'raw':_0x26912a[_0x9523('0x1b')]?_0x26912a[_0x9523('0x1b')][_0x9523('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26912a[_0x9523('0x1b')]?_0x26912a[_0x9523('0x1b')][_0x9523('0x23')]||null:null,'attributes':_0x26912a[_0x9523('0x1b')]?_0x26912a[_0x9523('0x1b')][_0x9523('0x20')]||null:null,'limit':_0x26912a[_0x9523('0x1b')]?_0x26912a['options'][_0x9523('0x1d')]||null:null})[_0x9523('0xd')](function(_0x3f3757){logger['info']('UpdateCmHopperBlack',_0x26912a);logger[_0x9523('0x11')](_0x9523('0x24'),_0x26912a,JSON[_0x9523('0x13')](_0x3f3757));_0x4bb76d(_0x3f3757);})[_0x9523('0x17')](function(_0x21ddad){logger[_0x9523('0x14')](_0x9523('0x24'),_0x21ddad['message'],_0x26912a);_0x112001(_0x5e291e['error'](0x1f4,_0x21ddad['message']));});});};exports[_0x9523('0x25')]=function(_0x256c0c){var _0x3284bb=this;return new Promise(function(_0x49d076,_0xb1d18d){return db[_0x9523('0x19')][_0x9523('0x26')]({'where':_0x256c0c[_0x9523('0x1b')]?_0x256c0c[_0x9523('0x1b')][_0x9523('0x23')]||null:null})[_0x9523('0xd')](function(_0x4ae4b9){logger[_0x9523('0xe')](_0x9523('0x25'),_0x256c0c);logger[_0x9523('0x11')](_0x9523('0x25'),_0x256c0c,JSON[_0x9523('0x13')](_0x4ae4b9));_0x49d076(_0x4ae4b9);})['catch'](function(_0xa14bb8){logger[_0x9523('0x14')](_0x9523('0x25'),_0xa14bb8[_0x9523('0x15')],_0x256c0c);_0xb1d18d(_0x3284bb[_0x9523('0x14')](0x1f4,_0xa14bb8[_0x9523('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 16073cd..e4d5309 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 _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperBlack.controller','index','get','describe','show','/:id'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xd046,0x129));var _0x6d04=function(_0x53cd3e,_0x2e4195){_0x53cd3e=_0x53cd3e-0x0;var _0x3feed8=_0xd046[_0x53cd3e];return _0x3feed8;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['put'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d04('0xa'),auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router; \ No newline at end of file +var _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x4be813,_0x36620f){var _0x23b00b=function(_0x39f420){while(--_0x39f420){_0x4be813['push'](_0x4be813['shift']());}};_0x23b00b(++_0x36620f);}(_0xf072,0x1cf));var _0x2f07=function(_0x4d1b63,_0x494772){_0x4d1b63=_0x4d1b63-0x0;var _0x3c0c00=_0xf072[_0x4d1b63];return _0x3c0c00;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 07def56..2b74095 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 _0x3d7a=['STRING','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','DATE','INTEGER'];(function(_0x503481,_0x2c0dfc){var _0x4b8897=function(_0x3704ec){while(--_0x3704ec){_0x503481['push'](_0x503481['shift']());}};_0x4b8897(++_0x2c0dfc);}(_0x3d7a,0x10e));var _0xa3d7=function(_0x47f4c2,_0x134e7b){_0x47f4c2=_0x47f4c2-0x0;var _0x22c63e=_0x3d7a[_0x47f4c2];return _0x22c63e;};'use strict';var Sequelize=require(_0xa3d7('0x0'));var moment=require(_0xa3d7('0x1'));module[_0xa3d7('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa3d7('0x3')]},'countbusyretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa3d7('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xa3d7('0x5')]},'originatecalleridname':{'type':Sequelize[_0xa3d7('0x5')]},'calleridnum':{'type':Sequelize[_0xa3d7('0x5')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa3d7('0x3')]},'responsetime':{'type':Sequelize[_0xa3d7('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa3d7('0x3')]},'endtime':{'type':Sequelize[_0xa3d7('0x3')]},'ringtime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa3d7('0x5')]},'campaign':{'type':Sequelize[_0xa3d7('0x5')]},'campaigntype':{'type':Sequelize[_0xa3d7('0x5')]},'membername':{'type':Sequelize[_0xa3d7('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa3d7('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa3d7('0x5')]},'dispositionat':{'type':Sequelize[_0xa3d7('0x3')],'set':function(_0x53eb31){var _0x4162bb=this['getDataValue']('endtime');if(_0x4162bb&&_0x53eb31){this[_0xa3d7('0x6')](_0xa3d7('0x7'),moment(_0x53eb31)[_0xa3d7('0x8')](moment(_0x4162bb),_0xa3d7('0x9')));}return this[_0xa3d7('0x6')]('dispositionat',_0x53eb31);}},'amd':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa3d7('0x3')]},'callback':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa3d7('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xa3d7('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa3d7('0x3')]},'recallme':{'type':Sequelize[_0xa3d7('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa3d7('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa3d7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x851f=['sequelize','moment','exports','INTEGER','DATE','STRING','endtime','setDataValue','diff','seconds','BOOLEAN'];(function(_0x17bc2c,_0x4806ac){var _0x587681=function(_0x289bf5){while(--_0x289bf5){_0x17bc2c['push'](_0x17bc2c['shift']());}};_0x587681(++_0x4806ac);}(_0x851f,0xbb));var _0xf851=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x851f[_0xb0fe92];return _0x41787f;};'use strict';var Sequelize=require(_0xf851('0x0'));var moment=require(_0xf851('0x1'));module[_0xf851('0x2')]={'state':{'type':Sequelize[_0xf851('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf851('0x4')]},'countbusyretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf851('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xf851('0x5')]},'calleridnum':{'type':Sequelize[_0xf851('0x5')]},'calleridname':{'type':Sequelize[_0xf851('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf851('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xf851('0x4')]},'endtime':{'type':Sequelize[_0xf851('0x4')]},'ringtime':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf851('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xf851('0x5')]},'disposition':{'type':Sequelize[_0xf851('0x5')]},'secondDisposition':{'type':Sequelize[_0xf851('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf851('0x5')]},'dispositionat':{'type':Sequelize[_0xf851('0x4')],'set':function(_0x2943f3){var _0x5962e9=this['getDataValue'](_0xf851('0x6'));if(_0x5962e9&&_0x2943f3){this[_0xf851('0x7')]('followuptime',moment(_0x2943f3)[_0xf851('0x8')](moment(_0x5962e9),_0xf851('0x9')));}return this[_0xf851('0x7')]('dispositionat',_0x2943f3);}},'amd':{'type':Sequelize[_0xf851('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf851('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf851('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf851('0x4')]},'callback':{'type':Sequelize[_0xf851('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf851('0x4')]},'deleted':{'type':Sequelize[_0xf851('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf851('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf851('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 24526e0..8db18de 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 _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xeda8,0x104));var _0x8eda=function(_0x101a1e,_0x5ebf70){_0x101a1e=_0x101a1e-0x0;var _0xa9836=_0xeda8[_0x101a1e];return _0xa9836;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file +var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x30a198,_0x460f99){var _0x4be945=function(_0x22f182){while(--_0x22f182){_0x30a198['push'](_0x30a198['shift']());}};_0x4be945(++_0x460f99);}(_0xd117,0x182));var _0x7d11=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0xd117[_0x4fe19c];return _0x952ac7;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 86dbe13..5f7ab98 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 _0xd613=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4112f1,_0x159a86){var _0x54e1bf=function(_0x3a5624){while(--_0x3a5624){_0x4112f1['push'](_0x4112f1['shift']());}};_0x54e1bf(++_0x159a86);}(_0xd613,0x180));var _0x3d61=function(_0x3ee717,_0x1717bd){_0x3ee717=_0x3ee717-0x0;var _0x4b7d8a=_0xd613[_0x3ee717];return _0x4b7d8a;};'use strict';var _=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var logger=require(_0x3d61('0x2'))(_0x3d61('0x3'));var moment=require(_0x3d61('0x4'));var BPromise=require(_0x3d61('0x5'));var rp=require(_0x3d61('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d61('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d61('0x8'));module[_0x3d61('0x9')]=function(_0x3917c0,_0x508745){return _0x3917c0[_0x3d61('0xa')](_0x3d61('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3d61('0xc'),'fields':['calleridnum']},{'name':_0x3d61('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8aa6=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperFinal.attributes','define','calleridnum','uniqueid','lodash','util'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x8aa6,0xa6));var _0x68aa=function(_0x53c5cf,_0x3ef208){_0x53c5cf=_0x53c5cf-0x0;var _0x3261aa=_0x8aa6[_0x53c5cf];return _0x3261aa;};'use strict';var _=require(_0x68aa('0x0'));var util=require(_0x68aa('0x1'));var logger=require(_0x68aa('0x2'))(_0x68aa('0x3'));var moment=require(_0x68aa('0x4'));var BPromise=require(_0x68aa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x68aa('0x6'));var config=require(_0x68aa('0x7'));var attributes=require(_0x68aa('0x8'));module['exports']=function(_0x423b8f,_0x432dac){return _0x423b8f[_0x68aa('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x68aa('0xa')]},{'name':'uniqueid','fields':[_0x68aa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 4d70316..4a97676 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3aad6b,_0x5913b5){var _0x3733fb=function(_0x4c9f60){while(--_0x4c9f60){_0x3aad6b['push'](_0x3aad6b['shift']());}};_0x3733fb(++_0x5913b5);}(_0x7a54,0x106));var _0x47a5=function(_0x43d0de,_0x490f32){_0x43d0de=_0x43d0de-0x0;var _0x37dc87=_0x7a54[_0x43d0de];return _0x37dc87;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x31f01e,_0x53472f){var _0x5a343b=function(_0x3468c5){while(--_0x3468c5){_0x31f01e['push'](_0x31f01e['shift']());}};_0x5a343b(++_0x53472f);}(_0x7a54,0x106));var _0x47a5=function(_0xad0b30,_0x3a223a){_0xad0b30=_0xad0b30-0x0;var _0x3013ca=_0x7a54[_0xad0b30];return _0x3013ca;};'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 430c1ef..7ab3e07 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 _0x7ea9=['/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x300776,_0x2aae33){var _0x8a9b1=function(_0x5817b2){while(--_0x5817b2){_0x300776['push'](_0x300776['shift']());}};_0x8a9b1(++_0x2aae33);}(_0x7ea9,0xec));var _0x97ea=function(_0xdd14c5,_0x178883){_0xdd14c5=_0xdd14c5-0x0;var _0x302fbf=_0x7ea9[_0xdd14c5];return _0x302fbf;};'use strict';var multer=require('multer');var util=require(_0x97ea('0x0'));var path=require(_0x97ea('0x1'));var timeout=require(_0x97ea('0x2'));var express=require(_0x97ea('0x3'));var router=express[_0x97ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x97ea('0x5'));var interaction=require(_0x97ea('0x6'));var config=require(_0x97ea('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x97ea('0x8')]('/',auth[_0x97ea('0x9')](),controller[_0x97ea('0xa')]);router[_0x97ea('0x8')]('/describe',auth[_0x97ea('0x9')](),controller[_0x97ea('0xb')]);router['get'](_0x97ea('0xc'),auth['isAuthenticated'](),controller[_0x97ea('0xd')]);router['get'](_0x97ea('0xe'),auth[_0x97ea('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x97ea('0x8')](_0x97ea('0xf'),auth[_0x97ea('0x9')](),controller[_0x97ea('0x10')]);router[_0x97ea('0x11')](_0x97ea('0x12'),auth[_0x97ea('0x9')](),controller[_0x97ea('0x13')]);router[_0x97ea('0x11')](_0x97ea('0x14'),auth['isAuthenticated'](),controller[_0x97ea('0x15')]);router[_0x97ea('0x11')]('/checkContactHopper',auth[_0x97ea('0x9')](),controller[_0x97ea('0x16')]);router[_0x97ea('0x17')]('/:id',auth[_0x97ea('0x9')](),controller[_0x97ea('0x18')]);module['exports']=router; \ No newline at end of file +var _0xd7a5=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe'];(function(_0x2d01dc,_0x840f2a){var _0x2f8336=function(_0x2789cc){while(--_0x2789cc){_0x2d01dc['push'](_0x2d01dc['shift']());}};_0x2f8336(++_0x840f2a);}(_0xd7a5,0x1ad));var _0x5d7a=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0xd7a5[_0x485abd];return _0x3379f1;};'use strict';var multer=require(_0x5d7a('0x0'));var util=require('util');var path=require(_0x5d7a('0x1'));var timeout=require(_0x5d7a('0x2'));var express=require('express');var router=express[_0x5d7a('0x3')]();var fs_extra=require(_0x5d7a('0x4'));var auth=require(_0x5d7a('0x5'));var interaction=require(_0x5d7a('0x6'));var config=require(_0x5d7a('0x7'));var controller=require(_0x5d7a('0x8'));router[_0x5d7a('0x9')]('/',auth[_0x5d7a('0xa')](),controller[_0x5d7a('0xb')]);router[_0x5d7a('0x9')]('/describe',auth[_0x5d7a('0xa')](),controller[_0x5d7a('0xc')]);router['get'](_0x5d7a('0xd'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0xe')]);router[_0x5d7a('0x9')](_0x5d7a('0xf'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x10')]);router['get'](_0x5d7a('0x11'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x12')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x13')]);router[_0x5d7a('0x14')](_0x5d7a('0x15'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x16')]);router[_0x5d7a('0x14')](_0x5d7a('0x17'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x18')]);router['put'](_0x5d7a('0xd'),auth[_0x5d7a('0xa')](),controller[_0x5d7a('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f3430db..d371140 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 _0xdf61=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xdf61,0x138));var _0x1df6=function(_0x43959f,_0x5892fb){_0x43959f=_0x43959f-0x0;var _0x319109=_0xdf61[_0x43959f];return _0x319109;};'use strict';var Sequelize=require('sequelize');module[_0x1df6('0x0')]={'state':{'type':Sequelize[_0x1df6('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1df6('0x2')]},'countbusyretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1df6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x1df6('0x3')]},'originatecalleridname':{'type':Sequelize[_0x1df6('0x3')]},'calleridnum':{'type':Sequelize[_0x1df6('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1df6('0x2')]},'answertime':{'type':Sequelize[_0x1df6('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1df6('0x2')]},'ringtime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1df6('0x3')]},'campaign':{'type':Sequelize[_0x1df6('0x3')]},'campaigntype':{'type':Sequelize[_0x1df6('0x3')]},'membername':{'type':Sequelize[_0x1df6('0x3')]},'reason':{'type':Sequelize[_0x1df6('0x3')]},'amd':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1df6('0x2')]},'recallme':{'type':Sequelize[_0x1df6('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1df6('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1df6('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x172f=['STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0x2cd759,_0x45dd70){var _0x1ab775=function(_0xd5cc2a){while(--_0xd5cc2a){_0x2cd759['push'](_0x2cd759['shift']());}};_0x1ab775(++_0x45dd70);}(_0x172f,0x1d5));var _0xf172=function(_0x3eff39,_0x4d37a7){_0x3eff39=_0x3eff39-0x0;var _0x7ac104=_0x172f[_0x3eff39];return _0x7ac104;};'use strict';var Sequelize=require(_0xf172('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf172('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf172('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf172('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf172('0x3')]},'answertime':{'type':Sequelize[_0xf172('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf172('0x3')]},'ringtime':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf172('0x1')]},'campaign':{'type':Sequelize[_0xf172('0x1')]},'campaigntype':{'type':Sequelize[_0xf172('0x1')]},'membername':{'type':Sequelize[_0xf172('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xf172('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf172('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xf172('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf172('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf172('0x3')]},'recallme':{'type':Sequelize[_0xf172('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf172('0x3')]},'edited':{'type':Sequelize[_0xf172('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf172('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 54759af..2a78535 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 _0xe5e9=['rows','catch','show','keys','find','create','describe','body','uniqueid','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','json','limit','undefined','count','offset','status','set','reject','save','update','then','destroy','sendStatus','error','name','send','map','CmHopperHistory','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0xb6384a,_0x528899){var _0x1ed7e4=function(_0x4aec89){while(--_0x4aec89){_0xb6384a['push'](_0xb6384a['shift']());}};_0x1ed7e4(++_0x528899);}(_0xe5e9,0x1c0));var _0x9e5e=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0xe5e9[_0x175a55];return _0x167adf;};'use strict';var emlformat=require(_0x9e5e('0x0'));var rimraf=require(_0x9e5e('0x1'));var zipdir=require(_0x9e5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e5e('0x3'));var moment=require('moment');var BPromise=require(_0x9e5e('0x4'));var Mustache=require(_0x9e5e('0x5'));var util=require(_0x9e5e('0x6'));var path=require(_0x9e5e('0x7'));var sox=require(_0x9e5e('0x8'));var csv=require('to-csv');var ejs=require(_0x9e5e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9e5e('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e5e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9e5e('0xc'));var querystring=require('querystring');var Papa=require(_0x9e5e('0xd'));var Redis=require('ioredis');var authService=require(_0x9e5e('0xe'));var qs=require(_0x9e5e('0xf'));var as=require(_0x9e5e('0x10'));var hardwareService=require(_0x9e5e('0x11'));var logger=require(_0x9e5e('0x12'))('api');var utils=require(_0x9e5e('0x13'));var config=require(_0x9e5e('0x14'));var licenseUtil=require(_0x9e5e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x239c24,_0x2508de){_0x2508de=_0x2508de||0xcc;return function(_0x3de1dd){if(_0x3de1dd){return _0x239c24['sendStatus'](_0x2508de);}return _0x239c24['status'](_0x2508de)[_0x9e5e('0x16')]();};}function respondWithResult(_0x2ffba2,_0x42f1c3){_0x42f1c3=_0x42f1c3||0xc8;return function(_0x614d2f){if(_0x614d2f){return _0x2ffba2['status'](_0x42f1c3)[_0x9e5e('0x17')](_0x614d2f);}};}function respondWithFilteredResult(_0x2a92e7,_0x458ca2){return function(_0x45a2d4){if(_0x45a2d4){var _0xe96931=typeof _0x458ca2['offset']==='undefined'&&typeof _0x458ca2[_0x9e5e('0x18')]===_0x9e5e('0x19');var _0x2ce69=_0x45a2d4[_0x9e5e('0x1a')];var _0x460a5f=_0xe96931?0x0:_0x458ca2[_0x9e5e('0x1b')];var _0x2c0411=_0xe96931?_0x45a2d4[_0x9e5e('0x1a')]:_0x458ca2['offset']+_0x458ca2[_0x9e5e('0x18')];var _0x1319ac;if(_0x2c0411>=_0x2ce69){_0x2c0411=_0x2ce69;_0x1319ac=0xc8;}else{_0x1319ac=0xce;}_0x2a92e7[_0x9e5e('0x1c')](_0x1319ac);return _0x2a92e7[_0x9e5e('0x1d')]('Content-Range',_0x460a5f+'-'+_0x2c0411+'/'+_0x2ce69)['json'](_0x45a2d4);}return null;};}function patchUpdates(_0x43c772){return function(_0x26eeed){try{jsonpatch['apply'](_0x26eeed,_0x43c772,!![]);}catch(_0x356e6b){return BPromise[_0x9e5e('0x1e')](_0x356e6b);}return _0x26eeed[_0x9e5e('0x1f')]();};}function saveUpdates(_0x32044f,_0x5a5fb7){return function(_0x5bfcc1){if(_0x5bfcc1){return _0x5bfcc1[_0x9e5e('0x20')](_0x32044f)[_0x9e5e('0x21')](function(_0x3acb94){return _0x3acb94;});}return null;};}function removeEntity(_0x428254,_0x1fb93e){return function(_0x1a0c5a){if(_0x1a0c5a){return _0x1a0c5a[_0x9e5e('0x22')]()[_0x9e5e('0x21')](function(){_0x428254[_0x9e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b960c,_0x47b386){return function(_0x471d12){if(!_0x471d12){_0x1b960c[_0x9e5e('0x23')](0x194);}return _0x471d12;};}function handleError(_0x4ae17f,_0xec2c6a){_0xec2c6a=_0xec2c6a||0x1f4;return function(_0x25a869){logger[_0x9e5e('0x24')](_0x25a869['stack']);if(_0x25a869[_0x9e5e('0x25')]){delete _0x25a869[_0x9e5e('0x25')];}_0x4ae17f['status'](_0xec2c6a)[_0x9e5e('0x26')](_0x25a869);};}exports['index']=function(_0x24ba61,_0x466f21){var _0x271529={},_0x4cefcf={},_0x35de82={'count':0x0,'rows':[]};var _0x286a38=_[_0x9e5e('0x27')](db[_0x9e5e('0x28')]['rawAttributes'],function(_0x6ff616){return{'name':_0x6ff616[_0x9e5e('0x29')],'type':_0x6ff616[_0x9e5e('0x2a')][_0x9e5e('0x2b')]};});_0x4cefcf[_0x9e5e('0x2c')]=_[_0x9e5e('0x27')](_0x286a38,_0x9e5e('0x25'));_0x4cefcf[_0x9e5e('0x2d')]=_['keys'](_0x24ba61[_0x9e5e('0x2d')]);_0x4cefcf[_0x9e5e('0x2e')]=_[_0x9e5e('0x2f')](_0x4cefcf[_0x9e5e('0x2c')],_0x4cefcf[_0x9e5e('0x2d')]);_0x271529['attributes']=_[_0x9e5e('0x2f')](_0x4cefcf[_0x9e5e('0x2c')],qs['fields'](_0x24ba61['query'][_0x9e5e('0x30')]));_0x271529[_0x9e5e('0x31')]=_0x271529[_0x9e5e('0x31')][_0x9e5e('0x32')]?_0x271529[_0x9e5e('0x31')]:_0x4cefcf[_0x9e5e('0x2c')];if(!_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x33')](_0x9e5e('0x34'))){_0x271529['limit']=qs[_0x9e5e('0x18')](_0x24ba61['query']['limit']);_0x271529['offset']=qs[_0x9e5e('0x1b')](_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x1b')]);}_0x271529[_0x9e5e('0x35')]=qs[_0x9e5e('0x36')](_0x24ba61[_0x9e5e('0x2d')]['sort']);_0x271529[_0x9e5e('0x37')]=qs[_0x9e5e('0x2e')](_[_0x9e5e('0x38')](_0x24ba61[_0x9e5e('0x2d')],_0x4cefcf[_0x9e5e('0x2e')]),_0x286a38);if(_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x39')]){_0x271529['where']=_[_0x9e5e('0x3a')](_0x271529[_0x9e5e('0x37')],{'$or':_['map'](_0x286a38,function(_0x1a379b){if(_0x1a379b[_0x9e5e('0x2a')]!=='VIRTUAL'){var _0x4e26e1={};_0x4e26e1[_0x1a379b[_0x9e5e('0x25')]]={'$like':'%'+_0x24ba61[_0x9e5e('0x2d')][_0x9e5e('0x39')]+'%'};return _0x4e26e1;}})});}_0x271529=_[_0x9e5e('0x3a')]({},_0x271529,_0x24ba61[_0x9e5e('0x3b')]);var _0x58e493={'where':_0x271529['where']};return db['CmHopperHistory'][_0x9e5e('0x1a')](_0x58e493)[_0x9e5e('0x21')](function(_0x2ab71e){_0x35de82['count']=_0x2ab71e;if(_0x24ba61['query'][_0x9e5e('0x3c')]){_0x271529[_0x9e5e('0x3d')]=[{'all':!![]}];}return db[_0x9e5e('0x28')][_0x9e5e('0x3e')](_0x271529);})[_0x9e5e('0x21')](function(_0x577b5d){_0x35de82[_0x9e5e('0x3f')]=_0x577b5d;return _0x35de82;})['then'](respondWithFilteredResult(_0x466f21,_0x271529))[_0x9e5e('0x40')](handleError(_0x466f21,null));};exports[_0x9e5e('0x41')]=function(_0x41bf11,_0x3edc0e){var _0x3ee35e={'raw':!![],'where':{'id':_0x41bf11['params']['id']}},_0x3df771={};_0x3df771[_0x9e5e('0x2c')]=_[_0x9e5e('0x42')](db[_0x9e5e('0x28')]['rawAttributes']);_0x3df771[_0x9e5e('0x2d')]=_[_0x9e5e('0x42')](_0x41bf11[_0x9e5e('0x2d')]);_0x3df771[_0x9e5e('0x2e')]=_[_0x9e5e('0x2f')](_0x3df771['model'],_0x3df771[_0x9e5e('0x2d')]);_0x3ee35e[_0x9e5e('0x31')]=_[_0x9e5e('0x2f')](_0x3df771[_0x9e5e('0x2c')],qs[_0x9e5e('0x30')](_0x41bf11[_0x9e5e('0x2d')][_0x9e5e('0x30')]));_0x3ee35e[_0x9e5e('0x31')]=_0x3ee35e[_0x9e5e('0x31')][_0x9e5e('0x32')]?_0x3ee35e['attributes']:_0x3df771[_0x9e5e('0x2c')];if(_0x41bf11[_0x9e5e('0x2d')][_0x9e5e('0x3c')]){_0x3ee35e[_0x9e5e('0x3d')]=[{'all':!![]}];}_0x3ee35e=_[_0x9e5e('0x3a')]({},_0x3ee35e,_0x41bf11['options']);return db[_0x9e5e('0x28')][_0x9e5e('0x43')](_0x3ee35e)['then'](handleEntityNotFound(_0x3edc0e,null))[_0x9e5e('0x21')](respondWithResult(_0x3edc0e,null))[_0x9e5e('0x40')](handleError(_0x3edc0e,null));};exports[_0x9e5e('0x44')]=function(_0x3f8e72,_0x7c4c08){return db[_0x9e5e('0x28')]['create'](_0x3f8e72['body'],{})['then'](respondWithResult(_0x7c4c08,0xc9))[_0x9e5e('0x40')](handleError(_0x7c4c08,null));};exports[_0x9e5e('0x45')]=function(_0x565816,_0xf3506e){return db['CmHopperHistory']['describe']()[_0x9e5e('0x21')](respondWithResult(_0xf3506e,null))[_0x9e5e('0x40')](handleError(_0xf3506e,null));};exports[_0x9e5e('0x20')]=function(_0x3111e9,_0x39aa42){if(_0x3111e9['body']['uniqueid']){delete _0x3111e9[_0x9e5e('0x46')][_0x9e5e('0x47')];}return db['CmHopperHistory'][_0x9e5e('0x43')]({'where':{'uniqueid':_0x3111e9[_0x9e5e('0x48')]['id']}})[_0x9e5e('0x21')](handleEntityNotFound(_0x39aa42,null))[_0x9e5e('0x21')](saveUpdates(_0x3111e9[_0x9e5e('0x46')],null))['then'](respondWithResult(_0x39aa42,null))['catch'](handleError(_0x39aa42,null));}; \ No newline at end of file +var _0x5585=['fields','include','CmHopperHistory','find','create','body','catch','describe','update','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params'];(function(_0x3ee944,_0x4d5f2f){var _0x1a36d1=function(_0xdeebaf){while(--_0xdeebaf){_0x3ee944['push'](_0x3ee944['shift']());}};_0x1a36d1(++_0x4d5f2f);}(_0x5585,0x190));var _0x5558=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5585[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x5558('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5558('0x1'));var jsonpatch=require(_0x5558('0x2'));var rp=require(_0x5558('0x3'));var moment=require(_0x5558('0x4'));var BPromise=require(_0x5558('0x5'));var Mustache=require(_0x5558('0x6'));var util=require(_0x5558('0x7'));var path=require('path');var sox=require(_0x5558('0x8'));var csv=require(_0x5558('0x9'));var ejs=require(_0x5558('0xa'));var fs=require('fs');var fs_extra=require(_0x5558('0xb'));var _=require(_0x5558('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5558('0xd'));var toCsv=require(_0x5558('0x9'));var querystring=require(_0x5558('0xe'));var Papa=require(_0x5558('0xf'));var Redis=require(_0x5558('0x10'));var authService=require(_0x5558('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5558('0x12'));var logger=require('../../config/logger')(_0x5558('0x13'));var utils=require(_0x5558('0x14'));var config=require(_0x5558('0x15'));var licenseUtil=require(_0x5558('0x16'));var db=require(_0x5558('0x17'))['db'];function respondWithStatusCode(_0x260070,_0xcd2d6d){_0xcd2d6d=_0xcd2d6d||0xcc;return function(_0x4c83af){if(_0x4c83af){return _0x260070[_0x5558('0x18')](_0xcd2d6d);}return _0x260070[_0x5558('0x19')](_0xcd2d6d)[_0x5558('0x1a')]();};}function respondWithResult(_0x45dd5e,_0x4cda81){_0x4cda81=_0x4cda81||0xc8;return function(_0x20c89d){if(_0x20c89d){return _0x45dd5e[_0x5558('0x19')](_0x4cda81)[_0x5558('0x1b')](_0x20c89d);}};}function respondWithFilteredResult(_0x1a19f5,_0x5c12ee){return function(_0x5a008a){if(_0x5a008a){var _0x2cc8bd=typeof _0x5c12ee[_0x5558('0x1c')]===_0x5558('0x1d')&&typeof _0x5c12ee['limit']===_0x5558('0x1d');var _0x19df92=_0x5a008a[_0x5558('0x1e')];var _0x30a30c=_0x2cc8bd?0x0:_0x5c12ee[_0x5558('0x1c')];var _0x38ba3a=_0x2cc8bd?_0x5a008a['count']:_0x5c12ee[_0x5558('0x1c')]+_0x5c12ee[_0x5558('0x1f')];var _0x35aba0;if(_0x38ba3a>=_0x19df92){_0x38ba3a=_0x19df92;_0x35aba0=0xc8;}else{_0x35aba0=0xce;}_0x1a19f5[_0x5558('0x19')](_0x35aba0);return _0x1a19f5[_0x5558('0x20')](_0x5558('0x21'),_0x30a30c+'-'+_0x38ba3a+'/'+_0x19df92)[_0x5558('0x1b')](_0x5a008a);}return null;};}function patchUpdates(_0x5c43ed){return function(_0x310d6a){try{jsonpatch['apply'](_0x310d6a,_0x5c43ed,!![]);}catch(_0xe56db1){return BPromise['reject'](_0xe56db1);}return _0x310d6a[_0x5558('0x22')]();};}function saveUpdates(_0x1390dc,_0x14bdd6){return function(_0x1da5de){if(_0x1da5de){return _0x1da5de['update'](_0x1390dc)[_0x5558('0x23')](function(_0x2cd2fd){return _0x2cd2fd;});}return null;};}function removeEntity(_0x4c8927,_0x6314f9){return function(_0x11c14a){if(_0x11c14a){return _0x11c14a[_0x5558('0x24')]()[_0x5558('0x23')](function(){_0x4c8927[_0x5558('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x348fda,_0x2ebed1){return function(_0x52293e){if(!_0x52293e){_0x348fda['sendStatus'](0x194);}return _0x52293e;};}function handleError(_0x13216f,_0x3e210c){_0x3e210c=_0x3e210c||0x1f4;return function(_0x1cff76){logger[_0x5558('0x25')](_0x1cff76[_0x5558('0x26')]);if(_0x1cff76['name']){delete _0x1cff76[_0x5558('0x27')];}_0x13216f[_0x5558('0x19')](_0x3e210c)[_0x5558('0x28')](_0x1cff76);};}exports[_0x5558('0x29')]=function(_0x3700d8,_0x32d08e){var _0xf0c671={},_0x35adb2={},_0x175859={'count':0x0,'rows':[]};var _0x6e0a41=_[_0x5558('0x2a')](db['CmHopperHistory'][_0x5558('0x2b')],function(_0x540cb7){return{'name':_0x540cb7['fieldName'],'type':_0x540cb7[_0x5558('0x2c')][_0x5558('0x2d')]};});_0x35adb2[_0x5558('0x2e')]=_['map'](_0x6e0a41,_0x5558('0x27'));_0x35adb2[_0x5558('0x2f')]=_[_0x5558('0x30')](_0x3700d8[_0x5558('0x2f')]);_0x35adb2[_0x5558('0x31')]=_[_0x5558('0x32')](_0x35adb2[_0x5558('0x2e')],_0x35adb2[_0x5558('0x2f')]);_0xf0c671[_0x5558('0x33')]=_[_0x5558('0x32')](_0x35adb2['model'],qs['fields'](_0x3700d8[_0x5558('0x2f')]['fields']));_0xf0c671[_0x5558('0x33')]=_0xf0c671['attributes'][_0x5558('0x34')]?_0xf0c671[_0x5558('0x33')]:_0x35adb2[_0x5558('0x2e')];if(!_0x3700d8[_0x5558('0x2f')][_0x5558('0x35')](_0x5558('0x36'))){_0xf0c671[_0x5558('0x1f')]=qs[_0x5558('0x1f')](_0x3700d8[_0x5558('0x2f')][_0x5558('0x1f')]);_0xf0c671['offset']=qs[_0x5558('0x1c')](_0x3700d8[_0x5558('0x2f')][_0x5558('0x1c')]);}_0xf0c671[_0x5558('0x37')]=qs[_0x5558('0x38')](_0x3700d8[_0x5558('0x2f')][_0x5558('0x38')]);_0xf0c671[_0x5558('0x39')]=qs[_0x5558('0x31')](_[_0x5558('0x3a')](_0x3700d8[_0x5558('0x2f')],_0x35adb2[_0x5558('0x31')]),_0x6e0a41);if(_0x3700d8[_0x5558('0x2f')][_0x5558('0x3b')]){_0xf0c671[_0x5558('0x39')]=_[_0x5558('0x3c')](_0xf0c671['where'],{'$or':_[_0x5558('0x2a')](_0x6e0a41,function(_0x201667){if(_0x201667['type']!==_0x5558('0x3d')){var _0x1463b6={};_0x1463b6[_0x201667['name']]={'$like':'%'+_0x3700d8[_0x5558('0x2f')][_0x5558('0x3b')]+'%'};return _0x1463b6;}})});}_0xf0c671=_[_0x5558('0x3c')]({},_0xf0c671,_0x3700d8[_0x5558('0x3e')]);var _0x3c66dd={'where':_0xf0c671[_0x5558('0x39')]};return db['CmHopperHistory']['count'](_0x3c66dd)[_0x5558('0x23')](function(_0x5b3ddb){_0x175859[_0x5558('0x1e')]=_0x5b3ddb;if(_0x3700d8['query'][_0x5558('0x3f')]){_0xf0c671['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x5558('0x40')](_0xf0c671);})[_0x5558('0x23')](function(_0x17b5a3){_0x175859[_0x5558('0x41')]=_0x17b5a3;return _0x175859;})[_0x5558('0x23')](respondWithFilteredResult(_0x32d08e,_0xf0c671))['catch'](handleError(_0x32d08e,null));};exports[_0x5558('0x42')]=function(_0x369eae,_0x1ea435){var _0x393254={'raw':!![],'where':{'id':_0x369eae[_0x5558('0x43')]['id']}},_0x49df20={};_0x49df20[_0x5558('0x2e')]=_[_0x5558('0x30')](db['CmHopperHistory'][_0x5558('0x2b')]);_0x49df20['query']=_[_0x5558('0x30')](_0x369eae[_0x5558('0x2f')]);_0x49df20[_0x5558('0x31')]=_[_0x5558('0x32')](_0x49df20[_0x5558('0x2e')],_0x49df20[_0x5558('0x2f')]);_0x393254[_0x5558('0x33')]=_['intersection'](_0x49df20[_0x5558('0x2e')],qs[_0x5558('0x44')](_0x369eae[_0x5558('0x2f')][_0x5558('0x44')]));_0x393254[_0x5558('0x33')]=_0x393254['attributes'][_0x5558('0x34')]?_0x393254['attributes']:_0x49df20[_0x5558('0x2e')];if(_0x369eae['query'][_0x5558('0x3f')]){_0x393254[_0x5558('0x45')]=[{'all':!![]}];}_0x393254=_[_0x5558('0x3c')]({},_0x393254,_0x369eae['options']);return db[_0x5558('0x46')][_0x5558('0x47')](_0x393254)[_0x5558('0x23')](handleEntityNotFound(_0x1ea435,null))['then'](respondWithResult(_0x1ea435,null))['catch'](handleError(_0x1ea435,null));};exports[_0x5558('0x48')]=function(_0x4ffc67,_0x167257){return db[_0x5558('0x46')][_0x5558('0x48')](_0x4ffc67[_0x5558('0x49')],{})[_0x5558('0x23')](respondWithResult(_0x167257,0xc9))[_0x5558('0x4a')](handleError(_0x167257,null));};exports[_0x5558('0x4b')]=function(_0x41f21e,_0x38cb93){return db['CmHopperHistory']['describe']()[_0x5558('0x23')](respondWithResult(_0x38cb93,null))[_0x5558('0x4a')](handleError(_0x38cb93,null));};exports[_0x5558('0x4c')]=function(_0x39fe3d,_0x388a45){if(_0x39fe3d['body'][_0x5558('0x4d')]){delete _0x39fe3d[_0x5558('0x49')][_0x5558('0x4d')];}return db[_0x5558('0x46')][_0x5558('0x47')]({'where':{'uniqueid':_0x39fe3d[_0x5558('0x43')]['id']}})[_0x5558('0x23')](handleEntityNotFound(_0x388a45,null))[_0x5558('0x23')](saveUpdates(_0x39fe3d['body'],null))[_0x5558('0x23')](respondWithResult(_0x388a45,null))[_0x5558('0x4a')](handleError(_0x388a45,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 82cc396..667129a 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 _0xdf5d=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x5a8b40,_0x4e403d){var _0x478346=function(_0x513b2d){while(--_0x513b2d){_0x5a8b40['push'](_0x5a8b40['shift']());}};_0x478346(++_0x4e403d);}(_0xdf5d,0x126));var _0xddf5=function(_0x369091,_0x574725){_0x369091=_0x369091-0x0;var _0x418677=_0xdf5d[_0x369091];return _0x418677;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var logger=require(_0xddf5('0x2'))(_0xddf5('0x3'));var moment=require(_0xddf5('0x4'));var BPromise=require(_0xddf5('0x5'));var rp=require(_0xddf5('0x6'));var fs=require('fs');var path=require(_0xddf5('0x7'));var rimraf=require('rimraf');var config=require(_0xddf5('0x8'));var attributes=require(_0xddf5('0x9'));module[_0xddf5('0xa')]=function(_0x3dc7dc,_0x3335b5){return _0x3dc7dc[_0xddf5('0xb')](_0xddf5('0xc'),attributes,{'tableName':_0xddf5('0xd'),'paranoid':![],'indexes':[{'name':_0xddf5('0xe'),'fields':[_0xddf5('0xe')]},{'name':_0xddf5('0xf'),'fields':[_0xddf5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb5f3=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2c1aa8,_0x3e0609){_0x2c1aa8=_0x2c1aa8-0x0;var _0x4019f5=_0xb5f3[_0x2c1aa8];return _0x4019f5;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var logger=require(_0x3b5f('0x2'))('api');var moment=require(_0x3b5f('0x3'));var BPromise=require(_0x3b5f('0x4'));var rp=require(_0x3b5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b5f('0x6'));var attributes=require(_0x3b5f('0x7'));module[_0x3b5f('0x8')]=function(_0x42d102,_0x55c7b4){return _0x42d102[_0x3b5f('0x9')](_0x3b5f('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x3b5f('0xb'),'fields':['endtime']},{'name':_0x3b5f('0xc'),'fields':[_0x3b5f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6c03b47..cdec460 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 _0xd957=['options','raw','stringify','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body'];(function(_0x4214da,_0x586705){var _0x64da0=function(_0x273e00){while(--_0x273e00){_0x4214da['push'](_0x4214da['shift']());}};_0x64da0(++_0x586705);}(_0xd957,0x153));var _0x7d95=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd957[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var moment=require('moment');var BPromise=require(_0x7d95('0x2'));var rs=require(_0x7d95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d95('0x4'))['db'];var utils=require(_0x7d95('0x5'));var logger=require(_0x7d95('0x6'))(_0x7d95('0x7'));var config=require(_0x7d95('0x8'));var jayson=require(_0x7d95('0x9'));var client=jayson[_0x7d95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181ca5,_0x11bb29,_0x4f10ec){return new BPromise(function(_0xfd14f6,_0x399d23){return client[_0x7d95('0xb')](_0x181ca5,_0x4f10ec)[_0x7d95('0xc')](function(_0x173838){logger['info'](_0x7d95('0xd'),_0x11bb29,_0x7d95('0xe'));logger[_0x7d95('0xf')](_0x7d95('0x10'),_0x11bb29,_0x7d95('0xe'),JSON['stringify'](_0x173838));if(_0x173838['error']){if(_0x173838[_0x7d95('0x11')][_0x7d95('0x12')]===0x1f4){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);return _0x399d23(_0x173838[_0x7d95('0x11')][_0x7d95('0x13')]);}logger[_0x7d95('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x11bb29,_0x173838[_0x7d95('0x11')]['message']);return _0xfd14f6(_0x173838[_0x7d95('0x11')]['message']);}else{logger[_0x7d95('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x11bb29,_0x7d95('0xe'));_0xfd14f6(_0x173838[_0x7d95('0x15')][_0x7d95('0x13')]);}})[_0x7d95('0x16')](function(_0x5ab72e){logger['error'](_0x7d95('0xd'),_0x11bb29,_0x5ab72e);_0x399d23(_0x5ab72e);});});}exports[_0x7d95('0x17')]=function(_0x7aded7){var _0x33a7ab=this;return new Promise(function(_0x57197c,_0x1c656c){return db[_0x7d95('0x18')]['create'](_0x7aded7[_0x7d95('0x19')],{'raw':_0x7aded7[_0x7d95('0x1a')]?_0x7aded7[_0x7d95('0x1a')][_0x7d95('0x1b')]===undefined?!![]:![]:!![]})[_0x7d95('0xc')](function(_0x1a058c){logger[_0x7d95('0x14')](_0x7d95('0x17'),_0x7aded7);logger[_0x7d95('0xf')]('CreateCmHopperHistory',_0x7aded7,JSON[_0x7d95('0x1c')](_0x1a058c));_0x57197c(_0x1a058c);})['catch'](function(_0x1e2b58){logger['error']('CreateCmHopperHistory',_0x1e2b58[_0x7d95('0x13')],_0x7aded7);_0x1c656c(_0x33a7ab[_0x7d95('0x11')](0x1f4,_0x1e2b58[_0x7d95('0x13')]));});});};exports['AvgHandleTime']=function(_0x2f54c4){var _0xd7d5=this;return new Promise(function(_0x49e92f,_0x1938a5){return db['CmHopperHistory']['findAll']({'raw':_0x2f54c4['options']?_0x2f54c4[_0x7d95('0x1a')][_0x7d95('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f54c4['options']?_0x2f54c4[_0x7d95('0x1a')][_0x7d95('0x1d')]||null:null,'attributes':[[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')][_0x7d95('0x1f')]('id')),_0x7d95('0x20')],[db['sequelize']['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x23')))),_0x7d95('0x24')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x26')))),_0x7d95('0x27')],[db[_0x7d95('0x1e')]['fn']('AVG',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x28')))),_0x7d95('0x29')],[db[_0x7d95('0x1e')]['fn']('AVG',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x7d95('0x2a')]]})[_0x7d95('0xc')](function(_0x53a458){logger[_0x7d95('0x14')](_0x7d95('0x2b'),_0x2f54c4);logger[_0x7d95('0xf')](_0x7d95('0x2b'),_0x2f54c4,JSON[_0x7d95('0x1c')](_0x53a458));_0x49e92f(_0x53a458);})[_0x7d95('0x16')](function(_0x1a58e0){logger['error'](_0x7d95('0x2b'),_0x1a58e0[_0x7d95('0x13')],_0x2f54c4);_0x1938a5(_0xd7d5[_0x7d95('0x11')](0x1f4,_0x1a58e0['message']));});});};exports[_0x7d95('0x2c')]=function(_0x247ff2){var _0x5a7dc1=this;return new Promise(function(_0x22735c,_0x283e74){return db[_0x7d95('0x18')][_0x7d95('0x2d')]({'raw':_0x247ff2['options']?_0x247ff2['options']['raw']===undefined?!![]:![]:!![],'where':_0x247ff2['options']?_0x247ff2['options']['where']||null:null,'attributes':[['campaign',_0x7d95('0x2e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x2f')))),_0x7d95('0x30')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x31')))),_0x7d95('0x32')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x23')))),_0x7d95('0x33')],[db['sequelize']['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db['sequelize'][_0x7d95('0x22')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x34')))),_0x7d95('0x35')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db['sequelize']['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x36')))),_0x7d95('0x37')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x38')))),_0x7d95('0x39')],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x3a')))),_0x7d95('0x3b')],[db[_0x7d95('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x7d95('0x3c')],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x3d')))),_0x7d95('0x3e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x3f')))),'outboundRejectCallsDay'],[db[_0x7d95('0x1e')]['fn']('COUNT',db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x40')))),_0x7d95('0x41')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')]['literal'](_0x7d95('0x42')))),_0x7d95('0x43')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x44')))),_0x7d95('0x45')]],'group':[_0x7d95('0x46')]})[_0x7d95('0xc')](function(_0x2e927b){logger[_0x7d95('0x14')](_0x7d95('0x2c'),_0x247ff2);logger['debug'](_0x7d95('0x2c'),_0x247ff2,JSON[_0x7d95('0x1c')](_0x2e927b));_0x22735c(_0x2e927b);})[_0x7d95('0x16')](function(_0x3b0987){logger[_0x7d95('0x11')](_0x7d95('0x2c'),_0x3b0987[_0x7d95('0x13')],_0x247ff2);_0x283e74(_0x5a7dc1[_0x7d95('0x11')](0x1f4,_0x3b0987[_0x7d95('0x13')]));});});};exports[_0x7d95('0x47')]=function(_0x29b971){var _0x280247=this;return new Promise(function(_0x194b36,_0x1534e9){return db[_0x7d95('0x18')][_0x7d95('0x2d')]({'raw':_0x29b971['options']?_0x29b971['options'][_0x7d95('0x1b')]===undefined?!![]:![]:!![],'where':_0x29b971[_0x7d95('0x1a')]?_0x29b971[_0x7d95('0x1a')]['where']||null:null,'attributes':[[_0x7d95('0x46'),_0x7d95('0x2e')],[db[_0x7d95('0x1e')]['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')][_0x7d95('0x1f')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x7d95('0x21'),db[_0x7d95('0x1e')]['fn']('IF',db[_0x7d95('0x1e')][_0x7d95('0x22')](_0x7d95('0x23')))),_0x7d95('0x48')]],'group':['campaign']})[_0x7d95('0xc')](function(_0x5fae0a){logger[_0x7d95('0x14')](_0x7d95('0x47'),_0x29b971);logger[_0x7d95('0xf')]('GetCampaignHopperHistory',_0x29b971,JSON[_0x7d95('0x1c')](_0x5fae0a));_0x194b36(_0x5fae0a);})[_0x7d95('0x16')](function(_0x3c1a6c){logger[_0x7d95('0x11')](_0x7d95('0x47'),_0x3c1a6c[_0x7d95('0x13')],_0x29b971);_0x1534e9(_0x280247[_0x7d95('0x11')](0x1f4,_0x3c1a6c[_0x7d95('0x13')]));});});}; \ No newline at end of file +var _0xe0d7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','stringify','AvgHandleTime','findAll','options','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','util','bluebird','randomstring'];(function(_0x1ed4eb,_0x45692e){var _0x3450e7=function(_0x4e618e){while(--_0x4e618e){_0x1ed4eb['push'](_0x1ed4eb['shift']());}};_0x3450e7(++_0x45692e);}(_0xe0d7,0x1e0));var _0x7e0d=function(_0x5acef4,_0x434e7c){_0x5acef4=_0x5acef4-0x0;var _0x5bf891=_0xe0d7[_0x5acef4];return _0x5bf891;};'use strict';var _=require('lodash');var util=require(_0x7e0d('0x0'));var moment=require('moment');var BPromise=require(_0x7e0d('0x1'));var rs=require(_0x7e0d('0x2'));var fs=require('fs');var Redis=require(_0x7e0d('0x3'));var db=require(_0x7e0d('0x4'))['db'];var utils=require(_0x7e0d('0x5'));var logger=require(_0x7e0d('0x6'))(_0x7e0d('0x7'));var config=require(_0x7e0d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x71294c,_0x42cfd7,_0x3bf7e2){return new BPromise(function(_0x1839fd,_0x1b8a71){return client[_0x7e0d('0xa')](_0x71294c,_0x3bf7e2)[_0x7e0d('0xb')](function(_0x34e8e9){logger[_0x7e0d('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x42cfd7,_0x7e0d('0xd'));logger[_0x7e0d('0xe')](_0x7e0d('0xf'),_0x42cfd7,'request\x20sent',JSON['stringify'](_0x34e8e9));if(_0x34e8e9['error']){if(_0x34e8e9[_0x7e0d('0x10')][_0x7e0d('0x11')]===0x1f4){logger[_0x7e0d('0x10')](_0x7e0d('0x12'),_0x42cfd7,_0x34e8e9[_0x7e0d('0x10')]['message']);return _0x1b8a71(_0x34e8e9['error'][_0x7e0d('0x13')]);}logger['error'](_0x7e0d('0x12'),_0x42cfd7,_0x34e8e9['error'][_0x7e0d('0x13')]);return _0x1839fd(_0x34e8e9[_0x7e0d('0x10')][_0x7e0d('0x13')]);}else{logger[_0x7e0d('0xc')](_0x7e0d('0x12'),_0x42cfd7,_0x7e0d('0xd'));_0x1839fd(_0x34e8e9['result'][_0x7e0d('0x13')]);}})[_0x7e0d('0x14')](function(_0x1b6161){logger[_0x7e0d('0x10')](_0x7e0d('0x12'),_0x42cfd7,_0x1b6161);_0x1b8a71(_0x1b6161);});});}exports[_0x7e0d('0x15')]=function(_0x366a22){var _0x589954=this;return new Promise(function(_0x584561,_0x178924){return db[_0x7e0d('0x16')][_0x7e0d('0x17')](_0x366a22[_0x7e0d('0x18')],{'raw':_0x366a22['options']?_0x366a22['options'][_0x7e0d('0x19')]===undefined?!![]:![]:!![]})[_0x7e0d('0xb')](function(_0xa3218c){logger[_0x7e0d('0xc')](_0x7e0d('0x15'),_0x366a22);logger[_0x7e0d('0xe')]('CreateCmHopperHistory',_0x366a22,JSON[_0x7e0d('0x1a')](_0xa3218c));_0x584561(_0xa3218c);})[_0x7e0d('0x14')](function(_0x516c0f){logger[_0x7e0d('0x10')](_0x7e0d('0x15'),_0x516c0f[_0x7e0d('0x13')],_0x366a22);_0x178924(_0x589954[_0x7e0d('0x10')](0x1f4,_0x516c0f[_0x7e0d('0x13')]));});});};exports[_0x7e0d('0x1b')]=function(_0x55d957){var _0x29e863=this;return new Promise(function(_0x472b4f,_0xbef3b9){return db[_0x7e0d('0x16')][_0x7e0d('0x1c')]({'raw':_0x55d957[_0x7e0d('0x1d')]?_0x55d957[_0x7e0d('0x1d')][_0x7e0d('0x19')]===undefined?!![]:![]:!![],'where':_0x55d957[_0x7e0d('0x1d')]?_0x55d957[_0x7e0d('0x1d')][_0x7e0d('0x1e')]||null:null,'attributes':[[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')][_0x7e0d('0x21')]('id')),_0x7e0d('0x22')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db['sequelize'][_0x7e0d('0x23')](_0x7e0d('0x24')))),_0x7e0d('0x25')],[db[_0x7e0d('0x1f')]['fn']('COUNT',db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x7e0d('0x26')],[db[_0x7e0d('0x1f')]['fn']('COUNT',db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0x7e0d('0x27')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x28'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x29')))),_0x7e0d('0x2a')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x28'),db['sequelize']['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x2b')))),'predictiveIntervalAvgTalktime']]})[_0x7e0d('0xb')](function(_0x59acbd){logger[_0x7e0d('0xc')](_0x7e0d('0x1b'),_0x55d957);logger[_0x7e0d('0xe')](_0x7e0d('0x1b'),_0x55d957,JSON['stringify'](_0x59acbd));_0x472b4f(_0x59acbd);})[_0x7e0d('0x14')](function(_0x1af801){logger[_0x7e0d('0x10')](_0x7e0d('0x1b'),_0x1af801[_0x7e0d('0x13')],_0x55d957);_0xbef3b9(_0x29e863[_0x7e0d('0x10')](0x1f4,_0x1af801[_0x7e0d('0x13')]));});});};exports[_0x7e0d('0x2c')]=function(_0x359b1c){var _0xf99168=this;return new Promise(function(_0x527576,_0x5c36ed){return db[_0x7e0d('0x16')][_0x7e0d('0x1c')]({'raw':_0x359b1c[_0x7e0d('0x1d')]?_0x359b1c[_0x7e0d('0x1d')][_0x7e0d('0x19')]===undefined?!![]:![]:!![],'where':_0x359b1c[_0x7e0d('0x1d')]?_0x359b1c[_0x7e0d('0x1d')][_0x7e0d('0x1e')]||null:null,'attributes':[[_0x7e0d('0x2d'),_0x7e0d('0x2e')],[db['sequelize']['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x7e0d('0x2f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7e0d('0x1f')]['literal'](_0x7e0d('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db['sequelize']['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x24')))),'outboundAnswerCallsDay'],[db[_0x7e0d('0x1f')]['fn']('COUNT',db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x31')))),_0x7e0d('0x32')],[db[_0x7e0d('0x1f')]['fn']('COUNT',db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x33')))),_0x7e0d('0x34')],[db['sequelize']['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db['sequelize'][_0x7e0d('0x23')](_0x7e0d('0x35')))),_0x7e0d('0x36')],[db['sequelize']['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db['sequelize'][_0x7e0d('0x23')](_0x7e0d('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x38')))),'outboundUnknownCallsDay'],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x39')))),_0x7e0d('0x3a')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x7e0d('0x3b')))),_0x7e0d('0x3c')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db['sequelize']['fn']('IF',db[_0x7e0d('0x1f')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x7e0d('0x3d')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db['sequelize']['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x3e')))),_0x7e0d('0x3f')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x40')))),_0x7e0d('0x3d')],[db['sequelize']['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')](_0x7e0d('0x41')))),_0x7e0d('0x42')]],'group':['campaign']})[_0x7e0d('0xb')](function(_0x4e3750){logger[_0x7e0d('0xc')](_0x7e0d('0x2c'),_0x359b1c);logger[_0x7e0d('0xe')](_0x7e0d('0x2c'),_0x359b1c,JSON[_0x7e0d('0x1a')](_0x4e3750));_0x527576(_0x4e3750);})[_0x7e0d('0x14')](function(_0x444433){logger['error']('GetVoiceQueueHopperHistory',_0x444433[_0x7e0d('0x13')],_0x359b1c);_0x5c36ed(_0xf99168['error'](0x1f4,_0x444433['message']));});});};exports[_0x7e0d('0x43')]=function(_0x21ac55){var _0xeda54e=this;return new Promise(function(_0x147054,_0x1964cf){return db[_0x7e0d('0x16')]['findAll']({'raw':_0x21ac55[_0x7e0d('0x1d')]?_0x21ac55[_0x7e0d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x21ac55['options']?_0x21ac55[_0x7e0d('0x1d')][_0x7e0d('0x1e')]||null:null,'attributes':[[_0x7e0d('0x2d'),_0x7e0d('0x2e')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')][_0x7e0d('0x21')]('id')),_0x7e0d('0x44')],[db[_0x7e0d('0x1f')]['fn'](_0x7e0d('0x20'),db[_0x7e0d('0x1f')]['fn']('IF',db[_0x7e0d('0x1f')][_0x7e0d('0x23')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x7e0d('0x2d')]})[_0x7e0d('0xb')](function(_0x50a034){logger[_0x7e0d('0xc')]('GetCampaignHopperHistory',_0x21ac55);logger[_0x7e0d('0xe')](_0x7e0d('0x43'),_0x21ac55,JSON[_0x7e0d('0x1a')](_0x50a034));_0x147054(_0x50a034);})[_0x7e0d('0x14')](function(_0x612db){logger[_0x7e0d('0x10')](_0x7e0d('0x43'),_0x612db[_0x7e0d('0x13')],_0x21ac55);_0x1964cf(_0xeda54e[_0x7e0d('0x10')](0x1f4,_0x612db[_0x7e0d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3e2ea37..2ca0535 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 _0x3bb0=['multer','util','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','exports'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x3bb0,0x143));var _0x03bb=function(_0x59d271,_0x4ec708){_0x59d271=_0x59d271-0x0;var _0xd413f=_0x3bb0[_0x59d271];return _0xd413f;};'use strict';var multer=require(_0x03bb('0x0'));var util=require(_0x03bb('0x1'));var path=require('path');var timeout=require(_0x03bb('0x2'));var express=require('express');var router=express[_0x03bb('0x3')]();var fs_extra=require(_0x03bb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03bb('0x5'));var controller=require(_0x03bb('0x6'));router[_0x03bb('0x7')]('/',auth[_0x03bb('0x8')](),controller[_0x03bb('0x9')]);router[_0x03bb('0x7')](_0x03bb('0xa'),auth[_0x03bb('0x8')](),controller[_0x03bb('0xb')]);router[_0x03bb('0x7')](_0x03bb('0xc'),auth['isAuthenticated'](),controller[_0x03bb('0xd')]);router[_0x03bb('0xe')]('/',auth[_0x03bb('0x8')](),controller['create']);router[_0x03bb('0xf')](_0x03bb('0xc'),auth[_0x03bb('0x8')](),controller['update']);module[_0x03bb('0x10')]=router; \ No newline at end of file +var _0xf722=['../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','multer','connect-timeout','Router'];(function(_0x7a8eed,_0x281066){var _0x2e92c7=function(_0x58c258){while(--_0x58c258){_0x7a8eed['push'](_0x7a8eed['shift']());}};_0x2e92c7(++_0x281066);}(_0xf722,0x15b));var _0x2f72=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf722[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x2f72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2f72('0x1'));var express=require('express');var router=express[_0x2f72('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2f72('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2f72('0x4'));var controller=require(_0x2f72('0x5'));router[_0x2f72('0x6')]('/',auth[_0x2f72('0x7')](),controller[_0x2f72('0x8')]);router[_0x2f72('0x6')](_0x2f72('0x9'),auth[_0x2f72('0x7')](),controller['describe']);router[_0x2f72('0x6')](_0x2f72('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2f72('0xb')]('/',auth['isAuthenticated'](),controller[_0x2f72('0xc')]);router['put']('/:id',auth[_0x2f72('0x7')](),controller[_0x2f72('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f3e14c4..d459b10 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 _0xd847=['STRING','name','sequelize','exports'];(function(_0x31ea15,_0x40f11c){var _0x317e97=function(_0x306770){while(--_0x306770){_0x31ea15['push'](_0x31ea15['shift']());}};_0x317e97(++_0x40f11c);}(_0xd847,0x18a));var _0x7d84=function(_0xaab1be,_0x1ffce6){_0xaab1be=_0xaab1be-0x0;var _0xd3a4e8=_0xd847[_0xaab1be];return _0xd3a4e8;};'use strict';var Sequelize=require(_0x7d84('0x0'));module[_0x7d84('0x1')]={'name':{'type':Sequelize[_0x7d84('0x2')],'unique':_0x7d84('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbdfd=['sequelize','name','STRING'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xbdfd,0x135));var _0xdbdf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbdfd[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xdbdf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdbdf('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdbdf('0x2')]},'dialPrefix':{'type':Sequelize[_0xdbdf('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 458383e..0cf14ca 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 _0xb59c=['defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','error','stack','name','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','include','CmList','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','keys','hasOwnProperty','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','each','omit','success','push','dataValues','errors','message','CustomFields','concat','format','options','getContactsCsv','CmCustomField','cf_%d','raw','getContacts','isEmpty','now','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb59c,0x1b8));var _0xcb59=function(_0x508b25,_0x1616eb){_0x508b25=_0x508b25-0x0;var _0x3b81eb=_0xb59c[_0x508b25];return _0x3b81eb;};'use strict';var emlformat=require(_0xcb59('0x0'));var rimraf=require(_0xcb59('0x1'));var zipdir=require(_0xcb59('0x2'));var jsonpatch=require(_0xcb59('0x3'));var rp=require(_0xcb59('0x4'));var moment=require(_0xcb59('0x5'));var BPromise=require(_0xcb59('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcb59('0x7'));var csv=require(_0xcb59('0x8'));var ejs=require(_0xcb59('0x9'));var fs=require('fs');var fs_extra=require(_0xcb59('0xa'));var _=require(_0xcb59('0xb'));var squel=require(_0xcb59('0xc'));var crypto=require('crypto');var jsforce=require(_0xcb59('0xd'));var deskjs=require(_0xcb59('0xe'));var toCsv=require(_0xcb59('0x8'));var querystring=require('querystring');var Papa=require(_0xcb59('0xf'));var Redis=require(_0xcb59('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb59('0x11'));var as=require(_0xcb59('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb59('0x13'))(_0xcb59('0x14'));var utils=require(_0xcb59('0x15'));var config=require(_0xcb59('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb59('0x17'))['db'];config['redis']=_[_0xcb59('0x18')](config[_0xcb59('0x19')],{'host':_0xcb59('0x1a'),'port':0x18eb});var socket=require(_0xcb59('0x1b'))(new Redis(config['redis']));require(_0xcb59('0x1c'))['register'](socket);function respondWithStatusCode(_0x18ba52,_0xe33710){_0xe33710=_0xe33710||0xcc;return function(_0x2038e7){if(_0x2038e7){return _0x18ba52[_0xcb59('0x1d')](_0xe33710);}return _0x18ba52[_0xcb59('0x1e')](_0xe33710)[_0xcb59('0x1f')]();};}function respondWithResult(_0x41b00b,_0xaa6fd2){_0xaa6fd2=_0xaa6fd2||0xc8;return function(_0x2a6c3f){if(_0x2a6c3f){return _0x41b00b[_0xcb59('0x1e')](_0xaa6fd2)['json'](_0x2a6c3f);}};}function respondWithFilteredResult(_0x426997,_0x44475c){return function(_0x2aedd0){if(_0x2aedd0){var _0x52c8e5=typeof _0x44475c[_0xcb59('0x20')]===_0xcb59('0x21')&&typeof _0x44475c[_0xcb59('0x22')]===_0xcb59('0x21');var _0x8b8e40=_0x2aedd0[_0xcb59('0x23')];var _0x3953b3=_0x52c8e5?0x0:_0x44475c[_0xcb59('0x20')];var _0x2a56c5=_0x52c8e5?_0x2aedd0[_0xcb59('0x23')]:_0x44475c[_0xcb59('0x20')]+_0x44475c[_0xcb59('0x22')];var _0x5c2e04;if(_0x2a56c5>=_0x8b8e40){_0x2a56c5=_0x8b8e40;_0x5c2e04=0xc8;}else{_0x5c2e04=0xce;}_0x426997[_0xcb59('0x1e')](_0x5c2e04);return _0x426997[_0xcb59('0x24')](_0xcb59('0x25'),_0x3953b3+'-'+_0x2a56c5+'/'+_0x8b8e40)[_0xcb59('0x26')](_0x2aedd0);}return null;};}function patchUpdates(_0x3e4697){return function(_0x134739){try{jsonpatch[_0xcb59('0x27')](_0x134739,_0x3e4697,!![]);}catch(_0x15e7e2){return BPromise[_0xcb59('0x28')](_0x15e7e2);}return _0x134739[_0xcb59('0x29')]();};}function saveUpdates(_0x2fffff,_0x5f2364){return function(_0x4dd599){if(_0x4dd599){return _0x4dd599[_0xcb59('0x2a')](_0x2fffff)[_0xcb59('0x2b')](function(_0x182069){return _0x182069;});}return null;};}function removeEntity(_0x1c1463,_0xef2035){return function(_0x4d67e1){if(_0x4d67e1){return _0x4d67e1[_0xcb59('0x2c')]()['then'](function(){var _0x17ca9a=_0x4d67e1[_0xcb59('0x2d')]({'plain':!![]});var _0x4d2223=_0xcb59('0x2e');return db['UserProfileResource'][_0xcb59('0x2c')]({'where':{'type':_0x4d2223,'resourceId':_0x17ca9a['id']}})['then'](function(){return _0x4d67e1;});})[_0xcb59('0x2b')](function(){_0x1c1463[_0xcb59('0x1e')](0xcc)[_0xcb59('0x1f')]();});}};}function handleEntityNotFound(_0x46b40d,_0x4edb48){return function(_0x2c47ee){if(!_0x2c47ee){_0x46b40d[_0xcb59('0x1d')](0x194);}return _0x2c47ee;};}function handleError(_0x2721a5,_0x29c9cb){_0x29c9cb=_0x29c9cb||0x1f4;return function(_0x294989){logger[_0xcb59('0x2f')](_0x294989[_0xcb59('0x30')]);if(_0x294989[_0xcb59('0x31')]){delete _0x294989[_0xcb59('0x31')];}_0x2721a5[_0xcb59('0x1e')](_0x29c9cb)['send'](_0x294989);};}exports['index']=function(_0x43866c,_0x1c1eee){var _0x26dff1={},_0x454472={},_0x24889d={'count':0x0,'rows':[]};var _0x5b3387=_[_0xcb59('0x32')](db['CmList'][_0xcb59('0x33')],function(_0x3eb61d){return{'name':_0x3eb61d[_0xcb59('0x34')],'type':_0x3eb61d[_0xcb59('0x35')][_0xcb59('0x36')]};});_0x454472['model']=_[_0xcb59('0x32')](_0x5b3387,_0xcb59('0x31'));_0x454472[_0xcb59('0x37')]=_['keys'](_0x43866c[_0xcb59('0x37')]);_0x454472['filters']=_[_0xcb59('0x38')](_0x454472[_0xcb59('0x39')],_0x454472[_0xcb59('0x37')]);_0x26dff1[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x454472['model'],qs[_0xcb59('0x3b')](_0x43866c['query'][_0xcb59('0x3b')]));_0x26dff1[_0xcb59('0x3a')]=_0x26dff1['attributes'][_0xcb59('0x3c')]?_0x26dff1[_0xcb59('0x3a')]:_0x454472[_0xcb59('0x39')];if(!_0x43866c[_0xcb59('0x37')]['hasOwnProperty'](_0xcb59('0x3d'))){_0x26dff1['limit']=qs['limit'](_0x43866c[_0xcb59('0x37')][_0xcb59('0x22')]);_0x26dff1['offset']=qs['offset'](_0x43866c[_0xcb59('0x37')]['offset']);}_0x26dff1[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x43866c[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x26dff1[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x43866c[_0xcb59('0x37')],_0x454472[_0xcb59('0x41')]),_0x5b3387);if(_0x43866c[_0xcb59('0x37')][_0xcb59('0x43')]){_0x26dff1[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x26dff1[_0xcb59('0x40')],{'$or':_['map'](_0x5b3387,function(_0x4abb4d){if(_0x4abb4d[_0xcb59('0x35')]!=='VIRTUAL'){var _0x497824={};_0x497824[_0x4abb4d['name']]={'$like':'%'+_0x43866c[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x497824;}})});}_0x26dff1=_[_0xcb59('0x44')]({},_0x26dff1,_0x43866c['options']);var _0x4f0e12={'where':_0x26dff1['where']};return db['CmList'][_0xcb59('0x23')](_0x4f0e12)['then'](function(_0x445276){_0x24889d[_0xcb59('0x23')]=_0x445276;if(_0x43866c[_0xcb59('0x37')]['includeAll']){_0x26dff1[_0xcb59('0x45')]=[{'all':!![]}];}return db[_0xcb59('0x46')][_0xcb59('0x47')](_0x26dff1);})[_0xcb59('0x2b')](function(_0x289347){_0x24889d['rows']=_0x289347;return _0x24889d;})[_0xcb59('0x2b')](respondWithFilteredResult(_0x1c1eee,_0x26dff1))[_0xcb59('0x48')](handleError(_0x1c1eee,null));};exports[_0xcb59('0x49')]=function(_0x1c2682,_0x5323ef){var _0x134f1a={'raw':![],'where':{'id':_0x1c2682[_0xcb59('0x4a')]['id']}},_0x3c829c={};_0x3c829c[_0xcb59('0x39')]=_['keys'](db['CmList'][_0xcb59('0x33')]);_0x3c829c[_0xcb59('0x37')]=_['keys'](_0x1c2682[_0xcb59('0x37')]);_0x3c829c[_0xcb59('0x41')]=_['intersection'](_0x3c829c[_0xcb59('0x39')],_0x3c829c[_0xcb59('0x37')]);_0x134f1a[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x3c829c[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x1c2682['query'][_0xcb59('0x3b')]));_0x134f1a[_0xcb59('0x3a')]=_0x134f1a[_0xcb59('0x3a')][_0xcb59('0x3c')]?_0x134f1a[_0xcb59('0x3a')]:_0x3c829c[_0xcb59('0x39')];if(_0x1c2682[_0xcb59('0x37')][_0xcb59('0x4b')]){_0x134f1a[_0xcb59('0x45')]=[{'all':!![]}];}_0x134f1a=_[_0xcb59('0x44')]({},_0x134f1a,_0x1c2682['options']);return db[_0xcb59('0x46')][_0xcb59('0x4c')](_0x134f1a)[_0xcb59('0x2b')](handleEntityNotFound(_0x5323ef,null))[_0xcb59('0x2b')](respondWithResult(_0x5323ef,null))[_0xcb59('0x48')](handleError(_0x5323ef,null));};exports[_0xcb59('0x4d')]=function(_0x37eae2,_0x277514){return db[_0xcb59('0x46')][_0xcb59('0x4d')](_0x37eae2[_0xcb59('0x4e')],{})[_0xcb59('0x2b')](function(_0x516688){var _0x15a33b=_0x37eae2[_0xcb59('0x4f')][_0xcb59('0x2d')]({'plain':!![]});if(!_0x15a33b)throw new Error(_0xcb59('0x50'));if(_0x15a33b[_0xcb59('0x51')]===_0xcb59('0x4f')){var _0x14ac1c=_0x516688[_0xcb59('0x2d')]({'plain':!![]});var _0x4fc03e='Lists';return db[_0xcb59('0x52')][_0xcb59('0x4c')]({'where':{'name':_0x4fc03e,'userProfileId':_0x15a33b[_0xcb59('0x53')]},'raw':!![]})['then'](function(_0x4134ba){if(_0x4134ba&&_0x4134ba['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x14ac1c['name'],'resourceId':_0x14ac1c['id'],'type':_0x4134ba[_0xcb59('0x31')],'sectionId':_0x4134ba['id']},{})[_0xcb59('0x2b')](function(){return _0x516688;});}else{return _0x516688;}})[_0xcb59('0x48')](function(_0x50ff08){logger[_0xcb59('0x2f')](_0xcb59('0x54'),_0x50ff08);throw _0x50ff08;});}return _0x516688;})[_0xcb59('0x2b')](respondWithResult(_0x277514,0xc9))[_0xcb59('0x48')](handleError(_0x277514,null));};exports[_0xcb59('0x2a')]=function(_0x2718f8,_0x5ccf0){if(_0x2718f8[_0xcb59('0x4e')]['id']){delete _0x2718f8[_0xcb59('0x4e')]['id'];}return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x2718f8[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ccf0,null))['then'](saveUpdates(_0x2718f8[_0xcb59('0x4e')],null))['then'](respondWithResult(_0x5ccf0,null))['catch'](handleError(_0x5ccf0,null));};exports['destroy']=function(_0x2a539d,_0x5c0024){return db['CmList']['find']({'where':{'id':_0x2a539d[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c0024,null))[_0xcb59('0x2b')](removeEntity(_0x5c0024,null))[_0xcb59('0x48')](handleError(_0x5c0024,null));};exports[_0xcb59('0x55')]=function(_0x43d42e,_0x47be6d){return db[_0xcb59('0x46')]['describe']()[_0xcb59('0x2b')](respondWithResult(_0x47be6d,null))[_0xcb59('0x48')](handleError(_0x47be6d,null));};exports[_0xcb59('0x56')]=function(_0x8e7361,_0x1742a3,_0x42279c){if(_0x8e7361[_0xcb59('0x4e')]['id']){delete _0x8e7361[_0xcb59('0x4e')]['id'];}return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x8e7361['params']['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x1742a3,null))[_0xcb59('0x2b')](function(_0x24e707){if(_0x24e707){_0x8e7361[_0xcb59('0x4e')][_0xcb59('0x57')]=_0x24e707['id'];return db[_0xcb59('0x58')][_0xcb59('0x4d')](_0x8e7361['body']);}})[_0xcb59('0x2b')](respondWithResult(_0x1742a3,null))[_0xcb59('0x48')](handleError(_0x1742a3,null));};exports[_0xcb59('0x59')]=function(_0x27f56e,_0x5ea8f1,_0x32a5e1){var _0x3188ec={'raw':![],'where':{}};var _0x2e851f={};var _0x45e643={'count':0x0,'rows':[]};return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x27f56e[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x5ea8f1,null))['then'](function(_0x9f099d){if(_0x9f099d){_0x2e851f[_0xcb59('0x39')]=_['keys'](db[_0xcb59('0x58')][_0xcb59('0x33')]);_0x2e851f[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x27f56e[_0xcb59('0x37')]);_0x2e851f[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x2e851f[_0xcb59('0x39')],_0x2e851f[_0xcb59('0x37')]);_0x3188ec[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x2e851f[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x27f56e[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x3188ec['attributes']=_0x3188ec['attributes'][_0xcb59('0x3c')]?_0x3188ec[_0xcb59('0x3a')]:_0x2e851f[_0xcb59('0x39')];if(!_0x27f56e['query'][_0xcb59('0x5c')](_0xcb59('0x3d'))){_0x3188ec[_0xcb59('0x22')]=qs[_0xcb59('0x22')](_0x27f56e[_0xcb59('0x37')]['limit']);_0x3188ec[_0xcb59('0x20')]=qs['offset'](_0x27f56e[_0xcb59('0x37')]['offset']);}_0x3188ec[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x27f56e['query'][_0xcb59('0x3f')]);_0x3188ec[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x27f56e['query'],_0x2e851f[_0xcb59('0x41')]));_0x3188ec[_0xcb59('0x40')]['ListId']=_0x9f099d['id'];if(_0x27f56e['query']['filter']){_0x3188ec[_0xcb59('0x40')]=_['merge'](_0x3188ec[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x3188ec[_0xcb59('0x3a')],function(_0x414c4a){var _0x16cf03={};_0x16cf03[_0x414c4a]={'$like':'%'+_0x27f56e[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x16cf03;})});}_0x3188ec=_[_0xcb59('0x44')]({},_0x3188ec,_0x27f56e['options']);return db[_0xcb59('0x58')][_0xcb59('0x23')]({'where':_0x3188ec['where']})[_0xcb59('0x2b')](function(_0x58bb84){_0x45e643['count']=_0x58bb84;if(_0x27f56e['query'][_0xcb59('0x4b')]){_0x3188ec['include']=[{'all':!![]}];}return db[_0xcb59('0x58')][_0xcb59('0x47')](_0x3188ec);})[_0xcb59('0x2b')](function(_0x11a898){_0x45e643[_0xcb59('0x5d')]=_0x11a898;return _0x45e643;});}})[_0xcb59('0x2b')](respondWithFilteredResult(_0x5ea8f1,_0x3188ec))[_0xcb59('0x48')](handleError(_0x5ea8f1,null));};exports[_0xcb59('0x5e')]=function(_0x5b08de,_0x2fb667,_0x18fbd5){return db[_0xcb59('0x46')][_0xcb59('0x4c')]({'where':{'id':_0x5b08de[_0xcb59('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fb667,null))[_0xcb59('0x2b')](function(_0x1a9814){if(_0x1a9814){return _0x1a9814[_0xcb59('0x5e')](_0x5b08de[_0xcb59('0x37')][_0xcb59('0x5f')]);}})[_0xcb59('0x2b')](respondWithStatusCode(_0x2fb667,null))[_0xcb59('0x48')](handleError(_0x2fb667,null));};exports[_0xcb59('0x60')]=function(_0x509502,_0x1e7dd2,_0x152b1e){return db[_0xcb59('0x46')]['find']({'where':{'id':_0x509502[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x1e7dd2,null))[_0xcb59('0x2b')](function(_0x505690){if(_0x505690){var _0x11507e=[];var _0x3c98e8={'success':[],'errors':[]};return db[_0xcb59('0x61')][_0xcb59('0x55')]()[_0xcb59('0x2b')](function(_0x50e70a){if(_0x509502[_0xcb59('0x4e')]['tags']&&_['isArray'](_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')])){if(_0x509502[_0xcb59('0x4e')]['tags']['length']){_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')]=_0x509502[_0xcb59('0x4e')]['tags']['join'](';')+';';}else{_0x509502['body'][_0xcb59('0x62')]=null;}}else{_0x509502[_0xcb59('0x4e')][_0xcb59('0x62')]=null;}if(_0x509502[_0xcb59('0x4e')]&&_[_0xcb59('0x63')](_0x509502[_0xcb59('0x4e')])){for(var _0x1cf907=0x0;_0x1cf907<_0x509502[_0xcb59('0x4e')][_0xcb59('0x3c')];_0x1cf907+=0x1){_0x509502[_0xcb59('0x4e')][_0x1cf907]['ListId']=_0x509502[_0xcb59('0x4a')]['id'];_0x11507e['push'](_0x509502[_0xcb59('0x4e')][_0x1cf907]);}return BPromise[_0xcb59('0x64')](_0x11507e,function(_0xed7b57){return db['CmContact'][_0xcb59('0x4d')](_[_0xcb59('0x65')](_0xed7b57,['ids','id'])||{},{'fields':_['keys'](_0x50e70a),'raw':!![]})['then'](function(_0x3d22b9){_0x3c98e8[_0xcb59('0x66')][_0xcb59('0x67')](_0x3d22b9[_0xcb59('0x68')]);})[_0xcb59('0x48')](function(_0x5789c3){_0x3c98e8[_0xcb59('0x69')]['push']({'data':_0xed7b57,'error':_0x5789c3[_0xcb59('0x6a')]});});})['then'](function(_0x25385d){return _0x3c98e8;})['catch'](function(_0x100c98){return _0x100c98;});}else{_0x1e7dd2['status'](0x190)[_0xcb59('0x26')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x1e7dd2,null))[_0xcb59('0x48')](handleError(_0x1e7dd2,null));};exports['getContacts']=function(_0x31d9bd,_0x13b6fe,_0x3f4943){var _0x1a1ebf;return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x31d9bd[_0xcb59('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xcb59('0x6b')}]})[_0xcb59('0x2b')](handleEntityNotFound(_0x13b6fe,null))[_0xcb59('0x2b')](function(_0x4d1579){if(_0x4d1579){_0x1a1ebf=_0x4d1579;return db[_0xcb59('0x61')][_0xcb59('0x33')];}})[_0xcb59('0x2b')](function(_0x24b10a){if(_0x24b10a){var _0x478486={};var _0x321a81={};_0x321a81[_0xcb59('0x39')]=_[_0xcb59('0x6c')](_[_0xcb59('0x5b')](_0x24b10a),_[_0xcb59('0x32')](_0x1a1ebf[_0xcb59('0x6b')],function(_0x342dca){return util[_0xcb59('0x6d')]('cf_%d',_0x342dca['id']);}));_0x321a81['query']=_[_0xcb59('0x5b')](_0x31d9bd[_0xcb59('0x37')]);_0x321a81['filters']=_[_0xcb59('0x38')](_0x321a81[_0xcb59('0x39')],_0x321a81[_0xcb59('0x37')]);_0x478486[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x321a81[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x478486[_0xcb59('0x3a')]=_0x478486['attributes'][_0xcb59('0x3c')]?_0x478486['attributes']:_0x321a81[_0xcb59('0x39')];if(!_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x5c')]('nolimit')){_0x478486[_0xcb59('0x22')]=qs['limit'](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x22')]);_0x478486[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x31d9bd['query'][_0xcb59('0x20')]);}_0x478486['order']=qs[_0xcb59('0x3f')](_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x478486[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x31d9bd[_0xcb59('0x37')],_0x321a81[_0xcb59('0x41')]));_0x478486['raw']=!![];if(_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x43')]){_0x478486[_0xcb59('0x40')]=_['merge'](_0x478486[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x478486['attributes'],function(_0x1caa58){var _0x407482={};_0x407482[_0x1caa58]={'$like':'%'+_0x31d9bd[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x407482;})});}_0x478486=_[_0xcb59('0x44')]({},_0x478486,_0x31d9bd[_0xcb59('0x6e')]);return _0x1a1ebf['getContacts'](_0x478486);}})[_0xcb59('0x2b')](respondWithResult(_0x13b6fe,null))[_0xcb59('0x48')](handleError(_0x13b6fe,null));};exports[_0xcb59('0x6f')]=function(_0x48a461,_0x5a3709,_0x28b2ca){var _0x3fcb9b;return db[_0xcb59('0x46')][_0xcb59('0x4c')]({'where':{'id':_0x48a461[_0xcb59('0x4a')]['id']},'include':[{'model':db[_0xcb59('0x70')],'as':_0xcb59('0x6b')}]})[_0xcb59('0x2b')](handleEntityNotFound(_0x5a3709,null))[_0xcb59('0x2b')](function(_0x50c40f){if(_0x50c40f){_0x3fcb9b=_0x50c40f;return db['CmContact']['rawAttributes'];}})['then'](function(_0x2e07f6){if(_0x2e07f6){var _0x37585e={};var _0x148e18={};_0x148e18['model']=_['concat'](_[_0xcb59('0x5b')](_0x2e07f6),_[_0xcb59('0x32')](_0x3fcb9b['CustomFields'],function(_0x552e3f){return util[_0xcb59('0x6d')](_0xcb59('0x71'),_0x552e3f['id']);}));_0x148e18[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x48a461[_0xcb59('0x37')]);_0x148e18[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x148e18['model'],_0x148e18[_0xcb59('0x37')]);_0x37585e[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0x148e18[_0xcb59('0x39')],qs['fields'](_0x48a461['query'][_0xcb59('0x3b')]));_0x37585e['attributes']=_0x37585e[_0xcb59('0x3a')][_0xcb59('0x3c')]?_0x37585e[_0xcb59('0x3a')]:_0x148e18[_0xcb59('0x39')];if(!_0x48a461[_0xcb59('0x37')][_0xcb59('0x5c')](_0xcb59('0x3d'))){_0x37585e[_0xcb59('0x22')]=qs[_0xcb59('0x22')](_0x48a461['query'][_0xcb59('0x22')]);_0x37585e[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x48a461[_0xcb59('0x37')][_0xcb59('0x20')]);}_0x37585e[_0xcb59('0x3e')]=qs['sort'](_0x48a461[_0xcb59('0x37')]['sort']);_0x37585e[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_[_0xcb59('0x42')](_0x48a461[_0xcb59('0x37')],_0x148e18[_0xcb59('0x41')]));_0x37585e[_0xcb59('0x72')]=!![];if(_0x48a461['query']['filter']){_0x37585e[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x37585e['where'],{'$or':_['map'](_0x37585e[_0xcb59('0x3a')],function(_0x28f585){var _0x1d4166={};_0x1d4166[_0x28f585]={'$like':'%'+_0x48a461[_0xcb59('0x37')][_0xcb59('0x43')]+'%'};return _0x1d4166;})});}_0x37585e=_['merge']({},_0x37585e,_0x48a461['options']);return _0x3fcb9b[_0xcb59('0x73')](_0x37585e);}})[_0xcb59('0x2b')](function(_0x4671e3){if(!_[_0xcb59('0x74')](_0x4671e3)){var _0x39cfcd=toCsv(_0x4671e3);var _0x3cccd6=Date[_0xcb59('0x75')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x3fcb9b['id'],_0x3cccd6),_0x39cfcd);_0x5a3709['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xcb59('0x6d')](_0xcb59('0x76'),_0x3fcb9b['id'],_0x3cccd6));_0x5a3709['setHeader'](_0xcb59('0x77'),_0xcb59('0x78'));return _0x5a3709[_0xcb59('0x79')](util[_0xcb59('0x6d')]('/tmp/list_%d_%s.csv',_0x3fcb9b['id'],_0x3cccd6));}else{return _0x5a3709['sendStatus'](0xcc);}})[_0xcb59('0x48')](handleError(_0x5a3709,null));};exports[_0xcb59('0x7a')]=function(_0x519969,_0x213ac0,_0x2eed65){var _0xb803c1;delete _0x519969[_0xcb59('0x4e')]['id'];return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x519969[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x213ac0,null))[_0xcb59('0x2b')](function(_0x4cbe51){if(_0x4cbe51){return db[_0xcb59('0x7b')][_0xcb59('0x7c')](function(_0x11503f){return db[_0xcb59('0x70')][_0xcb59('0x4d')](_0x519969[_0xcb59('0x4e')],{'transaction':_0x11503f})[_0xcb59('0x2b')](function(_0x5db787){_0xb803c1=_0x5db787;return _0x4cbe51[_0xcb59('0x7d')](_0x5db787,{'transaction':_0x11503f});})[_0xcb59('0x2b')](function(){var _0x588c12={'type':db[_0xcb59('0x7e')][_0xcb59('0x7f')],'transaction':_0x11503f};switch(_0x519969[_0xcb59('0x4e')][_0xcb59('0x35')]){case _0xcb59('0x80'):_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x7f')];break;case _0xcb59('0x81'):_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x82')];break;case'switch':_0x588c12[_0xcb59('0x35')]=db[_0xcb59('0x7e')][_0xcb59('0x83')];_0x588c12[_0xcb59('0x84')]=![];break;default:}return db['sequelize'][_0xcb59('0x85')]['addColumn'](_0xcb59('0x86'),util['format'](_0xcb59('0x87'),_0xb803c1['id']),_0x588c12);})[_0xcb59('0x2b')](function(){return _0xb803c1;});});}})[_0xcb59('0x2b')](respondWithResult(_0x213ac0,null))[_0xcb59('0x48')](handleError(_0x213ac0,null));};exports[_0xcb59('0x88')]=function(_0x41f581,_0x4f3368,_0x11f00a){var _0x41f9d3={};var _0xe24928={};var _0x1854d1;var _0x2e5626;return db[_0xcb59('0x46')][_0xcb59('0x5a')]({'where':{'id':_0x41f581[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x4f3368,null))[_0xcb59('0x2b')](function(_0x40d798){if(_0x40d798){_0x1854d1=_0x40d798;_0xe24928[_0xcb59('0x39')]=_[_0xcb59('0x5b')](db[_0xcb59('0x70')][_0xcb59('0x33')]);_0xe24928['query']=_[_0xcb59('0x5b')](_0x41f581[_0xcb59('0x37')]);_0xe24928[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0xe24928[_0xcb59('0x39')],_0xe24928[_0xcb59('0x37')]);_0x41f9d3[_0xcb59('0x3a')]=_[_0xcb59('0x38')](_0xe24928[_0xcb59('0x39')],qs['fields'](_0x41f581[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x41f9d3[_0xcb59('0x3a')]=_0x41f9d3[_0xcb59('0x3a')]['length']?_0x41f9d3['attributes']:_0xe24928[_0xcb59('0x39')];_0x41f9d3[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x41f581[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x41f9d3[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x41f581[_0xcb59('0x37')],_0xe24928[_0xcb59('0x41')]));_0x41f9d3[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x41f9d3['where'],{'$or':[{'ListId':_0x40d798['id']},{'ListId':null}]});if(_0x41f581['query'][_0xcb59('0x43')]){_0x41f9d3[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x41f9d3[_0xcb59('0x40')],{'$or':_[_0xcb59('0x32')](_0x41f9d3[_0xcb59('0x3a')],function(_0x2bc7d6){var _0x49fab9={};_0x49fab9[_0x2bc7d6]={'$like':'%'+_0x41f581['query'][_0xcb59('0x43')]+'%'};return _0x49fab9;})});}_0x41f9d3=_[_0xcb59('0x44')]({},_0x41f9d3,_0x41f581[_0xcb59('0x6e')]);return db['CmCustomField']['findAndCountAll'](_0x41f9d3);}})[_0xcb59('0x2b')](respondWithResult(_0x4f3368,null))['catch'](handleError(_0x4f3368,null));};exports[_0xcb59('0x89')]=function(_0x2f893d,_0x5651d9,_0x24c607){return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x2f893d[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x5651d9,null))['then'](function(_0x2e1e1b){if(_0x2e1e1b){return _0x2e1e1b[_0xcb59('0x89')](_0x2f893d['body'][_0xcb59('0x5f')],_[_0xcb59('0x65')](_0x2f893d['body'],[_0xcb59('0x5f'),'id'])||{})[_0xcb59('0x8a')](function(_0x1e9c76){for(var _0x2df8a6=0x0;_0x2df8a6<_0x2f893d[_0xcb59('0x4e')][_0xcb59('0x5f')][_0xcb59('0x3c')];_0x2df8a6+=0x1){socket[_0xcb59('0x8b')]('userCmList:save',{'UserId':Number(_0x2f893d[_0xcb59('0x4e')][_0xcb59('0x5f')][_0x2df8a6]),'CmListId':Number(_0x2f893d[_0xcb59('0x4a')]['id'])});}return _0x1e9c76;});}})['then'](respondWithResult(_0x5651d9,null))[_0xcb59('0x48')](handleError(_0x5651d9,null));};exports['removeAgents']=function(_0x159f6b,_0x157a29,_0x23f8c8){return db['CmList'][_0xcb59('0x4c')]({'where':{'id':_0x159f6b[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x157a29,null))[_0xcb59('0x2b')](function(_0x139b2c){if(_0x139b2c){return _0x139b2c[_0xcb59('0x8c')](_0x159f6b['query'][_0xcb59('0x5f')])[_0xcb59('0x2b')](function(){if(_[_0xcb59('0x63')](_0x159f6b['query'][_0xcb59('0x5f')])){for(var _0x1be520=0x0;_0x1be520<_0x159f6b[_0xcb59('0x37')][_0xcb59('0x5f')][_0xcb59('0x3c')];_0x1be520+=0x1){socket[_0xcb59('0x8b')](_0xcb59('0x8d'),{'UserId':Number(_0x159f6b[_0xcb59('0x37')][_0xcb59('0x5f')][_0x1be520]),'CmListId':Number(_0x159f6b['params']['id'])});}}else{socket[_0xcb59('0x8b')](_0xcb59('0x8d'),{'UserId':Number(_0x159f6b[_0xcb59('0x37')]['ids']),'CmListId':Number(_0x159f6b[_0xcb59('0x4a')]['id'])});}});}})[_0xcb59('0x2b')](respondWithStatusCode(_0x157a29,null))[_0xcb59('0x48')](handleError(_0x157a29,null));};exports[_0xcb59('0x8e')]=function(_0x207c7a,_0x46047c,_0x5daca2){var _0x17faf1={};var _0x32ae4d={};var _0x1ccacc;var _0x370d73;return db['CmList'][_0xcb59('0x5a')]({'where':{'id':_0x207c7a[_0xcb59('0x4a')]['id']}})[_0xcb59('0x2b')](handleEntityNotFound(_0x46047c,null))[_0xcb59('0x2b')](function(_0x5e4060){if(_0x5e4060){_0x1ccacc=_0x5e4060;_0x32ae4d[_0xcb59('0x39')]=_[_0xcb59('0x5b')](db['User'][_0xcb59('0x33')]);_0x32ae4d[_0xcb59('0x37')]=_[_0xcb59('0x5b')](_0x207c7a['query']);_0x32ae4d[_0xcb59('0x41')]=_[_0xcb59('0x38')](_0x32ae4d[_0xcb59('0x39')],_0x32ae4d['query']);_0x17faf1['attributes']=_[_0xcb59('0x38')](_0x32ae4d[_0xcb59('0x39')],qs[_0xcb59('0x3b')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x3b')]));_0x17faf1[_0xcb59('0x3a')]=_0x17faf1[_0xcb59('0x3a')]['length']?_0x17faf1[_0xcb59('0x3a')]:_0x32ae4d[_0xcb59('0x39')];_0x17faf1[_0xcb59('0x3e')]=qs[_0xcb59('0x3f')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x3f')]);_0x17faf1[_0xcb59('0x40')]=qs[_0xcb59('0x41')](_['pick'](_0x207c7a[_0xcb59('0x37')],_0x32ae4d['filters']));if(_0x207c7a[_0xcb59('0x37')][_0xcb59('0x43')]){_0x17faf1[_0xcb59('0x40')]=_[_0xcb59('0x44')](_0x17faf1['where'],{'$or':_[_0xcb59('0x32')](_0x17faf1[_0xcb59('0x3a')],function(_0x4ab963){var _0x638284={};_0x638284[_0x4ab963]={'$like':'%'+_0x207c7a[_0xcb59('0x37')]['filter']+'%'};return _0x638284;})});}_0x17faf1=_[_0xcb59('0x44')]({},_0x17faf1,_0x207c7a['options']);return _0x1ccacc[_0xcb59('0x8e')](_0x17faf1);}})['then'](function(_0x40d8c2){if(_0x40d8c2){_0x370d73=_0x40d8c2[_0xcb59('0x3c')];if(!_0x207c7a[_0xcb59('0x37')]['hasOwnProperty'](_0xcb59('0x3d'))){_0x17faf1[_0xcb59('0x22')]=qs['limit'](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x22')]);_0x17faf1[_0xcb59('0x20')]=qs[_0xcb59('0x20')](_0x207c7a[_0xcb59('0x37')][_0xcb59('0x20')]);}return _0x1ccacc['getAgents'](_0x17faf1);}})[_0xcb59('0x2b')](function(_0x2e676f){if(_0x2e676f){return _0x2e676f?{'count':_0x370d73,'rows':_0x2e676f}:null;}})['then'](respondWithResult(_0x46047c,null))[_0xcb59('0x48')](handleError(_0x46047c,null));}; \ No newline at end of file +var _0x103d=['save','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','user','role','userProfileId','autoAssociation','body','params','describe','addDisposition','Disposition','getDispositions','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','ListId','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','isEmpty','now','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject'];(function(_0x40ecbf,_0x29bac5){var _0x2be749=function(_0x1bd62a){while(--_0x1bd62a){_0x40ecbf['push'](_0x40ecbf['shift']());}};_0x2be749(++_0x29bac5);}(_0x103d,0x192));var _0xd103=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x103d[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd103('0x0'));var zipdir=require(_0xd103('0x1'));var jsonpatch=require(_0xd103('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd103('0x3'));var Mustache=require(_0xd103('0x4'));var util=require(_0xd103('0x5'));var path=require(_0xd103('0x6'));var sox=require(_0xd103('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd103('0x8'));var _=require(_0xd103('0x9'));var squel=require(_0xd103('0xa'));var crypto=require(_0xd103('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd103('0xc'));var querystring=require('querystring');var Papa=require(_0xd103('0xd'));var Redis=require('ioredis');var authService=require(_0xd103('0xe'));var qs=require(_0xd103('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd103('0x10'))(_0xd103('0x11'));var utils=require(_0xd103('0x12'));var config=require(_0xd103('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd103('0x14'))['db'];config[_0xd103('0x15')]=_[_0xd103('0x16')](config['redis'],{'host':_0xd103('0x17'),'port':0x18eb});var socket=require(_0xd103('0x18'))(new Redis(config[_0xd103('0x15')]));require(_0xd103('0x19'))[_0xd103('0x1a')](socket);function respondWithStatusCode(_0x1c8528,_0x2574c5){_0x2574c5=_0x2574c5||0xcc;return function(_0x3d995d){if(_0x3d995d){return _0x1c8528[_0xd103('0x1b')](_0x2574c5);}return _0x1c8528[_0xd103('0x1c')](_0x2574c5)[_0xd103('0x1d')]();};}function respondWithResult(_0x4fd9bb,_0x1bdda1){_0x1bdda1=_0x1bdda1||0xc8;return function(_0x1f01eb){if(_0x1f01eb){return _0x4fd9bb['status'](_0x1bdda1)['json'](_0x1f01eb);}};}function respondWithFilteredResult(_0xf04cb4,_0x1eed0b){return function(_0x256d97){if(_0x256d97){var _0x2f1ac7=typeof _0x1eed0b[_0xd103('0x1e')]==='undefined'&&typeof _0x1eed0b[_0xd103('0x1f')]===_0xd103('0x20');var _0x5cead8=_0x256d97[_0xd103('0x21')];var _0x345ff0=_0x2f1ac7?0x0:_0x1eed0b[_0xd103('0x1e')];var _0x3d38b5=_0x2f1ac7?_0x256d97[_0xd103('0x21')]:_0x1eed0b[_0xd103('0x1e')]+_0x1eed0b['limit'];var _0xcbc21b;if(_0x3d38b5>=_0x5cead8){_0x3d38b5=_0x5cead8;_0xcbc21b=0xc8;}else{_0xcbc21b=0xce;}_0xf04cb4[_0xd103('0x1c')](_0xcbc21b);return _0xf04cb4[_0xd103('0x22')](_0xd103('0x23'),_0x345ff0+'-'+_0x3d38b5+'/'+_0x5cead8)[_0xd103('0x24')](_0x256d97);}return null;};}function patchUpdates(_0x1cd89d){return function(_0x495f98){try{jsonpatch[_0xd103('0x25')](_0x495f98,_0x1cd89d,!![]);}catch(_0x7c5275){return BPromise[_0xd103('0x26')](_0x7c5275);}return _0x495f98[_0xd103('0x27')]();};}function saveUpdates(_0x2499b5,_0x123ed6){return function(_0x5a1c12){if(_0x5a1c12){return _0x5a1c12[_0xd103('0x28')](_0x2499b5)[_0xd103('0x29')](function(_0x2e9e15){return _0x2e9e15;});}return null;};}function removeEntity(_0x4d0e9d,_0x52b8c8){return function(_0x569046){if(_0x569046){return _0x569046['destroy']()[_0xd103('0x29')](function(){var _0x4c0e99=_0x569046[_0xd103('0x2a')]({'plain':!![]});var _0x2235bd=_0xd103('0x2b');return db[_0xd103('0x2c')][_0xd103('0x2d')]({'where':{'type':_0x2235bd,'resourceId':_0x4c0e99['id']}})[_0xd103('0x29')](function(){return _0x569046;});})[_0xd103('0x29')](function(){_0x4d0e9d[_0xd103('0x1c')](0xcc)[_0xd103('0x1d')]();});}};}function handleEntityNotFound(_0xfdcbc1,_0x14d78b){return function(_0x1e2202){if(!_0x1e2202){_0xfdcbc1['sendStatus'](0x194);}return _0x1e2202;};}function handleError(_0x90cd8,_0x1b4dfe){_0x1b4dfe=_0x1b4dfe||0x1f4;return function(_0x5ca834){logger[_0xd103('0x2e')](_0x5ca834[_0xd103('0x2f')]);if(_0x5ca834[_0xd103('0x30')]){delete _0x5ca834[_0xd103('0x30')];}_0x90cd8[_0xd103('0x1c')](_0x1b4dfe)['send'](_0x5ca834);};}exports[_0xd103('0x31')]=function(_0x26d631,_0x27dcfc){var _0x191c8d={},_0x109104={},_0x4ee2f3={'count':0x0,'rows':[]};var _0x10ae05=_[_0xd103('0x32')](db[_0xd103('0x33')][_0xd103('0x34')],function(_0x44521c){return{'name':_0x44521c[_0xd103('0x35')],'type':_0x44521c[_0xd103('0x36')][_0xd103('0x37')]};});_0x109104[_0xd103('0x38')]=_['map'](_0x10ae05,'name');_0x109104[_0xd103('0x39')]=_[_0xd103('0x3a')](_0x26d631[_0xd103('0x39')]);_0x109104[_0xd103('0x3b')]=_[_0xd103('0x3c')](_0x109104['model'],_0x109104[_0xd103('0x39')]);_0x191c8d[_0xd103('0x3d')]=_[_0xd103('0x3c')](_0x109104[_0xd103('0x38')],qs[_0xd103('0x3e')](_0x26d631['query'][_0xd103('0x3e')]));_0x191c8d[_0xd103('0x3d')]=_0x191c8d[_0xd103('0x3d')][_0xd103('0x3f')]?_0x191c8d[_0xd103('0x3d')]:_0x109104[_0xd103('0x38')];if(!_0x26d631[_0xd103('0x39')][_0xd103('0x40')](_0xd103('0x41'))){_0x191c8d['limit']=qs[_0xd103('0x1f')](_0x26d631[_0xd103('0x39')][_0xd103('0x1f')]);_0x191c8d[_0xd103('0x1e')]=qs[_0xd103('0x1e')](_0x26d631[_0xd103('0x39')][_0xd103('0x1e')]);}_0x191c8d[_0xd103('0x42')]=qs[_0xd103('0x43')](_0x26d631[_0xd103('0x39')][_0xd103('0x43')]);_0x191c8d['where']=qs[_0xd103('0x3b')](_[_0xd103('0x44')](_0x26d631[_0xd103('0x39')],_0x109104['filters']),_0x10ae05);if(_0x26d631[_0xd103('0x39')][_0xd103('0x45')]){_0x191c8d['where']=_[_0xd103('0x46')](_0x191c8d[_0xd103('0x47')],{'$or':_['map'](_0x10ae05,function(_0x569d8f){if(_0x569d8f[_0xd103('0x36')]!==_0xd103('0x48')){var _0xd68970={};_0xd68970[_0x569d8f[_0xd103('0x30')]]={'$like':'%'+_0x26d631[_0xd103('0x39')][_0xd103('0x45')]+'%'};return _0xd68970;}})});}_0x191c8d=_[_0xd103('0x46')]({},_0x191c8d,_0x26d631[_0xd103('0x49')]);var _0x41d9e1={'where':_0x191c8d[_0xd103('0x47')]};return db[_0xd103('0x33')]['count'](_0x41d9e1)[_0xd103('0x29')](function(_0x1d335c){_0x4ee2f3[_0xd103('0x21')]=_0x1d335c;if(_0x26d631[_0xd103('0x39')][_0xd103('0x4a')]){_0x191c8d[_0xd103('0x4b')]=[{'all':!![]}];}return db[_0xd103('0x33')][_0xd103('0x4c')](_0x191c8d);})[_0xd103('0x29')](function(_0x1b501d){_0x4ee2f3['rows']=_0x1b501d;return _0x4ee2f3;})['then'](respondWithFilteredResult(_0x27dcfc,_0x191c8d))['catch'](handleError(_0x27dcfc,null));};exports[_0xd103('0x4d')]=function(_0x5b4e31,_0x24a4ac){var _0x2902ff={'raw':![],'where':{'id':_0x5b4e31['params']['id']}},_0x2199d3={};_0x2199d3[_0xd103('0x38')]=_[_0xd103('0x3a')](db[_0xd103('0x33')][_0xd103('0x34')]);_0x2199d3[_0xd103('0x39')]=_[_0xd103('0x3a')](_0x5b4e31['query']);_0x2199d3['filters']=_[_0xd103('0x3c')](_0x2199d3['model'],_0x2199d3[_0xd103('0x39')]);_0x2902ff[_0xd103('0x3d')]=_['intersection'](_0x2199d3[_0xd103('0x38')],qs[_0xd103('0x3e')](_0x5b4e31[_0xd103('0x39')][_0xd103('0x3e')]));_0x2902ff[_0xd103('0x3d')]=_0x2902ff[_0xd103('0x3d')][_0xd103('0x3f')]?_0x2902ff[_0xd103('0x3d')]:_0x2199d3[_0xd103('0x38')];if(_0x5b4e31[_0xd103('0x39')]['includeAll']){_0x2902ff[_0xd103('0x4b')]=[{'all':!![]}];}_0x2902ff=_[_0xd103('0x46')]({},_0x2902ff,_0x5b4e31['options']);return db['CmList'][_0xd103('0x4e')](_0x2902ff)[_0xd103('0x29')](handleEntityNotFound(_0x24a4ac,null))[_0xd103('0x29')](respondWithResult(_0x24a4ac,null))[_0xd103('0x4f')](handleError(_0x24a4ac,null));};exports[_0xd103('0x50')]=function(_0x4ebe97,_0x4b3e31){return db['CmList']['create'](_0x4ebe97['body'],{})[_0xd103('0x29')](function(_0x2a2a20){var _0x49e8f4=_0x4ebe97[_0xd103('0x51')]['get']({'plain':!![]});if(!_0x49e8f4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49e8f4[_0xd103('0x52')]===_0xd103('0x51')){var _0x5b781c=_0x2a2a20[_0xd103('0x2a')]({'plain':!![]});var _0x795897='Lists';return db['UserProfileSection'][_0xd103('0x4e')]({'where':{'name':_0x795897,'userProfileId':_0x49e8f4[_0xd103('0x53')]},'raw':!![]})[_0xd103('0x29')](function(_0x3ea81b){if(_0x3ea81b&&_0x3ea81b[_0xd103('0x54')]===0x0){return db[_0xd103('0x2c')][_0xd103('0x50')]({'name':_0x5b781c['name'],'resourceId':_0x5b781c['id'],'type':_0x3ea81b['name'],'sectionId':_0x3ea81b['id']},{})[_0xd103('0x29')](function(){return _0x2a2a20;});}else{return _0x2a2a20;}})[_0xd103('0x4f')](function(_0x210311){logger[_0xd103('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x210311);throw _0x210311;});}return _0x2a2a20;})[_0xd103('0x29')](respondWithResult(_0x4b3e31,0xc9))[_0xd103('0x4f')](handleError(_0x4b3e31,null));};exports['update']=function(_0x345a13,_0x5ade10){if(_0x345a13['body']['id']){delete _0x345a13[_0xd103('0x55')]['id'];}return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x345a13[_0xd103('0x56')]['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x5ade10,null))[_0xd103('0x29')](saveUpdates(_0x345a13['body'],null))[_0xd103('0x29')](respondWithResult(_0x5ade10,null))[_0xd103('0x4f')](handleError(_0x5ade10,null));};exports['destroy']=function(_0x3771a0,_0x51cdd1){return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x3771a0['params']['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x51cdd1,null))['then'](removeEntity(_0x51cdd1,null))['catch'](handleError(_0x51cdd1,null));};exports[_0xd103('0x57')]=function(_0x1ecf17,_0x1fd595){return db[_0xd103('0x33')][_0xd103('0x57')]()[_0xd103('0x29')](respondWithResult(_0x1fd595,null))[_0xd103('0x4f')](handleError(_0x1fd595,null));};exports[_0xd103('0x58')]=function(_0x19b7a2,_0x321b3c,_0x3c1c3e){if(_0x19b7a2['body']['id']){delete _0x19b7a2[_0xd103('0x55')]['id'];}return db['CmList'][_0xd103('0x4e')]({'where':{'id':_0x19b7a2['params']['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x321b3c,null))['then'](function(_0x432f36){if(_0x432f36){_0x19b7a2['body']['ListId']=_0x432f36['id'];return db[_0xd103('0x59')][_0xd103('0x50')](_0x19b7a2[_0xd103('0x55')]);}})[_0xd103('0x29')](respondWithResult(_0x321b3c,null))[_0xd103('0x4f')](handleError(_0x321b3c,null));};exports[_0xd103('0x5a')]=function(_0x517463,_0x304941,_0x349f3e){var _0x2a4dc={'raw':![],'where':{}};var _0x12a88b={};var _0x68881e={'count':0x0,'rows':[]};return db[_0xd103('0x33')]['findOne']({'where':{'id':_0x517463['params']['id']}})['then'](handleEntityNotFound(_0x304941,null))['then'](function(_0x46eefe){if(_0x46eefe){_0x12a88b[_0xd103('0x38')]=_['keys'](db[_0xd103('0x59')][_0xd103('0x34')]);_0x12a88b[_0xd103('0x39')]=_['keys'](_0x517463[_0xd103('0x39')]);_0x12a88b[_0xd103('0x3b')]=_['intersection'](_0x12a88b['model'],_0x12a88b[_0xd103('0x39')]);_0x2a4dc['attributes']=_[_0xd103('0x3c')](_0x12a88b[_0xd103('0x38')],qs['fields'](_0x517463[_0xd103('0x39')]['fields']));_0x2a4dc[_0xd103('0x3d')]=_0x2a4dc[_0xd103('0x3d')][_0xd103('0x3f')]?_0x2a4dc[_0xd103('0x3d')]:_0x12a88b[_0xd103('0x38')];if(!_0x517463['query']['hasOwnProperty'](_0xd103('0x41'))){_0x2a4dc[_0xd103('0x1f')]=qs[_0xd103('0x1f')](_0x517463[_0xd103('0x39')][_0xd103('0x1f')]);_0x2a4dc[_0xd103('0x1e')]=qs[_0xd103('0x1e')](_0x517463[_0xd103('0x39')]['offset']);}_0x2a4dc['order']=qs[_0xd103('0x43')](_0x517463['query'][_0xd103('0x43')]);_0x2a4dc['where']=qs[_0xd103('0x3b')](_[_0xd103('0x44')](_0x517463[_0xd103('0x39')],_0x12a88b[_0xd103('0x3b')]));_0x2a4dc[_0xd103('0x47')]['ListId']=_0x46eefe['id'];if(_0x517463[_0xd103('0x39')][_0xd103('0x45')]){_0x2a4dc[_0xd103('0x47')]=_[_0xd103('0x46')](_0x2a4dc[_0xd103('0x47')],{'$or':_[_0xd103('0x32')](_0x2a4dc['attributes'],function(_0x2445f1){var _0x2555ab={};_0x2555ab[_0x2445f1]={'$like':'%'+_0x517463[_0xd103('0x39')]['filter']+'%'};return _0x2555ab;})});}_0x2a4dc=_['merge']({},_0x2a4dc,_0x517463[_0xd103('0x49')]);return db[_0xd103('0x59')][_0xd103('0x21')]({'where':_0x2a4dc[_0xd103('0x47')]})[_0xd103('0x29')](function(_0x2fdd4c){_0x68881e['count']=_0x2fdd4c;if(_0x517463['query'][_0xd103('0x4a')]){_0x2a4dc[_0xd103('0x4b')]=[{'all':!![]}];}return db[_0xd103('0x59')][_0xd103('0x4c')](_0x2a4dc);})['then'](function(_0xce1108){_0x68881e['rows']=_0xce1108;return _0x68881e;});}})[_0xd103('0x29')](respondWithFilteredResult(_0x304941,_0x2a4dc))['catch'](handleError(_0x304941,null));};exports[_0xd103('0x5b')]=function(_0x197125,_0x29dccf,_0x51ee70){return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x197125['params']['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x29dccf,null))['then'](function(_0x562617){if(_0x562617){return _0x562617['removeDispositions'](_0x197125[_0xd103('0x39')][_0xd103('0x5c')]);}})['then'](respondWithStatusCode(_0x29dccf,null))[_0xd103('0x4f')](handleError(_0x29dccf,null));};exports[_0xd103('0x5d')]=function(_0x33d624,_0xcf4ab4,_0x2557de){return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x33d624[_0xd103('0x56')]['id']}})[_0xd103('0x29')](handleEntityNotFound(_0xcf4ab4,null))['then'](function(_0x160bc7){if(_0x160bc7){var _0x5807e4=[];var _0x2580e0={'success':[],'errors':[]};return db[_0xd103('0x5e')]['describe']()[_0xd103('0x29')](function(_0x5adeca){if(_0x33d624[_0xd103('0x55')]['tags']&&_[_0xd103('0x5f')](_0x33d624[_0xd103('0x55')]['tags'])){if(_0x33d624[_0xd103('0x55')][_0xd103('0x60')][_0xd103('0x3f')]){_0x33d624[_0xd103('0x55')][_0xd103('0x60')]=_0x33d624[_0xd103('0x55')][_0xd103('0x60')][_0xd103('0x61')](';')+';';}else{_0x33d624[_0xd103('0x55')][_0xd103('0x60')]=null;}}else{_0x33d624[_0xd103('0x55')][_0xd103('0x60')]=null;}if(_0x33d624[_0xd103('0x55')]&&_[_0xd103('0x5f')](_0x33d624['body'])){for(var _0x5ec073=0x0;_0x5ec073<_0x33d624[_0xd103('0x55')][_0xd103('0x3f')];_0x5ec073+=0x1){_0x33d624[_0xd103('0x55')][_0x5ec073][_0xd103('0x62')]=_0x33d624[_0xd103('0x56')]['id'];_0x5807e4[_0xd103('0x63')](_0x33d624[_0xd103('0x55')][_0x5ec073]);}return BPromise[_0xd103('0x64')](_0x5807e4,function(_0x3f90a3){return db[_0xd103('0x5e')][_0xd103('0x50')](_[_0xd103('0x65')](_0x3f90a3,[_0xd103('0x5c'),'id'])||{},{'fields':_[_0xd103('0x3a')](_0x5adeca),'raw':!![]})['then'](function(_0x36ce33){_0x2580e0[_0xd103('0x66')][_0xd103('0x63')](_0x36ce33[_0xd103('0x67')]);})[_0xd103('0x4f')](function(_0xfff38e){_0x2580e0[_0xd103('0x68')]['push']({'data':_0x3f90a3,'error':_0xfff38e[_0xd103('0x69')]});});})[_0xd103('0x29')](function(_0x4ff17a){return _0x2580e0;})[_0xd103('0x4f')](function(_0x191335){return _0x191335;});}else{_0xcf4ab4[_0xd103('0x1c')](0x190)[_0xd103('0x24')]({'message':_0xd103('0x6a')});}});}})[_0xd103('0x29')](respondWithResult(_0xcf4ab4,null))['catch'](handleError(_0xcf4ab4,null));};exports[_0xd103('0x6b')]=function(_0x59b8b4,_0x27f72a,_0x1d87f3){var _0x1fad97;return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x59b8b4['params']['id']},'include':[{'model':db[_0xd103('0x6c')],'as':_0xd103('0x6d')}]})['then'](handleEntityNotFound(_0x27f72a,null))['then'](function(_0x52e945){if(_0x52e945){_0x1fad97=_0x52e945;return db[_0xd103('0x5e')][_0xd103('0x34')];}})[_0xd103('0x29')](function(_0x80fe74){if(_0x80fe74){var _0x27c026={};var _0x274567={};_0x274567[_0xd103('0x38')]=_[_0xd103('0x6e')](_[_0xd103('0x3a')](_0x80fe74),_[_0xd103('0x32')](_0x1fad97[_0xd103('0x6d')],function(_0x271944){return util['format'](_0xd103('0x6f'),_0x271944['id']);}));_0x274567[_0xd103('0x39')]=_[_0xd103('0x3a')](_0x59b8b4[_0xd103('0x39')]);_0x274567[_0xd103('0x3b')]=_['intersection'](_0x274567['model'],_0x274567[_0xd103('0x39')]);_0x27c026[_0xd103('0x3d')]=_[_0xd103('0x3c')](_0x274567[_0xd103('0x38')],qs[_0xd103('0x3e')](_0x59b8b4[_0xd103('0x39')][_0xd103('0x3e')]));_0x27c026['attributes']=_0x27c026[_0xd103('0x3d')][_0xd103('0x3f')]?_0x27c026[_0xd103('0x3d')]:_0x274567['model'];if(!_0x59b8b4[_0xd103('0x39')]['hasOwnProperty'](_0xd103('0x41'))){_0x27c026['limit']=qs['limit'](_0x59b8b4[_0xd103('0x39')][_0xd103('0x1f')]);_0x27c026[_0xd103('0x1e')]=qs['offset'](_0x59b8b4[_0xd103('0x39')][_0xd103('0x1e')]);}_0x27c026[_0xd103('0x42')]=qs[_0xd103('0x43')](_0x59b8b4['query']['sort']);_0x27c026[_0xd103('0x47')]=qs['filters'](_[_0xd103('0x44')](_0x59b8b4[_0xd103('0x39')],_0x274567[_0xd103('0x3b')]));_0x27c026[_0xd103('0x70')]=!![];if(_0x59b8b4[_0xd103('0x39')][_0xd103('0x45')]){_0x27c026[_0xd103('0x47')]=_[_0xd103('0x46')](_0x27c026[_0xd103('0x47')],{'$or':_[_0xd103('0x32')](_0x27c026[_0xd103('0x3d')],function(_0xc644cc){var _0x311933={};_0x311933[_0xc644cc]={'$like':'%'+_0x59b8b4['query'][_0xd103('0x45')]+'%'};return _0x311933;})});}_0x27c026=_[_0xd103('0x46')]({},_0x27c026,_0x59b8b4[_0xd103('0x49')]);return _0x1fad97[_0xd103('0x6b')](_0x27c026);}})[_0xd103('0x29')](respondWithResult(_0x27f72a,null))['catch'](handleError(_0x27f72a,null));};exports[_0xd103('0x71')]=function(_0x1149f1,_0x19ac38,_0x4f5e6a){var _0x45f9d8;return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x1149f1[_0xd103('0x56')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd103('0x6d')}]})[_0xd103('0x29')](handleEntityNotFound(_0x19ac38,null))[_0xd103('0x29')](function(_0x2abe38){if(_0x2abe38){_0x45f9d8=_0x2abe38;return db[_0xd103('0x5e')][_0xd103('0x34')];}})[_0xd103('0x29')](function(_0x24ace9){if(_0x24ace9){var _0x228737={};var _0x57a0cb={};_0x57a0cb[_0xd103('0x38')]=_[_0xd103('0x6e')](_[_0xd103('0x3a')](_0x24ace9),_['map'](_0x45f9d8['CustomFields'],function(_0x59a2dd){return util['format'](_0xd103('0x6f'),_0x59a2dd['id']);}));_0x57a0cb['query']=_['keys'](_0x1149f1['query']);_0x57a0cb[_0xd103('0x3b')]=_[_0xd103('0x3c')](_0x57a0cb[_0xd103('0x38')],_0x57a0cb[_0xd103('0x39')]);_0x228737[_0xd103('0x3d')]=_[_0xd103('0x3c')](_0x57a0cb[_0xd103('0x38')],qs[_0xd103('0x3e')](_0x1149f1[_0xd103('0x39')][_0xd103('0x3e')]));_0x228737[_0xd103('0x3d')]=_0x228737[_0xd103('0x3d')]['length']?_0x228737[_0xd103('0x3d')]:_0x57a0cb[_0xd103('0x38')];if(!_0x1149f1['query'][_0xd103('0x40')](_0xd103('0x41'))){_0x228737[_0xd103('0x1f')]=qs[_0xd103('0x1f')](_0x1149f1[_0xd103('0x39')][_0xd103('0x1f')]);_0x228737[_0xd103('0x1e')]=qs[_0xd103('0x1e')](_0x1149f1[_0xd103('0x39')]['offset']);}_0x228737['order']=qs[_0xd103('0x43')](_0x1149f1[_0xd103('0x39')][_0xd103('0x43')]);_0x228737[_0xd103('0x47')]=qs['filters'](_['pick'](_0x1149f1[_0xd103('0x39')],_0x57a0cb[_0xd103('0x3b')]));_0x228737[_0xd103('0x70')]=!![];if(_0x1149f1[_0xd103('0x39')][_0xd103('0x45')]){_0x228737[_0xd103('0x47')]=_[_0xd103('0x46')](_0x228737['where'],{'$or':_[_0xd103('0x32')](_0x228737[_0xd103('0x3d')],function(_0x422d9a){var _0x59ded0={};_0x59ded0[_0x422d9a]={'$like':'%'+_0x1149f1['query']['filter']+'%'};return _0x59ded0;})});}_0x228737=_[_0xd103('0x46')]({},_0x228737,_0x1149f1[_0xd103('0x49')]);return _0x45f9d8['getContacts'](_0x228737);}})[_0xd103('0x29')](function(_0x2d792b){if(!_[_0xd103('0x72')](_0x2d792b)){var _0x5455b9=toCsv(_0x2d792b);var _0x48ddc7=Date[_0xd103('0x73')]();fs['writeFileSync'](util[_0xd103('0x74')](_0xd103('0x75'),_0x45f9d8['id'],_0x48ddc7),_0x5455b9);_0x19ac38[_0xd103('0x76')](_0xd103('0x77'),_0xd103('0x78')+util[_0xd103('0x74')]('list_%d_%s.csv',_0x45f9d8['id'],_0x48ddc7));_0x19ac38['setHeader'](_0xd103('0x79'),_0xd103('0x7a'));return _0x19ac38[_0xd103('0x7b')](util[_0xd103('0x74')](_0xd103('0x75'),_0x45f9d8['id'],_0x48ddc7));}else{return _0x19ac38[_0xd103('0x1b')](0xcc);}})[_0xd103('0x4f')](handleError(_0x19ac38,null));};exports[_0xd103('0x7c')]=function(_0x2ba917,_0x552600,_0x41d7b0){var _0x1ec567;delete _0x2ba917[_0xd103('0x55')]['id'];return db[_0xd103('0x33')][_0xd103('0x7d')]({'where':{'id':_0x2ba917['params']['id']}})['then'](handleEntityNotFound(_0x552600,null))['then'](function(_0x58b2f5){if(_0x58b2f5){return db[_0xd103('0x7e')][_0xd103('0x7f')](function(_0x3ac78c){return db[_0xd103('0x6c')][_0xd103('0x50')](_0x2ba917['body'],{'transaction':_0x3ac78c})[_0xd103('0x29')](function(_0x123a57){_0x1ec567=_0x123a57;return _0x58b2f5[_0xd103('0x80')](_0x123a57,{'transaction':_0x3ac78c});})['then'](function(){var _0x2ebb6b={'type':db[_0xd103('0x81')][_0xd103('0x82')],'transaction':_0x3ac78c};switch(_0x2ba917[_0xd103('0x55')]['type']){case _0xd103('0x83'):_0x2ebb6b[_0xd103('0x36')]=db[_0xd103('0x81')][_0xd103('0x82')];break;case _0xd103('0x84'):_0x2ebb6b[_0xd103('0x36')]=db[_0xd103('0x81')][_0xd103('0x85')];break;case _0xd103('0x86'):_0x2ebb6b['type']=db[_0xd103('0x81')][_0xd103('0x87')];_0x2ebb6b['defaultValue']=![];break;default:}return db[_0xd103('0x7e')][_0xd103('0x88')]['addColumn'](_0xd103('0x89'),util[_0xd103('0x74')]('cf_%s',_0x1ec567['id']),_0x2ebb6b);})['then'](function(){return _0x1ec567;});});}})[_0xd103('0x29')](respondWithResult(_0x552600,null))[_0xd103('0x4f')](handleError(_0x552600,null));};exports[_0xd103('0x8a')]=function(_0xe6eddd,_0x206cee,_0x583465){var _0x4a8451={};var _0x90c5f7={};var _0x9d4e74;var _0x3cdeff;return db['CmList'][_0xd103('0x7d')]({'where':{'id':_0xe6eddd[_0xd103('0x56')]['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x206cee,null))['then'](function(_0x36ecb1){if(_0x36ecb1){_0x9d4e74=_0x36ecb1;_0x90c5f7['model']=_['keys'](db['CmCustomField']['rawAttributes']);_0x90c5f7['query']=_['keys'](_0xe6eddd[_0xd103('0x39')]);_0x90c5f7[_0xd103('0x3b')]=_[_0xd103('0x3c')](_0x90c5f7[_0xd103('0x38')],_0x90c5f7[_0xd103('0x39')]);_0x4a8451[_0xd103('0x3d')]=_[_0xd103('0x3c')](_0x90c5f7[_0xd103('0x38')],qs[_0xd103('0x3e')](_0xe6eddd['query'][_0xd103('0x3e')]));_0x4a8451[_0xd103('0x3d')]=_0x4a8451[_0xd103('0x3d')]['length']?_0x4a8451[_0xd103('0x3d')]:_0x90c5f7[_0xd103('0x38')];_0x4a8451[_0xd103('0x42')]=qs[_0xd103('0x43')](_0xe6eddd[_0xd103('0x39')][_0xd103('0x43')]);_0x4a8451[_0xd103('0x47')]=qs[_0xd103('0x3b')](_[_0xd103('0x44')](_0xe6eddd['query'],_0x90c5f7[_0xd103('0x3b')]));_0x4a8451['where']=_[_0xd103('0x46')](_0x4a8451[_0xd103('0x47')],{'$or':[{'ListId':_0x36ecb1['id']},{'ListId':null}]});if(_0xe6eddd[_0xd103('0x39')][_0xd103('0x45')]){_0x4a8451[_0xd103('0x47')]=_[_0xd103('0x46')](_0x4a8451[_0xd103('0x47')],{'$or':_['map'](_0x4a8451[_0xd103('0x3d')],function(_0x58e40d){var _0x33f742={};_0x33f742[_0x58e40d]={'$like':'%'+_0xe6eddd[_0xd103('0x39')]['filter']+'%'};return _0x33f742;})});}_0x4a8451=_[_0xd103('0x46')]({},_0x4a8451,_0xe6eddd['options']);return db[_0xd103('0x6c')]['findAndCountAll'](_0x4a8451);}})[_0xd103('0x29')](respondWithResult(_0x206cee,null))[_0xd103('0x4f')](handleError(_0x206cee,null));};exports[_0xd103('0x8b')]=function(_0x1ad2db,_0x161270,_0x27b401){return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x1ad2db[_0xd103('0x56')]['id']}})['then'](handleEntityNotFound(_0x161270,null))[_0xd103('0x29')](function(_0x1ee4b2){if(_0x1ee4b2){return _0x1ee4b2[_0xd103('0x8b')](_0x1ad2db[_0xd103('0x55')][_0xd103('0x5c')],_['omit'](_0x1ad2db[_0xd103('0x55')],[_0xd103('0x5c'),'id'])||{})[_0xd103('0x8c')](function(_0x2db976){for(var _0x2f1c8f=0x0;_0x2f1c8f<_0x1ad2db[_0xd103('0x55')][_0xd103('0x5c')][_0xd103('0x3f')];_0x2f1c8f+=0x1){socket[_0xd103('0x8d')](_0xd103('0x8e'),{'UserId':Number(_0x1ad2db[_0xd103('0x55')]['ids'][_0x2f1c8f]),'CmListId':Number(_0x1ad2db[_0xd103('0x56')]['id'])});}return _0x2db976;});}})['then'](respondWithResult(_0x161270,null))['catch'](handleError(_0x161270,null));};exports[_0xd103('0x8f')]=function(_0x116527,_0x1df337,_0x1212f1){return db[_0xd103('0x33')][_0xd103('0x4e')]({'where':{'id':_0x116527['params']['id']}})['then'](handleEntityNotFound(_0x1df337,null))['then'](function(_0x1d29ef){if(_0x1d29ef){return _0x1d29ef[_0xd103('0x8f')](_0x116527[_0xd103('0x39')][_0xd103('0x5c')])[_0xd103('0x29')](function(){if(_[_0xd103('0x5f')](_0x116527['query'][_0xd103('0x5c')])){for(var _0x11a162=0x0;_0x11a162<_0x116527[_0xd103('0x39')]['ids']['length'];_0x11a162+=0x1){socket[_0xd103('0x8d')](_0xd103('0x90'),{'UserId':Number(_0x116527[_0xd103('0x39')][_0xd103('0x5c')][_0x11a162]),'CmListId':Number(_0x116527[_0xd103('0x56')]['id'])});}}else{socket[_0xd103('0x8d')](_0xd103('0x90'),{'UserId':Number(_0x116527[_0xd103('0x39')][_0xd103('0x5c')]),'CmListId':Number(_0x116527[_0xd103('0x56')]['id'])});}});}})[_0xd103('0x29')](respondWithStatusCode(_0x1df337,null))[_0xd103('0x4f')](handleError(_0x1df337,null));};exports[_0xd103('0x91')]=function(_0x49db56,_0x48dcb8,_0x46280d){var _0x107382={};var _0x5bd92d={};var _0x33fc30;var _0x3882c3;return db['CmList'][_0xd103('0x7d')]({'where':{'id':_0x49db56['params']['id']}})[_0xd103('0x29')](handleEntityNotFound(_0x48dcb8,null))['then'](function(_0x4d267d){if(_0x4d267d){_0x33fc30=_0x4d267d;_0x5bd92d[_0xd103('0x38')]=_[_0xd103('0x3a')](db[_0xd103('0x92')][_0xd103('0x34')]);_0x5bd92d[_0xd103('0x39')]=_[_0xd103('0x3a')](_0x49db56[_0xd103('0x39')]);_0x5bd92d[_0xd103('0x3b')]=_[_0xd103('0x3c')](_0x5bd92d['model'],_0x5bd92d['query']);_0x107382['attributes']=_[_0xd103('0x3c')](_0x5bd92d[_0xd103('0x38')],qs['fields'](_0x49db56[_0xd103('0x39')][_0xd103('0x3e')]));_0x107382[_0xd103('0x3d')]=_0x107382[_0xd103('0x3d')][_0xd103('0x3f')]?_0x107382[_0xd103('0x3d')]:_0x5bd92d['model'];_0x107382['order']=qs[_0xd103('0x43')](_0x49db56['query'][_0xd103('0x43')]);_0x107382[_0xd103('0x47')]=qs[_0xd103('0x3b')](_[_0xd103('0x44')](_0x49db56['query'],_0x5bd92d['filters']));if(_0x49db56[_0xd103('0x39')][_0xd103('0x45')]){_0x107382[_0xd103('0x47')]=_['merge'](_0x107382[_0xd103('0x47')],{'$or':_['map'](_0x107382[_0xd103('0x3d')],function(_0xd389dc){var _0x3b7c11={};_0x3b7c11[_0xd389dc]={'$like':'%'+_0x49db56[_0xd103('0x39')]['filter']+'%'};return _0x3b7c11;})});}_0x107382=_['merge']({},_0x107382,_0x49db56[_0xd103('0x49')]);return _0x33fc30['getAgents'](_0x107382);}})[_0xd103('0x29')](function(_0x1a2e92){if(_0x1a2e92){_0x3882c3=_0x1a2e92[_0xd103('0x3f')];if(!_0x49db56['query'][_0xd103('0x40')](_0xd103('0x41'))){_0x107382[_0xd103('0x1f')]=qs[_0xd103('0x1f')](_0x49db56['query'][_0xd103('0x1f')]);_0x107382[_0xd103('0x1e')]=qs[_0xd103('0x1e')](_0x49db56[_0xd103('0x39')][_0xd103('0x1e')]);}return _0x33fc30[_0xd103('0x91')](_0x107382);}})[_0xd103('0x29')](function(_0xf297a2){if(_0xf297a2){return _0xf297a2?{'count':_0x3882c3,'rows':_0xf297a2}:null;}})[_0xd103('0x29')](respondWithResult(_0x48dcb8,null))['catch'](handleError(_0x48dcb8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index bcd6167..9a119da 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5fc3[_0xcf4569];return _0x7fef;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe14b,0x93));var _0xbe14=function(_0x30de08,_0x1d574e){_0x30de08=_0x30de08-0x0;var _0x2f5716=_0xe14b[_0x30de08];return _0x2f5716;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index de86c0d..a4318a1 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x3ceca7,_0x50219e){var _0x34b5c0=function(_0x9af205){while(--_0x9af205){_0x3ceca7['push'](_0x3ceca7['shift']());}};_0x34b5c0(++_0x50219e);}(_0xdace,0xc5));var _0xedac=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0xdace[_0x32b122];return _0x4ad25a;};'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('./cmList.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 _0xd2ea=['cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0xcf69e4,_0x22359f){var _0x3ae183=function(_0x34d0fc){while(--_0x34d0fc){_0xcf69e4['push'](_0xcf69e4['shift']());}};_0x3ae183(++_0x22359f);}(_0xd2ea,0x15f));var _0xad2e=function(_0x23e17a,_0x2f1a33){_0x23e17a=_0x23e17a-0x0;var _0x581269=_0xd2ea[_0x23e17a];return _0x581269;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'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 ac1aa7d..5e737cf 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 _0xf1d1=['debug','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','request\x20sent'];(function(_0x42432f,_0x3a5e3b){var _0x1f9370=function(_0xd7780b){while(--_0xd7780b){_0x42432f['push'](_0x42432f['shift']());}};_0x1f9370(++_0x3a5e3b);}(_0xf1d1,0x14d));var _0x1f1d=function(_0x589ca2,_0x544a75){_0x589ca2=_0x589ca2-0x0;var _0x258d8e=_0xf1d1[_0x589ca2];return _0x258d8e;};'use strict';var _=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f1d('0x2'));var fs=require('fs');var Redis=require(_0x1f1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f1d('0x4'));var logger=require(_0x1f1d('0x5'))(_0x1f1d('0x6'));var config=require(_0x1f1d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1f1d('0x8')]=_[_0x1f1d('0x9')](config[_0x1f1d('0x8')],{'host':_0x1f1d('0xa'),'port':0x18eb});var socket=require(_0x1f1d('0xb'))(new Redis(config[_0x1f1d('0x8')]));require(_0x1f1d('0xc'))['register'](socket);function respondWithRpcPromise(_0x4e7ab3,_0x572570,_0xdd2852){return new BPromise(function(_0x1d45e7,_0x911831){return client[_0x1f1d('0xd')](_0x4e7ab3,_0xdd2852)[_0x1f1d('0xe')](function(_0x318042){logger[_0x1f1d('0xf')]('CmList,\x20%s,\x20%s',_0x572570,_0x1f1d('0x10'));logger[_0x1f1d('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x572570,_0x1f1d('0x10'),JSON[_0x1f1d('0x12')](_0x318042));if(_0x318042[_0x1f1d('0x13')]){if(_0x318042['error'][_0x1f1d('0x14')]===0x1f4){logger[_0x1f1d('0x13')](_0x1f1d('0x15'),_0x572570,_0x318042[_0x1f1d('0x13')]['message']);return _0x911831(_0x318042[_0x1f1d('0x13')][_0x1f1d('0x16')]);}logger[_0x1f1d('0x13')](_0x1f1d('0x15'),_0x572570,_0x318042[_0x1f1d('0x13')]['message']);return _0x1d45e7(_0x318042[_0x1f1d('0x13')]['message']);}else{logger[_0x1f1d('0xf')](_0x1f1d('0x15'),_0x572570,_0x1f1d('0x10'));_0x1d45e7(_0x318042[_0x1f1d('0x17')]['message']);}})[_0x1f1d('0x18')](function(_0x40937c){logger['error'](_0x1f1d('0x15'),_0x572570,_0x40937c);_0x911831(_0x40937c);});});} \ No newline at end of file +var _0x8262=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','lodash','util'];(function(_0x3b685,_0x570f1f){var _0x7e2f30=function(_0x46c2f8){while(--_0x46c2f8){_0x3b685['push'](_0x3b685['shift']());}};_0x7e2f30(++_0x570f1f);}(_0x8262,0xd6));var _0x2826=function(_0x57cfe0,_0x21da11){_0x57cfe0=_0x57cfe0-0x0;var _0x3c7056=_0x8262[_0x57cfe0];return _0x3c7056;};'use strict';var _=require(_0x2826('0x0'));var util=require(_0x2826('0x1'));var moment=require('moment');var BPromise=require(_0x2826('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2826('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2826('0x4'));var logger=require(_0x2826('0x5'))(_0x2826('0x6'));var config=require(_0x2826('0x7'));var jayson=require(_0x2826('0x8'));var client=jayson[_0x2826('0x9')][_0x2826('0xa')]({'port':0x232a});config[_0x2826('0xb')]=_[_0x2826('0xc')](config[_0x2826('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2826('0xd'))(new Redis(config['redis']));require(_0x2826('0xe'))[_0x2826('0xf')](socket);function respondWithRpcPromise(_0x4910c8,_0x2a6ba3,_0xac5292){return new BPromise(function(_0x2d7c5c,_0x2dc30e){return client[_0x2826('0x10')](_0x4910c8,_0xac5292)[_0x2826('0x11')](function(_0x2515ff){logger[_0x2826('0x12')]('CmList,\x20%s,\x20%s',_0x2a6ba3,_0x2826('0x13'));logger['debug'](_0x2826('0x14'),_0x2a6ba3,_0x2826('0x13'),JSON[_0x2826('0x15')](_0x2515ff));if(_0x2515ff[_0x2826('0x16')]){if(_0x2515ff[_0x2826('0x16')][_0x2826('0x17')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x2a6ba3,_0x2515ff[_0x2826('0x16')][_0x2826('0x18')]);return _0x2dc30e(_0x2515ff[_0x2826('0x16')][_0x2826('0x18')]);}logger[_0x2826('0x16')](_0x2826('0x19'),_0x2a6ba3,_0x2515ff[_0x2826('0x16')]['message']);return _0x2d7c5c(_0x2515ff[_0x2826('0x16')]['message']);}else{logger[_0x2826('0x12')](_0x2826('0x19'),_0x2a6ba3,_0x2826('0x13'));_0x2d7c5c(_0x2515ff[_0x2826('0x1a')][_0x2826('0x18')]);}})['catch'](function(_0x690689){logger[_0x2826('0x16')](_0x2826('0x19'),_0x2a6ba3,_0x690689);_0x2dc30e(_0x690689);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f2d17a6..6511d11 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 _0x70a0=['removeListener','register','cmList:','./cmList.events','remove','update','emit'];(function(_0x5ad18c,_0x340ac2){var _0x23d3bb=function(_0x209b82){while(--_0x209b82){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x23d3bb(++_0x340ac2);}(_0x70a0,0x7a));var _0x070a=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x70a0[_0x29d915];return _0x160f86;};'use strict';var CmListEvents=require(_0x070a('0x0'));var events=['save',_0x070a('0x1'),_0x070a('0x2')];function createListener(_0x37925b,_0x1c6a15){return function(_0x32ba23){_0x1c6a15[_0x070a('0x3')](_0x37925b,_0x32ba23);};}function removeListener(_0x3b8533,_0x2278ed){return function(){CmListEvents[_0x070a('0x4')](_0x3b8533,_0x2278ed);};}exports[_0x070a('0x5')]=function(_0x4dcbda){for(var _0x3cc31b=0x0,_0x5c9a81=events['length'];_0x3cc31b<_0x5c9a81;_0x3cc31b++){var _0x4a408b=events[_0x3cc31b];var _0x5c2103=createListener(_0x070a('0x6')+_0x4a408b,_0x4dcbda);CmListEvents['on'](_0x4a408b,_0x5c2103);}}; \ No newline at end of file +var _0x142e=['remove','update','removeListener','register','cmList:','./cmList.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x142e,0xa6));var _0xe142=function(_0x1c80b4,_0x183d93){_0x1c80b4=_0x1c80b4-0x0;var _0x2bcc18=_0x142e[_0x1c80b4];return _0x2bcc18;};'use strict';var CmListEvents=require(_0xe142('0x0'));var events=[_0xe142('0x1'),_0xe142('0x2'),_0xe142('0x3')];function createListener(_0x53ad62,_0x5732e2){return function(_0x3bdbbe){_0x5732e2['emit'](_0x53ad62,_0x3bdbbe);};}function removeListener(_0x458b72,_0x447f72){return function(){CmListEvents[_0xe142('0x4')](_0x458b72,_0x447f72);};}exports[_0xe142('0x5')]=function(_0x28b82d){for(var _0x5d6de1=0x0,_0x57f0b5=events['length'];_0x5d6de1<_0x57f0b5;_0x5d6de1++){var _0x2eac9f=events[_0x5d6de1];var _0x280f1c=createListener(_0xe142('0x6')+_0x2eac9f,_0x28b82d);CmListEvents['on'](_0x2eac9f,_0x280f1c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index acf91f3..8e0ac8d 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 _0x67b3=['removeAgents','exports','multer','fs-extra','../../components/interaction/service','./cmList.controller','get','index','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x173aca,_0x4cfe9f){var _0x5dbf81=function(_0x10c012){while(--_0x10c012){_0x173aca['push'](_0x173aca['shift']());}};_0x5dbf81(++_0x4cfe9f);}(_0x67b3,0x98));var _0x367b=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x67b3[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require(_0x367b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x367b('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x367b('0x2'));var config=require('../../config/environment');var controller=require(_0x367b('0x3'));router[_0x367b('0x4')]('/',auth['isAuthenticated'](),controller[_0x367b('0x5')]);router[_0x367b('0x4')]('/describe',auth[_0x367b('0x6')](),controller[_0x367b('0x7')]);router[_0x367b('0x4')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller['show']);router[_0x367b('0x4')](_0x367b('0x9'),auth[_0x367b('0x6')](),controller[_0x367b('0xa')]);router['get'](_0x367b('0xb'),auth[_0x367b('0x6')](),controller[_0x367b('0xc')]);router[_0x367b('0x4')](_0x367b('0xd'),auth[_0x367b('0x6')](),controller[_0x367b('0xe')]);router['get'](_0x367b('0xf'),auth[_0x367b('0x6')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x367b('0x6')](),controller[_0x367b('0x10')]);router[_0x367b('0x11')]('/',auth[_0x367b('0x6')](),controller['create']);router[_0x367b('0x11')]('/:id/dispositions',auth[_0x367b('0x6')](),controller[_0x367b('0x12')]);router[_0x367b('0x11')]('/:id/contacts',auth[_0x367b('0x6')](),controller[_0x367b('0x13')]);router['post'](_0x367b('0xf'),auth[_0x367b('0x6')](),controller[_0x367b('0x14')]);router[_0x367b('0x11')](_0x367b('0x15'),auth[_0x367b('0x6')](),controller[_0x367b('0x16')]);router[_0x367b('0x17')]('/:id',auth[_0x367b('0x6')](),controller[_0x367b('0x18')]);router[_0x367b('0x19')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller[_0x367b('0x1a')]);router[_0x367b('0x19')](_0x367b('0x9'),auth[_0x367b('0x6')](),controller[_0x367b('0x1b')]);router['delete'](_0x367b('0x15'),auth[_0x367b('0x6')](),controller[_0x367b('0x1c')]);module[_0x367b('0x1d')]=router; \ No newline at end of file +var _0x560b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','describe','show','isAuthenticated','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','/:id/contacts','addCustomField','/:id/users','addAgents','update','delete','/:id','destroy','/:id/dispositions','exports','multer','path','connect-timeout'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x560b,0x12f));var _0xb560=function(_0x322245,_0xbcc6eb){_0x322245=_0x322245-0x0;var _0x33214c=_0x560b[_0x322245];return _0x33214c;};'use strict';var multer=require(_0xb560('0x0'));var util=require('util');var path=require(_0xb560('0x1'));var timeout=require(_0xb560('0x2'));var express=require(_0xb560('0x3'));var router=express[_0xb560('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb560('0x5'));var interaction=require(_0xb560('0x6'));var config=require(_0xb560('0x7'));var controller=require(_0xb560('0x8'));router[_0xb560('0x9')]('/',auth['isAuthenticated'](),controller[_0xb560('0xa')]);router[_0xb560('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb560('0xb')]);router[_0xb560('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb560('0xc')]);router['get']('/:id/dispositions',auth[_0xb560('0xd')](),controller[_0xb560('0xe')]);router[_0xb560('0x9')]('/:id/contacts',auth[_0xb560('0xd')](),controller[_0xb560('0xf')]);router[_0xb560('0x9')](_0xb560('0x10'),auth[_0xb560('0xd')](),controller[_0xb560('0x11')]);router[_0xb560('0x9')](_0xb560('0x12'),auth[_0xb560('0xd')](),controller[_0xb560('0x13')]);router[_0xb560('0x9')]('/:id/users',auth[_0xb560('0xd')](),controller[_0xb560('0x14')]);router[_0xb560('0x15')]('/',auth['isAuthenticated'](),controller[_0xb560('0x16')]);router[_0xb560('0x15')]('/:id/dispositions',auth[_0xb560('0xd')](),controller[_0xb560('0x17')]);router['post'](_0xb560('0x18'),auth[_0xb560('0xd')](),controller['addContacts']);router[_0xb560('0x15')](_0xb560('0x12'),auth[_0xb560('0xd')](),controller[_0xb560('0x19')]);router[_0xb560('0x15')](_0xb560('0x1a'),auth['isAuthenticated'](),controller[_0xb560('0x1b')]);router['put']('/:id',auth[_0xb560('0xd')](),controller[_0xb560('0x1c')]);router[_0xb560('0x1d')](_0xb560('0x1e'),auth[_0xb560('0xd')](),controller[_0xb560('0x1f')]);router[_0xb560('0x1d')](_0xb560('0x20'),auth[_0xb560('0xd')](),controller['removeDispositions']);router[_0xb560('0x1d')](_0xb560('0x1a'),auth[_0xb560('0xd')](),controller['removeAgents']);module[_0xb560('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 a4da964..2c4b03e 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 _0x8460=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x462945,_0x16d80d){var _0x294c0c=function(_0x1351ca){while(--_0x1351ca){_0x462945['push'](_0x462945['shift']());}};_0x294c0c(++_0x16d80d);}(_0x8460,0x1e2));var _0x0846=function(_0xf3a64b,_0x5bf08e){_0xf3a64b=_0xf3a64b-0x0;var _0x211ea6=_0x8460[_0xf3a64b];return _0x211ea6;};'use strict';var Sequelize=require(_0x0846('0x0'));module[_0x0846('0x1')]={'name':{'type':Sequelize[_0x0846('0x2')],'get':function(_0x59220f){return this[_0x0846('0x3')](_0x0846('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0846('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x0846('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xdb21=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x22b450,_0x11a84a){var _0x36a0ec=function(_0x495ae4){while(--_0x495ae4){_0x22b450['push'](_0x22b450['shift']());}};_0x36a0ec(++_0x11a84a);}(_0xdb21,0x1df));var _0x1db2=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0xdb21[_0x1d3791];return _0x40fbf5;};'use strict';var Sequelize=require(_0x1db2('0x0'));module[_0x1db2('0x1')]={'name':{'type':Sequelize[_0x1db2('0x2')],'get':function(_0x21419f){return this[_0x1db2('0x3')](_0x1db2('0x4'));}},'field':{'type':Sequelize[_0x1db2('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x1db2('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7fcae5d..6f62e49 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3e8a99,_0x203ca9){var _0x379fd2=function(_0x4df5ee){while(--_0x4df5ee){_0x3e8a99['push'](_0x3e8a99['shift']());}};_0x379fd2(++_0x203ca9);}(_0x7a54,0x106));var _0x47a5=function(_0xb34a57,_0x58e3b2){_0xb34a57=_0xb34a57-0x0;var _0x46a7fe=_0x7a54[_0xb34a57];return _0x46a7fe;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5efd65,_0x5ac924){var _0xf8c7d1=function(_0x32b0a9){while(--_0x32b0a9){_0x5efd65['push'](_0x5efd65['shift']());}};_0xf8c7d1(++_0x5ac924);}(_0x7a54,0x106));var _0x47a5=function(_0x1b3bce,_0x14705f){_0x1b3bce=_0x1b3bce-0x0;var _0x2b339c=_0x7a54[_0x1b3bce];return _0x2b339c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f22353b..b640dc7 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 _0xcfd0=['../../config/logger','bluebird','rimraf','../../config/environment','exports','define','Condition','tools_conditions','util'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcfd0,0x194));var _0x0cfd=function(_0x4746cb,_0x4a966e){_0x4746cb=_0x4746cb-0x0;var _0x1caeeb=_0xcfd0[_0x4746cb];return _0x1caeeb;};'use strict';var _=require('lodash');var util=require(_0x0cfd('0x0'));var logger=require(_0x0cfd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0cfd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cfd('0x3'));var config=require(_0x0cfd('0x4'));var attributes=require('./condition.attributes');module[_0x0cfd('0x5')]=function(_0xc05a12,_0x1b9f05){return _0xc05a12[_0x0cfd('0x6')](_0x0cfd('0x7'),attributes,{'tableName':_0x0cfd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56e7=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x56e7,0x18c));var _0x756e=function(_0x157ce5,_0xfa6b87){_0x157ce5=_0x157ce5-0x0;var _0x359c0c=_0x56e7[_0x157ce5];return _0x359c0c;};'use strict';var _=require(_0x756e('0x0'));var util=require('util');var logger=require(_0x756e('0x1'))(_0x756e('0x2'));var moment=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var rp=require(_0x756e('0x5'));var fs=require('fs');var path=require(_0x756e('0x6'));var rimraf=require('rimraf');var config=require(_0x756e('0x7'));var attributes=require(_0x756e('0x8'));module[_0x756e('0x9')]=function(_0x1370d3,_0x48b2ba){return _0x1370d3[_0x756e('0xa')]('Condition',attributes,{'tableName':'tools_conditions','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 6786729..a1ed0fc 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 _0x1b9c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1fa136,_0x4cc0a4){var _0x3ac511=function(_0x54f9fe){while(--_0x54f9fe){_0x1fa136['push'](_0x1fa136['shift']());}};_0x3ac511(++_0x4cc0a4);}(_0x1b9c,0x7d));var _0xc1b9=function(_0x3cc88d,_0x3aa2b1){_0x3cc88d=_0x3cc88d-0x0;var _0xccc83=_0x1b9c[_0x3cc88d];return _0xccc83;};'use strict';var _=require(_0xc1b9('0x0'));var util=require(_0xc1b9('0x1'));var moment=require(_0xc1b9('0x2'));var BPromise=require(_0xc1b9('0x3'));var rs=require(_0xc1b9('0x4'));var fs=require('fs');var Redis=require(_0xc1b9('0x5'));var db=require(_0xc1b9('0x6'))['db'];var utils=require(_0xc1b9('0x7'));var logger=require(_0xc1b9('0x8'))(_0xc1b9('0x9'));var config=require(_0xc1b9('0xa'));var jayson=require(_0xc1b9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3649fc,_0x52c059,_0xca3e4f){return new BPromise(function(_0x315be2,_0x4449f0){return client[_0xc1b9('0xc')](_0x3649fc,_0xca3e4f)[_0xc1b9('0xd')](function(_0xc746e9){logger['info'](_0xc1b9('0xe'),_0x52c059,_0xc1b9('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x52c059,_0xc1b9('0xf'),JSON[_0xc1b9('0x10')](_0xc746e9));if(_0xc746e9[_0xc1b9('0x11')]){if(_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x12')]===0x1f4){logger[_0xc1b9('0x11')](_0xc1b9('0xe'),_0x52c059,_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);return _0x4449f0(_0xc746e9[_0xc1b9('0x11')]['message']);}logger[_0xc1b9('0x11')]('Condition,\x20%s,\x20%s',_0x52c059,_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);return _0x315be2(_0xc746e9[_0xc1b9('0x11')][_0xc1b9('0x13')]);}else{logger[_0xc1b9('0x14')](_0xc1b9('0xe'),_0x52c059,_0xc1b9('0xf'));_0x315be2(_0xc746e9[_0xc1b9('0x15')][_0xc1b9('0x13')]);}})['catch'](function(_0x48f734){logger[_0xc1b9('0x11')]('Condition,\x20%s,\x20%s',_0x52c059,_0x48f734);_0x4449f0(_0x48f734);});});} \ No newline at end of file +var _0xf336=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','../../config/utils'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xf336,0x19e));var _0x6f33=function(_0x4545b9,_0x154ced){_0x4545b9=_0x4545b9-0x0;var _0x20e3be=_0xf336[_0x4545b9];return _0x20e3be;};'use strict';var _=require(_0x6f33('0x0'));var util=require('util');var moment=require(_0x6f33('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f33('0x3'));var logger=require(_0x6f33('0x4'))('rpc');var config=require(_0x6f33('0x5'));var jayson=require(_0x6f33('0x6'));var client=jayson[_0x6f33('0x7')][_0x6f33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42f991,_0x6a82f9,_0x2a10ea){return new BPromise(function(_0xb5a21d,_0x266a23){return client[_0x6f33('0x9')](_0x42f991,_0x2a10ea)['then'](function(_0x4b591d){logger[_0x6f33('0xa')](_0x6f33('0xb'),_0x6a82f9,_0x6f33('0xc'));logger['debug'](_0x6f33('0xd'),_0x6a82f9,'request\x20sent',JSON[_0x6f33('0xe')](_0x4b591d));if(_0x4b591d['error']){if(_0x4b591d[_0x6f33('0xf')]['code']===0x1f4){logger[_0x6f33('0xf')]('Condition,\x20%s,\x20%s',_0x6a82f9,_0x4b591d[_0x6f33('0xf')][_0x6f33('0x10')]);return _0x266a23(_0x4b591d[_0x6f33('0xf')]['message']);}logger[_0x6f33('0xf')](_0x6f33('0xb'),_0x6a82f9,_0x4b591d[_0x6f33('0xf')][_0x6f33('0x10')]);return _0xb5a21d(_0x4b591d[_0x6f33('0xf')][_0x6f33('0x10')]);}else{logger[_0x6f33('0xa')](_0x6f33('0xb'),_0x6a82f9,_0x6f33('0xc'));_0xb5a21d(_0x4b591d[_0x6f33('0x11')]['message']);}})[_0x6f33('0x12')](function(_0x26a67a){logger[_0x6f33('0xf')](_0x6f33('0xb'),_0x6a82f9,_0x26a67a);_0x266a23(_0x26a67a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index addc974..fc8b0b1 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 _0xc232=['isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./condition.controller'];(function(_0xa62a6b,_0x50f390){var _0x57380b=function(_0x29be07){while(--_0x29be07){_0xa62a6b['push'](_0xa62a6b['shift']());}};_0x57380b(++_0x50f390);}(_0xc232,0x68));var _0x2c23=function(_0x307cad,_0x324113){_0x307cad=_0x307cad-0x0;var _0x416850=_0xc232[_0x307cad];return _0x416850;};'use strict';var multer=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var path=require(_0x2c23('0x2'));var timeout=require(_0x2c23('0x3'));var express=require(_0x2c23('0x4'));var router=express['Router']();var fs_extra=require(_0x2c23('0x5'));var auth=require(_0x2c23('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c23('0x7'));router['put']('/:id',auth[_0x2c23('0x8')](),controller[_0x2c23('0x9')]);router[_0x2c23('0xa')](_0x2c23('0xb'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xc')]);module[_0x2c23('0xd')]=router; \ No newline at end of file +var _0x4367=['./condition.controller','put','/:id','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x59d1d2,_0x545184){var _0x1bd1ba=function(_0x494f31){while(--_0x494f31){_0x59d1d2['push'](_0x59d1d2['shift']());}};_0x1bd1ba(++_0x545184);}(_0x4367,0x19e));var _0x7436=function(_0x336def,_0x431cdc){_0x336def=_0x336def-0x0;var _0x56db41=_0x4367[_0x336def];return _0x56db41;};'use strict';var multer=require(_0x7436('0x0'));var util=require(_0x7436('0x1'));var path=require('path');var timeout=require(_0x7436('0x2'));var express=require(_0x7436('0x3'));var router=express[_0x7436('0x4')]();var fs_extra=require(_0x7436('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7436('0x6'));router[_0x7436('0x7')](_0x7436('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x7436('0x9')](),controller[_0x7436('0xa')]);module[_0x7436('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1946417..8761bfc 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 _0x757a=['exports','STRING'];(function(_0x1e08f8,_0x40723d){var _0x9c34d=function(_0x5db273){while(--_0x5db273){_0x1e08f8['push'](_0x1e08f8['shift']());}};_0x9c34d(++_0x40723d);}(_0x757a,0xde));var _0xa757=function(_0x1c5343,_0x2e725a){_0x1c5343=_0x1c5343-0x0;var _0x5042ff=_0x757a[_0x1c5343];return _0x5042ff;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f2469d5..ee94b17 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 _0x03d3=['UserProfileResource','destroy','error','name','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','get','CustomDashboards'];(function(_0x43b569,_0xf390ec){var _0x4bd963=function(_0x3c2c50){while(--_0x3c2c50){_0x43b569['push'](_0x43b569['shift']());}};_0x4bd963(++_0xf390ec);}(_0x03d3,0x1bb));var _0x303d=function(_0x4cfb82,_0x5ef436){_0x4cfb82=_0x4cfb82-0x0;var _0x5ade30=_0x03d3[_0x4cfb82];return _0x5ade30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x303d('0x0'));var zipdir=require(_0x303d('0x1'));var jsonpatch=require(_0x303d('0x2'));var rp=require(_0x303d('0x3'));var moment=require('moment');var BPromise=require(_0x303d('0x4'));var Mustache=require(_0x303d('0x5'));var util=require(_0x303d('0x6'));var path=require(_0x303d('0x7'));var sox=require('sox');var csv=require(_0x303d('0x8'));var ejs=require(_0x303d('0x9'));var fs=require('fs');var fs_extra=require(_0x303d('0xa'));var _=require('lodash');var squel=require(_0x303d('0xb'));var crypto=require('crypto');var jsforce=require(_0x303d('0xc'));var deskjs=require(_0x303d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x303d('0xe'));var Papa=require(_0x303d('0xf'));var Redis=require(_0x303d('0x10'));var authService=require(_0x303d('0x11'));var qs=require(_0x303d('0x12'));var as=require(_0x303d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x303d('0x14'))(_0x303d('0x15'));var utils=require(_0x303d('0x16'));var config=require(_0x303d('0x17'));var licenseUtil=require(_0x303d('0x18'));var db=require(_0x303d('0x19'))['db'];config[_0x303d('0x1a')]=_[_0x303d('0x1b')](config[_0x303d('0x1a')],{'host':_0x303d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x303d('0x1d')](socket);function respondWithStatusCode(_0x367f5c,_0x288ea7){_0x288ea7=_0x288ea7||0xcc;return function(_0x947a95){if(_0x947a95){return _0x367f5c[_0x303d('0x1e')](_0x288ea7);}return _0x367f5c['status'](_0x288ea7)[_0x303d('0x1f')]();};}function respondWithResult(_0x5cbc8c,_0x136436){_0x136436=_0x136436||0xc8;return function(_0xfe8ebc){if(_0xfe8ebc){return _0x5cbc8c[_0x303d('0x20')](_0x136436)['json'](_0xfe8ebc);}};}function respondWithFilteredResult(_0x5f4482,_0xe52152){return function(_0x3745fa){if(_0x3745fa){var _0x45e5d2=typeof _0xe52152['offset']===_0x303d('0x21')&&typeof _0xe52152[_0x303d('0x22')]===_0x303d('0x21');var _0x1ca309=_0x3745fa[_0x303d('0x23')];var _0x18877d=_0x45e5d2?0x0:_0xe52152['offset'];var _0x5d9217=_0x45e5d2?_0x3745fa[_0x303d('0x23')]:_0xe52152[_0x303d('0x24')]+_0xe52152['limit'];var _0x2c427b;if(_0x5d9217>=_0x1ca309){_0x5d9217=_0x1ca309;_0x2c427b=0xc8;}else{_0x2c427b=0xce;}_0x5f4482[_0x303d('0x20')](_0x2c427b);return _0x5f4482['set']('Content-Range',_0x18877d+'-'+_0x5d9217+'/'+_0x1ca309)[_0x303d('0x25')](_0x3745fa);}return null;};}function patchUpdates(_0x172a2f){return function(_0x32b350){try{jsonpatch[_0x303d('0x26')](_0x32b350,_0x172a2f,!![]);}catch(_0x265af0){return BPromise[_0x303d('0x27')](_0x265af0);}return _0x32b350[_0x303d('0x28')]();};}function saveUpdates(_0x3c22b2,_0x1ebd8a){return function(_0x12d5d9){if(_0x12d5d9){return _0x12d5d9[_0x303d('0x29')](_0x3c22b2)['then'](function(_0x200c0){return _0x200c0;});}return null;};}function removeEntity(_0x309855,_0x4ab233){return function(_0x12236e){if(_0x12236e){return _0x12236e['destroy']()[_0x303d('0x2a')](function(){var _0xa52e0=_0x12236e[_0x303d('0x2b')]({'plain':!![]});var _0x221478=_0x303d('0x2c');return db[_0x303d('0x2d')][_0x303d('0x2e')]({'where':{'type':_0x221478,'resourceId':_0xa52e0['id']}})[_0x303d('0x2a')](function(){return _0x12236e;});})[_0x303d('0x2a')](function(){_0x309855[_0x303d('0x20')](0xcc)[_0x303d('0x1f')]();});}};}function handleEntityNotFound(_0x52516e,_0x5508eb){return function(_0x542d51){if(!_0x542d51){_0x52516e[_0x303d('0x1e')](0x194);}return _0x542d51;};}function handleError(_0x29f13f,_0x4d675d){_0x4d675d=_0x4d675d||0x1f4;return function(_0x4b8c7f){logger[_0x303d('0x2f')](_0x4b8c7f['stack']);if(_0x4b8c7f['name']){delete _0x4b8c7f[_0x303d('0x30')];}_0x29f13f[_0x303d('0x20')](_0x4d675d)['send'](_0x4b8c7f);};}exports['index']=function(_0x142d11,_0x1d54de){var _0x191fa2={},_0x23f00d={},_0x44259f={'count':0x0,'rows':[]};var _0x1c3801=_[_0x303d('0x31')](db[_0x303d('0x32')][_0x303d('0x33')],function(_0x52def7){return{'name':_0x52def7['fieldName'],'type':_0x52def7[_0x303d('0x34')][_0x303d('0x35')]};});_0x23f00d[_0x303d('0x36')]=_['map'](_0x1c3801,_0x303d('0x30'));_0x23f00d[_0x303d('0x37')]=_[_0x303d('0x38')](_0x142d11['query']);_0x23f00d[_0x303d('0x39')]=_['intersection'](_0x23f00d[_0x303d('0x36')],_0x23f00d['query']);_0x191fa2[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x23f00d[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x142d11[_0x303d('0x37')]['fields']));_0x191fa2[_0x303d('0x3a')]=_0x191fa2['attributes'][_0x303d('0x3d')]?_0x191fa2[_0x303d('0x3a')]:_0x23f00d[_0x303d('0x36')];if(!_0x142d11[_0x303d('0x37')]['hasOwnProperty'](_0x303d('0x3e'))){_0x191fa2[_0x303d('0x22')]=qs['limit'](_0x142d11[_0x303d('0x37')][_0x303d('0x22')]);_0x191fa2[_0x303d('0x24')]=qs['offset'](_0x142d11[_0x303d('0x37')][_0x303d('0x24')]);}_0x191fa2[_0x303d('0x3f')]=qs[_0x303d('0x40')](_0x142d11['query'][_0x303d('0x40')]);_0x191fa2[_0x303d('0x41')]=qs[_0x303d('0x39')](_[_0x303d('0x42')](_0x142d11['query'],_0x23f00d[_0x303d('0x39')]),_0x1c3801);if(_0x142d11[_0x303d('0x37')][_0x303d('0x43')]){_0x191fa2[_0x303d('0x41')]=_[_0x303d('0x44')](_0x191fa2[_0x303d('0x41')],{'$or':_[_0x303d('0x31')](_0x1c3801,function(_0x2ceb3d){if(_0x2ceb3d['type']!==_0x303d('0x45')){var _0x40612f={};_0x40612f[_0x2ceb3d[_0x303d('0x30')]]={'$like':'%'+_0x142d11[_0x303d('0x37')][_0x303d('0x43')]+'%'};return _0x40612f;}})});}_0x191fa2=_['merge']({},_0x191fa2,_0x142d11[_0x303d('0x46')]);var _0x2a45f5={'where':_0x191fa2[_0x303d('0x41')]};return db[_0x303d('0x32')][_0x303d('0x23')](_0x2a45f5)[_0x303d('0x2a')](function(_0x6e2b41){_0x44259f['count']=_0x6e2b41;if(_0x142d11[_0x303d('0x37')][_0x303d('0x47')]){_0x191fa2[_0x303d('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x303d('0x49')](_0x191fa2);})[_0x303d('0x2a')](function(_0x28e7ab){_0x44259f[_0x303d('0x4a')]=_0x28e7ab;return _0x44259f;})[_0x303d('0x2a')](respondWithFilteredResult(_0x1d54de,_0x191fa2))['catch'](handleError(_0x1d54de,null));};exports[_0x303d('0x4b')]=function(_0x1c0d17,_0x183ff8){var _0x2d67cf={'raw':![],'where':{'id':_0x1c0d17[_0x303d('0x4c')]['id']}},_0x2c804e={};_0x2c804e[_0x303d('0x36')]=_[_0x303d('0x38')](db[_0x303d('0x32')][_0x303d('0x33')]);_0x2c804e[_0x303d('0x37')]=_[_0x303d('0x38')](_0x1c0d17['query']);_0x2c804e[_0x303d('0x39')]=_['intersection'](_0x2c804e[_0x303d('0x36')],_0x2c804e[_0x303d('0x37')]);_0x2d67cf[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x2c804e[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x1c0d17[_0x303d('0x37')][_0x303d('0x3c')]));_0x2d67cf[_0x303d('0x3a')]=_0x2d67cf[_0x303d('0x3a')][_0x303d('0x3d')]?_0x2d67cf[_0x303d('0x3a')]:_0x2c804e[_0x303d('0x36')];if(_0x1c0d17[_0x303d('0x37')]['includeAll']){_0x2d67cf[_0x303d('0x48')]=[{'all':!![]}];}_0x2d67cf=_[_0x303d('0x44')]({},_0x2d67cf,_0x1c0d17['options']);return db[_0x303d('0x32')][_0x303d('0x4d')](_0x2d67cf)[_0x303d('0x2a')](handleEntityNotFound(_0x183ff8,null))[_0x303d('0x2a')](respondWithResult(_0x183ff8,null))['catch'](handleError(_0x183ff8,null));};exports[_0x303d('0x4e')]=function(_0x3f1216,_0x48143e){return db[_0x303d('0x32')][_0x303d('0x4e')](_0x3f1216[_0x303d('0x4f')],{})['then'](function(_0x326640){var _0x544a51=_0x3f1216[_0x303d('0x50')][_0x303d('0x2b')]({'plain':!![]});if(!_0x544a51)throw new Error(_0x303d('0x51'));if(_0x544a51[_0x303d('0x52')]==='user'){var _0xe16e67=_0x326640[_0x303d('0x2b')]({'plain':!![]});var _0x2893eb='CustomDashboards';return db[_0x303d('0x53')][_0x303d('0x4d')]({'where':{'name':_0x2893eb,'userProfileId':_0x544a51[_0x303d('0x54')]},'raw':!![]})[_0x303d('0x2a')](function(_0xb838a0){if(_0xb838a0&&_0xb838a0[_0x303d('0x55')]===0x0){return db[_0x303d('0x2d')][_0x303d('0x4e')]({'name':_0xe16e67[_0x303d('0x30')],'resourceId':_0xe16e67['id'],'type':_0xb838a0['name'],'sectionId':_0xb838a0['id']},{})[_0x303d('0x2a')](function(){return _0x326640;});}else{return _0x326640;}})[_0x303d('0x56')](function(_0x249b91){logger[_0x303d('0x2f')](_0x303d('0x57'),_0x249b91);throw _0x249b91;});}return _0x326640;})[_0x303d('0x2a')](respondWithResult(_0x48143e,0xc9))[_0x303d('0x56')](handleError(_0x48143e,null));};exports[_0x303d('0x58')]=function(_0x819185,_0x2aa14){var _0x436724={'where':{'id':_0x819185[_0x303d('0x4c')]['id']}},_0x525f01={};_0x525f01['model']=_[_0x303d('0x38')](db[_0x303d('0x32')][_0x303d('0x33')]);_0x436724[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x525f01[_0x303d('0x36')],qs[_0x303d('0x3c')](_0x819185[_0x303d('0x37')][_0x303d('0x3c')]));_0x436724[_0x303d('0x3a')]=_0x436724[_0x303d('0x3a')]['length']?_0x436724[_0x303d('0x3a')]:_0x525f01[_0x303d('0x36')];if(_0x819185[_0x303d('0x37')][_0x303d('0x47')]){_0x436724['include']=[{'all':!![]}];}_0x436724=_[_0x303d('0x44')]({},_0x436724,_0x819185[_0x303d('0x46')]);return db[_0x303d('0x32')][_0x303d('0x4d')](_0x436724)[_0x303d('0x2a')](handleEntityNotFound(_0x2aa14,null))[_0x303d('0x2a')](function(_0x5856fb){if(_0x5856fb){var _0x5ed5d1=_0x5856fb[_0x303d('0x2b')]({'plain':!![]});_0x5ed5d1=qs[_0x303d('0x59')](_0x5ed5d1,['id','createdAt',_0x303d('0x5a')]);_0x819185[_0x303d('0x4f')]=_[_0x303d('0x59')](_0x819185[_0x303d('0x4f')],['id',_0x303d('0x5b'),_0x303d('0x5a')]);return db['Dashboard'][_0x303d('0x4e')](_[_0x303d('0x44')](_0x5ed5d1,_0x819185[_0x303d('0x4f')]),{'include':_0x819185[_0x303d('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x303d('0x2a')](function(_0x252737){var _0x1e6f94=_0x819185[_0x303d('0x50')][_0x303d('0x2b')]({'plain':!![]});if(!_0x1e6f94)throw new Error(_0x303d('0x51'));if(_0x1e6f94['role']===_0x303d('0x50')){var _0x2d8212=_0x252737[_0x303d('0x2b')]({'plain':!![]});var _0x580457=_0x303d('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x580457,'userProfileId':_0x1e6f94[_0x303d('0x54')]},'raw':!![]})[_0x303d('0x2a')](function(_0x3e527a){if(_0x3e527a&&_0x3e527a[_0x303d('0x55')]===0x0){return db[_0x303d('0x2d')][_0x303d('0x4e')]({'name':_0x2d8212[_0x303d('0x30')],'resourceId':_0x2d8212['id'],'type':_0x3e527a[_0x303d('0x30')],'sectionId':_0x3e527a['id']},{})[_0x303d('0x2a')](function(){return _0x252737;});}else{return _0x252737;}})['catch'](function(_0x248681){logger[_0x303d('0x2f')](_0x303d('0x57'),_0x248681);throw _0x248681;});}return _0x252737;});}})[_0x303d('0x2a')](respondWithResult(_0x2aa14,0xc9))[_0x303d('0x56')](handleError(_0x2aa14,null));};exports['update']=function(_0x1d48ab,_0x29ac68){if(_0x1d48ab[_0x303d('0x4f')]['id']){delete _0x1d48ab[_0x303d('0x4f')]['id'];}return db[_0x303d('0x32')][_0x303d('0x4d')]({'where':{'id':_0x1d48ab[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x29ac68,null))[_0x303d('0x2a')](saveUpdates(_0x1d48ab[_0x303d('0x4f')],null))['then'](respondWithResult(_0x29ac68,null))['catch'](handleError(_0x29ac68,null));};exports[_0x303d('0x2e')]=function(_0x6f4610,_0x51437d){return db[_0x303d('0x32')][_0x303d('0x4d')]({'where':{'id':_0x6f4610['params']['id']}})['then'](handleEntityNotFound(_0x51437d,null))[_0x303d('0x2a')](removeEntity(_0x51437d,null))[_0x303d('0x56')](handleError(_0x51437d,null));};function widgetAttributes(_0x51d85a){try{switch(_0x51d85a[_0x303d('0x34')]){case'iframe':return[{'name':_0x303d('0x5c'),'value':_0x51d85a['attrUrl']||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||_0x303d('0x5f')}];case'custom':return[{'name':'attrPath','value':_0x51d85a[_0x303d('0x60')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x51d85a[_0x303d('0x61')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a[_0x303d('0x5d')][0x0][_0x303d('0x5e')]:undefined)||_0x303d('0x62')},{'name':_0x303d('0x63'),'value':_0x51d85a[_0x303d('0x63')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a['attrs'][0x1]['value']:undefined)||_0x303d('0x64')},{'name':_0x303d('0x65'),'value':_0x51d85a['attrFontSize']||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x2]?_0x51d85a[_0x303d('0x5d')][0x2]['value']:undefined)||0xc}];case _0x303d('0x66'):return[{'name':'attrMetric','value':_0x51d85a['attrMetric']||(_0x51d85a['attrs']&&_0x51d85a['attrs'][0x0]?_0x51d85a['attrs'][0x0][_0x303d('0x5e')]:undefined)||'total'},{'name':_0x303d('0x67'),'value':_0x51d85a['attrVoiceQueues']||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a['attrs'][0x1][_0x303d('0x5e')]:undefined)||[]},{'name':_0x303d('0x65'),'value':_0x51d85a[_0x303d('0x65')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x2]?_0x51d85a[_0x303d('0x5d')][0x2][_0x303d('0x5e')]:undefined)||0x14}];case _0x303d('0x68'):case _0x303d('0x69'):return[{'name':'attrSerie1','value':_0x51d85a[_0x303d('0x6a')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a['attrs'][0x0]['value']:undefined)||_0x303d('0x6b')},{'name':_0x303d('0x6c'),'value':_0x51d85a[_0x303d('0x6c')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x1]?_0x51d85a[_0x303d('0x5d')][0x1][_0x303d('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x51d85a[_0x303d('0x6d')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x2]?_0x51d85a[_0x303d('0x5d')][0x2][_0x303d('0x5e')]:undefined)||null},{'name':_0x303d('0x67'),'value':_0x51d85a[_0x303d('0x67')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a[_0x303d('0x5d')][0x3]?_0x51d85a['attrs'][0x3][_0x303d('0x5e')]:undefined)||[]}];case _0x303d('0x6e'):return[{'name':_0x303d('0x6f'),'type':_0x51d85a[_0x303d('0x70')]||(_0x51d85a[_0x303d('0x5d')]&&_0x51d85a['attrs'][0x0]?_0x51d85a['attrs'][0x0]['type']:undefined)||null,'value':_0x51d85a['attrReport']||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x0]?_0x51d85a['attrs'][0x0][_0x303d('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x51d85a[_0x303d('0x71')]||(_0x51d85a['attrs']&&_0x51d85a[_0x303d('0x5d')][0x1]?_0x51d85a[_0x303d('0x5d')][0x1][_0x303d('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1dfdb9){logger['error'](_0x303d('0x72'),JSON[_0x303d('0x73')](_0x1dfdb9));return[];}}exports[_0x303d('0x74')]=function(_0xc6fbfd,_0x63f685,_0x6db635){if(_0xc6fbfd[_0x303d('0x4f')]['id']){delete _0xc6fbfd[_0x303d('0x4f')]['id'];}return db['Dashboard'][_0x303d('0x4d')]({'where':{'id':_0xc6fbfd[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x63f685,null))['then'](function(_0x125673){if(_0x125673){_0xc6fbfd[_0x303d('0x4f')][_0x303d('0x75')]=_0x125673['id'];_0xc6fbfd[_0x303d('0x4f')]['attrs']=widgetAttributes(_0xc6fbfd[_0x303d('0x4f')]);return db['DashboardItem'][_0x303d('0x4e')](_0xc6fbfd[_0x303d('0x4f')]);}})[_0x303d('0x2a')](respondWithResult(_0x63f685,null))[_0x303d('0x56')](handleError(_0x63f685,null));};exports[_0x303d('0x76')]=function(_0xf1f32,_0x36ee51,_0x2b4dca){var _0x4bacbe={};var _0x329da6={};var _0x4a557d;var _0x5a41b7;return db[_0x303d('0x32')][_0x303d('0x77')]({'where':{'id':_0xf1f32[_0x303d('0x4c')]['id']}})[_0x303d('0x2a')](handleEntityNotFound(_0x36ee51,null))[_0x303d('0x2a')](function(_0x728f94){if(_0x728f94){_0x4a557d=_0x728f94;_0x329da6['model']=_[_0x303d('0x38')](db[_0x303d('0x78')][_0x303d('0x33')]);_0x329da6['query']=_['keys'](_0xf1f32[_0x303d('0x37')]);_0x329da6[_0x303d('0x39')]=_['intersection'](_0x329da6[_0x303d('0x36')],_0x329da6['query']);_0x4bacbe[_0x303d('0x3a')]=_[_0x303d('0x3b')](_0x329da6[_0x303d('0x36')],qs[_0x303d('0x3c')](_0xf1f32[_0x303d('0x37')][_0x303d('0x3c')]));_0x4bacbe[_0x303d('0x3a')]=_0x4bacbe[_0x303d('0x3a')][_0x303d('0x3d')]?_0x4bacbe[_0x303d('0x3a')]:_0x329da6[_0x303d('0x36')];_0x4bacbe[_0x303d('0x3f')]=qs[_0x303d('0x40')](_0xf1f32[_0x303d('0x37')][_0x303d('0x40')]);_0x4bacbe[_0x303d('0x41')]=qs[_0x303d('0x39')](_[_0x303d('0x42')](_0xf1f32[_0x303d('0x37')],_0x329da6[_0x303d('0x39')]));if(_0xf1f32[_0x303d('0x37')][_0x303d('0x43')]){_0x4bacbe[_0x303d('0x41')]=_[_0x303d('0x44')](_0x4bacbe[_0x303d('0x41')],{'$or':_[_0x303d('0x31')](_0x4bacbe[_0x303d('0x3a')],function(_0x330c8d){var _0x43cc4e={};_0x43cc4e[_0x330c8d]={'$like':'%'+_0xf1f32[_0x303d('0x37')][_0x303d('0x43')]+'%'};return _0x43cc4e;})});}_0x4bacbe=_[_0x303d('0x44')]({},_0x4bacbe,_0xf1f32[_0x303d('0x46')]);return _0x4a557d['getItems'](_0x4bacbe);}})['then'](function(_0x5398f3){if(_0x5398f3){_0x5a41b7=_0x5398f3[_0x303d('0x3d')];if(!_0xf1f32[_0x303d('0x37')][_0x303d('0x79')](_0x303d('0x3e'))){_0x4bacbe[_0x303d('0x22')]=qs[_0x303d('0x22')](_0xf1f32[_0x303d('0x37')][_0x303d('0x22')]);_0x4bacbe[_0x303d('0x24')]=qs[_0x303d('0x24')](_0xf1f32[_0x303d('0x37')][_0x303d('0x24')]);}return _0x4a557d[_0x303d('0x76')](_0x4bacbe);}})[_0x303d('0x2a')](function(_0x3d3383){if(_0x3d3383){return _0x3d3383?{'count':_0x5a41b7,'rows':_0x3d3383}:null;}})[_0x303d('0x2a')](respondWithResult(_0x36ee51,null))[_0x303d('0x56')](handleError(_0x36ee51,null));}; \ No newline at end of file +var _0xbdaa=['defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','Dashboard','includeAll','findAll','rows','show','params','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbdaa,0x1ca));var _0xabda=function(_0x1156f8,_0x5cdd55){_0x1156f8=_0x1156f8-0x0;var _0xb5fe00=_0xbdaa[_0x1156f8];return _0xb5fe00;};'use strict';var emlformat=require(_0xabda('0x0'));var rimraf=require(_0xabda('0x1'));var zipdir=require(_0xabda('0x2'));var jsonpatch=require(_0xabda('0x3'));var rp=require(_0xabda('0x4'));var moment=require('moment');var BPromise=require(_0xabda('0x5'));var Mustache=require(_0xabda('0x6'));var util=require(_0xabda('0x7'));var path=require(_0xabda('0x8'));var sox=require(_0xabda('0x9'));var csv=require(_0xabda('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabda('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabda('0xc'));var jsforce=require(_0xabda('0xd'));var deskjs=require(_0xabda('0xe'));var toCsv=require(_0xabda('0xa'));var querystring=require(_0xabda('0xf'));var Papa=require(_0xabda('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xabda('0x11'));var hardwareService=require(_0xabda('0x12'));var logger=require(_0xabda('0x13'))(_0xabda('0x14'));var utils=require(_0xabda('0x15'));var config=require(_0xabda('0x16'));var licenseUtil=require(_0xabda('0x17'));var db=require(_0xabda('0x18'))['db'];config[_0xabda('0x19')]=_[_0xabda('0x1a')](config[_0xabda('0x19')],{'host':_0xabda('0x1b'),'port':0x18eb});var socket=require(_0xabda('0x1c'))(new Redis(config[_0xabda('0x19')]));require(_0xabda('0x1d'))[_0xabda('0x1e')](socket);function respondWithStatusCode(_0x58f3ee,_0xf81bda){_0xf81bda=_0xf81bda||0xcc;return function(_0x4449fb){if(_0x4449fb){return _0x58f3ee[_0xabda('0x1f')](_0xf81bda);}return _0x58f3ee[_0xabda('0x20')](_0xf81bda)[_0xabda('0x21')]();};}function respondWithResult(_0x4e30b4,_0x1b2096){_0x1b2096=_0x1b2096||0xc8;return function(_0x470c7d){if(_0x470c7d){return _0x4e30b4['status'](_0x1b2096)[_0xabda('0x22')](_0x470c7d);}};}function respondWithFilteredResult(_0x27ef72,_0x2b968a){return function(_0x32a816){if(_0x32a816){var _0x1a6589=typeof _0x2b968a[_0xabda('0x23')]===_0xabda('0x24')&&typeof _0x2b968a['limit']===_0xabda('0x24');var _0x534255=_0x32a816[_0xabda('0x25')];var _0xc202a3=_0x1a6589?0x0:_0x2b968a['offset'];var _0x432024=_0x1a6589?_0x32a816[_0xabda('0x25')]:_0x2b968a[_0xabda('0x23')]+_0x2b968a[_0xabda('0x26')];var _0x3c7d27;if(_0x432024>=_0x534255){_0x432024=_0x534255;_0x3c7d27=0xc8;}else{_0x3c7d27=0xce;}_0x27ef72[_0xabda('0x20')](_0x3c7d27);return _0x27ef72[_0xabda('0x27')](_0xabda('0x28'),_0xc202a3+'-'+_0x432024+'/'+_0x534255)[_0xabda('0x22')](_0x32a816);}return null;};}function patchUpdates(_0x5adcc7){return function(_0x32b66c){try{jsonpatch[_0xabda('0x29')](_0x32b66c,_0x5adcc7,!![]);}catch(_0x585ada){return BPromise[_0xabda('0x2a')](_0x585ada);}return _0x32b66c['save']();};}function saveUpdates(_0xd3b715,_0x3cde89){return function(_0x4f5c11){if(_0x4f5c11){return _0x4f5c11[_0xabda('0x2b')](_0xd3b715)[_0xabda('0x2c')](function(_0x5110b4){return _0x5110b4;});}return null;};}function removeEntity(_0x559dfe,_0x2c1b62){return function(_0x722fe){if(_0x722fe){return _0x722fe[_0xabda('0x2d')]()[_0xabda('0x2c')](function(){var _0x7e0f7=_0x722fe[_0xabda('0x2e')]({'plain':!![]});var _0x323374=_0xabda('0x2f');return db[_0xabda('0x30')][_0xabda('0x2d')]({'where':{'type':_0x323374,'resourceId':_0x7e0f7['id']}})[_0xabda('0x2c')](function(){return _0x722fe;});})[_0xabda('0x2c')](function(){_0x559dfe[_0xabda('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551691,_0x3d4c4c){return function(_0x4115d4){if(!_0x4115d4){_0x551691[_0xabda('0x1f')](0x194);}return _0x4115d4;};}function handleError(_0x239717,_0x5056e2){_0x5056e2=_0x5056e2||0x1f4;return function(_0x31891b){logger[_0xabda('0x31')](_0x31891b['stack']);if(_0x31891b[_0xabda('0x32')]){delete _0x31891b[_0xabda('0x32')];}_0x239717[_0xabda('0x20')](_0x5056e2)[_0xabda('0x33')](_0x31891b);};}exports[_0xabda('0x34')]=function(_0x5c10d2,_0x3b0ebf){var _0x139105={},_0x2edbc5={},_0x50dea6={'count':0x0,'rows':[]};var _0x14af74=_[_0xabda('0x35')](db['Dashboard'][_0xabda('0x36')],function(_0x41d302){return{'name':_0x41d302[_0xabda('0x37')],'type':_0x41d302['type']['key']};});_0x2edbc5[_0xabda('0x38')]=_[_0xabda('0x35')](_0x14af74,_0xabda('0x32'));_0x2edbc5[_0xabda('0x39')]=_[_0xabda('0x3a')](_0x5c10d2[_0xabda('0x39')]);_0x2edbc5[_0xabda('0x3b')]=_['intersection'](_0x2edbc5[_0xabda('0x38')],_0x2edbc5[_0xabda('0x39')]);_0x139105[_0xabda('0x3c')]=_[_0xabda('0x3d')](_0x2edbc5[_0xabda('0x38')],qs['fields'](_0x5c10d2[_0xabda('0x39')]['fields']));_0x139105['attributes']=_0x139105['attributes'][_0xabda('0x3e')]?_0x139105['attributes']:_0x2edbc5[_0xabda('0x38')];if(!_0x5c10d2[_0xabda('0x39')][_0xabda('0x3f')](_0xabda('0x40'))){_0x139105[_0xabda('0x26')]=qs[_0xabda('0x26')](_0x5c10d2[_0xabda('0x39')][_0xabda('0x26')]);_0x139105['offset']=qs[_0xabda('0x23')](_0x5c10d2[_0xabda('0x39')][_0xabda('0x23')]);}_0x139105[_0xabda('0x41')]=qs[_0xabda('0x42')](_0x5c10d2['query'][_0xabda('0x42')]);_0x139105[_0xabda('0x43')]=qs[_0xabda('0x3b')](_[_0xabda('0x44')](_0x5c10d2[_0xabda('0x39')],_0x2edbc5[_0xabda('0x3b')]),_0x14af74);if(_0x5c10d2['query'][_0xabda('0x45')]){_0x139105[_0xabda('0x43')]=_[_0xabda('0x46')](_0x139105['where'],{'$or':_[_0xabda('0x35')](_0x14af74,function(_0x58df59){if(_0x58df59[_0xabda('0x47')]!=='VIRTUAL'){var _0x3f2309={};_0x3f2309[_0x58df59[_0xabda('0x32')]]={'$like':'%'+_0x5c10d2[_0xabda('0x39')]['filter']+'%'};return _0x3f2309;}})});}_0x139105=_['merge']({},_0x139105,_0x5c10d2[_0xabda('0x48')]);var _0x3ec2df={'where':_0x139105['where']};return db[_0xabda('0x49')][_0xabda('0x25')](_0x3ec2df)['then'](function(_0x210100){_0x50dea6[_0xabda('0x25')]=_0x210100;if(_0x5c10d2['query'][_0xabda('0x4a')]){_0x139105['include']=[{'all':!![]}];}return db[_0xabda('0x49')][_0xabda('0x4b')](_0x139105);})[_0xabda('0x2c')](function(_0xeda080){_0x50dea6[_0xabda('0x4c')]=_0xeda080;return _0x50dea6;})[_0xabda('0x2c')](respondWithFilteredResult(_0x3b0ebf,_0x139105))['catch'](handleError(_0x3b0ebf,null));};exports[_0xabda('0x4d')]=function(_0x4e042f,_0x5da399){var _0x5c198a={'raw':![],'where':{'id':_0x4e042f[_0xabda('0x4e')]['id']}},_0x2239ec={};_0x2239ec[_0xabda('0x38')]=_[_0xabda('0x3a')](db[_0xabda('0x49')]['rawAttributes']);_0x2239ec[_0xabda('0x39')]=_[_0xabda('0x3a')](_0x4e042f['query']);_0x2239ec[_0xabda('0x3b')]=_['intersection'](_0x2239ec[_0xabda('0x38')],_0x2239ec[_0xabda('0x39')]);_0x5c198a['attributes']=_[_0xabda('0x3d')](_0x2239ec[_0xabda('0x38')],qs[_0xabda('0x4f')](_0x4e042f[_0xabda('0x39')]['fields']));_0x5c198a[_0xabda('0x3c')]=_0x5c198a['attributes'][_0xabda('0x3e')]?_0x5c198a[_0xabda('0x3c')]:_0x2239ec[_0xabda('0x38')];if(_0x4e042f['query']['includeAll']){_0x5c198a['include']=[{'all':!![]}];}_0x5c198a=_['merge']({},_0x5c198a,_0x4e042f[_0xabda('0x48')]);return db['Dashboard'][_0xabda('0x50')](_0x5c198a)['then'](handleEntityNotFound(_0x5da399,null))['then'](respondWithResult(_0x5da399,null))[_0xabda('0x51')](handleError(_0x5da399,null));};exports[_0xabda('0x52')]=function(_0x4d5ca8,_0x44a6bb){return db['Dashboard']['create'](_0x4d5ca8[_0xabda('0x53')],{})['then'](function(_0x5ba2de){var _0x7811e5=_0x4d5ca8[_0xabda('0x54')]['get']({'plain':!![]});if(!_0x7811e5)throw new Error(_0xabda('0x55'));if(_0x7811e5[_0xabda('0x56')]===_0xabda('0x54')){var _0x5ddf82=_0x5ba2de[_0xabda('0x2e')]({'plain':!![]});var _0x4a76de='CustomDashboards';return db[_0xabda('0x57')][_0xabda('0x50')]({'where':{'name':_0x4a76de,'userProfileId':_0x7811e5['userProfileId']},'raw':!![]})[_0xabda('0x2c')](function(_0x101852){if(_0x101852&&_0x101852['autoAssociation']===0x0){return db[_0xabda('0x30')]['create']({'name':_0x5ddf82[_0xabda('0x32')],'resourceId':_0x5ddf82['id'],'type':_0x101852[_0xabda('0x32')],'sectionId':_0x101852['id']},{})[_0xabda('0x2c')](function(){return _0x5ba2de;});}else{return _0x5ba2de;}})[_0xabda('0x51')](function(_0x525a45){logger[_0xabda('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x525a45);throw _0x525a45;});}return _0x5ba2de;})[_0xabda('0x2c')](respondWithResult(_0x44a6bb,0xc9))[_0xabda('0x51')](handleError(_0x44a6bb,null));};exports['clone']=function(_0x1d26b6,_0x44099d){var _0x4a2df9={'where':{'id':_0x1d26b6[_0xabda('0x4e')]['id']}},_0x493716={};_0x493716['model']=_[_0xabda('0x3a')](db['Dashboard'][_0xabda('0x36')]);_0x4a2df9[_0xabda('0x3c')]=_['intersection'](_0x493716[_0xabda('0x38')],qs[_0xabda('0x4f')](_0x1d26b6[_0xabda('0x39')][_0xabda('0x4f')]));_0x4a2df9[_0xabda('0x3c')]=_0x4a2df9[_0xabda('0x3c')][_0xabda('0x3e')]?_0x4a2df9[_0xabda('0x3c')]:_0x493716[_0xabda('0x38')];if(_0x1d26b6[_0xabda('0x39')][_0xabda('0x4a')]){_0x4a2df9['include']=[{'all':!![]}];}_0x4a2df9=_[_0xabda('0x46')]({},_0x4a2df9,_0x1d26b6[_0xabda('0x48')]);return db[_0xabda('0x49')][_0xabda('0x50')](_0x4a2df9)[_0xabda('0x2c')](handleEntityNotFound(_0x44099d,null))[_0xabda('0x2c')](function(_0x82ad2e){if(_0x82ad2e){var _0xd1773f=_0x82ad2e['get']({'plain':!![]});_0xd1773f=qs[_0xabda('0x58')](_0xd1773f,['id',_0xabda('0x59'),_0xabda('0x5a')]);_0x1d26b6[_0xabda('0x53')]=_[_0xabda('0x58')](_0x1d26b6[_0xabda('0x53')],['id',_0xabda('0x59'),_0xabda('0x5a')]);return db[_0xabda('0x49')]['create'](_[_0xabda('0x46')](_0xd1773f,_0x1d26b6[_0xabda('0x53')]),{'include':_0x1d26b6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xabda('0x2c')](function(_0x1fd6c2){var _0x65ef80=_0x1d26b6['user'][_0xabda('0x2e')]({'plain':!![]});if(!_0x65ef80)throw new Error(_0xabda('0x55'));if(_0x65ef80[_0xabda('0x56')]===_0xabda('0x54')){var _0x2ab5f7=_0x1fd6c2[_0xabda('0x2e')]({'plain':!![]});var _0x27e5be='CustomDashboards';return db[_0xabda('0x57')]['find']({'where':{'name':_0x27e5be,'userProfileId':_0x65ef80[_0xabda('0x5b')]},'raw':!![]})['then'](function(_0x4c4ad0){if(_0x4c4ad0&&_0x4c4ad0[_0xabda('0x5c')]===0x0){return db['UserProfileResource'][_0xabda('0x52')]({'name':_0x2ab5f7['name'],'resourceId':_0x2ab5f7['id'],'type':_0x4c4ad0['name'],'sectionId':_0x4c4ad0['id']},{})[_0xabda('0x2c')](function(){return _0x1fd6c2;});}else{return _0x1fd6c2;}})[_0xabda('0x51')](function(_0x5ca06e){logger[_0xabda('0x31')](_0xabda('0x5d'),_0x5ca06e);throw _0x5ca06e;});}return _0x1fd6c2;});}})[_0xabda('0x2c')](respondWithResult(_0x44099d,0xc9))[_0xabda('0x51')](handleError(_0x44099d,null));};exports[_0xabda('0x2b')]=function(_0x2049b3,_0x509d29){if(_0x2049b3['body']['id']){delete _0x2049b3[_0xabda('0x53')]['id'];}return db['Dashboard'][_0xabda('0x50')]({'where':{'id':_0x2049b3['params']['id']}})[_0xabda('0x2c')](handleEntityNotFound(_0x509d29,null))[_0xabda('0x2c')](saveUpdates(_0x2049b3[_0xabda('0x53')],null))[_0xabda('0x2c')](respondWithResult(_0x509d29,null))[_0xabda('0x51')](handleError(_0x509d29,null));};exports['destroy']=function(_0x2968c4,_0x33b364){return db[_0xabda('0x49')][_0xabda('0x50')]({'where':{'id':_0x2968c4[_0xabda('0x4e')]['id']}})[_0xabda('0x2c')](handleEntityNotFound(_0x33b364,null))[_0xabda('0x2c')](removeEntity(_0x33b364,null))[_0xabda('0x51')](handleError(_0x33b364,null));};function widgetAttributes(_0x3477e2){try{switch(_0x3477e2[_0xabda('0x47')]){case _0xabda('0x5e'):return[{'name':_0xabda('0x5f'),'value':_0x3477e2[_0xabda('0x5f')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2['attrs'][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x61')]:undefined)||'https://'}];case'custom':return[{'name':_0xabda('0x62'),'value':_0x3477e2['attrPath']||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2['attrs'][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x61')]:undefined)||''}];case _0xabda('0x63'):return[{'name':_0xabda('0x64'),'value':_0x3477e2[_0xabda('0x64')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x61')]:undefined)||'HH:mm:ss'},{'name':_0xabda('0x65'),'value':_0x3477e2[_0xabda('0x65')]||(_0x3477e2['attrs']&&_0x3477e2[_0xabda('0x60')][0x1]?_0x3477e2['attrs'][0x1][_0xabda('0x61')]:undefined)||_0xabda('0x66')},{'name':'attrFontSize','value':_0x3477e2[_0xabda('0x67')]||(_0x3477e2['attrs']&&_0x3477e2['attrs'][0x2]?_0x3477e2[_0xabda('0x60')][0x2][_0xabda('0x61')]:undefined)||0xc}];case _0xabda('0x68'):return[{'name':_0xabda('0x69'),'value':_0x3477e2[_0xabda('0x69')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x0]?_0x3477e2[_0xabda('0x60')][0x0]['value']:undefined)||_0xabda('0x6a')},{'name':_0xabda('0x6b'),'value':_0x3477e2[_0xabda('0x6b')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x1]?_0x3477e2[_0xabda('0x60')][0x1]['value']:undefined)||[]},{'name':_0xabda('0x67'),'value':_0x3477e2[_0xabda('0x67')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x2]?_0x3477e2[_0xabda('0x60')][0x2][_0xabda('0x61')]:undefined)||0x14}];case _0xabda('0x6c'):case'pie-chart':return[{'name':_0xabda('0x6d'),'value':_0x3477e2['attrSerie1']||(_0x3477e2['attrs']&&_0x3477e2[_0xabda('0x60')][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x61')]:undefined)||'total'},{'name':_0xabda('0x6e'),'value':_0x3477e2[_0xabda('0x6e')]||(_0x3477e2['attrs']&&_0x3477e2[_0xabda('0x60')][0x1]?_0x3477e2['attrs'][0x1][_0xabda('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x3477e2[_0xabda('0x6f')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2['attrs'][0x2]?_0x3477e2[_0xabda('0x60')][0x2][_0xabda('0x61')]:undefined)||null},{'name':_0xabda('0x6b'),'value':_0x3477e2[_0xabda('0x6b')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x3]?_0x3477e2[_0xabda('0x60')][0x3][_0xabda('0x61')]:undefined)||[]}];case'web-report':return[{'name':_0xabda('0x70'),'type':_0x3477e2[_0xabda('0x71')]||(_0x3477e2['attrs']&&_0x3477e2[_0xabda('0x60')][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x47')]:undefined)||null,'value':_0x3477e2['attrReport']||(_0x3477e2['attrs']&&_0x3477e2[_0xabda('0x60')][0x0]?_0x3477e2[_0xabda('0x60')][0x0][_0xabda('0x61')]:undefined)||null},{'name':_0xabda('0x72'),'value':_0x3477e2[_0xabda('0x72')]||(_0x3477e2[_0xabda('0x60')]&&_0x3477e2[_0xabda('0x60')][0x1]?_0x3477e2[_0xabda('0x60')][0x1][_0xabda('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x5c2791){logger[_0xabda('0x31')]('widgetAttributes:\x20%s',JSON[_0xabda('0x73')](_0x5c2791));return[];}}exports[_0xabda('0x74')]=function(_0x34a806,_0x29193e,_0x2f4420){if(_0x34a806[_0xabda('0x53')]['id']){delete _0x34a806[_0xabda('0x53')]['id'];}return db[_0xabda('0x49')][_0xabda('0x50')]({'where':{'id':_0x34a806[_0xabda('0x4e')]['id']}})[_0xabda('0x2c')](handleEntityNotFound(_0x29193e,null))['then'](function(_0xb7ec0){if(_0xb7ec0){_0x34a806[_0xabda('0x53')][_0xabda('0x75')]=_0xb7ec0['id'];_0x34a806[_0xabda('0x53')][_0xabda('0x60')]=widgetAttributes(_0x34a806['body']);return db[_0xabda('0x76')][_0xabda('0x52')](_0x34a806[_0xabda('0x53')]);}})[_0xabda('0x2c')](respondWithResult(_0x29193e,null))[_0xabda('0x51')](handleError(_0x29193e,null));};exports[_0xabda('0x77')]=function(_0x4af653,_0x154726,_0x319d01){var _0xc50685={};var _0x491cc6={};var _0x2d5009;var _0x26b153;return db[_0xabda('0x49')][_0xabda('0x78')]({'where':{'id':_0x4af653[_0xabda('0x4e')]['id']}})[_0xabda('0x2c')](handleEntityNotFound(_0x154726,null))[_0xabda('0x2c')](function(_0x223597){if(_0x223597){_0x2d5009=_0x223597;_0x491cc6['model']=_[_0xabda('0x3a')](db[_0xabda('0x76')][_0xabda('0x36')]);_0x491cc6[_0xabda('0x39')]=_[_0xabda('0x3a')](_0x4af653[_0xabda('0x39')]);_0x491cc6[_0xabda('0x3b')]=_[_0xabda('0x3d')](_0x491cc6[_0xabda('0x38')],_0x491cc6[_0xabda('0x39')]);_0xc50685[_0xabda('0x3c')]=_[_0xabda('0x3d')](_0x491cc6[_0xabda('0x38')],qs[_0xabda('0x4f')](_0x4af653[_0xabda('0x39')][_0xabda('0x4f')]));_0xc50685[_0xabda('0x3c')]=_0xc50685[_0xabda('0x3c')][_0xabda('0x3e')]?_0xc50685[_0xabda('0x3c')]:_0x491cc6[_0xabda('0x38')];_0xc50685['order']=qs['sort'](_0x4af653[_0xabda('0x39')][_0xabda('0x42')]);_0xc50685['where']=qs[_0xabda('0x3b')](_[_0xabda('0x44')](_0x4af653['query'],_0x491cc6['filters']));if(_0x4af653['query'][_0xabda('0x45')]){_0xc50685[_0xabda('0x43')]=_[_0xabda('0x46')](_0xc50685[_0xabda('0x43')],{'$or':_[_0xabda('0x35')](_0xc50685[_0xabda('0x3c')],function(_0x479218){var _0x2483ad={};_0x2483ad[_0x479218]={'$like':'%'+_0x4af653[_0xabda('0x39')][_0xabda('0x45')]+'%'};return _0x2483ad;})});}_0xc50685=_[_0xabda('0x46')]({},_0xc50685,_0x4af653[_0xabda('0x48')]);return _0x2d5009[_0xabda('0x77')](_0xc50685);}})[_0xabda('0x2c')](function(_0x16279e){if(_0x16279e){_0x26b153=_0x16279e[_0xabda('0x3e')];if(!_0x4af653['query'][_0xabda('0x3f')]('nolimit')){_0xc50685[_0xabda('0x26')]=qs[_0xabda('0x26')](_0x4af653[_0xabda('0x39')]['limit']);_0xc50685[_0xabda('0x23')]=qs[_0xabda('0x23')](_0x4af653[_0xabda('0x39')][_0xabda('0x23')]);}return _0x2d5009[_0xabda('0x77')](_0xc50685);}})['then'](function(_0x16713c){if(_0x16713c){return _0x16713c?{'count':_0x26b153,'rows':_0x16713c}:null;}})[_0xabda('0x2c')](respondWithResult(_0x154726,null))[_0xabda('0x51')](handleError(_0x154726,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dccf52a..2cdae80 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 _0xe16e=['update','emit','hook','events','../../mysqldb','Dashboard','save'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe16e,0x81));var _0xee16=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xe16e[_0x4ae829];return _0x256b31;};'use strict';var EventEmitter=require(_0xee16('0x0'));var Dashboard=require(_0xee16('0x1'))['db'][_0xee16('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee16('0x3'),'afterUpdate':_0xee16('0x4'),'afterDestroy':'remove'};function emitEvent(_0x25b5d6){return function(_0x1928d1,_0x58eaa6,_0x3d6d03){DashboardEvents[_0xee16('0x5')](_0x25b5d6+':'+_0x1928d1['id'],_0x1928d1);DashboardEvents['emit'](_0x25b5d6,_0x1928d1);_0x3d6d03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xee16('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x6578=['setMaxListeners','save','update','remove','../../mysqldb','Dashboard'];(function(_0x282f68,_0x239640){var _0x1aba38=function(_0x5955c8){while(--_0x5955c8){_0x282f68['push'](_0x282f68['shift']());}};_0x1aba38(++_0x239640);}(_0x6578,0xdc));var _0x8657=function(_0xed3608,_0x471359){_0xed3608=_0xed3608-0x0;var _0x4ba422=_0x6578[_0xed3608];return _0x4ba422;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x8657('0x0'))['db'][_0x8657('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8657('0x2')](0x0);var events={'afterCreate':_0x8657('0x3'),'afterUpdate':_0x8657('0x4'),'afterDestroy':_0x8657('0x5')};function emitEvent(_0x28bb59){return function(_0x50064a,_0x48e76b,_0x105a7c){DashboardEvents['emit'](_0x28bb59+':'+_0x50064a['id'],_0x50064a);DashboardEvents['emit'](_0x28bb59,_0x50064a);_0x105a7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5cb33c1..c9d4ed9 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 _0xa3e2=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','../../config/logger'];(function(_0x71185f,_0x371d74){var _0x160ffe=function(_0x57feba){while(--_0x57feba){_0x71185f['push'](_0x71185f['shift']());}};_0x160ffe(++_0x371d74);}(_0xa3e2,0x1cc));var _0x2a3e=function(_0x137da3,_0xa6277a){_0x137da3=_0x137da3-0x0;var _0x1ac46c=_0xa3e2[_0x137da3];return _0x1ac46c;};'use strict';var _=require(_0x2a3e('0x0'));var util=require('util');var logger=require(_0x2a3e('0x1'))(_0x2a3e('0x2'));var moment=require(_0x2a3e('0x3'));var BPromise=require(_0x2a3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a3e('0x5'));var rimraf=require(_0x2a3e('0x6'));var config=require(_0x2a3e('0x7'));var attributes=require(_0x2a3e('0x8'));module[_0x2a3e('0x9')]=function(_0x440ef9,_0x58e4ea){return _0x440ef9['define'](_0x2a3e('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x897b=['moment','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger','api'];(function(_0x2ebca0,_0x23455e){var _0x4748ec=function(_0x497834){while(--_0x497834){_0x2ebca0['push'](_0x2ebca0['shift']());}};_0x4748ec(++_0x23455e);}(_0x897b,0x1b6));var _0xb897=function(_0x48f710,_0x37517f){_0x48f710=_0x48f710-0x0;var _0x113d0a=_0x897b[_0x48f710];return _0x113d0a;};'use strict';var _=require(_0xb897('0x0'));var util=require(_0xb897('0x1'));var logger=require(_0xb897('0x2'))(_0xb897('0x3'));var moment=require(_0xb897('0x4'));var BPromise=require('bluebird');var rp=require(_0xb897('0x5'));var fs=require('fs');var path=require(_0xb897('0x6'));var rimraf=require(_0xb897('0x7'));var config=require(_0xb897('0x8'));var attributes=require(_0xb897('0x9'));module[_0xb897('0xa')]=function(_0x26b74e,_0x12a7e2){return _0x26b74e[_0xb897('0xb')]('Dashboard',attributes,{'tableName':_0xb897('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 46df6b0..8dc1bed 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 _0x9368=['then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0x9368,0x166));var _0x8936=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x9368[_0x462999];return _0x4b1366;};'use strict';var _=require(_0x8936('0x0'));var util=require(_0x8936('0x1'));var moment=require(_0x8936('0x2'));var BPromise=require(_0x8936('0x3'));var rs=require(_0x8936('0x4'));var fs=require('fs');var Redis=require(_0x8936('0x5'));var db=require(_0x8936('0x6'))['db'];var utils=require(_0x8936('0x7'));var logger=require('../../config/logger')(_0x8936('0x8'));var config=require(_0x8936('0x9'));var jayson=require(_0x8936('0xa'));var client=jayson[_0x8936('0xb')][_0x8936('0xc')]({'port':0x232a});config[_0x8936('0xd')]=_[_0x8936('0xe')](config[_0x8936('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8936('0xf'))(new Redis(config[_0x8936('0xd')]));require(_0x8936('0x10'))[_0x8936('0x11')](socket);function respondWithRpcPromise(_0x4b294c,_0x4bb512,_0x2a4e3f){return new BPromise(function(_0x239a25,_0x1136da){return client[_0x8936('0x12')](_0x4b294c,_0x2a4e3f)[_0x8936('0x13')](function(_0x54528d){logger['info'](_0x8936('0x14'),_0x4bb512,'request\x20sent');logger[_0x8936('0x15')](_0x8936('0x16'),_0x4bb512,_0x8936('0x17'),JSON[_0x8936('0x18')](_0x54528d));if(_0x54528d[_0x8936('0x19')]){if(_0x54528d[_0x8936('0x19')][_0x8936('0x1a')]===0x1f4){logger[_0x8936('0x19')](_0x8936('0x14'),_0x4bb512,_0x54528d['error']['message']);return _0x1136da(_0x54528d[_0x8936('0x19')][_0x8936('0x1b')]);}logger[_0x8936('0x19')]('Dashboard,\x20%s,\x20%s',_0x4bb512,_0x54528d[_0x8936('0x19')][_0x8936('0x1b')]);return _0x239a25(_0x54528d[_0x8936('0x19')]['message']);}else{logger[_0x8936('0x1c')](_0x8936('0x14'),_0x4bb512,_0x8936('0x17'));_0x239a25(_0x54528d['result'][_0x8936('0x1b')]);}})['catch'](function(_0x4c3b26){logger[_0x8936('0x19')](_0x8936('0x14'),_0x4bb512,_0x4c3b26);_0x1136da(_0x4c3b26);});});} \ No newline at end of file +var _0x6b35=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./dashboard.socket','register'];(function(_0xdfd570,_0x3d0f07){var _0x12faa7=function(_0x343982){while(--_0x343982){_0xdfd570['push'](_0xdfd570['shift']());}};_0x12faa7(++_0x3d0f07);}(_0x6b35,0x1f1));var _0x56b3=function(_0x3f90cc,_0x3f5fcc){_0x3f90cc=_0x3f90cc-0x0;var _0x43fd34=_0x6b35[_0x3f90cc];return _0x43fd34;};'use strict';var _=require(_0x56b3('0x0'));var util=require(_0x56b3('0x1'));var moment=require(_0x56b3('0x2'));var BPromise=require(_0x56b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56b3('0x4'));var db=require(_0x56b3('0x5'))['db'];var utils=require(_0x56b3('0x6'));var logger=require('../../config/logger')(_0x56b3('0x7'));var config=require(_0x56b3('0x8'));var jayson=require(_0x56b3('0x9'));var client=jayson['client'][_0x56b3('0xa')]({'port':0x232a});config[_0x56b3('0xb')]=_[_0x56b3('0xc')](config[_0x56b3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x56b3('0xd'))(new Redis(config[_0x56b3('0xb')]));require(_0x56b3('0xe'))[_0x56b3('0xf')](socket);function respondWithRpcPromise(_0x2eda75,_0x40887e,_0x3b2a5e){return new BPromise(function(_0x1addf4,_0x563943){return client['request'](_0x2eda75,_0x3b2a5e)['then'](function(_0x31f5ed){logger[_0x56b3('0x10')](_0x56b3('0x11'),_0x40887e,_0x56b3('0x12'));logger[_0x56b3('0x13')](_0x56b3('0x14'),_0x40887e,_0x56b3('0x12'),JSON[_0x56b3('0x15')](_0x31f5ed));if(_0x31f5ed[_0x56b3('0x16')]){if(_0x31f5ed[_0x56b3('0x16')][_0x56b3('0x17')]===0x1f4){logger[_0x56b3('0x16')](_0x56b3('0x11'),_0x40887e,_0x31f5ed[_0x56b3('0x16')]['message']);return _0x563943(_0x31f5ed[_0x56b3('0x16')][_0x56b3('0x18')]);}logger[_0x56b3('0x16')](_0x56b3('0x11'),_0x40887e,_0x31f5ed['error'][_0x56b3('0x18')]);return _0x1addf4(_0x31f5ed[_0x56b3('0x16')][_0x56b3('0x18')]);}else{logger['info'](_0x56b3('0x11'),_0x40887e,'request\x20sent');_0x1addf4(_0x31f5ed[_0x56b3('0x19')][_0x56b3('0x18')]);}})[_0x56b3('0x1a')](function(_0x125a26){logger[_0x56b3('0x16')](_0x56b3('0x11'),_0x40887e,_0x125a26);_0x563943(_0x125a26);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1341288..d878e5e 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 _0xc8d4=['register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x565fc3,_0x5153bd){var _0x5818a6=function(_0xf535b3){while(--_0xf535b3){_0x565fc3['push'](_0x565fc3['shift']());}};_0x5818a6(++_0x5153bd);}(_0xc8d4,0x6b));var _0x4c8d=function(_0x3e83d1,_0x389b18){_0x3e83d1=_0x3e83d1-0x0;var _0x3ec321=_0xc8d4[_0x3e83d1];return _0x3ec321;};'use strict';var DashboardEvents=require(_0x4c8d('0x0'));var events=[_0x4c8d('0x1'),_0x4c8d('0x2'),_0x4c8d('0x3')];function createListener(_0x21871a,_0x322cb7){return function(_0x2f0d41){_0x322cb7[_0x4c8d('0x4')](_0x21871a,_0x2f0d41);};}function removeListener(_0x4dd581,_0x4b2c75){return function(){DashboardEvents['removeListener'](_0x4dd581,_0x4b2c75);};}exports[_0x4c8d('0x5')]=function(_0x3c5a5b){for(var _0x4a9c5b=0x0,_0x415500=events[_0x4c8d('0x6')];_0x4a9c5b<_0x415500;_0x4a9c5b++){var _0x5e7f78=events[_0x4a9c5b];var _0x1afe25=createListener(_0x4c8d('0x7')+_0x5e7f78,_0x3c5a5b);DashboardEvents['on'](_0x5e7f78,_0x1afe25);}}; \ No newline at end of file +var _0x072e=['update','emit','register','length','dashboard:','save','remove'];(function(_0x43b149,_0x4ae753){var _0x5eaf84=function(_0x4ef1f1){while(--_0x4ef1f1){_0x43b149['push'](_0x43b149['shift']());}};_0x5eaf84(++_0x4ae753);}(_0x072e,0x18d));var _0xe072=function(_0x41b6a0,_0x1a004a){_0x41b6a0=_0x41b6a0-0x0;var _0xa8d057=_0x072e[_0x41b6a0];return _0xa8d057;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe072('0x0'),_0xe072('0x1'),_0xe072('0x2')];function createListener(_0x5439fa,_0x4eec01){return function(_0x2e851e){_0x4eec01[_0xe072('0x3')](_0x5439fa,_0x2e851e);};}function removeListener(_0x5b0529,_0x29ac2c){return function(){DashboardEvents['removeListener'](_0x5b0529,_0x29ac2c);};}exports[_0xe072('0x4')]=function(_0x37914c){for(var _0x2b143c=0x0,_0x36ab70=events[_0xe072('0x5')];_0x2b143c<_0x36ab70;_0x2b143c++){var _0x20723f=events[_0x2b143c];var _0x17e0b4=createListener(_0xe072('0x6')+_0x20723f,_0x37914c);DashboardEvents['on'](_0x20723f,_0x17e0b4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1f6cfb4..637f468 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 _0xb6a3=['/:id/clone','clone','/:id/items','addItem','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','show','getItems','post'];(function(_0x522aa7,_0x5e1bba){var _0x5aa82a=function(_0x3aba28){while(--_0x3aba28){_0x522aa7['push'](_0x522aa7['shift']());}};_0x5aa82a(++_0x5e1bba);}(_0xb6a3,0x75));var _0x3b6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb6a3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3b6a('0x0'));var util=require('util');var path=require(_0x3b6a('0x1'));var timeout=require(_0x3b6a('0x2'));var express=require(_0x3b6a('0x3'));var router=express[_0x3b6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b6a('0x6'));var controller=require(_0x3b6a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b6a('0x8')]);router[_0x3b6a('0x9')](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0xc')]);router['get']('/:id/items',auth[_0x3b6a('0xb')](),controller[_0x3b6a('0xd')]);router[_0x3b6a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b6a('0xe')](_0x3b6a('0xf'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x10')]);router[_0x3b6a('0xe')](_0x3b6a('0x11'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x12')]);router['put'](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller['update']);router[_0x3b6a('0x13')](_0x3b6a('0xa'),auth[_0x3b6a('0xb')](),controller[_0x3b6a('0x14')]);module[_0x3b6a('0x15')]=router; \ No newline at end of file +var _0x65b0=['./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x99ae2c,_0x12770d){var _0xdf81d1=function(_0x84507){while(--_0x84507){_0x99ae2c['push'](_0x99ae2c['shift']());}};_0xdf81d1(++_0x12770d);}(_0x65b0,0xb4));var _0x065b=function(_0xa62710,_0x48f2b8){_0xa62710=_0xa62710-0x0;var _0x26043b=_0x65b0[_0xa62710];return _0x26043b;};'use strict';var multer=require(_0x065b('0x0'));var util=require(_0x065b('0x1'));var path=require(_0x065b('0x2'));var timeout=require(_0x065b('0x3'));var express=require('express');var router=express[_0x065b('0x4')]();var fs_extra=require(_0x065b('0x5'));var auth=require(_0x065b('0x6'));var interaction=require(_0x065b('0x7'));var config=require(_0x065b('0x8'));var controller=require(_0x065b('0x9'));router['get']('/',auth[_0x065b('0xa')](),controller[_0x065b('0xb')]);router[_0x065b('0xc')](_0x065b('0xd'),auth[_0x065b('0xa')](),controller[_0x065b('0xe')]);router[_0x065b('0xc')](_0x065b('0xf'),auth['isAuthenticated'](),controller[_0x065b('0x10')]);router[_0x065b('0x11')]('/',auth[_0x065b('0xa')](),controller[_0x065b('0x12')]);router[_0x065b('0x11')](_0x065b('0x13'),auth['isAuthenticated'](),controller[_0x065b('0x14')]);router[_0x065b('0x11')](_0x065b('0xf'),auth[_0x065b('0xa')](),controller[_0x065b('0x15')]);router[_0x065b('0x16')](_0x065b('0xd'),auth['isAuthenticated'](),controller[_0x065b('0x17')]);router[_0x065b('0x18')](_0x065b('0xd'),auth[_0x065b('0xa')](),controller[_0x065b('0x19')]);module[_0x065b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5f1ff88..29c7684 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 _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x57556b,_0x29e57c){var _0x501ac7=function(_0x16f2bb){while(--_0x16f2bb){_0x57556b['push'](_0x57556b['shift']());}};_0x501ac7(++_0x29e57c);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x4819=['long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','squel','lodash','exports','STRING','TEXT'];(function(_0x5a523d,_0x39b2cf){var _0x977bfc=function(_0x23929f){while(--_0x23929f){_0x5a523d['push'](_0x5a523d['shift']());}};_0x977bfc(++_0x39b2cf);}(_0x4819,0xcd));var _0x9481=function(_0x460dae,_0x3a907f){_0x460dae=_0x460dae-0x0;var _0x36e6d0=_0x4819[_0x460dae];return _0x36e6d0;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9481('0x0'));var _=require(_0x9481('0x1'));module[_0x9481('0x2')]={'title':{'type':Sequelize[_0x9481('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9481('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9481('0x4')](_0x9481('0x5')),'get':function(){try{return JSON[_0x9481('0x6')](this[_0x9481('0x7')](_0x9481('0x8')));}catch(_0x5ac51c){return[];}},'set':function(_0x4d9e3a){try{this['setDataValue']('attrs',JSON[_0x9481('0x9')](_0x4d9e3a));}catch(_0x6c6a08){this[_0x9481('0xa')](_0x9481('0x8'),JSON[_0x9481('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9481('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9481('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9481('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9481('0x3')],'allowNull':![],'defaultValue':_0x9481('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9481('0x3')]},'titleFontSize':{'type':Sequelize[_0x9481('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 15f19b3..db90eea 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 _0x582d=['attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','show','params','model','rawAttributes','query','keys','filters','intersection','fields','attributes','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x582d,0x11c));var _0xd582=function(_0x3bf1ca,_0x1dcc3d){_0x3bf1ca=_0x3bf1ca-0x0;var _0x30d550=_0x582d[_0x3bf1ca];return _0x30d550;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require(_0xd582('0x1'));var zipdir=require(_0xd582('0x2'));var jsonpatch=require(_0xd582('0x3'));var rp=require(_0xd582('0x4'));var moment=require(_0xd582('0x5'));var BPromise=require(_0xd582('0x6'));var Mustache=require(_0xd582('0x7'));var util=require(_0xd582('0x8'));var path=require(_0xd582('0x9'));var sox=require(_0xd582('0xa'));var csv=require(_0xd582('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd582('0xc'));var _=require(_0xd582('0xd'));var squel=require('squel');var crypto=require(_0xd582('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd582('0xb'));var querystring=require(_0xd582('0xf'));var Papa=require(_0xd582('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd582('0x11'));var as=require(_0xd582('0x12'));var hardwareService=require(_0xd582('0x13'));var logger=require(_0xd582('0x14'))(_0xd582('0x15'));var utils=require(_0xd582('0x16'));var config=require(_0xd582('0x17'));var licenseUtil=require(_0xd582('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd582('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd582('0x1a'))(new Redis(config[_0xd582('0x19')]));require(_0xd582('0x1b'))[_0xd582('0x1c')](socket);function respondWithStatusCode(_0x8c6bd9,_0xbe1f9c){_0xbe1f9c=_0xbe1f9c||0xcc;return function(_0x3e1a09){if(_0x3e1a09){return _0x8c6bd9['sendStatus'](_0xbe1f9c);}return _0x8c6bd9[_0xd582('0x1d')](_0xbe1f9c)[_0xd582('0x1e')]();};}function respondWithResult(_0x189e99,_0x450cc0){_0x450cc0=_0x450cc0||0xc8;return function(_0x50cbd4){if(_0x50cbd4){return _0x189e99[_0xd582('0x1d')](_0x450cc0)[_0xd582('0x1f')](_0x50cbd4);}};}function respondWithFilteredResult(_0x268418,_0x2844d4){return function(_0x197453){if(_0x197453){var _0x20ee2b=typeof _0x2844d4['offset']==='undefined'&&typeof _0x2844d4[_0xd582('0x20')]===_0xd582('0x21');var _0x57c528=_0x197453[_0xd582('0x22')];var _0x5d4422=_0x20ee2b?0x0:_0x2844d4[_0xd582('0x23')];var _0x1bb015=_0x20ee2b?_0x197453[_0xd582('0x22')]:_0x2844d4[_0xd582('0x23')]+_0x2844d4[_0xd582('0x20')];var _0x38edeb;if(_0x1bb015>=_0x57c528){_0x1bb015=_0x57c528;_0x38edeb=0xc8;}else{_0x38edeb=0xce;}_0x268418[_0xd582('0x1d')](_0x38edeb);return _0x268418['set'](_0xd582('0x24'),_0x5d4422+'-'+_0x1bb015+'/'+_0x57c528)[_0xd582('0x1f')](_0x197453);}return null;};}function patchUpdates(_0xbc0fa2){return function(_0x4a7738){try{jsonpatch[_0xd582('0x25')](_0x4a7738,_0xbc0fa2,!![]);}catch(_0x3c47ec){return BPromise['reject'](_0x3c47ec);}return _0x4a7738[_0xd582('0x26')]();};}function saveUpdates(_0x5a2316,_0xaf6d12){return function(_0xf3c224){if(_0xf3c224){return _0xf3c224['update'](_0x5a2316)[_0xd582('0x27')](function(_0x14df28){return _0x14df28;});}return null;};}function removeEntity(_0x51f89a,_0x8e8b4f){return function(_0x58b472){if(_0x58b472){return _0x58b472[_0xd582('0x28')]()[_0xd582('0x27')](function(){_0x51f89a[_0xd582('0x1d')](0xcc)[_0xd582('0x1e')]();});}};}function handleEntityNotFound(_0x251ba9,_0x46cdcc){return function(_0x36e281){if(!_0x36e281){_0x251ba9[_0xd582('0x29')](0x194);}return _0x36e281;};}function handleError(_0x39da4d,_0x183962){_0x183962=_0x183962||0x1f4;return function(_0x5cbd9a){logger[_0xd582('0x2a')](_0x5cbd9a[_0xd582('0x2b')]);if(_0x5cbd9a['name']){delete _0x5cbd9a[_0xd582('0x2c')];}_0x39da4d[_0xd582('0x1d')](_0x183962)['send'](_0x5cbd9a);};}exports[_0xd582('0x2d')]=function(_0x3c94db,_0x28d929){var _0x40195e={'raw':![],'where':{'id':_0x3c94db[_0xd582('0x2e')]['id']}},_0x5b0817={};_0x5b0817[_0xd582('0x2f')]=_['keys'](db['DashboardItem'][_0xd582('0x30')]);_0x5b0817[_0xd582('0x31')]=_[_0xd582('0x32')](_0x3c94db[_0xd582('0x31')]);_0x5b0817[_0xd582('0x33')]=_[_0xd582('0x34')](_0x5b0817[_0xd582('0x2f')],_0x5b0817[_0xd582('0x31')]);_0x40195e['attributes']=_[_0xd582('0x34')](_0x5b0817['model'],qs[_0xd582('0x35')](_0x3c94db[_0xd582('0x31')][_0xd582('0x35')]));_0x40195e[_0xd582('0x36')]=_0x40195e[_0xd582('0x36')]['length']?_0x40195e[_0xd582('0x36')]:_0x5b0817[_0xd582('0x2f')];if(_0x3c94db['query']['includeAll']){_0x40195e['include']=[{'all':!![]}];}_0x40195e=_['merge']({},_0x40195e,_0x3c94db[_0xd582('0x37')]);return db[_0xd582('0x38')][_0xd582('0x39')](_0x40195e)[_0xd582('0x27')](handleEntityNotFound(_0x28d929,null))[_0xd582('0x27')](respondWithResult(_0x28d929,null))['catch'](handleError(_0x28d929,null));};exports[_0xd582('0x28')]=function(_0x2209ce,_0x369345){return db[_0xd582('0x38')][_0xd582('0x39')]({'where':{'id':_0x2209ce['params']['id']}})[_0xd582('0x27')](handleEntityNotFound(_0x369345,null))[_0xd582('0x27')](removeEntity(_0x369345,null))[_0xd582('0x3a')](handleError(_0x369345,null));};function widgetAttributes(_0x550fb5){try{switch(_0x550fb5[_0xd582('0x3b')]){case _0xd582('0x3c'):return[{'name':_0xd582('0x3d'),'value':_0x550fb5[_0xd582('0x3d')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5[_0xd582('0x3e')][0x0]['value']:undefined)||_0xd582('0x3f')}];case _0xd582('0x40'):return[{'name':_0xd582('0x41'),'value':_0x550fb5['attrPath']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||''}];case _0xd582('0x43'):return[{'name':_0xd582('0x44'),'value':_0x550fb5[_0xd582('0x44')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5['attrs'][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x45')},{'name':_0xd582('0x46'),'value':_0x550fb5['attrTimezone']||(_0x550fb5['attrs']&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||_0xd582('0x47')},{'name':_0xd582('0x48'),'value':_0x550fb5['attrFontSize']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2]['value']:undefined)||0xc}];case _0xd582('0x49'):return[{'name':'attrMetric','value':_0x550fb5[_0xd582('0x4a')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x4b')},{'name':'attrVoiceQueues','value':_0x550fb5[_0xd582('0x4c')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||[]},{'name':_0xd582('0x48'),'value':_0x550fb5[_0xd582('0x48')]||(_0x550fb5['attrs']&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2][_0xd582('0x42')]:undefined)||0x14}];case'multibar-chart':case _0xd582('0x4d'):return[{'name':_0xd582('0x4e'),'value':_0x550fb5['attrSerie1']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5['attrs'][0x0][_0xd582('0x42')]:undefined)||_0xd582('0x4b')},{'name':_0xd582('0x4f'),'value':_0x550fb5[_0xd582('0x4f')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x50'),'value':_0x550fb5['attrSerie3']||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x2]?_0x550fb5[_0xd582('0x3e')][0x2][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x4c'),'value':_0x550fb5[_0xd582('0x4c')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x3]?_0x550fb5['attrs'][0x3]['value']:undefined)||[]}];case _0xd582('0x51'):return[{'name':'attrReport','type':_0x550fb5[_0xd582('0x52')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5['attrs'][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x3b')]:undefined)||null,'value':_0x550fb5[_0xd582('0x53')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x0]?_0x550fb5[_0xd582('0x3e')][0x0][_0xd582('0x42')]:undefined)||null},{'name':_0xd582('0x54'),'value':_0x550fb5[_0xd582('0x54')]||(_0x550fb5[_0xd582('0x3e')]&&_0x550fb5[_0xd582('0x3e')][0x1]?_0x550fb5[_0xd582('0x3e')][0x1][_0xd582('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x1080e9){logger[_0xd582('0x2a')](_0xd582('0x55'),JSON[_0xd582('0x56')](_0x1080e9));return[];}}exports[_0xd582('0x57')]=function(_0x1a9cb7,_0x4eaf0c){if(_0x1a9cb7['body']){_0x1a9cb7['body'][_0xd582('0x3e')]=widgetAttributes(_0x1a9cb7[_0xd582('0x58')]);}return db[_0xd582('0x38')][_0xd582('0x57')](_0x1a9cb7[_0xd582('0x58')],{})[_0xd582('0x27')](respondWithResult(_0x4eaf0c,0xc9))[_0xd582('0x3a')](handleError(_0x4eaf0c,null));};exports['update']=function(_0x3dbd4c,_0x1c3a57){if(_0x3dbd4c['body']['id']){delete _0x3dbd4c[_0xd582('0x58')]['id'];}_0x3dbd4c[_0xd582('0x58')][_0xd582('0x3e')]=widgetAttributes(_0x3dbd4c[_0xd582('0x58')]);return db[_0xd582('0x38')]['find']({'where':{'id':_0x3dbd4c[_0xd582('0x2e')]['id']}})[_0xd582('0x27')](handleEntityNotFound(_0x1c3a57,null))[_0xd582('0x27')](saveUpdates(_0x3dbd4c[_0xd582('0x58')],null))[_0xd582('0x27')](respondWithResult(_0x1c3a57,null))[_0xd582('0x3a')](handleError(_0x1c3a57,null));}; \ No newline at end of file +var _0xc8ee=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','params','model','rawAttributes','query','filters','intersection','attributes','fields','merge','options','DashboardItem','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x5bc7c9,_0x21b41a){var _0x59717b=function(_0x677fe7){while(--_0x677fe7){_0x5bc7c9['push'](_0x5bc7c9['shift']());}};_0x59717b(++_0x21b41a);}(_0xc8ee,0x160));var _0xec8e=function(_0x50a7ef,_0xa10c4c){_0x50a7ef=_0x50a7ef-0x0;var _0x57da7e=_0xc8ee[_0x50a7ef];return _0x57da7e;};'use strict';var emlformat=require(_0xec8e('0x0'));var rimraf=require(_0xec8e('0x1'));var zipdir=require(_0xec8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec8e('0x3'));var moment=require(_0xec8e('0x4'));var BPromise=require(_0xec8e('0x5'));var Mustache=require(_0xec8e('0x6'));var util=require(_0xec8e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xec8e('0x8'));var ejs=require(_0xec8e('0x9'));var fs=require('fs');var fs_extra=require(_0xec8e('0xa'));var _=require(_0xec8e('0xb'));var squel=require(_0xec8e('0xc'));var crypto=require(_0xec8e('0xd'));var jsforce=require(_0xec8e('0xe'));var deskjs=require(_0xec8e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xec8e('0x10'));var Papa=require(_0xec8e('0x11'));var Redis=require(_0xec8e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xec8e('0x13'));var as=require(_0xec8e('0x14'));var hardwareService=require(_0xec8e('0x15'));var logger=require(_0xec8e('0x16'))(_0xec8e('0x17'));var utils=require(_0xec8e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xec8e('0x19'));var db=require(_0xec8e('0x1a'))['db'];config[_0xec8e('0x1b')]=_[_0xec8e('0x1c')](config['redis'],{'host':_0xec8e('0x1d'),'port':0x18eb});var socket=require(_0xec8e('0x1e'))(new Redis(config[_0xec8e('0x1b')]));require(_0xec8e('0x1f'))[_0xec8e('0x20')](socket);function respondWithStatusCode(_0x518354,_0xcd0d0e){_0xcd0d0e=_0xcd0d0e||0xcc;return function(_0x5d6c08){if(_0x5d6c08){return _0x518354['sendStatus'](_0xcd0d0e);}return _0x518354[_0xec8e('0x21')](_0xcd0d0e)[_0xec8e('0x22')]();};}function respondWithResult(_0x47f80d,_0x1d3aec){_0x1d3aec=_0x1d3aec||0xc8;return function(_0xf07e3c){if(_0xf07e3c){return _0x47f80d[_0xec8e('0x21')](_0x1d3aec)[_0xec8e('0x23')](_0xf07e3c);}};}function respondWithFilteredResult(_0x517201,_0x1a77ff){return function(_0x1ff127){if(_0x1ff127){var _0x232e39=typeof _0x1a77ff[_0xec8e('0x24')]===_0xec8e('0x25')&&typeof _0x1a77ff[_0xec8e('0x26')]===_0xec8e('0x25');var _0x16838b=_0x1ff127[_0xec8e('0x27')];var _0x40126e=_0x232e39?0x0:_0x1a77ff[_0xec8e('0x24')];var _0x1476c7=_0x232e39?_0x1ff127['count']:_0x1a77ff['offset']+_0x1a77ff[_0xec8e('0x26')];var _0xa72523;if(_0x1476c7>=_0x16838b){_0x1476c7=_0x16838b;_0xa72523=0xc8;}else{_0xa72523=0xce;}_0x517201[_0xec8e('0x21')](_0xa72523);return _0x517201[_0xec8e('0x28')](_0xec8e('0x29'),_0x40126e+'-'+_0x1476c7+'/'+_0x16838b)['json'](_0x1ff127);}return null;};}function patchUpdates(_0x1a4e80){return function(_0x54a7fa){try{jsonpatch[_0xec8e('0x2a')](_0x54a7fa,_0x1a4e80,!![]);}catch(_0x3653c7){return BPromise[_0xec8e('0x2b')](_0x3653c7);}return _0x54a7fa[_0xec8e('0x2c')]();};}function saveUpdates(_0x5ceb3f,_0xebe8c5){return function(_0x3b8fbd){if(_0x3b8fbd){return _0x3b8fbd['update'](_0x5ceb3f)[_0xec8e('0x2d')](function(_0x4cd52a){return _0x4cd52a;});}return null;};}function removeEntity(_0x4c995d,_0x7f4e15){return function(_0x202dd9){if(_0x202dd9){return _0x202dd9['destroy']()['then'](function(){_0x4c995d[_0xec8e('0x21')](0xcc)[_0xec8e('0x22')]();});}};}function handleEntityNotFound(_0x1de880,_0x11897f){return function(_0x5d4df0){if(!_0x5d4df0){_0x1de880['sendStatus'](0x194);}return _0x5d4df0;};}function handleError(_0x38fd88,_0xf3cea0){_0xf3cea0=_0xf3cea0||0x1f4;return function(_0x3b8d32){logger['error'](_0x3b8d32[_0xec8e('0x2e')]);if(_0x3b8d32[_0xec8e('0x2f')]){delete _0x3b8d32[_0xec8e('0x2f')];}_0x38fd88['status'](_0xf3cea0)[_0xec8e('0x30')](_0x3b8d32);};}exports['show']=function(_0x25a7c1,_0x265a69){var _0x2d4a6a={'raw':![],'where':{'id':_0x25a7c1[_0xec8e('0x31')]['id']}},_0x5954e5={};_0x5954e5[_0xec8e('0x32')]=_['keys'](db['DashboardItem'][_0xec8e('0x33')]);_0x5954e5[_0xec8e('0x34')]=_['keys'](_0x25a7c1['query']);_0x5954e5[_0xec8e('0x35')]=_[_0xec8e('0x36')](_0x5954e5[_0xec8e('0x32')],_0x5954e5['query']);_0x2d4a6a[_0xec8e('0x37')]=_[_0xec8e('0x36')](_0x5954e5[_0xec8e('0x32')],qs[_0xec8e('0x38')](_0x25a7c1[_0xec8e('0x34')][_0xec8e('0x38')]));_0x2d4a6a['attributes']=_0x2d4a6a[_0xec8e('0x37')]['length']?_0x2d4a6a[_0xec8e('0x37')]:_0x5954e5[_0xec8e('0x32')];if(_0x25a7c1[_0xec8e('0x34')]['includeAll']){_0x2d4a6a['include']=[{'all':!![]}];}_0x2d4a6a=_[_0xec8e('0x39')]({},_0x2d4a6a,_0x25a7c1[_0xec8e('0x3a')]);return db[_0xec8e('0x3b')][_0xec8e('0x3c')](_0x2d4a6a)[_0xec8e('0x2d')](handleEntityNotFound(_0x265a69,null))[_0xec8e('0x2d')](respondWithResult(_0x265a69,null))[_0xec8e('0x3d')](handleError(_0x265a69,null));};exports[_0xec8e('0x3e')]=function(_0x1ee6fb,_0x2d43f7){return db['DashboardItem'][_0xec8e('0x3c')]({'where':{'id':_0x1ee6fb[_0xec8e('0x31')]['id']}})['then'](handleEntityNotFound(_0x2d43f7,null))[_0xec8e('0x2d')](removeEntity(_0x2d43f7,null))[_0xec8e('0x3d')](handleError(_0x2d43f7,null));};function widgetAttributes(_0x33c986){try{switch(_0x33c986[_0xec8e('0x3f')]){case _0xec8e('0x40'):return[{'name':_0xec8e('0x41'),'value':_0x33c986[_0xec8e('0x41')]||(_0x33c986['attrs']&&_0x33c986[_0xec8e('0x42')][0x0]?_0x33c986['attrs'][0x0][_0xec8e('0x43')]:undefined)||_0xec8e('0x44')}];case _0xec8e('0x45'):return[{'name':_0xec8e('0x46'),'value':_0x33c986[_0xec8e('0x46')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x0]?_0x33c986[_0xec8e('0x42')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x33c986[_0xec8e('0x47')]||(_0x33c986['attrs']&&_0x33c986[_0xec8e('0x42')][0x0]?_0x33c986[_0xec8e('0x42')][0x0][_0xec8e('0x43')]:undefined)||_0xec8e('0x48')},{'name':_0xec8e('0x49'),'value':_0x33c986[_0xec8e('0x49')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x1]?_0x33c986['attrs'][0x1][_0xec8e('0x43')]:undefined)||'0.00'},{'name':_0xec8e('0x4a'),'value':_0x33c986['attrFontSize']||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x2]?_0x33c986[_0xec8e('0x42')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xec8e('0x4b'),'value':_0x33c986[_0xec8e('0x4b')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986['attrs'][0x0]?_0x33c986[_0xec8e('0x42')][0x0][_0xec8e('0x43')]:undefined)||_0xec8e('0x4c')},{'name':'attrVoiceQueues','value':_0x33c986['attrVoiceQueues']||(_0x33c986[_0xec8e('0x42')]&&_0x33c986['attrs'][0x1]?_0x33c986[_0xec8e('0x42')][0x1]['value']:undefined)||[]},{'name':_0xec8e('0x4a'),'value':_0x33c986['attrFontSize']||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x2]?_0x33c986[_0xec8e('0x42')][0x2]['value']:undefined)||0x14}];case _0xec8e('0x4d'):case _0xec8e('0x4e'):return[{'name':_0xec8e('0x4f'),'value':_0x33c986[_0xec8e('0x4f')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x0]?_0x33c986[_0xec8e('0x42')][0x0]['value']:undefined)||'total'},{'name':_0xec8e('0x50'),'value':_0x33c986[_0xec8e('0x50')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x1]?_0x33c986[_0xec8e('0x42')][0x1][_0xec8e('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x33c986[_0xec8e('0x51')]||(_0x33c986['attrs']&&_0x33c986['attrs'][0x2]?_0x33c986['attrs'][0x2][_0xec8e('0x43')]:undefined)||null},{'name':_0xec8e('0x52'),'value':_0x33c986['attrVoiceQueues']||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x3]?_0x33c986[_0xec8e('0x42')][0x3][_0xec8e('0x43')]:undefined)||[]}];case _0xec8e('0x53'):return[{'name':_0xec8e('0x54'),'type':_0x33c986[_0xec8e('0x55')]||(_0x33c986['attrs']&&_0x33c986['attrs'][0x0]?_0x33c986[_0xec8e('0x42')][0x0][_0xec8e('0x3f')]:undefined)||null,'value':_0x33c986['attrReport']||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x0]?_0x33c986['attrs'][0x0][_0xec8e('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x33c986[_0xec8e('0x56')]||(_0x33c986[_0xec8e('0x42')]&&_0x33c986[_0xec8e('0x42')][0x1]?_0x33c986[_0xec8e('0x42')][0x1][_0xec8e('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x1b3bc5){logger[_0xec8e('0x57')](_0xec8e('0x58'),JSON[_0xec8e('0x59')](_0x1b3bc5));return[];}}exports[_0xec8e('0x5a')]=function(_0x154f5c,_0x3bb2bd){if(_0x154f5c[_0xec8e('0x5b')]){_0x154f5c[_0xec8e('0x5b')][_0xec8e('0x42')]=widgetAttributes(_0x154f5c[_0xec8e('0x5b')]);}return db[_0xec8e('0x3b')]['create'](_0x154f5c[_0xec8e('0x5b')],{})[_0xec8e('0x2d')](respondWithResult(_0x3bb2bd,0xc9))[_0xec8e('0x3d')](handleError(_0x3bb2bd,null));};exports[_0xec8e('0x5c')]=function(_0x19cf03,_0x2c35df){if(_0x19cf03[_0xec8e('0x5b')]['id']){delete _0x19cf03[_0xec8e('0x5b')]['id'];}_0x19cf03[_0xec8e('0x5b')][_0xec8e('0x42')]=widgetAttributes(_0x19cf03[_0xec8e('0x5b')]);return db['DashboardItem'][_0xec8e('0x3c')]({'where':{'id':_0x19cf03[_0xec8e('0x31')]['id']}})['then'](handleEntityNotFound(_0x2c35df,null))[_0xec8e('0x2d')](saveUpdates(_0x19cf03['body'],null))[_0xec8e('0x2d')](respondWithResult(_0x2c35df,null))[_0xec8e('0x3d')](handleError(_0x2c35df,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f837ca9..8d44676 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 _0x3a18=['hook','exports','events','remove','emit','hasOwnProperty'];(function(_0x293c24,_0x5ba4c7){var _0x253301=function(_0x5a1c7c){while(--_0x5a1c7c){_0x293c24['push'](_0x293c24['shift']());}};_0x253301(++_0x5ba4c7);}(_0x3a18,0x104));var _0x83a1=function(_0x16d97a,_0x2fa85e){_0x16d97a=_0x16d97a-0x0;var _0x236d86=_0x3a18[_0x16d97a];return _0x236d86;};'use strict';var EventEmitter=require(_0x83a1('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x83a1('0x1')};function emitEvent(_0xdcc271){return function(_0x4a8118,_0x9a1262,_0x37ee60){DashboardItemEvents['emit'](_0xdcc271+':'+_0x4a8118['id'],_0x4a8118);DashboardItemEvents[_0x83a1('0x2')](_0xdcc271,_0x4a8118);_0x37ee60(null);};}for(var e in events){if(events[_0x83a1('0x3')](e)){var event=events[e];DashboardItem[_0x83a1('0x4')](e,emitEvent(event));}}module[_0x83a1('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x0f3e=['hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0x1f1460,_0x44b42a){var _0x4b5ab4=function(_0x4bd3d3){while(--_0x4bd3d3){_0x1f1460['push'](_0x1f1460['shift']());}};_0x4b5ab4(++_0x44b42a);}(_0x0f3e,0x92));var _0xe0f3=function(_0x1371d1,_0x4381a0){_0x1371d1=_0x1371d1-0x0;var _0x445eb4=_0x0f3e[_0x1371d1];return _0x445eb4;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xe0f3('0x0'))['db'][_0xe0f3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xe0f3('0x2')](0x0);var events={'afterCreate':_0xe0f3('0x3'),'afterUpdate':'update','afterDestroy':_0xe0f3('0x4')};function emitEvent(_0x36aa70){return function(_0xf16457,_0x34ca0c,_0x249fcd){DashboardItemEvents[_0xe0f3('0x5')](_0x36aa70+':'+_0xf16457['id'],_0xf16457);DashboardItemEvents['emit'](_0x36aa70,_0xf16457);_0x249fcd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xe0f3('0x6')](e,emitEvent(event));}}module[_0xe0f3('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 efa60cd..ee1f7a7 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 _0x3572=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','../../config/logger','api','moment','request-promise','path'];(function(_0x5cabfa,_0x58df7a){var _0x2a3ed9=function(_0x4bc63f){while(--_0x4bc63f){_0x5cabfa['push'](_0x5cabfa['shift']());}};_0x2a3ed9(++_0x58df7a);}(_0x3572,0x15b));var _0x2357=function(_0x2003ee,_0x4ade68){_0x2003ee=_0x2003ee-0x0;var _0xcd217d=_0x3572[_0x2003ee];return _0xcd217d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2357('0x0'))(_0x2357('0x1'));var moment=require(_0x2357('0x2'));var BPromise=require('bluebird');var rp=require(_0x2357('0x3'));var fs=require('fs');var path=require(_0x2357('0x4'));var rimraf=require('rimraf');var config=require(_0x2357('0x5'));var attributes=require(_0x2357('0x6'));module[_0x2357('0x7')]=function(_0x477842,_0x526cea){return _0x477842[_0x2357('0x8')](_0x2357('0x9'),attributes,{'tableName':_0x2357('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc02=['bluebird','request-promise','./dashboardItem.attributes','exports','define','lodash','api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfc02,0x1da));var _0x2fc0=function(_0x421e73,_0x2d3fdc){_0x421e73=_0x421e73-0x0;var _0x2f71ec=_0xfc02[_0x421e73];return _0x2f71ec;};'use strict';var _=require(_0x2fc0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2fc0('0x1'));var moment=require('moment');var BPromise=require(_0x2fc0('0x2'));var rp=require(_0x2fc0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2fc0('0x4'));module[_0x2fc0('0x5')]=function(_0x53693e,_0x191c44){return _0x53693e[_0x2fc0('0x6')]('DashboardItem',attributes,{'tableName':'dashboard_items','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 970ad11..b683967 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 _0xd2f9=['info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0xc28bd5,_0x214bd5){var _0x3a9de5=function(_0x5d1ff2){while(--_0x5d1ff2){_0xc28bd5['push'](_0xc28bd5['shift']());}};_0x3a9de5(++_0x214bd5);}(_0xd2f9,0xb0));var _0x9d2f=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xd2f9[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x9d2f('0x0'));var util=require('util');var moment=require(_0x9d2f('0x1'));var BPromise=require(_0x9d2f('0x2'));var rs=require(_0x9d2f('0x3'));var fs=require('fs');var Redis=require(_0x9d2f('0x4'));var db=require(_0x9d2f('0x5'))['db'];var utils=require(_0x9d2f('0x6'));var logger=require(_0x9d2f('0x7'))(_0x9d2f('0x8'));var config=require(_0x9d2f('0x9'));var jayson=require(_0x9d2f('0xa'));var client=jayson[_0x9d2f('0xb')][_0x9d2f('0xc')]({'port':0x232a});config[_0x9d2f('0xd')]=_[_0x9d2f('0xe')](config['redis'],{'host':_0x9d2f('0xf'),'port':0x18eb});var socket=require(_0x9d2f('0x10'))(new Redis(config[_0x9d2f('0xd')]));require(_0x9d2f('0x11'))['register'](socket);function respondWithRpcPromise(_0x552439,_0x2de893,_0xb52cc0){return new BPromise(function(_0x3440b3,_0x50c656){return client['request'](_0x552439,_0xb52cc0)[_0x9d2f('0x12')](function(_0x3b192c){logger['info'](_0x9d2f('0x13'),_0x2de893,_0x9d2f('0x14'));logger[_0x9d2f('0x15')](_0x9d2f('0x16'),_0x2de893,'request\x20sent',JSON[_0x9d2f('0x17')](_0x3b192c));if(_0x3b192c['error']){if(_0x3b192c['error'][_0x9d2f('0x18')]===0x1f4){logger[_0x9d2f('0x19')]('DashboardItem,\x20%s,\x20%s',_0x2de893,_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);return _0x50c656(_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);}logger[_0x9d2f('0x19')](_0x9d2f('0x13'),_0x2de893,_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);return _0x3440b3(_0x3b192c[_0x9d2f('0x19')][_0x9d2f('0x1a')]);}else{logger[_0x9d2f('0x1b')](_0x9d2f('0x13'),_0x2de893,_0x9d2f('0x14'));_0x3440b3(_0x3b192c['result'][_0x9d2f('0x1a')]);}})[_0x9d2f('0x1c')](function(_0x2f4102){logger[_0x9d2f('0x19')]('DashboardItem,\x20%s,\x20%s',_0x2de893,_0x2f4102);_0x50c656(_0x2f4102);});});} \ No newline at end of file +var _0xe7ac=['request','then','info','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register'];(function(_0x3fdd5f,_0x310f8d){var _0x3fae53=function(_0x46d5f0){while(--_0x46d5f0){_0x3fdd5f['push'](_0x3fdd5f['shift']());}};_0x3fae53(++_0x310f8d);}(_0xe7ac,0xf3));var _0xce7a=function(_0x1ff77b,_0x454413){_0x1ff77b=_0x1ff77b-0x0;var _0x397b50=_0xe7ac[_0x1ff77b];return _0x397b50;};'use strict';var _=require(_0xce7a('0x0'));var util=require(_0xce7a('0x1'));var moment=require('moment');var BPromise=require(_0xce7a('0x2'));var rs=require(_0xce7a('0x3'));var fs=require('fs');var Redis=require(_0xce7a('0x4'));var db=require(_0xce7a('0x5'))['db'];var utils=require(_0xce7a('0x6'));var logger=require(_0xce7a('0x7'))('rpc');var config=require(_0xce7a('0x8'));var jayson=require(_0xce7a('0x9'));var client=jayson[_0xce7a('0xa')][_0xce7a('0xb')]({'port':0x232a});config['redis']=_[_0xce7a('0xc')](config['redis'],{'host':_0xce7a('0xd'),'port':0x18eb});var socket=require(_0xce7a('0xe'))(new Redis(config[_0xce7a('0xf')]));require(_0xce7a('0x10'))[_0xce7a('0x11')](socket);function respondWithRpcPromise(_0x52691c,_0x575662,_0x19b2a0){return new BPromise(function(_0x5637ea,_0x1f863a){return client[_0xce7a('0x12')](_0x52691c,_0x19b2a0)[_0xce7a('0x13')](function(_0x38714e){logger[_0xce7a('0x14')]('DashboardItem,\x20%s,\x20%s',_0x575662,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x575662,'request\x20sent',JSON[_0xce7a('0x15')](_0x38714e));if(_0x38714e[_0xce7a('0x16')]){if(_0x38714e['error'][_0xce7a('0x17')]===0x1f4){logger[_0xce7a('0x16')]('DashboardItem,\x20%s,\x20%s',_0x575662,_0x38714e['error'][_0xce7a('0x18')]);return _0x1f863a(_0x38714e['error'][_0xce7a('0x18')]);}logger[_0xce7a('0x16')](_0xce7a('0x19'),_0x575662,_0x38714e[_0xce7a('0x16')][_0xce7a('0x18')]);return _0x5637ea(_0x38714e[_0xce7a('0x16')][_0xce7a('0x18')]);}else{logger[_0xce7a('0x14')](_0xce7a('0x19'),_0x575662,_0xce7a('0x1a'));_0x5637ea(_0x38714e[_0xce7a('0x1b')]['message']);}})[_0xce7a('0x1c')](function(_0x27f8c4){logger[_0xce7a('0x16')](_0xce7a('0x19'),_0x575662,_0x27f8c4);_0x1f863a(_0x27f8c4);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 24a2efe..5d09b1e 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 _0x357f=['save','remove','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x81dade,_0x214864){var _0x3b7224=function(_0x1ee304){while(--_0x1ee304){_0x81dade['push'](_0x81dade['shift']());}};_0x3b7224(++_0x214864);}(_0x357f,0xfb));var _0xf357=function(_0xc84b86,_0xf8c0c1){_0xc84b86=_0xc84b86-0x0;var _0x3775fc=_0x357f[_0xc84b86];return _0x3775fc;};'use strict';var DashboardItemEvents=require(_0xf357('0x0'));var events=[_0xf357('0x1'),_0xf357('0x2'),'update'];function createListener(_0x35efbd,_0x16d6a7){return function(_0x399a60){_0x16d6a7[_0xf357('0x3')](_0x35efbd,_0x399a60);};}function removeListener(_0x360a95,_0x52bf23){return function(){DashboardItemEvents[_0xf357('0x4')](_0x360a95,_0x52bf23);};}exports[_0xf357('0x5')]=function(_0x5c01ea){for(var _0x3311f0=0x0,_0x543ea1=events['length'];_0x3311f0<_0x543ea1;_0x3311f0++){var _0x1d74af=events[_0x3311f0];var _0x135535=createListener(_0xf357('0x6')+_0x1d74af,_0x5c01ea);DashboardItemEvents['on'](_0x1d74af,_0x135535);}}; \ No newline at end of file +var _0x819b=['length','dashboardItem:','./dashboardItem.events','save','remove','emit','register'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x819b,0x80));var _0xb819=function(_0x36176e,_0x3719b7){_0x36176e=_0x36176e-0x0;var _0xbe79bc=_0x819b[_0x36176e];return _0xbe79bc;};'use strict';var DashboardItemEvents=require(_0xb819('0x0'));var events=[_0xb819('0x1'),_0xb819('0x2'),'update'];function createListener(_0x1e7106,_0x888078){return function(_0x5c3301){_0x888078[_0xb819('0x3')](_0x1e7106,_0x5c3301);};}function removeListener(_0x139797,_0x39cf9d){return function(){DashboardItemEvents['removeListener'](_0x139797,_0x39cf9d);};}exports[_0xb819('0x4')]=function(_0x5881ae){for(var _0x465462=0x0,_0x125a73=events[_0xb819('0x5')];_0x465462<_0x125a73;_0x465462++){var _0x541614=events[_0x465462];var _0x33c9f1=createListener(_0xb819('0x6')+_0x541614,_0x5881ae);DashboardItemEvents['on'](_0x541614,_0x33c9f1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3dbbfa6..87bb2db 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 _0x9bab=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update'];(function(_0x35774e,_0x288c7c){var _0x5c3b87=function(_0x30e2c6){while(--_0x30e2c6){_0x35774e['push'](_0x35774e['shift']());}};_0x5c3b87(++_0x288c7c);}(_0x9bab,0x123));var _0xb9ba=function(_0x3b0998,_0x5e528e){_0x3b0998=_0x3b0998-0x0;var _0x3af98d=_0x9bab[_0x3b0998];return _0x3af98d;};'use strict';var multer=require(_0xb9ba('0x0'));var util=require(_0xb9ba('0x1'));var path=require(_0xb9ba('0x2'));var timeout=require(_0xb9ba('0x3'));var express=require(_0xb9ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb9ba('0x5'));var interaction=require(_0xb9ba('0x6'));var config=require(_0xb9ba('0x7'));var controller=require(_0xb9ba('0x8'));router[_0xb9ba('0x9')](_0xb9ba('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb9ba('0xb')](),controller[_0xb9ba('0xc')]);router[_0xb9ba('0xd')](_0xb9ba('0xa'),auth[_0xb9ba('0xb')](),controller[_0xb9ba('0xe')]);router[_0xb9ba('0xf')](_0xb9ba('0xa'),auth[_0xb9ba('0xb')](),controller[_0xb9ba('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb5ad=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','show','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xae5819,_0x2e9d38){var _0x38b072=function(_0x419e27){while(--_0x419e27){_0xae5819['push'](_0xae5819['shift']());}};_0x38b072(++_0x2e9d38);}(_0xb5ad,0x8c));var _0xdb5a=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xb5ad[_0x35a274];return _0x40d905;};'use strict';var multer=require(_0xdb5a('0x0'));var util=require(_0xdb5a('0x1'));var path=require(_0xdb5a('0x2'));var timeout=require(_0xdb5a('0x3'));var express=require(_0xdb5a('0x4'));var router=express[_0xdb5a('0x5')]();var fs_extra=require(_0xdb5a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdb5a('0x7'));var config=require(_0xdb5a('0x8'));var controller=require(_0xdb5a('0x9'));router['get'](_0xdb5a('0xa'),auth['isAuthenticated'](),controller[_0xdb5a('0xb')]);router['post']('/',auth[_0xdb5a('0xc')](),controller[_0xdb5a('0xd')]);router[_0xdb5a('0xe')](_0xdb5a('0xa'),auth[_0xdb5a('0xc')](),controller['update']);router[_0xdb5a('0xf')](_0xdb5a('0xa'),auth[_0xdb5a('0xc')](),controller[_0xdb5a('0x10')]);module[_0xdb5a('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 4f0a857..b4049c3 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 _0x4cc2=['ENUM','second','first','sequelize','exports','STRING'];(function(_0x494d21,_0x8b676a){var _0x2076b9=function(_0x4341dc){while(--_0x4341dc){_0x494d21['push'](_0x494d21['shift']());}};_0x2076b9(++_0x8b676a);}(_0x4cc2,0xa5));var _0x24cc=function(_0x2864be,_0x3aa8b9){_0x2864be=_0x2864be-0x0;var _0xb336bc=_0x4cc2[_0x2864be];return _0xb336bc;};'use strict';var Sequelize=require(_0x24cc('0x0'));module[_0x24cc('0x1')]={'name':{'type':Sequelize[_0x24cc('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x24cc('0x3')]('first',_0x24cc('0x4'),'third'),'allowNull':![],'defaultValue':_0x24cc('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2563=['sequelize','exports','STRING','first','third'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0x2563,0x19f));var _0x3256=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2563[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3256('0x0'));module[_0x3256('0x1')]={'name':{'type':Sequelize[_0x3256('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x3256('0x3'),'second',_0x3256('0x4')),'allowNull':![],'defaultValue':_0x3256('0x3')},'description':{'type':Sequelize[_0x3256('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 5f57bb5..f342ad9 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 _0xe7e4=['../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Dispositions','UserProfileResource','end','name','index','map','Disposition','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','intersection','includeAll','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x5b0dd3,_0x279520){var _0x408e8f=function(_0xbecac9){while(--_0xbecac9){_0x5b0dd3['push'](_0x5b0dd3['shift']());}};_0x408e8f(++_0x279520);}(_0xe7e4,0x1be));var _0x4e7e=function(_0x1770f3,_0x1dc21a){_0x1770f3=_0x1770f3-0x0;var _0x3aee62=_0xe7e4[_0x1770f3];return _0x3aee62;};'use strict';var emlformat=require(_0x4e7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e7e('0x1'));var jsonpatch=require(_0x4e7e('0x2'));var rp=require(_0x4e7e('0x3'));var moment=require('moment');var BPromise=require(_0x4e7e('0x4'));var Mustache=require(_0x4e7e('0x5'));var util=require(_0x4e7e('0x6'));var path=require('path');var sox=require(_0x4e7e('0x7'));var csv=require(_0x4e7e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e7e('0x9'));var squel=require(_0x4e7e('0xa'));var crypto=require('crypto');var jsforce=require(_0x4e7e('0xb'));var deskjs=require(_0x4e7e('0xc'));var toCsv=require(_0x4e7e('0x8'));var querystring=require(_0x4e7e('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e7e('0xe'));var authService=require(_0x4e7e('0xf'));var qs=require(_0x4e7e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e7e('0x11'));var logger=require('../../config/logger')(_0x4e7e('0x12'));var utils=require('../../config/utils');var config=require(_0x4e7e('0x13'));var licenseUtil=require(_0x4e7e('0x14'));var db=require(_0x4e7e('0x15'))['db'];function respondWithStatusCode(_0x13b645,_0x335939){_0x335939=_0x335939||0xcc;return function(_0x344c16){if(_0x344c16){return _0x13b645[_0x4e7e('0x16')](_0x335939);}return _0x13b645[_0x4e7e('0x17')](_0x335939)['end']();};}function respondWithResult(_0x415bda,_0x2519bf){_0x2519bf=_0x2519bf||0xc8;return function(_0x4488ee){if(_0x4488ee){return _0x415bda[_0x4e7e('0x17')](_0x2519bf)[_0x4e7e('0x18')](_0x4488ee);}};}function respondWithFilteredResult(_0x460c87,_0x275363){return function(_0x172e00){if(_0x172e00){var _0xa088ed=typeof _0x275363[_0x4e7e('0x19')]===_0x4e7e('0x1a')&&typeof _0x275363[_0x4e7e('0x1b')]==='undefined';var _0x48303e=_0x172e00[_0x4e7e('0x1c')];var _0x149186=_0xa088ed?0x0:_0x275363['offset'];var _0x28b6b7=_0xa088ed?_0x172e00[_0x4e7e('0x1c')]:_0x275363[_0x4e7e('0x19')]+_0x275363['limit'];var _0xc19ea8;if(_0x28b6b7>=_0x48303e){_0x28b6b7=_0x48303e;_0xc19ea8=0xc8;}else{_0xc19ea8=0xce;}_0x460c87[_0x4e7e('0x17')](_0xc19ea8);return _0x460c87[_0x4e7e('0x1d')](_0x4e7e('0x1e'),_0x149186+'-'+_0x28b6b7+'/'+_0x48303e)['json'](_0x172e00);}return null;};}function patchUpdates(_0x5648be){return function(_0x53fabf){try{jsonpatch[_0x4e7e('0x1f')](_0x53fabf,_0x5648be,!![]);}catch(_0x82a4dc){return BPromise['reject'](_0x82a4dc);}return _0x53fabf['save']();};}function saveUpdates(_0x4b7594,_0x1b6832){return function(_0x1f89ce){if(_0x1f89ce){return _0x1f89ce[_0x4e7e('0x20')](_0x4b7594)[_0x4e7e('0x21')](function(_0x2eb3eb){return _0x2eb3eb;});}return null;};}function removeEntity(_0x305fad,_0x12fc17){return function(_0x5cab1a){if(_0x5cab1a){return _0x5cab1a[_0x4e7e('0x22')]()[_0x4e7e('0x21')](function(){var _0x22319b=_0x5cab1a[_0x4e7e('0x23')]({'plain':!![]});var _0x4043a4=_0x4e7e('0x24');return db[_0x4e7e('0x25')]['destroy']({'where':{'type':_0x4043a4,'resourceId':_0x22319b['id']}})[_0x4e7e('0x21')](function(){return _0x5cab1a;});})[_0x4e7e('0x21')](function(){_0x305fad['status'](0xcc)[_0x4e7e('0x26')]();});}};}function handleEntityNotFound(_0x2ea03b,_0x4867b8){return function(_0x2d0aa0){if(!_0x2d0aa0){_0x2ea03b[_0x4e7e('0x16')](0x194);}return _0x2d0aa0;};}function handleError(_0x495cda,_0x1f1891){_0x1f1891=_0x1f1891||0x1f4;return function(_0x4d9a26){logger['error'](_0x4d9a26['stack']);if(_0x4d9a26[_0x4e7e('0x27')]){delete _0x4d9a26[_0x4e7e('0x27')];}_0x495cda['status'](_0x1f1891)['send'](_0x4d9a26);};}exports[_0x4e7e('0x28')]=function(_0x538366,_0x162ae5){var _0x3c2964={},_0x3ccddb={},_0x3607c3={'count':0x0,'rows':[]};var _0xc4d350=_[_0x4e7e('0x29')](db[_0x4e7e('0x2a')]['rawAttributes'],function(_0x2fdca6){return{'name':_0x2fdca6[_0x4e7e('0x2b')],'type':_0x2fdca6[_0x4e7e('0x2c')][_0x4e7e('0x2d')]};});_0x3ccddb[_0x4e7e('0x2e')]=_[_0x4e7e('0x29')](_0xc4d350,_0x4e7e('0x27'));_0x3ccddb[_0x4e7e('0x2f')]=_[_0x4e7e('0x30')](_0x538366[_0x4e7e('0x2f')]);_0x3ccddb[_0x4e7e('0x31')]=_['intersection'](_0x3ccddb[_0x4e7e('0x2e')],_0x3ccddb[_0x4e7e('0x2f')]);_0x3c2964['attributes']=_['intersection'](_0x3ccddb[_0x4e7e('0x2e')],qs[_0x4e7e('0x32')](_0x538366['query'][_0x4e7e('0x32')]));_0x3c2964[_0x4e7e('0x33')]=_0x3c2964[_0x4e7e('0x33')]['length']?_0x3c2964[_0x4e7e('0x33')]:_0x3ccddb[_0x4e7e('0x2e')];if(!_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x34')](_0x4e7e('0x35'))){_0x3c2964[_0x4e7e('0x1b')]=qs[_0x4e7e('0x1b')](_0x538366['query']['limit']);_0x3c2964[_0x4e7e('0x19')]=qs[_0x4e7e('0x19')](_0x538366['query']['offset']);}_0x3c2964[_0x4e7e('0x36')]=qs[_0x4e7e('0x37')](_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x37')]);_0x3c2964['where']=qs['filters'](_[_0x4e7e('0x38')](_0x538366[_0x4e7e('0x2f')],_0x3ccddb[_0x4e7e('0x31')]),_0xc4d350);if(_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x39')]){_0x3c2964[_0x4e7e('0x3a')]=_[_0x4e7e('0x3b')](_0x3c2964[_0x4e7e('0x3a')],{'$or':_[_0x4e7e('0x29')](_0xc4d350,function(_0x1750bf){if(_0x1750bf[_0x4e7e('0x2c')]!==_0x4e7e('0x3c')){var _0x37b820={};_0x37b820[_0x1750bf[_0x4e7e('0x27')]]={'$like':'%'+_0x538366[_0x4e7e('0x2f')][_0x4e7e('0x39')]+'%'};return _0x37b820;}})});}_0x3c2964=_[_0x4e7e('0x3b')]({},_0x3c2964,_0x538366[_0x4e7e('0x3d')]);var _0x18e67d={'where':_0x3c2964[_0x4e7e('0x3a')]};return db[_0x4e7e('0x2a')][_0x4e7e('0x1c')](_0x18e67d)['then'](function(_0x390585){_0x3607c3[_0x4e7e('0x1c')]=_0x390585;if(_0x538366[_0x4e7e('0x2f')]['includeAll']){_0x3c2964[_0x4e7e('0x3e')]=[{'all':!![]}];}return db[_0x4e7e('0x2a')]['findAll'](_0x3c2964);})[_0x4e7e('0x21')](function(_0x2955d6){_0x3607c3[_0x4e7e('0x3f')]=_0x2955d6;return _0x3607c3;})['then'](respondWithFilteredResult(_0x162ae5,_0x3c2964))[_0x4e7e('0x40')](handleError(_0x162ae5,null));};exports[_0x4e7e('0x41')]=function(_0x58ef67,_0x3b0b73){var _0x3dc3e2={'raw':!![],'where':{'id':_0x58ef67[_0x4e7e('0x42')]['id']}},_0x2306de={};_0x2306de['model']=_[_0x4e7e('0x30')](db[_0x4e7e('0x2a')]['rawAttributes']);_0x2306de['query']=_[_0x4e7e('0x30')](_0x58ef67[_0x4e7e('0x2f')]);_0x2306de[_0x4e7e('0x31')]=_[_0x4e7e('0x43')](_0x2306de['model'],_0x2306de[_0x4e7e('0x2f')]);_0x3dc3e2[_0x4e7e('0x33')]=_['intersection'](_0x2306de[_0x4e7e('0x2e')],qs[_0x4e7e('0x32')](_0x58ef67[_0x4e7e('0x2f')]['fields']));_0x3dc3e2[_0x4e7e('0x33')]=_0x3dc3e2['attributes']['length']?_0x3dc3e2[_0x4e7e('0x33')]:_0x2306de['model'];if(_0x58ef67['query'][_0x4e7e('0x44')]){_0x3dc3e2[_0x4e7e('0x3e')]=[{'all':!![]}];}_0x3dc3e2=_['merge']({},_0x3dc3e2,_0x58ef67[_0x4e7e('0x3d')]);return db[_0x4e7e('0x2a')]['find'](_0x3dc3e2)[_0x4e7e('0x21')](handleEntityNotFound(_0x3b0b73,null))['then'](respondWithResult(_0x3b0b73,null))[_0x4e7e('0x40')](handleError(_0x3b0b73,null));};exports[_0x4e7e('0x45')]=function(_0x30cda1,_0x70ef27){return db[_0x4e7e('0x2a')]['create'](_0x30cda1[_0x4e7e('0x46')],{})[_0x4e7e('0x21')](function(_0x10aaf2){var _0x9e3576=_0x30cda1[_0x4e7e('0x47')][_0x4e7e('0x23')]({'plain':!![]});if(!_0x9e3576)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9e3576['role']==='user'){var _0x3195a1=_0x10aaf2[_0x4e7e('0x23')]({'plain':!![]});var _0x281a48=_0x4e7e('0x24');return db[_0x4e7e('0x48')][_0x4e7e('0x49')]({'where':{'name':_0x281a48,'userProfileId':_0x9e3576[_0x4e7e('0x4a')]},'raw':!![]})[_0x4e7e('0x21')](function(_0x45f499){if(_0x45f499&&_0x45f499[_0x4e7e('0x4b')]===0x0){return db[_0x4e7e('0x25')][_0x4e7e('0x45')]({'name':_0x3195a1[_0x4e7e('0x27')],'resourceId':_0x3195a1['id'],'type':_0x45f499[_0x4e7e('0x27')],'sectionId':_0x45f499['id']},{})['then'](function(){return _0x10aaf2;});}else{return _0x10aaf2;}})[_0x4e7e('0x40')](function(_0x2b5c1a){logger['error'](_0x4e7e('0x4c'),_0x2b5c1a);throw _0x2b5c1a;});}return _0x10aaf2;})[_0x4e7e('0x21')](respondWithResult(_0x70ef27,0xc9))[_0x4e7e('0x40')](handleError(_0x70ef27,null));};exports[_0x4e7e('0x20')]=function(_0x34e668,_0x3563dd){if(_0x34e668[_0x4e7e('0x46')]['id']){delete _0x34e668['body']['id'];}return db[_0x4e7e('0x2a')][_0x4e7e('0x49')]({'where':{'id':_0x34e668[_0x4e7e('0x42')]['id']}})[_0x4e7e('0x21')](handleEntityNotFound(_0x3563dd,null))[_0x4e7e('0x21')](saveUpdates(_0x34e668[_0x4e7e('0x46')],null))[_0x4e7e('0x21')](respondWithResult(_0x3563dd,null))[_0x4e7e('0x40')](handleError(_0x3563dd,null));};exports['destroy']=function(_0x2140a2,_0x3c79c3){return db['Disposition'][_0x4e7e('0x49')]({'where':{'id':_0x2140a2[_0x4e7e('0x42')]['id']}})[_0x4e7e('0x21')](handleEntityNotFound(_0x3c79c3,null))[_0x4e7e('0x21')](removeEntity(_0x3c79c3,null))[_0x4e7e('0x40')](handleError(_0x3c79c3,null));}; \ No newline at end of file +var _0xcdb1=['includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','update','then','Dispositions','UserProfileResource','destroy','error','name','index','map','Disposition','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','limit','sort','where','merge','filter','include','findAll','rows','catch','show','params'];(function(_0x1be744,_0x35a81f){var _0x5c77ee=function(_0x22fff6){while(--_0x22fff6){_0x1be744['push'](_0x1be744['shift']());}};_0x5c77ee(++_0x35a81f);}(_0xcdb1,0x1eb));var _0x1cdb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcdb1[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cdb('0x0'));var zipdir=require(_0x1cdb('0x1'));var jsonpatch=require(_0x1cdb('0x2'));var rp=require(_0x1cdb('0x3'));var moment=require(_0x1cdb('0x4'));var BPromise=require(_0x1cdb('0x5'));var Mustache=require(_0x1cdb('0x6'));var util=require(_0x1cdb('0x7'));var path=require(_0x1cdb('0x8'));var sox=require('sox');var csv=require(_0x1cdb('0x9'));var ejs=require(_0x1cdb('0xa'));var fs=require('fs');var fs_extra=require(_0x1cdb('0xb'));var _=require(_0x1cdb('0xc'));var squel=require('squel');var crypto=require(_0x1cdb('0xd'));var jsforce=require(_0x1cdb('0xe'));var deskjs=require(_0x1cdb('0xf'));var toCsv=require(_0x1cdb('0x9'));var querystring=require(_0x1cdb('0x10'));var Papa=require('papaparse');var Redis=require(_0x1cdb('0x11'));var authService=require(_0x1cdb('0x12'));var qs=require(_0x1cdb('0x13'));var as=require(_0x1cdb('0x14'));var hardwareService=require(_0x1cdb('0x15'));var logger=require('../../config/logger')(_0x1cdb('0x16'));var utils=require(_0x1cdb('0x17'));var config=require(_0x1cdb('0x18'));var licenseUtil=require(_0x1cdb('0x19'));var db=require(_0x1cdb('0x1a'))['db'];function respondWithStatusCode(_0x45f482,_0x13c6c5){_0x13c6c5=_0x13c6c5||0xcc;return function(_0x4bb790){if(_0x4bb790){return _0x45f482[_0x1cdb('0x1b')](_0x13c6c5);}return _0x45f482[_0x1cdb('0x1c')](_0x13c6c5)[_0x1cdb('0x1d')]();};}function respondWithResult(_0x340c9a,_0x12cec9){_0x12cec9=_0x12cec9||0xc8;return function(_0x284840){if(_0x284840){return _0x340c9a[_0x1cdb('0x1c')](_0x12cec9)['json'](_0x284840);}};}function respondWithFilteredResult(_0x486045,_0x47e83d){return function(_0x30b33f){if(_0x30b33f){var _0x5bd366=typeof _0x47e83d[_0x1cdb('0x1e')]===_0x1cdb('0x1f')&&typeof _0x47e83d['limit']===_0x1cdb('0x1f');var _0x428c1b=_0x30b33f[_0x1cdb('0x20')];var _0xbbb216=_0x5bd366?0x0:_0x47e83d[_0x1cdb('0x1e')];var _0x4b3266=_0x5bd366?_0x30b33f[_0x1cdb('0x20')]:_0x47e83d['offset']+_0x47e83d['limit'];var _0x111571;if(_0x4b3266>=_0x428c1b){_0x4b3266=_0x428c1b;_0x111571=0xc8;}else{_0x111571=0xce;}_0x486045[_0x1cdb('0x1c')](_0x111571);return _0x486045['set'](_0x1cdb('0x21'),_0xbbb216+'-'+_0x4b3266+'/'+_0x428c1b)[_0x1cdb('0x22')](_0x30b33f);}return null;};}function patchUpdates(_0x4873a4){return function(_0x24d997){try{jsonpatch['apply'](_0x24d997,_0x4873a4,!![]);}catch(_0x2a2c60){return BPromise[_0x1cdb('0x23')](_0x2a2c60);}return _0x24d997['save']();};}function saveUpdates(_0x1ef802,_0x15f8c5){return function(_0x23d3b1){if(_0x23d3b1){return _0x23d3b1[_0x1cdb('0x24')](_0x1ef802)[_0x1cdb('0x25')](function(_0x122f34){return _0x122f34;});}return null;};}function removeEntity(_0x2490b2,_0x5c2401){return function(_0x87825f){if(_0x87825f){return _0x87825f['destroy']()[_0x1cdb('0x25')](function(){var _0x3cba08=_0x87825f['get']({'plain':!![]});var _0x556669=_0x1cdb('0x26');return db[_0x1cdb('0x27')][_0x1cdb('0x28')]({'where':{'type':_0x556669,'resourceId':_0x3cba08['id']}})[_0x1cdb('0x25')](function(){return _0x87825f;});})[_0x1cdb('0x25')](function(){_0x2490b2[_0x1cdb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2386f9,_0x20212e){return function(_0x498b4c){if(!_0x498b4c){_0x2386f9[_0x1cdb('0x1b')](0x194);}return _0x498b4c;};}function handleError(_0x3974e8,_0x2d3c33){_0x2d3c33=_0x2d3c33||0x1f4;return function(_0x2e2551){logger[_0x1cdb('0x29')](_0x2e2551['stack']);if(_0x2e2551[_0x1cdb('0x2a')]){delete _0x2e2551[_0x1cdb('0x2a')];}_0x3974e8[_0x1cdb('0x1c')](_0x2d3c33)['send'](_0x2e2551);};}exports[_0x1cdb('0x2b')]=function(_0xa67dcc,_0x2d8432){var _0x56961d={},_0x2aaa7d={},_0xf9a4d8={'count':0x0,'rows':[]};var _0x442bdb=_[_0x1cdb('0x2c')](db[_0x1cdb('0x2d')][_0x1cdb('0x2e')],function(_0x285962){return{'name':_0x285962['fieldName'],'type':_0x285962[_0x1cdb('0x2f')][_0x1cdb('0x30')]};});_0x2aaa7d[_0x1cdb('0x31')]=_[_0x1cdb('0x2c')](_0x442bdb,_0x1cdb('0x2a'));_0x2aaa7d['query']=_[_0x1cdb('0x32')](_0xa67dcc['query']);_0x2aaa7d[_0x1cdb('0x33')]=_[_0x1cdb('0x34')](_0x2aaa7d['model'],_0x2aaa7d['query']);_0x56961d[_0x1cdb('0x35')]=_[_0x1cdb('0x34')](_0x2aaa7d[_0x1cdb('0x31')],qs[_0x1cdb('0x36')](_0xa67dcc['query'][_0x1cdb('0x36')]));_0x56961d[_0x1cdb('0x35')]=_0x56961d[_0x1cdb('0x35')][_0x1cdb('0x37')]?_0x56961d['attributes']:_0x2aaa7d[_0x1cdb('0x31')];if(!_0xa67dcc[_0x1cdb('0x38')][_0x1cdb('0x39')]('nolimit')){_0x56961d[_0x1cdb('0x3a')]=qs['limit'](_0xa67dcc['query'][_0x1cdb('0x3a')]);_0x56961d[_0x1cdb('0x1e')]=qs['offset'](_0xa67dcc['query'][_0x1cdb('0x1e')]);}_0x56961d['order']=qs['sort'](_0xa67dcc[_0x1cdb('0x38')][_0x1cdb('0x3b')]);_0x56961d[_0x1cdb('0x3c')]=qs['filters'](_['pick'](_0xa67dcc[_0x1cdb('0x38')],_0x2aaa7d['filters']),_0x442bdb);if(_0xa67dcc['query']['filter']){_0x56961d[_0x1cdb('0x3c')]=_[_0x1cdb('0x3d')](_0x56961d[_0x1cdb('0x3c')],{'$or':_[_0x1cdb('0x2c')](_0x442bdb,function(_0x22c055){if(_0x22c055[_0x1cdb('0x2f')]!=='VIRTUAL'){var _0x18145b={};_0x18145b[_0x22c055[_0x1cdb('0x2a')]]={'$like':'%'+_0xa67dcc[_0x1cdb('0x38')][_0x1cdb('0x3e')]+'%'};return _0x18145b;}})});}_0x56961d=_[_0x1cdb('0x3d')]({},_0x56961d,_0xa67dcc['options']);var _0x4a51ac={'where':_0x56961d['where']};return db[_0x1cdb('0x2d')][_0x1cdb('0x20')](_0x4a51ac)['then'](function(_0x3c187c){_0xf9a4d8[_0x1cdb('0x20')]=_0x3c187c;if(_0xa67dcc[_0x1cdb('0x38')]['includeAll']){_0x56961d[_0x1cdb('0x3f')]=[{'all':!![]}];}return db['Disposition'][_0x1cdb('0x40')](_0x56961d);})[_0x1cdb('0x25')](function(_0x17e3c3){_0xf9a4d8[_0x1cdb('0x41')]=_0x17e3c3;return _0xf9a4d8;})['then'](respondWithFilteredResult(_0x2d8432,_0x56961d))[_0x1cdb('0x42')](handleError(_0x2d8432,null));};exports[_0x1cdb('0x43')]=function(_0x3e7ae1,_0x472250){var _0x28ab42={'raw':!![],'where':{'id':_0x3e7ae1[_0x1cdb('0x44')]['id']}},_0x442b83={};_0x442b83[_0x1cdb('0x31')]=_[_0x1cdb('0x32')](db[_0x1cdb('0x2d')]['rawAttributes']);_0x442b83[_0x1cdb('0x38')]=_[_0x1cdb('0x32')](_0x3e7ae1['query']);_0x442b83[_0x1cdb('0x33')]=_[_0x1cdb('0x34')](_0x442b83[_0x1cdb('0x31')],_0x442b83[_0x1cdb('0x38')]);_0x28ab42[_0x1cdb('0x35')]=_[_0x1cdb('0x34')](_0x442b83[_0x1cdb('0x31')],qs[_0x1cdb('0x36')](_0x3e7ae1[_0x1cdb('0x38')]['fields']));_0x28ab42['attributes']=_0x28ab42[_0x1cdb('0x35')][_0x1cdb('0x37')]?_0x28ab42['attributes']:_0x442b83[_0x1cdb('0x31')];if(_0x3e7ae1[_0x1cdb('0x38')][_0x1cdb('0x45')]){_0x28ab42['include']=[{'all':!![]}];}_0x28ab42=_[_0x1cdb('0x3d')]({},_0x28ab42,_0x3e7ae1[_0x1cdb('0x46')]);return db[_0x1cdb('0x2d')][_0x1cdb('0x47')](_0x28ab42)[_0x1cdb('0x25')](handleEntityNotFound(_0x472250,null))[_0x1cdb('0x25')](respondWithResult(_0x472250,null))['catch'](handleError(_0x472250,null));};exports[_0x1cdb('0x48')]=function(_0x1e1541,_0x44f159){return db[_0x1cdb('0x2d')][_0x1cdb('0x48')](_0x1e1541[_0x1cdb('0x49')],{})[_0x1cdb('0x25')](function(_0x19f707){var _0x53e8c3=_0x1e1541[_0x1cdb('0x4a')][_0x1cdb('0x4b')]({'plain':!![]});if(!_0x53e8c3)throw new Error(_0x1cdb('0x4c'));if(_0x53e8c3[_0x1cdb('0x4d')]===_0x1cdb('0x4a')){var _0xeece1=_0x19f707[_0x1cdb('0x4b')]({'plain':!![]});var _0x39f84f=_0x1cdb('0x26');return db['UserProfileSection'][_0x1cdb('0x47')]({'where':{'name':_0x39f84f,'userProfileId':_0x53e8c3[_0x1cdb('0x4e')]},'raw':!![]})[_0x1cdb('0x25')](function(_0xd1ae2a){if(_0xd1ae2a&&_0xd1ae2a['autoAssociation']===0x0){return db[_0x1cdb('0x27')][_0x1cdb('0x48')]({'name':_0xeece1[_0x1cdb('0x2a')],'resourceId':_0xeece1['id'],'type':_0xd1ae2a[_0x1cdb('0x2a')],'sectionId':_0xd1ae2a['id']},{})['then'](function(){return _0x19f707;});}else{return _0x19f707;}})[_0x1cdb('0x42')](function(_0x47b2ce){logger[_0x1cdb('0x29')](_0x1cdb('0x4f'),_0x47b2ce);throw _0x47b2ce;});}return _0x19f707;})[_0x1cdb('0x25')](respondWithResult(_0x44f159,0xc9))[_0x1cdb('0x42')](handleError(_0x44f159,null));};exports[_0x1cdb('0x24')]=function(_0xe83d0b,_0x212af1){if(_0xe83d0b[_0x1cdb('0x49')]['id']){delete _0xe83d0b[_0x1cdb('0x49')]['id'];}return db['Disposition'][_0x1cdb('0x47')]({'where':{'id':_0xe83d0b['params']['id']}})[_0x1cdb('0x25')](handleEntityNotFound(_0x212af1,null))[_0x1cdb('0x25')](saveUpdates(_0xe83d0b['body'],null))[_0x1cdb('0x25')](respondWithResult(_0x212af1,null))[_0x1cdb('0x42')](handleError(_0x212af1,null));};exports[_0x1cdb('0x28')]=function(_0x4051c6,_0x524320){return db[_0x1cdb('0x2d')][_0x1cdb('0x47')]({'where':{'id':_0x4051c6[_0x1cdb('0x44')]['id']}})[_0x1cdb('0x25')](handleEntityNotFound(_0x524320,null))[_0x1cdb('0x25')](removeEntity(_0x524320,null))[_0x1cdb('0x42')](handleError(_0x524320,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6426cb5..0c63abe 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 _0x9cb9=['name','name_chat','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x207d20,_0x224093){var _0x453cda=function(_0x44a4e1){while(--_0x44a4e1){_0x207d20['push'](_0x207d20['shift']());}};_0x453cda(++_0x224093);}(_0x9cb9,0x7c));var _0x99cb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9cb9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x99cb('0x0'));var util=require(_0x99cb('0x1'));var logger=require(_0x99cb('0x2'))('api');var moment=require(_0x99cb('0x3'));var BPromise=require(_0x99cb('0x4'));var rp=require(_0x99cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99cb('0x6'));var config=require(_0x99cb('0x7'));var attributes=require(_0x99cb('0x8'));module[_0x99cb('0x9')]=function(_0x2bfab0,_0x2750d5){return _0x2bfab0[_0x99cb('0xa')](_0x99cb('0xb'),attributes,{'tableName':_0x99cb('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x99cb('0xd'),'fields':[_0x99cb('0xe'),'ListId']},{'unique':!![],'name':_0x99cb('0xf'),'fields':[_0x99cb('0xe'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x99cb('0xe'),_0x99cb('0x10')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0x99cb('0x11'),'fields':[_0x99cb('0xe'),_0x99cb('0x12')]},{'unique':!![],'name':_0x99cb('0x13'),'fields':['name',_0x99cb('0x14')]},{'unique':!![],'name':_0x99cb('0x15'),'fields':['name',_0x99cb('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9b50=['path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','name_voice','name','ListId','name_chat','name_mail','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','util','../../config/logger','api','moment','request-promise'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9b50,0x9b));var _0x09b5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9b50[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x09b5('0x0'));var logger=require(_0x09b5('0x1'))(_0x09b5('0x2'));var moment=require(_0x09b5('0x3'));var BPromise=require('bluebird');var rp=require(_0x09b5('0x4'));var fs=require('fs');var path=require(_0x09b5('0x5'));var rimraf=require(_0x09b5('0x6'));var config=require(_0x09b5('0x7'));var attributes=require(_0x09b5('0x8'));module['exports']=function(_0x1c3d9d,_0x505f55){return _0x1c3d9d[_0x09b5('0x9')](_0x09b5('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x09b5('0xb'),'fields':[_0x09b5('0xc'),_0x09b5('0xd')]},{'unique':!![],'name':_0x09b5('0xe'),'fields':[_0x09b5('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x09b5('0xf'),'fields':[_0x09b5('0xc'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x09b5('0xc'),_0x09b5('0x10')]},{'unique':!![],'name':_0x09b5('0x11'),'fields':[_0x09b5('0xc'),_0x09b5('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x09b5('0xc'),_0x09b5('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index dfa78ed..b9257d2 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(_0x34058b,_0x5ca5ac){var _0x399bb5=function(_0x1b24b3){while(--_0x1b24b3){_0x34058b['push'](_0x34058b['shift']());}};_0x399bb5(++_0x5ca5ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x208949,_0x2c433e){var _0x367045=function(_0x4e1cc5){while(--_0x4e1cc5){_0x208949['push'](_0x208949['shift']());}};_0x367045(++_0x2c433e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 e9cf4c7..a3e0e07 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 _0x47cf=['../../config/environment','./disposition.controller','get','index','isAuthenticated','show','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','../../components/interaction/service'];(function(_0x4e075b,_0x26c178){var _0x5d44a7=function(_0x46e949){while(--_0x46e949){_0x4e075b['push'](_0x4e075b['shift']());}};_0x5d44a7(++_0x26c178);}(_0x47cf,0x1c7));var _0xf47c=function(_0x5b3f8d,_0x19bb0e){_0x5b3f8d=_0x5b3f8d-0x0;var _0x2da13b=_0x47cf[_0x5b3f8d];return _0x2da13b;};'use strict';var multer=require('multer');var util=require(_0xf47c('0x0'));var path=require(_0xf47c('0x1'));var timeout=require(_0xf47c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf47c('0x3'));var config=require(_0xf47c('0x4'));var controller=require(_0xf47c('0x5'));router[_0xf47c('0x6')]('/',auth['isAuthenticated'](),controller[_0xf47c('0x7')]);router[_0xf47c('0x6')]('/:id',auth[_0xf47c('0x8')](),controller[_0xf47c('0x9')]);router[_0xf47c('0xa')]('/',auth[_0xf47c('0x8')](),controller[_0xf47c('0xb')]);router[_0xf47c('0xc')]('/:id',auth[_0xf47c('0x8')](),controller['update']);router[_0xf47c('0xd')](_0xf47c('0xe'),auth['isAuthenticated'](),controller[_0xf47c('0xf')]);module[_0xf47c('0x10')]=router; \ No newline at end of file +var _0xaa31=['fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','show','create','/:id','update','destroy','exports','multer','util','express','Router'];(function(_0x41fa5d,_0x7b469d){var _0x308617=function(_0xf0d693){while(--_0xf0d693){_0x41fa5d['push'](_0x41fa5d['shift']());}};_0x308617(++_0x7b469d);}(_0xaa31,0xa6));var _0x1aa3=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xaa31[_0x35da42];return _0x370035;};'use strict';var multer=require(_0x1aa3('0x0'));var util=require(_0x1aa3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1aa3('0x2'));var router=express[_0x1aa3('0x3')]();var fs_extra=require(_0x1aa3('0x4'));var auth=require(_0x1aa3('0x5'));var interaction=require(_0x1aa3('0x6'));var config=require('../../config/environment');var controller=require(_0x1aa3('0x7'));router[_0x1aa3('0x8')]('/',auth[_0x1aa3('0x9')](),controller[_0x1aa3('0xa')]);router[_0x1aa3('0x8')]('/:id',auth[_0x1aa3('0x9')](),controller[_0x1aa3('0xb')]);router['post']('/',auth[_0x1aa3('0x9')](),controller[_0x1aa3('0xc')]);router['put'](_0x1aa3('0xd'),auth['isAuthenticated'](),controller[_0x1aa3('0xe')]);router['delete'](_0x1aa3('0xd'),auth['isAuthenticated'](),controller[_0x1aa3('0xf')]);module[_0x1aa3('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index c95d826..8edb873 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 _0x13f7=['localstationid','4800','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x4efd3d,_0x2b9694){var _0x1293f2=function(_0x14b90f){while(--_0x14b90f){_0x4efd3d['push'](_0x4efd3d['shift']());}};_0x1293f2(++_0x2b9694);}(_0x13f7,0x151));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x713f('0x0'));module['exports']={'name':{'type':Sequelize[_0x713f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x713f('0x1')]},'ecm':{'type':Sequelize[_0x713f('0x2')](_0x713f('0x3'),'no'),'defaultValue':_0x713f('0x3')},'headerinfo':{'type':Sequelize[_0x713f('0x1')],'defaultValue':_0x713f('0x4')},'localstationid':{'type':Sequelize[_0x713f('0x1')],'unique':_0x713f('0x5')},'minrate':{'type':Sequelize[_0x713f('0x2')]('2400',_0x713f('0x6'),'7200','9600',_0x713f('0x7'),_0x713f('0x8')),'defaultValue':_0x713f('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x713f('0x6'),'7200','9600',_0x713f('0x7'),_0x713f('0x8')),'defaultValue':_0x713f('0x8')},'modem':{'type':Sequelize[_0x713f('0x1')],'defaultValue':_0x713f('0x9')},'gateway':{'type':Sequelize[_0x713f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x713f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x713f('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x713f('0x2')](_0x713f('0xb'),_0x713f('0xc'),'DADHI',_0x713f('0xd')),'defaultValue':_0x713f('0xb')},'key':{'type':Sequelize[_0x713f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x713f('0xe')],'defaultValue':function(){return _0x713f('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x713f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x713f('0xa')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x713f('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x781c3f){if(!_0x781c3f)this[_0x713f('0x11')](_0x713f('0x12'),null);this[_0x713f('0x11')]('mandatoryDisposition',_0x781c3f);}}}; \ No newline at end of file +var _0x3d6e=['KHOMP','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','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','ENUM','SIP','IAX','DADHI'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x3d6e,0x1e5));var _0xe3d6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x3d6e[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xe3d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3d6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe3d6('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xe3d6('0x2'),'no'),'defaultValue':_0xe3d6('0x2')},'headerinfo':{'type':Sequelize[_0xe3d6('0x1')],'defaultValue':_0xe3d6('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xe3d6('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xe3d6('0x5'),_0xe3d6('0x6'),_0xe3d6('0x7'),_0xe3d6('0x8'),_0xe3d6('0x9'),_0xe3d6('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xe3d6('0xb')](_0xe3d6('0x5'),'4800',_0xe3d6('0x7'),_0xe3d6('0x8'),_0xe3d6('0x9'),_0xe3d6('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xe3d6('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xe3d6('0xc'),_0xe3d6('0xd'),_0xe3d6('0xe'),_0xe3d6('0xf')),'defaultValue':_0xe3d6('0xc')},'key':{'type':Sequelize[_0xe3d6('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe3d6('0x10')],'defaultValue':function(){return _0xe3d6('0x11');}},'notificationSound':{'type':Sequelize[_0xe3d6('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe3d6('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe3d6('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe3d6('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe3d6('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3d6('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0xe3d6('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xe3d6('0x12')],'defaultValue':![],'comment':_0xe3d6('0x15'),'set':function(_0x1a37c5){if(!_0x1a37c5)this[_0xe3d6('0x16')](_0xe3d6('0x17'),null);this[_0xe3d6('0x16')](_0xe3d6('0x18'),_0x1a37c5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6685fc0..17566ab 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 _0x9a9c=['localstationid','app','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','name','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','update','params','describe','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','exten'];(function(_0x46fbc4,_0x4151bc){var _0x3d2f51=function(_0x10e16e){while(--_0x10e16e){_0x46fbc4['push'](_0x46fbc4['shift']());}};_0x3d2f51(++_0x4151bc);}(_0x9a9c,0xf6));var _0xc9a9=function(_0x4c94d1,_0x573a4f){_0x4c94d1=_0x4c94d1-0x0;var _0x48c2c3=_0x9a9c[_0x4c94d1];return _0x48c2c3;};'use strict';var emlformat=require(_0xc9a9('0x0'));var rimraf=require(_0xc9a9('0x1'));var zipdir=require(_0xc9a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9a9('0x3'));var BPromise=require(_0xc9a9('0x4'));var Mustache=require(_0xc9a9('0x5'));var util=require(_0xc9a9('0x6'));var path=require(_0xc9a9('0x7'));var sox=require(_0xc9a9('0x8'));var csv=require(_0xc9a9('0x9'));var ejs=require(_0xc9a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc9a9('0xb'));var _=require(_0xc9a9('0xc'));var squel=require('squel');var crypto=require(_0xc9a9('0xd'));var jsforce=require(_0xc9a9('0xe'));var deskjs=require(_0xc9a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9a9('0x10'));var Papa=require(_0xc9a9('0x11'));var Redis=require(_0xc9a9('0x12'));var authService=require(_0xc9a9('0x13'));var qs=require(_0xc9a9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a9('0x15'));var logger=require(_0xc9a9('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc9a9('0x17'));var licenseUtil=require(_0xc9a9('0x18'));var db=require(_0xc9a9('0x19'))['db'];config[_0xc9a9('0x1a')]=_[_0xc9a9('0x1b')](config[_0xc9a9('0x1a')],{'host':_0xc9a9('0x1c'),'port':0x18eb});var socket=require(_0xc9a9('0x1d'))(new Redis(config[_0xc9a9('0x1a')]));require('./faxAccount.socket')[_0xc9a9('0x1e')](socket);var jayson=require(_0xc9a9('0x1f'));var client=jayson[_0xc9a9('0x20')][_0xc9a9('0x21')]({'port':0x232c});var client9002=jayson[_0xc9a9('0x20')][_0xc9a9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x28f165,_0x3a15fd,_0x3c6b59,_0x396eb2){return new BPromise(function(_0x123289,_0x3e425d){var _0x53fd13=_0x396eb2||client;return _0x53fd13[_0xc9a9('0x22')](_0x28f165,_0x3c6b59)[_0xc9a9('0x23')](function(_0x479cd9){logger[_0xc9a9('0x24')](_0xc9a9('0x25'),_0x3a15fd,'request\x20sent');logger[_0xc9a9('0x26')](_0xc9a9('0x27'),_0x3a15fd,_0xc9a9('0x28'),JSON[_0xc9a9('0x29')](_0x479cd9));if(_0x479cd9[_0xc9a9('0x2a')]){if(_0x479cd9[_0xc9a9('0x2a')]['code']===0x1f4){logger[_0xc9a9('0x2a')](_0xc9a9('0x25'),_0x3a15fd,_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);return _0x3e425d(_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x3a15fd,_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);return _0x123289(_0x479cd9[_0xc9a9('0x2a')][_0xc9a9('0x2b')]);}else{logger['info'](_0xc9a9('0x25'),_0x3a15fd,_0xc9a9('0x28'));_0x123289(_0x479cd9[_0xc9a9('0x2c')]['message']);}})[_0xc9a9('0x2d')](function(_0x475920){logger[_0xc9a9('0x2a')](_0xc9a9('0x25'),_0x3a15fd,_0x475920);_0x3e425d(_0x475920);});});}function respondWithStatusCode(_0x91715b,_0x45ab48){_0x45ab48=_0x45ab48||0xcc;return function(_0x265378){if(_0x265378){return _0x91715b[_0xc9a9('0x2e')](_0x45ab48);}return _0x91715b[_0xc9a9('0x2f')](_0x45ab48)[_0xc9a9('0x30')]();};}function respondWithResult(_0x10a421,_0x331b3d){_0x331b3d=_0x331b3d||0xc8;return function(_0x40b948){if(_0x40b948){return _0x10a421[_0xc9a9('0x2f')](_0x331b3d)['json'](_0x40b948);}};}function respondWithFilteredResult(_0x412633,_0x1eefc9){return function(_0x2a950a){if(_0x2a950a){var _0x4a285a=typeof _0x1eefc9[_0xc9a9('0x31')]===_0xc9a9('0x32')&&typeof _0x1eefc9[_0xc9a9('0x33')]===_0xc9a9('0x32');var _0x77c0ff=_0x2a950a[_0xc9a9('0x34')];var _0x1dfd05=_0x4a285a?0x0:_0x1eefc9[_0xc9a9('0x31')];var _0x4074ac=_0x4a285a?_0x2a950a['count']:_0x1eefc9[_0xc9a9('0x31')]+_0x1eefc9[_0xc9a9('0x33')];var _0x3530e3;if(_0x4074ac>=_0x77c0ff){_0x4074ac=_0x77c0ff;_0x3530e3=0xc8;}else{_0x3530e3=0xce;}_0x412633[_0xc9a9('0x2f')](_0x3530e3);return _0x412633[_0xc9a9('0x35')]('Content-Range',_0x1dfd05+'-'+_0x4074ac+'/'+_0x77c0ff)[_0xc9a9('0x36')](_0x2a950a);}return null;};}function patchUpdates(_0x32baf7){return function(_0x515b27){try{jsonpatch[_0xc9a9('0x37')](_0x515b27,_0x32baf7,!![]);}catch(_0x20f116){return BPromise[_0xc9a9('0x38')](_0x20f116);}return _0x515b27[_0xc9a9('0x39')]();};}function saveUpdates(_0x2aac45,_0xde612f){return function(_0x5d87d8){if(_0x5d87d8){return _0x5d87d8['update'](_0x2aac45)[_0xc9a9('0x23')](function(_0x3791ff){return _0x3791ff;});}return null;};}function removeEntity(_0x396b56,_0x4fac29){return function(_0x719bbe){if(_0x719bbe){return _0x719bbe['destroy']()[_0xc9a9('0x23')](function(){var _0x56e52d=_0x719bbe[_0xc9a9('0x3a')]({'plain':!![]});var _0x5f190f=_0xc9a9('0x3b');return db[_0xc9a9('0x3c')][_0xc9a9('0x3d')]({'where':{'type':_0x5f190f,'resourceId':_0x56e52d['id']}})[_0xc9a9('0x23')](function(){return _0x719bbe;});})[_0xc9a9('0x23')](function(){_0x396b56[_0xc9a9('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40e553,_0x149a38){return function(_0x44649d){if(!_0x44649d){_0x40e553[_0xc9a9('0x2e')](0x194);}return _0x44649d;};}function handleError(_0x491fa4,_0x426c36){_0x426c36=_0x426c36||0x1f4;return function(_0x2039bf){logger[_0xc9a9('0x2a')](_0x2039bf['stack']);if(_0x2039bf[_0xc9a9('0x3e')]){delete _0x2039bf[_0xc9a9('0x3e')];}_0x491fa4[_0xc9a9('0x2f')](_0x426c36)['send'](_0x2039bf);};}exports['index']=function(_0x31eed4,_0x33cfcd){var _0x5ba173={'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]},_0x59ddee={},_0x448aa8={'count':0x0,'rows':[]};var _0x295eaa=_[_0xc9a9('0x41')](db[_0xc9a9('0x42')][_0xc9a9('0x43')],function(_0x2e176b){return{'name':_0x2e176b['fieldName'],'type':_0x2e176b[_0xc9a9('0x44')][_0xc9a9('0x45')]};});_0x59ddee[_0xc9a9('0x46')]=_[_0xc9a9('0x41')](_0x295eaa,'name');_0x59ddee[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x31eed4[_0xc9a9('0x47')]);_0x59ddee[_0xc9a9('0x49')]=_['intersection'](_0x59ddee['model'],_0x59ddee[_0xc9a9('0x47')]);_0x5ba173[_0xc9a9('0x4a')]=_['intersection'](_0x59ddee[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x5ba173[_0xc9a9('0x4a')]=_0x5ba173[_0xc9a9('0x4a')]['length']?_0x5ba173[_0xc9a9('0x4a')]:_0x59ddee[_0xc9a9('0x46')];if(!_0x31eed4[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0x5ba173['limit']=qs[_0xc9a9('0x33')](_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x5ba173[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x31eed4['query']['offset']);}_0x5ba173['order']=qs['sort'](_0x31eed4['query'][_0xc9a9('0x4d')]);_0x5ba173[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x31eed4['query'],_0x59ddee['filters']),_0x295eaa);if(_0x31eed4['query'][_0xc9a9('0x50')]){_0x5ba173[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x5ba173['where'],{'$or':_['map'](_0x295eaa,function(_0xfa4be2){if(_0xfa4be2['type']!==_0xc9a9('0x52')){var _0x53e3e8={};_0x53e3e8[_0xfa4be2[_0xc9a9('0x3e')]]={'$like':'%'+_0x31eed4[_0xc9a9('0x47')]['filter']+'%'};return _0x53e3e8;}})});}_0x5ba173=_[_0xc9a9('0x51')]({},_0x5ba173,_0x31eed4[_0xc9a9('0x53')]);var _0x141eda={'where':_0x5ba173[_0xc9a9('0x4e')]};return db[_0xc9a9('0x42')][_0xc9a9('0x34')](_0x141eda)[_0xc9a9('0x23')](function(_0x2f956c){_0x448aa8[_0xc9a9('0x34')]=_0x2f956c;if(_0x31eed4[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x5ba173[_0xc9a9('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0xc9a9('0x56')](_0x5ba173);})[_0xc9a9('0x23')](function(_0x3df710){_0x448aa8[_0xc9a9('0x57')]=_0x3df710;return _0x448aa8;})[_0xc9a9('0x23')](respondWithFilteredResult(_0x33cfcd,_0x5ba173))[_0xc9a9('0x2d')](handleError(_0x33cfcd,null));};exports['show']=function(_0x3b90a4,_0x3f7747){var _0x6f8cda={'raw':![],'where':{'id':_0x3b90a4['params']['id']},'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]},_0x32f0fb={};_0x32f0fb[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db[_0xc9a9('0x42')][_0xc9a9('0x43')]);_0x32f0fb[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x3b90a4['query']);_0x32f0fb[_0xc9a9('0x49')]=_['intersection'](_0x32f0fb[_0xc9a9('0x46')],_0x32f0fb[_0xc9a9('0x47')]);_0x6f8cda[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x32f0fb['model'],qs[_0xc9a9('0x4b')](_0x3b90a4[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x6f8cda[_0xc9a9('0x4a')]=_0x6f8cda[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x6f8cda['attributes']:_0x32f0fb[_0xc9a9('0x46')];if(_0x3b90a4[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x6f8cda[_0xc9a9('0x55')]=[{'all':!![]}];}_0x6f8cda=_[_0xc9a9('0x51')]({},_0x6f8cda,_0x3b90a4[_0xc9a9('0x53')]);return db[_0xc9a9('0x42')][_0xc9a9('0x5a')](_0x6f8cda)[_0xc9a9('0x23')](handleEntityNotFound(_0x3f7747,null))[_0xc9a9('0x23')](respondWithResult(_0x3f7747,null))[_0xc9a9('0x2d')](handleError(_0x3f7747,null));};exports['create']=function(_0x5bcd71,_0x2414d2){return db[_0xc9a9('0x42')][_0xc9a9('0x5b')](_0x5bcd71[_0xc9a9('0x5c')],{})[_0xc9a9('0x23')](function(_0x54c96f){var _0x307df3=_0x5bcd71[_0xc9a9('0x5d')]['get']({'plain':!![]});if(!_0x307df3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x307df3[_0xc9a9('0x5e')]==='user'){var _0x2b760a=_0x54c96f[_0xc9a9('0x3a')]({'plain':!![]});var _0x2e0fef=_0xc9a9('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x2e0fef,'userProfileId':_0x307df3[_0xc9a9('0x5f')]},'raw':!![]})[_0xc9a9('0x23')](function(_0x1f3728){if(_0x1f3728&&_0x1f3728[_0xc9a9('0x60')]===0x0){return db[_0xc9a9('0x3c')][_0xc9a9('0x5b')]({'name':_0x2b760a[_0xc9a9('0x3e')],'resourceId':_0x2b760a['id'],'type':_0x1f3728[_0xc9a9('0x3e')],'sectionId':_0x1f3728['id']},{})[_0xc9a9('0x23')](function(){return _0x54c96f;});}else{return _0x54c96f;}})[_0xc9a9('0x2d')](function(_0x52f6af){logger[_0xc9a9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52f6af);throw _0x52f6af;});}return _0x54c96f;})[_0xc9a9('0x23')](respondWithResult(_0x2414d2,0xc9))[_0xc9a9('0x2d')](handleError(_0x2414d2,null));};exports[_0xc9a9('0x61')]=function(_0x5d819c,_0x155c50){if(_0x5d819c[_0xc9a9('0x5c')]['id']){delete _0x5d819c[_0xc9a9('0x5c')]['id'];}return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x5d819c[_0xc9a9('0x62')]['id']},'include':[{'model':db[_0xc9a9('0x3f')],'as':_0xc9a9('0x40')}]})[_0xc9a9('0x23')](handleEntityNotFound(_0x155c50,null))[_0xc9a9('0x23')](saveUpdates(_0x5d819c[_0xc9a9('0x5c')],null))[_0xc9a9('0x23')](respondWithResult(_0x155c50,null))[_0xc9a9('0x2d')](handleError(_0x155c50,null));};exports[_0xc9a9('0x3d')]=function(_0x867d23,_0x11cfae){return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x867d23[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x11cfae,null))[_0xc9a9('0x23')](removeEntity(_0x11cfae,null))[_0xc9a9('0x2d')](handleError(_0x11cfae,null));};exports[_0xc9a9('0x63')]=function(_0x2750e3,_0x5cc08c){return db[_0xc9a9('0x42')]['describe']()['then'](respondWithResult(_0x5cc08c,null))['catch'](handleError(_0x5cc08c,null));};exports['addDisposition']=function(_0x4f6524,_0x32376b,_0x16a42c){if(_0x4f6524['body']['id']){delete _0x4f6524['body']['id'];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x4f6524[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x32376b,null))[_0xc9a9('0x23')](function(_0x19408f){if(_0x19408f){_0x4f6524[_0xc9a9('0x5c')][_0xc9a9('0x64')]=_0x19408f['id'];return db[_0xc9a9('0x65')][_0xc9a9('0x5b')](_0x4f6524[_0xc9a9('0x5c')]);}})['then'](respondWithResult(_0x32376b,null))[_0xc9a9('0x2d')](handleError(_0x32376b,null));};exports[_0xc9a9('0x66')]=function(_0x3b82f7,_0x55883c,_0x25f1ad){var _0x4a0302={'raw':![],'where':{}};var _0x3bf6df={};var _0x2e5808={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x3b82f7[_0xc9a9('0x62')]['id']}})['then'](handleEntityNotFound(_0x55883c,null))['then'](function(_0x4f549b){if(_0x4f549b){_0x3bf6df[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x65')][_0xc9a9('0x43')]);_0x3bf6df['query']=_['keys'](_0x3b82f7['query']);_0x3bf6df[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x3bf6df[_0xc9a9('0x46')],_0x3bf6df[_0xc9a9('0x47')]);_0x4a0302[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x3bf6df[_0xc9a9('0x46')],qs['fields'](_0x3b82f7[_0xc9a9('0x47')]['fields']));_0x4a0302[_0xc9a9('0x4a')]=_0x4a0302[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x4a0302[_0xc9a9('0x4a')]:_0x3bf6df['model'];if(!_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x4a0302[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x3b82f7[_0xc9a9('0x47')]['limit']);_0x4a0302[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x4a0302[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x3b82f7['query'][_0xc9a9('0x4d')]);_0x4a0302['where']=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x3b82f7[_0xc9a9('0x47')],_0x3bf6df['filters']));_0x4a0302[_0xc9a9('0x4e')][_0xc9a9('0x64')]=_0x4f549b['id'];if(_0x3b82f7[_0xc9a9('0x47')]['filter']){_0x4a0302[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x4a0302[_0xc9a9('0x4e')],{'$or':_['map'](_0x4a0302[_0xc9a9('0x4a')],function(_0x4b19c8){var _0x4eaa92={};_0x4eaa92[_0x4b19c8]={'$like':'%'+_0x3b82f7[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x4eaa92;})});}_0x4a0302=_[_0xc9a9('0x51')]({},_0x4a0302,_0x3b82f7['options']);return db['Disposition']['count']({'where':_0x4a0302[_0xc9a9('0x4e')]})[_0xc9a9('0x23')](function(_0x85952d){_0x2e5808[_0xc9a9('0x34')]=_0x85952d;if(_0x3b82f7['query'][_0xc9a9('0x54')]){_0x4a0302[_0xc9a9('0x55')]=[{'all':!![]}];}return db[_0xc9a9('0x65')][_0xc9a9('0x56')](_0x4a0302);})[_0xc9a9('0x23')](function(_0x1fb323){_0x2e5808['rows']=_0x1fb323;return _0x2e5808;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x55883c,_0x4a0302))[_0xc9a9('0x2d')](handleError(_0x55883c,null));};exports[_0xc9a9('0x6a')]=function(_0x26c512,_0x591d42,_0x30e684){return db['FaxAccount'][_0xc9a9('0x5a')]({'where':{'id':_0x26c512[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x591d42,null))[_0xc9a9('0x23')](function(_0x3f6c17){if(_0x3f6c17){return _0x3f6c17[_0xc9a9('0x6a')](_0x26c512[_0xc9a9('0x47')][_0xc9a9('0x6b')]);}})[_0xc9a9('0x23')](respondWithStatusCode(_0x591d42,null))[_0xc9a9('0x2d')](handleError(_0x591d42,null));};exports[_0xc9a9('0x6c')]=function(_0x907b2c,_0x3cf067,_0x2adb73){if(_0x907b2c[_0xc9a9('0x5c')]['id']){delete _0x907b2c[_0xc9a9('0x5c')]['id'];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x907b2c['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3cf067,null))[_0xc9a9('0x23')](function(_0x4f832a){if(_0x4f832a){_0x907b2c[_0xc9a9('0x5c')]['FaxAccountId']=_0x4f832a['id'];return db[_0xc9a9('0x6d')][_0xc9a9('0x5b')](_0x907b2c['body']);}})[_0xc9a9('0x23')](respondWithResult(_0x3cf067,null))['catch'](handleError(_0x3cf067,null));};exports[_0xc9a9('0x6e')]=function(_0x48c289,_0x2aa015,_0x17756d){var _0x13e3dd={'raw':![],'where':{}};var _0x2edf62={};var _0x2b0143={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x48c289[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x2aa015,null))[_0xc9a9('0x23')](function(_0x4c1bf6){if(_0x4c1bf6){_0x2edf62[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db['CannedAnswer'][_0xc9a9('0x43')]);_0x2edf62['query']=_[_0xc9a9('0x48')](_0x48c289[_0xc9a9('0x47')]);_0x2edf62[_0xc9a9('0x49')]=_['intersection'](_0x2edf62[_0xc9a9('0x46')],_0x2edf62[_0xc9a9('0x47')]);_0x13e3dd[_0xc9a9('0x4a')]=_['intersection'](_0x2edf62['model'],qs['fields'](_0x48c289['query']['fields']));_0x13e3dd[_0xc9a9('0x4a')]=_0x13e3dd[_0xc9a9('0x4a')]['length']?_0x13e3dd[_0xc9a9('0x4a')]:_0x2edf62[_0xc9a9('0x46')];if(!_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x13e3dd[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x13e3dd[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x13e3dd[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x4d')]);_0x13e3dd[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x48c289[_0xc9a9('0x47')],_0x2edf62['filters']));_0x13e3dd['where'][_0xc9a9('0x64')]=_0x4c1bf6['id'];if(_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x50')]){_0x13e3dd['where']=_['merge'](_0x13e3dd['where'],{'$or':_['map'](_0x13e3dd[_0xc9a9('0x4a')],function(_0x1fcd4b){var _0x9298c8={};_0x9298c8[_0x1fcd4b]={'$like':'%'+_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x9298c8;})});}_0x13e3dd=_[_0xc9a9('0x51')]({},_0x13e3dd,_0x48c289[_0xc9a9('0x53')]);return db[_0xc9a9('0x6d')][_0xc9a9('0x34')]({'where':_0x13e3dd[_0xc9a9('0x4e')]})[_0xc9a9('0x23')](function(_0x26b535){_0x2b0143[_0xc9a9('0x34')]=_0x26b535;if(_0x48c289[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x13e3dd['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc9a9('0x56')](_0x13e3dd);})[_0xc9a9('0x23')](function(_0x4926bf){_0x2b0143[_0xc9a9('0x57')]=_0x4926bf;return _0x2b0143;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x2aa015,_0x13e3dd))[_0xc9a9('0x2d')](handleError(_0x2aa015,null));};exports[_0xc9a9('0x6f')]=function(_0x719df0,_0x51b277,_0x1f3ac7){return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x719df0['params']['id']}})['then'](handleEntityNotFound(_0x51b277,null))[_0xc9a9('0x23')](function(_0xbbf733){if(_0xbbf733){return _0xbbf733[_0xc9a9('0x6f')](_0x719df0[_0xc9a9('0x47')]['ids']);}})[_0xc9a9('0x23')](respondWithStatusCode(_0x51b277,null))[_0xc9a9('0x2d')](handleError(_0x51b277,null));};exports['addInteraction']=function(_0x3321c7,_0x3410ba,_0x35d612){return db['FaxInteraction'][_0xc9a9('0x5a')]({'where':{'id':_0x3321c7['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3410ba,null))[_0xc9a9('0x23')](function(_0x29c13f){if(_0x29c13f){return _0x29c13f['addInteraction'](_0x3321c7[_0xc9a9('0x5c')][_0xc9a9('0x6b')],_[_0xc9a9('0x70')](_0x3321c7['body'],[_0xc9a9('0x6b'),'id'])||{});}})[_0xc9a9('0x23')](respondWithResult(_0x3410ba,null))[_0xc9a9('0x2d')](handleError(_0x3410ba,null));};exports[_0xc9a9('0x71')]=function(_0x4496ff,_0xb82e26,_0x34ac6e){var _0x1fe549={'raw':![],'where':{}};var _0x175c4f={};var _0x1f317a={'count':0x0,'rows':[]};return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x4496ff[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0xb82e26,null))[_0xc9a9('0x23')](function(_0x23822c){if(_0x23822c){_0x175c4f[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db[_0xc9a9('0x72')][_0xc9a9('0x43')]);_0x175c4f['query']=_[_0xc9a9('0x48')](_0x4496ff['query']);_0x175c4f['filters']=_[_0xc9a9('0x58')](_0x175c4f[_0xc9a9('0x46')],_0x175c4f['query']);_0x1fe549['attributes']=_[_0xc9a9('0x58')](_0x175c4f['model'],qs[_0xc9a9('0x4b')](_0x4496ff['query'][_0xc9a9('0x4b')]));_0x1fe549[_0xc9a9('0x4a')]=_0x1fe549[_0xc9a9('0x4a')]['length']?_0x1fe549['attributes']:_0x175c4f[_0xc9a9('0x46')];if(!_0x4496ff[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0x1fe549[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x4496ff[_0xc9a9('0x47')][_0xc9a9('0x33')]);_0x1fe549[_0xc9a9('0x31')]=qs['offset'](_0x4496ff['query'][_0xc9a9('0x31')]);}_0x1fe549[_0xc9a9('0x69')]=qs[_0xc9a9('0x4d')](_0x4496ff['query'][_0xc9a9('0x4d')]);_0x1fe549[_0xc9a9('0x4e')]=qs['filters'](_['pick'](_0x4496ff['query'],_0x175c4f['filters']));_0x1fe549[_0xc9a9('0x4e')][_0xc9a9('0x64')]=_0x23822c['id'];if(_0x4496ff['query']['filter']){_0x1fe549[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x1fe549[_0xc9a9('0x4e')],{'$or':_['map'](_0x1fe549[_0xc9a9('0x4a')],function(_0x567b68){var _0x1c0778={};_0x1c0778[_0x567b68]={'$like':'%'+_0x4496ff['query']['filter']+'%'};return _0x1c0778;})});}_0x1fe549=_[_0xc9a9('0x51')]({},_0x1fe549,_0x4496ff['options']);return db[_0xc9a9('0x72')][_0xc9a9('0x34')]({'where':_0x1fe549['where']})[_0xc9a9('0x23')](function(_0x5532b0){_0x1f317a[_0xc9a9('0x34')]=_0x5532b0;if(_0x4496ff['query'][_0xc9a9('0x54')]){_0x1fe549[_0xc9a9('0x55')]=[{'model':db[_0xc9a9('0x73')],'as':_0xc9a9('0x74'),'required':![]},{'model':db[_0xc9a9('0x75')],'as':_0xc9a9('0x76'),'attributes':[_0xc9a9('0x3e'),_0xc9a9('0x77'),_0xc9a9('0x78')],'required':![]},{'model':db['Tag'],'as':_0xc9a9('0x79'),'attributes':['id',_0xc9a9('0x3e'),_0xc9a9('0x7a')],'where':_0x4496ff['query'][_0xc9a9('0x7b')]?{'id':_0x4496ff[_0xc9a9('0x47')]['tag']}:undefined,'required':_0x4496ff['query'][_0xc9a9('0x7b')]?!![]:![]}];}return db[_0xc9a9('0x72')][_0xc9a9('0x56')](_0x1fe549);})[_0xc9a9('0x23')](function(_0x500dfb){_0x1f317a[_0xc9a9('0x57')]=_0x500dfb;return _0x1f317a;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0xb82e26,_0x1fe549))['catch'](handleError(_0xb82e26,null));};exports['addApplications']=function(_0x43f555,_0x2a47de,_0x26e7cb){return db[_0xc9a9('0x42')]['findOne']({'where':{'id':_0x43f555['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x2a47de,null))[_0xc9a9('0x23')](function(_0x188505){if(_0x188505){return db[_0xc9a9('0x7c')][_0xc9a9('0x7d')](function(_0x1a2656){return db[_0xc9a9('0x7e')][_0xc9a9('0x3d')]({'where':{'FaxAccountId':_0x43f555[_0xc9a9('0x62')]['id']},'transaction':_0x1a2656})[_0xc9a9('0x23')](function(_0xc1952f){var _0x5a5103=_['map'](_0x43f555['body'],function(_0x1d917c){_0x1d917c['FaxAccountId']=_0x43f555['params']['id'];return _0x1d917c;});return db[_0xc9a9('0x7e')][_0xc9a9('0x7f')](_0x5a5103,{'transaction':_0x1a2656});});})[_0xc9a9('0x23')](function(){return db[_0xc9a9('0x7e')][_0xc9a9('0x80')]({'where':{'FaxAccountId':_0x43f555['params']['id']},'order':'priority'});});}})[_0xc9a9('0x23')](respondWithResult(_0x2a47de,null))[_0xc9a9('0x2d')](handleError(_0x2a47de,null));};exports[_0xc9a9('0x81')]=function(_0x18829e,_0x3aea1a,_0x135fb0){var _0xe4b39f={};var _0x29ac2a={};var _0x9de475;var _0x5de426;return db[_0xc9a9('0x42')]['findOne']({'where':{'id':_0x18829e['params']['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3aea1a,null))[_0xc9a9('0x23')](function(_0x1e2069){if(_0x1e2069){_0x9de475=_0x1e2069;_0x29ac2a[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x7e')][_0xc9a9('0x43')]);_0x29ac2a[_0xc9a9('0x47')]=_[_0xc9a9('0x48')](_0x18829e[_0xc9a9('0x47')]);_0x29ac2a[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x29ac2a['model'],_0x29ac2a[_0xc9a9('0x47')]);_0xe4b39f[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x29ac2a[_0xc9a9('0x46')],qs['fields'](_0x18829e['query'][_0xc9a9('0x4b')]));_0xe4b39f[_0xc9a9('0x4a')]=_0xe4b39f['attributes'][_0xc9a9('0x59')]?_0xe4b39f[_0xc9a9('0x4a')]:_0x29ac2a[_0xc9a9('0x46')];_0xe4b39f[_0xc9a9('0x69')]=qs['sort'](_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x4d')]);_0xe4b39f[_0xc9a9('0x4e')]=qs['filters'](_[_0xc9a9('0x4f')](_0x18829e[_0xc9a9('0x47')],_0x29ac2a['filters']));if(_0x18829e['query']['filter']){_0xe4b39f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0xe4b39f[_0xc9a9('0x4e')],{'$or':_[_0xc9a9('0x41')](_0xe4b39f[_0xc9a9('0x4a')],function(_0x14d949){var _0x3bfff5={};_0x3bfff5[_0x14d949]={'$like':'%'+_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x3bfff5;})});}_0xe4b39f=_[_0xc9a9('0x51')]({},_0xe4b39f,_0x18829e[_0xc9a9('0x53')]);return _0x9de475[_0xc9a9('0x81')](_0xe4b39f);}})[_0xc9a9('0x23')](function(_0x2cfb9f){if(_0x2cfb9f){_0x5de426=_0x2cfb9f[_0xc9a9('0x59')];if(!_0x18829e[_0xc9a9('0x47')]['hasOwnProperty'](_0xc9a9('0x4c'))){_0xe4b39f[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x18829e[_0xc9a9('0x47')]['limit']);_0xe4b39f[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x18829e[_0xc9a9('0x47')][_0xc9a9('0x31')]);}return _0x9de475['getApplications'](_0xe4b39f);}})[_0xc9a9('0x23')](function(_0x517670){if(_0x517670){return _0x517670?{'count':_0x5de426,'rows':_0x517670}:null;}})[_0xc9a9('0x23')](respondWithResult(_0x3aea1a,null))[_0xc9a9('0x2d')](handleError(_0x3aea1a,null));};function Extension(_0x5c723d,_0x55c65a,_0x2790e1,_0x87f61f){this[_0xc9a9('0x82')]='from-voip-provider';this[_0xc9a9('0x83')]=_0x5c723d[_0xc9a9('0x84')];this[_0xc9a9('0x85')]=_0x87f61f;this['type']='system';this['description']=_0xc9a9('0x86');this['FaxAccountId']=_0x5c723d['id'];this[_0xc9a9('0x87')]=_0x55c65a;this[_0xc9a9('0x88')]=_0x2790e1;}function createExtensionsReciveFax(_0x552122){var _0x531a8b=0x1;var _0x531d4c=[];_0x531d4c[_0xc9a9('0x89')](new Extension(_0x552122,_0x531a8b,'',_0xc9a9('0x8a')));_0x531a8b+=0x1;_0x531d4c[_0xc9a9('0x89')](new Extension(_0x552122,_0x531a8b,_0xc9a9('0x8b'),_0xc9a9('0x8c')));_0x531a8b+=0x1;for(var _0x142b83 in _0x552122){if(_0x552122[_0xc9a9('0x68')](_0x142b83)&&(_0x142b83==='ecm'||_0x142b83==='localstationid'||_0x142b83===_0xc9a9('0x8d')||_0x142b83===_0xc9a9('0x8e')||_0x142b83===_0xc9a9('0x8f')||_0x142b83==='maxrate'||_0x142b83===_0xc9a9('0x90')||_0x142b83===_0xc9a9('0x91')||_0x142b83===_0xc9a9('0x92'))){_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,_0xc9a9('0x93')+_0x142b83+')='+_0x552122[_0x142b83],_0xc9a9('0x8c')));_0x531a8b+=0x1;}}_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,'6',_0xc9a9('0x94')));_0x531a8b+=0x1;_0x531d4c['push'](new Extension(_0x552122,_0x531a8b,'/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',_0xc9a9('0x95')));_0x531a8b=0x0;return _0x531d4c;}exports[_0xc9a9('0x96')]=function(_0x456022,_0x3c5774,_0x2363ad){var _0x1a912a;return db[_0xc9a9('0x7c')]['transaction'](function(_0x545ec5){return db[_0xc9a9('0x42')][_0xc9a9('0x5b')](_0x456022[_0xc9a9('0x5c')],{'transaction':_0x545ec5})[_0xc9a9('0x23')](function(_0x2721a8){_0x1a912a=_0x2721a8[_0xc9a9('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0xc9a9('0x7f')](createExtensionsReciveFax(_0x1a912a),{'transaction':_0x545ec5});});})[_0xc9a9('0x23')](function(){return _0x1a912a;})['then'](respondWithResult(_0x3c5774,null))[_0xc9a9('0x2d')](handleError(_0x3c5774,null));};exports['updateAccountApplications']=function(_0x5a8ee4,_0x5a363c,_0x4899cd){var _0x38477e;return db[_0xc9a9('0x7c')][_0xc9a9('0x7d')](function(_0x598158){return db['FaxAccount'][_0xc9a9('0x61')](_0x5a8ee4[_0xc9a9('0x5c')],{'where':{'id':_0x5a8ee4['body']['id']},'transaction':_0x598158})[_0xc9a9('0x23')](function(_0x34e265){return db[_0xc9a9('0x97')]['destroy']({'where':{'FaxAccountId':_0x5a8ee4[_0xc9a9('0x5c')]['id']},'transaction':_0x598158})['then'](function(_0x4be1d0){return db[_0xc9a9('0x97')]['bulkCreate'](createExtensionsReciveFax(_[_0xc9a9('0x70')](_0x5a8ee4[_0xc9a9('0x5c')],['tech',_0xc9a9('0x45'),'createdAt',_0xc9a9('0x98'),_0xc9a9('0x99'),_0xc9a9('0x9a')])),{'transaction':_0x598158});});});})[_0xc9a9('0x23')](function(){return db[_0xc9a9('0x42')][_0xc9a9('0x9b')](_0x5a8ee4[_0xc9a9('0x5c')]['id']);})[_0xc9a9('0x23')](respondWithResult(_0x5a363c,null))[_0xc9a9('0x2d')](handleError(_0x5a363c,null));};exports[_0xc9a9('0x9c')]=function(_0x13b651,_0x3b80fb,_0x49af30){var _0x347c4f={'raw':!![],'where':{}};var _0x1f4505={};var _0x14d996={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc9a9('0x67')]({'where':{'id':_0x13b651[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x3b80fb,null))[_0xc9a9('0x23')](function(_0xf8a534){if(_0xf8a534){_0x1f4505[_0xc9a9('0x46')]=_['keys'](db[_0xc9a9('0x9d')][_0xc9a9('0x43')]);_0x1f4505[_0xc9a9('0x47')]=_['keys'](_0x13b651[_0xc9a9('0x47')]);_0x1f4505[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x1f4505[_0xc9a9('0x46')],_0x1f4505[_0xc9a9('0x47')]);_0x347c4f[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x1f4505[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x4b')]));_0x347c4f[_0xc9a9('0x4a')]=_0x347c4f[_0xc9a9('0x4a')][_0xc9a9('0x59')]?_0x347c4f[_0xc9a9('0x4a')]:_0x1f4505[_0xc9a9('0x46')];if(!_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x68')](_0xc9a9('0x4c'))){_0x347c4f[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x13b651['query'][_0xc9a9('0x33')]);_0x347c4f['offset']=qs[_0xc9a9('0x31')](_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x31')]);}_0x347c4f[_0xc9a9('0x69')]=qs['sort'](_0x13b651[_0xc9a9('0x47')]['sort']);_0x347c4f[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_['pick'](_0x13b651['query'],_0x1f4505[_0xc9a9('0x49')]));_0x347c4f['where']['FaxAccountId']=_0xf8a534['id'];if(_0x13b651[_0xc9a9('0x47')]['filter']){_0x347c4f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x347c4f[_0xc9a9('0x4e')],{'$or':_['map'](_0x347c4f[_0xc9a9('0x4a')],function(_0x2b8e1c){var _0x1d6de6={};_0x1d6de6[_0x2b8e1c]={'$like':'%'+_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x1d6de6;})});}if(_0x13b651[_0xc9a9('0x47')]['$gte']){var _0x602ac7=_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x9e')][_0xc9a9('0x9f')](',');var _0x39ed3b={};_0x39ed3b[_0x602ac7[0x0]]={'$gte':moment(_0x602ac7[0x1])[_0xc9a9('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x347c4f[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x347c4f[_0xc9a9('0x4e')],_0x39ed3b);}_0x347c4f=_[_0xc9a9('0x51')]({},_0x347c4f,_0x13b651[_0xc9a9('0x53')]);return db[_0xc9a9('0x9d')][_0xc9a9('0x34')]({'where':_0x347c4f[_0xc9a9('0x4e')]})['then'](function(_0x37afd8){_0x14d996[_0xc9a9('0x34')]=_0x37afd8;if(_0x13b651[_0xc9a9('0x47')][_0xc9a9('0x54')]){_0x347c4f[_0xc9a9('0x55')]=[{'all':!![]}];}return db[_0xc9a9('0x9d')]['findAll'](_0x347c4f);})['then'](function(_0x70869a){_0x14d996[_0xc9a9('0x57')]=_0x70869a;return _0x14d996;});}})[_0xc9a9('0x23')](respondWithFilteredResult(_0x3b80fb,_0x347c4f))[_0xc9a9('0x2d')](handleError(_0x3b80fb,null));};exports[_0xc9a9('0xa1')]=function(_0x384b81,_0x4f2992,_0x119c0e){var _0x2aabff,_0x370526={},_0x2f638c;if(_0x384b81[_0xc9a9('0x5c')]['to']){_0x2f638c=_0x384b81[_0xc9a9('0x5c')]['to'][0x0];}return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x384b81[_0xc9a9('0x62')]['id']},'include':[{'model':db[_0xc9a9('0xa2')],'as':_0xc9a9('0xa3'),'include':[{'model':db[_0xc9a9('0x73')],'as':_0xc9a9('0xa4'),'where':{'fax':_0x2f638c},'limit':0x1,'order':[[_0xc9a9('0x98'),_0xc9a9('0xa5')]]}]}]})[_0xc9a9('0x23')](handleEntityNotFound(_0x4f2992,null))['then'](function(_0x415cf2){_0x2aabff=_0x415cf2;if(_0x384b81[_0xc9a9('0x5c')]['attachments']&&_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0xc9a9('0x59')]){for(var _0x1ce97b=0x0;_0x1ce97b<_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0xc9a9('0x59')];_0x1ce97b+=0x1){_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0x1ce97b]={'filename':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][_0x1ce97b][_0xc9a9('0x3e')],'id':_0x384b81['body'][_0xc9a9('0xa6')][_0x1ce97b]['id'],'path':path[_0xc9a9('0xa7')](config[_0xc9a9('0xa8')],_0xc9a9('0xa9'),_0x384b81['body'][_0xc9a9('0xa6')][_0x1ce97b][_0xc9a9('0xaa')])};}}return respondWithRpcPromise(_0xc9a9('0xab'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x384b81['params']['id'])?undefined:_0x384b81[_0xc9a9('0x62')]['id'],'path':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')])?undefined:_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')],'fax':_['isNil'](_0x384b81[_0xc9a9('0x5c')]['to'][0x0])?undefined:_0x384b81[_0xc9a9('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x2aabff){if(_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xad')])){_0x384b81['body'][_0xc9a9('0xad')]=util[_0xc9a9('0xa0')]('\x22%s\x22\x20<%s>',_0x2aabff[_0xc9a9('0x3e')],_0x2aabff['fax']);}if(_0x2aabff['List']){if(_0x2aabff['List']['Contacts']['length']){return _0x2aabff[_0xc9a9('0xa3')][_0xc9a9('0xa4')][0x0];}else{return db[_0xc9a9('0x73')][_0xc9a9('0x5b')](_[_0xc9a9('0x1b')](_0x384b81[_0xc9a9('0x5c')],{'firstName':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'phone':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'fax':_0x384b81['body']['to'][0x0],'ListId':_0x2aabff[_0xc9a9('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xc9a9('0xae'));}})['then'](function(_0x76004){if(_0x76004){return db[_0xc9a9('0x72')][_0xc9a9('0x5a')]({'where':{'ContactId':_0x76004['id'],'closed':![],'FaxAccountId':_0x2aabff['id']}})['then'](function(_0x3507e0){if(_0x3507e0){return[_0x3507e0,![]];}return db[_0xc9a9('0x72')][_0xc9a9('0x5b')]({'UserId':_0x384b81[_0xc9a9('0x5d')]['id'],'ContactId':_0x76004['id'],'FaxAccountId':_0x2aabff['id'],'fax':_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'firstMsgDirection':_0xc9a9('0xaf'),'Messages':[_[_0xc9a9('0x51')](_0x384b81['body'],{'read':![],'body':_0x384b81['body'][_0xc9a9('0xa6')][0x0]['filename'],'FaxAccountId':_0x2aabff['id'],'UserId':_0x384b81['user']['id'],'ContactId':_0x76004['id'],'AttachmentId':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xc9a9('0xb0')}]})[_0xc9a9('0x23')](function(_0x1652cd){return[_0x1652cd,!![]];});});}else{throw new Error(_0xc9a9('0xb1'));}})['spread'](function(_0x49ede5,_0x1a2ff2){if(_0x1a2ff2){return _0x49ede5;}return db[_0xc9a9('0x9d')][_0xc9a9('0x5b')]({'direction':'out','read':![],'body':_0x384b81['body'][_0xc9a9('0xa6')][0x0][_0xc9a9('0xb2')],'FaxAccountId':_0x2aabff['id'],'FaxInteractionId':_0x49ede5['id'],'UserId':_0x384b81[_0xc9a9('0x5d')]['id'],'ContactId':_0x49ede5['ContactId'],'AttachmentId':_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0]['id']})[_0xc9a9('0x23')](function(_0x420171){_0x49ede5[_0xc9a9('0xb3')][_0xc9a9('0xb0')]=[];_0x49ede5[_0xc9a9('0xb3')]['Messages'][_0xc9a9('0x89')](_0x420171[_0xc9a9('0xb3')]);return _0x49ede5;});})[_0xc9a9('0x23')](function(_0x56bbda){respondWithRpcPromise(_0xc9a9('0xb4'),'SendFax',{'FaxAccountId':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x62')]['id'])?undefined:_0x384b81['params']['id'],'path':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')][_0xc9a9('0xa6')][0x0][_0xc9a9('0x7')])?undefined:_0x384b81[_0xc9a9('0x5c')]['attachments'][0x0][_0xc9a9('0x7')],'fax':_[_0xc9a9('0xac')](_0x384b81[_0xc9a9('0x5c')]['to'][0x0])?undefined:_0x384b81[_0xc9a9('0x5c')]['to'][0x0],'AttachmentId':_0x384b81[_0xc9a9('0x5c')]['attachments'][0x0]['id']},client9002)[_0xc9a9('0x23')](function(_0x24d9f6){logger[_0xc9a9('0x24')]('SendFaxRpc,\x20%s',_0x24d9f6);})[_0xc9a9('0x2d')](function(_0xe75712){logger['info'](_0xc9a9('0xb5'),_0xe75712);});return _0x56bbda;})[_0xc9a9('0x23')](respondWithResult(_0x4f2992,null))['catch'](handleError(_0x4f2992,null));};exports[_0xc9a9('0xb6')]=function(_0x4fd4a7,_0x5e4313,_0x548b4b){return db[_0xc9a9('0x42')]['find']({'where':{'id':_0x4fd4a7[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x5e4313,null))[_0xc9a9('0x23')](function(_0x57be48){if(_0x57be48){return _0x57be48['addAgents'](_0x4fd4a7['body'][_0xc9a9('0x6b')],_[_0xc9a9('0x70')](_0x4fd4a7[_0xc9a9('0x5c')],[_0xc9a9('0x6b'),'id'])||{})[_0xc9a9('0xb7')](function(_0x16d188){for(var _0x108333=0x0;_0x108333<_0x4fd4a7[_0xc9a9('0x5c')][_0xc9a9('0x6b')][_0xc9a9('0x59')];_0x108333+=0x1){socket[_0xc9a9('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x4fd4a7[_0xc9a9('0x5c')][_0xc9a9('0x6b')][_0x108333]),'FaxAccountId':Number(_0x4fd4a7['params']['id'])});}return _0x16d188;});}})[_0xc9a9('0x23')](respondWithResult(_0x5e4313,null))[_0xc9a9('0x2d')](handleError(_0x5e4313,null));};exports[_0xc9a9('0xb9')]=function(_0x96047d,_0x964769,_0x1db5e9){return db[_0xc9a9('0x42')][_0xc9a9('0x5a')]({'where':{'id':_0x96047d[_0xc9a9('0x62')]['id']}})[_0xc9a9('0x23')](handleEntityNotFound(_0x964769,null))[_0xc9a9('0x23')](function(_0x4fe349){if(_0x4fe349){return _0x4fe349[_0xc9a9('0xb9')](_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')])[_0xc9a9('0x23')](function(){if(_[_0xc9a9('0xba')](_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')])){for(var _0x9d4b99=0x0;_0x9d4b99<_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')][_0xc9a9('0x59')];_0x9d4b99+=0x1){socket[_0xc9a9('0xb8')](_0xc9a9('0xbb'),{'UserId':Number(_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')][_0x9d4b99]),'FaxAccountId':Number(_0x96047d[_0xc9a9('0x62')]['id'])});}}else{socket['emit'](_0xc9a9('0xbb'),{'UserId':Number(_0x96047d[_0xc9a9('0x47')][_0xc9a9('0x6b')]),'FaxAccountId':Number(_0x96047d[_0xc9a9('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x964769,null))['catch'](handleError(_0x964769,null));};exports[_0xc9a9('0xbc')]=function(_0x44ffcd,_0x1aff39,_0x2c0cff){var _0x1b6776={};var _0x3525c0={};var _0x1a6610;var _0x536db5;return db[_0xc9a9('0x42')][_0xc9a9('0x67')]({'where':{'id':_0x44ffcd['params']['id']}})['then'](handleEntityNotFound(_0x1aff39,null))['then'](function(_0x31c9be){if(_0x31c9be){_0x1a6610=_0x31c9be;_0x3525c0[_0xc9a9('0x46')]=_[_0xc9a9('0x48')](db['User'][_0xc9a9('0x43')]);_0x3525c0[_0xc9a9('0x47')]=_['keys'](_0x44ffcd[_0xc9a9('0x47')]);_0x3525c0[_0xc9a9('0x49')]=_[_0xc9a9('0x58')](_0x3525c0[_0xc9a9('0x46')],_0x3525c0['query']);_0x1b6776[_0xc9a9('0x4a')]=_[_0xc9a9('0x58')](_0x3525c0[_0xc9a9('0x46')],qs[_0xc9a9('0x4b')](_0x44ffcd[_0xc9a9('0x47')]['fields']));_0x1b6776[_0xc9a9('0x4a')]=_0x1b6776['attributes'][_0xc9a9('0x59')]?_0x1b6776[_0xc9a9('0x4a')]:_0x3525c0['model'];_0x1b6776['order']=qs[_0xc9a9('0x4d')](_0x44ffcd['query'][_0xc9a9('0x4d')]);_0x1b6776[_0xc9a9('0x4e')]=qs[_0xc9a9('0x49')](_[_0xc9a9('0x4f')](_0x44ffcd[_0xc9a9('0x47')],_0x3525c0[_0xc9a9('0x49')]));if(_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x50')]){_0x1b6776[_0xc9a9('0x4e')]=_[_0xc9a9('0x51')](_0x1b6776[_0xc9a9('0x4e')],{'$or':_[_0xc9a9('0x41')](_0x1b6776['attributes'],function(_0x53da74){var _0x4a1861={};_0x4a1861[_0x53da74]={'$like':'%'+_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x50')]+'%'};return _0x4a1861;})});}_0x1b6776=_[_0xc9a9('0x51')]({},_0x1b6776,_0x44ffcd['options']);return _0x1a6610['getAgents'](_0x1b6776);}})[_0xc9a9('0x23')](function(_0x50c790){if(_0x50c790){_0x536db5=_0x50c790[_0xc9a9('0x59')];if(!_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x68')]('nolimit')){_0x1b6776[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x44ffcd[_0xc9a9('0x47')]['limit']);_0x1b6776[_0xc9a9('0x31')]=qs[_0xc9a9('0x31')](_0x44ffcd[_0xc9a9('0x47')][_0xc9a9('0x31')]);}return _0x1a6610[_0xc9a9('0xbc')](_0x1b6776);}})[_0xc9a9('0x23')](function(_0xbb122a){if(_0xbb122a){return _0xbb122a?{'count':_0x536db5,'rows':_0xbb122a}:null;}})['then'](respondWithResult(_0x1aff39,null))[_0xc9a9('0x2d')](handleError(_0x1aff39,null));}; \ No newline at end of file +var _0x362e=['params','keys','create','body','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','system','Fax\x20Extension','appdata','push','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','path','format','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','FaxAccounts','destroy','stack','name','send','mandatoryDispositionPause','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','FaxAccount','findAll','rows','catch','show'];(function(_0x1e528f,_0xcd3b2e){var _0x13cf9b=function(_0x4805b){while(--_0x4805b){_0x1e528f['push'](_0x1e528f['shift']());}};_0x13cf9b(++_0xcd3b2e);}(_0x362e,0x65));var _0xe362=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x362e[_0x3a0c4f];return _0x247049;};'use strict';var emlformat=require(_0xe362('0x0'));var rimraf=require(_0xe362('0x1'));var zipdir=require(_0xe362('0x2'));var jsonpatch=require(_0xe362('0x3'));var rp=require(_0xe362('0x4'));var moment=require(_0xe362('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe362('0x6'));var path=require('path');var sox=require(_0xe362('0x7'));var csv=require(_0xe362('0x8'));var ejs=require(_0xe362('0x9'));var fs=require('fs');var fs_extra=require(_0xe362('0xa'));var _=require(_0xe362('0xb'));var squel=require(_0xe362('0xc'));var crypto=require(_0xe362('0xd'));var jsforce=require(_0xe362('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe362('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe362('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe362('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe362('0x11'));var logger=require('../../config/logger')(_0xe362('0x12'));var utils=require(_0xe362('0x13'));var config=require(_0xe362('0x14'));var licenseUtil=require(_0xe362('0x15'));var db=require(_0xe362('0x16'))['db'];config['redis']=_[_0xe362('0x17')](config[_0xe362('0x18')],{'host':_0xe362('0x19'),'port':0x18eb});var socket=require(_0xe362('0x1a'))(new Redis(config['redis']));require(_0xe362('0x1b'))[_0xe362('0x1c')](socket);var jayson=require(_0xe362('0x1d'));var client=jayson['client'][_0xe362('0x1e')]({'port':0x232c});var client9002=jayson[_0xe362('0x1f')][_0xe362('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x233245,_0x27a35f,_0x550e0b,_0x441244){return new BPromise(function(_0xa0cf36,_0x54ab69){var _0x521fd6=_0x441244||client;return _0x521fd6[_0xe362('0x20')](_0x233245,_0x550e0b)['then'](function(_0x7d09f5){logger[_0xe362('0x21')](_0xe362('0x22'),_0x27a35f,_0xe362('0x23'));logger[_0xe362('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x27a35f,_0xe362('0x23'),JSON[_0xe362('0x25')](_0x7d09f5));if(_0x7d09f5[_0xe362('0x26')]){if(_0x7d09f5['error'][_0xe362('0x27')]===0x1f4){logger[_0xe362('0x26')](_0xe362('0x22'),_0x27a35f,_0x7d09f5[_0xe362('0x26')]['message']);return _0x54ab69(_0x7d09f5[_0xe362('0x26')][_0xe362('0x28')]);}logger[_0xe362('0x26')](_0xe362('0x22'),_0x27a35f,_0x7d09f5[_0xe362('0x26')]['message']);return _0xa0cf36(_0x7d09f5[_0xe362('0x26')][_0xe362('0x28')]);}else{logger['info'](_0xe362('0x22'),_0x27a35f,_0xe362('0x23'));_0xa0cf36(_0x7d09f5[_0xe362('0x29')]['message']);}})['catch'](function(_0x4cbcf2){logger['error']('FaxAccount,\x20%s,\x20%s',_0x27a35f,_0x4cbcf2);_0x54ab69(_0x4cbcf2);});});}function respondWithStatusCode(_0x3a3659,_0x46e634){_0x46e634=_0x46e634||0xcc;return function(_0x5dc645){if(_0x5dc645){return _0x3a3659[_0xe362('0x2a')](_0x46e634);}return _0x3a3659[_0xe362('0x2b')](_0x46e634)[_0xe362('0x2c')]();};}function respondWithResult(_0x168515,_0x193e05){_0x193e05=_0x193e05||0xc8;return function(_0x249948){if(_0x249948){return _0x168515[_0xe362('0x2b')](_0x193e05)[_0xe362('0x2d')](_0x249948);}};}function respondWithFilteredResult(_0x32e01b,_0x488d16){return function(_0x9fc09b){if(_0x9fc09b){var _0xfb459b=typeof _0x488d16[_0xe362('0x2e')]===_0xe362('0x2f')&&typeof _0x488d16[_0xe362('0x30')]===_0xe362('0x2f');var _0x16b28f=_0x9fc09b[_0xe362('0x31')];var _0x1df510=_0xfb459b?0x0:_0x488d16[_0xe362('0x2e')];var _0x4749c0=_0xfb459b?_0x9fc09b[_0xe362('0x31')]:_0x488d16[_0xe362('0x2e')]+_0x488d16[_0xe362('0x30')];var _0x150d5e;if(_0x4749c0>=_0x16b28f){_0x4749c0=_0x16b28f;_0x150d5e=0xc8;}else{_0x150d5e=0xce;}_0x32e01b[_0xe362('0x2b')](_0x150d5e);return _0x32e01b[_0xe362('0x32')](_0xe362('0x33'),_0x1df510+'-'+_0x4749c0+'/'+_0x16b28f)['json'](_0x9fc09b);}return null;};}function patchUpdates(_0x7945b4){return function(_0x10857e){try{jsonpatch[_0xe362('0x34')](_0x10857e,_0x7945b4,!![]);}catch(_0xad5c65){return BPromise[_0xe362('0x35')](_0xad5c65);}return _0x10857e[_0xe362('0x36')]();};}function saveUpdates(_0x81e2fd,_0x143624){return function(_0x3b19c4){if(_0x3b19c4){return _0x3b19c4[_0xe362('0x37')](_0x81e2fd)[_0xe362('0x38')](function(_0x79a8ae){return _0x79a8ae;});}return null;};}function removeEntity(_0x155b32,_0x23aacb){return function(_0x3beb45){if(_0x3beb45){return _0x3beb45['destroy']()[_0xe362('0x38')](function(){var _0x3baead=_0x3beb45[_0xe362('0x39')]({'plain':!![]});var _0xadf2cb=_0xe362('0x3a');return db['UserProfileResource'][_0xe362('0x3b')]({'where':{'type':_0xadf2cb,'resourceId':_0x3baead['id']}})[_0xe362('0x38')](function(){return _0x3beb45;});})['then'](function(){_0x155b32[_0xe362('0x2b')](0xcc)[_0xe362('0x2c')]();});}};}function handleEntityNotFound(_0x4a7f50,_0x1ce5ed){return function(_0x99a69a){if(!_0x99a69a){_0x4a7f50[_0xe362('0x2a')](0x194);}return _0x99a69a;};}function handleError(_0x4f6d18,_0x3f14a9){_0x3f14a9=_0x3f14a9||0x1f4;return function(_0x1e4582){logger[_0xe362('0x26')](_0x1e4582[_0xe362('0x3c')]);if(_0x1e4582[_0xe362('0x3d')]){delete _0x1e4582[_0xe362('0x3d')];}_0x4f6d18[_0xe362('0x2b')](_0x3f14a9)[_0xe362('0x3e')](_0x1e4582);};}exports['index']=function(_0x58760d,_0x2418d1){var _0x49cd91={'include':[{'model':db['Pause'],'as':_0xe362('0x3f')}]},_0x5f2174={},_0x20c6aa={'count':0x0,'rows':[]};var _0x2f2f27=_[_0xe362('0x40')](db['FaxAccount'][_0xe362('0x41')],function(_0x138f87){return{'name':_0x138f87['fieldName'],'type':_0x138f87['type'][_0xe362('0x42')]};});_0x5f2174[_0xe362('0x43')]=_[_0xe362('0x40')](_0x2f2f27,_0xe362('0x3d'));_0x5f2174[_0xe362('0x44')]=_['keys'](_0x58760d[_0xe362('0x44')]);_0x5f2174[_0xe362('0x45')]=_[_0xe362('0x46')](_0x5f2174[_0xe362('0x43')],_0x5f2174[_0xe362('0x44')]);_0x49cd91[_0xe362('0x47')]=_[_0xe362('0x46')](_0x5f2174[_0xe362('0x43')],qs[_0xe362('0x48')](_0x58760d['query'][_0xe362('0x48')]));_0x49cd91['attributes']=_0x49cd91[_0xe362('0x47')][_0xe362('0x49')]?_0x49cd91[_0xe362('0x47')]:_0x5f2174[_0xe362('0x43')];if(!_0x58760d[_0xe362('0x44')][_0xe362('0x4a')]('nolimit')){_0x49cd91[_0xe362('0x30')]=qs['limit'](_0x58760d[_0xe362('0x44')][_0xe362('0x30')]);_0x49cd91[_0xe362('0x2e')]=qs['offset'](_0x58760d[_0xe362('0x44')][_0xe362('0x2e')]);}_0x49cd91[_0xe362('0x4b')]=qs[_0xe362('0x4c')](_0x58760d[_0xe362('0x44')][_0xe362('0x4c')]);_0x49cd91[_0xe362('0x4d')]=qs[_0xe362('0x45')](_[_0xe362('0x4e')](_0x58760d[_0xe362('0x44')],_0x5f2174['filters']),_0x2f2f27);if(_0x58760d[_0xe362('0x44')][_0xe362('0x4f')]){_0x49cd91[_0xe362('0x4d')]=_['merge'](_0x49cd91['where'],{'$or':_[_0xe362('0x40')](_0x2f2f27,function(_0x8ce585){if(_0x8ce585['type']!==_0xe362('0x50')){var _0x19f8fb={};_0x19f8fb[_0x8ce585['name']]={'$like':'%'+_0x58760d[_0xe362('0x44')][_0xe362('0x4f')]+'%'};return _0x19f8fb;}})});}_0x49cd91=_[_0xe362('0x51')]({},_0x49cd91,_0x58760d[_0xe362('0x52')]);var _0x58dc82={'where':_0x49cd91[_0xe362('0x4d')]};return db['FaxAccount'][_0xe362('0x31')](_0x58dc82)[_0xe362('0x38')](function(_0xa6ac88){_0x20c6aa['count']=_0xa6ac88;if(_0x58760d['query'][_0xe362('0x53')]){_0x49cd91[_0xe362('0x54')]=[{'all':!![]}];}return db[_0xe362('0x55')][_0xe362('0x56')](_0x49cd91);})[_0xe362('0x38')](function(_0x13ce01){_0x20c6aa[_0xe362('0x57')]=_0x13ce01;return _0x20c6aa;})['then'](respondWithFilteredResult(_0x2418d1,_0x49cd91))[_0xe362('0x58')](handleError(_0x2418d1,null));};exports[_0xe362('0x59')]=function(_0x5ec715,_0x31af4d){var _0x3ba9c8={'raw':![],'where':{'id':_0x5ec715[_0xe362('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xec1cfe={};_0xec1cfe[_0xe362('0x43')]=_[_0xe362('0x5b')](db[_0xe362('0x55')][_0xe362('0x41')]);_0xec1cfe[_0xe362('0x44')]=_[_0xe362('0x5b')](_0x5ec715['query']);_0xec1cfe[_0xe362('0x45')]=_[_0xe362('0x46')](_0xec1cfe[_0xe362('0x43')],_0xec1cfe[_0xe362('0x44')]);_0x3ba9c8['attributes']=_[_0xe362('0x46')](_0xec1cfe[_0xe362('0x43')],qs[_0xe362('0x48')](_0x5ec715[_0xe362('0x44')]['fields']));_0x3ba9c8[_0xe362('0x47')]=_0x3ba9c8[_0xe362('0x47')]['length']?_0x3ba9c8[_0xe362('0x47')]:_0xec1cfe[_0xe362('0x43')];if(_0x5ec715[_0xe362('0x44')][_0xe362('0x53')]){_0x3ba9c8[_0xe362('0x54')]=[{'all':!![]}];}_0x3ba9c8=_['merge']({},_0x3ba9c8,_0x5ec715[_0xe362('0x52')]);return db[_0xe362('0x55')]['find'](_0x3ba9c8)[_0xe362('0x38')](handleEntityNotFound(_0x31af4d,null))['then'](respondWithResult(_0x31af4d,null))['catch'](handleError(_0x31af4d,null));};exports['create']=function(_0x391c94,_0x539f3f){return db[_0xe362('0x55')][_0xe362('0x5c')](_0x391c94[_0xe362('0x5d')],{})[_0xe362('0x38')](function(_0x30f41f){var _0x4b5d86=_0x391c94[_0xe362('0x5e')][_0xe362('0x39')]({'plain':!![]});if(!_0x4b5d86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b5d86['role']==='user'){var _0x5d9ad5=_0x30f41f['get']({'plain':!![]});var _0xd183ec='FaxAccounts';return db['UserProfileSection'][_0xe362('0x5f')]({'where':{'name':_0xd183ec,'userProfileId':_0x4b5d86[_0xe362('0x60')]},'raw':!![]})[_0xe362('0x38')](function(_0x31abbd){if(_0x31abbd&&_0x31abbd[_0xe362('0x61')]===0x0){return db['UserProfileResource'][_0xe362('0x5c')]({'name':_0x5d9ad5[_0xe362('0x3d')],'resourceId':_0x5d9ad5['id'],'type':_0x31abbd[_0xe362('0x3d')],'sectionId':_0x31abbd['id']},{})[_0xe362('0x38')](function(){return _0x30f41f;});}else{return _0x30f41f;}})[_0xe362('0x58')](function(_0x1768ce){logger[_0xe362('0x26')](_0xe362('0x62'),_0x1768ce);throw _0x1768ce;});}return _0x30f41f;})['then'](respondWithResult(_0x539f3f,0xc9))[_0xe362('0x58')](handleError(_0x539f3f,null));};exports[_0xe362('0x37')]=function(_0x396fa9,_0x4d2d6b){if(_0x396fa9[_0xe362('0x5d')]['id']){delete _0x396fa9[_0xe362('0x5d')]['id'];}return db['FaxAccount'][_0xe362('0x5f')]({'where':{'id':_0x396fa9[_0xe362('0x5a')]['id']},'include':[{'model':db[_0xe362('0x63')],'as':_0xe362('0x3f')}]})[_0xe362('0x38')](handleEntityNotFound(_0x4d2d6b,null))[_0xe362('0x38')](saveUpdates(_0x396fa9[_0xe362('0x5d')],null))['then'](respondWithResult(_0x4d2d6b,null))[_0xe362('0x58')](handleError(_0x4d2d6b,null));};exports['destroy']=function(_0x24e4c5,_0x1a6f47){return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x24e4c5['params']['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x1a6f47,null))[_0xe362('0x38')](removeEntity(_0x1a6f47,null))[_0xe362('0x58')](handleError(_0x1a6f47,null));};exports['describe']=function(_0x2227bb,_0x291d1b){return db['FaxAccount'][_0xe362('0x64')]()[_0xe362('0x38')](respondWithResult(_0x291d1b,null))['catch'](handleError(_0x291d1b,null));};exports[_0xe362('0x65')]=function(_0x320556,_0x194ce1,_0x16b7d2){if(_0x320556[_0xe362('0x5d')]['id']){delete _0x320556[_0xe362('0x5d')]['id'];}return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x320556[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x194ce1,null))[_0xe362('0x38')](function(_0x377a52){if(_0x377a52){_0x320556['body']['FaxAccountId']=_0x377a52['id'];return db['Disposition']['create'](_0x320556[_0xe362('0x5d')]);}})[_0xe362('0x38')](respondWithResult(_0x194ce1,null))[_0xe362('0x58')](handleError(_0x194ce1,null));};exports[_0xe362('0x66')]=function(_0x57f000,_0x4fcab7,_0x206dc9){var _0x56073d={'raw':![],'where':{}};var _0x1ec9fe={};var _0x270bea={'count':0x0,'rows':[]};return db[_0xe362('0x55')][_0xe362('0x67')]({'where':{'id':_0x57f000['params']['id']}})['then'](handleEntityNotFound(_0x4fcab7,null))[_0xe362('0x38')](function(_0x493e6e){if(_0x493e6e){_0x1ec9fe[_0xe362('0x43')]=_['keys'](db[_0xe362('0x68')][_0xe362('0x41')]);_0x1ec9fe[_0xe362('0x44')]=_[_0xe362('0x5b')](_0x57f000[_0xe362('0x44')]);_0x1ec9fe['filters']=_[_0xe362('0x46')](_0x1ec9fe[_0xe362('0x43')],_0x1ec9fe[_0xe362('0x44')]);_0x56073d[_0xe362('0x47')]=_[_0xe362('0x46')](_0x1ec9fe['model'],qs[_0xe362('0x48')](_0x57f000[_0xe362('0x44')]['fields']));_0x56073d['attributes']=_0x56073d[_0xe362('0x47')]['length']?_0x56073d[_0xe362('0x47')]:_0x1ec9fe[_0xe362('0x43')];if(!_0x57f000[_0xe362('0x44')]['hasOwnProperty'](_0xe362('0x69'))){_0x56073d[_0xe362('0x30')]=qs[_0xe362('0x30')](_0x57f000[_0xe362('0x44')][_0xe362('0x30')]);_0x56073d[_0xe362('0x2e')]=qs[_0xe362('0x2e')](_0x57f000[_0xe362('0x44')][_0xe362('0x2e')]);}_0x56073d[_0xe362('0x4b')]=qs[_0xe362('0x4c')](_0x57f000[_0xe362('0x44')][_0xe362('0x4c')]);_0x56073d[_0xe362('0x4d')]=qs[_0xe362('0x45')](_[_0xe362('0x4e')](_0x57f000[_0xe362('0x44')],_0x1ec9fe[_0xe362('0x45')]));_0x56073d[_0xe362('0x4d')]['FaxAccountId']=_0x493e6e['id'];if(_0x57f000[_0xe362('0x44')][_0xe362('0x4f')]){_0x56073d[_0xe362('0x4d')]=_['merge'](_0x56073d['where'],{'$or':_[_0xe362('0x40')](_0x56073d['attributes'],function(_0x3d320d){var _0x2429ea={};_0x2429ea[_0x3d320d]={'$like':'%'+_0x57f000[_0xe362('0x44')][_0xe362('0x4f')]+'%'};return _0x2429ea;})});}_0x56073d=_[_0xe362('0x51')]({},_0x56073d,_0x57f000[_0xe362('0x52')]);return db[_0xe362('0x68')][_0xe362('0x31')]({'where':_0x56073d[_0xe362('0x4d')]})['then'](function(_0x539ac5){_0x270bea['count']=_0x539ac5;if(_0x57f000[_0xe362('0x44')][_0xe362('0x53')]){_0x56073d[_0xe362('0x54')]=[{'all':!![]}];}return db[_0xe362('0x68')][_0xe362('0x56')](_0x56073d);})['then'](function(_0x149666){_0x270bea[_0xe362('0x57')]=_0x149666;return _0x270bea;});}})[_0xe362('0x38')](respondWithFilteredResult(_0x4fcab7,_0x56073d))[_0xe362('0x58')](handleError(_0x4fcab7,null));};exports[_0xe362('0x6a')]=function(_0x1bf07b,_0x2b7d60,_0x1d2146){return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x1bf07b[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x2b7d60,null))['then'](function(_0x2e29de){if(_0x2e29de){return _0x2e29de[_0xe362('0x6a')](_0x1bf07b['query'][_0xe362('0x6b')]);}})[_0xe362('0x38')](respondWithStatusCode(_0x2b7d60,null))[_0xe362('0x58')](handleError(_0x2b7d60,null));};exports[_0xe362('0x6c')]=function(_0x5ad4d5,_0x488be5,_0x3616b9){if(_0x5ad4d5[_0xe362('0x5d')]['id']){delete _0x5ad4d5[_0xe362('0x5d')]['id'];}return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x5ad4d5['params']['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x488be5,null))[_0xe362('0x38')](function(_0x443287){if(_0x443287){_0x5ad4d5[_0xe362('0x5d')][_0xe362('0x6d')]=_0x443287['id'];return db['CannedAnswer'][_0xe362('0x5c')](_0x5ad4d5[_0xe362('0x5d')]);}})['then'](respondWithResult(_0x488be5,null))[_0xe362('0x58')](handleError(_0x488be5,null));};exports['getAnswers']=function(_0xd5bd7e,_0x103f3d,_0x3f0545){var _0x5f3b9d={'raw':![],'where':{}};var _0x211728={};var _0x2ba6c6={'count':0x0,'rows':[]};return db[_0xe362('0x55')][_0xe362('0x67')]({'where':{'id':_0xd5bd7e['params']['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x103f3d,null))[_0xe362('0x38')](function(_0x165021){if(_0x165021){_0x211728[_0xe362('0x43')]=_[_0xe362('0x5b')](db[_0xe362('0x6e')][_0xe362('0x41')]);_0x211728[_0xe362('0x44')]=_[_0xe362('0x5b')](_0xd5bd7e[_0xe362('0x44')]);_0x211728[_0xe362('0x45')]=_[_0xe362('0x46')](_0x211728[_0xe362('0x43')],_0x211728[_0xe362('0x44')]);_0x5f3b9d['attributes']=_[_0xe362('0x46')](_0x211728[_0xe362('0x43')],qs[_0xe362('0x48')](_0xd5bd7e['query']['fields']));_0x5f3b9d['attributes']=_0x5f3b9d['attributes']['length']?_0x5f3b9d['attributes']:_0x211728[_0xe362('0x43')];if(!_0xd5bd7e['query'][_0xe362('0x4a')](_0xe362('0x69'))){_0x5f3b9d[_0xe362('0x30')]=qs[_0xe362('0x30')](_0xd5bd7e[_0xe362('0x44')][_0xe362('0x30')]);_0x5f3b9d[_0xe362('0x2e')]=qs['offset'](_0xd5bd7e[_0xe362('0x44')][_0xe362('0x2e')]);}_0x5f3b9d[_0xe362('0x4b')]=qs[_0xe362('0x4c')](_0xd5bd7e[_0xe362('0x44')][_0xe362('0x4c')]);_0x5f3b9d['where']=qs['filters'](_[_0xe362('0x4e')](_0xd5bd7e[_0xe362('0x44')],_0x211728[_0xe362('0x45')]));_0x5f3b9d[_0xe362('0x4d')][_0xe362('0x6d')]=_0x165021['id'];if(_0xd5bd7e[_0xe362('0x44')]['filter']){_0x5f3b9d['where']=_[_0xe362('0x51')](_0x5f3b9d['where'],{'$or':_[_0xe362('0x40')](_0x5f3b9d[_0xe362('0x47')],function(_0x1e5a4f){var _0x505836={};_0x505836[_0x1e5a4f]={'$like':'%'+_0xd5bd7e[_0xe362('0x44')]['filter']+'%'};return _0x505836;})});}_0x5f3b9d=_['merge']({},_0x5f3b9d,_0xd5bd7e[_0xe362('0x52')]);return db[_0xe362('0x6e')][_0xe362('0x31')]({'where':_0x5f3b9d[_0xe362('0x4d')]})[_0xe362('0x38')](function(_0x341616){_0x2ba6c6[_0xe362('0x31')]=_0x341616;if(_0xd5bd7e['query'][_0xe362('0x53')]){_0x5f3b9d[_0xe362('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe362('0x56')](_0x5f3b9d);})['then'](function(_0x1f73a6){_0x2ba6c6[_0xe362('0x57')]=_0x1f73a6;return _0x2ba6c6;});}})['then'](respondWithFilteredResult(_0x103f3d,_0x5f3b9d))[_0xe362('0x58')](handleError(_0x103f3d,null));};exports[_0xe362('0x6f')]=function(_0x489ed7,_0x355dd9,_0x1dcd6e){return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x489ed7[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x355dd9,null))[_0xe362('0x38')](function(_0x4a7654){if(_0x4a7654){return _0x4a7654[_0xe362('0x6f')](_0x489ed7[_0xe362('0x44')][_0xe362('0x6b')]);}})[_0xe362('0x38')](respondWithStatusCode(_0x355dd9,null))[_0xe362('0x58')](handleError(_0x355dd9,null));};exports[_0xe362('0x70')]=function(_0x4706a4,_0x284267,_0x2a224d){return db[_0xe362('0x71')]['find']({'where':{'id':_0x4706a4[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x284267,null))[_0xe362('0x38')](function(_0x47da00){if(_0x47da00){return _0x47da00['addInteraction'](_0x4706a4[_0xe362('0x5d')][_0xe362('0x6b')],_[_0xe362('0x72')](_0x4706a4[_0xe362('0x5d')],['ids','id'])||{});}})[_0xe362('0x38')](respondWithResult(_0x284267,null))['catch'](handleError(_0x284267,null));};exports[_0xe362('0x73')]=function(_0x5368a3,_0x5b5cee,_0x596393){var _0x1a6d98={'raw':![],'where':{}};var _0x1e57e8={};var _0x15e53e={'count':0x0,'rows':[]};return db[_0xe362('0x55')]['findOne']({'where':{'id':_0x5368a3[_0xe362('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5b5cee,null))[_0xe362('0x38')](function(_0x4e9506){if(_0x4e9506){_0x1e57e8[_0xe362('0x43')]=_[_0xe362('0x5b')](db['FaxInteraction'][_0xe362('0x41')]);_0x1e57e8[_0xe362('0x44')]=_['keys'](_0x5368a3['query']);_0x1e57e8[_0xe362('0x45')]=_[_0xe362('0x46')](_0x1e57e8['model'],_0x1e57e8[_0xe362('0x44')]);_0x1a6d98[_0xe362('0x47')]=_['intersection'](_0x1e57e8[_0xe362('0x43')],qs[_0xe362('0x48')](_0x5368a3[_0xe362('0x44')]['fields']));_0x1a6d98[_0xe362('0x47')]=_0x1a6d98[_0xe362('0x47')][_0xe362('0x49')]?_0x1a6d98[_0xe362('0x47')]:_0x1e57e8[_0xe362('0x43')];if(!_0x5368a3['query'][_0xe362('0x4a')]('nolimit')){_0x1a6d98[_0xe362('0x30')]=qs[_0xe362('0x30')](_0x5368a3[_0xe362('0x44')]['limit']);_0x1a6d98[_0xe362('0x2e')]=qs[_0xe362('0x2e')](_0x5368a3[_0xe362('0x44')]['offset']);}_0x1a6d98[_0xe362('0x4b')]=qs[_0xe362('0x4c')](_0x5368a3[_0xe362('0x44')]['sort']);_0x1a6d98['where']=qs[_0xe362('0x45')](_[_0xe362('0x4e')](_0x5368a3[_0xe362('0x44')],_0x1e57e8['filters']));_0x1a6d98[_0xe362('0x4d')]['FaxAccountId']=_0x4e9506['id'];if(_0x5368a3[_0xe362('0x44')][_0xe362('0x4f')]){_0x1a6d98['where']=_[_0xe362('0x51')](_0x1a6d98[_0xe362('0x4d')],{'$or':_[_0xe362('0x40')](_0x1a6d98[_0xe362('0x47')],function(_0x2de1eb){var _0x5e416d={};_0x5e416d[_0x2de1eb]={'$like':'%'+_0x5368a3[_0xe362('0x44')][_0xe362('0x4f')]+'%'};return _0x5e416d;})});}_0x1a6d98=_['merge']({},_0x1a6d98,_0x5368a3[_0xe362('0x52')]);return db[_0xe362('0x71')][_0xe362('0x31')]({'where':_0x1a6d98['where']})[_0xe362('0x38')](function(_0x4f4cd6){_0x15e53e[_0xe362('0x31')]=_0x4f4cd6;if(_0x5368a3[_0xe362('0x44')]['includeAll']){_0x1a6d98[_0xe362('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe362('0x74')],'as':_0xe362('0x75'),'attributes':[_0xe362('0x3d'),_0xe362('0x76'),_0xe362('0x77')],'required':![]},{'model':db['Tag'],'as':_0xe362('0x78'),'attributes':['id',_0xe362('0x3d'),'color'],'where':_0x5368a3['query']['tag']?{'id':_0x5368a3['query'][_0xe362('0x79')]}:undefined,'required':_0x5368a3['query'][_0xe362('0x79')]?!![]:![]}];}return db[_0xe362('0x71')][_0xe362('0x56')](_0x1a6d98);})[_0xe362('0x38')](function(_0x26fad5){_0x15e53e[_0xe362('0x57')]=_0x26fad5;return _0x15e53e;});}})['then'](respondWithFilteredResult(_0x5b5cee,_0x1a6d98))['catch'](handleError(_0x5b5cee,null));};exports[_0xe362('0x7a')]=function(_0x2f3403,_0x378d2e,_0xa77081){return db[_0xe362('0x55')][_0xe362('0x67')]({'where':{'id':_0x2f3403[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x378d2e,null))[_0xe362('0x38')](function(_0x18ecb4){if(_0x18ecb4){return db[_0xe362('0x7b')]['transaction'](function(_0x21a5e0){return db[_0xe362('0x7c')][_0xe362('0x3b')]({'where':{'FaxAccountId':_0x2f3403[_0xe362('0x5a')]['id']},'transaction':_0x21a5e0})[_0xe362('0x38')](function(_0x4b64e0){var _0x3bfcaa=_[_0xe362('0x40')](_0x2f3403['body'],function(_0x1bc482){_0x1bc482[_0xe362('0x6d')]=_0x2f3403[_0xe362('0x5a')]['id'];return _0x1bc482;});return db['FaxApplication'][_0xe362('0x7d')](_0x3bfcaa,{'transaction':_0x21a5e0});});})[_0xe362('0x38')](function(){return db['FaxApplication'][_0xe362('0x7e')]({'where':{'FaxAccountId':_0x2f3403['params']['id']},'order':_0xe362('0x7f')});});}})[_0xe362('0x38')](respondWithResult(_0x378d2e,null))[_0xe362('0x58')](handleError(_0x378d2e,null));};exports[_0xe362('0x80')]=function(_0x2a6e6d,_0x3620b8,_0x46dce2){var _0x1e00ac={};var _0x298513={};var _0x5f3228;var _0x2bdd57;return db[_0xe362('0x55')][_0xe362('0x67')]({'where':{'id':_0x2a6e6d['params']['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x3620b8,null))[_0xe362('0x38')](function(_0x1318e1){if(_0x1318e1){_0x5f3228=_0x1318e1;_0x298513[_0xe362('0x43')]=_[_0xe362('0x5b')](db[_0xe362('0x7c')][_0xe362('0x41')]);_0x298513['query']=_['keys'](_0x2a6e6d['query']);_0x298513['filters']=_['intersection'](_0x298513[_0xe362('0x43')],_0x298513[_0xe362('0x44')]);_0x1e00ac[_0xe362('0x47')]=_[_0xe362('0x46')](_0x298513['model'],qs[_0xe362('0x48')](_0x2a6e6d['query']['fields']));_0x1e00ac[_0xe362('0x47')]=_0x1e00ac[_0xe362('0x47')]['length']?_0x1e00ac[_0xe362('0x47')]:_0x298513[_0xe362('0x43')];_0x1e00ac[_0xe362('0x4b')]=qs[_0xe362('0x4c')](_0x2a6e6d[_0xe362('0x44')][_0xe362('0x4c')]);_0x1e00ac[_0xe362('0x4d')]=qs[_0xe362('0x45')](_['pick'](_0x2a6e6d[_0xe362('0x44')],_0x298513[_0xe362('0x45')]));if(_0x2a6e6d['query'][_0xe362('0x4f')]){_0x1e00ac[_0xe362('0x4d')]=_[_0xe362('0x51')](_0x1e00ac[_0xe362('0x4d')],{'$or':_[_0xe362('0x40')](_0x1e00ac[_0xe362('0x47')],function(_0x24b5ed){var _0x11c6f3={};_0x11c6f3[_0x24b5ed]={'$like':'%'+_0x2a6e6d[_0xe362('0x44')][_0xe362('0x4f')]+'%'};return _0x11c6f3;})});}_0x1e00ac=_[_0xe362('0x51')]({},_0x1e00ac,_0x2a6e6d['options']);return _0x5f3228[_0xe362('0x80')](_0x1e00ac);}})['then'](function(_0x5dde23){if(_0x5dde23){_0x2bdd57=_0x5dde23[_0xe362('0x49')];if(!_0x2a6e6d['query'][_0xe362('0x4a')](_0xe362('0x69'))){_0x1e00ac[_0xe362('0x30')]=qs['limit'](_0x2a6e6d['query'][_0xe362('0x30')]);_0x1e00ac['offset']=qs[_0xe362('0x2e')](_0x2a6e6d[_0xe362('0x44')][_0xe362('0x2e')]);}return _0x5f3228[_0xe362('0x80')](_0x1e00ac);}})['then'](function(_0x2ce34){if(_0x2ce34){return _0x2ce34?{'count':_0x2bdd57,'rows':_0x2ce34}:null;}})[_0xe362('0x38')](respondWithResult(_0x3620b8,null))[_0xe362('0x58')](handleError(_0x3620b8,null));};function Extension(_0xf2cab,_0x53da9a,_0x3f5cad,_0x51a932){this[_0xe362('0x81')]=_0xe362('0x82');this['exten']=_0xf2cab[_0xe362('0x83')];this['app']=_0x51a932;this['type']=_0xe362('0x84');this['description']=_0xe362('0x85');this['FaxAccountId']=_0xf2cab['id'];this[_0xe362('0x7f')]=_0x53da9a;this[_0xe362('0x86')]=_0x3f5cad;}function createExtensionsReciveFax(_0x5763b1){var _0x34b60d=0x1;var _0x1e09c8=[];_0x1e09c8[_0xe362('0x87')](new Extension(_0x5763b1,_0x34b60d,'','Answer'));_0x34b60d+=0x1;_0x1e09c8[_0xe362('0x87')](new Extension(_0x5763b1,_0x34b60d,'CDR(type)=inbound-fax',_0xe362('0x88')));_0x34b60d+=0x1;for(var _0x57bb65 in _0x5763b1){if(_0x5763b1[_0xe362('0x4a')](_0x57bb65)&&(_0x57bb65===_0xe362('0x89')||_0x57bb65===_0xe362('0x83')||_0x57bb65===_0xe362('0x8a')||_0x57bb65===_0xe362('0x8b')||_0x57bb65==='headerinfo'||_0x57bb65===_0xe362('0x8c')||_0x57bb65===_0xe362('0x8d')||_0x57bb65===_0xe362('0x8e')||_0x57bb65===_0xe362('0x8f'))){_0x1e09c8[_0xe362('0x87')](new Extension(_0x5763b1,_0x34b60d,_0xe362('0x90')+_0x57bb65+')='+_0x5763b1[_0x57bb65],_0xe362('0x88')));_0x34b60d+=0x1;}}_0x1e09c8[_0xe362('0x87')](new Extension(_0x5763b1,_0x34b60d,'6',_0xe362('0x91')));_0x34b60d+=0x1;_0x1e09c8[_0xe362('0x87')](new Extension(_0x5763b1,_0x34b60d,_0xe362('0x92'),'ReceiveFax'));_0x34b60d=0x0;return _0x1e09c8;}exports[_0xe362('0x93')]=function(_0x3d0ff0,_0x5944b0,_0x3ca35d){var _0x1c150e;return db['sequelize'][_0xe362('0x94')](function(_0x10f642){return db[_0xe362('0x55')][_0xe362('0x5c')](_0x3d0ff0[_0xe362('0x5d')],{'transaction':_0x10f642})['then'](function(_0x15a0c0){_0x1c150e=_0x15a0c0[_0xe362('0x39')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x1c150e),{'transaction':_0x10f642});});})[_0xe362('0x38')](function(){return _0x1c150e;})['then'](respondWithResult(_0x5944b0,null))['catch'](handleError(_0x5944b0,null));};exports[_0xe362('0x95')]=function(_0x49b598,_0x3484cd,_0x591232){var _0x22414e;return db[_0xe362('0x7b')][_0xe362('0x94')](function(_0x4da6fd){return db['FaxAccount'][_0xe362('0x37')](_0x49b598['body'],{'where':{'id':_0x49b598[_0xe362('0x5d')]['id']},'transaction':_0x4da6fd})[_0xe362('0x38')](function(_0x2a4eea){return db[_0xe362('0x96')][_0xe362('0x3b')]({'where':{'FaxAccountId':_0x49b598['body']['id']},'transaction':_0x4da6fd})['then'](function(_0x148c6d){return db[_0xe362('0x96')][_0xe362('0x7d')](createExtensionsReciveFax(_[_0xe362('0x72')](_0x49b598[_0xe362('0x5d')],['tech','key',_0xe362('0x97'),'updatedAt',_0xe362('0x98'),_0xe362('0x99')])),{'transaction':_0x4da6fd});});});})[_0xe362('0x38')](function(){return db['FaxAccount'][_0xe362('0x9a')](_0x49b598[_0xe362('0x5d')]['id']);})['then'](respondWithResult(_0x3484cd,null))[_0xe362('0x58')](handleError(_0x3484cd,null));};exports[_0xe362('0x9b')]=function(_0x2893a4,_0x5a4f1c,_0x5a0208){var _0x4067e5={'raw':!![],'where':{}};var _0x7472e2={};var _0x2f205a={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe362('0x67')]({'where':{'id':_0x2893a4[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x5a4f1c,null))['then'](function(_0x27b121){if(_0x27b121){_0x7472e2[_0xe362('0x43')]=_[_0xe362('0x5b')](db[_0xe362('0x9c')][_0xe362('0x41')]);_0x7472e2[_0xe362('0x44')]=_['keys'](_0x2893a4[_0xe362('0x44')]);_0x7472e2[_0xe362('0x45')]=_['intersection'](_0x7472e2[_0xe362('0x43')],_0x7472e2['query']);_0x4067e5['attributes']=_[_0xe362('0x46')](_0x7472e2['model'],qs[_0xe362('0x48')](_0x2893a4[_0xe362('0x44')][_0xe362('0x48')]));_0x4067e5[_0xe362('0x47')]=_0x4067e5[_0xe362('0x47')][_0xe362('0x49')]?_0x4067e5[_0xe362('0x47')]:_0x7472e2['model'];if(!_0x2893a4[_0xe362('0x44')]['hasOwnProperty'](_0xe362('0x69'))){_0x4067e5[_0xe362('0x30')]=qs[_0xe362('0x30')](_0x2893a4[_0xe362('0x44')][_0xe362('0x30')]);_0x4067e5[_0xe362('0x2e')]=qs['offset'](_0x2893a4[_0xe362('0x44')][_0xe362('0x2e')]);}_0x4067e5['order']=qs[_0xe362('0x4c')](_0x2893a4[_0xe362('0x44')][_0xe362('0x4c')]);_0x4067e5['where']=qs[_0xe362('0x45')](_[_0xe362('0x4e')](_0x2893a4[_0xe362('0x44')],_0x7472e2['filters']));_0x4067e5[_0xe362('0x4d')][_0xe362('0x6d')]=_0x27b121['id'];if(_0x2893a4[_0xe362('0x44')][_0xe362('0x4f')]){_0x4067e5[_0xe362('0x4d')]=_['merge'](_0x4067e5['where'],{'$or':_[_0xe362('0x40')](_0x4067e5[_0xe362('0x47')],function(_0xe951a2){var _0x585a18={};_0x585a18[_0xe951a2]={'$like':'%'+_0x2893a4['query'][_0xe362('0x4f')]+'%'};return _0x585a18;})});}if(_0x2893a4[_0xe362('0x44')][_0xe362('0x9d')]){var _0x49c0ce=_0x2893a4['query'][_0xe362('0x9d')]['split'](',');var _0x3be8a3={};_0x3be8a3[_0x49c0ce[0x0]]={'$gte':moment(_0x49c0ce[0x1])['format'](_0xe362('0x9e'))};_0x4067e5['where']=_[_0xe362('0x51')](_0x4067e5[_0xe362('0x4d')],_0x3be8a3);}_0x4067e5=_[_0xe362('0x51')]({},_0x4067e5,_0x2893a4[_0xe362('0x52')]);return db[_0xe362('0x9c')][_0xe362('0x31')]({'where':_0x4067e5['where']})[_0xe362('0x38')](function(_0x5817b0){_0x2f205a[_0xe362('0x31')]=_0x5817b0;if(_0x2893a4['query'][_0xe362('0x53')]){_0x4067e5[_0xe362('0x54')]=[{'all':!![]}];}return db[_0xe362('0x9c')][_0xe362('0x56')](_0x4067e5);})[_0xe362('0x38')](function(_0x2f9578){_0x2f205a[_0xe362('0x57')]=_0x2f9578;return _0x2f205a;});}})[_0xe362('0x38')](respondWithFilteredResult(_0x5a4f1c,_0x4067e5))[_0xe362('0x58')](handleError(_0x5a4f1c,null));};exports['send']=function(_0x524f17,_0x2d009e,_0x134cd5){var _0x283c26,_0x55d227={},_0x5e23f2;if(_0x524f17[_0xe362('0x5d')]['to']){_0x5e23f2=_0x524f17[_0xe362('0x5d')]['to'][0x0];}return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x524f17[_0xe362('0x5a')]['id']},'include':[{'model':db[_0xe362('0x9f')],'as':_0xe362('0xa0'),'include':[{'model':db[_0xe362('0xa1')],'as':'Contacts','where':{'fax':_0x5e23f2},'limit':0x1,'order':[[_0xe362('0xa2'),_0xe362('0xa3')]]}]}]})[_0xe362('0x38')](handleEntityNotFound(_0x2d009e,null))[_0xe362('0x38')](function(_0x43967c){_0x283c26=_0x43967c;if(_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')]&&_0x524f17['body'][_0xe362('0xa4')][_0xe362('0x49')]){for(var _0x363d5f=0x0;_0x363d5f<_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')]['length'];_0x363d5f+=0x1){_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][_0x363d5f]={'filename':_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][_0x363d5f][_0xe362('0x3d')],'id':_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][_0x363d5f]['id'],'path':path[_0xe362('0xa5')](config[_0xe362('0xa6')],'server/files/attachments',_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][_0x363d5f][_0xe362('0xa7')])};}}return respondWithRpcPromise(_0xe362('0xa8'),_0xe362('0xa8'),{'FaxAccountId':_[_0xe362('0xa9')](_0x524f17[_0xe362('0x5a')]['id'])?undefined:_0x524f17['params']['id'],'path':_[_0xe362('0xa9')](_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][0x0][_0xe362('0xaa')])?undefined:_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][0x0][_0xe362('0xaa')],'fax':_['isNil'](_0x524f17['body']['to'][0x0])?undefined:_0x524f17[_0xe362('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x283c26){if(_[_0xe362('0xa9')](_0x524f17['body']['from'])){_0x524f17[_0xe362('0x5d')]['from']=util[_0xe362('0xab')](_0xe362('0xac'),_0x283c26[_0xe362('0x3d')],_0x283c26[_0xe362('0xad')]);}if(_0x283c26[_0xe362('0xa0')]){if(_0x283c26['List'][_0xe362('0xae')][_0xe362('0x49')]){return _0x283c26[_0xe362('0xa0')][_0xe362('0xae')][0x0];}else{return db['CmContact'][_0xe362('0x5c')](_['defaults'](_0x524f17[_0xe362('0x5d')],{'firstName':_0x524f17[_0xe362('0x5d')]['to'][0x0],'phone':_0x524f17[_0xe362('0x5d')]['to'][0x0],'fax':_0x524f17[_0xe362('0x5d')]['to'][0x0],'ListId':_0x283c26['ListId']}));}}else{throw new Error(_0xe362('0xaf'));}}else{throw new Error(_0xe362('0xb0'));}})[_0xe362('0x38')](function(_0x3ceaad){if(_0x3ceaad){return db['FaxInteraction']['find']({'where':{'ContactId':_0x3ceaad['id'],'closed':![],'FaxAccountId':_0x283c26['id']}})['then'](function(_0x3ced3d){if(_0x3ced3d){return[_0x3ced3d,![]];}return db[_0xe362('0x71')][_0xe362('0x5c')]({'UserId':_0x524f17[_0xe362('0x5e')]['id'],'ContactId':_0x3ceaad['id'],'FaxAccountId':_0x283c26['id'],'fax':_0x524f17[_0xe362('0x5d')]['to'][0x0],'firstMsgDirection':_0xe362('0xb1'),'Messages':[_[_0xe362('0x51')](_0x524f17[_0xe362('0x5d')],{'read':![],'body':_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][0x0]['filename'],'FaxAccountId':_0x283c26['id'],'UserId':_0x524f17[_0xe362('0x5e')]['id'],'ContactId':_0x3ceaad['id'],'AttachmentId':_0x524f17['body'][_0xe362('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xe362('0x9c')],'as':_0xe362('0xb2')}]})[_0xe362('0x38')](function(_0x42c015){return[_0x42c015,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe362('0xb3')](function(_0x513ac8,_0x5604e3){if(_0x5604e3){return _0x513ac8;}return db[_0xe362('0x9c')][_0xe362('0x5c')]({'direction':_0xe362('0xb1'),'read':![],'body':_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][0x0][_0xe362('0xb4')],'FaxAccountId':_0x283c26['id'],'FaxInteractionId':_0x513ac8['id'],'UserId':_0x524f17[_0xe362('0x5e')]['id'],'ContactId':_0x513ac8[_0xe362('0xb5')],'AttachmentId':_0x524f17[_0xe362('0x5d')]['attachments'][0x0]['id']})[_0xe362('0x38')](function(_0x5e4e6c){_0x513ac8['dataValues'][_0xe362('0xb2')]=[];_0x513ac8[_0xe362('0xb6')][_0xe362('0xb2')][_0xe362('0x87')](_0x5e4e6c[_0xe362('0xb6')]);return _0x513ac8;});})['then'](function(_0x9fbda6){respondWithRpcPromise(_0xe362('0xb7'),_0xe362('0xb7'),{'FaxAccountId':_['isNil'](_0x524f17[_0xe362('0x5a')]['id'])?undefined:_0x524f17['params']['id'],'path':_[_0xe362('0xa9')](_0x524f17[_0xe362('0x5d')][_0xe362('0xa4')][0x0][_0xe362('0xaa')])?undefined:_0x524f17[_0xe362('0x5d')]['attachments'][0x0]['path'],'fax':_[_0xe362('0xa9')](_0x524f17['body']['to'][0x0])?undefined:_0x524f17[_0xe362('0x5d')]['to'][0x0],'AttachmentId':_0x524f17[_0xe362('0x5d')]['attachments'][0x0]['id']},client9002)[_0xe362('0x38')](function(_0x4ff843){logger[_0xe362('0x21')]('SendFaxRpc,\x20%s',_0x4ff843);})[_0xe362('0x58')](function(_0xf0c3c6){logger['info']('SendFaxRpc,\x20%s',_0xf0c3c6);});return _0x9fbda6;})['then'](respondWithResult(_0x2d009e,null))[_0xe362('0x58')](handleError(_0x2d009e,null));};exports['addAgents']=function(_0x5392a1,_0x64056c,_0x3a8fc5){return db[_0xe362('0x55')][_0xe362('0x5f')]({'where':{'id':_0x5392a1['params']['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x64056c,null))[_0xe362('0x38')](function(_0x4e7de1){if(_0x4e7de1){return _0x4e7de1[_0xe362('0xb8')](_0x5392a1[_0xe362('0x5d')][_0xe362('0x6b')],_['omit'](_0x5392a1[_0xe362('0x5d')],[_0xe362('0x6b'),'id'])||{})['spread'](function(_0x2b0d08){for(var _0x3967af=0x0;_0x3967af<_0x5392a1[_0xe362('0x5d')][_0xe362('0x6b')][_0xe362('0x49')];_0x3967af+=0x1){socket[_0xe362('0xb9')](_0xe362('0xba'),{'UserId':Number(_0x5392a1[_0xe362('0x5d')][_0xe362('0x6b')][_0x3967af]),'FaxAccountId':Number(_0x5392a1[_0xe362('0x5a')]['id'])});}return _0x2b0d08;});}})[_0xe362('0x38')](respondWithResult(_0x64056c,null))[_0xe362('0x58')](handleError(_0x64056c,null));};exports[_0xe362('0xbb')]=function(_0x5d3921,_0x2dc5a9,_0x5a77b9){return db['FaxAccount'][_0xe362('0x5f')]({'where':{'id':_0x5d3921[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x2dc5a9,null))[_0xe362('0x38')](function(_0x397451){if(_0x397451){return _0x397451[_0xe362('0xbb')](_0x5d3921[_0xe362('0x44')][_0xe362('0x6b')])['then'](function(){if(_[_0xe362('0xbc')](_0x5d3921[_0xe362('0x44')][_0xe362('0x6b')])){for(var _0x1f7acd=0x0;_0x1f7acd<_0x5d3921[_0xe362('0x44')][_0xe362('0x6b')][_0xe362('0x49')];_0x1f7acd+=0x1){socket[_0xe362('0xb9')](_0xe362('0xbd'),{'UserId':Number(_0x5d3921[_0xe362('0x44')]['ids'][_0x1f7acd]),'FaxAccountId':Number(_0x5d3921[_0xe362('0x5a')]['id'])});}}else{socket[_0xe362('0xb9')](_0xe362('0xbd'),{'UserId':Number(_0x5d3921[_0xe362('0x44')][_0xe362('0x6b')]),'FaxAccountId':Number(_0x5d3921[_0xe362('0x5a')]['id'])});}});}})[_0xe362('0x38')](respondWithStatusCode(_0x2dc5a9,null))['catch'](handleError(_0x2dc5a9,null));};exports[_0xe362('0xbe')]=function(_0x4183d2,_0x16fb36,_0x16bdad){var _0xcd7b04={};var _0x1a0275={};var _0x32d559;var _0x28ac7c;return db[_0xe362('0x55')][_0xe362('0x67')]({'where':{'id':_0x4183d2[_0xe362('0x5a')]['id']}})[_0xe362('0x38')](handleEntityNotFound(_0x16fb36,null))[_0xe362('0x38')](function(_0x4997cb){if(_0x4997cb){_0x32d559=_0x4997cb;_0x1a0275['model']=_[_0xe362('0x5b')](db[_0xe362('0x74')][_0xe362('0x41')]);_0x1a0275[_0xe362('0x44')]=_[_0xe362('0x5b')](_0x4183d2[_0xe362('0x44')]);_0x1a0275[_0xe362('0x45')]=_[_0xe362('0x46')](_0x1a0275[_0xe362('0x43')],_0x1a0275[_0xe362('0x44')]);_0xcd7b04['attributes']=_[_0xe362('0x46')](_0x1a0275['model'],qs['fields'](_0x4183d2['query'][_0xe362('0x48')]));_0xcd7b04['attributes']=_0xcd7b04[_0xe362('0x47')][_0xe362('0x49')]?_0xcd7b04[_0xe362('0x47')]:_0x1a0275['model'];_0xcd7b04['order']=qs[_0xe362('0x4c')](_0x4183d2['query'][_0xe362('0x4c')]);_0xcd7b04[_0xe362('0x4d')]=qs[_0xe362('0x45')](_[_0xe362('0x4e')](_0x4183d2['query'],_0x1a0275['filters']));if(_0x4183d2[_0xe362('0x44')][_0xe362('0x4f')]){_0xcd7b04[_0xe362('0x4d')]=_[_0xe362('0x51')](_0xcd7b04[_0xe362('0x4d')],{'$or':_[_0xe362('0x40')](_0xcd7b04[_0xe362('0x47')],function(_0x43b450){var _0x95e055={};_0x95e055[_0x43b450]={'$like':'%'+_0x4183d2[_0xe362('0x44')]['filter']+'%'};return _0x95e055;})});}_0xcd7b04=_[_0xe362('0x51')]({},_0xcd7b04,_0x4183d2[_0xe362('0x52')]);return _0x32d559[_0xe362('0xbe')](_0xcd7b04);}})[_0xe362('0x38')](function(_0x25e3ec){if(_0x25e3ec){_0x28ac7c=_0x25e3ec[_0xe362('0x49')];if(!_0x4183d2[_0xe362('0x44')][_0xe362('0x4a')](_0xe362('0x69'))){_0xcd7b04[_0xe362('0x30')]=qs[_0xe362('0x30')](_0x4183d2[_0xe362('0x44')][_0xe362('0x30')]);_0xcd7b04[_0xe362('0x2e')]=qs[_0xe362('0x2e')](_0x4183d2[_0xe362('0x44')][_0xe362('0x2e')]);}return _0x32d559[_0xe362('0xbe')](_0xcd7b04);}})[_0xe362('0x38')](function(_0x2cbd84){if(_0x2cbd84){return _0x2cbd84?{'count':_0x28ac7c,'rows':_0x2cbd84}:null;}})['then'](respondWithResult(_0x16fb36,null))[_0xe362('0x58')](handleError(_0x16fb36,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index bed71a2..bad0a74 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 _0x02bb=['../../mysqldb','emit','hasOwnProperty','hook'];(function(_0x3e95e8,_0x551f99){var _0x2bf301=function(_0x3d0168){while(--_0x3d0168){_0x3e95e8['push'](_0x3e95e8['shift']());}};_0x2bf301(++_0x551f99);}(_0x02bb,0xec));var _0xb02b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x02bb[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xb02b('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29ed66){return function(_0x23813f,_0x18cb1b,_0x1cb3cd){FaxAccountEvents[_0xb02b('0x1')](_0x29ed66+':'+_0x23813f['id'],_0x23813f);FaxAccountEvents[_0xb02b('0x1')](_0x29ed66,_0x23813f);_0x1cb3cd(null);};}for(var e in events){if(events[_0xb02b('0x2')](e)){var event=events[e];FaxAccount[_0xb02b('0x3')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x8fda=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8fda,0xd6));var _0xa8fd=function(_0x136e2e,_0x2c0eba){_0x136e2e=_0x136e2e-0x0;var _0x5e7797=_0x8fda[_0x136e2e];return _0x5e7797;};'use strict';var EventEmitter=require(_0xa8fd('0x0'));var FaxAccount=require(_0xa8fd('0x1'))['db'][_0xa8fd('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa8fd('0x3')](0x0);var events={'afterCreate':_0xa8fd('0x4'),'afterUpdate':_0xa8fd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1819ad){return function(_0x5aa106,_0x3ad001,_0xa306dc){FaxAccountEvents[_0xa8fd('0x6')](_0x1819ad+':'+_0x5aa106['id'],_0x5aa106);FaxAccountEvents['emit'](_0x1819ad,_0x5aa106);_0xa306dc(null);};}for(var e in events){if(events[_0xa8fd('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xa8fd('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 54704eb..a23d83d 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 _0xea4c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x45fb40,_0x4ee5b6){var _0x10eae3=function(_0x2f60c8){while(--_0x2f60c8){_0x45fb40['push'](_0x45fb40['shift']());}};_0x10eae3(++_0x4ee5b6);}(_0xea4c,0x113));var _0xcea4=function(_0x1fdfa5,_0x4d1b12){_0x1fdfa5=_0x1fdfa5-0x0;var _0x421776=_0xea4c[_0x1fdfa5];return _0x421776;};'use strict';var _=require(_0xcea4('0x0'));var util=require(_0xcea4('0x1'));var logger=require(_0xcea4('0x2'))('api');var moment=require(_0xcea4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcea4('0x4'));var fs=require('fs');var path=require(_0xcea4('0x5'));var rimraf=require(_0xcea4('0x6'));var config=require(_0xcea4('0x7'));var attributes=require(_0xcea4('0x8'));module[_0xcea4('0x9')]=function(_0x40d9fe,_0x548e95){return _0x40d9fe['define'](_0xcea4('0xa'),attributes,{'tableName':_0xcea4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a34=['util','bluebird','request-promise','path','define','FaxAccount','fax_accounts','lodash'];(function(_0x392dc2,_0x47c3f3){var _0x14150f=function(_0x9f305a){while(--_0x9f305a){_0x392dc2['push'](_0x392dc2['shift']());}};_0x14150f(++_0x47c3f3);}(_0x8a34,0x11f));var _0x48a3=function(_0x22ea66,_0x30123a){_0x22ea66=_0x22ea66-0x0;var _0x529757=_0x8a34[_0x22ea66];return _0x529757;};'use strict';var _=require(_0x48a3('0x0'));var util=require(_0x48a3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x48a3('0x2'));var rp=require(_0x48a3('0x3'));var fs=require('fs');var path=require(_0x48a3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x345fe5,_0x1f1fc5){return _0x345fe5[_0x48a3('0x5')](_0x48a3('0x6'),attributes,{'tableName':_0x48a3('0x7'),'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 a711b2f..7f6aaa8 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 _0x9b55=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','defaults','redis','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','body','fax','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','list','applications','orderBy','priority','create','find','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird'];(function(_0x109d2c,_0xc45b1d){var _0x1a3809=function(_0x4b1cee){while(--_0x4b1cee){_0x109d2c['push'](_0x109d2c['shift']());}};_0x1a3809(++_0xc45b1d);}(_0x9b55,0x158));var _0x59b5=function(_0x468f74,_0x10e053){_0x468f74=_0x468f74-0x0;var _0x49e865=_0x9b55[_0x468f74];return _0x49e865;};'use strict';var _=require(_0x59b5('0x0'));var util=require(_0x59b5('0x1'));var moment=require(_0x59b5('0x2'));var BPromise=require(_0x59b5('0x3'));var rs=require(_0x59b5('0x4'));var fs=require('fs');var Redis=require(_0x59b5('0x5'));var db=require(_0x59b5('0x6'))['db'];var utils=require(_0x59b5('0x7'));var logger=require('../../config/logger')(_0x59b5('0x8'));var config=require('../../config/environment');var jayson=require(_0x59b5('0x9'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x59b5('0xa')](config[_0x59b5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x59b5('0xc'))(new Redis(config[_0x59b5('0xb')]));require(_0x59b5('0xd'))['register'](socket);function respondWithRpcPromise(_0x49750f,_0xccaae1,_0x4d631d){return new BPromise(function(_0x3136b2,_0x3b89f4){return client[_0x59b5('0xe')](_0x49750f,_0x4d631d)[_0x59b5('0xf')](function(_0xc38ca7){logger[_0x59b5('0x10')](_0x59b5('0x11'),_0xccaae1,_0x59b5('0x12'));logger['debug'](_0x59b5('0x13'),_0xccaae1,'request\x20sent',JSON['stringify'](_0xc38ca7));if(_0xc38ca7[_0x59b5('0x14')]){if(_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x15')]===0x1f4){logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);return _0x3b89f4(_0xc38ca7['error'][_0x59b5('0x16')]);}logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);return _0x3136b2(_0xc38ca7[_0x59b5('0x14')][_0x59b5('0x16')]);}else{logger[_0x59b5('0x10')](_0x59b5('0x11'),_0xccaae1,_0x59b5('0x12'));_0x3136b2(_0xc38ca7[_0x59b5('0x17')][_0x59b5('0x16')]);}})[_0x59b5('0x18')](function(_0x3c82f7){logger[_0x59b5('0x14')](_0x59b5('0x11'),_0xccaae1,_0x3c82f7);_0x3b89f4(_0x3c82f7);});});}exports[_0x59b5('0x19')]=function(_0x36a54a){var _0x2414f9=this;return new Promise(function(_0x2e2e86,_0x584a1f){return db[_0x59b5('0x1a')][_0x59b5('0x1b')]({'raw':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x36a54a['options']?_0x36a54a['options'][_0x59b5('0x1e')]||null:null,'attributes':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x1f')]||null:null,'limit':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x20')]||null:null,'include':_0x36a54a[_0x59b5('0x1c')]?_0x36a54a[_0x59b5('0x1c')][_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x36a54a['options']['include'],function(_0x400d06){return{'model':db[_0x400d06[_0x59b5('0x23')]],'as':_0x400d06['as'],'attributes':_0x400d06[_0x59b5('0x1f')],'include':_0x400d06[_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x400d06[_0x59b5('0x21')],function(_0x4303d7){return{'model':db[_0x4303d7[_0x59b5('0x23')]],'as':_0x4303d7['as'],'attributes':_0x4303d7['attributes'],'include':_0x4303d7[_0x59b5('0x21')]?_[_0x59b5('0x22')](_0x4303d7[_0x59b5('0x21')],function(_0x1c88ef){return{'model':db[_0x1c88ef[_0x59b5('0x23')]],'as':_0x1c88ef['as'],'attributes':_0x1c88ef[_0x59b5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x59b5('0xf')](function(_0x9e981f){logger[_0x59b5('0x10')](_0x59b5('0x19'),_0x36a54a);logger[_0x59b5('0x24')](_0x59b5('0x19'),_0x36a54a,JSON[_0x59b5('0x25')](_0x9e981f));_0x2e2e86(_0x9e981f);})['catch'](function(_0x7028c6){logger[_0x59b5('0x14')]('GetFaxAccount',_0x7028c6[_0x59b5('0x16')],_0x36a54a);_0x584a1f(_0x2414f9[_0x59b5('0x14')](0x1f4,_0x7028c6['message']));});});};exports['NotifyFaxAccount']=function(_0x529b51,_0x279eb4,_0x55ac5e){var _0x138bf4=this;return new Promise(function(_0x3dadc3,_0x166bfd){var _0x7ba7c3={'body':_0x529b51[_0x59b5('0x26')],'channel':_0x59b5('0x27')};var _0x28ed5e=[];var _0x11cb14=[];var _0x175596={};return db['CmContact']['describe']()[_0x59b5('0xf')](function(_0x4850b1){if(!_0x4850b1){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('no\x20available\x20attributes');}_0x28ed5e=_[_0x59b5('0x2a')](_[_0x59b5('0x2b')](_0x4850b1),[_0x59b5('0x2c'),'updatedAt']);_0x11cb14=_[_0x59b5('0x2a')](_[_0x59b5('0x2b')](_0x4850b1),[_0x59b5('0x2c'),_0x59b5('0x2d'),_0x59b5('0x2e'),_0x59b5('0x2f')]);if(_0x529b51[_0x59b5('0x26')]['id']){delete _0x529b51[_0x59b5('0x26')]['id'];}if(_[_0x59b5('0x30')](_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('from\x20is\x20mandatory');}if(_[_0x59b5('0x30')](_0x529b51[_0x59b5('0x26')]['body'])||_0x529b51[_0x59b5('0x26')]['body']===''){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))](_0x59b5('0x32'));}if(_[_0x59b5('0x30')](_0x529b51['body']['mapKey'])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))](_0x59b5('0x33')+_0x11cb14);}if(!_[_0x59b5('0x34')](_0x11cb14,_0x529b51['body'][_0x59b5('0x35')])){throw new db[(_0x59b5('0x28'))][(_0x59b5('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11cb14);}_0x175596[_0x529b51[_0x59b5('0x26')]['mapKey']]=_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')];})['then'](function(){return db[_0x59b5('0x1a')]['find']({'where':{'id':_0x529b51[_0x59b5('0x36')]['id']},'include':[{'model':db[_0x59b5('0x37')],'as':_0x59b5('0x38'),'include':[{'model':db[_0x59b5('0x39')],'as':_0x59b5('0x3a'),'where':_0x175596,'limit':0x1,'order':[[_0x59b5('0x2d'),_0x59b5('0x3b')]]}]},{'model':db[_0x59b5('0x3c')],'as':_0x59b5('0x3d')}]});})[_0x59b5('0xf')](function(_0x240bbb){if(_0x240bbb&&_0x240bbb[_0x59b5('0x38')]){var _0x3b7e3b=_0x240bbb['get']({'plain':!![]});_0x7ba7c3['account']=_0x3b7e3b;_0x7ba7c3['applications']=_0x3b7e3b[_0x59b5('0x3d')];_0x7ba7c3[_0x59b5('0x3e')]=_0x3b7e3b[_0x59b5('0x38')];_0x7ba7c3[_0x59b5('0x3f')]=_[_0x59b5('0x40')](_0x7ba7c3[_0x59b5('0x3f')],[_0x59b5('0x41')],['asc']);if(_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x3d')]){delete _0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x3d')];}if(_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')]&&_0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')][_0x59b5('0x3a')]['length']){return _0x7ba7c3[_0x59b5('0x36')][_0x59b5('0x38')][_0x59b5('0x3a')][0x0];}var _0x49bb12=_[_0x59b5('0xa')](_0x529b51[_0x59b5('0x26')],{'firstName':_0x529b51['body'][_0x59b5('0x31')],'ListId':_0x3b7e3b[_0x59b5('0x2f')]});_0x49bb12[_0x529b51[_0x59b5('0x26')][_0x59b5('0x35')]]=_0x529b51[_0x59b5('0x26')][_0x59b5('0x31')];return db[_0x59b5('0x39')][_0x59b5('0x42')](_0x49bb12,{'fields':_0x28ed5e,'raw':!![]});}})['then'](function(_0x2d6e0b){_0x7ba7c3['contact']=_0x2d6e0b;if(_0x2d6e0b){var _0x5762d9={'ContactId':_0x2d6e0b['id'],'FaxAccountId':_0x529b51[_0x59b5('0x36')]['id'],'fax':_0x2d6e0b[_0x59b5('0x27')]};return db['FaxInteraction'][_0x59b5('0x43')]({'where':{'ContactId':_0x2d6e0b['id'],'closed':![],'FaxAccountId':_0x529b51['account']['id']}})[_0x59b5('0xf')](function(_0x40f868){if(_0x40f868){return[_0x40f868,![]];}return db['FaxInteraction']['create'](_0x5762d9)[_0x59b5('0xf')](function(_0x4f66dc){return[_0x4f66dc,!![]];});});}else{throw new Error(_0x59b5('0x44'));}})['spread'](function(_0x4fd70c,_0x33ef2d){var _0x52703c=_0x4fd70c['get']({'plain':!![]});if(_0x33ef2d){if(_0x7ba7c3['account'][_0x59b5('0x45')]){_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x46')]({'id':0x0,'priority':_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x47')]+0x1,'app':_0x59b5('0x48'),'appdata':_0x59b5('0x49'),'interval':'*,*,*,*'});}_0x52703c[_0x59b5('0x4a')]=!![];}else{_0x52703c['created']=![];}_0x7ba7c3[_0x59b5('0x4b')]=_0x52703c;return db[_0x59b5('0x4c')][_0x59b5('0x42')]({'body':_0x529b51[_0x59b5('0x26')][_0x59b5('0x26')],'FaxAccountId':_0x529b51[_0x59b5('0x36')]['id'],'FaxInteractionId':_0x4fd70c['id'],'direction':'in','ContactId':_0x4fd70c[_0x59b5('0x4d')],'AttachmentId':_0x529b51[_0x59b5('0x26')][_0x59b5('0x4e')]});})['then'](function(_0xb8b93e){_0x7ba7c3[_0x59b5('0x16')]=_0xb8b93e;if(_0x7ba7c3['interaction'][_0x59b5('0x4f')]){return db[_0x59b5('0x50')][_0x59b5('0x43')]({'attributes':['id',_0x59b5('0x51')],'where':{'id':_0x7ba7c3[_0x59b5('0x4b')]['UserId']}})[_0x59b5('0xf')](function(_0x301af7){if(_0x301af7){_0x7ba7c3[_0x59b5('0x3f')][_0x59b5('0x52')]({'id':0x0,'priority':0x0,'app':_0x59b5('0x53'),'appdata':_0x301af7['name']+','+(_0x7ba7c3[_0x59b5('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x59b5('0x54')});}return respondWithRpcPromise(_0x59b5('0x55'),_0x59b5('0x56'),_0x7ba7c3);});}return respondWithRpcPromise(_0x59b5('0x55'),_0x59b5('0x56'),_0x7ba7c3);})[_0x59b5('0xf')](function(_0x101c4e){_0x3dadc3(_0x101c4e);})[_0x59b5('0x18')](function(_0x3a3479){_0x166bfd(_0x138bf4[_0x59b5('0x14')](0x1f4,_0x3a3479[_0x59b5('0x16')]));});});}; \ No newline at end of file +var _0x928d=['get','applications','list','orderBy','priority','asc','length','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','unmanaged','created','FaxMessage','ContactId','AttachmentId','interaction','User','name','UserId','unshift','agent','*,*,*,*','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x928d,0x134));var _0xd928=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x928d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xd928('0x0'));var util=require(_0xd928('0x1'));var moment=require(_0xd928('0x2'));var BPromise=require('bluebird');var rs=require(_0xd928('0x3'));var fs=require('fs');var Redis=require(_0xd928('0x4'));var db=require(_0xd928('0x5'))['db'];var utils=require(_0xd928('0x6'));var logger=require(_0xd928('0x7'))(_0xd928('0x8'));var config=require(_0xd928('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd928('0xa')][_0xd928('0xb')]({'port':0x232c});config[_0xd928('0xc')]=_[_0xd928('0xd')](config['redis'],{'host':_0xd928('0xe'),'port':0x18eb});var socket=require(_0xd928('0xf'))(new Redis(config[_0xd928('0xc')]));require(_0xd928('0x10'))[_0xd928('0x11')](socket);function respondWithRpcPromise(_0x1814de,_0x2cdde7,_0x33c968){return new BPromise(function(_0x568013,_0x13d44f){return client[_0xd928('0x12')](_0x1814de,_0x33c968)[_0xd928('0x13')](function(_0x1c10de){logger[_0xd928('0x14')]('FaxAccount,\x20%s,\x20%s',_0x2cdde7,'request\x20sent');logger[_0xd928('0x15')](_0xd928('0x16'),_0x2cdde7,_0xd928('0x17'),JSON[_0xd928('0x18')](_0x1c10de));if(_0x1c10de[_0xd928('0x19')]){if(_0x1c10de['error'][_0xd928('0x1a')]===0x1f4){logger[_0xd928('0x19')](_0xd928('0x1b'),_0x2cdde7,_0x1c10de['error']['message']);return _0x13d44f(_0x1c10de[_0xd928('0x19')]['message']);}logger[_0xd928('0x19')](_0xd928('0x1b'),_0x2cdde7,_0x1c10de[_0xd928('0x19')][_0xd928('0x1c')]);return _0x568013(_0x1c10de[_0xd928('0x19')][_0xd928('0x1c')]);}else{logger[_0xd928('0x14')]('FaxAccount,\x20%s,\x20%s',_0x2cdde7,_0xd928('0x17'));_0x568013(_0x1c10de[_0xd928('0x1d')][_0xd928('0x1c')]);}})[_0xd928('0x1e')](function(_0x25a42f){logger['error'](_0xd928('0x1b'),_0x2cdde7,_0x25a42f);_0x13d44f(_0x25a42f);});});}exports[_0xd928('0x1f')]=function(_0x544ef){var _0x4d6236=this;return new Promise(function(_0x44c895,_0x1b1162){return db[_0xd928('0x20')]['findAll']({'raw':_0x544ef[_0xd928('0x21')]?_0x544ef[_0xd928('0x21')][_0xd928('0x22')]===undefined?!![]:![]:!![],'where':_0x544ef[_0xd928('0x21')]?_0x544ef[_0xd928('0x21')][_0xd928('0x23')]||null:null,'attributes':_0x544ef[_0xd928('0x21')]?_0x544ef['options'][_0xd928('0x24')]||null:null,'limit':_0x544ef['options']?_0x544ef['options'][_0xd928('0x25')]||null:null,'include':_0x544ef[_0xd928('0x21')]?_0x544ef[_0xd928('0x21')][_0xd928('0x26')]?_[_0xd928('0x27')](_0x544ef['options']['include'],function(_0x48bd71){return{'model':db[_0x48bd71[_0xd928('0x28')]],'as':_0x48bd71['as'],'attributes':_0x48bd71['attributes'],'include':_0x48bd71['include']?_[_0xd928('0x27')](_0x48bd71['include'],function(_0x4197f5){return{'model':db[_0x4197f5[_0xd928('0x28')]],'as':_0x4197f5['as'],'attributes':_0x4197f5[_0xd928('0x24')],'include':_0x4197f5[_0xd928('0x26')]?_['map'](_0x4197f5[_0xd928('0x26')],function(_0x5346a1){return{'model':db[_0x5346a1[_0xd928('0x28')]],'as':_0x5346a1['as'],'attributes':_0x5346a1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd928('0x13')](function(_0x367e9b){logger[_0xd928('0x14')]('GetFaxAccount',_0x544ef);logger[_0xd928('0x15')](_0xd928('0x1f'),_0x544ef,JSON[_0xd928('0x18')](_0x367e9b));_0x44c895(_0x367e9b);})[_0xd928('0x1e')](function(_0x1c4576){logger['error']('GetFaxAccount',_0x1c4576[_0xd928('0x1c')],_0x544ef);_0x1b1162(_0x4d6236['error'](0x1f4,_0x1c4576[_0xd928('0x1c')]));});});};exports[_0xd928('0x29')]=function(_0x1add4e,_0x4c2087,_0x23d968){var _0xc66a8c=this;return new Promise(function(_0x36e1b3,_0x537280){var _0x2a18cc={'body':_0x1add4e[_0xd928('0x2a')],'channel':'fax'};var _0x350198=[];var _0x3e5662=[];var _0x223ae0={};return db[_0xd928('0x2b')][_0xd928('0x2c')]()[_0xd928('0x13')](function(_0x10ce88){if(!_0x10ce88){throw new db[(_0xd928('0x2d'))]['ValidationError'](_0xd928('0x2e'));}_0x350198=_['difference'](_[_0xd928('0x2f')](_0x10ce88),[_0xd928('0x30'),_0xd928('0x31')]);_0x3e5662=_['difference'](_['keys'](_0x10ce88),[_0xd928('0x30'),_0xd928('0x31'),_0xd928('0x32'),_0xd928('0x33')]);if(_0x1add4e[_0xd928('0x2a')]['id']){delete _0x1add4e['body']['id'];}if(_['isNil'](_0x1add4e['body']['from'])){throw new db[(_0xd928('0x2d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd928('0x34')](_0x1add4e[_0xd928('0x2a')][_0xd928('0x2a')])||_0x1add4e[_0xd928('0x2a')][_0xd928('0x2a')]===''){throw new db[(_0xd928('0x2d'))]['ValidationError'](_0xd928('0x35'));}if(_[_0xd928('0x34')](_0x1add4e[_0xd928('0x2a')][_0xd928('0x36')])){throw new db[(_0xd928('0x2d'))][(_0xd928('0x37'))](_0xd928('0x38')+_0x3e5662);}if(!_[_0xd928('0x39')](_0x3e5662,_0x1add4e['body'][_0xd928('0x36')])){throw new db[(_0xd928('0x2d'))][(_0xd928('0x37'))](_0xd928('0x3a')+_0x3e5662);}_0x223ae0[_0x1add4e[_0xd928('0x2a')][_0xd928('0x36')]]=_0x1add4e[_0xd928('0x2a')][_0xd928('0x3b')];})[_0xd928('0x13')](function(){return db[_0xd928('0x20')][_0xd928('0x3c')]({'where':{'id':_0x1add4e[_0xd928('0x3d')]['id']},'include':[{'model':db[_0xd928('0x3e')],'as':'List','include':[{'model':db[_0xd928('0x2b')],'as':_0xd928('0x3f'),'where':_0x223ae0,'limit':0x1,'order':[['updatedAt',_0xd928('0x40')]]}]},{'model':db[_0xd928('0x41')],'as':_0xd928('0x42')}]});})['then'](function(_0x95c48){if(_0x95c48&&_0x95c48[_0xd928('0x43')]){var _0x371cc7=_0x95c48[_0xd928('0x44')]({'plain':!![]});_0x2a18cc[_0xd928('0x3d')]=_0x371cc7;_0x2a18cc[_0xd928('0x45')]=_0x371cc7[_0xd928('0x42')];_0x2a18cc[_0xd928('0x46')]=_0x371cc7[_0xd928('0x43')];_0x2a18cc[_0xd928('0x45')]=_[_0xd928('0x47')](_0x2a18cc['applications'],[_0xd928('0x48')],[_0xd928('0x49')]);if(_0x2a18cc[_0xd928('0x3d')][_0xd928('0x42')]){delete _0x2a18cc[_0xd928('0x3d')]['Applications'];}if(_0x2a18cc[_0xd928('0x3d')][_0xd928('0x43')]&&_0x2a18cc[_0xd928('0x3d')][_0xd928('0x43')][_0xd928('0x3f')][_0xd928('0x4a')]){return _0x2a18cc['account'][_0xd928('0x43')]['Contacts'][0x0];}var _0x1a0c61=_[_0xd928('0xd')](_0x1add4e['body'],{'firstName':_0x1add4e[_0xd928('0x2a')][_0xd928('0x3b')],'ListId':_0x371cc7[_0xd928('0x33')]});_0x1a0c61[_0x1add4e[_0xd928('0x2a')][_0xd928('0x36')]]=_0x1add4e[_0xd928('0x2a')][_0xd928('0x3b')];return db[_0xd928('0x2b')][_0xd928('0x4b')](_0x1a0c61,{'fields':_0x350198,'raw':!![]});}})['then'](function(_0x3001be){_0x2a18cc[_0xd928('0x4c')]=_0x3001be;if(_0x3001be){var _0x166f1a={'ContactId':_0x3001be['id'],'FaxAccountId':_0x1add4e[_0xd928('0x3d')]['id'],'fax':_0x3001be[_0xd928('0x4d')]};return db[_0xd928('0x4e')][_0xd928('0x3c')]({'where':{'ContactId':_0x3001be['id'],'closed':![],'FaxAccountId':_0x1add4e[_0xd928('0x3d')]['id']}})['then'](function(_0x523e1b){if(_0x523e1b){return[_0x523e1b,![]];}return db['FaxInteraction'][_0xd928('0x4b')](_0x166f1a)[_0xd928('0x13')](function(_0x2d2f1c){return[_0x2d2f1c,!![]];});});}else{throw new Error(_0xd928('0x4f'));}})[_0xd928('0x50')](function(_0x4ade31,_0x5153a3){var _0x438f02=_0x4ade31['get']({'plain':!![]});if(_0x5153a3){if(_0x2a18cc[_0xd928('0x3d')]['autoclose']){_0x2a18cc[_0xd928('0x45')]['push']({'id':0x0,'priority':_0x2a18cc['applications']['length']+0x1,'app':'close','appdata':_0xd928('0x51'),'interval':'*,*,*,*'});}_0x438f02[_0xd928('0x52')]=!![];}else{_0x438f02['created']=![];}_0x2a18cc['interaction']=_0x438f02;return db[_0xd928('0x53')][_0xd928('0x4b')]({'body':_0x1add4e[_0xd928('0x2a')][_0xd928('0x2a')],'FaxAccountId':_0x1add4e[_0xd928('0x3d')]['id'],'FaxInteractionId':_0x4ade31['id'],'direction':'in','ContactId':_0x4ade31[_0xd928('0x54')],'AttachmentId':_0x1add4e[_0xd928('0x2a')][_0xd928('0x55')]});})[_0xd928('0x13')](function(_0x1e75fe){_0x2a18cc[_0xd928('0x1c')]=_0x1e75fe;if(_0x2a18cc[_0xd928('0x56')]['UserId']){return db[_0xd928('0x57')][_0xd928('0x3c')]({'attributes':['id',_0xd928('0x58')],'where':{'id':_0x2a18cc[_0xd928('0x56')][_0xd928('0x59')]}})[_0xd928('0x13')](function(_0x285470){if(_0x285470){_0x2a18cc[_0xd928('0x45')][_0xd928('0x5a')]({'id':0x0,'priority':0x0,'app':_0xd928('0x5b'),'appdata':_0x285470['name']+','+(_0x2a18cc[_0xd928('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0xd928('0x5c')});}return respondWithRpcPromise(_0xd928('0x5d'),'startRouting',_0x2a18cc);});}return respondWithRpcPromise(_0xd928('0x5d'),'startRouting',_0x2a18cc);})[_0xd928('0x13')](function(_0x43fbe4){_0x36e1b3(_0x43fbe4);})[_0xd928('0x1e')](function(_0x560a8e){_0x537280(_0xc66a8c['error'](0x1f4,_0x560a8e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5ca85df..a4b0357 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 _0x7df6=['update','emit','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x1139a9,_0xde5006){var _0x6482d9=function(_0x570a84){while(--_0x570a84){_0x1139a9['push'](_0x1139a9['shift']());}};_0x6482d9(++_0xde5006);}(_0x7df6,0x17f));var _0x67df=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x7df6[_0x43dc7e];return _0x21e12d;};'use strict';var FaxAccountEvents=require(_0x67df('0x0'));var events=['save',_0x67df('0x1'),_0x67df('0x2')];function createListener(_0x51dd1b,_0x3a5e18){return function(_0xdbd98d){_0x3a5e18[_0x67df('0x3')](_0x51dd1b,_0xdbd98d);};}function removeListener(_0x2a2718,_0x475c6d){return function(){FaxAccountEvents['removeListener'](_0x2a2718,_0x475c6d);};}exports[_0x67df('0x4')]=function(_0x532d14){for(var _0xf5bd7c=0x0,_0xa00478=events[_0x67df('0x5')];_0xf5bd7c<_0xa00478;_0xf5bd7c++){var _0x2acfaa=events[_0xf5bd7c];var _0x978370=createListener(_0x67df('0x6')+_0x2acfaa,_0x532d14);FaxAccountEvents['on'](_0x2acfaa,_0x978370);}}; \ No newline at end of file +var _0x04c7=['update','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x04c7,0x15b));var _0x704c=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0x04c7[_0x2a2e72];return _0x3cfb4a;};'use strict';var FaxAccountEvents=require(_0x704c('0x0'));var events=[_0x704c('0x1'),_0x704c('0x2'),_0x704c('0x3')];function createListener(_0x12720c,_0x35f671){return function(_0xcadc2c){_0x35f671['emit'](_0x12720c,_0xcadc2c);};}function removeListener(_0x105d2c,_0x58a12f){return function(){FaxAccountEvents['removeListener'](_0x105d2c,_0x58a12f);};}exports[_0x704c('0x4')]=function(_0x3826a3){for(var _0x2a525f=0x0,_0x1adbf8=events[_0x704c('0x5')];_0x2a525f<_0x1adbf8;_0x2a525f++){var _0x215d4a=events[_0x2a525f];var _0x1f1277=createListener(_0x704c('0x6')+_0x215d4a,_0x3826a3);FaxAccountEvents['on'](_0x215d4a,_0x1f1277);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index bd36bdf..ee0f20a 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x18fd4b,_0x475e2e){var _0xe5d6b4=function(_0x591c9b){while(--_0x591c9b){_0x18fd4b['push'](_0x18fd4b['shift']());}};_0xe5d6b4(++_0x475e2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x32e7ec,_0x3cc7ab){var _0x3ce874=function(_0x12ed3d){while(--_0x12ed3d){_0x32e7ec['push'](_0x32e7ec['shift']());}};_0x3ce874(++_0x3cc7ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index e8914ef..2cb6935 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 _0x546a=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x159464,_0x78b0c3){var _0x3100d5=function(_0x2f4637){while(--_0x2f4637){_0x159464['push'](_0x159464['shift']());}};_0x3100d5(++_0x78b0c3);}(_0x546a,0x1bc));var _0xa546=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x546a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa546('0x0'));module[_0xa546('0x1')]={'priority':{'type':Sequelize[_0xa546('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa546('0x3')],'allowNull':![],'defaultValue':_0xa546('0x4')},'appdata':{'type':Sequelize[_0xa546('0x5')]()},'description':{'type':Sequelize[_0xa546('0x3')]},'interval':{'type':Sequelize[_0xa546('0x3')],'defaultValue':_0xa546('0x6')}}; \ No newline at end of file +var _0xe775=['*,*,*,*','sequelize','STRING','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe775,0x91));var _0x5e77=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0xe775[_0x52e0ee];return _0x32534c;};'use strict';var Sequelize=require(_0x5e77('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5e77('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5e77('0x2')]()},'description':{'type':Sequelize[_0x5e77('0x1')]},'interval':{'type':Sequelize[_0x5e77('0x1')],'defaultValue':_0x5e77('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a4c7dad..f8dd980 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 _0xc1ca=['squel','crypto','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','undefined','offset','set','apply','reject','save','then','error','name','send','index','FaxApplication','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash'];(function(_0x575bb9,_0x1562ef){var _0x5e086f=function(_0xec0349){while(--_0xec0349){_0x575bb9['push'](_0x575bb9['shift']());}};_0x5e086f(++_0x1562ef);}(_0xc1ca,0x8f));var _0xac1c=function(_0x3e0f57,_0x7aceb7){_0x3e0f57=_0x3e0f57-0x0;var _0xf9f971=_0xc1ca[_0x3e0f57];return _0xf9f971;};'use strict';var emlformat=require(_0xac1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac1c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac1c('0x2'));var moment=require(_0xac1c('0x3'));var BPromise=require(_0xac1c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac1c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac1c('0x6'));var fs=require('fs');var fs_extra=require(_0xac1c('0x7'));var _=require(_0xac1c('0x8'));var squel=require(_0xac1c('0x9'));var crypto=require(_0xac1c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac1c('0xb'));var querystring=require(_0xac1c('0xc'));var Papa=require(_0xac1c('0xd'));var Redis=require(_0xac1c('0xe'));var authService=require(_0xac1c('0xf'));var qs=require(_0xac1c('0x10'));var as=require(_0xac1c('0x11'));var hardwareService=require(_0xac1c('0x12'));var logger=require(_0xac1c('0x13'))(_0xac1c('0x14'));var utils=require(_0xac1c('0x15'));var config=require(_0xac1c('0x16'));var licenseUtil=require(_0xac1c('0x17'));var db=require(_0xac1c('0x18'))['db'];function respondWithStatusCode(_0x3ee5d7,_0x27649b){_0x27649b=_0x27649b||0xcc;return function(_0x2be837){if(_0x2be837){return _0x3ee5d7[_0xac1c('0x19')](_0x27649b);}return _0x3ee5d7[_0xac1c('0x1a')](_0x27649b)[_0xac1c('0x1b')]();};}function respondWithResult(_0x19bda1,_0xa22723){_0xa22723=_0xa22723||0xc8;return function(_0x4658f8){if(_0x4658f8){return _0x19bda1['status'](_0xa22723)['json'](_0x4658f8);}};}function respondWithFilteredResult(_0x535445,_0xfd4b63){return function(_0x3e9d4c){if(_0x3e9d4c){var _0x9c5b7a=typeof _0xfd4b63['offset']===_0xac1c('0x1c')&&typeof _0xfd4b63['limit']==='undefined';var _0x3389a4=_0x3e9d4c['count'];var _0x5e90bc=_0x9c5b7a?0x0:_0xfd4b63[_0xac1c('0x1d')];var _0x306717=_0x9c5b7a?_0x3e9d4c['count']:_0xfd4b63['offset']+_0xfd4b63['limit'];var _0x347817;if(_0x306717>=_0x3389a4){_0x306717=_0x3389a4;_0x347817=0xc8;}else{_0x347817=0xce;}_0x535445['status'](_0x347817);return _0x535445[_0xac1c('0x1e')]('Content-Range',_0x5e90bc+'-'+_0x306717+'/'+_0x3389a4)['json'](_0x3e9d4c);}return null;};}function patchUpdates(_0x11ae9e){return function(_0x59bcc8){try{jsonpatch[_0xac1c('0x1f')](_0x59bcc8,_0x11ae9e,!![]);}catch(_0x5ceb21){return BPromise[_0xac1c('0x20')](_0x5ceb21);}return _0x59bcc8[_0xac1c('0x21')]();};}function saveUpdates(_0x50146a,_0x17da5e){return function(_0x2bbcf5){if(_0x2bbcf5){return _0x2bbcf5['update'](_0x50146a)[_0xac1c('0x22')](function(_0x46962d){return _0x46962d;});}return null;};}function removeEntity(_0x1e729a,_0x28bab7){return function(_0x2c56f4){if(_0x2c56f4){return _0x2c56f4['destroy']()[_0xac1c('0x22')](function(){_0x1e729a[_0xac1c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e16d,_0x1d7c58){return function(_0x4e722c){if(!_0x4e722c){_0x51e16d[_0xac1c('0x19')](0x194);}return _0x4e722c;};}function handleError(_0x164799,_0x4b1941){_0x4b1941=_0x4b1941||0x1f4;return function(_0x27271e){logger[_0xac1c('0x23')](_0x27271e['stack']);if(_0x27271e[_0xac1c('0x24')]){delete _0x27271e[_0xac1c('0x24')];}_0x164799['status'](_0x4b1941)[_0xac1c('0x25')](_0x27271e);};}exports[_0xac1c('0x26')]=function(_0x1f2e54,_0x5553e8){var _0x29a9ed={},_0x219796={},_0x43009b={'count':0x0,'rows':[]};var _0x29da15=_['map'](db[_0xac1c('0x27')]['rawAttributes'],function(_0x5f5ef8){return{'name':_0x5f5ef8[_0xac1c('0x28')],'type':_0x5f5ef8[_0xac1c('0x29')]['key']};});_0x219796[_0xac1c('0x2a')]=_['map'](_0x29da15,'name');_0x219796[_0xac1c('0x2b')]=_[_0xac1c('0x2c')](_0x1f2e54['query']);_0x219796[_0xac1c('0x2d')]=_['intersection'](_0x219796[_0xac1c('0x2a')],_0x219796['query']);_0x29a9ed[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x219796['model'],qs[_0xac1c('0x30')](_0x1f2e54[_0xac1c('0x2b')]['fields']));_0x29a9ed[_0xac1c('0x2e')]=_0x29a9ed[_0xac1c('0x2e')][_0xac1c('0x31')]?_0x29a9ed[_0xac1c('0x2e')]:_0x219796['model'];if(!_0x1f2e54[_0xac1c('0x2b')][_0xac1c('0x32')](_0xac1c('0x33'))){_0x29a9ed['limit']=qs[_0xac1c('0x34')](_0x1f2e54[_0xac1c('0x2b')][_0xac1c('0x34')]);_0x29a9ed[_0xac1c('0x1d')]=qs[_0xac1c('0x1d')](_0x1f2e54['query'][_0xac1c('0x1d')]);}_0x29a9ed[_0xac1c('0x35')]=qs[_0xac1c('0x36')](_0x1f2e54[_0xac1c('0x2b')]['sort']);_0x29a9ed[_0xac1c('0x37')]=qs[_0xac1c('0x2d')](_[_0xac1c('0x38')](_0x1f2e54[_0xac1c('0x2b')],_0x219796[_0xac1c('0x2d')]),_0x29da15);if(_0x1f2e54['query'][_0xac1c('0x39')]){_0x29a9ed[_0xac1c('0x37')]=_[_0xac1c('0x3a')](_0x29a9ed[_0xac1c('0x37')],{'$or':_[_0xac1c('0x3b')](_0x29da15,function(_0x41cbab){if(_0x41cbab[_0xac1c('0x29')]!==_0xac1c('0x3c')){var _0x4b5f9a={};_0x4b5f9a[_0x41cbab[_0xac1c('0x24')]]={'$like':'%'+_0x1f2e54[_0xac1c('0x2b')]['filter']+'%'};return _0x4b5f9a;}})});}_0x29a9ed=_['merge']({},_0x29a9ed,_0x1f2e54[_0xac1c('0x3d')]);var _0x1d5926={'where':_0x29a9ed[_0xac1c('0x37')]};return db[_0xac1c('0x27')][_0xac1c('0x3e')](_0x1d5926)[_0xac1c('0x22')](function(_0x42f338){_0x43009b[_0xac1c('0x3e')]=_0x42f338;if(_0x1f2e54['query'][_0xac1c('0x3f')]){_0x29a9ed[_0xac1c('0x40')]=[{'all':!![]}];}return db[_0xac1c('0x27')][_0xac1c('0x41')](_0x29a9ed);})['then'](function(_0x41e331){_0x43009b[_0xac1c('0x42')]=_0x41e331;return _0x43009b;})[_0xac1c('0x22')](respondWithFilteredResult(_0x5553e8,_0x29a9ed))[_0xac1c('0x43')](handleError(_0x5553e8,null));};exports[_0xac1c('0x44')]=function(_0xe9d3a8,_0x4da822){var _0x471e1d={'raw':!![],'where':{'id':_0xe9d3a8[_0xac1c('0x45')]['id']}},_0x244d0c={};_0x244d0c[_0xac1c('0x2a')]=_[_0xac1c('0x2c')](db[_0xac1c('0x27')][_0xac1c('0x46')]);_0x244d0c[_0xac1c('0x2b')]=_[_0xac1c('0x2c')](_0xe9d3a8[_0xac1c('0x2b')]);_0x244d0c[_0xac1c('0x2d')]=_['intersection'](_0x244d0c['model'],_0x244d0c[_0xac1c('0x2b')]);_0x471e1d[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x244d0c[_0xac1c('0x2a')],qs[_0xac1c('0x30')](_0xe9d3a8[_0xac1c('0x2b')][_0xac1c('0x30')]));_0x471e1d[_0xac1c('0x2e')]=_0x471e1d[_0xac1c('0x2e')][_0xac1c('0x31')]?_0x471e1d['attributes']:_0x244d0c[_0xac1c('0x2a')];if(_0xe9d3a8[_0xac1c('0x2b')][_0xac1c('0x3f')]){_0x471e1d['include']=[{'all':!![]}];}_0x471e1d=_[_0xac1c('0x3a')]({},_0x471e1d,_0xe9d3a8[_0xac1c('0x3d')]);return db[_0xac1c('0x27')][_0xac1c('0x47')](_0x471e1d)[_0xac1c('0x22')](handleEntityNotFound(_0x4da822,null))['then'](respondWithResult(_0x4da822,null))[_0xac1c('0x43')](handleError(_0x4da822,null));};exports[_0xac1c('0x48')]=function(_0x53a54a,_0x389838){return db[_0xac1c('0x27')][_0xac1c('0x48')](_0x53a54a['body'],{})[_0xac1c('0x22')](respondWithResult(_0x389838,0xc9))['catch'](handleError(_0x389838,null));};exports[_0xac1c('0x49')]=function(_0xb8ce6e,_0x53913b){if(_0xb8ce6e[_0xac1c('0x4a')]['id']){delete _0xb8ce6e[_0xac1c('0x4a')]['id'];}return db[_0xac1c('0x27')]['find']({'where':{'id':_0xb8ce6e['params']['id']}})[_0xac1c('0x22')](handleEntityNotFound(_0x53913b,null))[_0xac1c('0x22')](saveUpdates(_0xb8ce6e['body'],null))['then'](respondWithResult(_0x53913b,null))['catch'](handleError(_0x53913b,null));};exports[_0xac1c('0x4b')]=function(_0x4b68cc,_0x317a9e){return db[_0xac1c('0x27')][_0xac1c('0x47')]({'where':{'id':_0x4b68cc[_0xac1c('0x45')]['id']}})[_0xac1c('0x22')](handleEntityNotFound(_0x317a9e,null))['then'](removeEntity(_0x317a9e,null))['catch'](handleError(_0x317a9e,null));}; \ No newline at end of file +var _0x7742=['jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','FaxApplication','includeAll','include','rows','show','params','keys','catch','create','body','find','rimraf','zip-dir','fast-json-patch','moment','util','path','ejs','fs-extra','squel','crypto'];(function(_0x3b016e,_0x1b2d5a){var _0x4f9f8d=function(_0x10ab94){while(--_0x10ab94){_0x3b016e['push'](_0x3b016e['shift']());}};_0x4f9f8d(++_0x1b2d5a);}(_0x7742,0xcb));var _0x2774=function(_0x282606,_0x328ae5){_0x282606=_0x282606-0x0;var _0x806a23=_0x7742[_0x282606];return _0x806a23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2774('0x0'));var zipdir=require(_0x2774('0x1'));var jsonpatch=require(_0x2774('0x2'));var rp=require('request-promise');var moment=require(_0x2774('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2774('0x4'));var path=require(_0x2774('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2774('0x6'));var fs=require('fs');var fs_extra=require(_0x2774('0x7'));var _=require('lodash');var squel=require(_0x2774('0x8'));var crypto=require(_0x2774('0x9'));var jsforce=require(_0x2774('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2774('0xb'));var querystring=require(_0x2774('0xc'));var Papa=require('papaparse');var Redis=require(_0x2774('0xd'));var authService=require(_0x2774('0xe'));var qs=require(_0x2774('0xf'));var as=require(_0x2774('0x10'));var hardwareService=require(_0x2774('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2774('0x12'));var licenseUtil=require(_0x2774('0x13'));var db=require(_0x2774('0x14'))['db'];function respondWithStatusCode(_0x15ec5d,_0xdec3fb){_0xdec3fb=_0xdec3fb||0xcc;return function(_0x4adf09){if(_0x4adf09){return _0x15ec5d[_0x2774('0x15')](_0xdec3fb);}return _0x15ec5d[_0x2774('0x16')](_0xdec3fb)['end']();};}function respondWithResult(_0x4ef4a3,_0x44f872){_0x44f872=_0x44f872||0xc8;return function(_0x1137b1){if(_0x1137b1){return _0x4ef4a3[_0x2774('0x16')](_0x44f872)[_0x2774('0x17')](_0x1137b1);}};}function respondWithFilteredResult(_0x49ca44,_0x1c0d41){return function(_0x500db4){if(_0x500db4){var _0x55e3db=typeof _0x1c0d41[_0x2774('0x18')]===_0x2774('0x19')&&typeof _0x1c0d41[_0x2774('0x1a')]==='undefined';var _0x1a144a=_0x500db4['count'];var _0x23069c=_0x55e3db?0x0:_0x1c0d41[_0x2774('0x18')];var _0x5a8c26=_0x55e3db?_0x500db4[_0x2774('0x1b')]:_0x1c0d41[_0x2774('0x18')]+_0x1c0d41[_0x2774('0x1a')];var _0x588f9a;if(_0x5a8c26>=_0x1a144a){_0x5a8c26=_0x1a144a;_0x588f9a=0xc8;}else{_0x588f9a=0xce;}_0x49ca44[_0x2774('0x16')](_0x588f9a);return _0x49ca44[_0x2774('0x1c')](_0x2774('0x1d'),_0x23069c+'-'+_0x5a8c26+'/'+_0x1a144a)['json'](_0x500db4);}return null;};}function patchUpdates(_0x3fa24d){return function(_0x2af961){try{jsonpatch['apply'](_0x2af961,_0x3fa24d,!![]);}catch(_0x10993c){return BPromise[_0x2774('0x1e')](_0x10993c);}return _0x2af961[_0x2774('0x1f')]();};}function saveUpdates(_0x2161fb,_0x414785){return function(_0x34210e){if(_0x34210e){return _0x34210e[_0x2774('0x20')](_0x2161fb)[_0x2774('0x21')](function(_0xcea887){return _0xcea887;});}return null;};}function removeEntity(_0x351195,_0x2e52a2){return function(_0x1bfa8c){if(_0x1bfa8c){return _0x1bfa8c[_0x2774('0x22')]()[_0x2774('0x21')](function(){_0x351195[_0x2774('0x16')](0xcc)[_0x2774('0x23')]();});}};}function handleEntityNotFound(_0x2f1356,_0x488987){return function(_0x7731af){if(!_0x7731af){_0x2f1356[_0x2774('0x15')](0x194);}return _0x7731af;};}function handleError(_0x754f25,_0x4857c0){_0x4857c0=_0x4857c0||0x1f4;return function(_0xbc44a0){logger[_0x2774('0x24')](_0xbc44a0[_0x2774('0x25')]);if(_0xbc44a0[_0x2774('0x26')]){delete _0xbc44a0[_0x2774('0x26')];}_0x754f25['status'](_0x4857c0)[_0x2774('0x27')](_0xbc44a0);};}exports[_0x2774('0x28')]=function(_0x3da918,_0xa51d61){var _0x344a0e={},_0x3f4331={},_0x11ceb1={'count':0x0,'rows':[]};var _0x4b735c=_[_0x2774('0x29')](db['FaxApplication'][_0x2774('0x2a')],function(_0x3dc803){return{'name':_0x3dc803[_0x2774('0x2b')],'type':_0x3dc803[_0x2774('0x2c')][_0x2774('0x2d')]};});_0x3f4331[_0x2774('0x2e')]=_[_0x2774('0x29')](_0x4b735c,'name');_0x3f4331[_0x2774('0x2f')]=_['keys'](_0x3da918[_0x2774('0x2f')]);_0x3f4331[_0x2774('0x30')]=_[_0x2774('0x31')](_0x3f4331['model'],_0x3f4331[_0x2774('0x2f')]);_0x344a0e[_0x2774('0x32')]=_[_0x2774('0x31')](_0x3f4331['model'],qs[_0x2774('0x33')](_0x3da918['query'][_0x2774('0x33')]));_0x344a0e[_0x2774('0x32')]=_0x344a0e['attributes'][_0x2774('0x34')]?_0x344a0e[_0x2774('0x32')]:_0x3f4331[_0x2774('0x2e')];if(!_0x3da918[_0x2774('0x2f')][_0x2774('0x35')]('nolimit')){_0x344a0e['limit']=qs[_0x2774('0x1a')](_0x3da918[_0x2774('0x2f')][_0x2774('0x1a')]);_0x344a0e[_0x2774('0x18')]=qs[_0x2774('0x18')](_0x3da918['query']['offset']);}_0x344a0e[_0x2774('0x36')]=qs[_0x2774('0x37')](_0x3da918[_0x2774('0x2f')][_0x2774('0x37')]);_0x344a0e['where']=qs[_0x2774('0x30')](_[_0x2774('0x38')](_0x3da918[_0x2774('0x2f')],_0x3f4331[_0x2774('0x30')]),_0x4b735c);if(_0x3da918[_0x2774('0x2f')][_0x2774('0x39')]){_0x344a0e[_0x2774('0x3a')]=_[_0x2774('0x3b')](_0x344a0e['where'],{'$or':_['map'](_0x4b735c,function(_0x4e0ccc){if(_0x4e0ccc[_0x2774('0x2c')]!=='VIRTUAL'){var _0x4eab2f={};_0x4eab2f[_0x4e0ccc[_0x2774('0x26')]]={'$like':'%'+_0x3da918[_0x2774('0x2f')]['filter']+'%'};return _0x4eab2f;}})});}_0x344a0e=_['merge']({},_0x344a0e,_0x3da918['options']);var _0x4f2f74={'where':_0x344a0e['where']};return db[_0x2774('0x3c')][_0x2774('0x1b')](_0x4f2f74)['then'](function(_0x2de9c6){_0x11ceb1[_0x2774('0x1b')]=_0x2de9c6;if(_0x3da918[_0x2774('0x2f')][_0x2774('0x3d')]){_0x344a0e[_0x2774('0x3e')]=[{'all':!![]}];}return db[_0x2774('0x3c')]['findAll'](_0x344a0e);})[_0x2774('0x21')](function(_0x33a02d){_0x11ceb1[_0x2774('0x3f')]=_0x33a02d;return _0x11ceb1;})[_0x2774('0x21')](respondWithFilteredResult(_0xa51d61,_0x344a0e))['catch'](handleError(_0xa51d61,null));};exports[_0x2774('0x40')]=function(_0x38db8c,_0x34be41){var _0x17f7e9={'raw':!![],'where':{'id':_0x38db8c[_0x2774('0x41')]['id']}},_0x5e9d59={};_0x5e9d59[_0x2774('0x2e')]=_[_0x2774('0x42')](db[_0x2774('0x3c')]['rawAttributes']);_0x5e9d59[_0x2774('0x2f')]=_['keys'](_0x38db8c[_0x2774('0x2f')]);_0x5e9d59[_0x2774('0x30')]=_['intersection'](_0x5e9d59[_0x2774('0x2e')],_0x5e9d59['query']);_0x17f7e9['attributes']=_['intersection'](_0x5e9d59[_0x2774('0x2e')],qs[_0x2774('0x33')](_0x38db8c['query'][_0x2774('0x33')]));_0x17f7e9[_0x2774('0x32')]=_0x17f7e9[_0x2774('0x32')][_0x2774('0x34')]?_0x17f7e9['attributes']:_0x5e9d59[_0x2774('0x2e')];if(_0x38db8c[_0x2774('0x2f')][_0x2774('0x3d')]){_0x17f7e9[_0x2774('0x3e')]=[{'all':!![]}];}_0x17f7e9=_[_0x2774('0x3b')]({},_0x17f7e9,_0x38db8c['options']);return db[_0x2774('0x3c')]['find'](_0x17f7e9)['then'](handleEntityNotFound(_0x34be41,null))[_0x2774('0x21')](respondWithResult(_0x34be41,null))[_0x2774('0x43')](handleError(_0x34be41,null));};exports[_0x2774('0x44')]=function(_0x11f184,_0x3b4929){return db['FaxApplication']['create'](_0x11f184[_0x2774('0x45')],{})[_0x2774('0x21')](respondWithResult(_0x3b4929,0xc9))[_0x2774('0x43')](handleError(_0x3b4929,null));};exports[_0x2774('0x20')]=function(_0x34055c,_0x11db4c){if(_0x34055c[_0x2774('0x45')]['id']){delete _0x34055c['body']['id'];}return db[_0x2774('0x3c')][_0x2774('0x46')]({'where':{'id':_0x34055c[_0x2774('0x41')]['id']}})[_0x2774('0x21')](handleEntityNotFound(_0x11db4c,null))[_0x2774('0x21')](saveUpdates(_0x34055c[_0x2774('0x45')],null))['then'](respondWithResult(_0x11db4c,null))[_0x2774('0x43')](handleError(_0x11db4c,null));};exports[_0x2774('0x22')]=function(_0x4e9429,_0x31851a){return db[_0x2774('0x3c')]['find']({'where':{'id':_0x4e9429[_0x2774('0x41')]['id']}})[_0x2774('0x21')](handleEntityNotFound(_0x31851a,null))[_0x2774('0x21')](removeEntity(_0x31851a,null))[_0x2774('0x43')](handleError(_0x31851a,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8618a6b..643f3d2 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 _0xd2ab=['request-promise','rimraf','./faxApplication.attributes','exports','FaxApplication','lodash','../../config/logger','moment','bluebird'];(function(_0x3241e0,_0x5f3409){var _0x4361f7=function(_0x1d1d06){while(--_0x1d1d06){_0x3241e0['push'](_0x3241e0['shift']());}};_0x4361f7(++_0x5f3409);}(_0xd2ab,0x7a));var _0xbd2a=function(_0x3acb84,_0x5cead1){_0x3acb84=_0x3acb84-0x0;var _0x5d071b=_0xd2ab[_0x3acb84];return _0x5d071b;};'use strict';var _=require(_0xbd2a('0x0'));var util=require('util');var logger=require(_0xbd2a('0x1'))('api');var moment=require(_0xbd2a('0x2'));var BPromise=require(_0xbd2a('0x3'));var rp=require(_0xbd2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd2a('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd2a('0x6'));module[_0xbd2a('0x7')]=function(_0x4df7ec,_0x45ec73){return _0x4df7ec['define'](_0xbd2a('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5055=['request-promise','path','rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x42160c,_0x30e856){var _0xdba9cb=function(_0x3b1f82){while(--_0x3b1f82){_0x42160c['push'](_0x42160c['shift']());}};_0xdba9cb(++_0x30e856);}(_0x5055,0xd8));var _0x5505=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5055[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5505('0x0'));var logger=require(_0x5505('0x1'))(_0x5505('0x2'));var moment=require(_0x5505('0x3'));var BPromise=require(_0x5505('0x4'));var rp=require(_0x5505('0x5'));var fs=require('fs');var path=require(_0x5505('0x6'));var rimraf=require(_0x5505('0x7'));var config=require(_0x5505('0x8'));var attributes=require('./faxApplication.attributes');module[_0x5505('0x9')]=function(_0x3be98a,_0x4233c9){return _0x3be98a['define'](_0x5505('0xa'),attributes,{'tableName':_0x5505('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5505('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 04f37cf..2168253 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 _0xf41a=['client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x20446d,_0x196b02){var _0x3b126d=function(_0x38b2c7){while(--_0x38b2c7){_0x20446d['push'](_0x20446d['shift']());}};_0x3b126d(++_0x196b02);}(_0xf41a,0xd2));var _0xaf41=function(_0x213b74,_0x46786a){_0x213b74=_0x213b74-0x0;var _0x31a624=_0xf41a[_0x213b74];return _0x31a624;};'use strict';var _=require(_0xaf41('0x0'));var util=require(_0xaf41('0x1'));var moment=require(_0xaf41('0x2'));var BPromise=require(_0xaf41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf41('0x4'));var db=require(_0xaf41('0x5'))['db'];var utils=require(_0xaf41('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf41('0x7')][_0xaf41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a9b4f,_0x3f0e14,_0x3ffdf9){return new BPromise(function(_0x3321c5,_0x19512b){return client[_0xaf41('0x9')](_0x2a9b4f,_0x3ffdf9)['then'](function(_0x33cffc){logger[_0xaf41('0xa')](_0xaf41('0xb'),_0x3f0e14,'request\x20sent');logger[_0xaf41('0xc')](_0xaf41('0xd'),_0x3f0e14,_0xaf41('0xe'),JSON[_0xaf41('0xf')](_0x33cffc));if(_0x33cffc[_0xaf41('0x10')]){if(_0x33cffc['error'][_0xaf41('0x11')]===0x1f4){logger['error'](_0xaf41('0xb'),_0x3f0e14,_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);return _0x19512b(_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);}logger[_0xaf41('0x10')](_0xaf41('0xb'),_0x3f0e14,_0x33cffc['error'][_0xaf41('0x12')]);return _0x3321c5(_0x33cffc[_0xaf41('0x10')][_0xaf41('0x12')]);}else{logger[_0xaf41('0xa')](_0xaf41('0xb'),_0x3f0e14,_0xaf41('0xe'));_0x3321c5(_0x33cffc[_0xaf41('0x13')][_0xaf41('0x12')]);}})['catch'](function(_0x50d73b){logger['error'](_0xaf41('0xb'),_0x3f0e14,_0x50d73b);_0x19512b(_0x50d73b);});});}exports[_0xaf41('0x14')]=function(_0xe4a23b){var _0x37abec=this;return new Promise(function(_0x118e39,_0x567df2){return db[_0xaf41('0x15')][_0xaf41('0x16')](_0xe4a23b[_0xaf41('0x17')],{'raw':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b['options'][_0xaf41('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b['options'][_0xaf41('0x1a')]||null:null,'attributes':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b[_0xaf41('0x18')][_0xaf41('0x1b')]||null:null,'limit':_0xe4a23b[_0xaf41('0x18')]?_0xe4a23b[_0xaf41('0x18')][_0xaf41('0x1c')]||null:null})[_0xaf41('0x1d')](function(_0x50e642){logger[_0xaf41('0xa')](_0xaf41('0x14'),_0xe4a23b);logger['debug'](_0xaf41('0x14'),_0xe4a23b,JSON['stringify'](_0x50e642));_0x118e39(_0x50e642);})[_0xaf41('0x1e')](function(_0x27371c){logger[_0xaf41('0x10')](_0xaf41('0x14'),_0x27371c[_0xaf41('0x12')],_0xe4a23b);_0x567df2(_0x37abec[_0xaf41('0x10')](0x1f4,_0x27371c[_0xaf41('0x12')]));});});}; \ No newline at end of file +var _0x29f7=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','limit','then','lodash'];(function(_0x41fbcc,_0x178de7){var _0x106261=function(_0x2c76c0){while(--_0x2c76c0){_0x41fbcc['push'](_0x41fbcc['shift']());}};_0x106261(++_0x178de7);}(_0x29f7,0xca));var _0x729f=function(_0x4877da,_0x391790){_0x4877da=_0x4877da-0x0;var _0x43ce3e=_0x29f7[_0x4877da];return _0x43ce3e;};'use strict';var _=require(_0x729f('0x0'));var util=require(_0x729f('0x1'));var moment=require(_0x729f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x729f('0x3'))['db'];var utils=require(_0x729f('0x4'));var logger=require(_0x729f('0x5'))(_0x729f('0x6'));var config=require(_0x729f('0x7'));var jayson=require(_0x729f('0x8'));var client=jayson[_0x729f('0x9')][_0x729f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dfaa1,_0x43d212,_0x1563bc){return new BPromise(function(_0x431197,_0x21aee5){return client[_0x729f('0xb')](_0x1dfaa1,_0x1563bc)['then'](function(_0x592ed9){logger[_0x729f('0xc')]('FaxApplication,\x20%s,\x20%s',_0x43d212,'request\x20sent');logger['debug'](_0x729f('0xd'),_0x43d212,_0x729f('0xe'),JSON[_0x729f('0xf')](_0x592ed9));if(_0x592ed9['error']){if(_0x592ed9['error'][_0x729f('0x10')]===0x1f4){logger[_0x729f('0x11')](_0x729f('0x12'),_0x43d212,_0x592ed9[_0x729f('0x11')][_0x729f('0x13')]);return _0x21aee5(_0x592ed9['error'][_0x729f('0x13')]);}logger[_0x729f('0x11')](_0x729f('0x12'),_0x43d212,_0x592ed9[_0x729f('0x11')][_0x729f('0x13')]);return _0x431197(_0x592ed9[_0x729f('0x11')][_0x729f('0x13')]);}else{logger[_0x729f('0xc')](_0x729f('0x12'),_0x43d212,_0x729f('0xe'));_0x431197(_0x592ed9[_0x729f('0x14')][_0x729f('0x13')]);}})[_0x729f('0x15')](function(_0x63d841){logger[_0x729f('0x11')]('FaxApplication,\x20%s,\x20%s',_0x43d212,_0x63d841);_0x21aee5(_0x63d841);});});}exports[_0x729f('0x16')]=function(_0x417e68){var _0x4f8d35=this;return new Promise(function(_0x22c214,_0x39ee12){return db[_0x729f('0x17')]['update'](_0x417e68[_0x729f('0x18')],{'raw':_0x417e68['options']?_0x417e68[_0x729f('0x19')][_0x729f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417e68[_0x729f('0x19')]?_0x417e68[_0x729f('0x19')]['where']||null:null,'attributes':_0x417e68[_0x729f('0x19')]?_0x417e68[_0x729f('0x19')]['attributes']||null:null,'limit':_0x417e68['options']?_0x417e68[_0x729f('0x19')][_0x729f('0x1b')]||null:null})[_0x729f('0x1c')](function(_0x1effb6){logger[_0x729f('0xc')]('UpdateFaxApplication',_0x417e68);logger['debug'](_0x729f('0x16'),_0x417e68,JSON[_0x729f('0xf')](_0x1effb6));_0x22c214(_0x1effb6);})[_0x729f('0x15')](function(_0x582346){logger[_0x729f('0x11')](_0x729f('0x16'),_0x582346[_0x729f('0x13')],_0x417e68);_0x39ee12(_0x4f8d35[_0x729f('0x11')](0x1f4,_0x582346[_0x729f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a8ea866..a32c86d 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x5257b7,_0x4f42d6){var _0x5a8139=function(_0x4adfe2){while(--_0x4adfe2){_0x5257b7['push'](_0x5257b7['shift']());}};_0x5a8139(++_0x4f42d6);}(_0xda2d,0x102));var _0xdda2=function(_0x4d3c03,_0x4ba6ec){_0x4d3c03=_0x4d3c03-0x0;var _0x5b9e22=_0xda2d[_0x4d3c03];return _0x5b9e22;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x25e9ff,_0x3f0c8b){var _0x1cc069=function(_0x5e29b1){while(--_0x5e29b1){_0x25e9ff['push'](_0x25e9ff['shift']());}};_0x1cc069(++_0x3f0c8b);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9aaa7b0..db567b9 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 _0x12c1=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x37ee6f,_0x49d769){var _0x3db325=function(_0xda9717){while(--_0xda9717){_0x37ee6f['push'](_0x37ee6f['shift']());}};_0x3db325(++_0x49d769);}(_0x12c1,0x9c));var _0x112c=function(_0x2bf7fa,_0x178079){_0x2bf7fa=_0x2bf7fa-0x0;var _0x5ce982=_0x12c1[_0x2bf7fa];return _0x5ce982;};'use strict';var Sequelize=require(_0x112c('0x0'));module[_0x112c('0x1')]={'closed':{'type':Sequelize[_0x112c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x112c('0x3')]},'disposition':{'type':Sequelize[_0x112c('0x4')]},'secondDisposition':{'type':Sequelize[_0x112c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x112c('0x4')]},'note':{'type':Sequelize[_0x112c('0x4')]},'read1stAt':{'type':Sequelize[_0x112c('0x3')]},'fax':{'type':Sequelize[_0x112c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x112c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x112c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x67a3=['BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x67a3,0xd7));var _0x367a=function(_0x4a87d6,_0x38ac8c){_0x4a87d6=_0x4a87d6-0x0;var _0xd19aac=_0x67a3[_0x4a87d6];return _0xd19aac;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x367a('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x367a('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x367a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x367a('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x367a('0x1')]},'fax':{'type':Sequelize[_0x367a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x367a('0x3')]('in',_0x367a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x367a('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x367a('0x3')]('in',_0x367a('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f4766ed..77117ca 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 _0x21e4=['fullname','TagIds','Tags','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','users','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','value','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','server','join','root','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createWriteStream','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','json','offset','undefined','Content-Range','apply','reject','save','update','then','status','end','error','stack','name','Users','map'];(function(_0x2107a5,_0x2d34cd){var _0x402566=function(_0x16987e){while(--_0x16987e){_0x2107a5['push'](_0x2107a5['shift']());}};_0x402566(++_0x2d34cd);}(_0x21e4,0x17a));var _0x421e=function(_0x58124f,_0x4f9ddf){_0x58124f=_0x58124f-0x0;var _0x5c5f85=_0x21e4[_0x58124f];return _0x5c5f85;};'use strict';var emlformat=require(_0x421e('0x0'));var rimraf=require(_0x421e('0x1'));var zipdir=require(_0x421e('0x2'));var jsonpatch=require(_0x421e('0x3'));var rp=require('request-promise');var moment=require(_0x421e('0x4'));var BPromise=require(_0x421e('0x5'));var Mustache=require('mustache');var util=require(_0x421e('0x6'));var path=require(_0x421e('0x7'));var sox=require(_0x421e('0x8'));var csv=require(_0x421e('0x9'));var ejs=require(_0x421e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x421e('0xb'));var squel=require('squel');var crypto=require(_0x421e('0xc'));var jsforce=require(_0x421e('0xd'));var deskjs=require(_0x421e('0xe'));var toCsv=require(_0x421e('0x9'));var querystring=require(_0x421e('0xf'));var Papa=require(_0x421e('0x10'));var Redis=require('ioredis');var authService=require(_0x421e('0x11'));var qs=require(_0x421e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x421e('0x13'));var logger=require(_0x421e('0x14'))('api');var utils=require(_0x421e('0x15'));var config=require(_0x421e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x421e('0x17')](config['redis'],{'host':_0x421e('0x18'),'port':0x18eb});var socket=require(_0x421e('0x19'))(new Redis(config[_0x421e('0x1a')]));require(_0x421e('0x1b'))[_0x421e('0x1c')](socket);function respondWithStatusCode(_0x2346c2,_0x16e14f){_0x16e14f=_0x16e14f||0xcc;return function(_0x3faff6){if(_0x3faff6){return _0x2346c2[_0x421e('0x1d')](_0x16e14f);}return _0x2346c2['status'](_0x16e14f)['end']();};}function respondWithResult(_0x55748a,_0x2881cf){_0x2881cf=_0x2881cf||0xc8;return function(_0x3bfe63){if(_0x3bfe63){return _0x55748a['status'](_0x2881cf)[_0x421e('0x1e')](_0x3bfe63);}};}function respondWithFilteredResult(_0x3d8aa0,_0xbac1bd){return function(_0x3f6e0c){if(_0x3f6e0c){var _0x1502fc=typeof _0xbac1bd[_0x421e('0x1f')]===_0x421e('0x20')&&typeof _0xbac1bd['limit']===_0x421e('0x20');var _0x475a27=_0x3f6e0c['count'];var _0x37a774=_0x1502fc?0x0:_0xbac1bd['offset'];var _0x5c3fc5=_0x1502fc?_0x3f6e0c['count']:_0xbac1bd[_0x421e('0x1f')]+_0xbac1bd['limit'];var _0x29ad77;if(_0x5c3fc5>=_0x475a27){_0x5c3fc5=_0x475a27;_0x29ad77=0xc8;}else{_0x29ad77=0xce;}_0x3d8aa0['status'](_0x29ad77);return _0x3d8aa0['set'](_0x421e('0x21'),_0x37a774+'-'+_0x5c3fc5+'/'+_0x475a27)['json'](_0x3f6e0c);}return null;};}function patchUpdates(_0x2c6812){return function(_0x35383b){try{jsonpatch[_0x421e('0x22')](_0x35383b,_0x2c6812,!![]);}catch(_0x4d0778){return BPromise[_0x421e('0x23')](_0x4d0778);}return _0x35383b[_0x421e('0x24')]();};}function saveUpdates(_0x5a47a4,_0x117e6a){return function(_0x10dfae){if(_0x10dfae){return _0x10dfae[_0x421e('0x25')](_0x5a47a4)[_0x421e('0x26')](function(_0x2478e1){return _0x2478e1;});}return null;};}function removeEntity(_0x2ecc0c,_0x5c9b5a){return function(_0x1f7fc9){if(_0x1f7fc9){return _0x1f7fc9['destroy']()[_0x421e('0x26')](function(){_0x2ecc0c[_0x421e('0x27')](0xcc)[_0x421e('0x28')]();});}};}function handleEntityNotFound(_0x3ab688,_0x5d9db3){return function(_0x8cff41){if(!_0x8cff41){_0x3ab688[_0x421e('0x1d')](0x194);}return _0x8cff41;};}function handleError(_0xc3b39,_0x3ae87b){_0x3ae87b=_0x3ae87b||0x1f4;return function(_0x2ae2cc){logger[_0x421e('0x29')](_0x2ae2cc[_0x421e('0x2a')]);if(_0x2ae2cc['name']){delete _0x2ae2cc[_0x421e('0x2b')];}_0xc3b39[_0x421e('0x27')](_0x3ae87b)['send'](_0x2ae2cc);};}function getInteractionUsers(_0x2fbac3,_0x54fab7){return new BPromise(function(_0x519fb6,_0x435b29){try{if(_0x54fab7[_0x2fbac3['id']]){_0x2fbac3[_0x421e('0x2c')]=_[_0x421e('0x2d')](_0x54fab7[_0x2fbac3['id']],function(_0x363e54){return{'id':_0x363e54['id'],'fullname':_0x363e54[_0x421e('0x2e')]};});}}catch(_0x1b2e13){_0x435b29(_0x1b2e13);}_0x519fb6(_0x2fbac3);});}function getInteractionTags(_0x2b2452,_0x5683b4){return new BPromise(function(_0x2fd27a,_0x3df61b){try{if(_0x2b2452[_0x421e('0x2f')]){_0x2b2452[_0x421e('0x30')]=[];_0x2b2452[_0x421e('0x2f')]['split'](',')['forEach'](function(_0x21ed16){_0x2b2452[_0x421e('0x30')][_0x421e('0x31')](_0x5683b4[_0x21ed16]);});}delete _0x2b2452[_0x421e('0x2f')];}catch(_0x4d7086){_0x3df61b(_0x4d7086);}_0x2fd27a(_0x2b2452);});}function updateFaxInteraction(_0x3ca88d,_0x44fbb5,_0x2b40e8){return new BPromise(function(_0x59b7d5,_0x3ebad9){return getInteractionUsers(_0x3ca88d,_0x2b40e8)[_0x421e('0x26')](function(_0x5d8d43){return getInteractionTags(_0x5d8d43,_0x44fbb5);})[_0x421e('0x26')](function(_0x45fa5b){_0x59b7d5(_0x45fa5b);})[_0x421e('0x32')](function(_0x14d99c){_0x3ebad9(_0x14d99c);});});}exports[_0x421e('0x33')]=function(_0x28d8d7,_0x2adcde){var _0x247879={},_0x3f7180={},_0x3da2e6={'count':0x0,'rows':[]};var _0x28a7c8=_[_0x421e('0x2d')](db[_0x421e('0x34')][_0x421e('0x35')],function(_0xc39b6f){return{'name':_0xc39b6f[_0x421e('0x36')],'type':_0xc39b6f[_0x421e('0x37')][_0x421e('0x38')]};});_0x3f7180[_0x421e('0x39')]=_[_0x421e('0x2d')](_0x28a7c8,_0x421e('0x2b'));_0x3f7180[_0x421e('0x3a')]=_[_0x421e('0x3b')](_0x28d8d7[_0x421e('0x3a')]);_0x3f7180['filters']=_[_0x421e('0x3c')](_0x3f7180['model'],_0x3f7180['query']);_0x247879[_0x421e('0x3d')]=_['intersection'](_0x3f7180[_0x421e('0x39')],qs[_0x421e('0x3e')](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3e')]));_0x247879['attributes']=_0x247879['attributes']['length']?_0x247879['attributes']:_0x3f7180[_0x421e('0x39')];if(!_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3f')](_0x421e('0x40'))){_0x247879[_0x421e('0x41')]=qs[_0x421e('0x41')](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x41')]);_0x247879['offset']=qs[_0x421e('0x1f')](_0x28d8d7[_0x421e('0x3a')]['offset']);}_0x247879[_0x421e('0x42')]=qs[_0x421e('0x43')](_0x28d8d7['query'][_0x421e('0x43')]);_0x247879['where']=qs[_0x421e('0x44')](_['pick'](_0x28d8d7[_0x421e('0x3a')],_0x3f7180['filters']),_0x28a7c8);var _0x12f45f=[];var _0x5a638b=squel[_0x421e('0x45')]()[_0x421e('0x46')]('id')['field'](_0x421e('0x2b'))[_0x421e('0x46')](_0x421e('0x47'))[_0x421e('0x48')](_0x421e('0x49'));var _0xd5e352=squel[_0x421e('0x45')]()['field']('u.id')[_0x421e('0x46')](_0x421e('0x4a'))[_0x421e('0x46')](_0x421e('0x4b'))[_0x421e('0x48')]('user_has_fax_interactions','ui')['left_join'](_0x421e('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x58e7e6=squel[_0x421e('0x45')]()[_0x421e('0x48')](_0x421e('0x4d'),'i')[_0x421e('0x4e')](_0x421e('0x4f'),'c',_0x421e('0x50'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x421e('0x4e')](_0x421e('0x51'),'a',_0x421e('0x52'))[_0x421e('0x4e')](_0x421e('0x53'),'me',_0x421e('0x54'))['left_join'](_0x421e('0x55'),'it',_0x421e('0x56'))[_0x421e('0x4e')]('tools_tags','t',_0x421e('0x57'));var _0x22c936=squel[_0x421e('0x58')]();var _0x2b424f=[];var _0x18973a=squel['expr']();var _0x1dcac3;if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x59')]){_0x1dcac3=as['parseSearch'](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x59')]);var _0x3403be=_0x1dcac3[_0x421e('0x5a')];for(var _0x5b3e1f=0x0;_0x5b3e1f<_0x1dcac3[_0x421e('0x5b')][_0x421e('0x5c')];_0x5b3e1f++){var _0x4c96b4=_0x1dcac3['conditions'][_0x5b3e1f];var _0x2b917a='i';var _0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),_0x4c96b4[_0x421e('0x46')]]);if(!_0x452c22){switch(_0x4c96b4[_0x421e('0x46')]){case'unreadMessages':if(_0x4c96b4[_0x421e('0x5e')]==0x1){_0x58e7e6['having']('`'+_0x4c96b4[_0x421e('0x46')]+'`\x20=\x200');}else{_0x58e7e6[_0x421e('0x5f')]('`'+_0x4c96b4['field']+_0x421e('0x60'));}break;case _0x421e('0x61'):if(_0x4c96b4[_0x421e('0x62')]===_0x421e('0x63')){if(_0x4c96b4[_0x421e('0x5e')][_0x421e('0x64')]('\x20')['length']>0x1){_0x22c936[_0x3403be](_0x421e('0x65'),qs['getFullTextValue'](_0x4c96b4[_0x421e('0x5e')]),null);}else{var _0x73d05e='%'+_0x4c96b4['value']+'%';_0x22c936[_0x3403be]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x73d05e,_0x73d05e,_0x73d05e);}}else{_0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),_0x421e('0x66')]);_0x4c96b4[_0x421e('0x46')]='ContactId';_0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e['text'],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e[_0x421e('0x5e')]['end']);}break;case _0x421e('0x69'):var _0x56a938=_0x4c96b4['value']['split'](',')[_0x421e('0x2d')](function(_0xc924fb){return Number(_0xc924fb);});_0x56a938[_0x421e('0x6a')](function(_0x194caf){_0x18973a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x194caf+',%');});_0x2b424f=_[_0x421e('0x6b')](_0x2b424f,_0x56a938);break;case _0x421e('0x6c'):if(_0x4c96b4['operator']===_0x421e('0x63')){_0x22c936[_0x3403be](_0x421e('0x6d'),'%'+_0x4c96b4[_0x421e('0x5e')]+'%',null);}else{_0x452c22=_[_0x421e('0x5d')](_0x28a7c8,[_0x421e('0x2b'),'UserId']);_0x4c96b4[_0x421e('0x46')]='UserId';_0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')]['start'],_0x56f95e[_0x421e('0x5e')][_0x421e('0x28')]);}break;case'body':_0x56f95e=as['buildExpression']('me',null,_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e['value']['end']);break;}}else{var _0x56f95e=as[_0x421e('0x67')](_0x2b917a,_0x452c22[_0x421e('0x37')],_0x4c96b4);_0x22c936[_0x3403be](_0x56f95e[_0x421e('0x6e')],_0x56f95e[_0x421e('0x5e')][_0x421e('0x68')],_0x56f95e['value']['end']);}}}else{var _0x4f8b54=_(_0x28d8d7[_0x421e('0x3a')])[_0x421e('0x3b')]()[_0x421e('0x2d')](function(_0x399e31){return _[_0x421e('0x6f')](_0x28a7c8,['name',_0x399e31])?_0x399e31:undefined;})[_0x421e('0x70')]()[_0x421e('0x5e')]();if(!_[_0x421e('0x71')](_0x4f8b54)){_0x4f8b54[_0x421e('0x6a')](function(_0x42f0ad){if(_0x42f0ad===_0x421e('0x72')){_0x58e7e6['where'](_0x421e('0x73'),[][_0x421e('0x74')](_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]));}else if(_0x42f0ad===_0x421e('0x75')){var _0x19fef7=JSON['parse'](_0x28d8d7['query'][_0x42f0ad])['$gte'];var _0x29178f=JSON[_0x421e('0x76')](_0x28d8d7[_0x421e('0x3a')][_0x42f0ad])[_0x421e('0x77')];_0x58e7e6[_0x421e('0x78')](_0x421e('0x79'),_0x19fef7,_0x29178f);}else{if(_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]==='null'){_0x58e7e6[_0x421e('0x78')]('i.'+_0x42f0ad+_0x421e('0x7a'));}else{_0x58e7e6[_0x421e('0x78')]('i.'+_0x42f0ad+'\x20=\x20?',_0x28d8d7[_0x421e('0x3a')][_0x42f0ad]);}}});}if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7b')]){if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7b')]==0x1){_0x58e7e6['having']('`unreadMessages`\x20=\x200');}else{_0x58e7e6[_0x421e('0x5f')](_0x421e('0x7c'));}}if(_0x28d8d7['query'][_0x421e('0x7d')]){_0x2b424f=_['isArray'](_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7d')])?_0x28d8d7[_0x421e('0x3a')][_0x421e('0x7d')]:new Array(_0x28d8d7['query'][_0x421e('0x7d')]);_0x2b424f['forEach'](function(_0xcac46){_0x18973a['or'](_0x421e('0x7e'),'%,'+_0xcac46+',%');});}if(_0x28d8d7[_0x421e('0x3a')]['filter']){var _0x4239f0=_0x28d8d7['query'][_0x421e('0x7f')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x421e('0x80')](_0x4239f0)){_0x22c936['or']('i.id\x20LIKE\x20?',_0x4239f0+'%')['or']('i.fax\x20LIKE\x20?',_0x4239f0+'%');}_0x22c936['or'](_0x421e('0x81'),_0x4239f0+'%');}}_0x58e7e6[_0x421e('0x78')](_0x22c936);_0x58e7e6[_0x421e('0x82')](_0x421e('0x83'));var _0x1bd617={'type':db[_0x421e('0x84')][_0x421e('0x85')][_0x421e('0x86')],'raw':!![]};var _0x54fd66=_0x58e7e6[_0x421e('0x87')]();_0x54fd66[_0x421e('0x46')]('i.id');_0x54fd66[_0x421e('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x421e('0x88'));if(_0x247879[_0x421e('0x42')]){_0x247879[_0x421e('0x42')][_0x421e('0x6a')](function(_0x5986d0){var _0x3a34c1=_0x5986d0[0x0]===_0x421e('0x89')?_0x5986d0[0x0]:'i.'+_0x5986d0[0x0];_0x58e7e6[_0x421e('0x42')](_0x3a34c1,_0x5986d0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2b424f)){_0x58e7e6['having'](_0x18973a);_0x54fd66[_0x421e('0x78')](_0x421e('0x8a'),_0x2b424f);}BPromise[_0x421e('0x8b')]()[_0x421e('0x26')](function(){if(!_0x1dcac3){if(_0x28d8d7['query'][_0x421e('0x72')])return;_0x54fd66[_0x421e('0x78')](_0x421e('0x8c'));_0x58e7e6[_0x421e('0x78')](_0x421e('0x8c'));return;}if(_0x28d8d7[_0x421e('0x8d')][_0x421e('0x8e')]!==_0x421e('0x8f'))return;return _0x28d8d7[_0x421e('0x8d')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x421e('0x26')](function(_0x141db4){if(_['isEmpty'](_0x141db4)){_0x54fd66[_0x421e('0x78')]('i.FaxAccountId\x20IS\x20NULL');_0x58e7e6[_0x421e('0x78')](_0x421e('0x90'));}else{_0x54fd66['where'](_0x421e('0x73'),_[_0x421e('0x2d')](_0x141db4,'id'));_0x58e7e6[_0x421e('0x78')](_0x421e('0x73'),_['map'](_0x141db4,'id'));}});})[_0x421e('0x26')](function(){if(_0x28d8d7[_0x421e('0x8d')]['role']===_0x421e('0x8f')&&!_0x1dcac3&&!_0x28d8d7[_0x421e('0x3a')]['FaxAccountId'])return[];return db[_0x421e('0x91')][_0x421e('0x3a')](_0x54fd66[_0x421e('0x92')](),_0x1bd617);})[_0x421e('0x26')](function(_0x5e3d05){_0x3da2e6[_0x421e('0x93')]=_0x5e3d05[_0x421e('0x5c')];if(_0x3da2e6[_0x421e('0x93')]===0x0)return[];return db[_0x421e('0x91')][_0x421e('0x3a')](_0x5a638b[_0x421e('0x92')](),_0x1bd617)[_0x421e('0x26')](function(_0x413c21){_0x12f45f=_[_0x421e('0x94')](_0x413c21,'id');_0x1bd617=_[_0x421e('0x95')](_0x1bd617,{'model':db[_0x421e('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x28d8d7[_0x421e('0x3a')][_0x421e('0x3e')]){_0x247879[_0x421e('0x3d')][_0x421e('0x6a')](function(_0x140a58){_0x58e7e6[_0x421e('0x46')]('i.'+_0x140a58);});}else{_0x58e7e6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x58e7e6[_0x421e('0x46')](_0x421e('0x96'),'Account.key');_0x58e7e6[_0x421e('0x46')](_0x421e('0x97'),_0x421e('0x98'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x99'),_0x421e('0x89'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x9a'));_0x58e7e6[_0x421e('0x46')]('c.firstName',_0x421e('0x9b'));_0x58e7e6[_0x421e('0x46')](_0x421e('0x9c'),_0x421e('0x9d'));_0x58e7e6[_0x421e('0x46')]('c.email',_0x421e('0x9e'));_0x58e7e6[_0x421e('0x46')]('c.phone',_0x421e('0x9f'));_0x58e7e6['field'](_0x421e('0xa0'),_0x421e('0xa1'));_0x58e7e6[_0x421e('0x46')](_0x421e('0xa2'),_0x421e('0xa3'));_0x58e7e6[_0x421e('0x46')](_0x421e('0xa4'),'Owner.fullname');_0x58e7e6['field'](_0x421e('0xa5'),'Owner.internal');_0x58e7e6['field'](_0x421e('0xa6'),_0x421e('0x2f'));}if(_0x247879[_0x421e('0x41')])_0x58e7e6[_0x421e('0x41')](_0x247879[_0x421e('0x41')]);if(_0x247879[_0x421e('0x1f')])_0x58e7e6[_0x421e('0x1f')](_0x247879[_0x421e('0x1f')]);return db['sequelize'][_0x421e('0x3a')](_0x58e7e6[_0x421e('0x92')](),_0x1bd617);})[_0x421e('0x26')](function(_0x3aa311){if(_0x3aa311[_0x421e('0x5c')]>0x0)_0xd5e352[_0x421e('0x78')]('ui.FaxInteractionId\x20IN\x20?',_[_0x421e('0x2d')](_0x3aa311,'id'));return db[_0x421e('0x91')][_0x421e('0x3a')](_0xd5e352[_0x421e('0x92')](),_0x1bd617)[_0x421e('0x26')](function(_0x40d3b8){var _0x299342=_[_0x421e('0xa7')](_0x40d3b8,_0x421e('0xa8'));var _0x4d3c4c=[];_0x3aa311[_0x421e('0x6a')](function(_0x45e728){_0x4d3c4c['push'](updateFaxInteraction(_0x45e728,_0x12f45f,_0x299342));});return BPromise[_0x421e('0xa9')](_0x4d3c4c);});});})['then'](function(_0x45b89b){_0x3da2e6['rows']=_0x45b89b;return _0x3da2e6;})[_0x421e('0x26')](respondWithFilteredResult(_0x2adcde,_0x247879))['catch'](handleError(_0x2adcde,null));};exports[_0x421e('0xaa')]=function(_0x7f55da,_0x5aefc0){var _0x1abed8={'raw':![],'where':{'id':_0x7f55da[_0x421e('0xab')]['id']}},_0x3ceb68={};_0x3ceb68[_0x421e('0x39')]=_['keys'](db[_0x421e('0x34')][_0x421e('0x35')]);_0x3ceb68[_0x421e('0x3a')]=_[_0x421e('0x3b')](_0x7f55da[_0x421e('0x3a')]);_0x3ceb68['filters']=_[_0x421e('0x3c')](_0x3ceb68[_0x421e('0x39')],_0x3ceb68[_0x421e('0x3a')]);_0x1abed8[_0x421e('0x3d')]=_['intersection'](_0x3ceb68['model'],qs['fields'](_0x7f55da['query']['fields']));_0x1abed8['attributes']=_0x1abed8['attributes']['length']?_0x1abed8[_0x421e('0x3d')]:_0x3ceb68[_0x421e('0x39')];if(_0x7f55da['query'][_0x421e('0xac')]){_0x1abed8[_0x421e('0xad')]=[{'all':!![]}];}_0x1abed8=_[_0x421e('0x95')]({},_0x1abed8,_0x7f55da[_0x421e('0xae')]);return db[_0x421e('0x34')]['find'](_0x1abed8)[_0x421e('0x26')](handleEntityNotFound(_0x5aefc0,null))[_0x421e('0x26')](respondWithResult(_0x5aefc0,null))[_0x421e('0x32')](handleError(_0x5aefc0,null));};exports[_0x421e('0xaf')]=function(_0x36feb0,_0x8b8b31){return db[_0x421e('0x34')]['create'](_0x36feb0['body'],{})['then'](respondWithResult(_0x8b8b31,0xc9))[_0x421e('0x32')](handleError(_0x8b8b31,null));};exports[_0x421e('0x25')]=function(_0x299184,_0x5cda07){if(_0x299184['body']['id']){delete _0x299184[_0x421e('0xb0')]['id'];}return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x299184[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x5cda07,null))['then'](saveUpdates(_0x299184[_0x421e('0xb0')],null))['then'](respondWithResult(_0x5cda07,null))[_0x421e('0x32')](handleError(_0x5cda07,null));};exports[_0x421e('0xb1')]=function(_0x471c4f,_0x2c4428){return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x471c4f[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x2c4428,null))[_0x421e('0x26')](removeEntity(_0x2c4428,null))['catch'](handleError(_0x2c4428,null));};exports[_0x421e('0xb2')]=function(_0x40e740,_0x23ce81){return db['FaxInteraction'][_0x421e('0xb2')]()['then'](respondWithResult(_0x23ce81,null))[_0x421e('0x32')](handleError(_0x23ce81,null));};exports[_0x421e('0xb3')]=function(_0x35a139,_0x261f9e,_0x5e3972){return db[_0x421e('0xb4')][_0x421e('0x5d')]({'where':{'id':_0x35a139[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x261f9e,null))['then'](function(_0x211113){if(_0x211113){return _0x211113[_0x421e('0xb3')](_0x35a139[_0x421e('0xb0')][_0x421e('0xb5')],_[_0x421e('0xb6')](_0x35a139['body'],[_0x421e('0xb5'),'id'])||{});}})[_0x421e('0x26')](respondWithResult(_0x261f9e,null))['catch'](handleError(_0x261f9e,null));};exports[_0x421e('0xb7')]=function(_0x10328b,_0x420c6a,_0x1b9a4a){var _0x2ed34b={'raw':![],'where':{}};var _0x529b24={};var _0x31c8b5={'count':0x0,'rows':[]};return db[_0x421e('0x34')][_0x421e('0xb8')]({'where':{'id':_0x10328b[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x420c6a,null))[_0x421e('0x26')](function(_0x31b8ba){if(_0x31b8ba){_0x529b24[_0x421e('0x39')]=_['keys'](db[_0x421e('0xb4')][_0x421e('0x35')]);_0x529b24['query']=_['keys'](_0x10328b[_0x421e('0x3a')]);_0x529b24['filters']=_[_0x421e('0x3c')](_0x529b24[_0x421e('0x39')],_0x529b24[_0x421e('0x3a')]);_0x2ed34b['attributes']=_['intersection'](_0x529b24[_0x421e('0x39')],qs[_0x421e('0x3e')](_0x10328b[_0x421e('0x3a')][_0x421e('0x3e')]));_0x2ed34b[_0x421e('0x3d')]=_0x2ed34b['attributes'][_0x421e('0x5c')]?_0x2ed34b['attributes']:_0x529b24[_0x421e('0x39')];if(!_0x10328b[_0x421e('0x3a')][_0x421e('0x3f')](_0x421e('0x40'))){_0x2ed34b['limit']=qs[_0x421e('0x41')](_0x10328b[_0x421e('0x3a')][_0x421e('0x41')]);_0x2ed34b[_0x421e('0x1f')]=qs[_0x421e('0x1f')](_0x10328b[_0x421e('0x3a')][_0x421e('0x1f')]);}_0x2ed34b['order']=qs[_0x421e('0x43')](_0x10328b[_0x421e('0x3a')][_0x421e('0x43')]);_0x2ed34b[_0x421e('0x78')]=qs[_0x421e('0x44')](_[_0x421e('0xb9')](_0x10328b['query'],_0x529b24[_0x421e('0x44')]));_0x2ed34b['where'][_0x421e('0xa8')]=_0x31b8ba['id'];if(_0x10328b[_0x421e('0x3a')]['filter']){_0x2ed34b[_0x421e('0x78')]=_[_0x421e('0x95')](_0x2ed34b[_0x421e('0x78')],{'$or':_['map'](_0x2ed34b[_0x421e('0x3d')],function(_0x2cf0de){var _0x45ed09={};_0x45ed09[_0x2cf0de]={'$like':'%'+_0x10328b[_0x421e('0x3a')]['filter']+'%'};return _0x45ed09;})});}if(_0x10328b[_0x421e('0x3a')][_0x421e('0xba')]){var _0x5091ab=_0x10328b[_0x421e('0x3a')][_0x421e('0xba')][_0x421e('0x64')](',');var _0x1a551e={};_0x1a551e[_0x5091ab[0x0]]={'$gte':moment(_0x5091ab[0x1])[_0x421e('0xbb')](_0x421e('0xbc'))};_0x2ed34b[_0x421e('0x78')]=_[_0x421e('0x95')](_0x2ed34b[_0x421e('0x78')],_0x1a551e);}_0x2ed34b=_['merge']({},_0x2ed34b,_0x10328b[_0x421e('0xae')]);return db[_0x421e('0xb4')]['count']({'where':_0x2ed34b['where']})['then'](function(_0x39441c){_0x31c8b5[_0x421e('0x93')]=_0x39441c;if(_0x10328b[_0x421e('0x3a')][_0x421e('0xac')]){_0x2ed34b['include']=[{'all':!![]}];}return db['FaxMessage'][_0x421e('0xbd')](_0x2ed34b);})[_0x421e('0x26')](function(_0x2a5b35){_0x31c8b5[_0x421e('0xbe')]=_0x2a5b35;return _0x31c8b5;});}})['then'](respondWithFilteredResult(_0x420c6a,_0x2ed34b))[_0x421e('0x32')](handleError(_0x420c6a,null));};exports[_0x421e('0xbf')]=function(_0x24eed3,_0x9a36cc,_0x23b04f){return db[_0x421e('0x34')][_0x421e('0x5d')]({'where':{'id':_0x24eed3[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0x9a36cc,null))[_0x421e('0x26')](function(_0x576681){if(_0x576681){return _0x576681['setTags'](_0x24eed3[_0x421e('0xb0')]['ids'],_[_0x421e('0xb6')](_0x24eed3[_0x421e('0xb0')],['ids','id'])||{})[_0x421e('0xc0')](function(){return db[_0x421e('0x69')][_0x421e('0xbd')]({'attributes':['id',_0x421e('0x2b'),'color'],'where':{'id':_0x24eed3[_0x421e('0xb0')][_0x421e('0xb5')]}});})[_0x421e('0x26')](function(_0x31d550){socket[_0x421e('0xc1')](_0x421e('0xc2'),{'id':Number(_0x24eed3[_0x421e('0xab')]['id']),'tags':_0x31d550||[]});return{'id':Number(_0x24eed3[_0x421e('0xab')]['id']),'tags':_0x31d550||[]};});}})[_0x421e('0x26')](respondWithResult(_0x9a36cc,null))[_0x421e('0x32')](handleError(_0x9a36cc,null));};exports[_0x421e('0xc3')]=function(_0x368e47,_0xc48bfa,_0x2f5803){return db['FaxInteraction'][_0x421e('0x5d')]({'where':{'id':_0x368e47[_0x421e('0xab')]['id']}})[_0x421e('0x26')](handleEntityNotFound(_0xc48bfa,null))[_0x421e('0x26')](function(_0x26ae53){if(_0x26ae53){return _0x26ae53[_0x421e('0xc3')](_0x368e47[_0x421e('0x3a')][_0x421e('0xb5')]);}})[_0x421e('0x26')](respondWithStatusCode(_0xc48bfa,null))[_0x421e('0x32')](handleError(_0xc48bfa,null));};exports['download']=function(_0x1988e7,_0x7a5bf9){var _0x459639=moment()[_0x421e('0xc4')]()[_0x421e('0x92')]();var _0x448e49=path['join'](config['root'],_0x421e('0xc5'),'files','tmp');var _0xdfe9c0=path[_0x421e('0xc6')](config[_0x421e('0xc7')],'server','files',_0x421e('0xc8'));var _0xceaa35=path['join'](_0x448e49,_0x459639);var _0x4b32f3=util['format'](_0x421e('0xc9'),_0x1988e7[_0x421e('0xab')]['id'],_0x459639);var _0x2ae3a9=path['join'](_0x448e49,_0x4b32f3);var _0x407f56=[];_0x407f56[_0x421e('0x31')]({'model':db['Attachment'],'as':_0x421e('0xca'),'raw':!![]});var _0x1f2613=[{'model':db[_0x421e('0xb4')],'as':_0x421e('0xcb'),'attributes':['id','body','createdAt'],'include':_0x407f56}];return db[_0x421e('0x34')]['find']({'where':{'id':_0x1988e7[_0x421e('0xab')]['id']},'include':_0x1f2613})[_0x421e('0x26')](handleEntityNotFound(_0x7a5bf9,null))[_0x421e('0x26')](function(_0x2c9784){if(_0x2c9784&&_0x2c9784['Messages']){var _0x78a8a6=_0x2c9784['get']({'plain':!![]});fs[_0x421e('0xcc')](_0xceaa35);for(var _0x5b268d=0x0;_0x5b268d<_0x78a8a6[_0x421e('0xcb')][_0x421e('0x5c')];_0x5b268d++){var _0x5e6464=_0x78a8a6[_0x421e('0xcb')][_0x5b268d][_0x421e('0xca')];if(_0x5e6464){var _0x4c71d0=path['join'](_0xdfe9c0,_0x5e6464[_0x421e('0xcd')]);if(fs[_0x421e('0xce')](_0x4c71d0)){fs['createReadStream'](_0x4c71d0)['pipe'](fs[_0x421e('0xcf')](path[_0x421e('0xc6')](_0xceaa35,_0x5e6464[_0x421e('0xcd')])));}}}return BPromise[_0x421e('0x8b')]()[_0x421e('0x26')](function(){return new BPromise(function(_0xbac39a,_0x4adf77){zipdir(_0xceaa35,{'saveTo':_0x2ae3a9},function(_0x58ffce,_0x4725d6){if(_0x58ffce)return _0x4adf77(_0x58ffce);return _0xbac39a(_0x4725d6);});})[_0x421e('0x26')](function(){return new BPromise(function(_0x58c527,_0x13019c){rimraf(_0xceaa35,function(_0x223890){if(_0x223890)_0x13019c(_0x223890);return _0x58c527();});});})['then'](function(){return _0x7a5bf9[_0x421e('0xd0')](_0x2ae3a9,_0x4b32f3,function(_0x5339be){if(_0x5339be){console[_0x421e('0xd1')](_0x421e('0xd2'),_0x5339be);}else{fs[_0x421e('0xd3')](_0x2ae3a9);}});});});}else{return _0x7a5bf9[_0x421e('0x1d')](0xc8);}})[_0x421e('0x32')](handleError(_0x7a5bf9,null));}; \ No newline at end of file +var _0x0f09=['rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','end','error','name','send','Users','map','fullname','Tags','TagIds','split','push','index','FaxInteraction','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','show','params','includeAll','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','Attachment','Messages','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err'];(function(_0x880b91,_0x2c2d20){var _0x46faaf=function(_0x39c3cf){while(--_0x39c3cf){_0x880b91['push'](_0x880b91['shift']());}};_0x46faaf(++_0x2c2d20);}(_0x0f09,0x1ac));var _0x90f0=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0f09[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90f0('0x0'));var zipdir=require(_0x90f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f0('0x2'));var moment=require(_0x90f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x90f0('0x4'));var util=require('util');var path=require(_0x90f0('0x5'));var sox=require(_0x90f0('0x6'));var csv=require(_0x90f0('0x7'));var ejs=require(_0x90f0('0x8'));var fs=require('fs');var fs_extra=require(_0x90f0('0x9'));var _=require('lodash');var squel=require(_0x90f0('0xa'));var crypto=require(_0x90f0('0xb'));var jsforce=require(_0x90f0('0xc'));var deskjs=require(_0x90f0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x90f0('0xe'));var Papa=require(_0x90f0('0xf'));var Redis=require(_0x90f0('0x10'));var authService=require(_0x90f0('0x11'));var qs=require(_0x90f0('0x12'));var as=require(_0x90f0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90f0('0x14'))(_0x90f0('0x15'));var utils=require(_0x90f0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x90f0('0x17')]=_[_0x90f0('0x18')](config['redis'],{'host':_0x90f0('0x19'),'port':0x18eb});var socket=require(_0x90f0('0x1a'))(new Redis(config[_0x90f0('0x17')]));require(_0x90f0('0x1b'))['register'](socket);function respondWithStatusCode(_0x5a904b,_0x53b4f3){_0x53b4f3=_0x53b4f3||0xcc;return function(_0x2278f9){if(_0x2278f9){return _0x5a904b[_0x90f0('0x1c')](_0x53b4f3);}return _0x5a904b[_0x90f0('0x1d')](_0x53b4f3)['end']();};}function respondWithResult(_0x1d6f89,_0x4105a7){_0x4105a7=_0x4105a7||0xc8;return function(_0x752915){if(_0x752915){return _0x1d6f89[_0x90f0('0x1d')](_0x4105a7)['json'](_0x752915);}};}function respondWithFilteredResult(_0x87962c,_0x793942){return function(_0x1fc051){if(_0x1fc051){var _0x537c2e=typeof _0x793942[_0x90f0('0x1e')]===_0x90f0('0x1f')&&typeof _0x793942[_0x90f0('0x20')]==='undefined';var _0x565ebe=_0x1fc051[_0x90f0('0x21')];var _0x2742f1=_0x537c2e?0x0:_0x793942[_0x90f0('0x1e')];var _0x14f58e=_0x537c2e?_0x1fc051['count']:_0x793942[_0x90f0('0x1e')]+_0x793942[_0x90f0('0x20')];var _0x5d9b76;if(_0x14f58e>=_0x565ebe){_0x14f58e=_0x565ebe;_0x5d9b76=0xc8;}else{_0x5d9b76=0xce;}_0x87962c[_0x90f0('0x1d')](_0x5d9b76);return _0x87962c[_0x90f0('0x22')]('Content-Range',_0x2742f1+'-'+_0x14f58e+'/'+_0x565ebe)[_0x90f0('0x23')](_0x1fc051);}return null;};}function patchUpdates(_0x17feb9){return function(_0x376adb){try{jsonpatch[_0x90f0('0x24')](_0x376adb,_0x17feb9,!![]);}catch(_0x1765ee){return BPromise[_0x90f0('0x25')](_0x1765ee);}return _0x376adb[_0x90f0('0x26')]();};}function saveUpdates(_0x278014,_0x40642b){return function(_0x59cc40){if(_0x59cc40){return _0x59cc40[_0x90f0('0x27')](_0x278014)['then'](function(_0x3a99cf){return _0x3a99cf;});}return null;};}function removeEntity(_0x5d157a,_0x219c73){return function(_0x503264){if(_0x503264){return _0x503264['destroy']()[_0x90f0('0x28')](function(){_0x5d157a[_0x90f0('0x1d')](0xcc)[_0x90f0('0x29')]();});}};}function handleEntityNotFound(_0x846e8c,_0x1c792e){return function(_0x4fe2ea){if(!_0x4fe2ea){_0x846e8c[_0x90f0('0x1c')](0x194);}return _0x4fe2ea;};}function handleError(_0x40cc01,_0x28c348){_0x28c348=_0x28c348||0x1f4;return function(_0x46176d){logger[_0x90f0('0x2a')](_0x46176d['stack']);if(_0x46176d[_0x90f0('0x2b')]){delete _0x46176d[_0x90f0('0x2b')];}_0x40cc01[_0x90f0('0x1d')](_0x28c348)[_0x90f0('0x2c')](_0x46176d);};}function getInteractionUsers(_0xe302e9,_0x4ce9e4){return new BPromise(function(_0x594022,_0x5e812c){try{if(_0x4ce9e4[_0xe302e9['id']]){_0xe302e9[_0x90f0('0x2d')]=_[_0x90f0('0x2e')](_0x4ce9e4[_0xe302e9['id']],function(_0x4f9a01){return{'id':_0x4f9a01['id'],'fullname':_0x4f9a01[_0x90f0('0x2f')]};});}}catch(_0x19c212){_0x5e812c(_0x19c212);}_0x594022(_0xe302e9);});}function getInteractionTags(_0x1a3183,_0x357297){return new BPromise(function(_0x5da5c3,_0x432aee){try{if(_0x1a3183['TagIds']){_0x1a3183[_0x90f0('0x30')]=[];_0x1a3183[_0x90f0('0x31')][_0x90f0('0x32')](',')['forEach'](function(_0x405169){_0x1a3183[_0x90f0('0x30')][_0x90f0('0x33')](_0x357297[_0x405169]);});}delete _0x1a3183['TagIds'];}catch(_0xc148f){_0x432aee(_0xc148f);}_0x5da5c3(_0x1a3183);});}function updateFaxInteraction(_0x508756,_0x464818,_0x3d783b){return new BPromise(function(_0x2ad71f,_0x193ed2){return getInteractionUsers(_0x508756,_0x3d783b)[_0x90f0('0x28')](function(_0x5d4e16){return getInteractionTags(_0x5d4e16,_0x464818);})[_0x90f0('0x28')](function(_0xccdbd3){_0x2ad71f(_0xccdbd3);})['catch'](function(_0x2d6078){_0x193ed2(_0x2d6078);});});}exports[_0x90f0('0x34')]=function(_0x5e7263,_0x166f7d){var _0x8995e4={},_0x1125d1={},_0x8bee83={'count':0x0,'rows':[]};var _0x3c0689=_[_0x90f0('0x2e')](db[_0x90f0('0x35')][_0x90f0('0x36')],function(_0x2847b4){return{'name':_0x2847b4[_0x90f0('0x37')],'type':_0x2847b4['type']['key']};});_0x1125d1['model']=_[_0x90f0('0x2e')](_0x3c0689,'name');_0x1125d1[_0x90f0('0x38')]=_[_0x90f0('0x39')](_0x5e7263[_0x90f0('0x38')]);_0x1125d1[_0x90f0('0x3a')]=_[_0x90f0('0x3b')](_0x1125d1['model'],_0x1125d1[_0x90f0('0x38')]);_0x8995e4[_0x90f0('0x3c')]=_[_0x90f0('0x3b')](_0x1125d1[_0x90f0('0x3d')],qs[_0x90f0('0x3e')](_0x5e7263[_0x90f0('0x38')][_0x90f0('0x3e')]));_0x8995e4[_0x90f0('0x3c')]=_0x8995e4[_0x90f0('0x3c')][_0x90f0('0x3f')]?_0x8995e4[_0x90f0('0x3c')]:_0x1125d1[_0x90f0('0x3d')];if(!_0x5e7263['query'][_0x90f0('0x40')](_0x90f0('0x41'))){_0x8995e4[_0x90f0('0x20')]=qs[_0x90f0('0x20')](_0x5e7263['query'][_0x90f0('0x20')]);_0x8995e4[_0x90f0('0x1e')]=qs[_0x90f0('0x1e')](_0x5e7263[_0x90f0('0x38')][_0x90f0('0x1e')]);}_0x8995e4[_0x90f0('0x42')]=qs[_0x90f0('0x43')](_0x5e7263[_0x90f0('0x38')][_0x90f0('0x43')]);_0x8995e4[_0x90f0('0x44')]=qs['filters'](_[_0x90f0('0x45')](_0x5e7263[_0x90f0('0x38')],_0x1125d1[_0x90f0('0x3a')]),_0x3c0689);var _0x5c9b18=[];var _0x974c6a=squel[_0x90f0('0x46')]()[_0x90f0('0x47')]('id')[_0x90f0('0x47')]('name')[_0x90f0('0x47')]('color')[_0x90f0('0x48')](_0x90f0('0x49'));var _0x1045e7=squel[_0x90f0('0x46')]()[_0x90f0('0x47')]('u.id')['field'](_0x90f0('0x4a'))['field'](_0x90f0('0x4b'))[_0x90f0('0x48')]('user_has_fax_interactions','ui')[_0x90f0('0x4c')](_0x90f0('0x4d'),'u',_0x90f0('0x4e'));var _0x2f6b6b=squel[_0x90f0('0x46')]()[_0x90f0('0x48')](_0x90f0('0x4f'),'i')['left_join'](_0x90f0('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x90f0('0x4c')](_0x90f0('0x4d'),'o',_0x90f0('0x51'))['left_join']('fax_accounts','a',_0x90f0('0x52'))[_0x90f0('0x4c')](_0x90f0('0x53'),'me',_0x90f0('0x54'))[_0x90f0('0x4c')](_0x90f0('0x55'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x90f0('0x4c')](_0x90f0('0x49'),'t','t.id\x20=\x20it.TagId');var _0x43f1ae=squel[_0x90f0('0x56')]();var _0x505305=[];var _0xb91b57=squel[_0x90f0('0x56')]();var _0xf9dc5c;if(_0x5e7263['query'][_0x90f0('0x57')]){_0xf9dc5c=as[_0x90f0('0x58')](_0x5e7263[_0x90f0('0x38')][_0x90f0('0x57')]);var _0x2b8b4b=_0xf9dc5c[_0x90f0('0x59')];for(var _0x3fb462=0x0;_0x3fb462<_0xf9dc5c['conditions'][_0x90f0('0x3f')];_0x3fb462++){var _0x573566=_0xf9dc5c[_0x90f0('0x5a')][_0x3fb462];var _0x136007='i';var _0x4c4035=_[_0x90f0('0x5b')](_0x3c0689,[_0x90f0('0x2b'),_0x573566['field']]);if(!_0x4c4035){switch(_0x573566[_0x90f0('0x47')]){case _0x90f0('0x5c'):if(_0x573566[_0x90f0('0x5d')]==0x1){_0x2f6b6b['having']('`'+_0x573566['field']+_0x90f0('0x5e'));}else{_0x2f6b6b[_0x90f0('0x5f')]('`'+_0x573566['field']+'`\x20>\x200');}break;case'Contact':if(_0x573566[_0x90f0('0x60')]===_0x90f0('0x61')){if(_0x573566['value']['split']('\x20')[_0x90f0('0x3f')]>0x1){_0x43f1ae[_0x2b8b4b](_0x90f0('0x62'),qs[_0x90f0('0x63')](_0x573566[_0x90f0('0x5d')]),null);}else{var _0x15d108='%'+_0x573566[_0x90f0('0x5d')]+'%';_0x43f1ae[_0x2b8b4b](_0x90f0('0x64'),_0x15d108,_0x15d108,_0x15d108);}}else{_0x4c4035=_[_0x90f0('0x5b')](_0x3c0689,[_0x90f0('0x2b'),'ContactId']);_0x573566[_0x90f0('0x47')]=_0x90f0('0x65');_0x5ccf1d=as[_0x90f0('0x66')](_0x136007,_0x4c4035[_0x90f0('0x67')],_0x573566);_0x43f1ae[_0x2b8b4b](_0x5ccf1d[_0x90f0('0x68')],_0x5ccf1d['value'][_0x90f0('0x69')],_0x5ccf1d['value'][_0x90f0('0x29')]);}break;case _0x90f0('0x6a'):var _0x776f52=_0x573566[_0x90f0('0x5d')]['split'](',')[_0x90f0('0x2e')](function(_0xa7b812){return Number(_0xa7b812);});_0x776f52[_0x90f0('0x6b')](function(_0x23acf7){_0xb91b57['or'](_0x90f0('0x6c'),'%,'+_0x23acf7+',%');});_0x505305=_[_0x90f0('0x6d')](_0x505305,_0x776f52);break;case _0x90f0('0x6e'):if(_0x573566[_0x90f0('0x60')]==='$substring'){_0x43f1ae[_0x2b8b4b](_0x90f0('0x6f'),'%'+_0x573566['value']+'%',null);}else{_0x4c4035=_[_0x90f0('0x5b')](_0x3c0689,[_0x90f0('0x2b'),'UserId']);_0x573566[_0x90f0('0x47')]=_0x90f0('0x70');_0x5ccf1d=as[_0x90f0('0x66')](_0x136007,_0x4c4035[_0x90f0('0x67')],_0x573566);_0x43f1ae[_0x2b8b4b](_0x5ccf1d[_0x90f0('0x68')],_0x5ccf1d['value']['start'],_0x5ccf1d[_0x90f0('0x5d')][_0x90f0('0x29')]);}break;case _0x90f0('0x71'):_0x5ccf1d=as[_0x90f0('0x66')]('me',null,_0x573566);_0x43f1ae[_0x2b8b4b](_0x5ccf1d[_0x90f0('0x68')],_0x5ccf1d[_0x90f0('0x5d')][_0x90f0('0x69')],_0x5ccf1d['value'][_0x90f0('0x29')]);break;}}else{var _0x5ccf1d=as[_0x90f0('0x66')](_0x136007,_0x4c4035[_0x90f0('0x67')],_0x573566);_0x43f1ae[_0x2b8b4b](_0x5ccf1d[_0x90f0('0x68')],_0x5ccf1d[_0x90f0('0x5d')]['start'],_0x5ccf1d[_0x90f0('0x5d')]['end']);}}}else{var _0x2b8e95=_(_0x5e7263[_0x90f0('0x38')])[_0x90f0('0x39')]()[_0x90f0('0x2e')](function(_0x415045){return _['some'](_0x3c0689,[_0x90f0('0x2b'),_0x415045])?_0x415045:undefined;})['compact']()[_0x90f0('0x5d')]();if(!_[_0x90f0('0x72')](_0x2b8e95)){_0x2b8e95[_0x90f0('0x6b')](function(_0x5323ae){if(_0x5323ae==='FaxAccountId'){_0x2f6b6b['where'](_0x90f0('0x73'),[][_0x90f0('0x74')](_0x5e7263[_0x90f0('0x38')][_0x5323ae]));}else if(_0x5323ae===_0x90f0('0x75')){var _0x145211=JSON[_0x90f0('0x76')](_0x5e7263[_0x90f0('0x38')][_0x5323ae])[_0x90f0('0x77')];var _0x31a201=JSON['parse'](_0x5e7263['query'][_0x5323ae])['$lte'];_0x2f6b6b[_0x90f0('0x44')](_0x90f0('0x78'),_0x145211,_0x31a201);}else{if(_0x5e7263[_0x90f0('0x38')][_0x5323ae]===_0x90f0('0x79')){_0x2f6b6b[_0x90f0('0x44')]('i.'+_0x5323ae+_0x90f0('0x7a'));}else{_0x2f6b6b[_0x90f0('0x44')]('i.'+_0x5323ae+_0x90f0('0x7b'),_0x5e7263[_0x90f0('0x38')][_0x5323ae]);}}});}if(_0x5e7263[_0x90f0('0x38')][_0x90f0('0x7c')]){if(_0x5e7263[_0x90f0('0x38')][_0x90f0('0x7c')]==0x1){_0x2f6b6b[_0x90f0('0x5f')](_0x90f0('0x7d'));}else{_0x2f6b6b[_0x90f0('0x5f')](_0x90f0('0x7e'));}}if(_0x5e7263['query'][_0x90f0('0x7f')]){_0x505305=_['isArray'](_0x5e7263[_0x90f0('0x38')][_0x90f0('0x7f')])?_0x5e7263[_0x90f0('0x38')][_0x90f0('0x7f')]:new Array(_0x5e7263[_0x90f0('0x38')][_0x90f0('0x7f')]);_0x505305[_0x90f0('0x6b')](function(_0x5884ec){_0xb91b57['or'](_0x90f0('0x6c'),'%,'+_0x5884ec+',%');});}if(_0x5e7263['query']['filter']){var _0x46a810=_0x5e7263[_0x90f0('0x38')][_0x90f0('0x80')][_0x90f0('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x46a810)){_0x43f1ae['or'](_0x90f0('0x82'),_0x46a810+'%')['or'](_0x90f0('0x83'),_0x46a810+'%');}_0x43f1ae['or'](_0x90f0('0x84'),_0x46a810+'%');}}_0x2f6b6b[_0x90f0('0x44')](_0x43f1ae);_0x2f6b6b[_0x90f0('0x85')](_0x90f0('0x86'));var _0xc6b688={'type':db[_0x90f0('0x87')][_0x90f0('0x88')][_0x90f0('0x89')],'raw':!![]};var _0x505d3c=_0x2f6b6b[_0x90f0('0x8a')]();_0x505d3c[_0x90f0('0x47')]('i.id');_0x505d3c[_0x90f0('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x8995e4[_0x90f0('0x42')]){_0x8995e4[_0x90f0('0x42')][_0x90f0('0x6b')](function(_0x227eb8){var _0x2ddf0e=_0x227eb8[0x0]===_0x90f0('0x8b')?_0x227eb8[0x0]:'i.'+_0x227eb8[0x0];_0x2f6b6b['order'](_0x2ddf0e,_0x227eb8[0x1]===_0x90f0('0x8c')?![]:!![]);});}if(!_[_0x90f0('0x72')](_0x505305)){_0x2f6b6b['having'](_0xb91b57);_0x505d3c[_0x90f0('0x44')](_0x90f0('0x8d'),_0x505305);}BPromise['resolve']()['then'](function(){if(!_0xf9dc5c){if(_0x5e7263['query'][_0x90f0('0x8e')])return;_0x505d3c[_0x90f0('0x44')](_0x90f0('0x8f'));_0x2f6b6b['where'](_0x90f0('0x8f'));return;}if(_0x5e7263[_0x90f0('0x90')][_0x90f0('0x91')]!==_0x90f0('0x92'))return;return _0x5e7263['user'][_0x90f0('0x93')]({'attributes':['id'],'raw':!![]})[_0x90f0('0x28')](function(_0x2ebbf4){if(_[_0x90f0('0x72')](_0x2ebbf4)){_0x505d3c['where'](_0x90f0('0x94'));_0x2f6b6b[_0x90f0('0x44')](_0x90f0('0x94'));}else{_0x505d3c['where'](_0x90f0('0x73'),_[_0x90f0('0x2e')](_0x2ebbf4,'id'));_0x2f6b6b[_0x90f0('0x44')](_0x90f0('0x73'),_[_0x90f0('0x2e')](_0x2ebbf4,'id'));}});})[_0x90f0('0x28')](function(){if(_0x5e7263[_0x90f0('0x90')][_0x90f0('0x91')]===_0x90f0('0x92')&&!_0xf9dc5c&&!_0x5e7263['query'][_0x90f0('0x8e')])return[];return db[_0x90f0('0x95')][_0x90f0('0x38')](_0x505d3c[_0x90f0('0x96')](),_0xc6b688);})['then'](function(_0x5a04df){_0x8bee83['count']=_0x5a04df[_0x90f0('0x3f')];if(_0x8bee83[_0x90f0('0x21')]===0x0)return[];return db['sequelize']['query'](_0x974c6a['toString'](),_0xc6b688)['then'](function(_0x5d86d0){_0x5c9b18=_[_0x90f0('0x97')](_0x5d86d0,'id');_0xc6b688=_[_0x90f0('0x98')](_0xc6b688,{'model':db[_0x90f0('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e7263[_0x90f0('0x38')][_0x90f0('0x3e')]){_0x8995e4[_0x90f0('0x3c')][_0x90f0('0x6b')](function(_0x54876b){_0x2f6b6b['field']('i.'+_0x54876b);});}else{_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0x99'),'unreadMessages');_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0x9a'),_0x90f0('0x9b'));_0x2f6b6b['field']('a.mandatoryDisposition',_0x90f0('0x9c'));_0x2f6b6b[_0x90f0('0x47')]('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',_0x90f0('0x8b'));_0x2f6b6b[_0x90f0('0x47')]('i.*');_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0x9d'),_0x90f0('0x9e'));_0x2f6b6b['field'](_0x90f0('0x9f'),_0x90f0('0xa0'));_0x2f6b6b['field'](_0x90f0('0xa1'),_0x90f0('0xa2'));_0x2f6b6b[_0x90f0('0x47')]('c.phone',_0x90f0('0xa3'));_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0xa4'),_0x90f0('0xa5'));_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0xa6'),'Contact.fax');_0x2f6b6b['field']('o.fullname',_0x90f0('0xa7'));_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0xa8'),_0x90f0('0xa9'));_0x2f6b6b[_0x90f0('0x47')](_0x90f0('0xaa'),_0x90f0('0x31'));}if(_0x8995e4[_0x90f0('0x20')])_0x2f6b6b[_0x90f0('0x20')](_0x8995e4[_0x90f0('0x20')]);if(_0x8995e4[_0x90f0('0x1e')])_0x2f6b6b[_0x90f0('0x1e')](_0x8995e4[_0x90f0('0x1e')]);return db[_0x90f0('0x95')][_0x90f0('0x38')](_0x2f6b6b[_0x90f0('0x96')](),_0xc6b688);})[_0x90f0('0x28')](function(_0x56ea4e){if(_0x56ea4e['length']>0x0)_0x1045e7[_0x90f0('0x44')](_0x90f0('0xab'),_['map'](_0x56ea4e,'id'));return db[_0x90f0('0x95')][_0x90f0('0x38')](_0x1045e7[_0x90f0('0x96')](),_0xc6b688)[_0x90f0('0x28')](function(_0x242bd3){var _0x1bbd22=_[_0x90f0('0xac')](_0x242bd3,_0x90f0('0xad'));var _0x229ab0=[];_0x56ea4e['forEach'](function(_0x575cec){_0x229ab0['push'](updateFaxInteraction(_0x575cec,_0x5c9b18,_0x1bbd22));});return BPromise[_0x90f0('0xae')](_0x229ab0);});});})[_0x90f0('0x28')](function(_0x1ae1c4){_0x8bee83[_0x90f0('0xaf')]=_0x1ae1c4;return _0x8bee83;})[_0x90f0('0x28')](respondWithFilteredResult(_0x166f7d,_0x8995e4))[_0x90f0('0xb0')](handleError(_0x166f7d,null));};exports[_0x90f0('0xb1')]=function(_0x5ed69f,_0x298d1a){var _0x5d6aee={'raw':![],'where':{'id':_0x5ed69f[_0x90f0('0xb2')]['id']}},_0x25f1e6={};_0x25f1e6[_0x90f0('0x3d')]=_[_0x90f0('0x39')](db['FaxInteraction']['rawAttributes']);_0x25f1e6[_0x90f0('0x38')]=_[_0x90f0('0x39')](_0x5ed69f[_0x90f0('0x38')]);_0x25f1e6['filters']=_[_0x90f0('0x3b')](_0x25f1e6[_0x90f0('0x3d')],_0x25f1e6['query']);_0x5d6aee[_0x90f0('0x3c')]=_[_0x90f0('0x3b')](_0x25f1e6['model'],qs['fields'](_0x5ed69f[_0x90f0('0x38')]['fields']));_0x5d6aee[_0x90f0('0x3c')]=_0x5d6aee[_0x90f0('0x3c')][_0x90f0('0x3f')]?_0x5d6aee[_0x90f0('0x3c')]:_0x25f1e6[_0x90f0('0x3d')];if(_0x5ed69f[_0x90f0('0x38')][_0x90f0('0xb3')]){_0x5d6aee[_0x90f0('0xb4')]=[{'all':!![]}];}_0x5d6aee=_[_0x90f0('0x98')]({},_0x5d6aee,_0x5ed69f[_0x90f0('0xb5')]);return db[_0x90f0('0x35')][_0x90f0('0x5b')](_0x5d6aee)[_0x90f0('0x28')](handleEntityNotFound(_0x298d1a,null))[_0x90f0('0x28')](respondWithResult(_0x298d1a,null))[_0x90f0('0xb0')](handleError(_0x298d1a,null));};exports[_0x90f0('0xb6')]=function(_0x712ffe,_0x3f71cd){return db[_0x90f0('0x35')][_0x90f0('0xb6')](_0x712ffe[_0x90f0('0x71')],{})[_0x90f0('0x28')](respondWithResult(_0x3f71cd,0xc9))[_0x90f0('0xb0')](handleError(_0x3f71cd,null));};exports['update']=function(_0x17724f,_0x175696){if(_0x17724f['body']['id']){delete _0x17724f['body']['id'];}return db['FaxInteraction'][_0x90f0('0x5b')]({'where':{'id':_0x17724f[_0x90f0('0xb2')]['id']}})[_0x90f0('0x28')](handleEntityNotFound(_0x175696,null))[_0x90f0('0x28')](saveUpdates(_0x17724f[_0x90f0('0x71')],null))[_0x90f0('0x28')](respondWithResult(_0x175696,null))['catch'](handleError(_0x175696,null));};exports[_0x90f0('0xb7')]=function(_0x227c35,_0x1978eb){return db[_0x90f0('0x35')][_0x90f0('0x5b')]({'where':{'id':_0x227c35[_0x90f0('0xb2')]['id']}})['then'](handleEntityNotFound(_0x1978eb,null))[_0x90f0('0x28')](removeEntity(_0x1978eb,null))[_0x90f0('0xb0')](handleError(_0x1978eb,null));};exports[_0x90f0('0xb8')]=function(_0x321f73,_0x35329d){return db[_0x90f0('0x35')][_0x90f0('0xb8')]()[_0x90f0('0x28')](respondWithResult(_0x35329d,null))[_0x90f0('0xb0')](handleError(_0x35329d,null));};exports[_0x90f0('0xb9')]=function(_0x2749ff,_0x42dfaf,_0x2e3c46){return db[_0x90f0('0xba')][_0x90f0('0x5b')]({'where':{'id':_0x2749ff[_0x90f0('0xb2')]['id']}})['then'](handleEntityNotFound(_0x42dfaf,null))[_0x90f0('0x28')](function(_0xd66574){if(_0xd66574){return _0xd66574[_0x90f0('0xb9')](_0x2749ff[_0x90f0('0x71')][_0x90f0('0xbb')],_[_0x90f0('0xbc')](_0x2749ff['body'],[_0x90f0('0xbb'),'id'])||{});}})[_0x90f0('0x28')](respondWithResult(_0x42dfaf,null))[_0x90f0('0xb0')](handleError(_0x42dfaf,null));};exports[_0x90f0('0xbd')]=function(_0x594d13,_0x1c0914,_0x4aa779){var _0x18d3a4={'raw':![],'where':{}};var _0x45e158={};var _0x5b491a={'count':0x0,'rows':[]};return db[_0x90f0('0x35')]['findOne']({'where':{'id':_0x594d13[_0x90f0('0xb2')]['id']}})[_0x90f0('0x28')](handleEntityNotFound(_0x1c0914,null))[_0x90f0('0x28')](function(_0xdd9111){if(_0xdd9111){_0x45e158[_0x90f0('0x3d')]=_[_0x90f0('0x39')](db[_0x90f0('0xba')][_0x90f0('0x36')]);_0x45e158['query']=_[_0x90f0('0x39')](_0x594d13[_0x90f0('0x38')]);_0x45e158[_0x90f0('0x3a')]=_['intersection'](_0x45e158[_0x90f0('0x3d')],_0x45e158[_0x90f0('0x38')]);_0x18d3a4['attributes']=_[_0x90f0('0x3b')](_0x45e158[_0x90f0('0x3d')],qs[_0x90f0('0x3e')](_0x594d13[_0x90f0('0x38')][_0x90f0('0x3e')]));_0x18d3a4[_0x90f0('0x3c')]=_0x18d3a4['attributes'][_0x90f0('0x3f')]?_0x18d3a4[_0x90f0('0x3c')]:_0x45e158['model'];if(!_0x594d13[_0x90f0('0x38')]['hasOwnProperty'](_0x90f0('0x41'))){_0x18d3a4['limit']=qs[_0x90f0('0x20')](_0x594d13[_0x90f0('0x38')][_0x90f0('0x20')]);_0x18d3a4[_0x90f0('0x1e')]=qs[_0x90f0('0x1e')](_0x594d13[_0x90f0('0x38')][_0x90f0('0x1e')]);}_0x18d3a4[_0x90f0('0x42')]=qs[_0x90f0('0x43')](_0x594d13[_0x90f0('0x38')]['sort']);_0x18d3a4['where']=qs[_0x90f0('0x3a')](_[_0x90f0('0x45')](_0x594d13[_0x90f0('0x38')],_0x45e158['filters']));_0x18d3a4[_0x90f0('0x44')][_0x90f0('0xad')]=_0xdd9111['id'];if(_0x594d13['query'][_0x90f0('0x80')]){_0x18d3a4[_0x90f0('0x44')]=_['merge'](_0x18d3a4['where'],{'$or':_[_0x90f0('0x2e')](_0x18d3a4[_0x90f0('0x3c')],function(_0x5b8fc0){var _0x56f1a4={};_0x56f1a4[_0x5b8fc0]={'$like':'%'+_0x594d13[_0x90f0('0x38')]['filter']+'%'};return _0x56f1a4;})});}if(_0x594d13['query'][_0x90f0('0x77')]){var _0x44844a=_0x594d13[_0x90f0('0x38')][_0x90f0('0x77')]['split'](',');var _0x5ab0f2={};_0x5ab0f2[_0x44844a[0x0]]={'$gte':moment(_0x44844a[0x1])['format'](_0x90f0('0xbe'))};_0x18d3a4[_0x90f0('0x44')]=_[_0x90f0('0x98')](_0x18d3a4[_0x90f0('0x44')],_0x5ab0f2);}_0x18d3a4=_[_0x90f0('0x98')]({},_0x18d3a4,_0x594d13[_0x90f0('0xb5')]);return db['FaxMessage'][_0x90f0('0x21')]({'where':_0x18d3a4[_0x90f0('0x44')]})['then'](function(_0x2bc69e){_0x5b491a[_0x90f0('0x21')]=_0x2bc69e;if(_0x594d13[_0x90f0('0x38')][_0x90f0('0xb3')]){_0x18d3a4[_0x90f0('0xb4')]=[{'all':!![]}];}return db[_0x90f0('0xba')][_0x90f0('0xbf')](_0x18d3a4);})[_0x90f0('0x28')](function(_0x9fe432){_0x5b491a[_0x90f0('0xaf')]=_0x9fe432;return _0x5b491a;});}})[_0x90f0('0x28')](respondWithFilteredResult(_0x1c0914,_0x18d3a4))[_0x90f0('0xb0')](handleError(_0x1c0914,null));};exports[_0x90f0('0xc0')]=function(_0x4d528c,_0x3a67ee,_0x4a8688){return db['FaxInteraction'][_0x90f0('0x5b')]({'where':{'id':_0x4d528c['params']['id']}})[_0x90f0('0x28')](handleEntityNotFound(_0x3a67ee,null))[_0x90f0('0x28')](function(_0x1d07c7){if(_0x1d07c7){return _0x1d07c7[_0x90f0('0xc1')](_0x4d528c[_0x90f0('0x71')][_0x90f0('0xbb')],_[_0x90f0('0xbc')](_0x4d528c[_0x90f0('0x71')],[_0x90f0('0xbb'),'id'])||{})[_0x90f0('0xc2')](function(){return db[_0x90f0('0x6a')][_0x90f0('0xbf')]({'attributes':['id',_0x90f0('0x2b'),'color'],'where':{'id':_0x4d528c[_0x90f0('0x71')][_0x90f0('0xbb')]}});})['then'](function(_0x2b29b2){socket['emit'](_0x90f0('0xc3'),{'id':Number(_0x4d528c[_0x90f0('0xb2')]['id']),'tags':_0x2b29b2||[]});return{'id':Number(_0x4d528c[_0x90f0('0xb2')]['id']),'tags':_0x2b29b2||[]};});}})[_0x90f0('0x28')](respondWithResult(_0x3a67ee,null))[_0x90f0('0xb0')](handleError(_0x3a67ee,null));};exports[_0x90f0('0xc4')]=function(_0x4a804c,_0x3d7b7e,_0x1d31b4){return db[_0x90f0('0x35')][_0x90f0('0x5b')]({'where':{'id':_0x4a804c[_0x90f0('0xb2')]['id']}})[_0x90f0('0x28')](handleEntityNotFound(_0x3d7b7e,null))['then'](function(_0x4408df){if(_0x4408df){return _0x4408df['removeTags'](_0x4a804c['query'][_0x90f0('0xbb')]);}})[_0x90f0('0x28')](respondWithStatusCode(_0x3d7b7e,null))['catch'](handleError(_0x3d7b7e,null));};exports[_0x90f0('0xc5')]=function(_0x5572da,_0x1bb5e2){var _0x37fbe7=moment()[_0x90f0('0xc6')]()['toString']();var _0x586b54=path[_0x90f0('0xc7')](config[_0x90f0('0xc8')],_0x90f0('0xc9'),_0x90f0('0xca'),_0x90f0('0xcb'));var _0xb6d9d2=path[_0x90f0('0xc7')](config['root'],'server','files',_0x90f0('0xcc'));var _0x3dde24=path[_0x90f0('0xc7')](_0x586b54,_0x37fbe7);var _0x2a8805=util['format']('transcript-%d-%s.zip',_0x5572da['params']['id'],_0x37fbe7);var _0x44287b=path[_0x90f0('0xc7')](_0x586b54,_0x2a8805);var _0x2e5b38=[];_0x2e5b38[_0x90f0('0x33')]({'model':db[_0x90f0('0xcd')],'as':_0x90f0('0xcd'),'raw':!![]});var _0x1d37e0=[{'model':db[_0x90f0('0xba')],'as':_0x90f0('0xce'),'attributes':['id',_0x90f0('0x71'),_0x90f0('0x75')],'include':_0x2e5b38}];return db['FaxInteraction'][_0x90f0('0x5b')]({'where':{'id':_0x5572da[_0x90f0('0xb2')]['id']},'include':_0x1d37e0})[_0x90f0('0x28')](handleEntityNotFound(_0x1bb5e2,null))[_0x90f0('0x28')](function(_0x273d5c){if(_0x273d5c&&_0x273d5c[_0x90f0('0xce')]){var _0x206669=_0x273d5c['get']({'plain':!![]});fs[_0x90f0('0xcf')](_0x3dde24);for(var _0x3ba218=0x0;_0x3ba218<_0x206669[_0x90f0('0xce')][_0x90f0('0x3f')];_0x3ba218++){var _0x54d35d=_0x206669['Messages'][_0x3ba218]['Attachment'];if(_0x54d35d){var _0xbcac6=path[_0x90f0('0xc7')](_0xb6d9d2,_0x54d35d[_0x90f0('0xd0')]);if(fs[_0x90f0('0xd1')](_0xbcac6)){fs['createReadStream'](_0xbcac6)[_0x90f0('0xd2')](fs[_0x90f0('0xd3')](path[_0x90f0('0xc7')](_0x3dde24,_0x54d35d[_0x90f0('0xd0')])));}}}return BPromise['resolve']()[_0x90f0('0x28')](function(){return new BPromise(function(_0x2375b5,_0x2e5386){zipdir(_0x3dde24,{'saveTo':_0x44287b},function(_0x5a7fc7,_0x5c8283){if(_0x5a7fc7)return _0x2e5386(_0x5a7fc7);return _0x2375b5(_0x5c8283);});})[_0x90f0('0x28')](function(){return new BPromise(function(_0xa15b1d,_0x98317e){rimraf(_0x3dde24,function(_0xdf6d20){if(_0xdf6d20)_0x98317e(_0xdf6d20);return _0xa15b1d();});});})['then'](function(){return _0x1bb5e2[_0x90f0('0xc5')](_0x44287b,_0x2a8805,function(_0x2385a2){if(_0x2385a2){console[_0x90f0('0xd4')](_0x90f0('0xd5'),_0x2385a2);}else{fs['unlinkSync'](_0x44287b);}});});});}else{return _0x1bb5e2[_0x90f0('0x1c')](0xc8);}})[_0x90f0('0xb0')](handleError(_0x1bb5e2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 784a2b3..7b5e539 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 _0xebd0=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','Users','map'];(function(_0x285374,_0x4b7e9d){var _0x1f4428=function(_0x2c3319){while(--_0x2c3319){_0x285374['push'](_0x285374['shift']());}};_0x1f4428(++_0x4b7e9d);}(_0xebd0,0x14b));var _0x0ebd=function(_0x342089,_0x31dc2c){_0x342089=_0x342089-0x0;var _0x260b6c=_0xebd0[_0x342089];return _0x260b6c;};'use strict';var EventEmitter=require(_0x0ebd('0x0'));var FaxInteraction=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x2')];var FaxMessage=require(_0x0ebd('0x1'))['db'][_0x0ebd('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0ebd('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ebd('0x5'),'afterDestroy':_0x0ebd('0x6')};function emitEvent(_0x152e7f){return function(_0x4dd0e5,_0x544493,_0x26a9dc){_0x4dd0e5[_0x0ebd('0x7')]({'attributes':['id'],'raw':!![]})[_0x0ebd('0x8')](function(_0x3e946f){_0x4dd0e5['setDataValue'](_0x0ebd('0x9'),_0x3e946f[_0x0ebd('0xa')](function(_0x25fc4b){return{'id':_0x25fc4b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4dd0e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ebd('0x8')](function(_0x51c692){_0x4dd0e5[_0x0ebd('0xb')](_0x0ebd('0xc'),_0x51c692[_0x0ebd('0xd')]);FaxInteractionEvents[_0x0ebd('0xe')](_0x152e7f+':'+_0x4dd0e5['id'],_0x4dd0e5);FaxInteractionEvents[_0x0ebd('0xe')](_0x152e7f,_0x4dd0e5);_0x26a9dc(null);})[_0x0ebd('0xf')](_0x26a9dc(null));};}for(var e in events){if(events[_0x0ebd('0x10')](e)){var event=events[e];FaxInteraction[_0x0ebd('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xa2a2=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x6b1e48,_0x218366){var _0xb4b6e8=function(_0x17b35e){while(--_0x17b35e){_0x6b1e48['push'](_0x6b1e48['shift']());}};_0xb4b6e8(++_0x218366);}(_0xa2a2,0x13d));var _0x2a2a=function(_0x11841e,_0x2eff1d){_0x11841e=_0x11841e-0x0;var _0x4b98e4=_0xa2a2[_0x11841e];return _0x4b98e4;};'use strict';var EventEmitter=require(_0x2a2a('0x0'));var FaxInteraction=require(_0x2a2a('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x2a2a('0x1'))['db'][_0x2a2a('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2a2a('0x3')](0x0);var events={'afterCreate':_0x2a2a('0x4'),'afterUpdate':_0x2a2a('0x5'),'afterDestroy':_0x2a2a('0x6')};function emitEvent(_0x5c2fea){return function(_0x209989,_0x9c917,_0x3752dd){_0x209989['getUsers']({'attributes':['id'],'raw':!![]})[_0x2a2a('0x7')](function(_0x10b301){_0x209989[_0x2a2a('0x8')](_0x2a2a('0x9'),_0x10b301[_0x2a2a('0xa')](function(_0x374377){return{'id':_0x374377['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x209989['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a2a('0x7')](function(_0x36d62b){_0x209989[_0x2a2a('0x8')](_0x2a2a('0xb'),_0x36d62b['length']);FaxInteractionEvents[_0x2a2a('0xc')](_0x5c2fea+':'+_0x209989['id'],_0x209989);FaxInteractionEvents[_0x2a2a('0xc')](_0x5c2fea,_0x209989);_0x3752dd(null);})[_0x2a2a('0xd')](_0x3752dd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x2a2a('0xe')](e,emitEvent(event));}}module[_0x2a2a('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d8ffcde..76287bd 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 _0x0b6c=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0x513324,_0x4c36bf){var _0x55bf55=function(_0xc7bb0a){while(--_0xc7bb0a){_0x513324['push'](_0x513324['shift']());}};_0x55bf55(++_0x4c36bf);}(_0x0b6c,0x6f));var _0xc0b6=function(_0x14cc23,_0x5856e3){_0x14cc23=_0x14cc23-0x0;var _0xdfbd6f=_0x0b6c[_0x14cc23];return _0xdfbd6f;};'use strict';var _=require('lodash');var util=require(_0xc0b6('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc0b6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0b6('0x2'));var rimraf=require(_0xc0b6('0x3'));var config=require(_0xc0b6('0x4'));var attributes=require(_0xc0b6('0x5'));module[_0xc0b6('0x6')]=function(_0x3c8750,_0x709711){return _0x3c8750[_0xc0b6('0x7')](_0xc0b6('0x8'),attributes,{'tableName':_0xc0b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe28a9b,_0x72790b,_0x5e9de1){if(_0xe28a9b[_0xc0b6('0xa')](_0xc0b6('0xb'))){_0xe28a9b[_0xc0b6('0xc')]=moment()[_0xc0b6('0xd')](_0xc0b6('0xe'));}_0x5e9de1(null,_0xe28a9b);}}});}; \ No newline at end of file +var _0xeb37=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x111e82,_0x308847){var _0x4c76d0=function(_0x1b21e9){while(--_0x1b21e9){_0x111e82['push'](_0x111e82['shift']());}};_0x4c76d0(++_0x308847);}(_0xeb37,0x1ad));var _0x7eb3=function(_0x47f0cf,_0x5033e2){_0x47f0cf=_0x47f0cf-0x0;var _0x5ccbfa=_0xeb37[_0x47f0cf];return _0x5ccbfa;};'use strict';var _=require(_0x7eb3('0x0'));var util=require(_0x7eb3('0x1'));var logger=require(_0x7eb3('0x2'))(_0x7eb3('0x3'));var moment=require(_0x7eb3('0x4'));var BPromise=require(_0x7eb3('0x5'));var rp=require(_0x7eb3('0x6'));var fs=require('fs');var path=require(_0x7eb3('0x7'));var rimraf=require(_0x7eb3('0x8'));var config=require(_0x7eb3('0x9'));var attributes=require(_0x7eb3('0xa'));module[_0x7eb3('0xb')]=function(_0x284510,_0x5b9178){return _0x284510['define'](_0x7eb3('0xc'),attributes,{'tableName':_0x7eb3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x382098,_0x3e37ff,_0xd3c9f){if(_0x382098['changed'](_0x7eb3('0xe'))){_0x382098[_0x7eb3('0xf')]=moment()[_0x7eb3('0x10')](_0x7eb3('0x11'));}_0xd3c9f(null,_0x382098);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index c0caf46..9ec6efb 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 _0x6fca=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','AddTagsToFaxInteraction','find','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','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','stringify','error','message','result','catch'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0x6fca,0xaf));var _0xa6fc=function(_0x48e316,_0x3550e7){_0x48e316=_0x48e316-0x0;var _0x518e94=_0x6fca[_0x48e316];return _0x518e94;};'use strict';var _=require(_0xa6fc('0x0'));var util=require(_0xa6fc('0x1'));var moment=require(_0xa6fc('0x2'));var BPromise=require(_0xa6fc('0x3'));var rs=require(_0xa6fc('0x4'));var fs=require('fs');var Redis=require(_0xa6fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6fc('0x6'));var logger=require(_0xa6fc('0x7'))(_0xa6fc('0x8'));var config=require(_0xa6fc('0x9'));var jayson=require(_0xa6fc('0xa'));var client=jayson[_0xa6fc('0xb')][_0xa6fc('0xc')]({'port':0x232a});config[_0xa6fc('0xd')]=_['defaults'](config[_0xa6fc('0xd')],{'host':_0xa6fc('0xe'),'port':0x18eb});var socket=require(_0xa6fc('0xf'))(new Redis(config['redis']));require(_0xa6fc('0x10'))[_0xa6fc('0x11')](socket);function respondWithRpcPromise(_0xab9134,_0x2acd69,_0x2e1209){return new BPromise(function(_0x180bcb,_0x524cef){return client[_0xa6fc('0x12')](_0xab9134,_0x2e1209)[_0xa6fc('0x13')](function(_0x230e8a){logger[_0xa6fc('0x14')](_0xa6fc('0x15'),_0x2acd69,_0xa6fc('0x16'));logger[_0xa6fc('0x17')](_0xa6fc('0x18'),_0x2acd69,_0xa6fc('0x16'),JSON[_0xa6fc('0x19')](_0x230e8a));if(_0x230e8a['error']){if(_0x230e8a[_0xa6fc('0x1a')]['code']===0x1f4){logger[_0xa6fc('0x1a')](_0xa6fc('0x15'),_0x2acd69,_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);return _0x524cef(_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);}logger['error'](_0xa6fc('0x15'),_0x2acd69,_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);return _0x180bcb(_0x230e8a[_0xa6fc('0x1a')][_0xa6fc('0x1b')]);}else{logger[_0xa6fc('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x2acd69,_0xa6fc('0x16'));_0x180bcb(_0x230e8a[_0xa6fc('0x1c')][_0xa6fc('0x1b')]);}})[_0xa6fc('0x1d')](function(_0x4c179d){logger[_0xa6fc('0x1a')](_0xa6fc('0x15'),_0x2acd69,_0x4c179d);_0x524cef(_0x4c179d);});});}exports[_0xa6fc('0x1e')]=function(_0x1580ea){var _0x9a7498=this;return new Promise(function(_0xbb81c5,_0x312037){return db[_0xa6fc('0x1f')][_0xa6fc('0x20')](_0x1580ea[_0xa6fc('0x21')],{'raw':_0x1580ea['options']?_0x1580ea[_0xa6fc('0x22')][_0xa6fc('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1580ea['options']?_0x1580ea['options'][_0xa6fc('0x24')]||null:null,'attributes':_0x1580ea[_0xa6fc('0x22')]?_0x1580ea['options']['attributes']||null:null,'limit':_0x1580ea[_0xa6fc('0x22')]?_0x1580ea['options']['limit']||null:null})[_0xa6fc('0x13')](function(_0x5238b3){logger[_0xa6fc('0x14')](_0xa6fc('0x1e'),_0x1580ea);logger[_0xa6fc('0x17')](_0xa6fc('0x1e'),_0x1580ea,JSON[_0xa6fc('0x19')](_0x5238b3));_0xbb81c5(_0x5238b3);})[_0xa6fc('0x1d')](function(_0x5c25c4){logger[_0xa6fc('0x1a')](_0xa6fc('0x1e'),_0x5c25c4[_0xa6fc('0x1b')],_0x1580ea);_0x312037(_0x9a7498[_0xa6fc('0x1a')](0x1f4,_0x5c25c4[_0xa6fc('0x1b')]));});});};exports[_0xa6fc('0x25')]=function(_0x18666f){return new Promise(function(_0x3edff3,_0xe672ce){return db[_0xa6fc('0x1f')][_0xa6fc('0x26')]({'where':_0x18666f['options']?_0x18666f[_0xa6fc('0x22')]['where']||null:null})[_0xa6fc('0x13')](function(_0x57f629){if(_0x57f629){return _0x57f629['addTags'](_0x18666f[_0xa6fc('0x21')][_0xa6fc('0x27')],_['omit'](_0x18666f['body'],['ids','id'])||{});}})['spread'](function(_0x5314d5){logger[_0xa6fc('0x14')](_0xa6fc('0x28'),_0x18666f);logger[_0xa6fc('0x17')](_0xa6fc('0x28'),_0x18666f,JSON[_0xa6fc('0x19')](_0x5314d5));_0x3edff3(_0x5314d5);})[_0xa6fc('0x1d')](function(_0xbef06c){logger[_0xa6fc('0x1a')]('AddTags',_0xbef06c['message'],_0x18666f);_0xe672ce(_this['error'](0x1f4,_0xbef06c[_0xa6fc('0x1b')]));});});}; \ No newline at end of file +var _0xbe0d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','then','debug','catch','AddTagsToFaxInteraction','find','omit','ids','spread','AddTags','lodash','util','moment'];(function(_0x13e8f0,_0x4e995d){var _0x50bcdb=function(_0x3d6002){while(--_0x3d6002){_0x13e8f0['push'](_0x13e8f0['shift']());}};_0x50bcdb(++_0x4e995d);}(_0xbe0d,0xf3));var _0xdbe0=function(_0x551e3a,_0x45c8fe){_0x551e3a=_0x551e3a-0x0;var _0x12eff3=_0xbe0d[_0x551e3a];return _0x12eff3;};'use strict';var _=require(_0xdbe0('0x0'));var util=require(_0xdbe0('0x1'));var moment=require(_0xdbe0('0x2'));var BPromise=require(_0xdbe0('0x3'));var rs=require(_0xdbe0('0x4'));var fs=require('fs');var Redis=require(_0xdbe0('0x5'));var db=require(_0xdbe0('0x6'))['db'];var utils=require(_0xdbe0('0x7'));var logger=require(_0xdbe0('0x8'))(_0xdbe0('0x9'));var config=require(_0xdbe0('0xa'));var jayson=require(_0xdbe0('0xb'));var client=jayson[_0xdbe0('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xdbe0('0xd')],{'host':_0xdbe0('0xe'),'port':0x18eb});var socket=require(_0xdbe0('0xf'))(new Redis(config[_0xdbe0('0xd')]));require('./faxInteraction.socket')[_0xdbe0('0x10')](socket);function respondWithRpcPromise(_0x9c80ee,_0x51558d,_0x50338a){return new BPromise(function(_0x4899b4,_0x4f01cd){return client['request'](_0x9c80ee,_0x50338a)['then'](function(_0x483616){logger[_0xdbe0('0x11')](_0xdbe0('0x12'),_0x51558d,_0xdbe0('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x51558d,_0xdbe0('0x13'),JSON[_0xdbe0('0x14')](_0x483616));if(_0x483616[_0xdbe0('0x15')]){if(_0x483616[_0xdbe0('0x15')][_0xdbe0('0x16')]===0x1f4){logger[_0xdbe0('0x15')](_0xdbe0('0x12'),_0x51558d,_0x483616[_0xdbe0('0x15')][_0xdbe0('0x17')]);return _0x4f01cd(_0x483616[_0xdbe0('0x15')][_0xdbe0('0x17')]);}logger[_0xdbe0('0x15')](_0xdbe0('0x12'),_0x51558d,_0x483616[_0xdbe0('0x15')]['message']);return _0x4899b4(_0x483616[_0xdbe0('0x15')]['message']);}else{logger[_0xdbe0('0x11')](_0xdbe0('0x12'),_0x51558d,_0xdbe0('0x13'));_0x4899b4(_0x483616[_0xdbe0('0x18')][_0xdbe0('0x17')]);}})['catch'](function(_0x2f9d9c){logger['error'](_0xdbe0('0x12'),_0x51558d,_0x2f9d9c);_0x4f01cd(_0x2f9d9c);});});}exports[_0xdbe0('0x19')]=function(_0x3c8d06){var _0x526fae=this;return new Promise(function(_0x628be7,_0x57cbea){return db[_0xdbe0('0x1a')]['update'](_0x3c8d06[_0xdbe0('0x1b')],{'raw':_0x3c8d06['options']?_0x3c8d06[_0xdbe0('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8d06[_0xdbe0('0x1c')]?_0x3c8d06[_0xdbe0('0x1c')][_0xdbe0('0x1d')]||null:null,'attributes':_0x3c8d06[_0xdbe0('0x1c')]?_0x3c8d06[_0xdbe0('0x1c')][_0xdbe0('0x1e')]||null:null,'limit':_0x3c8d06[_0xdbe0('0x1c')]?_0x3c8d06[_0xdbe0('0x1c')][_0xdbe0('0x1f')]||null:null})[_0xdbe0('0x20')](function(_0x3f6161){logger['info'](_0xdbe0('0x19'),_0x3c8d06);logger[_0xdbe0('0x21')](_0xdbe0('0x19'),_0x3c8d06,JSON['stringify'](_0x3f6161));_0x628be7(_0x3f6161);})[_0xdbe0('0x22')](function(_0x391aaf){logger[_0xdbe0('0x15')](_0xdbe0('0x19'),_0x391aaf[_0xdbe0('0x17')],_0x3c8d06);_0x57cbea(_0x526fae['error'](0x1f4,_0x391aaf[_0xdbe0('0x17')]));});});};exports[_0xdbe0('0x23')]=function(_0x296ee4){return new Promise(function(_0x4bfd22,_0x25dd6c){return db[_0xdbe0('0x1a')][_0xdbe0('0x24')]({'where':_0x296ee4[_0xdbe0('0x1c')]?_0x296ee4[_0xdbe0('0x1c')]['where']||null:null})[_0xdbe0('0x20')](function(_0x389a36){if(_0x389a36){return _0x389a36['addTags'](_0x296ee4[_0xdbe0('0x1b')]['ids'],_[_0xdbe0('0x25')](_0x296ee4[_0xdbe0('0x1b')],[_0xdbe0('0x26'),'id'])||{});}})[_0xdbe0('0x27')](function(_0x24d61d){logger[_0xdbe0('0x11')](_0xdbe0('0x28'),_0x296ee4);logger[_0xdbe0('0x21')](_0xdbe0('0x28'),_0x296ee4,JSON[_0xdbe0('0x14')](_0x24d61d));_0x4bfd22(_0x24d61d);})['catch'](function(_0x431e91){logger[_0xdbe0('0x15')](_0xdbe0('0x28'),_0x431e91[_0xdbe0('0x17')],_0x296ee4);_0x25dd6c(_this[_0xdbe0('0x15')](0x1f4,_0x431e91[_0xdbe0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index c1c6ca7..eb0bcab 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 _0x08d3=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x08d3,0x73));var _0x308d=function(_0x481704,_0x2c8229){_0x481704=_0x481704-0x0;var _0x1e95a3=_0x08d3[_0x481704];return _0x1e95a3;};'use strict';var FaxInteractionEvents=require(_0x308d('0x0'));var events=[_0x308d('0x1'),_0x308d('0x2'),_0x308d('0x3')];function createListener(_0x577d08,_0x3393d3){return function(_0x3830de){_0x3393d3[_0x308d('0x4')](_0x577d08,_0x3830de);};}function removeListener(_0x2829e0,_0x13c725){return function(){FaxInteractionEvents[_0x308d('0x5')](_0x2829e0,_0x13c725);};}exports[_0x308d('0x6')]=function(_0x2ef36b){for(var _0x524881=0x0,_0x27d57f=events[_0x308d('0x7')];_0x524881<_0x27d57f;_0x524881++){var _0x20fac4=events[_0x524881];var _0x41c506=createListener(_0x308d('0x8')+_0x20fac4,_0x2ef36b);FaxInteractionEvents['on'](_0x20fac4,_0x41c506);}}; \ No newline at end of file +var _0xc5fe=['save','update','emit','removeListener','faxInteraction:'];(function(_0x105dc2,_0x18284d){var _0x1d460b=function(_0x3f48e2){while(--_0x3f48e2){_0x105dc2['push'](_0x105dc2['shift']());}};_0x1d460b(++_0x18284d);}(_0xc5fe,0x109));var _0xec5f=function(_0x31f806,_0x35fd82){_0x31f806=_0x31f806-0x0;var _0x3afcf9=_0xc5fe[_0x31f806];return _0x3afcf9;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xec5f('0x0'),'remove',_0xec5f('0x1')];function createListener(_0x3adea7,_0x383b1d){return function(_0x3846ec){_0x383b1d[_0xec5f('0x2')](_0x3adea7,_0x3846ec);};}function removeListener(_0x80a63a,_0x3ec709){return function(){FaxInteractionEvents[_0xec5f('0x3')](_0x80a63a,_0x3ec709);};}exports['register']=function(_0xf0ff75){for(var _0x37687f=0x0,_0x2fed97=events['length'];_0x37687f<_0x2fed97;_0x37687f++){var _0x5dfd93=events[_0x37687f];var _0x4bafb1=createListener(_0xec5f('0x4')+_0x5dfd93,_0xf0ff75);FaxInteractionEvents['on'](_0x5dfd93,_0x4bafb1);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3f6fea4..ef0e58f 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 _0x2d57=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x35ac83,_0x10be5c){var _0x35a6a0=function(_0x5298c0){while(--_0x5298c0){_0x35ac83['push'](_0x35ac83['shift']());}};_0x35a6a0(++_0x10be5c);}(_0x2d57,0x17a));var _0x72d5=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x2d57[_0x420b24];return _0x4da552;};'use strict';var multer=require('multer');var util=require(_0x72d5('0x0'));var path=require('path');var timeout=require(_0x72d5('0x1'));var express=require(_0x72d5('0x2'));var router=express[_0x72d5('0x3')]();var fs_extra=require(_0x72d5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x72d5('0x5'));var config=require(_0x72d5('0x6'));var controller=require('./faxInteraction.controller');router[_0x72d5('0x7')]('/',auth[_0x72d5('0x8')](),controller[_0x72d5('0x9')]);router[_0x72d5('0x7')]('/describe',auth[_0x72d5('0x8')](),controller[_0x72d5('0xa')]);router['get'](_0x72d5('0xb'),auth[_0x72d5('0x8')](),controller[_0x72d5('0xc')]);router[_0x72d5('0x7')](_0x72d5('0xd'),auth[_0x72d5('0x8')](),controller['getMessages']);router['get'](_0x72d5('0xe'),auth[_0x72d5('0x8')](),controller[_0x72d5('0xf')]);router[_0x72d5('0x10')]('/',auth[_0x72d5('0x8')](),controller[_0x72d5('0x11')]);router['post']('/:id/messages',auth[_0x72d5('0x8')](),controller[_0x72d5('0x12')]);router['post'](_0x72d5('0x13'),auth['isAuthenticated'](),interaction[_0x72d5('0x14')]('fax',_0x72d5('0x15')),controller[_0x72d5('0x16')]);router[_0x72d5('0x17')](_0x72d5('0xb'),auth[_0x72d5('0x8')](),interaction[_0x72d5('0x14')](_0x72d5('0x18'),_0x72d5('0x19')),controller[_0x72d5('0x1a')]);router[_0x72d5('0x1b')](_0x72d5('0xb'),auth['isAuthenticated'](),interaction[_0x72d5('0x14')](_0x72d5('0x18'),_0x72d5('0x1c')),controller[_0x72d5('0x1d')]);router[_0x72d5('0x1b')](_0x72d5('0x13'),auth[_0x72d5('0x8')](),controller[_0x72d5('0x1e')]);module[_0x72d5('0x1f')]=router; \ No newline at end of file +var _0xc3c4=['isAuthenticated','index','/describe','/:id','show','/:id/messages','download','create','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x4ca434,_0x46f3b0){var _0x17f3be=function(_0xe4aa29){while(--_0xe4aa29){_0x4ca434['push'](_0x4ca434['shift']());}};_0x17f3be(++_0x46f3b0);}(_0xc3c4,0xf5));var _0x4c3c=function(_0x2ea4c8,_0x3348d9){_0x2ea4c8=_0x2ea4c8-0x0;var _0x1a49bd=_0xc3c4[_0x2ea4c8];return _0x1a49bd;};'use strict';var multer=require(_0x4c3c('0x0'));var util=require('util');var path=require(_0x4c3c('0x1'));var timeout=require(_0x4c3c('0x2'));var express=require(_0x4c3c('0x3'));var router=express[_0x4c3c('0x4')]();var fs_extra=require(_0x4c3c('0x5'));var auth=require(_0x4c3c('0x6'));var interaction=require(_0x4c3c('0x7'));var config=require(_0x4c3c('0x8'));var controller=require(_0x4c3c('0x9'));router[_0x4c3c('0xa')]('/',auth[_0x4c3c('0xb')](),controller[_0x4c3c('0xc')]);router['get'](_0x4c3c('0xd'),auth[_0x4c3c('0xb')](),controller['describe']);router[_0x4c3c('0xa')](_0x4c3c('0xe'),auth['isAuthenticated'](),controller[_0x4c3c('0xf')]);router[_0x4c3c('0xa')](_0x4c3c('0x10'),auth[_0x4c3c('0xb')](),controller['getMessages']);router[_0x4c3c('0xa')]('/:id/download',auth[_0x4c3c('0xb')](),controller[_0x4c3c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4c3c('0x12')]);router[_0x4c3c('0x13')]('/:id/messages',auth[_0x4c3c('0xb')](),controller[_0x4c3c('0x14')]);router[_0x4c3c('0x13')](_0x4c3c('0x15'),auth[_0x4c3c('0xb')](),interaction['tracked'](_0x4c3c('0x16'),_0x4c3c('0x17')),controller[_0x4c3c('0x18')]);router['put'](_0x4c3c('0xe'),auth[_0x4c3c('0xb')](),interaction[_0x4c3c('0x19')](_0x4c3c('0x16'),_0x4c3c('0x1a')),controller[_0x4c3c('0x1b')]);router[_0x4c3c('0x1c')](_0x4c3c('0xe'),auth[_0x4c3c('0xb')](),interaction[_0x4c3c('0x19')](_0x4c3c('0x16'),_0x4c3c('0x1d')),controller[_0x4c3c('0x1e')]);router[_0x4c3c('0x1c')](_0x4c3c('0x15'),auth[_0x4c3c('0xb')](),controller[_0x4c3c('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index a0314c9..2e9b11d 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 _0xa8eb=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0xa8eb,0x179));var _0xba8e=function(_0x1541a3,_0xec95b6){_0x1541a3=_0x1541a3-0x0;var _0x5be16c=_0xa8eb[_0x1541a3];return _0x5be16c;};'use strict';var Sequelize=require(_0xba8e('0x0'));module['exports']={'body':{'type':Sequelize[_0xba8e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xba8e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba8e('0x3')]('in',_0xba8e('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xba8e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xba8e('0x5')]}}; \ No newline at end of file +var _0xb4e6=['ENUM','out','sequelize','TEXT','medium','BOOLEAN'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0xb4e6[_0x14a862];return _0x245eb5;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'body':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6b4e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b4e('0x4')]('in',_0x6b4e('0x5')),'defaultValue':_0x6b4e('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6b4e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index c5d85e3..38f15e0 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 _0x1381=['count','Content-Range','apply','save','update','destroy','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','params','include','options','find','body','accept','fax','readAt','format','UserId','user','agent','get','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','fax-interactions','reject','FaxInteraction','role','ContactId','motionChannel','event','rejectmessage','create','CmContact','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','server','files','attachments','join','basename','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','undefined'];(function(_0x28edf8,_0x3ab79f){var _0xb0bbba=function(_0x52eeae){while(--_0x52eeae){_0x28edf8['push'](_0x28edf8['shift']());}};_0xb0bbba(++_0x3ab79f);}(_0x1381,0x174));var _0x1138=function(_0x36ef33,_0x4bc2c5){_0x36ef33=_0x36ef33-0x0;var _0x107115=_0x1381[_0x36ef33];return _0x107115;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1138('0x0'));var zipdir=require(_0x1138('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1138('0x2'));var moment=require(_0x1138('0x3'));var BPromise=require(_0x1138('0x4'));var Mustache=require(_0x1138('0x5'));var util=require(_0x1138('0x6'));var path=require('path');var sox=require(_0x1138('0x7'));var csv=require(_0x1138('0x8'));var ejs=require(_0x1138('0x9'));var fs=require('fs');var fs_extra=require(_0x1138('0xa'));var _=require('lodash');var squel=require(_0x1138('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1138('0xc'));var toCsv=require(_0x1138('0x8'));var querystring=require(_0x1138('0xd'));var Papa=require('papaparse');var Redis=require(_0x1138('0xe'));var authService=require(_0x1138('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1138('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1138('0x11'))('api');var utils=require(_0x1138('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1138('0x13'));var db=require(_0x1138('0x14'))['db'];config[_0x1138('0x15')]=_['defaults'](config[_0x1138('0x15')],{'host':_0x1138('0x16'),'port':0x18eb});var socket=require(_0x1138('0x17'))(new Redis(config[_0x1138('0x15')]));require(_0x1138('0x18'))[_0x1138('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1138('0x1a')][_0x1138('0x1b')]({'port':0x232c});var client9002=jayson[_0x1138('0x1a')][_0x1138('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x7d5b41,_0x360735,_0x4cc97c,_0xbea5ac){return new BPromise(function(_0x39b828,_0x2a1893){var _0x2ae43e=_0xbea5ac||client;return _0x2ae43e[_0x1138('0x1c')](_0x7d5b41,_0x4cc97c)[_0x1138('0x1d')](function(_0x1e51be){logger[_0x1138('0x1e')](_0x1138('0x1f'),_0x360735,_0x1138('0x20'));logger[_0x1138('0x21')](_0x1138('0x22'),_0x360735,_0x1138('0x20'),JSON['stringify'](_0x1e51be));if(_0x1e51be[_0x1138('0x23')]){if(_0x1e51be['error'][_0x1138('0x24')]===0x1f4){logger[_0x1138('0x23')]('FaxMessage,\x20%s,\x20%s',_0x360735,_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);return _0x2a1893(_0x1e51be['error'][_0x1138('0x25')]);}logger[_0x1138('0x23')](_0x1138('0x1f'),_0x360735,_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);return _0x39b828(_0x1e51be[_0x1138('0x23')][_0x1138('0x25')]);}else{logger['info'](_0x1138('0x1f'),_0x360735,_0x1138('0x20'));_0x39b828(_0x1e51be[_0x1138('0x26')]['message']);}})[_0x1138('0x27')](function(_0x42be63){logger[_0x1138('0x23')]('FaxMessage,\x20%s,\x20%s',_0x360735,_0x42be63);_0x2a1893(_0x42be63);});});}function respondWithStatusCode(_0x599045,_0x5089ec){_0x5089ec=_0x5089ec||0xcc;return function(_0x239807){if(_0x239807){return _0x599045['sendStatus'](_0x5089ec);}return _0x599045[_0x1138('0x28')](_0x5089ec)[_0x1138('0x29')]();};}function respondWithResult(_0x1c953b,_0x3413a6){_0x3413a6=_0x3413a6||0xc8;return function(_0x46ebb2){if(_0x46ebb2){return _0x1c953b[_0x1138('0x28')](_0x3413a6)[_0x1138('0x2a')](_0x46ebb2);}};}function respondWithFilteredResult(_0xf60229,_0x48cce9){return function(_0x1acea1){if(_0x1acea1){var _0x3a8cbf=typeof _0x48cce9[_0x1138('0x2b')]===_0x1138('0x2c')&&typeof _0x48cce9['limit']===_0x1138('0x2c');var _0x4f3737=_0x1acea1['count'];var _0x3492b5=_0x3a8cbf?0x0:_0x48cce9[_0x1138('0x2b')];var _0xd07034=_0x3a8cbf?_0x1acea1[_0x1138('0x2d')]:_0x48cce9[_0x1138('0x2b')]+_0x48cce9['limit'];var _0x5b94ce;if(_0xd07034>=_0x4f3737){_0xd07034=_0x4f3737;_0x5b94ce=0xc8;}else{_0x5b94ce=0xce;}_0xf60229[_0x1138('0x28')](_0x5b94ce);return _0xf60229['set'](_0x1138('0x2e'),_0x3492b5+'-'+_0xd07034+'/'+_0x4f3737)[_0x1138('0x2a')](_0x1acea1);}return null;};}function patchUpdates(_0x5138e4){return function(_0x532c5f){try{jsonpatch[_0x1138('0x2f')](_0x532c5f,_0x5138e4,!![]);}catch(_0x39bf76){return BPromise['reject'](_0x39bf76);}return _0x532c5f[_0x1138('0x30')]();};}function saveUpdates(_0x43a943,_0x184b3f){return function(_0x3cbc3e){if(_0x3cbc3e){return _0x3cbc3e[_0x1138('0x31')](_0x43a943)['then'](function(_0x26bfd6){return _0x26bfd6;});}return null;};}function removeEntity(_0x3d6ce1,_0x26b97f){return function(_0x38745b){if(_0x38745b){return _0x38745b[_0x1138('0x32')]()[_0x1138('0x1d')](function(){_0x3d6ce1[_0x1138('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45484a,_0x2e9fec){return function(_0xab9589){if(!_0xab9589){_0x45484a['sendStatus'](0x194);}return _0xab9589;};}function handleError(_0x203af1,_0x5b748d){_0x5b748d=_0x5b748d||0x1f4;return function(_0x5abaff){logger[_0x1138('0x23')](_0x5abaff[_0x1138('0x33')]);if(_0x5abaff['name']){delete _0x5abaff['name'];}_0x203af1[_0x1138('0x28')](_0x5b748d)[_0x1138('0x34')](_0x5abaff);};}exports[_0x1138('0x35')]=function(_0x491595,_0x28c74b){var _0xbdfe86={},_0xba5cd0={},_0x10ba7d={'count':0x0,'rows':[]};var _0x5a6124=_[_0x1138('0x36')](db[_0x1138('0x37')][_0x1138('0x38')],function(_0x5820ac){return{'name':_0x5820ac[_0x1138('0x39')],'type':_0x5820ac[_0x1138('0x3a')][_0x1138('0x3b')]};});_0xba5cd0[_0x1138('0x3c')]=_[_0x1138('0x36')](_0x5a6124,_0x1138('0x3d'));_0xba5cd0[_0x1138('0x3e')]=_[_0x1138('0x3f')](_0x491595['query']);_0xba5cd0[_0x1138('0x40')]=_[_0x1138('0x41')](_0xba5cd0['model'],_0xba5cd0[_0x1138('0x3e')]);_0xbdfe86[_0x1138('0x42')]=_[_0x1138('0x41')](_0xba5cd0['model'],qs[_0x1138('0x43')](_0x491595[_0x1138('0x3e')]['fields']));_0xbdfe86[_0x1138('0x42')]=_0xbdfe86[_0x1138('0x42')][_0x1138('0x44')]?_0xbdfe86[_0x1138('0x42')]:_0xba5cd0['model'];if(!_0x491595['query'][_0x1138('0x45')](_0x1138('0x46'))){_0xbdfe86[_0x1138('0x47')]=qs['limit'](_0x491595['query'][_0x1138('0x47')]);_0xbdfe86['offset']=qs[_0x1138('0x2b')](_0x491595[_0x1138('0x3e')][_0x1138('0x2b')]);}_0xbdfe86['order']=qs[_0x1138('0x48')](_0x491595[_0x1138('0x3e')][_0x1138('0x48')]);_0xbdfe86[_0x1138('0x49')]=qs[_0x1138('0x40')](_[_0x1138('0x4a')](_0x491595[_0x1138('0x3e')],_0xba5cd0[_0x1138('0x40')]),_0x5a6124);if(_0x491595[_0x1138('0x3e')]['filter']){_0xbdfe86[_0x1138('0x49')]=_[_0x1138('0x4b')](_0xbdfe86[_0x1138('0x49')],{'$or':_['map'](_0x5a6124,function(_0x5c1e97){if(_0x5c1e97[_0x1138('0x3a')]!==_0x1138('0x4c')){var _0x3078d2={};_0x3078d2[_0x5c1e97[_0x1138('0x3d')]]={'$like':'%'+_0x491595[_0x1138('0x3e')][_0x1138('0x4d')]+'%'};return _0x3078d2;}})});}_0xbdfe86=_[_0x1138('0x4b')]({},_0xbdfe86,_0x491595['options']);var _0x41fab4={'where':_0xbdfe86['where']};return db['FaxMessage'][_0x1138('0x2d')](_0x41fab4)['then'](function(_0x182873){_0x10ba7d[_0x1138('0x2d')]=_0x182873;if(_0x491595['query'][_0x1138('0x4e')]){_0xbdfe86['include']=[{'all':!![]}];}return db[_0x1138('0x37')]['findAll'](_0xbdfe86);})[_0x1138('0x1d')](function(_0x146465){_0x10ba7d[_0x1138('0x4f')]=_0x146465;return _0x10ba7d;})[_0x1138('0x1d')](respondWithFilteredResult(_0x28c74b,_0xbdfe86))[_0x1138('0x27')](handleError(_0x28c74b,null));};exports['show']=function(_0x2ced90,_0x407869){var _0x199377={'raw':!![],'where':{'id':_0x2ced90[_0x1138('0x50')]['id']}},_0x2658fa={};_0x2658fa['model']=_[_0x1138('0x3f')](db[_0x1138('0x37')][_0x1138('0x38')]);_0x2658fa[_0x1138('0x3e')]=_[_0x1138('0x3f')](_0x2ced90[_0x1138('0x3e')]);_0x2658fa['filters']=_[_0x1138('0x41')](_0x2658fa[_0x1138('0x3c')],_0x2658fa[_0x1138('0x3e')]);_0x199377[_0x1138('0x42')]=_[_0x1138('0x41')](_0x2658fa[_0x1138('0x3c')],qs[_0x1138('0x43')](_0x2ced90['query']['fields']));_0x199377[_0x1138('0x42')]=_0x199377[_0x1138('0x42')][_0x1138('0x44')]?_0x199377[_0x1138('0x42')]:_0x2658fa[_0x1138('0x3c')];if(_0x2ced90[_0x1138('0x3e')][_0x1138('0x4e')]){_0x199377[_0x1138('0x51')]=[{'all':!![]}];}_0x199377=_[_0x1138('0x4b')]({},_0x199377,_0x2ced90[_0x1138('0x52')]);return db[_0x1138('0x37')][_0x1138('0x53')](_0x199377)[_0x1138('0x1d')](handleEntityNotFound(_0x407869,null))[_0x1138('0x1d')](respondWithResult(_0x407869,null))[_0x1138('0x27')](handleError(_0x407869,null));};exports['update']=function(_0x1ab1dc,_0x19c048){if(_0x1ab1dc[_0x1138('0x54')]['id']){delete _0x1ab1dc[_0x1138('0x54')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x1ab1dc[_0x1138('0x50')]['id']}})[_0x1138('0x1d')](handleEntityNotFound(_0x19c048,null))[_0x1138('0x1d')](saveUpdates(_0x1ab1dc[_0x1138('0x54')],null))['then'](respondWithResult(_0x19c048,null))['catch'](handleError(_0x19c048,null));};exports[_0x1138('0x32')]=function(_0x6045db,_0x3c58af){return db['FaxMessage'][_0x1138('0x53')]({'where':{'id':_0x6045db[_0x1138('0x50')]['id']}})[_0x1138('0x1d')](handleEntityNotFound(_0x3c58af,null))[_0x1138('0x1d')](removeEntity(_0x3c58af,null))[_0x1138('0x27')](handleError(_0x3c58af,null));};exports['describe']=function(_0x257b51,_0x22264c){return db[_0x1138('0x37')]['describe']()[_0x1138('0x1d')](respondWithResult(_0x22264c,null))[_0x1138('0x27')](handleError(_0x22264c,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x1138('0x55')]=function(_0x44443b,_0x3eafcf,_0x340f7d){var _0xf88f9c={'agent':{},'channel':_0x1138('0x56')};if(_0x44443b[_0x1138('0x54')]['id']){delete _0x44443b['body']['id'];}_0x44443b[_0x1138('0x54')]['read']=!![];_0x44443b[_0x1138('0x54')][_0x1138('0x57')]=moment()[_0x1138('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x44443b[_0x1138('0x54')][_0x1138('0x59')]=_0x44443b[_0x1138('0x54')][_0x1138('0x59')]||_0x44443b[_0x1138('0x5a')]['id'];_0xf88f9c[_0x1138('0x5b')]['id']=_0x44443b[_0x1138('0x54')][_0x1138('0x59')];return db[_0x1138('0x37')][_0x1138('0x53')]({'where':{'id':_0x44443b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3eafcf,null))[_0x1138('0x1d')](saveUpdates(_0x44443b[_0x1138('0x54')],null))[_0x1138('0x1d')](function(_0xc328c7){if(_0xc328c7){_0xf88f9c[_0x1138('0x25')]=_0xc328c7[_0x1138('0x5c')]({'plain':!![]});return db['FaxInteraction'][_0x1138('0x53')]({'where':{'id':_0xc328c7[_0x1138('0x5d')]}});}return null;})[_0x1138('0x1d')](handleEntityNotFound(_0x3eafcf,null))['then'](function(_0xf36014){if(_0xf36014){return _0xf36014[_0x1138('0x31')]({'UserId':_0x44443b[_0x1138('0x54')][_0x1138('0x59')],'read1stAt':_[_0x1138('0x5e')](_0xf36014['read1stAt'])?moment()[_0x1138('0x58')](_0x1138('0x5f')):undefined});}return null;})['then'](function(_0x1d2c4){if(_0x1d2c4){_0xf88f9c[_0x1138('0x60')]=_0x1d2c4[_0x1138('0x5c')]({'plain':!![]});interaction_log[_0x1138('0x1e')](_0x1138('0x61'),_0x44443b[_0x1138('0x5a')]['id'],_0x44443b[_0x1138('0x5a')][_0x1138('0x3d')],_0x44443b[_0x1138('0x5a')]['role'],_0xf88f9c[_0x1138('0x60')]['id'],_0x44443b['body']?JSON[_0x1138('0x62')](_0x44443b[_0x1138('0x54')]):_0x1138('0x63'));return respondWithRpcPromise(_0x1138('0x64'),_0x1138('0x65'),_0xf88f9c);}return null;})[_0x1138('0x1d')](function(_0x2095d4){var _0x18bfdf=_0x1138('0x66')+_0x2095d4[_0x1138('0x25')]['ContactId'];return db[_0x1138('0x67')]['query'](_0x18bfdf,{'type':db[_0x1138('0x68')][_0x1138('0x69')][_0x1138('0x6a')],'raw':!![]})[_0x1138('0x1d')](function(_0xc155b3){return _0xc155b3;});})['then'](function(_0x1999ee){if(_0x1999ee){_0xf88f9c[_0x1138('0x25')][_0x1138('0x6b')]=_0x1999ee[0x0];if(!_0x44443b[_0x1138('0x54')]['UserId'])return;return db[_0x1138('0x6c')][_0x1138('0x53')]({'where':{'id':_0x44443b[_0x1138('0x54')][_0x1138('0x59')],'role':'agent'},'attributes':['id',_0x1138('0x3d'),_0x1138('0x6d'),_0x1138('0x6e'),_0x1138('0x6f')],'raw':!![]});}return null;})[_0x1138('0x1d')](function(_0x5b70e9){if(!_0x5b70e9)return null;_0xf88f9c[_0x1138('0x25')][_0x1138('0x5b')]=_0x5b70e9;return _0xf88f9c;})[_0x1138('0x1d')](function(_0x51273a){if(_0x51273a){if(_0x44443b[_0x1138('0x54')]['manual']){_0xf88f9c[_0x1138('0x25')][_0x1138('0x70')]=util[_0x1138('0x58')](_0x1138('0x71'),_0x44443b[_0x1138('0x5a')]['name']);_0xf88f9c['message'][_0x1138('0x72')]=_0xf88f9c['channel'];_0xf88f9c[_0x1138('0x25')]['motionChannel']=_0xf88f9c[_0x1138('0x72')];_0xf88f9c[_0x1138('0x25')]['event']='accept';return respondWithRpcPromise('EventManager',_0x1138('0x73'),{'event':_0x1138('0x74'),'message':_0xf88f9c[_0x1138('0x25')]},client9002)[_0x1138('0x1d')](function(){return _0xf88f9c;});}return _0xf88f9c;}return null;})['then'](respondWithResult(_0x3eafcf,null))[_0x1138('0x27')](handleError(_0x3eafcf,null));};var interaction_log=require(_0x1138('0x11'))(_0x1138('0x75'));exports[_0x1138('0x76')]=function(_0x489ab6,_0x151027,_0x28aec4){var _0x55dd38={'agent':{},'channel':'fax'};if(_0x489ab6[_0x1138('0x54')]['id']){delete _0x489ab6[_0x1138('0x54')]['id'];}_0x489ab6['body'][_0x1138('0x59')]=_0x489ab6[_0x1138('0x54')][_0x1138('0x59')]||_0x489ab6['user']['id'];_0x55dd38[_0x1138('0x5b')]['id']=_0x489ab6['body'][_0x1138('0x59')];return db[_0x1138('0x37')]['find']({'where':{'id':_0x489ab6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x151027,null))[_0x1138('0x1d')](function(_0xd5d01b){if(_0xd5d01b){_0x55dd38['message']=_0xd5d01b[_0x1138('0x5c')]({'plain':!![]});return db[_0x1138('0x77')][_0x1138('0x53')]({'where':{'id':_0xd5d01b['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x151027,null))[_0x1138('0x1d')](function(_0x454fe9){if(_0x454fe9){_0x55dd38[_0x1138('0x60')]=_0x454fe9[_0x1138('0x5c')]({'plain':!![]});interaction_log[_0x1138('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x489ab6['user']['id'],_0x489ab6[_0x1138('0x5a')][_0x1138('0x3d')],_0x489ab6[_0x1138('0x5a')][_0x1138('0x78')],_0x55dd38['interaction']['id'],_0x489ab6[_0x1138('0x54')]?JSON['stringify'](_0x489ab6[_0x1138('0x54')]):_0x1138('0x63'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x55dd38);}return null;})[_0x1138('0x1d')](function(_0x2c6cb2){var _0x469c40=_0x1138('0x66')+_0x2c6cb2[_0x1138('0x25')][_0x1138('0x79')];return db[_0x1138('0x67')][_0x1138('0x3e')](_0x469c40,{'type':db[_0x1138('0x68')][_0x1138('0x69')]['SELECT'],'raw':!![]})[_0x1138('0x1d')](function(_0x58bdcc){return _0x58bdcc;});})[_0x1138('0x1d')](function(_0x1669e6){if(_0x1669e6){_0x55dd38[_0x1138('0x25')][_0x1138('0x6b')]=_0x1669e6[0x0];if(!_0x489ab6['body'][_0x1138('0x59')])return;return db['User'][_0x1138('0x53')]({'where':{'id':_0x489ab6[_0x1138('0x54')][_0x1138('0x59')],'role':_0x1138('0x5b')},'attributes':['id',_0x1138('0x3d'),_0x1138('0x6d'),'email',_0x1138('0x6f')],'raw':!![]});}return null;})[_0x1138('0x1d')](function(_0x134028){if(!_0x134028)return null;_0x55dd38[_0x1138('0x25')][_0x1138('0x5b')]=_0x134028;return _0x55dd38;})[_0x1138('0x1d')](function(_0x4c9160){if(_0x4c9160){_0x4c9160[_0x1138('0x25')][_0x1138('0x70')]=util[_0x1138('0x58')](_0x1138('0x71'),_0x489ab6[_0x1138('0x5a')][_0x1138('0x3d')]);_0x4c9160[_0x1138('0x25')][_0x1138('0x72')]=_0x55dd38[_0x1138('0x72')];_0x4c9160[_0x1138('0x25')][_0x1138('0x7a')]=_0x55dd38['channel'];_0x4c9160[_0x1138('0x25')][_0x1138('0x7b')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x1138('0x7c'),'message':_0x4c9160[_0x1138('0x25')]},client9002);return _0x55dd38;}return null;})[_0x1138('0x1d')](respondWithResult(_0x151027,null))[_0x1138('0x27')](handleError(_0x151027,null));};exports[_0x1138('0x7d')]=function(_0x46b2a4,_0x5834d6){var _0x560179;return db[_0x1138('0x37')]['create'](_0x46b2a4['body'],{})[_0x1138('0x1d')](function(_0x3c62b2){_0x560179=_0x3c62b2;return db[_0x1138('0x7e')]['findOne']({'where':{'id':_0x560179[_0x1138('0x79')]}});})['then'](function(_0xf1a370){if(_[_0x1138('0x5e')](_0xf1a370)){return;}else{_0x560179[_0x1138('0x56')]=_0xf1a370['fax'];return db[_0x1138('0x7f')][_0x1138('0x80')]({'where':{'id':_0x560179['AttachmentId']}});}})[_0x1138('0x1d')](function(_0x3bb4a5){return respondWithRpcPromise(_0x1138('0x81'),_0x1138('0x81'),{'FaxAccountId':_[_0x1138('0x5e')](_0x46b2a4[_0x1138('0x54')])?undefined:_0x46b2a4[_0x1138('0x54')][_0x1138('0x82')],'path':_['isNil'](_0x3bb4a5)?undefined:util[_0x1138('0x58')](_0x1138('0x83'),_0x3bb4a5['basename']),'fax':_[_0x1138('0x5e')](_0x560179[_0x1138('0x56')])?undefined:_0x560179['fax'],'AttachmentId':_0x560179['AttachmentId']},client9002);})[_0x1138('0x1d')](respondWithResult(_0x5834d6,0xc9))['catch'](handleError(_0x5834d6,null));};exports[_0x1138('0x84')]=function(_0x46b45c,_0x37492a){var _0x3e7e22=path['join'](config[_0x1138('0x85')],_0x1138('0x86'),_0x1138('0x87'),_0x1138('0x88'));return db[_0x1138('0x37')][_0x1138('0x53')]({'where':{'id':_0x46b45c[_0x1138('0x50')]['id']},'include':[{'model':db[_0x1138('0x7f')],'as':'Attachment'}]})[_0x1138('0x1d')](handleEntityNotFound(_0x37492a,null))[_0x1138('0x1d')](function(_0x3d5d5c){if(_0x3d5d5c){return _0x37492a[_0x1138('0x84')](path[_0x1138('0x89')](_0x3e7e22,_0x3d5d5c['Attachment'][_0x1138('0x8a')]));}})[_0x1138('0x27')](handleError(_0x37492a,null));}; \ No newline at end of file +var _0x325a=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','FaxInteractionId','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','SIP/%s','rejectmessage','create','CmContact','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','isNil','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','FaxMessage','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','intersection','length','find','body','describe','fax','read','readAt'];(function(_0x563af1,_0x37924c){var _0x58fccb=function(_0x509595){while(--_0x509595){_0x563af1['push'](_0x563af1['shift']());}};_0x58fccb(++_0x37924c);}(_0x325a,0xc6));var _0xa325=function(_0x2c4c10,_0x158cd9){_0x2c4c10=_0x2c4c10-0x0;var _0x41dc98=_0x325a[_0x2c4c10];return _0x41dc98;};'use strict';var emlformat=require(_0xa325('0x0'));var rimraf=require(_0xa325('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa325('0x2'));var rp=require(_0xa325('0x3'));var moment=require(_0xa325('0x4'));var BPromise=require(_0xa325('0x5'));var Mustache=require('mustache');var util=require(_0xa325('0x6'));var path=require('path');var sox=require(_0xa325('0x7'));var csv=require(_0xa325('0x8'));var ejs=require(_0xa325('0x9'));var fs=require('fs');var fs_extra=require(_0xa325('0xa'));var _=require(_0xa325('0xb'));var squel=require(_0xa325('0xc'));var crypto=require('crypto');var jsforce=require(_0xa325('0xd'));var deskjs=require(_0xa325('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa325('0xf'));var Papa=require(_0xa325('0x10'));var Redis=require(_0xa325('0x11'));var authService=require(_0xa325('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa325('0x13'));var hardwareService=require(_0xa325('0x14'));var logger=require(_0xa325('0x15'))(_0xa325('0x16'));var utils=require(_0xa325('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa325('0x18'));var db=require('../../mysqldb')['db'];config[_0xa325('0x19')]=_[_0xa325('0x1a')](config[_0xa325('0x19')],{'host':_0xa325('0x1b'),'port':0x18eb});var socket=require(_0xa325('0x1c'))(new Redis(config[_0xa325('0x19')]));require('./faxMessage.socket')[_0xa325('0x1d')](socket);var jayson=require(_0xa325('0x1e'));var client=jayson[_0xa325('0x1f')][_0xa325('0x20')]({'port':0x232c});var client9002=jayson[_0xa325('0x1f')][_0xa325('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2dba31,_0x37d00b,_0x208397,_0x5c758e){return new BPromise(function(_0x262e75,_0x3acd1c){var _0x58241c=_0x5c758e||client;return _0x58241c[_0xa325('0x21')](_0x2dba31,_0x208397)['then'](function(_0x2944a7){logger[_0xa325('0x22')](_0xa325('0x23'),_0x37d00b,_0xa325('0x24'));logger[_0xa325('0x25')](_0xa325('0x26'),_0x37d00b,_0xa325('0x24'),JSON[_0xa325('0x27')](_0x2944a7));if(_0x2944a7['error']){if(_0x2944a7[_0xa325('0x28')][_0xa325('0x29')]===0x1f4){logger[_0xa325('0x28')](_0xa325('0x23'),_0x37d00b,_0x2944a7[_0xa325('0x28')]['message']);return _0x3acd1c(_0x2944a7[_0xa325('0x28')]['message']);}logger[_0xa325('0x28')](_0xa325('0x23'),_0x37d00b,_0x2944a7['error'][_0xa325('0x2a')]);return _0x262e75(_0x2944a7['error'][_0xa325('0x2a')]);}else{logger[_0xa325('0x22')](_0xa325('0x23'),_0x37d00b,_0xa325('0x24'));_0x262e75(_0x2944a7[_0xa325('0x2b')][_0xa325('0x2a')]);}})[_0xa325('0x2c')](function(_0x67cd0f){logger[_0xa325('0x28')]('FaxMessage,\x20%s,\x20%s',_0x37d00b,_0x67cd0f);_0x3acd1c(_0x67cd0f);});});}function respondWithStatusCode(_0x2cf665,_0x4bcd07){_0x4bcd07=_0x4bcd07||0xcc;return function(_0x21d522){if(_0x21d522){return _0x2cf665[_0xa325('0x2d')](_0x4bcd07);}return _0x2cf665[_0xa325('0x2e')](_0x4bcd07)[_0xa325('0x2f')]();};}function respondWithResult(_0x56eadc,_0x439f86){_0x439f86=_0x439f86||0xc8;return function(_0x5609ba){if(_0x5609ba){return _0x56eadc['status'](_0x439f86)['json'](_0x5609ba);}};}function respondWithFilteredResult(_0x5b6c9d,_0x595417){return function(_0xfa8e93){if(_0xfa8e93){var _0x2caad3=typeof _0x595417['offset']===_0xa325('0x30')&&typeof _0x595417[_0xa325('0x31')]===_0xa325('0x30');var _0x20b1f0=_0xfa8e93[_0xa325('0x32')];var _0x5dd3e9=_0x2caad3?0x0:_0x595417[_0xa325('0x33')];var _0x51601d=_0x2caad3?_0xfa8e93[_0xa325('0x32')]:_0x595417[_0xa325('0x33')]+_0x595417[_0xa325('0x31')];var _0xec8347;if(_0x51601d>=_0x20b1f0){_0x51601d=_0x20b1f0;_0xec8347=0xc8;}else{_0xec8347=0xce;}_0x5b6c9d[_0xa325('0x2e')](_0xec8347);return _0x5b6c9d[_0xa325('0x34')](_0xa325('0x35'),_0x5dd3e9+'-'+_0x51601d+'/'+_0x20b1f0)[_0xa325('0x36')](_0xfa8e93);}return null;};}function patchUpdates(_0xd79244){return function(_0x4cc364){try{jsonpatch[_0xa325('0x37')](_0x4cc364,_0xd79244,!![]);}catch(_0x10982a){return BPromise[_0xa325('0x38')](_0x10982a);}return _0x4cc364[_0xa325('0x39')]();};}function saveUpdates(_0x4d24e3,_0x103c50){return function(_0x47a3b2){if(_0x47a3b2){return _0x47a3b2[_0xa325('0x3a')](_0x4d24e3)[_0xa325('0x3b')](function(_0x5cdee4){return _0x5cdee4;});}return null;};}function removeEntity(_0x3e2e91,_0x64977e){return function(_0x185b2a){if(_0x185b2a){return _0x185b2a[_0xa325('0x3c')]()[_0xa325('0x3b')](function(){_0x3e2e91[_0xa325('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45614c,_0x2d08fb){return function(_0x51bcc7){if(!_0x51bcc7){_0x45614c['sendStatus'](0x194);}return _0x51bcc7;};}function handleError(_0x2fbc67,_0x88e810){_0x88e810=_0x88e810||0x1f4;return function(_0x7ba587){logger[_0xa325('0x28')](_0x7ba587['stack']);if(_0x7ba587[_0xa325('0x3d')]){delete _0x7ba587[_0xa325('0x3d')];}_0x2fbc67[_0xa325('0x2e')](_0x88e810)[_0xa325('0x3e')](_0x7ba587);};}exports['index']=function(_0x19b3f6,_0x527605){var _0x46844e={},_0x38ee2d={},_0x57494c={'count':0x0,'rows':[]};var _0x59f33b=_['map'](db[_0xa325('0x3f')]['rawAttributes'],function(_0x43f368){return{'name':_0x43f368[_0xa325('0x40')],'type':_0x43f368[_0xa325('0x41')][_0xa325('0x42')]};});_0x38ee2d[_0xa325('0x43')]=_[_0xa325('0x44')](_0x59f33b,_0xa325('0x3d'));_0x38ee2d[_0xa325('0x45')]=_[_0xa325('0x46')](_0x19b3f6[_0xa325('0x45')]);_0x38ee2d[_0xa325('0x47')]=_['intersection'](_0x38ee2d[_0xa325('0x43')],_0x38ee2d[_0xa325('0x45')]);_0x46844e[_0xa325('0x48')]=_['intersection'](_0x38ee2d[_0xa325('0x43')],qs[_0xa325('0x49')](_0x19b3f6[_0xa325('0x45')]['fields']));_0x46844e[_0xa325('0x48')]=_0x46844e[_0xa325('0x48')]['length']?_0x46844e[_0xa325('0x48')]:_0x38ee2d['model'];if(!_0x19b3f6[_0xa325('0x45')][_0xa325('0x4a')](_0xa325('0x4b'))){_0x46844e[_0xa325('0x31')]=qs[_0xa325('0x31')](_0x19b3f6[_0xa325('0x45')]['limit']);_0x46844e['offset']=qs['offset'](_0x19b3f6[_0xa325('0x45')]['offset']);}_0x46844e['order']=qs[_0xa325('0x4c')](_0x19b3f6[_0xa325('0x45')]['sort']);_0x46844e['where']=qs[_0xa325('0x47')](_[_0xa325('0x4d')](_0x19b3f6[_0xa325('0x45')],_0x38ee2d[_0xa325('0x47')]),_0x59f33b);if(_0x19b3f6[_0xa325('0x45')][_0xa325('0x4e')]){_0x46844e[_0xa325('0x4f')]=_[_0xa325('0x50')](_0x46844e[_0xa325('0x4f')],{'$or':_['map'](_0x59f33b,function(_0x4ddb3d){if(_0x4ddb3d[_0xa325('0x41')]!==_0xa325('0x51')){var _0x184bed={};_0x184bed[_0x4ddb3d[_0xa325('0x3d')]]={'$like':'%'+_0x19b3f6[_0xa325('0x45')]['filter']+'%'};return _0x184bed;}})});}_0x46844e=_['merge']({},_0x46844e,_0x19b3f6[_0xa325('0x52')]);var _0x506d0b={'where':_0x46844e[_0xa325('0x4f')]};return db[_0xa325('0x3f')]['count'](_0x506d0b)[_0xa325('0x3b')](function(_0x1dc039){_0x57494c[_0xa325('0x32')]=_0x1dc039;if(_0x19b3f6[_0xa325('0x45')]['includeAll']){_0x46844e[_0xa325('0x53')]=[{'all':!![]}];}return db[_0xa325('0x3f')][_0xa325('0x54')](_0x46844e);})[_0xa325('0x3b')](function(_0x1a9fe4){_0x57494c[_0xa325('0x55')]=_0x1a9fe4;return _0x57494c;})['then'](respondWithFilteredResult(_0x527605,_0x46844e))['catch'](handleError(_0x527605,null));};exports[_0xa325('0x56')]=function(_0x4ab563,_0x13b2f0){var _0x5ce3fd={'raw':!![],'where':{'id':_0x4ab563[_0xa325('0x57')]['id']}},_0x5399a9={};_0x5399a9[_0xa325('0x43')]=_[_0xa325('0x46')](db[_0xa325('0x3f')]['rawAttributes']);_0x5399a9['query']=_[_0xa325('0x46')](_0x4ab563[_0xa325('0x45')]);_0x5399a9[_0xa325('0x47')]=_[_0xa325('0x58')](_0x5399a9[_0xa325('0x43')],_0x5399a9[_0xa325('0x45')]);_0x5ce3fd[_0xa325('0x48')]=_[_0xa325('0x58')](_0x5399a9[_0xa325('0x43')],qs[_0xa325('0x49')](_0x4ab563[_0xa325('0x45')][_0xa325('0x49')]));_0x5ce3fd[_0xa325('0x48')]=_0x5ce3fd[_0xa325('0x48')][_0xa325('0x59')]?_0x5ce3fd['attributes']:_0x5399a9[_0xa325('0x43')];if(_0x4ab563[_0xa325('0x45')]['includeAll']){_0x5ce3fd['include']=[{'all':!![]}];}_0x5ce3fd=_[_0xa325('0x50')]({},_0x5ce3fd,_0x4ab563[_0xa325('0x52')]);return db['FaxMessage'][_0xa325('0x5a')](_0x5ce3fd)['then'](handleEntityNotFound(_0x13b2f0,null))[_0xa325('0x3b')](respondWithResult(_0x13b2f0,null))['catch'](handleError(_0x13b2f0,null));};exports[_0xa325('0x3a')]=function(_0x17367d,_0x130762){if(_0x17367d[_0xa325('0x5b')]['id']){delete _0x17367d[_0xa325('0x5b')]['id'];}return db[_0xa325('0x3f')][_0xa325('0x5a')]({'where':{'id':_0x17367d[_0xa325('0x57')]['id']}})['then'](handleEntityNotFound(_0x130762,null))[_0xa325('0x3b')](saveUpdates(_0x17367d['body'],null))['then'](respondWithResult(_0x130762,null))[_0xa325('0x2c')](handleError(_0x130762,null));};exports[_0xa325('0x3c')]=function(_0x2bb454,_0x5e26fd){return db['FaxMessage'][_0xa325('0x5a')]({'where':{'id':_0x2bb454[_0xa325('0x57')]['id']}})[_0xa325('0x3b')](handleEntityNotFound(_0x5e26fd,null))['then'](removeEntity(_0x5e26fd,null))['catch'](handleError(_0x5e26fd,null));};exports[_0xa325('0x5c')]=function(_0xb234ae,_0x440b5c){return db[_0xa325('0x3f')][_0xa325('0x5c')]()[_0xa325('0x3b')](respondWithResult(_0x440b5c,null))[_0xa325('0x2c')](handleError(_0x440b5c,null));};var interaction_log=require(_0xa325('0x15'))('fax-interactions');exports['accept']=function(_0x2df76b,_0x4e3f2a,_0x1e457b){var _0x1b9b73={'agent':{},'channel':_0xa325('0x5d')};if(_0x2df76b[_0xa325('0x5b')]['id']){delete _0x2df76b[_0xa325('0x5b')]['id'];}_0x2df76b[_0xa325('0x5b')][_0xa325('0x5e')]=!![];_0x2df76b[_0xa325('0x5b')][_0xa325('0x5f')]=moment()[_0xa325('0x60')](_0xa325('0x61'));_0x2df76b['body'][_0xa325('0x62')]=_0x2df76b[_0xa325('0x5b')][_0xa325('0x62')]||_0x2df76b['user']['id'];_0x1b9b73['agent']['id']=_0x2df76b[_0xa325('0x5b')]['UserId'];return db[_0xa325('0x3f')][_0xa325('0x5a')]({'where':{'id':_0x2df76b['params']['id'],'UserId':null}})[_0xa325('0x3b')](handleEntityNotFound(_0x4e3f2a,null))[_0xa325('0x3b')](saveUpdates(_0x2df76b[_0xa325('0x5b')],null))['then'](function(_0x166422){if(_0x166422){_0x1b9b73['message']=_0x166422['get']({'plain':!![]});return db[_0xa325('0x63')][_0xa325('0x5a')]({'where':{'id':_0x166422[_0xa325('0x64')]}});}return null;})[_0xa325('0x3b')](handleEntityNotFound(_0x4e3f2a,null))['then'](function(_0x1e1fb6){if(_0x1e1fb6){return _0x1e1fb6[_0xa325('0x3a')]({'UserId':_0x2df76b[_0xa325('0x5b')][_0xa325('0x62')],'read1stAt':_['isNil'](_0x1e1fb6[_0xa325('0x65')])?moment()[_0xa325('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x17cdfd){if(_0x17cdfd){_0x1b9b73[_0xa325('0x66')]=_0x17cdfd[_0xa325('0x67')]({'plain':!![]});interaction_log[_0xa325('0x22')](_0xa325('0x68'),_0x2df76b[_0xa325('0x69')]['id'],_0x2df76b[_0xa325('0x69')][_0xa325('0x3d')],_0x2df76b[_0xa325('0x69')][_0xa325('0x6a')],_0x1b9b73[_0xa325('0x66')]['id'],_0x2df76b[_0xa325('0x5b')]?JSON['stringify'](_0x2df76b[_0xa325('0x5b')]):_0xa325('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xa325('0x6c'),_0x1b9b73);}return null;})[_0xa325('0x3b')](function(_0x1a67ee){var _0x1cb929=_0xa325('0x6d')+_0x1a67ee[_0xa325('0x2a')][_0xa325('0x6e')];return db[_0xa325('0x6f')][_0xa325('0x45')](_0x1cb929,{'type':db['Sequelize']['QueryTypes'][_0xa325('0x70')],'raw':!![]})['then'](function(_0x3374b7){return _0x3374b7;});})['then'](function(_0xed87f9){if(_0xed87f9){_0x1b9b73['message']['contact']=_0xed87f9[0x0];if(!_0x2df76b[_0xa325('0x5b')]['UserId'])return;return db[_0xa325('0x71')]['find']({'where':{'id':_0x2df76b[_0xa325('0x5b')][_0xa325('0x62')],'role':_0xa325('0x72')},'attributes':['id',_0xa325('0x3d'),_0xa325('0x73'),_0xa325('0x74'),_0xa325('0x75')],'raw':!![]});}return null;})[_0xa325('0x3b')](function(_0xd67396){if(!_0xd67396)return null;_0x1b9b73[_0xa325('0x2a')][_0xa325('0x72')]=_0xd67396;return _0x1b9b73;})[_0xa325('0x3b')](function(_0xf9bc0a){if(_0xf9bc0a){if(_0x2df76b[_0xa325('0x5b')][_0xa325('0x76')]){_0x1b9b73['message'][_0xa325('0x77')]=util[_0xa325('0x60')]('SIP/%s',_0x2df76b[_0xa325('0x69')][_0xa325('0x3d')]);_0x1b9b73[_0xa325('0x2a')][_0xa325('0x78')]=_0x1b9b73[_0xa325('0x78')];_0x1b9b73[_0xa325('0x2a')][_0xa325('0x79')]=_0x1b9b73[_0xa325('0x78')];_0x1b9b73['message'][_0xa325('0x7a')]='accept';return respondWithRpcPromise(_0xa325('0x7b'),'EventManager',{'event':_0xa325('0x7c'),'message':_0x1b9b73[_0xa325('0x2a')]},client9002)[_0xa325('0x3b')](function(){return _0x1b9b73;});}return _0x1b9b73;}return null;})['then'](respondWithResult(_0x4e3f2a,null))[_0xa325('0x2c')](handleError(_0x4e3f2a,null));};var interaction_log=require('../../config/logger')(_0xa325('0x7d'));exports['reject']=function(_0x4328ed,_0x1cba4d,_0x24df76){var _0x212f85={'agent':{},'channel':_0xa325('0x5d')};if(_0x4328ed[_0xa325('0x5b')]['id']){delete _0x4328ed['body']['id'];}_0x4328ed['body']['UserId']=_0x4328ed['body'][_0xa325('0x62')]||_0x4328ed[_0xa325('0x69')]['id'];_0x212f85[_0xa325('0x72')]['id']=_0x4328ed[_0xa325('0x5b')][_0xa325('0x62')];return db[_0xa325('0x3f')][_0xa325('0x5a')]({'where':{'id':_0x4328ed[_0xa325('0x57')]['id'],'UserId':null}})[_0xa325('0x3b')](handleEntityNotFound(_0x1cba4d,null))[_0xa325('0x3b')](function(_0x1a6369){if(_0x1a6369){_0x212f85[_0xa325('0x2a')]=_0x1a6369['get']({'plain':!![]});return db[_0xa325('0x63')][_0xa325('0x5a')]({'where':{'id':_0x1a6369[_0xa325('0x64')]}});}return null;})[_0xa325('0x3b')](handleEntityNotFound(_0x1cba4d,null))[_0xa325('0x3b')](function(_0x5bda0c){if(_0x5bda0c){_0x212f85[_0xa325('0x66')]=_0x5bda0c[_0xa325('0x67')]({'plain':!![]});interaction_log[_0xa325('0x22')](_0xa325('0x7e'),_0x4328ed[_0xa325('0x69')]['id'],_0x4328ed[_0xa325('0x69')][_0xa325('0x3d')],_0x4328ed[_0xa325('0x69')][_0xa325('0x6a')],_0x212f85['interaction']['id'],_0x4328ed[_0xa325('0x5b')]?JSON[_0xa325('0x27')](_0x4328ed[_0xa325('0x5b')]):_0xa325('0x6b'));return respondWithRpcPromise('RejectMessage',_0xa325('0x7f'),_0x212f85);}return null;})[_0xa325('0x3b')](function(_0x49d804){var _0x1083f5=_0xa325('0x6d')+_0x49d804[_0xa325('0x2a')]['ContactId'];return db[_0xa325('0x6f')][_0xa325('0x45')](_0x1083f5,{'type':db['Sequelize'][_0xa325('0x80')][_0xa325('0x70')],'raw':!![]})[_0xa325('0x3b')](function(_0x1f140e){return _0x1f140e;});})['then'](function(_0x2c099a){if(_0x2c099a){_0x212f85['message']['contact']=_0x2c099a[0x0];if(!_0x4328ed['body'][_0xa325('0x62')])return;return db['User']['find']({'where':{'id':_0x4328ed[_0xa325('0x5b')]['UserId'],'role':_0xa325('0x72')},'attributes':['id',_0xa325('0x3d'),_0xa325('0x73'),_0xa325('0x74'),_0xa325('0x75')],'raw':!![]});}return null;})[_0xa325('0x3b')](function(_0x1fd4c3){if(!_0x1fd4c3)return null;_0x212f85[_0xa325('0x2a')]['agent']=_0x1fd4c3;return _0x212f85;})[_0xa325('0x3b')](function(_0xca475a){if(_0xca475a){_0xca475a[_0xa325('0x2a')]['interface']=util[_0xa325('0x60')](_0xa325('0x81'),_0x4328ed[_0xa325('0x69')]['name']);_0xca475a[_0xa325('0x2a')][_0xa325('0x78')]=_0x212f85[_0xa325('0x78')];_0xca475a['message'][_0xa325('0x79')]=_0x212f85['channel'];_0xca475a['message'][_0xa325('0x7a')]='reject';respondWithRpcPromise(_0xa325('0x7b'),_0xa325('0x7b'),{'event':_0xa325('0x82'),'message':_0xca475a['message']},client9002);return _0x212f85;}return null;})[_0xa325('0x3b')](respondWithResult(_0x1cba4d,null))[_0xa325('0x2c')](handleError(_0x1cba4d,null));};exports[_0xa325('0x83')]=function(_0x863682,_0xc6bb33){var _0x263d89;return db[_0xa325('0x3f')]['create'](_0x863682[_0xa325('0x5b')],{})['then'](function(_0x1975e2){_0x263d89=_0x1975e2;return db[_0xa325('0x84')]['findOne']({'where':{'id':_0x263d89[_0xa325('0x6e')]}});})['then'](function(_0x32d9b6){if(_['isNil'](_0x32d9b6)){return;}else{_0x263d89[_0xa325('0x5d')]=_0x32d9b6[_0xa325('0x5d')];return db[_0xa325('0x85')][_0xa325('0x86')]({'where':{'id':_0x263d89['AttachmentId']}});}})[_0xa325('0x3b')](function(_0x4d17da){return respondWithRpcPromise(_0xa325('0x87'),_0xa325('0x87'),{'FaxAccountId':_['isNil'](_0x863682[_0xa325('0x5b')])?undefined:_0x863682[_0xa325('0x5b')][_0xa325('0x88')],'path':_['isNil'](_0x4d17da)?undefined:util[_0xa325('0x60')](_0xa325('0x89'),_0x4d17da[_0xa325('0x8a')]),'fax':_[_0xa325('0x8b')](_0x263d89[_0xa325('0x5d')])?undefined:_0x263d89[_0xa325('0x5d')],'AttachmentId':_0x263d89[_0xa325('0x8c')]},client9002);})['then'](respondWithResult(_0xc6bb33,0xc9))[_0xa325('0x2c')](handleError(_0xc6bb33,null));};exports[_0xa325('0x8d')]=function(_0x1c51ca,_0x5f2dd1){var _0x40eeb1=path[_0xa325('0x8e')](config[_0xa325('0x8f')],_0xa325('0x90'),_0xa325('0x91'),_0xa325('0x92'));return db['FaxMessage']['find']({'where':{'id':_0x1c51ca[_0xa325('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0xa325('0x85')}]})[_0xa325('0x3b')](handleEntityNotFound(_0x5f2dd1,null))[_0xa325('0x3b')](function(_0x39c74e){if(_0x39c74e){return _0x5f2dd1[_0xa325('0x8d')](path[_0xa325('0x8e')](_0x40eeb1,_0x39c74e[_0xa325('0x85')][_0xa325('0x8a')]));}})[_0xa325('0x2c')](handleError(_0x5f2dd1,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 4c0d5dd..7d7bfc0 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 _0xd386=['FaxMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x17e0af,_0x28e8f5){var _0x4b4266=function(_0x1100e1){while(--_0x1100e1){_0x17e0af['push'](_0x17e0af['shift']());}};_0x4b4266(++_0x28e8f5);}(_0xd386,0x10c));var _0x6d38=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xd386[_0x3ad7ad];return _0x225a60;};'use strict';var EventEmitter=require(_0x6d38('0x0'));var FaxMessage=require(_0x6d38('0x1'))['db'][_0x6d38('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d38('0x3'),'afterUpdate':_0x6d38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ce7c5){return function(_0x21b7ee,_0x97f669,_0xa6b2b3){FaxMessageEvents['emit'](_0x1ce7c5+':'+_0x21b7ee['id'],_0x21b7ee);FaxMessageEvents[_0x6d38('0x5')](_0x1ce7c5,_0x21b7ee);_0xa6b2b3(null);};}for(var e in events){if(events[_0x6d38('0x6')](e)){var event=events[e];FaxMessage[_0x6d38('0x7')](e,emitEvent(event));}}module[_0x6d38('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x2cd0=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x28cebf,_0x2be3e9){var _0x4ffbc5=function(_0x569dee){while(--_0x569dee){_0x28cebf['push'](_0x28cebf['shift']());}};_0x4ffbc5(++_0x2be3e9);}(_0x2cd0,0x10f));var _0x02cd=function(_0x1e81f9,_0x24f52f){_0x1e81f9=_0x1e81f9-0x0;var _0x5939ab=_0x2cd0[_0x1e81f9];return _0x5939ab;};'use strict';var EventEmitter=require(_0x02cd('0x0'));var FaxMessage=require(_0x02cd('0x1'))['db'][_0x02cd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x02cd('0x3')](0x0);var events={'afterCreate':_0x02cd('0x4'),'afterUpdate':_0x02cd('0x5'),'afterDestroy':_0x02cd('0x6')};function emitEvent(_0x215b17){return function(_0x4fecc3,_0x3dfd49,_0x3c4a73){FaxMessageEvents[_0x02cd('0x7')](_0x215b17+':'+_0x4fecc3['id'],_0x4fecc3);FaxMessageEvents[_0x02cd('0x7')](_0x215b17,_0x4fecc3);_0x3c4a73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x02cd('0x8')](e,emitEvent(event));}}module[_0x02cd('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 77fd019..896ee04 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 _0x85d0=['../../config/environment','./faxMessage.attributes','FaxMessage','fax_messages','body','FULLTEXT','get','toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','direction','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46a930,_0x4a77ce){var _0x8822a=function(_0x4c1c69){while(--_0x4c1c69){_0x46a930['push'](_0x46a930['shift']());}};_0x8822a(++_0x4a77ce);}(_0x85d0,0x170));var _0x085d=function(_0x40c443,_0x1c851b){_0x40c443=_0x40c443-0x0;var _0x28e0e9=_0x85d0[_0x40c443];return _0x28e0e9;};'use strict';var _=require(_0x085d('0x0'));var util=require(_0x085d('0x1'));var logger=require(_0x085d('0x2'))(_0x085d('0x3'));var moment=require(_0x085d('0x4'));var BPromise=require(_0x085d('0x5'));var rp=require(_0x085d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x085d('0x7'));var attributes=require(_0x085d('0x8'));module['exports']=function(_0x1d33da,_0x4f89ba){return _0x1d33da['define'](_0x085d('0x9'),attributes,{'tableName':_0x085d('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x085d('0xb')],'type':_0x085d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47575f,_0x3d7898,_0x121990){var _0x2e00bf=_0x1d33da['models'];var _0x5641d4=_0x47575f[_0x085d('0xd')]({'plain':!![]});if(_0x5641d4['direction'][_0x085d('0xe')]()==='in'||_0x5641d4['direction'][_0x085d('0xe')]()==='out'&&!_0x5641d4[_0x085d('0xf')]&&!_[_0x085d('0x10')](_0x5641d4['UserId'])){_0x2e00bf[_0x085d('0x11')][_0x085d('0x12')]({'where':{'id':_0x5641d4[_0x085d('0x13')]}})[_0x085d('0x14')](function(_0x5f2ffd){if(_0x5f2ffd){_0x5f2ffd['update']({'lastMsgAt':_0x5641d4[_0x085d('0x15')],'lastMsgDirection':_0x5641d4[_0x085d('0x16')]['toLowerCase']()});}})[_0x085d('0x17')](function(_0x83348c){console[_0x085d('0x18')](_0x83348c);});}_0x121990();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe361=['FaxInteractionId','catch','error','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xe361,0xe4));var _0x1e36=function(_0x448313,_0x2b5e0f){_0x448313=_0x448313-0x0;var _0x3740be=_0xe361[_0x448313];return _0x3740be;};'use strict';var _=require(_0x1e36('0x0'));var util=require('util');var logger=require(_0x1e36('0x1'))(_0x1e36('0x2'));var moment=require(_0x1e36('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e36('0x4'));var fs=require('fs');var path=require(_0x1e36('0x5'));var rimraf=require(_0x1e36('0x6'));var config=require('../../config/environment');var attributes=require(_0x1e36('0x7'));module[_0x1e36('0x8')]=function(_0xf86835,_0x20615b){return _0xf86835[_0x1e36('0x9')](_0x1e36('0xa'),attributes,{'tableName':_0x1e36('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x1e36('0xc')],'type':_0x1e36('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38cef3,_0x2acefc,_0x46318f){var _0x136f8c=_0xf86835[_0x1e36('0xe')];var _0x5e650c=_0x38cef3[_0x1e36('0xf')]({'plain':!![]});if(_0x5e650c[_0x1e36('0x10')][_0x1e36('0x11')]()==='in'||_0x5e650c[_0x1e36('0x10')][_0x1e36('0x11')]()===_0x1e36('0x12')&&!_0x5e650c[_0x1e36('0x13')]&&!_[_0x1e36('0x14')](_0x5e650c[_0x1e36('0x15')])){_0x136f8c[_0x1e36('0x16')][_0x1e36('0x17')]({'where':{'id':_0x5e650c[_0x1e36('0x18')]}})['then'](function(_0x333256){if(_0x333256){_0x333256['update']({'lastMsgAt':_0x5e650c['createdAt'],'lastMsgDirection':_0x5e650c[_0x1e36('0x10')]['toLowerCase']()});}})[_0x1e36('0x19')](function(_0x185914){console[_0x1e36('0x1a')](_0x185914);});}_0x46318f();}},'charset':_0x1e36('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index be05b32..afa5325 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 _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x519ee0,_0x7412ab){var _0x5d8910=function(_0x21305c){while(--_0x21305c){_0x519ee0['push'](_0x519ee0['shift']());}};_0x5d8910(++_0x7412ab);}(_0x0e85,0x7c));var _0x50e8=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x0e85[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file +var _0xb458=['info','result','catch','FaxMessage','create','body','options','then','CreateFaxMessage','update','raw','where','attributes','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','register','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb458,0x103));var _0x8b45=function(_0x1faf67,_0x7ad662){_0x1faf67=_0x1faf67-0x0;var _0x387342=_0xb458[_0x1faf67];return _0x387342;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});config[_0x8b45('0x9')]=_[_0x8b45('0xa')](config[_0x8b45('0x9')],{'host':_0x8b45('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b45('0x9')]));require(_0x8b45('0xc'))[_0x8b45('0xd')](socket);function respondWithRpcPromise(_0x2bc809,_0x2f7117,_0x499899){return new BPromise(function(_0x2a4c83,_0x7cc49b){return client['request'](_0x2bc809,_0x499899)['then'](function(_0x5bb708){logger['info'](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));logger[_0x8b45('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f7117,_0x8b45('0xf'),JSON[_0x8b45('0x11')](_0x5bb708));if(_0x5bb708[_0x8b45('0x12')]){if(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x13')]===0x1f4){logger[_0x8b45('0x12')]('FaxMessage,\x20%s,\x20%s',_0x2f7117,_0x5bb708['error'][_0x8b45('0x14')]);return _0x7cc49b(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);return _0x2a4c83(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}else{logger[_0x8b45('0x15')](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));_0x2a4c83(_0x5bb708[_0x8b45('0x16')][_0x8b45('0x14')]);}})[_0x8b45('0x17')](function(_0x31c6b4){logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x31c6b4);_0x7cc49b(_0x31c6b4);});});}exports['CreateFaxMessage']=function(_0x25e8a1){var _0x2db2d1=this;return new Promise(function(_0x1767d5,_0x46e21a){return db[_0x8b45('0x18')][_0x8b45('0x19')](_0x25e8a1[_0x8b45('0x1a')],{'raw':_0x25e8a1[_0x8b45('0x1b')]?_0x25e8a1['options']['raw']===undefined?!![]:![]:!![]})[_0x8b45('0x1c')](function(_0x580e17){logger[_0x8b45('0x15')](_0x8b45('0x1d'),_0x25e8a1);logger[_0x8b45('0x10')](_0x8b45('0x1d'),_0x25e8a1,JSON[_0x8b45('0x11')](_0x580e17));_0x1767d5(_0x580e17);})[_0x8b45('0x17')](function(_0x32b12b){logger['error']('CreateFaxMessage',_0x32b12b[_0x8b45('0x14')],_0x25e8a1);_0x46e21a(_0x2db2d1[_0x8b45('0x12')](0x1f4,_0x32b12b['message']));});});};exports['UpdateFaxMessage']=function(_0x129c35){var _0x32f6f0=this;return new Promise(function(_0x2ca2d9,_0x2f37bc){return db['FaxMessage'][_0x8b45('0x1e')](_0x129c35[_0x8b45('0x1a')],{'raw':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x20')]||null:null,'attributes':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')][_0x8b45('0x21')]||null:null,'limit':_0x129c35[_0x8b45('0x1b')]?_0x129c35[_0x8b45('0x1b')]['limit']||null:null})[_0x8b45('0x1c')](function(_0x36db96){logger[_0x8b45('0x15')](_0x8b45('0x22'),_0x129c35);logger[_0x8b45('0x10')](_0x8b45('0x22'),_0x129c35,JSON[_0x8b45('0x11')](_0x36db96));_0x2ca2d9(_0x36db96);})[_0x8b45('0x17')](function(_0x5d8938){logger[_0x8b45('0x12')](_0x8b45('0x22'),_0x5d8938[_0x8b45('0x14')],_0x129c35);_0x2f37bc(_0x32f6f0[_0x8b45('0x12')](0x1f4,_0x5d8938[_0x8b45('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3a3f0a2..a75c50c 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 _0x35bf=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x35bf,0xa2));var _0xf35b=function(_0x3514e4,_0x19fe27){_0x3514e4=_0x3514e4-0x0;var _0x3b5cb6=_0x35bf[_0x3514e4];return _0x3b5cb6;};'use strict';var FaxMessageEvents=require(_0xf35b('0x0'));var events=[_0xf35b('0x1'),_0xf35b('0x2'),_0xf35b('0x3')];function createListener(_0x147b5d,_0x4e28ae){return function(_0x52e36c){_0x4e28ae['emit'](_0x147b5d,_0x52e36c);};}function removeListener(_0x4553a6,_0x4c48fd){return function(){FaxMessageEvents[_0xf35b('0x4')](_0x4553a6,_0x4c48fd);};}exports[_0xf35b('0x5')]=function(_0x3af58b){for(var _0xa1c35c=0x0,_0x2f308f=events[_0xf35b('0x6')];_0xa1c35c<_0x2f308f;_0xa1c35c++){var _0x29b48d=events[_0xa1c35c];var _0x3c5c20=createListener(_0xf35b('0x7')+_0x29b48d,_0x3af58b);FaxMessageEvents['on'](_0x29b48d,_0x3c5c20);}}; \ No newline at end of file +var _0x1dd0=['./faxMessage.events','save','update','emit','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1dd0,0x1c7));var _0x01dd=function(_0x320382,_0x4695b2){_0x320382=_0x320382-0x0;var _0x557cd7=_0x1dd0[_0x320382];return _0x557cd7;};'use strict';var FaxMessageEvents=require(_0x01dd('0x0'));var events=[_0x01dd('0x1'),'remove',_0x01dd('0x2')];function createListener(_0x39ef8f,_0x2a01e4){return function(_0x4f9449){_0x2a01e4[_0x01dd('0x3')](_0x39ef8f,_0x4f9449);};}function removeListener(_0x5bcf47,_0x277034){return function(){FaxMessageEvents['removeListener'](_0x5bcf47,_0x277034);};}exports['register']=function(_0x549d50){for(var _0x2c4964=0x0,_0x25a0ae=events[_0x01dd('0x4')];_0x2c4964<_0x25a0ae;_0x2c4964++){var _0x28823e=events[_0x2c4964];var _0x1b357f=createListener('faxMessage:'+_0x28823e,_0x549d50);FaxMessageEvents['on'](_0x28823e,_0x1b357f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index ea93b0d..ea76556 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 _0xaa88=['describe','get','show','download','post','fax','faxmessage:create','put','/:id','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated'];(function(_0x19e915,_0x3ac017){var _0x23c76c=function(_0x50ab75){while(--_0x50ab75){_0x19e915['push'](_0x19e915['shift']());}};_0x23c76c(++_0x3ac017);}(_0xaa88,0x137));var _0x8aa8=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0xaa88[_0x3a0c4f];return _0x247049;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0xe')]('/:id/download',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x11')]('/',auth[_0x8aa8('0xc')](),interaction['tracked'](_0x8aa8('0x12'),_0x8aa8('0x13')),controller['create']);router[_0x8aa8('0x14')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x16'),auth[_0x8aa8('0xc')](),controller['accept']);router[_0x8aa8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8aa8('0x17')]);router[_0x8aa8('0x18')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x19')]);module[_0x8aa8('0x1a')]=router; \ No newline at end of file +var _0x702d=['get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x306555,_0x5d2051){var _0x3d6213=function(_0x4cb1bd){while(--_0x4cb1bd){_0x306555['push'](_0x306555['shift']());}};_0x3d6213(++_0x5d2051);}(_0x702d,0x147));var _0xd702=function(_0x436db0,_0x2fc867){_0x436db0=_0x436db0-0x0;var _0x3b7f62=_0x702d[_0x436db0];return _0x3b7f62;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./faxMessage.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0xc')]);router['get'](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0xf')]);router[_0xd702('0x9')](_0xd702('0x10'),auth[_0xd702('0xe')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')]('/',auth[_0xd702('0xe')](),interaction[_0xd702('0x13')]('fax','faxmessage:create'),controller[_0xd702('0x14')]);router[_0xd702('0x15')](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x16')]);router[_0xd702('0x15')](_0xd702('0x17'),auth[_0xd702('0xe')](),controller[_0xd702('0x18')]);router[_0xd702('0x15')]('/:id/reject',auth[_0xd702('0xe')](),controller[_0xd702('0x19')]);router['delete'](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x1a')]);module[_0xd702('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 6f8d514..620c9ef 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 _0x7e0a=['ENUM','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x708c33,_0x57e9f2){var _0xe5e059=function(_0x209937){while(--_0x209937){_0x708c33['push'](_0x708c33['shift']());}};_0xe5e059(++_0x57e9f2);}(_0x7e0a,0x15a));var _0xa7e0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x7e0a[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xa7e0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7e0('0x1')],'unique':_0xa7e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7e0('0x1')]},'timeout':{'type':Sequelize[_0xa7e0('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7e0('0x4')]('rrmemory',_0xa7e0('0x5'),_0xa7e0('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa23f=['INTEGER','sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x27672f,_0x2a8d01){var _0x1afe2b=function(_0x5aea0e){while(--_0x5aea0e){_0x27672f['push'](_0x27672f['shift']());}};_0x1afe2b(++_0x2a8d01);}(_0xa23f,0x18d));var _0xfa23=function(_0xd3a6e5,_0xb40884){_0xd3a6e5=_0xd3a6e5-0x0;var _0x56fd99=_0xa23f[_0xd3a6e5];return _0x56fd99;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'name':{'type':Sequelize[_0xfa23('0x2')],'unique':_0xfa23('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa23('0x4')](_0xfa23('0x5'),_0xfa23('0x6'),_0xfa23('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfa23('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 873ba5e..7d72162 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 _0x6d72=['fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','FaxQueues','error','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','FaxQueue','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserFaxQueue','nolimit','User','agent','faxPause','updatedAt','createdAt','format','SIP','Team','ids','findAll','Agents','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4403e5,_0x32ddae){var _0x512114=function(_0x1f21cb){while(--_0x1f21cb){_0x4403e5['push'](_0x4403e5['shift']());}};_0x512114(++_0x32ddae);}(_0x6d72,0x7d));var _0x26d7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6d72[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26d7('0x0'));var zipdir=require(_0x26d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26d7('0x2'));var moment=require(_0x26d7('0x3'));var BPromise=require(_0x26d7('0x4'));var Mustache=require(_0x26d7('0x5'));var util=require(_0x26d7('0x6'));var path=require(_0x26d7('0x7'));var sox=require(_0x26d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26d7('0x9'));var _=require(_0x26d7('0xa'));var squel=require(_0x26d7('0xb'));var crypto=require(_0x26d7('0xc'));var jsforce=require(_0x26d7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x26d7('0xe'));var querystring=require(_0x26d7('0xf'));var Papa=require(_0x26d7('0x10'));var Redis=require('ioredis');var authService=require(_0x26d7('0x11'));var qs=require(_0x26d7('0x12'));var as=require(_0x26d7('0x13'));var hardwareService=require(_0x26d7('0x14'));var logger=require(_0x26d7('0x15'))(_0x26d7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26d7('0x17'))['db'];config[_0x26d7('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x26d7('0x19'))(new Redis(config[_0x26d7('0x18')]));require(_0x26d7('0x1a'))['register'](socket);function respondWithStatusCode(_0x4deb0e,_0x20fc47){_0x20fc47=_0x20fc47||0xcc;return function(_0x3cfd8b){if(_0x3cfd8b){return _0x4deb0e[_0x26d7('0x1b')](_0x20fc47);}return _0x4deb0e[_0x26d7('0x1c')](_0x20fc47)[_0x26d7('0x1d')]();};}function respondWithResult(_0x25ed79,_0x41e827){_0x41e827=_0x41e827||0xc8;return function(_0x2c1163){if(_0x2c1163){return _0x25ed79['status'](_0x41e827)[_0x26d7('0x1e')](_0x2c1163);}};}function respondWithFilteredResult(_0x3d4b42,_0x3e528a){return function(_0xcca7e7){if(_0xcca7e7){var _0x1d3ce4=typeof _0x3e528a[_0x26d7('0x1f')]===_0x26d7('0x20')&&typeof _0x3e528a[_0x26d7('0x21')]===_0x26d7('0x20');var _0x1855e4=_0xcca7e7[_0x26d7('0x22')];var _0x5c9e58=_0x1d3ce4?0x0:_0x3e528a[_0x26d7('0x1f')];var _0x5b8ee4=_0x1d3ce4?_0xcca7e7[_0x26d7('0x22')]:_0x3e528a[_0x26d7('0x1f')]+_0x3e528a['limit'];var _0x23098b;if(_0x5b8ee4>=_0x1855e4){_0x5b8ee4=_0x1855e4;_0x23098b=0xc8;}else{_0x23098b=0xce;}_0x3d4b42['status'](_0x23098b);return _0x3d4b42[_0x26d7('0x23')](_0x26d7('0x24'),_0x5c9e58+'-'+_0x5b8ee4+'/'+_0x1855e4)[_0x26d7('0x1e')](_0xcca7e7);}return null;};}function patchUpdates(_0x467685){return function(_0x566b03){try{jsonpatch[_0x26d7('0x25')](_0x566b03,_0x467685,!![]);}catch(_0x3b29fc){return BPromise[_0x26d7('0x26')](_0x3b29fc);}return _0x566b03['save']();};}function saveUpdates(_0x184279,_0x243212){return function(_0x21dfd1){if(_0x21dfd1){return _0x21dfd1[_0x26d7('0x27')](_0x184279)[_0x26d7('0x28')](function(_0x2fc51b){return _0x2fc51b;});}return null;};}function removeEntity(_0x3cb015,_0x35d39d){return function(_0xe9a009){if(_0xe9a009){return _0xe9a009['destroy']()[_0x26d7('0x28')](function(){var _0x30f17a=_0xe9a009[_0x26d7('0x29')]({'plain':!![]});var _0x102148=_0x26d7('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x102148,'resourceId':_0x30f17a['id']}})[_0x26d7('0x28')](function(){return _0xe9a009;});})[_0x26d7('0x28')](function(){_0x3cb015[_0x26d7('0x1c')](0xcc)[_0x26d7('0x1d')]();});}};}function handleEntityNotFound(_0x45f7b4,_0x369bac){return function(_0x5a9946){if(!_0x5a9946){_0x45f7b4['sendStatus'](0x194);}return _0x5a9946;};}function handleError(_0x569c23,_0x5a118e){_0x5a118e=_0x5a118e||0x1f4;return function(_0x58e6d1){logger[_0x26d7('0x2b')](_0x58e6d1['stack']);if(_0x58e6d1[_0x26d7('0x2c')]){delete _0x58e6d1[_0x26d7('0x2c')];}_0x569c23[_0x26d7('0x1c')](_0x5a118e)[_0x26d7('0x2d')](_0x58e6d1);};}exports[_0x26d7('0x2e')]=function(_0x21fde9,_0x31e554){var _0x504eff={},_0x4dc8f9={},_0x57c8a5={'count':0x0,'rows':[]};var _0x2c647f=_['map'](db['FaxQueue'][_0x26d7('0x2f')],function(_0xea8020){return{'name':_0xea8020['fieldName'],'type':_0xea8020['type'][_0x26d7('0x30')]};});_0x4dc8f9[_0x26d7('0x31')]=_['map'](_0x2c647f,'name');_0x4dc8f9[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x21fde9[_0x26d7('0x32')]);_0x4dc8f9[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x4dc8f9['model'],_0x4dc8f9[_0x26d7('0x32')]);_0x504eff[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x4dc8f9[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x21fde9[_0x26d7('0x32')]['fields']));_0x504eff['attributes']=_0x504eff[_0x26d7('0x36')][_0x26d7('0x38')]?_0x504eff[_0x26d7('0x36')]:_0x4dc8f9[_0x26d7('0x31')];if(!_0x21fde9[_0x26d7('0x32')][_0x26d7('0x39')]('nolimit')){_0x504eff[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x21fde9[_0x26d7('0x32')][_0x26d7('0x21')]);_0x504eff[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x21fde9[_0x26d7('0x32')]['offset']);}_0x504eff[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x21fde9[_0x26d7('0x32')]['sort']);_0x504eff[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_[_0x26d7('0x3d')](_0x21fde9[_0x26d7('0x32')],_0x4dc8f9[_0x26d7('0x34')]),_0x2c647f);if(_0x21fde9['query'][_0x26d7('0x3e')]){_0x504eff[_0x26d7('0x3c')]=_[_0x26d7('0x3f')](_0x504eff[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x2c647f,function(_0x18e017){if(_0x18e017[_0x26d7('0x41')]!==_0x26d7('0x42')){var _0x526ab9={};_0x526ab9[_0x18e017[_0x26d7('0x2c')]]={'$like':'%'+_0x21fde9[_0x26d7('0x32')]['filter']+'%'};return _0x526ab9;}})});}_0x504eff=_[_0x26d7('0x3f')]({},_0x504eff,_0x21fde9[_0x26d7('0x43')]);var _0x381595={'where':_0x504eff[_0x26d7('0x3c')]};return db[_0x26d7('0x44')][_0x26d7('0x22')](_0x381595)[_0x26d7('0x28')](function(_0x500ce6){_0x57c8a5[_0x26d7('0x22')]=_0x500ce6;if(_0x21fde9['query']['includeAll']){_0x504eff[_0x26d7('0x45')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x504eff);})[_0x26d7('0x28')](function(_0x421512){_0x57c8a5[_0x26d7('0x46')]=_0x421512;return _0x57c8a5;})[_0x26d7('0x28')](respondWithFilteredResult(_0x31e554,_0x504eff))[_0x26d7('0x47')](handleError(_0x31e554,null));};exports[_0x26d7('0x48')]=function(_0x8f22df,_0x25d569){var _0x42b351={'raw':!![],'where':{'id':_0x8f22df[_0x26d7('0x49')]['id']}},_0x36c5cc={};_0x36c5cc['model']=_[_0x26d7('0x33')](db['FaxQueue'][_0x26d7('0x2f')]);_0x36c5cc[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x8f22df[_0x26d7('0x32')]);_0x36c5cc[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x36c5cc[_0x26d7('0x31')],_0x36c5cc['query']);_0x42b351[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x36c5cc[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x8f22df[_0x26d7('0x32')][_0x26d7('0x37')]));_0x42b351[_0x26d7('0x36')]=_0x42b351['attributes'][_0x26d7('0x38')]?_0x42b351[_0x26d7('0x36')]:_0x36c5cc[_0x26d7('0x31')];if(_0x8f22df[_0x26d7('0x32')]['includeAll']){_0x42b351['include']=[{'all':!![]}];}_0x42b351=_[_0x26d7('0x3f')]({},_0x42b351,_0x8f22df['options']);return db[_0x26d7('0x44')][_0x26d7('0x4a')](_0x42b351)[_0x26d7('0x28')](handleEntityNotFound(_0x25d569,null))['then'](respondWithResult(_0x25d569,null))['catch'](handleError(_0x25d569,null));};exports[_0x26d7('0x4b')]=function(_0x59303c,_0x12fdfd){return db[_0x26d7('0x44')][_0x26d7('0x4b')](_0x59303c[_0x26d7('0x4c')],{})[_0x26d7('0x28')](function(_0x433f80){var _0x2d4646=_0x59303c['user']['get']({'plain':!![]});if(!_0x2d4646)throw new Error(_0x26d7('0x4d'));if(_0x2d4646[_0x26d7('0x4e')]===_0x26d7('0x4f')){var _0x42d43e=_0x433f80[_0x26d7('0x29')]({'plain':!![]});var _0x120316='FaxQueues';return db[_0x26d7('0x50')][_0x26d7('0x4a')]({'where':{'name':_0x120316,'userProfileId':_0x2d4646[_0x26d7('0x51')]},'raw':!![]})[_0x26d7('0x28')](function(_0x149ba8){if(_0x149ba8&&_0x149ba8[_0x26d7('0x52')]===0x0){return db[_0x26d7('0x53')][_0x26d7('0x4b')]({'name':_0x42d43e[_0x26d7('0x2c')],'resourceId':_0x42d43e['id'],'type':_0x149ba8[_0x26d7('0x2c')],'sectionId':_0x149ba8['id']},{})['then'](function(){return _0x433f80;});}else{return _0x433f80;}})[_0x26d7('0x47')](function(_0x54f33d){logger['error'](_0x26d7('0x54'),_0x54f33d);throw _0x54f33d;});}return _0x433f80;})[_0x26d7('0x28')](respondWithResult(_0x12fdfd,0xc9))[_0x26d7('0x47')](handleError(_0x12fdfd,null));};exports[_0x26d7('0x27')]=function(_0x484ae4,_0x1cbc0d){if(_0x484ae4[_0x26d7('0x4c')]['id']){delete _0x484ae4[_0x26d7('0x4c')]['id'];}return db[_0x26d7('0x44')]['find']({'where':{'id':_0x484ae4[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x1cbc0d,null))[_0x26d7('0x28')](saveUpdates(_0x484ae4[_0x26d7('0x4c')],null))[_0x26d7('0x28')](respondWithResult(_0x1cbc0d,null))[_0x26d7('0x47')](handleError(_0x1cbc0d,null));};exports[_0x26d7('0x55')]=function(_0x1ba269,_0x2161ca){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x1ba269[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x2161ca,null))[_0x26d7('0x28')](removeEntity(_0x2161ca,null))['catch'](handleError(_0x2161ca,null));};exports[_0x26d7('0x56')]=function(_0x3e6753,_0x5e9900){return db['FaxQueue']['describe']()[_0x26d7('0x28')](respondWithResult(_0x5e9900,null))[_0x26d7('0x47')](handleError(_0x5e9900,null));};exports[_0x26d7('0x57')]=function(_0x503f9e,_0x4b1dba,_0x2686a5){var _0x55edb8={'raw':!![],'where':{}},_0x4fa81e={},_0x50ee4b;return db[_0x26d7('0x44')][_0x26d7('0x58')]({'where':{'id':_0x503f9e[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x4b1dba,null))[_0x26d7('0x28')](function(_0x263fe8){if(_0x263fe8){_0x50ee4b=_0x263fe8[_0x26d7('0x29')]({'plain':!![]});_0x4fa81e['model']=_['keys'](db[_0x26d7('0x59')][_0x26d7('0x2f')]);_0x4fa81e[_0x26d7('0x32')]=_['keys'](_0x503f9e['query']);_0x4fa81e[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x4fa81e[_0x26d7('0x31')],_0x4fa81e[_0x26d7('0x32')]);_0x55edb8['attributes']=_[_0x26d7('0x35')](_0x4fa81e[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x503f9e[_0x26d7('0x32')][_0x26d7('0x37')]));_0x55edb8['attributes']=_0x55edb8[_0x26d7('0x36')]['length']?_0x55edb8['attributes']:_0x4fa81e[_0x26d7('0x31')];if(!_0x503f9e[_0x26d7('0x32')][_0x26d7('0x39')](_0x26d7('0x5a'))){_0x55edb8[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x503f9e[_0x26d7('0x32')]['limit']);_0x55edb8[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x503f9e[_0x26d7('0x32')][_0x26d7('0x1f')]);}_0x55edb8[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x503f9e['query'][_0x26d7('0x3b')]);_0x55edb8[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_[_0x26d7('0x3d')](_0x503f9e['query'],_0x4fa81e[_0x26d7('0x34')]));_0x55edb8['where']['FaxQueueId']=_0x263fe8['id'];if(_0x503f9e[_0x26d7('0x32')][_0x26d7('0x3e')]){_0x55edb8[_0x26d7('0x3c')]=_[_0x26d7('0x3f')](_0x55edb8[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x55edb8['attributes'],function(_0x3a6207){var _0x5a0548={};_0x5a0548[_0x3a6207]={'$like':'%'+_0x503f9e[_0x26d7('0x32')]['filter']+'%'};return _0x5a0548;})});}_0x55edb8=_[_0x26d7('0x3f')]({},_0x55edb8,_0x503f9e['options']);return db[_0x26d7('0x59')]['findAll'](_0x55edb8);}})[_0x26d7('0x28')](function(_0x2d0b9f){if(_0x2d0b9f){return db[_0x26d7('0x5b')]['findAndCountAll']({'where':{'id':_[_0x26d7('0x40')](_0x2d0b9f,'UserId'),'role':_0x26d7('0x5c')},'attributes':['id',_0x26d7('0x2c'),_0x26d7('0x5d'),_0x26d7('0x5e'),_0x26d7('0x5f')]});}})[_0x26d7('0x28')](function(_0x6ad851){if(_0x6ad851){return{'count':_0x6ad851[_0x26d7('0x22')],'rows':_[_0x26d7('0x40')](_0x6ad851[_0x26d7('0x46')],function(_0x50866e){return{'membername':_0x50866e[_0x26d7('0x2c')],'UserId':_0x50866e['id'],'queue_name':_0x50ee4b[_0x26d7('0x2c')],'FaxQueueId':_0x50ee4b['id'],'interface':util[_0x26d7('0x60')]('%s/%s',_0x26d7('0x61'),_0x50866e[_0x26d7('0x2c')]),'penalty':0x0,'paused':_0x50866e[_0x26d7('0x5d')],'createdAt':_0x50866e['createdAt'],'updatedAt':_0x50866e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x26d7('0x28')](respondWithFilteredResult(_0x4b1dba,_0x55edb8))['catch'](handleError(_0x4b1dba,null));};exports['getTeams']=function(_0x461a33,_0x5efe9b,_0x5962f6){var _0x360c4b={};var _0x5bc5bc={};var _0x2903f0;var _0x5b10f1;return db['FaxQueue'][_0x26d7('0x58')]({'where':{'id':_0x461a33[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x5efe9b,null))[_0x26d7('0x28')](function(_0x5b0c35){if(_0x5b0c35){_0x2903f0=_0x5b0c35;_0x5bc5bc[_0x26d7('0x31')]=_[_0x26d7('0x33')](db[_0x26d7('0x62')][_0x26d7('0x2f')]);_0x5bc5bc[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x461a33[_0x26d7('0x32')]);_0x5bc5bc['filters']=_[_0x26d7('0x35')](_0x5bc5bc[_0x26d7('0x31')],_0x5bc5bc[_0x26d7('0x32')]);_0x360c4b['attributes']=_[_0x26d7('0x35')](_0x5bc5bc['model'],qs[_0x26d7('0x37')](_0x461a33[_0x26d7('0x32')][_0x26d7('0x37')]));_0x360c4b[_0x26d7('0x36')]=_0x360c4b['attributes'][_0x26d7('0x38')]?_0x360c4b[_0x26d7('0x36')]:_0x5bc5bc['model'];_0x360c4b[_0x26d7('0x3a')]=qs['sort'](_0x461a33[_0x26d7('0x32')][_0x26d7('0x3b')]);_0x360c4b[_0x26d7('0x3c')]=qs[_0x26d7('0x34')](_['pick'](_0x461a33[_0x26d7('0x32')],_0x5bc5bc[_0x26d7('0x34')]));if(_0x461a33[_0x26d7('0x32')][_0x26d7('0x3e')]){_0x360c4b['where']=_[_0x26d7('0x3f')](_0x360c4b[_0x26d7('0x3c')],{'$or':_[_0x26d7('0x40')](_0x360c4b['attributes'],function(_0x183ae4){var _0xae56d5={};_0xae56d5[_0x183ae4]={'$like':'%'+_0x461a33['query'][_0x26d7('0x3e')]+'%'};return _0xae56d5;})});}_0x360c4b=_['merge']({},_0x360c4b,_0x461a33['options']);return _0x2903f0['getTeams'](_0x360c4b);}})[_0x26d7('0x28')](function(_0x4b6045){if(_0x4b6045){_0x5b10f1=_0x4b6045[_0x26d7('0x38')];if(!_0x461a33[_0x26d7('0x32')][_0x26d7('0x39')](_0x26d7('0x5a'))){_0x360c4b[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x461a33['query']['limit']);_0x360c4b[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x461a33[_0x26d7('0x32')]['offset']);}return _0x2903f0['getTeams'](_0x360c4b);}})['then'](function(_0x2dd8fa){if(_0x2dd8fa){return _0x2dd8fa?{'count':_0x5b10f1,'rows':_0x2dd8fa}:null;}})[_0x26d7('0x28')](respondWithResult(_0x5efe9b,null))[_0x26d7('0x47')](handleError(_0x5efe9b,null));};exports['addTeams']=function(_0x2a7927,_0x26e49a,_0x4f5eaa){var _0x122d75=_0x2a7927['body'][_0x26d7('0x63')];return db[_0x26d7('0x62')][_0x26d7('0x64')]({'where':{'id':_0x122d75},'attributes':['id'],'include':[{'model':db[_0x26d7('0x5b')],'as':_0x26d7('0x65'),'attributes':['id',_0x26d7('0x2c'),'online',_0x26d7('0x66'),_0x26d7('0x67')],'raw':!![]}]})[_0x26d7('0x28')](function(_0x5249d9){if(_0x5249d9){var _0x1c19bf=_['flatMap'](_0x5249d9,function(_0x3d1de3){var _0x2194fe=_0x3d1de3[_0x26d7('0x29')]({'plain':!![]});return _0x2194fe[_0x26d7('0x65')];});return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x2a7927[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](function(_0x1002ba){return db[_0x26d7('0x68')][_0x26d7('0x69')](function(_0x324ad6){return _0x1002ba[_0x26d7('0x6a')](_0x122d75,{'transaction':_0x324ad6})[_0x26d7('0x28')](function(){return BPromise[_0x26d7('0x6b')](_0x1c19bf,function(_0x440ff9){return db['UserFaxQueue'][_0x26d7('0x6c')]({'where':{'UserId':_0x440ff9['id'],'FaxQueueId':_0x2a7927[_0x26d7('0x49')]['id']},'transaction':_0x324ad6});});})[_0x26d7('0x28')](function(){_0x1c19bf[_0x26d7('0x6d')](function(_0x2ed3c4){socket[_0x26d7('0x6e')]('userFaxQueue:save',{'UserId':_0x2ed3c4['id'],'FaxQueueId':_0x1002ba['id']});});});});});}})[_0x26d7('0x28')](respondWithStatusCode(_0x26e49a,null))['catch'](handleError(_0x26e49a,null));};exports['removeTeams']=function(_0x59a6db,_0x2565b9,_0x28382a){return db[_0x26d7('0x62')]['findAll']({'where':{'id':_0x59a6db[_0x26d7('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x26d7('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x26d7('0x28')](handleEntityNotFound(_0x2565b9,null))[_0x26d7('0x28')](function(_0x82e3a1){var _0x5dc596=_[_0x26d7('0x40')](_0x82e3a1,'id');var _0x3d18ce=[];var _0x564a22=[];var _0x28b21d=squel[_0x26d7('0x6f')]();_0x28b21d['field'](_0x26d7('0x70'))[_0x26d7('0x71')]('team_has_fax_queues','tq')['join'](_0x26d7('0x72'),'ut',_0x26d7('0x73'))['where']('FaxQueueId\x20=\x20?',_0x59a6db[_0x26d7('0x49')]['id']);for(var _0x6bef7=0x0;_0x6bef7<_0x82e3a1['length'];_0x6bef7+=0x1){let _0x31b7d9=_0x82e3a1[_0x6bef7];for(var _0x76350d=0x0;_0x76350d<_0x31b7d9[_0x26d7('0x65')]['length'];_0x76350d+=0x1){let _0x5ae731=_0x31b7d9[_0x26d7('0x65')][_0x76350d];var _0x1ac9fd=_0x28b21d[_0x26d7('0x74')]();_0x1ac9fd[_0x26d7('0x3c')]('ut.UserId\x20=\x20?',_0x5ae731['id']);_0x564a22[_0x26d7('0x75')](db[_0x26d7('0x68')]['query'](_0x1ac9fd['toString'](),{'type':db[_0x26d7('0x68')]['QueryTypes'][_0x26d7('0x76')]})[_0x26d7('0x28')](function(_0x2bf2b3){if(_0x2bf2b3[_0x26d7('0x38')]===0x1){return _0x5ae731['id'];}else{var _0x4a0363=_[_0x26d7('0x77')](_[_0x26d7('0x40')](_0x2bf2b3,'TeamId'),function(_0x57cc1f){return _[_0x26d7('0x78')](_0x5dc596,_0x57cc1f);});if(_0x4a0363){return _0x5ae731['id'];}}}));}}return BPromise[_0x26d7('0x79')](_0x564a22)[_0x26d7('0x28')](function(_0x13005f){_0x3d18ce=_(_0x3d18ce)[_0x26d7('0x7a')](_0x13005f)[_0x26d7('0x7b')]()[_0x26d7('0x7c')]();return db['FaxQueue'][_0x26d7('0x4a')]({'where':{'id':_0x59a6db[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](function(_0x174478){return db['sequelize'][_0x26d7('0x69')](function(_0x5200b9){return _0x174478[_0x26d7('0x7d')](_0x59a6db['query'][_0x26d7('0x63')],{'transaction':_0x5200b9})['then'](function(){if(!_[_0x26d7('0x7e')](_0x3d18ce)){return _0x174478[_0x26d7('0x7f')](_0x3d18ce,{'transaction':_0x5200b9});}})[_0x26d7('0x28')](function(){_0x3d18ce[_0x26d7('0x6d')](function(_0x48d97c){socket[_0x26d7('0x6e')](_0x26d7('0x80'),{'UserId':_0x48d97c,'FaxQueueId':_0x174478['id']});});});});});});})[_0x26d7('0x28')](respondWithStatusCode(_0x2565b9,null))[_0x26d7('0x47')](handleError(_0x2565b9,null));};exports[_0x26d7('0x81')]=function(_0x1d8478,_0x568481,_0x4c60f6){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x1d8478[_0x26d7('0x49')]['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x568481,null))[_0x26d7('0x28')](function(_0x33701a){if(_0x33701a){return _0x33701a['addAgents'](_0x1d8478[_0x26d7('0x4c')]['ids'],_['omit'](_0x1d8478[_0x26d7('0x4c')],['ids','id'])||{})[_0x26d7('0x82')](function(_0x5f31b3){for(var _0x1914ce=0x0;_0x1914ce<_0x1d8478[_0x26d7('0x4c')]['ids'][_0x26d7('0x38')];_0x1914ce+=0x1){socket[_0x26d7('0x6e')](_0x26d7('0x83'),{'UserId':Number(_0x1d8478['body'][_0x26d7('0x63')][_0x1914ce]),'FaxQueueId':Number(_0x1d8478[_0x26d7('0x49')]['id'])});}return _0x5f31b3;});}})[_0x26d7('0x28')](respondWithResult(_0x568481,null))[_0x26d7('0x47')](handleError(_0x568481,null));};exports[_0x26d7('0x7f')]=function(_0x773387,_0x41c9e7,_0x29f822){return db[_0x26d7('0x44')][_0x26d7('0x4a')]({'where':{'id':_0x773387[_0x26d7('0x49')]['id']}})['then'](handleEntityNotFound(_0x41c9e7,null))[_0x26d7('0x28')](function(_0x15f316){if(_0x15f316){return _0x15f316[_0x26d7('0x7f')](_0x773387[_0x26d7('0x32')]['ids'])[_0x26d7('0x28')](function(){if(_[_0x26d7('0x84')](_0x773387[_0x26d7('0x32')][_0x26d7('0x63')])){for(var _0x2fb3c5=0x0;_0x2fb3c5<_0x773387[_0x26d7('0x32')][_0x26d7('0x63')][_0x26d7('0x38')];_0x2fb3c5+=0x1){socket[_0x26d7('0x6e')]('userFaxQueue:remove',{'UserId':Number(_0x773387[_0x26d7('0x32')]['ids'][_0x2fb3c5]),'FaxQueueId':Number(_0x773387[_0x26d7('0x49')]['id'])});}}else{socket[_0x26d7('0x6e')](_0x26d7('0x80'),{'UserId':Number(_0x773387['query'][_0x26d7('0x63')]),'FaxQueueId':Number(_0x773387[_0x26d7('0x49')]['id'])});}});}})[_0x26d7('0x28')](respondWithStatusCode(_0x41c9e7,null))[_0x26d7('0x47')](handleError(_0x41c9e7,null));};exports[_0x26d7('0x85')]=function(_0x3e22aa,_0x522f4a,_0x1a1f03){var _0x41bd8d={};var _0x1b4c79={};var _0x4a014a;var _0xf9fd81;return db[_0x26d7('0x44')][_0x26d7('0x58')]({'where':{'id':_0x3e22aa['params']['id']}})[_0x26d7('0x28')](handleEntityNotFound(_0x522f4a,null))[_0x26d7('0x28')](function(_0x59ca5c){if(_0x59ca5c){_0x4a014a=_0x59ca5c;_0x1b4c79[_0x26d7('0x31')]=_[_0x26d7('0x33')](db['User'][_0x26d7('0x2f')]);_0x1b4c79[_0x26d7('0x32')]=_[_0x26d7('0x33')](_0x3e22aa[_0x26d7('0x32')]);_0x1b4c79[_0x26d7('0x34')]=_[_0x26d7('0x35')](_0x1b4c79[_0x26d7('0x31')],_0x1b4c79['query']);_0x41bd8d[_0x26d7('0x36')]=_[_0x26d7('0x35')](_0x1b4c79[_0x26d7('0x31')],qs[_0x26d7('0x37')](_0x3e22aa[_0x26d7('0x32')]['fields']));_0x41bd8d[_0x26d7('0x36')]=_0x41bd8d['attributes']['length']?_0x41bd8d[_0x26d7('0x36')]:_0x1b4c79['model'];_0x41bd8d[_0x26d7('0x3a')]=qs[_0x26d7('0x3b')](_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x3b')]);_0x41bd8d[_0x26d7('0x3c')]=qs['filters'](_[_0x26d7('0x3d')](_0x3e22aa['query'],_0x1b4c79[_0x26d7('0x34')]));if(_0x3e22aa['query'][_0x26d7('0x3e')]){_0x41bd8d['where']=_[_0x26d7('0x3f')](_0x41bd8d['where'],{'$or':_[_0x26d7('0x40')](_0x41bd8d['attributes'],function(_0x1f2d0a){var _0x29bb7b={};_0x29bb7b[_0x1f2d0a]={'$like':'%'+_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x3e')]+'%'};return _0x29bb7b;})});}_0x41bd8d=_['merge']({},_0x41bd8d,_0x3e22aa[_0x26d7('0x43')]);return _0x4a014a[_0x26d7('0x85')](_0x41bd8d);}})[_0x26d7('0x28')](function(_0x3eabb5){if(_0x3eabb5){_0xf9fd81=_0x3eabb5['length'];if(!_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x39')]('nolimit')){_0x41bd8d[_0x26d7('0x21')]=qs[_0x26d7('0x21')](_0x3e22aa['query'][_0x26d7('0x21')]);_0x41bd8d[_0x26d7('0x1f')]=qs[_0x26d7('0x1f')](_0x3e22aa[_0x26d7('0x32')][_0x26d7('0x1f')]);}return _0x4a014a[_0x26d7('0x85')](_0x41bd8d);}})[_0x26d7('0x28')](function(_0x1fc790){if(_0x1fc790){return _0x1fc790?{'count':_0xf9fd81,'rows':_0x1fc790}:null;}})[_0x26d7('0x28')](respondWithResult(_0x522f4a,null))[_0x26d7('0x47')](handleError(_0x522f4a,null));}; \ No newline at end of file +var _0x5b54=['SELECT','TeamId','includes','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','map','type','key','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','offset','query','order','sort','where','filter','merge','VIRTUAL','options','FaxQueue','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserFaxQueue','nolimit','pick','findAll','User','findAndCountAll','UserId','faxPause','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b54,0x124));var _0x45b5=function(_0xbfd2a0,_0x534333){_0xbfd2a0=_0xbfd2a0-0x0;var _0x5e33e9=_0x5b54[_0xbfd2a0];return _0x5e33e9;};'use strict';var emlformat=require(_0x45b5('0x0'));var rimraf=require(_0x45b5('0x1'));var zipdir=require(_0x45b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x45b5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x45b5('0x4'));var util=require(_0x45b5('0x5'));var path=require('path');var sox=require(_0x45b5('0x6'));var csv=require(_0x45b5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45b5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x45b5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x45b5('0x7'));var querystring=require(_0x45b5('0xa'));var Papa=require(_0x45b5('0xb'));var Redis=require(_0x45b5('0xc'));var authService=require(_0x45b5('0xd'));var qs=require(_0x45b5('0xe'));var as=require(_0x45b5('0xf'));var hardwareService=require(_0x45b5('0x10'));var logger=require(_0x45b5('0x11'))(_0x45b5('0x12'));var utils=require(_0x45b5('0x13'));var config=require(_0x45b5('0x14'));var licenseUtil=require(_0x45b5('0x15'));var db=require(_0x45b5('0x16'))['db'];config[_0x45b5('0x17')]=_[_0x45b5('0x18')](config[_0x45b5('0x17')],{'host':_0x45b5('0x19'),'port':0x18eb});var socket=require(_0x45b5('0x1a'))(new Redis(config[_0x45b5('0x17')]));require('./faxQueue.socket')[_0x45b5('0x1b')](socket);function respondWithStatusCode(_0x247e61,_0x4e4e10){_0x4e4e10=_0x4e4e10||0xcc;return function(_0x24ae61){if(_0x24ae61){return _0x247e61[_0x45b5('0x1c')](_0x4e4e10);}return _0x247e61[_0x45b5('0x1d')](_0x4e4e10)[_0x45b5('0x1e')]();};}function respondWithResult(_0x40fde5,_0x15dd16){_0x15dd16=_0x15dd16||0xc8;return function(_0x5da19f){if(_0x5da19f){return _0x40fde5[_0x45b5('0x1d')](_0x15dd16)[_0x45b5('0x1f')](_0x5da19f);}};}function respondWithFilteredResult(_0x1ebc20,_0x22f570){return function(_0x5115c3){if(_0x5115c3){var _0x4e4ab6=typeof _0x22f570['offset']===_0x45b5('0x20')&&typeof _0x22f570['limit']===_0x45b5('0x20');var _0x4d9580=_0x5115c3[_0x45b5('0x21')];var _0x1bc6e0=_0x4e4ab6?0x0:_0x22f570['offset'];var _0x4e88c9=_0x4e4ab6?_0x5115c3[_0x45b5('0x21')]:_0x22f570['offset']+_0x22f570['limit'];var _0x1df721;if(_0x4e88c9>=_0x4d9580){_0x4e88c9=_0x4d9580;_0x1df721=0xc8;}else{_0x1df721=0xce;}_0x1ebc20[_0x45b5('0x1d')](_0x1df721);return _0x1ebc20[_0x45b5('0x22')](_0x45b5('0x23'),_0x1bc6e0+'-'+_0x4e88c9+'/'+_0x4d9580)[_0x45b5('0x1f')](_0x5115c3);}return null;};}function patchUpdates(_0x345519){return function(_0x547763){try{jsonpatch[_0x45b5('0x24')](_0x547763,_0x345519,!![]);}catch(_0x563cb7){return BPromise[_0x45b5('0x25')](_0x563cb7);}return _0x547763[_0x45b5('0x26')]();};}function saveUpdates(_0x8a20e5,_0x20f8e9){return function(_0x344d8b){if(_0x344d8b){return _0x344d8b['update'](_0x8a20e5)[_0x45b5('0x27')](function(_0x3acbee){return _0x3acbee;});}return null;};}function removeEntity(_0x3a3a46,_0x1b21dc){return function(_0x56db85){if(_0x56db85){return _0x56db85[_0x45b5('0x28')]()['then'](function(){var _0x3b59e7=_0x56db85[_0x45b5('0x29')]({'plain':!![]});var _0xc201e9=_0x45b5('0x2a');return db[_0x45b5('0x2b')][_0x45b5('0x28')]({'where':{'type':_0xc201e9,'resourceId':_0x3b59e7['id']}})[_0x45b5('0x27')](function(){return _0x56db85;});})[_0x45b5('0x27')](function(){_0x3a3a46['status'](0xcc)[_0x45b5('0x1e')]();});}};}function handleEntityNotFound(_0x5cda9b,_0x389dae){return function(_0x5a8a00){if(!_0x5a8a00){_0x5cda9b[_0x45b5('0x1c')](0x194);}return _0x5a8a00;};}function handleError(_0x54a3ea,_0x5a5930){_0x5a5930=_0x5a5930||0x1f4;return function(_0x5a8334){logger['error'](_0x5a8334['stack']);if(_0x5a8334[_0x45b5('0x2c')]){delete _0x5a8334[_0x45b5('0x2c')];}_0x54a3ea[_0x45b5('0x1d')](_0x5a5930)[_0x45b5('0x2d')](_0x5a8334);};}exports[_0x45b5('0x2e')]=function(_0x5832ee,_0x1e5e1a){var _0x352659={},_0x59c9f2={},_0x306b5b={'count':0x0,'rows':[]};var _0x271d86=_[_0x45b5('0x2f')](db['FaxQueue']['rawAttributes'],function(_0x329399){return{'name':_0x329399['fieldName'],'type':_0x329399[_0x45b5('0x30')][_0x45b5('0x31')]};});_0x59c9f2['model']=_[_0x45b5('0x2f')](_0x271d86,'name');_0x59c9f2['query']=_[_0x45b5('0x32')](_0x5832ee['query']);_0x59c9f2[_0x45b5('0x33')]=_[_0x45b5('0x34')](_0x59c9f2[_0x45b5('0x35')],_0x59c9f2['query']);_0x352659[_0x45b5('0x36')]=_[_0x45b5('0x34')](_0x59c9f2[_0x45b5('0x35')],qs[_0x45b5('0x37')](_0x5832ee['query'][_0x45b5('0x37')]));_0x352659[_0x45b5('0x36')]=_0x352659[_0x45b5('0x36')][_0x45b5('0x38')]?_0x352659[_0x45b5('0x36')]:_0x59c9f2[_0x45b5('0x35')];if(!_0x5832ee['query'][_0x45b5('0x39')]('nolimit')){_0x352659[_0x45b5('0x3a')]=qs[_0x45b5('0x3a')](_0x5832ee['query'][_0x45b5('0x3a')]);_0x352659['offset']=qs[_0x45b5('0x3b')](_0x5832ee[_0x45b5('0x3c')][_0x45b5('0x3b')]);}_0x352659[_0x45b5('0x3d')]=qs[_0x45b5('0x3e')](_0x5832ee[_0x45b5('0x3c')][_0x45b5('0x3e')]);_0x352659[_0x45b5('0x3f')]=qs[_0x45b5('0x33')](_['pick'](_0x5832ee['query'],_0x59c9f2['filters']),_0x271d86);if(_0x5832ee[_0x45b5('0x3c')][_0x45b5('0x40')]){_0x352659[_0x45b5('0x3f')]=_[_0x45b5('0x41')](_0x352659['where'],{'$or':_[_0x45b5('0x2f')](_0x271d86,function(_0x5e64b1){if(_0x5e64b1[_0x45b5('0x30')]!==_0x45b5('0x42')){var _0x539709={};_0x539709[_0x5e64b1['name']]={'$like':'%'+_0x5832ee[_0x45b5('0x3c')]['filter']+'%'};return _0x539709;}})});}_0x352659=_[_0x45b5('0x41')]({},_0x352659,_0x5832ee[_0x45b5('0x43')]);var _0x5231a0={'where':_0x352659['where']};return db[_0x45b5('0x44')][_0x45b5('0x21')](_0x5231a0)[_0x45b5('0x27')](function(_0x40387e){_0x306b5b[_0x45b5('0x21')]=_0x40387e;if(_0x5832ee['query']['includeAll']){_0x352659[_0x45b5('0x45')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x352659);})['then'](function(_0x15923b){_0x306b5b[_0x45b5('0x46')]=_0x15923b;return _0x306b5b;})[_0x45b5('0x27')](respondWithFilteredResult(_0x1e5e1a,_0x352659))['catch'](handleError(_0x1e5e1a,null));};exports[_0x45b5('0x47')]=function(_0xb4ca99,_0xf827d4){var _0x162a80={'raw':!![],'where':{'id':_0xb4ca99[_0x45b5('0x48')]['id']}},_0xa3a176={};_0xa3a176[_0x45b5('0x35')]=_[_0x45b5('0x32')](db['FaxQueue'][_0x45b5('0x49')]);_0xa3a176[_0x45b5('0x3c')]=_[_0x45b5('0x32')](_0xb4ca99[_0x45b5('0x3c')]);_0xa3a176[_0x45b5('0x33')]=_[_0x45b5('0x34')](_0xa3a176[_0x45b5('0x35')],_0xa3a176[_0x45b5('0x3c')]);_0x162a80[_0x45b5('0x36')]=_[_0x45b5('0x34')](_0xa3a176[_0x45b5('0x35')],qs['fields'](_0xb4ca99[_0x45b5('0x3c')][_0x45b5('0x37')]));_0x162a80['attributes']=_0x162a80[_0x45b5('0x36')][_0x45b5('0x38')]?_0x162a80[_0x45b5('0x36')]:_0xa3a176[_0x45b5('0x35')];if(_0xb4ca99[_0x45b5('0x3c')][_0x45b5('0x4a')]){_0x162a80[_0x45b5('0x45')]=[{'all':!![]}];}_0x162a80=_[_0x45b5('0x41')]({},_0x162a80,_0xb4ca99[_0x45b5('0x43')]);return db[_0x45b5('0x44')][_0x45b5('0x4b')](_0x162a80)['then'](handleEntityNotFound(_0xf827d4,null))['then'](respondWithResult(_0xf827d4,null))[_0x45b5('0x4c')](handleError(_0xf827d4,null));};exports[_0x45b5('0x4d')]=function(_0x2a3fea,_0x58c803){return db[_0x45b5('0x44')][_0x45b5('0x4d')](_0x2a3fea[_0x45b5('0x4e')],{})['then'](function(_0x265295){var _0x4caded=_0x2a3fea['user']['get']({'plain':!![]});if(!_0x4caded)throw new Error(_0x45b5('0x4f'));if(_0x4caded[_0x45b5('0x50')]==='user'){var _0x246fa1=_0x265295[_0x45b5('0x29')]({'plain':!![]});var _0x51a305=_0x45b5('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x51a305,'userProfileId':_0x4caded[_0x45b5('0x51')]},'raw':!![]})[_0x45b5('0x27')](function(_0x12a7c2){if(_0x12a7c2&&_0x12a7c2[_0x45b5('0x52')]===0x0){return db[_0x45b5('0x2b')]['create']({'name':_0x246fa1['name'],'resourceId':_0x246fa1['id'],'type':_0x12a7c2[_0x45b5('0x2c')],'sectionId':_0x12a7c2['id']},{})[_0x45b5('0x27')](function(){return _0x265295;});}else{return _0x265295;}})[_0x45b5('0x4c')](function(_0x597fb2){logger[_0x45b5('0x53')](_0x45b5('0x54'),_0x597fb2);throw _0x597fb2;});}return _0x265295;})[_0x45b5('0x27')](respondWithResult(_0x58c803,0xc9))[_0x45b5('0x4c')](handleError(_0x58c803,null));};exports[_0x45b5('0x55')]=function(_0x6a3b5d,_0x3b4ea6){if(_0x6a3b5d[_0x45b5('0x4e')]['id']){delete _0x6a3b5d['body']['id'];}return db[_0x45b5('0x44')][_0x45b5('0x4b')]({'where':{'id':_0x6a3b5d['params']['id']}})['then'](handleEntityNotFound(_0x3b4ea6,null))[_0x45b5('0x27')](saveUpdates(_0x6a3b5d[_0x45b5('0x4e')],null))[_0x45b5('0x27')](respondWithResult(_0x3b4ea6,null))[_0x45b5('0x4c')](handleError(_0x3b4ea6,null));};exports[_0x45b5('0x28')]=function(_0x50e7c9,_0x106894){return db[_0x45b5('0x44')][_0x45b5('0x4b')]({'where':{'id':_0x50e7c9[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](handleEntityNotFound(_0x106894,null))[_0x45b5('0x27')](removeEntity(_0x106894,null))[_0x45b5('0x4c')](handleError(_0x106894,null));};exports['describe']=function(_0x50d7fd,_0xfff5a){return db['FaxQueue'][_0x45b5('0x56')]()[_0x45b5('0x27')](respondWithResult(_0xfff5a,null))[_0x45b5('0x4c')](handleError(_0xfff5a,null));};exports['getMembers']=function(_0x17c5a6,_0x297d9a,_0x3b05e3){var _0x2268d4={'raw':!![],'where':{}},_0x3d0aef={},_0x22ee35;return db[_0x45b5('0x44')][_0x45b5('0x57')]({'where':{'id':_0x17c5a6['params']['id']}})[_0x45b5('0x27')](handleEntityNotFound(_0x297d9a,null))['then'](function(_0xd60743){if(_0xd60743){_0x22ee35=_0xd60743[_0x45b5('0x29')]({'plain':!![]});_0x3d0aef[_0x45b5('0x35')]=_['keys'](db[_0x45b5('0x58')][_0x45b5('0x49')]);_0x3d0aef[_0x45b5('0x3c')]=_[_0x45b5('0x32')](_0x17c5a6[_0x45b5('0x3c')]);_0x3d0aef['filters']=_[_0x45b5('0x34')](_0x3d0aef[_0x45b5('0x35')],_0x3d0aef[_0x45b5('0x3c')]);_0x2268d4[_0x45b5('0x36')]=_['intersection'](_0x3d0aef[_0x45b5('0x35')],qs['fields'](_0x17c5a6['query'][_0x45b5('0x37')]));_0x2268d4[_0x45b5('0x36')]=_0x2268d4['attributes'][_0x45b5('0x38')]?_0x2268d4[_0x45b5('0x36')]:_0x3d0aef['model'];if(!_0x17c5a6[_0x45b5('0x3c')][_0x45b5('0x39')](_0x45b5('0x59'))){_0x2268d4[_0x45b5('0x3a')]=qs[_0x45b5('0x3a')](_0x17c5a6[_0x45b5('0x3c')]['limit']);_0x2268d4[_0x45b5('0x3b')]=qs[_0x45b5('0x3b')](_0x17c5a6[_0x45b5('0x3c')][_0x45b5('0x3b')]);}_0x2268d4[_0x45b5('0x3d')]=qs[_0x45b5('0x3e')](_0x17c5a6[_0x45b5('0x3c')][_0x45b5('0x3e')]);_0x2268d4['where']=qs[_0x45b5('0x33')](_[_0x45b5('0x5a')](_0x17c5a6[_0x45b5('0x3c')],_0x3d0aef[_0x45b5('0x33')]));_0x2268d4[_0x45b5('0x3f')]['FaxQueueId']=_0xd60743['id'];if(_0x17c5a6[_0x45b5('0x3c')]['filter']){_0x2268d4[_0x45b5('0x3f')]=_['merge'](_0x2268d4['where'],{'$or':_[_0x45b5('0x2f')](_0x2268d4[_0x45b5('0x36')],function(_0x29e8bf){var _0x226549={};_0x226549[_0x29e8bf]={'$like':'%'+_0x17c5a6['query'][_0x45b5('0x40')]+'%'};return _0x226549;})});}_0x2268d4=_[_0x45b5('0x41')]({},_0x2268d4,_0x17c5a6[_0x45b5('0x43')]);return db['UserFaxQueue'][_0x45b5('0x5b')](_0x2268d4);}})['then'](function(_0x3cb08a){if(_0x3cb08a){return db[_0x45b5('0x5c')][_0x45b5('0x5d')]({'where':{'id':_[_0x45b5('0x2f')](_0x3cb08a,_0x45b5('0x5e')),'role':'agent'},'attributes':['id','name',_0x45b5('0x5f'),'updatedAt',_0x45b5('0x60')]});}})[_0x45b5('0x27')](function(_0x347813){if(_0x347813){return{'count':_0x347813[_0x45b5('0x21')],'rows':_[_0x45b5('0x2f')](_0x347813['rows'],function(_0x4559d7){return{'membername':_0x4559d7[_0x45b5('0x2c')],'UserId':_0x4559d7['id'],'queue_name':_0x22ee35[_0x45b5('0x2c')],'FaxQueueId':_0x22ee35['id'],'interface':util['format'](_0x45b5('0x61'),_0x45b5('0x62'),_0x4559d7[_0x45b5('0x2c')]),'penalty':0x0,'paused':_0x4559d7[_0x45b5('0x5f')],'createdAt':_0x4559d7[_0x45b5('0x60')],'updatedAt':_0x4559d7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x45b5('0x27')](respondWithFilteredResult(_0x297d9a,_0x2268d4))[_0x45b5('0x4c')](handleError(_0x297d9a,null));};exports[_0x45b5('0x63')]=function(_0x44e41a,_0x4de850,_0x4fd272){var _0x1a9a9d={};var _0xc58ca={};var _0x46ca76;var _0x5efac3;return db['FaxQueue'][_0x45b5('0x57')]({'where':{'id':_0x44e41a[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](handleEntityNotFound(_0x4de850,null))['then'](function(_0x10399d){if(_0x10399d){_0x46ca76=_0x10399d;_0xc58ca['model']=_[_0x45b5('0x32')](db[_0x45b5('0x64')][_0x45b5('0x49')]);_0xc58ca[_0x45b5('0x3c')]=_['keys'](_0x44e41a[_0x45b5('0x3c')]);_0xc58ca[_0x45b5('0x33')]=_[_0x45b5('0x34')](_0xc58ca[_0x45b5('0x35')],_0xc58ca[_0x45b5('0x3c')]);_0x1a9a9d[_0x45b5('0x36')]=_[_0x45b5('0x34')](_0xc58ca[_0x45b5('0x35')],qs[_0x45b5('0x37')](_0x44e41a[_0x45b5('0x3c')]['fields']));_0x1a9a9d[_0x45b5('0x36')]=_0x1a9a9d[_0x45b5('0x36')][_0x45b5('0x38')]?_0x1a9a9d[_0x45b5('0x36')]:_0xc58ca[_0x45b5('0x35')];_0x1a9a9d['order']=qs[_0x45b5('0x3e')](_0x44e41a[_0x45b5('0x3c')][_0x45b5('0x3e')]);_0x1a9a9d['where']=qs[_0x45b5('0x33')](_[_0x45b5('0x5a')](_0x44e41a[_0x45b5('0x3c')],_0xc58ca[_0x45b5('0x33')]));if(_0x44e41a['query']['filter']){_0x1a9a9d[_0x45b5('0x3f')]=_[_0x45b5('0x41')](_0x1a9a9d['where'],{'$or':_[_0x45b5('0x2f')](_0x1a9a9d[_0x45b5('0x36')],function(_0x5e4b2f){var _0x2fb749={};_0x2fb749[_0x5e4b2f]={'$like':'%'+_0x44e41a[_0x45b5('0x3c')][_0x45b5('0x40')]+'%'};return _0x2fb749;})});}_0x1a9a9d=_[_0x45b5('0x41')]({},_0x1a9a9d,_0x44e41a[_0x45b5('0x43')]);return _0x46ca76['getTeams'](_0x1a9a9d);}})['then'](function(_0x5c3d47){if(_0x5c3d47){_0x5efac3=_0x5c3d47[_0x45b5('0x38')];if(!_0x44e41a[_0x45b5('0x3c')][_0x45b5('0x39')]('nolimit')){_0x1a9a9d['limit']=qs[_0x45b5('0x3a')](_0x44e41a[_0x45b5('0x3c')][_0x45b5('0x3a')]);_0x1a9a9d[_0x45b5('0x3b')]=qs[_0x45b5('0x3b')](_0x44e41a[_0x45b5('0x3c')][_0x45b5('0x3b')]);}return _0x46ca76[_0x45b5('0x63')](_0x1a9a9d);}})[_0x45b5('0x27')](function(_0x4fe8e3){if(_0x4fe8e3){return _0x4fe8e3?{'count':_0x5efac3,'rows':_0x4fe8e3}:null;}})['then'](respondWithResult(_0x4de850,null))[_0x45b5('0x4c')](handleError(_0x4de850,null));};exports[_0x45b5('0x65')]=function(_0x30fd75,_0x26db3d,_0x1fbe84){var _0x3a15cd=_0x30fd75[_0x45b5('0x4e')]['ids'];return db[_0x45b5('0x64')][_0x45b5('0x5b')]({'where':{'id':_0x3a15cd},'attributes':['id'],'include':[{'model':db[_0x45b5('0x5c')],'as':_0x45b5('0x66'),'attributes':['id',_0x45b5('0x2c'),_0x45b5('0x67'),_0x45b5('0x68'),'interface'],'raw':!![]}]})['then'](function(_0x228d5b){if(_0x228d5b){var _0x21c0cb=_['flatMap'](_0x228d5b,function(_0x2890bc){var _0x5c82e9=_0x2890bc[_0x45b5('0x29')]({'plain':!![]});return _0x5c82e9[_0x45b5('0x66')];});return db['FaxQueue']['find']({'where':{'id':_0x30fd75[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](function(_0x581317){return db[_0x45b5('0x69')][_0x45b5('0x6a')](function(_0x39cc4f){return _0x581317[_0x45b5('0x65')](_0x3a15cd,{'transaction':_0x39cc4f})['then'](function(){return BPromise[_0x45b5('0x6b')](_0x21c0cb,function(_0x5b7bfc){return db['UserFaxQueue'][_0x45b5('0x6c')]({'where':{'UserId':_0x5b7bfc['id'],'FaxQueueId':_0x30fd75[_0x45b5('0x48')]['id']},'transaction':_0x39cc4f});});})[_0x45b5('0x27')](function(){_0x21c0cb[_0x45b5('0x6d')](function(_0x3a9267){socket[_0x45b5('0x6e')](_0x45b5('0x6f'),{'UserId':_0x3a9267['id'],'FaxQueueId':_0x581317['id']});});});});});}})[_0x45b5('0x27')](respondWithStatusCode(_0x26db3d,null))[_0x45b5('0x4c')](handleError(_0x26db3d,null));};exports[_0x45b5('0x70')]=function(_0x284c1f,_0x330450,_0x5baf4c){return db['Team'][_0x45b5('0x5b')]({'where':{'id':_0x284c1f['query'][_0x45b5('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x330450,null))[_0x45b5('0x27')](function(_0x1311e1){var _0x321a2d=_[_0x45b5('0x2f')](_0x1311e1,'id');var _0x53b4ce=[];var _0x170e51=[];var _0x8e91ef=squel[_0x45b5('0x72')]();_0x8e91ef['field'](_0x45b5('0x73'))[_0x45b5('0x74')](_0x45b5('0x75'),'tq')[_0x45b5('0x76')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x45b5('0x77'),_0x284c1f[_0x45b5('0x48')]['id']);for(var _0x43a80b=0x0;_0x43a80b<_0x1311e1[_0x45b5('0x38')];_0x43a80b+=0x1){let _0x377e3b=_0x1311e1[_0x43a80b];for(var _0x266cd1=0x0;_0x266cd1<_0x377e3b['Agents'][_0x45b5('0x38')];_0x266cd1+=0x1){let _0x4a7086=_0x377e3b[_0x45b5('0x66')][_0x266cd1];var _0x2ee4bd=_0x8e91ef[_0x45b5('0x78')]();_0x2ee4bd[_0x45b5('0x3f')](_0x45b5('0x79'),_0x4a7086['id']);_0x170e51[_0x45b5('0x7a')](db[_0x45b5('0x69')][_0x45b5('0x3c')](_0x2ee4bd[_0x45b5('0x7b')](),{'type':db[_0x45b5('0x69')][_0x45b5('0x7c')][_0x45b5('0x7d')]})[_0x45b5('0x27')](function(_0x158a64){if(_0x158a64[_0x45b5('0x38')]===0x1){return _0x4a7086['id'];}else{var _0x408bc1=_['every'](_['map'](_0x158a64,_0x45b5('0x7e')),function(_0x4cdd00){return _[_0x45b5('0x7f')](_0x321a2d,_0x4cdd00);});if(_0x408bc1){return _0x4a7086['id'];}}}));}}return BPromise[_0x45b5('0x80')](_0x170e51)[_0x45b5('0x27')](function(_0x452826){_0x53b4ce=_(_0x53b4ce)[_0x45b5('0x81')](_0x452826)[_0x45b5('0x82')]()[_0x45b5('0x83')]();return db[_0x45b5('0x44')]['find']({'where':{'id':_0x284c1f[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](function(_0x530835){return db[_0x45b5('0x69')][_0x45b5('0x6a')](function(_0x2af14){return _0x530835['removeTeams'](_0x284c1f[_0x45b5('0x3c')][_0x45b5('0x71')],{'transaction':_0x2af14})[_0x45b5('0x27')](function(){if(!_[_0x45b5('0x84')](_0x53b4ce)){return _0x530835['removeAgents'](_0x53b4ce,{'transaction':_0x2af14});}})[_0x45b5('0x27')](function(){_0x53b4ce[_0x45b5('0x6d')](function(_0x178dfc){socket['emit'](_0x45b5('0x85'),{'UserId':_0x178dfc,'FaxQueueId':_0x530835['id']});});});});});});})[_0x45b5('0x27')](respondWithStatusCode(_0x330450,null))[_0x45b5('0x4c')](handleError(_0x330450,null));};exports[_0x45b5('0x86')]=function(_0x11a6d0,_0xc36148,_0xaecf4c){return db['FaxQueue'][_0x45b5('0x4b')]({'where':{'id':_0x11a6d0[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](handleEntityNotFound(_0xc36148,null))[_0x45b5('0x27')](function(_0x1b5faa){if(_0x1b5faa){return _0x1b5faa[_0x45b5('0x86')](_0x11a6d0[_0x45b5('0x4e')][_0x45b5('0x71')],_[_0x45b5('0x87')](_0x11a6d0[_0x45b5('0x4e')],[_0x45b5('0x71'),'id'])||{})['spread'](function(_0x23d80c){for(var _0x189cd4=0x0;_0x189cd4<_0x11a6d0[_0x45b5('0x4e')]['ids'][_0x45b5('0x38')];_0x189cd4+=0x1){socket[_0x45b5('0x6e')](_0x45b5('0x6f'),{'UserId':Number(_0x11a6d0[_0x45b5('0x4e')][_0x45b5('0x71')][_0x189cd4]),'FaxQueueId':Number(_0x11a6d0[_0x45b5('0x48')]['id'])});}return _0x23d80c;});}})[_0x45b5('0x27')](respondWithResult(_0xc36148,null))['catch'](handleError(_0xc36148,null));};exports['removeAgents']=function(_0xef2089,_0xa7b50f,_0x47f15b){return db[_0x45b5('0x44')]['find']({'where':{'id':_0xef2089[_0x45b5('0x48')]['id']}})['then'](handleEntityNotFound(_0xa7b50f,null))[_0x45b5('0x27')](function(_0x302e20){if(_0x302e20){return _0x302e20[_0x45b5('0x88')](_0xef2089[_0x45b5('0x3c')]['ids'])['then'](function(){if(_[_0x45b5('0x89')](_0xef2089[_0x45b5('0x3c')][_0x45b5('0x71')])){for(var _0x2c6c52=0x0;_0x2c6c52<_0xef2089['query']['ids'][_0x45b5('0x38')];_0x2c6c52+=0x1){socket[_0x45b5('0x6e')]('userFaxQueue:remove',{'UserId':Number(_0xef2089[_0x45b5('0x3c')][_0x45b5('0x71')][_0x2c6c52]),'FaxQueueId':Number(_0xef2089[_0x45b5('0x48')]['id'])});}}else{socket[_0x45b5('0x6e')](_0x45b5('0x85'),{'UserId':Number(_0xef2089[_0x45b5('0x3c')][_0x45b5('0x71')]),'FaxQueueId':Number(_0xef2089[_0x45b5('0x48')]['id'])});}});}})[_0x45b5('0x27')](respondWithStatusCode(_0xa7b50f,null))[_0x45b5('0x4c')](handleError(_0xa7b50f,null));};exports[_0x45b5('0x8a')]=function(_0x521a2d,_0x5c5cf8,_0x16adcc){var _0x4e4f73={};var _0x4b30a7={};var _0x379968;var _0x274d18;return db[_0x45b5('0x44')][_0x45b5('0x57')]({'where':{'id':_0x521a2d[_0x45b5('0x48')]['id']}})[_0x45b5('0x27')](handleEntityNotFound(_0x5c5cf8,null))[_0x45b5('0x27')](function(_0x2cca0b){if(_0x2cca0b){_0x379968=_0x2cca0b;_0x4b30a7[_0x45b5('0x35')]=_[_0x45b5('0x32')](db['User']['rawAttributes']);_0x4b30a7[_0x45b5('0x3c')]=_[_0x45b5('0x32')](_0x521a2d[_0x45b5('0x3c')]);_0x4b30a7[_0x45b5('0x33')]=_[_0x45b5('0x34')](_0x4b30a7[_0x45b5('0x35')],_0x4b30a7['query']);_0x4e4f73[_0x45b5('0x36')]=_[_0x45b5('0x34')](_0x4b30a7[_0x45b5('0x35')],qs[_0x45b5('0x37')](_0x521a2d['query'][_0x45b5('0x37')]));_0x4e4f73[_0x45b5('0x36')]=_0x4e4f73[_0x45b5('0x36')][_0x45b5('0x38')]?_0x4e4f73[_0x45b5('0x36')]:_0x4b30a7[_0x45b5('0x35')];_0x4e4f73[_0x45b5('0x3d')]=qs[_0x45b5('0x3e')](_0x521a2d[_0x45b5('0x3c')]['sort']);_0x4e4f73[_0x45b5('0x3f')]=qs[_0x45b5('0x33')](_['pick'](_0x521a2d[_0x45b5('0x3c')],_0x4b30a7[_0x45b5('0x33')]));if(_0x521a2d[_0x45b5('0x3c')][_0x45b5('0x40')]){_0x4e4f73[_0x45b5('0x3f')]=_[_0x45b5('0x41')](_0x4e4f73[_0x45b5('0x3f')],{'$or':_['map'](_0x4e4f73[_0x45b5('0x36')],function(_0x29beb4){var _0x22e6a8={};_0x22e6a8[_0x29beb4]={'$like':'%'+_0x521a2d[_0x45b5('0x3c')][_0x45b5('0x40')]+'%'};return _0x22e6a8;})});}_0x4e4f73=_[_0x45b5('0x41')]({},_0x4e4f73,_0x521a2d[_0x45b5('0x43')]);return _0x379968['getAgents'](_0x4e4f73);}})[_0x45b5('0x27')](function(_0x3eaeed){if(_0x3eaeed){_0x274d18=_0x3eaeed[_0x45b5('0x38')];if(!_0x521a2d[_0x45b5('0x3c')]['hasOwnProperty'](_0x45b5('0x59'))){_0x4e4f73[_0x45b5('0x3a')]=qs[_0x45b5('0x3a')](_0x521a2d['query'][_0x45b5('0x3a')]);_0x4e4f73[_0x45b5('0x3b')]=qs[_0x45b5('0x3b')](_0x521a2d[_0x45b5('0x3c')][_0x45b5('0x3b')]);}return _0x379968[_0x45b5('0x8a')](_0x4e4f73);}})[_0x45b5('0x27')](function(_0x27cc87){if(_0x27cc87){return _0x27cc87?{'count':_0x274d18,'rows':_0x27cc87}:null;}})[_0x45b5('0x27')](respondWithResult(_0x5c5cf8,null))[_0x45b5('0x4c')](handleError(_0x5c5cf8,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8f83510..ead2d2f 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 _0x37ac=['../../mysqldb','FaxQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x270dba,_0x1817d2){var _0x36b83b=function(_0x15a276){while(--_0x15a276){_0x270dba['push'](_0x270dba['shift']());}};_0x36b83b(++_0x1817d2);}(_0x37ac,0x1c1));var _0xc37a=function(_0x209a22,_0x235da2){_0x209a22=_0x209a22-0x0;var _0x5c0456=_0x37ac[_0x209a22];return _0x5c0456;};'use strict';var EventEmitter=require(_0xc37a('0x0'));var FaxQueue=require(_0xc37a('0x1'))['db'][_0xc37a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc37a('0x3'),'afterUpdate':_0xc37a('0x4'),'afterDestroy':_0xc37a('0x5')};function emitEvent(_0x50b9ed){return function(_0x245be9,_0x5e50c1,_0x22054d){FaxQueueEvents[_0xc37a('0x6')](_0x50b9ed+':'+_0x245be9['id'],_0x245be9);FaxQueueEvents['emit'](_0x50b9ed,_0x245be9);_0x22054d(null);};}for(var e in events){if(events[_0xc37a('0x7')](e)){var event=events[e];FaxQueue[_0xc37a('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xf5d8=['events','../../mysqldb','FaxQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3698d7,_0x550f69){var _0x179e1e=function(_0x56b841){while(--_0x56b841){_0x3698d7['push'](_0x3698d7['shift']());}};_0x179e1e(++_0x550f69);}(_0xf5d8,0x154));var _0x8f5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5d8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8f5d('0x0'));var FaxQueue=require(_0x8f5d('0x1'))['db'][_0x8f5d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f5d('0x3'),'afterUpdate':_0x8f5d('0x4'),'afterDestroy':_0x8f5d('0x5')};function emitEvent(_0x3d7be6){return function(_0x4e9381,_0x5233c8,_0x37f5d1){FaxQueueEvents[_0x8f5d('0x6')](_0x3d7be6+':'+_0x4e9381['id'],_0x4e9381);FaxQueueEvents[_0x8f5d('0x6')](_0x3d7be6,_0x4e9381);_0x37f5d1(null);};}for(var e in events){if(events[_0x8f5d('0x7')](e)){var event=events[e];FaxQueue[_0x8f5d('0x8')](e,emitEvent(event));}}module[_0x8f5d('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 31716a3..588d0c5 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 _0xd5ea=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','api','moment'];(function(_0x316e3e,_0x4cd8da){var _0x5b7f8c=function(_0x9aae60){while(--_0x9aae60){_0x316e3e['push'](_0x316e3e['shift']());}};_0x5b7f8c(++_0x4cd8da);}(_0xd5ea,0x1dd));var _0xad5e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd5ea[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xad5e('0x0'));var logger=require('../../config/logger')(_0xad5e('0x1'));var moment=require(_0xad5e('0x2'));var BPromise=require('bluebird');var rp=require(_0xad5e('0x3'));var fs=require('fs');var path=require(_0xad5e('0x4'));var rimraf=require(_0xad5e('0x5'));var config=require(_0xad5e('0x6'));var attributes=require(_0xad5e('0x7'));module[_0xad5e('0x8')]=function(_0x7627de,_0x35d904){return _0x7627de[_0xad5e('0x9')](_0xad5e('0xa'),attributes,{'tableName':_0xad5e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6e4=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash'];(function(_0xd93f0c,_0x1ee80b){var _0x5d507b=function(_0x384fe1){while(--_0x384fe1){_0xd93f0c['push'](_0xd93f0c['shift']());}};_0x5d507b(++_0x1ee80b);}(_0xd6e4,0x6b));var _0x4d6e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xd6e4[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x4d6e('0x0'));var util=require(_0x4d6e('0x1'));var logger=require(_0x4d6e('0x2'))(_0x4d6e('0x3'));var moment=require(_0x4d6e('0x4'));var BPromise=require('bluebird');var rp=require(_0x4d6e('0x5'));var fs=require('fs');var path=require(_0x4d6e('0x6'));var rimraf=require('rimraf');var config=require(_0x4d6e('0x7'));var attributes=require(_0x4d6e('0x8'));module['exports']=function(_0x24374f,_0x3e9114){return _0x24374f[_0x4d6e('0x9')](_0x4d6e('0xa'),attributes,{'tableName':_0x4d6e('0xb'),'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 1628cb6..680b7de 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 _0x3795=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','raw','options','where','attributes','limit','include','map','model','debug','ShowFaxQueue','lodash','util','moment','bluebird'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0x3795,0xe0));var _0x5379=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3795[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5379('0x0'));var util=require(_0x5379('0x1'));var moment=require(_0x5379('0x2'));var BPromise=require(_0x5379('0x3'));var rs=require(_0x5379('0x4'));var fs=require('fs');var Redis=require(_0x5379('0x5'));var db=require(_0x5379('0x6'))['db'];var utils=require(_0x5379('0x7'));var logger=require(_0x5379('0x8'))('rpc');var config=require(_0x5379('0x9'));var jayson=require(_0x5379('0xa'));var client=jayson[_0x5379('0xb')]['http']({'port':0x232a});config[_0x5379('0xc')]=_[_0x5379('0xd')](config[_0x5379('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5379('0xc')]));require(_0x5379('0xe'))[_0x5379('0xf')](socket);function respondWithRpcPromise(_0xa87848,_0x25eaf0,_0x2c8dee){return new BPromise(function(_0x383263,_0x148250){return client[_0x5379('0x10')](_0xa87848,_0x2c8dee)[_0x5379('0x11')](function(_0x592f76){logger[_0x5379('0x12')](_0x5379('0x13'),_0x25eaf0,_0x5379('0x14'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x25eaf0,_0x5379('0x14'),JSON[_0x5379('0x15')](_0x592f76));if(_0x592f76[_0x5379('0x16')]){if(_0x592f76[_0x5379('0x16')][_0x5379('0x17')]===0x1f4){logger[_0x5379('0x16')]('FaxQueue,\x20%s,\x20%s',_0x25eaf0,_0x592f76['error']['message']);return _0x148250(_0x592f76[_0x5379('0x16')][_0x5379('0x18')]);}logger[_0x5379('0x16')](_0x5379('0x13'),_0x25eaf0,_0x592f76['error'][_0x5379('0x18')]);return _0x383263(_0x592f76[_0x5379('0x16')][_0x5379('0x18')]);}else{logger[_0x5379('0x12')]('FaxQueue,\x20%s,\x20%s',_0x25eaf0,_0x5379('0x14'));_0x383263(_0x592f76['result'][_0x5379('0x18')]);}})[_0x5379('0x19')](function(_0x2aa6fb){logger[_0x5379('0x16')](_0x5379('0x13'),_0x25eaf0,_0x2aa6fb);_0x148250(_0x2aa6fb);});});}exports[_0x5379('0x1a')]=function(_0x30c0db){var _0x22363d=this;return new Promise(function(_0x186195,_0x259b59){return db[_0x5379('0x1b')]['findAll']({'raw':_0x30c0db['options']?_0x30c0db['options'][_0x5379('0x1c')]===undefined?!![]:![]:!![],'where':_0x30c0db[_0x5379('0x1d')]?_0x30c0db['options'][_0x5379('0x1e')]||null:null,'attributes':_0x30c0db['options']?_0x30c0db[_0x5379('0x1d')][_0x5379('0x1f')]||null:null,'limit':_0x30c0db[_0x5379('0x1d')]?_0x30c0db[_0x5379('0x1d')][_0x5379('0x20')]||null:null,'include':_0x30c0db[_0x5379('0x1d')]?_0x30c0db['options'][_0x5379('0x21')]?_[_0x5379('0x22')](_0x30c0db[_0x5379('0x1d')][_0x5379('0x21')],function(_0x3abb9b){return{'model':db[_0x3abb9b[_0x5379('0x23')]],'as':_0x3abb9b['as'],'attributes':_0x3abb9b[_0x5379('0x1f')],'include':_0x3abb9b[_0x5379('0x21')]?_[_0x5379('0x22')](_0x3abb9b[_0x5379('0x21')],function(_0x29d677){return{'model':db[_0x29d677['model']],'as':_0x29d677['as'],'attributes':_0x29d677['attributes'],'include':_0x29d677[_0x5379('0x21')]?_['map'](_0x29d677[_0x5379('0x21')],function(_0x440f00){return{'model':db[_0x440f00[_0x5379('0x23')]],'as':_0x440f00['as'],'attributes':_0x440f00[_0x5379('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5379('0x11')](function(_0x2d057b){logger['info'](_0x5379('0x1a'),_0x30c0db);logger['debug'](_0x5379('0x1a'),_0x30c0db,JSON[_0x5379('0x15')](_0x2d057b));_0x186195(_0x2d057b);})[_0x5379('0x19')](function(_0x14ce6a){logger['error'](_0x5379('0x1a'),_0x14ce6a[_0x5379('0x18')],_0x30c0db);_0x259b59(_0x22363d[_0x5379('0x16')](0x1f4,_0x14ce6a[_0x5379('0x18')]));});});};exports['ShowFaxQueue']=function(_0x161171){var _0x108ef2=this;return new Promise(function(_0x217e50,_0x570115){return db[_0x5379('0x1b')]['find']({'raw':_0x161171[_0x5379('0x1d')]?_0x161171[_0x5379('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x161171['options']?_0x161171['options'][_0x5379('0x1e')]||null:null,'attributes':_0x161171[_0x5379('0x1d')]?_0x161171[_0x5379('0x1d')][_0x5379('0x1f')]||null:null,'include':_0x161171[_0x5379('0x1d')]?_0x161171['options'][_0x5379('0x21')]?_['map'](_0x161171[_0x5379('0x1d')][_0x5379('0x21')],function(_0x45e1ee){return{'model':db[_0x45e1ee[_0x5379('0x23')]],'as':_0x45e1ee['as'],'attributes':_0x45e1ee[_0x5379('0x1f')],'include':_0x45e1ee[_0x5379('0x21')]?_[_0x5379('0x22')](_0x45e1ee[_0x5379('0x21')],function(_0x1dc141){return{'model':db[_0x1dc141[_0x5379('0x23')]],'as':_0x1dc141['as'],'attributes':_0x1dc141[_0x5379('0x1f')],'include':_0x1dc141['include']?_[_0x5379('0x22')](_0x1dc141['include'],function(_0x32d1df){return{'model':db[_0x32d1df['model']],'as':_0x32d1df['as'],'attributes':_0x32d1df['attributes']};}):[]};}):[]};}):[]:[]})[_0x5379('0x11')](function(_0x53ad1e){logger['info']('ShowFaxQueue',_0x161171);logger[_0x5379('0x24')](_0x5379('0x25'),_0x161171,JSON[_0x5379('0x15')](_0x53ad1e));_0x217e50(_0x53ad1e);})[_0x5379('0x19')](function(_0x2fd7a1){logger[_0x5379('0x16')](_0x5379('0x25'),_0x2fd7a1[_0x5379('0x18')],_0x161171);_0x570115(_0x108ef2[_0x5379('0x16')](0x1f4,_0x2fd7a1[_0x5379('0x18')]));});});}; \ No newline at end of file +var _0x5fee=['stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowFaxQueue','find','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x5fee,0x1dc));var _0xe5fe=function(_0x39e5a8,_0x367273){_0x39e5a8=_0x39e5a8-0x0;var _0x5c9feb=_0x5fee[_0x39e5a8];return _0x5c9feb;};'use strict';var _=require('lodash');var util=require(_0xe5fe('0x0'));var moment=require(_0xe5fe('0x1'));var BPromise=require('bluebird');var rs=require(_0xe5fe('0x2'));var fs=require('fs');var Redis=require(_0xe5fe('0x3'));var db=require(_0xe5fe('0x4'))['db'];var utils=require(_0xe5fe('0x5'));var logger=require('../../config/logger')(_0xe5fe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5fe('0x7')][_0xe5fe('0x8')]({'port':0x232a});config['redis']=_[_0xe5fe('0x9')](config['redis'],{'host':_0xe5fe('0xa'),'port':0x18eb});var socket=require(_0xe5fe('0xb'))(new Redis(config['redis']));require(_0xe5fe('0xc'))['register'](socket);function respondWithRpcPromise(_0x5882d5,_0x478566,_0x42f37b){return new BPromise(function(_0x535267,_0x3f0498){return client[_0xe5fe('0xd')](_0x5882d5,_0x42f37b)[_0xe5fe('0xe')](function(_0x28faa3){logger['info'](_0xe5fe('0xf'),_0x478566,_0xe5fe('0x10'));logger['debug'](_0xe5fe('0x11'),_0x478566,_0xe5fe('0x10'),JSON[_0xe5fe('0x12')](_0x28faa3));if(_0x28faa3[_0xe5fe('0x13')]){if(_0x28faa3['error'][_0xe5fe('0x14')]===0x1f4){logger[_0xe5fe('0x13')]('FaxQueue,\x20%s,\x20%s',_0x478566,_0x28faa3[_0xe5fe('0x13')][_0xe5fe('0x15')]);return _0x3f0498(_0x28faa3[_0xe5fe('0x13')]['message']);}logger[_0xe5fe('0x13')](_0xe5fe('0xf'),_0x478566,_0x28faa3['error'][_0xe5fe('0x15')]);return _0x535267(_0x28faa3[_0xe5fe('0x13')][_0xe5fe('0x15')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x478566,_0xe5fe('0x10'));_0x535267(_0x28faa3[_0xe5fe('0x16')][_0xe5fe('0x15')]);}})[_0xe5fe('0x17')](function(_0x1eda5a){logger[_0xe5fe('0x13')](_0xe5fe('0xf'),_0x478566,_0x1eda5a);_0x3f0498(_0x1eda5a);});});}exports[_0xe5fe('0x18')]=function(_0x2d146a){var _0x24a89d=this;return new Promise(function(_0x8edcc5,_0x422cee){return db['FaxQueue'][_0xe5fe('0x19')]({'raw':_0x2d146a[_0xe5fe('0x1a')]?_0x2d146a['options'][_0xe5fe('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d146a['options']?_0x2d146a[_0xe5fe('0x1a')][_0xe5fe('0x1c')]||null:null,'attributes':_0x2d146a[_0xe5fe('0x1a')]?_0x2d146a[_0xe5fe('0x1a')][_0xe5fe('0x1d')]||null:null,'limit':_0x2d146a[_0xe5fe('0x1a')]?_0x2d146a[_0xe5fe('0x1a')][_0xe5fe('0x1e')]||null:null,'include':_0x2d146a[_0xe5fe('0x1a')]?_0x2d146a[_0xe5fe('0x1a')]['include']?_[_0xe5fe('0x1f')](_0x2d146a[_0xe5fe('0x1a')][_0xe5fe('0x20')],function(_0x36986d){return{'model':db[_0x36986d[_0xe5fe('0x21')]],'as':_0x36986d['as'],'attributes':_0x36986d[_0xe5fe('0x1d')],'include':_0x36986d[_0xe5fe('0x20')]?_[_0xe5fe('0x1f')](_0x36986d[_0xe5fe('0x20')],function(_0x2021b0){return{'model':db[_0x2021b0['model']],'as':_0x2021b0['as'],'attributes':_0x2021b0['attributes'],'include':_0x2021b0[_0xe5fe('0x20')]?_[_0xe5fe('0x1f')](_0x2021b0[_0xe5fe('0x20')],function(_0x59ad7f){return{'model':db[_0x59ad7f[_0xe5fe('0x21')]],'as':_0x59ad7f['as'],'attributes':_0x59ad7f[_0xe5fe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe5fe('0xe')](function(_0xa744d6){logger['info'](_0xe5fe('0x18'),_0x2d146a);logger[_0xe5fe('0x22')](_0xe5fe('0x18'),_0x2d146a,JSON[_0xe5fe('0x12')](_0xa744d6));_0x8edcc5(_0xa744d6);})['catch'](function(_0x5c43c5){logger[_0xe5fe('0x13')](_0xe5fe('0x18'),_0x5c43c5[_0xe5fe('0x15')],_0x2d146a);_0x422cee(_0x24a89d[_0xe5fe('0x13')](0x1f4,_0x5c43c5[_0xe5fe('0x15')]));});});};exports[_0xe5fe('0x23')]=function(_0x4d3c5e){var _0x522ca1=this;return new Promise(function(_0x1a9426,_0xca8b59){return db['FaxQueue'][_0xe5fe('0x24')]({'raw':_0x4d3c5e[_0xe5fe('0x1a')]?_0x4d3c5e[_0xe5fe('0x1a')][_0xe5fe('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d3c5e[_0xe5fe('0x1a')]?_0x4d3c5e['options'][_0xe5fe('0x1c')]||null:null,'attributes':_0x4d3c5e['options']?_0x4d3c5e[_0xe5fe('0x1a')]['attributes']||null:null,'include':_0x4d3c5e[_0xe5fe('0x1a')]?_0x4d3c5e['options']['include']?_[_0xe5fe('0x1f')](_0x4d3c5e[_0xe5fe('0x1a')]['include'],function(_0x209a7a){return{'model':db[_0x209a7a[_0xe5fe('0x21')]],'as':_0x209a7a['as'],'attributes':_0x209a7a[_0xe5fe('0x1d')],'include':_0x209a7a[_0xe5fe('0x20')]?_['map'](_0x209a7a[_0xe5fe('0x20')],function(_0x32a3cd){return{'model':db[_0x32a3cd[_0xe5fe('0x21')]],'as':_0x32a3cd['as'],'attributes':_0x32a3cd[_0xe5fe('0x1d')],'include':_0x32a3cd['include']?_['map'](_0x32a3cd[_0xe5fe('0x20')],function(_0x103c75){return{'model':db[_0x103c75[_0xe5fe('0x21')]],'as':_0x103c75['as'],'attributes':_0x103c75[_0xe5fe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe5fe('0xe')](function(_0x40e392){logger[_0xe5fe('0x25')]('ShowFaxQueue',_0x4d3c5e);logger[_0xe5fe('0x22')]('ShowFaxQueue',_0x4d3c5e,JSON[_0xe5fe('0x12')](_0x40e392));_0x1a9426(_0x40e392);})[_0xe5fe('0x17')](function(_0x3f7027){logger[_0xe5fe('0x13')](_0xe5fe('0x23'),_0x3f7027[_0xe5fe('0x15')],_0x4d3c5e);_0xca8b59(_0x522ca1[_0xe5fe('0x13')](0x1f4,_0x3f7027[_0xe5fe('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a86daae..37064a8 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 _0xee81=['length','faxQueue:','./faxQueue.events','save','remove','register'];(function(_0x218947,_0x22c2a0){var _0x25c3bd=function(_0x4b6652){while(--_0x4b6652){_0x218947['push'](_0x218947['shift']());}};_0x25c3bd(++_0x22c2a0);}(_0xee81,0x15e));var _0x1ee8=function(_0x2e703d,_0x2b1fba){_0x2e703d=_0x2e703d-0x0;var _0x372a44=_0xee81[_0x2e703d];return _0x372a44;};'use strict';var FaxQueueEvents=require(_0x1ee8('0x0'));var events=[_0x1ee8('0x1'),_0x1ee8('0x2'),'update'];function createListener(_0x5d224f,_0x3b4269){return function(_0x2b7a72){_0x3b4269['emit'](_0x5d224f,_0x2b7a72);};}function removeListener(_0xd4fc66,_0x11b545){return function(){FaxQueueEvents['removeListener'](_0xd4fc66,_0x11b545);};}exports[_0x1ee8('0x3')]=function(_0xd6987){for(var _0x1f303b=0x0,_0x211c4f=events[_0x1ee8('0x4')];_0x1f303b<_0x211c4f;_0x1f303b++){var _0x984d62=events[_0x1f303b];var _0x3e095d=createListener(_0x1ee8('0x5')+_0x984d62,_0xd6987);FaxQueueEvents['on'](_0x984d62,_0x3e095d);}}; \ No newline at end of file +var _0x8fc5=['emit','removeListener','length','save','update'];(function(_0x104c9b,_0x56944d){var _0x39ba4d=function(_0x5d81a1){while(--_0x5d81a1){_0x104c9b['push'](_0x104c9b['shift']());}};_0x39ba4d(++_0x56944d);}(_0x8fc5,0x1ca));var _0x58fc=function(_0x4595b6,_0x248fd7){_0x4595b6=_0x4595b6-0x0;var _0x937048=_0x8fc5[_0x4595b6];return _0x937048;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x58fc('0x0'),'remove',_0x58fc('0x1')];function createListener(_0x2c2edd,_0x3ea007){return function(_0x1c12bb){_0x3ea007[_0x58fc('0x2')](_0x2c2edd,_0x1c12bb);};}function removeListener(_0x4b7bd2,_0x222e07){return function(){FaxQueueEvents[_0x58fc('0x3')](_0x4b7bd2,_0x222e07);};}exports['register']=function(_0x1f0c3d){for(var _0x488955=0x0,_0x125f32=events[_0x58fc('0x4')];_0x488955<_0x125f32;_0x488955++){var _0x5ab15f=events[_0x488955];var _0x4c715e=createListener('faxQueue:'+_0x5ab15f,_0x1f0c3d);FaxQueueEvents['on'](_0x5ab15f,_0x4c715e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3b2576a..298aefe 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 _0x0295=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','getMembers','getTeams','getAgents','/:id/teams','addTeams','post','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x0295,0x1f0));var _0x5029=function(_0xfab345,_0x43fc6e){_0xfab345=_0xfab345-0x0;var _0x1a60fd=_0x0295[_0xfab345];return _0x1a60fd;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/members',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/teams',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x11')]);router[_0x5029('0x12')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router[_0x5029('0x15')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router['delete'](_0x5029('0xd'),auth[_0x5029('0x8')](),controller[_0x5029('0x17')]);router[_0x5029('0x15')](_0x5029('0x10'),auth[_0x5029('0x8')](),controller[_0x5029('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9bd9=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0xc3c0af,_0x482aca){var _0x53efc2=function(_0xffa2f8){while(--_0xffa2f8){_0xc3c0af['push'](_0xc3c0af['shift']());}};_0x53efc2(++_0x482aca);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x9bd9[_0x1c156e];return _0x58fc22;};'use strict';var multer=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var path=require(_0x99bd('0x2'));var timeout=require(_0x99bd('0x3'));var express=require(_0x99bd('0x4'));var router=express[_0x99bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x99bd('0x7'));var controller=require(_0x99bd('0x8'));router['get']('/',auth[_0x99bd('0x9')](),controller[_0x99bd('0xa')]);router[_0x99bd('0xb')](_0x99bd('0xc'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xd')]);router[_0x99bd('0xb')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xf')]);router[_0x99bd('0xb')](_0x99bd('0x10'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x11')]);router['get'](_0x99bd('0x12'),auth['isAuthenticated'](),controller[_0x99bd('0x13')]);router['get'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller['getAgents']);router[_0x99bd('0x15')]('/',auth['isAuthenticated'](),controller[_0x99bd('0x16')]);router['post'](_0x99bd('0x12'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x17')]);router['post'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x18')]);router[_0x99bd('0x19')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1a')]);router[_0x99bd('0x1b')](_0x99bd('0xe'),auth['isAuthenticated'](),controller[_0x99bd('0x1c')]);router[_0x99bd('0x1b')](_0x99bd('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x99bd('0x1b')](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1d')]);module[_0x99bd('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d6d7eee..f83978f 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 _0xdd48=['moment','sequelize','STRING','DATE'];(function(_0x11afde,_0x5defc5){var _0x591a00=function(_0x98dbb1){while(--_0x98dbb1){_0x11afde['push'](_0x11afde['shift']());}};_0x591a00(++_0x5defc5);}(_0xdd48,0xec));var _0x8dd4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdd48[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x8dd4('0x0'));var Sequelize=require(_0x8dd4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8dd4('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8dd4('0x3')]},'leaveAt':{'type':Sequelize[_0x8dd4('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8dd4('0x3')]},'reason':{'type':Sequelize[_0x8dd4('0x2')]}}; \ No newline at end of file +var _0x3d7b=['exports','STRING','DATE','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d7b,0x1a2));var _0xb3d7=function(_0xd6ab42,_0x4a76f8){_0xd6ab42=_0xd6ab42-0x0;var _0x445960=_0x3d7b[_0xd6ab42];return _0x445960;};'use strict';var moment=require(_0xb3d7('0x0'));var Sequelize=require(_0xb3d7('0x1'));module[_0xb3d7('0x2')]={'uniqueid':{'type':Sequelize[_0xb3d7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb3d7('0x3')]},'joinAt':{'type':Sequelize[_0xb3d7('0x4')]},'leaveAt':{'type':Sequelize[_0xb3d7('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb3d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ca4237f..3deee4f 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 _0x280f=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','FaxQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','length','options','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x280f,0xe2));var _0xf280=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x280f[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require(_0xf280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf280('0x1'));var jsonpatch=require(_0xf280('0x2'));var rp=require(_0xf280('0x3'));var moment=require(_0xf280('0x4'));var BPromise=require(_0xf280('0x5'));var Mustache=require(_0xf280('0x6'));var util=require(_0xf280('0x7'));var path=require('path');var sox=require(_0xf280('0x8'));var csv=require(_0xf280('0x9'));var ejs=require(_0xf280('0xa'));var fs=require('fs');var fs_extra=require(_0xf280('0xb'));var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0x9'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var as=require(_0xf280('0x14'));var hardwareService=require(_0xf280('0x15'));var logger=require(_0xf280('0x16'))(_0xf280('0x17'));var utils=require(_0xf280('0x18'));var config=require(_0xf280('0x19'));var licenseUtil=require(_0xf280('0x1a'));var db=require(_0xf280('0x1b'))['db'];function respondWithStatusCode(_0x148d24,_0x56221f){_0x56221f=_0x56221f||0xcc;return function(_0x566eb7){if(_0x566eb7){return _0x148d24[_0xf280('0x1c')](_0x56221f);}return _0x148d24[_0xf280('0x1d')](_0x56221f)[_0xf280('0x1e')]();};}function respondWithResult(_0x1d7175,_0x3e9acc){_0x3e9acc=_0x3e9acc||0xc8;return function(_0x59fb22){if(_0x59fb22){return _0x1d7175[_0xf280('0x1d')](_0x3e9acc)[_0xf280('0x1f')](_0x59fb22);}};}function respondWithFilteredResult(_0x34cadb,_0x224162){return function(_0x1e8f4d){if(_0x1e8f4d){var _0x462177=typeof _0x224162[_0xf280('0x20')]==='undefined'&&typeof _0x224162['limit']==='undefined';var _0x30a9a6=_0x1e8f4d['count'];var _0x11c2b0=_0x462177?0x0:_0x224162['offset'];var _0x2a19e7=_0x462177?_0x1e8f4d[_0xf280('0x21')]:_0x224162['offset']+_0x224162[_0xf280('0x22')];var _0x59b8af;if(_0x2a19e7>=_0x30a9a6){_0x2a19e7=_0x30a9a6;_0x59b8af=0xc8;}else{_0x59b8af=0xce;}_0x34cadb[_0xf280('0x1d')](_0x59b8af);return _0x34cadb[_0xf280('0x23')](_0xf280('0x24'),_0x11c2b0+'-'+_0x2a19e7+'/'+_0x30a9a6)[_0xf280('0x1f')](_0x1e8f4d);}return null;};}function patchUpdates(_0x11db7d){return function(_0x3a4eff){try{jsonpatch[_0xf280('0x25')](_0x3a4eff,_0x11db7d,!![]);}catch(_0x469bdf){return BPromise[_0xf280('0x26')](_0x469bdf);}return _0x3a4eff['save']();};}function saveUpdates(_0x1ad62a,_0x5a1aa1){return function(_0xfb624e){if(_0xfb624e){return _0xfb624e[_0xf280('0x27')](_0x1ad62a)[_0xf280('0x28')](function(_0x32039f){return _0x32039f;});}return null;};}function removeEntity(_0x3de08f,_0x42020c){return function(_0x4c3618){if(_0x4c3618){return _0x4c3618[_0xf280('0x29')]()[_0xf280('0x28')](function(){_0x3de08f[_0xf280('0x1d')](0xcc)[_0xf280('0x1e')]();});}};}function handleEntityNotFound(_0x35cd2d,_0x302132){return function(_0x4509c1){if(!_0x4509c1){_0x35cd2d[_0xf280('0x1c')](0x194);}return _0x4509c1;};}function handleError(_0x485788,_0x368b24){_0x368b24=_0x368b24||0x1f4;return function(_0x1b21fb){logger[_0xf280('0x2a')](_0x1b21fb[_0xf280('0x2b')]);if(_0x1b21fb['name']){delete _0x1b21fb['name'];}_0x485788['status'](_0x368b24)['send'](_0x1b21fb);};}exports['index']=function(_0x3da40e,_0x2409f4){var _0xa1fbb7={},_0x34edaf={},_0x545ccf={'count':0x0,'rows':[]};var _0x1cdf05=_['map'](db[_0xf280('0x2c')][_0xf280('0x2d')],function(_0x534233){return{'name':_0x534233[_0xf280('0x2e')],'type':_0x534233[_0xf280('0x2f')][_0xf280('0x30')]};});_0x34edaf[_0xf280('0x31')]=_['map'](_0x1cdf05,_0xf280('0x32'));_0x34edaf[_0xf280('0x33')]=_[_0xf280('0x34')](_0x3da40e[_0xf280('0x33')]);_0x34edaf[_0xf280('0x35')]=_[_0xf280('0x36')](_0x34edaf[_0xf280('0x31')],_0x34edaf[_0xf280('0x33')]);_0xa1fbb7['attributes']=_[_0xf280('0x36')](_0x34edaf[_0xf280('0x31')],qs[_0xf280('0x37')](_0x3da40e[_0xf280('0x33')]['fields']));_0xa1fbb7['attributes']=_0xa1fbb7[_0xf280('0x38')]['length']?_0xa1fbb7[_0xf280('0x38')]:_0x34edaf[_0xf280('0x31')];if(!_0x3da40e[_0xf280('0x33')][_0xf280('0x39')](_0xf280('0x3a'))){_0xa1fbb7['limit']=qs['limit'](_0x3da40e['query'][_0xf280('0x22')]);_0xa1fbb7['offset']=qs[_0xf280('0x20')](_0x3da40e[_0xf280('0x33')]['offset']);}_0xa1fbb7[_0xf280('0x3b')]=qs[_0xf280('0x3c')](_0x3da40e[_0xf280('0x33')][_0xf280('0x3c')]);_0xa1fbb7[_0xf280('0x3d')]=qs[_0xf280('0x35')](_[_0xf280('0x3e')](_0x3da40e[_0xf280('0x33')],_0x34edaf[_0xf280('0x35')]),_0x1cdf05);if(_0x3da40e[_0xf280('0x33')]['filter']){_0xa1fbb7[_0xf280('0x3d')]=_[_0xf280('0x3f')](_0xa1fbb7[_0xf280('0x3d')],{'$or':_[_0xf280('0x40')](_0x1cdf05,function(_0x263a56){if(_0x263a56['type']!==_0xf280('0x41')){var _0x1f9365={};_0x1f9365[_0x263a56['name']]={'$like':'%'+_0x3da40e[_0xf280('0x33')][_0xf280('0x42')]+'%'};return _0x1f9365;}})});}_0xa1fbb7=_[_0xf280('0x3f')]({},_0xa1fbb7,_0x3da40e['options']);var _0x1ff055={'where':_0xa1fbb7[_0xf280('0x3d')]};return db['FaxQueueReport'][_0xf280('0x21')](_0x1ff055)[_0xf280('0x28')](function(_0x422f4c){_0x545ccf[_0xf280('0x21')]=_0x422f4c;if(_0x3da40e[_0xf280('0x33')][_0xf280('0x43')]){_0xa1fbb7[_0xf280('0x44')]=[{'all':!![]}];}return db[_0xf280('0x2c')][_0xf280('0x45')](_0xa1fbb7);})[_0xf280('0x28')](function(_0x22822e){_0x545ccf['rows']=_0x22822e;return _0x545ccf;})[_0xf280('0x28')](respondWithFilteredResult(_0x2409f4,_0xa1fbb7))[_0xf280('0x46')](handleError(_0x2409f4,null));};exports[_0xf280('0x47')]=function(_0x408be4,_0x4dcffd){var _0x2ef2c6={'raw':!![],'where':{'id':_0x408be4[_0xf280('0x48')]['id']}},_0x456ac6={};_0x456ac6[_0xf280('0x31')]=_[_0xf280('0x34')](db['FaxQueueReport'][_0xf280('0x2d')]);_0x456ac6['query']=_[_0xf280('0x34')](_0x408be4['query']);_0x456ac6[_0xf280('0x35')]=_[_0xf280('0x36')](_0x456ac6[_0xf280('0x31')],_0x456ac6['query']);_0x2ef2c6['attributes']=_[_0xf280('0x36')](_0x456ac6[_0xf280('0x31')],qs['fields'](_0x408be4[_0xf280('0x33')][_0xf280('0x37')]));_0x2ef2c6[_0xf280('0x38')]=_0x2ef2c6[_0xf280('0x38')][_0xf280('0x49')]?_0x2ef2c6['attributes']:_0x456ac6[_0xf280('0x31')];if(_0x408be4[_0xf280('0x33')][_0xf280('0x43')]){_0x2ef2c6[_0xf280('0x44')]=[{'all':!![]}];}_0x2ef2c6=_[_0xf280('0x3f')]({},_0x2ef2c6,_0x408be4[_0xf280('0x4a')]);return db[_0xf280('0x2c')]['find'](_0x2ef2c6)[_0xf280('0x28')](handleEntityNotFound(_0x4dcffd,null))[_0xf280('0x28')](respondWithResult(_0x4dcffd,null))[_0xf280('0x46')](handleError(_0x4dcffd,null));};exports[_0xf280('0x4b')]=function(_0x5648cc,_0x29c7f0){return db[_0xf280('0x2c')]['create'](_0x5648cc[_0xf280('0x4c')],{})[_0xf280('0x28')](respondWithResult(_0x29c7f0,0xc9))['catch'](handleError(_0x29c7f0,null));};exports[_0xf280('0x27')]=function(_0x4991d9,_0x5f45ca){if(_0x4991d9[_0xf280('0x4c')]['id']){delete _0x4991d9[_0xf280('0x4c')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x4991d9[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f45ca,null))[_0xf280('0x28')](saveUpdates(_0x4991d9[_0xf280('0x4c')],null))[_0xf280('0x28')](respondWithResult(_0x5f45ca,null))[_0xf280('0x46')](handleError(_0x5f45ca,null));};exports[_0xf280('0x29')]=function(_0x1c4522,_0xc3a873){return db['FaxQueueReport'][_0xf280('0x4d')]({'where':{'id':_0x1c4522[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0xc3a873,null))['then'](removeEntity(_0xc3a873,null))['catch'](handleError(_0xc3a873,null));};exports['describe']=function(_0x5a8325,_0x1ed725){return db[_0xf280('0x2c')]['describe']()[_0xf280('0x28')](respondWithResult(_0x1ed725,null))[_0xf280('0x46')](handleError(_0x1ed725,null));}; \ No newline at end of file +var _0x8278=['zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','save','update','destroy','end','error','stack','name','send','FaxQueueReport','fieldName','type','key','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','then','findAll','rows','catch','params','model','includeAll','find','create','body','describe','eml-format','rimraf'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8827('0x0'));var rimraf=require(_0x8827('0x1'));var zipdir=require(_0x8827('0x2'));var jsonpatch=require(_0x8827('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8827('0x4'));var Mustache=require(_0x8827('0x5'));var util=require(_0x8827('0x6'));var path=require(_0x8827('0x7'));var sox=require('sox');var csv=require(_0x8827('0x8'));var ejs=require(_0x8827('0x9'));var fs=require('fs');var fs_extra=require(_0x8827('0xa'));var _=require(_0x8827('0xb'));var squel=require(_0x8827('0xc'));var crypto=require(_0x8827('0xd'));var jsforce=require(_0x8827('0xe'));var deskjs=require(_0x8827('0xf'));var toCsv=require(_0x8827('0x8'));var querystring=require(_0x8827('0x10'));var Papa=require(_0x8827('0x11'));var Redis=require(_0x8827('0x12'));var authService=require(_0x8827('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8827('0x14'));var hardwareService=require(_0x8827('0x15'));var logger=require('../../config/logger')(_0x8827('0x16'));var utils=require(_0x8827('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8827('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a180c,_0x2cce86){_0x2cce86=_0x2cce86||0xcc;return function(_0x449408){if(_0x449408){return _0x4a180c[_0x8827('0x19')](_0x2cce86);}return _0x4a180c[_0x8827('0x1a')](_0x2cce86)['end']();};}function respondWithResult(_0x2334cb,_0xc0b479){_0xc0b479=_0xc0b479||0xc8;return function(_0x29639d){if(_0x29639d){return _0x2334cb[_0x8827('0x1a')](_0xc0b479)[_0x8827('0x1b')](_0x29639d);}};}function respondWithFilteredResult(_0x16fd76,_0x20c6b7){return function(_0x560fba){if(_0x560fba){var _0x4456e3=typeof _0x20c6b7[_0x8827('0x1c')]===_0x8827('0x1d')&&typeof _0x20c6b7['limit']===_0x8827('0x1d');var _0xa8569a=_0x560fba[_0x8827('0x1e')];var _0x4c7bbb=_0x4456e3?0x0:_0x20c6b7['offset'];var _0x4484ba=_0x4456e3?_0x560fba[_0x8827('0x1e')]:_0x20c6b7['offset']+_0x20c6b7['limit'];var _0x32fd04;if(_0x4484ba>=_0xa8569a){_0x4484ba=_0xa8569a;_0x32fd04=0xc8;}else{_0x32fd04=0xce;}_0x16fd76['status'](_0x32fd04);return _0x16fd76['set']('Content-Range',_0x4c7bbb+'-'+_0x4484ba+'/'+_0xa8569a)[_0x8827('0x1b')](_0x560fba);}return null;};}function patchUpdates(_0x161283){return function(_0x35ffe0){try{jsonpatch['apply'](_0x35ffe0,_0x161283,!![]);}catch(_0x14f344){return BPromise['reject'](_0x14f344);}return _0x35ffe0[_0x8827('0x1f')]();};}function saveUpdates(_0x186787,_0x5df50d){return function(_0x47efe7){if(_0x47efe7){return _0x47efe7[_0x8827('0x20')](_0x186787)['then'](function(_0x2915b6){return _0x2915b6;});}return null;};}function removeEntity(_0x52e0d6,_0x43f846){return function(_0xc7069d){if(_0xc7069d){return _0xc7069d[_0x8827('0x21')]()['then'](function(){_0x52e0d6[_0x8827('0x1a')](0xcc)[_0x8827('0x22')]();});}};}function handleEntityNotFound(_0xa8216,_0x5ecafa){return function(_0x44de19){if(!_0x44de19){_0xa8216['sendStatus'](0x194);}return _0x44de19;};}function handleError(_0x4210c7,_0x363a48){_0x363a48=_0x363a48||0x1f4;return function(_0x544a0a){logger[_0x8827('0x23')](_0x544a0a[_0x8827('0x24')]);if(_0x544a0a[_0x8827('0x25')]){delete _0x544a0a[_0x8827('0x25')];}_0x4210c7[_0x8827('0x1a')](_0x363a48)[_0x8827('0x26')](_0x544a0a);};}exports['index']=function(_0x58e238,_0x455b17){var _0x5e2ed4={},_0xf84db2={},_0x115267={'count':0x0,'rows':[]};var _0x5322a4=_['map'](db[_0x8827('0x27')]['rawAttributes'],function(_0x6fb312){return{'name':_0x6fb312[_0x8827('0x28')],'type':_0x6fb312[_0x8827('0x29')][_0x8827('0x2a')]};});_0xf84db2['model']=_[_0x8827('0x2b')](_0x5322a4,'name');_0xf84db2['query']=_[_0x8827('0x2c')](_0x58e238[_0x8827('0x2d')]);_0xf84db2[_0x8827('0x2e')]=_[_0x8827('0x2f')](_0xf84db2['model'],_0xf84db2[_0x8827('0x2d')]);_0x5e2ed4[_0x8827('0x30')]=_[_0x8827('0x2f')](_0xf84db2['model'],qs[_0x8827('0x31')](_0x58e238['query'][_0x8827('0x31')]));_0x5e2ed4[_0x8827('0x30')]=_0x5e2ed4['attributes'][_0x8827('0x32')]?_0x5e2ed4[_0x8827('0x30')]:_0xf84db2['model'];if(!_0x58e238['query'][_0x8827('0x33')](_0x8827('0x34'))){_0x5e2ed4['limit']=qs['limit'](_0x58e238['query'][_0x8827('0x35')]);_0x5e2ed4['offset']=qs[_0x8827('0x1c')](_0x58e238[_0x8827('0x2d')][_0x8827('0x1c')]);}_0x5e2ed4[_0x8827('0x36')]=qs[_0x8827('0x37')](_0x58e238[_0x8827('0x2d')]['sort']);_0x5e2ed4[_0x8827('0x38')]=qs[_0x8827('0x2e')](_[_0x8827('0x39')](_0x58e238['query'],_0xf84db2[_0x8827('0x2e')]),_0x5322a4);if(_0x58e238[_0x8827('0x2d')]['filter']){_0x5e2ed4['where']=_[_0x8827('0x3a')](_0x5e2ed4[_0x8827('0x38')],{'$or':_[_0x8827('0x2b')](_0x5322a4,function(_0x32fead){if(_0x32fead[_0x8827('0x29')]!==_0x8827('0x3b')){var _0x2dd883={};_0x2dd883[_0x32fead['name']]={'$like':'%'+_0x58e238[_0x8827('0x2d')]['filter']+'%'};return _0x2dd883;}})});}_0x5e2ed4=_[_0x8827('0x3a')]({},_0x5e2ed4,_0x58e238[_0x8827('0x3c')]);var _0x13b8f0={'where':_0x5e2ed4[_0x8827('0x38')]};return db[_0x8827('0x27')][_0x8827('0x1e')](_0x13b8f0)[_0x8827('0x3d')](function(_0x40436a){_0x115267[_0x8827('0x1e')]=_0x40436a;if(_0x58e238[_0x8827('0x2d')]['includeAll']){_0x5e2ed4['include']=[{'all':!![]}];}return db[_0x8827('0x27')][_0x8827('0x3e')](_0x5e2ed4);})[_0x8827('0x3d')](function(_0x37da4a){_0x115267[_0x8827('0x3f')]=_0x37da4a;return _0x115267;})[_0x8827('0x3d')](respondWithFilteredResult(_0x455b17,_0x5e2ed4))[_0x8827('0x40')](handleError(_0x455b17,null));};exports['show']=function(_0x576a9d,_0x10cd30){var _0x5d812c={'raw':!![],'where':{'id':_0x576a9d[_0x8827('0x41')]['id']}},_0x5da6dc={};_0x5da6dc[_0x8827('0x42')]=_[_0x8827('0x2c')](db[_0x8827('0x27')]['rawAttributes']);_0x5da6dc['query']=_[_0x8827('0x2c')](_0x576a9d[_0x8827('0x2d')]);_0x5da6dc[_0x8827('0x2e')]=_[_0x8827('0x2f')](_0x5da6dc[_0x8827('0x42')],_0x5da6dc[_0x8827('0x2d')]);_0x5d812c['attributes']=_[_0x8827('0x2f')](_0x5da6dc[_0x8827('0x42')],qs[_0x8827('0x31')](_0x576a9d['query'][_0x8827('0x31')]));_0x5d812c['attributes']=_0x5d812c[_0x8827('0x30')][_0x8827('0x32')]?_0x5d812c[_0x8827('0x30')]:_0x5da6dc['model'];if(_0x576a9d['query'][_0x8827('0x43')]){_0x5d812c['include']=[{'all':!![]}];}_0x5d812c=_[_0x8827('0x3a')]({},_0x5d812c,_0x576a9d[_0x8827('0x3c')]);return db['FaxQueueReport'][_0x8827('0x44')](_0x5d812c)[_0x8827('0x3d')](handleEntityNotFound(_0x10cd30,null))[_0x8827('0x3d')](respondWithResult(_0x10cd30,null))[_0x8827('0x40')](handleError(_0x10cd30,null));};exports[_0x8827('0x45')]=function(_0x5b3e20,_0x989745){return db[_0x8827('0x27')]['create'](_0x5b3e20['body'],{})[_0x8827('0x3d')](respondWithResult(_0x989745,0xc9))[_0x8827('0x40')](handleError(_0x989745,null));};exports['update']=function(_0x361a03,_0x12916c){if(_0x361a03[_0x8827('0x46')]['id']){delete _0x361a03['body']['id'];}return db[_0x8827('0x27')][_0x8827('0x44')]({'where':{'id':_0x361a03[_0x8827('0x41')]['id']}})[_0x8827('0x3d')](handleEntityNotFound(_0x12916c,null))[_0x8827('0x3d')](saveUpdates(_0x361a03[_0x8827('0x46')],null))[_0x8827('0x3d')](respondWithResult(_0x12916c,null))[_0x8827('0x40')](handleError(_0x12916c,null));};exports[_0x8827('0x21')]=function(_0x3d1004,_0x272d1d){return db[_0x8827('0x27')]['find']({'where':{'id':_0x3d1004[_0x8827('0x41')]['id']}})[_0x8827('0x3d')](handleEntityNotFound(_0x272d1d,null))['then'](removeEntity(_0x272d1d,null))[_0x8827('0x40')](handleError(_0x272d1d,null));};exports['describe']=function(_0x91273e,_0x1e6bb6){return db[_0x8827('0x27')][_0x8827('0x47')]()[_0x8827('0x3d')](respondWithResult(_0x1e6bb6,null))[_0x8827('0x40')](handleError(_0x1e6bb6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index cce6da2..a9f2023 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x224177,_0x26fc45){var _0xb6699c=function(_0x3dfd05){while(--_0x3dfd05){_0x224177['push'](_0x224177['shift']());}};_0xb6699c(++_0x26fc45);}(_0x53ec,0x192));var _0xc53e=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x53ec[_0x224f65];return _0x3f921c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x17c80c,_0x5498fb){var _0x5581a3=function(_0x2367b7){while(--_0x2367b7){_0x17c80c['push'](_0x17c80c['shift']());}};_0x5581a3(++_0x5498fb);}(_0x326f,0xd1));var _0xf326=function(_0x386d06,_0x30e48f){_0x386d06=_0x386d06-0x0;var _0x39110a=_0x326f[_0x386d06];return _0x39110a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e1bc428..879794c 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 _0xd4fe=['create','body','raw','CreateFaxQueueReport','FaxQueueReport','update','options','limit','UpdateFaxQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4a5b60,_0x382a8d){var _0x55c779=function(_0x3dfb52){while(--_0x3dfb52){_0x4a5b60['push'](_0x4a5b60['shift']());}};_0x55c779(++_0x382a8d);}(_0xd4fe,0x9f));var _0xed4f=function(_0x3c4c6e,_0x473754){_0x3c4c6e=_0x3c4c6e-0x0;var _0x55ff5f=_0xd4fe[_0x3c4c6e];return _0x55ff5f;};'use strict';var _=require(_0xed4f('0x0'));var util=require(_0xed4f('0x1'));var moment=require('moment');var BPromise=require(_0xed4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed4f('0x3'));var db=require(_0xed4f('0x4'))['db'];var utils=require(_0xed4f('0x5'));var logger=require('../../config/logger')(_0xed4f('0x6'));var config=require('../../config/environment');var jayson=require(_0xed4f('0x7'));var client=jayson['client'][_0xed4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b847c,_0x42ba43,_0x163f7b){return new BPromise(function(_0x821468,_0x5ef53f){return client['request'](_0x4b847c,_0x163f7b)[_0xed4f('0x9')](function(_0x3d0ac3){logger[_0xed4f('0xa')](_0xed4f('0xb'),_0x42ba43,'request\x20sent');logger[_0xed4f('0xc')](_0xed4f('0xd'),_0x42ba43,_0xed4f('0xe'),JSON[_0xed4f('0xf')](_0x3d0ac3));if(_0x3d0ac3[_0xed4f('0x10')]){if(_0x3d0ac3['error'][_0xed4f('0x11')]===0x1f4){logger['error'](_0xed4f('0xb'),_0x42ba43,_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);return _0x5ef53f(_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);}logger[_0xed4f('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x42ba43,_0x3d0ac3['error']['message']);return _0x821468(_0x3d0ac3[_0xed4f('0x10')][_0xed4f('0x12')]);}else{logger['info'](_0xed4f('0xb'),_0x42ba43,_0xed4f('0xe'));_0x821468(_0x3d0ac3[_0xed4f('0x13')][_0xed4f('0x12')]);}})[_0xed4f('0x14')](function(_0x56e18a){logger[_0xed4f('0x10')](_0xed4f('0xb'),_0x42ba43,_0x56e18a);_0x5ef53f(_0x56e18a);});});}exports['CreateFaxQueueReport']=function(_0x5067f3){var _0x5c7164=this;return new Promise(function(_0x3777ad,_0x210779){return db['FaxQueueReport'][_0xed4f('0x15')](_0x5067f3[_0xed4f('0x16')],{'raw':_0x5067f3['options']?_0x5067f3['options'][_0xed4f('0x17')]===undefined?!![]:![]:!![]})[_0xed4f('0x9')](function(_0x3677c8){logger[_0xed4f('0xa')](_0xed4f('0x18'),_0x5067f3);logger[_0xed4f('0xc')]('CreateFaxQueueReport',_0x5067f3,JSON['stringify'](_0x3677c8));_0x3777ad(_0x3677c8);})[_0xed4f('0x14')](function(_0x8a769e){logger[_0xed4f('0x10')](_0xed4f('0x18'),_0x8a769e[_0xed4f('0x12')],_0x5067f3);_0x210779(_0x5c7164['error'](0x1f4,_0x8a769e['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1eef7c){var _0x34ea94=this;return new Promise(function(_0x15e1c5,_0x37ceee){return db[_0xed4f('0x19')][_0xed4f('0x1a')](_0x1eef7c[_0xed4f('0x16')],{'raw':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')][_0xed4f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')]['where']||null:null,'attributes':_0x1eef7c['options']?_0x1eef7c[_0xed4f('0x1b')]['attributes']||null:null,'limit':_0x1eef7c[_0xed4f('0x1b')]?_0x1eef7c[_0xed4f('0x1b')][_0xed4f('0x1c')]||null:null})[_0xed4f('0x9')](function(_0x248d15){logger['info'](_0xed4f('0x1d'),_0x1eef7c);logger[_0xed4f('0xc')](_0xed4f('0x1d'),_0x1eef7c,JSON[_0xed4f('0xf')](_0x248d15));_0x15e1c5(_0x248d15);})['catch'](function(_0x209ee8){logger[_0xed4f('0x10')](_0xed4f('0x1d'),_0x209ee8[_0xed4f('0x12')],_0x1eef7c);_0x37ceee(_0x34ea94[_0xed4f('0x10')](0x1f4,_0x209ee8[_0xed4f('0x12')]));});});}; \ No newline at end of file +var _0x977b=['update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x977b,0x12f));var _0xb977=function(_0x427f57,_0x32e650){_0x427f57=_0x427f57-0x0;var _0x11cc19=_0x977b[_0x427f57];return _0x11cc19;};'use strict';var _=require(_0xb977('0x0'));var util=require(_0xb977('0x1'));var moment=require(_0xb977('0x2'));var BPromise=require(_0xb977('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb977('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb977('0x5'));var logger=require(_0xb977('0x6'))(_0xb977('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb977('0x8')][_0xb977('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56b1bb,_0x4e4b1a,_0xa09b23){return new BPromise(function(_0x37f903,_0x189167){return client[_0xb977('0xa')](_0x56b1bb,_0xa09b23)[_0xb977('0xb')](function(_0x536508){logger[_0xb977('0xc')](_0xb977('0xd'),_0x4e4b1a,_0xb977('0xe'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4e4b1a,'request\x20sent',JSON[_0xb977('0xf')](_0x536508));if(_0x536508[_0xb977('0x10')]){if(_0x536508[_0xb977('0x10')][_0xb977('0x11')]===0x1f4){logger[_0xb977('0x10')](_0xb977('0xd'),_0x4e4b1a,_0x536508[_0xb977('0x10')][_0xb977('0x12')]);return _0x189167(_0x536508['error'][_0xb977('0x12')]);}logger[_0xb977('0x10')](_0xb977('0xd'),_0x4e4b1a,_0x536508['error']['message']);return _0x37f903(_0x536508[_0xb977('0x10')][_0xb977('0x12')]);}else{logger[_0xb977('0xc')](_0xb977('0xd'),_0x4e4b1a,_0xb977('0xe'));_0x37f903(_0x536508[_0xb977('0x13')][_0xb977('0x12')]);}})[_0xb977('0x14')](function(_0x149452){logger[_0xb977('0x10')](_0xb977('0xd'),_0x4e4b1a,_0x149452);_0x189167(_0x149452);});});}exports['CreateFaxQueueReport']=function(_0x1943b2){var _0x4fb126=this;return new Promise(function(_0x3792ed,_0x58b020){return db[_0xb977('0x15')][_0xb977('0x16')](_0x1943b2['body'],{'raw':_0x1943b2['options']?_0x1943b2[_0xb977('0x17')][_0xb977('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x43e7d5){logger[_0xb977('0xc')](_0xb977('0x19'),_0x1943b2);logger['debug'](_0xb977('0x19'),_0x1943b2,JSON[_0xb977('0xf')](_0x43e7d5));_0x3792ed(_0x43e7d5);})['catch'](function(_0x558a24){logger[_0xb977('0x10')](_0xb977('0x19'),_0x558a24[_0xb977('0x12')],_0x1943b2);_0x58b020(_0x4fb126[_0xb977('0x10')](0x1f4,_0x558a24[_0xb977('0x12')]));});});};exports[_0xb977('0x1a')]=function(_0x360f90){var _0x24ab26=this;return new Promise(function(_0xe01b03,_0x4ac45a){return db[_0xb977('0x15')][_0xb977('0x1b')](_0x360f90[_0xb977('0x1c')],{'raw':_0x360f90[_0xb977('0x17')]?_0x360f90[_0xb977('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x360f90[_0xb977('0x17')]?_0x360f90[_0xb977('0x17')][_0xb977('0x1d')]||null:null,'attributes':_0x360f90[_0xb977('0x17')]?_0x360f90[_0xb977('0x17')][_0xb977('0x1e')]||null:null,'limit':_0x360f90[_0xb977('0x17')]?_0x360f90[_0xb977('0x17')][_0xb977('0x1f')]||null:null})['then'](function(_0x355b48){logger[_0xb977('0xc')](_0xb977('0x1a'),_0x360f90);logger[_0xb977('0x20')](_0xb977('0x1a'),_0x360f90,JSON[_0xb977('0xf')](_0x355b48));_0xe01b03(_0x355b48);})[_0xb977('0x14')](function(_0x2ba1fd){logger[_0xb977('0x10')](_0xb977('0x1a'),_0x2ba1fd[_0xb977('0x12')],_0x360f90);_0x4ac45a(_0x24ab26[_0xb977('0x10')](0x1f4,_0x2ba1fd[_0xb977('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 6c051f6..894629f 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 _0x9278=['path','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','util'];(function(_0x479650,_0x2bee99){var _0x26b288=function(_0x1ba49f){while(--_0x1ba49f){_0x479650['push'](_0x479650['shift']());}};_0x26b288(++_0x2bee99);}(_0x9278,0xa8));var _0x8927=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9278[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x8927('0x0'));var util=require(_0x8927('0x1'));var path=require(_0x8927('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8927('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8927('0x4'));var config=require(_0x8927('0x5'));var controller=require(_0x8927('0x6'));router[_0x8927('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8927('0x8'),auth[_0x8927('0x9')](),controller[_0x8927('0xa')]);router[_0x8927('0x7')](_0x8927('0xb'),auth['isAuthenticated'](),controller[_0x8927('0xc')]);router[_0x8927('0xd')]('/',auth[_0x8927('0x9')](),controller['create']);router[_0x8927('0xe')](_0x8927('0xb'),auth[_0x8927('0x9')](),controller[_0x8927('0xf')]);router[_0x8927('0x10')]('/:id',auth[_0x8927('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2497=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x2497,0x1d2));var _0x7249=function(_0x326a76,_0x1be9cd){_0x326a76=_0x326a76-0x0;var _0x3692a7=_0x2497[_0x326a76];return _0x3692a7;};'use strict';var multer=require(_0x7249('0x0'));var util=require(_0x7249('0x1'));var path=require(_0x7249('0x2'));var timeout=require(_0x7249('0x3'));var express=require(_0x7249('0x4'));var router=express[_0x7249('0x5')]();var fs_extra=require(_0x7249('0x6'));var auth=require(_0x7249('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7249('0x8'));var controller=require(_0x7249('0x9'));router[_0x7249('0xa')]('/',auth[_0x7249('0xb')](),controller[_0x7249('0xc')]);router[_0x7249('0xa')](_0x7249('0xd'),auth[_0x7249('0xb')](),controller[_0x7249('0xe')]);router[_0x7249('0xa')](_0x7249('0xf'),auth['isAuthenticated'](),controller[_0x7249('0x10')]);router[_0x7249('0x11')]('/',auth[_0x7249('0xb')](),controller[_0x7249('0x12')]);router[_0x7249('0x13')]('/:id',auth[_0x7249('0xb')](),controller[_0x7249('0x14')]);router[_0x7249('0x15')](_0x7249('0xf'),auth[_0x7249('0xb')](),controller[_0x7249('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index ef2d993..2133cb5 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1f93e8,_0x3866e1){var _0x151973=function(_0x3b86ff){while(--_0x3b86ff){_0x1f93e8['push'](_0x1f93e8['shift']());}};_0x151973(++_0x3866e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0xcb91[_0x54d49e];return _0x4af0f1;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x54ef,0x112));var _0xf54e=function(_0x2d82c9,_0x1935c5){_0x2d82c9=_0x2d82c9-0x0;var _0xf2985a=_0x54ef[_0x2d82c9];return _0xf2985a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 5e48ca4..4cd2834 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 _0x68be=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','FaxTransferReport','fieldName'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x68be,0x13f));var _0xe68b=function(_0x5aee17,_0x7859ca){_0x5aee17=_0x5aee17-0x0;var _0x1c4ba=_0x68be[_0x5aee17];return _0x1c4ba;};'use strict';var emlformat=require(_0xe68b('0x0'));var rimraf=require(_0xe68b('0x1'));var zipdir=require(_0xe68b('0x2'));var jsonpatch=require(_0xe68b('0x3'));var rp=require(_0xe68b('0x4'));var moment=require(_0xe68b('0x5'));var BPromise=require(_0xe68b('0x6'));var Mustache=require(_0xe68b('0x7'));var util=require(_0xe68b('0x8'));var path=require(_0xe68b('0x9'));var sox=require(_0xe68b('0xa'));var csv=require(_0xe68b('0xb'));var ejs=require(_0xe68b('0xc'));var fs=require('fs');var fs_extra=require(_0xe68b('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe68b('0xe'));var Redis=require(_0xe68b('0xf'));var authService=require(_0xe68b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe68b('0x11'));var logger=require('../../config/logger')(_0xe68b('0x12'));var utils=require(_0xe68b('0x13'));var config=require(_0xe68b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe68b('0x15'))['db'];function respondWithStatusCode(_0x151911,_0x24e0ce){_0x24e0ce=_0x24e0ce||0xcc;return function(_0x27e448){if(_0x27e448){return _0x151911[_0xe68b('0x16')](_0x24e0ce);}return _0x151911[_0xe68b('0x17')](_0x24e0ce)[_0xe68b('0x18')]();};}function respondWithResult(_0x276b4e,_0x1b8e44){_0x1b8e44=_0x1b8e44||0xc8;return function(_0x1d5f24){if(_0x1d5f24){return _0x276b4e['status'](_0x1b8e44)['json'](_0x1d5f24);}};}function respondWithFilteredResult(_0x2a659e,_0x1441ac){return function(_0x3c5456){if(_0x3c5456){var _0xb282fb=typeof _0x1441ac[_0xe68b('0x19')]===_0xe68b('0x1a')&&typeof _0x1441ac[_0xe68b('0x1b')]===_0xe68b('0x1a');var _0x53550e=_0x3c5456[_0xe68b('0x1c')];var _0x410771=_0xb282fb?0x0:_0x1441ac[_0xe68b('0x19')];var _0x12802d=_0xb282fb?_0x3c5456[_0xe68b('0x1c')]:_0x1441ac[_0xe68b('0x19')]+_0x1441ac[_0xe68b('0x1b')];var _0x373c41;if(_0x12802d>=_0x53550e){_0x12802d=_0x53550e;_0x373c41=0xc8;}else{_0x373c41=0xce;}_0x2a659e['status'](_0x373c41);return _0x2a659e[_0xe68b('0x1d')](_0xe68b('0x1e'),_0x410771+'-'+_0x12802d+'/'+_0x53550e)['json'](_0x3c5456);}return null;};}function patchUpdates(_0x33b84a){return function(_0x4b98e3){try{jsonpatch['apply'](_0x4b98e3,_0x33b84a,!![]);}catch(_0x35735b){return BPromise[_0xe68b('0x1f')](_0x35735b);}return _0x4b98e3[_0xe68b('0x20')]();};}function saveUpdates(_0x1c4cd9,_0x75960){return function(_0x377d90){if(_0x377d90){return _0x377d90['update'](_0x1c4cd9)[_0xe68b('0x21')](function(_0x4de201){return _0x4de201;});}return null;};}function removeEntity(_0x134e46,_0x25d6b1){return function(_0x45b1bc){if(_0x45b1bc){return _0x45b1bc[_0xe68b('0x22')]()[_0xe68b('0x21')](function(){_0x134e46[_0xe68b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6c8ae,_0x2e564d){return function(_0x192dd6){if(!_0x192dd6){_0xf6c8ae[_0xe68b('0x16')](0x194);}return _0x192dd6;};}function handleError(_0x21d4ce,_0x4fda6a){_0x4fda6a=_0x4fda6a||0x1f4;return function(_0x2090a2){logger['error'](_0x2090a2[_0xe68b('0x23')]);if(_0x2090a2[_0xe68b('0x24')]){delete _0x2090a2[_0xe68b('0x24')];}_0x21d4ce['status'](_0x4fda6a)[_0xe68b('0x25')](_0x2090a2);};}exports[_0xe68b('0x26')]=function(_0x15f9d0,_0x1cbd22){var _0x255ca2={},_0x54f41b={},_0x12a6dd={'count':0x0,'rows':[]};var _0x4d0be5=_['map'](db[_0xe68b('0x27')]['rawAttributes'],function(_0x3e0951){return{'name':_0x3e0951[_0xe68b('0x28')],'type':_0x3e0951[_0xe68b('0x29')][_0xe68b('0x2a')]};});_0x54f41b[_0xe68b('0x2b')]=_[_0xe68b('0x2c')](_0x4d0be5,_0xe68b('0x24'));_0x54f41b[_0xe68b('0x2d')]=_[_0xe68b('0x2e')](_0x15f9d0[_0xe68b('0x2d')]);_0x54f41b[_0xe68b('0x2f')]=_[_0xe68b('0x30')](_0x54f41b[_0xe68b('0x2b')],_0x54f41b['query']);_0x255ca2[_0xe68b('0x31')]=_[_0xe68b('0x30')](_0x54f41b['model'],qs[_0xe68b('0x32')](_0x15f9d0[_0xe68b('0x2d')]['fields']));_0x255ca2[_0xe68b('0x31')]=_0x255ca2[_0xe68b('0x31')][_0xe68b('0x33')]?_0x255ca2[_0xe68b('0x31')]:_0x54f41b[_0xe68b('0x2b')];if(!_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x34')](_0xe68b('0x35'))){_0x255ca2[_0xe68b('0x1b')]=qs[_0xe68b('0x1b')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x1b')]);_0x255ca2[_0xe68b('0x19')]=qs[_0xe68b('0x19')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x19')]);}_0x255ca2['order']=qs[_0xe68b('0x36')](_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x36')]);_0x255ca2[_0xe68b('0x37')]=qs[_0xe68b('0x2f')](_['pick'](_0x15f9d0[_0xe68b('0x2d')],_0x54f41b['filters']),_0x4d0be5);if(_0x15f9d0['query'][_0xe68b('0x38')]){_0x255ca2[_0xe68b('0x37')]=_[_0xe68b('0x39')](_0x255ca2[_0xe68b('0x37')],{'$or':_[_0xe68b('0x2c')](_0x4d0be5,function(_0x38d8aa){if(_0x38d8aa[_0xe68b('0x29')]!==_0xe68b('0x3a')){var _0x150203={};_0x150203[_0x38d8aa[_0xe68b('0x24')]]={'$like':'%'+_0x15f9d0[_0xe68b('0x2d')][_0xe68b('0x38')]+'%'};return _0x150203;}})});}_0x255ca2=_['merge']({},_0x255ca2,_0x15f9d0[_0xe68b('0x3b')]);var _0x125d2b={'where':_0x255ca2[_0xe68b('0x37')]};return db[_0xe68b('0x27')][_0xe68b('0x1c')](_0x125d2b)[_0xe68b('0x21')](function(_0x354ff8){_0x12a6dd['count']=_0x354ff8;if(_0x15f9d0['query']['includeAll']){_0x255ca2[_0xe68b('0x3c')]=[{'all':!![]}];}return db[_0xe68b('0x27')][_0xe68b('0x3d')](_0x255ca2);})[_0xe68b('0x21')](function(_0x3fd3ea){_0x12a6dd['rows']=_0x3fd3ea;return _0x12a6dd;})[_0xe68b('0x21')](respondWithFilteredResult(_0x1cbd22,_0x255ca2))[_0xe68b('0x3e')](handleError(_0x1cbd22,null));};exports[_0xe68b('0x3f')]=function(_0x4d1ef4,_0x19d419){var _0x2dc734={'raw':!![],'where':{'id':_0x4d1ef4[_0xe68b('0x40')]['id']}},_0x40287a={};_0x40287a[_0xe68b('0x2b')]=_['keys'](db[_0xe68b('0x27')][_0xe68b('0x41')]);_0x40287a[_0xe68b('0x2d')]=_['keys'](_0x4d1ef4[_0xe68b('0x2d')]);_0x40287a[_0xe68b('0x2f')]=_[_0xe68b('0x30')](_0x40287a[_0xe68b('0x2b')],_0x40287a[_0xe68b('0x2d')]);_0x2dc734[_0xe68b('0x31')]=_[_0xe68b('0x30')](_0x40287a['model'],qs[_0xe68b('0x32')](_0x4d1ef4[_0xe68b('0x2d')]['fields']));_0x2dc734[_0xe68b('0x31')]=_0x2dc734[_0xe68b('0x31')][_0xe68b('0x33')]?_0x2dc734[_0xe68b('0x31')]:_0x40287a[_0xe68b('0x2b')];if(_0x4d1ef4['query'][_0xe68b('0x42')]){_0x2dc734['include']=[{'all':!![]}];}_0x2dc734=_[_0xe68b('0x39')]({},_0x2dc734,_0x4d1ef4[_0xe68b('0x3b')]);return db[_0xe68b('0x27')]['find'](_0x2dc734)[_0xe68b('0x21')](handleEntityNotFound(_0x19d419,null))['then'](respondWithResult(_0x19d419,null))[_0xe68b('0x3e')](handleError(_0x19d419,null));};exports[_0xe68b('0x43')]=function(_0xf486b9,_0x35a804){return db['FaxTransferReport']['create'](_0xf486b9[_0xe68b('0x44')],{})[_0xe68b('0x21')](respondWithResult(_0x35a804,0xc9))['catch'](handleError(_0x35a804,null));};exports[_0xe68b('0x45')]=function(_0x9dde9e,_0x1706e8){if(_0x9dde9e[_0xe68b('0x44')]['id']){delete _0x9dde9e[_0xe68b('0x44')]['id'];}return db[_0xe68b('0x27')][_0xe68b('0x46')]({'where':{'id':_0x9dde9e[_0xe68b('0x40')]['id']}})[_0xe68b('0x21')](handleEntityNotFound(_0x1706e8,null))[_0xe68b('0x21')](saveUpdates(_0x9dde9e['body'],null))[_0xe68b('0x21')](respondWithResult(_0x1706e8,null))['catch'](handleError(_0x1706e8,null));};exports['destroy']=function(_0x29a193,_0x31a458){return db[_0xe68b('0x27')][_0xe68b('0x46')]({'where':{'id':_0x29a193[_0xe68b('0x40')]['id']}})[_0xe68b('0x21')](handleEntityNotFound(_0x31a458,null))[_0xe68b('0x21')](removeEntity(_0x31a458,null))[_0xe68b('0x3e')](handleError(_0x31a458,null));};exports[_0xe68b('0x47')]=function(_0x4dc22a,_0x1e9fa1){return db[_0xe68b('0x27')][_0xe68b('0x47')]()[_0xe68b('0x21')](respondWithResult(_0x1e9fa1,null))[_0xe68b('0x3e')](handleError(_0x1e9fa1,null));}; \ No newline at end of file +var _0xb2d0=['keys','query','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','create','body','catch','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','stack','name','send','map','FaxTransferReport','fieldName','key','model'];(function(_0x1891c8,_0x52ffd0){var _0x3d3dca=function(_0x4230d0){while(--_0x4230d0){_0x1891c8['push'](_0x1891c8['shift']());}};_0x3d3dca(++_0x52ffd0);}(_0xb2d0,0x1a4));var _0x0b2d=function(_0x362e00,_0x4b0e26){_0x362e00=_0x362e00-0x0;var _0x3bdd32=_0xb2d0[_0x362e00];return _0x3bdd32;};'use strict';var emlformat=require(_0x0b2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b2d('0x1'));var jsonpatch=require(_0x0b2d('0x2'));var rp=require(_0x0b2d('0x3'));var moment=require(_0x0b2d('0x4'));var BPromise=require(_0x0b2d('0x5'));var Mustache=require(_0x0b2d('0x6'));var util=require(_0x0b2d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0b2d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b2d('0x9'));var _=require(_0x0b2d('0xa'));var squel=require(_0x0b2d('0xb'));var crypto=require(_0x0b2d('0xc'));var jsforce=require(_0x0b2d('0xd'));var deskjs=require(_0x0b2d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b2d('0xf'));var Redis=require(_0x0b2d('0x10'));var authService=require(_0x0b2d('0x11'));var qs=require(_0x0b2d('0x12'));var as=require(_0x0b2d('0x13'));var hardwareService=require(_0x0b2d('0x14'));var logger=require(_0x0b2d('0x15'))(_0x0b2d('0x16'));var utils=require(_0x0b2d('0x17'));var config=require(_0x0b2d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b2d('0x19'))['db'];function respondWithStatusCode(_0x2d41a0,_0xed9b64){_0xed9b64=_0xed9b64||0xcc;return function(_0x507969){if(_0x507969){return _0x2d41a0[_0x0b2d('0x1a')](_0xed9b64);}return _0x2d41a0[_0x0b2d('0x1b')](_0xed9b64)[_0x0b2d('0x1c')]();};}function respondWithResult(_0x1c963d,_0x59119f){_0x59119f=_0x59119f||0xc8;return function(_0x2d369c){if(_0x2d369c){return _0x1c963d['status'](_0x59119f)[_0x0b2d('0x1d')](_0x2d369c);}};}function respondWithFilteredResult(_0x281822,_0x8f27fc){return function(_0x33ec8b){if(_0x33ec8b){var _0x447a1=typeof _0x8f27fc[_0x0b2d('0x1e')]===_0x0b2d('0x1f')&&typeof _0x8f27fc['limit']==='undefined';var _0x5adbdd=_0x33ec8b[_0x0b2d('0x20')];var _0x387978=_0x447a1?0x0:_0x8f27fc[_0x0b2d('0x1e')];var _0x878eab=_0x447a1?_0x33ec8b[_0x0b2d('0x20')]:_0x8f27fc[_0x0b2d('0x1e')]+_0x8f27fc[_0x0b2d('0x21')];var _0x434e2f;if(_0x878eab>=_0x5adbdd){_0x878eab=_0x5adbdd;_0x434e2f=0xc8;}else{_0x434e2f=0xce;}_0x281822[_0x0b2d('0x1b')](_0x434e2f);return _0x281822['set'](_0x0b2d('0x22'),_0x387978+'-'+_0x878eab+'/'+_0x5adbdd)[_0x0b2d('0x1d')](_0x33ec8b);}return null;};}function patchUpdates(_0x3ba376){return function(_0x49ac12){try{jsonpatch[_0x0b2d('0x23')](_0x49ac12,_0x3ba376,!![]);}catch(_0x1c53ef){return BPromise[_0x0b2d('0x24')](_0x1c53ef);}return _0x49ac12[_0x0b2d('0x25')]();};}function saveUpdates(_0xeb749c,_0x943b9f){return function(_0x5432c3){if(_0x5432c3){return _0x5432c3[_0x0b2d('0x26')](_0xeb749c)[_0x0b2d('0x27')](function(_0x27f997){return _0x27f997;});}return null;};}function removeEntity(_0x1400fa,_0x2f0d98){return function(_0x15f3ac){if(_0x15f3ac){return _0x15f3ac['destroy']()[_0x0b2d('0x27')](function(){_0x1400fa[_0x0b2d('0x1b')](0xcc)[_0x0b2d('0x1c')]();});}};}function handleEntityNotFound(_0x3ecf14,_0x48d6a0){return function(_0x489723){if(!_0x489723){_0x3ecf14[_0x0b2d('0x1a')](0x194);}return _0x489723;};}function handleError(_0x216f7e,_0x1bfcf4){_0x1bfcf4=_0x1bfcf4||0x1f4;return function(_0x3badeb){logger['error'](_0x3badeb[_0x0b2d('0x28')]);if(_0x3badeb[_0x0b2d('0x29')]){delete _0x3badeb[_0x0b2d('0x29')];}_0x216f7e[_0x0b2d('0x1b')](_0x1bfcf4)[_0x0b2d('0x2a')](_0x3badeb);};}exports['index']=function(_0x2fac8d,_0x5b1906){var _0x271c46={},_0x355587={},_0x5ebca6={'count':0x0,'rows':[]};var _0x1a693b=_[_0x0b2d('0x2b')](db[_0x0b2d('0x2c')]['rawAttributes'],function(_0x1cdd78){return{'name':_0x1cdd78[_0x0b2d('0x2d')],'type':_0x1cdd78['type'][_0x0b2d('0x2e')]};});_0x355587[_0x0b2d('0x2f')]=_[_0x0b2d('0x2b')](_0x1a693b,_0x0b2d('0x29'));_0x355587['query']=_[_0x0b2d('0x30')](_0x2fac8d[_0x0b2d('0x31')]);_0x355587['filters']=_[_0x0b2d('0x32')](_0x355587[_0x0b2d('0x2f')],_0x355587[_0x0b2d('0x31')]);_0x271c46[_0x0b2d('0x33')]=_[_0x0b2d('0x32')](_0x355587[_0x0b2d('0x2f')],qs['fields'](_0x2fac8d['query']['fields']));_0x271c46[_0x0b2d('0x33')]=_0x271c46[_0x0b2d('0x33')][_0x0b2d('0x34')]?_0x271c46['attributes']:_0x355587['model'];if(!_0x2fac8d[_0x0b2d('0x31')]['hasOwnProperty'](_0x0b2d('0x35'))){_0x271c46['limit']=qs['limit'](_0x2fac8d[_0x0b2d('0x31')][_0x0b2d('0x21')]);_0x271c46['offset']=qs[_0x0b2d('0x1e')](_0x2fac8d['query'][_0x0b2d('0x1e')]);}_0x271c46[_0x0b2d('0x36')]=qs[_0x0b2d('0x37')](_0x2fac8d['query'][_0x0b2d('0x37')]);_0x271c46[_0x0b2d('0x38')]=qs[_0x0b2d('0x39')](_[_0x0b2d('0x3a')](_0x2fac8d[_0x0b2d('0x31')],_0x355587[_0x0b2d('0x39')]),_0x1a693b);if(_0x2fac8d['query'][_0x0b2d('0x3b')]){_0x271c46[_0x0b2d('0x38')]=_[_0x0b2d('0x3c')](_0x271c46['where'],{'$or':_[_0x0b2d('0x2b')](_0x1a693b,function(_0x2fa4b1){if(_0x2fa4b1[_0x0b2d('0x3d')]!==_0x0b2d('0x3e')){var _0x3d87cc={};_0x3d87cc[_0x2fa4b1['name']]={'$like':'%'+_0x2fac8d[_0x0b2d('0x31')][_0x0b2d('0x3b')]+'%'};return _0x3d87cc;}})});}_0x271c46=_[_0x0b2d('0x3c')]({},_0x271c46,_0x2fac8d[_0x0b2d('0x3f')]);var _0x18dff6={'where':_0x271c46[_0x0b2d('0x38')]};return db[_0x0b2d('0x2c')][_0x0b2d('0x20')](_0x18dff6)['then'](function(_0x34aa3){_0x5ebca6[_0x0b2d('0x20')]=_0x34aa3;if(_0x2fac8d[_0x0b2d('0x31')][_0x0b2d('0x40')]){_0x271c46[_0x0b2d('0x41')]=[{'all':!![]}];}return db[_0x0b2d('0x2c')][_0x0b2d('0x42')](_0x271c46);})['then'](function(_0x466f4f){_0x5ebca6[_0x0b2d('0x43')]=_0x466f4f;return _0x5ebca6;})[_0x0b2d('0x27')](respondWithFilteredResult(_0x5b1906,_0x271c46))['catch'](handleError(_0x5b1906,null));};exports[_0x0b2d('0x44')]=function(_0x57b746,_0x301dd3){var _0x86a688={'raw':!![],'where':{'id':_0x57b746[_0x0b2d('0x45')]['id']}},_0x84af0a={};_0x84af0a[_0x0b2d('0x2f')]=_[_0x0b2d('0x30')](db['FaxTransferReport'][_0x0b2d('0x46')]);_0x84af0a[_0x0b2d('0x31')]=_[_0x0b2d('0x30')](_0x57b746['query']);_0x84af0a['filters']=_[_0x0b2d('0x32')](_0x84af0a[_0x0b2d('0x2f')],_0x84af0a[_0x0b2d('0x31')]);_0x86a688['attributes']=_[_0x0b2d('0x32')](_0x84af0a['model'],qs[_0x0b2d('0x47')](_0x57b746[_0x0b2d('0x31')]['fields']));_0x86a688['attributes']=_0x86a688['attributes'][_0x0b2d('0x34')]?_0x86a688[_0x0b2d('0x33')]:_0x84af0a[_0x0b2d('0x2f')];if(_0x57b746['query'][_0x0b2d('0x40')]){_0x86a688[_0x0b2d('0x41')]=[{'all':!![]}];}_0x86a688=_[_0x0b2d('0x3c')]({},_0x86a688,_0x57b746[_0x0b2d('0x3f')]);return db['FaxTransferReport'][_0x0b2d('0x48')](_0x86a688)['then'](handleEntityNotFound(_0x301dd3,null))[_0x0b2d('0x27')](respondWithResult(_0x301dd3,null))['catch'](handleError(_0x301dd3,null));};exports[_0x0b2d('0x49')]=function(_0x5518f0,_0x3b1d29){return db[_0x0b2d('0x2c')][_0x0b2d('0x49')](_0x5518f0[_0x0b2d('0x4a')],{})[_0x0b2d('0x27')](respondWithResult(_0x3b1d29,0xc9))['catch'](handleError(_0x3b1d29,null));};exports[_0x0b2d('0x26')]=function(_0x3120f6,_0x54c0e3){if(_0x3120f6['body']['id']){delete _0x3120f6['body']['id'];}return db[_0x0b2d('0x2c')][_0x0b2d('0x48')]({'where':{'id':_0x3120f6[_0x0b2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x54c0e3,null))[_0x0b2d('0x27')](saveUpdates(_0x3120f6[_0x0b2d('0x4a')],null))[_0x0b2d('0x27')](respondWithResult(_0x54c0e3,null))[_0x0b2d('0x4b')](handleError(_0x54c0e3,null));};exports[_0x0b2d('0x4c')]=function(_0x581131,_0x2c1eae){return db[_0x0b2d('0x2c')][_0x0b2d('0x48')]({'where':{'id':_0x581131[_0x0b2d('0x45')]['id']}})[_0x0b2d('0x27')](handleEntityNotFound(_0x2c1eae,null))['then'](removeEntity(_0x2c1eae,null))[_0x0b2d('0x4b')](handleError(_0x2c1eae,null));};exports[_0x0b2d('0x4d')]=function(_0x166dc0,_0x3210a3){return db[_0x0b2d('0x2c')][_0x0b2d('0x4d')]()['then'](respondWithResult(_0x3210a3,null))[_0x0b2d('0x4b')](handleError(_0x3210a3,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 8053007..0d27544 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 _0x40cb=['api','moment','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x10a984,_0x396e32){var _0x30ffcb=function(_0x4dceec){while(--_0x4dceec){_0x10a984['push'](_0x10a984['shift']());}};_0x30ffcb(++_0x396e32);}(_0x40cb,0x105));var _0xb40c=function(_0x413b19,_0x299538){_0x413b19=_0x413b19-0x0;var _0xb73bb6=_0x40cb[_0x413b19];return _0xb73bb6;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var logger=require(_0xb40c('0x2'))(_0xb40c('0x3'));var moment=require(_0xb40c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb40c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb40c('0x6'));module[_0xb40c('0x7')]=function(_0xf28b4f,_0xfe8ac0){return _0xf28b4f[_0xb40c('0x8')](_0xb40c('0x9'),attributes,{'tableName':_0xb40c('0xa'),'paranoid':![],'indexes':[{'name':_0xb40c('0xb'),'fields':[_0xb40c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fbb=['bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','moment'];(function(_0xa261a6,_0x35e115){var _0x3e2e60=function(_0x38fc3a){while(--_0x38fc3a){_0xa261a6['push'](_0xa261a6['shift']());}};_0x3e2e60(++_0x35e115);}(_0x5fbb,0x1ba));var _0xb5fb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5fbb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb5fb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb5fb('0x1'));var BPromise=require(_0xb5fb('0x2'));var rp=require(_0xb5fb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5fb('0x4'));var config=require(_0xb5fb('0x5'));var attributes=require(_0xb5fb('0x6'));module[_0xb5fb('0x7')]=function(_0x453a98,_0x828d58){return _0x453a98[_0xb5fb('0x8')](_0xb5fb('0x9'),attributes,{'tableName':_0xb5fb('0xa'),'paranoid':![],'indexes':[{'name':_0xb5fb('0xb'),'fields':[_0xb5fb('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 68bc981..ea9ce3e 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 _0xb3d0=['rpc','../../config/environment','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3d0,0x1af));var _0x0b3d=function(_0x4dd823,_0x336a6c){_0x4dd823=_0x4dd823-0x0;var _0x4412db=_0xb3d0[_0x4dd823];return _0x4412db;};'use strict';var _=require(_0x0b3d('0x0'));var util=require(_0x0b3d('0x1'));var moment=require('moment');var BPromise=require(_0x0b3d('0x2'));var rs=require(_0x0b3d('0x3'));var fs=require('fs');var Redis=require(_0x0b3d('0x4'));var db=require(_0x0b3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b3d('0x6'));var config=require(_0x0b3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b3d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1307,_0x2dc456,_0x15b374){return new BPromise(function(_0x19fafa,_0x299428){return client[_0x0b3d('0x9')](_0x4c1307,_0x15b374)['then'](function(_0x51060a){logger['info'](_0x0b3d('0xa'),_0x2dc456,_0x0b3d('0xb'));logger[_0x0b3d('0xc')](_0x0b3d('0xd'),_0x2dc456,'request\x20sent',JSON[_0x0b3d('0xe')](_0x51060a));if(_0x51060a['error']){if(_0x51060a[_0x0b3d('0xf')]['code']===0x1f4){logger['error'](_0x0b3d('0xa'),_0x2dc456,_0x51060a[_0x0b3d('0xf')]['message']);return _0x299428(_0x51060a[_0x0b3d('0xf')][_0x0b3d('0x10')]);}logger[_0x0b3d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2dc456,_0x51060a['error']['message']);return _0x19fafa(_0x51060a[_0x0b3d('0xf')][_0x0b3d('0x10')]);}else{logger[_0x0b3d('0x11')](_0x0b3d('0xa'),_0x2dc456,_0x0b3d('0xb'));_0x19fafa(_0x51060a[_0x0b3d('0x12')][_0x0b3d('0x10')]);}})['catch'](function(_0x173f1e){logger['error'](_0x0b3d('0xa'),_0x2dc456,_0x173f1e);_0x299428(_0x173f1e);});});} \ No newline at end of file +var _0x5c6c=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xed9c99,_0x2217b1){var _0x5443a1=function(_0xb7c751){while(--_0xb7c751){_0xed9c99['push'](_0xed9c99['shift']());}};_0x5443a1(++_0x2217b1);}(_0x5c6c,0x1bb));var _0xc5c6=function(_0x3a0ced,_0x4c67e9){_0x3a0ced=_0x3a0ced-0x0;var _0x18049a=_0x5c6c[_0x3a0ced];return _0x18049a;};'use strict';var _=require(_0xc5c6('0x0'));var util=require(_0xc5c6('0x1'));var moment=require('moment');var BPromise=require(_0xc5c6('0x2'));var rs=require(_0xc5c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5c6('0x5'))(_0xc5c6('0x6'));var config=require(_0xc5c6('0x7'));var jayson=require(_0xc5c6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1694e5,_0x474479,_0xc596f9){return new BPromise(function(_0x44bf7d,_0x12c8b2){return client[_0xc5c6('0x9')](_0x1694e5,_0xc596f9)['then'](function(_0x5b7b66){logger[_0xc5c6('0xa')](_0xc5c6('0xb'),_0x474479,_0xc5c6('0xc'));logger[_0xc5c6('0xd')](_0xc5c6('0xe'),_0x474479,'request\x20sent',JSON['stringify'](_0x5b7b66));if(_0x5b7b66['error']){if(_0x5b7b66[_0xc5c6('0xf')][_0xc5c6('0x10')]===0x1f4){logger[_0xc5c6('0xf')](_0xc5c6('0xb'),_0x474479,_0x5b7b66[_0xc5c6('0xf')]['message']);return _0x12c8b2(_0x5b7b66['error'][_0xc5c6('0x11')]);}logger['error'](_0xc5c6('0xb'),_0x474479,_0x5b7b66[_0xc5c6('0xf')][_0xc5c6('0x11')]);return _0x44bf7d(_0x5b7b66[_0xc5c6('0xf')]['message']);}else{logger[_0xc5c6('0xa')](_0xc5c6('0xb'),_0x474479,'request\x20sent');_0x44bf7d(_0x5b7b66[_0xc5c6('0x12')]['message']);}})[_0xc5c6('0x13')](function(_0x12c971){logger[_0xc5c6('0xf')](_0xc5c6('0xb'),_0x474479,_0x12c971);_0x12c8b2(_0x12c971);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8e9ca3e..ab068d0 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 _0xff26=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff26,0x19d));var _0x6ff2=function(_0x3322a0,_0xc75fc7){_0x3322a0=_0x3322a0-0x0;var _0x15be8e=_0xff26[_0x3322a0];return _0x15be8e;};'use strict';var multer=require(_0x6ff2('0x0'));var util=require(_0x6ff2('0x1'));var path=require(_0x6ff2('0x2'));var timeout=require(_0x6ff2('0x3'));var express=require(_0x6ff2('0x4'));var router=express[_0x6ff2('0x5')]();var fs_extra=require(_0x6ff2('0x6'));var auth=require(_0x6ff2('0x7'));var interaction=require(_0x6ff2('0x8'));var config=require(_0x6ff2('0x9'));var controller=require(_0x6ff2('0xa'));router[_0x6ff2('0xb')]('/',auth[_0x6ff2('0xc')](),controller[_0x6ff2('0xd')]);router[_0x6ff2('0xb')](_0x6ff2('0xe'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0xf')]);router[_0x6ff2('0xb')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0x11')]);router[_0x6ff2('0x12')]('/',auth['isAuthenticated'](),controller[_0x6ff2('0x13')]);router[_0x6ff2('0x14')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller[_0x6ff2('0x15')]);router[_0x6ff2('0x16')](_0x6ff2('0x10'),auth[_0x6ff2('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4759=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x3e2965,_0x4bcd74){var _0x378ad4=function(_0x189602){while(--_0x189602){_0x3e2965['push'](_0x3e2965['shift']());}};_0x378ad4(++_0x4bcd74);}(_0x4759,0x133));var _0x9475=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x4759[_0x33a694];return _0x41ff01;};'use strict';var multer=require(_0x9475('0x0'));var util=require('util');var path=require(_0x9475('0x1'));var timeout=require(_0x9475('0x2'));var express=require(_0x9475('0x3'));var router=express[_0x9475('0x4')]();var fs_extra=require(_0x9475('0x5'));var auth=require(_0x9475('0x6'));var interaction=require(_0x9475('0x7'));var config=require(_0x9475('0x8'));var controller=require(_0x9475('0x9'));router['get']('/',auth[_0x9475('0xa')](),controller[_0x9475('0xb')]);router[_0x9475('0xc')](_0x9475('0xd'),auth[_0x9475('0xa')](),controller[_0x9475('0xe')]);router['get'](_0x9475('0xf'),auth[_0x9475('0xa')](),controller[_0x9475('0x10')]);router[_0x9475('0x11')]('/',auth[_0x9475('0xa')](),controller[_0x9475('0x12')]);router[_0x9475('0x13')](_0x9475('0xf'),auth[_0x9475('0xa')](),controller[_0x9475('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9475('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 42e7c28..6a2d184 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 _0x2a2a=['get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index'];(function(_0x5271e8,_0x391087){var _0x328211=function(_0x69acdb){while(--_0x69acdb){_0x5271e8['push'](_0x5271e8['shift']());}};_0x328211(++_0x391087);}(_0x2a2a,0xa3));var _0xa2a2=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x2a2a[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0xa2a2('0x0'));var util=require(_0xa2a2('0x1'));var path=require(_0xa2a2('0x2'));var timeout=require(_0xa2a2('0x3'));var express=require(_0xa2a2('0x4'));var router=express[_0xa2a2('0x5')]();var fs_extra=require(_0xa2a2('0x6'));var auth=require(_0xa2a2('0x7'));var interaction=require(_0xa2a2('0x8'));var config=require('../../config/environment');var controller=require(_0xa2a2('0x9'));router['get']('/',auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xb')]);router[_0xa2a2('0xc')]('/:id',auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xd')]);router['get'](_0xa2a2('0xe'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0xf')]);router[_0xa2a2('0xc')](_0xa2a2('0x10'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0x11')]);router[_0xa2a2('0x12')]('/',auth['isAuthenticated'](),controller[_0xa2a2('0x13')]);router[_0xa2a2('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa2a2('0x14')]);router['put'](_0xa2a2('0x15'),auth[_0xa2a2('0xa')](),controller['update']);router[_0xa2a2('0x16')](_0xa2a2('0x15'),auth[_0xa2a2('0xa')](),controller[_0xa2a2('0x17')]);module[_0xa2a2('0x18')]=router; \ No newline at end of file +var _0x11bb=['fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','delete','exports','util','connect-timeout','express','Router'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x11bb,0x6e));var _0xb11b=function(_0x2d5430,_0x50ce4){_0x2d5430=_0x2d5430-0x0;var _0x2f3be7=_0x11bb[_0x2d5430];return _0x2f3be7;};'use strict';var multer=require('multer');var util=require(_0xb11b('0x0'));var path=require('path');var timeout=require(_0xb11b('0x1'));var express=require(_0xb11b('0x2'));var router=express[_0xb11b('0x3')]();var fs_extra=require(_0xb11b('0x4'));var auth=require(_0xb11b('0x5'));var interaction=require(_0xb11b('0x6'));var config=require('../../config/environment');var controller=require(_0xb11b('0x7'));router['get']('/',auth[_0xb11b('0x8')](),controller[_0xb11b('0x9')]);router[_0xb11b('0xa')](_0xb11b('0xb'),auth[_0xb11b('0x8')](),controller[_0xb11b('0xc')]);router[_0xb11b('0xa')](_0xb11b('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb11b('0xa')](_0xb11b('0xe'),auth['isAuthenticated'](),controller[_0xb11b('0xf')]);router['post']('/',auth[_0xb11b('0x8')](),controller[_0xb11b('0x10')]);router['post'](_0xb11b('0xd'),auth[_0xb11b('0x8')](),controller['addConfiguration']);router['put'](_0xb11b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb11b('0x11')](_0xb11b('0xb'),auth[_0xb11b('0x8')](),controller['destroy']);module[_0xb11b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 20f3362..b9b700f 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 _0x61ad=['STRING','basic','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x455ed5,_0xab57cc){var _0x481ac4=function(_0x4e2e61){while(--_0x4e2e61){_0x455ed5['push'](_0x455ed5['shift']());}};_0x481ac4(++_0xab57cc);}(_0x61ad,0x17f));var _0xd61a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61ad[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd61a('0x0'));module[_0xd61a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd61a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd61a('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xd61a('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xd61a('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xd61a('0x2')]},'serverUrl':{'type':Sequelize[_0xd61a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd61a('0x4')](_0xd61a('0x5'),_0xd61a('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x96b1=['sequelize','exports','STRING','ENUM','basic','newTab','integrationTab'];(function(_0x1a32fe,_0xdab6ac){var _0x1abca6=function(_0x280920){while(--_0x280920){_0x1a32fe['push'](_0x1a32fe['shift']());}};_0x1abca6(++_0xdab6ac);}(_0x96b1,0x142));var _0x196b=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x96b1[_0x5e2cb4];return _0x282902;};'use strict';var Sequelize=require(_0x196b('0x0'));module[_0x196b('0x1')]={'name':{'type':Sequelize[_0x196b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x196b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x196b('0x3')](_0x196b('0x4')),'defaultValue':_0x196b('0x4')},'password':{'type':Sequelize[_0x196b('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x196b('0x2')]},'token':{'type':Sequelize[_0x196b('0x2')]},'tokenSecret':{'type':Sequelize[_0x196b('0x2')]},'serverUrl':{'type':Sequelize[_0x196b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x196b('0x5')),'defaultValue':_0x196b('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4cde12c..7c10f5a 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 _0x3235=['channel','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','format','application/json','headers','Authorization','%s:%s','toString','base64','concat','_embedded','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','DeskAccount','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','params','body','destroy','getConfigurations','DeskConfiguration','addConfiguration','findOne','Subjects','getSubjects'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x3235,0x8b));var _0x5323=function(_0x11a6a6,_0x531bd8){_0x11a6a6=_0x11a6a6-0x0;var _0x4a08b4=_0x3235[_0x11a6a6];return _0x4a08b4;};'use strict';var emlformat=require(_0x5323('0x0'));var rimraf=require(_0x5323('0x1'));var zipdir=require(_0x5323('0x2'));var jsonpatch=require(_0x5323('0x3'));var rp=require(_0x5323('0x4'));var moment=require('moment');var BPromise=require(_0x5323('0x5'));var Mustache=require(_0x5323('0x6'));var util=require(_0x5323('0x7'));var path=require(_0x5323('0x8'));var sox=require(_0x5323('0x9'));var csv=require(_0x5323('0xa'));var ejs=require(_0x5323('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5323('0xc'));var squel=require('squel');var crypto=require(_0x5323('0xd'));var jsforce=require(_0x5323('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5323('0xa'));var querystring=require('querystring');var Papa=require(_0x5323('0xf'));var Redis=require('ioredis');var authService=require(_0x5323('0x10'));var qs=require(_0x5323('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5323('0x12'));var logger=require(_0x5323('0x13'))(_0x5323('0x14'));var utils=require(_0x5323('0x15'));var config=require(_0x5323('0x16'));var licenseUtil=require(_0x5323('0x17'));var db=require(_0x5323('0x18'))['db'];var integrations=require(_0x5323('0x19'));function respondWithStatusCode(_0x15dff2,_0x23512c){_0x23512c=_0x23512c||0xcc;return function(_0x4c030b){if(_0x4c030b){return _0x15dff2['sendStatus'](_0x23512c);}return _0x15dff2['status'](_0x23512c)[_0x5323('0x1a')]();};}function respondWithResult(_0x235e86,_0x5e6689){_0x5e6689=_0x5e6689||0xc8;return function(_0x376f46){if(_0x376f46){return _0x235e86[_0x5323('0x1b')](_0x5e6689)[_0x5323('0x1c')](_0x376f46);}};}function respondWithFilteredResult(_0x54642c,_0x462e87){return function(_0x34d7ad){if(_0x34d7ad){var _0x3985ae=typeof _0x462e87[_0x5323('0x1d')]===_0x5323('0x1e')&&typeof _0x462e87[_0x5323('0x1f')]==='undefined';var _0x57dbda=_0x34d7ad[_0x5323('0x20')];var _0x27ee65=_0x3985ae?0x0:_0x462e87[_0x5323('0x1d')];var _0x20f624=_0x3985ae?_0x34d7ad[_0x5323('0x20')]:_0x462e87[_0x5323('0x1d')]+_0x462e87[_0x5323('0x1f')];var _0x3e18e5;if(_0x20f624>=_0x57dbda){_0x20f624=_0x57dbda;_0x3e18e5=0xc8;}else{_0x3e18e5=0xce;}_0x54642c[_0x5323('0x1b')](_0x3e18e5);return _0x54642c['set'](_0x5323('0x21'),_0x27ee65+'-'+_0x20f624+'/'+_0x57dbda)['json'](_0x34d7ad);}return null;};}function patchUpdates(_0x482ea3){return function(_0x5a128b){try{jsonpatch[_0x5323('0x22')](_0x5a128b,_0x482ea3,!![]);}catch(_0x328858){return BPromise['reject'](_0x328858);}return _0x5a128b[_0x5323('0x23')]();};}function saveUpdates(_0x3ae1e4,_0x2ae8ce){return function(_0x362ca2){if(_0x362ca2){return _0x362ca2[_0x5323('0x24')](_0x3ae1e4)[_0x5323('0x25')](function(_0x1f2522){return _0x1f2522;});}return null;};}function removeEntity(_0x26be9f,_0x1e2a13){return function(_0x4d3f1e){if(_0x4d3f1e){return _0x4d3f1e['destroy']()['then'](function(){_0x26be9f[_0x5323('0x1b')](0xcc)[_0x5323('0x1a')]();});}};}function handleEntityNotFound(_0x13bc51,_0x599d6c){return function(_0x41dd56){if(!_0x41dd56){_0x13bc51[_0x5323('0x26')](0x194);}return _0x41dd56;};}function handleError(_0x28381b,_0x2384e3){_0x2384e3=_0x2384e3||0x1f4;return function(_0x366d31){logger[_0x5323('0x27')](_0x366d31[_0x5323('0x28')]);if(_0x366d31[_0x5323('0x29')]){delete _0x366d31['name'];}_0x28381b[_0x5323('0x1b')](_0x2384e3)[_0x5323('0x2a')](_0x366d31);};}exports[_0x5323('0x2b')]=function(_0x5ad729,_0x115c33){var _0x2d74c6={},_0x29fe7f={},_0x389934={'count':0x0,'rows':[]};var _0x2dc4f9=_[_0x5323('0x2c')](db[_0x5323('0x2d')]['rawAttributes'],function(_0x35235a){return{'name':_0x35235a[_0x5323('0x2e')],'type':_0x35235a['type'][_0x5323('0x2f')]};});_0x29fe7f[_0x5323('0x30')]=_[_0x5323('0x2c')](_0x2dc4f9,_0x5323('0x29'));_0x29fe7f['query']=_[_0x5323('0x31')](_0x5ad729[_0x5323('0x32')]);_0x29fe7f[_0x5323('0x33')]=_[_0x5323('0x34')](_0x29fe7f['model'],_0x29fe7f[_0x5323('0x32')]);_0x2d74c6[_0x5323('0x35')]=_[_0x5323('0x34')](_0x29fe7f[_0x5323('0x30')],qs['fields'](_0x5ad729[_0x5323('0x32')][_0x5323('0x36')]));_0x2d74c6[_0x5323('0x35')]=_0x2d74c6['attributes'][_0x5323('0x37')]?_0x2d74c6[_0x5323('0x35')]:_0x29fe7f['model'];if(!_0x5ad729[_0x5323('0x32')][_0x5323('0x38')](_0x5323('0x39'))){_0x2d74c6[_0x5323('0x1f')]=qs[_0x5323('0x1f')](_0x5ad729[_0x5323('0x32')]['limit']);_0x2d74c6[_0x5323('0x1d')]=qs[_0x5323('0x1d')](_0x5ad729['query'][_0x5323('0x1d')]);}_0x2d74c6[_0x5323('0x3a')]=qs[_0x5323('0x3b')](_0x5ad729[_0x5323('0x32')][_0x5323('0x3b')]);_0x2d74c6['where']=qs[_0x5323('0x33')](_[_0x5323('0x3c')](_0x5ad729[_0x5323('0x32')],_0x29fe7f['filters']),_0x2dc4f9);if(_0x5ad729['query']['filter']){_0x2d74c6[_0x5323('0x3d')]=_[_0x5323('0x3e')](_0x2d74c6[_0x5323('0x3d')],{'$or':_[_0x5323('0x2c')](_0x2dc4f9,function(_0x3eee6f){if(_0x3eee6f[_0x5323('0x3f')]!==_0x5323('0x40')){var _0x4c27db={};_0x4c27db[_0x3eee6f[_0x5323('0x29')]]={'$like':'%'+_0x5ad729[_0x5323('0x32')][_0x5323('0x41')]+'%'};return _0x4c27db;}})});}_0x2d74c6=_[_0x5323('0x3e')]({},_0x2d74c6,_0x5ad729['options']);var _0x4256f2={'where':_0x2d74c6[_0x5323('0x3d')]};return db[_0x5323('0x2d')]['count'](_0x4256f2)['then'](function(_0x52923b){_0x389934[_0x5323('0x20')]=_0x52923b;if(_0x5ad729[_0x5323('0x32')][_0x5323('0x42')]){_0x2d74c6[_0x5323('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x5323('0x44')](_0x2d74c6);})[_0x5323('0x25')](function(_0xd3f701){_0x389934[_0x5323('0x45')]=_0xd3f701;return _0x389934;})[_0x5323('0x25')](respondWithFilteredResult(_0x115c33,_0x2d74c6))[_0x5323('0x46')](handleError(_0x115c33,null));};exports[_0x5323('0x47')]=function(_0x2d7831,_0x554d8d){var _0x15878d={'raw':![],'where':{'id':_0x2d7831['params']['id']}},_0x56889f={};_0x56889f[_0x5323('0x30')]=_['keys'](db[_0x5323('0x2d')][_0x5323('0x48')]);_0x56889f[_0x5323('0x32')]=_[_0x5323('0x31')](_0x2d7831[_0x5323('0x32')]);_0x56889f[_0x5323('0x33')]=_[_0x5323('0x34')](_0x56889f[_0x5323('0x30')],_0x56889f[_0x5323('0x32')]);_0x15878d['attributes']=_[_0x5323('0x34')](_0x56889f[_0x5323('0x30')],qs['fields'](_0x2d7831[_0x5323('0x32')]['fields']));_0x15878d['attributes']=_0x15878d[_0x5323('0x35')][_0x5323('0x37')]?_0x15878d[_0x5323('0x35')]:_0x56889f['model'];if(_0x2d7831[_0x5323('0x32')][_0x5323('0x42')]){_0x15878d[_0x5323('0x43')]=[{'all':!![]}];}_0x15878d=_[_0x5323('0x3e')]({},_0x15878d,_0x2d7831[_0x5323('0x49')]);return db[_0x5323('0x2d')][_0x5323('0x4a')](_0x15878d)[_0x5323('0x25')](handleEntityNotFound(_0x554d8d,null))['then'](respondWithResult(_0x554d8d,null))['catch'](handleError(_0x554d8d,null));};exports['create']=function(_0x564c67,_0xc2e966){return db[_0x5323('0x2d')][_0x5323('0x4b')](_0x564c67['body'],{})[_0x5323('0x25')](respondWithResult(_0xc2e966,0xc9))[_0x5323('0x46')](handleError(_0xc2e966,null));};exports[_0x5323('0x24')]=function(_0x8877d,_0xf56aa2){if(_0x8877d['body']['id']){delete _0x8877d['body']['id'];}return db[_0x5323('0x2d')][_0x5323('0x4a')]({'where':{'id':_0x8877d[_0x5323('0x4c')]['id']}})[_0x5323('0x25')](handleEntityNotFound(_0xf56aa2,null))[_0x5323('0x25')](saveUpdates(_0x8877d[_0x5323('0x4d')],null))[_0x5323('0x25')](respondWithResult(_0xf56aa2,null))[_0x5323('0x46')](handleError(_0xf56aa2,null));};exports[_0x5323('0x4e')]=function(_0x502eb4,_0x101cec){return db[_0x5323('0x2d')][_0x5323('0x4a')]({'where':{'id':_0x502eb4[_0x5323('0x4c')]['id']}})[_0x5323('0x25')](handleEntityNotFound(_0x101cec,null))[_0x5323('0x25')](removeEntity(_0x101cec,null))[_0x5323('0x46')](handleError(_0x101cec,null));};exports[_0x5323('0x4f')]=function(_0x30ba10,_0xa4def1,_0x2b90f7){var _0x15cd05={};var _0x48d34b={};var _0x59bc51;var _0x88d739;return db[_0x5323('0x2d')]['findOne']({'where':{'id':_0x30ba10[_0x5323('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa4def1,null))[_0x5323('0x25')](function(_0xe9bb00){if(_0xe9bb00){_0x59bc51=_0xe9bb00;_0x48d34b[_0x5323('0x30')]=_[_0x5323('0x31')](db[_0x5323('0x50')][_0x5323('0x48')]);_0x48d34b[_0x5323('0x32')]=_['keys'](_0x30ba10[_0x5323('0x32')]);_0x48d34b[_0x5323('0x33')]=_[_0x5323('0x34')](_0x48d34b[_0x5323('0x30')],_0x48d34b[_0x5323('0x32')]);_0x15cd05[_0x5323('0x35')]=_[_0x5323('0x34')](_0x48d34b[_0x5323('0x30')],qs[_0x5323('0x36')](_0x30ba10[_0x5323('0x32')][_0x5323('0x36')]));_0x15cd05[_0x5323('0x35')]=_0x15cd05['attributes']['length']?_0x15cd05[_0x5323('0x35')]:_0x48d34b[_0x5323('0x30')];_0x15cd05[_0x5323('0x3a')]=qs[_0x5323('0x3b')](_0x30ba10['query'][_0x5323('0x3b')]);_0x15cd05[_0x5323('0x3d')]=qs['filters'](_[_0x5323('0x3c')](_0x30ba10['query'],_0x48d34b[_0x5323('0x33')]));if(_0x30ba10[_0x5323('0x32')][_0x5323('0x41')]){_0x15cd05['where']=_[_0x5323('0x3e')](_0x15cd05[_0x5323('0x3d')],{'$or':_[_0x5323('0x2c')](_0x15cd05[_0x5323('0x35')],function(_0x2148d2){var _0x1fbb5a={};_0x1fbb5a[_0x2148d2]={'$like':'%'+_0x30ba10[_0x5323('0x32')][_0x5323('0x41')]+'%'};return _0x1fbb5a;})});}_0x15cd05=_['merge']({},_0x15cd05,_0x30ba10[_0x5323('0x49')]);return _0x59bc51[_0x5323('0x4f')](_0x15cd05);}})['then'](function(_0xd2b1bd){if(_0xd2b1bd){_0x88d739=_0xd2b1bd[_0x5323('0x37')];if(!_0x30ba10[_0x5323('0x32')][_0x5323('0x38')](_0x5323('0x39'))){_0x15cd05[_0x5323('0x1f')]=qs[_0x5323('0x1f')](_0x30ba10['query'][_0x5323('0x1f')]);_0x15cd05['offset']=qs[_0x5323('0x1d')](_0x30ba10[_0x5323('0x32')][_0x5323('0x1d')]);}return _0x59bc51[_0x5323('0x4f')](_0x15cd05);}})['then'](function(_0x4706c2){if(_0x4706c2){return _0x4706c2?{'count':_0x88d739,'rows':_0x4706c2}:null;}})['then'](respondWithResult(_0xa4def1,null))[_0x5323('0x46')](handleError(_0xa4def1,null));};exports[_0x5323('0x51')]=function(_0x23e800,_0xfa5b58,_0x4f6830){if(_0x23e800[_0x5323('0x4d')]['id']){delete _0x23e800['body']['id'];}return db[_0x5323('0x2d')][_0x5323('0x52')]({'where':{'id':_0x23e800['params']['id']}})[_0x5323('0x25')](handleEntityNotFound(_0xfa5b58,null))['then'](function(_0x1a9e9a){if(_0x1a9e9a){_0x23e800[_0x5323('0x4d')]['AccountId']=_0x1a9e9a['id'];_0x23e800[_0x5323('0x4d')][_0x5323('0x53')]=integrations[_0x5323('0x54')](_0x23e800[_0x5323('0x4d')][_0x5323('0x55')],_0x23e800[_0x5323('0x4d')][_0x5323('0x3f')]);_0x23e800[_0x5323('0x4d')][_0x5323('0x56')]=integrations['getDescriptions'](_0x23e800[_0x5323('0x4d')][_0x5323('0x55')],_0x23e800[_0x5323('0x4d')][_0x5323('0x3f')]);return db['DeskConfiguration'][_0x5323('0x4b')](_0x23e800[_0x5323('0x4d')],{'include':[{'model':db['DeskField'],'as':_0x5323('0x53')},{'model':db['DeskField'],'as':_0x5323('0x56')}]});}return null;})['then'](respondWithResult(_0xfa5b58,null))[_0x5323('0x46')](handleError(_0xfa5b58,null));};exports[_0x5323('0x57')]=function(_0x392526,_0x5e762b,_0x26d1c2){var _0x3d69a3=[{'name':_0x5323('0x58'),'label':_0x5323('0x58'),'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 _0x1106d6='';return db[_0x5323('0x2d')][_0x5323('0x52')]({'where':{'id':_0x392526[_0x5323('0x4c')]['id']},'attributes':['id',_0x5323('0x59'),_0x5323('0x5a'),_0x5323('0x5b'),_0x5323('0x5c'),_0x5323('0x5d'),_0x5323('0x5e'),'token',_0x5323('0x5f')]})['then'](handleEntityNotFound(_0x5e762b,null))['then'](function(_0x3ab4e4){if(_0x3ab4e4){_0x1106d6=_0x3ab4e4[_0x5323('0x59')];var _0x260b68=_0x1106d6[_0x5323('0x60')](-0x1);if(_0x260b68==='/'){_0x1106d6=_0x1106d6[_0x5323('0x61')](0x0,_0x1106d6['lastIndexOf'](_0x260b68));}var _0x5ca779={'method':'GET','uri':util[_0x5323('0x62')]('%s/custom_fields',_0x1106d6),'headers':{'Content-Type':'application/json','Accept':_0x5323('0x63')},'json':!![]};if(_0x3ab4e4[_0x5323('0x5a')]==='basic'){_0x5ca779[_0x5323('0x64')][_0x5323('0x65')]=util[_0x5323('0x62')]('Basic\x20%s',new Buffer(util['format'](_0x5323('0x66'),_0x3ab4e4[_0x5323('0x5b')],_0x3ab4e4['password']))[_0x5323('0x67')](_0x5323('0x68')));}return rp(_0x5ca779)['then'](function(_0x462e42){return _0x3d69a3[_0x5323('0x69')](_[_0x5323('0x2c')](_0x462e42[_0x5323('0x6a')]['entries'],function(_0x46e305){return{'id':_0x46e305[_0x5323('0x29')],'name':_0x46e305[_0x5323('0x29')],'type':_0x46e305['type'],'active':_0x46e305['active'],'label':_0x46e305[_0x5323('0x6b')],'custom':!![]};}));});}})['then'](function(_0x75ec29){return{'count':_0x75ec29[_0x5323('0x37')],'rows':_0x75ec29};})[_0x5323('0x25')](respondWithResult(_0x5e762b,null))[_0x5323('0x46')](function(_0x3c3822){var _0x4a714c=_0x392526[_0x5323('0x32')][_0x5323('0x6c')]?0x1f4:_0x3c3822[_0x5323('0x6d')]||0x1f4;logger['error'](_0x5323('0x6e'),_0x5323('0x57'),_0x4a714c,JSON[_0x5323('0x6f')](_0x3c3822));delete _0x3c3822[_0x5323('0x29')];if(_0x4a714c===0x191){_0x4a714c=0x190;}_0x5e762b[_0x5323('0x1b')](_0x4a714c)[_0x5323('0x2a')](_0x392526[_0x5323('0x32')][_0x5323('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c3822[_0x5323('0x6d')]}:_0x3c3822);});}; \ No newline at end of file +var _0xd1f5=['pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','create','DeskField','Descriptions','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','format','password','toString','base64','concat','_embedded','entries','active','label','test','statusCode','error','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','stack','name','send','index','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','DeskAccount','includeAll','findAll','show','rawAttributes','length','include','find','body','catch','destroy','params','findOne'];(function(_0x2fa4e6,_0x4f8384){var _0x5ba01a=function(_0x4888b1){while(--_0x4888b1){_0x2fa4e6['push'](_0x2fa4e6['shift']());}};_0x5ba01a(++_0x4f8384);}(_0xd1f5,0x99));var _0x5d1f=function(_0x3a22e7,_0x9b2f60){_0x3a22e7=_0x3a22e7-0x0;var _0x1d7801=_0xd1f5[_0x3a22e7];return _0x1d7801;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d1f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d1f('0x1'));var rp=require(_0x5d1f('0x2'));var moment=require(_0x5d1f('0x3'));var BPromise=require(_0x5d1f('0x4'));var Mustache=require(_0x5d1f('0x5'));var util=require('util');var path=require(_0x5d1f('0x6'));var sox=require(_0x5d1f('0x7'));var csv=require(_0x5d1f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d1f('0x9'));var _=require(_0x5d1f('0xa'));var squel=require(_0x5d1f('0xb'));var crypto=require(_0x5d1f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d1f('0xd'));var toCsv=require(_0x5d1f('0x8'));var querystring=require(_0x5d1f('0xe'));var Papa=require(_0x5d1f('0xf'));var Redis=require(_0x5d1f('0x10'));var authService=require(_0x5d1f('0x11'));var qs=require(_0x5d1f('0x12'));var as=require(_0x5d1f('0x13'));var hardwareService=require(_0x5d1f('0x14'));var logger=require(_0x5d1f('0x15'))(_0x5d1f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5d1f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x33d6dc,_0x27962d){_0x27962d=_0x27962d||0xcc;return function(_0x5294ee){if(_0x5294ee){return _0x33d6dc[_0x5d1f('0x18')](_0x27962d);}return _0x33d6dc[_0x5d1f('0x19')](_0x27962d)[_0x5d1f('0x1a')]();};}function respondWithResult(_0x4fef73,_0x3954f4){_0x3954f4=_0x3954f4||0xc8;return function(_0x4dddee){if(_0x4dddee){return _0x4fef73[_0x5d1f('0x19')](_0x3954f4)['json'](_0x4dddee);}};}function respondWithFilteredResult(_0x2765a7,_0x423e91){return function(_0x2d6ace){if(_0x2d6ace){var _0x16b24c=typeof _0x423e91[_0x5d1f('0x1b')]===_0x5d1f('0x1c')&&typeof _0x423e91[_0x5d1f('0x1d')]==='undefined';var _0x45efc4=_0x2d6ace['count'];var _0x2de018=_0x16b24c?0x0:_0x423e91[_0x5d1f('0x1b')];var _0x1842b2=_0x16b24c?_0x2d6ace[_0x5d1f('0x1e')]:_0x423e91[_0x5d1f('0x1b')]+_0x423e91[_0x5d1f('0x1d')];var _0x2c496c;if(_0x1842b2>=_0x45efc4){_0x1842b2=_0x45efc4;_0x2c496c=0xc8;}else{_0x2c496c=0xce;}_0x2765a7[_0x5d1f('0x19')](_0x2c496c);return _0x2765a7[_0x5d1f('0x1f')]('Content-Range',_0x2de018+'-'+_0x1842b2+'/'+_0x45efc4)[_0x5d1f('0x20')](_0x2d6ace);}return null;};}function patchUpdates(_0x2bcbb5){return function(_0x5afc24){try{jsonpatch[_0x5d1f('0x21')](_0x5afc24,_0x2bcbb5,!![]);}catch(_0x2cc8f6){return BPromise[_0x5d1f('0x22')](_0x2cc8f6);}return _0x5afc24['save']();};}function saveUpdates(_0x14e943,_0x2b3be8){return function(_0xd141d6){if(_0xd141d6){return _0xd141d6['update'](_0x14e943)[_0x5d1f('0x23')](function(_0x349835){return _0x349835;});}return null;};}function removeEntity(_0x16565e,_0x567d58){return function(_0x5586d7){if(_0x5586d7){return _0x5586d7['destroy']()['then'](function(){_0x16565e[_0x5d1f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d07d,_0x2ced54){return function(_0x5d5a5e){if(!_0x5d5a5e){_0x13d07d[_0x5d1f('0x18')](0x194);}return _0x5d5a5e;};}function handleError(_0x10774c,_0x2d6569){_0x2d6569=_0x2d6569||0x1f4;return function(_0x1c5567){logger['error'](_0x1c5567[_0x5d1f('0x24')]);if(_0x1c5567[_0x5d1f('0x25')]){delete _0x1c5567['name'];}_0x10774c[_0x5d1f('0x19')](_0x2d6569)[_0x5d1f('0x26')](_0x1c5567);};}exports[_0x5d1f('0x27')]=function(_0x4bc368,_0x426463){var _0x4a458a={},_0x182a1d={},_0x35d8ef={'count':0x0,'rows':[]};var _0x415be2=_['map'](db['DeskAccount']['rawAttributes'],function(_0xef6bc2){return{'name':_0xef6bc2[_0x5d1f('0x28')],'type':_0xef6bc2[_0x5d1f('0x29')][_0x5d1f('0x2a')]};});_0x182a1d['model']=_[_0x5d1f('0x2b')](_0x415be2,_0x5d1f('0x25'));_0x182a1d[_0x5d1f('0x2c')]=_[_0x5d1f('0x2d')](_0x4bc368[_0x5d1f('0x2c')]);_0x182a1d['filters']=_['intersection'](_0x182a1d[_0x5d1f('0x2e')],_0x182a1d[_0x5d1f('0x2c')]);_0x4a458a[_0x5d1f('0x2f')]=_[_0x5d1f('0x30')](_0x182a1d[_0x5d1f('0x2e')],qs['fields'](_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x31')]));_0x4a458a[_0x5d1f('0x2f')]=_0x4a458a[_0x5d1f('0x2f')]['length']?_0x4a458a[_0x5d1f('0x2f')]:_0x182a1d[_0x5d1f('0x2e')];if(!_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x32')](_0x5d1f('0x33'))){_0x4a458a[_0x5d1f('0x1d')]=qs[_0x5d1f('0x1d')](_0x4bc368['query']['limit']);_0x4a458a['offset']=qs[_0x5d1f('0x1b')](_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x1b')]);}_0x4a458a[_0x5d1f('0x34')]=qs[_0x5d1f('0x35')](_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x35')]);_0x4a458a[_0x5d1f('0x36')]=qs[_0x5d1f('0x37')](_['pick'](_0x4bc368[_0x5d1f('0x2c')],_0x182a1d['filters']),_0x415be2);if(_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x38')]){_0x4a458a['where']=_[_0x5d1f('0x39')](_0x4a458a['where'],{'$or':_[_0x5d1f('0x2b')](_0x415be2,function(_0x45fa0e){if(_0x45fa0e[_0x5d1f('0x29')]!==_0x5d1f('0x3a')){var _0x21e29b={};_0x21e29b[_0x45fa0e['name']]={'$like':'%'+_0x4bc368[_0x5d1f('0x2c')][_0x5d1f('0x38')]+'%'};return _0x21e29b;}})});}_0x4a458a=_[_0x5d1f('0x39')]({},_0x4a458a,_0x4bc368[_0x5d1f('0x3b')]);var _0x413637={'where':_0x4a458a['where']};return db[_0x5d1f('0x3c')][_0x5d1f('0x1e')](_0x413637)['then'](function(_0x39b561){_0x35d8ef['count']=_0x39b561;if(_0x4bc368['query'][_0x5d1f('0x3d')]){_0x4a458a['include']=[{'all':!![]}];}return db[_0x5d1f('0x3c')][_0x5d1f('0x3e')](_0x4a458a);})[_0x5d1f('0x23')](function(_0x2db943){_0x35d8ef['rows']=_0x2db943;return _0x35d8ef;})['then'](respondWithFilteredResult(_0x426463,_0x4a458a))['catch'](handleError(_0x426463,null));};exports[_0x5d1f('0x3f')]=function(_0x32cdef,_0x4d38f5){var _0x3d753e={'raw':![],'where':{'id':_0x32cdef['params']['id']}},_0x3831f0={};_0x3831f0[_0x5d1f('0x2e')]=_['keys'](db[_0x5d1f('0x3c')][_0x5d1f('0x40')]);_0x3831f0[_0x5d1f('0x2c')]=_[_0x5d1f('0x2d')](_0x32cdef[_0x5d1f('0x2c')]);_0x3831f0[_0x5d1f('0x37')]=_[_0x5d1f('0x30')](_0x3831f0[_0x5d1f('0x2e')],_0x3831f0[_0x5d1f('0x2c')]);_0x3d753e[_0x5d1f('0x2f')]=_[_0x5d1f('0x30')](_0x3831f0['model'],qs[_0x5d1f('0x31')](_0x32cdef[_0x5d1f('0x2c')][_0x5d1f('0x31')]));_0x3d753e[_0x5d1f('0x2f')]=_0x3d753e[_0x5d1f('0x2f')][_0x5d1f('0x41')]?_0x3d753e['attributes']:_0x3831f0[_0x5d1f('0x2e')];if(_0x32cdef[_0x5d1f('0x2c')][_0x5d1f('0x3d')]){_0x3d753e[_0x5d1f('0x42')]=[{'all':!![]}];}_0x3d753e=_['merge']({},_0x3d753e,_0x32cdef[_0x5d1f('0x3b')]);return db[_0x5d1f('0x3c')][_0x5d1f('0x43')](_0x3d753e)['then'](handleEntityNotFound(_0x4d38f5,null))['then'](respondWithResult(_0x4d38f5,null))['catch'](handleError(_0x4d38f5,null));};exports['create']=function(_0xc6e383,_0x40dee6){return db[_0x5d1f('0x3c')]['create'](_0xc6e383[_0x5d1f('0x44')],{})[_0x5d1f('0x23')](respondWithResult(_0x40dee6,0xc9))[_0x5d1f('0x45')](handleError(_0x40dee6,null));};exports['update']=function(_0x8dd80c,_0x44c403){if(_0x8dd80c['body']['id']){delete _0x8dd80c[_0x5d1f('0x44')]['id'];}return db[_0x5d1f('0x3c')][_0x5d1f('0x43')]({'where':{'id':_0x8dd80c['params']['id']}})[_0x5d1f('0x23')](handleEntityNotFound(_0x44c403,null))[_0x5d1f('0x23')](saveUpdates(_0x8dd80c[_0x5d1f('0x44')],null))['then'](respondWithResult(_0x44c403,null))['catch'](handleError(_0x44c403,null));};exports[_0x5d1f('0x46')]=function(_0x37c7d5,_0x2583a9){return db[_0x5d1f('0x3c')][_0x5d1f('0x43')]({'where':{'id':_0x37c7d5[_0x5d1f('0x47')]['id']}})[_0x5d1f('0x23')](handleEntityNotFound(_0x2583a9,null))[_0x5d1f('0x23')](removeEntity(_0x2583a9,null))[_0x5d1f('0x45')](handleError(_0x2583a9,null));};exports['getConfigurations']=function(_0x1de404,_0x273c6e,_0x539878){var _0x296e48={};var _0x5a8ea5={};var _0x2645ab;var _0x31d506;return db['DeskAccount'][_0x5d1f('0x48')]({'where':{'id':_0x1de404[_0x5d1f('0x47')]['id']}})[_0x5d1f('0x23')](handleEntityNotFound(_0x273c6e,null))['then'](function(_0x2502c1){if(_0x2502c1){_0x2645ab=_0x2502c1;_0x5a8ea5[_0x5d1f('0x2e')]=_[_0x5d1f('0x2d')](db['DeskConfiguration'][_0x5d1f('0x40')]);_0x5a8ea5[_0x5d1f('0x2c')]=_['keys'](_0x1de404[_0x5d1f('0x2c')]);_0x5a8ea5[_0x5d1f('0x37')]=_['intersection'](_0x5a8ea5['model'],_0x5a8ea5[_0x5d1f('0x2c')]);_0x296e48[_0x5d1f('0x2f')]=_['intersection'](_0x5a8ea5[_0x5d1f('0x2e')],qs[_0x5d1f('0x31')](_0x1de404[_0x5d1f('0x2c')][_0x5d1f('0x31')]));_0x296e48[_0x5d1f('0x2f')]=_0x296e48[_0x5d1f('0x2f')][_0x5d1f('0x41')]?_0x296e48['attributes']:_0x5a8ea5[_0x5d1f('0x2e')];_0x296e48[_0x5d1f('0x34')]=qs[_0x5d1f('0x35')](_0x1de404[_0x5d1f('0x2c')][_0x5d1f('0x35')]);_0x296e48[_0x5d1f('0x36')]=qs[_0x5d1f('0x37')](_[_0x5d1f('0x49')](_0x1de404['query'],_0x5a8ea5[_0x5d1f('0x37')]));if(_0x1de404['query']['filter']){_0x296e48[_0x5d1f('0x36')]=_['merge'](_0x296e48['where'],{'$or':_[_0x5d1f('0x2b')](_0x296e48[_0x5d1f('0x2f')],function(_0x26fa99){var _0xbe205e={};_0xbe205e[_0x26fa99]={'$like':'%'+_0x1de404['query'][_0x5d1f('0x38')]+'%'};return _0xbe205e;})});}_0x296e48=_[_0x5d1f('0x39')]({},_0x296e48,_0x1de404['options']);return _0x2645ab[_0x5d1f('0x4a')](_0x296e48);}})['then'](function(_0x15caa9){if(_0x15caa9){_0x31d506=_0x15caa9[_0x5d1f('0x41')];if(!_0x1de404[_0x5d1f('0x2c')][_0x5d1f('0x32')](_0x5d1f('0x33'))){_0x296e48[_0x5d1f('0x1d')]=qs[_0x5d1f('0x1d')](_0x1de404[_0x5d1f('0x2c')][_0x5d1f('0x1d')]);_0x296e48[_0x5d1f('0x1b')]=qs[_0x5d1f('0x1b')](_0x1de404[_0x5d1f('0x2c')][_0x5d1f('0x1b')]);}return _0x2645ab['getConfigurations'](_0x296e48);}})[_0x5d1f('0x23')](function(_0x16f390){if(_0x16f390){return _0x16f390?{'count':_0x31d506,'rows':_0x16f390}:null;}})[_0x5d1f('0x23')](respondWithResult(_0x273c6e,null))[_0x5d1f('0x45')](handleError(_0x273c6e,null));};exports[_0x5d1f('0x4b')]=function(_0x4e7059,_0x1d8d58,_0x479c6f){if(_0x4e7059[_0x5d1f('0x44')]['id']){delete _0x4e7059[_0x5d1f('0x44')]['id'];}return db[_0x5d1f('0x3c')]['findOne']({'where':{'id':_0x4e7059[_0x5d1f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d8d58,null))[_0x5d1f('0x23')](function(_0x38fa31){if(_0x38fa31){_0x4e7059[_0x5d1f('0x44')][_0x5d1f('0x4c')]=_0x38fa31['id'];_0x4e7059['body'][_0x5d1f('0x4d')]=integrations[_0x5d1f('0x4e')](_0x4e7059[_0x5d1f('0x44')][_0x5d1f('0x4f')],_0x4e7059[_0x5d1f('0x44')][_0x5d1f('0x29')]);_0x4e7059[_0x5d1f('0x44')]['Descriptions']=integrations[_0x5d1f('0x50')](_0x4e7059[_0x5d1f('0x44')][_0x5d1f('0x4f')],_0x4e7059[_0x5d1f('0x44')][_0x5d1f('0x29')]);return db['DeskConfiguration'][_0x5d1f('0x51')](_0x4e7059['body'],{'include':[{'model':db['DeskField'],'as':_0x5d1f('0x4d')},{'model':db[_0x5d1f('0x52')],'as':_0x5d1f('0x53')}]});}return null;})['then'](respondWithResult(_0x1d8d58,null))[_0x5d1f('0x45')](handleError(_0x1d8d58,null));};exports['getFields']=function(_0x127a3b,_0x31b64e,_0x5a6def){var _0x41a597=[{'name':'priority','label':_0x5d1f('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4ee166='';return db[_0x5d1f('0x3c')][_0x5d1f('0x48')]({'where':{'id':_0x127a3b[_0x5d1f('0x47')]['id']},'attributes':['id',_0x5d1f('0x55'),_0x5d1f('0x56'),_0x5d1f('0x57'),'password',_0x5d1f('0x58'),_0x5d1f('0x59'),_0x5d1f('0x5a'),_0x5d1f('0x5b')]})[_0x5d1f('0x23')](handleEntityNotFound(_0x31b64e,null))['then'](function(_0xef2be1){if(_0xef2be1){_0x4ee166=_0xef2be1[_0x5d1f('0x55')];var _0x2fc071=_0x4ee166['slice'](-0x1);if(_0x2fc071==='/'){_0x4ee166=_0x4ee166[_0x5d1f('0x5c')](0x0,_0x4ee166[_0x5d1f('0x5d')](_0x2fc071));}var _0x5cf165={'method':_0x5d1f('0x5e'),'uri':util['format'](_0x5d1f('0x5f'),_0x4ee166),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xef2be1['authType']===_0x5d1f('0x60')){_0x5cf165[_0x5d1f('0x61')][_0x5d1f('0x62')]=util['format'](_0x5d1f('0x63'),new Buffer(util[_0x5d1f('0x64')]('%s:%s',_0xef2be1[_0x5d1f('0x57')],_0xef2be1[_0x5d1f('0x65')]))[_0x5d1f('0x66')](_0x5d1f('0x67')));}return rp(_0x5cf165)[_0x5d1f('0x23')](function(_0x5b1d7e){return _0x41a597[_0x5d1f('0x68')](_[_0x5d1f('0x2b')](_0x5b1d7e[_0x5d1f('0x69')][_0x5d1f('0x6a')],function(_0x171b56){return{'id':_0x171b56[_0x5d1f('0x25')],'name':_0x171b56['name'],'type':_0x171b56[_0x5d1f('0x29')],'active':_0x171b56[_0x5d1f('0x6b')],'label':_0x171b56[_0x5d1f('0x6c')],'custom':!![]};}));});}})[_0x5d1f('0x23')](function(_0x348c79){return{'count':_0x348c79[_0x5d1f('0x41')],'rows':_0x348c79};})['then'](respondWithResult(_0x31b64e,null))[_0x5d1f('0x45')](function(_0x1641e3){var _0x5412fa=_0x127a3b['query'][_0x5d1f('0x6d')]?0x1f4:_0x1641e3[_0x5d1f('0x6e')]||0x1f4;logger[_0x5d1f('0x6f')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5412fa,JSON[_0x5d1f('0x70')](_0x1641e3));delete _0x1641e3[_0x5d1f('0x25')];if(_0x5412fa===0x191){_0x5412fa=0x190;}_0x31b64e[_0x5d1f('0x19')](_0x5412fa)[_0x5d1f('0x26')](_0x127a3b[_0x5d1f('0x2c')][_0x5d1f('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x1641e3[_0x5d1f('0x6e')]}:_0x1641e3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c36d7e0..ca927bb 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 _0x896f=['exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','bluebird','request-promise','./intDeskAccount.attributes'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x896f,0x9d));var _0xf896=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x896f[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xf896('0x0'));var logger=require(_0xf896('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf896('0x2'));var rp=require(_0xf896('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf896('0x4'));var integrations=require('../../components/integrations/configuration');module[_0xf896('0x5')]=function(_0x1c7cda,_0x56c3ee){return _0x1c7cda[_0xf896('0x6')](_0xf896('0x7'),attributes,{'tableName':_0xf896('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a6a=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x12e146,_0x3bb7bf){var _0x3c1602=function(_0x152b6c){while(--_0x152b6c){_0x12e146['push'](_0x12e146['shift']());}};_0x3c1602(++_0x3bb7bf);}(_0x5a6a,0x7e));var _0xa5a6=function(_0x311017,_0x2ece8a){_0x311017=_0x311017-0x0;var _0x2e07c1=_0x5a6a[_0x311017];return _0x2e07c1;};'use strict';var _=require(_0xa5a6('0x0'));var util=require('util');var logger=require(_0xa5a6('0x1'))(_0xa5a6('0x2'));var moment=require(_0xa5a6('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5a6('0x4'));var fs=require('fs');var path=require(_0xa5a6('0x5'));var rimraf=require(_0xa5a6('0x6'));var config=require(_0xa5a6('0x7'));var attributes=require(_0xa5a6('0x8'));var integrations=require(_0xa5a6('0x9'));module[_0xa5a6('0xa')]=function(_0x2ec8bb,_0x1fd837){return _0x2ec8bb[_0xa5a6('0xb')](_0xa5a6('0xc'),attributes,{'tableName':_0xa5a6('0xd'),'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 9e0b623..cd444f8 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 _0x8d4d=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','debug','stringify','DeskAccount','ShowDeskAccount','lodash','moment','bluebird'];(function(_0x138d2c,_0x2abba6){var _0xacae0d=function(_0x4fcfd2){while(--_0x4fcfd2){_0x138d2c['push'](_0x138d2c['shift']());}};_0xacae0d(++_0x2abba6);}(_0x8d4d,0xb1));var _0xd8d4=function(_0xacde2e,_0x222056){_0xacde2e=_0xacde2e-0x0;var _0x3e7d33=_0x8d4d[_0xacde2e];return _0x3e7d33;};'use strict';var _=require(_0xd8d4('0x0'));var util=require('util');var moment=require(_0xd8d4('0x1'));var BPromise=require(_0xd8d4('0x2'));var rs=require(_0xd8d4('0x3'));var fs=require('fs');var Redis=require(_0xd8d4('0x4'));var db=require(_0xd8d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8d4('0x6'))(_0xd8d4('0x7'));var config=require(_0xd8d4('0x8'));var jayson=require(_0xd8d4('0x9'));var client=jayson[_0xd8d4('0xa')][_0xd8d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10e731,_0x1a262f,_0x50179f){return new BPromise(function(_0x3eb70c,_0x1153fb){return client['request'](_0x10e731,_0x50179f)[_0xd8d4('0xc')](function(_0x7caf3a){logger['info'](_0xd8d4('0xd'),_0x1a262f,_0xd8d4('0xe'));logger['debug'](_0xd8d4('0xf'),_0x1a262f,'request\x20sent',JSON['stringify'](_0x7caf3a));if(_0x7caf3a['error']){if(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x11')]===0x1f4){logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x7caf3a[_0xd8d4('0x10')]['message']);return _0x1153fb(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x12')]);}logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x7caf3a['error'][_0xd8d4('0x12')]);return _0x3eb70c(_0x7caf3a[_0xd8d4('0x10')][_0xd8d4('0x12')]);}else{logger[_0xd8d4('0x13')](_0xd8d4('0xd'),_0x1a262f,_0xd8d4('0xe'));_0x3eb70c(_0x7caf3a[_0xd8d4('0x14')][_0xd8d4('0x12')]);}})[_0xd8d4('0x15')](function(_0x4748c4){logger[_0xd8d4('0x10')](_0xd8d4('0xd'),_0x1a262f,_0x4748c4);_0x1153fb(_0x4748c4);});});}exports[_0xd8d4('0x16')]=function(_0x577629){var _0x83fdc2=this;return new Promise(function(_0x40b4fa,_0x1d8cb2){return db['DeskAccount'][_0xd8d4('0x17')]({'raw':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x19')]===undefined?!![]:![]:!![],'where':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1a')]||null:null,'attributes':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1b')]||null:null,'limit':_0x577629['options']?_0x577629[_0xd8d4('0x18')][_0xd8d4('0x1c')]||null:null,'include':_0x577629[_0xd8d4('0x18')]?_0x577629[_0xd8d4('0x18')]['include']?_[_0xd8d4('0x1d')](_0x577629[_0xd8d4('0x18')]['include'],function(_0x374ab7){return{'model':db[_0x374ab7[_0xd8d4('0x1e')]],'as':_0x374ab7['as'],'attributes':_0x374ab7[_0xd8d4('0x1b')],'include':_0x374ab7[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x374ab7[_0xd8d4('0x1f')],function(_0x5bf18e){return{'model':db[_0x5bf18e[_0xd8d4('0x1e')]],'as':_0x5bf18e['as'],'attributes':_0x5bf18e[_0xd8d4('0x1b')],'include':_0x5bf18e['include']?_[_0xd8d4('0x1d')](_0x5bf18e['include'],function(_0x10894d){return{'model':db[_0x10894d[_0xd8d4('0x1e')]],'as':_0x10894d['as'],'attributes':_0x10894d[_0xd8d4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd8d4('0xc')](function(_0x149659){logger[_0xd8d4('0x13')]('GetDeskAccount',_0x577629);logger[_0xd8d4('0x20')](_0xd8d4('0x16'),_0x577629,JSON[_0xd8d4('0x21')](_0x149659));_0x40b4fa(_0x149659);})[_0xd8d4('0x15')](function(_0x4292d1){logger[_0xd8d4('0x10')](_0xd8d4('0x16'),_0x4292d1[_0xd8d4('0x12')],_0x577629);_0x1d8cb2(_0x83fdc2['error'](0x1f4,_0x4292d1[_0xd8d4('0x12')]));});});};exports['ShowDeskAccount']=function(_0x476017){var _0x1221b5=this;return new Promise(function(_0x19eaca,_0x4fe18e){return db[_0xd8d4('0x22')]['find']({'raw':_0x476017[_0xd8d4('0x18')]?_0x476017[_0xd8d4('0x18')][_0xd8d4('0x19')]===undefined?!![]:![]:!![],'where':_0x476017[_0xd8d4('0x18')]?_0x476017['options'][_0xd8d4('0x1a')]||null:null,'attributes':_0x476017[_0xd8d4('0x18')]?_0x476017[_0xd8d4('0x18')][_0xd8d4('0x1b')]||null:null,'include':_0x476017['options']?_0x476017['options'][_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x476017[_0xd8d4('0x18')][_0xd8d4('0x1f')],function(_0x52f4b9){return{'model':db[_0x52f4b9['model']],'as':_0x52f4b9['as'],'attributes':_0x52f4b9[_0xd8d4('0x1b')],'include':_0x52f4b9[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x52f4b9[_0xd8d4('0x1f')],function(_0x158f09){return{'model':db[_0x158f09[_0xd8d4('0x1e')]],'as':_0x158f09['as'],'attributes':_0x158f09[_0xd8d4('0x1b')],'include':_0x158f09[_0xd8d4('0x1f')]?_[_0xd8d4('0x1d')](_0x158f09[_0xd8d4('0x1f')],function(_0x460ffd){return{'model':db[_0x460ffd[_0xd8d4('0x1e')]],'as':_0x460ffd['as'],'attributes':_0x460ffd[_0xd8d4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x218f12){logger[_0xd8d4('0x13')](_0xd8d4('0x23'),_0x476017);logger[_0xd8d4('0x20')](_0xd8d4('0x23'),_0x476017,JSON[_0xd8d4('0x21')](_0x218f12));_0x19eaca(_0x218f12);})[_0xd8d4('0x15')](function(_0x21f7c3){logger['error']('ShowDeskAccount',_0x21f7c3[_0xd8d4('0x12')],_0x476017);_0x4fe18e(_0x1221b5[_0xd8d4('0x10')](0x1f4,_0x21f7c3[_0xd8d4('0x12')]));});});}; \ No newline at end of file +var _0x920b=['message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','stringify','find','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x1a2a96,_0x3c1dbb){var _0x56182d=function(_0x4f4200){while(--_0x4f4200){_0x1a2a96['push'](_0x1a2a96['shift']());}};_0x56182d(++_0x3c1dbb);}(_0x920b,0x16e));var _0xb920=function(_0x280cc9,_0x2cfb26){_0x280cc9=_0x280cc9-0x0;var _0x2fd86f=_0x920b[_0x280cc9];return _0x2fd86f;};'use strict';var _=require(_0xb920('0x0'));var util=require(_0xb920('0x1'));var moment=require(_0xb920('0x2'));var BPromise=require(_0xb920('0x3'));var rs=require(_0xb920('0x4'));var fs=require('fs');var Redis=require(_0xb920('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb920('0x6'));var logger=require(_0xb920('0x7'))(_0xb920('0x8'));var config=require('../../config/environment');var jayson=require(_0xb920('0x9'));var client=jayson['client'][_0xb920('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42c624,_0x5bc845,_0x5934eb){return new BPromise(function(_0x441e61,_0x43bd88){return client[_0xb920('0xb')](_0x42c624,_0x5934eb)[_0xb920('0xc')](function(_0x4fef4a){logger[_0xb920('0xd')](_0xb920('0xe'),_0x5bc845,_0xb920('0xf'));logger[_0xb920('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5bc845,_0xb920('0xf'),JSON['stringify'](_0x4fef4a));if(_0x4fef4a['error']){if(_0x4fef4a[_0xb920('0x11')][_0xb920('0x12')]===0x1f4){logger[_0xb920('0x11')](_0xb920('0xe'),_0x5bc845,_0x4fef4a[_0xb920('0x11')]['message']);return _0x43bd88(_0x4fef4a['error'][_0xb920('0x13')]);}logger[_0xb920('0x11')](_0xb920('0xe'),_0x5bc845,_0x4fef4a[_0xb920('0x11')]['message']);return _0x441e61(_0x4fef4a[_0xb920('0x11')]['message']);}else{logger[_0xb920('0xd')]('DeskAccount,\x20%s,\x20%s',_0x5bc845,_0xb920('0xf'));_0x441e61(_0x4fef4a[_0xb920('0x14')]['message']);}})[_0xb920('0x15')](function(_0x3e8f0a){logger[_0xb920('0x11')](_0xb920('0xe'),_0x5bc845,_0x3e8f0a);_0x43bd88(_0x3e8f0a);});});}exports['GetDeskAccount']=function(_0x53971e){var _0x4ddb45=this;return new Promise(function(_0x3984bc,_0x561be7){return db['DeskAccount'][_0xb920('0x16')]({'raw':_0x53971e[_0xb920('0x17')]?_0x53971e[_0xb920('0x17')][_0xb920('0x18')]===undefined?!![]:![]:!![],'where':_0x53971e[_0xb920('0x17')]?_0x53971e[_0xb920('0x17')][_0xb920('0x19')]||null:null,'attributes':_0x53971e[_0xb920('0x17')]?_0x53971e[_0xb920('0x17')][_0xb920('0x1a')]||null:null,'limit':_0x53971e['options']?_0x53971e['options'][_0xb920('0x1b')]||null:null,'include':_0x53971e['options']?_0x53971e[_0xb920('0x17')][_0xb920('0x1c')]?_[_0xb920('0x1d')](_0x53971e['options'][_0xb920('0x1c')],function(_0x4f5755){return{'model':db[_0x4f5755['model']],'as':_0x4f5755['as'],'attributes':_0x4f5755[_0xb920('0x1a')],'include':_0x4f5755[_0xb920('0x1c')]?_['map'](_0x4f5755[_0xb920('0x1c')],function(_0x197d70){return{'model':db[_0x197d70['model']],'as':_0x197d70['as'],'attributes':_0x197d70[_0xb920('0x1a')],'include':_0x197d70['include']?_[_0xb920('0x1d')](_0x197d70['include'],function(_0x1c3aee){return{'model':db[_0x1c3aee[_0xb920('0x1e')]],'as':_0x1c3aee['as'],'attributes':_0x1c3aee[_0xb920('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a1e03){logger['info'](_0xb920('0x1f'),_0x53971e);logger[_0xb920('0x10')]('GetDeskAccount',_0x53971e,JSON[_0xb920('0x20')](_0x5a1e03));_0x3984bc(_0x5a1e03);})[_0xb920('0x15')](function(_0x1b17b5){logger[_0xb920('0x11')](_0xb920('0x1f'),_0x1b17b5['message'],_0x53971e);_0x561be7(_0x4ddb45[_0xb920('0x11')](0x1f4,_0x1b17b5[_0xb920('0x13')]));});});};exports['ShowDeskAccount']=function(_0x2424c1){var _0x5d5c7b=this;return new Promise(function(_0x32604b,_0x3a81d6){return db['DeskAccount'][_0xb920('0x21')]({'raw':_0x2424c1['options']?_0x2424c1['options'][_0xb920('0x18')]===undefined?!![]:![]:!![],'where':_0x2424c1[_0xb920('0x17')]?_0x2424c1[_0xb920('0x17')][_0xb920('0x19')]||null:null,'attributes':_0x2424c1[_0xb920('0x17')]?_0x2424c1[_0xb920('0x17')][_0xb920('0x1a')]||null:null,'include':_0x2424c1[_0xb920('0x17')]?_0x2424c1[_0xb920('0x17')][_0xb920('0x1c')]?_['map'](_0x2424c1[_0xb920('0x17')]['include'],function(_0x54d52c){return{'model':db[_0x54d52c[_0xb920('0x1e')]],'as':_0x54d52c['as'],'attributes':_0x54d52c[_0xb920('0x1a')],'include':_0x54d52c[_0xb920('0x1c')]?_[_0xb920('0x1d')](_0x54d52c[_0xb920('0x1c')],function(_0x5ce49d){return{'model':db[_0x5ce49d['model']],'as':_0x5ce49d['as'],'attributes':_0x5ce49d[_0xb920('0x1a')],'include':_0x5ce49d[_0xb920('0x1c')]?_[_0xb920('0x1d')](_0x5ce49d[_0xb920('0x1c')],function(_0x3f02bb){return{'model':db[_0x3f02bb['model']],'as':_0x3f02bb['as'],'attributes':_0x3f02bb[_0xb920('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb920('0xc')](function(_0x33f700){logger[_0xb920('0xd')](_0xb920('0x22'),_0x2424c1);logger['debug'](_0xb920('0x22'),_0x2424c1,JSON[_0xb920('0x20')](_0x33f700));_0x32604b(_0x33f700);})[_0xb920('0x15')](function(_0x5f4928){logger['error']('ShowDeskAccount',_0x5f4928['message'],_0x2424c1);_0x3a81d6(_0x5d5c7b['error'](0x1f4,_0x5f4928[_0xb920('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6fe44db..42f6122 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x33a048,_0x583b64){var _0x346085=function(_0x2054b9){while(--_0x2054b9){_0x33a048['push'](_0x33a048['shift']());}};_0x346085(++_0x583b64);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ed174,_0x2a4c49){_0x2ed174=_0x2ed174-0x0;var _0x3d02cb=_0xedd9[_0x2ed174];return _0x3d02cb;};'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('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x52ecb2,_0x5e8b33){var _0x2f979d=function(_0x4f6ed1){while(--_0x4f6ed1){_0x52ecb2['push'](_0x52ecb2['shift']());}};_0x2f979d(++_0x5e8b33);}(_0x34e8,0x12c));var _0x834e=function(_0xcd0bc1,_0x2410a1){_0xcd0bc1=_0xcd0bc1-0x0;var _0x2ced8f=_0x34e8[_0xcd0bc1];return _0x2ced8f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1b369fc..a6531aa 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 _0x1916=['exports','STRING'];(function(_0x49dfd1,_0x37f207){var _0x5bb373=function(_0x3d2afe){while(--_0x3d2afe){_0x49dfd1['push'](_0x49dfd1['shift']());}};_0x5bb373(++_0x37f207);}(_0x1916,0xda));var _0x6191=function(_0x3d826b,_0x551b00){_0x3d826b=_0x3d826b-0x0;var _0x1fca61=_0x1916[_0x3d826b];return _0x1fca61;};'use strict';var Sequelize=require('sequelize');module[_0x6191('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6191('0x1')]}}; \ No newline at end of file +var _0xf069=['exports','STRING','sequelize'];(function(_0x3874c9,_0x59b86e){var _0x2ac5e7=function(_0x4dc9d6){while(--_0x4dc9d6){_0x3874c9['push'](_0x3874c9['shift']());}};_0x2ac5e7(++_0x59b86e);}(_0xf069,0xec));var _0x9f06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf069[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9f06('0x0'));module[_0x9f06('0x1')]={'name':{'type':Sequelize[_0x9f06('0x2')]},'description':{'type':Sequelize[_0x9f06('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 4fcdbe5..3d3475f 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 _0x05a7=['includeAll','include','findAll','catch','show','find','create','body','params','destroy','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','apply','reject','save','update','then','end','sendStatus','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x05a7,0x1ad));var _0x705a=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x05a7[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0x705a('0x0'));var rimraf=require(_0x705a('0x1'));var zipdir=require(_0x705a('0x2'));var jsonpatch=require(_0x705a('0x3'));var rp=require(_0x705a('0x4'));var moment=require(_0x705a('0x5'));var BPromise=require(_0x705a('0x6'));var Mustache=require(_0x705a('0x7'));var util=require(_0x705a('0x8'));var path=require(_0x705a('0x9'));var sox=require(_0x705a('0xa'));var csv=require('to-csv');var ejs=require(_0x705a('0xb'));var fs=require('fs');var fs_extra=require(_0x705a('0xc'));var _=require(_0x705a('0xd'));var squel=require(_0x705a('0xe'));var crypto=require(_0x705a('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x705a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x705a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x705a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x705a('0x13'))('api');var utils=require(_0x705a('0x14'));var config=require(_0x705a('0x15'));var licenseUtil=require(_0x705a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bab43,_0x524a00){_0x524a00=_0x524a00||0xcc;return function(_0x1899d8){if(_0x1899d8){return _0x3bab43['sendStatus'](_0x524a00);}return _0x3bab43[_0x705a('0x17')](_0x524a00)['end']();};}function respondWithResult(_0x22f4c3,_0x361e28){_0x361e28=_0x361e28||0xc8;return function(_0x571e96){if(_0x571e96){return _0x22f4c3['status'](_0x361e28)[_0x705a('0x18')](_0x571e96);}};}function respondWithFilteredResult(_0x389138,_0x33fb06){return function(_0x425595){if(_0x425595){var _0x13d199=typeof _0x33fb06[_0x705a('0x19')]==='undefined'&&typeof _0x33fb06['limit']===_0x705a('0x1a');var _0x3f9059=_0x425595['count'];var _0x5227ed=_0x13d199?0x0:_0x33fb06[_0x705a('0x19')];var _0x4ab2fe=_0x13d199?_0x425595['count']:_0x33fb06[_0x705a('0x19')]+_0x33fb06[_0x705a('0x1b')];var _0x54ce5a;if(_0x4ab2fe>=_0x3f9059){_0x4ab2fe=_0x3f9059;_0x54ce5a=0xc8;}else{_0x54ce5a=0xce;}_0x389138[_0x705a('0x17')](_0x54ce5a);return _0x389138[_0x705a('0x1c')]('Content-Range',_0x5227ed+'-'+_0x4ab2fe+'/'+_0x3f9059)['json'](_0x425595);}return null;};}function patchUpdates(_0x16ffc5){return function(_0x591eac){try{jsonpatch[_0x705a('0x1d')](_0x591eac,_0x16ffc5,!![]);}catch(_0x524d51){return BPromise[_0x705a('0x1e')](_0x524d51);}return _0x591eac[_0x705a('0x1f')]();};}function saveUpdates(_0x4565d8,_0x11e6d4){return function(_0x1ed677){if(_0x1ed677){return _0x1ed677[_0x705a('0x20')](_0x4565d8)[_0x705a('0x21')](function(_0x5e1420){return _0x5e1420;});}return null;};}function removeEntity(_0x3b8aaf,_0x1ba1aa){return function(_0xd22ba3){if(_0xd22ba3){return _0xd22ba3['destroy']()[_0x705a('0x21')](function(){_0x3b8aaf[_0x705a('0x17')](0xcc)[_0x705a('0x22')]();});}};}function handleEntityNotFound(_0x2abd13,_0xb6e083){return function(_0x19a0e4){if(!_0x19a0e4){_0x2abd13[_0x705a('0x23')](0x194);}return _0x19a0e4;};}function handleError(_0x56582,_0x3a76fd){_0x3a76fd=_0x3a76fd||0x1f4;return function(_0x59dea0){logger[_0x705a('0x24')](_0x59dea0['stack']);if(_0x59dea0[_0x705a('0x25')]){delete _0x59dea0[_0x705a('0x25')];}_0x56582[_0x705a('0x17')](_0x3a76fd)[_0x705a('0x26')](_0x59dea0);};}exports[_0x705a('0x27')]=function(_0x39b00f,_0x33ac1c){var _0x26b791={},_0x4c8d42={},_0x463711={'count':0x0,'rows':[]};var _0x232987=_[_0x705a('0x28')](db[_0x705a('0x29')][_0x705a('0x2a')],function(_0x5e1e29){return{'name':_0x5e1e29[_0x705a('0x2b')],'type':_0x5e1e29[_0x705a('0x2c')]['key']};});_0x4c8d42['model']=_[_0x705a('0x28')](_0x232987,_0x705a('0x25'));_0x4c8d42[_0x705a('0x2d')]=_[_0x705a('0x2e')](_0x39b00f['query']);_0x4c8d42[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x4c8d42[_0x705a('0x31')],_0x4c8d42[_0x705a('0x2d')]);_0x26b791[_0x705a('0x32')]=_[_0x705a('0x30')](_0x4c8d42['model'],qs[_0x705a('0x33')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x33')]));_0x26b791[_0x705a('0x32')]=_0x26b791[_0x705a('0x32')][_0x705a('0x34')]?_0x26b791[_0x705a('0x32')]:_0x4c8d42['model'];if(!_0x39b00f['query']['hasOwnProperty'](_0x705a('0x35'))){_0x26b791[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x1b')]);_0x26b791[_0x705a('0x19')]=qs[_0x705a('0x19')](_0x39b00f[_0x705a('0x2d')][_0x705a('0x19')]);}_0x26b791[_0x705a('0x36')]=qs['sort'](_0x39b00f[_0x705a('0x2d')][_0x705a('0x37')]);_0x26b791[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x39b00f[_0x705a('0x2d')],_0x4c8d42[_0x705a('0x2f')]),_0x232987);if(_0x39b00f[_0x705a('0x2d')][_0x705a('0x3a')]){_0x26b791[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x26b791[_0x705a('0x38')],{'$or':_['map'](_0x232987,function(_0x308e2a){if(_0x308e2a[_0x705a('0x2c')]!==_0x705a('0x3c')){var _0x52fa1d={};_0x52fa1d[_0x308e2a[_0x705a('0x25')]]={'$like':'%'+_0x39b00f['query'][_0x705a('0x3a')]+'%'};return _0x52fa1d;}})});}_0x26b791=_[_0x705a('0x3b')]({},_0x26b791,_0x39b00f[_0x705a('0x3d')]);var _0x153021={'where':_0x26b791[_0x705a('0x38')]};return db[_0x705a('0x29')]['count'](_0x153021)[_0x705a('0x21')](function(_0x13323d){_0x463711[_0x705a('0x3e')]=_0x13323d;if(_0x39b00f[_0x705a('0x2d')][_0x705a('0x3f')]){_0x26b791[_0x705a('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x705a('0x41')](_0x26b791);})[_0x705a('0x21')](function(_0x1fb9ed){_0x463711['rows']=_0x1fb9ed;return _0x463711;})['then'](respondWithFilteredResult(_0x33ac1c,_0x26b791))[_0x705a('0x42')](handleError(_0x33ac1c,null));};exports[_0x705a('0x43')]=function(_0x4a9fcc,_0x198070){var _0x374e41={'raw':![],'where':{'id':_0x4a9fcc['params']['id']}},_0x1f6cd1={};_0x1f6cd1[_0x705a('0x31')]=_[_0x705a('0x2e')](db['DeskConfiguration']['rawAttributes']);_0x1f6cd1[_0x705a('0x2d')]=_[_0x705a('0x2e')](_0x4a9fcc['query']);_0x1f6cd1['filters']=_[_0x705a('0x30')](_0x1f6cd1[_0x705a('0x31')],_0x1f6cd1['query']);_0x374e41['attributes']=_[_0x705a('0x30')](_0x1f6cd1[_0x705a('0x31')],qs['fields'](_0x4a9fcc[_0x705a('0x2d')][_0x705a('0x33')]));_0x374e41[_0x705a('0x32')]=_0x374e41[_0x705a('0x32')][_0x705a('0x34')]?_0x374e41[_0x705a('0x32')]:_0x1f6cd1[_0x705a('0x31')];if(_0x4a9fcc[_0x705a('0x2d')][_0x705a('0x3f')]){_0x374e41[_0x705a('0x40')]=[{'all':!![]}];}_0x374e41=_['merge']({},_0x374e41,_0x4a9fcc[_0x705a('0x3d')]);return db[_0x705a('0x29')][_0x705a('0x44')](_0x374e41)[_0x705a('0x21')](handleEntityNotFound(_0x198070,null))[_0x705a('0x21')](respondWithResult(_0x198070,null))[_0x705a('0x42')](handleError(_0x198070,null));};exports['create']=function(_0x21166a,_0x3604f8){return db[_0x705a('0x29')][_0x705a('0x45')](_0x21166a['body'],{})[_0x705a('0x21')](respondWithResult(_0x3604f8,0xc9))[_0x705a('0x42')](handleError(_0x3604f8,null));};exports[_0x705a('0x20')]=function(_0xe0e1ca,_0x48e6c1){if(_0xe0e1ca['body']['id']){delete _0xe0e1ca[_0x705a('0x46')]['id'];}return db[_0x705a('0x29')]['find']({'where':{'id':_0xe0e1ca[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x48e6c1,null))[_0x705a('0x21')](saveUpdates(_0xe0e1ca[_0x705a('0x46')],null))[_0x705a('0x21')](respondWithResult(_0x48e6c1,null))[_0x705a('0x42')](handleError(_0x48e6c1,null));};exports[_0x705a('0x48')]=function(_0x23f204,_0x2a2b30){return db[_0x705a('0x29')][_0x705a('0x44')]({'where':{'id':_0x23f204[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x2a2b30,null))[_0x705a('0x21')](removeEntity(_0x2a2b30,null))['catch'](handleError(_0x2a2b30,null));};exports[_0x705a('0x49')]=function(_0x31f6e4,_0xe7b973,_0x55074d){var _0x38e712={};var _0x49e925={};var _0x3a42e0;var _0x4693ef;return db[_0x705a('0x29')][_0x705a('0x4a')]({'where':{'id':_0x31f6e4[_0x705a('0x47')]['id']}})['then'](handleEntityNotFound(_0xe7b973,null))['then'](function(_0x427aed){if(_0x427aed){_0x3a42e0=_0x427aed;_0x49e925['model']=_[_0x705a('0x2e')](db['DeskField'][_0x705a('0x2a')]);_0x49e925['query']=_[_0x705a('0x2e')](_0x31f6e4[_0x705a('0x2d')]);_0x49e925[_0x705a('0x2f')]=_['intersection'](_0x49e925[_0x705a('0x31')],_0x49e925[_0x705a('0x2d')]);_0x38e712[_0x705a('0x32')]=_['intersection'](_0x49e925[_0x705a('0x31')],qs['fields'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x33')]));_0x38e712['attributes']=_0x38e712[_0x705a('0x32')][_0x705a('0x34')]?_0x38e712[_0x705a('0x32')]:_0x49e925[_0x705a('0x31')];_0x38e712[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x37')]);_0x38e712[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x31f6e4['query'],_0x49e925[_0x705a('0x2f')]));if(_0x31f6e4[_0x705a('0x2d')][_0x705a('0x3a')]){_0x38e712[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x38e712[_0x705a('0x38')],{'$or':_[_0x705a('0x28')](_0x38e712[_0x705a('0x32')],function(_0x180994){var _0x1ac5f0={};_0x1ac5f0[_0x180994]={'$like':'%'+_0x31f6e4[_0x705a('0x2d')][_0x705a('0x3a')]+'%'};return _0x1ac5f0;})});}_0x38e712=_[_0x705a('0x3b')]({},_0x38e712,_0x31f6e4['options']);return _0x3a42e0[_0x705a('0x49')](_0x38e712);}})[_0x705a('0x21')](function(_0x5f0b6d){if(_0x5f0b6d){_0x4693ef=_0x5f0b6d[_0x705a('0x34')];if(!_0x31f6e4[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x38e712['limit']=qs['limit'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x1b')]);_0x38e712[_0x705a('0x19')]=qs['offset'](_0x31f6e4[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x3a42e0[_0x705a('0x49')](_0x38e712);}})[_0x705a('0x21')](function(_0x40719e){if(_0x40719e){return _0x40719e?{'count':_0x4693ef,'rows':_0x40719e}:null;}})[_0x705a('0x21')](respondWithResult(_0xe7b973,null))[_0x705a('0x42')](handleError(_0xe7b973,null));};exports[_0x705a('0x4c')]=function(_0x52dd5e,_0x44bc88,_0x190969){var _0x1adfbc={};var _0x3b2851={};var _0x42481a;var _0x308c2f;return db['DeskConfiguration'][_0x705a('0x4a')]({'where':{'id':_0x52dd5e[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x44bc88,null))[_0x705a('0x21')](function(_0x5b44d3){if(_0x5b44d3){_0x42481a=_0x5b44d3;_0x3b2851[_0x705a('0x31')]=_[_0x705a('0x2e')](db[_0x705a('0x4d')][_0x705a('0x2a')]);_0x3b2851['query']=_[_0x705a('0x2e')](_0x52dd5e['query']);_0x3b2851[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x3b2851[_0x705a('0x31')],_0x3b2851[_0x705a('0x2d')]);_0x1adfbc[_0x705a('0x32')]=_[_0x705a('0x30')](_0x3b2851[_0x705a('0x31')],qs[_0x705a('0x33')](_0x52dd5e['query'][_0x705a('0x33')]));_0x1adfbc[_0x705a('0x32')]=_0x1adfbc[_0x705a('0x32')]['length']?_0x1adfbc[_0x705a('0x32')]:_0x3b2851[_0x705a('0x31')];_0x1adfbc[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x52dd5e[_0x705a('0x2d')]['sort']);_0x1adfbc[_0x705a('0x38')]=qs[_0x705a('0x2f')](_['pick'](_0x52dd5e[_0x705a('0x2d')],_0x3b2851[_0x705a('0x2f')]));if(_0x52dd5e['query']['filter']){_0x1adfbc[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x1adfbc['where'],{'$or':_['map'](_0x1adfbc[_0x705a('0x32')],function(_0x129ad2){var _0x5eda95={};_0x5eda95[_0x129ad2]={'$like':'%'+_0x52dd5e[_0x705a('0x2d')]['filter']+'%'};return _0x5eda95;})});}_0x1adfbc=_[_0x705a('0x3b')]({},_0x1adfbc,_0x52dd5e[_0x705a('0x3d')]);return _0x42481a['getSubjects'](_0x1adfbc);}})[_0x705a('0x21')](function(_0x45e0fd){if(_0x45e0fd){_0x308c2f=_0x45e0fd[_0x705a('0x34')];if(!_0x52dd5e[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x1adfbc['limit']=qs['limit'](_0x52dd5e[_0x705a('0x2d')][_0x705a('0x1b')]);_0x1adfbc['offset']=qs[_0x705a('0x19')](_0x52dd5e[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x42481a[_0x705a('0x4c')](_0x1adfbc);}})[_0x705a('0x21')](function(_0x370ce3){if(_0x370ce3){return _0x370ce3?{'count':_0x308c2f,'rows':_0x370ce3}:null;}})['then'](respondWithResult(_0x44bc88,null))[_0x705a('0x42')](handleError(_0x44bc88,null));};exports['getDescriptions']=function(_0x1ba255,_0x3abc58,_0x5155b3){var _0x3c3b6b={};var _0x21fbe6={};var _0x32f4cc;var _0x2cb33c;return db[_0x705a('0x29')][_0x705a('0x4a')]({'where':{'id':_0x1ba255[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x3abc58,null))[_0x705a('0x21')](function(_0x5de30e){if(_0x5de30e){_0x32f4cc=_0x5de30e;_0x21fbe6['model']=_[_0x705a('0x2e')](db['DeskField'][_0x705a('0x2a')]);_0x21fbe6['query']=_[_0x705a('0x2e')](_0x1ba255[_0x705a('0x2d')]);_0x21fbe6['filters']=_[_0x705a('0x30')](_0x21fbe6[_0x705a('0x31')],_0x21fbe6[_0x705a('0x2d')]);_0x3c3b6b[_0x705a('0x32')]=_['intersection'](_0x21fbe6[_0x705a('0x31')],qs[_0x705a('0x33')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x33')]));_0x3c3b6b['attributes']=_0x3c3b6b[_0x705a('0x32')][_0x705a('0x34')]?_0x3c3b6b[_0x705a('0x32')]:_0x21fbe6[_0x705a('0x31')];_0x3c3b6b[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x37')]);_0x3c3b6b['where']=qs[_0x705a('0x2f')](_['pick'](_0x1ba255[_0x705a('0x2d')],_0x21fbe6[_0x705a('0x2f')]));if(_0x1ba255[_0x705a('0x2d')][_0x705a('0x3a')]){_0x3c3b6b[_0x705a('0x38')]=_[_0x705a('0x3b')](_0x3c3b6b[_0x705a('0x38')],{'$or':_['map'](_0x3c3b6b['attributes'],function(_0x189586){var _0x5639a1={};_0x5639a1[_0x189586]={'$like':'%'+_0x1ba255['query']['filter']+'%'};return _0x5639a1;})});}_0x3c3b6b=_[_0x705a('0x3b')]({},_0x3c3b6b,_0x1ba255[_0x705a('0x3d')]);return _0x32f4cc[_0x705a('0x4e')](_0x3c3b6b);}})[_0x705a('0x21')](function(_0x298553){if(_0x298553){_0x2cb33c=_0x298553[_0x705a('0x34')];if(!_0x1ba255['query']['hasOwnProperty']('nolimit')){_0x3c3b6b[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x1b')]);_0x3c3b6b[_0x705a('0x19')]=qs[_0x705a('0x19')](_0x1ba255[_0x705a('0x2d')][_0x705a('0x19')]);}return _0x32f4cc['getDescriptions'](_0x3c3b6b);}})[_0x705a('0x21')](function(_0x20b1ec){if(_0x20b1ec){return _0x20b1ec?{'count':_0x2cb33c,'rows':_0x20b1ec}:null;}})[_0x705a('0x21')](respondWithResult(_0x3abc58,null))[_0x705a('0x42')](handleError(_0x3abc58,null));};exports[_0x705a('0x4f')]=function(_0x587d2b,_0x3b1f20,_0x2db679){var _0x427a6a={};var _0x28d495={};var _0x1a67fe;var _0x1f97a9;return db['DeskConfiguration'][_0x705a('0x4a')]({'where':{'id':_0x587d2b[_0x705a('0x47')]['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x3b1f20,null))[_0x705a('0x21')](function(_0x3afd30){if(_0x3afd30){_0x1a67fe=_0x3afd30;_0x28d495[_0x705a('0x31')]=_[_0x705a('0x2e')](db[_0x705a('0x50')][_0x705a('0x2a')]);_0x28d495['query']=_[_0x705a('0x2e')](_0x587d2b[_0x705a('0x2d')]);_0x28d495[_0x705a('0x2f')]=_[_0x705a('0x30')](_0x28d495[_0x705a('0x31')],_0x28d495[_0x705a('0x2d')]);_0x427a6a[_0x705a('0x32')]=_[_0x705a('0x30')](_0x28d495[_0x705a('0x31')],qs[_0x705a('0x33')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x33')]));_0x427a6a[_0x705a('0x32')]=_0x427a6a['attributes']['length']?_0x427a6a[_0x705a('0x32')]:_0x28d495[_0x705a('0x31')];_0x427a6a[_0x705a('0x36')]=qs[_0x705a('0x37')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x37')]);_0x427a6a[_0x705a('0x38')]=qs[_0x705a('0x2f')](_[_0x705a('0x39')](_0x587d2b['query'],_0x28d495[_0x705a('0x2f')]));if(_0x587d2b[_0x705a('0x2d')][_0x705a('0x3a')]){_0x427a6a['where']=_['merge'](_0x427a6a[_0x705a('0x38')],{'$or':_[_0x705a('0x28')](_0x427a6a[_0x705a('0x32')],function(_0x7f1b47){var _0x473726={};_0x473726[_0x7f1b47]={'$like':'%'+_0x587d2b[_0x705a('0x2d')]['filter']+'%'};return _0x473726;})});}_0x427a6a=_[_0x705a('0x3b')]({},_0x427a6a,_0x587d2b[_0x705a('0x3d')]);return _0x1a67fe[_0x705a('0x4f')](_0x427a6a);}})[_0x705a('0x21')](function(_0x5ace3d){if(_0x5ace3d){_0x1f97a9=_0x5ace3d[_0x705a('0x34')];if(!_0x587d2b[_0x705a('0x2d')][_0x705a('0x4b')](_0x705a('0x35'))){_0x427a6a[_0x705a('0x1b')]=qs[_0x705a('0x1b')](_0x587d2b[_0x705a('0x2d')][_0x705a('0x1b')]);_0x427a6a[_0x705a('0x19')]=qs['offset'](_0x587d2b['query']['offset']);}return _0x1a67fe[_0x705a('0x4f')](_0x427a6a);}})[_0x705a('0x21')](function(_0x2c78cd){if(_0x2c78cd){return _0x2c78cd?{'count':_0x1f97a9,'rows':_0x2c78cd}:null;}})[_0x705a('0x21')](respondWithResult(_0x3b1f20,null))['catch'](handleError(_0x3b1f20,null));};exports[_0x705a('0x51')]=function(_0x77714a,_0x536c78,_0x14e3f1){if(_0x77714a[_0x705a('0x46')]['id']){delete _0x77714a[_0x705a('0x46')]['id'];}return db[_0x705a('0x29')]['findOne']({'where':{'id':_0x77714a['params']['id']}})[_0x705a('0x21')](handleEntityNotFound(_0x536c78,null))['then'](function(_0x6c1103){if(_0x6c1103){return _0x6c1103[_0x705a('0x51')](_0x77714a[_0x705a('0x46')]['ids']||[]);}return null;})[_0x705a('0x21')](respondWithResult(_0x536c78,null))[_0x705a('0x42')](handleError(_0x536c78,null));}; \ No newline at end of file +var _0xa93d=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','getFields','getSubjects','findOne','DeskField','nolimit','getDescriptions','getTags','Tag','setTags','ids','rimraf'];(function(_0x87cfc4,_0x2470eb){var _0x4d712e=function(_0x50b73d){while(--_0x50b73d){_0x87cfc4['push'](_0x87cfc4['shift']());}};_0x4d712e(++_0x2470eb);}(_0xa93d,0xab));var _0xda93=function(_0x3c7445,_0x328104){_0x3c7445=_0x3c7445-0x0;var _0x5616b6=_0xa93d[_0x3c7445];return _0x5616b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda93('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda93('0x1'));var rp=require('request-promise');var moment=require(_0xda93('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xda93('0x3'));var util=require(_0xda93('0x4'));var path=require(_0xda93('0x5'));var sox=require(_0xda93('0x6'));var csv=require(_0xda93('0x7'));var ejs=require(_0xda93('0x8'));var fs=require('fs');var fs_extra=require(_0xda93('0x9'));var _=require(_0xda93('0xa'));var squel=require(_0xda93('0xb'));var crypto=require(_0xda93('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xda93('0xd'));var toCsv=require(_0xda93('0x7'));var querystring=require(_0xda93('0xe'));var Papa=require(_0xda93('0xf'));var Redis=require('ioredis');var authService=require(_0xda93('0x10'));var qs=require(_0xda93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda93('0x12'));var logger=require(_0xda93('0x13'))(_0xda93('0x14'));var utils=require('../../config/utils');var config=require(_0xda93('0x15'));var licenseUtil=require(_0xda93('0x16'));var db=require(_0xda93('0x17'))['db'];function respondWithStatusCode(_0x153a46,_0x1b828f){_0x1b828f=_0x1b828f||0xcc;return function(_0x527a0a){if(_0x527a0a){return _0x153a46[_0xda93('0x18')](_0x1b828f);}return _0x153a46[_0xda93('0x19')](_0x1b828f)[_0xda93('0x1a')]();};}function respondWithResult(_0x56e3b3,_0x32f446){_0x32f446=_0x32f446||0xc8;return function(_0x2e814e){if(_0x2e814e){return _0x56e3b3[_0xda93('0x19')](_0x32f446)[_0xda93('0x1b')](_0x2e814e);}};}function respondWithFilteredResult(_0x17a399,_0x1cee50){return function(_0x535873){if(_0x535873){var _0x2dc4f4=typeof _0x1cee50['offset']==='undefined'&&typeof _0x1cee50[_0xda93('0x1c')]==='undefined';var _0x5b0e5f=_0x535873[_0xda93('0x1d')];var _0x190499=_0x2dc4f4?0x0:_0x1cee50[_0xda93('0x1e')];var _0x3710d0=_0x2dc4f4?_0x535873[_0xda93('0x1d')]:_0x1cee50[_0xda93('0x1e')]+_0x1cee50[_0xda93('0x1c')];var _0x1ada85;if(_0x3710d0>=_0x5b0e5f){_0x3710d0=_0x5b0e5f;_0x1ada85=0xc8;}else{_0x1ada85=0xce;}_0x17a399[_0xda93('0x19')](_0x1ada85);return _0x17a399[_0xda93('0x1f')](_0xda93('0x20'),_0x190499+'-'+_0x3710d0+'/'+_0x5b0e5f)[_0xda93('0x1b')](_0x535873);}return null;};}function patchUpdates(_0x31d2d7){return function(_0x5e8c8e){try{jsonpatch[_0xda93('0x21')](_0x5e8c8e,_0x31d2d7,!![]);}catch(_0xe570a9){return BPromise[_0xda93('0x22')](_0xe570a9);}return _0x5e8c8e[_0xda93('0x23')]();};}function saveUpdates(_0x4f5bc3,_0x50394c){return function(_0x384181){if(_0x384181){return _0x384181[_0xda93('0x24')](_0x4f5bc3)[_0xda93('0x25')](function(_0x16f990){return _0x16f990;});}return null;};}function removeEntity(_0x56e514,_0x43ae66){return function(_0x8e94b8){if(_0x8e94b8){return _0x8e94b8[_0xda93('0x26')]()[_0xda93('0x25')](function(){_0x56e514[_0xda93('0x19')](0xcc)[_0xda93('0x1a')]();});}};}function handleEntityNotFound(_0x5ae62b,_0x46662e){return function(_0x326431){if(!_0x326431){_0x5ae62b[_0xda93('0x18')](0x194);}return _0x326431;};}function handleError(_0x53d950,_0x2c2f0b){_0x2c2f0b=_0x2c2f0b||0x1f4;return function(_0x2d084c){logger[_0xda93('0x27')](_0x2d084c[_0xda93('0x28')]);if(_0x2d084c[_0xda93('0x29')]){delete _0x2d084c[_0xda93('0x29')];}_0x53d950[_0xda93('0x19')](_0x2c2f0b)[_0xda93('0x2a')](_0x2d084c);};}exports[_0xda93('0x2b')]=function(_0x252c5f,_0x38f159){var _0xb026a7={},_0x5dfd11={},_0x337605={'count':0x0,'rows':[]};var _0x339a75=_[_0xda93('0x2c')](db[_0xda93('0x2d')][_0xda93('0x2e')],function(_0x2ce7f7){return{'name':_0x2ce7f7[_0xda93('0x2f')],'type':_0x2ce7f7[_0xda93('0x30')][_0xda93('0x31')]};});_0x5dfd11[_0xda93('0x32')]=_[_0xda93('0x2c')](_0x339a75,_0xda93('0x29'));_0x5dfd11['query']=_[_0xda93('0x33')](_0x252c5f[_0xda93('0x34')]);_0x5dfd11[_0xda93('0x35')]=_[_0xda93('0x36')](_0x5dfd11[_0xda93('0x32')],_0x5dfd11[_0xda93('0x34')]);_0xb026a7[_0xda93('0x37')]=_['intersection'](_0x5dfd11[_0xda93('0x32')],qs['fields'](_0x252c5f[_0xda93('0x34')][_0xda93('0x38')]));_0xb026a7['attributes']=_0xb026a7[_0xda93('0x37')][_0xda93('0x39')]?_0xb026a7[_0xda93('0x37')]:_0x5dfd11[_0xda93('0x32')];if(!_0x252c5f[_0xda93('0x34')][_0xda93('0x3a')]('nolimit')){_0xb026a7[_0xda93('0x1c')]=qs[_0xda93('0x1c')](_0x252c5f['query'][_0xda93('0x1c')]);_0xb026a7[_0xda93('0x1e')]=qs[_0xda93('0x1e')](_0x252c5f[_0xda93('0x34')][_0xda93('0x1e')]);}_0xb026a7[_0xda93('0x3b')]=qs[_0xda93('0x3c')](_0x252c5f[_0xda93('0x34')][_0xda93('0x3c')]);_0xb026a7[_0xda93('0x3d')]=qs['filters'](_[_0xda93('0x3e')](_0x252c5f['query'],_0x5dfd11[_0xda93('0x35')]),_0x339a75);if(_0x252c5f[_0xda93('0x34')][_0xda93('0x3f')]){_0xb026a7[_0xda93('0x3d')]=_[_0xda93('0x40')](_0xb026a7['where'],{'$or':_[_0xda93('0x2c')](_0x339a75,function(_0x1bd729){if(_0x1bd729[_0xda93('0x30')]!==_0xda93('0x41')){var _0x4365d6={};_0x4365d6[_0x1bd729['name']]={'$like':'%'+_0x252c5f[_0xda93('0x34')][_0xda93('0x3f')]+'%'};return _0x4365d6;}})});}_0xb026a7=_['merge']({},_0xb026a7,_0x252c5f[_0xda93('0x42')]);var _0x28b548={'where':_0xb026a7[_0xda93('0x3d')]};return db['DeskConfiguration'][_0xda93('0x1d')](_0x28b548)[_0xda93('0x25')](function(_0x1751fe){_0x337605['count']=_0x1751fe;if(_0x252c5f[_0xda93('0x34')][_0xda93('0x43')]){_0xb026a7[_0xda93('0x44')]=[{'all':!![]}];}return db[_0xda93('0x2d')][_0xda93('0x45')](_0xb026a7);})['then'](function(_0x461fb2){_0x337605[_0xda93('0x46')]=_0x461fb2;return _0x337605;})['then'](respondWithFilteredResult(_0x38f159,_0xb026a7))[_0xda93('0x47')](handleError(_0x38f159,null));};exports['show']=function(_0x20f960,_0x10aa1a){var _0x5cad2a={'raw':![],'where':{'id':_0x20f960['params']['id']}},_0x15c1a7={};_0x15c1a7[_0xda93('0x32')]=_[_0xda93('0x33')](db['DeskConfiguration'][_0xda93('0x2e')]);_0x15c1a7[_0xda93('0x34')]=_[_0xda93('0x33')](_0x20f960[_0xda93('0x34')]);_0x15c1a7[_0xda93('0x35')]=_[_0xda93('0x36')](_0x15c1a7[_0xda93('0x32')],_0x15c1a7[_0xda93('0x34')]);_0x5cad2a[_0xda93('0x37')]=_[_0xda93('0x36')](_0x15c1a7[_0xda93('0x32')],qs[_0xda93('0x38')](_0x20f960[_0xda93('0x34')][_0xda93('0x38')]));_0x5cad2a[_0xda93('0x37')]=_0x5cad2a[_0xda93('0x37')]['length']?_0x5cad2a[_0xda93('0x37')]:_0x15c1a7[_0xda93('0x32')];if(_0x20f960[_0xda93('0x34')]['includeAll']){_0x5cad2a[_0xda93('0x44')]=[{'all':!![]}];}_0x5cad2a=_[_0xda93('0x40')]({},_0x5cad2a,_0x20f960[_0xda93('0x42')]);return db[_0xda93('0x2d')][_0xda93('0x48')](_0x5cad2a)['then'](handleEntityNotFound(_0x10aa1a,null))[_0xda93('0x25')](respondWithResult(_0x10aa1a,null))[_0xda93('0x47')](handleError(_0x10aa1a,null));};exports[_0xda93('0x49')]=function(_0x147582,_0x296042){return db[_0xda93('0x2d')]['create'](_0x147582[_0xda93('0x4a')],{})[_0xda93('0x25')](respondWithResult(_0x296042,0xc9))[_0xda93('0x47')](handleError(_0x296042,null));};exports[_0xda93('0x24')]=function(_0x1e61ae,_0x4c8223){if(_0x1e61ae[_0xda93('0x4a')]['id']){delete _0x1e61ae[_0xda93('0x4a')]['id'];}return db[_0xda93('0x2d')][_0xda93('0x48')]({'where':{'id':_0x1e61ae[_0xda93('0x4b')]['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x4c8223,null))[_0xda93('0x25')](saveUpdates(_0x1e61ae['body'],null))[_0xda93('0x25')](respondWithResult(_0x4c8223,null))[_0xda93('0x47')](handleError(_0x4c8223,null));};exports['destroy']=function(_0x1e8830,_0x4acb96){return db[_0xda93('0x2d')][_0xda93('0x48')]({'where':{'id':_0x1e8830[_0xda93('0x4b')]['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x4acb96,null))['then'](removeEntity(_0x4acb96,null))['catch'](handleError(_0x4acb96,null));};exports[_0xda93('0x4c')]=function(_0x283eed,_0xe154ab,_0x67c124){var _0x4704c8={};var _0x1e2346={};var _0x217cad;var _0x469abb;return db[_0xda93('0x2d')]['findOne']({'where':{'id':_0x283eed[_0xda93('0x4b')]['id']}})[_0xda93('0x25')](handleEntityNotFound(_0xe154ab,null))[_0xda93('0x25')](function(_0x4de2b6){if(_0x4de2b6){_0x217cad=_0x4de2b6;_0x1e2346[_0xda93('0x32')]=_[_0xda93('0x33')](db['DeskField'][_0xda93('0x2e')]);_0x1e2346[_0xda93('0x34')]=_[_0xda93('0x33')](_0x283eed['query']);_0x1e2346[_0xda93('0x35')]=_['intersection'](_0x1e2346[_0xda93('0x32')],_0x1e2346[_0xda93('0x34')]);_0x4704c8[_0xda93('0x37')]=_[_0xda93('0x36')](_0x1e2346[_0xda93('0x32')],qs['fields'](_0x283eed[_0xda93('0x34')]['fields']));_0x4704c8[_0xda93('0x37')]=_0x4704c8[_0xda93('0x37')][_0xda93('0x39')]?_0x4704c8[_0xda93('0x37')]:_0x1e2346[_0xda93('0x32')];_0x4704c8[_0xda93('0x3b')]=qs[_0xda93('0x3c')](_0x283eed[_0xda93('0x34')]['sort']);_0x4704c8[_0xda93('0x3d')]=qs[_0xda93('0x35')](_[_0xda93('0x3e')](_0x283eed[_0xda93('0x34')],_0x1e2346[_0xda93('0x35')]));if(_0x283eed[_0xda93('0x34')][_0xda93('0x3f')]){_0x4704c8['where']=_['merge'](_0x4704c8[_0xda93('0x3d')],{'$or':_[_0xda93('0x2c')](_0x4704c8[_0xda93('0x37')],function(_0x1f9b89){var _0x677766={};_0x677766[_0x1f9b89]={'$like':'%'+_0x283eed['query'][_0xda93('0x3f')]+'%'};return _0x677766;})});}_0x4704c8=_[_0xda93('0x40')]({},_0x4704c8,_0x283eed[_0xda93('0x42')]);return _0x217cad[_0xda93('0x4c')](_0x4704c8);}})[_0xda93('0x25')](function(_0x1a5f33){if(_0x1a5f33){_0x469abb=_0x1a5f33['length'];if(!_0x283eed[_0xda93('0x34')][_0xda93('0x3a')]('nolimit')){_0x4704c8[_0xda93('0x1c')]=qs[_0xda93('0x1c')](_0x283eed[_0xda93('0x34')]['limit']);_0x4704c8[_0xda93('0x1e')]=qs[_0xda93('0x1e')](_0x283eed[_0xda93('0x34')][_0xda93('0x1e')]);}return _0x217cad[_0xda93('0x4c')](_0x4704c8);}})[_0xda93('0x25')](function(_0x209e84){if(_0x209e84){return _0x209e84?{'count':_0x469abb,'rows':_0x209e84}:null;}})[_0xda93('0x25')](respondWithResult(_0xe154ab,null))[_0xda93('0x47')](handleError(_0xe154ab,null));};exports[_0xda93('0x4d')]=function(_0x1f0925,_0x3bb21f,_0x57be94){var _0x39f94b={};var _0x1db82f={};var _0x1664e6;var _0x4c231e;return db[_0xda93('0x2d')][_0xda93('0x4e')]({'where':{'id':_0x1f0925[_0xda93('0x4b')]['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x3bb21f,null))['then'](function(_0x2f503d){if(_0x2f503d){_0x1664e6=_0x2f503d;_0x1db82f['model']=_[_0xda93('0x33')](db[_0xda93('0x4f')][_0xda93('0x2e')]);_0x1db82f['query']=_[_0xda93('0x33')](_0x1f0925[_0xda93('0x34')]);_0x1db82f[_0xda93('0x35')]=_[_0xda93('0x36')](_0x1db82f[_0xda93('0x32')],_0x1db82f[_0xda93('0x34')]);_0x39f94b[_0xda93('0x37')]=_[_0xda93('0x36')](_0x1db82f['model'],qs[_0xda93('0x38')](_0x1f0925[_0xda93('0x34')][_0xda93('0x38')]));_0x39f94b[_0xda93('0x37')]=_0x39f94b[_0xda93('0x37')][_0xda93('0x39')]?_0x39f94b[_0xda93('0x37')]:_0x1db82f['model'];_0x39f94b[_0xda93('0x3b')]=qs[_0xda93('0x3c')](_0x1f0925[_0xda93('0x34')][_0xda93('0x3c')]);_0x39f94b[_0xda93('0x3d')]=qs[_0xda93('0x35')](_[_0xda93('0x3e')](_0x1f0925['query'],_0x1db82f['filters']));if(_0x1f0925['query'][_0xda93('0x3f')]){_0x39f94b['where']=_[_0xda93('0x40')](_0x39f94b[_0xda93('0x3d')],{'$or':_[_0xda93('0x2c')](_0x39f94b[_0xda93('0x37')],function(_0x183c42){var _0xe2aa50={};_0xe2aa50[_0x183c42]={'$like':'%'+_0x1f0925[_0xda93('0x34')][_0xda93('0x3f')]+'%'};return _0xe2aa50;})});}_0x39f94b=_[_0xda93('0x40')]({},_0x39f94b,_0x1f0925[_0xda93('0x42')]);return _0x1664e6['getSubjects'](_0x39f94b);}})[_0xda93('0x25')](function(_0xf40f2a){if(_0xf40f2a){_0x4c231e=_0xf40f2a[_0xda93('0x39')];if(!_0x1f0925[_0xda93('0x34')]['hasOwnProperty'](_0xda93('0x50'))){_0x39f94b[_0xda93('0x1c')]=qs[_0xda93('0x1c')](_0x1f0925[_0xda93('0x34')]['limit']);_0x39f94b[_0xda93('0x1e')]=qs['offset'](_0x1f0925[_0xda93('0x34')][_0xda93('0x1e')]);}return _0x1664e6['getSubjects'](_0x39f94b);}})[_0xda93('0x25')](function(_0x2906e1){if(_0x2906e1){return _0x2906e1?{'count':_0x4c231e,'rows':_0x2906e1}:null;}})[_0xda93('0x25')](respondWithResult(_0x3bb21f,null))['catch'](handleError(_0x3bb21f,null));};exports[_0xda93('0x51')]=function(_0x3f00c7,_0x441722,_0x324e8c){var _0x4fa09c={};var _0x2bf362={};var _0x4e804a;var _0x540063;return db[_0xda93('0x2d')][_0xda93('0x4e')]({'where':{'id':_0x3f00c7[_0xda93('0x4b')]['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x441722,null))['then'](function(_0x5191f8){if(_0x5191f8){_0x4e804a=_0x5191f8;_0x2bf362[_0xda93('0x32')]=_[_0xda93('0x33')](db['DeskField'][_0xda93('0x2e')]);_0x2bf362[_0xda93('0x34')]=_[_0xda93('0x33')](_0x3f00c7[_0xda93('0x34')]);_0x2bf362[_0xda93('0x35')]=_[_0xda93('0x36')](_0x2bf362['model'],_0x2bf362[_0xda93('0x34')]);_0x4fa09c[_0xda93('0x37')]=_['intersection'](_0x2bf362['model'],qs[_0xda93('0x38')](_0x3f00c7[_0xda93('0x34')][_0xda93('0x38')]));_0x4fa09c[_0xda93('0x37')]=_0x4fa09c[_0xda93('0x37')][_0xda93('0x39')]?_0x4fa09c[_0xda93('0x37')]:_0x2bf362['model'];_0x4fa09c[_0xda93('0x3b')]=qs[_0xda93('0x3c')](_0x3f00c7[_0xda93('0x34')]['sort']);_0x4fa09c[_0xda93('0x3d')]=qs[_0xda93('0x35')](_[_0xda93('0x3e')](_0x3f00c7['query'],_0x2bf362[_0xda93('0x35')]));if(_0x3f00c7[_0xda93('0x34')][_0xda93('0x3f')]){_0x4fa09c[_0xda93('0x3d')]=_[_0xda93('0x40')](_0x4fa09c[_0xda93('0x3d')],{'$or':_[_0xda93('0x2c')](_0x4fa09c[_0xda93('0x37')],function(_0x2c310f){var _0x190355={};_0x190355[_0x2c310f]={'$like':'%'+_0x3f00c7[_0xda93('0x34')][_0xda93('0x3f')]+'%'};return _0x190355;})});}_0x4fa09c=_[_0xda93('0x40')]({},_0x4fa09c,_0x3f00c7[_0xda93('0x42')]);return _0x4e804a['getDescriptions'](_0x4fa09c);}})[_0xda93('0x25')](function(_0x54fb0e){if(_0x54fb0e){_0x540063=_0x54fb0e['length'];if(!_0x3f00c7[_0xda93('0x34')]['hasOwnProperty'](_0xda93('0x50'))){_0x4fa09c['limit']=qs[_0xda93('0x1c')](_0x3f00c7[_0xda93('0x34')]['limit']);_0x4fa09c['offset']=qs[_0xda93('0x1e')](_0x3f00c7[_0xda93('0x34')][_0xda93('0x1e')]);}return _0x4e804a[_0xda93('0x51')](_0x4fa09c);}})[_0xda93('0x25')](function(_0x26f74a){if(_0x26f74a){return _0x26f74a?{'count':_0x540063,'rows':_0x26f74a}:null;}})[_0xda93('0x25')](respondWithResult(_0x441722,null))['catch'](handleError(_0x441722,null));};exports[_0xda93('0x52')]=function(_0xa6ec9b,_0x3df4b5,_0x5a583b){var _0x5f8f23={};var _0x99a7d2={};var _0x35c789;var _0x8a19a5;return db[_0xda93('0x2d')][_0xda93('0x4e')]({'where':{'id':_0xa6ec9b['params']['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x3df4b5,null))[_0xda93('0x25')](function(_0x2a8a0f){if(_0x2a8a0f){_0x35c789=_0x2a8a0f;_0x99a7d2['model']=_['keys'](db[_0xda93('0x53')]['rawAttributes']);_0x99a7d2['query']=_[_0xda93('0x33')](_0xa6ec9b[_0xda93('0x34')]);_0x99a7d2[_0xda93('0x35')]=_['intersection'](_0x99a7d2[_0xda93('0x32')],_0x99a7d2[_0xda93('0x34')]);_0x5f8f23[_0xda93('0x37')]=_[_0xda93('0x36')](_0x99a7d2['model'],qs['fields'](_0xa6ec9b[_0xda93('0x34')][_0xda93('0x38')]));_0x5f8f23[_0xda93('0x37')]=_0x5f8f23['attributes'][_0xda93('0x39')]?_0x5f8f23[_0xda93('0x37')]:_0x99a7d2['model'];_0x5f8f23[_0xda93('0x3b')]=qs[_0xda93('0x3c')](_0xa6ec9b[_0xda93('0x34')][_0xda93('0x3c')]);_0x5f8f23[_0xda93('0x3d')]=qs['filters'](_[_0xda93('0x3e')](_0xa6ec9b[_0xda93('0x34')],_0x99a7d2[_0xda93('0x35')]));if(_0xa6ec9b['query'][_0xda93('0x3f')]){_0x5f8f23['where']=_['merge'](_0x5f8f23['where'],{'$or':_[_0xda93('0x2c')](_0x5f8f23['attributes'],function(_0x33781e){var _0x417576={};_0x417576[_0x33781e]={'$like':'%'+_0xa6ec9b['query']['filter']+'%'};return _0x417576;})});}_0x5f8f23=_['merge']({},_0x5f8f23,_0xa6ec9b['options']);return _0x35c789[_0xda93('0x52')](_0x5f8f23);}})[_0xda93('0x25')](function(_0x2f60f8){if(_0x2f60f8){_0x8a19a5=_0x2f60f8['length'];if(!_0xa6ec9b[_0xda93('0x34')][_0xda93('0x3a')](_0xda93('0x50'))){_0x5f8f23[_0xda93('0x1c')]=qs[_0xda93('0x1c')](_0xa6ec9b[_0xda93('0x34')][_0xda93('0x1c')]);_0x5f8f23[_0xda93('0x1e')]=qs['offset'](_0xa6ec9b[_0xda93('0x34')][_0xda93('0x1e')]);}return _0x35c789[_0xda93('0x52')](_0x5f8f23);}})[_0xda93('0x25')](function(_0x45da35){if(_0x45da35){return _0x45da35?{'count':_0x8a19a5,'rows':_0x45da35}:null;}})[_0xda93('0x25')](respondWithResult(_0x3df4b5,null))[_0xda93('0x47')](handleError(_0x3df4b5,null));};exports[_0xda93('0x54')]=function(_0xd3d7b,_0x5701ea,_0x12ed75){if(_0xd3d7b[_0xda93('0x4a')]['id']){delete _0xd3d7b[_0xda93('0x4a')]['id'];}return db[_0xda93('0x2d')][_0xda93('0x4e')]({'where':{'id':_0xd3d7b['params']['id']}})[_0xda93('0x25')](handleEntityNotFound(_0x5701ea,null))[_0xda93('0x25')](function(_0x3d3c3b){if(_0x3d3c3b){return _0x3d3c3b[_0xda93('0x54')](_0xd3d7b[_0xda93('0x4a')][_0xda93('0x55')]||[]);}return null;})['then'](respondWithResult(_0x5701ea,null))[_0xda93('0x47')](handleError(_0x5701ea,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f390089..a7148e6 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 _0xbe5b=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','rimraf','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbe5b,0x199));var _0xbbe5=function(_0x3472b5,_0x41d633){_0x3472b5=_0x3472b5-0x0;var _0x3c628a=_0xbe5b[_0x3472b5];return _0x3c628a;};'use strict';var _=require(_0xbbe5('0x0'));var util=require(_0xbbe5('0x1'));var logger=require('../../config/logger')(_0xbbe5('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(_0xbbe5('0x3'));var config=require(_0xbbe5('0x4'));var attributes=require('./intDeskConfiguration.attributes');module[_0xbbe5('0x5')]=function(_0x189288,_0x476d5b){return _0x189288[_0xbbe5('0x6')](_0xbbe5('0x7'),attributes,{'tableName':_0xbbe5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fd9=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration'];(function(_0x5571aa,_0x3446bc){var _0xbf4c5f=function(_0x57c300){while(--_0x57c300){_0x5571aa['push'](_0x5571aa['shift']());}};_0xbf4c5f(++_0x3446bc);}(_0x1fd9,0x1b8));var _0x91fd=function(_0x5a2231,_0x3804db){_0x5a2231=_0x5a2231-0x0;var _0x45cbf4=_0x1fd9[_0x5a2231];return _0x45cbf4;};'use strict';var _=require('lodash');var util=require(_0x91fd('0x0'));var logger=require('../../config/logger')(_0x91fd('0x1'));var moment=require(_0x91fd('0x2'));var BPromise=require(_0x91fd('0x3'));var rp=require(_0x91fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91fd('0x5'));var config=require(_0x91fd('0x6'));var attributes=require(_0x91fd('0x7'));module['exports']=function(_0x50f4cc,_0x3caccd){return _0x50f4cc[_0x91fd('0x8')](_0x91fd('0x9'),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 6f58bdf..812868d 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 _0x20d8=['stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x16c8fc,_0x197778){var _0x34ce69=function(_0x4df72b){while(--_0x4df72b){_0x16c8fc['push'](_0x16c8fc['shift']());}};_0x34ce69(++_0x197778);}(_0x20d8,0xee));var _0x820d=function(_0x144d5b,_0xc6249f){_0x144d5b=_0x144d5b-0x0;var _0xccdcf4=_0x20d8[_0x144d5b];return _0xccdcf4;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});} \ No newline at end of file +var _0x4892=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x33da1e,_0xe5c45c){var _0x36317b=function(_0x5a6914){while(--_0x5a6914){_0x33da1e['push'](_0x33da1e['shift']());}};_0x36317b(++_0xe5c45c);}(_0x4892,0x1cd));var _0x2489=function(_0x4f6675,_0x4c5841){_0x4f6675=_0x4f6675-0x0;var _0x263145=_0x4892[_0x4f6675];return _0x263145;};'use strict';var _=require(_0x2489('0x0'));var util=require(_0x2489('0x1'));var moment=require('moment');var BPromise=require(_0x2489('0x2'));var rs=require(_0x2489('0x3'));var fs=require('fs');var Redis=require(_0x2489('0x4'));var db=require(_0x2489('0x5'))['db'];var utils=require(_0x2489('0x6'));var logger=require(_0x2489('0x7'))(_0x2489('0x8'));var config=require('../../config/environment');var jayson=require(_0x2489('0x9'));var client=jayson[_0x2489('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24ee8a,_0x196406,_0x369a5d){return new BPromise(function(_0x25a7d6,_0x703769){return client['request'](_0x24ee8a,_0x369a5d)[_0x2489('0xb')](function(_0x4e0e7c){logger['info'](_0x2489('0xc'),_0x196406,_0x2489('0xd'));logger['debug'](_0x2489('0xe'),_0x196406,_0x2489('0xd'),JSON[_0x2489('0xf')](_0x4e0e7c));if(_0x4e0e7c['error']){if(_0x4e0e7c['error'][_0x2489('0x10')]===0x1f4){logger[_0x2489('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x196406,_0x4e0e7c[_0x2489('0x11')]['message']);return _0x703769(_0x4e0e7c[_0x2489('0x11')][_0x2489('0x12')]);}logger[_0x2489('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x196406,_0x4e0e7c[_0x2489('0x11')][_0x2489('0x12')]);return _0x25a7d6(_0x4e0e7c['error'][_0x2489('0x12')]);}else{logger[_0x2489('0x13')](_0x2489('0xc'),_0x196406,'request\x20sent');_0x25a7d6(_0x4e0e7c[_0x2489('0x14')][_0x2489('0x12')]);}})[_0x2489('0x15')](function(_0x18cbc8){logger[_0x2489('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x196406,_0x18cbc8);_0x703769(_0x18cbc8);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e3f746e..f796629 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 _0x25a8=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','multer'];(function(_0x3f4bb0,_0x13821e){var _0x5b316a=function(_0x12c027){while(--_0x12c027){_0x3f4bb0['push'](_0x3f4bb0['shift']());}};_0x5b316a(++_0x13821e);}(_0x25a8,0x18b));var _0x825a=function(_0x4d2916,_0x479ece){_0x4d2916=_0x4d2916-0x0;var _0x2ee767=_0x25a8[_0x4d2916];return _0x2ee767;};'use strict';var multer=require(_0x825a('0x0'));var util=require('util');var path=require(_0x825a('0x1'));var timeout=require(_0x825a('0x2'));var express=require(_0x825a('0x3'));var router=express['Router']();var fs_extra=require(_0x825a('0x4'));var auth=require(_0x825a('0x5'));var interaction=require(_0x825a('0x6'));var config=require(_0x825a('0x7'));var controller=require('./intDeskField.controller');router[_0x825a('0x8')]('/',auth[_0x825a('0x9')](),controller[_0x825a('0xa')]);router['get']('/:id',auth[_0x825a('0x9')](),controller[_0x825a('0xb')]);router[_0x825a('0xc')]('/',auth[_0x825a('0x9')](),controller[_0x825a('0xd')]);router['put'](_0x825a('0xe'),auth[_0x825a('0x9')](),controller[_0x825a('0xf')]);router[_0x825a('0x10')](_0x825a('0xe'),auth[_0x825a('0x9')](),controller[_0x825a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x743e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x743e,0x1c1));var _0xe743=function(_0x324152,_0x5597e5){_0x324152=_0x324152-0x0;var _0x5cd2e4=_0x743e[_0x324152];return _0x5cd2e4;};'use strict';var multer=require(_0xe743('0x0'));var util=require(_0xe743('0x1'));var path=require(_0xe743('0x2'));var timeout=require(_0xe743('0x3'));var express=require(_0xe743('0x4'));var router=express[_0xe743('0x5')]();var fs_extra=require(_0xe743('0x6'));var auth=require(_0xe743('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe743('0x8'));var controller=require('./intDeskField.controller');router[_0xe743('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe743('0x9')](_0xe743('0xa'),auth[_0xe743('0xb')](),controller[_0xe743('0xc')]);router['post']('/',auth[_0xe743('0xb')](),controller[_0xe743('0xd')]);router['put'](_0xe743('0xa'),auth[_0xe743('0xb')](),controller[_0xe743('0xe')]);router[_0xe743('0xf')]('/:id',auth[_0xe743('0xb')](),controller[_0xe743('0x10')]);module[_0xe743('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e3cd766..05b8a83 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 _0x59d6=['exports','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x13a013,_0x4c4894){var _0x103bb7=function(_0x411f48){while(--_0x411f48){_0x13a013['push'](_0x13a013['shift']());}};_0x103bb7(++_0x4c4894);}(_0x59d6,0x1ef));var _0x659d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x59d6[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x659d('0x0'));module[_0x659d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x659d('0x2'),_0x659d('0x3'),_0x659d('0x4'),_0x659d('0x5'),_0x659d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x659d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x659d('0x2'),'variable',_0x659d('0x4'))},'keyContent':{'type':Sequelize[_0x659d('0x7')]},'idField':{'type':Sequelize[_0x659d('0x7')]},'nameField':{'type':Sequelize[_0x659d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x659d('0x7')]}}; \ No newline at end of file +var _0x8f4d=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x8f4d,0x1c3));var _0xd8f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f4d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd8f4('0x0'));module[_0xd8f4('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd8f4('0x2'),_0xd8f4('0x3'),'customVariable',_0xd8f4('0x4'),_0xd8f4('0x5')),'defaultValue':_0xd8f4('0x2')},'content':{'type':Sequelize[_0xd8f4('0x6')]},'key':{'type':Sequelize[_0xd8f4('0x6')]},'keyType':{'type':Sequelize[_0xd8f4('0x7')](_0xd8f4('0x2'),_0xd8f4('0x3'),_0xd8f4('0x8'))},'keyContent':{'type':Sequelize[_0xd8f4('0x6')]},'idField':{'type':Sequelize[_0xd8f4('0x6')]},'nameField':{'type':Sequelize[_0xd8f4('0x6')]},'customField':{'type':Sequelize[_0xd8f4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd8f4('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index be36641..d05867f 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 _0x1365=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','send','index','map','DeskField','fieldName','name','query','keys','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1365,0x1a4));var _0x5136=function(_0x220f8,_0x4e159e){_0x220f8=_0x220f8-0x0;var _0x5e678e=_0x1365[_0x220f8];return _0x5e678e;};'use strict';var emlformat=require(_0x5136('0x0'));var rimraf=require(_0x5136('0x1'));var zipdir=require(_0x5136('0x2'));var jsonpatch=require(_0x5136('0x3'));var rp=require(_0x5136('0x4'));var moment=require(_0x5136('0x5'));var BPromise=require(_0x5136('0x6'));var Mustache=require(_0x5136('0x7'));var util=require(_0x5136('0x8'));var path=require(_0x5136('0x9'));var sox=require('sox');var csv=require(_0x5136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5136('0xb'));var squel=require('squel');var crypto=require(_0x5136('0xc'));var jsforce=require(_0x5136('0xd'));var deskjs=require(_0x5136('0xe'));var toCsv=require(_0x5136('0xa'));var querystring=require(_0x5136('0xf'));var Papa=require(_0x5136('0x10'));var Redis=require('ioredis');var authService=require(_0x5136('0x11'));var qs=require(_0x5136('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5136('0x13'));var logger=require('../../config/logger')(_0x5136('0x14'));var utils=require(_0x5136('0x15'));var config=require(_0x5136('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5136('0x17'))['db'];function respondWithStatusCode(_0x44e4b7,_0x1cdd4a){_0x1cdd4a=_0x1cdd4a||0xcc;return function(_0x25e2bb){if(_0x25e2bb){return _0x44e4b7[_0x5136('0x18')](_0x1cdd4a);}return _0x44e4b7[_0x5136('0x19')](_0x1cdd4a)[_0x5136('0x1a')]();};}function respondWithResult(_0x263978,_0x48350d){_0x48350d=_0x48350d||0xc8;return function(_0x59fe56){if(_0x59fe56){return _0x263978['status'](_0x48350d)['json'](_0x59fe56);}};}function respondWithFilteredResult(_0x462844,_0x519e66){return function(_0x49e37e){if(_0x49e37e){var _0x577772=typeof _0x519e66[_0x5136('0x1b')]===_0x5136('0x1c')&&typeof _0x519e66[_0x5136('0x1d')]===_0x5136('0x1c');var _0x1f0e19=_0x49e37e[_0x5136('0x1e')];var _0x2f509d=_0x577772?0x0:_0x519e66['offset'];var _0x18b3c7=_0x577772?_0x49e37e['count']:_0x519e66[_0x5136('0x1b')]+_0x519e66[_0x5136('0x1d')];var _0x56b054;if(_0x18b3c7>=_0x1f0e19){_0x18b3c7=_0x1f0e19;_0x56b054=0xc8;}else{_0x56b054=0xce;}_0x462844[_0x5136('0x19')](_0x56b054);return _0x462844['set']('Content-Range',_0x2f509d+'-'+_0x18b3c7+'/'+_0x1f0e19)['json'](_0x49e37e);}return null;};}function patchUpdates(_0x76a12e){return function(_0x5b701f){try{jsonpatch[_0x5136('0x1f')](_0x5b701f,_0x76a12e,!![]);}catch(_0x5cfd2e){return BPromise['reject'](_0x5cfd2e);}return _0x5b701f[_0x5136('0x20')]();};}function saveUpdates(_0x264c85,_0x4f0168){return function(_0x5af5a1){if(_0x5af5a1){return _0x5af5a1[_0x5136('0x21')](_0x264c85)[_0x5136('0x22')](function(_0x5abdd8){return _0x5abdd8;});}return null;};}function removeEntity(_0x1a3f4e,_0x30b656){return function(_0xab029c){if(_0xab029c){return _0xab029c[_0x5136('0x23')]()[_0x5136('0x22')](function(){_0x1a3f4e[_0x5136('0x19')](0xcc)[_0x5136('0x1a')]();});}};}function handleEntityNotFound(_0x5d0e9e,_0x404c94){return function(_0x57e76e){if(!_0x57e76e){_0x5d0e9e[_0x5136('0x18')](0x194);}return _0x57e76e;};}function handleError(_0x5187a0,_0x10d5bf){_0x10d5bf=_0x10d5bf||0x1f4;return function(_0x3f39e4){logger[_0x5136('0x24')](_0x3f39e4[_0x5136('0x25')]);if(_0x3f39e4['name']){delete _0x3f39e4['name'];}_0x5187a0[_0x5136('0x19')](_0x10d5bf)[_0x5136('0x26')](_0x3f39e4);};}exports[_0x5136('0x27')]=function(_0x221693,_0x15a8de){var _0x3e59ca={},_0x3a4f94={},_0x1a1ec4={'count':0x0,'rows':[]};var _0x1bc724=_[_0x5136('0x28')](db[_0x5136('0x29')]['rawAttributes'],function(_0x4e699d){return{'name':_0x4e699d[_0x5136('0x2a')],'type':_0x4e699d['type']['key']};});_0x3a4f94['model']=_[_0x5136('0x28')](_0x1bc724,_0x5136('0x2b'));_0x3a4f94[_0x5136('0x2c')]=_[_0x5136('0x2d')](_0x221693[_0x5136('0x2c')]);_0x3a4f94['filters']=_['intersection'](_0x3a4f94['model'],_0x3a4f94[_0x5136('0x2c')]);_0x3e59ca['attributes']=_['intersection'](_0x3a4f94['model'],qs[_0x5136('0x2e')](_0x221693['query']['fields']));_0x3e59ca[_0x5136('0x2f')]=_0x3e59ca[_0x5136('0x2f')][_0x5136('0x30')]?_0x3e59ca['attributes']:_0x3a4f94[_0x5136('0x31')];if(!_0x221693[_0x5136('0x2c')][_0x5136('0x32')](_0x5136('0x33'))){_0x3e59ca['limit']=qs[_0x5136('0x1d')](_0x221693[_0x5136('0x2c')][_0x5136('0x1d')]);_0x3e59ca[_0x5136('0x1b')]=qs['offset'](_0x221693[_0x5136('0x2c')][_0x5136('0x1b')]);}_0x3e59ca[_0x5136('0x34')]=qs[_0x5136('0x35')](_0x221693[_0x5136('0x2c')][_0x5136('0x35')]);_0x3e59ca[_0x5136('0x36')]=qs['filters'](_[_0x5136('0x37')](_0x221693['query'],_0x3a4f94[_0x5136('0x38')]),_0x1bc724);if(_0x221693[_0x5136('0x2c')][_0x5136('0x39')]){_0x3e59ca['where']=_[_0x5136('0x3a')](_0x3e59ca[_0x5136('0x36')],{'$or':_[_0x5136('0x28')](_0x1bc724,function(_0x49b10e){if(_0x49b10e[_0x5136('0x3b')]!==_0x5136('0x3c')){var _0x21656b={};_0x21656b[_0x49b10e[_0x5136('0x2b')]]={'$like':'%'+_0x221693[_0x5136('0x2c')][_0x5136('0x39')]+'%'};return _0x21656b;}})});}_0x3e59ca=_[_0x5136('0x3a')]({},_0x3e59ca,_0x221693[_0x5136('0x3d')]);var _0x1f1eb8={'where':_0x3e59ca[_0x5136('0x36')]};return db[_0x5136('0x29')]['count'](_0x1f1eb8)[_0x5136('0x22')](function(_0xf06fb){_0x1a1ec4['count']=_0xf06fb;if(_0x221693[_0x5136('0x2c')][_0x5136('0x3e')]){_0x3e59ca['include']=[{'all':!![]}];}return db[_0x5136('0x29')][_0x5136('0x3f')](_0x3e59ca);})[_0x5136('0x22')](function(_0x23a9fb){_0x1a1ec4[_0x5136('0x40')]=_0x23a9fb;return _0x1a1ec4;})[_0x5136('0x22')](respondWithFilteredResult(_0x15a8de,_0x3e59ca))[_0x5136('0x41')](handleError(_0x15a8de,null));};exports[_0x5136('0x42')]=function(_0x2ab73b,_0x3bcf25){var _0x2bd409={'raw':!![],'where':{'id':_0x2ab73b[_0x5136('0x43')]['id']}},_0x31359b={};_0x31359b['model']=_['keys'](db['DeskField'][_0x5136('0x44')]);_0x31359b['query']=_[_0x5136('0x2d')](_0x2ab73b['query']);_0x31359b[_0x5136('0x38')]=_['intersection'](_0x31359b[_0x5136('0x31')],_0x31359b[_0x5136('0x2c')]);_0x2bd409[_0x5136('0x2f')]=_[_0x5136('0x45')](_0x31359b[_0x5136('0x31')],qs[_0x5136('0x2e')](_0x2ab73b['query'][_0x5136('0x2e')]));_0x2bd409[_0x5136('0x2f')]=_0x2bd409[_0x5136('0x2f')]['length']?_0x2bd409[_0x5136('0x2f')]:_0x31359b[_0x5136('0x31')];if(_0x2ab73b[_0x5136('0x2c')]['includeAll']){_0x2bd409['include']=[{'all':!![]}];}_0x2bd409=_['merge']({},_0x2bd409,_0x2ab73b[_0x5136('0x3d')]);return db[_0x5136('0x29')][_0x5136('0x46')](_0x2bd409)[_0x5136('0x22')](handleEntityNotFound(_0x3bcf25,null))[_0x5136('0x22')](respondWithResult(_0x3bcf25,null))[_0x5136('0x41')](handleError(_0x3bcf25,null));};exports[_0x5136('0x47')]=function(_0x402333,_0x4e235a){return db[_0x5136('0x29')][_0x5136('0x47')](_0x402333[_0x5136('0x48')],{})['then'](respondWithResult(_0x4e235a,0xc9))['catch'](handleError(_0x4e235a,null));};exports[_0x5136('0x21')]=function(_0x3b4bc0,_0x3fd844){if(_0x3b4bc0['body']['id']){delete _0x3b4bc0[_0x5136('0x48')]['id'];}return db[_0x5136('0x29')]['find']({'where':{'id':_0x3b4bc0[_0x5136('0x43')]['id']}})[_0x5136('0x22')](handleEntityNotFound(_0x3fd844,null))[_0x5136('0x22')](saveUpdates(_0x3b4bc0['body'],null))[_0x5136('0x22')](respondWithResult(_0x3fd844,null))[_0x5136('0x41')](handleError(_0x3fd844,null));};exports[_0x5136('0x23')]=function(_0x5a5bdb,_0x141bdf){return db[_0x5136('0x29')]['find']({'where':{'id':_0x5a5bdb['params']['id']}})[_0x5136('0x22')](handleEntityNotFound(_0x141bdf,null))[_0x5136('0x22')](removeEntity(_0x141bdf,null))['catch'](handleError(_0x141bdf,null));}; \ No newline at end of file +var _0xc84c=['catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','error','stack','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','includeAll','include'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0xc84c,0x12f));var _0xcc84=function(_0x5313fa,_0x7242c5){_0x5313fa=_0x5313fa-0x0;var _0x5bac88=_0xc84c[_0x5313fa];return _0x5bac88;};'use strict';var emlformat=require(_0xcc84('0x0'));var rimraf=require(_0xcc84('0x1'));var zipdir=require(_0xcc84('0x2'));var jsonpatch=require(_0xcc84('0x3'));var rp=require(_0xcc84('0x4'));var moment=require('moment');var BPromise=require(_0xcc84('0x5'));var Mustache=require('mustache');var util=require(_0xcc84('0x6'));var path=require(_0xcc84('0x7'));var sox=require(_0xcc84('0x8'));var csv=require('to-csv');var ejs=require(_0xcc84('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc84('0xa'));var squel=require('squel');var crypto=require(_0xcc84('0xb'));var jsforce=require(_0xcc84('0xc'));var deskjs=require(_0xcc84('0xd'));var toCsv=require(_0xcc84('0xe'));var querystring=require(_0xcc84('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcc84('0x10'));var qs=require(_0xcc84('0x11'));var as=require(_0xcc84('0x12'));var hardwareService=require(_0xcc84('0x13'));var logger=require(_0xcc84('0x14'))(_0xcc84('0x15'));var utils=require(_0xcc84('0x16'));var config=require(_0xcc84('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc84('0x18'))['db'];function respondWithStatusCode(_0x4c4bd5,_0x38f06f){_0x38f06f=_0x38f06f||0xcc;return function(_0x864f52){if(_0x864f52){return _0x4c4bd5[_0xcc84('0x19')](_0x38f06f);}return _0x4c4bd5['status'](_0x38f06f)[_0xcc84('0x1a')]();};}function respondWithResult(_0x5277a0,_0x4f4de4){_0x4f4de4=_0x4f4de4||0xc8;return function(_0x4cb3c0){if(_0x4cb3c0){return _0x5277a0['status'](_0x4f4de4)[_0xcc84('0x1b')](_0x4cb3c0);}};}function respondWithFilteredResult(_0x1f2b46,_0x1dd497){return function(_0x2014be){if(_0x2014be){var _0x2ad3cb=typeof _0x1dd497[_0xcc84('0x1c')]===_0xcc84('0x1d')&&typeof _0x1dd497[_0xcc84('0x1e')]===_0xcc84('0x1d');var _0x19d27c=_0x2014be[_0xcc84('0x1f')];var _0x27b4f3=_0x2ad3cb?0x0:_0x1dd497['offset'];var _0x5d4af5=_0x2ad3cb?_0x2014be[_0xcc84('0x1f')]:_0x1dd497['offset']+_0x1dd497[_0xcc84('0x1e')];var _0x550a10;if(_0x5d4af5>=_0x19d27c){_0x5d4af5=_0x19d27c;_0x550a10=0xc8;}else{_0x550a10=0xce;}_0x1f2b46[_0xcc84('0x20')](_0x550a10);return _0x1f2b46[_0xcc84('0x21')](_0xcc84('0x22'),_0x27b4f3+'-'+_0x5d4af5+'/'+_0x19d27c)['json'](_0x2014be);}return null;};}function patchUpdates(_0x4b3448){return function(_0x3a2bd6){try{jsonpatch[_0xcc84('0x23')](_0x3a2bd6,_0x4b3448,!![]);}catch(_0x2988e1){return BPromise[_0xcc84('0x24')](_0x2988e1);}return _0x3a2bd6['save']();};}function saveUpdates(_0x63ef29,_0x15f61c){return function(_0x2b13df){if(_0x2b13df){return _0x2b13df[_0xcc84('0x25')](_0x63ef29)[_0xcc84('0x26')](function(_0x65984){return _0x65984;});}return null;};}function removeEntity(_0x585ae5,_0x5c577b){return function(_0x429459){if(_0x429459){return _0x429459['destroy']()[_0xcc84('0x26')](function(){_0x585ae5[_0xcc84('0x20')](0xcc)[_0xcc84('0x1a')]();});}};}function handleEntityNotFound(_0x9837e2,_0x589e1f){return function(_0x3ca30d){if(!_0x3ca30d){_0x9837e2[_0xcc84('0x19')](0x194);}return _0x3ca30d;};}function handleError(_0x1a08a9,_0x296f6b){_0x296f6b=_0x296f6b||0x1f4;return function(_0x28d87a){logger[_0xcc84('0x27')](_0x28d87a[_0xcc84('0x28')]);if(_0x28d87a['name']){delete _0x28d87a['name'];}_0x1a08a9[_0xcc84('0x20')](_0x296f6b)[_0xcc84('0x29')](_0x28d87a);};}exports[_0xcc84('0x2a')]=function(_0x5357a7,_0x1ad165){var _0x2053ef={},_0x436e7b={},_0x9fb95c={'count':0x0,'rows':[]};var _0x3b5293=_[_0xcc84('0x2b')](db[_0xcc84('0x2c')][_0xcc84('0x2d')],function(_0xf54fe8){return{'name':_0xf54fe8[_0xcc84('0x2e')],'type':_0xf54fe8[_0xcc84('0x2f')][_0xcc84('0x30')]};});_0x436e7b[_0xcc84('0x31')]=_[_0xcc84('0x2b')](_0x3b5293,_0xcc84('0x32'));_0x436e7b[_0xcc84('0x33')]=_[_0xcc84('0x34')](_0x5357a7[_0xcc84('0x33')]);_0x436e7b[_0xcc84('0x35')]=_[_0xcc84('0x36')](_0x436e7b[_0xcc84('0x31')],_0x436e7b[_0xcc84('0x33')]);_0x2053ef[_0xcc84('0x37')]=_[_0xcc84('0x36')](_0x436e7b[_0xcc84('0x31')],qs[_0xcc84('0x38')](_0x5357a7[_0xcc84('0x33')]['fields']));_0x2053ef['attributes']=_0x2053ef['attributes'][_0xcc84('0x39')]?_0x2053ef[_0xcc84('0x37')]:_0x436e7b[_0xcc84('0x31')];if(!_0x5357a7[_0xcc84('0x33')]['hasOwnProperty'](_0xcc84('0x3a'))){_0x2053ef[_0xcc84('0x1e')]=qs[_0xcc84('0x1e')](_0x5357a7['query'][_0xcc84('0x1e')]);_0x2053ef[_0xcc84('0x1c')]=qs['offset'](_0x5357a7[_0xcc84('0x33')][_0xcc84('0x1c')]);}_0x2053ef[_0xcc84('0x3b')]=qs[_0xcc84('0x3c')](_0x5357a7['query']['sort']);_0x2053ef[_0xcc84('0x3d')]=qs['filters'](_[_0xcc84('0x3e')](_0x5357a7[_0xcc84('0x33')],_0x436e7b[_0xcc84('0x35')]),_0x3b5293);if(_0x5357a7['query']['filter']){_0x2053ef[_0xcc84('0x3d')]=_[_0xcc84('0x3f')](_0x2053ef[_0xcc84('0x3d')],{'$or':_[_0xcc84('0x2b')](_0x3b5293,function(_0x2534de){if(_0x2534de[_0xcc84('0x2f')]!=='VIRTUAL'){var _0x2f1b9e={};_0x2f1b9e[_0x2534de[_0xcc84('0x32')]]={'$like':'%'+_0x5357a7['query']['filter']+'%'};return _0x2f1b9e;}})});}_0x2053ef=_[_0xcc84('0x3f')]({},_0x2053ef,_0x5357a7[_0xcc84('0x40')]);var _0x1c5780={'where':_0x2053ef[_0xcc84('0x3d')]};return db[_0xcc84('0x2c')]['count'](_0x1c5780)[_0xcc84('0x26')](function(_0x2cff5a){_0x9fb95c[_0xcc84('0x1f')]=_0x2cff5a;if(_0x5357a7[_0xcc84('0x33')][_0xcc84('0x41')]){_0x2053ef[_0xcc84('0x42')]=[{'all':!![]}];}return db[_0xcc84('0x2c')]['findAll'](_0x2053ef);})[_0xcc84('0x26')](function(_0xf79e5c){_0x9fb95c['rows']=_0xf79e5c;return _0x9fb95c;})[_0xcc84('0x26')](respondWithFilteredResult(_0x1ad165,_0x2053ef))[_0xcc84('0x43')](handleError(_0x1ad165,null));};exports[_0xcc84('0x44')]=function(_0xbece24,_0x348f68){var _0x266319={'raw':!![],'where':{'id':_0xbece24[_0xcc84('0x45')]['id']}},_0x1a4447={};_0x1a4447[_0xcc84('0x31')]=_[_0xcc84('0x34')](db[_0xcc84('0x2c')][_0xcc84('0x2d')]);_0x1a4447[_0xcc84('0x33')]=_['keys'](_0xbece24['query']);_0x1a4447[_0xcc84('0x35')]=_[_0xcc84('0x36')](_0x1a4447[_0xcc84('0x31')],_0x1a4447[_0xcc84('0x33')]);_0x266319[_0xcc84('0x37')]=_[_0xcc84('0x36')](_0x1a4447[_0xcc84('0x31')],qs[_0xcc84('0x38')](_0xbece24[_0xcc84('0x33')]['fields']));_0x266319[_0xcc84('0x37')]=_0x266319[_0xcc84('0x37')][_0xcc84('0x39')]?_0x266319[_0xcc84('0x37')]:_0x1a4447[_0xcc84('0x31')];if(_0xbece24[_0xcc84('0x33')]['includeAll']){_0x266319[_0xcc84('0x42')]=[{'all':!![]}];}_0x266319=_[_0xcc84('0x3f')]({},_0x266319,_0xbece24['options']);return db[_0xcc84('0x2c')][_0xcc84('0x46')](_0x266319)['then'](handleEntityNotFound(_0x348f68,null))[_0xcc84('0x26')](respondWithResult(_0x348f68,null))[_0xcc84('0x43')](handleError(_0x348f68,null));};exports[_0xcc84('0x47')]=function(_0x17cd9e,_0x48f96e){return db[_0xcc84('0x2c')][_0xcc84('0x47')](_0x17cd9e[_0xcc84('0x48')],{})[_0xcc84('0x26')](respondWithResult(_0x48f96e,0xc9))[_0xcc84('0x43')](handleError(_0x48f96e,null));};exports[_0xcc84('0x25')]=function(_0x31f963,_0xec7bba){if(_0x31f963[_0xcc84('0x48')]['id']){delete _0x31f963[_0xcc84('0x48')]['id'];}return db[_0xcc84('0x2c')][_0xcc84('0x46')]({'where':{'id':_0x31f963[_0xcc84('0x45')]['id']}})['then'](handleEntityNotFound(_0xec7bba,null))['then'](saveUpdates(_0x31f963[_0xcc84('0x48')],null))['then'](respondWithResult(_0xec7bba,null))['catch'](handleError(_0xec7bba,null));};exports[_0xcc84('0x49')]=function(_0x46b45d,_0x13a552){return db[_0xcc84('0x2c')][_0xcc84('0x46')]({'where':{'id':_0x46b45d[_0xcc84('0x45')]['id']}})[_0xcc84('0x26')](handleEntityNotFound(_0x13a552,null))[_0xcc84('0x26')](removeEntity(_0x13a552,null))[_0xcc84('0x43')](handleError(_0x13a552,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 27c5ac0..50a2ae2 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 _0xe5e9=['idField','FieldId','lodash','moment','request-promise','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe5e9,0x15e));var _0x9e5e=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xe5e9[_0x5da048];return _0x13dfc5;};'use strict';var _=require(_0x9e5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9e5e('0x1'));var BPromise=require('bluebird');var rp=require(_0x9e5e('0x2'));var fs=require('fs');var path=require(_0x9e5e('0x3'));var rimraf=require(_0x9e5e('0x4'));var config=require('../../config/environment');var attributes=require(_0x9e5e('0x5'));module[_0x9e5e('0x6')]=function(_0x108168,_0x19b325){return _0x108168['define'](_0x9e5e('0x7'),attributes,{'tableName':_0x9e5e('0x8'),'paranoid':![],'indexes':[{'name':_0x9e5e('0x9'),'fields':[_0x9e5e('0xa'),_0x9e5e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa586=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5de350,_0x166004){var _0x46dcd2=function(_0x54084d){while(--_0x54084d){_0x5de350['push'](_0x5de350['shift']());}};_0x46dcd2(++_0x166004);}(_0xa586,0x1c8));var _0x6a58=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0xa586[_0x48326a];return _0x466709;};'use strict';var _=require(_0x6a58('0x0'));var util=require(_0x6a58('0x1'));var logger=require(_0x6a58('0x2'))(_0x6a58('0x3'));var moment=require(_0x6a58('0x4'));var BPromise=require(_0x6a58('0x5'));var rp=require(_0x6a58('0x6'));var fs=require('fs');var path=require(_0x6a58('0x7'));var rimraf=require(_0x6a58('0x8'));var config=require(_0x6a58('0x9'));var attributes=require(_0x6a58('0xa'));module[_0x6a58('0xb')]=function(_0x14bcc8,_0x29aa11){return _0x14bcc8[_0x6a58('0xc')](_0x6a58('0xd'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x6a58('0xe'),'fields':['idField',_0x6a58('0xf')],'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 4709441..7c5c7c3 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 _0xfb04=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb04,0x6c));var _0x4fb0=function(_0x5eadd8,_0x4e58f2){_0x5eadd8=_0x5eadd8-0x0;var _0x73b164=_0xfb04[_0x5eadd8];return _0x73b164;};'use strict';var _=require('lodash');var util=require(_0x4fb0('0x0'));var moment=require(_0x4fb0('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fb0('0x2'));var fs=require('fs');var Redis=require(_0x4fb0('0x3'));var db=require(_0x4fb0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fb0('0x5'))(_0x4fb0('0x6'));var config=require(_0x4fb0('0x7'));var jayson=require(_0x4fb0('0x8'));var client=jayson['client'][_0x4fb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570173,_0x320ded,_0x4ca99c){return new BPromise(function(_0x1a4aba,_0x56a888){return client['request'](_0x570173,_0x4ca99c)[_0x4fb0('0xa')](function(_0x16a3bb){logger[_0x4fb0('0xb')](_0x4fb0('0xc'),_0x320ded,_0x4fb0('0xd'));logger[_0x4fb0('0xe')](_0x4fb0('0xf'),_0x320ded,_0x4fb0('0xd'),JSON[_0x4fb0('0x10')](_0x16a3bb));if(_0x16a3bb['error']){if(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x12')]===0x1f4){logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);return _0x56a888(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);}logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x16a3bb['error'][_0x4fb0('0x13')]);return _0x1a4aba(_0x16a3bb[_0x4fb0('0x11')][_0x4fb0('0x13')]);}else{logger['info'](_0x4fb0('0xc'),_0x320ded,_0x4fb0('0xd'));_0x1a4aba(_0x16a3bb[_0x4fb0('0x14')]['message']);}})[_0x4fb0('0x15')](function(_0x107206){logger[_0x4fb0('0x11')](_0x4fb0('0xc'),_0x320ded,_0x107206);_0x56a888(_0x107206);});});} \ No newline at end of file +var _0xa5e9=['stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0xc5f10e,_0x1406e1){var _0x420402=function(_0x340de7){while(--_0x340de7){_0xc5f10e['push'](_0xc5f10e['shift']());}};_0x420402(++_0x1406e1);}(_0xa5e9,0x9d));var _0x9a5e=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xa5e9[_0x2bcb75];return _0x175345;};'use strict';var _=require(_0x9a5e('0x0'));var util=require(_0x9a5e('0x1'));var moment=require('moment');var BPromise=require(_0x9a5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a5e('0x3'));var db=require(_0x9a5e('0x4'))['db'];var utils=require(_0x9a5e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9a5e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9a5e('0x7')][_0x9a5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x77023f,_0x15ee5d,_0x2550da){return new BPromise(function(_0x2857ab,_0x5c2050){return client['request'](_0x77023f,_0x2550da)[_0x9a5e('0x9')](function(_0x4add50){logger[_0x9a5e('0xa')](_0x9a5e('0xb'),_0x15ee5d,_0x9a5e('0xc'));logger['debug'](_0x9a5e('0xd'),_0x15ee5d,_0x9a5e('0xc'),JSON[_0x9a5e('0xe')](_0x4add50));if(_0x4add50['error']){if(_0x4add50[_0x9a5e('0xf')][_0x9a5e('0x10')]===0x1f4){logger[_0x9a5e('0xf')](_0x9a5e('0xb'),_0x15ee5d,_0x4add50['error']['message']);return _0x5c2050(_0x4add50[_0x9a5e('0xf')][_0x9a5e('0x11')]);}logger[_0x9a5e('0xf')](_0x9a5e('0xb'),_0x15ee5d,_0x4add50['error'][_0x9a5e('0x11')]);return _0x2857ab(_0x4add50[_0x9a5e('0xf')][_0x9a5e('0x11')]);}else{logger[_0x9a5e('0xa')](_0x9a5e('0xb'),_0x15ee5d,_0x9a5e('0xc'));_0x2857ab(_0x4add50[_0x9a5e('0x12')][_0x9a5e('0x11')]);}})['catch'](function(_0x49e3f3){logger[_0x9a5e('0xf')](_0x9a5e('0xb'),_0x15ee5d,_0x49e3f3);_0x5c2050(_0x49e3f3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 70fcd49..c26d0a9 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 _0xc82a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util'];(function(_0x43c29d,_0x2bb419){var _0x567a24=function(_0xa26ba6){while(--_0xa26ba6){_0x43c29d['push'](_0x43c29d['shift']());}};_0x567a24(++_0x2bb419);}(_0xc82a,0xdf));var _0xac82=function(_0x41ecb2,_0x306e02){_0x41ecb2=_0x41ecb2-0x0;var _0x1137d9=_0xc82a[_0x41ecb2];return _0x1137d9;};'use strict';var multer=require(_0xac82('0x0'));var util=require(_0xac82('0x1'));var path=require(_0xac82('0x2'));var timeout=require(_0xac82('0x3'));var express=require(_0xac82('0x4'));var router=express[_0xac82('0x5')]();var fs_extra=require(_0xac82('0x6'));var auth=require(_0xac82('0x7'));var interaction=require(_0xac82('0x8'));var config=require(_0xac82('0x9'));var controller=require(_0xac82('0xa'));router[_0xac82('0xb')]('/',auth[_0xac82('0xc')](),controller[_0xac82('0xd')]);router['get'](_0xac82('0xe'),auth[_0xac82('0xc')](),controller['show']);router[_0xac82('0xb')](_0xac82('0xf'),auth[_0xac82('0xc')](),controller[_0xac82('0x10')]);router['get'](_0xac82('0x11'),auth[_0xac82('0xc')](),controller[_0xac82('0x12')]);router[_0xac82('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac82('0x13')](_0xac82('0xf'),auth[_0xac82('0xc')](),controller[_0xac82('0x14')]);router[_0xac82('0x15')](_0xac82('0xe'),auth[_0xac82('0xc')](),controller[_0xac82('0x16')]);router[_0xac82('0x17')](_0xac82('0xe'),auth['isAuthenticated'](),controller[_0xac82('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1407=['/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5a27f6,_0x2bd33e){var _0x10ab08=function(_0x47adc2){while(--_0x47adc2){_0x5a27f6['push'](_0x5a27f6['shift']());}};_0x10ab08(++_0x2bd33e);}(_0x1407,0x78));var _0x7140=function(_0x500577,_0x534f6a){_0x500577=_0x500577-0x0;var _0x11cdee=_0x1407[_0x500577];return _0x11cdee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7140('0x0'));var timeout=require('connect-timeout');var express=require(_0x7140('0x1'));var router=express[_0x7140('0x2')]();var fs_extra=require(_0x7140('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7140('0x4'));var config=require(_0x7140('0x5'));var controller=require(_0x7140('0x6'));router[_0x7140('0x7')]('/',auth[_0x7140('0x8')](),controller[_0x7140('0x9')]);router['get'](_0x7140('0xa'),auth['isAuthenticated'](),controller[_0x7140('0xb')]);router[_0x7140('0x7')](_0x7140('0xc'),auth[_0x7140('0x8')](),controller[_0x7140('0xd')]);router['get']('/:id/fields',auth[_0x7140('0x8')](),controller[_0x7140('0xe')]);router[_0x7140('0xf')]('/',auth[_0x7140('0x8')](),controller['create']);router[_0x7140('0xf')]('/:id/configurations',auth[_0x7140('0x8')](),controller[_0x7140('0x10')]);router[_0x7140('0x11')]('/:id',auth[_0x7140('0x8')](),controller[_0x7140('0x12')]);router[_0x7140('0x13')](_0x7140('0xa'),auth[_0x7140('0x8')](),controller[_0x7140('0x14')]);module[_0x7140('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e991841..ccb777f 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 _0xfdca=['exports','STRING','sequelize'];(function(_0xccc718,_0x11c2a2){var _0x44fdb4=function(_0x16de6f){while(--_0x16de6f){_0xccc718['push'](_0xccc718['shift']());}};_0x44fdb4(++_0x11c2a2);}(_0xfdca,0x152));var _0xafdc=function(_0x4444e4,_0x381c05){_0x4444e4=_0x4444e4-0x0;var _0xf81a45=_0xfdca[_0x4444e4];return _0xf81a45;};'use strict';var Sequelize=require(_0xafdc('0x0'));module[_0xafdc('0x1')]={'name':{'type':Sequelize[_0xafdc('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xafdc('0x2')]},'remoteUri':{'type':Sequelize[_0xafdc('0x2')]},'tenantId':{'type':Sequelize[_0xafdc('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xafdc('0x2')]},'serverUrl':{'type':Sequelize[_0xafdc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xafdc('0x2')]}}; \ No newline at end of file +var _0x3609=['exports','STRING','sequelize'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3609,0x101));var _0x9360=function(_0x18095d,_0x129ef9){_0x18095d=_0x18095d-0x0;var _0x34313=_0x3609[_0x18095d];return _0x34313;};'use strict';var Sequelize=require(_0x9360('0x0'));module[_0x9360('0x1')]={'name':{'type':Sequelize[_0x9360('0x2')]},'username':{'type':Sequelize[_0x9360('0x2')]},'password':{'type':Sequelize[_0x9360('0x2')]},'remoteUri':{'type':Sequelize[_0x9360('0x2')]},'tenantId':{'type':Sequelize[_0x9360('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9360('0x2')]},'serverUrl':{'type':Sequelize[_0x9360('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9360('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 2a29034..4baa096 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 _0x8e63=['channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption',')/Microsoft.Dynamics.CRM.','rimraf','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','Dynamics365Account','includeAll','rows','catch','params','length','include','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','getSubjects'];(function(_0x29d096,_0x4f3bf9){var _0x469bb8=function(_0x2e789a){while(--_0x2e789a){_0x29d096['push'](_0x29d096['shift']());}};_0x469bb8(++_0x4f3bf9);}(_0x8e63,0x7c));var _0x38e6=function(_0x33876e,_0x4a74d9){_0x33876e=_0x33876e-0x0;var _0x258a24=_0x8e63[_0x33876e];return _0x258a24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38e6('0x1'));var moment=require(_0x38e6('0x2'));var BPromise=require(_0x38e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e6('0x4'));var sox=require(_0x38e6('0x5'));var csv=require(_0x38e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e6('0x7'));var _=require(_0x38e6('0x8'));var squel=require(_0x38e6('0x9'));var crypto=require(_0x38e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38e6('0x6'));var querystring=require(_0x38e6('0xb'));var Papa=require(_0x38e6('0xc'));var Redis=require(_0x38e6('0xd'));var authService=require(_0x38e6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e6('0xf'));var logger=require('../../config/logger')(_0x38e6('0x10'));var utils=require('../../config/utils');var config=require(_0x38e6('0x11'));var licenseUtil=require(_0x38e6('0x12'));var db=require(_0x38e6('0x13'))['db'];var integrations=require(_0x38e6('0x14'));function respondWithStatusCode(_0x2e2585,_0x57c207){_0x57c207=_0x57c207||0xcc;return function(_0x2b4679){if(_0x2b4679){return _0x2e2585[_0x38e6('0x15')](_0x57c207);}return _0x2e2585['status'](_0x57c207)[_0x38e6('0x16')]();};}function respondWithResult(_0xfd7f2,_0x229f18){_0x229f18=_0x229f18||0xc8;return function(_0x1370bb){if(_0x1370bb){return _0xfd7f2[_0x38e6('0x17')](_0x229f18)[_0x38e6('0x18')](_0x1370bb);}};}function respondWithFilteredResult(_0x55208f,_0x279688){return function(_0x36a263){if(_0x36a263){var _0x3299c9=typeof _0x279688[_0x38e6('0x19')]===_0x38e6('0x1a')&&typeof _0x279688['limit']===_0x38e6('0x1a');var _0x58c772=_0x36a263[_0x38e6('0x1b')];var _0x3e94f9=_0x3299c9?0x0:_0x279688[_0x38e6('0x19')];var _0x1dee00=_0x3299c9?_0x36a263['count']:_0x279688[_0x38e6('0x19')]+_0x279688['limit'];var _0x18ec00;if(_0x1dee00>=_0x58c772){_0x1dee00=_0x58c772;_0x18ec00=0xc8;}else{_0x18ec00=0xce;}_0x55208f[_0x38e6('0x17')](_0x18ec00);return _0x55208f[_0x38e6('0x1c')](_0x38e6('0x1d'),_0x3e94f9+'-'+_0x1dee00+'/'+_0x58c772)[_0x38e6('0x18')](_0x36a263);}return null;};}function patchUpdates(_0x41bb24){return function(_0x495268){try{jsonpatch['apply'](_0x495268,_0x41bb24,!![]);}catch(_0x4d6bf4){return BPromise[_0x38e6('0x1e')](_0x4d6bf4);}return _0x495268['save']();};}function saveUpdates(_0x4a82f6,_0x2d995f){return function(_0xa4a8b9){if(_0xa4a8b9){return _0xa4a8b9[_0x38e6('0x1f')](_0x4a82f6)[_0x38e6('0x20')](function(_0x5f5ab2){return _0x5f5ab2;});}return null;};}function removeEntity(_0x140fc3,_0x4530a7){return function(_0x185922){if(_0x185922){return _0x185922['destroy']()[_0x38e6('0x20')](function(){_0x140fc3[_0x38e6('0x17')](0xcc)[_0x38e6('0x16')]();});}};}function handleEntityNotFound(_0x9bc0b0,_0x106424){return function(_0xdcf7ff){if(!_0xdcf7ff){_0x9bc0b0[_0x38e6('0x15')](0x194);}return _0xdcf7ff;};}function handleError(_0x167b28,_0x4a261a){_0x4a261a=_0x4a261a||0x1f4;return function(_0x175815){logger['error'](_0x175815[_0x38e6('0x21')]);if(_0x175815[_0x38e6('0x22')]){delete _0x175815[_0x38e6('0x22')];}_0x167b28[_0x38e6('0x17')](_0x4a261a)[_0x38e6('0x23')](_0x175815);};}exports[_0x38e6('0x24')]=function(_0x1d4a1b,_0x5a4912){var _0xe93f18={},_0x1980a4={},_0x48f5a2={'count':0x0,'rows':[]};var _0x1aa78b=_[_0x38e6('0x25')](db['Dynamics365Account'][_0x38e6('0x26')],function(_0x192893){return{'name':_0x192893[_0x38e6('0x27')],'type':_0x192893[_0x38e6('0x28')][_0x38e6('0x29')]};});_0x1980a4[_0x38e6('0x2a')]=_[_0x38e6('0x25')](_0x1aa78b,'name');_0x1980a4[_0x38e6('0x2b')]=_[_0x38e6('0x2c')](_0x1d4a1b[_0x38e6('0x2b')]);_0x1980a4[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x1980a4[_0x38e6('0x2a')],_0x1980a4[_0x38e6('0x2b')]);_0xe93f18['attributes']=_[_0x38e6('0x2e')](_0x1980a4[_0x38e6('0x2a')],qs[_0x38e6('0x2f')](_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x2f')]));_0xe93f18[_0x38e6('0x30')]=_0xe93f18[_0x38e6('0x30')]['length']?_0xe93f18[_0x38e6('0x30')]:_0x1980a4[_0x38e6('0x2a')];if(!_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x31')]('nolimit')){_0xe93f18[_0x38e6('0x32')]=qs[_0x38e6('0x32')](_0x1d4a1b['query'][_0x38e6('0x32')]);_0xe93f18[_0x38e6('0x19')]=qs[_0x38e6('0x19')](_0x1d4a1b[_0x38e6('0x2b')]['offset']);}_0xe93f18[_0x38e6('0x33')]=qs[_0x38e6('0x34')](_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x34')]);_0xe93f18['where']=qs[_0x38e6('0x2d')](_[_0x38e6('0x35')](_0x1d4a1b[_0x38e6('0x2b')],_0x1980a4[_0x38e6('0x2d')]),_0x1aa78b);if(_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x36')]){_0xe93f18[_0x38e6('0x37')]=_['merge'](_0xe93f18[_0x38e6('0x37')],{'$or':_[_0x38e6('0x25')](_0x1aa78b,function(_0x5700a1){if(_0x5700a1['type']!==_0x38e6('0x38')){var _0x11556e={};_0x11556e[_0x5700a1[_0x38e6('0x22')]]={'$like':'%'+_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x36')]+'%'};return _0x11556e;}})});}_0xe93f18=_[_0x38e6('0x39')]({},_0xe93f18,_0x1d4a1b[_0x38e6('0x3a')]);var _0x1878e9={'where':_0xe93f18[_0x38e6('0x37')]};return db[_0x38e6('0x3b')]['count'](_0x1878e9)[_0x38e6('0x20')](function(_0xd558ec){_0x48f5a2[_0x38e6('0x1b')]=_0xd558ec;if(_0x1d4a1b[_0x38e6('0x2b')][_0x38e6('0x3c')]){_0xe93f18['include']=[{'all':!![]}];}return db[_0x38e6('0x3b')]['findAll'](_0xe93f18);})[_0x38e6('0x20')](function(_0x2c4c63){_0x48f5a2[_0x38e6('0x3d')]=_0x2c4c63;return _0x48f5a2;})[_0x38e6('0x20')](respondWithFilteredResult(_0x5a4912,_0xe93f18))[_0x38e6('0x3e')](handleError(_0x5a4912,null));};exports['show']=function(_0x44e6af,_0x3166fb){var _0x5f4ae3={'raw':![],'where':{'id':_0x44e6af[_0x38e6('0x3f')]['id']}},_0x385045={};_0x385045[_0x38e6('0x2a')]=_['keys'](db[_0x38e6('0x3b')][_0x38e6('0x26')]);_0x385045['query']=_[_0x38e6('0x2c')](_0x44e6af[_0x38e6('0x2b')]);_0x385045[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x385045[_0x38e6('0x2a')],_0x385045['query']);_0x5f4ae3[_0x38e6('0x30')]=_['intersection'](_0x385045[_0x38e6('0x2a')],qs[_0x38e6('0x2f')](_0x44e6af['query'][_0x38e6('0x2f')]));_0x5f4ae3[_0x38e6('0x30')]=_0x5f4ae3['attributes'][_0x38e6('0x40')]?_0x5f4ae3[_0x38e6('0x30')]:_0x385045[_0x38e6('0x2a')];if(_0x44e6af['query'][_0x38e6('0x3c')]){_0x5f4ae3[_0x38e6('0x41')]=[{'all':!![]}];}_0x5f4ae3=_[_0x38e6('0x39')]({},_0x5f4ae3,_0x44e6af['options']);return db['Dynamics365Account'][_0x38e6('0x42')](_0x5f4ae3)[_0x38e6('0x20')](handleEntityNotFound(_0x3166fb,null))['then'](respondWithResult(_0x3166fb,null))[_0x38e6('0x3e')](handleError(_0x3166fb,null));};exports[_0x38e6('0x43')]=function(_0x2eadb4,_0x2e0644){return db[_0x38e6('0x3b')][_0x38e6('0x43')](_0x2eadb4[_0x38e6('0x44')],{})['then'](respondWithResult(_0x2e0644,0xc9))['catch'](handleError(_0x2e0644,null));};exports[_0x38e6('0x1f')]=function(_0x5d1e7b,_0xcb5099){if(_0x5d1e7b[_0x38e6('0x44')]['id']){delete _0x5d1e7b['body']['id'];}return db['Dynamics365Account'][_0x38e6('0x42')]({'where':{'id':_0x5d1e7b[_0x38e6('0x3f')]['id']}})['then'](handleEntityNotFound(_0xcb5099,null))[_0x38e6('0x20')](saveUpdates(_0x5d1e7b['body'],null))['then'](respondWithResult(_0xcb5099,null))[_0x38e6('0x3e')](handleError(_0xcb5099,null));};exports[_0x38e6('0x45')]=function(_0x385de7,_0x1b6291){return db[_0x38e6('0x3b')]['find']({'where':{'id':_0x385de7[_0x38e6('0x3f')]['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x1b6291,null))[_0x38e6('0x20')](removeEntity(_0x1b6291,null))[_0x38e6('0x3e')](handleError(_0x1b6291,null));};exports[_0x38e6('0x46')]=function(_0x361ff6,_0x138800,_0x4bd79d){var _0x55bbe4={};var _0x487485={};var _0x32e8dc;var _0x3cdcbd;return db['Dynamics365Account'][_0x38e6('0x47')]({'where':{'id':_0x361ff6[_0x38e6('0x3f')]['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x138800,null))[_0x38e6('0x20')](function(_0x38590e){if(_0x38590e){_0x32e8dc=_0x38590e;_0x487485[_0x38e6('0x2a')]=_[_0x38e6('0x2c')](db[_0x38e6('0x48')][_0x38e6('0x26')]);_0x487485[_0x38e6('0x2b')]=_['keys'](_0x361ff6[_0x38e6('0x2b')]);_0x487485[_0x38e6('0x2d')]=_[_0x38e6('0x2e')](_0x487485[_0x38e6('0x2a')],_0x487485[_0x38e6('0x2b')]);_0x55bbe4[_0x38e6('0x30')]=_[_0x38e6('0x2e')](_0x487485['model'],qs[_0x38e6('0x2f')](_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x2f')]));_0x55bbe4[_0x38e6('0x30')]=_0x55bbe4['attributes']['length']?_0x55bbe4['attributes']:_0x487485['model'];_0x55bbe4[_0x38e6('0x33')]=qs[_0x38e6('0x34')](_0x361ff6[_0x38e6('0x2b')]['sort']);_0x55bbe4[_0x38e6('0x37')]=qs[_0x38e6('0x2d')](_['pick'](_0x361ff6[_0x38e6('0x2b')],_0x487485['filters']));if(_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x36')]){_0x55bbe4[_0x38e6('0x37')]=_['merge'](_0x55bbe4[_0x38e6('0x37')],{'$or':_['map'](_0x55bbe4[_0x38e6('0x30')],function(_0x54a0bc){var _0x432026={};_0x432026[_0x54a0bc]={'$like':'%'+_0x361ff6[_0x38e6('0x2b')]['filter']+'%'};return _0x432026;})});}_0x55bbe4=_[_0x38e6('0x39')]({},_0x55bbe4,_0x361ff6[_0x38e6('0x3a')]);return _0x32e8dc['getConfigurations'](_0x55bbe4);}})['then'](function(_0x492f00){if(_0x492f00){_0x3cdcbd=_0x492f00[_0x38e6('0x40')];if(!_0x361ff6[_0x38e6('0x2b')][_0x38e6('0x31')](_0x38e6('0x49'))){_0x55bbe4[_0x38e6('0x32')]=qs[_0x38e6('0x32')](_0x361ff6['query'][_0x38e6('0x32')]);_0x55bbe4[_0x38e6('0x19')]=qs[_0x38e6('0x19')](_0x361ff6[_0x38e6('0x2b')]['offset']);}return _0x32e8dc[_0x38e6('0x46')](_0x55bbe4);}})[_0x38e6('0x20')](function(_0x45e5b5){if(_0x45e5b5){return _0x45e5b5?{'count':_0x3cdcbd,'rows':_0x45e5b5}:null;}})[_0x38e6('0x20')](respondWithResult(_0x138800,null))[_0x38e6('0x3e')](handleError(_0x138800,null));};exports[_0x38e6('0x4a')]=function(_0x46a495,_0x4dfae1,_0x169ba9){if(_0x46a495[_0x38e6('0x44')]['id']){delete _0x46a495['body']['id'];}return db[_0x38e6('0x3b')][_0x38e6('0x47')]({'where':{'id':_0x46a495['params']['id']}})[_0x38e6('0x20')](handleEntityNotFound(_0x4dfae1,null))['then'](function(_0x21c25b){if(_0x21c25b){_0x46a495[_0x38e6('0x44')]['AccountId']=_0x21c25b['id'];_0x46a495[_0x38e6('0x44')]['Subjects']=integrations[_0x38e6('0x4b')](_0x46a495[_0x38e6('0x44')][_0x38e6('0x4c')],_0x46a495['body']['type']);_0x46a495[_0x38e6('0x44')][_0x38e6('0x4d')]=integrations[_0x38e6('0x4e')](_0x46a495[_0x38e6('0x44')][_0x38e6('0x4c')],_0x46a495[_0x38e6('0x44')]['type']);return db['Dynamics365Configuration'][_0x38e6('0x43')](_0x46a495[_0x38e6('0x44')],{'include':[{'model':db[_0x38e6('0x4f')],'as':_0x38e6('0x50')},{'model':db[_0x38e6('0x4f')],'as':_0x38e6('0x4d')}]});}return null;})[_0x38e6('0x20')](respondWithResult(_0x4dfae1,null))[_0x38e6('0x3e')](handleError(_0x4dfae1,null));};exports[_0x38e6('0x51')]=function(_0x37d317,_0x1ef1dd,_0x45da45){var _0x5c965b=_0x37d317[_0x38e6('0x2b')][_0x38e6('0x52')];var _0x8ab723=_0x5c965b===_0x38e6('0x53')?'Incident':_0x38e6('0x54');var _0x385343='';var _0x28004d='';var _0x15ca57='';var _0x23a79e='';var _0x592512='';var _0x332315='';var _0x2fa987='';var _0x2f9906='';var _0x252426=[_0x38e6('0x55'),'description',_0x38e6('0x56'),_0x38e6('0x57'),'caseorigincode','subject',_0x38e6('0x58'),_0x38e6('0x59'),_0x38e6('0x5a'),_0x38e6('0x5b')];var _0x59c637=[_0x38e6('0x5c'),'accountidyominame',_0x38e6('0x5d'),_0x38e6('0x5e'),_0x38e6('0x5f'),_0x38e6('0x60'),_0x38e6('0x61'),'contractidname',_0x38e6('0x62'),_0x38e6('0x63'),_0x38e6('0x64'),_0x38e6('0x65'),_0x38e6('0x66'),_0x38e6('0x67'),_0x38e6('0x68'),_0x38e6('0x69'),_0x38e6('0x6a'),_0x38e6('0x6b'),_0x38e6('0x6c'),_0x38e6('0x6d'),_0x38e6('0x6e'),'entityimage_url',_0x38e6('0x6f'),_0x38e6('0x70'),_0x38e6('0x71'),'followupby',_0x38e6('0x72'),'influencescore','kbarticleidname',_0x38e6('0x73'),_0x38e6('0x74'),'modifiedbyexternalpartyname',_0x38e6('0x75'),_0x38e6('0x76'),_0x38e6('0x77'),_0x38e6('0x78'),_0x38e6('0x79'),_0x38e6('0x7a'),_0x38e6('0x7b'),_0x38e6('0x7c'),_0x38e6('0x7d'),_0x38e6('0x7e'),_0x38e6('0x7f'),_0x38e6('0x80'),'owneridtype','owneridyominame',_0x38e6('0x81'),_0x38e6('0x82'),_0x38e6('0x83'),_0x38e6('0x84'),_0x38e6('0x85'),_0x38e6('0x86'),_0x38e6('0x87'),_0x38e6('0x88'),_0x38e6('0x89'),_0x38e6('0x8a'),'responsiblecontactidyominame',_0x38e6('0x8b'),_0x38e6('0x8c'),_0x38e6('0x8d'),'socialprofileidname',_0x38e6('0x8e'),_0x38e6('0x8f'),_0x38e6('0x90'),'ticketnumber',_0x38e6('0x91'),_0x38e6('0x92'),_0x38e6('0x93'),_0x38e6('0x94'),'versionnumber'];var _0x343b85=_0x252426[_0x38e6('0x95')](_0x59c637);return db[_0x38e6('0x3b')]['findOne']({'where':{'id':_0x37d317[_0x38e6('0x3f')]['id']},'attributes':['id','username',_0x38e6('0x96'),_0x38e6('0x97'),_0x38e6('0x98'),_0x38e6('0x99'),_0x38e6('0x9a')]})[_0x38e6('0x20')](handleEntityNotFound(_0x1ef1dd,null))[_0x38e6('0x20')](function(_0x18bf4e){if(_0x18bf4e){_0x2f9906=_0x18bf4e[_0x38e6('0x97')];var _0x4c13a0=_0x2f9906[_0x38e6('0x9b')](-0x1);if(_0x4c13a0==='/'){_0x2f9906=_0x2f9906[_0x38e6('0x9c')](0x0,_0x2f9906[_0x38e6('0x9d')](_0x4c13a0));}_0x2fa987=util[_0x38e6('0x9e')]('%s/api/data/v9.0/',_0x2f9906);var _0x550751={'method':_0x38e6('0x9f'),'uri':'https://login.microsoftonline.com/'+_0x18bf4e[_0x38e6('0x98')]+'/oauth2/token','form':{'client_id':_0x18bf4e[_0x38e6('0x99')],'resource':_0x2f9906,'username':_0x18bf4e[_0x38e6('0xa0')],'password':_0x18bf4e[_0x38e6('0x96')],'grant_type':_0x38e6('0x96'),'client_secret':_0x18bf4e[_0x38e6('0x9a')]},'json':!![]};return rp(_0x550751);}})[_0x38e6('0x20')](function(_0x1436cd){_0x332315=_0x1436cd[_0x38e6('0xa1')];var _0x3f7ffe={'method':_0x38e6('0xa2'),'uri':encodeURI(_0x2fa987+_0x38e6('0xa3')+_0x8ab723+'\x27'),'headers':{'Authorization':_0x38e6('0xa4')+_0x332315,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x3f7ffe);})['then'](function(_0x2e1e9d){var _0x5ae4ec=_0x2e1e9d[_0x38e6('0xa6')][0x0];var _0x3a8ec3=_0x5ae4ec['MetadataId'];var _0x1579a7={'method':_0x38e6('0xa2'),'uri':_0x2fa987+_0x38e6('0xa7')+_0x3a8ec3+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x38e6('0xa4')+_0x332315,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x1579a7);})[_0x38e6('0x20')](function(_0x2b5174){_0x385343=_0x2b5174;_0x28004d=_0x385343[_0x38e6('0xa8')];_0x28004d=_[_0x38e6('0xa9')](_0x28004d,function(_0x5ad13a){return!_0x343b85['includes'](_0x5ad13a['LogicalName']);});var _0x40a47e=[];var _0x434b9e=[];_0x28004d[_0x38e6('0xaa')](function(_0xcccf86){if(_0xcccf86[_0x38e6('0xab')]){var _0x172110=_0xcccf86['@odata.type'][_0x38e6('0x9c')](_0xcccf86[_0x38e6('0xab')][_0x38e6('0x9d')]('.')+0x1);if(_0x172110===_0x38e6('0xac')){_0x40a47e[_0x38e6('0xad')](getSelectList(_0x2fa987,_0x5c965b,_0x434b9e,_0x385343['MetadataId'],_0xcccf86[_0x38e6('0xae')],_0x332315));}}});return Promise[_0x38e6('0xaf')](_0x40a47e);})[_0x38e6('0x20')](function(_0x2f886a){_0x15ca57=_0x2f886a[0x0];var _0x27acf0=[];var _0x4b99a2=[];_0x28004d['forEach'](function(_0xcecef1){if(!_['isNil'](_0xcecef1[_0x38e6('0xab')])){var _0x57de21=_0xcecef1['@odata.type']['substring'](_0xcecef1[_0x38e6('0xab')][_0x38e6('0x9d')]('.')+0x1);if(_0x57de21===_0x38e6('0xb0')){_0x27acf0[_0x38e6('0xad')](getBooleanList(_0x2fa987,_0x5c965b,_0x4b99a2,_0x385343[_0x38e6('0xae')],_0xcecef1[_0x38e6('0xae')],_0x332315));}}});return Promise['all'](_0x27acf0);})['then'](function(_0x17ca5f){_0x23a79e=_0x17ca5f[0x0];var _0x3f3d3b=[];var _0x39b2e0=[];_0x28004d['forEach'](function(_0x48bd58){if(_0x48bd58[_0x38e6('0xab')]){var _0x17eafd=_0x48bd58[_0x38e6('0xab')][_0x38e6('0x9c')](_0x48bd58['@odata.type'][_0x38e6('0x9d')]('.')+0x1);if(_0x17eafd===_0x38e6('0xb1')||_0x17eafd==='DoubleAttributeMetadata'||_0x17eafd==='BigIntAttributeMetadata'||_0x17eafd===_0x38e6('0xb2')||_0x17eafd===_0x38e6('0xb3')||_0x17eafd===_0x38e6('0xb4')||_0x17eafd===_0x38e6('0xb5')||_0x17eafd==='EntityNameAttributeMetadata'||_0x17eafd===_0x38e6('0xb6')||_0x17eafd===_0x38e6('0xb7')){_0x3f3d3b['push'](getInputList(_0x2fa987,_0x5c965b,_0x17eafd,_0x39b2e0,_0x385343['MetadataId'],_0x48bd58['MetadataId'],_0x332315));}}});return Promise[_0x38e6('0xaf')](_0x3f3d3b);})[_0x38e6('0x20')](function(_0x5ec226){_0x592512=_0x5ec226[0x0];var _0x548b8d=_0x15ca57[_0x38e6('0x95')](_0x23a79e)['concat'](_0x592512);var _0x5b733a={'count':_0x548b8d[_0x38e6('0x40')],'rows':_0x548b8d};return _0x5b733a;})[_0x38e6('0x20')](respondWithResult(_0x1ef1dd,null))['catch'](function(_0x23c67d){var _0x276997=_0x37d317[_0x38e6('0x2b')][_0x38e6('0xb8')]?0x1f4:_0x23c67d[_0x38e6('0xb9')]||0x1f4;logger[_0x38e6('0xba')](_0x23c67d[_0x38e6('0x21')]);delete _0x23c67d[_0x38e6('0x22')];if(_0x276997===0x191){_0x276997=0x190;}_0x1ef1dd['status'](_0x276997)['send'](_0x37d317['query'][_0x38e6('0xb8')]?{'message':_0x38e6('0xbb'),'statusCode':_0x23c67d[_0x38e6('0xb9')]}:_0x23c67d);});};function getSelectList(_0x1a1115,_0x2dc7fc,_0x5130ba,_0x1ad836,_0x58d289,_0x1dfc0a){var _0x252da1={'method':'GET','uri':_0x1a1115+'EntityDefinitions('+_0x1ad836+_0x38e6('0xbc')+_0x58d289+_0x38e6('0xbd')+_0x38e6('0xbe'),'headers':{'Authorization':_0x38e6('0xa4')+_0x1dfc0a,'If-None-Match':null,'OData-Version':_0x38e6('0xa5')},'json':!![]};return rp(_0x252da1)['then'](function(_0x1e7c07){var _0x300176=[];var _0x186975=_0x1e7c07[_0x38e6('0xbf')][_0x38e6('0xc0')];_0x186975[_0x38e6('0xaa')](function(_0x4adae5){_0x300176['push']({'name':_0x4adae5['Label'][_0x38e6('0xc1')][_0x38e6('0xc2')],'value':String(_0x4adae5['Value'])});});var _0x2ec2cb={'id':_0x2dc7fc+'_'+_0x1e7c07[_0x38e6('0xc3')],'name':_0x1e7c07[_0x38e6('0xc4')][_0x38e6('0xc1')][_0x38e6('0xc2')],'custom':![],'options':_0x300176};_0x5130ba[_0x38e6('0xad')](_0x2ec2cb);return _0x5130ba;});}function getBooleanList(_0x31d884,_0x2a47d4,_0x4e0968,_0x4d142a,_0x4a61ae,_0x247ebd){var _0x1d87ae={'method':_0x38e6('0xa2'),'uri':_0x31d884+'EntityDefinitions('+_0x4d142a+_0x38e6('0xbc')+_0x4a61ae+_0x38e6('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x247ebd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d87ae)['then'](function(_0x5a43d6){var _0x4c9a5e=[];_0x4c9a5e[_0x38e6('0xad')]({'name':_0x5a43d6[_0x38e6('0xbf')]['TrueOption'][_0x38e6('0xc2')][_0x38e6('0xc1')]['Label'],'value':'true'},{'name':_0x5a43d6['OptionSet'][_0x38e6('0xc6')][_0x38e6('0xc2')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x26e06e={'id':_0x2a47d4+'_'+_0x5a43d6['LogicalName'],'name':_0x5a43d6[_0x38e6('0xc4')]['UserLocalizedLabel'][_0x38e6('0xc2')],'custom':![],'options':_0x4c9a5e};_0x4e0968[_0x38e6('0xad')](_0x26e06e);return _0x4e0968;});}function getInputList(_0x44490d,_0x1b489c,_0x22e340,_0x406fe0,_0x2838ff,_0x59db53,_0x161af5){var _0x3c9faa={'method':_0x38e6('0xa2'),'uri':_0x44490d+'EntityDefinitions('+_0x2838ff+')/Attributes('+_0x59db53+_0x38e6('0xc7')+_0x22e340+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x38e6('0xa4')+_0x161af5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c9faa)['then'](function(_0x2c637f){var _0x45eac4={'id':_0x1b489c+'_'+_0x2c637f['LogicalName'],'name':_0x2c637f[_0x38e6('0xc4')][_0x38e6('0xc1')]?_0x2c637f['DisplayName']['UserLocalizedLabel'][_0x38e6('0xc2')]:_0x2c637f[_0x38e6('0xc3')],'custom':![],'options':[]};_0x406fe0[_0x38e6('0xad')](_0x45eac4);return _0x406fe0;});} \ No newline at end of file +var _0x7ae7=[')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','sendStatus','stack','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Dynamics365Account','findAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','error','test','Wrong\x20credentials',')/Attributes('];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x7ae7,0xd9));var _0x77ae=function(_0x57f4de,_0x57c7ae){_0x57f4de=_0x57f4de-0x0;var _0x1edd7b=_0x7ae7[_0x57f4de];return _0x1edd7b;};'use strict';var emlformat=require(_0x77ae('0x0'));var rimraf=require(_0x77ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77ae('0x2'));var rp=require(_0x77ae('0x3'));var moment=require(_0x77ae('0x4'));var BPromise=require(_0x77ae('0x5'));var Mustache=require(_0x77ae('0x6'));var util=require(_0x77ae('0x7'));var path=require(_0x77ae('0x8'));var sox=require(_0x77ae('0x9'));var csv=require(_0x77ae('0xa'));var ejs=require(_0x77ae('0xb'));var fs=require('fs');var fs_extra=require(_0x77ae('0xc'));var _=require(_0x77ae('0xd'));var squel=require(_0x77ae('0xe'));var crypto=require('crypto');var jsforce=require(_0x77ae('0xf'));var deskjs=require(_0x77ae('0x10'));var toCsv=require(_0x77ae('0xa'));var querystring=require(_0x77ae('0x11'));var Papa=require(_0x77ae('0x12'));var Redis=require(_0x77ae('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x77ae('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x77ae('0x15'))(_0x77ae('0x16'));var utils=require(_0x77ae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x77ae('0x18'));var db=require(_0x77ae('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x33d49e,_0x334823){_0x334823=_0x334823||0xcc;return function(_0x7beeee){if(_0x7beeee){return _0x33d49e['sendStatus'](_0x334823);}return _0x33d49e['status'](_0x334823)[_0x77ae('0x1a')]();};}function respondWithResult(_0x5b799f,_0x2d3017){_0x2d3017=_0x2d3017||0xc8;return function(_0xec36cb){if(_0xec36cb){return _0x5b799f[_0x77ae('0x1b')](_0x2d3017)[_0x77ae('0x1c')](_0xec36cb);}};}function respondWithFilteredResult(_0x504ad5,_0x566311){return function(_0xcb2f8e){if(_0xcb2f8e){var _0x383973=typeof _0x566311[_0x77ae('0x1d')]==='undefined'&&typeof _0x566311[_0x77ae('0x1e')]===_0x77ae('0x1f');var _0x166787=_0xcb2f8e[_0x77ae('0x20')];var _0x10cc1b=_0x383973?0x0:_0x566311['offset'];var _0x4b524b=_0x383973?_0xcb2f8e[_0x77ae('0x20')]:_0x566311[_0x77ae('0x1d')]+_0x566311[_0x77ae('0x1e')];var _0x360555;if(_0x4b524b>=_0x166787){_0x4b524b=_0x166787;_0x360555=0xc8;}else{_0x360555=0xce;}_0x504ad5[_0x77ae('0x1b')](_0x360555);return _0x504ad5[_0x77ae('0x21')]('Content-Range',_0x10cc1b+'-'+_0x4b524b+'/'+_0x166787)['json'](_0xcb2f8e);}return null;};}function patchUpdates(_0x27b348){return function(_0x48b984){try{jsonpatch[_0x77ae('0x22')](_0x48b984,_0x27b348,!![]);}catch(_0x3061c1){return BPromise[_0x77ae('0x23')](_0x3061c1);}return _0x48b984[_0x77ae('0x24')]();};}function saveUpdates(_0x17c79b,_0xe0c6ea){return function(_0x4edd51){if(_0x4edd51){return _0x4edd51['update'](_0x17c79b)['then'](function(_0x15c185){return _0x15c185;});}return null;};}function removeEntity(_0x199838,_0x4c64ba){return function(_0x4c06df){if(_0x4c06df){return _0x4c06df[_0x77ae('0x25')]()[_0x77ae('0x26')](function(){_0x199838[_0x77ae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22464b,_0x4ece2e){return function(_0x1993be){if(!_0x1993be){_0x22464b[_0x77ae('0x27')](0x194);}return _0x1993be;};}function handleError(_0x1c3120,_0x187698){_0x187698=_0x187698||0x1f4;return function(_0x5059f3){logger['error'](_0x5059f3[_0x77ae('0x28')]);if(_0x5059f3[_0x77ae('0x29')]){delete _0x5059f3[_0x77ae('0x29')];}_0x1c3120['status'](_0x187698)[_0x77ae('0x2a')](_0x5059f3);};}exports['index']=function(_0x354557,_0x4803e8){var _0xaca6b0={},_0x564023={},_0x1fafbd={'count':0x0,'rows':[]};var _0x28098c=_[_0x77ae('0x2b')](db['Dynamics365Account'][_0x77ae('0x2c')],function(_0x264ab4){return{'name':_0x264ab4['fieldName'],'type':_0x264ab4[_0x77ae('0x2d')][_0x77ae('0x2e')]};});_0x564023['model']=_[_0x77ae('0x2b')](_0x28098c,_0x77ae('0x29'));_0x564023['query']=_[_0x77ae('0x2f')](_0x354557[_0x77ae('0x30')]);_0x564023[_0x77ae('0x31')]=_[_0x77ae('0x32')](_0x564023[_0x77ae('0x33')],_0x564023[_0x77ae('0x30')]);_0xaca6b0[_0x77ae('0x34')]=_[_0x77ae('0x32')](_0x564023[_0x77ae('0x33')],qs[_0x77ae('0x35')](_0x354557[_0x77ae('0x30')]['fields']));_0xaca6b0[_0x77ae('0x34')]=_0xaca6b0['attributes'][_0x77ae('0x36')]?_0xaca6b0[_0x77ae('0x34')]:_0x564023['model'];if(!_0x354557[_0x77ae('0x30')]['hasOwnProperty'](_0x77ae('0x37'))){_0xaca6b0[_0x77ae('0x1e')]=qs[_0x77ae('0x1e')](_0x354557[_0x77ae('0x30')]['limit']);_0xaca6b0['offset']=qs[_0x77ae('0x1d')](_0x354557['query'][_0x77ae('0x1d')]);}_0xaca6b0[_0x77ae('0x38')]=qs[_0x77ae('0x39')](_0x354557[_0x77ae('0x30')][_0x77ae('0x39')]);_0xaca6b0[_0x77ae('0x3a')]=qs['filters'](_[_0x77ae('0x3b')](_0x354557[_0x77ae('0x30')],_0x564023[_0x77ae('0x31')]),_0x28098c);if(_0x354557[_0x77ae('0x30')][_0x77ae('0x3c')]){_0xaca6b0['where']=_[_0x77ae('0x3d')](_0xaca6b0[_0x77ae('0x3a')],{'$or':_['map'](_0x28098c,function(_0x1536e7){if(_0x1536e7[_0x77ae('0x2d')]!==_0x77ae('0x3e')){var _0x2aedee={};_0x2aedee[_0x1536e7[_0x77ae('0x29')]]={'$like':'%'+_0x354557['query'][_0x77ae('0x3c')]+'%'};return _0x2aedee;}})});}_0xaca6b0=_['merge']({},_0xaca6b0,_0x354557[_0x77ae('0x3f')]);var _0x541510={'where':_0xaca6b0[_0x77ae('0x3a')]};return db['Dynamics365Account'][_0x77ae('0x20')](_0x541510)[_0x77ae('0x26')](function(_0x3d5e39){_0x1fafbd[_0x77ae('0x20')]=_0x3d5e39;if(_0x354557['query'][_0x77ae('0x40')]){_0xaca6b0[_0x77ae('0x41')]=[{'all':!![]}];}return db[_0x77ae('0x42')][_0x77ae('0x43')](_0xaca6b0);})['then'](function(_0x590b16){_0x1fafbd[_0x77ae('0x44')]=_0x590b16;return _0x1fafbd;})[_0x77ae('0x26')](respondWithFilteredResult(_0x4803e8,_0xaca6b0))[_0x77ae('0x45')](handleError(_0x4803e8,null));};exports['show']=function(_0x4d33d7,_0x2cc8bc){var _0x275b1c={'raw':![],'where':{'id':_0x4d33d7[_0x77ae('0x46')]['id']}},_0x4c7f4d={};_0x4c7f4d[_0x77ae('0x33')]=_['keys'](db[_0x77ae('0x42')][_0x77ae('0x2c')]);_0x4c7f4d[_0x77ae('0x30')]=_[_0x77ae('0x2f')](_0x4d33d7[_0x77ae('0x30')]);_0x4c7f4d[_0x77ae('0x31')]=_[_0x77ae('0x32')](_0x4c7f4d[_0x77ae('0x33')],_0x4c7f4d[_0x77ae('0x30')]);_0x275b1c['attributes']=_[_0x77ae('0x32')](_0x4c7f4d[_0x77ae('0x33')],qs[_0x77ae('0x35')](_0x4d33d7[_0x77ae('0x30')]['fields']));_0x275b1c[_0x77ae('0x34')]=_0x275b1c[_0x77ae('0x34')][_0x77ae('0x36')]?_0x275b1c['attributes']:_0x4c7f4d[_0x77ae('0x33')];if(_0x4d33d7[_0x77ae('0x30')][_0x77ae('0x40')]){_0x275b1c[_0x77ae('0x41')]=[{'all':!![]}];}_0x275b1c=_[_0x77ae('0x3d')]({},_0x275b1c,_0x4d33d7['options']);return db[_0x77ae('0x42')][_0x77ae('0x47')](_0x275b1c)[_0x77ae('0x26')](handleEntityNotFound(_0x2cc8bc,null))['then'](respondWithResult(_0x2cc8bc,null))[_0x77ae('0x45')](handleError(_0x2cc8bc,null));};exports[_0x77ae('0x48')]=function(_0x5c39bc,_0x1d936f){return db[_0x77ae('0x42')][_0x77ae('0x48')](_0x5c39bc[_0x77ae('0x49')],{})['then'](respondWithResult(_0x1d936f,0xc9))[_0x77ae('0x45')](handleError(_0x1d936f,null));};exports[_0x77ae('0x4a')]=function(_0x3bd6f5,_0x46ecf1){if(_0x3bd6f5['body']['id']){delete _0x3bd6f5[_0x77ae('0x49')]['id'];}return db[_0x77ae('0x42')][_0x77ae('0x47')]({'where':{'id':_0x3bd6f5[_0x77ae('0x46')]['id']}})[_0x77ae('0x26')](handleEntityNotFound(_0x46ecf1,null))[_0x77ae('0x26')](saveUpdates(_0x3bd6f5[_0x77ae('0x49')],null))[_0x77ae('0x26')](respondWithResult(_0x46ecf1,null))[_0x77ae('0x45')](handleError(_0x46ecf1,null));};exports[_0x77ae('0x25')]=function(_0x20459a,_0x62334d){return db[_0x77ae('0x42')]['find']({'where':{'id':_0x20459a['params']['id']}})['then'](handleEntityNotFound(_0x62334d,null))[_0x77ae('0x26')](removeEntity(_0x62334d,null))[_0x77ae('0x45')](handleError(_0x62334d,null));};exports[_0x77ae('0x4b')]=function(_0x3c91a4,_0x2d68f6,_0x56b931){var _0x14dd79={};var _0x4e4385={};var _0x198acd;var _0x19b6b0;return db[_0x77ae('0x42')][_0x77ae('0x4c')]({'where':{'id':_0x3c91a4['params']['id']}})[_0x77ae('0x26')](handleEntityNotFound(_0x2d68f6,null))[_0x77ae('0x26')](function(_0x58a52a){if(_0x58a52a){_0x198acd=_0x58a52a;_0x4e4385[_0x77ae('0x33')]=_[_0x77ae('0x2f')](db[_0x77ae('0x4d')][_0x77ae('0x2c')]);_0x4e4385[_0x77ae('0x30')]=_[_0x77ae('0x2f')](_0x3c91a4[_0x77ae('0x30')]);_0x4e4385[_0x77ae('0x31')]=_[_0x77ae('0x32')](_0x4e4385['model'],_0x4e4385[_0x77ae('0x30')]);_0x14dd79['attributes']=_[_0x77ae('0x32')](_0x4e4385[_0x77ae('0x33')],qs['fields'](_0x3c91a4[_0x77ae('0x30')][_0x77ae('0x35')]));_0x14dd79[_0x77ae('0x34')]=_0x14dd79[_0x77ae('0x34')][_0x77ae('0x36')]?_0x14dd79[_0x77ae('0x34')]:_0x4e4385[_0x77ae('0x33')];_0x14dd79[_0x77ae('0x38')]=qs['sort'](_0x3c91a4['query'][_0x77ae('0x39')]);_0x14dd79[_0x77ae('0x3a')]=qs[_0x77ae('0x31')](_[_0x77ae('0x3b')](_0x3c91a4[_0x77ae('0x30')],_0x4e4385['filters']));if(_0x3c91a4['query']['filter']){_0x14dd79[_0x77ae('0x3a')]=_[_0x77ae('0x3d')](_0x14dd79[_0x77ae('0x3a')],{'$or':_[_0x77ae('0x2b')](_0x14dd79[_0x77ae('0x34')],function(_0x58e99c){var _0x4e6b7f={};_0x4e6b7f[_0x58e99c]={'$like':'%'+_0x3c91a4[_0x77ae('0x30')][_0x77ae('0x3c')]+'%'};return _0x4e6b7f;})});}_0x14dd79=_[_0x77ae('0x3d')]({},_0x14dd79,_0x3c91a4[_0x77ae('0x3f')]);return _0x198acd['getConfigurations'](_0x14dd79);}})[_0x77ae('0x26')](function(_0x269430){if(_0x269430){_0x19b6b0=_0x269430[_0x77ae('0x36')];if(!_0x3c91a4[_0x77ae('0x30')][_0x77ae('0x4e')]('nolimit')){_0x14dd79[_0x77ae('0x1e')]=qs[_0x77ae('0x1e')](_0x3c91a4[_0x77ae('0x30')][_0x77ae('0x1e')]);_0x14dd79[_0x77ae('0x1d')]=qs[_0x77ae('0x1d')](_0x3c91a4[_0x77ae('0x30')][_0x77ae('0x1d')]);}return _0x198acd[_0x77ae('0x4b')](_0x14dd79);}})[_0x77ae('0x26')](function(_0x344425){if(_0x344425){return _0x344425?{'count':_0x19b6b0,'rows':_0x344425}:null;}})['then'](respondWithResult(_0x2d68f6,null))['catch'](handleError(_0x2d68f6,null));};exports[_0x77ae('0x4f')]=function(_0x5e3183,_0x325f58,_0x5c4700){if(_0x5e3183[_0x77ae('0x49')]['id']){delete _0x5e3183['body']['id'];}return db[_0x77ae('0x42')][_0x77ae('0x4c')]({'where':{'id':_0x5e3183[_0x77ae('0x46')]['id']}})[_0x77ae('0x26')](handleEntityNotFound(_0x325f58,null))[_0x77ae('0x26')](function(_0xef61f0){if(_0xef61f0){_0x5e3183[_0x77ae('0x49')]['AccountId']=_0xef61f0['id'];_0x5e3183['body'][_0x77ae('0x50')]=integrations['getSubjects'](_0x5e3183[_0x77ae('0x49')][_0x77ae('0x51')],_0x5e3183['body'][_0x77ae('0x2d')]);_0x5e3183['body']['Descriptions']=integrations[_0x77ae('0x52')](_0x5e3183[_0x77ae('0x49')][_0x77ae('0x51')],_0x5e3183[_0x77ae('0x49')][_0x77ae('0x2d')]);return db[_0x77ae('0x4d')][_0x77ae('0x48')](_0x5e3183[_0x77ae('0x49')],{'include':[{'model':db[_0x77ae('0x53')],'as':_0x77ae('0x50')},{'model':db[_0x77ae('0x53')],'as':'Descriptions'}]});}return null;})[_0x77ae('0x26')](respondWithResult(_0x325f58,null))[_0x77ae('0x45')](handleError(_0x325f58,null));};exports[_0x77ae('0x54')]=function(_0x387264,_0x5be1c0,_0x25695d){var _0x2f7da1=_0x387264['query'][_0x77ae('0x55')];var _0x1da5b5=_0x2f7da1===_0x77ae('0x56')?_0x77ae('0x57'):_0x77ae('0x58');var _0x253104='';var _0x4b4fcf='';var _0x4ec24d='';var _0x236437='';var _0x14045e='';var _0x3b2b7e='';var _0x4c2992='';var _0x20ce48='';var _0x332336=['title','description','customerid',_0x77ae('0x59'),_0x77ae('0x5a'),_0x77ae('0x5b'),_0x77ae('0x5c'),'regardingobjectid','directioncode',_0x77ae('0x5d')];var _0x36a2b6=[_0x77ae('0x5e'),_0x77ae('0x5f'),_0x77ae('0x60'),_0x77ae('0x61'),_0x77ae('0x62'),_0x77ae('0x63'),_0x77ae('0x64'),_0x77ae('0x65'),_0x77ae('0x66'),_0x77ae('0x67'),'createdbyname',_0x77ae('0x68'),'createdon',_0x77ae('0x69'),_0x77ae('0x6a'),'customeridname',_0x77ae('0x6b'),_0x77ae('0x6c'),_0x77ae('0x6d'),_0x77ae('0x6e'),_0x77ae('0x6f'),_0x77ae('0x70'),_0x77ae('0x71'),'exchangerate',_0x77ae('0x72'),_0x77ae('0x73'),_0x77ae('0x74'),'influencescore',_0x77ae('0x75'),_0x77ae('0x76'),_0x77ae('0x77'),_0x77ae('0x78'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x77ae('0x79'),_0x77ae('0x7a'),_0x77ae('0x7b'),'modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents',_0x77ae('0x7c'),'overriddencreatedon',_0x77ae('0x7d'),_0x77ae('0x7e'),_0x77ae('0x7f'),_0x77ae('0x80'),_0x77ae('0x81'),_0x77ae('0x82'),_0x77ae('0x83'),_0x77ae('0x84'),_0x77ae('0x85'),'resolveby',_0x77ae('0x86'),_0x77ae('0x87'),_0x77ae('0x88'),_0x77ae('0x89'),_0x77ae('0x8a'),_0x77ae('0x8b'),_0x77ae('0x8c'),'socialprofileidname',_0x77ae('0x8d'),'statuscode',_0x77ae('0x8e'),_0x77ae('0x8f'),_0x77ae('0x90'),_0x77ae('0x91'),_0x77ae('0x92'),'utcconversiontimezonecode',_0x77ae('0x93')];var _0x2c36f2=_0x332336[_0x77ae('0x94')](_0x36a2b6);return db[_0x77ae('0x42')][_0x77ae('0x4c')]({'where':{'id':_0x387264[_0x77ae('0x46')]['id']},'attributes':['id',_0x77ae('0x95'),'password','remoteUri',_0x77ae('0x96'),_0x77ae('0x97'),_0x77ae('0x98')]})['then'](handleEntityNotFound(_0x5be1c0,null))[_0x77ae('0x26')](function(_0x3252d9){if(_0x3252d9){_0x20ce48=_0x3252d9[_0x77ae('0x99')];var _0x8b2d06=_0x20ce48[_0x77ae('0x9a')](-0x1);if(_0x8b2d06==='/'){_0x20ce48=_0x20ce48[_0x77ae('0x9b')](0x0,_0x20ce48[_0x77ae('0x9c')](_0x8b2d06));}_0x4c2992=util[_0x77ae('0x9d')](_0x77ae('0x9e'),_0x20ce48);var _0x51594f={'method':_0x77ae('0x9f'),'uri':_0x77ae('0xa0')+_0x3252d9['tenantId']+'/oauth2/token','form':{'client_id':_0x3252d9[_0x77ae('0x97')],'resource':_0x20ce48,'username':_0x3252d9['username'],'password':_0x3252d9[_0x77ae('0xa1')],'grant_type':_0x77ae('0xa1'),'client_secret':_0x3252d9[_0x77ae('0x98')]},'json':!![]};return rp(_0x51594f);}})['then'](function(_0x2e6508){_0x3b2b7e=_0x2e6508['access_token'];var _0x57bb8e={'method':_0x77ae('0xa2'),'uri':encodeURI(_0x4c2992+_0x77ae('0xa3')+_0x1da5b5+'\x27'),'headers':{'Authorization':_0x77ae('0xa4')+_0x3b2b7e,'If-None-Match':null,'OData-Version':_0x77ae('0xa5')},'json':!![]};return rp(_0x57bb8e);})[_0x77ae('0x26')](function(_0x55712a){var _0x40ca5d=_0x55712a[_0x77ae('0xa6')][0x0];var _0x2ca4a1=_0x40ca5d[_0x77ae('0xa7')];var _0xf2eff9={'method':_0x77ae('0xa2'),'uri':_0x4c2992+_0x77ae('0xa8')+_0x2ca4a1+_0x77ae('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x3b2b7e,'If-None-Match':null,'OData-Version':_0x77ae('0xa5')},'json':!![]};return rp(_0xf2eff9);})[_0x77ae('0x26')](function(_0x371456){_0x253104=_0x371456;_0x4b4fcf=_0x253104[_0x77ae('0xaa')];_0x4b4fcf=_[_0x77ae('0xab')](_0x4b4fcf,function(_0x4fe825){return!_0x2c36f2[_0x77ae('0xac')](_0x4fe825[_0x77ae('0xad')]);});var _0x1ef33e=[];var _0x3ca87b=[];_0x4b4fcf[_0x77ae('0xae')](function(_0x4b85da){if(_0x4b85da[_0x77ae('0xaf')]){var _0x567b34=_0x4b85da[_0x77ae('0xaf')][_0x77ae('0x9b')](_0x4b85da['@odata.type'][_0x77ae('0x9c')]('.')+0x1);if(_0x567b34===_0x77ae('0xb0')){_0x1ef33e[_0x77ae('0xb1')](getSelectList(_0x4c2992,_0x2f7da1,_0x3ca87b,_0x253104[_0x77ae('0xa7')],_0x4b85da[_0x77ae('0xa7')],_0x3b2b7e));}}});return Promise[_0x77ae('0xb2')](_0x1ef33e);})['then'](function(_0x4ffcd6){_0x4ec24d=_0x4ffcd6[0x0];var _0x16f97b=[];var _0x275e49=[];_0x4b4fcf['forEach'](function(_0xae6ac){if(!_[_0x77ae('0xb3')](_0xae6ac[_0x77ae('0xaf')])){var _0x571a0f=_0xae6ac['@odata.type']['substring'](_0xae6ac[_0x77ae('0xaf')][_0x77ae('0x9c')]('.')+0x1);if(_0x571a0f===_0x77ae('0xb4')){_0x16f97b[_0x77ae('0xb1')](getBooleanList(_0x4c2992,_0x2f7da1,_0x275e49,_0x253104[_0x77ae('0xa7')],_0xae6ac[_0x77ae('0xa7')],_0x3b2b7e));}}});return Promise[_0x77ae('0xb2')](_0x16f97b);})[_0x77ae('0x26')](function(_0x4cc105){_0x236437=_0x4cc105[0x0];var _0x5883c3=[];var _0x4c2768=[];_0x4b4fcf[_0x77ae('0xae')](function(_0x25c244){if(_0x25c244[_0x77ae('0xaf')]){var _0x51fa15=_0x25c244['@odata.type'][_0x77ae('0x9b')](_0x25c244[_0x77ae('0xaf')][_0x77ae('0x9c')]('.')+0x1);if(_0x51fa15===_0x77ae('0xb5')||_0x51fa15===_0x77ae('0xb6')||_0x51fa15==='BigIntAttributeMetadata'||_0x51fa15===_0x77ae('0xb7')||_0x51fa15===_0x77ae('0xb8')||_0x51fa15===_0x77ae('0xb9')||_0x51fa15===_0x77ae('0xba')||_0x51fa15==='EntityNameAttributeMetadata'||_0x51fa15===_0x77ae('0xbb')||_0x51fa15===_0x77ae('0xbc')){_0x5883c3[_0x77ae('0xb1')](getInputList(_0x4c2992,_0x2f7da1,_0x51fa15,_0x4c2768,_0x253104[_0x77ae('0xa7')],_0x25c244[_0x77ae('0xa7')],_0x3b2b7e));}}});return Promise[_0x77ae('0xb2')](_0x5883c3);})['then'](function(_0x13c49f){_0x14045e=_0x13c49f[0x0];var _0x81cb0b=_0x4ec24d[_0x77ae('0x94')](_0x236437)[_0x77ae('0x94')](_0x14045e);var _0xe0b14={'count':_0x81cb0b['length'],'rows':_0x81cb0b};return _0xe0b14;})['then'](respondWithResult(_0x5be1c0,null))[_0x77ae('0x45')](function(_0x1ef9e5){var _0x1157cd=_0x387264[_0x77ae('0x30')]['test']?0x1f4:_0x1ef9e5['statusCode']||0x1f4;logger[_0x77ae('0xbd')](_0x1ef9e5[_0x77ae('0x28')]);delete _0x1ef9e5['name'];if(_0x1157cd===0x191){_0x1157cd=0x190;}_0x5be1c0[_0x77ae('0x1b')](_0x1157cd)[_0x77ae('0x2a')](_0x387264[_0x77ae('0x30')][_0x77ae('0xbe')]?{'message':_0x77ae('0xbf'),'statusCode':_0x1ef9e5['statusCode']}:_0x1ef9e5);});};function getSelectList(_0x5d0463,_0x5cf777,_0x1b3665,_0x2d57dd,_0x4a6913,_0x1b6a85){var _0x21525a={'method':'GET','uri':_0x5d0463+_0x77ae('0xa8')+_0x2d57dd+_0x77ae('0xc0')+_0x4a6913+_0x77ae('0xc1')+_0x77ae('0xc2'),'headers':{'Authorization':_0x77ae('0xa4')+_0x1b6a85,'If-None-Match':null,'OData-Version':_0x77ae('0xa5')},'json':!![]};return rp(_0x21525a)[_0x77ae('0x26')](function(_0x103985){var _0x5d72d0=[];var _0xc0c01d=_0x103985[_0x77ae('0xc3')]['Options'];_0xc0c01d['forEach'](function(_0x1e5039){_0x5d72d0[_0x77ae('0xb1')]({'name':_0x1e5039['Label'][_0x77ae('0xc4')]['Label'],'value':String(_0x1e5039['Value'])});});var _0x53c4ac={'id':_0x5cf777+'_'+_0x103985[_0x77ae('0xad')],'name':_0x103985['DisplayName'][_0x77ae('0xc4')][_0x77ae('0xc5')],'custom':![],'options':_0x5d72d0};_0x1b3665[_0x77ae('0xb1')](_0x53c4ac);return _0x1b3665;});}function getBooleanList(_0x101cf0,_0x47456d,_0x41d356,_0x15393d,_0x2bb25e,_0x559bb5){var _0x233dec={'method':_0x77ae('0xa2'),'uri':_0x101cf0+'EntityDefinitions('+_0x15393d+_0x77ae('0xc0')+_0x2bb25e+_0x77ae('0xc6'),'headers':{'Authorization':_0x77ae('0xa4')+_0x559bb5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x233dec)['then'](function(_0x196a65){var _0x223e46=[];_0x223e46[_0x77ae('0xb1')]({'name':_0x196a65[_0x77ae('0xc3')][_0x77ae('0xc7')]['Label']['UserLocalizedLabel'][_0x77ae('0xc5')],'value':_0x77ae('0xc8')},{'name':_0x196a65[_0x77ae('0xc3')][_0x77ae('0xc9')][_0x77ae('0xc5')][_0x77ae('0xc4')][_0x77ae('0xc5')],'value':_0x77ae('0xca')});var _0x43e2ef={'id':_0x47456d+'_'+_0x196a65[_0x77ae('0xad')],'name':_0x196a65[_0x77ae('0xcb')][_0x77ae('0xc4')][_0x77ae('0xc5')],'custom':![],'options':_0x223e46};_0x41d356[_0x77ae('0xb1')](_0x43e2ef);return _0x41d356;});}function getInputList(_0x217d5c,_0x11eaa7,_0x44f160,_0x45a60a,_0x500da6,_0x10f2ea,_0x45309d){var _0x4ae891={'method':_0x77ae('0xa2'),'uri':_0x217d5c+'EntityDefinitions('+_0x500da6+_0x77ae('0xc0')+_0x10f2ea+')/Microsoft.Dynamics.CRM.'+_0x44f160+_0x77ae('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x45309d,'If-None-Match':null,'OData-Version':_0x77ae('0xa5')},'json':!![]};return rp(_0x4ae891)['then'](function(_0x40ee3d){var _0x42da3b={'id':_0x11eaa7+'_'+_0x40ee3d[_0x77ae('0xad')],'name':_0x40ee3d[_0x77ae('0xcb')][_0x77ae('0xc4')]?_0x40ee3d['DisplayName'][_0x77ae('0xc4')][_0x77ae('0xc5')]:_0x40ee3d['LogicalName'],'custom':![],'options':[]};_0x45a60a[_0x77ae('0xb1')](_0x42da3b);return _0x45a60a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 49e5b3e..253f978 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x23321d,_0x5f35d8){var _0xc812a8=function(_0x1ae620){while(--_0x1ae620){_0x23321d['push'](_0x23321d['shift']());}};_0xc812a8(++_0x5f35d8);}(_0xe706,0xa3));var _0x6e70=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0xe706[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x198f34,_0x8b2681){var _0x2ac744=function(_0x4b527f){while(--_0x4b527f){_0x198f34['push'](_0x198f34['shift']());}};_0x2ac744(++_0x8b2681);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0xcb91[_0x402731];return _0x111736;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('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 04b0c0c..93c098b 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 _0xce4b=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','options','raw','where','attributes','limit','include','map','model','then','ShowDynamics365Account','Dynamics365Account','find'];(function(_0x27c522,_0x21f5f1){var _0xc23dae=function(_0x268727){while(--_0x268727){_0x27c522['push'](_0x27c522['shift']());}};_0xc23dae(++_0x21f5f1);}(_0xce4b,0xd2));var _0xbce4=function(_0xfbecc4,_0x2a4953){_0xfbecc4=_0xfbecc4-0x0;var _0x10572d=_0xce4b[_0xfbecc4];return _0x10572d;};'use strict';var _=require(_0xbce4('0x0'));var util=require('util');var moment=require(_0xbce4('0x1'));var BPromise=require(_0xbce4('0x2'));var rs=require(_0xbce4('0x3'));var fs=require('fs');var Redis=require(_0xbce4('0x4'));var db=require(_0xbce4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce4('0x6'))(_0xbce4('0x7'));var config=require(_0xbce4('0x8'));var jayson=require(_0xbce4('0x9'));var client=jayson[_0xbce4('0xa')][_0xbce4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42aa41,_0x19e9da,_0x2d5814){return new BPromise(function(_0x41c93b,_0x39675f){return client['request'](_0x42aa41,_0x2d5814)['then'](function(_0x71cb36){logger[_0xbce4('0xc')](_0xbce4('0xd'),_0x19e9da,_0xbce4('0xe'));logger[_0xbce4('0xf')](_0xbce4('0x10'),_0x19e9da,_0xbce4('0xe'),JSON[_0xbce4('0x11')](_0x71cb36));if(_0x71cb36['error']){if(_0x71cb36[_0xbce4('0x12')][_0xbce4('0x13')]===0x1f4){logger[_0xbce4('0x12')](_0xbce4('0xd'),_0x19e9da,_0x71cb36['error'][_0xbce4('0x14')]);return _0x39675f(_0x71cb36['error']['message']);}logger[_0xbce4('0x12')](_0xbce4('0xd'),_0x19e9da,_0x71cb36[_0xbce4('0x12')][_0xbce4('0x14')]);return _0x41c93b(_0x71cb36[_0xbce4('0x12')][_0xbce4('0x14')]);}else{logger[_0xbce4('0xc')](_0xbce4('0xd'),_0x19e9da,_0xbce4('0xe'));_0x41c93b(_0x71cb36['result']['message']);}})[_0xbce4('0x15')](function(_0x1e480a){logger['error'](_0xbce4('0xd'),_0x19e9da,_0x1e480a);_0x39675f(_0x1e480a);});});}exports[_0xbce4('0x16')]=function(_0x35e264){var _0x3a6c5e=this;return new Promise(function(_0xcc44a8,_0x46033a){return db['Dynamics365Account']['findAll']({'raw':_0x35e264[_0xbce4('0x17')]?_0x35e264['options'][_0xbce4('0x18')]===undefined?!![]:![]:!![],'where':_0x35e264[_0xbce4('0x17')]?_0x35e264[_0xbce4('0x17')][_0xbce4('0x19')]||null:null,'attributes':_0x35e264[_0xbce4('0x17')]?_0x35e264[_0xbce4('0x17')][_0xbce4('0x1a')]||null:null,'limit':_0x35e264['options']?_0x35e264['options'][_0xbce4('0x1b')]||null:null,'include':_0x35e264[_0xbce4('0x17')]?_0x35e264['options'][_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x35e264['options'][_0xbce4('0x1c')],function(_0x5ba141){return{'model':db[_0x5ba141[_0xbce4('0x1e')]],'as':_0x5ba141['as'],'attributes':_0x5ba141[_0xbce4('0x1a')],'include':_0x5ba141['include']?_[_0xbce4('0x1d')](_0x5ba141[_0xbce4('0x1c')],function(_0x434bce){return{'model':db[_0x434bce[_0xbce4('0x1e')]],'as':_0x434bce['as'],'attributes':_0x434bce[_0xbce4('0x1a')],'include':_0x434bce[_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x434bce['include'],function(_0x13f5af){return{'model':db[_0x13f5af[_0xbce4('0x1e')]],'as':_0x13f5af['as'],'attributes':_0x13f5af[_0xbce4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbce4('0x1f')](function(_0x484001){logger['info']('GetDynamics365Account',_0x35e264);logger['debug'](_0xbce4('0x16'),_0x35e264,JSON[_0xbce4('0x11')](_0x484001));_0xcc44a8(_0x484001);})['catch'](function(_0x19489){logger[_0xbce4('0x12')]('GetDynamics365Account',_0x19489['message'],_0x35e264);_0x46033a(_0x3a6c5e[_0xbce4('0x12')](0x1f4,_0x19489[_0xbce4('0x14')]));});});};exports[_0xbce4('0x20')]=function(_0x1e7102){var _0x3b06e8=this;return new Promise(function(_0x3c79ff,_0x6ddf11){return db[_0xbce4('0x21')][_0xbce4('0x22')]({'raw':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x18')]===undefined?!![]:![]:!![],'where':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x19')]||null:null,'attributes':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')]['attributes']||null:null,'include':_0x1e7102[_0xbce4('0x17')]?_0x1e7102[_0xbce4('0x17')][_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x1e7102[_0xbce4('0x17')]['include'],function(_0x4047fb){return{'model':db[_0x4047fb[_0xbce4('0x1e')]],'as':_0x4047fb['as'],'attributes':_0x4047fb[_0xbce4('0x1a')],'include':_0x4047fb[_0xbce4('0x1c')]?_[_0xbce4('0x1d')](_0x4047fb[_0xbce4('0x1c')],function(_0x5af657){return{'model':db[_0x5af657['model']],'as':_0x5af657['as'],'attributes':_0x5af657[_0xbce4('0x1a')],'include':_0x5af657[_0xbce4('0x1c')]?_['map'](_0x5af657[_0xbce4('0x1c')],function(_0x35ad72){return{'model':db[_0x35ad72[_0xbce4('0x1e')]],'as':_0x35ad72['as'],'attributes':_0x35ad72[_0xbce4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b0ab1){logger[_0xbce4('0xc')](_0xbce4('0x20'),_0x1e7102);logger[_0xbce4('0xf')](_0xbce4('0x20'),_0x1e7102,JSON['stringify'](_0x3b0ab1));_0x3c79ff(_0x3b0ab1);})[_0xbce4('0x15')](function(_0x243e7d){logger[_0xbce4('0x12')](_0xbce4('0x20'),_0x243e7d[_0xbce4('0x14')],_0x1e7102);_0x6ddf11(_0x3b06e8[_0xbce4('0x12')](0x1f4,_0x243e7d[_0xbce4('0x14')]));});});}; \ No newline at end of file +var _0x3116=['include','model','map','then','ShowDynamics365Account','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetDynamics365Account','findAll','options','raw','attributes','limit'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x3116,0xb6));var _0x6311=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3116[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0x6311('0x0'));var moment=require(_0x6311('0x1'));var BPromise=require(_0x6311('0x2'));var rs=require(_0x6311('0x3'));var fs=require('fs');var Redis=require(_0x6311('0x4'));var db=require(_0x6311('0x5'))['db'];var utils=require(_0x6311('0x6'));var logger=require(_0x6311('0x7'))(_0x6311('0x8'));var config=require(_0x6311('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6311('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a2b5,_0x217b68,_0x4afd53){return new BPromise(function(_0x25c728,_0x15c0d0){return client[_0x6311('0xb')](_0x50a2b5,_0x4afd53)['then'](function(_0x4a66a2){logger[_0x6311('0xc')](_0x6311('0xd'),_0x217b68,'request\x20sent');logger[_0x6311('0xe')](_0x6311('0xf'),_0x217b68,'request\x20sent',JSON[_0x6311('0x10')](_0x4a66a2));if(_0x4a66a2[_0x6311('0x11')]){if(_0x4a66a2[_0x6311('0x11')]['code']===0x1f4){logger[_0x6311('0x11')](_0x6311('0xd'),_0x217b68,_0x4a66a2[_0x6311('0x11')][_0x6311('0x12')]);return _0x15c0d0(_0x4a66a2['error']['message']);}logger['error'](_0x6311('0xd'),_0x217b68,_0x4a66a2[_0x6311('0x11')][_0x6311('0x12')]);return _0x25c728(_0x4a66a2[_0x6311('0x11')]['message']);}else{logger[_0x6311('0xc')](_0x6311('0xd'),_0x217b68,_0x6311('0x13'));_0x25c728(_0x4a66a2[_0x6311('0x14')][_0x6311('0x12')]);}})[_0x6311('0x15')](function(_0x165661){logger[_0x6311('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x217b68,_0x165661);_0x15c0d0(_0x165661);});});}exports[_0x6311('0x16')]=function(_0x32dc75){var _0x36a5a8=this;return new Promise(function(_0x2d0978,_0x4e7c59){return db['Dynamics365Account'][_0x6311('0x17')]({'raw':_0x32dc75[_0x6311('0x18')]?_0x32dc75[_0x6311('0x18')][_0x6311('0x19')]===undefined?!![]:![]:!![],'where':_0x32dc75[_0x6311('0x18')]?_0x32dc75[_0x6311('0x18')]['where']||null:null,'attributes':_0x32dc75['options']?_0x32dc75[_0x6311('0x18')][_0x6311('0x1a')]||null:null,'limit':_0x32dc75[_0x6311('0x18')]?_0x32dc75[_0x6311('0x18')][_0x6311('0x1b')]||null:null,'include':_0x32dc75[_0x6311('0x18')]?_0x32dc75[_0x6311('0x18')][_0x6311('0x1c')]?_['map'](_0x32dc75['options'][_0x6311('0x1c')],function(_0x2f449e){return{'model':db[_0x2f449e[_0x6311('0x1d')]],'as':_0x2f449e['as'],'attributes':_0x2f449e[_0x6311('0x1a')],'include':_0x2f449e[_0x6311('0x1c')]?_['map'](_0x2f449e[_0x6311('0x1c')],function(_0x3bfb09){return{'model':db[_0x3bfb09[_0x6311('0x1d')]],'as':_0x3bfb09['as'],'attributes':_0x3bfb09[_0x6311('0x1a')],'include':_0x3bfb09['include']?_[_0x6311('0x1e')](_0x3bfb09[_0x6311('0x1c')],function(_0x4e07a1){return{'model':db[_0x4e07a1[_0x6311('0x1d')]],'as':_0x4e07a1['as'],'attributes':_0x4e07a1[_0x6311('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6311('0x1f')](function(_0x3927e7){logger[_0x6311('0xc')](_0x6311('0x16'),_0x32dc75);logger[_0x6311('0xe')](_0x6311('0x16'),_0x32dc75,JSON['stringify'](_0x3927e7));_0x2d0978(_0x3927e7);})[_0x6311('0x15')](function(_0x5d4c50){logger['error'](_0x6311('0x16'),_0x5d4c50[_0x6311('0x12')],_0x32dc75);_0x4e7c59(_0x36a5a8[_0x6311('0x11')](0x1f4,_0x5d4c50[_0x6311('0x12')]));});});};exports[_0x6311('0x20')]=function(_0x1e72b6){var _0x27e4ea=this;return new Promise(function(_0x37e6a8,_0x34d293){return db['Dynamics365Account'][_0x6311('0x21')]({'raw':_0x1e72b6['options']?_0x1e72b6[_0x6311('0x18')][_0x6311('0x19')]===undefined?!![]:![]:!![],'where':_0x1e72b6['options']?_0x1e72b6['options'][_0x6311('0x22')]||null:null,'attributes':_0x1e72b6['options']?_0x1e72b6[_0x6311('0x18')][_0x6311('0x1a')]||null:null,'include':_0x1e72b6['options']?_0x1e72b6['options'][_0x6311('0x1c')]?_[_0x6311('0x1e')](_0x1e72b6[_0x6311('0x18')][_0x6311('0x1c')],function(_0x47aff0){return{'model':db[_0x47aff0['model']],'as':_0x47aff0['as'],'attributes':_0x47aff0['attributes'],'include':_0x47aff0[_0x6311('0x1c')]?_[_0x6311('0x1e')](_0x47aff0['include'],function(_0x2913a0){return{'model':db[_0x2913a0[_0x6311('0x1d')]],'as':_0x2913a0['as'],'attributes':_0x2913a0[_0x6311('0x1a')],'include':_0x2913a0['include']?_[_0x6311('0x1e')](_0x2913a0[_0x6311('0x1c')],function(_0x4e4bf1){return{'model':db[_0x4e4bf1[_0x6311('0x1d')]],'as':_0x4e4bf1['as'],'attributes':_0x4e4bf1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6311('0x1f')](function(_0x2977c4){logger[_0x6311('0xc')](_0x6311('0x20'),_0x1e72b6);logger[_0x6311('0xe')](_0x6311('0x20'),_0x1e72b6,JSON[_0x6311('0x10')](_0x2977c4));_0x37e6a8(_0x2977c4);})[_0x6311('0x15')](function(_0x18393e){logger[_0x6311('0x11')](_0x6311('0x20'),_0x18393e[_0x6311('0x12')],_0x1e72b6);_0x34d293(_0x27e4ea[_0x6311('0x11')](0x1f4,_0x18393e[_0x6311('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 5b22043..62d6cf1 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 _0x1921=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x3a92eb,_0x19667f){var _0x3c30d6=function(_0x4f0f1f){while(--_0x4f0f1f){_0x3a92eb['push'](_0x3a92eb['shift']());}};_0x3c30d6(++_0x19667f);}(_0x1921,0xe4));var _0x1192=function(_0x4f71ac,_0x3eafd5){_0x4f71ac=_0x4f71ac-0x0;var _0x1bfdca=_0x1921[_0x4f71ac];return _0x1bfdca;};'use strict';var multer=require(_0x1192('0x0'));var util=require(_0x1192('0x1'));var path=require(_0x1192('0x2'));var timeout=require(_0x1192('0x3'));var express=require(_0x1192('0x4'));var router=express[_0x1192('0x5')]();var fs_extra=require(_0x1192('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1192('0x7'));var config=require(_0x1192('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x1192('0x9')]('/',auth[_0x1192('0xa')](),controller['index']);router[_0x1192('0x9')](_0x1192('0xb'),auth[_0x1192('0xa')](),controller[_0x1192('0xc')]);router[_0x1192('0x9')](_0x1192('0xd'),auth[_0x1192('0xa')](),controller[_0x1192('0xe')]);router[_0x1192('0x9')](_0x1192('0xf'),auth[_0x1192('0xa')](),controller[_0x1192('0x10')]);router[_0x1192('0x9')](_0x1192('0x11'),auth[_0x1192('0xa')](),controller[_0x1192('0x12')]);router[_0x1192('0x13')]('/',auth[_0x1192('0xa')](),controller[_0x1192('0x14')]);router[_0x1192('0x15')](_0x1192('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1192('0x16')](_0x1192('0xb'),auth[_0x1192('0xa')](),controller[_0x1192('0x17')]);module[_0x1192('0x18')]=router; \ No newline at end of file +var _0xaa83=['get','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','/:id','show'];(function(_0x39372d,_0xd77841){var _0xe35eba=function(_0x4b81ef){while(--_0x4b81ef){_0x39372d['push'](_0x39372d['shift']());}};_0xe35eba(++_0xd77841);}(_0xaa83,0x16a));var _0x3aa8=function(_0x459820,_0x1b8e1d){_0x459820=_0x459820-0x0;var _0xafadeb=_0xaa83[_0x459820];return _0xafadeb;};'use strict';var multer=require(_0x3aa8('0x0'));var util=require(_0x3aa8('0x1'));var path=require('path');var timeout=require(_0x3aa8('0x2'));var express=require(_0x3aa8('0x3'));var router=express[_0x3aa8('0x4')]();var fs_extra=require(_0x3aa8('0x5'));var auth=require(_0x3aa8('0x6'));var interaction=require(_0x3aa8('0x7'));var config=require(_0x3aa8('0x8'));var controller=require(_0x3aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3aa8('0xa')]);router['get'](_0x3aa8('0xb'),auth['isAuthenticated'](),controller[_0x3aa8('0xc')]);router[_0x3aa8('0xd')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3aa8('0xe')]);router[_0x3aa8('0xd')](_0x3aa8('0xf'),auth[_0x3aa8('0x10')](),controller[_0x3aa8('0x11')]);router[_0x3aa8('0xd')](_0x3aa8('0x12'),auth['isAuthenticated'](),controller[_0x3aa8('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3aa8('0x14')](_0x3aa8('0xb'),auth[_0x3aa8('0x10')](),controller[_0x3aa8('0x15')]);router[_0x3aa8('0x16')](_0x3aa8('0xb'),auth[_0x3aa8('0x10')](),controller[_0x3aa8('0x17')]);module[_0x3aa8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 0dc1a29..443f026 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 _0x638a=['phonecall','sequelize','STRING','ENUM','incident'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x638a,0x1e6));var _0xa638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa638('0x0'));module['exports']={'name':{'type':Sequelize[_0xa638('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa638('0x2')](_0xa638('0x3'),_0xa638('0x4')),'defaultValue':_0xa638('0x3')}}; \ No newline at end of file +var _0xb291=['ENUM','incident','exports','STRING'];(function(_0x3b72a0,_0x1fd8e2){var _0x5c4702=function(_0xc7d699){while(--_0xc7d699){_0x3b72a0['push'](_0x3b72a0['shift']());}};_0x5c4702(++_0x1fd8e2);}(_0xb291,0x1e6));var _0x1b29=function(_0x296aab,_0x11e6fe){_0x296aab=_0x296aab-0x0;var _0x3fc835=_0xb291[_0x296aab];return _0x3fc835;};'use strict';var Sequelize=require('sequelize');module[_0x1b29('0x0')]={'name':{'type':Sequelize[_0x1b29('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x1b29('0x2')](_0x1b29('0x3'),'phonecall'),'defaultValue':_0x1b29('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e68ee2a..31fa3ea 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 _0x449b=['order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','rows','show','params','rawAttributes','fields','options','find','catch','create','update','body','getFields','findOne','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','Dynamics365Configuration','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','nolimit'];(function(_0x3f5d78,_0x4b8b1f){var _0x221dd6=function(_0x28aacf){while(--_0x28aacf){_0x3f5d78['push'](_0x3f5d78['shift']());}};_0x221dd6(++_0x4b8b1f);}(_0x449b,0x6c));var _0xb449=function(_0x4409d1,_0x34555a){_0x4409d1=_0x4409d1-0x0;var _0x2baebf=_0x449b[_0x4409d1];return _0x2baebf;};'use strict';var emlformat=require(_0xb449('0x0'));var rimraf=require(_0xb449('0x1'));var zipdir=require(_0xb449('0x2'));var jsonpatch=require(_0xb449('0x3'));var rp=require(_0xb449('0x4'));var moment=require('moment');var BPromise=require(_0xb449('0x5'));var Mustache=require('mustache');var util=require(_0xb449('0x6'));var path=require(_0xb449('0x7'));var sox=require(_0xb449('0x8'));var csv=require(_0xb449('0x9'));var ejs=require(_0xb449('0xa'));var fs=require('fs');var fs_extra=require(_0xb449('0xb'));var _=require(_0xb449('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb449('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb449('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb449('0xe'));var authService=require(_0xb449('0xf'));var qs=require(_0xb449('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb449('0x11'));var logger=require(_0xb449('0x12'))(_0xb449('0x13'));var utils=require(_0xb449('0x14'));var config=require(_0xb449('0x15'));var licenseUtil=require(_0xb449('0x16'));var db=require(_0xb449('0x17'))['db'];function respondWithStatusCode(_0x2f4327,_0x122830){_0x122830=_0x122830||0xcc;return function(_0x4258aa){if(_0x4258aa){return _0x2f4327[_0xb449('0x18')](_0x122830);}return _0x2f4327[_0xb449('0x19')](_0x122830)[_0xb449('0x1a')]();};}function respondWithResult(_0x44e5dd,_0xe2a4dd){_0xe2a4dd=_0xe2a4dd||0xc8;return function(_0x5e0170){if(_0x5e0170){return _0x44e5dd[_0xb449('0x19')](_0xe2a4dd)[_0xb449('0x1b')](_0x5e0170);}};}function respondWithFilteredResult(_0x52a3e4,_0x561d1e){return function(_0x5dee25){if(_0x5dee25){var _0x52ff7b=typeof _0x561d1e[_0xb449('0x1c')]===_0xb449('0x1d')&&typeof _0x561d1e[_0xb449('0x1e')]===_0xb449('0x1d');var _0x461b17=_0x5dee25['count'];var _0x24276d=_0x52ff7b?0x0:_0x561d1e[_0xb449('0x1c')];var _0x5af7df=_0x52ff7b?_0x5dee25['count']:_0x561d1e[_0xb449('0x1c')]+_0x561d1e['limit'];var _0x5df75e;if(_0x5af7df>=_0x461b17){_0x5af7df=_0x461b17;_0x5df75e=0xc8;}else{_0x5df75e=0xce;}_0x52a3e4['status'](_0x5df75e);return _0x52a3e4[_0xb449('0x1f')](_0xb449('0x20'),_0x24276d+'-'+_0x5af7df+'/'+_0x461b17)[_0xb449('0x1b')](_0x5dee25);}return null;};}function patchUpdates(_0x157270){return function(_0x1b8b57){try{jsonpatch[_0xb449('0x21')](_0x1b8b57,_0x157270,!![]);}catch(_0x4c31d4){return BPromise[_0xb449('0x22')](_0x4c31d4);}return _0x1b8b57[_0xb449('0x23')]();};}function saveUpdates(_0x5458a8,_0x3dae44){return function(_0x29b30c){if(_0x29b30c){return _0x29b30c['update'](_0x5458a8)[_0xb449('0x24')](function(_0x3d6a81){return _0x3d6a81;});}return null;};}function removeEntity(_0x340b2c,_0x54ce09){return function(_0x212fe6){if(_0x212fe6){return _0x212fe6[_0xb449('0x25')]()[_0xb449('0x24')](function(){_0x340b2c[_0xb449('0x19')](0xcc)[_0xb449('0x1a')]();});}};}function handleEntityNotFound(_0x45b3b9,_0x11a2c0){return function(_0x54682a){if(!_0x54682a){_0x45b3b9[_0xb449('0x18')](0x194);}return _0x54682a;};}function handleError(_0x4e0930,_0x551790){_0x551790=_0x551790||0x1f4;return function(_0x3b55a8){logger[_0xb449('0x26')](_0x3b55a8[_0xb449('0x27')]);if(_0x3b55a8['name']){delete _0x3b55a8[_0xb449('0x28')];}_0x4e0930[_0xb449('0x19')](_0x551790)['send'](_0x3b55a8);};}exports['index']=function(_0x4daa3a,_0x264fc1){var _0x3dd491={},_0x189792={},_0x365ec6={'count':0x0,'rows':[]};var _0x212f98=_[_0xb449('0x29')](db[_0xb449('0x2a')]['rawAttributes'],function(_0x214056){return{'name':_0x214056[_0xb449('0x2b')],'type':_0x214056[_0xb449('0x2c')][_0xb449('0x2d')]};});_0x189792['model']=_[_0xb449('0x29')](_0x212f98,_0xb449('0x28'));_0x189792[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x4daa3a[_0xb449('0x2e')]);_0x189792[_0xb449('0x30')]=_['intersection'](_0x189792[_0xb449('0x31')],_0x189792[_0xb449('0x2e')]);_0x3dd491[_0xb449('0x32')]=_[_0xb449('0x33')](_0x189792['model'],qs['fields'](_0x4daa3a[_0xb449('0x2e')]['fields']));_0x3dd491[_0xb449('0x32')]=_0x3dd491[_0xb449('0x32')][_0xb449('0x34')]?_0x3dd491['attributes']:_0x189792[_0xb449('0x31')];if(!_0x4daa3a[_0xb449('0x2e')]['hasOwnProperty'](_0xb449('0x35'))){_0x3dd491['limit']=qs['limit'](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x1e')]);_0x3dd491[_0xb449('0x1c')]=qs[_0xb449('0x1c')](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x1c')]);}_0x3dd491[_0xb449('0x36')]=qs[_0xb449('0x37')](_0x4daa3a[_0xb449('0x2e')][_0xb449('0x37')]);_0x3dd491['where']=qs[_0xb449('0x30')](_[_0xb449('0x38')](_0x4daa3a['query'],_0x189792[_0xb449('0x30')]),_0x212f98);if(_0x4daa3a['query'][_0xb449('0x39')]){_0x3dd491[_0xb449('0x3a')]=_[_0xb449('0x3b')](_0x3dd491['where'],{'$or':_[_0xb449('0x29')](_0x212f98,function(_0x2cc7c8){if(_0x2cc7c8[_0xb449('0x2c')]!==_0xb449('0x3c')){var _0x318f97={};_0x318f97[_0x2cc7c8[_0xb449('0x28')]]={'$like':'%'+_0x4daa3a[_0xb449('0x2e')][_0xb449('0x39')]+'%'};return _0x318f97;}})});}_0x3dd491=_[_0xb449('0x3b')]({},_0x3dd491,_0x4daa3a['options']);var _0x1840e4={'where':_0x3dd491[_0xb449('0x3a')]};return db[_0xb449('0x2a')][_0xb449('0x3d')](_0x1840e4)[_0xb449('0x24')](function(_0x18d2e5){_0x365ec6['count']=_0x18d2e5;if(_0x4daa3a[_0xb449('0x2e')][_0xb449('0x3e')]){_0x3dd491[_0xb449('0x3f')]=[{'all':!![]}];}return db[_0xb449('0x2a')]['findAll'](_0x3dd491);})[_0xb449('0x24')](function(_0x219c5f){_0x365ec6[_0xb449('0x40')]=_0x219c5f;return _0x365ec6;})[_0xb449('0x24')](respondWithFilteredResult(_0x264fc1,_0x3dd491))['catch'](handleError(_0x264fc1,null));};exports[_0xb449('0x41')]=function(_0x1f95e4,_0x1a614c){var _0x20cade={'raw':![],'where':{'id':_0x1f95e4[_0xb449('0x42')]['id']}},_0x316b88={};_0x316b88[_0xb449('0x31')]=_[_0xb449('0x2f')](db[_0xb449('0x2a')][_0xb449('0x43')]);_0x316b88[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x1f95e4['query']);_0x316b88['filters']=_[_0xb449('0x33')](_0x316b88[_0xb449('0x31')],_0x316b88[_0xb449('0x2e')]);_0x20cade[_0xb449('0x32')]=_[_0xb449('0x33')](_0x316b88[_0xb449('0x31')],qs['fields'](_0x1f95e4[_0xb449('0x2e')][_0xb449('0x44')]));_0x20cade[_0xb449('0x32')]=_0x20cade[_0xb449('0x32')][_0xb449('0x34')]?_0x20cade[_0xb449('0x32')]:_0x316b88[_0xb449('0x31')];if(_0x1f95e4['query'][_0xb449('0x3e')]){_0x20cade['include']=[{'all':!![]}];}_0x20cade=_['merge']({},_0x20cade,_0x1f95e4[_0xb449('0x45')]);return db[_0xb449('0x2a')][_0xb449('0x46')](_0x20cade)[_0xb449('0x24')](handleEntityNotFound(_0x1a614c,null))[_0xb449('0x24')](respondWithResult(_0x1a614c,null))[_0xb449('0x47')](handleError(_0x1a614c,null));};exports[_0xb449('0x48')]=function(_0xcc2b1a,_0x23072a){return db['Dynamics365Configuration']['create'](_0xcc2b1a['body'],{})[_0xb449('0x24')](respondWithResult(_0x23072a,0xc9))['catch'](handleError(_0x23072a,null));};exports[_0xb449('0x49')]=function(_0x4e7ee7,_0x43143a){if(_0x4e7ee7[_0xb449('0x4a')]['id']){delete _0x4e7ee7[_0xb449('0x4a')]['id'];}return db[_0xb449('0x2a')][_0xb449('0x46')]({'where':{'id':_0x4e7ee7[_0xb449('0x42')]['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x43143a,null))[_0xb449('0x24')](saveUpdates(_0x4e7ee7['body'],null))[_0xb449('0x24')](respondWithResult(_0x43143a,null))['catch'](handleError(_0x43143a,null));};exports['destroy']=function(_0x21a149,_0x41182e){return db[_0xb449('0x2a')][_0xb449('0x46')]({'where':{'id':_0x21a149[_0xb449('0x42')]['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x41182e,null))[_0xb449('0x24')](removeEntity(_0x41182e,null))[_0xb449('0x47')](handleError(_0x41182e,null));};exports[_0xb449('0x4b')]=function(_0x1d50b1,_0x4e1e83,_0x107ac6){var _0x22bc8f={};var _0x2b13e6={};var _0x54b480;var _0x2250c6;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x1d50b1['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x4e1e83,null))['then'](function(_0x1eff67){if(_0x1eff67){_0x54b480=_0x1eff67;_0x2b13e6['model']=_[_0xb449('0x2f')](db['Dynamics365Field'][_0xb449('0x43')]);_0x2b13e6[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x1d50b1[_0xb449('0x2e')]);_0x2b13e6[_0xb449('0x30')]=_[_0xb449('0x33')](_0x2b13e6[_0xb449('0x31')],_0x2b13e6[_0xb449('0x2e')]);_0x22bc8f[_0xb449('0x32')]=_['intersection'](_0x2b13e6[_0xb449('0x31')],qs[_0xb449('0x44')](_0x1d50b1[_0xb449('0x2e')][_0xb449('0x44')]));_0x22bc8f[_0xb449('0x32')]=_0x22bc8f[_0xb449('0x32')]['length']?_0x22bc8f[_0xb449('0x32')]:_0x2b13e6[_0xb449('0x31')];_0x22bc8f[_0xb449('0x36')]=qs[_0xb449('0x37')](_0x1d50b1[_0xb449('0x2e')][_0xb449('0x37')]);_0x22bc8f[_0xb449('0x3a')]=qs[_0xb449('0x30')](_['pick'](_0x1d50b1[_0xb449('0x2e')],_0x2b13e6[_0xb449('0x30')]));if(_0x1d50b1[_0xb449('0x2e')][_0xb449('0x39')]){_0x22bc8f['where']=_['merge'](_0x22bc8f[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x22bc8f['attributes'],function(_0x413453){var _0x27ebc4={};_0x27ebc4[_0x413453]={'$like':'%'+_0x1d50b1['query'][_0xb449('0x39')]+'%'};return _0x27ebc4;})});}_0x22bc8f=_[_0xb449('0x3b')]({},_0x22bc8f,_0x1d50b1[_0xb449('0x45')]);return _0x54b480[_0xb449('0x4b')](_0x22bc8f);}})['then'](function(_0x4a0921){if(_0x4a0921){_0x2250c6=_0x4a0921[_0xb449('0x34')];if(!_0x1d50b1[_0xb449('0x2e')][_0xb449('0x4d')]('nolimit')){_0x22bc8f[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x1d50b1[_0xb449('0x2e')]['limit']);_0x22bc8f[_0xb449('0x1c')]=qs[_0xb449('0x1c')](_0x1d50b1['query'][_0xb449('0x1c')]);}return _0x54b480[_0xb449('0x4b')](_0x22bc8f);}})[_0xb449('0x24')](function(_0x4c5572){if(_0x4c5572){return _0x4c5572?{'count':_0x2250c6,'rows':_0x4c5572}:null;}})[_0xb449('0x24')](respondWithResult(_0x4e1e83,null))['catch'](handleError(_0x4e1e83,null));};exports[_0xb449('0x4e')]=function(_0x52b178,_0x26811a,_0x25d3a8){var _0x59ef44={};var _0x5b038b={};var _0x2dd0cc;var _0x3398a6;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x52b178['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x26811a,null))[_0xb449('0x24')](function(_0x1adb3d){if(_0x1adb3d){_0x2dd0cc=_0x1adb3d;_0x5b038b[_0xb449('0x31')]=_[_0xb449('0x2f')](db['Dynamics365Field'][_0xb449('0x43')]);_0x5b038b[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x52b178['query']);_0x5b038b['filters']=_[_0xb449('0x33')](_0x5b038b[_0xb449('0x31')],_0x5b038b[_0xb449('0x2e')]);_0x59ef44[_0xb449('0x32')]=_[_0xb449('0x33')](_0x5b038b[_0xb449('0x31')],qs[_0xb449('0x44')](_0x52b178[_0xb449('0x2e')][_0xb449('0x44')]));_0x59ef44[_0xb449('0x32')]=_0x59ef44['attributes'][_0xb449('0x34')]?_0x59ef44[_0xb449('0x32')]:_0x5b038b['model'];_0x59ef44['order']=qs[_0xb449('0x37')](_0x52b178[_0xb449('0x2e')][_0xb449('0x37')]);_0x59ef44[_0xb449('0x3a')]=qs[_0xb449('0x30')](_[_0xb449('0x38')](_0x52b178[_0xb449('0x2e')],_0x5b038b[_0xb449('0x30')]));if(_0x52b178[_0xb449('0x2e')][_0xb449('0x39')]){_0x59ef44['where']=_[_0xb449('0x3b')](_0x59ef44[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x59ef44['attributes'],function(_0x286b84){var _0x4adab9={};_0x4adab9[_0x286b84]={'$like':'%'+_0x52b178['query']['filter']+'%'};return _0x4adab9;})});}_0x59ef44=_[_0xb449('0x3b')]({},_0x59ef44,_0x52b178[_0xb449('0x45')]);return _0x2dd0cc['getSubjects'](_0x59ef44);}})[_0xb449('0x24')](function(_0x582194){if(_0x582194){_0x3398a6=_0x582194['length'];if(!_0x52b178[_0xb449('0x2e')]['hasOwnProperty']('nolimit')){_0x59ef44[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x52b178[_0xb449('0x2e')][_0xb449('0x1e')]);_0x59ef44['offset']=qs[_0xb449('0x1c')](_0x52b178[_0xb449('0x2e')][_0xb449('0x1c')]);}return _0x2dd0cc['getSubjects'](_0x59ef44);}})[_0xb449('0x24')](function(_0x2df82a){if(_0x2df82a){return _0x2df82a?{'count':_0x3398a6,'rows':_0x2df82a}:null;}})['then'](respondWithResult(_0x26811a,null))['catch'](handleError(_0x26811a,null));};exports['getDescriptions']=function(_0x4f6a6a,_0x41a458,_0x57d4af){var _0x5376c0={};var _0x292a60={};var _0x1a294d;var _0xb31057;return db[_0xb449('0x2a')][_0xb449('0x4c')]({'where':{'id':_0x4f6a6a['params']['id']}})[_0xb449('0x24')](handleEntityNotFound(_0x41a458,null))[_0xb449('0x24')](function(_0x599b15){if(_0x599b15){_0x1a294d=_0x599b15;_0x292a60[_0xb449('0x31')]=_[_0xb449('0x2f')](db[_0xb449('0x4f')][_0xb449('0x43')]);_0x292a60[_0xb449('0x2e')]=_[_0xb449('0x2f')](_0x4f6a6a[_0xb449('0x2e')]);_0x292a60['filters']=_['intersection'](_0x292a60[_0xb449('0x31')],_0x292a60[_0xb449('0x2e')]);_0x5376c0[_0xb449('0x32')]=_[_0xb449('0x33')](_0x292a60[_0xb449('0x31')],qs[_0xb449('0x44')](_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x44')]));_0x5376c0[_0xb449('0x32')]=_0x5376c0['attributes'][_0xb449('0x34')]?_0x5376c0[_0xb449('0x32')]:_0x292a60[_0xb449('0x31')];_0x5376c0[_0xb449('0x36')]=qs['sort'](_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x37')]);_0x5376c0[_0xb449('0x3a')]=qs['filters'](_[_0xb449('0x38')](_0x4f6a6a[_0xb449('0x2e')],_0x292a60['filters']));if(_0x4f6a6a[_0xb449('0x2e')]['filter']){_0x5376c0[_0xb449('0x3a')]=_[_0xb449('0x3b')](_0x5376c0[_0xb449('0x3a')],{'$or':_[_0xb449('0x29')](_0x5376c0[_0xb449('0x32')],function(_0x40ed72){var _0x3ed7a0={};_0x3ed7a0[_0x40ed72]={'$like':'%'+_0x4f6a6a[_0xb449('0x2e')][_0xb449('0x39')]+'%'};return _0x3ed7a0;})});}_0x5376c0=_[_0xb449('0x3b')]({},_0x5376c0,_0x4f6a6a[_0xb449('0x45')]);return _0x1a294d[_0xb449('0x50')](_0x5376c0);}})[_0xb449('0x24')](function(_0x5c764c){if(_0x5c764c){_0xb31057=_0x5c764c[_0xb449('0x34')];if(!_0x4f6a6a[_0xb449('0x2e')]['hasOwnProperty'](_0xb449('0x35'))){_0x5376c0[_0xb449('0x1e')]=qs[_0xb449('0x1e')](_0x4f6a6a[_0xb449('0x2e')]['limit']);_0x5376c0['offset']=qs[_0xb449('0x1c')](_0x4f6a6a[_0xb449('0x2e')]['offset']);}return _0x1a294d[_0xb449('0x50')](_0x5376c0);}})[_0xb449('0x24')](function(_0xda4011){if(_0xda4011){return _0xda4011?{'count':_0xb31057,'rows':_0xda4011}:null;}})[_0xb449('0x24')](respondWithResult(_0x41a458,null))['catch'](handleError(_0x41a458,null));}; \ No newline at end of file +var _0x711a=['query','keys','filters','intersection','attributes','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','includeAll','include','rows','catch','show','params','fields','length','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','set','Content-Range','reject','save','update','then','end','sendStatus','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map'];(function(_0xd53b14,_0x54d7e7){var _0x542de3=function(_0x167428){while(--_0x167428){_0xd53b14['push'](_0xd53b14['shift']());}};_0x542de3(++_0x54d7e7);}(_0x711a,0x154));var _0xa711=function(_0x2dffa4,_0x1ea9d1){_0x2dffa4=_0x2dffa4-0x0;var _0xa5242=_0x711a[_0x2dffa4];return _0xa5242;};'use strict';var emlformat=require(_0xa711('0x0'));var rimraf=require(_0xa711('0x1'));var zipdir=require(_0xa711('0x2'));var jsonpatch=require(_0xa711('0x3'));var rp=require(_0xa711('0x4'));var moment=require(_0xa711('0x5'));var BPromise=require(_0xa711('0x6'));var Mustache=require('mustache');var util=require(_0xa711('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa711('0x8'));var ejs=require(_0xa711('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa711('0xa'));var squel=require(_0xa711('0xb'));var crypto=require(_0xa711('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa711('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa711('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa711('0xf'));var logger=require(_0xa711('0x10'))('api');var utils=require(_0xa711('0x11'));var config=require(_0xa711('0x12'));var licenseUtil=require(_0xa711('0x13'));var db=require(_0xa711('0x14'))['db'];function respondWithStatusCode(_0x3e657a,_0x174339){_0x174339=_0x174339||0xcc;return function(_0xef5635){if(_0xef5635){return _0x3e657a['sendStatus'](_0x174339);}return _0x3e657a[_0xa711('0x15')](_0x174339)['end']();};}function respondWithResult(_0xe3161f,_0x18019c){_0x18019c=_0x18019c||0xc8;return function(_0x24ecf8){if(_0x24ecf8){return _0xe3161f[_0xa711('0x15')](_0x18019c)[_0xa711('0x16')](_0x24ecf8);}};}function respondWithFilteredResult(_0x3ff90d,_0x224e1a){return function(_0x380f6a){if(_0x380f6a){var _0x1431e0=typeof _0x224e1a[_0xa711('0x17')]==='undefined'&&typeof _0x224e1a['limit']==='undefined';var _0x577244=_0x380f6a['count'];var _0x157477=_0x1431e0?0x0:_0x224e1a['offset'];var _0x302aa5=_0x1431e0?_0x380f6a[_0xa711('0x18')]:_0x224e1a[_0xa711('0x17')]+_0x224e1a[_0xa711('0x19')];var _0x1cf0ba;if(_0x302aa5>=_0x577244){_0x302aa5=_0x577244;_0x1cf0ba=0xc8;}else{_0x1cf0ba=0xce;}_0x3ff90d[_0xa711('0x15')](_0x1cf0ba);return _0x3ff90d[_0xa711('0x1a')](_0xa711('0x1b'),_0x157477+'-'+_0x302aa5+'/'+_0x577244)[_0xa711('0x16')](_0x380f6a);}return null;};}function patchUpdates(_0x7e69fb){return function(_0x44a967){try{jsonpatch['apply'](_0x44a967,_0x7e69fb,!![]);}catch(_0x3bf787){return BPromise[_0xa711('0x1c')](_0x3bf787);}return _0x44a967[_0xa711('0x1d')]();};}function saveUpdates(_0x30c57a,_0x29f7d9){return function(_0x1aea76){if(_0x1aea76){return _0x1aea76[_0xa711('0x1e')](_0x30c57a)[_0xa711('0x1f')](function(_0x4b65a2){return _0x4b65a2;});}return null;};}function removeEntity(_0x38cdb1,_0x349b35){return function(_0x120a81){if(_0x120a81){return _0x120a81['destroy']()['then'](function(){_0x38cdb1[_0xa711('0x15')](0xcc)[_0xa711('0x20')]();});}};}function handleEntityNotFound(_0x4c57ce,_0x5b080e){return function(_0x1066c3){if(!_0x1066c3){_0x4c57ce[_0xa711('0x21')](0x194);}return _0x1066c3;};}function handleError(_0x5bf915,_0x596766){_0x596766=_0x596766||0x1f4;return function(_0x398d9f){logger[_0xa711('0x22')](_0x398d9f['stack']);if(_0x398d9f[_0xa711('0x23')]){delete _0x398d9f['name'];}_0x5bf915['status'](_0x596766)[_0xa711('0x24')](_0x398d9f);};}exports[_0xa711('0x25')]=function(_0x36464e,_0x4691d1){var _0x56dc0d={},_0x519399={},_0x5b26e1={'count':0x0,'rows':[]};var _0x365cbd=_['map'](db[_0xa711('0x26')][_0xa711('0x27')],function(_0x240ed6){return{'name':_0x240ed6[_0xa711('0x28')],'type':_0x240ed6[_0xa711('0x29')][_0xa711('0x2a')]};});_0x519399[_0xa711('0x2b')]=_[_0xa711('0x2c')](_0x365cbd,_0xa711('0x23'));_0x519399[_0xa711('0x2d')]=_[_0xa711('0x2e')](_0x36464e[_0xa711('0x2d')]);_0x519399[_0xa711('0x2f')]=_[_0xa711('0x30')](_0x519399['model'],_0x519399[_0xa711('0x2d')]);_0x56dc0d[_0xa711('0x31')]=_['intersection'](_0x519399[_0xa711('0x2b')],qs['fields'](_0x36464e[_0xa711('0x2d')]['fields']));_0x56dc0d['attributes']=_0x56dc0d[_0xa711('0x31')]['length']?_0x56dc0d[_0xa711('0x31')]:_0x519399[_0xa711('0x2b')];if(!_0x36464e[_0xa711('0x2d')]['hasOwnProperty'](_0xa711('0x32'))){_0x56dc0d[_0xa711('0x19')]=qs[_0xa711('0x19')](_0x36464e['query'][_0xa711('0x19')]);_0x56dc0d[_0xa711('0x17')]=qs[_0xa711('0x17')](_0x36464e[_0xa711('0x2d')][_0xa711('0x17')]);}_0x56dc0d[_0xa711('0x33')]=qs[_0xa711('0x34')](_0x36464e['query'][_0xa711('0x34')]);_0x56dc0d['where']=qs[_0xa711('0x2f')](_[_0xa711('0x35')](_0x36464e[_0xa711('0x2d')],_0x519399[_0xa711('0x2f')]),_0x365cbd);if(_0x36464e['query']['filter']){_0x56dc0d['where']=_['merge'](_0x56dc0d['where'],{'$or':_[_0xa711('0x2c')](_0x365cbd,function(_0x339826){if(_0x339826[_0xa711('0x29')]!==_0xa711('0x36')){var _0x2e618b={};_0x2e618b[_0x339826[_0xa711('0x23')]]={'$like':'%'+_0x36464e[_0xa711('0x2d')][_0xa711('0x37')]+'%'};return _0x2e618b;}})});}_0x56dc0d=_[_0xa711('0x38')]({},_0x56dc0d,_0x36464e[_0xa711('0x39')]);var _0x353d62={'where':_0x56dc0d[_0xa711('0x3a')]};return db[_0xa711('0x26')][_0xa711('0x18')](_0x353d62)['then'](function(_0x4d3725){_0x5b26e1['count']=_0x4d3725;if(_0x36464e[_0xa711('0x2d')][_0xa711('0x3b')]){_0x56dc0d[_0xa711('0x3c')]=[{'all':!![]}];}return db[_0xa711('0x26')]['findAll'](_0x56dc0d);})[_0xa711('0x1f')](function(_0x43af32){_0x5b26e1[_0xa711('0x3d')]=_0x43af32;return _0x5b26e1;})[_0xa711('0x1f')](respondWithFilteredResult(_0x4691d1,_0x56dc0d))[_0xa711('0x3e')](handleError(_0x4691d1,null));};exports[_0xa711('0x3f')]=function(_0x2741c9,_0x28ac0a){var _0x4f5bb8={'raw':![],'where':{'id':_0x2741c9[_0xa711('0x40')]['id']}},_0x3a9b33={};_0x3a9b33[_0xa711('0x2b')]=_[_0xa711('0x2e')](db[_0xa711('0x26')]['rawAttributes']);_0x3a9b33[_0xa711('0x2d')]=_[_0xa711('0x2e')](_0x2741c9['query']);_0x3a9b33['filters']=_[_0xa711('0x30')](_0x3a9b33[_0xa711('0x2b')],_0x3a9b33[_0xa711('0x2d')]);_0x4f5bb8[_0xa711('0x31')]=_[_0xa711('0x30')](_0x3a9b33['model'],qs[_0xa711('0x41')](_0x2741c9[_0xa711('0x2d')]['fields']));_0x4f5bb8[_0xa711('0x31')]=_0x4f5bb8[_0xa711('0x31')][_0xa711('0x42')]?_0x4f5bb8[_0xa711('0x31')]:_0x3a9b33[_0xa711('0x2b')];if(_0x2741c9['query'][_0xa711('0x3b')]){_0x4f5bb8['include']=[{'all':!![]}];}_0x4f5bb8=_['merge']({},_0x4f5bb8,_0x2741c9[_0xa711('0x39')]);return db['Dynamics365Configuration'][_0xa711('0x43')](_0x4f5bb8)['then'](handleEntityNotFound(_0x28ac0a,null))[_0xa711('0x1f')](respondWithResult(_0x28ac0a,null))[_0xa711('0x3e')](handleError(_0x28ac0a,null));};exports[_0xa711('0x44')]=function(_0x5ab45b,_0x36809a){return db[_0xa711('0x26')]['create'](_0x5ab45b[_0xa711('0x45')],{})['then'](respondWithResult(_0x36809a,0xc9))['catch'](handleError(_0x36809a,null));};exports[_0xa711('0x1e')]=function(_0x10f379,_0x42f206){if(_0x10f379[_0xa711('0x45')]['id']){delete _0x10f379['body']['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x10f379['params']['id']}})[_0xa711('0x1f')](handleEntityNotFound(_0x42f206,null))['then'](saveUpdates(_0x10f379['body'],null))[_0xa711('0x1f')](respondWithResult(_0x42f206,null))['catch'](handleError(_0x42f206,null));};exports[_0xa711('0x46')]=function(_0x2ad514,_0x405230){return db[_0xa711('0x26')][_0xa711('0x43')]({'where':{'id':_0x2ad514['params']['id']}})[_0xa711('0x1f')](handleEntityNotFound(_0x405230,null))['then'](removeEntity(_0x405230,null))[_0xa711('0x3e')](handleError(_0x405230,null));};exports[_0xa711('0x47')]=function(_0x1a98ca,_0x5193f6,_0x1d569e){var _0x3d59da={};var _0x12927f={};var _0x1ca8ef;var _0x5ef709;return db[_0xa711('0x26')][_0xa711('0x48')]({'where':{'id':_0x1a98ca[_0xa711('0x40')]['id']}})[_0xa711('0x1f')](handleEntityNotFound(_0x5193f6,null))[_0xa711('0x1f')](function(_0x5c4b78){if(_0x5c4b78){_0x1ca8ef=_0x5c4b78;_0x12927f[_0xa711('0x2b')]=_[_0xa711('0x2e')](db['Dynamics365Field'][_0xa711('0x27')]);_0x12927f['query']=_['keys'](_0x1a98ca[_0xa711('0x2d')]);_0x12927f[_0xa711('0x2f')]=_[_0xa711('0x30')](_0x12927f[_0xa711('0x2b')],_0x12927f[_0xa711('0x2d')]);_0x3d59da[_0xa711('0x31')]=_[_0xa711('0x30')](_0x12927f[_0xa711('0x2b')],qs[_0xa711('0x41')](_0x1a98ca['query'][_0xa711('0x41')]));_0x3d59da[_0xa711('0x31')]=_0x3d59da['attributes'][_0xa711('0x42')]?_0x3d59da[_0xa711('0x31')]:_0x12927f[_0xa711('0x2b')];_0x3d59da[_0xa711('0x33')]=qs[_0xa711('0x34')](_0x1a98ca[_0xa711('0x2d')][_0xa711('0x34')]);_0x3d59da[_0xa711('0x3a')]=qs[_0xa711('0x2f')](_['pick'](_0x1a98ca['query'],_0x12927f[_0xa711('0x2f')]));if(_0x1a98ca['query'][_0xa711('0x37')]){_0x3d59da[_0xa711('0x3a')]=_[_0xa711('0x38')](_0x3d59da[_0xa711('0x3a')],{'$or':_['map'](_0x3d59da[_0xa711('0x31')],function(_0x226cce){var _0x23bb77={};_0x23bb77[_0x226cce]={'$like':'%'+_0x1a98ca['query'][_0xa711('0x37')]+'%'};return _0x23bb77;})});}_0x3d59da=_[_0xa711('0x38')]({},_0x3d59da,_0x1a98ca[_0xa711('0x39')]);return _0x1ca8ef[_0xa711('0x47')](_0x3d59da);}})['then'](function(_0x36897f){if(_0x36897f){_0x5ef709=_0x36897f['length'];if(!_0x1a98ca[_0xa711('0x2d')][_0xa711('0x49')](_0xa711('0x32'))){_0x3d59da[_0xa711('0x19')]=qs[_0xa711('0x19')](_0x1a98ca[_0xa711('0x2d')][_0xa711('0x19')]);_0x3d59da[_0xa711('0x17')]=qs[_0xa711('0x17')](_0x1a98ca[_0xa711('0x2d')][_0xa711('0x17')]);}return _0x1ca8ef[_0xa711('0x47')](_0x3d59da);}})['then'](function(_0x370a73){if(_0x370a73){return _0x370a73?{'count':_0x5ef709,'rows':_0x370a73}:null;}})[_0xa711('0x1f')](respondWithResult(_0x5193f6,null))[_0xa711('0x3e')](handleError(_0x5193f6,null));};exports[_0xa711('0x4a')]=function(_0x124a9a,_0x49629f,_0x4feb2d){var _0x12c14e={};var _0x5bc79e={};var _0x2ce407;var _0x2f88ec;return db[_0xa711('0x26')]['findOne']({'where':{'id':_0x124a9a[_0xa711('0x40')]['id']}})[_0xa711('0x1f')](handleEntityNotFound(_0x49629f,null))[_0xa711('0x1f')](function(_0x388d85){if(_0x388d85){_0x2ce407=_0x388d85;_0x5bc79e[_0xa711('0x2b')]=_[_0xa711('0x2e')](db[_0xa711('0x4b')][_0xa711('0x27')]);_0x5bc79e[_0xa711('0x2d')]=_[_0xa711('0x2e')](_0x124a9a['query']);_0x5bc79e[_0xa711('0x2f')]=_[_0xa711('0x30')](_0x5bc79e[_0xa711('0x2b')],_0x5bc79e[_0xa711('0x2d')]);_0x12c14e[_0xa711('0x31')]=_['intersection'](_0x5bc79e[_0xa711('0x2b')],qs[_0xa711('0x41')](_0x124a9a[_0xa711('0x2d')][_0xa711('0x41')]));_0x12c14e[_0xa711('0x31')]=_0x12c14e[_0xa711('0x31')]['length']?_0x12c14e[_0xa711('0x31')]:_0x5bc79e[_0xa711('0x2b')];_0x12c14e[_0xa711('0x33')]=qs['sort'](_0x124a9a[_0xa711('0x2d')][_0xa711('0x34')]);_0x12c14e['where']=qs[_0xa711('0x2f')](_['pick'](_0x124a9a[_0xa711('0x2d')],_0x5bc79e[_0xa711('0x2f')]));if(_0x124a9a[_0xa711('0x2d')][_0xa711('0x37')]){_0x12c14e['where']=_['merge'](_0x12c14e[_0xa711('0x3a')],{'$or':_[_0xa711('0x2c')](_0x12c14e['attributes'],function(_0x20a2ab){var _0x4772f9={};_0x4772f9[_0x20a2ab]={'$like':'%'+_0x124a9a[_0xa711('0x2d')][_0xa711('0x37')]+'%'};return _0x4772f9;})});}_0x12c14e=_[_0xa711('0x38')]({},_0x12c14e,_0x124a9a['options']);return _0x2ce407[_0xa711('0x4a')](_0x12c14e);}})[_0xa711('0x1f')](function(_0x19261b){if(_0x19261b){_0x2f88ec=_0x19261b[_0xa711('0x42')];if(!_0x124a9a[_0xa711('0x2d')][_0xa711('0x49')](_0xa711('0x32'))){_0x12c14e[_0xa711('0x19')]=qs['limit'](_0x124a9a['query']['limit']);_0x12c14e['offset']=qs[_0xa711('0x17')](_0x124a9a[_0xa711('0x2d')][_0xa711('0x17')]);}return _0x2ce407['getSubjects'](_0x12c14e);}})[_0xa711('0x1f')](function(_0x20571a){if(_0x20571a){return _0x20571a?{'count':_0x2f88ec,'rows':_0x20571a}:null;}})[_0xa711('0x1f')](respondWithResult(_0x49629f,null))[_0xa711('0x3e')](handleError(_0x49629f,null));};exports[_0xa711('0x4c')]=function(_0x4d5318,_0x4494e0,_0x21013f){var _0x4de718={};var _0x2ab3f5={};var _0x4cbf3d;var _0x786cf2;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4d5318[_0xa711('0x40')]['id']}})[_0xa711('0x1f')](handleEntityNotFound(_0x4494e0,null))[_0xa711('0x1f')](function(_0x51308b){if(_0x51308b){_0x4cbf3d=_0x51308b;_0x2ab3f5['model']=_[_0xa711('0x2e')](db['Dynamics365Field'][_0xa711('0x27')]);_0x2ab3f5['query']=_[_0xa711('0x2e')](_0x4d5318[_0xa711('0x2d')]);_0x2ab3f5[_0xa711('0x2f')]=_[_0xa711('0x30')](_0x2ab3f5['model'],_0x2ab3f5['query']);_0x4de718[_0xa711('0x31')]=_['intersection'](_0x2ab3f5['model'],qs[_0xa711('0x41')](_0x4d5318[_0xa711('0x2d')]['fields']));_0x4de718[_0xa711('0x31')]=_0x4de718[_0xa711('0x31')][_0xa711('0x42')]?_0x4de718['attributes']:_0x2ab3f5[_0xa711('0x2b')];_0x4de718[_0xa711('0x33')]=qs[_0xa711('0x34')](_0x4d5318[_0xa711('0x2d')][_0xa711('0x34')]);_0x4de718[_0xa711('0x3a')]=qs['filters'](_[_0xa711('0x35')](_0x4d5318[_0xa711('0x2d')],_0x2ab3f5['filters']));if(_0x4d5318[_0xa711('0x2d')][_0xa711('0x37')]){_0x4de718[_0xa711('0x3a')]=_[_0xa711('0x38')](_0x4de718[_0xa711('0x3a')],{'$or':_[_0xa711('0x2c')](_0x4de718[_0xa711('0x31')],function(_0x8b4a7b){var _0x1a9ecf={};_0x1a9ecf[_0x8b4a7b]={'$like':'%'+_0x4d5318['query'][_0xa711('0x37')]+'%'};return _0x1a9ecf;})});}_0x4de718=_[_0xa711('0x38')]({},_0x4de718,_0x4d5318[_0xa711('0x39')]);return _0x4cbf3d[_0xa711('0x4c')](_0x4de718);}})[_0xa711('0x1f')](function(_0x471026){if(_0x471026){_0x786cf2=_0x471026['length'];if(!_0x4d5318[_0xa711('0x2d')][_0xa711('0x49')](_0xa711('0x32'))){_0x4de718[_0xa711('0x19')]=qs[_0xa711('0x19')](_0x4d5318[_0xa711('0x2d')][_0xa711('0x19')]);_0x4de718[_0xa711('0x17')]=qs[_0xa711('0x17')](_0x4d5318[_0xa711('0x2d')][_0xa711('0x17')]);}return _0x4cbf3d[_0xa711('0x4c')](_0x4de718);}})[_0xa711('0x1f')](function(_0x3c9c0f){if(_0x3c9c0f){return _0x3c9c0f?{'count':_0x786cf2,'rows':_0x3c9c0f}:null;}})[_0xa711('0x1f')](respondWithResult(_0x4494e0,null))['catch'](handleError(_0x4494e0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ea0b4c4..89cc82b 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 _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x944768,_0x4fae3a){var _0x488ed6=function(_0x394b40){while(--_0x394b40){_0x944768['push'](_0x944768['shift']());}};_0x488ed6(++_0x4fae3a);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5e6841,_0x51f0ff){_0x5e6841=_0x5e6841-0x0;var _0x4f8368=_0x8d0e[_0x5e6841];return _0x4f8368;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x4b84[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 9af114c..1dd8940 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 _0xffed=['stringify','code','error','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xffed,0xe1));var _0xdffe=function(_0x5c0fc5,_0x1d3f69){_0x5c0fc5=_0x5c0fc5-0x0;var _0x1e9375=_0xffed[_0x5c0fc5];return _0x1e9375;};'use strict';var _=require('lodash');var util=require(_0xdffe('0x0'));var moment=require(_0xdffe('0x1'));var BPromise=require('bluebird');var rs=require(_0xdffe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdffe('0x3'))['db'];var utils=require(_0xdffe('0x4'));var logger=require(_0xdffe('0x5'))(_0xdffe('0x6'));var config=require(_0xdffe('0x7'));var jayson=require(_0xdffe('0x8'));var client=jayson[_0xdffe('0x9')][_0xdffe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c467d,_0x2fe972,_0xb502fe){return new BPromise(function(_0x39ad8d,_0x1dd497){return client[_0xdffe('0xb')](_0x1c467d,_0xb502fe)[_0xdffe('0xc')](function(_0x208cfe){logger[_0xdffe('0xd')](_0xdffe('0xe'),_0x2fe972,_0xdffe('0xf'));logger[_0xdffe('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2fe972,_0xdffe('0xf'),JSON[_0xdffe('0x11')](_0x208cfe));if(_0x208cfe['error']){if(_0x208cfe['error'][_0xdffe('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0x208cfe[_0xdffe('0x13')]['message']);return _0x1dd497(_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);}logger['error'](_0xdffe('0xe'),_0x2fe972,_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);return _0x39ad8d(_0x208cfe[_0xdffe('0x13')][_0xdffe('0x14')]);}else{logger[_0xdffe('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0xdffe('0xf'));_0x39ad8d(_0x208cfe['result'][_0xdffe('0x14')]);}})[_0xdffe('0x15')](function(_0x411282){logger[_0xdffe('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fe972,_0x411282);_0x1dd497(_0x411282);});});} \ No newline at end of file +var _0x34d0=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x102c67,_0x4795df){var _0x556a65=function(_0x3a6ccd){while(--_0x3a6ccd){_0x102c67['push'](_0x102c67['shift']());}};_0x556a65(++_0x4795df);}(_0x34d0,0x10d));var _0x034d=function(_0x5a1bc2,_0x4dba69){_0x5a1bc2=_0x5a1bc2-0x0;var _0x1b9200=_0x34d0[_0x5a1bc2];return _0x1b9200;};'use strict';var _=require(_0x034d('0x0'));var util=require(_0x034d('0x1'));var moment=require(_0x034d('0x2'));var BPromise=require(_0x034d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x034d('0x4'));var db=require(_0x034d('0x5'))['db'];var utils=require(_0x034d('0x6'));var logger=require(_0x034d('0x7'))(_0x034d('0x8'));var config=require(_0x034d('0x9'));var jayson=require(_0x034d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42704c,_0x2f18cc,_0x30ac8d){return new BPromise(function(_0x3ac4aa,_0x711123){return client[_0x034d('0xb')](_0x42704c,_0x30ac8d)[_0x034d('0xc')](function(_0x259d6a){logger[_0x034d('0xd')](_0x034d('0xe'),_0x2f18cc,_0x034d('0xf'));logger[_0x034d('0x10')](_0x034d('0x11'),_0x2f18cc,_0x034d('0xf'),JSON[_0x034d('0x12')](_0x259d6a));if(_0x259d6a[_0x034d('0x13')]){if(_0x259d6a[_0x034d('0x13')][_0x034d('0x14')]===0x1f4){logger['error'](_0x034d('0xe'),_0x2f18cc,_0x259d6a[_0x034d('0x13')][_0x034d('0x15')]);return _0x711123(_0x259d6a[_0x034d('0x13')][_0x034d('0x15')]);}logger[_0x034d('0x13')](_0x034d('0xe'),_0x2f18cc,_0x259d6a['error'][_0x034d('0x15')]);return _0x3ac4aa(_0x259d6a['error']['message']);}else{logger[_0x034d('0xd')](_0x034d('0xe'),_0x2f18cc,_0x034d('0xf'));_0x3ac4aa(_0x259d6a[_0x034d('0x16')][_0x034d('0x15')]);}})[_0x034d('0x17')](function(_0x223c6c){logger[_0x034d('0x13')](_0x034d('0xe'),_0x2f18cc,_0x223c6c);_0x711123(_0x223c6c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 3f7e16b..de88418 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 _0xb405=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xbc380e,_0x714c7b){var _0x285628=function(_0x52f1fc){while(--_0x52f1fc){_0xbc380e['push'](_0xbc380e['shift']());}};_0x285628(++_0x714c7b);}(_0xb405,0x1bb));var _0x5b40=function(_0x9939af,_0x3db63e){_0x9939af=_0x9939af-0x0;var _0x4275c2=_0xb405[_0x9939af];return _0x4275c2;};'use strict';var multer=require(_0x5b40('0x0'));var util=require('util');var path=require(_0x5b40('0x1'));var timeout=require(_0x5b40('0x2'));var express=require(_0x5b40('0x3'));var router=express[_0x5b40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5b40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b40('0x6'));var controller=require(_0x5b40('0x7'));router[_0x5b40('0x8')]('/',auth[_0x5b40('0x9')](),controller[_0x5b40('0xa')]);router[_0x5b40('0x8')](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0xc')]);router[_0x5b40('0xd')]('/',auth['isAuthenticated'](),controller[_0x5b40('0xe')]);router['put'](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0xf')]);router[_0x5b40('0x10')](_0x5b40('0xb'),auth[_0x5b40('0x9')](),controller[_0x5b40('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0e89=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x0e89,0x154));var _0x90e8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0e89[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x90e8('0x0'));var util=require(_0x90e8('0x1'));var path=require(_0x90e8('0x2'));var timeout=require(_0x90e8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x90e8('0x4'));var auth=require(_0x90e8('0x5'));var interaction=require(_0x90e8('0x6'));var config=require(_0x90e8('0x7'));var controller=require(_0x90e8('0x8'));router[_0x90e8('0x9')]('/',auth[_0x90e8('0xa')](),controller[_0x90e8('0xb')]);router[_0x90e8('0x9')](_0x90e8('0xc'),auth[_0x90e8('0xa')](),controller[_0x90e8('0xd')]);router[_0x90e8('0xe')]('/',auth[_0x90e8('0xa')](),controller[_0x90e8('0xf')]);router[_0x90e8('0x10')](_0x90e8('0xc'),auth[_0x90e8('0xa')](),controller['update']);router['delete'](_0x90e8('0xc'),auth[_0x90e8('0xa')](),controller[_0x90e8('0x11')]);module[_0x90e8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f5d1c03..73049f5 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 _0xcfa3=['sequelize','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x27cc07,_0x239df7){var _0x278018=function(_0x2370ea){while(--_0x2370ea){_0x27cc07['push'](_0x27cc07['shift']());}};_0x278018(++_0x239df7);}(_0xcfa3,0x11f));var _0x3cfa=function(_0x211cf4,_0x4887a5){_0x211cf4=_0x211cf4-0x0;var _0x22c2a5=_0xcfa3[_0x211cf4];return _0x22c2a5;};'use strict';var Sequelize=require(_0x3cfa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3cfa('0x1'),_0x3cfa('0x2'),_0x3cfa('0x3'),_0x3cfa('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3cfa('0x5')]},'key':{'type':Sequelize[_0x3cfa('0x5')]},'keyType':{'type':Sequelize[_0x3cfa('0x6')]('string',_0x3cfa('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x3cfa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3cfa('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cfa('0x5')]}}; \ No newline at end of file +var _0x709b=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x1b64a6,_0x374535){var _0x408441=function(_0x806032){while(--_0x806032){_0x1b64a6['push'](_0x1b64a6['shift']());}};_0x408441(++_0x374535);}(_0x709b,0x1b8));var _0xb709=function(_0x3e55a2,_0x37c97b){_0x3e55a2=_0x3e55a2-0x0;var _0xb1f8f4=_0x709b[_0x3e55a2];return _0xb1f8f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xb709('0x0'),_0xb709('0x1'),_0xb709('0x2'),_0xb709('0x3'),_0xb709('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb709('0x5')]},'key':{'type':Sequelize[_0xb709('0x5')]},'keyType':{'type':Sequelize[_0xb709('0x6')](_0xb709('0x0'),_0xb709('0x1'),_0xb709('0x2'))},'keyContent':{'type':Sequelize[_0xb709('0x5')]},'idField':{'type':Sequelize[_0xb709('0x5')]},'nameField':{'type':Sequelize[_0xb709('0x5')]},'customField':{'type':Sequelize[_0xb709('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb709('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9a295ce..5676036 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 _0xdec1=['undefined','limit','count','Content-Range','json','apply','reject','then','destroy','end','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x5113fd,_0x33fdfb){var _0x206c20=function(_0x50a180){while(--_0x50a180){_0x5113fd['push'](_0x5113fd['shift']());}};_0x206c20(++_0x33fdfb);}(_0xdec1,0x105));var _0x1dec=function(_0x2efad4,_0x5f54ac){_0x2efad4=_0x2efad4-0x0;var _0xd68dd0=_0xdec1[_0x2efad4];return _0xd68dd0;};'use strict';var emlformat=require(_0x1dec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1dec('0x1'));var jsonpatch=require(_0x1dec('0x2'));var rp=require(_0x1dec('0x3'));var moment=require('moment');var BPromise=require(_0x1dec('0x4'));var Mustache=require(_0x1dec('0x5'));var util=require(_0x1dec('0x6'));var path=require('path');var sox=require(_0x1dec('0x7'));var csv=require(_0x1dec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dec('0x9'));var _=require(_0x1dec('0xa'));var squel=require('squel');var crypto=require(_0x1dec('0xb'));var jsforce=require(_0x1dec('0xc'));var deskjs=require(_0x1dec('0xd'));var toCsv=require(_0x1dec('0x8'));var querystring=require(_0x1dec('0xe'));var Papa=require('papaparse');var Redis=require(_0x1dec('0xf'));var authService=require(_0x1dec('0x10'));var qs=require(_0x1dec('0x11'));var as=require(_0x1dec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dec('0x13'))(_0x1dec('0x14'));var utils=require('../../config/utils');var config=require(_0x1dec('0x15'));var licenseUtil=require(_0x1dec('0x16'));var db=require(_0x1dec('0x17'))['db'];function respondWithStatusCode(_0x53dd81,_0x4cf39c){_0x4cf39c=_0x4cf39c||0xcc;return function(_0x5c2542){if(_0x5c2542){return _0x53dd81[_0x1dec('0x18')](_0x4cf39c);}return _0x53dd81[_0x1dec('0x19')](_0x4cf39c)['end']();};}function respondWithResult(_0x448909,_0x5e5eb4){_0x5e5eb4=_0x5e5eb4||0xc8;return function(_0x2ba022){if(_0x2ba022){return _0x448909[_0x1dec('0x19')](_0x5e5eb4)['json'](_0x2ba022);}};}function respondWithFilteredResult(_0x50c06b,_0x166739){return function(_0x572249){if(_0x572249){var _0x450332=typeof _0x166739[_0x1dec('0x1a')]===_0x1dec('0x1b')&&typeof _0x166739[_0x1dec('0x1c')]==='undefined';var _0xfe2b4e=_0x572249[_0x1dec('0x1d')];var _0xce702e=_0x450332?0x0:_0x166739[_0x1dec('0x1a')];var _0x1e37aa=_0x450332?_0x572249['count']:_0x166739[_0x1dec('0x1a')]+_0x166739['limit'];var _0x31e1c8;if(_0x1e37aa>=_0xfe2b4e){_0x1e37aa=_0xfe2b4e;_0x31e1c8=0xc8;}else{_0x31e1c8=0xce;}_0x50c06b[_0x1dec('0x19')](_0x31e1c8);return _0x50c06b['set'](_0x1dec('0x1e'),_0xce702e+'-'+_0x1e37aa+'/'+_0xfe2b4e)[_0x1dec('0x1f')](_0x572249);}return null;};}function patchUpdates(_0x33638b){return function(_0x59961a){try{jsonpatch[_0x1dec('0x20')](_0x59961a,_0x33638b,!![]);}catch(_0x53c9fb){return BPromise[_0x1dec('0x21')](_0x53c9fb);}return _0x59961a['save']();};}function saveUpdates(_0x51046b,_0x465485){return function(_0x28d22e){if(_0x28d22e){return _0x28d22e['update'](_0x51046b)[_0x1dec('0x22')](function(_0x2ff08d){return _0x2ff08d;});}return null;};}function removeEntity(_0x5eb185,_0x2b7ae5){return function(_0x2f6296){if(_0x2f6296){return _0x2f6296[_0x1dec('0x23')]()['then'](function(){_0x5eb185[_0x1dec('0x19')](0xcc)[_0x1dec('0x24')]();});}};}function handleEntityNotFound(_0xe2e70f,_0x4479b8){return function(_0x4235c2){if(!_0x4235c2){_0xe2e70f[_0x1dec('0x18')](0x194);}return _0x4235c2;};}function handleError(_0x343374,_0x502873){_0x502873=_0x502873||0x1f4;return function(_0x58be36){logger['error'](_0x58be36['stack']);if(_0x58be36['name']){delete _0x58be36['name'];}_0x343374[_0x1dec('0x19')](_0x502873)[_0x1dec('0x25')](_0x58be36);};}exports[_0x1dec('0x26')]=function(_0x20f6fd,_0x56f7ff){var _0x2e8f95={},_0x3aa9f6={},_0x4f9420={'count':0x0,'rows':[]};var _0x5dd075=_[_0x1dec('0x27')](db[_0x1dec('0x28')][_0x1dec('0x29')],function(_0x504507){return{'name':_0x504507[_0x1dec('0x2a')],'type':_0x504507[_0x1dec('0x2b')][_0x1dec('0x2c')]};});_0x3aa9f6['model']=_[_0x1dec('0x27')](_0x5dd075,_0x1dec('0x2d'));_0x3aa9f6[_0x1dec('0x2e')]=_[_0x1dec('0x2f')](_0x20f6fd[_0x1dec('0x2e')]);_0x3aa9f6[_0x1dec('0x30')]=_[_0x1dec('0x31')](_0x3aa9f6[_0x1dec('0x32')],_0x3aa9f6[_0x1dec('0x2e')]);_0x2e8f95[_0x1dec('0x33')]=_['intersection'](_0x3aa9f6[_0x1dec('0x32')],qs[_0x1dec('0x34')](_0x20f6fd['query'][_0x1dec('0x34')]));_0x2e8f95[_0x1dec('0x33')]=_0x2e8f95[_0x1dec('0x33')][_0x1dec('0x35')]?_0x2e8f95[_0x1dec('0x33')]:_0x3aa9f6[_0x1dec('0x32')];if(!_0x20f6fd['query'][_0x1dec('0x36')]('nolimit')){_0x2e8f95[_0x1dec('0x1c')]=qs[_0x1dec('0x1c')](_0x20f6fd[_0x1dec('0x2e')]['limit']);_0x2e8f95[_0x1dec('0x1a')]=qs[_0x1dec('0x1a')](_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x1a')]);}_0x2e8f95[_0x1dec('0x37')]=qs[_0x1dec('0x38')](_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x38')]);_0x2e8f95[_0x1dec('0x39')]=qs[_0x1dec('0x30')](_[_0x1dec('0x3a')](_0x20f6fd[_0x1dec('0x2e')],_0x3aa9f6[_0x1dec('0x30')]),_0x5dd075);if(_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3b')]){_0x2e8f95[_0x1dec('0x39')]=_[_0x1dec('0x3c')](_0x2e8f95['where'],{'$or':_[_0x1dec('0x27')](_0x5dd075,function(_0x401a85){if(_0x401a85['type']!==_0x1dec('0x3d')){var _0x373d37={};_0x373d37[_0x401a85[_0x1dec('0x2d')]]={'$like':'%'+_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3b')]+'%'};return _0x373d37;}})});}_0x2e8f95=_['merge']({},_0x2e8f95,_0x20f6fd[_0x1dec('0x3e')]);var _0x5cb0ed={'where':_0x2e8f95[_0x1dec('0x39')]};return db[_0x1dec('0x28')]['count'](_0x5cb0ed)[_0x1dec('0x22')](function(_0x5b12d6){_0x4f9420[_0x1dec('0x1d')]=_0x5b12d6;if(_0x20f6fd[_0x1dec('0x2e')][_0x1dec('0x3f')]){_0x2e8f95[_0x1dec('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x1dec('0x41')](_0x2e8f95);})[_0x1dec('0x22')](function(_0x4c6bf0){_0x4f9420[_0x1dec('0x42')]=_0x4c6bf0;return _0x4f9420;})[_0x1dec('0x22')](respondWithFilteredResult(_0x56f7ff,_0x2e8f95))['catch'](handleError(_0x56f7ff,null));};exports[_0x1dec('0x43')]=function(_0x1a175f,_0x54082c){var _0x39acc0={'raw':!![],'where':{'id':_0x1a175f['params']['id']}},_0x2e0dc8={};_0x2e0dc8[_0x1dec('0x32')]=_[_0x1dec('0x2f')](db[_0x1dec('0x28')][_0x1dec('0x29')]);_0x2e0dc8['query']=_[_0x1dec('0x2f')](_0x1a175f[_0x1dec('0x2e')]);_0x2e0dc8[_0x1dec('0x30')]=_['intersection'](_0x2e0dc8[_0x1dec('0x32')],_0x2e0dc8['query']);_0x39acc0[_0x1dec('0x33')]=_[_0x1dec('0x31')](_0x2e0dc8[_0x1dec('0x32')],qs[_0x1dec('0x34')](_0x1a175f[_0x1dec('0x2e')][_0x1dec('0x34')]));_0x39acc0[_0x1dec('0x33')]=_0x39acc0['attributes'][_0x1dec('0x35')]?_0x39acc0['attributes']:_0x2e0dc8[_0x1dec('0x32')];if(_0x1a175f[_0x1dec('0x2e')][_0x1dec('0x3f')]){_0x39acc0[_0x1dec('0x40')]=[{'all':!![]}];}_0x39acc0=_[_0x1dec('0x3c')]({},_0x39acc0,_0x1a175f['options']);return db[_0x1dec('0x28')][_0x1dec('0x44')](_0x39acc0)[_0x1dec('0x22')](handleEntityNotFound(_0x54082c,null))['then'](respondWithResult(_0x54082c,null))[_0x1dec('0x45')](handleError(_0x54082c,null));};exports[_0x1dec('0x46')]=function(_0x46ee25,_0x57fe1f){return db[_0x1dec('0x28')][_0x1dec('0x46')](_0x46ee25['body'],{})['then'](respondWithResult(_0x57fe1f,0xc9))[_0x1dec('0x45')](handleError(_0x57fe1f,null));};exports['update']=function(_0x3607c2,_0x4dbde7){if(_0x3607c2['body']['id']){delete _0x3607c2['body']['id'];}return db[_0x1dec('0x28')][_0x1dec('0x44')]({'where':{'id':_0x3607c2[_0x1dec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4dbde7,null))['then'](saveUpdates(_0x3607c2['body'],null))['then'](respondWithResult(_0x4dbde7,null))[_0x1dec('0x45')](handleError(_0x4dbde7,null));};exports['destroy']=function(_0x28e179,_0x48c21e){return db[_0x1dec('0x28')]['find']({'where':{'id':_0x28e179[_0x1dec('0x47')]['id']}})['then'](handleEntityNotFound(_0x48c21e,null))[_0x1dec('0x22')](removeEntity(_0x48c21e,null))['catch'](handleError(_0x48c21e,null));}; \ No newline at end of file +var _0x8d99=['apply','then','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','show','include','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x8d99,0x110));var _0x98d9=function(_0x2016be,_0x1e85b2){_0x2016be=_0x2016be-0x0;var _0xf07f37=_0x8d99[_0x2016be];return _0xf07f37;};'use strict';var emlformat=require(_0x98d9('0x0'));var rimraf=require(_0x98d9('0x1'));var zipdir=require(_0x98d9('0x2'));var jsonpatch=require(_0x98d9('0x3'));var rp=require(_0x98d9('0x4'));var moment=require(_0x98d9('0x5'));var BPromise=require(_0x98d9('0x6'));var Mustache=require(_0x98d9('0x7'));var util=require(_0x98d9('0x8'));var path=require(_0x98d9('0x9'));var sox=require(_0x98d9('0xa'));var csv=require(_0x98d9('0xb'));var ejs=require(_0x98d9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x98d9('0xd'));var crypto=require(_0x98d9('0xe'));var jsforce=require(_0x98d9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x98d9('0xb'));var querystring=require(_0x98d9('0x10'));var Papa=require(_0x98d9('0x11'));var Redis=require('ioredis');var authService=require(_0x98d9('0x12'));var qs=require(_0x98d9('0x13'));var as=require(_0x98d9('0x14'));var hardwareService=require(_0x98d9('0x15'));var logger=require('../../config/logger')(_0x98d9('0x16'));var utils=require(_0x98d9('0x17'));var config=require(_0x98d9('0x18'));var licenseUtil=require(_0x98d9('0x19'));var db=require(_0x98d9('0x1a'))['db'];function respondWithStatusCode(_0x297278,_0xf3c21a){_0xf3c21a=_0xf3c21a||0xcc;return function(_0x10ead5){if(_0x10ead5){return _0x297278[_0x98d9('0x1b')](_0xf3c21a);}return _0x297278[_0x98d9('0x1c')](_0xf3c21a)[_0x98d9('0x1d')]();};}function respondWithResult(_0x33fb64,_0xb8858f){_0xb8858f=_0xb8858f||0xc8;return function(_0x29b102){if(_0x29b102){return _0x33fb64[_0x98d9('0x1c')](_0xb8858f)[_0x98d9('0x1e')](_0x29b102);}};}function respondWithFilteredResult(_0x36d2c,_0x16ed2f){return function(_0x346467){if(_0x346467){var _0x33d989=typeof _0x16ed2f[_0x98d9('0x1f')]==='undefined'&&typeof _0x16ed2f[_0x98d9('0x20')]===_0x98d9('0x21');var _0x3ce0ec=_0x346467[_0x98d9('0x22')];var _0x17f3f8=_0x33d989?0x0:_0x16ed2f[_0x98d9('0x1f')];var _0x2f5c36=_0x33d989?_0x346467[_0x98d9('0x22')]:_0x16ed2f[_0x98d9('0x1f')]+_0x16ed2f[_0x98d9('0x20')];var _0x1fad1f;if(_0x2f5c36>=_0x3ce0ec){_0x2f5c36=_0x3ce0ec;_0x1fad1f=0xc8;}else{_0x1fad1f=0xce;}_0x36d2c['status'](_0x1fad1f);return _0x36d2c['set'](_0x98d9('0x23'),_0x17f3f8+'-'+_0x2f5c36+'/'+_0x3ce0ec)[_0x98d9('0x1e')](_0x346467);}return null;};}function patchUpdates(_0x3ae6ac){return function(_0x4d2974){try{jsonpatch[_0x98d9('0x24')](_0x4d2974,_0x3ae6ac,!![]);}catch(_0x21fe77){return BPromise['reject'](_0x21fe77);}return _0x4d2974['save']();};}function saveUpdates(_0x494f65,_0x131019){return function(_0x4d425a){if(_0x4d425a){return _0x4d425a['update'](_0x494f65)[_0x98d9('0x25')](function(_0x874277){return _0x874277;});}return null;};}function removeEntity(_0x138a69,_0x536956){return function(_0x23f63e){if(_0x23f63e){return _0x23f63e['destroy']()[_0x98d9('0x25')](function(){_0x138a69[_0x98d9('0x1c')](0xcc)[_0x98d9('0x1d')]();});}};}function handleEntityNotFound(_0x37ba98,_0x33ab4e){return function(_0x79a43b){if(!_0x79a43b){_0x37ba98[_0x98d9('0x1b')](0x194);}return _0x79a43b;};}function handleError(_0x58b346,_0x2e1df9){_0x2e1df9=_0x2e1df9||0x1f4;return function(_0x45c090){logger[_0x98d9('0x26')](_0x45c090[_0x98d9('0x27')]);if(_0x45c090[_0x98d9('0x28')]){delete _0x45c090[_0x98d9('0x28')];}_0x58b346[_0x98d9('0x1c')](_0x2e1df9)[_0x98d9('0x29')](_0x45c090);};}exports[_0x98d9('0x2a')]=function(_0x3b29d5,_0x5bca97){var _0x3b6c8d={},_0x326066={},_0x433316={'count':0x0,'rows':[]};var _0x5777d9=_[_0x98d9('0x2b')](db['Dynamics365Field'][_0x98d9('0x2c')],function(_0x37a08c){return{'name':_0x37a08c['fieldName'],'type':_0x37a08c[_0x98d9('0x2d')][_0x98d9('0x2e')]};});_0x326066[_0x98d9('0x2f')]=_[_0x98d9('0x2b')](_0x5777d9,'name');_0x326066['query']=_[_0x98d9('0x30')](_0x3b29d5[_0x98d9('0x31')]);_0x326066[_0x98d9('0x32')]=_[_0x98d9('0x33')](_0x326066[_0x98d9('0x2f')],_0x326066[_0x98d9('0x31')]);_0x3b6c8d[_0x98d9('0x34')]=_[_0x98d9('0x33')](_0x326066[_0x98d9('0x2f')],qs[_0x98d9('0x35')](_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x35')]));_0x3b6c8d[_0x98d9('0x34')]=_0x3b6c8d[_0x98d9('0x34')][_0x98d9('0x36')]?_0x3b6c8d[_0x98d9('0x34')]:_0x326066[_0x98d9('0x2f')];if(!_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x37')](_0x98d9('0x38'))){_0x3b6c8d[_0x98d9('0x20')]=qs[_0x98d9('0x20')](_0x3b29d5[_0x98d9('0x31')]['limit']);_0x3b6c8d['offset']=qs[_0x98d9('0x1f')](_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x1f')]);}_0x3b6c8d['order']=qs['sort'](_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x39')]);_0x3b6c8d[_0x98d9('0x3a')]=qs['filters'](_[_0x98d9('0x3b')](_0x3b29d5[_0x98d9('0x31')],_0x326066[_0x98d9('0x32')]),_0x5777d9);if(_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x3c')]){_0x3b6c8d['where']=_[_0x98d9('0x3d')](_0x3b6c8d[_0x98d9('0x3a')],{'$or':_[_0x98d9('0x2b')](_0x5777d9,function(_0x4f6984){if(_0x4f6984['type']!==_0x98d9('0x3e')){var _0x7cb819={};_0x7cb819[_0x4f6984[_0x98d9('0x28')]]={'$like':'%'+_0x3b29d5['query']['filter']+'%'};return _0x7cb819;}})});}_0x3b6c8d=_[_0x98d9('0x3d')]({},_0x3b6c8d,_0x3b29d5[_0x98d9('0x3f')]);var _0x1bcda4={'where':_0x3b6c8d[_0x98d9('0x3a')]};return db[_0x98d9('0x40')][_0x98d9('0x22')](_0x1bcda4)[_0x98d9('0x25')](function(_0x3203fd){_0x433316['count']=_0x3203fd;if(_0x3b29d5[_0x98d9('0x31')][_0x98d9('0x41')]){_0x3b6c8d['include']=[{'all':!![]}];}return db[_0x98d9('0x40')][_0x98d9('0x42')](_0x3b6c8d);})[_0x98d9('0x25')](function(_0x17d365){_0x433316[_0x98d9('0x43')]=_0x17d365;return _0x433316;})['then'](respondWithFilteredResult(_0x5bca97,_0x3b6c8d))[_0x98d9('0x44')](handleError(_0x5bca97,null));};exports[_0x98d9('0x45')]=function(_0x5b81de,_0x1f292d){var _0x4ee048={'raw':!![],'where':{'id':_0x5b81de['params']['id']}},_0x18df73={};_0x18df73['model']=_[_0x98d9('0x30')](db[_0x98d9('0x40')][_0x98d9('0x2c')]);_0x18df73[_0x98d9('0x31')]=_[_0x98d9('0x30')](_0x5b81de[_0x98d9('0x31')]);_0x18df73['filters']=_[_0x98d9('0x33')](_0x18df73[_0x98d9('0x2f')],_0x18df73['query']);_0x4ee048[_0x98d9('0x34')]=_[_0x98d9('0x33')](_0x18df73['model'],qs[_0x98d9('0x35')](_0x5b81de['query'][_0x98d9('0x35')]));_0x4ee048[_0x98d9('0x34')]=_0x4ee048[_0x98d9('0x34')][_0x98d9('0x36')]?_0x4ee048[_0x98d9('0x34')]:_0x18df73[_0x98d9('0x2f')];if(_0x5b81de[_0x98d9('0x31')][_0x98d9('0x41')]){_0x4ee048[_0x98d9('0x46')]=[{'all':!![]}];}_0x4ee048=_[_0x98d9('0x3d')]({},_0x4ee048,_0x5b81de[_0x98d9('0x3f')]);return db[_0x98d9('0x40')][_0x98d9('0x47')](_0x4ee048)[_0x98d9('0x25')](handleEntityNotFound(_0x1f292d,null))['then'](respondWithResult(_0x1f292d,null))[_0x98d9('0x44')](handleError(_0x1f292d,null));};exports[_0x98d9('0x48')]=function(_0x24dfba,_0x1d20a8){return db['Dynamics365Field'][_0x98d9('0x48')](_0x24dfba['body'],{})[_0x98d9('0x25')](respondWithResult(_0x1d20a8,0xc9))[_0x98d9('0x44')](handleError(_0x1d20a8,null));};exports[_0x98d9('0x49')]=function(_0x522103,_0x28e53a){if(_0x522103[_0x98d9('0x4a')]['id']){delete _0x522103['body']['id'];}return db[_0x98d9('0x40')]['find']({'where':{'id':_0x522103[_0x98d9('0x4b')]['id']}})[_0x98d9('0x25')](handleEntityNotFound(_0x28e53a,null))[_0x98d9('0x25')](saveUpdates(_0x522103[_0x98d9('0x4a')],null))[_0x98d9('0x25')](respondWithResult(_0x28e53a,null))[_0x98d9('0x44')](handleError(_0x28e53a,null));};exports[_0x98d9('0x4c')]=function(_0x45f237,_0x18e6eb){return db[_0x98d9('0x40')][_0x98d9('0x47')]({'where':{'id':_0x45f237[_0x98d9('0x4b')]['id']}})[_0x98d9('0x25')](handleEntityNotFound(_0x18e6eb,null))[_0x98d9('0x25')](removeEntity(_0x18e6eb,null))['catch'](handleError(_0x18e6eb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2c0eb16..f57404a 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 _0x39a6=['idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x39a6,0x7f));var _0x639a=function(_0x5df4b3,_0x4fa6c6){_0x5df4b3=_0x5df4b3-0x0;var _0x116bd8=_0x39a6[_0x5df4b3];return _0x116bd8;};'use strict';var _=require(_0x639a('0x0'));var util=require('util');var logger=require(_0x639a('0x1'))(_0x639a('0x2'));var moment=require(_0x639a('0x3'));var BPromise=require(_0x639a('0x4'));var rp=require(_0x639a('0x5'));var fs=require('fs');var path=require(_0x639a('0x6'));var rimraf=require(_0x639a('0x7'));var config=require(_0x639a('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x639a('0x9')]=function(_0x4de439,_0x26b0b3){return _0x4de439[_0x639a('0xa')]('Dynamics365Field',attributes,{'tableName':_0x639a('0xb'),'paranoid':![],'indexes':[{'name':_0x639a('0xc'),'fields':[_0x639a('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28a1=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x13c020,_0x4b768b){var _0xe9b3d4=function(_0x4fca57){while(--_0x4fca57){_0x13c020['push'](_0x13c020['shift']());}};_0xe9b3d4(++_0x4b768b);}(_0x28a1,0x183));var _0x128a=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x28a1[_0x54e6f5];return _0x5e8794;};'use strict';var _=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var logger=require(_0x128a('0x2'))(_0x128a('0x3'));var moment=require('moment');var BPromise=require(_0x128a('0x4'));var rp=require(_0x128a('0x5'));var fs=require('fs');var path=require(_0x128a('0x6'));var rimraf=require(_0x128a('0x7'));var config=require(_0x128a('0x8'));var attributes=require(_0x128a('0x9'));module[_0x128a('0xa')]=function(_0x463bd3,_0x255f12){return _0x463bd3[_0x128a('0xb')](_0x128a('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x128a('0xd'),'fields':['idField',_0x128a('0xe')],'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 2c6d17b..3e1511b 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 _0x3b16=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b16,0x1c7));var _0x63b1=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3b16[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x63b1('0x0'));var util=require(_0x63b1('0x1'));var moment=require(_0x63b1('0x2'));var BPromise=require(_0x63b1('0x3'));var rs=require(_0x63b1('0x4'));var fs=require('fs');var Redis=require(_0x63b1('0x5'));var db=require(_0x63b1('0x6'))['db'];var utils=require(_0x63b1('0x7'));var logger=require(_0x63b1('0x8'))(_0x63b1('0x9'));var config=require('../../config/environment');var jayson=require(_0x63b1('0xa'));var client=jayson[_0x63b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x80bfe4,_0x2e494d,_0x44a074){return new BPromise(function(_0x4323d6,_0x5cefd5){return client[_0x63b1('0xc')](_0x80bfe4,_0x44a074)[_0x63b1('0xd')](function(_0xcaf9ac){logger[_0x63b1('0xe')](_0x63b1('0xf'),_0x2e494d,_0x63b1('0x10'));logger[_0x63b1('0x11')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2e494d,'request\x20sent',JSON['stringify'](_0xcaf9ac));if(_0xcaf9ac[_0x63b1('0x12')]){if(_0xcaf9ac[_0x63b1('0x12')]['code']===0x1f4){logger[_0x63b1('0x12')](_0x63b1('0xf'),_0x2e494d,_0xcaf9ac['error'][_0x63b1('0x13')]);return _0x5cefd5(_0xcaf9ac[_0x63b1('0x12')][_0x63b1('0x13')]);}logger[_0x63b1('0x12')](_0x63b1('0xf'),_0x2e494d,_0xcaf9ac['error']['message']);return _0x4323d6(_0xcaf9ac[_0x63b1('0x12')][_0x63b1('0x13')]);}else{logger[_0x63b1('0xe')](_0x63b1('0xf'),_0x2e494d,'request\x20sent');_0x4323d6(_0xcaf9ac[_0x63b1('0x14')][_0x63b1('0x13')]);}})[_0x63b1('0x15')](function(_0x4f13d0){logger[_0x63b1('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x2e494d,_0x4f13d0);_0x5cefd5(_0x4f13d0);});});} \ No newline at end of file +var _0x5b9b=['code','Dynamics365Field,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4b8dd8,_0x173097){var _0x474ed7=function(_0x59d27d){while(--_0x59d27d){_0x4b8dd8['push'](_0x4b8dd8['shift']());}};_0x474ed7(++_0x173097);}(_0x5b9b,0x1e5));var _0xb5b9=function(_0x564c57,_0x54f257){_0x564c57=_0x564c57-0x0;var _0x11d4fa=_0x5b9b[_0x564c57];return _0x11d4fa;};'use strict';var _=require(_0xb5b9('0x0'));var util=require(_0xb5b9('0x1'));var moment=require(_0xb5b9('0x2'));var BPromise=require('bluebird');var rs=require(_0xb5b9('0x3'));var fs=require('fs');var Redis=require(_0xb5b9('0x4'));var db=require(_0xb5b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5b9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5b9('0x7')][_0xb5b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dae89,_0x135c78,_0x2c7b14){return new BPromise(function(_0x6c0d4f,_0x4cd3d4){return client['request'](_0x5dae89,_0x2c7b14)[_0xb5b9('0x9')](function(_0x3072b8){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x135c78,'request\x20sent');logger[_0xb5b9('0xa')](_0xb5b9('0xb'),_0x135c78,_0xb5b9('0xc'),JSON[_0xb5b9('0xd')](_0x3072b8));if(_0x3072b8[_0xb5b9('0xe')]){if(_0x3072b8[_0xb5b9('0xe')][_0xb5b9('0xf')]===0x1f4){logger[_0xb5b9('0xe')](_0xb5b9('0x10'),_0x135c78,_0x3072b8[_0xb5b9('0xe')][_0xb5b9('0x11')]);return _0x4cd3d4(_0x3072b8['error']['message']);}logger[_0xb5b9('0xe')](_0xb5b9('0x10'),_0x135c78,_0x3072b8[_0xb5b9('0xe')]['message']);return _0x6c0d4f(_0x3072b8[_0xb5b9('0xe')][_0xb5b9('0x11')]);}else{logger[_0xb5b9('0x12')](_0xb5b9('0x10'),_0x135c78,'request\x20sent');_0x6c0d4f(_0x3072b8['result']['message']);}})[_0xb5b9('0x13')](function(_0x13ddf8){logger[_0xb5b9('0xe')](_0xb5b9('0x10'),_0x135c78,_0x13ddf8);_0x4cd3d4(_0x13ddf8);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index aad6ace..bc3fcb7 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 _0xff35=['addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0xff35,0x13a));var _0x5ff3=function(_0xf1d988,_0x341f87){_0xf1d988=_0xf1d988-0x0;var _0x264fa0=_0xff35[_0xf1d988];return _0x264fa0;};'use strict';var multer=require(_0x5ff3('0x0'));var util=require('util');var path=require(_0x5ff3('0x1'));var timeout=require(_0x5ff3('0x2'));var express=require(_0x5ff3('0x3'));var router=express[_0x5ff3('0x4')]();var fs_extra=require(_0x5ff3('0x5'));var auth=require(_0x5ff3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x5ff3('0x7')](),controller['index']);router[_0x5ff3('0x8')](_0x5ff3('0x9'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xa')]);router['get'](_0x5ff3('0xb'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xc')]);router[_0x5ff3('0x8')]('/:id/fields',auth[_0x5ff3('0x7')](),controller[_0x5ff3('0xd')]);router[_0x5ff3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ff3('0xf')]);router[_0x5ff3('0xe')](_0x5ff3('0xb'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0x10')]);router[_0x5ff3('0x11')](_0x5ff3('0x9'),auth[_0x5ff3('0x7')](),controller[_0x5ff3('0x12')]);router[_0x5ff3('0x13')](_0x5ff3('0x9'),auth['isAuthenticated'](),controller[_0x5ff3('0x14')]);module[_0x5ff3('0x15')]=router; \ No newline at end of file +var _0xb003=['/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x3c65be,_0xbdde71){var _0xa7d880=function(_0x49e351){while(--_0x49e351){_0x3c65be['push'](_0x3c65be['shift']());}};_0xa7d880(++_0xbdde71);}(_0xb003,0xab));var _0x3b00=function(_0x21aa5b,_0x2c808f){_0x21aa5b=_0x21aa5b-0x0;var _0x2ca4c8=_0xb003[_0x21aa5b];return _0x2ca4c8;};'use strict';var multer=require(_0x3b00('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3b00('0x1'));var express=require(_0x3b00('0x2'));var router=express[_0x3b00('0x3')]();var fs_extra=require(_0x3b00('0x4'));var auth=require(_0x3b00('0x5'));var interaction=require(_0x3b00('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x3b00('0x7')]('/',auth['isAuthenticated'](),controller[_0x3b00('0x8')]);router[_0x3b00('0x7')](_0x3b00('0x9'),auth[_0x3b00('0xa')](),controller['show']);router[_0x3b00('0x7')](_0x3b00('0xb'),auth['isAuthenticated'](),controller[_0x3b00('0xc')]);router['get'](_0x3b00('0xd'),auth[_0x3b00('0xa')](),controller['getFields']);router[_0x3b00('0xe')]('/',auth[_0x3b00('0xa')](),controller['create']);router[_0x3b00('0xe')](_0x3b00('0xb'),auth[_0x3b00('0xa')](),controller[_0x3b00('0xf')]);router[_0x3b00('0x10')](_0x3b00('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b00('0x9'),auth[_0x3b00('0xa')](),controller[_0x3b00('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 51e2862..42bb95e 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 _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x18b729,_0x3f159e){var _0x596825=function(_0x1e285d){while(--_0x1e285d){_0x18b729['push'](_0x18b729['shift']());}};_0x596825(++_0x3f159e);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5ea165,_0x236631){_0x5ea165=_0x5ea165-0x0;var _0x5868d5=_0xaebd[_0x5ea165];return _0x5868d5;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7880=['exports','STRING','username','remoteUri'];(function(_0x47ccb2,_0x1268a0){var _0x155b41=function(_0x3168cd){while(--_0x3168cd){_0x47ccb2['push'](_0x47ccb2['shift']());}};_0x155b41(++_0x1268a0);}(_0x7880,0x1f4));var _0x0788=function(_0x17ebd1,_0x5bc2e3){_0x17ebd1=_0x17ebd1-0x0;var _0x3fe498=_0x7880[_0x17ebd1];return _0x3fe498;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ff0603c..f2f37a2 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 _0x66d3=['body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','group','source','ticket_type','company','remove','includes','custom_text','label','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','set','reject','save','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','FreshdeskAccount','includeAll','include','findAll','rows','catch','show','params','length','find','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66d3,0x10f));var _0x366d=function(_0x4bdd09,_0x40a121){_0x4bdd09=_0x4bdd09-0x0;var _0x13666a=_0x66d3[_0x4bdd09];return _0x13666a;};'use strict';var emlformat=require(_0x366d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366d('0x2'));var moment=require(_0x366d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x366d('0x4'));var util=require('util');var path=require(_0x366d('0x5'));var sox=require('sox');var csv=require(_0x366d('0x6'));var ejs=require(_0x366d('0x7'));var fs=require('fs');var fs_extra=require(_0x366d('0x8'));var _=require(_0x366d('0x9'));var squel=require(_0x366d('0xa'));var crypto=require(_0x366d('0xb'));var jsforce=require(_0x366d('0xc'));var deskjs=require(_0x366d('0xd'));var toCsv=require(_0x366d('0x6'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require('ioredis');var authService=require(_0x366d('0x10'));var qs=require(_0x366d('0x11'));var as=require(_0x366d('0x12'));var hardwareService=require(_0x366d('0x13'));var logger=require(_0x366d('0x14'))(_0x366d('0x15'));var utils=require(_0x366d('0x16'));var config=require(_0x366d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x366d('0x18'));function respondWithStatusCode(_0x797ee,_0x3dd776){_0x3dd776=_0x3dd776||0xcc;return function(_0x2eef82){if(_0x2eef82){return _0x797ee[_0x366d('0x19')](_0x3dd776);}return _0x797ee[_0x366d('0x1a')](_0x3dd776)['end']();};}function respondWithResult(_0x265292,_0x2a3fdb){_0x2a3fdb=_0x2a3fdb||0xc8;return function(_0x4e1d8e){if(_0x4e1d8e){return _0x265292[_0x366d('0x1a')](_0x2a3fdb)[_0x366d('0x1b')](_0x4e1d8e);}};}function respondWithFilteredResult(_0x54a1bb,_0x3da66f){return function(_0x309dc6){if(_0x309dc6){var _0x413008=typeof _0x3da66f['offset']===_0x366d('0x1c')&&typeof _0x3da66f['limit']===_0x366d('0x1c');var _0x6b9092=_0x309dc6['count'];var _0x401eca=_0x413008?0x0:_0x3da66f[_0x366d('0x1d')];var _0x12fecc=_0x413008?_0x309dc6[_0x366d('0x1e')]:_0x3da66f[_0x366d('0x1d')]+_0x3da66f['limit'];var _0xb8b16d;if(_0x12fecc>=_0x6b9092){_0x12fecc=_0x6b9092;_0xb8b16d=0xc8;}else{_0xb8b16d=0xce;}_0x54a1bb['status'](_0xb8b16d);return _0x54a1bb[_0x366d('0x1f')]('Content-Range',_0x401eca+'-'+_0x12fecc+'/'+_0x6b9092)['json'](_0x309dc6);}return null;};}function patchUpdates(_0x219106){return function(_0x3eb8d9){try{jsonpatch['apply'](_0x3eb8d9,_0x219106,!![]);}catch(_0x189dc0){return BPromise[_0x366d('0x20')](_0x189dc0);}return _0x3eb8d9[_0x366d('0x21')]();};}function saveUpdates(_0x58d16f,_0x3b5c89){return function(_0x3c540d){if(_0x3c540d){return _0x3c540d['update'](_0x58d16f)[_0x366d('0x22')](function(_0x47ebf4){return _0x47ebf4;});}return null;};}function removeEntity(_0x1c9ee9,_0x1326c9){return function(_0x46bf52){if(_0x46bf52){return _0x46bf52['destroy']()[_0x366d('0x22')](function(){_0x1c9ee9[_0x366d('0x1a')](0xcc)[_0x366d('0x23')]();});}};}function handleEntityNotFound(_0x5254e6,_0x53002e){return function(_0x5aec17){if(!_0x5aec17){_0x5254e6[_0x366d('0x19')](0x194);}return _0x5aec17;};}function handleError(_0x40f3df,_0x5d2b67){_0x5d2b67=_0x5d2b67||0x1f4;return function(_0x5592a1){logger[_0x366d('0x24')](_0x5592a1[_0x366d('0x25')]);if(_0x5592a1[_0x366d('0x26')]){delete _0x5592a1[_0x366d('0x26')];}_0x40f3df['status'](_0x5d2b67)[_0x366d('0x27')](_0x5592a1);};}exports['index']=function(_0x47cc0c,_0x13a6b2){var _0x594d42={},_0x535b26={},_0xa856fa={'count':0x0,'rows':[]};var _0x13aaca=_[_0x366d('0x28')](db['FreshdeskAccount'][_0x366d('0x29')],function(_0x2cb209){return{'name':_0x2cb209[_0x366d('0x2a')],'type':_0x2cb209[_0x366d('0x2b')][_0x366d('0x2c')]};});_0x535b26[_0x366d('0x2d')]=_['map'](_0x13aaca,_0x366d('0x26'));_0x535b26['query']=_[_0x366d('0x2e')](_0x47cc0c['query']);_0x535b26[_0x366d('0x2f')]=_[_0x366d('0x30')](_0x535b26[_0x366d('0x2d')],_0x535b26[_0x366d('0x31')]);_0x594d42['attributes']=_[_0x366d('0x30')](_0x535b26[_0x366d('0x2d')],qs[_0x366d('0x32')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x32')]));_0x594d42[_0x366d('0x33')]=_0x594d42['attributes']['length']?_0x594d42[_0x366d('0x33')]:_0x535b26[_0x366d('0x2d')];if(!_0x47cc0c[_0x366d('0x31')][_0x366d('0x34')]('nolimit')){_0x594d42[_0x366d('0x35')]=qs[_0x366d('0x35')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x35')]);_0x594d42[_0x366d('0x1d')]=qs[_0x366d('0x1d')](_0x47cc0c[_0x366d('0x31')][_0x366d('0x1d')]);}_0x594d42[_0x366d('0x36')]=qs['sort'](_0x47cc0c[_0x366d('0x31')][_0x366d('0x37')]);_0x594d42[_0x366d('0x38')]=qs['filters'](_[_0x366d('0x39')](_0x47cc0c[_0x366d('0x31')],_0x535b26[_0x366d('0x2f')]),_0x13aaca);if(_0x47cc0c[_0x366d('0x31')][_0x366d('0x3a')]){_0x594d42[_0x366d('0x38')]=_['merge'](_0x594d42[_0x366d('0x38')],{'$or':_[_0x366d('0x28')](_0x13aaca,function(_0x28dabd){if(_0x28dabd[_0x366d('0x2b')]!=='VIRTUAL'){var _0xffb576={};_0xffb576[_0x28dabd[_0x366d('0x26')]]={'$like':'%'+_0x47cc0c[_0x366d('0x31')][_0x366d('0x3a')]+'%'};return _0xffb576;}})});}_0x594d42=_[_0x366d('0x3b')]({},_0x594d42,_0x47cc0c['options']);var _0xf280fe={'where':_0x594d42[_0x366d('0x38')]};return db[_0x366d('0x3c')][_0x366d('0x1e')](_0xf280fe)[_0x366d('0x22')](function(_0x2957e2){_0xa856fa[_0x366d('0x1e')]=_0x2957e2;if(_0x47cc0c['query'][_0x366d('0x3d')]){_0x594d42[_0x366d('0x3e')]=[{'all':!![]}];}return db[_0x366d('0x3c')][_0x366d('0x3f')](_0x594d42);})[_0x366d('0x22')](function(_0x2dbcb5){_0xa856fa[_0x366d('0x40')]=_0x2dbcb5;return _0xa856fa;})[_0x366d('0x22')](respondWithFilteredResult(_0x13a6b2,_0x594d42))[_0x366d('0x41')](handleError(_0x13a6b2,null));};exports[_0x366d('0x42')]=function(_0x1b5d5c,_0x185abc){var _0x53c654={'raw':![],'where':{'id':_0x1b5d5c[_0x366d('0x43')]['id']}},_0xfe8801={};_0xfe8801['model']=_[_0x366d('0x2e')](db['FreshdeskAccount'][_0x366d('0x29')]);_0xfe8801['query']=_[_0x366d('0x2e')](_0x1b5d5c['query']);_0xfe8801[_0x366d('0x2f')]=_[_0x366d('0x30')](_0xfe8801[_0x366d('0x2d')],_0xfe8801[_0x366d('0x31')]);_0x53c654[_0x366d('0x33')]=_[_0x366d('0x30')](_0xfe8801[_0x366d('0x2d')],qs['fields'](_0x1b5d5c[_0x366d('0x31')][_0x366d('0x32')]));_0x53c654[_0x366d('0x33')]=_0x53c654[_0x366d('0x33')][_0x366d('0x44')]?_0x53c654[_0x366d('0x33')]:_0xfe8801[_0x366d('0x2d')];if(_0x1b5d5c[_0x366d('0x31')][_0x366d('0x3d')]){_0x53c654[_0x366d('0x3e')]=[{'all':!![]}];}_0x53c654=_[_0x366d('0x3b')]({},_0x53c654,_0x1b5d5c['options']);return db[_0x366d('0x3c')][_0x366d('0x45')](_0x53c654)[_0x366d('0x22')](handleEntityNotFound(_0x185abc,null))['then'](respondWithResult(_0x185abc,null))[_0x366d('0x41')](handleError(_0x185abc,null));};exports['create']=function(_0x15efc4,_0x423fb6){return db[_0x366d('0x3c')]['create'](_0x15efc4['body'],{})[_0x366d('0x22')](respondWithResult(_0x423fb6,0xc9))[_0x366d('0x41')](handleError(_0x423fb6,null));};exports[_0x366d('0x46')]=function(_0x68ba99,_0xe88468){if(_0x68ba99[_0x366d('0x47')]['id']){delete _0x68ba99[_0x366d('0x47')]['id'];}return db['FreshdeskAccount'][_0x366d('0x45')]({'where':{'id':_0x68ba99[_0x366d('0x43')]['id']}})[_0x366d('0x22')](handleEntityNotFound(_0xe88468,null))['then'](saveUpdates(_0x68ba99['body'],null))[_0x366d('0x22')](respondWithResult(_0xe88468,null))[_0x366d('0x41')](handleError(_0xe88468,null));};exports[_0x366d('0x48')]=function(_0x3948c8,_0xfffa10){return db[_0x366d('0x3c')][_0x366d('0x45')]({'where':{'id':_0x3948c8['params']['id']}})[_0x366d('0x22')](handleEntityNotFound(_0xfffa10,null))[_0x366d('0x22')](removeEntity(_0xfffa10,null))[_0x366d('0x41')](handleError(_0xfffa10,null));};exports[_0x366d('0x49')]=function(_0x1537d9,_0x9d8be,_0x7c3397){var _0x315f08={};var _0x8520af={};var _0x1359ea;var _0x39d546;return db['FreshdeskAccount'][_0x366d('0x4a')]({'where':{'id':_0x1537d9[_0x366d('0x43')]['id']}})['then'](handleEntityNotFound(_0x9d8be,null))[_0x366d('0x22')](function(_0x207afe){if(_0x207afe){_0x1359ea=_0x207afe;_0x8520af['model']=_[_0x366d('0x2e')](db[_0x366d('0x4b')]['rawAttributes']);_0x8520af[_0x366d('0x31')]=_[_0x366d('0x2e')](_0x1537d9[_0x366d('0x31')]);_0x8520af[_0x366d('0x2f')]=_['intersection'](_0x8520af[_0x366d('0x2d')],_0x8520af['query']);_0x315f08[_0x366d('0x33')]=_[_0x366d('0x30')](_0x8520af['model'],qs[_0x366d('0x32')](_0x1537d9['query'][_0x366d('0x32')]));_0x315f08[_0x366d('0x33')]=_0x315f08[_0x366d('0x33')]['length']?_0x315f08[_0x366d('0x33')]:_0x8520af[_0x366d('0x2d')];_0x315f08[_0x366d('0x36')]=qs[_0x366d('0x37')](_0x1537d9['query'][_0x366d('0x37')]);_0x315f08[_0x366d('0x38')]=qs[_0x366d('0x2f')](_[_0x366d('0x39')](_0x1537d9[_0x366d('0x31')],_0x8520af[_0x366d('0x2f')]));if(_0x1537d9[_0x366d('0x31')][_0x366d('0x3a')]){_0x315f08[_0x366d('0x38')]=_[_0x366d('0x3b')](_0x315f08['where'],{'$or':_[_0x366d('0x28')](_0x315f08[_0x366d('0x33')],function(_0x1da500){var _0x152da4={};_0x152da4[_0x1da500]={'$like':'%'+_0x1537d9[_0x366d('0x31')][_0x366d('0x3a')]+'%'};return _0x152da4;})});}_0x315f08=_[_0x366d('0x3b')]({},_0x315f08,_0x1537d9['options']);return _0x1359ea[_0x366d('0x49')](_0x315f08);}})[_0x366d('0x22')](function(_0x1da9a1){if(_0x1da9a1){_0x39d546=_0x1da9a1[_0x366d('0x44')];if(!_0x1537d9[_0x366d('0x31')][_0x366d('0x34')](_0x366d('0x4c'))){_0x315f08[_0x366d('0x35')]=qs[_0x366d('0x35')](_0x1537d9['query'][_0x366d('0x35')]);_0x315f08[_0x366d('0x1d')]=qs['offset'](_0x1537d9[_0x366d('0x31')][_0x366d('0x1d')]);}return _0x1359ea[_0x366d('0x49')](_0x315f08);}})[_0x366d('0x22')](function(_0x2ac178){if(_0x2ac178){return _0x2ac178?{'count':_0x39d546,'rows':_0x2ac178}:null;}})[_0x366d('0x22')](respondWithResult(_0x9d8be,null))[_0x366d('0x41')](handleError(_0x9d8be,null));};exports[_0x366d('0x4d')]=function(_0x25db3f,_0x299b86,_0x54430c){if(_0x25db3f[_0x366d('0x47')]['id']){delete _0x25db3f['body']['id'];}return db[_0x366d('0x3c')][_0x366d('0x4a')]({'where':{'id':_0x25db3f['params']['id']}})[_0x366d('0x22')](handleEntityNotFound(_0x299b86,null))[_0x366d('0x22')](function(_0x278ca2){if(_0x278ca2){_0x25db3f[_0x366d('0x47')]['AccountId']=_0x278ca2['id'];_0x25db3f[_0x366d('0x47')][_0x366d('0x4e')]=integrations[_0x366d('0x4f')](_0x25db3f[_0x366d('0x47')][_0x366d('0x50')],_0x25db3f['body'][_0x366d('0x2b')]);_0x25db3f[_0x366d('0x47')][_0x366d('0x51')]=integrations[_0x366d('0x52')](_0x25db3f[_0x366d('0x47')][_0x366d('0x50')],_0x25db3f[_0x366d('0x47')][_0x366d('0x2b')]);return db[_0x366d('0x4b')][_0x366d('0x53')](_0x25db3f[_0x366d('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0x366d('0x4e')},{'model':db[_0x366d('0x54')],'as':_0x366d('0x51')}]});}return null;})['then'](respondWithResult(_0x299b86,null))['catch'](handleError(_0x299b86,null));};exports[_0x366d('0x55')]=function(_0x15d796,_0x33f391,_0x241fd6){var _0x25a823='';return db[_0x366d('0x3c')][_0x366d('0x4a')]({'where':{'id':_0x15d796[_0x366d('0x43')]['id']},'attributes':['id',_0x366d('0x56'),'apiKey']})[_0x366d('0x22')](handleEntityNotFound(_0x33f391,null))[_0x366d('0x22')](function(_0x79ca8a){if(_0x79ca8a){_0x25a823=_0x79ca8a[_0x366d('0x56')];var _0x54e6d0=_0x25a823['slice'](-0x1);if(_0x54e6d0==='/'){_0x25a823=_0x25a823[_0x366d('0x57')](0x0,_0x25a823[_0x366d('0x58')](_0x54e6d0));}return rp({'method':_0x366d('0x59'),'uri':util[_0x366d('0x5a')]('%s/%s',_0x25a823,_0x366d('0x5b')),'headers':{'Authorization':util[_0x366d('0x5a')](_0x366d('0x5c'),new Buffer(util[_0x366d('0x5a')](_0x366d('0x5d'),_0x79ca8a['apiKey']))[_0x366d('0x5e')](_0x366d('0x5f')))},'json':!![]});}})[_0x366d('0x22')](function(_0x49df32){if(_0x49df32){var _0x466bfe=[_0x366d('0x60'),_0x366d('0x61'),'agent',_0x366d('0x62'),_0x366d('0x1a'),'priority',_0x366d('0x63'),_0x366d('0x64'),_0x366d('0x65'),_0x366d('0x63'),_0x366d('0x66')];_[_0x366d('0x67')](_0x49df32,function(_0x3192ba){return _0x466bfe[_0x366d('0x68')](_0x3192ba[_0x366d('0x26')])||!_0x3192ba['default']&&_0x3192ba[_0x366d('0x2b')]!==_0x366d('0x69')&&_0x3192ba[_0x366d('0x2b')]!=='custom_dropdown';});return{'count':_0x49df32[_0x366d('0x44')],'rows':_[_0x366d('0x28')](_0x49df32,function(_0x4046f3){return{'id':_0x4046f3[_0x366d('0x26')],'name':_0x4046f3[_0x366d('0x6a')],'custom':!_0x4046f3[_0x366d('0x6b')],'options':_0x4046f3[_0x366d('0x6c')]?_[_0x366d('0x28')](_0x4046f3[_0x366d('0x6c')],function(_0x1d380d){return{'name':_['capitalize'](_0x1d380d),'value':_0x1d380d};}):[]};})};}})['then'](respondWithResult(_0x33f391,null))['catch'](function(_0x1b2c75){var _0x3b01fb=_0x15d796[_0x366d('0x31')][_0x366d('0x6d')]?0x1f4:_0x1b2c75[_0x366d('0x6e')]||0x1f4;logger[_0x366d('0x24')](_0x366d('0x6f'),_0x366d('0x55'),_0x3b01fb,JSON[_0x366d('0x70')](_0x1b2c75));delete _0x1b2c75[_0x366d('0x26')];if(_0x3b01fb===0x191){_0x3b01fb=0x190;}_0x33f391[_0x366d('0x1a')](_0x3b01fb)[_0x366d('0x27')](_0x15d796[_0x366d('0x31')][_0x366d('0x6d')]?{'message':_0x366d('0x71'),'statusCode':_0x1b2c75[_0x366d('0x6e')]}:_0x1b2c75);});}; \ No newline at end of file +var _0x1cf3=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskConfiguration','FreshdeskField','Descriptions','getFields','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','apiKey','toString','requester','subject','description','priority','group','company','remove','includes','custom_dropdown','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x321783,_0x1fc724){var _0xe0830c=function(_0x3b2202){while(--_0x3b2202){_0x321783['push'](_0x321783['shift']());}};_0xe0830c(++_0x1fc724);}(_0x1cf3,0x1be));var _0x31cf=function(_0x24661b,_0x250f5d){_0x24661b=_0x24661b-0x0;var _0x2504aa=_0x1cf3[_0x24661b];return _0x2504aa;};'use strict';var emlformat=require(_0x31cf('0x0'));var rimraf=require(_0x31cf('0x1'));var zipdir=require(_0x31cf('0x2'));var jsonpatch=require(_0x31cf('0x3'));var rp=require('request-promise');var moment=require(_0x31cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31cf('0x5'));var util=require(_0x31cf('0x6'));var path=require(_0x31cf('0x7'));var sox=require(_0x31cf('0x8'));var csv=require(_0x31cf('0x9'));var ejs=require(_0x31cf('0xa'));var fs=require('fs');var fs_extra=require(_0x31cf('0xb'));var _=require(_0x31cf('0xc'));var squel=require(_0x31cf('0xd'));var crypto=require(_0x31cf('0xe'));var jsforce=require(_0x31cf('0xf'));var deskjs=require(_0x31cf('0x10'));var toCsv=require(_0x31cf('0x9'));var querystring=require(_0x31cf('0x11'));var Papa=require('papaparse');var Redis=require(_0x31cf('0x12'));var authService=require(_0x31cf('0x13'));var qs=require(_0x31cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31cf('0x15'));var logger=require(_0x31cf('0x16'))(_0x31cf('0x17'));var utils=require(_0x31cf('0x18'));var config=require(_0x31cf('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x31cf('0x1a'));function respondWithStatusCode(_0x34e202,_0xfc40c9){_0xfc40c9=_0xfc40c9||0xcc;return function(_0x464988){if(_0x464988){return _0x34e202['sendStatus'](_0xfc40c9);}return _0x34e202[_0x31cf('0x1b')](_0xfc40c9)[_0x31cf('0x1c')]();};}function respondWithResult(_0x41f3df,_0x492d3d){_0x492d3d=_0x492d3d||0xc8;return function(_0xfe3b10){if(_0xfe3b10){return _0x41f3df[_0x31cf('0x1b')](_0x492d3d)[_0x31cf('0x1d')](_0xfe3b10);}};}function respondWithFilteredResult(_0x1f6470,_0x4ae41f){return function(_0x54af12){if(_0x54af12){var _0x3be709=typeof _0x4ae41f[_0x31cf('0x1e')]===_0x31cf('0x1f')&&typeof _0x4ae41f['limit']===_0x31cf('0x1f');var _0x1218cc=_0x54af12['count'];var _0x560d11=_0x3be709?0x0:_0x4ae41f[_0x31cf('0x1e')];var _0x521be0=_0x3be709?_0x54af12[_0x31cf('0x20')]:_0x4ae41f['offset']+_0x4ae41f['limit'];var _0xb16c9f;if(_0x521be0>=_0x1218cc){_0x521be0=_0x1218cc;_0xb16c9f=0xc8;}else{_0xb16c9f=0xce;}_0x1f6470[_0x31cf('0x1b')](_0xb16c9f);return _0x1f6470[_0x31cf('0x21')](_0x31cf('0x22'),_0x560d11+'-'+_0x521be0+'/'+_0x1218cc)[_0x31cf('0x1d')](_0x54af12);}return null;};}function patchUpdates(_0x2499e7){return function(_0xd53f81){try{jsonpatch[_0x31cf('0x23')](_0xd53f81,_0x2499e7,!![]);}catch(_0x4942a8){return BPromise[_0x31cf('0x24')](_0x4942a8);}return _0xd53f81[_0x31cf('0x25')]();};}function saveUpdates(_0x247a48,_0xfa517f){return function(_0x2319d0){if(_0x2319d0){return _0x2319d0[_0x31cf('0x26')](_0x247a48)[_0x31cf('0x27')](function(_0x5cb51b){return _0x5cb51b;});}return null;};}function removeEntity(_0x33e6e1,_0x3f09d3){return function(_0x348b46){if(_0x348b46){return _0x348b46[_0x31cf('0x28')]()[_0x31cf('0x27')](function(){_0x33e6e1[_0x31cf('0x1b')](0xcc)[_0x31cf('0x1c')]();});}};}function handleEntityNotFound(_0x10dd40,_0x53664a){return function(_0x1c5a6d){if(!_0x1c5a6d){_0x10dd40[_0x31cf('0x29')](0x194);}return _0x1c5a6d;};}function handleError(_0x43519e,_0xc5fee6){_0xc5fee6=_0xc5fee6||0x1f4;return function(_0x19f3ac){logger[_0x31cf('0x2a')](_0x19f3ac[_0x31cf('0x2b')]);if(_0x19f3ac[_0x31cf('0x2c')]){delete _0x19f3ac[_0x31cf('0x2c')];}_0x43519e[_0x31cf('0x1b')](_0xc5fee6)['send'](_0x19f3ac);};}exports[_0x31cf('0x2d')]=function(_0x148e36,_0x4d7fd0){var _0x29b920={},_0x51e298={},_0x3bd4ce={'count':0x0,'rows':[]};var _0x6c789=_[_0x31cf('0x2e')](db[_0x31cf('0x2f')][_0x31cf('0x30')],function(_0x3daa30){return{'name':_0x3daa30[_0x31cf('0x31')],'type':_0x3daa30[_0x31cf('0x32')][_0x31cf('0x33')]};});_0x51e298[_0x31cf('0x34')]=_[_0x31cf('0x2e')](_0x6c789,_0x31cf('0x2c'));_0x51e298['query']=_['keys'](_0x148e36[_0x31cf('0x35')]);_0x51e298[_0x31cf('0x36')]=_[_0x31cf('0x37')](_0x51e298[_0x31cf('0x34')],_0x51e298[_0x31cf('0x35')]);_0x29b920[_0x31cf('0x38')]=_['intersection'](_0x51e298[_0x31cf('0x34')],qs[_0x31cf('0x39')](_0x148e36[_0x31cf('0x35')]['fields']));_0x29b920[_0x31cf('0x38')]=_0x29b920[_0x31cf('0x38')]['length']?_0x29b920['attributes']:_0x51e298[_0x31cf('0x34')];if(!_0x148e36[_0x31cf('0x35')][_0x31cf('0x3a')](_0x31cf('0x3b'))){_0x29b920['limit']=qs[_0x31cf('0x3c')](_0x148e36[_0x31cf('0x35')][_0x31cf('0x3c')]);_0x29b920['offset']=qs['offset'](_0x148e36['query'][_0x31cf('0x1e')]);}_0x29b920[_0x31cf('0x3d')]=qs[_0x31cf('0x3e')](_0x148e36[_0x31cf('0x35')][_0x31cf('0x3e')]);_0x29b920['where']=qs['filters'](_['pick'](_0x148e36[_0x31cf('0x35')],_0x51e298[_0x31cf('0x36')]),_0x6c789);if(_0x148e36[_0x31cf('0x35')]['filter']){_0x29b920[_0x31cf('0x3f')]=_[_0x31cf('0x40')](_0x29b920[_0x31cf('0x3f')],{'$or':_[_0x31cf('0x2e')](_0x6c789,function(_0x2ca35){if(_0x2ca35[_0x31cf('0x32')]!=='VIRTUAL'){var _0xc1a742={};_0xc1a742[_0x2ca35[_0x31cf('0x2c')]]={'$like':'%'+_0x148e36[_0x31cf('0x35')][_0x31cf('0x41')]+'%'};return _0xc1a742;}})});}_0x29b920=_[_0x31cf('0x40')]({},_0x29b920,_0x148e36[_0x31cf('0x42')]);var _0x453e11={'where':_0x29b920[_0x31cf('0x3f')]};return db[_0x31cf('0x2f')]['count'](_0x453e11)[_0x31cf('0x27')](function(_0x4bede3){_0x3bd4ce['count']=_0x4bede3;if(_0x148e36[_0x31cf('0x35')][_0x31cf('0x43')]){_0x29b920[_0x31cf('0x44')]=[{'all':!![]}];}return db[_0x31cf('0x2f')]['findAll'](_0x29b920);})[_0x31cf('0x27')](function(_0x1f2cdb){_0x3bd4ce[_0x31cf('0x45')]=_0x1f2cdb;return _0x3bd4ce;})[_0x31cf('0x27')](respondWithFilteredResult(_0x4d7fd0,_0x29b920))[_0x31cf('0x46')](handleError(_0x4d7fd0,null));};exports[_0x31cf('0x47')]=function(_0x540419,_0x4d45ed){var _0x44c1b2={'raw':![],'where':{'id':_0x540419[_0x31cf('0x48')]['id']}},_0x2bf3f9={};_0x2bf3f9[_0x31cf('0x34')]=_[_0x31cf('0x49')](db[_0x31cf('0x2f')][_0x31cf('0x30')]);_0x2bf3f9[_0x31cf('0x35')]=_[_0x31cf('0x49')](_0x540419[_0x31cf('0x35')]);_0x2bf3f9[_0x31cf('0x36')]=_[_0x31cf('0x37')](_0x2bf3f9[_0x31cf('0x34')],_0x2bf3f9[_0x31cf('0x35')]);_0x44c1b2[_0x31cf('0x38')]=_['intersection'](_0x2bf3f9[_0x31cf('0x34')],qs[_0x31cf('0x39')](_0x540419['query'][_0x31cf('0x39')]));_0x44c1b2[_0x31cf('0x38')]=_0x44c1b2[_0x31cf('0x38')][_0x31cf('0x4a')]?_0x44c1b2[_0x31cf('0x38')]:_0x2bf3f9[_0x31cf('0x34')];if(_0x540419[_0x31cf('0x35')][_0x31cf('0x43')]){_0x44c1b2[_0x31cf('0x44')]=[{'all':!![]}];}_0x44c1b2=_[_0x31cf('0x40')]({},_0x44c1b2,_0x540419[_0x31cf('0x42')]);return db[_0x31cf('0x2f')][_0x31cf('0x4b')](_0x44c1b2)[_0x31cf('0x27')](handleEntityNotFound(_0x4d45ed,null))[_0x31cf('0x27')](respondWithResult(_0x4d45ed,null))['catch'](handleError(_0x4d45ed,null));};exports['create']=function(_0x559ab0,_0x560887){return db[_0x31cf('0x2f')][_0x31cf('0x4c')](_0x559ab0[_0x31cf('0x4d')],{})['then'](respondWithResult(_0x560887,0xc9))[_0x31cf('0x46')](handleError(_0x560887,null));};exports[_0x31cf('0x26')]=function(_0x1c96f1,_0x486d77){if(_0x1c96f1[_0x31cf('0x4d')]['id']){delete _0x1c96f1[_0x31cf('0x4d')]['id'];}return db[_0x31cf('0x2f')]['find']({'where':{'id':_0x1c96f1['params']['id']}})[_0x31cf('0x27')](handleEntityNotFound(_0x486d77,null))[_0x31cf('0x27')](saveUpdates(_0x1c96f1['body'],null))[_0x31cf('0x27')](respondWithResult(_0x486d77,null))[_0x31cf('0x46')](handleError(_0x486d77,null));};exports['destroy']=function(_0x5a9f3c,_0x1ee5b1){return db[_0x31cf('0x2f')][_0x31cf('0x4b')]({'where':{'id':_0x5a9f3c[_0x31cf('0x48')]['id']}})[_0x31cf('0x27')](handleEntityNotFound(_0x1ee5b1,null))[_0x31cf('0x27')](removeEntity(_0x1ee5b1,null))[_0x31cf('0x46')](handleError(_0x1ee5b1,null));};exports[_0x31cf('0x4e')]=function(_0x2baaf3,_0x3a0ae5,_0x17ca4f){var _0x574ba2={};var _0x59b626={};var _0x1ffc54;var _0x5b3002;return db['FreshdeskAccount'][_0x31cf('0x4f')]({'where':{'id':_0x2baaf3['params']['id']}})[_0x31cf('0x27')](handleEntityNotFound(_0x3a0ae5,null))[_0x31cf('0x27')](function(_0x4a2ac1){if(_0x4a2ac1){_0x1ffc54=_0x4a2ac1;_0x59b626[_0x31cf('0x34')]=_[_0x31cf('0x49')](db['FreshdeskConfiguration']['rawAttributes']);_0x59b626[_0x31cf('0x35')]=_[_0x31cf('0x49')](_0x2baaf3[_0x31cf('0x35')]);_0x59b626['filters']=_['intersection'](_0x59b626[_0x31cf('0x34')],_0x59b626[_0x31cf('0x35')]);_0x574ba2[_0x31cf('0x38')]=_[_0x31cf('0x37')](_0x59b626[_0x31cf('0x34')],qs[_0x31cf('0x39')](_0x2baaf3['query']['fields']));_0x574ba2[_0x31cf('0x38')]=_0x574ba2[_0x31cf('0x38')][_0x31cf('0x4a')]?_0x574ba2[_0x31cf('0x38')]:_0x59b626[_0x31cf('0x34')];_0x574ba2[_0x31cf('0x3d')]=qs['sort'](_0x2baaf3[_0x31cf('0x35')][_0x31cf('0x3e')]);_0x574ba2[_0x31cf('0x3f')]=qs['filters'](_['pick'](_0x2baaf3[_0x31cf('0x35')],_0x59b626[_0x31cf('0x36')]));if(_0x2baaf3[_0x31cf('0x35')]['filter']){_0x574ba2['where']=_['merge'](_0x574ba2[_0x31cf('0x3f')],{'$or':_[_0x31cf('0x2e')](_0x574ba2[_0x31cf('0x38')],function(_0x545853){var _0x372486={};_0x372486[_0x545853]={'$like':'%'+_0x2baaf3[_0x31cf('0x35')][_0x31cf('0x41')]+'%'};return _0x372486;})});}_0x574ba2=_[_0x31cf('0x40')]({},_0x574ba2,_0x2baaf3[_0x31cf('0x42')]);return _0x1ffc54[_0x31cf('0x4e')](_0x574ba2);}})['then'](function(_0x4fc125){if(_0x4fc125){_0x5b3002=_0x4fc125['length'];if(!_0x2baaf3[_0x31cf('0x35')][_0x31cf('0x3a')](_0x31cf('0x3b'))){_0x574ba2[_0x31cf('0x3c')]=qs[_0x31cf('0x3c')](_0x2baaf3[_0x31cf('0x35')][_0x31cf('0x3c')]);_0x574ba2[_0x31cf('0x1e')]=qs[_0x31cf('0x1e')](_0x2baaf3['query'][_0x31cf('0x1e')]);}return _0x1ffc54['getConfigurations'](_0x574ba2);}})[_0x31cf('0x27')](function(_0x485b76){if(_0x485b76){return _0x485b76?{'count':_0x5b3002,'rows':_0x485b76}:null;}})[_0x31cf('0x27')](respondWithResult(_0x3a0ae5,null))[_0x31cf('0x46')](handleError(_0x3a0ae5,null));};exports['addConfiguration']=function(_0x5b30ab,_0x4ff2e7,_0xb82a7e){if(_0x5b30ab[_0x31cf('0x4d')]['id']){delete _0x5b30ab[_0x31cf('0x4d')]['id'];}return db[_0x31cf('0x2f')][_0x31cf('0x4f')]({'where':{'id':_0x5b30ab['params']['id']}})['then'](handleEntityNotFound(_0x4ff2e7,null))[_0x31cf('0x27')](function(_0x106cd0){if(_0x106cd0){_0x5b30ab[_0x31cf('0x4d')][_0x31cf('0x50')]=_0x106cd0['id'];_0x5b30ab[_0x31cf('0x4d')][_0x31cf('0x51')]=integrations[_0x31cf('0x52')](_0x5b30ab[_0x31cf('0x4d')]['channel'],_0x5b30ab[_0x31cf('0x4d')][_0x31cf('0x32')]);_0x5b30ab[_0x31cf('0x4d')]['Descriptions']=integrations[_0x31cf('0x53')](_0x5b30ab['body']['channel'],_0x5b30ab['body'][_0x31cf('0x32')]);return db[_0x31cf('0x54')][_0x31cf('0x4c')](_0x5b30ab['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x31cf('0x51')},{'model':db[_0x31cf('0x55')],'as':_0x31cf('0x56')}]});}return null;})[_0x31cf('0x27')](respondWithResult(_0x4ff2e7,null))['catch'](handleError(_0x4ff2e7,null));};exports[_0x31cf('0x57')]=function(_0x2a6e69,_0x5ca5ca,_0x39570f){var _0x2f633e='';return db[_0x31cf('0x2f')][_0x31cf('0x4f')]({'where':{'id':_0x2a6e69[_0x31cf('0x48')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x5ca5ca,null))['then'](function(_0x3a0b5f){if(_0x3a0b5f){_0x2f633e=_0x3a0b5f['remoteUri'];var _0x288be8=_0x2f633e['slice'](-0x1);if(_0x288be8==='/'){_0x2f633e=_0x2f633e[_0x31cf('0x58')](0x0,_0x2f633e[_0x31cf('0x59')](_0x288be8));}return rp({'method':_0x31cf('0x5a'),'uri':util[_0x31cf('0x5b')](_0x31cf('0x5c'),_0x2f633e,_0x31cf('0x5d')),'headers':{'Authorization':util[_0x31cf('0x5b')]('Basic\x20%s',new Buffer(util[_0x31cf('0x5b')](_0x31cf('0x5e'),_0x3a0b5f[_0x31cf('0x5f')]))[_0x31cf('0x60')]('base64'))},'json':!![]});}})[_0x31cf('0x27')](function(_0x127409){if(_0x127409){var _0x4304b3=[_0x31cf('0x61'),_0x31cf('0x62'),'agent',_0x31cf('0x63'),'status',_0x31cf('0x64'),_0x31cf('0x65'),'source','ticket_type',_0x31cf('0x65'),_0x31cf('0x66')];_[_0x31cf('0x67')](_0x127409,function(_0x47a3a2){return _0x4304b3[_0x31cf('0x68')](_0x47a3a2[_0x31cf('0x2c')])||!_0x47a3a2['default']&&_0x47a3a2[_0x31cf('0x32')]!=='custom_text'&&_0x47a3a2[_0x31cf('0x32')]!==_0x31cf('0x69');});return{'count':_0x127409[_0x31cf('0x4a')],'rows':_[_0x31cf('0x2e')](_0x127409,function(_0x1f495b){return{'id':_0x1f495b[_0x31cf('0x2c')],'name':_0x1f495b['label'],'custom':!_0x1f495b[_0x31cf('0x6a')],'options':_0x1f495b['choices']?_['map'](_0x1f495b[_0x31cf('0x6b')],function(_0x21e13c){return{'name':_[_0x31cf('0x6c')](_0x21e13c),'value':_0x21e13c};}):[]};})};}})['then'](respondWithResult(_0x5ca5ca,null))[_0x31cf('0x46')](function(_0x23aef0){var _0x588437=_0x2a6e69[_0x31cf('0x35')][_0x31cf('0x6d')]?0x1f4:_0x23aef0['statusCode']||0x1f4;logger['error'](_0x31cf('0x6e'),_0x31cf('0x57'),_0x588437,JSON['stringify'](_0x23aef0));delete _0x23aef0[_0x31cf('0x2c')];if(_0x588437===0x191){_0x588437=0x190;}_0x5ca5ca[_0x31cf('0x1b')](_0x588437)[_0x31cf('0x6f')](_0x2a6e69[_0x31cf('0x35')][_0x31cf('0x6d')]?{'message':_0x31cf('0x70'),'statusCode':_0x23aef0['statusCode']}:_0x23aef0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1bd8934..36937f4 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 _0xe733=['lodash','util','../../config/logger','api','bluebird','path','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe733,0x140));var _0x3e73=function(_0x8483ac,_0x5b9bab){_0x8483ac=_0x8483ac-0x0;var _0x4fcd66=_0xe733[_0x8483ac];return _0x4fcd66;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var logger=require(_0x3e73('0x2'))(_0x3e73('0x3'));var moment=require('moment');var BPromise=require(_0x3e73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e73('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e73('0x6'));var integrations=require(_0x3e73('0x7'));module['exports']=function(_0x19cef2,_0x193e64){return _0x19cef2[_0x3e73('0x8')](_0x3e73('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0b7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x4fc930,_0x59a279){var _0x55db91=function(_0x288237){while(--_0x288237){_0x4fc930['push'](_0x4fc930['shift']());}};_0x55db91(++_0x59a279);}(_0xe0b7,0xc1));var _0x7e0b=function(_0x34734c,_0x3c3ff3){_0x34734c=_0x34734c-0x0;var _0x4956f2=_0xe0b7[_0x34734c];return _0x4956f2;};'use strict';var _=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var logger=require('../../config/logger')(_0x7e0b('0x2'));var moment=require(_0x7e0b('0x3'));var BPromise=require(_0x7e0b('0x4'));var rp=require(_0x7e0b('0x5'));var fs=require('fs');var path=require(_0x7e0b('0x6'));var rimraf=require(_0x7e0b('0x7'));var config=require(_0x7e0b('0x8'));var attributes=require(_0x7e0b('0x9'));var integrations=require(_0x7e0b('0xa'));module['exports']=function(_0x29198c,_0x786868){return _0x29198c['define'](_0x7e0b('0xb'),attributes,{'tableName':_0x7e0b('0xc'),'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 d9dad97..eb27558 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 _0x96a5=['then','info','FreshdeskAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowFreshdeskAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x514ca4,_0x5f3a51){var _0x2a64dc=function(_0x4f5736){while(--_0x4f5736){_0x514ca4['push'](_0x514ca4['shift']());}};_0x2a64dc(++_0x5f3a51);}(_0x96a5,0xef));var _0x596a=function(_0x4e95c1,_0x58aa3c){_0x4e95c1=_0x4e95c1-0x0;var _0xb610e8=_0x96a5[_0x4e95c1];return _0xb610e8;};'use strict';var _=require(_0x596a('0x0'));var util=require(_0x596a('0x1'));var moment=require(_0x596a('0x2'));var BPromise=require(_0x596a('0x3'));var rs=require(_0x596a('0x4'));var fs=require('fs');var Redis=require(_0x596a('0x5'));var db=require(_0x596a('0x6'))['db'];var utils=require(_0x596a('0x7'));var logger=require(_0x596a('0x8'))(_0x596a('0x9'));var config=require('../../config/environment');var jayson=require(_0x596a('0xa'));var client=jayson[_0x596a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8bae2f,_0x153389,_0x110107){return new BPromise(function(_0x4e3537,_0x5bf528){return client[_0x596a('0xc')](_0x8bae2f,_0x110107)[_0x596a('0xd')](function(_0x2401f5){logger[_0x596a('0xe')](_0x596a('0xf'),_0x153389,'request\x20sent');logger[_0x596a('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x153389,'request\x20sent',JSON['stringify'](_0x2401f5));if(_0x2401f5[_0x596a('0x11')]){if(_0x2401f5[_0x596a('0x11')][_0x596a('0x12')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x153389,_0x2401f5[_0x596a('0x11')]['message']);return _0x5bf528(_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);}logger[_0x596a('0x11')](_0x596a('0xf'),_0x153389,_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);return _0x4e3537(_0x2401f5[_0x596a('0x11')][_0x596a('0x13')]);}else{logger[_0x596a('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x153389,_0x596a('0x14'));_0x4e3537(_0x2401f5[_0x596a('0x15')]['message']);}})[_0x596a('0x16')](function(_0x3713af){logger[_0x596a('0x11')](_0x596a('0xf'),_0x153389,_0x3713af);_0x5bf528(_0x3713af);});});}exports[_0x596a('0x17')]=function(_0xc9c01c){var _0x4840da=this;return new Promise(function(_0x5e56f,_0xc4b801){return db['FreshdeskAccount'][_0x596a('0x18')]({'raw':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1a')]===undefined?!![]:![]:!![],'where':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1b')]||null:null,'attributes':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1c')]||null:null,'limit':_0xc9c01c[_0x596a('0x19')]?_0xc9c01c[_0x596a('0x19')][_0x596a('0x1d')]||null:null,'include':_0xc9c01c['options']?_0xc9c01c[_0x596a('0x19')]['include']?_[_0x596a('0x1e')](_0xc9c01c[_0x596a('0x19')][_0x596a('0x1f')],function(_0x30998f){return{'model':db[_0x30998f[_0x596a('0x20')]],'as':_0x30998f['as'],'attributes':_0x30998f['attributes'],'include':_0x30998f[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x30998f[_0x596a('0x1f')],function(_0x2c068d){return{'model':db[_0x2c068d[_0x596a('0x20')]],'as':_0x2c068d['as'],'attributes':_0x2c068d[_0x596a('0x1c')],'include':_0x2c068d[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x2c068d[_0x596a('0x1f')],function(_0x5f0d8a){return{'model':db[_0x5f0d8a[_0x596a('0x20')]],'as':_0x5f0d8a['as'],'attributes':_0x5f0d8a[_0x596a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x596a('0xd')](function(_0x3275e1){logger[_0x596a('0xe')]('GetFreshdeskAccount',_0xc9c01c);logger['debug']('GetFreshdeskAccount',_0xc9c01c,JSON['stringify'](_0x3275e1));_0x5e56f(_0x3275e1);})[_0x596a('0x16')](function(_0x5c77d6){logger[_0x596a('0x11')](_0x596a('0x17'),_0x5c77d6['message'],_0xc9c01c);_0xc4b801(_0x4840da['error'](0x1f4,_0x5c77d6[_0x596a('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x3cfd05){var _0x610079=this;return new Promise(function(_0x35122e,_0x59ec65){return db['FreshdeskAccount'][_0x596a('0x21')]({'raw':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1b')]||null:null,'attributes':_0x3cfd05[_0x596a('0x19')]?_0x3cfd05[_0x596a('0x19')][_0x596a('0x1c')]||null:null,'include':_0x3cfd05['options']?_0x3cfd05[_0x596a('0x19')]['include']?_[_0x596a('0x1e')](_0x3cfd05[_0x596a('0x19')][_0x596a('0x1f')],function(_0x50185f){return{'model':db[_0x50185f[_0x596a('0x20')]],'as':_0x50185f['as'],'attributes':_0x50185f[_0x596a('0x1c')],'include':_0x50185f[_0x596a('0x1f')]?_[_0x596a('0x1e')](_0x50185f[_0x596a('0x1f')],function(_0x531c04){return{'model':db[_0x531c04[_0x596a('0x20')]],'as':_0x531c04['as'],'attributes':_0x531c04['attributes'],'include':_0x531c04['include']?_[_0x596a('0x1e')](_0x531c04[_0x596a('0x1f')],function(_0x4dc29e){return{'model':db[_0x4dc29e[_0x596a('0x20')]],'as':_0x4dc29e['as'],'attributes':_0x4dc29e[_0x596a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x596a('0xd')](function(_0xad59a1){logger[_0x596a('0xe')](_0x596a('0x22'),_0x3cfd05);logger['debug'](_0x596a('0x22'),_0x3cfd05,JSON[_0x596a('0x23')](_0xad59a1));_0x35122e(_0xad59a1);})[_0x596a('0x16')](function(_0x297ef8){logger[_0x596a('0x11')](_0x596a('0x22'),_0x297ef8[_0x596a('0x13')],_0x3cfd05);_0x59ec65(_0x610079[_0x596a('0x11')](0x1f4,_0x297ef8[_0x596a('0x13')]));});});}; \ No newline at end of file +var _0x6a73=['options','attributes','limit','include','map','model','debug','find','where','lodash','util','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll'];(function(_0x313cc4,_0x5ab68f){var _0xd252dd=function(_0x1d055b){while(--_0x1d055b){_0x313cc4['push'](_0x313cc4['shift']());}};_0xd252dd(++_0x5ab68f);}(_0x6a73,0x171));var _0x36a7=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x6a73[_0x271060];return _0x40540b;};'use strict';var _=require(_0x36a7('0x0'));var util=require(_0x36a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36a7('0x2'));var db=require(_0x36a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x36a7('0x4'))('rpc');var config=require(_0x36a7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x36a7('0x6')][_0x36a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4b9893,_0x1cf0fc,_0x447af1){return new BPromise(function(_0x19e97e,_0x4e0e18){return client[_0x36a7('0x8')](_0x4b9893,_0x447af1)[_0x36a7('0x9')](function(_0x102d13){logger[_0x36a7('0xa')](_0x36a7('0xb'),_0x1cf0fc,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1cf0fc,_0x36a7('0xc'),JSON[_0x36a7('0xd')](_0x102d13));if(_0x102d13[_0x36a7('0xe')]){if(_0x102d13['error'][_0x36a7('0xf')]===0x1f4){logger[_0x36a7('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x1cf0fc,_0x102d13[_0x36a7('0xe')][_0x36a7('0x10')]);return _0x4e0e18(_0x102d13[_0x36a7('0xe')][_0x36a7('0x10')]);}logger[_0x36a7('0xe')](_0x36a7('0xb'),_0x1cf0fc,_0x102d13['error'][_0x36a7('0x10')]);return _0x19e97e(_0x102d13[_0x36a7('0xe')][_0x36a7('0x10')]);}else{logger[_0x36a7('0xa')](_0x36a7('0xb'),_0x1cf0fc,'request\x20sent');_0x19e97e(_0x102d13['result'][_0x36a7('0x10')]);}})[_0x36a7('0x11')](function(_0x10fd9){logger[_0x36a7('0xe')](_0x36a7('0xb'),_0x1cf0fc,_0x10fd9);_0x4e0e18(_0x10fd9);});});}exports[_0x36a7('0x12')]=function(_0x248bbf){var _0x3e342e=this;return new Promise(function(_0x1f869c,_0x58808a){return db[_0x36a7('0x13')][_0x36a7('0x14')]({'raw':_0x248bbf['options']?_0x248bbf[_0x36a7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x248bbf[_0x36a7('0x15')]?_0x248bbf['options']['where']||null:null,'attributes':_0x248bbf['options']?_0x248bbf[_0x36a7('0x15')][_0x36a7('0x16')]||null:null,'limit':_0x248bbf[_0x36a7('0x15')]?_0x248bbf[_0x36a7('0x15')][_0x36a7('0x17')]||null:null,'include':_0x248bbf[_0x36a7('0x15')]?_0x248bbf[_0x36a7('0x15')][_0x36a7('0x18')]?_[_0x36a7('0x19')](_0x248bbf[_0x36a7('0x15')][_0x36a7('0x18')],function(_0x49a2de){return{'model':db[_0x49a2de['model']],'as':_0x49a2de['as'],'attributes':_0x49a2de[_0x36a7('0x16')],'include':_0x49a2de['include']?_[_0x36a7('0x19')](_0x49a2de[_0x36a7('0x18')],function(_0x3321d4){return{'model':db[_0x3321d4[_0x36a7('0x1a')]],'as':_0x3321d4['as'],'attributes':_0x3321d4[_0x36a7('0x16')],'include':_0x3321d4[_0x36a7('0x18')]?_['map'](_0x3321d4[_0x36a7('0x18')],function(_0x728c73){return{'model':db[_0x728c73[_0x36a7('0x1a')]],'as':_0x728c73['as'],'attributes':_0x728c73[_0x36a7('0x16')]};}):[]};}):[]};}):[]:[]})[_0x36a7('0x9')](function(_0x5f1bca){logger[_0x36a7('0xa')](_0x36a7('0x12'),_0x248bbf);logger[_0x36a7('0x1b')](_0x36a7('0x12'),_0x248bbf,JSON[_0x36a7('0xd')](_0x5f1bca));_0x1f869c(_0x5f1bca);})[_0x36a7('0x11')](function(_0x16ff63){logger[_0x36a7('0xe')](_0x36a7('0x12'),_0x16ff63[_0x36a7('0x10')],_0x248bbf);_0x58808a(_0x3e342e[_0x36a7('0xe')](0x1f4,_0x16ff63['message']));});});};exports['ShowFreshdeskAccount']=function(_0x36d47b){var _0x57a7ad=this;return new Promise(function(_0x45229b,_0x501c67){return db['FreshdeskAccount'][_0x36a7('0x1c')]({'raw':_0x36d47b[_0x36a7('0x15')]?_0x36d47b[_0x36a7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x36d47b['options']?_0x36d47b[_0x36a7('0x15')][_0x36a7('0x1d')]||null:null,'attributes':_0x36d47b[_0x36a7('0x15')]?_0x36d47b[_0x36a7('0x15')][_0x36a7('0x16')]||null:null,'include':_0x36d47b[_0x36a7('0x15')]?_0x36d47b['options'][_0x36a7('0x18')]?_[_0x36a7('0x19')](_0x36d47b[_0x36a7('0x15')][_0x36a7('0x18')],function(_0x3b21a1){return{'model':db[_0x3b21a1[_0x36a7('0x1a')]],'as':_0x3b21a1['as'],'attributes':_0x3b21a1[_0x36a7('0x16')],'include':_0x3b21a1[_0x36a7('0x18')]?_[_0x36a7('0x19')](_0x3b21a1['include'],function(_0x1b8058){return{'model':db[_0x1b8058[_0x36a7('0x1a')]],'as':_0x1b8058['as'],'attributes':_0x1b8058[_0x36a7('0x16')],'include':_0x1b8058[_0x36a7('0x18')]?_[_0x36a7('0x19')](_0x1b8058[_0x36a7('0x18')],function(_0x5461e7){return{'model':db[_0x5461e7[_0x36a7('0x1a')]],'as':_0x5461e7['as'],'attributes':_0x5461e7[_0x36a7('0x16')]};}):[]};}):[]};}):[]:[]})[_0x36a7('0x9')](function(_0x1e4097){logger['info']('ShowFreshdeskAccount',_0x36d47b);logger[_0x36a7('0x1b')]('ShowFreshdeskAccount',_0x36d47b,JSON[_0x36a7('0xd')](_0x1e4097));_0x45229b(_0x1e4097);})[_0x36a7('0x11')](function(_0x14303b){logger['error']('ShowFreshdeskAccount',_0x14303b['message'],_0x36d47b);_0x501c67(_0x57a7ad['error'](0x1f4,_0x14303b[_0x36a7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9e2c40b..e5ebbf9 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 _0x83d1=['getTags','post','create','setTags','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags'];(function(_0x5536af,_0xb75547){var _0xcfeaaa=function(_0x5391c7){while(--_0x5391c7){_0x5536af['push'](_0x5536af['shift']());}};_0xcfeaaa(++_0xb75547);}(_0x83d1,0xe2));var _0x183d=function(_0x8430f6,_0x40c010){_0x8430f6=_0x8430f6-0x0;var _0x558dbb=_0x83d1[_0x8430f6];return _0x558dbb;};'use strict';var multer=require(_0x183d('0x0'));var util=require(_0x183d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x183d('0x2'));var router=express[_0x183d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x183d('0x4'));var interaction=require(_0x183d('0x5'));var config=require(_0x183d('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x183d('0x7')]('/',auth[_0x183d('0x8')](),controller[_0x183d('0x9')]);router[_0x183d('0x7')]('/:id',auth[_0x183d('0x8')](),controller[_0x183d('0xa')]);router[_0x183d('0x7')](_0x183d('0xb'),auth[_0x183d('0x8')](),controller[_0x183d('0xc')]);router[_0x183d('0x7')](_0x183d('0xd'),auth[_0x183d('0x8')](),controller['getSubjects']);router[_0x183d('0x7')](_0x183d('0xe'),auth[_0x183d('0x8')](),controller['getDescriptions']);router[_0x183d('0x7')](_0x183d('0xf'),auth[_0x183d('0x8')](),controller[_0x183d('0x10')]);router[_0x183d('0x11')]('/',auth[_0x183d('0x8')](),controller[_0x183d('0x12')]);router[_0x183d('0x11')](_0x183d('0xf'),auth[_0x183d('0x8')](),controller[_0x183d('0x13')]);router['put']('/:id',auth[_0x183d('0x8')](),controller['update']);router[_0x183d('0x14')]('/:id',auth[_0x183d('0x8')](),controller['destroy']);module[_0x183d('0x15')]=router; \ No newline at end of file +var _0x2d4d=['/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','post','setTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2d4d,0x11b));var _0xd2d4=function(_0x2e2c82,_0x4e7599){_0x2e2c82=_0x2e2c82-0x0;var _0x2e53d0=_0x2d4d[_0x2e2c82];return _0x2e53d0;};'use strict';var multer=require(_0xd2d4('0x0'));var util=require(_0xd2d4('0x1'));var path=require(_0xd2d4('0x2'));var timeout=require(_0xd2d4('0x3'));var express=require(_0xd2d4('0x4'));var router=express[_0xd2d4('0x5')]();var fs_extra=require(_0xd2d4('0x6'));var auth=require(_0xd2d4('0x7'));var interaction=require(_0xd2d4('0x8'));var config=require(_0xd2d4('0x9'));var controller=require(_0xd2d4('0xa'));router['get']('/',auth[_0xd2d4('0xb')](),controller[_0xd2d4('0xc')]);router[_0xd2d4('0xd')](_0xd2d4('0xe'),auth[_0xd2d4('0xb')](),controller[_0xd2d4('0xf')]);router[_0xd2d4('0xd')](_0xd2d4('0x10'),auth[_0xd2d4('0xb')](),controller[_0xd2d4('0x11')]);router['get'](_0xd2d4('0x12'),auth[_0xd2d4('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xd2d4('0xb')](),controller[_0xd2d4('0x13')]);router[_0xd2d4('0xd')](_0xd2d4('0x14'),auth[_0xd2d4('0xb')](),controller['getTags']);router[_0xd2d4('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd2d4('0x14'),auth['isAuthenticated'](),controller[_0xd2d4('0x16')]);router[_0xd2d4('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xd2d4('0x18')]);router[_0xd2d4('0x19')](_0xd2d4('0xe'),auth[_0xd2d4('0xb')](),controller['destroy']);module[_0xd2d4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index a9998fd..c9d40b3 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 _0x7f1c=['STRING','sequelize'];(function(_0x18592,_0xf82d77){var _0x3f4daa=function(_0x49080a){while(--_0x49080a){_0x18592['push'](_0x18592['shift']());}};_0x3f4daa(++_0xf82d77);}(_0x7f1c,0x131));var _0xc7f1=function(_0xe06dfd,_0x553a8b){_0xe06dfd=_0xe06dfd-0x0;var _0x35a4c3=_0x7f1c[_0xe06dfd];return _0x35a4c3;};'use strict';var Sequelize=require(_0xc7f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7f1('0x1')]},'description':{'type':Sequelize[_0xc7f1('0x1')]}}; \ No newline at end of file +var _0x6b47=['sequelize','exports','STRING'];(function(_0x502400,_0x3a75e9){var _0x200a9d=function(_0x2f4667){while(--_0x2f4667){_0x502400['push'](_0x502400['shift']());}};_0x200a9d(++_0x3a75e9);}(_0x6b47,0x186));var _0x76b4=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x6b47[_0x810e4d];return _0x13f01c;};'use strict';var Sequelize=require(_0x76b4('0x0'));module[_0x76b4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x76b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 29020e6..68836d8 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 _0x3c72=['attributes','fields','where','pick','filter','merge','rows','catch','show','length','options','find','create','body','params','destroy','findOne','FreshdeskField','order','sort','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2c77b9,_0x45f5e3){var _0x3c2596=function(_0x4facf6){while(--_0x4facf6){_0x2c77b9['push'](_0x2c77b9['shift']());}};_0x3c2596(++_0x45f5e3);}(_0x3c72,0x6b));var _0x23c7=function(_0x2854f5,_0x59c45e){_0x2854f5=_0x2854f5-0x0;var _0x39706a=_0x3c72[_0x2854f5];return _0x39706a;};'use strict';var emlformat=require(_0x23c7('0x0'));var rimraf=require(_0x23c7('0x1'));var zipdir=require(_0x23c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c7('0x3'));var moment=require(_0x23c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x23c7('0x5'));var util=require(_0x23c7('0x6'));var path=require(_0x23c7('0x7'));var sox=require(_0x23c7('0x8'));var csv=require(_0x23c7('0x9'));var ejs=require(_0x23c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x23c7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23c7('0x9'));var querystring=require('querystring');var Papa=require(_0x23c7('0xc'));var Redis=require(_0x23c7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x23c7('0xe'));var as=require(_0x23c7('0xf'));var hardwareService=require(_0x23c7('0x10'));var logger=require(_0x23c7('0x11'))(_0x23c7('0x12'));var utils=require('../../config/utils');var config=require(_0x23c7('0x13'));var licenseUtil=require(_0x23c7('0x14'));var db=require(_0x23c7('0x15'))['db'];function respondWithStatusCode(_0x267680,_0x44c3af){_0x44c3af=_0x44c3af||0xcc;return function(_0x32ed05){if(_0x32ed05){return _0x267680[_0x23c7('0x16')](_0x44c3af);}return _0x267680['status'](_0x44c3af)['end']();};}function respondWithResult(_0xbbf0d1,_0x515947){_0x515947=_0x515947||0xc8;return function(_0x34d2c3){if(_0x34d2c3){return _0xbbf0d1[_0x23c7('0x17')](_0x515947)[_0x23c7('0x18')](_0x34d2c3);}};}function respondWithFilteredResult(_0x1c496c,_0x4ae6e9){return function(_0x375ccd){if(_0x375ccd){var _0x240ad4=typeof _0x4ae6e9[_0x23c7('0x19')]===_0x23c7('0x1a')&&typeof _0x4ae6e9[_0x23c7('0x1b')]==='undefined';var _0x957018=_0x375ccd['count'];var _0x511fc1=_0x240ad4?0x0:_0x4ae6e9[_0x23c7('0x19')];var _0x571b2c=_0x240ad4?_0x375ccd[_0x23c7('0x1c')]:_0x4ae6e9['offset']+_0x4ae6e9[_0x23c7('0x1b')];var _0xe48476;if(_0x571b2c>=_0x957018){_0x571b2c=_0x957018;_0xe48476=0xc8;}else{_0xe48476=0xce;}_0x1c496c[_0x23c7('0x17')](_0xe48476);return _0x1c496c[_0x23c7('0x1d')](_0x23c7('0x1e'),_0x511fc1+'-'+_0x571b2c+'/'+_0x957018)[_0x23c7('0x18')](_0x375ccd);}return null;};}function patchUpdates(_0x1efc16){return function(_0x20baa5){try{jsonpatch[_0x23c7('0x1f')](_0x20baa5,_0x1efc16,!![]);}catch(_0x2f9c1d){return BPromise[_0x23c7('0x20')](_0x2f9c1d);}return _0x20baa5[_0x23c7('0x21')]();};}function saveUpdates(_0x4d4b3a,_0x1cc19e){return function(_0x38f34c){if(_0x38f34c){return _0x38f34c[_0x23c7('0x22')](_0x4d4b3a)[_0x23c7('0x23')](function(_0x34a04d){return _0x34a04d;});}return null;};}function removeEntity(_0x1c2080,_0x55dd83){return function(_0x1e63a8){if(_0x1e63a8){return _0x1e63a8['destroy']()['then'](function(){_0x1c2080['status'](0xcc)[_0x23c7('0x24')]();});}};}function handleEntityNotFound(_0x10c613,_0x5c6931){return function(_0x35323f){if(!_0x35323f){_0x10c613['sendStatus'](0x194);}return _0x35323f;};}function handleError(_0x2bae0d,_0x8918ad){_0x8918ad=_0x8918ad||0x1f4;return function(_0x154085){logger['error'](_0x154085['stack']);if(_0x154085[_0x23c7('0x25')]){delete _0x154085[_0x23c7('0x25')];}_0x2bae0d['status'](_0x8918ad)[_0x23c7('0x26')](_0x154085);};}exports[_0x23c7('0x27')]=function(_0x59196f,_0x5f151d){var _0x4763db={},_0x27ad21={},_0x2f4d63={'count':0x0,'rows':[]};var _0x31f38b=_[_0x23c7('0x28')](db[_0x23c7('0x29')][_0x23c7('0x2a')],function(_0x36c519){return{'name':_0x36c519[_0x23c7('0x2b')],'type':_0x36c519[_0x23c7('0x2c')][_0x23c7('0x2d')]};});_0x27ad21[_0x23c7('0x2e')]=_['map'](_0x31f38b,_0x23c7('0x25'));_0x27ad21[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x59196f[_0x23c7('0x2f')]);_0x27ad21[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x27ad21[_0x23c7('0x2e')],_0x27ad21['query']);_0x4763db[_0x23c7('0x33')]=_['intersection'](_0x27ad21[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x59196f['query'][_0x23c7('0x34')]));_0x4763db['attributes']=_0x4763db['attributes']['length']?_0x4763db[_0x23c7('0x33')]:_0x27ad21[_0x23c7('0x2e')];if(!_0x59196f[_0x23c7('0x2f')]['hasOwnProperty']('nolimit')){_0x4763db[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x59196f[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x4763db['offset']=qs[_0x23c7('0x19')](_0x59196f[_0x23c7('0x2f')][_0x23c7('0x19')]);}_0x4763db['order']=qs['sort'](_0x59196f[_0x23c7('0x2f')]['sort']);_0x4763db[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0x59196f[_0x23c7('0x2f')],_0x27ad21[_0x23c7('0x31')]),_0x31f38b);if(_0x59196f['query'][_0x23c7('0x37')]){_0x4763db[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x4763db[_0x23c7('0x35')],{'$or':_['map'](_0x31f38b,function(_0x154ffd){if(_0x154ffd[_0x23c7('0x2c')]!=='VIRTUAL'){var _0x3f87f1={};_0x3f87f1[_0x154ffd[_0x23c7('0x25')]]={'$like':'%'+_0x59196f[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x3f87f1;}})});}_0x4763db=_[_0x23c7('0x38')]({},_0x4763db,_0x59196f['options']);var _0x171824={'where':_0x4763db[_0x23c7('0x35')]};return db[_0x23c7('0x29')][_0x23c7('0x1c')](_0x171824)[_0x23c7('0x23')](function(_0x5f4ecc){_0x2f4d63['count']=_0x5f4ecc;if(_0x59196f[_0x23c7('0x2f')]['includeAll']){_0x4763db['include']=[{'all':!![]}];}return db[_0x23c7('0x29')]['findAll'](_0x4763db);})['then'](function(_0x5a7c12){_0x2f4d63[_0x23c7('0x39')]=_0x5a7c12;return _0x2f4d63;})[_0x23c7('0x23')](respondWithFilteredResult(_0x5f151d,_0x4763db))[_0x23c7('0x3a')](handleError(_0x5f151d,null));};exports[_0x23c7('0x3b')]=function(_0x46b0e8,_0x5471a4){var _0x5ef285={'raw':![],'where':{'id':_0x46b0e8['params']['id']}},_0x252142={};_0x252142[_0x23c7('0x2e')]=_[_0x23c7('0x30')](db[_0x23c7('0x29')][_0x23c7('0x2a')]);_0x252142[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x46b0e8[_0x23c7('0x2f')]);_0x252142['filters']=_[_0x23c7('0x32')](_0x252142[_0x23c7('0x2e')],_0x252142[_0x23c7('0x2f')]);_0x5ef285['attributes']=_[_0x23c7('0x32')](_0x252142[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x46b0e8['query'][_0x23c7('0x34')]));_0x5ef285['attributes']=_0x5ef285[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x5ef285[_0x23c7('0x33')]:_0x252142[_0x23c7('0x2e')];if(_0x46b0e8[_0x23c7('0x2f')]['includeAll']){_0x5ef285['include']=[{'all':!![]}];}_0x5ef285=_[_0x23c7('0x38')]({},_0x5ef285,_0x46b0e8[_0x23c7('0x3d')]);return db['FreshdeskConfiguration'][_0x23c7('0x3e')](_0x5ef285)['then'](handleEntityNotFound(_0x5471a4,null))[_0x23c7('0x23')](respondWithResult(_0x5471a4,null))[_0x23c7('0x3a')](handleError(_0x5471a4,null));};exports[_0x23c7('0x3f')]=function(_0x2628e1,_0x59dcca){return db['FreshdeskConfiguration'][_0x23c7('0x3f')](_0x2628e1[_0x23c7('0x40')],{})[_0x23c7('0x23')](respondWithResult(_0x59dcca,0xc9))[_0x23c7('0x3a')](handleError(_0x59dcca,null));};exports[_0x23c7('0x22')]=function(_0x531643,_0x3c3795){if(_0x531643['body']['id']){delete _0x531643[_0x23c7('0x40')]['id'];}return db[_0x23c7('0x29')][_0x23c7('0x3e')]({'where':{'id':_0x531643[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x3c3795,null))['then'](saveUpdates(_0x531643[_0x23c7('0x40')],null))[_0x23c7('0x23')](respondWithResult(_0x3c3795,null))['catch'](handleError(_0x3c3795,null));};exports[_0x23c7('0x42')]=function(_0x3fb6e6,_0x37abb6){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3fb6e6[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x37abb6,null))['then'](removeEntity(_0x37abb6,null))[_0x23c7('0x3a')](handleError(_0x37abb6,null));};exports['getFields']=function(_0xfb5bb7,_0x1adbee,_0x2101c5){var _0x396148={};var _0x9efe4b={};var _0x3f2afa;var _0x5a5b48;return db['FreshdeskConfiguration'][_0x23c7('0x43')]({'where':{'id':_0xfb5bb7[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x1adbee,null))[_0x23c7('0x23')](function(_0x3b65ae){if(_0x3b65ae){_0x3f2afa=_0x3b65ae;_0x9efe4b[_0x23c7('0x2e')]=_['keys'](db[_0x23c7('0x44')][_0x23c7('0x2a')]);_0x9efe4b[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0xfb5bb7[_0x23c7('0x2f')]);_0x9efe4b['filters']=_[_0x23c7('0x32')](_0x9efe4b['model'],_0x9efe4b[_0x23c7('0x2f')]);_0x396148[_0x23c7('0x33')]=_[_0x23c7('0x32')](_0x9efe4b[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x396148['attributes']=_0x396148[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x396148[_0x23c7('0x33')]:_0x9efe4b['model'];_0x396148[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x46')]);_0x396148[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0xfb5bb7[_0x23c7('0x2f')],_0x9efe4b[_0x23c7('0x31')]));if(_0xfb5bb7['query'][_0x23c7('0x37')]){_0x396148[_0x23c7('0x35')]=_['merge'](_0x396148[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x396148[_0x23c7('0x33')],function(_0x47616e){var _0x3f322d={};_0x3f322d[_0x47616e]={'$like':'%'+_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x3f322d;})});}_0x396148=_['merge']({},_0x396148,_0xfb5bb7[_0x23c7('0x3d')]);return _0x3f2afa[_0x23c7('0x47')](_0x396148);}})[_0x23c7('0x23')](function(_0x408cc8){if(_0x408cc8){_0x5a5b48=_0x408cc8[_0x23c7('0x3c')];if(!_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x396148[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x396148[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0xfb5bb7[_0x23c7('0x2f')][_0x23c7('0x19')]);}return _0x3f2afa[_0x23c7('0x47')](_0x396148);}})[_0x23c7('0x23')](function(_0x3c0254){if(_0x3c0254){return _0x3c0254?{'count':_0x5a5b48,'rows':_0x3c0254}:null;}})[_0x23c7('0x23')](respondWithResult(_0x1adbee,null))[_0x23c7('0x3a')](handleError(_0x1adbee,null));};exports[_0x23c7('0x4a')]=function(_0x803fec,_0xd34732,_0x156943){var _0x536c93={};var _0x2b3048={};var _0x50ee29;var _0x127a92;return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x803fec['params']['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0xd34732,null))['then'](function(_0x2df910){if(_0x2df910){_0x50ee29=_0x2df910;_0x2b3048[_0x23c7('0x2e')]=_['keys'](db[_0x23c7('0x44')]['rawAttributes']);_0x2b3048[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x803fec[_0x23c7('0x2f')]);_0x2b3048['filters']=_[_0x23c7('0x32')](_0x2b3048[_0x23c7('0x2e')],_0x2b3048[_0x23c7('0x2f')]);_0x536c93[_0x23c7('0x33')]=_[_0x23c7('0x32')](_0x2b3048['model'],qs[_0x23c7('0x34')](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x536c93[_0x23c7('0x33')]=_0x536c93[_0x23c7('0x33')]['length']?_0x536c93[_0x23c7('0x33')]:_0x2b3048['model'];_0x536c93[_0x23c7('0x45')]=qs['sort'](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x46')]);_0x536c93[_0x23c7('0x35')]=qs[_0x23c7('0x31')](_['pick'](_0x803fec[_0x23c7('0x2f')],_0x2b3048[_0x23c7('0x31')]));if(_0x803fec[_0x23c7('0x2f')]['filter']){_0x536c93['where']=_[_0x23c7('0x38')](_0x536c93[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x536c93[_0x23c7('0x33')],function(_0x59ff72){var _0x2a0587={};_0x2a0587[_0x59ff72]={'$like':'%'+_0x803fec[_0x23c7('0x2f')]['filter']+'%'};return _0x2a0587;})});}_0x536c93=_[_0x23c7('0x38')]({},_0x536c93,_0x803fec[_0x23c7('0x3d')]);return _0x50ee29[_0x23c7('0x4a')](_0x536c93);}})[_0x23c7('0x23')](function(_0x249291){if(_0x249291){_0x127a92=_0x249291['length'];if(!_0x803fec[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x536c93['limit']=qs[_0x23c7('0x1b')](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x536c93[_0x23c7('0x19')]=qs['offset'](_0x803fec[_0x23c7('0x2f')][_0x23c7('0x19')]);}return _0x50ee29[_0x23c7('0x4a')](_0x536c93);}})[_0x23c7('0x23')](function(_0x20d943){if(_0x20d943){return _0x20d943?{'count':_0x127a92,'rows':_0x20d943}:null;}})[_0x23c7('0x23')](respondWithResult(_0xd34732,null))[_0x23c7('0x3a')](handleError(_0xd34732,null));};exports[_0x23c7('0x4b')]=function(_0x3a02cf,_0x25f6e4,_0x428005){var _0x1efad5={};var _0x38191f={};var _0x1a94fc;var _0x373328;return db['FreshdeskConfiguration'][_0x23c7('0x43')]({'where':{'id':_0x3a02cf[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x25f6e4,null))[_0x23c7('0x23')](function(_0x525043){if(_0x525043){_0x1a94fc=_0x525043;_0x38191f['model']=_[_0x23c7('0x30')](db[_0x23c7('0x44')][_0x23c7('0x2a')]);_0x38191f[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x3a02cf[_0x23c7('0x2f')]);_0x38191f[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x38191f[_0x23c7('0x2e')],_0x38191f[_0x23c7('0x2f')]);_0x1efad5['attributes']=_[_0x23c7('0x32')](_0x38191f['model'],qs[_0x23c7('0x34')](_0x3a02cf['query'][_0x23c7('0x34')]));_0x1efad5[_0x23c7('0x33')]=_0x1efad5[_0x23c7('0x33')]['length']?_0x1efad5[_0x23c7('0x33')]:_0x38191f[_0x23c7('0x2e')];_0x1efad5[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0x3a02cf['query'][_0x23c7('0x46')]);_0x1efad5[_0x23c7('0x35')]=qs['filters'](_[_0x23c7('0x36')](_0x3a02cf['query'],_0x38191f[_0x23c7('0x31')]));if(_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x37')]){_0x1efad5[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x1efad5[_0x23c7('0x35')],{'$or':_[_0x23c7('0x28')](_0x1efad5[_0x23c7('0x33')],function(_0x2a87a6){var _0x472601={};_0x472601[_0x2a87a6]={'$like':'%'+_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x472601;})});}_0x1efad5=_[_0x23c7('0x38')]({},_0x1efad5,_0x3a02cf[_0x23c7('0x3d')]);return _0x1a94fc[_0x23c7('0x4b')](_0x1efad5);}})[_0x23c7('0x23')](function(_0x1f471c){if(_0x1f471c){_0x373328=_0x1f471c['length'];if(!_0x3a02cf[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x1efad5[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x3a02cf[_0x23c7('0x2f')]['limit']);_0x1efad5[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0x3a02cf[_0x23c7('0x2f')]['offset']);}return _0x1a94fc[_0x23c7('0x4b')](_0x1efad5);}})['then'](function(_0x55ec19){if(_0x55ec19){return _0x55ec19?{'count':_0x373328,'rows':_0x55ec19}:null;}})[_0x23c7('0x23')](respondWithResult(_0x25f6e4,null))['catch'](handleError(_0x25f6e4,null));};exports[_0x23c7('0x4c')]=function(_0x1f96b,_0x41bea5,_0x14f705){var _0x3ecd53={};var _0x4fe18a={};var _0x135a31;var _0x156ac1;return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x1f96b[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0x41bea5,null))[_0x23c7('0x23')](function(_0x4cffb0){if(_0x4cffb0){_0x135a31=_0x4cffb0;_0x4fe18a[_0x23c7('0x2e')]=_['keys'](db['Tag'][_0x23c7('0x2a')]);_0x4fe18a[_0x23c7('0x2f')]=_[_0x23c7('0x30')](_0x1f96b[_0x23c7('0x2f')]);_0x4fe18a[_0x23c7('0x31')]=_[_0x23c7('0x32')](_0x4fe18a['model'],_0x4fe18a['query']);_0x3ecd53['attributes']=_[_0x23c7('0x32')](_0x4fe18a[_0x23c7('0x2e')],qs[_0x23c7('0x34')](_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x34')]));_0x3ecd53['attributes']=_0x3ecd53[_0x23c7('0x33')][_0x23c7('0x3c')]?_0x3ecd53['attributes']:_0x4fe18a[_0x23c7('0x2e')];_0x3ecd53[_0x23c7('0x45')]=qs[_0x23c7('0x46')](_0x1f96b['query'][_0x23c7('0x46')]);_0x3ecd53[_0x23c7('0x35')]=qs[_0x23c7('0x31')](_['pick'](_0x1f96b[_0x23c7('0x2f')],_0x4fe18a[_0x23c7('0x31')]));if(_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x37')]){_0x3ecd53[_0x23c7('0x35')]=_[_0x23c7('0x38')](_0x3ecd53[_0x23c7('0x35')],{'$or':_['map'](_0x3ecd53['attributes'],function(_0x2ee8db){var _0x583b73={};_0x583b73[_0x2ee8db]={'$like':'%'+_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x37')]+'%'};return _0x583b73;})});}_0x3ecd53=_[_0x23c7('0x38')]({},_0x3ecd53,_0x1f96b['options']);return _0x135a31[_0x23c7('0x4c')](_0x3ecd53);}})[_0x23c7('0x23')](function(_0x2f5ff0){if(_0x2f5ff0){_0x156ac1=_0x2f5ff0['length'];if(!_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x48')](_0x23c7('0x49'))){_0x3ecd53[_0x23c7('0x1b')]=qs[_0x23c7('0x1b')](_0x1f96b[_0x23c7('0x2f')][_0x23c7('0x1b')]);_0x3ecd53[_0x23c7('0x19')]=qs[_0x23c7('0x19')](_0x1f96b[_0x23c7('0x2f')]['offset']);}return _0x135a31[_0x23c7('0x4c')](_0x3ecd53);}})[_0x23c7('0x23')](function(_0x43eed3){if(_0x43eed3){return _0x43eed3?{'count':_0x156ac1,'rows':_0x43eed3}:null;}})[_0x23c7('0x23')](respondWithResult(_0x41bea5,null))[_0x23c7('0x3a')](handleError(_0x41bea5,null));};exports[_0x23c7('0x4d')]=function(_0x37f169,_0xb4397c,_0xdd57e3){if(_0x37f169[_0x23c7('0x40')]['id']){delete _0x37f169[_0x23c7('0x40')]['id'];}return db[_0x23c7('0x29')][_0x23c7('0x43')]({'where':{'id':_0x37f169[_0x23c7('0x41')]['id']}})[_0x23c7('0x23')](handleEntityNotFound(_0xb4397c,null))[_0x23c7('0x23')](function(_0x356e36){if(_0x356e36){return _0x356e36[_0x23c7('0x4d')](_0x37f169[_0x23c7('0x40')][_0x23c7('0x4e')]||[]);}return null;})[_0x23c7('0x23')](respondWithResult(_0xb4397c,null))['catch'](handleError(_0xb4397c,null));}; \ No newline at end of file +var _0x3ec7=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','destroy','FreshdeskField','pick','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','then','error','name','send','index','FreshdeskConfiguration','rawAttributes','type','map'];(function(_0x3eced7,_0x4d98bd){var _0x171afc=function(_0x2272e2){while(--_0x2272e2){_0x3eced7['push'](_0x3eced7['shift']());}};_0x171afc(++_0x4d98bd);}(_0x3ec7,0x1bb));var _0x73ec=function(_0x3c073f,_0x177b75){_0x3c073f=_0x3c073f-0x0;var _0x53c0a8=_0x3ec7[_0x3c073f];return _0x53c0a8;};'use strict';var emlformat=require(_0x73ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x73ec('0x1'));var rp=require('request-promise');var moment=require(_0x73ec('0x2'));var BPromise=require(_0x73ec('0x3'));var Mustache=require('mustache');var util=require(_0x73ec('0x4'));var path=require(_0x73ec('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x73ec('0x6'));var fs=require('fs');var fs_extra=require(_0x73ec('0x7'));var _=require(_0x73ec('0x8'));var squel=require(_0x73ec('0x9'));var crypto=require(_0x73ec('0xa'));var jsforce=require(_0x73ec('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x73ec('0xc'));var querystring=require('querystring');var Papa=require(_0x73ec('0xd'));var Redis=require(_0x73ec('0xe'));var authService=require(_0x73ec('0xf'));var qs=require(_0x73ec('0x10'));var as=require(_0x73ec('0x11'));var hardwareService=require(_0x73ec('0x12'));var logger=require(_0x73ec('0x13'))(_0x73ec('0x14'));var utils=require(_0x73ec('0x15'));var config=require(_0x73ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x287483,_0x3b0f83){_0x3b0f83=_0x3b0f83||0xcc;return function(_0x2475da){if(_0x2475da){return _0x287483[_0x73ec('0x17')](_0x3b0f83);}return _0x287483['status'](_0x3b0f83)[_0x73ec('0x18')]();};}function respondWithResult(_0x3728d1,_0xa77c64){_0xa77c64=_0xa77c64||0xc8;return function(_0x2ea6e8){if(_0x2ea6e8){return _0x3728d1['status'](_0xa77c64)['json'](_0x2ea6e8);}};}function respondWithFilteredResult(_0x2bf255,_0x4a110d){return function(_0x5f088b){if(_0x5f088b){var _0x32ce85=typeof _0x4a110d[_0x73ec('0x19')]==='undefined'&&typeof _0x4a110d[_0x73ec('0x1a')]===_0x73ec('0x1b');var _0x4fef3f=_0x5f088b[_0x73ec('0x1c')];var _0x31759e=_0x32ce85?0x0:_0x4a110d['offset'];var _0x47c29d=_0x32ce85?_0x5f088b[_0x73ec('0x1c')]:_0x4a110d[_0x73ec('0x19')]+_0x4a110d[_0x73ec('0x1a')];var _0x251a2f;if(_0x47c29d>=_0x4fef3f){_0x47c29d=_0x4fef3f;_0x251a2f=0xc8;}else{_0x251a2f=0xce;}_0x2bf255[_0x73ec('0x1d')](_0x251a2f);return _0x2bf255[_0x73ec('0x1e')](_0x73ec('0x1f'),_0x31759e+'-'+_0x47c29d+'/'+_0x4fef3f)[_0x73ec('0x20')](_0x5f088b);}return null;};}function patchUpdates(_0x5649f5){return function(_0x1c7b87){try{jsonpatch['apply'](_0x1c7b87,_0x5649f5,!![]);}catch(_0x23cb80){return BPromise[_0x73ec('0x21')](_0x23cb80);}return _0x1c7b87['save']();};}function saveUpdates(_0x114bd4,_0x46bde4){return function(_0x57b973){if(_0x57b973){return _0x57b973['update'](_0x114bd4)['then'](function(_0xed7c6a){return _0xed7c6a;});}return null;};}function removeEntity(_0xaad9f0,_0xd0910b){return function(_0x5e4ac8){if(_0x5e4ac8){return _0x5e4ac8['destroy']()[_0x73ec('0x22')](function(){_0xaad9f0[_0x73ec('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a607d,_0x1cf408){return function(_0x1b3c50){if(!_0x1b3c50){_0x3a607d['sendStatus'](0x194);}return _0x1b3c50;};}function handleError(_0x1b5559,_0x54ae06){_0x54ae06=_0x54ae06||0x1f4;return function(_0x352176){logger[_0x73ec('0x23')](_0x352176['stack']);if(_0x352176[_0x73ec('0x24')]){delete _0x352176[_0x73ec('0x24')];}_0x1b5559[_0x73ec('0x1d')](_0x54ae06)[_0x73ec('0x25')](_0x352176);};}exports[_0x73ec('0x26')]=function(_0x2d864c,_0x14db0e){var _0x74d603={},_0x1033f3={},_0x1fad5b={'count':0x0,'rows':[]};var _0x4b6272=_['map'](db[_0x73ec('0x27')][_0x73ec('0x28')],function(_0x3478c6){return{'name':_0x3478c6['fieldName'],'type':_0x3478c6[_0x73ec('0x29')]['key']};});_0x1033f3['model']=_[_0x73ec('0x2a')](_0x4b6272,_0x73ec('0x24'));_0x1033f3[_0x73ec('0x2b')]=_[_0x73ec('0x2c')](_0x2d864c[_0x73ec('0x2b')]);_0x1033f3[_0x73ec('0x2d')]=_[_0x73ec('0x2e')](_0x1033f3[_0x73ec('0x2f')],_0x1033f3[_0x73ec('0x2b')]);_0x74d603['attributes']=_[_0x73ec('0x2e')](_0x1033f3['model'],qs[_0x73ec('0x30')](_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x30')]));_0x74d603[_0x73ec('0x31')]=_0x74d603[_0x73ec('0x31')][_0x73ec('0x32')]?_0x74d603[_0x73ec('0x31')]:_0x1033f3[_0x73ec('0x2f')];if(!_0x2d864c['query'][_0x73ec('0x33')](_0x73ec('0x34'))){_0x74d603[_0x73ec('0x1a')]=qs[_0x73ec('0x1a')](_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x1a')]);_0x74d603[_0x73ec('0x19')]=qs[_0x73ec('0x19')](_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x19')]);}_0x74d603[_0x73ec('0x35')]=qs[_0x73ec('0x36')](_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x36')]);_0x74d603[_0x73ec('0x37')]=qs[_0x73ec('0x2d')](_['pick'](_0x2d864c['query'],_0x1033f3[_0x73ec('0x2d')]),_0x4b6272);if(_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x38')]){_0x74d603['where']=_[_0x73ec('0x39')](_0x74d603[_0x73ec('0x37')],{'$or':_[_0x73ec('0x2a')](_0x4b6272,function(_0x2924f6){if(_0x2924f6[_0x73ec('0x29')]!==_0x73ec('0x3a')){var _0x55fc23={};_0x55fc23[_0x2924f6[_0x73ec('0x24')]]={'$like':'%'+_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x38')]+'%'};return _0x55fc23;}})});}_0x74d603=_[_0x73ec('0x39')]({},_0x74d603,_0x2d864c['options']);var _0x10b38b={'where':_0x74d603['where']};return db[_0x73ec('0x27')][_0x73ec('0x1c')](_0x10b38b)[_0x73ec('0x22')](function(_0x4ecf24){_0x1fad5b[_0x73ec('0x1c')]=_0x4ecf24;if(_0x2d864c[_0x73ec('0x2b')][_0x73ec('0x3b')]){_0x74d603['include']=[{'all':!![]}];}return db[_0x73ec('0x27')][_0x73ec('0x3c')](_0x74d603);})[_0x73ec('0x22')](function(_0x49fdf8){_0x1fad5b[_0x73ec('0x3d')]=_0x49fdf8;return _0x1fad5b;})[_0x73ec('0x22')](respondWithFilteredResult(_0x14db0e,_0x74d603))[_0x73ec('0x3e')](handleError(_0x14db0e,null));};exports[_0x73ec('0x3f')]=function(_0x32f6b6,_0x533124){var _0x141b44={'raw':![],'where':{'id':_0x32f6b6[_0x73ec('0x40')]['id']}},_0x233147={};_0x233147[_0x73ec('0x2f')]=_[_0x73ec('0x2c')](db['FreshdeskConfiguration'][_0x73ec('0x28')]);_0x233147[_0x73ec('0x2b')]=_['keys'](_0x32f6b6[_0x73ec('0x2b')]);_0x233147[_0x73ec('0x2d')]=_[_0x73ec('0x2e')](_0x233147[_0x73ec('0x2f')],_0x233147[_0x73ec('0x2b')]);_0x141b44[_0x73ec('0x31')]=_['intersection'](_0x233147['model'],qs[_0x73ec('0x30')](_0x32f6b6['query'][_0x73ec('0x30')]));_0x141b44[_0x73ec('0x31')]=_0x141b44[_0x73ec('0x31')][_0x73ec('0x32')]?_0x141b44[_0x73ec('0x31')]:_0x233147[_0x73ec('0x2f')];if(_0x32f6b6[_0x73ec('0x2b')]['includeAll']){_0x141b44[_0x73ec('0x41')]=[{'all':!![]}];}_0x141b44=_[_0x73ec('0x39')]({},_0x141b44,_0x32f6b6[_0x73ec('0x42')]);return db[_0x73ec('0x27')][_0x73ec('0x43')](_0x141b44)['then'](handleEntityNotFound(_0x533124,null))['then'](respondWithResult(_0x533124,null))[_0x73ec('0x3e')](handleError(_0x533124,null));};exports[_0x73ec('0x44')]=function(_0x12c2e8,_0x4312da){return db[_0x73ec('0x27')]['create'](_0x12c2e8[_0x73ec('0x45')],{})[_0x73ec('0x22')](respondWithResult(_0x4312da,0xc9))[_0x73ec('0x3e')](handleError(_0x4312da,null));};exports[_0x73ec('0x46')]=function(_0x17fb05,_0x1bbb25){if(_0x17fb05[_0x73ec('0x45')]['id']){delete _0x17fb05[_0x73ec('0x45')]['id'];}return db[_0x73ec('0x27')][_0x73ec('0x43')]({'where':{'id':_0x17fb05[_0x73ec('0x40')]['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x1bbb25,null))[_0x73ec('0x22')](saveUpdates(_0x17fb05['body'],null))[_0x73ec('0x22')](respondWithResult(_0x1bbb25,null))[_0x73ec('0x3e')](handleError(_0x1bbb25,null));};exports[_0x73ec('0x47')]=function(_0x40769a,_0x333c5f){return db[_0x73ec('0x27')][_0x73ec('0x43')]({'where':{'id':_0x40769a['params']['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x333c5f,null))[_0x73ec('0x22')](removeEntity(_0x333c5f,null))[_0x73ec('0x3e')](handleError(_0x333c5f,null));};exports['getFields']=function(_0x4580e4,_0x9d995d,_0x1e3407){var _0x6978e5={};var _0xef205e={};var _0x1a53a9;var _0x1246f1;return db[_0x73ec('0x27')]['findOne']({'where':{'id':_0x4580e4['params']['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x9d995d,null))[_0x73ec('0x22')](function(_0x280bf2){if(_0x280bf2){_0x1a53a9=_0x280bf2;_0xef205e['model']=_[_0x73ec('0x2c')](db[_0x73ec('0x48')][_0x73ec('0x28')]);_0xef205e['query']=_[_0x73ec('0x2c')](_0x4580e4[_0x73ec('0x2b')]);_0xef205e[_0x73ec('0x2d')]=_[_0x73ec('0x2e')](_0xef205e[_0x73ec('0x2f')],_0xef205e[_0x73ec('0x2b')]);_0x6978e5[_0x73ec('0x31')]=_[_0x73ec('0x2e')](_0xef205e[_0x73ec('0x2f')],qs[_0x73ec('0x30')](_0x4580e4['query'][_0x73ec('0x30')]));_0x6978e5[_0x73ec('0x31')]=_0x6978e5[_0x73ec('0x31')][_0x73ec('0x32')]?_0x6978e5[_0x73ec('0x31')]:_0xef205e[_0x73ec('0x2f')];_0x6978e5[_0x73ec('0x35')]=qs['sort'](_0x4580e4[_0x73ec('0x2b')][_0x73ec('0x36')]);_0x6978e5['where']=qs[_0x73ec('0x2d')](_[_0x73ec('0x49')](_0x4580e4[_0x73ec('0x2b')],_0xef205e['filters']));if(_0x4580e4[_0x73ec('0x2b')][_0x73ec('0x38')]){_0x6978e5[_0x73ec('0x37')]=_[_0x73ec('0x39')](_0x6978e5[_0x73ec('0x37')],{'$or':_[_0x73ec('0x2a')](_0x6978e5['attributes'],function(_0x40e4c2){var _0xaac185={};_0xaac185[_0x40e4c2]={'$like':'%'+_0x4580e4[_0x73ec('0x2b')][_0x73ec('0x38')]+'%'};return _0xaac185;})});}_0x6978e5=_[_0x73ec('0x39')]({},_0x6978e5,_0x4580e4['options']);return _0x1a53a9['getFields'](_0x6978e5);}})[_0x73ec('0x22')](function(_0x1d91ae){if(_0x1d91ae){_0x1246f1=_0x1d91ae['length'];if(!_0x4580e4[_0x73ec('0x2b')][_0x73ec('0x33')](_0x73ec('0x34'))){_0x6978e5[_0x73ec('0x1a')]=qs['limit'](_0x4580e4[_0x73ec('0x2b')][_0x73ec('0x1a')]);_0x6978e5[_0x73ec('0x19')]=qs[_0x73ec('0x19')](_0x4580e4['query'][_0x73ec('0x19')]);}return _0x1a53a9['getFields'](_0x6978e5);}})[_0x73ec('0x22')](function(_0x421fb2){if(_0x421fb2){return _0x421fb2?{'count':_0x1246f1,'rows':_0x421fb2}:null;}})[_0x73ec('0x22')](respondWithResult(_0x9d995d,null))['catch'](handleError(_0x9d995d,null));};exports[_0x73ec('0x4a')]=function(_0x27ba1f,_0x1918b5,_0x509e61){var _0x335ce0={};var _0x1f3dfb={};var _0x5b41e7;var _0x4836ff;return db[_0x73ec('0x27')][_0x73ec('0x4b')]({'where':{'id':_0x27ba1f['params']['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x1918b5,null))[_0x73ec('0x22')](function(_0x52c69c){if(_0x52c69c){_0x5b41e7=_0x52c69c;_0x1f3dfb[_0x73ec('0x2f')]=_[_0x73ec('0x2c')](db['FreshdeskField'][_0x73ec('0x28')]);_0x1f3dfb['query']=_[_0x73ec('0x2c')](_0x27ba1f['query']);_0x1f3dfb['filters']=_['intersection'](_0x1f3dfb[_0x73ec('0x2f')],_0x1f3dfb[_0x73ec('0x2b')]);_0x335ce0[_0x73ec('0x31')]=_[_0x73ec('0x2e')](_0x1f3dfb[_0x73ec('0x2f')],qs['fields'](_0x27ba1f[_0x73ec('0x2b')][_0x73ec('0x30')]));_0x335ce0[_0x73ec('0x31')]=_0x335ce0[_0x73ec('0x31')]['length']?_0x335ce0[_0x73ec('0x31')]:_0x1f3dfb[_0x73ec('0x2f')];_0x335ce0['order']=qs[_0x73ec('0x36')](_0x27ba1f['query'][_0x73ec('0x36')]);_0x335ce0[_0x73ec('0x37')]=qs[_0x73ec('0x2d')](_[_0x73ec('0x49')](_0x27ba1f[_0x73ec('0x2b')],_0x1f3dfb[_0x73ec('0x2d')]));if(_0x27ba1f[_0x73ec('0x2b')][_0x73ec('0x38')]){_0x335ce0['where']=_[_0x73ec('0x39')](_0x335ce0[_0x73ec('0x37')],{'$or':_[_0x73ec('0x2a')](_0x335ce0['attributes'],function(_0x270b8e){var _0x508015={};_0x508015[_0x270b8e]={'$like':'%'+_0x27ba1f[_0x73ec('0x2b')]['filter']+'%'};return _0x508015;})});}_0x335ce0=_[_0x73ec('0x39')]({},_0x335ce0,_0x27ba1f[_0x73ec('0x42')]);return _0x5b41e7['getSubjects'](_0x335ce0);}})['then'](function(_0x2bde06){if(_0x2bde06){_0x4836ff=_0x2bde06[_0x73ec('0x32')];if(!_0x27ba1f[_0x73ec('0x2b')][_0x73ec('0x33')](_0x73ec('0x34'))){_0x335ce0[_0x73ec('0x1a')]=qs['limit'](_0x27ba1f['query'][_0x73ec('0x1a')]);_0x335ce0[_0x73ec('0x19')]=qs[_0x73ec('0x19')](_0x27ba1f[_0x73ec('0x2b')]['offset']);}return _0x5b41e7[_0x73ec('0x4a')](_0x335ce0);}})[_0x73ec('0x22')](function(_0x27370e){if(_0x27370e){return _0x27370e?{'count':_0x4836ff,'rows':_0x27370e}:null;}})['then'](respondWithResult(_0x1918b5,null))[_0x73ec('0x3e')](handleError(_0x1918b5,null));};exports[_0x73ec('0x4c')]=function(_0x2c0ea9,_0x1043f7,_0x3295dd){var _0x1a8998={};var _0x408da8={};var _0x5ea9d4;var _0x4bb435;return db[_0x73ec('0x27')][_0x73ec('0x4b')]({'where':{'id':_0x2c0ea9[_0x73ec('0x40')]['id']}})['then'](handleEntityNotFound(_0x1043f7,null))[_0x73ec('0x22')](function(_0x3db9d2){if(_0x3db9d2){_0x5ea9d4=_0x3db9d2;_0x408da8[_0x73ec('0x2f')]=_[_0x73ec('0x2c')](db['FreshdeskField']['rawAttributes']);_0x408da8[_0x73ec('0x2b')]=_[_0x73ec('0x2c')](_0x2c0ea9[_0x73ec('0x2b')]);_0x408da8[_0x73ec('0x2d')]=_[_0x73ec('0x2e')](_0x408da8[_0x73ec('0x2f')],_0x408da8[_0x73ec('0x2b')]);_0x1a8998[_0x73ec('0x31')]=_[_0x73ec('0x2e')](_0x408da8['model'],qs[_0x73ec('0x30')](_0x2c0ea9[_0x73ec('0x2b')][_0x73ec('0x30')]));_0x1a8998[_0x73ec('0x31')]=_0x1a8998[_0x73ec('0x31')][_0x73ec('0x32')]?_0x1a8998[_0x73ec('0x31')]:_0x408da8[_0x73ec('0x2f')];_0x1a8998['order']=qs['sort'](_0x2c0ea9['query']['sort']);_0x1a8998['where']=qs[_0x73ec('0x2d')](_[_0x73ec('0x49')](_0x2c0ea9[_0x73ec('0x2b')],_0x408da8[_0x73ec('0x2d')]));if(_0x2c0ea9[_0x73ec('0x2b')]['filter']){_0x1a8998[_0x73ec('0x37')]=_[_0x73ec('0x39')](_0x1a8998[_0x73ec('0x37')],{'$or':_[_0x73ec('0x2a')](_0x1a8998[_0x73ec('0x31')],function(_0x4033c8){var _0x379225={};_0x379225[_0x4033c8]={'$like':'%'+_0x2c0ea9['query'][_0x73ec('0x38')]+'%'};return _0x379225;})});}_0x1a8998=_[_0x73ec('0x39')]({},_0x1a8998,_0x2c0ea9[_0x73ec('0x42')]);return _0x5ea9d4[_0x73ec('0x4c')](_0x1a8998);}})[_0x73ec('0x22')](function(_0x51c3b0){if(_0x51c3b0){_0x4bb435=_0x51c3b0[_0x73ec('0x32')];if(!_0x2c0ea9[_0x73ec('0x2b')]['hasOwnProperty'](_0x73ec('0x34'))){_0x1a8998[_0x73ec('0x1a')]=qs['limit'](_0x2c0ea9[_0x73ec('0x2b')]['limit']);_0x1a8998['offset']=qs['offset'](_0x2c0ea9[_0x73ec('0x2b')][_0x73ec('0x19')]);}return _0x5ea9d4[_0x73ec('0x4c')](_0x1a8998);}})[_0x73ec('0x22')](function(_0x22e80a){if(_0x22e80a){return _0x22e80a?{'count':_0x4bb435,'rows':_0x22e80a}:null;}})['then'](respondWithResult(_0x1043f7,null))[_0x73ec('0x3e')](handleError(_0x1043f7,null));};exports[_0x73ec('0x4d')]=function(_0x1c944e,_0x1ad1e8,_0x59e6e8){var _0x32ca33={};var _0xc7bcb7={};var _0x349522;var _0x3fd177;return db['FreshdeskConfiguration'][_0x73ec('0x4b')]({'where':{'id':_0x1c944e[_0x73ec('0x40')]['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x1ad1e8,null))[_0x73ec('0x22')](function(_0x50eecd){if(_0x50eecd){_0x349522=_0x50eecd;_0xc7bcb7[_0x73ec('0x2f')]=_[_0x73ec('0x2c')](db[_0x73ec('0x4e')][_0x73ec('0x28')]);_0xc7bcb7[_0x73ec('0x2b')]=_['keys'](_0x1c944e[_0x73ec('0x2b')]);_0xc7bcb7[_0x73ec('0x2d')]=_['intersection'](_0xc7bcb7[_0x73ec('0x2f')],_0xc7bcb7[_0x73ec('0x2b')]);_0x32ca33['attributes']=_['intersection'](_0xc7bcb7[_0x73ec('0x2f')],qs['fields'](_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x30')]));_0x32ca33[_0x73ec('0x31')]=_0x32ca33[_0x73ec('0x31')]['length']?_0x32ca33[_0x73ec('0x31')]:_0xc7bcb7[_0x73ec('0x2f')];_0x32ca33[_0x73ec('0x35')]=qs[_0x73ec('0x36')](_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x36')]);_0x32ca33[_0x73ec('0x37')]=qs[_0x73ec('0x2d')](_[_0x73ec('0x49')](_0x1c944e[_0x73ec('0x2b')],_0xc7bcb7[_0x73ec('0x2d')]));if(_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x38')]){_0x32ca33[_0x73ec('0x37')]=_[_0x73ec('0x39')](_0x32ca33['where'],{'$or':_[_0x73ec('0x2a')](_0x32ca33['attributes'],function(_0x41b992){var _0x48eab5={};_0x48eab5[_0x41b992]={'$like':'%'+_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x38')]+'%'};return _0x48eab5;})});}_0x32ca33=_[_0x73ec('0x39')]({},_0x32ca33,_0x1c944e[_0x73ec('0x42')]);return _0x349522[_0x73ec('0x4d')](_0x32ca33);}})[_0x73ec('0x22')](function(_0x634c4b){if(_0x634c4b){_0x3fd177=_0x634c4b[_0x73ec('0x32')];if(!_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x33')]('nolimit')){_0x32ca33['limit']=qs[_0x73ec('0x1a')](_0x1c944e[_0x73ec('0x2b')]['limit']);_0x32ca33[_0x73ec('0x19')]=qs['offset'](_0x1c944e[_0x73ec('0x2b')][_0x73ec('0x19')]);}return _0x349522['getTags'](_0x32ca33);}})[_0x73ec('0x22')](function(_0x4a5feb){if(_0x4a5feb){return _0x4a5feb?{'count':_0x3fd177,'rows':_0x4a5feb}:null;}})[_0x73ec('0x22')](respondWithResult(_0x1ad1e8,null))[_0x73ec('0x3e')](handleError(_0x1ad1e8,null));};exports[_0x73ec('0x4f')]=function(_0x161ba3,_0x484cc3,_0x25ed82){if(_0x161ba3[_0x73ec('0x45')]['id']){delete _0x161ba3[_0x73ec('0x45')]['id'];}return db['FreshdeskConfiguration'][_0x73ec('0x4b')]({'where':{'id':_0x161ba3['params']['id']}})[_0x73ec('0x22')](handleEntityNotFound(_0x484cc3,null))['then'](function(_0x3c7314){if(_0x3c7314){return _0x3c7314['setTags'](_0x161ba3[_0x73ec('0x45')][_0x73ec('0x50')]||[]);}return null;})[_0x73ec('0x22')](respondWithResult(_0x484cc3,null))['catch'](handleError(_0x484cc3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 31bde66..f0b1646 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 _0x52ea=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4dbc5b,_0xf50059){var _0x4bb4a8=function(_0x494403){while(--_0x494403){_0x4dbc5b['push'](_0x4dbc5b['shift']());}};_0x4bb4a8(++_0xf50059);}(_0x52ea,0xdf));var _0xa52e=function(_0x40b981,_0x48b308){_0x40b981=_0x40b981-0x0;var _0x58696b=_0x52ea[_0x40b981];return _0x58696b;};'use strict';var _=require(_0xa52e('0x0'));var util=require(_0xa52e('0x1'));var logger=require(_0xa52e('0x2'))(_0xa52e('0x3'));var moment=require(_0xa52e('0x4'));var BPromise=require(_0xa52e('0x5'));var rp=require(_0xa52e('0x6'));var fs=require('fs');var path=require(_0xa52e('0x7'));var rimraf=require('rimraf');var config=require(_0xa52e('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xa52e('0x9')]=function(_0x588f4e,_0x189475){return _0x588f4e[_0xa52e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda82=['../../config/environment','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda82,0x7a));var _0x2da8=function(_0x4a67cb,_0x3ba880){_0x4a67cb=_0x4a67cb-0x0;var _0x3b2c75=_0xda82[_0x4a67cb];return _0x3b2c75;};'use strict';var _=require('lodash');var util=require(_0x2da8('0x0'));var logger=require(_0x2da8('0x1'))(_0x2da8('0x2'));var moment=require(_0x2da8('0x3'));var BPromise=require(_0x2da8('0x4'));var rp=require(_0x2da8('0x5'));var fs=require('fs');var path=require(_0x2da8('0x6'));var rimraf=require(_0x2da8('0x7'));var config=require(_0x2da8('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x1bdb43,_0x583694){return _0x1bdb43['define']('FreshdeskConfiguration',attributes,{'tableName':_0x2da8('0x9'),'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 2020e00..5c8e903 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 _0x1be6=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x1be6,0x133));var _0x61be=function(_0x4be8d6,_0x19b6e7){_0x4be8d6=_0x4be8d6-0x0;var _0x3dd1c7=_0x1be6[_0x4be8d6];return _0x3dd1c7;};'use strict';var _=require(_0x61be('0x0'));var util=require(_0x61be('0x1'));var moment=require(_0x61be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61be('0x3'));var db=require(_0x61be('0x4'))['db'];var utils=require(_0x61be('0x5'));var logger=require(_0x61be('0x6'))(_0x61be('0x7'));var config=require(_0x61be('0x8'));var jayson=require(_0x61be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6989,_0x56cd89,_0xa1d512){return new BPromise(function(_0x586eff,_0x392d8e){return client[_0x61be('0xa')](_0x1e6989,_0xa1d512)['then'](function(_0x36da36){logger['info'](_0x61be('0xb'),_0x56cd89,_0x61be('0xc'));logger[_0x61be('0xd')](_0x61be('0xe'),_0x56cd89,_0x61be('0xc'),JSON['stringify'](_0x36da36));if(_0x36da36[_0x61be('0xf')]){if(_0x36da36['error'][_0x61be('0x10')]===0x1f4){logger[_0x61be('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x56cd89,_0x36da36[_0x61be('0xf')]['message']);return _0x392d8e(_0x36da36[_0x61be('0xf')][_0x61be('0x11')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x56cd89,_0x36da36[_0x61be('0xf')][_0x61be('0x11')]);return _0x586eff(_0x36da36['error']['message']);}else{logger[_0x61be('0x12')](_0x61be('0xb'),_0x56cd89,_0x61be('0xc'));_0x586eff(_0x36da36['result'][_0x61be('0x11')]);}})[_0x61be('0x13')](function(_0x1e5905){logger[_0x61be('0xf')](_0x61be('0xb'),_0x56cd89,_0x1e5905);_0x392d8e(_0x1e5905);});});} \ No newline at end of file +var _0x5027=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result'];(function(_0x4cb35e,_0x18538e){var _0x475505=function(_0x23a3f9){while(--_0x23a3f9){_0x4cb35e['push'](_0x4cb35e['shift']());}};_0x475505(++_0x18538e);}(_0x5027,0x69));var _0x7502=function(_0x353c7f,_0x1d2111){_0x353c7f=_0x353c7f-0x0;var _0x5074c1=_0x5027[_0x353c7f];return _0x5074c1;};'use strict';var _=require(_0x7502('0x0'));var util=require(_0x7502('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7502('0x2'));var fs=require('fs');var Redis=require(_0x7502('0x3'));var db=require(_0x7502('0x4'))['db'];var utils=require(_0x7502('0x5'));var logger=require(_0x7502('0x6'))('rpc');var config=require(_0x7502('0x7'));var jayson=require(_0x7502('0x8'));var client=jayson[_0x7502('0x9')][_0x7502('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286427,_0x50f079,_0x3e3e1c){return new BPromise(function(_0x3e37d4,_0x3e9055){return client['request'](_0x286427,_0x3e3e1c)[_0x7502('0xb')](function(_0x245844){logger[_0x7502('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x50f079,_0x7502('0xd'));logger[_0x7502('0xe')](_0x7502('0xf'),_0x50f079,_0x7502('0xd'),JSON['stringify'](_0x245844));if(_0x245844['error']){if(_0x245844['error'][_0x7502('0x10')]===0x1f4){logger[_0x7502('0x11')](_0x7502('0x12'),_0x50f079,_0x245844[_0x7502('0x11')][_0x7502('0x13')]);return _0x3e9055(_0x245844[_0x7502('0x11')][_0x7502('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x50f079,_0x245844[_0x7502('0x11')][_0x7502('0x13')]);return _0x3e37d4(_0x245844[_0x7502('0x11')][_0x7502('0x13')]);}else{logger[_0x7502('0xc')](_0x7502('0x12'),_0x50f079,_0x7502('0xd'));_0x3e37d4(_0x245844[_0x7502('0x14')]['message']);}})['catch'](function(_0x462d1c){logger[_0x7502('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x50f079,_0x462d1c);_0x3e9055(_0x462d1c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4432646..dd4b437 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 _0xed24=['show','create','put','delete','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x3378e9,_0x224437){var _0x2e2a08=function(_0x2065c9){while(--_0x2065c9){_0x3378e9['push'](_0x3378e9['shift']());}};_0x2e2a08(++_0x224437);}(_0xed24,0x1d6));var _0x4ed2=function(_0x2804b1,_0x30a18c){_0x2804b1=_0x2804b1-0x0;var _0x296240=_0xed24[_0x2804b1];return _0x296240;};'use strict';var multer=require(_0x4ed2('0x0'));var util=require(_0x4ed2('0x1'));var path=require(_0x4ed2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ed2('0x3'));var interaction=require(_0x4ed2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ed2('0x5'));router[_0x4ed2('0x6')]('/',auth[_0x4ed2('0x7')](),controller[_0x4ed2('0x8')]);router['get'](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller[_0x4ed2('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4ed2('0xb')]);router[_0x4ed2('0xc')](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller['update']);router[_0x4ed2('0xd')](_0x4ed2('0x9'),auth[_0x4ed2('0x7')](),controller['destroy']);module[_0x4ed2('0xe')]=router; \ No newline at end of file +var _0xbe68=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','path'];(function(_0x2eab4c,_0x9763f5){var _0x2ede27=function(_0x27fd4d){while(--_0x27fd4d){_0x2eab4c['push'](_0x2eab4c['shift']());}};_0x2ede27(++_0x9763f5);}(_0xbe68,0x12e));var _0x8be6=function(_0x5b89d4,_0x3b5b3c){_0x5b89d4=_0x5b89d4-0x0;var _0x1baa2c=_0xbe68[_0x5b89d4];return _0x1baa2c;};'use strict';var multer=require(_0x8be6('0x0'));var util=require('util');var path=require(_0x8be6('0x1'));var timeout=require(_0x8be6('0x2'));var express=require(_0x8be6('0x3'));var router=express[_0x8be6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8be6('0x5'));var interaction=require(_0x8be6('0x6'));var config=require(_0x8be6('0x7'));var controller=require(_0x8be6('0x8'));router[_0x8be6('0x9')]('/',auth[_0x8be6('0xa')](),controller[_0x8be6('0xb')]);router['get'](_0x8be6('0xc'),auth[_0x8be6('0xa')](),controller[_0x8be6('0xd')]);router[_0x8be6('0xe')]('/',auth[_0x8be6('0xa')](),controller['create']);router['put'](_0x8be6('0xc'),auth[_0x8be6('0xa')](),controller[_0x8be6('0xf')]);router[_0x8be6('0x10')](_0x8be6('0xc'),auth['isAuthenticated'](),controller[_0x8be6('0x11')]);module[_0x8be6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 25b62a4..3b0dd94 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 _0xa3d0=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x3ef4c7,_0x3c8f24){var _0x4d358f=function(_0x352fb7){while(--_0x352fb7){_0x3ef4c7['push'](_0x3ef4c7['shift']());}};_0x4d358f(++_0x3c8f24);}(_0xa3d0,0x164));var _0x0a3d=function(_0x4f24ec,_0x552826){_0x4f24ec=_0x4f24ec-0x0;var _0x11926e=_0xa3d0[_0x4f24ec];return _0x11926e;};'use strict';var Sequelize=require('sequelize');module[_0x0a3d('0x0')]={'type':{'type':Sequelize[_0x0a3d('0x1')](_0x0a3d('0x2'),_0x0a3d('0x3'),_0x0a3d('0x4'),_0x0a3d('0x5'),_0x0a3d('0x6')),'defaultValue':_0x0a3d('0x2')},'content':{'type':Sequelize[_0x0a3d('0x7')]},'key':{'type':Sequelize[_0x0a3d('0x7')]},'keyType':{'type':Sequelize[_0x0a3d('0x1')](_0x0a3d('0x2'),'variable',_0x0a3d('0x4'))},'keyContent':{'type':Sequelize[_0x0a3d('0x7')]},'idField':{'type':Sequelize[_0x0a3d('0x7')]},'nameField':{'type':Sequelize[_0x0a3d('0x7')]},'customField':{'type':Sequelize[_0x0a3d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a3d('0x7')]}}; \ No newline at end of file +var _0x3238=['STRING','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3238,0x139));var _0x8323=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3238[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8323('0x0'));module[_0x8323('0x1')]={'type':{'type':Sequelize[_0x8323('0x2')](_0x8323('0x3'),_0x8323('0x4'),_0x8323('0x5'),'keyValue',_0x8323('0x6')),'defaultValue':_0x8323('0x3')},'content':{'type':Sequelize[_0x8323('0x7')]},'key':{'type':Sequelize[_0x8323('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8323('0x4'),_0x8323('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8323('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8323('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 0d58c18..cb0987e 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 _0xeb74=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x5c4573,_0x4f0e2a){var _0x3d1bba=function(_0xe988d1){while(--_0xe988d1){_0x5c4573['push'](_0x5c4573['shift']());}};_0x3d1bba(++_0x4f0e2a);}(_0xeb74,0xe3));var _0x4eb7=function(_0x415073,_0x25b09a){_0x415073=_0x415073-0x0;var _0x39dabf=_0xeb74[_0x415073];return _0x39dabf;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['FreshdeskField'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['FreshdeskField'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['FreshdeskField'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));}; \ No newline at end of file +var _0xb2b3=['update','then','error','stack','name','send','map','FreshdeskField','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xb2b3,0x71));var _0x3b2b=function(_0x2b3b1a,_0x281032){_0x2b3b1a=_0x2b3b1a-0x0;var _0x5313eb=_0xb2b3[_0x2b3b1a];return _0x5313eb;};'use strict';var emlformat=require(_0x3b2b('0x0'));var rimraf=require(_0x3b2b('0x1'));var zipdir=require(_0x3b2b('0x2'));var jsonpatch=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var moment=require(_0x3b2b('0x5'));var BPromise=require(_0x3b2b('0x6'));var Mustache=require('mustache');var util=require(_0x3b2b('0x7'));var path=require(_0x3b2b('0x8'));var sox=require(_0x3b2b('0x9'));var csv=require(_0x3b2b('0xa'));var ejs=require(_0x3b2b('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2b('0xc'));var _=require(_0x3b2b('0xd'));var squel=require(_0x3b2b('0xe'));var crypto=require(_0x3b2b('0xf'));var jsforce=require(_0x3b2b('0x10'));var deskjs=require(_0x3b2b('0x11'));var toCsv=require(_0x3b2b('0xa'));var querystring=require('querystring');var Papa=require(_0x3b2b('0x12'));var Redis=require(_0x3b2b('0x13'));var authService=require(_0x3b2b('0x14'));var qs=require(_0x3b2b('0x15'));var as=require(_0x3b2b('0x16'));var hardwareService=require(_0x3b2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3b2b('0x18'));var config=require(_0x3b2b('0x19'));var licenseUtil=require(_0x3b2b('0x1a'));var db=require(_0x3b2b('0x1b'))['db'];function respondWithStatusCode(_0x5a696c,_0x20a6ed){_0x20a6ed=_0x20a6ed||0xcc;return function(_0x20d753){if(_0x20d753){return _0x5a696c[_0x3b2b('0x1c')](_0x20a6ed);}return _0x5a696c[_0x3b2b('0x1d')](_0x20a6ed)[_0x3b2b('0x1e')]();};}function respondWithResult(_0x1d664c,_0x52b63f){_0x52b63f=_0x52b63f||0xc8;return function(_0x1dad6d){if(_0x1dad6d){return _0x1d664c[_0x3b2b('0x1d')](_0x52b63f)['json'](_0x1dad6d);}};}function respondWithFilteredResult(_0x3224ec,_0x2c186a){return function(_0x9f0aa){if(_0x9f0aa){var _0x5593e4=typeof _0x2c186a[_0x3b2b('0x1f')]==='undefined'&&typeof _0x2c186a[_0x3b2b('0x20')]===_0x3b2b('0x21');var _0x57a2b4=_0x9f0aa['count'];var _0x1a3bfb=_0x5593e4?0x0:_0x2c186a['offset'];var _0x157155=_0x5593e4?_0x9f0aa[_0x3b2b('0x22')]:_0x2c186a['offset']+_0x2c186a[_0x3b2b('0x20')];var _0x4ff5e3;if(_0x157155>=_0x57a2b4){_0x157155=_0x57a2b4;_0x4ff5e3=0xc8;}else{_0x4ff5e3=0xce;}_0x3224ec[_0x3b2b('0x1d')](_0x4ff5e3);return _0x3224ec[_0x3b2b('0x23')]('Content-Range',_0x1a3bfb+'-'+_0x157155+'/'+_0x57a2b4)['json'](_0x9f0aa);}return null;};}function patchUpdates(_0x1d786b){return function(_0x42ef4e){try{jsonpatch[_0x3b2b('0x24')](_0x42ef4e,_0x1d786b,!![]);}catch(_0x46db63){return BPromise[_0x3b2b('0x25')](_0x46db63);}return _0x42ef4e[_0x3b2b('0x26')]();};}function saveUpdates(_0x14a181,_0xc5b0bf){return function(_0x1273e7){if(_0x1273e7){return _0x1273e7[_0x3b2b('0x27')](_0x14a181)[_0x3b2b('0x28')](function(_0x4d5f70){return _0x4d5f70;});}return null;};}function removeEntity(_0x20c1bc,_0x35387c){return function(_0x252e36){if(_0x252e36){return _0x252e36['destroy']()[_0x3b2b('0x28')](function(){_0x20c1bc['status'](0xcc)[_0x3b2b('0x1e')]();});}};}function handleEntityNotFound(_0x50d2e5,_0x3ec4f0){return function(_0x5df93e){if(!_0x5df93e){_0x50d2e5['sendStatus'](0x194);}return _0x5df93e;};}function handleError(_0x399d72,_0x1aab2e){_0x1aab2e=_0x1aab2e||0x1f4;return function(_0x11313d){logger[_0x3b2b('0x29')](_0x11313d[_0x3b2b('0x2a')]);if(_0x11313d[_0x3b2b('0x2b')]){delete _0x11313d[_0x3b2b('0x2b')];}_0x399d72[_0x3b2b('0x1d')](_0x1aab2e)[_0x3b2b('0x2c')](_0x11313d);};}exports['index']=function(_0x4ed952,_0x4fc420){var _0x5ca78b={},_0x3e2177={},_0x2e4bc7={'count':0x0,'rows':[]};var _0x3a1ff8=_[_0x3b2b('0x2d')](db[_0x3b2b('0x2e')][_0x3b2b('0x2f')],function(_0x3acb5b){return{'name':_0x3acb5b['fieldName'],'type':_0x3acb5b[_0x3b2b('0x30')]['key']};});_0x3e2177['model']=_[_0x3b2b('0x2d')](_0x3a1ff8,_0x3b2b('0x2b'));_0x3e2177[_0x3b2b('0x31')]=_[_0x3b2b('0x32')](_0x4ed952['query']);_0x3e2177['filters']=_[_0x3b2b('0x33')](_0x3e2177[_0x3b2b('0x34')],_0x3e2177[_0x3b2b('0x31')]);_0x5ca78b[_0x3b2b('0x35')]=_[_0x3b2b('0x33')](_0x3e2177['model'],qs[_0x3b2b('0x36')](_0x4ed952['query'][_0x3b2b('0x36')]));_0x5ca78b[_0x3b2b('0x35')]=_0x5ca78b[_0x3b2b('0x35')][_0x3b2b('0x37')]?_0x5ca78b[_0x3b2b('0x35')]:_0x3e2177[_0x3b2b('0x34')];if(!_0x4ed952[_0x3b2b('0x31')][_0x3b2b('0x38')]('nolimit')){_0x5ca78b['limit']=qs[_0x3b2b('0x20')](_0x4ed952['query'][_0x3b2b('0x20')]);_0x5ca78b[_0x3b2b('0x1f')]=qs[_0x3b2b('0x1f')](_0x4ed952[_0x3b2b('0x31')][_0x3b2b('0x1f')]);}_0x5ca78b[_0x3b2b('0x39')]=qs[_0x3b2b('0x3a')](_0x4ed952[_0x3b2b('0x31')][_0x3b2b('0x3a')]);_0x5ca78b[_0x3b2b('0x3b')]=qs['filters'](_[_0x3b2b('0x3c')](_0x4ed952[_0x3b2b('0x31')],_0x3e2177[_0x3b2b('0x3d')]),_0x3a1ff8);if(_0x4ed952[_0x3b2b('0x31')][_0x3b2b('0x3e')]){_0x5ca78b[_0x3b2b('0x3b')]=_[_0x3b2b('0x3f')](_0x5ca78b[_0x3b2b('0x3b')],{'$or':_[_0x3b2b('0x2d')](_0x3a1ff8,function(_0x1ef97b){if(_0x1ef97b[_0x3b2b('0x30')]!==_0x3b2b('0x40')){var _0x8adb5f={};_0x8adb5f[_0x1ef97b[_0x3b2b('0x2b')]]={'$like':'%'+_0x4ed952['query'][_0x3b2b('0x3e')]+'%'};return _0x8adb5f;}})});}_0x5ca78b=_[_0x3b2b('0x3f')]({},_0x5ca78b,_0x4ed952[_0x3b2b('0x41')]);var _0x27e415={'where':_0x5ca78b[_0x3b2b('0x3b')]};return db[_0x3b2b('0x2e')][_0x3b2b('0x22')](_0x27e415)['then'](function(_0x506067){_0x2e4bc7[_0x3b2b('0x22')]=_0x506067;if(_0x4ed952['query'][_0x3b2b('0x42')]){_0x5ca78b[_0x3b2b('0x43')]=[{'all':!![]}];}return db[_0x3b2b('0x2e')][_0x3b2b('0x44')](_0x5ca78b);})[_0x3b2b('0x28')](function(_0x282a94){_0x2e4bc7[_0x3b2b('0x45')]=_0x282a94;return _0x2e4bc7;})[_0x3b2b('0x28')](respondWithFilteredResult(_0x4fc420,_0x5ca78b))['catch'](handleError(_0x4fc420,null));};exports['show']=function(_0x538802,_0x381e38){var _0x3dd5c8={'raw':!![],'where':{'id':_0x538802[_0x3b2b('0x46')]['id']}},_0x3d3ccd={};_0x3d3ccd[_0x3b2b('0x34')]=_[_0x3b2b('0x32')](db['FreshdeskField'][_0x3b2b('0x2f')]);_0x3d3ccd['query']=_[_0x3b2b('0x32')](_0x538802[_0x3b2b('0x31')]);_0x3d3ccd[_0x3b2b('0x3d')]=_[_0x3b2b('0x33')](_0x3d3ccd[_0x3b2b('0x34')],_0x3d3ccd['query']);_0x3dd5c8[_0x3b2b('0x35')]=_['intersection'](_0x3d3ccd[_0x3b2b('0x34')],qs['fields'](_0x538802[_0x3b2b('0x31')][_0x3b2b('0x36')]));_0x3dd5c8[_0x3b2b('0x35')]=_0x3dd5c8[_0x3b2b('0x35')]['length']?_0x3dd5c8['attributes']:_0x3d3ccd[_0x3b2b('0x34')];if(_0x538802['query'][_0x3b2b('0x42')]){_0x3dd5c8[_0x3b2b('0x43')]=[{'all':!![]}];}_0x3dd5c8=_['merge']({},_0x3dd5c8,_0x538802[_0x3b2b('0x41')]);return db['FreshdeskField'][_0x3b2b('0x47')](_0x3dd5c8)[_0x3b2b('0x28')](handleEntityNotFound(_0x381e38,null))[_0x3b2b('0x28')](respondWithResult(_0x381e38,null))[_0x3b2b('0x48')](handleError(_0x381e38,null));};exports[_0x3b2b('0x49')]=function(_0x57bfda,_0x533b74){return db[_0x3b2b('0x2e')][_0x3b2b('0x49')](_0x57bfda['body'],{})[_0x3b2b('0x28')](respondWithResult(_0x533b74,0xc9))[_0x3b2b('0x48')](handleError(_0x533b74,null));};exports[_0x3b2b('0x27')]=function(_0x25a6d1,_0x468253){if(_0x25a6d1[_0x3b2b('0x4a')]['id']){delete _0x25a6d1[_0x3b2b('0x4a')]['id'];}return db[_0x3b2b('0x2e')][_0x3b2b('0x47')]({'where':{'id':_0x25a6d1[_0x3b2b('0x46')]['id']}})[_0x3b2b('0x28')](handleEntityNotFound(_0x468253,null))[_0x3b2b('0x28')](saveUpdates(_0x25a6d1[_0x3b2b('0x4a')],null))['then'](respondWithResult(_0x468253,null))[_0x3b2b('0x48')](handleError(_0x468253,null));};exports[_0x3b2b('0x4b')]=function(_0x4c46db,_0xc6d4c7){return db[_0x3b2b('0x2e')][_0x3b2b('0x47')]({'where':{'id':_0x4c46db[_0x3b2b('0x46')]['id']}})['then'](handleEntityNotFound(_0xc6d4c7,null))[_0x3b2b('0x28')](removeEntity(_0xc6d4c7,null))[_0x3b2b('0x48')](handleError(_0xc6d4c7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1e3d84d..f53a343 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 _0x43d3=['bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x3cfe70,_0x2465d5){var _0x2f0890=function(_0x2fa927){while(--_0x2fa927){_0x3cfe70['push'](_0x3cfe70['shift']());}};_0x2f0890(++_0x2465d5);}(_0x43d3,0x182));var _0x343d=function(_0x4e8a8e,_0x40d7c3){_0x4e8a8e=_0x4e8a8e-0x0;var _0xea8fe5=_0x43d3[_0x4e8a8e];return _0xea8fe5;};'use strict';var _=require('lodash');var util=require(_0x343d('0x0'));var logger=require(_0x343d('0x1'))(_0x343d('0x2'));var moment=require(_0x343d('0x3'));var BPromise=require(_0x343d('0x4'));var rp=require(_0x343d('0x5'));var fs=require('fs');var path=require(_0x343d('0x6'));var rimraf=require(_0x343d('0x7'));var config=require('../../config/environment');var attributes=require(_0x343d('0x8'));module['exports']=function(_0x117216,_0x3aa08a){return _0x117216[_0x343d('0x9')](_0x343d('0xa'),attributes,{'tableName':_0x343d('0xb'),'paranoid':![],'indexes':[{'name':_0x343d('0xc'),'fields':[_0x343d('0xd'),_0x343d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f63=['freshdesk_unique_index','lodash','util','api','moment','bluebird','path','rimraf','exports','FreshdeskField','int_freshdesk_fields'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x1f63,0x7a));var _0x31f6=function(_0x4f175e,_0xfd7a24){_0x4f175e=_0x4f175e-0x0;var _0x27ef52=_0x1f63[_0x4f175e];return _0x27ef52;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var logger=require('../../config/logger')(_0x31f6('0x2'));var moment=require(_0x31f6('0x3'));var BPromise=require(_0x31f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31f6('0x5'));var rimraf=require(_0x31f6('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x31f6('0x7')]=function(_0x11250b,_0xe8437e){return _0x11250b['define'](_0x31f6('0x8'),attributes,{'tableName':_0x31f6('0x9'),'paranoid':![],'indexes':[{'name':_0x31f6('0xa'),'fields':['idField','FieldId'],'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 20b9ae3..4bcc8bf 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 _0x3d5a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0xcad84b,_0x3e75f3){var _0x17c611=function(_0x5773b8){while(--_0x5773b8){_0xcad84b['push'](_0xcad84b['shift']());}};_0x17c611(++_0x3e75f3);}(_0x3d5a,0x19f));var _0xa3d5=function(_0x3bf04a,_0x56ed90){_0x3bf04a=_0x3bf04a-0x0;var _0x241e4b=_0x3d5a[_0x3bf04a];return _0x241e4b;};'use strict';var _=require(_0xa3d5('0x0'));var util=require(_0xa3d5('0x1'));var moment=require('moment');var BPromise=require(_0xa3d5('0x2'));var rs=require(_0xa3d5('0x3'));var fs=require('fs');var Redis=require(_0xa3d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3d5('0x5'));var logger=require(_0xa3d5('0x6'))(_0xa3d5('0x7'));var config=require(_0xa3d5('0x8'));var jayson=require(_0xa3d5('0x9'));var client=jayson['client'][_0xa3d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd80a76,_0x57e010,_0x30ebc3){return new BPromise(function(_0x1654d3,_0x475a3e){return client[_0xa3d5('0xb')](_0xd80a76,_0x30ebc3)['then'](function(_0x357a15){logger['info'](_0xa3d5('0xc'),_0x57e010,_0xa3d5('0xd'));logger['debug'](_0xa3d5('0xe'),_0x57e010,_0xa3d5('0xd'),JSON[_0xa3d5('0xf')](_0x357a15));if(_0x357a15[_0xa3d5('0x10')]){if(_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x11')]===0x1f4){logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x357a15['error'][_0xa3d5('0x12')]);return _0x475a3e(_0x357a15[_0xa3d5('0x10')]['message']);}logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x12')]);return _0x1654d3(_0x357a15[_0xa3d5('0x10')][_0xa3d5('0x12')]);}else{logger[_0xa3d5('0x13')](_0xa3d5('0xc'),_0x57e010,'request\x20sent');_0x1654d3(_0x357a15[_0xa3d5('0x14')][_0xa3d5('0x12')]);}})[_0xa3d5('0x15')](function(_0x1362de){logger[_0xa3d5('0x10')](_0xa3d5('0xc'),_0x57e010,_0x1362de);_0x475a3e(_0x1362de);});});} \ No newline at end of file +var _0xb65f=['client','then','info','request\x20sent','debug','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0xb65f,0x1c3));var _0xfb65=function(_0x4aedc0,_0x7c4299){_0x4aedc0=_0x4aedc0-0x0;var _0x16dd9d=_0xb65f[_0x4aedc0];return _0x16dd9d;};'use strict';var _=require(_0xfb65('0x0'));var util=require('util');var moment=require(_0xfb65('0x1'));var BPromise=require(_0xfb65('0x2'));var rs=require(_0xfb65('0x3'));var fs=require('fs');var Redis=require(_0xfb65('0x4'));var db=require(_0xfb65('0x5'))['db'];var utils=require(_0xfb65('0x6'));var logger=require(_0xfb65('0x7'))(_0xfb65('0x8'));var config=require(_0xfb65('0x9'));var jayson=require(_0xfb65('0xa'));var client=jayson[_0xfb65('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2b69,_0x3de761,_0x343fa2){return new BPromise(function(_0x54ab3e,_0x112879){return client['request'](_0x1a2b69,_0x343fa2)[_0xfb65('0xc')](function(_0x3032de){logger[_0xfb65('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x3de761,_0xfb65('0xe'));logger[_0xfb65('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3de761,_0xfb65('0xe'),JSON[_0xfb65('0x10')](_0x3032de));if(_0x3032de[_0xfb65('0x11')]){if(_0x3032de[_0xfb65('0x11')]['code']===0x1f4){logger['error'](_0xfb65('0x12'),_0x3de761,_0x3032de[_0xfb65('0x11')][_0xfb65('0x13')]);return _0x112879(_0x3032de[_0xfb65('0x11')][_0xfb65('0x13')]);}logger['error'](_0xfb65('0x12'),_0x3de761,_0x3032de[_0xfb65('0x11')][_0xfb65('0x13')]);return _0x54ab3e(_0x3032de[_0xfb65('0x11')][_0xfb65('0x13')]);}else{logger[_0xfb65('0xd')](_0xfb65('0x12'),_0x3de761,_0xfb65('0xe'));_0x54ab3e(_0x3032de[_0xfb65('0x14')]['message']);}})[_0xfb65('0x15')](function(_0x23ed1a){logger[_0xfb65('0x11')](_0xfb65('0x12'),_0x3de761,_0x23ed1a);_0x112879(_0x23ed1a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 9ec9029..2e52917 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 _0xe205=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe205,0xa7));var _0x5e20=function(_0x483c6f,_0x35aa0c){_0x483c6f=_0x483c6f-0x0;var _0x365b8c=_0xe205[_0x483c6f];return _0x365b8c;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xb')](),controller['show']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['getConfigurations']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0x10')]);router[_0x5e20('0x11')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x12')]);router['put'](_0x5e20('0x13'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x14')]);router['delete'](_0x5e20('0x13'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);module['exports']=router; \ No newline at end of file +var _0x36ee=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x13920b,_0x3b382d){var _0x53caaf=function(_0xb12bb1){while(--_0xb12bb1){_0x13920b['push'](_0x13920b['shift']());}};_0x53caaf(++_0x3b382d);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x11')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x11')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x13')]);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router[_0xe36e('0x15')]('/:id',auth[_0xe36e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f594ae7..cadc79f 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0xddda8a,_0x18e398){var _0x1fcb3d=function(_0x71251){while(--_0x71251){_0xddda8a['push'](_0xddda8a['shift']());}};_0x1fcb3d(++_0x18e398);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x383ef3,_0x26b75f){_0x383ef3=_0x383ef3-0x0;var _0x2c3fdb=_0x4e2e[_0x383ef3];return _0x2c3fdb;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x30990e,_0xfedf8b){var _0x22dd79=function(_0x1537a0){while(--_0x1537a0){_0x30990e['push'](_0x30990e['shift']());}};_0x22dd79(++_0xfedf8b);}(_0xd824,0xc2));var _0x4d82=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd824[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 125ac4c..3f5d6e9 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 _0x9fe8=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','catch','create','body','update','destroy','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model'];(function(_0x131de3,_0xe50190){var _0x4a189e=function(_0x56f287){while(--_0x56f287){_0x131de3['push'](_0x131de3['shift']());}};_0x4a189e(++_0xe50190);}(_0x9fe8,0xfd));var _0x89fe=function(_0x57b707,_0x1b5d3c){_0x57b707=_0x57b707-0x0;var _0x15d0d4=_0x9fe8[_0x57b707];return _0x15d0d4;};'use strict';var emlformat=require(_0x89fe('0x0'));var rimraf=require(_0x89fe('0x1'));var zipdir=require(_0x89fe('0x2'));var jsonpatch=require(_0x89fe('0x3'));var rp=require(_0x89fe('0x4'));var moment=require(_0x89fe('0x5'));var BPromise=require(_0x89fe('0x6'));var Mustache=require(_0x89fe('0x7'));var util=require(_0x89fe('0x8'));var path=require('path');var sox=require(_0x89fe('0x9'));var csv=require(_0x89fe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89fe('0xb'));var squel=require('squel');var crypto=require(_0x89fe('0xc'));var jsforce=require(_0x89fe('0xd'));var deskjs=require(_0x89fe('0xe'));var toCsv=require(_0x89fe('0xa'));var querystring=require('querystring');var Papa=require(_0x89fe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89fe('0x10'));var as=require(_0x89fe('0x11'));var hardwareService=require(_0x89fe('0x12'));var logger=require(_0x89fe('0x13'))(_0x89fe('0x14'));var utils=require(_0x89fe('0x15'));var config=require(_0x89fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4d1ea5,_0x2971af){_0x2971af=_0x2971af||0xcc;return function(_0x387df4){if(_0x387df4){return _0x4d1ea5[_0x89fe('0x17')](_0x2971af);}return _0x4d1ea5[_0x89fe('0x18')](_0x2971af)[_0x89fe('0x19')]();};}function respondWithResult(_0xb80e16,_0x411368){_0x411368=_0x411368||0xc8;return function(_0x3829ba){if(_0x3829ba){return _0xb80e16['status'](_0x411368)[_0x89fe('0x1a')](_0x3829ba);}};}function respondWithFilteredResult(_0x535a05,_0x577e51){return function(_0x56b4b7){if(_0x56b4b7){var _0x52d771=typeof _0x577e51['offset']==='undefined'&&typeof _0x577e51[_0x89fe('0x1b')]===_0x89fe('0x1c');var _0x5b9067=_0x56b4b7[_0x89fe('0x1d')];var _0x13a62d=_0x52d771?0x0:_0x577e51[_0x89fe('0x1e')];var _0xc00f43=_0x52d771?_0x56b4b7[_0x89fe('0x1d')]:_0x577e51[_0x89fe('0x1e')]+_0x577e51[_0x89fe('0x1b')];var _0x76da7f;if(_0xc00f43>=_0x5b9067){_0xc00f43=_0x5b9067;_0x76da7f=0xc8;}else{_0x76da7f=0xce;}_0x535a05[_0x89fe('0x18')](_0x76da7f);return _0x535a05[_0x89fe('0x1f')](_0x89fe('0x20'),_0x13a62d+'-'+_0xc00f43+'/'+_0x5b9067)[_0x89fe('0x1a')](_0x56b4b7);}return null;};}function patchUpdates(_0x2667b2){return function(_0x3b4a8e){try{jsonpatch[_0x89fe('0x21')](_0x3b4a8e,_0x2667b2,!![]);}catch(_0x21d586){return BPromise['reject'](_0x21d586);}return _0x3b4a8e[_0x89fe('0x22')]();};}function saveUpdates(_0x13a0ed,_0x3f2d3f){return function(_0x3e4aa1){if(_0x3e4aa1){return _0x3e4aa1['update'](_0x13a0ed)[_0x89fe('0x23')](function(_0x4fa184){return _0x4fa184;});}return null;};}function removeEntity(_0x36973c,_0x375c0a){return function(_0x152bf1){if(_0x152bf1){return _0x152bf1['destroy']()[_0x89fe('0x23')](function(){_0x36973c[_0x89fe('0x18')](0xcc)[_0x89fe('0x19')]();});}};}function handleEntityNotFound(_0x393de9,_0x5557a9){return function(_0x31f5af){if(!_0x31f5af){_0x393de9['sendStatus'](0x194);}return _0x31f5af;};}function handleError(_0x3a658c,_0xcfcf3c){_0xcfcf3c=_0xcfcf3c||0x1f4;return function(_0x4f2321){logger['error'](_0x4f2321[_0x89fe('0x24')]);if(_0x4f2321[_0x89fe('0x25')]){delete _0x4f2321['name'];}_0x3a658c[_0x89fe('0x18')](_0xcfcf3c)[_0x89fe('0x26')](_0x4f2321);};}exports[_0x89fe('0x27')]=function(_0x2c07c3,_0x2c9c68){var _0x3ffd80={},_0x2e278b={},_0x11466b={'count':0x0,'rows':[]};var _0x33b0a8=_[_0x89fe('0x28')](db[_0x89fe('0x29')][_0x89fe('0x2a')],function(_0x5435f8){return{'name':_0x5435f8[_0x89fe('0x2b')],'type':_0x5435f8[_0x89fe('0x2c')][_0x89fe('0x2d')]};});_0x2e278b[_0x89fe('0x2e')]=_[_0x89fe('0x28')](_0x33b0a8,_0x89fe('0x25'));_0x2e278b[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x2c07c3['query']);_0x2e278b[_0x89fe('0x31')]=_[_0x89fe('0x32')](_0x2e278b[_0x89fe('0x2e')],_0x2e278b[_0x89fe('0x2f')]);_0x3ffd80[_0x89fe('0x33')]=_[_0x89fe('0x32')](_0x2e278b[_0x89fe('0x2e')],qs[_0x89fe('0x34')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x3ffd80[_0x89fe('0x33')]=_0x3ffd80['attributes'][_0x89fe('0x35')]?_0x3ffd80[_0x89fe('0x33')]:_0x2e278b[_0x89fe('0x2e')];if(!_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x36')]('nolimit')){_0x3ffd80[_0x89fe('0x1b')]=qs[_0x89fe('0x1b')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x1b')]);_0x3ffd80[_0x89fe('0x1e')]=qs[_0x89fe('0x1e')](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x1e')]);}_0x3ffd80['order']=qs['sort'](_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x37')]);_0x3ffd80[_0x89fe('0x38')]=qs[_0x89fe('0x31')](_[_0x89fe('0x39')](_0x2c07c3[_0x89fe('0x2f')],_0x2e278b[_0x89fe('0x31')]),_0x33b0a8);if(_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3a')]){_0x3ffd80[_0x89fe('0x38')]=_[_0x89fe('0x3b')](_0x3ffd80[_0x89fe('0x38')],{'$or':_[_0x89fe('0x28')](_0x33b0a8,function(_0x5b2879){if(_0x5b2879['type']!==_0x89fe('0x3c')){var _0x34a96b={};_0x34a96b[_0x5b2879[_0x89fe('0x25')]]={'$like':'%'+_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3a')]+'%'};return _0x34a96b;}})});}_0x3ffd80=_[_0x89fe('0x3b')]({},_0x3ffd80,_0x2c07c3[_0x89fe('0x3d')]);var _0x2fb5f3={'where':_0x3ffd80['where']};return db[_0x89fe('0x29')]['count'](_0x2fb5f3)['then'](function(_0x114211){_0x11466b[_0x89fe('0x1d')]=_0x114211;if(_0x2c07c3[_0x89fe('0x2f')][_0x89fe('0x3e')]){_0x3ffd80[_0x89fe('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x3ffd80);})[_0x89fe('0x23')](function(_0x3b41ff){_0x11466b['rows']=_0x3b41ff;return _0x11466b;})[_0x89fe('0x23')](respondWithFilteredResult(_0x2c9c68,_0x3ffd80))['catch'](handleError(_0x2c9c68,null));};exports[_0x89fe('0x40')]=function(_0x46a0c3,_0x1ad0b8){var _0x422002={'raw':![],'where':{'id':_0x46a0c3[_0x89fe('0x41')]['id']}},_0x39079d={};_0x39079d[_0x89fe('0x2e')]=_[_0x89fe('0x30')](db[_0x89fe('0x29')][_0x89fe('0x2a')]);_0x39079d[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x46a0c3[_0x89fe('0x2f')]);_0x39079d['filters']=_['intersection'](_0x39079d[_0x89fe('0x2e')],_0x39079d[_0x89fe('0x2f')]);_0x422002['attributes']=_[_0x89fe('0x32')](_0x39079d['model'],qs[_0x89fe('0x34')](_0x46a0c3[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x422002[_0x89fe('0x33')]=_0x422002[_0x89fe('0x33')][_0x89fe('0x35')]?_0x422002[_0x89fe('0x33')]:_0x39079d[_0x89fe('0x2e')];if(_0x46a0c3['query']['includeAll']){_0x422002['include']=[{'all':!![]}];}_0x422002=_[_0x89fe('0x3b')]({},_0x422002,_0x46a0c3[_0x89fe('0x3d')]);return db[_0x89fe('0x29')][_0x89fe('0x42')](_0x422002)[_0x89fe('0x23')](handleEntityNotFound(_0x1ad0b8,null))[_0x89fe('0x23')](respondWithResult(_0x1ad0b8,null))[_0x89fe('0x43')](handleError(_0x1ad0b8,null));};exports[_0x89fe('0x44')]=function(_0x544dd6,_0x1451cf){return db['FreshsalesAccount'][_0x89fe('0x44')](_0x544dd6[_0x89fe('0x45')],{})['then'](respondWithResult(_0x1451cf,0xc9))[_0x89fe('0x43')](handleError(_0x1451cf,null));};exports[_0x89fe('0x46')]=function(_0x234e85,_0x44627e){if(_0x234e85['body']['id']){delete _0x234e85[_0x89fe('0x45')]['id'];}return db[_0x89fe('0x29')][_0x89fe('0x42')]({'where':{'id':_0x234e85[_0x89fe('0x41')]['id']}})['then'](handleEntityNotFound(_0x44627e,null))[_0x89fe('0x23')](saveUpdates(_0x234e85[_0x89fe('0x45')],null))[_0x89fe('0x23')](respondWithResult(_0x44627e,null))['catch'](handleError(_0x44627e,null));};exports[_0x89fe('0x47')]=function(_0x38d6e4,_0x58267e){return db[_0x89fe('0x29')][_0x89fe('0x42')]({'where':{'id':_0x38d6e4[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x58267e,null))[_0x89fe('0x23')](removeEntity(_0x58267e,null))[_0x89fe('0x43')](handleError(_0x58267e,null));};exports[_0x89fe('0x48')]=function(_0x416b6a,_0x57e2f3,_0xc6883e){var _0x126151={};var _0x268aed={};var _0x21edd1;var _0x1306c5;return db[_0x89fe('0x29')][_0x89fe('0x49')]({'where':{'id':_0x416b6a[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x57e2f3,null))['then'](function(_0x5c216f){if(_0x5c216f){_0x21edd1=_0x5c216f;_0x268aed['model']=_['keys'](db['FreshsalesConfiguration'][_0x89fe('0x2a')]);_0x268aed[_0x89fe('0x2f')]=_[_0x89fe('0x30')](_0x416b6a[_0x89fe('0x2f')]);_0x268aed[_0x89fe('0x31')]=_[_0x89fe('0x32')](_0x268aed[_0x89fe('0x2e')],_0x268aed[_0x89fe('0x2f')]);_0x126151[_0x89fe('0x33')]=_[_0x89fe('0x32')](_0x268aed[_0x89fe('0x2e')],qs[_0x89fe('0x34')](_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x34')]));_0x126151[_0x89fe('0x33')]=_0x126151[_0x89fe('0x33')][_0x89fe('0x35')]?_0x126151[_0x89fe('0x33')]:_0x268aed[_0x89fe('0x2e')];_0x126151['order']=qs[_0x89fe('0x37')](_0x416b6a['query'][_0x89fe('0x37')]);_0x126151[_0x89fe('0x38')]=qs['filters'](_['pick'](_0x416b6a[_0x89fe('0x2f')],_0x268aed[_0x89fe('0x31')]));if(_0x416b6a['query'][_0x89fe('0x3a')]){_0x126151[_0x89fe('0x38')]=_[_0x89fe('0x3b')](_0x126151['where'],{'$or':_[_0x89fe('0x28')](_0x126151[_0x89fe('0x33')],function(_0x5aaefc){var _0x406164={};_0x406164[_0x5aaefc]={'$like':'%'+_0x416b6a[_0x89fe('0x2f')]['filter']+'%'};return _0x406164;})});}_0x126151=_['merge']({},_0x126151,_0x416b6a[_0x89fe('0x3d')]);return _0x21edd1['getConfigurations'](_0x126151);}})['then'](function(_0x3aa88f){if(_0x3aa88f){_0x1306c5=_0x3aa88f[_0x89fe('0x35')];if(!_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x36')](_0x89fe('0x4a'))){_0x126151[_0x89fe('0x1b')]=qs[_0x89fe('0x1b')](_0x416b6a[_0x89fe('0x2f')][_0x89fe('0x1b')]);_0x126151[_0x89fe('0x1e')]=qs[_0x89fe('0x1e')](_0x416b6a['query'][_0x89fe('0x1e')]);}return _0x21edd1[_0x89fe('0x48')](_0x126151);}})[_0x89fe('0x23')](function(_0x1cb416){if(_0x1cb416){return _0x1cb416?{'count':_0x1306c5,'rows':_0x1cb416}:null;}})[_0x89fe('0x23')](respondWithResult(_0x57e2f3,null))[_0x89fe('0x43')](handleError(_0x57e2f3,null));};exports[_0x89fe('0x4b')]=function(_0x4d7810,_0x128e00,_0x16bf5b){if(_0x4d7810[_0x89fe('0x45')]['id']){delete _0x4d7810['body']['id'];}return db[_0x89fe('0x29')]['findOne']({'where':{'id':_0x4d7810[_0x89fe('0x41')]['id']}})[_0x89fe('0x23')](handleEntityNotFound(_0x128e00,null))[_0x89fe('0x23')](function(_0x30b7e2){if(_0x30b7e2){_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4c')]=_0x30b7e2['id'];_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4d')]=integrations[_0x89fe('0x4e')](_0x4d7810[_0x89fe('0x45')][_0x89fe('0x4f')],_0x4d7810['body']['type']);_0x4d7810[_0x89fe('0x45')][_0x89fe('0x50')]=integrations[_0x89fe('0x51')](_0x4d7810['body'][_0x89fe('0x4f')],_0x4d7810[_0x89fe('0x45')][_0x89fe('0x2c')]);return db[_0x89fe('0x52')][_0x89fe('0x44')](_0x4d7810[_0x89fe('0x45')],{'include':[{'model':db[_0x89fe('0x53')],'as':_0x89fe('0x4d')},{'model':db[_0x89fe('0x53')],'as':_0x89fe('0x50')}]});}return null;})['then'](respondWithResult(_0x128e00,null))['catch'](handleError(_0x128e00,null));};exports[_0x89fe('0x54')]=function(_0x4294a5,_0x458691,_0x4ac815){var _0x58d50f='';var _0xfa6251='';return db[_0x89fe('0x29')][_0x89fe('0x49')]({'where':{'id':_0x4294a5[_0x89fe('0x41')]['id']},'attributes':['id',_0x89fe('0x55'),_0x89fe('0x56'),_0x89fe('0x57')]})[_0x89fe('0x23')](handleEntityNotFound(_0x458691,null))['then'](function(_0x3f53e3){if(_0x3f53e3){_0xfa6251=_0x3f53e3[_0x89fe('0x55')];_0x58d50f=_0x3f53e3['remoteUri'];var _0x920d49=_0x3f53e3[_0x89fe('0x56')][_0x89fe('0x58')](-0x1);if(_0x920d49==='/'){_0x58d50f=_0x58d50f['substring'](0x0,_0x58d50f[_0x89fe('0x59')](_0x920d49));}return rp({'method':'GET','uri':util[_0x89fe('0x5a')]('%s%s',_0x58d50f,_0x89fe('0x5b')),'headers':{'Authorization':_0x89fe('0x5c')+_0x3f53e3[_0x89fe('0x57')]},'json':!![]});}})[_0x89fe('0x23')](function(_0x5edc65){if(_0x5edc65){var _0x50c940=_0x5edc65[_0x89fe('0x5d')];var _0x55f87f=![];var _0x29e972=null;for(_0x29e972=0x0;_0x29e972<_0x50c940[_0x89fe('0x35')];_0x29e972++){if(_0x50c940[_0x29e972][_0x89fe('0x5e')]===_0xfa6251){_0x55f87f=!![];}}if(_0x55f87f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x89fe('0x5f')});}}})[_0x89fe('0x23')](respondWithResult(_0x458691,null))[_0x89fe('0x43')](function(_0xa40a85){var _0x3ff105=_0x4294a5[_0x89fe('0x2f')]['test']?0x1f4:_0xa40a85[_0x89fe('0x60')]||0x1f4;logger[_0x89fe('0x61')](_0x89fe('0x62'),_0x89fe('0x54'),_0x3ff105,JSON[_0x89fe('0x63')](_0xa40a85));delete _0xa40a85['name'];if(_0x3ff105===0x191){_0x3ff105=0x190;}_0x458691['status'](_0x3ff105)[_0x89fe('0x26')](_0x4294a5[_0x89fe('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xa40a85[_0x89fe('0x60')]}:_0xa40a85);});}; \ No newline at end of file +var _0xebcb=['sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','order','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0x32590c,_0x4dc6af){var _0xdb2d60=function(_0x380734){while(--_0x380734){_0x32590c['push'](_0x32590c['shift']());}};_0xdb2d60(++_0x4dc6af);}(_0xebcb,0xfd));var _0xbebc=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xebcb[_0x5027b1];return _0x4a46cf;};'use strict';var emlformat=require(_0xbebc('0x0'));var rimraf=require(_0xbebc('0x1'));var zipdir=require(_0xbebc('0x2'));var jsonpatch=require(_0xbebc('0x3'));var rp=require(_0xbebc('0x4'));var moment=require(_0xbebc('0x5'));var BPromise=require(_0xbebc('0x6'));var Mustache=require(_0xbebc('0x7'));var util=require('util');var path=require(_0xbebc('0x8'));var sox=require(_0xbebc('0x9'));var csv=require('to-csv');var ejs=require(_0xbebc('0xa'));var fs=require('fs');var fs_extra=require(_0xbebc('0xb'));var _=require(_0xbebc('0xc'));var squel=require(_0xbebc('0xd'));var crypto=require(_0xbebc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbebc('0xf'));var toCsv=require(_0xbebc('0x10'));var querystring=require('querystring');var Papa=require(_0xbebc('0x11'));var Redis=require(_0xbebc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbebc('0x13'));var as=require(_0xbebc('0x14'));var hardwareService=require(_0xbebc('0x15'));var logger=require(_0xbebc('0x16'))(_0xbebc('0x17'));var utils=require(_0xbebc('0x18'));var config=require(_0xbebc('0x19'));var licenseUtil=require(_0xbebc('0x1a'));var db=require(_0xbebc('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e8d5d,_0x1b8bc6){_0x1b8bc6=_0x1b8bc6||0xcc;return function(_0x4368f0){if(_0x4368f0){return _0x2e8d5d['sendStatus'](_0x1b8bc6);}return _0x2e8d5d['status'](_0x1b8bc6)[_0xbebc('0x1c')]();};}function respondWithResult(_0x429e7,_0x59833f){_0x59833f=_0x59833f||0xc8;return function(_0x2cfa64){if(_0x2cfa64){return _0x429e7[_0xbebc('0x1d')](_0x59833f)['json'](_0x2cfa64);}};}function respondWithFilteredResult(_0x71976b,_0x4f3e85){return function(_0x355aed){if(_0x355aed){var _0x2bfb7a=typeof _0x4f3e85[_0xbebc('0x1e')]===_0xbebc('0x1f')&&typeof _0x4f3e85[_0xbebc('0x20')]===_0xbebc('0x1f');var _0x25c50d=_0x355aed['count'];var _0x46a630=_0x2bfb7a?0x0:_0x4f3e85[_0xbebc('0x1e')];var _0x30310a=_0x2bfb7a?_0x355aed[_0xbebc('0x21')]:_0x4f3e85[_0xbebc('0x1e')]+_0x4f3e85[_0xbebc('0x20')];var _0x2257a3;if(_0x30310a>=_0x25c50d){_0x30310a=_0x25c50d;_0x2257a3=0xc8;}else{_0x2257a3=0xce;}_0x71976b[_0xbebc('0x1d')](_0x2257a3);return _0x71976b['set'](_0xbebc('0x22'),_0x46a630+'-'+_0x30310a+'/'+_0x25c50d)[_0xbebc('0x23')](_0x355aed);}return null;};}function patchUpdates(_0x464de9){return function(_0x383f3c){try{jsonpatch[_0xbebc('0x24')](_0x383f3c,_0x464de9,!![]);}catch(_0x5a8825){return BPromise['reject'](_0x5a8825);}return _0x383f3c['save']();};}function saveUpdates(_0x407d6a,_0x47a9f3){return function(_0x522e8b){if(_0x522e8b){return _0x522e8b[_0xbebc('0x25')](_0x407d6a)['then'](function(_0x47a879){return _0x47a879;});}return null;};}function removeEntity(_0x3525d1,_0xe19c30){return function(_0x5970d7){if(_0x5970d7){return _0x5970d7[_0xbebc('0x26')]()['then'](function(){_0x3525d1['status'](0xcc)[_0xbebc('0x1c')]();});}};}function handleEntityNotFound(_0x18cccf,_0x63ba16){return function(_0x19e844){if(!_0x19e844){_0x18cccf['sendStatus'](0x194);}return _0x19e844;};}function handleError(_0x346c8e,_0x4a3c22){_0x4a3c22=_0x4a3c22||0x1f4;return function(_0x3fae6c){logger[_0xbebc('0x27')](_0x3fae6c[_0xbebc('0x28')]);if(_0x3fae6c[_0xbebc('0x29')]){delete _0x3fae6c['name'];}_0x346c8e[_0xbebc('0x1d')](_0x4a3c22)[_0xbebc('0x2a')](_0x3fae6c);};}exports[_0xbebc('0x2b')]=function(_0x531fd3,_0x4f192b){var _0x9e5f8c={},_0xab72f9={},_0x29133d={'count':0x0,'rows':[]};var _0x5058=_[_0xbebc('0x2c')](db[_0xbebc('0x2d')]['rawAttributes'],function(_0x3164bc){return{'name':_0x3164bc[_0xbebc('0x2e')],'type':_0x3164bc[_0xbebc('0x2f')]['key']};});_0xab72f9[_0xbebc('0x30')]=_[_0xbebc('0x2c')](_0x5058,'name');_0xab72f9['query']=_['keys'](_0x531fd3[_0xbebc('0x31')]);_0xab72f9[_0xbebc('0x32')]=_[_0xbebc('0x33')](_0xab72f9[_0xbebc('0x30')],_0xab72f9[_0xbebc('0x31')]);_0x9e5f8c[_0xbebc('0x34')]=_[_0xbebc('0x33')](_0xab72f9[_0xbebc('0x30')],qs['fields'](_0x531fd3[_0xbebc('0x31')][_0xbebc('0x35')]));_0x9e5f8c['attributes']=_0x9e5f8c[_0xbebc('0x34')][_0xbebc('0x36')]?_0x9e5f8c[_0xbebc('0x34')]:_0xab72f9[_0xbebc('0x30')];if(!_0x531fd3[_0xbebc('0x31')]['hasOwnProperty'](_0xbebc('0x37'))){_0x9e5f8c[_0xbebc('0x20')]=qs[_0xbebc('0x20')](_0x531fd3[_0xbebc('0x31')][_0xbebc('0x20')]);_0x9e5f8c[_0xbebc('0x1e')]=qs[_0xbebc('0x1e')](_0x531fd3[_0xbebc('0x31')][_0xbebc('0x1e')]);}_0x9e5f8c['order']=qs[_0xbebc('0x38')](_0x531fd3[_0xbebc('0x31')][_0xbebc('0x38')]);_0x9e5f8c[_0xbebc('0x39')]=qs[_0xbebc('0x32')](_['pick'](_0x531fd3[_0xbebc('0x31')],_0xab72f9[_0xbebc('0x32')]),_0x5058);if(_0x531fd3['query'][_0xbebc('0x3a')]){_0x9e5f8c[_0xbebc('0x39')]=_[_0xbebc('0x3b')](_0x9e5f8c[_0xbebc('0x39')],{'$or':_[_0xbebc('0x2c')](_0x5058,function(_0x3a403d){if(_0x3a403d['type']!==_0xbebc('0x3c')){var _0x50696d={};_0x50696d[_0x3a403d[_0xbebc('0x29')]]={'$like':'%'+_0x531fd3[_0xbebc('0x31')][_0xbebc('0x3a')]+'%'};return _0x50696d;}})});}_0x9e5f8c=_[_0xbebc('0x3b')]({},_0x9e5f8c,_0x531fd3[_0xbebc('0x3d')]);var _0x1aeded={'where':_0x9e5f8c[_0xbebc('0x39')]};return db['FreshsalesAccount']['count'](_0x1aeded)[_0xbebc('0x3e')](function(_0x341e23){_0x29133d[_0xbebc('0x21')]=_0x341e23;if(_0x531fd3[_0xbebc('0x31')][_0xbebc('0x3f')]){_0x9e5f8c[_0xbebc('0x40')]=[{'all':!![]}];}return db[_0xbebc('0x2d')][_0xbebc('0x41')](_0x9e5f8c);})[_0xbebc('0x3e')](function(_0x27c62b){_0x29133d[_0xbebc('0x42')]=_0x27c62b;return _0x29133d;})[_0xbebc('0x3e')](respondWithFilteredResult(_0x4f192b,_0x9e5f8c))[_0xbebc('0x43')](handleError(_0x4f192b,null));};exports[_0xbebc('0x44')]=function(_0x3ee382,_0x43ce76){var _0x3eb3c3={'raw':![],'where':{'id':_0x3ee382[_0xbebc('0x45')]['id']}},_0x2f8165={};_0x2f8165[_0xbebc('0x30')]=_[_0xbebc('0x46')](db[_0xbebc('0x2d')][_0xbebc('0x47')]);_0x2f8165['query']=_['keys'](_0x3ee382['query']);_0x2f8165['filters']=_[_0xbebc('0x33')](_0x2f8165['model'],_0x2f8165[_0xbebc('0x31')]);_0x3eb3c3['attributes']=_[_0xbebc('0x33')](_0x2f8165[_0xbebc('0x30')],qs[_0xbebc('0x35')](_0x3ee382[_0xbebc('0x31')][_0xbebc('0x35')]));_0x3eb3c3[_0xbebc('0x34')]=_0x3eb3c3[_0xbebc('0x34')][_0xbebc('0x36')]?_0x3eb3c3[_0xbebc('0x34')]:_0x2f8165[_0xbebc('0x30')];if(_0x3ee382['query'][_0xbebc('0x3f')]){_0x3eb3c3[_0xbebc('0x40')]=[{'all':!![]}];}_0x3eb3c3=_['merge']({},_0x3eb3c3,_0x3ee382[_0xbebc('0x3d')]);return db[_0xbebc('0x2d')]['find'](_0x3eb3c3)[_0xbebc('0x3e')](handleEntityNotFound(_0x43ce76,null))[_0xbebc('0x3e')](respondWithResult(_0x43ce76,null))[_0xbebc('0x43')](handleError(_0x43ce76,null));};exports[_0xbebc('0x48')]=function(_0x3b28df,_0x410b5f){return db[_0xbebc('0x2d')][_0xbebc('0x48')](_0x3b28df[_0xbebc('0x49')],{})[_0xbebc('0x3e')](respondWithResult(_0x410b5f,0xc9))[_0xbebc('0x43')](handleError(_0x410b5f,null));};exports['update']=function(_0xe469f3,_0x26602a){if(_0xe469f3[_0xbebc('0x49')]['id']){delete _0xe469f3[_0xbebc('0x49')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0xe469f3[_0xbebc('0x45')]['id']}})['then'](handleEntityNotFound(_0x26602a,null))[_0xbebc('0x3e')](saveUpdates(_0xe469f3['body'],null))[_0xbebc('0x3e')](respondWithResult(_0x26602a,null))['catch'](handleError(_0x26602a,null));};exports['destroy']=function(_0x44f0ea,_0x147d24){return db[_0xbebc('0x2d')][_0xbebc('0x4a')]({'where':{'id':_0x44f0ea[_0xbebc('0x45')]['id']}})[_0xbebc('0x3e')](handleEntityNotFound(_0x147d24,null))[_0xbebc('0x3e')](removeEntity(_0x147d24,null))[_0xbebc('0x43')](handleError(_0x147d24,null));};exports[_0xbebc('0x4b')]=function(_0x38e92c,_0x37c564,_0x44d61b){var _0x1b1c64={};var _0x3cf4ae={};var _0x562d7e;var _0xb5f09e;return db['FreshsalesAccount'][_0xbebc('0x4c')]({'where':{'id':_0x38e92c['params']['id']}})[_0xbebc('0x3e')](handleEntityNotFound(_0x37c564,null))['then'](function(_0x5ef506){if(_0x5ef506){_0x562d7e=_0x5ef506;_0x3cf4ae['model']=_[_0xbebc('0x46')](db[_0xbebc('0x4d')][_0xbebc('0x47')]);_0x3cf4ae[_0xbebc('0x31')]=_[_0xbebc('0x46')](_0x38e92c[_0xbebc('0x31')]);_0x3cf4ae[_0xbebc('0x32')]=_[_0xbebc('0x33')](_0x3cf4ae['model'],_0x3cf4ae[_0xbebc('0x31')]);_0x1b1c64[_0xbebc('0x34')]=_[_0xbebc('0x33')](_0x3cf4ae[_0xbebc('0x30')],qs['fields'](_0x38e92c[_0xbebc('0x31')][_0xbebc('0x35')]));_0x1b1c64['attributes']=_0x1b1c64[_0xbebc('0x34')]['length']?_0x1b1c64['attributes']:_0x3cf4ae['model'];_0x1b1c64[_0xbebc('0x4e')]=qs[_0xbebc('0x38')](_0x38e92c[_0xbebc('0x31')][_0xbebc('0x38')]);_0x1b1c64[_0xbebc('0x39')]=qs['filters'](_[_0xbebc('0x4f')](_0x38e92c[_0xbebc('0x31')],_0x3cf4ae['filters']));if(_0x38e92c[_0xbebc('0x31')][_0xbebc('0x3a')]){_0x1b1c64['where']=_[_0xbebc('0x3b')](_0x1b1c64[_0xbebc('0x39')],{'$or':_['map'](_0x1b1c64[_0xbebc('0x34')],function(_0x5a0c15){var _0x5c9467={};_0x5c9467[_0x5a0c15]={'$like':'%'+_0x38e92c[_0xbebc('0x31')][_0xbebc('0x3a')]+'%'};return _0x5c9467;})});}_0x1b1c64=_['merge']({},_0x1b1c64,_0x38e92c[_0xbebc('0x3d')]);return _0x562d7e[_0xbebc('0x4b')](_0x1b1c64);}})[_0xbebc('0x3e')](function(_0x2fe491){if(_0x2fe491){_0xb5f09e=_0x2fe491['length'];if(!_0x38e92c[_0xbebc('0x31')][_0xbebc('0x50')](_0xbebc('0x37'))){_0x1b1c64[_0xbebc('0x20')]=qs[_0xbebc('0x20')](_0x38e92c[_0xbebc('0x31')][_0xbebc('0x20')]);_0x1b1c64['offset']=qs['offset'](_0x38e92c[_0xbebc('0x31')][_0xbebc('0x1e')]);}return _0x562d7e['getConfigurations'](_0x1b1c64);}})['then'](function(_0x1891fc){if(_0x1891fc){return _0x1891fc?{'count':_0xb5f09e,'rows':_0x1891fc}:null;}})[_0xbebc('0x3e')](respondWithResult(_0x37c564,null))['catch'](handleError(_0x37c564,null));};exports[_0xbebc('0x51')]=function(_0x49b87d,_0x25a925,_0x42c5fc){if(_0x49b87d['body']['id']){delete _0x49b87d['body']['id'];}return db[_0xbebc('0x2d')]['findOne']({'where':{'id':_0x49b87d[_0xbebc('0x45')]['id']}})['then'](handleEntityNotFound(_0x25a925,null))[_0xbebc('0x3e')](function(_0xb77391){if(_0xb77391){_0x49b87d['body']['AccountId']=_0xb77391['id'];_0x49b87d[_0xbebc('0x49')][_0xbebc('0x52')]=integrations[_0xbebc('0x53')](_0x49b87d[_0xbebc('0x49')][_0xbebc('0x54')],_0x49b87d[_0xbebc('0x49')][_0xbebc('0x2f')]);_0x49b87d['body'][_0xbebc('0x55')]=integrations[_0xbebc('0x56')](_0x49b87d[_0xbebc('0x49')][_0xbebc('0x54')],_0x49b87d['body']['type']);return db['FreshsalesConfiguration'][_0xbebc('0x48')](_0x49b87d['body'],{'include':[{'model':db[_0xbebc('0x57')],'as':_0xbebc('0x52')},{'model':db[_0xbebc('0x57')],'as':_0xbebc('0x55')}]});}return null;})['then'](respondWithResult(_0x25a925,null))[_0xbebc('0x43')](handleError(_0x25a925,null));};exports[_0xbebc('0x58')]=function(_0x58e1b0,_0x1f7c5d,_0x53e661){var _0x2bae9b='';var _0x476c9d='';return db[_0xbebc('0x2d')][_0xbebc('0x4c')]({'where':{'id':_0x58e1b0[_0xbebc('0x45')]['id']},'attributes':['id',_0xbebc('0x59'),'remoteUri',_0xbebc('0x5a')]})[_0xbebc('0x3e')](handleEntityNotFound(_0x1f7c5d,null))[_0xbebc('0x3e')](function(_0x3f128e){if(_0x3f128e){_0x476c9d=_0x3f128e[_0xbebc('0x59')];_0x2bae9b=_0x3f128e[_0xbebc('0x5b')];var _0x222369=_0x3f128e[_0xbebc('0x5b')][_0xbebc('0x5c')](-0x1);if(_0x222369==='/'){_0x2bae9b=_0x2bae9b[_0xbebc('0x5d')](0x0,_0x2bae9b['lastIndexOf'](_0x222369));}return rp({'method':'GET','uri':util[_0xbebc('0x5e')](_0xbebc('0x5f'),_0x2bae9b,_0xbebc('0x60')),'headers':{'Authorization':'Token\x20token='+_0x3f128e[_0xbebc('0x5a')]},'json':!![]});}})[_0xbebc('0x3e')](function(_0x347271){if(_0x347271){var _0x143d2c=_0x347271[_0xbebc('0x61')];var _0x391a5a=![];var _0x302c33=null;for(_0x302c33=0x0;_0x302c33<_0x143d2c['length'];_0x302c33++){if(_0x143d2c[_0x302c33][_0xbebc('0x62')]===_0x476c9d){_0x391a5a=!![];}}if(_0x391a5a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xbebc('0x63')});}}})[_0xbebc('0x3e')](respondWithResult(_0x1f7c5d,null))[_0xbebc('0x43')](function(_0x4dfea5){var _0x9e27da=_0x58e1b0[_0xbebc('0x31')][_0xbebc('0x64')]?0x1f4:_0x4dfea5['statusCode']||0x1f4;logger[_0xbebc('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xbebc('0x58'),_0x9e27da,JSON['stringify'](_0x4dfea5));delete _0x4dfea5[_0xbebc('0x29')];if(_0x9e27da===0x191){_0x9e27da=0x190;}_0x1f7c5d['status'](_0x9e27da)[_0xbebc('0x2a')](_0x58e1b0[_0xbebc('0x31')][_0xbebc('0x64')]?{'message':_0xbebc('0x65'),'statusCode':_0x4dfea5[_0xbebc('0x66')]}:_0x4dfea5);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2ca31ef..62283fd 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 _0x4975=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bcd6f,_0xa89d8){var _0x349319=function(_0x20a636){while(--_0x20a636){_0x1bcd6f['push'](_0x1bcd6f['shift']());}};_0x349319(++_0xa89d8);}(_0x4975,0x86));var _0x5497=function(_0x6c051,_0x4a3ea7){_0x6c051=_0x6c051-0x0;var _0x3b5e5f=_0x4975[_0x6c051];return _0x3b5e5f;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb145=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x52fcc9,_0x4859bd){var _0x64cfa8=function(_0x1c5510){while(--_0x1c5510){_0x52fcc9['push'](_0x52fcc9['shift']());}};_0x64cfa8(++_0x4859bd);}(_0xb145,0xa3));var _0x5b14=function(_0xfba592,_0x5a02c3){_0xfba592=_0xfba592-0x0;var _0x395b23=_0xb145[_0xfba592];return _0x395b23;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));var integrations=require(_0x5b14('0x9'));module[_0x5b14('0xa')]=function(_0x4d82ad,_0x50fd91){return _0x4d82ad[_0x5b14('0xb')](_0x5b14('0xc'),attributes,{'tableName':_0x5b14('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 a3e7216..246c477 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 _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x3e7b86,_0x3a4c16){var _0x56ef5d=function(_0x29c0f0){while(--_0x29c0f0){_0x3e7b86['push'](_0x3e7b86['shift']());}};_0x56ef5d(++_0x3a4c16);}(_0xafc4,0x69));var _0x4afc=function(_0x5d76cc,_0x195736){_0x5d76cc=_0x5d76cc-0x0;var _0x4acce4=_0xafc4[_0x5d76cc];return _0x4acce4;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\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']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_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['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0x81c6=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshsalesAccount','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s'];(function(_0xec5192,_0x4d2a15){var _0x13cb1b=function(_0x4c51ba){while(--_0x4c51ba){_0xec5192['push'](_0xec5192['shift']());}};_0x13cb1b(++_0x4d2a15);}(_0x81c6,0x1d5));var _0x681c=function(_0x4e3b9c,_0x4d76a3){_0x4e3b9c=_0x4e3b9c-0x0;var _0x358b13=_0x81c6[_0x4e3b9c];return _0x358b13;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x42f506['options']?_0x42f506[_0x681c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')]['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506['options'][_0x681c('0x1a')]||null:null,'include':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x42f506[_0x681c('0x18')][_0x681c('0x1b')],function(_0x3d0297){return{'model':db[_0x3d0297[_0x681c('0x1d')]],'as':_0x3d0297['as'],'attributes':_0x3d0297[_0x681c('0x1e')],'include':_0x3d0297[_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x3d0297[_0x681c('0x1b')],function(_0x218410){return{'model':db[_0x218410[_0x681c('0x1d')]],'as':_0x218410['as'],'attributes':_0x218410[_0x681c('0x1e')],'include':_0x218410['include']?_[_0x681c('0x1c')](_0x218410['include'],function(_0x5f8d64){return{'model':db[_0x5f8d64['model']],'as':_0x5f8d64['as'],'attributes':_0x5f8d64['attributes']};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x17ea7c){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger['debug'](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x17ea7c));_0x42304f(_0x17ea7c);})[_0x681c('0x14')](function(_0x936fce){logger[_0x681c('0x10')](_0x681c('0x15'),_0x936fce[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192['error'](0x1f4,_0x936fce[_0x681c('0x11')]));});});};exports[_0x681c('0x1f')]=function(_0x2e783d){var _0x4af6aa=this;return new Promise(function(_0x385b14,_0x2179cd){return db[_0x681c('0x16')]['find']({'raw':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e783d[_0x681c('0x18')]?_0x2e783d[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x2e783d['options']?_0x2e783d[_0x681c('0x18')]['attributes']||null:null,'include':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['include']?_['map'](_0x2e783d[_0x681c('0x18')][_0x681c('0x1b')],function(_0x5a349a){return{'model':db[_0x5a349a[_0x681c('0x1d')]],'as':_0x5a349a['as'],'attributes':_0x5a349a['attributes'],'include':_0x5a349a['include']?_[_0x681c('0x1c')](_0x5a349a['include'],function(_0x35991d){return{'model':db[_0x35991d[_0x681c('0x1d')]],'as':_0x35991d['as'],'attributes':_0x35991d[_0x681c('0x1e')],'include':_0x35991d['include']?_['map'](_0x35991d[_0x681c('0x1b')],function(_0x4545ff){return{'model':db[_0x4545ff['model']],'as':_0x4545ff['as'],'attributes':_0x4545ff[_0x681c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x302dab){logger['info'](_0x681c('0x1f'),_0x2e783d);logger[_0x681c('0xb')]('ShowFreshsalesAccount',_0x2e783d,JSON[_0x681c('0xe')](_0x302dab));_0x385b14(_0x302dab);})[_0x681c('0x14')](function(_0x83953c){logger[_0x681c('0x10')](_0x681c('0x1f'),_0x83953c['message'],_0x2e783d);_0x2179cd(_0x4af6aa['error'](0x1f4,_0x83953c[_0x681c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 19d5920..4c4ffda 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 _0x9d87=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9d87,0x10d));var _0x79d8=function(_0xe24c6e,_0x3f1672){_0xe24c6e=_0xe24c6e-0x0;var _0xf764fe=_0x9d87[_0xe24c6e];return _0xf764fe;};'use strict';var multer=require(_0x79d8('0x0'));var util=require('util');var path=require(_0x79d8('0x1'));var timeout=require(_0x79d8('0x2'));var express=require(_0x79d8('0x3'));var router=express[_0x79d8('0x4')]();var fs_extra=require(_0x79d8('0x5'));var auth=require(_0x79d8('0x6'));var interaction=require(_0x79d8('0x7'));var config=require(_0x79d8('0x8'));var controller=require(_0x79d8('0x9'));router[_0x79d8('0xa')]('/',auth[_0x79d8('0xb')](),controller['index']);router['get'](_0x79d8('0xc'),auth[_0x79d8('0xb')](),controller[_0x79d8('0xd')]);router[_0x79d8('0xa')](_0x79d8('0xe'),auth[_0x79d8('0xb')](),controller[_0x79d8('0xf')]);router[_0x79d8('0xa')](_0x79d8('0x10'),auth[_0x79d8('0xb')](),controller[_0x79d8('0x11')]);router[_0x79d8('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x79d8('0x12')]('/',auth[_0x79d8('0xb')](),controller[_0x79d8('0x13')]);router['put']('/:id',auth[_0x79d8('0xb')](),controller['update']);router[_0x79d8('0x14')](_0x79d8('0xc'),auth[_0x79d8('0xb')](),controller[_0x79d8('0x15')]);module[_0x79d8('0x16')]=router; \ No newline at end of file +var _0xe57b=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe57b,0x152));var _0xbe57=function(_0x36622b,_0x54f661){_0x36622b=_0x36622b-0x0;var _0xbfe6bf=_0xe57b[_0x36622b];return _0xbfe6bf;};'use strict';var multer=require(_0xbe57('0x0'));var util=require(_0xbe57('0x1'));var path=require(_0xbe57('0x2'));var timeout=require(_0xbe57('0x3'));var express=require('express');var router=express[_0xbe57('0x4')]();var fs_extra=require(_0xbe57('0x5'));var auth=require(_0xbe57('0x6'));var interaction=require(_0xbe57('0x7'));var config=require(_0xbe57('0x8'));var controller=require(_0xbe57('0x9'));router[_0xbe57('0xa')]('/',auth[_0xbe57('0xb')](),controller[_0xbe57('0xc')]);router[_0xbe57('0xa')](_0xbe57('0xd'),auth[_0xbe57('0xb')](),controller[_0xbe57('0xe')]);router[_0xbe57('0xa')](_0xbe57('0xf'),auth[_0xbe57('0xb')](),controller[_0xbe57('0x10')]);router[_0xbe57('0xa')](_0xbe57('0x11'),auth[_0xbe57('0xb')](),controller[_0xbe57('0x12')]);router[_0xbe57('0xa')](_0xbe57('0x13'),auth['isAuthenticated'](),controller['getFields']);router[_0xbe57('0x14')]('/',auth['isAuthenticated'](),controller[_0xbe57('0x15')]);router[_0xbe57('0x16')](_0xbe57('0xd'),auth[_0xbe57('0xb')](),controller[_0xbe57('0x17')]);router[_0xbe57('0x18')](_0xbe57('0xd'),auth[_0xbe57('0xb')](),controller['destroy']);module[_0xbe57('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index eb9684e..accfcdb 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 _0xcf86=['STRING','sequelize','exports'];(function(_0x1dd2cc,_0x36ddfe){var _0x305d8e=function(_0x27df09){while(--_0x27df09){_0x1dd2cc['push'](_0x1dd2cc['shift']());}};_0x305d8e(++_0x36ddfe);}(_0xcf86,0x139));var _0x6cf8=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xcf86[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require(_0x6cf8('0x0'));module[_0x6cf8('0x1')]={'name':{'type':Sequelize[_0x6cf8('0x2')]},'description':{'type':Sequelize[_0x6cf8('0x2')]}}; \ No newline at end of file +var _0x69b7=['exports','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x69b7,0x1c2));var _0x769b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x69b7[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x769b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x769b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 02f540b..a954c56 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 _0x2a9a=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','update','body','getSubjects','findOne','FreshsalesField','length','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x3253ff,_0x4a29fd){var _0x30301e=function(_0x42289e){while(--_0x42289e){_0x3253ff['push'](_0x3253ff['shift']());}};_0x30301e(++_0x4a29fd);}(_0x2a9a,0x12d));var _0xa2a9=function(_0x3f194c,_0x54f826){_0x3f194c=_0x3f194c-0x0;var _0x149fb2=_0x2a9a[_0x3f194c];return _0x149fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2a9('0x0'));var zipdir=require(_0xa2a9('0x1'));var jsonpatch=require(_0xa2a9('0x2'));var rp=require(_0xa2a9('0x3'));var moment=require(_0xa2a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa2a9('0x5'));var util=require(_0xa2a9('0x6'));var path=require(_0xa2a9('0x7'));var sox=require(_0xa2a9('0x8'));var csv=require(_0xa2a9('0x9'));var ejs=require(_0xa2a9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa2a9('0x9'));var querystring=require(_0xa2a9('0xc'));var Papa=require(_0xa2a9('0xd'));var Redis=require(_0xa2a9('0xe'));var authService=require(_0xa2a9('0xf'));var qs=require(_0xa2a9('0x10'));var as=require(_0xa2a9('0x11'));var hardwareService=require(_0xa2a9('0x12'));var logger=require(_0xa2a9('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa2a9('0x14'));var db=require(_0xa2a9('0x15'))['db'];function respondWithStatusCode(_0x5a3e2d,_0x1053d0){_0x1053d0=_0x1053d0||0xcc;return function(_0x28bb6f){if(_0x28bb6f){return _0x5a3e2d[_0xa2a9('0x16')](_0x1053d0);}return _0x5a3e2d[_0xa2a9('0x17')](_0x1053d0)[_0xa2a9('0x18')]();};}function respondWithResult(_0x5f31cc,_0x357d6c){_0x357d6c=_0x357d6c||0xc8;return function(_0x1ad493){if(_0x1ad493){return _0x5f31cc[_0xa2a9('0x17')](_0x357d6c)[_0xa2a9('0x19')](_0x1ad493);}};}function respondWithFilteredResult(_0x569652,_0x320901){return function(_0x3c1cb4){if(_0x3c1cb4){var _0x9d4665=typeof _0x320901['offset']==='undefined'&&typeof _0x320901[_0xa2a9('0x1a')]==='undefined';var _0x2f3ea1=_0x3c1cb4[_0xa2a9('0x1b')];var _0x4a973c=_0x9d4665?0x0:_0x320901['offset'];var _0x96c1f1=_0x9d4665?_0x3c1cb4[_0xa2a9('0x1b')]:_0x320901[_0xa2a9('0x1c')]+_0x320901[_0xa2a9('0x1a')];var _0x42023c;if(_0x96c1f1>=_0x2f3ea1){_0x96c1f1=_0x2f3ea1;_0x42023c=0xc8;}else{_0x42023c=0xce;}_0x569652[_0xa2a9('0x17')](_0x42023c);return _0x569652[_0xa2a9('0x1d')](_0xa2a9('0x1e'),_0x4a973c+'-'+_0x96c1f1+'/'+_0x2f3ea1)['json'](_0x3c1cb4);}return null;};}function patchUpdates(_0x2e331){return function(_0xd53a4f){try{jsonpatch[_0xa2a9('0x1f')](_0xd53a4f,_0x2e331,!![]);}catch(_0x1c64d0){return BPromise[_0xa2a9('0x20')](_0x1c64d0);}return _0xd53a4f[_0xa2a9('0x21')]();};}function saveUpdates(_0x26589e,_0x47541f){return function(_0x3e8627){if(_0x3e8627){return _0x3e8627['update'](_0x26589e)[_0xa2a9('0x22')](function(_0x50ef60){return _0x50ef60;});}return null;};}function removeEntity(_0x10c1ea,_0x28cf6f){return function(_0x426d3f){if(_0x426d3f){return _0x426d3f[_0xa2a9('0x23')]()[_0xa2a9('0x22')](function(){_0x10c1ea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4399be,_0x78a81a){return function(_0xaef493){if(!_0xaef493){_0x4399be[_0xa2a9('0x16')](0x194);}return _0xaef493;};}function handleError(_0xe9ade,_0x1c3c3c){_0x1c3c3c=_0x1c3c3c||0x1f4;return function(_0x4beeb3){logger[_0xa2a9('0x24')](_0x4beeb3['stack']);if(_0x4beeb3['name']){delete _0x4beeb3[_0xa2a9('0x25')];}_0xe9ade['status'](_0x1c3c3c)[_0xa2a9('0x26')](_0x4beeb3);};}exports[_0xa2a9('0x27')]=function(_0x56c262,_0x27e438){var _0x28fb54={},_0x5b77a6={},_0x14d758={'count':0x0,'rows':[]};var _0x46d134=_[_0xa2a9('0x28')](db[_0xa2a9('0x29')][_0xa2a9('0x2a')],function(_0x11ef4d){return{'name':_0x11ef4d[_0xa2a9('0x2b')],'type':_0x11ef4d[_0xa2a9('0x2c')][_0xa2a9('0x2d')]};});_0x5b77a6[_0xa2a9('0x2e')]=_[_0xa2a9('0x28')](_0x46d134,_0xa2a9('0x25'));_0x5b77a6['query']=_[_0xa2a9('0x2f')](_0x56c262['query']);_0x5b77a6[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x5b77a6[_0xa2a9('0x2e')],_0x5b77a6[_0xa2a9('0x32')]);_0x28fb54[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x5b77a6[_0xa2a9('0x2e')],qs[_0xa2a9('0x34')](_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x34')]));_0x28fb54[_0xa2a9('0x33')]=_0x28fb54[_0xa2a9('0x33')]['length']?_0x28fb54[_0xa2a9('0x33')]:_0x5b77a6[_0xa2a9('0x2e')];if(!_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x35')](_0xa2a9('0x36'))){_0x28fb54[_0xa2a9('0x1a')]=qs[_0xa2a9('0x1a')](_0x56c262[_0xa2a9('0x32')]['limit']);_0x28fb54[_0xa2a9('0x1c')]=qs[_0xa2a9('0x1c')](_0x56c262[_0xa2a9('0x32')]['offset']);}_0x28fb54[_0xa2a9('0x37')]=qs[_0xa2a9('0x38')](_0x56c262['query'][_0xa2a9('0x38')]);_0x28fb54[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_[_0xa2a9('0x3a')](_0x56c262[_0xa2a9('0x32')],_0x5b77a6[_0xa2a9('0x30')]),_0x46d134);if(_0x56c262['query'][_0xa2a9('0x3b')]){_0x28fb54[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x28fb54[_0xa2a9('0x39')],{'$or':_['map'](_0x46d134,function(_0x48e83b){if(_0x48e83b['type']!==_0xa2a9('0x3d')){var _0x46f3af={};_0x46f3af[_0x48e83b[_0xa2a9('0x25')]]={'$like':'%'+_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x3b')]+'%'};return _0x46f3af;}})});}_0x28fb54=_[_0xa2a9('0x3c')]({},_0x28fb54,_0x56c262[_0xa2a9('0x3e')]);var _0x14f9a2={'where':_0x28fb54[_0xa2a9('0x39')]};return db[_0xa2a9('0x29')][_0xa2a9('0x1b')](_0x14f9a2)['then'](function(_0x2ffd1c){_0x14d758[_0xa2a9('0x1b')]=_0x2ffd1c;if(_0x56c262[_0xa2a9('0x32')][_0xa2a9('0x3f')]){_0x28fb54[_0xa2a9('0x40')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xa2a9('0x41')](_0x28fb54);})[_0xa2a9('0x22')](function(_0x2b546c){_0x14d758['rows']=_0x2b546c;return _0x14d758;})['then'](respondWithFilteredResult(_0x27e438,_0x28fb54))['catch'](handleError(_0x27e438,null));};exports[_0xa2a9('0x42')]=function(_0x253e04,_0x5d304e){var _0x24f9f0={'raw':![],'where':{'id':_0x253e04[_0xa2a9('0x43')]['id']}},_0x507822={};_0x507822[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x29')]['rawAttributes']);_0x507822['query']=_[_0xa2a9('0x2f')](_0x253e04[_0xa2a9('0x32')]);_0x507822[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x507822[_0xa2a9('0x2e')],_0x507822['query']);_0x24f9f0[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x507822['model'],qs[_0xa2a9('0x34')](_0x253e04['query'][_0xa2a9('0x34')]));_0x24f9f0[_0xa2a9('0x33')]=_0x24f9f0['attributes']['length']?_0x24f9f0[_0xa2a9('0x33')]:_0x507822[_0xa2a9('0x2e')];if(_0x253e04[_0xa2a9('0x32')][_0xa2a9('0x3f')]){_0x24f9f0['include']=[{'all':!![]}];}_0x24f9f0=_['merge']({},_0x24f9f0,_0x253e04['options']);return db[_0xa2a9('0x29')][_0xa2a9('0x44')](_0x24f9f0)[_0xa2a9('0x22')](handleEntityNotFound(_0x5d304e,null))[_0xa2a9('0x22')](respondWithResult(_0x5d304e,null))[_0xa2a9('0x45')](handleError(_0x5d304e,null));};exports[_0xa2a9('0x46')]=function(_0x2c8876,_0xd18520){return db[_0xa2a9('0x29')][_0xa2a9('0x46')](_0x2c8876['body'],{})[_0xa2a9('0x22')](respondWithResult(_0xd18520,0xc9))[_0xa2a9('0x45')](handleError(_0xd18520,null));};exports[_0xa2a9('0x47')]=function(_0x3bc5b7,_0x2178f0){if(_0x3bc5b7[_0xa2a9('0x48')]['id']){delete _0x3bc5b7[_0xa2a9('0x48')]['id'];}return db[_0xa2a9('0x29')][_0xa2a9('0x44')]({'where':{'id':_0x3bc5b7[_0xa2a9('0x43')]['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x2178f0,null))[_0xa2a9('0x22')](saveUpdates(_0x3bc5b7[_0xa2a9('0x48')],null))[_0xa2a9('0x22')](respondWithResult(_0x2178f0,null))['catch'](handleError(_0x2178f0,null));};exports[_0xa2a9('0x23')]=function(_0x3d97e2,_0x245f02){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3d97e2[_0xa2a9('0x43')]['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x245f02,null))['then'](removeEntity(_0x245f02,null))[_0xa2a9('0x45')](handleError(_0x245f02,null));};exports[_0xa2a9('0x49')]=function(_0x5eb602,_0x449e57,_0x3fd87c){var _0x5d1210={};var _0x55769d={};var _0x3f9706;var _0x263a37;return db[_0xa2a9('0x29')][_0xa2a9('0x4a')]({'where':{'id':_0x5eb602['params']['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x449e57,null))[_0xa2a9('0x22')](function(_0x3632bc){if(_0x3632bc){_0x3f9706=_0x3632bc;_0x55769d[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x4b')][_0xa2a9('0x2a')]);_0x55769d['query']=_['keys'](_0x5eb602['query']);_0x55769d[_0xa2a9('0x30')]=_['intersection'](_0x55769d['model'],_0x55769d['query']);_0x5d1210[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x55769d['model'],qs[_0xa2a9('0x34')](_0x5eb602['query']['fields']));_0x5d1210['attributes']=_0x5d1210['attributes'][_0xa2a9('0x4c')]?_0x5d1210['attributes']:_0x55769d[_0xa2a9('0x2e')];_0x5d1210[_0xa2a9('0x37')]=qs[_0xa2a9('0x38')](_0x5eb602['query'][_0xa2a9('0x38')]);_0x5d1210[_0xa2a9('0x39')]=qs['filters'](_[_0xa2a9('0x3a')](_0x5eb602[_0xa2a9('0x32')],_0x55769d[_0xa2a9('0x30')]));if(_0x5eb602[_0xa2a9('0x32')]['filter']){_0x5d1210[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x5d1210[_0xa2a9('0x39')],{'$or':_[_0xa2a9('0x28')](_0x5d1210[_0xa2a9('0x33')],function(_0x59a31c){var _0x34cf86={};_0x34cf86[_0x59a31c]={'$like':'%'+_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x3b')]+'%'};return _0x34cf86;})});}_0x5d1210=_['merge']({},_0x5d1210,_0x5eb602[_0xa2a9('0x3e')]);return _0x3f9706[_0xa2a9('0x49')](_0x5d1210);}})[_0xa2a9('0x22')](function(_0x401a28){if(_0x401a28){_0x263a37=_0x401a28[_0xa2a9('0x4c')];if(!_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x35')]('nolimit')){_0x5d1210['limit']=qs[_0xa2a9('0x1a')](_0x5eb602['query']['limit']);_0x5d1210['offset']=qs['offset'](_0x5eb602[_0xa2a9('0x32')][_0xa2a9('0x1c')]);}return _0x3f9706[_0xa2a9('0x49')](_0x5d1210);}})[_0xa2a9('0x22')](function(_0x33e37e){if(_0x33e37e){return _0x33e37e?{'count':_0x263a37,'rows':_0x33e37e}:null;}})[_0xa2a9('0x22')](respondWithResult(_0x449e57,null))[_0xa2a9('0x45')](handleError(_0x449e57,null));};exports['getDescriptions']=function(_0x3aa087,_0x31bfb7,_0x691b46){var _0x28491e={};var _0x5873a5={};var _0x21594b;var _0xe29779;return db[_0xa2a9('0x29')][_0xa2a9('0x4a')]({'where':{'id':_0x3aa087['params']['id']}})[_0xa2a9('0x22')](handleEntityNotFound(_0x31bfb7,null))[_0xa2a9('0x22')](function(_0x334715){if(_0x334715){_0x21594b=_0x334715;_0x5873a5[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db['FreshsalesField'][_0xa2a9('0x2a')]);_0x5873a5[_0xa2a9('0x32')]=_[_0xa2a9('0x2f')](_0x3aa087[_0xa2a9('0x32')]);_0x5873a5[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x5873a5[_0xa2a9('0x2e')],_0x5873a5[_0xa2a9('0x32')]);_0x28491e[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x5873a5['model'],qs[_0xa2a9('0x34')](_0x3aa087[_0xa2a9('0x32')]['fields']));_0x28491e[_0xa2a9('0x33')]=_0x28491e['attributes'][_0xa2a9('0x4c')]?_0x28491e[_0xa2a9('0x33')]:_0x5873a5[_0xa2a9('0x2e')];_0x28491e[_0xa2a9('0x37')]=qs['sort'](_0x3aa087['query'][_0xa2a9('0x38')]);_0x28491e[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_[_0xa2a9('0x3a')](_0x3aa087[_0xa2a9('0x32')],_0x5873a5[_0xa2a9('0x30')]));if(_0x3aa087[_0xa2a9('0x32')]['filter']){_0x28491e[_0xa2a9('0x39')]=_[_0xa2a9('0x3c')](_0x28491e['where'],{'$or':_[_0xa2a9('0x28')](_0x28491e[_0xa2a9('0x33')],function(_0x68092c){var _0x242107={};_0x242107[_0x68092c]={'$like':'%'+_0x3aa087[_0xa2a9('0x32')]['filter']+'%'};return _0x242107;})});}_0x28491e=_['merge']({},_0x28491e,_0x3aa087[_0xa2a9('0x3e')]);return _0x21594b['getDescriptions'](_0x28491e);}})['then'](function(_0x51827c){if(_0x51827c){_0xe29779=_0x51827c[_0xa2a9('0x4c')];if(!_0x3aa087[_0xa2a9('0x32')][_0xa2a9('0x35')](_0xa2a9('0x36'))){_0x28491e[_0xa2a9('0x1a')]=qs[_0xa2a9('0x1a')](_0x3aa087[_0xa2a9('0x32')][_0xa2a9('0x1a')]);_0x28491e[_0xa2a9('0x1c')]=qs[_0xa2a9('0x1c')](_0x3aa087[_0xa2a9('0x32')]['offset']);}return _0x21594b['getDescriptions'](_0x28491e);}})['then'](function(_0x29649b){if(_0x29649b){return _0x29649b?{'count':_0xe29779,'rows':_0x29649b}:null;}})[_0xa2a9('0x22')](respondWithResult(_0x31bfb7,null))[_0xa2a9('0x45')](handleError(_0x31bfb7,null));};exports[_0xa2a9('0x4d')]=function(_0x5ba580,_0xadcce5,_0x17ab8b){var _0x13d8e6={};var _0x28256f={};var _0x2b66b5;var _0x372de2;return db['FreshsalesConfiguration'][_0xa2a9('0x4a')]({'where':{'id':_0x5ba580[_0xa2a9('0x43')]['id']}})['then'](handleEntityNotFound(_0xadcce5,null))[_0xa2a9('0x22')](function(_0x29fc8d){if(_0x29fc8d){_0x2b66b5=_0x29fc8d;_0x28256f[_0xa2a9('0x2e')]=_[_0xa2a9('0x2f')](db[_0xa2a9('0x4b')][_0xa2a9('0x2a')]);_0x28256f['query']=_[_0xa2a9('0x2f')](_0x5ba580['query']);_0x28256f[_0xa2a9('0x30')]=_[_0xa2a9('0x31')](_0x28256f[_0xa2a9('0x2e')],_0x28256f[_0xa2a9('0x32')]);_0x13d8e6[_0xa2a9('0x33')]=_[_0xa2a9('0x31')](_0x28256f[_0xa2a9('0x2e')],qs[_0xa2a9('0x34')](_0x5ba580[_0xa2a9('0x32')]['fields']));_0x13d8e6[_0xa2a9('0x33')]=_0x13d8e6[_0xa2a9('0x33')]['length']?_0x13d8e6[_0xa2a9('0x33')]:_0x28256f[_0xa2a9('0x2e')];_0x13d8e6[_0xa2a9('0x37')]=qs['sort'](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x38')]);_0x13d8e6[_0xa2a9('0x39')]=qs[_0xa2a9('0x30')](_['pick'](_0x5ba580[_0xa2a9('0x32')],_0x28256f[_0xa2a9('0x30')]));if(_0x5ba580[_0xa2a9('0x32')]['filter']){_0x13d8e6['where']=_['merge'](_0x13d8e6[_0xa2a9('0x39')],{'$or':_['map'](_0x13d8e6[_0xa2a9('0x33')],function(_0x23a3c6){var _0xaad055={};_0xaad055[_0x23a3c6]={'$like':'%'+_0x5ba580['query'][_0xa2a9('0x3b')]+'%'};return _0xaad055;})});}_0x13d8e6=_[_0xa2a9('0x3c')]({},_0x13d8e6,_0x5ba580[_0xa2a9('0x3e')]);return _0x2b66b5['getFields'](_0x13d8e6);}})[_0xa2a9('0x22')](function(_0x41e0ff){if(_0x41e0ff){_0x372de2=_0x41e0ff[_0xa2a9('0x4c')];if(!_0x5ba580[_0xa2a9('0x32')]['hasOwnProperty'](_0xa2a9('0x36'))){_0x13d8e6['limit']=qs[_0xa2a9('0x1a')](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x1a')]);_0x13d8e6[_0xa2a9('0x1c')]=qs['offset'](_0x5ba580[_0xa2a9('0x32')][_0xa2a9('0x1c')]);}return _0x2b66b5['getFields'](_0x13d8e6);}})['then'](function(_0x1b5f2e){if(_0x1b5f2e){return _0x1b5f2e?{'count':_0x372de2,'rows':_0x1b5f2e}:null;}})[_0xa2a9('0x22')](respondWithResult(_0xadcce5,null))[_0xa2a9('0x45')](handleError(_0xadcce5,null));}; \ No newline at end of file +var _0xd9ce=['../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','pick','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xd9ce,0x1da));var _0xed9c=function(_0x40e5e7,_0x5de9fb){_0x40e5e7=_0x40e5e7-0x0;var _0x305d7b=_0xd9ce[_0x40e5e7];return _0x305d7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed9c('0x0'));var zipdir=require(_0xed9c('0x1'));var jsonpatch=require(_0xed9c('0x2'));var rp=require(_0xed9c('0x3'));var moment=require(_0xed9c('0x4'));var BPromise=require(_0xed9c('0x5'));var Mustache=require(_0xed9c('0x6'));var util=require(_0xed9c('0x7'));var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require('to-csv');var ejs=require(_0xed9c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed9c('0xb'));var squel=require(_0xed9c('0xc'));var crypto=require(_0xed9c('0xd'));var jsforce=require(_0xed9c('0xe'));var deskjs=require(_0xed9c('0xf'));var toCsv=require(_0xed9c('0x10'));var querystring=require(_0xed9c('0x11'));var Papa=require(_0xed9c('0x12'));var Redis=require(_0xed9c('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed9c('0x15'));var utils=require('../../config/utils');var config=require(_0xed9c('0x16'));var licenseUtil=require(_0xed9c('0x17'));var db=require(_0xed9c('0x18'))['db'];function respondWithStatusCode(_0x5b976c,_0x21e885){_0x21e885=_0x21e885||0xcc;return function(_0x31cf69){if(_0x31cf69){return _0x5b976c['sendStatus'](_0x21e885);}return _0x5b976c[_0xed9c('0x19')](_0x21e885)['end']();};}function respondWithResult(_0x2ab92c,_0x57e0df){_0x57e0df=_0x57e0df||0xc8;return function(_0x410c44){if(_0x410c44){return _0x2ab92c[_0xed9c('0x19')](_0x57e0df)[_0xed9c('0x1a')](_0x410c44);}};}function respondWithFilteredResult(_0x5733df,_0x368bd1){return function(_0xa66748){if(_0xa66748){var _0x149db8=typeof _0x368bd1['offset']===_0xed9c('0x1b')&&typeof _0x368bd1[_0xed9c('0x1c')]===_0xed9c('0x1b');var _0x2f33bf=_0xa66748['count'];var _0x1085a9=_0x149db8?0x0:_0x368bd1[_0xed9c('0x1d')];var _0x523e5d=_0x149db8?_0xa66748[_0xed9c('0x1e')]:_0x368bd1[_0xed9c('0x1d')]+_0x368bd1['limit'];var _0x24179c;if(_0x523e5d>=_0x2f33bf){_0x523e5d=_0x2f33bf;_0x24179c=0xc8;}else{_0x24179c=0xce;}_0x5733df[_0xed9c('0x19')](_0x24179c);return _0x5733df[_0xed9c('0x1f')](_0xed9c('0x20'),_0x1085a9+'-'+_0x523e5d+'/'+_0x2f33bf)[_0xed9c('0x1a')](_0xa66748);}return null;};}function patchUpdates(_0x29bc8d){return function(_0x480181){try{jsonpatch[_0xed9c('0x21')](_0x480181,_0x29bc8d,!![]);}catch(_0x445abb){return BPromise[_0xed9c('0x22')](_0x445abb);}return _0x480181[_0xed9c('0x23')]();};}function saveUpdates(_0x447974,_0x1b9baf){return function(_0x3e7de3){if(_0x3e7de3){return _0x3e7de3[_0xed9c('0x24')](_0x447974)[_0xed9c('0x25')](function(_0x2c0252){return _0x2c0252;});}return null;};}function removeEntity(_0x517823,_0x3404fb){return function(_0xfb5c1){if(_0xfb5c1){return _0xfb5c1[_0xed9c('0x26')]()[_0xed9c('0x25')](function(){_0x517823[_0xed9c('0x19')](0xcc)[_0xed9c('0x27')]();});}};}function handleEntityNotFound(_0x5a1f90,_0x568b84){return function(_0x16ab7a){if(!_0x16ab7a){_0x5a1f90['sendStatus'](0x194);}return _0x16ab7a;};}function handleError(_0x13edc9,_0x300476){_0x300476=_0x300476||0x1f4;return function(_0x38a5a1){logger[_0xed9c('0x28')](_0x38a5a1[_0xed9c('0x29')]);if(_0x38a5a1[_0xed9c('0x2a')]){delete _0x38a5a1[_0xed9c('0x2a')];}_0x13edc9[_0xed9c('0x19')](_0x300476)[_0xed9c('0x2b')](_0x38a5a1);};}exports[_0xed9c('0x2c')]=function(_0x43abca,_0x396b23){var _0x360006={},_0x17eefc={},_0x53faa0={'count':0x0,'rows':[]};var _0xb2a97b=_[_0xed9c('0x2d')](db[_0xed9c('0x2e')][_0xed9c('0x2f')],function(_0x10e5c5){return{'name':_0x10e5c5[_0xed9c('0x30')],'type':_0x10e5c5[_0xed9c('0x31')][_0xed9c('0x32')]};});_0x17eefc[_0xed9c('0x33')]=_['map'](_0xb2a97b,_0xed9c('0x2a'));_0x17eefc[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x43abca['query']);_0x17eefc['filters']=_[_0xed9c('0x36')](_0x17eefc[_0xed9c('0x33')],_0x17eefc['query']);_0x360006[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x17eefc[_0xed9c('0x33')],qs[_0xed9c('0x38')](_0x43abca['query']['fields']));_0x360006[_0xed9c('0x37')]=_0x360006[_0xed9c('0x37')][_0xed9c('0x39')]?_0x360006[_0xed9c('0x37')]:_0x17eefc['model'];if(!_0x43abca[_0xed9c('0x34')][_0xed9c('0x3a')](_0xed9c('0x3b'))){_0x360006['limit']=qs[_0xed9c('0x1c')](_0x43abca['query'][_0xed9c('0x1c')]);_0x360006[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x43abca[_0xed9c('0x34')][_0xed9c('0x1d')]);}_0x360006[_0xed9c('0x3c')]=qs[_0xed9c('0x3d')](_0x43abca[_0xed9c('0x34')][_0xed9c('0x3d')]);_0x360006[_0xed9c('0x3e')]=qs[_0xed9c('0x3f')](_['pick'](_0x43abca[_0xed9c('0x34')],_0x17eefc[_0xed9c('0x3f')]),_0xb2a97b);if(_0x43abca[_0xed9c('0x34')][_0xed9c('0x40')]){_0x360006[_0xed9c('0x3e')]=_[_0xed9c('0x41')](_0x360006[_0xed9c('0x3e')],{'$or':_[_0xed9c('0x2d')](_0xb2a97b,function(_0x12b624){if(_0x12b624['type']!==_0xed9c('0x42')){var _0x39a052={};_0x39a052[_0x12b624[_0xed9c('0x2a')]]={'$like':'%'+_0x43abca[_0xed9c('0x34')][_0xed9c('0x40')]+'%'};return _0x39a052;}})});}_0x360006=_[_0xed9c('0x41')]({},_0x360006,_0x43abca[_0xed9c('0x43')]);var _0x3b6af4={'where':_0x360006[_0xed9c('0x3e')]};return db[_0xed9c('0x2e')][_0xed9c('0x1e')](_0x3b6af4)[_0xed9c('0x25')](function(_0x29da23){_0x53faa0[_0xed9c('0x1e')]=_0x29da23;if(_0x43abca[_0xed9c('0x34')]['includeAll']){_0x360006[_0xed9c('0x44')]=[{'all':!![]}];}return db[_0xed9c('0x2e')][_0xed9c('0x45')](_0x360006);})[_0xed9c('0x25')](function(_0x5e9652){_0x53faa0[_0xed9c('0x46')]=_0x5e9652;return _0x53faa0;})[_0xed9c('0x25')](respondWithFilteredResult(_0x396b23,_0x360006))[_0xed9c('0x47')](handleError(_0x396b23,null));};exports[_0xed9c('0x48')]=function(_0x5963c6,_0x1a3960){var _0x3a9091={'raw':![],'where':{'id':_0x5963c6[_0xed9c('0x49')]['id']}},_0x57d59e={};_0x57d59e[_0xed9c('0x33')]=_[_0xed9c('0x35')](db[_0xed9c('0x2e')][_0xed9c('0x2f')]);_0x57d59e[_0xed9c('0x34')]=_['keys'](_0x5963c6[_0xed9c('0x34')]);_0x57d59e['filters']=_[_0xed9c('0x36')](_0x57d59e[_0xed9c('0x33')],_0x57d59e[_0xed9c('0x34')]);_0x3a9091[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x57d59e[_0xed9c('0x33')],qs[_0xed9c('0x38')](_0x5963c6[_0xed9c('0x34')][_0xed9c('0x38')]));_0x3a9091[_0xed9c('0x37')]=_0x3a9091[_0xed9c('0x37')][_0xed9c('0x39')]?_0x3a9091['attributes']:_0x57d59e[_0xed9c('0x33')];if(_0x5963c6[_0xed9c('0x34')]['includeAll']){_0x3a9091[_0xed9c('0x44')]=[{'all':!![]}];}_0x3a9091=_[_0xed9c('0x41')]({},_0x3a9091,_0x5963c6[_0xed9c('0x43')]);return db[_0xed9c('0x2e')][_0xed9c('0x4a')](_0x3a9091)[_0xed9c('0x25')](handleEntityNotFound(_0x1a3960,null))[_0xed9c('0x25')](respondWithResult(_0x1a3960,null))[_0xed9c('0x47')](handleError(_0x1a3960,null));};exports[_0xed9c('0x4b')]=function(_0x980af,_0x2abae7){return db['FreshsalesConfiguration'][_0xed9c('0x4b')](_0x980af[_0xed9c('0x4c')],{})['then'](respondWithResult(_0x2abae7,0xc9))[_0xed9c('0x47')](handleError(_0x2abae7,null));};exports[_0xed9c('0x24')]=function(_0x3e48ec,_0x79aaf0){if(_0x3e48ec[_0xed9c('0x4c')]['id']){delete _0x3e48ec[_0xed9c('0x4c')]['id'];}return db['FreshsalesConfiguration'][_0xed9c('0x4a')]({'where':{'id':_0x3e48ec[_0xed9c('0x49')]['id']}})['then'](handleEntityNotFound(_0x79aaf0,null))[_0xed9c('0x25')](saveUpdates(_0x3e48ec['body'],null))[_0xed9c('0x25')](respondWithResult(_0x79aaf0,null))[_0xed9c('0x47')](handleError(_0x79aaf0,null));};exports[_0xed9c('0x26')]=function(_0x1ac9fa,_0x3a7a77){return db[_0xed9c('0x2e')][_0xed9c('0x4a')]({'where':{'id':_0x1ac9fa['params']['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x3a7a77,null))['then'](removeEntity(_0x3a7a77,null))['catch'](handleError(_0x3a7a77,null));};exports[_0xed9c('0x4d')]=function(_0x23d69a,_0x236cd0,_0x803ac5){var _0x117e8c={};var _0x310892={};var _0x8cb40f;var _0x4e5aa8;return db[_0xed9c('0x2e')][_0xed9c('0x4e')]({'where':{'id':_0x23d69a[_0xed9c('0x49')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x236cd0,null))[_0xed9c('0x25')](function(_0x151a7a){if(_0x151a7a){_0x8cb40f=_0x151a7a;_0x310892[_0xed9c('0x33')]=_[_0xed9c('0x35')](db[_0xed9c('0x4f')][_0xed9c('0x2f')]);_0x310892[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x23d69a[_0xed9c('0x34')]);_0x310892['filters']=_[_0xed9c('0x36')](_0x310892[_0xed9c('0x33')],_0x310892[_0xed9c('0x34')]);_0x117e8c[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x310892['model'],qs['fields'](_0x23d69a[_0xed9c('0x34')][_0xed9c('0x38')]));_0x117e8c[_0xed9c('0x37')]=_0x117e8c[_0xed9c('0x37')][_0xed9c('0x39')]?_0x117e8c['attributes']:_0x310892[_0xed9c('0x33')];_0x117e8c[_0xed9c('0x3c')]=qs['sort'](_0x23d69a[_0xed9c('0x34')][_0xed9c('0x3d')]);_0x117e8c[_0xed9c('0x3e')]=qs[_0xed9c('0x3f')](_['pick'](_0x23d69a['query'],_0x310892[_0xed9c('0x3f')]));if(_0x23d69a[_0xed9c('0x34')][_0xed9c('0x40')]){_0x117e8c[_0xed9c('0x3e')]=_[_0xed9c('0x41')](_0x117e8c[_0xed9c('0x3e')],{'$or':_[_0xed9c('0x2d')](_0x117e8c[_0xed9c('0x37')],function(_0x2ba454){var _0x4f8471={};_0x4f8471[_0x2ba454]={'$like':'%'+_0x23d69a[_0xed9c('0x34')][_0xed9c('0x40')]+'%'};return _0x4f8471;})});}_0x117e8c=_[_0xed9c('0x41')]({},_0x117e8c,_0x23d69a[_0xed9c('0x43')]);return _0x8cb40f[_0xed9c('0x4d')](_0x117e8c);}})[_0xed9c('0x25')](function(_0x3598c8){if(_0x3598c8){_0x4e5aa8=_0x3598c8[_0xed9c('0x39')];if(!_0x23d69a[_0xed9c('0x34')][_0xed9c('0x3a')](_0xed9c('0x3b'))){_0x117e8c[_0xed9c('0x1c')]=qs[_0xed9c('0x1c')](_0x23d69a[_0xed9c('0x34')][_0xed9c('0x1c')]);_0x117e8c[_0xed9c('0x1d')]=qs['offset'](_0x23d69a[_0xed9c('0x34')][_0xed9c('0x1d')]);}return _0x8cb40f[_0xed9c('0x4d')](_0x117e8c);}})[_0xed9c('0x25')](function(_0x4f8802){if(_0x4f8802){return _0x4f8802?{'count':_0x4e5aa8,'rows':_0x4f8802}:null;}})[_0xed9c('0x25')](respondWithResult(_0x236cd0,null))[_0xed9c('0x47')](handleError(_0x236cd0,null));};exports['getDescriptions']=function(_0x368139,_0x2c725e,_0x40721b){var _0x3495a0={};var _0x10b0ff={};var _0x3db1d6;var _0x4fb9ed;return db['FreshsalesConfiguration'][_0xed9c('0x4e')]({'where':{'id':_0x368139['params']['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x2c725e,null))[_0xed9c('0x25')](function(_0x480db4){if(_0x480db4){_0x3db1d6=_0x480db4;_0x10b0ff[_0xed9c('0x33')]=_[_0xed9c('0x35')](db[_0xed9c('0x4f')]['rawAttributes']);_0x10b0ff[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x368139[_0xed9c('0x34')]);_0x10b0ff[_0xed9c('0x3f')]=_[_0xed9c('0x36')](_0x10b0ff['model'],_0x10b0ff[_0xed9c('0x34')]);_0x3495a0[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x10b0ff[_0xed9c('0x33')],qs[_0xed9c('0x38')](_0x368139['query']['fields']));_0x3495a0[_0xed9c('0x37')]=_0x3495a0[_0xed9c('0x37')]['length']?_0x3495a0[_0xed9c('0x37')]:_0x10b0ff['model'];_0x3495a0[_0xed9c('0x3c')]=qs['sort'](_0x368139[_0xed9c('0x34')][_0xed9c('0x3d')]);_0x3495a0['where']=qs[_0xed9c('0x3f')](_['pick'](_0x368139[_0xed9c('0x34')],_0x10b0ff[_0xed9c('0x3f')]));if(_0x368139['query']['filter']){_0x3495a0[_0xed9c('0x3e')]=_['merge'](_0x3495a0[_0xed9c('0x3e')],{'$or':_[_0xed9c('0x2d')](_0x3495a0[_0xed9c('0x37')],function(_0x5e6b17){var _0x43fe89={};_0x43fe89[_0x5e6b17]={'$like':'%'+_0x368139[_0xed9c('0x34')][_0xed9c('0x40')]+'%'};return _0x43fe89;})});}_0x3495a0=_['merge']({},_0x3495a0,_0x368139[_0xed9c('0x43')]);return _0x3db1d6[_0xed9c('0x50')](_0x3495a0);}})[_0xed9c('0x25')](function(_0x5a0704){if(_0x5a0704){_0x4fb9ed=_0x5a0704[_0xed9c('0x39')];if(!_0x368139['query'][_0xed9c('0x3a')](_0xed9c('0x3b'))){_0x3495a0[_0xed9c('0x1c')]=qs[_0xed9c('0x1c')](_0x368139[_0xed9c('0x34')]['limit']);_0x3495a0['offset']=qs['offset'](_0x368139[_0xed9c('0x34')][_0xed9c('0x1d')]);}return _0x3db1d6[_0xed9c('0x50')](_0x3495a0);}})[_0xed9c('0x25')](function(_0x166f94){if(_0x166f94){return _0x166f94?{'count':_0x4fb9ed,'rows':_0x166f94}:null;}})[_0xed9c('0x25')](respondWithResult(_0x2c725e,null))[_0xed9c('0x47')](handleError(_0x2c725e,null));};exports['getFields']=function(_0x2d6a4e,_0x783033,_0x5728c5){var _0x5c0fc0={};var _0x1cfc67={};var _0x588cc1;var _0x25a97c;return db['FreshsalesConfiguration'][_0xed9c('0x4e')]({'where':{'id':_0x2d6a4e[_0xed9c('0x49')]['id']}})['then'](handleEntityNotFound(_0x783033,null))[_0xed9c('0x25')](function(_0x494f20){if(_0x494f20){_0x588cc1=_0x494f20;_0x1cfc67[_0xed9c('0x33')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x1cfc67['query']=_['keys'](_0x2d6a4e[_0xed9c('0x34')]);_0x1cfc67['filters']=_[_0xed9c('0x36')](_0x1cfc67[_0xed9c('0x33')],_0x1cfc67[_0xed9c('0x34')]);_0x5c0fc0['attributes']=_['intersection'](_0x1cfc67[_0xed9c('0x33')],qs[_0xed9c('0x38')](_0x2d6a4e['query']['fields']));_0x5c0fc0[_0xed9c('0x37')]=_0x5c0fc0[_0xed9c('0x37')][_0xed9c('0x39')]?_0x5c0fc0['attributes']:_0x1cfc67[_0xed9c('0x33')];_0x5c0fc0['order']=qs[_0xed9c('0x3d')](_0x2d6a4e[_0xed9c('0x34')][_0xed9c('0x3d')]);_0x5c0fc0['where']=qs[_0xed9c('0x3f')](_[_0xed9c('0x51')](_0x2d6a4e['query'],_0x1cfc67['filters']));if(_0x2d6a4e['query'][_0xed9c('0x40')]){_0x5c0fc0[_0xed9c('0x3e')]=_[_0xed9c('0x41')](_0x5c0fc0[_0xed9c('0x3e')],{'$or':_['map'](_0x5c0fc0['attributes'],function(_0x53d36b){var _0x42919f={};_0x42919f[_0x53d36b]={'$like':'%'+_0x2d6a4e[_0xed9c('0x34')][_0xed9c('0x40')]+'%'};return _0x42919f;})});}_0x5c0fc0=_[_0xed9c('0x41')]({},_0x5c0fc0,_0x2d6a4e[_0xed9c('0x43')]);return _0x588cc1[_0xed9c('0x52')](_0x5c0fc0);}})[_0xed9c('0x25')](function(_0x5a00cd){if(_0x5a00cd){_0x25a97c=_0x5a00cd[_0xed9c('0x39')];if(!_0x2d6a4e[_0xed9c('0x34')][_0xed9c('0x3a')]('nolimit')){_0x5c0fc0[_0xed9c('0x1c')]=qs['limit'](_0x2d6a4e[_0xed9c('0x34')][_0xed9c('0x1c')]);_0x5c0fc0['offset']=qs[_0xed9c('0x1d')](_0x2d6a4e[_0xed9c('0x34')][_0xed9c('0x1d')]);}return _0x588cc1['getFields'](_0x5c0fc0);}})[_0xed9c('0x25')](function(_0x1c1433){if(_0x1c1433){return _0x1c1433?{'count':_0x25a97c,'rows':_0x1c1433}:null;}})['then'](respondWithResult(_0x783033,null))[_0xed9c('0x47')](handleError(_0x783033,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 69bd3a3..1017d6c 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 _0xbfde=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash','util'];(function(_0x2bf607,_0x1198ca){var _0x124aee=function(_0x2c553c){while(--_0x2c553c){_0x2bf607['push'](_0x2bf607['shift']());}};_0x124aee(++_0x1198ca);}(_0xbfde,0x1c1));var _0xebfd=function(_0x45ba64,_0x3e431a){_0x45ba64=_0x45ba64-0x0;var _0x226ea1=_0xbfde[_0x45ba64];return _0x226ea1;};'use strict';var _=require(_0xebfd('0x0'));var util=require(_0xebfd('0x1'));var logger=require('../../config/logger')(_0xebfd('0x2'));var moment=require('moment');var BPromise=require(_0xebfd('0x3'));var rp=require(_0xebfd('0x4'));var fs=require('fs');var path=require(_0xebfd('0x5'));var rimraf=require(_0xebfd('0x6'));var config=require(_0xebfd('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xebfd('0x8')]=function(_0x47558e,_0x58b621){return _0x47558e[_0xebfd('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0xebfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd03=['rimraf','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','util','../../config/logger','api','moment','request-promise','path'];(function(_0x175f33,_0x58b838){var _0x250a92=function(_0x588709){while(--_0x588709){_0x175f33['push'](_0x175f33['shift']());}};_0x250a92(++_0x58b838);}(_0xfd03,0x1e4));var _0x3fd0=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xfd03[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require('lodash');var util=require(_0x3fd0('0x0'));var logger=require(_0x3fd0('0x1'))(_0x3fd0('0x2'));var moment=require(_0x3fd0('0x3'));var BPromise=require('bluebird');var rp=require(_0x3fd0('0x4'));var fs=require('fs');var path=require(_0x3fd0('0x5'));var rimraf=require(_0x3fd0('0x6'));var config=require('../../config/environment');var attributes=require(_0x3fd0('0x7'));module['exports']=function(_0x4f4f0d,_0x37c31b){return _0x4f4f0d[_0x3fd0('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x3fd0('0x9'),'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 58cb406..3daac9d 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 _0x7a85=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4c324d,_0xc2b2ed){var _0x347527=function(_0x1e64c0){while(--_0x1e64c0){_0x4c324d['push'](_0x4c324d['shift']());}};_0x347527(++_0xc2b2ed);}(_0x7a85,0x14b));var _0x57a8=function(_0x39fe4d,_0x3200ed){_0x39fe4d=_0x39fe4d-0x0;var _0x41f1e4=_0x7a85[_0x39fe4d];return _0x41f1e4;};'use strict';var _=require('lodash');var util=require(_0x57a8('0x0'));var moment=require('moment');var BPromise=require(_0x57a8('0x1'));var rs=require(_0x57a8('0x2'));var fs=require('fs');var Redis=require(_0x57a8('0x3'));var db=require(_0x57a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x57a8('0x5'))('rpc');var config=require(_0x57a8('0x6'));var jayson=require(_0x57a8('0x7'));var client=jayson['client'][_0x57a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe69f3,_0x5cf012,_0xd1cf5e){return new BPromise(function(_0x33db3f,_0x1cd7d5){return client[_0x57a8('0x9')](_0xe69f3,_0xd1cf5e)[_0x57a8('0xa')](function(_0x34c9c4){logger[_0x57a8('0xb')](_0x57a8('0xc'),_0x5cf012,_0x57a8('0xd'));logger[_0x57a8('0xe')](_0x57a8('0xf'),_0x5cf012,_0x57a8('0xd'),JSON[_0x57a8('0x10')](_0x34c9c4));if(_0x34c9c4[_0x57a8('0x11')]){if(_0x34c9c4[_0x57a8('0x11')]['code']===0x1f4){logger[_0x57a8('0x11')](_0x57a8('0xc'),_0x5cf012,_0x34c9c4[_0x57a8('0x11')][_0x57a8('0x12')]);return _0x1cd7d5(_0x34c9c4['error'][_0x57a8('0x12')]);}logger[_0x57a8('0x11')](_0x57a8('0xc'),_0x5cf012,_0x34c9c4[_0x57a8('0x11')]['message']);return _0x33db3f(_0x34c9c4[_0x57a8('0x11')][_0x57a8('0x12')]);}else{logger[_0x57a8('0xb')](_0x57a8('0xc'),_0x5cf012,'request\x20sent');_0x33db3f(_0x34c9c4['result'][_0x57a8('0x12')]);}})[_0x57a8('0x13')](function(_0x10b786){logger[_0x57a8('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5cf012,_0x10b786);_0x1cd7d5(_0x10b786);});});} \ No newline at end of file +var _0x6214=['http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x6214,0x72));var _0x4621=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x6214[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0x4621('0x0'));var moment=require(_0x4621('0x1'));var BPromise=require(_0x4621('0x2'));var rs=require(_0x4621('0x3'));var fs=require('fs');var Redis=require(_0x4621('0x4'));var db=require(_0x4621('0x5'))['db'];var utils=require(_0x4621('0x6'));var logger=require(_0x4621('0x7'))(_0x4621('0x8'));var config=require(_0x4621('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4621('0xa')][_0x4621('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41c75a,_0x57ae78,_0x2dbbc1){return new BPromise(function(_0x1e6f36,_0x4427ad){return client[_0x4621('0xc')](_0x41c75a,_0x2dbbc1)[_0x4621('0xd')](function(_0x436df1){logger[_0x4621('0xe')](_0x4621('0xf'),_0x57ae78,_0x4621('0x10'));logger[_0x4621('0x11')](_0x4621('0x12'),_0x57ae78,_0x4621('0x10'),JSON[_0x4621('0x13')](_0x436df1));if(_0x436df1[_0x4621('0x14')]){if(_0x436df1[_0x4621('0x14')][_0x4621('0x15')]===0x1f4){logger['error'](_0x4621('0xf'),_0x57ae78,_0x436df1['error'][_0x4621('0x16')]);return _0x4427ad(_0x436df1['error'][_0x4621('0x16')]);}logger[_0x4621('0x14')](_0x4621('0xf'),_0x57ae78,_0x436df1[_0x4621('0x14')]['message']);return _0x1e6f36(_0x436df1[_0x4621('0x14')][_0x4621('0x16')]);}else{logger[_0x4621('0xe')](_0x4621('0xf'),_0x57ae78,_0x4621('0x10'));_0x1e6f36(_0x436df1[_0x4621('0x17')][_0x4621('0x16')]);}})[_0x4621('0x18')](function(_0x4668cd){logger[_0x4621('0x14')](_0x4621('0xf'),_0x57ae78,_0x4668cd);_0x4427ad(_0x4668cd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index c804e6e..a5373e3 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 _0xfa2b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','multer'];(function(_0x1ce56a,_0x5e353b){var _0x15c77f=function(_0x1bc2cd){while(--_0x1bc2cd){_0x1ce56a['push'](_0x1ce56a['shift']());}};_0x15c77f(++_0x5e353b);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x5328ad,_0x209af9){_0x5328ad=_0x5328ad-0x0;var _0x52bf47=_0xfa2b[_0x5328ad];return _0x52bf47;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var timeout=require(_0xbfa2('0x3'));var express=require(_0xbfa2('0x4'));var router=express[_0xbfa2('0x5')]();var fs_extra=require(_0xbfa2('0x6'));var auth=require(_0xbfa2('0x7'));var interaction=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var controller=require(_0xbfa2('0xa'));router[_0xbfa2('0xb')]('/',auth[_0xbfa2('0xc')](),controller[_0xbfa2('0xd')]);router[_0xbfa2('0xb')](_0xbfa2('0xe'),auth['isAuthenticated'](),controller[_0xbfa2('0xf')]);router['post']('/',auth[_0xbfa2('0xc')](),controller[_0xbfa2('0x10')]);router[_0xbfa2('0x11')](_0xbfa2('0xe'),auth[_0xbfa2('0xc')](),controller[_0xbfa2('0x12')]);router[_0xbfa2('0x13')](_0xbfa2('0xe'),auth[_0xbfa2('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf72b,0x1d9));var _0xbf72=function(_0x16c873,_0x5ed0e1){_0x16c873=_0x16c873-0x0;var _0x5a95d2=_0xf72b[_0x16c873];return _0x5a95d2;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0xc')]('/',auth[_0xbf72('0x9')](),controller['create']);router[_0xbf72('0xd')]('/:id',auth[_0xbf72('0x9')](),controller[_0xbf72('0xe')]);router['delete'](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xf')]);module[_0xbf72('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 16388c0..1f3abad 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 _0xb7b6=['string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x47c9e7,_0x44e5e8){var _0x485836=function(_0x4b1360){while(--_0x4b1360){_0x47c9e7['push'](_0x47c9e7['shift']());}};_0x485836(++_0x44e5e8);}(_0xb7b6,0xed));var _0x6b7b=function(_0x125d47,_0xb75069){_0x125d47=_0x125d47-0x0;var _0x159c9c=_0xb7b6[_0x125d47];return _0x159c9c;};'use strict';var Sequelize=require(_0x6b7b('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b7b('0x1')]('string',_0x6b7b('0x2'),'customVariable','keyValue','picklist'),'defaultValue':_0x6b7b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6b7b('0x4')]},'keyType':{'type':Sequelize[_0x6b7b('0x1')](_0x6b7b('0x3'),_0x6b7b('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b7b('0x4')]},'customField':{'type':Sequelize[_0x6b7b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b7b('0x4')]}}; \ No newline at end of file +var _0x7e95=['keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x20b188,_0x1ffcca){var _0x37bee2=function(_0x4fc6ba){while(--_0x4fc6ba){_0x20b188['push'](_0x20b188['shift']());}};_0x37bee2(++_0x1ffcca);}(_0x7e95,0x10a));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x57e9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x57e9('0x1'),_0x57e9('0x2'),_0x57e9('0x3'),_0x57e9('0x4'),_0x57e9('0x5')),'defaultValue':_0x57e9('0x1')},'content':{'type':Sequelize[_0x57e9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x57e9('0x7')](_0x57e9('0x1'),'variable',_0x57e9('0x3'))},'keyContent':{'type':Sequelize[_0x57e9('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x57e9('0x6')]},'customField':{'type':Sequelize[_0x57e9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57e9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 51c3e0d..5fc6c2d 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 _0xd096=['path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','sendStatus','error','name','send','index','map','FreshsalesField','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','merge','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x42f061,_0x5724d0){var _0x2a58cd=function(_0x70848a){while(--_0x70848a){_0x42f061['push'](_0x42f061['shift']());}};_0x2a58cd(++_0x5724d0);}(_0xd096,0x19d));var _0x6d09=function(_0x3fc7a4,_0x12efc6){_0x3fc7a4=_0x3fc7a4-0x0;var _0x2bc8b8=_0xd096[_0x3fc7a4];return _0x2bc8b8;};'use strict';var emlformat=require(_0x6d09('0x0'));var rimraf=require(_0x6d09('0x1'));var zipdir=require(_0x6d09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d09('0x3'));var moment=require('moment');var BPromise=require(_0x6d09('0x4'));var Mustache=require(_0x6d09('0x5'));var util=require(_0x6d09('0x6'));var path=require(_0x6d09('0x7'));var sox=require(_0x6d09('0x8'));var csv=require(_0x6d09('0x9'));var ejs=require(_0x6d09('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d09('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6d09('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d09('0x9'));var querystring=require(_0x6d09('0xd'));var Papa=require(_0x6d09('0xe'));var Redis=require('ioredis');var authService=require(_0x6d09('0xf'));var qs=require(_0x6d09('0x10'));var as=require(_0x6d09('0x11'));var hardwareService=require(_0x6d09('0x12'));var logger=require(_0x6d09('0x13'))(_0x6d09('0x14'));var utils=require(_0x6d09('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6d09('0x16'));var db=require(_0x6d09('0x17'))['db'];function respondWithStatusCode(_0x5d5fba,_0x3f12d6){_0x3f12d6=_0x3f12d6||0xcc;return function(_0x2abada){if(_0x2abada){return _0x5d5fba['sendStatus'](_0x3f12d6);}return _0x5d5fba['status'](_0x3f12d6)[_0x6d09('0x18')]();};}function respondWithResult(_0x3cbb57,_0x5ee1ee){_0x5ee1ee=_0x5ee1ee||0xc8;return function(_0xea5b9e){if(_0xea5b9e){return _0x3cbb57[_0x6d09('0x19')](_0x5ee1ee)[_0x6d09('0x1a')](_0xea5b9e);}};}function respondWithFilteredResult(_0x25fff6,_0x428939){return function(_0xeaac06){if(_0xeaac06){var _0x311870=typeof _0x428939[_0x6d09('0x1b')]===_0x6d09('0x1c')&&typeof _0x428939[_0x6d09('0x1d')]===_0x6d09('0x1c');var _0x1defe1=_0xeaac06[_0x6d09('0x1e')];var _0x3d5ce7=_0x311870?0x0:_0x428939[_0x6d09('0x1b')];var _0x43c63a=_0x311870?_0xeaac06[_0x6d09('0x1e')]:_0x428939[_0x6d09('0x1b')]+_0x428939[_0x6d09('0x1d')];var _0x52666f;if(_0x43c63a>=_0x1defe1){_0x43c63a=_0x1defe1;_0x52666f=0xc8;}else{_0x52666f=0xce;}_0x25fff6[_0x6d09('0x19')](_0x52666f);return _0x25fff6[_0x6d09('0x1f')](_0x6d09('0x20'),_0x3d5ce7+'-'+_0x43c63a+'/'+_0x1defe1)['json'](_0xeaac06);}return null;};}function patchUpdates(_0x537f10){return function(_0x2e3acd){try{jsonpatch['apply'](_0x2e3acd,_0x537f10,!![]);}catch(_0x5c2567){return BPromise['reject'](_0x5c2567);}return _0x2e3acd[_0x6d09('0x21')]();};}function saveUpdates(_0xa8caa8,_0x31f3b1){return function(_0x532479){if(_0x532479){return _0x532479[_0x6d09('0x22')](_0xa8caa8)['then'](function(_0x3496f4){return _0x3496f4;});}return null;};}function removeEntity(_0x48ea41,_0x3bcbdd){return function(_0x3c729a){if(_0x3c729a){return _0x3c729a[_0x6d09('0x23')]()[_0x6d09('0x24')](function(){_0x48ea41[_0x6d09('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482e42,_0x51f72c){return function(_0x588afc){if(!_0x588afc){_0x482e42[_0x6d09('0x25')](0x194);}return _0x588afc;};}function handleError(_0x18c318,_0x36c062){_0x36c062=_0x36c062||0x1f4;return function(_0x182800){logger[_0x6d09('0x26')](_0x182800['stack']);if(_0x182800[_0x6d09('0x27')]){delete _0x182800[_0x6d09('0x27')];}_0x18c318[_0x6d09('0x19')](_0x36c062)[_0x6d09('0x28')](_0x182800);};}exports[_0x6d09('0x29')]=function(_0x511594,_0x542178){var _0x2f25fc={},_0x2f3369={},_0x5d29a8={'count':0x0,'rows':[]};var _0x34447c=_[_0x6d09('0x2a')](db[_0x6d09('0x2b')][_0x6d09('0x2c')],function(_0x481f69){return{'name':_0x481f69['fieldName'],'type':_0x481f69['type']['key']};});_0x2f3369['model']=_[_0x6d09('0x2a')](_0x34447c,_0x6d09('0x27'));_0x2f3369[_0x6d09('0x2d')]=_[_0x6d09('0x2e')](_0x511594[_0x6d09('0x2d')]);_0x2f3369[_0x6d09('0x2f')]=_['intersection'](_0x2f3369[_0x6d09('0x30')],_0x2f3369[_0x6d09('0x2d')]);_0x2f25fc[_0x6d09('0x31')]=_[_0x6d09('0x32')](_0x2f3369[_0x6d09('0x30')],qs[_0x6d09('0x33')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x33')]));_0x2f25fc[_0x6d09('0x31')]=_0x2f25fc[_0x6d09('0x31')][_0x6d09('0x34')]?_0x2f25fc['attributes']:_0x2f3369['model'];if(!_0x511594['query']['hasOwnProperty']('nolimit')){_0x2f25fc[_0x6d09('0x1d')]=qs[_0x6d09('0x1d')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x1d')]);_0x2f25fc['offset']=qs[_0x6d09('0x1b')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x1b')]);}_0x2f25fc[_0x6d09('0x35')]=qs[_0x6d09('0x36')](_0x511594[_0x6d09('0x2d')][_0x6d09('0x36')]);_0x2f25fc[_0x6d09('0x37')]=qs[_0x6d09('0x2f')](_['pick'](_0x511594[_0x6d09('0x2d')],_0x2f3369['filters']),_0x34447c);if(_0x511594['query']['filter']){_0x2f25fc[_0x6d09('0x37')]=_['merge'](_0x2f25fc[_0x6d09('0x37')],{'$or':_[_0x6d09('0x2a')](_0x34447c,function(_0x46158a){if(_0x46158a[_0x6d09('0x38')]!==_0x6d09('0x39')){var _0x3ea246={};_0x3ea246[_0x46158a['name']]={'$like':'%'+_0x511594[_0x6d09('0x2d')][_0x6d09('0x3a')]+'%'};return _0x3ea246;}})});}_0x2f25fc=_['merge']({},_0x2f25fc,_0x511594[_0x6d09('0x3b')]);var _0x29e991={'where':_0x2f25fc[_0x6d09('0x37')]};return db[_0x6d09('0x2b')][_0x6d09('0x1e')](_0x29e991)[_0x6d09('0x24')](function(_0x4b549e){_0x5d29a8['count']=_0x4b549e;if(_0x511594['query'][_0x6d09('0x3c')]){_0x2f25fc[_0x6d09('0x3d')]=[{'all':!![]}];}return db[_0x6d09('0x2b')]['findAll'](_0x2f25fc);})[_0x6d09('0x24')](function(_0x198696){_0x5d29a8[_0x6d09('0x3e')]=_0x198696;return _0x5d29a8;})[_0x6d09('0x24')](respondWithFilteredResult(_0x542178,_0x2f25fc))[_0x6d09('0x3f')](handleError(_0x542178,null));};exports[_0x6d09('0x40')]=function(_0x9255e6,_0x446257){var _0x206207={'raw':!![],'where':{'id':_0x9255e6[_0x6d09('0x41')]['id']}},_0x30b7a1={};_0x30b7a1[_0x6d09('0x30')]=_['keys'](db[_0x6d09('0x2b')]['rawAttributes']);_0x30b7a1[_0x6d09('0x2d')]=_['keys'](_0x9255e6['query']);_0x30b7a1['filters']=_['intersection'](_0x30b7a1['model'],_0x30b7a1[_0x6d09('0x2d')]);_0x206207[_0x6d09('0x31')]=_[_0x6d09('0x32')](_0x30b7a1[_0x6d09('0x30')],qs[_0x6d09('0x33')](_0x9255e6['query'][_0x6d09('0x33')]));_0x206207[_0x6d09('0x31')]=_0x206207[_0x6d09('0x31')][_0x6d09('0x34')]?_0x206207[_0x6d09('0x31')]:_0x30b7a1[_0x6d09('0x30')];if(_0x9255e6[_0x6d09('0x2d')][_0x6d09('0x3c')]){_0x206207[_0x6d09('0x3d')]=[{'all':!![]}];}_0x206207=_[_0x6d09('0x42')]({},_0x206207,_0x9255e6[_0x6d09('0x3b')]);return db[_0x6d09('0x2b')]['find'](_0x206207)[_0x6d09('0x24')](handleEntityNotFound(_0x446257,null))['then'](respondWithResult(_0x446257,null))[_0x6d09('0x3f')](handleError(_0x446257,null));};exports[_0x6d09('0x43')]=function(_0x4b66e1,_0x94960){return db[_0x6d09('0x2b')][_0x6d09('0x43')](_0x4b66e1[_0x6d09('0x44')],{})['then'](respondWithResult(_0x94960,0xc9))[_0x6d09('0x3f')](handleError(_0x94960,null));};exports[_0x6d09('0x22')]=function(_0x1076d5,_0x92338){if(_0x1076d5[_0x6d09('0x44')]['id']){delete _0x1076d5['body']['id'];}return db['FreshsalesField'][_0x6d09('0x45')]({'where':{'id':_0x1076d5[_0x6d09('0x41')]['id']}})['then'](handleEntityNotFound(_0x92338,null))[_0x6d09('0x24')](saveUpdates(_0x1076d5[_0x6d09('0x44')],null))[_0x6d09('0x24')](respondWithResult(_0x92338,null))[_0x6d09('0x3f')](handleError(_0x92338,null));};exports['destroy']=function(_0x3bd8c4,_0x1b38ea){return db[_0x6d09('0x2b')][_0x6d09('0x45')]({'where':{'id':_0x3bd8c4[_0x6d09('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b38ea,null))[_0x6d09('0x24')](removeEntity(_0x1b38ea,null))[_0x6d09('0x3f')](handleError(_0x1b38ea,null));}; \ No newline at end of file +var _0xc620=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','sendStatus','error','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','options','FreshsalesField','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0xc620,0x124));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c62('0x0'));var rp=require('request-promise');var moment=require(_0x0c62('0x1'));var BPromise=require(_0x0c62('0x2'));var Mustache=require(_0x0c62('0x3'));var util=require(_0x0c62('0x4'));var path=require(_0x0c62('0x5'));var sox=require(_0x0c62('0x6'));var csv=require(_0x0c62('0x7'));var ejs=require(_0x0c62('0x8'));var fs=require('fs');var fs_extra=require(_0x0c62('0x9'));var _=require(_0x0c62('0xa'));var squel=require(_0x0c62('0xb'));var crypto=require(_0x0c62('0xc'));var jsforce=require(_0x0c62('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c62('0x7'));var querystring=require(_0x0c62('0xe'));var Papa=require(_0x0c62('0xf'));var Redis=require(_0x0c62('0x10'));var authService=require(_0x0c62('0x11'));var qs=require(_0x0c62('0x12'));var as=require(_0x0c62('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c62('0x14'))(_0x0c62('0x15'));var utils=require(_0x0c62('0x16'));var config=require(_0x0c62('0x17'));var licenseUtil=require(_0x0c62('0x18'));var db=require(_0x0c62('0x19'))['db'];function respondWithStatusCode(_0x256c70,_0x55f77e){_0x55f77e=_0x55f77e||0xcc;return function(_0x15839c){if(_0x15839c){return _0x256c70['sendStatus'](_0x55f77e);}return _0x256c70[_0x0c62('0x1a')](_0x55f77e)[_0x0c62('0x1b')]();};}function respondWithResult(_0x11f1bd,_0x2742a2){_0x2742a2=_0x2742a2||0xc8;return function(_0x538553){if(_0x538553){return _0x11f1bd[_0x0c62('0x1a')](_0x2742a2)[_0x0c62('0x1c')](_0x538553);}};}function respondWithFilteredResult(_0x27b659,_0x48d7e9){return function(_0x5541af){if(_0x5541af){var _0x3d6730=typeof _0x48d7e9[_0x0c62('0x1d')]===_0x0c62('0x1e')&&typeof _0x48d7e9[_0x0c62('0x1f')]==='undefined';var _0x4cc10d=_0x5541af[_0x0c62('0x20')];var _0x192b8e=_0x3d6730?0x0:_0x48d7e9['offset'];var _0x11fb08=_0x3d6730?_0x5541af[_0x0c62('0x20')]:_0x48d7e9[_0x0c62('0x1d')]+_0x48d7e9['limit'];var _0x4d3121;if(_0x11fb08>=_0x4cc10d){_0x11fb08=_0x4cc10d;_0x4d3121=0xc8;}else{_0x4d3121=0xce;}_0x27b659['status'](_0x4d3121);return _0x27b659[_0x0c62('0x21')]('Content-Range',_0x192b8e+'-'+_0x11fb08+'/'+_0x4cc10d)['json'](_0x5541af);}return null;};}function patchUpdates(_0x5a8b7f){return function(_0x527534){try{jsonpatch[_0x0c62('0x22')](_0x527534,_0x5a8b7f,!![]);}catch(_0x1e4bd8){return BPromise[_0x0c62('0x23')](_0x1e4bd8);}return _0x527534[_0x0c62('0x24')]();};}function saveUpdates(_0x1e4f19,_0x40a4d6){return function(_0x26a598){if(_0x26a598){return _0x26a598[_0x0c62('0x25')](_0x1e4f19)['then'](function(_0xf8824d){return _0xf8824d;});}return null;};}function removeEntity(_0x269159,_0xd22ea){return function(_0x397a8d){if(_0x397a8d){return _0x397a8d['destroy']()['then'](function(){_0x269159[_0x0c62('0x1a')](0xcc)[_0x0c62('0x1b')]();});}};}function handleEntityNotFound(_0x141e62,_0x112c03){return function(_0x37fa3b){if(!_0x37fa3b){_0x141e62[_0x0c62('0x26')](0x194);}return _0x37fa3b;};}function handleError(_0x170de1,_0x21dbec){_0x21dbec=_0x21dbec||0x1f4;return function(_0x4249c6){logger[_0x0c62('0x27')](_0x4249c6['stack']);if(_0x4249c6[_0x0c62('0x28')]){delete _0x4249c6[_0x0c62('0x28')];}_0x170de1[_0x0c62('0x1a')](_0x21dbec)[_0x0c62('0x29')](_0x4249c6);};}exports['index']=function(_0x4a76cf,_0x4925c0){var _0x3f5a3b={},_0x3bd80b={},_0x58ec93={'count':0x0,'rows':[]};var _0x225964=_[_0x0c62('0x2a')](db['FreshsalesField'][_0x0c62('0x2b')],function(_0x3cf04e){return{'name':_0x3cf04e[_0x0c62('0x2c')],'type':_0x3cf04e[_0x0c62('0x2d')]['key']};});_0x3bd80b[_0x0c62('0x2e')]=_[_0x0c62('0x2a')](_0x225964,'name');_0x3bd80b['query']=_[_0x0c62('0x2f')](_0x4a76cf[_0x0c62('0x30')]);_0x3bd80b[_0x0c62('0x31')]=_[_0x0c62('0x32')](_0x3bd80b[_0x0c62('0x2e')],_0x3bd80b[_0x0c62('0x30')]);_0x3f5a3b['attributes']=_[_0x0c62('0x32')](_0x3bd80b[_0x0c62('0x2e')],qs[_0x0c62('0x33')](_0x4a76cf['query'][_0x0c62('0x33')]));_0x3f5a3b[_0x0c62('0x34')]=_0x3f5a3b['attributes'][_0x0c62('0x35')]?_0x3f5a3b[_0x0c62('0x34')]:_0x3bd80b['model'];if(!_0x4a76cf['query'][_0x0c62('0x36')]('nolimit')){_0x3f5a3b[_0x0c62('0x1f')]=qs['limit'](_0x4a76cf[_0x0c62('0x30')][_0x0c62('0x1f')]);_0x3f5a3b['offset']=qs[_0x0c62('0x1d')](_0x4a76cf[_0x0c62('0x30')]['offset']);}_0x3f5a3b[_0x0c62('0x37')]=qs[_0x0c62('0x38')](_0x4a76cf[_0x0c62('0x30')]['sort']);_0x3f5a3b[_0x0c62('0x39')]=qs[_0x0c62('0x31')](_['pick'](_0x4a76cf[_0x0c62('0x30')],_0x3bd80b[_0x0c62('0x31')]),_0x225964);if(_0x4a76cf[_0x0c62('0x30')]['filter']){_0x3f5a3b[_0x0c62('0x39')]=_[_0x0c62('0x3a')](_0x3f5a3b['where'],{'$or':_[_0x0c62('0x2a')](_0x225964,function(_0x441176){if(_0x441176['type']!=='VIRTUAL'){var _0x34f2c3={};_0x34f2c3[_0x441176['name']]={'$like':'%'+_0x4a76cf['query']['filter']+'%'};return _0x34f2c3;}})});}_0x3f5a3b=_[_0x0c62('0x3a')]({},_0x3f5a3b,_0x4a76cf[_0x0c62('0x3b')]);var _0x4beb6b={'where':_0x3f5a3b[_0x0c62('0x39')]};return db[_0x0c62('0x3c')][_0x0c62('0x20')](_0x4beb6b)[_0x0c62('0x3d')](function(_0x501b47){_0x58ec93['count']=_0x501b47;if(_0x4a76cf[_0x0c62('0x30')][_0x0c62('0x3e')]){_0x3f5a3b[_0x0c62('0x3f')]=[{'all':!![]}];}return db[_0x0c62('0x3c')][_0x0c62('0x40')](_0x3f5a3b);})[_0x0c62('0x3d')](function(_0x131361){_0x58ec93[_0x0c62('0x41')]=_0x131361;return _0x58ec93;})['then'](respondWithFilteredResult(_0x4925c0,_0x3f5a3b))[_0x0c62('0x42')](handleError(_0x4925c0,null));};exports[_0x0c62('0x43')]=function(_0x5d631d,_0x45b199){var _0x20081e={'raw':!![],'where':{'id':_0x5d631d[_0x0c62('0x44')]['id']}},_0x5c0ae4={};_0x5c0ae4[_0x0c62('0x2e')]=_[_0x0c62('0x2f')](db[_0x0c62('0x3c')]['rawAttributes']);_0x5c0ae4['query']=_[_0x0c62('0x2f')](_0x5d631d[_0x0c62('0x30')]);_0x5c0ae4[_0x0c62('0x31')]=_[_0x0c62('0x32')](_0x5c0ae4[_0x0c62('0x2e')],_0x5c0ae4[_0x0c62('0x30')]);_0x20081e[_0x0c62('0x34')]=_[_0x0c62('0x32')](_0x5c0ae4[_0x0c62('0x2e')],qs[_0x0c62('0x33')](_0x5d631d[_0x0c62('0x30')][_0x0c62('0x33')]));_0x20081e[_0x0c62('0x34')]=_0x20081e['attributes'][_0x0c62('0x35')]?_0x20081e[_0x0c62('0x34')]:_0x5c0ae4[_0x0c62('0x2e')];if(_0x5d631d[_0x0c62('0x30')][_0x0c62('0x3e')]){_0x20081e[_0x0c62('0x3f')]=[{'all':!![]}];}_0x20081e=_[_0x0c62('0x3a')]({},_0x20081e,_0x5d631d[_0x0c62('0x3b')]);return db['FreshsalesField'][_0x0c62('0x45')](_0x20081e)[_0x0c62('0x3d')](handleEntityNotFound(_0x45b199,null))[_0x0c62('0x3d')](respondWithResult(_0x45b199,null))[_0x0c62('0x42')](handleError(_0x45b199,null));};exports[_0x0c62('0x46')]=function(_0x52dd3b,_0x21fa65){return db[_0x0c62('0x3c')][_0x0c62('0x46')](_0x52dd3b['body'],{})['then'](respondWithResult(_0x21fa65,0xc9))[_0x0c62('0x42')](handleError(_0x21fa65,null));};exports[_0x0c62('0x25')]=function(_0x2ac0f5,_0x276c02){if(_0x2ac0f5['body']['id']){delete _0x2ac0f5['body']['id'];}return db[_0x0c62('0x3c')][_0x0c62('0x45')]({'where':{'id':_0x2ac0f5[_0x0c62('0x44')]['id']}})['then'](handleEntityNotFound(_0x276c02,null))[_0x0c62('0x3d')](saveUpdates(_0x2ac0f5[_0x0c62('0x47')],null))[_0x0c62('0x3d')](respondWithResult(_0x276c02,null))['catch'](handleError(_0x276c02,null));};exports[_0x0c62('0x48')]=function(_0x2f91d5,_0x47399c){return db[_0x0c62('0x3c')][_0x0c62('0x45')]({'where':{'id':_0x2f91d5[_0x0c62('0x44')]['id']}})[_0x0c62('0x3d')](handleEntityNotFound(_0x47399c,null))[_0x0c62('0x3d')](removeEntity(_0x47399c,null))[_0x0c62('0x42')](handleError(_0x47399c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index fea10c0..e541889 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 _0xaaee=['FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x18bf22,_0x3517ce){var _0x13c5dc=function(_0x45c65a){while(--_0x45c65a){_0x18bf22['push'](_0x18bf22['shift']());}};_0x13c5dc(++_0x3517ce);}(_0xaaee,0xa9));var _0xeaae=function(_0xa527d2,_0x23c3d4){_0xa527d2=_0xa527d2-0x0;var _0x3eaa20=_0xaaee[_0xa527d2];return _0x3eaa20;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var logger=require(_0xeaae('0x1'))(_0xeaae('0x2'));var moment=require('moment');var BPromise=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var fs=require('fs');var path=require(_0xeaae('0x5'));var rimraf=require(_0xeaae('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaae('0x7'));module[_0xeaae('0x8')]=function(_0x213422,_0x45c104){return _0x213422[_0xeaae('0x9')](_0xeaae('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xeaae('0xb'),'fields':[_0xeaae('0xc'),_0xeaae('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd732=['bluebird','request-promise','../../config/environment','exports','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xd732,0x18e));var _0x2d73=function(_0x2b3f9b,_0x1f85c4){_0x2b3f9b=_0x2b3f9b-0x0;var _0x1c4acc=_0xd732[_0x2b3f9b];return _0x1c4acc;};'use strict';var _=require(_0x2d73('0x0'));var util=require('util');var logger=require(_0x2d73('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2d73('0x2'));var rp=require(_0x2d73('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2d73('0x4'));var attributes=require('./intFreshsalesField.attributes');module[_0x2d73('0x5')]=function(_0x11aa83,_0x47d40d){return _0x11aa83['define'](_0x2d73('0x6'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x2d73('0x7'),'fields':[_0x2d73('0x8'),_0x2d73('0x9')],'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 bfee728..facc787 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 _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dbaa6,_0x28e5c0){var _0x3128fb=function(_0x23507a){while(--_0x23507a){_0x2dbaa6['push'](_0x2dbaa6['shift']());}};_0x3128fb(++_0x28e5c0);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x536540,_0x4fa89e){var _0x2341ef=function(_0x2ca6b0){while(--_0x2ca6b0){_0x536540['push'](_0x536540['shift']());}};_0x2341ef(++_0x4fa89e);}(_0xba34,0x119));var _0x4ba3=function(_0x21ed89,_0x7ed88d){_0x21ed89=_0x21ed89-0x0;var _0x4c1578=_0xba34[_0x21ed89];return _0x4c1578;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5070d01..830ef07 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(_0x2bf9f8,_0x419118){var _0x58c859=function(_0x4ba048){while(--_0x4ba048){_0x2bf9f8['push'](_0x2bf9f8['shift']());}};_0x58c859(++_0x419118);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4b76fe,_0x42045b){var _0x305149=function(_0x2f8de3){while(--_0x2f8de3){_0x4b76fe['push'](_0x4b76fe['shift']());}};_0x305149(++_0x42045b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9a09e1f..86624d0 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 _0xe635=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x3f4aee,_0x3114c5){var _0x327bc8=function(_0x49702e){while(--_0x49702e){_0x3f4aee['push'](_0x3f4aee['shift']());}};_0x327bc8(++_0x3114c5);}(_0xe635,0x1be));var _0x5e63=function(_0x360681,_0xd973a2){_0x360681=_0x360681-0x0;var _0x2abca7=_0xe635[_0x360681];return _0x2abca7;};'use strict';var Sequelize=require(_0x5e63('0x0'));module[_0x5e63('0x1')]={'name':{'type':Sequelize[_0x5e63('0x2')]},'description':{'type':Sequelize[_0x5e63('0x2')]},'username':{'type':Sequelize[_0x5e63('0x2')],'unique':_0x5e63('0x3')},'remoteUri':{'type':Sequelize[_0x5e63('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5e63('0x2')]},'securityToken':{'type':Sequelize[_0x5e63('0x2')]},'serverUrl':{'type':Sequelize[_0x5e63('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5e63('0x4')](_0x5e63('0x5'),_0x5e63('0x6')),'defaultValue':_0x5e63('0x5')}}; \ No newline at end of file +var _0x97db=['STRING','username','ENUM','integrationTab','sequelize','exports'];(function(_0x9709ce,_0x5765af){var _0x414c87=function(_0x51149b){while(--_0x51149b){_0x9709ce['push'](_0x9709ce['shift']());}};_0x414c87(++_0x5765af);}(_0x97db,0x1b4));var _0xb97d=function(_0x4cfde5,_0x3b9d20){_0x4cfde5=_0x4cfde5-0x0;var _0x36408e=_0x97db[_0x4cfde5];return _0x36408e;};'use strict';var Sequelize=require(_0xb97d('0x0'));module[_0xb97d('0x1')]={'name':{'type':Sequelize[_0xb97d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xb97d('0x3')},'remoteUri':{'type':Sequelize[_0xb97d('0x2')]},'password':{'type':Sequelize[_0xb97d('0x2')]},'clientId':{'type':Sequelize[_0xb97d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb97d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb97d('0x4')]('integrationTab','newTab'),'defaultValue':_0xb97d('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 1c57068..606b880 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 _0xe341=['order','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','substring','login','password','concat','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','map','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','status','error','stack','name','send','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','rows','catch','params','rawAttributes','include','find','create','body','destroy','findOne','SalesforceConfiguration'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xe341,0x18c));var _0x1e34=function(_0x192a5a,_0x1a4bfc){_0x192a5a=_0x192a5a-0x0;var _0x16d5b1=_0xe341[_0x192a5a];return _0x16d5b1;};'use strict';var emlformat=require(_0x1e34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e34('0x2'));var moment=require(_0x1e34('0x3'));var BPromise=require(_0x1e34('0x4'));var Mustache=require(_0x1e34('0x5'));var util=require('util');var path=require(_0x1e34('0x6'));var sox=require('sox');var csv=require(_0x1e34('0x7'));var ejs=require(_0x1e34('0x8'));var fs=require('fs');var fs_extra=require(_0x1e34('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e34('0xa'));var jsforce=require(_0x1e34('0xb'));var deskjs=require(_0x1e34('0xc'));var toCsv=require(_0x1e34('0x7'));var querystring=require('querystring');var Papa=require(_0x1e34('0xd'));var Redis=require('ioredis');var authService=require(_0x1e34('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1e34('0xf'));var hardwareService=require(_0x1e34('0x10'));var logger=require(_0x1e34('0x11'))(_0x1e34('0x12'));var utils=require(_0x1e34('0x13'));var config=require(_0x1e34('0x14'));var licenseUtil=require(_0x1e34('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x478e01,_0x5316b8){_0x5316b8=_0x5316b8||0xcc;return function(_0x4908a8){if(_0x4908a8){return _0x478e01[_0x1e34('0x16')](_0x5316b8);}return _0x478e01['status'](_0x5316b8)[_0x1e34('0x17')]();};}function respondWithResult(_0x2e31ed,_0x962785){_0x962785=_0x962785||0xc8;return function(_0xe11e3){if(_0xe11e3){return _0x2e31ed['status'](_0x962785)[_0x1e34('0x18')](_0xe11e3);}};}function respondWithFilteredResult(_0x247402,_0x44b694){return function(_0x1e7373){if(_0x1e7373){var _0x190896=typeof _0x44b694[_0x1e34('0x19')]==='undefined'&&typeof _0x44b694['limit']===_0x1e34('0x1a');var _0x283e38=_0x1e7373[_0x1e34('0x1b')];var _0x4b8e74=_0x190896?0x0:_0x44b694['offset'];var _0x1cef5d=_0x190896?_0x1e7373[_0x1e34('0x1b')]:_0x44b694[_0x1e34('0x19')]+_0x44b694[_0x1e34('0x1c')];var _0x12b15b;if(_0x1cef5d>=_0x283e38){_0x1cef5d=_0x283e38;_0x12b15b=0xc8;}else{_0x12b15b=0xce;}_0x247402['status'](_0x12b15b);return _0x247402[_0x1e34('0x1d')](_0x1e34('0x1e'),_0x4b8e74+'-'+_0x1cef5d+'/'+_0x283e38)[_0x1e34('0x18')](_0x1e7373);}return null;};}function patchUpdates(_0x12aab0){return function(_0x52cb38){try{jsonpatch[_0x1e34('0x1f')](_0x52cb38,_0x12aab0,!![]);}catch(_0x30c0be){return BPromise['reject'](_0x30c0be);}return _0x52cb38[_0x1e34('0x20')]();};}function saveUpdates(_0x1c2b83,_0x37f0c8){return function(_0x2d13a4){if(_0x2d13a4){return _0x2d13a4[_0x1e34('0x21')](_0x1c2b83)[_0x1e34('0x22')](function(_0x2a4601){return _0x2a4601;});}return null;};}function removeEntity(_0x17062a,_0x1763f4){return function(_0x41846e){if(_0x41846e){return _0x41846e['destroy']()[_0x1e34('0x22')](function(){_0x17062a[_0x1e34('0x23')](0xcc)[_0x1e34('0x17')]();});}};}function handleEntityNotFound(_0x204e58,_0x1aab86){return function(_0x352d17){if(!_0x352d17){_0x204e58[_0x1e34('0x16')](0x194);}return _0x352d17;};}function handleError(_0x502f6c,_0x12abff){_0x12abff=_0x12abff||0x1f4;return function(_0x3bcc8b){logger[_0x1e34('0x24')](_0x3bcc8b[_0x1e34('0x25')]);if(_0x3bcc8b[_0x1e34('0x26')]){delete _0x3bcc8b[_0x1e34('0x26')];}_0x502f6c['status'](_0x12abff)[_0x1e34('0x27')](_0x3bcc8b);};}exports['index']=function(_0x3c3c17,_0x1dedcc){var _0xc4bd60={},_0x1bb972={},_0x941c6c={'count':0x0,'rows':[]};var _0x5ae9a3=_['map'](db[_0x1e34('0x28')]['rawAttributes'],function(_0x2224e5){return{'name':_0x2224e5[_0x1e34('0x29')],'type':_0x2224e5[_0x1e34('0x2a')][_0x1e34('0x2b')]};});_0x1bb972[_0x1e34('0x2c')]=_['map'](_0x5ae9a3,_0x1e34('0x26'));_0x1bb972[_0x1e34('0x2d')]=_[_0x1e34('0x2e')](_0x3c3c17[_0x1e34('0x2d')]);_0x1bb972[_0x1e34('0x2f')]=_['intersection'](_0x1bb972['model'],_0x1bb972[_0x1e34('0x2d')]);_0xc4bd60['attributes']=_[_0x1e34('0x30')](_0x1bb972[_0x1e34('0x2c')],qs[_0x1e34('0x31')](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x31')]));_0xc4bd60['attributes']=_0xc4bd60[_0x1e34('0x32')][_0x1e34('0x33')]?_0xc4bd60['attributes']:_0x1bb972[_0x1e34('0x2c')];if(!_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x34')](_0x1e34('0x35'))){_0xc4bd60['limit']=qs[_0x1e34('0x1c')](_0x3c3c17[_0x1e34('0x2d')]['limit']);_0xc4bd60[_0x1e34('0x19')]=qs['offset'](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x19')]);}_0xc4bd60['order']=qs[_0x1e34('0x36')](_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x36')]);_0xc4bd60['where']=qs[_0x1e34('0x2f')](_[_0x1e34('0x37')](_0x3c3c17[_0x1e34('0x2d')],_0x1bb972['filters']),_0x5ae9a3);if(_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x38')]){_0xc4bd60[_0x1e34('0x39')]=_['merge'](_0xc4bd60['where'],{'$or':_['map'](_0x5ae9a3,function(_0x4ccead){if(_0x4ccead[_0x1e34('0x2a')]!==_0x1e34('0x3a')){var _0x45b2d1={};_0x45b2d1[_0x4ccead[_0x1e34('0x26')]]={'$like':'%'+_0x3c3c17[_0x1e34('0x2d')][_0x1e34('0x38')]+'%'};return _0x45b2d1;}})});}_0xc4bd60=_[_0x1e34('0x3b')]({},_0xc4bd60,_0x3c3c17[_0x1e34('0x3c')]);var _0x51d0cb={'where':_0xc4bd60[_0x1e34('0x39')]};return db[_0x1e34('0x28')][_0x1e34('0x1b')](_0x51d0cb)[_0x1e34('0x22')](function(_0x16b953){_0x941c6c[_0x1e34('0x1b')]=_0x16b953;if(_0x3c3c17[_0x1e34('0x2d')]['includeAll']){_0xc4bd60['include']=[{'all':!![]}];}return db[_0x1e34('0x28')]['findAll'](_0xc4bd60);})[_0x1e34('0x22')](function(_0x58c270){_0x941c6c[_0x1e34('0x3d')]=_0x58c270;return _0x941c6c;})[_0x1e34('0x22')](respondWithFilteredResult(_0x1dedcc,_0xc4bd60))[_0x1e34('0x3e')](handleError(_0x1dedcc,null));};exports['show']=function(_0x535f5f,_0x4bbe27){var _0x4f758f={'raw':![],'where':{'id':_0x535f5f[_0x1e34('0x3f')]['id']}},_0x585c8e={};_0x585c8e[_0x1e34('0x2c')]=_[_0x1e34('0x2e')](db['SalesforceAccount'][_0x1e34('0x40')]);_0x585c8e['query']=_['keys'](_0x535f5f[_0x1e34('0x2d')]);_0x585c8e[_0x1e34('0x2f')]=_[_0x1e34('0x30')](_0x585c8e[_0x1e34('0x2c')],_0x585c8e[_0x1e34('0x2d')]);_0x4f758f[_0x1e34('0x32')]=_['intersection'](_0x585c8e[_0x1e34('0x2c')],qs['fields'](_0x535f5f[_0x1e34('0x2d')]['fields']));_0x4f758f[_0x1e34('0x32')]=_0x4f758f[_0x1e34('0x32')][_0x1e34('0x33')]?_0x4f758f[_0x1e34('0x32')]:_0x585c8e['model'];if(_0x535f5f[_0x1e34('0x2d')]['includeAll']){_0x4f758f[_0x1e34('0x41')]=[{'all':!![]}];}_0x4f758f=_[_0x1e34('0x3b')]({},_0x4f758f,_0x535f5f['options']);return db['SalesforceAccount'][_0x1e34('0x42')](_0x4f758f)[_0x1e34('0x22')](handleEntityNotFound(_0x4bbe27,null))['then'](respondWithResult(_0x4bbe27,null))[_0x1e34('0x3e')](handleError(_0x4bbe27,null));};exports['create']=function(_0x4bae55,_0x1d241c){return db['SalesforceAccount'][_0x1e34('0x43')](_0x4bae55['body'],{})[_0x1e34('0x22')](respondWithResult(_0x1d241c,0xc9))['catch'](handleError(_0x1d241c,null));};exports[_0x1e34('0x21')]=function(_0x360d43,_0x1ce4c4){if(_0x360d43['body']['id']){delete _0x360d43[_0x1e34('0x44')]['id'];}return db[_0x1e34('0x28')]['find']({'where':{'id':_0x360d43[_0x1e34('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1ce4c4,null))[_0x1e34('0x22')](saveUpdates(_0x360d43['body'],null))['then'](respondWithResult(_0x1ce4c4,null))[_0x1e34('0x3e')](handleError(_0x1ce4c4,null));};exports[_0x1e34('0x45')]=function(_0x5cb858,_0x41272a){return db['SalesforceAccount'][_0x1e34('0x42')]({'where':{'id':_0x5cb858['params']['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x41272a,null))[_0x1e34('0x22')](removeEntity(_0x41272a,null))[_0x1e34('0x3e')](handleError(_0x41272a,null));};exports['getConfigurations']=function(_0x21e8a2,_0x98dcb3,_0x392633){var _0xe06a47={};var _0x517aba={};var _0x29ae09;var _0x51a3bb;return db[_0x1e34('0x28')][_0x1e34('0x46')]({'where':{'id':_0x21e8a2[_0x1e34('0x3f')]['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x98dcb3,null))[_0x1e34('0x22')](function(_0x2445a8){if(_0x2445a8){_0x29ae09=_0x2445a8;_0x517aba['model']=_[_0x1e34('0x2e')](db[_0x1e34('0x47')][_0x1e34('0x40')]);_0x517aba['query']=_['keys'](_0x21e8a2[_0x1e34('0x2d')]);_0x517aba[_0x1e34('0x2f')]=_['intersection'](_0x517aba['model'],_0x517aba[_0x1e34('0x2d')]);_0xe06a47[_0x1e34('0x32')]=_[_0x1e34('0x30')](_0x517aba[_0x1e34('0x2c')],qs[_0x1e34('0x31')](_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x31')]));_0xe06a47['attributes']=_0xe06a47[_0x1e34('0x32')]['length']?_0xe06a47['attributes']:_0x517aba['model'];_0xe06a47[_0x1e34('0x48')]=qs[_0x1e34('0x36')](_0x21e8a2['query'][_0x1e34('0x36')]);_0xe06a47['where']=qs[_0x1e34('0x2f')](_['pick'](_0x21e8a2[_0x1e34('0x2d')],_0x517aba[_0x1e34('0x2f')]));if(_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x38')]){_0xe06a47['where']=_[_0x1e34('0x3b')](_0xe06a47[_0x1e34('0x39')],{'$or':_['map'](_0xe06a47['attributes'],function(_0x2adbe6){var _0x1efc4d={};_0x1efc4d[_0x2adbe6]={'$like':'%'+_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x38')]+'%'};return _0x1efc4d;})});}_0xe06a47=_[_0x1e34('0x3b')]({},_0xe06a47,_0x21e8a2[_0x1e34('0x3c')]);return _0x29ae09['getConfigurations'](_0xe06a47);}})[_0x1e34('0x22')](function(_0x31ff4e){if(_0x31ff4e){_0x51a3bb=_0x31ff4e[_0x1e34('0x33')];if(!_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x34')](_0x1e34('0x35'))){_0xe06a47['limit']=qs[_0x1e34('0x1c')](_0x21e8a2[_0x1e34('0x2d')][_0x1e34('0x1c')]);_0xe06a47[_0x1e34('0x19')]=qs[_0x1e34('0x19')](_0x21e8a2['query'][_0x1e34('0x19')]);}return _0x29ae09[_0x1e34('0x49')](_0xe06a47);}})[_0x1e34('0x22')](function(_0x20e898){if(_0x20e898){return _0x20e898?{'count':_0x51a3bb,'rows':_0x20e898}:null;}})['then'](respondWithResult(_0x98dcb3,null))[_0x1e34('0x3e')](handleError(_0x98dcb3,null));};exports['addConfiguration']=function(_0x591011,_0x2ace13,_0x3fa65c){if(_0x591011[_0x1e34('0x44')]['id']){delete _0x591011[_0x1e34('0x44')]['id'];}return db[_0x1e34('0x28')][_0x1e34('0x46')]({'where':{'id':_0x591011['params']['id']}})[_0x1e34('0x22')](handleEntityNotFound(_0x2ace13,null))[_0x1e34('0x22')](function(_0x590659){if(_0x590659){_0x591011['body'][_0x1e34('0x4a')]=_0x590659['id'];_0x591011['body'][_0x1e34('0x4b')]=integrations[_0x1e34('0x4c')](_0x591011[_0x1e34('0x44')]['channel'],_0x591011['body']['type']);_0x591011[_0x1e34('0x44')][_0x1e34('0x4d')]=integrations[_0x1e34('0x4e')](_0x591011[_0x1e34('0x44')]['channel'],_0x591011[_0x1e34('0x44')][_0x1e34('0x2a')]);return db['SalesforceConfiguration'][_0x1e34('0x43')](_0x591011['body'],{'include':[{'model':db[_0x1e34('0x4f')],'as':'Subjects'},{'model':db[_0x1e34('0x4f')],'as':_0x1e34('0x4d')}]});}return null;})[_0x1e34('0x22')](respondWithResult(_0x2ace13,null))[_0x1e34('0x3e')](handleError(_0x2ace13,null));};exports[_0x1e34('0x50')]=function(_0x1fb226,_0x520eeb,_0x2db8a7){var _0x23b104;var _0x26bf65='';var _0x5d1ecf='Task';return db[_0x1e34('0x28')]['findOne']({'where':{'id':_0x1fb226[_0x1e34('0x3f')]['id']},'attributes':['id',_0x1e34('0x51'),_0x1e34('0x52'),_0x1e34('0x53'),_0x1e34('0x54'),'password','securityToken']})['then'](handleEntityNotFound(_0x520eeb,null))['then'](function(_0x3725fe){if(_0x3725fe){_0x26bf65=_0x3725fe['remoteUri'];var _0x3857ef=_0x26bf65['slice'](-0x1);if(_0x3857ef==='/'){_0x26bf65=_0x26bf65[_0x1e34('0x55')](0x0,_0x26bf65['lastIndexOf'](_0x3857ef));}_0x23b104=new jsforce['Connection']({'oauth2':{'loginUrl':_0x26bf65,'clientId':_0x3725fe[_0x1e34('0x52')],'clientSecret':_0x3725fe[_0x1e34('0x53')]}});return _0x23b104[_0x1e34('0x56')](_0x3725fe[_0x1e34('0x54')],_0x3725fe[_0x1e34('0x57')][_0x1e34('0x58')](_0x3725fe[_0x1e34('0x59')]));}})[_0x1e34('0x22')](function(_0x189c04){if(_0x189c04){if(!_[_0x1e34('0x5a')](_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x5b')])){_0x5d1ecf=_0x1fb226['query'][_0x1e34('0x5b')];}return _0x23b104[_0x1e34('0x5c')](_0x5d1ecf)[_0x1e34('0x5d')]();}})[_0x1e34('0x22')](function(_0x2ba70a){var _0x406737=['OwnerId',_0x1e34('0x5e'),'IsReminderSet',_0x1e34('0x5f'),_0x1e34('0x60'),'Description'];var _0x42a849=[_0x1e34('0x61'),_0x1e34('0x62'),_0x1e34('0x63'),'boolean',_0x1e34('0x64'),_0x1e34('0x65'),_0x1e34('0x66')];if(_0x2ba70a){_[_0x1e34('0x67')](_0x2ba70a[_0x1e34('0x31')],function(_0x5ae2bf){return _0x406737[_0x1e34('0x68')](_0x5ae2bf['name'])||!_0x42a849['includes'](_0x5ae2bf[_0x1e34('0x2a')]);});return{'count':_0x2ba70a[_0x1e34('0x31')][_0x1e34('0x33')],'rows':_['map'](_0x2ba70a[_0x1e34('0x31')],function(_0x4699b7){return{'id':_0x4699b7['name'],'name':_0x4699b7[_0x1e34('0x69')],'custom':_0x4699b7[_0x1e34('0x6a')],'options':_0x4699b7[_0x1e34('0x6b')][_0x1e34('0x33')]>0x0?_[_0x1e34('0x6c')](_0x4699b7[_0x1e34('0x6b')],function(_0x3a1b4d){return{'name':_0x3a1b4d[_0x1e34('0x69')],'value':_0x3a1b4d[_0x1e34('0x6d')]};}):_0x4699b7[_0x1e34('0x2a')]==_0x1e34('0x6e')?[{'name':_0x1e34('0x6f'),'value':_0x1e34('0x70')},{'name':_0x1e34('0x71'),'value':'false'}]:[]};})};}})[_0x1e34('0x22')](respondWithResult(_0x520eeb,null))[_0x1e34('0x3e')](function(_0x3bd261){var _0x341a6b=_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x72')]?0x1f4:_0x3bd261['statusCode']||0x1f4;logger[_0x1e34('0x24')](_0x1e34('0x73'),_0x1e34('0x50'),_0x341a6b,JSON['stringify'](_0x3bd261));delete _0x3bd261[_0x1e34('0x26')];if(_0x341a6b===0x191){_0x341a6b=0x190;}_0x520eeb[_0x1e34('0x23')](_0x341a6b)['send'](_0x1fb226[_0x1e34('0x2d')][_0x1e34('0x72')]?{'message':_0x1e34('0x74'),'statusCode':_0x3bd261['statusCode']}:_0x3bd261);});}; \ No newline at end of file +var _0xd5f9=['getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','clientId','clientSecret','username','securityToken','remoteUri','slice','lastIndexOf','Connection','login','password','isNil','ticketType','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','boolean','email','textarea','includes','label','custom','picklistValues','value','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','fast-json-patch','moment','mustache','path','sox','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','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','set','reject','save','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','update','params','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects'];(function(_0x1d420a,_0x35ca13){var _0x205173=function(_0x3f8682){while(--_0x3f8682){_0x1d420a['push'](_0x1d420a['shift']());}};_0x205173(++_0x35ca13);}(_0xd5f9,0x1ec));var _0x9d5f=function(_0x1ad53d,_0x3067eb){_0x1ad53d=_0x1ad53d-0x0;var _0x57df8d=_0xd5f9[_0x1ad53d];return _0x57df8d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9d5f('0x0'));var rp=require('request-promise');var moment=require(_0x9d5f('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x9d5f('0x2'));var util=require('util');var path=require(_0x9d5f('0x3'));var sox=require(_0x9d5f('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d5f('0x5'));var squel=require(_0x9d5f('0x6'));var crypto=require(_0x9d5f('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x9d5f('0x8'));var toCsv=require(_0x9d5f('0x9'));var querystring=require(_0x9d5f('0xa'));var Papa=require(_0x9d5f('0xb'));var Redis=require('ioredis');var authService=require(_0x9d5f('0xc'));var qs=require(_0x9d5f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d5f('0xe'));var logger=require('../../config/logger')(_0x9d5f('0xf'));var utils=require(_0x9d5f('0x10'));var config=require(_0x9d5f('0x11'));var licenseUtil=require(_0x9d5f('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9d5f('0x13'));function respondWithStatusCode(_0x2d0e9c,_0x6ddec5){_0x6ddec5=_0x6ddec5||0xcc;return function(_0x39f692){if(_0x39f692){return _0x2d0e9c[_0x9d5f('0x14')](_0x6ddec5);}return _0x2d0e9c['status'](_0x6ddec5)[_0x9d5f('0x15')]();};}function respondWithResult(_0x565a4a,_0x589208){_0x589208=_0x589208||0xc8;return function(_0x3f047e){if(_0x3f047e){return _0x565a4a[_0x9d5f('0x16')](_0x589208)[_0x9d5f('0x17')](_0x3f047e);}};}function respondWithFilteredResult(_0x49b916,_0x4f8f64){return function(_0x51bfe0){if(_0x51bfe0){var _0x39ddf2=typeof _0x4f8f64['offset']==='undefined'&&typeof _0x4f8f64[_0x9d5f('0x18')]===_0x9d5f('0x19');var _0xa8f976=_0x51bfe0[_0x9d5f('0x1a')];var _0xb2776b=_0x39ddf2?0x0:_0x4f8f64['offset'];var _0x2ec104=_0x39ddf2?_0x51bfe0[_0x9d5f('0x1a')]:_0x4f8f64[_0x9d5f('0x1b')]+_0x4f8f64[_0x9d5f('0x18')];var _0x32e149;if(_0x2ec104>=_0xa8f976){_0x2ec104=_0xa8f976;_0x32e149=0xc8;}else{_0x32e149=0xce;}_0x49b916['status'](_0x32e149);return _0x49b916[_0x9d5f('0x1c')]('Content-Range',_0xb2776b+'-'+_0x2ec104+'/'+_0xa8f976)[_0x9d5f('0x17')](_0x51bfe0);}return null;};}function patchUpdates(_0x343b51){return function(_0x21e19f){try{jsonpatch['apply'](_0x21e19f,_0x343b51,!![]);}catch(_0x1ba87f){return BPromise[_0x9d5f('0x1d')](_0x1ba87f);}return _0x21e19f[_0x9d5f('0x1e')]();};}function saveUpdates(_0x7e6c70,_0x11fc30){return function(_0x2cd09b){if(_0x2cd09b){return _0x2cd09b['update'](_0x7e6c70)[_0x9d5f('0x1f')](function(_0x2e8f8f){return _0x2e8f8f;});}return null;};}function removeEntity(_0x538b0c,_0x2da61e){return function(_0x2466db){if(_0x2466db){return _0x2466db[_0x9d5f('0x20')]()['then'](function(){_0x538b0c[_0x9d5f('0x16')](0xcc)[_0x9d5f('0x15')]();});}};}function handleEntityNotFound(_0x2560bf,_0x2b176b){return function(_0x5e2fe2){if(!_0x5e2fe2){_0x2560bf[_0x9d5f('0x14')](0x194);}return _0x5e2fe2;};}function handleError(_0x1940f5,_0x260c1e){_0x260c1e=_0x260c1e||0x1f4;return function(_0x48879a){logger[_0x9d5f('0x21')](_0x48879a[_0x9d5f('0x22')]);if(_0x48879a[_0x9d5f('0x23')]){delete _0x48879a[_0x9d5f('0x23')];}_0x1940f5[_0x9d5f('0x16')](_0x260c1e)[_0x9d5f('0x24')](_0x48879a);};}exports[_0x9d5f('0x25')]=function(_0x3c6269,_0x200781){var _0x1e2ded={},_0x291b00={},_0x4661bb={'count':0x0,'rows':[]};var _0x1b3f12=_[_0x9d5f('0x26')](db[_0x9d5f('0x27')][_0x9d5f('0x28')],function(_0x47ecd9){return{'name':_0x47ecd9['fieldName'],'type':_0x47ecd9['type'][_0x9d5f('0x29')]};});_0x291b00['model']=_['map'](_0x1b3f12,_0x9d5f('0x23'));_0x291b00[_0x9d5f('0x2a')]=_[_0x9d5f('0x2b')](_0x3c6269[_0x9d5f('0x2a')]);_0x291b00[_0x9d5f('0x2c')]=_['intersection'](_0x291b00[_0x9d5f('0x2d')],_0x291b00['query']);_0x1e2ded['attributes']=_[_0x9d5f('0x2e')](_0x291b00[_0x9d5f('0x2d')],qs[_0x9d5f('0x2f')](_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x2f')]));_0x1e2ded[_0x9d5f('0x30')]=_0x1e2ded[_0x9d5f('0x30')][_0x9d5f('0x31')]?_0x1e2ded[_0x9d5f('0x30')]:_0x291b00[_0x9d5f('0x2d')];if(!_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x32')](_0x9d5f('0x33'))){_0x1e2ded['limit']=qs[_0x9d5f('0x18')](_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x18')]);_0x1e2ded[_0x9d5f('0x1b')]=qs[_0x9d5f('0x1b')](_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x1b')]);}_0x1e2ded[_0x9d5f('0x34')]=qs[_0x9d5f('0x35')](_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x35')]);_0x1e2ded[_0x9d5f('0x36')]=qs[_0x9d5f('0x2c')](_['pick'](_0x3c6269[_0x9d5f('0x2a')],_0x291b00[_0x9d5f('0x2c')]),_0x1b3f12);if(_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x37')]){_0x1e2ded['where']=_[_0x9d5f('0x38')](_0x1e2ded['where'],{'$or':_['map'](_0x1b3f12,function(_0x1198a7){if(_0x1198a7['type']!==_0x9d5f('0x39')){var _0x455b38={};_0x455b38[_0x1198a7[_0x9d5f('0x23')]]={'$like':'%'+_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x37')]+'%'};return _0x455b38;}})});}_0x1e2ded=_[_0x9d5f('0x38')]({},_0x1e2ded,_0x3c6269[_0x9d5f('0x3a')]);var _0x2460e7={'where':_0x1e2ded[_0x9d5f('0x36')]};return db['SalesforceAccount'][_0x9d5f('0x1a')](_0x2460e7)[_0x9d5f('0x1f')](function(_0x14723f){_0x4661bb[_0x9d5f('0x1a')]=_0x14723f;if(_0x3c6269[_0x9d5f('0x2a')][_0x9d5f('0x3b')]){_0x1e2ded[_0x9d5f('0x3c')]=[{'all':!![]}];}return db[_0x9d5f('0x27')]['findAll'](_0x1e2ded);})[_0x9d5f('0x1f')](function(_0x406684){_0x4661bb[_0x9d5f('0x3d')]=_0x406684;return _0x4661bb;})[_0x9d5f('0x1f')](respondWithFilteredResult(_0x200781,_0x1e2ded))[_0x9d5f('0x3e')](handleError(_0x200781,null));};exports['show']=function(_0x1a184e,_0x243cb6){var _0x42792d={'raw':![],'where':{'id':_0x1a184e['params']['id']}},_0x288258={};_0x288258[_0x9d5f('0x2d')]=_[_0x9d5f('0x2b')](db[_0x9d5f('0x27')][_0x9d5f('0x28')]);_0x288258[_0x9d5f('0x2a')]=_[_0x9d5f('0x2b')](_0x1a184e['query']);_0x288258[_0x9d5f('0x2c')]=_[_0x9d5f('0x2e')](_0x288258[_0x9d5f('0x2d')],_0x288258['query']);_0x42792d[_0x9d5f('0x30')]=_['intersection'](_0x288258[_0x9d5f('0x2d')],qs[_0x9d5f('0x2f')](_0x1a184e[_0x9d5f('0x2a')][_0x9d5f('0x2f')]));_0x42792d[_0x9d5f('0x30')]=_0x42792d[_0x9d5f('0x30')]['length']?_0x42792d[_0x9d5f('0x30')]:_0x288258['model'];if(_0x1a184e[_0x9d5f('0x2a')]['includeAll']){_0x42792d['include']=[{'all':!![]}];}_0x42792d=_[_0x9d5f('0x38')]({},_0x42792d,_0x1a184e[_0x9d5f('0x3a')]);return db[_0x9d5f('0x27')][_0x9d5f('0x3f')](_0x42792d)[_0x9d5f('0x1f')](handleEntityNotFound(_0x243cb6,null))[_0x9d5f('0x1f')](respondWithResult(_0x243cb6,null))['catch'](handleError(_0x243cb6,null));};exports[_0x9d5f('0x40')]=function(_0x5aced4,_0x5a548f){return db[_0x9d5f('0x27')][_0x9d5f('0x40')](_0x5aced4[_0x9d5f('0x41')],{})[_0x9d5f('0x1f')](respondWithResult(_0x5a548f,0xc9))[_0x9d5f('0x3e')](handleError(_0x5a548f,null));};exports[_0x9d5f('0x42')]=function(_0x579b0d,_0x564d02){if(_0x579b0d[_0x9d5f('0x41')]['id']){delete _0x579b0d[_0x9d5f('0x41')]['id'];}return db[_0x9d5f('0x27')][_0x9d5f('0x3f')]({'where':{'id':_0x579b0d[_0x9d5f('0x43')]['id']}})[_0x9d5f('0x1f')](handleEntityNotFound(_0x564d02,null))[_0x9d5f('0x1f')](saveUpdates(_0x579b0d[_0x9d5f('0x41')],null))[_0x9d5f('0x1f')](respondWithResult(_0x564d02,null))[_0x9d5f('0x3e')](handleError(_0x564d02,null));};exports['destroy']=function(_0x127db6,_0x3473ec){return db['SalesforceAccount']['find']({'where':{'id':_0x127db6['params']['id']}})['then'](handleEntityNotFound(_0x3473ec,null))['then'](removeEntity(_0x3473ec,null))['catch'](handleError(_0x3473ec,null));};exports[_0x9d5f('0x44')]=function(_0x2cc054,_0x4a3555,_0x2922de){var _0x345b13={};var _0x1e0f38={};var _0x35b3fb;var _0x2844d6;return db['SalesforceAccount'][_0x9d5f('0x45')]({'where':{'id':_0x2cc054['params']['id']}})['then'](handleEntityNotFound(_0x4a3555,null))[_0x9d5f('0x1f')](function(_0xfdfe0d){if(_0xfdfe0d){_0x35b3fb=_0xfdfe0d;_0x1e0f38[_0x9d5f('0x2d')]=_['keys'](db[_0x9d5f('0x46')][_0x9d5f('0x28')]);_0x1e0f38[_0x9d5f('0x2a')]=_[_0x9d5f('0x2b')](_0x2cc054[_0x9d5f('0x2a')]);_0x1e0f38[_0x9d5f('0x2c')]=_['intersection'](_0x1e0f38[_0x9d5f('0x2d')],_0x1e0f38[_0x9d5f('0x2a')]);_0x345b13[_0x9d5f('0x30')]=_[_0x9d5f('0x2e')](_0x1e0f38['model'],qs[_0x9d5f('0x2f')](_0x2cc054['query'][_0x9d5f('0x2f')]));_0x345b13[_0x9d5f('0x30')]=_0x345b13['attributes'][_0x9d5f('0x31')]?_0x345b13['attributes']:_0x1e0f38[_0x9d5f('0x2d')];_0x345b13[_0x9d5f('0x34')]=qs[_0x9d5f('0x35')](_0x2cc054[_0x9d5f('0x2a')][_0x9d5f('0x35')]);_0x345b13[_0x9d5f('0x36')]=qs['filters'](_['pick'](_0x2cc054['query'],_0x1e0f38['filters']));if(_0x2cc054[_0x9d5f('0x2a')][_0x9d5f('0x37')]){_0x345b13['where']=_[_0x9d5f('0x38')](_0x345b13['where'],{'$or':_[_0x9d5f('0x26')](_0x345b13[_0x9d5f('0x30')],function(_0x168cf8){var _0x16920c={};_0x16920c[_0x168cf8]={'$like':'%'+_0x2cc054['query'][_0x9d5f('0x37')]+'%'};return _0x16920c;})});}_0x345b13=_['merge']({},_0x345b13,_0x2cc054['options']);return _0x35b3fb['getConfigurations'](_0x345b13);}})[_0x9d5f('0x1f')](function(_0x45362b){if(_0x45362b){_0x2844d6=_0x45362b['length'];if(!_0x2cc054[_0x9d5f('0x2a')][_0x9d5f('0x32')](_0x9d5f('0x33'))){_0x345b13[_0x9d5f('0x18')]=qs[_0x9d5f('0x18')](_0x2cc054['query'][_0x9d5f('0x18')]);_0x345b13['offset']=qs[_0x9d5f('0x1b')](_0x2cc054[_0x9d5f('0x2a')]['offset']);}return _0x35b3fb[_0x9d5f('0x44')](_0x345b13);}})['then'](function(_0x1bd84a){if(_0x1bd84a){return _0x1bd84a?{'count':_0x2844d6,'rows':_0x1bd84a}:null;}})[_0x9d5f('0x1f')](respondWithResult(_0x4a3555,null))[_0x9d5f('0x3e')](handleError(_0x4a3555,null));};exports['addConfiguration']=function(_0x2e944a,_0x48bb67,_0x498870){if(_0x2e944a[_0x9d5f('0x41')]['id']){delete _0x2e944a[_0x9d5f('0x41')]['id'];}return db['SalesforceAccount'][_0x9d5f('0x45')]({'where':{'id':_0x2e944a[_0x9d5f('0x43')]['id']}})[_0x9d5f('0x1f')](handleEntityNotFound(_0x48bb67,null))[_0x9d5f('0x1f')](function(_0x2c3764){if(_0x2c3764){_0x2e944a[_0x9d5f('0x41')][_0x9d5f('0x47')]=_0x2c3764['id'];_0x2e944a[_0x9d5f('0x41')][_0x9d5f('0x48')]=integrations[_0x9d5f('0x49')](_0x2e944a['body'][_0x9d5f('0x4a')],_0x2e944a['body'][_0x9d5f('0x4b')]);_0x2e944a[_0x9d5f('0x41')][_0x9d5f('0x4c')]=integrations[_0x9d5f('0x4d')](_0x2e944a[_0x9d5f('0x41')][_0x9d5f('0x4a')],_0x2e944a[_0x9d5f('0x41')]['type']);return db[_0x9d5f('0x46')][_0x9d5f('0x40')](_0x2e944a[_0x9d5f('0x41')],{'include':[{'model':db[_0x9d5f('0x4e')],'as':'Subjects'},{'model':db[_0x9d5f('0x4e')],'as':'Descriptions'}]});}return null;})[_0x9d5f('0x1f')](respondWithResult(_0x48bb67,null))[_0x9d5f('0x3e')](handleError(_0x48bb67,null));};exports[_0x9d5f('0x4f')]=function(_0x5d13a5,_0x11d3a4,_0x1eba8c){var _0x491056;var _0x5cf884='';var _0x40ed64='Task';return db[_0x9d5f('0x27')][_0x9d5f('0x45')]({'where':{'id':_0x5d13a5[_0x9d5f('0x43')]['id']},'attributes':['id','remoteUri',_0x9d5f('0x50'),_0x9d5f('0x51'),_0x9d5f('0x52'),'password',_0x9d5f('0x53')]})[_0x9d5f('0x1f')](handleEntityNotFound(_0x11d3a4,null))[_0x9d5f('0x1f')](function(_0x2e4ea3){if(_0x2e4ea3){_0x5cf884=_0x2e4ea3[_0x9d5f('0x54')];var _0x204389=_0x5cf884[_0x9d5f('0x55')](-0x1);if(_0x204389==='/'){_0x5cf884=_0x5cf884['substring'](0x0,_0x5cf884[_0x9d5f('0x56')](_0x204389));}_0x491056=new jsforce[(_0x9d5f('0x57'))]({'oauth2':{'loginUrl':_0x5cf884,'clientId':_0x2e4ea3[_0x9d5f('0x50')],'clientSecret':_0x2e4ea3['clientSecret']}});return _0x491056[_0x9d5f('0x58')](_0x2e4ea3[_0x9d5f('0x52')],_0x2e4ea3[_0x9d5f('0x59')]['concat'](_0x2e4ea3[_0x9d5f('0x53')]));}})[_0x9d5f('0x1f')](function(_0x29fc67){if(_0x29fc67){if(!_[_0x9d5f('0x5a')](_0x5d13a5['query'][_0x9d5f('0x5b')])){_0x40ed64=_0x5d13a5[_0x9d5f('0x2a')][_0x9d5f('0x5b')];}return _0x491056['sobject'](_0x40ed64)[_0x9d5f('0x5c')]();}})[_0x9d5f('0x1f')](function(_0x122559){var _0x34a32a=['OwnerId',_0x9d5f('0x5d'),_0x9d5f('0x5e'),_0x9d5f('0x5f'),_0x9d5f('0x60'),_0x9d5f('0x61')];var _0x4faf8b=[_0x9d5f('0x62'),'int','picklist',_0x9d5f('0x63'),_0x9d5f('0x64'),_0x9d5f('0x65'),'phone'];if(_0x122559){_['remove'](_0x122559['fields'],function(_0xbdd0b1){return _0x34a32a[_0x9d5f('0x66')](_0xbdd0b1[_0x9d5f('0x23')])||!_0x4faf8b[_0x9d5f('0x66')](_0xbdd0b1[_0x9d5f('0x4b')]);});return{'count':_0x122559[_0x9d5f('0x2f')][_0x9d5f('0x31')],'rows':_['map'](_0x122559[_0x9d5f('0x2f')],function(_0x3faf23){return{'id':_0x3faf23[_0x9d5f('0x23')],'name':_0x3faf23[_0x9d5f('0x67')],'custom':_0x3faf23[_0x9d5f('0x68')],'options':_0x3faf23[_0x9d5f('0x69')][_0x9d5f('0x31')]>0x0?_[_0x9d5f('0x26')](_0x3faf23[_0x9d5f('0x69')],function(_0x2b8cb4){return{'name':_0x2b8cb4[_0x9d5f('0x67')],'value':_0x2b8cb4[_0x9d5f('0x6a')]};}):_0x3faf23[_0x9d5f('0x4b')]==_0x9d5f('0x63')?[{'name':'True','value':'true'},{'name':_0x9d5f('0x6b'),'value':_0x9d5f('0x6c')}]:[]};})};}})[_0x9d5f('0x1f')](respondWithResult(_0x11d3a4,null))['catch'](function(_0x205669){var _0x52f4fb=_0x5d13a5[_0x9d5f('0x2a')][_0x9d5f('0x6d')]?0x1f4:_0x205669[_0x9d5f('0x6e')]||0x1f4;logger[_0x9d5f('0x21')](_0x9d5f('0x6f'),_0x9d5f('0x4f'),_0x52f4fb,JSON['stringify'](_0x205669));delete _0x205669[_0x9d5f('0x23')];if(_0x52f4fb===0x191){_0x52f4fb=0x190;}_0x11d3a4[_0x9d5f('0x16')](_0x52f4fb)[_0x9d5f('0x24')](_0x5d13a5[_0x9d5f('0x2a')][_0x9d5f('0x6d')]?{'message':_0x9d5f('0x70'),'statusCode':_0x205669[_0x9d5f('0x6e')]}:_0x205669);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 586f747..9c872d2 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 _0x5620=['define','SalesforceAccount','lodash','../../config/logger','api','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x6bf9f6,_0x33fcc0){var _0x5bc37e=function(_0x5910fd){while(--_0x5910fd){_0x6bf9f6['push'](_0x6bf9f6['shift']());}};_0x5bc37e(++_0x33fcc0);}(_0x5620,0xbf));var _0x0562=function(_0x533381,_0x8a69fa){_0x533381=_0x533381-0x0;var _0x2877ed=_0x5620[_0x533381];return _0x2877ed;};'use strict';var _=require(_0x0562('0x0'));var util=require('util');var logger=require(_0x0562('0x1'))(_0x0562('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0562('0x3'));var rimraf=require('rimraf');var config=require(_0x0562('0x4'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x0562('0x5'));module[_0x0562('0x6')]=function(_0x4155b9,_0x24b8d1){return _0x4155b9[_0x0562('0x7')](_0x0562('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x054f=['rimraf','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4843ac,_0x3d25e7){var _0x14e72f=function(_0x3e2544){while(--_0x3e2544){_0x4843ac['push'](_0x4843ac['shift']());}};_0x14e72f(++_0x3d25e7);}(_0x054f,0x1a6));var _0xf054=function(_0x3781ae,_0x59ea2f){_0x3781ae=_0x3781ae-0x0;var _0x3cc5fc=_0x054f[_0x3781ae];return _0x3cc5fc;};'use strict';var _=require(_0xf054('0x0'));var util=require(_0xf054('0x1'));var logger=require(_0xf054('0x2'))(_0xf054('0x3'));var moment=require(_0xf054('0x4'));var BPromise=require(_0xf054('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf054('0x6'));var rimraf=require(_0xf054('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xf054('0x8'));module['exports']=function(_0x4260f7,_0x113205){return _0x4260f7['define'](_0xf054('0x9'),attributes,{'tableName':_0xf054('0xa'),'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 4f66d74..666c91e 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 _0x4890=['findAll','options','where','attributes','limit','map','include','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','then','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount'];(function(_0x2c7b28,_0x146b28){var _0x888d18=function(_0x4e9843){while(--_0x4e9843){_0x2c7b28['push'](_0x2c7b28['shift']());}};_0x888d18(++_0x146b28);}(_0x4890,0x157));var _0x0489=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x4890[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require(_0x0489('0x0'));var util=require(_0x0489('0x1'));var moment=require('moment');var BPromise=require(_0x0489('0x2'));var rs=require(_0x0489('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0489('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0489('0x5'));var config=require(_0x0489('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0489('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ad03d,_0x4f0d92,_0x5d0e19){return new BPromise(function(_0x38148d,_0x18926d){return client['request'](_0x5ad03d,_0x5d0e19)[_0x0489('0x8')](function(_0x391f8a){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4f0d92,_0x0489('0x9'));logger[_0x0489('0xa')](_0x0489('0xb'),_0x4f0d92,_0x0489('0x9'),JSON['stringify'](_0x391f8a));if(_0x391f8a[_0x0489('0xc')]){if(_0x391f8a[_0x0489('0xc')][_0x0489('0xd')]===0x1f4){logger['error'](_0x0489('0xe'),_0x4f0d92,_0x391f8a['error'][_0x0489('0xf')]);return _0x18926d(_0x391f8a[_0x0489('0xc')][_0x0489('0xf')]);}logger[_0x0489('0xc')](_0x0489('0xe'),_0x4f0d92,_0x391f8a[_0x0489('0xc')][_0x0489('0xf')]);return _0x38148d(_0x391f8a[_0x0489('0xc')]['message']);}else{logger[_0x0489('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4f0d92,'request\x20sent');_0x38148d(_0x391f8a[_0x0489('0x11')][_0x0489('0xf')]);}})[_0x0489('0x12')](function(_0x463d22){logger[_0x0489('0xc')](_0x0489('0xe'),_0x4f0d92,_0x463d22);_0x18926d(_0x463d22);});});}exports['GetSalesforceAccount']=function(_0x406ba5){var _0x36ec98=this;return new Promise(function(_0xd1db1,_0x2ce9bc){return db[_0x0489('0x13')][_0x0489('0x14')]({'raw':_0x406ba5[_0x0489('0x15')]?_0x406ba5[_0x0489('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x406ba5['options']?_0x406ba5[_0x0489('0x15')][_0x0489('0x16')]||null:null,'attributes':_0x406ba5[_0x0489('0x15')]?_0x406ba5['options'][_0x0489('0x17')]||null:null,'limit':_0x406ba5[_0x0489('0x15')]?_0x406ba5[_0x0489('0x15')][_0x0489('0x18')]||null:null,'include':_0x406ba5['options']?_0x406ba5[_0x0489('0x15')]['include']?_[_0x0489('0x19')](_0x406ba5[_0x0489('0x15')][_0x0489('0x1a')],function(_0x1ba0ff){return{'model':db[_0x1ba0ff[_0x0489('0x1b')]],'as':_0x1ba0ff['as'],'attributes':_0x1ba0ff[_0x0489('0x17')],'include':_0x1ba0ff[_0x0489('0x1a')]?_[_0x0489('0x19')](_0x1ba0ff[_0x0489('0x1a')],function(_0x24b956){return{'model':db[_0x24b956['model']],'as':_0x24b956['as'],'attributes':_0x24b956[_0x0489('0x17')],'include':_0x24b956[_0x0489('0x1a')]?_[_0x0489('0x19')](_0x24b956[_0x0489('0x1a')],function(_0x29f8bb){return{'model':db[_0x29f8bb[_0x0489('0x1b')]],'as':_0x29f8bb['as'],'attributes':_0x29f8bb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x66ad20){logger[_0x0489('0x10')](_0x0489('0x1c'),_0x406ba5);logger[_0x0489('0xa')]('GetSalesforceAccount',_0x406ba5,JSON[_0x0489('0x1d')](_0x66ad20));_0xd1db1(_0x66ad20);})[_0x0489('0x12')](function(_0x5a7f99){logger['error'](_0x0489('0x1c'),_0x5a7f99['message'],_0x406ba5);_0x2ce9bc(_0x36ec98[_0x0489('0xc')](0x1f4,_0x5a7f99[_0x0489('0xf')]));});});};exports[_0x0489('0x1e')]=function(_0x3df6bd){var _0x1669ae=this;return new Promise(function(_0x5ddc11,_0x35abbc){return db['SalesforceAccount'][_0x0489('0x1f')]({'raw':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x20')]===undefined?!![]:![]:!![],'where':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x16')]||null:null,'attributes':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd['options']['attributes']||null:null,'include':_0x3df6bd[_0x0489('0x15')]?_0x3df6bd[_0x0489('0x15')][_0x0489('0x1a')]?_[_0x0489('0x19')](_0x3df6bd[_0x0489('0x15')]['include'],function(_0x44ada5){return{'model':db[_0x44ada5[_0x0489('0x1b')]],'as':_0x44ada5['as'],'attributes':_0x44ada5[_0x0489('0x17')],'include':_0x44ada5['include']?_[_0x0489('0x19')](_0x44ada5[_0x0489('0x1a')],function(_0x2f73a4){return{'model':db[_0x2f73a4['model']],'as':_0x2f73a4['as'],'attributes':_0x2f73a4[_0x0489('0x17')],'include':_0x2f73a4['include']?_['map'](_0x2f73a4[_0x0489('0x1a')],function(_0x471a38){return{'model':db[_0x471a38[_0x0489('0x1b')]],'as':_0x471a38['as'],'attributes':_0x471a38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc0f1fe){logger[_0x0489('0x10')](_0x0489('0x1e'),_0x3df6bd);logger['debug'](_0x0489('0x1e'),_0x3df6bd,JSON[_0x0489('0x1d')](_0xc0f1fe));_0x5ddc11(_0xc0f1fe);})[_0x0489('0x12')](function(_0x546897){logger['error'](_0x0489('0x1e'),_0x546897[_0x0489('0xf')],_0x3df6bd);_0x35abbc(_0x1669ae[_0x0489('0xc')](0x1f4,_0x546897['message']));});});}; \ No newline at end of file +var _0x5893=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SalesforceAccount','options','raw','where','limit','include','map','model','attributes','GetSalesforceAccount','ShowSalesforceAccount','find','util','moment'];(function(_0x7c5b41,_0x577587){var _0xa75631=function(_0xbb62a4){while(--_0xbb62a4){_0x7c5b41['push'](_0x7c5b41['shift']());}};_0xa75631(++_0x577587);}(_0x5893,0xf3));var _0x3589=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5893[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3589('0x0'));var moment=require(_0x3589('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3589('0x2'));var db=require(_0x3589('0x3'))['db'];var utils=require(_0x3589('0x4'));var logger=require(_0x3589('0x5'))(_0x3589('0x6'));var config=require(_0x3589('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3589('0x8')][_0x3589('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1db1f3,_0x3647b4,_0x27ce03){return new BPromise(function(_0x1d0d51,_0x2ee74c){return client[_0x3589('0xa')](_0x1db1f3,_0x27ce03)[_0x3589('0xb')](function(_0x1f5fb2){logger[_0x3589('0xc')](_0x3589('0xd'),_0x3647b4,_0x3589('0xe'));logger[_0x3589('0xf')](_0x3589('0x10'),_0x3647b4,'request\x20sent',JSON[_0x3589('0x11')](_0x1f5fb2));if(_0x1f5fb2[_0x3589('0x12')]){if(_0x1f5fb2[_0x3589('0x12')][_0x3589('0x13')]===0x1f4){logger[_0x3589('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x3647b4,_0x1f5fb2[_0x3589('0x12')][_0x3589('0x14')]);return _0x2ee74c(_0x1f5fb2['error'][_0x3589('0x14')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3647b4,_0x1f5fb2[_0x3589('0x12')]['message']);return _0x1d0d51(_0x1f5fb2[_0x3589('0x12')]['message']);}else{logger['info'](_0x3589('0xd'),_0x3647b4,_0x3589('0xe'));_0x1d0d51(_0x1f5fb2[_0x3589('0x15')]['message']);}})[_0x3589('0x16')](function(_0x6b4447){logger['error'](_0x3589('0xd'),_0x3647b4,_0x6b4447);_0x2ee74c(_0x6b4447);});});}exports['GetSalesforceAccount']=function(_0x4b6426){var _0x11dc48=this;return new Promise(function(_0x24b6f7,_0x1f6fec){return db[_0x3589('0x17')]['findAll']({'raw':_0x4b6426[_0x3589('0x18')]?_0x4b6426[_0x3589('0x18')][_0x3589('0x19')]===undefined?!![]:![]:!![],'where':_0x4b6426['options']?_0x4b6426[_0x3589('0x18')][_0x3589('0x1a')]||null:null,'attributes':_0x4b6426[_0x3589('0x18')]?_0x4b6426[_0x3589('0x18')]['attributes']||null:null,'limit':_0x4b6426[_0x3589('0x18')]?_0x4b6426['options'][_0x3589('0x1b')]||null:null,'include':_0x4b6426[_0x3589('0x18')]?_0x4b6426[_0x3589('0x18')][_0x3589('0x1c')]?_[_0x3589('0x1d')](_0x4b6426[_0x3589('0x18')]['include'],function(_0x486220){return{'model':db[_0x486220[_0x3589('0x1e')]],'as':_0x486220['as'],'attributes':_0x486220[_0x3589('0x1f')],'include':_0x486220[_0x3589('0x1c')]?_[_0x3589('0x1d')](_0x486220[_0x3589('0x1c')],function(_0x16eb8a){return{'model':db[_0x16eb8a['model']],'as':_0x16eb8a['as'],'attributes':_0x16eb8a[_0x3589('0x1f')],'include':_0x16eb8a[_0x3589('0x1c')]?_['map'](_0x16eb8a[_0x3589('0x1c')],function(_0x38b22a){return{'model':db[_0x38b22a[_0x3589('0x1e')]],'as':_0x38b22a['as'],'attributes':_0x38b22a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3589('0xb')](function(_0x19bb74){logger[_0x3589('0xc')](_0x3589('0x20'),_0x4b6426);logger[_0x3589('0xf')](_0x3589('0x20'),_0x4b6426,JSON['stringify'](_0x19bb74));_0x24b6f7(_0x19bb74);})[_0x3589('0x16')](function(_0xf56437){logger['error']('GetSalesforceAccount',_0xf56437[_0x3589('0x14')],_0x4b6426);_0x1f6fec(_0x11dc48[_0x3589('0x12')](0x1f4,_0xf56437[_0x3589('0x14')]));});});};exports[_0x3589('0x21')]=function(_0xad856d){var _0x2d0820=this;return new Promise(function(_0x39e1ba,_0x545dd2){return db['SalesforceAccount'][_0x3589('0x22')]({'raw':_0xad856d[_0x3589('0x18')]?_0xad856d[_0x3589('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xad856d[_0x3589('0x18')]?_0xad856d[_0x3589('0x18')][_0x3589('0x1a')]||null:null,'attributes':_0xad856d['options']?_0xad856d[_0x3589('0x18')][_0x3589('0x1f')]||null:null,'include':_0xad856d[_0x3589('0x18')]?_0xad856d['options'][_0x3589('0x1c')]?_['map'](_0xad856d['options'][_0x3589('0x1c')],function(_0x3aaf49){return{'model':db[_0x3aaf49[_0x3589('0x1e')]],'as':_0x3aaf49['as'],'attributes':_0x3aaf49[_0x3589('0x1f')],'include':_0x3aaf49[_0x3589('0x1c')]?_[_0x3589('0x1d')](_0x3aaf49['include'],function(_0x5b7fb5){return{'model':db[_0x5b7fb5[_0x3589('0x1e')]],'as':_0x5b7fb5['as'],'attributes':_0x5b7fb5[_0x3589('0x1f')],'include':_0x5b7fb5['include']?_['map'](_0x5b7fb5[_0x3589('0x1c')],function(_0x1c78ee){return{'model':db[_0x1c78ee[_0x3589('0x1e')]],'as':_0x1c78ee['as'],'attributes':_0x1c78ee[_0x3589('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3589('0xb')](function(_0xcd395c){logger['info']('ShowSalesforceAccount',_0xad856d);logger[_0x3589('0xf')]('ShowSalesforceAccount',_0xad856d,JSON[_0x3589('0x11')](_0xcd395c));_0x39e1ba(_0xcd395c);})['catch'](function(_0x2c5b0a){logger['error'](_0x3589('0x21'),_0x2c5b0a[_0x3589('0x14')],_0xad856d);_0x545dd2(_0x2d0820[_0x3589('0x12')](0x1f4,_0x2c5b0a[_0x3589('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 299cc42..7a1b367 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdb28,0x106));var _0x8db2=function(_0xce6daf,_0x443cb1){_0xce6daf=_0xce6daf-0x0;var _0x40e38b=_0xdb28[_0xce6daf];return _0x40e38b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdb28,0x106));var _0x8db2=function(_0x1adf3e,_0x1a399a){_0x1adf3e=_0x1adf3e-0x0;var _0x430b9d=_0xdb28[_0x1adf3e];return _0x430b9d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b9f3c88..7fb0774 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 _0x4d4b=['contact','lead','account_contact_lead','account','nothing','STRING','ENUM','Task','Case','contact_lead'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4d4b,0xf5));var _0xb4d4=function(_0x57d22c,_0x317c8c){_0x57d22c=_0x57d22c-0x0;var _0x44a9b2=_0x4d4b[_0x57d22c];return _0x44a9b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb4d4('0x0')]},'description':{'type':Sequelize[_0xb4d4('0x0')]},'ticketType':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x2'),_0xb4d4('0x3')),'defaultValue':_0xb4d4('0x2')},'moduleSearch':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x4'),_0xb4d4('0x5'),_0xb4d4('0x6'),_0xb4d4('0x7'),_0xb4d4('0x8')),'defaultValue':_0xb4d4('0x4')},'moduleCreate':{'type':Sequelize[_0xb4d4('0x1')](_0xb4d4('0x9'),_0xb4d4('0x5'),'lead',_0xb4d4('0x8')),'defaultValue':_0xb4d4('0x6')},'leadId':{'type':Sequelize[_0xb4d4('0x0')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xb4d4('0x0')]}}; \ No newline at end of file +var _0x50f0=['account','nothing','contact','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead'];(function(_0xe9ffa,_0x45337e){var _0x1d5ca8=function(_0x59df2f){while(--_0x59df2f){_0xe9ffa['push'](_0xe9ffa['shift']());}};_0x1d5ca8(++_0x45337e);}(_0x50f0,0x1cb));var _0x050f=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x50f0[_0x1627ae];return _0x34b38f;};'use strict';var Sequelize=require(_0x050f('0x0'));module[_0x050f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x050f('0x2')]},'ticketType':{'type':Sequelize[_0x050f('0x3')](_0x050f('0x4'),_0x050f('0x5')),'defaultValue':_0x050f('0x4')},'moduleSearch':{'type':Sequelize[_0x050f('0x3')](_0x050f('0x6'),'contact',_0x050f('0x7'),_0x050f('0x8'),_0x050f('0x9')),'defaultValue':_0x050f('0x6')},'moduleCreate':{'type':Sequelize[_0x050f('0x3')](_0x050f('0xa'),_0x050f('0xb'),_0x050f('0x7'),_0x050f('0x9')),'defaultValue':_0x050f('0x7')},'leadId':{'type':Sequelize[_0x050f('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x050f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x050f('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d676dac..0fdadce 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 _0x8b1f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','SalesforceConfiguration','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','SalesforceField','getFields','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring'];(function(_0x12b4ff,_0x3749f2){var _0x3dde2b=function(_0x3f94c9){while(--_0x3f94c9){_0x12b4ff['push'](_0x12b4ff['shift']());}};_0x3dde2b(++_0x3749f2);}(_0x8b1f,0xda));var _0xf8b1=function(_0xc5da18,_0x3354e1){_0xc5da18=_0xc5da18-0x0;var _0xf6646f=_0x8b1f[_0xc5da18];return _0xf6646f;};'use strict';var emlformat=require(_0xf8b1('0x0'));var rimraf=require(_0xf8b1('0x1'));var zipdir=require(_0xf8b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8b1('0x3'));var moment=require(_0xf8b1('0x4'));var BPromise=require(_0xf8b1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf8b1('0x6'));var csv=require(_0xf8b1('0x7'));var ejs=require(_0xf8b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8b1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf8b1('0xa'));var deskjs=require(_0xf8b1('0xb'));var toCsv=require(_0xf8b1('0x7'));var querystring=require(_0xf8b1('0xc'));var Papa=require(_0xf8b1('0xd'));var Redis=require(_0xf8b1('0xe'));var authService=require(_0xf8b1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf8b1('0x10'));var hardwareService=require(_0xf8b1('0x11'));var logger=require(_0xf8b1('0x12'))('api');var utils=require(_0xf8b1('0x13'));var config=require(_0xf8b1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8b1('0x15'))['db'];function respondWithStatusCode(_0x174482,_0x1f7f25){_0x1f7f25=_0x1f7f25||0xcc;return function(_0x520cdf){if(_0x520cdf){return _0x174482['sendStatus'](_0x1f7f25);}return _0x174482[_0xf8b1('0x16')](_0x1f7f25)['end']();};}function respondWithResult(_0x1e09b1,_0x24021d){_0x24021d=_0x24021d||0xc8;return function(_0x2f8ed6){if(_0x2f8ed6){return _0x1e09b1[_0xf8b1('0x16')](_0x24021d)[_0xf8b1('0x17')](_0x2f8ed6);}};}function respondWithFilteredResult(_0x382d51,_0x45f747){return function(_0x4221b1){if(_0x4221b1){var _0x251ec4=typeof _0x45f747['offset']===_0xf8b1('0x18')&&typeof _0x45f747[_0xf8b1('0x19')]===_0xf8b1('0x18');var _0x55827c=_0x4221b1[_0xf8b1('0x1a')];var _0x156d13=_0x251ec4?0x0:_0x45f747[_0xf8b1('0x1b')];var _0x55c57f=_0x251ec4?_0x4221b1['count']:_0x45f747[_0xf8b1('0x1b')]+_0x45f747[_0xf8b1('0x19')];var _0x31a8e7;if(_0x55c57f>=_0x55827c){_0x55c57f=_0x55827c;_0x31a8e7=0xc8;}else{_0x31a8e7=0xce;}_0x382d51[_0xf8b1('0x16')](_0x31a8e7);return _0x382d51[_0xf8b1('0x1c')](_0xf8b1('0x1d'),_0x156d13+'-'+_0x55c57f+'/'+_0x55827c)[_0xf8b1('0x17')](_0x4221b1);}return null;};}function patchUpdates(_0x1f4728){return function(_0x217f23){try{jsonpatch[_0xf8b1('0x1e')](_0x217f23,_0x1f4728,!![]);}catch(_0x4617e9){return BPromise[_0xf8b1('0x1f')](_0x4617e9);}return _0x217f23[_0xf8b1('0x20')]();};}function saveUpdates(_0x2b61f1,_0xe6ee23){return function(_0x516da8){if(_0x516da8){return _0x516da8[_0xf8b1('0x21')](_0x2b61f1)[_0xf8b1('0x22')](function(_0x37f973){return _0x37f973;});}return null;};}function removeEntity(_0xf9dea4,_0x4859bb){return function(_0x3733ae){if(_0x3733ae){return _0x3733ae[_0xf8b1('0x23')]()[_0xf8b1('0x22')](function(){_0xf9dea4[_0xf8b1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8fed,_0x4cce19){return function(_0x33dd50){if(!_0x33dd50){_0x2b8fed[_0xf8b1('0x24')](0x194);}return _0x33dd50;};}function handleError(_0x220213,_0x3067b7){_0x3067b7=_0x3067b7||0x1f4;return function(_0x22fd1e){logger['error'](_0x22fd1e[_0xf8b1('0x25')]);if(_0x22fd1e[_0xf8b1('0x26')]){delete _0x22fd1e['name'];}_0x220213['status'](_0x3067b7)[_0xf8b1('0x27')](_0x22fd1e);};}exports['index']=function(_0x147d21,_0x4a9c53){var _0x37e81a={},_0x21e304={},_0xb10199={'count':0x0,'rows':[]};var _0x545ac3=_[_0xf8b1('0x28')](db[_0xf8b1('0x29')]['rawAttributes'],function(_0x35d31a){return{'name':_0x35d31a[_0xf8b1('0x2a')],'type':_0x35d31a['type'][_0xf8b1('0x2b')]};});_0x21e304[_0xf8b1('0x2c')]=_[_0xf8b1('0x28')](_0x545ac3,_0xf8b1('0x26'));_0x21e304[_0xf8b1('0x2d')]=_['keys'](_0x147d21[_0xf8b1('0x2d')]);_0x21e304[_0xf8b1('0x2e')]=_['intersection'](_0x21e304[_0xf8b1('0x2c')],_0x21e304[_0xf8b1('0x2d')]);_0x37e81a['attributes']=_[_0xf8b1('0x2f')](_0x21e304[_0xf8b1('0x2c')],qs['fields'](_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x37e81a[_0xf8b1('0x31')]=_0x37e81a['attributes'][_0xf8b1('0x32')]?_0x37e81a[_0xf8b1('0x31')]:_0x21e304[_0xf8b1('0x2c')];if(!_0x147d21['query'][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x37e81a[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x147d21[_0xf8b1('0x2d')]['limit']);_0x37e81a['offset']=qs[_0xf8b1('0x1b')](_0x147d21[_0xf8b1('0x2d')]['offset']);}_0x37e81a[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x36')]);_0x37e81a[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_['pick'](_0x147d21[_0xf8b1('0x2d')],_0x21e304[_0xf8b1('0x2e')]),_0x545ac3);if(_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x38')]){_0x37e81a[_0xf8b1('0x37')]=_['merge'](_0x37e81a[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x545ac3,function(_0x46eead){if(_0x46eead['type']!=='VIRTUAL'){var _0x4aa9f1={};_0x4aa9f1[_0x46eead[_0xf8b1('0x26')]]={'$like':'%'+_0x147d21[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x4aa9f1;}})});}_0x37e81a=_[_0xf8b1('0x39')]({},_0x37e81a,_0x147d21[_0xf8b1('0x3a')]);var _0x3f569c={'where':_0x37e81a[_0xf8b1('0x37')]};return db[_0xf8b1('0x29')][_0xf8b1('0x1a')](_0x3f569c)[_0xf8b1('0x22')](function(_0x53229b){_0xb10199['count']=_0x53229b;if(_0x147d21['query'][_0xf8b1('0x3b')]){_0x37e81a[_0xf8b1('0x3c')]=[{'all':!![]}];}return db[_0xf8b1('0x29')][_0xf8b1('0x3d')](_0x37e81a);})[_0xf8b1('0x22')](function(_0x4c5301){_0xb10199[_0xf8b1('0x3e')]=_0x4c5301;return _0xb10199;})[_0xf8b1('0x22')](respondWithFilteredResult(_0x4a9c53,_0x37e81a))['catch'](handleError(_0x4a9c53,null));};exports[_0xf8b1('0x3f')]=function(_0x18c70e,_0x453b79){var _0x28fdf2={'raw':![],'where':{'id':_0x18c70e[_0xf8b1('0x40')]['id']}},_0x3c83e2={};_0x3c83e2[_0xf8b1('0x2c')]=_[_0xf8b1('0x41')](db[_0xf8b1('0x29')][_0xf8b1('0x42')]);_0x3c83e2['query']=_['keys'](_0x18c70e[_0xf8b1('0x2d')]);_0x3c83e2[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x3c83e2[_0xf8b1('0x2c')],_0x3c83e2[_0xf8b1('0x2d')]);_0x28fdf2[_0xf8b1('0x31')]=_[_0xf8b1('0x2f')](_0x3c83e2[_0xf8b1('0x2c')],qs['fields'](_0x18c70e['query'][_0xf8b1('0x30')]));_0x28fdf2[_0xf8b1('0x31')]=_0x28fdf2[_0xf8b1('0x31')]['length']?_0x28fdf2[_0xf8b1('0x31')]:_0x3c83e2[_0xf8b1('0x2c')];if(_0x18c70e[_0xf8b1('0x2d')][_0xf8b1('0x3b')]){_0x28fdf2['include']=[{'all':!![]}];}_0x28fdf2=_['merge']({},_0x28fdf2,_0x18c70e[_0xf8b1('0x3a')]);return db['SalesforceConfiguration'][_0xf8b1('0x43')](_0x28fdf2)[_0xf8b1('0x22')](handleEntityNotFound(_0x453b79,null))['then'](respondWithResult(_0x453b79,null))[_0xf8b1('0x44')](handleError(_0x453b79,null));};exports[_0xf8b1('0x45')]=function(_0x46db4b,_0x4c1555){return db[_0xf8b1('0x29')][_0xf8b1('0x45')](_0x46db4b[_0xf8b1('0x46')],{})['then'](respondWithResult(_0x4c1555,0xc9))[_0xf8b1('0x44')](handleError(_0x4c1555,null));};exports[_0xf8b1('0x21')]=function(_0x2df99f,_0x25504e){if(_0x2df99f[_0xf8b1('0x46')]['id']){delete _0x2df99f[_0xf8b1('0x46')]['id'];}return db['SalesforceConfiguration'][_0xf8b1('0x43')]({'where':{'id':_0x2df99f[_0xf8b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x25504e,null))['then'](saveUpdates(_0x2df99f[_0xf8b1('0x46')],null))[_0xf8b1('0x22')](respondWithResult(_0x25504e,null))[_0xf8b1('0x44')](handleError(_0x25504e,null));};exports[_0xf8b1('0x23')]=function(_0x15d0be,_0xb02131){return db[_0xf8b1('0x29')][_0xf8b1('0x43')]({'where':{'id':_0x15d0be['params']['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0xb02131,null))[_0xf8b1('0x22')](removeEntity(_0xb02131,null))[_0xf8b1('0x44')](handleError(_0xb02131,null));};exports['getFields']=function(_0x154b53,_0x3c8b58,_0x45a350){var _0x27b144={};var _0x15082a={};var _0x562b02;var _0x358021;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x154b53[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x3c8b58,null))[_0xf8b1('0x22')](function(_0x592310){if(_0x592310){_0x562b02=_0x592310;_0x15082a['model']=_['keys'](db[_0xf8b1('0x47')][_0xf8b1('0x42')]);_0x15082a[_0xf8b1('0x2d')]=_[_0xf8b1('0x41')](_0x154b53[_0xf8b1('0x2d')]);_0x15082a['filters']=_['intersection'](_0x15082a['model'],_0x15082a[_0xf8b1('0x2d')]);_0x27b144['attributes']=_[_0xf8b1('0x2f')](_0x15082a[_0xf8b1('0x2c')],qs[_0xf8b1('0x30')](_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x27b144['attributes']=_0x27b144[_0xf8b1('0x31')][_0xf8b1('0x32')]?_0x27b144[_0xf8b1('0x31')]:_0x15082a['model'];_0x27b144[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x154b53[_0xf8b1('0x2d')]['sort']);_0x27b144[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_['pick'](_0x154b53['query'],_0x15082a[_0xf8b1('0x2e')]));if(_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x38')]){_0x27b144[_0xf8b1('0x37')]=_['merge'](_0x27b144[_0xf8b1('0x37')],{'$or':_['map'](_0x27b144['attributes'],function(_0x2536e7){var _0x325b01={};_0x325b01[_0x2536e7]={'$like':'%'+_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x325b01;})});}_0x27b144=_[_0xf8b1('0x39')]({},_0x27b144,_0x154b53[_0xf8b1('0x3a')]);return _0x562b02['getFields'](_0x27b144);}})[_0xf8b1('0x22')](function(_0xc703e4){if(_0xc703e4){_0x358021=_0xc703e4[_0xf8b1('0x32')];if(!_0x154b53[_0xf8b1('0x2d')][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x27b144[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x154b53['query'][_0xf8b1('0x19')]);_0x27b144['offset']=qs[_0xf8b1('0x1b')](_0x154b53['query']['offset']);}return _0x562b02[_0xf8b1('0x48')](_0x27b144);}})['then'](function(_0x20aefd){if(_0x20aefd){return _0x20aefd?{'count':_0x358021,'rows':_0x20aefd}:null;}})[_0xf8b1('0x22')](respondWithResult(_0x3c8b58,null))[_0xf8b1('0x44')](handleError(_0x3c8b58,null));};exports[_0xf8b1('0x49')]=function(_0x395f97,_0x336b6b,_0x572e3d){var _0x3b30c8={};var _0x3c1356={};var _0x5757d7;var _0x45539e;return db['SalesforceConfiguration'][_0xf8b1('0x4a')]({'where':{'id':_0x395f97[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x336b6b,null))[_0xf8b1('0x22')](function(_0x1bebea){if(_0x1bebea){_0x5757d7=_0x1bebea;_0x3c1356['model']=_[_0xf8b1('0x41')](db[_0xf8b1('0x47')][_0xf8b1('0x42')]);_0x3c1356['query']=_[_0xf8b1('0x41')](_0x395f97[_0xf8b1('0x2d')]);_0x3c1356[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x3c1356[_0xf8b1('0x2c')],_0x3c1356['query']);_0x3b30c8[_0xf8b1('0x31')]=_[_0xf8b1('0x2f')](_0x3c1356['model'],qs[_0xf8b1('0x30')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x3b30c8['attributes']=_0x3b30c8[_0xf8b1('0x31')][_0xf8b1('0x32')]?_0x3b30c8[_0xf8b1('0x31')]:_0x3c1356['model'];_0x3b30c8[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x36')]);_0x3b30c8['where']=qs[_0xf8b1('0x2e')](_[_0xf8b1('0x4b')](_0x395f97[_0xf8b1('0x2d')],_0x3c1356[_0xf8b1('0x2e')]));if(_0x395f97[_0xf8b1('0x2d')]['filter']){_0x3b30c8[_0xf8b1('0x37')]=_['merge'](_0x3b30c8[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x3b30c8[_0xf8b1('0x31')],function(_0x23d137){var _0x396191={};_0x396191[_0x23d137]={'$like':'%'+_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x396191;})});}_0x3b30c8=_['merge']({},_0x3b30c8,_0x395f97['options']);return _0x5757d7[_0xf8b1('0x49')](_0x3b30c8);}})[_0xf8b1('0x22')](function(_0x22469f){if(_0x22469f){_0x45539e=_0x22469f['length'];if(!_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x33')](_0xf8b1('0x34'))){_0x3b30c8[_0xf8b1('0x19')]=qs['limit'](_0x395f97['query'][_0xf8b1('0x19')]);_0x3b30c8[_0xf8b1('0x1b')]=qs[_0xf8b1('0x1b')](_0x395f97[_0xf8b1('0x2d')][_0xf8b1('0x1b')]);}return _0x5757d7[_0xf8b1('0x49')](_0x3b30c8);}})[_0xf8b1('0x22')](function(_0x3a9b46){if(_0x3a9b46){return _0x3a9b46?{'count':_0x45539e,'rows':_0x3a9b46}:null;}})['then'](respondWithResult(_0x336b6b,null))['catch'](handleError(_0x336b6b,null));};exports[_0xf8b1('0x4c')]=function(_0x53c7f5,_0x42d598,_0x43d16f){var _0x2b8b15={};var _0x13307b={};var _0x144a8d;var _0x208c6e;return db[_0xf8b1('0x29')][_0xf8b1('0x4a')]({'where':{'id':_0x53c7f5[_0xf8b1('0x40')]['id']}})[_0xf8b1('0x22')](handleEntityNotFound(_0x42d598,null))[_0xf8b1('0x22')](function(_0x1da8be){if(_0x1da8be){_0x144a8d=_0x1da8be;_0x13307b['model']=_[_0xf8b1('0x41')](db['SalesforceField'][_0xf8b1('0x42')]);_0x13307b[_0xf8b1('0x2d')]=_[_0xf8b1('0x41')](_0x53c7f5[_0xf8b1('0x2d')]);_0x13307b[_0xf8b1('0x2e')]=_[_0xf8b1('0x2f')](_0x13307b['model'],_0x13307b['query']);_0x2b8b15['attributes']=_[_0xf8b1('0x2f')](_0x13307b[_0xf8b1('0x2c')],qs['fields'](_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x30')]));_0x2b8b15[_0xf8b1('0x31')]=_0x2b8b15[_0xf8b1('0x31')]['length']?_0x2b8b15[_0xf8b1('0x31')]:_0x13307b[_0xf8b1('0x2c')];_0x2b8b15[_0xf8b1('0x35')]=qs[_0xf8b1('0x36')](_0x53c7f5['query'][_0xf8b1('0x36')]);_0x2b8b15[_0xf8b1('0x37')]=qs[_0xf8b1('0x2e')](_[_0xf8b1('0x4b')](_0x53c7f5['query'],_0x13307b['filters']));if(_0x53c7f5['query']['filter']){_0x2b8b15[_0xf8b1('0x37')]=_[_0xf8b1('0x39')](_0x2b8b15[_0xf8b1('0x37')],{'$or':_[_0xf8b1('0x28')](_0x2b8b15[_0xf8b1('0x31')],function(_0x3444dc){var _0x2e4855={};_0x2e4855[_0x3444dc]={'$like':'%'+_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x38')]+'%'};return _0x2e4855;})});}_0x2b8b15=_[_0xf8b1('0x39')]({},_0x2b8b15,_0x53c7f5[_0xf8b1('0x3a')]);return _0x144a8d['getDescriptions'](_0x2b8b15);}})[_0xf8b1('0x22')](function(_0x55c92a){if(_0x55c92a){_0x208c6e=_0x55c92a[_0xf8b1('0x32')];if(!_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x33')]('nolimit')){_0x2b8b15[_0xf8b1('0x19')]=qs[_0xf8b1('0x19')](_0x53c7f5[_0xf8b1('0x2d')][_0xf8b1('0x19')]);_0x2b8b15[_0xf8b1('0x1b')]=qs[_0xf8b1('0x1b')](_0x53c7f5['query'][_0xf8b1('0x1b')]);}return _0x144a8d['getDescriptions'](_0x2b8b15);}})['then'](function(_0x313ac7){if(_0x313ac7){return _0x313ac7?{'count':_0x208c6e,'rows':_0x313ac7}:null;}})[_0xf8b1('0x22')](respondWithResult(_0x42d598,null))[_0xf8b1('0x44')](handleError(_0x42d598,null));}; \ No newline at end of file +var _0xf12f=['rows','catch','show','params','find','create','update','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceConfiguration','includeAll','include','findAll'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xf12f,0x1bb));var _0xff12=function(_0xa590e7,_0x264d2f){_0xa590e7=_0xa590e7-0x0;var _0x3137b1=_0xf12f[_0xa590e7];return _0x3137b1;};'use strict';var emlformat=require(_0xff12('0x0'));var rimraf=require(_0xff12('0x1'));var zipdir=require(_0xff12('0x2'));var jsonpatch=require(_0xff12('0x3'));var rp=require(_0xff12('0x4'));var moment=require(_0xff12('0x5'));var BPromise=require(_0xff12('0x6'));var Mustache=require(_0xff12('0x7'));var util=require(_0xff12('0x8'));var path=require('path');var sox=require(_0xff12('0x9'));var csv=require('to-csv');var ejs=require(_0xff12('0xa'));var fs=require('fs');var fs_extra=require(_0xff12('0xb'));var _=require(_0xff12('0xc'));var squel=require(_0xff12('0xd'));var crypto=require(_0xff12('0xe'));var jsforce=require(_0xff12('0xf'));var deskjs=require(_0xff12('0x10'));var toCsv=require('to-csv');var querystring=require(_0xff12('0x11'));var Papa=require(_0xff12('0x12'));var Redis=require(_0xff12('0x13'));var authService=require(_0xff12('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xff12('0x15'));var hardwareService=require(_0xff12('0x16'));var logger=require(_0xff12('0x17'))(_0xff12('0x18'));var utils=require(_0xff12('0x19'));var config=require(_0xff12('0x1a'));var licenseUtil=require(_0xff12('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x254e51,_0xb83573){_0xb83573=_0xb83573||0xcc;return function(_0x48f186){if(_0x48f186){return _0x254e51['sendStatus'](_0xb83573);}return _0x254e51['status'](_0xb83573)[_0xff12('0x1c')]();};}function respondWithResult(_0x15a265,_0x3cd2e9){_0x3cd2e9=_0x3cd2e9||0xc8;return function(_0x41c94c){if(_0x41c94c){return _0x15a265[_0xff12('0x1d')](_0x3cd2e9)['json'](_0x41c94c);}};}function respondWithFilteredResult(_0x5016c5,_0x12e003){return function(_0x49f58b){if(_0x49f58b){var _0x26e747=typeof _0x12e003['offset']===_0xff12('0x1e')&&typeof _0x12e003[_0xff12('0x1f')]==='undefined';var _0x35f00f=_0x49f58b['count'];var _0x3546a7=_0x26e747?0x0:_0x12e003['offset'];var _0x262de1=_0x26e747?_0x49f58b[_0xff12('0x20')]:_0x12e003[_0xff12('0x21')]+_0x12e003[_0xff12('0x1f')];var _0x5ad06b;if(_0x262de1>=_0x35f00f){_0x262de1=_0x35f00f;_0x5ad06b=0xc8;}else{_0x5ad06b=0xce;}_0x5016c5[_0xff12('0x1d')](_0x5ad06b);return _0x5016c5[_0xff12('0x22')](_0xff12('0x23'),_0x3546a7+'-'+_0x262de1+'/'+_0x35f00f)[_0xff12('0x24')](_0x49f58b);}return null;};}function patchUpdates(_0x3bc4d8){return function(_0xbe4249){try{jsonpatch[_0xff12('0x25')](_0xbe4249,_0x3bc4d8,!![]);}catch(_0xc8895){return BPromise[_0xff12('0x26')](_0xc8895);}return _0xbe4249[_0xff12('0x27')]();};}function saveUpdates(_0x4b4883,_0x57b02a){return function(_0x35193b){if(_0x35193b){return _0x35193b['update'](_0x4b4883)['then'](function(_0x209de7){return _0x209de7;});}return null;};}function removeEntity(_0x2c6851,_0x17ed5a){return function(_0x1ac558){if(_0x1ac558){return _0x1ac558[_0xff12('0x28')]()[_0xff12('0x29')](function(){_0x2c6851['status'](0xcc)[_0xff12('0x1c')]();});}};}function handleEntityNotFound(_0x4b8ec8,_0x119475){return function(_0x23163f){if(!_0x23163f){_0x4b8ec8[_0xff12('0x2a')](0x194);}return _0x23163f;};}function handleError(_0x2cb008,_0x432b7e){_0x432b7e=_0x432b7e||0x1f4;return function(_0x3bfde5){logger[_0xff12('0x2b')](_0x3bfde5[_0xff12('0x2c')]);if(_0x3bfde5[_0xff12('0x2d')]){delete _0x3bfde5[_0xff12('0x2d')];}_0x2cb008[_0xff12('0x1d')](_0x432b7e)[_0xff12('0x2e')](_0x3bfde5);};}exports['index']=function(_0x39096a,_0x1e6f53){var _0x6b77db={},_0x19272c={},_0x59457c={'count':0x0,'rows':[]};var _0x35b30f=_[_0xff12('0x2f')](db['SalesforceConfiguration'][_0xff12('0x30')],function(_0x1446aa){return{'name':_0x1446aa[_0xff12('0x31')],'type':_0x1446aa[_0xff12('0x32')]['key']};});_0x19272c[_0xff12('0x33')]=_[_0xff12('0x2f')](_0x35b30f,'name');_0x19272c[_0xff12('0x34')]=_[_0xff12('0x35')](_0x39096a['query']);_0x19272c[_0xff12('0x36')]=_['intersection'](_0x19272c[_0xff12('0x33')],_0x19272c[_0xff12('0x34')]);_0x6b77db[_0xff12('0x37')]=_[_0xff12('0x38')](_0x19272c[_0xff12('0x33')],qs['fields'](_0x39096a['query'][_0xff12('0x39')]));_0x6b77db['attributes']=_0x6b77db[_0xff12('0x37')][_0xff12('0x3a')]?_0x6b77db[_0xff12('0x37')]:_0x19272c[_0xff12('0x33')];if(!_0x39096a[_0xff12('0x34')][_0xff12('0x3b')](_0xff12('0x3c'))){_0x6b77db['limit']=qs[_0xff12('0x1f')](_0x39096a[_0xff12('0x34')]['limit']);_0x6b77db[_0xff12('0x21')]=qs[_0xff12('0x21')](_0x39096a[_0xff12('0x34')][_0xff12('0x21')]);}_0x6b77db[_0xff12('0x3d')]=qs[_0xff12('0x3e')](_0x39096a[_0xff12('0x34')][_0xff12('0x3e')]);_0x6b77db[_0xff12('0x3f')]=qs[_0xff12('0x36')](_[_0xff12('0x40')](_0x39096a[_0xff12('0x34')],_0x19272c[_0xff12('0x36')]),_0x35b30f);if(_0x39096a[_0xff12('0x34')]['filter']){_0x6b77db[_0xff12('0x3f')]=_[_0xff12('0x41')](_0x6b77db[_0xff12('0x3f')],{'$or':_['map'](_0x35b30f,function(_0x46d0d3){if(_0x46d0d3[_0xff12('0x32')]!==_0xff12('0x42')){var _0x20310a={};_0x20310a[_0x46d0d3[_0xff12('0x2d')]]={'$like':'%'+_0x39096a[_0xff12('0x34')][_0xff12('0x43')]+'%'};return _0x20310a;}})});}_0x6b77db=_[_0xff12('0x41')]({},_0x6b77db,_0x39096a[_0xff12('0x44')]);var _0x55b7a4={'where':_0x6b77db[_0xff12('0x3f')]};return db[_0xff12('0x45')][_0xff12('0x20')](_0x55b7a4)['then'](function(_0x3b01c){_0x59457c[_0xff12('0x20')]=_0x3b01c;if(_0x39096a[_0xff12('0x34')][_0xff12('0x46')]){_0x6b77db[_0xff12('0x47')]=[{'all':!![]}];}return db[_0xff12('0x45')][_0xff12('0x48')](_0x6b77db);})[_0xff12('0x29')](function(_0x5edb33){_0x59457c[_0xff12('0x49')]=_0x5edb33;return _0x59457c;})['then'](respondWithFilteredResult(_0x1e6f53,_0x6b77db))[_0xff12('0x4a')](handleError(_0x1e6f53,null));};exports[_0xff12('0x4b')]=function(_0x552e57,_0x23d64e){var _0x40aae7={'raw':![],'where':{'id':_0x552e57[_0xff12('0x4c')]['id']}},_0x4b6942={};_0x4b6942['model']=_[_0xff12('0x35')](db[_0xff12('0x45')][_0xff12('0x30')]);_0x4b6942[_0xff12('0x34')]=_[_0xff12('0x35')](_0x552e57['query']);_0x4b6942['filters']=_[_0xff12('0x38')](_0x4b6942[_0xff12('0x33')],_0x4b6942[_0xff12('0x34')]);_0x40aae7['attributes']=_[_0xff12('0x38')](_0x4b6942['model'],qs[_0xff12('0x39')](_0x552e57['query']['fields']));_0x40aae7[_0xff12('0x37')]=_0x40aae7[_0xff12('0x37')][_0xff12('0x3a')]?_0x40aae7[_0xff12('0x37')]:_0x4b6942[_0xff12('0x33')];if(_0x552e57[_0xff12('0x34')][_0xff12('0x46')]){_0x40aae7[_0xff12('0x47')]=[{'all':!![]}];}_0x40aae7=_['merge']({},_0x40aae7,_0x552e57[_0xff12('0x44')]);return db[_0xff12('0x45')][_0xff12('0x4d')](_0x40aae7)[_0xff12('0x29')](handleEntityNotFound(_0x23d64e,null))[_0xff12('0x29')](respondWithResult(_0x23d64e,null))[_0xff12('0x4a')](handleError(_0x23d64e,null));};exports[_0xff12('0x4e')]=function(_0x57e87e,_0x33b608){return db[_0xff12('0x45')][_0xff12('0x4e')](_0x57e87e['body'],{})[_0xff12('0x29')](respondWithResult(_0x33b608,0xc9))['catch'](handleError(_0x33b608,null));};exports[_0xff12('0x4f')]=function(_0x52d1bf,_0x11ddc5){if(_0x52d1bf[_0xff12('0x50')]['id']){delete _0x52d1bf[_0xff12('0x50')]['id'];}return db['SalesforceConfiguration'][_0xff12('0x4d')]({'where':{'id':_0x52d1bf[_0xff12('0x4c')]['id']}})[_0xff12('0x29')](handleEntityNotFound(_0x11ddc5,null))[_0xff12('0x29')](saveUpdates(_0x52d1bf[_0xff12('0x50')],null))[_0xff12('0x29')](respondWithResult(_0x11ddc5,null))[_0xff12('0x4a')](handleError(_0x11ddc5,null));};exports[_0xff12('0x28')]=function(_0x45b604,_0x546d19){return db['SalesforceConfiguration']['find']({'where':{'id':_0x45b604[_0xff12('0x4c')]['id']}})[_0xff12('0x29')](handleEntityNotFound(_0x546d19,null))['then'](removeEntity(_0x546d19,null))[_0xff12('0x4a')](handleError(_0x546d19,null));};exports[_0xff12('0x51')]=function(_0x321b23,_0x33c5f5,_0x2e35ea){var _0x23810f={};var _0x199367={};var _0x482a9a;var _0x53ecc4;return db[_0xff12('0x45')][_0xff12('0x52')]({'where':{'id':_0x321b23[_0xff12('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33c5f5,null))[_0xff12('0x29')](function(_0x4fbfd8){if(_0x4fbfd8){_0x482a9a=_0x4fbfd8;_0x199367[_0xff12('0x33')]=_[_0xff12('0x35')](db['SalesforceField'][_0xff12('0x30')]);_0x199367[_0xff12('0x34')]=_['keys'](_0x321b23[_0xff12('0x34')]);_0x199367['filters']=_[_0xff12('0x38')](_0x199367['model'],_0x199367[_0xff12('0x34')]);_0x23810f[_0xff12('0x37')]=_['intersection'](_0x199367['model'],qs[_0xff12('0x39')](_0x321b23[_0xff12('0x34')][_0xff12('0x39')]));_0x23810f[_0xff12('0x37')]=_0x23810f[_0xff12('0x37')][_0xff12('0x3a')]?_0x23810f[_0xff12('0x37')]:_0x199367[_0xff12('0x33')];_0x23810f[_0xff12('0x3d')]=qs[_0xff12('0x3e')](_0x321b23['query']['sort']);_0x23810f[_0xff12('0x3f')]=qs[_0xff12('0x36')](_[_0xff12('0x40')](_0x321b23[_0xff12('0x34')],_0x199367['filters']));if(_0x321b23['query'][_0xff12('0x43')]){_0x23810f['where']=_[_0xff12('0x41')](_0x23810f[_0xff12('0x3f')],{'$or':_[_0xff12('0x2f')](_0x23810f[_0xff12('0x37')],function(_0x3bca27){var _0x1dc90a={};_0x1dc90a[_0x3bca27]={'$like':'%'+_0x321b23['query'][_0xff12('0x43')]+'%'};return _0x1dc90a;})});}_0x23810f=_['merge']({},_0x23810f,_0x321b23[_0xff12('0x44')]);return _0x482a9a[_0xff12('0x51')](_0x23810f);}})[_0xff12('0x29')](function(_0x27ade9){if(_0x27ade9){_0x53ecc4=_0x27ade9[_0xff12('0x3a')];if(!_0x321b23[_0xff12('0x34')][_0xff12('0x3b')]('nolimit')){_0x23810f[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x321b23[_0xff12('0x34')][_0xff12('0x1f')]);_0x23810f[_0xff12('0x21')]=qs['offset'](_0x321b23[_0xff12('0x34')][_0xff12('0x21')]);}return _0x482a9a[_0xff12('0x51')](_0x23810f);}})['then'](function(_0x113f13){if(_0x113f13){return _0x113f13?{'count':_0x53ecc4,'rows':_0x113f13}:null;}})[_0xff12('0x29')](respondWithResult(_0x33c5f5,null))[_0xff12('0x4a')](handleError(_0x33c5f5,null));};exports['getSubjects']=function(_0x5da66d,_0x1c6f0b,_0x4bbb13){var _0x39459b={};var _0x2e9c78={};var _0x2d3b58;var _0x25dba4;return db[_0xff12('0x45')][_0xff12('0x52')]({'where':{'id':_0x5da66d[_0xff12('0x4c')]['id']}})[_0xff12('0x29')](handleEntityNotFound(_0x1c6f0b,null))[_0xff12('0x29')](function(_0x103625){if(_0x103625){_0x2d3b58=_0x103625;_0x2e9c78[_0xff12('0x33')]=_['keys'](db[_0xff12('0x53')][_0xff12('0x30')]);_0x2e9c78['query']=_[_0xff12('0x35')](_0x5da66d[_0xff12('0x34')]);_0x2e9c78[_0xff12('0x36')]=_[_0xff12('0x38')](_0x2e9c78[_0xff12('0x33')],_0x2e9c78['query']);_0x39459b[_0xff12('0x37')]=_[_0xff12('0x38')](_0x2e9c78[_0xff12('0x33')],qs['fields'](_0x5da66d['query'][_0xff12('0x39')]));_0x39459b['attributes']=_0x39459b[_0xff12('0x37')][_0xff12('0x3a')]?_0x39459b['attributes']:_0x2e9c78[_0xff12('0x33')];_0x39459b['order']=qs[_0xff12('0x3e')](_0x5da66d[_0xff12('0x34')][_0xff12('0x3e')]);_0x39459b[_0xff12('0x3f')]=qs[_0xff12('0x36')](_[_0xff12('0x40')](_0x5da66d[_0xff12('0x34')],_0x2e9c78[_0xff12('0x36')]));if(_0x5da66d[_0xff12('0x34')][_0xff12('0x43')]){_0x39459b['where']=_[_0xff12('0x41')](_0x39459b[_0xff12('0x3f')],{'$or':_[_0xff12('0x2f')](_0x39459b[_0xff12('0x37')],function(_0xad1014){var _0xd42077={};_0xd42077[_0xad1014]={'$like':'%'+_0x5da66d[_0xff12('0x34')]['filter']+'%'};return _0xd42077;})});}_0x39459b=_['merge']({},_0x39459b,_0x5da66d[_0xff12('0x44')]);return _0x2d3b58[_0xff12('0x54')](_0x39459b);}})[_0xff12('0x29')](function(_0x17edd4){if(_0x17edd4){_0x25dba4=_0x17edd4[_0xff12('0x3a')];if(!_0x5da66d['query'][_0xff12('0x3b')](_0xff12('0x3c'))){_0x39459b[_0xff12('0x1f')]=qs['limit'](_0x5da66d[_0xff12('0x34')]['limit']);_0x39459b[_0xff12('0x21')]=qs['offset'](_0x5da66d[_0xff12('0x34')]['offset']);}return _0x2d3b58[_0xff12('0x54')](_0x39459b);}})[_0xff12('0x29')](function(_0x1cd47d){if(_0x1cd47d){return _0x1cd47d?{'count':_0x25dba4,'rows':_0x1cd47d}:null;}})['then'](respondWithResult(_0x1c6f0b,null))[_0xff12('0x4a')](handleError(_0x1c6f0b,null));};exports[_0xff12('0x55')]=function(_0x46bbc1,_0x3d7cfc,_0x3a2ac9){var _0x527988={};var _0x104b05={};var _0x4d03fc;var _0xb10a90;return db[_0xff12('0x45')][_0xff12('0x52')]({'where':{'id':_0x46bbc1['params']['id']}})[_0xff12('0x29')](handleEntityNotFound(_0x3d7cfc,null))[_0xff12('0x29')](function(_0x4c7426){if(_0x4c7426){_0x4d03fc=_0x4c7426;_0x104b05[_0xff12('0x33')]=_[_0xff12('0x35')](db[_0xff12('0x53')][_0xff12('0x30')]);_0x104b05['query']=_[_0xff12('0x35')](_0x46bbc1['query']);_0x104b05[_0xff12('0x36')]=_[_0xff12('0x38')](_0x104b05[_0xff12('0x33')],_0x104b05['query']);_0x527988[_0xff12('0x37')]=_[_0xff12('0x38')](_0x104b05[_0xff12('0x33')],qs['fields'](_0x46bbc1[_0xff12('0x34')][_0xff12('0x39')]));_0x527988[_0xff12('0x37')]=_0x527988[_0xff12('0x37')][_0xff12('0x3a')]?_0x527988['attributes']:_0x104b05['model'];_0x527988[_0xff12('0x3d')]=qs[_0xff12('0x3e')](_0x46bbc1[_0xff12('0x34')][_0xff12('0x3e')]);_0x527988[_0xff12('0x3f')]=qs[_0xff12('0x36')](_[_0xff12('0x40')](_0x46bbc1[_0xff12('0x34')],_0x104b05['filters']));if(_0x46bbc1['query'][_0xff12('0x43')]){_0x527988[_0xff12('0x3f')]=_[_0xff12('0x41')](_0x527988[_0xff12('0x3f')],{'$or':_['map'](_0x527988[_0xff12('0x37')],function(_0x52562d){var _0x243683={};_0x243683[_0x52562d]={'$like':'%'+_0x46bbc1['query']['filter']+'%'};return _0x243683;})});}_0x527988=_[_0xff12('0x41')]({},_0x527988,_0x46bbc1[_0xff12('0x44')]);return _0x4d03fc['getDescriptions'](_0x527988);}})[_0xff12('0x29')](function(_0x10210d){if(_0x10210d){_0xb10a90=_0x10210d[_0xff12('0x3a')];if(!_0x46bbc1[_0xff12('0x34')][_0xff12('0x3b')]('nolimit')){_0x527988[_0xff12('0x1f')]=qs['limit'](_0x46bbc1['query'][_0xff12('0x1f')]);_0x527988[_0xff12('0x21')]=qs[_0xff12('0x21')](_0x46bbc1[_0xff12('0x34')][_0xff12('0x21')]);}return _0x4d03fc[_0xff12('0x55')](_0x527988);}})[_0xff12('0x29')](function(_0x5304c5){if(_0x5304c5){return _0x5304c5?{'count':_0xb10a90,'rows':_0x5304c5}:null;}})[_0xff12('0x29')](respondWithResult(_0x3d7cfc,null))[_0xff12('0x4a')](handleError(_0x3d7cfc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 13e7f73..882a6a6 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 _0x3648=['./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x1f7e4a,_0x54ef35){var _0x4532a2=function(_0x4e948b){while(--_0x4e948b){_0x1f7e4a['push'](_0x1f7e4a['shift']());}};_0x4532a2(++_0x54ef35);}(_0x3648,0x1ee));var _0x8364=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3648[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8364('0x0'));var util=require('util');var logger=require(_0x8364('0x1'))(_0x8364('0x2'));var moment=require(_0x8364('0x3'));var BPromise=require('bluebird');var rp=require(_0x8364('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8364('0x5'));var attributes=require(_0x8364('0x6'));module[_0x8364('0x7')]=function(_0x42985d,_0xda8c18){return _0x42985d[_0x8364('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x8364('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a50=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x157348,_0x6d9d99){var _0x34cb47=function(_0x479b70){while(--_0x479b70){_0x157348['push'](_0x157348['shift']());}};_0x34cb47(++_0x6d9d99);}(_0x3a50,0x7a));var _0x03a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a50[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x03a5('0x0'));var util=require(_0x03a5('0x1'));var logger=require(_0x03a5('0x2'))(_0x03a5('0x3'));var moment=require(_0x03a5('0x4'));var BPromise=require(_0x03a5('0x5'));var rp=require(_0x03a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03a5('0x7'));var config=require(_0x03a5('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x445be1,_0x823bb5){return _0x445be1[_0x03a5('0x9')](_0x03a5('0xa'),attributes,{'tableName':_0x03a5('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 ef9195b..562fdf4 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 _0x8c5d=['client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4231c6,_0x59d4f4){var _0x2e86a2=function(_0x22ab8e){while(--_0x22ab8e){_0x4231c6['push'](_0x4231c6['shift']());}};_0x2e86a2(++_0x59d4f4);}(_0x8c5d,0x16b));var _0xd8c5=function(_0xdb2eb5,_0x248d67){_0xdb2eb5=_0xdb2eb5-0x0;var _0x5e0830=_0x8c5d[_0xdb2eb5];return _0x5e0830;};'use strict';var _=require(_0xd8c5('0x0'));var util=require(_0xd8c5('0x1'));var moment=require(_0xd8c5('0x2'));var BPromise=require(_0xd8c5('0x3'));var rs=require(_0xd8c5('0x4'));var fs=require('fs');var Redis=require(_0xd8c5('0x5'));var db=require(_0xd8c5('0x6'))['db'];var utils=require(_0xd8c5('0x7'));var logger=require(_0xd8c5('0x8'))(_0xd8c5('0x9'));var config=require('../../config/environment');var jayson=require(_0xd8c5('0xa'));var client=jayson[_0xd8c5('0xb')][_0xd8c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172687,_0x534941,_0x238705){return new BPromise(function(_0x5e4a5e,_0x43a131){return client[_0xd8c5('0xd')](_0x172687,_0x238705)[_0xd8c5('0xe')](function(_0x3bee2f){logger['info'](_0xd8c5('0xf'),_0x534941,_0xd8c5('0x10'));logger['debug'](_0xd8c5('0x11'),_0x534941,'request\x20sent',JSON[_0xd8c5('0x12')](_0x3bee2f));if(_0x3bee2f['error']){if(_0x3bee2f[_0xd8c5('0x13')]['code']===0x1f4){logger[_0xd8c5('0x13')](_0xd8c5('0xf'),_0x534941,_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);return _0x43a131(_0x3bee2f[_0xd8c5('0x13')]['message']);}logger['error'](_0xd8c5('0xf'),_0x534941,_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);return _0x5e4a5e(_0x3bee2f[_0xd8c5('0x13')][_0xd8c5('0x14')]);}else{logger['info'](_0xd8c5('0xf'),_0x534941,_0xd8c5('0x10'));_0x5e4a5e(_0x3bee2f['result'][_0xd8c5('0x14')]);}})[_0xd8c5('0x15')](function(_0x2b989b){logger[_0xd8c5('0x13')](_0xd8c5('0xf'),_0x534941,_0x2b989b);_0x43a131(_0x2b989b);});});} \ No newline at end of file +var _0xe0a2=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','code','message','error','catch','lodash','moment','bluebird','randomstring'];(function(_0x4c2b96,_0x17ab0d){var _0x2a62bf=function(_0x6069bd){while(--_0x6069bd){_0x4c2b96['push'](_0x4c2b96['shift']());}};_0x2a62bf(++_0x17ab0d);}(_0xe0a2,0x1ca));var _0x2e0a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe0a2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2e0a('0x0'));var util=require('util');var moment=require(_0x2e0a('0x1'));var BPromise=require(_0x2e0a('0x2'));var rs=require(_0x2e0a('0x3'));var fs=require('fs');var Redis=require(_0x2e0a('0x4'));var db=require(_0x2e0a('0x5'))['db'];var utils=require(_0x2e0a('0x6'));var logger=require('../../config/logger')(_0x2e0a('0x7'));var config=require(_0x2e0a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2e0a('0x9')][_0x2e0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x88b116,_0x5db8b8,_0x5b8864){return new BPromise(function(_0x305aac,_0x40a90e){return client['request'](_0x88b116,_0x5b8864)[_0x2e0a('0xb')](function(_0x407588){logger[_0x2e0a('0xc')](_0x2e0a('0xd'),_0x5db8b8,_0x2e0a('0xe'));logger[_0x2e0a('0xf')](_0x2e0a('0x10'),_0x5db8b8,_0x2e0a('0xe'),JSON['stringify'](_0x407588));if(_0x407588['error']){if(_0x407588['error'][_0x2e0a('0x11')]===0x1f4){logger['error'](_0x2e0a('0xd'),_0x5db8b8,_0x407588['error'][_0x2e0a('0x12')]);return _0x40a90e(_0x407588['error'][_0x2e0a('0x12')]);}logger[_0x2e0a('0x13')](_0x2e0a('0xd'),_0x5db8b8,_0x407588[_0x2e0a('0x13')]['message']);return _0x305aac(_0x407588[_0x2e0a('0x13')][_0x2e0a('0x12')]);}else{logger['info'](_0x2e0a('0xd'),_0x5db8b8,_0x2e0a('0xe'));_0x305aac(_0x407588['result'][_0x2e0a('0x12')]);}})[_0x2e0a('0x14')](function(_0x452456){logger['error'](_0x2e0a('0xd'),_0x5db8b8,_0x452456);_0x40a90e(_0x452456);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a9647bc..f9bb0fe 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 _0x5898=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','get','/:id','show','create','put','update'];(function(_0x1361d2,_0x337bfd){var _0x51f900=function(_0x56611a){while(--_0x56611a){_0x1361d2['push'](_0x1361d2['shift']());}};_0x51f900(++_0x337bfd);}(_0x5898,0x157));var _0x8589=function(_0x17c283,_0x587fcc){_0x17c283=_0x17c283-0x0;var _0x4e0800=_0x5898[_0x17c283];return _0x4e0800;};'use strict';var multer=require(_0x8589('0x0'));var util=require(_0x8589('0x1'));var path=require(_0x8589('0x2'));var timeout=require(_0x8589('0x3'));var express=require(_0x8589('0x4'));var router=express[_0x8589('0x5')]();var fs_extra=require(_0x8589('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8589('0x7'));var config=require(_0x8589('0x8'));var controller=require(_0x8589('0x9'));router['get']('/',auth[_0x8589('0xa')](),controller['index']);router[_0x8589('0xb')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0xd')]);router['post']('/',auth[_0x8589('0xa')](),controller[_0x8589('0xe')]);router[_0x8589('0xf')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0x10')]);router[_0x8589('0x11')](_0x8589('0xc'),auth['isAuthenticated'](),controller[_0x8589('0x12')]);module[_0x8589('0x13')]=router; \ No newline at end of file +var _0x8729=['index','/:id','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8729,0x170));var _0x9872=function(_0x5b90e8,_0x349677){_0x5b90e8=_0x5b90e8-0x0;var _0x533ef8=_0x8729[_0x5b90e8];return _0x533ef8;};'use strict';var multer=require('multer');var util=require(_0x9872('0x0'));var path=require(_0x9872('0x1'));var timeout=require(_0x9872('0x2'));var express=require(_0x9872('0x3'));var router=express[_0x9872('0x4')]();var fs_extra=require(_0x9872('0x5'));var auth=require(_0x9872('0x6'));var interaction=require(_0x9872('0x7'));var config=require(_0x9872('0x8'));var controller=require(_0x9872('0x9'));router[_0x9872('0xa')]('/',auth[_0x9872('0xb')](),controller[_0x9872('0xc')]);router['get'](_0x9872('0xd'),auth[_0x9872('0xb')](),controller['show']);router['post']('/',auth[_0x9872('0xb')](),controller[_0x9872('0xe')]);router[_0x9872('0xf')](_0x9872('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9872('0x10')](_0x9872('0xd'),auth[_0x9872('0xb')](),controller[_0x9872('0x11')]);module[_0x9872('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b4005d5..230b203 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 _0x3c6d=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x3c6d,0x1aa));var _0xd3c6=function(_0x51631a,_0x1ffe1c){_0x51631a=_0x51631a-0x0;var _0x4812d0=_0x3c6d[_0x51631a];return _0x4812d0;};'use strict';var Sequelize=require(_0xd3c6('0x0'));module[_0xd3c6('0x1')]={'type':{'type':Sequelize[_0xd3c6('0x2')](_0xd3c6('0x3'),_0xd3c6('0x4'),_0xd3c6('0x5'),_0xd3c6('0x6'),_0xd3c6('0x7')),'defaultValue':_0xd3c6('0x3')},'content':{'type':Sequelize[_0xd3c6('0x8')]},'key':{'type':Sequelize[_0xd3c6('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd3c6('0x4'),_0xd3c6('0x5'))},'keyContent':{'type':Sequelize[_0xd3c6('0x8')]},'idField':{'type':Sequelize[_0xd3c6('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6b0=['exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x325c1d,_0x3ef11a){var _0x5ae327=function(_0x58fe16){while(--_0x58fe16){_0x325c1d['push'](_0x325c1d['shift']());}};_0x5ae327(++_0x3ef11a);}(_0xf6b0,0x16c));var _0x0f6b=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf6b0[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module[_0x0f6b('0x0')]={'type':{'type':Sequelize[_0x0f6b('0x1')](_0x0f6b('0x2'),_0x0f6b('0x3'),_0x0f6b('0x4'),_0x0f6b('0x5'),'picklist'),'defaultValue':_0x0f6b('0x2')},'content':{'type':Sequelize[_0x0f6b('0x6')]},'key':{'type':Sequelize[_0x0f6b('0x6')]},'keyType':{'type':Sequelize[_0x0f6b('0x1')](_0x0f6b('0x2'),'variable',_0x0f6b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0f6b('0x6')]},'variableName':{'type':Sequelize[_0x0f6b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ab6a8af..ccdb746 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 _0x0501=['fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','save','update','then','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x0501,0x1a7));var _0x1050=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0x0501[_0x2a94cf];return _0x22147f;};'use strict';var emlformat=require(_0x1050('0x0'));var rimraf=require(_0x1050('0x1'));var zipdir=require(_0x1050('0x2'));var jsonpatch=require(_0x1050('0x3'));var rp=require(_0x1050('0x4'));var moment=require(_0x1050('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1050('0x6'));var util=require(_0x1050('0x7'));var path=require('path');var sox=require(_0x1050('0x8'));var csv=require(_0x1050('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1050('0xa'));var _=require(_0x1050('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1050('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1050('0xd'));var Papa=require('papaparse');var Redis=require(_0x1050('0xe'));var authService=require(_0x1050('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1050('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1050('0x11'))('api');var utils=require(_0x1050('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1050('0x13'));var db=require(_0x1050('0x14'))['db'];function respondWithStatusCode(_0x1ee20e,_0x4b9f78){_0x4b9f78=_0x4b9f78||0xcc;return function(_0x2e6fb9){if(_0x2e6fb9){return _0x1ee20e[_0x1050('0x15')](_0x4b9f78);}return _0x1ee20e[_0x1050('0x16')](_0x4b9f78)[_0x1050('0x17')]();};}function respondWithResult(_0x1d9244,_0x279996){_0x279996=_0x279996||0xc8;return function(_0x72ab9a){if(_0x72ab9a){return _0x1d9244[_0x1050('0x16')](_0x279996)['json'](_0x72ab9a);}};}function respondWithFilteredResult(_0x12e9d1,_0x130147){return function(_0x319d04){if(_0x319d04){var _0x3a24f8=typeof _0x130147['offset']==='undefined'&&typeof _0x130147['limit']===_0x1050('0x18');var _0x3b41c2=_0x319d04[_0x1050('0x19')];var _0x388742=_0x3a24f8?0x0:_0x130147['offset'];var _0x4df422=_0x3a24f8?_0x319d04[_0x1050('0x19')]:_0x130147[_0x1050('0x1a')]+_0x130147[_0x1050('0x1b')];var _0x20a4b1;if(_0x4df422>=_0x3b41c2){_0x4df422=_0x3b41c2;_0x20a4b1=0xc8;}else{_0x20a4b1=0xce;}_0x12e9d1[_0x1050('0x16')](_0x20a4b1);return _0x12e9d1[_0x1050('0x1c')]('Content-Range',_0x388742+'-'+_0x4df422+'/'+_0x3b41c2)[_0x1050('0x1d')](_0x319d04);}return null;};}function patchUpdates(_0x4a5c55){return function(_0x2df613){try{jsonpatch['apply'](_0x2df613,_0x4a5c55,!![]);}catch(_0x3a9bd8){return BPromise['reject'](_0x3a9bd8);}return _0x2df613[_0x1050('0x1e')]();};}function saveUpdates(_0x5f458e,_0x5d53f9){return function(_0x1818b5){if(_0x1818b5){return _0x1818b5[_0x1050('0x1f')](_0x5f458e)[_0x1050('0x20')](function(_0x4a1b0c){return _0x4a1b0c;});}return null;};}function removeEntity(_0x22dbc5,_0x2d333c){return function(_0x2154f5){if(_0x2154f5){return _0x2154f5['destroy']()[_0x1050('0x20')](function(){_0x22dbc5[_0x1050('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a066,_0x42c140){return function(_0x2a8b91){if(!_0x2a8b91){_0x41a066['sendStatus'](0x194);}return _0x2a8b91;};}function handleError(_0x4956f1,_0x5cf2c3){_0x5cf2c3=_0x5cf2c3||0x1f4;return function(_0x24e9be){logger[_0x1050('0x21')](_0x24e9be[_0x1050('0x22')]);if(_0x24e9be[_0x1050('0x23')]){delete _0x24e9be[_0x1050('0x23')];}_0x4956f1[_0x1050('0x16')](_0x5cf2c3)['send'](_0x24e9be);};}exports[_0x1050('0x24')]=function(_0x353238,_0x23538a){var _0x348625={},_0x2b7c94={},_0x42b6c0={'count':0x0,'rows':[]};var _0x25edf2=_[_0x1050('0x25')](db[_0x1050('0x26')][_0x1050('0x27')],function(_0xa853d2){return{'name':_0xa853d2[_0x1050('0x28')],'type':_0xa853d2['type'][_0x1050('0x29')]};});_0x2b7c94[_0x1050('0x2a')]=_[_0x1050('0x25')](_0x25edf2,_0x1050('0x23'));_0x2b7c94[_0x1050('0x2b')]=_[_0x1050('0x2c')](_0x353238[_0x1050('0x2b')]);_0x2b7c94['filters']=_[_0x1050('0x2d')](_0x2b7c94[_0x1050('0x2a')],_0x2b7c94['query']);_0x348625[_0x1050('0x2e')]=_[_0x1050('0x2d')](_0x2b7c94[_0x1050('0x2a')],qs[_0x1050('0x2f')](_0x353238[_0x1050('0x2b')][_0x1050('0x2f')]));_0x348625[_0x1050('0x2e')]=_0x348625['attributes'][_0x1050('0x30')]?_0x348625['attributes']:_0x2b7c94[_0x1050('0x2a')];if(!_0x353238[_0x1050('0x2b')][_0x1050('0x31')](_0x1050('0x32'))){_0x348625[_0x1050('0x1b')]=qs[_0x1050('0x1b')](_0x353238[_0x1050('0x2b')][_0x1050('0x1b')]);_0x348625[_0x1050('0x1a')]=qs[_0x1050('0x1a')](_0x353238[_0x1050('0x2b')][_0x1050('0x1a')]);}_0x348625[_0x1050('0x33')]=qs[_0x1050('0x34')](_0x353238['query'][_0x1050('0x34')]);_0x348625[_0x1050('0x35')]=qs[_0x1050('0x36')](_[_0x1050('0x37')](_0x353238[_0x1050('0x2b')],_0x2b7c94[_0x1050('0x36')]),_0x25edf2);if(_0x353238[_0x1050('0x2b')][_0x1050('0x38')]){_0x348625[_0x1050('0x35')]=_[_0x1050('0x39')](_0x348625['where'],{'$or':_[_0x1050('0x25')](_0x25edf2,function(_0x4ce3fa){if(_0x4ce3fa['type']!==_0x1050('0x3a')){var _0x5056df={};_0x5056df[_0x4ce3fa['name']]={'$like':'%'+_0x353238[_0x1050('0x2b')][_0x1050('0x38')]+'%'};return _0x5056df;}})});}_0x348625=_[_0x1050('0x39')]({},_0x348625,_0x353238['options']);var _0x5eb6ad={'where':_0x348625[_0x1050('0x35')]};return db[_0x1050('0x26')][_0x1050('0x19')](_0x5eb6ad)[_0x1050('0x20')](function(_0x106586){_0x42b6c0[_0x1050('0x19')]=_0x106586;if(_0x353238[_0x1050('0x2b')]['includeAll']){_0x348625['include']=[{'all':!![]}];}return db[_0x1050('0x26')][_0x1050('0x3b')](_0x348625);})[_0x1050('0x20')](function(_0x575da4){_0x42b6c0[_0x1050('0x3c')]=_0x575da4;return _0x42b6c0;})[_0x1050('0x20')](respondWithFilteredResult(_0x23538a,_0x348625))[_0x1050('0x3d')](handleError(_0x23538a,null));};exports[_0x1050('0x3e')]=function(_0x530d58,_0x24ec99){var _0x423fc5={'raw':!![],'where':{'id':_0x530d58[_0x1050('0x3f')]['id']}},_0x1b8517={};_0x1b8517['model']=_[_0x1050('0x2c')](db[_0x1050('0x26')]['rawAttributes']);_0x1b8517['query']=_[_0x1050('0x2c')](_0x530d58[_0x1050('0x2b')]);_0x1b8517[_0x1050('0x36')]=_[_0x1050('0x2d')](_0x1b8517[_0x1050('0x2a')],_0x1b8517[_0x1050('0x2b')]);_0x423fc5['attributes']=_['intersection'](_0x1b8517[_0x1050('0x2a')],qs[_0x1050('0x2f')](_0x530d58[_0x1050('0x2b')]['fields']));_0x423fc5['attributes']=_0x423fc5[_0x1050('0x2e')][_0x1050('0x30')]?_0x423fc5[_0x1050('0x2e')]:_0x1b8517[_0x1050('0x2a')];if(_0x530d58[_0x1050('0x2b')][_0x1050('0x40')]){_0x423fc5[_0x1050('0x41')]=[{'all':!![]}];}_0x423fc5=_[_0x1050('0x39')]({},_0x423fc5,_0x530d58[_0x1050('0x42')]);return db[_0x1050('0x26')][_0x1050('0x43')](_0x423fc5)[_0x1050('0x20')](handleEntityNotFound(_0x24ec99,null))[_0x1050('0x20')](respondWithResult(_0x24ec99,null))['catch'](handleError(_0x24ec99,null));};exports['create']=function(_0x1ca57a,_0xf7dc0e){return db[_0x1050('0x26')][_0x1050('0x44')](_0x1ca57a['body'],{})[_0x1050('0x20')](respondWithResult(_0xf7dc0e,0xc9))[_0x1050('0x3d')](handleError(_0xf7dc0e,null));};exports[_0x1050('0x1f')]=function(_0x369193,_0x18e40e){if(_0x369193[_0x1050('0x45')]['id']){delete _0x369193[_0x1050('0x45')]['id'];}return db[_0x1050('0x26')][_0x1050('0x43')]({'where':{'id':_0x369193['params']['id']}})['then'](handleEntityNotFound(_0x18e40e,null))[_0x1050('0x20')](saveUpdates(_0x369193['body'],null))[_0x1050('0x20')](respondWithResult(_0x18e40e,null))[_0x1050('0x3d')](handleError(_0x18e40e,null));};exports[_0x1050('0x46')]=function(_0x52f6fe,_0x257181){return db[_0x1050('0x26')]['find']({'where':{'id':_0x52f6fe[_0x1050('0x3f')]['id']}})['then'](handleEntityNotFound(_0x257181,null))[_0x1050('0x20')](removeEntity(_0x257181,null))[_0x1050('0x3d')](handleError(_0x257181,null));}; \ No newline at end of file +var _0xe690=['rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','SalesforceField','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','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','save','then','destroy','sendStatus','error','name','index','map'];(function(_0x49c40f,_0x380e7e){var _0x4796a2=function(_0x4e87bb){while(--_0x4e87bb){_0x49c40f['push'](_0x49c40f['shift']());}};_0x4796a2(++_0x380e7e);}(_0xe690,0x198));var _0x0e69=function(_0x365fa8,_0x4c34ca){_0x365fa8=_0x365fa8-0x0;var _0x4a6be9=_0xe690[_0x365fa8];return _0x4a6be9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e69('0x0'));var zipdir=require(_0x0e69('0x1'));var jsonpatch=require(_0x0e69('0x2'));var rp=require(_0x0e69('0x3'));var moment=require(_0x0e69('0x4'));var BPromise=require(_0x0e69('0x5'));var Mustache=require(_0x0e69('0x6'));var util=require('util');var path=require(_0x0e69('0x7'));var sox=require(_0x0e69('0x8'));var csv=require(_0x0e69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e69('0xa'));var _=require(_0x0e69('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e69('0xc'));var toCsv=require(_0x0e69('0x9'));var querystring=require(_0x0e69('0xd'));var Papa=require(_0x0e69('0xe'));var Redis=require(_0x0e69('0xf'));var authService=require(_0x0e69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0e69('0x11'));var hardwareService=require(_0x0e69('0x12'));var logger=require('../../config/logger')(_0x0e69('0x13'));var utils=require(_0x0e69('0x14'));var config=require(_0x0e69('0x15'));var licenseUtil=require(_0x0e69('0x16'));var db=require(_0x0e69('0x17'))['db'];function respondWithStatusCode(_0x23555f,_0x5346b6){_0x5346b6=_0x5346b6||0xcc;return function(_0x1e4d44){if(_0x1e4d44){return _0x23555f['sendStatus'](_0x5346b6);}return _0x23555f[_0x0e69('0x18')](_0x5346b6)[_0x0e69('0x19')]();};}function respondWithResult(_0x165254,_0x38fba4){_0x38fba4=_0x38fba4||0xc8;return function(_0x408ba6){if(_0x408ba6){return _0x165254[_0x0e69('0x18')](_0x38fba4)[_0x0e69('0x1a')](_0x408ba6);}};}function respondWithFilteredResult(_0x56d820,_0x21a9e1){return function(_0x1df87a){if(_0x1df87a){var _0x31426f=typeof _0x21a9e1[_0x0e69('0x1b')]===_0x0e69('0x1c')&&typeof _0x21a9e1[_0x0e69('0x1d')]===_0x0e69('0x1c');var _0x1f1327=_0x1df87a[_0x0e69('0x1e')];var _0x2a50c6=_0x31426f?0x0:_0x21a9e1['offset'];var _0x2c8de3=_0x31426f?_0x1df87a[_0x0e69('0x1e')]:_0x21a9e1[_0x0e69('0x1b')]+_0x21a9e1[_0x0e69('0x1d')];var _0x22c7a0;if(_0x2c8de3>=_0x1f1327){_0x2c8de3=_0x1f1327;_0x22c7a0=0xc8;}else{_0x22c7a0=0xce;}_0x56d820[_0x0e69('0x18')](_0x22c7a0);return _0x56d820[_0x0e69('0x1f')](_0x0e69('0x20'),_0x2a50c6+'-'+_0x2c8de3+'/'+_0x1f1327)[_0x0e69('0x1a')](_0x1df87a);}return null;};}function patchUpdates(_0x5b6163){return function(_0x3a941f){try{jsonpatch[_0x0e69('0x21')](_0x3a941f,_0x5b6163,!![]);}catch(_0x53f879){return BPromise['reject'](_0x53f879);}return _0x3a941f[_0x0e69('0x22')]();};}function saveUpdates(_0x3a0147,_0x4788b1){return function(_0x7ec588){if(_0x7ec588){return _0x7ec588['update'](_0x3a0147)[_0x0e69('0x23')](function(_0x3603de){return _0x3603de;});}return null;};}function removeEntity(_0x3ba16e,_0x338b97){return function(_0x4e1e5d){if(_0x4e1e5d){return _0x4e1e5d[_0x0e69('0x24')]()[_0x0e69('0x23')](function(){_0x3ba16e[_0x0e69('0x18')](0xcc)[_0x0e69('0x19')]();});}};}function handleEntityNotFound(_0x58e3ac,_0x49cc80){return function(_0x55a6ff){if(!_0x55a6ff){_0x58e3ac[_0x0e69('0x25')](0x194);}return _0x55a6ff;};}function handleError(_0x753a03,_0x37fcfe){_0x37fcfe=_0x37fcfe||0x1f4;return function(_0x13d1e1){logger[_0x0e69('0x26')](_0x13d1e1['stack']);if(_0x13d1e1[_0x0e69('0x27')]){delete _0x13d1e1['name'];}_0x753a03[_0x0e69('0x18')](_0x37fcfe)['send'](_0x13d1e1);};}exports[_0x0e69('0x28')]=function(_0x3100dd,_0x1dc220){var _0x2d7278={},_0xda19af={},_0x58f4f2={'count':0x0,'rows':[]};var _0x1c88c0=_[_0x0e69('0x29')](db['SalesforceField'][_0x0e69('0x2a')],function(_0x3ccf82){return{'name':_0x3ccf82[_0x0e69('0x2b')],'type':_0x3ccf82['type'][_0x0e69('0x2c')]};});_0xda19af[_0x0e69('0x2d')]=_[_0x0e69('0x29')](_0x1c88c0,_0x0e69('0x27'));_0xda19af['query']=_[_0x0e69('0x2e')](_0x3100dd['query']);_0xda19af[_0x0e69('0x2f')]=_[_0x0e69('0x30')](_0xda19af[_0x0e69('0x2d')],_0xda19af['query']);_0x2d7278[_0x0e69('0x31')]=_[_0x0e69('0x30')](_0xda19af[_0x0e69('0x2d')],qs[_0x0e69('0x32')](_0x3100dd[_0x0e69('0x33')][_0x0e69('0x32')]));_0x2d7278['attributes']=_0x2d7278[_0x0e69('0x31')][_0x0e69('0x34')]?_0x2d7278['attributes']:_0xda19af['model'];if(!_0x3100dd['query'][_0x0e69('0x35')](_0x0e69('0x36'))){_0x2d7278[_0x0e69('0x1d')]=qs[_0x0e69('0x1d')](_0x3100dd['query'][_0x0e69('0x1d')]);_0x2d7278[_0x0e69('0x1b')]=qs['offset'](_0x3100dd['query'][_0x0e69('0x1b')]);}_0x2d7278[_0x0e69('0x37')]=qs[_0x0e69('0x38')](_0x3100dd[_0x0e69('0x33')][_0x0e69('0x38')]);_0x2d7278[_0x0e69('0x39')]=qs[_0x0e69('0x2f')](_['pick'](_0x3100dd[_0x0e69('0x33')],_0xda19af[_0x0e69('0x2f')]),_0x1c88c0);if(_0x3100dd[_0x0e69('0x33')][_0x0e69('0x3a')]){_0x2d7278[_0x0e69('0x39')]=_['merge'](_0x2d7278['where'],{'$or':_[_0x0e69('0x29')](_0x1c88c0,function(_0x2f9ea9){if(_0x2f9ea9[_0x0e69('0x3b')]!==_0x0e69('0x3c')){var _0x463f77={};_0x463f77[_0x2f9ea9[_0x0e69('0x27')]]={'$like':'%'+_0x3100dd['query'][_0x0e69('0x3a')]+'%'};return _0x463f77;}})});}_0x2d7278=_[_0x0e69('0x3d')]({},_0x2d7278,_0x3100dd[_0x0e69('0x3e')]);var _0x35006f={'where':_0x2d7278[_0x0e69('0x39')]};return db[_0x0e69('0x3f')][_0x0e69('0x1e')](_0x35006f)[_0x0e69('0x23')](function(_0x5d859e){_0x58f4f2[_0x0e69('0x1e')]=_0x5d859e;if(_0x3100dd[_0x0e69('0x33')][_0x0e69('0x40')]){_0x2d7278[_0x0e69('0x41')]=[{'all':!![]}];}return db[_0x0e69('0x3f')][_0x0e69('0x42')](_0x2d7278);})[_0x0e69('0x23')](function(_0x321798){_0x58f4f2[_0x0e69('0x43')]=_0x321798;return _0x58f4f2;})[_0x0e69('0x23')](respondWithFilteredResult(_0x1dc220,_0x2d7278))[_0x0e69('0x44')](handleError(_0x1dc220,null));};exports[_0x0e69('0x45')]=function(_0x3a294f,_0x1bebf6){var _0x3e681b={'raw':!![],'where':{'id':_0x3a294f['params']['id']}},_0x416d7e={};_0x416d7e['model']=_['keys'](db[_0x0e69('0x3f')][_0x0e69('0x2a')]);_0x416d7e['query']=_[_0x0e69('0x2e')](_0x3a294f[_0x0e69('0x33')]);_0x416d7e[_0x0e69('0x2f')]=_[_0x0e69('0x30')](_0x416d7e[_0x0e69('0x2d')],_0x416d7e[_0x0e69('0x33')]);_0x3e681b[_0x0e69('0x31')]=_['intersection'](_0x416d7e['model'],qs[_0x0e69('0x32')](_0x3a294f[_0x0e69('0x33')][_0x0e69('0x32')]));_0x3e681b[_0x0e69('0x31')]=_0x3e681b[_0x0e69('0x31')][_0x0e69('0x34')]?_0x3e681b[_0x0e69('0x31')]:_0x416d7e[_0x0e69('0x2d')];if(_0x3a294f['query'][_0x0e69('0x40')]){_0x3e681b[_0x0e69('0x41')]=[{'all':!![]}];}_0x3e681b=_['merge']({},_0x3e681b,_0x3a294f[_0x0e69('0x3e')]);return db[_0x0e69('0x3f')][_0x0e69('0x46')](_0x3e681b)[_0x0e69('0x23')](handleEntityNotFound(_0x1bebf6,null))['then'](respondWithResult(_0x1bebf6,null))['catch'](handleError(_0x1bebf6,null));};exports[_0x0e69('0x47')]=function(_0x55492c,_0x475b34){return db[_0x0e69('0x3f')][_0x0e69('0x47')](_0x55492c[_0x0e69('0x48')],{})[_0x0e69('0x23')](respondWithResult(_0x475b34,0xc9))[_0x0e69('0x44')](handleError(_0x475b34,null));};exports[_0x0e69('0x49')]=function(_0x3fdc00,_0x1bcc17){if(_0x3fdc00[_0x0e69('0x48')]['id']){delete _0x3fdc00[_0x0e69('0x48')]['id'];}return db[_0x0e69('0x3f')]['find']({'where':{'id':_0x3fdc00[_0x0e69('0x4a')]['id']}})[_0x0e69('0x23')](handleEntityNotFound(_0x1bcc17,null))['then'](saveUpdates(_0x3fdc00[_0x0e69('0x48')],null))[_0x0e69('0x23')](respondWithResult(_0x1bcc17,null))[_0x0e69('0x44')](handleError(_0x1bcc17,null));};exports[_0x0e69('0x24')]=function(_0x4398e0,_0x252391){return db['SalesforceField'][_0x0e69('0x46')]({'where':{'id':_0x4398e0['params']['id']}})[_0x0e69('0x23')](handleEntityNotFound(_0x252391,null))[_0x0e69('0x23')](removeEntity(_0x252391,null))[_0x0e69('0x44')](handleError(_0x252391,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 10cb709..6c19a68 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 _0x183c=['exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x183c,0x14f));var _0xc183=function(_0x5bb21c,_0x10705b){_0x5bb21c=_0x5bb21c-0x0;var _0x5d2fbc=_0x183c[_0x5bb21c];return _0x5d2fbc;};'use strict';var _=require(_0xc183('0x0'));var util=require(_0xc183('0x1'));var logger=require(_0xc183('0x2'))(_0xc183('0x3'));var moment=require(_0xc183('0x4'));var BPromise=require(_0xc183('0x5'));var rp=require(_0xc183('0x6'));var fs=require('fs');var path=require(_0xc183('0x7'));var rimraf=require(_0xc183('0x8'));var config=require('../../config/environment');var attributes=require(_0xc183('0x9'));module[_0xc183('0xa')]=function(_0x1fdc78,_0x36c372){return _0x1fdc78[_0xc183('0xb')](_0xc183('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xc183('0xd'),'fields':['idField',_0xc183('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd03a=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a059,_0x4b0d2c){var _0xe485d0=function(_0x3a8df1){while(--_0x3a8df1){_0x4a059['push'](_0x4a059['shift']());}};_0xe485d0(++_0x4b0d2c);}(_0xd03a,0x13b));var _0xad03=function(_0x11d3f4,_0x5ca4b6){_0x11d3f4=_0x11d3f4-0x0;var _0x198c36=_0xd03a[_0x11d3f4];return _0x198c36;};'use strict';var _=require(_0xad03('0x0'));var util=require(_0xad03('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad03('0x2'));var rp=require(_0xad03('0x3'));var fs=require('fs');var path=require(_0xad03('0x4'));var rimraf=require(_0xad03('0x5'));var config=require(_0xad03('0x6'));var attributes=require(_0xad03('0x7'));module[_0xad03('0x8')]=function(_0x638a40,_0x435a09){return _0x638a40[_0xad03('0x9')](_0xad03('0xa'),attributes,{'tableName':_0xad03('0xb'),'paranoid':![],'indexes':[{'name':_0xad03('0xc'),'fields':['idField',_0xad03('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 558c085..5a2df96 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 _0x5caa=['jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x268916,_0x1c27e1){var _0x38f8a4=function(_0x5e9ea6){while(--_0x5e9ea6){_0x268916['push'](_0x268916['shift']());}};_0x38f8a4(++_0x1c27e1);}(_0x5caa,0x10c));var _0xa5ca=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5caa[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0xa5ca('0x0'));var moment=require(_0xa5ca('0x1'));var BPromise=require(_0xa5ca('0x2'));var rs=require(_0xa5ca('0x3'));var fs=require('fs');var Redis=require(_0xa5ca('0x4'));var db=require(_0xa5ca('0x5'))['db'];var utils=require(_0xa5ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5ca('0x7'));var jayson=require(_0xa5ca('0x8'));var client=jayson[_0xa5ca('0x9')][_0xa5ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272c64,_0x48cfb8,_0x2a3967){return new BPromise(function(_0x33b4b0,_0x54522f){return client[_0xa5ca('0xb')](_0x272c64,_0x2a3967)[_0xa5ca('0xc')](function(_0x45759f){logger[_0xa5ca('0xd')](_0xa5ca('0xe'),_0x48cfb8,_0xa5ca('0xf'));logger[_0xa5ca('0x10')](_0xa5ca('0x11'),_0x48cfb8,_0xa5ca('0xf'),JSON[_0xa5ca('0x12')](_0x45759f));if(_0x45759f[_0xa5ca('0x13')]){if(_0x45759f['error'][_0xa5ca('0x14')]===0x1f4){logger['error'](_0xa5ca('0xe'),_0x48cfb8,_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);return _0x54522f(_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);}logger[_0xa5ca('0x13')]('SalesforceField,\x20%s,\x20%s',_0x48cfb8,_0x45759f[_0xa5ca('0x13')]['message']);return _0x33b4b0(_0x45759f[_0xa5ca('0x13')][_0xa5ca('0x15')]);}else{logger[_0xa5ca('0xd')](_0xa5ca('0xe'),_0x48cfb8,_0xa5ca('0xf'));_0x33b4b0(_0x45759f[_0xa5ca('0x16')][_0xa5ca('0x15')]);}})['catch'](function(_0x3029f5){logger['error'](_0xa5ca('0xe'),_0x48cfb8,_0x3029f5);_0x54522f(_0x3029f5);});});} \ No newline at end of file +var _0x788b=['jayson/promise','client','http','request','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x232ef6,_0x3ee37d){var _0x45149d=function(_0x280b31){while(--_0x280b31){_0x232ef6['push'](_0x232ef6['shift']());}};_0x45149d(++_0x3ee37d);}(_0x788b,0x10a));var _0xb788=function(_0x3fe1e1,_0x1101f9){_0x3fe1e1=_0x3fe1e1-0x0;var _0x220b16=_0x788b[_0x3fe1e1];return _0x220b16;};'use strict';var _=require(_0xb788('0x0'));var util=require(_0xb788('0x1'));var moment=require('moment');var BPromise=require(_0xb788('0x2'));var rs=require(_0xb788('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb788('0x4'))['db'];var utils=require(_0xb788('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb788('0x6'));var jayson=require(_0xb788('0x7'));var client=jayson[_0xb788('0x8')][_0xb788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e533e,_0x4f8a36,_0x456991){return new BPromise(function(_0xa40d76,_0x4ae494){return client[_0xb788('0xa')](_0x4e533e,_0x456991)[_0xb788('0xb')](function(_0x11441f){logger[_0xb788('0xc')]('SalesforceField,\x20%s,\x20%s',_0x4f8a36,_0xb788('0xd'));logger['debug'](_0xb788('0xe'),_0x4f8a36,'request\x20sent',JSON['stringify'](_0x11441f));if(_0x11441f[_0xb788('0xf')]){if(_0x11441f[_0xb788('0xf')][_0xb788('0x10')]===0x1f4){logger[_0xb788('0xf')](_0xb788('0x11'),_0x4f8a36,_0x11441f[_0xb788('0xf')][_0xb788('0x12')]);return _0x4ae494(_0x11441f[_0xb788('0xf')][_0xb788('0x12')]);}logger[_0xb788('0xf')](_0xb788('0x11'),_0x4f8a36,_0x11441f['error']['message']);return _0xa40d76(_0x11441f[_0xb788('0xf')][_0xb788('0x12')]);}else{logger[_0xb788('0xc')](_0xb788('0x11'),_0x4f8a36,_0xb788('0xd'));_0xa40d76(_0x11441f[_0xb788('0x13')][_0xb788('0x12')]);}})[_0xb788('0x14')](function(_0x54156a){logger[_0xb788('0xf')]('SalesforceField,\x20%s,\x20%s',_0x4f8a36,_0x54156a);_0x4ae494(_0x54156a);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b113121..52dc7e5 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 _0xd588=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x27e49a,_0x32735d){var _0x1cd4e5=function(_0x411255){while(--_0x411255){_0x27e49a['push'](_0x27e49a['shift']());}};_0x1cd4e5(++_0x32735d);}(_0xd588,0x195));var _0x8d58=function(_0x238e4e,_0x2755f4){_0x238e4e=_0x238e4e-0x0;var _0x58962f=_0xd588[_0x238e4e];return _0x58962f;};'use strict';var multer=require(_0x8d58('0x0'));var util=require('util');var path=require(_0x8d58('0x1'));var timeout=require(_0x8d58('0x2'));var express=require(_0x8d58('0x3'));var router=express[_0x8d58('0x4')]();var fs_extra=require(_0x8d58('0x5'));var auth=require(_0x8d58('0x6'));var interaction=require(_0x8d58('0x7'));var config=require(_0x8d58('0x8'));var controller=require(_0x8d58('0x9'));router[_0x8d58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8d58('0xb'),auth[_0x8d58('0xc')](),controller[_0x8d58('0xd')]);router[_0x8d58('0xa')]('/:id/configurations',auth[_0x8d58('0xc')](),controller[_0x8d58('0xe')]);router[_0x8d58('0xa')](_0x8d58('0xf'),auth['isAuthenticated'](),controller[_0x8d58('0x10')]);router[_0x8d58('0x11')]('/',auth[_0x8d58('0xc')](),controller[_0x8d58('0x12')]);router[_0x8d58('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8d58('0x13')]);router[_0x8d58('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8d58('0x15')]);router[_0x8d58('0x16')](_0x8d58('0xb'),auth[_0x8d58('0xc')](),controller[_0x8d58('0x17')]);module[_0x8d58('0x18')]=router; \ No newline at end of file +var _0xeda0=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x48ac49,_0x408719){var _0x195df2=function(_0x1c6a42){while(--_0x1c6a42){_0x48ac49['push'](_0x48ac49['shift']());}};_0x195df2(++_0x408719);}(_0xeda0,0x1d8));var _0x0eda=function(_0x48551f,_0x35d76b){_0x48551f=_0x48551f-0x0;var _0x525bfc=_0xeda0[_0x48551f];return _0x525bfc;};'use strict';var multer=require(_0x0eda('0x0'));var util=require(_0x0eda('0x1'));var path=require(_0x0eda('0x2'));var timeout=require('connect-timeout');var express=require(_0x0eda('0x3'));var router=express[_0x0eda('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0eda('0x5'));var config=require(_0x0eda('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x0eda('0x7')]('/',auth[_0x0eda('0x8')](),controller[_0x0eda('0x9')]);router[_0x0eda('0x7')](_0x0eda('0xa'),auth[_0x0eda('0x8')](),controller[_0x0eda('0xb')]);router[_0x0eda('0x7')](_0x0eda('0xc'),auth['isAuthenticated'](),controller[_0x0eda('0xd')]);router[_0x0eda('0x7')](_0x0eda('0xe'),auth[_0x0eda('0x8')](),controller[_0x0eda('0xf')]);router[_0x0eda('0x10')]('/',auth['isAuthenticated'](),controller[_0x0eda('0x11')]);router[_0x0eda('0x10')](_0x0eda('0xc'),auth[_0x0eda('0x8')](),controller[_0x0eda('0x12')]);router[_0x0eda('0x13')]('/:id',auth[_0x0eda('0x8')](),controller[_0x0eda('0x14')]);router['delete']('/:id',auth[_0x0eda('0x8')](),controller[_0x0eda('0x15')]);module[_0x0eda('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index dd28c44..322427d 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 _0x8722=['sequelize','exports','STRING','username'];(function(_0x349c2b,_0x3c316f){var _0xb77279=function(_0x57c342){while(--_0x57c342){_0x349c2b['push'](_0x349c2b['shift']());}};_0xb77279(++_0x3c316f);}(_0x8722,0xc4));var _0x2872=function(_0x55fc56,_0xbe231f){_0x55fc56=_0x55fc56-0x0;var _0x2d5c9d=_0x8722[_0x55fc56];return _0x2d5c9d;};'use strict';var Sequelize=require(_0x2872('0x0'));module[_0x2872('0x1')]={'name':{'type':Sequelize[_0x2872('0x2')]},'description':{'type':Sequelize[_0x2872('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2872('0x3')},'password':{'type':Sequelize[_0x2872('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2872('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2872('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8bd1=['sequelize','STRING','username'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8bd1,0x159));var _0x18bd=function(_0x5aa189,_0x298f13){_0x5aa189=_0x5aa189-0x0;var _0x2f4a59=_0x8bd1[_0x5aa189];return _0x2f4a59;};'use strict';var Sequelize=require(_0x18bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x18bd('0x1')]},'description':{'type':Sequelize[_0x18bd('0x1')]},'username':{'type':Sequelize[_0x18bd('0x1')],'unique':_0x18bd('0x2')},'password':{'type':Sequelize[_0x18bd('0x1')]},'email':{'type':Sequelize[_0x18bd('0x1')]},'remoteUri':{'type':Sequelize[_0x18bd('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x18bd('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8b212d0..81f33ed 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 _0xfe1c=['findAll','catch','params','rawAttributes','create','body','find','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','Subjects','Descriptions','channel','ServicenowField','getFields','knowledge','subcategory','notify','incident_state','severity','category','made_sla','upon_reject','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','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','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowAccount','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include'];(function(_0x45765b,_0x55564f){var _0x32305a=function(_0x154002){while(--_0x154002){_0x45765b['push'](_0x45765b['shift']());}};_0x32305a(++_0x55564f);}(_0xfe1c,0x11a));var _0xcfe1=function(_0x5043ed,_0x2b8a50){_0x5043ed=_0x5043ed-0x0;var _0x5becf0=_0xfe1c[_0x5043ed];return _0x5becf0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcfe1('0x0'));var jsonpatch=require(_0xcfe1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfe1('0x2'));var Mustache=require(_0xcfe1('0x3'));var util=require(_0xcfe1('0x4'));var path=require(_0xcfe1('0x5'));var sox=require(_0xcfe1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfe1('0x7'));var _=require('lodash');var squel=require(_0xcfe1('0x8'));var crypto=require(_0xcfe1('0x9'));var jsforce=require(_0xcfe1('0xa'));var deskjs=require(_0xcfe1('0xb'));var toCsv=require(_0xcfe1('0xc'));var querystring=require(_0xcfe1('0xd'));var Papa=require(_0xcfe1('0xe'));var Redis=require(_0xcfe1('0xf'));var authService=require(_0xcfe1('0x10'));var qs=require(_0xcfe1('0x11'));var as=require(_0xcfe1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcfe1('0x13'));var config=require(_0xcfe1('0x14'));var licenseUtil=require(_0xcfe1('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4301d2,_0x1cdf51){_0x1cdf51=_0x1cdf51||0xcc;return function(_0xeefc78){if(_0xeefc78){return _0x4301d2['sendStatus'](_0x1cdf51);}return _0x4301d2[_0xcfe1('0x16')](_0x1cdf51)['end']();};}function respondWithResult(_0x1e7f90,_0x35e31c){_0x35e31c=_0x35e31c||0xc8;return function(_0x34915e){if(_0x34915e){return _0x1e7f90[_0xcfe1('0x16')](_0x35e31c)[_0xcfe1('0x17')](_0x34915e);}};}function respondWithFilteredResult(_0x24cad2,_0xf8c47e){return function(_0x41fb9e){if(_0x41fb9e){var _0x21a75e=typeof _0xf8c47e[_0xcfe1('0x18')]===_0xcfe1('0x19')&&typeof _0xf8c47e['limit']==='undefined';var _0x218093=_0x41fb9e[_0xcfe1('0x1a')];var _0xdd07fd=_0x21a75e?0x0:_0xf8c47e[_0xcfe1('0x18')];var _0x5f51a3=_0x21a75e?_0x41fb9e['count']:_0xf8c47e['offset']+_0xf8c47e[_0xcfe1('0x1b')];var _0x4ac288;if(_0x5f51a3>=_0x218093){_0x5f51a3=_0x218093;_0x4ac288=0xc8;}else{_0x4ac288=0xce;}_0x24cad2['status'](_0x4ac288);return _0x24cad2['set'](_0xcfe1('0x1c'),_0xdd07fd+'-'+_0x5f51a3+'/'+_0x218093)['json'](_0x41fb9e);}return null;};}function patchUpdates(_0x1b36a8){return function(_0x3ac854){try{jsonpatch[_0xcfe1('0x1d')](_0x3ac854,_0x1b36a8,!![]);}catch(_0x3373f6){return BPromise[_0xcfe1('0x1e')](_0x3373f6);}return _0x3ac854[_0xcfe1('0x1f')]();};}function saveUpdates(_0x3057a6,_0x5a0cf2){return function(_0x5a01eb){if(_0x5a01eb){return _0x5a01eb[_0xcfe1('0x20')](_0x3057a6)[_0xcfe1('0x21')](function(_0x18e977){return _0x18e977;});}return null;};}function removeEntity(_0x3663f7,_0x58ff5b){return function(_0x56c2bc){if(_0x56c2bc){return _0x56c2bc[_0xcfe1('0x22')]()[_0xcfe1('0x21')](function(){_0x3663f7[_0xcfe1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64f80,_0x15119d){return function(_0x248501){if(!_0x248501){_0xe64f80[_0xcfe1('0x23')](0x194);}return _0x248501;};}function handleError(_0x477890,_0x30f691){_0x30f691=_0x30f691||0x1f4;return function(_0x51ef7f){logger[_0xcfe1('0x24')](_0x51ef7f[_0xcfe1('0x25')]);if(_0x51ef7f['name']){delete _0x51ef7f[_0xcfe1('0x26')];}_0x477890[_0xcfe1('0x16')](_0x30f691)[_0xcfe1('0x27')](_0x51ef7f);};}exports['index']=function(_0x2b28d7,_0x389526){var _0x4b6d25={},_0x1bd2af={},_0x247f33={'count':0x0,'rows':[]};var _0x555ebb=_[_0xcfe1('0x28')](db[_0xcfe1('0x29')]['rawAttributes'],function(_0x6b001e){return{'name':_0x6b001e['fieldName'],'type':_0x6b001e['type'][_0xcfe1('0x2a')]};});_0x1bd2af[_0xcfe1('0x2b')]=_[_0xcfe1('0x28')](_0x555ebb,_0xcfe1('0x26'));_0x1bd2af[_0xcfe1('0x2c')]=_[_0xcfe1('0x2d')](_0x2b28d7[_0xcfe1('0x2c')]);_0x1bd2af[_0xcfe1('0x2e')]=_[_0xcfe1('0x2f')](_0x1bd2af[_0xcfe1('0x2b')],_0x1bd2af[_0xcfe1('0x2c')]);_0x4b6d25['attributes']=_['intersection'](_0x1bd2af[_0xcfe1('0x2b')],qs[_0xcfe1('0x30')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0x4b6d25[_0xcfe1('0x31')]=_0x4b6d25[_0xcfe1('0x31')][_0xcfe1('0x32')]?_0x4b6d25[_0xcfe1('0x31')]:_0x1bd2af['model'];if(!_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x33')]('nolimit')){_0x4b6d25[_0xcfe1('0x1b')]=qs[_0xcfe1('0x1b')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x1b')]);_0x4b6d25[_0xcfe1('0x18')]=qs[_0xcfe1('0x18')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x18')]);}_0x4b6d25['order']=qs[_0xcfe1('0x34')](_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x34')]);_0x4b6d25[_0xcfe1('0x35')]=qs[_0xcfe1('0x2e')](_[_0xcfe1('0x36')](_0x2b28d7[_0xcfe1('0x2c')],_0x1bd2af['filters']),_0x555ebb);if(_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x37')]){_0x4b6d25['where']=_['merge'](_0x4b6d25[_0xcfe1('0x35')],{'$or':_['map'](_0x555ebb,function(_0x480628){if(_0x480628[_0xcfe1('0x38')]!==_0xcfe1('0x39')){var _0x342771={};_0x342771[_0x480628[_0xcfe1('0x26')]]={'$like':'%'+_0x2b28d7[_0xcfe1('0x2c')]['filter']+'%'};return _0x342771;}})});}_0x4b6d25=_[_0xcfe1('0x3a')]({},_0x4b6d25,_0x2b28d7[_0xcfe1('0x3b')]);var _0x3ff352={'where':_0x4b6d25[_0xcfe1('0x35')]};return db[_0xcfe1('0x29')][_0xcfe1('0x1a')](_0x3ff352)[_0xcfe1('0x21')](function(_0x469c60){_0x247f33[_0xcfe1('0x1a')]=_0x469c60;if(_0x2b28d7[_0xcfe1('0x2c')][_0xcfe1('0x3c')]){_0x4b6d25[_0xcfe1('0x3d')]=[{'all':!![]}];}return db[_0xcfe1('0x29')][_0xcfe1('0x3e')](_0x4b6d25);})[_0xcfe1('0x21')](function(_0x1aaee0){_0x247f33['rows']=_0x1aaee0;return _0x247f33;})['then'](respondWithFilteredResult(_0x389526,_0x4b6d25))[_0xcfe1('0x3f')](handleError(_0x389526,null));};exports['show']=function(_0x3392b3,_0x8d6e81){var _0x3dab60={'raw':![],'where':{'id':_0x3392b3[_0xcfe1('0x40')]['id']}},_0x2a7bbc={};_0x2a7bbc[_0xcfe1('0x2b')]=_['keys'](db['ServicenowAccount'][_0xcfe1('0x41')]);_0x2a7bbc[_0xcfe1('0x2c')]=_['keys'](_0x3392b3[_0xcfe1('0x2c')]);_0x2a7bbc['filters']=_[_0xcfe1('0x2f')](_0x2a7bbc[_0xcfe1('0x2b')],_0x2a7bbc[_0xcfe1('0x2c')]);_0x3dab60[_0xcfe1('0x31')]=_[_0xcfe1('0x2f')](_0x2a7bbc[_0xcfe1('0x2b')],qs[_0xcfe1('0x30')](_0x3392b3[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0x3dab60[_0xcfe1('0x31')]=_0x3dab60['attributes'][_0xcfe1('0x32')]?_0x3dab60['attributes']:_0x2a7bbc['model'];if(_0x3392b3[_0xcfe1('0x2c')][_0xcfe1('0x3c')]){_0x3dab60['include']=[{'all':!![]}];}_0x3dab60=_['merge']({},_0x3dab60,_0x3392b3[_0xcfe1('0x3b')]);return db['ServicenowAccount']['find'](_0x3dab60)['then'](handleEntityNotFound(_0x8d6e81,null))[_0xcfe1('0x21')](respondWithResult(_0x8d6e81,null))['catch'](handleError(_0x8d6e81,null));};exports[_0xcfe1('0x42')]=function(_0x560f1e,_0x1d8a3c){return db[_0xcfe1('0x29')][_0xcfe1('0x42')](_0x560f1e[_0xcfe1('0x43')],{})[_0xcfe1('0x21')](respondWithResult(_0x1d8a3c,0xc9))['catch'](handleError(_0x1d8a3c,null));};exports[_0xcfe1('0x20')]=function(_0x8f86f4,_0x1ccd3f){if(_0x8f86f4[_0xcfe1('0x43')]['id']){delete _0x8f86f4['body']['id'];}return db[_0xcfe1('0x29')][_0xcfe1('0x44')]({'where':{'id':_0x8f86f4[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x1ccd3f,null))[_0xcfe1('0x21')](saveUpdates(_0x8f86f4['body'],null))['then'](respondWithResult(_0x1ccd3f,null))[_0xcfe1('0x3f')](handleError(_0x1ccd3f,null));};exports[_0xcfe1('0x22')]=function(_0x295fc2,_0x174cab){return db[_0xcfe1('0x29')][_0xcfe1('0x44')]({'where':{'id':_0x295fc2[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x174cab,null))[_0xcfe1('0x21')](removeEntity(_0x174cab,null))[_0xcfe1('0x3f')](handleError(_0x174cab,null));};exports[_0xcfe1('0x45')]=function(_0x2f6f93,_0x593f9a,_0x154dff){var _0xf836f1={};var _0x43ab60={};var _0x171cf1;var _0x461e19;return db[_0xcfe1('0x29')]['findOne']({'where':{'id':_0x2f6f93[_0xcfe1('0x40')]['id']}})[_0xcfe1('0x21')](handleEntityNotFound(_0x593f9a,null))[_0xcfe1('0x21')](function(_0x5788e1){if(_0x5788e1){_0x171cf1=_0x5788e1;_0x43ab60[_0xcfe1('0x2b')]=_['keys'](db[_0xcfe1('0x46')][_0xcfe1('0x41')]);_0x43ab60[_0xcfe1('0x2c')]=_[_0xcfe1('0x2d')](_0x2f6f93['query']);_0x43ab60[_0xcfe1('0x2e')]=_[_0xcfe1('0x2f')](_0x43ab60['model'],_0x43ab60[_0xcfe1('0x2c')]);_0xf836f1[_0xcfe1('0x31')]=_['intersection'](_0x43ab60['model'],qs['fields'](_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x30')]));_0xf836f1[_0xcfe1('0x31')]=_0xf836f1['attributes']['length']?_0xf836f1[_0xcfe1('0x31')]:_0x43ab60[_0xcfe1('0x2b')];_0xf836f1['order']=qs[_0xcfe1('0x34')](_0x2f6f93['query'][_0xcfe1('0x34')]);_0xf836f1[_0xcfe1('0x35')]=qs['filters'](_[_0xcfe1('0x36')](_0x2f6f93['query'],_0x43ab60[_0xcfe1('0x2e')]));if(_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x37')]){_0xf836f1['where']=_['merge'](_0xf836f1['where'],{'$or':_[_0xcfe1('0x28')](_0xf836f1['attributes'],function(_0x3a0ffb){var _0x2709a0={};_0x2709a0[_0x3a0ffb]={'$like':'%'+_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x37')]+'%'};return _0x2709a0;})});}_0xf836f1=_['merge']({},_0xf836f1,_0x2f6f93[_0xcfe1('0x3b')]);return _0x171cf1['getConfigurations'](_0xf836f1);}})['then'](function(_0x5a262d){if(_0x5a262d){_0x461e19=_0x5a262d[_0xcfe1('0x32')];if(!_0x2f6f93[_0xcfe1('0x2c')][_0xcfe1('0x33')]('nolimit')){_0xf836f1['limit']=qs['limit'](_0x2f6f93['query'][_0xcfe1('0x1b')]);_0xf836f1[_0xcfe1('0x18')]=qs['offset'](_0x2f6f93[_0xcfe1('0x2c')]['offset']);}return _0x171cf1[_0xcfe1('0x45')](_0xf836f1);}})['then'](function(_0x1b7624){if(_0x1b7624){return _0x1b7624?{'count':_0x461e19,'rows':_0x1b7624}:null;}})['then'](respondWithResult(_0x593f9a,null))[_0xcfe1('0x3f')](handleError(_0x593f9a,null));};exports[_0xcfe1('0x47')]=function(_0x1efbb5,_0x1841bc,_0x42e3b6){if(_0x1efbb5[_0xcfe1('0x43')]['id']){delete _0x1efbb5[_0xcfe1('0x43')]['id'];}return db[_0xcfe1('0x29')][_0xcfe1('0x48')]({'where':{'id':_0x1efbb5['params']['id']}})['then'](handleEntityNotFound(_0x1841bc,null))[_0xcfe1('0x21')](function(_0x356e36){if(_0x356e36){_0x1efbb5[_0xcfe1('0x43')]['AccountId']=_0x356e36['id'];_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x49')]=integrations['getSubjects'](_0x1efbb5[_0xcfe1('0x43')]['channel'],_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x38')]);_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x4a')]=integrations['getDescriptions'](_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x4b')],_0x1efbb5[_0xcfe1('0x43')][_0xcfe1('0x38')]);return db[_0xcfe1('0x46')]['create'](_0x1efbb5[_0xcfe1('0x43')],{'include':[{'model':db[_0xcfe1('0x4c')],'as':_0xcfe1('0x49')},{'model':db[_0xcfe1('0x4c')],'as':_0xcfe1('0x4a')}]});}return null;})[_0xcfe1('0x21')](respondWithResult(_0x1841bc,null))['catch'](handleError(_0x1841bc,null));};exports[_0xcfe1('0x4d')]=function(_0x3f4cd5,_0x185e77,_0x112829){var _0x5227b7=['made_sla','hold_reason',_0xcfe1('0x4e'),_0xcfe1('0x4f'),'close_code',_0xcfe1('0x50'),_0xcfe1('0x51'),_0xcfe1('0x52'),_0xcfe1('0x53')];var _0xa26293=['parent',_0xcfe1('0x54'),'caused_by','watch_list',_0xcfe1('0x55'),'sys_updated_on','child_incidents',_0xcfe1('0x56'),_0xcfe1('0x57'),'number',_0xcfe1('0x58'),'sys_updated_by',_0xcfe1('0x59'),_0xcfe1('0x5a'),_0xcfe1('0x5b'),'sys_domain',_0xcfe1('0x5c'),_0xcfe1('0x5d'),_0xcfe1('0x4e'),'order',_0xcfe1('0x5e'),_0xcfe1('0x5f'),_0xcfe1('0x60'),_0xcfe1('0x61'),'impact',_0xcfe1('0x62'),_0xcfe1('0x63'),_0xcfe1('0x64'),'priority','sys_domain_path','rfc','time_worked',_0xcfe1('0x65'),_0xcfe1('0x66'),_0xcfe1('0x67'),_0xcfe1('0x68'),_0xcfe1('0x69'),_0xcfe1('0x6a'),'resolved_at',_0xcfe1('0x6b'),_0xcfe1('0x6c'),_0xcfe1('0x4f'),_0xcfe1('0x6d'),_0xcfe1('0x6e'),_0xcfe1('0x6f'),'correlation_display',_0xcfe1('0x70'),_0xcfe1('0x71'),_0xcfe1('0x72'),_0xcfe1('0x73'),'additional_assignee_list',_0xcfe1('0x74'),_0xcfe1('0x75'),'notify',_0xcfe1('0x76'),_0xcfe1('0x77'),_0xcfe1('0x78'),_0xcfe1('0x79'),_0xcfe1('0x7a'),'sys_id',_0xcfe1('0x7b'),'reopened_by',_0xcfe1('0x51'),_0xcfe1('0x7c'),_0xcfe1('0x7d'),_0xcfe1('0x7e'),_0xcfe1('0x7f'),_0xcfe1('0x80'),_0xcfe1('0x81'),_0xcfe1('0x52'),_0xcfe1('0x82'),_0xcfe1('0x83'),_0xcfe1('0x84'),'comments_and_work_notes',_0xcfe1('0x85'),_0xcfe1('0x86'),_0xcfe1('0x87'),_0xcfe1('0x88'),_0xcfe1('0x89'),_0xcfe1('0x8a'),_0xcfe1('0x8b'),_0xcfe1('0x8c'),_0xcfe1('0x53')];var _0x3f7330='';var _0x56c7ef='';var _0x27f80b=[];var _0x577b5d='';var _0x2c3d92='';var _0xe01561=[];var _0x25ab7c='';var _0x2b5eed='';var _0x41a503={};var _0x1658f4='';return db[_0xcfe1('0x29')][_0xcfe1('0x48')]({'where':{'id':_0x3f4cd5[_0xcfe1('0x40')]['id']},'attributes':['id','username','password','email',_0xcfe1('0x8d'),_0xcfe1('0x8e')]})['then'](handleEntityNotFound(_0x185e77,null))[_0xcfe1('0x21')](function(_0x4b2427){if(_0x4b2427){_0x1658f4=_0x4b2427[_0xcfe1('0x8d')];var _0x36e0b0=_0x1658f4['slice'](-0x1);if(_0x36e0b0==='/'){_0x1658f4=_0x1658f4[_0xcfe1('0x8f')](0x0,_0x1658f4[_0xcfe1('0x90')](_0x36e0b0));}_0x2b5eed=util[_0xcfe1('0x91')](_0xcfe1('0x92'),_0x1658f4);_0x25ab7c=util['format'](_0xcfe1('0x93'),_0x1658f4);_0x41a503={'user':_0x4b2427['username'],'pass':_0x4b2427['password']};var _0x3549db={'method':_0xcfe1('0x94'),'uri':_0x2b5eed+_0xcfe1('0x95'),'auth':_0x41a503,'json':!![]};return rp(_0x3549db);}})['then'](function(_0x1f1c27){if(_0x1f1c27[_0xcfe1('0x96')][_0xcfe1('0x32')]>0x0){_0x3f7330=_0x1f1c27[_0xcfe1('0x96')];}console['log'](_0xcfe1('0x97'),_0x3f7330);_0xe01561=[];_0x56c7ef=Object[_0xcfe1('0x98')]([],_0x3f7330);_[_0xcfe1('0x99')](_0x56c7ef,function(_0x497fd7){return!_0x5227b7['includes'](_0x497fd7[_0xcfe1('0x26')]);});_0x56c7ef[_0xcfe1('0x9a')](function(_0x17d786){var _0x6821e4=createFieldObject(_0x25ab7c,_0x41a503,_0x17d786[_0xcfe1('0x9b')],_0x17d786[_0xcfe1('0x26')],_0x17d786[_0xcfe1('0x9c')],![]);_0xe01561[_0xcfe1('0x9d')](_0x6821e4);});return Promise[_0xcfe1('0x9e')](_0xe01561);})[_0xcfe1('0x21')](function(_0x445bdf){_0x27f80b=_0x445bdf;_0x577b5d=Object[_0xcfe1('0x98')]([],_0x3f7330);console[_0xcfe1('0x9f')](_0xcfe1('0xa0'),_0x3f7330);_['remove'](_0x577b5d,function(_0x38ba33){return _0xa26293[_0xcfe1('0xa1')](_0x38ba33['name']);});console[_0xcfe1('0x9f')](_0xcfe1('0xa2'),_0x577b5d);_0xe01561=[];_0x577b5d[_0xcfe1('0x9a')](function(_0x4431ee){var _0x53cfd9=createFieldObject(_0x25ab7c,_0x41a503,_0x4431ee[_0xcfe1('0x9b')],_0x4431ee[_0xcfe1('0x26')],_0x4431ee[_0xcfe1('0x9c')],!![]);_0xe01561[_0xcfe1('0x9d')](_0x53cfd9);});return Promise[_0xcfe1('0x9e')](_0xe01561);})[_0xcfe1('0x21')](function(_0x29c997){_0x2c3d92=_0x29c997;var _0x3bc7f5=_0x27f80b[_0xcfe1('0xa3')](_0x2c3d92);return{'count':_0x3bc7f5[_0xcfe1('0x32')],'rows':_0x3bc7f5};})[_0xcfe1('0x21')](respondWithResult(_0x185e77,null))[_0xcfe1('0x3f')](function(_0x28c7a6){console[_0xcfe1('0x9f')](_0xcfe1('0xa4')+_0x28c7a6);var _0x3731ca=_0x3f4cd5[_0xcfe1('0x2c')]['test']?0x1f4:_0x28c7a6['statusCode']||0x1f4;logger[_0xcfe1('0x24')](_0x28c7a6[_0xcfe1('0x25')]);delete _0x28c7a6[_0xcfe1('0x26')];if(_0x3731ca===0x191){_0x3731ca=0x190;}_0x185e77[_0xcfe1('0x16')](_0x3731ca)[_0xcfe1('0x27')](_0x3f4cd5['query'][_0xcfe1('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x28c7a6['statusCode']}:_0x28c7a6);});};function createFieldObject(_0x98f029,_0xe44ee5,_0x20261a,_0x112e1b,_0x7a0097,_0x1e61b9){return new Promise(function(_0x142763,_0x4b913c){var _0x404990={'id':_0x112e1b,'name':_0x7a0097,'custom':_0x1e61b9};if(_0x20261a==='boolean'){_0x404990['options']=[{'name':_0xcfe1('0xa6'),'value':'true'},{'name':_0xcfe1('0xa7'),'value':'false'}];_0x142763(_0x404990);}else{var _0x7ab921={'method':_0xcfe1('0x94'),'uri':_0x98f029+_0xcfe1('0xa8')+_0x112e1b,'auth':_0xe44ee5,'json':!![]};return rp(_0x7ab921)[_0xcfe1('0x21')](function(_0x5c492b){var _0x3ec758=[];if(_0x5c492b[_0xcfe1('0x96')]['length']>0x0){_0x5c492b[_0xcfe1('0x96')]['forEach'](function(_0x24b13c){if(_0x24b13c[_0xcfe1('0xa9')]===_0xcfe1('0xaa')){var _0x513773={'name':_0x24b13c[_0xcfe1('0x9c')],'value':_0x24b13c[_0xcfe1('0xab')]};_0x3ec758['push'](_0x513773);}});}_0x404990['options']=_0x3ec758;if(_0x404990['options'][_0xcfe1('0x32')]>0x0){_0x142763(_0x404990);}else{if(_0x1e61b9==![]){_0x142763();}else{_0x142763(_0x404990);}}});}});} \ No newline at end of file +var _0x4ff6=['category','parent','caused_by','sys_updated_on','child_incidents','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','close_code','correlation_display','delivery_task','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','assigned_to','comments','due_date','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','False','false','sys_choice?sysparm_query=name=incident^element=','result','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','sendStatus','name','map','ServicenowAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','update','body','getConfigurations','ServicenowConfiguration','rawAttributes','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','incident_state','severity'];(function(_0x2f26fe,_0x2145d8){var _0x44c6a4=function(_0x287ab0){while(--_0x287ab0){_0x2f26fe['push'](_0x2f26fe['shift']());}};_0x44c6a4(++_0x2145d8);}(_0x4ff6,0x100));var _0x64ff=function(_0x374de1,_0x4d7a59){_0x374de1=_0x374de1-0x0;var _0x4bebf4=_0x4ff6[_0x374de1];return _0x4bebf4;};'use strict';var emlformat=require(_0x64ff('0x0'));var rimraf=require(_0x64ff('0x1'));var zipdir=require(_0x64ff('0x2'));var jsonpatch=require(_0x64ff('0x3'));var rp=require('request-promise');var moment=require(_0x64ff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x64ff('0x5'));var path=require(_0x64ff('0x6'));var sox=require(_0x64ff('0x7'));var csv=require('to-csv');var ejs=require(_0x64ff('0x8'));var fs=require('fs');var fs_extra=require(_0x64ff('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x64ff('0xa'));var jsforce=require(_0x64ff('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x64ff('0xc'));var querystring=require(_0x64ff('0xd'));var Papa=require(_0x64ff('0xe'));var Redis=require('ioredis');var authService=require(_0x64ff('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x64ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x64ff('0x11'));var utils=require('../../config/utils');var config=require(_0x64ff('0x12'));var licenseUtil=require(_0x64ff('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x64ff('0x14'));function respondWithStatusCode(_0x2ba49b,_0x189df1){_0x189df1=_0x189df1||0xcc;return function(_0x2c5c3a){if(_0x2c5c3a){return _0x2ba49b['sendStatus'](_0x189df1);}return _0x2ba49b[_0x64ff('0x15')](_0x189df1)['end']();};}function respondWithResult(_0x13c188,_0x435c54){_0x435c54=_0x435c54||0xc8;return function(_0x4c561b){if(_0x4c561b){return _0x13c188[_0x64ff('0x15')](_0x435c54)[_0x64ff('0x16')](_0x4c561b);}};}function respondWithFilteredResult(_0x3c0a50,_0x2cd47a){return function(_0x1a0388){if(_0x1a0388){var _0x5a3343=typeof _0x2cd47a[_0x64ff('0x17')]===_0x64ff('0x18')&&typeof _0x2cd47a[_0x64ff('0x19')]==='undefined';var _0x4fbe32=_0x1a0388['count'];var _0x4501dd=_0x5a3343?0x0:_0x2cd47a[_0x64ff('0x17')];var _0x51d795=_0x5a3343?_0x1a0388[_0x64ff('0x1a')]:_0x2cd47a[_0x64ff('0x17')]+_0x2cd47a[_0x64ff('0x19')];var _0x2def7f;if(_0x51d795>=_0x4fbe32){_0x51d795=_0x4fbe32;_0x2def7f=0xc8;}else{_0x2def7f=0xce;}_0x3c0a50[_0x64ff('0x15')](_0x2def7f);return _0x3c0a50[_0x64ff('0x1b')]('Content-Range',_0x4501dd+'-'+_0x51d795+'/'+_0x4fbe32)['json'](_0x1a0388);}return null;};}function patchUpdates(_0x354f23){return function(_0x3df30c){try{jsonpatch[_0x64ff('0x1c')](_0x3df30c,_0x354f23,!![]);}catch(_0x3ddb7a){return BPromise['reject'](_0x3ddb7a);}return _0x3df30c[_0x64ff('0x1d')]();};}function saveUpdates(_0x2ce168,_0x405dbc){return function(_0x49714f){if(_0x49714f){return _0x49714f['update'](_0x2ce168)[_0x64ff('0x1e')](function(_0x207cbd){return _0x207cbd;});}return null;};}function removeEntity(_0x103758,_0x4a606c){return function(_0x224e67){if(_0x224e67){return _0x224e67[_0x64ff('0x1f')]()[_0x64ff('0x1e')](function(){_0x103758[_0x64ff('0x15')](0xcc)[_0x64ff('0x20')]();});}};}function handleEntityNotFound(_0x1307c3,_0x17ea49){return function(_0x3efe54){if(!_0x3efe54){_0x1307c3[_0x64ff('0x21')](0x194);}return _0x3efe54;};}function handleError(_0x23701f,_0x353e16){_0x353e16=_0x353e16||0x1f4;return function(_0x270a7c){logger['error'](_0x270a7c['stack']);if(_0x270a7c[_0x64ff('0x22')]){delete _0x270a7c[_0x64ff('0x22')];}_0x23701f['status'](_0x353e16)['send'](_0x270a7c);};}exports['index']=function(_0x14950d,_0x2adb61){var _0x8fafed={},_0x3c67f2={},_0x1ac212={'count':0x0,'rows':[]};var _0x3c209a=_[_0x64ff('0x23')](db[_0x64ff('0x24')]['rawAttributes'],function(_0x3e7c75){return{'name':_0x3e7c75[_0x64ff('0x25')],'type':_0x3e7c75[_0x64ff('0x26')]['key']};});_0x3c67f2[_0x64ff('0x27')]=_[_0x64ff('0x23')](_0x3c209a,'name');_0x3c67f2[_0x64ff('0x28')]=_[_0x64ff('0x29')](_0x14950d[_0x64ff('0x28')]);_0x3c67f2[_0x64ff('0x2a')]=_[_0x64ff('0x2b')](_0x3c67f2[_0x64ff('0x27')],_0x3c67f2[_0x64ff('0x28')]);_0x8fafed['attributes']=_['intersection'](_0x3c67f2[_0x64ff('0x27')],qs[_0x64ff('0x2c')](_0x14950d[_0x64ff('0x28')][_0x64ff('0x2c')]));_0x8fafed[_0x64ff('0x2d')]=_0x8fafed[_0x64ff('0x2d')][_0x64ff('0x2e')]?_0x8fafed[_0x64ff('0x2d')]:_0x3c67f2[_0x64ff('0x27')];if(!_0x14950d['query'][_0x64ff('0x2f')](_0x64ff('0x30'))){_0x8fafed[_0x64ff('0x19')]=qs['limit'](_0x14950d[_0x64ff('0x28')][_0x64ff('0x19')]);_0x8fafed[_0x64ff('0x17')]=qs['offset'](_0x14950d[_0x64ff('0x28')][_0x64ff('0x17')]);}_0x8fafed[_0x64ff('0x31')]=qs[_0x64ff('0x32')](_0x14950d[_0x64ff('0x28')][_0x64ff('0x32')]);_0x8fafed[_0x64ff('0x33')]=qs[_0x64ff('0x2a')](_[_0x64ff('0x34')](_0x14950d[_0x64ff('0x28')],_0x3c67f2['filters']),_0x3c209a);if(_0x14950d[_0x64ff('0x28')][_0x64ff('0x35')]){_0x8fafed['where']=_[_0x64ff('0x36')](_0x8fafed['where'],{'$or':_[_0x64ff('0x23')](_0x3c209a,function(_0x2a22d5){if(_0x2a22d5[_0x64ff('0x26')]!==_0x64ff('0x37')){var _0x9bf215={};_0x9bf215[_0x2a22d5[_0x64ff('0x22')]]={'$like':'%'+_0x14950d['query']['filter']+'%'};return _0x9bf215;}})});}_0x8fafed=_[_0x64ff('0x36')]({},_0x8fafed,_0x14950d[_0x64ff('0x38')]);var _0x4bd24e={'where':_0x8fafed[_0x64ff('0x33')]};return db[_0x64ff('0x24')][_0x64ff('0x1a')](_0x4bd24e)[_0x64ff('0x1e')](function(_0x330409){_0x1ac212[_0x64ff('0x1a')]=_0x330409;if(_0x14950d['query'][_0x64ff('0x39')]){_0x8fafed[_0x64ff('0x3a')]=[{'all':!![]}];}return db[_0x64ff('0x24')]['findAll'](_0x8fafed);})[_0x64ff('0x1e')](function(_0x5dfe9d){_0x1ac212[_0x64ff('0x3b')]=_0x5dfe9d;return _0x1ac212;})[_0x64ff('0x1e')](respondWithFilteredResult(_0x2adb61,_0x8fafed))['catch'](handleError(_0x2adb61,null));};exports[_0x64ff('0x3c')]=function(_0x403986,_0x527fb4){var _0x3ce30f={'raw':![],'where':{'id':_0x403986[_0x64ff('0x3d')]['id']}},_0x5e8e7a={};_0x5e8e7a[_0x64ff('0x27')]=_[_0x64ff('0x29')](db[_0x64ff('0x24')]['rawAttributes']);_0x5e8e7a['query']=_[_0x64ff('0x29')](_0x403986[_0x64ff('0x28')]);_0x5e8e7a[_0x64ff('0x2a')]=_[_0x64ff('0x2b')](_0x5e8e7a[_0x64ff('0x27')],_0x5e8e7a[_0x64ff('0x28')]);_0x3ce30f['attributes']=_[_0x64ff('0x2b')](_0x5e8e7a[_0x64ff('0x27')],qs[_0x64ff('0x2c')](_0x403986[_0x64ff('0x28')][_0x64ff('0x2c')]));_0x3ce30f[_0x64ff('0x2d')]=_0x3ce30f[_0x64ff('0x2d')][_0x64ff('0x2e')]?_0x3ce30f[_0x64ff('0x2d')]:_0x5e8e7a[_0x64ff('0x27')];if(_0x403986[_0x64ff('0x28')][_0x64ff('0x39')]){_0x3ce30f[_0x64ff('0x3a')]=[{'all':!![]}];}_0x3ce30f=_[_0x64ff('0x36')]({},_0x3ce30f,_0x403986['options']);return db[_0x64ff('0x24')][_0x64ff('0x3e')](_0x3ce30f)[_0x64ff('0x1e')](handleEntityNotFound(_0x527fb4,null))[_0x64ff('0x1e')](respondWithResult(_0x527fb4,null))[_0x64ff('0x3f')](handleError(_0x527fb4,null));};exports[_0x64ff('0x40')]=function(_0xb81c7b,_0x1b462e){return db[_0x64ff('0x24')][_0x64ff('0x40')](_0xb81c7b['body'],{})['then'](respondWithResult(_0x1b462e,0xc9))[_0x64ff('0x3f')](handleError(_0x1b462e,null));};exports[_0x64ff('0x41')]=function(_0x21dfcd,_0x338b82){if(_0x21dfcd['body']['id']){delete _0x21dfcd[_0x64ff('0x42')]['id'];}return db[_0x64ff('0x24')]['find']({'where':{'id':_0x21dfcd[_0x64ff('0x3d')]['id']}})[_0x64ff('0x1e')](handleEntityNotFound(_0x338b82,null))[_0x64ff('0x1e')](saveUpdates(_0x21dfcd[_0x64ff('0x42')],null))[_0x64ff('0x1e')](respondWithResult(_0x338b82,null))[_0x64ff('0x3f')](handleError(_0x338b82,null));};exports[_0x64ff('0x1f')]=function(_0x1180bc,_0x52a7ec){return db[_0x64ff('0x24')]['find']({'where':{'id':_0x1180bc[_0x64ff('0x3d')]['id']}})[_0x64ff('0x1e')](handleEntityNotFound(_0x52a7ec,null))['then'](removeEntity(_0x52a7ec,null))[_0x64ff('0x3f')](handleError(_0x52a7ec,null));};exports[_0x64ff('0x43')]=function(_0x1e7e72,_0x1d06c6,_0x13a3ec){var _0x30c343={};var _0x4ec5d={};var _0x5d7f03;var _0x32d703;return db[_0x64ff('0x24')]['findOne']({'where':{'id':_0x1e7e72[_0x64ff('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1d06c6,null))[_0x64ff('0x1e')](function(_0x244033){if(_0x244033){_0x5d7f03=_0x244033;_0x4ec5d['model']=_['keys'](db[_0x64ff('0x44')][_0x64ff('0x45')]);_0x4ec5d[_0x64ff('0x28')]=_[_0x64ff('0x29')](_0x1e7e72[_0x64ff('0x28')]);_0x4ec5d[_0x64ff('0x2a')]=_[_0x64ff('0x2b')](_0x4ec5d[_0x64ff('0x27')],_0x4ec5d[_0x64ff('0x28')]);_0x30c343[_0x64ff('0x2d')]=_[_0x64ff('0x2b')](_0x4ec5d[_0x64ff('0x27')],qs[_0x64ff('0x2c')](_0x1e7e72[_0x64ff('0x28')][_0x64ff('0x2c')]));_0x30c343['attributes']=_0x30c343[_0x64ff('0x2d')]['length']?_0x30c343[_0x64ff('0x2d')]:_0x4ec5d[_0x64ff('0x27')];_0x30c343[_0x64ff('0x31')]=qs[_0x64ff('0x32')](_0x1e7e72[_0x64ff('0x28')]['sort']);_0x30c343[_0x64ff('0x33')]=qs[_0x64ff('0x2a')](_['pick'](_0x1e7e72[_0x64ff('0x28')],_0x4ec5d[_0x64ff('0x2a')]));if(_0x1e7e72[_0x64ff('0x28')]['filter']){_0x30c343[_0x64ff('0x33')]=_[_0x64ff('0x36')](_0x30c343[_0x64ff('0x33')],{'$or':_[_0x64ff('0x23')](_0x30c343[_0x64ff('0x2d')],function(_0x407520){var _0x4c3ae6={};_0x4c3ae6[_0x407520]={'$like':'%'+_0x1e7e72[_0x64ff('0x28')]['filter']+'%'};return _0x4c3ae6;})});}_0x30c343=_[_0x64ff('0x36')]({},_0x30c343,_0x1e7e72['options']);return _0x5d7f03[_0x64ff('0x43')](_0x30c343);}})[_0x64ff('0x1e')](function(_0x5a3395){if(_0x5a3395){_0x32d703=_0x5a3395[_0x64ff('0x2e')];if(!_0x1e7e72['query']['hasOwnProperty'](_0x64ff('0x30'))){_0x30c343[_0x64ff('0x19')]=qs[_0x64ff('0x19')](_0x1e7e72[_0x64ff('0x28')][_0x64ff('0x19')]);_0x30c343[_0x64ff('0x17')]=qs['offset'](_0x1e7e72[_0x64ff('0x28')]['offset']);}return _0x5d7f03[_0x64ff('0x43')](_0x30c343);}})[_0x64ff('0x1e')](function(_0x184686){if(_0x184686){return _0x184686?{'count':_0x32d703,'rows':_0x184686}:null;}})[_0x64ff('0x1e')](respondWithResult(_0x1d06c6,null))[_0x64ff('0x3f')](handleError(_0x1d06c6,null));};exports[_0x64ff('0x46')]=function(_0x3af528,_0xef28e,_0x4e09ad){if(_0x3af528[_0x64ff('0x42')]['id']){delete _0x3af528[_0x64ff('0x42')]['id'];}return db['ServicenowAccount'][_0x64ff('0x47')]({'where':{'id':_0x3af528[_0x64ff('0x3d')]['id']}})[_0x64ff('0x1e')](handleEntityNotFound(_0xef28e,null))[_0x64ff('0x1e')](function(_0xce02fd){if(_0xce02fd){_0x3af528['body'][_0x64ff('0x48')]=_0xce02fd['id'];_0x3af528[_0x64ff('0x42')][_0x64ff('0x49')]=integrations['getSubjects'](_0x3af528[_0x64ff('0x42')][_0x64ff('0x4a')],_0x3af528[_0x64ff('0x42')][_0x64ff('0x26')]);_0x3af528[_0x64ff('0x42')][_0x64ff('0x4b')]=integrations[_0x64ff('0x4c')](_0x3af528[_0x64ff('0x42')]['channel'],_0x3af528[_0x64ff('0x42')][_0x64ff('0x26')]);return db[_0x64ff('0x44')][_0x64ff('0x40')](_0x3af528[_0x64ff('0x42')],{'include':[{'model':db[_0x64ff('0x4d')],'as':'Subjects'},{'model':db[_0x64ff('0x4d')],'as':'Descriptions'}]});}return null;})[_0x64ff('0x1e')](respondWithResult(_0xef28e,null))[_0x64ff('0x3f')](handleError(_0xef28e,null));};exports[_0x64ff('0x4e')]=function(_0x438c20,_0x487e76,_0x5bfe12){var _0x2b337f=[_0x64ff('0x4f'),_0x64ff('0x50'),_0x64ff('0x51'),'subcategory','close_code','notify',_0x64ff('0x52'),_0x64ff('0x53'),_0x64ff('0x54')];var _0x16c196=[_0x64ff('0x55'),_0x64ff('0x4f'),_0x64ff('0x56'),'watch_list','upon_reject',_0x64ff('0x57'),_0x64ff('0x58'),'hold_reason','approval_history','number','resolved_by',_0x64ff('0x59'),_0x64ff('0x5a'),_0x64ff('0x5b'),'sys_created_on',_0x64ff('0x5c'),'state',_0x64ff('0x5d'),_0x64ff('0x51'),'order',_0x64ff('0x5e'),_0x64ff('0x5f'),_0x64ff('0x60'),_0x64ff('0x61'),'impact',_0x64ff('0x62'),_0x64ff('0x63'),_0x64ff('0x64'),_0x64ff('0x65'),_0x64ff('0x66'),_0x64ff('0x67'),_0x64ff('0x68'),'expected_start',_0x64ff('0x69'),_0x64ff('0x6a'),_0x64ff('0x6b'),_0x64ff('0x6c'),_0x64ff('0x6d'),_0x64ff('0x6e'),_0x64ff('0x6f'),_0x64ff('0x70'),'subcategory','work_notes',_0x64ff('0x71'),_0x64ff('0x72'),_0x64ff('0x73'),_0x64ff('0x74'),'work_start','assignment_group','business_stc',_0x64ff('0x75'),'description',_0x64ff('0x76'),'notify',_0x64ff('0x77'),_0x64ff('0x78'),_0x64ff('0x79'),'follow_up',_0x64ff('0x7a'),_0x64ff('0x7b'),'contact_type',_0x64ff('0x7c'),_0x64ff('0x52'),'urgency',_0x64ff('0x7d'),_0x64ff('0x7e'),_0x64ff('0x7f'),'activity_due',_0x64ff('0x80'),_0x64ff('0x53'),_0x64ff('0x81'),'sla_due','approval','comments_and_work_notes',_0x64ff('0x82'),'sys_mod_count','reopen_count',_0x64ff('0x83'),_0x64ff('0x84'),'upon_approval',_0x64ff('0x85'),_0x64ff('0x86'),_0x64ff('0x54')];var _0x2cf3fe='';var _0x362f14='';var _0x306604=[];var _0x42f671='';var _0x919b91='';var _0x1ea0d7=[];var _0x459306='';var _0x114144='';var _0x3701a7={};var _0x26f1c1='';return db['ServicenowAccount'][_0x64ff('0x47')]({'where':{'id':_0x438c20['params']['id']},'attributes':['id',_0x64ff('0x87'),_0x64ff('0x88'),_0x64ff('0x89'),_0x64ff('0x8a'),_0x64ff('0x8b')]})[_0x64ff('0x1e')](handleEntityNotFound(_0x487e76,null))['then'](function(_0x5db1e6){if(_0x5db1e6){_0x26f1c1=_0x5db1e6[_0x64ff('0x8a')];var _0x550819=_0x26f1c1[_0x64ff('0x8c')](-0x1);if(_0x550819==='/'){_0x26f1c1=_0x26f1c1[_0x64ff('0x8d')](0x0,_0x26f1c1[_0x64ff('0x8e')](_0x550819));}_0x114144=util[_0x64ff('0x8f')](_0x64ff('0x90'),_0x26f1c1);_0x459306=util[_0x64ff('0x8f')](_0x64ff('0x91'),_0x26f1c1);_0x3701a7={'user':_0x5db1e6['username'],'pass':_0x5db1e6[_0x64ff('0x88')]};var _0x569181={'method':_0x64ff('0x92'),'uri':_0x114144+_0x64ff('0x93'),'auth':_0x3701a7,'json':!![]};return rp(_0x569181);}})[_0x64ff('0x1e')](function(_0x2f9953){if(_0x2f9953['result'][_0x64ff('0x2e')]>0x0){_0x2cf3fe=_0x2f9953['result'];}console[_0x64ff('0x94')](_0x64ff('0x95'),_0x2cf3fe);_0x1ea0d7=[];_0x362f14=Object[_0x64ff('0x96')]([],_0x2cf3fe);_[_0x64ff('0x97')](_0x362f14,function(_0x5dedce){return!_0x2b337f[_0x64ff('0x98')](_0x5dedce['name']);});_0x362f14[_0x64ff('0x99')](function(_0x196917){var _0x4260c9=createFieldObject(_0x459306,_0x3701a7,_0x196917['internalType'],_0x196917[_0x64ff('0x22')],_0x196917[_0x64ff('0x9a')],![]);_0x1ea0d7[_0x64ff('0x9b')](_0x4260c9);});return Promise[_0x64ff('0x9c')](_0x1ea0d7);})[_0x64ff('0x1e')](function(_0x1e2fc5){_0x306604=_0x1e2fc5;_0x42f671=Object[_0x64ff('0x96')]([],_0x2cf3fe);console[_0x64ff('0x94')]('TCL:\x20_object',_0x2cf3fe);_[_0x64ff('0x97')](_0x42f671,function(_0x55e5b1){return _0x16c196[_0x64ff('0x98')](_0x55e5b1[_0x64ff('0x22')]);});console[_0x64ff('0x94')](_0x64ff('0x9d'),_0x42f671);_0x1ea0d7=[];_0x42f671[_0x64ff('0x99')](function(_0x58c7d0){var _0x2723c0=createFieldObject(_0x459306,_0x3701a7,_0x58c7d0[_0x64ff('0x9e')],_0x58c7d0[_0x64ff('0x22')],_0x58c7d0[_0x64ff('0x9a')],!![]);_0x1ea0d7[_0x64ff('0x9b')](_0x2723c0);});return Promise[_0x64ff('0x9c')](_0x1ea0d7);})[_0x64ff('0x1e')](function(_0x1748b0){_0x919b91=_0x1748b0;var _0x1176f8=_0x306604[_0x64ff('0x9f')](_0x919b91);return{'count':_0x1176f8['length'],'rows':_0x1176f8};})[_0x64ff('0x1e')](respondWithResult(_0x487e76,null))[_0x64ff('0x3f')](function(_0x42073d){console[_0x64ff('0x94')](_0x64ff('0xa0')+_0x42073d);var _0x236dee=_0x438c20[_0x64ff('0x28')][_0x64ff('0xa1')]?0x1f4:_0x42073d[_0x64ff('0xa2')]||0x1f4;logger['error'](_0x42073d[_0x64ff('0xa3')]);delete _0x42073d[_0x64ff('0x22')];if(_0x236dee===0x191){_0x236dee=0x190;}_0x487e76[_0x64ff('0x15')](_0x236dee)['send'](_0x438c20[_0x64ff('0x28')][_0x64ff('0xa1')]?{'message':_0x64ff('0xa4'),'statusCode':_0x42073d[_0x64ff('0xa2')]}:_0x42073d);});};function createFieldObject(_0x3510cd,_0x19d297,_0x909f40,_0x4796b4,_0x5422df,_0x21667a){return new Promise(function(_0x175893,_0x156e9e){var _0x57993a={'id':_0x4796b4,'name':_0x5422df,'custom':_0x21667a};if(_0x909f40===_0x64ff('0xa5')){_0x57993a[_0x64ff('0x38')]=[{'name':'True','value':'true'},{'name':_0x64ff('0xa6'),'value':_0x64ff('0xa7')}];_0x175893(_0x57993a);}else{var _0x1c768a={'method':_0x64ff('0x92'),'uri':_0x3510cd+_0x64ff('0xa8')+_0x4796b4,'auth':_0x19d297,'json':!![]};return rp(_0x1c768a)[_0x64ff('0x1e')](function(_0x3052d5){var _0x2d4aac=[];if(_0x3052d5[_0x64ff('0xa9')][_0x64ff('0x2e')]>0x0){_0x3052d5['result'][_0x64ff('0x99')](function(_0x247372){if(_0x247372['inactive']==='false'){var _0x27d0f3={'name':_0x247372[_0x64ff('0x9a')],'value':_0x247372['value']};_0x2d4aac[_0x64ff('0x9b')](_0x27d0f3);}});}_0x57993a[_0x64ff('0x38')]=_0x2d4aac;if(_0x57993a[_0x64ff('0x38')][_0x64ff('0x2e')]>0x0){_0x175893(_0x57993a);}else{if(_0x21667a==![]){_0x175893();}else{_0x175893(_0x57993a);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1224706..bf64e3d 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 _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x1b9339,_0x10ec96){var _0x1354e4=function(_0x593b36){while(--_0x593b36){_0x1b9339['push'](_0x1b9339['shift']());}};_0x1354e4(++_0x10ec96);}(_0xb138,0x1dd));var _0x8b13=function(_0x4a705a,_0x13c990){_0x4a705a=_0x4a705a-0x0;var _0x37e5bd=_0xb138[_0x4a705a];return _0x37e5bd;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x1cb9,0x14e));var _0x91cb=function(_0xacb540,_0x26b075){_0xacb540=_0xacb540-0x0;var _0x8ad1d7=_0x1cb9[_0xacb540];return _0x8ad1d7;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('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 2045048..0f12f6a 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 _0x2329=['attributes','limit','include','model','map','catch','find','raw','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where'];(function(_0x5476fc,_0x34a4b2){var _0x2a4764=function(_0x48e41f){while(--_0x48e41f){_0x5476fc['push'](_0x5476fc['shift']());}};_0x2a4764(++_0x34a4b2);}(_0x2329,0xa5));var _0x9232=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2329[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9232('0x0'));var moment=require(_0x9232('0x1'));var BPromise=require(_0x9232('0x2'));var rs=require(_0x9232('0x3'));var fs=require('fs');var Redis=require(_0x9232('0x4'));var db=require(_0x9232('0x5'))['db'];var utils=require(_0x9232('0x6'));var logger=require(_0x9232('0x7'))(_0x9232('0x8'));var config=require(_0x9232('0x9'));var jayson=require(_0x9232('0xa'));var client=jayson[_0x9232('0xb')][_0x9232('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb47272,_0x2c9641,_0x238c5){return new BPromise(function(_0x5247fa,_0x421685){return client[_0x9232('0xd')](_0xb47272,_0x238c5)[_0x9232('0xe')](function(_0x2ed211){logger[_0x9232('0xf')](_0x9232('0x10'),_0x2c9641,_0x9232('0x11'));logger[_0x9232('0x12')](_0x9232('0x13'),_0x2c9641,'request\x20sent',JSON[_0x9232('0x14')](_0x2ed211));if(_0x2ed211['error']){if(_0x2ed211['error'][_0x9232('0x15')]===0x1f4){logger[_0x9232('0x16')](_0x9232('0x10'),_0x2c9641,_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);return _0x421685(_0x2ed211[_0x9232('0x16')]['message']);}logger[_0x9232('0x16')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9641,_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);return _0x5247fa(_0x2ed211[_0x9232('0x16')][_0x9232('0x17')]);}else{logger[_0x9232('0xf')](_0x9232('0x10'),_0x2c9641,_0x9232('0x11'));_0x5247fa(_0x2ed211[_0x9232('0x18')][_0x9232('0x17')]);}})['catch'](function(_0x6f5e25){logger[_0x9232('0x16')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9641,_0x6f5e25);_0x421685(_0x6f5e25);});});}exports[_0x9232('0x19')]=function(_0x5a7223){var _0xa9a812=this;return new Promise(function(_0x2cc154,_0x48c98e){return db[_0x9232('0x1a')][_0x9232('0x1b')]({'raw':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x1d')]||null:null,'attributes':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x1e')]||null:null,'limit':_0x5a7223['options']?_0x5a7223['options'][_0x9232('0x1f')]||null:null,'include':_0x5a7223[_0x9232('0x1c')]?_0x5a7223[_0x9232('0x1c')][_0x9232('0x20')]?_['map'](_0x5a7223[_0x9232('0x1c')][_0x9232('0x20')],function(_0xddef8d){return{'model':db[_0xddef8d[_0x9232('0x21')]],'as':_0xddef8d['as'],'attributes':_0xddef8d[_0x9232('0x1e')],'include':_0xddef8d[_0x9232('0x20')]?_[_0x9232('0x22')](_0xddef8d[_0x9232('0x20')],function(_0x29b434){return{'model':db[_0x29b434[_0x9232('0x21')]],'as':_0x29b434['as'],'attributes':_0x29b434[_0x9232('0x1e')],'include':_0x29b434[_0x9232('0x20')]?_['map'](_0x29b434[_0x9232('0x20')],function(_0x2207a9){return{'model':db[_0x2207a9[_0x9232('0x21')]],'as':_0x2207a9['as'],'attributes':_0x2207a9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x496644){logger[_0x9232('0xf')]('GetServicenowAccount',_0x5a7223);logger[_0x9232('0x12')]('GetServicenowAccount',_0x5a7223,JSON[_0x9232('0x14')](_0x496644));_0x2cc154(_0x496644);})[_0x9232('0x23')](function(_0x4a9dea){logger['error'](_0x9232('0x19'),_0x4a9dea[_0x9232('0x17')],_0x5a7223);_0x48c98e(_0xa9a812[_0x9232('0x16')](0x1f4,_0x4a9dea[_0x9232('0x17')]));});});};exports['ShowServicenowAccount']=function(_0x49c539){var _0xc76c9a=this;return new Promise(function(_0x3ebf06,_0x69911f){return db['ServicenowAccount'][_0x9232('0x24')]({'raw':_0x49c539[_0x9232('0x1c')]?_0x49c539[_0x9232('0x1c')][_0x9232('0x25')]===undefined?!![]:![]:!![],'where':_0x49c539[_0x9232('0x1c')]?_0x49c539['options'][_0x9232('0x1d')]||null:null,'attributes':_0x49c539[_0x9232('0x1c')]?_0x49c539[_0x9232('0x1c')][_0x9232('0x1e')]||null:null,'include':_0x49c539['options']?_0x49c539[_0x9232('0x1c')][_0x9232('0x20')]?_[_0x9232('0x22')](_0x49c539['options']['include'],function(_0x7c69d6){return{'model':db[_0x7c69d6['model']],'as':_0x7c69d6['as'],'attributes':_0x7c69d6[_0x9232('0x1e')],'include':_0x7c69d6['include']?_[_0x9232('0x22')](_0x7c69d6['include'],function(_0x5019eb){return{'model':db[_0x5019eb['model']],'as':_0x5019eb['as'],'attributes':_0x5019eb[_0x9232('0x1e')],'include':_0x5019eb['include']?_['map'](_0x5019eb[_0x9232('0x20')],function(_0x453ea3){return{'model':db[_0x453ea3['model']],'as':_0x453ea3['as'],'attributes':_0x453ea3[_0x9232('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9232('0xe')](function(_0x10dc76){logger[_0x9232('0xf')](_0x9232('0x26'),_0x49c539);logger[_0x9232('0x12')](_0x9232('0x26'),_0x49c539,JSON['stringify'](_0x10dc76));_0x3ebf06(_0x10dc76);})[_0x9232('0x23')](function(_0x5698ce){logger[_0x9232('0x16')](_0x9232('0x26'),_0x5698ce[_0x9232('0x17')],_0x49c539);_0x69911f(_0xc76c9a['error'](0x1f4,_0x5698ce[_0x9232('0x17')]));});});}; \ No newline at end of file +var _0x911e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','include','map','model','ShowServicenowAccount','find','where','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5dc201,_0xba38f3){var _0x294163=function(_0x572448){while(--_0x572448){_0x5dc201['push'](_0x5dc201['shift']());}};_0x294163(++_0xba38f3);}(_0x911e,0x1aa));var _0xe911=function(_0x5a4fbc,_0x2b6692){_0x5a4fbc=_0x5a4fbc-0x0;var _0x30c04c=_0x911e[_0x5a4fbc];return _0x30c04c;};'use strict';var _=require(_0xe911('0x0'));var util=require(_0xe911('0x1'));var moment=require('moment');var BPromise=require(_0xe911('0x2'));var rs=require(_0xe911('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe911('0x4'))['db'];var utils=require(_0xe911('0x5'));var logger=require(_0xe911('0x6'))(_0xe911('0x7'));var config=require(_0xe911('0x8'));var jayson=require(_0xe911('0x9'));var client=jayson['client'][_0xe911('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x523b31,_0x6b3dad,_0x105d11){return new BPromise(function(_0x562cd0,_0x367122){return client[_0xe911('0xb')](_0x523b31,_0x105d11)[_0xe911('0xc')](function(_0x37c9a1){logger[_0xe911('0xd')](_0xe911('0xe'),_0x6b3dad,'request\x20sent');logger[_0xe911('0xf')](_0xe911('0x10'),_0x6b3dad,_0xe911('0x11'),JSON['stringify'](_0x37c9a1));if(_0x37c9a1['error']){if(_0x37c9a1[_0xe911('0x12')][_0xe911('0x13')]===0x1f4){logger[_0xe911('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x6b3dad,_0x37c9a1[_0xe911('0x12')][_0xe911('0x14')]);return _0x367122(_0x37c9a1[_0xe911('0x12')][_0xe911('0x14')]);}logger[_0xe911('0x12')](_0xe911('0xe'),_0x6b3dad,_0x37c9a1[_0xe911('0x12')][_0xe911('0x14')]);return _0x562cd0(_0x37c9a1[_0xe911('0x12')][_0xe911('0x14')]);}else{logger[_0xe911('0xd')](_0xe911('0xe'),_0x6b3dad,_0xe911('0x11'));_0x562cd0(_0x37c9a1[_0xe911('0x15')][_0xe911('0x14')]);}})[_0xe911('0x16')](function(_0x3e68e3){logger[_0xe911('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x6b3dad,_0x3e68e3);_0x367122(_0x3e68e3);});});}exports[_0xe911('0x17')]=function(_0x10329a){var _0x5f30ce=this;return new Promise(function(_0x2cbb34,_0x31500f){return db[_0xe911('0x18')][_0xe911('0x19')]({'raw':_0x10329a[_0xe911('0x1a')]?_0x10329a[_0xe911('0x1a')][_0xe911('0x1b')]===undefined?!![]:![]:!![],'where':_0x10329a[_0xe911('0x1a')]?_0x10329a['options']['where']||null:null,'attributes':_0x10329a[_0xe911('0x1a')]?_0x10329a[_0xe911('0x1a')][_0xe911('0x1c')]||null:null,'limit':_0x10329a[_0xe911('0x1a')]?_0x10329a[_0xe911('0x1a')]['limit']||null:null,'include':_0x10329a[_0xe911('0x1a')]?_0x10329a['options'][_0xe911('0x1d')]?_[_0xe911('0x1e')](_0x10329a[_0xe911('0x1a')][_0xe911('0x1d')],function(_0x2515f6){return{'model':db[_0x2515f6[_0xe911('0x1f')]],'as':_0x2515f6['as'],'attributes':_0x2515f6[_0xe911('0x1c')],'include':_0x2515f6[_0xe911('0x1d')]?_[_0xe911('0x1e')](_0x2515f6[_0xe911('0x1d')],function(_0x478fe2){return{'model':db[_0x478fe2[_0xe911('0x1f')]],'as':_0x478fe2['as'],'attributes':_0x478fe2[_0xe911('0x1c')],'include':_0x478fe2[_0xe911('0x1d')]?_[_0xe911('0x1e')](_0x478fe2[_0xe911('0x1d')],function(_0x4dead4){return{'model':db[_0x4dead4[_0xe911('0x1f')]],'as':_0x4dead4['as'],'attributes':_0x4dead4[_0xe911('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe911('0xc')](function(_0xf86727){logger[_0xe911('0xd')](_0xe911('0x17'),_0x10329a);logger['debug'](_0xe911('0x17'),_0x10329a,JSON['stringify'](_0xf86727));_0x2cbb34(_0xf86727);})[_0xe911('0x16')](function(_0x446428){logger[_0xe911('0x12')](_0xe911('0x17'),_0x446428['message'],_0x10329a);_0x31500f(_0x5f30ce['error'](0x1f4,_0x446428['message']));});});};exports[_0xe911('0x20')]=function(_0x28ca74){var _0x6e3951=this;return new Promise(function(_0x26339f,_0x549359){return db[_0xe911('0x18')][_0xe911('0x21')]({'raw':_0x28ca74[_0xe911('0x1a')]?_0x28ca74[_0xe911('0x1a')][_0xe911('0x1b')]===undefined?!![]:![]:!![],'where':_0x28ca74[_0xe911('0x1a')]?_0x28ca74[_0xe911('0x1a')][_0xe911('0x22')]||null:null,'attributes':_0x28ca74['options']?_0x28ca74[_0xe911('0x1a')][_0xe911('0x1c')]||null:null,'include':_0x28ca74['options']?_0x28ca74[_0xe911('0x1a')][_0xe911('0x1d')]?_['map'](_0x28ca74[_0xe911('0x1a')][_0xe911('0x1d')],function(_0x47fb84){return{'model':db[_0x47fb84[_0xe911('0x1f')]],'as':_0x47fb84['as'],'attributes':_0x47fb84[_0xe911('0x1c')],'include':_0x47fb84[_0xe911('0x1d')]?_[_0xe911('0x1e')](_0x47fb84[_0xe911('0x1d')],function(_0x56bc48){return{'model':db[_0x56bc48['model']],'as':_0x56bc48['as'],'attributes':_0x56bc48[_0xe911('0x1c')],'include':_0x56bc48[_0xe911('0x1d')]?_[_0xe911('0x1e')](_0x56bc48['include'],function(_0x2b32fc){return{'model':db[_0x2b32fc[_0xe911('0x1f')]],'as':_0x2b32fc['as'],'attributes':_0x2b32fc[_0xe911('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x513de0){logger[_0xe911('0xd')]('ShowServicenowAccount',_0x28ca74);logger[_0xe911('0xf')](_0xe911('0x20'),_0x28ca74,JSON[_0xe911('0x23')](_0x513de0));_0x26339f(_0x513de0);})[_0xe911('0x16')](function(_0x355d34){logger[_0xe911('0x12')]('ShowServicenowAccount',_0x355d34[_0xe911('0x14')],_0x28ca74);_0x549359(_0x6e3951['error'](0x1f4,_0x355d34[_0xe911('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d8d0f28..73f7118 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 _0x7054=['put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create'];(function(_0x21003d,_0x15858f){var _0x1cd2e6=function(_0x20cbeb){while(--_0x20cbeb){_0x21003d['push'](_0x21003d['shift']());}};_0x1cd2e6(++_0x15858f);}(_0x7054,0x89));var _0x4705=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0x7054[_0x57746e];return _0x5caeaa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4705('0x0'));var express=require(_0x4705('0x1'));var router=express[_0x4705('0x2')]();var fs_extra=require(_0x4705('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4705('0x4'));var config=require('../../config/environment');var controller=require(_0x4705('0x5'));router[_0x4705('0x6')]('/',auth[_0x4705('0x7')](),controller[_0x4705('0x8')]);router[_0x4705('0x6')](_0x4705('0x9'),auth[_0x4705('0x7')](),controller['show']);router['get'](_0x4705('0xa'),auth[_0x4705('0x7')](),controller[_0x4705('0xb')]);router[_0x4705('0x6')](_0x4705('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4705('0x6')](_0x4705('0xd'),auth[_0x4705('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x4705('0x7')](),controller[_0x4705('0xe')]);router[_0x4705('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4705('0x10')](_0x4705('0x9'),auth['isAuthenticated'](),controller[_0x4705('0x11')]);module[_0x4705('0x12')]=router; \ No newline at end of file +var _0x160c=['put','/:id','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x46df5b,_0xbfc508){var _0x2daac0=function(_0x10d509){while(--_0x10d509){_0x46df5b['push'](_0x46df5b['shift']());}};_0x2daac0(++_0xbfc508);}(_0x160c,0xec));var _0xc160=function(_0x2cb255,_0x4244c5){_0x2cb255=_0x2cb255-0x0;var _0x1b7936=_0x160c[_0x2cb255];return _0x1b7936;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc160('0x0'));var express=require(_0xc160('0x1'));var router=express['Router']();var fs_extra=require(_0xc160('0x2'));var auth=require(_0xc160('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc160('0x4'));var controller=require(_0xc160('0x5'));router[_0xc160('0x6')]('/',auth[_0xc160('0x7')](),controller[_0xc160('0x8')]);router[_0xc160('0x6')]('/:id',auth[_0xc160('0x7')](),controller[_0xc160('0x9')]);router[_0xc160('0x6')](_0xc160('0xa'),auth[_0xc160('0x7')](),controller['getFields']);router[_0xc160('0x6')](_0xc160('0xb'),auth[_0xc160('0x7')](),controller[_0xc160('0xc')]);router[_0xc160('0x6')](_0xc160('0xd'),auth[_0xc160('0x7')](),controller[_0xc160('0xe')]);router[_0xc160('0xf')]('/',auth['isAuthenticated'](),controller[_0xc160('0x10')]);router[_0xc160('0x11')](_0xc160('0x12'),auth[_0xc160('0x7')](),controller[_0xc160('0x13')]);router[_0xc160('0x14')]('/:id',auth[_0xc160('0x7')](),controller[_0xc160('0x15')]);module[_0xc160('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 1f92cf5..c50104f 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 _0x20ff=['sequelize','exports','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x20ff,0x96));var _0xf20f=function(_0x478830,_0x266465){_0x478830=_0x478830-0x0;var _0x1f2420=_0x20ff[_0x478830];return _0x1f2420;};'use strict';var Sequelize=require(_0xf20f('0x0'));module[_0xf20f('0x1')]={'name':{'type':Sequelize[_0xf20f('0x2')]},'description':{'type':Sequelize[_0xf20f('0x2')]}}; \ No newline at end of file +var _0x83c5=['exports','sequelize'];(function(_0xcaad52,_0x51927d){var _0x1162b3=function(_0x27872a){while(--_0x27872a){_0xcaad52['push'](_0xcaad52['shift']());}};_0x1162b3(++_0x51927d);}(_0x83c5,0x97));var _0x583c=function(_0x3a4b1b,_0x40e5c1){_0x3a4b1b=_0x3a4b1b-0x0;var _0x1b00ac=_0x83c5[_0x3a4b1b];return _0x1b00ac;};'use strict';var Sequelize=require(_0x583c('0x0'));module[_0x583c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c9c32cd..969ed90 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 _0x5fe1=['getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','length','create','body','find','params','findOne','ServicenowField','order'];(function(_0x54b83b,_0x50919b){var _0x4e4405=function(_0x2f420f){while(--_0x2f420f){_0x54b83b['push'](_0x54b83b['shift']());}};_0x4e4405(++_0x50919b);}(_0x5fe1,0x158));var _0x15fe=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x5fe1[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x15fe('0x0'));var rimraf=require(_0x15fe('0x1'));var zipdir=require(_0x15fe('0x2'));var jsonpatch=require(_0x15fe('0x3'));var rp=require(_0x15fe('0x4'));var moment=require(_0x15fe('0x5'));var BPromise=require(_0x15fe('0x6'));var Mustache=require(_0x15fe('0x7'));var util=require(_0x15fe('0x8'));var path=require(_0x15fe('0x9'));var sox=require(_0x15fe('0xa'));var csv=require(_0x15fe('0xb'));var ejs=require(_0x15fe('0xc'));var fs=require('fs');var fs_extra=require(_0x15fe('0xd'));var _=require(_0x15fe('0xe'));var squel=require(_0x15fe('0xf'));var crypto=require(_0x15fe('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x15fe('0x11'));var toCsv=require(_0x15fe('0xb'));var querystring=require('querystring');var Papa=require(_0x15fe('0x12'));var Redis=require(_0x15fe('0x13'));var authService=require(_0x15fe('0x14'));var qs=require(_0x15fe('0x15'));var as=require(_0x15fe('0x16'));var hardwareService=require(_0x15fe('0x17'));var logger=require('../../config/logger')(_0x15fe('0x18'));var utils=require(_0x15fe('0x19'));var config=require(_0x15fe('0x1a'));var licenseUtil=require(_0x15fe('0x1b'));var db=require(_0x15fe('0x1c'))['db'];function respondWithStatusCode(_0x4ae913,_0x1e2c47){_0x1e2c47=_0x1e2c47||0xcc;return function(_0x1ca9e7){if(_0x1ca9e7){return _0x4ae913['sendStatus'](_0x1e2c47);}return _0x4ae913['status'](_0x1e2c47)[_0x15fe('0x1d')]();};}function respondWithResult(_0xde1384,_0x3ab967){_0x3ab967=_0x3ab967||0xc8;return function(_0x41407c){if(_0x41407c){return _0xde1384[_0x15fe('0x1e')](_0x3ab967)[_0x15fe('0x1f')](_0x41407c);}};}function respondWithFilteredResult(_0xc7167c,_0x526e8d){return function(_0x4d9484){if(_0x4d9484){var _0x4cc20f=typeof _0x526e8d['offset']===_0x15fe('0x20')&&typeof _0x526e8d['limit']===_0x15fe('0x20');var _0x75c568=_0x4d9484[_0x15fe('0x21')];var _0x20d2fb=_0x4cc20f?0x0:_0x526e8d[_0x15fe('0x22')];var _0x5b4604=_0x4cc20f?_0x4d9484[_0x15fe('0x21')]:_0x526e8d[_0x15fe('0x22')]+_0x526e8d[_0x15fe('0x23')];var _0x4ce058;if(_0x5b4604>=_0x75c568){_0x5b4604=_0x75c568;_0x4ce058=0xc8;}else{_0x4ce058=0xce;}_0xc7167c[_0x15fe('0x1e')](_0x4ce058);return _0xc7167c[_0x15fe('0x24')](_0x15fe('0x25'),_0x20d2fb+'-'+_0x5b4604+'/'+_0x75c568)[_0x15fe('0x1f')](_0x4d9484);}return null;};}function patchUpdates(_0x607ef6){return function(_0x2f6e0e){try{jsonpatch['apply'](_0x2f6e0e,_0x607ef6,!![]);}catch(_0x322dfe){return BPromise['reject'](_0x322dfe);}return _0x2f6e0e[_0x15fe('0x26')]();};}function saveUpdates(_0x25b3f5,_0x16323d){return function(_0x1251a1){if(_0x1251a1){return _0x1251a1[_0x15fe('0x27')](_0x25b3f5)[_0x15fe('0x28')](function(_0x1cf537){return _0x1cf537;});}return null;};}function removeEntity(_0x288e80,_0x310f58){return function(_0x267eeb){if(_0x267eeb){return _0x267eeb[_0x15fe('0x29')]()[_0x15fe('0x28')](function(){_0x288e80['status'](0xcc)[_0x15fe('0x1d')]();});}};}function handleEntityNotFound(_0x51f0ba,_0x32b976){return function(_0x1351fb){if(!_0x1351fb){_0x51f0ba['sendStatus'](0x194);}return _0x1351fb;};}function handleError(_0x40f349,_0x2b3085){_0x2b3085=_0x2b3085||0x1f4;return function(_0x375bc8){logger[_0x15fe('0x2a')](_0x375bc8[_0x15fe('0x2b')]);if(_0x375bc8[_0x15fe('0x2c')]){delete _0x375bc8['name'];}_0x40f349[_0x15fe('0x1e')](_0x2b3085)[_0x15fe('0x2d')](_0x375bc8);};}exports[_0x15fe('0x2e')]=function(_0x1ff82d,_0x1ee875){var _0x339e0b={},_0x3d1023={},_0x1253a9={'count':0x0,'rows':[]};var _0x1a0647=_[_0x15fe('0x2f')](db[_0x15fe('0x30')][_0x15fe('0x31')],function(_0x3ea53d){return{'name':_0x3ea53d[_0x15fe('0x32')],'type':_0x3ea53d['type'][_0x15fe('0x33')]};});_0x3d1023['model']=_['map'](_0x1a0647,'name');_0x3d1023[_0x15fe('0x34')]=_['keys'](_0x1ff82d[_0x15fe('0x34')]);_0x3d1023[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x3d1023['model'],_0x3d1023['query']);_0x339e0b[_0x15fe('0x37')]=_['intersection'](_0x3d1023[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x1ff82d['query'][_0x15fe('0x39')]));_0x339e0b[_0x15fe('0x37')]=_0x339e0b['attributes']['length']?_0x339e0b['attributes']:_0x3d1023[_0x15fe('0x38')];if(!_0x1ff82d[_0x15fe('0x34')]['hasOwnProperty'](_0x15fe('0x3a'))){_0x339e0b[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x1ff82d[_0x15fe('0x34')]['limit']);_0x339e0b['offset']=qs[_0x15fe('0x22')](_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x22')]);}_0x339e0b['order']=qs[_0x15fe('0x3b')](_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x339e0b[_0x15fe('0x3c')]=qs['filters'](_[_0x15fe('0x3d')](_0x1ff82d[_0x15fe('0x34')],_0x3d1023['filters']),_0x1a0647);if(_0x1ff82d[_0x15fe('0x34')]['filter']){_0x339e0b['where']=_[_0x15fe('0x3e')](_0x339e0b[_0x15fe('0x3c')],{'$or':_['map'](_0x1a0647,function(_0x26511c){if(_0x26511c[_0x15fe('0x3f')]!==_0x15fe('0x40')){var _0x160288={};_0x160288[_0x26511c['name']]={'$like':'%'+_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x41')]+'%'};return _0x160288;}})});}_0x339e0b=_[_0x15fe('0x3e')]({},_0x339e0b,_0x1ff82d[_0x15fe('0x42')]);var _0xe9321c={'where':_0x339e0b[_0x15fe('0x3c')]};return db['ServicenowConfiguration']['count'](_0xe9321c)[_0x15fe('0x28')](function(_0x12248d){_0x1253a9['count']=_0x12248d;if(_0x1ff82d[_0x15fe('0x34')][_0x15fe('0x43')]){_0x339e0b[_0x15fe('0x44')]=[{'all':!![]}];}return db[_0x15fe('0x30')][_0x15fe('0x45')](_0x339e0b);})['then'](function(_0x3ab7ff){_0x1253a9['rows']=_0x3ab7ff;return _0x1253a9;})[_0x15fe('0x28')](respondWithFilteredResult(_0x1ee875,_0x339e0b))[_0x15fe('0x46')](handleError(_0x1ee875,null));};exports[_0x15fe('0x47')]=function(_0x2b7270,_0x50beb7){var _0x49c1f2={'raw':![],'where':{'id':_0x2b7270['params']['id']}},_0x189936={};_0x189936['model']=_[_0x15fe('0x48')](db[_0x15fe('0x30')][_0x15fe('0x31')]);_0x189936[_0x15fe('0x34')]=_['keys'](_0x2b7270[_0x15fe('0x34')]);_0x189936[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x189936['model'],_0x189936['query']);_0x49c1f2[_0x15fe('0x37')]=_[_0x15fe('0x36')](_0x189936[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x2b7270[_0x15fe('0x34')]['fields']));_0x49c1f2[_0x15fe('0x37')]=_0x49c1f2['attributes'][_0x15fe('0x49')]?_0x49c1f2[_0x15fe('0x37')]:_0x189936[_0x15fe('0x38')];if(_0x2b7270[_0x15fe('0x34')]['includeAll']){_0x49c1f2['include']=[{'all':!![]}];}_0x49c1f2=_[_0x15fe('0x3e')]({},_0x49c1f2,_0x2b7270[_0x15fe('0x42')]);return db[_0x15fe('0x30')]['find'](_0x49c1f2)[_0x15fe('0x28')](handleEntityNotFound(_0x50beb7,null))[_0x15fe('0x28')](respondWithResult(_0x50beb7,null))[_0x15fe('0x46')](handleError(_0x50beb7,null));};exports[_0x15fe('0x4a')]=function(_0x31a7c2,_0x533c1f){return db['ServicenowConfiguration']['create'](_0x31a7c2[_0x15fe('0x4b')],{})['then'](respondWithResult(_0x533c1f,0xc9))[_0x15fe('0x46')](handleError(_0x533c1f,null));};exports[_0x15fe('0x27')]=function(_0x3cf00c,_0x35714d){if(_0x3cf00c[_0x15fe('0x4b')]['id']){delete _0x3cf00c[_0x15fe('0x4b')]['id'];}return db['ServicenowConfiguration'][_0x15fe('0x4c')]({'where':{'id':_0x3cf00c['params']['id']}})['then'](handleEntityNotFound(_0x35714d,null))[_0x15fe('0x28')](saveUpdates(_0x3cf00c[_0x15fe('0x4b')],null))[_0x15fe('0x28')](respondWithResult(_0x35714d,null))['catch'](handleError(_0x35714d,null));};exports[_0x15fe('0x29')]=function(_0x64df1b,_0x513d5b){return db['ServicenowConfiguration']['find']({'where':{'id':_0x64df1b[_0x15fe('0x4d')]['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0x513d5b,null))[_0x15fe('0x28')](removeEntity(_0x513d5b,null))[_0x15fe('0x46')](handleError(_0x513d5b,null));};exports['getFields']=function(_0x5d5772,_0xb289d8,_0x44a162){var _0x51f5a8={};var _0x1524f7={};var _0x134966;var _0x4304ed;return db[_0x15fe('0x30')][_0x15fe('0x4e')]({'where':{'id':_0x5d5772['params']['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0xb289d8,null))[_0x15fe('0x28')](function(_0x343dd6){if(_0x343dd6){_0x134966=_0x343dd6;_0x1524f7[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x1524f7[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x5d5772[_0x15fe('0x34')]);_0x1524f7[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x1524f7['model'],_0x1524f7[_0x15fe('0x34')]);_0x51f5a8[_0x15fe('0x37')]=_['intersection'](_0x1524f7[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x39')]));_0x51f5a8[_0x15fe('0x37')]=_0x51f5a8[_0x15fe('0x37')][_0x15fe('0x49')]?_0x51f5a8[_0x15fe('0x37')]:_0x1524f7[_0x15fe('0x38')];_0x51f5a8[_0x15fe('0x50')]=qs[_0x15fe('0x3b')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x51f5a8[_0x15fe('0x3c')]=qs['filters'](_[_0x15fe('0x3d')](_0x5d5772[_0x15fe('0x34')],_0x1524f7[_0x15fe('0x35')]));if(_0x5d5772['query'][_0x15fe('0x41')]){_0x51f5a8[_0x15fe('0x3c')]=_['merge'](_0x51f5a8['where'],{'$or':_[_0x15fe('0x2f')](_0x51f5a8[_0x15fe('0x37')],function(_0x5c8e33){var _0x7776f7={};_0x7776f7[_0x5c8e33]={'$like':'%'+_0x5d5772[_0x15fe('0x34')][_0x15fe('0x41')]+'%'};return _0x7776f7;})});}_0x51f5a8=_[_0x15fe('0x3e')]({},_0x51f5a8,_0x5d5772[_0x15fe('0x42')]);return _0x134966[_0x15fe('0x51')](_0x51f5a8);}})[_0x15fe('0x28')](function(_0x88d057){if(_0x88d057){_0x4304ed=_0x88d057[_0x15fe('0x49')];if(!_0x5d5772['query'][_0x15fe('0x52')](_0x15fe('0x3a'))){_0x51f5a8[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x23')]);_0x51f5a8[_0x15fe('0x22')]=qs[_0x15fe('0x22')](_0x5d5772[_0x15fe('0x34')][_0x15fe('0x22')]);}return _0x134966[_0x15fe('0x51')](_0x51f5a8);}})[_0x15fe('0x28')](function(_0xbf5219){if(_0xbf5219){return _0xbf5219?{'count':_0x4304ed,'rows':_0xbf5219}:null;}})['then'](respondWithResult(_0xb289d8,null))[_0x15fe('0x46')](handleError(_0xb289d8,null));};exports[_0x15fe('0x53')]=function(_0x444f94,_0x2c720b,_0xbb6419){var _0xf0234e={};var _0x2d08fc={};var _0x10e0bc;var _0x2e3635;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x444f94['params']['id']}})['then'](handleEntityNotFound(_0x2c720b,null))[_0x15fe('0x28')](function(_0x10c745){if(_0x10c745){_0x10e0bc=_0x10c745;_0x2d08fc[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x2d08fc[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x444f94[_0x15fe('0x34')]);_0x2d08fc[_0x15fe('0x35')]=_[_0x15fe('0x36')](_0x2d08fc[_0x15fe('0x38')],_0x2d08fc['query']);_0xf0234e['attributes']=_[_0x15fe('0x36')](_0x2d08fc[_0x15fe('0x38')],qs['fields'](_0x444f94['query'][_0x15fe('0x39')]));_0xf0234e[_0x15fe('0x37')]=_0xf0234e[_0x15fe('0x37')][_0x15fe('0x49')]?_0xf0234e['attributes']:_0x2d08fc[_0x15fe('0x38')];_0xf0234e['order']=qs[_0x15fe('0x3b')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x3b')]);_0xf0234e['where']=qs['filters'](_[_0x15fe('0x3d')](_0x444f94[_0x15fe('0x34')],_0x2d08fc[_0x15fe('0x35')]));if(_0x444f94[_0x15fe('0x34')][_0x15fe('0x41')]){_0xf0234e['where']=_[_0x15fe('0x3e')](_0xf0234e[_0x15fe('0x3c')],{'$or':_[_0x15fe('0x2f')](_0xf0234e[_0x15fe('0x37')],function(_0x8ffa6d){var _0x16b8d3={};_0x16b8d3[_0x8ffa6d]={'$like':'%'+_0x444f94[_0x15fe('0x34')]['filter']+'%'};return _0x16b8d3;})});}_0xf0234e=_['merge']({},_0xf0234e,_0x444f94['options']);return _0x10e0bc[_0x15fe('0x53')](_0xf0234e);}})[_0x15fe('0x28')](function(_0x1da32e){if(_0x1da32e){_0x2e3635=_0x1da32e['length'];if(!_0x444f94[_0x15fe('0x34')][_0x15fe('0x52')](_0x15fe('0x3a'))){_0xf0234e[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x23')]);_0xf0234e[_0x15fe('0x22')]=qs[_0x15fe('0x22')](_0x444f94[_0x15fe('0x34')][_0x15fe('0x22')]);}return _0x10e0bc['getSubjects'](_0xf0234e);}})[_0x15fe('0x28')](function(_0x549142){if(_0x549142){return _0x549142?{'count':_0x2e3635,'rows':_0x549142}:null;}})[_0x15fe('0x28')](respondWithResult(_0x2c720b,null))[_0x15fe('0x46')](handleError(_0x2c720b,null));};exports[_0x15fe('0x54')]=function(_0x5ac309,_0x5083de,_0x30d46a){var _0x5d57ef={};var _0x35de8a={};var _0x56e2b2;var _0x2fa804;return db[_0x15fe('0x30')]['findOne']({'where':{'id':_0x5ac309[_0x15fe('0x4d')]['id']}})[_0x15fe('0x28')](handleEntityNotFound(_0x5083de,null))[_0x15fe('0x28')](function(_0x33b2e9){if(_0x33b2e9){_0x56e2b2=_0x33b2e9;_0x35de8a[_0x15fe('0x38')]=_[_0x15fe('0x48')](db[_0x15fe('0x4f')][_0x15fe('0x31')]);_0x35de8a[_0x15fe('0x34')]=_[_0x15fe('0x48')](_0x5ac309[_0x15fe('0x34')]);_0x35de8a[_0x15fe('0x35')]=_['intersection'](_0x35de8a[_0x15fe('0x38')],_0x35de8a[_0x15fe('0x34')]);_0x5d57ef[_0x15fe('0x37')]=_['intersection'](_0x35de8a[_0x15fe('0x38')],qs[_0x15fe('0x39')](_0x5ac309[_0x15fe('0x34')][_0x15fe('0x39')]));_0x5d57ef[_0x15fe('0x37')]=_0x5d57ef[_0x15fe('0x37')][_0x15fe('0x49')]?_0x5d57ef[_0x15fe('0x37')]:_0x35de8a['model'];_0x5d57ef[_0x15fe('0x50')]=qs[_0x15fe('0x3b')](_0x5ac309[_0x15fe('0x34')][_0x15fe('0x3b')]);_0x5d57ef['where']=qs[_0x15fe('0x35')](_[_0x15fe('0x3d')](_0x5ac309[_0x15fe('0x34')],_0x35de8a[_0x15fe('0x35')]));if(_0x5ac309[_0x15fe('0x34')][_0x15fe('0x41')]){_0x5d57ef[_0x15fe('0x3c')]=_[_0x15fe('0x3e')](_0x5d57ef[_0x15fe('0x3c')],{'$or':_[_0x15fe('0x2f')](_0x5d57ef[_0x15fe('0x37')],function(_0x57192f){var _0x3ad430={};_0x3ad430[_0x57192f]={'$like':'%'+_0x5ac309['query'][_0x15fe('0x41')]+'%'};return _0x3ad430;})});}_0x5d57ef=_[_0x15fe('0x3e')]({},_0x5d57ef,_0x5ac309[_0x15fe('0x42')]);return _0x56e2b2[_0x15fe('0x54')](_0x5d57ef);}})[_0x15fe('0x28')](function(_0x3c60f2){if(_0x3c60f2){_0x2fa804=_0x3c60f2[_0x15fe('0x49')];if(!_0x5ac309['query']['hasOwnProperty'](_0x15fe('0x3a'))){_0x5d57ef[_0x15fe('0x23')]=qs[_0x15fe('0x23')](_0x5ac309['query'][_0x15fe('0x23')]);_0x5d57ef['offset']=qs[_0x15fe('0x22')](_0x5ac309['query'][_0x15fe('0x22')]);}return _0x56e2b2[_0x15fe('0x54')](_0x5d57ef);}})['then'](function(_0x3fe6d2){if(_0x3fe6d2){return _0x3fe6d2?{'count':_0x2fa804,'rows':_0x3fe6d2}:null;}})[_0x15fe('0x28')](respondWithResult(_0x5083de,null))['catch'](handleError(_0x5083de,null));}; \ No newline at end of file +var _0xee15=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','catch','show','rawAttributes','create','body','find','params','ServicenowField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','then','destroy','error','stack','name','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x44d6ec,_0x4c94a6){var _0x567d55=function(_0x5aa16c){while(--_0x5aa16c){_0x44d6ec['push'](_0x44d6ec['shift']());}};_0x567d55(++_0x4c94a6);}(_0xee15,0x18a));var _0x5ee1=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xee15[_0x7791d5];return _0x5ce288;};'use strict';var emlformat=require(_0x5ee1('0x0'));var rimraf=require(_0x5ee1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ee1('0x2'));var BPromise=require(_0x5ee1('0x3'));var Mustache=require(_0x5ee1('0x4'));var util=require(_0x5ee1('0x5'));var path=require('path');var sox=require(_0x5ee1('0x6'));var csv=require(_0x5ee1('0x7'));var ejs=require(_0x5ee1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ee1('0x9'));var squel=require(_0x5ee1('0xa'));var crypto=require(_0x5ee1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ee1('0xc'));var toCsv=require(_0x5ee1('0x7'));var querystring=require(_0x5ee1('0xd'));var Papa=require(_0x5ee1('0xe'));var Redis=require(_0x5ee1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ee1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ee1('0x11'));var logger=require(_0x5ee1('0x12'))(_0x5ee1('0x13'));var utils=require(_0x5ee1('0x14'));var config=require(_0x5ee1('0x15'));var licenseUtil=require(_0x5ee1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x368524,_0x1c24d5){_0x1c24d5=_0x1c24d5||0xcc;return function(_0x9ce671){if(_0x9ce671){return _0x368524[_0x5ee1('0x17')](_0x1c24d5);}return _0x368524[_0x5ee1('0x18')](_0x1c24d5)[_0x5ee1('0x19')]();};}function respondWithResult(_0x1c45cd,_0x11fe45){_0x11fe45=_0x11fe45||0xc8;return function(_0x37fe17){if(_0x37fe17){return _0x1c45cd[_0x5ee1('0x18')](_0x11fe45)[_0x5ee1('0x1a')](_0x37fe17);}};}function respondWithFilteredResult(_0x310659,_0x5ee0f7){return function(_0xa80891){if(_0xa80891){var _0x48c7cf=typeof _0x5ee0f7['offset']==='undefined'&&typeof _0x5ee0f7[_0x5ee1('0x1b')]===_0x5ee1('0x1c');var _0x36877f=_0xa80891[_0x5ee1('0x1d')];var _0x382551=_0x48c7cf?0x0:_0x5ee0f7[_0x5ee1('0x1e')];var _0x29b55f=_0x48c7cf?_0xa80891['count']:_0x5ee0f7[_0x5ee1('0x1e')]+_0x5ee0f7[_0x5ee1('0x1b')];var _0x53b312;if(_0x29b55f>=_0x36877f){_0x29b55f=_0x36877f;_0x53b312=0xc8;}else{_0x53b312=0xce;}_0x310659[_0x5ee1('0x18')](_0x53b312);return _0x310659[_0x5ee1('0x1f')](_0x5ee1('0x20'),_0x382551+'-'+_0x29b55f+'/'+_0x36877f)[_0x5ee1('0x1a')](_0xa80891);}return null;};}function patchUpdates(_0x2c5926){return function(_0x7a7c77){try{jsonpatch['apply'](_0x7a7c77,_0x2c5926,!![]);}catch(_0x465340){return BPromise['reject'](_0x465340);}return _0x7a7c77['save']();};}function saveUpdates(_0x59c01b,_0x5054f8){return function(_0x599e88){if(_0x599e88){return _0x599e88['update'](_0x59c01b)[_0x5ee1('0x21')](function(_0x3b35b6){return _0x3b35b6;});}return null;};}function removeEntity(_0x4a79cc,_0x3961af){return function(_0x2f43d0){if(_0x2f43d0){return _0x2f43d0[_0x5ee1('0x22')]()[_0x5ee1('0x21')](function(){_0x4a79cc[_0x5ee1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40fc19,_0x41042c){return function(_0x577a24){if(!_0x577a24){_0x40fc19[_0x5ee1('0x17')](0x194);}return _0x577a24;};}function handleError(_0x1f884a,_0x84b7e9){_0x84b7e9=_0x84b7e9||0x1f4;return function(_0x750736){logger[_0x5ee1('0x23')](_0x750736[_0x5ee1('0x24')]);if(_0x750736[_0x5ee1('0x25')]){delete _0x750736[_0x5ee1('0x25')];}_0x1f884a[_0x5ee1('0x18')](_0x84b7e9)['send'](_0x750736);};}exports['index']=function(_0x2892ec,_0x20e118){var _0x1224be={},_0x311986={},_0x314583={'count':0x0,'rows':[]};var _0x16ecdd=_[_0x5ee1('0x26')](db['ServicenowConfiguration']['rawAttributes'],function(_0x35cb6e){return{'name':_0x35cb6e['fieldName'],'type':_0x35cb6e[_0x5ee1('0x27')][_0x5ee1('0x28')]};});_0x311986[_0x5ee1('0x29')]=_[_0x5ee1('0x26')](_0x16ecdd,_0x5ee1('0x25'));_0x311986[_0x5ee1('0x2a')]=_[_0x5ee1('0x2b')](_0x2892ec[_0x5ee1('0x2a')]);_0x311986[_0x5ee1('0x2c')]=_[_0x5ee1('0x2d')](_0x311986[_0x5ee1('0x29')],_0x311986[_0x5ee1('0x2a')]);_0x1224be['attributes']=_[_0x5ee1('0x2d')](_0x311986['model'],qs[_0x5ee1('0x2e')](_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x2e')]));_0x1224be[_0x5ee1('0x2f')]=_0x1224be['attributes'][_0x5ee1('0x30')]?_0x1224be['attributes']:_0x311986['model'];if(!_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x31')](_0x5ee1('0x32'))){_0x1224be[_0x5ee1('0x1b')]=qs[_0x5ee1('0x1b')](_0x2892ec[_0x5ee1('0x2a')]['limit']);_0x1224be[_0x5ee1('0x1e')]=qs[_0x5ee1('0x1e')](_0x2892ec[_0x5ee1('0x2a')]['offset']);}_0x1224be[_0x5ee1('0x33')]=qs[_0x5ee1('0x34')](_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x34')]);_0x1224be[_0x5ee1('0x35')]=qs[_0x5ee1('0x2c')](_[_0x5ee1('0x36')](_0x2892ec['query'],_0x311986[_0x5ee1('0x2c')]),_0x16ecdd);if(_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x37')]){_0x1224be[_0x5ee1('0x35')]=_[_0x5ee1('0x38')](_0x1224be[_0x5ee1('0x35')],{'$or':_['map'](_0x16ecdd,function(_0x5c4dc){if(_0x5c4dc[_0x5ee1('0x27')]!==_0x5ee1('0x39')){var _0x4a1a3d={};_0x4a1a3d[_0x5c4dc[_0x5ee1('0x25')]]={'$like':'%'+_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x37')]+'%'};return _0x4a1a3d;}})});}_0x1224be=_[_0x5ee1('0x38')]({},_0x1224be,_0x2892ec[_0x5ee1('0x3a')]);var _0x348b23={'where':_0x1224be[_0x5ee1('0x35')]};return db[_0x5ee1('0x3b')][_0x5ee1('0x1d')](_0x348b23)[_0x5ee1('0x21')](function(_0x441839){_0x314583['count']=_0x441839;if(_0x2892ec[_0x5ee1('0x2a')][_0x5ee1('0x3c')]){_0x1224be[_0x5ee1('0x3d')]=[{'all':!![]}];}return db[_0x5ee1('0x3b')]['findAll'](_0x1224be);})[_0x5ee1('0x21')](function(_0x1c5cac){_0x314583['rows']=_0x1c5cac;return _0x314583;})[_0x5ee1('0x21')](respondWithFilteredResult(_0x20e118,_0x1224be))[_0x5ee1('0x3e')](handleError(_0x20e118,null));};exports[_0x5ee1('0x3f')]=function(_0x21d575,_0x354bc1){var _0x2c2a4d={'raw':![],'where':{'id':_0x21d575['params']['id']}},_0xa365bb={};_0xa365bb[_0x5ee1('0x29')]=_[_0x5ee1('0x2b')](db['ServicenowConfiguration'][_0x5ee1('0x40')]);_0xa365bb['query']=_['keys'](_0x21d575[_0x5ee1('0x2a')]);_0xa365bb['filters']=_[_0x5ee1('0x2d')](_0xa365bb[_0x5ee1('0x29')],_0xa365bb[_0x5ee1('0x2a')]);_0x2c2a4d[_0x5ee1('0x2f')]=_[_0x5ee1('0x2d')](_0xa365bb[_0x5ee1('0x29')],qs[_0x5ee1('0x2e')](_0x21d575['query']['fields']));_0x2c2a4d[_0x5ee1('0x2f')]=_0x2c2a4d[_0x5ee1('0x2f')][_0x5ee1('0x30')]?_0x2c2a4d['attributes']:_0xa365bb[_0x5ee1('0x29')];if(_0x21d575[_0x5ee1('0x2a')][_0x5ee1('0x3c')]){_0x2c2a4d[_0x5ee1('0x3d')]=[{'all':!![]}];}_0x2c2a4d=_[_0x5ee1('0x38')]({},_0x2c2a4d,_0x21d575[_0x5ee1('0x3a')]);return db[_0x5ee1('0x3b')]['find'](_0x2c2a4d)[_0x5ee1('0x21')](handleEntityNotFound(_0x354bc1,null))[_0x5ee1('0x21')](respondWithResult(_0x354bc1,null))['catch'](handleError(_0x354bc1,null));};exports[_0x5ee1('0x41')]=function(_0x2625d0,_0x533293){return db['ServicenowConfiguration'][_0x5ee1('0x41')](_0x2625d0[_0x5ee1('0x42')],{})[_0x5ee1('0x21')](respondWithResult(_0x533293,0xc9))[_0x5ee1('0x3e')](handleError(_0x533293,null));};exports['update']=function(_0x9d0626,_0x44557a){if(_0x9d0626[_0x5ee1('0x42')]['id']){delete _0x9d0626['body']['id'];}return db['ServicenowConfiguration'][_0x5ee1('0x43')]({'where':{'id':_0x9d0626['params']['id']}})[_0x5ee1('0x21')](handleEntityNotFound(_0x44557a,null))[_0x5ee1('0x21')](saveUpdates(_0x9d0626[_0x5ee1('0x42')],null))[_0x5ee1('0x21')](respondWithResult(_0x44557a,null))[_0x5ee1('0x3e')](handleError(_0x44557a,null));};exports[_0x5ee1('0x22')]=function(_0x3690b9,_0x159171){return db['ServicenowConfiguration'][_0x5ee1('0x43')]({'where':{'id':_0x3690b9['params']['id']}})[_0x5ee1('0x21')](handleEntityNotFound(_0x159171,null))[_0x5ee1('0x21')](removeEntity(_0x159171,null))[_0x5ee1('0x3e')](handleError(_0x159171,null));};exports['getFields']=function(_0x2ed2a4,_0x10592b,_0x284c8b){var _0x56e75c={};var _0x28c9ff={};var _0x2f9d49;var _0x3a42b0;return db[_0x5ee1('0x3b')]['findOne']({'where':{'id':_0x2ed2a4[_0x5ee1('0x44')]['id']}})[_0x5ee1('0x21')](handleEntityNotFound(_0x10592b,null))['then'](function(_0x423f01){if(_0x423f01){_0x2f9d49=_0x423f01;_0x28c9ff['model']=_[_0x5ee1('0x2b')](db[_0x5ee1('0x45')][_0x5ee1('0x40')]);_0x28c9ff[_0x5ee1('0x2a')]=_[_0x5ee1('0x2b')](_0x2ed2a4[_0x5ee1('0x2a')]);_0x28c9ff['filters']=_['intersection'](_0x28c9ff[_0x5ee1('0x29')],_0x28c9ff[_0x5ee1('0x2a')]);_0x56e75c[_0x5ee1('0x2f')]=_[_0x5ee1('0x2d')](_0x28c9ff[_0x5ee1('0x29')],qs[_0x5ee1('0x2e')](_0x2ed2a4[_0x5ee1('0x2a')]['fields']));_0x56e75c['attributes']=_0x56e75c[_0x5ee1('0x2f')][_0x5ee1('0x30')]?_0x56e75c[_0x5ee1('0x2f')]:_0x28c9ff[_0x5ee1('0x29')];_0x56e75c[_0x5ee1('0x33')]=qs[_0x5ee1('0x34')](_0x2ed2a4[_0x5ee1('0x2a')]['sort']);_0x56e75c['where']=qs[_0x5ee1('0x2c')](_[_0x5ee1('0x36')](_0x2ed2a4[_0x5ee1('0x2a')],_0x28c9ff[_0x5ee1('0x2c')]));if(_0x2ed2a4[_0x5ee1('0x2a')][_0x5ee1('0x37')]){_0x56e75c['where']=_[_0x5ee1('0x38')](_0x56e75c['where'],{'$or':_[_0x5ee1('0x26')](_0x56e75c['attributes'],function(_0x56e391){var _0x47ad2c={};_0x47ad2c[_0x56e391]={'$like':'%'+_0x2ed2a4[_0x5ee1('0x2a')][_0x5ee1('0x37')]+'%'};return _0x47ad2c;})});}_0x56e75c=_[_0x5ee1('0x38')]({},_0x56e75c,_0x2ed2a4['options']);return _0x2f9d49[_0x5ee1('0x46')](_0x56e75c);}})['then'](function(_0x665e20){if(_0x665e20){_0x3a42b0=_0x665e20[_0x5ee1('0x30')];if(!_0x2ed2a4[_0x5ee1('0x2a')][_0x5ee1('0x31')](_0x5ee1('0x32'))){_0x56e75c['limit']=qs[_0x5ee1('0x1b')](_0x2ed2a4[_0x5ee1('0x2a')][_0x5ee1('0x1b')]);_0x56e75c[_0x5ee1('0x1e')]=qs['offset'](_0x2ed2a4[_0x5ee1('0x2a')][_0x5ee1('0x1e')]);}return _0x2f9d49[_0x5ee1('0x46')](_0x56e75c);}})[_0x5ee1('0x21')](function(_0xc3fca2){if(_0xc3fca2){return _0xc3fca2?{'count':_0x3a42b0,'rows':_0xc3fca2}:null;}})[_0x5ee1('0x21')](respondWithResult(_0x10592b,null))[_0x5ee1('0x3e')](handleError(_0x10592b,null));};exports[_0x5ee1('0x47')]=function(_0x3c826f,_0x1e8e46,_0x413fe8){var _0xe94963={};var _0x5e9489={};var _0x36b4cf;var _0x4af479;return db[_0x5ee1('0x3b')][_0x5ee1('0x48')]({'where':{'id':_0x3c826f[_0x5ee1('0x44')]['id']}})[_0x5ee1('0x21')](handleEntityNotFound(_0x1e8e46,null))[_0x5ee1('0x21')](function(_0x730c5a){if(_0x730c5a){_0x36b4cf=_0x730c5a;_0x5e9489['model']=_['keys'](db[_0x5ee1('0x45')][_0x5ee1('0x40')]);_0x5e9489[_0x5ee1('0x2a')]=_[_0x5ee1('0x2b')](_0x3c826f[_0x5ee1('0x2a')]);_0x5e9489[_0x5ee1('0x2c')]=_[_0x5ee1('0x2d')](_0x5e9489['model'],_0x5e9489[_0x5ee1('0x2a')]);_0xe94963[_0x5ee1('0x2f')]=_[_0x5ee1('0x2d')](_0x5e9489[_0x5ee1('0x29')],qs[_0x5ee1('0x2e')](_0x3c826f[_0x5ee1('0x2a')][_0x5ee1('0x2e')]));_0xe94963[_0x5ee1('0x2f')]=_0xe94963[_0x5ee1('0x2f')][_0x5ee1('0x30')]?_0xe94963[_0x5ee1('0x2f')]:_0x5e9489['model'];_0xe94963[_0x5ee1('0x33')]=qs['sort'](_0x3c826f[_0x5ee1('0x2a')][_0x5ee1('0x34')]);_0xe94963['where']=qs[_0x5ee1('0x2c')](_[_0x5ee1('0x36')](_0x3c826f[_0x5ee1('0x2a')],_0x5e9489[_0x5ee1('0x2c')]));if(_0x3c826f[_0x5ee1('0x2a')][_0x5ee1('0x37')]){_0xe94963[_0x5ee1('0x35')]=_[_0x5ee1('0x38')](_0xe94963['where'],{'$or':_['map'](_0xe94963[_0x5ee1('0x2f')],function(_0x259d1c){var _0x2932c6={};_0x2932c6[_0x259d1c]={'$like':'%'+_0x3c826f[_0x5ee1('0x2a')][_0x5ee1('0x37')]+'%'};return _0x2932c6;})});}_0xe94963=_[_0x5ee1('0x38')]({},_0xe94963,_0x3c826f[_0x5ee1('0x3a')]);return _0x36b4cf['getSubjects'](_0xe94963);}})[_0x5ee1('0x21')](function(_0x5775d4){if(_0x5775d4){_0x4af479=_0x5775d4['length'];if(!_0x3c826f['query'][_0x5ee1('0x31')]('nolimit')){_0xe94963[_0x5ee1('0x1b')]=qs['limit'](_0x3c826f[_0x5ee1('0x2a')]['limit']);_0xe94963[_0x5ee1('0x1e')]=qs[_0x5ee1('0x1e')](_0x3c826f['query'][_0x5ee1('0x1e')]);}return _0x36b4cf[_0x5ee1('0x47')](_0xe94963);}})[_0x5ee1('0x21')](function(_0x40c71a){if(_0x40c71a){return _0x40c71a?{'count':_0x4af479,'rows':_0x40c71a}:null;}})[_0x5ee1('0x21')](respondWithResult(_0x1e8e46,null))[_0x5ee1('0x3e')](handleError(_0x1e8e46,null));};exports['getDescriptions']=function(_0x2ca0bf,_0x466708,_0x292178){var _0x2d8bfa={};var _0x2737eb={};var _0x11f3a7;var _0x4f4359;return db[_0x5ee1('0x3b')][_0x5ee1('0x48')]({'where':{'id':_0x2ca0bf['params']['id']}})[_0x5ee1('0x21')](handleEntityNotFound(_0x466708,null))[_0x5ee1('0x21')](function(_0x821324){if(_0x821324){_0x11f3a7=_0x821324;_0x2737eb[_0x5ee1('0x29')]=_['keys'](db[_0x5ee1('0x45')][_0x5ee1('0x40')]);_0x2737eb[_0x5ee1('0x2a')]=_[_0x5ee1('0x2b')](_0x2ca0bf[_0x5ee1('0x2a')]);_0x2737eb[_0x5ee1('0x2c')]=_[_0x5ee1('0x2d')](_0x2737eb[_0x5ee1('0x29')],_0x2737eb[_0x5ee1('0x2a')]);_0x2d8bfa[_0x5ee1('0x2f')]=_[_0x5ee1('0x2d')](_0x2737eb[_0x5ee1('0x29')],qs['fields'](_0x2ca0bf[_0x5ee1('0x2a')][_0x5ee1('0x2e')]));_0x2d8bfa[_0x5ee1('0x2f')]=_0x2d8bfa[_0x5ee1('0x2f')][_0x5ee1('0x30')]?_0x2d8bfa['attributes']:_0x2737eb[_0x5ee1('0x29')];_0x2d8bfa['order']=qs[_0x5ee1('0x34')](_0x2ca0bf[_0x5ee1('0x2a')][_0x5ee1('0x34')]);_0x2d8bfa[_0x5ee1('0x35')]=qs[_0x5ee1('0x2c')](_[_0x5ee1('0x36')](_0x2ca0bf[_0x5ee1('0x2a')],_0x2737eb['filters']));if(_0x2ca0bf[_0x5ee1('0x2a')][_0x5ee1('0x37')]){_0x2d8bfa[_0x5ee1('0x35')]=_[_0x5ee1('0x38')](_0x2d8bfa[_0x5ee1('0x35')],{'$or':_['map'](_0x2d8bfa[_0x5ee1('0x2f')],function(_0x4d8c0d){var _0x2d5b7f={};_0x2d5b7f[_0x4d8c0d]={'$like':'%'+_0x2ca0bf[_0x5ee1('0x2a')]['filter']+'%'};return _0x2d5b7f;})});}_0x2d8bfa=_['merge']({},_0x2d8bfa,_0x2ca0bf[_0x5ee1('0x3a')]);return _0x11f3a7[_0x5ee1('0x49')](_0x2d8bfa);}})[_0x5ee1('0x21')](function(_0x5a57fa){if(_0x5a57fa){_0x4f4359=_0x5a57fa[_0x5ee1('0x30')];if(!_0x2ca0bf[_0x5ee1('0x2a')]['hasOwnProperty'](_0x5ee1('0x32'))){_0x2d8bfa[_0x5ee1('0x1b')]=qs[_0x5ee1('0x1b')](_0x2ca0bf[_0x5ee1('0x2a')]['limit']);_0x2d8bfa[_0x5ee1('0x1e')]=qs[_0x5ee1('0x1e')](_0x2ca0bf[_0x5ee1('0x2a')]['offset']);}return _0x11f3a7[_0x5ee1('0x49')](_0x2d8bfa);}})[_0x5ee1('0x21')](function(_0x5bfdcb){if(_0x5bfdcb){return _0x5bfdcb?{'count':_0x4f4359,'rows':_0x5bfdcb}:null;}})[_0x5ee1('0x21')](respondWithResult(_0x466708,null))[_0x5ee1('0x3e')](handleError(_0x466708,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3ac94ff..8250c20 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 _0x457b=['api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x457b,0xca));var _0xb457=function(_0x42cb74,_0xd030f0){_0x42cb74=_0x42cb74-0x0;var _0x264737=_0x457b[_0x42cb74];return _0x264737;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var logger=require('../../config/logger')(_0xb457('0x2'));var moment=require(_0xb457('0x3'));var BPromise=require(_0xb457('0x4'));var rp=require(_0xb457('0x5'));var fs=require('fs');var path=require(_0xb457('0x6'));var rimraf=require('rimraf');var config=require(_0xb457('0x7'));var attributes=require(_0xb457('0x8'));module[_0xb457('0x9')]=function(_0x3823c7,_0x3cefc3){return _0x3823c7['define'](_0xb457('0xa'),attributes,{'tableName':_0xb457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed03=['lodash','util','api','request-promise','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x18fa5a,_0x3a6dde){var _0x39f1d3=function(_0x40bdec){while(--_0x40bdec){_0x18fa5a['push'](_0x18fa5a['shift']());}};_0x39f1d3(++_0x3a6dde);}(_0xed03,0xdc));var _0x3ed0=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xed03[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var logger=require('../../config/logger')(_0x3ed0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3ed0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ed0('0x4'));var config=require('../../config/environment');var attributes=require(_0x3ed0('0x5'));module[_0x3ed0('0x6')]=function(_0x9ef405,_0x39a2a0){return _0x9ef405[_0x3ed0('0x7')](_0x3ed0('0x8'),attributes,{'tableName':_0x3ed0('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 5f8bc9d..b0a74d1 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 _0x90ef=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x90ef,0x171));var _0xf90e=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0x90ef[_0x1b3e32];return _0x4796e3;};'use strict';var _=require(_0xf90e('0x0'));var util=require(_0xf90e('0x1'));var moment=require(_0xf90e('0x2'));var BPromise=require(_0xf90e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf90e('0x4'));var db=require(_0xf90e('0x5'))['db'];var utils=require(_0xf90e('0x6'));var logger=require('../../config/logger')(_0xf90e('0x7'));var config=require(_0xf90e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf90e('0x9')][_0xf90e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x385436,_0x5a86ce,_0x3ddfee){return new BPromise(function(_0x4fce40,_0x327de0){return client[_0xf90e('0xb')](_0x385436,_0x3ddfee)[_0xf90e('0xc')](function(_0x4ea9a0){logger[_0xf90e('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5a86ce,_0xf90e('0xe'));logger['debug'](_0xf90e('0xf'),_0x5a86ce,_0xf90e('0xe'),JSON[_0xf90e('0x10')](_0x4ea9a0));if(_0x4ea9a0[_0xf90e('0x11')]){if(_0x4ea9a0['error'][_0xf90e('0x12')]===0x1f4){logger[_0xf90e('0x11')](_0xf90e('0x13'),_0x5a86ce,_0x4ea9a0[_0xf90e('0x11')][_0xf90e('0x14')]);return _0x327de0(_0x4ea9a0['error'][_0xf90e('0x14')]);}logger[_0xf90e('0x11')](_0xf90e('0x13'),_0x5a86ce,_0x4ea9a0[_0xf90e('0x11')][_0xf90e('0x14')]);return _0x4fce40(_0x4ea9a0['error'][_0xf90e('0x14')]);}else{logger[_0xf90e('0xd')](_0xf90e('0x13'),_0x5a86ce,'request\x20sent');_0x4fce40(_0x4ea9a0[_0xf90e('0x15')][_0xf90e('0x14')]);}})[_0xf90e('0x16')](function(_0x1a5506){logger[_0xf90e('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5a86ce,_0x1a5506);_0x327de0(_0x1a5506);});});} \ No newline at end of file +var _0x929e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x350fac,_0x10781a){var _0xc47cad=function(_0x4245d7){while(--_0x4245d7){_0x350fac['push'](_0x350fac['shift']());}};_0xc47cad(++_0x10781a);}(_0x929e,0xb2));var _0xe929=function(_0x7d89d1,_0x1aa838){_0x7d89d1=_0x7d89d1-0x0;var _0x3b1e20=_0x929e[_0x7d89d1];return _0x3b1e20;};'use strict';var _=require(_0xe929('0x0'));var util=require(_0xe929('0x1'));var moment=require(_0xe929('0x2'));var BPromise=require(_0xe929('0x3'));var rs=require(_0xe929('0x4'));var fs=require('fs');var Redis=require(_0xe929('0x5'));var db=require(_0xe929('0x6'))['db'];var utils=require(_0xe929('0x7'));var logger=require('../../config/logger')(_0xe929('0x8'));var config=require('../../config/environment');var jayson=require(_0xe929('0x9'));var client=jayson['client'][_0xe929('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a8b3c,_0x217b11,_0x3c48f8){return new BPromise(function(_0xe57bef,_0x10f304){return client[_0xe929('0xb')](_0x1a8b3c,_0x3c48f8)['then'](function(_0x32389a){logger[_0xe929('0xc')](_0xe929('0xd'),_0x217b11,_0xe929('0xe'));logger['debug'](_0xe929('0xf'),_0x217b11,_0xe929('0xe'),JSON[_0xe929('0x10')](_0x32389a));if(_0x32389a[_0xe929('0x11')]){if(_0x32389a[_0xe929('0x11')][_0xe929('0x12')]===0x1f4){logger[_0xe929('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x217b11,_0x32389a[_0xe929('0x11')][_0xe929('0x13')]);return _0x10f304(_0x32389a[_0xe929('0x11')]['message']);}logger['error'](_0xe929('0xd'),_0x217b11,_0x32389a[_0xe929('0x11')][_0xe929('0x13')]);return _0xe57bef(_0x32389a['error'][_0xe929('0x13')]);}else{logger[_0xe929('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x217b11,_0xe929('0xe'));_0xe57bef(_0x32389a[_0xe929('0x14')][_0xe929('0x13')]);}})[_0xe929('0x15')](function(_0x399a86){logger[_0xe929('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x217b11,_0x399a86);_0x10f304(_0x399a86);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7c583c3..ce8bef8 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 _0xf44e=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x31def2,_0x314684){var _0x2be1d3=function(_0x3fbadf){while(--_0x3fbadf){_0x31def2['push'](_0x31def2['shift']());}};_0x2be1d3(++_0x314684);}(_0xf44e,0x16b));var _0xef44=function(_0x2c1dfd,_0x263dc3){_0x2c1dfd=_0x2c1dfd-0x0;var _0x27b362=_0xf44e[_0x2c1dfd];return _0x27b362;};'use strict';var multer=require(_0xef44('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef44('0x1'));var express=require(_0xef44('0x2'));var router=express[_0xef44('0x3')]();var fs_extra=require(_0xef44('0x4'));var auth=require(_0xef44('0x5'));var interaction=require(_0xef44('0x6'));var config=require('../../config/environment');var controller=require(_0xef44('0x7'));router[_0xef44('0x8')]('/',auth[_0xef44('0x9')](),controller[_0xef44('0xa')]);router['get'](_0xef44('0xb'),auth[_0xef44('0x9')](),controller[_0xef44('0xc')]);router[_0xef44('0xd')]('/',auth[_0xef44('0x9')](),controller[_0xef44('0xe')]);router[_0xef44('0xf')](_0xef44('0xb'),auth[_0xef44('0x9')](),controller[_0xef44('0x10')]);router[_0xef44('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xef44('0x12')]);module[_0xef44('0x13')]=router; \ No newline at end of file +var _0xa966=['get','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','path','Router','fs-extra','./intServicenowField.controller','index'];(function(_0x5ed493,_0x2e626d){var _0x5515c8=function(_0xa3d418){while(--_0xa3d418){_0x5ed493['push'](_0x5ed493['shift']());}};_0x5515c8(++_0x2e626d);}(_0xa966,0x19a));var _0x6a96=function(_0x5d0140,_0xe77bbb){_0x5d0140=_0x5d0140-0x0;var _0x503aab=_0xa966[_0x5d0140];return _0x503aab;};'use strict';var multer=require(_0x6a96('0x0'));var util=require('util');var path=require(_0x6a96('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6a96('0x2')]();var fs_extra=require(_0x6a96('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6a96('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x6a96('0x5')]);router[_0x6a96('0x6')](_0x6a96('0x7'),auth['isAuthenticated'](),controller[_0x6a96('0x8')]);router[_0x6a96('0x9')]('/',auth[_0x6a96('0xa')](),controller[_0x6a96('0xb')]);router['put'](_0x6a96('0x7'),auth['isAuthenticated'](),controller[_0x6a96('0xc')]);router[_0x6a96('0xd')]('/:id',auth[_0x6a96('0xa')](),controller[_0x6a96('0xe')]);module[_0x6a96('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 25ea56c..b366b77 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 _0x3972=['ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3972,0xce));var _0x2397=function(_0xc472da,_0xac0d82){_0xc472da=_0xc472da-0x0;var _0x1e6558=_0x3972[_0xc472da];return _0x1e6558;};'use strict';var Sequelize=require(_0x2397('0x0'));module['exports']={'type':{'type':Sequelize[_0x2397('0x1')]('string','variable',_0x2397('0x2'),_0x2397('0x3'),_0x2397('0x4')),'defaultValue':_0x2397('0x5')},'content':{'type':Sequelize[_0x2397('0x6')]},'key':{'type':Sequelize[_0x2397('0x6')]},'keyType':{'type':Sequelize[_0x2397('0x1')](_0x2397('0x5'),_0x2397('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2397('0x6')]},'nameField':{'type':Sequelize[_0x2397('0x6')]},'customField':{'type':Sequelize[_0x2397('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2397('0x6')]}}; \ No newline at end of file +var _0x8e83=['sequelize','exports','variable','customVariable','keyValue','string','STRING','ENUM','BOOLEAN'];(function(_0x9a560f,_0x43409a){var _0x53f811=function(_0x312004){while(--_0x312004){_0x9a560f['push'](_0x9a560f['shift']());}};_0x53f811(++_0x43409a);}(_0x8e83,0x183));var _0x38e8=function(_0x1487d9,_0x4efec4){_0x1487d9=_0x1487d9-0x0;var _0x5f2beb=_0x8e83[_0x1487d9];return _0x5f2beb;};'use strict';var Sequelize=require(_0x38e8('0x0'));module[_0x38e8('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x38e8('0x2'),_0x38e8('0x3'),_0x38e8('0x4'),'picklist'),'defaultValue':_0x38e8('0x5')},'content':{'type':Sequelize[_0x38e8('0x6')]},'key':{'type':Sequelize[_0x38e8('0x6')]},'keyType':{'type':Sequelize[_0x38e8('0x7')](_0x38e8('0x5'),_0x38e8('0x2'),_0x38e8('0x3'))},'keyContent':{'type':Sequelize[_0x38e8('0x6')]},'idField':{'type':Sequelize[_0x38e8('0x6')]},'nameField':{'type':Sequelize[_0x38e8('0x6')]},'customField':{'type':Sequelize[_0x38e8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38e8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2dd0578..473aac6 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 _0x1b85=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','name','index','map','ServicenowField','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','create','body','catch','update','params','eml-format','rimraf','zip-dir','bluebird','path','sox'];(function(_0x3099d1,_0x3dd47b){var _0x19fec0=function(_0x28a1e8){while(--_0x28a1e8){_0x3099d1['push'](_0x3099d1['shift']());}};_0x19fec0(++_0x3dd47b);}(_0x1b85,0x10e));var _0x51b8=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0x1b85[_0x48df04];return _0x4de5fa;};'use strict';var emlformat=require(_0x51b8('0x0'));var rimraf=require(_0x51b8('0x1'));var zipdir=require(_0x51b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51b8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x51b8('0x4'));var sox=require(_0x51b8('0x5'));var csv=require(_0x51b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51b8('0x7'));var _=require(_0x51b8('0x8'));var squel=require(_0x51b8('0x9'));var crypto=require(_0x51b8('0xa'));var jsforce=require(_0x51b8('0xb'));var deskjs=require(_0x51b8('0xc'));var toCsv=require(_0x51b8('0x6'));var querystring=require('querystring');var Papa=require(_0x51b8('0xd'));var Redis=require(_0x51b8('0xe'));var authService=require(_0x51b8('0xf'));var qs=require(_0x51b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51b8('0x11'))(_0x51b8('0x12'));var utils=require(_0x51b8('0x13'));var config=require(_0x51b8('0x14'));var licenseUtil=require(_0x51b8('0x15'));var db=require(_0x51b8('0x16'))['db'];function respondWithStatusCode(_0x8b7928,_0x2d117b){_0x2d117b=_0x2d117b||0xcc;return function(_0x40af79){if(_0x40af79){return _0x8b7928['sendStatus'](_0x2d117b);}return _0x8b7928['status'](_0x2d117b)['end']();};}function respondWithResult(_0x9677a4,_0x5e7a5e){_0x5e7a5e=_0x5e7a5e||0xc8;return function(_0x176518){if(_0x176518){return _0x9677a4[_0x51b8('0x17')](_0x5e7a5e)[_0x51b8('0x18')](_0x176518);}};}function respondWithFilteredResult(_0x1cd2ed,_0x2d46f0){return function(_0x52829b){if(_0x52829b){var _0x553a35=typeof _0x2d46f0[_0x51b8('0x19')]==='undefined'&&typeof _0x2d46f0['limit']==='undefined';var _0x4b5baa=_0x52829b[_0x51b8('0x1a')];var _0x5628fe=_0x553a35?0x0:_0x2d46f0[_0x51b8('0x19')];var _0x119874=_0x553a35?_0x52829b[_0x51b8('0x1a')]:_0x2d46f0[_0x51b8('0x19')]+_0x2d46f0[_0x51b8('0x1b')];var _0x39a08a;if(_0x119874>=_0x4b5baa){_0x119874=_0x4b5baa;_0x39a08a=0xc8;}else{_0x39a08a=0xce;}_0x1cd2ed['status'](_0x39a08a);return _0x1cd2ed['set'](_0x51b8('0x1c'),_0x5628fe+'-'+_0x119874+'/'+_0x4b5baa)[_0x51b8('0x18')](_0x52829b);}return null;};}function patchUpdates(_0x696ab5){return function(_0x40becc){try{jsonpatch[_0x51b8('0x1d')](_0x40becc,_0x696ab5,!![]);}catch(_0x56b2bb){return BPromise[_0x51b8('0x1e')](_0x56b2bb);}return _0x40becc['save']();};}function saveUpdates(_0x2a5cdc,_0x21476d){return function(_0x8df4b8){if(_0x8df4b8){return _0x8df4b8['update'](_0x2a5cdc)[_0x51b8('0x1f')](function(_0x20eba2){return _0x20eba2;});}return null;};}function removeEntity(_0x431a36,_0xd56aeb){return function(_0x34387d){if(_0x34387d){return _0x34387d[_0x51b8('0x20')]()[_0x51b8('0x1f')](function(){_0x431a36[_0x51b8('0x17')](0xcc)[_0x51b8('0x21')]();});}};}function handleEntityNotFound(_0x234f9a,_0x547e4f){return function(_0x394fb9){if(!_0x394fb9){_0x234f9a['sendStatus'](0x194);}return _0x394fb9;};}function handleError(_0x3527b2,_0x44bedf){_0x44bedf=_0x44bedf||0x1f4;return function(_0x18c3b7){logger[_0x51b8('0x22')](_0x18c3b7['stack']);if(_0x18c3b7[_0x51b8('0x23')]){delete _0x18c3b7[_0x51b8('0x23')];}_0x3527b2[_0x51b8('0x17')](_0x44bedf)['send'](_0x18c3b7);};}exports[_0x51b8('0x24')]=function(_0x4b9699,_0xbbc4f6){var _0x4273b4={},_0x382323={},_0x2dd4ff={'count':0x0,'rows':[]};var _0x7db813=_[_0x51b8('0x25')](db[_0x51b8('0x26')][_0x51b8('0x27')],function(_0x6121f6){return{'name':_0x6121f6['fieldName'],'type':_0x6121f6[_0x51b8('0x28')][_0x51b8('0x29')]};});_0x382323['model']=_[_0x51b8('0x25')](_0x7db813,'name');_0x382323['query']=_[_0x51b8('0x2a')](_0x4b9699[_0x51b8('0x2b')]);_0x382323[_0x51b8('0x2c')]=_[_0x51b8('0x2d')](_0x382323[_0x51b8('0x2e')],_0x382323[_0x51b8('0x2b')]);_0x4273b4['attributes']=_[_0x51b8('0x2d')](_0x382323[_0x51b8('0x2e')],qs[_0x51b8('0x2f')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x2f')]));_0x4273b4[_0x51b8('0x30')]=_0x4273b4[_0x51b8('0x30')][_0x51b8('0x31')]?_0x4273b4[_0x51b8('0x30')]:_0x382323[_0x51b8('0x2e')];if(!_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x32')](_0x51b8('0x33'))){_0x4273b4['limit']=qs[_0x51b8('0x1b')](_0x4b9699['query']['limit']);_0x4273b4[_0x51b8('0x19')]=qs[_0x51b8('0x19')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x19')]);}_0x4273b4[_0x51b8('0x34')]=qs[_0x51b8('0x35')](_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x35')]);_0x4273b4[_0x51b8('0x36')]=qs[_0x51b8('0x2c')](_['pick'](_0x4b9699[_0x51b8('0x2b')],_0x382323['filters']),_0x7db813);if(_0x4b9699['query']['filter']){_0x4273b4['where']=_[_0x51b8('0x37')](_0x4273b4[_0x51b8('0x36')],{'$or':_[_0x51b8('0x25')](_0x7db813,function(_0x4b3fed){if(_0x4b3fed[_0x51b8('0x28')]!==_0x51b8('0x38')){var _0x5a3acf={};_0x5a3acf[_0x4b3fed[_0x51b8('0x23')]]={'$like':'%'+_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x39')]+'%'};return _0x5a3acf;}})});}_0x4273b4=_[_0x51b8('0x37')]({},_0x4273b4,_0x4b9699[_0x51b8('0x3a')]);var _0x56ea39={'where':_0x4273b4[_0x51b8('0x36')]};return db['ServicenowField'][_0x51b8('0x1a')](_0x56ea39)[_0x51b8('0x1f')](function(_0x379dab){_0x2dd4ff['count']=_0x379dab;if(_0x4b9699[_0x51b8('0x2b')][_0x51b8('0x3b')]){_0x4273b4[_0x51b8('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0x51b8('0x3d')](_0x4273b4);})[_0x51b8('0x1f')](function(_0x1ba3f2){_0x2dd4ff['rows']=_0x1ba3f2;return _0x2dd4ff;})[_0x51b8('0x1f')](respondWithFilteredResult(_0xbbc4f6,_0x4273b4))['catch'](handleError(_0xbbc4f6,null));};exports[_0x51b8('0x3e')]=function(_0x35744a,_0x3168cd){var _0x56b5dc={'raw':!![],'where':{'id':_0x35744a['params']['id']}},_0x295454={};_0x295454[_0x51b8('0x2e')]=_[_0x51b8('0x2a')](db[_0x51b8('0x26')]['rawAttributes']);_0x295454['query']=_[_0x51b8('0x2a')](_0x35744a[_0x51b8('0x2b')]);_0x295454[_0x51b8('0x2c')]=_[_0x51b8('0x2d')](_0x295454[_0x51b8('0x2e')],_0x295454['query']);_0x56b5dc[_0x51b8('0x30')]=_[_0x51b8('0x2d')](_0x295454[_0x51b8('0x2e')],qs[_0x51b8('0x2f')](_0x35744a[_0x51b8('0x2b')][_0x51b8('0x2f')]));_0x56b5dc['attributes']=_0x56b5dc[_0x51b8('0x30')][_0x51b8('0x31')]?_0x56b5dc['attributes']:_0x295454['model'];if(_0x35744a[_0x51b8('0x2b')][_0x51b8('0x3b')]){_0x56b5dc[_0x51b8('0x3c')]=[{'all':!![]}];}_0x56b5dc=_[_0x51b8('0x37')]({},_0x56b5dc,_0x35744a[_0x51b8('0x3a')]);return db[_0x51b8('0x26')][_0x51b8('0x3f')](_0x56b5dc)[_0x51b8('0x1f')](handleEntityNotFound(_0x3168cd,null))[_0x51b8('0x1f')](respondWithResult(_0x3168cd,null))['catch'](handleError(_0x3168cd,null));};exports['create']=function(_0x354372,_0x4e1de3){return db[_0x51b8('0x26')][_0x51b8('0x40')](_0x354372[_0x51b8('0x41')],{})[_0x51b8('0x1f')](respondWithResult(_0x4e1de3,0xc9))[_0x51b8('0x42')](handleError(_0x4e1de3,null));};exports[_0x51b8('0x43')]=function(_0x15201c,_0x29be49){if(_0x15201c[_0x51b8('0x41')]['id']){delete _0x15201c[_0x51b8('0x41')]['id'];}return db[_0x51b8('0x26')][_0x51b8('0x3f')]({'where':{'id':_0x15201c[_0x51b8('0x44')]['id']}})[_0x51b8('0x1f')](handleEntityNotFound(_0x29be49,null))['then'](saveUpdates(_0x15201c[_0x51b8('0x41')],null))[_0x51b8('0x1f')](respondWithResult(_0x29be49,null))[_0x51b8('0x42')](handleError(_0x29be49,null));};exports[_0x51b8('0x20')]=function(_0x582735,_0x210a11){return db[_0x51b8('0x26')]['find']({'where':{'id':_0x582735[_0x51b8('0x44')]['id']}})[_0x51b8('0x1f')](handleEntityNotFound(_0x210a11,null))['then'](removeEntity(_0x210a11,null))[_0x51b8('0x42')](handleError(_0x210a11,null));}; \ No newline at end of file +var _0x5f8d=['limit','count','set','update','then','end','sendStatus','error','stack','name','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','undefined'];(function(_0x2187ac,_0x4364c2){var _0x31cfec=function(_0x3206c9){while(--_0x3206c9){_0x2187ac['push'](_0x2187ac['shift']());}};_0x31cfec(++_0x4364c2);}(_0x5f8d,0x70));var _0xd5f8=function(_0x5744db,_0x28bb93){_0x5744db=_0x5744db-0x0;var _0x32d3af=_0x5f8d[_0x5744db];return _0x32d3af;};'use strict';var emlformat=require(_0xd5f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5f8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd5f8('0x3'));var util=require(_0xd5f8('0x4'));var path=require(_0xd5f8('0x5'));var sox=require(_0xd5f8('0x6'));var csv=require(_0xd5f8('0x7'));var ejs=require(_0xd5f8('0x8'));var fs=require('fs');var fs_extra=require(_0xd5f8('0x9'));var _=require(_0xd5f8('0xa'));var squel=require(_0xd5f8('0xb'));var crypto=require('crypto');var jsforce=require(_0xd5f8('0xc'));var deskjs=require(_0xd5f8('0xd'));var toCsv=require(_0xd5f8('0x7'));var querystring=require(_0xd5f8('0xe'));var Papa=require('papaparse');var Redis=require(_0xd5f8('0xf'));var authService=require(_0xd5f8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd5f8('0x11'));var hardwareService=require(_0xd5f8('0x12'));var logger=require(_0xd5f8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd5f8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5f8('0x15'))['db'];function respondWithStatusCode(_0x15fb34,_0x2239d4){_0x2239d4=_0x2239d4||0xcc;return function(_0x720cdd){if(_0x720cdd){return _0x15fb34['sendStatus'](_0x2239d4);}return _0x15fb34[_0xd5f8('0x16')](_0x2239d4)['end']();};}function respondWithResult(_0x472d18,_0x53ed3c){_0x53ed3c=_0x53ed3c||0xc8;return function(_0x17b958){if(_0x17b958){return _0x472d18[_0xd5f8('0x16')](_0x53ed3c)[_0xd5f8('0x17')](_0x17b958);}};}function respondWithFilteredResult(_0x238e69,_0x223bda){return function(_0x49be2a){if(_0x49be2a){var _0x6e8fd6=typeof _0x223bda[_0xd5f8('0x18')]===_0xd5f8('0x19')&&typeof _0x223bda[_0xd5f8('0x1a')]==='undefined';var _0x5e1529=_0x49be2a[_0xd5f8('0x1b')];var _0x48af0f=_0x6e8fd6?0x0:_0x223bda['offset'];var _0x2d8ae0=_0x6e8fd6?_0x49be2a[_0xd5f8('0x1b')]:_0x223bda[_0xd5f8('0x18')]+_0x223bda[_0xd5f8('0x1a')];var _0x5ed020;if(_0x2d8ae0>=_0x5e1529){_0x2d8ae0=_0x5e1529;_0x5ed020=0xc8;}else{_0x5ed020=0xce;}_0x238e69[_0xd5f8('0x16')](_0x5ed020);return _0x238e69[_0xd5f8('0x1c')]('Content-Range',_0x48af0f+'-'+_0x2d8ae0+'/'+_0x5e1529)[_0xd5f8('0x17')](_0x49be2a);}return null;};}function patchUpdates(_0x3634f5){return function(_0x205103){try{jsonpatch['apply'](_0x205103,_0x3634f5,!![]);}catch(_0x42fc5e){return BPromise['reject'](_0x42fc5e);}return _0x205103['save']();};}function saveUpdates(_0xc666de,_0x381b3e){return function(_0x4a89f4){if(_0x4a89f4){return _0x4a89f4[_0xd5f8('0x1d')](_0xc666de)['then'](function(_0x5407fc){return _0x5407fc;});}return null;};}function removeEntity(_0x16f49b,_0x247658){return function(_0x140af3){if(_0x140af3){return _0x140af3['destroy']()[_0xd5f8('0x1e')](function(){_0x16f49b[_0xd5f8('0x16')](0xcc)[_0xd5f8('0x1f')]();});}};}function handleEntityNotFound(_0x5e4774,_0x33479d){return function(_0x1760aa){if(!_0x1760aa){_0x5e4774[_0xd5f8('0x20')](0x194);}return _0x1760aa;};}function handleError(_0x14aacb,_0x304f4c){_0x304f4c=_0x304f4c||0x1f4;return function(_0x5f3360){logger[_0xd5f8('0x21')](_0x5f3360[_0xd5f8('0x22')]);if(_0x5f3360[_0xd5f8('0x23')]){delete _0x5f3360[_0xd5f8('0x23')];}_0x14aacb[_0xd5f8('0x16')](_0x304f4c)['send'](_0x5f3360);};}exports['index']=function(_0x36f5dd,_0x2cf3d8){var _0x2a10b5={},_0x43441d={},_0x3c6570={'count':0x0,'rows':[]};var _0x551716=_['map'](db[_0xd5f8('0x24')][_0xd5f8('0x25')],function(_0x1da85c){return{'name':_0x1da85c[_0xd5f8('0x26')],'type':_0x1da85c[_0xd5f8('0x27')][_0xd5f8('0x28')]};});_0x43441d[_0xd5f8('0x29')]=_['map'](_0x551716,_0xd5f8('0x23'));_0x43441d[_0xd5f8('0x2a')]=_[_0xd5f8('0x2b')](_0x36f5dd['query']);_0x43441d[_0xd5f8('0x2c')]=_[_0xd5f8('0x2d')](_0x43441d[_0xd5f8('0x29')],_0x43441d[_0xd5f8('0x2a')]);_0x2a10b5[_0xd5f8('0x2e')]=_[_0xd5f8('0x2d')](_0x43441d['model'],qs[_0xd5f8('0x2f')](_0x36f5dd[_0xd5f8('0x2a')]['fields']));_0x2a10b5[_0xd5f8('0x2e')]=_0x2a10b5[_0xd5f8('0x2e')][_0xd5f8('0x30')]?_0x2a10b5['attributes']:_0x43441d['model'];if(!_0x36f5dd[_0xd5f8('0x2a')][_0xd5f8('0x31')](_0xd5f8('0x32'))){_0x2a10b5['limit']=qs['limit'](_0x36f5dd[_0xd5f8('0x2a')][_0xd5f8('0x1a')]);_0x2a10b5[_0xd5f8('0x18')]=qs['offset'](_0x36f5dd[_0xd5f8('0x2a')]['offset']);}_0x2a10b5[_0xd5f8('0x33')]=qs[_0xd5f8('0x34')](_0x36f5dd[_0xd5f8('0x2a')]['sort']);_0x2a10b5[_0xd5f8('0x35')]=qs[_0xd5f8('0x2c')](_[_0xd5f8('0x36')](_0x36f5dd[_0xd5f8('0x2a')],_0x43441d[_0xd5f8('0x2c')]),_0x551716);if(_0x36f5dd[_0xd5f8('0x2a')][_0xd5f8('0x37')]){_0x2a10b5['where']=_['merge'](_0x2a10b5[_0xd5f8('0x35')],{'$or':_['map'](_0x551716,function(_0xcbccb9){if(_0xcbccb9['type']!==_0xd5f8('0x38')){var _0x279251={};_0x279251[_0xcbccb9['name']]={'$like':'%'+_0x36f5dd[_0xd5f8('0x2a')][_0xd5f8('0x37')]+'%'};return _0x279251;}})});}_0x2a10b5=_[_0xd5f8('0x39')]({},_0x2a10b5,_0x36f5dd[_0xd5f8('0x3a')]);var _0x151fdf={'where':_0x2a10b5['where']};return db[_0xd5f8('0x24')][_0xd5f8('0x1b')](_0x151fdf)[_0xd5f8('0x1e')](function(_0x10e810){_0x3c6570[_0xd5f8('0x1b')]=_0x10e810;if(_0x36f5dd[_0xd5f8('0x2a')][_0xd5f8('0x3b')]){_0x2a10b5[_0xd5f8('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0xd5f8('0x3d')](_0x2a10b5);})[_0xd5f8('0x1e')](function(_0x18e64c){_0x3c6570['rows']=_0x18e64c;return _0x3c6570;})[_0xd5f8('0x1e')](respondWithFilteredResult(_0x2cf3d8,_0x2a10b5))[_0xd5f8('0x3e')](handleError(_0x2cf3d8,null));};exports[_0xd5f8('0x3f')]=function(_0x2d58ed,_0x5cf454){var _0x340ba9={'raw':!![],'where':{'id':_0x2d58ed[_0xd5f8('0x40')]['id']}},_0x2869b0={};_0x2869b0[_0xd5f8('0x29')]=_[_0xd5f8('0x2b')](db[_0xd5f8('0x24')][_0xd5f8('0x25')]);_0x2869b0[_0xd5f8('0x2a')]=_[_0xd5f8('0x2b')](_0x2d58ed[_0xd5f8('0x2a')]);_0x2869b0['filters']=_['intersection'](_0x2869b0[_0xd5f8('0x29')],_0x2869b0['query']);_0x340ba9[_0xd5f8('0x2e')]=_[_0xd5f8('0x2d')](_0x2869b0[_0xd5f8('0x29')],qs[_0xd5f8('0x2f')](_0x2d58ed['query'][_0xd5f8('0x2f')]));_0x340ba9['attributes']=_0x340ba9[_0xd5f8('0x2e')][_0xd5f8('0x30')]?_0x340ba9[_0xd5f8('0x2e')]:_0x2869b0[_0xd5f8('0x29')];if(_0x2d58ed[_0xd5f8('0x2a')][_0xd5f8('0x3b')]){_0x340ba9[_0xd5f8('0x3c')]=[{'all':!![]}];}_0x340ba9=_[_0xd5f8('0x39')]({},_0x340ba9,_0x2d58ed[_0xd5f8('0x3a')]);return db[_0xd5f8('0x24')]['find'](_0x340ba9)['then'](handleEntityNotFound(_0x5cf454,null))[_0xd5f8('0x1e')](respondWithResult(_0x5cf454,null))[_0xd5f8('0x3e')](handleError(_0x5cf454,null));};exports[_0xd5f8('0x41')]=function(_0x287eaf,_0x1d0748){return db[_0xd5f8('0x24')][_0xd5f8('0x41')](_0x287eaf[_0xd5f8('0x42')],{})[_0xd5f8('0x1e')](respondWithResult(_0x1d0748,0xc9))[_0xd5f8('0x3e')](handleError(_0x1d0748,null));};exports[_0xd5f8('0x1d')]=function(_0x5b5da4,_0x5c9115){if(_0x5b5da4[_0xd5f8('0x42')]['id']){delete _0x5b5da4['body']['id'];}return db[_0xd5f8('0x24')][_0xd5f8('0x43')]({'where':{'id':_0x5b5da4[_0xd5f8('0x40')]['id']}})[_0xd5f8('0x1e')](handleEntityNotFound(_0x5c9115,null))['then'](saveUpdates(_0x5b5da4[_0xd5f8('0x42')],null))[_0xd5f8('0x1e')](respondWithResult(_0x5c9115,null))[_0xd5f8('0x3e')](handleError(_0x5c9115,null));};exports[_0xd5f8('0x44')]=function(_0x4c4c6e,_0x3e5833){return db[_0xd5f8('0x24')][_0xd5f8('0x43')]({'where':{'id':_0x4c4c6e[_0xd5f8('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e5833,null))['then'](removeEntity(_0x3e5833,null))['catch'](handleError(_0x3e5833,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ce842ed..96db73d 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 _0xc892=['FieldId','lodash','../../config/logger','api','moment','bluebird','./intServicenowField.attributes','ServicenowField','servicenow_unique_index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc892,0xd0));var _0x2c89=function(_0x4ec352,_0x1300ba){_0x4ec352=_0x4ec352-0x0;var _0x1a7f42=_0xc892[_0x4ec352];return _0x1a7f42;};'use strict';var _=require(_0x2c89('0x0'));var util=require('util');var logger=require(_0x2c89('0x1'))(_0x2c89('0x2'));var moment=require(_0x2c89('0x3'));var BPromise=require(_0x2c89('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(_0x2c89('0x5'));module['exports']=function(_0xbee858,_0x11977d){return _0xbee858['define'](_0x2c89('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2c89('0x7'),'fields':['idField',_0x2c89('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5332=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField','lodash'];(function(_0x256c77,_0x1a65df){var _0x1eb89f=function(_0x1efb98){while(--_0x1efb98){_0x256c77['push'](_0x256c77['shift']());}};_0x1eb89f(++_0x1a65df);}(_0x5332,0x1df));var _0x2533=function(_0x1f743f,_0x1710a){_0x1f743f=_0x1f743f-0x0;var _0x4c48a9=_0x5332[_0x1f743f];return _0x4c48a9;};'use strict';var _=require(_0x2533('0x0'));var util=require(_0x2533('0x1'));var logger=require(_0x2533('0x2'))(_0x2533('0x3'));var moment=require('moment');var BPromise=require(_0x2533('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2533('0x5'));var config=require(_0x2533('0x6'));var attributes=require(_0x2533('0x7'));module[_0x2533('0x8')]=function(_0x551235,_0x1ff4fe){return _0x551235[_0x2533('0x9')]('ServicenowField',attributes,{'tableName':_0x2533('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x2533('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 0a5fb58..f9fe875 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3feccc,_0x5534c7){var _0x2c13b5=function(_0x59a2cd){while(--_0x59a2cd){_0x3feccc['push'](_0x3feccc['shift']());}};_0x2c13b5(++_0x5534c7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3968a1,_0x51e12a){_0x3968a1=_0x3968a1-0x0;var _0x513aad=_0xf4eb[_0x3968a1];return _0x513aad;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x454abb,_0x46973c){var _0x177b21=function(_0x4374d1){while(--_0x4374d1){_0x454abb['push'](_0x454abb['shift']());}};_0x177b21(++_0x46973c);}(_0xaa88,0x137));var _0x8aa8=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xaa88[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7e55fff..79ba9f6 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(_0x27874c,_0x193d59){var _0x3af0b8=function(_0x32bfc2){while(--_0x32bfc2){_0x27874c['push'](_0x27874c['shift']());}};_0x3af0b8(++_0x193d59);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x48c07d,_0x1623e5){var _0x5d5bc0=function(_0x3dee8c){while(--_0x3dee8c){_0x48c07d['push'](_0x48c07d['shift']());}};_0x5d5bc0(++_0x1623e5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 0a1be10..0a700dc 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(_0xa0e18f,_0x37889e){var _0x331b49=function(_0x41e501){while(--_0x41e501){_0xa0e18f['push'](_0xa0e18f['shift']());}};_0x331b49(++_0x37889e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x21ce1b,_0x502204){var _0x411cb2=function(_0x3796ae){while(--_0x3796ae){_0x21ce1b['push'](_0x21ce1b['shift']());}};_0x411cb2(++_0x502204);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 ab3afc3..9cad585 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 _0xd192=['date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','substring','format','%s%s','/service/v4_1/rest.php','JSON','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','module_fields','remove','label','values','value','statusCode','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','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','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','error','stack','name','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','sort','pick','nolimit','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','description'];(function(_0x36a51b,_0x5c5362){var _0x528ba3=function(_0x38868d){while(--_0x38868d){_0x36a51b['push'](_0x36a51b['shift']());}};_0x528ba3(++_0x5c5362);}(_0xd192,0x8d));var _0x2d19=function(_0x105e5f,_0xaa5f92){_0x105e5f=_0x105e5f-0x0;var _0x5b60c2=_0xd192[_0x105e5f];return _0x5b60c2;};'use strict';var emlformat=require(_0x2d19('0x0'));var rimraf=require(_0x2d19('0x1'));var zipdir=require(_0x2d19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d19('0x3'));var BPromise=require(_0x2d19('0x4'));var Mustache=require('mustache');var util=require(_0x2d19('0x5'));var path=require(_0x2d19('0x6'));var sox=require(_0x2d19('0x7'));var csv=require(_0x2d19('0x8'));var ejs=require(_0x2d19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d19('0xa'));var squel=require(_0x2d19('0xb'));var crypto=require(_0x2d19('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2d19('0xd'));var toCsv=require(_0x2d19('0x8'));var querystring=require(_0x2d19('0xe'));var Papa=require(_0x2d19('0xf'));var Redis=require(_0x2d19('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2d19('0x11'));var as=require(_0x2d19('0x12'));var hardwareService=require(_0x2d19('0x13'));var logger=require(_0x2d19('0x14'))(_0x2d19('0x15'));var utils=require(_0x2d19('0x16'));var config=require(_0x2d19('0x17'));var licenseUtil=require(_0x2d19('0x18'));var db=require(_0x2d19('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xcb742,_0x46a1d3){_0x46a1d3=_0x46a1d3||0xcc;return function(_0x23196b){if(_0x23196b){return _0xcb742[_0x2d19('0x1a')](_0x46a1d3);}return _0xcb742['status'](_0x46a1d3)[_0x2d19('0x1b')]();};}function respondWithResult(_0x29f78f,_0x2a8053){_0x2a8053=_0x2a8053||0xc8;return function(_0x50dd05){if(_0x50dd05){return _0x29f78f[_0x2d19('0x1c')](_0x2a8053)['json'](_0x50dd05);}};}function respondWithFilteredResult(_0x36d8bf,_0x4d6a4f){return function(_0x25ab60){if(_0x25ab60){var _0xae40c0=typeof _0x4d6a4f[_0x2d19('0x1d')]===_0x2d19('0x1e')&&typeof _0x4d6a4f[_0x2d19('0x1f')]===_0x2d19('0x1e');var _0x32aac8=_0x25ab60[_0x2d19('0x20')];var _0x1b2865=_0xae40c0?0x0:_0x4d6a4f['offset'];var _0x4f9186=_0xae40c0?_0x25ab60[_0x2d19('0x20')]:_0x4d6a4f[_0x2d19('0x1d')]+_0x4d6a4f['limit'];var _0x3a9a95;if(_0x4f9186>=_0x32aac8){_0x4f9186=_0x32aac8;_0x3a9a95=0xc8;}else{_0x3a9a95=0xce;}_0x36d8bf[_0x2d19('0x1c')](_0x3a9a95);return _0x36d8bf['set'](_0x2d19('0x21'),_0x1b2865+'-'+_0x4f9186+'/'+_0x32aac8)[_0x2d19('0x22')](_0x25ab60);}return null;};}function patchUpdates(_0x3e5f6e){return function(_0x1cd264){try{jsonpatch[_0x2d19('0x23')](_0x1cd264,_0x3e5f6e,!![]);}catch(_0x1e1154){return BPromise[_0x2d19('0x24')](_0x1e1154);}return _0x1cd264['save']();};}function saveUpdates(_0x26c2ee,_0x38885b){return function(_0x324957){if(_0x324957){return _0x324957['update'](_0x26c2ee)[_0x2d19('0x25')](function(_0x4756d8){return _0x4756d8;});}return null;};}function removeEntity(_0x2e9e08,_0x344f31){return function(_0x1a0c79){if(_0x1a0c79){return _0x1a0c79[_0x2d19('0x26')]()[_0x2d19('0x25')](function(){_0x2e9e08[_0x2d19('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a9551,_0x2d1c00){return function(_0x369e0c){if(!_0x369e0c){_0x2a9551[_0x2d19('0x1a')](0x194);}return _0x369e0c;};}function handleError(_0x2ae3ca,_0x59de91){_0x59de91=_0x59de91||0x1f4;return function(_0x4e090e){logger[_0x2d19('0x27')](_0x4e090e[_0x2d19('0x28')]);if(_0x4e090e[_0x2d19('0x29')]){delete _0x4e090e[_0x2d19('0x29')];}_0x2ae3ca[_0x2d19('0x1c')](_0x59de91)['send'](_0x4e090e);};}exports['index']=function(_0x3b8467,_0xfcafec){var _0x3cd93c={},_0x576559={},_0x46a919={'count':0x0,'rows':[]};var _0x189f38=_[_0x2d19('0x2a')](db[_0x2d19('0x2b')][_0x2d19('0x2c')],function(_0x556fa3){return{'name':_0x556fa3[_0x2d19('0x2d')],'type':_0x556fa3[_0x2d19('0x2e')][_0x2d19('0x2f')]};});_0x576559[_0x2d19('0x30')]=_['map'](_0x189f38,_0x2d19('0x29'));_0x576559['query']=_['keys'](_0x3b8467[_0x2d19('0x31')]);_0x576559[_0x2d19('0x32')]=_['intersection'](_0x576559['model'],_0x576559[_0x2d19('0x31')]);_0x3cd93c[_0x2d19('0x33')]=_[_0x2d19('0x34')](_0x576559[_0x2d19('0x30')],qs[_0x2d19('0x35')](_0x3b8467[_0x2d19('0x31')][_0x2d19('0x35')]));_0x3cd93c[_0x2d19('0x33')]=_0x3cd93c[_0x2d19('0x33')][_0x2d19('0x36')]?_0x3cd93c[_0x2d19('0x33')]:_0x576559[_0x2d19('0x30')];if(!_0x3b8467[_0x2d19('0x31')][_0x2d19('0x37')]('nolimit')){_0x3cd93c[_0x2d19('0x1f')]=qs['limit'](_0x3b8467[_0x2d19('0x31')][_0x2d19('0x1f')]);_0x3cd93c[_0x2d19('0x1d')]=qs[_0x2d19('0x1d')](_0x3b8467['query'][_0x2d19('0x1d')]);}_0x3cd93c[_0x2d19('0x38')]=qs['sort'](_0x3b8467[_0x2d19('0x31')]['sort']);_0x3cd93c[_0x2d19('0x39')]=qs[_0x2d19('0x32')](_['pick'](_0x3b8467[_0x2d19('0x31')],_0x576559[_0x2d19('0x32')]),_0x189f38);if(_0x3b8467[_0x2d19('0x31')][_0x2d19('0x3a')]){_0x3cd93c[_0x2d19('0x39')]=_['merge'](_0x3cd93c[_0x2d19('0x39')],{'$or':_[_0x2d19('0x2a')](_0x189f38,function(_0x5d7f58){if(_0x5d7f58[_0x2d19('0x2e')]!==_0x2d19('0x3b')){var _0x271aeb={};_0x271aeb[_0x5d7f58[_0x2d19('0x29')]]={'$like':'%'+_0x3b8467[_0x2d19('0x31')]['filter']+'%'};return _0x271aeb;}})});}_0x3cd93c=_[_0x2d19('0x3c')]({},_0x3cd93c,_0x3b8467[_0x2d19('0x3d')]);var _0x5759e5={'where':_0x3cd93c[_0x2d19('0x39')]};return db[_0x2d19('0x2b')][_0x2d19('0x20')](_0x5759e5)[_0x2d19('0x25')](function(_0x5cf113){_0x46a919['count']=_0x5cf113;if(_0x3b8467[_0x2d19('0x31')]['includeAll']){_0x3cd93c[_0x2d19('0x3e')]=[{'all':!![]}];}return db[_0x2d19('0x2b')][_0x2d19('0x3f')](_0x3cd93c);})[_0x2d19('0x25')](function(_0x5012e0){_0x46a919['rows']=_0x5012e0;return _0x46a919;})[_0x2d19('0x25')](respondWithFilteredResult(_0xfcafec,_0x3cd93c))[_0x2d19('0x40')](handleError(_0xfcafec,null));};exports[_0x2d19('0x41')]=function(_0x47770b,_0x3e060e){var _0x35c9e8={'raw':![],'where':{'id':_0x47770b[_0x2d19('0x42')]['id']}},_0x100dfd={};_0x100dfd[_0x2d19('0x30')]=_[_0x2d19('0x43')](db[_0x2d19('0x2b')][_0x2d19('0x2c')]);_0x100dfd['query']=_['keys'](_0x47770b[_0x2d19('0x31')]);_0x100dfd['filters']=_[_0x2d19('0x34')](_0x100dfd[_0x2d19('0x30')],_0x100dfd[_0x2d19('0x31')]);_0x35c9e8['attributes']=_[_0x2d19('0x34')](_0x100dfd['model'],qs[_0x2d19('0x35')](_0x47770b[_0x2d19('0x31')][_0x2d19('0x35')]));_0x35c9e8[_0x2d19('0x33')]=_0x35c9e8[_0x2d19('0x33')][_0x2d19('0x36')]?_0x35c9e8[_0x2d19('0x33')]:_0x100dfd[_0x2d19('0x30')];if(_0x47770b['query']['includeAll']){_0x35c9e8[_0x2d19('0x3e')]=[{'all':!![]}];}_0x35c9e8=_[_0x2d19('0x3c')]({},_0x35c9e8,_0x47770b[_0x2d19('0x3d')]);return db[_0x2d19('0x2b')][_0x2d19('0x44')](_0x35c9e8)['then'](handleEntityNotFound(_0x3e060e,null))[_0x2d19('0x25')](respondWithResult(_0x3e060e,null))[_0x2d19('0x40')](handleError(_0x3e060e,null));};exports[_0x2d19('0x45')]=function(_0xade053,_0x373269){return db['SugarcrmAccount']['create'](_0xade053[_0x2d19('0x46')],{})[_0x2d19('0x25')](respondWithResult(_0x373269,0xc9))[_0x2d19('0x40')](handleError(_0x373269,null));};exports['update']=function(_0x5bc8f9,_0x439cf9){if(_0x5bc8f9[_0x2d19('0x46')]['id']){delete _0x5bc8f9[_0x2d19('0x46')]['id'];}return db[_0x2d19('0x2b')][_0x2d19('0x44')]({'where':{'id':_0x5bc8f9[_0x2d19('0x42')]['id']}})['then'](handleEntityNotFound(_0x439cf9,null))[_0x2d19('0x25')](saveUpdates(_0x5bc8f9[_0x2d19('0x46')],null))[_0x2d19('0x25')](respondWithResult(_0x439cf9,null))['catch'](handleError(_0x439cf9,null));};exports[_0x2d19('0x26')]=function(_0x22fa63,_0x457b3a){return db[_0x2d19('0x2b')][_0x2d19('0x44')]({'where':{'id':_0x22fa63[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0x457b3a,null))[_0x2d19('0x25')](removeEntity(_0x457b3a,null))[_0x2d19('0x40')](handleError(_0x457b3a,null));};exports[_0x2d19('0x47')]=function(_0x3f3d66,_0xedf666,_0x371207){var _0xd4cc92={};var _0x4cd38d={};var _0x40e7b5;var _0xbea0b8;return db[_0x2d19('0x2b')]['findOne']({'where':{'id':_0x3f3d66[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0xedf666,null))['then'](function(_0x39578a){if(_0x39578a){_0x40e7b5=_0x39578a;_0x4cd38d[_0x2d19('0x30')]=_[_0x2d19('0x43')](db['SugarcrmConfiguration'][_0x2d19('0x2c')]);_0x4cd38d[_0x2d19('0x31')]=_[_0x2d19('0x43')](_0x3f3d66['query']);_0x4cd38d[_0x2d19('0x32')]=_[_0x2d19('0x34')](_0x4cd38d[_0x2d19('0x30')],_0x4cd38d[_0x2d19('0x31')]);_0xd4cc92['attributes']=_[_0x2d19('0x34')](_0x4cd38d[_0x2d19('0x30')],qs[_0x2d19('0x35')](_0x3f3d66['query']['fields']));_0xd4cc92[_0x2d19('0x33')]=_0xd4cc92[_0x2d19('0x33')][_0x2d19('0x36')]?_0xd4cc92['attributes']:_0x4cd38d[_0x2d19('0x30')];_0xd4cc92[_0x2d19('0x38')]=qs[_0x2d19('0x48')](_0x3f3d66['query'][_0x2d19('0x48')]);_0xd4cc92[_0x2d19('0x39')]=qs[_0x2d19('0x32')](_[_0x2d19('0x49')](_0x3f3d66[_0x2d19('0x31')],_0x4cd38d[_0x2d19('0x32')]));if(_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x3a')]){_0xd4cc92[_0x2d19('0x39')]=_[_0x2d19('0x3c')](_0xd4cc92['where'],{'$or':_[_0x2d19('0x2a')](_0xd4cc92['attributes'],function(_0xdf6f3d){var _0x3384f1={};_0x3384f1[_0xdf6f3d]={'$like':'%'+_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x3a')]+'%'};return _0x3384f1;})});}_0xd4cc92=_[_0x2d19('0x3c')]({},_0xd4cc92,_0x3f3d66['options']);return _0x40e7b5[_0x2d19('0x47')](_0xd4cc92);}})[_0x2d19('0x25')](function(_0x5b32fe){if(_0x5b32fe){_0xbea0b8=_0x5b32fe[_0x2d19('0x36')];if(!_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x37')](_0x2d19('0x4a'))){_0xd4cc92[_0x2d19('0x1f')]=qs[_0x2d19('0x1f')](_0x3f3d66['query']['limit']);_0xd4cc92[_0x2d19('0x1d')]=qs[_0x2d19('0x1d')](_0x3f3d66[_0x2d19('0x31')][_0x2d19('0x1d')]);}return _0x40e7b5[_0x2d19('0x47')](_0xd4cc92);}})['then'](function(_0x4b49ae){if(_0x4b49ae){return _0x4b49ae?{'count':_0xbea0b8,'rows':_0x4b49ae}:null;}})[_0x2d19('0x25')](respondWithResult(_0xedf666,null))[_0x2d19('0x40')](handleError(_0xedf666,null));};exports[_0x2d19('0x4b')]=function(_0xbb056,_0x11fef8,_0x67cf3e){if(_0xbb056[_0x2d19('0x46')]['id']){delete _0xbb056['body']['id'];}return db['SugarcrmAccount'][_0x2d19('0x4c')]({'where':{'id':_0xbb056[_0x2d19('0x42')]['id']}})[_0x2d19('0x25')](handleEntityNotFound(_0x11fef8,null))[_0x2d19('0x25')](function(_0x303d4e){if(_0x303d4e){_0xbb056[_0x2d19('0x46')]['AccountId']=_0x303d4e['id'];_0xbb056[_0x2d19('0x46')]['Subjects']=integrations[_0x2d19('0x4d')](_0xbb056['body'][_0x2d19('0x4e')],_0xbb056[_0x2d19('0x46')][_0x2d19('0x2e')]);_0xbb056[_0x2d19('0x46')][_0x2d19('0x4f')]=integrations[_0x2d19('0x50')](_0xbb056[_0x2d19('0x46')][_0x2d19('0x4e')],_0xbb056[_0x2d19('0x46')][_0x2d19('0x2e')]);return db[_0x2d19('0x51')][_0x2d19('0x45')](_0xbb056[_0x2d19('0x46')],{'include':[{'model':db[_0x2d19('0x52')],'as':'Subjects'},{'model':db[_0x2d19('0x52')],'as':'Descriptions'}]});}return null;})[_0x2d19('0x25')](respondWithResult(_0x11fef8,null))['catch'](handleError(_0x11fef8,null));};exports[_0x2d19('0x53')]=function(_0x10becd,_0x4d17af,_0x119567){var _0x45ba43='';var _0x535925=['id','name','assigned_user_id','created_by',_0x2d19('0x54'),_0x2d19('0x55'),_0x2d19('0x56'),_0x2d19('0x57'),_0x2d19('0x58'),_0x2d19('0x59'),_0x2d19('0x5a'),'direction'];return db[_0x2d19('0x2b')][_0x2d19('0x4c')]({'where':{'id':_0x10becd[_0x2d19('0x42')]['id']},'attributes':['id',_0x2d19('0x5b'),_0x2d19('0x5c'),'remoteUri']})['then'](handleEntityNotFound(_0x4d17af,null))['then'](function(_0x5b3a29){if(_0x5b3a29){_0x45ba43=_0x5b3a29[_0x2d19('0x5d')];var _0x3eff63=_0x45ba43['slice'](-0x1);if(_0x3eff63==='/'){_0x45ba43=_0x45ba43[_0x2d19('0x5e')](0x0,_0x45ba43['lastIndexOf'](_0x3eff63));}return rp({'method':'POST','uri':util[_0x2d19('0x5f')](_0x2d19('0x60'),_0x45ba43,_0x2d19('0x61')),'json':!![],'form':{'method':'login','input_type':_0x2d19('0x62'),'response_type':_0x2d19('0x62'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5b3a29[_0x2d19('0x5b')],'password':_0x5b3a29['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x6f0e11){if(_0x6f0e11&&_0x6f0e11[_0x2d19('0x29')]!==_0x2d19('0x63')&&_0x6f0e11['name']!==_0x2d19('0x64')){return rp({'method':'POST','uri':util[_0x2d19('0x5f')](_0x2d19('0x60'),_0x45ba43,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2d19('0x65'),'input_type':_0x2d19('0x62'),'response_type':_0x2d19('0x62'),'rest_data':JSON[_0x2d19('0x66')]({'session':_0x6f0e11['id'],'module_name':_0x2d19('0x67')})}})[_0x2d19('0x25')](function(_0x327364){if(_0x327364){var _0x3df06c=_['values'](_0x327364[_0x2d19('0x68')]);_[_0x2d19('0x69')](_0x3df06c,function(_0x569212){return _0x535925['includes'](_0x569212['name']);});return{'count':_0x3df06c[_0x2d19('0x36')],'rows':_[_0x2d19('0x2a')](_0x3df06c,function(_0x46d35a){return{'id':_0x46d35a[_0x2d19('0x29')],'name':_0x46d35a[_0x2d19('0x6a')],'custom':_['endsWith'](_0x46d35a[_0x2d19('0x29')],'_c')?!![]:![],'options':_0x46d35a[_0x2d19('0x3d')]?_[_0x2d19('0x2a')](_[_0x2d19('0x6b')](_0x46d35a['options']),function(_0x2260cf){return{'name':_0x2260cf[_0x2d19('0x6c')],'value':_0x2260cf[_0x2d19('0x29')]};}):[]};})};}})[_0x2d19('0x25')](respondWithResult(_0x4d17af,null))[_0x2d19('0x40')](function(_0x15789d){var _0x41827a=_0x10becd['query']['test']?0x1f4:_0x15789d[_0x2d19('0x6d')]||0x1f4;logger[_0x2d19('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x2d19('0x53'),_0x41827a,JSON[_0x2d19('0x66')](_0x15789d));delete _0x15789d[_0x2d19('0x29')];if(_0x41827a===0x191){_0x41827a=0x190;}_0x4d17af[_0x2d19('0x1c')](_0x41827a)[_0x2d19('0x6e')](_0x10becd['query'][_0x2d19('0x6f')]?{'message':_0x2d19('0x70'),'statusCode':_0x15789d[_0x2d19('0x6d')]}:_0x15789d);});}else{var _0x1dbd90=0x1f4;_0x4d17af['status'](_0x1dbd90)[_0x2d19('0x6e')]({'message':_0x2d19('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0d9f=['filter','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','keys','merge','create','update','body','find','destroy','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','slice','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','PLAIN','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','remove','includes','label','value','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0d9f,0x136));var _0xf0d9=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x0d9f[_0x1a809b];return _0x5d90e6;};'use strict';var emlformat=require(_0xf0d9('0x0'));var rimraf=require(_0xf0d9('0x1'));var zipdir=require(_0xf0d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0d9('0x3'));var moment=require(_0xf0d9('0x4'));var BPromise=require(_0xf0d9('0x5'));var Mustache=require(_0xf0d9('0x6'));var util=require(_0xf0d9('0x7'));var path=require(_0xf0d9('0x8'));var sox=require(_0xf0d9('0x9'));var csv=require(_0xf0d9('0xa'));var ejs=require(_0xf0d9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0d9('0xc'));var _=require(_0xf0d9('0xd'));var squel=require('squel');var crypto=require(_0xf0d9('0xe'));var jsforce=require(_0xf0d9('0xf'));var deskjs=require(_0xf0d9('0x10'));var toCsv=require(_0xf0d9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0d9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf0d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0d9('0x13'));var logger=require(_0xf0d9('0x14'))('api');var utils=require(_0xf0d9('0x15'));var config=require(_0xf0d9('0x16'));var licenseUtil=require(_0xf0d9('0x17'));var db=require(_0xf0d9('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x88e885,_0x176fc1){_0x176fc1=_0x176fc1||0xcc;return function(_0x1e26b7){if(_0x1e26b7){return _0x88e885[_0xf0d9('0x19')](_0x176fc1);}return _0x88e885[_0xf0d9('0x1a')](_0x176fc1)[_0xf0d9('0x1b')]();};}function respondWithResult(_0x542139,_0x4504cd){_0x4504cd=_0x4504cd||0xc8;return function(_0x1abca2){if(_0x1abca2){return _0x542139['status'](_0x4504cd)[_0xf0d9('0x1c')](_0x1abca2);}};}function respondWithFilteredResult(_0x16e284,_0x4a25f2){return function(_0x536ff2){if(_0x536ff2){var _0x2772a8=typeof _0x4a25f2[_0xf0d9('0x1d')]==='undefined'&&typeof _0x4a25f2[_0xf0d9('0x1e')]===_0xf0d9('0x1f');var _0x2afe3a=_0x536ff2['count'];var _0x11c804=_0x2772a8?0x0:_0x4a25f2['offset'];var _0x144b4f=_0x2772a8?_0x536ff2[_0xf0d9('0x20')]:_0x4a25f2['offset']+_0x4a25f2['limit'];var _0x252452;if(_0x144b4f>=_0x2afe3a){_0x144b4f=_0x2afe3a;_0x252452=0xc8;}else{_0x252452=0xce;}_0x16e284['status'](_0x252452);return _0x16e284[_0xf0d9('0x21')](_0xf0d9('0x22'),_0x11c804+'-'+_0x144b4f+'/'+_0x2afe3a)[_0xf0d9('0x1c')](_0x536ff2);}return null;};}function patchUpdates(_0x5777ef){return function(_0x308835){try{jsonpatch['apply'](_0x308835,_0x5777ef,!![]);}catch(_0x1a39ac){return BPromise[_0xf0d9('0x23')](_0x1a39ac);}return _0x308835[_0xf0d9('0x24')]();};}function saveUpdates(_0x3f3b89,_0x32eb32){return function(_0x233e39){if(_0x233e39){return _0x233e39['update'](_0x3f3b89)['then'](function(_0x4570bb){return _0x4570bb;});}return null;};}function removeEntity(_0x2c57dd,_0x4fc4f5){return function(_0x1f83d6){if(_0x1f83d6){return _0x1f83d6['destroy']()['then'](function(){_0x2c57dd[_0xf0d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x696799,_0x4fcc7d){return function(_0x46b467){if(!_0x46b467){_0x696799['sendStatus'](0x194);}return _0x46b467;};}function handleError(_0x19a084,_0x283f84){_0x283f84=_0x283f84||0x1f4;return function(_0x3b8805){logger[_0xf0d9('0x25')](_0x3b8805[_0xf0d9('0x26')]);if(_0x3b8805[_0xf0d9('0x27')]){delete _0x3b8805[_0xf0d9('0x27')];}_0x19a084[_0xf0d9('0x1a')](_0x283f84)[_0xf0d9('0x28')](_0x3b8805);};}exports[_0xf0d9('0x29')]=function(_0x22418b,_0x6ffeda){var _0x4fecc3={},_0x3d3534={},_0x4f3958={'count':0x0,'rows':[]};var _0x26ce66=_[_0xf0d9('0x2a')](db[_0xf0d9('0x2b')][_0xf0d9('0x2c')],function(_0x29a9bf){return{'name':_0x29a9bf[_0xf0d9('0x2d')],'type':_0x29a9bf['type'][_0xf0d9('0x2e')]};});_0x3d3534[_0xf0d9('0x2f')]=_[_0xf0d9('0x2a')](_0x26ce66,_0xf0d9('0x27'));_0x3d3534['query']=_['keys'](_0x22418b['query']);_0x3d3534[_0xf0d9('0x30')]=_[_0xf0d9('0x31')](_0x3d3534[_0xf0d9('0x2f')],_0x3d3534['query']);_0x4fecc3[_0xf0d9('0x32')]=_[_0xf0d9('0x31')](_0x3d3534[_0xf0d9('0x2f')],qs[_0xf0d9('0x33')](_0x22418b[_0xf0d9('0x34')][_0xf0d9('0x33')]));_0x4fecc3[_0xf0d9('0x32')]=_0x4fecc3[_0xf0d9('0x32')][_0xf0d9('0x35')]?_0x4fecc3[_0xf0d9('0x32')]:_0x3d3534[_0xf0d9('0x2f')];if(!_0x22418b['query'][_0xf0d9('0x36')](_0xf0d9('0x37'))){_0x4fecc3[_0xf0d9('0x1e')]=qs[_0xf0d9('0x1e')](_0x22418b[_0xf0d9('0x34')][_0xf0d9('0x1e')]);_0x4fecc3[_0xf0d9('0x1d')]=qs[_0xf0d9('0x1d')](_0x22418b['query'][_0xf0d9('0x1d')]);}_0x4fecc3['order']=qs['sort'](_0x22418b[_0xf0d9('0x34')][_0xf0d9('0x38')]);_0x4fecc3[_0xf0d9('0x39')]=qs[_0xf0d9('0x30')](_[_0xf0d9('0x3a')](_0x22418b[_0xf0d9('0x34')],_0x3d3534[_0xf0d9('0x30')]),_0x26ce66);if(_0x22418b['query'][_0xf0d9('0x3b')]){_0x4fecc3[_0xf0d9('0x39')]=_['merge'](_0x4fecc3[_0xf0d9('0x39')],{'$or':_[_0xf0d9('0x2a')](_0x26ce66,function(_0x3d3473){if(_0x3d3473['type']!==_0xf0d9('0x3c')){var _0xbc57c6={};_0xbc57c6[_0x3d3473[_0xf0d9('0x27')]]={'$like':'%'+_0x22418b[_0xf0d9('0x34')][_0xf0d9('0x3b')]+'%'};return _0xbc57c6;}})});}_0x4fecc3=_['merge']({},_0x4fecc3,_0x22418b[_0xf0d9('0x3d')]);var _0x2c373e={'where':_0x4fecc3[_0xf0d9('0x39')]};return db['SugarcrmAccount']['count'](_0x2c373e)[_0xf0d9('0x3e')](function(_0x5b43e1){_0x4f3958[_0xf0d9('0x20')]=_0x5b43e1;if(_0x22418b[_0xf0d9('0x34')][_0xf0d9('0x3f')]){_0x4fecc3[_0xf0d9('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf0d9('0x41')](_0x4fecc3);})[_0xf0d9('0x3e')](function(_0xec892){_0x4f3958[_0xf0d9('0x42')]=_0xec892;return _0x4f3958;})[_0xf0d9('0x3e')](respondWithFilteredResult(_0x6ffeda,_0x4fecc3))[_0xf0d9('0x43')](handleError(_0x6ffeda,null));};exports['show']=function(_0x349e19,_0x486862){var _0x16c63c={'raw':![],'where':{'id':_0x349e19[_0xf0d9('0x44')]['id']}},_0x3fe4cc={};_0x3fe4cc[_0xf0d9('0x2f')]=_['keys'](db['SugarcrmAccount'][_0xf0d9('0x2c')]);_0x3fe4cc[_0xf0d9('0x34')]=_[_0xf0d9('0x45')](_0x349e19[_0xf0d9('0x34')]);_0x3fe4cc[_0xf0d9('0x30')]=_['intersection'](_0x3fe4cc[_0xf0d9('0x2f')],_0x3fe4cc[_0xf0d9('0x34')]);_0x16c63c['attributes']=_['intersection'](_0x3fe4cc[_0xf0d9('0x2f')],qs[_0xf0d9('0x33')](_0x349e19[_0xf0d9('0x34')]['fields']));_0x16c63c[_0xf0d9('0x32')]=_0x16c63c[_0xf0d9('0x32')]['length']?_0x16c63c[_0xf0d9('0x32')]:_0x3fe4cc[_0xf0d9('0x2f')];if(_0x349e19[_0xf0d9('0x34')][_0xf0d9('0x3f')]){_0x16c63c[_0xf0d9('0x40')]=[{'all':!![]}];}_0x16c63c=_[_0xf0d9('0x46')]({},_0x16c63c,_0x349e19['options']);return db[_0xf0d9('0x2b')]['find'](_0x16c63c)['then'](handleEntityNotFound(_0x486862,null))[_0xf0d9('0x3e')](respondWithResult(_0x486862,null))[_0xf0d9('0x43')](handleError(_0x486862,null));};exports['create']=function(_0x6898e1,_0x36e6ef){return db[_0xf0d9('0x2b')][_0xf0d9('0x47')](_0x6898e1['body'],{})[_0xf0d9('0x3e')](respondWithResult(_0x36e6ef,0xc9))[_0xf0d9('0x43')](handleError(_0x36e6ef,null));};exports[_0xf0d9('0x48')]=function(_0x2abba3,_0x56061f){if(_0x2abba3[_0xf0d9('0x49')]['id']){delete _0x2abba3['body']['id'];}return db[_0xf0d9('0x2b')][_0xf0d9('0x4a')]({'where':{'id':_0x2abba3['params']['id']}})['then'](handleEntityNotFound(_0x56061f,null))[_0xf0d9('0x3e')](saveUpdates(_0x2abba3[_0xf0d9('0x49')],null))[_0xf0d9('0x3e')](respondWithResult(_0x56061f,null))[_0xf0d9('0x43')](handleError(_0x56061f,null));};exports[_0xf0d9('0x4b')]=function(_0x2a99d2,_0x3901eb){return db[_0xf0d9('0x2b')][_0xf0d9('0x4a')]({'where':{'id':_0x2a99d2[_0xf0d9('0x44')]['id']}})[_0xf0d9('0x3e')](handleEntityNotFound(_0x3901eb,null))[_0xf0d9('0x3e')](removeEntity(_0x3901eb,null))['catch'](handleError(_0x3901eb,null));};exports[_0xf0d9('0x4c')]=function(_0x23e9fd,_0x565ef8,_0x351567){var _0x22dd49={};var _0x3d0c92={};var _0x25bcf8;var _0x2bae39;return db[_0xf0d9('0x2b')][_0xf0d9('0x4d')]({'where':{'id':_0x23e9fd[_0xf0d9('0x44')]['id']}})[_0xf0d9('0x3e')](handleEntityNotFound(_0x565ef8,null))['then'](function(_0x9021e0){if(_0x9021e0){_0x25bcf8=_0x9021e0;_0x3d0c92[_0xf0d9('0x2f')]=_[_0xf0d9('0x45')](db['SugarcrmConfiguration'][_0xf0d9('0x2c')]);_0x3d0c92[_0xf0d9('0x34')]=_[_0xf0d9('0x45')](_0x23e9fd[_0xf0d9('0x34')]);_0x3d0c92[_0xf0d9('0x30')]=_[_0xf0d9('0x31')](_0x3d0c92[_0xf0d9('0x2f')],_0x3d0c92['query']);_0x22dd49['attributes']=_[_0xf0d9('0x31')](_0x3d0c92[_0xf0d9('0x2f')],qs[_0xf0d9('0x33')](_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x33')]));_0x22dd49[_0xf0d9('0x32')]=_0x22dd49[_0xf0d9('0x32')][_0xf0d9('0x35')]?_0x22dd49[_0xf0d9('0x32')]:_0x3d0c92['model'];_0x22dd49[_0xf0d9('0x4e')]=qs[_0xf0d9('0x38')](_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x38')]);_0x22dd49[_0xf0d9('0x39')]=qs['filters'](_[_0xf0d9('0x3a')](_0x23e9fd['query'],_0x3d0c92[_0xf0d9('0x30')]));if(_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x3b')]){_0x22dd49['where']=_[_0xf0d9('0x46')](_0x22dd49[_0xf0d9('0x39')],{'$or':_[_0xf0d9('0x2a')](_0x22dd49[_0xf0d9('0x32')],function(_0x3eee23){var _0x3572fd={};_0x3572fd[_0x3eee23]={'$like':'%'+_0x23e9fd[_0xf0d9('0x34')]['filter']+'%'};return _0x3572fd;})});}_0x22dd49=_[_0xf0d9('0x46')]({},_0x22dd49,_0x23e9fd[_0xf0d9('0x3d')]);return _0x25bcf8[_0xf0d9('0x4c')](_0x22dd49);}})[_0xf0d9('0x3e')](function(_0xa8110f){if(_0xa8110f){_0x2bae39=_0xa8110f[_0xf0d9('0x35')];if(!_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x36')]('nolimit')){_0x22dd49[_0xf0d9('0x1e')]=qs[_0xf0d9('0x1e')](_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x1e')]);_0x22dd49[_0xf0d9('0x1d')]=qs[_0xf0d9('0x1d')](_0x23e9fd[_0xf0d9('0x34')][_0xf0d9('0x1d')]);}return _0x25bcf8[_0xf0d9('0x4c')](_0x22dd49);}})[_0xf0d9('0x3e')](function(_0x5bcf07){if(_0x5bcf07){return _0x5bcf07?{'count':_0x2bae39,'rows':_0x5bcf07}:null;}})[_0xf0d9('0x3e')](respondWithResult(_0x565ef8,null))['catch'](handleError(_0x565ef8,null));};exports[_0xf0d9('0x4f')]=function(_0xbbeb87,_0x22ef9a,_0x1b6e92){if(_0xbbeb87['body']['id']){delete _0xbbeb87[_0xf0d9('0x49')]['id'];}return db[_0xf0d9('0x2b')][_0xf0d9('0x4d')]({'where':{'id':_0xbbeb87[_0xf0d9('0x44')]['id']}})[_0xf0d9('0x3e')](handleEntityNotFound(_0x22ef9a,null))['then'](function(_0xba19c9){if(_0xba19c9){_0xbbeb87[_0xf0d9('0x49')][_0xf0d9('0x50')]=_0xba19c9['id'];_0xbbeb87[_0xf0d9('0x49')][_0xf0d9('0x51')]=integrations[_0xf0d9('0x52')](_0xbbeb87['body']['channel'],_0xbbeb87[_0xf0d9('0x49')]['type']);_0xbbeb87['body'][_0xf0d9('0x53')]=integrations[_0xf0d9('0x54')](_0xbbeb87[_0xf0d9('0x49')][_0xf0d9('0x55')],_0xbbeb87[_0xf0d9('0x49')]['type']);return db[_0xf0d9('0x56')]['create'](_0xbbeb87[_0xf0d9('0x49')],{'include':[{'model':db[_0xf0d9('0x57')],'as':'Subjects'},{'model':db[_0xf0d9('0x57')],'as':'Descriptions'}]});}return null;})[_0xf0d9('0x3e')](respondWithResult(_0x22ef9a,null))[_0xf0d9('0x43')](handleError(_0x22ef9a,null));};exports[_0xf0d9('0x58')]=function(_0x7d0ea8,_0x3fbd63,_0x3c8186){var _0xec840e='';var _0x390278=['id','name',_0xf0d9('0x59'),_0xf0d9('0x5a'),_0xf0d9('0x5b'),_0xf0d9('0x5c'),_0xf0d9('0x5d'),_0xf0d9('0x5e'),_0xf0d9('0x5f'),_0xf0d9('0x60'),_0xf0d9('0x61'),_0xf0d9('0x62')];return db[_0xf0d9('0x2b')][_0xf0d9('0x4d')]({'where':{'id':_0x7d0ea8[_0xf0d9('0x44')]['id']},'attributes':['id','username','password',_0xf0d9('0x63')]})[_0xf0d9('0x3e')](handleEntityNotFound(_0x3fbd63,null))[_0xf0d9('0x3e')](function(_0x4d89b0){if(_0x4d89b0){_0xec840e=_0x4d89b0[_0xf0d9('0x63')];var _0x104baa=_0xec840e[_0xf0d9('0x64')](-0x1);if(_0x104baa==='/'){_0xec840e=_0xec840e['substring'](0x0,_0xec840e['lastIndexOf'](_0x104baa));}return rp({'method':_0xf0d9('0x65'),'uri':util[_0xf0d9('0x66')](_0xf0d9('0x67'),_0xec840e,_0xf0d9('0x68')),'json':!![],'form':{'method':_0xf0d9('0x69'),'input_type':_0xf0d9('0x6a'),'response_type':_0xf0d9('0x6a'),'rest_data':JSON[_0xf0d9('0x6b')]({'user_auth':{'user_name':_0x4d89b0[_0xf0d9('0x6c')],'password':_0x4d89b0[_0xf0d9('0x6d')],'encryption':_0xf0d9('0x6e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xf0d9('0x3e')](function(_0x1eff4a){if(_0x1eff4a&&_0x1eff4a[_0xf0d9('0x27')]!==_0xf0d9('0x6f')&&_0x1eff4a[_0xf0d9('0x27')]!==_0xf0d9('0x70')){return rp({'method':'POST','uri':util[_0xf0d9('0x66')]('%s%s',_0xec840e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xf0d9('0x6a'),'rest_data':JSON['stringify']({'session':_0x1eff4a['id'],'module_name':_0xf0d9('0x71')})}})[_0xf0d9('0x3e')](function(_0x30d22b){if(_0x30d22b){var _0x2d5829=_[_0xf0d9('0x72')](_0x30d22b[_0xf0d9('0x73')]);_[_0xf0d9('0x74')](_0x2d5829,function(_0x136e7b){return _0x390278[_0xf0d9('0x75')](_0x136e7b[_0xf0d9('0x27')]);});return{'count':_0x2d5829['length'],'rows':_[_0xf0d9('0x2a')](_0x2d5829,function(_0x2e4d75){return{'id':_0x2e4d75[_0xf0d9('0x27')],'name':_0x2e4d75[_0xf0d9('0x76')],'custom':_['endsWith'](_0x2e4d75['name'],'_c')?!![]:![],'options':_0x2e4d75['options']?_['map'](_['values'](_0x2e4d75['options']),function(_0x331419){return{'name':_0x331419[_0xf0d9('0x77')],'value':_0x331419[_0xf0d9('0x27')]};}):[]};})};}})['then'](respondWithResult(_0x3fbd63,null))['catch'](function(_0x42e3a3){var _0x1933e4=_0x7d0ea8[_0xf0d9('0x34')][_0xf0d9('0x78')]?0x1f4:_0x42e3a3[_0xf0d9('0x79')]||0x1f4;logger[_0xf0d9('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xf0d9('0x58'),_0x1933e4,JSON[_0xf0d9('0x6b')](_0x42e3a3));delete _0x42e3a3['name'];if(_0x1933e4===0x191){_0x1933e4=0x190;}_0x3fbd63[_0xf0d9('0x1a')](_0x1933e4)[_0xf0d9('0x28')](_0x7d0ea8[_0xf0d9('0x34')]['test']?{'message':_0xf0d9('0x7a'),'statusCode':_0x42e3a3[_0xf0d9('0x79')]}:_0x42e3a3);});}else{var _0x4337b8=0x1f4;_0x3fbd63[_0xf0d9('0x1a')](_0x4337b8)[_0xf0d9('0x28')]({'message':_0xf0d9('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 81a46b1..23ad153 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 _0xe426=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','../../config/logger','api','moment'];(function(_0x3dc534,_0xfd7d8a){var _0x1fde67=function(_0x1fe78b){while(--_0x1fe78b){_0x3dc534['push'](_0x3dc534['shift']());}};_0x1fde67(++_0xfd7d8a);}(_0xe426,0xf8));var _0x6e42=function(_0x2b79a8,_0xade1e4){_0x2b79a8=_0x2b79a8-0x0;var _0x1ad925=_0xe426[_0x2b79a8];return _0x1ad925;};'use strict';var _=require(_0x6e42('0x0'));var util=require('util');var logger=require(_0x6e42('0x1'))(_0x6e42('0x2'));var moment=require(_0x6e42('0x3'));var BPromise=require(_0x6e42('0x4'));var rp=require(_0x6e42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e42('0x6'));var config=require(_0x6e42('0x7'));var attributes=require(_0x6e42('0x8'));var integrations=require(_0x6e42('0x9'));module['exports']=function(_0x7807d8,_0xfaf712){return _0x7807d8[_0x6e42('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x6e42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e7b=['int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x5406a1,_0x3659ae){_0x5406a1=_0x5406a1-0x0;var _0x892737=_0x4e7b[_0x5406a1];return _0x892737;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var logger=require('../../config/logger')(_0xb4e7('0x2'));var moment=require('moment');var BPromise=require(_0xb4e7('0x3'));var rp=require(_0xb4e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e7('0x5'));var config=require(_0xb4e7('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xb4e7('0x7'));module[_0xb4e7('0x8')]=function(_0x271dbf,_0x1dcf05){return _0x271dbf[_0xb4e7('0x9')]('SugarcrmAccount',attributes,{'tableName':_0xb4e7('0xa'),'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 79fd8ce..5518b38 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 _0xa2cd=['catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e1fd5,_0x1173d8){var _0x397946=function(_0x5c2e42){while(--_0x5c2e42){_0x1e1fd5['push'](_0x1e1fd5['shift']());}};_0x397946(++_0x1173d8);}(_0xa2cd,0x96));var _0xda2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2cd[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xda2c('0x0'));var moment=require(_0xda2c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda2c('0x2'));var db=require(_0xda2c('0x3'))['db'];var utils=require(_0xda2c('0x4'));var logger=require(_0xda2c('0x5'))('rpc');var config=require(_0xda2c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xda2c('0x7')][_0xda2c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36c7d0,_0x2df207,_0x423004){return new BPromise(function(_0x431662,_0x193228){return client[_0xda2c('0x9')](_0x36c7d0,_0x423004)[_0xda2c('0xa')](function(_0x4c44e5){logger['info'](_0xda2c('0xb'),_0x2df207,_0xda2c('0xc'));logger[_0xda2c('0xd')](_0xda2c('0xe'),_0x2df207,_0xda2c('0xc'),JSON[_0xda2c('0xf')](_0x4c44e5));if(_0x4c44e5['error']){if(_0x4c44e5[_0xda2c('0x10')][_0xda2c('0x11')]===0x1f4){logger[_0xda2c('0x10')](_0xda2c('0xb'),_0x2df207,_0x4c44e5[_0xda2c('0x10')]['message']);return _0x193228(_0x4c44e5['error'][_0xda2c('0x12')]);}logger[_0xda2c('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2df207,_0x4c44e5[_0xda2c('0x10')]['message']);return _0x431662(_0x4c44e5[_0xda2c('0x10')][_0xda2c('0x12')]);}else{logger[_0xda2c('0x13')](_0xda2c('0xb'),_0x2df207,'request\x20sent');_0x431662(_0x4c44e5['result']['message']);}})[_0xda2c('0x14')](function(_0x206c42){logger[_0xda2c('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2df207,_0x206c42);_0x193228(_0x206c42);});});}exports['GetSugarcrmAccount']=function(_0xde3565){var _0x4fa27b=this;return new Promise(function(_0x533a62,_0x162063){return db[_0xda2c('0x15')][_0xda2c('0x16')]({'raw':_0xde3565[_0xda2c('0x17')]?_0xde3565['options'][_0xda2c('0x18')]===undefined?!![]:![]:!![],'where':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x19')]||null:null,'attributes':_0xde3565['options']?_0xde3565['options'][_0xda2c('0x1a')]||null:null,'limit':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x1b')]||null:null,'include':_0xde3565[_0xda2c('0x17')]?_0xde3565[_0xda2c('0x17')][_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0xde3565[_0xda2c('0x17')][_0xda2c('0x1c')],function(_0xb06ab4){return{'model':db[_0xb06ab4[_0xda2c('0x1e')]],'as':_0xb06ab4['as'],'attributes':_0xb06ab4[_0xda2c('0x1a')],'include':_0xb06ab4['include']?_[_0xda2c('0x1d')](_0xb06ab4[_0xda2c('0x1c')],function(_0x368c57){return{'model':db[_0x368c57[_0xda2c('0x1e')]],'as':_0x368c57['as'],'attributes':_0x368c57['attributes'],'include':_0x368c57[_0xda2c('0x1c')]?_['map'](_0x368c57[_0xda2c('0x1c')],function(_0x3c47b9){return{'model':db[_0x3c47b9[_0xda2c('0x1e')]],'as':_0x3c47b9['as'],'attributes':_0x3c47b9[_0xda2c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda2c('0xa')](function(_0x29168c){logger['info'](_0xda2c('0x1f'),_0xde3565);logger[_0xda2c('0xd')](_0xda2c('0x1f'),_0xde3565,JSON['stringify'](_0x29168c));_0x533a62(_0x29168c);})['catch'](function(_0x897fd5){logger[_0xda2c('0x10')](_0xda2c('0x1f'),_0x897fd5[_0xda2c('0x12')],_0xde3565);_0x162063(_0x4fa27b[_0xda2c('0x10')](0x1f4,_0x897fd5[_0xda2c('0x12')]));});});};exports[_0xda2c('0x20')]=function(_0x389b43){var _0x38ff1f=this;return new Promise(function(_0x264c71,_0x408595){return db[_0xda2c('0x15')][_0xda2c('0x21')]({'raw':_0x389b43[_0xda2c('0x17')]?_0x389b43[_0xda2c('0x17')][_0xda2c('0x18')]===undefined?!![]:![]:!![],'where':_0x389b43[_0xda2c('0x17')]?_0x389b43['options'][_0xda2c('0x19')]||null:null,'attributes':_0x389b43[_0xda2c('0x17')]?_0x389b43[_0xda2c('0x17')]['attributes']||null:null,'include':_0x389b43[_0xda2c('0x17')]?_0x389b43['options'][_0xda2c('0x1c')]?_['map'](_0x389b43[_0xda2c('0x17')]['include'],function(_0x5508ad){return{'model':db[_0x5508ad[_0xda2c('0x1e')]],'as':_0x5508ad['as'],'attributes':_0x5508ad[_0xda2c('0x1a')],'include':_0x5508ad[_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0x5508ad['include'],function(_0x1efe0d){return{'model':db[_0x1efe0d[_0xda2c('0x1e')]],'as':_0x1efe0d['as'],'attributes':_0x1efe0d['attributes'],'include':_0x1efe0d[_0xda2c('0x1c')]?_[_0xda2c('0x1d')](_0x1efe0d['include'],function(_0x371b3b){return{'model':db[_0x371b3b[_0xda2c('0x1e')]],'as':_0x371b3b['as'],'attributes':_0x371b3b[_0xda2c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda2c('0xa')](function(_0x1a3ab0){logger[_0xda2c('0x13')]('ShowSugarcrmAccount',_0x389b43);logger[_0xda2c('0xd')](_0xda2c('0x20'),_0x389b43,JSON['stringify'](_0x1a3ab0));_0x264c71(_0x1a3ab0);})[_0xda2c('0x14')](function(_0x2f886e){logger['error'](_0xda2c('0x20'),_0x2f886e[_0xda2c('0x12')],_0x389b43);_0x408595(_0x38ff1f['error'](0x1f4,_0x2f886e[_0xda2c('0x12')]));});});}; \ No newline at end of file +var _0xfe04=['then','debug','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSugarcrmAccount','options','raw','where','limit','include','map','attributes','model'];(function(_0x48832c,_0x1afbd9){var _0x23ddcf=function(_0x54364){while(--_0x54364){_0x48832c['push'](_0x48832c['shift']());}};_0x23ddcf(++_0x1afbd9);}(_0xfe04,0xed));var _0x4fe0=function(_0x4130ae,_0x2469c9){_0x4130ae=_0x4130ae-0x0;var _0x28dee4=_0xfe04[_0x4130ae];return _0x28dee4;};'use strict';var _=require(_0x4fe0('0x0'));var util=require(_0x4fe0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4fe0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fe0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fe0('0x4'))(_0x4fe0('0x5'));var config=require(_0x4fe0('0x6'));var jayson=require(_0x4fe0('0x7'));var client=jayson[_0x4fe0('0x8')][_0x4fe0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a97fd,_0x1ea9d3,_0x250a33){return new BPromise(function(_0x1d35b6,_0x46d4f7){return client['request'](_0x1a97fd,_0x250a33)['then'](function(_0x356826){logger[_0x4fe0('0xa')](_0x4fe0('0xb'),_0x1ea9d3,_0x4fe0('0xc'));logger['debug'](_0x4fe0('0xd'),_0x1ea9d3,_0x4fe0('0xc'),JSON['stringify'](_0x356826));if(_0x356826[_0x4fe0('0xe')]){if(_0x356826['error'][_0x4fe0('0xf')]===0x1f4){logger[_0x4fe0('0xe')](_0x4fe0('0xb'),_0x1ea9d3,_0x356826[_0x4fe0('0xe')][_0x4fe0('0x10')]);return _0x46d4f7(_0x356826[_0x4fe0('0xe')][_0x4fe0('0x10')]);}logger['error'](_0x4fe0('0xb'),_0x1ea9d3,_0x356826[_0x4fe0('0xe')]['message']);return _0x1d35b6(_0x356826[_0x4fe0('0xe')][_0x4fe0('0x10')]);}else{logger[_0x4fe0('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ea9d3,_0x4fe0('0xc'));_0x1d35b6(_0x356826['result'][_0x4fe0('0x10')]);}})[_0x4fe0('0x11')](function(_0x37b422){logger['error'](_0x4fe0('0xb'),_0x1ea9d3,_0x37b422);_0x46d4f7(_0x37b422);});});}exports[_0x4fe0('0x12')]=function(_0x22a2b3){var _0x1e52d1=this;return new Promise(function(_0x343e08,_0x25699c){return db['SugarcrmAccount']['findAll']({'raw':_0x22a2b3['options']?_0x22a2b3[_0x4fe0('0x13')][_0x4fe0('0x14')]===undefined?!![]:![]:!![],'where':_0x22a2b3[_0x4fe0('0x13')]?_0x22a2b3[_0x4fe0('0x13')][_0x4fe0('0x15')]||null:null,'attributes':_0x22a2b3[_0x4fe0('0x13')]?_0x22a2b3[_0x4fe0('0x13')]['attributes']||null:null,'limit':_0x22a2b3[_0x4fe0('0x13')]?_0x22a2b3[_0x4fe0('0x13')][_0x4fe0('0x16')]||null:null,'include':_0x22a2b3[_0x4fe0('0x13')]?_0x22a2b3[_0x4fe0('0x13')][_0x4fe0('0x17')]?_[_0x4fe0('0x18')](_0x22a2b3['options'][_0x4fe0('0x17')],function(_0x55de94){return{'model':db[_0x55de94['model']],'as':_0x55de94['as'],'attributes':_0x55de94[_0x4fe0('0x19')],'include':_0x55de94[_0x4fe0('0x17')]?_[_0x4fe0('0x18')](_0x55de94[_0x4fe0('0x17')],function(_0x16290a){return{'model':db[_0x16290a['model']],'as':_0x16290a['as'],'attributes':_0x16290a[_0x4fe0('0x19')],'include':_0x16290a['include']?_[_0x4fe0('0x18')](_0x16290a[_0x4fe0('0x17')],function(_0x521cc2){return{'model':db[_0x521cc2[_0x4fe0('0x1a')]],'as':_0x521cc2['as'],'attributes':_0x521cc2['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fe0('0x1b')](function(_0x34d3f5){logger[_0x4fe0('0xa')](_0x4fe0('0x12'),_0x22a2b3);logger[_0x4fe0('0x1c')](_0x4fe0('0x12'),_0x22a2b3,JSON[_0x4fe0('0x1d')](_0x34d3f5));_0x343e08(_0x34d3f5);})['catch'](function(_0x119f77){logger['error'](_0x4fe0('0x12'),_0x119f77[_0x4fe0('0x10')],_0x22a2b3);_0x25699c(_0x1e52d1['error'](0x1f4,_0x119f77['message']));});});};exports[_0x4fe0('0x1e')]=function(_0x5923f3){var _0x41ccec=this;return new Promise(function(_0x42a096,_0x32906f){return db[_0x4fe0('0x1f')][_0x4fe0('0x20')]({'raw':_0x5923f3[_0x4fe0('0x13')]?_0x5923f3[_0x4fe0('0x13')][_0x4fe0('0x14')]===undefined?!![]:![]:!![],'where':_0x5923f3['options']?_0x5923f3[_0x4fe0('0x13')]['where']||null:null,'attributes':_0x5923f3[_0x4fe0('0x13')]?_0x5923f3[_0x4fe0('0x13')][_0x4fe0('0x19')]||null:null,'include':_0x5923f3[_0x4fe0('0x13')]?_0x5923f3[_0x4fe0('0x13')][_0x4fe0('0x17')]?_['map'](_0x5923f3[_0x4fe0('0x13')][_0x4fe0('0x17')],function(_0x39e799){return{'model':db[_0x39e799[_0x4fe0('0x1a')]],'as':_0x39e799['as'],'attributes':_0x39e799[_0x4fe0('0x19')],'include':_0x39e799['include']?_[_0x4fe0('0x18')](_0x39e799[_0x4fe0('0x17')],function(_0x42a82b){return{'model':db[_0x42a82b[_0x4fe0('0x1a')]],'as':_0x42a82b['as'],'attributes':_0x42a82b[_0x4fe0('0x19')],'include':_0x42a82b[_0x4fe0('0x17')]?_[_0x4fe0('0x18')](_0x42a82b[_0x4fe0('0x17')],function(_0x150c3b){return{'model':db[_0x150c3b['model']],'as':_0x150c3b['as'],'attributes':_0x150c3b[_0x4fe0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4fe0('0x1b')](function(_0x1b73da){logger[_0x4fe0('0xa')](_0x4fe0('0x1e'),_0x5923f3);logger[_0x4fe0('0x1c')](_0x4fe0('0x1e'),_0x5923f3,JSON[_0x4fe0('0x1d')](_0x1b73da));_0x42a096(_0x1b73da);})['catch'](function(_0x226ab7){logger[_0x4fe0('0xe')](_0x4fe0('0x1e'),_0x226ab7[_0x4fe0('0x10')],_0x5923f3);_0x32906f(_0x41ccec[_0x4fe0('0xe')](0x1f4,_0x226ab7[_0x4fe0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 7fb5de6..eae6c20 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 _0xbc95=['./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1e0d9a,_0x214450){var _0x36cbe0=function(_0x4003b4){while(--_0x4003b4){_0x1e0d9a['push'](_0x1e0d9a['shift']());}};_0x36cbe0(++_0x214450);}(_0xbc95,0x77));var _0x5bc9=function(_0x5a5cfb,_0x37ed01){_0x5a5cfb=_0x5a5cfb-0x0;var _0x334936=_0xbc95[_0x5a5cfb];return _0x334936;};'use strict';var multer=require('multer');var util=require(_0x5bc9('0x0'));var path=require(_0x5bc9('0x1'));var timeout=require(_0x5bc9('0x2'));var express=require(_0x5bc9('0x3'));var router=express['Router']();var fs_extra=require(_0x5bc9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5bc9('0x5'));var config=require(_0x5bc9('0x6'));var controller=require(_0x5bc9('0x7'));router[_0x5bc9('0x8')]('/',auth[_0x5bc9('0x9')](),controller['index']);router['get'](_0x5bc9('0xa'),auth['isAuthenticated'](),controller[_0x5bc9('0xb')]);router[_0x5bc9('0x8')](_0x5bc9('0xc'),auth[_0x5bc9('0x9')](),controller['getFields']);router['get'](_0x5bc9('0xd'),auth[_0x5bc9('0x9')](),controller[_0x5bc9('0xe')]);router['get']('/:id/descriptions',auth[_0x5bc9('0x9')](),controller[_0x5bc9('0xf')]);router[_0x5bc9('0x10')]('/',auth[_0x5bc9('0x9')](),controller['create']);router['put']('/:id',auth[_0x5bc9('0x9')](),controller[_0x5bc9('0x11')]);router[_0x5bc9('0x12')](_0x5bc9('0xa'),auth[_0x5bc9('0x9')](),controller[_0x5bc9('0x13')]);module[_0x5bc9('0x14')]=router; \ No newline at end of file +var _0x14b4=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x55c253,_0x59f0d8){var _0x3123f1=function(_0x2e63d4){while(--_0x2e63d4){_0x55c253['push'](_0x55c253['shift']());}};_0x3123f1(++_0x59f0d8);}(_0x14b4,0x13b));var _0x414b=function(_0xc4c142,_0x392430){_0xc4c142=_0xc4c142-0x0;var _0x2c825e=_0x14b4[_0xc4c142];return _0x2c825e;};'use strict';var multer=require(_0x414b('0x0'));var util=require('util');var path=require(_0x414b('0x1'));var timeout=require(_0x414b('0x2'));var express=require(_0x414b('0x3'));var router=express[_0x414b('0x4')]();var fs_extra=require(_0x414b('0x5'));var auth=require(_0x414b('0x6'));var interaction=require(_0x414b('0x7'));var config=require(_0x414b('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x414b('0x9')]('/',auth['isAuthenticated'](),controller[_0x414b('0xa')]);router[_0x414b('0x9')](_0x414b('0xb'),auth[_0x414b('0xc')](),controller[_0x414b('0xd')]);router[_0x414b('0x9')](_0x414b('0xe'),auth['isAuthenticated'](),controller[_0x414b('0xf')]);router['get'](_0x414b('0x10'),auth['isAuthenticated'](),controller[_0x414b('0x11')]);router['get'](_0x414b('0x12'),auth[_0x414b('0xc')](),controller[_0x414b('0x13')]);router['post']('/',auth[_0x414b('0xc')](),controller[_0x414b('0x14')]);router[_0x414b('0x15')](_0x414b('0xb'),auth['isAuthenticated'](),controller[_0x414b('0x16')]);router[_0x414b('0x17')](_0x414b('0xb'),auth['isAuthenticated'](),controller[_0x414b('0x18')]);module[_0x414b('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index aa02cb7..ee7eedc 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 _0x7383=['sequelize','STRING'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7383,0x104));var _0x3738=function(_0x2ed416,_0x484a43){_0x2ed416=_0x2ed416-0x0;var _0xd3778a=_0x7383[_0x2ed416];return _0xd3778a;};'use strict';var Sequelize=require(_0x3738('0x0'));module['exports']={'name':{'type':Sequelize[_0x3738('0x1')]},'description':{'type':Sequelize[_0x3738('0x1')]}}; \ No newline at end of file +var _0x45e5=['exports','STRING'];(function(_0x4fc1e3,_0x5ca40d){var _0x5538e2=function(_0x3e432){while(--_0x3e432){_0x4fc1e3['push'](_0x4fc1e3['shift']());}};_0x5538e2(++_0x5ca40d);}(_0x45e5,0x1b2));var _0x545e=function(_0x2ef9f2,_0x4a6e3d){_0x2ef9f2=_0x2ef9f2-0x0;var _0x48fa3a=_0x45e5[_0x2ef9f2];return _0x48fa3a;};'use strict';var Sequelize=require('sequelize');module[_0x545e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x545e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index af33ee9..b0164df 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 _0xf6ab=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','findOne','SugarcrmField','pick','getFields','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xf6ab,0x109));var _0xbf6a=function(_0x5d2f25,_0x2f58f3){_0x5d2f25=_0x5d2f25-0x0;var _0x5e793d=_0xf6ab[_0x5d2f25];return _0x5e793d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf6a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf6a('0x1'));var moment=require(_0xbf6a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbf6a('0x3'));var util=require(_0xbf6a('0x4'));var path=require(_0xbf6a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf6a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf6a('0x7'));var crypto=require(_0xbf6a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xbf6a('0x9'));var toCsv=require(_0xbf6a('0xa'));var querystring=require(_0xbf6a('0xb'));var Papa=require(_0xbf6a('0xc'));var Redis=require('ioredis');var authService=require(_0xbf6a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf6a('0xe'));var utils=require(_0xbf6a('0xf'));var config=require(_0xbf6a('0x10'));var licenseUtil=require(_0xbf6a('0x11'));var db=require(_0xbf6a('0x12'))['db'];function respondWithStatusCode(_0x3b2b0c,_0xa24a69){_0xa24a69=_0xa24a69||0xcc;return function(_0xec450a){if(_0xec450a){return _0x3b2b0c[_0xbf6a('0x13')](_0xa24a69);}return _0x3b2b0c[_0xbf6a('0x14')](_0xa24a69)[_0xbf6a('0x15')]();};}function respondWithResult(_0x5b044b,_0x2da5f6){_0x2da5f6=_0x2da5f6||0xc8;return function(_0x29e49a){if(_0x29e49a){return _0x5b044b['status'](_0x2da5f6)[_0xbf6a('0x16')](_0x29e49a);}};}function respondWithFilteredResult(_0x1cf5ff,_0x1f64ae){return function(_0x52156e){if(_0x52156e){var _0x58a380=typeof _0x1f64ae['offset']===_0xbf6a('0x17')&&typeof _0x1f64ae[_0xbf6a('0x18')]===_0xbf6a('0x17');var _0x415b84=_0x52156e[_0xbf6a('0x19')];var _0x48a7d1=_0x58a380?0x0:_0x1f64ae[_0xbf6a('0x1a')];var _0x23aecc=_0x58a380?_0x52156e[_0xbf6a('0x19')]:_0x1f64ae[_0xbf6a('0x1a')]+_0x1f64ae['limit'];var _0x4e3652;if(_0x23aecc>=_0x415b84){_0x23aecc=_0x415b84;_0x4e3652=0xc8;}else{_0x4e3652=0xce;}_0x1cf5ff[_0xbf6a('0x14')](_0x4e3652);return _0x1cf5ff[_0xbf6a('0x1b')](_0xbf6a('0x1c'),_0x48a7d1+'-'+_0x23aecc+'/'+_0x415b84)[_0xbf6a('0x16')](_0x52156e);}return null;};}function patchUpdates(_0x1cba08){return function(_0x504a79){try{jsonpatch[_0xbf6a('0x1d')](_0x504a79,_0x1cba08,!![]);}catch(_0x2aabc6){return BPromise[_0xbf6a('0x1e')](_0x2aabc6);}return _0x504a79[_0xbf6a('0x1f')]();};}function saveUpdates(_0x52417c,_0x141ec5){return function(_0x5efed5){if(_0x5efed5){return _0x5efed5['update'](_0x52417c)[_0xbf6a('0x20')](function(_0x353a3d){return _0x353a3d;});}return null;};}function removeEntity(_0x31dab1,_0x2eb5e6){return function(_0x4c06f3){if(_0x4c06f3){return _0x4c06f3[_0xbf6a('0x21')]()[_0xbf6a('0x20')](function(){_0x31dab1[_0xbf6a('0x14')](0xcc)[_0xbf6a('0x15')]();});}};}function handleEntityNotFound(_0x3d081e,_0x30b0e1){return function(_0x2b4d1c){if(!_0x2b4d1c){_0x3d081e[_0xbf6a('0x13')](0x194);}return _0x2b4d1c;};}function handleError(_0x4ab689,_0x442e01){_0x442e01=_0x442e01||0x1f4;return function(_0x46d9f0){logger[_0xbf6a('0x22')](_0x46d9f0[_0xbf6a('0x23')]);if(_0x46d9f0[_0xbf6a('0x24')]){delete _0x46d9f0[_0xbf6a('0x24')];}_0x4ab689[_0xbf6a('0x14')](_0x442e01)['send'](_0x46d9f0);};}exports[_0xbf6a('0x25')]=function(_0x3d9b67,_0xfeb944){var _0x396882={},_0x417758={},_0x1d11b9={'count':0x0,'rows':[]};var _0x53e061=_['map'](db['SugarcrmConfiguration'][_0xbf6a('0x26')],function(_0x2d2089){return{'name':_0x2d2089[_0xbf6a('0x27')],'type':_0x2d2089[_0xbf6a('0x28')]['key']};});_0x417758[_0xbf6a('0x29')]=_['map'](_0x53e061,'name');_0x417758[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x3d9b67[_0xbf6a('0x2a')]);_0x417758[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x417758[_0xbf6a('0x29')],_0x417758[_0xbf6a('0x2a')]);_0x396882['attributes']=_[_0xbf6a('0x2d')](_0x417758[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x2e')]));_0x396882['attributes']=_0x396882[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0x396882[_0xbf6a('0x2f')]:_0x417758[_0xbf6a('0x29')];if(!_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x31')](_0xbf6a('0x32'))){_0x396882['limit']=qs[_0xbf6a('0x18')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x18')]);_0x396882[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x1a')]);}_0x396882[_0xbf6a('0x33')]=qs[_0xbf6a('0x34')](_0x3d9b67[_0xbf6a('0x2a')]['sort']);_0x396882[_0xbf6a('0x35')]=qs['filters'](_['pick'](_0x3d9b67[_0xbf6a('0x2a')],_0x417758[_0xbf6a('0x2c')]),_0x53e061);if(_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x396882[_0xbf6a('0x35')]=_[_0xbf6a('0x37')](_0x396882[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0x53e061,function(_0x5e7b56){if(_0x5e7b56[_0xbf6a('0x28')]!==_0xbf6a('0x39')){var _0x5f04b4={};_0x5f04b4[_0x5e7b56[_0xbf6a('0x24')]]={'$like':'%'+_0x3d9b67['query'][_0xbf6a('0x36')]+'%'};return _0x5f04b4;}})});}_0x396882=_['merge']({},_0x396882,_0x3d9b67['options']);var _0x32cfb6={'where':_0x396882[_0xbf6a('0x35')]};return db[_0xbf6a('0x3a')]['count'](_0x32cfb6)['then'](function(_0x4c9036){_0x1d11b9['count']=_0x4c9036;if(_0x3d9b67[_0xbf6a('0x2a')][_0xbf6a('0x3b')]){_0x396882[_0xbf6a('0x3c')]=[{'all':!![]}];}return db[_0xbf6a('0x3a')][_0xbf6a('0x3d')](_0x396882);})[_0xbf6a('0x20')](function(_0x3b8084){_0x1d11b9[_0xbf6a('0x3e')]=_0x3b8084;return _0x1d11b9;})[_0xbf6a('0x20')](respondWithFilteredResult(_0xfeb944,_0x396882))[_0xbf6a('0x3f')](handleError(_0xfeb944,null));};exports[_0xbf6a('0x40')]=function(_0x2a6194,_0x3f4b01){var _0x47317e={'raw':![],'where':{'id':_0x2a6194[_0xbf6a('0x41')]['id']}},_0xcf08a3={};_0xcf08a3[_0xbf6a('0x29')]=_['keys'](db[_0xbf6a('0x3a')][_0xbf6a('0x26')]);_0xcf08a3[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x2a6194[_0xbf6a('0x2a')]);_0xcf08a3[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0xcf08a3[_0xbf6a('0x29')],_0xcf08a3[_0xbf6a('0x2a')]);_0x47317e[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0xcf08a3[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x2a6194['query'][_0xbf6a('0x2e')]));_0x47317e['attributes']=_0x47317e[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0x47317e[_0xbf6a('0x2f')]:_0xcf08a3['model'];if(_0x2a6194[_0xbf6a('0x2a')][_0xbf6a('0x3b')]){_0x47317e[_0xbf6a('0x3c')]=[{'all':!![]}];}_0x47317e=_['merge']({},_0x47317e,_0x2a6194[_0xbf6a('0x42')]);return db['SugarcrmConfiguration'][_0xbf6a('0x43')](_0x47317e)[_0xbf6a('0x20')](handleEntityNotFound(_0x3f4b01,null))['then'](respondWithResult(_0x3f4b01,null))[_0xbf6a('0x3f')](handleError(_0x3f4b01,null));};exports[_0xbf6a('0x44')]=function(_0x436618,_0x23e125){return db[_0xbf6a('0x3a')][_0xbf6a('0x44')](_0x436618['body'],{})[_0xbf6a('0x20')](respondWithResult(_0x23e125,0xc9))[_0xbf6a('0x3f')](handleError(_0x23e125,null));};exports['update']=function(_0x27a2df,_0x1648df){if(_0x27a2df[_0xbf6a('0x45')]['id']){delete _0x27a2df[_0xbf6a('0x45')]['id'];}return db['SugarcrmConfiguration'][_0xbf6a('0x43')]({'where':{'id':_0x27a2df[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x1648df,null))[_0xbf6a('0x20')](saveUpdates(_0x27a2df[_0xbf6a('0x45')],null))[_0xbf6a('0x20')](respondWithResult(_0x1648df,null))['catch'](handleError(_0x1648df,null));};exports['destroy']=function(_0x1e2fdc,_0x192c50){return db[_0xbf6a('0x3a')]['find']({'where':{'id':_0x1e2fdc['params']['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x192c50,null))['then'](removeEntity(_0x192c50,null))[_0xbf6a('0x3f')](handleError(_0x192c50,null));};exports['getFields']=function(_0x3a027e,_0x2e28dd,_0x5b78d6){var _0xac7a9c={};var _0x529342={};var _0xbbec86;var _0x44eb50;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x3a027e[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x2e28dd,null))[_0xbf6a('0x20')](function(_0x187d8e){if(_0x187d8e){_0xbbec86=_0x187d8e;_0x529342['model']=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x529342['query']=_['keys'](_0x3a027e['query']);_0x529342[_0xbf6a('0x2c')]=_['intersection'](_0x529342[_0xbf6a('0x29')],_0x529342[_0xbf6a('0x2a')]);_0xac7a9c[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x529342[_0xbf6a('0x29')],qs['fields'](_0x3a027e[_0xbf6a('0x2a')]['fields']));_0xac7a9c['attributes']=_0xac7a9c[_0xbf6a('0x2f')][_0xbf6a('0x30')]?_0xac7a9c[_0xbf6a('0x2f')]:_0x529342[_0xbf6a('0x29')];_0xac7a9c['order']=qs[_0xbf6a('0x34')](_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x34')]);_0xac7a9c[_0xbf6a('0x35')]=qs[_0xbf6a('0x2c')](_[_0xbf6a('0x48')](_0x3a027e[_0xbf6a('0x2a')],_0x529342['filters']));if(_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0xac7a9c[_0xbf6a('0x35')]=_[_0xbf6a('0x37')](_0xac7a9c[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0xac7a9c[_0xbf6a('0x2f')],function(_0x4864e3){var _0x346534={};_0x346534[_0x4864e3]={'$like':'%'+_0x3a027e[_0xbf6a('0x2a')][_0xbf6a('0x36')]+'%'};return _0x346534;})});}_0xac7a9c=_[_0xbf6a('0x37')]({},_0xac7a9c,_0x3a027e['options']);return _0xbbec86['getFields'](_0xac7a9c);}})[_0xbf6a('0x20')](function(_0x2f656d){if(_0x2f656d){_0x44eb50=_0x2f656d[_0xbf6a('0x30')];if(!_0x3a027e[_0xbf6a('0x2a')]['hasOwnProperty']('nolimit')){_0xac7a9c[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x3a027e['query']['limit']);_0xac7a9c[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x3a027e[_0xbf6a('0x2a')]['offset']);}return _0xbbec86[_0xbf6a('0x49')](_0xac7a9c);}})[_0xbf6a('0x20')](function(_0x1ad70f){if(_0x1ad70f){return _0x1ad70f?{'count':_0x44eb50,'rows':_0x1ad70f}:null;}})[_0xbf6a('0x20')](respondWithResult(_0x2e28dd,null))[_0xbf6a('0x3f')](handleError(_0x2e28dd,null));};exports['getSubjects']=function(_0x5081bb,_0x1fee27,_0x5344da){var _0x32fa4a={};var _0x104c6f={};var _0x2728e3;var _0x50302e;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x5081bb[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0x1fee27,null))[_0xbf6a('0x20')](function(_0x4ddf78){if(_0x4ddf78){_0x2728e3=_0x4ddf78;_0x104c6f[_0xbf6a('0x29')]=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x104c6f[_0xbf6a('0x2a')]=_['keys'](_0x5081bb[_0xbf6a('0x2a')]);_0x104c6f[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x104c6f[_0xbf6a('0x29')],_0x104c6f[_0xbf6a('0x2a')]);_0x32fa4a[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x104c6f['model'],qs['fields'](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x2e')]));_0x32fa4a[_0xbf6a('0x2f')]=_0x32fa4a['attributes'][_0xbf6a('0x30')]?_0x32fa4a[_0xbf6a('0x2f')]:_0x104c6f[_0xbf6a('0x29')];_0x32fa4a['order']=qs[_0xbf6a('0x34')](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x34')]);_0x32fa4a[_0xbf6a('0x35')]=qs['filters'](_['pick'](_0x5081bb[_0xbf6a('0x2a')],_0x104c6f['filters']));if(_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x32fa4a['where']=_['merge'](_0x32fa4a[_0xbf6a('0x35')],{'$or':_['map'](_0x32fa4a[_0xbf6a('0x2f')],function(_0x58249f){var _0x92c8bb={};_0x92c8bb[_0x58249f]={'$like':'%'+_0x5081bb[_0xbf6a('0x2a')]['filter']+'%'};return _0x92c8bb;})});}_0x32fa4a=_[_0xbf6a('0x37')]({},_0x32fa4a,_0x5081bb[_0xbf6a('0x42')]);return _0x2728e3['getSubjects'](_0x32fa4a);}})[_0xbf6a('0x20')](function(_0x3a0ba1){if(_0x3a0ba1){_0x50302e=_0x3a0ba1['length'];if(!_0x5081bb[_0xbf6a('0x2a')]['hasOwnProperty'](_0xbf6a('0x32'))){_0x32fa4a[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x5081bb[_0xbf6a('0x2a')][_0xbf6a('0x18')]);_0x32fa4a[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x5081bb[_0xbf6a('0x2a')]['offset']);}return _0x2728e3[_0xbf6a('0x4a')](_0x32fa4a);}})[_0xbf6a('0x20')](function(_0x2377cd){if(_0x2377cd){return _0x2377cd?{'count':_0x50302e,'rows':_0x2377cd}:null;}})[_0xbf6a('0x20')](respondWithResult(_0x1fee27,null))['catch'](handleError(_0x1fee27,null));};exports[_0xbf6a('0x4b')]=function(_0x4ad253,_0xa66295,_0x2d68b6){var _0x2b282b={};var _0x1bd658={};var _0x269cdb;var _0x572fc8;return db[_0xbf6a('0x3a')][_0xbf6a('0x46')]({'where':{'id':_0x4ad253[_0xbf6a('0x41')]['id']}})[_0xbf6a('0x20')](handleEntityNotFound(_0xa66295,null))[_0xbf6a('0x20')](function(_0x305bee){if(_0x305bee){_0x269cdb=_0x305bee;_0x1bd658['model']=_[_0xbf6a('0x2b')](db[_0xbf6a('0x47')][_0xbf6a('0x26')]);_0x1bd658[_0xbf6a('0x2a')]=_[_0xbf6a('0x2b')](_0x4ad253[_0xbf6a('0x2a')]);_0x1bd658[_0xbf6a('0x2c')]=_[_0xbf6a('0x2d')](_0x1bd658[_0xbf6a('0x29')],_0x1bd658[_0xbf6a('0x2a')]);_0x2b282b[_0xbf6a('0x2f')]=_[_0xbf6a('0x2d')](_0x1bd658[_0xbf6a('0x29')],qs[_0xbf6a('0x2e')](_0x4ad253[_0xbf6a('0x2a')]['fields']));_0x2b282b[_0xbf6a('0x2f')]=_0x2b282b['attributes']['length']?_0x2b282b[_0xbf6a('0x2f')]:_0x1bd658[_0xbf6a('0x29')];_0x2b282b[_0xbf6a('0x33')]=qs['sort'](_0x4ad253[_0xbf6a('0x2a')]['sort']);_0x2b282b[_0xbf6a('0x35')]=qs[_0xbf6a('0x2c')](_[_0xbf6a('0x48')](_0x4ad253[_0xbf6a('0x2a')],_0x1bd658[_0xbf6a('0x2c')]));if(_0x4ad253[_0xbf6a('0x2a')][_0xbf6a('0x36')]){_0x2b282b['where']=_[_0xbf6a('0x37')](_0x2b282b[_0xbf6a('0x35')],{'$or':_[_0xbf6a('0x38')](_0x2b282b['attributes'],function(_0x373989){var _0x27b6f2={};_0x27b6f2[_0x373989]={'$like':'%'+_0x4ad253[_0xbf6a('0x2a')]['filter']+'%'};return _0x27b6f2;})});}_0x2b282b=_[_0xbf6a('0x37')]({},_0x2b282b,_0x4ad253[_0xbf6a('0x42')]);return _0x269cdb[_0xbf6a('0x4b')](_0x2b282b);}})[_0xbf6a('0x20')](function(_0x2a854a){if(_0x2a854a){_0x572fc8=_0x2a854a[_0xbf6a('0x30')];if(!_0x4ad253[_0xbf6a('0x2a')][_0xbf6a('0x31')]('nolimit')){_0x2b282b[_0xbf6a('0x18')]=qs[_0xbf6a('0x18')](_0x4ad253['query'][_0xbf6a('0x18')]);_0x2b282b[_0xbf6a('0x1a')]=qs[_0xbf6a('0x1a')](_0x4ad253['query'][_0xbf6a('0x1a')]);}return _0x269cdb[_0xbf6a('0x4b')](_0x2b282b);}})[_0xbf6a('0x20')](function(_0x157252){if(_0x157252){return _0x157252?{'count':_0x572fc8,'rows':_0x157252}:null;}})[_0xbf6a('0x20')](respondWithResult(_0xa66295,null))[_0xbf6a('0x3f')](handleError(_0xa66295,null));}; \ No newline at end of file +var _0x2f2c=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','catch','create','body','params','destroy','getFields','findOne','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','apply','save','update','then','sendStatus','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x2f2c,0x1c2));var _0xc2f2=function(_0x3bc45f,_0x1ecbb9){_0x3bc45f=_0x3bc45f-0x0;var _0x3a9f65=_0x2f2c[_0x3bc45f];return _0x3a9f65;};'use strict';var emlformat=require(_0xc2f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2f2('0x1'));var jsonpatch=require(_0xc2f2('0x2'));var rp=require(_0xc2f2('0x3'));var moment=require(_0xc2f2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2f2('0x5'));var util=require('util');var path=require(_0xc2f2('0x6'));var sox=require('sox');var csv=require(_0xc2f2('0x7'));var ejs=require(_0xc2f2('0x8'));var fs=require('fs');var fs_extra=require(_0xc2f2('0x9'));var _=require(_0xc2f2('0xa'));var squel=require(_0xc2f2('0xb'));var crypto=require(_0xc2f2('0xc'));var jsforce=require(_0xc2f2('0xd'));var deskjs=require(_0xc2f2('0xe'));var toCsv=require(_0xc2f2('0x7'));var querystring=require(_0xc2f2('0xf'));var Papa=require(_0xc2f2('0x10'));var Redis=require(_0xc2f2('0x11'));var authService=require(_0xc2f2('0x12'));var qs=require(_0xc2f2('0x13'));var as=require(_0xc2f2('0x14'));var hardwareService=require(_0xc2f2('0x15'));var logger=require(_0xc2f2('0x16'))(_0xc2f2('0x17'));var utils=require(_0xc2f2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc2f2('0x19'));var db=require(_0xc2f2('0x1a'))['db'];function respondWithStatusCode(_0x263d1c,_0x2faf02){_0x2faf02=_0x2faf02||0xcc;return function(_0x400d9f){if(_0x400d9f){return _0x263d1c['sendStatus'](_0x2faf02);}return _0x263d1c[_0xc2f2('0x1b')](_0x2faf02)[_0xc2f2('0x1c')]();};}function respondWithResult(_0x4a7709,_0x5ec7f6){_0x5ec7f6=_0x5ec7f6||0xc8;return function(_0x1dc8d9){if(_0x1dc8d9){return _0x4a7709[_0xc2f2('0x1b')](_0x5ec7f6)[_0xc2f2('0x1d')](_0x1dc8d9);}};}function respondWithFilteredResult(_0x50cf64,_0x4de693){return function(_0x21e3da){if(_0x21e3da){var _0xad9770=typeof _0x4de693[_0xc2f2('0x1e')]==='undefined'&&typeof _0x4de693[_0xc2f2('0x1f')]===_0xc2f2('0x20');var _0xea93a4=_0x21e3da['count'];var _0x586ce2=_0xad9770?0x0:_0x4de693[_0xc2f2('0x1e')];var _0x224515=_0xad9770?_0x21e3da['count']:_0x4de693[_0xc2f2('0x1e')]+_0x4de693[_0xc2f2('0x1f')];var _0x146b73;if(_0x224515>=_0xea93a4){_0x224515=_0xea93a4;_0x146b73=0xc8;}else{_0x146b73=0xce;}_0x50cf64[_0xc2f2('0x1b')](_0x146b73);return _0x50cf64[_0xc2f2('0x21')]('Content-Range',_0x586ce2+'-'+_0x224515+'/'+_0xea93a4)[_0xc2f2('0x1d')](_0x21e3da);}return null;};}function patchUpdates(_0x1c2ed9){return function(_0x289756){try{jsonpatch[_0xc2f2('0x22')](_0x289756,_0x1c2ed9,!![]);}catch(_0x183a97){return BPromise['reject'](_0x183a97);}return _0x289756[_0xc2f2('0x23')]();};}function saveUpdates(_0x5ce0d3,_0x1bdeac){return function(_0xaf650){if(_0xaf650){return _0xaf650[_0xc2f2('0x24')](_0x5ce0d3)['then'](function(_0x383610){return _0x383610;});}return null;};}function removeEntity(_0x4e74a5,_0x31bd9a){return function(_0x11e24c){if(_0x11e24c){return _0x11e24c['destroy']()[_0xc2f2('0x25')](function(){_0x4e74a5[_0xc2f2('0x1b')](0xcc)[_0xc2f2('0x1c')]();});}};}function handleEntityNotFound(_0x277c6d,_0x31b6b3){return function(_0x41dd39){if(!_0x41dd39){_0x277c6d[_0xc2f2('0x26')](0x194);}return _0x41dd39;};}function handleError(_0x2c4fd0,_0x1fdee1){_0x1fdee1=_0x1fdee1||0x1f4;return function(_0x4a753f){logger['error'](_0x4a753f[_0xc2f2('0x27')]);if(_0x4a753f[_0xc2f2('0x28')]){delete _0x4a753f[_0xc2f2('0x28')];}_0x2c4fd0['status'](_0x1fdee1)[_0xc2f2('0x29')](_0x4a753f);};}exports[_0xc2f2('0x2a')]=function(_0x366402,_0x473c06){var _0x2a1174={},_0x540ed3={},_0x566161={'count':0x0,'rows':[]};var _0x564286=_['map'](db[_0xc2f2('0x2b')][_0xc2f2('0x2c')],function(_0x56331f){return{'name':_0x56331f[_0xc2f2('0x2d')],'type':_0x56331f[_0xc2f2('0x2e')][_0xc2f2('0x2f')]};});_0x540ed3[_0xc2f2('0x30')]=_[_0xc2f2('0x31')](_0x564286,'name');_0x540ed3[_0xc2f2('0x32')]=_[_0xc2f2('0x33')](_0x366402[_0xc2f2('0x32')]);_0x540ed3[_0xc2f2('0x34')]=_[_0xc2f2('0x35')](_0x540ed3['model'],_0x540ed3['query']);_0x2a1174[_0xc2f2('0x36')]=_[_0xc2f2('0x35')](_0x540ed3['model'],qs[_0xc2f2('0x37')](_0x366402[_0xc2f2('0x32')][_0xc2f2('0x37')]));_0x2a1174[_0xc2f2('0x36')]=_0x2a1174['attributes'][_0xc2f2('0x38')]?_0x2a1174[_0xc2f2('0x36')]:_0x540ed3[_0xc2f2('0x30')];if(!_0x366402[_0xc2f2('0x32')][_0xc2f2('0x39')]('nolimit')){_0x2a1174[_0xc2f2('0x1f')]=qs['limit'](_0x366402[_0xc2f2('0x32')]['limit']);_0x2a1174[_0xc2f2('0x1e')]=qs[_0xc2f2('0x1e')](_0x366402[_0xc2f2('0x32')][_0xc2f2('0x1e')]);}_0x2a1174[_0xc2f2('0x3a')]=qs[_0xc2f2('0x3b')](_0x366402[_0xc2f2('0x32')][_0xc2f2('0x3b')]);_0x2a1174[_0xc2f2('0x3c')]=qs[_0xc2f2('0x34')](_[_0xc2f2('0x3d')](_0x366402[_0xc2f2('0x32')],_0x540ed3[_0xc2f2('0x34')]),_0x564286);if(_0x366402['query'][_0xc2f2('0x3e')]){_0x2a1174[_0xc2f2('0x3c')]=_[_0xc2f2('0x3f')](_0x2a1174[_0xc2f2('0x3c')],{'$or':_['map'](_0x564286,function(_0x444077){if(_0x444077[_0xc2f2('0x2e')]!==_0xc2f2('0x40')){var _0x5d4ff2={};_0x5d4ff2[_0x444077[_0xc2f2('0x28')]]={'$like':'%'+_0x366402[_0xc2f2('0x32')][_0xc2f2('0x3e')]+'%'};return _0x5d4ff2;}})});}_0x2a1174=_[_0xc2f2('0x3f')]({},_0x2a1174,_0x366402[_0xc2f2('0x41')]);var _0x2aa8c9={'where':_0x2a1174[_0xc2f2('0x3c')]};return db['SugarcrmConfiguration'][_0xc2f2('0x42')](_0x2aa8c9)['then'](function(_0x384f3e){_0x566161[_0xc2f2('0x42')]=_0x384f3e;if(_0x366402[_0xc2f2('0x32')]['includeAll']){_0x2a1174['include']=[{'all':!![]}];}return db[_0xc2f2('0x2b')][_0xc2f2('0x43')](_0x2a1174);})[_0xc2f2('0x25')](function(_0x595239){_0x566161[_0xc2f2('0x44')]=_0x595239;return _0x566161;})['then'](respondWithFilteredResult(_0x473c06,_0x2a1174))['catch'](handleError(_0x473c06,null));};exports[_0xc2f2('0x45')]=function(_0x3dbb4f,_0x270f19){var _0x415ea4={'raw':![],'where':{'id':_0x3dbb4f['params']['id']}},_0x42fb3c={};_0x42fb3c[_0xc2f2('0x30')]=_[_0xc2f2('0x33')](db[_0xc2f2('0x2b')][_0xc2f2('0x2c')]);_0x42fb3c[_0xc2f2('0x32')]=_[_0xc2f2('0x33')](_0x3dbb4f[_0xc2f2('0x32')]);_0x42fb3c[_0xc2f2('0x34')]=_['intersection'](_0x42fb3c[_0xc2f2('0x30')],_0x42fb3c[_0xc2f2('0x32')]);_0x415ea4['attributes']=_[_0xc2f2('0x35')](_0x42fb3c['model'],qs[_0xc2f2('0x37')](_0x3dbb4f[_0xc2f2('0x32')]['fields']));_0x415ea4['attributes']=_0x415ea4['attributes']['length']?_0x415ea4['attributes']:_0x42fb3c[_0xc2f2('0x30')];if(_0x3dbb4f[_0xc2f2('0x32')][_0xc2f2('0x46')]){_0x415ea4[_0xc2f2('0x47')]=[{'all':!![]}];}_0x415ea4=_['merge']({},_0x415ea4,_0x3dbb4f[_0xc2f2('0x41')]);return db[_0xc2f2('0x2b')][_0xc2f2('0x48')](_0x415ea4)[_0xc2f2('0x25')](handleEntityNotFound(_0x270f19,null))[_0xc2f2('0x25')](respondWithResult(_0x270f19,null))[_0xc2f2('0x49')](handleError(_0x270f19,null));};exports[_0xc2f2('0x4a')]=function(_0x4e14a2,_0xf83602){return db[_0xc2f2('0x2b')]['create'](_0x4e14a2['body'],{})[_0xc2f2('0x25')](respondWithResult(_0xf83602,0xc9))[_0xc2f2('0x49')](handleError(_0xf83602,null));};exports[_0xc2f2('0x24')]=function(_0x1cea6f,_0x1251a8){if(_0x1cea6f[_0xc2f2('0x4b')]['id']){delete _0x1cea6f[_0xc2f2('0x4b')]['id'];}return db[_0xc2f2('0x2b')][_0xc2f2('0x48')]({'where':{'id':_0x1cea6f[_0xc2f2('0x4c')]['id']}})[_0xc2f2('0x25')](handleEntityNotFound(_0x1251a8,null))[_0xc2f2('0x25')](saveUpdates(_0x1cea6f[_0xc2f2('0x4b')],null))['then'](respondWithResult(_0x1251a8,null))[_0xc2f2('0x49')](handleError(_0x1251a8,null));};exports[_0xc2f2('0x4d')]=function(_0x37e4d2,_0x1b5489){return db['SugarcrmConfiguration'][_0xc2f2('0x48')]({'where':{'id':_0x37e4d2['params']['id']}})[_0xc2f2('0x25')](handleEntityNotFound(_0x1b5489,null))[_0xc2f2('0x25')](removeEntity(_0x1b5489,null))['catch'](handleError(_0x1b5489,null));};exports[_0xc2f2('0x4e')]=function(_0x3261db,_0x3173c3,_0x7899cf){var _0x491e35={};var _0x96cf92={};var _0x30e599;var _0x47a618;return db[_0xc2f2('0x2b')][_0xc2f2('0x4f')]({'where':{'id':_0x3261db['params']['id']}})['then'](handleEntityNotFound(_0x3173c3,null))[_0xc2f2('0x25')](function(_0xb69e5c){if(_0xb69e5c){_0x30e599=_0xb69e5c;_0x96cf92['model']=_['keys'](db['SugarcrmField'][_0xc2f2('0x2c')]);_0x96cf92[_0xc2f2('0x32')]=_[_0xc2f2('0x33')](_0x3261db[_0xc2f2('0x32')]);_0x96cf92[_0xc2f2('0x34')]=_['intersection'](_0x96cf92['model'],_0x96cf92['query']);_0x491e35[_0xc2f2('0x36')]=_[_0xc2f2('0x35')](_0x96cf92['model'],qs[_0xc2f2('0x37')](_0x3261db[_0xc2f2('0x32')][_0xc2f2('0x37')]));_0x491e35[_0xc2f2('0x36')]=_0x491e35[_0xc2f2('0x36')][_0xc2f2('0x38')]?_0x491e35[_0xc2f2('0x36')]:_0x96cf92[_0xc2f2('0x30')];_0x491e35[_0xc2f2('0x3a')]=qs[_0xc2f2('0x3b')](_0x3261db[_0xc2f2('0x32')][_0xc2f2('0x3b')]);_0x491e35['where']=qs[_0xc2f2('0x34')](_[_0xc2f2('0x3d')](_0x3261db[_0xc2f2('0x32')],_0x96cf92['filters']));if(_0x3261db[_0xc2f2('0x32')][_0xc2f2('0x3e')]){_0x491e35[_0xc2f2('0x3c')]=_[_0xc2f2('0x3f')](_0x491e35[_0xc2f2('0x3c')],{'$or':_[_0xc2f2('0x31')](_0x491e35[_0xc2f2('0x36')],function(_0x4eae72){var _0x31c594={};_0x31c594[_0x4eae72]={'$like':'%'+_0x3261db[_0xc2f2('0x32')][_0xc2f2('0x3e')]+'%'};return _0x31c594;})});}_0x491e35=_[_0xc2f2('0x3f')]({},_0x491e35,_0x3261db[_0xc2f2('0x41')]);return _0x30e599[_0xc2f2('0x4e')](_0x491e35);}})[_0xc2f2('0x25')](function(_0x223079){if(_0x223079){_0x47a618=_0x223079['length'];if(!_0x3261db[_0xc2f2('0x32')]['hasOwnProperty'](_0xc2f2('0x50'))){_0x491e35['limit']=qs['limit'](_0x3261db[_0xc2f2('0x32')][_0xc2f2('0x1f')]);_0x491e35[_0xc2f2('0x1e')]=qs[_0xc2f2('0x1e')](_0x3261db['query'][_0xc2f2('0x1e')]);}return _0x30e599[_0xc2f2('0x4e')](_0x491e35);}})[_0xc2f2('0x25')](function(_0xc37a5e){if(_0xc37a5e){return _0xc37a5e?{'count':_0x47a618,'rows':_0xc37a5e}:null;}})['then'](respondWithResult(_0x3173c3,null))[_0xc2f2('0x49')](handleError(_0x3173c3,null));};exports[_0xc2f2('0x51')]=function(_0x4870c8,_0x4cbe7e,_0x33e12f){var _0x33b9bf={};var _0x210846={};var _0x57a8de;var _0x21795c;return db[_0xc2f2('0x2b')]['findOne']({'where':{'id':_0x4870c8['params']['id']}})[_0xc2f2('0x25')](handleEntityNotFound(_0x4cbe7e,null))[_0xc2f2('0x25')](function(_0x4fd2b3){if(_0x4fd2b3){_0x57a8de=_0x4fd2b3;_0x210846[_0xc2f2('0x30')]=_[_0xc2f2('0x33')](db[_0xc2f2('0x52')][_0xc2f2('0x2c')]);_0x210846[_0xc2f2('0x32')]=_[_0xc2f2('0x33')](_0x4870c8[_0xc2f2('0x32')]);_0x210846[_0xc2f2('0x34')]=_['intersection'](_0x210846['model'],_0x210846['query']);_0x33b9bf[_0xc2f2('0x36')]=_['intersection'](_0x210846[_0xc2f2('0x30')],qs[_0xc2f2('0x37')](_0x4870c8[_0xc2f2('0x32')][_0xc2f2('0x37')]));_0x33b9bf[_0xc2f2('0x36')]=_0x33b9bf[_0xc2f2('0x36')][_0xc2f2('0x38')]?_0x33b9bf[_0xc2f2('0x36')]:_0x210846[_0xc2f2('0x30')];_0x33b9bf[_0xc2f2('0x3a')]=qs['sort'](_0x4870c8['query'][_0xc2f2('0x3b')]);_0x33b9bf[_0xc2f2('0x3c')]=qs[_0xc2f2('0x34')](_['pick'](_0x4870c8[_0xc2f2('0x32')],_0x210846[_0xc2f2('0x34')]));if(_0x4870c8[_0xc2f2('0x32')][_0xc2f2('0x3e')]){_0x33b9bf['where']=_[_0xc2f2('0x3f')](_0x33b9bf[_0xc2f2('0x3c')],{'$or':_['map'](_0x33b9bf[_0xc2f2('0x36')],function(_0x56b8f4){var _0x470950={};_0x470950[_0x56b8f4]={'$like':'%'+_0x4870c8[_0xc2f2('0x32')][_0xc2f2('0x3e')]+'%'};return _0x470950;})});}_0x33b9bf=_[_0xc2f2('0x3f')]({},_0x33b9bf,_0x4870c8[_0xc2f2('0x41')]);return _0x57a8de['getSubjects'](_0x33b9bf);}})[_0xc2f2('0x25')](function(_0x409629){if(_0x409629){_0x21795c=_0x409629[_0xc2f2('0x38')];if(!_0x4870c8[_0xc2f2('0x32')]['hasOwnProperty'](_0xc2f2('0x50'))){_0x33b9bf[_0xc2f2('0x1f')]=qs[_0xc2f2('0x1f')](_0x4870c8[_0xc2f2('0x32')]['limit']);_0x33b9bf[_0xc2f2('0x1e')]=qs[_0xc2f2('0x1e')](_0x4870c8[_0xc2f2('0x32')][_0xc2f2('0x1e')]);}return _0x57a8de[_0xc2f2('0x51')](_0x33b9bf);}})[_0xc2f2('0x25')](function(_0x7c9afe){if(_0x7c9afe){return _0x7c9afe?{'count':_0x21795c,'rows':_0x7c9afe}:null;}})['then'](respondWithResult(_0x4cbe7e,null))[_0xc2f2('0x49')](handleError(_0x4cbe7e,null));};exports[_0xc2f2('0x53')]=function(_0x4afaa1,_0x5a3113,_0x2d34a0){var _0x525a25={};var _0x1f83ae={};var _0x5a199f;var _0x45b7a1;return db['SugarcrmConfiguration'][_0xc2f2('0x4f')]({'where':{'id':_0x4afaa1[_0xc2f2('0x4c')]['id']}})[_0xc2f2('0x25')](handleEntityNotFound(_0x5a3113,null))['then'](function(_0xf0b5cc){if(_0xf0b5cc){_0x5a199f=_0xf0b5cc;_0x1f83ae[_0xc2f2('0x30')]=_[_0xc2f2('0x33')](db['SugarcrmField'][_0xc2f2('0x2c')]);_0x1f83ae[_0xc2f2('0x32')]=_['keys'](_0x4afaa1[_0xc2f2('0x32')]);_0x1f83ae[_0xc2f2('0x34')]=_[_0xc2f2('0x35')](_0x1f83ae[_0xc2f2('0x30')],_0x1f83ae[_0xc2f2('0x32')]);_0x525a25[_0xc2f2('0x36')]=_[_0xc2f2('0x35')](_0x1f83ae['model'],qs[_0xc2f2('0x37')](_0x4afaa1[_0xc2f2('0x32')][_0xc2f2('0x37')]));_0x525a25['attributes']=_0x525a25[_0xc2f2('0x36')][_0xc2f2('0x38')]?_0x525a25[_0xc2f2('0x36')]:_0x1f83ae['model'];_0x525a25[_0xc2f2('0x3a')]=qs[_0xc2f2('0x3b')](_0x4afaa1[_0xc2f2('0x32')]['sort']);_0x525a25['where']=qs['filters'](_['pick'](_0x4afaa1['query'],_0x1f83ae['filters']));if(_0x4afaa1['query'][_0xc2f2('0x3e')]){_0x525a25[_0xc2f2('0x3c')]=_['merge'](_0x525a25['where'],{'$or':_['map'](_0x525a25[_0xc2f2('0x36')],function(_0x13742a){var _0x1846b3={};_0x1846b3[_0x13742a]={'$like':'%'+_0x4afaa1[_0xc2f2('0x32')][_0xc2f2('0x3e')]+'%'};return _0x1846b3;})});}_0x525a25=_[_0xc2f2('0x3f')]({},_0x525a25,_0x4afaa1[_0xc2f2('0x41')]);return _0x5a199f['getDescriptions'](_0x525a25);}})[_0xc2f2('0x25')](function(_0xb5eedb){if(_0xb5eedb){_0x45b7a1=_0xb5eedb[_0xc2f2('0x38')];if(!_0x4afaa1[_0xc2f2('0x32')][_0xc2f2('0x39')](_0xc2f2('0x50'))){_0x525a25[_0xc2f2('0x1f')]=qs[_0xc2f2('0x1f')](_0x4afaa1[_0xc2f2('0x32')][_0xc2f2('0x1f')]);_0x525a25[_0xc2f2('0x1e')]=qs[_0xc2f2('0x1e')](_0x4afaa1[_0xc2f2('0x32')][_0xc2f2('0x1e')]);}return _0x5a199f[_0xc2f2('0x53')](_0x525a25);}})[_0xc2f2('0x25')](function(_0x5f4b67){if(_0x5f4b67){return _0x5f4b67?{'count':_0x45b7a1,'rows':_0x5f4b67}:null;}})[_0xc2f2('0x25')](respondWithResult(_0x5a3113,null))[_0xc2f2('0x49')](handleError(_0x5a3113,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b52d5bb..93af4e0 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 _0x739b=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x32ee51,_0x26d577){var _0x57d860=function(_0x55b534){while(--_0x55b534){_0x32ee51['push'](_0x32ee51['shift']());}};_0x57d860(++_0x26d577);}(_0x739b,0x1b0));var _0xb739=function(_0x36d768,_0x4075c4){_0x36d768=_0x36d768-0x0;var _0x4d4d90=_0x739b[_0x36d768];return _0x4d4d90;};'use strict';var _=require(_0xb739('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb739('0x1'));var moment=require(_0xb739('0x2'));var BPromise=require(_0xb739('0x3'));var rp=require(_0xb739('0x4'));var fs=require('fs');var path=require(_0xb739('0x5'));var rimraf=require(_0xb739('0x6'));var config=require(_0xb739('0x7'));var attributes=require(_0xb739('0x8'));module['exports']=function(_0x15dfa5,_0xc6b362){return _0x15dfa5[_0xb739('0x9')](_0xb739('0xa'),attributes,{'tableName':_0xb739('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc42f=['path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','util','../../config/logger','api','moment','bluebird'];(function(_0x58887a,_0x5e59d1){var _0x1a997d=function(_0x3a0c45){while(--_0x3a0c45){_0x58887a['push'](_0x58887a['shift']());}};_0x1a997d(++_0x5e59d1);}(_0xc42f,0xab));var _0xfc42=function(_0x3dcb1e,_0x464f4f){_0x3dcb1e=_0x3dcb1e-0x0;var _0x40c08e=_0xc42f[_0x3dcb1e];return _0x40c08e;};'use strict';var _=require('lodash');var util=require(_0xfc42('0x0'));var logger=require(_0xfc42('0x1'))(_0xfc42('0x2'));var moment=require(_0xfc42('0x3'));var BPromise=require(_0xfc42('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc42('0x5'));var rimraf=require(_0xfc42('0x6'));var config=require(_0xfc42('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xfc42('0x8')]=function(_0x4df648,_0x25c691){return _0x4df648[_0xfc42('0x9')](_0xfc42('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index cf82f43..843159c 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 _0xf31d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x568964,_0x38917d){var _0x4715b7=function(_0x1287a0){while(--_0x1287a0){_0x568964['push'](_0x568964['shift']());}};_0x4715b7(++_0x38917d);}(_0xf31d,0x111));var _0xdf31=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xf31d[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xdf31('0x0'));var util=require('util');var moment=require(_0xdf31('0x1'));var BPromise=require(_0xdf31('0x2'));var rs=require(_0xdf31('0x3'));var fs=require('fs');var Redis=require(_0xdf31('0x4'));var db=require(_0xdf31('0x5'))['db'];var utils=require(_0xdf31('0x6'));var logger=require(_0xdf31('0x7'))(_0xdf31('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf31('0x9'));var client=jayson[_0xdf31('0xa')][_0xdf31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114913,_0xdbf73,_0x2dc77f){return new BPromise(function(_0x4669ce,_0x17d3b4){return client[_0xdf31('0xc')](_0x114913,_0x2dc77f)[_0xdf31('0xd')](function(_0x4541a3){logger[_0xdf31('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xdbf73,'request\x20sent');logger[_0xdf31('0xf')](_0xdf31('0x10'),_0xdbf73,_0xdf31('0x11'),JSON[_0xdf31('0x12')](_0x4541a3));if(_0x4541a3[_0xdf31('0x13')]){if(_0x4541a3['error'][_0xdf31('0x14')]===0x1f4){logger['error'](_0xdf31('0x15'),_0xdbf73,_0x4541a3[_0xdf31('0x13')][_0xdf31('0x16')]);return _0x17d3b4(_0x4541a3[_0xdf31('0x13')]['message']);}logger[_0xdf31('0x13')](_0xdf31('0x15'),_0xdbf73,_0x4541a3[_0xdf31('0x13')]['message']);return _0x4669ce(_0x4541a3[_0xdf31('0x13')][_0xdf31('0x16')]);}else{logger[_0xdf31('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xdbf73,_0xdf31('0x11'));_0x4669ce(_0x4541a3[_0xdf31('0x17')][_0xdf31('0x16')]);}})[_0xdf31('0x18')](function(_0x464d47){logger[_0xdf31('0x13')](_0xdf31('0x15'),_0xdbf73,_0x464d47);_0x17d3b4(_0x464d47);});});} \ No newline at end of file +var _0x16ed=['request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x561755,_0x29010c){var _0x1c01d5=function(_0x5410c6){while(--_0x5410c6){_0x561755['push'](_0x561755['shift']());}};_0x1c01d5(++_0x29010c);}(_0x16ed,0x1a0));var _0xd16e=function(_0x23e3eb,_0x419ae8){_0x23e3eb=_0x23e3eb-0x0;var _0x1c9ab6=_0x16ed[_0x23e3eb];return _0x1c9ab6;};'use strict';var _=require(_0xd16e('0x0'));var util=require(_0xd16e('0x1'));var moment=require(_0xd16e('0x2'));var BPromise=require(_0xd16e('0x3'));var rs=require(_0xd16e('0x4'));var fs=require('fs');var Redis=require(_0xd16e('0x5'));var db=require(_0xd16e('0x6'))['db'];var utils=require(_0xd16e('0x7'));var logger=require('../../config/logger')(_0xd16e('0x8'));var config=require(_0xd16e('0x9'));var jayson=require(_0xd16e('0xa'));var client=jayson[_0xd16e('0xb')][_0xd16e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x586c18,_0x3fb80a,_0x52405f){return new BPromise(function(_0x3a5396,_0x42b181){return client[_0xd16e('0xd')](_0x586c18,_0x52405f)['then'](function(_0x2a0544){logger[_0xd16e('0xe')](_0xd16e('0xf'),_0x3fb80a,_0xd16e('0x10'));logger['debug'](_0xd16e('0x11'),_0x3fb80a,_0xd16e('0x10'),JSON[_0xd16e('0x12')](_0x2a0544));if(_0x2a0544[_0xd16e('0x13')]){if(_0x2a0544[_0xd16e('0x13')][_0xd16e('0x14')]===0x1f4){logger[_0xd16e('0x13')](_0xd16e('0xf'),_0x3fb80a,_0x2a0544[_0xd16e('0x13')][_0xd16e('0x15')]);return _0x42b181(_0x2a0544[_0xd16e('0x13')][_0xd16e('0x15')]);}logger[_0xd16e('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3fb80a,_0x2a0544['error']['message']);return _0x3a5396(_0x2a0544[_0xd16e('0x13')][_0xd16e('0x15')]);}else{logger[_0xd16e('0xe')](_0xd16e('0xf'),_0x3fb80a,_0xd16e('0x10'));_0x3a5396(_0x2a0544[_0xd16e('0x16')][_0xd16e('0x15')]);}})[_0xd16e('0x17')](function(_0x211637){logger[_0xd16e('0x13')](_0xd16e('0xf'),_0x3fb80a,_0x211637);_0x42b181(_0x211637);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b7796f4..c634824 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 _0xe6dc=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xe6dc,0x91));var _0xce6d=function(_0x36b6d5,_0x5837f2){_0x36b6d5=_0x36b6d5-0x0;var _0x2f493e=_0xe6dc[_0x36b6d5];return _0x2f493e;};'use strict';var multer=require(_0xce6d('0x0'));var util=require(_0xce6d('0x1'));var path=require('path');var timeout=require(_0xce6d('0x2'));var express=require(_0xce6d('0x3'));var router=express[_0xce6d('0x4')]();var fs_extra=require(_0xce6d('0x5'));var auth=require(_0xce6d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce6d('0x7'));var controller=require(_0xce6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xce6d('0x9')]('/:id',auth[_0xce6d('0xa')](),controller[_0xce6d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xce6d('0xc')]);router[_0xce6d('0xd')](_0xce6d('0xe'),auth[_0xce6d('0xa')](),controller[_0xce6d('0xf')]);router[_0xce6d('0x10')]('/:id',auth[_0xce6d('0xa')](),controller['destroy']);module[_0xce6d('0x11')]=router; \ No newline at end of file +var _0x33c7=['/:id','post','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x1f6856,_0x2146a7){var _0x1d7a85=function(_0x555441){while(--_0x555441){_0x1f6856['push'](_0x1f6856['shift']());}};_0x1d7a85(++_0x2146a7);}(_0x33c7,0x1ae));var _0x733c=function(_0x45071a,_0x406695){_0x45071a=_0x45071a-0x0;var _0x4502ca=_0x33c7[_0x45071a];return _0x4502ca;};'use strict';var multer=require('multer');var util=require(_0x733c('0x0'));var path=require(_0x733c('0x1'));var timeout=require(_0x733c('0x2'));var express=require(_0x733c('0x3'));var router=express[_0x733c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x733c('0x5'));var interaction=require(_0x733c('0x6'));var config=require(_0x733c('0x7'));var controller=require(_0x733c('0x8'));router[_0x733c('0x9')]('/',auth[_0x733c('0xa')](),controller[_0x733c('0xb')]);router[_0x733c('0x9')](_0x733c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x733c('0xd')]('/',auth[_0x733c('0xa')](),controller['create']);router[_0x733c('0xe')](_0x733c('0xc'),auth['isAuthenticated'](),controller[_0x733c('0xf')]);router[_0x733c('0x10')](_0x733c('0xc'),auth[_0x733c('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 78bc522..33a5dae 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 _0x929e=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x929e,0x18a));var _0xe929=function(_0x55a1f8,_0x4a8bf6){_0x55a1f8=_0x55a1f8-0x0;var _0x9a92e9=_0x929e[_0x55a1f8];return _0x9a92e9;};'use strict';var Sequelize=require(_0xe929('0x0'));module[_0xe929('0x1')]={'type':{'type':Sequelize[_0xe929('0x2')]('string',_0xe929('0x3'),'customVariable',_0xe929('0x4'),_0xe929('0x5')),'defaultValue':_0xe929('0x6')},'content':{'type':Sequelize[_0xe929('0x7')]},'key':{'type':Sequelize[_0xe929('0x7')]},'keyType':{'type':Sequelize[_0xe929('0x2')]('string','variable',_0xe929('0x8'))},'keyContent':{'type':Sequelize[_0xe929('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe929('0x7')]},'customField':{'type':Sequelize[_0xe929('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe929('0x7')]}}; \ No newline at end of file +var _0x4708=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x396ab6,_0x42b881){var _0xef2423=function(_0x5a26b7){while(--_0x5a26b7){_0x396ab6['push'](_0x396ab6['shift']());}};_0xef2423(++_0x42b881);}(_0x4708,0x13f));var _0x8470=function(_0x694b5e,_0x1609c8){_0x694b5e=_0x694b5e-0x0;var _0x19a418=_0x4708[_0x694b5e];return _0x19a418;};'use strict';var Sequelize=require(_0x8470('0x0'));module[_0x8470('0x1')]={'type':{'type':Sequelize[_0x8470('0x2')](_0x8470('0x3'),_0x8470('0x4'),_0x8470('0x5'),_0x8470('0x6'),_0x8470('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8470('0x8')]},'key':{'type':Sequelize[_0x8470('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8470('0x3'),_0x8470('0x4'),_0x8470('0x5'))},'keyContent':{'type':Sequelize[_0x8470('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8470('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5214738..82dfac3 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 _0xa7ee=['merge','VIRTUAL','options','then','findAll','show','params','intersection','includeAll','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x318e31,_0x1a8c88){var _0x512793=function(_0x33cbf0){while(--_0x33cbf0){_0x318e31['push'](_0x318e31['shift']());}};_0x512793(++_0x1a8c88);}(_0xa7ee,0x1ee));var _0xea7e=function(_0x3ca7a9,_0x4fc0c7){_0x3ca7a9=_0x3ca7a9-0x0;var _0x399428=_0xa7ee[_0x3ca7a9];return _0x399428;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require(_0xea7e('0x1'));var zipdir=require(_0xea7e('0x2'));var jsonpatch=require(_0xea7e('0x3'));var rp=require(_0xea7e('0x4'));var moment=require(_0xea7e('0x5'));var BPromise=require(_0xea7e('0x6'));var Mustache=require(_0xea7e('0x7'));var util=require(_0xea7e('0x8'));var path=require('path');var sox=require(_0xea7e('0x9'));var csv=require(_0xea7e('0xa'));var ejs=require(_0xea7e('0xb'));var fs=require('fs');var fs_extra=require(_0xea7e('0xc'));var _=require(_0xea7e('0xd'));var squel=require('squel');var crypto=require(_0xea7e('0xe'));var jsforce=require(_0xea7e('0xf'));var deskjs=require(_0xea7e('0x10'));var toCsv=require(_0xea7e('0xa'));var querystring=require(_0xea7e('0x11'));var Papa=require(_0xea7e('0x12'));var Redis=require(_0xea7e('0x13'));var authService=require(_0xea7e('0x14'));var qs=require(_0xea7e('0x15'));var as=require(_0xea7e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea7e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xea7e('0x18'));var licenseUtil=require(_0xea7e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58942a,_0x404b84){_0x404b84=_0x404b84||0xcc;return function(_0x2e0827){if(_0x2e0827){return _0x58942a[_0xea7e('0x1a')](_0x404b84);}return _0x58942a[_0xea7e('0x1b')](_0x404b84)['end']();};}function respondWithResult(_0x243383,_0x10fa87){_0x10fa87=_0x10fa87||0xc8;return function(_0x45b3b9){if(_0x45b3b9){return _0x243383['status'](_0x10fa87)[_0xea7e('0x1c')](_0x45b3b9);}};}function respondWithFilteredResult(_0xd27e80,_0x55047e){return function(_0x4f2675){if(_0x4f2675){var _0x38e088=typeof _0x55047e[_0xea7e('0x1d')]===_0xea7e('0x1e')&&typeof _0x55047e[_0xea7e('0x1f')]==='undefined';var _0x20c137=_0x4f2675[_0xea7e('0x20')];var _0x1c4597=_0x38e088?0x0:_0x55047e['offset'];var _0x52c987=_0x38e088?_0x4f2675[_0xea7e('0x20')]:_0x55047e['offset']+_0x55047e[_0xea7e('0x1f')];var _0x13b02c;if(_0x52c987>=_0x20c137){_0x52c987=_0x20c137;_0x13b02c=0xc8;}else{_0x13b02c=0xce;}_0xd27e80['status'](_0x13b02c);return _0xd27e80[_0xea7e('0x21')](_0xea7e('0x22'),_0x1c4597+'-'+_0x52c987+'/'+_0x20c137)['json'](_0x4f2675);}return null;};}function patchUpdates(_0x3a7d8d){return function(_0x58be42){try{jsonpatch[_0xea7e('0x23')](_0x58be42,_0x3a7d8d,!![]);}catch(_0x5b7ae8){return BPromise[_0xea7e('0x24')](_0x5b7ae8);}return _0x58be42[_0xea7e('0x25')]();};}function saveUpdates(_0x180e73,_0x262fb2){return function(_0x338cf7){if(_0x338cf7){return _0x338cf7[_0xea7e('0x26')](_0x180e73)['then'](function(_0x3d7ec8){return _0x3d7ec8;});}return null;};}function removeEntity(_0x75a582,_0x3ba979){return function(_0x16f599){if(_0x16f599){return _0x16f599[_0xea7e('0x27')]()['then'](function(){_0x75a582[_0xea7e('0x1b')](0xcc)[_0xea7e('0x28')]();});}};}function handleEntityNotFound(_0x33841d,_0x341c0e){return function(_0x52f5e5){if(!_0x52f5e5){_0x33841d['sendStatus'](0x194);}return _0x52f5e5;};}function handleError(_0x52e8fa,_0x1e148a){_0x1e148a=_0x1e148a||0x1f4;return function(_0x40e9ce){logger[_0xea7e('0x29')](_0x40e9ce[_0xea7e('0x2a')]);if(_0x40e9ce['name']){delete _0x40e9ce[_0xea7e('0x2b')];}_0x52e8fa['status'](_0x1e148a)[_0xea7e('0x2c')](_0x40e9ce);};}exports[_0xea7e('0x2d')]=function(_0x498020,_0x705366){var _0x97dce5={},_0x4de38b={},_0x34a6b9={'count':0x0,'rows':[]};var _0x2baace=_[_0xea7e('0x2e')](db[_0xea7e('0x2f')][_0xea7e('0x30')],function(_0x381f9f){return{'name':_0x381f9f[_0xea7e('0x31')],'type':_0x381f9f[_0xea7e('0x32')][_0xea7e('0x33')]};});_0x4de38b['model']=_[_0xea7e('0x2e')](_0x2baace,_0xea7e('0x2b'));_0x4de38b[_0xea7e('0x34')]=_[_0xea7e('0x35')](_0x498020[_0xea7e('0x34')]);_0x4de38b[_0xea7e('0x36')]=_['intersection'](_0x4de38b[_0xea7e('0x37')],_0x4de38b[_0xea7e('0x34')]);_0x97dce5[_0xea7e('0x38')]=_['intersection'](_0x4de38b[_0xea7e('0x37')],qs[_0xea7e('0x39')](_0x498020[_0xea7e('0x34')][_0xea7e('0x39')]));_0x97dce5['attributes']=_0x97dce5['attributes'][_0xea7e('0x3a')]?_0x97dce5['attributes']:_0x4de38b[_0xea7e('0x37')];if(!_0x498020[_0xea7e('0x34')][_0xea7e('0x3b')](_0xea7e('0x3c'))){_0x97dce5[_0xea7e('0x1f')]=qs['limit'](_0x498020[_0xea7e('0x34')][_0xea7e('0x1f')]);_0x97dce5['offset']=qs['offset'](_0x498020['query']['offset']);}_0x97dce5[_0xea7e('0x3d')]=qs[_0xea7e('0x3e')](_0x498020['query']['sort']);_0x97dce5['where']=qs[_0xea7e('0x36')](_[_0xea7e('0x3f')](_0x498020['query'],_0x4de38b[_0xea7e('0x36')]),_0x2baace);if(_0x498020[_0xea7e('0x34')][_0xea7e('0x40')]){_0x97dce5[_0xea7e('0x41')]=_[_0xea7e('0x42')](_0x97dce5[_0xea7e('0x41')],{'$or':_[_0xea7e('0x2e')](_0x2baace,function(_0x54f5ef){if(_0x54f5ef[_0xea7e('0x32')]!==_0xea7e('0x43')){var _0x2c2bea={};_0x2c2bea[_0x54f5ef[_0xea7e('0x2b')]]={'$like':'%'+_0x498020[_0xea7e('0x34')][_0xea7e('0x40')]+'%'};return _0x2c2bea;}})});}_0x97dce5=_['merge']({},_0x97dce5,_0x498020[_0xea7e('0x44')]);var _0x8bd231={'where':_0x97dce5[_0xea7e('0x41')]};return db['SugarcrmField'][_0xea7e('0x20')](_0x8bd231)[_0xea7e('0x45')](function(_0x1329a9){_0x34a6b9[_0xea7e('0x20')]=_0x1329a9;if(_0x498020['query']['includeAll']){_0x97dce5['include']=[{'all':!![]}];}return db[_0xea7e('0x2f')][_0xea7e('0x46')](_0x97dce5);})[_0xea7e('0x45')](function(_0x4b7771){_0x34a6b9['rows']=_0x4b7771;return _0x34a6b9;})[_0xea7e('0x45')](respondWithFilteredResult(_0x705366,_0x97dce5))['catch'](handleError(_0x705366,null));};exports[_0xea7e('0x47')]=function(_0xe45537,_0x54d516){var _0xe9b341={'raw':!![],'where':{'id':_0xe45537[_0xea7e('0x48')]['id']}},_0x2cfd04={};_0x2cfd04[_0xea7e('0x37')]=_[_0xea7e('0x35')](db['SugarcrmField'][_0xea7e('0x30')]);_0x2cfd04[_0xea7e('0x34')]=_['keys'](_0xe45537[_0xea7e('0x34')]);_0x2cfd04[_0xea7e('0x36')]=_[_0xea7e('0x49')](_0x2cfd04[_0xea7e('0x37')],_0x2cfd04[_0xea7e('0x34')]);_0xe9b341[_0xea7e('0x38')]=_[_0xea7e('0x49')](_0x2cfd04[_0xea7e('0x37')],qs[_0xea7e('0x39')](_0xe45537['query']['fields']));_0xe9b341[_0xea7e('0x38')]=_0xe9b341['attributes'][_0xea7e('0x3a')]?_0xe9b341[_0xea7e('0x38')]:_0x2cfd04[_0xea7e('0x37')];if(_0xe45537[_0xea7e('0x34')][_0xea7e('0x4a')]){_0xe9b341[_0xea7e('0x4b')]=[{'all':!![]}];}_0xe9b341=_[_0xea7e('0x42')]({},_0xe9b341,_0xe45537[_0xea7e('0x44')]);return db[_0xea7e('0x2f')][_0xea7e('0x4c')](_0xe9b341)[_0xea7e('0x45')](handleEntityNotFound(_0x54d516,null))[_0xea7e('0x45')](respondWithResult(_0x54d516,null))[_0xea7e('0x4d')](handleError(_0x54d516,null));};exports[_0xea7e('0x4e')]=function(_0x1ca920,_0x847c52){return db[_0xea7e('0x2f')][_0xea7e('0x4e')](_0x1ca920['body'],{})[_0xea7e('0x45')](respondWithResult(_0x847c52,0xc9))[_0xea7e('0x4d')](handleError(_0x847c52,null));};exports['update']=function(_0x5f2138,_0x313c41){if(_0x5f2138[_0xea7e('0x4f')]['id']){delete _0x5f2138[_0xea7e('0x4f')]['id'];}return db['SugarcrmField'][_0xea7e('0x4c')]({'where':{'id':_0x5f2138[_0xea7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x313c41,null))[_0xea7e('0x45')](saveUpdates(_0x5f2138['body'],null))[_0xea7e('0x45')](respondWithResult(_0x313c41,null))['catch'](handleError(_0x313c41,null));};exports[_0xea7e('0x27')]=function(_0x2abdf9,_0x5a7171){return db[_0xea7e('0x2f')]['find']({'where':{'id':_0x2abdf9['params']['id']}})[_0xea7e('0x45')](handleEntityNotFound(_0x5a7171,null))[_0xea7e('0x45')](removeEntity(_0x5a7171,null))[_0xea7e('0x4d')](handleError(_0x5a7171,null));}; \ No newline at end of file +var _0xc25c=['params','keys','rawAttributes','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SugarcrmField','fieldName','type','model','query','intersection','attributes','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x516b10,_0xee4f85){var _0x262dde=function(_0x5e0529){while(--_0x5e0529){_0x516b10['push'](_0x516b10['shift']());}};_0x262dde(++_0xee4f85);}(_0xc25c,0xe5));var _0xcc25=function(_0x27b589,_0x1ca5c6){_0x27b589=_0x27b589-0x0;var _0x1ba308=_0xc25c[_0x27b589];return _0x1ba308;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc25('0x0'));var zipdir=require(_0xcc25('0x1'));var jsonpatch=require(_0xcc25('0x2'));var rp=require(_0xcc25('0x3'));var moment=require(_0xcc25('0x4'));var BPromise=require(_0xcc25('0x5'));var Mustache=require(_0xcc25('0x6'));var util=require(_0xcc25('0x7'));var path=require(_0xcc25('0x8'));var sox=require(_0xcc25('0x9'));var csv=require(_0xcc25('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc25('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc25('0xc'));var jsforce=require(_0xcc25('0xd'));var deskjs=require(_0xcc25('0xe'));var toCsv=require(_0xcc25('0xa'));var querystring=require(_0xcc25('0xf'));var Papa=require(_0xcc25('0x10'));var Redis=require(_0xcc25('0x11'));var authService=require(_0xcc25('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcc25('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc25('0x14'))(_0xcc25('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcc25('0x16'));var db=require(_0xcc25('0x17'))['db'];function respondWithStatusCode(_0x45a037,_0x5cc1e4){_0x5cc1e4=_0x5cc1e4||0xcc;return function(_0x5c9f48){if(_0x5c9f48){return _0x45a037[_0xcc25('0x18')](_0x5cc1e4);}return _0x45a037[_0xcc25('0x19')](_0x5cc1e4)['end']();};}function respondWithResult(_0x5ac473,_0x3e89ff){_0x3e89ff=_0x3e89ff||0xc8;return function(_0x544193){if(_0x544193){return _0x5ac473[_0xcc25('0x19')](_0x3e89ff)[_0xcc25('0x1a')](_0x544193);}};}function respondWithFilteredResult(_0x11a9bd,_0x42b91d){return function(_0x5e0c8b){if(_0x5e0c8b){var _0x241140=typeof _0x42b91d[_0xcc25('0x1b')]===_0xcc25('0x1c')&&typeof _0x42b91d[_0xcc25('0x1d')]===_0xcc25('0x1c');var _0x33f2ba=_0x5e0c8b[_0xcc25('0x1e')];var _0x24442b=_0x241140?0x0:_0x42b91d[_0xcc25('0x1b')];var _0x17cdde=_0x241140?_0x5e0c8b[_0xcc25('0x1e')]:_0x42b91d['offset']+_0x42b91d[_0xcc25('0x1d')];var _0x506209;if(_0x17cdde>=_0x33f2ba){_0x17cdde=_0x33f2ba;_0x506209=0xc8;}else{_0x506209=0xce;}_0x11a9bd[_0xcc25('0x19')](_0x506209);return _0x11a9bd[_0xcc25('0x1f')](_0xcc25('0x20'),_0x24442b+'-'+_0x17cdde+'/'+_0x33f2ba)[_0xcc25('0x1a')](_0x5e0c8b);}return null;};}function patchUpdates(_0x425a66){return function(_0x3907f3){try{jsonpatch[_0xcc25('0x21')](_0x3907f3,_0x425a66,!![]);}catch(_0x5545f2){return BPromise[_0xcc25('0x22')](_0x5545f2);}return _0x3907f3[_0xcc25('0x23')]();};}function saveUpdates(_0x788bd,_0x5ceb94){return function(_0x47eef7){if(_0x47eef7){return _0x47eef7[_0xcc25('0x24')](_0x788bd)['then'](function(_0x4529f1){return _0x4529f1;});}return null;};}function removeEntity(_0x360b49,_0x1f4a58){return function(_0x3da2e5){if(_0x3da2e5){return _0x3da2e5[_0xcc25('0x25')]()[_0xcc25('0x26')](function(){_0x360b49[_0xcc25('0x19')](0xcc)[_0xcc25('0x27')]();});}};}function handleEntityNotFound(_0x433375,_0x4c9bca){return function(_0x462416){if(!_0x462416){_0x433375[_0xcc25('0x18')](0x194);}return _0x462416;};}function handleError(_0xe796cd,_0x58f7e7){_0x58f7e7=_0x58f7e7||0x1f4;return function(_0x236de7){logger[_0xcc25('0x28')](_0x236de7[_0xcc25('0x29')]);if(_0x236de7[_0xcc25('0x2a')]){delete _0x236de7[_0xcc25('0x2a')];}_0xe796cd['status'](_0x58f7e7)[_0xcc25('0x2b')](_0x236de7);};}exports[_0xcc25('0x2c')]=function(_0xac80b1,_0x284f32){var _0x1f0851={},_0x7a4f54={},_0x1218ed={'count':0x0,'rows':[]};var _0x36f84f=_[_0xcc25('0x2d')](db[_0xcc25('0x2e')]['rawAttributes'],function(_0x3f5059){return{'name':_0x3f5059[_0xcc25('0x2f')],'type':_0x3f5059[_0xcc25('0x30')]['key']};});_0x7a4f54[_0xcc25('0x31')]=_[_0xcc25('0x2d')](_0x36f84f,_0xcc25('0x2a'));_0x7a4f54[_0xcc25('0x32')]=_['keys'](_0xac80b1['query']);_0x7a4f54['filters']=_['intersection'](_0x7a4f54[_0xcc25('0x31')],_0x7a4f54['query']);_0x1f0851['attributes']=_[_0xcc25('0x33')](_0x7a4f54[_0xcc25('0x31')],qs['fields'](_0xac80b1[_0xcc25('0x32')]['fields']));_0x1f0851[_0xcc25('0x34')]=_0x1f0851[_0xcc25('0x34')][_0xcc25('0x35')]?_0x1f0851[_0xcc25('0x34')]:_0x7a4f54[_0xcc25('0x31')];if(!_0xac80b1[_0xcc25('0x32')]['hasOwnProperty'](_0xcc25('0x36'))){_0x1f0851[_0xcc25('0x1d')]=qs[_0xcc25('0x1d')](_0xac80b1[_0xcc25('0x32')][_0xcc25('0x1d')]);_0x1f0851['offset']=qs[_0xcc25('0x1b')](_0xac80b1[_0xcc25('0x32')][_0xcc25('0x1b')]);}_0x1f0851['order']=qs[_0xcc25('0x37')](_0xac80b1[_0xcc25('0x32')][_0xcc25('0x37')]);_0x1f0851[_0xcc25('0x38')]=qs[_0xcc25('0x39')](_[_0xcc25('0x3a')](_0xac80b1[_0xcc25('0x32')],_0x7a4f54['filters']),_0x36f84f);if(_0xac80b1[_0xcc25('0x32')][_0xcc25('0x3b')]){_0x1f0851[_0xcc25('0x38')]=_[_0xcc25('0x3c')](_0x1f0851[_0xcc25('0x38')],{'$or':_[_0xcc25('0x2d')](_0x36f84f,function(_0x2bb47c){if(_0x2bb47c['type']!=='VIRTUAL'){var _0x2775ec={};_0x2775ec[_0x2bb47c[_0xcc25('0x2a')]]={'$like':'%'+_0xac80b1[_0xcc25('0x32')][_0xcc25('0x3b')]+'%'};return _0x2775ec;}})});}_0x1f0851=_[_0xcc25('0x3c')]({},_0x1f0851,_0xac80b1[_0xcc25('0x3d')]);var _0x2e3fac={'where':_0x1f0851[_0xcc25('0x38')]};return db['SugarcrmField'][_0xcc25('0x1e')](_0x2e3fac)[_0xcc25('0x26')](function(_0x3d1507){_0x1218ed[_0xcc25('0x1e')]=_0x3d1507;if(_0xac80b1[_0xcc25('0x32')][_0xcc25('0x3e')]){_0x1f0851['include']=[{'all':!![]}];}return db[_0xcc25('0x2e')][_0xcc25('0x3f')](_0x1f0851);})[_0xcc25('0x26')](function(_0x7b8e84){_0x1218ed[_0xcc25('0x40')]=_0x7b8e84;return _0x1218ed;})['then'](respondWithFilteredResult(_0x284f32,_0x1f0851))[_0xcc25('0x41')](handleError(_0x284f32,null));};exports[_0xcc25('0x42')]=function(_0x54e71f,_0x380981){var _0x2c397a={'raw':!![],'where':{'id':_0x54e71f[_0xcc25('0x43')]['id']}},_0x237651={};_0x237651['model']=_[_0xcc25('0x44')](db[_0xcc25('0x2e')][_0xcc25('0x45')]);_0x237651[_0xcc25('0x32')]=_[_0xcc25('0x44')](_0x54e71f[_0xcc25('0x32')]);_0x237651[_0xcc25('0x39')]=_[_0xcc25('0x33')](_0x237651[_0xcc25('0x31')],_0x237651['query']);_0x2c397a[_0xcc25('0x34')]=_[_0xcc25('0x33')](_0x237651[_0xcc25('0x31')],qs['fields'](_0x54e71f['query']['fields']));_0x2c397a[_0xcc25('0x34')]=_0x2c397a[_0xcc25('0x34')][_0xcc25('0x35')]?_0x2c397a[_0xcc25('0x34')]:_0x237651[_0xcc25('0x31')];if(_0x54e71f[_0xcc25('0x32')]['includeAll']){_0x2c397a[_0xcc25('0x46')]=[{'all':!![]}];}_0x2c397a=_['merge']({},_0x2c397a,_0x54e71f['options']);return db[_0xcc25('0x2e')][_0xcc25('0x47')](_0x2c397a)[_0xcc25('0x26')](handleEntityNotFound(_0x380981,null))[_0xcc25('0x26')](respondWithResult(_0x380981,null))[_0xcc25('0x41')](handleError(_0x380981,null));};exports['create']=function(_0x30e392,_0xe24d2a){return db['SugarcrmField'][_0xcc25('0x48')](_0x30e392[_0xcc25('0x49')],{})[_0xcc25('0x26')](respondWithResult(_0xe24d2a,0xc9))[_0xcc25('0x41')](handleError(_0xe24d2a,null));};exports[_0xcc25('0x24')]=function(_0x4b483c,_0x1af28e){if(_0x4b483c['body']['id']){delete _0x4b483c[_0xcc25('0x49')]['id'];}return db[_0xcc25('0x2e')][_0xcc25('0x47')]({'where':{'id':_0x4b483c[_0xcc25('0x43')]['id']}})[_0xcc25('0x26')](handleEntityNotFound(_0x1af28e,null))[_0xcc25('0x26')](saveUpdates(_0x4b483c[_0xcc25('0x49')],null))['then'](respondWithResult(_0x1af28e,null))[_0xcc25('0x41')](handleError(_0x1af28e,null));};exports[_0xcc25('0x25')]=function(_0x2faa24,_0x29f35e){return db[_0xcc25('0x2e')][_0xcc25('0x47')]({'where':{'id':_0x2faa24[_0xcc25('0x43')]['id']}})[_0xcc25('0x26')](handleEntityNotFound(_0x29f35e,null))['then'](removeEntity(_0x29f35e,null))[_0xcc25('0x41')](handleError(_0x29f35e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 3aa3d5a..cc62ccd 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 _0x8831=['request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5e0b68,_0x5a4bbf){var _0x190b88=function(_0x4f216c){while(--_0x4f216c){_0x5e0b68['push'](_0x5e0b68['shift']());}};_0x190b88(++_0x5a4bbf);}(_0x8831,0x155));var _0x1883=function(_0xd58fc1,_0x1d931c){_0xd58fc1=_0xd58fc1-0x0;var _0xc71c40=_0x8831[_0xd58fc1];return _0xc71c40;};'use strict';var _=require(_0x1883('0x0'));var util=require('util');var logger=require(_0x1883('0x1'))(_0x1883('0x2'));var moment=require(_0x1883('0x3'));var BPromise=require('bluebird');var rp=require(_0x1883('0x4'));var fs=require('fs');var path=require(_0x1883('0x5'));var rimraf=require(_0x1883('0x6'));var config=require(_0x1883('0x7'));var attributes=require(_0x1883('0x8'));module[_0x1883('0x9')]=function(_0x590909,_0x4b611a){return _0x590909[_0x1883('0xa')]('SugarcrmField',attributes,{'tableName':_0x1883('0xb'),'paranoid':![],'indexes':[{'name':_0x1883('0xc'),'fields':[_0x1883('0xd'),_0x1883('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86a4=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ff6be,_0x3f4984){var _0x44e2dd=function(_0x5d978e){while(--_0x5d978e){_0x2ff6be['push'](_0x2ff6be['shift']());}};_0x44e2dd(++_0x3f4984);}(_0x86a4,0x6a));var _0x486a=function(_0x378249,_0x34c802){_0x378249=_0x378249-0x0;var _0x2b92c2=_0x86a4[_0x378249];return _0x2b92c2;};'use strict';var _=require(_0x486a('0x0'));var util=require('util');var logger=require(_0x486a('0x1'))(_0x486a('0x2'));var moment=require(_0x486a('0x3'));var BPromise=require(_0x486a('0x4'));var rp=require(_0x486a('0x5'));var fs=require('fs');var path=require(_0x486a('0x6'));var rimraf=require(_0x486a('0x7'));var config=require(_0x486a('0x8'));var attributes=require(_0x486a('0x9'));module[_0x486a('0xa')]=function(_0x37cbfa,_0x1772a7){return _0x37cbfa[_0x486a('0xb')](_0x486a('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x486a('0xd'),'fields':[_0x486a('0xe'),_0x486a('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 313718c..692441f 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 _0x74c6=['SugarcrmField,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','message'];(function(_0x57c0b9,_0x58e04a){var _0xe65535=function(_0x130a6b){while(--_0x130a6b){_0x57c0b9['push'](_0x57c0b9['shift']());}};_0xe65535(++_0x58e04a);}(_0x74c6,0x16a));var _0x674c=function(_0x72d336,_0x238cab){_0x72d336=_0x72d336-0x0;var _0x36b2a0=_0x74c6[_0x72d336];return _0x36b2a0;};'use strict';var _=require(_0x674c('0x0'));var util=require(_0x674c('0x1'));var moment=require(_0x674c('0x2'));var BPromise=require('bluebird');var rs=require(_0x674c('0x3'));var fs=require('fs');var Redis=require(_0x674c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x674c('0x5'));var logger=require(_0x674c('0x6'))(_0x674c('0x7'));var config=require(_0x674c('0x8'));var jayson=require(_0x674c('0x9'));var client=jayson['client'][_0x674c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5309e9,_0x30eae1,_0x3cba54){return new BPromise(function(_0x4d5964,_0x526381){return client[_0x674c('0xb')](_0x5309e9,_0x3cba54)[_0x674c('0xc')](function(_0x3a5e1c){logger[_0x674c('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x30eae1,_0x674c('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x30eae1,'request\x20sent',JSON['stringify'](_0x3a5e1c));if(_0x3a5e1c[_0x674c('0xf')]){if(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x10')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x30eae1,_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);return _0x526381(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);}logger[_0x674c('0xf')](_0x674c('0x12'),_0x30eae1,_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);return _0x4d5964(_0x3a5e1c[_0x674c('0xf')][_0x674c('0x11')]);}else{logger[_0x674c('0xd')](_0x674c('0x12'),_0x30eae1,_0x674c('0xe'));_0x4d5964(_0x3a5e1c['result'][_0x674c('0x11')]);}})[_0x674c('0x13')](function(_0x2f1a25){logger[_0x674c('0xf')](_0x674c('0x12'),_0x30eae1,_0x2f1a25);_0x526381(_0x2f1a25);});});} \ No newline at end of file +var _0x6b80=['error','code','message','result','catch','bluebird','ioredis','../../config/logger','jayson/promise','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x4ba5fa,_0x128daf){var _0x3edafe=function(_0x221188){while(--_0x221188){_0x4ba5fa['push'](_0x4ba5fa['shift']());}};_0x3edafe(++_0x128daf);}(_0x6b80,0x95));var _0x06b8=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x6b80[_0x216799];return _0x3661c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x06b8('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b8('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06b8('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06b8('0x3'));var client=jayson['client'][_0x06b8('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x2d0289,_0x2f4acb,_0x42e13c){return new BPromise(function(_0x25ca10,_0x787f34){return client['request'](_0x2d0289,_0x42e13c)[_0x06b8('0x5')](function(_0x585577){logger[_0x06b8('0x6')](_0x06b8('0x7'),_0x2f4acb,'request\x20sent');logger[_0x06b8('0x8')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2f4acb,_0x06b8('0x9'),JSON[_0x06b8('0xa')](_0x585577));if(_0x585577[_0x06b8('0xb')]){if(_0x585577[_0x06b8('0xb')][_0x06b8('0xc')]===0x1f4){logger[_0x06b8('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x2f4acb,_0x585577[_0x06b8('0xb')]['message']);return _0x787f34(_0x585577[_0x06b8('0xb')][_0x06b8('0xd')]);}logger[_0x06b8('0xb')](_0x06b8('0x7'),_0x2f4acb,_0x585577[_0x06b8('0xb')]['message']);return _0x25ca10(_0x585577[_0x06b8('0xb')][_0x06b8('0xd')]);}else{logger[_0x06b8('0x6')]('SugarcrmField,\x20%s,\x20%s',_0x2f4acb,_0x06b8('0x9'));_0x25ca10(_0x585577[_0x06b8('0xe')][_0x06b8('0xd')]);}})[_0x06b8('0xf')](function(_0x56bad2){logger['error'](_0x06b8('0x7'),_0x2f4acb,_0x56bad2);_0x787f34(_0x56bad2);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index bb636e8..93ec4f3 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 _0x7531=['../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7531,0x69));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var path=require(_0x1753('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1753('0x3'));var auth=require(_0x1753('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1753('0x5'));var controller=require(_0x1753('0x6'));router['get']('/',auth[_0x1753('0x7')](),controller[_0x1753('0x8')]);router[_0x1753('0x9')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0xb')]);router[_0x1753('0x9')]('/:id/configurations',auth[_0x1753('0x7')](),controller[_0x1753('0xc')]);router[_0x1753('0x9')](_0x1753('0xd'),auth[_0x1753('0x7')](),controller[_0x1753('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1753('0xf')]);router[_0x1753('0x10')](_0x1753('0x11'),auth[_0x1753('0x7')](),controller[_0x1753('0x12')]);router[_0x1753('0x13')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0x14')]);router['delete'](_0x1753('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1753('0x15')]=router; \ No newline at end of file +var _0xd20f=['get','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','isAuthenticated','index'];(function(_0x2aa323,_0x1c492b){var _0x17fcab=function(_0x261146){while(--_0x261146){_0x2aa323['push'](_0x2aa323['shift']());}};_0x17fcab(++_0x1c492b);}(_0xd20f,0xbf));var _0xfd20=function(_0x2c3650,_0x1d47d9){_0x2c3650=_0x2c3650-0x0;var _0x3729e8=_0xd20f[_0x2c3650];return _0x3729e8;};'use strict';var multer=require(_0xfd20('0x0'));var util=require(_0xfd20('0x1'));var path=require('path');var timeout=require(_0xfd20('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfd20('0x3'));var auth=require(_0xfd20('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xfd20('0x5')](),controller[_0xfd20('0x6')]);router[_0xfd20('0x7')](_0xfd20('0x8'),auth[_0xfd20('0x5')](),controller[_0xfd20('0x9')]);router[_0xfd20('0x7')](_0xfd20('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xfd20('0x7')](_0xfd20('0xb'),auth[_0xfd20('0x5')](),controller[_0xfd20('0xc')]);router[_0xfd20('0xd')]('/',auth[_0xfd20('0x5')](),controller['create']);router[_0xfd20('0xd')](_0xfd20('0xa'),auth[_0xfd20('0x5')](),controller[_0xfd20('0xe')]);router[_0xfd20('0xf')](_0xfd20('0x8'),auth[_0xfd20('0x5')](),controller['update']);router[_0xfd20('0x10')](_0xfd20('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xfd20('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 106a895..e3ccfc9 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 _0x83aa=['exports','STRING','HelpDesk','sequelize'];(function(_0xbd0c3d,_0x1f4957){var _0x53e1ff=function(_0x5aa9ff){while(--_0x5aa9ff){_0xbd0c3d['push'](_0xbd0c3d['shift']());}};_0x53e1ff(++_0x1f4957);}(_0x83aa,0x8f));var _0xa83a=function(_0x27ea81,_0x12a73f){_0x27ea81=_0x27ea81-0x0;var _0x57ccc0=_0x83aa[_0x27ea81];return _0x57ccc0;};'use strict';var Sequelize=require(_0xa83a('0x0'));module[_0xa83a('0x1')]={'name':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![],'defaultValue':_0xa83a('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa83a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x494e=['exports','STRING','HelpDesk'];(function(_0x4ecdf1,_0x2625df){var _0x4bae39=function(_0x5a28a6){while(--_0x5a28a6){_0x4ecdf1['push'](_0x4ecdf1['shift']());}};_0x4bae39(++_0x2625df);}(_0x494e,0x84));var _0xe494=function(_0x40064b,_0x507aa8){_0x40064b=_0x40064b-0x0;var _0x2bca87=_0x494e[_0x40064b];return _0x2bca87;};'use strict';var Sequelize=require('sequelize');module[_0xe494('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe494('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe494('0x1')],'allowNull':![],'defaultValue':_0xe494('0x2')},'remoteUri':{'type':Sequelize[_0xe494('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe494('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe494('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 5fd7e28..f91ed7a 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 _0xc06e=['attributes','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','include','findAll','show','keys','includeAll','find','catch','create','body','params','findOne','VtigerConfiguration','order','sort','pick','getConfigurations','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','substring','format','GET','success','POST','login','result','describe','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','filters','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc06e,0x1e6));var _0xec06=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xc06e[_0x512c83];return _0x1f7f25;};'use strict';var emlformat=require(_0xec06('0x0'));var rimraf=require(_0xec06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec06('0x2'));var rp=require(_0xec06('0x3'));var moment=require('moment');var BPromise=require(_0xec06('0x4'));var Mustache=require('mustache');var util=require(_0xec06('0x5'));var path=require('path');var sox=require(_0xec06('0x6'));var csv=require(_0xec06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec06('0x8'));var squel=require(_0xec06('0x9'));var crypto=require(_0xec06('0xa'));var jsforce=require(_0xec06('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec06('0xc'));var Redis=require(_0xec06('0xd'));var authService=require(_0xec06('0xe'));var qs=require(_0xec06('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec06('0x10'));var logger=require(_0xec06('0x11'))('api');var utils=require(_0xec06('0x12'));var config=require(_0xec06('0x13'));var licenseUtil=require(_0xec06('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xec06('0x15'));function respondWithStatusCode(_0x1541ed,_0x52f383){_0x52f383=_0x52f383||0xcc;return function(_0x488bc9){if(_0x488bc9){return _0x1541ed['sendStatus'](_0x52f383);}return _0x1541ed[_0xec06('0x16')](_0x52f383)[_0xec06('0x17')]();};}function respondWithResult(_0x4fd410,_0x5103a1){_0x5103a1=_0x5103a1||0xc8;return function(_0x1d7489){if(_0x1d7489){return _0x4fd410[_0xec06('0x16')](_0x5103a1)[_0xec06('0x18')](_0x1d7489);}};}function respondWithFilteredResult(_0x34b274,_0x5e3e31){return function(_0x533b63){if(_0x533b63){var _0x35fd9f=typeof _0x5e3e31[_0xec06('0x19')]==='undefined'&&typeof _0x5e3e31[_0xec06('0x1a')]===_0xec06('0x1b');var _0x42d353=_0x533b63[_0xec06('0x1c')];var _0x5a75f3=_0x35fd9f?0x0:_0x5e3e31[_0xec06('0x19')];var _0x440dd9=_0x35fd9f?_0x533b63[_0xec06('0x1c')]:_0x5e3e31[_0xec06('0x19')]+_0x5e3e31[_0xec06('0x1a')];var _0x5c8898;if(_0x440dd9>=_0x42d353){_0x440dd9=_0x42d353;_0x5c8898=0xc8;}else{_0x5c8898=0xce;}_0x34b274[_0xec06('0x16')](_0x5c8898);return _0x34b274['set'](_0xec06('0x1d'),_0x5a75f3+'-'+_0x440dd9+'/'+_0x42d353)['json'](_0x533b63);}return null;};}function patchUpdates(_0x1caa3f){return function(_0x255ff){try{jsonpatch[_0xec06('0x1e')](_0x255ff,_0x1caa3f,!![]);}catch(_0x444586){return BPromise[_0xec06('0x1f')](_0x444586);}return _0x255ff['save']();};}function saveUpdates(_0x1e134f,_0xcbdf00){return function(_0x4acb22){if(_0x4acb22){return _0x4acb22[_0xec06('0x20')](_0x1e134f)[_0xec06('0x21')](function(_0x3098a5){return _0x3098a5;});}return null;};}function removeEntity(_0x2500eb,_0x589d60){return function(_0x5b3e97){if(_0x5b3e97){return _0x5b3e97[_0xec06('0x22')]()[_0xec06('0x21')](function(){_0x2500eb[_0xec06('0x16')](0xcc)[_0xec06('0x17')]();});}};}function handleEntityNotFound(_0x1ca5a7,_0x41210a){return function(_0x13ae1a){if(!_0x13ae1a){_0x1ca5a7[_0xec06('0x23')](0x194);}return _0x13ae1a;};}function handleError(_0x30529d,_0xd9daa5){_0xd9daa5=_0xd9daa5||0x1f4;return function(_0x4ef5d7){logger[_0xec06('0x24')](_0x4ef5d7['stack']);if(_0x4ef5d7['name']){delete _0x4ef5d7[_0xec06('0x25')];}_0x30529d[_0xec06('0x16')](_0xd9daa5)[_0xec06('0x26')](_0x4ef5d7);};}exports[_0xec06('0x27')]=function(_0x4d9381,_0x360cdc){var _0x593cab={},_0x2da2ce={},_0x4b5d39={'count':0x0,'rows':[]};var _0x26e633=_[_0xec06('0x28')](db[_0xec06('0x29')][_0xec06('0x2a')],function(_0x295a3c){return{'name':_0x295a3c[_0xec06('0x2b')],'type':_0x295a3c[_0xec06('0x2c')]['key']};});_0x2da2ce[_0xec06('0x2d')]=_[_0xec06('0x28')](_0x26e633,'name');_0x2da2ce[_0xec06('0x2e')]=_['keys'](_0x4d9381[_0xec06('0x2e')]);_0x2da2ce[_0xec06('0x2f')]=_[_0xec06('0x30')](_0x2da2ce['model'],_0x2da2ce['query']);_0x593cab[_0xec06('0x31')]=_[_0xec06('0x30')](_0x2da2ce['model'],qs[_0xec06('0x32')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x32')]));_0x593cab[_0xec06('0x31')]=_0x593cab['attributes'][_0xec06('0x33')]?_0x593cab['attributes']:_0x2da2ce[_0xec06('0x2d')];if(!_0x4d9381[_0xec06('0x2e')][_0xec06('0x34')](_0xec06('0x35'))){_0x593cab[_0xec06('0x1a')]=qs[_0xec06('0x1a')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x1a')]);_0x593cab['offset']=qs[_0xec06('0x19')](_0x4d9381[_0xec06('0x2e')][_0xec06('0x19')]);}_0x593cab['order']=qs['sort'](_0x4d9381[_0xec06('0x2e')]['sort']);_0x593cab[_0xec06('0x36')]=qs[_0xec06('0x2f')](_['pick'](_0x4d9381[_0xec06('0x2e')],_0x2da2ce[_0xec06('0x2f')]),_0x26e633);if(_0x4d9381[_0xec06('0x2e')]['filter']){_0x593cab[_0xec06('0x36')]=_[_0xec06('0x37')](_0x593cab[_0xec06('0x36')],{'$or':_[_0xec06('0x28')](_0x26e633,function(_0x5cb295){if(_0x5cb295[_0xec06('0x2c')]!==_0xec06('0x38')){var _0x50f74f={};_0x50f74f[_0x5cb295[_0xec06('0x25')]]={'$like':'%'+_0x4d9381[_0xec06('0x2e')][_0xec06('0x39')]+'%'};return _0x50f74f;}})});}_0x593cab=_['merge']({},_0x593cab,_0x4d9381[_0xec06('0x3a')]);var _0x4aa141={'where':_0x593cab[_0xec06('0x36')]};return db['VtigerAccount'][_0xec06('0x1c')](_0x4aa141)['then'](function(_0x77094d){_0x4b5d39[_0xec06('0x1c')]=_0x77094d;if(_0x4d9381[_0xec06('0x2e')]['includeAll']){_0x593cab[_0xec06('0x3b')]=[{'all':!![]}];}return db[_0xec06('0x29')][_0xec06('0x3c')](_0x593cab);})[_0xec06('0x21')](function(_0xa09010){_0x4b5d39['rows']=_0xa09010;return _0x4b5d39;})['then'](respondWithFilteredResult(_0x360cdc,_0x593cab))['catch'](handleError(_0x360cdc,null));};exports[_0xec06('0x3d')]=function(_0x127b91,_0xf0e13f){var _0x4c4eb2={'raw':![],'where':{'id':_0x127b91['params']['id']}},_0x1abcff={};_0x1abcff['model']=_[_0xec06('0x3e')](db[_0xec06('0x29')][_0xec06('0x2a')]);_0x1abcff[_0xec06('0x2e')]=_['keys'](_0x127b91[_0xec06('0x2e')]);_0x1abcff['filters']=_[_0xec06('0x30')](_0x1abcff[_0xec06('0x2d')],_0x1abcff[_0xec06('0x2e')]);_0x4c4eb2[_0xec06('0x31')]=_[_0xec06('0x30')](_0x1abcff[_0xec06('0x2d')],qs[_0xec06('0x32')](_0x127b91[_0xec06('0x2e')][_0xec06('0x32')]));_0x4c4eb2[_0xec06('0x31')]=_0x4c4eb2[_0xec06('0x31')]['length']?_0x4c4eb2['attributes']:_0x1abcff[_0xec06('0x2d')];if(_0x127b91[_0xec06('0x2e')][_0xec06('0x3f')]){_0x4c4eb2[_0xec06('0x3b')]=[{'all':!![]}];}_0x4c4eb2=_[_0xec06('0x37')]({},_0x4c4eb2,_0x127b91[_0xec06('0x3a')]);return db[_0xec06('0x29')][_0xec06('0x40')](_0x4c4eb2)[_0xec06('0x21')](handleEntityNotFound(_0xf0e13f,null))[_0xec06('0x21')](respondWithResult(_0xf0e13f,null))[_0xec06('0x41')](handleError(_0xf0e13f,null));};exports[_0xec06('0x42')]=function(_0x5cfc72,_0x16992f){return db['VtigerAccount']['create'](_0x5cfc72['body'],{})[_0xec06('0x21')](respondWithResult(_0x16992f,0xc9))[_0xec06('0x41')](handleError(_0x16992f,null));};exports[_0xec06('0x20')]=function(_0x3dbd5f,_0x10d344){if(_0x3dbd5f[_0xec06('0x43')]['id']){delete _0x3dbd5f['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x3dbd5f[_0xec06('0x44')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x10d344,null))['then'](saveUpdates(_0x3dbd5f[_0xec06('0x43')],null))[_0xec06('0x21')](respondWithResult(_0x10d344,null))[_0xec06('0x41')](handleError(_0x10d344,null));};exports[_0xec06('0x22')]=function(_0x437336,_0x353b28){return db[_0xec06('0x29')][_0xec06('0x40')]({'where':{'id':_0x437336[_0xec06('0x44')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x353b28,null))[_0xec06('0x21')](removeEntity(_0x353b28,null))[_0xec06('0x41')](handleError(_0x353b28,null));};exports['getConfigurations']=function(_0x28ecae,_0x403a61,_0x4823dc){var _0x703588={};var _0x4ccd5f={};var _0x4ffc9b;var _0x39de9b;return db[_0xec06('0x29')][_0xec06('0x45')]({'where':{'id':_0x28ecae[_0xec06('0x44')]['id']}})['then'](handleEntityNotFound(_0x403a61,null))[_0xec06('0x21')](function(_0x1f7338){if(_0x1f7338){_0x4ffc9b=_0x1f7338;_0x4ccd5f[_0xec06('0x2d')]=_[_0xec06('0x3e')](db[_0xec06('0x46')][_0xec06('0x2a')]);_0x4ccd5f[_0xec06('0x2e')]=_['keys'](_0x28ecae[_0xec06('0x2e')]);_0x4ccd5f[_0xec06('0x2f')]=_[_0xec06('0x30')](_0x4ccd5f[_0xec06('0x2d')],_0x4ccd5f[_0xec06('0x2e')]);_0x703588[_0xec06('0x31')]=_['intersection'](_0x4ccd5f['model'],qs[_0xec06('0x32')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x32')]));_0x703588[_0xec06('0x31')]=_0x703588['attributes'][_0xec06('0x33')]?_0x703588[_0xec06('0x31')]:_0x4ccd5f['model'];_0x703588[_0xec06('0x47')]=qs[_0xec06('0x48')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x48')]);_0x703588['where']=qs[_0xec06('0x2f')](_[_0xec06('0x49')](_0x28ecae[_0xec06('0x2e')],_0x4ccd5f['filters']));if(_0x28ecae['query'][_0xec06('0x39')]){_0x703588[_0xec06('0x36')]=_[_0xec06('0x37')](_0x703588['where'],{'$or':_['map'](_0x703588[_0xec06('0x31')],function(_0x3c305d){var _0x35fbaf={};_0x35fbaf[_0x3c305d]={'$like':'%'+_0x28ecae[_0xec06('0x2e')][_0xec06('0x39')]+'%'};return _0x35fbaf;})});}_0x703588=_[_0xec06('0x37')]({},_0x703588,_0x28ecae[_0xec06('0x3a')]);return _0x4ffc9b['getConfigurations'](_0x703588);}})[_0xec06('0x21')](function(_0x4f69c4){if(_0x4f69c4){_0x39de9b=_0x4f69c4['length'];if(!_0x28ecae[_0xec06('0x2e')]['hasOwnProperty'](_0xec06('0x35'))){_0x703588[_0xec06('0x1a')]=qs[_0xec06('0x1a')](_0x28ecae[_0xec06('0x2e')][_0xec06('0x1a')]);_0x703588[_0xec06('0x19')]=qs['offset'](_0x28ecae[_0xec06('0x2e')][_0xec06('0x19')]);}return _0x4ffc9b[_0xec06('0x4a')](_0x703588);}})[_0xec06('0x21')](function(_0x3b1bcb){if(_0x3b1bcb){return _0x3b1bcb?{'count':_0x39de9b,'rows':_0x3b1bcb}:null;}})['then'](respondWithResult(_0x403a61,null))[_0xec06('0x41')](handleError(_0x403a61,null));};exports['addConfiguration']=function(_0x26d4f1,_0x5eca6e,_0x13f543){if(_0x26d4f1['body']['id']){delete _0x26d4f1[_0xec06('0x43')]['id'];}return db[_0xec06('0x29')]['findOne']({'where':{'id':_0x26d4f1[_0xec06('0x44')]['id']}})['then'](handleEntityNotFound(_0x5eca6e,null))['then'](function(_0x23f79c){if(_0x23f79c){_0x26d4f1['body']['AccountId']=_0x23f79c['id'];_0x26d4f1[_0xec06('0x43')][_0xec06('0x4b')]=integrations['getSubjects'](_0x26d4f1[_0xec06('0x43')][_0xec06('0x4c')],_0x26d4f1[_0xec06('0x43')][_0xec06('0x2c')]);_0x26d4f1[_0xec06('0x43')][_0xec06('0x4d')]=integrations[_0xec06('0x4e')](_0x26d4f1[_0xec06('0x43')][_0xec06('0x4c')],_0x26d4f1[_0xec06('0x43')][_0xec06('0x2c')]);return db[_0xec06('0x46')][_0xec06('0x42')](_0x26d4f1[_0xec06('0x43')],{'include':[{'model':db[_0xec06('0x4f')],'as':_0xec06('0x4b')},{'model':db[_0xec06('0x4f')],'as':_0xec06('0x4d')}]});}return null;})[_0xec06('0x21')](respondWithResult(_0x5eca6e,null))['catch'](handleError(_0x5eca6e,null));};var md5=require(_0xec06('0x50'));exports[_0xec06('0x51')]=function(_0x43d518,_0x3ff4a1,_0x497717){var _0x48a91a=null;var _0x2d83aa=null;var _0x4b905e=null;var _0x49ff9b=null;var _0x5ee701='';return db[_0xec06('0x29')][_0xec06('0x45')]({'where':{'id':_0x43d518[_0xec06('0x44')]['id']},'attributes':['id',_0xec06('0x25'),_0xec06('0x52'),'description',_0xec06('0x53'),_0xec06('0x54'),'serverUrl','accessKey']})[_0xec06('0x21')](handleEntityNotFound(_0x3ff4a1,null))[_0xec06('0x21')](function(_0x498fb6){if(_0x498fb6){_0x48a91a=_0x498fb6[_0xec06('0x52')];_0x2d83aa=_0x498fb6[_0xec06('0x55')];_0x4b905e=_0x498fb6['moduleName'];_0x5ee701=_0x498fb6[_0xec06('0x54')];var _0xe9b4cf=_0x5ee701['slice'](-0x1);if(_0xe9b4cf==='/'){_0x5ee701=_0x5ee701[_0xec06('0x56')](0x0,_0x5ee701['lastIndexOf'](_0xe9b4cf));}_0x49ff9b=util[_0xec06('0x57')]('%s/webservice.php',_0x5ee701);var _0x58ae96={'method':_0xec06('0x58'),'uri':_0x49ff9b,'qs':{'operation':'getchallenge','username':_0x498fb6[_0xec06('0x52')]},'json':!![]};return rp(_0x58ae96);}})['then'](function(_0x3fcb13){if(_0x3fcb13[_0xec06('0x59')]){var _0x16c3ec={'method':_0xec06('0x5a'),'uri':_0x49ff9b,'form':{'operation':_0xec06('0x5b'),'username':_0x48a91a,'accessKey':md5(_0x3fcb13[_0xec06('0x5c')]['token']+_0x2d83aa)},'json':!![]};return rp(_0x16c3ec);}})[_0xec06('0x21')](function(_0x8e6ecc){if(_0x8e6ecc['success']){var _0x56e504={'method':_0xec06('0x58'),'uri':_0x49ff9b,'qs':{'operation':_0xec06('0x5d'),'username':_0x48a91a,'sessionName':_0x8e6ecc[_0xec06('0x5c')]['sessionName'],'elementType':_0x4b905e},'json':!![]};return rp(_0x56e504);}})['then'](function(_0x1c5a01){if(_0x1c5a01[_0xec06('0x59')]){var _0x48efb8=['autogenerated','reference','owner'];_[_0xec06('0x5e')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x44f168){return _0x48efb8[_0xec06('0x5f')](_0x44f168['type'][_0xec06('0x25')]);});_[_0xec06('0x5e')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x4b62f3){return _0x4b62f3[_0xec06('0x60')]==='false';});return{'count':_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')]['length'],'rows':_[_0xec06('0x28')](_0x1c5a01[_0xec06('0x5c')][_0xec06('0x32')],function(_0x593644){return{'id':_0x593644[_0xec06('0x25')],'name':_0x593644[_0xec06('0x61')],'custom':_[_0xec06('0x62')](_0x593644[_0xec06('0x25')],_0xec06('0x63'))?!![]:![],'options':_0x593644[_0xec06('0x2c')]['name']===_0xec06('0x64')&&_0x593644[_0xec06('0x2c')][_0xec06('0x65')][_0xec06('0x33')]>0x0?_[_0xec06('0x28')](_0x593644['type'][_0xec06('0x65')],function(_0x56ccd6){return{'name':_0x56ccd6['label'],'value':_0x56ccd6['value']};}):[]};})};}})[_0xec06('0x21')](respondWithResult(_0x3ff4a1,null))[_0xec06('0x41')](function(_0x1bb626){console['log'](_0xec06('0x66')+_0x1bb626);var _0x5dffb3=_0x43d518['query'][_0xec06('0x67')]?0x1f4:_0x1bb626[_0xec06('0x68')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5dffb3,JSON[_0xec06('0x69')](_0x1bb626));delete _0x1bb626[_0xec06('0x25')];if(_0x5dffb3===0x191){_0x5dffb3=0x190;}_0x3ff4a1[_0xec06('0x16')](_0x5dffb3)[_0xec06('0x26')](_0x43d518[_0xec06('0x2e')][_0xec06('0x67')]?{'message':_0xec06('0x6a'),'statusCode':_0x1bb626[_0xec06('0x68')]}:_0x1bb626);});}; \ No newline at end of file +var _0x195c=['vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','VtigerAccount','include','findAll','rows','show','length','includeAll','options','find','create','body','catch','params','getConfigurations','findOne','sort','Subjects','getSubjects','Descriptions','channel','VtigerConfiguration','VtigerField','md5','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','owner','includes','remove','false','label','startsWith','cf_','picklistValues','value'];(function(_0xe3f9c3,_0x12473b){var _0x5aa9ac=function(_0x208fc0){while(--_0x208fc0){_0xe3f9c3['push'](_0xe3f9c3['shift']());}};_0x5aa9ac(++_0x12473b);}(_0x195c,0x16d));var _0xc195=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x195c[_0x12bcf7];return _0x2825a;};'use strict';var emlformat=require(_0xc195('0x0'));var rimraf=require(_0xc195('0x1'));var zipdir=require(_0xc195('0x2'));var jsonpatch=require(_0xc195('0x3'));var rp=require('request-promise');var moment=require(_0xc195('0x4'));var BPromise=require(_0xc195('0x5'));var Mustache=require('mustache');var util=require(_0xc195('0x6'));var path=require(_0xc195('0x7'));var sox=require('sox');var csv=require(_0xc195('0x8'));var ejs=require(_0xc195('0x9'));var fs=require('fs');var fs_extra=require(_0xc195('0xa'));var _=require(_0xc195('0xb'));var squel=require(_0xc195('0xc'));var crypto=require('crypto');var jsforce=require(_0xc195('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc195('0x8'));var querystring=require(_0xc195('0xe'));var Papa=require(_0xc195('0xf'));var Redis=require(_0xc195('0x10'));var authService=require(_0xc195('0x11'));var qs=require(_0xc195('0x12'));var as=require(_0xc195('0x13'));var hardwareService=require(_0xc195('0x14'));var logger=require(_0xc195('0x15'))('api');var utils=require(_0xc195('0x16'));var config=require(_0xc195('0x17'));var licenseUtil=require(_0xc195('0x18'));var db=require(_0xc195('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d0391,_0x33c5b2){_0x33c5b2=_0x33c5b2||0xcc;return function(_0x493639){if(_0x493639){return _0x2d0391[_0xc195('0x1a')](_0x33c5b2);}return _0x2d0391[_0xc195('0x1b')](_0x33c5b2)[_0xc195('0x1c')]();};}function respondWithResult(_0xf2f2f5,_0x3e1437){_0x3e1437=_0x3e1437||0xc8;return function(_0x5b98a0){if(_0x5b98a0){return _0xf2f2f5[_0xc195('0x1b')](_0x3e1437)[_0xc195('0x1d')](_0x5b98a0);}};}function respondWithFilteredResult(_0x4d90ba,_0x54dd05){return function(_0x207ecb){if(_0x207ecb){var _0x64b7f5=typeof _0x54dd05[_0xc195('0x1e')]===_0xc195('0x1f')&&typeof _0x54dd05[_0xc195('0x20')]===_0xc195('0x1f');var _0x3ea478=_0x207ecb['count'];var _0x47235e=_0x64b7f5?0x0:_0x54dd05['offset'];var _0x5cc1bf=_0x64b7f5?_0x207ecb[_0xc195('0x21')]:_0x54dd05[_0xc195('0x1e')]+_0x54dd05[_0xc195('0x20')];var _0x509baf;if(_0x5cc1bf>=_0x3ea478){_0x5cc1bf=_0x3ea478;_0x509baf=0xc8;}else{_0x509baf=0xce;}_0x4d90ba[_0xc195('0x1b')](_0x509baf);return _0x4d90ba[_0xc195('0x22')](_0xc195('0x23'),_0x47235e+'-'+_0x5cc1bf+'/'+_0x3ea478)[_0xc195('0x1d')](_0x207ecb);}return null;};}function patchUpdates(_0x42dccc){return function(_0x2c16ec){try{jsonpatch[_0xc195('0x24')](_0x2c16ec,_0x42dccc,!![]);}catch(_0x19bb66){return BPromise[_0xc195('0x25')](_0x19bb66);}return _0x2c16ec['save']();};}function saveUpdates(_0x5e2b73,_0x271495){return function(_0x5a2197){if(_0x5a2197){return _0x5a2197[_0xc195('0x26')](_0x5e2b73)['then'](function(_0x3e79e7){return _0x3e79e7;});}return null;};}function removeEntity(_0x3e196d,_0x5dc9de){return function(_0x4152ec){if(_0x4152ec){return _0x4152ec[_0xc195('0x27')]()[_0xc195('0x28')](function(){_0x3e196d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9620,_0x92ec70){return function(_0x45459d){if(!_0x45459d){_0x2d9620[_0xc195('0x1a')](0x194);}return _0x45459d;};}function handleError(_0x3668e1,_0x10a612){_0x10a612=_0x10a612||0x1f4;return function(_0x4bc4f9){logger[_0xc195('0x29')](_0x4bc4f9[_0xc195('0x2a')]);if(_0x4bc4f9['name']){delete _0x4bc4f9['name'];}_0x3668e1[_0xc195('0x1b')](_0x10a612)[_0xc195('0x2b')](_0x4bc4f9);};}exports[_0xc195('0x2c')]=function(_0x12fbc6,_0x5f570c){var _0x518b37={},_0x37e202={},_0x4f905e={'count':0x0,'rows':[]};var _0x4764a8=_[_0xc195('0x2d')](db['VtigerAccount'][_0xc195('0x2e')],function(_0xb1d6a){return{'name':_0xb1d6a[_0xc195('0x2f')],'type':_0xb1d6a[_0xc195('0x30')][_0xc195('0x31')]};});_0x37e202[_0xc195('0x32')]=_[_0xc195('0x2d')](_0x4764a8,_0xc195('0x33'));_0x37e202['query']=_[_0xc195('0x34')](_0x12fbc6[_0xc195('0x35')]);_0x37e202[_0xc195('0x36')]=_['intersection'](_0x37e202[_0xc195('0x32')],_0x37e202[_0xc195('0x35')]);_0x518b37[_0xc195('0x37')]=_[_0xc195('0x38')](_0x37e202[_0xc195('0x32')],qs[_0xc195('0x39')](_0x12fbc6[_0xc195('0x35')][_0xc195('0x39')]));_0x518b37[_0xc195('0x37')]=_0x518b37[_0xc195('0x37')]['length']?_0x518b37['attributes']:_0x37e202[_0xc195('0x32')];if(!_0x12fbc6[_0xc195('0x35')][_0xc195('0x3a')](_0xc195('0x3b'))){_0x518b37['limit']=qs[_0xc195('0x20')](_0x12fbc6[_0xc195('0x35')][_0xc195('0x20')]);_0x518b37['offset']=qs[_0xc195('0x1e')](_0x12fbc6[_0xc195('0x35')][_0xc195('0x1e')]);}_0x518b37[_0xc195('0x3c')]=qs['sort'](_0x12fbc6[_0xc195('0x35')]['sort']);_0x518b37[_0xc195('0x3d')]=qs[_0xc195('0x36')](_[_0xc195('0x3e')](_0x12fbc6[_0xc195('0x35')],_0x37e202[_0xc195('0x36')]),_0x4764a8);if(_0x12fbc6[_0xc195('0x35')][_0xc195('0x3f')]){_0x518b37[_0xc195('0x3d')]=_[_0xc195('0x40')](_0x518b37['where'],{'$or':_[_0xc195('0x2d')](_0x4764a8,function(_0x2434d1){if(_0x2434d1[_0xc195('0x30')]!==_0xc195('0x41')){var _0x250063={};_0x250063[_0x2434d1['name']]={'$like':'%'+_0x12fbc6[_0xc195('0x35')][_0xc195('0x3f')]+'%'};return _0x250063;}})});}_0x518b37=_['merge']({},_0x518b37,_0x12fbc6['options']);var _0x468e8a={'where':_0x518b37[_0xc195('0x3d')]};return db[_0xc195('0x42')][_0xc195('0x21')](_0x468e8a)['then'](function(_0x8fcdaa){_0x4f905e[_0xc195('0x21')]=_0x8fcdaa;if(_0x12fbc6[_0xc195('0x35')]['includeAll']){_0x518b37[_0xc195('0x43')]=[{'all':!![]}];}return db[_0xc195('0x42')][_0xc195('0x44')](_0x518b37);})[_0xc195('0x28')](function(_0x509bd9){_0x4f905e[_0xc195('0x45')]=_0x509bd9;return _0x4f905e;})['then'](respondWithFilteredResult(_0x5f570c,_0x518b37))['catch'](handleError(_0x5f570c,null));};exports[_0xc195('0x46')]=function(_0x5a0ae2,_0x3ed837){var _0x104c24={'raw':![],'where':{'id':_0x5a0ae2['params']['id']}},_0x21a065={};_0x21a065[_0xc195('0x32')]=_[_0xc195('0x34')](db[_0xc195('0x42')]['rawAttributes']);_0x21a065[_0xc195('0x35')]=_['keys'](_0x5a0ae2['query']);_0x21a065[_0xc195('0x36')]=_['intersection'](_0x21a065[_0xc195('0x32')],_0x21a065[_0xc195('0x35')]);_0x104c24[_0xc195('0x37')]=_['intersection'](_0x21a065[_0xc195('0x32')],qs['fields'](_0x5a0ae2['query'][_0xc195('0x39')]));_0x104c24[_0xc195('0x37')]=_0x104c24[_0xc195('0x37')][_0xc195('0x47')]?_0x104c24['attributes']:_0x21a065['model'];if(_0x5a0ae2[_0xc195('0x35')][_0xc195('0x48')]){_0x104c24[_0xc195('0x43')]=[{'all':!![]}];}_0x104c24=_['merge']({},_0x104c24,_0x5a0ae2[_0xc195('0x49')]);return db[_0xc195('0x42')][_0xc195('0x4a')](_0x104c24)[_0xc195('0x28')](handleEntityNotFound(_0x3ed837,null))[_0xc195('0x28')](respondWithResult(_0x3ed837,null))['catch'](handleError(_0x3ed837,null));};exports[_0xc195('0x4b')]=function(_0x306574,_0x1f04a6){return db['VtigerAccount'][_0xc195('0x4b')](_0x306574[_0xc195('0x4c')],{})['then'](respondWithResult(_0x1f04a6,0xc9))[_0xc195('0x4d')](handleError(_0x1f04a6,null));};exports[_0xc195('0x26')]=function(_0x2f2e78,_0x5e9506){if(_0x2f2e78[_0xc195('0x4c')]['id']){delete _0x2f2e78['body']['id'];}return db[_0xc195('0x42')]['find']({'where':{'id':_0x2f2e78[_0xc195('0x4e')]['id']}})[_0xc195('0x28')](handleEntityNotFound(_0x5e9506,null))[_0xc195('0x28')](saveUpdates(_0x2f2e78['body'],null))[_0xc195('0x28')](respondWithResult(_0x5e9506,null))[_0xc195('0x4d')](handleError(_0x5e9506,null));};exports[_0xc195('0x27')]=function(_0x2d9e3c,_0x536fd5){return db[_0xc195('0x42')][_0xc195('0x4a')]({'where':{'id':_0x2d9e3c[_0xc195('0x4e')]['id']}})[_0xc195('0x28')](handleEntityNotFound(_0x536fd5,null))[_0xc195('0x28')](removeEntity(_0x536fd5,null))[_0xc195('0x4d')](handleError(_0x536fd5,null));};exports[_0xc195('0x4f')]=function(_0x4d9ee6,_0x4628db,_0x3b94d6){var _0x4c5f98={};var _0x27bde0={};var _0x3f872c;var _0x3f35c5;return db[_0xc195('0x42')][_0xc195('0x50')]({'where':{'id':_0x4d9ee6[_0xc195('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4628db,null))[_0xc195('0x28')](function(_0xdff0df){if(_0xdff0df){_0x3f872c=_0xdff0df;_0x27bde0[_0xc195('0x32')]=_['keys'](db['VtigerConfiguration'][_0xc195('0x2e')]);_0x27bde0[_0xc195('0x35')]=_[_0xc195('0x34')](_0x4d9ee6[_0xc195('0x35')]);_0x27bde0[_0xc195('0x36')]=_[_0xc195('0x38')](_0x27bde0[_0xc195('0x32')],_0x27bde0['query']);_0x4c5f98['attributes']=_[_0xc195('0x38')](_0x27bde0[_0xc195('0x32')],qs['fields'](_0x4d9ee6[_0xc195('0x35')]['fields']));_0x4c5f98['attributes']=_0x4c5f98[_0xc195('0x37')][_0xc195('0x47')]?_0x4c5f98['attributes']:_0x27bde0[_0xc195('0x32')];_0x4c5f98[_0xc195('0x3c')]=qs[_0xc195('0x51')](_0x4d9ee6[_0xc195('0x35')][_0xc195('0x51')]);_0x4c5f98[_0xc195('0x3d')]=qs['filters'](_[_0xc195('0x3e')](_0x4d9ee6['query'],_0x27bde0[_0xc195('0x36')]));if(_0x4d9ee6[_0xc195('0x35')][_0xc195('0x3f')]){_0x4c5f98['where']=_[_0xc195('0x40')](_0x4c5f98[_0xc195('0x3d')],{'$or':_['map'](_0x4c5f98[_0xc195('0x37')],function(_0x1fe9d5){var _0x4140b0={};_0x4140b0[_0x1fe9d5]={'$like':'%'+_0x4d9ee6[_0xc195('0x35')][_0xc195('0x3f')]+'%'};return _0x4140b0;})});}_0x4c5f98=_['merge']({},_0x4c5f98,_0x4d9ee6[_0xc195('0x49')]);return _0x3f872c['getConfigurations'](_0x4c5f98);}})['then'](function(_0x15fc76){if(_0x15fc76){_0x3f35c5=_0x15fc76[_0xc195('0x47')];if(!_0x4d9ee6['query']['hasOwnProperty'](_0xc195('0x3b'))){_0x4c5f98['limit']=qs[_0xc195('0x20')](_0x4d9ee6[_0xc195('0x35')][_0xc195('0x20')]);_0x4c5f98[_0xc195('0x1e')]=qs[_0xc195('0x1e')](_0x4d9ee6[_0xc195('0x35')]['offset']);}return _0x3f872c[_0xc195('0x4f')](_0x4c5f98);}})['then'](function(_0x36ab18){if(_0x36ab18){return _0x36ab18?{'count':_0x3f35c5,'rows':_0x36ab18}:null;}})[_0xc195('0x28')](respondWithResult(_0x4628db,null))['catch'](handleError(_0x4628db,null));};exports['addConfiguration']=function(_0x2b4559,_0x459844,_0x121d97){if(_0x2b4559[_0xc195('0x4c')]['id']){delete _0x2b4559['body']['id'];}return db[_0xc195('0x42')][_0xc195('0x50')]({'where':{'id':_0x2b4559[_0xc195('0x4e')]['id']}})['then'](handleEntityNotFound(_0x459844,null))['then'](function(_0x5b54b1){if(_0x5b54b1){_0x2b4559[_0xc195('0x4c')]['AccountId']=_0x5b54b1['id'];_0x2b4559[_0xc195('0x4c')][_0xc195('0x52')]=integrations[_0xc195('0x53')](_0x2b4559[_0xc195('0x4c')]['channel'],_0x2b4559[_0xc195('0x4c')]['type']);_0x2b4559[_0xc195('0x4c')][_0xc195('0x54')]=integrations['getDescriptions'](_0x2b4559[_0xc195('0x4c')][_0xc195('0x55')],_0x2b4559['body'][_0xc195('0x30')]);return db[_0xc195('0x56')][_0xc195('0x4b')](_0x2b4559[_0xc195('0x4c')],{'include':[{'model':db[_0xc195('0x57')],'as':_0xc195('0x52')},{'model':db[_0xc195('0x57')],'as':_0xc195('0x54')}]});}return null;})[_0xc195('0x28')](respondWithResult(_0x459844,null))[_0xc195('0x4d')](handleError(_0x459844,null));};var md5=require(_0xc195('0x58'));exports['getFields']=function(_0x562d27,_0x46b1ad,_0x57d5a8){var _0x3179c3=null;var _0x51b379=null;var _0x41b39f=null;var _0x217927=null;var _0x55e5c8='';return db[_0xc195('0x42')][_0xc195('0x50')]({'where':{'id':_0x562d27[_0xc195('0x4e')]['id']},'attributes':['id',_0xc195('0x33'),_0xc195('0x59'),_0xc195('0x5a'),_0xc195('0x5b'),_0xc195('0x5c'),'serverUrl',_0xc195('0x5d')]})['then'](handleEntityNotFound(_0x46b1ad,null))[_0xc195('0x28')](function(_0x1be90e){if(_0x1be90e){_0x3179c3=_0x1be90e[_0xc195('0x59')];_0x51b379=_0x1be90e[_0xc195('0x5d')];_0x41b39f=_0x1be90e['moduleName'];_0x55e5c8=_0x1be90e[_0xc195('0x5c')];var _0x5a8b08=_0x55e5c8[_0xc195('0x5e')](-0x1);if(_0x5a8b08==='/'){_0x55e5c8=_0x55e5c8[_0xc195('0x5f')](0x0,_0x55e5c8[_0xc195('0x60')](_0x5a8b08));}_0x217927=util['format']('%s/webservice.php',_0x55e5c8);var _0xa232c2={'method':'GET','uri':_0x217927,'qs':{'operation':_0xc195('0x61'),'username':_0x1be90e['username']},'json':!![]};return rp(_0xa232c2);}})[_0xc195('0x28')](function(_0x5d005c){if(_0x5d005c['success']){var _0x305a7e={'method':_0xc195('0x62'),'uri':_0x217927,'form':{'operation':_0xc195('0x63'),'username':_0x3179c3,'accessKey':md5(_0x5d005c[_0xc195('0x64')][_0xc195('0x65')]+_0x51b379)},'json':!![]};return rp(_0x305a7e);}})['then'](function(_0x373529){if(_0x373529[_0xc195('0x66')]){var _0x394fa5={'method':'GET','uri':_0x217927,'qs':{'operation':_0xc195('0x67'),'username':_0x3179c3,'sessionName':_0x373529[_0xc195('0x64')]['sessionName'],'elementType':_0x41b39f},'json':!![]};return rp(_0x394fa5);}})['then'](function(_0x4e06c2){if(_0x4e06c2[_0xc195('0x66')]){var _0x4509dd=[_0xc195('0x68'),_0xc195('0x69'),_0xc195('0x6a')];_['remove'](_0x4e06c2[_0xc195('0x64')][_0xc195('0x39')],function(_0x3b3bce){return _0x4509dd[_0xc195('0x6b')](_0x3b3bce[_0xc195('0x30')]['name']);});_[_0xc195('0x6c')](_0x4e06c2[_0xc195('0x64')]['fields'],function(_0x4c2146){return _0x4c2146['editable']===_0xc195('0x6d');});return{'count':_0x4e06c2[_0xc195('0x64')][_0xc195('0x39')]['length'],'rows':_[_0xc195('0x2d')](_0x4e06c2['result'][_0xc195('0x39')],function(_0x3936ef){return{'id':_0x3936ef[_0xc195('0x33')],'name':_0x3936ef[_0xc195('0x6e')],'custom':_[_0xc195('0x6f')](_0x3936ef[_0xc195('0x33')],_0xc195('0x70'))?!![]:![],'options':_0x3936ef['type']['name']==='picklist'&&_0x3936ef[_0xc195('0x30')][_0xc195('0x71')][_0xc195('0x47')]>0x0?_[_0xc195('0x2d')](_0x3936ef[_0xc195('0x30')][_0xc195('0x71')],function(_0x21102c){return{'name':_0x21102c['label'],'value':_0x21102c[_0xc195('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x46b1ad,null))[_0xc195('0x4d')](function(_0x652bfb){console['log'](_0xc195('0x73')+_0x652bfb);var _0x91caf8=_0x562d27[_0xc195('0x35')][_0xc195('0x74')]?0x1f4:_0x652bfb['statusCode']||0x1f4;logger[_0xc195('0x29')](_0xc195('0x75'),_0xc195('0x76'),_0x91caf8,JSON['stringify'](_0x652bfb));delete _0x652bfb[_0xc195('0x33')];if(_0x91caf8===0x191){_0x91caf8=0x190;}_0x46b1ad['status'](_0x91caf8)[_0xc195('0x2b')](_0x562d27['query'][_0xc195('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x652bfb[_0xc195('0x77')]}:_0x652bfb);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 56539da..398c687 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 _0xb8eb=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','VtigerAccount','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b09dd,_0x57f9bd){var _0x4df232=function(_0x5219af){while(--_0x5219af){_0x5b09dd['push'](_0x5b09dd['shift']());}};_0x4df232(++_0x57f9bd);}(_0xb8eb,0x96));var _0xbb8e=function(_0x223537,_0x126eab){_0x223537=_0x223537-0x0;var _0x531d63=_0xb8eb[_0x223537];return _0x531d63;};'use strict';var _=require(_0xbb8e('0x0'));var util=require('util');var logger=require(_0xbb8e('0x1'))(_0xbb8e('0x2'));var moment=require(_0xbb8e('0x3'));var BPromise=require(_0xbb8e('0x4'));var rp=require(_0xbb8e('0x5'));var fs=require('fs');var path=require(_0xbb8e('0x6'));var rimraf=require(_0xbb8e('0x7'));var config=require(_0xbb8e('0x8'));var attributes=require(_0xbb8e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xbb8e('0xa')]=function(_0x905e58,_0x105fe7){return _0x905e58['define'](_0xbb8e('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd8a=['exports','int_vtiger_accounts','lodash','util','api','bluebird','request-promise','../../config/environment','./intVtigerAccount.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xdd8a,0x1a0));var _0xadd8=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0xdd8a[_0x3d61c6];return _0x47e0df;};'use strict';var _=require(_0xadd8('0x0'));var util=require(_0xadd8('0x1'));var logger=require('../../config/logger')(_0xadd8('0x2'));var moment=require('moment');var BPromise=require(_0xadd8('0x3'));var rp=require(_0xadd8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xadd8('0x5'));var attributes=require(_0xadd8('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xadd8('0x7')]=function(_0x189c66,_0x5b4a4e){return _0x189c66['define']('VtigerAccount',attributes,{'tableName':_0xadd8('0x8'),'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 74a3699..76f7c90 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 _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeffd,0x6b));var _0xdeff=function(_0x426426,_0x3619c5){_0x426426=_0x426426-0x0;var _0x1a7a9a=_0xeffd[_0x426426];return _0x1a7a9a;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetVtigerAccount']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetVtigerAccount',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});}; \ No newline at end of file +var _0xb688=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','GetVtigerAccount','stringify','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x31688a,_0x588c7d){var _0xc7b088=function(_0x3ed4c8){while(--_0x3ed4c8){_0x31688a['push'](_0x31688a['shift']());}};_0xc7b088(++_0x588c7d);}(_0xb688,0xcf));var _0x8b68=function(_0x225c83,_0x411d35){_0x225c83=_0x225c83-0x0;var _0x138677=_0xb688[_0x225c83];return _0x138677;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['GetVtigerAccount']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')]({'raw':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1a')]||null:null,'attributes':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'limit':_0xd17693['options']?_0xd17693['options'][_0x8b68('0x1c')]||null:null,'include':_0xd17693['options']?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x173524){return{'model':db[_0x173524['model']],'as':_0x173524['as'],'attributes':_0x173524[_0x8b68('0x1b')],'include':_0x173524[_0x8b68('0x1d')]?_['map'](_0x173524[_0x8b68('0x1d')],function(_0x3cf8d2){return{'model':db[_0x3cf8d2[_0x8b68('0x1f')]],'as':_0x3cf8d2['as'],'attributes':_0x3cf8d2['attributes'],'include':_0x3cf8d2['include']?_['map'](_0x3cf8d2[_0x8b68('0x1d')],function(_0x448e43){return{'model':db[_0x448e43[_0x8b68('0x1f')]],'as':_0x448e43['as'],'attributes':_0x448e43['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x53aaa2){logger['info'](_0x8b68('0x20'),_0xd17693);logger['debug'](_0x8b68('0x20'),_0xd17693,JSON[_0x8b68('0x21')](_0x53aaa2));_0x4a68c7(_0x53aaa2);})['catch'](function(_0x494ce4){logger[_0x8b68('0x12')](_0x8b68('0x20'),_0x494ce4[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x494ce4[_0x8b68('0x14')]));});});};exports[_0x8b68('0x22')]=function(_0x460c37){var _0x5b7ed1=this;return new Promise(function(_0x3b6d1b,_0x50a1e9){return db[_0x8b68('0x17')][_0x8b68('0x23')]({'raw':_0x460c37['options']?_0x460c37[_0x8b68('0x19')][_0x8b68('0x24')]===undefined?!![]:![]:!![],'where':_0x460c37[_0x8b68('0x19')]?_0x460c37['options']['where']||null:null,'attributes':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'include':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x7fe301){return{'model':db[_0x7fe301[_0x8b68('0x1f')]],'as':_0x7fe301['as'],'attributes':_0x7fe301[_0x8b68('0x1b')],'include':_0x7fe301[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x7fe301[_0x8b68('0x1d')],function(_0x151277){return{'model':db[_0x151277[_0x8b68('0x1f')]],'as':_0x151277['as'],'attributes':_0x151277[_0x8b68('0x1b')],'include':_0x151277[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x151277[_0x8b68('0x1d')],function(_0x43b971){return{'model':db[_0x43b971['model']],'as':_0x43b971['as'],'attributes':_0x43b971['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x262d6c){logger[_0x8b68('0xd')](_0x8b68('0x22'),_0x460c37);logger[_0x8b68('0x10')](_0x8b68('0x22'),_0x460c37,JSON[_0x8b68('0x21')](_0x262d6c));_0x3b6d1b(_0x262d6c);})[_0x8b68('0x16')](function(_0x5b628e){logger[_0x8b68('0x12')](_0x8b68('0x22'),_0x5b628e[_0x8b68('0x14')],_0x460c37);_0x50a1e9(_0x5b7ed1[_0x8b68('0x12')](0x1f4,_0x5b628e[_0x8b68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 424a84e..d0ba372 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 _0xd842=['../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','util','Router','fs-extra'];(function(_0x1ded25,_0x26be3d){var _0x8ec99f=function(_0x3017ac){while(--_0x3017ac){_0x1ded25['push'](_0x1ded25['shift']());}};_0x8ec99f(++_0x26be3d);}(_0xd842,0x140));var _0x2d84=function(_0x47b6db,_0x3ad28b){_0x47b6db=_0x47b6db-0x0;var _0x7d5e23=_0xd842[_0x47b6db];return _0x7d5e23;};'use strict';var multer=require('multer');var util=require(_0x2d84('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d84('0x1')]();var fs_extra=require(_0x2d84('0x2'));var auth=require(_0x2d84('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d84('0x4'));var controller=require(_0x2d84('0x5'));router[_0x2d84('0x6')]('/',auth['isAuthenticated'](),controller[_0x2d84('0x7')]);router[_0x2d84('0x6')](_0x2d84('0x8'),auth['isAuthenticated'](),controller[_0x2d84('0x9')]);router[_0x2d84('0x6')]('/:id/fields',auth[_0x2d84('0xa')](),controller['getFields']);router[_0x2d84('0x6')](_0x2d84('0xb'),auth['isAuthenticated'](),controller[_0x2d84('0xc')]);router[_0x2d84('0x6')](_0x2d84('0xd'),auth[_0x2d84('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x2d84('0xa')](),controller['create']);router[_0x2d84('0xe')](_0x2d84('0x8'),auth[_0x2d84('0xa')](),controller[_0x2d84('0xf')]);router[_0x2d84('0x10')](_0x2d84('0x8'),auth[_0x2d84('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6049=['getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','show','isAuthenticated'];(function(_0x1c5710,_0x20c184){var _0x174a1b=function(_0x43d1f6){while(--_0x43d1f6){_0x1c5710['push'](_0x1c5710['shift']());}};_0x174a1b(++_0x20c184);}(_0x6049,0xc7));var _0x9604=function(_0x4671c3,_0x59a5f8){_0x4671c3=_0x4671c3-0x0;var _0x4c0b3f=_0x6049[_0x4671c3];return _0x4c0b3f;};'use strict';var multer=require(_0x9604('0x0'));var util=require(_0x9604('0x1'));var path=require('path');var timeout=require(_0x9604('0x2'));var express=require(_0x9604('0x3'));var router=express['Router']();var fs_extra=require(_0x9604('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9604('0x5'));var config=require('../../config/environment');var controller=require(_0x9604('0x6'));router[_0x9604('0x7')]('/',auth['isAuthenticated'](),controller[_0x9604('0x8')]);router[_0x9604('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9604('0x9')]);router[_0x9604('0x7')]('/:id/fields',auth[_0x9604('0xa')](),controller[_0x9604('0xb')]);router[_0x9604('0x7')](_0x9604('0xc'),auth[_0x9604('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9604('0xd')]);router[_0x9604('0xe')]('/',auth[_0x9604('0xa')](),controller[_0x9604('0xf')]);router[_0x9604('0x10')]('/:id',auth[_0x9604('0xa')](),controller[_0x9604('0x11')]);router[_0x9604('0x12')](_0x9604('0x13'),auth[_0x9604('0xa')](),controller[_0x9604('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3bb59f0..ae01799 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 _0x5f22=['STRING','sequelize','exports'];(function(_0x17b67f,_0x5afa55){var _0x79be8c=function(_0x509f1b){while(--_0x509f1b){_0x17b67f['push'](_0x17b67f['shift']());}};_0x79be8c(++_0x5afa55);}(_0x5f22,0x1b1));var _0x25f2=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x5f22[_0x4226d6];return _0x19655b;};'use strict';var Sequelize=require(_0x25f2('0x0'));module[_0x25f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x25f2('0x2')]}}; \ No newline at end of file +var _0xccd5=['STRING','sequelize','exports'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0xccd5,0x1e7));var _0x5ccd=function(_0x8a8851,_0x4ff359){_0x8a8851=_0x8a8851-0x0;var _0x151cd0=_0xccd5[_0x8a8851];return _0x151cd0;};'use strict';var Sequelize=require(_0x5ccd('0x0'));module[_0x5ccd('0x1')]={'name':{'type':Sequelize[_0x5ccd('0x2')]},'description':{'type':Sequelize[_0x5ccd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e01c237..5c92d6c 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 _0xdb81=['moment','bluebird','util','path','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','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','getFields','VtigerField','order','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0xdb81,0x191));var _0x1db8=function(_0xc93daa,_0x55ef84){_0xc93daa=_0xc93daa-0x0;var _0x2afc45=_0xdb81[_0xc93daa];return _0x2afc45;};'use strict';var emlformat=require(_0x1db8('0x0'));var rimraf=require(_0x1db8('0x1'));var zipdir=require(_0x1db8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1db8('0x3'));var moment=require(_0x1db8('0x4'));var BPromise=require(_0x1db8('0x5'));var Mustache=require('mustache');var util=require(_0x1db8('0x6'));var path=require(_0x1db8('0x7'));var sox=require('sox');var csv=require(_0x1db8('0x8'));var ejs=require(_0x1db8('0x9'));var fs=require('fs');var fs_extra=require(_0x1db8('0xa'));var _=require(_0x1db8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1db8('0xc'));var deskjs=require(_0x1db8('0xd'));var toCsv=require(_0x1db8('0x8'));var querystring=require(_0x1db8('0xe'));var Papa=require(_0x1db8('0xf'));var Redis=require('ioredis');var authService=require(_0x1db8('0x10'));var qs=require(_0x1db8('0x11'));var as=require(_0x1db8('0x12'));var hardwareService=require(_0x1db8('0x13'));var logger=require(_0x1db8('0x14'))(_0x1db8('0x15'));var utils=require(_0x1db8('0x16'));var config=require(_0x1db8('0x17'));var licenseUtil=require(_0x1db8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ea0f,_0x4a3a64){_0x4a3a64=_0x4a3a64||0xcc;return function(_0x337c20){if(_0x337c20){return _0x24ea0f[_0x1db8('0x19')](_0x4a3a64);}return _0x24ea0f[_0x1db8('0x1a')](_0x4a3a64)[_0x1db8('0x1b')]();};}function respondWithResult(_0x304da6,_0x422149){_0x422149=_0x422149||0xc8;return function(_0x53db4c){if(_0x53db4c){return _0x304da6[_0x1db8('0x1a')](_0x422149)[_0x1db8('0x1c')](_0x53db4c);}};}function respondWithFilteredResult(_0x4380cb,_0x5c7acb){return function(_0x3c3686){if(_0x3c3686){var _0x1f4207=typeof _0x5c7acb[_0x1db8('0x1d')]===_0x1db8('0x1e')&&typeof _0x5c7acb[_0x1db8('0x1f')]===_0x1db8('0x1e');var _0x57cc68=_0x3c3686[_0x1db8('0x20')];var _0x1bd862=_0x1f4207?0x0:_0x5c7acb['offset'];var _0x5f5a1d=_0x1f4207?_0x3c3686[_0x1db8('0x20')]:_0x5c7acb['offset']+_0x5c7acb[_0x1db8('0x1f')];var _0x1b5556;if(_0x5f5a1d>=_0x57cc68){_0x5f5a1d=_0x57cc68;_0x1b5556=0xc8;}else{_0x1b5556=0xce;}_0x4380cb[_0x1db8('0x1a')](_0x1b5556);return _0x4380cb['set'](_0x1db8('0x21'),_0x1bd862+'-'+_0x5f5a1d+'/'+_0x57cc68)['json'](_0x3c3686);}return null;};}function patchUpdates(_0x5d8bc7){return function(_0x3702ec){try{jsonpatch['apply'](_0x3702ec,_0x5d8bc7,!![]);}catch(_0x2f5033){return BPromise[_0x1db8('0x22')](_0x2f5033);}return _0x3702ec[_0x1db8('0x23')]();};}function saveUpdates(_0x298511,_0x964e5d){return function(_0x18ebb7){if(_0x18ebb7){return _0x18ebb7[_0x1db8('0x24')](_0x298511)[_0x1db8('0x25')](function(_0x55d947){return _0x55d947;});}return null;};}function removeEntity(_0xe4f4c4,_0x2e38){return function(_0x2829a7){if(_0x2829a7){return _0x2829a7[_0x1db8('0x26')]()['then'](function(){_0xe4f4c4[_0x1db8('0x1a')](0xcc)[_0x1db8('0x1b')]();});}};}function handleEntityNotFound(_0x4d0791,_0x49ec0e){return function(_0x33211e){if(!_0x33211e){_0x4d0791[_0x1db8('0x19')](0x194);}return _0x33211e;};}function handleError(_0x17100a,_0x2f3677){_0x2f3677=_0x2f3677||0x1f4;return function(_0xe246e2){logger['error'](_0xe246e2[_0x1db8('0x27')]);if(_0xe246e2[_0x1db8('0x28')]){delete _0xe246e2['name'];}_0x17100a[_0x1db8('0x1a')](_0x2f3677)[_0x1db8('0x29')](_0xe246e2);};}exports[_0x1db8('0x2a')]=function(_0x14cb4e,_0x53095e){var _0x7eb185={},_0x483ede={},_0x3d4ff7={'count':0x0,'rows':[]};var _0x47b94e=_[_0x1db8('0x2b')](db[_0x1db8('0x2c')][_0x1db8('0x2d')],function(_0x358ab){return{'name':_0x358ab[_0x1db8('0x2e')],'type':_0x358ab[_0x1db8('0x2f')][_0x1db8('0x30')]};});_0x483ede['model']=_['map'](_0x47b94e,'name');_0x483ede['query']=_['keys'](_0x14cb4e[_0x1db8('0x31')]);_0x483ede[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x483ede['model'],_0x483ede[_0x1db8('0x31')]);_0x7eb185[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x483ede[_0x1db8('0x35')],qs[_0x1db8('0x36')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x36')]));_0x7eb185['attributes']=_0x7eb185[_0x1db8('0x34')]['length']?_0x7eb185[_0x1db8('0x34')]:_0x483ede[_0x1db8('0x35')];if(!_0x14cb4e['query'][_0x1db8('0x37')]('nolimit')){_0x7eb185[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x1f')]);_0x7eb185[_0x1db8('0x1d')]=qs[_0x1db8('0x1d')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x1d')]);}_0x7eb185['order']=qs[_0x1db8('0x38')](_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x38')]);_0x7eb185[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x14cb4e[_0x1db8('0x31')],_0x483ede[_0x1db8('0x32')]),_0x47b94e);if(_0x14cb4e[_0x1db8('0x31')]['filter']){_0x7eb185[_0x1db8('0x39')]=_[_0x1db8('0x3b')](_0x7eb185['where'],{'$or':_[_0x1db8('0x2b')](_0x47b94e,function(_0x55ca88){if(_0x55ca88[_0x1db8('0x2f')]!==_0x1db8('0x3c')){var _0x2327ff={};_0x2327ff[_0x55ca88['name']]={'$like':'%'+_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x3d')]+'%'};return _0x2327ff;}})});}_0x7eb185=_[_0x1db8('0x3b')]({},_0x7eb185,_0x14cb4e[_0x1db8('0x3e')]);var _0x3a4afb={'where':_0x7eb185[_0x1db8('0x39')]};return db[_0x1db8('0x2c')]['count'](_0x3a4afb)[_0x1db8('0x25')](function(_0x476bb0){_0x3d4ff7['count']=_0x476bb0;if(_0x14cb4e[_0x1db8('0x31')][_0x1db8('0x3f')]){_0x7eb185[_0x1db8('0x40')]=[{'all':!![]}];}return db[_0x1db8('0x2c')][_0x1db8('0x41')](_0x7eb185);})['then'](function(_0x219fe9){_0x3d4ff7[_0x1db8('0x42')]=_0x219fe9;return _0x3d4ff7;})[_0x1db8('0x25')](respondWithFilteredResult(_0x53095e,_0x7eb185))[_0x1db8('0x43')](handleError(_0x53095e,null));};exports[_0x1db8('0x44')]=function(_0x15e942,_0x57d488){var _0x3ad5dc={'raw':![],'where':{'id':_0x15e942['params']['id']}},_0xeb4fe8={};_0xeb4fe8['model']=_[_0x1db8('0x45')](db[_0x1db8('0x2c')][_0x1db8('0x2d')]);_0xeb4fe8[_0x1db8('0x31')]=_['keys'](_0x15e942[_0x1db8('0x31')]);_0xeb4fe8[_0x1db8('0x32')]=_['intersection'](_0xeb4fe8[_0x1db8('0x35')],_0xeb4fe8[_0x1db8('0x31')]);_0x3ad5dc[_0x1db8('0x34')]=_['intersection'](_0xeb4fe8[_0x1db8('0x35')],qs['fields'](_0x15e942[_0x1db8('0x31')]['fields']));_0x3ad5dc[_0x1db8('0x34')]=_0x3ad5dc[_0x1db8('0x34')][_0x1db8('0x46')]?_0x3ad5dc[_0x1db8('0x34')]:_0xeb4fe8['model'];if(_0x15e942[_0x1db8('0x31')][_0x1db8('0x3f')]){_0x3ad5dc['include']=[{'all':!![]}];}_0x3ad5dc=_[_0x1db8('0x3b')]({},_0x3ad5dc,_0x15e942[_0x1db8('0x3e')]);return db[_0x1db8('0x2c')][_0x1db8('0x47')](_0x3ad5dc)[_0x1db8('0x25')](handleEntityNotFound(_0x57d488,null))['then'](respondWithResult(_0x57d488,null))['catch'](handleError(_0x57d488,null));};exports['create']=function(_0x388f8a,_0xa847ca){return db[_0x1db8('0x2c')][_0x1db8('0x48')](_0x388f8a['body'],{})[_0x1db8('0x25')](respondWithResult(_0xa847ca,0xc9))[_0x1db8('0x43')](handleError(_0xa847ca,null));};exports[_0x1db8('0x24')]=function(_0x5051ec,_0x5a32cb){if(_0x5051ec[_0x1db8('0x49')]['id']){delete _0x5051ec[_0x1db8('0x49')]['id'];}return db[_0x1db8('0x2c')][_0x1db8('0x47')]({'where':{'id':_0x5051ec[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x5a32cb,null))[_0x1db8('0x25')](saveUpdates(_0x5051ec[_0x1db8('0x49')],null))[_0x1db8('0x25')](respondWithResult(_0x5a32cb,null))[_0x1db8('0x43')](handleError(_0x5a32cb,null));};exports['destroy']=function(_0x30d4c3,_0x36c9e2){return db[_0x1db8('0x2c')][_0x1db8('0x47')]({'where':{'id':_0x30d4c3['params']['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x36c9e2,null))[_0x1db8('0x25')](removeEntity(_0x36c9e2,null))[_0x1db8('0x43')](handleError(_0x36c9e2,null));};exports[_0x1db8('0x4b')]=function(_0x1fa205,_0x853599,_0x122771){var _0x4bcd91={};var _0x1e7ff5={};var _0x1935d3;var _0x412d0e;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x1fa205[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x853599,null))[_0x1db8('0x25')](function(_0x5f35d3){if(_0x5f35d3){_0x1935d3=_0x5f35d3;_0x1e7ff5['model']=_[_0x1db8('0x45')](db[_0x1db8('0x4c')][_0x1db8('0x2d')]);_0x1e7ff5['query']=_[_0x1db8('0x45')](_0x1fa205[_0x1db8('0x31')]);_0x1e7ff5[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x1e7ff5['model'],_0x1e7ff5[_0x1db8('0x31')]);_0x4bcd91[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x1e7ff5[_0x1db8('0x35')],qs['fields'](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x36')]));_0x4bcd91[_0x1db8('0x34')]=_0x4bcd91['attributes'][_0x1db8('0x46')]?_0x4bcd91[_0x1db8('0x34')]:_0x1e7ff5['model'];_0x4bcd91[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x38')]);_0x4bcd91[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x1fa205[_0x1db8('0x31')],_0x1e7ff5[_0x1db8('0x32')]));if(_0x1fa205['query'][_0x1db8('0x3d')]){_0x4bcd91['where']=_[_0x1db8('0x3b')](_0x4bcd91[_0x1db8('0x39')],{'$or':_[_0x1db8('0x2b')](_0x4bcd91[_0x1db8('0x34')],function(_0x2ff3b9){var _0x4ac7fc={};_0x4ac7fc[_0x2ff3b9]={'$like':'%'+_0x1fa205[_0x1db8('0x31')]['filter']+'%'};return _0x4ac7fc;})});}_0x4bcd91=_[_0x1db8('0x3b')]({},_0x4bcd91,_0x1fa205[_0x1db8('0x3e')]);return _0x1935d3[_0x1db8('0x4b')](_0x4bcd91);}})[_0x1db8('0x25')](function(_0x595ee8){if(_0x595ee8){_0x412d0e=_0x595ee8['length'];if(!_0x1fa205[_0x1db8('0x31')][_0x1db8('0x37')]('nolimit')){_0x4bcd91[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x1fa205[_0x1db8('0x31')]['limit']);_0x4bcd91['offset']=qs['offset'](_0x1fa205[_0x1db8('0x31')][_0x1db8('0x1d')]);}return _0x1935d3[_0x1db8('0x4b')](_0x4bcd91);}})[_0x1db8('0x25')](function(_0xd97e67){if(_0xd97e67){return _0xd97e67?{'count':_0x412d0e,'rows':_0xd97e67}:null;}})[_0x1db8('0x25')](respondWithResult(_0x853599,null))[_0x1db8('0x43')](handleError(_0x853599,null));};exports['getSubjects']=function(_0x424446,_0x4aad62,_0x1e5de4){var _0x3b3b99={};var _0x41d288={};var _0xb97b0;var _0x273284;return db['VtigerConfiguration'][_0x1db8('0x4e')]({'where':{'id':_0x424446[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x4aad62,null))[_0x1db8('0x25')](function(_0x2a251b){if(_0x2a251b){_0xb97b0=_0x2a251b;_0x41d288[_0x1db8('0x35')]=_[_0x1db8('0x45')](db[_0x1db8('0x4c')][_0x1db8('0x2d')]);_0x41d288['query']=_[_0x1db8('0x45')](_0x424446[_0x1db8('0x31')]);_0x41d288['filters']=_['intersection'](_0x41d288['model'],_0x41d288['query']);_0x3b3b99[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x41d288[_0x1db8('0x35')],qs['fields'](_0x424446[_0x1db8('0x31')][_0x1db8('0x36')]));_0x3b3b99[_0x1db8('0x34')]=_0x3b3b99[_0x1db8('0x34')]['length']?_0x3b3b99[_0x1db8('0x34')]:_0x41d288[_0x1db8('0x35')];_0x3b3b99[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x424446[_0x1db8('0x31')][_0x1db8('0x38')]);_0x3b3b99[_0x1db8('0x39')]=qs[_0x1db8('0x32')](_[_0x1db8('0x3a')](_0x424446['query'],_0x41d288[_0x1db8('0x32')]));if(_0x424446[_0x1db8('0x31')][_0x1db8('0x3d')]){_0x3b3b99[_0x1db8('0x39')]=_[_0x1db8('0x3b')](_0x3b3b99[_0x1db8('0x39')],{'$or':_['map'](_0x3b3b99[_0x1db8('0x34')],function(_0x5ea483){var _0x1cf7a1={};_0x1cf7a1[_0x5ea483]={'$like':'%'+_0x424446[_0x1db8('0x31')]['filter']+'%'};return _0x1cf7a1;})});}_0x3b3b99=_['merge']({},_0x3b3b99,_0x424446[_0x1db8('0x3e')]);return _0xb97b0['getSubjects'](_0x3b3b99);}})[_0x1db8('0x25')](function(_0x9acc4){if(_0x9acc4){_0x273284=_0x9acc4[_0x1db8('0x46')];if(!_0x424446['query'][_0x1db8('0x37')]('nolimit')){_0x3b3b99['limit']=qs[_0x1db8('0x1f')](_0x424446[_0x1db8('0x31')]['limit']);_0x3b3b99['offset']=qs[_0x1db8('0x1d')](_0x424446['query']['offset']);}return _0xb97b0[_0x1db8('0x4f')](_0x3b3b99);}})[_0x1db8('0x25')](function(_0x303324){if(_0x303324){return _0x303324?{'count':_0x273284,'rows':_0x303324}:null;}})[_0x1db8('0x25')](respondWithResult(_0x4aad62,null))[_0x1db8('0x43')](handleError(_0x4aad62,null));};exports[_0x1db8('0x50')]=function(_0x4d38e4,_0x27fd70,_0x2b144e){var _0x4e507a={};var _0x469d9a={};var _0xb7b61e;var _0x191277;return db[_0x1db8('0x2c')][_0x1db8('0x4e')]({'where':{'id':_0x4d38e4[_0x1db8('0x4a')]['id']}})[_0x1db8('0x25')](handleEntityNotFound(_0x27fd70,null))[_0x1db8('0x25')](function(_0x2a4587){if(_0x2a4587){_0xb7b61e=_0x2a4587;_0x469d9a[_0x1db8('0x35')]=_[_0x1db8('0x45')](db[_0x1db8('0x4c')]['rawAttributes']);_0x469d9a[_0x1db8('0x31')]=_['keys'](_0x4d38e4['query']);_0x469d9a[_0x1db8('0x32')]=_[_0x1db8('0x33')](_0x469d9a['model'],_0x469d9a[_0x1db8('0x31')]);_0x4e507a[_0x1db8('0x34')]=_[_0x1db8('0x33')](_0x469d9a[_0x1db8('0x35')],qs[_0x1db8('0x36')](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x36')]));_0x4e507a['attributes']=_0x4e507a[_0x1db8('0x34')][_0x1db8('0x46')]?_0x4e507a[_0x1db8('0x34')]:_0x469d9a[_0x1db8('0x35')];_0x4e507a[_0x1db8('0x4d')]=qs[_0x1db8('0x38')](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x38')]);_0x4e507a[_0x1db8('0x39')]=qs['filters'](_[_0x1db8('0x3a')](_0x4d38e4[_0x1db8('0x31')],_0x469d9a[_0x1db8('0x32')]));if(_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x3d')]){_0x4e507a['where']=_[_0x1db8('0x3b')](_0x4e507a['where'],{'$or':_[_0x1db8('0x2b')](_0x4e507a[_0x1db8('0x34')],function(_0xfaf94e){var _0x29eb30={};_0x29eb30[_0xfaf94e]={'$like':'%'+_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x3d')]+'%'};return _0x29eb30;})});}_0x4e507a=_['merge']({},_0x4e507a,_0x4d38e4['options']);return _0xb7b61e['getDescriptions'](_0x4e507a);}})[_0x1db8('0x25')](function(_0x4f47a0){if(_0x4f47a0){_0x191277=_0x4f47a0[_0x1db8('0x46')];if(!_0x4d38e4['query']['hasOwnProperty']('nolimit')){_0x4e507a[_0x1db8('0x1f')]=qs['limit'](_0x4d38e4[_0x1db8('0x31')][_0x1db8('0x1f')]);_0x4e507a['offset']=qs[_0x1db8('0x1d')](_0x4d38e4['query']['offset']);}return _0xb7b61e[_0x1db8('0x50')](_0x4e507a);}})[_0x1db8('0x25')](function(_0x348abf){if(_0x348abf){return _0x348abf?{'count':_0x191277,'rows':_0x348abf}:null;}})[_0x1db8('0x25')](respondWithResult(_0x27fd70,null))['catch'](handleError(_0x27fd70,null));}; \ No newline at end of file +var _0xfd18=['save','update','then','destroy','sendStatus','error','stack','name','send','index','VtigerConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','VtigerField','order','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x1bd259,_0x4787ec){var _0x40f493=function(_0x22a063){while(--_0x22a063){_0x1bd259['push'](_0x1bd259['shift']());}};_0x40f493(++_0x4787ec);}(_0xfd18,0x181));var _0x8fd1=function(_0x39947f,_0x5787a6){_0x39947f=_0x39947f-0x0;var _0x415d92=_0xfd18[_0x39947f];return _0x415d92;};'use strict';var emlformat=require(_0x8fd1('0x0'));var rimraf=require(_0x8fd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fd1('0x2'));var rp=require(_0x8fd1('0x3'));var moment=require('moment');var BPromise=require(_0x8fd1('0x4'));var Mustache=require(_0x8fd1('0x5'));var util=require(_0x8fd1('0x6'));var path=require(_0x8fd1('0x7'));var sox=require(_0x8fd1('0x8'));var csv=require(_0x8fd1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fd1('0xa'));var _=require(_0x8fd1('0xb'));var squel=require(_0x8fd1('0xc'));var crypto=require(_0x8fd1('0xd'));var jsforce=require(_0x8fd1('0xe'));var deskjs=require(_0x8fd1('0xf'));var toCsv=require(_0x8fd1('0x9'));var querystring=require(_0x8fd1('0x10'));var Papa=require(_0x8fd1('0x11'));var Redis=require('ioredis');var authService=require(_0x8fd1('0x12'));var qs=require(_0x8fd1('0x13'));var as=require(_0x8fd1('0x14'));var hardwareService=require(_0x8fd1('0x15'));var logger=require(_0x8fd1('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8fd1('0x17'));var licenseUtil=require(_0x8fd1('0x18'));var db=require(_0x8fd1('0x19'))['db'];function respondWithStatusCode(_0x21f2c1,_0x2dbcb4){_0x2dbcb4=_0x2dbcb4||0xcc;return function(_0xd4cd59){if(_0xd4cd59){return _0x21f2c1['sendStatus'](_0x2dbcb4);}return _0x21f2c1[_0x8fd1('0x1a')](_0x2dbcb4)['end']();};}function respondWithResult(_0x2a7c61,_0x5679fc){_0x5679fc=_0x5679fc||0xc8;return function(_0x290feb){if(_0x290feb){return _0x2a7c61[_0x8fd1('0x1a')](_0x5679fc)[_0x8fd1('0x1b')](_0x290feb);}};}function respondWithFilteredResult(_0x174eea,_0x95a4a5){return function(_0xde7016){if(_0xde7016){var _0x57d4e1=typeof _0x95a4a5['offset']===_0x8fd1('0x1c')&&typeof _0x95a4a5[_0x8fd1('0x1d')]===_0x8fd1('0x1c');var _0x489c84=_0xde7016[_0x8fd1('0x1e')];var _0x293a59=_0x57d4e1?0x0:_0x95a4a5[_0x8fd1('0x1f')];var _0x5baad8=_0x57d4e1?_0xde7016['count']:_0x95a4a5['offset']+_0x95a4a5['limit'];var _0x36fbfb;if(_0x5baad8>=_0x489c84){_0x5baad8=_0x489c84;_0x36fbfb=0xc8;}else{_0x36fbfb=0xce;}_0x174eea['status'](_0x36fbfb);return _0x174eea['set'](_0x8fd1('0x20'),_0x293a59+'-'+_0x5baad8+'/'+_0x489c84)['json'](_0xde7016);}return null;};}function patchUpdates(_0x2e6bfe){return function(_0x39ab6b){try{jsonpatch[_0x8fd1('0x21')](_0x39ab6b,_0x2e6bfe,!![]);}catch(_0x7d074a){return BPromise[_0x8fd1('0x22')](_0x7d074a);}return _0x39ab6b[_0x8fd1('0x23')]();};}function saveUpdates(_0x415d9e,_0x147466){return function(_0x21ee7d){if(_0x21ee7d){return _0x21ee7d[_0x8fd1('0x24')](_0x415d9e)[_0x8fd1('0x25')](function(_0x5a2d45){return _0x5a2d45;});}return null;};}function removeEntity(_0x4e092b,_0x528b4b){return function(_0x17e12c){if(_0x17e12c){return _0x17e12c[_0x8fd1('0x26')]()['then'](function(){_0x4e092b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3899bd,_0x491bdd){return function(_0x183dc6){if(!_0x183dc6){_0x3899bd[_0x8fd1('0x27')](0x194);}return _0x183dc6;};}function handleError(_0x1c8bd5,_0x3f87e3){_0x3f87e3=_0x3f87e3||0x1f4;return function(_0x305bfd){logger[_0x8fd1('0x28')](_0x305bfd[_0x8fd1('0x29')]);if(_0x305bfd[_0x8fd1('0x2a')]){delete _0x305bfd[_0x8fd1('0x2a')];}_0x1c8bd5[_0x8fd1('0x1a')](_0x3f87e3)[_0x8fd1('0x2b')](_0x305bfd);};}exports[_0x8fd1('0x2c')]=function(_0x357f04,_0x8f86a4){var _0x6deea8={},_0x16daa0={},_0x42e7b1={'count':0x0,'rows':[]};var _0x8e46d=_['map'](db[_0x8fd1('0x2d')]['rawAttributes'],function(_0x98d930){return{'name':_0x98d930[_0x8fd1('0x2e')],'type':_0x98d930[_0x8fd1('0x2f')][_0x8fd1('0x30')]};});_0x16daa0[_0x8fd1('0x31')]=_[_0x8fd1('0x32')](_0x8e46d,_0x8fd1('0x2a'));_0x16daa0[_0x8fd1('0x33')]=_[_0x8fd1('0x34')](_0x357f04[_0x8fd1('0x33')]);_0x16daa0[_0x8fd1('0x35')]=_[_0x8fd1('0x36')](_0x16daa0[_0x8fd1('0x31')],_0x16daa0[_0x8fd1('0x33')]);_0x6deea8[_0x8fd1('0x37')]=_[_0x8fd1('0x36')](_0x16daa0[_0x8fd1('0x31')],qs['fields'](_0x357f04[_0x8fd1('0x33')][_0x8fd1('0x38')]));_0x6deea8[_0x8fd1('0x37')]=_0x6deea8[_0x8fd1('0x37')][_0x8fd1('0x39')]?_0x6deea8[_0x8fd1('0x37')]:_0x16daa0[_0x8fd1('0x31')];if(!_0x357f04[_0x8fd1('0x33')]['hasOwnProperty'](_0x8fd1('0x3a'))){_0x6deea8[_0x8fd1('0x1d')]=qs[_0x8fd1('0x1d')](_0x357f04[_0x8fd1('0x33')]['limit']);_0x6deea8[_0x8fd1('0x1f')]=qs['offset'](_0x357f04[_0x8fd1('0x33')][_0x8fd1('0x1f')]);}_0x6deea8['order']=qs[_0x8fd1('0x3b')](_0x357f04['query'][_0x8fd1('0x3b')]);_0x6deea8['where']=qs[_0x8fd1('0x35')](_[_0x8fd1('0x3c')](_0x357f04[_0x8fd1('0x33')],_0x16daa0[_0x8fd1('0x35')]),_0x8e46d);if(_0x357f04['query'][_0x8fd1('0x3d')]){_0x6deea8[_0x8fd1('0x3e')]=_[_0x8fd1('0x3f')](_0x6deea8['where'],{'$or':_[_0x8fd1('0x32')](_0x8e46d,function(_0x42f285){if(_0x42f285[_0x8fd1('0x2f')]!==_0x8fd1('0x40')){var _0x512af1={};_0x512af1[_0x42f285[_0x8fd1('0x2a')]]={'$like':'%'+_0x357f04[_0x8fd1('0x33')][_0x8fd1('0x3d')]+'%'};return _0x512af1;}})});}_0x6deea8=_[_0x8fd1('0x3f')]({},_0x6deea8,_0x357f04[_0x8fd1('0x41')]);var _0x364654={'where':_0x6deea8['where']};return db[_0x8fd1('0x2d')][_0x8fd1('0x1e')](_0x364654)[_0x8fd1('0x25')](function(_0x2c52b7){_0x42e7b1[_0x8fd1('0x1e')]=_0x2c52b7;if(_0x357f04[_0x8fd1('0x33')][_0x8fd1('0x42')]){_0x6deea8[_0x8fd1('0x43')]=[{'all':!![]}];}return db[_0x8fd1('0x2d')][_0x8fd1('0x44')](_0x6deea8);})[_0x8fd1('0x25')](function(_0x1af88b){_0x42e7b1[_0x8fd1('0x45')]=_0x1af88b;return _0x42e7b1;})[_0x8fd1('0x25')](respondWithFilteredResult(_0x8f86a4,_0x6deea8))[_0x8fd1('0x46')](handleError(_0x8f86a4,null));};exports[_0x8fd1('0x47')]=function(_0x50dea2,_0x54b947){var _0x491a7c={'raw':![],'where':{'id':_0x50dea2[_0x8fd1('0x48')]['id']}},_0x3f6760={};_0x3f6760[_0x8fd1('0x31')]=_['keys'](db[_0x8fd1('0x2d')][_0x8fd1('0x49')]);_0x3f6760[_0x8fd1('0x33')]=_['keys'](_0x50dea2[_0x8fd1('0x33')]);_0x3f6760['filters']=_[_0x8fd1('0x36')](_0x3f6760['model'],_0x3f6760[_0x8fd1('0x33')]);_0x491a7c[_0x8fd1('0x37')]=_[_0x8fd1('0x36')](_0x3f6760[_0x8fd1('0x31')],qs[_0x8fd1('0x38')](_0x50dea2['query']['fields']));_0x491a7c['attributes']=_0x491a7c[_0x8fd1('0x37')][_0x8fd1('0x39')]?_0x491a7c[_0x8fd1('0x37')]:_0x3f6760[_0x8fd1('0x31')];if(_0x50dea2[_0x8fd1('0x33')][_0x8fd1('0x42')]){_0x491a7c[_0x8fd1('0x43')]=[{'all':!![]}];}_0x491a7c=_[_0x8fd1('0x3f')]({},_0x491a7c,_0x50dea2[_0x8fd1('0x41')]);return db[_0x8fd1('0x2d')][_0x8fd1('0x4a')](_0x491a7c)['then'](handleEntityNotFound(_0x54b947,null))[_0x8fd1('0x25')](respondWithResult(_0x54b947,null))['catch'](handleError(_0x54b947,null));};exports[_0x8fd1('0x4b')]=function(_0x421437,_0x1de563){return db[_0x8fd1('0x2d')][_0x8fd1('0x4b')](_0x421437[_0x8fd1('0x4c')],{})[_0x8fd1('0x25')](respondWithResult(_0x1de563,0xc9))[_0x8fd1('0x46')](handleError(_0x1de563,null));};exports['update']=function(_0x16c54b,_0x4f3d17){if(_0x16c54b[_0x8fd1('0x4c')]['id']){delete _0x16c54b[_0x8fd1('0x4c')]['id'];}return db[_0x8fd1('0x2d')][_0x8fd1('0x4a')]({'where':{'id':_0x16c54b[_0x8fd1('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f3d17,null))['then'](saveUpdates(_0x16c54b[_0x8fd1('0x4c')],null))[_0x8fd1('0x25')](respondWithResult(_0x4f3d17,null))[_0x8fd1('0x46')](handleError(_0x4f3d17,null));};exports['destroy']=function(_0xdffd5d,_0x49de1c){return db[_0x8fd1('0x2d')][_0x8fd1('0x4a')]({'where':{'id':_0xdffd5d['params']['id']}})[_0x8fd1('0x25')](handleEntityNotFound(_0x49de1c,null))[_0x8fd1('0x25')](removeEntity(_0x49de1c,null))[_0x8fd1('0x46')](handleError(_0x49de1c,null));};exports[_0x8fd1('0x4d')]=function(_0x2a25e0,_0xe0f44e,_0x35a6e7){var _0x3ba328={};var _0x10db6c={};var _0x3f6313;var _0x296e4a;return db[_0x8fd1('0x2d')][_0x8fd1('0x4e')]({'where':{'id':_0x2a25e0[_0x8fd1('0x48')]['id']}})[_0x8fd1('0x25')](handleEntityNotFound(_0xe0f44e,null))[_0x8fd1('0x25')](function(_0xbb6632){if(_0xbb6632){_0x3f6313=_0xbb6632;_0x10db6c[_0x8fd1('0x31')]=_[_0x8fd1('0x34')](db[_0x8fd1('0x4f')][_0x8fd1('0x49')]);_0x10db6c['query']=_[_0x8fd1('0x34')](_0x2a25e0['query']);_0x10db6c[_0x8fd1('0x35')]=_['intersection'](_0x10db6c[_0x8fd1('0x31')],_0x10db6c['query']);_0x3ba328[_0x8fd1('0x37')]=_[_0x8fd1('0x36')](_0x10db6c[_0x8fd1('0x31')],qs[_0x8fd1('0x38')](_0x2a25e0['query'][_0x8fd1('0x38')]));_0x3ba328[_0x8fd1('0x37')]=_0x3ba328[_0x8fd1('0x37')][_0x8fd1('0x39')]?_0x3ba328[_0x8fd1('0x37')]:_0x10db6c['model'];_0x3ba328[_0x8fd1('0x50')]=qs[_0x8fd1('0x3b')](_0x2a25e0['query'][_0x8fd1('0x3b')]);_0x3ba328[_0x8fd1('0x3e')]=qs[_0x8fd1('0x35')](_['pick'](_0x2a25e0[_0x8fd1('0x33')],_0x10db6c[_0x8fd1('0x35')]));if(_0x2a25e0['query'][_0x8fd1('0x3d')]){_0x3ba328[_0x8fd1('0x3e')]=_[_0x8fd1('0x3f')](_0x3ba328[_0x8fd1('0x3e')],{'$or':_[_0x8fd1('0x32')](_0x3ba328[_0x8fd1('0x37')],function(_0xf99598){var _0x403394={};_0x403394[_0xf99598]={'$like':'%'+_0x2a25e0['query']['filter']+'%'};return _0x403394;})});}_0x3ba328=_[_0x8fd1('0x3f')]({},_0x3ba328,_0x2a25e0['options']);return _0x3f6313['getFields'](_0x3ba328);}})[_0x8fd1('0x25')](function(_0x5e0e2d){if(_0x5e0e2d){_0x296e4a=_0x5e0e2d['length'];if(!_0x2a25e0['query']['hasOwnProperty'](_0x8fd1('0x3a'))){_0x3ba328[_0x8fd1('0x1d')]=qs['limit'](_0x2a25e0[_0x8fd1('0x33')][_0x8fd1('0x1d')]);_0x3ba328['offset']=qs[_0x8fd1('0x1f')](_0x2a25e0['query'][_0x8fd1('0x1f')]);}return _0x3f6313[_0x8fd1('0x4d')](_0x3ba328);}})[_0x8fd1('0x25')](function(_0x259754){if(_0x259754){return _0x259754?{'count':_0x296e4a,'rows':_0x259754}:null;}})[_0x8fd1('0x25')](respondWithResult(_0xe0f44e,null))['catch'](handleError(_0xe0f44e,null));};exports[_0x8fd1('0x51')]=function(_0x15d1e0,_0x2fa94c,_0x3f66f1){var _0x562779={};var _0x102d28={};var _0x172ddd;var _0x11dca0;return db[_0x8fd1('0x2d')]['findOne']({'where':{'id':_0x15d1e0[_0x8fd1('0x48')]['id']}})[_0x8fd1('0x25')](handleEntityNotFound(_0x2fa94c,null))[_0x8fd1('0x25')](function(_0x386ffd){if(_0x386ffd){_0x172ddd=_0x386ffd;_0x102d28[_0x8fd1('0x31')]=_['keys'](db['VtigerField'][_0x8fd1('0x49')]);_0x102d28[_0x8fd1('0x33')]=_[_0x8fd1('0x34')](_0x15d1e0[_0x8fd1('0x33')]);_0x102d28[_0x8fd1('0x35')]=_[_0x8fd1('0x36')](_0x102d28['model'],_0x102d28[_0x8fd1('0x33')]);_0x562779[_0x8fd1('0x37')]=_['intersection'](_0x102d28[_0x8fd1('0x31')],qs[_0x8fd1('0x38')](_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x38')]));_0x562779[_0x8fd1('0x37')]=_0x562779[_0x8fd1('0x37')][_0x8fd1('0x39')]?_0x562779[_0x8fd1('0x37')]:_0x102d28[_0x8fd1('0x31')];_0x562779[_0x8fd1('0x50')]=qs[_0x8fd1('0x3b')](_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x3b')]);_0x562779['where']=qs[_0x8fd1('0x35')](_[_0x8fd1('0x3c')](_0x15d1e0['query'],_0x102d28[_0x8fd1('0x35')]));if(_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x3d')]){_0x562779['where']=_[_0x8fd1('0x3f')](_0x562779['where'],{'$or':_[_0x8fd1('0x32')](_0x562779[_0x8fd1('0x37')],function(_0x1de075){var _0x77d20b={};_0x77d20b[_0x1de075]={'$like':'%'+_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x3d')]+'%'};return _0x77d20b;})});}_0x562779=_[_0x8fd1('0x3f')]({},_0x562779,_0x15d1e0[_0x8fd1('0x41')]);return _0x172ddd[_0x8fd1('0x51')](_0x562779);}})[_0x8fd1('0x25')](function(_0x429484){if(_0x429484){_0x11dca0=_0x429484[_0x8fd1('0x39')];if(!_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x52')](_0x8fd1('0x3a'))){_0x562779[_0x8fd1('0x1d')]=qs[_0x8fd1('0x1d')](_0x15d1e0[_0x8fd1('0x33')][_0x8fd1('0x1d')]);_0x562779['offset']=qs[_0x8fd1('0x1f')](_0x15d1e0['query']['offset']);}return _0x172ddd[_0x8fd1('0x51')](_0x562779);}})['then'](function(_0x9dc4e5){if(_0x9dc4e5){return _0x9dc4e5?{'count':_0x11dca0,'rows':_0x9dc4e5}:null;}})[_0x8fd1('0x25')](respondWithResult(_0x2fa94c,null))[_0x8fd1('0x46')](handleError(_0x2fa94c,null));};exports[_0x8fd1('0x53')]=function(_0x59b3e8,_0x17927a,_0x309018){var _0x172550={};var _0x1c250d={};var _0x287b36;var _0x12cffb;return db[_0x8fd1('0x2d')][_0x8fd1('0x4e')]({'where':{'id':_0x59b3e8['params']['id']}})[_0x8fd1('0x25')](handleEntityNotFound(_0x17927a,null))[_0x8fd1('0x25')](function(_0x34004e){if(_0x34004e){_0x287b36=_0x34004e;_0x1c250d[_0x8fd1('0x31')]=_['keys'](db[_0x8fd1('0x4f')]['rawAttributes']);_0x1c250d[_0x8fd1('0x33')]=_[_0x8fd1('0x34')](_0x59b3e8[_0x8fd1('0x33')]);_0x1c250d[_0x8fd1('0x35')]=_[_0x8fd1('0x36')](_0x1c250d['model'],_0x1c250d[_0x8fd1('0x33')]);_0x172550['attributes']=_[_0x8fd1('0x36')](_0x1c250d[_0x8fd1('0x31')],qs[_0x8fd1('0x38')](_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x38')]));_0x172550['attributes']=_0x172550[_0x8fd1('0x37')][_0x8fd1('0x39')]?_0x172550[_0x8fd1('0x37')]:_0x1c250d['model'];_0x172550[_0x8fd1('0x50')]=qs[_0x8fd1('0x3b')](_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x3b')]);_0x172550['where']=qs[_0x8fd1('0x35')](_[_0x8fd1('0x3c')](_0x59b3e8[_0x8fd1('0x33')],_0x1c250d['filters']));if(_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x3d')]){_0x172550[_0x8fd1('0x3e')]=_[_0x8fd1('0x3f')](_0x172550[_0x8fd1('0x3e')],{'$or':_[_0x8fd1('0x32')](_0x172550[_0x8fd1('0x37')],function(_0x1bb9e3){var _0x379d12={};_0x379d12[_0x1bb9e3]={'$like':'%'+_0x59b3e8['query']['filter']+'%'};return _0x379d12;})});}_0x172550=_[_0x8fd1('0x3f')]({},_0x172550,_0x59b3e8[_0x8fd1('0x41')]);return _0x287b36[_0x8fd1('0x53')](_0x172550);}})['then'](function(_0x3ea3e3){if(_0x3ea3e3){_0x12cffb=_0x3ea3e3['length'];if(!_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x52')]('nolimit')){_0x172550[_0x8fd1('0x1d')]=qs[_0x8fd1('0x1d')](_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x1d')]);_0x172550[_0x8fd1('0x1f')]=qs[_0x8fd1('0x1f')](_0x59b3e8[_0x8fd1('0x33')][_0x8fd1('0x1f')]);}return _0x287b36['getDescriptions'](_0x172550);}})['then'](function(_0x19d023){if(_0x19d023){return _0x19d023?{'count':_0x12cffb,'rows':_0x19d023}:null;}})[_0x8fd1('0x25')](respondWithResult(_0x17927a,null))[_0x8fd1('0x46')](handleError(_0x17927a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 74cbb33..31d7631 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 _0x53cd=['exports','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','request-promise','rimraf','./intVtigerConfiguration.attributes'];(function(_0xcb4cdc,_0x42032f){var _0x21ca5b=function(_0x179c8c){while(--_0x179c8c){_0xcb4cdc['push'](_0xcb4cdc['shift']());}};_0x21ca5b(++_0x42032f);}(_0x53cd,0x15c));var _0xd53c=function(_0x3874ef,_0x373424){_0x3874ef=_0x3874ef-0x0;var _0x185561=_0x53cd[_0x3874ef];return _0x185561;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd53c('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd53c('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd53c('0x2'));var config=require('../../config/environment');var attributes=require(_0xd53c('0x3'));module[_0xd53c('0x4')]=function(_0x551a66,_0x574296){return _0x551a66[_0xd53c('0x5')](_0xd53c('0x6'),attributes,{'tableName':_0xd53c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05b8=['api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','lodash','util'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x05b8,0x1c6));var _0x805b=function(_0x4132ea,_0x16c03e){_0x4132ea=_0x4132ea-0x0;var _0x538546=_0x05b8[_0x4132ea];return _0x538546;};'use strict';var _=require(_0x805b('0x0'));var util=require(_0x805b('0x1'));var logger=require('../../config/logger')(_0x805b('0x2'));var moment=require('moment');var BPromise=require(_0x805b('0x3'));var rp=require(_0x805b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x805b('0x5'));var config=require(_0x805b('0x6'));var attributes=require(_0x805b('0x7'));module['exports']=function(_0x1e257d,_0x3c46c3){return _0x1e257d['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 65a74ff..b3a487a 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 _0x40fe=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x40fe,0x175));var _0xe40f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x40fe[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xe40f('0x0'));var util=require(_0xe40f('0x1'));var moment=require(_0xe40f('0x2'));var BPromise=require(_0xe40f('0x3'));var rs=require(_0xe40f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe40f('0x5'))['db'];var utils=require(_0xe40f('0x6'));var logger=require('../../config/logger')(_0xe40f('0x7'));var config=require(_0xe40f('0x8'));var jayson=require(_0xe40f('0x9'));var client=jayson[_0xe40f('0xa')][_0xe40f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1db810,_0x115266,_0x5beac2){return new BPromise(function(_0x1b4f1e,_0x3a5e58){return client[_0xe40f('0xc')](_0x1db810,_0x5beac2)[_0xe40f('0xd')](function(_0x3b9dfd){logger['info'](_0xe40f('0xe'),_0x115266,_0xe40f('0xf'));logger['debug'](_0xe40f('0x10'),_0x115266,_0xe40f('0xf'),JSON[_0xe40f('0x11')](_0x3b9dfd));if(_0x3b9dfd['error']){if(_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x13')]===0x1f4){logger[_0xe40f('0x12')](_0xe40f('0xe'),_0x115266,_0x3b9dfd[_0xe40f('0x12')]['message']);return _0x3a5e58(_0x3b9dfd['error']['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x115266,_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x14')]);return _0x1b4f1e(_0x3b9dfd[_0xe40f('0x12')][_0xe40f('0x14')]);}else{logger[_0xe40f('0x15')](_0xe40f('0xe'),_0x115266,_0xe40f('0xf'));_0x1b4f1e(_0x3b9dfd['result'][_0xe40f('0x14')]);}})[_0xe40f('0x16')](function(_0x4c89e5){logger['error'](_0xe40f('0xe'),_0x115266,_0x4c89e5);_0x3a5e58(_0x4c89e5);});});} \ No newline at end of file +var _0xf585=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5b7186,_0x1ea912){var _0x44a4ac=function(_0xed3a19){while(--_0xed3a19){_0x5b7186['push'](_0x5b7186['shift']());}};_0x44a4ac(++_0x1ea912);}(_0xf585,0x19b));var _0x5f58=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf585[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x5f58('0x0'));var util=require(_0x5f58('0x1'));var moment=require(_0x5f58('0x2'));var BPromise=require(_0x5f58('0x3'));var rs=require(_0x5f58('0x4'));var fs=require('fs');var Redis=require(_0x5f58('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f58('0x6'));var logger=require(_0x5f58('0x7'))(_0x5f58('0x8'));var config=require(_0x5f58('0x9'));var jayson=require(_0x5f58('0xa'));var client=jayson[_0x5f58('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c8ed8,_0x68749e,_0x25a0d9){return new BPromise(function(_0x1ed196,_0x27a0f5){return client[_0x5f58('0xc')](_0x5c8ed8,_0x25a0d9)[_0x5f58('0xd')](function(_0x5ca6d1){logger[_0x5f58('0xe')](_0x5f58('0xf'),_0x68749e,_0x5f58('0x10'));logger[_0x5f58('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x68749e,_0x5f58('0x10'),JSON[_0x5f58('0x12')](_0x5ca6d1));if(_0x5ca6d1[_0x5f58('0x13')]){if(_0x5ca6d1[_0x5f58('0x13')][_0x5f58('0x14')]===0x1f4){logger['error'](_0x5f58('0xf'),_0x68749e,_0x5ca6d1['error'][_0x5f58('0x15')]);return _0x27a0f5(_0x5ca6d1[_0x5f58('0x13')][_0x5f58('0x15')]);}logger[_0x5f58('0x13')](_0x5f58('0xf'),_0x68749e,_0x5ca6d1[_0x5f58('0x13')][_0x5f58('0x15')]);return _0x1ed196(_0x5ca6d1[_0x5f58('0x13')]['message']);}else{logger['info'](_0x5f58('0xf'),_0x68749e,_0x5f58('0x10'));_0x1ed196(_0x5ca6d1[_0x5f58('0x16')]['message']);}})[_0x5f58('0x17')](function(_0x2d85c0){logger[_0x5f58('0x13')](_0x5f58('0xf'),_0x68749e,_0x2d85c0);_0x27a0f5(_0x2d85c0);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index e8965e0..133ce43 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 _0x8fa6=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util'];(function(_0x554d5a,_0x7e474f){var _0x1f219f=function(_0x562921){while(--_0x562921){_0x554d5a['push'](_0x554d5a['shift']());}};_0x1f219f(++_0x7e474f);}(_0x8fa6,0x19c));var _0x68fa=function(_0x219e19,_0x972a89){_0x219e19=_0x219e19-0x0;var _0x8fafa=_0x8fa6[_0x219e19];return _0x8fafa;};'use strict';var multer=require(_0x68fa('0x0'));var util=require(_0x68fa('0x1'));var path=require(_0x68fa('0x2'));var timeout=require(_0x68fa('0x3'));var express=require(_0x68fa('0x4'));var router=express[_0x68fa('0x5')]();var fs_extra=require(_0x68fa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68fa('0x7'));var config=require(_0x68fa('0x8'));var controller=require('./intVtigerField.controller');router[_0x68fa('0x9')]('/',auth[_0x68fa('0xa')](),controller[_0x68fa('0xb')]);router[_0x68fa('0x9')](_0x68fa('0xc'),auth[_0x68fa('0xa')](),controller[_0x68fa('0xd')]);router[_0x68fa('0xe')]('/',auth[_0x68fa('0xa')](),controller[_0x68fa('0xf')]);router['put']('/:id',auth[_0x68fa('0xa')](),controller['update']);router['delete']('/:id',auth[_0x68fa('0xa')](),controller[_0x68fa('0x10')]);module[_0x68fa('0x11')]=router; \ No newline at end of file +var _0x80c4=['/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index'];(function(_0xc81ca7,_0xb90d5){var _0x366401=function(_0x181f0a){while(--_0x181f0a){_0xc81ca7['push'](_0xc81ca7['shift']());}};_0x366401(++_0xb90d5);}(_0x80c4,0xc9));var _0x480c=function(_0x5d28c6,_0x5d9857){_0x5d28c6=_0x5d28c6-0x0;var _0x4ae4f7=_0x80c4[_0x5d28c6];return _0x4ae4f7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x480c('0x0'));var express=require(_0x480c('0x1'));var router=express[_0x480c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x480c('0x3'));var controller=require('./intVtigerField.controller');router[_0x480c('0x4')]('/',auth[_0x480c('0x5')](),controller[_0x480c('0x6')]);router[_0x480c('0x4')](_0x480c('0x7'),auth['isAuthenticated'](),controller[_0x480c('0x8')]);router[_0x480c('0x9')]('/',auth[_0x480c('0x5')](),controller[_0x480c('0xa')]);router[_0x480c('0xb')](_0x480c('0x7'),auth[_0x480c('0x5')](),controller[_0x480c('0xc')]);router[_0x480c('0xd')](_0x480c('0x7'),auth[_0x480c('0x5')](),controller[_0x480c('0xe')]);module[_0x480c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 5407c0f..976dd7a 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 _0x6b5c=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6b5c,0xce));var _0xc6b5=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x6b5c[_0x309d93];return _0x2dd61d;};'use strict';var Sequelize=require(_0xc6b5('0x0'));module[_0xc6b5('0x1')]={'type':{'type':Sequelize[_0xc6b5('0x2')](_0xc6b5('0x3'),_0xc6b5('0x4'),_0xc6b5('0x5'),_0xc6b5('0x6'),'picklist'),'defaultValue':_0xc6b5('0x3')},'content':{'type':Sequelize[_0xc6b5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc6b5('0x2')](_0xc6b5('0x3'),_0xc6b5('0x4'),_0xc6b5('0x5'))},'keyContent':{'type':Sequelize[_0xc6b5('0x7')]},'idField':{'type':Sequelize[_0xc6b5('0x7')]},'nameField':{'type':Sequelize[_0xc6b5('0x7')]},'customField':{'type':Sequelize[_0xc6b5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd55f=['sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd55f,0xcb));var _0xfd55=function(_0x2d9cbf,_0x53721e){_0x2d9cbf=_0x2d9cbf-0x0;var _0x33cdcb=_0xd55f[_0x2d9cbf];return _0x33cdcb;};'use strict';var Sequelize=require(_0xfd55('0x0'));module[_0xfd55('0x1')]={'type':{'type':Sequelize[_0xfd55('0x2')](_0xfd55('0x3'),_0xfd55('0x4'),_0xfd55('0x5'),'keyValue','picklist'),'defaultValue':_0xfd55('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfd55('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfd55('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfd55('0x6')]},'nameField':{'type':Sequelize[_0xfd55('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfd55('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ca2e63e..ea25f4d 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 _0x910b=['params','include','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','index','map','VtigerField','rawAttributes','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0x910b,0x98));var _0xb910=function(_0x347d46,_0x54b037){_0x347d46=_0x347d46-0x0;var _0x17b251=_0x910b[_0x347d46];return _0x17b251;};'use strict';var emlformat=require(_0xb910('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb910('0x1'));var rp=require(_0xb910('0x2'));var moment=require(_0xb910('0x3'));var BPromise=require(_0xb910('0x4'));var Mustache=require(_0xb910('0x5'));var util=require(_0xb910('0x6'));var path=require(_0xb910('0x7'));var sox=require(_0xb910('0x8'));var csv=require(_0xb910('0x9'));var ejs=require(_0xb910('0xa'));var fs=require('fs');var fs_extra=require(_0xb910('0xb'));var _=require(_0xb910('0xc'));var squel=require('squel');var crypto=require(_0xb910('0xd'));var jsforce=require(_0xb910('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb910('0x9'));var querystring=require(_0xb910('0xf'));var Papa=require(_0xb910('0x10'));var Redis=require(_0xb910('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb910('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb910('0x13'))(_0xb910('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb910('0x15'));var db=require(_0xb910('0x16'))['db'];function respondWithStatusCode(_0x1143f4,_0x3a99c2){_0x3a99c2=_0x3a99c2||0xcc;return function(_0x286cf6){if(_0x286cf6){return _0x1143f4[_0xb910('0x17')](_0x3a99c2);}return _0x1143f4[_0xb910('0x18')](_0x3a99c2)[_0xb910('0x19')]();};}function respondWithResult(_0x1177ac,_0x336f9c){_0x336f9c=_0x336f9c||0xc8;return function(_0x5de3f8){if(_0x5de3f8){return _0x1177ac['status'](_0x336f9c)[_0xb910('0x1a')](_0x5de3f8);}};}function respondWithFilteredResult(_0x3a66da,_0x2b1993){return function(_0x49dcbc){if(_0x49dcbc){var _0x269c7b=typeof _0x2b1993['offset']==='undefined'&&typeof _0x2b1993[_0xb910('0x1b')]===_0xb910('0x1c');var _0x23636f=_0x49dcbc[_0xb910('0x1d')];var _0x4ca9ae=_0x269c7b?0x0:_0x2b1993['offset'];var _0xaa4a8c=_0x269c7b?_0x49dcbc['count']:_0x2b1993[_0xb910('0x1e')]+_0x2b1993['limit'];var _0x5b66be;if(_0xaa4a8c>=_0x23636f){_0xaa4a8c=_0x23636f;_0x5b66be=0xc8;}else{_0x5b66be=0xce;}_0x3a66da['status'](_0x5b66be);return _0x3a66da[_0xb910('0x1f')](_0xb910('0x20'),_0x4ca9ae+'-'+_0xaa4a8c+'/'+_0x23636f)['json'](_0x49dcbc);}return null;};}function patchUpdates(_0x581491){return function(_0xaf6e5c){try{jsonpatch[_0xb910('0x21')](_0xaf6e5c,_0x581491,!![]);}catch(_0x45383e){return BPromise[_0xb910('0x22')](_0x45383e);}return _0xaf6e5c[_0xb910('0x23')]();};}function saveUpdates(_0x2a4530,_0x3149fa){return function(_0x1f30df){if(_0x1f30df){return _0x1f30df[_0xb910('0x24')](_0x2a4530)[_0xb910('0x25')](function(_0x57314c){return _0x57314c;});}return null;};}function removeEntity(_0x55c9bb,_0x33d265){return function(_0x1c0fac){if(_0x1c0fac){return _0x1c0fac['destroy']()['then'](function(){_0x55c9bb['status'](0xcc)[_0xb910('0x19')]();});}};}function handleEntityNotFound(_0x9726f3,_0xd2721b){return function(_0x54bfcf){if(!_0x54bfcf){_0x9726f3['sendStatus'](0x194);}return _0x54bfcf;};}function handleError(_0x2c22ad,_0x50fd30){_0x50fd30=_0x50fd30||0x1f4;return function(_0x2be392){logger[_0xb910('0x26')](_0x2be392[_0xb910('0x27')]);if(_0x2be392['name']){delete _0x2be392['name'];}_0x2c22ad[_0xb910('0x18')](_0x50fd30)['send'](_0x2be392);};}exports[_0xb910('0x28')]=function(_0x3e3446,_0x3d502c){var _0x3462a2={},_0x12160f={},_0x18badd={'count':0x0,'rows':[]};var _0x1a8503=_[_0xb910('0x29')](db[_0xb910('0x2a')][_0xb910('0x2b')],function(_0x45251b){return{'name':_0x45251b['fieldName'],'type':_0x45251b['type'][_0xb910('0x2c')]};});_0x12160f['model']=_[_0xb910('0x29')](_0x1a8503,_0xb910('0x2d'));_0x12160f[_0xb910('0x2e')]=_[_0xb910('0x2f')](_0x3e3446['query']);_0x12160f['filters']=_[_0xb910('0x30')](_0x12160f[_0xb910('0x31')],_0x12160f[_0xb910('0x2e')]);_0x3462a2[_0xb910('0x32')]=_[_0xb910('0x30')](_0x12160f['model'],qs[_0xb910('0x33')](_0x3e3446[_0xb910('0x2e')]['fields']));_0x3462a2[_0xb910('0x32')]=_0x3462a2[_0xb910('0x32')][_0xb910('0x34')]?_0x3462a2[_0xb910('0x32')]:_0x12160f[_0xb910('0x31')];if(!_0x3e3446['query'][_0xb910('0x35')](_0xb910('0x36'))){_0x3462a2[_0xb910('0x1b')]=qs[_0xb910('0x1b')](_0x3e3446[_0xb910('0x2e')][_0xb910('0x1b')]);_0x3462a2['offset']=qs[_0xb910('0x1e')](_0x3e3446['query'][_0xb910('0x1e')]);}_0x3462a2['order']=qs[_0xb910('0x37')](_0x3e3446[_0xb910('0x2e')][_0xb910('0x37')]);_0x3462a2[_0xb910('0x38')]=qs[_0xb910('0x39')](_[_0xb910('0x3a')](_0x3e3446[_0xb910('0x2e')],_0x12160f[_0xb910('0x39')]),_0x1a8503);if(_0x3e3446[_0xb910('0x2e')][_0xb910('0x3b')]){_0x3462a2[_0xb910('0x38')]=_[_0xb910('0x3c')](_0x3462a2[_0xb910('0x38')],{'$or':_['map'](_0x1a8503,function(_0x39fe2b){if(_0x39fe2b[_0xb910('0x3d')]!==_0xb910('0x3e')){var _0x5c40cb={};_0x5c40cb[_0x39fe2b[_0xb910('0x2d')]]={'$like':'%'+_0x3e3446[_0xb910('0x2e')]['filter']+'%'};return _0x5c40cb;}})});}_0x3462a2=_[_0xb910('0x3c')]({},_0x3462a2,_0x3e3446[_0xb910('0x3f')]);var _0x4d7b25={'where':_0x3462a2[_0xb910('0x38')]};return db[_0xb910('0x2a')][_0xb910('0x1d')](_0x4d7b25)[_0xb910('0x25')](function(_0x4d2d84){_0x18badd[_0xb910('0x1d')]=_0x4d2d84;if(_0x3e3446[_0xb910('0x2e')][_0xb910('0x40')]){_0x3462a2['include']=[{'all':!![]}];}return db[_0xb910('0x2a')]['findAll'](_0x3462a2);})[_0xb910('0x25')](function(_0x48e3e5){_0x18badd[_0xb910('0x41')]=_0x48e3e5;return _0x18badd;})[_0xb910('0x25')](respondWithFilteredResult(_0x3d502c,_0x3462a2))[_0xb910('0x42')](handleError(_0x3d502c,null));};exports['show']=function(_0x5d1884,_0x217f34){var _0x41da37={'raw':!![],'where':{'id':_0x5d1884[_0xb910('0x43')]['id']}},_0x4f1c72={};_0x4f1c72[_0xb910('0x31')]=_[_0xb910('0x2f')](db[_0xb910('0x2a')][_0xb910('0x2b')]);_0x4f1c72[_0xb910('0x2e')]=_[_0xb910('0x2f')](_0x5d1884[_0xb910('0x2e')]);_0x4f1c72['filters']=_[_0xb910('0x30')](_0x4f1c72[_0xb910('0x31')],_0x4f1c72[_0xb910('0x2e')]);_0x41da37[_0xb910('0x32')]=_[_0xb910('0x30')](_0x4f1c72[_0xb910('0x31')],qs[_0xb910('0x33')](_0x5d1884['query'][_0xb910('0x33')]));_0x41da37[_0xb910('0x32')]=_0x41da37[_0xb910('0x32')][_0xb910('0x34')]?_0x41da37['attributes']:_0x4f1c72[_0xb910('0x31')];if(_0x5d1884[_0xb910('0x2e')][_0xb910('0x40')]){_0x41da37[_0xb910('0x44')]=[{'all':!![]}];}_0x41da37=_[_0xb910('0x3c')]({},_0x41da37,_0x5d1884[_0xb910('0x3f')]);return db['VtigerField'][_0xb910('0x45')](_0x41da37)[_0xb910('0x25')](handleEntityNotFound(_0x217f34,null))[_0xb910('0x25')](respondWithResult(_0x217f34,null))['catch'](handleError(_0x217f34,null));};exports[_0xb910('0x46')]=function(_0x410887,_0x10358c){return db[_0xb910('0x2a')][_0xb910('0x46')](_0x410887[_0xb910('0x47')],{})[_0xb910('0x25')](respondWithResult(_0x10358c,0xc9))[_0xb910('0x42')](handleError(_0x10358c,null));};exports['update']=function(_0x8cc3b7,_0x1e5d8c){if(_0x8cc3b7[_0xb910('0x47')]['id']){delete _0x8cc3b7['body']['id'];}return db[_0xb910('0x2a')][_0xb910('0x45')]({'where':{'id':_0x8cc3b7[_0xb910('0x43')]['id']}})[_0xb910('0x25')](handleEntityNotFound(_0x1e5d8c,null))[_0xb910('0x25')](saveUpdates(_0x8cc3b7[_0xb910('0x47')],null))[_0xb910('0x25')](respondWithResult(_0x1e5d8c,null))[_0xb910('0x42')](handleError(_0x1e5d8c,null));};exports[_0xb910('0x48')]=function(_0x1f0456,_0x5618c8){return db[_0xb910('0x2a')][_0xb910('0x45')]({'where':{'id':_0x1f0456[_0xb910('0x43')]['id']}})[_0xb910('0x25')](handleEntityNotFound(_0x5618c8,null))[_0xb910('0x25')](removeEntity(_0x5618c8,null))['catch'](handleError(_0x5618c8,null));}; \ No newline at end of file +var _0xdf38=['options','VtigerField','then','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x478dda,_0x507258){var _0x5a8847=function(_0xc7a033){while(--_0xc7a033){_0x478dda['push'](_0x478dda['shift']());}};_0x5a8847(++_0x507258);}(_0xdf38,0xa2));var _0x8df3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdf38[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8df3('0x0'));var jsonpatch=require(_0x8df3('0x1'));var rp=require(_0x8df3('0x2'));var moment=require(_0x8df3('0x3'));var BPromise=require(_0x8df3('0x4'));var Mustache=require(_0x8df3('0x5'));var util=require('util');var path=require(_0x8df3('0x6'));var sox=require(_0x8df3('0x7'));var csv=require(_0x8df3('0x8'));var ejs=require(_0x8df3('0x9'));var fs=require('fs');var fs_extra=require(_0x8df3('0xa'));var _=require(_0x8df3('0xb'));var squel=require(_0x8df3('0xc'));var crypto=require(_0x8df3('0xd'));var jsforce=require(_0x8df3('0xe'));var deskjs=require(_0x8df3('0xf'));var toCsv=require(_0x8df3('0x8'));var querystring=require(_0x8df3('0x10'));var Papa=require(_0x8df3('0x11'));var Redis=require(_0x8df3('0x12'));var authService=require(_0x8df3('0x13'));var qs=require(_0x8df3('0x14'));var as=require(_0x8df3('0x15'));var hardwareService=require(_0x8df3('0x16'));var logger=require('../../config/logger')(_0x8df3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8df3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48365f,_0x368d56){_0x368d56=_0x368d56||0xcc;return function(_0x231149){if(_0x231149){return _0x48365f[_0x8df3('0x19')](_0x368d56);}return _0x48365f[_0x8df3('0x1a')](_0x368d56)[_0x8df3('0x1b')]();};}function respondWithResult(_0x338cab,_0x494de5){_0x494de5=_0x494de5||0xc8;return function(_0x2dcc92){if(_0x2dcc92){return _0x338cab[_0x8df3('0x1a')](_0x494de5)[_0x8df3('0x1c')](_0x2dcc92);}};}function respondWithFilteredResult(_0x4133a5,_0x221ecc){return function(_0x2c7483){if(_0x2c7483){var _0x3323a1=typeof _0x221ecc[_0x8df3('0x1d')]===_0x8df3('0x1e')&&typeof _0x221ecc[_0x8df3('0x1f')]===_0x8df3('0x1e');var _0x3ecf18=_0x2c7483[_0x8df3('0x20')];var _0x52a7e7=_0x3323a1?0x0:_0x221ecc[_0x8df3('0x1d')];var _0x47bbde=_0x3323a1?_0x2c7483[_0x8df3('0x20')]:_0x221ecc[_0x8df3('0x1d')]+_0x221ecc[_0x8df3('0x1f')];var _0x4eb44c;if(_0x47bbde>=_0x3ecf18){_0x47bbde=_0x3ecf18;_0x4eb44c=0xc8;}else{_0x4eb44c=0xce;}_0x4133a5['status'](_0x4eb44c);return _0x4133a5['set'](_0x8df3('0x21'),_0x52a7e7+'-'+_0x47bbde+'/'+_0x3ecf18)[_0x8df3('0x1c')](_0x2c7483);}return null;};}function patchUpdates(_0x478361){return function(_0x368de4){try{jsonpatch[_0x8df3('0x22')](_0x368de4,_0x478361,!![]);}catch(_0x438ccd){return BPromise[_0x8df3('0x23')](_0x438ccd);}return _0x368de4['save']();};}function saveUpdates(_0x2ae0ff,_0x5633e5){return function(_0x59f959){if(_0x59f959){return _0x59f959[_0x8df3('0x24')](_0x2ae0ff)['then'](function(_0x725411){return _0x725411;});}return null;};}function removeEntity(_0x4e5978,_0xe50987){return function(_0x3aa016){if(_0x3aa016){return _0x3aa016[_0x8df3('0x25')]()['then'](function(){_0x4e5978[_0x8df3('0x1a')](0xcc)[_0x8df3('0x1b')]();});}};}function handleEntityNotFound(_0x508dbc,_0xb31ce5){return function(_0x802e49){if(!_0x802e49){_0x508dbc[_0x8df3('0x19')](0x194);}return _0x802e49;};}function handleError(_0x494b95,_0x226d97){_0x226d97=_0x226d97||0x1f4;return function(_0x1ae16e){logger[_0x8df3('0x26')](_0x1ae16e[_0x8df3('0x27')]);if(_0x1ae16e[_0x8df3('0x28')]){delete _0x1ae16e['name'];}_0x494b95[_0x8df3('0x1a')](_0x226d97)[_0x8df3('0x29')](_0x1ae16e);};}exports['index']=function(_0x1f8b50,_0x502b4a){var _0x5f0e78={},_0x548b39={},_0x23f9f8={'count':0x0,'rows':[]};var _0x4447c1=_[_0x8df3('0x2a')](db['VtigerField'][_0x8df3('0x2b')],function(_0x361605){return{'name':_0x361605[_0x8df3('0x2c')],'type':_0x361605[_0x8df3('0x2d')][_0x8df3('0x2e')]};});_0x548b39[_0x8df3('0x2f')]=_[_0x8df3('0x2a')](_0x4447c1,_0x8df3('0x28'));_0x548b39['query']=_[_0x8df3('0x30')](_0x1f8b50[_0x8df3('0x31')]);_0x548b39[_0x8df3('0x32')]=_['intersection'](_0x548b39[_0x8df3('0x2f')],_0x548b39[_0x8df3('0x31')]);_0x5f0e78[_0x8df3('0x33')]=_[_0x8df3('0x34')](_0x548b39[_0x8df3('0x2f')],qs[_0x8df3('0x35')](_0x1f8b50[_0x8df3('0x31')][_0x8df3('0x35')]));_0x5f0e78['attributes']=_0x5f0e78[_0x8df3('0x33')][_0x8df3('0x36')]?_0x5f0e78[_0x8df3('0x33')]:_0x548b39[_0x8df3('0x2f')];if(!_0x1f8b50[_0x8df3('0x31')][_0x8df3('0x37')](_0x8df3('0x38'))){_0x5f0e78[_0x8df3('0x1f')]=qs[_0x8df3('0x1f')](_0x1f8b50['query'][_0x8df3('0x1f')]);_0x5f0e78[_0x8df3('0x1d')]=qs['offset'](_0x1f8b50[_0x8df3('0x31')][_0x8df3('0x1d')]);}_0x5f0e78['order']=qs[_0x8df3('0x39')](_0x1f8b50['query'][_0x8df3('0x39')]);_0x5f0e78[_0x8df3('0x3a')]=qs[_0x8df3('0x32')](_[_0x8df3('0x3b')](_0x1f8b50['query'],_0x548b39[_0x8df3('0x32')]),_0x4447c1);if(_0x1f8b50['query'][_0x8df3('0x3c')]){_0x5f0e78[_0x8df3('0x3a')]=_['merge'](_0x5f0e78[_0x8df3('0x3a')],{'$or':_[_0x8df3('0x2a')](_0x4447c1,function(_0x37699c){if(_0x37699c[_0x8df3('0x2d')]!==_0x8df3('0x3d')){var _0x2b25cc={};_0x2b25cc[_0x37699c[_0x8df3('0x28')]]={'$like':'%'+_0x1f8b50[_0x8df3('0x31')][_0x8df3('0x3c')]+'%'};return _0x2b25cc;}})});}_0x5f0e78=_[_0x8df3('0x3e')]({},_0x5f0e78,_0x1f8b50[_0x8df3('0x3f')]);var _0x5709cd={'where':_0x5f0e78['where']};return db[_0x8df3('0x40')]['count'](_0x5709cd)[_0x8df3('0x41')](function(_0x292338){_0x23f9f8[_0x8df3('0x20')]=_0x292338;if(_0x1f8b50[_0x8df3('0x31')][_0x8df3('0x42')]){_0x5f0e78[_0x8df3('0x43')]=[{'all':!![]}];}return db[_0x8df3('0x40')]['findAll'](_0x5f0e78);})[_0x8df3('0x41')](function(_0x2356d6){_0x23f9f8[_0x8df3('0x44')]=_0x2356d6;return _0x23f9f8;})[_0x8df3('0x41')](respondWithFilteredResult(_0x502b4a,_0x5f0e78))[_0x8df3('0x45')](handleError(_0x502b4a,null));};exports[_0x8df3('0x46')]=function(_0x308bbf,_0x296724){var _0xd236ae={'raw':!![],'where':{'id':_0x308bbf[_0x8df3('0x47')]['id']}},_0x6c1053={};_0x6c1053[_0x8df3('0x2f')]=_[_0x8df3('0x30')](db[_0x8df3('0x40')][_0x8df3('0x2b')]);_0x6c1053['query']=_['keys'](_0x308bbf[_0x8df3('0x31')]);_0x6c1053[_0x8df3('0x32')]=_[_0x8df3('0x34')](_0x6c1053[_0x8df3('0x2f')],_0x6c1053['query']);_0xd236ae['attributes']=_[_0x8df3('0x34')](_0x6c1053[_0x8df3('0x2f')],qs[_0x8df3('0x35')](_0x308bbf[_0x8df3('0x31')][_0x8df3('0x35')]));_0xd236ae[_0x8df3('0x33')]=_0xd236ae[_0x8df3('0x33')][_0x8df3('0x36')]?_0xd236ae[_0x8df3('0x33')]:_0x6c1053[_0x8df3('0x2f')];if(_0x308bbf[_0x8df3('0x31')]['includeAll']){_0xd236ae[_0x8df3('0x43')]=[{'all':!![]}];}_0xd236ae=_[_0x8df3('0x3e')]({},_0xd236ae,_0x308bbf[_0x8df3('0x3f')]);return db[_0x8df3('0x40')][_0x8df3('0x48')](_0xd236ae)['then'](handleEntityNotFound(_0x296724,null))['then'](respondWithResult(_0x296724,null))[_0x8df3('0x45')](handleError(_0x296724,null));};exports[_0x8df3('0x49')]=function(_0x32569a,_0x5c94fd){return db['VtigerField'][_0x8df3('0x49')](_0x32569a[_0x8df3('0x4a')],{})['then'](respondWithResult(_0x5c94fd,0xc9))[_0x8df3('0x45')](handleError(_0x5c94fd,null));};exports[_0x8df3('0x24')]=function(_0x536753,_0x161cc3){if(_0x536753['body']['id']){delete _0x536753[_0x8df3('0x4a')]['id'];}return db['VtigerField'][_0x8df3('0x48')]({'where':{'id':_0x536753['params']['id']}})[_0x8df3('0x41')](handleEntityNotFound(_0x161cc3,null))[_0x8df3('0x41')](saveUpdates(_0x536753[_0x8df3('0x4a')],null))[_0x8df3('0x41')](respondWithResult(_0x161cc3,null))[_0x8df3('0x45')](handleError(_0x161cc3,null));};exports[_0x8df3('0x25')]=function(_0x17295a,_0x3b41c3){return db[_0x8df3('0x40')][_0x8df3('0x48')]({'where':{'id':_0x17295a[_0x8df3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b41c3,null))[_0x8df3('0x41')](removeEntity(_0x3b41c3,null))['catch'](handleError(_0x3b41c3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2a99d44..c95d071 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 _0x4260=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x50bbc7,_0xa9db18){var _0x39d039=function(_0x4b5937){while(--_0x4b5937){_0x50bbc7['push'](_0x50bbc7['shift']());}};_0x39d039(++_0xa9db18);}(_0x4260,0x17f));var _0x0426=function(_0x14f80d,_0x3a99aa){_0x14f80d=_0x14f80d-0x0;var _0x4a25ea=_0x4260[_0x14f80d];return _0x4a25ea;};'use strict';var _=require(_0x0426('0x0'));var util=require(_0x0426('0x1'));var logger=require(_0x0426('0x2'))(_0x0426('0x3'));var moment=require(_0x0426('0x4'));var BPromise=require(_0x0426('0x5'));var rp=require(_0x0426('0x6'));var fs=require('fs');var path=require(_0x0426('0x7'));var rimraf=require(_0x0426('0x8'));var config=require(_0x0426('0x9'));var attributes=require(_0x0426('0xa'));module[_0x0426('0xb')]=function(_0x237556,_0x4bd7bd){return _0x237556[_0x0426('0xc')](_0x0426('0xd'),attributes,{'tableName':_0x0426('0xe'),'paranoid':![],'indexes':[{'name':_0x0426('0xf'),'fields':[_0x0426('0x10'),_0x0426('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8550=['exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8550,0x123));var _0x0855=function(_0x311b64,_0x1a2891){_0x311b64=_0x311b64-0x0;var _0x26fd8f=_0x8550[_0x311b64];return _0x26fd8f;};'use strict';var _=require(_0x0855('0x0'));var util=require('util');var logger=require(_0x0855('0x1'))(_0x0855('0x2'));var moment=require('moment');var BPromise=require(_0x0855('0x3'));var rp=require(_0x0855('0x4'));var fs=require('fs');var path=require(_0x0855('0x5'));var rimraf=require(_0x0855('0x6'));var config=require(_0x0855('0x7'));var attributes=require(_0x0855('0x8'));module[_0x0855('0x9')]=function(_0x203864,_0x4049b5){return _0x203864[_0x0855('0xa')](_0x0855('0xb'),attributes,{'tableName':_0x0855('0xc'),'paranoid':![],'indexes':[{'name':_0x0855('0xd'),'fields':['idField',_0x0855('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index a0f77f3..6f0908e 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 _0x883f=['message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x386078,_0x3aa89e){var _0x4a7083=function(_0x1005bc){while(--_0x1005bc){_0x386078['push'](_0x386078['shift']());}};_0x4a7083(++_0x3aa89e);}(_0x883f,0x147));var _0xf883=function(_0xbfa006,_0x1118d1){_0xbfa006=_0xbfa006-0x0;var _0x396001=_0x883f[_0xbfa006];return _0x396001;};'use strict';var _=require('lodash');var util=require(_0xf883('0x0'));var moment=require('moment');var BPromise=require(_0xf883('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf883('0x2'));var db=require(_0xf883('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf883('0x4'))(_0xf883('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf883('0x6')][_0xf883('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43ccb6,_0x450be5,_0x319773){return new BPromise(function(_0x1e0fcc,_0x25a548){return client['request'](_0x43ccb6,_0x319773)[_0xf883('0x8')](function(_0x12f04b){logger['info'](_0xf883('0x9'),_0x450be5,_0xf883('0xa'));logger['debug'](_0xf883('0xb'),_0x450be5,_0xf883('0xa'),JSON[_0xf883('0xc')](_0x12f04b));if(_0x12f04b[_0xf883('0xd')]){if(_0x12f04b['error'][_0xf883('0xe')]===0x1f4){logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x12f04b['error'][_0xf883('0xf')]);return _0x25a548(_0x12f04b['error'][_0xf883('0xf')]);}logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x12f04b[_0xf883('0xd')][_0xf883('0xf')]);return _0x1e0fcc(_0x12f04b[_0xf883('0xd')][_0xf883('0xf')]);}else{logger[_0xf883('0x10')]('VtigerField,\x20%s,\x20%s',_0x450be5,_0xf883('0xa'));_0x1e0fcc(_0x12f04b[_0xf883('0x11')][_0xf883('0xf')]);}})[_0xf883('0x12')](function(_0x36ddb0){logger[_0xf883('0xd')](_0xf883('0x9'),_0x450be5,_0x36ddb0);_0x25a548(_0x36ddb0);});});} \ No newline at end of file +var _0x412e=['code','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x412e,0x10e));var _0xe412=function(_0x49af6c,_0x5b83db){_0x49af6c=_0x49af6c-0x0;var _0x29d28c=_0x412e[_0x49af6c];return _0x29d28c;};'use strict';var _=require(_0xe412('0x0'));var util=require(_0xe412('0x1'));var moment=require('moment');var BPromise=require(_0xe412('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe412('0x3'));var logger=require(_0xe412('0x4'))('rpc');var config=require(_0xe412('0x5'));var jayson=require(_0xe412('0x6'));var client=jayson['client'][_0xe412('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ee0d8,_0x1d71e4,_0x58a742){return new BPromise(function(_0x212519,_0x203ae3){return client[_0xe412('0x8')](_0x2ee0d8,_0x58a742)['then'](function(_0x36bc8f){logger[_0xe412('0x9')](_0xe412('0xa'),_0x1d71e4,_0xe412('0xb'));logger[_0xe412('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x1d71e4,'request\x20sent',JSON[_0xe412('0xd')](_0x36bc8f));if(_0x36bc8f[_0xe412('0xe')]){if(_0x36bc8f[_0xe412('0xe')][_0xe412('0xf')]===0x1f4){logger[_0xe412('0xe')](_0xe412('0xa'),_0x1d71e4,_0x36bc8f[_0xe412('0xe')]['message']);return _0x203ae3(_0x36bc8f[_0xe412('0xe')][_0xe412('0x10')]);}logger[_0xe412('0xe')]('VtigerField,\x20%s,\x20%s',_0x1d71e4,_0x36bc8f[_0xe412('0xe')][_0xe412('0x10')]);return _0x212519(_0x36bc8f[_0xe412('0xe')][_0xe412('0x10')]);}else{logger[_0xe412('0x9')](_0xe412('0xa'),_0x1d71e4,_0xe412('0xb'));_0x212519(_0x36bc8f[_0xe412('0x11')]['message']);}})[_0xe412('0x12')](function(_0x5aedaf){logger[_0xe412('0xe')]('VtigerField,\x20%s,\x20%s',_0x1d71e4,_0x5aedaf);_0x203ae3(_0x5aedaf);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0802b26..ab6787a 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 _0xbe7b=['Router','../../components/auth/service','./intZendeskAccount.controller','index','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x23b6ab,_0x541da0){var _0x458ab5=function(_0x4cb6a6){while(--_0x4cb6a6){_0x23b6ab['push'](_0x23b6ab['shift']());}};_0x458ab5(++_0x541da0);}(_0xbe7b,0x66));var _0xbbe7=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xbe7b[_0x576e2b];return _0x46461a;};'use strict';var multer=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var path=require(_0xbbe7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbbe7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbbe7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbbe7('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbe7('0x6')]);router[_0xbbe7('0x7')](_0xbbe7('0x8'),auth[_0xbbe7('0x9')](),controller['show']);router['get']('/:id/configurations',auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xa')]);router['get'](_0xbbe7('0xb'),auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xc')]);router[_0xbbe7('0xd')]('/',auth[_0xbbe7('0x9')](),controller[_0xbbe7('0xe')]);router[_0xbbe7('0xd')](_0xbbe7('0xf'),auth[_0xbbe7('0x9')](),controller[_0xbbe7('0x10')]);router[_0xbbe7('0x11')](_0xbbe7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbbe7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbbe7('0x13')]);module[_0xbbe7('0x14')]=router; \ No newline at end of file +var _0xbe7e=['/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0x5acd84,_0x378158){var _0x4fbe2e=function(_0x1b35c5){while(--_0x1b35c5){_0x5acd84['push'](_0x5acd84['shift']());}};_0x4fbe2e(++_0x378158);}(_0xbe7e,0x198));var _0xebe7=function(_0x4a200a,_0x102e4b){_0x4a200a=_0x4a200a-0x0;var _0x14f944=_0xbe7e[_0x4a200a];return _0x14f944;};'use strict';var multer=require(_0xebe7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xebe7('0x1'));var router=express[_0xebe7('0x2')]();var fs_extra=require(_0xebe7('0x3'));var auth=require(_0xebe7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xebe7('0x5'));var controller=require(_0xebe7('0x6'));router[_0xebe7('0x7')]('/',auth[_0xebe7('0x8')](),controller[_0xebe7('0x9')]);router['get'](_0xebe7('0xa'),auth[_0xebe7('0x8')](),controller['show']);router[_0xebe7('0x7')](_0xebe7('0xb'),auth[_0xebe7('0x8')](),controller[_0xebe7('0xc')]);router[_0xebe7('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xebe7('0xd')]);router[_0xebe7('0xe')]('/',auth['isAuthenticated'](),controller[_0xebe7('0xf')]);router[_0xebe7('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xebe7('0x10')]);router['put'](_0xebe7('0xa'),auth['isAuthenticated'](),controller[_0xebe7('0x11')]);router[_0xebe7('0x12')]('/:id',auth[_0xebe7('0x8')](),controller['destroy']);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 9530c0d..eb27cb0 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 _0xfb11=['remoteUri','ENUM','token','password','integrationTab','newTab','sequelize','STRING','username'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfb11[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x1fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fb1('0x1')]},'description':{'type':Sequelize[_0x1fb1('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1fb1('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x3')},'authType':{'type':Sequelize[_0x1fb1('0x4')]('password',_0x1fb1('0x5')),'defaultValue':_0x1fb1('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1fb1('0x4')](_0x1fb1('0x7'),_0x1fb1('0x8')),'defaultValue':_0x1fb1('0x7')}}; \ No newline at end of file +var _0xba18=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x25dcbb,_0x5712ad){var _0x218248=function(_0x36d0a6){while(--_0x36d0a6){_0x25dcbb['push'](_0x25dcbb['shift']());}};_0x218248(++_0x5712ad);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')]},'description':{'type':Sequelize[_0x8ba1('0x2')]},'username':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3')},'password':{'type':Sequelize[_0x8ba1('0x2')]},'token':{'type':Sequelize[_0x8ba1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8ba1('0x4')},'authType':{'type':Sequelize[_0x8ba1('0x5')](_0x8ba1('0x6'),_0x8ba1('0x7')),'defaultValue':_0x8ba1('0x6')},'serverUrl':{'type':Sequelize[_0x8ba1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8ba1('0x8'),_0x8ba1('0x9')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c19bafb..24f62db 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x1adb8e,_0x26c003){var _0x20efb4=function(_0x457f55){while(--_0x457f55){_0x1adb8e['push'](_0x1adb8e['shift']());}};_0x20efb4(++_0x26c003);}(_0xc788,0xc4));var _0x8c78=function(_0x566c5a,_0x42e09c){_0x566c5a=_0x566c5a-0x0;var _0x3c4abe=_0xc788[_0x566c5a];return _0x3c4abe;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});}; \ No newline at end of file +var _0x6b20=['../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','merge','create','body','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','username','password','authType','remoteUri','slice','format','Basic\x20%s','%s:%s','toString','base64','token','headers','Sequelize','ValidationError','Unknown\x20authentication\x20type','remove','includes','ticket_fields','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x547b1a,_0x3ae4b9){var _0x45ed3b=function(_0x3dfe95){while(--_0x3dfe95){_0x547b1a['push'](_0x547b1a['shift']());}};_0x45ed3b(++_0x3ae4b9);}(_0x6b20,0xd1));var _0x06b2=function(_0x320685,_0x394cd6){_0x320685=_0x320685-0x0;var _0x45b32b=_0x6b20[_0x320685];return _0x45b32b;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];var integrations=require(_0x06b2('0x17'));function respondWithStatusCode(_0x810a12,_0x3039c9){_0x3039c9=_0x3039c9||0xcc;return function(_0x926bf6){if(_0x926bf6){return _0x810a12[_0x06b2('0x18')](_0x3039c9);}return _0x810a12[_0x06b2('0x19')](_0x3039c9)[_0x06b2('0x1a')]();};}function respondWithResult(_0x2822e9,_0x26faee){_0x26faee=_0x26faee||0xc8;return function(_0x544de8){if(_0x544de8){return _0x2822e9[_0x06b2('0x19')](_0x26faee)[_0x06b2('0x1b')](_0x544de8);}};}function respondWithFilteredResult(_0x47496c,_0x3830e9){return function(_0xef0466){if(_0xef0466){var _0x45d5c5=typeof _0x3830e9['offset']===_0x06b2('0x1c')&&typeof _0x3830e9[_0x06b2('0x1d')]==='undefined';var _0x1e16d1=_0xef0466['count'];var _0x4c9cae=_0x45d5c5?0x0:_0x3830e9[_0x06b2('0x1e')];var _0x1b4ab0=_0x45d5c5?_0xef0466[_0x06b2('0x1f')]:_0x3830e9[_0x06b2('0x1e')]+_0x3830e9['limit'];var _0x288801;if(_0x1b4ab0>=_0x1e16d1){_0x1b4ab0=_0x1e16d1;_0x288801=0xc8;}else{_0x288801=0xce;}_0x47496c[_0x06b2('0x19')](_0x288801);return _0x47496c[_0x06b2('0x20')](_0x06b2('0x21'),_0x4c9cae+'-'+_0x1b4ab0+'/'+_0x1e16d1)[_0x06b2('0x1b')](_0xef0466);}return null;};}function patchUpdates(_0x368ad8){return function(_0x268e7d){try{jsonpatch['apply'](_0x268e7d,_0x368ad8,!![]);}catch(_0x18c9a9){return BPromise[_0x06b2('0x22')](_0x18c9a9);}return _0x268e7d[_0x06b2('0x23')]();};}function saveUpdates(_0x208384,_0x4e2a4c){return function(_0x4fa84f){if(_0x4fa84f){return _0x4fa84f[_0x06b2('0x24')](_0x208384)[_0x06b2('0x25')](function(_0x4fc95f){return _0x4fc95f;});}return null;};}function removeEntity(_0x39659f,_0x5e40f2){return function(_0x3d58c6){if(_0x3d58c6){return _0x3d58c6[_0x06b2('0x26')]()[_0x06b2('0x25')](function(){_0x39659f['status'](0xcc)[_0x06b2('0x1a')]();});}};}function handleEntityNotFound(_0x306ce,_0xc65820){return function(_0x1a94dc){if(!_0x1a94dc){_0x306ce[_0x06b2('0x18')](0x194);}return _0x1a94dc;};}function handleError(_0x4f5e90,_0xbb00ea){_0xbb00ea=_0xbb00ea||0x1f4;return function(_0x34370b){logger[_0x06b2('0x27')](_0x34370b[_0x06b2('0x28')]);if(_0x34370b[_0x06b2('0x29')]){delete _0x34370b[_0x06b2('0x29')];}_0x4f5e90['status'](_0xbb00ea)[_0x06b2('0x2a')](_0x34370b);};}exports[_0x06b2('0x2b')]=function(_0x2720fa,_0x13c0eb){var _0x1f02d8={},_0x1bfaa9={},_0x3668bb={'count':0x0,'rows':[]};var _0x51698b=_[_0x06b2('0x2c')](db[_0x06b2('0x2d')][_0x06b2('0x2e')],function(_0x15a78b){return{'name':_0x15a78b[_0x06b2('0x2f')],'type':_0x15a78b[_0x06b2('0x30')][_0x06b2('0x31')]};});_0x1bfaa9[_0x06b2('0x32')]=_['map'](_0x51698b,_0x06b2('0x29'));_0x1bfaa9[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x2720fa[_0x06b2('0x33')]);_0x1bfaa9[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x1bfaa9[_0x06b2('0x32')],_0x1bfaa9['query']);_0x1f02d8['attributes']=_[_0x06b2('0x36')](_0x1bfaa9[_0x06b2('0x32')],qs[_0x06b2('0x37')](_0x2720fa['query'][_0x06b2('0x37')]));_0x1f02d8[_0x06b2('0x38')]=_0x1f02d8[_0x06b2('0x38')][_0x06b2('0x39')]?_0x1f02d8[_0x06b2('0x38')]:_0x1bfaa9[_0x06b2('0x32')];if(!_0x2720fa['query'][_0x06b2('0x3a')](_0x06b2('0x3b'))){_0x1f02d8[_0x06b2('0x1d')]=qs['limit'](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x1d')]);_0x1f02d8['offset']=qs[_0x06b2('0x1e')](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x1e')]);}_0x1f02d8[_0x06b2('0x3c')]=qs[_0x06b2('0x3d')](_0x2720fa[_0x06b2('0x33')][_0x06b2('0x3d')]);_0x1f02d8[_0x06b2('0x3e')]=qs[_0x06b2('0x35')](_[_0x06b2('0x3f')](_0x2720fa[_0x06b2('0x33')],_0x1bfaa9[_0x06b2('0x35')]),_0x51698b);if(_0x2720fa['query'][_0x06b2('0x40')]){_0x1f02d8['where']=_['merge'](_0x1f02d8[_0x06b2('0x3e')],{'$or':_['map'](_0x51698b,function(_0x26ab14){if(_0x26ab14['type']!==_0x06b2('0x41')){var _0x369673={};_0x369673[_0x26ab14[_0x06b2('0x29')]]={'$like':'%'+_0x2720fa[_0x06b2('0x33')][_0x06b2('0x40')]+'%'};return _0x369673;}})});}_0x1f02d8=_['merge']({},_0x1f02d8,_0x2720fa[_0x06b2('0x42')]);var _0xee3ec6={'where':_0x1f02d8[_0x06b2('0x3e')]};return db[_0x06b2('0x2d')][_0x06b2('0x1f')](_0xee3ec6)[_0x06b2('0x25')](function(_0x5f2549){_0x3668bb[_0x06b2('0x1f')]=_0x5f2549;if(_0x2720fa[_0x06b2('0x33')]['includeAll']){_0x1f02d8['include']=[{'all':!![]}];}return db[_0x06b2('0x2d')][_0x06b2('0x43')](_0x1f02d8);})[_0x06b2('0x25')](function(_0x3a8452){_0x3668bb[_0x06b2('0x44')]=_0x3a8452;return _0x3668bb;})[_0x06b2('0x25')](respondWithFilteredResult(_0x13c0eb,_0x1f02d8))[_0x06b2('0x45')](handleError(_0x13c0eb,null));};exports[_0x06b2('0x46')]=function(_0x2e2a80,_0x117bf4){var _0x1d7750={'raw':![],'where':{'id':_0x2e2a80[_0x06b2('0x47')]['id']}},_0xf9b9e={};_0xf9b9e[_0x06b2('0x32')]=_[_0x06b2('0x34')](db[_0x06b2('0x2d')][_0x06b2('0x2e')]);_0xf9b9e[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x2e2a80['query']);_0xf9b9e[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0xf9b9e[_0x06b2('0x32')],_0xf9b9e[_0x06b2('0x33')]);_0x1d7750['attributes']=_[_0x06b2('0x36')](_0xf9b9e[_0x06b2('0x32')],qs['fields'](_0x2e2a80[_0x06b2('0x33')][_0x06b2('0x37')]));_0x1d7750['attributes']=_0x1d7750[_0x06b2('0x38')][_0x06b2('0x39')]?_0x1d7750['attributes']:_0xf9b9e['model'];if(_0x2e2a80['query'][_0x06b2('0x48')]){_0x1d7750[_0x06b2('0x49')]=[{'all':!![]}];}_0x1d7750=_[_0x06b2('0x4a')]({},_0x1d7750,_0x2e2a80[_0x06b2('0x42')]);return db[_0x06b2('0x2d')]['find'](_0x1d7750)['then'](handleEntityNotFound(_0x117bf4,null))[_0x06b2('0x25')](respondWithResult(_0x117bf4,null))[_0x06b2('0x45')](handleError(_0x117bf4,null));};exports[_0x06b2('0x4b')]=function(_0x1f4d89,_0x33ac29){return db[_0x06b2('0x2d')]['create'](_0x1f4d89[_0x06b2('0x4c')],{})[_0x06b2('0x25')](respondWithResult(_0x33ac29,0xc9))[_0x06b2('0x45')](handleError(_0x33ac29,null));};exports[_0x06b2('0x24')]=function(_0x146c5c,_0x36a74a){if(_0x146c5c['body']['id']){delete _0x146c5c[_0x06b2('0x4c')]['id'];}return db[_0x06b2('0x2d')][_0x06b2('0x4d')]({'where':{'id':_0x146c5c[_0x06b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x36a74a,null))[_0x06b2('0x25')](saveUpdates(_0x146c5c[_0x06b2('0x4c')],null))[_0x06b2('0x25')](respondWithResult(_0x36a74a,null))[_0x06b2('0x45')](handleError(_0x36a74a,null));};exports['destroy']=function(_0x346f04,_0x8cf9fe){return db[_0x06b2('0x2d')][_0x06b2('0x4d')]({'where':{'id':_0x346f04[_0x06b2('0x47')]['id']}})[_0x06b2('0x25')](handleEntityNotFound(_0x8cf9fe,null))[_0x06b2('0x25')](removeEntity(_0x8cf9fe,null))[_0x06b2('0x45')](handleError(_0x8cf9fe,null));};exports['getConfigurations']=function(_0x33bc8e,_0x8288ae,_0x318a3b){var _0x5c328c={};var _0x2857d5={};var _0x2f75a0;var _0x4fba4c;return db['ZendeskAccount'][_0x06b2('0x4e')]({'where':{'id':_0x33bc8e['params']['id']}})['then'](handleEntityNotFound(_0x8288ae,null))[_0x06b2('0x25')](function(_0x5899c1){if(_0x5899c1){_0x2f75a0=_0x5899c1;_0x2857d5[_0x06b2('0x32')]=_[_0x06b2('0x34')](db[_0x06b2('0x4f')][_0x06b2('0x2e')]);_0x2857d5[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x33bc8e[_0x06b2('0x33')]);_0x2857d5[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x2857d5[_0x06b2('0x32')],_0x2857d5['query']);_0x5c328c['attributes']=_[_0x06b2('0x36')](_0x2857d5[_0x06b2('0x32')],qs['fields'](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x37')]));_0x5c328c[_0x06b2('0x38')]=_0x5c328c[_0x06b2('0x38')]['length']?_0x5c328c['attributes']:_0x2857d5['model'];_0x5c328c[_0x06b2('0x3c')]=qs['sort'](_0x33bc8e['query'][_0x06b2('0x3d')]);_0x5c328c[_0x06b2('0x3e')]=qs[_0x06b2('0x35')](_[_0x06b2('0x3f')](_0x33bc8e[_0x06b2('0x33')],_0x2857d5[_0x06b2('0x35')]));if(_0x33bc8e['query'][_0x06b2('0x40')]){_0x5c328c[_0x06b2('0x3e')]=_['merge'](_0x5c328c[_0x06b2('0x3e')],{'$or':_[_0x06b2('0x2c')](_0x5c328c[_0x06b2('0x38')],function(_0x2e0388){var _0x23ce27={};_0x23ce27[_0x2e0388]={'$like':'%'+_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x40')]+'%'};return _0x23ce27;})});}_0x5c328c=_[_0x06b2('0x4a')]({},_0x5c328c,_0x33bc8e[_0x06b2('0x42')]);return _0x2f75a0[_0x06b2('0x50')](_0x5c328c);}})[_0x06b2('0x25')](function(_0x397b16){if(_0x397b16){_0x4fba4c=_0x397b16['length'];if(!_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x3a')]('nolimit')){_0x5c328c[_0x06b2('0x1d')]=qs[_0x06b2('0x1d')](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x1d')]);_0x5c328c['offset']=qs[_0x06b2('0x1e')](_0x33bc8e[_0x06b2('0x33')][_0x06b2('0x1e')]);}return _0x2f75a0['getConfigurations'](_0x5c328c);}})[_0x06b2('0x25')](function(_0x1ad9f7){if(_0x1ad9f7){return _0x1ad9f7?{'count':_0x4fba4c,'rows':_0x1ad9f7}:null;}})[_0x06b2('0x25')](respondWithResult(_0x8288ae,null))[_0x06b2('0x45')](handleError(_0x8288ae,null));};exports[_0x06b2('0x51')]=function(_0x43b907,_0x1aae55,_0x10faea){if(_0x43b907[_0x06b2('0x4c')]['id']){delete _0x43b907['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x43b907['params']['id']}})[_0x06b2('0x25')](handleEntityNotFound(_0x1aae55,null))['then'](function(_0x200a6e){if(_0x200a6e){_0x43b907[_0x06b2('0x4c')][_0x06b2('0x52')]=_0x200a6e['id'];_0x43b907[_0x06b2('0x4c')][_0x06b2('0x53')]=integrations[_0x06b2('0x54')](_0x43b907['body']['channel'],_0x43b907[_0x06b2('0x4c')][_0x06b2('0x30')]);_0x43b907['body'][_0x06b2('0x55')]=integrations[_0x06b2('0x56')](_0x43b907[_0x06b2('0x4c')][_0x06b2('0x57')],_0x43b907[_0x06b2('0x4c')][_0x06b2('0x30')]);return db['ZendeskConfiguration'][_0x06b2('0x4b')](_0x43b907['body'],{'include':[{'model':db[_0x06b2('0x58')],'as':_0x06b2('0x53')},{'model':db[_0x06b2('0x58')],'as':'Descriptions'}]});}return null;})[_0x06b2('0x25')](respondWithResult(_0x1aae55,null))[_0x06b2('0x45')](handleError(_0x1aae55,null));};exports[_0x06b2('0x59')]=function(_0x4cc763,_0xc1010,_0x4900d2){var _0x15b345='';return db[_0x06b2('0x2d')][_0x06b2('0x4e')]({'where':{'id':_0x4cc763[_0x06b2('0x47')]['id']},'attributes':['id',_0x06b2('0x5a'),_0x06b2('0x5b'),'token',_0x06b2('0x5c'),_0x06b2('0x5d')]})[_0x06b2('0x25')](handleEntityNotFound(_0xc1010,null))[_0x06b2('0x25')](function(_0x5f3db5){if(_0x5f3db5){_0x15b345=_0x5f3db5[_0x06b2('0x5d')];var _0x39464c=_0x15b345[_0x06b2('0x5e')](-0x1);if(_0x39464c==='/'){_0x15b345=_0x15b345['substring'](0x0,_0x15b345['lastIndexOf'](_0x39464c));}var _0x3ef003={'method':'GET','uri':util[_0x06b2('0x5f')]('%s/%s',_0x15b345,'ticket_fields'),'json':!![]};switch(_0x5f3db5[_0x06b2('0x5c')]){case _0x06b2('0x5b'):_0x3ef003['headers']={'Authorization':util[_0x06b2('0x5f')](_0x06b2('0x60'),new Buffer(util[_0x06b2('0x5f')](_0x06b2('0x61'),_0x5f3db5[_0x06b2('0x5a')],_0x5f3db5[_0x06b2('0x5b')]))[_0x06b2('0x62')](_0x06b2('0x63')))};break;case _0x06b2('0x64'):_0x3ef003[_0x06b2('0x65')]={'Authorization':util[_0x06b2('0x5f')]('Basic\x20%s',new Buffer(util[_0x06b2('0x5f')]('%s/token:%s',_0x5f3db5['username'],_0x5f3db5[_0x06b2('0x64')]))[_0x06b2('0x62')]('base64'))};break;default:throw new db[(_0x06b2('0x66'))][(_0x06b2('0x67'))](_0x06b2('0x68'));}return rp(_0x3ef003);}})['then'](function(_0x309337){if(_0x309337){var _0x3ff04f=['subject','description','group','assignee'];_[_0x06b2('0x69')](_0x309337['ticket_fields'],function(_0x1e4412){return _0x3ff04f[_0x06b2('0x6a')](_0x1e4412[_0x06b2('0x30')]);});return{'count':_0x309337[_0x06b2('0x6b')][_0x06b2('0x39')],'rows':_[_0x06b2('0x2c')](_0x309337[_0x06b2('0x6b')],function(_0x444725){return{'id':_0x444725['id'],'name':_0x444725[_0x06b2('0x6c')]>0x7?_0x444725[_0x06b2('0x6d')]:_0x444725[_0x06b2('0x30')],'custom':_0x444725[_0x06b2('0x6c')]>0x7?!![]:![],'options':_0x444725[_0x06b2('0x6e')]?_0x444725['system_field_options']:_0x444725['custom_field_options']?_0x444725[_0x06b2('0x6f')]:[]};})};}})[_0x06b2('0x25')](respondWithResult(_0xc1010,null))[_0x06b2('0x45')](function(_0x1328ec){var _0x364706=_0x4cc763[_0x06b2('0x33')]['test']?0x1f4:_0x1328ec['statusCode']||0x1f4;logger[_0x06b2('0x27')](_0x06b2('0x70'),_0x06b2('0x59'),_0x364706,JSON[_0x06b2('0x71')](_0x1328ec));delete _0x1328ec[_0x06b2('0x29')];if(_0x364706===0x191){_0x364706=0x190;}_0xc1010['status'](_0x364706)[_0x06b2('0x2a')](_0x4cc763['query']['test']?{'message':_0x06b2('0x72'),'statusCode':_0x1328ec[_0x06b2('0x73')]}:_0x1328ec);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1c4ccde..ce96ada 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 _0x7fe7=['int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2dd6a3,_0x331095){var _0x4eff75=function(_0xc0d1cb){while(--_0xc0d1cb){_0x2dd6a3['push'](_0x2dd6a3['shift']());}};_0x4eff75(++_0x331095);}(_0x7fe7,0xe1));var _0x77fe=function(_0x287aba,_0x2b05a3){_0x287aba=_0x287aba-0x0;var _0x25d2ea=_0x7fe7[_0x287aba];return _0x25d2ea;};'use strict';var _=require(_0x77fe('0x0'));var util=require(_0x77fe('0x1'));var logger=require(_0x77fe('0x2'))(_0x77fe('0x3'));var moment=require('moment');var BPromise=require(_0x77fe('0x4'));var rp=require(_0x77fe('0x5'));var fs=require('fs');var path=require(_0x77fe('0x6'));var rimraf=require(_0x77fe('0x7'));var config=require(_0x77fe('0x8'));var attributes=require(_0x77fe('0x9'));var integrations=require(_0x77fe('0xa'));module[_0x77fe('0xb')]=function(_0x2306ef,_0x4725c8){return _0x2306ef[_0x77fe('0xc')]('ZendeskAccount',attributes,{'tableName':_0x77fe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74c=['api','moment','bluebird','path','rimraf','../../config/environment','exports','ZendeskAccount','int_zendesk_accounts','util','../../config/logger'];(function(_0x1bcee8,_0x50e73e){var _0x444c74=function(_0x49e550){while(--_0x49e550){_0x1bcee8['push'](_0x1bcee8['shift']());}};_0x444c74(++_0x50e73e);}(_0xa74c,0x106));var _0xca74=function(_0x419c4c,_0x36597b){_0x419c4c=_0x419c4c-0x0;var _0xe7fc46=_0xa74c[_0x419c4c];return _0xe7fc46;};'use strict';var _=require('lodash');var util=require(_0xca74('0x0'));var logger=require(_0xca74('0x1'))(_0xca74('0x2'));var moment=require(_0xca74('0x3'));var BPromise=require(_0xca74('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca74('0x5'));var rimraf=require(_0xca74('0x6'));var config=require(_0xca74('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xca74('0x8')]=function(_0x143e4b,_0x558f39){return _0x143e4b['define'](_0xca74('0x9'),attributes,{'tableName':_0xca74('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 88a711c..b31bc38 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 _0x046b=['error','message','catch','GetZendeskAccount','ZendeskAccount','options','where','attributes','include','map','model','find','ShowZendeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x046b,0x1ba));var _0xb046=function(_0x547302,_0x2fccee){_0x547302=_0x547302-0x0;var _0x3a24f0=_0x046b[_0x547302];return _0x3a24f0;};'use strict';var _=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var moment=require(_0xb046('0x2'));var BPromise=require(_0xb046('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb046('0x4'));var db=require(_0xb046('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb046('0x6'))(_0xb046('0x7'));var config=require(_0xb046('0x8'));var jayson=require(_0xb046('0x9'));var client=jayson[_0xb046('0xa')][_0xb046('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x475e10,_0x24e1d7,_0x2a3c2e){return new BPromise(function(_0x231f85,_0x32aa04){return client[_0xb046('0xc')](_0x475e10,_0x2a3c2e)[_0xb046('0xd')](function(_0x53c263){logger[_0xb046('0xe')](_0xb046('0xf'),_0x24e1d7,_0xb046('0x10'));logger[_0xb046('0x11')](_0xb046('0x12'),_0x24e1d7,'request\x20sent',JSON[_0xb046('0x13')](_0x53c263));if(_0x53c263[_0xb046('0x14')]){if(_0x53c263['error']['code']===0x1f4){logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);return _0x32aa04(_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);}logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x53c263[_0xb046('0x14')][_0xb046('0x15')]);return _0x231f85(_0x53c263['error'][_0xb046('0x15')]);}else{logger[_0xb046('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x24e1d7,_0xb046('0x10'));_0x231f85(_0x53c263['result'][_0xb046('0x15')]);}})[_0xb046('0x16')](function(_0x3199b8){logger[_0xb046('0x14')](_0xb046('0xf'),_0x24e1d7,_0x3199b8);_0x32aa04(_0x3199b8);});});}exports[_0xb046('0x17')]=function(_0x52241f){var _0x47d1ad=this;return new Promise(function(_0x17bbb0,_0x4431bd){return db[_0xb046('0x18')]['findAll']({'raw':_0x52241f['options']?_0x52241f[_0xb046('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x52241f[_0xb046('0x19')]?_0x52241f['options'][_0xb046('0x1a')]||null:null,'attributes':_0x52241f[_0xb046('0x19')]?_0x52241f[_0xb046('0x19')][_0xb046('0x1b')]||null:null,'limit':_0x52241f['options']?_0x52241f['options']['limit']||null:null,'include':_0x52241f[_0xb046('0x19')]?_0x52241f[_0xb046('0x19')][_0xb046('0x1c')]?_[_0xb046('0x1d')](_0x52241f[_0xb046('0x19')][_0xb046('0x1c')],function(_0x51c65d){return{'model':db[_0x51c65d[_0xb046('0x1e')]],'as':_0x51c65d['as'],'attributes':_0x51c65d['attributes'],'include':_0x51c65d['include']?_[_0xb046('0x1d')](_0x51c65d[_0xb046('0x1c')],function(_0x1c3638){return{'model':db[_0x1c3638[_0xb046('0x1e')]],'as':_0x1c3638['as'],'attributes':_0x1c3638[_0xb046('0x1b')],'include':_0x1c3638[_0xb046('0x1c')]?_[_0xb046('0x1d')](_0x1c3638[_0xb046('0x1c')],function(_0x5ac704){return{'model':db[_0x5ac704['model']],'as':_0x5ac704['as'],'attributes':_0x5ac704[_0xb046('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ff57c){logger[_0xb046('0xe')](_0xb046('0x17'),_0x52241f);logger[_0xb046('0x11')](_0xb046('0x17'),_0x52241f,JSON[_0xb046('0x13')](_0x2ff57c));_0x17bbb0(_0x2ff57c);})[_0xb046('0x16')](function(_0x333dbe){logger[_0xb046('0x14')](_0xb046('0x17'),_0x333dbe[_0xb046('0x15')],_0x52241f);_0x4431bd(_0x47d1ad[_0xb046('0x14')](0x1f4,_0x333dbe[_0xb046('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x28b3fb){var _0x5398f9=this;return new Promise(function(_0x9fd5f8,_0x57124d){return db[_0xb046('0x18')][_0xb046('0x1f')]({'raw':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb[_0xb046('0x19')][_0xb046('0x1a')]||null:null,'attributes':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb['options'][_0xb046('0x1b')]||null:null,'include':_0x28b3fb[_0xb046('0x19')]?_0x28b3fb[_0xb046('0x19')]['include']?_[_0xb046('0x1d')](_0x28b3fb[_0xb046('0x19')][_0xb046('0x1c')],function(_0x293b56){return{'model':db[_0x293b56[_0xb046('0x1e')]],'as':_0x293b56['as'],'attributes':_0x293b56[_0xb046('0x1b')],'include':_0x293b56['include']?_['map'](_0x293b56[_0xb046('0x1c')],function(_0x285092){return{'model':db[_0x285092[_0xb046('0x1e')]],'as':_0x285092['as'],'attributes':_0x285092[_0xb046('0x1b')],'include':_0x285092[_0xb046('0x1c')]?_['map'](_0x285092[_0xb046('0x1c')],function(_0x5b0278){return{'model':db[_0x5b0278[_0xb046('0x1e')]],'as':_0x5b0278['as'],'attributes':_0x5b0278[_0xb046('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb046('0xd')](function(_0x271c14){logger[_0xb046('0xe')](_0xb046('0x20'),_0x28b3fb);logger[_0xb046('0x11')](_0xb046('0x20'),_0x28b3fb,JSON['stringify'](_0x271c14));_0x9fd5f8(_0x271c14);})[_0xb046('0x16')](function(_0x10ddfa){logger[_0xb046('0x14')]('ShowZendeskAccount',_0x10ddfa['message'],_0x28b3fb);_0x57124d(_0x5398f9['error'](0x1f4,_0x10ddfa['message']));});});}; \ No newline at end of file +var _0x7971=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7971,0x94));var _0x1797=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7971[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x1797('0x0'));var util=require(_0x1797('0x1'));var moment=require(_0x1797('0x2'));var BPromise=require('bluebird');var rs=require(_0x1797('0x3'));var fs=require('fs');var Redis=require(_0x1797('0x4'));var db=require(_0x1797('0x5'))['db'];var utils=require(_0x1797('0x6'));var logger=require(_0x1797('0x7'))(_0x1797('0x8'));var config=require(_0x1797('0x9'));var jayson=require(_0x1797('0xa'));var client=jayson['client'][_0x1797('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2793cd,_0x277287,_0x29bfcf){return new BPromise(function(_0x655de3,_0x437d36){return client[_0x1797('0xc')](_0x2793cd,_0x29bfcf)[_0x1797('0xd')](function(_0x2a1e3c){logger[_0x1797('0xe')](_0x1797('0xf'),_0x277287,_0x1797('0x10'));logger[_0x1797('0x11')](_0x1797('0x12'),_0x277287,_0x1797('0x10'),JSON[_0x1797('0x13')](_0x2a1e3c));if(_0x2a1e3c[_0x1797('0x14')]){if(_0x2a1e3c[_0x1797('0x14')][_0x1797('0x15')]===0x1f4){logger[_0x1797('0x14')](_0x1797('0xf'),_0x277287,_0x2a1e3c[_0x1797('0x14')][_0x1797('0x16')]);return _0x437d36(_0x2a1e3c[_0x1797('0x14')]['message']);}logger[_0x1797('0x14')](_0x1797('0xf'),_0x277287,_0x2a1e3c['error'][_0x1797('0x16')]);return _0x655de3(_0x2a1e3c[_0x1797('0x14')][_0x1797('0x16')]);}else{logger['info'](_0x1797('0xf'),_0x277287,_0x1797('0x10'));_0x655de3(_0x2a1e3c[_0x1797('0x17')]['message']);}})[_0x1797('0x18')](function(_0x3d596b){logger[_0x1797('0x14')](_0x1797('0xf'),_0x277287,_0x3d596b);_0x437d36(_0x3d596b);});});}exports[_0x1797('0x19')]=function(_0x2fccf9){var _0x514204=this;return new Promise(function(_0x522f70,_0x20392a){return db[_0x1797('0x1a')][_0x1797('0x1b')]({'raw':_0x2fccf9[_0x1797('0x1c')]?_0x2fccf9['options'][_0x1797('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fccf9[_0x1797('0x1c')]?_0x2fccf9[_0x1797('0x1c')][_0x1797('0x1e')]||null:null,'attributes':_0x2fccf9[_0x1797('0x1c')]?_0x2fccf9[_0x1797('0x1c')][_0x1797('0x1f')]||null:null,'limit':_0x2fccf9[_0x1797('0x1c')]?_0x2fccf9[_0x1797('0x1c')]['limit']||null:null,'include':_0x2fccf9['options']?_0x2fccf9[_0x1797('0x1c')][_0x1797('0x20')]?_[_0x1797('0x21')](_0x2fccf9['options'][_0x1797('0x20')],function(_0x249849){return{'model':db[_0x249849[_0x1797('0x22')]],'as':_0x249849['as'],'attributes':_0x249849[_0x1797('0x1f')],'include':_0x249849[_0x1797('0x20')]?_[_0x1797('0x21')](_0x249849[_0x1797('0x20')],function(_0x647587){return{'model':db[_0x647587[_0x1797('0x22')]],'as':_0x647587['as'],'attributes':_0x647587[_0x1797('0x1f')],'include':_0x647587[_0x1797('0x20')]?_['map'](_0x647587['include'],function(_0x225889){return{'model':db[_0x225889[_0x1797('0x22')]],'as':_0x225889['as'],'attributes':_0x225889[_0x1797('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1797('0xd')](function(_0x1b80d8){logger[_0x1797('0xe')](_0x1797('0x19'),_0x2fccf9);logger[_0x1797('0x11')](_0x1797('0x19'),_0x2fccf9,JSON['stringify'](_0x1b80d8));_0x522f70(_0x1b80d8);})[_0x1797('0x18')](function(_0x388048){logger[_0x1797('0x14')](_0x1797('0x19'),_0x388048[_0x1797('0x16')],_0x2fccf9);_0x20392a(_0x514204[_0x1797('0x14')](0x1f4,_0x388048['message']));});});};exports[_0x1797('0x23')]=function(_0x24448c){var _0x3bb121=this;return new Promise(function(_0x19266b,_0xad2156){return db[_0x1797('0x1a')][_0x1797('0x24')]({'raw':_0x24448c[_0x1797('0x1c')]?_0x24448c[_0x1797('0x1c')][_0x1797('0x1d')]===undefined?!![]:![]:!![],'where':_0x24448c['options']?_0x24448c[_0x1797('0x1c')][_0x1797('0x1e')]||null:null,'attributes':_0x24448c[_0x1797('0x1c')]?_0x24448c[_0x1797('0x1c')][_0x1797('0x1f')]||null:null,'include':_0x24448c['options']?_0x24448c[_0x1797('0x1c')][_0x1797('0x20')]?_[_0x1797('0x21')](_0x24448c[_0x1797('0x1c')][_0x1797('0x20')],function(_0xe3a544){return{'model':db[_0xe3a544[_0x1797('0x22')]],'as':_0xe3a544['as'],'attributes':_0xe3a544[_0x1797('0x1f')],'include':_0xe3a544['include']?_[_0x1797('0x21')](_0xe3a544[_0x1797('0x20')],function(_0x55dc6f){return{'model':db[_0x55dc6f[_0x1797('0x22')]],'as':_0x55dc6f['as'],'attributes':_0x55dc6f['attributes'],'include':_0x55dc6f['include']?_[_0x1797('0x21')](_0x55dc6f[_0x1797('0x20')],function(_0x360f9f){return{'model':db[_0x360f9f['model']],'as':_0x360f9f['as'],'attributes':_0x360f9f[_0x1797('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1797('0xd')](function(_0x41253b){logger['info'](_0x1797('0x23'),_0x24448c);logger[_0x1797('0x11')](_0x1797('0x23'),_0x24448c,JSON[_0x1797('0x13')](_0x41253b));_0x19266b(_0x41253b);})[_0x1797('0x18')](function(_0x330adf){logger[_0x1797('0x14')](_0x1797('0x23'),_0x330adf[_0x1797('0x16')],_0x24448c);_0xad2156(_0x3bb121[_0x1797('0x14')](0x1f4,_0x330adf[_0x1797('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 78e1061..51a1b7f 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 _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0xb688,0xcf));var _0x8b68=function(_0x52e6a1,_0x1a3335){_0x52e6a1=_0x52e6a1-0x0;var _0x3a6894=_0xb688[_0x52e6a1];return _0x3a6894;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5ab3716..ac97f82 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 _0x18e1=['sequelize'];(function(_0xc5b34f,_0x2e4810){var _0x2eeb54=function(_0x4d45f3){while(--_0x4d45f3){_0xc5b34f['push'](_0xc5b34f['shift']());}};_0x2eeb54(++_0x2e4810);}(_0x18e1,0x6b));var _0x118e=function(_0x12a884,_0x3803c5){_0x12a884=_0x12a884-0x0;var _0x2d604e=_0x18e1[_0x12a884];return _0x2d604e;};'use strict';var Sequelize=require(_0x118e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb87e=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb87e,0x1b2));var _0xeb87=function(_0x57ae67,_0x3f8c61){_0x57ae67=_0x57ae67-0x0;var _0x3f762f=_0xb87e[_0x57ae67];return _0x3f762f;};'use strict';var Sequelize=require(_0xeb87('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb87('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 9c70a8e..41c98b6 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 _0x72b4=['fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','include','rows','catch','show','keys','rawAttributes','find','create','body','params','getFields','findOne','merge','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ZendeskConfiguration'];(function(_0x307b78,_0x4ce9d0){var _0x4fd7ca=function(_0x4405ab){while(--_0x4405ab){_0x307b78['push'](_0x307b78['shift']());}};_0x4fd7ca(++_0x4ce9d0);}(_0x72b4,0x173));var _0x472b=function(_0x27a9cc,_0x1b1b55){_0x27a9cc=_0x27a9cc-0x0;var _0x412f06=_0x72b4[_0x27a9cc];return _0x412f06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x472b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x472b('0x1'));var rp=require(_0x472b('0x2'));var moment=require(_0x472b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x472b('0x4'));var util=require('util');var path=require(_0x472b('0x5'));var sox=require(_0x472b('0x6'));var csv=require(_0x472b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x472b('0x8'));var _=require('lodash');var squel=require(_0x472b('0x9'));var crypto=require('crypto');var jsforce=require(_0x472b('0xa'));var deskjs=require(_0x472b('0xb'));var toCsv=require(_0x472b('0x7'));var querystring=require(_0x472b('0xc'));var Papa=require(_0x472b('0xd'));var Redis=require(_0x472b('0xe'));var authService=require(_0x472b('0xf'));var qs=require(_0x472b('0x10'));var as=require(_0x472b('0x11'));var hardwareService=require(_0x472b('0x12'));var logger=require(_0x472b('0x13'))(_0x472b('0x14'));var utils=require(_0x472b('0x15'));var config=require(_0x472b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x472b('0x17'))['db'];function respondWithStatusCode(_0x81ee33,_0x29ef6b){_0x29ef6b=_0x29ef6b||0xcc;return function(_0x191e20){if(_0x191e20){return _0x81ee33[_0x472b('0x18')](_0x29ef6b);}return _0x81ee33[_0x472b('0x19')](_0x29ef6b)['end']();};}function respondWithResult(_0x3fe7f7,_0x3cd72a){_0x3cd72a=_0x3cd72a||0xc8;return function(_0x3015f2){if(_0x3015f2){return _0x3fe7f7['status'](_0x3cd72a)[_0x472b('0x1a')](_0x3015f2);}};}function respondWithFilteredResult(_0x32fab4,_0x39f279){return function(_0x21efd5){if(_0x21efd5){var _0x3f804b=typeof _0x39f279[_0x472b('0x1b')]===_0x472b('0x1c')&&typeof _0x39f279[_0x472b('0x1d')]===_0x472b('0x1c');var _0x3d3d87=_0x21efd5[_0x472b('0x1e')];var _0x535cdf=_0x3f804b?0x0:_0x39f279['offset'];var _0x12617b=_0x3f804b?_0x21efd5[_0x472b('0x1e')]:_0x39f279['offset']+_0x39f279['limit'];var _0x34963b;if(_0x12617b>=_0x3d3d87){_0x12617b=_0x3d3d87;_0x34963b=0xc8;}else{_0x34963b=0xce;}_0x32fab4['status'](_0x34963b);return _0x32fab4['set'](_0x472b('0x1f'),_0x535cdf+'-'+_0x12617b+'/'+_0x3d3d87)[_0x472b('0x1a')](_0x21efd5);}return null;};}function patchUpdates(_0x4acdae){return function(_0xffec9d){try{jsonpatch[_0x472b('0x20')](_0xffec9d,_0x4acdae,!![]);}catch(_0x4ea7f8){return BPromise[_0x472b('0x21')](_0x4ea7f8);}return _0xffec9d['save']();};}function saveUpdates(_0x548d76,_0x267158){return function(_0x4e8d70){if(_0x4e8d70){return _0x4e8d70[_0x472b('0x22')](_0x548d76)[_0x472b('0x23')](function(_0x3e929d){return _0x3e929d;});}return null;};}function removeEntity(_0x34d32b,_0x5c1c31){return function(_0xcd2c7c){if(_0xcd2c7c){return _0xcd2c7c[_0x472b('0x24')]()[_0x472b('0x23')](function(){_0x34d32b[_0x472b('0x19')](0xcc)[_0x472b('0x25')]();});}};}function handleEntityNotFound(_0x17f179,_0x22e871){return function(_0x26997e){if(!_0x26997e){_0x17f179[_0x472b('0x18')](0x194);}return _0x26997e;};}function handleError(_0x3b12e9,_0x29d29a){_0x29d29a=_0x29d29a||0x1f4;return function(_0xc216d1){logger['error'](_0xc216d1[_0x472b('0x26')]);if(_0xc216d1[_0x472b('0x27')]){delete _0xc216d1['name'];}_0x3b12e9[_0x472b('0x19')](_0x29d29a)[_0x472b('0x28')](_0xc216d1);};}exports[_0x472b('0x29')]=function(_0x12d0cb,_0x5cfcfd){var _0x4b7604={},_0x373ab1={},_0x24d1dd={'count':0x0,'rows':[]};var _0x155996=_[_0x472b('0x2a')](db[_0x472b('0x2b')]['rawAttributes'],function(_0x2bd8a8){return{'name':_0x2bd8a8[_0x472b('0x2c')],'type':_0x2bd8a8['type'][_0x472b('0x2d')]};});_0x373ab1[_0x472b('0x2e')]=_[_0x472b('0x2a')](_0x155996,_0x472b('0x27'));_0x373ab1[_0x472b('0x2f')]=_['keys'](_0x12d0cb[_0x472b('0x2f')]);_0x373ab1[_0x472b('0x30')]=_[_0x472b('0x31')](_0x373ab1['model'],_0x373ab1[_0x472b('0x2f')]);_0x4b7604[_0x472b('0x32')]=_['intersection'](_0x373ab1['model'],qs[_0x472b('0x33')](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x33')]));_0x4b7604[_0x472b('0x32')]=_0x4b7604['attributes'][_0x472b('0x34')]?_0x4b7604[_0x472b('0x32')]:_0x373ab1[_0x472b('0x2e')];if(!_0x12d0cb['query'][_0x472b('0x35')](_0x472b('0x36'))){_0x4b7604[_0x472b('0x1d')]=qs['limit'](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x1d')]);_0x4b7604['offset']=qs[_0x472b('0x1b')](_0x12d0cb[_0x472b('0x2f')][_0x472b('0x1b')]);}_0x4b7604[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x12d0cb[_0x472b('0x2f')]['sort']);_0x4b7604[_0x472b('0x39')]=qs['filters'](_[_0x472b('0x3a')](_0x12d0cb['query'],_0x373ab1[_0x472b('0x30')]),_0x155996);if(_0x12d0cb['query'][_0x472b('0x3b')]){_0x4b7604[_0x472b('0x39')]=_['merge'](_0x4b7604[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x155996,function(_0x142ddd){if(_0x142ddd[_0x472b('0x3c')]!==_0x472b('0x3d')){var _0x5de85e={};_0x5de85e[_0x142ddd['name']]={'$like':'%'+_0x12d0cb[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x5de85e;}})});}_0x4b7604=_['merge']({},_0x4b7604,_0x12d0cb[_0x472b('0x3e')]);var _0x312634={'where':_0x4b7604[_0x472b('0x39')]};return db[_0x472b('0x2b')][_0x472b('0x1e')](_0x312634)['then'](function(_0x3f0755){_0x24d1dd[_0x472b('0x1e')]=_0x3f0755;if(_0x12d0cb[_0x472b('0x2f')]['includeAll']){_0x4b7604[_0x472b('0x3f')]=[{'all':!![]}];}return db[_0x472b('0x2b')]['findAll'](_0x4b7604);})[_0x472b('0x23')](function(_0x37eadf){_0x24d1dd[_0x472b('0x40')]=_0x37eadf;return _0x24d1dd;})['then'](respondWithFilteredResult(_0x5cfcfd,_0x4b7604))[_0x472b('0x41')](handleError(_0x5cfcfd,null));};exports[_0x472b('0x42')]=function(_0x1097e4,_0x4c1a8f){var _0x230d3b={'raw':![],'where':{'id':_0x1097e4['params']['id']}},_0x35593e={};_0x35593e[_0x472b('0x2e')]=_[_0x472b('0x43')](db[_0x472b('0x2b')][_0x472b('0x44')]);_0x35593e[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x1097e4['query']);_0x35593e['filters']=_['intersection'](_0x35593e[_0x472b('0x2e')],_0x35593e[_0x472b('0x2f')]);_0x230d3b[_0x472b('0x32')]=_[_0x472b('0x31')](_0x35593e[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x1097e4[_0x472b('0x2f')]['fields']));_0x230d3b['attributes']=_0x230d3b[_0x472b('0x32')]['length']?_0x230d3b['attributes']:_0x35593e[_0x472b('0x2e')];if(_0x1097e4['query']['includeAll']){_0x230d3b[_0x472b('0x3f')]=[{'all':!![]}];}_0x230d3b=_['merge']({},_0x230d3b,_0x1097e4['options']);return db[_0x472b('0x2b')][_0x472b('0x45')](_0x230d3b)[_0x472b('0x23')](handleEntityNotFound(_0x4c1a8f,null))[_0x472b('0x23')](respondWithResult(_0x4c1a8f,null))['catch'](handleError(_0x4c1a8f,null));};exports[_0x472b('0x46')]=function(_0x23aac4,_0x326959){return db[_0x472b('0x2b')][_0x472b('0x46')](_0x23aac4[_0x472b('0x47')],{})['then'](respondWithResult(_0x326959,0xc9))[_0x472b('0x41')](handleError(_0x326959,null));};exports['update']=function(_0x3e9fd8,_0x5affc8){if(_0x3e9fd8[_0x472b('0x47')]['id']){delete _0x3e9fd8[_0x472b('0x47')]['id'];}return db[_0x472b('0x2b')][_0x472b('0x45')]({'where':{'id':_0x3e9fd8[_0x472b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5affc8,null))['then'](saveUpdates(_0x3e9fd8[_0x472b('0x47')],null))[_0x472b('0x23')](respondWithResult(_0x5affc8,null))['catch'](handleError(_0x5affc8,null));};exports[_0x472b('0x24')]=function(_0x585d23,_0xa684d3){return db[_0x472b('0x2b')][_0x472b('0x45')]({'where':{'id':_0x585d23[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0xa684d3,null))['then'](removeEntity(_0xa684d3,null))[_0x472b('0x41')](handleError(_0xa684d3,null));};exports[_0x472b('0x49')]=function(_0x4a4aca,_0x2826a4,_0x3fdf56){var _0x30504a={};var _0x16fd63={};var _0x8e47e;var _0x562722;return db['ZendeskConfiguration'][_0x472b('0x4a')]({'where':{'id':_0x4a4aca[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x2826a4,null))[_0x472b('0x23')](function(_0x1a083e){if(_0x1a083e){_0x8e47e=_0x1a083e;_0x16fd63['model']=_[_0x472b('0x43')](db['ZendeskField'][_0x472b('0x44')]);_0x16fd63['query']=_[_0x472b('0x43')](_0x4a4aca[_0x472b('0x2f')]);_0x16fd63[_0x472b('0x30')]=_['intersection'](_0x16fd63[_0x472b('0x2e')],_0x16fd63[_0x472b('0x2f')]);_0x30504a[_0x472b('0x32')]=_['intersection'](_0x16fd63[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x4a4aca['query']['fields']));_0x30504a[_0x472b('0x32')]=_0x30504a[_0x472b('0x32')][_0x472b('0x34')]?_0x30504a[_0x472b('0x32')]:_0x16fd63['model'];_0x30504a[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x4a4aca['query'][_0x472b('0x38')]);_0x30504a[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x4a4aca[_0x472b('0x2f')],_0x16fd63[_0x472b('0x30')]));if(_0x4a4aca[_0x472b('0x2f')][_0x472b('0x3b')]){_0x30504a[_0x472b('0x39')]=_[_0x472b('0x4b')](_0x30504a[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x30504a[_0x472b('0x32')],function(_0x5ade02){var _0x29f59e={};_0x29f59e[_0x5ade02]={'$like':'%'+_0x4a4aca['query'][_0x472b('0x3b')]+'%'};return _0x29f59e;})});}_0x30504a=_[_0x472b('0x4b')]({},_0x30504a,_0x4a4aca[_0x472b('0x3e')]);return _0x8e47e[_0x472b('0x49')](_0x30504a);}})[_0x472b('0x23')](function(_0x5dd06a){if(_0x5dd06a){_0x562722=_0x5dd06a[_0x472b('0x34')];if(!_0x4a4aca[_0x472b('0x2f')][_0x472b('0x35')](_0x472b('0x36'))){_0x30504a[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x4a4aca[_0x472b('0x2f')][_0x472b('0x1d')]);_0x30504a[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x4a4aca[_0x472b('0x2f')]['offset']);}return _0x8e47e[_0x472b('0x49')](_0x30504a);}})['then'](function(_0x8d7dae){if(_0x8d7dae){return _0x8d7dae?{'count':_0x562722,'rows':_0x8d7dae}:null;}})[_0x472b('0x23')](respondWithResult(_0x2826a4,null))[_0x472b('0x41')](handleError(_0x2826a4,null));};exports[_0x472b('0x4c')]=function(_0x5e0eb6,_0x320f08,_0x2fc5de){var _0x33ea80={};var _0x5b59d0={};var _0xcf60a4;var _0x1aefee;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x5e0eb6[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x320f08,null))[_0x472b('0x23')](function(_0x173c50){if(_0x173c50){_0xcf60a4=_0x173c50;_0x5b59d0[_0x472b('0x2e')]=_[_0x472b('0x43')](db[_0x472b('0x4d')][_0x472b('0x44')]);_0x5b59d0[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x5e0eb6[_0x472b('0x2f')]);_0x5b59d0['filters']=_[_0x472b('0x31')](_0x5b59d0[_0x472b('0x2e')],_0x5b59d0[_0x472b('0x2f')]);_0x33ea80[_0x472b('0x32')]=_[_0x472b('0x31')](_0x5b59d0[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x33')]));_0x33ea80[_0x472b('0x32')]=_0x33ea80[_0x472b('0x32')][_0x472b('0x34')]?_0x33ea80['attributes']:_0x5b59d0[_0x472b('0x2e')];_0x33ea80[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x38')]);_0x33ea80[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x5e0eb6['query'],_0x5b59d0[_0x472b('0x30')]));if(_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x3b')]){_0x33ea80[_0x472b('0x39')]=_[_0x472b('0x4b')](_0x33ea80[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x33ea80[_0x472b('0x32')],function(_0x2440f2){var _0x2b2a65={};_0x2b2a65[_0x2440f2]={'$like':'%'+_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x2b2a65;})});}_0x33ea80=_[_0x472b('0x4b')]({},_0x33ea80,_0x5e0eb6[_0x472b('0x3e')]);return _0xcf60a4[_0x472b('0x4c')](_0x33ea80);}})[_0x472b('0x23')](function(_0x3a20b4){if(_0x3a20b4){_0x1aefee=_0x3a20b4[_0x472b('0x34')];if(!_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x35')]('nolimit')){_0x33ea80['limit']=qs[_0x472b('0x1d')](_0x5e0eb6[_0x472b('0x2f')]['limit']);_0x33ea80[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x5e0eb6[_0x472b('0x2f')][_0x472b('0x1b')]);}return _0xcf60a4[_0x472b('0x4c')](_0x33ea80);}})[_0x472b('0x23')](function(_0x4b924b){if(_0x4b924b){return _0x4b924b?{'count':_0x1aefee,'rows':_0x4b924b}:null;}})[_0x472b('0x23')](respondWithResult(_0x320f08,null))['catch'](handleError(_0x320f08,null));};exports[_0x472b('0x4e')]=function(_0x52209e,_0x23dff2,_0x5cd83f){var _0x425783={};var _0x4dfd5b={};var _0x35e7a8;var _0x1578c5;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x52209e['params']['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x23dff2,null))[_0x472b('0x23')](function(_0x19878d){if(_0x19878d){_0x35e7a8=_0x19878d;_0x4dfd5b['model']=_[_0x472b('0x43')](db[_0x472b('0x4d')]['rawAttributes']);_0x4dfd5b[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x52209e[_0x472b('0x2f')]);_0x4dfd5b[_0x472b('0x30')]=_[_0x472b('0x31')](_0x4dfd5b[_0x472b('0x2e')],_0x4dfd5b['query']);_0x425783[_0x472b('0x32')]=_[_0x472b('0x31')](_0x4dfd5b[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x52209e[_0x472b('0x2f')][_0x472b('0x33')]));_0x425783['attributes']=_0x425783[_0x472b('0x32')][_0x472b('0x34')]?_0x425783[_0x472b('0x32')]:_0x4dfd5b[_0x472b('0x2e')];_0x425783[_0x472b('0x37')]=qs[_0x472b('0x38')](_0x52209e[_0x472b('0x2f')][_0x472b('0x38')]);_0x425783['where']=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x52209e[_0x472b('0x2f')],_0x4dfd5b[_0x472b('0x30')]));if(_0x52209e[_0x472b('0x2f')][_0x472b('0x3b')]){_0x425783[_0x472b('0x39')]=_['merge'](_0x425783[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x425783['attributes'],function(_0x339d72){var _0x3a865c={};_0x3a865c[_0x339d72]={'$like':'%'+_0x52209e[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x3a865c;})});}_0x425783=_['merge']({},_0x425783,_0x52209e['options']);return _0x35e7a8[_0x472b('0x4e')](_0x425783);}})['then'](function(_0x50d4e1){if(_0x50d4e1){_0x1578c5=_0x50d4e1['length'];if(!_0x52209e[_0x472b('0x2f')][_0x472b('0x35')]('nolimit')){_0x425783[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x52209e['query'][_0x472b('0x1d')]);_0x425783['offset']=qs[_0x472b('0x1b')](_0x52209e[_0x472b('0x2f')]['offset']);}return _0x35e7a8[_0x472b('0x4e')](_0x425783);}})[_0x472b('0x23')](function(_0x446ef9){if(_0x446ef9){return _0x446ef9?{'count':_0x1578c5,'rows':_0x446ef9}:null;}})[_0x472b('0x23')](respondWithResult(_0x23dff2,null))['catch'](handleError(_0x23dff2,null));};exports['getTags']=function(_0x27a2fb,_0x46bfa4,_0x478722){var _0x43bf79={};var _0x323e06={};var _0x1d670a;var _0xfd085;return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x27a2fb[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x46bfa4,null))[_0x472b('0x23')](function(_0x1c694a){if(_0x1c694a){_0x1d670a=_0x1c694a;_0x323e06[_0x472b('0x2e')]=_['keys'](db[_0x472b('0x4f')][_0x472b('0x44')]);_0x323e06[_0x472b('0x2f')]=_[_0x472b('0x43')](_0x27a2fb[_0x472b('0x2f')]);_0x323e06[_0x472b('0x30')]=_[_0x472b('0x31')](_0x323e06['model'],_0x323e06[_0x472b('0x2f')]);_0x43bf79[_0x472b('0x32')]=_['intersection'](_0x323e06[_0x472b('0x2e')],qs[_0x472b('0x33')](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x33')]));_0x43bf79[_0x472b('0x32')]=_0x43bf79[_0x472b('0x32')][_0x472b('0x34')]?_0x43bf79[_0x472b('0x32')]:_0x323e06['model'];_0x43bf79[_0x472b('0x37')]=qs['sort'](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x38')]);_0x43bf79[_0x472b('0x39')]=qs[_0x472b('0x30')](_[_0x472b('0x3a')](_0x27a2fb[_0x472b('0x2f')],_0x323e06[_0x472b('0x30')]));if(_0x27a2fb[_0x472b('0x2f')][_0x472b('0x3b')]){_0x43bf79[_0x472b('0x39')]=_['merge'](_0x43bf79[_0x472b('0x39')],{'$or':_[_0x472b('0x2a')](_0x43bf79[_0x472b('0x32')],function(_0x1a1f04){var _0x1c2779={};_0x1c2779[_0x1a1f04]={'$like':'%'+_0x27a2fb[_0x472b('0x2f')][_0x472b('0x3b')]+'%'};return _0x1c2779;})});}_0x43bf79=_[_0x472b('0x4b')]({},_0x43bf79,_0x27a2fb[_0x472b('0x3e')]);return _0x1d670a[_0x472b('0x50')](_0x43bf79);}})[_0x472b('0x23')](function(_0x472adc){if(_0x472adc){_0xfd085=_0x472adc[_0x472b('0x34')];if(!_0x27a2fb[_0x472b('0x2f')]['hasOwnProperty'](_0x472b('0x36'))){_0x43bf79[_0x472b('0x1d')]=qs[_0x472b('0x1d')](_0x27a2fb['query']['limit']);_0x43bf79[_0x472b('0x1b')]=qs[_0x472b('0x1b')](_0x27a2fb[_0x472b('0x2f')][_0x472b('0x1b')]);}return _0x1d670a['getTags'](_0x43bf79);}})[_0x472b('0x23')](function(_0x26c858){if(_0x26c858){return _0x26c858?{'count':_0xfd085,'rows':_0x26c858}:null;}})[_0x472b('0x23')](respondWithResult(_0x46bfa4,null))[_0x472b('0x41')](handleError(_0x46bfa4,null));};exports[_0x472b('0x51')]=function(_0x126e85,_0x4f1057,_0x55e431){if(_0x126e85[_0x472b('0x47')]['id']){delete _0x126e85[_0x472b('0x47')]['id'];}return db[_0x472b('0x2b')][_0x472b('0x4a')]({'where':{'id':_0x126e85[_0x472b('0x48')]['id']}})[_0x472b('0x23')](handleEntityNotFound(_0x4f1057,null))[_0x472b('0x23')](function(_0x4efb92){if(_0x4efb92){return _0x4efb92[_0x472b('0x51')](_0x126e85[_0x472b('0x47')][_0x472b('0x52')]||[]);}return null;})[_0x472b('0x23')](respondWithResult(_0x4f1057,null))['catch'](handleError(_0x4f1057,null));}; \ No newline at end of file +var _0x8db9=['ZendeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','options','find','body','destroy','getFields','findOne'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x8db9,0x14f));var _0x98db=function(_0x3f9715,_0x431051){_0x3f9715=_0x3f9715-0x0;var _0x2d1e42=_0x8db9[_0x3f9715];return _0x2d1e42;};'use strict';var emlformat=require(_0x98db('0x0'));var rimraf=require(_0x98db('0x1'));var zipdir=require(_0x98db('0x2'));var jsonpatch=require(_0x98db('0x3'));var rp=require(_0x98db('0x4'));var moment=require(_0x98db('0x5'));var BPromise=require(_0x98db('0x6'));var Mustache=require(_0x98db('0x7'));var util=require(_0x98db('0x8'));var path=require(_0x98db('0x9'));var sox=require(_0x98db('0xa'));var csv=require(_0x98db('0xb'));var ejs=require(_0x98db('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98db('0xd'));var squel=require(_0x98db('0xe'));var crypto=require(_0x98db('0xf'));var jsforce=require(_0x98db('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x98db('0x11'));var Papa=require(_0x98db('0x12'));var Redis=require(_0x98db('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98db('0x14'));var logger=require(_0x98db('0x15'))(_0x98db('0x16'));var utils=require(_0x98db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x98db('0x18'))['db'];function respondWithStatusCode(_0x43c1a5,_0x4a3902){_0x4a3902=_0x4a3902||0xcc;return function(_0x444179){if(_0x444179){return _0x43c1a5[_0x98db('0x19')](_0x4a3902);}return _0x43c1a5[_0x98db('0x1a')](_0x4a3902)[_0x98db('0x1b')]();};}function respondWithResult(_0x3c6c1a,_0x3d3ea8){_0x3d3ea8=_0x3d3ea8||0xc8;return function(_0x342fff){if(_0x342fff){return _0x3c6c1a[_0x98db('0x1a')](_0x3d3ea8)['json'](_0x342fff);}};}function respondWithFilteredResult(_0x5f57d7,_0x2353e8){return function(_0x4d21da){if(_0x4d21da){var _0x29b126=typeof _0x2353e8['offset']===_0x98db('0x1c')&&typeof _0x2353e8[_0x98db('0x1d')]===_0x98db('0x1c');var _0x36d348=_0x4d21da[_0x98db('0x1e')];var _0x31183f=_0x29b126?0x0:_0x2353e8['offset'];var _0x1be314=_0x29b126?_0x4d21da['count']:_0x2353e8[_0x98db('0x1f')]+_0x2353e8[_0x98db('0x1d')];var _0x5b314d;if(_0x1be314>=_0x36d348){_0x1be314=_0x36d348;_0x5b314d=0xc8;}else{_0x5b314d=0xce;}_0x5f57d7['status'](_0x5b314d);return _0x5f57d7[_0x98db('0x20')](_0x98db('0x21'),_0x31183f+'-'+_0x1be314+'/'+_0x36d348)[_0x98db('0x22')](_0x4d21da);}return null;};}function patchUpdates(_0x58e891){return function(_0x44d0d7){try{jsonpatch['apply'](_0x44d0d7,_0x58e891,!![]);}catch(_0x3acc10){return BPromise[_0x98db('0x23')](_0x3acc10);}return _0x44d0d7[_0x98db('0x24')]();};}function saveUpdates(_0x1ce605,_0x1797f1){return function(_0x5ada19){if(_0x5ada19){return _0x5ada19[_0x98db('0x25')](_0x1ce605)['then'](function(_0x45417e){return _0x45417e;});}return null;};}function removeEntity(_0x1a4bfb,_0x1fc1d8){return function(_0x1e0611){if(_0x1e0611){return _0x1e0611['destroy']()[_0x98db('0x26')](function(){_0x1a4bfb[_0x98db('0x1a')](0xcc)[_0x98db('0x1b')]();});}};}function handleEntityNotFound(_0x1e2b22,_0x24d22d){return function(_0x2ebcb1){if(!_0x2ebcb1){_0x1e2b22[_0x98db('0x19')](0x194);}return _0x2ebcb1;};}function handleError(_0xaaa1a1,_0x2f93d3){_0x2f93d3=_0x2f93d3||0x1f4;return function(_0x3e721b){logger['error'](_0x3e721b[_0x98db('0x27')]);if(_0x3e721b[_0x98db('0x28')]){delete _0x3e721b[_0x98db('0x28')];}_0xaaa1a1[_0x98db('0x1a')](_0x2f93d3)['send'](_0x3e721b);};}exports[_0x98db('0x29')]=function(_0x48c9eb,_0x14e082){var _0x1a19f6={},_0x359352={},_0x116a25={'count':0x0,'rows':[]};var _0xb7bc6a=_[_0x98db('0x2a')](db[_0x98db('0x2b')][_0x98db('0x2c')],function(_0x458cbc){return{'name':_0x458cbc[_0x98db('0x2d')],'type':_0x458cbc[_0x98db('0x2e')][_0x98db('0x2f')]};});_0x359352[_0x98db('0x30')]=_['map'](_0xb7bc6a,_0x98db('0x28'));_0x359352[_0x98db('0x31')]=_[_0x98db('0x32')](_0x48c9eb['query']);_0x359352[_0x98db('0x33')]=_[_0x98db('0x34')](_0x359352[_0x98db('0x30')],_0x359352[_0x98db('0x31')]);_0x1a19f6[_0x98db('0x35')]=_['intersection'](_0x359352[_0x98db('0x30')],qs[_0x98db('0x36')](_0x48c9eb[_0x98db('0x31')][_0x98db('0x36')]));_0x1a19f6['attributes']=_0x1a19f6[_0x98db('0x35')][_0x98db('0x37')]?_0x1a19f6[_0x98db('0x35')]:_0x359352['model'];if(!_0x48c9eb[_0x98db('0x31')][_0x98db('0x38')](_0x98db('0x39'))){_0x1a19f6[_0x98db('0x1d')]=qs[_0x98db('0x1d')](_0x48c9eb[_0x98db('0x31')][_0x98db('0x1d')]);_0x1a19f6[_0x98db('0x1f')]=qs['offset'](_0x48c9eb[_0x98db('0x31')][_0x98db('0x1f')]);}_0x1a19f6['order']=qs[_0x98db('0x3a')](_0x48c9eb['query'][_0x98db('0x3a')]);_0x1a19f6['where']=qs[_0x98db('0x33')](_[_0x98db('0x3b')](_0x48c9eb['query'],_0x359352[_0x98db('0x33')]),_0xb7bc6a);if(_0x48c9eb[_0x98db('0x31')][_0x98db('0x3c')]){_0x1a19f6[_0x98db('0x3d')]=_[_0x98db('0x3e')](_0x1a19f6['where'],{'$or':_[_0x98db('0x2a')](_0xb7bc6a,function(_0x251a06){if(_0x251a06[_0x98db('0x2e')]!=='VIRTUAL'){var _0x16aed1={};_0x16aed1[_0x251a06[_0x98db('0x28')]]={'$like':'%'+_0x48c9eb[_0x98db('0x31')][_0x98db('0x3c')]+'%'};return _0x16aed1;}})});}_0x1a19f6=_['merge']({},_0x1a19f6,_0x48c9eb['options']);var _0x35be3e={'where':_0x1a19f6[_0x98db('0x3d')]};return db[_0x98db('0x2b')]['count'](_0x35be3e)[_0x98db('0x26')](function(_0x37b69f){_0x116a25[_0x98db('0x1e')]=_0x37b69f;if(_0x48c9eb['query'][_0x98db('0x3f')]){_0x1a19f6[_0x98db('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x98db('0x41')](_0x1a19f6);})[_0x98db('0x26')](function(_0x391810){_0x116a25[_0x98db('0x42')]=_0x391810;return _0x116a25;})[_0x98db('0x26')](respondWithFilteredResult(_0x14e082,_0x1a19f6))[_0x98db('0x43')](handleError(_0x14e082,null));};exports['show']=function(_0x4ee05a,_0x43d5c4){var _0x37d14f={'raw':![],'where':{'id':_0x4ee05a[_0x98db('0x44')]['id']}},_0x40d5f8={};_0x40d5f8[_0x98db('0x30')]=_[_0x98db('0x32')](db[_0x98db('0x2b')][_0x98db('0x2c')]);_0x40d5f8['query']=_['keys'](_0x4ee05a[_0x98db('0x31')]);_0x40d5f8['filters']=_[_0x98db('0x34')](_0x40d5f8['model'],_0x40d5f8[_0x98db('0x31')]);_0x37d14f[_0x98db('0x35')]=_[_0x98db('0x34')](_0x40d5f8[_0x98db('0x30')],qs[_0x98db('0x36')](_0x4ee05a['query'][_0x98db('0x36')]));_0x37d14f[_0x98db('0x35')]=_0x37d14f['attributes'][_0x98db('0x37')]?_0x37d14f[_0x98db('0x35')]:_0x40d5f8[_0x98db('0x30')];if(_0x4ee05a[_0x98db('0x31')]['includeAll']){_0x37d14f[_0x98db('0x40')]=[{'all':!![]}];}_0x37d14f=_[_0x98db('0x3e')]({},_0x37d14f,_0x4ee05a[_0x98db('0x45')]);return db[_0x98db('0x2b')][_0x98db('0x46')](_0x37d14f)[_0x98db('0x26')](handleEntityNotFound(_0x43d5c4,null))['then'](respondWithResult(_0x43d5c4,null))[_0x98db('0x43')](handleError(_0x43d5c4,null));};exports['create']=function(_0x273fa1,_0x359426){return db[_0x98db('0x2b')]['create'](_0x273fa1[_0x98db('0x47')],{})[_0x98db('0x26')](respondWithResult(_0x359426,0xc9))[_0x98db('0x43')](handleError(_0x359426,null));};exports[_0x98db('0x25')]=function(_0x49a22a,_0x4d673c){if(_0x49a22a['body']['id']){delete _0x49a22a['body']['id'];}return db['ZendeskConfiguration'][_0x98db('0x46')]({'where':{'id':_0x49a22a[_0x98db('0x44')]['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x4d673c,null))[_0x98db('0x26')](saveUpdates(_0x49a22a[_0x98db('0x47')],null))[_0x98db('0x26')](respondWithResult(_0x4d673c,null))[_0x98db('0x43')](handleError(_0x4d673c,null));};exports[_0x98db('0x48')]=function(_0x1505e4,_0x3ad673){return db[_0x98db('0x2b')][_0x98db('0x46')]({'where':{'id':_0x1505e4[_0x98db('0x44')]['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x3ad673,null))[_0x98db('0x26')](removeEntity(_0x3ad673,null))['catch'](handleError(_0x3ad673,null));};exports[_0x98db('0x49')]=function(_0x48091e,_0xb3b3c5,_0x1b56d3){var _0x1a014c={};var _0x437a09={};var _0x5a1caf;var _0x45250d;return db[_0x98db('0x2b')][_0x98db('0x4a')]({'where':{'id':_0x48091e['params']['id']}})[_0x98db('0x26')](handleEntityNotFound(_0xb3b3c5,null))[_0x98db('0x26')](function(_0x4194ad){if(_0x4194ad){_0x5a1caf=_0x4194ad;_0x437a09[_0x98db('0x30')]=_['keys'](db[_0x98db('0x4b')][_0x98db('0x2c')]);_0x437a09[_0x98db('0x31')]=_[_0x98db('0x32')](_0x48091e[_0x98db('0x31')]);_0x437a09[_0x98db('0x33')]=_[_0x98db('0x34')](_0x437a09[_0x98db('0x30')],_0x437a09[_0x98db('0x31')]);_0x1a014c[_0x98db('0x35')]=_[_0x98db('0x34')](_0x437a09[_0x98db('0x30')],qs[_0x98db('0x36')](_0x48091e[_0x98db('0x31')][_0x98db('0x36')]));_0x1a014c[_0x98db('0x35')]=_0x1a014c[_0x98db('0x35')][_0x98db('0x37')]?_0x1a014c[_0x98db('0x35')]:_0x437a09[_0x98db('0x30')];_0x1a014c[_0x98db('0x4c')]=qs[_0x98db('0x3a')](_0x48091e['query']['sort']);_0x1a014c[_0x98db('0x3d')]=qs[_0x98db('0x33')](_['pick'](_0x48091e[_0x98db('0x31')],_0x437a09[_0x98db('0x33')]));if(_0x48091e[_0x98db('0x31')]['filter']){_0x1a014c[_0x98db('0x3d')]=_[_0x98db('0x3e')](_0x1a014c[_0x98db('0x3d')],{'$or':_[_0x98db('0x2a')](_0x1a014c['attributes'],function(_0x2bac03){var _0x367b06={};_0x367b06[_0x2bac03]={'$like':'%'+_0x48091e['query'][_0x98db('0x3c')]+'%'};return _0x367b06;})});}_0x1a014c=_[_0x98db('0x3e')]({},_0x1a014c,_0x48091e[_0x98db('0x45')]);return _0x5a1caf[_0x98db('0x49')](_0x1a014c);}})[_0x98db('0x26')](function(_0x302259){if(_0x302259){_0x45250d=_0x302259['length'];if(!_0x48091e['query'][_0x98db('0x38')](_0x98db('0x39'))){_0x1a014c['limit']=qs[_0x98db('0x1d')](_0x48091e[_0x98db('0x31')]['limit']);_0x1a014c[_0x98db('0x1f')]=qs[_0x98db('0x1f')](_0x48091e[_0x98db('0x31')]['offset']);}return _0x5a1caf[_0x98db('0x49')](_0x1a014c);}})[_0x98db('0x26')](function(_0x50ddf2){if(_0x50ddf2){return _0x50ddf2?{'count':_0x45250d,'rows':_0x50ddf2}:null;}})[_0x98db('0x26')](respondWithResult(_0xb3b3c5,null))['catch'](handleError(_0xb3b3c5,null));};exports['getSubjects']=function(_0x1295a5,_0x1c4bd1,_0x2f0091){var _0x4b6ccd={};var _0x59b8f7={};var _0x35c88f;var _0x1eb5d6;return db['ZendeskConfiguration'][_0x98db('0x4a')]({'where':{'id':_0x1295a5[_0x98db('0x44')]['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x1c4bd1,null))[_0x98db('0x26')](function(_0x51789b){if(_0x51789b){_0x35c88f=_0x51789b;_0x59b8f7[_0x98db('0x30')]=_[_0x98db('0x32')](db['ZendeskField']['rawAttributes']);_0x59b8f7[_0x98db('0x31')]=_[_0x98db('0x32')](_0x1295a5[_0x98db('0x31')]);_0x59b8f7[_0x98db('0x33')]=_[_0x98db('0x34')](_0x59b8f7[_0x98db('0x30')],_0x59b8f7[_0x98db('0x31')]);_0x4b6ccd[_0x98db('0x35')]=_[_0x98db('0x34')](_0x59b8f7['model'],qs['fields'](_0x1295a5[_0x98db('0x31')][_0x98db('0x36')]));_0x4b6ccd['attributes']=_0x4b6ccd[_0x98db('0x35')][_0x98db('0x37')]?_0x4b6ccd[_0x98db('0x35')]:_0x59b8f7[_0x98db('0x30')];_0x4b6ccd['order']=qs[_0x98db('0x3a')](_0x1295a5[_0x98db('0x31')]['sort']);_0x4b6ccd[_0x98db('0x3d')]=qs[_0x98db('0x33')](_[_0x98db('0x3b')](_0x1295a5[_0x98db('0x31')],_0x59b8f7[_0x98db('0x33')]));if(_0x1295a5[_0x98db('0x31')][_0x98db('0x3c')]){_0x4b6ccd['where']=_[_0x98db('0x3e')](_0x4b6ccd[_0x98db('0x3d')],{'$or':_[_0x98db('0x2a')](_0x4b6ccd[_0x98db('0x35')],function(_0x268b03){var _0x345156={};_0x345156[_0x268b03]={'$like':'%'+_0x1295a5[_0x98db('0x31')]['filter']+'%'};return _0x345156;})});}_0x4b6ccd=_[_0x98db('0x3e')]({},_0x4b6ccd,_0x1295a5[_0x98db('0x45')]);return _0x35c88f[_0x98db('0x4d')](_0x4b6ccd);}})[_0x98db('0x26')](function(_0xbb7c17){if(_0xbb7c17){_0x1eb5d6=_0xbb7c17[_0x98db('0x37')];if(!_0x1295a5[_0x98db('0x31')][_0x98db('0x38')](_0x98db('0x39'))){_0x4b6ccd[_0x98db('0x1d')]=qs[_0x98db('0x1d')](_0x1295a5[_0x98db('0x31')][_0x98db('0x1d')]);_0x4b6ccd['offset']=qs[_0x98db('0x1f')](_0x1295a5[_0x98db('0x31')]['offset']);}return _0x35c88f[_0x98db('0x4d')](_0x4b6ccd);}})[_0x98db('0x26')](function(_0x46df2e){if(_0x46df2e){return _0x46df2e?{'count':_0x1eb5d6,'rows':_0x46df2e}:null;}})['then'](respondWithResult(_0x1c4bd1,null))[_0x98db('0x43')](handleError(_0x1c4bd1,null));};exports[_0x98db('0x4e')]=function(_0xb93312,_0x45cf52,_0x55d4ab){var _0x11ebcf={};var _0x2e0dc6={};var _0x1ff5e9;var _0x1b95ad;return db[_0x98db('0x2b')][_0x98db('0x4a')]({'where':{'id':_0xb93312['params']['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x45cf52,null))[_0x98db('0x26')](function(_0x59ffd7){if(_0x59ffd7){_0x1ff5e9=_0x59ffd7;_0x2e0dc6[_0x98db('0x30')]=_['keys'](db[_0x98db('0x4b')][_0x98db('0x2c')]);_0x2e0dc6[_0x98db('0x31')]=_['keys'](_0xb93312['query']);_0x2e0dc6[_0x98db('0x33')]=_[_0x98db('0x34')](_0x2e0dc6[_0x98db('0x30')],_0x2e0dc6['query']);_0x11ebcf[_0x98db('0x35')]=_[_0x98db('0x34')](_0x2e0dc6[_0x98db('0x30')],qs['fields'](_0xb93312[_0x98db('0x31')]['fields']));_0x11ebcf['attributes']=_0x11ebcf[_0x98db('0x35')][_0x98db('0x37')]?_0x11ebcf[_0x98db('0x35')]:_0x2e0dc6['model'];_0x11ebcf[_0x98db('0x4c')]=qs[_0x98db('0x3a')](_0xb93312[_0x98db('0x31')]['sort']);_0x11ebcf[_0x98db('0x3d')]=qs[_0x98db('0x33')](_[_0x98db('0x3b')](_0xb93312[_0x98db('0x31')],_0x2e0dc6[_0x98db('0x33')]));if(_0xb93312[_0x98db('0x31')][_0x98db('0x3c')]){_0x11ebcf[_0x98db('0x3d')]=_[_0x98db('0x3e')](_0x11ebcf[_0x98db('0x3d')],{'$or':_[_0x98db('0x2a')](_0x11ebcf[_0x98db('0x35')],function(_0xa97f1f){var _0x5cf44c={};_0x5cf44c[_0xa97f1f]={'$like':'%'+_0xb93312[_0x98db('0x31')]['filter']+'%'};return _0x5cf44c;})});}_0x11ebcf=_[_0x98db('0x3e')]({},_0x11ebcf,_0xb93312[_0x98db('0x45')]);return _0x1ff5e9[_0x98db('0x4e')](_0x11ebcf);}})[_0x98db('0x26')](function(_0x34c461){if(_0x34c461){_0x1b95ad=_0x34c461[_0x98db('0x37')];if(!_0xb93312['query'][_0x98db('0x38')]('nolimit')){_0x11ebcf['limit']=qs[_0x98db('0x1d')](_0xb93312[_0x98db('0x31')][_0x98db('0x1d')]);_0x11ebcf[_0x98db('0x1f')]=qs['offset'](_0xb93312[_0x98db('0x31')][_0x98db('0x1f')]);}return _0x1ff5e9[_0x98db('0x4e')](_0x11ebcf);}})[_0x98db('0x26')](function(_0x5acf7d){if(_0x5acf7d){return _0x5acf7d?{'count':_0x1b95ad,'rows':_0x5acf7d}:null;}})['then'](respondWithResult(_0x45cf52,null))['catch'](handleError(_0x45cf52,null));};exports['getTags']=function(_0x29581d,_0x375466,_0x389691){var _0x4de0d3={};var _0x4d0d1b={};var _0x36fd5e;var _0x382f62;return db[_0x98db('0x2b')]['findOne']({'where':{'id':_0x29581d[_0x98db('0x44')]['id']}})['then'](handleEntityNotFound(_0x375466,null))[_0x98db('0x26')](function(_0x59ddd1){if(_0x59ddd1){_0x36fd5e=_0x59ddd1;_0x4d0d1b[_0x98db('0x30')]=_[_0x98db('0x32')](db[_0x98db('0x4f')][_0x98db('0x2c')]);_0x4d0d1b[_0x98db('0x31')]=_[_0x98db('0x32')](_0x29581d[_0x98db('0x31')]);_0x4d0d1b['filters']=_['intersection'](_0x4d0d1b[_0x98db('0x30')],_0x4d0d1b['query']);_0x4de0d3['attributes']=_['intersection'](_0x4d0d1b['model'],qs[_0x98db('0x36')](_0x29581d[_0x98db('0x31')][_0x98db('0x36')]));_0x4de0d3[_0x98db('0x35')]=_0x4de0d3[_0x98db('0x35')][_0x98db('0x37')]?_0x4de0d3[_0x98db('0x35')]:_0x4d0d1b['model'];_0x4de0d3[_0x98db('0x4c')]=qs[_0x98db('0x3a')](_0x29581d['query'][_0x98db('0x3a')]);_0x4de0d3[_0x98db('0x3d')]=qs[_0x98db('0x33')](_[_0x98db('0x3b')](_0x29581d[_0x98db('0x31')],_0x4d0d1b[_0x98db('0x33')]));if(_0x29581d['query'][_0x98db('0x3c')]){_0x4de0d3[_0x98db('0x3d')]=_[_0x98db('0x3e')](_0x4de0d3[_0x98db('0x3d')],{'$or':_[_0x98db('0x2a')](_0x4de0d3[_0x98db('0x35')],function(_0x14047e){var _0x261859={};_0x261859[_0x14047e]={'$like':'%'+_0x29581d[_0x98db('0x31')]['filter']+'%'};return _0x261859;})});}_0x4de0d3=_[_0x98db('0x3e')]({},_0x4de0d3,_0x29581d[_0x98db('0x45')]);return _0x36fd5e[_0x98db('0x50')](_0x4de0d3);}})[_0x98db('0x26')](function(_0x76ca79){if(_0x76ca79){_0x382f62=_0x76ca79[_0x98db('0x37')];if(!_0x29581d[_0x98db('0x31')]['hasOwnProperty'](_0x98db('0x39'))){_0x4de0d3[_0x98db('0x1d')]=qs[_0x98db('0x1d')](_0x29581d['query']['limit']);_0x4de0d3[_0x98db('0x1f')]=qs[_0x98db('0x1f')](_0x29581d[_0x98db('0x31')]['offset']);}return _0x36fd5e[_0x98db('0x50')](_0x4de0d3);}})[_0x98db('0x26')](function(_0x3d1139){if(_0x3d1139){return _0x3d1139?{'count':_0x382f62,'rows':_0x3d1139}:null;}})[_0x98db('0x26')](respondWithResult(_0x375466,null))[_0x98db('0x43')](handleError(_0x375466,null));};exports[_0x98db('0x51')]=function(_0x513a8c,_0x83fe20,_0x32f85d){if(_0x513a8c[_0x98db('0x47')]['id']){delete _0x513a8c[_0x98db('0x47')]['id'];}return db[_0x98db('0x2b')][_0x98db('0x4a')]({'where':{'id':_0x513a8c[_0x98db('0x44')]['id']}})[_0x98db('0x26')](handleEntityNotFound(_0x83fe20,null))[_0x98db('0x26')](function(_0x1208fe){if(_0x1208fe){return _0x1208fe[_0x98db('0x51')](_0x513a8c[_0x98db('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x83fe20,null))['catch'](handleError(_0x83fe20,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ac3e81f..4e38c5b 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 _0x351d=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x25cf2e,_0x46ab77){var _0x349fe4=function(_0x159134){while(--_0x159134){_0x25cf2e['push'](_0x25cf2e['shift']());}};_0x349fe4(++_0x46ab77);}(_0x351d,0x90));var _0xd351=function(_0x188fab,_0x3736df){_0x188fab=_0x188fab-0x0;var _0x52ae60=_0x351d[_0x188fab];return _0x52ae60;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9354=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x9354,0x96));var _0x4935=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x9354[_0x56fb33];return _0x435ee4;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 924bf47..0db62d7 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 _0x641e=['ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xaf0e1e,_0x35d918){var _0xd25ff4=function(_0x250b24){while(--_0x250b24){_0xaf0e1e['push'](_0xaf0e1e['shift']());}};_0xd25ff4(++_0x35d918);}(_0x641e,0x97));var _0xe641=function(_0x317257,_0x1677dc){_0x317257=_0x317257-0x0;var _0x1f235d=_0x641e[_0x317257];return _0x1f235d;};'use strict';var _=require(_0xe641('0x0'));var util=require('util');var moment=require(_0xe641('0x1'));var BPromise=require(_0xe641('0x2'));var rs=require(_0xe641('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe641('0x4'));var logger=require(_0xe641('0x5'))(_0xe641('0x6'));var config=require(_0xe641('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe641('0x8')][_0xe641('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368d14,_0x403877,_0x586dee){return new BPromise(function(_0x40491b,_0x3d57c3){return client['request'](_0x368d14,_0x586dee)[_0xe641('0xa')](function(_0x56aa6d){logger[_0xe641('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x403877,_0xe641('0xc'));logger[_0xe641('0xd')](_0xe641('0xe'),_0x403877,_0xe641('0xc'),JSON[_0xe641('0xf')](_0x56aa6d));if(_0x56aa6d['error']){if(_0x56aa6d[_0xe641('0x10')]['code']===0x1f4){logger[_0xe641('0x10')](_0xe641('0x11'),_0x403877,_0x56aa6d[_0xe641('0x10')][_0xe641('0x12')]);return _0x3d57c3(_0x56aa6d['error']['message']);}logger['error'](_0xe641('0x11'),_0x403877,_0x56aa6d[_0xe641('0x10')][_0xe641('0x12')]);return _0x40491b(_0x56aa6d[_0xe641('0x10')]['message']);}else{logger[_0xe641('0xb')](_0xe641('0x11'),_0x403877,'request\x20sent');_0x40491b(_0x56aa6d[_0xe641('0x13')][_0xe641('0x12')]);}})[_0xe641('0x14')](function(_0x121116){logger['error'](_0xe641('0x11'),_0x403877,_0x121116);_0x3d57c3(_0x121116);});});} \ No newline at end of file +var _0xf9f0=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x26ca0f,_0x45126b){var _0x5ba1c9=function(_0x37240f){while(--_0x37240f){_0x26ca0f['push'](_0x26ca0f['shift']());}};_0x5ba1c9(++_0x45126b);}(_0xf9f0,0x88));var _0x0f9f=function(_0x4bef1b,_0x29ed3a){_0x4bef1b=_0x4bef1b-0x0;var _0x1f73c8=_0xf9f0[_0x4bef1b];return _0x1f73c8;};'use strict';var _=require(_0x0f9f('0x0'));var util=require(_0x0f9f('0x1'));var moment=require(_0x0f9f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f9f('0x3'));var fs=require('fs');var Redis=require(_0x0f9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f9f('0x5'))(_0x0f9f('0x6'));var config=require(_0x0f9f('0x7'));var jayson=require(_0x0f9f('0x8'));var client=jayson['client'][_0x0f9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fcc03,_0x20e4bf,_0x3d0ae7){return new BPromise(function(_0x3d4127,_0x27d9c0){return client['request'](_0x2fcc03,_0x3d0ae7)[_0x0f9f('0xa')](function(_0x1becc9){logger[_0x0f9f('0xb')](_0x0f9f('0xc'),_0x20e4bf,_0x0f9f('0xd'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x20e4bf,_0x0f9f('0xd'),JSON[_0x0f9f('0xe')](_0x1becc9));if(_0x1becc9[_0x0f9f('0xf')]){if(_0x1becc9[_0x0f9f('0xf')][_0x0f9f('0x10')]===0x1f4){logger[_0x0f9f('0xf')](_0x0f9f('0xc'),_0x20e4bf,_0x1becc9[_0x0f9f('0xf')]['message']);return _0x27d9c0(_0x1becc9[_0x0f9f('0xf')][_0x0f9f('0x11')]);}logger['error'](_0x0f9f('0xc'),_0x20e4bf,_0x1becc9[_0x0f9f('0xf')][_0x0f9f('0x11')]);return _0x3d4127(_0x1becc9[_0x0f9f('0xf')][_0x0f9f('0x11')]);}else{logger[_0x0f9f('0xb')](_0x0f9f('0xc'),_0x20e4bf,'request\x20sent');_0x3d4127(_0x1becc9[_0x0f9f('0x12')][_0x0f9f('0x11')]);}})[_0x0f9f('0x13')](function(_0x2c5c64){logger[_0x0f9f('0xf')](_0x0f9f('0xc'),_0x20e4bf,_0x2c5c64);_0x27d9c0(_0x2c5c64);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5af596e..3a16fae 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 _0x1e3d=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x1e60fa,_0x611d6d){var _0x59a8ee=function(_0xdc465a){while(--_0xdc465a){_0x1e60fa['push'](_0x1e60fa['shift']());}};_0x59a8ee(++_0x611d6d);}(_0x1e3d,0x11e));var _0xd1e3=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x1e3d[_0x2261ce];return _0x524640;};'use strict';var multer=require('multer');var util=require(_0xd1e3('0x0'));var path=require(_0xd1e3('0x1'));var timeout=require(_0xd1e3('0x2'));var express=require(_0xd1e3('0x3'));var router=express[_0xd1e3('0x4')]();var fs_extra=require(_0xd1e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e3('0x6'));var config=require(_0xd1e3('0x7'));var controller=require(_0xd1e3('0x8'));router[_0xd1e3('0x9')]('/',auth[_0xd1e3('0xa')](),controller[_0xd1e3('0xb')]);router[_0xd1e3('0x9')](_0xd1e3('0xc'),auth[_0xd1e3('0xa')](),controller[_0xd1e3('0xd')]);router[_0xd1e3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd1e3('0xf')]);router['put'](_0xd1e3('0xc'),auth[_0xd1e3('0xa')](),controller[_0xd1e3('0x10')]);router[_0xd1e3('0x11')]('/:id',auth[_0xd1e3('0xa')](),controller[_0xd1e3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55d9=['show','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2b0c8f,_0x596d2f){var _0x4cc23d=function(_0x464dd6){while(--_0x464dd6){_0x2b0c8f['push'](_0x2b0c8f['shift']());}};_0x4cc23d(++_0x596d2f);}(_0x55d9,0x170));var _0x955d=function(_0xa1f5c4,_0x247496){_0xa1f5c4=_0xa1f5c4-0x0;var _0x3f2f74=_0x55d9[_0xa1f5c4];return _0x3f2f74;};'use strict';var multer=require(_0x955d('0x0'));var util=require(_0x955d('0x1'));var path=require('path');var timeout=require(_0x955d('0x2'));var express=require(_0x955d('0x3'));var router=express[_0x955d('0x4')]();var fs_extra=require(_0x955d('0x5'));var auth=require(_0x955d('0x6'));var interaction=require(_0x955d('0x7'));var config=require(_0x955d('0x8'));var controller=require('./intZendeskField.controller');router[_0x955d('0x9')]('/',auth[_0x955d('0xa')](),controller[_0x955d('0xb')]);router[_0x955d('0x9')]('/:id',auth[_0x955d('0xa')](),controller[_0x955d('0xc')]);router['post']('/',auth[_0x955d('0xa')](),controller[_0x955d('0xd')]);router[_0x955d('0xe')]('/:id',auth[_0x955d('0xa')](),controller[_0x955d('0xf')]);router[_0x955d('0x10')](_0x955d('0x11'),auth['isAuthenticated'](),controller[_0x955d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index abbfdfc..96b1441 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 _0xafcd=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x3e1b77,_0x4c2c98){var _0x434515=function(_0x37816d){while(--_0x37816d){_0x3e1b77['push'](_0x3e1b77['shift']());}};_0x434515(++_0x4c2c98);}(_0xafcd,0x150));var _0xdafc=function(_0x1992cd,_0x57d364){_0x1992cd=_0x1992cd-0x0;var _0x33c636=_0xafcd[_0x1992cd];return _0x33c636;};'use strict';var Sequelize=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdafc('0x2'),_0xdafc('0x3'),_0xdafc('0x4'),_0xdafc('0x5'),_0xdafc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdafc('0x7')]},'key':{'type':Sequelize[_0xdafc('0x7')]},'keyType':{'type':Sequelize[_0xdafc('0x8')](_0xdafc('0x2'),'variable',_0xdafc('0x4'))},'keyContent':{'type':Sequelize[_0xdafc('0x7')]},'idField':{'type':Sequelize[_0xdafc('0x7')]},'nameField':{'type':Sequelize[_0xdafc('0x7')]},'customField':{'type':Sequelize[_0xdafc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0881=['exports','string','variable','keyValue','STRING','ENUM','sequelize'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x0881,0x133));var _0x1088=function(_0x32017c,_0x3991d4){_0x32017c=_0x32017c-0x0;var _0xca9140=_0x0881[_0x32017c];return _0xca9140;};'use strict';var Sequelize=require(_0x1088('0x0'));module[_0x1088('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1088('0x2'),_0x1088('0x3'),'customVariable',_0x1088('0x4'),'picklist'),'defaultValue':_0x1088('0x2')},'content':{'type':Sequelize[_0x1088('0x5')]},'key':{'type':Sequelize[_0x1088('0x5')]},'keyType':{'type':Sequelize[_0x1088('0x6')]('string',_0x1088('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1088('0x5')]},'idField':{'type':Sequelize[_0x1088('0x5')]},'nameField':{'type':Sequelize[_0x1088('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1088('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 88b7623..1f12ffe 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 _0x0373=['show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x0373,0x1c2));var _0x3037=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x0373[_0x4f027d];return _0xc46890;};'use strict';var emlformat=require(_0x3037('0x0'));var rimraf=require(_0x3037('0x1'));var zipdir=require(_0x3037('0x2'));var jsonpatch=require(_0x3037('0x3'));var rp=require(_0x3037('0x4'));var moment=require(_0x3037('0x5'));var BPromise=require(_0x3037('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3037('0x7'));var sox=require(_0x3037('0x8'));var csv=require(_0x3037('0x9'));var ejs=require(_0x3037('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3037('0xb'));var squel=require(_0x3037('0xc'));var crypto=require(_0x3037('0xd'));var jsforce=require(_0x3037('0xe'));var deskjs=require(_0x3037('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3037('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3037('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3037('0x12'));var logger=require(_0x3037('0x13'))(_0x3037('0x14'));var utils=require(_0x3037('0x15'));var config=require(_0x3037('0x16'));var licenseUtil=require(_0x3037('0x17'));var db=require(_0x3037('0x18'))['db'];function respondWithStatusCode(_0x2e16fd,_0x224113){_0x224113=_0x224113||0xcc;return function(_0x252d6f){if(_0x252d6f){return _0x2e16fd[_0x3037('0x19')](_0x224113);}return _0x2e16fd[_0x3037('0x1a')](_0x224113)[_0x3037('0x1b')]();};}function respondWithResult(_0x50d807,_0x1159f9){_0x1159f9=_0x1159f9||0xc8;return function(_0x3d5ee0){if(_0x3d5ee0){return _0x50d807['status'](_0x1159f9)[_0x3037('0x1c')](_0x3d5ee0);}};}function respondWithFilteredResult(_0x490804,_0x151da7){return function(_0xd4528){if(_0xd4528){var _0x16355e=typeof _0x151da7[_0x3037('0x1d')]===_0x3037('0x1e')&&typeof _0x151da7[_0x3037('0x1f')]===_0x3037('0x1e');var _0x509cb9=_0xd4528[_0x3037('0x20')];var _0x3054ba=_0x16355e?0x0:_0x151da7[_0x3037('0x1d')];var _0x19dba4=_0x16355e?_0xd4528[_0x3037('0x20')]:_0x151da7[_0x3037('0x1d')]+_0x151da7[_0x3037('0x1f')];var _0x568ef4;if(_0x19dba4>=_0x509cb9){_0x19dba4=_0x509cb9;_0x568ef4=0xc8;}else{_0x568ef4=0xce;}_0x490804['status'](_0x568ef4);return _0x490804[_0x3037('0x21')](_0x3037('0x22'),_0x3054ba+'-'+_0x19dba4+'/'+_0x509cb9)[_0x3037('0x1c')](_0xd4528);}return null;};}function patchUpdates(_0xe6e72){return function(_0x183f50){try{jsonpatch[_0x3037('0x23')](_0x183f50,_0xe6e72,!![]);}catch(_0x4ed4a3){return BPromise['reject'](_0x4ed4a3);}return _0x183f50[_0x3037('0x24')]();};}function saveUpdates(_0xfe3ac7,_0x37ca38){return function(_0x3d6157){if(_0x3d6157){return _0x3d6157[_0x3037('0x25')](_0xfe3ac7)[_0x3037('0x26')](function(_0x1c6065){return _0x1c6065;});}return null;};}function removeEntity(_0x61be38,_0x35012d){return function(_0xd8250e){if(_0xd8250e){return _0xd8250e['destroy']()[_0x3037('0x26')](function(){_0x61be38[_0x3037('0x1a')](0xcc)[_0x3037('0x1b')]();});}};}function handleEntityNotFound(_0x1aa014,_0x17928b){return function(_0x2f2bfb){if(!_0x2f2bfb){_0x1aa014[_0x3037('0x19')](0x194);}return _0x2f2bfb;};}function handleError(_0x5b7d09,_0x11fcb8){_0x11fcb8=_0x11fcb8||0x1f4;return function(_0x24b8d3){logger['error'](_0x24b8d3[_0x3037('0x27')]);if(_0x24b8d3[_0x3037('0x28')]){delete _0x24b8d3[_0x3037('0x28')];}_0x5b7d09[_0x3037('0x1a')](_0x11fcb8)[_0x3037('0x29')](_0x24b8d3);};}exports[_0x3037('0x2a')]=function(_0x36faaa,_0x2a875d){var _0x2a2ba5={},_0x39ea1e={},_0x4c5c91={'count':0x0,'rows':[]};var _0x1790ad=_[_0x3037('0x2b')](db[_0x3037('0x2c')][_0x3037('0x2d')],function(_0x22f27c){return{'name':_0x22f27c[_0x3037('0x2e')],'type':_0x22f27c[_0x3037('0x2f')][_0x3037('0x30')]};});_0x39ea1e[_0x3037('0x31')]=_[_0x3037('0x2b')](_0x1790ad,_0x3037('0x28'));_0x39ea1e[_0x3037('0x32')]=_['keys'](_0x36faaa[_0x3037('0x32')]);_0x39ea1e[_0x3037('0x33')]=_[_0x3037('0x34')](_0x39ea1e[_0x3037('0x31')],_0x39ea1e['query']);_0x2a2ba5[_0x3037('0x35')]=_['intersection'](_0x39ea1e['model'],qs['fields'](_0x36faaa[_0x3037('0x32')][_0x3037('0x36')]));_0x2a2ba5['attributes']=_0x2a2ba5[_0x3037('0x35')][_0x3037('0x37')]?_0x2a2ba5['attributes']:_0x39ea1e[_0x3037('0x31')];if(!_0x36faaa[_0x3037('0x32')]['hasOwnProperty'](_0x3037('0x38'))){_0x2a2ba5[_0x3037('0x1f')]=qs[_0x3037('0x1f')](_0x36faaa[_0x3037('0x32')][_0x3037('0x1f')]);_0x2a2ba5[_0x3037('0x1d')]=qs[_0x3037('0x1d')](_0x36faaa[_0x3037('0x32')][_0x3037('0x1d')]);}_0x2a2ba5[_0x3037('0x39')]=qs['sort'](_0x36faaa[_0x3037('0x32')][_0x3037('0x3a')]);_0x2a2ba5[_0x3037('0x3b')]=qs[_0x3037('0x33')](_[_0x3037('0x3c')](_0x36faaa[_0x3037('0x32')],_0x39ea1e[_0x3037('0x33')]),_0x1790ad);if(_0x36faaa[_0x3037('0x32')][_0x3037('0x3d')]){_0x2a2ba5['where']=_[_0x3037('0x3e')](_0x2a2ba5[_0x3037('0x3b')],{'$or':_[_0x3037('0x2b')](_0x1790ad,function(_0x4db52c){if(_0x4db52c[_0x3037('0x2f')]!==_0x3037('0x3f')){var _0xea8178={};_0xea8178[_0x4db52c[_0x3037('0x28')]]={'$like':'%'+_0x36faaa['query']['filter']+'%'};return _0xea8178;}})});}_0x2a2ba5=_['merge']({},_0x2a2ba5,_0x36faaa['options']);var _0xa1e67a={'where':_0x2a2ba5[_0x3037('0x3b')]};return db['ZendeskField'][_0x3037('0x20')](_0xa1e67a)[_0x3037('0x26')](function(_0x333fc8){_0x4c5c91[_0x3037('0x20')]=_0x333fc8;if(_0x36faaa[_0x3037('0x32')][_0x3037('0x40')]){_0x2a2ba5[_0x3037('0x41')]=[{'all':!![]}];}return db[_0x3037('0x2c')][_0x3037('0x42')](_0x2a2ba5);})[_0x3037('0x26')](function(_0xcd65ff){_0x4c5c91['rows']=_0xcd65ff;return _0x4c5c91;})['then'](respondWithFilteredResult(_0x2a875d,_0x2a2ba5))[_0x3037('0x43')](handleError(_0x2a875d,null));};exports[_0x3037('0x44')]=function(_0x1ebf6e,_0x49541d){var _0xf98859={'raw':!![],'where':{'id':_0x1ebf6e['params']['id']}},_0x1b6447={};_0x1b6447['model']=_[_0x3037('0x45')](db[_0x3037('0x2c')][_0x3037('0x2d')]);_0x1b6447[_0x3037('0x32')]=_[_0x3037('0x45')](_0x1ebf6e[_0x3037('0x32')]);_0x1b6447[_0x3037('0x33')]=_[_0x3037('0x34')](_0x1b6447[_0x3037('0x31')],_0x1b6447['query']);_0xf98859[_0x3037('0x35')]=_[_0x3037('0x34')](_0x1b6447[_0x3037('0x31')],qs[_0x3037('0x36')](_0x1ebf6e[_0x3037('0x32')][_0x3037('0x36')]));_0xf98859[_0x3037('0x35')]=_0xf98859[_0x3037('0x35')][_0x3037('0x37')]?_0xf98859['attributes']:_0x1b6447['model'];if(_0x1ebf6e[_0x3037('0x32')][_0x3037('0x40')]){_0xf98859['include']=[{'all':!![]}];}_0xf98859=_['merge']({},_0xf98859,_0x1ebf6e['options']);return db[_0x3037('0x2c')][_0x3037('0x46')](_0xf98859)[_0x3037('0x26')](handleEntityNotFound(_0x49541d,null))['then'](respondWithResult(_0x49541d,null))['catch'](handleError(_0x49541d,null));};exports[_0x3037('0x47')]=function(_0x296abe,_0x3c9319){return db[_0x3037('0x2c')][_0x3037('0x47')](_0x296abe[_0x3037('0x48')],{})[_0x3037('0x26')](respondWithResult(_0x3c9319,0xc9))[_0x3037('0x43')](handleError(_0x3c9319,null));};exports[_0x3037('0x25')]=function(_0x10bd4d,_0x3dbc47){if(_0x10bd4d['body']['id']){delete _0x10bd4d[_0x3037('0x48')]['id'];}return db[_0x3037('0x2c')][_0x3037('0x46')]({'where':{'id':_0x10bd4d[_0x3037('0x49')]['id']}})[_0x3037('0x26')](handleEntityNotFound(_0x3dbc47,null))['then'](saveUpdates(_0x10bd4d[_0x3037('0x48')],null))[_0x3037('0x26')](respondWithResult(_0x3dbc47,null))['catch'](handleError(_0x3dbc47,null));};exports['destroy']=function(_0x5b8340,_0x28e026){return db[_0x3037('0x2c')][_0x3037('0x46')]({'where':{'id':_0x5b8340[_0x3037('0x49')]['id']}})['then'](handleEntityNotFound(_0x28e026,null))[_0x3037('0x26')](removeEntity(_0x28e026,null))[_0x3037('0x43')](handleError(_0x28e026,null));}; \ No newline at end of file +var _0xe6ca=['rows','catch','params','keys','length','merge','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','ZendeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','options','includeAll'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xe6ca,0x1a7));var _0xae6c=function(_0x24c37a,_0x53b3e6){_0x24c37a=_0x24c37a-0x0;var _0x2e653a=_0xe6ca[_0x24c37a];return _0x2e653a;};'use strict';var emlformat=require(_0xae6c('0x0'));var rimraf=require(_0xae6c('0x1'));var zipdir=require(_0xae6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae6c('0x3'));var moment=require(_0xae6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae6c('0x5'));var util=require(_0xae6c('0x6'));var path=require(_0xae6c('0x7'));var sox=require('sox');var csv=require(_0xae6c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae6c('0x9'));var _=require(_0xae6c('0xa'));var squel=require(_0xae6c('0xb'));var crypto=require('crypto');var jsforce=require(_0xae6c('0xc'));var deskjs=require(_0xae6c('0xd'));var toCsv=require(_0xae6c('0x8'));var querystring=require('querystring');var Papa=require(_0xae6c('0xe'));var Redis=require(_0xae6c('0xf'));var authService=require(_0xae6c('0x10'));var qs=require(_0xae6c('0x11'));var as=require(_0xae6c('0x12'));var hardwareService=require(_0xae6c('0x13'));var logger=require('../../config/logger')(_0xae6c('0x14'));var utils=require(_0xae6c('0x15'));var config=require(_0xae6c('0x16'));var licenseUtil=require(_0xae6c('0x17'));var db=require(_0xae6c('0x18'))['db'];function respondWithStatusCode(_0xfe2fb9,_0x284805){_0x284805=_0x284805||0xcc;return function(_0x4c20b2){if(_0x4c20b2){return _0xfe2fb9['sendStatus'](_0x284805);}return _0xfe2fb9[_0xae6c('0x19')](_0x284805)[_0xae6c('0x1a')]();};}function respondWithResult(_0x479f30,_0x515fee){_0x515fee=_0x515fee||0xc8;return function(_0x1a80c0){if(_0x1a80c0){return _0x479f30[_0xae6c('0x19')](_0x515fee)[_0xae6c('0x1b')](_0x1a80c0);}};}function respondWithFilteredResult(_0x7f8de,_0x422493){return function(_0xaa8999){if(_0xaa8999){var _0x25b4c6=typeof _0x422493[_0xae6c('0x1c')]===_0xae6c('0x1d')&&typeof _0x422493[_0xae6c('0x1e')]===_0xae6c('0x1d');var _0x111c9e=_0xaa8999[_0xae6c('0x1f')];var _0x1c84dc=_0x25b4c6?0x0:_0x422493[_0xae6c('0x1c')];var _0xf1423=_0x25b4c6?_0xaa8999[_0xae6c('0x1f')]:_0x422493['offset']+_0x422493['limit'];var _0x442523;if(_0xf1423>=_0x111c9e){_0xf1423=_0x111c9e;_0x442523=0xc8;}else{_0x442523=0xce;}_0x7f8de[_0xae6c('0x19')](_0x442523);return _0x7f8de[_0xae6c('0x20')](_0xae6c('0x21'),_0x1c84dc+'-'+_0xf1423+'/'+_0x111c9e)[_0xae6c('0x1b')](_0xaa8999);}return null;};}function patchUpdates(_0x241022){return function(_0x153a7e){try{jsonpatch[_0xae6c('0x22')](_0x153a7e,_0x241022,!![]);}catch(_0x249765){return BPromise[_0xae6c('0x23')](_0x249765);}return _0x153a7e[_0xae6c('0x24')]();};}function saveUpdates(_0x18212f,_0x34fb44){return function(_0x1523cb){if(_0x1523cb){return _0x1523cb['update'](_0x18212f)[_0xae6c('0x25')](function(_0x293392){return _0x293392;});}return null;};}function removeEntity(_0x3421f8,_0x7f45a5){return function(_0x5250bf){if(_0x5250bf){return _0x5250bf[_0xae6c('0x26')]()['then'](function(){_0x3421f8[_0xae6c('0x19')](0xcc)[_0xae6c('0x1a')]();});}};}function handleEntityNotFound(_0x2986c3,_0x21c291){return function(_0x3eac54){if(!_0x3eac54){_0x2986c3['sendStatus'](0x194);}return _0x3eac54;};}function handleError(_0x41d140,_0x632cce){_0x632cce=_0x632cce||0x1f4;return function(_0x38a3c4){logger[_0xae6c('0x27')](_0x38a3c4[_0xae6c('0x28')]);if(_0x38a3c4['name']){delete _0x38a3c4[_0xae6c('0x29')];}_0x41d140[_0xae6c('0x19')](_0x632cce)['send'](_0x38a3c4);};}exports['index']=function(_0x32ad89,_0x49fb35){var _0x3e3517={},_0x1eb938={},_0x1eb5a9={'count':0x0,'rows':[]};var _0x3c6845=_[_0xae6c('0x2a')](db[_0xae6c('0x2b')][_0xae6c('0x2c')],function(_0x206b29){return{'name':_0x206b29[_0xae6c('0x2d')],'type':_0x206b29[_0xae6c('0x2e')]['key']};});_0x1eb938[_0xae6c('0x2f')]=_[_0xae6c('0x2a')](_0x3c6845,'name');_0x1eb938[_0xae6c('0x30')]=_['keys'](_0x32ad89[_0xae6c('0x30')]);_0x1eb938[_0xae6c('0x31')]=_[_0xae6c('0x32')](_0x1eb938[_0xae6c('0x2f')],_0x1eb938['query']);_0x3e3517[_0xae6c('0x33')]=_[_0xae6c('0x32')](_0x1eb938[_0xae6c('0x2f')],qs[_0xae6c('0x34')](_0x32ad89[_0xae6c('0x30')][_0xae6c('0x34')]));_0x3e3517['attributes']=_0x3e3517[_0xae6c('0x33')]['length']?_0x3e3517[_0xae6c('0x33')]:_0x1eb938[_0xae6c('0x2f')];if(!_0x32ad89[_0xae6c('0x30')]['hasOwnProperty'](_0xae6c('0x35'))){_0x3e3517[_0xae6c('0x1e')]=qs[_0xae6c('0x1e')](_0x32ad89['query'][_0xae6c('0x1e')]);_0x3e3517[_0xae6c('0x1c')]=qs['offset'](_0x32ad89['query'][_0xae6c('0x1c')]);}_0x3e3517[_0xae6c('0x36')]=qs[_0xae6c('0x37')](_0x32ad89[_0xae6c('0x30')][_0xae6c('0x37')]);_0x3e3517[_0xae6c('0x38')]=qs[_0xae6c('0x31')](_['pick'](_0x32ad89[_0xae6c('0x30')],_0x1eb938[_0xae6c('0x31')]),_0x3c6845);if(_0x32ad89[_0xae6c('0x30')][_0xae6c('0x39')]){_0x3e3517[_0xae6c('0x38')]=_['merge'](_0x3e3517[_0xae6c('0x38')],{'$or':_[_0xae6c('0x2a')](_0x3c6845,function(_0x29010c){if(_0x29010c[_0xae6c('0x2e')]!=='VIRTUAL'){var _0xc3616a={};_0xc3616a[_0x29010c[_0xae6c('0x29')]]={'$like':'%'+_0x32ad89['query'][_0xae6c('0x39')]+'%'};return _0xc3616a;}})});}_0x3e3517=_['merge']({},_0x3e3517,_0x32ad89[_0xae6c('0x3a')]);var _0x164fab={'where':_0x3e3517[_0xae6c('0x38')]};return db[_0xae6c('0x2b')][_0xae6c('0x1f')](_0x164fab)[_0xae6c('0x25')](function(_0x11ae14){_0x1eb5a9[_0xae6c('0x1f')]=_0x11ae14;if(_0x32ad89['query'][_0xae6c('0x3b')]){_0x3e3517['include']=[{'all':!![]}];}return db[_0xae6c('0x2b')]['findAll'](_0x3e3517);})[_0xae6c('0x25')](function(_0x3fdb42){_0x1eb5a9[_0xae6c('0x3c')]=_0x3fdb42;return _0x1eb5a9;})['then'](respondWithFilteredResult(_0x49fb35,_0x3e3517))[_0xae6c('0x3d')](handleError(_0x49fb35,null));};exports['show']=function(_0x3a7a6e,_0x1e3467){var _0x36e6fe={'raw':!![],'where':{'id':_0x3a7a6e[_0xae6c('0x3e')]['id']}},_0x5be83a={};_0x5be83a[_0xae6c('0x2f')]=_[_0xae6c('0x3f')](db[_0xae6c('0x2b')][_0xae6c('0x2c')]);_0x5be83a['query']=_[_0xae6c('0x3f')](_0x3a7a6e[_0xae6c('0x30')]);_0x5be83a[_0xae6c('0x31')]=_[_0xae6c('0x32')](_0x5be83a[_0xae6c('0x2f')],_0x5be83a['query']);_0x36e6fe[_0xae6c('0x33')]=_[_0xae6c('0x32')](_0x5be83a[_0xae6c('0x2f')],qs[_0xae6c('0x34')](_0x3a7a6e[_0xae6c('0x30')]['fields']));_0x36e6fe['attributes']=_0x36e6fe[_0xae6c('0x33')][_0xae6c('0x40')]?_0x36e6fe['attributes']:_0x5be83a['model'];if(_0x3a7a6e['query'][_0xae6c('0x3b')]){_0x36e6fe['include']=[{'all':!![]}];}_0x36e6fe=_[_0xae6c('0x41')]({},_0x36e6fe,_0x3a7a6e[_0xae6c('0x3a')]);return db[_0xae6c('0x2b')][_0xae6c('0x42')](_0x36e6fe)['then'](handleEntityNotFound(_0x1e3467,null))[_0xae6c('0x25')](respondWithResult(_0x1e3467,null))[_0xae6c('0x3d')](handleError(_0x1e3467,null));};exports[_0xae6c('0x43')]=function(_0x227365,_0x2e7858){return db[_0xae6c('0x2b')][_0xae6c('0x43')](_0x227365['body'],{})['then'](respondWithResult(_0x2e7858,0xc9))['catch'](handleError(_0x2e7858,null));};exports['update']=function(_0x408ba2,_0x4040ee){if(_0x408ba2['body']['id']){delete _0x408ba2[_0xae6c('0x44')]['id'];}return db[_0xae6c('0x2b')][_0xae6c('0x42')]({'where':{'id':_0x408ba2[_0xae6c('0x3e')]['id']}})[_0xae6c('0x25')](handleEntityNotFound(_0x4040ee,null))[_0xae6c('0x25')](saveUpdates(_0x408ba2[_0xae6c('0x44')],null))[_0xae6c('0x25')](respondWithResult(_0x4040ee,null))[_0xae6c('0x3d')](handleError(_0x4040ee,null));};exports[_0xae6c('0x26')]=function(_0x4e96ed,_0x6b0402){return db['ZendeskField'][_0xae6c('0x42')]({'where':{'id':_0x4e96ed['params']['id']}})[_0xae6c('0x25')](handleEntityNotFound(_0x6b0402,null))[_0xae6c('0x25')](removeEntity(_0x6b0402,null))[_0xae6c('0x3d')](handleError(_0x6b0402,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 4d46b99..3d9125a 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 _0x8e65=['./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c8cfe,_0x4bae35){var _0x4690fc=function(_0x4f441e){while(--_0x4f441e){_0x3c8cfe['push'](_0x3c8cfe['shift']());}};_0x4690fc(++_0x4bae35);}(_0x8e65,0x1c8));var _0x58e6=function(_0x4fad1,_0x3aebb4){_0x4fad1=_0x4fad1-0x0;var _0x24f9e1=_0x8e65[_0x4fad1];return _0x24f9e1;};'use strict';var _=require(_0x58e6('0x0'));var util=require('util');var logger=require(_0x58e6('0x1'))(_0x58e6('0x2'));var moment=require(_0x58e6('0x3'));var BPromise=require(_0x58e6('0x4'));var rp=require(_0x58e6('0x5'));var fs=require('fs');var path=require(_0x58e6('0x6'));var rimraf=require(_0x58e6('0x7'));var config=require(_0x58e6('0x8'));var attributes=require(_0x58e6('0x9'));module[_0x58e6('0xa')]=function(_0x54c17b,_0x298f8b){return _0x54c17b[_0x58e6('0xb')]('ZendeskField',attributes,{'tableName':_0x58e6('0xc'),'paranoid':![],'indexes':[{'name':_0x58e6('0xd'),'fields':[_0x58e6('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba8b=['./intZendeskField.attributes','define','ZendeskField','zendesk_unique_index','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4192cd,_0x540716){var _0x47d084=function(_0x4f6de0){while(--_0x4f6de0){_0x4192cd['push'](_0x4192cd['shift']());}};_0x47d084(++_0x540716);}(_0xba8b,0x1da));var _0xbba8=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xba8b[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xbba8('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbba8('0x1'));var rp=require(_0xbba8('0x2'));var fs=require('fs');var path=require(_0xbba8('0x3'));var rimraf=require(_0xbba8('0x4'));var config=require(_0xbba8('0x5'));var attributes=require(_0xbba8('0x6'));module['exports']=function(_0x4c5976,_0xfec254){return _0x4c5976[_0xbba8('0x7')](_0xbba8('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xbba8('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 3384d2d..3b8b891 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 _0xf53e=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xf53e,0x94));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var moment=require(_0xef53('0x2'));var BPromise=require(_0xef53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef53('0x4'));var db=require(_0xef53('0x5'))['db'];var utils=require(_0xef53('0x6'));var logger=require(_0xef53('0x7'))(_0xef53('0x8'));var config=require(_0xef53('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xef53('0xa')][_0xef53('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f274,_0x162c21,_0x9fdf38){return new BPromise(function(_0x7f18bb,_0x30dbcb){return client[_0xef53('0xc')](_0x29f274,_0x9fdf38)[_0xef53('0xd')](function(_0x1ac1a5){logger[_0xef53('0xe')](_0xef53('0xf'),_0x162c21,'request\x20sent');logger[_0xef53('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x162c21,_0xef53('0x11'),JSON[_0xef53('0x12')](_0x1ac1a5));if(_0x1ac1a5[_0xef53('0x13')]){if(_0x1ac1a5[_0xef53('0x13')][_0xef53('0x14')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x162c21,_0x1ac1a5[_0xef53('0x13')][_0xef53('0x15')]);return _0x30dbcb(_0x1ac1a5[_0xef53('0x13')]['message']);}logger[_0xef53('0x13')](_0xef53('0xf'),_0x162c21,_0x1ac1a5[_0xef53('0x13')][_0xef53('0x15')]);return _0x7f18bb(_0x1ac1a5['error'][_0xef53('0x15')]);}else{logger[_0xef53('0xe')](_0xef53('0xf'),_0x162c21,'request\x20sent');_0x7f18bb(_0x1ac1a5[_0xef53('0x16')][_0xef53('0x15')]);}})[_0xef53('0x17')](function(_0x418274){logger[_0xef53('0x13')]('ZendeskField,\x20%s,\x20%s',_0x162c21,_0x418274);_0x30dbcb(_0x418274);});});} \ No newline at end of file +var _0x9c24=['error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x483e77,_0x433e9b){var _0x359df0=function(_0x3c3d57){while(--_0x3c3d57){_0x483e77['push'](_0x483e77['shift']());}};_0x359df0(++_0x433e9b);}(_0x9c24,0xca));var _0x49c2=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x9c24[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c2('0x0'));var BPromise=require(_0x49c2('0x1'));var rs=require(_0x49c2('0x2'));var fs=require('fs');var Redis=require(_0x49c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49c2('0x4'))('rpc');var config=require(_0x49c2('0x5'));var jayson=require(_0x49c2('0x6'));var client=jayson[_0x49c2('0x7')][_0x49c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d37e5,_0xcad850,_0x538b27){return new BPromise(function(_0x46bfaf,_0x33da56){return client['request'](_0x4d37e5,_0x538b27)[_0x49c2('0x9')](function(_0x157b51){logger[_0x49c2('0xa')](_0x49c2('0xb'),_0xcad850,'request\x20sent');logger[_0x49c2('0xc')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0xcad850,_0x49c2('0xd'),JSON['stringify'](_0x157b51));if(_0x157b51[_0x49c2('0xe')]){if(_0x157b51[_0x49c2('0xe')][_0x49c2('0xf')]===0x1f4){logger[_0x49c2('0xe')](_0x49c2('0xb'),_0xcad850,_0x157b51[_0x49c2('0xe')][_0x49c2('0x10')]);return _0x33da56(_0x157b51[_0x49c2('0xe')][_0x49c2('0x10')]);}logger['error'](_0x49c2('0xb'),_0xcad850,_0x157b51[_0x49c2('0xe')]['message']);return _0x46bfaf(_0x157b51[_0x49c2('0xe')][_0x49c2('0x10')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0xcad850,_0x49c2('0xd'));_0x46bfaf(_0x157b51['result'][_0x49c2('0x10')]);}})[_0x49c2('0x11')](function(_0x4dfe42){logger[_0x49c2('0xe')](_0x49c2('0xb'),_0xcad850,_0x4dfe42);_0x33da56(_0x4dfe42);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 22a7c45..8f4a683 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 _0x16a9=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete'];(function(_0x5d0de8,_0x22f569){var _0x3afe4a=function(_0x24bdde){while(--_0x24bdde){_0x5d0de8['push'](_0x5d0de8['shift']());}};_0x3afe4a(++_0x22f569);}(_0x16a9,0x7a));var _0x916a=function(_0x433e30,_0x1adab3){_0x433e30=_0x433e30-0x0;var _0x523194=_0x16a9[_0x433e30];return _0x523194;};'use strict';var multer=require(_0x916a('0x0'));var util=require(_0x916a('0x1'));var path=require('path');var timeout=require(_0x916a('0x2'));var express=require(_0x916a('0x3'));var router=express[_0x916a('0x4')]();var fs_extra=require(_0x916a('0x5'));var auth=require(_0x916a('0x6'));var interaction=require(_0x916a('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x916a('0x8')]('/',auth['isAuthenticated'](),controller[_0x916a('0x9')]);router[_0x916a('0x8')](_0x916a('0xa'),auth['isAuthenticated'](),controller[_0x916a('0xb')]);router[_0x916a('0x8')](_0x916a('0xc'),auth[_0x916a('0xd')](),controller[_0x916a('0xe')]);router[_0x916a('0x8')](_0x916a('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x916a('0x10')]('/',auth['isAuthenticated'](),controller[_0x916a('0x11')]);router['post'](_0x916a('0xc'),auth[_0x916a('0xd')](),controller[_0x916a('0x12')]);router[_0x916a('0x13')](_0x916a('0xa'),auth[_0x916a('0xd')](),controller[_0x916a('0x14')]);router[_0x916a('0x15')]('/:id',auth[_0x916a('0xd')](),controller[_0x916a('0x16')]);module[_0x916a('0x17')]=router; \ No newline at end of file +var _0x4d03=['create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','./intZohoAccount.controller','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','get','/:id/fields','getFields','post'];(function(_0x1c5339,_0x1a01dc){var _0x9c1a81=function(_0x5861dc){while(--_0x5861dc){_0x1c5339['push'](_0x1c5339['shift']());}};_0x9c1a81(++_0x1a01dc);}(_0x4d03,0xd8));var _0x34d0=function(_0x5d6a17,_0x38f906){_0x5d6a17=_0x5d6a17-0x0;var _0x32d7ea=_0x4d03[_0x5d6a17];return _0x32d7ea;};'use strict';var multer=require('multer');var util=require(_0x34d0('0x0'));var path=require(_0x34d0('0x1'));var timeout=require(_0x34d0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34d0('0x3'));var config=require('../../config/environment');var controller=require(_0x34d0('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x34d0('0x5')]);router['get'](_0x34d0('0x6'),auth['isAuthenticated'](),controller[_0x34d0('0x7')]);router['get'](_0x34d0('0x8'),auth[_0x34d0('0x9')](),controller[_0x34d0('0xa')]);router[_0x34d0('0xb')](_0x34d0('0xc'),auth[_0x34d0('0x9')](),controller[_0x34d0('0xd')]);router[_0x34d0('0xe')]('/',auth[_0x34d0('0x9')](),controller[_0x34d0('0xf')]);router['post'](_0x34d0('0x8'),auth[_0x34d0('0x9')](),controller[_0x34d0('0x10')]);router[_0x34d0('0x11')](_0x34d0('0x6'),auth[_0x34d0('0x9')](),controller['update']);router[_0x34d0('0x12')]('/:id',auth[_0x34d0('0x9')](),controller[_0x34d0('0x13')]);module[_0x34d0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9b0c634..abb6dd9 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 _0x5c12=['exports','STRING'];(function(_0x33a13f,_0x2ffcab){var _0x1ccb8d=function(_0x3e9fca){while(--_0x3e9fca){_0x33a13f['push'](_0x33a13f['shift']());}};_0x1ccb8d(++_0x2ffcab);}(_0x5c12,0x188));var _0x25c1=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x5c12[_0x2d9e27];return _0xd35381;};'use strict';var Sequelize=require('sequelize');module[_0x25c1('0x0')]={'name':{'type':Sequelize[_0x25c1('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x25c1('0x1')]},'zone':{'type':Sequelize[_0x25c1('0x1')]},'clientId':{'type':Sequelize[_0x25c1('0x1')]},'clientSecret':{'type':Sequelize[_0x25c1('0x1')]},'serverUrl':{'type':Sequelize[_0x25c1('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x25c1('0x1')]},'refreshToken':{'type':Sequelize[_0x25c1('0x1')]}}; \ No newline at end of file +var _0xe14d=['exports','STRING','sequelize'];(function(_0x25106c,_0x7fb0ce){var _0x431b94=function(_0x1b9065){while(--_0x1b9065){_0x25106c['push'](_0x25106c['shift']());}};_0x431b94(++_0x7fb0ce);}(_0xe14d,0x1ee));var _0xde14=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xe14d[_0x58afd5];return _0x3e503b;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 469d2dd..9fd79fb 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 _0x3116=['params','getConfigurations','findOne','ZohoConfiguration','sort','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','host','clientSecret','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','error','message','Owner','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','ZohoAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','pick','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3116,0x1c5));var _0x6311=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3116[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x6311('0x0'));var rimraf=require(_0x6311('0x1'));var zipdir=require(_0x6311('0x2'));var jsonpatch=require(_0x6311('0x3'));var rp=require(_0x6311('0x4'));var moment=require(_0x6311('0x5'));var BPromise=require(_0x6311('0x6'));var Mustache=require('mustache');var util=require(_0x6311('0x7'));var path=require(_0x6311('0x8'));var sox=require('sox');var csv=require(_0x6311('0x9'));var ejs=require(_0x6311('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6311('0xb'));var squel=require(_0x6311('0xc'));var crypto=require(_0x6311('0xd'));var jsforce=require(_0x6311('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6311('0x9'));var querystring=require(_0x6311('0xf'));var Papa=require(_0x6311('0x10'));var Redis=require(_0x6311('0x11'));var authService=require(_0x6311('0x12'));var qs=require(_0x6311('0x13'));var as=require(_0x6311('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6311('0x15'));var utils=require(_0x6311('0x16'));var config=require(_0x6311('0x17'));var licenseUtil=require(_0x6311('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6311('0x19'));function respondWithStatusCode(_0x3779ce,_0x2dbdce){_0x2dbdce=_0x2dbdce||0xcc;return function(_0x5155d3){if(_0x5155d3){return _0x3779ce[_0x6311('0x1a')](_0x2dbdce);}return _0x3779ce[_0x6311('0x1b')](_0x2dbdce)['end']();};}function respondWithResult(_0x4eb23f,_0x156492){_0x156492=_0x156492||0xc8;return function(_0x3b61bc){if(_0x3b61bc){return _0x4eb23f['status'](_0x156492)['json'](_0x3b61bc);}};}function respondWithFilteredResult(_0x5b22dc,_0x4f3494){return function(_0x712101){if(_0x712101){var _0xdb47b7=typeof _0x4f3494[_0x6311('0x1c')]==='undefined'&&typeof _0x4f3494[_0x6311('0x1d')]===_0x6311('0x1e');var _0x3dd39d=_0x712101[_0x6311('0x1f')];var _0x589489=_0xdb47b7?0x0:_0x4f3494[_0x6311('0x1c')];var _0x5d483f=_0xdb47b7?_0x712101[_0x6311('0x1f')]:_0x4f3494['offset']+_0x4f3494['limit'];var _0x226233;if(_0x5d483f>=_0x3dd39d){_0x5d483f=_0x3dd39d;_0x226233=0xc8;}else{_0x226233=0xce;}_0x5b22dc[_0x6311('0x1b')](_0x226233);return _0x5b22dc[_0x6311('0x20')](_0x6311('0x21'),_0x589489+'-'+_0x5d483f+'/'+_0x3dd39d)['json'](_0x712101);}return null;};}function patchUpdates(_0x26f110){return function(_0x3a80a9){try{jsonpatch[_0x6311('0x22')](_0x3a80a9,_0x26f110,!![]);}catch(_0x495111){return BPromise[_0x6311('0x23')](_0x495111);}return _0x3a80a9[_0x6311('0x24')]();};}function saveUpdates(_0x5b1f0d,_0x551f70){return function(_0x3e6e53){if(_0x3e6e53){return _0x3e6e53[_0x6311('0x25')](_0x5b1f0d)[_0x6311('0x26')](function(_0x4bc06d){return _0x4bc06d;});}return null;};}function removeEntity(_0x30e254,_0x5047a7){return function(_0x44ed4b){if(_0x44ed4b){return _0x44ed4b[_0x6311('0x27')]()[_0x6311('0x26')](function(){_0x30e254[_0x6311('0x1b')](0xcc)[_0x6311('0x28')]();});}};}function handleEntityNotFound(_0x83c01b,_0x17c414){return function(_0x2b9bfa){if(!_0x2b9bfa){_0x83c01b['sendStatus'](0x194);}return _0x2b9bfa;};}function handleError(_0x513d36,_0x4c7142){_0x4c7142=_0x4c7142||0x1f4;return function(_0xb8ea54){logger['error'](_0xb8ea54['stack']);if(_0xb8ea54[_0x6311('0x29')]){delete _0xb8ea54[_0x6311('0x29')];}_0x513d36[_0x6311('0x1b')](_0x4c7142)['send'](_0xb8ea54);};}exports[_0x6311('0x2a')]=function(_0x5565ac,_0x6e0dca){var _0x21fdcc={},_0x51fd59={},_0x2155c0={'count':0x0,'rows':[]};var _0x2d1848=_[_0x6311('0x2b')](db[_0x6311('0x2c')][_0x6311('0x2d')],function(_0x36c69e){return{'name':_0x36c69e[_0x6311('0x2e')],'type':_0x36c69e['type'][_0x6311('0x2f')]};});_0x51fd59['model']=_[_0x6311('0x2b')](_0x2d1848,_0x6311('0x29'));_0x51fd59['query']=_[_0x6311('0x30')](_0x5565ac[_0x6311('0x31')]);_0x51fd59[_0x6311('0x32')]=_[_0x6311('0x33')](_0x51fd59[_0x6311('0x34')],_0x51fd59['query']);_0x21fdcc[_0x6311('0x35')]=_[_0x6311('0x33')](_0x51fd59[_0x6311('0x34')],qs[_0x6311('0x36')](_0x5565ac['query'][_0x6311('0x36')]));_0x21fdcc[_0x6311('0x35')]=_0x21fdcc[_0x6311('0x35')][_0x6311('0x37')]?_0x21fdcc[_0x6311('0x35')]:_0x51fd59[_0x6311('0x34')];if(!_0x5565ac[_0x6311('0x31')]['hasOwnProperty'](_0x6311('0x38'))){_0x21fdcc['limit']=qs[_0x6311('0x1d')](_0x5565ac[_0x6311('0x31')][_0x6311('0x1d')]);_0x21fdcc[_0x6311('0x1c')]=qs[_0x6311('0x1c')](_0x5565ac[_0x6311('0x31')][_0x6311('0x1c')]);}_0x21fdcc[_0x6311('0x39')]=qs['sort'](_0x5565ac[_0x6311('0x31')]['sort']);_0x21fdcc['where']=qs[_0x6311('0x32')](_[_0x6311('0x3a')](_0x5565ac[_0x6311('0x31')],_0x51fd59['filters']),_0x2d1848);if(_0x5565ac[_0x6311('0x31')]['filter']){_0x21fdcc['where']=_[_0x6311('0x3b')](_0x21fdcc[_0x6311('0x3c')],{'$or':_[_0x6311('0x2b')](_0x2d1848,function(_0x10d8f7){if(_0x10d8f7[_0x6311('0x3d')]!==_0x6311('0x3e')){var _0x218901={};_0x218901[_0x10d8f7['name']]={'$like':'%'+_0x5565ac['query']['filter']+'%'};return _0x218901;}})});}_0x21fdcc=_[_0x6311('0x3b')]({},_0x21fdcc,_0x5565ac[_0x6311('0x3f')]);var _0x1c8053={'where':_0x21fdcc['where']};return db[_0x6311('0x2c')]['count'](_0x1c8053)['then'](function(_0x56cdb0){_0x2155c0[_0x6311('0x1f')]=_0x56cdb0;if(_0x5565ac['query'][_0x6311('0x40')]){_0x21fdcc[_0x6311('0x41')]=[{'all':!![]}];}return db[_0x6311('0x2c')][_0x6311('0x42')](_0x21fdcc);})[_0x6311('0x26')](function(_0x2eaed6){_0x2155c0['rows']=_0x2eaed6;return _0x2155c0;})[_0x6311('0x26')](respondWithFilteredResult(_0x6e0dca,_0x21fdcc))[_0x6311('0x43')](handleError(_0x6e0dca,null));};exports['show']=function(_0x486cc0,_0x107383){var _0x356988={'raw':![],'where':{'id':_0x486cc0['params']['id']}},_0x48ae6d={};_0x48ae6d[_0x6311('0x34')]=_[_0x6311('0x30')](db[_0x6311('0x2c')]['rawAttributes']);_0x48ae6d[_0x6311('0x31')]=_[_0x6311('0x30')](_0x486cc0[_0x6311('0x31')]);_0x48ae6d['filters']=_[_0x6311('0x33')](_0x48ae6d['model'],_0x48ae6d[_0x6311('0x31')]);_0x356988[_0x6311('0x35')]=_['intersection'](_0x48ae6d['model'],qs['fields'](_0x486cc0[_0x6311('0x31')][_0x6311('0x36')]));_0x356988[_0x6311('0x35')]=_0x356988[_0x6311('0x35')][_0x6311('0x37')]?_0x356988[_0x6311('0x35')]:_0x48ae6d[_0x6311('0x34')];if(_0x486cc0[_0x6311('0x31')][_0x6311('0x40')]){_0x356988[_0x6311('0x41')]=[{'all':!![]}];}_0x356988=_[_0x6311('0x3b')]({},_0x356988,_0x486cc0[_0x6311('0x3f')]);return db[_0x6311('0x2c')][_0x6311('0x44')](_0x356988)[_0x6311('0x26')](handleEntityNotFound(_0x107383,null))[_0x6311('0x26')](respondWithResult(_0x107383,null))[_0x6311('0x43')](handleError(_0x107383,null));};exports['create']=function(_0x57e8b4,_0x5988b1){return db[_0x6311('0x2c')][_0x6311('0x45')](_0x57e8b4[_0x6311('0x46')],{})[_0x6311('0x26')](respondWithResult(_0x5988b1,0xc9))[_0x6311('0x43')](handleError(_0x5988b1,null));};exports[_0x6311('0x25')]=function(_0x19a09c,_0x2d4062){if(_0x19a09c[_0x6311('0x46')]['id']){delete _0x19a09c[_0x6311('0x46')]['id'];}return db['ZohoAccount'][_0x6311('0x44')]({'where':{'id':_0x19a09c[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x2d4062,null))['then'](saveUpdates(_0x19a09c['body'],null))[_0x6311('0x26')](respondWithResult(_0x2d4062,null))[_0x6311('0x43')](handleError(_0x2d4062,null));};exports[_0x6311('0x27')]=function(_0x560263,_0x16eeab){return db[_0x6311('0x2c')][_0x6311('0x44')]({'where':{'id':_0x560263[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x16eeab,null))[_0x6311('0x26')](removeEntity(_0x16eeab,null))['catch'](handleError(_0x16eeab,null));};exports[_0x6311('0x48')]=function(_0xb19b11,_0x55cda3,_0xda8457){var _0x18806c={};var _0x4dae77={};var _0x1e4357;var _0x31bfdb;return db[_0x6311('0x2c')][_0x6311('0x49')]({'where':{'id':_0xb19b11[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x55cda3,null))[_0x6311('0x26')](function(_0x3c12b7){if(_0x3c12b7){_0x1e4357=_0x3c12b7;_0x4dae77['model']=_['keys'](db[_0x6311('0x4a')][_0x6311('0x2d')]);_0x4dae77[_0x6311('0x31')]=_[_0x6311('0x30')](_0xb19b11[_0x6311('0x31')]);_0x4dae77[_0x6311('0x32')]=_[_0x6311('0x33')](_0x4dae77['model'],_0x4dae77[_0x6311('0x31')]);_0x18806c[_0x6311('0x35')]=_['intersection'](_0x4dae77['model'],qs[_0x6311('0x36')](_0xb19b11['query'][_0x6311('0x36')]));_0x18806c[_0x6311('0x35')]=_0x18806c['attributes'][_0x6311('0x37')]?_0x18806c['attributes']:_0x4dae77['model'];_0x18806c['order']=qs[_0x6311('0x4b')](_0xb19b11[_0x6311('0x31')][_0x6311('0x4b')]);_0x18806c[_0x6311('0x3c')]=qs[_0x6311('0x32')](_['pick'](_0xb19b11[_0x6311('0x31')],_0x4dae77['filters']));if(_0xb19b11[_0x6311('0x31')][_0x6311('0x4c')]){_0x18806c[_0x6311('0x3c')]=_[_0x6311('0x3b')](_0x18806c[_0x6311('0x3c')],{'$or':_['map'](_0x18806c['attributes'],function(_0x5b443c){var _0x5e8ad5={};_0x5e8ad5[_0x5b443c]={'$like':'%'+_0xb19b11[_0x6311('0x31')][_0x6311('0x4c')]+'%'};return _0x5e8ad5;})});}_0x18806c=_[_0x6311('0x3b')]({},_0x18806c,_0xb19b11[_0x6311('0x3f')]);return _0x1e4357[_0x6311('0x48')](_0x18806c);}})[_0x6311('0x26')](function(_0x2a53a9){if(_0x2a53a9){_0x31bfdb=_0x2a53a9[_0x6311('0x37')];if(!_0xb19b11[_0x6311('0x31')][_0x6311('0x4d')](_0x6311('0x38'))){_0x18806c[_0x6311('0x1d')]=qs[_0x6311('0x1d')](_0xb19b11[_0x6311('0x31')][_0x6311('0x1d')]);_0x18806c['offset']=qs[_0x6311('0x1c')](_0xb19b11[_0x6311('0x31')][_0x6311('0x1c')]);}return _0x1e4357[_0x6311('0x48')](_0x18806c);}})[_0x6311('0x26')](function(_0x17cd51){if(_0x17cd51){return _0x17cd51?{'count':_0x31bfdb,'rows':_0x17cd51}:null;}})['then'](respondWithResult(_0x55cda3,null))['catch'](handleError(_0x55cda3,null));};exports[_0x6311('0x4e')]=function(_0x502ad7,_0x57e55b,_0xad5669){if(_0x502ad7[_0x6311('0x46')]['id']){delete _0x502ad7['body']['id'];}return db[_0x6311('0x2c')]['findOne']({'where':{'id':_0x502ad7[_0x6311('0x47')]['id']}})[_0x6311('0x26')](handleEntityNotFound(_0x57e55b,null))[_0x6311('0x26')](function(_0x45b0c1){if(_0x45b0c1){_0x502ad7[_0x6311('0x46')][_0x6311('0x4f')]=_0x45b0c1['id'];_0x502ad7['body']['Subjects']=integrations[_0x6311('0x50')](_0x502ad7[_0x6311('0x46')][_0x6311('0x51')],_0x502ad7[_0x6311('0x46')][_0x6311('0x3d')]);_0x502ad7[_0x6311('0x46')][_0x6311('0x52')]=integrations[_0x6311('0x53')](_0x502ad7[_0x6311('0x46')][_0x6311('0x51')],_0x502ad7['body'][_0x6311('0x3d')]);return db['ZohoConfiguration']['create'](_0x502ad7[_0x6311('0x46')],{'include':[{'model':db[_0x6311('0x54')],'as':_0x6311('0x55')},{'model':db[_0x6311('0x54')],'as':_0x6311('0x52')}]});}return null;})[_0x6311('0x26')](respondWithResult(_0x57e55b,null))['catch'](handleError(_0x57e55b,null));};function getAccessToken(_0x4bb8c4){return new Promise(function(_0x4b81ab,_0xc2c414){var _0x4d6331;switch(_0x4bb8c4[_0x6311('0x56')]){case'US':_0x4d6331=_0x6311('0x57');break;case'AU':_0x4d6331=_0x6311('0x58');break;case'EU':_0x4d6331=_0x6311('0x59');break;case'IN':_0x4d6331='https://accounts.zoho.in';break;case'CN':_0x4d6331='https://accounts.zoho.com.cn';break;default:_0x4d6331=_0x6311('0x59');break;}var _0x18f974={'method':_0x6311('0x5a'),'uri':_0x4d6331+_0x6311('0x5b'),'qs':{'refresh_token':_0x4bb8c4[_0x6311('0x5c')],'client_id':_0x4bb8c4[_0x6311('0x5d')],'client_secret':_0x4bb8c4['clientSecret'],'grant_type':_0x6311('0x5e')},'json':!![]};return rp(_0x18f974)[_0x6311('0x26')](function(_0x7d9316){if(_0x7d9316[_0x6311('0x5f')]){_0x4b81ab(_0x7d9316[_0x6311('0x5f')]);}else{_0xc2c414('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x6311('0x43')](function(_0x436368){_0xc2c414(_0x436368);});});}exports[_0x6311('0x60')]=function(_0x233312,_0x4f1e79,_0x5016ac){var _0x4fda41,_0x3feb9c,_0x4f8a91,_0x24e0a,_0x23ddb4;return db[_0x6311('0x2c')][_0x6311('0x49')]({'where':{'id':_0x233312[_0x6311('0x47')]['id']},'attributes':['id',_0x6311('0x61'),_0x6311('0x56'),'clientId',_0x6311('0x62'),_0x6311('0x63'),_0x6311('0x64'),_0x6311('0x5c')]})[_0x6311('0x26')](handleEntityNotFound(_0x4f1e79,null))[_0x6311('0x26')](function(_0xd5f993){_0x23ddb4=_0xd5f993;_0x4fda41=_0x23ddb4[_0x6311('0x61')];_0x3feb9c=_0x4fda41===_0x6311('0x65')?'eu':_0x6311('0x66');_0x4f8a91=_0x23ddb4['serverUrl'];var _0x2f0038=_0x4f8a91[_0x6311('0x67')](-0x1);if(_0x2f0038==='/'||_0x2f0038==='\x5c'||_0x2f0038===':'){_0x4f8a91=_0x4f8a91['substring'](0x0,_0x4f8a91[_0x6311('0x68')](_0x2f0038));}if(!_0x23ddb4['refreshToken']){throw new Error(_0x6311('0x69'));}return getAccessToken(_0x23ddb4);})['then'](function(_0x1a849a){if(_0x1a849a){return rp({'method':_0x6311('0x6a'),'uri':util[_0x6311('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3feb9c),'qs':{'module':'Calls'},'headers':{'Authorization':_0x6311('0x6c')+_0x1a849a},'json':!![]});}})[_0x6311('0x26')](function(_0x17a239){if(_0x17a239){if(_0x17a239['response']&&_0x17a239[_0x6311('0x6d')][_0x6311('0x6e')]){throw new Error(_0x17a239[_0x6311('0x6d')][_0x6311('0x6e')][_0x6311('0x6f')]);}var _0x5c1e80=[];var _0x1f7b49=[];var _0x6ffe98=[_0x6311('0x70'),'Subject',_0x6311('0x71'),'WhoId',_0x6311('0x72'),_0x6311('0x73'),_0x6311('0x74'),_0x6311('0x75')];_0x1f7b49=_[_0x6311('0x76')](_0x17a239[_0x6311('0x36')],function(_0x28d48d){return _0x6ffe98['includes'](_0x28d48d[_0x6311('0x77')]);});for(var _0x4d7f5d=0x0;_0x4d7f5d<_0x1f7b49[_0x6311('0x37')];_0x4d7f5d++){if(_0x1f7b49[_0x4d7f5d][_0x6311('0x78')]===![]){_0x5c1e80['push']({'id':_0x1f7b49[_0x4d7f5d]['id'],'name':_0x1f7b49[_0x4d7f5d][_0x6311('0x79')],'custom':_0x1f7b49[_0x4d7f5d]['custom_field'],'options':_0x1f7b49[_0x4d7f5d][_0x6311('0x7a')]===_0x6311('0x7b')&&_0x1f7b49[_0x4d7f5d][_0x6311('0x7c')]['length']>-0x1?_['map'](_0x1f7b49[_0x4d7f5d][_0x6311('0x7c')],function(_0x98cd6f){return{'name':_0x98cd6f,'value':_0x98cd6f};}):[]});}}return{'count':_0x5c1e80[_0x6311('0x37')],'rows':_0x5c1e80};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4f1e79,null))['catch'](function(_0x5b91be){var _0x215bdd=_0x233312[_0x6311('0x31')][_0x6311('0x7d')]?0x1f4:_0x5b91be[_0x6311('0x7e')]||0x1f4;logger[_0x6311('0x6e')](_0x6311('0x7f'),_0x6311('0x60'),_0x215bdd,JSON[_0x6311('0x80')](_0x5b91be));delete _0x5b91be[_0x6311('0x29')];if(_0x215bdd===0x191){_0x215bdd=0x190;}_0x4f1e79[_0x6311('0x1b')](_0x215bdd)[_0x6311('0x81')](_0x233312[_0x6311('0x31')][_0x6311('0x7d')]?{'message':_0x6311('0x82'),'statusCode':_0x5b91be[_0x6311('0x7e')]}:_0x5b91be);});}; \ No newline at end of file +var _0xd8f7=['update','then','destroy','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','findOne','ZohoConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0x4add99,_0x3dadc9){var _0x1ef5d0=function(_0x57f016){while(--_0x57f016){_0x4add99['push'](_0x4add99['shift']());}};_0x1ef5d0(++_0x3dadc9);}(_0xd8f7,0x15e));var _0x7d8f=function(_0x3e7254,_0x180fc6){_0x3e7254=_0x3e7254-0x0;var _0x4afe4b=_0xd8f7[_0x3e7254];return _0x4afe4b;};'use strict';var emlformat=require(_0x7d8f('0x0'));var rimraf=require(_0x7d8f('0x1'));var zipdir=require(_0x7d8f('0x2'));var jsonpatch=require(_0x7d8f('0x3'));var rp=require(_0x7d8f('0x4'));var moment=require(_0x7d8f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7d8f('0x6'));var util=require('util');var path=require(_0x7d8f('0x7'));var sox=require(_0x7d8f('0x8'));var csv=require('to-csv');var ejs=require(_0x7d8f('0x9'));var fs=require('fs');var fs_extra=require(_0x7d8f('0xa'));var _=require('lodash');var squel=require(_0x7d8f('0xb'));var crypto=require(_0x7d8f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d8f('0xd'));var toCsv=require(_0x7d8f('0xe'));var querystring=require(_0x7d8f('0xf'));var Papa=require(_0x7d8f('0x10'));var Redis=require(_0x7d8f('0x11'));var authService=require(_0x7d8f('0x12'));var qs=require(_0x7d8f('0x13'));var as=require(_0x7d8f('0x14'));var hardwareService=require(_0x7d8f('0x15'));var logger=require(_0x7d8f('0x16'))(_0x7d8f('0x17'));var utils=require('../../config/utils');var config=require(_0x7d8f('0x18'));var licenseUtil=require(_0x7d8f('0x19'));var db=require(_0x7d8f('0x1a'))['db'];var integrations=require(_0x7d8f('0x1b'));function respondWithStatusCode(_0x35d626,_0x3a8522){_0x3a8522=_0x3a8522||0xcc;return function(_0x4f14df){if(_0x4f14df){return _0x35d626[_0x7d8f('0x1c')](_0x3a8522);}return _0x35d626[_0x7d8f('0x1d')](_0x3a8522)['end']();};}function respondWithResult(_0x5ad95d,_0x33e542){_0x33e542=_0x33e542||0xc8;return function(_0x5d040a){if(_0x5d040a){return _0x5ad95d[_0x7d8f('0x1d')](_0x33e542)['json'](_0x5d040a);}};}function respondWithFilteredResult(_0xe70ca7,_0x5e2c9c){return function(_0x3b1750){if(_0x3b1750){var _0x117108=typeof _0x5e2c9c['offset']===_0x7d8f('0x1e')&&typeof _0x5e2c9c[_0x7d8f('0x1f')]===_0x7d8f('0x1e');var _0x33ca03=_0x3b1750[_0x7d8f('0x20')];var _0x35b865=_0x117108?0x0:_0x5e2c9c[_0x7d8f('0x21')];var _0xa3249b=_0x117108?_0x3b1750['count']:_0x5e2c9c[_0x7d8f('0x21')]+_0x5e2c9c[_0x7d8f('0x1f')];var _0x4f8558;if(_0xa3249b>=_0x33ca03){_0xa3249b=_0x33ca03;_0x4f8558=0xc8;}else{_0x4f8558=0xce;}_0xe70ca7[_0x7d8f('0x1d')](_0x4f8558);return _0xe70ca7[_0x7d8f('0x22')](_0x7d8f('0x23'),_0x35b865+'-'+_0xa3249b+'/'+_0x33ca03)[_0x7d8f('0x24')](_0x3b1750);}return null;};}function patchUpdates(_0x5aac58){return function(_0x473c6a){try{jsonpatch[_0x7d8f('0x25')](_0x473c6a,_0x5aac58,!![]);}catch(_0x3d77df){return BPromise[_0x7d8f('0x26')](_0x3d77df);}return _0x473c6a[_0x7d8f('0x27')]();};}function saveUpdates(_0x58351e,_0x949c){return function(_0x1a1a00){if(_0x1a1a00){return _0x1a1a00[_0x7d8f('0x28')](_0x58351e)[_0x7d8f('0x29')](function(_0x40a5d7){return _0x40a5d7;});}return null;};}function removeEntity(_0xb6cdd1,_0x4fed8a){return function(_0x378f8c){if(_0x378f8c){return _0x378f8c[_0x7d8f('0x2a')]()['then'](function(){_0xb6cdd1[_0x7d8f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ba845,_0x1fc0d7){return function(_0x4cd06d){if(!_0x4cd06d){_0x4ba845[_0x7d8f('0x1c')](0x194);}return _0x4cd06d;};}function handleError(_0x1387b7,_0x27615b){_0x27615b=_0x27615b||0x1f4;return function(_0x39d2a1){logger[_0x7d8f('0x2b')](_0x39d2a1[_0x7d8f('0x2c')]);if(_0x39d2a1[_0x7d8f('0x2d')]){delete _0x39d2a1[_0x7d8f('0x2d')];}_0x1387b7[_0x7d8f('0x1d')](_0x27615b)[_0x7d8f('0x2e')](_0x39d2a1);};}exports['index']=function(_0x5efe42,_0x87b368){var _0x5d5d7e={},_0x50c8e0={},_0x490394={'count':0x0,'rows':[]};var _0x164ef4=_['map'](db['ZohoAccount'][_0x7d8f('0x2f')],function(_0x477974){return{'name':_0x477974['fieldName'],'type':_0x477974[_0x7d8f('0x30')][_0x7d8f('0x31')]};});_0x50c8e0[_0x7d8f('0x32')]=_[_0x7d8f('0x33')](_0x164ef4,_0x7d8f('0x2d'));_0x50c8e0[_0x7d8f('0x34')]=_[_0x7d8f('0x35')](_0x5efe42[_0x7d8f('0x34')]);_0x50c8e0[_0x7d8f('0x36')]=_[_0x7d8f('0x37')](_0x50c8e0[_0x7d8f('0x32')],_0x50c8e0[_0x7d8f('0x34')]);_0x5d5d7e[_0x7d8f('0x38')]=_['intersection'](_0x50c8e0[_0x7d8f('0x32')],qs['fields'](_0x5efe42[_0x7d8f('0x34')][_0x7d8f('0x39')]));_0x5d5d7e[_0x7d8f('0x38')]=_0x5d5d7e[_0x7d8f('0x38')]['length']?_0x5d5d7e[_0x7d8f('0x38')]:_0x50c8e0[_0x7d8f('0x32')];if(!_0x5efe42[_0x7d8f('0x34')][_0x7d8f('0x3a')](_0x7d8f('0x3b'))){_0x5d5d7e[_0x7d8f('0x1f')]=qs[_0x7d8f('0x1f')](_0x5efe42[_0x7d8f('0x34')][_0x7d8f('0x1f')]);_0x5d5d7e[_0x7d8f('0x21')]=qs[_0x7d8f('0x21')](_0x5efe42['query'][_0x7d8f('0x21')]);}_0x5d5d7e[_0x7d8f('0x3c')]=qs[_0x7d8f('0x3d')](_0x5efe42['query']['sort']);_0x5d5d7e[_0x7d8f('0x3e')]=qs[_0x7d8f('0x36')](_[_0x7d8f('0x3f')](_0x5efe42['query'],_0x50c8e0[_0x7d8f('0x36')]),_0x164ef4);if(_0x5efe42[_0x7d8f('0x34')][_0x7d8f('0x40')]){_0x5d5d7e[_0x7d8f('0x3e')]=_[_0x7d8f('0x41')](_0x5d5d7e['where'],{'$or':_['map'](_0x164ef4,function(_0x39ef4b){if(_0x39ef4b[_0x7d8f('0x30')]!==_0x7d8f('0x42')){var _0x549631={};_0x549631[_0x39ef4b[_0x7d8f('0x2d')]]={'$like':'%'+_0x5efe42[_0x7d8f('0x34')]['filter']+'%'};return _0x549631;}})});}_0x5d5d7e=_[_0x7d8f('0x41')]({},_0x5d5d7e,_0x5efe42[_0x7d8f('0x43')]);var _0x280ace={'where':_0x5d5d7e[_0x7d8f('0x3e')]};return db[_0x7d8f('0x44')][_0x7d8f('0x20')](_0x280ace)[_0x7d8f('0x29')](function(_0x2a09cd){_0x490394[_0x7d8f('0x20')]=_0x2a09cd;if(_0x5efe42[_0x7d8f('0x34')]['includeAll']){_0x5d5d7e[_0x7d8f('0x45')]=[{'all':!![]}];}return db[_0x7d8f('0x44')][_0x7d8f('0x46')](_0x5d5d7e);})[_0x7d8f('0x29')](function(_0x227d09){_0x490394[_0x7d8f('0x47')]=_0x227d09;return _0x490394;})[_0x7d8f('0x29')](respondWithFilteredResult(_0x87b368,_0x5d5d7e))[_0x7d8f('0x48')](handleError(_0x87b368,null));};exports[_0x7d8f('0x49')]=function(_0x5eed36,_0x4fcbf5){var _0x1ec849={'raw':![],'where':{'id':_0x5eed36[_0x7d8f('0x4a')]['id']}},_0x180381={};_0x180381[_0x7d8f('0x32')]=_[_0x7d8f('0x35')](db['ZohoAccount'][_0x7d8f('0x2f')]);_0x180381[_0x7d8f('0x34')]=_[_0x7d8f('0x35')](_0x5eed36[_0x7d8f('0x34')]);_0x180381[_0x7d8f('0x36')]=_[_0x7d8f('0x37')](_0x180381[_0x7d8f('0x32')],_0x180381[_0x7d8f('0x34')]);_0x1ec849[_0x7d8f('0x38')]=_[_0x7d8f('0x37')](_0x180381[_0x7d8f('0x32')],qs[_0x7d8f('0x39')](_0x5eed36[_0x7d8f('0x34')][_0x7d8f('0x39')]));_0x1ec849[_0x7d8f('0x38')]=_0x1ec849[_0x7d8f('0x38')][_0x7d8f('0x4b')]?_0x1ec849[_0x7d8f('0x38')]:_0x180381[_0x7d8f('0x32')];if(_0x5eed36['query'][_0x7d8f('0x4c')]){_0x1ec849[_0x7d8f('0x45')]=[{'all':!![]}];}_0x1ec849=_['merge']({},_0x1ec849,_0x5eed36['options']);return db['ZohoAccount']['find'](_0x1ec849)[_0x7d8f('0x29')](handleEntityNotFound(_0x4fcbf5,null))[_0x7d8f('0x29')](respondWithResult(_0x4fcbf5,null))[_0x7d8f('0x48')](handleError(_0x4fcbf5,null));};exports[_0x7d8f('0x4d')]=function(_0x49f778,_0xd152f1){return db[_0x7d8f('0x44')][_0x7d8f('0x4d')](_0x49f778[_0x7d8f('0x4e')],{})[_0x7d8f('0x29')](respondWithResult(_0xd152f1,0xc9))['catch'](handleError(_0xd152f1,null));};exports[_0x7d8f('0x28')]=function(_0x5d7cc3,_0x1c827f){if(_0x5d7cc3[_0x7d8f('0x4e')]['id']){delete _0x5d7cc3[_0x7d8f('0x4e')]['id'];}return db[_0x7d8f('0x44')][_0x7d8f('0x4f')]({'where':{'id':_0x5d7cc3[_0x7d8f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c827f,null))[_0x7d8f('0x29')](saveUpdates(_0x5d7cc3[_0x7d8f('0x4e')],null))[_0x7d8f('0x29')](respondWithResult(_0x1c827f,null))[_0x7d8f('0x48')](handleError(_0x1c827f,null));};exports[_0x7d8f('0x2a')]=function(_0xa1f2c4,_0x44c7fa){return db[_0x7d8f('0x44')][_0x7d8f('0x4f')]({'where':{'id':_0xa1f2c4[_0x7d8f('0x4a')]['id']}})[_0x7d8f('0x29')](handleEntityNotFound(_0x44c7fa,null))[_0x7d8f('0x29')](removeEntity(_0x44c7fa,null))[_0x7d8f('0x48')](handleError(_0x44c7fa,null));};exports['getConfigurations']=function(_0x2890cd,_0x354d4,_0x1b6b8d){var _0x588ef0={};var _0x2739de={};var _0x1f5a73;var _0x2c37a4;return db[_0x7d8f('0x44')][_0x7d8f('0x50')]({'where':{'id':_0x2890cd[_0x7d8f('0x4a')]['id']}})[_0x7d8f('0x29')](handleEntityNotFound(_0x354d4,null))['then'](function(_0x25da70){if(_0x25da70){_0x1f5a73=_0x25da70;_0x2739de['model']=_[_0x7d8f('0x35')](db[_0x7d8f('0x51')]['rawAttributes']);_0x2739de[_0x7d8f('0x34')]=_[_0x7d8f('0x35')](_0x2890cd[_0x7d8f('0x34')]);_0x2739de[_0x7d8f('0x36')]=_[_0x7d8f('0x37')](_0x2739de['model'],_0x2739de[_0x7d8f('0x34')]);_0x588ef0[_0x7d8f('0x38')]=_[_0x7d8f('0x37')](_0x2739de[_0x7d8f('0x32')],qs['fields'](_0x2890cd['query']['fields']));_0x588ef0[_0x7d8f('0x38')]=_0x588ef0[_0x7d8f('0x38')][_0x7d8f('0x4b')]?_0x588ef0['attributes']:_0x2739de[_0x7d8f('0x32')];_0x588ef0[_0x7d8f('0x3c')]=qs[_0x7d8f('0x3d')](_0x2890cd[_0x7d8f('0x34')][_0x7d8f('0x3d')]);_0x588ef0[_0x7d8f('0x3e')]=qs[_0x7d8f('0x36')](_[_0x7d8f('0x3f')](_0x2890cd['query'],_0x2739de[_0x7d8f('0x36')]));if(_0x2890cd[_0x7d8f('0x34')][_0x7d8f('0x40')]){_0x588ef0[_0x7d8f('0x3e')]=_[_0x7d8f('0x41')](_0x588ef0[_0x7d8f('0x3e')],{'$or':_[_0x7d8f('0x33')](_0x588ef0[_0x7d8f('0x38')],function(_0x326fbd){var _0x4229b0={};_0x4229b0[_0x326fbd]={'$like':'%'+_0x2890cd['query'][_0x7d8f('0x40')]+'%'};return _0x4229b0;})});}_0x588ef0=_[_0x7d8f('0x41')]({},_0x588ef0,_0x2890cd[_0x7d8f('0x43')]);return _0x1f5a73[_0x7d8f('0x52')](_0x588ef0);}})['then'](function(_0x2cb533){if(_0x2cb533){_0x2c37a4=_0x2cb533['length'];if(!_0x2890cd[_0x7d8f('0x34')][_0x7d8f('0x3a')](_0x7d8f('0x3b'))){_0x588ef0[_0x7d8f('0x1f')]=qs['limit'](_0x2890cd[_0x7d8f('0x34')][_0x7d8f('0x1f')]);_0x588ef0[_0x7d8f('0x21')]=qs[_0x7d8f('0x21')](_0x2890cd[_0x7d8f('0x34')][_0x7d8f('0x21')]);}return _0x1f5a73[_0x7d8f('0x52')](_0x588ef0);}})['then'](function(_0x4cc7d0){if(_0x4cc7d0){return _0x4cc7d0?{'count':_0x2c37a4,'rows':_0x4cc7d0}:null;}})[_0x7d8f('0x29')](respondWithResult(_0x354d4,null))[_0x7d8f('0x48')](handleError(_0x354d4,null));};exports['addConfiguration']=function(_0x57cee2,_0xae3b92,_0x27822c){if(_0x57cee2[_0x7d8f('0x4e')]['id']){delete _0x57cee2[_0x7d8f('0x4e')]['id'];}return db[_0x7d8f('0x44')]['findOne']({'where':{'id':_0x57cee2[_0x7d8f('0x4a')]['id']}})[_0x7d8f('0x29')](handleEntityNotFound(_0xae3b92,null))['then'](function(_0x4daac0){if(_0x4daac0){_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x53')]=_0x4daac0['id'];_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x54')]=integrations[_0x7d8f('0x55')](_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x56')],_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x30')]);_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x57')]=integrations[_0x7d8f('0x58')](_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x56')],_0x57cee2[_0x7d8f('0x4e')][_0x7d8f('0x30')]);return db[_0x7d8f('0x51')][_0x7d8f('0x4d')](_0x57cee2[_0x7d8f('0x4e')],{'include':[{'model':db[_0x7d8f('0x59')],'as':_0x7d8f('0x54')},{'model':db[_0x7d8f('0x59')],'as':_0x7d8f('0x57')}]});}return null;})[_0x7d8f('0x29')](respondWithResult(_0xae3b92,null))[_0x7d8f('0x48')](handleError(_0xae3b92,null));};function getAccessToken(_0x993470){return new Promise(function(_0x1b6044,_0x1636dc){var _0x42620f;switch(_0x993470[_0x7d8f('0x5a')]){case'US':_0x42620f=_0x7d8f('0x5b');break;case'AU':_0x42620f=_0x7d8f('0x5c');break;case'EU':_0x42620f='https://accounts.zoho.eu';break;case'IN':_0x42620f=_0x7d8f('0x5d');break;case'CN':_0x42620f=_0x7d8f('0x5e');break;default:_0x42620f='https://accounts.zoho.eu';break;}var _0x2642bf={'method':'POST','uri':_0x42620f+_0x7d8f('0x5f'),'qs':{'refresh_token':_0x993470[_0x7d8f('0x60')],'client_id':_0x993470[_0x7d8f('0x61')],'client_secret':_0x993470[_0x7d8f('0x62')],'grant_type':_0x7d8f('0x63')},'json':!![]};return rp(_0x2642bf)[_0x7d8f('0x29')](function(_0x5ce2df){if(_0x5ce2df['access_token']){_0x1b6044(_0x5ce2df[_0x7d8f('0x64')]);}else{_0x1636dc('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x7d8f('0x48')](function(_0x5da6c4){_0x1636dc(_0x5da6c4);});});}exports[_0x7d8f('0x65')]=function(_0x5cdb2e,_0x41e404,_0x3a34f7){var _0x570eb2,_0x1f53cf,_0xbf4c2,_0x43484b,_0x29f3f4;return db['ZohoAccount']['findOne']({'where':{'id':_0x5cdb2e[_0x7d8f('0x4a')]['id']},'attributes':['id',_0x7d8f('0x66'),_0x7d8f('0x5a'),_0x7d8f('0x61'),_0x7d8f('0x62'),_0x7d8f('0x67'),_0x7d8f('0x68'),_0x7d8f('0x60')]})['then'](handleEntityNotFound(_0x41e404,null))[_0x7d8f('0x29')](function(_0x2544c3){_0x29f3f4=_0x2544c3;_0x570eb2=_0x29f3f4[_0x7d8f('0x66')];_0x1f53cf=_0x570eb2===_0x7d8f('0x69')?'eu':'com';_0xbf4c2=_0x29f3f4[_0x7d8f('0x67')];var _0x45adb3=_0xbf4c2['slice'](-0x1);if(_0x45adb3==='/'||_0x45adb3==='\x5c'||_0x45adb3===':'){_0xbf4c2=_0xbf4c2[_0x7d8f('0x6a')](0x0,_0xbf4c2[_0x7d8f('0x6b')](_0x45adb3));}if(!_0x29f3f4[_0x7d8f('0x60')]){throw new Error(_0x7d8f('0x6c'));}return getAccessToken(_0x29f3f4);})[_0x7d8f('0x29')](function(_0xf3b330){if(_0xf3b330){return rp({'method':_0x7d8f('0x6d'),'uri':util[_0x7d8f('0x6e')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1f53cf),'qs':{'module':'Calls'},'headers':{'Authorization':_0x7d8f('0x6f')+_0xf3b330},'json':!![]});}})[_0x7d8f('0x29')](function(_0x37cd0c){if(_0x37cd0c){if(_0x37cd0c[_0x7d8f('0x70')]&&_0x37cd0c[_0x7d8f('0x70')][_0x7d8f('0x2b')]){throw new Error(_0x37cd0c[_0x7d8f('0x70')][_0x7d8f('0x2b')]['message']);}var _0xa8ef89=[];var _0x569de5=[];var _0x407adf=['Owner',_0x7d8f('0x71'),_0x7d8f('0x72'),_0x7d8f('0x73'),_0x7d8f('0x74'),'Call_Result','Call_Start_Time',_0x7d8f('0x75')];_0x569de5=_[_0x7d8f('0x76')](_0x37cd0c[_0x7d8f('0x39')],function(_0x2594a6){return _0x407adf[_0x7d8f('0x77')](_0x2594a6[_0x7d8f('0x78')]);});for(var _0x54b42f=0x0;_0x54b42f<_0x569de5[_0x7d8f('0x4b')];_0x54b42f++){if(_0x569de5[_0x54b42f]['system_mandatory']===![]){_0xa8ef89[_0x7d8f('0x79')]({'id':_0x569de5[_0x54b42f]['id'],'name':_0x569de5[_0x54b42f][_0x7d8f('0x7a')],'custom':_0x569de5[_0x54b42f][_0x7d8f('0x7b')],'options':_0x569de5[_0x54b42f][_0x7d8f('0x7c')]==='picklist'&&_0x569de5[_0x54b42f][_0x7d8f('0x7d')][_0x7d8f('0x4b')]>-0x1?_[_0x7d8f('0x33')](_0x569de5[_0x54b42f][_0x7d8f('0x7d')],function(_0x1a0cdb){return{'name':_0x1a0cdb,'value':_0x1a0cdb};}):[]});}}return{'count':_0xa8ef89[_0x7d8f('0x4b')],'rows':_0xa8ef89};}else{return{'count':0x0,'rows':[]};}})[_0x7d8f('0x29')](respondWithResult(_0x41e404,null))[_0x7d8f('0x48')](function(_0x5b175f){var _0x3b33ad=_0x5cdb2e[_0x7d8f('0x34')][_0x7d8f('0x7e')]?0x1f4:_0x5b175f[_0x7d8f('0x7f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x7d8f('0x65'),_0x3b33ad,JSON[_0x7d8f('0x80')](_0x5b175f));delete _0x5b175f[_0x7d8f('0x2d')];if(_0x3b33ad===0x191){_0x3b33ad=0x190;}_0x41e404['status'](_0x3b33ad)[_0x7d8f('0x2e')](_0x5cdb2e[_0x7d8f('0x34')][_0x7d8f('0x7e')]?{'message':_0x7d8f('0x81'),'statusCode':_0x5b175f[_0x7d8f('0x7f')]}:_0x5b175f);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 94eb6c5..9916082 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 _0x0b5a=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','zone','changed','serverUrl','clientId','code','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','clientSecret','then','parse','refresh_token','refreshToken','info','format','name','inspect','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch'];(function(_0x4e76b0,_0x3168de){var _0x5d5358=function(_0x57db2a){while(--_0x57db2a){_0x4e76b0['push'](_0x4e76b0['shift']());}};_0x5d5358(++_0x3168de);}(_0x0b5a,0x158));var _0xa0b5=function(_0x530385,_0xcbc622){_0x530385=_0x530385-0x0;var _0x425e01=_0x0b5a[_0x530385];return _0x425e01;};'use strict';var _=require(_0xa0b5('0x0'));var util=require(_0xa0b5('0x1'));var logger=require(_0xa0b5('0x2'))(_0xa0b5('0x3'));var moment=require(_0xa0b5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0b5('0x5'));var fs=require('fs');var path=require(_0xa0b5('0x6'));var rimraf=require('rimraf');var config=require(_0xa0b5('0x7'));var attributes=require(_0xa0b5('0x8'));var integrations=require(_0xa0b5('0x9'));module[_0xa0b5('0xa')]=function(_0x4b7505,_0x27e6cb){return _0x4b7505[_0xa0b5('0xb')](_0xa0b5('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x354ab4,_0x47e23d,_0x596124){if(_0x354ab4['changed'](_0xa0b5('0xd'))||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0xf'))||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0x10'))||_0x354ab4['changed']('clientSecret')||_0x354ab4[_0xa0b5('0xe')](_0xa0b5('0x11'))||_0x354ab4[_0xa0b5('0xe')]('host')){var _0x18db88,_0x276fea;_0x18db88=_0x354ab4[_0xa0b5('0xf')];var _0x552b5f=_0x18db88['slice'](-0x1);if(_0x552b5f==='/'||_0x552b5f==='\x5c'||_0x552b5f===':'){_0x18db88=_0x18db88[_0xa0b5('0x12')](0x0,_0x18db88[_0xa0b5('0x13')](_0x552b5f));}switch(_0x354ab4[_0xa0b5('0xd')]){case'US':_0x276fea='https://accounts.zoho.com';break;case'AU':_0x276fea=_0xa0b5('0x14');break;case'IN':_0x276fea=_0xa0b5('0x15');break;case'CN':_0x276fea='https://accounts.zoho.com.cn';break;default:_0x276fea=_0xa0b5('0x16');break;}var _0x1dc75e={'method':_0xa0b5('0x17'),'uri':_0x276fea+'/oauth/v2/token','form':{'grant_type':_0xa0b5('0x18'),'client_id':_0x354ab4['clientId'],'client_secret':_0x354ab4[_0xa0b5('0x19')],'redirect_uri':_0x354ab4[_0xa0b5('0xf')],'code':_0x354ab4[_0xa0b5('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1dc75e)[_0xa0b5('0x1a')](function(_0x3d2b33){var _0x116392=JSON[_0xa0b5('0x1b')](_0x3d2b33);if(_0x116392[_0xa0b5('0x1c')]){_0x354ab4[_0xa0b5('0x1d')]=_0x116392[_0xa0b5('0x1c')];logger[_0xa0b5('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x354ab4['name'],_0x354ab4['id']));}else{logger['error'](util[_0xa0b5('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x354ab4[_0xa0b5('0x20')],_0x354ab4['id']),util[_0xa0b5('0x21')](_0x116392,{'showHidden':![],'depth':null}));}return _0x596124(null,_0x47e23d);})['catch'](function(_0x18056e){logger[_0xa0b5('0x22')](util['format'](_0xa0b5('0x23'),_0x354ab4[_0xa0b5('0x20')],_0x354ab4['id']),util[_0xa0b5('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x596124(_0x18056e);});}else{return _0x596124(null,_0x47e23d);}},'beforeUpdate':function(_0x390d24,_0x14718b,_0x30ccb0){if(_0x390d24[_0xa0b5('0xe')]('zone')||_0x390d24['changed'](_0xa0b5('0xf'))||_0x390d24['changed']('clientId')||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x19'))||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x11'))||_0x390d24[_0xa0b5('0xe')](_0xa0b5('0x24'))){var _0x25c65f,_0x3ed5be;_0x25c65f=_0x390d24[_0xa0b5('0xf')];var _0x388c09=_0x25c65f[_0xa0b5('0x25')](-0x1);if(_0x388c09==='/'||_0x388c09==='\x5c'||_0x388c09===':'){_0x25c65f=_0x25c65f[_0xa0b5('0x12')](0x0,_0x25c65f[_0xa0b5('0x13')](_0x388c09));}switch(_0x390d24[_0xa0b5('0xd')]){case'US':_0x3ed5be=_0xa0b5('0x26');break;case'AU':_0x3ed5be=_0xa0b5('0x14');break;case'IN':_0x3ed5be=_0xa0b5('0x15');break;case'CN':_0x3ed5be=_0xa0b5('0x27');break;default:_0x3ed5be=_0xa0b5('0x16');break;}var _0x36d519={'method':'POST','uri':_0x3ed5be+_0xa0b5('0x28'),'form':{'grant_type':'authorization_code','client_id':_0x390d24[_0xa0b5('0x10')],'client_secret':_0x390d24[_0xa0b5('0x19')],'redirect_uri':_0x390d24[_0xa0b5('0xf')],'code':_0x390d24[_0xa0b5('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x36d519)['then'](function(_0x6bd9b8){var _0x297a2e=JSON[_0xa0b5('0x1b')](_0x6bd9b8);if(_0x297a2e['refresh_token']){_0x390d24[_0xa0b5('0x1d')]=_0x297a2e[_0xa0b5('0x1c')];logger['info'](util['format'](_0xa0b5('0x29'),_0x390d24[_0xa0b5('0x20')],_0x390d24['id']));}else{logger['error'](util[_0xa0b5('0x1f')](_0xa0b5('0x23'),_0x390d24[_0xa0b5('0x20')],_0x390d24['id']),util[_0xa0b5('0x21')](_0x297a2e,{'showHidden':![],'depth':null}));}return _0x30ccb0(null,_0x14718b);})[_0xa0b5('0x2a')](function(_0x160494){logger[_0xa0b5('0x22')](util['format'](_0xa0b5('0x23'),_0x390d24['name'],_0x390d24['id']),util[_0xa0b5('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x30ccb0(_0x160494);});}else{return _0x30ccb0(null,_0x14718b);}}}});}; \ No newline at end of file +var _0xefe8=['serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','https://accounts.zoho.com.au','https://accounts.zoho.eu','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone'];(function(_0x75ad68,_0xc75b2a){var _0x469c7d=function(_0x2feecf){while(--_0x2feecf){_0x75ad68['push'](_0x75ad68['shift']());}};_0x469c7d(++_0xc75b2a);}(_0xefe8,0x1a9));var _0x8efe=function(_0x5628b2,_0x223018){_0x5628b2=_0x5628b2-0x0;var _0x2174a7=_0xefe8[_0x5628b2];return _0x2174a7;};'use strict';var _=require(_0x8efe('0x0'));var util=require(_0x8efe('0x1'));var logger=require(_0x8efe('0x2'))(_0x8efe('0x3'));var moment=require(_0x8efe('0x4'));var BPromise=require(_0x8efe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8efe('0x6'));var rimraf=require('rimraf');var config=require(_0x8efe('0x7'));var attributes=require(_0x8efe('0x8'));var integrations=require(_0x8efe('0x9'));module[_0x8efe('0xa')]=function(_0x2c2fa9,_0x2eed00){return _0x2c2fa9['define'](_0x8efe('0xb'),attributes,{'tableName':_0x8efe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a02f8,_0x480b9a,_0x47fc04){if(_0x5a02f8[_0x8efe('0xd')](_0x8efe('0xe'))||_0x5a02f8[_0x8efe('0xd')](_0x8efe('0xf'))||_0x5a02f8[_0x8efe('0xd')](_0x8efe('0x10'))||_0x5a02f8[_0x8efe('0xd')](_0x8efe('0x11'))||_0x5a02f8[_0x8efe('0xd')](_0x8efe('0x12'))||_0x5a02f8[_0x8efe('0xd')](_0x8efe('0x13'))){var _0x37e922,_0x4801e5;_0x37e922=_0x5a02f8['serverUrl'];var _0x76fb6b=_0x37e922[_0x8efe('0x14')](-0x1);if(_0x76fb6b==='/'||_0x76fb6b==='\x5c'||_0x76fb6b===':'){_0x37e922=_0x37e922[_0x8efe('0x15')](0x0,_0x37e922[_0x8efe('0x16')](_0x76fb6b));}switch(_0x5a02f8[_0x8efe('0xe')]){case'US':_0x4801e5=_0x8efe('0x17');break;case'AU':_0x4801e5='https://accounts.zoho.com.au';break;case'IN':_0x4801e5=_0x8efe('0x18');break;case'CN':_0x4801e5=_0x8efe('0x19');break;default:_0x4801e5='https://accounts.zoho.eu';break;}var _0x218a7b={'method':_0x8efe('0x1a'),'uri':_0x4801e5+_0x8efe('0x1b'),'form':{'grant_type':_0x8efe('0x1c'),'client_id':_0x5a02f8['clientId'],'client_secret':_0x5a02f8[_0x8efe('0x11')],'redirect_uri':_0x5a02f8[_0x8efe('0xf')],'code':_0x5a02f8[_0x8efe('0x12')]},'headers':{'Content-Type':_0x8efe('0x1d')}};return rp(_0x218a7b)[_0x8efe('0x1e')](function(_0x291579){var _0x1ec3cb=JSON[_0x8efe('0x1f')](_0x291579);if(_0x1ec3cb[_0x8efe('0x20')]){_0x5a02f8[_0x8efe('0x21')]=_0x1ec3cb[_0x8efe('0x20')];logger[_0x8efe('0x22')](util[_0x8efe('0x23')](_0x8efe('0x24'),_0x5a02f8[_0x8efe('0x25')],_0x5a02f8['id']));}else{logger[_0x8efe('0x26')](util[_0x8efe('0x23')](_0x8efe('0x27'),_0x5a02f8[_0x8efe('0x25')],_0x5a02f8['id']),util['inspect'](_0x1ec3cb,{'showHidden':![],'depth':null}));}return _0x47fc04(null,_0x480b9a);})[_0x8efe('0x28')](function(_0x4cc140){logger[_0x8efe('0x26')](util[_0x8efe('0x23')](_0x8efe('0x27'),_0x5a02f8[_0x8efe('0x25')],_0x5a02f8['id']),util[_0x8efe('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x47fc04(_0x4cc140);});}else{return _0x47fc04(null,_0x480b9a);}},'beforeUpdate':function(_0x1b5278,_0x458753,_0x3302d9){if(_0x1b5278['changed'](_0x8efe('0xe'))||_0x1b5278[_0x8efe('0xd')](_0x8efe('0xf'))||_0x1b5278[_0x8efe('0xd')](_0x8efe('0x10'))||_0x1b5278['changed'](_0x8efe('0x11'))||_0x1b5278[_0x8efe('0xd')](_0x8efe('0x12'))||_0x1b5278[_0x8efe('0xd')](_0x8efe('0x13'))){var _0x12641b,_0xea69b3;_0x12641b=_0x1b5278[_0x8efe('0xf')];var _0x3e2f7d=_0x12641b[_0x8efe('0x14')](-0x1);if(_0x3e2f7d==='/'||_0x3e2f7d==='\x5c'||_0x3e2f7d===':'){_0x12641b=_0x12641b[_0x8efe('0x15')](0x0,_0x12641b[_0x8efe('0x16')](_0x3e2f7d));}switch(_0x1b5278[_0x8efe('0xe')]){case'US':_0xea69b3=_0x8efe('0x17');break;case'AU':_0xea69b3=_0x8efe('0x2a');break;case'IN':_0xea69b3=_0x8efe('0x18');break;case'CN':_0xea69b3=_0x8efe('0x19');break;default:_0xea69b3=_0x8efe('0x2b');break;}var _0x428743={'method':_0x8efe('0x1a'),'uri':_0xea69b3+_0x8efe('0x1b'),'form':{'grant_type':_0x8efe('0x1c'),'client_id':_0x1b5278[_0x8efe('0x10')],'client_secret':_0x1b5278[_0x8efe('0x11')],'redirect_uri':_0x1b5278[_0x8efe('0xf')],'code':_0x1b5278['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x428743)[_0x8efe('0x1e')](function(_0x1126b5){var _0x3eb518=JSON[_0x8efe('0x1f')](_0x1126b5);if(_0x3eb518['refresh_token']){_0x1b5278[_0x8efe('0x21')]=_0x3eb518[_0x8efe('0x20')];logger[_0x8efe('0x22')](util[_0x8efe('0x23')](_0x8efe('0x24'),_0x1b5278[_0x8efe('0x25')],_0x1b5278['id']));}else{logger[_0x8efe('0x26')](util[_0x8efe('0x23')](_0x8efe('0x27'),_0x1b5278[_0x8efe('0x25')],_0x1b5278['id']),util['inspect'](_0x3eb518,{'showHidden':![],'depth':null}));}return _0x3302d9(null,_0x458753);})['catch'](function(_0x599dcb){logger[_0x8efe('0x26')](util[_0x8efe('0x23')](_0x8efe('0x27'),_0x1b5278['name'],_0x1b5278['id']),util[_0x8efe('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x3302d9(_0x599dcb);});}else{return _0x3302d9(null,_0x458753);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f4fac62..402100c 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 _0x2250=['code','message','catch','GetZohoAccount','findAll','options','where','attributes','limit','include','model','map','ShowZohoAccount','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2250,0x178));var _0x0225=function(_0x1eec3a,_0x168828){_0x1eec3a=_0x1eec3a-0x0;var _0x133cf7=_0x2250[_0x1eec3a];return _0x133cf7;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var moment=require(_0x0225('0x2'));var BPromise=require(_0x0225('0x3'));var rs=require(_0x0225('0x4'));var fs=require('fs');var Redis=require(_0x0225('0x5'));var db=require(_0x0225('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require(_0x0225('0xa'));var client=jayson[_0x0225('0xb')][_0x0225('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a9fd5,_0x229c55,_0x4b8eda){return new BPromise(function(_0x331807,_0x5b87cc){return client['request'](_0x1a9fd5,_0x4b8eda)[_0x0225('0xd')](function(_0x1991b5){logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));logger['debug'](_0x0225('0x11'),_0x229c55,_0x0225('0x10'),JSON[_0x0225('0x12')](_0x1991b5));if(_0x1991b5[_0x0225('0x13')]){if(_0x1991b5['error'][_0x0225('0x14')]===0x1f4){logger['error'](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')]['message']);return _0x5b87cc(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}logger[_0x0225('0x13')](_0x0225('0xf'),_0x229c55,_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);return _0x331807(_0x1991b5[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xe')](_0x0225('0xf'),_0x229c55,_0x0225('0x10'));_0x331807(_0x1991b5['result'][_0x0225('0x15')]);}})[_0x0225('0x16')](function(_0x59e455){logger[_0x0225('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x229c55,_0x59e455);_0x5b87cc(_0x59e455);});});}exports[_0x0225('0x17')]=function(_0x424b5b){var _0x27ab34=this;return new Promise(function(_0x38534d,_0x1318bc){return db['ZohoAccount'][_0x0225('0x18')]({'raw':_0x424b5b['options']?_0x424b5b['options']['raw']===undefined?!![]:![]:!![],'where':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')][_0x0225('0x1a')]||null:null,'attributes':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')][_0x0225('0x1b')]||null:null,'limit':_0x424b5b[_0x0225('0x19')]?_0x424b5b['options'][_0x0225('0x1c')]||null:null,'include':_0x424b5b[_0x0225('0x19')]?_0x424b5b[_0x0225('0x19')]['include']?_['map'](_0x424b5b[_0x0225('0x19')]['include'],function(_0x58efd3){return{'model':db[_0x58efd3['model']],'as':_0x58efd3['as'],'attributes':_0x58efd3['attributes'],'include':_0x58efd3[_0x0225('0x1d')]?_['map'](_0x58efd3[_0x0225('0x1d')],function(_0xcb5384){return{'model':db[_0xcb5384[_0x0225('0x1e')]],'as':_0xcb5384['as'],'attributes':_0xcb5384[_0x0225('0x1b')],'include':_0xcb5384[_0x0225('0x1d')]?_[_0x0225('0x1f')](_0xcb5384[_0x0225('0x1d')],function(_0x5579ad){return{'model':db[_0x5579ad[_0x0225('0x1e')]],'as':_0x5579ad['as'],'attributes':_0x5579ad[_0x0225('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0225('0xd')](function(_0x32d45d){logger['info']('GetZohoAccount',_0x424b5b);logger['debug'](_0x0225('0x17'),_0x424b5b,JSON['stringify'](_0x32d45d));_0x38534d(_0x32d45d);})['catch'](function(_0x3d205c){logger['error'](_0x0225('0x17'),_0x3d205c['message'],_0x424b5b);_0x1318bc(_0x27ab34[_0x0225('0x13')](0x1f4,_0x3d205c['message']));});});};exports[_0x0225('0x20')]=function(_0x45ae3){var _0x3b793a=this;return new Promise(function(_0x391aed,_0x1353ff){return db['ZohoAccount'][_0x0225('0x21')]({'raw':_0x45ae3[_0x0225('0x19')]?_0x45ae3[_0x0225('0x19')][_0x0225('0x22')]===undefined?!![]:![]:!![],'where':_0x45ae3['options']?_0x45ae3[_0x0225('0x19')][_0x0225('0x1a')]||null:null,'attributes':_0x45ae3['options']?_0x45ae3[_0x0225('0x19')][_0x0225('0x1b')]||null:null,'include':_0x45ae3[_0x0225('0x19')]?_0x45ae3[_0x0225('0x19')][_0x0225('0x1d')]?_[_0x0225('0x1f')](_0x45ae3['options'][_0x0225('0x1d')],function(_0x59749a){return{'model':db[_0x59749a['model']],'as':_0x59749a['as'],'attributes':_0x59749a[_0x0225('0x1b')],'include':_0x59749a['include']?_['map'](_0x59749a[_0x0225('0x1d')],function(_0x52969c){return{'model':db[_0x52969c[_0x0225('0x1e')]],'as':_0x52969c['as'],'attributes':_0x52969c['attributes'],'include':_0x52969c[_0x0225('0x1d')]?_[_0x0225('0x1f')](_0x52969c[_0x0225('0x1d')],function(_0x59e00e){return{'model':db[_0x59e00e[_0x0225('0x1e')]],'as':_0x59e00e['as'],'attributes':_0x59e00e[_0x0225('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0225('0xd')](function(_0x18cd91){logger[_0x0225('0xe')](_0x0225('0x20'),_0x45ae3);logger[_0x0225('0x23')](_0x0225('0x20'),_0x45ae3,JSON['stringify'](_0x18cd91));_0x391aed(_0x18cd91);})['catch'](function(_0xc267cc){logger[_0x0225('0x13')](_0x0225('0x20'),_0xc267cc[_0x0225('0x15')],_0x45ae3);_0x1353ff(_0x3b793a[_0x0225('0x13')](0x1f4,_0xc267cc[_0x0225('0x15')]));});});}; \ No newline at end of file +var _0x3914=['info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','ShowZohoAccount','find','attributes','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x571b10,_0x1b827a){var _0x23ca52=function(_0x5cb0bb){while(--_0x5cb0bb){_0x571b10['push'](_0x571b10['shift']());}};_0x23ca52(++_0x1b827a);}(_0x3914,0xeb));var _0x4391=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x3914[_0x18b191];return _0x43e146;};'use strict';var _=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var moment=require('moment');var BPromise=require(_0x4391('0x2'));var rs=require(_0x4391('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4391('0x4'))['db'];var utils=require(_0x4391('0x5'));var logger=require(_0x4391('0x6'))('rpc');var config=require(_0x4391('0x7'));var jayson=require(_0x4391('0x8'));var client=jayson['client'][_0x4391('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49819d,_0x4733a2,_0x5c32ac){return new BPromise(function(_0x378c09,_0x17bcfb){return client['request'](_0x49819d,_0x5c32ac)['then'](function(_0x3d6693){logger[_0x4391('0xa')](_0x4391('0xb'),_0x4733a2,'request\x20sent');logger[_0x4391('0xc')](_0x4391('0xd'),_0x4733a2,_0x4391('0xe'),JSON[_0x4391('0xf')](_0x3d6693));if(_0x3d6693['error']){if(_0x3d6693[_0x4391('0x10')][_0x4391('0x11')]===0x1f4){logger[_0x4391('0x10')](_0x4391('0xb'),_0x4733a2,_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);return _0x17bcfb(_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);}logger['error'](_0x4391('0xb'),_0x4733a2,_0x3d6693[_0x4391('0x10')][_0x4391('0x12')]);return _0x378c09(_0x3d6693[_0x4391('0x10')]['message']);}else{logger[_0x4391('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x4733a2,_0x4391('0xe'));_0x378c09(_0x3d6693[_0x4391('0x13')][_0x4391('0x12')]);}})[_0x4391('0x14')](function(_0x2a79a4){logger[_0x4391('0x10')](_0x4391('0xb'),_0x4733a2,_0x2a79a4);_0x17bcfb(_0x2a79a4);});});}exports[_0x4391('0x15')]=function(_0x58a311){var _0x4cfa6b=this;return new Promise(function(_0x2ecb23,_0x4da0b0){return db[_0x4391('0x16')][_0x4391('0x17')]({'raw':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')][_0x4391('0x19')]===undefined?!![]:![]:!![],'where':_0x58a311['options']?_0x58a311['options'][_0x4391('0x1a')]||null:null,'attributes':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')]['attributes']||null:null,'limit':_0x58a311[_0x4391('0x18')]?_0x58a311[_0x4391('0x18')][_0x4391('0x1b')]||null:null,'include':_0x58a311[_0x4391('0x18')]?_0x58a311['options'][_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x58a311[_0x4391('0x18')][_0x4391('0x1c')],function(_0x24e16c){return{'model':db[_0x24e16c[_0x4391('0x1e')]],'as':_0x24e16c['as'],'attributes':_0x24e16c['attributes'],'include':_0x24e16c[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x24e16c[_0x4391('0x1c')],function(_0x333ca6){return{'model':db[_0x333ca6['model']],'as':_0x333ca6['as'],'attributes':_0x333ca6['attributes'],'include':_0x333ca6[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x333ca6[_0x4391('0x1c')],function(_0x197408){return{'model':db[_0x197408[_0x4391('0x1e')]],'as':_0x197408['as'],'attributes':_0x197408['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ee253){logger['info'](_0x4391('0x15'),_0x58a311);logger[_0x4391('0xc')](_0x4391('0x15'),_0x58a311,JSON[_0x4391('0xf')](_0x4ee253));_0x2ecb23(_0x4ee253);})['catch'](function(_0x34059f){logger[_0x4391('0x10')](_0x4391('0x15'),_0x34059f[_0x4391('0x12')],_0x58a311);_0x4da0b0(_0x4cfa6b[_0x4391('0x10')](0x1f4,_0x34059f['message']));});});};exports[_0x4391('0x1f')]=function(_0x3edb24){var _0x19b5d1=this;return new Promise(function(_0x2b5a06,_0x237d61){return db[_0x4391('0x16')][_0x4391('0x20')]({'raw':_0x3edb24[_0x4391('0x18')]?_0x3edb24[_0x4391('0x18')][_0x4391('0x19')]===undefined?!![]:![]:!![],'where':_0x3edb24[_0x4391('0x18')]?_0x3edb24['options'][_0x4391('0x1a')]||null:null,'attributes':_0x3edb24['options']?_0x3edb24[_0x4391('0x18')]['attributes']||null:null,'include':_0x3edb24['options']?_0x3edb24[_0x4391('0x18')][_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x3edb24[_0x4391('0x18')][_0x4391('0x1c')],function(_0x3fca2a){return{'model':db[_0x3fca2a[_0x4391('0x1e')]],'as':_0x3fca2a['as'],'attributes':_0x3fca2a['attributes'],'include':_0x3fca2a[_0x4391('0x1c')]?_['map'](_0x3fca2a[_0x4391('0x1c')],function(_0x5c58d0){return{'model':db[_0x5c58d0[_0x4391('0x1e')]],'as':_0x5c58d0['as'],'attributes':_0x5c58d0[_0x4391('0x21')],'include':_0x5c58d0[_0x4391('0x1c')]?_[_0x4391('0x1d')](_0x5c58d0[_0x4391('0x1c')],function(_0x4696c8){return{'model':db[_0x4696c8[_0x4391('0x1e')]],'as':_0x4696c8['as'],'attributes':_0x4696c8[_0x4391('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4391('0x22')](function(_0x1b4fab){logger[_0x4391('0xa')](_0x4391('0x1f'),_0x3edb24);logger[_0x4391('0xc')](_0x4391('0x1f'),_0x3edb24,JSON[_0x4391('0xf')](_0x1b4fab));_0x2b5a06(_0x1b4fab);})[_0x4391('0x14')](function(_0x7f513a){logger[_0x4391('0x10')]('ShowZohoAccount',_0x7f513a['message'],_0x3edb24);_0x237d61(_0x19b5d1[_0x4391('0x10')](0x1f4,_0x7f513a[_0x4391('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 161ec8e..25f174c 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 _0xfb3d=['express','Router','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','update','exports','connect-timeout'];(function(_0x4c56ff,_0xdc2249){var _0xa5d48d=function(_0x2e457e){while(--_0x2e457e){_0x4c56ff['push'](_0x4c56ff['shift']());}};_0xa5d48d(++_0xdc2249);}(_0xfb3d,0x10f));var _0xdfb3=function(_0x2a1e85,_0x5829f1){_0x2a1e85=_0x2a1e85-0x0;var _0x218ae9=_0xfb3d[_0x2a1e85];return _0x218ae9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdfb3('0x0'));var express=require(_0xdfb3('0x1'));var router=express[_0xdfb3('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdfb3('0x3'));var config=require('../../config/environment');var controller=require(_0xdfb3('0x4'));router[_0xdfb3('0x5')]('/',auth[_0xdfb3('0x6')](),controller[_0xdfb3('0x7')]);router[_0xdfb3('0x5')](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0x9')]);router[_0xdfb3('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdfb3('0xa')]);router[_0xdfb3('0x5')]('/:id/subjects',auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xb')]);router[_0xdfb3('0x5')](_0xdfb3('0xc'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xd')]);router['post']('/',auth[_0xdfb3('0x6')](),controller['create']);router['put'](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller[_0xdfb3('0xe')]);router['delete'](_0xdfb3('0x8'),auth[_0xdfb3('0x6')](),controller['destroy']);module[_0xdfb3('0xf')]=router; \ No newline at end of file +var _0x3498=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer'];(function(_0x1c18f1,_0x4ff5b0){var _0x45caed=function(_0x100238){while(--_0x100238){_0x1c18f1['push'](_0x1c18f1['shift']());}};_0x45caed(++_0x4ff5b0);}(_0x3498,0x153));var _0x8349=function(_0x1812ae,_0x5c230d){_0x1812ae=_0x1812ae-0x0;var _0x253ffa=_0x3498[_0x1812ae];return _0x253ffa;};'use strict';var multer=require(_0x8349('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8349('0x1'));var express=require(_0x8349('0x2'));var router=express[_0x8349('0x3')]();var fs_extra=require(_0x8349('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8349('0x5'));var config=require(_0x8349('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x8349('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8349('0x8'),auth[_0x8349('0x9')](),controller['show']);router[_0x8349('0x7')](_0x8349('0xa'),auth[_0x8349('0x9')](),controller['getFields']);router[_0x8349('0x7')](_0x8349('0xb'),auth[_0x8349('0x9')](),controller[_0x8349('0xc')]);router[_0x8349('0x7')](_0x8349('0xd'),auth[_0x8349('0x9')](),controller[_0x8349('0xe')]);router[_0x8349('0xf')]('/',auth[_0x8349('0x9')](),controller[_0x8349('0x10')]);router[_0x8349('0x11')](_0x8349('0x8'),auth[_0x8349('0x9')](),controller[_0x8349('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8349('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 13f8304..c186ca7 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 _0x0869=['exports','STRING','ENUM','contact','nothing','lead','contact_lead','sequelize'];(function(_0x1bef2a,_0x5becb3){var _0x10f24b=function(_0x1b9b83){while(--_0x1b9b83){_0x1bef2a['push'](_0x1bef2a['shift']());}};_0x10f24b(++_0x5becb3);}(_0x0869,0xaf));var _0x9086=function(_0x3902ad,_0x3c27dd){_0x3902ad=_0x3902ad-0x0;var _0x364fea=_0x0869[_0x3902ad];return _0x364fea;};'use strict';var Sequelize=require(_0x9086('0x0'));module[_0x9086('0x1')]={'name':{'type':Sequelize[_0x9086('0x2')]},'moduleCreate':{'type':Sequelize[_0x9086('0x3')]('lead',_0x9086('0x4'),_0x9086('0x5')),'defaultValue':_0x9086('0x6')},'moduleSearch':{'type':Sequelize[_0x9086('0x3')](_0x9086('0x7'),_0x9086('0x4'),'lead'),'defaultValue':_0x9086('0x7')},'description':{'type':Sequelize[_0x9086('0x2')]}}; \ No newline at end of file +var _0x406a=['contact_lead','sequelize','STRING','ENUM','lead','contact','nothing'];(function(_0x37622c,_0x2918f7){var _0x2cc516=function(_0x43faac){while(--_0x43faac){_0x37622c['push'](_0x37622c['shift']());}};_0x2cc516(++_0x2918f7);}(_0x406a,0xfd));var _0xa406=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x406a[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require(_0xa406('0x0'));module['exports']={'name':{'type':Sequelize[_0xa406('0x1')]},'moduleCreate':{'type':Sequelize[_0xa406('0x2')](_0xa406('0x3'),_0xa406('0x4'),_0xa406('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa406('0x2')]('contact_lead','contact',_0xa406('0x3')),'defaultValue':_0xa406('0x6')},'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 eab7205..a931eed 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 _0x3d4f=['order','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','destroy','then','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','ZohoField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d4f,0x198));var _0xf3d4=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x3d4f[_0x571a17];return _0x3ef337;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf3d4('0x0'));var jsonpatch=require(_0xf3d4('0x1'));var rp=require(_0xf3d4('0x2'));var moment=require(_0xf3d4('0x3'));var BPromise=require(_0xf3d4('0x4'));var Mustache=require(_0xf3d4('0x5'));var util=require(_0xf3d4('0x6'));var path=require('path');var sox=require(_0xf3d4('0x7'));var csv=require(_0xf3d4('0x8'));var ejs=require(_0xf3d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf3d4('0xa'));var crypto=require(_0xf3d4('0xb'));var jsforce=require(_0xf3d4('0xc'));var deskjs=require(_0xf3d4('0xd'));var toCsv=require(_0xf3d4('0x8'));var querystring=require(_0xf3d4('0xe'));var Papa=require(_0xf3d4('0xf'));var Redis=require(_0xf3d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf3d4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3d4('0x12'))(_0xf3d4('0x13'));var utils=require(_0xf3d4('0x14'));var config=require(_0xf3d4('0x15'));var licenseUtil=require(_0xf3d4('0x16'));var db=require(_0xf3d4('0x17'))['db'];function respondWithStatusCode(_0x56818f,_0x2c3982){_0x2c3982=_0x2c3982||0xcc;return function(_0x34a15b){if(_0x34a15b){return _0x56818f[_0xf3d4('0x18')](_0x2c3982);}return _0x56818f[_0xf3d4('0x19')](_0x2c3982)[_0xf3d4('0x1a')]();};}function respondWithResult(_0x4ebbd8,_0x22c133){_0x22c133=_0x22c133||0xc8;return function(_0x4f81fb){if(_0x4f81fb){return _0x4ebbd8[_0xf3d4('0x19')](_0x22c133)[_0xf3d4('0x1b')](_0x4f81fb);}};}function respondWithFilteredResult(_0x5dec55,_0x1d7184){return function(_0x389ac0){if(_0x389ac0){var _0x235113=typeof _0x1d7184[_0xf3d4('0x1c')]===_0xf3d4('0x1d')&&typeof _0x1d7184[_0xf3d4('0x1e')]===_0xf3d4('0x1d');var _0x690857=_0x389ac0['count'];var _0x315ba3=_0x235113?0x0:_0x1d7184[_0xf3d4('0x1c')];var _0x554d05=_0x235113?_0x389ac0[_0xf3d4('0x1f')]:_0x1d7184[_0xf3d4('0x1c')]+_0x1d7184['limit'];var _0x29223e;if(_0x554d05>=_0x690857){_0x554d05=_0x690857;_0x29223e=0xc8;}else{_0x29223e=0xce;}_0x5dec55[_0xf3d4('0x19')](_0x29223e);return _0x5dec55[_0xf3d4('0x20')](_0xf3d4('0x21'),_0x315ba3+'-'+_0x554d05+'/'+_0x690857)[_0xf3d4('0x1b')](_0x389ac0);}return null;};}function patchUpdates(_0x462ad7){return function(_0x59ae52){try{jsonpatch['apply'](_0x59ae52,_0x462ad7,!![]);}catch(_0x4d04e3){return BPromise[_0xf3d4('0x22')](_0x4d04e3);}return _0x59ae52[_0xf3d4('0x23')]();};}function saveUpdates(_0x20de85,_0x467d9b){return function(_0x525940){if(_0x525940){return _0x525940[_0xf3d4('0x24')](_0x20de85)['then'](function(_0x104bca){return _0x104bca;});}return null;};}function removeEntity(_0x4e17fc,_0xc3f7bc){return function(_0xf84b6){if(_0xf84b6){return _0xf84b6[_0xf3d4('0x25')]()[_0xf3d4('0x26')](function(){_0x4e17fc[_0xf3d4('0x19')](0xcc)[_0xf3d4('0x1a')]();});}};}function handleEntityNotFound(_0x2f0a0c,_0x2574d9){return function(_0x3f984f){if(!_0x3f984f){_0x2f0a0c[_0xf3d4('0x18')](0x194);}return _0x3f984f;};}function handleError(_0x587f3b,_0x415c8d){_0x415c8d=_0x415c8d||0x1f4;return function(_0x861e1c){logger['error'](_0x861e1c['stack']);if(_0x861e1c[_0xf3d4('0x27')]){delete _0x861e1c['name'];}_0x587f3b['status'](_0x415c8d)[_0xf3d4('0x28')](_0x861e1c);};}exports[_0xf3d4('0x29')]=function(_0x1e703d,_0x196221){var _0x5c19a6={},_0x4010cc={},_0x3a3cd1={'count':0x0,'rows':[]};var _0x39fc39=_[_0xf3d4('0x2a')](db[_0xf3d4('0x2b')][_0xf3d4('0x2c')],function(_0x31c1d3){return{'name':_0x31c1d3[_0xf3d4('0x2d')],'type':_0x31c1d3[_0xf3d4('0x2e')][_0xf3d4('0x2f')]};});_0x4010cc[_0xf3d4('0x30')]=_[_0xf3d4('0x2a')](_0x39fc39,'name');_0x4010cc[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x1e703d[_0xf3d4('0x31')]);_0x4010cc['filters']=_[_0xf3d4('0x33')](_0x4010cc[_0xf3d4('0x30')],_0x4010cc[_0xf3d4('0x31')]);_0x5c19a6[_0xf3d4('0x34')]=_['intersection'](_0x4010cc['model'],qs[_0xf3d4('0x35')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x5c19a6[_0xf3d4('0x34')]=_0x5c19a6[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x5c19a6[_0xf3d4('0x34')]:_0x4010cc['model'];if(!_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x5c19a6[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x1e703d[_0xf3d4('0x31')]['limit']);_0x5c19a6[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x1c')]);}_0x5c19a6['order']=qs[_0xf3d4('0x39')](_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x5c19a6[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x1e703d[_0xf3d4('0x31')],_0x4010cc[_0xf3d4('0x3c')]),_0x39fc39);if(_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x3d')]){_0x5c19a6[_0xf3d4('0x3a')]=_[_0xf3d4('0x3e')](_0x5c19a6['where'],{'$or':_[_0xf3d4('0x2a')](_0x39fc39,function(_0x273ea0){if(_0x273ea0[_0xf3d4('0x2e')]!==_0xf3d4('0x3f')){var _0x2ef032={};_0x2ef032[_0x273ea0[_0xf3d4('0x27')]]={'$like':'%'+_0x1e703d[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x2ef032;}})});}_0x5c19a6=_[_0xf3d4('0x3e')]({},_0x5c19a6,_0x1e703d[_0xf3d4('0x40')]);var _0x1cdeef={'where':_0x5c19a6[_0xf3d4('0x3a')]};return db[_0xf3d4('0x2b')]['count'](_0x1cdeef)[_0xf3d4('0x26')](function(_0x4e6a12){_0x3a3cd1[_0xf3d4('0x1f')]=_0x4e6a12;if(_0x1e703d['query'][_0xf3d4('0x41')]){_0x5c19a6[_0xf3d4('0x42')]=[{'all':!![]}];}return db[_0xf3d4('0x2b')][_0xf3d4('0x43')](_0x5c19a6);})[_0xf3d4('0x26')](function(_0x2861db){_0x3a3cd1[_0xf3d4('0x44')]=_0x2861db;return _0x3a3cd1;})[_0xf3d4('0x26')](respondWithFilteredResult(_0x196221,_0x5c19a6))[_0xf3d4('0x45')](handleError(_0x196221,null));};exports[_0xf3d4('0x46')]=function(_0x32627b,_0x17d1b8){var _0x5f2f28={'raw':![],'where':{'id':_0x32627b['params']['id']}},_0x3608ab={};_0x3608ab[_0xf3d4('0x30')]=_['keys'](db[_0xf3d4('0x2b')][_0xf3d4('0x2c')]);_0x3608ab[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x32627b[_0xf3d4('0x31')]);_0x3608ab[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x3608ab['model'],_0x3608ab[_0xf3d4('0x31')]);_0x5f2f28['attributes']=_[_0xf3d4('0x33')](_0x3608ab[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x32627b[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x5f2f28[_0xf3d4('0x34')]=_0x5f2f28[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x5f2f28['attributes']:_0x3608ab[_0xf3d4('0x30')];if(_0x32627b[_0xf3d4('0x31')][_0xf3d4('0x41')]){_0x5f2f28[_0xf3d4('0x42')]=[{'all':!![]}];}_0x5f2f28=_[_0xf3d4('0x3e')]({},_0x5f2f28,_0x32627b[_0xf3d4('0x40')]);return db['ZohoConfiguration'][_0xf3d4('0x47')](_0x5f2f28)[_0xf3d4('0x26')](handleEntityNotFound(_0x17d1b8,null))[_0xf3d4('0x26')](respondWithResult(_0x17d1b8,null))[_0xf3d4('0x45')](handleError(_0x17d1b8,null));};exports['create']=function(_0x330dc4,_0x238b54){return db[_0xf3d4('0x2b')][_0xf3d4('0x48')](_0x330dc4['body'],{})[_0xf3d4('0x26')](respondWithResult(_0x238b54,0xc9))[_0xf3d4('0x45')](handleError(_0x238b54,null));};exports[_0xf3d4('0x24')]=function(_0x555a6b,_0x21ef5d){if(_0x555a6b[_0xf3d4('0x49')]['id']){delete _0x555a6b[_0xf3d4('0x49')]['id'];}return db[_0xf3d4('0x2b')]['find']({'where':{'id':_0x555a6b[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x21ef5d,null))[_0xf3d4('0x26')](saveUpdates(_0x555a6b[_0xf3d4('0x49')],null))[_0xf3d4('0x26')](respondWithResult(_0x21ef5d,null))[_0xf3d4('0x45')](handleError(_0x21ef5d,null));};exports[_0xf3d4('0x25')]=function(_0x2d3a3d,_0x3bb5df){return db[_0xf3d4('0x2b')][_0xf3d4('0x47')]({'where':{'id':_0x2d3a3d['params']['id']}})['then'](handleEntityNotFound(_0x3bb5df,null))[_0xf3d4('0x26')](removeEntity(_0x3bb5df,null))['catch'](handleError(_0x3bb5df,null));};exports[_0xf3d4('0x4b')]=function(_0x10bc95,_0x235324,_0x3ebd10){var _0x580727={};var _0x55c4d3={};var _0x1e49ff;var _0x5546dc;return db['ZohoConfiguration'][_0xf3d4('0x4c')]({'where':{'id':_0x10bc95[_0xf3d4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x235324,null))['then'](function(_0x52933f){if(_0x52933f){_0x1e49ff=_0x52933f;_0x55c4d3[_0xf3d4('0x30')]=_['keys'](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x55c4d3[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x10bc95[_0xf3d4('0x31')]);_0x55c4d3[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x55c4d3[_0xf3d4('0x30')],_0x55c4d3[_0xf3d4('0x31')]);_0x580727['attributes']=_[_0xf3d4('0x33')](_0x55c4d3[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x580727[_0xf3d4('0x34')]=_0x580727[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x580727[_0xf3d4('0x34')]:_0x55c4d3['model'];_0x580727['order']=qs[_0xf3d4('0x39')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x580727[_0xf3d4('0x3a')]=qs[_0xf3d4('0x3c')](_[_0xf3d4('0x3b')](_0x10bc95[_0xf3d4('0x31')],_0x55c4d3[_0xf3d4('0x3c')]));if(_0x10bc95['query'][_0xf3d4('0x3d')]){_0x580727['where']=_[_0xf3d4('0x3e')](_0x580727[_0xf3d4('0x3a')],{'$or':_[_0xf3d4('0x2a')](_0x580727[_0xf3d4('0x34')],function(_0x64561c){var _0x5ccb35={};_0x5ccb35[_0x64561c]={'$like':'%'+_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x5ccb35;})});}_0x580727=_[_0xf3d4('0x3e')]({},_0x580727,_0x10bc95[_0xf3d4('0x40')]);return _0x1e49ff['getFields'](_0x580727);}})[_0xf3d4('0x26')](function(_0x2c479b){if(_0x2c479b){_0x5546dc=_0x2c479b['length'];if(!_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x580727[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x10bc95['query'][_0xf3d4('0x1e')]);_0x580727[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x10bc95[_0xf3d4('0x31')][_0xf3d4('0x1c')]);}return _0x1e49ff[_0xf3d4('0x4b')](_0x580727);}})[_0xf3d4('0x26')](function(_0x55a2d9){if(_0x55a2d9){return _0x55a2d9?{'count':_0x5546dc,'rows':_0x55a2d9}:null;}})['then'](respondWithResult(_0x235324,null))[_0xf3d4('0x45')](handleError(_0x235324,null));};exports['getSubjects']=function(_0x5e8d32,_0x4e707e,_0x2c8f20){var _0x13b856={};var _0x470eef={};var _0x55cbd7;var _0x4f0cb1;return db['ZohoConfiguration'][_0xf3d4('0x4c')]({'where':{'id':_0x5e8d32[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x4e707e,null))[_0xf3d4('0x26')](function(_0x48dbef){if(_0x48dbef){_0x55cbd7=_0x48dbef;_0x470eef[_0xf3d4('0x30')]=_[_0xf3d4('0x32')](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x470eef[_0xf3d4('0x31')]=_['keys'](_0x5e8d32[_0xf3d4('0x31')]);_0x470eef['filters']=_['intersection'](_0x470eef[_0xf3d4('0x30')],_0x470eef[_0xf3d4('0x31')]);_0x13b856[_0xf3d4('0x34')]=_[_0xf3d4('0x33')](_0x470eef['model'],qs[_0xf3d4('0x35')](_0x5e8d32['query'][_0xf3d4('0x35')]));_0x13b856[_0xf3d4('0x34')]=_0x13b856['attributes']['length']?_0x13b856[_0xf3d4('0x34')]:_0x470eef['model'];_0x13b856[_0xf3d4('0x4e')]=qs['sort'](_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x13b856[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x5e8d32[_0xf3d4('0x31')],_0x470eef[_0xf3d4('0x3c')]));if(_0x5e8d32['query'][_0xf3d4('0x3d')]){_0x13b856['where']=_[_0xf3d4('0x3e')](_0x13b856[_0xf3d4('0x3a')],{'$or':_['map'](_0x13b856['attributes'],function(_0x1534ee){var _0x23eaeb={};_0x23eaeb[_0x1534ee]={'$like':'%'+_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x3d')]+'%'};return _0x23eaeb;})});}_0x13b856=_[_0xf3d4('0x3e')]({},_0x13b856,_0x5e8d32[_0xf3d4('0x40')]);return _0x55cbd7[_0xf3d4('0x4f')](_0x13b856);}})['then'](function(_0x2ae03b){if(_0x2ae03b){_0x4f0cb1=_0x2ae03b[_0xf3d4('0x36')];if(!_0x5e8d32[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x13b856[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x5e8d32[_0xf3d4('0x31')]['limit']);_0x13b856[_0xf3d4('0x1c')]=qs[_0xf3d4('0x1c')](_0x5e8d32[_0xf3d4('0x31')]['offset']);}return _0x55cbd7[_0xf3d4('0x4f')](_0x13b856);}})[_0xf3d4('0x26')](function(_0x16dd5a){if(_0x16dd5a){return _0x16dd5a?{'count':_0x4f0cb1,'rows':_0x16dd5a}:null;}})[_0xf3d4('0x26')](respondWithResult(_0x4e707e,null))[_0xf3d4('0x45')](handleError(_0x4e707e,null));};exports[_0xf3d4('0x50')]=function(_0x1e3490,_0x4c4158,_0x44bb8c){var _0x502fcc={};var _0x59bc2a={};var _0x48071f;var _0x5ba182;return db[_0xf3d4('0x2b')]['findOne']({'where':{'id':_0x1e3490[_0xf3d4('0x4a')]['id']}})[_0xf3d4('0x26')](handleEntityNotFound(_0x4c4158,null))[_0xf3d4('0x26')](function(_0x385c93){if(_0x385c93){_0x48071f=_0x385c93;_0x59bc2a['model']=_[_0xf3d4('0x32')](db[_0xf3d4('0x4d')][_0xf3d4('0x2c')]);_0x59bc2a[_0xf3d4('0x31')]=_[_0xf3d4('0x32')](_0x1e3490[_0xf3d4('0x31')]);_0x59bc2a[_0xf3d4('0x3c')]=_[_0xf3d4('0x33')](_0x59bc2a[_0xf3d4('0x30')],_0x59bc2a[_0xf3d4('0x31')]);_0x502fcc[_0xf3d4('0x34')]=_['intersection'](_0x59bc2a[_0xf3d4('0x30')],qs[_0xf3d4('0x35')](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x35')]));_0x502fcc[_0xf3d4('0x34')]=_0x502fcc[_0xf3d4('0x34')][_0xf3d4('0x36')]?_0x502fcc['attributes']:_0x59bc2a[_0xf3d4('0x30')];_0x502fcc[_0xf3d4('0x4e')]=qs['sort'](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x39')]);_0x502fcc[_0xf3d4('0x3a')]=qs['filters'](_[_0xf3d4('0x3b')](_0x1e3490[_0xf3d4('0x31')],_0x59bc2a[_0xf3d4('0x3c')]));if(_0x1e3490['query']['filter']){_0x502fcc[_0xf3d4('0x3a')]=_[_0xf3d4('0x3e')](_0x502fcc[_0xf3d4('0x3a')],{'$or':_[_0xf3d4('0x2a')](_0x502fcc[_0xf3d4('0x34')],function(_0x511a56){var _0x33127e={};_0x33127e[_0x511a56]={'$like':'%'+_0x1e3490['query'][_0xf3d4('0x3d')]+'%'};return _0x33127e;})});}_0x502fcc=_[_0xf3d4('0x3e')]({},_0x502fcc,_0x1e3490[_0xf3d4('0x40')]);return _0x48071f['getDescriptions'](_0x502fcc);}})['then'](function(_0x581382){if(_0x581382){_0x5ba182=_0x581382['length'];if(!_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x37')](_0xf3d4('0x38'))){_0x502fcc[_0xf3d4('0x1e')]=qs[_0xf3d4('0x1e')](_0x1e3490[_0xf3d4('0x31')][_0xf3d4('0x1e')]);_0x502fcc[_0xf3d4('0x1c')]=qs['offset'](_0x1e3490['query'][_0xf3d4('0x1c')]);}return _0x48071f['getDescriptions'](_0x502fcc);}})[_0xf3d4('0x26')](function(_0x5a7a90){if(_0x5a7a90){return _0x5a7a90?{'count':_0x5ba182,'rows':_0x5a7a90}:null;}})[_0xf3d4('0x26')](respondWithResult(_0x4c4158,null))['catch'](handleError(_0x4c4158,null));}; \ No newline at end of file +var _0xbb96=['count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','ZohoConfiguration','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','create','body','getFields','findOne','getSubjects','ZohoField','getDescriptions','eml-format','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0xbb96,0x115));var _0x6bb9=function(_0x2d7a4b,_0xa36b04){_0x2d7a4b=_0x2d7a4b-0x0;var _0x603707=_0xbb96[_0x2d7a4b];return _0x603707;};'use strict';var emlformat=require(_0x6bb9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bb9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bb9('0x2'));var moment=require(_0x6bb9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6bb9('0x4'));var path=require(_0x6bb9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6bb9('0x6'));var fs=require('fs');var fs_extra=require(_0x6bb9('0x7'));var _=require(_0x6bb9('0x8'));var squel=require(_0x6bb9('0x9'));var crypto=require('crypto');var jsforce=require(_0x6bb9('0xa'));var deskjs=require(_0x6bb9('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6bb9('0xc'));var Redis=require(_0x6bb9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6bb9('0xe'));var as=require(_0x6bb9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bb9('0x10'))(_0x6bb9('0x11'));var utils=require(_0x6bb9('0x12'));var config=require(_0x6bb9('0x13'));var licenseUtil=require(_0x6bb9('0x14'));var db=require(_0x6bb9('0x15'))['db'];function respondWithStatusCode(_0x50c10b,_0x533cf9){_0x533cf9=_0x533cf9||0xcc;return function(_0x4f779e){if(_0x4f779e){return _0x50c10b['sendStatus'](_0x533cf9);}return _0x50c10b['status'](_0x533cf9)[_0x6bb9('0x16')]();};}function respondWithResult(_0x322d03,_0x1be635){_0x1be635=_0x1be635||0xc8;return function(_0x460c2c){if(_0x460c2c){return _0x322d03[_0x6bb9('0x17')](_0x1be635)[_0x6bb9('0x18')](_0x460c2c);}};}function respondWithFilteredResult(_0x262978,_0x5dda5c){return function(_0x1bc741){if(_0x1bc741){var _0x103def=typeof _0x5dda5c[_0x6bb9('0x19')]===_0x6bb9('0x1a')&&typeof _0x5dda5c['limit']===_0x6bb9('0x1a');var _0x242e51=_0x1bc741[_0x6bb9('0x1b')];var _0x4f779c=_0x103def?0x0:_0x5dda5c[_0x6bb9('0x19')];var _0x370605=_0x103def?_0x1bc741[_0x6bb9('0x1b')]:_0x5dda5c[_0x6bb9('0x19')]+_0x5dda5c[_0x6bb9('0x1c')];var _0x35ebf1;if(_0x370605>=_0x242e51){_0x370605=_0x242e51;_0x35ebf1=0xc8;}else{_0x35ebf1=0xce;}_0x262978[_0x6bb9('0x17')](_0x35ebf1);return _0x262978[_0x6bb9('0x1d')](_0x6bb9('0x1e'),_0x4f779c+'-'+_0x370605+'/'+_0x242e51)[_0x6bb9('0x18')](_0x1bc741);}return null;};}function patchUpdates(_0x1940be){return function(_0x5be914){try{jsonpatch['apply'](_0x5be914,_0x1940be,!![]);}catch(_0xf71d79){return BPromise[_0x6bb9('0x1f')](_0xf71d79);}return _0x5be914['save']();};}function saveUpdates(_0x582fbc,_0x6a37d1){return function(_0x21ce5d){if(_0x21ce5d){return _0x21ce5d[_0x6bb9('0x20')](_0x582fbc)[_0x6bb9('0x21')](function(_0x3c782e){return _0x3c782e;});}return null;};}function removeEntity(_0x1524a2,_0x41f474){return function(_0x37a7d2){if(_0x37a7d2){return _0x37a7d2[_0x6bb9('0x22')]()[_0x6bb9('0x21')](function(){_0x1524a2[_0x6bb9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e4dc,_0x526713){return function(_0x5f0920){if(!_0x5f0920){_0x43e4dc['sendStatus'](0x194);}return _0x5f0920;};}function handleError(_0x110341,_0x31cca0){_0x31cca0=_0x31cca0||0x1f4;return function(_0x50fdcb){logger[_0x6bb9('0x23')](_0x50fdcb[_0x6bb9('0x24')]);if(_0x50fdcb[_0x6bb9('0x25')]){delete _0x50fdcb[_0x6bb9('0x25')];}_0x110341[_0x6bb9('0x17')](_0x31cca0)[_0x6bb9('0x26')](_0x50fdcb);};}exports[_0x6bb9('0x27')]=function(_0x5b128b,_0x236343){var _0x2b81e0={},_0x4e0b8f={},_0x2f00b0={'count':0x0,'rows':[]};var _0x58fd43=_['map'](db[_0x6bb9('0x28')][_0x6bb9('0x29')],function(_0x48d36d){return{'name':_0x48d36d['fieldName'],'type':_0x48d36d[_0x6bb9('0x2a')][_0x6bb9('0x2b')]};});_0x4e0b8f[_0x6bb9('0x2c')]=_[_0x6bb9('0x2d')](_0x58fd43,_0x6bb9('0x25'));_0x4e0b8f['query']=_[_0x6bb9('0x2e')](_0x5b128b[_0x6bb9('0x2f')]);_0x4e0b8f[_0x6bb9('0x30')]=_[_0x6bb9('0x31')](_0x4e0b8f[_0x6bb9('0x2c')],_0x4e0b8f['query']);_0x2b81e0['attributes']=_[_0x6bb9('0x31')](_0x4e0b8f['model'],qs[_0x6bb9('0x32')](_0x5b128b[_0x6bb9('0x2f')][_0x6bb9('0x32')]));_0x2b81e0[_0x6bb9('0x33')]=_0x2b81e0[_0x6bb9('0x33')][_0x6bb9('0x34')]?_0x2b81e0[_0x6bb9('0x33')]:_0x4e0b8f[_0x6bb9('0x2c')];if(!_0x5b128b['query'][_0x6bb9('0x35')](_0x6bb9('0x36'))){_0x2b81e0[_0x6bb9('0x1c')]=qs[_0x6bb9('0x1c')](_0x5b128b[_0x6bb9('0x2f')][_0x6bb9('0x1c')]);_0x2b81e0['offset']=qs[_0x6bb9('0x19')](_0x5b128b['query'][_0x6bb9('0x19')]);}_0x2b81e0[_0x6bb9('0x37')]=qs['sort'](_0x5b128b[_0x6bb9('0x2f')][_0x6bb9('0x38')]);_0x2b81e0[_0x6bb9('0x39')]=qs[_0x6bb9('0x30')](_[_0x6bb9('0x3a')](_0x5b128b[_0x6bb9('0x2f')],_0x4e0b8f[_0x6bb9('0x30')]),_0x58fd43);if(_0x5b128b[_0x6bb9('0x2f')][_0x6bb9('0x3b')]){_0x2b81e0[_0x6bb9('0x39')]=_[_0x6bb9('0x3c')](_0x2b81e0[_0x6bb9('0x39')],{'$or':_[_0x6bb9('0x2d')](_0x58fd43,function(_0x29945b){if(_0x29945b[_0x6bb9('0x2a')]!=='VIRTUAL'){var _0x78c213={};_0x78c213[_0x29945b[_0x6bb9('0x25')]]={'$like':'%'+_0x5b128b[_0x6bb9('0x2f')][_0x6bb9('0x3b')]+'%'};return _0x78c213;}})});}_0x2b81e0=_['merge']({},_0x2b81e0,_0x5b128b['options']);var _0x3691f7={'where':_0x2b81e0[_0x6bb9('0x39')]};return db[_0x6bb9('0x28')][_0x6bb9('0x1b')](_0x3691f7)[_0x6bb9('0x21')](function(_0x2fc83c){_0x2f00b0[_0x6bb9('0x1b')]=_0x2fc83c;if(_0x5b128b['query'][_0x6bb9('0x3d')]){_0x2b81e0['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x6bb9('0x3e')](_0x2b81e0);})['then'](function(_0x15a3b3){_0x2f00b0[_0x6bb9('0x3f')]=_0x15a3b3;return _0x2f00b0;})['then'](respondWithFilteredResult(_0x236343,_0x2b81e0))[_0x6bb9('0x40')](handleError(_0x236343,null));};exports['show']=function(_0x3f8559,_0x20e029){var _0x533fcd={'raw':![],'where':{'id':_0x3f8559[_0x6bb9('0x41')]['id']}},_0x27eab1={};_0x27eab1[_0x6bb9('0x2c')]=_[_0x6bb9('0x2e')](db[_0x6bb9('0x28')][_0x6bb9('0x29')]);_0x27eab1[_0x6bb9('0x2f')]=_['keys'](_0x3f8559[_0x6bb9('0x2f')]);_0x27eab1['filters']=_[_0x6bb9('0x31')](_0x27eab1[_0x6bb9('0x2c')],_0x27eab1['query']);_0x533fcd[_0x6bb9('0x33')]=_[_0x6bb9('0x31')](_0x27eab1['model'],qs[_0x6bb9('0x32')](_0x3f8559[_0x6bb9('0x2f')]['fields']));_0x533fcd[_0x6bb9('0x33')]=_0x533fcd['attributes']['length']?_0x533fcd[_0x6bb9('0x33')]:_0x27eab1['model'];if(_0x3f8559['query'][_0x6bb9('0x3d')]){_0x533fcd[_0x6bb9('0x42')]=[{'all':!![]}];}_0x533fcd=_[_0x6bb9('0x3c')]({},_0x533fcd,_0x3f8559[_0x6bb9('0x43')]);return db[_0x6bb9('0x28')][_0x6bb9('0x44')](_0x533fcd)['then'](handleEntityNotFound(_0x20e029,null))[_0x6bb9('0x21')](respondWithResult(_0x20e029,null))['catch'](handleError(_0x20e029,null));};exports[_0x6bb9('0x45')]=function(_0x18ab14,_0x3c9e25){return db[_0x6bb9('0x28')][_0x6bb9('0x45')](_0x18ab14[_0x6bb9('0x46')],{})[_0x6bb9('0x21')](respondWithResult(_0x3c9e25,0xc9))['catch'](handleError(_0x3c9e25,null));};exports[_0x6bb9('0x20')]=function(_0x77fa8d,_0x5d5e7c){if(_0x77fa8d[_0x6bb9('0x46')]['id']){delete _0x77fa8d['body']['id'];}return db[_0x6bb9('0x28')]['find']({'where':{'id':_0x77fa8d[_0x6bb9('0x41')]['id']}})[_0x6bb9('0x21')](handleEntityNotFound(_0x5d5e7c,null))[_0x6bb9('0x21')](saveUpdates(_0x77fa8d[_0x6bb9('0x46')],null))[_0x6bb9('0x21')](respondWithResult(_0x5d5e7c,null))[_0x6bb9('0x40')](handleError(_0x5d5e7c,null));};exports[_0x6bb9('0x22')]=function(_0x55e0ce,_0x3d890c){return db[_0x6bb9('0x28')][_0x6bb9('0x44')]({'where':{'id':_0x55e0ce['params']['id']}})[_0x6bb9('0x21')](handleEntityNotFound(_0x3d890c,null))[_0x6bb9('0x21')](removeEntity(_0x3d890c,null))[_0x6bb9('0x40')](handleError(_0x3d890c,null));};exports[_0x6bb9('0x47')]=function(_0x1769c2,_0x166694,_0x5c947f){var _0x286ac3={};var _0x4748b5={};var _0x148b74;var _0x5ba260;return db['ZohoConfiguration'][_0x6bb9('0x48')]({'where':{'id':_0x1769c2[_0x6bb9('0x41')]['id']}})['then'](handleEntityNotFound(_0x166694,null))[_0x6bb9('0x21')](function(_0x5aac4d){if(_0x5aac4d){_0x148b74=_0x5aac4d;_0x4748b5[_0x6bb9('0x2c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x4748b5[_0x6bb9('0x2f')]=_[_0x6bb9('0x2e')](_0x1769c2['query']);_0x4748b5[_0x6bb9('0x30')]=_[_0x6bb9('0x31')](_0x4748b5[_0x6bb9('0x2c')],_0x4748b5[_0x6bb9('0x2f')]);_0x286ac3['attributes']=_['intersection'](_0x4748b5[_0x6bb9('0x2c')],qs['fields'](_0x1769c2[_0x6bb9('0x2f')]['fields']));_0x286ac3[_0x6bb9('0x33')]=_0x286ac3[_0x6bb9('0x33')][_0x6bb9('0x34')]?_0x286ac3[_0x6bb9('0x33')]:_0x4748b5[_0x6bb9('0x2c')];_0x286ac3[_0x6bb9('0x37')]=qs[_0x6bb9('0x38')](_0x1769c2[_0x6bb9('0x2f')][_0x6bb9('0x38')]);_0x286ac3[_0x6bb9('0x39')]=qs[_0x6bb9('0x30')](_['pick'](_0x1769c2[_0x6bb9('0x2f')],_0x4748b5[_0x6bb9('0x30')]));if(_0x1769c2[_0x6bb9('0x2f')]['filter']){_0x286ac3[_0x6bb9('0x39')]=_[_0x6bb9('0x3c')](_0x286ac3[_0x6bb9('0x39')],{'$or':_[_0x6bb9('0x2d')](_0x286ac3[_0x6bb9('0x33')],function(_0x26a032){var _0x5aa62b={};_0x5aa62b[_0x26a032]={'$like':'%'+_0x1769c2['query'][_0x6bb9('0x3b')]+'%'};return _0x5aa62b;})});}_0x286ac3=_[_0x6bb9('0x3c')]({},_0x286ac3,_0x1769c2[_0x6bb9('0x43')]);return _0x148b74[_0x6bb9('0x47')](_0x286ac3);}})['then'](function(_0x3d60dc){if(_0x3d60dc){_0x5ba260=_0x3d60dc[_0x6bb9('0x34')];if(!_0x1769c2['query'][_0x6bb9('0x35')](_0x6bb9('0x36'))){_0x286ac3[_0x6bb9('0x1c')]=qs[_0x6bb9('0x1c')](_0x1769c2['query'][_0x6bb9('0x1c')]);_0x286ac3[_0x6bb9('0x19')]=qs[_0x6bb9('0x19')](_0x1769c2[_0x6bb9('0x2f')][_0x6bb9('0x19')]);}return _0x148b74['getFields'](_0x286ac3);}})[_0x6bb9('0x21')](function(_0x351b67){if(_0x351b67){return _0x351b67?{'count':_0x5ba260,'rows':_0x351b67}:null;}})[_0x6bb9('0x21')](respondWithResult(_0x166694,null))['catch'](handleError(_0x166694,null));};exports[_0x6bb9('0x49')]=function(_0xf0af34,_0x4a9f48,_0xac30b2){var _0x37dc53={};var _0x3cf3d1={};var _0x47570b;var _0xa34a48;return db[_0x6bb9('0x28')][_0x6bb9('0x48')]({'where':{'id':_0xf0af34[_0x6bb9('0x41')]['id']}})[_0x6bb9('0x21')](handleEntityNotFound(_0x4a9f48,null))['then'](function(_0x45ad05){if(_0x45ad05){_0x47570b=_0x45ad05;_0x3cf3d1[_0x6bb9('0x2c')]=_[_0x6bb9('0x2e')](db[_0x6bb9('0x4a')][_0x6bb9('0x29')]);_0x3cf3d1[_0x6bb9('0x2f')]=_[_0x6bb9('0x2e')](_0xf0af34[_0x6bb9('0x2f')]);_0x3cf3d1[_0x6bb9('0x30')]=_[_0x6bb9('0x31')](_0x3cf3d1[_0x6bb9('0x2c')],_0x3cf3d1[_0x6bb9('0x2f')]);_0x37dc53['attributes']=_[_0x6bb9('0x31')](_0x3cf3d1[_0x6bb9('0x2c')],qs[_0x6bb9('0x32')](_0xf0af34[_0x6bb9('0x2f')][_0x6bb9('0x32')]));_0x37dc53[_0x6bb9('0x33')]=_0x37dc53[_0x6bb9('0x33')]['length']?_0x37dc53['attributes']:_0x3cf3d1[_0x6bb9('0x2c')];_0x37dc53['order']=qs[_0x6bb9('0x38')](_0xf0af34['query'][_0x6bb9('0x38')]);_0x37dc53[_0x6bb9('0x39')]=qs[_0x6bb9('0x30')](_['pick'](_0xf0af34[_0x6bb9('0x2f')],_0x3cf3d1[_0x6bb9('0x30')]));if(_0xf0af34[_0x6bb9('0x2f')][_0x6bb9('0x3b')]){_0x37dc53['where']=_[_0x6bb9('0x3c')](_0x37dc53['where'],{'$or':_[_0x6bb9('0x2d')](_0x37dc53['attributes'],function(_0x35ddb2){var _0x59d8a2={};_0x59d8a2[_0x35ddb2]={'$like':'%'+_0xf0af34['query'][_0x6bb9('0x3b')]+'%'};return _0x59d8a2;})});}_0x37dc53=_[_0x6bb9('0x3c')]({},_0x37dc53,_0xf0af34['options']);return _0x47570b[_0x6bb9('0x49')](_0x37dc53);}})[_0x6bb9('0x21')](function(_0x2b128c){if(_0x2b128c){_0xa34a48=_0x2b128c[_0x6bb9('0x34')];if(!_0xf0af34[_0x6bb9('0x2f')][_0x6bb9('0x35')]('nolimit')){_0x37dc53[_0x6bb9('0x1c')]=qs[_0x6bb9('0x1c')](_0xf0af34[_0x6bb9('0x2f')][_0x6bb9('0x1c')]);_0x37dc53[_0x6bb9('0x19')]=qs[_0x6bb9('0x19')](_0xf0af34[_0x6bb9('0x2f')]['offset']);}return _0x47570b[_0x6bb9('0x49')](_0x37dc53);}})[_0x6bb9('0x21')](function(_0x279d51){if(_0x279d51){return _0x279d51?{'count':_0xa34a48,'rows':_0x279d51}:null;}})[_0x6bb9('0x21')](respondWithResult(_0x4a9f48,null))[_0x6bb9('0x40')](handleError(_0x4a9f48,null));};exports[_0x6bb9('0x4b')]=function(_0x12ae55,_0x3b485a,_0x326a5c){var _0x2de5a1={};var _0x93cd3e={};var _0x4f5746;var _0x122065;return db[_0x6bb9('0x28')][_0x6bb9('0x48')]({'where':{'id':_0x12ae55['params']['id']}})[_0x6bb9('0x21')](handleEntityNotFound(_0x3b485a,null))[_0x6bb9('0x21')](function(_0x509f9e){if(_0x509f9e){_0x4f5746=_0x509f9e;_0x93cd3e[_0x6bb9('0x2c')]=_[_0x6bb9('0x2e')](db[_0x6bb9('0x4a')]['rawAttributes']);_0x93cd3e[_0x6bb9('0x2f')]=_['keys'](_0x12ae55['query']);_0x93cd3e[_0x6bb9('0x30')]=_[_0x6bb9('0x31')](_0x93cd3e[_0x6bb9('0x2c')],_0x93cd3e[_0x6bb9('0x2f')]);_0x2de5a1[_0x6bb9('0x33')]=_[_0x6bb9('0x31')](_0x93cd3e[_0x6bb9('0x2c')],qs['fields'](_0x12ae55[_0x6bb9('0x2f')]['fields']));_0x2de5a1[_0x6bb9('0x33')]=_0x2de5a1[_0x6bb9('0x33')]['length']?_0x2de5a1['attributes']:_0x93cd3e['model'];_0x2de5a1[_0x6bb9('0x37')]=qs['sort'](_0x12ae55[_0x6bb9('0x2f')][_0x6bb9('0x38')]);_0x2de5a1[_0x6bb9('0x39')]=qs[_0x6bb9('0x30')](_[_0x6bb9('0x3a')](_0x12ae55[_0x6bb9('0x2f')],_0x93cd3e[_0x6bb9('0x30')]));if(_0x12ae55[_0x6bb9('0x2f')][_0x6bb9('0x3b')]){_0x2de5a1[_0x6bb9('0x39')]=_[_0x6bb9('0x3c')](_0x2de5a1[_0x6bb9('0x39')],{'$or':_[_0x6bb9('0x2d')](_0x2de5a1[_0x6bb9('0x33')],function(_0x4d2aef){var _0x525547={};_0x525547[_0x4d2aef]={'$like':'%'+_0x12ae55['query'][_0x6bb9('0x3b')]+'%'};return _0x525547;})});}_0x2de5a1=_[_0x6bb9('0x3c')]({},_0x2de5a1,_0x12ae55[_0x6bb9('0x43')]);return _0x4f5746[_0x6bb9('0x4b')](_0x2de5a1);}})['then'](function(_0x73c123){if(_0x73c123){_0x122065=_0x73c123[_0x6bb9('0x34')];if(!_0x12ae55[_0x6bb9('0x2f')][_0x6bb9('0x35')](_0x6bb9('0x36'))){_0x2de5a1[_0x6bb9('0x1c')]=qs[_0x6bb9('0x1c')](_0x12ae55['query'][_0x6bb9('0x1c')]);_0x2de5a1[_0x6bb9('0x19')]=qs[_0x6bb9('0x19')](_0x12ae55[_0x6bb9('0x2f')]['offset']);}return _0x4f5746[_0x6bb9('0x4b')](_0x2de5a1);}})[_0x6bb9('0x21')](function(_0x507364){if(_0x507364){return _0x507364?{'count':_0x122065,'rows':_0x507364}:null;}})['then'](respondWithResult(_0x3b485a,null))[_0x6bb9('0x40')](handleError(_0x3b485a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index fe554bf..8cfc5fd 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 _0x711e=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x118d57,_0x5dd82a){var _0x22c697=function(_0x2f1173){while(--_0x2f1173){_0x118d57['push'](_0x118d57['shift']());}};_0x22c697(++_0x5dd82a);}(_0x711e,0xcb));var _0xe711=function(_0x3cc075,_0x2ffbc5){_0x3cc075=_0x3cc075-0x0;var _0x54a72d=_0x711e[_0x3cc075];return _0x54a72d;};'use strict';var _=require(_0xe711('0x0'));var util=require(_0xe711('0x1'));var logger=require(_0xe711('0x2'))(_0xe711('0x3'));var moment=require(_0xe711('0x4'));var BPromise=require('bluebird');var rp=require(_0xe711('0x5'));var fs=require('fs');var path=require(_0xe711('0x6'));var rimraf=require(_0xe711('0x7'));var config=require(_0xe711('0x8'));var attributes=require(_0xe711('0x9'));module[_0xe711('0xa')]=function(_0x14908e,_0x4fbe20){return _0x14908e[_0xe711('0xb')](_0xe711('0xc'),attributes,{'tableName':_0xe711('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8310=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x110652,_0x34ea3a){var _0x3a1150=function(_0xdcadda){while(--_0xdcadda){_0x110652['push'](_0x110652['shift']());}};_0x3a1150(++_0x34ea3a);}(_0x8310,0xf7));var _0x0831=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x8310[_0x1fb7d1];return _0x2480d8;};'use strict';var _=require(_0x0831('0x0'));var util=require(_0x0831('0x1'));var logger=require(_0x0831('0x2'))(_0x0831('0x3'));var moment=require(_0x0831('0x4'));var BPromise=require(_0x0831('0x5'));var rp=require(_0x0831('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0831('0x7'));var config=require(_0x0831('0x8'));var attributes=require(_0x0831('0x9'));module[_0x0831('0xa')]=function(_0x46f6c0,_0x148b2d){return _0x46f6c0[_0x0831('0xb')](_0x0831('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index e57a15d..f9f93cc 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 _0xb1b7=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0xb1b7,0x68));var _0x7b1b=function(_0x1807b1,_0x3112e0){_0x1807b1=_0x1807b1-0x0;var _0x358848=_0xb1b7[_0x1807b1];return _0x358848;};'use strict';var _=require('lodash');var util=require(_0x7b1b('0x0'));var moment=require(_0x7b1b('0x1'));var BPromise=require(_0x7b1b('0x2'));var rs=require(_0x7b1b('0x3'));var fs=require('fs');var Redis=require(_0x7b1b('0x4'));var db=require(_0x7b1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b1b('0x6'))(_0x7b1b('0x7'));var config=require(_0x7b1b('0x8'));var jayson=require(_0x7b1b('0x9'));var client=jayson[_0x7b1b('0xa')][_0x7b1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0b66,_0x541d8d,_0x5da373){return new BPromise(function(_0x413334,_0x32df1a){return client[_0x7b1b('0xc')](_0x2a0b66,_0x5da373)[_0x7b1b('0xd')](function(_0x1eb19f){logger[_0x7b1b('0xe')](_0x7b1b('0xf'),_0x541d8d,_0x7b1b('0x10'));logger[_0x7b1b('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x541d8d,_0x7b1b('0x10'),JSON[_0x7b1b('0x12')](_0x1eb19f));if(_0x1eb19f[_0x7b1b('0x13')]){if(_0x1eb19f[_0x7b1b('0x13')][_0x7b1b('0x14')]===0x1f4){logger[_0x7b1b('0x13')](_0x7b1b('0xf'),_0x541d8d,_0x1eb19f[_0x7b1b('0x13')]['message']);return _0x32df1a(_0x1eb19f['error'][_0x7b1b('0x15')]);}logger[_0x7b1b('0x13')](_0x7b1b('0xf'),_0x541d8d,_0x1eb19f[_0x7b1b('0x13')]['message']);return _0x413334(_0x1eb19f[_0x7b1b('0x13')][_0x7b1b('0x15')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x541d8d,'request\x20sent');_0x413334(_0x1eb19f[_0x7b1b('0x16')][_0x7b1b('0x15')]);}})[_0x7b1b('0x17')](function(_0x311cbf){logger[_0x7b1b('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x541d8d,_0x311cbf);_0x32df1a(_0x311cbf);});});} \ No newline at end of file +var _0x2b69=['then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2b69,0x109));var _0x92b6=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x2b69[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x92b6('0x0'));var util=require(_0x92b6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92b6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x92b6('0x3'));var logger=require(_0x92b6('0x4'))(_0x92b6('0x5'));var config=require(_0x92b6('0x6'));var jayson=require(_0x92b6('0x7'));var client=jayson[_0x92b6('0x8')][_0x92b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x392d50,_0x3d9024,_0x577dea){return new BPromise(function(_0x15ba82,_0x30e8c5){return client[_0x92b6('0xa')](_0x392d50,_0x577dea)[_0x92b6('0xb')](function(_0x47642b){logger[_0x92b6('0xc')](_0x92b6('0xd'),_0x3d9024,'request\x20sent');logger[_0x92b6('0xe')](_0x92b6('0xf'),_0x3d9024,'request\x20sent',JSON[_0x92b6('0x10')](_0x47642b));if(_0x47642b[_0x92b6('0x11')]){if(_0x47642b['error'][_0x92b6('0x12')]===0x1f4){logger[_0x92b6('0x11')](_0x92b6('0xd'),_0x3d9024,_0x47642b['error']['message']);return _0x30e8c5(_0x47642b[_0x92b6('0x11')][_0x92b6('0x13')]);}logger['error'](_0x92b6('0xd'),_0x3d9024,_0x47642b['error']['message']);return _0x15ba82(_0x47642b['error'][_0x92b6('0x13')]);}else{logger['info'](_0x92b6('0xd'),_0x3d9024,_0x92b6('0x14'));_0x15ba82(_0x47642b[_0x92b6('0x15')][_0x92b6('0x13')]);}})[_0x92b6('0x16')](function(_0x273c44){logger[_0x92b6('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3d9024,_0x273c44);_0x30e8c5(_0x273c44);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7032e4d..5f6da5b 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 _0x0bc1=['index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x1ef9ea,_0x2171e4){_0x1ef9ea=_0x1ef9ea-0x0;var _0x40b7a4=_0x0bc1[_0x1ef9ea];return _0x40b7a4;};'use strict';var multer=require(_0x10bc('0x0'));var util=require(_0x10bc('0x1'));var path=require(_0x10bc('0x2'));var timeout=require(_0x10bc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x10bc('0x4'));var auth=require(_0x10bc('0x5'));var interaction=require(_0x10bc('0x6'));var config=require(_0x10bc('0x7'));var controller=require(_0x10bc('0x8'));router['get']('/',auth[_0x10bc('0x9')](),controller[_0x10bc('0xa')]);router[_0x10bc('0xb')](_0x10bc('0xc'),auth[_0x10bc('0x9')](),controller[_0x10bc('0xd')]);router[_0x10bc('0xe')]('/',auth[_0x10bc('0x9')](),controller['create']);router[_0x10bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x10bc('0x10')]);router[_0x10bc('0x11')]('/:id',auth[_0x10bc('0x9')](),controller[_0x10bc('0x12')]);module[_0x10bc('0x13')]=router; \ No newline at end of file +var _0x6010=['../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6010,0x187));var _0x0601=function(_0x1286ca,_0x5f2be6){_0x1286ca=_0x1286ca-0x0;var _0x160434=_0x6010[_0x1286ca];return _0x160434;};'use strict';var multer=require(_0x0601('0x0'));var util=require(_0x0601('0x1'));var path=require(_0x0601('0x2'));var timeout=require(_0x0601('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0601('0x4'));var auth=require(_0x0601('0x5'));var interaction=require(_0x0601('0x6'));var config=require('../../config/environment');var controller=require(_0x0601('0x7'));router[_0x0601('0x8')]('/',auth['isAuthenticated'](),controller[_0x0601('0x9')]);router[_0x0601('0x8')](_0x0601('0xa'),auth['isAuthenticated'](),controller[_0x0601('0xb')]);router[_0x0601('0xc')]('/',auth[_0x0601('0xd')](),controller['create']);router[_0x0601('0xe')](_0x0601('0xa'),auth[_0x0601('0xd')](),controller[_0x0601('0xf')]);router['delete'](_0x0601('0xa'),auth['isAuthenticated'](),controller[_0x0601('0x10')]);module[_0x0601('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 35bf63a..9a8411e 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 _0x18d3=['picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18d3,0x181));var _0x318d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x18d3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x318d('0x0'));module[_0x318d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x318d('0x2'),_0x318d('0x3'),'customVariable',_0x318d('0x4'),_0x318d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x318d('0x6')]},'key':{'type':Sequelize[_0x318d('0x6')]},'keyType':{'type':Sequelize[_0x318d('0x7')](_0x318d('0x2'),_0x318d('0x3'),_0x318d('0x8'))},'keyContent':{'type':Sequelize[_0x318d('0x6')]},'idField':{'type':Sequelize[_0x318d('0x6')]},'nameField':{'type':Sequelize[_0x318d('0x6')]},'customField':{'type':Sequelize[_0x318d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x318d('0x6')]}}; \ No newline at end of file +var _0xfe93=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0xfe93,0x1b6));var _0x3fe9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xfe93[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x3fe9('0x0'));module[_0x3fe9('0x1')]={'type':{'type':Sequelize[_0x3fe9('0x2')](_0x3fe9('0x3'),_0x3fe9('0x4'),_0x3fe9('0x5'),'keyValue',_0x3fe9('0x6')),'defaultValue':_0x3fe9('0x3')},'content':{'type':Sequelize[_0x3fe9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3fe9('0x2')](_0x3fe9('0x3'),_0x3fe9('0x4'),_0x3fe9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3fe9('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3fe9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3fe9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f1afb91..0a0042c 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 _0x00a4=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','end','sendStatus','error','stack','name','send','index','ZohoField'];(function(_0x377a5c,_0x7f6aa9){var _0x4fa2b0=function(_0x345902){while(--_0x345902){_0x377a5c['push'](_0x377a5c['shift']());}};_0x4fa2b0(++_0x7f6aa9);}(_0x00a4,0x186));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x400a('0x0'));var rimraf=require(_0x400a('0x1'));var zipdir=require(_0x400a('0x2'));var jsonpatch=require(_0x400a('0x3'));var rp=require(_0x400a('0x4'));var moment=require('moment');var BPromise=require(_0x400a('0x5'));var Mustache=require('mustache');var util=require(_0x400a('0x6'));var path=require(_0x400a('0x7'));var sox=require('sox');var csv=require(_0x400a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x400a('0x9'));var squel=require(_0x400a('0xa'));var crypto=require(_0x400a('0xb'));var jsforce=require(_0x400a('0xc'));var deskjs=require(_0x400a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x400a('0xe'));var Papa=require(_0x400a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x400a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x400a('0x11'))(_0x400a('0x12'));var utils=require(_0x400a('0x13'));var config=require(_0x400a('0x14'));var licenseUtil=require(_0x400a('0x15'));var db=require(_0x400a('0x16'))['db'];function respondWithStatusCode(_0x49ebbd,_0x3b81e2){_0x3b81e2=_0x3b81e2||0xcc;return function(_0x74be0f){if(_0x74be0f){return _0x49ebbd['sendStatus'](_0x3b81e2);}return _0x49ebbd['status'](_0x3b81e2)['end']();};}function respondWithResult(_0x203759,_0x188c99){_0x188c99=_0x188c99||0xc8;return function(_0x2967aa){if(_0x2967aa){return _0x203759[_0x400a('0x17')](_0x188c99)[_0x400a('0x18')](_0x2967aa);}};}function respondWithFilteredResult(_0x41f35e,_0x5d86e1){return function(_0x275286){if(_0x275286){var _0xfd25c6=typeof _0x5d86e1[_0x400a('0x19')]===_0x400a('0x1a')&&typeof _0x5d86e1[_0x400a('0x1b')]===_0x400a('0x1a');var _0x1506c4=_0x275286['count'];var _0x2e6831=_0xfd25c6?0x0:_0x5d86e1[_0x400a('0x19')];var _0x267a4e=_0xfd25c6?_0x275286[_0x400a('0x1c')]:_0x5d86e1[_0x400a('0x19')]+_0x5d86e1[_0x400a('0x1b')];var _0x4c7ddf;if(_0x267a4e>=_0x1506c4){_0x267a4e=_0x1506c4;_0x4c7ddf=0xc8;}else{_0x4c7ddf=0xce;}_0x41f35e[_0x400a('0x17')](_0x4c7ddf);return _0x41f35e[_0x400a('0x1d')](_0x400a('0x1e'),_0x2e6831+'-'+_0x267a4e+'/'+_0x1506c4)['json'](_0x275286);}return null;};}function patchUpdates(_0xd7e75d){return function(_0x1ccb14){try{jsonpatch['apply'](_0x1ccb14,_0xd7e75d,!![]);}catch(_0x47f63a){return BPromise[_0x400a('0x1f')](_0x47f63a);}return _0x1ccb14['save']();};}function saveUpdates(_0x182b05,_0x368d55){return function(_0x11e1fa){if(_0x11e1fa){return _0x11e1fa[_0x400a('0x20')](_0x182b05)[_0x400a('0x21')](function(_0x11db80){return _0x11db80;});}return null;};}function removeEntity(_0x369387,_0x7ec3bb){return function(_0x4f4912){if(_0x4f4912){return _0x4f4912['destroy']()[_0x400a('0x21')](function(){_0x369387[_0x400a('0x17')](0xcc)[_0x400a('0x22')]();});}};}function handleEntityNotFound(_0x26682f,_0x328c54){return function(_0x51edd7){if(!_0x51edd7){_0x26682f[_0x400a('0x23')](0x194);}return _0x51edd7;};}function handleError(_0x36cc68,_0x2e9470){_0x2e9470=_0x2e9470||0x1f4;return function(_0x4f4bff){logger[_0x400a('0x24')](_0x4f4bff[_0x400a('0x25')]);if(_0x4f4bff[_0x400a('0x26')]){delete _0x4f4bff['name'];}_0x36cc68[_0x400a('0x17')](_0x2e9470)[_0x400a('0x27')](_0x4f4bff);};}exports[_0x400a('0x28')]=function(_0x3e7c43,_0x440c91){var _0x2706cc={},_0x3455f6={},_0x187e5f={'count':0x0,'rows':[]};var _0x2d6dd5=_['map'](db[_0x400a('0x29')][_0x400a('0x2a')],function(_0x2753e4){return{'name':_0x2753e4[_0x400a('0x2b')],'type':_0x2753e4[_0x400a('0x2c')][_0x400a('0x2d')]};});_0x3455f6[_0x400a('0x2e')]=_['map'](_0x2d6dd5,_0x400a('0x26'));_0x3455f6['query']=_[_0x400a('0x2f')](_0x3e7c43[_0x400a('0x30')]);_0x3455f6['filters']=_[_0x400a('0x31')](_0x3455f6['model'],_0x3455f6[_0x400a('0x30')]);_0x2706cc[_0x400a('0x32')]=_['intersection'](_0x3455f6[_0x400a('0x2e')],qs[_0x400a('0x33')](_0x3e7c43[_0x400a('0x30')][_0x400a('0x33')]));_0x2706cc[_0x400a('0x32')]=_0x2706cc['attributes'][_0x400a('0x34')]?_0x2706cc[_0x400a('0x32')]:_0x3455f6['model'];if(!_0x3e7c43[_0x400a('0x30')]['hasOwnProperty'](_0x400a('0x35'))){_0x2706cc[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x3e7c43[_0x400a('0x30')]['limit']);_0x2706cc['offset']=qs[_0x400a('0x19')](_0x3e7c43[_0x400a('0x30')][_0x400a('0x19')]);}_0x2706cc[_0x400a('0x36')]=qs[_0x400a('0x37')](_0x3e7c43['query'][_0x400a('0x37')]);_0x2706cc['where']=qs[_0x400a('0x38')](_[_0x400a('0x39')](_0x3e7c43['query'],_0x3455f6[_0x400a('0x38')]),_0x2d6dd5);if(_0x3e7c43['query'][_0x400a('0x3a')]){_0x2706cc['where']=_[_0x400a('0x3b')](_0x2706cc[_0x400a('0x3c')],{'$or':_['map'](_0x2d6dd5,function(_0x5843ab){if(_0x5843ab['type']!=='VIRTUAL'){var _0x34eb97={};_0x34eb97[_0x5843ab[_0x400a('0x26')]]={'$like':'%'+_0x3e7c43[_0x400a('0x30')]['filter']+'%'};return _0x34eb97;}})});}_0x2706cc=_['merge']({},_0x2706cc,_0x3e7c43[_0x400a('0x3d')]);var _0x35593f={'where':_0x2706cc[_0x400a('0x3c')]};return db[_0x400a('0x29')][_0x400a('0x1c')](_0x35593f)['then'](function(_0x28ba05){_0x187e5f[_0x400a('0x1c')]=_0x28ba05;if(_0x3e7c43[_0x400a('0x30')][_0x400a('0x3e')]){_0x2706cc[_0x400a('0x3f')]=[{'all':!![]}];}return db[_0x400a('0x29')][_0x400a('0x40')](_0x2706cc);})[_0x400a('0x21')](function(_0x409d25){_0x187e5f['rows']=_0x409d25;return _0x187e5f;})[_0x400a('0x21')](respondWithFilteredResult(_0x440c91,_0x2706cc))[_0x400a('0x41')](handleError(_0x440c91,null));};exports[_0x400a('0x42')]=function(_0x2832f9,_0x3512cf){var _0x541996={'raw':!![],'where':{'id':_0x2832f9[_0x400a('0x43')]['id']}},_0x3a5997={};_0x3a5997['model']=_[_0x400a('0x2f')](db[_0x400a('0x29')]['rawAttributes']);_0x3a5997[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x2832f9[_0x400a('0x30')]);_0x3a5997[_0x400a('0x38')]=_[_0x400a('0x31')](_0x3a5997['model'],_0x3a5997[_0x400a('0x30')]);_0x541996[_0x400a('0x32')]=_[_0x400a('0x31')](_0x3a5997[_0x400a('0x2e')],qs[_0x400a('0x33')](_0x2832f9[_0x400a('0x30')][_0x400a('0x33')]));_0x541996[_0x400a('0x32')]=_0x541996[_0x400a('0x32')][_0x400a('0x34')]?_0x541996[_0x400a('0x32')]:_0x3a5997[_0x400a('0x2e')];if(_0x2832f9[_0x400a('0x30')]['includeAll']){_0x541996[_0x400a('0x3f')]=[{'all':!![]}];}_0x541996=_['merge']({},_0x541996,_0x2832f9['options']);return db[_0x400a('0x29')]['find'](_0x541996)['then'](handleEntityNotFound(_0x3512cf,null))[_0x400a('0x21')](respondWithResult(_0x3512cf,null))[_0x400a('0x41')](handleError(_0x3512cf,null));};exports[_0x400a('0x44')]=function(_0x1d93aa,_0x921cae){return db['ZohoField'][_0x400a('0x44')](_0x1d93aa[_0x400a('0x45')],{})['then'](respondWithResult(_0x921cae,0xc9))[_0x400a('0x41')](handleError(_0x921cae,null));};exports['update']=function(_0x3ea387,_0x5671f3){if(_0x3ea387['body']['id']){delete _0x3ea387[_0x400a('0x45')]['id'];}return db[_0x400a('0x29')][_0x400a('0x46')]({'where':{'id':_0x3ea387[_0x400a('0x43')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x5671f3,null))[_0x400a('0x21')](saveUpdates(_0x3ea387[_0x400a('0x45')],null))[_0x400a('0x21')](respondWithResult(_0x5671f3,null))[_0x400a('0x41')](handleError(_0x5671f3,null));};exports[_0x400a('0x47')]=function(_0xf7a502,_0x65fab4){return db[_0x400a('0x29')]['find']({'where':{'id':_0xf7a502[_0x400a('0x43')]['id']}})['then'](handleEntityNotFound(_0x65fab4,null))['then'](removeEntity(_0x65fab4,null))[_0x400a('0x41')](handleError(_0x65fab4,null));}; \ No newline at end of file +var _0x8163=['save','update','destroy','then','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','options','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','reject'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x8163,0x13a));var _0x3816=function(_0x5d0426,_0x4443c2){_0x5d0426=_0x5d0426-0x0;var _0x1dcb9c=_0x8163[_0x5d0426];return _0x1dcb9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3816('0x0'));var zipdir=require(_0x3816('0x1'));var jsonpatch=require(_0x3816('0x2'));var rp=require(_0x3816('0x3'));var moment=require(_0x3816('0x4'));var BPromise=require(_0x3816('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3816('0x6'));var csv=require('to-csv');var ejs=require(_0x3816('0x7'));var fs=require('fs');var fs_extra=require(_0x3816('0x8'));var _=require(_0x3816('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3816('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3816('0xb'));var Papa=require(_0x3816('0xc'));var Redis=require(_0x3816('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3816('0xe'));var as=require(_0x3816('0xf'));var hardwareService=require(_0x3816('0x10'));var logger=require(_0x3816('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3816('0x12'));var licenseUtil=require(_0x3816('0x13'));var db=require(_0x3816('0x14'))['db'];function respondWithStatusCode(_0xc961f4,_0x1a4718){_0x1a4718=_0x1a4718||0xcc;return function(_0x1dd509){if(_0x1dd509){return _0xc961f4[_0x3816('0x15')](_0x1a4718);}return _0xc961f4[_0x3816('0x16')](_0x1a4718)[_0x3816('0x17')]();};}function respondWithResult(_0x4d4d8e,_0x589a8c){_0x589a8c=_0x589a8c||0xc8;return function(_0x5e6f12){if(_0x5e6f12){return _0x4d4d8e[_0x3816('0x16')](_0x589a8c)[_0x3816('0x18')](_0x5e6f12);}};}function respondWithFilteredResult(_0x5203ee,_0x215e30){return function(_0x2dcd2c){if(_0x2dcd2c){var _0xb9aec=typeof _0x215e30['offset']==='undefined'&&typeof _0x215e30[_0x3816('0x19')]==='undefined';var _0x1cff6c=_0x2dcd2c['count'];var _0x406f27=_0xb9aec?0x0:_0x215e30[_0x3816('0x1a')];var _0x20af04=_0xb9aec?_0x2dcd2c[_0x3816('0x1b')]:_0x215e30[_0x3816('0x1a')]+_0x215e30['limit'];var _0x41ecf9;if(_0x20af04>=_0x1cff6c){_0x20af04=_0x1cff6c;_0x41ecf9=0xc8;}else{_0x41ecf9=0xce;}_0x5203ee[_0x3816('0x16')](_0x41ecf9);return _0x5203ee['set'](_0x3816('0x1c'),_0x406f27+'-'+_0x20af04+'/'+_0x1cff6c)['json'](_0x2dcd2c);}return null;};}function patchUpdates(_0x41d6ce){return function(_0x22bb71){try{jsonpatch[_0x3816('0x1d')](_0x22bb71,_0x41d6ce,!![]);}catch(_0x1b3cfc){return BPromise[_0x3816('0x1e')](_0x1b3cfc);}return _0x22bb71[_0x3816('0x1f')]();};}function saveUpdates(_0x23f624,_0xdc44a3){return function(_0x2cc037){if(_0x2cc037){return _0x2cc037[_0x3816('0x20')](_0x23f624)['then'](function(_0x5a2409){return _0x5a2409;});}return null;};}function removeEntity(_0x5a49cf,_0x1f1454){return function(_0x385f55){if(_0x385f55){return _0x385f55[_0x3816('0x21')]()[_0x3816('0x22')](function(){_0x5a49cf[_0x3816('0x16')](0xcc)[_0x3816('0x17')]();});}};}function handleEntityNotFound(_0x4edbd2,_0x30104e){return function(_0x164d56){if(!_0x164d56){_0x4edbd2[_0x3816('0x15')](0x194);}return _0x164d56;};}function handleError(_0x3f7bf4,_0x169960){_0x169960=_0x169960||0x1f4;return function(_0x93cd8){logger['error'](_0x93cd8[_0x3816('0x23')]);if(_0x93cd8[_0x3816('0x24')]){delete _0x93cd8[_0x3816('0x24')];}_0x3f7bf4[_0x3816('0x16')](_0x169960)[_0x3816('0x25')](_0x93cd8);};}exports['index']=function(_0x37aea3,_0x495998){var _0x230d49={},_0x5f4253={},_0x2a3e6a={'count':0x0,'rows':[]};var _0x232493=_[_0x3816('0x26')](db[_0x3816('0x27')][_0x3816('0x28')],function(_0x12e313){return{'name':_0x12e313[_0x3816('0x29')],'type':_0x12e313['type'][_0x3816('0x2a')]};});_0x5f4253['model']=_[_0x3816('0x26')](_0x232493,'name');_0x5f4253[_0x3816('0x2b')]=_[_0x3816('0x2c')](_0x37aea3[_0x3816('0x2b')]);_0x5f4253[_0x3816('0x2d')]=_['intersection'](_0x5f4253[_0x3816('0x2e')],_0x5f4253[_0x3816('0x2b')]);_0x230d49[_0x3816('0x2f')]=_[_0x3816('0x30')](_0x5f4253[_0x3816('0x2e')],qs['fields'](_0x37aea3[_0x3816('0x2b')][_0x3816('0x31')]));_0x230d49['attributes']=_0x230d49[_0x3816('0x2f')][_0x3816('0x32')]?_0x230d49[_0x3816('0x2f')]:_0x5f4253[_0x3816('0x2e')];if(!_0x37aea3[_0x3816('0x2b')][_0x3816('0x33')]('nolimit')){_0x230d49[_0x3816('0x19')]=qs[_0x3816('0x19')](_0x37aea3[_0x3816('0x2b')][_0x3816('0x19')]);_0x230d49[_0x3816('0x1a')]=qs['offset'](_0x37aea3[_0x3816('0x2b')]['offset']);}_0x230d49[_0x3816('0x34')]=qs[_0x3816('0x35')](_0x37aea3[_0x3816('0x2b')]['sort']);_0x230d49['where']=qs[_0x3816('0x2d')](_[_0x3816('0x36')](_0x37aea3[_0x3816('0x2b')],_0x5f4253[_0x3816('0x2d')]),_0x232493);if(_0x37aea3[_0x3816('0x2b')][_0x3816('0x37')]){_0x230d49[_0x3816('0x38')]=_['merge'](_0x230d49[_0x3816('0x38')],{'$or':_[_0x3816('0x26')](_0x232493,function(_0x3baf70){if(_0x3baf70['type']!==_0x3816('0x39')){var _0x31096c={};_0x31096c[_0x3baf70[_0x3816('0x24')]]={'$like':'%'+_0x37aea3[_0x3816('0x2b')][_0x3816('0x37')]+'%'};return _0x31096c;}})});}_0x230d49=_[_0x3816('0x3a')]({},_0x230d49,_0x37aea3['options']);var _0x2ed4df={'where':_0x230d49['where']};return db[_0x3816('0x27')][_0x3816('0x1b')](_0x2ed4df)[_0x3816('0x22')](function(_0x40ec64){_0x2a3e6a[_0x3816('0x1b')]=_0x40ec64;if(_0x37aea3['query'][_0x3816('0x3b')]){_0x230d49[_0x3816('0x3c')]=[{'all':!![]}];}return db[_0x3816('0x27')][_0x3816('0x3d')](_0x230d49);})['then'](function(_0x7ae89d){_0x2a3e6a[_0x3816('0x3e')]=_0x7ae89d;return _0x2a3e6a;})[_0x3816('0x22')](respondWithFilteredResult(_0x495998,_0x230d49))['catch'](handleError(_0x495998,null));};exports['show']=function(_0x4b92d8,_0x169205){var _0x3386c6={'raw':!![],'where':{'id':_0x4b92d8['params']['id']}},_0xbf09b8={};_0xbf09b8['model']=_['keys'](db[_0x3816('0x27')][_0x3816('0x28')]);_0xbf09b8[_0x3816('0x2b')]=_[_0x3816('0x2c')](_0x4b92d8[_0x3816('0x2b')]);_0xbf09b8[_0x3816('0x2d')]=_[_0x3816('0x30')](_0xbf09b8[_0x3816('0x2e')],_0xbf09b8[_0x3816('0x2b')]);_0x3386c6[_0x3816('0x2f')]=_['intersection'](_0xbf09b8[_0x3816('0x2e')],qs[_0x3816('0x31')](_0x4b92d8[_0x3816('0x2b')][_0x3816('0x31')]));_0x3386c6[_0x3816('0x2f')]=_0x3386c6[_0x3816('0x2f')][_0x3816('0x32')]?_0x3386c6['attributes']:_0xbf09b8[_0x3816('0x2e')];if(_0x4b92d8[_0x3816('0x2b')][_0x3816('0x3b')]){_0x3386c6[_0x3816('0x3c')]=[{'all':!![]}];}_0x3386c6=_['merge']({},_0x3386c6,_0x4b92d8[_0x3816('0x3f')]);return db[_0x3816('0x27')][_0x3816('0x40')](_0x3386c6)['then'](handleEntityNotFound(_0x169205,null))[_0x3816('0x22')](respondWithResult(_0x169205,null))[_0x3816('0x41')](handleError(_0x169205,null));};exports[_0x3816('0x42')]=function(_0x5e6bb4,_0x51c373){return db[_0x3816('0x27')]['create'](_0x5e6bb4[_0x3816('0x43')],{})[_0x3816('0x22')](respondWithResult(_0x51c373,0xc9))[_0x3816('0x41')](handleError(_0x51c373,null));};exports[_0x3816('0x20')]=function(_0x8be15d,_0x7ea6c){if(_0x8be15d[_0x3816('0x43')]['id']){delete _0x8be15d[_0x3816('0x43')]['id'];}return db[_0x3816('0x27')]['find']({'where':{'id':_0x8be15d[_0x3816('0x44')]['id']}})['then'](handleEntityNotFound(_0x7ea6c,null))[_0x3816('0x22')](saveUpdates(_0x8be15d['body'],null))[_0x3816('0x22')](respondWithResult(_0x7ea6c,null))[_0x3816('0x41')](handleError(_0x7ea6c,null));};exports['destroy']=function(_0x3d7a37,_0x572b9b){return db[_0x3816('0x27')]['find']({'where':{'id':_0x3d7a37[_0x3816('0x44')]['id']}})['then'](handleEntityNotFound(_0x572b9b,null))[_0x3816('0x22')](removeEntity(_0x572b9b,null))[_0x3816('0x41')](handleError(_0x572b9b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3f57ed2..53d4bd2 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 _0xacf4=['bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','../../config/logger','api','moment'];(function(_0x33a40d,_0x2d88de){var _0x306fe8=function(_0x5c1031){while(--_0x5c1031){_0x33a40d['push'](_0x33a40d['shift']());}};_0x306fe8(++_0x2d88de);}(_0xacf4,0xe7));var _0x4acf=function(_0x27b485,_0x4ac16f){_0x27b485=_0x27b485-0x0;var _0x58c157=_0xacf4[_0x27b485];return _0x58c157;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25e7=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x34f44f,_0x7d83a0){var _0x32875c=function(_0x11e102){while(--_0x11e102){_0x34f44f['push'](_0x34f44f['shift']());}};_0x32875c(++_0x7d83a0);}(_0x25e7,0x1d6));var _0x725e=function(_0x166e33,_0x127e77){_0x166e33=_0x166e33-0x0;var _0x1a2409=_0x25e7[_0x166e33];return _0x1a2409;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var logger=require(_0x725e('0x2'))(_0x725e('0x3'));var moment=require(_0x725e('0x4'));var BPromise=require(_0x725e('0x5'));var rp=require(_0x725e('0x6'));var fs=require('fs');var path=require(_0x725e('0x7'));var rimraf=require(_0x725e('0x8'));var config=require(_0x725e('0x9'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x2497a5,_0x480945){return _0x2497a5['define'](_0x725e('0xa'),attributes,{'tableName':_0x725e('0xb'),'paranoid':![],'indexes':[{'name':_0x725e('0xc'),'fields':[_0x725e('0xd'),_0x725e('0xe')],'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 bcbfafa..ee3637a 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 _0xe2fa=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x30bfdc,_0x3e4b7e){var _0x110b84=function(_0x581858){while(--_0x581858){_0x30bfdc['push'](_0x30bfdc['shift']());}};_0x110b84(++_0x3e4b7e);}(_0xe2fa,0x119));var _0xae2f=function(_0x425e95,_0x307167){_0x425e95=_0x425e95-0x0;var _0x4ffac2=_0xe2fa[_0x425e95];return _0x4ffac2;};'use strict';var _=require(_0xae2f('0x0'));var util=require(_0xae2f('0x1'));var moment=require('moment');var BPromise=require(_0xae2f('0x2'));var rs=require(_0xae2f('0x3'));var fs=require('fs');var Redis=require(_0xae2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae2f('0x5'));var logger=require(_0xae2f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae2f('0x7'));var client=jayson[_0xae2f('0x8')][_0xae2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ca66f,_0x5a5805,_0x3d891f){return new BPromise(function(_0x231592,_0x36dfbc){return client[_0xae2f('0xa')](_0x1ca66f,_0x3d891f)[_0xae2f('0xb')](function(_0x421606){logger[_0xae2f('0xc')](_0xae2f('0xd'),_0x5a5805,_0xae2f('0xe'));logger[_0xae2f('0xf')](_0xae2f('0x10'),_0x5a5805,_0xae2f('0xe'),JSON[_0xae2f('0x11')](_0x421606));if(_0x421606[_0xae2f('0x12')]){if(_0x421606['error']['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x5a5805,_0x421606[_0xae2f('0x12')][_0xae2f('0x13')]);return _0x36dfbc(_0x421606[_0xae2f('0x12')]['message']);}logger['error'](_0xae2f('0xd'),_0x5a5805,_0x421606['error'][_0xae2f('0x13')]);return _0x231592(_0x421606[_0xae2f('0x12')][_0xae2f('0x13')]);}else{logger[_0xae2f('0xc')](_0xae2f('0xd'),_0x5a5805,_0xae2f('0xe'));_0x231592(_0x421606['result'][_0xae2f('0x13')]);}})[_0xae2f('0x14')](function(_0xcadcc){logger[_0xae2f('0x12')](_0xae2f('0xd'),_0x5a5805,_0xcadcc);_0x36dfbc(_0xcadcc);});});} \ No newline at end of file +var _0xb503=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','moment'];(function(_0x267cd5,_0x4be78f){var _0xebc4d6=function(_0x45936f){while(--_0x45936f){_0x267cd5['push'](_0x267cd5['shift']());}};_0xebc4d6(++_0x4be78f);}(_0xb503,0xfb));var _0x3b50=function(_0x5e2cbc,_0x399ca6){_0x5e2cbc=_0x5e2cbc-0x0;var _0x1123e4=_0xb503[_0x5e2cbc];return _0x1123e4;};'use strict';var _=require(_0x3b50('0x0'));var util=require('util');var moment=require(_0x3b50('0x1'));var BPromise=require(_0x3b50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b50('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b50('0x4'));var logger=require(_0x3b50('0x5'))(_0x3b50('0x6'));var config=require(_0x3b50('0x7'));var jayson=require(_0x3b50('0x8'));var client=jayson[_0x3b50('0x9')][_0x3b50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250d1c,_0x269771,_0x375109){return new BPromise(function(_0x2fbaf9,_0x1fc8e7){return client[_0x3b50('0xb')](_0x250d1c,_0x375109)[_0x3b50('0xc')](function(_0x1fbf04){logger[_0x3b50('0xd')](_0x3b50('0xe'),_0x269771,_0x3b50('0xf'));logger[_0x3b50('0x10')](_0x3b50('0x11'),_0x269771,_0x3b50('0xf'),JSON[_0x3b50('0x12')](_0x1fbf04));if(_0x1fbf04['error']){if(_0x1fbf04['error'][_0x3b50('0x13')]===0x1f4){logger[_0x3b50('0x14')]('ZohoField,\x20%s,\x20%s',_0x269771,_0x1fbf04[_0x3b50('0x14')]['message']);return _0x1fc8e7(_0x1fbf04[_0x3b50('0x14')][_0x3b50('0x15')]);}logger[_0x3b50('0x14')]('ZohoField,\x20%s,\x20%s',_0x269771,_0x1fbf04['error']['message']);return _0x2fbaf9(_0x1fbf04['error'][_0x3b50('0x15')]);}else{logger[_0x3b50('0xd')]('ZohoField,\x20%s,\x20%s',_0x269771,_0x3b50('0xf'));_0x2fbaf9(_0x1fbf04['result'][_0x3b50('0x15')]);}})[_0x3b50('0x16')](function(_0xa22475){logger[_0x3b50('0x14')](_0x3b50('0xe'),_0x269771,_0xa22475);_0x1fc8e7(_0xa22475);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 18939cd..061b264 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2b36a9,_0xd385c3){var _0x3e868a=function(_0x5b7fb7){while(--_0x5b7fb7){_0x2b36a9['push'](_0x2b36a9['shift']());}};_0x3e868a(++_0xd385c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0xcb91[_0x2ef8f1];return _0x17498d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1b857f,_0x286e31){var _0x5582e9=function(_0x643a90){while(--_0x643a90){_0x1b857f['push'](_0x1b857f['shift']());}};_0x5582e9(++_0x286e31);}(_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');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 47b556e..fdd0b23 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 _0xb65c=['INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x48667c,_0x5799ca){var _0x283941=function(_0x2af2de){while(--_0x2af2de){_0x48667c['push'](_0x48667c['shift']());}};_0x283941(++_0x5799ca);}(_0xb65c,0x16e));var _0xcb65=function(_0x48cb2b,_0x3b0835){_0x48cb2b=_0x48cb2b-0x0;var _0x3f3488=_0xb65c[_0x48cb2b];return _0x3f3488;};'use strict';var Sequelize=require(_0xcb65('0x0'));module[_0xcb65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb65('0x2')},'version':{'type':Sequelize[_0xcb65('0x3')],'allowNull':![],'unique':_0xcb65('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xcb65('0x4')},'filename':{'type':Sequelize[_0xcb65('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcb65('0x3')]},'size':{'type':Sequelize[_0xcb65('0x5')]},'active':{'type':Sequelize[_0xcb65('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xcb65('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xcb65('0x3')],'unique':'state'},'description':{'type':Sequelize[_0xcb65('0x3')]},'title':{'type':Sequelize[_0xcb65('0x3')]},'remoteUri':{'type':Sequelize[_0xcb65('0x3')]},'link':{'type':Sequelize[_0xcb65('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5c4c=['unique_name_and_version','STRING','INTEGER','BOOLEAN','state','exports'];(function(_0x434253,_0x392c4c){var _0x3636c4=function(_0x3a64e0){while(--_0x3a64e0){_0x434253['push'](_0x434253['shift']());}};_0x3636c4(++_0x392c4c);}(_0x5c4c,0x95));var _0xc5c4=function(_0x51132c,_0x4aeda8){_0x51132c=_0x51132c-0x0;var _0x4cf632=_0x5c4c[_0x51132c];return _0x4cf632;};'use strict';var Sequelize=require('sequelize');module[_0xc5c4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc5c4('0x1')},'version':{'type':Sequelize[_0xc5c4('0x2')],'allowNull':![],'unique':_0xc5c4('0x1')},'main':{'type':Sequelize[_0xc5c4('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xc5c4('0x2')]},'path':{'type':Sequelize[_0xc5c4('0x2')]},'type':{'type':Sequelize[_0xc5c4('0x2')]},'size':{'type':Sequelize[_0xc5c4('0x3')]},'active':{'type':Sequelize[_0xc5c4('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xc5c4('0x2')]},'state':{'type':Sequelize[_0xc5c4('0x2')],'unique':_0xc5c4('0x5')},'description':{'type':Sequelize[_0xc5c4('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5c4('0x2')]},'link':{'type':Sequelize[_0xc5c4('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 1e33258..c3bbd82 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(_0xf440be,_0x287c82){var _0x3656ca=function(_0x28ca47){while(--_0x28ca47){_0xf440be['push'](_0xf440be['shift']());}};_0x3656ca(++_0x287c82);}(_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 _0x33af=['merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where'];(function(_0x23997b,_0x4df825){var _0x7015cb=function(_0x570d01){while(--_0x570d01){_0x23997b['push'](_0x23997b['shift']());}};_0x7015cb(++_0x4df825);}(_0x33af,0xec));var _0xf33a=function(_0x550151,_0x49d953){_0x550151=_0x550151-0x0;var _0x1ba3cb=_0x33af[_0x550151];return _0x1ba3cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['Integration'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 0d9abab..5555e4e 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 _0xef2a=['../../config/environment','exports','define','Integration','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x568ad9,_0x1fae9e){var _0x5e694c=function(_0x4ce2b9){while(--_0x4ce2b9){_0x568ad9['push'](_0x568ad9['shift']());}};_0x5e694c(++_0x1fae9e);}(_0xef2a,0x88));var _0xaef2=function(_0x434b0a,_0x2fddef){_0x434b0a=_0x434b0a-0x0;var _0x10ba54=_0xef2a[_0x434b0a];return _0x10ba54;};'use strict';var _=require(_0xaef2('0x0'));var util=require(_0xaef2('0x1'));var logger=require(_0xaef2('0x2'))(_0xaef2('0x3'));var moment=require('moment');var BPromise=require(_0xaef2('0x4'));var rp=require(_0xaef2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef2('0x6'));var config=require(_0xaef2('0x7'));var attributes=require('./integration.attributes');module[_0xaef2('0x8')]=function(_0x394bf4,_0x1cb5ef){return _0x394bf4[_0xaef2('0x9')](_0xaef2('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd91b=['exports','Integration','integrations','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x3bdecf,_0x1b14b4){var _0x7cfade=function(_0x8a2ce6){while(--_0x8a2ce6){_0x3bdecf['push'](_0x3bdecf['shift']());}};_0x7cfade(++_0x1b14b4);}(_0xd91b,0x1b0));var _0xbd91=function(_0x12780d,_0x4e69c4){_0x12780d=_0x12780d-0x0;var _0x2023fe=_0xd91b[_0x12780d];return _0x2023fe;};'use strict';var _=require('lodash');var util=require(_0xbd91('0x0'));var logger=require(_0xbd91('0x1'))('api');var moment=require(_0xbd91('0x2'));var BPromise=require(_0xbd91('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd91('0x4'));var rimraf=require(_0xbd91('0x5'));var config=require(_0xbd91('0x6'));var attributes=require(_0xbd91('0x7'));module[_0xbd91('0x8')]=function(_0x191149,_0x20dcc3){return _0x191149['define'](_0xbd91('0x9'),attributes,{'tableName':_0xbd91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 755b2b9..e0b0db9 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ca7ca,_0x559929){var _0x17af13=function(_0x48942e){while(--_0x48942e){_0x2ca7ca['push'](_0x2ca7ca['shift']());}};_0x17af13(++_0x559929);}(_0x0295,0x1f0));var _0x5029=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x0295[_0x26bcec];return _0x1049dc;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x58fc55,_0x3d528a){var _0x2b461e=function(_0x648da){while(--_0x648da){_0x58fc55['push'](_0x58fc55['shift']());}};_0x2b461e(++_0x3d528a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x6d38[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2230a5f..8e395ac 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 _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x53ab39,_0x18131b){var _0x4b8182=function(_0x1feb2a){while(--_0x1feb2a){_0x53ab39['push'](_0x53ab39['shift']());}};_0x4b8182(++_0x18131b);}(_0x524e,0x15e));var _0xe524=function(_0x1bdc55,_0x9db043){_0x1bdc55=_0x1bdc55-0x0;var _0x19de9b=_0x524e[_0x1bdc55];return _0x19de9b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 24f89db..7a4a2bd 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 _0xf43c=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x3dc190,_0xa6c975){var _0x5bde76=function(_0xad954e){while(--_0xad954e){_0x3dc190['push'](_0x3dc190['shift']());}};_0x5bde76(++_0xa6c975);}(_0xf43c,0x7b));var _0xcf43=function(_0x3a40df,_0x1d262d){_0x3a40df=_0x3a40df-0x0;var _0x105865=_0xf43c[_0x3a40df];return _0x105865;};'use strict';var Sequelize=require(_0xcf43('0x0'));module[_0xcf43('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xcf43('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xcf43('0x3')]},'contacts':{'type':Sequelize[_0xcf43('0x2')]},'uniqueid':{'type':Sequelize[_0xcf43('0x2')]},'calleridnum':{'type':Sequelize[_0xcf43('0x2')]},'calleridname':{'type':Sequelize[_0xcf43('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xcf43('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xcf43('0x4')]},'agentconnectAt':{'type':Sequelize[_0xcf43('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xcf43('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcf43('0x4')]},'talktime':{'type':Sequelize[_0xcf43('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcf43('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xcf43('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcf43('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcf43('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcf43('0x2')]},'channelstate':{'type':Sequelize[_0xcf43('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcf43('0x2')]},'connectedlinenum':{'type':Sequelize[_0xcf43('0x2')]},'connectedlinename':{'type':Sequelize[_0xcf43('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcf43('0x2')]},'context':{'type':Sequelize[_0xcf43('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xcf43('0x2')]},'destchannelstate':{'type':Sequelize[_0xcf43('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xcf43('0x2')]},'destcalleridnum':{'type':Sequelize[_0xcf43('0x2')]},'destcalleridname':{'type':Sequelize[_0xcf43('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xcf43('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xcf43('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xcf43('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xcf43('0x2')]},'destuniqueid':{'type':Sequelize[_0xcf43('0x2')]},'messageId':{'type':Sequelize[_0xcf43('0x2')]},'inReplyTo':{'type':Sequelize[_0xcf43('0x2')]},'subject':{'type':Sequelize[_0xcf43('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcf43('0x2')]},'cc':{'type':Sequelize[_0xcf43('0x2')]},'attachment':{'type':Sequelize[_0xcf43('0x6')]},'html':{'type':Sequelize[_0xcf43('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xcf43('0x7'),_0xcf43('0x8'),_0xcf43('0x9'),_0xcf43('0xa'))},'url':{'type':Sequelize[_0xcf43('0x2')]},'app':{'type':Sequelize[_0xcf43('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3f5a=['ENUM','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0x13eddd,_0x2bb439){var _0x3125b5=function(_0x5c2188){while(--_0x5c2188){_0x13eddd['push'](_0x13eddd['shift']());}};_0x3125b5(++_0x2bb439);}(_0x3f5a,0x17c));var _0xa3f5=function(_0x47b7c9,_0x3848b2){_0x47b7c9=_0x47b7c9-0x0;var _0x435aaf=_0x3f5a[_0x47b7c9];return _0x435aaf;};'use strict';var Sequelize=require(_0xa3f5('0x0'));module[_0xa3f5('0x1')]={'integration':{'type':Sequelize[_0xa3f5('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xa3f5('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa3f5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa3f5('0x2')]},'interface':{'type':Sequelize[_0xa3f5('0x2')]},'membername':{'type':Sequelize[_0xa3f5('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa3f5('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xa3f5('0x4')]},'agentcomplete':{'type':Sequelize[_0xa3f5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa3f5('0x3')]},'talktime':{'type':Sequelize[_0xa3f5('0x4')]},'agentacw':{'type':Sequelize[_0xa3f5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xa3f5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa3f5('0x3')]},'agentdump':{'type':Sequelize[_0xa3f5('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xa3f5('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa3f5('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa3f5('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa3f5('0x2')]},'exten':{'type':Sequelize[_0xa3f5('0x2')]},'priority':{'type':Sequelize[_0xa3f5('0x2')]},'destchannel':{'type':Sequelize[_0xa3f5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa3f5('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa3f5('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa3f5('0x2')]},'destlanguage':{'type':Sequelize[_0xa3f5('0x2')]},'destaccountcode':{'type':Sequelize[_0xa3f5('0x2')]},'destcontext':{'type':Sequelize[_0xa3f5('0x2')]},'destexten':{'type':Sequelize[_0xa3f5('0x2')]},'destpriority':{'type':Sequelize[_0xa3f5('0x2')]},'destuniqueid':{'type':Sequelize[_0xa3f5('0x2')]},'messageId':{'type':Sequelize[_0xa3f5('0x2')]},'inReplyTo':{'type':Sequelize[_0xa3f5('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa3f5('0x2')]},'to':{'type':Sequelize[_0xa3f5('0x2')]},'cc':{'type':Sequelize[_0xa3f5('0x2')]},'attachment':{'type':Sequelize[_0xa3f5('0x6')]},'html':{'type':Sequelize[_0xa3f5('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa3f5('0x7')]('SENT','SENDING','RECEIVED',_0xa3f5('0x8'))},'url':{'type':Sequelize[_0xa3f5('0x2')]},'app':{'type':Sequelize[_0xa3f5('0x2')]},'appdata':{'type':Sequelize[_0xa3f5('0x2')]},'projectId':{'type':Sequelize[_0xa3f5('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 1004d3c..4948352 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 _0xf387=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x36e68e,_0x1cc8f6){var _0x1be971=function(_0x1f0707){while(--_0x1f0707){_0x36e68e['push'](_0x36e68e['shift']());}};_0x1be971(++_0x1cc8f6);}(_0xf387,0x65));var _0x7f38=function(_0x52b9a2,_0x4e8ea1){_0x52b9a2=_0x52b9a2-0x0;var _0xdce3cf=_0xf387[_0x52b9a2];return _0xdce3cf;};'use strict';var emlformat=require(_0x7f38('0x0'));var rimraf=require(_0x7f38('0x1'));var zipdir=require(_0x7f38('0x2'));var jsonpatch=require(_0x7f38('0x3'));var rp=require(_0x7f38('0x4'));var moment=require(_0x7f38('0x5'));var BPromise=require(_0x7f38('0x6'));var Mustache=require(_0x7f38('0x7'));var util=require('util');var path=require(_0x7f38('0x8'));var sox=require(_0x7f38('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f38('0xa'));var _=require(_0x7f38('0xb'));var squel=require(_0x7f38('0xc'));var crypto=require(_0x7f38('0xd'));var jsforce=require(_0x7f38('0xe'));var deskjs=require(_0x7f38('0xf'));var toCsv=require(_0x7f38('0x10'));var querystring=require(_0x7f38('0x11'));var Papa=require(_0x7f38('0x12'));var Redis=require(_0x7f38('0x13'));var authService=require(_0x7f38('0x14'));var qs=require(_0x7f38('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f38('0x16'));var logger=require('../../config/logger')(_0x7f38('0x17'));var utils=require('../../config/utils');var config=require(_0x7f38('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f38('0x19'))['db'];function respondWithStatusCode(_0x369cd3,_0x91b2b4){_0x91b2b4=_0x91b2b4||0xcc;return function(_0x41bfa8){if(_0x41bfa8){return _0x369cd3[_0x7f38('0x1a')](_0x91b2b4);}return _0x369cd3[_0x7f38('0x1b')](_0x91b2b4)[_0x7f38('0x1c')]();};}function respondWithResult(_0x5f4779,_0x1f4d79){_0x1f4d79=_0x1f4d79||0xc8;return function(_0x1d3cd9){if(_0x1d3cd9){return _0x5f4779[_0x7f38('0x1b')](_0x1f4d79)[_0x7f38('0x1d')](_0x1d3cd9);}};}function respondWithFilteredResult(_0x362981,_0x314045){return function(_0x501a82){if(_0x501a82){var _0x208f2d=typeof _0x314045[_0x7f38('0x1e')]===_0x7f38('0x1f')&&typeof _0x314045[_0x7f38('0x20')]==='undefined';var _0x1e4607=_0x501a82[_0x7f38('0x21')];var _0x27c65c=_0x208f2d?0x0:_0x314045[_0x7f38('0x1e')];var _0x205e9d=_0x208f2d?_0x501a82['count']:_0x314045['offset']+_0x314045['limit'];var _0x1e517e;if(_0x205e9d>=_0x1e4607){_0x205e9d=_0x1e4607;_0x1e517e=0xc8;}else{_0x1e517e=0xce;}_0x362981['status'](_0x1e517e);return _0x362981[_0x7f38('0x22')]('Content-Range',_0x27c65c+'-'+_0x205e9d+'/'+_0x1e4607)[_0x7f38('0x1d')](_0x501a82);}return null;};}function patchUpdates(_0x286ed4){return function(_0x53fc3e){try{jsonpatch[_0x7f38('0x23')](_0x53fc3e,_0x286ed4,!![]);}catch(_0x19cfcd){return BPromise[_0x7f38('0x24')](_0x19cfcd);}return _0x53fc3e[_0x7f38('0x25')]();};}function saveUpdates(_0x36784e,_0x181185){return function(_0x3b020c){if(_0x3b020c){return _0x3b020c[_0x7f38('0x26')](_0x36784e)['then'](function(_0x3b57cd){return _0x3b57cd;});}return null;};}function removeEntity(_0x5c383d,_0x903994){return function(_0xe26629){if(_0xe26629){return _0xe26629[_0x7f38('0x27')]()[_0x7f38('0x28')](function(){_0x5c383d[_0x7f38('0x1b')](0xcc)[_0x7f38('0x1c')]();});}};}function handleEntityNotFound(_0x210468,_0x41df61){return function(_0x200dcf){if(!_0x200dcf){_0x210468['sendStatus'](0x194);}return _0x200dcf;};}function handleError(_0x47f10e,_0xd73b60){_0xd73b60=_0xd73b60||0x1f4;return function(_0x2e383b){logger[_0x7f38('0x29')](_0x2e383b['stack']);if(_0x2e383b[_0x7f38('0x2a')]){delete _0x2e383b[_0x7f38('0x2a')];}_0x47f10e[_0x7f38('0x1b')](_0xd73b60)[_0x7f38('0x2b')](_0x2e383b);};}exports[_0x7f38('0x2c')]=function(_0x566750,_0x295863){var _0x5730f9={},_0x17514b={},_0x2f8eae={'count':0x0,'rows':[]};var _0x4342c2=_['map'](db[_0x7f38('0x2d')][_0x7f38('0x2e')],function(_0x3f123a){return{'name':_0x3f123a[_0x7f38('0x2f')],'type':_0x3f123a[_0x7f38('0x30')][_0x7f38('0x31')]};});_0x17514b[_0x7f38('0x32')]=_[_0x7f38('0x33')](_0x4342c2,'name');_0x17514b['query']=_[_0x7f38('0x34')](_0x566750[_0x7f38('0x35')]);_0x17514b['filters']=_[_0x7f38('0x36')](_0x17514b[_0x7f38('0x32')],_0x17514b[_0x7f38('0x35')]);_0x5730f9[_0x7f38('0x37')]=_['intersection'](_0x17514b[_0x7f38('0x32')],qs[_0x7f38('0x38')](_0x566750['query'][_0x7f38('0x38')]));_0x5730f9[_0x7f38('0x37')]=_0x5730f9['attributes'][_0x7f38('0x39')]?_0x5730f9['attributes']:_0x17514b[_0x7f38('0x32')];if(!_0x566750['query'][_0x7f38('0x3a')](_0x7f38('0x3b'))){_0x5730f9[_0x7f38('0x20')]=qs[_0x7f38('0x20')](_0x566750[_0x7f38('0x35')][_0x7f38('0x20')]);_0x5730f9[_0x7f38('0x1e')]=qs[_0x7f38('0x1e')](_0x566750[_0x7f38('0x35')][_0x7f38('0x1e')]);}_0x5730f9['order']=qs[_0x7f38('0x3c')](_0x566750[_0x7f38('0x35')]['sort']);_0x5730f9[_0x7f38('0x3d')]=qs[_0x7f38('0x3e')](_[_0x7f38('0x3f')](_0x566750[_0x7f38('0x35')],_0x17514b['filters']),_0x4342c2);if(_0x566750[_0x7f38('0x35')][_0x7f38('0x40')]){_0x5730f9[_0x7f38('0x3d')]=_[_0x7f38('0x41')](_0x5730f9['where'],{'$or':_[_0x7f38('0x33')](_0x4342c2,function(_0x49ef51){if(_0x49ef51[_0x7f38('0x30')]!==_0x7f38('0x42')){var _0x1db20c={};_0x1db20c[_0x49ef51[_0x7f38('0x2a')]]={'$like':'%'+_0x566750[_0x7f38('0x35')][_0x7f38('0x40')]+'%'};return _0x1db20c;}})});}_0x5730f9=_[_0x7f38('0x41')]({},_0x5730f9,_0x566750[_0x7f38('0x43')]);var _0x44b3bf={'where':_0x5730f9[_0x7f38('0x3d')]};return db[_0x7f38('0x2d')][_0x7f38('0x21')](_0x44b3bf)[_0x7f38('0x28')](function(_0x2cbfc6){_0x2f8eae[_0x7f38('0x21')]=_0x2cbfc6;if(_0x566750[_0x7f38('0x35')][_0x7f38('0x44')]){_0x5730f9[_0x7f38('0x45')]=[{'all':!![]}];}return db[_0x7f38('0x2d')]['findAll'](_0x5730f9);})[_0x7f38('0x28')](function(_0x4173fb){_0x2f8eae[_0x7f38('0x46')]=_0x4173fb;return _0x2f8eae;})[_0x7f38('0x28')](respondWithFilteredResult(_0x295863,_0x5730f9))[_0x7f38('0x47')](handleError(_0x295863,null));};exports[_0x7f38('0x48')]=function(_0x2cf65c,_0x554202){var _0x4041dd={'raw':![],'where':{'id':_0x2cf65c[_0x7f38('0x49')]['id']}},_0x37da5b={};_0x37da5b['model']=_['keys'](db[_0x7f38('0x2d')]['rawAttributes']);_0x37da5b[_0x7f38('0x35')]=_['keys'](_0x2cf65c[_0x7f38('0x35')]);_0x37da5b['filters']=_[_0x7f38('0x36')](_0x37da5b[_0x7f38('0x32')],_0x37da5b[_0x7f38('0x35')]);_0x4041dd[_0x7f38('0x37')]=_[_0x7f38('0x36')](_0x37da5b[_0x7f38('0x32')],qs[_0x7f38('0x38')](_0x2cf65c[_0x7f38('0x35')]['fields']));_0x4041dd[_0x7f38('0x37')]=_0x4041dd[_0x7f38('0x37')]['length']?_0x4041dd[_0x7f38('0x37')]:_0x37da5b['model'];if(_0x2cf65c[_0x7f38('0x35')][_0x7f38('0x44')]){_0x4041dd[_0x7f38('0x45')]=[{'all':!![]}];}_0x4041dd=_[_0x7f38('0x41')]({},_0x4041dd,_0x2cf65c['options']);return db['IntegrationReport'][_0x7f38('0x4a')](_0x4041dd)['then'](handleEntityNotFound(_0x554202,null))[_0x7f38('0x28')](respondWithResult(_0x554202,null))[_0x7f38('0x47')](handleError(_0x554202,null));};exports['create']=function(_0xdb5cf8,_0x32e76e){return db[_0x7f38('0x2d')]['create'](_0xdb5cf8['body'],{})[_0x7f38('0x28')](respondWithResult(_0x32e76e,0xc9))[_0x7f38('0x47')](handleError(_0x32e76e,null));};exports['update']=function(_0x3bb06f,_0x2bcbd7){if(_0x3bb06f[_0x7f38('0x4b')]['id']){delete _0x3bb06f['body']['id'];}return db['IntegrationReport'][_0x7f38('0x4a')]({'where':{'id':_0x3bb06f[_0x7f38('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bcbd7,null))[_0x7f38('0x28')](saveUpdates(_0x3bb06f[_0x7f38('0x4b')],null))['then'](respondWithResult(_0x2bcbd7,null))['catch'](handleError(_0x2bcbd7,null));};exports[_0x7f38('0x27')]=function(_0x377f4,_0x520621){return db['IntegrationReport'][_0x7f38('0x4a')]({'where':{'id':_0x377f4['params']['id']}})[_0x7f38('0x28')](handleEntityNotFound(_0x520621,null))[_0x7f38('0x28')](removeEntity(_0x520621,null))[_0x7f38('0x47')](handleError(_0x520621,null));};exports[_0x7f38('0x4c')]=function(_0x788bd,_0x2420c0){return db['IntegrationReport'][_0x7f38('0x4c')]()[_0x7f38('0x28')](respondWithResult(_0x2420c0,null))[_0x7f38('0x47')](handleError(_0x2420c0,null));}; \ No newline at end of file +var _0x4d58=['key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type'];(function(_0x56f972,_0x49b459){var _0xf415ef=function(_0x5e30f5){while(--_0x5e30f5){_0x56f972['push'](_0x56f972['shift']());}};_0xf415ef(++_0x49b459);}(_0x4d58,0xfa));var _0x84d5=function(_0x582613,_0x11597f){_0x582613=_0x582613-0x0;var _0xe266ec=_0x4d58[_0x582613];return _0xe266ec;};'use strict';var emlformat=require(_0x84d5('0x0'));var rimraf=require(_0x84d5('0x1'));var zipdir=require(_0x84d5('0x2'));var jsonpatch=require(_0x84d5('0x3'));var rp=require(_0x84d5('0x4'));var moment=require(_0x84d5('0x5'));var BPromise=require(_0x84d5('0x6'));var Mustache=require(_0x84d5('0x7'));var util=require(_0x84d5('0x8'));var path=require('path');var sox=require(_0x84d5('0x9'));var csv=require(_0x84d5('0xa'));var ejs=require(_0x84d5('0xb'));var fs=require('fs');var fs_extra=require(_0x84d5('0xc'));var _=require('lodash');var squel=require(_0x84d5('0xd'));var crypto=require(_0x84d5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x84d5('0xf'));var Redis=require('ioredis');var authService=require(_0x84d5('0x10'));var qs=require(_0x84d5('0x11'));var as=require(_0x84d5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84d5('0x13'))('api');var utils=require(_0x84d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x84d5('0x15'));var db=require(_0x84d5('0x16'))['db'];function respondWithStatusCode(_0x1eeaa5,_0x5c6714){_0x5c6714=_0x5c6714||0xcc;return function(_0x54631d){if(_0x54631d){return _0x1eeaa5['sendStatus'](_0x5c6714);}return _0x1eeaa5[_0x84d5('0x17')](_0x5c6714)[_0x84d5('0x18')]();};}function respondWithResult(_0x260fac,_0x6bd406){_0x6bd406=_0x6bd406||0xc8;return function(_0x4360fc){if(_0x4360fc){return _0x260fac[_0x84d5('0x17')](_0x6bd406)[_0x84d5('0x19')](_0x4360fc);}};}function respondWithFilteredResult(_0x42fcf8,_0x348a1f){return function(_0x2de31f){if(_0x2de31f){var _0x532fae=typeof _0x348a1f[_0x84d5('0x1a')]===_0x84d5('0x1b')&&typeof _0x348a1f['limit']===_0x84d5('0x1b');var _0x1488b8=_0x2de31f['count'];var _0x448c4d=_0x532fae?0x0:_0x348a1f[_0x84d5('0x1a')];var _0x46e7b1=_0x532fae?_0x2de31f[_0x84d5('0x1c')]:_0x348a1f[_0x84d5('0x1a')]+_0x348a1f[_0x84d5('0x1d')];var _0xd75fb9;if(_0x46e7b1>=_0x1488b8){_0x46e7b1=_0x1488b8;_0xd75fb9=0xc8;}else{_0xd75fb9=0xce;}_0x42fcf8[_0x84d5('0x17')](_0xd75fb9);return _0x42fcf8[_0x84d5('0x1e')]('Content-Range',_0x448c4d+'-'+_0x46e7b1+'/'+_0x1488b8)[_0x84d5('0x19')](_0x2de31f);}return null;};}function patchUpdates(_0x5540af){return function(_0x566fd6){try{jsonpatch['apply'](_0x566fd6,_0x5540af,!![]);}catch(_0x4be9c0){return BPromise[_0x84d5('0x1f')](_0x4be9c0);}return _0x566fd6[_0x84d5('0x20')]();};}function saveUpdates(_0x4846fb,_0x2e48e5){return function(_0x55c856){if(_0x55c856){return _0x55c856[_0x84d5('0x21')](_0x4846fb)[_0x84d5('0x22')](function(_0x596311){return _0x596311;});}return null;};}function removeEntity(_0x5ae45d,_0x2d9b33){return function(_0x587194){if(_0x587194){return _0x587194[_0x84d5('0x23')]()[_0x84d5('0x22')](function(){_0x5ae45d[_0x84d5('0x17')](0xcc)[_0x84d5('0x18')]();});}};}function handleEntityNotFound(_0x54d809,_0x4d74c1){return function(_0x29f2b1){if(!_0x29f2b1){_0x54d809[_0x84d5('0x24')](0x194);}return _0x29f2b1;};}function handleError(_0x179632,_0x4f6ff4){_0x4f6ff4=_0x4f6ff4||0x1f4;return function(_0x5d30f3){logger[_0x84d5('0x25')](_0x5d30f3[_0x84d5('0x26')]);if(_0x5d30f3[_0x84d5('0x27')]){delete _0x5d30f3['name'];}_0x179632[_0x84d5('0x17')](_0x4f6ff4)[_0x84d5('0x28')](_0x5d30f3);};}exports['index']=function(_0x1c641d,_0x124a90){var _0x6d0513={},_0x2add83={},_0x31add7={'count':0x0,'rows':[]};var _0x2cd0dd=_[_0x84d5('0x29')](db[_0x84d5('0x2a')][_0x84d5('0x2b')],function(_0xfab54e){return{'name':_0xfab54e[_0x84d5('0x2c')],'type':_0xfab54e[_0x84d5('0x2d')][_0x84d5('0x2e')]};});_0x2add83[_0x84d5('0x2f')]=_[_0x84d5('0x29')](_0x2cd0dd,_0x84d5('0x27'));_0x2add83[_0x84d5('0x30')]=_[_0x84d5('0x31')](_0x1c641d['query']);_0x2add83[_0x84d5('0x32')]=_[_0x84d5('0x33')](_0x2add83['model'],_0x2add83[_0x84d5('0x30')]);_0x6d0513['attributes']=_['intersection'](_0x2add83[_0x84d5('0x2f')],qs[_0x84d5('0x34')](_0x1c641d[_0x84d5('0x30')][_0x84d5('0x34')]));_0x6d0513[_0x84d5('0x35')]=_0x6d0513['attributes'][_0x84d5('0x36')]?_0x6d0513['attributes']:_0x2add83['model'];if(!_0x1c641d['query']['hasOwnProperty'](_0x84d5('0x37'))){_0x6d0513['limit']=qs[_0x84d5('0x1d')](_0x1c641d[_0x84d5('0x30')][_0x84d5('0x1d')]);_0x6d0513['offset']=qs[_0x84d5('0x1a')](_0x1c641d[_0x84d5('0x30')][_0x84d5('0x1a')]);}_0x6d0513['order']=qs[_0x84d5('0x38')](_0x1c641d['query'][_0x84d5('0x38')]);_0x6d0513['where']=qs[_0x84d5('0x32')](_[_0x84d5('0x39')](_0x1c641d[_0x84d5('0x30')],_0x2add83[_0x84d5('0x32')]),_0x2cd0dd);if(_0x1c641d[_0x84d5('0x30')]['filter']){_0x6d0513[_0x84d5('0x3a')]=_[_0x84d5('0x3b')](_0x6d0513[_0x84d5('0x3a')],{'$or':_[_0x84d5('0x29')](_0x2cd0dd,function(_0x352581){if(_0x352581[_0x84d5('0x2d')]!==_0x84d5('0x3c')){var _0x541e2f={};_0x541e2f[_0x352581[_0x84d5('0x27')]]={'$like':'%'+_0x1c641d['query'][_0x84d5('0x3d')]+'%'};return _0x541e2f;}})});}_0x6d0513=_['merge']({},_0x6d0513,_0x1c641d[_0x84d5('0x3e')]);var _0x1b13dc={'where':_0x6d0513[_0x84d5('0x3a')]};return db[_0x84d5('0x2a')][_0x84d5('0x1c')](_0x1b13dc)['then'](function(_0x47add2){_0x31add7[_0x84d5('0x1c')]=_0x47add2;if(_0x1c641d[_0x84d5('0x30')][_0x84d5('0x3f')]){_0x6d0513[_0x84d5('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0x84d5('0x41')](_0x6d0513);})[_0x84d5('0x22')](function(_0x5dad8f){_0x31add7[_0x84d5('0x42')]=_0x5dad8f;return _0x31add7;})[_0x84d5('0x22')](respondWithFilteredResult(_0x124a90,_0x6d0513))['catch'](handleError(_0x124a90,null));};exports[_0x84d5('0x43')]=function(_0x2e7d90,_0x42b442){var _0x3a959c={'raw':![],'where':{'id':_0x2e7d90[_0x84d5('0x44')]['id']}},_0xb95b69={};_0xb95b69[_0x84d5('0x2f')]=_[_0x84d5('0x31')](db[_0x84d5('0x2a')]['rawAttributes']);_0xb95b69[_0x84d5('0x30')]=_[_0x84d5('0x31')](_0x2e7d90[_0x84d5('0x30')]);_0xb95b69[_0x84d5('0x32')]=_[_0x84d5('0x33')](_0xb95b69['model'],_0xb95b69[_0x84d5('0x30')]);_0x3a959c['attributes']=_['intersection'](_0xb95b69['model'],qs[_0x84d5('0x34')](_0x2e7d90[_0x84d5('0x30')][_0x84d5('0x34')]));_0x3a959c['attributes']=_0x3a959c[_0x84d5('0x35')][_0x84d5('0x36')]?_0x3a959c['attributes']:_0xb95b69[_0x84d5('0x2f')];if(_0x2e7d90[_0x84d5('0x30')]['includeAll']){_0x3a959c['include']=[{'all':!![]}];}_0x3a959c=_['merge']({},_0x3a959c,_0x2e7d90[_0x84d5('0x3e')]);return db[_0x84d5('0x2a')]['find'](_0x3a959c)[_0x84d5('0x22')](handleEntityNotFound(_0x42b442,null))[_0x84d5('0x22')](respondWithResult(_0x42b442,null))[_0x84d5('0x45')](handleError(_0x42b442,null));};exports[_0x84d5('0x46')]=function(_0x27613c,_0x4a16dc){return db[_0x84d5('0x2a')]['create'](_0x27613c[_0x84d5('0x47')],{})[_0x84d5('0x22')](respondWithResult(_0x4a16dc,0xc9))[_0x84d5('0x45')](handleError(_0x4a16dc,null));};exports[_0x84d5('0x21')]=function(_0x296240,_0x38ac39){if(_0x296240[_0x84d5('0x47')]['id']){delete _0x296240[_0x84d5('0x47')]['id'];}return db['IntegrationReport'][_0x84d5('0x48')]({'where':{'id':_0x296240[_0x84d5('0x44')]['id']}})[_0x84d5('0x22')](handleEntityNotFound(_0x38ac39,null))['then'](saveUpdates(_0x296240[_0x84d5('0x47')],null))['then'](respondWithResult(_0x38ac39,null))[_0x84d5('0x45')](handleError(_0x38ac39,null));};exports[_0x84d5('0x23')]=function(_0x123461,_0x38ee1a){return db[_0x84d5('0x2a')][_0x84d5('0x48')]({'where':{'id':_0x123461[_0x84d5('0x44')]['id']}})['then'](handleEntityNotFound(_0x38ee1a,null))[_0x84d5('0x22')](removeEntity(_0x38ee1a,null))[_0x84d5('0x45')](handleError(_0x38ee1a,null));};exports[_0x84d5('0x49')]=function(_0x3ddb25,_0x3e1473){return db[_0x84d5('0x2a')][_0x84d5('0x49')]()[_0x84d5('0x22')](respondWithResult(_0x3e1473,null))[_0x84d5('0x45')](handleError(_0x3e1473,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a58998c..4e0fc3a 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 _0xf0f1=['report_integration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x386dad,_0x50f891){var _0x1f9d54=function(_0x1ab4b6){while(--_0x1ab4b6){_0x386dad['push'](_0x386dad['shift']());}};_0x1f9d54(++_0x50f891);}(_0xf0f1,0x12c));var _0x1f0f=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xf0f1[_0x281e5e];return _0x5a22d2;};'use strict';var _=require(_0x1f0f('0x0'));var util=require(_0x1f0f('0x1'));var logger=require(_0x1f0f('0x2'))(_0x1f0f('0x3'));var moment=require(_0x1f0f('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f0f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f0f('0x6'));var config=require(_0x1f0f('0x7'));var attributes=require(_0x1f0f('0x8'));module[_0x1f0f('0x9')]=function(_0x70969a,_0x4a232f){return _0x70969a[_0x1f0f('0xa')](_0x1f0f('0xb'),attributes,{'tableName':_0x1f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61a3=['bluebird','path','rimraf','./integrationReport.attributes','exports','define','util','../../config/logger','moment'];(function(_0x25f3e1,_0x18de94){var _0x3c389e=function(_0x5dfeac){while(--_0x5dfeac){_0x25f3e1['push'](_0x25f3e1['shift']());}};_0x3c389e(++_0x18de94);}(_0x61a3,0x1bf));var _0x361a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61a3[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x361a('0x0'));var logger=require(_0x361a('0x1'))('api');var moment=require(_0x361a('0x2'));var BPromise=require(_0x361a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x361a('0x4'));var rimraf=require(_0x361a('0x5'));var config=require('../../config/environment');var attributes=require(_0x361a('0x6'));module[_0x361a('0x7')]=function(_0x11966f,_0x36ebb2){return _0x11966f[_0x361a('0x8')]('IntegrationReport',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 d3d79b8..36e6482 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x53ec,0x192));var _0xc53e=function(_0x40348a,_0x5c0bb3){_0x40348a=_0x40348a-0x0;var _0x290d46=_0x53ec[_0x40348a];return _0x290d46;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47cf32,_0x6a9b4e){var _0x28c879=function(_0x50e0a0){while(--_0x50e0a0){_0x47cf32['push'](_0x47cf32['shift']());}};_0x28c879(++_0x6a9b4e);}(_0x326f,0xd1));var _0xf326=function(_0x45df89,_0xed3bdf){_0x45df89=_0x45df89-0x0;var _0x3aecd5=_0x326f[_0x45df89];return _0x3aecd5;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 9e8c0aa..26c1794 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 _0xfdcd=['../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','create','addInterval','addIntervals','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdfdc('0x0'));var path=require(_0xdfdc('0x1'));var timeout=require(_0xdfdc('0x2'));var express=require('express');var router=express[_0xdfdc('0x3')]();var fs_extra=require(_0xdfdc('0x4'));var auth=require(_0xdfdc('0x5'));var interaction=require(_0xdfdc('0x6'));var config=require(_0xdfdc('0x7'));var controller=require(_0xdfdc('0x8'));router[_0xdfdc('0x9')]('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xb')]);router[_0xdfdc('0x9')](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xd')]);router['get'](_0xdfdc('0xe'),auth[_0xdfdc('0xa')](),controller['getIntervals']);router[_0xdfdc('0xf')]('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x10')]);router[_0xdfdc('0xf')](_0xdfdc('0xe'),auth['isAuthenticated'](),controller[_0xdfdc('0x11')]);router['post']('/:id/sub_intervals/create_many',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x12')]);router[_0xdfdc('0x13')](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x14')]);router[_0xdfdc('0x15')]('/:id',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0x16')]);module[_0xdfdc('0x17')]=router; \ No newline at end of file +var _0x0183=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','/:id','get','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','delete'];(function(_0x216a2b,_0xe92cd6){var _0x4da9b7=function(_0x4be3a8){while(--_0x4be3a8){_0x216a2b['push'](_0x216a2b['shift']());}};_0x4da9b7(++_0xe92cd6);}(_0x0183,0x1e1));var _0x3018=function(_0x5338fe,_0x5e71d1){_0x5338fe=_0x5338fe-0x0;var _0xf0a1be=_0x0183[_0x5338fe];return _0xf0a1be;};'use strict';var multer=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var path=require(_0x3018('0x2'));var timeout=require(_0x3018('0x3'));var express=require(_0x3018('0x4'));var router=express[_0x3018('0x5')]();var fs_extra=require(_0x3018('0x6'));var auth=require(_0x3018('0x7'));var interaction=require(_0x3018('0x8'));var config=require(_0x3018('0x9'));var controller=require(_0x3018('0xa'));router['get']('/',auth[_0x3018('0xb')](),controller[_0x3018('0xc')]);router['get'](_0x3018('0xd'),auth[_0x3018('0xb')](),controller['show']);router[_0x3018('0xe')](_0x3018('0xf'),auth['isAuthenticated'](),controller[_0x3018('0x10')]);router[_0x3018('0x11')]('/',auth['isAuthenticated'](),controller[_0x3018('0x12')]);router[_0x3018('0x11')](_0x3018('0xf'),auth[_0x3018('0xb')](),controller['addInterval']);router[_0x3018('0x11')](_0x3018('0x13'),auth[_0x3018('0xb')](),controller[_0x3018('0x14')]);router[_0x3018('0x15')](_0x3018('0xd'),auth[_0x3018('0xb')](),controller['update']);router[_0x3018('0x16')](_0x3018('0xd'),auth[_0x3018('0xb')](),controller[_0x3018('0x17')]);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 98b9084..12a9d5f 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 _0xcccb=['exports','STRING'];(function(_0x1e9afa,_0x5ab465){var _0x1a5eff=function(_0x4fc4ef){while(--_0x4fc4ef){_0x1e9afa['push'](_0x1e9afa['shift']());}};_0x1a5eff(++_0x5ab465);}(_0xcccb,0x1e2));var _0xbccc=function(_0x1cc67b,_0x5e8a7c){_0x1cc67b=_0x1cc67b-0x0;var _0x529cd9=_0xcccb[_0x1cc67b];return _0x529cd9;};'use strict';var Sequelize=require('sequelize');module[_0xbccc('0x0')]={'name':{'type':Sequelize[_0xbccc('0x1')]},'description':{'type':Sequelize[_0xbccc('0x1')]},'interval':{'type':Sequelize[_0xbccc('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x5f1b=['sequelize','exports','STRING'];(function(_0x31c38c,_0x47f729){var _0x12f18f=function(_0x2e8097){while(--_0x2e8097){_0x31c38c['push'](_0x31c38c['shift']());}};_0x12f18f(++_0x47f729);}(_0x5f1b,0x198));var _0xb5f1=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x5f1b[_0x2caaef];return _0xd011f8;};'use strict';var Sequelize=require(_0xb5f1('0x0'));module[_0xb5f1('0x1')]={'name':{'type':Sequelize[_0xb5f1('0x2')]},'description':{'type':Sequelize[_0xb5f1('0x2')]},'interval':{'type':Sequelize[_0xb5f1('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 0e47f6a..2ba6d3e 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 _0xa87d=['where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','getIntervals','findOne','order','filter','addIntervals','transaction','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','Intervals','UserProfileResource','end','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort'];(function(_0x22a2c7,_0x1cae88){var _0x4abf52=function(_0x3faf3a){while(--_0x3faf3a){_0x22a2c7['push'](_0x22a2c7['shift']());}};_0x4abf52(++_0x1cae88);}(_0xa87d,0xc5));var _0xda87=function(_0x3cf780,_0x4412f9){_0x3cf780=_0x3cf780-0x0;var _0x181a05=_0xa87d[_0x3cf780];return _0x181a05;};'use strict';var emlformat=require(_0xda87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda87('0x2'));var moment=require(_0xda87('0x3'));var BPromise=require(_0xda87('0x4'));var Mustache=require(_0xda87('0x5'));var util=require(_0xda87('0x6'));var path=require('path');var sox=require(_0xda87('0x7'));var csv=require(_0xda87('0x8'));var ejs=require(_0xda87('0x9'));var fs=require('fs');var fs_extra=require(_0xda87('0xa'));var _=require('lodash');var squel=require(_0xda87('0xb'));var crypto=require(_0xda87('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xda87('0x8'));var querystring=require(_0xda87('0xd'));var Papa=require(_0xda87('0xe'));var Redis=require('ioredis');var authService=require(_0xda87('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda87('0x10'));var logger=require(_0xda87('0x11'))('api');var utils=require(_0xda87('0x12'));var config=require(_0xda87('0x13'));var licenseUtil=require(_0xda87('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xda87('0x15'));function respondWithStatusCode(_0xabb0ef,_0x43b1c3){_0x43b1c3=_0x43b1c3||0xcc;return function(_0x52028d){if(_0x52028d){return _0xabb0ef[_0xda87('0x16')](_0x43b1c3);}return _0xabb0ef[_0xda87('0x17')](_0x43b1c3)['end']();};}function respondWithResult(_0x2a7763,_0x53a552){_0x53a552=_0x53a552||0xc8;return function(_0x300b9f){if(_0x300b9f){return _0x2a7763['status'](_0x53a552)['json'](_0x300b9f);}};}function respondWithFilteredResult(_0x11c472,_0x1229b3){return function(_0x12296e){if(_0x12296e){var _0x51a526=typeof _0x1229b3[_0xda87('0x18')]===_0xda87('0x19')&&typeof _0x1229b3[_0xda87('0x1a')]===_0xda87('0x19');var _0x17bd35=_0x12296e['count'];var _0x9ea7c=_0x51a526?0x0:_0x1229b3['offset'];var _0x16d53c=_0x51a526?_0x12296e[_0xda87('0x1b')]:_0x1229b3[_0xda87('0x18')]+_0x1229b3['limit'];var _0x55fed3;if(_0x16d53c>=_0x17bd35){_0x16d53c=_0x17bd35;_0x55fed3=0xc8;}else{_0x55fed3=0xce;}_0x11c472[_0xda87('0x17')](_0x55fed3);return _0x11c472[_0xda87('0x1c')](_0xda87('0x1d'),_0x9ea7c+'-'+_0x16d53c+'/'+_0x17bd35)['json'](_0x12296e);}return null;};}function patchUpdates(_0x4c3306){return function(_0x3ef0a6){try{jsonpatch[_0xda87('0x1e')](_0x3ef0a6,_0x4c3306,!![]);}catch(_0x4cd0d6){return BPromise[_0xda87('0x1f')](_0x4cd0d6);}return _0x3ef0a6['save']();};}function saveUpdates(_0x3cfcf1,_0x30e0bd){return function(_0x3ea400){if(_0x3ea400){return _0x3ea400['update'](_0x3cfcf1)[_0xda87('0x20')](function(_0x29fcd6){return _0x29fcd6;});}return null;};}function removeEntity(_0x254298,_0x321cbd){return function(_0x2d2078){if(_0x2d2078){return _0x2d2078[_0xda87('0x21')]()[_0xda87('0x20')](function(){var _0x158463=_0x2d2078[_0xda87('0x22')]({'plain':!![]});var _0x442d3f=_0xda87('0x23');return db[_0xda87('0x24')][_0xda87('0x21')]({'where':{'type':_0x442d3f,'resourceId':_0x158463['id']}})[_0xda87('0x20')](function(){return _0x2d2078;});})[_0xda87('0x20')](function(){_0x254298[_0xda87('0x17')](0xcc)[_0xda87('0x25')]();});}};}function handleEntityNotFound(_0x21504f,_0x201fb1){return function(_0x35da91){if(!_0x35da91){_0x21504f['sendStatus'](0x194);}return _0x35da91;};}function handleError(_0x4217d6,_0x4c0d86){_0x4c0d86=_0x4c0d86||0x1f4;return function(_0x43f434){logger[_0xda87('0x26')](_0x43f434['stack']);if(_0x43f434['name']){delete _0x43f434[_0xda87('0x27')];}_0x4217d6[_0xda87('0x17')](_0x4c0d86)[_0xda87('0x28')](_0x43f434);};}exports[_0xda87('0x29')]=function(_0x182fc2,_0x43eb48){var _0x4e10ab={},_0xfeb3aa={},_0x4784c1={'count':0x0,'rows':[]};var _0x3c45d4=_[_0xda87('0x2a')](db[_0xda87('0x2b')][_0xda87('0x2c')],function(_0x3a1a21){return{'name':_0x3a1a21[_0xda87('0x2d')],'type':_0x3a1a21[_0xda87('0x2e')][_0xda87('0x2f')]};});_0xfeb3aa[_0xda87('0x30')]=_[_0xda87('0x2a')](_0x3c45d4,_0xda87('0x27'));_0xfeb3aa[_0xda87('0x31')]=_[_0xda87('0x32')](_0x182fc2[_0xda87('0x31')]);_0xfeb3aa[_0xda87('0x33')]=_['intersection'](_0xfeb3aa[_0xda87('0x30')],_0xfeb3aa[_0xda87('0x31')]);_0x4e10ab['attributes']=_[_0xda87('0x34')](_0xfeb3aa[_0xda87('0x30')],qs[_0xda87('0x35')](_0x182fc2['query'][_0xda87('0x35')]));_0x4e10ab[_0xda87('0x36')]=_0x4e10ab[_0xda87('0x36')][_0xda87('0x37')]?_0x4e10ab[_0xda87('0x36')]:_0xfeb3aa['model'];if(!_0x182fc2[_0xda87('0x31')][_0xda87('0x38')]('nolimit')){_0x4e10ab['limit']=qs[_0xda87('0x1a')](_0x182fc2[_0xda87('0x31')]['limit']);_0x4e10ab[_0xda87('0x18')]=qs['offset'](_0x182fc2[_0xda87('0x31')][_0xda87('0x18')]);}_0x4e10ab['order']=qs['sort'](_0x182fc2[_0xda87('0x31')][_0xda87('0x39')]);_0x4e10ab[_0xda87('0x3a')]=qs[_0xda87('0x33')](_[_0xda87('0x3b')](_0x182fc2[_0xda87('0x31')],_0xfeb3aa['filters']),_0x3c45d4);if(_0x182fc2['query']['filter']){_0x4e10ab[_0xda87('0x3a')]=_[_0xda87('0x3c')](_0x4e10ab['where'],{'$or':_[_0xda87('0x2a')](_0x3c45d4,function(_0x1f7158){if(_0x1f7158[_0xda87('0x2e')]!==_0xda87('0x3d')){var _0x5debd8={};_0x5debd8[_0x1f7158[_0xda87('0x27')]]={'$like':'%'+_0x182fc2[_0xda87('0x31')]['filter']+'%'};return _0x5debd8;}})});}_0x4e10ab=_[_0xda87('0x3c')]({},_0x4e10ab,_0x182fc2[_0xda87('0x3e')]);var _0x3e57a={'where':_0x4e10ab[_0xda87('0x3a')]};return db['Interval'][_0xda87('0x1b')](_0x3e57a)[_0xda87('0x20')](function(_0x4b7a0d){_0x4784c1[_0xda87('0x1b')]=_0x4b7a0d;if(_0x182fc2['query'][_0xda87('0x3f')]){_0x4e10ab[_0xda87('0x40')]=[{'all':!![]}];}return db[_0xda87('0x2b')][_0xda87('0x41')](_0x4e10ab);})[_0xda87('0x20')](function(_0x1572cc){_0x4784c1['rows']=_0x1572cc;return _0x4784c1;})['then'](respondWithFilteredResult(_0x43eb48,_0x4e10ab))[_0xda87('0x42')](handleError(_0x43eb48,null));};exports[_0xda87('0x43')]=function(_0x18b52b,_0x12cb74){var _0x1498d2={'raw':!![],'where':{'id':_0x18b52b[_0xda87('0x44')]['id']}},_0x38159c={};_0x38159c[_0xda87('0x30')]=_['keys'](db['Interval'][_0xda87('0x2c')]);_0x38159c['query']=_[_0xda87('0x32')](_0x18b52b[_0xda87('0x31')]);_0x38159c[_0xda87('0x33')]=_[_0xda87('0x34')](_0x38159c[_0xda87('0x30')],_0x38159c[_0xda87('0x31')]);_0x1498d2['attributes']=_[_0xda87('0x34')](_0x38159c['model'],qs[_0xda87('0x35')](_0x18b52b[_0xda87('0x31')][_0xda87('0x35')]));_0x1498d2[_0xda87('0x36')]=_0x1498d2['attributes'][_0xda87('0x37')]?_0x1498d2['attributes']:_0x38159c[_0xda87('0x30')];if(_0x18b52b['query'][_0xda87('0x3f')]){_0x1498d2[_0xda87('0x40')]=[{'all':!![]}];}_0x1498d2=_['merge']({},_0x1498d2,_0x18b52b[_0xda87('0x3e')]);return db[_0xda87('0x2b')]['find'](_0x1498d2)[_0xda87('0x20')](handleEntityNotFound(_0x12cb74,null))[_0xda87('0x20')](respondWithResult(_0x12cb74,null))['catch'](handleError(_0x12cb74,null));};exports[_0xda87('0x45')]=function(_0x17f33f,_0x1b53fa){return db[_0xda87('0x2b')][_0xda87('0x45')](_0x17f33f['body'],{})[_0xda87('0x20')](function(_0x530e28){var _0xd50931=_0x17f33f['user'][_0xda87('0x22')]({'plain':!![]});if(!_0xd50931)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd50931['role']==='user'){var _0x5318de=_0x530e28['get']({'plain':!![]});var _0x296754=_0xda87('0x23');return db[_0xda87('0x46')][_0xda87('0x47')]({'where':{'name':_0x296754,'userProfileId':_0xd50931[_0xda87('0x48')]},'raw':!![]})[_0xda87('0x20')](function(_0x2efc70){if(_0x2efc70&&_0x2efc70[_0xda87('0x49')]===0x0){return db[_0xda87('0x24')][_0xda87('0x45')]({'name':_0x5318de[_0xda87('0x27')],'resourceId':_0x5318de['id'],'type':_0x2efc70['name'],'sectionId':_0x2efc70['id']},{})[_0xda87('0x20')](function(){return _0x530e28;});}else{return _0x530e28;}})[_0xda87('0x42')](function(_0x43256f){logger['error'](_0xda87('0x4a'),_0x43256f);throw _0x43256f;});}return _0x530e28;})['then'](respondWithResult(_0x1b53fa,0xc9))[_0xda87('0x42')](handleError(_0x1b53fa,null));};exports[_0xda87('0x4b')]=function(_0xc3cdce,_0x2a4559){if(_0xc3cdce[_0xda87('0x4c')]['id']){delete _0xc3cdce[_0xda87('0x4c')]['id'];}return db[_0xda87('0x2b')]['find']({'where':{'id':_0xc3cdce['params']['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x2a4559,null))[_0xda87('0x20')](saveUpdates(_0xc3cdce['body'],null))[_0xda87('0x20')](respondWithResult(_0x2a4559,null))[_0xda87('0x42')](handleError(_0x2a4559,null));};exports['destroy']=function(_0x2c77d3,_0x5a11e5){return db[_0xda87('0x2b')][_0xda87('0x47')]({'where':{'id':_0x2c77d3[_0xda87('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a11e5,null))['then'](removeEntity(_0x5a11e5,null))[_0xda87('0x42')](handleError(_0x5a11e5,null));};exports[_0xda87('0x4d')]=function(_0xd3f485,_0x74c188,_0x3b7953){if(_0xd3f485['body']['id']){delete _0xd3f485['body']['id'];}return db[_0xda87('0x2b')][_0xda87('0x47')]({'where':{'id':_0xd3f485[_0xda87('0x44')]['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x74c188,null))[_0xda87('0x20')](function(_0x376c09){if(_0x376c09){_0xd3f485['body'][_0xda87('0x4e')]=_0x376c09['id'];return db[_0xda87('0x2b')]['create'](_0xd3f485[_0xda87('0x4c')]);}})['then'](respondWithResult(_0x74c188,null))[_0xda87('0x42')](handleError(_0x74c188,null));};exports[_0xda87('0x4f')]=function(_0x17b0a1,_0x507617,_0x49d951){var _0x956401={};var _0x174e93={};var _0x7a3ffc;var _0xfbc90b;return db[_0xda87('0x2b')][_0xda87('0x50')]({'where':{'id':_0x17b0a1[_0xda87('0x44')]['id']}})[_0xda87('0x20')](handleEntityNotFound(_0x507617,null))['then'](function(_0x328fea){if(_0x328fea){_0x7a3ffc=_0x328fea;_0x174e93['model']=_[_0xda87('0x32')](db[_0xda87('0x2b')][_0xda87('0x2c')]);_0x174e93[_0xda87('0x31')]=_['keys'](_0x17b0a1['query']);_0x174e93['filters']=_[_0xda87('0x34')](_0x174e93[_0xda87('0x30')],_0x174e93[_0xda87('0x31')]);_0x956401[_0xda87('0x36')]=_[_0xda87('0x34')](_0x174e93[_0xda87('0x30')],qs['fields'](_0x17b0a1[_0xda87('0x31')][_0xda87('0x35')]));_0x956401['attributes']=_0x956401[_0xda87('0x36')][_0xda87('0x37')]?_0x956401[_0xda87('0x36')]:_0x174e93['model'];_0x956401[_0xda87('0x51')]=qs[_0xda87('0x39')](_0x17b0a1[_0xda87('0x31')][_0xda87('0x39')]);_0x956401['where']=qs[_0xda87('0x33')](_[_0xda87('0x3b')](_0x17b0a1[_0xda87('0x31')],_0x174e93[_0xda87('0x33')]));if(_0x17b0a1['query']['filter']){_0x956401[_0xda87('0x3a')]=_[_0xda87('0x3c')](_0x956401['where'],{'$or':_['map'](_0x956401[_0xda87('0x36')],function(_0x1c9c17){var _0x38943b={};_0x38943b[_0x1c9c17]={'$like':'%'+_0x17b0a1[_0xda87('0x31')][_0xda87('0x52')]+'%'};return _0x38943b;})});}_0x956401=_['merge']({},_0x956401,_0x17b0a1[_0xda87('0x3e')]);return _0x7a3ffc[_0xda87('0x4f')](_0x956401);}})[_0xda87('0x20')](function(_0x17ac90){if(_0x17ac90){_0xfbc90b=_0x17ac90['length'];if(!_0x17b0a1[_0xda87('0x31')]['hasOwnProperty']('nolimit')){_0x956401['limit']=qs[_0xda87('0x1a')](_0x17b0a1[_0xda87('0x31')][_0xda87('0x1a')]);_0x956401[_0xda87('0x18')]=qs[_0xda87('0x18')](_0x17b0a1['query'][_0xda87('0x18')]);}return _0x7a3ffc['getIntervals'](_0x956401);}})[_0xda87('0x20')](function(_0x4de528){if(_0x4de528){return _0x4de528?{'count':_0xfbc90b,'rows':_0x4de528}:null;}})[_0xda87('0x20')](respondWithResult(_0x507617,null))[_0xda87('0x42')](handleError(_0x507617,null));};exports[_0xda87('0x53')]=function(_0x2458a3,_0x45e077,_0x24ec5a){return db['Interval']['findOne']({'where':{'id':_0x2458a3[_0xda87('0x44')]['id']}})['then'](handleEntityNotFound(_0x45e077,null))[_0xda87('0x20')](function(_0x2c348e){if(_0x2c348e){return db['sequelize'][_0xda87('0x54')](function(_0x29a32c){return db[_0xda87('0x2b')][_0xda87('0x21')]({'where':{'IntervalId':_0x2458a3['params']['id']},'transaction':_0x29a32c})[_0xda87('0x20')](function(_0x2c228e){var _0x3f6dad=_[_0xda87('0x2a')](_0x2458a3[_0xda87('0x4c')],function(_0x127e2f){delete _0x127e2f['id'];_0x127e2f[_0xda87('0x4e')]=_0x2458a3[_0xda87('0x44')]['id'];return _0x127e2f;});return db['Interval']['bulkCreate'](_0x3f6dad,{'transaction':_0x29a32c});});})[_0xda87('0x20')](function(){return db[_0xda87('0x2b')]['findAll']({'where':{'IntervalId':_0x2458a3['params']['id']}});});}})[_0xda87('0x20')](respondWithResult(_0x45e077,null))['catch'](handleError(_0x45e077,null));}; \ No newline at end of file +var _0x1871=['catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','bulkCreate','findAll','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','get','Intervals','UserProfileResource','destroy','end','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1871,0x1e6));var _0x1187=function(_0x1f8f3d,_0x1f2dfc){_0x1f8f3d=_0x1f8f3d-0x0;var _0x40d760=_0x1871[_0x1f8f3d];return _0x40d760;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1187('0x0'));var rp=require(_0x1187('0x1'));var moment=require(_0x1187('0x2'));var BPromise=require(_0x1187('0x3'));var Mustache=require(_0x1187('0x4'));var util=require(_0x1187('0x5'));var path=require(_0x1187('0x6'));var sox=require(_0x1187('0x7'));var csv=require(_0x1187('0x8'));var ejs=require(_0x1187('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1187('0xa'));var squel=require('squel');var crypto=require(_0x1187('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1187('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1187('0xd'));var Papa=require(_0x1187('0xe'));var Redis=require(_0x1187('0xf'));var authService=require(_0x1187('0x10'));var qs=require(_0x1187('0x11'));var as=require(_0x1187('0x12'));var hardwareService=require(_0x1187('0x13'));var logger=require(_0x1187('0x14'))(_0x1187('0x15'));var utils=require(_0x1187('0x16'));var config=require(_0x1187('0x17'));var licenseUtil=require(_0x1187('0x18'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x13d2f4,_0x3fad48){_0x3fad48=_0x3fad48||0xcc;return function(_0xe31223){if(_0xe31223){return _0x13d2f4[_0x1187('0x19')](_0x3fad48);}return _0x13d2f4[_0x1187('0x1a')](_0x3fad48)['end']();};}function respondWithResult(_0x24ba32,_0x39692a){_0x39692a=_0x39692a||0xc8;return function(_0xef68e3){if(_0xef68e3){return _0x24ba32[_0x1187('0x1a')](_0x39692a)[_0x1187('0x1b')](_0xef68e3);}};}function respondWithFilteredResult(_0x8138a0,_0x11968c){return function(_0x333308){if(_0x333308){var _0x49a850=typeof _0x11968c[_0x1187('0x1c')]===_0x1187('0x1d')&&typeof _0x11968c[_0x1187('0x1e')]===_0x1187('0x1d');var _0x25643a=_0x333308[_0x1187('0x1f')];var _0x59330d=_0x49a850?0x0:_0x11968c[_0x1187('0x1c')];var _0x2899cc=_0x49a850?_0x333308[_0x1187('0x1f')]:_0x11968c[_0x1187('0x1c')]+_0x11968c['limit'];var _0x105d4c;if(_0x2899cc>=_0x25643a){_0x2899cc=_0x25643a;_0x105d4c=0xc8;}else{_0x105d4c=0xce;}_0x8138a0[_0x1187('0x1a')](_0x105d4c);return _0x8138a0[_0x1187('0x20')]('Content-Range',_0x59330d+'-'+_0x2899cc+'/'+_0x25643a)[_0x1187('0x1b')](_0x333308);}return null;};}function patchUpdates(_0x313cec){return function(_0x3dd705){try{jsonpatch['apply'](_0x3dd705,_0x313cec,!![]);}catch(_0x5ed485){return BPromise[_0x1187('0x21')](_0x5ed485);}return _0x3dd705['save']();};}function saveUpdates(_0x4218c7,_0x8fc527){return function(_0x365ab0){if(_0x365ab0){return _0x365ab0[_0x1187('0x22')](_0x4218c7)[_0x1187('0x23')](function(_0x174c8d){return _0x174c8d;});}return null;};}function removeEntity(_0x1a3e97,_0x4d5827){return function(_0x5a9fc9){if(_0x5a9fc9){return _0x5a9fc9['destroy']()[_0x1187('0x23')](function(){var _0x3fed34=_0x5a9fc9[_0x1187('0x24')]({'plain':!![]});var _0x53c1c0=_0x1187('0x25');return db[_0x1187('0x26')][_0x1187('0x27')]({'where':{'type':_0x53c1c0,'resourceId':_0x3fed34['id']}})[_0x1187('0x23')](function(){return _0x5a9fc9;});})['then'](function(){_0x1a3e97['status'](0xcc)[_0x1187('0x28')]();});}};}function handleEntityNotFound(_0x519bab,_0x58a1f4){return function(_0x336126){if(!_0x336126){_0x519bab[_0x1187('0x19')](0x194);}return _0x336126;};}function handleError(_0x2f5fd6,_0x3a6ab0){_0x3a6ab0=_0x3a6ab0||0x1f4;return function(_0xad6357){logger[_0x1187('0x29')](_0xad6357[_0x1187('0x2a')]);if(_0xad6357['name']){delete _0xad6357[_0x1187('0x2b')];}_0x2f5fd6[_0x1187('0x1a')](_0x3a6ab0)[_0x1187('0x2c')](_0xad6357);};}exports['index']=function(_0x37d8ee,_0x27eece){var _0x4a5584={},_0x23d65f={},_0x20242e={'count':0x0,'rows':[]};var _0x4fa229=_['map'](db[_0x1187('0x2d')][_0x1187('0x2e')],function(_0x446164){return{'name':_0x446164[_0x1187('0x2f')],'type':_0x446164[_0x1187('0x30')][_0x1187('0x31')]};});_0x23d65f[_0x1187('0x32')]=_[_0x1187('0x33')](_0x4fa229,_0x1187('0x2b'));_0x23d65f[_0x1187('0x34')]=_[_0x1187('0x35')](_0x37d8ee[_0x1187('0x34')]);_0x23d65f[_0x1187('0x36')]=_[_0x1187('0x37')](_0x23d65f[_0x1187('0x32')],_0x23d65f['query']);_0x4a5584[_0x1187('0x38')]=_['intersection'](_0x23d65f[_0x1187('0x32')],qs[_0x1187('0x39')](_0x37d8ee[_0x1187('0x34')][_0x1187('0x39')]));_0x4a5584['attributes']=_0x4a5584['attributes'][_0x1187('0x3a')]?_0x4a5584[_0x1187('0x38')]:_0x23d65f[_0x1187('0x32')];if(!_0x37d8ee[_0x1187('0x34')][_0x1187('0x3b')](_0x1187('0x3c'))){_0x4a5584[_0x1187('0x1e')]=qs[_0x1187('0x1e')](_0x37d8ee[_0x1187('0x34')]['limit']);_0x4a5584[_0x1187('0x1c')]=qs[_0x1187('0x1c')](_0x37d8ee[_0x1187('0x34')]['offset']);}_0x4a5584[_0x1187('0x3d')]=qs[_0x1187('0x3e')](_0x37d8ee[_0x1187('0x34')]['sort']);_0x4a5584[_0x1187('0x3f')]=qs[_0x1187('0x36')](_[_0x1187('0x40')](_0x37d8ee[_0x1187('0x34')],_0x23d65f['filters']),_0x4fa229);if(_0x37d8ee[_0x1187('0x34')][_0x1187('0x41')]){_0x4a5584[_0x1187('0x3f')]=_[_0x1187('0x42')](_0x4a5584[_0x1187('0x3f')],{'$or':_[_0x1187('0x33')](_0x4fa229,function(_0x285924){if(_0x285924[_0x1187('0x30')]!==_0x1187('0x43')){var _0x1f2d12={};_0x1f2d12[_0x285924['name']]={'$like':'%'+_0x37d8ee[_0x1187('0x34')]['filter']+'%'};return _0x1f2d12;}})});}_0x4a5584=_[_0x1187('0x42')]({},_0x4a5584,_0x37d8ee[_0x1187('0x44')]);var _0xe5b9ae={'where':_0x4a5584['where']};return db[_0x1187('0x2d')][_0x1187('0x1f')](_0xe5b9ae)['then'](function(_0x313652){_0x20242e[_0x1187('0x1f')]=_0x313652;if(_0x37d8ee[_0x1187('0x34')][_0x1187('0x45')]){_0x4a5584[_0x1187('0x46')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x4a5584);})[_0x1187('0x23')](function(_0x23e467){_0x20242e[_0x1187('0x47')]=_0x23e467;return _0x20242e;})['then'](respondWithFilteredResult(_0x27eece,_0x4a5584))[_0x1187('0x48')](handleError(_0x27eece,null));};exports[_0x1187('0x49')]=function(_0x15e9f0,_0x388f69){var _0x56ef40={'raw':!![],'where':{'id':_0x15e9f0[_0x1187('0x4a')]['id']}},_0xd2997b={};_0xd2997b[_0x1187('0x32')]=_[_0x1187('0x35')](db[_0x1187('0x2d')]['rawAttributes']);_0xd2997b[_0x1187('0x34')]=_[_0x1187('0x35')](_0x15e9f0[_0x1187('0x34')]);_0xd2997b[_0x1187('0x36')]=_['intersection'](_0xd2997b[_0x1187('0x32')],_0xd2997b[_0x1187('0x34')]);_0x56ef40[_0x1187('0x38')]=_[_0x1187('0x37')](_0xd2997b['model'],qs['fields'](_0x15e9f0[_0x1187('0x34')][_0x1187('0x39')]));_0x56ef40[_0x1187('0x38')]=_0x56ef40['attributes'][_0x1187('0x3a')]?_0x56ef40[_0x1187('0x38')]:_0xd2997b['model'];if(_0x15e9f0['query']['includeAll']){_0x56ef40[_0x1187('0x46')]=[{'all':!![]}];}_0x56ef40=_[_0x1187('0x42')]({},_0x56ef40,_0x15e9f0[_0x1187('0x44')]);return db[_0x1187('0x2d')][_0x1187('0x4b')](_0x56ef40)[_0x1187('0x23')](handleEntityNotFound(_0x388f69,null))[_0x1187('0x23')](respondWithResult(_0x388f69,null))[_0x1187('0x48')](handleError(_0x388f69,null));};exports['create']=function(_0x5d6ebe,_0x3bd7e8){return db[_0x1187('0x2d')]['create'](_0x5d6ebe[_0x1187('0x4c')],{})[_0x1187('0x23')](function(_0x2b56be){var _0x6e2c10=_0x5d6ebe[_0x1187('0x4d')][_0x1187('0x24')]({'plain':!![]});if(!_0x6e2c10)throw new Error(_0x1187('0x4e'));if(_0x6e2c10[_0x1187('0x4f')]===_0x1187('0x4d')){var _0x2b4a4c=_0x2b56be[_0x1187('0x24')]({'plain':!![]});var _0x574248='Intervals';return db['UserProfileSection'][_0x1187('0x4b')]({'where':{'name':_0x574248,'userProfileId':_0x6e2c10[_0x1187('0x50')]},'raw':!![]})[_0x1187('0x23')](function(_0x6e7370){if(_0x6e7370&&_0x6e7370[_0x1187('0x51')]===0x0){return db[_0x1187('0x26')][_0x1187('0x52')]({'name':_0x2b4a4c['name'],'resourceId':_0x2b4a4c['id'],'type':_0x6e7370[_0x1187('0x2b')],'sectionId':_0x6e7370['id']},{})['then'](function(){return _0x2b56be;});}else{return _0x2b56be;}})[_0x1187('0x48')](function(_0x2ea783){logger['error'](_0x1187('0x53'),_0x2ea783);throw _0x2ea783;});}return _0x2b56be;})[_0x1187('0x23')](respondWithResult(_0x3bd7e8,0xc9))[_0x1187('0x48')](handleError(_0x3bd7e8,null));};exports['update']=function(_0x441f97,_0x5e8653){if(_0x441f97[_0x1187('0x4c')]['id']){delete _0x441f97[_0x1187('0x4c')]['id'];}return db['Interval'][_0x1187('0x4b')]({'where':{'id':_0x441f97['params']['id']}})[_0x1187('0x23')](handleEntityNotFound(_0x5e8653,null))[_0x1187('0x23')](saveUpdates(_0x441f97[_0x1187('0x4c')],null))['then'](respondWithResult(_0x5e8653,null))[_0x1187('0x48')](handleError(_0x5e8653,null));};exports[_0x1187('0x27')]=function(_0x2cbd39,_0x33fde5){return db[_0x1187('0x2d')][_0x1187('0x4b')]({'where':{'id':_0x2cbd39[_0x1187('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33fde5,null))[_0x1187('0x23')](removeEntity(_0x33fde5,null))[_0x1187('0x48')](handleError(_0x33fde5,null));};exports[_0x1187('0x54')]=function(_0x158e05,_0x272d32,_0x199e1d){if(_0x158e05['body']['id']){delete _0x158e05[_0x1187('0x4c')]['id'];}return db[_0x1187('0x2d')][_0x1187('0x4b')]({'where':{'id':_0x158e05[_0x1187('0x4a')]['id']}})[_0x1187('0x23')](handleEntityNotFound(_0x272d32,null))['then'](function(_0x38415e){if(_0x38415e){_0x158e05[_0x1187('0x4c')][_0x1187('0x55')]=_0x38415e['id'];return db[_0x1187('0x2d')][_0x1187('0x52')](_0x158e05[_0x1187('0x4c')]);}})[_0x1187('0x23')](respondWithResult(_0x272d32,null))[_0x1187('0x48')](handleError(_0x272d32,null));};exports[_0x1187('0x56')]=function(_0x41febb,_0xf7eb99,_0x17862f){var _0x30fb29={};var _0x3b5feb={};var _0x21e93a;var _0x32fbe6;return db[_0x1187('0x2d')]['findOne']({'where':{'id':_0x41febb[_0x1187('0x4a')]['id']}})[_0x1187('0x23')](handleEntityNotFound(_0xf7eb99,null))[_0x1187('0x23')](function(_0x5e3640){if(_0x5e3640){_0x21e93a=_0x5e3640;_0x3b5feb[_0x1187('0x32')]=_[_0x1187('0x35')](db[_0x1187('0x2d')][_0x1187('0x2e')]);_0x3b5feb[_0x1187('0x34')]=_[_0x1187('0x35')](_0x41febb[_0x1187('0x34')]);_0x3b5feb[_0x1187('0x36')]=_['intersection'](_0x3b5feb['model'],_0x3b5feb[_0x1187('0x34')]);_0x30fb29['attributes']=_[_0x1187('0x37')](_0x3b5feb[_0x1187('0x32')],qs[_0x1187('0x39')](_0x41febb[_0x1187('0x34')][_0x1187('0x39')]));_0x30fb29['attributes']=_0x30fb29[_0x1187('0x38')]['length']?_0x30fb29[_0x1187('0x38')]:_0x3b5feb[_0x1187('0x32')];_0x30fb29['order']=qs[_0x1187('0x3e')](_0x41febb[_0x1187('0x34')][_0x1187('0x3e')]);_0x30fb29[_0x1187('0x3f')]=qs[_0x1187('0x36')](_['pick'](_0x41febb[_0x1187('0x34')],_0x3b5feb[_0x1187('0x36')]));if(_0x41febb['query']['filter']){_0x30fb29[_0x1187('0x3f')]=_[_0x1187('0x42')](_0x30fb29[_0x1187('0x3f')],{'$or':_[_0x1187('0x33')](_0x30fb29[_0x1187('0x38')],function(_0x3eb385){var _0x199ea1={};_0x199ea1[_0x3eb385]={'$like':'%'+_0x41febb[_0x1187('0x34')][_0x1187('0x41')]+'%'};return _0x199ea1;})});}_0x30fb29=_['merge']({},_0x30fb29,_0x41febb[_0x1187('0x44')]);return _0x21e93a[_0x1187('0x56')](_0x30fb29);}})[_0x1187('0x23')](function(_0x5d42d0){if(_0x5d42d0){_0x32fbe6=_0x5d42d0[_0x1187('0x3a')];if(!_0x41febb[_0x1187('0x34')]['hasOwnProperty'](_0x1187('0x3c'))){_0x30fb29['limit']=qs[_0x1187('0x1e')](_0x41febb[_0x1187('0x34')][_0x1187('0x1e')]);_0x30fb29[_0x1187('0x1c')]=qs[_0x1187('0x1c')](_0x41febb[_0x1187('0x34')][_0x1187('0x1c')]);}return _0x21e93a['getIntervals'](_0x30fb29);}})[_0x1187('0x23')](function(_0x4fb6b8){if(_0x4fb6b8){return _0x4fb6b8?{'count':_0x32fbe6,'rows':_0x4fb6b8}:null;}})[_0x1187('0x23')](respondWithResult(_0xf7eb99,null))[_0x1187('0x48')](handleError(_0xf7eb99,null));};exports[_0x1187('0x57')]=function(_0x1175b9,_0x2af999,_0x1b94a6){return db['Interval'][_0x1187('0x58')]({'where':{'id':_0x1175b9[_0x1187('0x4a')]['id']}})[_0x1187('0x23')](handleEntityNotFound(_0x2af999,null))[_0x1187('0x23')](function(_0x11ae4d){if(_0x11ae4d){return db[_0x1187('0x59')][_0x1187('0x5a')](function(_0x4c95d9){return db[_0x1187('0x2d')]['destroy']({'where':{'IntervalId':_0x1175b9[_0x1187('0x4a')]['id']},'transaction':_0x4c95d9})['then'](function(_0x25e840){var _0x37e512=_['map'](_0x1175b9[_0x1187('0x4c')],function(_0x21d1f2){delete _0x21d1f2['id'];_0x21d1f2[_0x1187('0x55')]=_0x1175b9[_0x1187('0x4a')]['id'];return _0x21d1f2;});return db[_0x1187('0x2d')][_0x1187('0x5b')](_0x37e512,{'transaction':_0x4c95d9});});})['then'](function(){return db[_0x1187('0x2d')][_0x1187('0x5c')]({'where':{'IntervalId':_0x1175b9[_0x1187('0x4a')]['id']}});});}})[_0x1187('0x23')](respondWithResult(_0x2af999,null))['catch'](handleError(_0x2af999,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 1ad88b0..4caa05a 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 _0x81db=['exports','tools_intervals','rewrite','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite'];(function(_0x46784e,_0x2adf21){var _0x2776da=function(_0x47aa77){while(--_0x47aa77){_0x46784e['push'](_0x46784e['shift']());}};_0x2776da(++_0x2adf21);}(_0x81db,0x9f));var _0xb81d=function(_0x135d50,_0x49fdf6){_0x135d50=_0x135d50-0x0;var _0x29836c=_0x81db[_0x135d50];return _0x29836c;};'use strict';var _=require(_0xb81d('0x0'));var util=require('util');var logger=require(_0xb81d('0x1'))(_0xb81d('0x2'));var moment=require('moment');var BPromise=require(_0xb81d('0x3'));var rp=require(_0xb81d('0x4'));var fs=require('fs');var path=require(_0xb81d('0x5'));var rimraf=require(_0xb81d('0x6'));var config=require(_0xb81d('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xb81d('0x8'));module[_0xb81d('0x9')]=function(_0x436784,_0x51cae3){return _0x436784['define']('Interval',attributes,{'tableName':_0xb81d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5674e9,_0x2830fe){extensions[_0xb81d('0xb')](_0x436784,_0x5674e9);},'afterBulkCreate':function(_0x3c5be4,_0x38f097,_0x13d5f9){_0x13d5f9();extensions[_0xb81d('0xb')](_0x436784,_0x3c5be4[0x0]);},'afterUpdate':function(_0x3a6b2e,_0x5df31f){extensions[_0xb81d('0xb')](_0x436784,_0x3a6b2e);},'afterDestroy':function(_0x4ad22e,_0x4327b2){extensions[_0xb81d('0xb')](_0x436784,_0x4ad22e);}}});}; \ No newline at end of file +var _0x38b8=['bluebird','rimraf','../../config/environment','exports','define','Interval','rewrite','lodash','../../config/logger','api'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var logger=require(_0x838b('0x1'))(_0x838b('0x2'));var moment=require('moment');var BPromise=require(_0x838b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x838b('0x4'));var config=require(_0x838b('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x838b('0x6')]=function(_0x4299dc,_0x5c516c){return _0x4299dc[_0x838b('0x7')](_0x838b('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x552245,_0x1a6bc0){extensions[_0x838b('0x9')](_0x4299dc,_0x552245);},'afterBulkCreate':function(_0x31ba84,_0x552a0f,_0x22cda4){_0x22cda4();extensions['rewrite'](_0x4299dc,_0x31ba84[0x0]);},'afterUpdate':function(_0x3884e3,_0x24ce13){extensions[_0x838b('0x9')](_0x4299dc,_0x3884e3);},'afterDestroy':function(_0x111a26,_0x241e6a){extensions[_0x838b('0x9')](_0x4299dc,_0x111a26);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 236352c..14ded5f 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 52656d7..1bcc783 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2ffee8,_0x308957){var _0x26f0c8=function(_0x3c5ef2){while(--_0x3c5ef2){_0x2ffee8['push'](_0x2ffee8['shift']());}};_0x26f0c8(++_0x308957);}(_0x2032,0xd9));var _0x2203=function(_0x12accf,_0x357361){_0x12accf=_0x12accf-0x0;var _0x1f99bc=_0x2032[_0x12accf];return _0x1f99bc;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 374b99e..cf2a1ec 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 _0xdd7b=['setEncoding','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','3eAmWpBVP0','key','summary','\x20from\x20','description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64'];(function(_0x1fb80d,_0x4591b0){var _0x1e9d52=function(_0x238215){while(--_0x238215){_0x1fb80d['push'](_0x1fb80d['shift']());}};_0x1e9d52(++_0x4591b0);}(_0xdd7b,0x130));var _0xbdd7=function(_0x25a661,_0x28b612){_0x25a661=_0x25a661-0x0;var _0x16a63c=_0xdd7b[_0x25a661];return _0x16a63c;};'use strict';var BPromise=require('bluebird');var https=require(_0xbdd7('0x0'));var logger=require(_0xbdd7('0x1'))('api');var USERNAME=_0xbdd7('0x2');var PASSWORD=_0xbdd7('0x3');function openIssue(_0xe0b306,_0x1e4e60){var _0x4e113a={'fields':{'project':{'key':_0xe0b306[_0xbdd7('0x4')]||'MOTGUI'},'summary':(_0xe0b306[_0xbdd7('0x5')]||'Report')+_0xbdd7('0x6')+_0xe0b306['ip'],'description':_0xe0b306[_0xbdd7('0x7')]||JSON[_0xbdd7('0x8')](_0xe0b306),'issuetype':{'name':_0xe0b306[_0xbdd7('0x9')]||'Bug'}}};_0x4e113a[_0xbdd7('0xa')]['customfield_11500']=_0xe0b306[_0xbdd7('0xb')];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0xc')]=_0xe0b306[_0xbdd7('0xd')];_0x4e113a['fields']['customfield_11502']=_0xe0b306['newToken'];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0xe')]=_0xe0b306[_0xbdd7('0xf')];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0x10')]=_0xe0b306['reason'];_0x4e113a[_0xbdd7('0xa')][_0xbdd7('0x11')]=_0xe0b306['ip'];var _0x3c574d={'host':_0xbdd7('0x12'),'port':0x1bb,'path':_0xbdd7('0x13'),'method':_0xbdd7('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xbdd7('0x15'),'Authorization':_0xbdd7('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xbdd7('0x17'))}};var _0x18bb1c=JSON[_0xbdd7('0x8')](_0x4e113a);var _0x203c53=https['request'](_0x3c574d,function(_0x22b21b){_0x22b21b[_0xbdd7('0x18')]('utf8');var _0x4708a7='';_0x22b21b['on'](_0xbdd7('0x19'),function(_0x47f781){_0x4708a7+=_0x47f781;});_0x22b21b['on'](_0xbdd7('0x1a'),function(){if(_0x1e4e60){return _0x1e4e60[_0xbdd7('0x1b')](_0x22b21b[_0xbdd7('0x1c')])[_0xbdd7('0x1d')](JSON['parse'](_0x4708a7));}});});_0x203c53['on']('error',function(_0x24ce0a){if(_0x1e4e60){return _0x1e4e60[_0xbdd7('0x1b')](0x1f4)[_0xbdd7('0x1d')]({'errors':[{'message':_0xbdd7('0x1e'),'type':_0xbdd7('0x1f')}]});}});_0x203c53[_0xbdd7('0x20')](_0x18bb1c);_0x203c53['end']();}exports[_0xbdd7('0x21')]=openIssue;exports[_0xbdd7('0x22')]=function(_0x2c28f1,_0x1cb5ac){_0x2c28f1[_0xbdd7('0x23')]['ip']=_0x2c28f1[_0xbdd7('0x24')][_0xbdd7('0x25')]||_0x2c28f1[_0xbdd7('0x26')][_0xbdd7('0x27')]||_0x2c28f1[_0xbdd7('0x28')][_0xbdd7('0x27')]||_0x2c28f1[_0xbdd7('0x26')]['socket']['remoteAddress'];return openIssue(_0x2c28f1[_0xbdd7('0x23')],_0x1cb5ac);}; \ No newline at end of file +var _0x72d4=['statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','base64','request','utf8','data','end','status'];(function(_0x59dc5b,_0x339687){var _0x4cb142=function(_0x2856f0){while(--_0x2856f0){_0x59dc5b['push'](_0x59dc5b['shift']());}};_0x4cb142(++_0x339687);}(_0x72d4,0x127));var _0x472d=function(_0x7c6500,_0x3fb9b4){_0x7c6500=_0x7c6500-0x0;var _0x56345d=_0x72d4[_0x7c6500];return _0x56345d;};'use strict';var BPromise=require(_0x472d('0x0'));var https=require(_0x472d('0x1'));var logger=require(_0x472d('0x2'))(_0x472d('0x3'));var USERNAME=_0x472d('0x4');var PASSWORD=_0x472d('0x5');function openIssue(_0xad9bb5,_0x5e8628){var _0x2c35bf={'fields':{'project':{'key':_0xad9bb5[_0x472d('0x6')]||'MOTGUI'},'summary':(_0xad9bb5[_0x472d('0x7')]||_0x472d('0x8'))+_0x472d('0x9')+_0xad9bb5['ip'],'description':_0xad9bb5[_0x472d('0xa')]||JSON[_0x472d('0xb')](_0xad9bb5),'issuetype':{'name':_0xad9bb5[_0x472d('0xc')]||_0x472d('0xd')}}};_0x2c35bf[_0x472d('0xe')]['customfield_11500']=_0xad9bb5[_0x472d('0xf')];_0x2c35bf['fields'][_0x472d('0x10')]=_0xad9bb5[_0x472d('0x11')];_0x2c35bf['fields'][_0x472d('0x12')]=_0xad9bb5[_0x472d('0x13')];_0x2c35bf[_0x472d('0xe')][_0x472d('0x14')]=_0xad9bb5[_0x472d('0x15')];_0x2c35bf[_0x472d('0xe')][_0x472d('0x16')]=_0xad9bb5[_0x472d('0x17')];_0x2c35bf[_0x472d('0xe')][_0x472d('0x18')]=_0xad9bb5['ip'];var _0x2fb98f={'host':_0x472d('0x19'),'port':0x1bb,'path':_0x472d('0x1a'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x472d('0x1b'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x472d('0x1c'))}};var _0x5c8782=JSON['stringify'](_0x2c35bf);var _0x36c5e1=https[_0x472d('0x1d')](_0x2fb98f,function(_0x48a949){_0x48a949['setEncoding'](_0x472d('0x1e'));var _0x54f0c1='';_0x48a949['on'](_0x472d('0x1f'),function(_0x4c0dff){_0x54f0c1+=_0x4c0dff;});_0x48a949['on'](_0x472d('0x20'),function(){if(_0x5e8628){return _0x5e8628[_0x472d('0x21')](_0x48a949[_0x472d('0x22')])[_0x472d('0x23')](JSON[_0x472d('0x24')](_0x54f0c1));}});});_0x36c5e1['on'](_0x472d('0x25'),function(_0x587644){if(_0x5e8628){return _0x5e8628[_0x472d('0x21')](0x1f4)[_0x472d('0x23')]({'errors':[{'message':_0x472d('0x26'),'type':_0x472d('0x27')}]});}});_0x36c5e1['write'](_0x5c8782);_0x36c5e1['end']();}exports[_0x472d('0x28')]=openIssue;exports[_0x472d('0x29')]=function(_0x5271cf,_0x2496a5){_0x5271cf[_0x472d('0x2a')]['ip']=_0x5271cf['headers'][_0x472d('0x2b')]||_0x5271cf[_0x472d('0x2c')]['remoteAddress']||_0x5271cf[_0x472d('0x2d')][_0x472d('0x2e')]||_0x5271cf[_0x472d('0x2c')][_0x472d('0x2d')]['remoteAddress'];return openIssue(_0x5271cf[_0x472d('0x2a')],_0x2496a5);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f0d867e..a9625cd 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 _0x55e0=['./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f60a3,_0x32f1f8){var _0x5bb3c9=function(_0x2cdbb0){while(--_0x2cdbb0){_0x1f60a3['push'](_0x1f60a3['shift']());}};_0x5bb3c9(++_0x32f1f8);}(_0x55e0,0xdc));var _0x055e=function(_0x437746,_0x3ecf1f){_0x437746=_0x437746-0x0;var _0x5b0ffc=_0x55e0[_0x437746];return _0x5b0ffc;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0xd')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')](_0x055e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x055e('0x10')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0x11')]);module[_0x055e('0x12')]=router; \ No newline at end of file +var _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x12f152,_0x24c25e){var _0x3758f1=function(_0x1e37cb){while(--_0x1e37cb){_0x12f152['push'](_0x12f152['shift']());}};_0x3758f1(++_0x24c25e);}(_0xa74f,0x9a));var _0xfa74=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0xa74f[_0x52e0ee];return _0x32534c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index b11ea4a..99c0b10 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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x2eeb82,_0x5a28d6){_0x2eeb82=_0x2eeb82-0x0;var _0x309246=_0x7a54[_0x2eeb82];return _0x309246;};'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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x3b4896,_0xff2b33){_0x3b4896=_0x3b4896-0x0;var _0x5c714a=_0x7a54[_0x3b4896];return _0x5c714a;};'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 b2e6c97..c19b984 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 _0x3ca4=['describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','error','send','index','map','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','update','body'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3ca4,0x17d));var _0x43ca=function(_0x38d4a2,_0x24cdc1){_0x38d4a2=_0x38d4a2-0x0;var _0x51d655=_0x3ca4[_0x38d4a2];return _0x51d655;};'use strict';var emlformat=require(_0x43ca('0x0'));var rimraf=require(_0x43ca('0x1'));var zipdir=require(_0x43ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var Mustache=require(_0x43ca('0x5'));var util=require(_0x43ca('0x6'));var path=require(_0x43ca('0x7'));var sox=require(_0x43ca('0x8'));var csv=require(_0x43ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ca('0xa'));var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x9'));var querystring=require(_0x43ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x11'));var qs=require(_0x43ca('0x12'));var as=require(_0x43ca('0x13'));var hardwareService=require(_0x43ca('0x14'));var logger=require('../../config/logger')(_0x43ca('0x15'));var utils=require(_0x43ca('0x16'));var config=require(_0x43ca('0x17'));var licenseUtil=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];function respondWithStatusCode(_0x246ead,_0x30184f){_0x30184f=_0x30184f||0xcc;return function(_0x2ede07){if(_0x2ede07){return _0x246ead[_0x43ca('0x1a')](_0x30184f);}return _0x246ead['status'](_0x30184f)[_0x43ca('0x1b')]();};}function respondWithResult(_0x13cf26,_0x4b710d){_0x4b710d=_0x4b710d||0xc8;return function(_0x309176){if(_0x309176){return _0x13cf26['status'](_0x4b710d)[_0x43ca('0x1c')](_0x309176);}};}function respondWithFilteredResult(_0x567579,_0xdccc62){return function(_0x1a8bf6){if(_0x1a8bf6){var _0x51a517=typeof _0xdccc62[_0x43ca('0x1d')]===_0x43ca('0x1e')&&typeof _0xdccc62[_0x43ca('0x1f')]==='undefined';var _0x4fb5e4=_0x1a8bf6['count'];var _0x5e50c9=_0x51a517?0x0:_0xdccc62[_0x43ca('0x1d')];var _0x268817=_0x51a517?_0x1a8bf6[_0x43ca('0x20')]:_0xdccc62['offset']+_0xdccc62[_0x43ca('0x1f')];var _0x806f68;if(_0x268817>=_0x4fb5e4){_0x268817=_0x4fb5e4;_0x806f68=0xc8;}else{_0x806f68=0xce;}_0x567579[_0x43ca('0x21')](_0x806f68);return _0x567579['set'](_0x43ca('0x22'),_0x5e50c9+'-'+_0x268817+'/'+_0x4fb5e4)['json'](_0x1a8bf6);}return null;};}function patchUpdates(_0x106d07){return function(_0x9bc5dc){try{jsonpatch[_0x43ca('0x23')](_0x9bc5dc,_0x106d07,!![]);}catch(_0x5ae497){return BPromise[_0x43ca('0x24')](_0x5ae497);}return _0x9bc5dc[_0x43ca('0x25')]();};}function saveUpdates(_0x2af64f,_0x2ad8fa){return function(_0x35d34c){if(_0x35d34c){return _0x35d34c['update'](_0x2af64f)[_0x43ca('0x26')](function(_0x34767e){return _0x34767e;});}return null;};}function removeEntity(_0x557b96,_0x379902){return function(_0x22d6ac){if(_0x22d6ac){return _0x22d6ac[_0x43ca('0x27')]()[_0x43ca('0x26')](function(){_0x557b96[_0x43ca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da1ec,_0xc07cde){return function(_0x29f2ee){if(!_0x29f2ee){_0x2da1ec[_0x43ca('0x1a')](0x194);}return _0x29f2ee;};}function handleError(_0x14287e,_0x1de54b){_0x1de54b=_0x1de54b||0x1f4;return function(_0x3b2078){logger[_0x43ca('0x28')](_0x3b2078['stack']);if(_0x3b2078['name']){delete _0x3b2078['name'];}_0x14287e[_0x43ca('0x21')](_0x1de54b)[_0x43ca('0x29')](_0x3b2078);};}exports[_0x43ca('0x2a')]=function(_0x9d09b9,_0x34dc4f){var _0x36884b={},_0xffad2d={},_0x3f0b2b={'count':0x0,'rows':[]};var _0x5f37ff=_[_0x43ca('0x2b')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x12b2a2){return{'name':_0x12b2a2[_0x43ca('0x2c')],'type':_0x12b2a2[_0x43ca('0x2d')][_0x43ca('0x2e')]};});_0xffad2d[_0x43ca('0x2f')]=_['map'](_0x5f37ff,_0x43ca('0x30'));_0xffad2d['query']=_[_0x43ca('0x31')](_0x9d09b9['query']);_0xffad2d[_0x43ca('0x32')]=_[_0x43ca('0x33')](_0xffad2d['model'],_0xffad2d[_0x43ca('0x34')]);_0x36884b[_0x43ca('0x35')]=_[_0x43ca('0x33')](_0xffad2d[_0x43ca('0x2f')],qs[_0x43ca('0x36')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x36')]));_0x36884b['attributes']=_0x36884b[_0x43ca('0x35')]['length']?_0x36884b[_0x43ca('0x35')]:_0xffad2d[_0x43ca('0x2f')];if(!_0x9d09b9['query'][_0x43ca('0x37')]('nolimit')){_0x36884b['limit']=qs[_0x43ca('0x1f')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x1f')]);_0x36884b[_0x43ca('0x1d')]=qs[_0x43ca('0x1d')](_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x1d')]);}_0x36884b['order']=qs[_0x43ca('0x38')](_0x9d09b9[_0x43ca('0x34')]['sort']);_0x36884b[_0x43ca('0x39')]=qs[_0x43ca('0x32')](_['pick'](_0x9d09b9[_0x43ca('0x34')],_0xffad2d['filters']),_0x5f37ff);if(_0x9d09b9['query'][_0x43ca('0x3a')]){_0x36884b[_0x43ca('0x39')]=_[_0x43ca('0x3b')](_0x36884b[_0x43ca('0x39')],{'$or':_[_0x43ca('0x2b')](_0x5f37ff,function(_0x2205c4){if(_0x2205c4[_0x43ca('0x2d')]!==_0x43ca('0x3c')){var _0x35e316={};_0x35e316[_0x2205c4[_0x43ca('0x30')]]={'$like':'%'+_0x9d09b9[_0x43ca('0x34')][_0x43ca('0x3a')]+'%'};return _0x35e316;}})});}_0x36884b=_['merge']({},_0x36884b,_0x9d09b9['options']);var _0xb36699={'where':_0x36884b[_0x43ca('0x39')]};return db[_0x43ca('0x3d')]['count'](_0xb36699)[_0x43ca('0x26')](function(_0x57a2d4){_0x3f0b2b[_0x43ca('0x20')]=_0x57a2d4;if(_0x9d09b9['query'][_0x43ca('0x3e')]){_0x36884b[_0x43ca('0x3f')]=[{'all':!![]}];}return db[_0x43ca('0x3d')][_0x43ca('0x40')](_0x36884b);})[_0x43ca('0x26')](function(_0xc48edb){_0x3f0b2b['rows']=_0xc48edb;return _0x3f0b2b;})['then'](respondWithFilteredResult(_0x34dc4f,_0x36884b))[_0x43ca('0x41')](handleError(_0x34dc4f,null));};exports[_0x43ca('0x42')]=function(_0x1a3d8d,_0x331505){var _0x4343c0={'raw':!![],'where':{'id':_0x1a3d8d[_0x43ca('0x43')]['id']}},_0x35cb5e={};_0x35cb5e[_0x43ca('0x2f')]=_[_0x43ca('0x31')](db[_0x43ca('0x3d')][_0x43ca('0x44')]);_0x35cb5e[_0x43ca('0x34')]=_[_0x43ca('0x31')](_0x1a3d8d[_0x43ca('0x34')]);_0x35cb5e[_0x43ca('0x32')]=_[_0x43ca('0x33')](_0x35cb5e[_0x43ca('0x2f')],_0x35cb5e[_0x43ca('0x34')]);_0x4343c0[_0x43ca('0x35')]=_[_0x43ca('0x33')](_0x35cb5e[_0x43ca('0x2f')],qs['fields'](_0x1a3d8d[_0x43ca('0x34')][_0x43ca('0x36')]));_0x4343c0[_0x43ca('0x35')]=_0x4343c0['attributes'][_0x43ca('0x45')]?_0x4343c0[_0x43ca('0x35')]:_0x35cb5e[_0x43ca('0x2f')];if(_0x1a3d8d[_0x43ca('0x34')][_0x43ca('0x3e')]){_0x4343c0[_0x43ca('0x3f')]=[{'all':!![]}];}_0x4343c0=_[_0x43ca('0x3b')]({},_0x4343c0,_0x1a3d8d[_0x43ca('0x46')]);return db[_0x43ca('0x3d')][_0x43ca('0x47')](_0x4343c0)[_0x43ca('0x26')](handleEntityNotFound(_0x331505,null))['then'](respondWithResult(_0x331505,null))[_0x43ca('0x41')](handleError(_0x331505,null));};exports[_0x43ca('0x48')]=function(_0x31bbaf,_0x4b4c54){return db['JscriptyAnswerReport'][_0x43ca('0x48')](_0x31bbaf['body'],{})[_0x43ca('0x26')](respondWithResult(_0x4b4c54,0xc9))['catch'](handleError(_0x4b4c54,null));};exports[_0x43ca('0x49')]=function(_0x25e0fd,_0x45cafd){if(_0x25e0fd['body']['id']){delete _0x25e0fd[_0x43ca('0x4a')]['id'];}return db[_0x43ca('0x3d')]['find']({'where':{'id':_0x25e0fd[_0x43ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x45cafd,null))['then'](saveUpdates(_0x25e0fd[_0x43ca('0x4a')],null))[_0x43ca('0x26')](respondWithResult(_0x45cafd,null))[_0x43ca('0x41')](handleError(_0x45cafd,null));};exports[_0x43ca('0x27')]=function(_0x10c183,_0x435daa){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x10c183[_0x43ca('0x43')]['id']}})[_0x43ca('0x26')](handleEntityNotFound(_0x435daa,null))['then'](removeEntity(_0x435daa,null))['catch'](handleError(_0x435daa,null));};exports[_0x43ca('0x4b')]=function(_0x55107c,_0x218604){return db[_0x43ca('0x3d')][_0x43ca('0x4b')]()['then'](respondWithResult(_0x218604,null))[_0x43ca('0x41')](handleError(_0x218604,null));}; \ No newline at end of file +var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','JscriptyAnswerReport','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x1c36a8,_0x49c835){var _0xb622c5=function(_0x24f4f3){while(--_0x24f4f3){_0x1c36a8['push'](_0x1c36a8['shift']());}};_0xb622c5(++_0x49c835);}(_0xafdd,0x19a));var _0xdafd=function(_0x389e70,_0x290b25){_0x389e70=_0x389e70-0x0;var _0x59dd73=_0xafdd[_0x389e70];return _0x59dd73;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2ccbbcd..39fe96f 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 _0x771a=['path','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','util','../../config/logger','api','bluebird'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x771a,0x18c));var _0xa771=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x771a[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0xa771('0x0'));var logger=require(_0xa771('0x1'))(_0xa771('0x2'));var moment=require('moment');var BPromise=require(_0xa771('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa771('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa771('0x5'));module['exports']=function(_0x567534,_0x572106){return _0x567534[_0xa771('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0xa771('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a28=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x37f40e,_0x5c5a1d){var _0x1bab3f=function(_0x3a5eb9){while(--_0x3a5eb9){_0x37f40e['push'](_0x37f40e['shift']());}};_0x1bab3f(++_0x5c5a1d);}(_0x7a28,0x144));var _0x87a2=function(_0x26e912,_0x131e81){_0x26e912=_0x26e912-0x0;var _0x1aa289=_0x7a28[_0x26e912];return _0x1aa289;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x87a2('0x0'));var moment=require(_0x87a2('0x1'));var BPromise=require('bluebird');var rp=require(_0x87a2('0x2'));var fs=require('fs');var path=require(_0x87a2('0x3'));var rimraf=require(_0x87a2('0x4'));var config=require(_0x87a2('0x5'));var attributes=require(_0x87a2('0x6'));module[_0x87a2('0x7')]=function(_0x948d25,_0x1733b2){return _0x948d25['define'](_0x87a2('0x8'),attributes,{'tableName':_0x87a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 0fcf51a..93e8001 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 _0x0e82=['debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5967c0,_0x452377){var _0x2ad249=function(_0x7eb26){while(--_0x7eb26){_0x5967c0['push'](_0x5967c0['shift']());}};_0x2ad249(++_0x452377);}(_0x0e82,0x118));var _0x20e8=function(_0x3f7da9,_0x19bded){_0x3f7da9=_0x3f7da9-0x0;var _0x619aee=_0x0e82[_0x3f7da9];return _0x619aee;};'use strict';var _=require('lodash');var util=require(_0x20e8('0x0'));var moment=require(_0x20e8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20e8('0x2'));var db=require(_0x20e8('0x3'))['db'];var utils=require(_0x20e8('0x4'));var logger=require(_0x20e8('0x5'))(_0x20e8('0x6'));var config=require(_0x20e8('0x7'));var jayson=require(_0x20e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed6c6,_0x2cfcc7,_0xad50bd){return new BPromise(function(_0x48c010,_0x45cbbc){return client[_0x20e8('0x9')](_0x4ed6c6,_0xad50bd)[_0x20e8('0xa')](function(_0x215099){logger[_0x20e8('0xb')](_0x20e8('0xc'),_0x2cfcc7,_0x20e8('0xd'));logger[_0x20e8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2cfcc7,_0x20e8('0xd'),JSON[_0x20e8('0xf')](_0x215099));if(_0x215099[_0x20e8('0x10')]){if(_0x215099[_0x20e8('0x10')][_0x20e8('0x11')]===0x1f4){logger[_0x20e8('0x10')](_0x20e8('0xc'),_0x2cfcc7,_0x215099[_0x20e8('0x10')][_0x20e8('0x12')]);return _0x45cbbc(_0x215099['error'][_0x20e8('0x12')]);}logger[_0x20e8('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2cfcc7,_0x215099[_0x20e8('0x10')][_0x20e8('0x12')]);return _0x48c010(_0x215099[_0x20e8('0x10')]['message']);}else{logger[_0x20e8('0xb')](_0x20e8('0xc'),_0x2cfcc7,_0x20e8('0xd'));_0x48c010(_0x215099[_0x20e8('0x13')]['message']);}})[_0x20e8('0x14')](function(_0x323b83){logger[_0x20e8('0x10')](_0x20e8('0xc'),_0x2cfcc7,_0x323b83);_0x45cbbc(_0x323b83);});});} \ No newline at end of file +var _0xdcd9=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x229cfd,_0x3d7b4c){var _0x5621a3=function(_0x3d5e61){while(--_0x3d5e61){_0x229cfd['push'](_0x229cfd['shift']());}};_0x5621a3(++_0x3d7b4c);}(_0xdcd9,0x1ec));var _0x9dcd=function(_0x88ec31,_0x4516ad){_0x88ec31=_0x88ec31-0x0;var _0x114384=_0xdcd9[_0x88ec31];return _0x114384;};'use strict';var _=require(_0x9dcd('0x0'));var util=require('util');var moment=require(_0x9dcd('0x1'));var BPromise=require(_0x9dcd('0x2'));var rs=require(_0x9dcd('0x3'));var fs=require('fs');var Redis=require(_0x9dcd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dcd('0x5'));var logger=require(_0x9dcd('0x6'))(_0x9dcd('0x7'));var config=require(_0x9dcd('0x8'));var jayson=require(_0x9dcd('0x9'));var client=jayson[_0x9dcd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30b12c,_0x55af99,_0x1dcdcf){return new BPromise(function(_0x59656c,_0x3b91da){return client[_0x9dcd('0xb')](_0x30b12c,_0x1dcdcf)[_0x9dcd('0xc')](function(_0x2bf720){logger[_0x9dcd('0xd')](_0x9dcd('0xe'),_0x55af99,_0x9dcd('0xf'));logger[_0x9dcd('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x55af99,'request\x20sent',JSON[_0x9dcd('0x11')](_0x2bf720));if(_0x2bf720[_0x9dcd('0x12')]){if(_0x2bf720['error'][_0x9dcd('0x13')]===0x1f4){logger[_0x9dcd('0x12')](_0x9dcd('0xe'),_0x55af99,_0x2bf720[_0x9dcd('0x12')]['message']);return _0x3b91da(_0x2bf720['error']['message']);}logger[_0x9dcd('0x12')](_0x9dcd('0xe'),_0x55af99,_0x2bf720[_0x9dcd('0x12')][_0x9dcd('0x14')]);return _0x59656c(_0x2bf720[_0x9dcd('0x12')]['message']);}else{logger['info'](_0x9dcd('0xe'),_0x55af99,_0x9dcd('0xf'));_0x59656c(_0x2bf720[_0x9dcd('0x15')][_0x9dcd('0x14')]);}})[_0x9dcd('0x16')](function(_0x3f5712){logger['error'](_0x9dcd('0xe'),_0x55af99,_0x3f5712);_0x3b91da(_0x3f5712);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 5bac381..1585fe1 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 _0xe045=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','put','update','/:id','exports','multer','Router','../../components/interaction/service'];(function(_0x551919,_0x143aa4){var _0x1b0e78=function(_0x18441e){while(--_0x18441e){_0x551919['push'](_0x551919['shift']());}};_0x1b0e78(++_0x143aa4);}(_0xe045,0x1f1));var _0x5e04=function(_0x726deb,_0x527c07){_0x726deb=_0x726deb-0x0;var _0x481564=_0xe045[_0x726deb];return _0x481564;};'use strict';var multer=require(_0x5e04('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e04('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5e04('0x2'));var config=require(_0x5e04('0x3'));var controller=require(_0x5e04('0x4'));router[_0x5e04('0x5')]('/',auth[_0x5e04('0x6')](),controller[_0x5e04('0x7')]);router['get']('/:id',auth[_0x5e04('0x6')](),controller[_0x5e04('0x8')]);router['get']('/:id/sessions',auth[_0x5e04('0x6')](),controller[_0x5e04('0x9')]);router[_0x5e04('0x5')]('/:id/answers',auth[_0x5e04('0x6')](),controller[_0x5e04('0xa')]);router[_0x5e04('0x5')](_0x5e04('0xb'),auth[_0x5e04('0x6')](),timeout(_0x5e04('0xc')),controller[_0x5e04('0xd')]);router[_0x5e04('0xe')]('/',auth[_0x5e04('0x6')](),controller[_0x5e04('0xf')]);router[_0x5e04('0xe')]('/:id/clone',auth[_0x5e04('0x6')](),controller['clone']);router[_0x5e04('0x10')]('/:id',auth[_0x5e04('0x6')](),controller[_0x5e04('0x11')]);router['delete'](_0x5e04('0x12'),auth[_0x5e04('0x6')](),controller['destroy']);module[_0x5e04('0x13')]=router; \ No newline at end of file +var _0x9ec5=['getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','get','getSessions','/:id/answers'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x9ec5,0x94));var _0x59ec=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x9ec5[_0x484c03];return _0x294127;};'use strict';var multer=require(_0x59ec('0x0'));var util=require(_0x59ec('0x1'));var path=require(_0x59ec('0x2'));var timeout=require(_0x59ec('0x3'));var express=require(_0x59ec('0x4'));var router=express[_0x59ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x59ec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x59ec('0x7'));var controller=require('./jscriptyProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x59ec('0x8')]);router['get'](_0x59ec('0x9'),auth[_0x59ec('0xa')](),controller['show']);router[_0x59ec('0xb')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x59ec('0xc')]);router['get'](_0x59ec('0xd'),auth[_0x59ec('0xa')](),controller[_0x59ec('0xe')]);router[_0x59ec('0xb')](_0x59ec('0xf'),auth[_0x59ec('0xa')](),timeout(_0x59ec('0x10')),controller[_0x59ec('0x11')]);router['post']('/',auth[_0x59ec('0xa')](),controller[_0x59ec('0x12')]);router[_0x59ec('0x13')](_0x59ec('0x14'),auth[_0x59ec('0xa')](),controller[_0x59ec('0x15')]);router[_0x59ec('0x16')](_0x59ec('0x9'),auth[_0x59ec('0xa')](),controller[_0x59ec('0x17')]);router[_0x59ec('0x18')](_0x59ec('0x9'),auth['isAuthenticated'](),controller[_0x59ec('0x19')]);module[_0x59ec('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a6e9c2c..a1e1691 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 _0x1106=['BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x1b4109,_0x2b9903){var _0x356138=function(_0x4b8865){while(--_0x4b8865){_0x1b4109['push'](_0x1b4109['shift']());}};_0x356138(++_0x2b9903);}(_0x1106,0x1d2));var _0x6110=function(_0x264edb,_0x4ecbaa){_0x264edb=_0x264edb-0x0;var _0x54aeac=_0x1106[_0x264edb];return _0x54aeac;};'use strict';var Sequelize=require(_0x6110('0x0'));var _=require(_0x6110('0x1'));var util=require(_0x6110('0x2'));module['exports']={'name':{'type':Sequelize[_0x6110('0x3')],'unique':_0x6110('0x4')},'description':{'type':Sequelize[_0x6110('0x3')]},'formData':{'type':Sequelize[_0x6110('0x5')]('long'),'set':function(_0x4e42c3){if(_[_0x6110('0x6')](_0x4e42c3)){this[_0x6110('0x7')]('formData',JSON[_0x6110('0x8')](_0x4e42c3));}else if(_[_0x6110('0x9')](_0x4e42c3)){this[_0x6110('0x7')](_0x6110('0xa'),_0x4e42c3);}else{this['setDataValue']('formData',util['format'](_0x6110('0xb'),this[_0x6110('0xc')]('name')||'',this['getDataValue'](_0x6110('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6110('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6110('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xe860=['STRING','name','TEXT','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xe860,0x123));var _0x0e86=function(_0x21ff0f,_0x3aae38){_0x21ff0f=_0x21ff0f-0x0;var _0x2daded=_0xe860[_0x21ff0f];return _0x2daded;};'use strict';var Sequelize=require(_0x0e86('0x0'));var _=require('lodash');var util=require(_0x0e86('0x1'));module[_0x0e86('0x2')]={'name':{'type':Sequelize[_0x0e86('0x3')],'unique':_0x0e86('0x4')},'description':{'type':Sequelize[_0x0e86('0x3')]},'formData':{'type':Sequelize[_0x0e86('0x5')]('long'),'set':function(_0x464dba){if(_['isObjectLike'](_0x464dba)){this['setDataValue'](_0x0e86('0x6'),JSON['stringify'](_0x464dba));}else if(_[_0x0e86('0x7')](_0x464dba)){this[_0x0e86('0x8')](_0x0e86('0x6'),_0x464dba);}else{this['setDataValue'](_0x0e86('0x6'),util[_0x0e86('0x9')](_0x0e86('0xa'),this[_0x0e86('0xb')](_0x0e86('0x4'))||'',this[_0x0e86('0xb')](_0x0e86('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0e86('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0e86('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 99bb630..a16dec3 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 _0x094c=['attributes','length','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getSessions','findOne','JscriptySessionReport','sort','pick','filter','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields'];(function(_0x2f8f92,_0x2f0114){var _0x3f900b=function(_0x5af6d2){while(--_0x5af6d2){_0x2f8f92['push'](_0x2f8f92['shift']());}};_0x3f900b(++_0x2f0114);}(_0x094c,0x131));var _0xc094=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x094c[_0xb24fad];return _0x173226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){var _0x59f5a6=_0x364ede['get']({'plain':!![]});var _0xa85298='Projects';return db[_0xc094('0x25')][_0xc094('0x26')]({'where':{'type':_0xa85298,'resourceId':_0x59f5a6['id']}})[_0xc094('0x24')](function(){return _0x364ede;});})[_0xc094('0x24')](function(){_0x249a32[_0xc094('0x19')](0xcc)[_0xc094('0x27')]();});}};}function handleEntityNotFound(_0x1f9675,_0xaa6ff0){return function(_0x1000e6){if(!_0x1000e6){_0x1f9675[_0xc094('0x18')](0x194);}return _0x1000e6;};}function handleError(_0x5a92d8,_0x203f94){_0x203f94=_0x203f94||0x1f4;return function(_0x1936f3){logger['error'](_0x1936f3[_0xc094('0x28')]);if(_0x1936f3[_0xc094('0x29')]){delete _0x1936f3[_0xc094('0x29')];}_0x5a92d8[_0xc094('0x19')](_0x203f94)[_0xc094('0x2a')](_0x1936f3);};}exports[_0xc094('0x2b')]=function(_0x23790f,_0x27614c){var _0x5090e3={},_0xb267a4={},_0x56ef51={'count':0x0,'rows':[]};var _0x5bf460=_[_0xc094('0x2c')](db[_0xc094('0x2d')][_0xc094('0x2e')],function(_0x421b78){return{'name':_0x421b78[_0xc094('0x2f')],'type':_0x421b78[_0xc094('0x30')][_0xc094('0x31')]};});_0xb267a4['model']=_['map'](_0x5bf460,_0xc094('0x29'));_0xb267a4[_0xc094('0x32')]=_['keys'](_0x23790f['query']);_0xb267a4[_0xc094('0x33')]=_[_0xc094('0x34')](_0xb267a4['model'],_0xb267a4[_0xc094('0x32')]);_0x5090e3['attributes']=_[_0xc094('0x34')](_0xb267a4[_0xc094('0x35')],qs[_0xc094('0x36')](_0x23790f[_0xc094('0x32')][_0xc094('0x36')]));_0x5090e3['attributes']=_0x5090e3[_0xc094('0x37')][_0xc094('0x38')]?_0x5090e3['attributes']:_0xb267a4[_0xc094('0x35')];if(!_0x23790f[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x5090e3[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x23790f[_0xc094('0x32')]['limit']);_0x5090e3['offset']=qs[_0xc094('0x1b')](_0x23790f[_0xc094('0x32')][_0xc094('0x1b')]);}_0x5090e3[_0xc094('0x3b')]=qs['sort'](_0x23790f[_0xc094('0x32')]['sort']);_0x5090e3['where']=qs['filters'](_['pick'](_0x23790f[_0xc094('0x32')],_0xb267a4[_0xc094('0x33')]),_0x5bf460);if(_0x23790f['query']['filter']){_0x5090e3[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x5090e3[_0xc094('0x3c')],{'$or':_['map'](_0x5bf460,function(_0x484e63){if(_0x484e63[_0xc094('0x30')]!=='VIRTUAL'){var _0x2337c3={};_0x2337c3[_0x484e63[_0xc094('0x29')]]={'$like':'%'+_0x23790f[_0xc094('0x32')]['filter']+'%'};return _0x2337c3;}})});}_0x5090e3=_[_0xc094('0x3d')]({},_0x5090e3,_0x23790f[_0xc094('0x3e')]);var _0x299494={'where':_0x5090e3[_0xc094('0x3c')]};return db['JscriptyProject'][_0xc094('0x1e')](_0x299494)[_0xc094('0x24')](function(_0x109a09){_0x56ef51[_0xc094('0x1e')]=_0x109a09;if(_0x23790f[_0xc094('0x32')][_0xc094('0x3f')]){_0x5090e3[_0xc094('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0xc094('0x41')](_0x5090e3);})['then'](function(_0x5082df){_0x56ef51[_0xc094('0x42')]=_0x5082df;return _0x56ef51;})['then'](respondWithFilteredResult(_0x27614c,_0x5090e3))[_0xc094('0x43')](handleError(_0x27614c,null));};exports[_0xc094('0x44')]=function(_0x43600e,_0x1c97e6){var _0x388e76={'raw':![],'where':{'id':_0x43600e['params']['id']}},_0x1bf5f1={};_0x1bf5f1[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x1bf5f1['query']=_['keys'](_0x43600e[_0xc094('0x32')]);_0x1bf5f1[_0xc094('0x33')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],_0x1bf5f1['query']);_0x388e76[_0xc094('0x37')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],qs[_0xc094('0x36')](_0x43600e['query'][_0xc094('0x36')]));_0x388e76[_0xc094('0x37')]=_0x388e76[_0xc094('0x37')][_0xc094('0x38')]?_0x388e76[_0xc094('0x37')]:_0x1bf5f1[_0xc094('0x35')];if(_0x43600e['query']['includeAll']){_0x388e76[_0xc094('0x40')]=[{'all':!![]}];}_0x388e76=_['merge']({},_0x388e76,_0x43600e[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x388e76)['then'](handleEntityNotFound(_0x1c97e6,null))[_0xc094('0x24')](respondWithResult(_0x1c97e6,null))['catch'](handleError(_0x1c97e6,null));};exports[_0xc094('0x47')]=function(_0x56dc51,_0x46aa3b){return db[_0xc094('0x2d')][_0xc094('0x47')](_0x56dc51[_0xc094('0x48')],{})['then'](function(_0x43cab6){var _0x5f1f2a=_0x56dc51[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x5f1f2a)throw new Error(_0xc094('0x4b'));if(_0x5f1f2a[_0xc094('0x4c')]===_0xc094('0x49')){var _0xb7ba29=_0x43cab6[_0xc094('0x4a')]({'plain':!![]});var _0xac85c5=_0xc094('0x4d');return db[_0xc094('0x4e')]['find']({'where':{'name':_0xac85c5,'userProfileId':_0x5f1f2a[_0xc094('0x4f')]},'raw':!![]})['then'](function(_0x2ba0a9){if(_0x2ba0a9&&_0x2ba0a9[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')]['create']({'name':_0xb7ba29[_0xc094('0x29')],'resourceId':_0xb7ba29['id'],'type':_0x2ba0a9[_0xc094('0x29')],'sectionId':_0x2ba0a9['id']},{})[_0xc094('0x24')](function(){return _0x43cab6;});}else{return _0x43cab6;}})[_0xc094('0x43')](function(_0x5b38ef){logger[_0xc094('0x51')](_0xc094('0x52'),_0x5b38ef);throw _0x5b38ef;});}return _0x43cab6;})['then'](respondWithResult(_0x46aa3b,0xc9))[_0xc094('0x43')](handleError(_0x46aa3b,null));};exports[_0xc094('0x53')]=function(_0x5ac606,_0x1a2db9){var _0x54fc6b={'where':{'id':_0x5ac606[_0xc094('0x54')]['id']}},_0x5e7a51={};_0x5e7a51[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x54fc6b[_0xc094('0x37')]=_[_0xc094('0x34')](_0x5e7a51[_0xc094('0x35')],qs[_0xc094('0x36')](_0x5ac606[_0xc094('0x32')][_0xc094('0x36')]));_0x54fc6b[_0xc094('0x37')]=_0x54fc6b[_0xc094('0x37')][_0xc094('0x38')]?_0x54fc6b['attributes']:_0x5e7a51[_0xc094('0x35')];if(_0x5ac606[_0xc094('0x32')][_0xc094('0x3f')]){_0x54fc6b['include']=[{'all':!![]}];}_0x54fc6b=_[_0xc094('0x3d')]({},_0x54fc6b,_0x5ac606[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x54fc6b)[_0xc094('0x24')](handleEntityNotFound(_0x1a2db9,null))[_0xc094('0x24')](function(_0x5f2bba){if(_0x5f2bba){var _0x1a0b90=_0x5f2bba['get']({'plain':!![]});_0x1a0b90=qs[_0xc094('0x55')](_0x1a0b90,['id',_0xc094('0x56'),_0xc094('0x57')]);_0x5ac606[_0xc094('0x48')]=_[_0xc094('0x55')](_0x5ac606[_0xc094('0x48')],['id',_0xc094('0x56'),_0xc094('0x57')]);return db[_0xc094('0x2d')][_0xc094('0x47')](_[_0xc094('0x3d')](_0x1a0b90,_0x5ac606[_0xc094('0x48')]),{'include':_0x5ac606['query'][_0xc094('0x3f')]?[{'all':!![]}]:undefined})[_0xc094('0x24')](function(_0xc9d8){var _0x465b28=_0x5ac606[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x465b28)throw new Error(_0xc094('0x4b'));if(_0x465b28[_0xc094('0x4c')]===_0xc094('0x49')){var _0x419006=_0xc9d8[_0xc094('0x4a')]({'plain':!![]});var _0x22d1f3=_0xc094('0x4d');return db[_0xc094('0x4e')][_0xc094('0x46')]({'where':{'name':_0x22d1f3,'userProfileId':_0x465b28[_0xc094('0x4f')]},'raw':!![]})[_0xc094('0x24')](function(_0x401f4b){if(_0x401f4b&&_0x401f4b[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')][_0xc094('0x47')]({'name':_0x419006[_0xc094('0x29')],'resourceId':_0x419006['id'],'type':_0x401f4b[_0xc094('0x29')],'sectionId':_0x401f4b['id']},{})[_0xc094('0x24')](function(){return _0xc9d8;});}else{return _0xc9d8;}})['catch'](function(_0x11c69d){logger[_0xc094('0x51')](_0xc094('0x52'),_0x11c69d);throw _0x11c69d;});}return _0xc9d8;});}})[_0xc094('0x24')](respondWithResult(_0x1a2db9,0xc9))[_0xc094('0x43')](handleError(_0x1a2db9,null));};exports[_0xc094('0x58')]=function(_0x2aae68,_0xbc704c){if(_0x2aae68[_0xc094('0x48')]['id']){delete _0x2aae68['body']['id'];}return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x2aae68[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0xbc704c,null))[_0xc094('0x24')](saveUpdates(_0x2aae68[_0xc094('0x48')],null))['then'](respondWithResult(_0xbc704c,null))[_0xc094('0x43')](handleError(_0xbc704c,null));};exports['destroy']=function(_0x3fbd46,_0x6df9b3){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3fbd46[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x6df9b3,null))[_0xc094('0x24')](removeEntity(_0x6df9b3,null))[_0xc094('0x43')](handleError(_0x6df9b3,null));};exports[_0xc094('0x59')]=function(_0x2168ab,_0x443857,_0x42f14e){var _0x3b81d2={'raw':!![],'where':{}};var _0x5b56dd={};var _0x519713={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x2168ab['params']['id']}})['then'](handleEntityNotFound(_0x443857,null))[_0xc094('0x24')](function(_0x1575d0){if(_0x1575d0){_0x5b56dd[_0xc094('0x35')]=_['keys'](db[_0xc094('0x5b')][_0xc094('0x2e')]);_0x5b56dd[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2168ab['query']);_0x5b56dd['filters']=_[_0xc094('0x34')](_0x5b56dd['model'],_0x5b56dd[_0xc094('0x32')]);_0x3b81d2['attributes']=_[_0xc094('0x34')](_0x5b56dd['model'],qs[_0xc094('0x36')](_0x2168ab[_0xc094('0x32')][_0xc094('0x36')]));_0x3b81d2[_0xc094('0x37')]=_0x3b81d2[_0xc094('0x37')][_0xc094('0x38')]?_0x3b81d2['attributes']:_0x5b56dd[_0xc094('0x35')];if(!_0x2168ab[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0x3b81d2[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2168ab['query'][_0xc094('0x1d')]);_0x3b81d2[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2168ab['query']['offset']);}_0x3b81d2['order']=qs[_0xc094('0x5c')](_0x2168ab['query'][_0xc094('0x5c')]);_0x3b81d2['where']=qs['filters'](_[_0xc094('0x5d')](_0x2168ab[_0xc094('0x32')],_0x5b56dd[_0xc094('0x33')]));_0x3b81d2['where']['ProjectId']=_0x1575d0['id'];if(_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]){_0x3b81d2[_0xc094('0x3c')]=_['merge'](_0x3b81d2[_0xc094('0x3c')],{'$or':_['map'](_0x3b81d2[_0xc094('0x37')],function(_0x5abe4a){var _0x20f456={};_0x20f456[_0x5abe4a]={'$like':'%'+_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x20f456;})});}_0x3b81d2=_[_0xc094('0x3d')]({},_0x3b81d2,_0x2168ab['options']);return db[_0xc094('0x5b')][_0xc094('0x1e')]({'where':_0x3b81d2['where']})[_0xc094('0x24')](function(_0x53b4c0){_0x519713['count']=_0x53b4c0;if(_0x2168ab[_0xc094('0x32')][_0xc094('0x3f')]){_0x3b81d2[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x5b')]['findAll'](_0x3b81d2);})['then'](function(_0x6db787){_0x519713['rows']=_0x6db787;return _0x519713;});}})['then'](respondWithFilteredResult(_0x443857,_0x3b81d2))[_0xc094('0x43')](handleError(_0x443857,null));};exports[_0xc094('0x5f')]=function(_0x20d0a6,_0x93ed7e,_0x19a5a0){var _0xd61d85={'raw':!![],'where':{}};var _0x272d5f={};var _0x2905cf={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x20d0a6[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x93ed7e,null))[_0xc094('0x24')](function(_0x11db0f){if(_0x11db0f){_0x272d5f[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x60')]['rawAttributes']);_0x272d5f['query']=_['keys'](_0x20d0a6[_0xc094('0x32')]);_0x272d5f[_0xc094('0x33')]=_[_0xc094('0x34')](_0x272d5f[_0xc094('0x35')],_0x272d5f[_0xc094('0x32')]);_0xd61d85[_0xc094('0x37')]=_['intersection'](_0x272d5f[_0xc094('0x35')],qs[_0xc094('0x36')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x36')]));_0xd61d85[_0xc094('0x37')]=_0xd61d85[_0xc094('0x37')][_0xc094('0x38')]?_0xd61d85[_0xc094('0x37')]:_0x272d5f['model'];if(!_0x20d0a6[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0xd61d85[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x1d')]);_0xd61d85[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x20d0a6['query'][_0xc094('0x1b')]);}_0xd61d85[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x5c')]);_0xd61d85[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x20d0a6['query'],_0x272d5f[_0xc094('0x33')]));_0xd61d85[_0xc094('0x3c')]['ProjectId']=_0x11db0f['id'];if(_0x20d0a6['query']['filter']){_0xd61d85[_0xc094('0x3c')]=_['merge'](_0xd61d85[_0xc094('0x3c')],{'$or':_['map'](_0xd61d85[_0xc094('0x37')],function(_0x19a16a){var _0x53e9b5={};_0x53e9b5[_0x19a16a]={'$like':'%'+_0x20d0a6[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x53e9b5;})});}_0xd61d85=_[_0xc094('0x3d')]({},_0xd61d85,_0x20d0a6['options']);return db[_0xc094('0x60')][_0xc094('0x1e')]({'where':_0xd61d85[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x550f2e){_0x2905cf[_0xc094('0x1e')]=_0x550f2e;if(_0x20d0a6['query'][_0xc094('0x3f')]){_0xd61d85[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x60')]['findAll'](_0xd61d85);})['then'](function(_0x1b5c26){_0x2905cf[_0xc094('0x42')]=_0x1b5c26;return _0x2905cf;});}})[_0xc094('0x24')](respondWithFilteredResult(_0x93ed7e,_0xd61d85))['catch'](handleError(_0x93ed7e,null));};function char(_0x56626c){return _0xc094('0x61')===typeof _0x56626c?String[_0xc094('0x62')][_0xc094('0x21')](null,arguments):_0x56626c;}function needsEncapsulation(_0x2fd2a9){return!!_0x2fd2a9&&(_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xd))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xa))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x2c))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x22))>=0x0);}function encapsulate(_0xffec0a){var _0x105e4d=char(0x22),_0x2aa2f1='\x5c'+char(0x22),_0x4d8b71=_0xffec0a[_0xc094('0x63')]()['replace'](new RegExp(_0x105e4d,'g'),_0x2aa2f1);return _0x105e4d+_0x4d8b71+_0x105e4d;}exports[_0xc094('0x65')]=function(_0x45b875,_0x1b9316,_0x955189){var _0x1366cf,_0x23f273;var _0x565ba7={'where':{'ProjectId':_0x45b875[_0xc094('0x54')]['id']}};if(_0x45b875[_0xc094('0x32')]['startTime']){_0x565ba7['where'][_0xc094('0x66')]=JSON[_0xc094('0x67')](_0x45b875['query']['startTime']);}return db[_0xc094('0x5b')][_0xc094('0x41')](_0x565ba7)[_0xc094('0x24')](handleEntityNotFound(_0x1b9316,null))[_0xc094('0x24')](function(_0x5a27e1){if(_0x5a27e1){_0x1366cf=_0x5a27e1;return db[_0xc094('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xc094('0x2c')](_0x1366cf,'id')},'ProjectId':_0x45b875[_0xc094('0x54')]['id']},'order':_0xc094('0x69')});}})['then'](handleEntityNotFound(_0x1b9316,null))['then'](function(_0x387cb0){if(_0x387cb0){_0x23f273=_0x387cb0;var _0x53109f={};for(var _0x245e38=0x0,_0x5624f3=_0x23f273[_0xc094('0x38')];_0x245e38<_0x5624f3;_0x245e38++){if(!_0x53109f[_0xc094('0x39')](_0x23f273[_0x245e38][_0xc094('0x6a')])){_0x53109f[_0x23f273[_0x245e38][_0xc094('0x6a')]]=needsEncapsulation(_0x23f273[_0x245e38][_0xc094('0x6b')])?encapsulate(_0x23f273[_0x245e38][_0xc094('0x6b')]):_0x23f273[_0x245e38][_0xc094('0x6b')];}}var _0x32bc4b=[],_0x51eda7={};for(var _0x26885b=0x0,_0x350538=_0x1366cf[_0xc094('0x38')];_0x26885b<_0x350538;_0x26885b++){_0x51eda7={'ProjectId':_0x45b875[_0xc094('0x54')]['id'],'SessionId':_0x1366cf[_0x26885b]['id'],'StartTime':moment(_0x1366cf[_0x26885b][_0xc094('0x66')])['format'](_0xc094('0x6c'))};for(var _0x34ca8a=0x0,_0x27492b=_0x23f273[_0xc094('0x38')];_0x34ca8a<_0x27492b;_0x34ca8a++){if(_0x23f273[_0x34ca8a][_0xc094('0x6d')]==_0x1366cf[_0x26885b]['id']&&_0x53109f[_0xc094('0x39')](_0x23f273[_0x34ca8a][_0xc094('0x6a')])){_0x51eda7[_0x53109f[_0x23f273[_0x34ca8a][_0xc094('0x6a')]]]=_0x23f273[_0x34ca8a][_0xc094('0x6e')];}}for(var _0xf24a1e in _0x53109f){if(!_0x51eda7[_0xc094('0x39')](_0x53109f[_0xf24a1e])){_0x51eda7[_0x53109f[_0xf24a1e]]=null;}}_0x32bc4b['push'](_0x51eda7);}return _0x32bc4b;}})[_0xc094('0x24')](function(_0x321652){if(!_[_0xc094('0x6f')](_0x321652)){var _0x14b39b=toCsv(_0x321652);var _0x24f12d=Date[_0xc094('0x70')]();fs['writeFileSync'](util['format'](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d),_0x14b39b);_0x1b9316[_0xc094('0x72')](_0xc094('0x73'),'attachment;\x20filename='+util[_0xc094('0x74')](_0xc094('0x75'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));_0x1b9316[_0xc094('0x72')](_0xc094('0x76'),'text/csv');return _0x1b9316[_0xc094('0x77')](util[_0xc094('0x74')](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));}else{return _0x1b9316[_0xc094('0x18')](0xcc);}})[_0xc094('0x43')](handleError(_0x1b9316,null));}; \ No newline at end of file +var _0x7939=['sort','pick','filter','merge','where','options','count','findAll','show','params','includeAll','include','find','create','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','catch','update','getSessions','findOne','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','offset','set','apply','save','then','destroy','get','Projects','UserProfileResource','error','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x5a6288,_0xa4b3d2){var _0x5a4d67=function(_0xe9bed){while(--_0xe9bed){_0x5a6288['push'](_0x5a6288['shift']());}};_0x5a4d67(++_0xa4b3d2);}(_0x7939,0x11c));var _0x9793=function(_0x126494,_0x175a47){_0x126494=_0x126494-0x0;var _0x3d8450=_0x7939[_0x126494];return _0x3d8450;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9793('0x0'));var zipdir=require(_0x9793('0x1'));var jsonpatch=require(_0x9793('0x2'));var rp=require(_0x9793('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9793('0x4'));var path=require(_0x9793('0x5'));var sox=require(_0x9793('0x6'));var csv=require(_0x9793('0x7'));var ejs=require(_0x9793('0x8'));var fs=require('fs');var fs_extra=require(_0x9793('0x9'));var _=require(_0x9793('0xa'));var squel=require('squel');var crypto=require(_0x9793('0xb'));var jsforce=require(_0x9793('0xc'));var deskjs=require(_0x9793('0xd'));var toCsv=require(_0x9793('0x7'));var querystring=require('querystring');var Papa=require(_0x9793('0xe'));var Redis=require('ioredis');var authService=require(_0x9793('0xf'));var qs=require(_0x9793('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9793('0x11'));var logger=require(_0x9793('0x12'))(_0x9793('0x13'));var utils=require(_0x9793('0x14'));var config=require(_0x9793('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30ca14,_0x358345){_0x358345=_0x358345||0xcc;return function(_0x11589f){if(_0x11589f){return _0x30ca14[_0x9793('0x16')](_0x358345);}return _0x30ca14[_0x9793('0x17')](_0x358345)[_0x9793('0x18')]();};}function respondWithResult(_0x1b7b8a,_0x14323c){_0x14323c=_0x14323c||0xc8;return function(_0x377012){if(_0x377012){return _0x1b7b8a[_0x9793('0x17')](_0x14323c)[_0x9793('0x19')](_0x377012);}};}function respondWithFilteredResult(_0x265da2,_0x4f0d68){return function(_0x277e9b){if(_0x277e9b){var _0x2953f9=typeof _0x4f0d68['offset']==='undefined'&&typeof _0x4f0d68[_0x9793('0x1a')]==='undefined';var _0x39b676=_0x277e9b['count'];var _0x372fd2=_0x2953f9?0x0:_0x4f0d68[_0x9793('0x1b')];var _0x3e7771=_0x2953f9?_0x277e9b['count']:_0x4f0d68['offset']+_0x4f0d68[_0x9793('0x1a')];var _0x53aa43;if(_0x3e7771>=_0x39b676){_0x3e7771=_0x39b676;_0x53aa43=0xc8;}else{_0x53aa43=0xce;}_0x265da2['status'](_0x53aa43);return _0x265da2[_0x9793('0x1c')]('Content-Range',_0x372fd2+'-'+_0x3e7771+'/'+_0x39b676)[_0x9793('0x19')](_0x277e9b);}return null;};}function patchUpdates(_0x3c89fb){return function(_0xe3cd5d){try{jsonpatch[_0x9793('0x1d')](_0xe3cd5d,_0x3c89fb,!![]);}catch(_0x23b51e){return BPromise['reject'](_0x23b51e);}return _0xe3cd5d[_0x9793('0x1e')]();};}function saveUpdates(_0x6ed133,_0x500782){return function(_0x167bf0){if(_0x167bf0){return _0x167bf0['update'](_0x6ed133)[_0x9793('0x1f')](function(_0x1f079d){return _0x1f079d;});}return null;};}function removeEntity(_0x566c92,_0x4eacb2){return function(_0x120bc2){if(_0x120bc2){return _0x120bc2[_0x9793('0x20')]()[_0x9793('0x1f')](function(){var _0x527a7f=_0x120bc2[_0x9793('0x21')]({'plain':!![]});var _0xd94215=_0x9793('0x22');return db[_0x9793('0x23')][_0x9793('0x20')]({'where':{'type':_0xd94215,'resourceId':_0x527a7f['id']}})[_0x9793('0x1f')](function(){return _0x120bc2;});})[_0x9793('0x1f')](function(){_0x566c92[_0x9793('0x17')](0xcc)[_0x9793('0x18')]();});}};}function handleEntityNotFound(_0x21a4cb,_0x92f198){return function(_0xf8e48d){if(!_0xf8e48d){_0x21a4cb[_0x9793('0x16')](0x194);}return _0xf8e48d;};}function handleError(_0x4c64ad,_0xe82d42){_0xe82d42=_0xe82d42||0x1f4;return function(_0x1b26ff){logger[_0x9793('0x24')](_0x1b26ff[_0x9793('0x25')]);if(_0x1b26ff['name']){delete _0x1b26ff[_0x9793('0x26')];}_0x4c64ad[_0x9793('0x17')](_0xe82d42)['send'](_0x1b26ff);};}exports[_0x9793('0x27')]=function(_0x233242,_0x43eb5e){var _0x53ba5f={},_0x3afde6={},_0x3a8897={'count':0x0,'rows':[]};var _0x35e785=_['map'](db[_0x9793('0x28')][_0x9793('0x29')],function(_0x5363a5){return{'name':_0x5363a5[_0x9793('0x2a')],'type':_0x5363a5[_0x9793('0x2b')]['key']};});_0x3afde6[_0x9793('0x2c')]=_[_0x9793('0x2d')](_0x35e785,_0x9793('0x26'));_0x3afde6[_0x9793('0x2e')]=_[_0x9793('0x2f')](_0x233242[_0x9793('0x2e')]);_0x3afde6[_0x9793('0x30')]=_[_0x9793('0x31')](_0x3afde6[_0x9793('0x2c')],_0x3afde6[_0x9793('0x2e')]);_0x53ba5f[_0x9793('0x32')]=_[_0x9793('0x31')](_0x3afde6['model'],qs[_0x9793('0x33')](_0x233242[_0x9793('0x2e')][_0x9793('0x33')]));_0x53ba5f['attributes']=_0x53ba5f['attributes']['length']?_0x53ba5f[_0x9793('0x32')]:_0x3afde6['model'];if(!_0x233242[_0x9793('0x2e')][_0x9793('0x34')](_0x9793('0x35'))){_0x53ba5f[_0x9793('0x1a')]=qs[_0x9793('0x1a')](_0x233242[_0x9793('0x2e')][_0x9793('0x1a')]);_0x53ba5f[_0x9793('0x1b')]=qs['offset'](_0x233242[_0x9793('0x2e')][_0x9793('0x1b')]);}_0x53ba5f[_0x9793('0x36')]=qs[_0x9793('0x37')](_0x233242[_0x9793('0x2e')]['sort']);_0x53ba5f['where']=qs[_0x9793('0x30')](_[_0x9793('0x38')](_0x233242[_0x9793('0x2e')],_0x3afde6[_0x9793('0x30')]),_0x35e785);if(_0x233242[_0x9793('0x2e')][_0x9793('0x39')]){_0x53ba5f['where']=_[_0x9793('0x3a')](_0x53ba5f[_0x9793('0x3b')],{'$or':_[_0x9793('0x2d')](_0x35e785,function(_0x50f2b3){if(_0x50f2b3[_0x9793('0x2b')]!=='VIRTUAL'){var _0x1b0b53={};_0x1b0b53[_0x50f2b3[_0x9793('0x26')]]={'$like':'%'+_0x233242['query']['filter']+'%'};return _0x1b0b53;}})});}_0x53ba5f=_[_0x9793('0x3a')]({},_0x53ba5f,_0x233242[_0x9793('0x3c')]);var _0x3ad539={'where':_0x53ba5f[_0x9793('0x3b')]};return db['JscriptyProject'][_0x9793('0x3d')](_0x3ad539)['then'](function(_0x55ac2d){_0x3a8897[_0x9793('0x3d')]=_0x55ac2d;if(_0x233242[_0x9793('0x2e')]['includeAll']){_0x53ba5f['include']=[{'all':!![]}];}return db[_0x9793('0x28')][_0x9793('0x3e')](_0x53ba5f);})[_0x9793('0x1f')](function(_0x409938){_0x3a8897['rows']=_0x409938;return _0x3a8897;})[_0x9793('0x1f')](respondWithFilteredResult(_0x43eb5e,_0x53ba5f))['catch'](handleError(_0x43eb5e,null));};exports[_0x9793('0x3f')]=function(_0x26dded,_0x416cb2){var _0x295cdf={'raw':![],'where':{'id':_0x26dded[_0x9793('0x40')]['id']}},_0x241a1f={};_0x241a1f[_0x9793('0x2c')]=_[_0x9793('0x2f')](db[_0x9793('0x28')][_0x9793('0x29')]);_0x241a1f[_0x9793('0x2e')]=_['keys'](_0x26dded[_0x9793('0x2e')]);_0x241a1f[_0x9793('0x30')]=_[_0x9793('0x31')](_0x241a1f['model'],_0x241a1f[_0x9793('0x2e')]);_0x295cdf[_0x9793('0x32')]=_[_0x9793('0x31')](_0x241a1f[_0x9793('0x2c')],qs['fields'](_0x26dded[_0x9793('0x2e')][_0x9793('0x33')]));_0x295cdf['attributes']=_0x295cdf[_0x9793('0x32')]['length']?_0x295cdf[_0x9793('0x32')]:_0x241a1f['model'];if(_0x26dded[_0x9793('0x2e')][_0x9793('0x41')]){_0x295cdf[_0x9793('0x42')]=[{'all':!![]}];}_0x295cdf=_[_0x9793('0x3a')]({},_0x295cdf,_0x26dded[_0x9793('0x3c')]);return db[_0x9793('0x28')][_0x9793('0x43')](_0x295cdf)[_0x9793('0x1f')](handleEntityNotFound(_0x416cb2,null))[_0x9793('0x1f')](respondWithResult(_0x416cb2,null))['catch'](handleError(_0x416cb2,null));};exports['create']=function(_0x583800,_0x545952){return db[_0x9793('0x28')][_0x9793('0x44')](_0x583800['body'],{})[_0x9793('0x1f')](function(_0x100781){var _0x40a0da=_0x583800[_0x9793('0x45')][_0x9793('0x21')]({'plain':!![]});if(!_0x40a0da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a0da['role']===_0x9793('0x45')){var _0x521858=_0x100781['get']({'plain':!![]});var _0x1f91e4=_0x9793('0x22');return db['UserProfileSection'][_0x9793('0x43')]({'where':{'name':_0x1f91e4,'userProfileId':_0x40a0da[_0x9793('0x46')]},'raw':!![]})[_0x9793('0x1f')](function(_0x2445fa){if(_0x2445fa&&_0x2445fa['autoAssociation']===0x0){return db[_0x9793('0x23')][_0x9793('0x44')]({'name':_0x521858[_0x9793('0x26')],'resourceId':_0x521858['id'],'type':_0x2445fa[_0x9793('0x26')],'sectionId':_0x2445fa['id']},{})[_0x9793('0x1f')](function(){return _0x100781;});}else{return _0x100781;}})['catch'](function(_0x3106f5){logger[_0x9793('0x24')](_0x9793('0x47'),_0x3106f5);throw _0x3106f5;});}return _0x100781;})[_0x9793('0x1f')](respondWithResult(_0x545952,0xc9))['catch'](handleError(_0x545952,null));};exports['clone']=function(_0xce5e8b,_0x4132f5){var _0xb15e63={'where':{'id':_0xce5e8b['params']['id']}},_0x56cc8c={};_0x56cc8c[_0x9793('0x2c')]=_[_0x9793('0x2f')](db[_0x9793('0x28')][_0x9793('0x29')]);_0xb15e63['attributes']=_[_0x9793('0x31')](_0x56cc8c[_0x9793('0x2c')],qs[_0x9793('0x33')](_0xce5e8b[_0x9793('0x2e')]['fields']));_0xb15e63['attributes']=_0xb15e63[_0x9793('0x32')][_0x9793('0x48')]?_0xb15e63[_0x9793('0x32')]:_0x56cc8c[_0x9793('0x2c')];if(_0xce5e8b['query']['includeAll']){_0xb15e63[_0x9793('0x42')]=[{'all':!![]}];}_0xb15e63=_[_0x9793('0x3a')]({},_0xb15e63,_0xce5e8b[_0x9793('0x3c')]);return db[_0x9793('0x28')][_0x9793('0x43')](_0xb15e63)[_0x9793('0x1f')](handleEntityNotFound(_0x4132f5,null))[_0x9793('0x1f')](function(_0x4c0916){if(_0x4c0916){var _0x1d6f8b=_0x4c0916[_0x9793('0x21')]({'plain':!![]});_0x1d6f8b=qs['omit'](_0x1d6f8b,['id',_0x9793('0x49'),_0x9793('0x4a')]);_0xce5e8b[_0x9793('0x4b')]=_[_0x9793('0x4c')](_0xce5e8b[_0x9793('0x4b')],['id',_0x9793('0x49'),'updatedAt']);return db[_0x9793('0x28')][_0x9793('0x44')](_[_0x9793('0x3a')](_0x1d6f8b,_0xce5e8b[_0x9793('0x4b')]),{'include':_0xce5e8b[_0x9793('0x2e')][_0x9793('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x243bc4){var _0x25c455=_0xce5e8b['user']['get']({'plain':!![]});if(!_0x25c455)throw new Error(_0x9793('0x4d'));if(_0x25c455['role']===_0x9793('0x45')){var _0x14bcba=_0x243bc4[_0x9793('0x21')]({'plain':!![]});var _0x37e70b=_0x9793('0x22');return db[_0x9793('0x4e')][_0x9793('0x43')]({'where':{'name':_0x37e70b,'userProfileId':_0x25c455[_0x9793('0x46')]},'raw':!![]})[_0x9793('0x1f')](function(_0x55d247){if(_0x55d247&&_0x55d247['autoAssociation']===0x0){return db[_0x9793('0x23')]['create']({'name':_0x14bcba[_0x9793('0x26')],'resourceId':_0x14bcba['id'],'type':_0x55d247[_0x9793('0x26')],'sectionId':_0x55d247['id']},{})[_0x9793('0x1f')](function(){return _0x243bc4;});}else{return _0x243bc4;}})[_0x9793('0x4f')](function(_0x175ba3){logger['error'](_0x9793('0x47'),_0x175ba3);throw _0x175ba3;});}return _0x243bc4;});}})[_0x9793('0x1f')](respondWithResult(_0x4132f5,0xc9))[_0x9793('0x4f')](handleError(_0x4132f5,null));};exports[_0x9793('0x50')]=function(_0x233c8b,_0x281129){if(_0x233c8b[_0x9793('0x4b')]['id']){delete _0x233c8b[_0x9793('0x4b')]['id'];}return db[_0x9793('0x28')][_0x9793('0x43')]({'where':{'id':_0x233c8b[_0x9793('0x40')]['id']}})['then'](handleEntityNotFound(_0x281129,null))[_0x9793('0x1f')](saveUpdates(_0x233c8b['body'],null))[_0x9793('0x1f')](respondWithResult(_0x281129,null))[_0x9793('0x4f')](handleError(_0x281129,null));};exports['destroy']=function(_0x9f8611,_0x46083e){return db[_0x9793('0x28')]['find']({'where':{'id':_0x9f8611[_0x9793('0x40')]['id']}})[_0x9793('0x1f')](handleEntityNotFound(_0x46083e,null))[_0x9793('0x1f')](removeEntity(_0x46083e,null))[_0x9793('0x4f')](handleError(_0x46083e,null));};exports[_0x9793('0x51')]=function(_0x5259e8,_0x117c7a,_0xde73ef){var _0x4e13b1={'raw':!![],'where':{}};var _0x4df598={};var _0x3eb368={'count':0x0,'rows':[]};return db[_0x9793('0x28')][_0x9793('0x52')]({'where':{'id':_0x5259e8['params']['id']}})[_0x9793('0x1f')](handleEntityNotFound(_0x117c7a,null))[_0x9793('0x1f')](function(_0x47dbe7){if(_0x47dbe7){_0x4df598[_0x9793('0x2c')]=_[_0x9793('0x2f')](db[_0x9793('0x53')][_0x9793('0x29')]);_0x4df598[_0x9793('0x2e')]=_['keys'](_0x5259e8[_0x9793('0x2e')]);_0x4df598[_0x9793('0x30')]=_[_0x9793('0x31')](_0x4df598[_0x9793('0x2c')],_0x4df598['query']);_0x4e13b1[_0x9793('0x32')]=_['intersection'](_0x4df598[_0x9793('0x2c')],qs[_0x9793('0x33')](_0x5259e8[_0x9793('0x2e')][_0x9793('0x33')]));_0x4e13b1[_0x9793('0x32')]=_0x4e13b1['attributes'][_0x9793('0x48')]?_0x4e13b1[_0x9793('0x32')]:_0x4df598[_0x9793('0x2c')];if(!_0x5259e8[_0x9793('0x2e')][_0x9793('0x34')]('nolimit')){_0x4e13b1[_0x9793('0x1a')]=qs['limit'](_0x5259e8[_0x9793('0x2e')][_0x9793('0x1a')]);_0x4e13b1[_0x9793('0x1b')]=qs[_0x9793('0x1b')](_0x5259e8[_0x9793('0x2e')]['offset']);}_0x4e13b1[_0x9793('0x36')]=qs[_0x9793('0x37')](_0x5259e8[_0x9793('0x2e')][_0x9793('0x37')]);_0x4e13b1[_0x9793('0x3b')]=qs[_0x9793('0x30')](_[_0x9793('0x38')](_0x5259e8[_0x9793('0x2e')],_0x4df598[_0x9793('0x30')]));_0x4e13b1[_0x9793('0x3b')]['ProjectId']=_0x47dbe7['id'];if(_0x5259e8['query']['filter']){_0x4e13b1[_0x9793('0x3b')]=_[_0x9793('0x3a')](_0x4e13b1[_0x9793('0x3b')],{'$or':_['map'](_0x4e13b1[_0x9793('0x32')],function(_0x55a3ca){var _0x117e12={};_0x117e12[_0x55a3ca]={'$like':'%'+_0x5259e8[_0x9793('0x2e')][_0x9793('0x39')]+'%'};return _0x117e12;})});}_0x4e13b1=_[_0x9793('0x3a')]({},_0x4e13b1,_0x5259e8['options']);return db['JscriptySessionReport'][_0x9793('0x3d')]({'where':_0x4e13b1[_0x9793('0x3b')]})['then'](function(_0x494d5e){_0x3eb368[_0x9793('0x3d')]=_0x494d5e;if(_0x5259e8[_0x9793('0x2e')][_0x9793('0x41')]){_0x4e13b1[_0x9793('0x42')]=[{'all':!![]}];}return db[_0x9793('0x53')][_0x9793('0x3e')](_0x4e13b1);})[_0x9793('0x1f')](function(_0x4842a9){_0x3eb368[_0x9793('0x54')]=_0x4842a9;return _0x3eb368;});}})[_0x9793('0x1f')](respondWithFilteredResult(_0x117c7a,_0x4e13b1))['catch'](handleError(_0x117c7a,null));};exports[_0x9793('0x55')]=function(_0x174afd,_0xebbb8d,_0x35534d){var _0x15069f={'raw':!![],'where':{}};var _0xb20d96={};var _0xadcabb={'count':0x0,'rows':[]};return db[_0x9793('0x28')][_0x9793('0x52')]({'where':{'id':_0x174afd['params']['id']}})['then'](handleEntityNotFound(_0xebbb8d,null))[_0x9793('0x1f')](function(_0x321843){if(_0x321843){_0xb20d96['model']=_[_0x9793('0x2f')](db[_0x9793('0x56')][_0x9793('0x29')]);_0xb20d96['query']=_[_0x9793('0x2f')](_0x174afd[_0x9793('0x2e')]);_0xb20d96[_0x9793('0x30')]=_['intersection'](_0xb20d96['model'],_0xb20d96[_0x9793('0x2e')]);_0x15069f['attributes']=_[_0x9793('0x31')](_0xb20d96[_0x9793('0x2c')],qs['fields'](_0x174afd[_0x9793('0x2e')][_0x9793('0x33')]));_0x15069f[_0x9793('0x32')]=_0x15069f['attributes'][_0x9793('0x48')]?_0x15069f[_0x9793('0x32')]:_0xb20d96[_0x9793('0x2c')];if(!_0x174afd[_0x9793('0x2e')][_0x9793('0x34')](_0x9793('0x35'))){_0x15069f[_0x9793('0x1a')]=qs['limit'](_0x174afd['query'][_0x9793('0x1a')]);_0x15069f[_0x9793('0x1b')]=qs[_0x9793('0x1b')](_0x174afd[_0x9793('0x2e')][_0x9793('0x1b')]);}_0x15069f[_0x9793('0x36')]=qs['sort'](_0x174afd[_0x9793('0x2e')][_0x9793('0x37')]);_0x15069f[_0x9793('0x3b')]=qs[_0x9793('0x30')](_[_0x9793('0x38')](_0x174afd[_0x9793('0x2e')],_0xb20d96['filters']));_0x15069f['where']['ProjectId']=_0x321843['id'];if(_0x174afd[_0x9793('0x2e')][_0x9793('0x39')]){_0x15069f[_0x9793('0x3b')]=_[_0x9793('0x3a')](_0x15069f['where'],{'$or':_[_0x9793('0x2d')](_0x15069f[_0x9793('0x32')],function(_0x3839be){var _0x4d642c={};_0x4d642c[_0x3839be]={'$like':'%'+_0x174afd['query'][_0x9793('0x39')]+'%'};return _0x4d642c;})});}_0x15069f=_[_0x9793('0x3a')]({},_0x15069f,_0x174afd[_0x9793('0x3c')]);return db[_0x9793('0x56')][_0x9793('0x3d')]({'where':_0x15069f[_0x9793('0x3b')]})[_0x9793('0x1f')](function(_0x425284){_0xadcabb[_0x9793('0x3d')]=_0x425284;if(_0x174afd[_0x9793('0x2e')][_0x9793('0x41')]){_0x15069f['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x9793('0x3e')](_0x15069f);})[_0x9793('0x1f')](function(_0x134df4){_0xadcabb['rows']=_0x134df4;return _0xadcabb;});}})[_0x9793('0x1f')](respondWithFilteredResult(_0xebbb8d,_0x15069f))['catch'](handleError(_0xebbb8d,null));};function char(_0x3b3b06){return _0x9793('0x57')===typeof _0x3b3b06?String[_0x9793('0x58')][_0x9793('0x1d')](null,arguments):_0x3b3b06;}function needsEncapsulation(_0x26797e){return!!_0x26797e&&(_0x26797e[_0x9793('0x59')]()['indexOf'](char(0xd))>=0x0||_0x26797e[_0x9793('0x59')]()[_0x9793('0x5a')](char(0xa))>=0x0||_0x26797e[_0x9793('0x59')]()['indexOf'](char(0x2c))>=0x0||_0x26797e['toString']()[_0x9793('0x5a')](char(0x22))>=0x0);}function encapsulate(_0xd6e534){var _0x3e932c=char(0x22),_0x53090f='\x5c'+char(0x22),_0x1b42b8=_0xd6e534[_0x9793('0x59')]()[_0x9793('0x5b')](new RegExp(_0x3e932c,'g'),_0x53090f);return _0x3e932c+_0x1b42b8+_0x3e932c;}exports[_0x9793('0x5c')]=function(_0x4103c1,_0xab95f9,_0x220307){var _0x1a7f66,_0x3517f5;var _0x93e5c6={'where':{'ProjectId':_0x4103c1['params']['id']}};if(_0x4103c1[_0x9793('0x2e')][_0x9793('0x5d')]){_0x93e5c6[_0x9793('0x3b')][_0x9793('0x5e')]=JSON['parse'](_0x4103c1['query'][_0x9793('0x5d')]);}return db[_0x9793('0x53')][_0x9793('0x3e')](_0x93e5c6)[_0x9793('0x1f')](handleEntityNotFound(_0xab95f9,null))[_0x9793('0x1f')](function(_0x1182a5){if(_0x1182a5){_0x1a7f66=_0x1182a5;return db[_0x9793('0x5f')][_0x9793('0x3e')]({'where':{'SessionId':{'$in':_[_0x9793('0x2d')](_0x1a7f66,'id')},'ProjectId':_0x4103c1[_0x9793('0x40')]['id']},'order':_0x9793('0x60')});}})[_0x9793('0x1f')](handleEntityNotFound(_0xab95f9,null))['then'](function(_0x4580c2){if(_0x4580c2){_0x3517f5=_0x4580c2;var _0x592ec7={};for(var _0x2d8b59=0x0,_0x232ad7=_0x3517f5['length'];_0x2d8b59<_0x232ad7;_0x2d8b59++){if(!_0x592ec7[_0x9793('0x34')](_0x3517f5[_0x2d8b59][_0x9793('0x61')])){_0x592ec7[_0x3517f5[_0x2d8b59][_0x9793('0x61')]]=needsEncapsulation(_0x3517f5[_0x2d8b59][_0x9793('0x62')])?encapsulate(_0x3517f5[_0x2d8b59][_0x9793('0x62')]):_0x3517f5[_0x2d8b59][_0x9793('0x62')];}}var _0x21b127=[],_0x2e29e2={};for(var _0x50e88e=0x0,_0x40ab27=_0x1a7f66['length'];_0x50e88e<_0x40ab27;_0x50e88e++){_0x2e29e2={'ProjectId':_0x4103c1[_0x9793('0x40')]['id'],'SessionId':_0x1a7f66[_0x50e88e]['id'],'StartTime':moment(_0x1a7f66[_0x50e88e][_0x9793('0x5e')])['format'](_0x9793('0x63'))};for(var _0x26301a=0x0,_0x1b7ede=_0x3517f5[_0x9793('0x48')];_0x26301a<_0x1b7ede;_0x26301a++){if(_0x3517f5[_0x26301a][_0x9793('0x64')]==_0x1a7f66[_0x50e88e]['id']&&_0x592ec7[_0x9793('0x34')](_0x3517f5[_0x26301a][_0x9793('0x61')])){_0x2e29e2[_0x592ec7[_0x3517f5[_0x26301a][_0x9793('0x61')]]]=_0x3517f5[_0x26301a][_0x9793('0x65')];}}for(var _0x4c23a6 in _0x592ec7){if(!_0x2e29e2[_0x9793('0x34')](_0x592ec7[_0x4c23a6])){_0x2e29e2[_0x592ec7[_0x4c23a6]]=null;}}_0x21b127[_0x9793('0x66')](_0x2e29e2);}return _0x21b127;}})[_0x9793('0x1f')](function(_0x24184b){if(!_[_0x9793('0x67')](_0x24184b)){var _0x34ef26=toCsv(_0x24184b);var _0x584330=Date[_0x9793('0x68')]();fs['writeFileSync'](util[_0x9793('0x69')](_0x9793('0x6a'),_0x4103c1[_0x9793('0x40')]['id'],_0x584330),_0x34ef26);_0xab95f9[_0x9793('0x6b')](_0x9793('0x6c'),'attachment;\x20filename='+util[_0x9793('0x69')](_0x9793('0x6d'),_0x4103c1['params']['id'],_0x584330));_0xab95f9[_0x9793('0x6b')](_0x9793('0x6e'),_0x9793('0x6f'));return _0xab95f9[_0x9793('0x70')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4103c1[_0x9793('0x40')]['id'],_0x584330));}else{return _0xab95f9[_0x9793('0x16')](0xcc);}})[_0x9793('0x4f')](handleError(_0xab95f9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 371877e..b9b9933 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 _0xb717=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x23207b,_0x4d57bd){var _0x337090=function(_0x76cdaf){while(--_0x76cdaf){_0x23207b['push'](_0x23207b['shift']());}};_0x337090(++_0x4d57bd);}(_0xb717,0x1b4));var _0x7b71=function(_0x4813df,_0x16059d){_0x4813df=_0x4813df-0x0;var _0x1f0f2c=_0xb717[_0x4813df];return _0x1f0f2c;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7b=['moment','bluebird','request-promise','path','../../config/environment','exports','define','jscripty_projects','util','../../config/logger','api'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x6f7b,0x168));var _0xb6f7=function(_0x5eaf7b,_0x4b7b8a){_0x5eaf7b=_0x5eaf7b-0x0;var _0x4b42e5=_0x6f7b[_0x5eaf7b];return _0x4b42e5;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var logger=require(_0xb6f7('0x1'))(_0xb6f7('0x2'));var moment=require(_0xb6f7('0x3'));var BPromise=require(_0xb6f7('0x4'));var rp=require(_0xb6f7('0x5'));var fs=require('fs');var path=require(_0xb6f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb6f7('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xb6f7('0x8')]=function(_0x25cec3,_0x59b2d9){return _0x25cec3[_0xb6f7('0x9')]('JscriptyProject',attributes,{'tableName':_0xb6f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index a515fc7..cf6fa1f 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xda3f,0xec));var _0xfda3=function(_0x14b9d3,_0x5d4c4b){_0x14b9d3=_0x14b9d3-0x0;var _0x638f30=_0xda3f[_0x14b9d3];return _0x638f30;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\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 +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(_0x470d17,_0x32e508){var _0xd6558d=function(_0x23f372){while(--_0x23f372){_0x470d17['push'](_0x470d17['shift']());}};_0xd6558d(++_0x32e508);}(_0xaa88,0x137));var _0x8aa8=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xaa88[_0x4c2f30];return _0xb8854d;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d908b32..77a757f 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 _0xc7a7=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xc7a7,0x16c));var _0x7c7a=function(_0x27eed5,_0x45c856){_0x27eed5=_0x27eed5-0x0;var _0x42397c=_0xc7a7[_0x27eed5];return _0x42397c;};'use strict';var multer=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var path=require(_0x7c7a('0x2'));var timeout=require(_0x7c7a('0x3'));var express=require(_0x7c7a('0x4'));var router=express[_0x7c7a('0x5')]();var fs_extra=require(_0x7c7a('0x6'));var auth=require(_0x7c7a('0x7'));var interaction=require(_0x7c7a('0x8'));var config=require('../../config/environment');var controller=require(_0x7c7a('0x9'));router['get']('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xb')]);router[_0x7c7a('0xc')]('/describe',auth[_0x7c7a('0xa')](),controller['describe']);router[_0x7c7a('0xc')](_0x7c7a('0xd'),auth['isAuthenticated'](),controller[_0x7c7a('0xe')]);router['post']('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xf')]);router[_0x7c7a('0x10')](_0x7c7a('0xd'),auth[_0x7c7a('0xa')](),controller['update']);router[_0x7c7a('0x11')]('/:id',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0x12')]);module[_0x7c7a('0x13')]=router; \ No newline at end of file +var _0x87bb=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x33c5db,_0xc8c567){var _0x583c5f=function(_0x583270){while(--_0x583270){_0x33c5db['push'](_0x33c5db['shift']());}};_0x583c5f(++_0xc8c567);}(_0x87bb,0xa2));var _0xb87b=function(_0x4246de,_0x3a61f2){_0x4246de=_0x4246de-0x0;var _0x43c264=_0x87bb[_0x4246de];return _0x43c264;};'use strict';var multer=require(_0xb87b('0x0'));var util=require(_0xb87b('0x1'));var path=require(_0xb87b('0x2'));var timeout=require(_0xb87b('0x3'));var express=require(_0xb87b('0x4'));var router=express[_0xb87b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb87b('0x6'));var interaction=require(_0xb87b('0x7'));var config=require('../../config/environment');var controller=require(_0xb87b('0x8'));router[_0xb87b('0x9')]('/',auth[_0xb87b('0xa')](),controller[_0xb87b('0xb')]);router['get'](_0xb87b('0xc'),auth[_0xb87b('0xa')](),controller[_0xb87b('0xd')]);router[_0xb87b('0x9')](_0xb87b('0xe'),auth['isAuthenticated'](),controller[_0xb87b('0xf')]);router[_0xb87b('0x10')]('/',auth[_0xb87b('0xa')](),controller[_0xb87b('0x11')]);router[_0xb87b('0x12')](_0xb87b('0xe'),auth[_0xb87b('0xa')](),controller[_0xb87b('0x13')]);router[_0xb87b('0x14')](_0xb87b('0xe'),auth[_0xb87b('0xa')](),controller[_0xb87b('0x15')]);module[_0xb87b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 2561242..ad1526d 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x1f7b8a,_0x446305){_0x1f7b8a=_0x1f7b8a-0x0;var _0x4ba7a2=_0x7a54[_0x1f7b8a];return _0x4ba7a2;};'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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x1ef273,_0x4dec90){_0x1ef273=_0x1ef273-0x0;var _0x3673d9=_0x7a54[_0x1ef273];return _0x3673d9;};'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 4106262..bccd3dd 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 _0x58b2=['count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','filter','where','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x217b17,_0x35fc8d){var _0x150d1b=function(_0x34296c){while(--_0x34296c){_0x217b17['push'](_0x217b17['shift']());}};_0x150d1b(++_0x35fc8d);}(_0x58b2,0xfb));var _0x258b=function(_0x4913a8,_0x5a8cbd){_0x4913a8=_0x4913a8-0x0;var _0x50a4de=_0x58b2[_0x4913a8];return _0x50a4de;};'use strict';var emlformat=require(_0x258b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x258b('0x1'));var moment=require(_0x258b('0x2'));var BPromise=require(_0x258b('0x3'));var Mustache=require(_0x258b('0x4'));var util=require(_0x258b('0x5'));var path=require('path');var sox=require(_0x258b('0x6'));var csv=require(_0x258b('0x7'));var ejs=require(_0x258b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x258b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x258b('0xa'));var Papa=require('papaparse');var Redis=require(_0x258b('0xb'));var authService=require(_0x258b('0xc'));var qs=require(_0x258b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258b('0xe'));var logger=require(_0x258b('0xf'))(_0x258b('0x10'));var utils=require(_0x258b('0x11'));var config=require(_0x258b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x258b('0x13'))['db'];function respondWithStatusCode(_0x501eb9,_0x31da1f){_0x31da1f=_0x31da1f||0xcc;return function(_0x3b5f5f){if(_0x3b5f5f){return _0x501eb9[_0x258b('0x14')](_0x31da1f);}return _0x501eb9['status'](_0x31da1f)['end']();};}function respondWithResult(_0x5378bd,_0x2c0fe7){_0x2c0fe7=_0x2c0fe7||0xc8;return function(_0x1318ff){if(_0x1318ff){return _0x5378bd[_0x258b('0x15')](_0x2c0fe7)[_0x258b('0x16')](_0x1318ff);}};}function respondWithFilteredResult(_0x29f490,_0xd3cd85){return function(_0x1a4dbc){if(_0x1a4dbc){var _0x23057a=typeof _0xd3cd85[_0x258b('0x17')]===_0x258b('0x18')&&typeof _0xd3cd85['limit']==='undefined';var _0x5b2ab7=_0x1a4dbc[_0x258b('0x19')];var _0xea8a8a=_0x23057a?0x0:_0xd3cd85[_0x258b('0x17')];var _0x340703=_0x23057a?_0x1a4dbc[_0x258b('0x19')]:_0xd3cd85[_0x258b('0x17')]+_0xd3cd85['limit'];var _0x366457;if(_0x340703>=_0x5b2ab7){_0x340703=_0x5b2ab7;_0x366457=0xc8;}else{_0x366457=0xce;}_0x29f490['status'](_0x366457);return _0x29f490[_0x258b('0x1a')](_0x258b('0x1b'),_0xea8a8a+'-'+_0x340703+'/'+_0x5b2ab7)['json'](_0x1a4dbc);}return null;};}function patchUpdates(_0x3c516d){return function(_0xee2aa){try{jsonpatch[_0x258b('0x1c')](_0xee2aa,_0x3c516d,!![]);}catch(_0x45392d){return BPromise['reject'](_0x45392d);}return _0xee2aa[_0x258b('0x1d')]();};}function saveUpdates(_0x1b8a2e,_0x630977){return function(_0x407c2f){if(_0x407c2f){return _0x407c2f[_0x258b('0x1e')](_0x1b8a2e)[_0x258b('0x1f')](function(_0x36706d){return _0x36706d;});}return null;};}function removeEntity(_0xce162d,_0x545d29){return function(_0x5949bd){if(_0x5949bd){return _0x5949bd[_0x258b('0x20')]()['then'](function(){_0xce162d['status'](0xcc)[_0x258b('0x21')]();});}};}function handleEntityNotFound(_0x3f95e9,_0x16bad0){return function(_0x6ee75d){if(!_0x6ee75d){_0x3f95e9[_0x258b('0x14')](0x194);}return _0x6ee75d;};}function handleError(_0x32c6d4,_0x43ccb5){_0x43ccb5=_0x43ccb5||0x1f4;return function(_0x6be3ea){logger[_0x258b('0x22')](_0x6be3ea[_0x258b('0x23')]);if(_0x6be3ea[_0x258b('0x24')]){delete _0x6be3ea[_0x258b('0x24')];}_0x32c6d4[_0x258b('0x15')](_0x43ccb5)['send'](_0x6be3ea);};}exports[_0x258b('0x25')]=function(_0x33102a,_0xf2da29){var _0x588e0d={},_0x44d677={},_0x1b64fd={'count':0x0,'rows':[]};var _0x28e1dd=_[_0x258b('0x26')](db['JscriptyQuestionReport'][_0x258b('0x27')],function(_0x4d0e5f){return{'name':_0x4d0e5f[_0x258b('0x28')],'type':_0x4d0e5f[_0x258b('0x29')]['key']};});_0x44d677['model']=_[_0x258b('0x26')](_0x28e1dd,_0x258b('0x24'));_0x44d677[_0x258b('0x2a')]=_[_0x258b('0x2b')](_0x33102a['query']);_0x44d677[_0x258b('0x2c')]=_[_0x258b('0x2d')](_0x44d677[_0x258b('0x2e')],_0x44d677[_0x258b('0x2a')]);_0x588e0d['attributes']=_[_0x258b('0x2d')](_0x44d677[_0x258b('0x2e')],qs[_0x258b('0x2f')](_0x33102a[_0x258b('0x2a')][_0x258b('0x2f')]));_0x588e0d[_0x258b('0x30')]=_0x588e0d[_0x258b('0x30')][_0x258b('0x31')]?_0x588e0d[_0x258b('0x30')]:_0x44d677[_0x258b('0x2e')];if(!_0x33102a[_0x258b('0x2a')]['hasOwnProperty'](_0x258b('0x32'))){_0x588e0d[_0x258b('0x33')]=qs['limit'](_0x33102a['query']['limit']);_0x588e0d['offset']=qs['offset'](_0x33102a[_0x258b('0x2a')][_0x258b('0x17')]);}_0x588e0d['order']=qs['sort'](_0x33102a['query']['sort']);_0x588e0d['where']=qs['filters'](_['pick'](_0x33102a[_0x258b('0x2a')],_0x44d677['filters']),_0x28e1dd);if(_0x33102a[_0x258b('0x2a')][_0x258b('0x34')]){_0x588e0d[_0x258b('0x35')]=_['merge'](_0x588e0d['where'],{'$or':_['map'](_0x28e1dd,function(_0x581a4f){if(_0x581a4f[_0x258b('0x29')]!==_0x258b('0x36')){var _0x544483={};_0x544483[_0x581a4f[_0x258b('0x24')]]={'$like':'%'+_0x33102a[_0x258b('0x2a')][_0x258b('0x34')]+'%'};return _0x544483;}})});}_0x588e0d=_['merge']({},_0x588e0d,_0x33102a[_0x258b('0x37')]);var _0x440e68={'where':_0x588e0d[_0x258b('0x35')]};return db[_0x258b('0x38')]['count'](_0x440e68)[_0x258b('0x1f')](function(_0x2ec108){_0x1b64fd[_0x258b('0x19')]=_0x2ec108;if(_0x33102a[_0x258b('0x2a')][_0x258b('0x39')]){_0x588e0d[_0x258b('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x258b('0x3b')](_0x588e0d);})['then'](function(_0x161872){_0x1b64fd[_0x258b('0x3c')]=_0x161872;return _0x1b64fd;})['then'](respondWithFilteredResult(_0xf2da29,_0x588e0d))['catch'](handleError(_0xf2da29,null));};exports[_0x258b('0x3d')]=function(_0x5e8da3,_0x1be079){var _0xcdc5d2={'raw':!![],'where':{'id':_0x5e8da3[_0x258b('0x3e')]['id']}},_0x37c4a5={};_0x37c4a5['model']=_['keys'](db['JscriptyQuestionReport'][_0x258b('0x27')]);_0x37c4a5[_0x258b('0x2a')]=_[_0x258b('0x2b')](_0x5e8da3[_0x258b('0x2a')]);_0x37c4a5[_0x258b('0x2c')]=_[_0x258b('0x2d')](_0x37c4a5[_0x258b('0x2e')],_0x37c4a5[_0x258b('0x2a')]);_0xcdc5d2[_0x258b('0x30')]=_[_0x258b('0x2d')](_0x37c4a5[_0x258b('0x2e')],qs[_0x258b('0x2f')](_0x5e8da3['query'][_0x258b('0x2f')]));_0xcdc5d2[_0x258b('0x30')]=_0xcdc5d2[_0x258b('0x30')][_0x258b('0x31')]?_0xcdc5d2[_0x258b('0x30')]:_0x37c4a5['model'];if(_0x5e8da3['query'][_0x258b('0x39')]){_0xcdc5d2[_0x258b('0x3a')]=[{'all':!![]}];}_0xcdc5d2=_[_0x258b('0x3f')]({},_0xcdc5d2,_0x5e8da3['options']);return db[_0x258b('0x38')][_0x258b('0x40')](_0xcdc5d2)['then'](handleEntityNotFound(_0x1be079,null))['then'](respondWithResult(_0x1be079,null))[_0x258b('0x41')](handleError(_0x1be079,null));};exports[_0x258b('0x42')]=function(_0x2e68af,_0x563684){return db[_0x258b('0x38')][_0x258b('0x42')](_0x2e68af[_0x258b('0x43')],{})[_0x258b('0x1f')](respondWithResult(_0x563684,0xc9))[_0x258b('0x41')](handleError(_0x563684,null));};exports[_0x258b('0x1e')]=function(_0x1ad876,_0x1dbe34){if(_0x1ad876[_0x258b('0x43')]['id']){delete _0x1ad876['body']['id'];}return db[_0x258b('0x38')][_0x258b('0x40')]({'where':{'id':_0x1ad876[_0x258b('0x3e')]['id']}})[_0x258b('0x1f')](handleEntityNotFound(_0x1dbe34,null))['then'](saveUpdates(_0x1ad876[_0x258b('0x43')],null))[_0x258b('0x1f')](respondWithResult(_0x1dbe34,null))[_0x258b('0x41')](handleError(_0x1dbe34,null));};exports['destroy']=function(_0x15eb2d,_0x2f3fe4){return db[_0x258b('0x38')][_0x258b('0x40')]({'where':{'id':_0x15eb2d[_0x258b('0x3e')]['id']}})[_0x258b('0x1f')](handleEntityNotFound(_0x2f3fe4,null))[_0x258b('0x1f')](removeEntity(_0x2f3fe4,null))[_0x258b('0x41')](handleError(_0x2f3fe4,null));};exports['describe']=function(_0x3fdc22,_0x65c63c){return db['JscriptyQuestionReport'][_0x258b('0x44')]()[_0x258b('0x1f')](respondWithResult(_0x65c63c,null))['catch'](handleError(_0x65c63c,null));}; \ No newline at end of file +var _0xbcae=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xbcae,0xfa));var _0xebca=function(_0x36c548,_0x5dbb4b){_0x36c548=_0x36c548-0x0;var _0x59d1f6=_0xbcae[_0x36c548];return _0x59d1f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebca('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var Mustache=require(_0xebca('0x4'));var util=require(_0xebca('0x5'));var path=require(_0xebca('0x6'));var sox=require(_0xebca('0x7'));var csv=require(_0xebca('0x8'));var ejs=require(_0xebca('0x9'));var fs=require('fs');var fs_extra=require(_0xebca('0xa'));var _=require(_0xebca('0xb'));var squel=require('squel');var crypto=require(_0xebca('0xc'));var jsforce=require(_0xebca('0xd'));var deskjs=require(_0xebca('0xe'));var toCsv=require(_0xebca('0x8'));var querystring=require(_0xebca('0xf'));var Papa=require('papaparse');var Redis=require(_0xebca('0x10'));var authService=require(_0xebca('0x11'));var qs=require(_0xebca('0x12'));var as=require(_0xebca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xebca('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xebca('0x15'))['db'];function respondWithStatusCode(_0x414530,_0x539c04){_0x539c04=_0x539c04||0xcc;return function(_0x49cb9f){if(_0x49cb9f){return _0x414530[_0xebca('0x16')](_0x539c04);}return _0x414530[_0xebca('0x17')](_0x539c04)['end']();};}function respondWithResult(_0x5c88c9,_0x3190d2){_0x3190d2=_0x3190d2||0xc8;return function(_0x52204f){if(_0x52204f){return _0x5c88c9[_0xebca('0x17')](_0x3190d2)[_0xebca('0x18')](_0x52204f);}};}function respondWithFilteredResult(_0x535eeb,_0x4f1fd2){return function(_0x1a3f66){if(_0x1a3f66){var _0x3ed86e=typeof _0x4f1fd2[_0xebca('0x19')]===_0xebca('0x1a')&&typeof _0x4f1fd2[_0xebca('0x1b')]===_0xebca('0x1a');var _0xb19082=_0x1a3f66[_0xebca('0x1c')];var _0x2e3995=_0x3ed86e?0x0:_0x4f1fd2[_0xebca('0x19')];var _0xcbb0a8=_0x3ed86e?_0x1a3f66['count']:_0x4f1fd2['offset']+_0x4f1fd2[_0xebca('0x1b')];var _0x6860d3;if(_0xcbb0a8>=_0xb19082){_0xcbb0a8=_0xb19082;_0x6860d3=0xc8;}else{_0x6860d3=0xce;}_0x535eeb['status'](_0x6860d3);return _0x535eeb['set'](_0xebca('0x1d'),_0x2e3995+'-'+_0xcbb0a8+'/'+_0xb19082)['json'](_0x1a3f66);}return null;};}function patchUpdates(_0x35f7e5){return function(_0x1e418e){try{jsonpatch[_0xebca('0x1e')](_0x1e418e,_0x35f7e5,!![]);}catch(_0x4f2928){return BPromise[_0xebca('0x1f')](_0x4f2928);}return _0x1e418e[_0xebca('0x20')]();};}function saveUpdates(_0xe8d716,_0x398c89){return function(_0x49b1ee){if(_0x49b1ee){return _0x49b1ee[_0xebca('0x21')](_0xe8d716)[_0xebca('0x22')](function(_0x1e616c){return _0x1e616c;});}return null;};}function removeEntity(_0x211ada,_0xec4d04){return function(_0x34d68c){if(_0x34d68c){return _0x34d68c[_0xebca('0x23')]()[_0xebca('0x22')](function(){_0x211ada[_0xebca('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b226e,_0x30ed27){return function(_0x3490ed){if(!_0x3490ed){_0x3b226e[_0xebca('0x16')](0x194);}return _0x3490ed;};}function handleError(_0x54d303,_0xb4f3f){_0xb4f3f=_0xb4f3f||0x1f4;return function(_0x1cdd5a){logger[_0xebca('0x24')](_0x1cdd5a['stack']);if(_0x1cdd5a['name']){delete _0x1cdd5a[_0xebca('0x25')];}_0x54d303[_0xebca('0x17')](_0xb4f3f)[_0xebca('0x26')](_0x1cdd5a);};}exports[_0xebca('0x27')]=function(_0x374213,_0x9364a3){var _0x4a907d={},_0x5a554c={},_0xe243c4={'count':0x0,'rows':[]};var _0x2e2271=_[_0xebca('0x28')](db[_0xebca('0x29')][_0xebca('0x2a')],function(_0x5b0608){return{'name':_0x5b0608[_0xebca('0x2b')],'type':_0x5b0608[_0xebca('0x2c')]['key']};});_0x5a554c[_0xebca('0x2d')]=_[_0xebca('0x28')](_0x2e2271,'name');_0x5a554c[_0xebca('0x2e')]=_[_0xebca('0x2f')](_0x374213[_0xebca('0x2e')]);_0x5a554c[_0xebca('0x30')]=_[_0xebca('0x31')](_0x5a554c[_0xebca('0x2d')],_0x5a554c[_0xebca('0x2e')]);_0x4a907d[_0xebca('0x32')]=_[_0xebca('0x31')](_0x5a554c[_0xebca('0x2d')],qs[_0xebca('0x33')](_0x374213[_0xebca('0x2e')][_0xebca('0x33')]));_0x4a907d[_0xebca('0x32')]=_0x4a907d[_0xebca('0x32')]['length']?_0x4a907d['attributes']:_0x5a554c['model'];if(!_0x374213[_0xebca('0x2e')][_0xebca('0x34')]('nolimit')){_0x4a907d[_0xebca('0x1b')]=qs[_0xebca('0x1b')](_0x374213['query'][_0xebca('0x1b')]);_0x4a907d[_0xebca('0x19')]=qs[_0xebca('0x19')](_0x374213['query'][_0xebca('0x19')]);}_0x4a907d[_0xebca('0x35')]=qs[_0xebca('0x36')](_0x374213['query'][_0xebca('0x36')]);_0x4a907d[_0xebca('0x37')]=qs[_0xebca('0x30')](_[_0xebca('0x38')](_0x374213[_0xebca('0x2e')],_0x5a554c['filters']),_0x2e2271);if(_0x374213['query'][_0xebca('0x39')]){_0x4a907d[_0xebca('0x37')]=_[_0xebca('0x3a')](_0x4a907d[_0xebca('0x37')],{'$or':_[_0xebca('0x28')](_0x2e2271,function(_0xe88729){if(_0xe88729[_0xebca('0x2c')]!==_0xebca('0x3b')){var _0x5aa986={};_0x5aa986[_0xe88729[_0xebca('0x25')]]={'$like':'%'+_0x374213['query'][_0xebca('0x39')]+'%'};return _0x5aa986;}})});}_0x4a907d=_['merge']({},_0x4a907d,_0x374213[_0xebca('0x3c')]);var _0x376b51={'where':_0x4a907d[_0xebca('0x37')]};return db[_0xebca('0x29')][_0xebca('0x1c')](_0x376b51)[_0xebca('0x22')](function(_0x3644e7){_0xe243c4[_0xebca('0x1c')]=_0x3644e7;if(_0x374213[_0xebca('0x2e')][_0xebca('0x3d')]){_0x4a907d['include']=[{'all':!![]}];}return db[_0xebca('0x29')][_0xebca('0x3e')](_0x4a907d);})[_0xebca('0x22')](function(_0x4afb10){_0xe243c4[_0xebca('0x3f')]=_0x4afb10;return _0xe243c4;})[_0xebca('0x22')](respondWithFilteredResult(_0x9364a3,_0x4a907d))[_0xebca('0x40')](handleError(_0x9364a3,null));};exports[_0xebca('0x41')]=function(_0x24b3dd,_0x34b3e7){var _0x5cba57={'raw':!![],'where':{'id':_0x24b3dd['params']['id']}},_0x2312ee={};_0x2312ee[_0xebca('0x2d')]=_[_0xebca('0x2f')](db[_0xebca('0x29')][_0xebca('0x2a')]);_0x2312ee['query']=_['keys'](_0x24b3dd['query']);_0x2312ee[_0xebca('0x30')]=_[_0xebca('0x31')](_0x2312ee['model'],_0x2312ee[_0xebca('0x2e')]);_0x5cba57['attributes']=_[_0xebca('0x31')](_0x2312ee[_0xebca('0x2d')],qs[_0xebca('0x33')](_0x24b3dd[_0xebca('0x2e')][_0xebca('0x33')]));_0x5cba57[_0xebca('0x32')]=_0x5cba57[_0xebca('0x32')][_0xebca('0x42')]?_0x5cba57[_0xebca('0x32')]:_0x2312ee['model'];if(_0x24b3dd[_0xebca('0x2e')][_0xebca('0x3d')]){_0x5cba57[_0xebca('0x43')]=[{'all':!![]}];}_0x5cba57=_['merge']({},_0x5cba57,_0x24b3dd[_0xebca('0x3c')]);return db[_0xebca('0x29')][_0xebca('0x44')](_0x5cba57)[_0xebca('0x22')](handleEntityNotFound(_0x34b3e7,null))['then'](respondWithResult(_0x34b3e7,null))[_0xebca('0x40')](handleError(_0x34b3e7,null));};exports['create']=function(_0x3c1cc1,_0x4c3b6f){return db[_0xebca('0x29')][_0xebca('0x45')](_0x3c1cc1[_0xebca('0x46')],{})[_0xebca('0x22')](respondWithResult(_0x4c3b6f,0xc9))[_0xebca('0x40')](handleError(_0x4c3b6f,null));};exports[_0xebca('0x21')]=function(_0x2dd872,_0x115a02){if(_0x2dd872['body']['id']){delete _0x2dd872[_0xebca('0x46')]['id'];}return db[_0xebca('0x29')][_0xebca('0x44')]({'where':{'id':_0x2dd872['params']['id']}})[_0xebca('0x22')](handleEntityNotFound(_0x115a02,null))[_0xebca('0x22')](saveUpdates(_0x2dd872['body'],null))[_0xebca('0x22')](respondWithResult(_0x115a02,null))['catch'](handleError(_0x115a02,null));};exports[_0xebca('0x23')]=function(_0x566e47,_0x4ce91c){return db[_0xebca('0x29')][_0xebca('0x44')]({'where':{'id':_0x566e47[_0xebca('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ce91c,null))[_0xebca('0x22')](removeEntity(_0x4ce91c,null))['catch'](handleError(_0x4ce91c,null));};exports[_0xebca('0x48')]=function(_0x471804,_0x40cde0){return db[_0xebca('0x29')][_0xebca('0x48')]()['then'](respondWithResult(_0x40cde0,null))[_0xebca('0x40')](handleError(_0x40cde0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f43893f..ee6879b 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 _0xb8dc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','util'];(function(_0x48b4a1,_0x3c2bf4){var _0x2df379=function(_0x5962c1){while(--_0x5962c1){_0x48b4a1['push'](_0x48b4a1['shift']());}};_0x2df379(++_0x3c2bf4);}(_0xb8dc,0xba));var _0xcb8d=function(_0x2194b5,_0x5cabd2){_0x2194b5=_0x2194b5-0x0;var _0x46a794=_0xb8dc[_0x2194b5];return _0x46a794;};'use strict';var _=require('lodash');var util=require(_0xcb8d('0x0'));var logger=require(_0xcb8d('0x1'))(_0xcb8d('0x2'));var moment=require(_0xcb8d('0x3'));var BPromise=require(_0xcb8d('0x4'));var rp=require(_0xcb8d('0x5'));var fs=require('fs');var path=require(_0xcb8d('0x6'));var rimraf=require(_0xcb8d('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb8d('0x8'));module['exports']=function(_0x52601d,_0x54f3a){return _0x52601d[_0xcb8d('0x9')](_0xcb8d('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e4c=['moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x3feb8a,_0x47c784){var _0x4523ca=function(_0x4fba86){while(--_0x4fba86){_0x3feb8a['push'](_0x3feb8a['shift']());}};_0x4523ca(++_0x47c784);}(_0x2e4c,0x1f3));var _0xc2e4=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2e4c[_0x2a56ad];return _0x425175;};'use strict';var _=require('lodash');var util=require(_0xc2e4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc2e4('0x1'));var BPromise=require(_0xc2e4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2e4('0x3'));var rimraf=require(_0xc2e4('0x4'));var config=require(_0xc2e4('0x5'));var attributes=require(_0xc2e4('0x6'));module[_0xc2e4('0x7')]=function(_0xce5f82,_0x184f8b){return _0xce5f82['define'](_0xc2e4('0x8'),attributes,{'tableName':_0xc2e4('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 cbf0588..71c8e4d 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 _0x8026=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x5ad0c0,_0x444dfe){var _0x21bfb0=function(_0x1ccbea){while(--_0x1ccbea){_0x5ad0c0['push'](_0x5ad0c0['shift']());}};_0x21bfb0(++_0x444dfe);}(_0x8026,0x1d7));var _0x6802=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0x8026[_0x4e68aa];return _0xfe0a56;};'use strict';var _=require('lodash');var util=require(_0x6802('0x0'));var moment=require(_0x6802('0x1'));var BPromise=require(_0x6802('0x2'));var rs=require(_0x6802('0x3'));var fs=require('fs');var Redis=require(_0x6802('0x4'));var db=require(_0x6802('0x5'))['db'];var utils=require(_0x6802('0x6'));var logger=require(_0x6802('0x7'))(_0x6802('0x8'));var config=require(_0x6802('0x9'));var jayson=require(_0x6802('0xa'));var client=jayson[_0x6802('0xb')][_0x6802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574598,_0x1c1456,_0x52150e){return new BPromise(function(_0xa92a2c,_0x4d87e7){return client[_0x6802('0xd')](_0x574598,_0x52150e)[_0x6802('0xe')](function(_0x5ae3a9){logger[_0x6802('0xf')](_0x6802('0x10'),_0x1c1456,_0x6802('0x11'));logger[_0x6802('0x12')](_0x6802('0x13'),_0x1c1456,'request\x20sent',JSON[_0x6802('0x14')](_0x5ae3a9));if(_0x5ae3a9[_0x6802('0x15')]){if(_0x5ae3a9[_0x6802('0x15')][_0x6802('0x16')]===0x1f4){logger[_0x6802('0x15')](_0x6802('0x10'),_0x1c1456,_0x5ae3a9[_0x6802('0x15')][_0x6802('0x17')]);return _0x4d87e7(_0x5ae3a9[_0x6802('0x15')][_0x6802('0x17')]);}logger[_0x6802('0x15')](_0x6802('0x10'),_0x1c1456,_0x5ae3a9[_0x6802('0x15')]['message']);return _0xa92a2c(_0x5ae3a9[_0x6802('0x15')]['message']);}else{logger[_0x6802('0xf')](_0x6802('0x10'),_0x1c1456,_0x6802('0x11'));_0xa92a2c(_0x5ae3a9['result']['message']);}})[_0x6802('0x18')](function(_0x4e9d9e){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1c1456,_0x4e9d9e);_0x4d87e7(_0x4e9d9e);});});} \ No newline at end of file +var _0x0818=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2554b6,_0x22e703){var _0x4b23b9=function(_0x1b025c){while(--_0x1b025c){_0x2554b6['push'](_0x2554b6['shift']());}};_0x4b23b9(++_0x22e703);}(_0x0818,0x15a));var _0x8081=function(_0x374721,_0xd85c69){_0x374721=_0x374721-0x0;var _0x376312=_0x0818[_0x374721];return _0x376312;};'use strict';var _=require('lodash');var util=require(_0x8081('0x0'));var moment=require(_0x8081('0x1'));var BPromise=require(_0x8081('0x2'));var rs=require(_0x8081('0x3'));var fs=require('fs');var Redis=require(_0x8081('0x4'));var db=require(_0x8081('0x5'))['db'];var utils=require(_0x8081('0x6'));var logger=require(_0x8081('0x7'))(_0x8081('0x8'));var config=require(_0x8081('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8081('0xa')][_0x8081('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13dc04,_0x4d12d4,_0x343808){return new BPromise(function(_0xcf4c6e,_0x5a4958){return client[_0x8081('0xc')](_0x13dc04,_0x343808)[_0x8081('0xd')](function(_0x473ed9){logger[_0x8081('0xe')](_0x8081('0xf'),_0x4d12d4,'request\x20sent');logger[_0x8081('0x10')](_0x8081('0x11'),_0x4d12d4,_0x8081('0x12'),JSON[_0x8081('0x13')](_0x473ed9));if(_0x473ed9[_0x8081('0x14')]){if(_0x473ed9[_0x8081('0x14')]['code']===0x1f4){logger['error'](_0x8081('0xf'),_0x4d12d4,_0x473ed9['error'][_0x8081('0x15')]);return _0x5a4958(_0x473ed9[_0x8081('0x14')]['message']);}logger[_0x8081('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d12d4,_0x473ed9[_0x8081('0x14')][_0x8081('0x15')]);return _0xcf4c6e(_0x473ed9[_0x8081('0x14')][_0x8081('0x15')]);}else{logger[_0x8081('0xe')](_0x8081('0xf'),_0x4d12d4,_0x8081('0x12'));_0xcf4c6e(_0x473ed9[_0x8081('0x16')]['message']);}})['catch'](function(_0x57ad74){logger[_0x8081('0x14')](_0x8081('0xf'),_0x4d12d4,_0x57ad74);_0x5a4958(_0x57ad74);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 03c9fef..0c645a8 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 _0x2ba0=['post','create','put','/:id','update','destroy','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','show'];(function(_0x10adb7,_0x534196){var _0x48ce7d=function(_0x147e80){while(--_0x147e80){_0x10adb7['push'](_0x10adb7['shift']());}};_0x48ce7d(++_0x534196);}(_0x2ba0,0x67));var _0x02ba=function(_0x4240be,_0x2846f4){_0x4240be=_0x4240be-0x0;var _0x400bd7=_0x2ba0[_0x4240be];return _0x400bd7;};'use strict';var multer=require(_0x02ba('0x0'));var util=require(_0x02ba('0x1'));var path=require(_0x02ba('0x2'));var timeout=require(_0x02ba('0x3'));var express=require(_0x02ba('0x4'));var router=express[_0x02ba('0x5')]();var fs_extra=require(_0x02ba('0x6'));var auth=require(_0x02ba('0x7'));var interaction=require(_0x02ba('0x8'));var config=require(_0x02ba('0x9'));var controller=require(_0x02ba('0xa'));router[_0x02ba('0xb')]('/',auth[_0x02ba('0xc')](),controller[_0x02ba('0xd')]);router[_0x02ba('0xb')](_0x02ba('0xe'),auth['isAuthenticated'](),controller[_0x02ba('0xf')]);router[_0x02ba('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x02ba('0x10')]);router[_0x02ba('0xb')]('/:id/questions',auth[_0x02ba('0xc')](),controller['getQuestions']);router[_0x02ba('0x11')]('/',auth['isAuthenticated'](),controller[_0x02ba('0x12')]);router[_0x02ba('0x13')](_0x02ba('0x14'),auth[_0x02ba('0xc')](),controller[_0x02ba('0x15')]);router['delete'](_0x02ba('0x14'),auth[_0x02ba('0xc')](),controller[_0x02ba('0x16')]);module[_0x02ba('0x17')]=router; \ No newline at end of file +var _0xc98b=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy'];(function(_0x268ed5,_0x2cb0ec){var _0x3f7278=function(_0x293f57){while(--_0x293f57){_0x268ed5['push'](_0x268ed5['shift']());}};_0x3f7278(++_0x2cb0ec);}(_0xc98b,0x191));var _0xbc98=function(_0x4db6e2,_0x2de447){_0x4db6e2=_0x4db6e2-0x0;var _0x3d748c=_0xc98b[_0x4db6e2];return _0x3d748c;};'use strict';var multer=require(_0xbc98('0x0'));var util=require('util');var path=require(_0xbc98('0x1'));var timeout=require(_0xbc98('0x2'));var express=require('express');var router=express[_0xbc98('0x3')]();var fs_extra=require(_0xbc98('0x4'));var auth=require(_0xbc98('0x5'));var interaction=require(_0xbc98('0x6'));var config=require(_0xbc98('0x7'));var controller=require(_0xbc98('0x8'));router[_0xbc98('0x9')]('/',auth['isAuthenticated'](),controller[_0xbc98('0xa')]);router[_0xbc98('0x9')](_0xbc98('0xb'),auth[_0xbc98('0xc')](),controller[_0xbc98('0xd')]);router['get'](_0xbc98('0xe'),auth[_0xbc98('0xc')](),controller[_0xbc98('0xf')]);router[_0xbc98('0x9')](_0xbc98('0x10'),auth[_0xbc98('0xc')](),controller[_0xbc98('0x11')]);router[_0xbc98('0x12')]('/',auth[_0xbc98('0xc')](),controller[_0xbc98('0x13')]);router[_0xbc98('0x14')](_0xbc98('0xe'),auth['isAuthenticated'](),controller[_0xbc98('0x15')]);router[_0xbc98('0x16')]('/:id',auth[_0xbc98('0xc')](),controller[_0xbc98('0x17')]);module[_0xbc98('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a4ffc14..d285a06 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 _0xa2c6=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2c6,0x1bb));var _0x6a2c=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xa2c6[_0x1573ea];return _0x51c0e2;};'use strict';var moment=require(_0x6a2c('0x0'));var Sequelize=require('sequelize');module[_0x6a2c('0x1')]={'starttime':{'type':Sequelize[_0x6a2c('0x2')],'set':function(_0x30dca6){this['setDataValue']('starttime',_0x30dca6);this[_0x6a2c('0x3')](_0x6a2c('0x4'),moment()[_0x6a2c('0x5')](_0x6a2c('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6a2c('0x7')]},'uniqueid':{'type':Sequelize[_0x6a2c('0x7')]},'calleridname':{'type':Sequelize[_0x6a2c('0x7')]},'calleridnum':{'type':Sequelize[_0x6a2c('0x7')]},'completed':{'type':Sequelize[_0x6a2c('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x8b38=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','starttime','setDataValue'];(function(_0x17fda7,_0x86a4a4){var _0x32ab20=function(_0x4906ec){while(--_0x4906ec){_0x17fda7['push'](_0x17fda7['shift']());}};_0x32ab20(++_0x86a4a4);}(_0x8b38,0x159));var _0x88b3=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0x8b38[_0x17784a];return _0x41aded;};'use strict';var moment=require(_0x88b3('0x0'));var Sequelize=require(_0x88b3('0x1'));module[_0x88b3('0x2')]={'starttime':{'type':Sequelize[_0x88b3('0x3')],'set':function(_0x2f3c17){this['setDataValue'](_0x88b3('0x4'),_0x2f3c17);this[_0x88b3('0x5')]('endtime',moment()[_0x88b3('0x6')](_0x88b3('0x7')));}},'endtime':{'type':Sequelize[_0x88b3('0x3')]},'membername':{'type':Sequelize[_0x88b3('0x8')]},'projectname':{'type':Sequelize[_0x88b3('0x8')]},'queue':{'type':Sequelize[_0x88b3('0x8')]},'uniqueid':{'type':Sequelize[_0x88b3('0x8')]},'calleridname':{'type':Sequelize[_0x88b3('0x8')]},'calleridnum':{'type':Sequelize[_0x88b3('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8eeaa8b..e6a78c6 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 _0x659d=['merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','findOne','nolimit','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','JscriptySessionReport','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where'];(function(_0xd7d73c,_0x2f5719){var _0x81ed61=function(_0x2c0a76){while(--_0x2c0a76){_0xd7d73c['push'](_0xd7d73c['shift']());}};_0x81ed61(++_0x2f5719);}(_0x659d,0x64));var _0xd659=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x659d[_0x41ee16];return _0x1f60de;};'use strict';var emlformat=require(_0xd659('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd659('0x1'));var jsonpatch=require(_0xd659('0x2'));var rp=require(_0xd659('0x3'));var moment=require(_0xd659('0x4'));var BPromise=require(_0xd659('0x5'));var Mustache=require('mustache');var util=require(_0xd659('0x6'));var path=require(_0xd659('0x7'));var sox=require(_0xd659('0x8'));var csv=require('to-csv');var ejs=require(_0xd659('0x9'));var fs=require('fs');var fs_extra=require(_0xd659('0xa'));var _=require(_0xd659('0xb'));var squel=require(_0xd659('0xc'));var crypto=require(_0xd659('0xd'));var jsforce=require(_0xd659('0xe'));var deskjs=require(_0xd659('0xf'));var toCsv=require(_0xd659('0x10'));var querystring=require(_0xd659('0x11'));var Papa=require(_0xd659('0x12'));var Redis=require('ioredis');var authService=require(_0xd659('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd659('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd659('0x15'))(_0xd659('0x16'));var utils=require('../../config/utils');var config=require(_0xd659('0x17'));var licenseUtil=require(_0xd659('0x18'));var db=require(_0xd659('0x19'))['db'];function respondWithStatusCode(_0x39660b,_0x1d7fc3){_0x1d7fc3=_0x1d7fc3||0xcc;return function(_0xda1eae){if(_0xda1eae){return _0x39660b['sendStatus'](_0x1d7fc3);}return _0x39660b[_0xd659('0x1a')](_0x1d7fc3)['end']();};}function respondWithResult(_0x700bfd,_0x1437e4){_0x1437e4=_0x1437e4||0xc8;return function(_0x34fe75){if(_0x34fe75){return _0x700bfd['status'](_0x1437e4)[_0xd659('0x1b')](_0x34fe75);}};}function respondWithFilteredResult(_0x30af48,_0x339f16){return function(_0x188a21){if(_0x188a21){var _0x296b4d=typeof _0x339f16['offset']==='undefined'&&typeof _0x339f16[_0xd659('0x1c')]===_0xd659('0x1d');var _0x48c48b=_0x188a21[_0xd659('0x1e')];var _0x17eabc=_0x296b4d?0x0:_0x339f16[_0xd659('0x1f')];var _0x31688a=_0x296b4d?_0x188a21[_0xd659('0x1e')]:_0x339f16[_0xd659('0x1f')]+_0x339f16[_0xd659('0x1c')];var _0x932cc8;if(_0x31688a>=_0x48c48b){_0x31688a=_0x48c48b;_0x932cc8=0xc8;}else{_0x932cc8=0xce;}_0x30af48['status'](_0x932cc8);return _0x30af48[_0xd659('0x20')]('Content-Range',_0x17eabc+'-'+_0x31688a+'/'+_0x48c48b)['json'](_0x188a21);}return null;};}function patchUpdates(_0x55b5eb){return function(_0x469d0e){try{jsonpatch[_0xd659('0x21')](_0x469d0e,_0x55b5eb,!![]);}catch(_0x1edf23){return BPromise[_0xd659('0x22')](_0x1edf23);}return _0x469d0e[_0xd659('0x23')]();};}function saveUpdates(_0x5c23d6,_0x58f12b){return function(_0xad0c55){if(_0xad0c55){return _0xad0c55[_0xd659('0x24')](_0x5c23d6)[_0xd659('0x25')](function(_0x4f2faf){return _0x4f2faf;});}return null;};}function removeEntity(_0x2c20bf,_0x1df00a){return function(_0x14741e){if(_0x14741e){return _0x14741e[_0xd659('0x26')]()['then'](function(){_0x2c20bf['status'](0xcc)[_0xd659('0x27')]();});}};}function handleEntityNotFound(_0x584f75,_0x5eca81){return function(_0x2073bd){if(!_0x2073bd){_0x584f75[_0xd659('0x28')](0x194);}return _0x2073bd;};}function handleError(_0x5cb9c0,_0x3c699e){_0x3c699e=_0x3c699e||0x1f4;return function(_0x983e2c){logger[_0xd659('0x29')](_0x983e2c['stack']);if(_0x983e2c[_0xd659('0x2a')]){delete _0x983e2c['name'];}_0x5cb9c0[_0xd659('0x1a')](_0x3c699e)['send'](_0x983e2c);};}exports[_0xd659('0x2b')]=function(_0x50e325,_0x4f9fcf){var _0x32223e={},_0x398a5e={},_0x7a8064={'count':0x0,'rows':[]};var _0x2d75ef=_[_0xd659('0x2c')](db[_0xd659('0x2d')][_0xd659('0x2e')],function(_0x3b61b9){return{'name':_0x3b61b9['fieldName'],'type':_0x3b61b9['type'][_0xd659('0x2f')]};});_0x398a5e['model']=_[_0xd659('0x2c')](_0x2d75ef,'name');_0x398a5e[_0xd659('0x30')]=_['keys'](_0x50e325[_0xd659('0x30')]);_0x398a5e[_0xd659('0x31')]=_[_0xd659('0x32')](_0x398a5e[_0xd659('0x33')],_0x398a5e[_0xd659('0x30')]);_0x32223e[_0xd659('0x34')]=_['intersection'](_0x398a5e[_0xd659('0x33')],qs[_0xd659('0x35')](_0x50e325['query'][_0xd659('0x35')]));_0x32223e['attributes']=_0x32223e[_0xd659('0x34')][_0xd659('0x36')]?_0x32223e[_0xd659('0x34')]:_0x398a5e[_0xd659('0x33')];if(!_0x50e325[_0xd659('0x30')][_0xd659('0x37')]('nolimit')){_0x32223e[_0xd659('0x1c')]=qs[_0xd659('0x1c')](_0x50e325[_0xd659('0x30')][_0xd659('0x1c')]);_0x32223e[_0xd659('0x1f')]=qs[_0xd659('0x1f')](_0x50e325[_0xd659('0x30')][_0xd659('0x1f')]);}_0x32223e['order']=qs['sort'](_0x50e325[_0xd659('0x30')][_0xd659('0x38')]);_0x32223e['where']=qs[_0xd659('0x31')](_[_0xd659('0x39')](_0x50e325[_0xd659('0x30')],_0x398a5e[_0xd659('0x31')]),_0x2d75ef);if(_0x50e325[_0xd659('0x30')][_0xd659('0x3a')]){_0x32223e[_0xd659('0x3b')]=_[_0xd659('0x3c')](_0x32223e[_0xd659('0x3b')],{'$or':_['map'](_0x2d75ef,function(_0x1d9180){if(_0x1d9180[_0xd659('0x3d')]!==_0xd659('0x3e')){var _0x326e02={};_0x326e02[_0x1d9180[_0xd659('0x2a')]]={'$like':'%'+_0x50e325[_0xd659('0x30')][_0xd659('0x3a')]+'%'};return _0x326e02;}})});}_0x32223e=_[_0xd659('0x3c')]({},_0x32223e,_0x50e325[_0xd659('0x3f')]);var _0x4f4488={'where':_0x32223e[_0xd659('0x3b')]};return db['JscriptySessionReport'][_0xd659('0x1e')](_0x4f4488)[_0xd659('0x25')](function(_0x89691c){_0x7a8064['count']=_0x89691c;if(_0x50e325['query'][_0xd659('0x40')]){_0x32223e[_0xd659('0x41')]=[{'all':!![]}];}return db[_0xd659('0x2d')]['findAll'](_0x32223e);})[_0xd659('0x25')](function(_0x14b514){_0x7a8064[_0xd659('0x42')]=_0x14b514;return _0x7a8064;})[_0xd659('0x25')](respondWithFilteredResult(_0x4f9fcf,_0x32223e))[_0xd659('0x43')](handleError(_0x4f9fcf,null));};exports[_0xd659('0x44')]=function(_0x23d895,_0x474476){var _0x5cb2a5={'raw':!![],'where':{'id':_0x23d895[_0xd659('0x45')]['id']}},_0x52d949={};_0x52d949[_0xd659('0x33')]=_[_0xd659('0x46')](db[_0xd659('0x2d')][_0xd659('0x2e')]);_0x52d949[_0xd659('0x30')]=_[_0xd659('0x46')](_0x23d895[_0xd659('0x30')]);_0x52d949['filters']=_[_0xd659('0x32')](_0x52d949['model'],_0x52d949[_0xd659('0x30')]);_0x5cb2a5[_0xd659('0x34')]=_['intersection'](_0x52d949[_0xd659('0x33')],qs[_0xd659('0x35')](_0x23d895[_0xd659('0x30')][_0xd659('0x35')]));_0x5cb2a5['attributes']=_0x5cb2a5[_0xd659('0x34')][_0xd659('0x36')]?_0x5cb2a5[_0xd659('0x34')]:_0x52d949[_0xd659('0x33')];if(_0x23d895[_0xd659('0x30')][_0xd659('0x40')]){_0x5cb2a5[_0xd659('0x41')]=[{'all':!![]}];}_0x5cb2a5=_['merge']({},_0x5cb2a5,_0x23d895[_0xd659('0x3f')]);return db[_0xd659('0x2d')][_0xd659('0x47')](_0x5cb2a5)['then'](handleEntityNotFound(_0x474476,null))[_0xd659('0x25')](respondWithResult(_0x474476,null))[_0xd659('0x43')](handleError(_0x474476,null));};exports[_0xd659('0x48')]=function(_0x15618b,_0x5881f8){return db[_0xd659('0x2d')][_0xd659('0x48')](_0x15618b[_0xd659('0x49')],{})[_0xd659('0x25')](respondWithResult(_0x5881f8,0xc9))[_0xd659('0x43')](handleError(_0x5881f8,null));};exports[_0xd659('0x24')]=function(_0x5fe69b,_0x776c7f){if(_0x5fe69b[_0xd659('0x49')]['id']){delete _0x5fe69b[_0xd659('0x49')]['id'];}return db[_0xd659('0x2d')][_0xd659('0x47')]({'where':{'id':_0x5fe69b['params']['id']}})[_0xd659('0x25')](handleEntityNotFound(_0x776c7f,null))['then'](saveUpdates(_0x5fe69b[_0xd659('0x49')],null))['then'](respondWithResult(_0x776c7f,null))[_0xd659('0x43')](handleError(_0x776c7f,null));};exports[_0xd659('0x26')]=function(_0x5ce8fb,_0x1046ec){return db[_0xd659('0x2d')][_0xd659('0x47')]({'where':{'id':_0x5ce8fb[_0xd659('0x45')]['id']}})[_0xd659('0x25')](handleEntityNotFound(_0x1046ec,null))['then'](removeEntity(_0x1046ec,null))[_0xd659('0x43')](handleError(_0x1046ec,null));};exports[_0xd659('0x4a')]=function(_0x5c922e,_0x6f6e6f){return db[_0xd659('0x2d')][_0xd659('0x4a')]()[_0xd659('0x25')](respondWithResult(_0x6f6e6f,null))[_0xd659('0x43')](handleError(_0x6f6e6f,null));};exports['getQuestions']=function(_0x12ff74,_0x36c488,_0x455b26){var _0x3ebcd0={'raw':!![],'where':{}};var _0x2281ce={};var _0x12ca6c={'count':0x0,'rows':[]};return db[_0xd659('0x2d')][_0xd659('0x4b')]({'where':{'id':_0x12ff74[_0xd659('0x45')]['id']}})['then'](handleEntityNotFound(_0x36c488,null))[_0xd659('0x25')](function(_0x201e7d){if(_0x201e7d){_0x2281ce[_0xd659('0x33')]=_[_0xd659('0x46')](db['JscriptyQuestionReport'][_0xd659('0x2e')]);_0x2281ce[_0xd659('0x30')]=_[_0xd659('0x46')](_0x12ff74['query']);_0x2281ce[_0xd659('0x31')]=_[_0xd659('0x32')](_0x2281ce['model'],_0x2281ce[_0xd659('0x30')]);_0x3ebcd0[_0xd659('0x34')]=_[_0xd659('0x32')](_0x2281ce[_0xd659('0x33')],qs[_0xd659('0x35')](_0x12ff74[_0xd659('0x30')][_0xd659('0x35')]));_0x3ebcd0[_0xd659('0x34')]=_0x3ebcd0['attributes']['length']?_0x3ebcd0[_0xd659('0x34')]:_0x2281ce[_0xd659('0x33')];if(!_0x12ff74[_0xd659('0x30')][_0xd659('0x37')](_0xd659('0x4c'))){_0x3ebcd0[_0xd659('0x1c')]=qs['limit'](_0x12ff74[_0xd659('0x30')][_0xd659('0x1c')]);_0x3ebcd0[_0xd659('0x1f')]=qs[_0xd659('0x1f')](_0x12ff74[_0xd659('0x30')]['offset']);}_0x3ebcd0[_0xd659('0x4d')]=qs[_0xd659('0x38')](_0x12ff74[_0xd659('0x30')]['sort']);_0x3ebcd0[_0xd659('0x3b')]=qs[_0xd659('0x31')](_[_0xd659('0x39')](_0x12ff74[_0xd659('0x30')],_0x2281ce[_0xd659('0x31')]));_0x3ebcd0[_0xd659('0x3b')][_0xd659('0x4e')]=_0x201e7d['id'];if(_0x12ff74['query'][_0xd659('0x3a')]){_0x3ebcd0[_0xd659('0x3b')]=_[_0xd659('0x3c')](_0x3ebcd0[_0xd659('0x3b')],{'$or':_[_0xd659('0x2c')](_0x3ebcd0[_0xd659('0x34')],function(_0x32e5e4){var _0x598f13={};_0x598f13[_0x32e5e4]={'$like':'%'+_0x12ff74['query'][_0xd659('0x3a')]+'%'};return _0x598f13;})});}_0x3ebcd0=_[_0xd659('0x3c')]({},_0x3ebcd0,_0x12ff74[_0xd659('0x3f')]);return db['JscriptyQuestionReport']['count']({'where':_0x3ebcd0['where']})[_0xd659('0x25')](function(_0x135129){_0x12ca6c[_0xd659('0x1e')]=_0x135129;if(_0x12ff74[_0xd659('0x30')][_0xd659('0x40')]){_0x3ebcd0[_0xd659('0x41')]=[{'all':!![]}];}return db[_0xd659('0x4f')]['findAll'](_0x3ebcd0);})[_0xd659('0x25')](function(_0x24912e){_0x12ca6c[_0xd659('0x42')]=_0x24912e;return _0x12ca6c;});}})['then'](respondWithFilteredResult(_0x36c488,_0x3ebcd0))[_0xd659('0x43')](handleError(_0x36c488,null));}; \ No newline at end of file +var _0x39ca=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','sendStatus','error','name','send','index','map','JscriptySessionReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','keys','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','hasOwnProperty','SessionId','options','rows','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring'];(function(_0x4c89cd,_0x2c57e2){var _0x1090d2=function(_0x1e9dda){while(--_0x1e9dda){_0x4c89cd['push'](_0x4c89cd['shift']());}};_0x1090d2(++_0x2c57e2);}(_0x39ca,0xd8));var _0xa39c=function(_0x3a2a33,_0x29372a){_0x3a2a33=_0x3a2a33-0x0;var _0x10d6d2=_0x39ca[_0x3a2a33];return _0x10d6d2;};'use strict';var emlformat=require(_0xa39c('0x0'));var rimraf=require(_0xa39c('0x1'));var zipdir=require(_0xa39c('0x2'));var jsonpatch=require(_0xa39c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa39c('0x4'));var Mustache=require(_0xa39c('0x5'));var util=require(_0xa39c('0x6'));var path=require(_0xa39c('0x7'));var sox=require('sox');var csv=require(_0xa39c('0x8'));var ejs=require(_0xa39c('0x9'));var fs=require('fs');var fs_extra=require(_0xa39c('0xa'));var _=require(_0xa39c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa39c('0xc'));var deskjs=require(_0xa39c('0xd'));var toCsv=require(_0xa39c('0x8'));var querystring=require(_0xa39c('0xe'));var Papa=require(_0xa39c('0xf'));var Redis=require('ioredis');var authService=require(_0xa39c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa39c('0x11'));var hardwareService=require(_0xa39c('0x12'));var logger=require('../../config/logger')(_0xa39c('0x13'));var utils=require(_0xa39c('0x14'));var config=require(_0xa39c('0x15'));var licenseUtil=require(_0xa39c('0x16'));var db=require(_0xa39c('0x17'))['db'];function respondWithStatusCode(_0x5b743e,_0x3cebf0){_0x3cebf0=_0x3cebf0||0xcc;return function(_0x1b0a25){if(_0x1b0a25){return _0x5b743e['sendStatus'](_0x3cebf0);}return _0x5b743e[_0xa39c('0x18')](_0x3cebf0)[_0xa39c('0x19')]();};}function respondWithResult(_0x351cf5,_0x47b56e){_0x47b56e=_0x47b56e||0xc8;return function(_0x456d48){if(_0x456d48){return _0x351cf5[_0xa39c('0x18')](_0x47b56e)[_0xa39c('0x1a')](_0x456d48);}};}function respondWithFilteredResult(_0x52f86b,_0x209ece){return function(_0x1692f9){if(_0x1692f9){var _0x515e25=typeof _0x209ece[_0xa39c('0x1b')]==='undefined'&&typeof _0x209ece[_0xa39c('0x1c')]===_0xa39c('0x1d');var _0x568040=_0x1692f9[_0xa39c('0x1e')];var _0x101808=_0x515e25?0x0:_0x209ece[_0xa39c('0x1b')];var _0x340fba=_0x515e25?_0x1692f9['count']:_0x209ece['offset']+_0x209ece[_0xa39c('0x1c')];var _0x43e5cc;if(_0x340fba>=_0x568040){_0x340fba=_0x568040;_0x43e5cc=0xc8;}else{_0x43e5cc=0xce;}_0x52f86b[_0xa39c('0x18')](_0x43e5cc);return _0x52f86b['set']('Content-Range',_0x101808+'-'+_0x340fba+'/'+_0x568040)['json'](_0x1692f9);}return null;};}function patchUpdates(_0x43e7c4){return function(_0x8a480e){try{jsonpatch[_0xa39c('0x1f')](_0x8a480e,_0x43e7c4,!![]);}catch(_0x260ddd){return BPromise[_0xa39c('0x20')](_0x260ddd);}return _0x8a480e[_0xa39c('0x21')]();};}function saveUpdates(_0x79b3b9,_0x48f699){return function(_0x4a9b6d){if(_0x4a9b6d){return _0x4a9b6d[_0xa39c('0x22')](_0x79b3b9)[_0xa39c('0x23')](function(_0x16a0ab){return _0x16a0ab;});}return null;};}function removeEntity(_0x1cf00c,_0x21e786){return function(_0xe877b4){if(_0xe877b4){return _0xe877b4['destroy']()['then'](function(){_0x1cf00c[_0xa39c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ea7c,_0x3fc2d3){return function(_0x53c2e4){if(!_0x53c2e4){_0x49ea7c[_0xa39c('0x24')](0x194);}return _0x53c2e4;};}function handleError(_0x266364,_0x34e0fd){_0x34e0fd=_0x34e0fd||0x1f4;return function(_0x472c23){logger[_0xa39c('0x25')](_0x472c23['stack']);if(_0x472c23[_0xa39c('0x26')]){delete _0x472c23[_0xa39c('0x26')];}_0x266364[_0xa39c('0x18')](_0x34e0fd)[_0xa39c('0x27')](_0x472c23);};}exports[_0xa39c('0x28')]=function(_0x5c127d,_0x426341){var _0x2776c1={},_0x4fc81f={},_0xad7ff3={'count':0x0,'rows':[]};var _0x16e2c0=_[_0xa39c('0x29')](db[_0xa39c('0x2a')]['rawAttributes'],function(_0xe1f9c3){return{'name':_0xe1f9c3['fieldName'],'type':_0xe1f9c3[_0xa39c('0x2b')][_0xa39c('0x2c')]};});_0x4fc81f[_0xa39c('0x2d')]=_[_0xa39c('0x29')](_0x16e2c0,_0xa39c('0x26'));_0x4fc81f['query']=_['keys'](_0x5c127d[_0xa39c('0x2e')]);_0x4fc81f[_0xa39c('0x2f')]=_[_0xa39c('0x30')](_0x4fc81f[_0xa39c('0x2d')],_0x4fc81f[_0xa39c('0x2e')]);_0x2776c1[_0xa39c('0x31')]=_['intersection'](_0x4fc81f['model'],qs[_0xa39c('0x32')](_0x5c127d['query'][_0xa39c('0x32')]));_0x2776c1['attributes']=_0x2776c1[_0xa39c('0x31')][_0xa39c('0x33')]?_0x2776c1[_0xa39c('0x31')]:_0x4fc81f[_0xa39c('0x2d')];if(!_0x5c127d[_0xa39c('0x2e')]['hasOwnProperty'](_0xa39c('0x34'))){_0x2776c1['limit']=qs[_0xa39c('0x1c')](_0x5c127d[_0xa39c('0x2e')][_0xa39c('0x1c')]);_0x2776c1[_0xa39c('0x1b')]=qs[_0xa39c('0x1b')](_0x5c127d[_0xa39c('0x2e')][_0xa39c('0x1b')]);}_0x2776c1[_0xa39c('0x35')]=qs['sort'](_0x5c127d[_0xa39c('0x2e')][_0xa39c('0x36')]);_0x2776c1[_0xa39c('0x37')]=qs[_0xa39c('0x2f')](_[_0xa39c('0x38')](_0x5c127d[_0xa39c('0x2e')],_0x4fc81f[_0xa39c('0x2f')]),_0x16e2c0);if(_0x5c127d[_0xa39c('0x2e')][_0xa39c('0x39')]){_0x2776c1[_0xa39c('0x37')]=_['merge'](_0x2776c1[_0xa39c('0x37')],{'$or':_['map'](_0x16e2c0,function(_0x489d28){if(_0x489d28[_0xa39c('0x2b')]!=='VIRTUAL'){var _0x1cd359={};_0x1cd359[_0x489d28['name']]={'$like':'%'+_0x5c127d['query'][_0xa39c('0x39')]+'%'};return _0x1cd359;}})});}_0x2776c1=_[_0xa39c('0x3a')]({},_0x2776c1,_0x5c127d['options']);var _0x24b93a={'where':_0x2776c1[_0xa39c('0x37')]};return db[_0xa39c('0x2a')][_0xa39c('0x1e')](_0x24b93a)[_0xa39c('0x23')](function(_0x331412){_0xad7ff3[_0xa39c('0x1e')]=_0x331412;if(_0x5c127d[_0xa39c('0x2e')][_0xa39c('0x3b')]){_0x2776c1[_0xa39c('0x3c')]=[{'all':!![]}];}return db[_0xa39c('0x2a')][_0xa39c('0x3d')](_0x2776c1);})[_0xa39c('0x23')](function(_0x7282fa){_0xad7ff3['rows']=_0x7282fa;return _0xad7ff3;})[_0xa39c('0x23')](respondWithFilteredResult(_0x426341,_0x2776c1))[_0xa39c('0x3e')](handleError(_0x426341,null));};exports['show']=function(_0x14479a,_0x369d28){var _0x267bff={'raw':!![],'where':{'id':_0x14479a[_0xa39c('0x3f')]['id']}},_0x370320={};_0x370320[_0xa39c('0x2d')]=_['keys'](db[_0xa39c('0x2a')]['rawAttributes']);_0x370320[_0xa39c('0x2e')]=_[_0xa39c('0x40')](_0x14479a['query']);_0x370320[_0xa39c('0x2f')]=_['intersection'](_0x370320[_0xa39c('0x2d')],_0x370320['query']);_0x267bff[_0xa39c('0x31')]=_[_0xa39c('0x30')](_0x370320[_0xa39c('0x2d')],qs[_0xa39c('0x32')](_0x14479a[_0xa39c('0x2e')][_0xa39c('0x32')]));_0x267bff[_0xa39c('0x31')]=_0x267bff[_0xa39c('0x31')]['length']?_0x267bff[_0xa39c('0x31')]:_0x370320['model'];if(_0x14479a[_0xa39c('0x2e')][_0xa39c('0x3b')]){_0x267bff[_0xa39c('0x3c')]=[{'all':!![]}];}_0x267bff=_['merge']({},_0x267bff,_0x14479a['options']);return db[_0xa39c('0x2a')][_0xa39c('0x41')](_0x267bff)[_0xa39c('0x23')](handleEntityNotFound(_0x369d28,null))[_0xa39c('0x23')](respondWithResult(_0x369d28,null))['catch'](handleError(_0x369d28,null));};exports[_0xa39c('0x42')]=function(_0x6afadf,_0x4f0ae7){return db['JscriptySessionReport']['create'](_0x6afadf[_0xa39c('0x43')],{})[_0xa39c('0x23')](respondWithResult(_0x4f0ae7,0xc9))[_0xa39c('0x3e')](handleError(_0x4f0ae7,null));};exports[_0xa39c('0x22')]=function(_0x2c2290,_0x5d2f5d){if(_0x2c2290[_0xa39c('0x43')]['id']){delete _0x2c2290[_0xa39c('0x43')]['id'];}return db['JscriptySessionReport'][_0xa39c('0x41')]({'where':{'id':_0x2c2290['params']['id']}})['then'](handleEntityNotFound(_0x5d2f5d,null))[_0xa39c('0x23')](saveUpdates(_0x2c2290[_0xa39c('0x43')],null))['then'](respondWithResult(_0x5d2f5d,null))[_0xa39c('0x3e')](handleError(_0x5d2f5d,null));};exports['destroy']=function(_0x4d3710,_0x2b8452){return db[_0xa39c('0x2a')][_0xa39c('0x41')]({'where':{'id':_0x4d3710[_0xa39c('0x3f')]['id']}})[_0xa39c('0x23')](handleEntityNotFound(_0x2b8452,null))[_0xa39c('0x23')](removeEntity(_0x2b8452,null))[_0xa39c('0x3e')](handleError(_0x2b8452,null));};exports[_0xa39c('0x44')]=function(_0x14afca,_0x59fec0){return db[_0xa39c('0x2a')][_0xa39c('0x44')]()[_0xa39c('0x23')](respondWithResult(_0x59fec0,null))[_0xa39c('0x3e')](handleError(_0x59fec0,null));};exports[_0xa39c('0x45')]=function(_0x4ac22b,_0x369b66,_0x5097db){var _0x2fe0ec={'raw':!![],'where':{}};var _0x58aae7={};var _0x5d9782={'count':0x0,'rows':[]};return db[_0xa39c('0x2a')][_0xa39c('0x46')]({'where':{'id':_0x4ac22b[_0xa39c('0x3f')]['id']}})[_0xa39c('0x23')](handleEntityNotFound(_0x369b66,null))[_0xa39c('0x23')](function(_0x4b35d1){if(_0x4b35d1){_0x58aae7[_0xa39c('0x2d')]=_[_0xa39c('0x40')](db[_0xa39c('0x47')][_0xa39c('0x48')]);_0x58aae7[_0xa39c('0x2e')]=_[_0xa39c('0x40')](_0x4ac22b[_0xa39c('0x2e')]);_0x58aae7[_0xa39c('0x2f')]=_['intersection'](_0x58aae7[_0xa39c('0x2d')],_0x58aae7['query']);_0x2fe0ec['attributes']=_['intersection'](_0x58aae7[_0xa39c('0x2d')],qs[_0xa39c('0x32')](_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x32')]));_0x2fe0ec[_0xa39c('0x31')]=_0x2fe0ec['attributes'][_0xa39c('0x33')]?_0x2fe0ec[_0xa39c('0x31')]:_0x58aae7[_0xa39c('0x2d')];if(!_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x49')]('nolimit')){_0x2fe0ec[_0xa39c('0x1c')]=qs[_0xa39c('0x1c')](_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x1c')]);_0x2fe0ec[_0xa39c('0x1b')]=qs[_0xa39c('0x1b')](_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x1b')]);}_0x2fe0ec[_0xa39c('0x35')]=qs['sort'](_0x4ac22b['query'][_0xa39c('0x36')]);_0x2fe0ec[_0xa39c('0x37')]=qs[_0xa39c('0x2f')](_['pick'](_0x4ac22b[_0xa39c('0x2e')],_0x58aae7[_0xa39c('0x2f')]));_0x2fe0ec[_0xa39c('0x37')][_0xa39c('0x4a')]=_0x4b35d1['id'];if(_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x39')]){_0x2fe0ec[_0xa39c('0x37')]=_[_0xa39c('0x3a')](_0x2fe0ec['where'],{'$or':_[_0xa39c('0x29')](_0x2fe0ec[_0xa39c('0x31')],function(_0x56b9f5){var _0xf490de={};_0xf490de[_0x56b9f5]={'$like':'%'+_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x39')]+'%'};return _0xf490de;})});}_0x2fe0ec=_[_0xa39c('0x3a')]({},_0x2fe0ec,_0x4ac22b[_0xa39c('0x4b')]);return db[_0xa39c('0x47')]['count']({'where':_0x2fe0ec[_0xa39c('0x37')]})[_0xa39c('0x23')](function(_0x31015f){_0x5d9782['count']=_0x31015f;if(_0x4ac22b[_0xa39c('0x2e')][_0xa39c('0x3b')]){_0x2fe0ec[_0xa39c('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa39c('0x3d')](_0x2fe0ec);})[_0xa39c('0x23')](function(_0x797b8b){_0x5d9782[_0xa39c('0x4c')]=_0x797b8b;return _0x5d9782;});}})[_0xa39c('0x23')](respondWithFilteredResult(_0x369b66,_0x2fe0ec))[_0xa39c('0x3e')](handleError(_0x369b66,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f47dafc..1e89e95 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions'];(function(_0x21c9e7,_0x1ca4d1){var _0x3fd3ff=function(_0xc5e171){while(--_0xc5e171){_0x21c9e7['push'](_0x21c9e7['shift']());}};_0x3fd3ff(++_0x1ca4d1);}(_0x2d72,0xa8));var _0x22d7=function(_0x459585,_0x35c5bc){_0x459585=_0x459585-0x0;var _0x50835b=_0x2d72[_0x459585];return _0x50835b;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c6=['JscriptySessionReport','util','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x324acc,_0xebc43f){var _0x457156=function(_0x1056cf){while(--_0x1056cf){_0x324acc['push'](_0x324acc['shift']());}};_0x457156(++_0xebc43f);}(_0x81c6,0x1d5));var _0x681c=function(_0x78d8b7,_0x2cfc1d){_0x78d8b7=_0x78d8b7-0x0;var _0x5a979c=_0x81c6[_0x78d8b7];return _0x5a979c;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index d1d55ce..ed60c72 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 _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x8952,0x17e));var _0x2895=function(_0x53581b,_0x16b2fa){_0x53581b=_0x53581b-0x0;var _0x5cfa1b=_0x8952[_0x53581b];return _0x5cfa1b;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file +var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5dd46b,_0x59f8f1){var _0x216630=function(_0x34a341){while(--_0x34a341){_0x5dd46b['push'](_0x5dd46b['shift']());}};_0x216630(++_0x59f8f1);}(_0xef0f,0x168));var _0xfef0=function(_0x15a273,_0x576ced){_0x15a273=_0x15a273-0x0;var _0x43e203=_0xef0f[_0x15a273];return _0x43e203;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9cacf6a..483f917 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 _0x6dec=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0x23812f,_0x3abb06){var _0x1e7ad0=function(_0x324f5a){while(--_0x324f5a){_0x23812f['push'](_0x23812f['shift']());}};_0x1e7ad0(++_0x3abb06);}(_0x6dec,0x10e));var _0xc6de=function(_0x21011a,_0x3d61d0){_0x21011a=_0x21011a-0x0;var _0x42ef68=_0x6dec[_0x21011a];return _0x42ef68;};'use strict';var multer=require(_0xc6de('0x0'));var util=require('util');var path=require(_0xc6de('0x1'));var timeout=require(_0xc6de('0x2'));var express=require(_0xc6de('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6de('0x4'));var interaction=require(_0xc6de('0x5'));var config=require(_0xc6de('0x6'));var controller=require(_0xc6de('0x7'));router[_0xc6de('0x8')]('/',controller[_0xc6de('0x9')]);router[_0xc6de('0xa')](_0xc6de('0xb'),auth[_0xc6de('0xc')](),controller[_0xc6de('0xd')]);module[_0xc6de('0xe')]=router; \ No newline at end of file +var _0xd493=['index','put','/:id','isAuthenticated','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0xd493,0x1bd));var _0x3d49=function(_0x2774a7,_0x370440){_0x2774a7=_0x2774a7-0x0;var _0x5aadbf=_0xd493[_0x2774a7];return _0x5aadbf;};'use strict';var multer=require(_0x3d49('0x0'));var util=require('util');var path=require(_0x3d49('0x1'));var timeout=require(_0x3d49('0x2'));var express=require('express');var router=express[_0x3d49('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3d49('0x4'));var config=require(_0x3d49('0x5'));var controller=require('./license.controller');router['get']('/',controller[_0x3d49('0x6')]);router[_0x3d49('0x7')](_0x3d49('0x8'),auth[_0x3d49('0x9')](),controller['update']);module[_0x3d49('0xa')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index aafa5d5..adac90c 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 _0xc350=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc350,0xde));var _0x0c35=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xc350[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x0c35('0x0'));module[_0x0c35('0x1')]={'license':{'type':Sequelize[_0x0c35('0x2')]},'data1':{'type':Sequelize[_0x0c35('0x3')]},'data2':{'type':Sequelize[_0x0c35('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x0c35('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd076=['STRING','sequelize','exports','TEXT'];(function(_0x2d79e6,_0x405f4b){var _0x5b07bf=function(_0x1ea897){while(--_0x1ea897){_0x2d79e6['push'](_0x2d79e6['shift']());}};_0x5b07bf(++_0x405f4b);}(_0xd076,0xb1));var _0x6d07=function(_0x5ed064,_0x2b0c53){_0x5ed064=_0x5ed064-0x0;var _0x5d56e0=_0xd076[_0x5ed064];return _0x5d56e0;};'use strict';var Sequelize=require(_0x6d07('0x0'));module[_0x6d07('0x1')]={'license':{'type':Sequelize[_0x6d07('0x2')]},'data1':{'type':Sequelize[_0x6d07('0x3')]},'data2':{'type':Sequelize[_0x6d07('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 4f8fbd1..2bde6f5 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 _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','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'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0x7a54,0x106));var _0x47a5=function(_0x10fbd6,_0x5d0234){_0x10fbd6=_0x10fbd6-0x0;var _0x460aab=_0x7a54[_0x10fbd6];return _0x460aab;};'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);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file +var _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3d3c75,_0xe42529){var _0x590a21=function(_0x30aae7){while(--_0x30aae7){_0x3d3c75['push'](_0x3d3c75['shift']());}};_0x590a21(++_0xe42529);}(_0xabce,0x103));var _0xeabc=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xabce[_0x363ef8];return _0x148822;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 96470cb..4e78578 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 _0xd98e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license'];(function(_0x198352,_0x2695c8){var _0x466a2f=function(_0x448f78){while(--_0x448f78){_0x198352['push'](_0x198352['shift']());}};_0x466a2f(++_0x2695c8);}(_0xd98e,0x1ea));var _0xed98=function(_0x568388,_0xb7fd92){_0x568388=_0x568388-0x0;var _0x427c42=_0xd98e[_0x568388];return _0x427c42;};'use strict';var _=require(_0xed98('0x0'));var util=require(_0xed98('0x1'));var logger=require(_0xed98('0x2'))(_0xed98('0x3'));var moment=require(_0xed98('0x4'));var BPromise=require(_0xed98('0x5'));var rp=require(_0xed98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed98('0x7'));var config=require(_0xed98('0x8'));var attributes=require(_0xed98('0x9'));module[_0xed98('0xa')]=function(_0x5ad454,_0x65033f){return _0x5ad454[_0xed98('0xb')](_0xed98('0xc'),attributes,{'tableName':_0xed98('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f3=['request-promise','path','../../config/environment','exports','define','License','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f3,0xec));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var logger=require(_0x354f('0x2'))('api');var moment=require(_0x354f('0x3'));var BPromise=require('bluebird');var rp=require(_0x354f('0x4'));var fs=require('fs');var path=require(_0x354f('0x5'));var rimraf=require('rimraf');var config=require(_0x354f('0x6'));var attributes=require('./license.attributes');module[_0x354f('0x7')]=function(_0x405563,_0x48cfac){return _0x405563[_0x354f('0x8')](_0x354f('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 82fef5f..bccbcf3 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 _0x0d10=['License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x0d10,0x16f));var _0x00d1=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x0d10[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x00d1('0x0'));var rs=require(_0x00d1('0x1'));var fs=require('fs');var Redis=require(_0x00d1('0x2'));var db=require(_0x00d1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x00d1('0x4'));var jayson=require(_0x00d1('0x5'));var client=jayson[_0x00d1('0x6')][_0x00d1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a234,_0x57c695,_0x41a762){return new BPromise(function(_0x5b5f7e,_0x3760a7){return client[_0x00d1('0x8')](_0x21a234,_0x41a762)[_0x00d1('0x9')](function(_0x5a6330){logger[_0x00d1('0xa')](_0x00d1('0xb'),_0x57c695,'request\x20sent');logger[_0x00d1('0xc')](_0x00d1('0xd'),_0x57c695,_0x00d1('0xe'),JSON[_0x00d1('0xf')](_0x5a6330));if(_0x5a6330[_0x00d1('0x10')]){if(_0x5a6330['error'][_0x00d1('0x11')]===0x1f4){logger[_0x00d1('0x10')](_0x00d1('0xb'),_0x57c695,_0x5a6330[_0x00d1('0x10')]['message']);return _0x3760a7(_0x5a6330['error'][_0x00d1('0x12')]);}logger[_0x00d1('0x10')](_0x00d1('0xb'),_0x57c695,_0x5a6330[_0x00d1('0x10')][_0x00d1('0x12')]);return _0x5b5f7e(_0x5a6330[_0x00d1('0x10')][_0x00d1('0x12')]);}else{logger[_0x00d1('0xa')](_0x00d1('0xb'),_0x57c695,_0x00d1('0xe'));_0x5b5f7e(_0x5a6330[_0x00d1('0x13')][_0x00d1('0x12')]);}})['catch'](function(_0x4d4b52){logger['error'](_0x00d1('0xb'),_0x57c695,_0x4d4b52);_0x3760a7(_0x4d4b52);});});} \ No newline at end of file +var _0x09e9=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s'];(function(_0x2a086d,_0x181893){var _0x5e2aad=function(_0x306245){while(--_0x306245){_0x2a086d['push'](_0x2a086d['shift']());}};_0x5e2aad(++_0x181893);}(_0x09e9,0xaf));var _0x909e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x09e9[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x909e('0x0'));var util=require(_0x909e('0x1'));var moment=require(_0x909e('0x2'));var BPromise=require(_0x909e('0x3'));var rs=require(_0x909e('0x4'));var fs=require('fs');var Redis=require(_0x909e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x909e('0x6'))(_0x909e('0x7'));var config=require(_0x909e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x909e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf125,_0x3564cc,_0x413d3b){return new BPromise(function(_0x502424,_0x35b322){return client[_0x909e('0xa')](_0x2cf125,_0x413d3b)[_0x909e('0xb')](function(_0x54e8a5){logger[_0x909e('0xc')](_0x909e('0xd'),_0x3564cc,_0x909e('0xe'));logger[_0x909e('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x3564cc,_0x909e('0xe'),JSON['stringify'](_0x54e8a5));if(_0x54e8a5['error']){if(_0x54e8a5[_0x909e('0x10')][_0x909e('0x11')]===0x1f4){logger[_0x909e('0x10')]('License,\x20%s,\x20%s',_0x3564cc,_0x54e8a5['error'][_0x909e('0x12')]);return _0x35b322(_0x54e8a5[_0x909e('0x10')]['message']);}logger['error'](_0x909e('0xd'),_0x3564cc,_0x54e8a5['error'][_0x909e('0x12')]);return _0x502424(_0x54e8a5[_0x909e('0x10')]['message']);}else{logger[_0x909e('0xc')](_0x909e('0xd'),_0x3564cc,_0x909e('0xe'));_0x502424(_0x54e8a5[_0x909e('0x13')][_0x909e('0x12')]);}})[_0x909e('0x14')](function(_0x42228c){logger[_0x909e('0x10')](_0x909e('0xd'),_0x3564cc,_0x42228c);_0x35b322(_0x42228c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 790a486..87b3596 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 _0x62d1=['../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/send','addAgents','put','update','/:id/dispositions','removeDispositions','delete','removeAnswers','/:id/in_servers','removeSmtp','destroy','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36a294,_0x2a87ee){var _0x312024=function(_0x38da5a){while(--_0x38da5a){_0x36a294['push'](_0x36a294['shift']());}};_0x312024(++_0x2a87ee);}(_0x62d1,0x1e4));var _0x162d=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x62d1[_0x7791d5];return _0x5ce288;};'use strict';var multer=require(_0x162d('0x0'));var util=require(_0x162d('0x1'));var path=require('path');var timeout=require(_0x162d('0x2'));var express=require(_0x162d('0x3'));var router=express[_0x162d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x162d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x162d('0x6'));var controller=require(_0x162d('0x7'));router[_0x162d('0x8')]('/',auth[_0x162d('0x9')](),controller[_0x162d('0xa')]);router['get'](_0x162d('0xb'),auth['isAuthenticated'](),controller[_0x162d('0xc')]);router[_0x162d('0x8')](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0xe')]);router['get']('/:id/dispositions',auth[_0x162d('0x9')](),controller[_0x162d('0xf')]);router[_0x162d('0x8')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x11')]);router[_0x162d('0x8')]('/:id/in_servers',auth[_0x162d('0x9')](),controller[_0x162d('0x12')]);router['get'](_0x162d('0x13'),auth['isAuthenticated'](),controller[_0x162d('0x14')]);router[_0x162d('0x8')](_0x162d('0x15'),auth[_0x162d('0x9')](),controller[_0x162d('0x16')]);router['get'](_0x162d('0x17'),auth[_0x162d('0x9')](),controller['getApplications']);router[_0x162d('0x8')](_0x162d('0x18'),auth['isAuthenticated'](),controller[_0x162d('0x19')]);router[_0x162d('0x8')](_0x162d('0x1a'),auth[_0x162d('0x9')](),controller[_0x162d('0x1b')]);router[_0x162d('0x8')]('/:id/users',auth[_0x162d('0x9')](),controller[_0x162d('0x1c')]);router[_0x162d('0x1d')]('/:id/dispositions',auth[_0x162d('0x9')](),controller[_0x162d('0x1e')]);router[_0x162d('0x1d')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x1f')]);router[_0x162d('0x1d')]('/',auth[_0x162d('0x9')](),controller[_0x162d('0x20')]);router[_0x162d('0x1d')]('/:id/in_servers',auth[_0x162d('0x9')](),controller[_0x162d('0x21')]);router[_0x162d('0x1d')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x162d('0x22')]);router[_0x162d('0x1d')](_0x162d('0x15'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x162d('0x1d')](_0x162d('0x17'),auth[_0x162d('0x9')](),controller['addApplications']);router['post'](_0x162d('0x23'),auth['isAuthenticated'](),controller['send']);router[_0x162d('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x162d('0x24')]);router[_0x162d('0x25')](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0x26')]);router['delete'](_0x162d('0x27'),auth[_0x162d('0x9')](),controller[_0x162d('0x28')]);router[_0x162d('0x29')](_0x162d('0x10'),auth[_0x162d('0x9')](),controller[_0x162d('0x2a')]);router['delete'](_0x162d('0x2b'),auth['isAuthenticated'](),controller['removeImap']);router[_0x162d('0x29')](_0x162d('0x13'),auth[_0x162d('0x9')](),controller[_0x162d('0x2c')]);router['delete'](_0x162d('0xd'),auth[_0x162d('0x9')](),controller[_0x162d('0x2d')]);router[_0x162d('0x29')](_0x162d('0x2e'),auth[_0x162d('0x9')](),controller[_0x162d('0x2f')]);module[_0x162d('0x30')]=router; \ No newline at end of file +var _0x5475=['/:id','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','addAnswer','post','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put'];(function(_0x1d660d,_0x15803f){var _0x140ce2=function(_0x12883a){while(--_0x12883a){_0x1d660d['push'](_0x1d660d['shift']());}};_0x140ce2(++_0x15803f);}(_0x5475,0x188));var _0x5547=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x5475[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x5547('0x0'));var util=require(_0x5547('0x1'));var path=require(_0x5547('0x2'));var timeout=require('connect-timeout');var express=require(_0x5547('0x3'));var router=express[_0x5547('0x4')]();var fs_extra=require(_0x5547('0x5'));var auth=require(_0x5547('0x6'));var interaction=require(_0x5547('0x7'));var config=require(_0x5547('0x8'));var controller=require(_0x5547('0x9'));router[_0x5547('0xa')]('/',auth[_0x5547('0xb')](),controller[_0x5547('0xc')]);router[_0x5547('0xa')]('/describe',auth[_0x5547('0xb')](),controller[_0x5547('0xd')]);router[_0x5547('0xa')]('/:id',auth[_0x5547('0xb')](),controller[_0x5547('0xe')]);router[_0x5547('0xa')](_0x5547('0xf'),auth[_0x5547('0xb')](),controller[_0x5547('0x10')]);router['get'](_0x5547('0x11'),auth[_0x5547('0xb')](),controller[_0x5547('0x12')]);router[_0x5547('0xa')](_0x5547('0x13'),auth[_0x5547('0xb')](),controller[_0x5547('0x14')]);router[_0x5547('0xa')](_0x5547('0x15'),auth[_0x5547('0xb')](),controller[_0x5547('0x16')]);router[_0x5547('0xa')]('/:id/interactions',auth[_0x5547('0xb')](),controller['getInteractions']);router['get'](_0x5547('0x17'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x5547('0x18'),auth['isAuthenticated'](),controller[_0x5547('0x19')]);router[_0x5547('0xa')](_0x5547('0x1a'),auth[_0x5547('0xb')](),controller[_0x5547('0x1b')]);router[_0x5547('0xa')](_0x5547('0x1c'),auth[_0x5547('0xb')](),controller[_0x5547('0x1d')]);router['post'](_0x5547('0xf'),auth['isAuthenticated'](),controller[_0x5547('0x1e')]);router['post'](_0x5547('0x11'),auth[_0x5547('0xb')](),controller[_0x5547('0x1f')]);router[_0x5547('0x20')]('/',auth[_0x5547('0xb')](),controller['create']);router[_0x5547('0x20')](_0x5547('0x13'),auth['isAuthenticated'](),controller[_0x5547('0x21')]);router[_0x5547('0x20')](_0x5547('0x15'),auth[_0x5547('0xb')](),controller[_0x5547('0x22')]);router[_0x5547('0x20')]('/:id/interactions',auth[_0x5547('0xb')](),controller[_0x5547('0x23')]);router['post'](_0x5547('0x17'),auth[_0x5547('0xb')](),controller[_0x5547('0x24')]);router[_0x5547('0x20')]('/:id/send',auth['isAuthenticated'](),controller[_0x5547('0x25')]);router[_0x5547('0x20')](_0x5547('0x1c'),auth[_0x5547('0xb')](),controller[_0x5547('0x26')]);router[_0x5547('0x27')](_0x5547('0x28'),auth[_0x5547('0xb')](),controller[_0x5547('0x29')]);router[_0x5547('0x2a')](_0x5547('0xf'),auth[_0x5547('0xb')](),controller[_0x5547('0x2b')]);router[_0x5547('0x2a')](_0x5547('0x11'),auth[_0x5547('0xb')](),controller[_0x5547('0x2c')]);router['delete'](_0x5547('0x13'),auth[_0x5547('0xb')](),controller[_0x5547('0x2d')]);router[_0x5547('0x2a')](_0x5547('0x15'),auth[_0x5547('0xb')](),controller['removeSmtp']);router[_0x5547('0x2a')](_0x5547('0x28'),auth[_0x5547('0xb')](),controller[_0x5547('0x2e')]);router[_0x5547('0x2a')](_0x5547('0x1c'),auth[_0x5547('0xb')](),controller[_0x5547('0x2f')]);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 347176b..68ed34f 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 _0x8819=['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','setDataValue','mandatoryDispositionPauseId','STRING','BOOLEAN'];(function(_0x17cdcc,_0x29d5de){var _0x38f5f6=function(_0x55f444){while(--_0x55f444){_0x17cdcc['push'](_0x17cdcc['shift']());}};_0x38f5f6(++_0x29d5de);}(_0x8819,0x94));var _0x9881=function(_0x2bcc70,_0xb85e75){_0x2bcc70=_0x2bcc70-0x0;var _0x4c1247=_0x8819[_0x2bcc70];return _0x4c1247;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9881('0x0')]},'name':{'type':Sequelize[_0x9881('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x9881('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9881('0x1')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9881('0x2')]},'markAsUnread':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9881('0x0')],'allowNull':![],'defaultValue':_0x9881('0x3')},'fontSize':{'type':Sequelize[_0x9881('0x4')](0x2)[_0x9881('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9881('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9881('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9881('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x9881('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1df0ba){if(!_0x1df0ba)this[_0x9881('0x8')](_0x9881('0x9'),null);this[_0x9881('0x8')]('mandatoryDisposition',_0x1df0ba);}}}; \ No newline at end of file +var _0xce50=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports'];(function(_0x5beec9,_0x5551de){var _0x20d488=function(_0xde0c66){while(--_0xde0c66){_0x5beec9['push'](_0x5beec9['shift']());}};_0x20d488(++_0x5551de);}(_0xce50,0x1d8));var _0x0ce5=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xce50[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require('sequelize');module[_0x0ce5('0x0')]={'description':{'type':Sequelize[_0x0ce5('0x1')]},'name':{'type':Sequelize[_0x0ce5('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x0ce5('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x0ce5('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ce5('0x4')},'fontSize':{'type':Sequelize[_0x0ce5('0x5')](0x2)[_0x0ce5('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0ce5('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0ce5('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ce5('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x0ce5('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0ce5('0x8'),'set':function(_0x2b5559){if(!_0x2b5559)this[_0x0ce5('0x9')](_0x0ce5('0xa'),null);this[_0x0ce5('0x9')]('mandatoryDisposition',_0x2b5559);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index bacbf0f..9624a65 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 _0xdbe3=['filter','merge','includeAll','show','params','Pause','keys','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','length','hasOwnProperty','nolimit','order','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','ListId','active','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','pick','CmContact','Contact','User','fullname','internal','Tag','Tags','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','updatedAt','DESC','isNil','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','Sequelize','ValidationError','addAgents','omit','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','sort','where'];(function(_0x4cb219,_0x1a4765){var _0x5cf899=function(_0x127a17){while(--_0x127a17){_0x4cb219['push'](_0x4cb219['shift']());}};_0x5cf899(++_0x1a4765);}(_0xdbe3,0x135));var _0x3dbe=function(_0x1b70b7,_0x3c3737){_0x1b70b7=_0x1b70b7-0x0;var _0x5348ff=_0xdbe3[_0x1b70b7];return _0x5348ff;};'use strict';var emlformat=require(_0x3dbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dbe('0x1'));var jsonpatch=require(_0x3dbe('0x2'));var rp=require(_0x3dbe('0x3'));var moment=require(_0x3dbe('0x4'));var BPromise=require(_0x3dbe('0x5'));var Mustache=require(_0x3dbe('0x6'));var util=require('util');var path=require(_0x3dbe('0x7'));var sox=require(_0x3dbe('0x8'));var csv=require(_0x3dbe('0x9'));var ejs=require(_0x3dbe('0xa'));var fs=require('fs');var fs_extra=require(_0x3dbe('0xb'));var _=require(_0x3dbe('0xc'));var squel=require(_0x3dbe('0xd'));var crypto=require('crypto');var jsforce=require(_0x3dbe('0xe'));var deskjs=require(_0x3dbe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3dbe('0x10'));var Papa=require(_0x3dbe('0x11'));var htmlToText=require(_0x3dbe('0x12'));var juice=require(_0x3dbe('0x13'));var Redis=require(_0x3dbe('0x14'));var authService=require(_0x3dbe('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dbe('0x16'));var logger=require('../../config/logger')(_0x3dbe('0x17'));var utils=require(_0x3dbe('0x18'));var config=require(_0x3dbe('0x19'));var licenseUtil=require(_0x3dbe('0x1a'));var db=require(_0x3dbe('0x1b'))['db'];config[_0x3dbe('0x1c')]=_[_0x3dbe('0x1d')](config[_0x3dbe('0x1c')],{'host':_0x3dbe('0x1e'),'port':0x18eb});var socket=require(_0x3dbe('0x1f'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x3dbe('0x20')](socket);var jayson=require(_0x3dbe('0x21'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x40c7c9,_0x38a5fa,_0x311940,_0x155305){return new BPromise(function(_0x3a615a,_0x4c318e){var _0x2803de=_0x155305||client;return _0x2803de[_0x3dbe('0x22')](_0x40c7c9,_0x311940)[_0x3dbe('0x23')](function(_0x556869){logger[_0x3dbe('0x24')](_0x3dbe('0x25'),_0x38a5fa,_0x3dbe('0x26'));logger['debug'](_0x3dbe('0x27'),_0x38a5fa,_0x3dbe('0x26'),JSON['stringify'](_0x556869));if(_0x556869[_0x3dbe('0x28')]){if(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x29')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x38a5fa,_0x556869[_0x3dbe('0x28')]['message']);return _0x4c318e(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);}logger[_0x3dbe('0x28')](_0x3dbe('0x25'),_0x38a5fa,_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);return _0x3a615a(_0x556869[_0x3dbe('0x28')][_0x3dbe('0x2a')]);}else{logger[_0x3dbe('0x24')](_0x3dbe('0x25'),_0x38a5fa,_0x3dbe('0x26'));_0x3a615a(_0x556869[_0x3dbe('0x2b')]['message']);}})[_0x3dbe('0x2c')](function(_0x3cf0b0){logger[_0x3dbe('0x28')](_0x3dbe('0x25'),_0x38a5fa,_0x3cf0b0);_0x4c318e(_0x3cf0b0);});});}function respondWithStatusCode(_0x4417d7,_0x59451b){_0x59451b=_0x59451b||0xcc;return function(_0x227de8){if(_0x227de8){return _0x4417d7[_0x3dbe('0x2d')](_0x59451b);}return _0x4417d7['status'](_0x59451b)[_0x3dbe('0x2e')]();};}function respondWithResult(_0x580cdf,_0x29d062){_0x29d062=_0x29d062||0xc8;return function(_0x8dfdb6){if(_0x8dfdb6){return _0x580cdf[_0x3dbe('0x2f')](_0x29d062)[_0x3dbe('0x30')](_0x8dfdb6);}};}function respondWithFilteredResult(_0x46b908,_0x4c56f4){return function(_0xdc71e5){if(_0xdc71e5){var _0x20ec62=typeof _0x4c56f4[_0x3dbe('0x31')]==='undefined'&&typeof _0x4c56f4[_0x3dbe('0x32')]==='undefined';var _0x3ac866=_0xdc71e5[_0x3dbe('0x33')];var _0x416de6=_0x20ec62?0x0:_0x4c56f4[_0x3dbe('0x31')];var _0x452065=_0x20ec62?_0xdc71e5[_0x3dbe('0x33')]:_0x4c56f4[_0x3dbe('0x31')]+_0x4c56f4[_0x3dbe('0x32')];var _0x1343ab;if(_0x452065>=_0x3ac866){_0x452065=_0x3ac866;_0x1343ab=0xc8;}else{_0x1343ab=0xce;}_0x46b908[_0x3dbe('0x2f')](_0x1343ab);return _0x46b908[_0x3dbe('0x34')](_0x3dbe('0x35'),_0x416de6+'-'+_0x452065+'/'+_0x3ac866)[_0x3dbe('0x30')](_0xdc71e5);}return null;};}function patchUpdates(_0x2876d1){return function(_0xdffea7){try{jsonpatch['apply'](_0xdffea7,_0x2876d1,!![]);}catch(_0x52b840){return BPromise[_0x3dbe('0x36')](_0x52b840);}return _0xdffea7[_0x3dbe('0x37')]();};}function saveUpdates(_0x3e36c3,_0x45e272){return function(_0x49a1df){if(_0x49a1df){return _0x49a1df[_0x3dbe('0x38')](_0x3e36c3)[_0x3dbe('0x23')](function(_0xf29cc9){return _0xf29cc9;});}return null;};}function removeEntity(_0x37859e,_0x357ac8){return function(_0x149c9f){if(_0x149c9f){return _0x149c9f[_0x3dbe('0x39')]()[_0x3dbe('0x23')](function(){var _0x2f88c9=_0x149c9f['get']({'plain':!![]});var _0x50df69=_0x3dbe('0x3a');return db[_0x3dbe('0x3b')]['destroy']({'where':{'type':_0x50df69,'resourceId':_0x2f88c9['id']}})[_0x3dbe('0x23')](function(){return _0x149c9f;});})[_0x3dbe('0x23')](function(){_0x37859e[_0x3dbe('0x2f')](0xcc)[_0x3dbe('0x2e')]();});}};}function handleEntityNotFound(_0x37690f,_0x17ced6){return function(_0x1a6cca){if(!_0x1a6cca){_0x37690f[_0x3dbe('0x2d')](0x194);}return _0x1a6cca;};}function handleError(_0x5c160d,_0x38b47b){_0x38b47b=_0x38b47b||0x1f4;return function(_0x6967c6){logger['error'](_0x6967c6[_0x3dbe('0x3c')]);if(_0x6967c6[_0x3dbe('0x3d')]){delete _0x6967c6[_0x3dbe('0x3d')];}_0x5c160d['status'](_0x38b47b)[_0x3dbe('0x3e')](_0x6967c6);};}exports[_0x3dbe('0x3f')]=function(_0x4c9703,_0xb8925d){var _0x19dfa4={'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db[_0x3dbe('0x42')],'as':_0x3dbe('0x43')},{'model':db['Pause'],'as':_0x3dbe('0x44')}]},_0x5581da={},_0x57aebf={'count':0x0,'rows':[]};var _0x4d00ad=_[_0x3dbe('0x45')](db[_0x3dbe('0x46')][_0x3dbe('0x47')],function(_0x9411a7){return{'name':_0x9411a7[_0x3dbe('0x48')],'type':_0x9411a7[_0x3dbe('0x49')][_0x3dbe('0x4a')]};});_0x5581da[_0x3dbe('0x4b')]=_[_0x3dbe('0x45')](_0x4d00ad,_0x3dbe('0x3d'));_0x5581da[_0x3dbe('0x4c')]=_['keys'](_0x4c9703[_0x3dbe('0x4c')]);_0x5581da[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x5581da[_0x3dbe('0x4b')],_0x5581da[_0x3dbe('0x4c')]);_0x19dfa4['attributes']=_[_0x3dbe('0x4e')](_0x5581da[_0x3dbe('0x4b')],qs['fields'](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x19dfa4[_0x3dbe('0x50')]=_0x19dfa4[_0x3dbe('0x50')]['length']?_0x19dfa4[_0x3dbe('0x50')]:_0x5581da[_0x3dbe('0x4b')];if(!_0x4c9703[_0x3dbe('0x4c')]['hasOwnProperty']('nolimit')){_0x19dfa4[_0x3dbe('0x32')]=qs['limit'](_0x4c9703['query'][_0x3dbe('0x32')]);_0x19dfa4['offset']=qs[_0x3dbe('0x31')](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x19dfa4['order']=qs[_0x3dbe('0x51')](_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x19dfa4[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x4c9703['query'],_0x5581da[_0x3dbe('0x4d')]),_0x4d00ad);if(_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x19dfa4[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x19dfa4[_0x3dbe('0x52')],{'$or':_['map'](_0x4d00ad,function(_0x4632ef){if(_0x4632ef['type']!=='VIRTUAL'){var _0x5272d1={};_0x5272d1[_0x4632ef[_0x3dbe('0x3d')]]={'$like':'%'+_0x4c9703[_0x3dbe('0x4c')]['filter']+'%'};return _0x5272d1;}})});}_0x19dfa4=_[_0x3dbe('0x54')]({},_0x19dfa4,_0x4c9703['options']);var _0xe9b683={'where':_0x19dfa4[_0x3dbe('0x52')]};return db[_0x3dbe('0x46')]['count'](_0xe9b683)[_0x3dbe('0x23')](function(_0x4e42dd){_0x57aebf[_0x3dbe('0x33')]=_0x4e42dd;if(_0x4c9703[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x19dfa4['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x19dfa4);})['then'](function(_0x4fbe5b){_0x57aebf['rows']=_0x4fbe5b;return _0x57aebf;})['then'](respondWithFilteredResult(_0xb8925d,_0x19dfa4))[_0x3dbe('0x2c')](handleError(_0xb8925d,null));};exports[_0x3dbe('0x56')]=function(_0x4e9a29,_0x1c798d){var _0x9b301b={'raw':![],'where':{'id':_0x4e9a29[_0x3dbe('0x57')]['id']},'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db[_0x3dbe('0x42')],'as':'Smtp'},{'model':db[_0x3dbe('0x58')],'as':_0x3dbe('0x44')}]},_0x734899={};_0x734899['model']=_[_0x3dbe('0x59')](db['MailAccount'][_0x3dbe('0x47')]);_0x734899['query']=_['keys'](_0x4e9a29['query']);_0x734899[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x734899[_0x3dbe('0x4b')],_0x734899[_0x3dbe('0x4c')]);_0x9b301b['attributes']=_[_0x3dbe('0x4e')](_0x734899[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x4e9a29[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x9b301b[_0x3dbe('0x50')]=_0x9b301b[_0x3dbe('0x50')]['length']?_0x9b301b[_0x3dbe('0x50')]:_0x734899[_0x3dbe('0x4b')];if(_0x4e9a29[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x9b301b['include']=[{'all':!![]}];}_0x9b301b=_[_0x3dbe('0x54')]({},_0x9b301b,_0x4e9a29[_0x3dbe('0x5a')]);return db[_0x3dbe('0x46')][_0x3dbe('0x5b')](_0x9b301b)[_0x3dbe('0x23')](handleEntityNotFound(_0x1c798d,null))[_0x3dbe('0x23')](respondWithResult(_0x1c798d,null))[_0x3dbe('0x2c')](handleError(_0x1c798d,null));};exports['update']=function(_0x55f122,_0x356a71){if(_0x55f122[_0x3dbe('0x5c')]['id']){delete _0x55f122[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x55f122['params']['id']},'include':[{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3dbe('0x58')],'as':_0x3dbe('0x44')}]})[_0x3dbe('0x23')](handleEntityNotFound(_0x356a71,null))[_0x3dbe('0x23')](saveUpdates(_0x55f122[_0x3dbe('0x5c')],null))['then'](function(_0x8fe50c){if(_0x8fe50c&&_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x41')]){return db[_0x3dbe('0x40')]['update'](_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x41')],{'where':{'MailAccountId':_0x8fe50c['id']}})[_0x3dbe('0x23')](function(){return _0x8fe50c;});}return _0x8fe50c;})[_0x3dbe('0x23')](function(_0x52f7fd){if(_0x52f7fd&&_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x43')]){return db[_0x3dbe('0x42')]['update'](_0x55f122[_0x3dbe('0x5c')][_0x3dbe('0x43')],{'where':{'MailAccountId':_0x52f7fd['id']}})[_0x3dbe('0x23')](function(){return _0x52f7fd;});}return _0x52f7fd;})['then'](respondWithResult(_0x356a71,null))[_0x3dbe('0x2c')](handleError(_0x356a71,null));};exports[_0x3dbe('0x5d')]=function(_0x3d1ab1,_0x30300a){return db[_0x3dbe('0x46')]['describe']()['then'](respondWithResult(_0x30300a,null))['catch'](handleError(_0x30300a,null));};exports[_0x3dbe('0x5e')]=function(_0x4875c0,_0x3dcbf1,_0x142d14){if(_0x4875c0[_0x3dbe('0x5c')]['id']){delete _0x4875c0[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x4875c0[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3dcbf1,null))[_0x3dbe('0x23')](function(_0x2b50a0){if(_0x2b50a0){_0x4875c0[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x2b50a0['id'];return db[_0x3dbe('0x60')][_0x3dbe('0x61')](_0x4875c0['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x3dcbf1,null))[_0x3dbe('0x2c')](handleError(_0x3dcbf1,null));};exports['getDispositions']=function(_0x40cce9,_0xb5f1b2,_0x5c7b39){var _0x399798={'raw':![],'where':{}};var _0x4624fa={};var _0xfd490d={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x40cce9[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xb5f1b2,null))[_0x3dbe('0x23')](function(_0x3b0558){if(_0x3b0558){_0x4624fa[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x60')][_0x3dbe('0x47')]);_0x4624fa[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x40cce9[_0x3dbe('0x4c')]);_0x4624fa[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x4624fa[_0x3dbe('0x4b')],_0x4624fa[_0x3dbe('0x4c')]);_0x399798[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x4624fa[_0x3dbe('0x4b')],qs['fields'](_0x40cce9[_0x3dbe('0x4c')]['fields']));_0x399798[_0x3dbe('0x50')]=_0x399798[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x399798[_0x3dbe('0x50')]:_0x4624fa[_0x3dbe('0x4b')];if(!_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x399798[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0x40cce9['query']['limit']);_0x399798[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x399798[_0x3dbe('0x65')]=qs['sort'](_0x40cce9[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x399798[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_['pick'](_0x40cce9[_0x3dbe('0x4c')],_0x4624fa[_0x3dbe('0x4d')]));_0x399798['where'][_0x3dbe('0x5f')]=_0x3b0558['id'];if(_0x40cce9['query'][_0x3dbe('0x53')]){_0x399798['where']=_[_0x3dbe('0x54')](_0x399798['where'],{'$or':_[_0x3dbe('0x45')](_0x399798['attributes'],function(_0x55eccc){var _0xfb5cfa={};_0xfb5cfa[_0x55eccc]={'$like':'%'+_0x40cce9[_0x3dbe('0x4c')]['filter']+'%'};return _0xfb5cfa;})});}_0x399798=_[_0x3dbe('0x54')]({},_0x399798,_0x40cce9[_0x3dbe('0x5a')]);return db[_0x3dbe('0x60')][_0x3dbe('0x33')]({'where':_0x399798[_0x3dbe('0x52')]})['then'](function(_0x25034c){_0xfd490d[_0x3dbe('0x33')]=_0x25034c;if(_0x40cce9['query'][_0x3dbe('0x55')]){_0x399798[_0x3dbe('0x66')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x399798);})[_0x3dbe('0x23')](function(_0x4e74d8){_0xfd490d[_0x3dbe('0x67')]=_0x4e74d8;return _0xfd490d;});}})['then'](respondWithFilteredResult(_0xb5f1b2,_0x399798))[_0x3dbe('0x2c')](handleError(_0xb5f1b2,null));};exports[_0x3dbe('0x68')]=function(_0x1b0bd2,_0xb974b9,_0x1730fc){return db['MailAccount'][_0x3dbe('0x5b')]({'where':{'id':_0x1b0bd2[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xb974b9,null))[_0x3dbe('0x23')](function(_0x1567e9){if(_0x1567e9){return _0x1567e9[_0x3dbe('0x68')](_0x1b0bd2[_0x3dbe('0x4c')][_0x3dbe('0x69')]);}})[_0x3dbe('0x23')](respondWithStatusCode(_0xb974b9,null))[_0x3dbe('0x2c')](handleError(_0xb974b9,null));};exports[_0x3dbe('0x6a')]=function(_0x1df1ac,_0x18c8cc,_0x8d5ae2){if(_0x1df1ac['body']['id']){delete _0x1df1ac[_0x3dbe('0x5c')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1df1ac[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x18c8cc,null))[_0x3dbe('0x23')](function(_0x1afd27){if(_0x1afd27){_0x1df1ac[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x1afd27['id'];return db[_0x3dbe('0x6b')][_0x3dbe('0x61')](_0x1df1ac[_0x3dbe('0x5c')]);}})[_0x3dbe('0x23')](respondWithResult(_0x18c8cc,null))[_0x3dbe('0x2c')](handleError(_0x18c8cc,null));};exports[_0x3dbe('0x6c')]=function(_0x239e14,_0x2fbbeb,_0x11c2fc){var _0x223500={'raw':![],'where':{}};var _0x30447b={};var _0x6e1c81={'count':0x0,'rows':[]};return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x239e14[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x2fbbeb,null))[_0x3dbe('0x23')](function(_0x109a90){if(_0x109a90){_0x30447b[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db['CannedAnswer']['rawAttributes']);_0x30447b[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x239e14[_0x3dbe('0x4c')]);_0x30447b['filters']=_[_0x3dbe('0x4e')](_0x30447b[_0x3dbe('0x4b')],_0x30447b[_0x3dbe('0x4c')]);_0x223500[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x30447b[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x223500[_0x3dbe('0x50')]=_0x223500[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x223500['attributes']:_0x30447b[_0x3dbe('0x4b')];if(!_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x63')]('nolimit')){_0x223500[_0x3dbe('0x32')]=qs['limit'](_0x239e14['query'][_0x3dbe('0x32')]);_0x223500[_0x3dbe('0x31')]=qs['offset'](_0x239e14['query'][_0x3dbe('0x31')]);}_0x223500[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x223500[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x239e14[_0x3dbe('0x4c')],_0x30447b[_0x3dbe('0x4d')]));_0x223500[_0x3dbe('0x52')][_0x3dbe('0x5f')]=_0x109a90['id'];if(_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x223500[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x223500[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x223500[_0x3dbe('0x50')],function(_0x19afb9){var _0x626cc7={};_0x626cc7[_0x19afb9]={'$like':'%'+_0x239e14[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x626cc7;})});}_0x223500=_[_0x3dbe('0x54')]({},_0x223500,_0x239e14[_0x3dbe('0x5a')]);return db['CannedAnswer']['count']({'where':_0x223500[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x366732){_0x6e1c81[_0x3dbe('0x33')]=_0x366732;if(_0x239e14[_0x3dbe('0x4c')]['includeAll']){_0x223500['include']=[{'all':!![]}];}return db[_0x3dbe('0x6b')][_0x3dbe('0x6e')](_0x223500);})[_0x3dbe('0x23')](function(_0x518d14){_0x6e1c81[_0x3dbe('0x67')]=_0x518d14;return _0x6e1c81;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x2fbbeb,_0x223500))[_0x3dbe('0x2c')](handleError(_0x2fbbeb,null));};exports[_0x3dbe('0x6f')]=function(_0x397d88,_0x3abe17,_0x11b1c2){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x397d88['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3abe17,null))[_0x3dbe('0x23')](function(_0x88cec5){if(_0x88cec5){return _0x88cec5['removeAnswers'](_0x397d88[_0x3dbe('0x4c')][_0x3dbe('0x69')]);}})['then'](respondWithStatusCode(_0x3abe17,null))[_0x3dbe('0x2c')](handleError(_0x3abe17,null));};exports[_0x3dbe('0x61')]=function(_0x1b229d,_0x47c7f5){var _0x4f2237={'name':_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x3d')],'key':_0x1b229d[_0x3dbe('0x5c')]['key'],'email':_0x1b229d[_0x3dbe('0x5c')]['email'],'ListId':_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x70')],'active':!_['isNil'](_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x71')])?_0x1b229d['body'][_0x3dbe('0x71')]:!![],'description':_0x1b229d[_0x3dbe('0x5c')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x72')])){if(_0x1b229d['body']['cauthentication']){_0x4f2237['Imap'][_0x3dbe('0x73')]=_0x4f2237[_0x3dbe('0x43')]['user']=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x74')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x75')]=_0x4f2237['Smtp'][_0x3dbe('0x76')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x77')];}else{_0x4f2237['Imap'][_0x3dbe('0x78')]=_0x4f2237['Smtp'][_0x3dbe('0x78')]=![];}_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x79')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x41')][_0x3dbe('0x79')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x7a')]=_0x1b229d['body'][_0x3dbe('0x41')][_0x3dbe('0x7a')];_0x4f2237['Smtp'][_0x3dbe('0x79')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x43')][_0x3dbe('0x79')];_0x4f2237[_0x3dbe('0x43')][_0x3dbe('0x7a')]=_0x1b229d['body'][_0x3dbe('0x43')][_0x3dbe('0x7a')];}else{_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x7b')]=_0x4f2237['Smtp'][_0x3dbe('0x7b')]=_0x1b229d[_0x3dbe('0x5c')]['cservice'];_0x4f2237['Imap'][_0x3dbe('0x73')]=_0x4f2237['Smtp'][_0x3dbe('0x73')]=_0x1b229d['body'][_0x3dbe('0x74')];_0x4f2237[_0x3dbe('0x41')][_0x3dbe('0x75')]=_0x4f2237[_0x3dbe('0x43')][_0x3dbe('0x76')]=_0x1b229d[_0x3dbe('0x5c')][_0x3dbe('0x77')];}return db[_0x3dbe('0x46')]['create'](_0x4f2237,{'include':[{'model':db[_0x3dbe('0x42')],'as':_0x3dbe('0x43')},{'model':db[_0x3dbe('0x40')],'as':_0x3dbe('0x41')}]})[_0x3dbe('0x23')](function(_0x237949){var _0x25c4f7=_0x1b229d[_0x3dbe('0x73')]['get']({'plain':!![]});if(!_0x25c4f7)throw new Error(_0x3dbe('0x7c'));if(_0x25c4f7[_0x3dbe('0x7d')]===_0x3dbe('0x73')){var _0xe431a2=_0x237949[_0x3dbe('0x7e')]({'plain':!![]});return db[_0x3dbe('0x7f')][_0x3dbe('0x5b')]({'where':{'name':_0x3dbe('0x3a'),'userProfileId':_0x25c4f7[_0x3dbe('0x80')]},'raw':!![]})[_0x3dbe('0x23')](function(_0x3eb8bb){if(_0x3eb8bb&&_0x3eb8bb[_0x3dbe('0x81')]===0x0){return db[_0x3dbe('0x3b')][_0x3dbe('0x61')]({'name':_0xe431a2['name'],'resourceId':_0xe431a2['id'],'type':_0x3eb8bb[_0x3dbe('0x3d')],'sectionId':_0x3eb8bb['id']},{})[_0x3dbe('0x23')](function(){return _0x237949;});}else{return _0x237949;}})[_0x3dbe('0x2c')](function(_0x4f5f79){logger[_0x3dbe('0x28')](_0x3dbe('0x82'),_0x4f5f79);throw _0x4f5f79;});}return _0x237949;})[_0x3dbe('0x23')](respondWithResult(_0x47c7f5,0xc9))[_0x3dbe('0x2c')](handleError(_0x47c7f5,null));};exports[_0x3dbe('0x83')]=function(_0x105262,_0xc786d6,_0x3bd46f){return db['MailAccount']['findOne']({'where':{'id':_0x105262[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xc786d6,null))[_0x3dbe('0x23')](function(_0x3b52bb){if(_0x3b52bb){return _0x3b52bb[_0x3dbe('0x83')]();}return null;})[_0x3dbe('0x23')](respondWithResult(_0xc786d6,null))['catch'](handleError(_0xc786d6,null));};exports[_0x3dbe('0x84')]=function(_0x596e0a,_0x293c98,_0x3cf0ff){if(_0x596e0a['body']['id']){delete _0x596e0a[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x596e0a[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x293c98,null))[_0x3dbe('0x23')](function(_0x1021a4){if(_0x1021a4){_0x596e0a[_0x3dbe('0x5c')][_0x3dbe('0x5f')]=_0x1021a4['id'];return db[_0x3dbe('0x40')][_0x3dbe('0x61')](_0x596e0a['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x293c98,null))[_0x3dbe('0x2c')](handleError(_0x293c98,null));};exports[_0x3dbe('0x85')]=function(_0x300752,_0xd475e9,_0x10eaa6){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x300752[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0xd475e9,null))[_0x3dbe('0x23')](function(_0xdedb08){if(_0xdedb08){return _0xdedb08[_0x3dbe('0x86')](null);}return null;})[_0x3dbe('0x23')](respondWithStatusCode(_0xd475e9,null))['catch'](handleError(_0xd475e9,null));};exports[_0x3dbe('0x87')]=function(_0xc6cbb9,_0x5bde0c,_0x10d7fb){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0xc6cbb9[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x5bde0c,null))[_0x3dbe('0x23')](function(_0x561316){if(_0x561316){return _0x561316[_0x3dbe('0x87')]();}return null;})['then'](respondWithResult(_0x5bde0c,null))[_0x3dbe('0x2c')](handleError(_0x5bde0c,null));};exports[_0x3dbe('0x88')]=function(_0x2a3b24,_0x497ecd,_0x44a05f){if(_0x2a3b24[_0x3dbe('0x5c')]['id']){delete _0x2a3b24[_0x3dbe('0x5c')]['id'];}return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x2a3b24['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x497ecd,null))['then'](function(_0x2b3d6b){if(_0x2b3d6b){_0x2a3b24['body'][_0x3dbe('0x5f')]=_0x2b3d6b['id'];return db[_0x3dbe('0x42')][_0x3dbe('0x61')](_0x2a3b24['body']);}})[_0x3dbe('0x23')](respondWithResult(_0x497ecd,null))['catch'](handleError(_0x497ecd,null));};exports[_0x3dbe('0x89')]=function(_0x4edb8a,_0x1ea187,_0x5af1db){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x4edb8a[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x1ea187,null))[_0x3dbe('0x23')](function(_0x3e9922){if(_0x3e9922){return _0x3e9922[_0x3dbe('0x8a')](null);}return null;})[_0x3dbe('0x23')](respondWithStatusCode(_0x1ea187,null))[_0x3dbe('0x2c')](handleError(_0x1ea187,null));};exports[_0x3dbe('0x8b')]=function(_0xde1018,_0x149651,_0x1bcb47){return db[_0x3dbe('0x8c')][_0x3dbe('0x5b')]({'where':{'id':_0xde1018[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x149651,null))[_0x3dbe('0x23')](function(_0x263114){if(_0x263114){return _0x263114['addInteraction'](_0xde1018[_0x3dbe('0x5c')]['ids'],_['omit'](_0xde1018[_0x3dbe('0x5c')],[_0x3dbe('0x69'),'id'])||{});}})['then'](respondWithResult(_0x149651,null))[_0x3dbe('0x2c')](handleError(_0x149651,null));};exports[_0x3dbe('0x8d')]=function(_0xe2b6e5,_0x53c4da,_0x593803){var _0x461409={'raw':![],'where':{}};var _0x4d2ae4={};var _0x5ca8c5={'count':0x0,'rows':[]};return db['MailAccount'][_0x3dbe('0x6d')]({'where':{'id':_0xe2b6e5[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x53c4da,null))[_0x3dbe('0x23')](function(_0x5f2e05){if(_0x5f2e05){_0x4d2ae4[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x8c')][_0x3dbe('0x47')]);_0x4d2ae4[_0x3dbe('0x4c')]=_['keys'](_0xe2b6e5['query']);_0x4d2ae4[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x4d2ae4['model'],_0x4d2ae4['query']);_0x461409[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x4d2ae4[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x461409[_0x3dbe('0x50')]=_0x461409[_0x3dbe('0x50')]['length']?_0x461409[_0x3dbe('0x50')]:_0x4d2ae4[_0x3dbe('0x4b')];if(!_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x461409[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x461409[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0xe2b6e5[_0x3dbe('0x4c')]['offset']);}_0x461409['order']=qs[_0x3dbe('0x51')](_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x461409[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_[_0x3dbe('0x8e')](_0xe2b6e5[_0x3dbe('0x4c')],_0x4d2ae4[_0x3dbe('0x4d')]));_0x461409[_0x3dbe('0x52')][_0x3dbe('0x5f')]=_0x5f2e05['id'];if(_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x461409[_0x3dbe('0x52')]=_['merge'](_0x461409[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x461409['attributes'],function(_0x2a5bd8){var _0x45cf22={};_0x45cf22[_0x2a5bd8]={'$like':'%'+_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x45cf22;})});}_0x461409=_['merge']({},_0x461409,_0xe2b6e5[_0x3dbe('0x5a')]);return db[_0x3dbe('0x8c')][_0x3dbe('0x33')]({'where':_0x461409[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x254cda){_0x5ca8c5['count']=_0x254cda;if(_0xe2b6e5['query']['includeAll']){_0x461409[_0x3dbe('0x66')]=[{'model':db[_0x3dbe('0x8f')],'as':_0x3dbe('0x90'),'required':![]},{'model':db[_0x3dbe('0x91')],'as':'Owner','attributes':[_0x3dbe('0x3d'),_0x3dbe('0x92'),_0x3dbe('0x93')],'required':![]},{'model':db[_0x3dbe('0x94')],'as':_0x3dbe('0x95'),'attributes':['id',_0x3dbe('0x3d'),'color'],'where':_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x96')]?{'id':_0xe2b6e5['query'][_0x3dbe('0x96')]}:undefined,'required':_0xe2b6e5[_0x3dbe('0x4c')][_0x3dbe('0x96')]?!![]:![]}];}return db['MailInteraction'][_0x3dbe('0x6e')](_0x461409);})['then'](function(_0x359828){_0x5ca8c5['rows']=_0x359828;return _0x5ca8c5;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x53c4da,_0x461409))['catch'](handleError(_0x53c4da,null));};exports[_0x3dbe('0x97')]=function(_0x2eca25,_0x3f45fc,_0x5b9332){return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x2eca25[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x3f45fc,null))['then'](function(_0xf0c41d){if(_0xf0c41d){return db['sequelize'][_0x3dbe('0x98')](function(_0x319b6b){return db[_0x3dbe('0x99')][_0x3dbe('0x39')]({'where':{'MailAccountId':_0x2eca25['params']['id']},'transaction':_0x319b6b})[_0x3dbe('0x23')](function(_0x5352b9){var _0x2b697e=_[_0x3dbe('0x45')](_0x2eca25['body'],function(_0x1eca6e){_0x1eca6e['MailAccountId']=_0x2eca25[_0x3dbe('0x57')]['id'];return _0x1eca6e;});return db['MailApplication'][_0x3dbe('0x9a')](_0x2b697e,{'transaction':_0x319b6b});});})[_0x3dbe('0x23')](function(){return db[_0x3dbe('0x99')][_0x3dbe('0x9b')]({'where':{'MailAccountId':_0x2eca25[_0x3dbe('0x57')]['id']},'order':_0x3dbe('0x9c')});});}})[_0x3dbe('0x23')](respondWithResult(_0x3f45fc,null))[_0x3dbe('0x2c')](handleError(_0x3f45fc,null));};exports[_0x3dbe('0x9d')]=function(_0x15b615,_0x37c54a,_0x2079e4){var _0x503e53={};var _0x9f43a1={};var _0x345bc6;var _0x16037d;return db[_0x3dbe('0x46')]['findOne']({'where':{'id':_0x15b615[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x37c54a,null))[_0x3dbe('0x23')](function(_0x48b84b){if(_0x48b84b){_0x345bc6=_0x48b84b;_0x9f43a1[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x99')][_0x3dbe('0x47')]);_0x9f43a1[_0x3dbe('0x4c')]=_['keys'](_0x15b615[_0x3dbe('0x4c')]);_0x9f43a1[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x9f43a1[_0x3dbe('0x4b')],_0x9f43a1[_0x3dbe('0x4c')]);_0x503e53[_0x3dbe('0x50')]=_['intersection'](_0x9f43a1[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x503e53[_0x3dbe('0x50')]=_0x503e53[_0x3dbe('0x50')]['length']?_0x503e53[_0x3dbe('0x50')]:_0x9f43a1['model'];_0x503e53[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x503e53[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_['pick'](_0x15b615[_0x3dbe('0x4c')],_0x9f43a1[_0x3dbe('0x4d')]));if(_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x503e53[_0x3dbe('0x52')]=_[_0x3dbe('0x54')](_0x503e53['where'],{'$or':_[_0x3dbe('0x45')](_0x503e53[_0x3dbe('0x50')],function(_0x5aafcf){var _0x3ab902={};_0x3ab902[_0x5aafcf]={'$like':'%'+_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x53')]+'%'};return _0x3ab902;})});}_0x503e53=_['merge']({},_0x503e53,_0x15b615[_0x3dbe('0x5a')]);return _0x345bc6[_0x3dbe('0x9d')](_0x503e53);}})[_0x3dbe('0x23')](function(_0x3e945c){if(_0x3e945c){_0x16037d=_0x3e945c[_0x3dbe('0x62')];if(!_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x63')](_0x3dbe('0x64'))){_0x503e53[_0x3dbe('0x32')]=qs['limit'](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x503e53[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x15b615[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}return _0x345bc6[_0x3dbe('0x9d')](_0x503e53);}})[_0x3dbe('0x23')](function(_0x772491){if(_0x772491){return _0x772491?{'count':_0x16037d,'rows':_0x772491}:null;}})[_0x3dbe('0x23')](respondWithResult(_0x37c54a,null))['catch'](handleError(_0x37c54a,null));};exports['getMessages']=function(_0x16f747,_0x2e7409,_0x5c6b1a){var _0x1f24f0={'raw':!![],'where':{}};var _0x1bbe1c={};var _0xd883b3={'count':0x0,'rows':[]};return db[_0x3dbe('0x46')][_0x3dbe('0x6d')]({'where':{'id':_0x16f747[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e7409,null))[_0x3dbe('0x23')](function(_0x195a72){if(_0x195a72){_0x1bbe1c[_0x3dbe('0x4b')]=_[_0x3dbe('0x59')](db[_0x3dbe('0x9e')][_0x3dbe('0x47')]);_0x1bbe1c[_0x3dbe('0x4c')]=_[_0x3dbe('0x59')](_0x16f747[_0x3dbe('0x4c')]);_0x1bbe1c[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x1bbe1c['model'],_0x1bbe1c[_0x3dbe('0x4c')]);_0x1f24f0['attributes']=_[_0x3dbe('0x4e')](_0x1bbe1c[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x1f24f0[_0x3dbe('0x50')]=_0x1f24f0[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x1f24f0[_0x3dbe('0x50')]:_0x1bbe1c[_0x3dbe('0x4b')];if(!_0x16f747['query']['hasOwnProperty'](_0x3dbe('0x64'))){_0x1f24f0[_0x3dbe('0x32')]=qs[_0x3dbe('0x32')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x32')]);_0x1f24f0['offset']=qs[_0x3dbe('0x31')](_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x31')]);}_0x1f24f0[_0x3dbe('0x65')]=qs[_0x3dbe('0x51')](_0x16f747['query']['sort']);_0x1f24f0[_0x3dbe('0x52')]=qs[_0x3dbe('0x4d')](_[_0x3dbe('0x8e')](_0x16f747[_0x3dbe('0x4c')],_0x1bbe1c[_0x3dbe('0x4d')]));_0x1f24f0[_0x3dbe('0x52')]['MailAccountId']=_0x195a72['id'];if(_0x16f747[_0x3dbe('0x4c')]['filter']){_0x1f24f0[_0x3dbe('0x52')]=_['merge'](_0x1f24f0[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x1f24f0['attributes'],function(_0x2666dc){var _0x1b35ab={};_0x1b35ab[_0x2666dc]={'$like':'%'+_0x16f747[_0x3dbe('0x4c')]['filter']+'%'};return _0x1b35ab;})});}if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x9f')]){var _0x28572a=_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x9f')][_0x3dbe('0xa0')](',');var _0x158bb6={};_0x158bb6[_0x28572a[0x0]]={'$gte':moment(_0x28572a[0x1])[_0x3dbe('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f24f0[_0x3dbe('0x52')]=_['merge'](_0x1f24f0[_0x3dbe('0x52')],_0x158bb6);}_0x1f24f0=_[_0x3dbe('0x54')]({},_0x1f24f0,_0x16f747[_0x3dbe('0x5a')]);return db[_0x3dbe('0x9e')]['count']({'where':_0x1f24f0[_0x3dbe('0x52')]})[_0x3dbe('0x23')](function(_0x494853){_0xd883b3[_0x3dbe('0x33')]=_0x494853;if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0x55')]){_0x1f24f0[_0x3dbe('0x66')]=[{'all':!![]}];}return db['MailMessage'][_0x3dbe('0x6e')](_0x1f24f0);})[_0x3dbe('0x23')](function(_0x568ad4){if(_0x16f747[_0x3dbe('0x4c')][_0x3dbe('0xa2')]==='true'){for(var _0xae8217=0x0;_0xae8217<_0x568ad4[_0x3dbe('0x62')];_0xae8217++){_0x568ad4[_0xae8217][_0x3dbe('0x5c')]=juice(_0x568ad4[_0xae8217][_0x3dbe('0x5c')]);}}_0xd883b3[_0x3dbe('0x67')]=_0x568ad4;return _0xd883b3;});}})[_0x3dbe('0x23')](respondWithFilteredResult(_0x2e7409,_0x1f24f0))[_0x3dbe('0x2c')](handleError(_0x2e7409,null));};exports[_0x3dbe('0x3e')]=function(_0xb5f535,_0x11ebdf,_0x4eef16){var _0x2c56f4,_0x4db27f={},_0x50b362;if(_0xb5f535[_0x3dbe('0x5c')]['to']){_0x50b362=_0xb5f535['body']['to']['split'](',')[0x0];}return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0xb5f535['params']['id']},'include':[{'model':db[_0x3dbe('0xa3')],'as':'List','include':[{'model':db[_0x3dbe('0x8f')],'as':'Contacts','where':{'email':_0x50b362},'limit':0x1,'order':[[_0x3dbe('0xa4'),_0x3dbe('0xa5')]]}]},{'model':db[_0x3dbe('0x42')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x11ebdf,null))['then'](function(_0xb3d4af){if(_0xb3d4af){_0x2c56f4=_0xb3d4af;if(_0xb3d4af[_0x3dbe('0x43')]){if(_[_0x3dbe('0xa6')](_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xa7')])){_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xa7')]=util[_0x3dbe('0xa1')](_0x3dbe('0xa8'),_0xb3d4af[_0x3dbe('0x3d')],_0xb3d4af[_0x3dbe('0xa9')]||_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x73')]);}if(_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')]&&_0xb5f535[_0x3dbe('0x5c')]['attachments'][_0x3dbe('0x62')]){for(var _0x266906=0x0;_0x266906<_0xb5f535['body'][_0x3dbe('0xaa')][_0x3dbe('0x62')];_0x266906+=0x1){_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906]={'filename':_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906][_0x3dbe('0x3d')],'path':path[_0x3dbe('0xab')](config['root'],_0x3dbe('0xac'),_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xaa')][_0x266906][_0x3dbe('0xad')])};}}var _0x5b8f38={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x7b')])){if(_0xb3d4af['Smtp'][_0x3dbe('0x78')]){_0x5b8f38[_0x3dbe('0xae')]={'user':_0xb3d4af[_0x3dbe('0x43')]['user'],'pass':_0xb3d4af[_0x3dbe('0x43')]['pass']};}_0x5b8f38[_0x3dbe('0x79')]=_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x79')];_0x5b8f38[_0x3dbe('0x7a')]=_0xb3d4af[_0x3dbe('0x43')]['port'];_0x5b8f38[_0x3dbe('0xaf')]=_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0xaf')];}else{_0x5b8f38['service']=_0xb3d4af['Smtp'][_0x3dbe('0x7b')];_0x5b8f38[_0x3dbe('0xae')]={'user':_0xb3d4af[_0x3dbe('0x43')]['user'],'pass':_0xb3d4af[_0x3dbe('0x43')][_0x3dbe('0x76')]};}return respondWithRpcPromise(_0x3dbe('0xb0'),_0x3dbe('0xb1'),{'account':_0x5b8f38,'message':_0xb5f535['body']});}else{throw new Error(_0x3dbe('0xb2'));}}})['then'](function(_0x32f3c0){if(_0x32f3c0){_0x4db27f=_0x32f3c0;if(_0x2c56f4[_0x3dbe('0xb3')]){if(_0x2c56f4[_0x3dbe('0xb3')]['Contacts'][_0x3dbe('0x62')]){return _0x2c56f4[_0x3dbe('0xb3')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x3dbe('0x1d')](_0xb5f535[_0x3dbe('0x5c')],{'firstName':_0xb5f535['body']['to'],'email':_0xb5f535[_0x3dbe('0x5c')]['to'],'phone':_0xb5f535['body']['to'],'ListId':_0x2c56f4[_0x3dbe('0x70')]}));}}else{throw new Error(_0x3dbe('0xb2'));}}})[_0x3dbe('0x23')](function(_0xfd790e){if(_0xfd790e){var _0x30dede={'UserId':_0xb5f535[_0x3dbe('0x73')]['id'],'ContactId':_0xfd790e['id'],'MailAccountId':_0x2c56f4['id'],'inReplyTo':_0x4db27f[_0x3dbe('0xb4')],'to':_0xb5f535['body']['from'],'cc':_0xb5f535[_0x3dbe('0x5c')]['cc'],'subject':_0xb5f535[_0x3dbe('0x5c')]['subject'],'attach':_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb5')],'firstMsgDirection':_0x3dbe('0xb6'),'lastMsgAt':moment()['format'](_0x3dbe('0xb7')),'lastMsgDirection':_0x3dbe('0xb6'),'Messages':[_[_0x3dbe('0x54')](_0xb5f535[_0x3dbe('0x5c')],{'messageId':_0x4db27f[_0x3dbe('0xb4')],'sentAt':moment()[_0x3dbe('0xa1')](_0x3dbe('0xb7')),'read':!![],'MailAccountId':_0x2c56f4['id'],'UserId':_0xb5f535[_0x3dbe('0x73')]['id'],'ContactId':_0xfd790e['id']})]};if(_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb8')]){_0x30dede=_[_0x3dbe('0x54')](_0x30dede,_0xb5f535[_0x3dbe('0x5c')][_0x3dbe('0xb8')]);}return db['MailInteraction'][_0x3dbe('0x61')](_0x30dede,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x3dbe('0x23')](respondWithResult(_0x11ebdf,null))[_0x3dbe('0x2c')](handleError(_0x11ebdf,null));};exports[_0x3dbe('0xb9')]=function(_0x51542e,_0x54eaed,_0x12d2f1){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x51542e[_0x3dbe('0x57')]['id']},'include':[{'model':db[_0x3dbe('0x42')],'as':'Smtp','raw':!![]}]})[_0x3dbe('0x23')](handleEntityNotFound(_0x54eaed,null))[_0x3dbe('0x23')](function(_0x133aad){if(_0x133aad&&_0x133aad[_0x3dbe('0x43')]){var _0x4d06e6={'id':_0x133aad['id'],'tls':{'rejectUnauthorized':![]}};if(_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x7b')]){_0x4d06e6[_0x3dbe('0x7b')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x7b')];}else{_0x4d06e6[_0x3dbe('0x79')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x79')];_0x4d06e6[_0x3dbe('0x7a')]=_0x133aad['Smtp'][_0x3dbe('0x7a')];_0x4d06e6[_0x3dbe('0xaf')]=_0x133aad[_0x3dbe('0x43')][_0x3dbe('0xaf')];}if(_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x78')]){_0x4d06e6[_0x3dbe('0xae')]={'user':_0x133aad[_0x3dbe('0x43')][_0x3dbe('0x73')],'pass':_0x133aad['Smtp'][_0x3dbe('0x76')]};}return respondWithRpcPromise('VerifySmtp',_0x3dbe('0xb9'),{'account':_0x4d06e6});}})['then'](respondWithResult(_0x54eaed,null))[_0x3dbe('0x2c')](handleError(_0x54eaed,null));};exports[_0x3dbe('0x39')]=function(_0x2dcf0e,_0x56f3ab){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x2dcf0e['params']['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x56f3ab,null))[_0x3dbe('0x23')](function(_0x34fb2a){if(_0x34fb2a&&_0x34fb2a[_0x3dbe('0x7b')]){throw new db[(_0x3dbe('0xba'))][(_0x3dbe('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x34fb2a;})[_0x3dbe('0x23')](removeEntity(_0x56f3ab,null))[_0x3dbe('0x2c')](handleError(_0x56f3ab,null));};exports[_0x3dbe('0xbc')]=function(_0x4661b3,_0x31b4e4,_0x549a74){return db[_0x3dbe('0x46')]['find']({'where':{'id':_0x4661b3[_0x3dbe('0x57')]['id']}})[_0x3dbe('0x23')](handleEntityNotFound(_0x31b4e4,null))[_0x3dbe('0x23')](function(_0x83d747){if(_0x83d747){return _0x83d747[_0x3dbe('0xbc')](_0x4661b3[_0x3dbe('0x5c')]['ids'],_[_0x3dbe('0xbd')](_0x4661b3[_0x3dbe('0x5c')],[_0x3dbe('0x69'),'id'])||{})[_0x3dbe('0xbe')](function(_0x2a9246){for(var _0x9b76aa=0x0;_0x9b76aa<_0x4661b3[_0x3dbe('0x5c')]['ids']['length'];_0x9b76aa+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x4661b3[_0x3dbe('0x5c')][_0x3dbe('0x69')][_0x9b76aa]),'MailAccountId':Number(_0x4661b3[_0x3dbe('0x57')]['id'])});}return _0x2a9246;});}})['then'](respondWithResult(_0x31b4e4,null))[_0x3dbe('0x2c')](handleError(_0x31b4e4,null));};exports[_0x3dbe('0xbf')]=function(_0x42afc1,_0x58704e,_0x22899b){return db[_0x3dbe('0x46')][_0x3dbe('0x5b')]({'where':{'id':_0x42afc1['params']['id']}})['then'](handleEntityNotFound(_0x58704e,null))[_0x3dbe('0x23')](function(_0x388867){if(_0x388867){return _0x388867['removeAgents'](_0x42afc1[_0x3dbe('0x4c')]['ids'])[_0x3dbe('0x23')](function(){if(_[_0x3dbe('0xc0')](_0x42afc1[_0x3dbe('0x4c')]['ids'])){for(var _0x3e5433=0x0;_0x3e5433<_0x42afc1[_0x3dbe('0x4c')][_0x3dbe('0x69')][_0x3dbe('0x62')];_0x3e5433+=0x1){socket[_0x3dbe('0xc1')](_0x3dbe('0xc2'),{'UserId':Number(_0x42afc1[_0x3dbe('0x4c')][_0x3dbe('0x69')][_0x3e5433]),'MailAccountId':Number(_0x42afc1['params']['id'])});}}else{socket[_0x3dbe('0xc1')](_0x3dbe('0xc2'),{'UserId':Number(_0x42afc1[_0x3dbe('0x4c')]['ids']),'MailAccountId':Number(_0x42afc1['params']['id'])});}});}})[_0x3dbe('0x23')](respondWithStatusCode(_0x58704e,null))['catch'](handleError(_0x58704e,null));};exports[_0x3dbe('0xc3')]=function(_0x3b7e5c,_0x1edf0d,_0x2e975b){var _0x116fc2={};var _0x305b7c={};var _0x284361;var _0x4f4203;return db['MailAccount'][_0x3dbe('0x6d')]({'where':{'id':_0x3b7e5c[_0x3dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x1edf0d,null))[_0x3dbe('0x23')](function(_0x47d633){if(_0x47d633){_0x284361=_0x47d633;_0x305b7c['model']=_[_0x3dbe('0x59')](db[_0x3dbe('0x91')][_0x3dbe('0x47')]);_0x305b7c[_0x3dbe('0x4c')]=_['keys'](_0x3b7e5c['query']);_0x305b7c[_0x3dbe('0x4d')]=_[_0x3dbe('0x4e')](_0x305b7c[_0x3dbe('0x4b')],_0x305b7c[_0x3dbe('0x4c')]);_0x116fc2[_0x3dbe('0x50')]=_[_0x3dbe('0x4e')](_0x305b7c[_0x3dbe('0x4b')],qs[_0x3dbe('0x4f')](_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x4f')]));_0x116fc2[_0x3dbe('0x50')]=_0x116fc2[_0x3dbe('0x50')][_0x3dbe('0x62')]?_0x116fc2[_0x3dbe('0x50')]:_0x305b7c[_0x3dbe('0x4b')];_0x116fc2['order']=qs[_0x3dbe('0x51')](_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x51')]);_0x116fc2[_0x3dbe('0x52')]=qs['filters'](_['pick'](_0x3b7e5c[_0x3dbe('0x4c')],_0x305b7c[_0x3dbe('0x4d')]));if(_0x3b7e5c[_0x3dbe('0x4c')][_0x3dbe('0x53')]){_0x116fc2['where']=_[_0x3dbe('0x54')](_0x116fc2[_0x3dbe('0x52')],{'$or':_[_0x3dbe('0x45')](_0x116fc2[_0x3dbe('0x50')],function(_0x15fd3d){var _0x268e77={};_0x268e77[_0x15fd3d]={'$like':'%'+_0x3b7e5c[_0x3dbe('0x4c')]['filter']+'%'};return _0x268e77;})});}_0x116fc2=_['merge']({},_0x116fc2,_0x3b7e5c[_0x3dbe('0x5a')]);return _0x284361[_0x3dbe('0xc3')](_0x116fc2);}})[_0x3dbe('0x23')](function(_0x3f3bfe){if(_0x3f3bfe){_0x4f4203=_0x3f3bfe['length'];if(!_0x3b7e5c[_0x3dbe('0x4c')]['hasOwnProperty'](_0x3dbe('0x64'))){_0x116fc2['limit']=qs['limit'](_0x3b7e5c[_0x3dbe('0x4c')]['limit']);_0x116fc2[_0x3dbe('0x31')]=qs[_0x3dbe('0x31')](_0x3b7e5c['query'][_0x3dbe('0x31')]);}return _0x284361[_0x3dbe('0xc3')](_0x116fc2);}})[_0x3dbe('0x23')](function(_0x21524b){if(_0x21524b){return _0x21524b?{'count':_0x4f4203,'rows':_0x21524b}:null;}})['then'](respondWithResult(_0x1edf0d,null))[_0x3dbe('0x2c')](handleError(_0x1edf0d,null));}; \ No newline at end of file +var _0x531a=['Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','auth','pass','secure','SendMail','List\x20not\x20found','List','Contacts','defaults','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','register','request','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','offset','undefined','count','limit','set','json','apply','reject','save','destroy','get','MailAccounts','UserProfileResource','then','end','sendStatus','stack','name','index','Imap','MailServerOut','Smtp','MailAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','rows','params','MailServerIn','Pause','keys','update','body','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','include','removeDispositions','find','ids','addAnswer','create','getAnswers','CannedAnswer','findAll','removeAnswers','email','ListId','isNil','active','description','user','cuser','cpassword','authentication','host','port','service','cservice','password','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','order','CmContact','Contact'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x531a,0x100));var _0xa531=function(_0x19a2eb,_0x2df439){_0x19a2eb=_0x19a2eb-0x0;var _0x3c8514=_0x531a[_0x19a2eb];return _0x3c8514;};'use strict';var emlformat=require(_0xa531('0x0'));var rimraf=require(_0xa531('0x1'));var zipdir=require(_0xa531('0x2'));var jsonpatch=require(_0xa531('0x3'));var rp=require(_0xa531('0x4'));var moment=require(_0xa531('0x5'));var BPromise=require(_0xa531('0x6'));var Mustache=require(_0xa531('0x7'));var util=require(_0xa531('0x8'));var path=require(_0xa531('0x9'));var sox=require('sox');var csv=require(_0xa531('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa531('0xb'));var _=require(_0xa531('0xc'));var squel=require(_0xa531('0xd'));var crypto=require(_0xa531('0xe'));var jsforce=require(_0xa531('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa531('0xa'));var querystring=require(_0xa531('0x10'));var Papa=require('papaparse');var htmlToText=require(_0xa531('0x11'));var juice=require(_0xa531('0x12'));var Redis=require(_0xa531('0x13'));var authService=require(_0xa531('0x14'));var qs=require(_0xa531('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa531('0x16'));var logger=require('../../config/logger')(_0xa531('0x17'));var utils=require(_0xa531('0x18'));var config=require(_0xa531('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa531('0x1a'))['db'];config[_0xa531('0x1b')]=_['defaults'](config[_0xa531('0x1b')],{'host':_0xa531('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa531('0x1b')]));require(_0xa531('0x1d'))[_0xa531('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x1600f4,_0x1668aa,_0x3c0798,_0x2082b4){return new BPromise(function(_0x324076,_0x1df484){var _0x580761=_0x2082b4||client;return _0x580761[_0xa531('0x1f')](_0x1600f4,_0x3c0798)['then'](function(_0x412b84){logger[_0xa531('0x20')]('MailAccount,\x20%s,\x20%s',_0x1668aa,'request\x20sent');logger[_0xa531('0x21')](_0xa531('0x22'),_0x1668aa,_0xa531('0x23'),JSON['stringify'](_0x412b84));if(_0x412b84[_0xa531('0x24')]){if(_0x412b84[_0xa531('0x24')][_0xa531('0x25')]===0x1f4){logger['error'](_0xa531('0x26'),_0x1668aa,_0x412b84[_0xa531('0x24')]['message']);return _0x1df484(_0x412b84[_0xa531('0x24')][_0xa531('0x27')]);}logger[_0xa531('0x24')](_0xa531('0x26'),_0x1668aa,_0x412b84[_0xa531('0x24')][_0xa531('0x27')]);return _0x324076(_0x412b84[_0xa531('0x24')][_0xa531('0x27')]);}else{logger[_0xa531('0x20')](_0xa531('0x26'),_0x1668aa,_0xa531('0x23'));_0x324076(_0x412b84[_0xa531('0x28')]['message']);}})[_0xa531('0x29')](function(_0x1d0217){logger[_0xa531('0x24')]('MailAccount,\x20%s,\x20%s',_0x1668aa,_0x1d0217);_0x1df484(_0x1d0217);});});}function respondWithStatusCode(_0x7fb52d,_0x180823){_0x180823=_0x180823||0xcc;return function(_0x537e4d){if(_0x537e4d){return _0x7fb52d['sendStatus'](_0x180823);}return _0x7fb52d[_0xa531('0x2a')](_0x180823)['end']();};}function respondWithResult(_0x3acffc,_0x2be143){_0x2be143=_0x2be143||0xc8;return function(_0x5b7ad2){if(_0x5b7ad2){return _0x3acffc[_0xa531('0x2a')](_0x2be143)['json'](_0x5b7ad2);}};}function respondWithFilteredResult(_0x36a8e6,_0x531b8c){return function(_0x56307d){if(_0x56307d){var _0x5e480a=typeof _0x531b8c[_0xa531('0x2b')]===_0xa531('0x2c')&&typeof _0x531b8c['limit']==='undefined';var _0x380cec=_0x56307d['count'];var _0x97df27=_0x5e480a?0x0:_0x531b8c[_0xa531('0x2b')];var _0x556f56=_0x5e480a?_0x56307d[_0xa531('0x2d')]:_0x531b8c[_0xa531('0x2b')]+_0x531b8c[_0xa531('0x2e')];var _0x492832;if(_0x556f56>=_0x380cec){_0x556f56=_0x380cec;_0x492832=0xc8;}else{_0x492832=0xce;}_0x36a8e6[_0xa531('0x2a')](_0x492832);return _0x36a8e6[_0xa531('0x2f')]('Content-Range',_0x97df27+'-'+_0x556f56+'/'+_0x380cec)[_0xa531('0x30')](_0x56307d);}return null;};}function patchUpdates(_0x13c270){return function(_0x50eae8){try{jsonpatch[_0xa531('0x31')](_0x50eae8,_0x13c270,!![]);}catch(_0xbbe6f0){return BPromise[_0xa531('0x32')](_0xbbe6f0);}return _0x50eae8[_0xa531('0x33')]();};}function saveUpdates(_0x1eb778,_0x434212){return function(_0x224ddc){if(_0x224ddc){return _0x224ddc['update'](_0x1eb778)['then'](function(_0x423572){return _0x423572;});}return null;};}function removeEntity(_0x30fc8c,_0x350338){return function(_0x305959){if(_0x305959){return _0x305959[_0xa531('0x34')]()['then'](function(){var _0x1ac630=_0x305959[_0xa531('0x35')]({'plain':!![]});var _0x2a3dec=_0xa531('0x36');return db[_0xa531('0x37')][_0xa531('0x34')]({'where':{'type':_0x2a3dec,'resourceId':_0x1ac630['id']}})[_0xa531('0x38')](function(){return _0x305959;});})[_0xa531('0x38')](function(){_0x30fc8c[_0xa531('0x2a')](0xcc)[_0xa531('0x39')]();});}};}function handleEntityNotFound(_0x28f84c,_0x55e014){return function(_0x79fd14){if(!_0x79fd14){_0x28f84c[_0xa531('0x3a')](0x194);}return _0x79fd14;};}function handleError(_0x42c1d8,_0x10cc3c){_0x10cc3c=_0x10cc3c||0x1f4;return function(_0x237c3d){logger['error'](_0x237c3d[_0xa531('0x3b')]);if(_0x237c3d[_0xa531('0x3c')]){delete _0x237c3d[_0xa531('0x3c')];}_0x42c1d8[_0xa531('0x2a')](_0x10cc3c)['send'](_0x237c3d);};}exports[_0xa531('0x3d')]=function(_0x297c78,_0x20e74c){var _0x58bd5f={'include':[{'model':db['MailServerIn'],'as':_0xa531('0x3e')},{'model':db[_0xa531('0x3f')],'as':_0xa531('0x40')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x47b295={},_0x3f6c51={'count':0x0,'rows':[]};var _0x383994=_['map'](db[_0xa531('0x41')][_0xa531('0x42')],function(_0x2024ce){return{'name':_0x2024ce[_0xa531('0x43')],'type':_0x2024ce[_0xa531('0x44')][_0xa531('0x45')]};});_0x47b295[_0xa531('0x46')]=_[_0xa531('0x47')](_0x383994,_0xa531('0x3c'));_0x47b295['query']=_['keys'](_0x297c78[_0xa531('0x48')]);_0x47b295['filters']=_[_0xa531('0x49')](_0x47b295[_0xa531('0x46')],_0x47b295[_0xa531('0x48')]);_0x58bd5f['attributes']=_[_0xa531('0x49')](_0x47b295[_0xa531('0x46')],qs[_0xa531('0x4a')](_0x297c78[_0xa531('0x48')][_0xa531('0x4a')]));_0x58bd5f[_0xa531('0x4b')]=_0x58bd5f[_0xa531('0x4b')][_0xa531('0x4c')]?_0x58bd5f[_0xa531('0x4b')]:_0x47b295[_0xa531('0x46')];if(!_0x297c78[_0xa531('0x48')][_0xa531('0x4d')](_0xa531('0x4e'))){_0x58bd5f['limit']=qs[_0xa531('0x2e')](_0x297c78['query'][_0xa531('0x2e')]);_0x58bd5f[_0xa531('0x2b')]=qs[_0xa531('0x2b')](_0x297c78[_0xa531('0x48')]['offset']);}_0x58bd5f['order']=qs['sort'](_0x297c78[_0xa531('0x48')][_0xa531('0x4f')]);_0x58bd5f[_0xa531('0x50')]=qs['filters'](_[_0xa531('0x51')](_0x297c78[_0xa531('0x48')],_0x47b295[_0xa531('0x52')]),_0x383994);if(_0x297c78[_0xa531('0x48')]['filter']){_0x58bd5f[_0xa531('0x50')]=_['merge'](_0x58bd5f[_0xa531('0x50')],{'$or':_[_0xa531('0x47')](_0x383994,function(_0xbcfcc7){if(_0xbcfcc7[_0xa531('0x44')]!==_0xa531('0x53')){var _0x4ca7fc={};_0x4ca7fc[_0xbcfcc7[_0xa531('0x3c')]]={'$like':'%'+_0x297c78[_0xa531('0x48')][_0xa531('0x54')]+'%'};return _0x4ca7fc;}})});}_0x58bd5f=_[_0xa531('0x55')]({},_0x58bd5f,_0x297c78[_0xa531('0x56')]);var _0x4a7bc6={'where':_0x58bd5f[_0xa531('0x50')]};return db[_0xa531('0x41')]['count'](_0x4a7bc6)[_0xa531('0x38')](function(_0x4abca4){_0x3f6c51[_0xa531('0x2d')]=_0x4abca4;if(_0x297c78[_0xa531('0x48')][_0xa531('0x57')]){_0x58bd5f['include']=[{'all':!![]}];}return db[_0xa531('0x41')]['findAll'](_0x58bd5f);})[_0xa531('0x38')](function(_0x2b7cfb){_0x3f6c51[_0xa531('0x58')]=_0x2b7cfb;return _0x3f6c51;})['then'](respondWithFilteredResult(_0x20e74c,_0x58bd5f))['catch'](handleError(_0x20e74c,null));};exports['show']=function(_0x3587fe,_0x207e41){var _0x3c64c2={'raw':![],'where':{'id':_0x3587fe[_0xa531('0x59')]['id']},'include':[{'model':db[_0xa531('0x5a')],'as':_0xa531('0x3e')},{'model':db[_0xa531('0x3f')],'as':_0xa531('0x40')},{'model':db[_0xa531('0x5b')],'as':'mandatoryDispositionPause'}]},_0x53fefc={};_0x53fefc[_0xa531('0x46')]=_['keys'](db[_0xa531('0x41')][_0xa531('0x42')]);_0x53fefc[_0xa531('0x48')]=_[_0xa531('0x5c')](_0x3587fe[_0xa531('0x48')]);_0x53fefc['filters']=_[_0xa531('0x49')](_0x53fefc[_0xa531('0x46')],_0x53fefc[_0xa531('0x48')]);_0x3c64c2['attributes']=_[_0xa531('0x49')](_0x53fefc['model'],qs[_0xa531('0x4a')](_0x3587fe['query']['fields']));_0x3c64c2['attributes']=_0x3c64c2['attributes']['length']?_0x3c64c2[_0xa531('0x4b')]:_0x53fefc[_0xa531('0x46')];if(_0x3587fe[_0xa531('0x48')][_0xa531('0x57')]){_0x3c64c2['include']=[{'all':!![]}];}_0x3c64c2=_[_0xa531('0x55')]({},_0x3c64c2,_0x3587fe[_0xa531('0x56')]);return db[_0xa531('0x41')]['find'](_0x3c64c2)[_0xa531('0x38')](handleEntityNotFound(_0x207e41,null))['then'](respondWithResult(_0x207e41,null))[_0xa531('0x29')](handleError(_0x207e41,null));};exports[_0xa531('0x5d')]=function(_0xb30d0c,_0x5cfc90){if(_0xb30d0c[_0xa531('0x5e')]['id']){delete _0xb30d0c[_0xa531('0x5e')]['id'];}return db[_0xa531('0x41')]['find']({'where':{'id':_0xb30d0c[_0xa531('0x59')]['id']},'include':[{'model':db[_0xa531('0x5a')],'as':_0xa531('0x3e')},{'model':db['MailServerOut'],'as':_0xa531('0x40')},{'model':db['Pause'],'as':_0xa531('0x5f')}]})[_0xa531('0x38')](handleEntityNotFound(_0x5cfc90,null))[_0xa531('0x38')](saveUpdates(_0xb30d0c[_0xa531('0x5e')],null))[_0xa531('0x38')](function(_0x2906a8){if(_0x2906a8&&_0xb30d0c['body']['Imap']){return db[_0xa531('0x5a')][_0xa531('0x5d')](_0xb30d0c['body'][_0xa531('0x3e')],{'where':{'MailAccountId':_0x2906a8['id']}})[_0xa531('0x38')](function(){return _0x2906a8;});}return _0x2906a8;})[_0xa531('0x38')](function(_0x132f9e){if(_0x132f9e&&_0xb30d0c[_0xa531('0x5e')][_0xa531('0x40')]){return db['MailServerOut'][_0xa531('0x5d')](_0xb30d0c[_0xa531('0x5e')][_0xa531('0x40')],{'where':{'MailAccountId':_0x132f9e['id']}})[_0xa531('0x38')](function(){return _0x132f9e;});}return _0x132f9e;})[_0xa531('0x38')](respondWithResult(_0x5cfc90,null))['catch'](handleError(_0x5cfc90,null));};exports['describe']=function(_0x18572a,_0x41342a){return db[_0xa531('0x41')][_0xa531('0x60')]()[_0xa531('0x38')](respondWithResult(_0x41342a,null))[_0xa531('0x29')](handleError(_0x41342a,null));};exports[_0xa531('0x61')]=function(_0x1a3da4,_0x8fab97,_0xd8f05){if(_0x1a3da4[_0xa531('0x5e')]['id']){delete _0x1a3da4[_0xa531('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1a3da4[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x8fab97,null))['then'](function(_0xb52927){if(_0xb52927){_0x1a3da4[_0xa531('0x5e')][_0xa531('0x62')]=_0xb52927['id'];return db[_0xa531('0x63')]['create'](_0x1a3da4['body']);}})[_0xa531('0x38')](respondWithResult(_0x8fab97,null))['catch'](handleError(_0x8fab97,null));};exports[_0xa531('0x64')]=function(_0x21870d,_0x1d3135,_0x36c480){var _0x19b145={'raw':![],'where':{}};var _0x1033a5={};var _0x196ea3={'count':0x0,'rows':[]};return db[_0xa531('0x41')][_0xa531('0x65')]({'where':{'id':_0x21870d['params']['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x1d3135,null))['then'](function(_0x1ce9ac){if(_0x1ce9ac){_0x1033a5[_0xa531('0x46')]=_[_0xa531('0x5c')](db[_0xa531('0x63')][_0xa531('0x42')]);_0x1033a5[_0xa531('0x48')]=_[_0xa531('0x5c')](_0x21870d['query']);_0x1033a5[_0xa531('0x52')]=_[_0xa531('0x49')](_0x1033a5[_0xa531('0x46')],_0x1033a5[_0xa531('0x48')]);_0x19b145[_0xa531('0x4b')]=_[_0xa531('0x49')](_0x1033a5[_0xa531('0x46')],qs[_0xa531('0x4a')](_0x21870d[_0xa531('0x48')][_0xa531('0x4a')]));_0x19b145[_0xa531('0x4b')]=_0x19b145['attributes'][_0xa531('0x4c')]?_0x19b145[_0xa531('0x4b')]:_0x1033a5['model'];if(!_0x21870d[_0xa531('0x48')][_0xa531('0x4d')]('nolimit')){_0x19b145[_0xa531('0x2e')]=qs['limit'](_0x21870d[_0xa531('0x48')][_0xa531('0x2e')]);_0x19b145[_0xa531('0x2b')]=qs['offset'](_0x21870d['query'][_0xa531('0x2b')]);}_0x19b145['order']=qs[_0xa531('0x4f')](_0x21870d[_0xa531('0x48')][_0xa531('0x4f')]);_0x19b145[_0xa531('0x50')]=qs['filters'](_['pick'](_0x21870d['query'],_0x1033a5[_0xa531('0x52')]));_0x19b145[_0xa531('0x50')][_0xa531('0x62')]=_0x1ce9ac['id'];if(_0x21870d['query']['filter']){_0x19b145['where']=_['merge'](_0x19b145['where'],{'$or':_[_0xa531('0x47')](_0x19b145[_0xa531('0x4b')],function(_0x2915ea){var _0x66a79e={};_0x66a79e[_0x2915ea]={'$like':'%'+_0x21870d['query'][_0xa531('0x54')]+'%'};return _0x66a79e;})});}_0x19b145=_[_0xa531('0x55')]({},_0x19b145,_0x21870d[_0xa531('0x56')]);return db[_0xa531('0x63')][_0xa531('0x2d')]({'where':_0x19b145['where']})[_0xa531('0x38')](function(_0x31c094){_0x196ea3[_0xa531('0x2d')]=_0x31c094;if(_0x21870d[_0xa531('0x48')][_0xa531('0x57')]){_0x19b145[_0xa531('0x66')]=[{'all':!![]}];}return db[_0xa531('0x63')]['findAll'](_0x19b145);})['then'](function(_0x45e1bf){_0x196ea3[_0xa531('0x58')]=_0x45e1bf;return _0x196ea3;});}})[_0xa531('0x38')](respondWithFilteredResult(_0x1d3135,_0x19b145))[_0xa531('0x29')](handleError(_0x1d3135,null));};exports[_0xa531('0x67')]=function(_0x3f5e78,_0x2525fb,_0x1908b7){return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x3f5e78[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x2525fb,null))[_0xa531('0x38')](function(_0x5e20cd){if(_0x5e20cd){return _0x5e20cd[_0xa531('0x67')](_0x3f5e78[_0xa531('0x48')][_0xa531('0x69')]);}})['then'](respondWithStatusCode(_0x2525fb,null))[_0xa531('0x29')](handleError(_0x2525fb,null));};exports[_0xa531('0x6a')]=function(_0x43cbad,_0x2b8b3a,_0x41868b){if(_0x43cbad['body']['id']){delete _0x43cbad[_0xa531('0x5e')]['id'];}return db['MailAccount'][_0xa531('0x68')]({'where':{'id':_0x43cbad[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x2b8b3a,null))['then'](function(_0x5c46ab){if(_0x5c46ab){_0x43cbad[_0xa531('0x5e')]['MailAccountId']=_0x5c46ab['id'];return db['CannedAnswer'][_0xa531('0x6b')](_0x43cbad['body']);}})[_0xa531('0x38')](respondWithResult(_0x2b8b3a,null))[_0xa531('0x29')](handleError(_0x2b8b3a,null));};exports[_0xa531('0x6c')]=function(_0x1df4a7,_0x54dd4e,_0x388022){var _0x2a93b1={'raw':![],'where':{}};var _0x40d309={};var _0x34f691={'count':0x0,'rows':[]};return db[_0xa531('0x41')]['findOne']({'where':{'id':_0x1df4a7[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x54dd4e,null))[_0xa531('0x38')](function(_0xaa2fc9){if(_0xaa2fc9){_0x40d309[_0xa531('0x46')]=_[_0xa531('0x5c')](db['CannedAnswer']['rawAttributes']);_0x40d309[_0xa531('0x48')]=_[_0xa531('0x5c')](_0x1df4a7[_0xa531('0x48')]);_0x40d309[_0xa531('0x52')]=_[_0xa531('0x49')](_0x40d309[_0xa531('0x46')],_0x40d309[_0xa531('0x48')]);_0x2a93b1[_0xa531('0x4b')]=_[_0xa531('0x49')](_0x40d309[_0xa531('0x46')],qs[_0xa531('0x4a')](_0x1df4a7[_0xa531('0x48')][_0xa531('0x4a')]));_0x2a93b1[_0xa531('0x4b')]=_0x2a93b1[_0xa531('0x4b')][_0xa531('0x4c')]?_0x2a93b1[_0xa531('0x4b')]:_0x40d309[_0xa531('0x46')];if(!_0x1df4a7['query'][_0xa531('0x4d')](_0xa531('0x4e'))){_0x2a93b1['limit']=qs[_0xa531('0x2e')](_0x1df4a7['query'][_0xa531('0x2e')]);_0x2a93b1['offset']=qs[_0xa531('0x2b')](_0x1df4a7[_0xa531('0x48')][_0xa531('0x2b')]);}_0x2a93b1['order']=qs[_0xa531('0x4f')](_0x1df4a7[_0xa531('0x48')][_0xa531('0x4f')]);_0x2a93b1[_0xa531('0x50')]=qs['filters'](_[_0xa531('0x51')](_0x1df4a7[_0xa531('0x48')],_0x40d309[_0xa531('0x52')]));_0x2a93b1['where'][_0xa531('0x62')]=_0xaa2fc9['id'];if(_0x1df4a7[_0xa531('0x48')][_0xa531('0x54')]){_0x2a93b1[_0xa531('0x50')]=_['merge'](_0x2a93b1[_0xa531('0x50')],{'$or':_[_0xa531('0x47')](_0x2a93b1[_0xa531('0x4b')],function(_0x1896df){var _0x5978b3={};_0x5978b3[_0x1896df]={'$like':'%'+_0x1df4a7['query'][_0xa531('0x54')]+'%'};return _0x5978b3;})});}_0x2a93b1=_['merge']({},_0x2a93b1,_0x1df4a7['options']);return db['CannedAnswer'][_0xa531('0x2d')]({'where':_0x2a93b1[_0xa531('0x50')]})['then'](function(_0x49dd06){_0x34f691[_0xa531('0x2d')]=_0x49dd06;if(_0x1df4a7['query'][_0xa531('0x57')]){_0x2a93b1['include']=[{'all':!![]}];}return db[_0xa531('0x6d')][_0xa531('0x6e')](_0x2a93b1);})[_0xa531('0x38')](function(_0x5d20fd){_0x34f691[_0xa531('0x58')]=_0x5d20fd;return _0x34f691;});}})[_0xa531('0x38')](respondWithFilteredResult(_0x54dd4e,_0x2a93b1))[_0xa531('0x29')](handleError(_0x54dd4e,null));};exports[_0xa531('0x6f')]=function(_0x4a9bf2,_0x4b3859,_0x4131a9){return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x4a9bf2[_0xa531('0x59')]['id']}})['then'](handleEntityNotFound(_0x4b3859,null))['then'](function(_0x5123ba){if(_0x5123ba){return _0x5123ba[_0xa531('0x6f')](_0x4a9bf2[_0xa531('0x48')]['ids']);}})[_0xa531('0x38')](respondWithStatusCode(_0x4b3859,null))['catch'](handleError(_0x4b3859,null));};exports[_0xa531('0x6b')]=function(_0x21f881,_0x5baf82){var _0xa4f5e1={'name':_0x21f881[_0xa531('0x5e')][_0xa531('0x3c')],'key':_0x21f881['body'][_0xa531('0x45')],'email':_0x21f881[_0xa531('0x5e')][_0xa531('0x70')],'ListId':_0x21f881['body'][_0xa531('0x71')],'active':!_[_0xa531('0x72')](_0x21f881['body'][_0xa531('0x73')])?_0x21f881[_0xa531('0x5e')][_0xa531('0x73')]:!![],'description':_0x21f881[_0xa531('0x5e')][_0xa531('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0xa531('0x72')](_0x21f881['body']['cservice'])){if(_0x21f881[_0xa531('0x5e')]['cauthentication']){_0xa4f5e1[_0xa531('0x3e')][_0xa531('0x75')]=_0xa4f5e1['Smtp']['user']=_0x21f881[_0xa531('0x5e')][_0xa531('0x76')];_0xa4f5e1[_0xa531('0x3e')]['password']=_0xa4f5e1[_0xa531('0x40')]['pass']=_0x21f881[_0xa531('0x5e')][_0xa531('0x77')];}else{_0xa4f5e1['Imap'][_0xa531('0x78')]=_0xa4f5e1['Smtp']['authentication']=![];}_0xa4f5e1[_0xa531('0x3e')]['host']=_0x21f881['body'][_0xa531('0x3e')][_0xa531('0x79')];_0xa4f5e1['Imap']['port']=_0x21f881[_0xa531('0x5e')]['Imap'][_0xa531('0x7a')];_0xa4f5e1[_0xa531('0x40')][_0xa531('0x79')]=_0x21f881[_0xa531('0x5e')][_0xa531('0x40')][_0xa531('0x79')];_0xa4f5e1[_0xa531('0x40')][_0xa531('0x7a')]=_0x21f881[_0xa531('0x5e')][_0xa531('0x40')][_0xa531('0x7a')];}else{_0xa4f5e1['Imap'][_0xa531('0x7b')]=_0xa4f5e1[_0xa531('0x40')][_0xa531('0x7b')]=_0x21f881[_0xa531('0x5e')][_0xa531('0x7c')];_0xa4f5e1[_0xa531('0x3e')][_0xa531('0x75')]=_0xa4f5e1[_0xa531('0x40')][_0xa531('0x75')]=_0x21f881[_0xa531('0x5e')][_0xa531('0x76')];_0xa4f5e1[_0xa531('0x3e')][_0xa531('0x7d')]=_0xa4f5e1[_0xa531('0x40')]['pass']=_0x21f881[_0xa531('0x5e')][_0xa531('0x77')];}return db[_0xa531('0x41')]['create'](_0xa4f5e1,{'include':[{'model':db[_0xa531('0x3f')],'as':_0xa531('0x40')},{'model':db[_0xa531('0x5a')],'as':'Imap'}]})[_0xa531('0x38')](function(_0x1604f5){var _0x2b3441=_0x21f881[_0xa531('0x75')][_0xa531('0x35')]({'plain':!![]});if(!_0x2b3441)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b3441['role']===_0xa531('0x75')){var _0x40a14d=_0x1604f5[_0xa531('0x35')]({'plain':!![]});return db[_0xa531('0x7e')]['find']({'where':{'name':_0xa531('0x36'),'userProfileId':_0x2b3441[_0xa531('0x7f')]},'raw':!![]})[_0xa531('0x38')](function(_0x574012){if(_0x574012&&_0x574012[_0xa531('0x80')]===0x0){return db['UserProfileResource']['create']({'name':_0x40a14d['name'],'resourceId':_0x40a14d['id'],'type':_0x574012['name'],'sectionId':_0x574012['id']},{})['then'](function(){return _0x1604f5;});}else{return _0x1604f5;}})['catch'](function(_0x386582){logger['error'](_0xa531('0x81'),_0x386582);throw _0x386582;});}return _0x1604f5;})[_0xa531('0x38')](respondWithResult(_0x5baf82,0xc9))[_0xa531('0x29')](handleError(_0x5baf82,null));};exports[_0xa531('0x82')]=function(_0x5e71fb,_0x414222,_0x15d197){return db['MailAccount']['findOne']({'where':{'id':_0x5e71fb[_0xa531('0x59')]['id']}})['then'](handleEntityNotFound(_0x414222,null))[_0xa531('0x38')](function(_0x196328){if(_0x196328){return _0x196328[_0xa531('0x82')]();}return null;})[_0xa531('0x38')](respondWithResult(_0x414222,null))[_0xa531('0x29')](handleError(_0x414222,null));};exports[_0xa531('0x83')]=function(_0x469d08,_0x242ff0,_0x57fcc1){if(_0x469d08[_0xa531('0x5e')]['id']){delete _0x469d08[_0xa531('0x5e')]['id'];}return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x469d08[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x242ff0,null))[_0xa531('0x38')](function(_0x468be5){if(_0x468be5){_0x469d08[_0xa531('0x5e')]['MailAccountId']=_0x468be5['id'];return db['MailServerIn'][_0xa531('0x6b')](_0x469d08[_0xa531('0x5e')]);}})[_0xa531('0x38')](respondWithResult(_0x242ff0,null))[_0xa531('0x29')](handleError(_0x242ff0,null));};exports['removeImap']=function(_0x2947e9,_0x1bdf10,_0x350e44){return db[_0xa531('0x41')][_0xa531('0x65')]({'where':{'id':_0x2947e9[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x1bdf10,null))[_0xa531('0x38')](function(_0x581a91){if(_0x581a91){return _0x581a91[_0xa531('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x1bdf10,null))['catch'](handleError(_0x1bdf10,null));};exports[_0xa531('0x85')]=function(_0x311651,_0x3c9c90,_0x5b6533){return db[_0xa531('0x41')][_0xa531('0x65')]({'where':{'id':_0x311651[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x3c9c90,null))['then'](function(_0x6232a6){if(_0x6232a6){return _0x6232a6['getSmtp']();}return null;})[_0xa531('0x38')](respondWithResult(_0x3c9c90,null))[_0xa531('0x29')](handleError(_0x3c9c90,null));};exports[_0xa531('0x86')]=function(_0x92318e,_0x4cbe2a,_0x3eec42){if(_0x92318e['body']['id']){delete _0x92318e[_0xa531('0x5e')]['id'];}return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x92318e[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x4cbe2a,null))[_0xa531('0x38')](function(_0x4ab644){if(_0x4ab644){_0x92318e[_0xa531('0x5e')]['MailAccountId']=_0x4ab644['id'];return db[_0xa531('0x3f')][_0xa531('0x6b')](_0x92318e[_0xa531('0x5e')]);}})[_0xa531('0x38')](respondWithResult(_0x4cbe2a,null))['catch'](handleError(_0x4cbe2a,null));};exports[_0xa531('0x87')]=function(_0x1325f5,_0xfb853,_0x30feb2){return db['MailAccount']['findOne']({'where':{'id':_0x1325f5[_0xa531('0x59')]['id']}})['then'](handleEntityNotFound(_0xfb853,null))[_0xa531('0x38')](function(_0x222888){if(_0x222888){return _0x222888[_0xa531('0x88')](null);}return null;})[_0xa531('0x38')](respondWithStatusCode(_0xfb853,null))[_0xa531('0x29')](handleError(_0xfb853,null));};exports['addInteraction']=function(_0x620f7f,_0xf705f5,_0x3e3d53){return db[_0xa531('0x89')][_0xa531('0x68')]({'where':{'id':_0x620f7f[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0xf705f5,null))['then'](function(_0x457b73){if(_0x457b73){return _0x457b73[_0xa531('0x8a')](_0x620f7f[_0xa531('0x5e')][_0xa531('0x69')],_[_0xa531('0x8b')](_0x620f7f['body'],['ids','id'])||{});}})[_0xa531('0x38')](respondWithResult(_0xf705f5,null))[_0xa531('0x29')](handleError(_0xf705f5,null));};exports[_0xa531('0x8c')]=function(_0x3697bf,_0x45aa2a,_0x28e189){var _0x5b5650={'raw':![],'where':{}};var _0x28c6c8={};var _0x227282={'count':0x0,'rows':[]};return db[_0xa531('0x41')]['findOne']({'where':{'id':_0x3697bf['params']['id']}})['then'](handleEntityNotFound(_0x45aa2a,null))['then'](function(_0x11559e){if(_0x11559e){_0x28c6c8[_0xa531('0x46')]=_['keys'](db['MailInteraction'][_0xa531('0x42')]);_0x28c6c8[_0xa531('0x48')]=_['keys'](_0x3697bf['query']);_0x28c6c8['filters']=_[_0xa531('0x49')](_0x28c6c8[_0xa531('0x46')],_0x28c6c8[_0xa531('0x48')]);_0x5b5650[_0xa531('0x4b')]=_['intersection'](_0x28c6c8[_0xa531('0x46')],qs['fields'](_0x3697bf['query']['fields']));_0x5b5650[_0xa531('0x4b')]=_0x5b5650[_0xa531('0x4b')][_0xa531('0x4c')]?_0x5b5650[_0xa531('0x4b')]:_0x28c6c8[_0xa531('0x46')];if(!_0x3697bf[_0xa531('0x48')][_0xa531('0x4d')]('nolimit')){_0x5b5650[_0xa531('0x2e')]=qs[_0xa531('0x2e')](_0x3697bf[_0xa531('0x48')][_0xa531('0x2e')]);_0x5b5650[_0xa531('0x2b')]=qs[_0xa531('0x2b')](_0x3697bf['query'][_0xa531('0x2b')]);}_0x5b5650[_0xa531('0x8d')]=qs[_0xa531('0x4f')](_0x3697bf['query'][_0xa531('0x4f')]);_0x5b5650[_0xa531('0x50')]=qs[_0xa531('0x52')](_[_0xa531('0x51')](_0x3697bf['query'],_0x28c6c8[_0xa531('0x52')]));_0x5b5650[_0xa531('0x50')][_0xa531('0x62')]=_0x11559e['id'];if(_0x3697bf['query'][_0xa531('0x54')]){_0x5b5650[_0xa531('0x50')]=_[_0xa531('0x55')](_0x5b5650[_0xa531('0x50')],{'$or':_[_0xa531('0x47')](_0x5b5650[_0xa531('0x4b')],function(_0x51b2ec){var _0x5f4e93={};_0x5f4e93[_0x51b2ec]={'$like':'%'+_0x3697bf[_0xa531('0x48')][_0xa531('0x54')]+'%'};return _0x5f4e93;})});}_0x5b5650=_['merge']({},_0x5b5650,_0x3697bf['options']);return db[_0xa531('0x89')]['count']({'where':_0x5b5650['where']})[_0xa531('0x38')](function(_0x3c9297){_0x227282[_0xa531('0x2d')]=_0x3c9297;if(_0x3697bf[_0xa531('0x48')]['includeAll']){_0x5b5650[_0xa531('0x66')]=[{'model':db[_0xa531('0x8e')],'as':_0xa531('0x8f'),'required':![]},{'model':db['User'],'as':_0xa531('0x90'),'attributes':['name',_0xa531('0x91'),_0xa531('0x92')],'required':![]},{'model':db[_0xa531('0x93')],'as':'Tags','attributes':['id','name',_0xa531('0x94')],'where':_0x3697bf[_0xa531('0x48')][_0xa531('0x95')]?{'id':_0x3697bf[_0xa531('0x48')]['tag']}:undefined,'required':_0x3697bf[_0xa531('0x48')][_0xa531('0x95')]?!![]:![]}];}return db[_0xa531('0x89')][_0xa531('0x6e')](_0x5b5650);})[_0xa531('0x38')](function(_0x486e9d){_0x227282['rows']=_0x486e9d;return _0x227282;});}})[_0xa531('0x38')](respondWithFilteredResult(_0x45aa2a,_0x5b5650))[_0xa531('0x29')](handleError(_0x45aa2a,null));};exports[_0xa531('0x96')]=function(_0x125ccf,_0x53f4c1,_0x24a98b){return db[_0xa531('0x41')][_0xa531('0x65')]({'where':{'id':_0x125ccf[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x53f4c1,null))[_0xa531('0x38')](function(_0x58b0b7){if(_0x58b0b7){return db[_0xa531('0x97')]['transaction'](function(_0x4a7373){return db['MailApplication'][_0xa531('0x34')]({'where':{'MailAccountId':_0x125ccf[_0xa531('0x59')]['id']},'transaction':_0x4a7373})['then'](function(_0xd70c1){var _0x64c1e2=_[_0xa531('0x47')](_0x125ccf[_0xa531('0x5e')],function(_0x29db69){_0x29db69[_0xa531('0x62')]=_0x125ccf[_0xa531('0x59')]['id'];return _0x29db69;});return db[_0xa531('0x98')][_0xa531('0x99')](_0x64c1e2,{'transaction':_0x4a7373});});})[_0xa531('0x38')](function(){return db[_0xa531('0x98')][_0xa531('0x9a')]({'where':{'MailAccountId':_0x125ccf[_0xa531('0x59')]['id']},'order':_0xa531('0x9b')});});}})[_0xa531('0x38')](respondWithResult(_0x53f4c1,null))[_0xa531('0x29')](handleError(_0x53f4c1,null));};exports[_0xa531('0x9c')]=function(_0x21efd4,_0x2bd4ba,_0x9d08e4){var _0x5a7bb0={};var _0x20fcc0={};var _0x570b55;var _0x1f79a9;return db[_0xa531('0x41')][_0xa531('0x65')]({'where':{'id':_0x21efd4[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x2bd4ba,null))['then'](function(_0x5d6fe5){if(_0x5d6fe5){_0x570b55=_0x5d6fe5;_0x20fcc0[_0xa531('0x46')]=_[_0xa531('0x5c')](db['MailApplication'][_0xa531('0x42')]);_0x20fcc0[_0xa531('0x48')]=_[_0xa531('0x5c')](_0x21efd4[_0xa531('0x48')]);_0x20fcc0[_0xa531('0x52')]=_[_0xa531('0x49')](_0x20fcc0[_0xa531('0x46')],_0x20fcc0[_0xa531('0x48')]);_0x5a7bb0['attributes']=_[_0xa531('0x49')](_0x20fcc0[_0xa531('0x46')],qs['fields'](_0x21efd4[_0xa531('0x48')][_0xa531('0x4a')]));_0x5a7bb0['attributes']=_0x5a7bb0[_0xa531('0x4b')]['length']?_0x5a7bb0[_0xa531('0x4b')]:_0x20fcc0[_0xa531('0x46')];_0x5a7bb0[_0xa531('0x8d')]=qs['sort'](_0x21efd4[_0xa531('0x48')][_0xa531('0x4f')]);_0x5a7bb0['where']=qs[_0xa531('0x52')](_[_0xa531('0x51')](_0x21efd4[_0xa531('0x48')],_0x20fcc0[_0xa531('0x52')]));if(_0x21efd4[_0xa531('0x48')][_0xa531('0x54')]){_0x5a7bb0['where']=_['merge'](_0x5a7bb0[_0xa531('0x50')],{'$or':_[_0xa531('0x47')](_0x5a7bb0['attributes'],function(_0x2506f1){var _0x3f8481={};_0x3f8481[_0x2506f1]={'$like':'%'+_0x21efd4['query']['filter']+'%'};return _0x3f8481;})});}_0x5a7bb0=_['merge']({},_0x5a7bb0,_0x21efd4[_0xa531('0x56')]);return _0x570b55['getApplications'](_0x5a7bb0);}})[_0xa531('0x38')](function(_0xf50481){if(_0xf50481){_0x1f79a9=_0xf50481['length'];if(!_0x21efd4[_0xa531('0x48')][_0xa531('0x4d')](_0xa531('0x4e'))){_0x5a7bb0[_0xa531('0x2e')]=qs[_0xa531('0x2e')](_0x21efd4[_0xa531('0x48')]['limit']);_0x5a7bb0['offset']=qs['offset'](_0x21efd4[_0xa531('0x48')][_0xa531('0x2b')]);}return _0x570b55[_0xa531('0x9c')](_0x5a7bb0);}})[_0xa531('0x38')](function(_0x21636b){if(_0x21636b){return _0x21636b?{'count':_0x1f79a9,'rows':_0x21636b}:null;}})[_0xa531('0x38')](respondWithResult(_0x2bd4ba,null))[_0xa531('0x29')](handleError(_0x2bd4ba,null));};exports[_0xa531('0x9d')]=function(_0xa93dfb,_0x4d27f5,_0x51747e){var _0x2d02a6={'raw':!![],'where':{}};var _0x312ece={};var _0x5db335={'count':0x0,'rows':[]};return db[_0xa531('0x41')]['findOne']({'where':{'id':_0xa93dfb[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x4d27f5,null))['then'](function(_0x55b923){if(_0x55b923){_0x312ece['model']=_[_0xa531('0x5c')](db[_0xa531('0x9e')][_0xa531('0x42')]);_0x312ece['query']=_['keys'](_0xa93dfb['query']);_0x312ece['filters']=_['intersection'](_0x312ece[_0xa531('0x46')],_0x312ece['query']);_0x2d02a6[_0xa531('0x4b')]=_[_0xa531('0x49')](_0x312ece[_0xa531('0x46')],qs['fields'](_0xa93dfb[_0xa531('0x48')][_0xa531('0x4a')]));_0x2d02a6['attributes']=_0x2d02a6['attributes']['length']?_0x2d02a6[_0xa531('0x4b')]:_0x312ece[_0xa531('0x46')];if(!_0xa93dfb[_0xa531('0x48')]['hasOwnProperty'](_0xa531('0x4e'))){_0x2d02a6[_0xa531('0x2e')]=qs[_0xa531('0x2e')](_0xa93dfb[_0xa531('0x48')][_0xa531('0x2e')]);_0x2d02a6[_0xa531('0x2b')]=qs[_0xa531('0x2b')](_0xa93dfb['query'][_0xa531('0x2b')]);}_0x2d02a6[_0xa531('0x8d')]=qs[_0xa531('0x4f')](_0xa93dfb['query'][_0xa531('0x4f')]);_0x2d02a6[_0xa531('0x50')]=qs[_0xa531('0x52')](_[_0xa531('0x51')](_0xa93dfb[_0xa531('0x48')],_0x312ece[_0xa531('0x52')]));_0x2d02a6[_0xa531('0x50')]['MailAccountId']=_0x55b923['id'];if(_0xa93dfb[_0xa531('0x48')][_0xa531('0x54')]){_0x2d02a6['where']=_[_0xa531('0x55')](_0x2d02a6[_0xa531('0x50')],{'$or':_[_0xa531('0x47')](_0x2d02a6[_0xa531('0x4b')],function(_0x5acc1e){var _0x58cb35={};_0x58cb35[_0x5acc1e]={'$like':'%'+_0xa93dfb[_0xa531('0x48')]['filter']+'%'};return _0x58cb35;})});}if(_0xa93dfb[_0xa531('0x48')]['$gte']){var _0x1be59c=_0xa93dfb['query'][_0xa531('0x9f')][_0xa531('0xa0')](',');var _0x43f9ad={};_0x43f9ad[_0x1be59c[0x0]]={'$gte':moment(_0x1be59c[0x1])[_0xa531('0xa1')](_0xa531('0xa2'))};_0x2d02a6['where']=_['merge'](_0x2d02a6[_0xa531('0x50')],_0x43f9ad);}_0x2d02a6=_[_0xa531('0x55')]({},_0x2d02a6,_0xa93dfb[_0xa531('0x56')]);return db['MailMessage']['count']({'where':_0x2d02a6[_0xa531('0x50')]})[_0xa531('0x38')](function(_0x4f161b){_0x5db335['count']=_0x4f161b;if(_0xa93dfb[_0xa531('0x48')][_0xa531('0x57')]){_0x2d02a6[_0xa531('0x66')]=[{'all':!![]}];}return db['MailMessage'][_0xa531('0x6e')](_0x2d02a6);})[_0xa531('0x38')](function(_0x3482fa){if(_0xa93dfb[_0xa531('0x48')][_0xa531('0xa3')]===_0xa531('0xa4')){for(var _0x39cd0a=0x0;_0x39cd0a<_0x3482fa[_0xa531('0x4c')];_0x39cd0a++){_0x3482fa[_0x39cd0a]['body']=juice(_0x3482fa[_0x39cd0a][_0xa531('0x5e')]);}}_0x5db335[_0xa531('0x58')]=_0x3482fa;return _0x5db335;});}})[_0xa531('0x38')](respondWithFilteredResult(_0x4d27f5,_0x2d02a6))['catch'](handleError(_0x4d27f5,null));};exports['send']=function(_0x48c39b,_0x509074,_0x250a89){var _0x1a25dc,_0x822059={},_0xeed885;if(_0x48c39b[_0xa531('0x5e')]['to']){_0xeed885=_0x48c39b['body']['to'][_0xa531('0xa0')](',')[0x0];}return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x48c39b[_0xa531('0x59')]['id']},'include':[{'model':db[_0xa531('0xa5')],'as':'List','include':[{'model':db[_0xa531('0x8e')],'as':'Contacts','where':{'email':_0xeed885},'limit':0x1,'order':[[_0xa531('0xa6'),_0xa531('0xa7')]]}]},{'model':db[_0xa531('0x3f')],'as':_0xa531('0x40'),'raw':!![]}]})[_0xa531('0x38')](handleEntityNotFound(_0x509074,null))[_0xa531('0x38')](function(_0x4b0716){if(_0x4b0716){_0x1a25dc=_0x4b0716;if(_0x4b0716[_0xa531('0x40')]){if(_['isNil'](_0x48c39b[_0xa531('0x5e')][_0xa531('0xa8')])){_0x48c39b[_0xa531('0x5e')]['from']=util[_0xa531('0xa1')]('%s\x20<%s>',_0x4b0716[_0xa531('0x3c')],_0x4b0716['email']||_0x4b0716[_0xa531('0x40')][_0xa531('0x75')]);}if(_0x48c39b[_0xa531('0x5e')]['attachments']&&_0x48c39b[_0xa531('0x5e')]['attachments'][_0xa531('0x4c')]){for(var _0x13a81d=0x0;_0x13a81d<_0x48c39b[_0xa531('0x5e')][_0xa531('0xa9')][_0xa531('0x4c')];_0x13a81d+=0x1){_0x48c39b[_0xa531('0x5e')][_0xa531('0xa9')][_0x13a81d]={'filename':_0x48c39b[_0xa531('0x5e')][_0xa531('0xa9')][_0x13a81d][_0xa531('0x3c')],'path':path[_0xa531('0xaa')](config[_0xa531('0xab')],_0xa531('0xac'),_0x48c39b[_0xa531('0x5e')][_0xa531('0xa9')][_0x13a81d][_0xa531('0xad')])};}}var _0x2bc64e={'tls':{'rejectUnauthorized':![]}};if(_[_0xa531('0x72')](_0x4b0716['Smtp'][_0xa531('0x7b')])){if(_0x4b0716[_0xa531('0x40')][_0xa531('0x78')]){_0x2bc64e[_0xa531('0xae')]={'user':_0x4b0716[_0xa531('0x40')][_0xa531('0x75')],'pass':_0x4b0716[_0xa531('0x40')][_0xa531('0xaf')]};}_0x2bc64e[_0xa531('0x79')]=_0x4b0716['Smtp'][_0xa531('0x79')];_0x2bc64e[_0xa531('0x7a')]=_0x4b0716['Smtp'][_0xa531('0x7a')];_0x2bc64e[_0xa531('0xb0')]=_0x4b0716[_0xa531('0x40')][_0xa531('0xb0')];}else{_0x2bc64e[_0xa531('0x7b')]=_0x4b0716[_0xa531('0x40')][_0xa531('0x7b')];_0x2bc64e[_0xa531('0xae')]={'user':_0x4b0716[_0xa531('0x40')][_0xa531('0x75')],'pass':_0x4b0716[_0xa531('0x40')][_0xa531('0xaf')]};}return respondWithRpcPromise(_0xa531('0xb1'),'sendMail',{'account':_0x2bc64e,'message':_0x48c39b[_0xa531('0x5e')]});}else{throw new Error(_0xa531('0xb2'));}}})['then'](function(_0x49a134){if(_0x49a134){_0x822059=_0x49a134;if(_0x1a25dc[_0xa531('0xb3')]){if(_0x1a25dc[_0xa531('0xb3')][_0xa531('0xb4')][_0xa531('0x4c')]){return _0x1a25dc['List'][_0xa531('0xb4')][0x0];}else{return db[_0xa531('0x8e')][_0xa531('0x6b')](_[_0xa531('0xb5')](_0x48c39b['body'],{'firstName':_0x48c39b[_0xa531('0x5e')]['to'],'email':_0x48c39b[_0xa531('0x5e')]['to'],'phone':_0x48c39b[_0xa531('0x5e')]['to'],'ListId':_0x1a25dc[_0xa531('0x71')]}));}}else{throw new Error(_0xa531('0xb2'));}}})[_0xa531('0x38')](function(_0xcd2d13){if(_0xcd2d13){var _0x148090={'UserId':_0x48c39b[_0xa531('0x75')]['id'],'ContactId':_0xcd2d13['id'],'MailAccountId':_0x1a25dc['id'],'inReplyTo':_0x822059[_0xa531('0xb6')],'to':_0x48c39b[_0xa531('0x5e')][_0xa531('0xa8')],'cc':_0x48c39b[_0xa531('0x5e')]['cc'],'subject':_0x48c39b[_0xa531('0x5e')][_0xa531('0xb7')],'attach':_0x48c39b[_0xa531('0x5e')][_0xa531('0xb8')],'firstMsgDirection':_0xa531('0xb9'),'lastMsgAt':moment()['format'](_0xa531('0xa2')),'lastMsgDirection':_0xa531('0xb9'),'Messages':[_['merge'](_0x48c39b[_0xa531('0x5e')],{'messageId':_0x822059[_0xa531('0xb6')],'sentAt':moment()[_0xa531('0xa1')](_0xa531('0xa2')),'read':!![],'MailAccountId':_0x1a25dc['id'],'UserId':_0x48c39b['user']['id'],'ContactId':_0xcd2d13['id']})]};if(_0x48c39b['body']['Interaction']){_0x148090=_[_0xa531('0x55')](_0x148090,_0x48c39b['body'][_0xa531('0xba')]);}return db[_0xa531('0x89')]['create'](_0x148090,{'include':[{'model':db[_0xa531('0x9e')],'as':'Messages'}]});}})[_0xa531('0x38')](respondWithResult(_0x509074,null))['catch'](handleError(_0x509074,null));};exports[_0xa531('0xbb')]=function(_0x5b4ab2,_0x543956,_0x45f76e){return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x5b4ab2['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0xa531('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x543956,null))[_0xa531('0x38')](function(_0x5a4b03){if(_0x5a4b03&&_0x5a4b03[_0xa531('0x40')]){var _0x36da59={'id':_0x5a4b03['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5a4b03[_0xa531('0x40')]['service']){_0x36da59['service']=_0x5a4b03[_0xa531('0x40')]['service'];}else{_0x36da59['host']=_0x5a4b03[_0xa531('0x40')][_0xa531('0x79')];_0x36da59['port']=_0x5a4b03['Smtp'][_0xa531('0x7a')];_0x36da59[_0xa531('0xb0')]=_0x5a4b03[_0xa531('0x40')][_0xa531('0xb0')];}if(_0x5a4b03[_0xa531('0x40')][_0xa531('0x78')]){_0x36da59['auth']={'user':_0x5a4b03[_0xa531('0x40')][_0xa531('0x75')],'pass':_0x5a4b03[_0xa531('0x40')][_0xa531('0xaf')]};}return respondWithRpcPromise(_0xa531('0xbc'),_0xa531('0xbb'),{'account':_0x36da59});}})[_0xa531('0x38')](respondWithResult(_0x543956,null))[_0xa531('0x29')](handleError(_0x543956,null));};exports['destroy']=function(_0x49752b,_0xa797bb){return db[_0xa531('0x41')]['find']({'where':{'id':_0x49752b[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0xa797bb,null))['then'](function(_0x239576){if(_0x239576&&_0x239576[_0xa531('0x7b')]){throw new db[(_0xa531('0xbd'))][(_0xa531('0xbe'))](_0xa531('0xbf'));}return _0x239576;})['then'](removeEntity(_0xa797bb,null))[_0xa531('0x29')](handleError(_0xa797bb,null));};exports['addAgents']=function(_0x225a6f,_0x4210c1,_0x3c5faf){return db[_0xa531('0x41')][_0xa531('0x68')]({'where':{'id':_0x225a6f[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x4210c1,null))[_0xa531('0x38')](function(_0x15713a){if(_0x15713a){return _0x15713a[_0xa531('0xc0')](_0x225a6f[_0xa531('0x5e')][_0xa531('0x69')],_[_0xa531('0x8b')](_0x225a6f['body'],[_0xa531('0x69'),'id'])||{})['spread'](function(_0x2742bf){for(var _0x4d0623=0x0;_0x4d0623<_0x225a6f['body']['ids'][_0xa531('0x4c')];_0x4d0623+=0x1){socket[_0xa531('0xc1')](_0xa531('0xc2'),{'UserId':Number(_0x225a6f[_0xa531('0x5e')][_0xa531('0x69')][_0x4d0623]),'MailAccountId':Number(_0x225a6f[_0xa531('0x59')]['id'])});}return _0x2742bf;});}})[_0xa531('0x38')](respondWithResult(_0x4210c1,null))[_0xa531('0x29')](handleError(_0x4210c1,null));};exports[_0xa531('0xc3')]=function(_0x4a10b3,_0x4b4cc4,_0x523f19){return db['MailAccount'][_0xa531('0x68')]({'where':{'id':_0x4a10b3[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x4b4cc4,null))['then'](function(_0x19acc1){if(_0x19acc1){return _0x19acc1[_0xa531('0xc3')](_0x4a10b3['query'][_0xa531('0x69')])[_0xa531('0x38')](function(){if(_[_0xa531('0xc4')](_0x4a10b3[_0xa531('0x48')][_0xa531('0x69')])){for(var _0x1cc83b=0x0;_0x1cc83b<_0x4a10b3['query']['ids'][_0xa531('0x4c')];_0x1cc83b+=0x1){socket[_0xa531('0xc1')](_0xa531('0xc5'),{'UserId':Number(_0x4a10b3[_0xa531('0x48')][_0xa531('0x69')][_0x1cc83b]),'MailAccountId':Number(_0x4a10b3[_0xa531('0x59')]['id'])});}}else{socket[_0xa531('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x4a10b3[_0xa531('0x48')][_0xa531('0x69')]),'MailAccountId':Number(_0x4a10b3[_0xa531('0x59')]['id'])});}});}})[_0xa531('0x38')](respondWithStatusCode(_0x4b4cc4,null))[_0xa531('0x29')](handleError(_0x4b4cc4,null));};exports[_0xa531('0xc6')]=function(_0x51c233,_0x3f775b,_0x3e6f33){var _0x549a70={};var _0x15b5cc={};var _0x3c5976;var _0xa203d9;return db['MailAccount']['findOne']({'where':{'id':_0x51c233[_0xa531('0x59')]['id']}})[_0xa531('0x38')](handleEntityNotFound(_0x3f775b,null))[_0xa531('0x38')](function(_0x11a159){if(_0x11a159){_0x3c5976=_0x11a159;_0x15b5cc['model']=_[_0xa531('0x5c')](db[_0xa531('0xc7')][_0xa531('0x42')]);_0x15b5cc[_0xa531('0x48')]=_[_0xa531('0x5c')](_0x51c233[_0xa531('0x48')]);_0x15b5cc[_0xa531('0x52')]=_[_0xa531('0x49')](_0x15b5cc['model'],_0x15b5cc[_0xa531('0x48')]);_0x549a70[_0xa531('0x4b')]=_[_0xa531('0x49')](_0x15b5cc['model'],qs['fields'](_0x51c233[_0xa531('0x48')][_0xa531('0x4a')]));_0x549a70[_0xa531('0x4b')]=_0x549a70[_0xa531('0x4b')]['length']?_0x549a70[_0xa531('0x4b')]:_0x15b5cc[_0xa531('0x46')];_0x549a70['order']=qs[_0xa531('0x4f')](_0x51c233[_0xa531('0x48')][_0xa531('0x4f')]);_0x549a70[_0xa531('0x50')]=qs[_0xa531('0x52')](_[_0xa531('0x51')](_0x51c233[_0xa531('0x48')],_0x15b5cc[_0xa531('0x52')]));if(_0x51c233[_0xa531('0x48')]['filter']){_0x549a70[_0xa531('0x50')]=_[_0xa531('0x55')](_0x549a70[_0xa531('0x50')],{'$or':_['map'](_0x549a70[_0xa531('0x4b')],function(_0x9337de){var _0x12a986={};_0x12a986[_0x9337de]={'$like':'%'+_0x51c233[_0xa531('0x48')][_0xa531('0x54')]+'%'};return _0x12a986;})});}_0x549a70=_[_0xa531('0x55')]({},_0x549a70,_0x51c233[_0xa531('0x56')]);return _0x3c5976['getAgents'](_0x549a70);}})[_0xa531('0x38')](function(_0x1378d9){if(_0x1378d9){_0xa203d9=_0x1378d9[_0xa531('0x4c')];if(!_0x51c233['query'][_0xa531('0x4d')](_0xa531('0x4e'))){_0x549a70[_0xa531('0x2e')]=qs[_0xa531('0x2e')](_0x51c233['query']['limit']);_0x549a70[_0xa531('0x2b')]=qs['offset'](_0x51c233[_0xa531('0x48')]['offset']);}return _0x3c5976[_0xa531('0xc6')](_0x549a70);}})[_0xa531('0x38')](function(_0x2f8abc){if(_0x2f8abc){return _0x2f8abc?{'count':_0xa203d9,'rows':_0x2f8abc}:null;}})[_0xa531('0x38')](respondWithResult(_0x3f775b,null))[_0xa531('0x29')](handleError(_0x3f775b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index cc14e69..0c3c33a 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 _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','MailAccount'];(function(_0x207f10,_0x1a9ff8){var _0x49f99a=function(_0x45515e){while(--_0x45515e){_0x207f10['push'](_0x207f10['shift']());}};_0x49f99a(++_0x1a9ff8);}(_0xdd68,0x196));var _0x8dd6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdd68[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x8dd6('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){MailAccountEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);MailAccountEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x8dd6('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xdab6=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x708cfa,_0x413d56){var _0x2418ca=function(_0x215ea2){while(--_0x215ea2){_0x708cfa['push'](_0x708cfa['shift']());}};_0x2418ca(++_0x413d56);}(_0xdab6,0x9a));var _0x6dab=function(_0x3643d5,_0x6e02f5){_0x3643d5=_0x3643d5-0x0;var _0x1f29d7=_0xdab6[_0x3643d5];return _0x1f29d7;};'use strict';var EventEmitter=require(_0x6dab('0x0'));var MailAccount=require(_0x6dab('0x1'))['db'][_0x6dab('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6dab('0x3')](0x0);var events={'afterCreate':_0x6dab('0x4'),'afterUpdate':_0x6dab('0x5'),'afterDestroy':_0x6dab('0x6')};function emitEvent(_0x345b42){return function(_0x450920,_0xff6846,_0x51ae51){MailAccountEvents[_0x6dab('0x7')](_0x345b42+':'+_0x450920['id'],_0x450920);MailAccountEvents[_0x6dab('0x7')](_0x345b42,_0x450920);_0x51ae51(null);};}for(var e in events){if(events[_0x6dab('0x8')](e)){var event=events[e];MailAccount[_0x6dab('0x9')](e,emitEvent(event));}}module[_0x6dab('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 9036e38..ef26683 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 _0x7764=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts'];(function(_0x57a725,_0x82c598){var _0x842833=function(_0x52235f){while(--_0x52235f){_0x57a725['push'](_0x57a725['shift']());}};_0x842833(++_0x82c598);}(_0x7764,0x113));var _0x4776=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7764[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x4776('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rp=require(_0x4776('0x4'));var fs=require('fs');var path=require(_0x4776('0x5'));var rimraf=require(_0x4776('0x6'));var config=require(_0x4776('0x7'));var attributes=require(_0x4776('0x8'));module['exports']=function(_0x522945,_0x16c4dc){return _0x522945[_0x4776('0x9')]('MailAccount',attributes,{'tableName':_0x4776('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c42=['lodash','util','api','moment','bluebird','request-promise','path','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x455502,_0x6451e9){var _0x4053eb=function(_0x19df60){while(--_0x19df60){_0x455502['push'](_0x455502['shift']());}};_0x4053eb(++_0x6451e9);}(_0x3c42,0x13f));var _0x23c4=function(_0x276b89,_0x34a7a4){_0x276b89=_0x276b89-0x0;var _0x1f37cf=_0x3c42[_0x276b89];return _0x1f37cf;};'use strict';var _=require(_0x23c4('0x0'));var util=require(_0x23c4('0x1'));var logger=require('../../config/logger')(_0x23c4('0x2'));var moment=require(_0x23c4('0x3'));var BPromise=require(_0x23c4('0x4'));var rp=require(_0x23c4('0x5'));var fs=require('fs');var path=require(_0x23c4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23c4('0x7'));module[_0x23c4('0x8')]=function(_0x2d9d33,_0x559446){return _0x2d9d33['define'](_0x23c4('0x9'),attributes,{'tableName':_0x23c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index c44b245..a84e4c1 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 _0x8bf4=['rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowMailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','MailServerOut','List','omit','Applications','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','List\x20not\x20found','contact','messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','format','get','interaction','created','subject','bcc','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x3fc9f2,_0x563559){var _0x3b7a42=function(_0x445999){while(--_0x445999){_0x3fc9f2['push'](_0x3fc9f2['shift']());}};_0x3b7a42(++_0x563559);}(_0x8bf4,0x134));var _0x48bf=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x8bf4[_0x498334];return _0x13bb70;};'use strict';var _=require(_0x48bf('0x0'));var util=require(_0x48bf('0x1'));var moment=require(_0x48bf('0x2'));var BPromise=require(_0x48bf('0x3'));var rs=require(_0x48bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x48bf('0x5'));var logger=require(_0x48bf('0x6'))(_0x48bf('0x7'));var config=require(_0x48bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48bf('0x9')]['http']({'port':0x232c});config[_0x48bf('0xa')]=_[_0x48bf('0xb')](config[_0x48bf('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x48bf('0xc'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x48bf('0xd')](socket);function respondWithRpcPromise(_0x8f9feb,_0x486fcf,_0x3c9431){return new BPromise(function(_0x32c0a3,_0x4ed369){return client[_0x48bf('0xe')](_0x8f9feb,_0x3c9431)['then'](function(_0x451243){logger['info'](_0x48bf('0xf'),_0x486fcf,'request\x20sent');logger[_0x48bf('0x10')](_0x48bf('0x11'),_0x486fcf,_0x48bf('0x12'),JSON[_0x48bf('0x13')](_0x451243));if(_0x451243[_0x48bf('0x14')]){if(_0x451243[_0x48bf('0x14')][_0x48bf('0x15')]===0x1f4){logger['error'](_0x48bf('0xf'),_0x486fcf,_0x451243['error'][_0x48bf('0x16')]);return _0x4ed369(_0x451243[_0x48bf('0x14')][_0x48bf('0x16')]);}logger['error'](_0x48bf('0xf'),_0x486fcf,_0x451243['error']['message']);return _0x32c0a3(_0x451243[_0x48bf('0x14')]['message']);}else{logger[_0x48bf('0x17')](_0x48bf('0xf'),_0x486fcf,_0x48bf('0x12'));_0x32c0a3(_0x451243[_0x48bf('0x18')]['message']);}})[_0x48bf('0x19')](function(_0x3f0e2b){logger[_0x48bf('0x14')](_0x48bf('0xf'),_0x486fcf,_0x3f0e2b);_0x4ed369(_0x3f0e2b);});});}exports[_0x48bf('0x1a')]=function(_0x211d3a){var _0x1b094e=this;return new Promise(function(_0x3efe11,_0xa4c699){return db[_0x48bf('0x1b')][_0x48bf('0x1c')]({'raw':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a['options'][_0x48bf('0x1e')]===undefined?!![]:![]:!![],'where':_0x211d3a['options']?_0x211d3a['options'][_0x48bf('0x1f')]||null:null,'attributes':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x20')]||null:null,'limit':_0x211d3a[_0x48bf('0x1d')]?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x21')]||null:null,'include':_0x211d3a['options']?_0x211d3a[_0x48bf('0x1d')][_0x48bf('0x22')]?_['map'](_0x211d3a['options']['include'],function(_0x3a0f02){return{'model':db[_0x3a0f02[_0x48bf('0x23')]],'as':_0x3a0f02['as'],'attributes':_0x3a0f02[_0x48bf('0x20')],'include':_0x3a0f02[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x3a0f02['include'],function(_0x5be420){return{'model':db[_0x5be420['model']],'as':_0x5be420['as'],'attributes':_0x5be420[_0x48bf('0x20')],'include':_0x5be420[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x5be420[_0x48bf('0x22')],function(_0xa5cee3){return{'model':db[_0xa5cee3['model']],'as':_0xa5cee3['as'],'attributes':_0xa5cee3[_0x48bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x48bf('0x25')](function(_0x1565b5){logger[_0x48bf('0x17')](_0x48bf('0x1a'),_0x211d3a);logger[_0x48bf('0x10')](_0x48bf('0x1a'),_0x211d3a,JSON['stringify'](_0x1565b5));_0x3efe11(_0x1565b5);})[_0x48bf('0x19')](function(_0x19b3e4){logger[_0x48bf('0x14')]('GetMailAccount',_0x19b3e4[_0x48bf('0x16')],_0x211d3a);_0xa4c699(_0x1b094e[_0x48bf('0x14')](0x1f4,_0x19b3e4[_0x48bf('0x16')]));});});};exports[_0x48bf('0x26')]=function(_0x2f4c24){var _0x2c29f6=this;return new Promise(function(_0x3c5a9c,_0x2a741d){return db[_0x48bf('0x1b')][_0x48bf('0x27')]({'raw':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')]['where']||null:null,'attributes':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24[_0x48bf('0x1d')][_0x48bf('0x20')]||null:null,'include':_0x2f4c24[_0x48bf('0x1d')]?_0x2f4c24['options']['include']?_['map'](_0x2f4c24['options'][_0x48bf('0x22')],function(_0xa7ef7a){return{'model':db[_0xa7ef7a[_0x48bf('0x23')]],'as':_0xa7ef7a['as'],'attributes':_0xa7ef7a[_0x48bf('0x20')],'include':_0xa7ef7a[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0xa7ef7a[_0x48bf('0x22')],function(_0x5074a3){return{'model':db[_0x5074a3['model']],'as':_0x5074a3['as'],'attributes':_0x5074a3[_0x48bf('0x20')],'include':_0x5074a3[_0x48bf('0x22')]?_[_0x48bf('0x24')](_0x5074a3['include'],function(_0x3e9851){return{'model':db[_0x3e9851['model']],'as':_0x3e9851['as'],'attributes':_0x3e9851[_0x48bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x48bf('0x25')](function(_0x368897){logger[_0x48bf('0x17')](_0x48bf('0x26'),_0x2f4c24);logger[_0x48bf('0x10')]('ShowMailAccount',_0x2f4c24,JSON[_0x48bf('0x13')](_0x368897));_0x3c5a9c(_0x368897);})[_0x48bf('0x19')](function(_0x513f63){logger[_0x48bf('0x14')](_0x48bf('0x26'),_0x513f63[_0x48bf('0x16')],_0x2f4c24);_0x2a741d(_0x2c29f6[_0x48bf('0x14')](0x1f4,_0x513f63[_0x48bf('0x16')]));});});};exports[_0x48bf('0x28')]=function(_0x5aba9d){var _0x3ba08a=this;return new Promise(function(_0x16241a,_0x279e61){var _0x44ea5b={'body':_0x5aba9d['body'],'channel':_0x48bf('0x29')};var _0x6fbd58=_[_0x48bf('0x2a')](_[_0x48bf('0x2b')](db[_0x48bf('0x2c')][_0x48bf('0x2d')]),['createdAt',_0x48bf('0x2e'),_0x48bf('0x2f'),_0x48bf('0x30')]);var _0x4233e3=![];if(_0x5aba9d[_0x48bf('0x31')]['id']){delete _0x5aba9d[_0x48bf('0x31')]['id'];}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')])||_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')]===''){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x34')));}if(_[_0x48bf('0x32')](_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x35')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x36')+_0x6fbd58));}if(!_[_0x48bf('0x37')](_0x6fbd58,_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x35')])){return _0x279e61(_0x3ba08a[_0x48bf('0x14')](0x1f4,_0x48bf('0x38')+_0x6fbd58));}var _0x1f99c0={};_0x1f99c0[_0x5aba9d[_0x48bf('0x31')]['mapKey']]=_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')];return db['MailAccount'][_0x48bf('0x27')]({'where':{'id':_0x5aba9d[_0x48bf('0x39')]['id']},'include':[{'model':db[_0x48bf('0x3a')],'as':'List','include':[{'model':db[_0x48bf('0x2c')],'as':_0x48bf('0x3b'),'where':_0x1f99c0,'limit':0x1,'order':[[_0x48bf('0x2e'),_0x48bf('0x3c')]]}]},{'model':db[_0x48bf('0x3d')],'as':'Applications'},{'model':db[_0x48bf('0x3e')],'as':'Smtp'}]})[_0x48bf('0x25')](function(_0x4eccc6){if(_0x4eccc6&&_0x4eccc6[_0x48bf('0x3f')]){var _0x5ad965=_0x4eccc6['get']({'plain':!![]});_0x44ea5b['account']=_[_0x48bf('0x40')](_0x5ad965,[_0x48bf('0x41'),_0x48bf('0x3f')]);_0x44ea5b[_0x48bf('0x42')]=_0x5ad965[_0x48bf('0x41')];_0x44ea5b['list']=_0x5ad965[_0x48bf('0x3f')];_0x44ea5b['applications']=_[_0x48bf('0x43')](_0x44ea5b['applications'],[_0x48bf('0x44')],[_0x48bf('0x45')]);if(_0x44ea5b['account']&&_0x44ea5b['account'][_0x48bf('0x46')]){_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x47')]({'id':0x0,'priority':_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x48')]+0x1,'app':'close','appdata':_0x48bf('0x46'),'interval':_0x48bf('0x49')});}if(_0x44ea5b[_0x48bf('0x39')][_0x48bf('0x41')]){delete _0x44ea5b[_0x48bf('0x39')]['Applications'];}if(_0x44ea5b['account']['List']){delete _0x44ea5b[_0x48bf('0x39')][_0x48bf('0x3f')];}if(_0x5ad965['List'][_0x48bf('0x3b')][_0x48bf('0x48')]){return _0x5ad965[_0x48bf('0x3f')][_0x48bf('0x3b')][0x0];}var _0xb98cbf=_[_0x48bf('0xb')](_0x5aba9d[_0x48bf('0x31')],{'firstName':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')],'ListId':_0x5ad965['ListId']});_0xb98cbf[_0x5aba9d['body'][_0x48bf('0x35')]]=_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x33')];return db[_0x48bf('0x2c')]['create'](_0xb98cbf);}else{throw new Error(_0x48bf('0x4a'));}})[_0x48bf('0x25')](function(_0x5b8758){_0x44ea5b[_0x48bf('0x4b')]=_0x5b8758;if(_0x5b8758){if(!_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')]){_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')]=rs[_0x48bf('0x4d')]()+'\x20'+_0x5aba9d['body'][_0x48bf('0x16')][_0x48bf('0x33')];}var _0x234bed={'ContactId':_0x5b8758['id'],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id'],'inReplyTo':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['messageId'],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x33')],'cc':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['cc'],'subject':_0x5aba9d[_0x48bf('0x31')]['message']['subject'],'attach':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'lastMsgAt':moment()['format'](_0x48bf('0x4f')),'lastMsgDirection':'in'};return db[_0x48bf('0x50')][_0x48bf('0x27')]({'where':{'closed':![],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id']},'include':[{'model':db[_0x48bf('0x51')],'as':_0x48bf('0x52'),'attributes':[_0x48bf('0x4c')],'where':{'messageId':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x53')]}}]})['then'](function(_0x3a2a20){if(_0x3a2a20){return[_0x3a2a20,![]];}return db[_0x48bf('0x50')][_0x48bf('0x54')](_0x234bed)['then'](function(_0x41520e){return[_0x41520e,!![]];});});}else{throw new Error(_0x48bf('0x55'));}})[_0x48bf('0x56')](function(_0x1bdcf0,_0x33b67b){if(_0x1bdcf0){_0x4233e3=_0x33b67b;if(!_0x33b67b){return _0x1bdcf0[_0x48bf('0x57')]({'inReplyTo':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4c')],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['from'],'cc':_0x5aba9d[_0x48bf('0x31')]['message']['cc'],'subject':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['subject'],'attach':_0x1bdcf0[_0x48bf('0x4e')]?_0x1bdcf0[_0x48bf('0x4e')]:_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x48bf('0x4f')),'lastMsgAt':moment()[_0x48bf('0x58')](_0x48bf('0x4f')),'lastMsgDirection':'in'});}else{return _0x1bdcf0;}}})[_0x48bf('0x25')](function(_0x23546d){_0x44ea5b['interaction']=_0x23546d[_0x48bf('0x59')]({'plain':!![]});_0x44ea5b[_0x48bf('0x5a')][_0x48bf('0x5b')]=_0x4233e3;return db[_0x48bf('0x51')][_0x48bf('0x54')]({'body':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x31')],'MailAccountId':_0x5aba9d[_0x48bf('0x39')]['id'],'MailInteractionId':_0x23546d['id'],'direction':'in','ContactId':_0x44ea5b['contact']['id'],'messageId':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['messageId'],'from':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x33')],'to':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['to'],'cc':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['cc'],'subject':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x5c')],'attach':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')][_0x48bf('0x4e')],'Attachments':_0x5aba9d[_0x48bf('0x31')]['message']['attachments'],'originTo':_0x5aba9d['body'][_0x48bf('0x16')]['originTo'],'originCc':_0x5aba9d['body'][_0x48bf('0x16')]['originCc'],'bcc':_0x5aba9d['body'][_0x48bf('0x16')][_0x48bf('0x5d')],'ChatWebsiteId':_0x5aba9d['body'][_0x48bf('0x16')]['ChatWebsiteId']||null,'originChannel':_0x5aba9d[_0x48bf('0x31')][_0x48bf('0x16')]['originChannel']||_0x48bf('0x5e'),'ChatOfflineMessageId':_0x5aba9d[_0x48bf('0x31')]['message'][_0x48bf('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x48bf('0x60')}]});})[_0x48bf('0x25')](function(_0x3c48b6){_0x44ea5b[_0x48bf('0x16')]=_0x3c48b6;if(_0x44ea5b[_0x48bf('0x5a')][_0x48bf('0x61')]){return db[_0x48bf('0x62')]['find']({'attributes':['id',_0x48bf('0x63')],'where':{'id':_0x44ea5b['interaction']['UserId']}})['then'](function(_0x4ed88f){if(_0x4ed88f){_0x44ea5b[_0x48bf('0x42')][_0x48bf('0x64')]({'id':0x0,'priority':0x0,'app':_0x48bf('0x65'),'appdata':_0x4ed88f[_0x48bf('0x63')]+','+(_0x44ea5b['account'][_0x48bf('0x66')]||0xa),'interval':_0x48bf('0x49')});}return respondWithRpcPromise(_0x48bf('0x67'),_0x48bf('0x68'),_0x44ea5b);});}return respondWithRpcPromise(_0x48bf('0x67'),_0x48bf('0x68'),_0x44ea5b);})[_0x48bf('0x25')](function(_0x27c1e0){_0x16241a(_0x27c1e0);})[_0x48bf('0x19')](function(_0x127354){_0x279e61(_0x3ba08a['error'](0x1f4,_0x127354['message']));});});}; \ No newline at end of file +var _0x9ca1=['message','info','result','catch','findAll','options','raw','where','attributes','map','include','model','ShowMailAccount','MailAccount','find','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','CmContact','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','autoclose','push','length','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x47cab2,_0x302dfe){var _0x134c72=function(_0x2153f2){while(--_0x2153f2){_0x47cab2['push'](_0x47cab2['shift']());}};_0x134c72(++_0x302dfe);}(_0x9ca1,0x113));var _0x19ca=function(_0x574a89,_0x3a2fab){_0x574a89=_0x574a89-0x0;var _0x351983=_0x9ca1[_0x574a89];return _0x351983;};'use strict';var _=require(_0x19ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x19ca('0x1'));var rs=require(_0x19ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ca('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x19ca('0x4'));var config=require(_0x19ca('0x5'));var jayson=require(_0x19ca('0x6'));var client=jayson[_0x19ca('0x7')][_0x19ca('0x8')]({'port':0x232c});config[_0x19ca('0x9')]=_[_0x19ca('0xa')](config[_0x19ca('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x19ca('0xb'))(new Redis(config[_0x19ca('0x9')]));require('./mailAccount.socket')[_0x19ca('0xc')](socket);function respondWithRpcPromise(_0x3be7e8,_0x3e7a6f,_0x379847){return new BPromise(function(_0x20fd0e,_0x4c03d1){return client[_0x19ca('0xd')](_0x3be7e8,_0x379847)[_0x19ca('0xe')](function(_0x1c9971){logger['info'](_0x19ca('0xf'),_0x3e7a6f,_0x19ca('0x10'));logger[_0x19ca('0x11')](_0x19ca('0x12'),_0x3e7a6f,_0x19ca('0x10'),JSON[_0x19ca('0x13')](_0x1c9971));if(_0x1c9971['error']){if(_0x1c9971[_0x19ca('0x14')][_0x19ca('0x15')]===0x1f4){logger[_0x19ca('0x14')](_0x19ca('0xf'),_0x3e7a6f,_0x1c9971['error']['message']);return _0x4c03d1(_0x1c9971['error']['message']);}logger[_0x19ca('0x14')](_0x19ca('0xf'),_0x3e7a6f,_0x1c9971['error'][_0x19ca('0x16')]);return _0x20fd0e(_0x1c9971['error']['message']);}else{logger[_0x19ca('0x17')](_0x19ca('0xf'),_0x3e7a6f,_0x19ca('0x10'));_0x20fd0e(_0x1c9971[_0x19ca('0x18')][_0x19ca('0x16')]);}})[_0x19ca('0x19')](function(_0x11b200){logger[_0x19ca('0x14')](_0x19ca('0xf'),_0x3e7a6f,_0x11b200);_0x4c03d1(_0x11b200);});});}exports['GetMailAccount']=function(_0x55c9cd){var _0x400bcc=this;return new Promise(function(_0x20d0bd,_0x4e1a8f){return db['MailAccount'][_0x19ca('0x1a')]({'raw':_0x55c9cd['options']?_0x55c9cd[_0x19ca('0x1b')][_0x19ca('0x1c')]===undefined?!![]:![]:!![],'where':_0x55c9cd['options']?_0x55c9cd[_0x19ca('0x1b')][_0x19ca('0x1d')]||null:null,'attributes':_0x55c9cd[_0x19ca('0x1b')]?_0x55c9cd['options']['attributes']||null:null,'limit':_0x55c9cd[_0x19ca('0x1b')]?_0x55c9cd[_0x19ca('0x1b')]['limit']||null:null,'include':_0x55c9cd['options']?_0x55c9cd[_0x19ca('0x1b')]['include']?_['map'](_0x55c9cd[_0x19ca('0x1b')]['include'],function(_0x48c358){return{'model':db[_0x48c358['model']],'as':_0x48c358['as'],'attributes':_0x48c358[_0x19ca('0x1e')],'include':_0x48c358['include']?_[_0x19ca('0x1f')](_0x48c358[_0x19ca('0x20')],function(_0x21a549){return{'model':db[_0x21a549['model']],'as':_0x21a549['as'],'attributes':_0x21a549[_0x19ca('0x1e')],'include':_0x21a549[_0x19ca('0x20')]?_[_0x19ca('0x1f')](_0x21a549[_0x19ca('0x20')],function(_0x131c8a){return{'model':db[_0x131c8a[_0x19ca('0x21')]],'as':_0x131c8a['as'],'attributes':_0x131c8a[_0x19ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x19ca('0xe')](function(_0x54163e){logger[_0x19ca('0x17')]('GetMailAccount',_0x55c9cd);logger[_0x19ca('0x11')]('GetMailAccount',_0x55c9cd,JSON[_0x19ca('0x13')](_0x54163e));_0x20d0bd(_0x54163e);})[_0x19ca('0x19')](function(_0x160a2c){logger[_0x19ca('0x14')]('GetMailAccount',_0x160a2c[_0x19ca('0x16')],_0x55c9cd);_0x4e1a8f(_0x400bcc[_0x19ca('0x14')](0x1f4,_0x160a2c[_0x19ca('0x16')]));});});};exports[_0x19ca('0x22')]=function(_0x4305d7){var _0x107f42=this;return new Promise(function(_0x14ebf6,_0x1d882c){return db[_0x19ca('0x23')][_0x19ca('0x24')]({'raw':_0x4305d7[_0x19ca('0x1b')]?_0x4305d7[_0x19ca('0x1b')][_0x19ca('0x1c')]===undefined?!![]:![]:!![],'where':_0x4305d7[_0x19ca('0x1b')]?_0x4305d7[_0x19ca('0x1b')][_0x19ca('0x1d')]||null:null,'attributes':_0x4305d7['options']?_0x4305d7['options'][_0x19ca('0x1e')]||null:null,'include':_0x4305d7[_0x19ca('0x1b')]?_0x4305d7[_0x19ca('0x1b')][_0x19ca('0x20')]?_[_0x19ca('0x1f')](_0x4305d7[_0x19ca('0x1b')][_0x19ca('0x20')],function(_0x250c51){return{'model':db[_0x250c51[_0x19ca('0x21')]],'as':_0x250c51['as'],'attributes':_0x250c51[_0x19ca('0x1e')],'include':_0x250c51['include']?_['map'](_0x250c51[_0x19ca('0x20')],function(_0x17ba6d){return{'model':db[_0x17ba6d[_0x19ca('0x21')]],'as':_0x17ba6d['as'],'attributes':_0x17ba6d[_0x19ca('0x1e')],'include':_0x17ba6d['include']?_[_0x19ca('0x1f')](_0x17ba6d[_0x19ca('0x20')],function(_0x1606f4){return{'model':db[_0x1606f4[_0x19ca('0x21')]],'as':_0x1606f4['as'],'attributes':_0x1606f4[_0x19ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x19ca('0xe')](function(_0x2c824f){logger['info'](_0x19ca('0x22'),_0x4305d7);logger[_0x19ca('0x11')]('ShowMailAccount',_0x4305d7,JSON[_0x19ca('0x13')](_0x2c824f));_0x14ebf6(_0x2c824f);})[_0x19ca('0x19')](function(_0x6be520){logger[_0x19ca('0x14')](_0x19ca('0x22'),_0x6be520[_0x19ca('0x16')],_0x4305d7);_0x1d882c(_0x107f42['error'](0x1f4,_0x6be520[_0x19ca('0x16')]));});});};exports['NotifyMailAccount']=function(_0x242038){var _0x2ab776=this;return new Promise(function(_0x25386f,_0x39c16c){var _0x193629={'body':_0x242038[_0x19ca('0x25')],'channel':_0x19ca('0x26')};var _0x319f05=_[_0x19ca('0x27')](_[_0x19ca('0x28')](db['CmContact'][_0x19ca('0x29')]),[_0x19ca('0x2a'),_0x19ca('0x2b'),'CompanyId',_0x19ca('0x2c')]);var _0x530c4e=![];if(_0x242038[_0x19ca('0x25')]['id']){delete _0x242038[_0x19ca('0x25')]['id'];}if(_[_0x19ca('0x2d')](_0x242038[_0x19ca('0x25')][_0x19ca('0x2e')])){return _0x39c16c(_0x2ab776[_0x19ca('0x14')](0x1f4,_0x19ca('0x2f')));}if(_[_0x19ca('0x2d')](_0x242038[_0x19ca('0x25')][_0x19ca('0x25')])||_0x242038[_0x19ca('0x25')][_0x19ca('0x25')]===''){return _0x39c16c(_0x2ab776[_0x19ca('0x14')](0x1f4,_0x19ca('0x30')));}if(_['isNil'](_0x242038[_0x19ca('0x25')][_0x19ca('0x31')])){return _0x39c16c(_0x2ab776[_0x19ca('0x14')](0x1f4,_0x19ca('0x32')+_0x319f05));}if(!_[_0x19ca('0x33')](_0x319f05,_0x242038[_0x19ca('0x25')][_0x19ca('0x31')])){return _0x39c16c(_0x2ab776['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x319f05));}var _0x5980dd={};_0x5980dd[_0x242038[_0x19ca('0x25')]['mapKey']]=_0x242038[_0x19ca('0x25')][_0x19ca('0x2e')];return db['MailAccount']['find']({'where':{'id':_0x242038[_0x19ca('0x34')]['id']},'include':[{'model':db[_0x19ca('0x35')],'as':_0x19ca('0x36'),'include':[{'model':db[_0x19ca('0x37')],'as':'Contacts','where':_0x5980dd,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x19ca('0x38')],'as':_0x19ca('0x39')},{'model':db[_0x19ca('0x3a')],'as':_0x19ca('0x3b')}]})[_0x19ca('0xe')](function(_0x1a351c){if(_0x1a351c&&_0x1a351c['List']){var _0x45d40a=_0x1a351c[_0x19ca('0x3c')]({'plain':!![]});_0x193629[_0x19ca('0x34')]=_[_0x19ca('0x3d')](_0x45d40a,[_0x19ca('0x39'),_0x19ca('0x36')]);_0x193629[_0x19ca('0x3e')]=_0x45d40a[_0x19ca('0x39')];_0x193629[_0x19ca('0x3f')]=_0x45d40a['List'];_0x193629[_0x19ca('0x3e')]=_[_0x19ca('0x40')](_0x193629[_0x19ca('0x3e')],['priority'],['asc']);if(_0x193629[_0x19ca('0x34')]&&_0x193629[_0x19ca('0x34')][_0x19ca('0x41')]){_0x193629['applications'][_0x19ca('0x42')]({'id':0x0,'priority':_0x193629['applications'][_0x19ca('0x43')]+0x1,'app':'close','appdata':_0x19ca('0x41'),'interval':_0x19ca('0x44')});}if(_0x193629[_0x19ca('0x34')][_0x19ca('0x39')]){delete _0x193629['account'][_0x19ca('0x39')];}if(_0x193629[_0x19ca('0x34')][_0x19ca('0x36')]){delete _0x193629['account'][_0x19ca('0x36')];}if(_0x45d40a['List'][_0x19ca('0x45')][_0x19ca('0x43')]){return _0x45d40a[_0x19ca('0x36')][_0x19ca('0x45')][0x0];}var _0x272375=_[_0x19ca('0xa')](_0x242038['body'],{'firstName':_0x242038['body'][_0x19ca('0x2e')],'ListId':_0x45d40a[_0x19ca('0x2c')]});_0x272375[_0x242038[_0x19ca('0x25')][_0x19ca('0x31')]]=_0x242038[_0x19ca('0x25')]['from'];return db[_0x19ca('0x37')][_0x19ca('0x46')](_0x272375);}else{throw new Error(_0x19ca('0x47'));}})[_0x19ca('0xe')](function(_0x107875){_0x193629[_0x19ca('0x48')]=_0x107875;if(_0x107875){if(!_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x49')]){_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x49')]=rs['generate']()+'\x20'+_0x242038['body']['message'][_0x19ca('0x2e')];}var _0x2192cb={'ContactId':_0x107875['id'],'MailAccountId':_0x242038[_0x19ca('0x34')]['id'],'inReplyTo':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['messageId'],'to':_0x242038[_0x19ca('0x25')]['message'][_0x19ca('0x2e')],'cc':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['cc'],'subject':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['subject'],'attach':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x4a')],'lastMsgAt':moment()[_0x19ca('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x19ca('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0x242038[_0x19ca('0x34')]['id']},'include':[{'model':db[_0x19ca('0x4d')],'as':_0x19ca('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x4f')]}}]})[_0x19ca('0xe')](function(_0x495c54){if(_0x495c54){return[_0x495c54,![]];}return db[_0x19ca('0x4c')][_0x19ca('0x46')](_0x2192cb)[_0x19ca('0xe')](function(_0x76640e){return[_0x76640e,!![]];});});}else{throw new Error(_0x19ca('0x50'));}})[_0x19ca('0x51')](function(_0x5ca724,_0xeacf0f){if(_0x5ca724){_0x530c4e=_0xeacf0f;if(!_0xeacf0f){return _0x5ca724['update']({'inReplyTo':_0x242038['body'][_0x19ca('0x16')][_0x19ca('0x49')],'to':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['from'],'cc':_0x242038[_0x19ca('0x25')]['message']['cc'],'subject':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x52')],'attach':_0x5ca724['attach']?_0x5ca724[_0x19ca('0x4a')]:_0x242038['body']['message']['attach'],'substatus':null,'substatusAt':moment()['format'](_0x19ca('0x53')),'lastMsgAt':moment()[_0x19ca('0x4b')](_0x19ca('0x53')),'lastMsgDirection':'in'});}else{return _0x5ca724;}}})['then'](function(_0x46e860){_0x193629[_0x19ca('0x54')]=_0x46e860[_0x19ca('0x3c')]({'plain':!![]});_0x193629[_0x19ca('0x54')][_0x19ca('0x55')]=_0x530c4e;return db[_0x19ca('0x4d')][_0x19ca('0x46')]({'body':_0x242038[_0x19ca('0x25')]['body'],'MailAccountId':_0x242038['account']['id'],'MailInteractionId':_0x46e860['id'],'direction':'in','ContactId':_0x193629[_0x19ca('0x48')]['id'],'messageId':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x49')],'from':_0x242038['body'][_0x19ca('0x16')][_0x19ca('0x2e')],'to':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['to'],'cc':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['cc'],'subject':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['subject'],'attach':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x4a')],'Attachments':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x56')],'originTo':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x57')],'originCc':_0x242038[_0x19ca('0x25')]['message']['originCc'],'bcc':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x58')],'ChatWebsiteId':_0x242038[_0x19ca('0x25')]['message'][_0x19ca('0x59')]||null,'originChannel':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')][_0x19ca('0x5a')]||_0x19ca('0x5b'),'ChatOfflineMessageId':_0x242038[_0x19ca('0x25')][_0x19ca('0x16')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x19ca('0xe')](function(_0x43ff0c){_0x193629[_0x19ca('0x16')]=_0x43ff0c;if(_0x193629[_0x19ca('0x54')][_0x19ca('0x5c')]){return db[_0x19ca('0x5d')]['find']({'attributes':['id','name'],'where':{'id':_0x193629[_0x19ca('0x54')][_0x19ca('0x5c')]}})[_0x19ca('0xe')](function(_0x363ce7){if(_0x363ce7){_0x193629[_0x19ca('0x3e')][_0x19ca('0x5e')]({'id':0x0,'priority':0x0,'app':_0x19ca('0x5f'),'appdata':_0x363ce7['name']+','+(_0x193629[_0x19ca('0x34')][_0x19ca('0x60')]||0xa),'interval':_0x19ca('0x44')});}return respondWithRpcPromise(_0x19ca('0x61'),_0x19ca('0x62'),_0x193629);});}return respondWithRpcPromise(_0x19ca('0x61'),_0x19ca('0x62'),_0x193629);})[_0x19ca('0xe')](function(_0x473a60){_0x25386f(_0x473a60);})[_0x19ca('0x19')](function(_0xe82d68){_0x39c16c(_0x2ab776[_0x19ca('0x14')](0x1f4,_0xe82d68[_0x19ca('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 124c571..afe5d3b 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 _0x3958=['length','mailAccount:','./mailAccount.events','save','emit','removeListener'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3958,0xe0));var _0x8395=function(_0xf0cc23,_0x136903){_0xf0cc23=_0xf0cc23-0x0;var _0xdc8dd9=_0x3958[_0xf0cc23];return _0xdc8dd9;};'use strict';var MailAccountEvents=require(_0x8395('0x0'));var events=[_0x8395('0x1'),'remove','update'];function createListener(_0x3de2a4,_0x2ed2cc){return function(_0x456f16){_0x2ed2cc[_0x8395('0x2')](_0x3de2a4,_0x456f16);};}function removeListener(_0x31b2c9,_0x45d894){return function(){MailAccountEvents[_0x8395('0x3')](_0x31b2c9,_0x45d894);};}exports['register']=function(_0x348cc4){for(var _0x1df63d=0x0,_0x1619bb=events[_0x8395('0x4')];_0x1df63d<_0x1619bb;_0x1df63d++){var _0x427b93=events[_0x1df63d];var _0x13b051=createListener(_0x8395('0x5')+_0x427b93,_0x348cc4);MailAccountEvents['on'](_0x427b93,_0x13b051);}}; \ No newline at end of file +var _0xdc15=['mailAccount:','./mailAccount.events','remove','update','removeListener','length'];(function(_0x527826,_0x4b946d){var _0x2bbb34=function(_0x4251f8){while(--_0x4251f8){_0x527826['push'](_0x527826['shift']());}};_0x2bbb34(++_0x4b946d);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0xdc15[_0x178668];return _0x26107d;};'use strict';var MailAccountEvents=require(_0x5dc1('0x0'));var events=['save',_0x5dc1('0x1'),_0x5dc1('0x2')];function createListener(_0x2dad79,_0x3ccbc1){return function(_0x384287){_0x3ccbc1['emit'](_0x2dad79,_0x384287);};}function removeListener(_0x54e344,_0x5e5500){return function(){MailAccountEvents[_0x5dc1('0x3')](_0x54e344,_0x5e5500);};}exports['register']=function(_0x4b7fa9){for(var _0x40d2b9=0x0,_0x2ec95f=events[_0x5dc1('0x4')];_0x40d2b9<_0x2ec95f;_0x40d2b9++){var _0x12abf9=events[_0x40d2b9];var _0x1c90f6=createListener(_0x5dc1('0x5')+_0x12abf9,_0x4b7fa9);MailAccountEvents['on'](_0x12abf9,_0x1c90f6);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e413151..eaee113 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 _0x0528=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','update','delete','isAuthenticated','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0528,0x99));var _0x8052=function(_0x465e84,_0x2ad6f8){_0x465e84=_0x465e84-0x0;var _0x29c6df=_0x0528[_0x465e84];return _0x29c6df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8052('0x0'));var timeout=require(_0x8052('0x1'));var express=require(_0x8052('0x2'));var router=express[_0x8052('0x3')]();var fs_extra=require(_0x8052('0x4'));var auth=require(_0x8052('0x5'));var interaction=require(_0x8052('0x6'));var config=require(_0x8052('0x7'));var controller=require(_0x8052('0x8'));router[_0x8052('0x9')](_0x8052('0xa'),auth['isAuthenticated'](),controller[_0x8052('0xb')]);router[_0x8052('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8052('0xd')]);router[_0x8052('0xe')](_0x8052('0xa'),auth[_0x8052('0xf')](),controller['destroy']);module[_0x8052('0x10')]=router; \ No newline at end of file +var _0xe529=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','delete','destroy','multer','util'];(function(_0x389c20,_0x27d3aa){var _0x17e14d=function(_0x342618){while(--_0x342618){_0x389c20['push'](_0x389c20['shift']());}};_0x17e14d(++_0x27d3aa);}(_0xe529,0x15d));var _0x9e52=function(_0x135188,_0x1afd71){_0x135188=_0x135188-0x0;var _0x371f9e=_0xe529[_0x135188];return _0x371f9e;};'use strict';var multer=require(_0x9e52('0x0'));var util=require(_0x9e52('0x1'));var path=require('path');var timeout=require(_0x9e52('0x2'));var express=require(_0x9e52('0x3'));var router=express[_0x9e52('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9e52('0x5'));var config=require(_0x9e52('0x6'));var controller=require('./mailApplication.controller');router['get'](_0x9e52('0x7'),auth[_0x9e52('0x8')](),controller[_0x9e52('0x9')]);router[_0x9e52('0xa')](_0x9e52('0x7'),auth[_0x9e52('0x8')](),controller['update']);router[_0x9e52('0xb')](_0x9e52('0x7'),auth['isAuthenticated'](),controller[_0x9e52('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index fe673b6..2544be5 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 _0x61a1=['exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x61a1,0x1ae));var _0x161a=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x61a1[_0x4f2c3a];return _0x17d91c;};'use strict';var Sequelize=require('sequelize');module[_0x161a('0x0')]={'priority':{'type':Sequelize[_0x161a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x161a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x161a('0x3')]()},'description':{'type':Sequelize[_0x161a('0x2')]},'interval':{'type':Sequelize[_0x161a('0x2')],'defaultValue':_0x161a('0x4')}}; \ No newline at end of file +var _0x1b88=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x2e5e70,_0xce551a){var _0x331b61=function(_0x4c03ea){while(--_0x4c03ea){_0x2e5e70['push'](_0x2e5e70['shift']());}};_0x331b61(++_0xce551a);}(_0x1b88,0x67));var _0x81b8=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1b88[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x81b8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x81b8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x81b8('0x2')],'allowNull':![],'defaultValue':_0x81b8('0x3')},'appdata':{'type':Sequelize[_0x81b8('0x4')]()},'description':{'type':Sequelize[_0x81b8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4f3e76c..3b5b090 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 _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xedd9,0xfc));var _0x9edd=function(_0x4975b0,_0x513519){_0x4975b0=_0x4975b0-0x0;var _0x3a8f7d=_0xedd9[_0x4975b0];return _0x3a8f7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x2f2d0f,_0x4f5065){var _0x2def7e=function(_0x45d3f2){while(--_0x45d3f2){_0x2f2d0f['push'](_0x2f2d0f['shift']());}};_0x2def7e(++_0x4f5065);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 39b914c..e3f0ea3 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 _0xec41=['rimraf','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xec41,0x89));var _0x1ec4=function(_0x95d36,_0x339cbd){_0x95d36=_0x95d36-0x0;var _0x324f84=_0xec41[_0x95d36];return _0x324f84;};'use strict';var _=require(_0x1ec4('0x0'));var util=require('util');var logger=require(_0x1ec4('0x1'))(_0x1ec4('0x2'));var moment=require(_0x1ec4('0x3'));var BPromise=require(_0x1ec4('0x4'));var rp=require(_0x1ec4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ec4('0x6'));var config=require('../../config/environment');var attributes=require(_0x1ec4('0x7'));module[_0x1ec4('0x8')]=function(_0xe18a46,_0x5af427){return _0xe18a46[_0x1ec4('0x9')]('MailApplication',attributes,{'tableName':_0x1ec4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ec4('0xb'),'collate':_0x1ec4('0xc')});}; \ No newline at end of file +var _0x0313=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','../../config/logger'];(function(_0x96bf55,_0x184b21){var _0x44c688=function(_0x2ac499){while(--_0x2ac499){_0x96bf55['push'](_0x96bf55['shift']());}};_0x44c688(++_0x184b21);}(_0x0313,0xfb));var _0x3031=function(_0x4b2bd1,_0x4a8e7b){_0x4b2bd1=_0x4b2bd1-0x0;var _0x4b96d6=_0x0313[_0x4b2bd1];return _0x4b96d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3031('0x0'))(_0x3031('0x1'));var moment=require(_0x3031('0x2'));var BPromise=require(_0x3031('0x3'));var rp=require(_0x3031('0x4'));var fs=require('fs');var path=require(_0x3031('0x5'));var rimraf=require(_0x3031('0x6'));var config=require(_0x3031('0x7'));var attributes=require('./mailApplication.attributes');module[_0x3031('0x8')]=function(_0x3394e3,_0x249ef2){return _0x3394e3[_0x3031('0x9')](_0x3031('0xa'),attributes,{'tableName':_0x3031('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6f03cca..beb74e4 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 _0xdabc=['request\x20sent','debug','error','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','limit','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xdabc,0x16b));var _0xcdab=function(_0x164eb1,_0x198a7d){_0x164eb1=_0x164eb1-0x0;var _0x73311=_0xdabc[_0x164eb1];return _0x73311;};'use strict';var _=require('lodash');var util=require(_0xcdab('0x0'));var moment=require(_0xcdab('0x1'));var BPromise=require(_0xcdab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdab('0x3'));var db=require(_0xcdab('0x4'))['db'];var utils=require(_0xcdab('0x5'));var logger=require(_0xcdab('0x6'))(_0xcdab('0x7'));var config=require(_0xcdab('0x8'));var jayson=require(_0xcdab('0x9'));var client=jayson[_0xcdab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xceb00e,_0x3d2c44,_0x980fac){return new BPromise(function(_0x513c14,_0x1932b4){return client[_0xcdab('0xb')](_0xceb00e,_0x980fac)[_0xcdab('0xc')](function(_0x518b92){logger[_0xcdab('0xd')]('MailApplication,\x20%s,\x20%s',_0x3d2c44,_0xcdab('0xe'));logger[_0xcdab('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3d2c44,_0xcdab('0xe'),JSON['stringify'](_0x518b92));if(_0x518b92['error']){if(_0x518b92['error']['code']===0x1f4){logger[_0xcdab('0x10')](_0xcdab('0x11'),_0x3d2c44,_0x518b92[_0xcdab('0x10')][_0xcdab('0x12')]);return _0x1932b4(_0x518b92[_0xcdab('0x10')]['message']);}logger['error'](_0xcdab('0x11'),_0x3d2c44,_0x518b92[_0xcdab('0x10')]['message']);return _0x513c14(_0x518b92['error']['message']);}else{logger[_0xcdab('0xd')](_0xcdab('0x11'),_0x3d2c44,_0xcdab('0xe'));_0x513c14(_0x518b92[_0xcdab('0x13')][_0xcdab('0x12')]);}})[_0xcdab('0x14')](function(_0x47ed01){logger['error'](_0xcdab('0x11'),_0x3d2c44,_0x47ed01);_0x1932b4(_0x47ed01);});});}exports[_0xcdab('0x15')]=function(_0x5e21e6){var _0xef41c6=this;return new Promise(function(_0xd529a,_0x57ad6e){return db['MailApplication'][_0xcdab('0x16')](_0x5e21e6['body'],{'raw':_0x5e21e6['options']?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e21e6[_0xcdab('0x17')]?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x19')]||null:null,'attributes':_0x5e21e6['options']?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x1a')]||null:null,'limit':_0x5e21e6[_0xcdab('0x17')]?_0x5e21e6[_0xcdab('0x17')][_0xcdab('0x1b')]||null:null})['then'](function(_0x393255){logger[_0xcdab('0xd')](_0xcdab('0x15'),_0x5e21e6);logger[_0xcdab('0xf')](_0xcdab('0x15'),_0x5e21e6,JSON[_0xcdab('0x1c')](_0x393255));_0xd529a(_0x393255);})[_0xcdab('0x14')](function(_0x11127b){logger[_0xcdab('0x10')](_0xcdab('0x15'),_0x11127b['message'],_0x5e21e6);_0x57ad6e(_0xef41c6[_0xcdab('0x10')](0x1f4,_0x11127b['message']));});});}; \ No newline at end of file +var _0xc4a1=['request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','update','body','options','raw','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x59818a,_0x121ef3){var _0x5e82ea=function(_0x9af65d){while(--_0x9af65d){_0x59818a['push'](_0x59818a['shift']());}};_0x5e82ea(++_0x121ef3);}(_0xc4a1,0xb7));var _0x1c4a=function(_0x5b1a90,_0x55738d){_0x5b1a90=_0x5b1a90-0x0;var _0x1ecdb9=_0xc4a1[_0x5b1a90];return _0x1ecdb9;};'use strict';var _=require(_0x1c4a('0x0'));var util=require(_0x1c4a('0x1'));var moment=require(_0x1c4a('0x2'));var BPromise=require(_0x1c4a('0x3'));var rs=require(_0x1c4a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c4a('0x5'))['db'];var utils=require(_0x1c4a('0x6'));var logger=require(_0x1c4a('0x7'))(_0x1c4a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c4a('0x9')][_0x1c4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cdd81,_0x5a231d,_0x5575f8){return new BPromise(function(_0x9afbcc,_0x5bac11){return client['request'](_0x2cdd81,_0x5575f8)[_0x1c4a('0xb')](function(_0x4d0b66){logger[_0x1c4a('0xc')]('MailApplication,\x20%s,\x20%s',_0x5a231d,_0x1c4a('0xd'));logger[_0x1c4a('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5a231d,'request\x20sent',JSON['stringify'](_0x4d0b66));if(_0x4d0b66[_0x1c4a('0xf')]){if(_0x4d0b66[_0x1c4a('0xf')][_0x1c4a('0x10')]===0x1f4){logger[_0x1c4a('0xf')](_0x1c4a('0x11'),_0x5a231d,_0x4d0b66[_0x1c4a('0xf')][_0x1c4a('0x12')]);return _0x5bac11(_0x4d0b66[_0x1c4a('0xf')][_0x1c4a('0x12')]);}logger[_0x1c4a('0xf')](_0x1c4a('0x11'),_0x5a231d,_0x4d0b66[_0x1c4a('0xf')]['message']);return _0x9afbcc(_0x4d0b66[_0x1c4a('0xf')]['message']);}else{logger[_0x1c4a('0xc')](_0x1c4a('0x11'),_0x5a231d,_0x1c4a('0xd'));_0x9afbcc(_0x4d0b66['result'][_0x1c4a('0x12')]);}})[_0x1c4a('0x13')](function(_0x4eb9f4){logger[_0x1c4a('0xf')]('MailApplication,\x20%s,\x20%s',_0x5a231d,_0x4eb9f4);_0x5bac11(_0x4eb9f4);});});}exports[_0x1c4a('0x14')]=function(_0x56e081){var _0x41cde3=this;return new Promise(function(_0x1ebfca,_0x34f374){return db['MailApplication'][_0x1c4a('0x15')](_0x56e081[_0x1c4a('0x16')],{'raw':_0x56e081[_0x1c4a('0x17')]?_0x56e081['options'][_0x1c4a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56e081['options']?_0x56e081[_0x1c4a('0x17')]['where']||null:null,'attributes':_0x56e081[_0x1c4a('0x17')]?_0x56e081[_0x1c4a('0x17')][_0x1c4a('0x19')]||null:null,'limit':_0x56e081[_0x1c4a('0x17')]?_0x56e081[_0x1c4a('0x17')][_0x1c4a('0x1a')]||null:null})[_0x1c4a('0xb')](function(_0x54ed2b){logger[_0x1c4a('0xc')]('UpdateMailApplication',_0x56e081);logger['debug'](_0x1c4a('0x14'),_0x56e081,JSON[_0x1c4a('0x1b')](_0x54ed2b));_0x1ebfca(_0x54ed2b);})[_0x1c4a('0x13')](function(_0xb555c1){logger['error'](_0x1c4a('0x14'),_0xb555c1[_0x1c4a('0x12')],_0x56e081);_0x34f374(_0x41cde3[_0x1c4a('0xf')](0x1f4,_0xb555c1[_0x1c4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 082c41c..aa0e3c8 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 _0x4225=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','create','post','/:id/messages','/:id/tags','mail','mailinteraction:addtags','addTags','put','update','delete','tracked','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4225,0xd5));var _0x5422=function(_0x56a595,_0x586c93){_0x56a595=_0x56a595-0x0;var _0x4a8c03=_0x4225[_0x56a595];return _0x4a8c03;};'use strict';var express=require(_0x5422('0x0'));var router=express[_0x5422('0x1')]();var auth=require(_0x5422('0x2'));var interaction=require(_0x5422('0x3'));var controller=require('./mailInteraction.controller');router[_0x5422('0x4')]('/',auth[_0x5422('0x5')](),controller[_0x5422('0x6')]);router['get'](_0x5422('0x7'),auth['isAuthenticated'](),controller[_0x5422('0x8')]);router['get'](_0x5422('0x9'),auth[_0x5422('0x5')](),controller['show']);router[_0x5422('0x4')]('/:id/messages',auth[_0x5422('0x5')](),controller[_0x5422('0xa')]);router[_0x5422('0x4')](_0x5422('0xb'),auth[_0x5422('0x5')](),controller[_0x5422('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5422('0xd')]);router[_0x5422('0xe')](_0x5422('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x5422('0xe')](_0x5422('0x10'),auth[_0x5422('0x5')](),interaction['tracked'](_0x5422('0x11'),_0x5422('0x12')),controller[_0x5422('0x13')]);router[_0x5422('0x14')](_0x5422('0x9'),auth[_0x5422('0x5')](),interaction['tracked'](_0x5422('0x11'),'mailinteraction:update'),controller[_0x5422('0x15')]);router[_0x5422('0x16')](_0x5422('0x9'),auth[_0x5422('0x5')](),interaction[_0x5422('0x17')]('mail',_0x5422('0x18')),controller[_0x5422('0x19')]);router[_0x5422('0x16')](_0x5422('0x10'),auth['isAuthenticated'](),controller[_0x5422('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1f8e=['mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','post','create','tracked'];(function(_0x1cc69f,_0x133739){var _0x2df738=function(_0x500dc4){while(--_0x500dc4){_0x1cc69f['push'](_0x1cc69f['shift']());}};_0x2df738(++_0x133739);}(_0x1f8e,0x169));var _0xe1f8=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x1f8e[_0x37756b];return _0x46efec;};'use strict';var express=require(_0xe1f8('0x0'));var router=express['Router']();var auth=require(_0xe1f8('0x1'));var interaction=require(_0xe1f8('0x2'));var controller=require('./mailInteraction.controller');router[_0xe1f8('0x3')]('/',auth[_0xe1f8('0x4')](),controller[_0xe1f8('0x5')]);router[_0xe1f8('0x3')](_0xe1f8('0x6'),auth[_0xe1f8('0x4')](),controller['describe']);router[_0xe1f8('0x3')](_0xe1f8('0x7'),auth[_0xe1f8('0x4')](),controller[_0xe1f8('0x8')]);router[_0xe1f8('0x3')](_0xe1f8('0x9'),auth['isAuthenticated'](),controller[_0xe1f8('0xa')]);router[_0xe1f8('0x3')]('/:id/download',auth[_0xe1f8('0x4')](),controller['download']);router[_0xe1f8('0xb')]('/',auth['isAuthenticated'](),controller[_0xe1f8('0xc')]);router[_0xe1f8('0xb')]('/:id/messages',auth[_0xe1f8('0x4')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xe1f8('0xd')](_0xe1f8('0xe'),_0xe1f8('0xf')),controller[_0xe1f8('0x10')]);router[_0xe1f8('0x11')](_0xe1f8('0x7'),auth[_0xe1f8('0x4')](),interaction[_0xe1f8('0xd')](_0xe1f8('0xe'),_0xe1f8('0x12')),controller[_0xe1f8('0x13')]);router[_0xe1f8('0x14')](_0xe1f8('0x7'),auth['isAuthenticated'](),interaction[_0xe1f8('0xd')](_0xe1f8('0xe'),_0xe1f8('0x15')),controller[_0xe1f8('0x16')]);router[_0xe1f8('0x14')](_0xe1f8('0x17'),auth['isAuthenticated'](),controller[_0xe1f8('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 85e3aec..631ae42 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 _0x3d82=['BOOLEAN','STRING','TEXT','long','DATE','out','ENUM','sequelize'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x3d82,0x117));var _0x23d8=function(_0x1944e1,_0x29875e){_0x1944e1=_0x1944e1-0x0;var _0x486d30=_0x3d82[_0x1944e1];return _0x486d30;};'use strict';var Sequelize=require(_0x23d8('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x23d8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x23d8('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x23d8('0x2')]},'inReplyTo':{'type':Sequelize[_0x23d8('0x2')](0x1fe)},'to':{'type':Sequelize[_0x23d8('0x2')]},'cc':{'type':Sequelize[_0x23d8('0x3')](_0x23d8('0x4'))},'subject':{'type':Sequelize[_0x23d8('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x23d8('0x5')]},'substatus':{'type':Sequelize[_0x23d8('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x23d8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x23d8('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x23d8('0x7')]('in',_0x23d8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x23d8('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xb6be=['ENUM','out','sequelize','iconv','DATE','STRING','long','BOOLEAN'];(function(_0x42f388,_0x465da1){var _0x161681=function(_0x1ce839){while(--_0x1ce839){_0x42f388['push'](_0x42f388['shift']());}};_0x161681(++_0x465da1);}(_0xb6be,0x132));var _0xeb6b=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xb6be[_0x28394f];return _0x2618d2;};'use strict';var Sequelize=require(_0xeb6b('0x0'));var iconv=require(_0xeb6b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeb6b('0x2')]},'disposition':{'type':Sequelize[_0xeb6b('0x3')]},'secondDisposition':{'type':Sequelize[_0xeb6b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeb6b('0x3')]},'note':{'type':Sequelize[_0xeb6b('0x3')]},'inReplyTo':{'type':Sequelize[_0xeb6b('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xeb6b('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xeb6b('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xeb6b('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xeb6b('0x6')]('in',_0xeb6b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xeb6b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xeb6b('0x6')]('in',_0xeb6b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xeb6b('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2f421cc..d245a62 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 _0x1038=['localhost','./mailInteraction.socket','register','status','json','offset','undefined','limit','update','then','stack','name','send','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','MailInteraction','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','end','compact','isEmpty','MailAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','i.id','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','count','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','rawAttributes','include','merge','options','create','body','destroy','params','describe','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','emit','removeTags','download','unix','server','files','tmp','root','attachments','join','transcript-%d-%s.zip','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','build','message%d.eml','unlinkSync','sendStatus','eml-format','zip-dir','moment','util','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','html-entities','redis'];(function(_0xe7dc47,_0x26d832){var _0x20a92c=function(_0x3c3252){while(--_0x3c3252){_0xe7dc47['push'](_0xe7dc47['shift']());}};_0x20a92c(++_0x26d832);}(_0x1038,0x1b9));var _0x8103=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x1038[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0x8103('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8103('0x1'));var moment=require(_0x8103('0x2'));var BPromise=require('bluebird');var util=require(_0x8103('0x3'));var path=require(_0x8103('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8103('0x5'));var juice=require(_0x8103('0x6'));var Redis=require(_0x8103('0x7'));var qs=require(_0x8103('0x8'));var as=require(_0x8103('0x9'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x8103('0xa'))['db'];var htmlEntities=require(_0x8103('0xb'));config[_0x8103('0xc')]=_['defaults'](config['redis'],{'host':_0x8103('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8103('0xc')]));require(_0x8103('0xe'))[_0x8103('0xf')](socket);function respondWithStatusCode(_0x4ba17d,_0x343281){_0x343281=_0x343281||0xcc;return function(_0x1c4f89){if(_0x1c4f89){return _0x4ba17d['sendStatus'](_0x343281);}return _0x4ba17d[_0x8103('0x10')](_0x343281)['end']();};}function respondWithResult(_0x4c5232,_0x442c45){_0x442c45=_0x442c45||0xc8;return function(_0x16da80){if(_0x16da80){return _0x4c5232[_0x8103('0x10')](_0x442c45)[_0x8103('0x11')](_0x16da80);}};}function respondWithFilteredResult(_0x553bb8,_0x330fb1){return function(_0x14d2b9){if(_0x14d2b9){var _0x4edb52=typeof _0x330fb1[_0x8103('0x12')]===_0x8103('0x13')&&typeof _0x330fb1[_0x8103('0x14')]===_0x8103('0x13');var _0x3a3098=_0x14d2b9['count'];var _0x41c8bd=_0x4edb52?0x0:_0x330fb1[_0x8103('0x12')];var _0x4e0fbf=_0x4edb52?_0x14d2b9['count']:_0x330fb1[_0x8103('0x12')]+_0x330fb1[_0x8103('0x14')];var _0x57d696;if(_0x4e0fbf>=_0x3a3098){_0x4e0fbf=_0x3a3098;_0x57d696=0xc8;}else{_0x57d696=0xce;}_0x553bb8[_0x8103('0x10')](_0x57d696);return _0x553bb8['set']('Content-Range',_0x41c8bd+'-'+_0x4e0fbf+'/'+_0x3a3098)[_0x8103('0x11')](_0x14d2b9);}return null;};}function saveUpdates(_0x38845b){return function(_0x44d1a6){if(_0x44d1a6){return _0x44d1a6[_0x8103('0x15')](_0x38845b)[_0x8103('0x16')](function(_0x1f3710){return _0x1f3710;});}return null;};}function removeEntity(_0x3598c5){return function(_0x3b6e4f){if(_0x3b6e4f){return _0x3b6e4f['destroy']()[_0x8103('0x16')](function(){_0x3598c5[_0x8103('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1cf3){return function(_0x4e12fb){if(!_0x4e12fb){_0x3b1cf3['sendStatus'](0x194);}return _0x4e12fb;};}function handleError(_0x4fe530,_0x87496){_0x87496=_0x87496||0x1f4;return function(_0x5f094){logger['error'](_0x5f094[_0x8103('0x17')]);if(_0x5f094[_0x8103('0x18')]){delete _0x5f094[_0x8103('0x18')];}_0x4fe530[_0x8103('0x10')](_0x87496)[_0x8103('0x19')](_0x5f094);};}function getInteractionUsers(_0x5f56e3,_0x47e056){return new BPromise(function(_0x4e595b,_0x5a07d4){try{if(_0x47e056[_0x5f56e3['id']]){_0x5f56e3['Users']=_[_0x8103('0x1a')](_0x47e056[_0x5f56e3['id']],function(_0x26b935){return{'id':_0x26b935['id'],'fullname':_0x26b935[_0x8103('0x1b')]};});}}catch(_0x18a2c7){_0x5a07d4(_0x18a2c7);}_0x4e595b(_0x5f56e3);});}function getInteractionTags(_0x6f6aed,_0x5d11ef){return new BPromise(function(_0x56474a,_0x4e5eb2){try{if(_0x6f6aed[_0x8103('0x1c')]){_0x6f6aed[_0x8103('0x1d')]=[];_0x6f6aed[_0x8103('0x1c')][_0x8103('0x1e')](',')['forEach'](function(_0x471db6){_0x6f6aed[_0x8103('0x1d')][_0x8103('0x1f')](_0x5d11ef[_0x471db6]);});}delete _0x6f6aed[_0x8103('0x1c')];}catch(_0x205d53){_0x4e5eb2(_0x205d53);}_0x56474a(_0x6f6aed);});}function getLastMessageText(_0x2629bd){return new BPromise(function(_0x59f13d,_0x2ac918){return db[_0x8103('0x20')][_0x8103('0x21')]({'where':{'$and':[{'MailInteractionId':_0x2629bd['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8103('0x22')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8103('0x23')],'order':'-id','raw':!![]})[_0x8103('0x16')](function(_0x3f8236){if(_0x3f8236&&_0x3f8236[_0x8103('0x23')]){_0x2629bd[_0x8103('0x24')]=_[_0x8103('0x25')](_0x3f8236['plainBody']);}_0x59f13d(_0x2629bd);})[_0x8103('0x26')](function(_0x2ca2f5){_0x2ac918(_0x2ca2f5);});});}function updateMailInteraction(_0x5bafd7,_0x37b598,_0xe03e49,_0x1d8e47){return new BPromise(function(_0x5572ac,_0x24edff){return getInteractionUsers(_0x5bafd7,_0xe03e49)['then'](function(_0x378b48){return getInteractionTags(_0x378b48,_0x37b598);})['then'](function(_0x5b556d){if(_0x1d8e47){_0x5572ac(getLastMessageText(_0x5b556d));}else{_0x5572ac(_0x5b556d);}})[_0x8103('0x26')](function(_0x429fc9){_0x24edff(_0x429fc9);});});}exports['index']=function(_0x2e1318,_0x285ecd){var _0x48064a={},_0x5479ae={},_0x329c6f={'count':0x0,'rows':[]};var _0x4c573f=_[_0x8103('0x1a')](db[_0x8103('0x27')]['rawAttributes'],function(_0x3b7fd2){return{'name':_0x3b7fd2[_0x8103('0x28')],'type':_0x3b7fd2['type'][_0x8103('0x29')]};});_0x5479ae['model']=_[_0x8103('0x1a')](_0x4c573f,_0x8103('0x18'));_0x5479ae[_0x8103('0x2a')]=_[_0x8103('0x2b')](_0x2e1318[_0x8103('0x2a')]);_0x5479ae[_0x8103('0x2c')]=_[_0x8103('0x2d')](_0x5479ae['model'],_0x5479ae[_0x8103('0x2a')]);_0x48064a['attributes']=_[_0x8103('0x2d')](_0x5479ae[_0x8103('0x2e')],qs['fields'](_0x2e1318[_0x8103('0x2a')][_0x8103('0x2f')]));_0x48064a[_0x8103('0x30')]=_0x48064a['attributes'][_0x8103('0x31')]?_0x48064a[_0x8103('0x30')]:_0x5479ae[_0x8103('0x2e')];if(!_0x2e1318[_0x8103('0x2a')][_0x8103('0x32')](_0x8103('0x33'))){_0x48064a[_0x8103('0x14')]=qs[_0x8103('0x14')](_0x2e1318['query']['limit']);_0x48064a['offset']=qs[_0x8103('0x12')](_0x2e1318[_0x8103('0x2a')][_0x8103('0x12')]);}_0x48064a[_0x8103('0x34')]=qs['sort'](_0x2e1318[_0x8103('0x2a')][_0x8103('0x35')]);_0x48064a[_0x8103('0x36')]=qs['filters'](_[_0x8103('0x37')](_0x2e1318['query'],_0x5479ae[_0x8103('0x2c')]),_0x4c573f);var _0x1b3552=[];var _0x5462cd=squel[_0x8103('0x38')]()[_0x8103('0x39')]('id')['field'](_0x8103('0x18'))[_0x8103('0x39')](_0x8103('0x3a'))['from']('tools_tags');var _0x3c2989=squel['select']()['field'](_0x8103('0x3b'))[_0x8103('0x39')]('u.fullname')[_0x8103('0x39')]('ui.MailInteractionId')['from'](_0x8103('0x3c'),'ui')[_0x8103('0x3d')](_0x8103('0x3e'),'u',_0x8103('0x3f'));var _0x488f8c=squel['select']()['from'](_0x8103('0x40'),'i')[_0x8103('0x3d')](_0x8103('0x41'),'c',_0x8103('0x42'))[_0x8103('0x3d')](_0x8103('0x3e'),'o','o.id\x20=\x20i.UserId')[_0x8103('0x3d')](_0x8103('0x43'),'a',_0x8103('0x44'))[_0x8103('0x3d')](_0x8103('0x45'),'me',_0x8103('0x46'))[_0x8103('0x3d')]('mail_interaction_has_tags','it',_0x8103('0x47'))['left_join'](_0x8103('0x48'),'t','t.id\x20=\x20it.TagId');var _0x52e0f5=squel[_0x8103('0x49')]();var _0x480e8a=[];var _0x3cb205=squel[_0x8103('0x49')]();var _0x1564a2;if(_0x2e1318['query'][_0x8103('0x4a')]){_0x1564a2=as['parseSearch'](_0x2e1318['query'][_0x8103('0x4a')]);var _0x2be967=_0x1564a2[_0x8103('0x4b')];for(var _0x379989=0x0;_0x379989<_0x1564a2[_0x8103('0x4c')]['length'];_0x379989++){var _0x39b08a=_0x1564a2['conditions'][_0x379989];var _0x293e16='i';var _0x19d942=_[_0x8103('0x4d')](_0x4c573f,['name',_0x39b08a[_0x8103('0x39')]]);if(!_0x19d942){switch(_0x39b08a[_0x8103('0x39')]){case'unreadMessages':if(_0x39b08a[_0x8103('0x4e')]==0x1){_0x488f8c['having']('`'+_0x39b08a[_0x8103('0x39')]+_0x8103('0x4f'));}else{_0x488f8c['having']('`'+_0x39b08a[_0x8103('0x39')]+_0x8103('0x50'));}break;case _0x8103('0x51'):if(_0x39b08a[_0x8103('0x52')]===_0x8103('0x53')){if(_0x39b08a['value'][_0x8103('0x1e')]('\x20')[_0x8103('0x31')]>0x1){_0x52e0f5[_0x2be967](_0x8103('0x54'),qs[_0x8103('0x55')](_0x39b08a[_0x8103('0x4e')]),null);}else{var _0x5bb020='%'+_0x39b08a[_0x8103('0x4e')]+'%';_0x52e0f5[_0x2be967](_0x8103('0x56'),_0x5bb020,_0x5bb020,_0x5bb020);}}else{_0x19d942=_['find'](_0x4c573f,[_0x8103('0x18'),'ContactId']);_0x39b08a[_0x8103('0x39')]=_0x8103('0x57');_0x3adf6c=as['buildExpression'](_0x293e16,_0x19d942[_0x8103('0x58')],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c[_0x8103('0x4e')]['start'],_0x3adf6c[_0x8103('0x4e')]['end']);}break;case _0x8103('0x5a'):var _0x21edc0=_0x39b08a[_0x8103('0x4e')][_0x8103('0x1e')](',')[_0x8103('0x1a')](function(_0x353d19){return Number(_0x353d19);});_0x21edc0[_0x8103('0x5b')](function(_0x56fc1b){_0x3cb205['or'](_0x8103('0x5c'),'%,'+_0x56fc1b+',%');});_0x480e8a=_[_0x8103('0x5d')](_0x480e8a,_0x21edc0);break;case _0x8103('0x5e'):if(_0x39b08a[_0x8103('0x52')]===_0x8103('0x53')){_0x52e0f5[_0x2be967](_0x8103('0x5f'),'%'+_0x39b08a[_0x8103('0x4e')]+'%',null);}else{_0x19d942=_['find'](_0x4c573f,[_0x8103('0x18'),'UserId']);_0x39b08a[_0x8103('0x39')]=_0x8103('0x60');_0x3adf6c=as[_0x8103('0x61')](_0x293e16,_0x19d942['type'],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x62')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);}break;case _0x8103('0x23'):_0x3adf6c=as['buildExpression']('me',null,_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c[_0x8103('0x59')],_0x3adf6c['value'][_0x8103('0x62')],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);break;}}else{var _0x3adf6c=as[_0x8103('0x61')](_0x293e16,_0x19d942[_0x8103('0x58')],_0x39b08a);_0x52e0f5[_0x2be967](_0x3adf6c['text'],_0x3adf6c[_0x8103('0x4e')]['start'],_0x3adf6c[_0x8103('0x4e')][_0x8103('0x63')]);}}}else{var _0x2cb03b=_(_0x2e1318['query'])[_0x8103('0x2b')]()[_0x8103('0x1a')](function(_0x4aab1e){return _['some'](_0x4c573f,[_0x8103('0x18'),_0x4aab1e])?_0x4aab1e:undefined;})[_0x8103('0x64')]()[_0x8103('0x4e')]();if(!_[_0x8103('0x65')](_0x2cb03b)){_0x2cb03b[_0x8103('0x5b')](function(_0x38d33b){if(_0x38d33b===_0x8103('0x66')){_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IN\x20?',[][_0x8103('0x67')](_0x2e1318[_0x8103('0x2a')][_0x38d33b]));}else if(_0x38d33b==='createdAt'){var _0x40f1f3=JSON[_0x8103('0x68')](_0x2e1318[_0x8103('0x2a')][_0x38d33b])[_0x8103('0x69')];var _0x20ee66=JSON[_0x8103('0x68')](_0x2e1318[_0x8103('0x2a')][_0x38d33b])[_0x8103('0x6a')];_0x488f8c['where'](_0x8103('0x6b'),_0x40f1f3,_0x20ee66);}else{if(_0x2e1318['query'][_0x38d33b]==='null'){_0x488f8c[_0x8103('0x36')]('i.'+_0x38d33b+_0x8103('0x6c'));}else{_0x488f8c[_0x8103('0x36')]('i.'+_0x38d33b+'\x20=\x20?',_0x2e1318[_0x8103('0x2a')][_0x38d33b]);}}});}if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x6d')]){if(_0x2e1318[_0x8103('0x2a')]['read']==0x1){_0x488f8c[_0x8103('0x6e')](_0x8103('0x6f'));}else{_0x488f8c[_0x8103('0x6e')](_0x8103('0x70'));}}if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')]){_0x480e8a=_[_0x8103('0x72')](_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')])?_0x2e1318[_0x8103('0x2a')][_0x8103('0x71')]:new Array(_0x2e1318['query'][_0x8103('0x71')]);_0x480e8a[_0x8103('0x5b')](function(_0x2bf7a0){_0x3cb205['or'](_0x8103('0x5c'),'%,'+_0x2bf7a0+',%');});}if(_0x2e1318['query']['filter']){var _0x43d2e9=_0x2e1318[_0x8103('0x2a')][_0x8103('0x73')][_0x8103('0x74')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8103('0x75')](_0x43d2e9)){_0x52e0f5['or']('i.id\x20LIKE\x20?',_0x43d2e9+'%');}else if(qs[_0x8103('0x76')](_0x43d2e9)){_0x52e0f5['or'](_0x8103('0x77'),_0x43d2e9+'%');}else{_0x52e0f5['or'](_0x8103('0x78'),qs[_0x8103('0x55')](_0x43d2e9))['or'](_0x8103('0x79'),qs[_0x8103('0x55')](_0x43d2e9));}}}_0x488f8c[_0x8103('0x36')](_0x52e0f5);_0x488f8c[_0x8103('0x7a')]('i.id');var _0x2f5e6f={'type':db[_0x8103('0x7b')][_0x8103('0x7c')]['SELECT'],'raw':!![]};var _0x72827a=_0x488f8c['clone']();_0x72827a[_0x8103('0x39')](_0x8103('0x7d'));_0x72827a[_0x8103('0x39')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8103('0x7e'));if(_0x48064a[_0x8103('0x34')]){_0x48064a['order'][_0x8103('0x5b')](function(_0x2a90a7){var _0x551180=_0x2a90a7[0x0]===_0x8103('0x7f')?_0x2a90a7[0x0]:'i.'+_0x2a90a7[0x0];_0x488f8c[_0x8103('0x34')](_0x551180,_0x2a90a7[0x1]===_0x8103('0x80')?![]:!![]);});}if(!_[_0x8103('0x65')](_0x480e8a)){_0x488f8c['having'](_0x3cb205);_0x72827a[_0x8103('0x36')](_0x8103('0x81'),_0x480e8a);}BPromise[_0x8103('0x82')]()[_0x8103('0x16')](function(){if(!_0x1564a2){if(_0x2e1318['query'][_0x8103('0x66')])return;_0x72827a[_0x8103('0x36')](_0x8103('0x83'));_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2e1318[_0x8103('0x84')]['role']!==_0x8103('0x85'))return;return _0x2e1318[_0x8103('0x84')][_0x8103('0x86')]({'attributes':['id'],'raw':!![]})[_0x8103('0x16')](function(_0x5d1bf0){if(_[_0x8103('0x65')](_0x5d1bf0)){_0x72827a[_0x8103('0x36')](_0x8103('0x87'));_0x488f8c[_0x8103('0x36')](_0x8103('0x87'));}else{_0x72827a['where'](_0x8103('0x88'),_[_0x8103('0x1a')](_0x5d1bf0,'id'));_0x488f8c[_0x8103('0x36')]('i.MailAccountId\x20IN\x20?',_[_0x8103('0x1a')](_0x5d1bf0,'id'));}});})[_0x8103('0x16')](function(){if(_0x2e1318['user']['role']===_0x8103('0x85')&&!_0x1564a2&&!_0x2e1318[_0x8103('0x2a')][_0x8103('0x66')])return[];return db['sequelize'][_0x8103('0x2a')](_0x72827a[_0x8103('0x89')](),_0x2f5e6f);})[_0x8103('0x16')](function(_0x454227){_0x329c6f[_0x8103('0x8a')]=_0x454227[_0x8103('0x31')];if(_0x329c6f[_0x8103('0x8a')]===0x0)return[];return db['sequelize']['query'](_0x5462cd['toString'](),_0x2f5e6f)[_0x8103('0x16')](function(_0x576c5a){_0x1b3552=_[_0x8103('0x8b')](_0x576c5a,'id');_0x2f5e6f=_['merge'](_0x2f5e6f,{'model':db[_0x8103('0x27')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e1318[_0x8103('0x2a')][_0x8103('0x2f')]){_0x48064a[_0x8103('0x30')][_0x8103('0x5b')](function(_0x244a54){_0x488f8c[_0x8103('0x39')]('i.'+_0x244a54);});}else{_0x488f8c[_0x8103('0x39')](_0x8103('0x8c'),_0x8103('0x7e'));_0x488f8c[_0x8103('0x39')](_0x8103('0x8d'),_0x8103('0x8e'));_0x488f8c['field']('a.mandatoryDisposition',_0x8103('0x8f'));_0x488f8c['field'](_0x8103('0x90'),_0x8103('0x7f'));_0x488f8c['field']('i.id');_0x488f8c[_0x8103('0x39')](_0x8103('0x91'));_0x488f8c['field'](_0x8103('0x92'));_0x488f8c[_0x8103('0x39')](_0x8103('0x93'));_0x488f8c['field'](_0x8103('0x94'));_0x488f8c[_0x8103('0x39')](_0x8103('0x95'));_0x488f8c[_0x8103('0x39')](_0x8103('0x96'));_0x488f8c['field'](_0x8103('0x97'));_0x488f8c[_0x8103('0x39')]('i.subject');_0x488f8c['field']('i.disposition');_0x488f8c['field'](_0x8103('0x98'));_0x488f8c[_0x8103('0x39')](_0x8103('0x99'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9a'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9b'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9c'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9d'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9e'));_0x488f8c[_0x8103('0x39')](_0x8103('0x9f'),_0x8103('0xa0'));_0x488f8c[_0x8103('0x39')](_0x8103('0xa1'),_0x8103('0xa2'));_0x488f8c[_0x8103('0x39')]('c.email',_0x8103('0xa3'));_0x488f8c[_0x8103('0x39')]('c.phone',_0x8103('0xa4'));_0x488f8c[_0x8103('0x39')]('c.mobile',_0x8103('0xa5'));_0x488f8c[_0x8103('0x39')](_0x8103('0xa6'),_0x8103('0xa7'));_0x488f8c[_0x8103('0x39')]('o.fullname','Owner.fullname');_0x488f8c[_0x8103('0x39')](_0x8103('0xa8'),_0x8103('0xa9'));_0x488f8c['field'](_0x8103('0xaa'),_0x8103('0x1c'));}if(_0x48064a[_0x8103('0x14')])_0x488f8c['limit'](_0x48064a[_0x8103('0x14')]);if(_0x48064a[_0x8103('0x12')])_0x488f8c[_0x8103('0x12')](_0x48064a[_0x8103('0x12')]);return db[_0x8103('0xab')]['query'](_0x488f8c[_0x8103('0x89')](),_0x2f5e6f);})[_0x8103('0x16')](function(_0x4deda0){if(_0x4deda0[_0x8103('0x31')]>0x0)_0x3c2989[_0x8103('0x36')](_0x8103('0xac'),_[_0x8103('0x1a')](_0x4deda0,'id'));return db[_0x8103('0xab')][_0x8103('0x2a')](_0x3c2989[_0x8103('0x89')](),_0x2f5e6f)[_0x8103('0x16')](function(_0x4b72f9){var _0x3f10de=_[_0x8103('0xad')](_0x4b72f9,_0x8103('0xae'));var _0x1478dc=[];return db[_0x8103('0xaf')][_0x8103('0x21')]({'attributes':[_0x8103('0xb0')],'raw':!![]})[_0x8103('0x16')](function(_0x4175b3){var _0x221b2a=_0x4175b3[_0x8103('0xb0')];_0x4deda0[_0x8103('0x5b')](function(_0x26afee){_0x1478dc[_0x8103('0x1f')](updateMailInteraction(_0x26afee,_0x1b3552,_0x3f10de,_0x221b2a));});return BPromise[_0x8103('0xb1')](_0x1478dc);});});});})[_0x8103('0x16')](function(_0xf59cd7){_0x329c6f[_0x8103('0xb2')]=_0xf59cd7;return _0x329c6f;})[_0x8103('0x16')](respondWithFilteredResult(_0x285ecd,_0x48064a))[_0x8103('0x26')](handleError(_0x285ecd,null));};exports[_0x8103('0xb3')]=function(_0x47b623,_0x2f024a){var _0x2143ff={'raw':![],'where':{'id':_0x47b623['params']['id']}},_0x5e5960={};_0x5e5960[_0x8103('0x2e')]=_[_0x8103('0x2b')](db['MailInteraction'][_0x8103('0xb4')]);_0x5e5960['query']=_[_0x8103('0x2b')](_0x47b623[_0x8103('0x2a')]);_0x5e5960[_0x8103('0x2c')]=_[_0x8103('0x2d')](_0x5e5960[_0x8103('0x2e')],_0x5e5960[_0x8103('0x2a')]);_0x2143ff[_0x8103('0x30')]=_[_0x8103('0x2d')](_0x5e5960[_0x8103('0x2e')],qs[_0x8103('0x2f')](_0x47b623[_0x8103('0x2a')][_0x8103('0x2f')]));_0x2143ff[_0x8103('0x30')]=_0x2143ff[_0x8103('0x30')][_0x8103('0x31')]?_0x2143ff['attributes']:_0x5e5960[_0x8103('0x2e')];if(_0x47b623[_0x8103('0x2a')]['includeAll']){_0x2143ff[_0x8103('0xb5')]=[{'all':!![]}];}_0x2143ff=_[_0x8103('0xb6')]({},_0x2143ff,_0x47b623[_0x8103('0xb7')]);return db[_0x8103('0x27')][_0x8103('0x4d')](_0x2143ff)['then'](handleEntityNotFound(_0x2f024a,null))[_0x8103('0x16')](respondWithResult(_0x2f024a,null))[_0x8103('0x26')](handleError(_0x2f024a,null));};exports['create']=function(_0x448575,_0x42f6ee){return db[_0x8103('0x27')][_0x8103('0xb8')](_0x448575[_0x8103('0xb9')],{})['then'](respondWithResult(_0x42f6ee,0xc9))[_0x8103('0x26')](handleError(_0x42f6ee,null));};exports['update']=function(_0x51a750,_0x57f9a7){if(_0x51a750[_0x8103('0xb9')]['id']){delete _0x51a750[_0x8103('0xb9')]['id'];}return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x51a750['params']['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x57f9a7,null))['then'](saveUpdates(_0x51a750[_0x8103('0xb9')],null))['then'](respondWithResult(_0x57f9a7,null))[_0x8103('0x26')](handleError(_0x57f9a7,null));};exports[_0x8103('0xba')]=function(_0x528001,_0x501b32){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x528001[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x501b32,null))['then'](removeEntity(_0x501b32,null))['catch'](handleError(_0x501b32,null));};exports[_0x8103('0xbc')]=function(_0x3131ef,_0x39ef14){return db['MailInteraction'][_0x8103('0xbc')]()[_0x8103('0x16')](respondWithResult(_0x39ef14,null))[_0x8103('0x26')](handleError(_0x39ef14,null));};exports[_0x8103('0xbd')]=function(_0x244d46,_0x34d74d){return db[_0x8103('0x20')][_0x8103('0x4d')]({'where':{'id':_0x244d46[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x34d74d,null))[_0x8103('0x16')](function(_0x1d7317){if(_0x1d7317){return _0x1d7317[_0x8103('0xbd')](_0x244d46[_0x8103('0xb9')]['ids'],_['omit'](_0x244d46['body'],[_0x8103('0xbe'),'id'])||{});}})[_0x8103('0x16')](respondWithResult(_0x34d74d,null))[_0x8103('0x26')](handleError(_0x34d74d,null));};exports[_0x8103('0xbf')]=function(_0xd25df2,_0x57034e){var _0x98d4d8={'raw':![],'where':{}};var _0x265ec4={};var _0x3083a7={'count':0x0,'rows':[]};return db[_0x8103('0x27')][_0x8103('0x21')]({'where':{'id':_0xd25df2[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x57034e,null))[_0x8103('0x16')](function(_0x1f138a){if(_0x1f138a){_0x265ec4[_0x8103('0x2e')]=_[_0x8103('0x2b')](db[_0x8103('0x20')][_0x8103('0xb4')]);_0x265ec4[_0x8103('0x2a')]=_[_0x8103('0x2b')](_0xd25df2[_0x8103('0x2a')]);_0x265ec4['filters']=_[_0x8103('0x2d')](_0x265ec4[_0x8103('0x2e')],_0x265ec4[_0x8103('0x2a')]);_0x98d4d8[_0x8103('0x30')]=_[_0x8103('0x2d')](_0x265ec4[_0x8103('0x2e')],qs[_0x8103('0x2f')](_0xd25df2[_0x8103('0x2a')][_0x8103('0x2f')]));_0x98d4d8[_0x8103('0x30')]=_0x98d4d8[_0x8103('0x30')][_0x8103('0x31')]?_0x98d4d8[_0x8103('0x30')]:_0x265ec4[_0x8103('0x2e')];if(!_0xd25df2['query'][_0x8103('0x32')]('nolimit')){_0x98d4d8[_0x8103('0x14')]=qs[_0x8103('0x14')](_0xd25df2[_0x8103('0x2a')]['limit']);_0x98d4d8[_0x8103('0x12')]=qs[_0x8103('0x12')](_0xd25df2[_0x8103('0x2a')][_0x8103('0x12')]);}_0x98d4d8['order']=qs[_0x8103('0x35')](_0xd25df2['query']['sort']);_0x98d4d8['where']=qs[_0x8103('0x2c')](_['pick'](_0xd25df2[_0x8103('0x2a')],_0x265ec4[_0x8103('0x2c')]));_0x98d4d8[_0x8103('0x36')][_0x8103('0xae')]=_0x1f138a['id'];if(_0xd25df2[_0x8103('0x2a')]['filter']){_0x98d4d8[_0x8103('0x36')]=_[_0x8103('0xb6')](_0x98d4d8[_0x8103('0x36')],{'$or':_[_0x8103('0x1a')](_0x98d4d8[_0x8103('0x30')],function(_0x18ae55){var _0x3ff2fb={};_0x3ff2fb[_0x18ae55]={'$like':'%'+_0xd25df2[_0x8103('0x2a')][_0x8103('0x73')]+'%'};return _0x3ff2fb;})});}if(_0xd25df2[_0x8103('0x2a')][_0x8103('0x69')]){var _0x59e247=_0xd25df2[_0x8103('0x2a')][_0x8103('0x69')][_0x8103('0x1e')](',');var _0x5f28ee={};_0x5f28ee[_0x59e247[0x0]]={'$gte':moment(_0x59e247[0x1])['format'](_0x8103('0xc0'))};_0x98d4d8[_0x8103('0x36')]=_[_0x8103('0xb6')](_0x98d4d8[_0x8103('0x36')],_0x5f28ee);}_0x98d4d8=_[_0x8103('0xb6')]({},_0x98d4d8,_0xd25df2[_0x8103('0xb7')]);return db[_0x8103('0x20')][_0x8103('0x8a')]({'where':_0x98d4d8['where']})[_0x8103('0x16')](function(_0x2bc691){_0x3083a7[_0x8103('0x8a')]=_0x2bc691;if(_0xd25df2[_0x8103('0x2a')][_0x8103('0xc1')]){_0x98d4d8[_0x8103('0xb5')]=[{'all':!![]}];}return db[_0x8103('0x20')][_0x8103('0xc2')](_0x98d4d8);})[_0x8103('0x16')](function(_0x44b782){if(_0xd25df2[_0x8103('0x2a')]['inlineCss']==='true'){for(var _0x5f3a3f=0x0;_0x5f3a3f<_0x44b782[_0x8103('0x31')];_0x5f3a3f++){_0x44b782[_0x5f3a3f][_0x8103('0xb9')]=juice(_0x44b782[_0x5f3a3f]['body']);}}_0x3083a7[_0x8103('0xb2')]=_0x44b782;return _0x3083a7;});}})['then'](respondWithFilteredResult(_0x57034e,_0x98d4d8))['catch'](handleError(_0x57034e,null));};exports[_0x8103('0xc3')]=function(_0x4fc651,_0x3b5304){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x4fc651['params']['id']}})[_0x8103('0x16')](handleEntityNotFound(_0x3b5304,null))['then'](function(_0x20b6b5){if(_0x20b6b5){return _0x20b6b5['setTags'](_0x4fc651['body'][_0x8103('0xbe')],_['omit'](_0x4fc651[_0x8103('0xb9')],[_0x8103('0xbe'),'id'])||{})[_0x8103('0xc4')](function(){return db['Tag'][_0x8103('0xc2')]({'attributes':['id',_0x8103('0x18'),_0x8103('0x3a')],'where':{'id':_0x4fc651[_0x8103('0xb9')][_0x8103('0xbe')]}});})[_0x8103('0x16')](function(_0x319b1a){socket[_0x8103('0xc5')]('mailInteractionTags:save',{'id':Number(_0x4fc651[_0x8103('0xbb')]['id']),'tags':_0x319b1a||[]});return{'id':Number(_0x4fc651[_0x8103('0xbb')]['id']),'tags':_0x319b1a||[]};});}})[_0x8103('0x16')](respondWithResult(_0x3b5304,null))[_0x8103('0x26')](handleError(_0x3b5304,null));};exports[_0x8103('0xc6')]=function(_0x263d38,_0xed8d33){return db[_0x8103('0x27')][_0x8103('0x4d')]({'where':{'id':_0x263d38[_0x8103('0xbb')]['id']}})[_0x8103('0x16')](handleEntityNotFound(_0xed8d33,null))[_0x8103('0x16')](function(_0x163536){if(_0x163536){return _0x163536['removeTags'](_0x263d38[_0x8103('0x2a')][_0x8103('0xbe')]);}})['then'](respondWithStatusCode(_0xed8d33,null))['catch'](handleError(_0xed8d33,null));};exports[_0x8103('0xc7')]=function(_0xeb9b0f,_0x54df46){var _0x5cd2b3=moment()[_0x8103('0xc8')]()[_0x8103('0x89')]();var _0x6d5950=path['join'](config['root'],_0x8103('0xc9'),_0x8103('0xca'),_0x8103('0xcb'));var _0x26933f=path['join'](config[_0x8103('0xcc')],_0x8103('0xc9'),'files',_0x8103('0xcd'));var _0xf6a9bf=path[_0x8103('0xce')](_0x6d5950,_0x5cd2b3);var _0x5d8799=util['format'](_0x8103('0xcf'),_0xeb9b0f[_0x8103('0xbb')]['id'],_0x5cd2b3);var _0x48c5df=path[_0x8103('0xce')](_0x6d5950,_0x5d8799);var _0x30d06b=[];if(_0xeb9b0f[_0x8103('0x2a')][_0x8103('0xcd')]){_0x30d06b[_0x8103('0x1f')]({'model':db[_0x8103('0xd0')],'as':_0x8103('0xd1'),'raw':!![]});}var _0x4b43ea=[{'model':db[_0x8103('0x20')],'as':_0x8103('0xd2'),'attributes':['id',_0x8103('0xb9'),_0x8103('0xd3'),'to','cc',_0x8103('0xd4'),'subject',_0x8103('0xd5')],'where':{'secret':![]},'order':qs[_0x8103('0x35')]('id'),'include':_0x30d06b}];return db['MailInteraction'][_0x8103('0x4d')]({'where':{'id':_0xeb9b0f[_0x8103('0xbb')]['id']},'include':_0x4b43ea})['then'](handleEntityNotFound(_0x54df46,null))[_0x8103('0x16')](function(_0x11a036){if(_0x11a036&&_0x11a036['Messages']){var _0x19222a=_0x11a036[_0x8103('0xd6')]({'plain':!![]});fs[_0x8103('0xd7')](_0xf6a9bf);return BPromise[_0x8103('0xd8')](_0x19222a[_0x8103('0xd2')],function(_0xfd76e8,_0x532043){var _0x4f7307={'from':_0xfd76e8[_0x8103('0xd3')],'to':_0xfd76e8['to'],'subject':_0xfd76e8['subject'],'html':htmlEntities[_0x8103('0xd9')](_0xfd76e8['body']),'headers':{'Date':moment(_0xfd76e8['createdAt'])[_0x8103('0xda')](_0x8103('0xdb'))},'attachments':[]};if(_0xfd76e8['cc']){_0x4f7307[_0x8103('0xdc')]['Cc']=_0xfd76e8['cc'];}if(_0xfd76e8[_0x8103('0xd4')]){_0x4f7307[_0x8103('0xdc')][_0x8103('0xdd')]=_0xfd76e8['bcc'];}return new BPromise(function(_0x47915c,_0x48c5a5){if(_0xfd76e8[_0x8103('0xd1')]){for(var _0x3cbcdf=0x0;_0x3cbcdf<_0xfd76e8[_0x8103('0xd1')][_0x8103('0x31')];_0x3cbcdf++){var _0x3236d9=_0xfd76e8[_0x8103('0xd1')][_0x3cbcdf];var _0x3ea09d=path[_0x8103('0xce')](_0x26933f,_0x3236d9['basename']);if(fs[_0x8103('0xde')](_0x3ea09d)){_0x4f7307[_0x8103('0xcd')][_0x8103('0x1f')]({'name':_0x3236d9[_0x8103('0x18')],'contentType':_0x3236d9[_0x8103('0x58')],'data':fs['readFileSync'](_0x3ea09d)});}}}emlformat[_0x8103('0xdf')](_0x4f7307,function(_0x5f56d3,_0x3836b7){if(_0x5f56d3)return _0x48c5a5(_0x5f56d3);fs['writeFileSync'](path['join'](_0xf6a9bf,util['format'](_0x8103('0xe0'),_0x532043)),_0x3836b7);return _0x47915c(_0x3836b7);});});})[_0x8103('0x16')](function(){return new BPromise(function(_0x4c5e17,_0x12d09d){zipdir(_0xf6a9bf,{'saveTo':_0x48c5df},function(_0x1302f0,_0x5b78ee){if(_0x1302f0)return _0x12d09d(_0x1302f0);return _0x4c5e17(_0x5b78ee);});})[_0x8103('0x16')](function(){return new BPromise(function(_0x31735a,_0x4328ca){rimraf(_0xf6a9bf,function(_0x5976bb){if(_0x5976bb)_0x4328ca(_0x5976bb);return _0x31735a();});});})[_0x8103('0x16')](function(){return _0x54df46['download'](_0x48c5df,_0x5d8799,function(_0xa00b3b){if(!_0xa00b3b)fs[_0x8103('0xe1')](_0x48c5df);});});});}else{return _0x54df46[_0x8103('0xe2')](0xc8);}})[_0x8103('0x26')](handleError(_0x54df46,null));}; \ No newline at end of file +var _0x595f=['fullname','Tags','TagIds','split','push','findOne','out','plainBody','trimStart','catch','index','map','MailInteraction','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','keys','isEmpty','MailAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','user','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','Setting','enableEmailPreview','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','MailMessage','omit','ids','merge','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','get','mkdirSync','each','decode','format','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','squel','juice','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','limit','count','set','Content-Range','update','then','error','stack','name','send'];(function(_0x128b78,_0x5c3211){var _0x586d64=function(_0x2b4ef7){while(--_0x2b4ef7){_0x128b78['push'](_0x128b78['shift']());}};_0x586d64(++_0x5c3211);}(_0x595f,0x1b4));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf595('0x0'));var zipdir=require(_0xf595('0x1'));var moment=require(_0xf595('0x2'));var BPromise=require(_0xf595('0x3'));var util=require(_0xf595('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xf595('0x5'));var juice=require(_0xf595('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xf595('0x7'));var logger=require('../../config/logger')(_0xf595('0x8'));var config=require(_0xf595('0x9'));var db=require(_0xf595('0xa'))['db'];var htmlEntities=require(_0xf595('0xb'));config[_0xf595('0xc')]=_[_0xf595('0xd')](config[_0xf595('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf595('0xe'))(new Redis(config[_0xf595('0xc')]));require(_0xf595('0xf'))['register'](socket);function respondWithStatusCode(_0x23dd60,_0x5c78fb){_0x5c78fb=_0x5c78fb||0xcc;return function(_0x610548){if(_0x610548){return _0x23dd60['sendStatus'](_0x5c78fb);}return _0x23dd60[_0xf595('0x10')](_0x5c78fb)[_0xf595('0x11')]();};}function respondWithResult(_0x4a7b3e,_0x5f2107){_0x5f2107=_0x5f2107||0xc8;return function(_0x4db25d){if(_0x4db25d){return _0x4a7b3e[_0xf595('0x10')](_0x5f2107)[_0xf595('0x12')](_0x4db25d);}};}function respondWithFilteredResult(_0x36284a,_0x5c5ab3){return function(_0x2c7a5e){if(_0x2c7a5e){var _0x108825=typeof _0x5c5ab3[_0xf595('0x13')]==='undefined'&&typeof _0x5c5ab3[_0xf595('0x14')]==='undefined';var _0x46bd46=_0x2c7a5e['count'];var _0x1d684d=_0x108825?0x0:_0x5c5ab3[_0xf595('0x13')];var _0x847c11=_0x108825?_0x2c7a5e[_0xf595('0x15')]:_0x5c5ab3[_0xf595('0x13')]+_0x5c5ab3[_0xf595('0x14')];var _0x150eb1;if(_0x847c11>=_0x46bd46){_0x847c11=_0x46bd46;_0x150eb1=0xc8;}else{_0x150eb1=0xce;}_0x36284a['status'](_0x150eb1);return _0x36284a[_0xf595('0x16')](_0xf595('0x17'),_0x1d684d+'-'+_0x847c11+'/'+_0x46bd46)[_0xf595('0x12')](_0x2c7a5e);}return null;};}function saveUpdates(_0x29a3e7){return function(_0x2585d8){if(_0x2585d8){return _0x2585d8[_0xf595('0x18')](_0x29a3e7)['then'](function(_0xe58ee1){return _0xe58ee1;});}return null;};}function removeEntity(_0x5aba1e){return function(_0x32be47){if(_0x32be47){return _0x32be47['destroy']()[_0xf595('0x19')](function(){_0x5aba1e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cefdc){return function(_0x4db908){if(!_0x4db908){_0x4cefdc['sendStatus'](0x194);}return _0x4db908;};}function handleError(_0x74ec27,_0x30b62d){_0x30b62d=_0x30b62d||0x1f4;return function(_0x237b7b){logger[_0xf595('0x1a')](_0x237b7b[_0xf595('0x1b')]);if(_0x237b7b[_0xf595('0x1c')]){delete _0x237b7b[_0xf595('0x1c')];}_0x74ec27['status'](_0x30b62d)[_0xf595('0x1d')](_0x237b7b);};}function getInteractionUsers(_0x35dea7,_0x5dc122){return new BPromise(function(_0x15c194,_0x7097b2){try{if(_0x5dc122[_0x35dea7['id']]){_0x35dea7['Users']=_['map'](_0x5dc122[_0x35dea7['id']],function(_0xcf13c){return{'id':_0xcf13c['id'],'fullname':_0xcf13c[_0xf595('0x1e')]};});}}catch(_0x4a1ec7){_0x7097b2(_0x4a1ec7);}_0x15c194(_0x35dea7);});}function getInteractionTags(_0x20b7c4,_0x217f85){return new BPromise(function(_0x443f20,_0x4f8c45){try{if(_0x20b7c4['TagIds']){_0x20b7c4[_0xf595('0x1f')]=[];_0x20b7c4[_0xf595('0x20')][_0xf595('0x21')](',')['forEach'](function(_0x23f110){_0x20b7c4['Tags'][_0xf595('0x22')](_0x217f85[_0x23f110]);});}delete _0x20b7c4['TagIds'];}catch(_0x465f5a){_0x4f8c45(_0x465f5a);}_0x443f20(_0x20b7c4);});}function getLastMessageText(_0x437254){return new BPromise(function(_0x2337e2,_0x190f0f){return db['MailMessage'][_0xf595('0x23')]({'where':{'$and':[{'MailInteractionId':_0x437254['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf595('0x24')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf595('0x25')],'order':'-id','raw':!![]})['then'](function(_0x34890a){if(_0x34890a&&_0x34890a[_0xf595('0x25')]){_0x437254['lastMsgText']=_[_0xf595('0x26')](_0x34890a[_0xf595('0x25')]);}_0x2337e2(_0x437254);})[_0xf595('0x27')](function(_0x3fb877){_0x190f0f(_0x3fb877);});});}function updateMailInteraction(_0xee55fe,_0x1c504b,_0x407198,_0x295242){return new BPromise(function(_0x4045dd,_0x10d182){return getInteractionUsers(_0xee55fe,_0x407198)[_0xf595('0x19')](function(_0xdcafa9){return getInteractionTags(_0xdcafa9,_0x1c504b);})[_0xf595('0x19')](function(_0x599bbb){if(_0x295242){_0x4045dd(getLastMessageText(_0x599bbb));}else{_0x4045dd(_0x599bbb);}})[_0xf595('0x27')](function(_0x2baa42){_0x10d182(_0x2baa42);});});}exports[_0xf595('0x28')]=function(_0x3cfe15,_0x582fbb){var _0x151c33={},_0x4f4abb={},_0xfd3f18={'count':0x0,'rows':[]};var _0xdd2f90=_[_0xf595('0x29')](db[_0xf595('0x2a')][_0xf595('0x2b')],function(_0x1d04e7){return{'name':_0x1d04e7['fieldName'],'type':_0x1d04e7[_0xf595('0x2c')][_0xf595('0x2d')]};});_0x4f4abb[_0xf595('0x2e')]=_[_0xf595('0x29')](_0xdd2f90,_0xf595('0x1c'));_0x4f4abb[_0xf595('0x2f')]=_['keys'](_0x3cfe15[_0xf595('0x2f')]);_0x4f4abb['filters']=_[_0xf595('0x30')](_0x4f4abb[_0xf595('0x2e')],_0x4f4abb[_0xf595('0x2f')]);_0x151c33[_0xf595('0x31')]=_['intersection'](_0x4f4abb[_0xf595('0x2e')],qs[_0xf595('0x32')](_0x3cfe15[_0xf595('0x2f')]['fields']));_0x151c33[_0xf595('0x31')]=_0x151c33[_0xf595('0x31')]['length']?_0x151c33['attributes']:_0x4f4abb[_0xf595('0x2e')];if(!_0x3cfe15['query'][_0xf595('0x33')](_0xf595('0x34'))){_0x151c33[_0xf595('0x14')]=qs[_0xf595('0x14')](_0x3cfe15[_0xf595('0x2f')]['limit']);_0x151c33['offset']=qs[_0xf595('0x13')](_0x3cfe15[_0xf595('0x2f')][_0xf595('0x13')]);}_0x151c33[_0xf595('0x35')]=qs['sort'](_0x3cfe15[_0xf595('0x2f')][_0xf595('0x36')]);_0x151c33[_0xf595('0x37')]=qs[_0xf595('0x38')](_[_0xf595('0x39')](_0x3cfe15[_0xf595('0x2f')],_0x4f4abb[_0xf595('0x38')]),_0xdd2f90);var _0x18c1a7=[];var _0x415afe=squel['select']()[_0xf595('0x3a')]('id')['field'](_0xf595('0x1c'))[_0xf595('0x3a')](_0xf595('0x3b'))[_0xf595('0x3c')](_0xf595('0x3d'));var _0x26c00b=squel[_0xf595('0x3e')]()[_0xf595('0x3a')](_0xf595('0x3f'))[_0xf595('0x3a')](_0xf595('0x40'))[_0xf595('0x3a')](_0xf595('0x41'))[_0xf595('0x3c')](_0xf595('0x42'),'ui')['left_join'](_0xf595('0x43'),'u',_0xf595('0x44'));var _0x3bc23d=squel['select']()[_0xf595('0x3c')](_0xf595('0x45'),'i')[_0xf595('0x46')](_0xf595('0x47'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf595('0x43'),'o','o.id\x20=\x20i.UserId')[_0xf595('0x46')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0xf595('0x46')]('mail_messages','me',_0xf595('0x48'))['left_join'](_0xf595('0x49'),'it',_0xf595('0x4a'))[_0xf595('0x46')](_0xf595('0x3d'),'t',_0xf595('0x4b'));var _0x58f370=squel[_0xf595('0x4c')]();var _0x404924=[];var _0x2d9410=squel[_0xf595('0x4c')]();var _0x4f52e8;if(_0x3cfe15[_0xf595('0x2f')][_0xf595('0x4d')]){_0x4f52e8=as[_0xf595('0x4e')](_0x3cfe15[_0xf595('0x2f')][_0xf595('0x4d')]);var _0x5352c6=_0x4f52e8[_0xf595('0x4f')];for(var _0xdeab2e=0x0;_0xdeab2e<_0x4f52e8[_0xf595('0x50')][_0xf595('0x51')];_0xdeab2e++){var _0x2989d1=_0x4f52e8['conditions'][_0xdeab2e];var _0x222ee0='i';var _0x3ededd=_[_0xf595('0x52')](_0xdd2f90,[_0xf595('0x1c'),_0x2989d1[_0xf595('0x3a')]]);if(!_0x3ededd){switch(_0x2989d1[_0xf595('0x3a')]){case _0xf595('0x53'):if(_0x2989d1['value']==0x1){_0x3bc23d[_0xf595('0x54')]('`'+_0x2989d1['field']+_0xf595('0x55'));}else{_0x3bc23d[_0xf595('0x54')]('`'+_0x2989d1['field']+_0xf595('0x56'));}break;case'Contact':if(_0x2989d1[_0xf595('0x57')]===_0xf595('0x58')){if(_0x2989d1[_0xf595('0x59')][_0xf595('0x21')]('\x20')['length']>0x1){_0x58f370[_0x5352c6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf595('0x5a')](_0x2989d1[_0xf595('0x59')]),null);}else{var _0xd45ee3='%'+_0x2989d1[_0xf595('0x59')]+'%';_0x58f370[_0x5352c6](_0xf595('0x5b'),_0xd45ee3,_0xd45ee3,_0xd45ee3);}}else{_0x3ededd=_[_0xf595('0x52')](_0xdd2f90,[_0xf595('0x1c'),_0xf595('0x5c')]);_0x2989d1[_0xf595('0x3a')]=_0xf595('0x5c');_0x403813=as['buildExpression'](_0x222ee0,_0x3ededd[_0xf595('0x2c')],_0x2989d1);_0x58f370[_0x5352c6](_0x403813[_0xf595('0x5d')],_0x403813[_0xf595('0x59')][_0xf595('0x5e')],_0x403813[_0xf595('0x59')]['end']);}break;case _0xf595('0x5f'):var _0x5c05e6=_0x2989d1[_0xf595('0x59')][_0xf595('0x21')](',')['map'](function(_0x4bd7d9){return Number(_0x4bd7d9);});_0x5c05e6[_0xf595('0x60')](function(_0x3b83da){_0x2d9410['or'](_0xf595('0x61'),'%,'+_0x3b83da+',%');});_0x404924=_[_0xf595('0x62')](_0x404924,_0x5c05e6);break;case _0xf595('0x63'):if(_0x2989d1[_0xf595('0x57')]===_0xf595('0x58')){_0x58f370[_0x5352c6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2989d1[_0xf595('0x59')]+'%',null);}else{_0x3ededd=_[_0xf595('0x52')](_0xdd2f90,[_0xf595('0x1c'),_0xf595('0x64')]);_0x2989d1['field']=_0xf595('0x64');_0x403813=as[_0xf595('0x65')](_0x222ee0,_0x3ededd[_0xf595('0x2c')],_0x2989d1);_0x58f370[_0x5352c6](_0x403813[_0xf595('0x5d')],_0x403813[_0xf595('0x59')]['start'],_0x403813[_0xf595('0x59')][_0xf595('0x11')]);}break;case _0xf595('0x25'):_0x403813=as[_0xf595('0x65')]('me',null,_0x2989d1);_0x58f370[_0x5352c6](_0x403813['text'],_0x403813[_0xf595('0x59')][_0xf595('0x5e')],_0x403813[_0xf595('0x59')]['end']);break;}}else{var _0x403813=as[_0xf595('0x65')](_0x222ee0,_0x3ededd[_0xf595('0x2c')],_0x2989d1);_0x58f370[_0x5352c6](_0x403813[_0xf595('0x5d')],_0x403813[_0xf595('0x59')][_0xf595('0x5e')],_0x403813[_0xf595('0x59')][_0xf595('0x11')]);}}}else{var _0x1e775d=_(_0x3cfe15[_0xf595('0x2f')])[_0xf595('0x66')]()[_0xf595('0x29')](function(_0x191792){return _['some'](_0xdd2f90,[_0xf595('0x1c'),_0x191792])?_0x191792:undefined;})['compact']()[_0xf595('0x59')]();if(!_[_0xf595('0x67')](_0x1e775d)){_0x1e775d[_0xf595('0x60')](function(_0x5d046b){if(_0x5d046b===_0xf595('0x68')){_0x3bc23d[_0xf595('0x37')]('i.MailAccountId\x20IN\x20?',[][_0xf595('0x69')](_0x3cfe15[_0xf595('0x2f')][_0x5d046b]));}else if(_0x5d046b===_0xf595('0x6a')){var _0x453360=JSON[_0xf595('0x6b')](_0x3cfe15['query'][_0x5d046b])[_0xf595('0x6c')];var _0x350d73=JSON[_0xf595('0x6b')](_0x3cfe15[_0xf595('0x2f')][_0x5d046b])[_0xf595('0x6d')];_0x3bc23d['where'](_0xf595('0x6e'),_0x453360,_0x350d73);}else{if(_0x3cfe15[_0xf595('0x2f')][_0x5d046b]===_0xf595('0x6f')){_0x3bc23d[_0xf595('0x37')]('i.'+_0x5d046b+_0xf595('0x70'));}else{_0x3bc23d[_0xf595('0x37')]('i.'+_0x5d046b+_0xf595('0x71'),_0x3cfe15[_0xf595('0x2f')][_0x5d046b]);}}});}if(_0x3cfe15['query'][_0xf595('0x72')]){if(_0x3cfe15['query']['read']==0x1){_0x3bc23d['having'](_0xf595('0x73'));}else{_0x3bc23d[_0xf595('0x54')](_0xf595('0x74'));}}if(_0x3cfe15['query'][_0xf595('0x75')]){_0x404924=_[_0xf595('0x76')](_0x3cfe15['query']['tag'])?_0x3cfe15[_0xf595('0x2f')]['tag']:new Array(_0x3cfe15[_0xf595('0x2f')][_0xf595('0x75')]);_0x404924[_0xf595('0x60')](function(_0x416e7b){_0x2d9410['or'](_0xf595('0x61'),'%,'+_0x416e7b+',%');});}if(_0x3cfe15[_0xf595('0x2f')][_0xf595('0x77')]){var _0x217525=_0x3cfe15[_0xf595('0x2f')][_0xf595('0x77')][_0xf595('0x78')]('\x5c','\x5c\x5c')[_0xf595('0x78')](/'/g,'\x27\x27');if(qs[_0xf595('0x79')](_0x217525)){_0x58f370['or']('i.id\x20LIKE\x20?',_0x217525+'%');}else if(qs[_0xf595('0x7a')](_0x217525)){_0x58f370['or']('c.email\x20LIKE\x20?',_0x217525+'%');}else{_0x58f370['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf595('0x5a')](_0x217525))['or'](_0xf595('0x7b'),qs[_0xf595('0x5a')](_0x217525));}}}_0x3bc23d[_0xf595('0x37')](_0x58f370);_0x3bc23d[_0xf595('0x7c')]('i.id');var _0x591f93={'type':db[_0xf595('0x7d')][_0xf595('0x7e')][_0xf595('0x7f')],'raw':!![]};var _0x4fb601=_0x3bc23d[_0xf595('0x80')]();_0x4fb601['field'](_0xf595('0x81'));_0x4fb601[_0xf595('0x3a')](_0xf595('0x82'),_0xf595('0x53'));if(_0x151c33[_0xf595('0x35')]){_0x151c33[_0xf595('0x35')][_0xf595('0x60')](function(_0x40964c){var _0x58b288=_0x40964c[0x0]===_0xf595('0x83')?_0x40964c[0x0]:'i.'+_0x40964c[0x0];_0x3bc23d[_0xf595('0x35')](_0x58b288,_0x40964c[0x1]===_0xf595('0x84')?![]:!![]);});}if(!_[_0xf595('0x67')](_0x404924)){_0x3bc23d[_0xf595('0x54')](_0x2d9410);_0x4fb601[_0xf595('0x37')](_0xf595('0x85'),_0x404924);}BPromise[_0xf595('0x86')]()['then'](function(){if(!_0x4f52e8){if(_0x3cfe15[_0xf595('0x2f')][_0xf595('0x68')])return;_0x4fb601[_0xf595('0x37')](_0xf595('0x87'));_0x3bc23d['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3cfe15['user'][_0xf595('0x88')]!==_0xf595('0x89'))return;return _0x3cfe15['user'][_0xf595('0x8a')]({'attributes':['id'],'raw':!![]})[_0xf595('0x19')](function(_0xa9992f){if(_[_0xf595('0x67')](_0xa9992f)){_0x4fb601[_0xf595('0x37')](_0xf595('0x8b'));_0x3bc23d['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x4fb601['where'](_0xf595('0x8c'),_[_0xf595('0x29')](_0xa9992f,'id'));_0x3bc23d[_0xf595('0x37')](_0xf595('0x8c'),_[_0xf595('0x29')](_0xa9992f,'id'));}});})['then'](function(){if(_0x3cfe15[_0xf595('0x8d')]['role']==='agent'&&!_0x4f52e8&&!_0x3cfe15['query']['MailAccountId'])return[];return db[_0xf595('0x8e')][_0xf595('0x2f')](_0x4fb601['toString'](),_0x591f93);})[_0xf595('0x19')](function(_0x16f5f6){_0xfd3f18[_0xf595('0x15')]=_0x16f5f6[_0xf595('0x51')];if(_0xfd3f18[_0xf595('0x15')]===0x0)return[];return db['sequelize']['query'](_0x415afe[_0xf595('0x8f')](),_0x591f93)['then'](function(_0xf6c815){_0x18c1a7=_[_0xf595('0x90')](_0xf6c815,'id');_0x591f93=_['merge'](_0x591f93,{'model':db[_0xf595('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3cfe15[_0xf595('0x2f')][_0xf595('0x32')]){_0x151c33[_0xf595('0x31')][_0xf595('0x60')](function(_0x28568f){_0x3bc23d[_0xf595('0x3a')]('i.'+_0x28568f);});}else{_0x3bc23d[_0xf595('0x3a')](_0xf595('0x82'),_0xf595('0x53'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x91'),_0xf595('0x92'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x93'),_0xf595('0x94'));_0x3bc23d[_0xf595('0x3a')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xf595('0x83'));_0x3bc23d[_0xf595('0x3a')]('i.id');_0x3bc23d[_0xf595('0x3a')](_0xf595('0x95'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x96'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x97'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x98'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x99'));_0x3bc23d[_0xf595('0x3a')]('i.lastMsgAt');_0x3bc23d[_0xf595('0x3a')]('i.lastMsgDirection');_0x3bc23d[_0xf595('0x3a')](_0xf595('0x9a'));_0x3bc23d['field']('i.disposition');_0x3bc23d[_0xf595('0x3a')](_0xf595('0x9b'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x9c'));_0x3bc23d['field'](_0xf595('0x9d'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x9e'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0x9f'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xa0'));_0x3bc23d['field'](_0xf595('0xa1'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xa2'),_0xf595('0xa3'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xa4'),_0xf595('0xa5'));_0x3bc23d['field'](_0xf595('0xa6'),_0xf595('0xa7'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xa8'),_0xf595('0xa9'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xaa'),_0xf595('0xab'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xac'),_0xf595('0xad'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xae'),_0xf595('0xaf'));_0x3bc23d['field']('o.internal',_0xf595('0xb0'));_0x3bc23d[_0xf595('0x3a')](_0xf595('0xb1'),_0xf595('0x20'));}if(_0x151c33[_0xf595('0x14')])_0x3bc23d['limit'](_0x151c33[_0xf595('0x14')]);if(_0x151c33[_0xf595('0x13')])_0x3bc23d['offset'](_0x151c33[_0xf595('0x13')]);return db['sequelize'][_0xf595('0x2f')](_0x3bc23d[_0xf595('0x8f')](),_0x591f93);})[_0xf595('0x19')](function(_0x5ac427){if(_0x5ac427[_0xf595('0x51')]>0x0)_0x26c00b[_0xf595('0x37')]('ui.MailInteractionId\x20IN\x20?',_[_0xf595('0x29')](_0x5ac427,'id'));return db[_0xf595('0x8e')]['query'](_0x26c00b[_0xf595('0x8f')](),_0x591f93)['then'](function(_0x23f563){var _0x2ee312=_['groupBy'](_0x23f563,_0xf595('0xb2'));var _0x1aef90=[];return db[_0xf595('0xb3')][_0xf595('0x23')]({'attributes':[_0xf595('0xb4')],'raw':!![]})[_0xf595('0x19')](function(_0x10d9c3){var _0x33a3a5=_0x10d9c3[_0xf595('0xb4')];_0x5ac427[_0xf595('0x60')](function(_0x13614e){_0x1aef90[_0xf595('0x22')](updateMailInteraction(_0x13614e,_0x18c1a7,_0x2ee312,_0x33a3a5));});return BPromise['all'](_0x1aef90);});});});})['then'](function(_0x1ed8e3){_0xfd3f18['rows']=_0x1ed8e3;return _0xfd3f18;})['then'](respondWithFilteredResult(_0x582fbb,_0x151c33))[_0xf595('0x27')](handleError(_0x582fbb,null));};exports[_0xf595('0xb5')]=function(_0x4c0103,_0x2bf529){var _0x5457bd={'raw':![],'where':{'id':_0x4c0103[_0xf595('0xb6')]['id']}},_0x1a7b0e={};_0x1a7b0e[_0xf595('0x2e')]=_['keys'](db[_0xf595('0x2a')]['rawAttributes']);_0x1a7b0e[_0xf595('0x2f')]=_[_0xf595('0x66')](_0x4c0103['query']);_0x1a7b0e[_0xf595('0x38')]=_[_0xf595('0x30')](_0x1a7b0e[_0xf595('0x2e')],_0x1a7b0e[_0xf595('0x2f')]);_0x5457bd['attributes']=_['intersection'](_0x1a7b0e[_0xf595('0x2e')],qs[_0xf595('0x32')](_0x4c0103[_0xf595('0x2f')]['fields']));_0x5457bd[_0xf595('0x31')]=_0x5457bd['attributes'][_0xf595('0x51')]?_0x5457bd[_0xf595('0x31')]:_0x1a7b0e[_0xf595('0x2e')];if(_0x4c0103[_0xf595('0x2f')][_0xf595('0xb7')]){_0x5457bd[_0xf595('0xb8')]=[{'all':!![]}];}_0x5457bd=_['merge']({},_0x5457bd,_0x4c0103[_0xf595('0xb9')]);return db[_0xf595('0x2a')]['find'](_0x5457bd)['then'](handleEntityNotFound(_0x2bf529,null))['then'](respondWithResult(_0x2bf529,null))['catch'](handleError(_0x2bf529,null));};exports[_0xf595('0xba')]=function(_0x2bbb69,_0x5c0d42){return db[_0xf595('0x2a')]['create'](_0x2bbb69[_0xf595('0xbb')],{})[_0xf595('0x19')](respondWithResult(_0x5c0d42,0xc9))['catch'](handleError(_0x5c0d42,null));};exports['update']=function(_0x256b4b,_0x17e451){if(_0x256b4b[_0xf595('0xbb')]['id']){delete _0x256b4b[_0xf595('0xbb')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x256b4b[_0xf595('0xb6')]['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x17e451,null))[_0xf595('0x19')](saveUpdates(_0x256b4b[_0xf595('0xbb')],null))['then'](respondWithResult(_0x17e451,null))['catch'](handleError(_0x17e451,null));};exports[_0xf595('0xbc')]=function(_0x5835f7,_0x43e53e){return db[_0xf595('0x2a')]['find']({'where':{'id':_0x5835f7['params']['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x43e53e,null))[_0xf595('0x19')](removeEntity(_0x43e53e,null))[_0xf595('0x27')](handleError(_0x43e53e,null));};exports[_0xf595('0xbd')]=function(_0x4f5c1e,_0x3d3443){return db[_0xf595('0x2a')][_0xf595('0xbd')]()[_0xf595('0x19')](respondWithResult(_0x3d3443,null))[_0xf595('0x27')](handleError(_0x3d3443,null));};exports[_0xf595('0xbe')]=function(_0x3b1964,_0x3f022f){return db[_0xf595('0xbf')]['find']({'where':{'id':_0x3b1964[_0xf595('0xb6')]['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x3f022f,null))[_0xf595('0x19')](function(_0x504395){if(_0x504395){return _0x504395[_0xf595('0xbe')](_0x3b1964[_0xf595('0xbb')]['ids'],_[_0xf595('0xc0')](_0x3b1964[_0xf595('0xbb')],[_0xf595('0xc1'),'id'])||{});}})[_0xf595('0x19')](respondWithResult(_0x3f022f,null))['catch'](handleError(_0x3f022f,null));};exports['getMessages']=function(_0x40ba2f,_0x409dbb){var _0xfac028={'raw':![],'where':{}};var _0x1fd91b={};var _0x2f021a={'count':0x0,'rows':[]};return db[_0xf595('0x2a')]['findOne']({'where':{'id':_0x40ba2f[_0xf595('0xb6')]['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x409dbb,null))[_0xf595('0x19')](function(_0xcb8c19){if(_0xcb8c19){_0x1fd91b['model']=_[_0xf595('0x66')](db[_0xf595('0xbf')][_0xf595('0x2b')]);_0x1fd91b['query']=_[_0xf595('0x66')](_0x40ba2f[_0xf595('0x2f')]);_0x1fd91b[_0xf595('0x38')]=_[_0xf595('0x30')](_0x1fd91b[_0xf595('0x2e')],_0x1fd91b['query']);_0xfac028['attributes']=_['intersection'](_0x1fd91b[_0xf595('0x2e')],qs[_0xf595('0x32')](_0x40ba2f[_0xf595('0x2f')][_0xf595('0x32')]));_0xfac028[_0xf595('0x31')]=_0xfac028[_0xf595('0x31')][_0xf595('0x51')]?_0xfac028['attributes']:_0x1fd91b[_0xf595('0x2e')];if(!_0x40ba2f['query'][_0xf595('0x33')]('nolimit')){_0xfac028[_0xf595('0x14')]=qs['limit'](_0x40ba2f[_0xf595('0x2f')][_0xf595('0x14')]);_0xfac028['offset']=qs[_0xf595('0x13')](_0x40ba2f[_0xf595('0x2f')]['offset']);}_0xfac028[_0xf595('0x35')]=qs[_0xf595('0x36')](_0x40ba2f[_0xf595('0x2f')]['sort']);_0xfac028['where']=qs[_0xf595('0x38')](_['pick'](_0x40ba2f[_0xf595('0x2f')],_0x1fd91b[_0xf595('0x38')]));_0xfac028[_0xf595('0x37')][_0xf595('0xb2')]=_0xcb8c19['id'];if(_0x40ba2f[_0xf595('0x2f')][_0xf595('0x77')]){_0xfac028[_0xf595('0x37')]=_[_0xf595('0xc2')](_0xfac028[_0xf595('0x37')],{'$or':_['map'](_0xfac028[_0xf595('0x31')],function(_0x13b2c6){var _0x1156e6={};_0x1156e6[_0x13b2c6]={'$like':'%'+_0x40ba2f[_0xf595('0x2f')][_0xf595('0x77')]+'%'};return _0x1156e6;})});}if(_0x40ba2f[_0xf595('0x2f')][_0xf595('0x6c')]){var _0xbd6b68=_0x40ba2f[_0xf595('0x2f')][_0xf595('0x6c')][_0xf595('0x21')](',');var _0x5b038f={};_0x5b038f[_0xbd6b68[0x0]]={'$gte':moment(_0xbd6b68[0x1])['format'](_0xf595('0xc3'))};_0xfac028[_0xf595('0x37')]=_[_0xf595('0xc2')](_0xfac028[_0xf595('0x37')],_0x5b038f);}_0xfac028=_[_0xf595('0xc2')]({},_0xfac028,_0x40ba2f[_0xf595('0xb9')]);return db[_0xf595('0xbf')][_0xf595('0x15')]({'where':_0xfac028[_0xf595('0x37')]})[_0xf595('0x19')](function(_0x4bf8d7){_0x2f021a[_0xf595('0x15')]=_0x4bf8d7;if(_0x40ba2f[_0xf595('0x2f')][_0xf595('0xb7')]){_0xfac028[_0xf595('0xb8')]=[{'all':!![]}];}return db[_0xf595('0xbf')][_0xf595('0xc4')](_0xfac028);})['then'](function(_0x195091){if(_0x40ba2f[_0xf595('0x2f')][_0xf595('0xc5')]==='true'){for(var _0x17050d=0x0;_0x17050d<_0x195091[_0xf595('0x51')];_0x17050d++){_0x195091[_0x17050d][_0xf595('0xbb')]=juice(_0x195091[_0x17050d][_0xf595('0xbb')]);}}_0x2f021a[_0xf595('0xc6')]=_0x195091;return _0x2f021a;});}})['then'](respondWithFilteredResult(_0x409dbb,_0xfac028))[_0xf595('0x27')](handleError(_0x409dbb,null));};exports[_0xf595('0xc7')]=function(_0x29012a,_0x4d6edb){return db[_0xf595('0x2a')][_0xf595('0x52')]({'where':{'id':_0x29012a['params']['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x4d6edb,null))[_0xf595('0x19')](function(_0x37d955){if(_0x37d955){return _0x37d955[_0xf595('0xc8')](_0x29012a['body'][_0xf595('0xc1')],_[_0xf595('0xc0')](_0x29012a[_0xf595('0xbb')],[_0xf595('0xc1'),'id'])||{})[_0xf595('0xc9')](function(){return db[_0xf595('0x5f')][_0xf595('0xc4')]({'attributes':['id',_0xf595('0x1c'),_0xf595('0x3b')],'where':{'id':_0x29012a[_0xf595('0xbb')][_0xf595('0xc1')]}});})[_0xf595('0x19')](function(_0x5e251d){socket[_0xf595('0xca')](_0xf595('0xcb'),{'id':Number(_0x29012a[_0xf595('0xb6')]['id']),'tags':_0x5e251d||[]});return{'id':Number(_0x29012a['params']['id']),'tags':_0x5e251d||[]};});}})[_0xf595('0x19')](respondWithResult(_0x4d6edb,null))['catch'](handleError(_0x4d6edb,null));};exports[_0xf595('0xcc')]=function(_0x50295e,_0x3884bc){return db[_0xf595('0x2a')][_0xf595('0x52')]({'where':{'id':_0x50295e[_0xf595('0xb6')]['id']}})[_0xf595('0x19')](handleEntityNotFound(_0x3884bc,null))['then'](function(_0x1069fd){if(_0x1069fd){return _0x1069fd[_0xf595('0xcc')](_0x50295e[_0xf595('0x2f')][_0xf595('0xc1')]);}})[_0xf595('0x19')](respondWithStatusCode(_0x3884bc,null))[_0xf595('0x27')](handleError(_0x3884bc,null));};exports['download']=function(_0x245f00,_0x1f9e17){var _0x3a2618=moment()[_0xf595('0xcd')]()[_0xf595('0x8f')]();var _0x50b59e=path[_0xf595('0xce')](config['root'],_0xf595('0xcf'),_0xf595('0xd0'),_0xf595('0xd1'));var _0x4dcdcd=path['join'](config[_0xf595('0xd2')],_0xf595('0xcf'),_0xf595('0xd0'),_0xf595('0xd3'));var _0xfa1b10=path[_0xf595('0xce')](_0x50b59e,_0x3a2618);var _0x4f3b36=util['format'](_0xf595('0xd4'),_0x245f00[_0xf595('0xb6')]['id'],_0x3a2618);var _0x15e864=path[_0xf595('0xce')](_0x50b59e,_0x4f3b36);var _0x3e7f27=[];if(_0x245f00[_0xf595('0x2f')][_0xf595('0xd3')]){_0x3e7f27[_0xf595('0x22')]({'model':db[_0xf595('0xd5')],'as':'Attachments','raw':!![]});}var _0x30369a=[{'model':db[_0xf595('0xbf')],'as':_0xf595('0xd6'),'attributes':['id',_0xf595('0xbb'),_0xf595('0x3c'),'to','cc',_0xf595('0xd7'),_0xf595('0xd8'),_0xf595('0x6a')],'where':{'secret':![]},'order':qs[_0xf595('0x36')]('id'),'include':_0x3e7f27}];return db[_0xf595('0x2a')]['find']({'where':{'id':_0x245f00[_0xf595('0xb6')]['id']},'include':_0x30369a})[_0xf595('0x19')](handleEntityNotFound(_0x1f9e17,null))[_0xf595('0x19')](function(_0x5135c0){if(_0x5135c0&&_0x5135c0[_0xf595('0xd6')]){var _0x3ab215=_0x5135c0[_0xf595('0xd9')]({'plain':!![]});fs[_0xf595('0xda')](_0xfa1b10);return BPromise[_0xf595('0xdb')](_0x3ab215[_0xf595('0xd6')],function(_0x2acf7e,_0x226873){var _0x24c01a={'from':_0x2acf7e[_0xf595('0x3c')],'to':_0x2acf7e['to'],'subject':_0x2acf7e['subject'],'html':htmlEntities[_0xf595('0xdc')](_0x2acf7e[_0xf595('0xbb')]),'headers':{'Date':moment(_0x2acf7e[_0xf595('0x6a')])[_0xf595('0xdd')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2acf7e['cc']){_0x24c01a['headers']['Cc']=_0x2acf7e['cc'];}if(_0x2acf7e['bcc']){_0x24c01a[_0xf595('0xde')][_0xf595('0xdf')]=_0x2acf7e[_0xf595('0xd7')];}return new BPromise(function(_0x301ce6,_0x1f334c){if(_0x2acf7e[_0xf595('0xe0')]){for(var _0x412814=0x0;_0x412814<_0x2acf7e['Attachments'][_0xf595('0x51')];_0x412814++){var _0x45cb62=_0x2acf7e[_0xf595('0xe0')][_0x412814];var _0x326055=path[_0xf595('0xce')](_0x4dcdcd,_0x45cb62[_0xf595('0xe1')]);if(fs[_0xf595('0xe2')](_0x326055)){_0x24c01a[_0xf595('0xd3')][_0xf595('0x22')]({'name':_0x45cb62[_0xf595('0x1c')],'contentType':_0x45cb62[_0xf595('0x2c')],'data':fs[_0xf595('0xe3')](_0x326055)});}}}emlformat[_0xf595('0xe4')](_0x24c01a,function(_0x36db49,_0x188afc){if(_0x36db49)return _0x1f334c(_0x36db49);fs[_0xf595('0xe5')](path[_0xf595('0xce')](_0xfa1b10,util[_0xf595('0xdd')](_0xf595('0xe6'),_0x226873)),_0x188afc);return _0x301ce6(_0x188afc);});});})[_0xf595('0x19')](function(){return new BPromise(function(_0xcf8f9b,_0x4457b2){zipdir(_0xfa1b10,{'saveTo':_0x15e864},function(_0x52e275,_0x499d18){if(_0x52e275)return _0x4457b2(_0x52e275);return _0xcf8f9b(_0x499d18);});})['then'](function(){return new BPromise(function(_0x282785,_0x12cd5f){rimraf(_0xfa1b10,function(_0x39bd69){if(_0x39bd69)_0x12cd5f(_0x39bd69);return _0x282785();});});})[_0xf595('0x19')](function(){return _0x1f9e17['download'](_0x15e864,_0x4f3b36,function(_0x1e044a){if(!_0x1e044a)fs[_0xf595('0xe7')](_0x15e864);});});});}else{return _0x1f9e17[_0xf595('0xe8')](0xc8);}})[_0xf595('0x27')](handleError(_0x1f9e17,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c4a1303..954f64d 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 _0xb085=['catch','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb085,0x9b));var _0x5b08=function(_0x3dd6b1,_0x93c89){_0x3dd6b1=_0x3dd6b1-0x0;var _0x34b485=_0xb085[_0x3dd6b1];return _0x34b485;};'use strict';var EventEmitter=require(_0x5b08('0x0'));var MailInteraction=require(_0x5b08('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x5b08('0x1'))['db'][_0x5b08('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5b08('0x3')](0x0);var events={'afterCreate':_0x5b08('0x4'),'afterUpdate':_0x5b08('0x5'),'afterDestroy':_0x5b08('0x6')};function emitEvent(_0x1b3990){return function(_0x33b71d,_0xc17894,_0x4ebf0e){_0x33b71d[_0x5b08('0x7')]({'attributes':['id'],'raw':!![]})[_0x5b08('0x8')](function(_0x2e98b3){_0x33b71d[_0x5b08('0x9')](_0x5b08('0xa'),_0x2e98b3[_0x5b08('0xb')](function(_0x935aee){return{'id':_0x935aee['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x33b71d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x32a7f0){_0x33b71d[_0x5b08('0x9')](_0x5b08('0xc'),_0x32a7f0[_0x5b08('0xd')]);MailInteractionEvents[_0x5b08('0xe')](_0x1b3990+':'+_0x33b71d['id'],_0x33b71d);MailInteractionEvents[_0x5b08('0xe')](_0x1b3990,_0x33b71d);_0x4ebf0e(null);})[_0x5b08('0xf')](_0x4ebf0e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5b08('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x3dcf=['setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3dcf,0xe8));var _0xf3dc=function(_0x4902aa,_0x142afa){_0x4902aa=_0x4902aa-0x0;var _0x10852f=_0x3dcf[_0x4902aa];return _0x10852f;};'use strict';var EventEmitter=require(_0xf3dc('0x0'));var MailInteraction=require(_0xf3dc('0x1'))['db'][_0xf3dc('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf3dc('0x3')](0x0);var events={'afterCreate':_0xf3dc('0x4'),'afterUpdate':'update','afterDestroy':_0xf3dc('0x5')};function emitEvent(_0x35021a){return function(_0x51cab6,_0x54772c,_0x39453e){_0x51cab6['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x28e85e){_0x51cab6[_0xf3dc('0x6')](_0xf3dc('0x7'),_0x28e85e['map'](function(_0x47081b){return{'id':_0x47081b['id']};}));return MailMessage[_0xf3dc('0x8')]({'where':{'MailInteractionId':_0x51cab6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf3dc('0x9')](function(_0x39f320){_0x51cab6['setDataValue'](_0xf3dc('0xa'),_0x39f320[_0xf3dc('0xb')]);MailInteractionEvents[_0xf3dc('0xc')](_0x35021a+':'+_0x51cab6['id'],_0x51cab6);MailInteractionEvents[_0xf3dc('0xc')](_0x35021a,_0x51cab6);_0x39453e(null);})[_0xf3dc('0xd')](_0x39453e(null));};}for(var e in events){if(events[_0xf3dc('0xe')](e)){var event=events[e];MailInteraction[_0xf3dc('0xf')](e,emitEvent(event));}}module[_0xf3dc('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 190370d..9b10228 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 _0x4261=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','format','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','mail_interactions','fti_mail_interactions'];(function(_0x5ab633,_0x27e5a5){var _0x429b88=function(_0x4d8144){while(--_0x4d8144){_0x5ab633['push'](_0x5ab633['shift']());}};_0x429b88(++_0x27e5a5);}(_0x4261,0x16d));var _0x1426=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4261[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x1426('0x0'));var logger=require(_0x1426('0x1'))(_0x1426('0x2'));var moment=require(_0x1426('0x3'));var BPromise=require(_0x1426('0x4'));var rp=require(_0x1426('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1426('0x6'));var config=require(_0x1426('0x7'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x1b4cdc,_0x5701d8){return _0x1b4cdc['define']('MailInteraction',attributes,{'tableName':_0x1426('0x8'),'paranoid':![],'indexes':[{'name':_0x1426('0x9'),'fields':[_0x1426('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a63fd,_0x265de9,_0x1d28de){if(_0x3a63fd[_0x1426('0xb')]){_0x3a63fd[_0x1426('0xc')]=moment()['format'](_0x1426('0xd'));}if(_0x3a63fd[_0x1426('0xe')]){_0x3a63fd[_0x1426('0xf')]=moment()['format'](_0x1426('0xd'));}_0x1d28de(null,_0x265de9);},'beforeUpdate':function(_0x50afaa,_0x1475b4,_0x6b6e27){if(_0x50afaa[_0x1426('0x10')](_0x1426('0xb'))){_0x50afaa[_0x1426('0xc')]=_0x50afaa['substatus']?moment()[_0x1426('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x50afaa[_0x1426('0x10')]('closed')){_0x50afaa[_0x1426('0xf')]=moment()[_0x1426('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x50afaa['substatus']=null;_0x50afaa[_0x1426('0xc')]=null;}_0x6b6e27(null,_0x50afaa);},'afterUpdate':function(_0x230946,_0x15502a,_0xbb33c4){var _0x3c2a66=_0x1b4cdc[_0x1426('0x12')];var _0x3644ff=_0x230946[_0x1426('0x13')]({'plain':!![]});if(_0x3644ff[_0x1426('0xe')]){return _0x3c2a66[_0x1426('0x14')][_0x1426('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3644ff['id']}})[_0x1426('0x16')](function(){_0xbb33c4();})[_0x1426('0x17')](function(_0x273a03){_0xbb33c4(_0x273a03);});}else{_0xbb33c4();}}},'charset':'utf8mb4','collate':_0x1426('0x18')});}; \ No newline at end of file +var _0xa55a=['define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','get','MailMessage','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','../../config/environment','./mailInteraction.attributes'];(function(_0x344da9,_0x13502b){var _0x14c587=function(_0x2f4c15){while(--_0x2f4c15){_0x344da9['push'](_0x344da9['shift']());}};_0x14c587(++_0x13502b);}(_0xa55a,0x1f1));var _0xaa55=function(_0x166f1b,_0x323ef0){_0x166f1b=_0x166f1b-0x0;var _0x185bd2=_0xa55a[_0x166f1b];return _0x185bd2;};'use strict';var _=require(_0xaa55('0x0'));var util=require(_0xaa55('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa55('0x2'));var BPromise=require('bluebird');var rp=require(_0xaa55('0x3'));var fs=require('fs');var path=require(_0xaa55('0x4'));var rimraf=require('rimraf');var config=require(_0xaa55('0x5'));var attributes=require(_0xaa55('0x6'));module['exports']=function(_0x2da3d6,_0x44961f){return _0x2da3d6[_0xaa55('0x7')]('MailInteraction',attributes,{'tableName':_0xaa55('0x8'),'paranoid':![],'indexes':[{'name':_0xaa55('0x9'),'fields':[_0xaa55('0xa'),'to'],'type':_0xaa55('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39a2f1,_0x102586,_0x94c5d5){if(_0x39a2f1[_0xaa55('0xc')]){_0x39a2f1['substatusAt']=moment()[_0xaa55('0xd')](_0xaa55('0xe'));}if(_0x39a2f1[_0xaa55('0xf')]){_0x39a2f1[_0xaa55('0x10')]=moment()[_0xaa55('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x94c5d5(null,_0x102586);},'beforeUpdate':function(_0x70f263,_0xbeba74,_0x2f8249){if(_0x70f263[_0xaa55('0x11')](_0xaa55('0xc'))){_0x70f263[_0xaa55('0x12')]=_0x70f263[_0xaa55('0xc')]?moment()[_0xaa55('0xd')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x70f263[_0xaa55('0x11')]('closed')){_0x70f263[_0xaa55('0x10')]=moment()[_0xaa55('0xd')](_0xaa55('0xe'));_0x70f263[_0xaa55('0xc')]=null;_0x70f263['substatusAt']=null;}_0x2f8249(null,_0x70f263);},'afterUpdate':function(_0x132ca,_0x2fe96b,_0x2ced6f){var _0x26b4e7=_0x2da3d6['models'];var _0x4bdf9c=_0x132ca[_0xaa55('0x13')]({'plain':!![]});if(_0x4bdf9c[_0xaa55('0xf')]){return _0x26b4e7[_0xaa55('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x4bdf9c['id']}})['then'](function(){_0x2ced6f();})[_0xaa55('0x15')](function(_0x5bd65c){_0x2ced6f(_0x5bd65c);});}else{_0x2ced6f();}}},'charset':_0xaa55('0x16'),'collate':_0xaa55('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 424c861..c8586c8 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 _0x51a8=['where','attributes','limit','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailInteraction','update','body','options'];(function(_0x28ab95,_0x5e5670){var _0x369b86=function(_0x2e76a4){while(--_0x2e76a4){_0x28ab95['push'](_0x28ab95['shift']());}};_0x369b86(++_0x5e5670);}(_0x51a8,0x186));var _0x851a=function(_0x26eb2a,_0x5293d9){_0x26eb2a=_0x26eb2a-0x0;var _0x14eed3=_0x51a8[_0x26eb2a];return _0x14eed3;};'use strict';var _=require(_0x851a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x851a('0x1'));var rs=require(_0x851a('0x2'));var fs=require('fs');var Redis=require(_0x851a('0x3'));var db=require(_0x851a('0x4'))['db'];var utils=require(_0x851a('0x5'));var logger=require(_0x851a('0x6'))(_0x851a('0x7'));var config=require(_0x851a('0x8'));var jayson=require(_0x851a('0x9'));var client=jayson[_0x851a('0xa')]['http']({'port':0x232a});config['redis']=_[_0x851a('0xb')](config[_0x851a('0xc')],{'host':_0x851a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x851a('0xc')]));require(_0x851a('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e7938,_0x91ebb9,_0x428dc1){return new BPromise(function(_0xe2f757,_0x96cc23){return client[_0x851a('0xf')](_0x5e7938,_0x428dc1)[_0x851a('0x10')](function(_0x2b809c){logger[_0x851a('0x11')](_0x851a('0x12'),_0x91ebb9,_0x851a('0x13'));logger[_0x851a('0x14')](_0x851a('0x15'),_0x91ebb9,'request\x20sent',JSON['stringify'](_0x2b809c));if(_0x2b809c[_0x851a('0x16')]){if(_0x2b809c['error'][_0x851a('0x17')]===0x1f4){logger[_0x851a('0x16')]('MailInteraction,\x20%s,\x20%s',_0x91ebb9,_0x2b809c['error'][_0x851a('0x18')]);return _0x96cc23(_0x2b809c[_0x851a('0x16')]['message']);}logger[_0x851a('0x16')](_0x851a('0x12'),_0x91ebb9,_0x2b809c['error'][_0x851a('0x18')]);return _0xe2f757(_0x2b809c[_0x851a('0x16')][_0x851a('0x18')]);}else{logger[_0x851a('0x11')]('MailInteraction,\x20%s,\x20%s',_0x91ebb9,_0x851a('0x13'));_0xe2f757(_0x2b809c['result']['message']);}})[_0x851a('0x19')](function(_0xd53e6f){logger[_0x851a('0x16')](_0x851a('0x12'),_0x91ebb9,_0xd53e6f);_0x96cc23(_0xd53e6f);});});}exports['UpdateMailInteraction']=function(_0x2069f6){var _0x749cd0=this;return new Promise(function(_0x2d8e98,_0x459534){return db[_0x851a('0x1a')][_0x851a('0x1b')](_0x2069f6[_0x851a('0x1c')],{'raw':_0x2069f6[_0x851a('0x1d')]?_0x2069f6[_0x851a('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x1e')]||null:null,'attributes':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x1f')]||null:null,'limit':_0x2069f6['options']?_0x2069f6[_0x851a('0x1d')][_0x851a('0x20')]||null:null})[_0x851a('0x10')](function(_0x30a5b2){logger[_0x851a('0x11')](_0x851a('0x21'),_0x2069f6);logger['debug']('UpdateMailInteraction',_0x2069f6,JSON[_0x851a('0x22')](_0x30a5b2));_0x2d8e98(_0x30a5b2);})['catch'](function(_0x6b80ec){logger[_0x851a('0x16')]('UpdateMailInteraction',_0x6b80ec['message'],_0x2069f6);_0x459534(_0x749cd0[_0x851a('0x16')](0x1f4,_0x6b80ec[_0x851a('0x18')]));});});};exports[_0x851a('0x23')]=function(_0x5dd3b4){return new Promise(function(_0x4e337d,_0x630bdc){return db[_0x851a('0x1a')][_0x851a('0x24')]({'where':_0x5dd3b4[_0x851a('0x1d')]?_0x5dd3b4[_0x851a('0x1d')][_0x851a('0x1e')]||null:null})[_0x851a('0x10')](function(_0x46b992){if(_0x46b992){return _0x46b992[_0x851a('0x25')](_0x5dd3b4['body']['ids'],_[_0x851a('0x26')](_0x5dd3b4[_0x851a('0x1c')],[_0x851a('0x27'),'id'])||{});}})[_0x851a('0x28')](function(_0x11658b){logger[_0x851a('0x11')](_0x851a('0x29'),_0x5dd3b4);logger[_0x851a('0x14')](_0x851a('0x29'),_0x5dd3b4,JSON[_0x851a('0x22')](_0x11658b));_0x4e337d(_0x11658b);})[_0x851a('0x19')](function(_0xe9cfaf){logger[_0x851a('0x16')](_0x851a('0x29'),_0xe9cfaf[_0x851a('0x18')],_0x5dd3b4);_0x630bdc(_this[_0x851a('0x16')](0x1f4,_0xe9cfaf[_0x851a('0x18')]));});});}; \ No newline at end of file +var _0xbaa3=['defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','debug','stringify','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x149550,_0x1a1ef9){var _0x2a93bf=function(_0x2431e3){while(--_0x2431e3){_0x149550['push'](_0x149550['shift']());}};_0x2a93bf(++_0x1a1ef9);}(_0xbaa3,0x100));var _0x3baa=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xbaa3[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0x3baa('0x0'));var util=require(_0x3baa('0x1'));var moment=require('moment');var BPromise=require(_0x3baa('0x2'));var rs=require(_0x3baa('0x3'));var fs=require('fs');var Redis=require(_0x3baa('0x4'));var db=require(_0x3baa('0x5'))['db'];var utils=require(_0x3baa('0x6'));var logger=require(_0x3baa('0x7'))(_0x3baa('0x8'));var config=require(_0x3baa('0x9'));var jayson=require(_0x3baa('0xa'));var client=jayson[_0x3baa('0xb')][_0x3baa('0xc')]({'port':0x232a});config[_0x3baa('0xd')]=_[_0x3baa('0xe')](config[_0x3baa('0xd')],{'host':_0x3baa('0xf'),'port':0x18eb});var socket=require(_0x3baa('0x10'))(new Redis(config[_0x3baa('0xd')]));require(_0x3baa('0x11'))[_0x3baa('0x12')](socket);function respondWithRpcPromise(_0x1308fa,_0x23f95b,_0x5d5115){return new BPromise(function(_0x6be755,_0x4c37ed){return client[_0x3baa('0x13')](_0x1308fa,_0x5d5115)[_0x3baa('0x14')](function(_0xa8c67e){logger[_0x3baa('0x15')](_0x3baa('0x16'),_0x23f95b,_0x3baa('0x17'));logger['debug'](_0x3baa('0x18'),_0x23f95b,_0x3baa('0x17'),JSON['stringify'](_0xa8c67e));if(_0xa8c67e[_0x3baa('0x19')]){if(_0xa8c67e['error'][_0x3baa('0x1a')]===0x1f4){logger[_0x3baa('0x19')](_0x3baa('0x16'),_0x23f95b,_0xa8c67e[_0x3baa('0x19')][_0x3baa('0x1b')]);return _0x4c37ed(_0xa8c67e[_0x3baa('0x19')]['message']);}logger['error'](_0x3baa('0x16'),_0x23f95b,_0xa8c67e[_0x3baa('0x19')][_0x3baa('0x1b')]);return _0x6be755(_0xa8c67e['error'][_0x3baa('0x1b')]);}else{logger[_0x3baa('0x15')]('MailInteraction,\x20%s,\x20%s',_0x23f95b,_0x3baa('0x17'));_0x6be755(_0xa8c67e[_0x3baa('0x1c')]['message']);}})[_0x3baa('0x1d')](function(_0x29e0fa){logger[_0x3baa('0x19')](_0x3baa('0x16'),_0x23f95b,_0x29e0fa);_0x4c37ed(_0x29e0fa);});});}exports[_0x3baa('0x1e')]=function(_0x940422){var _0x25e5a7=this;return new Promise(function(_0x26ebd9,_0x2c7c26){return db[_0x3baa('0x1f')][_0x3baa('0x20')](_0x940422[_0x3baa('0x21')],{'raw':_0x940422['options']?_0x940422[_0x3baa('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x940422[_0x3baa('0x22')]?_0x940422['options'][_0x3baa('0x23')]||null:null,'attributes':_0x940422[_0x3baa('0x22')]?_0x940422['options'][_0x3baa('0x24')]||null:null,'limit':_0x940422[_0x3baa('0x22')]?_0x940422['options']['limit']||null:null})['then'](function(_0x35d84c){logger[_0x3baa('0x15')](_0x3baa('0x1e'),_0x940422);logger[_0x3baa('0x25')]('UpdateMailInteraction',_0x940422,JSON[_0x3baa('0x26')](_0x35d84c));_0x26ebd9(_0x35d84c);})[_0x3baa('0x1d')](function(_0x1d7c46){logger[_0x3baa('0x19')](_0x3baa('0x1e'),_0x1d7c46[_0x3baa('0x1b')],_0x940422);_0x2c7c26(_0x25e5a7[_0x3baa('0x19')](0x1f4,_0x1d7c46['message']));});});};exports[_0x3baa('0x27')]=function(_0x2e9770){return new Promise(function(_0x1e4c95,_0x30334f){return db[_0x3baa('0x1f')]['find']({'where':_0x2e9770[_0x3baa('0x22')]?_0x2e9770[_0x3baa('0x22')][_0x3baa('0x23')]||null:null})[_0x3baa('0x14')](function(_0x5cbbe5){if(_0x5cbbe5){return _0x5cbbe5[_0x3baa('0x28')](_0x2e9770[_0x3baa('0x21')][_0x3baa('0x29')],_[_0x3baa('0x2a')](_0x2e9770['body'],[_0x3baa('0x29'),'id'])||{});}})[_0x3baa('0x2b')](function(_0x4a4da7){logger['info'](_0x3baa('0x2c'),_0x2e9770);logger[_0x3baa('0x25')]('AddTags',_0x2e9770,JSON[_0x3baa('0x26')](_0x4a4da7));_0x1e4c95(_0x4a4da7);})[_0x3baa('0x1d')](function(_0xe27f6a){logger[_0x3baa('0x19')](_0x3baa('0x2c'),_0xe27f6a['message'],_0x2e9770);_0x30334f(_this[_0x3baa('0x19')](0x1f4,_0xe27f6a[_0x3baa('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index fd5d186..bbd39da 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 _0xe06f=['./mailInteraction.events','save','remove','update','emit','removeListener','length','mailInteraction:'];(function(_0xaaeda8,_0x1bc84c){var _0x4b2fe2=function(_0x58ea1f){while(--_0x58ea1f){_0xaaeda8['push'](_0xaaeda8['shift']());}};_0x4b2fe2(++_0x1bc84c);}(_0xe06f,0xa8));var _0xfe06=function(_0x48c140,_0x17d968){_0x48c140=_0x48c140-0x0;var _0x530f1b=_0xe06f[_0x48c140];return _0x530f1b;};'use strict';var MailInteractionEvents=require(_0xfe06('0x0'));var events=[_0xfe06('0x1'),_0xfe06('0x2'),_0xfe06('0x3')];function createListener(_0xddac21,_0x358b85){return function(_0x4be8fa){_0x358b85[_0xfe06('0x4')](_0xddac21,_0x4be8fa);};}function removeListener(_0x4ca037,_0x1eb312){return function(){MailInteractionEvents[_0xfe06('0x5')](_0x4ca037,_0x1eb312);};}exports['register']=function(_0x3a4163){for(var _0xf4e32d=0x0,_0x20a5db=events[_0xfe06('0x6')];_0xf4e32d<_0x20a5db;_0xf4e32d++){var _0x3edbda=events[_0xf4e32d];var _0x1c86a0=createListener(_0xfe06('0x7')+_0x3edbda,_0x3a4163);MailInteractionEvents['on'](_0x3edbda,_0x1c86a0);}}; \ No newline at end of file +var _0xbe28=['removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x2fdd15,_0x3de3b1){var _0x57d76c=function(_0x1878b9){while(--_0x1878b9){_0x2fdd15['push'](_0x2fdd15['shift']());}};_0x57d76c(++_0x3de3b1);}(_0xbe28,0x183));var _0x8be2=function(_0x318343,_0x3a3366){_0x318343=_0x318343-0x0;var _0x237a97=_0xbe28[_0x318343];return _0x237a97;};'use strict';var MailInteractionEvents=require(_0x8be2('0x0'));var events=[_0x8be2('0x1'),_0x8be2('0x2'),_0x8be2('0x3')];function createListener(_0x267bef,_0x255b29){return function(_0x691d2e){_0x255b29[_0x8be2('0x4')](_0x267bef,_0x691d2e);};}function removeListener(_0x439cc3,_0x47e4eb){return function(){MailInteractionEvents[_0x8be2('0x5')](_0x439cc3,_0x47e4eb);};}exports[_0x8be2('0x6')]=function(_0x3d46f1){for(var _0x417ccb=0x0,_0x4592d9=events['length'];_0x417ccb<_0x4592d9;_0x417ccb++){var _0x154f86=events[_0x417ccb];var _0x4eb03e=createListener(_0x8be2('0x7')+_0x154f86,_0x3d46f1);MailInteractionEvents['on'](_0x154f86,_0x4eb03e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index ba99a3b..7d67d95 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 _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x36d6af,_0x5b3cea){var _0x457c40=function(_0xa1bb63){while(--_0xa1bb63){_0x36d6af['push'](_0x36d6af['shift']());}};_0x457c40(++_0x5b3cea);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2613f0,_0xcbb41c){_0x2613f0=_0x2613f0-0x0;var _0x47acc3=_0xec56[_0x2613f0];return _0x47acc3;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'mailmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file +var _0x883e=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util'];(function(_0x212c20,_0x2d9956){var _0x481711=function(_0x2f277b){while(--_0x2f277b){_0x212c20['push'](_0x212c20['shift']());}};_0x481711(++_0x2d9956);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe883('0x0'));var util=require(_0xe883('0x1'));var path=require(_0xe883('0x2'));var timeout=require('connect-timeout');var express=require(_0xe883('0x3'));var router=express[_0xe883('0x4')]();var fs_extra=require(_0xe883('0x5'));var auth=require(_0xe883('0x6'));var interaction=require(_0xe883('0x7'));var config=require('../../config/environment');var controller=require(_0xe883('0x8'));router['get']('/',auth[_0xe883('0x9')](),controller[_0xe883('0xa')]);router[_0xe883('0xb')](_0xe883('0xc'),auth[_0xe883('0x9')](),controller[_0xe883('0xd')]);router['get'](_0xe883('0xe'),auth[_0xe883('0x9')](),controller[_0xe883('0xf')]);router[_0xe883('0xb')](_0xe883('0x10'),auth[_0xe883('0x9')](),controller[_0xe883('0x11')]);router[_0xe883('0x12')]('/',auth[_0xe883('0x9')](),interaction[_0xe883('0x13')]('mail',_0xe883('0x14')),controller[_0xe883('0x15')]);router[_0xe883('0x16')](_0xe883('0xe'),auth[_0xe883('0x9')](),controller[_0xe883('0x17')]);router[_0xe883('0x16')](_0xe883('0x18'),auth[_0xe883('0x9')](),controller[_0xe883('0x19')]);router[_0xe883('0x16')](_0xe883('0x1a'),auth['isAuthenticated'](),controller[_0xe883('0x1b')]);router[_0xe883('0x1c')](_0xe883('0xe'),auth[_0xe883('0x9')](),controller['destroy']);module[_0xe883('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index aba95be..d371c5f 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 _0x9390=['out','STRING','long','DATE','BOOLEAN','Email','Chat','sequelize','exports','TEXT','medium','ENUM'];(function(_0x560ef3,_0x2f393f){var _0x333787=function(_0x55a4ae){while(--_0x55a4ae){_0x560ef3['push'](_0x560ef3['shift']());}};_0x333787(++_0x2f393f);}(_0x9390,0xc7));var _0x0939=function(_0x321d5d,_0x52fc02){_0x321d5d=_0x321d5d-0x0;var _0x17d764=_0x9390[_0x321d5d];return _0x17d764;};'use strict';var Sequelize=require(_0x0939('0x0'));var _=require('lodash');module[_0x0939('0x1')]={'body':{'type':Sequelize[_0x0939('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0939('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0939('0x4')]('in',_0x0939('0x5')),'defaultValue':_0x0939('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x0939('0x6')]},'to':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'cc':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'bcc':{'type':Sequelize[_0x0939('0x2')](_0x0939('0x7'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x0939('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0939('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0939('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x0939('0x7'))},'originCc':{'type':Sequelize[_0x0939('0x2')]('long')},'originChannel':{'type':Sequelize[_0x0939('0x4')](_0x0939('0xa'),_0x0939('0xb')),'defaultValue':_0x0939('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xe5a4=['exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat'];(function(_0x4ad223,_0x5e2566){var _0x11267c=function(_0x26a5f5){while(--_0x26a5f5){_0x4ad223['push'](_0x4ad223['shift']());}};_0x11267c(++_0x5e2566);}(_0xe5a4,0xd8));var _0x4e5a=function(_0x3c24a8,_0x39442e){_0x3c24a8=_0x3c24a8-0x0;var _0x195e05=_0xe5a4[_0x3c24a8];return _0x195e05;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x4e5a('0x0')]={'body':{'type':Sequelize['TEXT'](_0x4e5a('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4e5a('0x2')](_0x4e5a('0x3'))},'read':{'type':Sequelize[_0x4e5a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4e5a('0x5')]('in',_0x4e5a('0x6')),'defaultValue':_0x4e5a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4e5a('0x7')]},'to':{'type':Sequelize[_0x4e5a('0x2')](_0x4e5a('0x1'))},'cc':{'type':Sequelize[_0x4e5a('0x2')]('long')},'bcc':{'type':Sequelize[_0x4e5a('0x2')]('long')},'subject':{'type':Sequelize[_0x4e5a('0x2')]},'sentAt':{'type':Sequelize[_0x4e5a('0x8')]},'attach':{'type':Sequelize[_0x4e5a('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4e5a('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x4e5a('0x2')]('long')},'originCc':{'type':Sequelize[_0x4e5a('0x2')](_0x4e5a('0x1'))},'originChannel':{'type':Sequelize['ENUM'](_0x4e5a('0xa'),_0x4e5a('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 72d47c4..9998a31 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 _0x60f7=['fromString','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','build','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../mysqldb','defaults','socket.io-emitter','redis','html-entities','./mailMessage.socket','jayson/promise','http','client','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','json','offset','limit','count','set','Content-Range','update','destroy','status','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','include','findAll','rows','show','params','find','body','catch','describe','create','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','authentication','user','pass','auth','secure','attachments','join','root','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','read','UserId','agent','get','MailInteraction','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','reject','mail','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','sequelize','SELECT','email'];(function(_0x4200c1,_0x3a50a6){var _0x2e44d5=function(_0x21b837){while(--_0x21b837){_0x4200c1['push'](_0x4200c1['shift']());}};_0x2e44d5(++_0x3a50a6);}(_0x60f7,0xbb));var _0x760f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x60f7[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x760f('0x0'));var moment=require(_0x760f('0x1'));var BPromise=require(_0x760f('0x2'));var util=require('util');var path=require(_0x760f('0x3'));var fs=require('fs');var _=require(_0x760f('0x4'));var Redis=require(_0x760f('0x5'));var htmlToText=require(_0x760f('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x760f('0x7'));var interaction_log=require(_0x760f('0x8'))(_0x760f('0x9'));var config=require('../../config/environment');var db=require(_0x760f('0xa'))['db'];config['redis']=_[_0x760f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x760f('0xc'))(new Redis(config[_0x760f('0xd')]));var htmlEntities=require(_0x760f('0xe'));require(_0x760f('0xf'))['register'](socket);var jayson=require(_0x760f('0x10'));var client=jayson['client'][_0x760f('0x11')]({'port':0x232c});var client9003=jayson[_0x760f('0x12')][_0x760f('0x11')]({'port':0x232b});var client9002=jayson[_0x760f('0x12')][_0x760f('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x55c9d0,_0xb7c0b8,_0x32a8fa,_0x155aef){return new BPromise(function(_0x2a0bd5,_0x486eb1){var _0x48e8c2=_0x155aef||client;return _0x48e8c2['request'](_0x55c9d0,_0x32a8fa)[_0x760f('0x13')](function(_0x508319){logger['info'](_0x760f('0x14'),_0xb7c0b8,_0x760f('0x15'));logger[_0x760f('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0xb7c0b8,_0x760f('0x15'),JSON['stringify'](_0x508319));if(_0x508319[_0x760f('0x17')]){if(_0x508319['error'][_0x760f('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xb7c0b8,_0x508319['error'][_0x760f('0x19')]);return _0x486eb1(_0x508319[_0x760f('0x17')][_0x760f('0x19')]);}logger[_0x760f('0x17')](_0x760f('0x14'),_0xb7c0b8,_0x508319[_0x760f('0x17')]['message']);return _0x2a0bd5(_0x508319[_0x760f('0x17')][_0x760f('0x19')]);}else{logger[_0x760f('0x1a')](_0x760f('0x14'),_0xb7c0b8,_0x760f('0x15'));_0x2a0bd5(_0x508319[_0x760f('0x1b')][_0x760f('0x19')]);}})['catch'](function(_0x2eee8b){logger[_0x760f('0x17')]('MailMessage,\x20%s,\x20%s',_0xb7c0b8,_0x2eee8b);_0x486eb1(_0x2eee8b);});});}function respondWithResult(_0x3c4ded,_0x2c3162){_0x2c3162=_0x2c3162||0xc8;return function(_0x445780){if(_0x445780){return _0x3c4ded['status'](_0x2c3162)[_0x760f('0x1c')](_0x445780);}};}function respondWithFilteredResult(_0x1a3f03,_0x331424){return function(_0x58283f){if(_0x58283f){var _0x4ed95b=typeof _0x331424[_0x760f('0x1d')]==='undefined'&&typeof _0x331424[_0x760f('0x1e')]==='undefined';var _0x26723e=_0x58283f[_0x760f('0x1f')];var _0x277a3b=_0x4ed95b?0x0:_0x331424['offset'];var _0xd70361=_0x4ed95b?_0x58283f['count']:_0x331424[_0x760f('0x1d')]+_0x331424['limit'];var _0x595473;if(_0xd70361>=_0x26723e){_0xd70361=_0x26723e;_0x595473=0xc8;}else{_0x595473=0xce;}_0x1a3f03['status'](_0x595473);return _0x1a3f03[_0x760f('0x20')](_0x760f('0x21'),_0x277a3b+'-'+_0xd70361+'/'+_0x26723e)[_0x760f('0x1c')](_0x58283f);}return null;};}function saveUpdates(_0x31af70){return function(_0x5c182e){if(_0x5c182e){return _0x5c182e[_0x760f('0x22')](_0x31af70)[_0x760f('0x13')](function(_0x1aa03a){return _0x1aa03a;});}return null;};}function removeEntity(_0x2f2b1c){return function(_0x121779){if(_0x121779){return _0x121779[_0x760f('0x23')]()[_0x760f('0x13')](function(){_0x2f2b1c[_0x760f('0x24')](0xcc)[_0x760f('0x25')]();});}};}function handleEntityNotFound(_0x257155){return function(_0x4e3136){if(!_0x4e3136){_0x257155[_0x760f('0x26')](0x194);}return _0x4e3136;};}function handleError(_0x2e0e4d,_0x54774c){_0x54774c=_0x54774c||0x1f4;return function(_0x5adf30){logger['error'](_0x5adf30[_0x760f('0x27')]);if(_0x5adf30[_0x760f('0x28')]){delete _0x5adf30[_0x760f('0x28')];}_0x2e0e4d[_0x760f('0x24')](_0x54774c)[_0x760f('0x29')](_0x5adf30);};}exports[_0x760f('0x2a')]=function(_0x5576d7,_0x330b39){var _0x7f2dcb={},_0x4ca4ac={},_0x417c43={'count':0x0,'rows':[]};var _0x352ef9=_[_0x760f('0x2b')](db['MailMessage'][_0x760f('0x2c')],function(_0x1f1a31){return{'name':_0x1f1a31[_0x760f('0x2d')],'type':_0x1f1a31[_0x760f('0x2e')][_0x760f('0x2f')]};});_0x4ca4ac[_0x760f('0x30')]=_[_0x760f('0x2b')](_0x352ef9,_0x760f('0x28'));_0x4ca4ac[_0x760f('0x31')]=_[_0x760f('0x32')](_0x5576d7['query']);_0x4ca4ac[_0x760f('0x33')]=_['intersection'](_0x4ca4ac[_0x760f('0x30')],_0x4ca4ac[_0x760f('0x31')]);_0x7f2dcb[_0x760f('0x34')]=_[_0x760f('0x35')](_0x4ca4ac['model'],qs['fields'](_0x5576d7[_0x760f('0x31')][_0x760f('0x36')]));_0x7f2dcb['attributes']=_0x7f2dcb['attributes'][_0x760f('0x37')]?_0x7f2dcb['attributes']:_0x4ca4ac[_0x760f('0x30')];if(!_0x5576d7['query'][_0x760f('0x38')](_0x760f('0x39'))){_0x7f2dcb['limit']=qs['limit'](_0x5576d7['query'][_0x760f('0x1e')]);_0x7f2dcb[_0x760f('0x1d')]=qs[_0x760f('0x1d')](_0x5576d7['query'][_0x760f('0x1d')]);}_0x7f2dcb['order']=qs[_0x760f('0x3a')](_0x5576d7['query'][_0x760f('0x3a')]);_0x7f2dcb[_0x760f('0x3b')]=qs[_0x760f('0x33')](_[_0x760f('0x3c')](_0x5576d7[_0x760f('0x31')],_0x4ca4ac['filters']),_0x352ef9);if(_0x5576d7[_0x760f('0x31')][_0x760f('0x3d')]){_0x7f2dcb['where']=_[_0x760f('0x3e')](_0x7f2dcb[_0x760f('0x3b')],{'$or':_[_0x760f('0x2b')](_0x352ef9,function(_0x362b22){if(_0x362b22[_0x760f('0x2e')]!==_0x760f('0x3f')){var _0x1b32d6={};_0x1b32d6[_0x362b22[_0x760f('0x28')]]={'$like':'%'+_0x5576d7[_0x760f('0x31')][_0x760f('0x3d')]+'%'};return _0x1b32d6;}})});}_0x7f2dcb=_[_0x760f('0x3e')]({},_0x7f2dcb,_0x5576d7[_0x760f('0x40')]);var _0x2ee8d5={'where':_0x7f2dcb[_0x760f('0x3b')]};return db[_0x760f('0x41')][_0x760f('0x1f')](_0x2ee8d5)['then'](function(_0x333269){_0x417c43[_0x760f('0x1f')]=_0x333269;if(_0x5576d7[_0x760f('0x31')][_0x760f('0x42')]){_0x7f2dcb[_0x760f('0x43')]=[{'all':!![]}];}return db[_0x760f('0x41')][_0x760f('0x44')](_0x7f2dcb);})[_0x760f('0x13')](function(_0x26b4a4){_0x417c43[_0x760f('0x45')]=_0x26b4a4;return _0x417c43;})[_0x760f('0x13')](respondWithFilteredResult(_0x330b39,_0x7f2dcb))['catch'](handleError(_0x330b39,null));};exports[_0x760f('0x46')]=function(_0x2a0c80,_0x237603){var _0x4d5c44={'raw':!![],'where':{'id':_0x2a0c80[_0x760f('0x47')]['id']}},_0x155c07={};_0x155c07[_0x760f('0x30')]=_[_0x760f('0x32')](db['MailMessage'][_0x760f('0x2c')]);_0x155c07[_0x760f('0x31')]=_[_0x760f('0x32')](_0x2a0c80[_0x760f('0x31')]);_0x155c07[_0x760f('0x33')]=_[_0x760f('0x35')](_0x155c07[_0x760f('0x30')],_0x155c07[_0x760f('0x31')]);_0x4d5c44['attributes']=_[_0x760f('0x35')](_0x155c07[_0x760f('0x30')],qs[_0x760f('0x36')](_0x2a0c80[_0x760f('0x31')][_0x760f('0x36')]));_0x4d5c44['attributes']=_0x4d5c44[_0x760f('0x34')][_0x760f('0x37')]?_0x4d5c44[_0x760f('0x34')]:_0x155c07['model'];if(_0x2a0c80[_0x760f('0x31')]['includeAll']){_0x4d5c44[_0x760f('0x43')]=[{'all':!![]}];}_0x4d5c44=_[_0x760f('0x3e')]({},_0x4d5c44,_0x2a0c80[_0x760f('0x40')]);return db[_0x760f('0x41')][_0x760f('0x48')](_0x4d5c44)[_0x760f('0x13')](handleEntityNotFound(_0x237603,null))[_0x760f('0x13')](respondWithResult(_0x237603,null))['catch'](handleError(_0x237603,null));};exports['update']=function(_0x2e092e,_0x32a3e9){if(_0x2e092e[_0x760f('0x49')]['id']){delete _0x2e092e['body']['id'];}return db['MailMessage'][_0x760f('0x48')]({'where':{'id':_0x2e092e[_0x760f('0x47')]['id']}})[_0x760f('0x13')](handleEntityNotFound(_0x32a3e9,null))[_0x760f('0x13')](saveUpdates(_0x2e092e[_0x760f('0x49')],null))[_0x760f('0x13')](respondWithResult(_0x32a3e9,null))[_0x760f('0x4a')](handleError(_0x32a3e9,null));};exports['destroy']=function(_0x3a2540,_0x46269e){return db[_0x760f('0x41')]['find']({'where':{'id':_0x3a2540[_0x760f('0x47')]['id']}})[_0x760f('0x13')](handleEntityNotFound(_0x46269e,null))[_0x760f('0x13')](removeEntity(_0x46269e,null))['catch'](handleError(_0x46269e,null));};exports[_0x760f('0x4b')]=function(_0x187809,_0x3fe52a){return db[_0x760f('0x41')][_0x760f('0x4b')]()[_0x760f('0x13')](respondWithResult(_0x3fe52a,null))['catch'](handleError(_0x3fe52a,null));};exports[_0x760f('0x4c')]=function(_0x541929,_0x482e0c){return db['MailMessage'][_0x760f('0x4c')](_0x541929[_0x760f('0x49')])[_0x760f('0x13')](function(_0x3a9f24){if(_0x3a9f24){if(_0x3a9f24['direction']==='out'&&!_0x3a9f24[_0x760f('0x4d')]){var _0x3d0936,_0x446d88,_0x568c66;if(_0x541929[_0x760f('0x49')]['to']){_0x446d88=_0x541929['body']['to'][_0x760f('0x4e')](',')[0x0];}return db['MailAccount'][_0x760f('0x4f')]({'where':{'id':_0x3a9f24[_0x760f('0x50')]},'include':[{'model':db[_0x760f('0x51')],'as':'List','include':[{'model':db[_0x760f('0x52')],'as':_0x760f('0x53'),'where':{'email':_0x446d88},'limit':0x1,'order':[['updatedAt',_0x760f('0x54')]]}]},{'model':db[_0x760f('0x55')],'as':_0x760f('0x56'),'raw':!![]}]})[_0x760f('0x13')](function(_0x509397){_0x3d0936=_0x509397;if(_0x3d0936&&_0x3d0936['Smtp']){var _0x3a4d51={'tls':{'rejectUnauthorized':![]}};if(_[_0x760f('0x57')](_0x3d0936[_0x760f('0x56')][_0x760f('0x58')])){_0x3a4d51[_0x760f('0x59')]=_0x3d0936['Smtp'][_0x760f('0x59')];_0x3a4d51[_0x760f('0x5a')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x5a')];_0x3a4d51['secure']=_0x3d0936[_0x760f('0x56')]['secure'];if(_0x3d0936[_0x760f('0x56')][_0x760f('0x5b')]){_0x3a4d51['auth']={'user':_0x3d0936[_0x760f('0x56')][_0x760f('0x5c')],'pass':_0x3d0936['Smtp'][_0x760f('0x5d')]};}}else{_0x3a4d51[_0x760f('0x58')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x58')];_0x3a4d51[_0x760f('0x5e')]={'user':_0x3d0936[_0x760f('0x56')][_0x760f('0x5c')],'pass':_0x3d0936['Smtp'][_0x760f('0x5d')]};_0x3a4d51[_0x760f('0x5f')]=_0x3d0936[_0x760f('0x56')][_0x760f('0x5f')];}if(_0x541929[_0x760f('0x49')][_0x760f('0x60')]&&_0x541929['body'][_0x760f('0x60')]['length']){for(var _0x32088e=0x0;_0x32088e<_0x541929[_0x760f('0x49')][_0x760f('0x60')][_0x760f('0x37')];_0x32088e+=0x1){_0x541929[_0x760f('0x49')]['attachments'][_0x32088e]={'filename':_0x541929[_0x760f('0x49')]['attachments'][_0x32088e][_0x760f('0x28')],'path':path[_0x760f('0x61')](config[_0x760f('0x62')],_0x760f('0x63'),_0x541929['body'][_0x760f('0x60')][_0x32088e][_0x760f('0x64')])};}}_0x568c66={'account':_0x3a4d51,'message':_0x541929[_0x760f('0x49')]};return;}})[_0x760f('0x13')](function(){if(_0x3d0936[_0x760f('0x65')]){if(_0x3d0936[_0x760f('0x65')][_0x760f('0x53')]['length']){return _0x3d0936[_0x760f('0x65')]['Contacts'][0x0];}else{return db[_0x760f('0x52')]['create'](_['defaults'](_0x541929[_0x760f('0x49')],{'firstName':_0x541929[_0x760f('0x49')]['to'],'email':_0x541929['body']['to'],'phone':_0x541929['body']['to'],'ListId':_0x3d0936['ListId']}));}}else{throw new Error(_0x760f('0x66'));}})[_0x760f('0x13')](function(){if(_0x568c66){return respondWithRpcPromise(_0x760f('0x67'),_0x760f('0x68'),_0x568c66,client9003)[_0x760f('0x13')](function(_0x543710){return _0x3a9f24[_0x760f('0x22')]({'read':!![],'messageId':_0x543710[_0x760f('0x69')],'sentAt':moment()[_0x760f('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x760f('0x4a')](function(_0x42ad1b){logger['error']('%s',JSON[_0x760f('0x6b')](_0x42ad1b));return _0x3a9f24;});}return _0x3a9f24;});}return _0x3a9f24;}})['then'](respondWithResult(_0x482e0c,0xc9))[_0x760f('0x4a')](handleError(_0x482e0c,null));};exports[_0x760f('0x6c')]=function(_0x5e6181,_0x1c4c91){var _0xf3ec99={'agent':{},'channel':'mail'};if(_0x5e6181[_0x760f('0x49')]['id']){delete _0x5e6181[_0x760f('0x49')]['id'];}_0x5e6181[_0x760f('0x49')][_0x760f('0x6d')]=!![];_0x5e6181[_0x760f('0x49')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')]=_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')]||_0x5e6181['user']['id'];_0xf3ec99[_0x760f('0x6f')]['id']=_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')];return db[_0x760f('0x41')][_0x760f('0x48')]({'where':{'id':_0x5e6181[_0x760f('0x47')]['id'],'UserId':null}})[_0x760f('0x13')](handleEntityNotFound(_0x1c4c91,null))['then'](saveUpdates(_0x5e6181[_0x760f('0x49')],null))[_0x760f('0x13')](function(_0x59c274){if(_0x59c274){_0xf3ec99[_0x760f('0x19')]=_0x59c274[_0x760f('0x70')]({'plain':!![]});return db[_0x760f('0x71')][_0x760f('0x48')]({'where':{'id':_0x59c274[_0x760f('0x72')]}});}return null;})[_0x760f('0x13')](handleEntityNotFound(_0x1c4c91,null))[_0x760f('0x13')](function(_0x4354de){if(_0x4354de){return _0x4354de[_0x760f('0x22')]({'UserId':_0x5e6181['body'][_0x760f('0x6e')],'read1stAt':_[_0x760f('0x57')](_0x4354de['read1stAt'])?moment()[_0x760f('0x6a')](_0x760f('0x73')):undefined});}return null;})[_0x760f('0x13')](function(_0x5f4c7f){if(_0x5f4c7f){_0xf3ec99['interaction']=_0x5f4c7f['get']({'plain':!![]});interaction_log[_0x760f('0x1a')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e6181[_0x760f('0x5c')]['id'],_0x5e6181[_0x760f('0x5c')][_0x760f('0x28')],_0x5e6181[_0x760f('0x5c')]['role'],_0xf3ec99['interaction']['id'],_0x5e6181[_0x760f('0x49')]?JSON[_0x760f('0x6b')](_0x5e6181[_0x760f('0x49')]):_0x760f('0x74'));return respondWithRpcPromise(_0x760f('0x75'),_0x760f('0x76'),_0xf3ec99);}return null;})['then'](function(_0x6419dc){var _0x43bcce=_0x760f('0x77')+_0x6419dc[_0x760f('0x19')]['ContactId'];return db['sequelize'][_0x760f('0x31')](_0x43bcce,{'type':db[_0x760f('0x78')][_0x760f('0x79')]['SELECT'],'raw':!![]})[_0x760f('0x13')](function(_0x15126d){return _0x15126d;});})[_0x760f('0x13')](function(_0x55b77e){if(_0x55b77e){_0xf3ec99[_0x760f('0x19')][_0x760f('0x7a')]=_0x55b77e[0x0];if(!_0x5e6181[_0x760f('0x49')]['UserId'])return;return db[_0x760f('0x7b')][_0x760f('0x48')]({'where':{'id':_0x5e6181[_0x760f('0x49')][_0x760f('0x6e')],'role':_0x760f('0x6f')},'attributes':['id','name',_0x760f('0x7c'),'email',_0x760f('0x7d')],'raw':!![]});}return null;})[_0x760f('0x13')](function(_0x56673f){if(!_0x56673f)return null;_0xf3ec99[_0x760f('0x19')][_0x760f('0x6f')]=_0x56673f;return _0xf3ec99;})['then'](function(_0x18ebc9){if(_0x18ebc9){if(_0x5e6181['body'][_0x760f('0x7e')]){_0xf3ec99[_0x760f('0x19')][_0x760f('0x7f')]=util['format'](_0x760f('0x80'),_0x5e6181[_0x760f('0x5c')][_0x760f('0x28')]);_0xf3ec99[_0x760f('0x19')]['channel']=_0xf3ec99['channel'];_0xf3ec99[_0x760f('0x19')][_0x760f('0x81')]=_0xf3ec99[_0x760f('0x82')];_0xf3ec99['message']['event']=_0x760f('0x6c');_0xf3ec99[_0x760f('0x19')][_0x760f('0x49')]=htmlToText['fromString'](_0xf3ec99['message'][_0x760f('0x49')]);return respondWithRpcPromise(_0x760f('0x83'),_0x760f('0x83'),{'event':_0x760f('0x84'),'message':_0xf3ec99['message']},client9002)[_0x760f('0x13')](function(){return _0xf3ec99;});}return _0xf3ec99;}return null;})[_0x760f('0x13')](respondWithResult(_0x1c4c91,null))[_0x760f('0x4a')](handleError(_0x1c4c91,null));};exports[_0x760f('0x85')]=function(_0x21ee6e,_0x2cbf9b){var _0x4ff2d8={'agent':{},'channel':_0x760f('0x86')};if(_0x21ee6e[_0x760f('0x49')]['id']){delete _0x21ee6e[_0x760f('0x49')]['id'];}_0x21ee6e['body'][_0x760f('0x6e')]=_0x21ee6e['body'][_0x760f('0x6e')]||_0x21ee6e[_0x760f('0x5c')]['id'];_0x4ff2d8[_0x760f('0x6f')]['id']=_0x21ee6e['body']['UserId'];return db[_0x760f('0x41')]['find']({'where':{'id':_0x21ee6e[_0x760f('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2cbf9b,null))[_0x760f('0x13')](function(_0x21fbe7){if(_0x21fbe7){_0x4ff2d8[_0x760f('0x19')]=_0x21fbe7['get']({'plain':!![]});return db['MailInteraction'][_0x760f('0x48')]({'where':{'id':_0x21fbe7[_0x760f('0x72')]}});}return null;})[_0x760f('0x13')](handleEntityNotFound(_0x2cbf9b,null))[_0x760f('0x13')](function(_0x559b67){if(_0x559b67){_0x4ff2d8[_0x760f('0x87')]=_0x559b67[_0x760f('0x70')]({'plain':!![]});interaction_log['info'](_0x760f('0x88'),_0x21ee6e[_0x760f('0x5c')]['id'],_0x21ee6e[_0x760f('0x5c')][_0x760f('0x28')],_0x21ee6e[_0x760f('0x5c')][_0x760f('0x89')],_0x4ff2d8['interaction']['id'],_0x21ee6e['body']?JSON[_0x760f('0x6b')](_0x21ee6e[_0x760f('0x49')]):'null');return respondWithRpcPromise('RejectMessage',_0x760f('0x8a'),_0x4ff2d8);}return null;})[_0x760f('0x13')](function(_0x16f17f){var _0x171e48='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x16f17f[_0x760f('0x19')][_0x760f('0x8b')];return db[_0x760f('0x8c')][_0x760f('0x31')](_0x171e48,{'type':db[_0x760f('0x78')]['QueryTypes'][_0x760f('0x8d')],'raw':!![]})[_0x760f('0x13')](function(_0x46aeb6){return _0x46aeb6;});})[_0x760f('0x13')](function(_0x26f5f6){if(_0x26f5f6){_0x4ff2d8['message'][_0x760f('0x7a')]=_0x26f5f6[0x0];if(!_0x21ee6e[_0x760f('0x49')]['UserId'])return;return db[_0x760f('0x7b')]['find']({'where':{'id':_0x21ee6e[_0x760f('0x49')]['UserId'],'role':'agent'},'attributes':['id',_0x760f('0x28'),'fullname',_0x760f('0x8e'),_0x760f('0x7d')],'raw':!![]});}return null;})['then'](function(_0x137dbe){if(!_0x137dbe)return null;_0x4ff2d8[_0x760f('0x19')][_0x760f('0x6f')]=_0x137dbe;return _0x4ff2d8;})[_0x760f('0x13')](function(_0x2c696a){if(_0x2c696a){_0x2c696a[_0x760f('0x19')]['interface']=util[_0x760f('0x6a')](_0x760f('0x80'),_0x21ee6e['user'][_0x760f('0x28')]);_0x2c696a[_0x760f('0x19')][_0x760f('0x82')]=_0x4ff2d8[_0x760f('0x82')];_0x2c696a[_0x760f('0x19')][_0x760f('0x81')]=_0x4ff2d8[_0x760f('0x82')];_0x2c696a[_0x760f('0x19')]['event']=_0x760f('0x85');_0x2c696a['message'][_0x760f('0x49')]=htmlToText[_0x760f('0x8f')](_0x4ff2d8[_0x760f('0x19')][_0x760f('0x49')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0x760f('0x90'),'message':_0x2c696a['message']},client9002);return _0x4ff2d8;}return null;})[_0x760f('0x13')](respondWithResult(_0x2cbf9b,null))[_0x760f('0x4a')](handleError(_0x2cbf9b,null));};exports['download']=function(_0x254587,_0x160e9b){var _0x4bfc62=moment()[_0x760f('0x91')]()[_0x760f('0x92')]();var _0x5e5720=path['join'](config[_0x760f('0x62')],_0x760f('0x93'),_0x760f('0x94'),_0x760f('0x95'));var _0x18fd74=path['join'](config[_0x760f('0x62')],_0x760f('0x93'),'files',_0x760f('0x60'));var _0x451577=util['format'](_0x760f('0x96'),_0x4bfc62);return db[_0x760f('0x41')][_0x760f('0x48')]({'where':{'id':_0x254587['params']['id']},'attributes':['id',_0x760f('0x49'),_0x760f('0x97'),'to','cc',_0x760f('0x98'),_0x760f('0x99'),_0x760f('0x9a')],'include':_0x254587[_0x760f('0x31')][_0x760f('0x60')]?[{'model':db[_0x760f('0x9b')],'as':_0x760f('0x9c')}]:undefined})[_0x760f('0x13')](handleEntityNotFound(_0x160e9b,null))['then'](function(_0x271082){if(_0x271082){var _0x3824d9=_0x271082;var _0x3e4c47={'from':_0x3824d9[_0x760f('0x97')],'to':_0x3824d9['to'],'subject':_0x3824d9[_0x760f('0x99')],'html':htmlEntities[_0x760f('0x9d')](_0x3824d9[_0x760f('0x49')]),'headers':{'Date':moment(_0x3824d9[_0x760f('0x9a')])['format'](_0x760f('0x9e'))},'attachments':[]};if(_0x271082['cc']){_0x3e4c47[_0x760f('0x9f')]['Cc']=_0x271082['cc'];}if(_0x271082[_0x760f('0x98')]){_0x3e4c47[_0x760f('0x9f')]['Bcc']=_0x271082[_0x760f('0x98')];}return new BPromise(function(_0xad8960,_0x3d81fa){if(_0x271082[_0x760f('0x9c')]){for(var _0x22843d=0x0;_0x22843d<_0x271082[_0x760f('0x9c')][_0x760f('0x37')];_0x22843d++){var _0x1f1ec6=_0x271082[_0x760f('0x9c')][_0x22843d];var _0x1c2dc8=path[_0x760f('0x61')](_0x18fd74,_0x1f1ec6[_0x760f('0x64')]);if(fs['existsSync'](_0x1c2dc8)){_0x3e4c47[_0x760f('0x60')][_0x760f('0xa0')]({'name':_0x1f1ec6[_0x760f('0x28')],'contentType':_0x1f1ec6[_0x760f('0x2e')],'data':fs[_0x760f('0xa1')](_0x1c2dc8)});}}}emlformat[_0x760f('0xa2')](_0x3e4c47,function(_0x8464a1,_0x5cd180){if(_0x8464a1)return _0x3d81fa(_0x8464a1);fs['writeFileSync'](path[_0x760f('0x61')](_0x5e5720,_0x451577),_0x5cd180);return _0xad8960(_0x5cd180);});});}})[_0x760f('0x13')](function(_0x4f16df){if(_0x4f16df){return _0x160e9b[_0x760f('0xa3')](path[_0x760f('0x61')](_0x5e5720,_0x451577),_0x451577,function(_0x57a4d3){if(!_0x57a4d3)fs[_0x760f('0xa4')](path['join'](_0x5e5720,_0x451577));});}})['catch'](handleError(_0x160e9b,null));}; \ No newline at end of file +var _0xad04=['existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','redis','register','jayson/promise','client','http','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','end','stack','name','send','MailMessage','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','show','keys','find','body','destroy','params','describe','create','direction','out','split','MailAccount','CmList','List','CmContact','Contacts','updatedAt','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','join','root','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','fullname','interface','rejectmessage','unix','toString','server','files','from','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xad04,0xa7));var _0x4ad0=function(_0x15a8c4,_0x1b9cfd){_0x15a8c4=_0x15a8c4-0x0;var _0x32bd=_0xad04[_0x15a8c4];return _0x32bd;};'use strict';var emlformat=require(_0x4ad0('0x0'));var moment=require(_0x4ad0('0x1'));var BPromise=require(_0x4ad0('0x2'));var util=require(_0x4ad0('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x4ad0('0x4'));var Redis=require(_0x4ad0('0x5'));var htmlToText=require(_0x4ad0('0x6'));var qs=require(_0x4ad0('0x7'));var logger=require(_0x4ad0('0x8'))(_0x4ad0('0x9'));var interaction_log=require(_0x4ad0('0x8'))('mail-interactions');var config=require(_0x4ad0('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4ad0('0xb')](config['redis'],{'host':_0x4ad0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ad0('0xd')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x4ad0('0xe')](socket);var jayson=require(_0x4ad0('0xf'));var client=jayson[_0x4ad0('0x10')]['http']({'port':0x232c});var client9003=jayson[_0x4ad0('0x10')][_0x4ad0('0x11')]({'port':0x232b});var client9002=jayson[_0x4ad0('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5ec4,_0x2dab57,_0x5217b0,_0x3d3ae8){return new BPromise(function(_0x2fd1f8,_0x35a7dc){var _0x2e842e=_0x3d3ae8||client;return _0x2e842e['request'](_0x5c5ec4,_0x5217b0)[_0x4ad0('0x12')](function(_0x43c791){logger['info']('MailMessage,\x20%s,\x20%s',_0x2dab57,'request\x20sent');logger[_0x4ad0('0x13')](_0x4ad0('0x14'),_0x2dab57,_0x4ad0('0x15'),JSON[_0x4ad0('0x16')](_0x43c791));if(_0x43c791[_0x4ad0('0x17')]){if(_0x43c791[_0x4ad0('0x17')]['code']===0x1f4){logger[_0x4ad0('0x17')](_0x4ad0('0x18'),_0x2dab57,_0x43c791['error'][_0x4ad0('0x19')]);return _0x35a7dc(_0x43c791[_0x4ad0('0x17')]['message']);}logger[_0x4ad0('0x17')]('MailMessage,\x20%s,\x20%s',_0x2dab57,_0x43c791[_0x4ad0('0x17')][_0x4ad0('0x19')]);return _0x2fd1f8(_0x43c791[_0x4ad0('0x17')][_0x4ad0('0x19')]);}else{logger['info'](_0x4ad0('0x18'),_0x2dab57,_0x4ad0('0x15'));_0x2fd1f8(_0x43c791[_0x4ad0('0x1a')][_0x4ad0('0x19')]);}})[_0x4ad0('0x1b')](function(_0x590e63){logger[_0x4ad0('0x17')](_0x4ad0('0x18'),_0x2dab57,_0x590e63);_0x35a7dc(_0x590e63);});});}function respondWithResult(_0x2402eb,_0x461d3d){_0x461d3d=_0x461d3d||0xc8;return function(_0x4b7ef1){if(_0x4b7ef1){return _0x2402eb[_0x4ad0('0x1c')](_0x461d3d)[_0x4ad0('0x1d')](_0x4b7ef1);}};}function respondWithFilteredResult(_0x61a52d,_0x513b8c){return function(_0x1cc9e5){if(_0x1cc9e5){var _0x3256cd=typeof _0x513b8c[_0x4ad0('0x1e')]==='undefined'&&typeof _0x513b8c[_0x4ad0('0x1f')]===_0x4ad0('0x20');var _0x8c7bf6=_0x1cc9e5['count'];var _0x59ae6a=_0x3256cd?0x0:_0x513b8c[_0x4ad0('0x1e')];var _0x673bee=_0x3256cd?_0x1cc9e5[_0x4ad0('0x21')]:_0x513b8c[_0x4ad0('0x1e')]+_0x513b8c['limit'];var _0x50ec99;if(_0x673bee>=_0x8c7bf6){_0x673bee=_0x8c7bf6;_0x50ec99=0xc8;}else{_0x50ec99=0xce;}_0x61a52d[_0x4ad0('0x1c')](_0x50ec99);return _0x61a52d[_0x4ad0('0x22')](_0x4ad0('0x23'),_0x59ae6a+'-'+_0x673bee+'/'+_0x8c7bf6)[_0x4ad0('0x1d')](_0x1cc9e5);}return null;};}function saveUpdates(_0x44687c){return function(_0x37f695){if(_0x37f695){return _0x37f695[_0x4ad0('0x24')](_0x44687c)[_0x4ad0('0x12')](function(_0x2ed57a){return _0x2ed57a;});}return null;};}function removeEntity(_0x1a1c21){return function(_0x113785){if(_0x113785){return _0x113785['destroy']()['then'](function(){_0x1a1c21[_0x4ad0('0x1c')](0xcc)[_0x4ad0('0x25')]();});}};}function handleEntityNotFound(_0x2e3383){return function(_0x45c6f1){if(!_0x45c6f1){_0x2e3383['sendStatus'](0x194);}return _0x45c6f1;};}function handleError(_0x22ee13,_0x172a0c){_0x172a0c=_0x172a0c||0x1f4;return function(_0x50ea68){logger[_0x4ad0('0x17')](_0x50ea68[_0x4ad0('0x26')]);if(_0x50ea68['name']){delete _0x50ea68[_0x4ad0('0x27')];}_0x22ee13[_0x4ad0('0x1c')](_0x172a0c)[_0x4ad0('0x28')](_0x50ea68);};}exports['index']=function(_0x3e2560,_0x230058){var _0x4901d1={},_0x1cecc9={},_0x547c44={'count':0x0,'rows':[]};var _0x37a1cf=_['map'](db[_0x4ad0('0x29')][_0x4ad0('0x2a')],function(_0x4e89f2){return{'name':_0x4e89f2[_0x4ad0('0x2b')],'type':_0x4e89f2[_0x4ad0('0x2c')]['key']};});_0x1cecc9[_0x4ad0('0x2d')]=_['map'](_0x37a1cf,_0x4ad0('0x27'));_0x1cecc9[_0x4ad0('0x2e')]=_['keys'](_0x3e2560[_0x4ad0('0x2e')]);_0x1cecc9[_0x4ad0('0x2f')]=_['intersection'](_0x1cecc9['model'],_0x1cecc9[_0x4ad0('0x2e')]);_0x4901d1[_0x4ad0('0x30')]=_[_0x4ad0('0x31')](_0x1cecc9['model'],qs[_0x4ad0('0x32')](_0x3e2560['query']['fields']));_0x4901d1[_0x4ad0('0x30')]=_0x4901d1[_0x4ad0('0x30')][_0x4ad0('0x33')]?_0x4901d1[_0x4ad0('0x30')]:_0x1cecc9[_0x4ad0('0x2d')];if(!_0x3e2560[_0x4ad0('0x2e')][_0x4ad0('0x34')](_0x4ad0('0x35'))){_0x4901d1[_0x4ad0('0x1f')]=qs[_0x4ad0('0x1f')](_0x3e2560[_0x4ad0('0x2e')][_0x4ad0('0x1f')]);_0x4901d1[_0x4ad0('0x1e')]=qs[_0x4ad0('0x1e')](_0x3e2560['query']['offset']);}_0x4901d1['order']=qs[_0x4ad0('0x36')](_0x3e2560[_0x4ad0('0x2e')]['sort']);_0x4901d1[_0x4ad0('0x37')]=qs[_0x4ad0('0x2f')](_['pick'](_0x3e2560[_0x4ad0('0x2e')],_0x1cecc9[_0x4ad0('0x2f')]),_0x37a1cf);if(_0x3e2560['query']['filter']){_0x4901d1[_0x4ad0('0x37')]=_['merge'](_0x4901d1[_0x4ad0('0x37')],{'$or':_['map'](_0x37a1cf,function(_0x46b88a){if(_0x46b88a['type']!==_0x4ad0('0x38')){var _0x577567={};_0x577567[_0x46b88a[_0x4ad0('0x27')]]={'$like':'%'+_0x3e2560[_0x4ad0('0x2e')][_0x4ad0('0x39')]+'%'};return _0x577567;}})});}_0x4901d1=_[_0x4ad0('0x3a')]({},_0x4901d1,_0x3e2560['options']);var _0x3f5dfb={'where':_0x4901d1['where']};return db[_0x4ad0('0x29')][_0x4ad0('0x21')](_0x3f5dfb)['then'](function(_0x13b75f){_0x547c44[_0x4ad0('0x21')]=_0x13b75f;if(_0x3e2560['query'][_0x4ad0('0x3b')]){_0x4901d1[_0x4ad0('0x3c')]=[{'all':!![]}];}return db['MailMessage'][_0x4ad0('0x3d')](_0x4901d1);})['then'](function(_0x5efc39){_0x547c44['rows']=_0x5efc39;return _0x547c44;})[_0x4ad0('0x12')](respondWithFilteredResult(_0x230058,_0x4901d1))['catch'](handleError(_0x230058,null));};exports[_0x4ad0('0x3e')]=function(_0x2e80ca,_0x411211){var _0x522338={'raw':!![],'where':{'id':_0x2e80ca['params']['id']}},_0x2960b8={};_0x2960b8[_0x4ad0('0x2d')]=_[_0x4ad0('0x3f')](db['MailMessage'][_0x4ad0('0x2a')]);_0x2960b8[_0x4ad0('0x2e')]=_['keys'](_0x2e80ca['query']);_0x2960b8[_0x4ad0('0x2f')]=_['intersection'](_0x2960b8[_0x4ad0('0x2d')],_0x2960b8['query']);_0x522338['attributes']=_[_0x4ad0('0x31')](_0x2960b8[_0x4ad0('0x2d')],qs['fields'](_0x2e80ca[_0x4ad0('0x2e')][_0x4ad0('0x32')]));_0x522338['attributes']=_0x522338[_0x4ad0('0x30')][_0x4ad0('0x33')]?_0x522338[_0x4ad0('0x30')]:_0x2960b8[_0x4ad0('0x2d')];if(_0x2e80ca[_0x4ad0('0x2e')]['includeAll']){_0x522338[_0x4ad0('0x3c')]=[{'all':!![]}];}_0x522338=_[_0x4ad0('0x3a')]({},_0x522338,_0x2e80ca['options']);return db['MailMessage'][_0x4ad0('0x40')](_0x522338)[_0x4ad0('0x12')](handleEntityNotFound(_0x411211,null))[_0x4ad0('0x12')](respondWithResult(_0x411211,null))[_0x4ad0('0x1b')](handleError(_0x411211,null));};exports[_0x4ad0('0x24')]=function(_0x30d62d,_0x419214){if(_0x30d62d[_0x4ad0('0x41')]['id']){delete _0x30d62d[_0x4ad0('0x41')]['id'];}return db[_0x4ad0('0x29')][_0x4ad0('0x40')]({'where':{'id':_0x30d62d['params']['id']}})[_0x4ad0('0x12')](handleEntityNotFound(_0x419214,null))['then'](saveUpdates(_0x30d62d['body'],null))[_0x4ad0('0x12')](respondWithResult(_0x419214,null))['catch'](handleError(_0x419214,null));};exports[_0x4ad0('0x42')]=function(_0x3d1a70,_0x1993ae){return db[_0x4ad0('0x29')][_0x4ad0('0x40')]({'where':{'id':_0x3d1a70[_0x4ad0('0x43')]['id']}})[_0x4ad0('0x12')](handleEntityNotFound(_0x1993ae,null))[_0x4ad0('0x12')](removeEntity(_0x1993ae,null))[_0x4ad0('0x1b')](handleError(_0x1993ae,null));};exports[_0x4ad0('0x44')]=function(_0x4ca68d,_0x372e7d){return db['MailMessage'][_0x4ad0('0x44')]()['then'](respondWithResult(_0x372e7d,null))[_0x4ad0('0x1b')](handleError(_0x372e7d,null));};exports[_0x4ad0('0x45')]=function(_0x5c162c,_0x2c4966){return db[_0x4ad0('0x29')][_0x4ad0('0x45')](_0x5c162c[_0x4ad0('0x41')])[_0x4ad0('0x12')](function(_0xda58f6){if(_0xda58f6){if(_0xda58f6[_0x4ad0('0x46')]===_0x4ad0('0x47')&&!_0xda58f6['secret']){var _0x34f8cc,_0x51133b,_0x1e8be5;if(_0x5c162c['body']['to']){_0x51133b=_0x5c162c['body']['to'][_0x4ad0('0x48')](',')[0x0];}return db[_0x4ad0('0x49')]['findOne']({'where':{'id':_0xda58f6['MailAccountId']},'include':[{'model':db[_0x4ad0('0x4a')],'as':_0x4ad0('0x4b'),'include':[{'model':db[_0x4ad0('0x4c')],'as':_0x4ad0('0x4d'),'where':{'email':_0x51133b},'limit':0x1,'order':[[_0x4ad0('0x4e'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x4ad0('0x4f'),'raw':!![]}]})[_0x4ad0('0x12')](function(_0x17e059){_0x34f8cc=_0x17e059;if(_0x34f8cc&&_0x34f8cc[_0x4ad0('0x4f')]){var _0x1b0e94={'tls':{'rejectUnauthorized':![]}};if(_[_0x4ad0('0x50')](_0x34f8cc[_0x4ad0('0x4f')]['service'])){_0x1b0e94[_0x4ad0('0x51')]=_0x34f8cc[_0x4ad0('0x4f')][_0x4ad0('0x51')];_0x1b0e94[_0x4ad0('0x52')]=_0x34f8cc[_0x4ad0('0x4f')][_0x4ad0('0x52')];_0x1b0e94[_0x4ad0('0x53')]=_0x34f8cc['Smtp'][_0x4ad0('0x53')];if(_0x34f8cc[_0x4ad0('0x4f')][_0x4ad0('0x54')]){_0x1b0e94[_0x4ad0('0x55')]={'user':_0x34f8cc['Smtp'][_0x4ad0('0x56')],'pass':_0x34f8cc[_0x4ad0('0x4f')]['pass']};}}else{_0x1b0e94[_0x4ad0('0x57')]=_0x34f8cc[_0x4ad0('0x4f')]['service'];_0x1b0e94['auth']={'user':_0x34f8cc[_0x4ad0('0x4f')][_0x4ad0('0x56')],'pass':_0x34f8cc['Smtp'][_0x4ad0('0x58')]};_0x1b0e94[_0x4ad0('0x53')]=_0x34f8cc['Smtp'][_0x4ad0('0x53')];}if(_0x5c162c['body'][_0x4ad0('0x59')]&&_0x5c162c[_0x4ad0('0x41')][_0x4ad0('0x59')][_0x4ad0('0x33')]){for(var _0x5723ae=0x0;_0x5723ae<_0x5c162c[_0x4ad0('0x41')][_0x4ad0('0x59')][_0x4ad0('0x33')];_0x5723ae+=0x1){_0x5c162c[_0x4ad0('0x41')]['attachments'][_0x5723ae]={'filename':_0x5c162c['body'][_0x4ad0('0x59')][_0x5723ae][_0x4ad0('0x27')],'path':path[_0x4ad0('0x5a')](config[_0x4ad0('0x5b')],'server/files/attachments',_0x5c162c[_0x4ad0('0x41')][_0x4ad0('0x59')][_0x5723ae][_0x4ad0('0x5c')])};}}_0x1e8be5={'account':_0x1b0e94,'message':_0x5c162c[_0x4ad0('0x41')]};return;}})['then'](function(){if(_0x34f8cc[_0x4ad0('0x4b')]){if(_0x34f8cc[_0x4ad0('0x4b')][_0x4ad0('0x4d')][_0x4ad0('0x33')]){return _0x34f8cc['List'][_0x4ad0('0x4d')][0x0];}else{return db['CmContact'][_0x4ad0('0x45')](_[_0x4ad0('0xb')](_0x5c162c[_0x4ad0('0x41')],{'firstName':_0x5c162c[_0x4ad0('0x41')]['to'],'email':_0x5c162c[_0x4ad0('0x41')]['to'],'phone':_0x5c162c['body']['to'],'ListId':_0x34f8cc[_0x4ad0('0x5d')]}));}}else{throw new Error(_0x4ad0('0x5e'));}})[_0x4ad0('0x12')](function(){if(_0x1e8be5){return respondWithRpcPromise(_0x4ad0('0x5f'),_0x4ad0('0x60'),_0x1e8be5,client9003)[_0x4ad0('0x12')](function(_0x1d128e){return _0xda58f6[_0x4ad0('0x24')]({'read':!![],'messageId':_0x1d128e[_0x4ad0('0x61')],'sentAt':moment()[_0x4ad0('0x62')](_0x4ad0('0x63'))});})[_0x4ad0('0x1b')](function(_0x3159cb){logger[_0x4ad0('0x17')]('%s',JSON[_0x4ad0('0x16')](_0x3159cb));return _0xda58f6;});}return _0xda58f6;});}return _0xda58f6;}})['then'](respondWithResult(_0x2c4966,0xc9))[_0x4ad0('0x1b')](handleError(_0x2c4966,null));};exports['accept']=function(_0x254896,_0x3f0f48){var _0x511128={'agent':{},'channel':'mail'};if(_0x254896[_0x4ad0('0x41')]['id']){delete _0x254896['body']['id'];}_0x254896[_0x4ad0('0x41')][_0x4ad0('0x64')]=!![];_0x254896[_0x4ad0('0x41')][_0x4ad0('0x65')]=moment()['format'](_0x4ad0('0x63'));_0x254896[_0x4ad0('0x41')][_0x4ad0('0x66')]=_0x254896[_0x4ad0('0x41')]['UserId']||_0x254896[_0x4ad0('0x56')]['id'];_0x511128[_0x4ad0('0x67')]['id']=_0x254896[_0x4ad0('0x41')][_0x4ad0('0x66')];return db[_0x4ad0('0x29')][_0x4ad0('0x40')]({'where':{'id':_0x254896['params']['id'],'UserId':null}})[_0x4ad0('0x12')](handleEntityNotFound(_0x3f0f48,null))['then'](saveUpdates(_0x254896[_0x4ad0('0x41')],null))['then'](function(_0x5ae7eb){if(_0x5ae7eb){_0x511128[_0x4ad0('0x19')]=_0x5ae7eb[_0x4ad0('0x68')]({'plain':!![]});return db[_0x4ad0('0x69')][_0x4ad0('0x40')]({'where':{'id':_0x5ae7eb[_0x4ad0('0x6a')]}});}return null;})[_0x4ad0('0x12')](handleEntityNotFound(_0x3f0f48,null))[_0x4ad0('0x12')](function(_0x3e6546){if(_0x3e6546){return _0x3e6546[_0x4ad0('0x24')]({'UserId':_0x254896[_0x4ad0('0x41')]['UserId'],'read1stAt':_[_0x4ad0('0x50')](_0x3e6546[_0x4ad0('0x6b')])?moment()[_0x4ad0('0x62')](_0x4ad0('0x63')):undefined});}return null;})[_0x4ad0('0x12')](function(_0x57a528){if(_0x57a528){_0x511128['interaction']=_0x57a528['get']({'plain':!![]});interaction_log[_0x4ad0('0x6c')](_0x4ad0('0x6d'),_0x254896[_0x4ad0('0x56')]['id'],_0x254896[_0x4ad0('0x56')][_0x4ad0('0x27')],_0x254896['user'][_0x4ad0('0x6e')],_0x511128[_0x4ad0('0x6f')]['id'],_0x254896['body']?JSON['stringify'](_0x254896['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x511128);}return null;})[_0x4ad0('0x12')](function(_0x4ca6e0){var _0x49b54b=_0x4ad0('0x70')+_0x4ca6e0[_0x4ad0('0x19')]['ContactId'];return db[_0x4ad0('0x71')][_0x4ad0('0x2e')](_0x49b54b,{'type':db[_0x4ad0('0x72')][_0x4ad0('0x73')][_0x4ad0('0x74')],'raw':!![]})[_0x4ad0('0x12')](function(_0x430f77){return _0x430f77;});})['then'](function(_0x11a960){if(_0x11a960){_0x511128[_0x4ad0('0x19')][_0x4ad0('0x75')]=_0x11a960[0x0];if(!_0x254896[_0x4ad0('0x41')][_0x4ad0('0x66')])return;return db[_0x4ad0('0x76')]['find']({'where':{'id':_0x254896[_0x4ad0('0x41')]['UserId'],'role':'agent'},'attributes':['id',_0x4ad0('0x27'),'fullname',_0x4ad0('0x77'),_0x4ad0('0x78')],'raw':!![]});}return null;})['then'](function(_0x1e477f){if(!_0x1e477f)return null;_0x511128[_0x4ad0('0x19')][_0x4ad0('0x67')]=_0x1e477f;return _0x511128;})[_0x4ad0('0x12')](function(_0x4d0dcb){if(_0x4d0dcb){if(_0x254896[_0x4ad0('0x41')][_0x4ad0('0x79')]){_0x511128[_0x4ad0('0x19')]['interface']=util['format'](_0x4ad0('0x7a'),_0x254896[_0x4ad0('0x56')]['name']);_0x511128['message'][_0x4ad0('0x7b')]=_0x511128['channel'];_0x511128['message'][_0x4ad0('0x7c')]=_0x511128[_0x4ad0('0x7b')];_0x511128[_0x4ad0('0x19')][_0x4ad0('0x7d')]=_0x4ad0('0x7e');_0x511128['message'][_0x4ad0('0x41')]=htmlToText[_0x4ad0('0x7f')](_0x511128[_0x4ad0('0x19')]['body']);return respondWithRpcPromise(_0x4ad0('0x80'),_0x4ad0('0x80'),{'event':_0x4ad0('0x81'),'message':_0x511128[_0x4ad0('0x19')]},client9002)[_0x4ad0('0x12')](function(){return _0x511128;});}return _0x511128;}return null;})[_0x4ad0('0x12')](respondWithResult(_0x3f0f48,null))[_0x4ad0('0x1b')](handleError(_0x3f0f48,null));};exports[_0x4ad0('0x82')]=function(_0x5c98b7,_0x51c65b){var _0x5390c2={'agent':{},'channel':_0x4ad0('0x83')};if(_0x5c98b7[_0x4ad0('0x41')]['id']){delete _0x5c98b7[_0x4ad0('0x41')]['id'];}_0x5c98b7[_0x4ad0('0x41')][_0x4ad0('0x66')]=_0x5c98b7[_0x4ad0('0x41')][_0x4ad0('0x66')]||_0x5c98b7[_0x4ad0('0x56')]['id'];_0x5390c2[_0x4ad0('0x67')]['id']=_0x5c98b7[_0x4ad0('0x41')][_0x4ad0('0x66')];return db[_0x4ad0('0x29')][_0x4ad0('0x40')]({'where':{'id':_0x5c98b7[_0x4ad0('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51c65b,null))[_0x4ad0('0x12')](function(_0x1fa8b6){if(_0x1fa8b6){_0x5390c2[_0x4ad0('0x19')]=_0x1fa8b6[_0x4ad0('0x68')]({'plain':!![]});return db[_0x4ad0('0x69')][_0x4ad0('0x40')]({'where':{'id':_0x1fa8b6[_0x4ad0('0x6a')]}});}return null;})[_0x4ad0('0x12')](handleEntityNotFound(_0x51c65b,null))['then'](function(_0x27cd89){if(_0x27cd89){_0x5390c2[_0x4ad0('0x6f')]=_0x27cd89[_0x4ad0('0x68')]({'plain':!![]});interaction_log[_0x4ad0('0x6c')](_0x4ad0('0x84'),_0x5c98b7['user']['id'],_0x5c98b7[_0x4ad0('0x56')][_0x4ad0('0x27')],_0x5c98b7[_0x4ad0('0x56')][_0x4ad0('0x6e')],_0x5390c2[_0x4ad0('0x6f')]['id'],_0x5c98b7['body']?JSON['stringify'](_0x5c98b7[_0x4ad0('0x41')]):_0x4ad0('0x85'));return respondWithRpcPromise(_0x4ad0('0x86'),_0x4ad0('0x87'),_0x5390c2);}return null;})[_0x4ad0('0x12')](function(_0x171e6e){var _0x32768a=_0x4ad0('0x70')+_0x171e6e[_0x4ad0('0x19')][_0x4ad0('0x88')];return db[_0x4ad0('0x71')][_0x4ad0('0x2e')](_0x32768a,{'type':db[_0x4ad0('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x4ad0('0x12')](function(_0x4d02c0){return _0x4d02c0;});})['then'](function(_0xba0a3e){if(_0xba0a3e){_0x5390c2[_0x4ad0('0x19')][_0x4ad0('0x75')]=_0xba0a3e[0x0];if(!_0x5c98b7[_0x4ad0('0x41')][_0x4ad0('0x66')])return;return db[_0x4ad0('0x76')][_0x4ad0('0x40')]({'where':{'id':_0x5c98b7['body'][_0x4ad0('0x66')],'role':'agent'},'attributes':['id',_0x4ad0('0x27'),_0x4ad0('0x89'),_0x4ad0('0x77'),_0x4ad0('0x78')],'raw':!![]});}return null;})['then'](function(_0x28ed1e){if(!_0x28ed1e)return null;_0x5390c2[_0x4ad0('0x19')]['agent']=_0x28ed1e;return _0x5390c2;})[_0x4ad0('0x12')](function(_0x1c8a01){if(_0x1c8a01){_0x1c8a01[_0x4ad0('0x19')][_0x4ad0('0x8a')]=util['format'](_0x4ad0('0x7a'),_0x5c98b7[_0x4ad0('0x56')][_0x4ad0('0x27')]);_0x1c8a01['message']['channel']=_0x5390c2[_0x4ad0('0x7b')];_0x1c8a01['message'][_0x4ad0('0x7c')]=_0x5390c2[_0x4ad0('0x7b')];_0x1c8a01['message'][_0x4ad0('0x7d')]=_0x4ad0('0x82');_0x1c8a01['message'][_0x4ad0('0x41')]=htmlToText[_0x4ad0('0x7f')](_0x5390c2[_0x4ad0('0x19')][_0x4ad0('0x41')]);respondWithRpcPromise('EventManager',_0x4ad0('0x80'),{'event':_0x4ad0('0x8b'),'message':_0x1c8a01[_0x4ad0('0x19')]},client9002);return _0x5390c2;}return null;})[_0x4ad0('0x12')](respondWithResult(_0x51c65b,null))['catch'](handleError(_0x51c65b,null));};exports['download']=function(_0x392a17,_0x236553){var _0x2df199=moment()[_0x4ad0('0x8c')]()[_0x4ad0('0x8d')]();var _0x69e9d0=path[_0x4ad0('0x5a')](config['root'],_0x4ad0('0x8e'),_0x4ad0('0x8f'),'tmp');var _0x10b803=path[_0x4ad0('0x5a')](config[_0x4ad0('0x5b')],_0x4ad0('0x8e'),'files',_0x4ad0('0x59'));var _0x1bb461=util[_0x4ad0('0x62')]('message-%s.eml',_0x2df199);return db[_0x4ad0('0x29')][_0x4ad0('0x40')]({'where':{'id':_0x392a17[_0x4ad0('0x43')]['id']},'attributes':['id',_0x4ad0('0x41'),_0x4ad0('0x90'),'to','cc','bcc',_0x4ad0('0x91'),_0x4ad0('0x92')],'include':_0x392a17[_0x4ad0('0x2e')]['attachments']?[{'model':db[_0x4ad0('0x93')],'as':'Attachments'}]:undefined})[_0x4ad0('0x12')](handleEntityNotFound(_0x236553,null))[_0x4ad0('0x12')](function(_0x3777c4){if(_0x3777c4){var _0x9d2f6c=_0x3777c4;var _0x16cf36={'from':_0x9d2f6c['from'],'to':_0x9d2f6c['to'],'subject':_0x9d2f6c[_0x4ad0('0x91')],'html':htmlEntities[_0x4ad0('0x94')](_0x9d2f6c['body']),'headers':{'Date':moment(_0x9d2f6c['createdAt'])[_0x4ad0('0x62')](_0x4ad0('0x95'))},'attachments':[]};if(_0x3777c4['cc']){_0x16cf36['headers']['Cc']=_0x3777c4['cc'];}if(_0x3777c4['bcc']){_0x16cf36[_0x4ad0('0x96')]['Bcc']=_0x3777c4[_0x4ad0('0x97')];}return new BPromise(function(_0x598729,_0x8bd47d){if(_0x3777c4['Attachments']){for(var _0x560221=0x0;_0x560221<_0x3777c4['Attachments'][_0x4ad0('0x33')];_0x560221++){var _0x280b11=_0x3777c4[_0x4ad0('0x98')][_0x560221];var _0x4539fb=path['join'](_0x10b803,_0x280b11[_0x4ad0('0x5c')]);if(fs[_0x4ad0('0x99')](_0x4539fb)){_0x16cf36[_0x4ad0('0x59')][_0x4ad0('0x9a')]({'name':_0x280b11[_0x4ad0('0x27')],'contentType':_0x280b11[_0x4ad0('0x2c')],'data':fs[_0x4ad0('0x9b')](_0x4539fb)});}}}emlformat[_0x4ad0('0x9c')](_0x16cf36,function(_0x190d6f,_0x38363d){if(_0x190d6f)return _0x8bd47d(_0x190d6f);fs[_0x4ad0('0x9d')](path[_0x4ad0('0x5a')](_0x69e9d0,_0x1bb461),_0x38363d);return _0x598729(_0x38363d);});});}})['then'](function(_0xfbd2b){if(_0xfbd2b){return _0x236553[_0x4ad0('0x9e')](path[_0x4ad0('0x5a')](_0x69e9d0,_0x1bb461),_0x1bb461,function(_0x5c213d){if(!_0x5c213d)fs[_0x4ad0('0x9f')](path[_0x4ad0('0x5a')](_0x69e9d0,_0x1bb461));});}})[_0x4ad0('0x1b')](handleError(_0x236553,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 455dd66..c9acaa9 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 _0x0498=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3471da,_0x3666ef){var _0x36a452=function(_0x2de7e7){while(--_0x2de7e7){_0x3471da['push'](_0x3471da['shift']());}};_0x36a452(++_0x3666ef);}(_0x0498,0x88));var _0x8049=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0498[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x8049('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8049('0x1')](0x0);var events={'afterCreate':_0x8049('0x2'),'afterUpdate':_0x8049('0x3'),'afterDestroy':_0x8049('0x4')};function emitEvent(_0x49583a){return function(_0x371216,_0x1b820d,_0x337587){MailMessageEvents[_0x8049('0x5')](_0x49583a+':'+_0x371216['id'],_0x371216);MailMessageEvents[_0x8049('0x5')](_0x49583a,_0x371216);_0x337587(null);};}for(var e in events){if(events[_0x8049('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x8049('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xdbc5=['save','remove','emit','hook','exports','events','MailMessage'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdbc5,0x67));var _0x5dbc=function(_0x17b207,_0x36a21d){_0x17b207=_0x17b207-0x0;var _0x2630b9=_0xdbc5[_0x17b207];return _0x2630b9;};'use strict';var EventEmitter=require(_0x5dbc('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x5dbc('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dbc('0x2'),'afterUpdate':'update','afterDestroy':_0x5dbc('0x3')};function emitEvent(_0x3fad50){return function(_0x33c3f3,_0x155606,_0x2e6ba6){MailMessageEvents[_0x5dbc('0x4')](_0x3fad50+':'+_0x33c3f3['id'],_0x33c3f3);MailMessageEvents[_0x5dbc('0x4')](_0x3fad50,_0x33c3f3);_0x2e6ba6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5dbc('0x5')](e,emitEvent(event));}}module[_0x5dbc('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 46f44a9..c2d788e 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 _0x4b51=['exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','models','get','toLowerCase','direction','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','lodash','../../config/logger','api','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes'];(function(_0x4a2f68,_0x2a864d){var _0x55f946=function(_0x50b711){while(--_0x50b711){_0x4a2f68['push'](_0x4a2f68['shift']());}};_0x55f946(++_0x2a864d);}(_0x4b51,0x1e7));var _0x14b5=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x4b51[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x14b5('0x0'));var util=require('util');var logger=require(_0x14b5('0x1'))(_0x14b5('0x2'));var moment=require(_0x14b5('0x3'));var BPromise=require('bluebird');var rp=require(_0x14b5('0x4'));var htmlToText=require(_0x14b5('0x5'));var fs=require('fs');var path=require(_0x14b5('0x6'));var rimraf=require('rimraf');var config=require(_0x14b5('0x7'));var attributes=require(_0x14b5('0x8'));module[_0x14b5('0x9')]=function(_0x32fe85,_0x1e4604){return _0x32fe85[_0x14b5('0xa')](_0x14b5('0xb'),attributes,{'tableName':_0x14b5('0xc'),'paranoid':![],'indexes':[{'name':_0x14b5('0xd'),'fields':[_0x14b5('0xd')]},{'name':'fti_mail_messages','fields':[_0x14b5('0xe'),_0x14b5('0xf')],'type':_0x14b5('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36e917,_0x23c37d,_0x5171a7){if(_0x36e917['body']){_0x36e917[_0x14b5('0xe')]=htmlToText[_0x14b5('0x11')](_0x36e917['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5171a7(null,_0x23c37d);},'afterCreate':function(_0x2ca51f,_0x30a761,_0x3212e4){var _0x1c5b68=_0x32fe85[_0x14b5('0x12')];var _0x589fa4=_0x2ca51f[_0x14b5('0x13')]({'plain':!![]});if(_0x589fa4['direction'][_0x14b5('0x14')]()==='in'||_0x589fa4[_0x14b5('0x15')][_0x14b5('0x14')]()==='out'&&!_0x589fa4[_0x14b5('0x16')]&&!_[_0x14b5('0x17')](_0x589fa4['UserId'])){_0x1c5b68[_0x14b5('0x18')][_0x14b5('0x19')]({'where':{'id':_0x589fa4[_0x14b5('0x1a')]}})[_0x14b5('0x1b')](function(_0x3a42e4){if(_0x3a42e4){_0x3a42e4[_0x14b5('0x1c')]({'lastMsgAt':_0x589fa4[_0x14b5('0x1d')],'lastMsgDirection':_0x589fa4[_0x14b5('0x15')][_0x14b5('0x14')]()});}})[_0x14b5('0x1e')](function(_0x46cd26){console['error'](_0x46cd26);});}_0x3212e4();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3cde=['body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x3cde,0x19e));var _0xe3cd=function(_0x2675b0,_0x5d1668){_0x2675b0=_0x2675b0-0x0;var _0x19d11c=_0x3cde[_0x2675b0];return _0x19d11c;};'use strict';var _=require(_0xe3cd('0x0'));var util=require('util');var logger=require(_0xe3cd('0x1'))(_0xe3cd('0x2'));var moment=require(_0xe3cd('0x3'));var BPromise=require(_0xe3cd('0x4'));var rp=require(_0xe3cd('0x5'));var htmlToText=require(_0xe3cd('0x6'));var fs=require('fs');var path=require(_0xe3cd('0x7'));var rimraf=require(_0xe3cd('0x8'));var config=require(_0xe3cd('0x9'));var attributes=require(_0xe3cd('0xa'));module[_0xe3cd('0xb')]=function(_0x180417,_0x1c1921){return _0x180417['define'](_0xe3cd('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xe3cd('0xd'),'fields':[_0xe3cd('0xd')]},{'name':_0xe3cd('0xe'),'fields':[_0xe3cd('0xf'),_0xe3cd('0x10')],'type':_0xe3cd('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b01e6,_0x333bd0,_0x133508){if(_0x3b01e6[_0xe3cd('0x12')]){_0x3b01e6[_0xe3cd('0xf')]=htmlToText[_0xe3cd('0x13')](_0x3b01e6[_0xe3cd('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x133508(null,_0x333bd0);},'afterCreate':function(_0x5ed230,_0x5b0af3,_0x2b45ff){var _0x584e2f=_0x180417[_0xe3cd('0x14')];var _0x194fe8=_0x5ed230[_0xe3cd('0x15')]({'plain':!![]});if(_0x194fe8[_0xe3cd('0x16')][_0xe3cd('0x17')]()==='in'||_0x194fe8[_0xe3cd('0x16')][_0xe3cd('0x17')]()==='out'&&!_0x194fe8[_0xe3cd('0x18')]&&!_[_0xe3cd('0x19')](_0x194fe8[_0xe3cd('0x1a')])){_0x584e2f[_0xe3cd('0x1b')][_0xe3cd('0x1c')]({'where':{'id':_0x194fe8[_0xe3cd('0x1d')]}})[_0xe3cd('0x1e')](function(_0x5d06d6){if(_0x5d06d6){_0x5d06d6[_0xe3cd('0x1f')]({'lastMsgAt':_0x194fe8[_0xe3cd('0x20')],'lastMsgDirection':_0x194fe8['direction'][_0xe3cd('0x17')]()});}})[_0xe3cd('0x21')](function(_0x29a6ab){console[_0xe3cd('0x22')](_0x29a6ab);});}_0x2b45ff();}},'charset':_0xe3cd('0x23'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 07c49f9..91cfe8c 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 _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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7708,0x188));var _0x8770=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x7708[_0x1ee9a1];return _0x21270f;};'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 +var _0x77e6=['catch','CreateMailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x125fb5,_0x2bfd88){var _0x422dbe=function(_0xd6dc84){while(--_0xd6dc84){_0x125fb5['push'](_0x125fb5['shift']());}};_0x422dbe(++_0x2bfd88);}(_0x77e6,0x1a6));var _0x677e=function(_0x114b1d,_0x11ebda){_0x114b1d=_0x114b1d-0x0;var _0x538371=_0x77e6[_0x114b1d];return _0x538371;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});config[_0x677e('0xb')]=_['defaults'](config['redis'],{'host':_0x677e('0xc'),'port':0x18eb});var socket=require(_0x677e('0xd'))(new Redis(config[_0x677e('0xb')]));require(_0x677e('0xe'))['register'](socket);function respondWithRpcPromise(_0x206305,_0x5bf52d,_0x3cdbe3){return new BPromise(function(_0x227084,_0x1e4fd9){return client[_0x677e('0xf')](_0x206305,_0x3cdbe3)[_0x677e('0x10')](function(_0x49ca35){logger[_0x677e('0x11')](_0x677e('0x12'),_0x5bf52d,_0x677e('0x13'));logger[_0x677e('0x14')](_0x677e('0x15'),_0x5bf52d,_0x677e('0x13'),JSON[_0x677e('0x16')](_0x49ca35));if(_0x49ca35[_0x677e('0x17')]){if(_0x49ca35['error']['code']===0x1f4){logger['error'](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x1e4fd9(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}logger[_0x677e('0x17')](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x227084(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}else{logger[_0x677e('0x11')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0x677e('0x13'));_0x227084(_0x49ca35[_0x677e('0x19')][_0x677e('0x18')]);}})[_0x677e('0x1a')](function(_0xba1c26){logger[_0x677e('0x17')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0xba1c26);_0x1e4fd9(_0xba1c26);});});}exports[_0x677e('0x1b')]=function(_0x4bfbb6){var _0x18424e=this;return new Promise(function(_0x267aac,_0x26e9c5){return db['MailMessage'][_0x677e('0x1c')](_0x4bfbb6[_0x677e('0x1d')],{'raw':_0x4bfbb6[_0x677e('0x1e')]?_0x4bfbb6[_0x677e('0x1e')][_0x677e('0x1f')]===undefined?!![]:![]:!![]})[_0x677e('0x10')](function(_0x3a7895){logger['info']('CreateMailMessage',_0x4bfbb6);logger['debug'](_0x677e('0x1b'),_0x4bfbb6,JSON[_0x677e('0x16')](_0x3a7895));_0x267aac(_0x3a7895);})[_0x677e('0x1a')](function(_0x540d0e){logger[_0x677e('0x17')](_0x677e('0x1b'),_0x540d0e[_0x677e('0x18')],_0x4bfbb6);_0x26e9c5(_0x18424e[_0x677e('0x17')](0x1f4,_0x540d0e[_0x677e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 42a564c..0d7bde5 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 _0x1d60=['length','mailMessage:','update','emit','removeListener'];(function(_0x51b1e4,_0x164131){var _0x587d06=function(_0x20f408){while(--_0x20f408){_0x51b1e4['push'](_0x51b1e4['shift']());}};_0x587d06(++_0x164131);}(_0x1d60,0xe8));var _0x01d6=function(_0x59fe15,_0x426a79){_0x59fe15=_0x59fe15-0x0;var _0x2c6d9c=_0x1d60[_0x59fe15];return _0x2c6d9c;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x01d6('0x0')];function createListener(_0x3de8c7,_0xa743fa){return function(_0x16f460){_0xa743fa[_0x01d6('0x1')](_0x3de8c7,_0x16f460);};}function removeListener(_0x36a016,_0x486b9b){return function(){MailMessageEvents[_0x01d6('0x2')](_0x36a016,_0x486b9b);};}exports['register']=function(_0x1cee6b){for(var _0xd09b99=0x0,_0x4e0aca=events[_0x01d6('0x3')];_0xd09b99<_0x4e0aca;_0xd09b99++){var _0x19809c=events[_0xd09b99];var _0x1de5bb=createListener(_0x01d6('0x4')+_0x19809c,_0x1cee6b);MailMessageEvents['on'](_0x19809c,_0x1de5bb);}}; \ No newline at end of file +var _0xf76f=['removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x28ef98,_0x4275c1){var _0x1d39a1=function(_0x4eaa41){while(--_0x4eaa41){_0x28ef98['push'](_0x28ef98['shift']());}};_0x1d39a1(++_0x4275c1);}(_0xf76f,0x1ab));var _0xff76=function(_0x1f8f6e,_0x16f2fc){_0x1f8f6e=_0x1f8f6e-0x0;var _0x5329a9=_0xf76f[_0x1f8f6e];return _0x5329a9;};'use strict';var MailMessageEvents=require(_0xff76('0x0'));var events=[_0xff76('0x1'),_0xff76('0x2'),_0xff76('0x3')];function createListener(_0xcd5927,_0x3289d5){return function(_0x50ab8b){_0x3289d5[_0xff76('0x4')](_0xcd5927,_0x50ab8b);};}function removeListener(_0x808edd,_0x589fcc){return function(){MailMessageEvents[_0xff76('0x5')](_0x808edd,_0x589fcc);};}exports[_0xff76('0x6')]=function(_0x42db92){for(var _0x35ad0c=0x0,_0x3627a8=events[_0xff76('0x7')];_0x35ad0c<_0x3627a8;_0x35ad0c++){var _0x107a12=events[_0x35ad0c];var _0x8be2b5=createListener(_0xff76('0x8')+_0x107a12,_0x42db92);MailMessageEvents['on'](_0x107a12,_0x8be2b5);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 082b8c2..8f85c7f 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 _0x670a=['/:id/users','getAgents','post','create','addTeams','put','update','destroy','removeTeams','delete','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','getMembers','/:id/teams','getTeams'];(function(_0x45defb,_0x5ca043){var _0x463ec0=function(_0x43b660){while(--_0x43b660){_0x45defb['push'](_0x45defb['shift']());}};_0x463ec0(++_0x5ca043);}(_0x670a,0x1df));var _0xa670=function(_0x247244,_0x3642e4){_0x247244=_0x247244-0x0;var _0x821314=_0x670a[_0x247244];return _0x821314;};'use strict';var multer=require(_0xa670('0x0'));var util=require(_0xa670('0x1'));var path=require(_0xa670('0x2'));var timeout=require(_0xa670('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa670('0x4'));var auth=require(_0xa670('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0xa670('0x6')]('/',auth['isAuthenticated'](),controller[_0xa670('0x7')]);router['get'](_0xa670('0x8'),auth['isAuthenticated'](),controller[_0xa670('0x9')]);router[_0xa670('0x6')](_0xa670('0xa'),auth[_0xa670('0xb')](),controller['show']);router[_0xa670('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0xa670('0xc')]);router[_0xa670('0x6')](_0xa670('0xd'),auth[_0xa670('0xb')](),controller[_0xa670('0xe')]);router[_0xa670('0x6')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller[_0xa670('0x10')]);router[_0xa670('0x11')]('/',auth['isAuthenticated'](),controller[_0xa670('0x12')]);router[_0xa670('0x11')](_0xa670('0xd'),auth[_0xa670('0xb')](),controller[_0xa670('0x13')]);router[_0xa670('0x11')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller['addAgents']);router[_0xa670('0x14')](_0xa670('0xa'),auth['isAuthenticated'](),controller[_0xa670('0x15')]);router['delete'](_0xa670('0xa'),auth['isAuthenticated'](),controller[_0xa670('0x16')]);router['delete']('/:id/teams',auth[_0xa670('0xb')](),controller[_0xa670('0x17')]);router[_0xa670('0x18')](_0xa670('0xf'),auth[_0xa670('0xb')](),controller[_0xa670('0x19')]);module['exports']=router; \ No newline at end of file +var _0x8629=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8629,0x144));var _0x9862=function(_0x3d2799,_0x58c640){_0x3d2799=_0x3d2799-0x0;var _0x305e71=_0x8629[_0x3d2799];return _0x305e71;};'use strict';var multer=require('multer');var util=require(_0x9862('0x0'));var path=require(_0x9862('0x1'));var timeout=require('connect-timeout');var express=require(_0x9862('0x2'));var router=express[_0x9862('0x3')]();var fs_extra=require(_0x9862('0x4'));var auth=require(_0x9862('0x5'));var interaction=require(_0x9862('0x6'));var config=require(_0x9862('0x7'));var controller=require(_0x9862('0x8'));router[_0x9862('0x9')]('/',auth[_0x9862('0xa')](),controller[_0x9862('0xb')]);router[_0x9862('0x9')](_0x9862('0xc'),auth[_0x9862('0xa')](),controller[_0x9862('0xd')]);router[_0x9862('0x9')](_0x9862('0xe'),auth['isAuthenticated'](),controller[_0x9862('0xf')]);router[_0x9862('0x9')](_0x9862('0x10'),auth[_0x9862('0xa')](),controller[_0x9862('0x11')]);router[_0x9862('0x9')](_0x9862('0x12'),auth[_0x9862('0xa')](),controller[_0x9862('0x13')]);router[_0x9862('0x9')](_0x9862('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9862('0x15')]('/',auth['isAuthenticated'](),controller[_0x9862('0x16')]);router[_0x9862('0x15')](_0x9862('0x12'),auth[_0x9862('0xa')](),controller[_0x9862('0x17')]);router[_0x9862('0x15')](_0x9862('0x14'),auth[_0x9862('0xa')](),controller[_0x9862('0x18')]);router[_0x9862('0x19')](_0x9862('0xe'),auth[_0x9862('0xa')](),controller[_0x9862('0x1a')]);router[_0x9862('0x1b')](_0x9862('0xe'),auth[_0x9862('0xa')](),controller[_0x9862('0x1c')]);router[_0x9862('0x1b')](_0x9862('0x12'),auth[_0x9862('0xa')](),controller[_0x9862('0x1d')]);router[_0x9862('0x1b')](_0x9862('0x14'),auth[_0x9862('0xa')](),controller[_0x9862('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 017b760..20064de 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 _0x72b0=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x40aac5,_0x5d8733){var _0x343d40=function(_0x51bdbc){while(--_0x51bdbc){_0x40aac5['push'](_0x40aac5['shift']());}};_0x343d40(++_0x5d8733);}(_0x72b0,0x146));var _0x072b=function(_0x25cbf7,_0x5d7203){_0x25cbf7=_0x25cbf7-0x0;var _0x186792=_0x72b0[_0x25cbf7];return _0x186792;};'use strict';var Sequelize=require('sequelize');module[_0x072b('0x0')]={'name':{'type':Sequelize[_0x072b('0x1')],'unique':_0x072b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x072b('0x1')]},'timeout':{'type':Sequelize[_0x072b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x072b('0x4')](_0x072b('0x5'),'beepall',_0x072b('0x6'))}}; \ No newline at end of file +var _0xe916=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xe916,0x16b));var _0x6e91=function(_0x447d0d,_0x508e61){_0x447d0d=_0x447d0d-0x0;var _0x519a44=_0xe916[_0x447d0d];return _0x519a44;};'use strict';var Sequelize=require(_0x6e91('0x0'));module[_0x6e91('0x1')]={'name':{'type':Sequelize[_0x6e91('0x2')],'unique':_0x6e91('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6e91('0x2')]},'timeout':{'type':Sequelize[_0x6e91('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6e91('0x5')](_0x6e91('0x6'),_0x6e91('0x7'),_0x6e91('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 57d773b..6a88d10 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 _0x88f5=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','index','map','MailQueue','rawAttributes','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','describe','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','forEach','emit','userMailQueue:save','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3bdc36,_0x34eca0){var _0x3b5a5c=function(_0x1a0096){while(--_0x1a0096){_0x3bdc36['push'](_0x3bdc36['shift']());}};_0x3b5a5c(++_0x34eca0);}(_0x88f5,0x79));var _0x588f=function(_0x304cb4,_0x1631c7){_0x304cb4=_0x304cb4-0x0;var _0x84d773=_0x88f5[_0x304cb4];return _0x84d773;};'use strict';var emlformat=require(_0x588f('0x0'));var rimraf=require(_0x588f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x588f('0x2'));var moment=require(_0x588f('0x3'));var BPromise=require(_0x588f('0x4'));var Mustache=require(_0x588f('0x5'));var util=require('util');var path=require(_0x588f('0x6'));var sox=require(_0x588f('0x7'));var csv=require(_0x588f('0x8'));var ejs=require(_0x588f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x588f('0xa'));var squel=require(_0x588f('0xb'));var crypto=require(_0x588f('0xc'));var jsforce=require(_0x588f('0xd'));var deskjs=require(_0x588f('0xe'));var toCsv=require(_0x588f('0x8'));var querystring=require('querystring');var Papa=require(_0x588f('0xf'));var Redis=require(_0x588f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x588f('0x11'));var hardwareService=require(_0x588f('0x12'));var logger=require(_0x588f('0x13'))('api');var utils=require(_0x588f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x588f('0x15'));var db=require(_0x588f('0x16'))['db'];config[_0x588f('0x17')]=_[_0x588f('0x18')](config[_0x588f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x588f('0x19'))(new Redis(config[_0x588f('0x17')]));require('./mailQueue.socket')[_0x588f('0x1a')](socket);function respondWithStatusCode(_0x1db459,_0x332bf7){_0x332bf7=_0x332bf7||0xcc;return function(_0x4a8a85){if(_0x4a8a85){return _0x1db459[_0x588f('0x1b')](_0x332bf7);}return _0x1db459[_0x588f('0x1c')](_0x332bf7)['end']();};}function respondWithResult(_0x25331b,_0x2b49a0){_0x2b49a0=_0x2b49a0||0xc8;return function(_0x3829d7){if(_0x3829d7){return _0x25331b[_0x588f('0x1c')](_0x2b49a0)[_0x588f('0x1d')](_0x3829d7);}};}function respondWithFilteredResult(_0x4a97ce,_0x33e2ee){return function(_0x1a1fac){if(_0x1a1fac){var _0x3aa544=typeof _0x33e2ee[_0x588f('0x1e')]==='undefined'&&typeof _0x33e2ee[_0x588f('0x1f')]==='undefined';var _0x213112=_0x1a1fac[_0x588f('0x20')];var _0x4ceaa7=_0x3aa544?0x0:_0x33e2ee['offset'];var _0x9ff7a2=_0x3aa544?_0x1a1fac[_0x588f('0x20')]:_0x33e2ee[_0x588f('0x1e')]+_0x33e2ee[_0x588f('0x1f')];var _0x404e8c;if(_0x9ff7a2>=_0x213112){_0x9ff7a2=_0x213112;_0x404e8c=0xc8;}else{_0x404e8c=0xce;}_0x4a97ce[_0x588f('0x1c')](_0x404e8c);return _0x4a97ce['set'](_0x588f('0x21'),_0x4ceaa7+'-'+_0x9ff7a2+'/'+_0x213112)[_0x588f('0x1d')](_0x1a1fac);}return null;};}function patchUpdates(_0x503ce3){return function(_0x38d659){try{jsonpatch['apply'](_0x38d659,_0x503ce3,!![]);}catch(_0x212a0e){return BPromise[_0x588f('0x22')](_0x212a0e);}return _0x38d659[_0x588f('0x23')]();};}function saveUpdates(_0xe96914,_0x534aa8){return function(_0x153213){if(_0x153213){return _0x153213[_0x588f('0x24')](_0xe96914)[_0x588f('0x25')](function(_0xcbdb5d){return _0xcbdb5d;});}return null;};}function removeEntity(_0x57eb13,_0x5304e5){return function(_0x69c849){if(_0x69c849){return _0x69c849[_0x588f('0x26')]()[_0x588f('0x25')](function(){var _0x516027=_0x69c849[_0x588f('0x27')]({'plain':!![]});var _0x5595be=_0x588f('0x28');return db[_0x588f('0x29')][_0x588f('0x26')]({'where':{'type':_0x5595be,'resourceId':_0x516027['id']}})['then'](function(){return _0x69c849;});})[_0x588f('0x25')](function(){_0x57eb13[_0x588f('0x1c')](0xcc)[_0x588f('0x2a')]();});}};}function handleEntityNotFound(_0x19b14e,_0x104a2b){return function(_0x24dc25){if(!_0x24dc25){_0x19b14e[_0x588f('0x1b')](0x194);}return _0x24dc25;};}function handleError(_0x442692,_0x1a6d18){_0x1a6d18=_0x1a6d18||0x1f4;return function(_0x4d7d62){logger[_0x588f('0x2b')](_0x4d7d62[_0x588f('0x2c')]);if(_0x4d7d62['name']){delete _0x4d7d62['name'];}_0x442692[_0x588f('0x1c')](_0x1a6d18)['send'](_0x4d7d62);};}exports[_0x588f('0x2d')]=function(_0x3d9fb0,_0xaa8252){var _0x29ed94={},_0x2ac854={},_0x1bbe14={'count':0x0,'rows':[]};var _0xc2f8f4=_[_0x588f('0x2e')](db[_0x588f('0x2f')][_0x588f('0x30')],function(_0xe3fd01){return{'name':_0xe3fd01[_0x588f('0x31')],'type':_0xe3fd01['type'][_0x588f('0x32')]};});_0x2ac854[_0x588f('0x33')]=_[_0x588f('0x2e')](_0xc2f8f4,_0x588f('0x34'));_0x2ac854[_0x588f('0x35')]=_[_0x588f('0x36')](_0x3d9fb0[_0x588f('0x35')]);_0x2ac854['filters']=_[_0x588f('0x37')](_0x2ac854[_0x588f('0x33')],_0x2ac854[_0x588f('0x35')]);_0x29ed94['attributes']=_[_0x588f('0x37')](_0x2ac854[_0x588f('0x33')],qs['fields'](_0x3d9fb0['query'][_0x588f('0x38')]));_0x29ed94[_0x588f('0x39')]=_0x29ed94[_0x588f('0x39')][_0x588f('0x3a')]?_0x29ed94['attributes']:_0x2ac854[_0x588f('0x33')];if(!_0x3d9fb0[_0x588f('0x35')][_0x588f('0x3b')](_0x588f('0x3c'))){_0x29ed94[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x3d9fb0[_0x588f('0x35')]['limit']);_0x29ed94[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x3d9fb0['query'][_0x588f('0x1e')]);}_0x29ed94[_0x588f('0x3d')]=qs['sort'](_0x3d9fb0[_0x588f('0x35')][_0x588f('0x3e')]);_0x29ed94['where']=qs['filters'](_[_0x588f('0x3f')](_0x3d9fb0[_0x588f('0x35')],_0x2ac854[_0x588f('0x40')]),_0xc2f8f4);if(_0x3d9fb0[_0x588f('0x35')][_0x588f('0x41')]){_0x29ed94[_0x588f('0x42')]=_[_0x588f('0x43')](_0x29ed94[_0x588f('0x42')],{'$or':_['map'](_0xc2f8f4,function(_0x2eb548){if(_0x2eb548[_0x588f('0x44')]!==_0x588f('0x45')){var _0x962e99={};_0x962e99[_0x2eb548[_0x588f('0x34')]]={'$like':'%'+_0x3d9fb0[_0x588f('0x35')][_0x588f('0x41')]+'%'};return _0x962e99;}})});}_0x29ed94=_[_0x588f('0x43')]({},_0x29ed94,_0x3d9fb0[_0x588f('0x46')]);var _0x127d72={'where':_0x29ed94[_0x588f('0x42')]};return db[_0x588f('0x2f')][_0x588f('0x20')](_0x127d72)[_0x588f('0x25')](function(_0x28df51){_0x1bbe14[_0x588f('0x20')]=_0x28df51;if(_0x3d9fb0[_0x588f('0x35')][_0x588f('0x47')]){_0x29ed94[_0x588f('0x48')]=[{'all':!![]}];}return db[_0x588f('0x2f')][_0x588f('0x49')](_0x29ed94);})[_0x588f('0x25')](function(_0x1bdaac){_0x1bbe14['rows']=_0x1bdaac;return _0x1bbe14;})[_0x588f('0x25')](respondWithFilteredResult(_0xaa8252,_0x29ed94))[_0x588f('0x4a')](handleError(_0xaa8252,null));};exports[_0x588f('0x4b')]=function(_0x293333,_0x220a8b){var _0x175d41={'raw':!![],'where':{'id':_0x293333[_0x588f('0x4c')]['id']}},_0x21b001={};_0x21b001[_0x588f('0x33')]=_[_0x588f('0x36')](db[_0x588f('0x2f')][_0x588f('0x30')]);_0x21b001[_0x588f('0x35')]=_[_0x588f('0x36')](_0x293333[_0x588f('0x35')]);_0x21b001[_0x588f('0x40')]=_[_0x588f('0x37')](_0x21b001[_0x588f('0x33')],_0x21b001['query']);_0x175d41[_0x588f('0x39')]=_[_0x588f('0x37')](_0x21b001[_0x588f('0x33')],qs['fields'](_0x293333[_0x588f('0x35')][_0x588f('0x38')]));_0x175d41[_0x588f('0x39')]=_0x175d41['attributes']['length']?_0x175d41[_0x588f('0x39')]:_0x21b001[_0x588f('0x33')];if(_0x293333[_0x588f('0x35')]['includeAll']){_0x175d41[_0x588f('0x48')]=[{'all':!![]}];}_0x175d41=_['merge']({},_0x175d41,_0x293333[_0x588f('0x46')]);return db[_0x588f('0x2f')]['find'](_0x175d41)[_0x588f('0x25')](handleEntityNotFound(_0x220a8b,null))[_0x588f('0x25')](respondWithResult(_0x220a8b,null))[_0x588f('0x4a')](handleError(_0x220a8b,null));};exports[_0x588f('0x4d')]=function(_0x23178e,_0x5c8fb0){return db[_0x588f('0x2f')]['create'](_0x23178e[_0x588f('0x4e')],{})[_0x588f('0x25')](function(_0x24c018){var _0x4ca36a=_0x23178e['user'][_0x588f('0x27')]({'plain':!![]});if(!_0x4ca36a)throw new Error(_0x588f('0x4f'));if(_0x4ca36a[_0x588f('0x50')]===_0x588f('0x51')){var _0x214380=_0x24c018[_0x588f('0x27')]({'plain':!![]});var _0x25b6c2='MailQueues';return db[_0x588f('0x52')][_0x588f('0x53')]({'where':{'name':_0x25b6c2,'userProfileId':_0x4ca36a['userProfileId']},'raw':!![]})['then'](function(_0x196f75){if(_0x196f75&&_0x196f75[_0x588f('0x54')]===0x0){return db[_0x588f('0x29')][_0x588f('0x4d')]({'name':_0x214380[_0x588f('0x34')],'resourceId':_0x214380['id'],'type':_0x196f75[_0x588f('0x34')],'sectionId':_0x196f75['id']},{})['then'](function(){return _0x24c018;});}else{return _0x24c018;}})[_0x588f('0x4a')](function(_0x2005d9){logger[_0x588f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2005d9);throw _0x2005d9;});}return _0x24c018;})[_0x588f('0x25')](respondWithResult(_0x5c8fb0,0xc9))['catch'](handleError(_0x5c8fb0,null));};exports[_0x588f('0x24')]=function(_0x4eb373,_0x327bd9){if(_0x4eb373['body']['id']){delete _0x4eb373[_0x588f('0x4e')]['id'];}return db['MailQueue'][_0x588f('0x53')]({'where':{'id':_0x4eb373[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x327bd9,null))[_0x588f('0x25')](saveUpdates(_0x4eb373[_0x588f('0x4e')],null))['then'](respondWithResult(_0x327bd9,null))[_0x588f('0x4a')](handleError(_0x327bd9,null));};exports[_0x588f('0x26')]=function(_0x4172b8,_0x5c56d9){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x4172b8[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x5c56d9,null))['then'](removeEntity(_0x5c56d9,null))[_0x588f('0x4a')](handleError(_0x5c56d9,null));};exports[_0x588f('0x55')]=function(_0x3db1bb,_0x673ce8){return db[_0x588f('0x2f')][_0x588f('0x55')]()[_0x588f('0x25')](respondWithResult(_0x673ce8,null))[_0x588f('0x4a')](handleError(_0x673ce8,null));};exports['getMembers']=function(_0x3c1040,_0x5056b2,_0x4b1ccc){var _0xbbe7cf={'raw':!![],'where':{}},_0x265b21={},_0x4fdc8a;return db['MailQueue'][_0x588f('0x56')]({'where':{'id':_0x3c1040['params']['id']}})['then'](handleEntityNotFound(_0x5056b2,null))[_0x588f('0x25')](function(_0x12fade){if(_0x12fade){_0x4fdc8a=_0x12fade[_0x588f('0x27')]({'plain':!![]});_0x265b21[_0x588f('0x33')]=_[_0x588f('0x36')](db['UserMailQueue'][_0x588f('0x30')]);_0x265b21[_0x588f('0x35')]=_[_0x588f('0x36')](_0x3c1040[_0x588f('0x35')]);_0x265b21['filters']=_[_0x588f('0x37')](_0x265b21['model'],_0x265b21[_0x588f('0x35')]);_0xbbe7cf['attributes']=_['intersection'](_0x265b21[_0x588f('0x33')],qs[_0x588f('0x38')](_0x3c1040[_0x588f('0x35')][_0x588f('0x38')]));_0xbbe7cf['attributes']=_0xbbe7cf[_0x588f('0x39')]['length']?_0xbbe7cf[_0x588f('0x39')]:_0x265b21[_0x588f('0x33')];if(!_0x3c1040['query'][_0x588f('0x3b')](_0x588f('0x3c'))){_0xbbe7cf[_0x588f('0x1f')]=qs['limit'](_0x3c1040[_0x588f('0x35')][_0x588f('0x1f')]);_0xbbe7cf[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x3c1040[_0x588f('0x35')][_0x588f('0x1e')]);}_0xbbe7cf[_0x588f('0x3d')]=qs[_0x588f('0x3e')](_0x3c1040[_0x588f('0x35')][_0x588f('0x3e')]);_0xbbe7cf[_0x588f('0x42')]=qs['filters'](_[_0x588f('0x3f')](_0x3c1040[_0x588f('0x35')],_0x265b21[_0x588f('0x40')]));_0xbbe7cf[_0x588f('0x42')][_0x588f('0x57')]=_0x12fade['id'];if(_0x3c1040[_0x588f('0x35')][_0x588f('0x41')]){_0xbbe7cf[_0x588f('0x42')]=_['merge'](_0xbbe7cf[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0xbbe7cf[_0x588f('0x39')],function(_0xafda80){var _0x4e60b6={};_0x4e60b6[_0xafda80]={'$like':'%'+_0x3c1040['query'][_0x588f('0x41')]+'%'};return _0x4e60b6;})});}_0xbbe7cf=_[_0x588f('0x43')]({},_0xbbe7cf,_0x3c1040['options']);return db[_0x588f('0x58')][_0x588f('0x49')](_0xbbe7cf);}})[_0x588f('0x25')](function(_0x497084){if(_0x497084){return db[_0x588f('0x59')][_0x588f('0x5a')]({'where':{'id':_[_0x588f('0x2e')](_0x497084,_0x588f('0x5b')),'role':_0x588f('0x5c')},'attributes':['id','name',_0x588f('0x5d'),_0x588f('0x5e'),_0x588f('0x5f')]});}})[_0x588f('0x25')](function(_0xa16e0c){if(_0xa16e0c){return{'count':_0xa16e0c['count'],'rows':_[_0x588f('0x2e')](_0xa16e0c[_0x588f('0x60')],function(_0x177900){return{'membername':_0x177900['name'],'UserId':_0x177900['id'],'queue_name':_0x4fdc8a[_0x588f('0x34')],'MailQueueId':_0x4fdc8a['id'],'interface':util[_0x588f('0x61')](_0x588f('0x62'),_0x588f('0x63'),_0x177900[_0x588f('0x34')]),'penalty':0x0,'paused':_0x177900[_0x588f('0x5d')],'createdAt':_0x177900[_0x588f('0x5f')],'updatedAt':_0x177900['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x588f('0x25')](respondWithFilteredResult(_0x5056b2,_0xbbe7cf))['catch'](handleError(_0x5056b2,null));};exports[_0x588f('0x64')]=function(_0x4a864c,_0x256eba,_0x476dd1){var _0x3f65a6={};var _0xef9ee0={};var _0x367b19;var _0x1559cc;return db['MailQueue']['findOne']({'where':{'id':_0x4a864c[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x256eba,null))[_0x588f('0x25')](function(_0x2ba8db){if(_0x2ba8db){_0x367b19=_0x2ba8db;_0xef9ee0[_0x588f('0x33')]=_[_0x588f('0x36')](db[_0x588f('0x65')][_0x588f('0x30')]);_0xef9ee0['query']=_[_0x588f('0x36')](_0x4a864c[_0x588f('0x35')]);_0xef9ee0[_0x588f('0x40')]=_[_0x588f('0x37')](_0xef9ee0[_0x588f('0x33')],_0xef9ee0[_0x588f('0x35')]);_0x3f65a6[_0x588f('0x39')]=_[_0x588f('0x37')](_0xef9ee0[_0x588f('0x33')],qs['fields'](_0x4a864c[_0x588f('0x35')][_0x588f('0x38')]));_0x3f65a6[_0x588f('0x39')]=_0x3f65a6[_0x588f('0x39')][_0x588f('0x3a')]?_0x3f65a6['attributes']:_0xef9ee0[_0x588f('0x33')];_0x3f65a6['order']=qs[_0x588f('0x3e')](_0x4a864c[_0x588f('0x35')]['sort']);_0x3f65a6[_0x588f('0x42')]=qs[_0x588f('0x40')](_['pick'](_0x4a864c[_0x588f('0x35')],_0xef9ee0['filters']));if(_0x4a864c[_0x588f('0x35')][_0x588f('0x41')]){_0x3f65a6['where']=_['merge'](_0x3f65a6[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0x3f65a6[_0x588f('0x39')],function(_0x500d96){var _0x156c25={};_0x156c25[_0x500d96]={'$like':'%'+_0x4a864c[_0x588f('0x35')][_0x588f('0x41')]+'%'};return _0x156c25;})});}_0x3f65a6=_['merge']({},_0x3f65a6,_0x4a864c[_0x588f('0x46')]);return _0x367b19['getTeams'](_0x3f65a6);}})[_0x588f('0x25')](function(_0x3e86f6){if(_0x3e86f6){_0x1559cc=_0x3e86f6[_0x588f('0x3a')];if(!_0x4a864c[_0x588f('0x35')][_0x588f('0x3b')](_0x588f('0x3c'))){_0x3f65a6[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x4a864c[_0x588f('0x35')][_0x588f('0x1f')]);_0x3f65a6[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x4a864c[_0x588f('0x35')][_0x588f('0x1e')]);}return _0x367b19[_0x588f('0x64')](_0x3f65a6);}})['then'](function(_0x2b0a75){if(_0x2b0a75){return _0x2b0a75?{'count':_0x1559cc,'rows':_0x2b0a75}:null;}})[_0x588f('0x25')](respondWithResult(_0x256eba,null))[_0x588f('0x4a')](handleError(_0x256eba,null));};exports['addTeams']=function(_0x5b2daf,_0x334d9a,_0x581593){var _0x4adc64=_0x5b2daf['body'][_0x588f('0x66')];return db['Team'][_0x588f('0x49')]({'where':{'id':_0x4adc64},'attributes':['id'],'include':[{'model':db[_0x588f('0x59')],'as':_0x588f('0x67'),'attributes':['id',_0x588f('0x34'),_0x588f('0x68'),_0x588f('0x69'),_0x588f('0x6a')],'raw':!![]}]})[_0x588f('0x25')](function(_0x1d1723){if(_0x1d1723){var _0x10c206=_[_0x588f('0x6b')](_0x1d1723,function(_0x3d55b1){var _0x158c63=_0x3d55b1[_0x588f('0x27')]({'plain':!![]});return _0x158c63['Agents'];});return db['MailQueue'][_0x588f('0x53')]({'where':{'id':_0x5b2daf[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](function(_0x44ca8b){return db['sequelize'][_0x588f('0x6c')](function(_0x17f4d6){return _0x44ca8b[_0x588f('0x6d')](_0x4adc64,{'transaction':_0x17f4d6})['then'](function(){return BPromise['each'](_0x10c206,function(_0x1feb26){return db[_0x588f('0x58')]['findOrCreate']({'where':{'UserId':_0x1feb26['id'],'MailQueueId':_0x5b2daf[_0x588f('0x4c')]['id']},'transaction':_0x17f4d6});});})['then'](function(){_0x10c206[_0x588f('0x6e')](function(_0x14b927){socket[_0x588f('0x6f')](_0x588f('0x70'),{'UserId':_0x14b927['id'],'MailQueueId':_0x44ca8b['id']});});});});});}})[_0x588f('0x25')](respondWithStatusCode(_0x334d9a,null))[_0x588f('0x4a')](handleError(_0x334d9a,null));};exports['removeTeams']=function(_0x2eb938,_0x4ef4ef,_0x34c89b){return db[_0x588f('0x65')]['findAll']({'where':{'id':_0x2eb938[_0x588f('0x35')][_0x588f('0x66')]},'attributes':['id'],'include':[{'model':db[_0x588f('0x59')],'as':_0x588f('0x67'),'attributes':['id'],'raw':!![]}]})[_0x588f('0x25')](handleEntityNotFound(_0x4ef4ef,null))['then'](function(_0x6407e3){var _0x27b89e=_[_0x588f('0x2e')](_0x6407e3,'id');var _0x2f04ca=[];var _0x4f8559=[];var _0x25823c=squel[_0x588f('0x71')]();_0x25823c[_0x588f('0x72')]('tq.TeamId')[_0x588f('0x73')](_0x588f('0x74'),'tq')[_0x588f('0x75')](_0x588f('0x76'),'ut',_0x588f('0x77'))['where']('MailQueueId\x20=\x20?',_0x2eb938['params']['id']);for(var _0x28e4b4=0x0;_0x28e4b4<_0x6407e3[_0x588f('0x3a')];_0x28e4b4+=0x1){let _0x3ad4e9=_0x6407e3[_0x28e4b4];for(var _0x3c86c0=0x0;_0x3c86c0<_0x3ad4e9[_0x588f('0x67')][_0x588f('0x3a')];_0x3c86c0+=0x1){let _0x4c4a01=_0x3ad4e9['Agents'][_0x3c86c0];var _0x238740=_0x25823c[_0x588f('0x78')]();_0x238740['where'](_0x588f('0x79'),_0x4c4a01['id']);_0x4f8559[_0x588f('0x7a')](db['sequelize'][_0x588f('0x35')](_0x238740[_0x588f('0x7b')](),{'type':db[_0x588f('0x7c')][_0x588f('0x7d')][_0x588f('0x7e')]})[_0x588f('0x25')](function(_0x507cfb){if(_0x507cfb[_0x588f('0x3a')]===0x1){return _0x4c4a01['id'];}else{var _0xb5ffdb=_[_0x588f('0x7f')](_[_0x588f('0x2e')](_0x507cfb,_0x588f('0x80')),function(_0x164c59){return _[_0x588f('0x81')](_0x27b89e,_0x164c59);});if(_0xb5ffdb){return _0x4c4a01['id'];}}}));}}return BPromise['all'](_0x4f8559)[_0x588f('0x25')](function(_0xe1f431){_0x2f04ca=_(_0x2f04ca)[_0x588f('0x82')](_0xe1f431)[_0x588f('0x83')]()[_0x588f('0x84')]();return db[_0x588f('0x2f')]['find']({'where':{'id':_0x2eb938[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](function(_0x366fb2){return db[_0x588f('0x7c')][_0x588f('0x6c')](function(_0x381920){return _0x366fb2[_0x588f('0x85')](_0x2eb938[_0x588f('0x35')][_0x588f('0x66')],{'transaction':_0x381920})[_0x588f('0x25')](function(){if(!_[_0x588f('0x86')](_0x2f04ca)){return _0x366fb2[_0x588f('0x87')](_0x2f04ca,{'transaction':_0x381920});}})['then'](function(){_0x2f04ca[_0x588f('0x6e')](function(_0x4fa751){socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':_0x4fa751,'MailQueueId':_0x366fb2['id']});});});});});});})[_0x588f('0x25')](respondWithStatusCode(_0x4ef4ef,null))[_0x588f('0x4a')](handleError(_0x4ef4ef,null));};exports[_0x588f('0x89')]=function(_0x455d47,_0x395265,_0x54006d){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x455d47[_0x588f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x395265,null))[_0x588f('0x25')](function(_0x233797){if(_0x233797){return _0x233797[_0x588f('0x89')](_0x455d47[_0x588f('0x4e')][_0x588f('0x66')],_[_0x588f('0x8a')](_0x455d47['body'],['ids','id'])||{})[_0x588f('0x8b')](function(_0x324d84){for(var _0x10d627=0x0;_0x10d627<_0x455d47['body'][_0x588f('0x66')][_0x588f('0x3a')];_0x10d627+=0x1){socket[_0x588f('0x6f')](_0x588f('0x70'),{'UserId':Number(_0x455d47[_0x588f('0x4e')]['ids'][_0x10d627]),'MailQueueId':Number(_0x455d47['params']['id'])});}return _0x324d84;});}})[_0x588f('0x25')](respondWithResult(_0x395265,null))[_0x588f('0x4a')](handleError(_0x395265,null));};exports[_0x588f('0x87')]=function(_0x2385a8,_0x59e203,_0x26b34b){return db[_0x588f('0x2f')][_0x588f('0x53')]({'where':{'id':_0x2385a8['params']['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x59e203,null))[_0x588f('0x25')](function(_0x5e2178){if(_0x5e2178){return _0x5e2178['removeAgents'](_0x2385a8[_0x588f('0x35')][_0x588f('0x66')])[_0x588f('0x25')](function(){if(_[_0x588f('0x8c')](_0x2385a8['query'][_0x588f('0x66')])){for(var _0x10eb9d=0x0;_0x10eb9d<_0x2385a8[_0x588f('0x35')][_0x588f('0x66')][_0x588f('0x3a')];_0x10eb9d+=0x1){socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':Number(_0x2385a8[_0x588f('0x35')][_0x588f('0x66')][_0x10eb9d]),'MailQueueId':Number(_0x2385a8[_0x588f('0x4c')]['id'])});}}else{socket[_0x588f('0x6f')](_0x588f('0x88'),{'UserId':Number(_0x2385a8['query'][_0x588f('0x66')]),'MailQueueId':Number(_0x2385a8[_0x588f('0x4c')]['id'])});}});}})[_0x588f('0x25')](respondWithStatusCode(_0x59e203,null))[_0x588f('0x4a')](handleError(_0x59e203,null));};exports[_0x588f('0x8d')]=function(_0x537eb6,_0x3ff933,_0x30fa90){var _0x383d1f={};var _0x5e1f2c={};var _0x1e05ba;var _0x56e545;return db[_0x588f('0x2f')][_0x588f('0x56')]({'where':{'id':_0x537eb6[_0x588f('0x4c')]['id']}})[_0x588f('0x25')](handleEntityNotFound(_0x3ff933,null))[_0x588f('0x25')](function(_0x3d5503){if(_0x3d5503){_0x1e05ba=_0x3d5503;_0x5e1f2c[_0x588f('0x33')]=_['keys'](db[_0x588f('0x59')][_0x588f('0x30')]);_0x5e1f2c[_0x588f('0x35')]=_[_0x588f('0x36')](_0x537eb6[_0x588f('0x35')]);_0x5e1f2c['filters']=_[_0x588f('0x37')](_0x5e1f2c[_0x588f('0x33')],_0x5e1f2c[_0x588f('0x35')]);_0x383d1f['attributes']=_[_0x588f('0x37')](_0x5e1f2c[_0x588f('0x33')],qs[_0x588f('0x38')](_0x537eb6['query'][_0x588f('0x38')]));_0x383d1f[_0x588f('0x39')]=_0x383d1f[_0x588f('0x39')][_0x588f('0x3a')]?_0x383d1f[_0x588f('0x39')]:_0x5e1f2c[_0x588f('0x33')];_0x383d1f[_0x588f('0x3d')]=qs['sort'](_0x537eb6[_0x588f('0x35')][_0x588f('0x3e')]);_0x383d1f[_0x588f('0x42')]=qs[_0x588f('0x40')](_[_0x588f('0x3f')](_0x537eb6['query'],_0x5e1f2c['filters']));if(_0x537eb6[_0x588f('0x35')][_0x588f('0x41')]){_0x383d1f['where']=_['merge'](_0x383d1f[_0x588f('0x42')],{'$or':_[_0x588f('0x2e')](_0x383d1f[_0x588f('0x39')],function(_0x199a4c){var _0x44e96b={};_0x44e96b[_0x199a4c]={'$like':'%'+_0x537eb6['query'][_0x588f('0x41')]+'%'};return _0x44e96b;})});}_0x383d1f=_[_0x588f('0x43')]({},_0x383d1f,_0x537eb6['options']);return _0x1e05ba[_0x588f('0x8d')](_0x383d1f);}})[_0x588f('0x25')](function(_0x36cae9){if(_0x36cae9){_0x56e545=_0x36cae9[_0x588f('0x3a')];if(!_0x537eb6[_0x588f('0x35')]['hasOwnProperty'](_0x588f('0x3c'))){_0x383d1f[_0x588f('0x1f')]=qs[_0x588f('0x1f')](_0x537eb6[_0x588f('0x35')][_0x588f('0x1f')]);_0x383d1f[_0x588f('0x1e')]=qs[_0x588f('0x1e')](_0x537eb6['query']['offset']);}return _0x1e05ba[_0x588f('0x8d')](_0x383d1f);}})['then'](function(_0x2c21bb){if(_0x2c21bb){return _0x2c21bb?{'count':_0x56e545,'rows':_0x2c21bb}:null;}})[_0x588f('0x25')](respondWithResult(_0x3ff933,null))[_0x588f('0x4a')](handleError(_0x3ff933,null));}; \ No newline at end of file +var _0x07c3=['isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','body','describe','getMembers','findOne','order','UserMailQueue','findAll','UserId','mailPause','updatedAt','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x07c3,0x1bf));var _0x307c=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x07c3[_0x3902c1];return _0x1266cc;};'use strict';var emlformat=require(_0x307c('0x0'));var rimraf=require(_0x307c('0x1'));var zipdir=require(_0x307c('0x2'));var jsonpatch=require(_0x307c('0x3'));var rp=require(_0x307c('0x4'));var moment=require(_0x307c('0x5'));var BPromise=require(_0x307c('0x6'));var Mustache=require(_0x307c('0x7'));var util=require('util');var path=require(_0x307c('0x8'));var sox=require(_0x307c('0x9'));var csv=require(_0x307c('0xa'));var ejs=require(_0x307c('0xb'));var fs=require('fs');var fs_extra=require(_0x307c('0xc'));var _=require(_0x307c('0xd'));var squel=require(_0x307c('0xe'));var crypto=require(_0x307c('0xf'));var jsforce=require(_0x307c('0x10'));var deskjs=require(_0x307c('0x11'));var toCsv=require(_0x307c('0xa'));var querystring=require(_0x307c('0x12'));var Papa=require(_0x307c('0x13'));var Redis=require(_0x307c('0x14'));var authService=require(_0x307c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x307c('0x16'));var hardwareService=require(_0x307c('0x17'));var logger=require(_0x307c('0x18'))(_0x307c('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x307c('0x1a'));var db=require('../../mysqldb')['db'];config[_0x307c('0x1b')]=_[_0x307c('0x1c')](config['redis'],{'host':_0x307c('0x1d'),'port':0x18eb});var socket=require(_0x307c('0x1e'))(new Redis(config[_0x307c('0x1b')]));require(_0x307c('0x1f'))[_0x307c('0x20')](socket);function respondWithStatusCode(_0x2ea8c3,_0x85509f){_0x85509f=_0x85509f||0xcc;return function(_0x46c5d8){if(_0x46c5d8){return _0x2ea8c3[_0x307c('0x21')](_0x85509f);}return _0x2ea8c3[_0x307c('0x22')](_0x85509f)[_0x307c('0x23')]();};}function respondWithResult(_0x424a74,_0x53e2f4){_0x53e2f4=_0x53e2f4||0xc8;return function(_0x2a3edc){if(_0x2a3edc){return _0x424a74[_0x307c('0x22')](_0x53e2f4)[_0x307c('0x24')](_0x2a3edc);}};}function respondWithFilteredResult(_0x2f44ce,_0x301e1a){return function(_0x2e21a6){if(_0x2e21a6){var _0x3e05e2=typeof _0x301e1a[_0x307c('0x25')]===_0x307c('0x26')&&typeof _0x301e1a['limit']==='undefined';var _0x3bbb1e=_0x2e21a6['count'];var _0x409e5b=_0x3e05e2?0x0:_0x301e1a['offset'];var _0x4cf649=_0x3e05e2?_0x2e21a6[_0x307c('0x27')]:_0x301e1a[_0x307c('0x25')]+_0x301e1a['limit'];var _0x2b07da;if(_0x4cf649>=_0x3bbb1e){_0x4cf649=_0x3bbb1e;_0x2b07da=0xc8;}else{_0x2b07da=0xce;}_0x2f44ce[_0x307c('0x22')](_0x2b07da);return _0x2f44ce['set'](_0x307c('0x28'),_0x409e5b+'-'+_0x4cf649+'/'+_0x3bbb1e)[_0x307c('0x24')](_0x2e21a6);}return null;};}function patchUpdates(_0x574622){return function(_0x2d4d18){try{jsonpatch[_0x307c('0x29')](_0x2d4d18,_0x574622,!![]);}catch(_0x9a66a0){return BPromise[_0x307c('0x2a')](_0x9a66a0);}return _0x2d4d18[_0x307c('0x2b')]();};}function saveUpdates(_0x2b5f2f,_0x46b8a8){return function(_0x383065){if(_0x383065){return _0x383065[_0x307c('0x2c')](_0x2b5f2f)[_0x307c('0x2d')](function(_0x5da864){return _0x5da864;});}return null;};}function removeEntity(_0x44dcce,_0x58c383){return function(_0x598d43){if(_0x598d43){return _0x598d43[_0x307c('0x2e')]()[_0x307c('0x2d')](function(){var _0x9da210=_0x598d43[_0x307c('0x2f')]({'plain':!![]});var _0x25dede=_0x307c('0x30');return db['UserProfileResource'][_0x307c('0x2e')]({'where':{'type':_0x25dede,'resourceId':_0x9da210['id']}})[_0x307c('0x2d')](function(){return _0x598d43;});})[_0x307c('0x2d')](function(){_0x44dcce['status'](0xcc)[_0x307c('0x23')]();});}};}function handleEntityNotFound(_0x1781ab,_0xcb6ae6){return function(_0x12d9a9){if(!_0x12d9a9){_0x1781ab[_0x307c('0x21')](0x194);}return _0x12d9a9;};}function handleError(_0x1e5da0,_0x533008){_0x533008=_0x533008||0x1f4;return function(_0x1203f6){logger[_0x307c('0x31')](_0x1203f6[_0x307c('0x32')]);if(_0x1203f6[_0x307c('0x33')]){delete _0x1203f6[_0x307c('0x33')];}_0x1e5da0[_0x307c('0x22')](_0x533008)[_0x307c('0x34')](_0x1203f6);};}exports[_0x307c('0x35')]=function(_0x12b5f4,_0x55f4c0){var _0x29c0c4={},_0x1985fb={},_0x325961={'count':0x0,'rows':[]};var _0x1a706a=_[_0x307c('0x36')](db[_0x307c('0x37')][_0x307c('0x38')],function(_0xc08363){return{'name':_0xc08363[_0x307c('0x39')],'type':_0xc08363[_0x307c('0x3a')][_0x307c('0x3b')]};});_0x1985fb['model']=_[_0x307c('0x36')](_0x1a706a,_0x307c('0x33'));_0x1985fb['query']=_[_0x307c('0x3c')](_0x12b5f4[_0x307c('0x3d')]);_0x1985fb['filters']=_[_0x307c('0x3e')](_0x1985fb['model'],_0x1985fb[_0x307c('0x3d')]);_0x29c0c4[_0x307c('0x3f')]=_[_0x307c('0x3e')](_0x1985fb[_0x307c('0x40')],qs[_0x307c('0x41')](_0x12b5f4[_0x307c('0x3d')][_0x307c('0x41')]));_0x29c0c4['attributes']=_0x29c0c4[_0x307c('0x3f')][_0x307c('0x42')]?_0x29c0c4[_0x307c('0x3f')]:_0x1985fb[_0x307c('0x40')];if(!_0x12b5f4[_0x307c('0x3d')][_0x307c('0x43')](_0x307c('0x44'))){_0x29c0c4['limit']=qs['limit'](_0x12b5f4['query'][_0x307c('0x45')]);_0x29c0c4[_0x307c('0x25')]=qs[_0x307c('0x25')](_0x12b5f4['query'][_0x307c('0x25')]);}_0x29c0c4['order']=qs[_0x307c('0x46')](_0x12b5f4[_0x307c('0x3d')][_0x307c('0x46')]);_0x29c0c4[_0x307c('0x47')]=qs[_0x307c('0x48')](_[_0x307c('0x49')](_0x12b5f4[_0x307c('0x3d')],_0x1985fb[_0x307c('0x48')]),_0x1a706a);if(_0x12b5f4['query'][_0x307c('0x4a')]){_0x29c0c4['where']=_[_0x307c('0x4b')](_0x29c0c4['where'],{'$or':_[_0x307c('0x36')](_0x1a706a,function(_0x4a802a){if(_0x4a802a[_0x307c('0x3a')]!==_0x307c('0x4c')){var _0xb56d3b={};_0xb56d3b[_0x4a802a[_0x307c('0x33')]]={'$like':'%'+_0x12b5f4[_0x307c('0x3d')][_0x307c('0x4a')]+'%'};return _0xb56d3b;}})});}_0x29c0c4=_[_0x307c('0x4b')]({},_0x29c0c4,_0x12b5f4[_0x307c('0x4d')]);var _0xaa4479={'where':_0x29c0c4[_0x307c('0x47')]};return db['MailQueue']['count'](_0xaa4479)[_0x307c('0x2d')](function(_0x264aa8){_0x325961[_0x307c('0x27')]=_0x264aa8;if(_0x12b5f4[_0x307c('0x3d')][_0x307c('0x4e')]){_0x29c0c4[_0x307c('0x4f')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x29c0c4);})[_0x307c('0x2d')](function(_0x5d7d0d){_0x325961[_0x307c('0x50')]=_0x5d7d0d;return _0x325961;})[_0x307c('0x2d')](respondWithFilteredResult(_0x55f4c0,_0x29c0c4))[_0x307c('0x51')](handleError(_0x55f4c0,null));};exports['show']=function(_0x19f170,_0x440999){var _0x225cfb={'raw':!![],'where':{'id':_0x19f170[_0x307c('0x52')]['id']}},_0xb719d2={};_0xb719d2['model']=_[_0x307c('0x3c')](db[_0x307c('0x37')]['rawAttributes']);_0xb719d2[_0x307c('0x3d')]=_[_0x307c('0x3c')](_0x19f170[_0x307c('0x3d')]);_0xb719d2[_0x307c('0x48')]=_[_0x307c('0x3e')](_0xb719d2[_0x307c('0x40')],_0xb719d2[_0x307c('0x3d')]);_0x225cfb['attributes']=_[_0x307c('0x3e')](_0xb719d2[_0x307c('0x40')],qs[_0x307c('0x41')](_0x19f170['query'][_0x307c('0x41')]));_0x225cfb[_0x307c('0x3f')]=_0x225cfb[_0x307c('0x3f')][_0x307c('0x42')]?_0x225cfb['attributes']:_0xb719d2[_0x307c('0x40')];if(_0x19f170['query']['includeAll']){_0x225cfb['include']=[{'all':!![]}];}_0x225cfb=_[_0x307c('0x4b')]({},_0x225cfb,_0x19f170[_0x307c('0x4d')]);return db[_0x307c('0x37')][_0x307c('0x53')](_0x225cfb)['then'](handleEntityNotFound(_0x440999,null))[_0x307c('0x2d')](respondWithResult(_0x440999,null))[_0x307c('0x51')](handleError(_0x440999,null));};exports[_0x307c('0x54')]=function(_0x2776b8,_0x136c17){return db[_0x307c('0x37')][_0x307c('0x54')](_0x2776b8['body'],{})['then'](function(_0x1f41c9){var _0x424a92=_0x2776b8[_0x307c('0x55')][_0x307c('0x2f')]({'plain':!![]});if(!_0x424a92)throw new Error(_0x307c('0x56'));if(_0x424a92[_0x307c('0x57')]===_0x307c('0x55')){var _0x58e3ff=_0x1f41c9['get']({'plain':!![]});var _0x4540d1=_0x307c('0x30');return db[_0x307c('0x58')][_0x307c('0x53')]({'where':{'name':_0x4540d1,'userProfileId':_0x424a92[_0x307c('0x59')]},'raw':!![]})['then'](function(_0x4792a7){if(_0x4792a7&&_0x4792a7['autoAssociation']===0x0){return db[_0x307c('0x5a')][_0x307c('0x54')]({'name':_0x58e3ff['name'],'resourceId':_0x58e3ff['id'],'type':_0x4792a7[_0x307c('0x33')],'sectionId':_0x4792a7['id']},{})[_0x307c('0x2d')](function(){return _0x1f41c9;});}else{return _0x1f41c9;}})[_0x307c('0x51')](function(_0x561d02){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x561d02);throw _0x561d02;});}return _0x1f41c9;})[_0x307c('0x2d')](respondWithResult(_0x136c17,0xc9))[_0x307c('0x51')](handleError(_0x136c17,null));};exports['update']=function(_0x47a8fe,_0x46b41e){if(_0x47a8fe[_0x307c('0x5b')]['id']){delete _0x47a8fe['body']['id'];}return db[_0x307c('0x37')][_0x307c('0x53')]({'where':{'id':_0x47a8fe[_0x307c('0x52')]['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x46b41e,null))['then'](saveUpdates(_0x47a8fe[_0x307c('0x5b')],null))[_0x307c('0x2d')](respondWithResult(_0x46b41e,null))[_0x307c('0x51')](handleError(_0x46b41e,null));};exports[_0x307c('0x2e')]=function(_0x26a533,_0x2420af){return db[_0x307c('0x37')][_0x307c('0x53')]({'where':{'id':_0x26a533['params']['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x2420af,null))[_0x307c('0x2d')](removeEntity(_0x2420af,null))[_0x307c('0x51')](handleError(_0x2420af,null));};exports['describe']=function(_0x10efed,_0xe1ddea){return db[_0x307c('0x37')][_0x307c('0x5c')]()['then'](respondWithResult(_0xe1ddea,null))['catch'](handleError(_0xe1ddea,null));};exports[_0x307c('0x5d')]=function(_0x3ce94c,_0x5d1783,_0x48d721){var _0x5b00c2={'raw':!![],'where':{}},_0x2bc93a={},_0x3b68d2;return db[_0x307c('0x37')][_0x307c('0x5e')]({'where':{'id':_0x3ce94c[_0x307c('0x52')]['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x5d1783,null))['then'](function(_0x25da39){if(_0x25da39){_0x3b68d2=_0x25da39[_0x307c('0x2f')]({'plain':!![]});_0x2bc93a[_0x307c('0x40')]=_[_0x307c('0x3c')](db['UserMailQueue'][_0x307c('0x38')]);_0x2bc93a['query']=_[_0x307c('0x3c')](_0x3ce94c[_0x307c('0x3d')]);_0x2bc93a['filters']=_[_0x307c('0x3e')](_0x2bc93a['model'],_0x2bc93a[_0x307c('0x3d')]);_0x5b00c2[_0x307c('0x3f')]=_['intersection'](_0x2bc93a[_0x307c('0x40')],qs[_0x307c('0x41')](_0x3ce94c[_0x307c('0x3d')]['fields']));_0x5b00c2['attributes']=_0x5b00c2['attributes'][_0x307c('0x42')]?_0x5b00c2[_0x307c('0x3f')]:_0x2bc93a['model'];if(!_0x3ce94c[_0x307c('0x3d')][_0x307c('0x43')]('nolimit')){_0x5b00c2['limit']=qs[_0x307c('0x45')](_0x3ce94c['query'][_0x307c('0x45')]);_0x5b00c2['offset']=qs[_0x307c('0x25')](_0x3ce94c['query'][_0x307c('0x25')]);}_0x5b00c2[_0x307c('0x5f')]=qs['sort'](_0x3ce94c[_0x307c('0x3d')][_0x307c('0x46')]);_0x5b00c2['where']=qs['filters'](_['pick'](_0x3ce94c[_0x307c('0x3d')],_0x2bc93a[_0x307c('0x48')]));_0x5b00c2[_0x307c('0x47')]['MailQueueId']=_0x25da39['id'];if(_0x3ce94c[_0x307c('0x3d')][_0x307c('0x4a')]){_0x5b00c2[_0x307c('0x47')]=_[_0x307c('0x4b')](_0x5b00c2[_0x307c('0x47')],{'$or':_[_0x307c('0x36')](_0x5b00c2[_0x307c('0x3f')],function(_0x33c60e){var _0x43649f={};_0x43649f[_0x33c60e]={'$like':'%'+_0x3ce94c[_0x307c('0x3d')]['filter']+'%'};return _0x43649f;})});}_0x5b00c2=_['merge']({},_0x5b00c2,_0x3ce94c[_0x307c('0x4d')]);return db[_0x307c('0x60')][_0x307c('0x61')](_0x5b00c2);}})[_0x307c('0x2d')](function(_0x4bee5c){if(_0x4bee5c){return db['User']['findAndCountAll']({'where':{'id':_[_0x307c('0x36')](_0x4bee5c,_0x307c('0x62')),'role':'agent'},'attributes':['id','name',_0x307c('0x63'),_0x307c('0x64'),'createdAt']});}})[_0x307c('0x2d')](function(_0x56eb8e){if(_0x56eb8e){return{'count':_0x56eb8e[_0x307c('0x27')],'rows':_[_0x307c('0x36')](_0x56eb8e['rows'],function(_0x803bbc){return{'membername':_0x803bbc[_0x307c('0x33')],'UserId':_0x803bbc['id'],'queue_name':_0x3b68d2[_0x307c('0x33')],'MailQueueId':_0x3b68d2['id'],'interface':util['format'](_0x307c('0x65'),_0x307c('0x66'),_0x803bbc['name']),'penalty':0x0,'paused':_0x803bbc[_0x307c('0x63')],'createdAt':_0x803bbc[_0x307c('0x67')],'updatedAt':_0x803bbc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x307c('0x2d')](respondWithFilteredResult(_0x5d1783,_0x5b00c2))[_0x307c('0x51')](handleError(_0x5d1783,null));};exports['getTeams']=function(_0xb6692e,_0x5a771e,_0x46853a){var _0x764d61={};var _0x377085={};var _0x4e08c1;var _0x2097a3;return db[_0x307c('0x37')][_0x307c('0x5e')]({'where':{'id':_0xb6692e[_0x307c('0x52')]['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x5a771e,null))[_0x307c('0x2d')](function(_0x39903c){if(_0x39903c){_0x4e08c1=_0x39903c;_0x377085[_0x307c('0x40')]=_[_0x307c('0x3c')](db['Team']['rawAttributes']);_0x377085[_0x307c('0x3d')]=_[_0x307c('0x3c')](_0xb6692e['query']);_0x377085[_0x307c('0x48')]=_[_0x307c('0x3e')](_0x377085[_0x307c('0x40')],_0x377085['query']);_0x764d61['attributes']=_['intersection'](_0x377085[_0x307c('0x40')],qs[_0x307c('0x41')](_0xb6692e[_0x307c('0x3d')][_0x307c('0x41')]));_0x764d61[_0x307c('0x3f')]=_0x764d61['attributes'][_0x307c('0x42')]?_0x764d61[_0x307c('0x3f')]:_0x377085['model'];_0x764d61['order']=qs[_0x307c('0x46')](_0xb6692e[_0x307c('0x3d')][_0x307c('0x46')]);_0x764d61[_0x307c('0x47')]=qs['filters'](_[_0x307c('0x49')](_0xb6692e[_0x307c('0x3d')],_0x377085['filters']));if(_0xb6692e[_0x307c('0x3d')][_0x307c('0x4a')]){_0x764d61['where']=_[_0x307c('0x4b')](_0x764d61[_0x307c('0x47')],{'$or':_['map'](_0x764d61['attributes'],function(_0x5317ef){var _0x351bb5={};_0x351bb5[_0x5317ef]={'$like':'%'+_0xb6692e[_0x307c('0x3d')][_0x307c('0x4a')]+'%'};return _0x351bb5;})});}_0x764d61=_[_0x307c('0x4b')]({},_0x764d61,_0xb6692e['options']);return _0x4e08c1['getTeams'](_0x764d61);}})[_0x307c('0x2d')](function(_0x503c66){if(_0x503c66){_0x2097a3=_0x503c66['length'];if(!_0xb6692e[_0x307c('0x3d')][_0x307c('0x43')]('nolimit')){_0x764d61['limit']=qs[_0x307c('0x45')](_0xb6692e['query'][_0x307c('0x45')]);_0x764d61[_0x307c('0x25')]=qs[_0x307c('0x25')](_0xb6692e['query']['offset']);}return _0x4e08c1[_0x307c('0x68')](_0x764d61);}})[_0x307c('0x2d')](function(_0x12a96f){if(_0x12a96f){return _0x12a96f?{'count':_0x2097a3,'rows':_0x12a96f}:null;}})[_0x307c('0x2d')](respondWithResult(_0x5a771e,null))[_0x307c('0x51')](handleError(_0x5a771e,null));};exports[_0x307c('0x69')]=function(_0x4ad8cf,_0x450a65,_0x2208c7){var _0x347175=_0x4ad8cf[_0x307c('0x5b')][_0x307c('0x6a')];return db[_0x307c('0x6b')][_0x307c('0x61')]({'where':{'id':_0x347175},'attributes':['id'],'include':[{'model':db[_0x307c('0x6c')],'as':'Agents','attributes':['id',_0x307c('0x33'),_0x307c('0x6d'),_0x307c('0x6e'),_0x307c('0x6f')],'raw':!![]}]})[_0x307c('0x2d')](function(_0x2744af){if(_0x2744af){var _0x4cedbf=_[_0x307c('0x70')](_0x2744af,function(_0x3c55f5){var _0x962a51=_0x3c55f5[_0x307c('0x2f')]({'plain':!![]});return _0x962a51[_0x307c('0x71')];});return db[_0x307c('0x37')]['find']({'where':{'id':_0x4ad8cf[_0x307c('0x52')]['id']}})[_0x307c('0x2d')](function(_0x33eb31){return db[_0x307c('0x72')][_0x307c('0x73')](function(_0x24468d){return _0x33eb31[_0x307c('0x69')](_0x347175,{'transaction':_0x24468d})['then'](function(){return BPromise['each'](_0x4cedbf,function(_0x477a6c){return db[_0x307c('0x60')][_0x307c('0x74')]({'where':{'UserId':_0x477a6c['id'],'MailQueueId':_0x4ad8cf[_0x307c('0x52')]['id']},'transaction':_0x24468d});});})['then'](function(){_0x4cedbf[_0x307c('0x75')](function(_0x511704){socket[_0x307c('0x76')](_0x307c('0x77'),{'UserId':_0x511704['id'],'MailQueueId':_0x33eb31['id']});});});});});}})[_0x307c('0x2d')](respondWithStatusCode(_0x450a65,null))['catch'](handleError(_0x450a65,null));};exports[_0x307c('0x78')]=function(_0x4cfdd5,_0x4bf4e6,_0xd0bd4c){return db['Team'][_0x307c('0x61')]({'where':{'id':_0x4cfdd5[_0x307c('0x3d')][_0x307c('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x307c('0x6c')],'as':_0x307c('0x71'),'attributes':['id'],'raw':!![]}]})[_0x307c('0x2d')](handleEntityNotFound(_0x4bf4e6,null))[_0x307c('0x2d')](function(_0x187dc1){var _0x3c8f41=_[_0x307c('0x36')](_0x187dc1,'id');var _0x2b494a=[];var _0x455745=[];var _0x314082=squel[_0x307c('0x79')]();_0x314082[_0x307c('0x7a')](_0x307c('0x7b'))[_0x307c('0x7c')](_0x307c('0x7d'),'tq')[_0x307c('0x7e')](_0x307c('0x7f'),'ut',_0x307c('0x80'))[_0x307c('0x47')](_0x307c('0x81'),_0x4cfdd5[_0x307c('0x52')]['id']);for(var _0x5bc613=0x0;_0x5bc613<_0x187dc1[_0x307c('0x42')];_0x5bc613+=0x1){let _0x194f5c=_0x187dc1[_0x5bc613];for(var _0x79822f=0x0;_0x79822f<_0x194f5c['Agents'][_0x307c('0x42')];_0x79822f+=0x1){let _0x56a740=_0x194f5c[_0x307c('0x71')][_0x79822f];var _0x3ee4fc=_0x314082['clone']();_0x3ee4fc[_0x307c('0x47')](_0x307c('0x82'),_0x56a740['id']);_0x455745[_0x307c('0x83')](db[_0x307c('0x72')]['query'](_0x3ee4fc[_0x307c('0x84')](),{'type':db[_0x307c('0x72')][_0x307c('0x85')]['SELECT']})[_0x307c('0x2d')](function(_0x115c0b){if(_0x115c0b[_0x307c('0x42')]===0x1){return _0x56a740['id'];}else{var _0x2b59d6=_[_0x307c('0x86')](_[_0x307c('0x36')](_0x115c0b,_0x307c('0x87')),function(_0x1510d4){return _[_0x307c('0x88')](_0x3c8f41,_0x1510d4);});if(_0x2b59d6){return _0x56a740['id'];}}}));}}return BPromise['all'](_0x455745)[_0x307c('0x2d')](function(_0x3bd78d){_0x2b494a=_(_0x2b494a)[_0x307c('0x89')](_0x3bd78d)[_0x307c('0x8a')]()[_0x307c('0x8b')]();return db[_0x307c('0x37')][_0x307c('0x53')]({'where':{'id':_0x4cfdd5[_0x307c('0x52')]['id']}})['then'](function(_0x19c715){return db['sequelize'][_0x307c('0x73')](function(_0x4a7679){return _0x19c715['removeTeams'](_0x4cfdd5['query'][_0x307c('0x6a')],{'transaction':_0x4a7679})['then'](function(){if(!_[_0x307c('0x8c')](_0x2b494a)){return _0x19c715[_0x307c('0x8d')](_0x2b494a,{'transaction':_0x4a7679});}})[_0x307c('0x2d')](function(){_0x2b494a[_0x307c('0x75')](function(_0x1b6e7c){socket['emit']('userMailQueue:remove',{'UserId':_0x1b6e7c,'MailQueueId':_0x19c715['id']});});});});});});})[_0x307c('0x2d')](respondWithStatusCode(_0x4bf4e6,null))[_0x307c('0x51')](handleError(_0x4bf4e6,null));};exports[_0x307c('0x8e')]=function(_0xd19d54,_0x5b00a2,_0x163093){return db[_0x307c('0x37')]['find']({'where':{'id':_0xd19d54[_0x307c('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b00a2,null))[_0x307c('0x2d')](function(_0xfb026a){if(_0xfb026a){return _0xfb026a[_0x307c('0x8e')](_0xd19d54[_0x307c('0x5b')]['ids'],_[_0x307c('0x8f')](_0xd19d54[_0x307c('0x5b')],[_0x307c('0x6a'),'id'])||{})[_0x307c('0x90')](function(_0x568ad1){for(var _0x230434=0x0;_0x230434<_0xd19d54['body'][_0x307c('0x6a')][_0x307c('0x42')];_0x230434+=0x1){socket['emit'](_0x307c('0x77'),{'UserId':Number(_0xd19d54[_0x307c('0x5b')][_0x307c('0x6a')][_0x230434]),'MailQueueId':Number(_0xd19d54[_0x307c('0x52')]['id'])});}return _0x568ad1;});}})[_0x307c('0x2d')](respondWithResult(_0x5b00a2,null))[_0x307c('0x51')](handleError(_0x5b00a2,null));};exports[_0x307c('0x8d')]=function(_0x2e2506,_0x284f71,_0x39cd36){return db[_0x307c('0x37')][_0x307c('0x53')]({'where':{'id':_0x2e2506['params']['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x284f71,null))[_0x307c('0x2d')](function(_0xa714a0){if(_0xa714a0){return _0xa714a0[_0x307c('0x8d')](_0x2e2506[_0x307c('0x3d')][_0x307c('0x6a')])['then'](function(){if(_[_0x307c('0x91')](_0x2e2506['query']['ids'])){for(var _0x4f07e5=0x0;_0x4f07e5<_0x2e2506[_0x307c('0x3d')][_0x307c('0x6a')][_0x307c('0x42')];_0x4f07e5+=0x1){socket[_0x307c('0x76')]('userMailQueue:remove',{'UserId':Number(_0x2e2506[_0x307c('0x3d')][_0x307c('0x6a')][_0x4f07e5]),'MailQueueId':Number(_0x2e2506['params']['id'])});}}else{socket[_0x307c('0x76')](_0x307c('0x92'),{'UserId':Number(_0x2e2506[_0x307c('0x3d')][_0x307c('0x6a')]),'MailQueueId':Number(_0x2e2506[_0x307c('0x52')]['id'])});}});}})[_0x307c('0x2d')](respondWithStatusCode(_0x284f71,null))['catch'](handleError(_0x284f71,null));};exports[_0x307c('0x93')]=function(_0x32ce4e,_0x18a677,_0x1eb209){var _0x522550={};var _0x4467b8={};var _0x26f09f;var _0x2e6d37;return db['MailQueue'][_0x307c('0x5e')]({'where':{'id':_0x32ce4e[_0x307c('0x52')]['id']}})[_0x307c('0x2d')](handleEntityNotFound(_0x18a677,null))[_0x307c('0x2d')](function(_0x25d17a){if(_0x25d17a){_0x26f09f=_0x25d17a;_0x4467b8[_0x307c('0x40')]=_[_0x307c('0x3c')](db[_0x307c('0x6c')][_0x307c('0x38')]);_0x4467b8[_0x307c('0x3d')]=_[_0x307c('0x3c')](_0x32ce4e[_0x307c('0x3d')]);_0x4467b8['filters']=_[_0x307c('0x3e')](_0x4467b8[_0x307c('0x40')],_0x4467b8[_0x307c('0x3d')]);_0x522550[_0x307c('0x3f')]=_[_0x307c('0x3e')](_0x4467b8[_0x307c('0x40')],qs[_0x307c('0x41')](_0x32ce4e[_0x307c('0x3d')][_0x307c('0x41')]));_0x522550['attributes']=_0x522550[_0x307c('0x3f')][_0x307c('0x42')]?_0x522550[_0x307c('0x3f')]:_0x4467b8['model'];_0x522550['order']=qs[_0x307c('0x46')](_0x32ce4e[_0x307c('0x3d')][_0x307c('0x46')]);_0x522550[_0x307c('0x47')]=qs['filters'](_['pick'](_0x32ce4e[_0x307c('0x3d')],_0x4467b8[_0x307c('0x48')]));if(_0x32ce4e['query'][_0x307c('0x4a')]){_0x522550[_0x307c('0x47')]=_[_0x307c('0x4b')](_0x522550[_0x307c('0x47')],{'$or':_[_0x307c('0x36')](_0x522550[_0x307c('0x3f')],function(_0x266e82){var _0x95a261={};_0x95a261[_0x266e82]={'$like':'%'+_0x32ce4e[_0x307c('0x3d')][_0x307c('0x4a')]+'%'};return _0x95a261;})});}_0x522550=_['merge']({},_0x522550,_0x32ce4e[_0x307c('0x4d')]);return _0x26f09f['getAgents'](_0x522550);}})[_0x307c('0x2d')](function(_0xabaec9){if(_0xabaec9){_0x2e6d37=_0xabaec9[_0x307c('0x42')];if(!_0x32ce4e[_0x307c('0x3d')]['hasOwnProperty'](_0x307c('0x44'))){_0x522550[_0x307c('0x45')]=qs[_0x307c('0x45')](_0x32ce4e[_0x307c('0x3d')][_0x307c('0x45')]);_0x522550[_0x307c('0x25')]=qs[_0x307c('0x25')](_0x32ce4e['query']['offset']);}return _0x26f09f[_0x307c('0x93')](_0x522550);}})[_0x307c('0x2d')](function(_0x4b90b0){if(_0x4b90b0){return _0x4b90b0?{'count':_0x2e6d37,'rows':_0x4b90b0}:null;}})[_0x307c('0x2d')](respondWithResult(_0x18a677,null))[_0x307c('0x51')](handleError(_0x18a677,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 3ae49a2..f7db866 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 _0xdf36=['remove','emit','hook','exports','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0xdf36,0x193));var _0x6df3=function(_0x422eef,_0x367e57){_0x422eef=_0x422eef-0x0;var _0x1f8282=_0xdf36[_0x422eef];return _0x1f8282;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x6df3('0x0'))['db'][_0x6df3('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6df3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6df3('0x3')};function emitEvent(_0x3374fb){return function(_0x540d69,_0x22c4dc,_0x532c9f){MailQueueEvents[_0x6df3('0x4')](_0x3374fb+':'+_0x540d69['id'],_0x540d69);MailQueueEvents['emit'](_0x3374fb,_0x540d69);_0x532c9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6df3('0x5')](e,emitEvent(event));}}module[_0x6df3('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x974e=['emit','hasOwnProperty','exports','../../mysqldb','MailQueue','setMaxListeners','update','remove'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x974e,0x1c3));var _0xe974=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x974e[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xe974('0x0'))['db'][_0xe974('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe974('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe974('0x3'),'afterDestroy':_0xe974('0x4')};function emitEvent(_0x1289cb){return function(_0x4b733e,_0x2b7bc6,_0x4859ae){MailQueueEvents[_0xe974('0x5')](_0x1289cb+':'+_0x4b733e['id'],_0x4b733e);MailQueueEvents[_0xe974('0x5')](_0x1289cb,_0x4b733e);_0x4859ae(null);};}for(var e in events){if(events[_0xe974('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xe974('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 7733fdc..d87c155 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 _0xab72=['rimraf','../../config/environment','./mailQueue.attributes','exports','define','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2902cc,_0x4d1d00){var _0x5f418f=function(_0x5e3846){while(--_0x5e3846){_0x2902cc['push'](_0x2902cc['shift']());}};_0x5f418f(++_0x4d1d00);}(_0xab72,0xaa));var _0x2ab7=function(_0x4c2379,_0x278271){_0x4c2379=_0x4c2379-0x0;var _0x543fd5=_0xab72[_0x4c2379];return _0x543fd5;};'use strict';var _=require(_0x2ab7('0x0'));var util=require(_0x2ab7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2ab7('0x2'));var BPromise=require(_0x2ab7('0x3'));var rp=require(_0x2ab7('0x4'));var fs=require('fs');var path=require(_0x2ab7('0x5'));var rimraf=require(_0x2ab7('0x6'));var config=require(_0x2ab7('0x7'));var attributes=require(_0x2ab7('0x8'));module[_0x2ab7('0x9')]=function(_0x5e454b,_0x48e1c3){return _0x5e454b[_0x2ab7('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bf1=['MailQueue','mail_queues','../../config/logger','api','moment','bluebird','rimraf','./mailQueue.attributes','exports'];(function(_0x50eb6f,_0x271730){var _0x584c1a=function(_0x4f94c5){while(--_0x4f94c5){_0x50eb6f['push'](_0x50eb6f['shift']());}};_0x584c1a(++_0x271730);}(_0x8bf1,0x1e8));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x18bf('0x0'))(_0x18bf('0x1'));var moment=require(_0x18bf('0x2'));var BPromise=require(_0x18bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x18bf('0x4'));var config=require('../../config/environment');var attributes=require(_0x18bf('0x5'));module[_0x18bf('0x6')]=function(_0x1b8702,_0x41347c){return _0x1b8702['define'](_0x18bf('0x7'),attributes,{'tableName':_0x18bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index f5dae5d..c8444e4 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 _0x33a4=['redis','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','attributes','then','ShowMailQueue','find','model','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x33a4,0x88));var _0x433a=function(_0x40ffac,_0x1fa7df){_0x40ffac=_0x40ffac-0x0;var _0x2892f9=_0x33a4[_0x40ffac];return _0x2892f9;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var moment=require('moment');var BPromise=require(_0x433a('0x1'));var rs=require(_0x433a('0x2'));var fs=require('fs');var Redis=require(_0x433a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x433a('0x4'));var config=require(_0x433a('0x5'));var jayson=require(_0x433a('0x6'));var client=jayson[_0x433a('0x7')][_0x433a('0x8')]({'port':0x232a});config['redis']=_[_0x433a('0x9')](config['redis'],{'host':_0x433a('0xa'),'port':0x18eb});var socket=require(_0x433a('0xb'))(new Redis(config[_0x433a('0xc')]));require(_0x433a('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ac437,_0x3e52a0,_0x12db5c){return new BPromise(function(_0x19a533,_0x3f4eee){return client[_0x433a('0xe')](_0x4ac437,_0x12db5c)['then'](function(_0x495d26){logger[_0x433a('0xf')](_0x433a('0x10'),_0x3e52a0,_0x433a('0x11'));logger[_0x433a('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3e52a0,_0x433a('0x11'),JSON[_0x433a('0x13')](_0x495d26));if(_0x495d26['error']){if(_0x495d26[_0x433a('0x14')]['code']===0x1f4){logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x495d26[_0x433a('0x14')]['message']);return _0x3f4eee(_0x495d26['error'][_0x433a('0x15')]);}logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x495d26[_0x433a('0x14')][_0x433a('0x15')]);return _0x19a533(_0x495d26['error']['message']);}else{logger[_0x433a('0xf')](_0x433a('0x10'),_0x3e52a0,_0x433a('0x11'));_0x19a533(_0x495d26[_0x433a('0x16')][_0x433a('0x15')]);}})[_0x433a('0x17')](function(_0x35fa83){logger[_0x433a('0x14')](_0x433a('0x10'),_0x3e52a0,_0x35fa83);_0x3f4eee(_0x35fa83);});});}exports[_0x433a('0x18')]=function(_0x36db9f){var _0x5a37ad=this;return new Promise(function(_0xfc331a,_0x566ae7){return db[_0x433a('0x19')]['findAll']({'raw':_0x36db9f[_0x433a('0x1a')]?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1b')]===undefined?!![]:![]:!![],'where':_0x36db9f[_0x433a('0x1a')]?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1c')]||null:null,'attributes':_0x36db9f[_0x433a('0x1a')]?_0x36db9f['options']['attributes']||null:null,'limit':_0x36db9f[_0x433a('0x1a')]?_0x36db9f['options'][_0x433a('0x1d')]||null:null,'include':_0x36db9f['options']?_0x36db9f[_0x433a('0x1a')][_0x433a('0x1e')]?_[_0x433a('0x1f')](_0x36db9f[_0x433a('0x1a')][_0x433a('0x1e')],function(_0xaea8aa){return{'model':db[_0xaea8aa['model']],'as':_0xaea8aa['as'],'attributes':_0xaea8aa[_0x433a('0x20')],'include':_0xaea8aa[_0x433a('0x1e')]?_['map'](_0xaea8aa[_0x433a('0x1e')],function(_0x571461){return{'model':db[_0x571461['model']],'as':_0x571461['as'],'attributes':_0x571461['attributes'],'include':_0x571461[_0x433a('0x1e')]?_['map'](_0x571461[_0x433a('0x1e')],function(_0x499e8c){return{'model':db[_0x499e8c['model']],'as':_0x499e8c['as'],'attributes':_0x499e8c[_0x433a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x433a('0x21')](function(_0x147bb9){logger['info'](_0x433a('0x18'),_0x36db9f);logger[_0x433a('0x12')](_0x433a('0x18'),_0x36db9f,JSON['stringify'](_0x147bb9));_0xfc331a(_0x147bb9);})['catch'](function(_0x713b41){logger[_0x433a('0x14')](_0x433a('0x18'),_0x713b41[_0x433a('0x15')],_0x36db9f);_0x566ae7(_0x5a37ad[_0x433a('0x14')](0x1f4,_0x713b41[_0x433a('0x15')]));});});};exports[_0x433a('0x22')]=function(_0x3b6a19){var _0x5246a6=this;return new Promise(function(_0x3c84cb,_0x2459d7){return db[_0x433a('0x19')][_0x433a('0x23')]({'raw':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1c')]||null:null,'attributes':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19['options'][_0x433a('0x20')]||null:null,'include':_0x3b6a19[_0x433a('0x1a')]?_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1e')]?_[_0x433a('0x1f')](_0x3b6a19[_0x433a('0x1a')][_0x433a('0x1e')],function(_0x367875){return{'model':db[_0x367875[_0x433a('0x24')]],'as':_0x367875['as'],'attributes':_0x367875[_0x433a('0x20')],'include':_0x367875[_0x433a('0x1e')]?_['map'](_0x367875[_0x433a('0x1e')],function(_0x266a9c){return{'model':db[_0x266a9c['model']],'as':_0x266a9c['as'],'attributes':_0x266a9c['attributes'],'include':_0x266a9c[_0x433a('0x1e')]?_['map'](_0x266a9c[_0x433a('0x1e')],function(_0x20fc31){return{'model':db[_0x20fc31[_0x433a('0x24')]],'as':_0x20fc31['as'],'attributes':_0x20fc31['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28a10c){logger[_0x433a('0xf')](_0x433a('0x22'),_0x3b6a19);logger[_0x433a('0x12')](_0x433a('0x22'),_0x3b6a19,JSON[_0x433a('0x13')](_0x28a10c));_0x3c84cb(_0x28a10c);})['catch'](function(_0x4e1cac){logger[_0x433a('0x14')](_0x433a('0x22'),_0x4e1cac['message'],_0x3b6a19);_0x2459d7(_0x5246a6[_0x433a('0x14')](0x1f4,_0x4e1cac[_0x433a('0x15')]));});});}; \ No newline at end of file +var _0x1be9=['limit','include','map','attributes','model','then','ShowMailQueue','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./mailQueue.socket','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw'];(function(_0x244936,_0x2a006c){var _0x2dc452=function(_0x34958c){while(--_0x34958c){_0x244936['push'](_0x244936['shift']());}};_0x2dc452(++_0x2a006c);}(_0x1be9,0x77));var _0x91be=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x1be9[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x91be('0x0'));var util=require(_0x91be('0x1'));var moment=require(_0x91be('0x2'));var BPromise=require(_0x91be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91be('0x5'));var logger=require(_0x91be('0x6'))(_0x91be('0x7'));var config=require(_0x91be('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91be('0x9')]({'port':0x232a});config[_0x91be('0xa')]=_[_0x91be('0xb')](config[_0x91be('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x91be('0xc'))(new Redis(config[_0x91be('0xa')]));require(_0x91be('0xd'))['register'](socket);function respondWithRpcPromise(_0x149863,_0x443f3a,_0x49b087){return new BPromise(function(_0x50468c,_0x32a1c0){return client['request'](_0x149863,_0x49b087)['then'](function(_0x259ffc){logger[_0x91be('0xe')](_0x91be('0xf'),_0x443f3a,_0x91be('0x10'));logger[_0x91be('0x11')](_0x91be('0x12'),_0x443f3a,_0x91be('0x10'),JSON[_0x91be('0x13')](_0x259ffc));if(_0x259ffc['error']){if(_0x259ffc[_0x91be('0x14')][_0x91be('0x15')]===0x1f4){logger[_0x91be('0x14')](_0x91be('0xf'),_0x443f3a,_0x259ffc[_0x91be('0x14')][_0x91be('0x16')]);return _0x32a1c0(_0x259ffc[_0x91be('0x14')][_0x91be('0x16')]);}logger[_0x91be('0x14')](_0x91be('0xf'),_0x443f3a,_0x259ffc[_0x91be('0x14')]['message']);return _0x50468c(_0x259ffc['error']['message']);}else{logger['info'](_0x91be('0xf'),_0x443f3a,_0x91be('0x10'));_0x50468c(_0x259ffc['result'][_0x91be('0x16')]);}})[_0x91be('0x17')](function(_0x2bb874){logger['error'](_0x91be('0xf'),_0x443f3a,_0x2bb874);_0x32a1c0(_0x2bb874);});});}exports[_0x91be('0x18')]=function(_0x1a3592){var _0x1d0697=this;return new Promise(function(_0x3f107a,_0x40be89){return db[_0x91be('0x19')][_0x91be('0x1a')]({'raw':_0x1a3592['options']?_0x1a3592[_0x91be('0x1b')][_0x91be('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a3592['options']?_0x1a3592[_0x91be('0x1b')]['where']||null:null,'attributes':_0x1a3592[_0x91be('0x1b')]?_0x1a3592['options']['attributes']||null:null,'limit':_0x1a3592['options']?_0x1a3592[_0x91be('0x1b')][_0x91be('0x1d')]||null:null,'include':_0x1a3592[_0x91be('0x1b')]?_0x1a3592[_0x91be('0x1b')][_0x91be('0x1e')]?_[_0x91be('0x1f')](_0x1a3592[_0x91be('0x1b')]['include'],function(_0x546bd5){return{'model':db[_0x546bd5['model']],'as':_0x546bd5['as'],'attributes':_0x546bd5[_0x91be('0x20')],'include':_0x546bd5[_0x91be('0x1e')]?_['map'](_0x546bd5['include'],function(_0x251774){return{'model':db[_0x251774['model']],'as':_0x251774['as'],'attributes':_0x251774[_0x91be('0x20')],'include':_0x251774[_0x91be('0x1e')]?_[_0x91be('0x1f')](_0x251774[_0x91be('0x1e')],function(_0x129ce3){return{'model':db[_0x129ce3[_0x91be('0x21')]],'as':_0x129ce3['as'],'attributes':_0x129ce3[_0x91be('0x20')]};}):[]};}):[]};}):[]:[]})[_0x91be('0x22')](function(_0x497a46){logger['info'](_0x91be('0x18'),_0x1a3592);logger['debug']('GetMailQueue',_0x1a3592,JSON[_0x91be('0x13')](_0x497a46));_0x3f107a(_0x497a46);})[_0x91be('0x17')](function(_0x1f1376){logger[_0x91be('0x14')](_0x91be('0x18'),_0x1f1376[_0x91be('0x16')],_0x1a3592);_0x40be89(_0x1d0697[_0x91be('0x14')](0x1f4,_0x1f1376[_0x91be('0x16')]));});});};exports[_0x91be('0x23')]=function(_0x57b6f9){var _0x2ffe05=this;return new Promise(function(_0x21ef6f,_0x76ce4d){return db[_0x91be('0x19')]['find']({'raw':_0x57b6f9[_0x91be('0x1b')]?_0x57b6f9[_0x91be('0x1b')][_0x91be('0x1c')]===undefined?!![]:![]:!![],'where':_0x57b6f9[_0x91be('0x1b')]?_0x57b6f9[_0x91be('0x1b')][_0x91be('0x24')]||null:null,'attributes':_0x57b6f9[_0x91be('0x1b')]?_0x57b6f9[_0x91be('0x1b')]['attributes']||null:null,'include':_0x57b6f9[_0x91be('0x1b')]?_0x57b6f9['options']['include']?_[_0x91be('0x1f')](_0x57b6f9['options'][_0x91be('0x1e')],function(_0x210f1d){return{'model':db[_0x210f1d[_0x91be('0x21')]],'as':_0x210f1d['as'],'attributes':_0x210f1d['attributes'],'include':_0x210f1d[_0x91be('0x1e')]?_['map'](_0x210f1d[_0x91be('0x1e')],function(_0xcfce17){return{'model':db[_0xcfce17['model']],'as':_0xcfce17['as'],'attributes':_0xcfce17['attributes'],'include':_0xcfce17[_0x91be('0x1e')]?_[_0x91be('0x1f')](_0xcfce17[_0x91be('0x1e')],function(_0x1ba536){return{'model':db[_0x1ba536[_0x91be('0x21')]],'as':_0x1ba536['as'],'attributes':_0x1ba536[_0x91be('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbd844f){logger[_0x91be('0xe')](_0x91be('0x23'),_0x57b6f9);logger[_0x91be('0x11')]('ShowMailQueue',_0x57b6f9,JSON[_0x91be('0x13')](_0xbd844f));_0x21ef6f(_0xbd844f);})['catch'](function(_0x3d0682){logger[_0x91be('0x14')](_0x91be('0x23'),_0x3d0682['message'],_0x57b6f9);_0x76ce4d(_0x2ffe05[_0x91be('0x14')](0x1f4,_0x3d0682[_0x91be('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3eaf13f..0127f07 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 _0x2c05=['removeListener','register','length','./mailQueue.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c05,0xff));var _0x52c0=function(_0x10b418,_0x25b1f2){_0x10b418=_0x10b418-0x0;var _0xd0377f=_0x2c05[_0x10b418];return _0xd0377f;};'use strict';var MailQueueEvents=require(_0x52c0('0x0'));var events=[_0x52c0('0x1'),'remove',_0x52c0('0x2')];function createListener(_0x55a963,_0x5f5cd3){return function(_0x2bc05d){_0x5f5cd3[_0x52c0('0x3')](_0x55a963,_0x2bc05d);};}function removeListener(_0xb41a99,_0x432f70){return function(){MailQueueEvents[_0x52c0('0x4')](_0xb41a99,_0x432f70);};}exports[_0x52c0('0x5')]=function(_0x642719){for(var _0x526ffb=0x0,_0x548f79=events[_0x52c0('0x6')];_0x526ffb<_0x548f79;_0x526ffb++){var _0x332cb4=events[_0x526ffb];var _0x206f02=createListener('mailQueue:'+_0x332cb4,_0x642719);MailQueueEvents['on'](_0x332cb4,_0x206f02);}}; \ No newline at end of file +var _0x33b9=['./mailQueue.events','remove','update','removeListener','register','mailQueue:'];(function(_0x3c0277,_0x39f09d){var _0x369a17=function(_0x40d193){while(--_0x40d193){_0x3c0277['push'](_0x3c0277['shift']());}};_0x369a17(++_0x39f09d);}(_0x33b9,0x1ec));var _0x933b=function(_0x51cda6,_0x2bfdf6){_0x51cda6=_0x51cda6-0x0;var _0x5643c6=_0x33b9[_0x51cda6];return _0x5643c6;};'use strict';var MailQueueEvents=require(_0x933b('0x0'));var events=['save',_0x933b('0x1'),_0x933b('0x2')];function createListener(_0xd9dc68,_0x1f9f3f){return function(_0x5ef16d){_0x1f9f3f['emit'](_0xd9dc68,_0x5ef16d);};}function removeListener(_0x34c69b,_0x3e164f){return function(){MailQueueEvents[_0x933b('0x3')](_0x34c69b,_0x3e164f);};}exports[_0x933b('0x4')]=function(_0x210a1a){for(var _0x5be84d=0x0,_0x3d6d16=events['length'];_0x5be84d<_0x3d6d16;_0x5be84d++){var _0x523ed7=events[_0x5be84d];var _0x2429de=createListener(_0x933b('0x5')+_0x523ed7,_0x210a1a);MailQueueEvents['on'](_0x523ed7,_0x2429de);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 1f429a0..6d5c39b 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 _0x5bef=['/describe','describe','/:id','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x5bef,0x7f));var _0xf5be=function(_0x3c7741,_0xe8c99d){_0x3c7741=_0x3c7741-0x0;var _0x2d9679=_0x5bef[_0x3c7741];return _0x2d9679;};'use strict';var multer=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var path=require(_0xf5be('0x2'));var timeout=require(_0xf5be('0x3'));var express=require(_0xf5be('0x4'));var router=express[_0xf5be('0x5')]();var fs_extra=require(_0xf5be('0x6'));var auth=require(_0xf5be('0x7'));var interaction=require(_0xf5be('0x8'));var config=require(_0xf5be('0x9'));var controller=require('./mailQueueReport.controller');router[_0xf5be('0xa')]('/',auth[_0xf5be('0xb')](),controller[_0xf5be('0xc')]);router[_0xf5be('0xa')](_0xf5be('0xd'),auth[_0xf5be('0xb')](),controller[_0xf5be('0xe')]);router['get'](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['show']);router[_0xf5be('0x10')]('/',auth[_0xf5be('0xb')](),controller['create']);router[_0xf5be('0x11')](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['update']);router[_0xf5be('0x12')](_0xf5be('0xf'),auth[_0xf5be('0xb')](),controller['destroy']);module[_0xf5be('0x13')]=router; \ No newline at end of file +var _0xb672=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x1e7f1a,_0x3f0e05){var _0x3c4af6=function(_0x9c860f){while(--_0x9c860f){_0x1e7f1a['push'](_0x1e7f1a['shift']());}};_0x3c4af6(++_0x3f0e05);}(_0xb672,0x1a7));var _0x2b67=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb672[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var path=require(_0x2b67('0x2'));var timeout=require(_0x2b67('0x3'));var express=require('express');var router=express[_0x2b67('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2b67('0x5'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x2b67('0x6')](),controller[_0x2b67('0x7')]);router[_0x2b67('0x8')](_0x2b67('0x9'),auth[_0x2b67('0x6')](),controller[_0x2b67('0xa')]);router[_0x2b67('0x8')](_0x2b67('0xb'),auth[_0x2b67('0x6')](),controller[_0x2b67('0xc')]);router[_0x2b67('0xd')]('/',auth[_0x2b67('0x6')](),controller['create']);router[_0x2b67('0xe')](_0x2b67('0xb'),auth[_0x2b67('0x6')](),controller[_0x2b67('0xf')]);router[_0x2b67('0x10')](_0x2b67('0xb'),auth[_0x2b67('0x6')](),controller[_0x2b67('0x11')]);module[_0x2b67('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f0f8831..423c91b 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 _0x100a=['moment','sequelize','exports','STRING','DATE'];(function(_0x220719,_0x1cabf9){var _0x28b05e=function(_0x21d4d2){while(--_0x21d4d2){_0x220719['push'](_0x220719['shift']());}};_0x28b05e(++_0x1cabf9);}(_0x100a,0x87));var _0xa100=function(_0x23f948,_0x197541){_0x23f948=_0x23f948-0x0;var _0x4b2c20=_0x100a[_0x23f948];return _0x4b2c20;};'use strict';var moment=require(_0xa100('0x0'));var Sequelize=require(_0xa100('0x1'));module[_0xa100('0x2')]={'uniqueid':{'type':Sequelize[_0xa100('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa100('0x3')]},'joinAt':{'type':Sequelize[_0xa100('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa100('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x441f=['STRING','DATE','moment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x441f,0x16a));var _0xf441=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0x441f[_0x564821];return _0x2b604d;};'use strict';var moment=require(_0xf441('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf441('0x1')]},'joinAt':{'type':Sequelize[_0xf441('0x2')]},'leaveAt':{'type':Sequelize[_0xf441('0x2')]},'acceptAt':{'type':Sequelize[_0xf441('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf441('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 39eb4b3..4b97a4e 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 _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0xacf4,0xe7));var _0x4acf=function(_0x28c6d2,_0xb0d949){_0x28c6d2=_0x28c6d2-0x0;var _0x4cd798=_0xacf4[_0x28c6d2];return _0x4cd798;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['MailQueueReport'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['MailQueueReport']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','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','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x239d4f,_0x17f3b5){var _0x399ee9=function(_0x138d2d){while(--_0x138d2d){_0x239d4f['push'](_0x239d4f['shift']());}};_0x399ee9(++_0x17f3b5);}(_0xadb5,0xad));var _0x5adb=function(_0x477a91,_0x216b2e){_0x477a91=_0x477a91-0x0;var _0x372c4c=_0xadb5[_0x477a91];return _0x372c4c;};'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['MailQueueReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 94b4697..5737d49 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 _0x38d2=['path','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x18894b,_0xb20093){var _0x4b3230=function(_0x434091){while(--_0x434091){_0x18894b['push'](_0x18894b['shift']());}};_0x4b3230(++_0xb20093);}(_0x38d2,0xed));var _0x238d=function(_0x1db84b,_0xe0d0){_0x1db84b=_0x1db84b-0x0;var _0x5392d1=_0x38d2[_0x1db84b];return _0x5392d1;};'use strict';var _=require('lodash');var util=require(_0x238d('0x0'));var logger=require('../../config/logger')(_0x238d('0x1'));var moment=require(_0x238d('0x2'));var BPromise=require(_0x238d('0x3'));var rp=require(_0x238d('0x4'));var fs=require('fs');var path=require(_0x238d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x238d('0x6'));module[_0x238d('0x7')]=function(_0x217454,_0x21ee3e){return _0x217454[_0x238d('0x8')](_0x238d('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x238d('0xa'),'fields':[_0x238d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe49=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x244940,_0x2ef81a){var _0x3d7051=function(_0x5a6ff3){while(--_0x5a6ff3){_0x244940['push'](_0x244940['shift']());}};_0x3d7051(++_0x2ef81a);}(_0xbe49,0xa4));var _0x9be4=function(_0x588438,_0x4c65c1){_0x588438=_0x588438-0x0;var _0x50fd0e=_0xbe49[_0x588438];return _0x50fd0e;};'use strict';var _=require(_0x9be4('0x0'));var util=require(_0x9be4('0x1'));var logger=require(_0x9be4('0x2'))(_0x9be4('0x3'));var moment=require(_0x9be4('0x4'));var BPromise=require(_0x9be4('0x5'));var rp=require(_0x9be4('0x6'));var fs=require('fs');var path=require(_0x9be4('0x7'));var rimraf=require(_0x9be4('0x8'));var config=require(_0x9be4('0x9'));var attributes=require(_0x9be4('0xa'));module[_0x9be4('0xb')]=function(_0x4515af,_0x4f6b01){return _0x4515af['define'](_0x9be4('0xc'),attributes,{'tableName':_0x9be4('0xd'),'paranoid':![],'indexes':[{'name':_0x9be4('0xe'),'fields':[_0x9be4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 99cd7ac..d55bddd 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 _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(_0x2408a7,_0x11086c){var _0x4f30e6=function(_0xd116b1){while(--_0xd116b1){_0x2408a7['push'](_0x2408a7['shift']());}};_0x4f30e6(++_0x11086c);}(_0x326f,0xd1));var _0xf326=function(_0x5e08f6,_0x57e62b){_0x5e08f6=_0x5e08f6-0x0;var _0x28c00b=_0x326f[_0x5e08f6];return _0x28c00b;};'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 +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x27fb22,_0xab9f66){var _0x2046fc=function(_0x1a692c){while(--_0x1a692c){_0x27fb22['push'](_0x27fb22['shift']());}};_0x2046fc(++_0xab9f66);}(_0x2ef3,0xba));var _0x32ef=function(_0x26d100,_0x12fb8a){_0x26d100=_0x26d100-0x0;var _0x5dedc9=_0x2ef3[_0x26d100];return _0x5dedc9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 67d5f4b..ec13ccb 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x354e60,_0x50aad4){var _0x1cc4be=function(_0x2cbc60){while(--_0x2cbc60){_0x354e60['push'](_0x354e60['shift']());}};_0x1cc4be(++_0x50aad4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xcb91[_0x304b67];return _0x493afb;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4f147b,_0x3d5c64){var _0xa47402=function(_0x432136){while(--_0x432136){_0x4f147b['push'](_0x4f147b['shift']());}};_0xa47402(++_0x3d5c64);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xcb91[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ea2add1..8be03ea 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 _0x04b8=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x38aee2,_0x7d94f4){var _0x4c0922=function(_0x479037){while(--_0x479037){_0x38aee2['push'](_0x38aee2['shift']());}};_0x4c0922(++_0x7d94f4);}(_0x04b8,0x159));var _0x804b=function(_0x16a1f6,_0x427d94){_0x16a1f6=_0x16a1f6-0x0;var _0x48eaf0=_0x04b8[_0x16a1f6];return _0x48eaf0;};'use strict';var Sequelize=require('sequelize');module[_0x804b('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x804b('0x1')]},'authentication':{'type':Sequelize[_0x804b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x804b('0x1')]},'port':{'type':Sequelize[_0x804b('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x804b('0x1')],'defaultValue':_0x804b('0x4')},'connTimeout':{'type':Sequelize[_0x804b('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x804b('0x1')]}}; \ No newline at end of file +var _0x8b29=['INTEGER','sequelize','STRING'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x8b29,0xbe));var _0x98b2=function(_0xb722f4,_0x2b2b72){_0xb722f4=_0xb722f4-0x0;var _0x3cfe7e=_0x8b29[_0xb722f4];return _0x3cfe7e;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'description':{'type':Sequelize[_0x98b2('0x1')]},'host':{'type':Sequelize[_0x98b2('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x98b2('0x1')]},'port':{'type':Sequelize[_0x98b2('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x98b2('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x98b2('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x98b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d87146c..e888eea 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 _0xfb0b=['../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash','bluebird','request-promise'];(function(_0x102ab4,_0xad970f){var _0x3280e4=function(_0x537e73){while(--_0x537e73){_0x102ab4['push'](_0x102ab4['shift']());}};_0x3280e4(++_0xad970f);}(_0xfb0b,0x90));var _0xbfb0=function(_0x561fa4,_0x22f756){_0x561fa4=_0x561fa4-0x0;var _0x440ab9=_0xfb0b[_0x561fa4];return _0x440ab9;};'use strict';var _=require(_0xbfb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbfb0('0x1'));var rp=require(_0xbfb0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfb0('0x3'));var attributes=require(_0xbfb0('0x4'));module['exports']=function(_0x1c8b74,_0x1ddb4){return _0x1c8b74['define'](_0xbfb0('0x5'),attributes,{'tableName':_0xbfb0('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb8=['exports','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xddb8,0xab));var _0x8ddb=function(_0x328980,_0x3b3d26){_0x328980=_0x328980-0x0;var _0x563b39=_0xddb8[_0x328980];return _0x563b39;};'use strict';var _=require('lodash');var util=require(_0x8ddb('0x0'));var logger=require(_0x8ddb('0x1'))(_0x8ddb('0x2'));var moment=require(_0x8ddb('0x3'));var BPromise=require(_0x8ddb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ddb('0x5'));var rimraf=require(_0x8ddb('0x6'));var config=require(_0x8ddb('0x7'));var attributes=require(_0x8ddb('0x8'));module[_0x8ddb('0x9')]=function(_0x104e1b,_0x25723e){return _0x104e1b['define'](_0x8ddb('0xa'),attributes,{'tableName':_0x8ddb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 8cd40a8..326a2fc 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 _0xbee3=['model','attributes','stringify','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','map'];(function(_0x9d1d83,_0x2e9492){var _0x1e7e45=function(_0x1d81bf){while(--_0x1d81bf){_0x9d1d83['push'](_0x9d1d83['shift']());}};_0x1e7e45(++_0x2e9492);}(_0xbee3,0xd5));var _0x3bee=function(_0x5b7a5b,_0x2b31eb){_0x5b7a5b=_0x5b7a5b-0x0;var _0x2e1f28=_0xbee3[_0x5b7a5b];return _0x2e1f28;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3bee('0x1'));var fs=require('fs');var Redis=require(_0x3bee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var config=require('../../config/environment');var jayson=require(_0x3bee('0x6'));var client=jayson[_0x3bee('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fdeec,_0x28d912,_0x1b510d){return new BPromise(function(_0x339223,_0xbdd5d5){return client[_0x3bee('0x8')](_0x2fdeec,_0x1b510d)[_0x3bee('0x9')](function(_0x518e2d){logger[_0x3bee('0xa')](_0x3bee('0xb'),_0x28d912,_0x3bee('0xc'));logger[_0x3bee('0xd')](_0x3bee('0xe'),_0x28d912,_0x3bee('0xc'),JSON['stringify'](_0x518e2d));if(_0x518e2d[_0x3bee('0xf')]){if(_0x518e2d['error'][_0x3bee('0x10')]===0x1f4){logger[_0x3bee('0xf')](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0xbdd5d5(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}logger['error'](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0x339223(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x28d912,_0x3bee('0xc'));_0x339223(_0x518e2d['result'][_0x3bee('0x11')]);}})[_0x3bee('0x12')](function(_0x57d42c){logger['error'](_0x3bee('0xb'),_0x28d912,_0x57d42c);_0xbdd5d5(_0x57d42c);});});}exports[_0x3bee('0x13')]=function(_0xfdba3b){var _0x631ff8=this;return new Promise(function(_0x49095a,_0x30a1de){return db[_0x3bee('0x14')][_0x3bee('0x15')]({'raw':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x17')]===undefined?!![]:![]:!![],'where':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b['options']['where']||null:null,'attributes':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')]['attributes']||null:null,'limit':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x18')]||null:null,'include':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0xfdba3b['options'][_0x3bee('0x19')],function(_0x1ed0c1){return{'model':db[_0x1ed0c1[_0x3bee('0x1b')]],'as':_0x1ed0c1['as'],'attributes':_0x1ed0c1[_0x3bee('0x1c')],'include':_0x1ed0c1['include']?_[_0x3bee('0x1a')](_0x1ed0c1[_0x3bee('0x19')],function(_0x1e0111){return{'model':db[_0x1e0111['model']],'as':_0x1e0111['as'],'attributes':_0x1e0111['attributes'],'include':_0x1e0111[_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0x1e0111['include'],function(_0x2c0e50){return{'model':db[_0x2c0e50[_0x3bee('0x1b')]],'as':_0x2c0e50['as'],'attributes':_0x2c0e50[_0x3bee('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1984c4){logger[_0x3bee('0xa')](_0x3bee('0x13'),_0xfdba3b);logger['debug'](_0x3bee('0x13'),_0xfdba3b,JSON[_0x3bee('0x1d')](_0x1984c4));_0x49095a(_0x1984c4);})[_0x3bee('0x12')](function(_0x496abd){logger[_0x3bee('0xf')](_0x3bee('0x13'),_0x496abd[_0x3bee('0x11')],_0xfdba3b);_0x30a1de(_0x631ff8[_0x3bee('0xf')](0x1f4,_0x496abd[_0x3bee('0x11')]));});});}; \ No newline at end of file +var _0x5882=['catch','MailServerIn','options','where','attributes','limit','include','map','model','GetMailServerIn','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x151ed4,_0x23cfb8){var _0x1c6f7e=function(_0x5466be){while(--_0x5466be){_0x151ed4['push'](_0x151ed4['shift']());}};_0x1c6f7e(++_0x23cfb8);}(_0x5882,0x1db));var _0x2588=function(_0x4246d7,_0x3859c4){_0x4246d7=_0x4246d7-0x0;var _0x4979de=_0x5882[_0x4246d7];return _0x4979de;};'use strict';var _=require('lodash');var util=require(_0x2588('0x0'));var moment=require(_0x2588('0x1'));var BPromise=require('bluebird');var rs=require(_0x2588('0x2'));var fs=require('fs');var Redis=require(_0x2588('0x3'));var db=require(_0x2588('0x4'))['db'];var utils=require(_0x2588('0x5'));var logger=require(_0x2588('0x6'))(_0x2588('0x7'));var config=require(_0x2588('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2588('0x9')][_0x2588('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56e594,_0x32dd94,_0x1b53e5){return new BPromise(function(_0x4e19cd,_0x19a43e){return client[_0x2588('0xb')](_0x56e594,_0x1b53e5)[_0x2588('0xc')](function(_0x3c8ac5){logger['info'](_0x2588('0xd'),_0x32dd94,_0x2588('0xe'));logger[_0x2588('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x32dd94,_0x2588('0xe'),JSON[_0x2588('0x10')](_0x3c8ac5));if(_0x3c8ac5['error']){if(_0x3c8ac5[_0x2588('0x11')][_0x2588('0x12')]===0x1f4){logger[_0x2588('0x11')](_0x2588('0xd'),_0x32dd94,_0x3c8ac5[_0x2588('0x11')][_0x2588('0x13')]);return _0x19a43e(_0x3c8ac5[_0x2588('0x11')][_0x2588('0x13')]);}logger['error'](_0x2588('0xd'),_0x32dd94,_0x3c8ac5[_0x2588('0x11')][_0x2588('0x13')]);return _0x4e19cd(_0x3c8ac5['error'][_0x2588('0x13')]);}else{logger[_0x2588('0x14')](_0x2588('0xd'),_0x32dd94,_0x2588('0xe'));_0x4e19cd(_0x3c8ac5['result']['message']);}})[_0x2588('0x15')](function(_0x42b84b){logger[_0x2588('0x11')](_0x2588('0xd'),_0x32dd94,_0x42b84b);_0x19a43e(_0x42b84b);});});}exports['GetMailServerIn']=function(_0x56b174){var _0x4e792e=this;return new Promise(function(_0x254417,_0xe9f78){return db[_0x2588('0x16')]['findAll']({'raw':_0x56b174[_0x2588('0x17')]?_0x56b174[_0x2588('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x56b174[_0x2588('0x17')]?_0x56b174[_0x2588('0x17')][_0x2588('0x18')]||null:null,'attributes':_0x56b174[_0x2588('0x17')]?_0x56b174[_0x2588('0x17')][_0x2588('0x19')]||null:null,'limit':_0x56b174[_0x2588('0x17')]?_0x56b174[_0x2588('0x17')][_0x2588('0x1a')]||null:null,'include':_0x56b174[_0x2588('0x17')]?_0x56b174[_0x2588('0x17')][_0x2588('0x1b')]?_[_0x2588('0x1c')](_0x56b174[_0x2588('0x17')]['include'],function(_0x3820a6){return{'model':db[_0x3820a6['model']],'as':_0x3820a6['as'],'attributes':_0x3820a6[_0x2588('0x19')],'include':_0x3820a6[_0x2588('0x1b')]?_['map'](_0x3820a6[_0x2588('0x1b')],function(_0x2afb56){return{'model':db[_0x2afb56[_0x2588('0x1d')]],'as':_0x2afb56['as'],'attributes':_0x2afb56[_0x2588('0x19')],'include':_0x2afb56[_0x2588('0x1b')]?_[_0x2588('0x1c')](_0x2afb56['include'],function(_0x3e3bad){return{'model':db[_0x3e3bad[_0x2588('0x1d')]],'as':_0x3e3bad['as'],'attributes':_0x3e3bad[_0x2588('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2588('0xc')](function(_0x13562c){logger['info'](_0x2588('0x1e'),_0x56b174);logger[_0x2588('0xf')](_0x2588('0x1e'),_0x56b174,JSON[_0x2588('0x10')](_0x13562c));_0x254417(_0x13562c);})[_0x2588('0x15')](function(_0x39bfb7){logger['error']('GetMailServerIn',_0x39bfb7['message'],_0x56b174);_0xe9f78(_0x4e792e[_0x2588('0x11')](0x1f4,_0x39bfb7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 1314c67..2e872f2 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(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x47d925,_0x50885e){_0x47d925=_0x47d925-0x0;var _0x32494b=_0x7a54[_0x47d925];return _0x32494b;};'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(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 3a6cfc6..b58d1b5 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 _0x8b54=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x511e08,_0x26ba8c){var _0x7a652e=function(_0x42d218){while(--_0x42d218){_0x511e08['push'](_0x511e08['shift']());}};_0x7a652e(++_0x26ba8c);}(_0x8b54,0x160));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x48b5('0x0'));module[_0x48b5('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x48b5('0x2')]},'port':{'type':Sequelize[_0x48b5('0x3')]},'secure':{'type':Sequelize[_0x48b5('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x48b5('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe1c4=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1e91fd,_0x557756){var _0x12d6b5=function(_0x2f3e50){while(--_0x2f3e50){_0x1e91fd['push'](_0x1e91fd['shift']());}};_0x12d6b5(++_0x557756);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x3325b7,_0x33779b){_0x3325b7=_0x3325b7-0x0;var _0x273b22=_0xe1c4[_0x3325b7];return _0x273b22;};'use strict';var Sequelize=require(_0x4e1c('0x0'));module[_0x4e1c('0x1')]={'description':{'type':Sequelize[_0x4e1c('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4e1c('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4e1c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x4e1c('0x2')]},'authentication':{'type':Sequelize[_0x4e1c('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 e1f4cd5..22f28a1 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 _0xce6f=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','findAll','rows','catch','show','params','length','merge','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xce6f,0x166));var _0xfce6=function(_0x41b4c0,_0x56c918){_0x41b4c0=_0x41b4c0-0x0;var _0xe364b1=_0xce6f[_0x41b4c0];return _0xe364b1;};'use strict';var emlformat=require(_0xfce6('0x0'));var rimraf=require(_0xfce6('0x1'));var zipdir=require(_0xfce6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfce6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfce6('0x4'));var path=require('path');var sox=require(_0xfce6('0x5'));var csv=require('to-csv');var ejs=require(_0xfce6('0x6'));var fs=require('fs');var fs_extra=require(_0xfce6('0x7'));var _=require(_0xfce6('0x8'));var squel=require(_0xfce6('0x9'));var crypto=require(_0xfce6('0xa'));var jsforce=require(_0xfce6('0xb'));var deskjs=require(_0xfce6('0xc'));var toCsv=require(_0xfce6('0xd'));var querystring=require(_0xfce6('0xe'));var Papa=require('papaparse');var Redis=require(_0xfce6('0xf'));var authService=require(_0xfce6('0x10'));var qs=require(_0xfce6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfce6('0x12'));var logger=require(_0xfce6('0x13'))('api');var utils=require(_0xfce6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfce6('0x15'));var db=require(_0xfce6('0x16'))['db'];function respondWithStatusCode(_0x4a40c8,_0x4ecf55){_0x4ecf55=_0x4ecf55||0xcc;return function(_0x41adac){if(_0x41adac){return _0x4a40c8[_0xfce6('0x17')](_0x4ecf55);}return _0x4a40c8[_0xfce6('0x18')](_0x4ecf55)[_0xfce6('0x19')]();};}function respondWithResult(_0x4f0d78,_0x318c1b){_0x318c1b=_0x318c1b||0xc8;return function(_0x39b3a5){if(_0x39b3a5){return _0x4f0d78[_0xfce6('0x18')](_0x318c1b)[_0xfce6('0x1a')](_0x39b3a5);}};}function respondWithFilteredResult(_0x39ade6,_0x49e2eb){return function(_0x45f8c3){if(_0x45f8c3){var _0x985a9c=typeof _0x49e2eb[_0xfce6('0x1b')]===_0xfce6('0x1c')&&typeof _0x49e2eb[_0xfce6('0x1d')]===_0xfce6('0x1c');var _0x10044a=_0x45f8c3[_0xfce6('0x1e')];var _0x23b9ce=_0x985a9c?0x0:_0x49e2eb[_0xfce6('0x1b')];var _0x218b72=_0x985a9c?_0x45f8c3[_0xfce6('0x1e')]:_0x49e2eb[_0xfce6('0x1b')]+_0x49e2eb[_0xfce6('0x1d')];var _0x34e0df;if(_0x218b72>=_0x10044a){_0x218b72=_0x10044a;_0x34e0df=0xc8;}else{_0x34e0df=0xce;}_0x39ade6[_0xfce6('0x18')](_0x34e0df);return _0x39ade6[_0xfce6('0x1f')](_0xfce6('0x20'),_0x23b9ce+'-'+_0x218b72+'/'+_0x10044a)[_0xfce6('0x1a')](_0x45f8c3);}return null;};}function patchUpdates(_0x19ea8f){return function(_0x12fafc){try{jsonpatch[_0xfce6('0x21')](_0x12fafc,_0x19ea8f,!![]);}catch(_0x1fe8fa){return BPromise[_0xfce6('0x22')](_0x1fe8fa);}return _0x12fafc['save']();};}function saveUpdates(_0x36521a,_0xa0ed82){return function(_0x3e72fd){if(_0x3e72fd){return _0x3e72fd[_0xfce6('0x23')](_0x36521a)[_0xfce6('0x24')](function(_0x5e6d9b){return _0x5e6d9b;});}return null;};}function removeEntity(_0x1c0c35,_0x56f06b){return function(_0x2a8016){if(_0x2a8016){return _0x2a8016['destroy']()[_0xfce6('0x24')](function(){_0x1c0c35[_0xfce6('0x18')](0xcc)[_0xfce6('0x19')]();});}};}function handleEntityNotFound(_0x27bdd7,_0x30448a){return function(_0x310bf1){if(!_0x310bf1){_0x27bdd7[_0xfce6('0x17')](0x194);}return _0x310bf1;};}function handleError(_0xfbaef1,_0x5f145f){_0x5f145f=_0x5f145f||0x1f4;return function(_0x430feb){logger[_0xfce6('0x25')](_0x430feb[_0xfce6('0x26')]);if(_0x430feb[_0xfce6('0x27')]){delete _0x430feb['name'];}_0xfbaef1['status'](_0x5f145f)[_0xfce6('0x28')](_0x430feb);};}exports[_0xfce6('0x29')]=function(_0x2cc0c6,_0xb19325){var _0x44153c={},_0x363ebf={},_0x38ab4d={'count':0x0,'rows':[]};var _0x324634=_['map'](db[_0xfce6('0x2a')][_0xfce6('0x2b')],function(_0x302d07){return{'name':_0x302d07['fieldName'],'type':_0x302d07[_0xfce6('0x2c')][_0xfce6('0x2d')]};});_0x363ebf[_0xfce6('0x2e')]=_[_0xfce6('0x2f')](_0x324634,_0xfce6('0x27'));_0x363ebf[_0xfce6('0x30')]=_[_0xfce6('0x31')](_0x2cc0c6[_0xfce6('0x30')]);_0x363ebf[_0xfce6('0x32')]=_[_0xfce6('0x33')](_0x363ebf[_0xfce6('0x2e')],_0x363ebf[_0xfce6('0x30')]);_0x44153c[_0xfce6('0x34')]=_[_0xfce6('0x33')](_0x363ebf[_0xfce6('0x2e')],qs[_0xfce6('0x35')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x35')]));_0x44153c['attributes']=_0x44153c[_0xfce6('0x34')]['length']?_0x44153c[_0xfce6('0x34')]:_0x363ebf[_0xfce6('0x2e')];if(!_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x36')](_0xfce6('0x37'))){_0x44153c[_0xfce6('0x1d')]=qs[_0xfce6('0x1d')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x1d')]);_0x44153c[_0xfce6('0x1b')]=qs['offset'](_0x2cc0c6[_0xfce6('0x30')]['offset']);}_0x44153c[_0xfce6('0x38')]=qs[_0xfce6('0x39')](_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x39')]);_0x44153c['where']=qs[_0xfce6('0x32')](_[_0xfce6('0x3a')](_0x2cc0c6[_0xfce6('0x30')],_0x363ebf[_0xfce6('0x32')]),_0x324634);if(_0x2cc0c6['query'][_0xfce6('0x3b')]){_0x44153c[_0xfce6('0x3c')]=_['merge'](_0x44153c[_0xfce6('0x3c')],{'$or':_[_0xfce6('0x2f')](_0x324634,function(_0x39fce2){if(_0x39fce2[_0xfce6('0x2c')]!=='VIRTUAL'){var _0x539343={};_0x539343[_0x39fce2[_0xfce6('0x27')]]={'$like':'%'+_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x3b')]+'%'};return _0x539343;}})});}_0x44153c=_['merge']({},_0x44153c,_0x2cc0c6[_0xfce6('0x3d')]);var _0x3f147a={'where':_0x44153c['where']};return db[_0xfce6('0x2a')][_0xfce6('0x1e')](_0x3f147a)[_0xfce6('0x24')](function(_0x4533b1){_0x38ab4d['count']=_0x4533b1;if(_0x2cc0c6[_0xfce6('0x30')][_0xfce6('0x3e')]){_0x44153c['include']=[{'all':!![]}];}return db[_0xfce6('0x2a')][_0xfce6('0x3f')](_0x44153c);})[_0xfce6('0x24')](function(_0x2b626d){_0x38ab4d[_0xfce6('0x40')]=_0x2b626d;return _0x38ab4d;})[_0xfce6('0x24')](respondWithFilteredResult(_0xb19325,_0x44153c))[_0xfce6('0x41')](handleError(_0xb19325,null));};exports[_0xfce6('0x42')]=function(_0x2bb53e,_0x2def3d){var _0x308789={'raw':!![],'where':{'id':_0x2bb53e[_0xfce6('0x43')]['id']}},_0x4d2ae4={};_0x4d2ae4[_0xfce6('0x2e')]=_[_0xfce6('0x31')](db[_0xfce6('0x2a')]['rawAttributes']);_0x4d2ae4[_0xfce6('0x30')]=_[_0xfce6('0x31')](_0x2bb53e[_0xfce6('0x30')]);_0x4d2ae4[_0xfce6('0x32')]=_[_0xfce6('0x33')](_0x4d2ae4[_0xfce6('0x2e')],_0x4d2ae4[_0xfce6('0x30')]);_0x308789[_0xfce6('0x34')]=_[_0xfce6('0x33')](_0x4d2ae4['model'],qs[_0xfce6('0x35')](_0x2bb53e[_0xfce6('0x30')]['fields']));_0x308789[_0xfce6('0x34')]=_0x308789[_0xfce6('0x34')][_0xfce6('0x44')]?_0x308789[_0xfce6('0x34')]:_0x4d2ae4[_0xfce6('0x2e')];if(_0x2bb53e['query'][_0xfce6('0x3e')]){_0x308789['include']=[{'all':!![]}];}_0x308789=_[_0xfce6('0x45')]({},_0x308789,_0x2bb53e[_0xfce6('0x3d')]);return db[_0xfce6('0x2a')][_0xfce6('0x46')](_0x308789)[_0xfce6('0x24')](handleEntityNotFound(_0x2def3d,null))['then'](respondWithResult(_0x2def3d,null))[_0xfce6('0x41')](handleError(_0x2def3d,null));};exports[_0xfce6('0x47')]=function(_0x269320,_0x117490){return db[_0xfce6('0x2a')]['create'](_0x269320['body'],{})['then'](respondWithResult(_0x117490,0xc9))[_0xfce6('0x41')](handleError(_0x117490,null));};exports['update']=function(_0x5c62ab,_0x32134d){if(_0x5c62ab[_0xfce6('0x48')]['id']){delete _0x5c62ab[_0xfce6('0x48')]['id'];}return db['MailServerOut'][_0xfce6('0x46')]({'where':{'id':_0x5c62ab['params']['id']}})[_0xfce6('0x24')](handleEntityNotFound(_0x32134d,null))[_0xfce6('0x24')](saveUpdates(_0x5c62ab[_0xfce6('0x48')],null))['then'](respondWithResult(_0x32134d,null))[_0xfce6('0x41')](handleError(_0x32134d,null));};exports[_0xfce6('0x49')]=function(_0x35143f,_0x476516){return db['MailServerOut'][_0xfce6('0x46')]({'where':{'id':_0x35143f['params']['id']}})['then'](handleEntityNotFound(_0x476516,null))[_0xfce6('0x24')](removeEntity(_0x476516,null))[_0xfce6('0x41')](handleError(_0x476516,null));}; \ No newline at end of file +var _0x5088=['sort','pick','filter','where','merge','VIRTUAL','options','MailServerOut','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5088,0x14f));var _0x8508=function(_0x10fd98,_0x5209db){_0x10fd98=_0x10fd98-0x0;var _0x5347d5=_0x5088[_0x10fd98];return _0x5347d5;};'use strict';var emlformat=require(_0x8508('0x0'));var rimraf=require(_0x8508('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8508('0x2'));var rp=require(_0x8508('0x3'));var moment=require(_0x8508('0x4'));var BPromise=require(_0x8508('0x5'));var Mustache=require(_0x8508('0x6'));var util=require(_0x8508('0x7'));var path=require(_0x8508('0x8'));var sox=require(_0x8508('0x9'));var csv=require(_0x8508('0xa'));var ejs=require(_0x8508('0xb'));var fs=require('fs');var fs_extra=require(_0x8508('0xc'));var _=require('lodash');var squel=require(_0x8508('0xd'));var crypto=require(_0x8508('0xe'));var jsforce=require(_0x8508('0xf'));var deskjs=require(_0x8508('0x10'));var toCsv=require(_0x8508('0xa'));var querystring=require('querystring');var Papa=require(_0x8508('0x11'));var Redis=require(_0x8508('0x12'));var authService=require(_0x8508('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8508('0x14'));var hardwareService=require(_0x8508('0x15'));var logger=require('../../config/logger')(_0x8508('0x16'));var utils=require(_0x8508('0x17'));var config=require(_0x8508('0x18'));var licenseUtil=require(_0x8508('0x19'));var db=require(_0x8508('0x1a'))['db'];function respondWithStatusCode(_0x1c397d,_0x3d667f){_0x3d667f=_0x3d667f||0xcc;return function(_0x35442a){if(_0x35442a){return _0x1c397d['sendStatus'](_0x3d667f);}return _0x1c397d[_0x8508('0x1b')](_0x3d667f)[_0x8508('0x1c')]();};}function respondWithResult(_0x48a626,_0x4959f8){_0x4959f8=_0x4959f8||0xc8;return function(_0x527447){if(_0x527447){return _0x48a626[_0x8508('0x1b')](_0x4959f8)[_0x8508('0x1d')](_0x527447);}};}function respondWithFilteredResult(_0x3e4a9b,_0x203ecf){return function(_0xcaf4f2){if(_0xcaf4f2){var _0x580f4f=typeof _0x203ecf['offset']==='undefined'&&typeof _0x203ecf[_0x8508('0x1e')]===_0x8508('0x1f');var _0x22333b=_0xcaf4f2[_0x8508('0x20')];var _0x87d722=_0x580f4f?0x0:_0x203ecf[_0x8508('0x21')];var _0x2a767b=_0x580f4f?_0xcaf4f2[_0x8508('0x20')]:_0x203ecf[_0x8508('0x21')]+_0x203ecf[_0x8508('0x1e')];var _0x21dbd9;if(_0x2a767b>=_0x22333b){_0x2a767b=_0x22333b;_0x21dbd9=0xc8;}else{_0x21dbd9=0xce;}_0x3e4a9b['status'](_0x21dbd9);return _0x3e4a9b[_0x8508('0x22')]('Content-Range',_0x87d722+'-'+_0x2a767b+'/'+_0x22333b)[_0x8508('0x1d')](_0xcaf4f2);}return null;};}function patchUpdates(_0x53f70b){return function(_0x2d73c6){try{jsonpatch[_0x8508('0x23')](_0x2d73c6,_0x53f70b,!![]);}catch(_0x43e062){return BPromise[_0x8508('0x24')](_0x43e062);}return _0x2d73c6[_0x8508('0x25')]();};}function saveUpdates(_0x466216,_0x3b3f31){return function(_0x3b34c7){if(_0x3b34c7){return _0x3b34c7[_0x8508('0x26')](_0x466216)[_0x8508('0x27')](function(_0x584798){return _0x584798;});}return null;};}function removeEntity(_0x2e7d91,_0x50d97e){return function(_0x4105c8){if(_0x4105c8){return _0x4105c8[_0x8508('0x28')]()[_0x8508('0x27')](function(){_0x2e7d91['status'](0xcc)[_0x8508('0x1c')]();});}};}function handleEntityNotFound(_0x147563,_0x58ac36){return function(_0x36e4e8){if(!_0x36e4e8){_0x147563[_0x8508('0x29')](0x194);}return _0x36e4e8;};}function handleError(_0x189036,_0x12eafd){_0x12eafd=_0x12eafd||0x1f4;return function(_0x102ced){logger[_0x8508('0x2a')](_0x102ced[_0x8508('0x2b')]);if(_0x102ced[_0x8508('0x2c')]){delete _0x102ced[_0x8508('0x2c')];}_0x189036[_0x8508('0x1b')](_0x12eafd)[_0x8508('0x2d')](_0x102ced);};}exports['index']=function(_0x183128,_0x2e630d){var _0x321acd={},_0x39a438={},_0x1bde3a={'count':0x0,'rows':[]};var _0x5b86eb=_[_0x8508('0x2e')](db['MailServerOut']['rawAttributes'],function(_0x490adc){return{'name':_0x490adc[_0x8508('0x2f')],'type':_0x490adc[_0x8508('0x30')][_0x8508('0x31')]};});_0x39a438['model']=_[_0x8508('0x2e')](_0x5b86eb,_0x8508('0x2c'));_0x39a438[_0x8508('0x32')]=_[_0x8508('0x33')](_0x183128[_0x8508('0x32')]);_0x39a438[_0x8508('0x34')]=_['intersection'](_0x39a438[_0x8508('0x35')],_0x39a438['query']);_0x321acd['attributes']=_[_0x8508('0x36')](_0x39a438[_0x8508('0x35')],qs[_0x8508('0x37')](_0x183128[_0x8508('0x32')][_0x8508('0x37')]));_0x321acd[_0x8508('0x38')]=_0x321acd[_0x8508('0x38')]['length']?_0x321acd[_0x8508('0x38')]:_0x39a438[_0x8508('0x35')];if(!_0x183128[_0x8508('0x32')][_0x8508('0x39')](_0x8508('0x3a'))){_0x321acd[_0x8508('0x1e')]=qs['limit'](_0x183128[_0x8508('0x32')][_0x8508('0x1e')]);_0x321acd[_0x8508('0x21')]=qs[_0x8508('0x21')](_0x183128['query'][_0x8508('0x21')]);}_0x321acd[_0x8508('0x3b')]=qs[_0x8508('0x3c')](_0x183128[_0x8508('0x32')][_0x8508('0x3c')]);_0x321acd['where']=qs[_0x8508('0x34')](_[_0x8508('0x3d')](_0x183128[_0x8508('0x32')],_0x39a438[_0x8508('0x34')]),_0x5b86eb);if(_0x183128['query'][_0x8508('0x3e')]){_0x321acd[_0x8508('0x3f')]=_[_0x8508('0x40')](_0x321acd['where'],{'$or':_['map'](_0x5b86eb,function(_0x1d5324){if(_0x1d5324[_0x8508('0x30')]!==_0x8508('0x41')){var _0x5a56dc={};_0x5a56dc[_0x1d5324['name']]={'$like':'%'+_0x183128['query'][_0x8508('0x3e')]+'%'};return _0x5a56dc;}})});}_0x321acd=_[_0x8508('0x40')]({},_0x321acd,_0x183128[_0x8508('0x42')]);var _0x2888c={'where':_0x321acd[_0x8508('0x3f')]};return db[_0x8508('0x43')]['count'](_0x2888c)[_0x8508('0x27')](function(_0x518ef4){_0x1bde3a[_0x8508('0x20')]=_0x518ef4;if(_0x183128[_0x8508('0x32')][_0x8508('0x44')]){_0x321acd[_0x8508('0x45')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x321acd);})[_0x8508('0x27')](function(_0x11d092){_0x1bde3a[_0x8508('0x46')]=_0x11d092;return _0x1bde3a;})[_0x8508('0x27')](respondWithFilteredResult(_0x2e630d,_0x321acd))['catch'](handleError(_0x2e630d,null));};exports[_0x8508('0x47')]=function(_0x372166,_0x22d60f){var _0xf0ef9f={'raw':!![],'where':{'id':_0x372166[_0x8508('0x48')]['id']}},_0x40beed={};_0x40beed[_0x8508('0x35')]=_['keys'](db['MailServerOut'][_0x8508('0x49')]);_0x40beed[_0x8508('0x32')]=_[_0x8508('0x33')](_0x372166[_0x8508('0x32')]);_0x40beed['filters']=_[_0x8508('0x36')](_0x40beed[_0x8508('0x35')],_0x40beed[_0x8508('0x32')]);_0xf0ef9f[_0x8508('0x38')]=_[_0x8508('0x36')](_0x40beed[_0x8508('0x35')],qs[_0x8508('0x37')](_0x372166['query']['fields']));_0xf0ef9f[_0x8508('0x38')]=_0xf0ef9f[_0x8508('0x38')][_0x8508('0x4a')]?_0xf0ef9f[_0x8508('0x38')]:_0x40beed[_0x8508('0x35')];if(_0x372166['query'][_0x8508('0x44')]){_0xf0ef9f['include']=[{'all':!![]}];}_0xf0ef9f=_['merge']({},_0xf0ef9f,_0x372166[_0x8508('0x42')]);return db[_0x8508('0x43')][_0x8508('0x4b')](_0xf0ef9f)[_0x8508('0x27')](handleEntityNotFound(_0x22d60f,null))['then'](respondWithResult(_0x22d60f,null))[_0x8508('0x4c')](handleError(_0x22d60f,null));};exports[_0x8508('0x4d')]=function(_0x3bf587,_0x2f6fa8){return db['MailServerOut'][_0x8508('0x4d')](_0x3bf587[_0x8508('0x4e')],{})[_0x8508('0x27')](respondWithResult(_0x2f6fa8,0xc9))[_0x8508('0x4c')](handleError(_0x2f6fa8,null));};exports['update']=function(_0x5e055f,_0x1c67df){if(_0x5e055f[_0x8508('0x4e')]['id']){delete _0x5e055f[_0x8508('0x4e')]['id'];}return db[_0x8508('0x43')]['find']({'where':{'id':_0x5e055f[_0x8508('0x48')]['id']}})[_0x8508('0x27')](handleEntityNotFound(_0x1c67df,null))[_0x8508('0x27')](saveUpdates(_0x5e055f[_0x8508('0x4e')],null))[_0x8508('0x27')](respondWithResult(_0x1c67df,null))[_0x8508('0x4c')](handleError(_0x1c67df,null));};exports[_0x8508('0x28')]=function(_0x4edb15,_0xc70a0a){return db[_0x8508('0x43')][_0x8508('0x4b')]({'where':{'id':_0x4edb15[_0x8508('0x48')]['id']}})[_0x8508('0x27')](handleEntityNotFound(_0xc70a0a,null))[_0x8508('0x27')](removeEntity(_0xc70a0a,null))['catch'](handleError(_0xc70a0a,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index bf9e326..20be7e3 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 _0x3fd5=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2560f8,_0x57607e){var _0x20dbd0=function(_0x975590){while(--_0x975590){_0x2560f8['push'](_0x2560f8['shift']());}};_0x20dbd0(++_0x57607e);}(_0x3fd5,0x19c));var _0x53fd=function(_0x22d6c8,_0x48e940){_0x22d6c8=_0x22d6c8-0x0;var _0x33953f=_0x3fd5[_0x22d6c8];return _0x33953f;};'use strict';var _=require(_0x53fd('0x0'));var util=require('util');var logger=require(_0x53fd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x53fd('0x2'));var rp=require(_0x53fd('0x3'));var fs=require('fs');var path=require(_0x53fd('0x4'));var rimraf=require(_0x53fd('0x5'));var config=require(_0x53fd('0x6'));var attributes=require(_0x53fd('0x7'));module[_0x53fd('0x8')]=function(_0x5625ee,_0x4e8ca4){return _0x5625ee[_0x53fd('0x9')](_0x53fd('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d5f=['request-promise','path','rimraf','exports','MailServerOut','mail_servers_out','lodash','moment','bluebird'];(function(_0x269b11,_0xd8f98f){var _0x231483=function(_0x334e94){while(--_0x334e94){_0x269b11['push'](_0x269b11['shift']());}};_0x231483(++_0xd8f98f);}(_0x4d5f,0x10b));var _0xf4d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4d5f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf4d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf4d5('0x1'));var BPromise=require(_0xf4d5('0x2'));var rp=require(_0xf4d5('0x3'));var fs=require('fs');var path=require(_0xf4d5('0x4'));var rimraf=require(_0xf4d5('0x5'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xf4d5('0x6')]=function(_0x42f0a2,_0x365edd){return _0x42f0a2['define'](_0xf4d5('0x7'),attributes,{'tableName':_0xf4d5('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 071781f..4800142 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x266c20,_0x1bebbb){_0x266c20=_0x266c20-0x0;var _0x509adc=_0x7a54[_0x266c20];return _0x509adc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x9bcd51,_0x44ba03){var _0x678fa=function(_0x35f577){while(--_0x35f577){_0x9bcd51['push'](_0x9bcd51['shift']());}};_0x678fa(++_0x44ba03);}(_0x1261,0x144));var _0x1126=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x1261[_0x1261c2];return _0x3aabd2;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index cd0cfc4..c6cc9e1 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 _0xdbcd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','create','put','update','delete'];(function(_0x49009e,_0x28c8a6){var _0x4fa03a=function(_0x381760){while(--_0x381760){_0x49009e['push'](_0x49009e['shift']());}};_0x4fa03a(++_0x28c8a6);}(_0xdbcd,0x178));var _0xddbc=function(_0x2a8042,_0x19e485){_0x2a8042=_0x2a8042-0x0;var _0x41a9d1=_0xdbcd[_0x2a8042];return _0x41a9d1;};'use strict';var multer=require(_0xddbc('0x0'));var util=require(_0xddbc('0x1'));var path=require(_0xddbc('0x2'));var timeout=require(_0xddbc('0x3'));var express=require(_0xddbc('0x4'));var router=express[_0xddbc('0x5')]();var fs_extra=require(_0xddbc('0x6'));var auth=require(_0xddbc('0x7'));var interaction=require(_0xddbc('0x8'));var config=require(_0xddbc('0x9'));var controller=require(_0xddbc('0xa'));router[_0xddbc('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xddbc('0xc')](),controller[_0xddbc('0xd')]);router[_0xddbc('0xb')](_0xddbc('0xe'),auth[_0xddbc('0xc')](),controller[_0xddbc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddbc('0x10')]);router[_0xddbc('0x11')](_0xddbc('0xe'),auth[_0xddbc('0xc')](),controller[_0xddbc('0x12')]);router[_0xddbc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xddbc('0x14')]);module[_0xddbc('0x15')]=router; \ No newline at end of file +var _0xbe84=['/:id','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','post','create','put'];(function(_0x2fe155,_0x106532){var _0xdfcb6=function(_0x5ad565){while(--_0x5ad565){_0x2fe155['push'](_0x2fe155['shift']());}};_0xdfcb6(++_0x106532);}(_0xbe84,0x1de));var _0x4be8=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xbe84[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x4be8('0x0'));var util=require(_0x4be8('0x1'));var path=require(_0x4be8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4be8('0x3'));var router=express[_0x4be8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4be8('0x5'));var interaction=require(_0x4be8('0x6'));var config=require('../../config/environment');var controller=require(_0x4be8('0x7'));router[_0x4be8('0x8')]('/',auth[_0x4be8('0x9')](),controller[_0x4be8('0xa')]);router[_0x4be8('0x8')](_0x4be8('0xb'),auth[_0x4be8('0x9')](),controller[_0x4be8('0xc')]);router[_0x4be8('0x8')]('/:id',auth[_0x4be8('0x9')](),controller['show']);router[_0x4be8('0xd')]('/',auth[_0x4be8('0x9')](),controller[_0x4be8('0xe')]);router[_0x4be8('0xf')](_0x4be8('0x10'),auth[_0x4be8('0x9')](),controller['update']);router[_0x4be8('0x11')](_0x4be8('0x10'),auth[_0x4be8('0x9')](),controller[_0x4be8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 9c48521..ddaec76 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 _0xbeea=['sequelize','STRING','name'];(function(_0x36ea27,_0x27d9da){var _0x40e23c=function(_0x3170e7){while(--_0x3170e7){_0x36ea27['push'](_0x36ea27['shift']());}};_0x40e23c(++_0x27d9da);}(_0xbeea,0xb1));var _0xabee=function(_0x595cfc,_0x22ea3b){_0x595cfc=_0x595cfc-0x0;var _0x1213fd=_0xbeea[_0x595cfc];return _0x1213fd;};'use strict';var Sequelize=require(_0xabee('0x0'));module['exports']={'name':{'type':Sequelize[_0xabee('0x1')],'unique':_0xabee('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xabee('0x1')]}}; \ No newline at end of file +var _0x4873=['exports','STRING','sequelize'];(function(_0x29b5f3,_0x19f626){var _0x473ea7=function(_0x519df2){while(--_0x519df2){_0x29b5f3['push'](_0x29b5f3['shift']());}};_0x473ea7(++_0x19f626);}(_0x4873,0x1df));var _0x3487=function(_0x169885,_0x5d5643){_0x169885=_0x169885-0x0;var _0x19b5cc=_0x4873[_0x169885];return _0x19b5cc;};'use strict';var Sequelize=require(_0x3487('0x0'));module[_0x3487('0x1')]={'name':{'type':Sequelize[_0x3487('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3487('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1fe78a1..10288e9 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 _0x118d=['status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','params','create','body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus'];(function(_0x597997,_0x34a84e){var _0x3274da=function(_0xd83f59){while(--_0xd83f59){_0x597997['push'](_0x597997['shift']());}};_0x3274da(++_0x34a84e);}(_0x118d,0xb6));var _0xd118=function(_0x1e07d6,_0x1b3000){_0x1e07d6=_0x1e07d6-0x0;var _0x91f1f3=_0x118d[_0x1e07d6];return _0x91f1f3;};'use strict';var emlformat=require(_0xd118('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd118('0x1'));var rp=require('request-promise');var moment=require(_0xd118('0x2'));var BPromise=require(_0xd118('0x3'));var Mustache=require(_0xd118('0x4'));var util=require('util');var path=require(_0xd118('0x5'));var sox=require('sox');var csv=require(_0xd118('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd118('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd118('0x8'));var jsforce=require(_0xd118('0x9'));var deskjs=require(_0xd118('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd118('0xb'));var Papa=require(_0xd118('0xc'));var Redis=require(_0xd118('0xd'));var authService=require(_0xd118('0xe'));var qs=require(_0xd118('0xf'));var as=require(_0xd118('0x10'));var hardwareService=require(_0xd118('0x11'));var logger=require(_0xd118('0x12'))(_0xd118('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd118('0x14'))['db'];function respondWithStatusCode(_0x439f00,_0x2e5b36){_0x2e5b36=_0x2e5b36||0xcc;return function(_0x1445dc){if(_0x1445dc){return _0x439f00[_0xd118('0x15')](_0x2e5b36);}return _0x439f00[_0xd118('0x16')](_0x2e5b36)[_0xd118('0x17')]();};}function respondWithResult(_0x59e9f4,_0x9da504){_0x9da504=_0x9da504||0xc8;return function(_0x591833){if(_0x591833){return _0x59e9f4[_0xd118('0x16')](_0x9da504)[_0xd118('0x18')](_0x591833);}};}function respondWithFilteredResult(_0x489b7f,_0xd9eca0){return function(_0x4f30cf){if(_0x4f30cf){var _0xc8f493=typeof _0xd9eca0[_0xd118('0x19')]===_0xd118('0x1a')&&typeof _0xd9eca0[_0xd118('0x1b')]===_0xd118('0x1a');var _0x487bc1=_0x4f30cf[_0xd118('0x1c')];var _0x5c4aae=_0xc8f493?0x0:_0xd9eca0[_0xd118('0x19')];var _0xc004f6=_0xc8f493?_0x4f30cf[_0xd118('0x1c')]:_0xd9eca0[_0xd118('0x19')]+_0xd9eca0[_0xd118('0x1b')];var _0x46bc8d;if(_0xc004f6>=_0x487bc1){_0xc004f6=_0x487bc1;_0x46bc8d=0xc8;}else{_0x46bc8d=0xce;}_0x489b7f[_0xd118('0x16')](_0x46bc8d);return _0x489b7f['set']('Content-Range',_0x5c4aae+'-'+_0xc004f6+'/'+_0x487bc1)[_0xd118('0x18')](_0x4f30cf);}return null;};}function patchUpdates(_0x49f122){return function(_0x3bdd51){try{jsonpatch[_0xd118('0x1d')](_0x3bdd51,_0x49f122,!![]);}catch(_0x4839fa){return BPromise['reject'](_0x4839fa);}return _0x3bdd51['save']();};}function saveUpdates(_0x3a3681,_0x3093b0){return function(_0x369992){if(_0x369992){return _0x369992[_0xd118('0x1e')](_0x3a3681)[_0xd118('0x1f')](function(_0x339469){return _0x339469;});}return null;};}function removeEntity(_0x73744f,_0x372eb9){return function(_0xe5af06){if(_0xe5af06){return _0xe5af06[_0xd118('0x20')]()[_0xd118('0x1f')](function(){_0x73744f[_0xd118('0x16')](0xcc)[_0xd118('0x17')]();});}};}function handleEntityNotFound(_0x3ab0f2,_0x464ff6){return function(_0x4a6d28){if(!_0x4a6d28){_0x3ab0f2['sendStatus'](0x194);}return _0x4a6d28;};}function handleError(_0x426514,_0x4bb18c){_0x4bb18c=_0x4bb18c||0x1f4;return function(_0x293892){logger[_0xd118('0x21')](_0x293892[_0xd118('0x22')]);if(_0x293892['name']){delete _0x293892[_0xd118('0x23')];}_0x426514[_0xd118('0x16')](_0x4bb18c)[_0xd118('0x24')](_0x293892);};}exports[_0xd118('0x25')]=function(_0x4f5703,_0x107db5){var _0x29daa5={},_0x360af5={},_0x55d79d={'count':0x0,'rows':[]};var _0x227986=_[_0xd118('0x26')](db[_0xd118('0x27')][_0xd118('0x28')],function(_0xf2e06b){return{'name':_0xf2e06b['fieldName'],'type':_0xf2e06b['type'][_0xd118('0x29')]};});_0x360af5['model']=_[_0xd118('0x26')](_0x227986,_0xd118('0x23'));_0x360af5[_0xd118('0x2a')]=_[_0xd118('0x2b')](_0x4f5703[_0xd118('0x2a')]);_0x360af5[_0xd118('0x2c')]=_[_0xd118('0x2d')](_0x360af5[_0xd118('0x2e')],_0x360af5['query']);_0x29daa5[_0xd118('0x2f')]=_[_0xd118('0x2d')](_0x360af5['model'],qs[_0xd118('0x30')](_0x4f5703['query'][_0xd118('0x30')]));_0x29daa5['attributes']=_0x29daa5[_0xd118('0x2f')][_0xd118('0x31')]?_0x29daa5['attributes']:_0x360af5[_0xd118('0x2e')];if(!_0x4f5703['query'][_0xd118('0x32')]('nolimit')){_0x29daa5[_0xd118('0x1b')]=qs[_0xd118('0x1b')](_0x4f5703[_0xd118('0x2a')][_0xd118('0x1b')]);_0x29daa5[_0xd118('0x19')]=qs[_0xd118('0x19')](_0x4f5703[_0xd118('0x2a')][_0xd118('0x19')]);}_0x29daa5[_0xd118('0x33')]=qs['sort'](_0x4f5703[_0xd118('0x2a')][_0xd118('0x34')]);_0x29daa5[_0xd118('0x35')]=qs['filters'](_[_0xd118('0x36')](_0x4f5703['query'],_0x360af5['filters']),_0x227986);if(_0x4f5703['query'][_0xd118('0x37')]){_0x29daa5[_0xd118('0x35')]=_[_0xd118('0x38')](_0x29daa5[_0xd118('0x35')],{'$or':_[_0xd118('0x26')](_0x227986,function(_0x3ee96e){if(_0x3ee96e[_0xd118('0x39')]!=='VIRTUAL'){var _0x15145b={};_0x15145b[_0x3ee96e[_0xd118('0x23')]]={'$like':'%'+_0x4f5703['query'][_0xd118('0x37')]+'%'};return _0x15145b;}})});}_0x29daa5=_['merge']({},_0x29daa5,_0x4f5703[_0xd118('0x3a')]);var _0x586bf6={'where':_0x29daa5[_0xd118('0x35')]};return db[_0xd118('0x27')][_0xd118('0x1c')](_0x586bf6)['then'](function(_0x315a7c){_0x55d79d[_0xd118('0x1c')]=_0x315a7c;if(_0x4f5703[_0xd118('0x2a')][_0xd118('0x3b')]){_0x29daa5[_0xd118('0x3c')]=[{'all':!![]}];}return db['MailSubstatus'][_0xd118('0x3d')](_0x29daa5);})[_0xd118('0x1f')](function(_0x3f9ff4){_0x55d79d['rows']=_0x3f9ff4;return _0x55d79d;})[_0xd118('0x1f')](respondWithFilteredResult(_0x107db5,_0x29daa5))[_0xd118('0x3e')](handleError(_0x107db5,null));};exports['show']=function(_0x12c79a,_0x439863){var _0x1d7ae3={'raw':!![],'where':{'id':_0x12c79a[_0xd118('0x3f')]['id']}},_0xaab31b={};_0xaab31b['model']=_[_0xd118('0x2b')](db[_0xd118('0x27')][_0xd118('0x28')]);_0xaab31b['query']=_[_0xd118('0x2b')](_0x12c79a[_0xd118('0x2a')]);_0xaab31b[_0xd118('0x2c')]=_['intersection'](_0xaab31b[_0xd118('0x2e')],_0xaab31b['query']);_0x1d7ae3[_0xd118('0x2f')]=_[_0xd118('0x2d')](_0xaab31b[_0xd118('0x2e')],qs[_0xd118('0x30')](_0x12c79a['query']['fields']));_0x1d7ae3[_0xd118('0x2f')]=_0x1d7ae3[_0xd118('0x2f')]['length']?_0x1d7ae3[_0xd118('0x2f')]:_0xaab31b[_0xd118('0x2e')];if(_0x12c79a[_0xd118('0x2a')][_0xd118('0x3b')]){_0x1d7ae3[_0xd118('0x3c')]=[{'all':!![]}];}_0x1d7ae3=_['merge']({},_0x1d7ae3,_0x12c79a[_0xd118('0x3a')]);return db['MailSubstatus']['find'](_0x1d7ae3)[_0xd118('0x1f')](handleEntityNotFound(_0x439863,null))[_0xd118('0x1f')](respondWithResult(_0x439863,null))[_0xd118('0x3e')](handleError(_0x439863,null));};exports['create']=function(_0x1bc182,_0x509207){return db[_0xd118('0x27')][_0xd118('0x40')](_0x1bc182['body'],{})['then'](respondWithResult(_0x509207,0xc9))[_0xd118('0x3e')](handleError(_0x509207,null));};exports[_0xd118('0x1e')]=function(_0x2e668f,_0x2228ab){if(_0x2e668f['body']['id']){delete _0x2e668f['body']['id'];}return db[_0xd118('0x27')]['find']({'where':{'id':_0x2e668f['params']['id']}})['then'](handleEntityNotFound(_0x2228ab,null))[_0xd118('0x1f')](saveUpdates(_0x2e668f[_0xd118('0x41')],null))['then'](respondWithResult(_0x2228ab,null))['catch'](handleError(_0x2228ab,null));};exports[_0xd118('0x20')]=function(_0x52a024,_0x1cd3c7){return db[_0xd118('0x27')][_0xd118('0x42')]({'where':{'id':_0x52a024[_0xd118('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cd3c7,null))[_0xd118('0x1f')](removeEntity(_0x1cd3c7,null))[_0xd118('0x3e')](handleError(_0x1cd3c7,null));};exports[_0xd118('0x43')]=function(_0x35efeb,_0xc770e){return db[_0xd118('0x27')][_0xd118('0x43')]()['then'](respondWithResult(_0xc770e,null))[_0xd118('0x3e')](handleError(_0xc770e,null));}; \ No newline at end of file +var _0x9d92=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','destroy','then','stack','name','send','index','MailSubstatus','rawAttributes','type','key','keys','intersection','model','query','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe'];(function(_0x5e1880,_0x19d704){var _0x4c642f=function(_0x29d311){while(--_0x29d311){_0x5e1880['push'](_0x5e1880['shift']());}};_0x4c642f(++_0x19d704);}(_0x9d92,0x1b6));var _0x29d9=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x9d92[_0x5e2cb4];return _0x282902;};'use strict';var emlformat=require(_0x29d9('0x0'));var rimraf=require(_0x29d9('0x1'));var zipdir=require(_0x29d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29d9('0x3'));var moment=require(_0x29d9('0x4'));var BPromise=require(_0x29d9('0x5'));var Mustache=require(_0x29d9('0x6'));var util=require(_0x29d9('0x7'));var path=require(_0x29d9('0x8'));var sox=require(_0x29d9('0x9'));var csv=require('to-csv');var ejs=require(_0x29d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29d9('0xb'));var squel=require('squel');var crypto=require(_0x29d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29d9('0xd'));var toCsv=require(_0x29d9('0xe'));var querystring=require(_0x29d9('0xf'));var Papa=require('papaparse');var Redis=require(_0x29d9('0x10'));var authService=require(_0x29d9('0x11'));var qs=require(_0x29d9('0x12'));var as=require(_0x29d9('0x13'));var hardwareService=require(_0x29d9('0x14'));var logger=require(_0x29d9('0x15'))(_0x29d9('0x16'));var utils=require(_0x29d9('0x17'));var config=require(_0x29d9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x29d9('0x19'))['db'];function respondWithStatusCode(_0x3c70d7,_0x573893){_0x573893=_0x573893||0xcc;return function(_0x603240){if(_0x603240){return _0x3c70d7[_0x29d9('0x1a')](_0x573893);}return _0x3c70d7[_0x29d9('0x1b')](_0x573893)[_0x29d9('0x1c')]();};}function respondWithResult(_0x4f7ce3,_0x5bb5f5){_0x5bb5f5=_0x5bb5f5||0xc8;return function(_0x1e135f){if(_0x1e135f){return _0x4f7ce3[_0x29d9('0x1b')](_0x5bb5f5)[_0x29d9('0x1d')](_0x1e135f);}};}function respondWithFilteredResult(_0x56890f,_0x56dc3f){return function(_0x46fb8e){if(_0x46fb8e){var _0x5a4e7b=typeof _0x56dc3f[_0x29d9('0x1e')]==='undefined'&&typeof _0x56dc3f['limit']===_0x29d9('0x1f');var _0x81d1b5=_0x46fb8e[_0x29d9('0x20')];var _0x4a0657=_0x5a4e7b?0x0:_0x56dc3f['offset'];var _0x345bfa=_0x5a4e7b?_0x46fb8e[_0x29d9('0x20')]:_0x56dc3f['offset']+_0x56dc3f[_0x29d9('0x21')];var _0x1c9b2d;if(_0x345bfa>=_0x81d1b5){_0x345bfa=_0x81d1b5;_0x1c9b2d=0xc8;}else{_0x1c9b2d=0xce;}_0x56890f[_0x29d9('0x1b')](_0x1c9b2d);return _0x56890f['set']('Content-Range',_0x4a0657+'-'+_0x345bfa+'/'+_0x81d1b5)['json'](_0x46fb8e);}return null;};}function patchUpdates(_0x41794f){return function(_0x5e5237){try{jsonpatch[_0x29d9('0x22')](_0x5e5237,_0x41794f,!![]);}catch(_0x176400){return BPromise['reject'](_0x176400);}return _0x5e5237[_0x29d9('0x23')]();};}function saveUpdates(_0x551e64,_0x5f4acc){return function(_0x8f8d9d){if(_0x8f8d9d){return _0x8f8d9d[_0x29d9('0x24')](_0x551e64)['then'](function(_0x5d56c3){return _0x5d56c3;});}return null;};}function removeEntity(_0x54f1ad,_0x168169){return function(_0x2c0807){if(_0x2c0807){return _0x2c0807[_0x29d9('0x25')]()[_0x29d9('0x26')](function(){_0x54f1ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6474,_0x3a80a8){return function(_0x2e1bde){if(!_0x2e1bde){_0x2d6474['sendStatus'](0x194);}return _0x2e1bde;};}function handleError(_0x4c61b6,_0x23492f){_0x23492f=_0x23492f||0x1f4;return function(_0x3d6dc9){logger['error'](_0x3d6dc9[_0x29d9('0x27')]);if(_0x3d6dc9[_0x29d9('0x28')]){delete _0x3d6dc9['name'];}_0x4c61b6[_0x29d9('0x1b')](_0x23492f)[_0x29d9('0x29')](_0x3d6dc9);};}exports[_0x29d9('0x2a')]=function(_0x33399f,_0x14809a){var _0x57d18c={},_0x2f361f={},_0x30892a={'count':0x0,'rows':[]};var _0x376699=_['map'](db[_0x29d9('0x2b')][_0x29d9('0x2c')],function(_0xe38d1){return{'name':_0xe38d1['fieldName'],'type':_0xe38d1[_0x29d9('0x2d')][_0x29d9('0x2e')]};});_0x2f361f['model']=_['map'](_0x376699,_0x29d9('0x28'));_0x2f361f['query']=_[_0x29d9('0x2f')](_0x33399f['query']);_0x2f361f['filters']=_[_0x29d9('0x30')](_0x2f361f[_0x29d9('0x31')],_0x2f361f[_0x29d9('0x32')]);_0x57d18c[_0x29d9('0x33')]=_['intersection'](_0x2f361f['model'],qs['fields'](_0x33399f[_0x29d9('0x32')][_0x29d9('0x34')]));_0x57d18c[_0x29d9('0x33')]=_0x57d18c[_0x29d9('0x33')][_0x29d9('0x35')]?_0x57d18c['attributes']:_0x2f361f['model'];if(!_0x33399f[_0x29d9('0x32')]['hasOwnProperty'](_0x29d9('0x36'))){_0x57d18c[_0x29d9('0x21')]=qs[_0x29d9('0x21')](_0x33399f[_0x29d9('0x32')]['limit']);_0x57d18c[_0x29d9('0x1e')]=qs[_0x29d9('0x1e')](_0x33399f[_0x29d9('0x32')]['offset']);}_0x57d18c['order']=qs[_0x29d9('0x37')](_0x33399f['query'][_0x29d9('0x37')]);_0x57d18c[_0x29d9('0x38')]=qs[_0x29d9('0x39')](_[_0x29d9('0x3a')](_0x33399f[_0x29d9('0x32')],_0x2f361f['filters']),_0x376699);if(_0x33399f[_0x29d9('0x32')][_0x29d9('0x3b')]){_0x57d18c[_0x29d9('0x38')]=_['merge'](_0x57d18c[_0x29d9('0x38')],{'$or':_['map'](_0x376699,function(_0x5d9396){if(_0x5d9396[_0x29d9('0x2d')]!==_0x29d9('0x3c')){var _0x23f792={};_0x23f792[_0x5d9396[_0x29d9('0x28')]]={'$like':'%'+_0x33399f['query'][_0x29d9('0x3b')]+'%'};return _0x23f792;}})});}_0x57d18c=_[_0x29d9('0x3d')]({},_0x57d18c,_0x33399f['options']);var _0x3fbef0={'where':_0x57d18c[_0x29d9('0x38')]};return db[_0x29d9('0x2b')]['count'](_0x3fbef0)[_0x29d9('0x26')](function(_0xe7e78f){_0x30892a['count']=_0xe7e78f;if(_0x33399f[_0x29d9('0x32')]['includeAll']){_0x57d18c[_0x29d9('0x3e')]=[{'all':!![]}];}return db[_0x29d9('0x2b')][_0x29d9('0x3f')](_0x57d18c);})[_0x29d9('0x26')](function(_0x204279){_0x30892a[_0x29d9('0x40')]=_0x204279;return _0x30892a;})[_0x29d9('0x26')](respondWithFilteredResult(_0x14809a,_0x57d18c))[_0x29d9('0x41')](handleError(_0x14809a,null));};exports[_0x29d9('0x42')]=function(_0x1361f7,_0x35656d){var _0x1600a5={'raw':!![],'where':{'id':_0x1361f7[_0x29d9('0x43')]['id']}},_0xac85af={};_0xac85af[_0x29d9('0x31')]=_['keys'](db[_0x29d9('0x2b')][_0x29d9('0x2c')]);_0xac85af[_0x29d9('0x32')]=_[_0x29d9('0x2f')](_0x1361f7[_0x29d9('0x32')]);_0xac85af[_0x29d9('0x39')]=_[_0x29d9('0x30')](_0xac85af[_0x29d9('0x31')],_0xac85af[_0x29d9('0x32')]);_0x1600a5[_0x29d9('0x33')]=_[_0x29d9('0x30')](_0xac85af[_0x29d9('0x31')],qs[_0x29d9('0x34')](_0x1361f7['query'][_0x29d9('0x34')]));_0x1600a5[_0x29d9('0x33')]=_0x1600a5[_0x29d9('0x33')][_0x29d9('0x35')]?_0x1600a5[_0x29d9('0x33')]:_0xac85af[_0x29d9('0x31')];if(_0x1361f7['query'][_0x29d9('0x44')]){_0x1600a5['include']=[{'all':!![]}];}_0x1600a5=_[_0x29d9('0x3d')]({},_0x1600a5,_0x1361f7['options']);return db[_0x29d9('0x2b')][_0x29d9('0x45')](_0x1600a5)['then'](handleEntityNotFound(_0x35656d,null))['then'](respondWithResult(_0x35656d,null))[_0x29d9('0x41')](handleError(_0x35656d,null));};exports['create']=function(_0x2ffb05,_0x2c687f){return db[_0x29d9('0x2b')][_0x29d9('0x46')](_0x2ffb05[_0x29d9('0x47')],{})[_0x29d9('0x26')](respondWithResult(_0x2c687f,0xc9))[_0x29d9('0x41')](handleError(_0x2c687f,null));};exports[_0x29d9('0x24')]=function(_0x3f76e2,_0x369989){if(_0x3f76e2[_0x29d9('0x47')]['id']){delete _0x3f76e2[_0x29d9('0x47')]['id'];}return db[_0x29d9('0x2b')][_0x29d9('0x45')]({'where':{'id':_0x3f76e2[_0x29d9('0x43')]['id']}})[_0x29d9('0x26')](handleEntityNotFound(_0x369989,null))['then'](saveUpdates(_0x3f76e2['body'],null))[_0x29d9('0x26')](respondWithResult(_0x369989,null))['catch'](handleError(_0x369989,null));};exports[_0x29d9('0x25')]=function(_0x52f4f1,_0x202dd7){return db['MailSubstatus']['find']({'where':{'id':_0x52f4f1['params']['id']}})['then'](handleEntityNotFound(_0x202dd7,null))[_0x29d9('0x26')](removeEntity(_0x202dd7,null))['catch'](handleError(_0x202dd7,null));};exports['describe']=function(_0x46ed46,_0x1169b8){return db[_0x29d9('0x2b')][_0x29d9('0x48')]()[_0x29d9('0x26')](respondWithResult(_0x1169b8,null))[_0x29d9('0x41')](handleError(_0x1169b8,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4fe3423..c29d764 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 _0x5f08=['bluebird','request-promise','path','rimraf','define','mail_substatuses','util','api','moment'];(function(_0x2d34ca,_0x468d6d){var _0x33711d=function(_0x5ee7e3){while(--_0x5ee7e3){_0x2d34ca['push'](_0x2d34ca['shift']());}};_0x33711d(++_0x468d6d);}(_0x5f08,0x138));var _0x85f0=function(_0x18ea38,_0x5b07e5){_0x18ea38=_0x18ea38-0x0;var _0x38060e=_0x5f08[_0x18ea38];return _0x38060e;};'use strict';var _=require('lodash');var util=require(_0x85f0('0x0'));var logger=require('../../config/logger')(_0x85f0('0x1'));var moment=require(_0x85f0('0x2'));var BPromise=require(_0x85f0('0x3'));var rp=require(_0x85f0('0x4'));var fs=require('fs');var path=require(_0x85f0('0x5'));var rimraf=require(_0x85f0('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x52e118,_0x594624){return _0x52e118[_0x85f0('0x7')]('MailSubstatus',attributes,{'tableName':_0x85f0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb872=['exports','MailSubstatus','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xb872,0x16d));var _0x2b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb872[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2b87('0x0'));var logger=require(_0x2b87('0x1'))('api');var moment=require(_0x2b87('0x2'));var BPromise=require(_0x2b87('0x3'));var rp=require(_0x2b87('0x4'));var fs=require('fs');var path=require(_0x2b87('0x5'));var rimraf=require(_0x2b87('0x6'));var config=require(_0x2b87('0x7'));var attributes=require(_0x2b87('0x8'));module[_0x2b87('0x9')]=function(_0x5bdcc2,_0x1985f0){return _0x5bdcc2['define'](_0x2b87('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 858492d..e208dae 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 _0x3fea=['request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x22a4b8,_0x248b69){var _0x31b39c=function(_0x1375e8){while(--_0x1375e8){_0x22a4b8['push'](_0x22a4b8['shift']());}};_0x31b39c(++_0x248b69);}(_0x3fea,0x1bc));var _0xa3fe=function(_0x1c4a24,_0x2632e4){_0x1c4a24=_0x1c4a24-0x0;var _0x1ad99e=_0x3fea[_0x1c4a24];return _0x1ad99e;};'use strict';var _=require(_0xa3fe('0x0'));var util=require(_0xa3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3fe('0x2'));var fs=require('fs');var Redis=require(_0xa3fe('0x3'));var db=require(_0xa3fe('0x4'))['db'];var utils=require(_0xa3fe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa3fe('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3fe('0x7')][_0xa3fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2971ba,_0x224ae8,_0x16ea77){return new BPromise(function(_0x22a5a3,_0x3a9f7c){return client['request'](_0x2971ba,_0x16ea77)[_0xa3fe('0x9')](function(_0x293d3c){logger[_0xa3fe('0xa')](_0xa3fe('0xb'),_0x224ae8,_0xa3fe('0xc'));logger['debug'](_0xa3fe('0xd'),_0x224ae8,_0xa3fe('0xc'),JSON['stringify'](_0x293d3c));if(_0x293d3c[_0xa3fe('0xe')]){if(_0x293d3c[_0xa3fe('0xe')][_0xa3fe('0xf')]===0x1f4){logger['error'](_0xa3fe('0xb'),_0x224ae8,_0x293d3c['error'][_0xa3fe('0x10')]);return _0x3a9f7c(_0x293d3c['error'][_0xa3fe('0x10')]);}logger['error'](_0xa3fe('0xb'),_0x224ae8,_0x293d3c[_0xa3fe('0xe')][_0xa3fe('0x10')]);return _0x22a5a3(_0x293d3c['error'][_0xa3fe('0x10')]);}else{logger[_0xa3fe('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x224ae8,_0xa3fe('0xc'));_0x22a5a3(_0x293d3c[_0xa3fe('0x11')]['message']);}})[_0xa3fe('0x12')](function(_0x20aaf7){logger[_0xa3fe('0xe')](_0xa3fe('0xb'),_0x224ae8,_0x20aaf7);_0x3a9f7c(_0x20aaf7);});});} \ No newline at end of file +var _0x7fe1=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x560471,_0x2de3f6){var _0x58a817=function(_0x39b589){while(--_0x39b589){_0x560471['push'](_0x560471['shift']());}};_0x58a817(++_0x2de3f6);}(_0x7fe1,0x96));var _0x17fe=function(_0x4e4a38,_0x13b3a0){_0x4e4a38=_0x4e4a38-0x0;var _0x2fe004=_0x7fe1[_0x4e4a38];return _0x2fe004;};'use strict';var _=require(_0x17fe('0x0'));var util=require(_0x17fe('0x1'));var moment=require('moment');var BPromise=require(_0x17fe('0x2'));var rs=require(_0x17fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x17fe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x17fe('0x5'));var jayson=require(_0x17fe('0x6'));var client=jayson[_0x17fe('0x7')][_0x17fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e2730,_0x545e06,_0x2ad648){return new BPromise(function(_0x327a4f,_0x1a175e){return client[_0x17fe('0x9')](_0x5e2730,_0x2ad648)['then'](function(_0x463c2c){logger[_0x17fe('0xa')](_0x17fe('0xb'),_0x545e06,_0x17fe('0xc'));logger[_0x17fe('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x545e06,_0x17fe('0xc'),JSON[_0x17fe('0xe')](_0x463c2c));if(_0x463c2c[_0x17fe('0xf')]){if(_0x463c2c[_0x17fe('0xf')][_0x17fe('0x10')]===0x1f4){logger[_0x17fe('0xf')](_0x17fe('0xb'),_0x545e06,_0x463c2c[_0x17fe('0xf')][_0x17fe('0x11')]);return _0x1a175e(_0x463c2c[_0x17fe('0xf')][_0x17fe('0x11')]);}logger[_0x17fe('0xf')](_0x17fe('0xb'),_0x545e06,_0x463c2c['error'][_0x17fe('0x11')]);return _0x327a4f(_0x463c2c[_0x17fe('0xf')]['message']);}else{logger[_0x17fe('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x545e06,_0x17fe('0xc'));_0x327a4f(_0x463c2c[_0x17fe('0x12')][_0x17fe('0x11')]);}})[_0x17fe('0x13')](function(_0x4db62d){logger[_0x17fe('0xf')](_0x17fe('0xb'),_0x545e06,_0x4db62d);_0x1a175e(_0x4db62d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 86a2e6a..3f94ab4 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 _0x2c53=['index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x7d3837,_0x54b098){var _0x240ff3=function(_0x252406){while(--_0x252406){_0x7d3837['push'](_0x7d3837['shift']());}};_0x240ff3(++_0x54b098);}(_0x2c53,0x166));var _0x32c5=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x2c53[_0x4695ba];return _0x524b7d;};'use strict';var multer=require(_0x32c5('0x0'));var util=require(_0x32c5('0x1'));var path=require(_0x32c5('0x2'));var timeout=require(_0x32c5('0x3'));var express=require(_0x32c5('0x4'));var router=express[_0x32c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32c5('0x6'));var interaction=require(_0x32c5('0x7'));var config=require('../../config/environment');var controller=require(_0x32c5('0x8'));router[_0x32c5('0x9')]('/',auth['isAuthenticated'](),controller[_0x32c5('0xa')]);router['get'](_0x32c5('0xb'),auth[_0x32c5('0xc')](),controller[_0x32c5('0xd')]);router['get']('/:id',auth[_0x32c5('0xc')](),controller[_0x32c5('0xe')]);router[_0x32c5('0xf')]('/',auth['isAuthenticated'](),controller[_0x32c5('0x10')]);router[_0x32c5('0x11')](_0x32c5('0x12'),auth['isAuthenticated'](),controller[_0x32c5('0x13')]);router[_0x32c5('0x14')](_0x32c5('0x12'),auth['isAuthenticated'](),controller[_0x32c5('0x15')]);module[_0x32c5('0x16')]=router; \ No newline at end of file +var _0x24bb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','/describe','describe','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x361cf7,_0x3ee81b){var _0x49186b=function(_0xfb8371){while(--_0xfb8371){_0x361cf7['push'](_0x361cf7['shift']());}};_0x49186b(++_0x3ee81b);}(_0x24bb,0x151));var _0xb24b=function(_0x15fd15,_0x12f457){_0x15fd15=_0x15fd15-0x0;var _0x4aec8e=_0x24bb[_0x15fd15];return _0x4aec8e;};'use strict';var multer=require(_0xb24b('0x0'));var util=require('util');var path=require(_0xb24b('0x1'));var timeout=require(_0xb24b('0x2'));var express=require(_0xb24b('0x3'));var router=express[_0xb24b('0x4')]();var fs_extra=require(_0xb24b('0x5'));var auth=require(_0xb24b('0x6'));var interaction=require(_0xb24b('0x7'));var config=require(_0xb24b('0x8'));var controller=require(_0xb24b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb24b('0xa')]);router['get'](_0xb24b('0xb'),auth['isAuthenticated'](),controller[_0xb24b('0xc')]);router[_0xb24b('0xd')](_0xb24b('0xe'),auth[_0xb24b('0xf')](),controller[_0xb24b('0x10')]);router[_0xb24b('0x11')]('/',auth[_0xb24b('0xf')](),controller[_0xb24b('0x12')]);router[_0xb24b('0x13')](_0xb24b('0xe'),auth['isAuthenticated'](),controller[_0xb24b('0x14')]);router[_0xb24b('0x15')](_0xb24b('0xe'),auth[_0xb24b('0xf')](),controller[_0xb24b('0x16')]);module[_0xb24b('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 84563ac..e58ea0f 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x572e92,_0x5b8c78){var _0x50bf10=function(_0x4001d3){while(--_0x4001d3){_0x572e92['push'](_0x572e92['shift']());}};_0x50bf10(++_0x5b8c78);}(_0x008c,0x188));var _0xc008=function(_0x42f2a7,_0x5917c6){_0x42f2a7=_0x42f2a7-0x0;var _0x999180=_0x008c[_0x42f2a7];return _0x999180;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xaf0684,_0x393697){var _0x3d4c7c=function(_0x36473f){while(--_0x36473f){_0xaf0684['push'](_0xaf0684['shift']());}};_0x3d4c7c(++_0x393697);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xcb91[_0x506172];return _0x2723c0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 484a979..c2a21bc 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 _0xfd32=['where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','fast-json-patch','request-promise','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','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3b72b3,_0x339310){var _0x540a70=function(_0x4f5868){while(--_0x4f5868){_0x3b72b3['push'](_0x3b72b3['shift']());}};_0x540a70(++_0x339310);}(_0xfd32,0xf1));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fd3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fd3('0x1'));var rp=require(_0x2fd3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2fd3('0x3'));var util=require(_0x2fd3('0x4'));var path=require('path');var sox=require(_0x2fd3('0x5'));var csv=require(_0x2fd3('0x6'));var ejs=require(_0x2fd3('0x7'));var fs=require('fs');var fs_extra=require(_0x2fd3('0x8'));var _=require(_0x2fd3('0x9'));var squel=require(_0x2fd3('0xa'));var crypto=require(_0x2fd3('0xb'));var jsforce=require(_0x2fd3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2fd3('0x6'));var querystring=require(_0x2fd3('0xd'));var Papa=require(_0x2fd3('0xe'));var Redis=require(_0x2fd3('0xf'));var authService=require(_0x2fd3('0x10'));var qs=require(_0x2fd3('0x11'));var as=require(_0x2fd3('0x12'));var hardwareService=require(_0x2fd3('0x13'));var logger=require('../../config/logger')(_0x2fd3('0x14'));var utils=require('../../config/utils');var config=require(_0x2fd3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198a41,_0x7f743){_0x7f743=_0x7f743||0xcc;return function(_0x48ba81){if(_0x48ba81){return _0x198a41[_0x2fd3('0x16')](_0x7f743);}return _0x198a41['status'](_0x7f743)[_0x2fd3('0x17')]();};}function respondWithResult(_0x26e675,_0x2b564e){_0x2b564e=_0x2b564e||0xc8;return function(_0x2e30ec){if(_0x2e30ec){return _0x26e675[_0x2fd3('0x18')](_0x2b564e)[_0x2fd3('0x19')](_0x2e30ec);}};}function respondWithFilteredResult(_0x21efbf,_0x1df803){return function(_0xa8e68b){if(_0xa8e68b){var _0x5e6abe=typeof _0x1df803[_0x2fd3('0x1a')]===_0x2fd3('0x1b')&&typeof _0x1df803[_0x2fd3('0x1c')]===_0x2fd3('0x1b');var _0x554302=_0xa8e68b[_0x2fd3('0x1d')];var _0x22374f=_0x5e6abe?0x0:_0x1df803[_0x2fd3('0x1a')];var _0xd0eb8a=_0x5e6abe?_0xa8e68b[_0x2fd3('0x1d')]:_0x1df803['offset']+_0x1df803[_0x2fd3('0x1c')];var _0x421262;if(_0xd0eb8a>=_0x554302){_0xd0eb8a=_0x554302;_0x421262=0xc8;}else{_0x421262=0xce;}_0x21efbf[_0x2fd3('0x18')](_0x421262);return _0x21efbf[_0x2fd3('0x1e')](_0x2fd3('0x1f'),_0x22374f+'-'+_0xd0eb8a+'/'+_0x554302)[_0x2fd3('0x19')](_0xa8e68b);}return null;};}function patchUpdates(_0x4ac07a){return function(_0x478b12){try{jsonpatch['apply'](_0x478b12,_0x4ac07a,!![]);}catch(_0x5e9fa5){return BPromise[_0x2fd3('0x20')](_0x5e9fa5);}return _0x478b12[_0x2fd3('0x21')]();};}function saveUpdates(_0x11eb9f,_0x276568){return function(_0x44e1b1){if(_0x44e1b1){return _0x44e1b1[_0x2fd3('0x22')](_0x11eb9f)[_0x2fd3('0x23')](function(_0x5289b8){return _0x5289b8;});}return null;};}function removeEntity(_0x56520d,_0x21f23f){return function(_0x2ae238){if(_0x2ae238){return _0x2ae238[_0x2fd3('0x24')]()[_0x2fd3('0x23')](function(){_0x56520d['status'](0xcc)[_0x2fd3('0x17')]();});}};}function handleEntityNotFound(_0x53a728,_0x4d251e){return function(_0x5d5253){if(!_0x5d5253){_0x53a728[_0x2fd3('0x16')](0x194);}return _0x5d5253;};}function handleError(_0x43c90f,_0xecc435){_0xecc435=_0xecc435||0x1f4;return function(_0x2082d8){logger[_0x2fd3('0x25')](_0x2082d8['stack']);if(_0x2082d8['name']){delete _0x2082d8[_0x2fd3('0x26')];}_0x43c90f[_0x2fd3('0x18')](_0xecc435)[_0x2fd3('0x27')](_0x2082d8);};}exports[_0x2fd3('0x28')]=function(_0x28a8fe,_0x3b0a81){var _0x4bbd63={},_0x9928b6={},_0x299c80={'count':0x0,'rows':[]};var _0x3176e2=_[_0x2fd3('0x29')](db[_0x2fd3('0x2a')][_0x2fd3('0x2b')],function(_0x32b112){return{'name':_0x32b112[_0x2fd3('0x2c')],'type':_0x32b112[_0x2fd3('0x2d')][_0x2fd3('0x2e')]};});_0x9928b6[_0x2fd3('0x2f')]=_[_0x2fd3('0x29')](_0x3176e2,_0x2fd3('0x26'));_0x9928b6[_0x2fd3('0x30')]=_[_0x2fd3('0x31')](_0x28a8fe[_0x2fd3('0x30')]);_0x9928b6[_0x2fd3('0x32')]=_[_0x2fd3('0x33')](_0x9928b6['model'],_0x9928b6[_0x2fd3('0x30')]);_0x4bbd63['attributes']=_[_0x2fd3('0x33')](_0x9928b6['model'],qs['fields'](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x34')]));_0x4bbd63[_0x2fd3('0x35')]=_0x4bbd63['attributes'][_0x2fd3('0x36')]?_0x4bbd63['attributes']:_0x9928b6['model'];if(!_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x37')](_0x2fd3('0x38'))){_0x4bbd63[_0x2fd3('0x1c')]=qs['limit'](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x1c')]);_0x4bbd63[_0x2fd3('0x1a')]=qs[_0x2fd3('0x1a')](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x1a')]);}_0x4bbd63[_0x2fd3('0x39')]=qs[_0x2fd3('0x3a')](_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3a')]);_0x4bbd63[_0x2fd3('0x3b')]=qs[_0x2fd3('0x32')](_['pick'](_0x28a8fe['query'],_0x9928b6[_0x2fd3('0x32')]),_0x3176e2);if(_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3c')]){_0x4bbd63[_0x2fd3('0x3b')]=_['merge'](_0x4bbd63[_0x2fd3('0x3b')],{'$or':_[_0x2fd3('0x29')](_0x3176e2,function(_0x67c79d){if(_0x67c79d['type']!==_0x2fd3('0x3d')){var _0x5ac511={};_0x5ac511[_0x67c79d['name']]={'$like':'%'+_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3c')]+'%'};return _0x5ac511;}})});}_0x4bbd63=_['merge']({},_0x4bbd63,_0x28a8fe[_0x2fd3('0x3e')]);var _0x5e1f30={'where':_0x4bbd63['where']};return db[_0x2fd3('0x2a')][_0x2fd3('0x1d')](_0x5e1f30)[_0x2fd3('0x23')](function(_0x38e545){_0x299c80[_0x2fd3('0x1d')]=_0x38e545;if(_0x28a8fe[_0x2fd3('0x30')][_0x2fd3('0x3f')]){_0x4bbd63[_0x2fd3('0x40')]=[{'all':!![]}];}return db[_0x2fd3('0x2a')][_0x2fd3('0x41')](_0x4bbd63);})[_0x2fd3('0x23')](function(_0x329d81){_0x299c80[_0x2fd3('0x42')]=_0x329d81;return _0x299c80;})[_0x2fd3('0x23')](respondWithFilteredResult(_0x3b0a81,_0x4bbd63))[_0x2fd3('0x43')](handleError(_0x3b0a81,null));};exports[_0x2fd3('0x44')]=function(_0x56fc69,_0x456e45){var _0xb7c72d={'raw':!![],'where':{'id':_0x56fc69[_0x2fd3('0x45')]['id']}},_0x322e37={};_0x322e37[_0x2fd3('0x2f')]=_[_0x2fd3('0x31')](db[_0x2fd3('0x2a')]['rawAttributes']);_0x322e37['query']=_[_0x2fd3('0x31')](_0x56fc69[_0x2fd3('0x30')]);_0x322e37[_0x2fd3('0x32')]=_['intersection'](_0x322e37[_0x2fd3('0x2f')],_0x322e37[_0x2fd3('0x30')]);_0xb7c72d[_0x2fd3('0x35')]=_['intersection'](_0x322e37[_0x2fd3('0x2f')],qs[_0x2fd3('0x34')](_0x56fc69[_0x2fd3('0x30')][_0x2fd3('0x34')]));_0xb7c72d[_0x2fd3('0x35')]=_0xb7c72d[_0x2fd3('0x35')][_0x2fd3('0x36')]?_0xb7c72d[_0x2fd3('0x35')]:_0x322e37[_0x2fd3('0x2f')];if(_0x56fc69[_0x2fd3('0x30')][_0x2fd3('0x3f')]){_0xb7c72d['include']=[{'all':!![]}];}_0xb7c72d=_[_0x2fd3('0x46')]({},_0xb7c72d,_0x56fc69[_0x2fd3('0x3e')]);return db[_0x2fd3('0x2a')][_0x2fd3('0x47')](_0xb7c72d)[_0x2fd3('0x23')](handleEntityNotFound(_0x456e45,null))[_0x2fd3('0x23')](respondWithResult(_0x456e45,null))['catch'](handleError(_0x456e45,null));};exports[_0x2fd3('0x48')]=function(_0x21ca66,_0x336873){return db[_0x2fd3('0x2a')]['create'](_0x21ca66[_0x2fd3('0x49')],{})[_0x2fd3('0x23')](respondWithResult(_0x336873,0xc9))[_0x2fd3('0x43')](handleError(_0x336873,null));};exports['update']=function(_0x52b937,_0x32d481){if(_0x52b937[_0x2fd3('0x49')]['id']){delete _0x52b937[_0x2fd3('0x49')]['id'];}return db[_0x2fd3('0x2a')][_0x2fd3('0x47')]({'where':{'id':_0x52b937['params']['id']}})[_0x2fd3('0x23')](handleEntityNotFound(_0x32d481,null))[_0x2fd3('0x23')](saveUpdates(_0x52b937[_0x2fd3('0x49')],null))['then'](respondWithResult(_0x32d481,null))[_0x2fd3('0x43')](handleError(_0x32d481,null));};exports[_0x2fd3('0x24')]=function(_0x4b512e,_0x2a60c3){return db['MailTransferReport'][_0x2fd3('0x47')]({'where':{'id':_0x4b512e[_0x2fd3('0x45')]['id']}})[_0x2fd3('0x23')](handleEntityNotFound(_0x2a60c3,null))[_0x2fd3('0x23')](removeEntity(_0x2a60c3,null))[_0x2fd3('0x43')](handleError(_0x2a60c3,null));};exports[_0x2fd3('0x4a')]=function(_0x5fc3ac,_0x2d8173){return db[_0x2fd3('0x2a')][_0x2fd3('0x4a')]()['then'](respondWithResult(_0x2d8173,null))[_0x2fd3('0x43')](handleError(_0x2d8173,null));}; \ No newline at end of file +var _0x5475=['fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','filters','includeAll','find','create','body','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection'];(function(_0x34becb,_0x30c334){var _0x4b241a=function(_0x53a184){while(--_0x53a184){_0x34becb['push'](_0x34becb['shift']());}};_0x4b241a(++_0x30c334);}(_0x5475,0xf9));var _0x5547=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5475[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5547('0x0'));var zipdir=require(_0x5547('0x1'));var jsonpatch=require(_0x5547('0x2'));var rp=require(_0x5547('0x3'));var moment=require(_0x5547('0x4'));var BPromise=require(_0x5547('0x5'));var Mustache=require(_0x5547('0x6'));var util=require(_0x5547('0x7'));var path=require(_0x5547('0x8'));var sox=require(_0x5547('0x9'));var csv=require(_0x5547('0xa'));var ejs=require(_0x5547('0xb'));var fs=require('fs');var fs_extra=require(_0x5547('0xc'));var _=require(_0x5547('0xd'));var squel=require(_0x5547('0xe'));var crypto=require(_0x5547('0xf'));var jsforce=require(_0x5547('0x10'));var deskjs=require(_0x5547('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5547('0x12'));var Redis=require(_0x5547('0x13'));var authService=require(_0x5547('0x14'));var qs=require(_0x5547('0x15'));var as=require(_0x5547('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5547('0x17'))('api');var utils=require(_0x5547('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5547('0x19'))['db'];function respondWithStatusCode(_0x163ca8,_0x102a29){_0x102a29=_0x102a29||0xcc;return function(_0x4ea731){if(_0x4ea731){return _0x163ca8[_0x5547('0x1a')](_0x102a29);}return _0x163ca8['status'](_0x102a29)['end']();};}function respondWithResult(_0x5b2600,_0xeeed2d){_0xeeed2d=_0xeeed2d||0xc8;return function(_0x22eee6){if(_0x22eee6){return _0x5b2600[_0x5547('0x1b')](_0xeeed2d)[_0x5547('0x1c')](_0x22eee6);}};}function respondWithFilteredResult(_0x2176f6,_0x14b8a4){return function(_0x4eb21f){if(_0x4eb21f){var _0x5d7f56=typeof _0x14b8a4['offset']===_0x5547('0x1d')&&typeof _0x14b8a4['limit']===_0x5547('0x1d');var _0x17f0af=_0x4eb21f[_0x5547('0x1e')];var _0x141732=_0x5d7f56?0x0:_0x14b8a4[_0x5547('0x1f')];var _0x23c24d=_0x5d7f56?_0x4eb21f[_0x5547('0x1e')]:_0x14b8a4['offset']+_0x14b8a4[_0x5547('0x20')];var _0x545c78;if(_0x23c24d>=_0x17f0af){_0x23c24d=_0x17f0af;_0x545c78=0xc8;}else{_0x545c78=0xce;}_0x2176f6[_0x5547('0x1b')](_0x545c78);return _0x2176f6[_0x5547('0x21')]('Content-Range',_0x141732+'-'+_0x23c24d+'/'+_0x17f0af)[_0x5547('0x1c')](_0x4eb21f);}return null;};}function patchUpdates(_0x15b03b){return function(_0x5314bc){try{jsonpatch[_0x5547('0x22')](_0x5314bc,_0x15b03b,!![]);}catch(_0x1290bb){return BPromise[_0x5547('0x23')](_0x1290bb);}return _0x5314bc[_0x5547('0x24')]();};}function saveUpdates(_0x1994ff,_0x4ee985){return function(_0x202b7d){if(_0x202b7d){return _0x202b7d[_0x5547('0x25')](_0x1994ff)[_0x5547('0x26')](function(_0x43d9e9){return _0x43d9e9;});}return null;};}function removeEntity(_0x3923f8,_0x323b76){return function(_0x4f0e58){if(_0x4f0e58){return _0x4f0e58[_0x5547('0x27')]()[_0x5547('0x26')](function(){_0x3923f8['status'](0xcc)[_0x5547('0x28')]();});}};}function handleEntityNotFound(_0x294c16,_0x1b70b5){return function(_0x22db7c){if(!_0x22db7c){_0x294c16[_0x5547('0x1a')](0x194);}return _0x22db7c;};}function handleError(_0x3afce3,_0x31e662){_0x31e662=_0x31e662||0x1f4;return function(_0xa2993){logger[_0x5547('0x29')](_0xa2993['stack']);if(_0xa2993[_0x5547('0x2a')]){delete _0xa2993[_0x5547('0x2a')];}_0x3afce3[_0x5547('0x1b')](_0x31e662)['send'](_0xa2993);};}exports[_0x5547('0x2b')]=function(_0x5af7e5,_0x23aebb){var _0x1e6b28={},_0x387d8a={},_0x1887cf={'count':0x0,'rows':[]};var _0x101717=_[_0x5547('0x2c')](db[_0x5547('0x2d')][_0x5547('0x2e')],function(_0x361b30){return{'name':_0x361b30[_0x5547('0x2f')],'type':_0x361b30[_0x5547('0x30')][_0x5547('0x31')]};});_0x387d8a['model']=_[_0x5547('0x2c')](_0x101717,'name');_0x387d8a[_0x5547('0x32')]=_[_0x5547('0x33')](_0x5af7e5[_0x5547('0x32')]);_0x387d8a['filters']=_['intersection'](_0x387d8a[_0x5547('0x34')],_0x387d8a[_0x5547('0x32')]);_0x1e6b28[_0x5547('0x35')]=_[_0x5547('0x36')](_0x387d8a['model'],qs[_0x5547('0x37')](_0x5af7e5['query']['fields']));_0x1e6b28[_0x5547('0x35')]=_0x1e6b28[_0x5547('0x35')]['length']?_0x1e6b28[_0x5547('0x35')]:_0x387d8a[_0x5547('0x34')];if(!_0x5af7e5['query']['hasOwnProperty'](_0x5547('0x38'))){_0x1e6b28['limit']=qs[_0x5547('0x20')](_0x5af7e5[_0x5547('0x32')][_0x5547('0x20')]);_0x1e6b28[_0x5547('0x1f')]=qs[_0x5547('0x1f')](_0x5af7e5[_0x5547('0x32')][_0x5547('0x1f')]);}_0x1e6b28['order']=qs['sort'](_0x5af7e5[_0x5547('0x32')][_0x5547('0x39')]);_0x1e6b28[_0x5547('0x3a')]=qs['filters'](_[_0x5547('0x3b')](_0x5af7e5[_0x5547('0x32')],_0x387d8a['filters']),_0x101717);if(_0x5af7e5[_0x5547('0x32')][_0x5547('0x3c')]){_0x1e6b28[_0x5547('0x3a')]=_[_0x5547('0x3d')](_0x1e6b28[_0x5547('0x3a')],{'$or':_[_0x5547('0x2c')](_0x101717,function(_0x5764ab){if(_0x5764ab[_0x5547('0x30')]!==_0x5547('0x3e')){var _0x140c47={};_0x140c47[_0x5764ab[_0x5547('0x2a')]]={'$like':'%'+_0x5af7e5[_0x5547('0x32')]['filter']+'%'};return _0x140c47;}})});}_0x1e6b28=_['merge']({},_0x1e6b28,_0x5af7e5[_0x5547('0x3f')]);var _0x5140a8={'where':_0x1e6b28[_0x5547('0x3a')]};return db[_0x5547('0x2d')][_0x5547('0x1e')](_0x5140a8)[_0x5547('0x26')](function(_0x38428f){_0x1887cf[_0x5547('0x1e')]=_0x38428f;if(_0x5af7e5[_0x5547('0x32')]['includeAll']){_0x1e6b28[_0x5547('0x40')]=[{'all':!![]}];}return db[_0x5547('0x2d')][_0x5547('0x41')](_0x1e6b28);})[_0x5547('0x26')](function(_0x4baacf){_0x1887cf[_0x5547('0x42')]=_0x4baacf;return _0x1887cf;})['then'](respondWithFilteredResult(_0x23aebb,_0x1e6b28))[_0x5547('0x43')](handleError(_0x23aebb,null));};exports[_0x5547('0x44')]=function(_0x2ff5c5,_0x7f8c51){var _0x4193aa={'raw':!![],'where':{'id':_0x2ff5c5[_0x5547('0x45')]['id']}},_0x3abc00={};_0x3abc00[_0x5547('0x34')]=_['keys'](db[_0x5547('0x2d')][_0x5547('0x2e')]);_0x3abc00[_0x5547('0x32')]=_['keys'](_0x2ff5c5[_0x5547('0x32')]);_0x3abc00[_0x5547('0x46')]=_[_0x5547('0x36')](_0x3abc00[_0x5547('0x34')],_0x3abc00['query']);_0x4193aa[_0x5547('0x35')]=_['intersection'](_0x3abc00['model'],qs[_0x5547('0x37')](_0x2ff5c5[_0x5547('0x32')][_0x5547('0x37')]));_0x4193aa['attributes']=_0x4193aa[_0x5547('0x35')]['length']?_0x4193aa[_0x5547('0x35')]:_0x3abc00[_0x5547('0x34')];if(_0x2ff5c5[_0x5547('0x32')][_0x5547('0x47')]){_0x4193aa[_0x5547('0x40')]=[{'all':!![]}];}_0x4193aa=_[_0x5547('0x3d')]({},_0x4193aa,_0x2ff5c5[_0x5547('0x3f')]);return db['MailTransferReport'][_0x5547('0x48')](_0x4193aa)[_0x5547('0x26')](handleEntityNotFound(_0x7f8c51,null))['then'](respondWithResult(_0x7f8c51,null))[_0x5547('0x43')](handleError(_0x7f8c51,null));};exports[_0x5547('0x49')]=function(_0x15d603,_0x1cb63b){return db['MailTransferReport']['create'](_0x15d603[_0x5547('0x4a')],{})[_0x5547('0x26')](respondWithResult(_0x1cb63b,0xc9))['catch'](handleError(_0x1cb63b,null));};exports[_0x5547('0x25')]=function(_0x59fa97,_0x48d78d){if(_0x59fa97[_0x5547('0x4a')]['id']){delete _0x59fa97['body']['id'];}return db[_0x5547('0x2d')][_0x5547('0x48')]({'where':{'id':_0x59fa97[_0x5547('0x45')]['id']}})[_0x5547('0x26')](handleEntityNotFound(_0x48d78d,null))['then'](saveUpdates(_0x59fa97[_0x5547('0x4a')],null))[_0x5547('0x26')](respondWithResult(_0x48d78d,null))[_0x5547('0x43')](handleError(_0x48d78d,null));};exports[_0x5547('0x27')]=function(_0x215658,_0x30b280){return db[_0x5547('0x2d')][_0x5547('0x48')]({'where':{'id':_0x215658[_0x5547('0x45')]['id']}})[_0x5547('0x26')](handleEntityNotFound(_0x30b280,null))['then'](removeEntity(_0x30b280,null))[_0x5547('0x43')](handleError(_0x30b280,null));};exports[_0x5547('0x4b')]=function(_0x1f62e0,_0x1ba120){return db['MailTransferReport'][_0x5547('0x4b')]()[_0x5547('0x26')](respondWithResult(_0x1ba120,null))[_0x5547('0x43')](handleError(_0x1ba120,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8b89234..fc227a4 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 _0xbe22=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x224233,_0x4bcfdc){var _0x50c518=function(_0xfe6f8b){while(--_0xfe6f8b){_0x224233['push'](_0x224233['shift']());}};_0x50c518(++_0x4bcfdc);}(_0xbe22,0x1c1));var _0x2be2=function(_0x223a07,_0x58fd2b){_0x223a07=_0x223a07-0x0;var _0x2bcdbb=_0xbe22[_0x223a07];return _0x2bcdbb;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('0xb'),'paranoid':![],'indexes':[{'name':_0x2be2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa496=['api','moment','bluebird','path','rimraf','../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa496,0x1b7));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a49('0x0'))(_0x6a49('0x1'));var moment=require(_0x6a49('0x2'));var BPromise=require(_0x6a49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a49('0x4'));var rimraf=require(_0x6a49('0x5'));var config=require(_0x6a49('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x6a49('0x7')]=function(_0x23e9f2,_0x5afde1){return _0x23e9f2['define'](_0x6a49('0x8'),attributes,{'tableName':_0x6a49('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6a49('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 4c99f42..08c5067 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 _0x97db=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x99bff7,_0x33f3e6){var _0x53cc2f=function(_0x2f9c4d){while(--_0x2f9c4d){_0x99bff7['push'](_0x99bff7['shift']());}};_0x53cc2f(++_0x33f3e6);}(_0x97db,0x1b4));var _0xb97d=function(_0x4514a7,_0x5a4c15){_0x4514a7=_0x4514a7-0x0;var _0x4129cd=_0x97db[_0x4514a7];return _0x4129cd;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var moment=require(_0xb97d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb97d('0x3'));var db=require(_0xb97d('0x4'))['db'];var utils=require(_0xb97d('0x5'));var logger=require(_0xb97d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb97d('0x7'));var client=jayson[_0xb97d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533149,_0x2ff80e,_0x57cbd4){return new BPromise(function(_0x20f1e1,_0x2e1230){return client['request'](_0x533149,_0x57cbd4)[_0xb97d('0x9')](function(_0xe9acff){logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,'request\x20sent');logger[_0xb97d('0xc')](_0xb97d('0xd'),_0x2ff80e,_0xb97d('0xe'),JSON[_0xb97d('0xf')](_0xe9acff));if(_0xe9acff[_0xb97d('0x10')]){if(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x11')]===0x1f4){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x2e1230(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);}logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x20f1e1(_0xe9acff[_0xb97d('0x10')]['message']);}else{logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,_0xb97d('0xe'));_0x20f1e1(_0xe9acff[_0xb97d('0x13')][_0xb97d('0x12')]);}})['catch'](function(_0x416d6a){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0x416d6a);_0x2e1230(_0x416d6a);});});} \ No newline at end of file +var _0x6f40=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3ae027,_0x1a2ef0){var _0x371f27=function(_0x4e626a){while(--_0x4e626a){_0x3ae027['push'](_0x3ae027['shift']());}};_0x371f27(++_0x1a2ef0);}(_0x6f40,0x10f));var _0x06f4=function(_0x5c587a,_0x4dba89){_0x5c587a=_0x5c587a-0x0;var _0x28d19e=_0x6f40[_0x5c587a];return _0x28d19e;};'use strict';var _=require(_0x06f4('0x0'));var util=require(_0x06f4('0x1'));var moment=require(_0x06f4('0x2'));var BPromise=require(_0x06f4('0x3'));var rs=require(_0x06f4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06f4('0x5'))['db'];var utils=require(_0x06f4('0x6'));var logger=require(_0x06f4('0x7'))(_0x06f4('0x8'));var config=require(_0x06f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x06f4('0xa')][_0x06f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18717c,_0x53a167,_0x3098d4){return new BPromise(function(_0x29590d,_0x3a2133){return client[_0x06f4('0xc')](_0x18717c,_0x3098d4)[_0x06f4('0xd')](function(_0x390087){logger[_0x06f4('0xe')](_0x06f4('0xf'),_0x53a167,_0x06f4('0x10'));logger[_0x06f4('0x11')](_0x06f4('0x12'),_0x53a167,_0x06f4('0x10'),JSON[_0x06f4('0x13')](_0x390087));if(_0x390087[_0x06f4('0x14')]){if(_0x390087[_0x06f4('0x14')][_0x06f4('0x15')]===0x1f4){logger[_0x06f4('0x14')](_0x06f4('0xf'),_0x53a167,_0x390087[_0x06f4('0x14')][_0x06f4('0x16')]);return _0x3a2133(_0x390087[_0x06f4('0x14')][_0x06f4('0x16')]);}logger[_0x06f4('0x14')](_0x06f4('0xf'),_0x53a167,_0x390087[_0x06f4('0x14')][_0x06f4('0x16')]);return _0x29590d(_0x390087[_0x06f4('0x14')]['message']);}else{logger[_0x06f4('0xe')](_0x06f4('0xf'),_0x53a167,_0x06f4('0x10'));_0x29590d(_0x390087['result'][_0x06f4('0x16')]);}})[_0x06f4('0x17')](function(_0x344534){logger[_0x06f4('0x14')](_0x06f4('0xf'),_0x53a167,_0x344534);_0x3a2133(_0x344534);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cbfeef4..60fca82 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 _0x657b=['/describe','describe','/:id','show','create','put','delete','destroy','exports','path','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x657b,0xa2));var _0xb657=function(_0x18f4d6,_0x4d973f){_0x18f4d6=_0x18f4d6-0x0;var _0x5c5de1=_0x657b[_0x18f4d6];return _0x5c5de1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb657('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb657('0x1')]();var fs_extra=require(_0xb657('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb657('0x3'));var config=require('../../config/environment');var controller=require(_0xb657('0x4'));router[_0xb657('0x5')]('/',auth[_0xb657('0x6')](),controller[_0xb657('0x7')]);router[_0xb657('0x5')](_0xb657('0x8'),auth[_0xb657('0x6')](),controller[_0xb657('0x9')]);router[_0xb657('0x5')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller[_0xb657('0xb')]);router['post']('/',auth[_0xb657('0x6')](),controller[_0xb657('0xc')]);router[_0xb657('0xd')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller['update']);router[_0xb657('0xe')](_0xb657('0xa'),auth[_0xb657('0x6')](),controller[_0xb657('0xf')]);module[_0xb657('0x10')]=router; \ No newline at end of file +var _0xd9e4=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x521278,_0x36d9b1){var _0x28e005=function(_0x1018d2){while(--_0x1018d2){_0x521278['push'](_0x521278['shift']());}};_0x28e005(++_0x36d9b1);}(_0xd9e4,0x14c));var _0x4d9e=function(_0x387b44,_0x3ad1ba){_0x387b44=_0x387b44-0x0;var _0x55ff2d=_0xd9e4[_0x387b44];return _0x55ff2d;};'use strict';var multer=require('multer');var util=require(_0x4d9e('0x0'));var path=require(_0x4d9e('0x1'));var timeout=require(_0x4d9e('0x2'));var express=require(_0x4d9e('0x3'));var router=express['Router']();var fs_extra=require(_0x4d9e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4d9e('0x5'));var config=require(_0x4d9e('0x6'));var controller=require(_0x4d9e('0x7'));router[_0x4d9e('0x8')]('/',auth[_0x4d9e('0x9')](),controller[_0x4d9e('0xa')]);router['get'](_0x4d9e('0xb'),auth[_0x4d9e('0x9')](),controller[_0x4d9e('0xc')]);router[_0x4d9e('0x8')](_0x4d9e('0xd'),auth[_0x4d9e('0x9')](),controller[_0x4d9e('0xe')]);router[_0x4d9e('0xf')]('/',auth[_0x4d9e('0x9')](),controller[_0x4d9e('0x10')]);router[_0x4d9e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4d9e('0x12')]);router[_0x4d9e('0x13')](_0x4d9e('0xd'),auth[_0x4d9e('0x9')](),controller[_0x4d9e('0x14')]);module[_0x4d9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c52214f..f3fe097 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 _0xe130=['talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe130,0x127));var _0x0e13=function(_0x4aa9f9,_0x25516c){_0x4aa9f9=_0x4aa9f9-0x0;var _0x22048b=_0xe130[_0x4aa9f9];return _0x22048b;};'use strict';var Sequelize=require(_0x0e13('0x0'));var moment=require(_0x0e13('0x1'));module['exports']={'channel':{'type':Sequelize[_0x0e13('0x2')]},'membername':{'type':Sequelize[_0x0e13('0x2')]},'interface':{'type':Sequelize[_0x0e13('0x2')]},'type':{'type':Sequelize[_0x0e13('0x2')],'defaultValue':_0x0e13('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x0e13('0x4')]},'enterAt':{'type':Sequelize[_0x0e13('0x5')]},'exitAt':{'type':Sequelize[_0x0e13('0x5')],'set':function(_0xcd92e){var _0x50a80e=moment(_0xcd92e);var _0x1774a5=moment(this['getDataValue']('enterAt'));var _0x5aaa22=_0x50a80e[_0x0e13('0x6')](_0x1774a5,_0x0e13('0x7'));this['setDataValue']('exitAt',_0xcd92e);this[_0x0e13('0x8')](_0x0e13('0x9'),_0x5aaa22||null);}},'data1':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xb')},'data4':{'type':Sequelize[_0x0e13('0x2')],'comment':_0x0e13('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x0e13('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0e13('0x4')]},'uniqueid':{'type':Sequelize[_0x0e13('0x2')]}}; \ No newline at end of file +var _0x851c=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x5edb22,_0x136394){var _0x3f9dba=function(_0x9dd4fa){while(--_0x9dd4fa){_0x5edb22['push'](_0x5edb22['shift']());}};_0x3f9dba(++_0x136394);}(_0x851c,0x19d));var _0xc851=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x851c[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xc851('0x0'));var moment=require(_0xc851('0x1'));module[_0xc851('0x2')]={'channel':{'type':Sequelize[_0xc851('0x3')]},'membername':{'type':Sequelize[_0xc851('0x3')]},'interface':{'type':Sequelize[_0xc851('0x3')]},'type':{'type':Sequelize[_0xc851('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xc851('0x4')},'duration':{'type':Sequelize[_0xc851('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc851('0x6')],'set':function(_0x272e34){var _0x535cf1=moment(_0x272e34);var _0x3067e5=moment(this['getDataValue']('enterAt'));var _0x12a405=_0x535cf1['diff'](_0x3067e5,'seconds');this[_0xc851('0x7')](_0xc851('0x8'),_0x272e34);this[_0xc851('0x7')](_0xc851('0x9'),_0x12a405||null);}},'data1':{'type':Sequelize[_0xc851('0x3')],'comment':_0xc851('0xa')},'data2':{'type':Sequelize[_0xc851('0x3')],'comment':_0xc851('0xb')},'data3':{'type':Sequelize['STRING'],'comment':_0xc851('0xc')},'data4':{'type':Sequelize[_0xc851('0x3')],'comment':_0xc851('0xd')},'data5':{'type':Sequelize[_0xc851('0x3')],'comment':_0xc851('0xe')},'role':{'type':Sequelize[_0xc851('0x3')]},'internal':{'type':Sequelize[_0xc851('0x5')]},'uniqueid':{'type':Sequelize[_0xc851('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c1636a3..37556fe 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xedd9,0xfc));var _0x9edd=function(_0xc73f74,_0x41c03a){_0xc73f74=_0xc73f74-0x0;var _0x560e01=_0xedd9[_0xc73f74];return _0x560e01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x55ca,0x126));var _0xa55c=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x55ca[_0x2abc3d];return _0x252745;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 56a8e5e..35c2548 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 _0x070f=['request-promise','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','api','moment','bluebird'];(function(_0x49d0fd,_0x371f7b){var _0x20a93f=function(_0x319802){while(--_0x319802){_0x49d0fd['push'](_0x49d0fd['shift']());}};_0x20a93f(++_0x371f7b);}(_0x070f,0xf3));var _0xf070=function(_0x4a31f6,_0x4738b9){_0x4a31f6=_0x4a31f6-0x0;var _0x8919f=_0x070f[_0x4a31f6];return _0x8919f;};'use strict';var _=require(_0xf070('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf070('0x1'));var moment=require(_0xf070('0x2'));var BPromise=require(_0xf070('0x3'));var rp=require(_0xf070('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf070('0x5'));var config=require(_0xf070('0x6'));var attributes=require(_0xf070('0x7'));module['exports']=function(_0x370f5,_0x421ca4){return _0x370f5['define'](_0xf070('0x8'),attributes,{'tableName':_0xf070('0x9'),'paranoid':![],'indexes':[{'name':_0xf070('0xa'),'fields':[_0xf070('0xb'),_0xf070('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0a3=['request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x303fa0,_0x4494b2){var _0x497b7b=function(_0x229a1d){while(--_0x229a1d){_0x303fa0['push'](_0x303fa0['shift']());}};_0x497b7b(++_0x4494b2);}(_0xe0a3,0xba));var _0x3e0a=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0xe0a3[_0x1e17eb];return _0x4de4c7;};'use strict';var _=require(_0x3e0a('0x0'));var util=require(_0x3e0a('0x1'));var logger=require(_0x3e0a('0x2'))(_0x3e0a('0x3'));var moment=require(_0x3e0a('0x4'));var BPromise=require(_0x3e0a('0x5'));var rp=require(_0x3e0a('0x6'));var fs=require('fs');var path=require(_0x3e0a('0x7'));var rimraf=require('rimraf');var config=require(_0x3e0a('0x8'));var attributes=require(_0x3e0a('0x9'));module[_0x3e0a('0xa')]=function(_0x25abed,_0x484a46){return _0x25abed[_0x3e0a('0xb')](_0x3e0a('0xc'),attributes,{'tableName':_0x3e0a('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x3e0a('0xe'),_0x3e0a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 0fbba90..29fb819 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 _0x11e5=['request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','stringify','catch','CreateMemberReport','MemberReport','create','body','update','UpdateMemberReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x1207d1,_0xfb8333){var _0x5b2e10=function(_0x4ebb85){while(--_0x4ebb85){_0x1207d1['push'](_0x1207d1['shift']());}};_0x5b2e10(++_0xfb8333);}(_0x11e5,0x8b));var _0x511e=function(_0x2c5df9,_0x2811cb){_0x2c5df9=_0x2c5df9-0x0;var _0x39d1d0=_0x11e5[_0x2c5df9];return _0x39d1d0;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var moment=require(_0x511e('0x1'));var BPromise=require(_0x511e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511e('0x3'));var db=require(_0x511e('0x4'))['db'];var utils=require(_0x511e('0x5'));var logger=require('../../config/logger')(_0x511e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x511e('0x7')][_0x511e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x466dec,_0x57cac3,_0x47cf56){return new BPromise(function(_0x3ebc4b,_0xf0ba86){return client[_0x511e('0x9')](_0x466dec,_0x47cf56)[_0x511e('0xa')](function(_0x4449c4){logger[_0x511e('0xb')](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));logger[_0x511e('0xe')](_0x511e('0xf'),_0x57cac3,_0x511e('0xd'),JSON['stringify'](_0x4449c4));if(_0x4449c4[_0x511e('0x10')]){if(_0x4449c4['error']['code']===0x1f4){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);return _0xf0ba86(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}logger['error'](_0x511e('0xc'),_0x57cac3,_0x4449c4[_0x511e('0x10')]['message']);return _0x3ebc4b(_0x4449c4[_0x511e('0x10')][_0x511e('0x11')]);}else{logger['info'](_0x511e('0xc'),_0x57cac3,_0x511e('0xd'));_0x3ebc4b(_0x4449c4[_0x511e('0x12')][_0x511e('0x11')]);}})['catch'](function(_0x3e0415){logger[_0x511e('0x10')](_0x511e('0xc'),_0x57cac3,_0x3e0415);_0xf0ba86(_0x3e0415);});});}exports['GetMemberReport']=function(_0x26af67){var _0x5bd814=this;return new Promise(function(_0x34e6cd,_0x492c9f){return db['MemberReport'][_0x511e('0x13')]({'raw':_0x26af67['options']?_0x26af67[_0x511e('0x14')][_0x511e('0x15')]===undefined?!![]:![]:!![],'where':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x16')]||null:null,'attributes':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x17')]||null:null,'limit':_0x26af67['options']?_0x26af67[_0x511e('0x14')][_0x511e('0x18')]||null:null,'include':_0x26af67[_0x511e('0x14')]?_0x26af67[_0x511e('0x14')][_0x511e('0x19')]?_[_0x511e('0x1a')](_0x26af67[_0x511e('0x14')][_0x511e('0x19')],function(_0x211b90){return{'model':db[_0x211b90[_0x511e('0x1b')]],'as':_0x211b90['as'],'attributes':_0x211b90['attributes'],'include':_0x211b90['include']?_[_0x511e('0x1a')](_0x211b90['include'],function(_0x1ff5c4){return{'model':db[_0x1ff5c4['model']],'as':_0x1ff5c4['as'],'attributes':_0x1ff5c4[_0x511e('0x17')],'include':_0x1ff5c4[_0x511e('0x19')]?_[_0x511e('0x1a')](_0x1ff5c4[_0x511e('0x19')],function(_0x1bb7f9){return{'model':db[_0x1bb7f9[_0x511e('0x1b')]],'as':_0x1bb7f9['as'],'attributes':_0x1bb7f9[_0x511e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x511e('0xa')](function(_0x309695){logger[_0x511e('0xb')]('GetMemberReport',_0x26af67);logger[_0x511e('0xe')](_0x511e('0x1c'),_0x26af67,JSON[_0x511e('0x1d')](_0x309695));_0x34e6cd(_0x309695);})[_0x511e('0x1e')](function(_0x369be6){logger['error'](_0x511e('0x1c'),_0x369be6['message'],_0x26af67);_0x492c9f(_0x5bd814['error'](0x1f4,_0x369be6[_0x511e('0x11')]));});});};exports[_0x511e('0x1f')]=function(_0xa3b110){var _0x2fb396=this;return new Promise(function(_0x432b5d,_0x4812d9){return db[_0x511e('0x20')][_0x511e('0x21')](_0xa3b110[_0x511e('0x22')],{'raw':_0xa3b110[_0x511e('0x14')]?_0xa3b110[_0x511e('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x511e('0xa')](function(_0x32a749){logger[_0x511e('0xb')](_0x511e('0x1f'),_0xa3b110);logger[_0x511e('0xe')](_0x511e('0x1f'),_0xa3b110,JSON[_0x511e('0x1d')](_0x32a749));_0x432b5d(_0x32a749);})[_0x511e('0x1e')](function(_0x5a881a){logger[_0x511e('0x10')](_0x511e('0x1f'),_0x5a881a[_0x511e('0x11')],_0xa3b110);_0x4812d9(_0x2fb396[_0x511e('0x10')](0x1f4,_0x5a881a['message']));});});};exports['UpdateMemberReport']=function(_0x3f6dfc){var _0x57026d=this;return new Promise(function(_0x529d08,_0x256fd3){return db[_0x511e('0x20')][_0x511e('0x23')](_0x3f6dfc[_0x511e('0x22')],{'raw':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc['options'][_0x511e('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc[_0x511e('0x14')]['where']||null:null,'attributes':_0x3f6dfc[_0x511e('0x14')]?_0x3f6dfc[_0x511e('0x14')][_0x511e('0x17')]||null:null,'limit':_0x3f6dfc['options']?_0x3f6dfc[_0x511e('0x14')][_0x511e('0x18')]||null:null})['then'](function(_0x357a66){logger[_0x511e('0xb')](_0x511e('0x24'),_0x3f6dfc);logger[_0x511e('0xe')](_0x511e('0x24'),_0x3f6dfc,JSON[_0x511e('0x1d')](_0x357a66));_0x529d08(_0x357a66);})[_0x511e('0x1e')](function(_0x8cc26e){logger[_0x511e('0x10')](_0x511e('0x24'),_0x8cc26e[_0x511e('0x11')],_0x3f6dfc);_0x256fd3(_0x57026d['error'](0x1f4,_0x8cc26e[_0x511e('0x11')]));});});}; \ No newline at end of file +var _0xea31=['debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','where','attributes','limit','map','include','model','CreateMemberReport','create','body','raw','UpdateMemberReport','MemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3fd2d9,_0x45b499){var _0x1a2c82=function(_0x6b95a6){while(--_0x6b95a6){_0x3fd2d9['push'](_0x3fd2d9['shift']());}};_0x1a2c82(++_0x45b499);}(_0xea31,0x6b));var _0x1ea3=function(_0x43f689,_0x11e5b9){_0x43f689=_0x43f689-0x0;var _0x2ab17d=_0xea31[_0x43f689];return _0x2ab17d;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e6fb,_0x4c8f83,_0x1fa3a8){return new BPromise(function(_0x1b578e,_0x30a6db){return client[_0x1ea3('0xc')](_0x13e6fb,_0x1fa3a8)[_0x1ea3('0xd')](function(_0x2ff19a){logger['info'](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));logger[_0x1ea3('0x10')](_0x1ea3('0x11'),_0x4c8f83,_0x1ea3('0xf'),JSON[_0x1ea3('0x12')](_0x2ff19a));if(_0x2ff19a[_0x1ea3('0x13')]){if(_0x2ff19a['error'][_0x1ea3('0x14')]===0x1f4){logger['error'](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);return _0x30a6db(_0x2ff19a['error'][_0x1ea3('0x15')]);}logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a['error'][_0x1ea3('0x15')]);return _0x1b578e(_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);}else{logger[_0x1ea3('0x16')](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));_0x1b578e(_0x2ff19a[_0x1ea3('0x17')]['message']);}})[_0x1ea3('0x18')](function(_0x199728){logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x199728);_0x30a6db(_0x199728);});});}exports[_0x1ea3('0x19')]=function(_0x541e18){var _0x1c7530=this;return new Promise(function(_0x2a8b47,_0x990a86){return db['MemberReport'][_0x1ea3('0x1a')]({'raw':_0x541e18[_0x1ea3('0x1b')]?_0x541e18[_0x1ea3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x541e18[_0x1ea3('0x1b')]?_0x541e18['options'][_0x1ea3('0x1c')]||null:null,'attributes':_0x541e18[_0x1ea3('0x1b')]?_0x541e18[_0x1ea3('0x1b')][_0x1ea3('0x1d')]||null:null,'limit':_0x541e18[_0x1ea3('0x1b')]?_0x541e18['options'][_0x1ea3('0x1e')]||null:null,'include':_0x541e18['options']?_0x541e18[_0x1ea3('0x1b')]['include']?_[_0x1ea3('0x1f')](_0x541e18[_0x1ea3('0x1b')][_0x1ea3('0x20')],function(_0x5ad8ff){return{'model':db[_0x5ad8ff['model']],'as':_0x5ad8ff['as'],'attributes':_0x5ad8ff[_0x1ea3('0x1d')],'include':_0x5ad8ff['include']?_[_0x1ea3('0x1f')](_0x5ad8ff[_0x1ea3('0x20')],function(_0x3c42f3){return{'model':db[_0x3c42f3[_0x1ea3('0x21')]],'as':_0x3c42f3['as'],'attributes':_0x3c42f3[_0x1ea3('0x1d')],'include':_0x3c42f3['include']?_['map'](_0x3c42f3[_0x1ea3('0x20')],function(_0x2edfb4){return{'model':db[_0x2edfb4[_0x1ea3('0x21')]],'as':_0x2edfb4['as'],'attributes':_0x2edfb4[_0x1ea3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1ea3('0xd')](function(_0x12283d){logger[_0x1ea3('0x16')](_0x1ea3('0x19'),_0x541e18);logger[_0x1ea3('0x10')](_0x1ea3('0x19'),_0x541e18,JSON[_0x1ea3('0x12')](_0x12283d));_0x2a8b47(_0x12283d);})[_0x1ea3('0x18')](function(_0x2c29d7){logger[_0x1ea3('0x13')](_0x1ea3('0x19'),_0x2c29d7[_0x1ea3('0x15')],_0x541e18);_0x990a86(_0x1c7530['error'](0x1f4,_0x2c29d7[_0x1ea3('0x15')]));});});};exports[_0x1ea3('0x22')]=function(_0x473fda){var _0x1744b8=this;return new Promise(function(_0x2448fd,_0x59c5af){return db['MemberReport'][_0x1ea3('0x23')](_0x473fda[_0x1ea3('0x24')],{'raw':_0x473fda['options']?_0x473fda[_0x1ea3('0x1b')][_0x1ea3('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x4c16ef){logger[_0x1ea3('0x16')](_0x1ea3('0x22'),_0x473fda);logger[_0x1ea3('0x10')](_0x1ea3('0x22'),_0x473fda,JSON[_0x1ea3('0x12')](_0x4c16ef));_0x2448fd(_0x4c16ef);})[_0x1ea3('0x18')](function(_0x3b78bb){logger[_0x1ea3('0x13')](_0x1ea3('0x22'),_0x3b78bb['message'],_0x473fda);_0x59c5af(_0x1744b8[_0x1ea3('0x13')](0x1f4,_0x3b78bb[_0x1ea3('0x15')]));});});};exports[_0x1ea3('0x26')]=function(_0x24793d){var _0x2139a6=this;return new Promise(function(_0x3b9266,_0x36d563){return db[_0x1ea3('0x27')][_0x1ea3('0x28')](_0x24793d[_0x1ea3('0x24')],{'raw':_0x24793d['options']?_0x24793d[_0x1ea3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24793d[_0x1ea3('0x1b')]?_0x24793d['options']['where']||null:null,'attributes':_0x24793d[_0x1ea3('0x1b')]?_0x24793d['options']['attributes']||null:null,'limit':_0x24793d['options']?_0x24793d[_0x1ea3('0x1b')][_0x1ea3('0x1e')]||null:null})[_0x1ea3('0xd')](function(_0x3c2289){logger[_0x1ea3('0x16')]('UpdateMemberReport',_0x24793d);logger[_0x1ea3('0x10')]('UpdateMemberReport',_0x24793d,JSON[_0x1ea3('0x12')](_0x3c2289));_0x3b9266(_0x3c2289);})[_0x1ea3('0x18')](function(_0x5c7206){logger[_0x1ea3('0x13')](_0x1ea3('0x26'),_0x5c7206[_0x1ea3('0x15')],_0x24793d);_0x36d563(_0x2139a6[_0x1ea3('0x13')](0x1f4,_0x5c7206[_0x1ea3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4dfe814..ec4a88e 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 _0xbf3e=['../../config/environment','./migration.controller','get','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x20ed21,_0x3c4796){var _0x1a5f0e=function(_0x2e1647){while(--_0x2e1647){_0x20ed21['push'](_0x20ed21['shift']());}};_0x1a5f0e(++_0x3c4796);}(_0xbf3e,0xee));var _0xebf3=function(_0x558aa4,_0x27684d){_0x558aa4=_0x558aa4-0x0;var _0x59c117=_0xbf3e[_0x558aa4];return _0x59c117;};'use strict';var multer=require('multer');var util=require(_0xebf3('0x0'));var path=require('path');var timeout=require(_0xebf3('0x1'));var express=require(_0xebf3('0x2'));var router=express[_0xebf3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xebf3('0x4'));var config=require(_0xebf3('0x5'));var controller=require(_0xebf3('0x6'));router[_0xebf3('0x7')]('/',controller['index']);module[_0xebf3('0x8')]=router; \ No newline at end of file +var _0xc15b=['Router','../../components/interaction/service','../../config/environment','./migration.controller','multer','path','connect-timeout','express'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xc15b,0xe4));var _0xbc15=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xc15b[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require(_0xbc15('0x0'));var util=require('util');var path=require(_0xbc15('0x1'));var timeout=require(_0xbc15('0x2'));var express=require(_0xbc15('0x3'));var router=express[_0xbc15('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc15('0x5'));var config=require(_0xbc15('0x6'));var controller=require(_0xbc15('0x7'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d028e40..4f7dcb0 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 _0xb1a8=['version','sequelize','STRING'];(function(_0x252c3b,_0x7ae0e3){var _0x1e52e6=function(_0x4abb92){while(--_0x4abb92){_0x252c3b['push'](_0x252c3b['shift']());}};_0x1e52e6(++_0x7ae0e3);}(_0xb1a8,0x1a2));var _0x8b1a=function(_0x3ee617,_0x3f16a9){_0x3ee617=_0x3ee617-0x0;var _0x3a4098=_0xb1a8[_0x3ee617];return _0x3a4098;};'use strict';var Sequelize=require(_0x8b1a('0x0'));module['exports']={'version':{'type':Sequelize[_0x8b1a('0x1')],'unique':_0x8b1a('0x2')}}; \ No newline at end of file +var _0x0c5c=['version','sequelize','STRING'];(function(_0x361775,_0x9bc08a){var _0x2dcc63=function(_0x5e5c35){while(--_0x5e5c35){_0x361775['push'](_0x361775['shift']());}};_0x2dcc63(++_0x9bc08a);}(_0x0c5c,0x1d2));var _0xc0c5=function(_0x298150,_0x5c3127){_0x298150=_0x298150-0x0;var _0x19c942=_0x0c5c[_0x298150];return _0x19c942;};'use strict';var Sequelize=require(_0xc0c5('0x0'));module['exports']={'version':{'type':Sequelize[_0xc0c5('0x1')],'unique':_0xc0c5('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index be582ec..5402c1e 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 _0xa5b9=['sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x25678f,_0x5958d5){var _0x1961b5=function(_0x3d0258){while(--_0x3d0258){_0x25678f['push'](_0x25678f['shift']());}};_0x1961b5(++_0x5958d5);}(_0xa5b9,0x1d3));var _0x9a5b=function(_0x9dd51c,_0x3f13c6){_0x9dd51c=_0x9dd51c-0x0;var _0x14f0ff=_0xa5b9[_0x9dd51c];return _0x14f0ff;};'use strict';var emlformat=require(_0x9a5b('0x0'));var rimraf=require(_0x9a5b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a5b('0x2'));var rp=require('request-promise');var moment=require(_0x9a5b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a5b('0x4'));var util=require(_0x9a5b('0x5'));var path=require(_0x9a5b('0x6'));var sox=require(_0x9a5b('0x7'));var csv=require(_0x9a5b('0x8'));var ejs=require(_0x9a5b('0x9'));var fs=require('fs');var fs_extra=require(_0x9a5b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a5b('0xb'));var jsforce=require(_0x9a5b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9a5b('0x8'));var querystring=require('querystring');var Papa=require(_0x9a5b('0xd'));var Redis=require(_0x9a5b('0xe'));var authService=require(_0x9a5b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9a5b('0x10'));var hardwareService=require(_0x9a5b('0x11'));var logger=require(_0x9a5b('0x12'))(_0x9a5b('0x13'));var utils=require('../../config/utils');var config=require(_0x9a5b('0x14'));var licenseUtil=require(_0x9a5b('0x15'));var db=require(_0x9a5b('0x16'))['db'];function respondWithStatusCode(_0x355f9e,_0x4655d4){_0x4655d4=_0x4655d4||0xcc;return function(_0x49d0f3){if(_0x49d0f3){return _0x355f9e[_0x9a5b('0x17')](_0x4655d4);}return _0x355f9e[_0x9a5b('0x18')](_0x4655d4)[_0x9a5b('0x19')]();};}function respondWithResult(_0x520404,_0x5cdd47){_0x5cdd47=_0x5cdd47||0xc8;return function(_0x5e666c){if(_0x5e666c){return _0x520404['status'](_0x5cdd47)[_0x9a5b('0x1a')](_0x5e666c);}};}function respondWithFilteredResult(_0x24f6c8,_0x34231b){return function(_0x4882a1){if(_0x4882a1){var _0x2c0970=typeof _0x34231b[_0x9a5b('0x1b')]==='undefined'&&typeof _0x34231b[_0x9a5b('0x1c')]===_0x9a5b('0x1d');var _0x3c18b6=_0x4882a1[_0x9a5b('0x1e')];var _0x342568=_0x2c0970?0x0:_0x34231b[_0x9a5b('0x1b')];var _0xdd487c=_0x2c0970?_0x4882a1['count']:_0x34231b['offset']+_0x34231b[_0x9a5b('0x1c')];var _0x10abdc;if(_0xdd487c>=_0x3c18b6){_0xdd487c=_0x3c18b6;_0x10abdc=0xc8;}else{_0x10abdc=0xce;}_0x24f6c8[_0x9a5b('0x18')](_0x10abdc);return _0x24f6c8['set'](_0x9a5b('0x1f'),_0x342568+'-'+_0xdd487c+'/'+_0x3c18b6)[_0x9a5b('0x1a')](_0x4882a1);}return null;};}function patchUpdates(_0x550418){return function(_0x190586){try{jsonpatch[_0x9a5b('0x20')](_0x190586,_0x550418,!![]);}catch(_0x172dbd){return BPromise[_0x9a5b('0x21')](_0x172dbd);}return _0x190586[_0x9a5b('0x22')]();};}function saveUpdates(_0x3f26f8,_0x42a550){return function(_0x4c3afd){if(_0x4c3afd){return _0x4c3afd[_0x9a5b('0x23')](_0x3f26f8)[_0x9a5b('0x24')](function(_0xdbe5a9){return _0xdbe5a9;});}return null;};}function removeEntity(_0x356e44,_0x4ab82a){return function(_0x16de56){if(_0x16de56){return _0x16de56[_0x9a5b('0x25')]()[_0x9a5b('0x24')](function(){_0x356e44[_0x9a5b('0x18')](0xcc)[_0x9a5b('0x19')]();});}};}function handleEntityNotFound(_0x39663e,_0x1f0a0a){return function(_0x51b7c4){if(!_0x51b7c4){_0x39663e[_0x9a5b('0x17')](0x194);}return _0x51b7c4;};}function handleError(_0x10580,_0x132604){_0x132604=_0x132604||0x1f4;return function(_0x1f87ab){logger[_0x9a5b('0x26')](_0x1f87ab[_0x9a5b('0x27')]);if(_0x1f87ab[_0x9a5b('0x28')]){delete _0x1f87ab[_0x9a5b('0x28')];}_0x10580['status'](_0x132604)[_0x9a5b('0x29')](_0x1f87ab);};}exports[_0x9a5b('0x2a')]=function(_0x3794fa,_0xde07b3){var _0x463be1={},_0x283a13={},_0x3be9c6={'count':0x0,'rows':[]};var _0x5bff5f=_[_0x9a5b('0x2b')](db[_0x9a5b('0x2c')][_0x9a5b('0x2d')],function(_0x1adae1){return{'name':_0x1adae1[_0x9a5b('0x2e')],'type':_0x1adae1[_0x9a5b('0x2f')][_0x9a5b('0x30')]};});_0x283a13['model']=_[_0x9a5b('0x2b')](_0x5bff5f,_0x9a5b('0x28'));_0x283a13[_0x9a5b('0x31')]=_[_0x9a5b('0x32')](_0x3794fa[_0x9a5b('0x31')]);_0x283a13[_0x9a5b('0x33')]=_[_0x9a5b('0x34')](_0x283a13[_0x9a5b('0x35')],_0x283a13['query']);_0x463be1[_0x9a5b('0x36')]=_[_0x9a5b('0x34')](_0x283a13[_0x9a5b('0x35')],qs[_0x9a5b('0x37')](_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x37')]));_0x463be1[_0x9a5b('0x36')]=_0x463be1[_0x9a5b('0x36')][_0x9a5b('0x38')]?_0x463be1[_0x9a5b('0x36')]:_0x283a13[_0x9a5b('0x35')];if(!_0x3794fa['query'][_0x9a5b('0x39')](_0x9a5b('0x3a'))){_0x463be1[_0x9a5b('0x1c')]=qs[_0x9a5b('0x1c')](_0x3794fa['query'][_0x9a5b('0x1c')]);_0x463be1[_0x9a5b('0x1b')]=qs[_0x9a5b('0x1b')](_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x1b')]);}_0x463be1[_0x9a5b('0x3b')]=qs[_0x9a5b('0x3c')](_0x3794fa['query'][_0x9a5b('0x3c')]);_0x463be1[_0x9a5b('0x3d')]=qs[_0x9a5b('0x33')](_['pick'](_0x3794fa['query'],_0x283a13['filters']),_0x5bff5f);if(_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x3e')]){_0x463be1[_0x9a5b('0x3d')]=_[_0x9a5b('0x3f')](_0x463be1['where'],{'$or':_[_0x9a5b('0x2b')](_0x5bff5f,function(_0x500a4f){if(_0x500a4f[_0x9a5b('0x2f')]!=='VIRTUAL'){var _0x1de106={};_0x1de106[_0x500a4f['name']]={'$like':'%'+_0x3794fa[_0x9a5b('0x31')][_0x9a5b('0x3e')]+'%'};return _0x1de106;}})});}_0x463be1=_[_0x9a5b('0x3f')]({},_0x463be1,_0x3794fa[_0x9a5b('0x40')]);var _0x4e7906={'where':_0x463be1[_0x9a5b('0x3d')]};return db[_0x9a5b('0x2c')]['count'](_0x4e7906)[_0x9a5b('0x24')](function(_0x4c3f15){_0x3be9c6['count']=_0x4c3f15;if(_0x3794fa['query'][_0x9a5b('0x41')]){_0x463be1[_0x9a5b('0x42')]=[{'all':!![]}];}return db[_0x9a5b('0x2c')][_0x9a5b('0x43')](_0x463be1);})[_0x9a5b('0x24')](function(_0x710167){_0x3be9c6[_0x9a5b('0x44')]=_0x710167;return _0x3be9c6;})[_0x9a5b('0x24')](respondWithFilteredResult(_0xde07b3,_0x463be1))[_0x9a5b('0x45')](handleError(_0xde07b3,null));}; \ No newline at end of file +var _0x299d=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','include','rows','catch','eml-format','rimraf'];(function(_0x4c92e5,_0xf0e638){var _0x34a1bb=function(_0x389980){while(--_0x389980){_0x4c92e5['push'](_0x4c92e5['shift']());}};_0x34a1bb(++_0xf0e638);}(_0x299d,0x82));var _0xd299=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x299d[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0xd299('0x0'));var rimraf=require(_0xd299('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd299('0x2'));var rp=require(_0xd299('0x3'));var moment=require(_0xd299('0x4'));var BPromise=require(_0xd299('0x5'));var Mustache=require(_0xd299('0x6'));var util=require(_0xd299('0x7'));var path=require(_0xd299('0x8'));var sox=require(_0xd299('0x9'));var csv=require(_0xd299('0xa'));var ejs=require(_0xd299('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd299('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd299('0xd'));var toCsv=require(_0xd299('0xa'));var querystring=require(_0xd299('0xe'));var Papa=require(_0xd299('0xf'));var Redis=require(_0xd299('0x10'));var authService=require(_0xd299('0x11'));var qs=require(_0xd299('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd299('0x13'))(_0xd299('0x14'));var utils=require(_0xd299('0x15'));var config=require(_0xd299('0x16'));var licenseUtil=require(_0xd299('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b2a0e,_0xc9bdaf){_0xc9bdaf=_0xc9bdaf||0xcc;return function(_0x24512f){if(_0x24512f){return _0x5b2a0e[_0xd299('0x18')](_0xc9bdaf);}return _0x5b2a0e[_0xd299('0x19')](_0xc9bdaf)['end']();};}function respondWithResult(_0x33df80,_0x2e3ee3){_0x2e3ee3=_0x2e3ee3||0xc8;return function(_0xfc89){if(_0xfc89){return _0x33df80['status'](_0x2e3ee3)[_0xd299('0x1a')](_0xfc89);}};}function respondWithFilteredResult(_0x33fb20,_0x4941fc){return function(_0x2195da){if(_0x2195da){var _0x44fe75=typeof _0x4941fc[_0xd299('0x1b')]===_0xd299('0x1c')&&typeof _0x4941fc[_0xd299('0x1d')]===_0xd299('0x1c');var _0x5b6781=_0x2195da[_0xd299('0x1e')];var _0x4a6620=_0x44fe75?0x0:_0x4941fc[_0xd299('0x1b')];var _0x525ef9=_0x44fe75?_0x2195da[_0xd299('0x1e')]:_0x4941fc[_0xd299('0x1b')]+_0x4941fc[_0xd299('0x1d')];var _0x2c8a13;if(_0x525ef9>=_0x5b6781){_0x525ef9=_0x5b6781;_0x2c8a13=0xc8;}else{_0x2c8a13=0xce;}_0x33fb20['status'](_0x2c8a13);return _0x33fb20[_0xd299('0x1f')]('Content-Range',_0x4a6620+'-'+_0x525ef9+'/'+_0x5b6781)['json'](_0x2195da);}return null;};}function patchUpdates(_0xc958d){return function(_0xe8799c){try{jsonpatch[_0xd299('0x20')](_0xe8799c,_0xc958d,!![]);}catch(_0x5809a4){return BPromise[_0xd299('0x21')](_0x5809a4);}return _0xe8799c[_0xd299('0x22')]();};}function saveUpdates(_0x476f74,_0x59a917){return function(_0x5b277f){if(_0x5b277f){return _0x5b277f['update'](_0x476f74)[_0xd299('0x23')](function(_0xa8bee4){return _0xa8bee4;});}return null;};}function removeEntity(_0x13f37c,_0x345c32){return function(_0x25d4d5){if(_0x25d4d5){return _0x25d4d5[_0xd299('0x24')]()[_0xd299('0x23')](function(){_0x13f37c[_0xd299('0x19')](0xcc)[_0xd299('0x25')]();});}};}function handleEntityNotFound(_0x433750,_0xf7d677){return function(_0xdb1094){if(!_0xdb1094){_0x433750[_0xd299('0x18')](0x194);}return _0xdb1094;};}function handleError(_0x224328,_0x26b067){_0x26b067=_0x26b067||0x1f4;return function(_0x56d459){logger[_0xd299('0x26')](_0x56d459[_0xd299('0x27')]);if(_0x56d459[_0xd299('0x28')]){delete _0x56d459[_0xd299('0x28')];}_0x224328[_0xd299('0x19')](_0x26b067)[_0xd299('0x29')](_0x56d459);};}exports[_0xd299('0x2a')]=function(_0x4fea3d,_0x40ccc3){var _0x32b9c6={},_0x16384a={},_0x1ca348={'count':0x0,'rows':[]};var _0x214d3e=_[_0xd299('0x2b')](db[_0xd299('0x2c')][_0xd299('0x2d')],function(_0x59d3d2){return{'name':_0x59d3d2[_0xd299('0x2e')],'type':_0x59d3d2['type'][_0xd299('0x2f')]};});_0x16384a[_0xd299('0x30')]=_['map'](_0x214d3e,_0xd299('0x28'));_0x16384a[_0xd299('0x31')]=_['keys'](_0x4fea3d['query']);_0x16384a['filters']=_['intersection'](_0x16384a[_0xd299('0x30')],_0x16384a[_0xd299('0x31')]);_0x32b9c6[_0xd299('0x32')]=_[_0xd299('0x33')](_0x16384a[_0xd299('0x30')],qs[_0xd299('0x34')](_0x4fea3d[_0xd299('0x31')][_0xd299('0x34')]));_0x32b9c6[_0xd299('0x32')]=_0x32b9c6[_0xd299('0x32')][_0xd299('0x35')]?_0x32b9c6[_0xd299('0x32')]:_0x16384a[_0xd299('0x30')];if(!_0x4fea3d[_0xd299('0x31')][_0xd299('0x36')]('nolimit')){_0x32b9c6[_0xd299('0x1d')]=qs[_0xd299('0x1d')](_0x4fea3d[_0xd299('0x31')][_0xd299('0x1d')]);_0x32b9c6['offset']=qs[_0xd299('0x1b')](_0x4fea3d[_0xd299('0x31')][_0xd299('0x1b')]);}_0x32b9c6[_0xd299('0x37')]=qs['sort'](_0x4fea3d['query'][_0xd299('0x38')]);_0x32b9c6[_0xd299('0x39')]=qs['filters'](_['pick'](_0x4fea3d[_0xd299('0x31')],_0x16384a[_0xd299('0x3a')]),_0x214d3e);if(_0x4fea3d[_0xd299('0x31')][_0xd299('0x3b')]){_0x32b9c6[_0xd299('0x39')]=_[_0xd299('0x3c')](_0x32b9c6[_0xd299('0x39')],{'$or':_[_0xd299('0x2b')](_0x214d3e,function(_0x5960b8){if(_0x5960b8[_0xd299('0x3d')]!==_0xd299('0x3e')){var _0x488b3a={};_0x488b3a[_0x5960b8[_0xd299('0x28')]]={'$like':'%'+_0x4fea3d['query'][_0xd299('0x3b')]+'%'};return _0x488b3a;}})});}_0x32b9c6=_[_0xd299('0x3c')]({},_0x32b9c6,_0x4fea3d['options']);var _0x2f23f3={'where':_0x32b9c6[_0xd299('0x39')]};return db[_0xd299('0x2c')][_0xd299('0x1e')](_0x2f23f3)['then'](function(_0x470764){_0x1ca348['count']=_0x470764;if(_0x4fea3d[_0xd299('0x31')]['includeAll']){_0x32b9c6[_0xd299('0x3f')]=[{'all':!![]}];}return db[_0xd299('0x2c')]['findAll'](_0x32b9c6);})[_0xd299('0x23')](function(_0x2497ac){_0x1ca348[_0xd299('0x40')]=_0x2497ac;return _0x1ca348;})['then'](respondWithFilteredResult(_0x40ccc3,_0x32b9c6))[_0xd299('0x41')](handleError(_0x40ccc3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b0dfdaf..20cd7e2 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 _0xa8f9=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','bluebird','request-promise','path'];(function(_0x144ba9,_0x1f1d84){var _0x186e01=function(_0x748c0f){while(--_0x748c0f){_0x144ba9['push'](_0x144ba9['shift']());}};_0x186e01(++_0x1f1d84);}(_0xa8f9,0x17b));var _0x9a8f=function(_0x1be8c5,_0x4cf1cf){_0x1be8c5=_0x1be8c5-0x0;var _0x4e4de2=_0xa8f9[_0x1be8c5];return _0x4e4de2;};'use strict';var _=require('lodash');var util=require(_0x9a8f('0x0'));var logger=require(_0x9a8f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9a8f('0x2'));var rp=require(_0x9a8f('0x3'));var fs=require('fs');var path=require(_0x9a8f('0x4'));var rimraf=require(_0x9a8f('0x5'));var config=require(_0x9a8f('0x6'));var attributes=require(_0x9a8f('0x7'));module[_0x9a8f('0x8')]=function(_0x2a16ca,_0xb056cb){return _0x2a16ca[_0x9a8f('0x9')](_0x9a8f('0xa'),attributes,{'tableName':_0x9a8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1494=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1494,0x177));var _0x4149=function(_0x59968d,_0x51a1ae){_0x59968d=_0x59968d-0x0;var _0x504b96=_0x1494[_0x59968d];return _0x504b96;};'use strict';var _=require(_0x4149('0x0'));var util=require(_0x4149('0x1'));var logger=require(_0x4149('0x2'))(_0x4149('0x3'));var moment=require('moment');var BPromise=require(_0x4149('0x4'));var rp=require(_0x4149('0x5'));var fs=require('fs');var path=require(_0x4149('0x6'));var rimraf=require(_0x4149('0x7'));var config=require(_0x4149('0x8'));var attributes=require(_0x4149('0x9'));module[_0x4149('0xa')]=function(_0x41e1e1,_0x229f7d){return _0x41e1e1[_0x4149('0xb')]('Migration',attributes,{'tableName':_0x4149('0xc'),'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 51c8833..8fc917f 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 _0xc7ea=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xc7ea,0x171));var _0xac7e=function(_0x47559f,_0x374a08){_0x47559f=_0x47559f-0x0;var _0xe1196e=_0xc7ea[_0x47559f];return _0xe1196e;};'use strict';var _=require(_0xac7e('0x0'));var util=require(_0xac7e('0x1'));var moment=require('moment');var BPromise=require(_0xac7e('0x2'));var rs=require(_0xac7e('0x3'));var fs=require('fs');var Redis=require(_0xac7e('0x4'));var db=require(_0xac7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var config=require(_0xac7e('0x8'));var jayson=require(_0xac7e('0x9'));var client=jayson[_0xac7e('0xa')][_0xac7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x447bfe,_0x1aca29,_0x1612f3){return new BPromise(function(_0x1cb874,_0x4d83fb){return client[_0xac7e('0xc')](_0x447bfe,_0x1612f3)[_0xac7e('0xd')](function(_0x2efbf4){logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));logger[_0xac7e('0x11')](_0xac7e('0x12'),_0x1aca29,_0xac7e('0x10'),JSON[_0xac7e('0x13')](_0x2efbf4));if(_0x2efbf4[_0xac7e('0x14')]){if(_0x2efbf4[_0xac7e('0x14')]['code']===0x1f4){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x4d83fb(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x1cb874(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}else{logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));_0x1cb874(_0x2efbf4[_0xac7e('0x16')][_0xac7e('0x15')]);}})['catch'](function(_0x3f4869){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x3f4869);_0x4d83fb(_0x3f4869);});});} \ No newline at end of file +var _0xc2cc=['util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x587cea,_0x45cf12){var _0x58724c=function(_0x3e86b4){while(--_0x3e86b4){_0x587cea['push'](_0x587cea['shift']());}};_0x58724c(++_0x45cf12);}(_0xc2cc,0x70));var _0xcc2c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc2cc[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xcc2c('0x0'));var moment=require(_0xcc2c('0x1'));var BPromise=require(_0xcc2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc2c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc2c('0x4'));var logger=require('../../config/logger')(_0xcc2c('0x5'));var config=require('../../config/environment');var jayson=require(_0xcc2c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475a85,_0x4ab837,_0x144b90){return new BPromise(function(_0x5a276f,_0x1d311f){return client['request'](_0x475a85,_0x144b90)['then'](function(_0x2bde97){logger[_0xcc2c('0x7')](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));logger[_0xcc2c('0xa')](_0xcc2c('0xb'),_0x4ab837,_0xcc2c('0x9'),JSON[_0xcc2c('0xc')](_0x2bde97));if(_0x2bde97['error']){if(_0x2bde97[_0xcc2c('0xd')]['code']===0x1f4){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')][_0xcc2c('0xe')]);return _0x1d311f(_0x2bde97['error']['message']);}logger['error'](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')]['message']);return _0x5a276f(_0x2bde97['error'][_0xcc2c('0xe')]);}else{logger['info'](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));_0x5a276f(_0x2bde97[_0xcc2c('0xf')][_0xcc2c('0xe')]);}})['catch'](function(_0x5d6189){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x5d6189);_0x1d311f(_0x5d6189);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 587f561..fa33516 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 _0xad5f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xad5f,0x1a8));var _0xfad5=function(_0x2e5a8c,_0x35f4bf){_0x2e5a8c=_0x2e5a8c-0x0;var _0x5816ec=_0xad5f[_0x2e5a8c];return _0x5816ec;};'use strict';var multer=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var path=require(_0xfad5('0x2'));var timeout=require(_0xfad5('0x3'));var express=require(_0xfad5('0x4'));var router=express[_0xfad5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfad5('0x6'));var interaction=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var controller=require(_0xfad5('0x9'));router[_0xfad5('0xa')]('/',auth[_0xfad5('0xb')](),controller[_0xfad5('0xc')]);router['get'](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0xe')]);router[_0xfad5('0xf')]('/',auth['isAuthenticated'](),controller[_0xfad5('0x10')]);router[_0xfad5('0x11')](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0x12')]);router[_0xfad5('0x13')](_0xfad5('0xd'),auth['isAuthenticated'](),controller[_0xfad5('0x14')]);module[_0xfad5('0x15')]=router; \ No newline at end of file +var _0x3dd7=['post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show'];(function(_0x574142,_0x1b7716){var _0x2afa92=function(_0x42827e){while(--_0x42827e){_0x574142['push'](_0x574142['shift']());}};_0x2afa92(++_0x1b7716);}(_0x3dd7,0xe9));var _0x73dd=function(_0x3f5395,_0x5189ef){_0x3f5395=_0x3f5395-0x0;var _0x1bb11e=_0x3dd7[_0x3f5395];return _0x1bb11e;};'use strict';var multer=require(_0x73dd('0x0'));var util=require(_0x73dd('0x1'));var path=require(_0x73dd('0x2'));var timeout=require(_0x73dd('0x3'));var express=require('express');var router=express[_0x73dd('0x4')]();var fs_extra=require(_0x73dd('0x5'));var auth=require(_0x73dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73dd('0x7'));var controller=require(_0x73dd('0x8'));router[_0x73dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x73dd('0xa')]);router[_0x73dd('0x9')](_0x73dd('0xb'),auth[_0x73dd('0xc')](),controller[_0x73dd('0xd')]);router[_0x73dd('0xe')]('/',auth[_0x73dd('0xc')](),controller[_0x73dd('0xf')]);router[_0x73dd('0x10')](_0x73dd('0xb'),auth[_0x73dd('0xc')](),controller['update']);router[_0x73dd('0x11')]('/:id',auth[_0x73dd('0xc')](),controller['destroy']);module[_0x73dd('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 2f49b01..703df17 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 _0xf6f2=['ENUM','externip','stun','turn','STRING','sequelize','exports'];(function(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0xf6f2,0x171));var _0x2f6f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf6f2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x2f6f('0x0'));module[_0x2f6f('0x1')]={'type':{'type':Sequelize[_0x2f6f('0x2')]('localnet',_0x2f6f('0x3'),_0x2f6f('0x4'),_0x2f6f('0x5'))},'value':{'type':Sequelize[_0x2f6f('0x6')]},'username':{'type':Sequelize[_0x2f6f('0x6')]},'password':{'type':Sequelize[_0x2f6f('0x6')]}}; \ No newline at end of file +var _0x876f=['stun','turn','STRING','sequelize','localnet'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x876f,0xd5));var _0xf876=function(_0x5c8c00,_0x552a5b){_0x5c8c00=_0x5c8c00-0x0;var _0x3a162a=_0x876f[_0x5c8c00];return _0x3a162a;};'use strict';var Sequelize=require(_0xf876('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf876('0x1'),'externip',_0xf876('0x2'),_0xf876('0x3'))},'value':{'type':Sequelize[_0xf876('0x4')]},'username':{'type':Sequelize[_0xf876('0x4')]},'password':{'type':Sequelize[_0xf876('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 038d886..850799d 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 _0x4502=['filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','Network','findAll','rows','show','params','find','create','sequelize','body','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','eml-format','zip-dir','moment','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','rawAttributes','type','key','model','map','query','keys'];(function(_0x9d2e,_0x18ba09){var _0x53e359=function(_0x5d1a5f){while(--_0x5d1a5f){_0x9d2e['push'](_0x9d2e['shift']());}};_0x53e359(++_0x18ba09);}(_0x4502,0x157));var _0x2450=function(_0x40b2c5,_0x2ed3da){_0x40b2c5=_0x40b2c5-0x0;var _0x2d9d66=_0x4502[_0x40b2c5];return _0x2d9d66;};'use strict';var emlformat=require(_0x2450('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2450('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2450('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2450('0x3'));var util=require(_0x2450('0x4'));var path=require(_0x2450('0x5'));var sox=require(_0x2450('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2450('0x7'));var squel=require(_0x2450('0x8'));var crypto=require('crypto');var jsforce=require(_0x2450('0x9'));var deskjs=require(_0x2450('0xa'));var toCsv=require(_0x2450('0xb'));var querystring=require(_0x2450('0xc'));var Papa=require(_0x2450('0xd'));var Redis=require(_0x2450('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2450('0xf'));var as=require(_0x2450('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2450('0x11'));var utils=require(_0x2450('0x12'));var config=require(_0x2450('0x13'));var licenseUtil=require(_0x2450('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2450('0x15'));var client=jayson[_0x2450('0x16')][_0x2450('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x149762,_0x2aa48d,_0x2e80f3,_0x3b6568){return new BPromise(function(_0x110db4,_0x3c27e2){var _0x1956e5=_0x3b6568||client;return _0x1956e5[_0x2450('0x18')](_0x149762,_0x2e80f3)[_0x2450('0x19')](function(_0x5e8937){logger[_0x2450('0x1a')](_0x2450('0x1b'),_0x2aa48d,_0x2450('0x1c'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x2aa48d,_0x2450('0x1c'),JSON[_0x2450('0x1d')](_0x5e8937));if(_0x5e8937['error']){if(_0x5e8937[_0x2450('0x1e')]['code']===0x1f4){logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x5e8937['error'][_0x2450('0x1f')]);return _0x3c27e2(_0x5e8937[_0x2450('0x1e')]['message']);}logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x5e8937[_0x2450('0x1e')][_0x2450('0x1f')]);return _0x110db4(_0x5e8937['error']['message']);}else{logger['info'](_0x2450('0x1b'),_0x2aa48d,'request\x20sent');_0x110db4(_0x5e8937[_0x2450('0x20')]['message']);}})[_0x2450('0x21')](function(_0x82835f){logger[_0x2450('0x1e')](_0x2450('0x1b'),_0x2aa48d,_0x82835f);_0x3c27e2(_0x82835f);});});}function respondWithStatusCode(_0x378b2b,_0x1564e8){_0x1564e8=_0x1564e8||0xcc;return function(_0x357bd0){if(_0x357bd0){return _0x378b2b['sendStatus'](_0x1564e8);}return _0x378b2b['status'](_0x1564e8)[_0x2450('0x22')]();};}function respondWithResult(_0x51e01a,_0x319e42){_0x319e42=_0x319e42||0xc8;return function(_0x3be156){if(_0x3be156){return _0x51e01a[_0x2450('0x23')](_0x319e42)[_0x2450('0x24')](_0x3be156);}};}function respondWithFilteredResult(_0xb96a9a,_0x225250){return function(_0x126855){if(_0x126855){var _0x2180ff=typeof _0x225250[_0x2450('0x25')]===_0x2450('0x26')&&typeof _0x225250[_0x2450('0x27')]===_0x2450('0x26');var _0x164fb2=_0x126855[_0x2450('0x28')];var _0x4f0997=_0x2180ff?0x0:_0x225250[_0x2450('0x25')];var _0x2225ac=_0x2180ff?_0x126855[_0x2450('0x28')]:_0x225250['offset']+_0x225250[_0x2450('0x27')];var _0x3b3793;if(_0x2225ac>=_0x164fb2){_0x2225ac=_0x164fb2;_0x3b3793=0xc8;}else{_0x3b3793=0xce;}_0xb96a9a[_0x2450('0x23')](_0x3b3793);return _0xb96a9a[_0x2450('0x29')](_0x2450('0x2a'),_0x4f0997+'-'+_0x2225ac+'/'+_0x164fb2)[_0x2450('0x24')](_0x126855);}return null;};}function patchUpdates(_0x1a740f){return function(_0x237ca2){try{jsonpatch[_0x2450('0x2b')](_0x237ca2,_0x1a740f,!![]);}catch(_0x3c9ea9){return BPromise[_0x2450('0x2c')](_0x3c9ea9);}return _0x237ca2[_0x2450('0x2d')]();};}function saveUpdates(_0x409aed,_0x43c34b){return function(_0x4196a0){if(_0x4196a0){return _0x4196a0[_0x2450('0x2e')](_0x409aed)[_0x2450('0x19')](function(_0x409e30){return _0x409e30;});}return null;};}function removeEntity(_0x45c5cd,_0x6ade59){return function(_0x2f9e9a){if(_0x2f9e9a){return _0x2f9e9a[_0x2450('0x2f')]()[_0x2450('0x19')](function(){_0x45c5cd[_0x2450('0x23')](0xcc)[_0x2450('0x22')]();});}};}function handleEntityNotFound(_0x129dfc,_0x3d75ce){return function(_0x3c071f){if(!_0x3c071f){_0x129dfc['sendStatus'](0x194);}return _0x3c071f;};}function handleError(_0x3ca808,_0x350233){_0x350233=_0x350233||0x1f4;return function(_0x3f07cb){logger[_0x2450('0x1e')](_0x3f07cb['stack']);if(_0x3f07cb['name']){delete _0x3f07cb[_0x2450('0x30')];}_0x3ca808[_0x2450('0x23')](_0x350233)[_0x2450('0x31')](_0x3f07cb);};}exports['index']=function(_0x3f9fee,_0x349679){var _0x56b11b={},_0x2ea48d={},_0x38e7f7={'count':0x0,'rows':[]};var _0x73ca5a=_['map'](db['Network'][_0x2450('0x32')],function(_0x1b421a){return{'name':_0x1b421a['fieldName'],'type':_0x1b421a[_0x2450('0x33')][_0x2450('0x34')]};});_0x2ea48d[_0x2450('0x35')]=_[_0x2450('0x36')](_0x73ca5a,_0x2450('0x30'));_0x2ea48d[_0x2450('0x37')]=_[_0x2450('0x38')](_0x3f9fee[_0x2450('0x37')]);_0x2ea48d[_0x2450('0x39')]=_[_0x2450('0x3a')](_0x2ea48d['model'],_0x2ea48d[_0x2450('0x37')]);_0x56b11b[_0x2450('0x3b')]=_[_0x2450('0x3a')](_0x2ea48d[_0x2450('0x35')],qs[_0x2450('0x3c')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x3c')]));_0x56b11b[_0x2450('0x3b')]=_0x56b11b['attributes'][_0x2450('0x3d')]?_0x56b11b['attributes']:_0x2ea48d[_0x2450('0x35')];if(!_0x3f9fee['query']['hasOwnProperty']('nolimit')){_0x56b11b[_0x2450('0x27')]=qs[_0x2450('0x27')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x27')]);_0x56b11b[_0x2450('0x25')]=qs[_0x2450('0x25')](_0x3f9fee[_0x2450('0x37')]['offset']);}_0x56b11b[_0x2450('0x3e')]=qs[_0x2450('0x3f')](_0x3f9fee[_0x2450('0x37')][_0x2450('0x3f')]);_0x56b11b[_0x2450('0x40')]=qs[_0x2450('0x39')](_[_0x2450('0x41')](_0x3f9fee['query'],_0x2ea48d[_0x2450('0x39')]),_0x73ca5a);if(_0x3f9fee[_0x2450('0x37')][_0x2450('0x42')]){_0x56b11b[_0x2450('0x40')]=_[_0x2450('0x43')](_0x56b11b[_0x2450('0x40')],{'$or':_[_0x2450('0x36')](_0x73ca5a,function(_0x2e5a16){if(_0x2e5a16[_0x2450('0x33')]!=='VIRTUAL'){var _0x3e981b={};_0x3e981b[_0x2e5a16[_0x2450('0x30')]]={'$like':'%'+_0x3f9fee[_0x2450('0x37')][_0x2450('0x42')]+'%'};return _0x3e981b;}})});}_0x56b11b=_[_0x2450('0x43')]({},_0x56b11b,_0x3f9fee[_0x2450('0x44')]);var _0x40f5c7={'where':_0x56b11b[_0x2450('0x40')]};return db['Network']['count'](_0x40f5c7)[_0x2450('0x19')](function(_0x3bf9c4){_0x38e7f7[_0x2450('0x28')]=_0x3bf9c4;if(_0x3f9fee['query'][_0x2450('0x45')]){_0x56b11b[_0x2450('0x46')]=[{'all':!![]}];}return db[_0x2450('0x47')][_0x2450('0x48')](_0x56b11b);})['then'](function(_0x212b79){_0x38e7f7[_0x2450('0x49')]=_0x212b79;return _0x38e7f7;})['then'](respondWithFilteredResult(_0x349679,_0x56b11b))[_0x2450('0x21')](handleError(_0x349679,null));};exports[_0x2450('0x4a')]=function(_0x1fa995,_0x142ce7){var _0x42082a={'raw':!![],'where':{'id':_0x1fa995[_0x2450('0x4b')]['id']}},_0x551980={};_0x551980[_0x2450('0x35')]=_[_0x2450('0x38')](db[_0x2450('0x47')]['rawAttributes']);_0x551980[_0x2450('0x37')]=_['keys'](_0x1fa995[_0x2450('0x37')]);_0x551980[_0x2450('0x39')]=_[_0x2450('0x3a')](_0x551980[_0x2450('0x35')],_0x551980[_0x2450('0x37')]);_0x42082a[_0x2450('0x3b')]=_['intersection'](_0x551980['model'],qs['fields'](_0x1fa995['query'][_0x2450('0x3c')]));_0x42082a[_0x2450('0x3b')]=_0x42082a[_0x2450('0x3b')][_0x2450('0x3d')]?_0x42082a[_0x2450('0x3b')]:_0x551980[_0x2450('0x35')];if(_0x1fa995[_0x2450('0x37')][_0x2450('0x45')]){_0x42082a[_0x2450('0x46')]=[{'all':!![]}];}_0x42082a=_[_0x2450('0x43')]({},_0x42082a,_0x1fa995[_0x2450('0x44')]);return db[_0x2450('0x47')][_0x2450('0x4c')](_0x42082a)[_0x2450('0x19')](handleEntityNotFound(_0x142ce7,null))[_0x2450('0x19')](respondWithResult(_0x142ce7,null))[_0x2450('0x21')](handleError(_0x142ce7,null));};exports[_0x2450('0x4d')]=function(_0x4bffc5,_0xca30ac,_0x487882){var _0x3cdfde;return db[_0x2450('0x4e')]['transaction'](function(_0x530f26){return db['Network'][_0x2450('0x4d')](_0x4bffc5[_0x2450('0x4f')],{'raw':!![]})[_0x2450('0x19')](function(_0x253001){_0x3cdfde=_0x253001;return db['Network'][_0x2450('0x48')]({'where':{'type':_0x4bffc5['body'][_0x2450('0x33')]},'raw':!![]});})[_0x2450('0x19')](function(_0xd05a59){if(_0x3cdfde[_0x2450('0x33')][_0x2450('0x50')]()==_0x2450('0x51')){var _0x2537ed=fs[_0x2450('0x52')](path['join'](config['root'],_0x2450('0x53')),_0x2450('0x54'));var _0x21a6f5=ejs[_0x2450('0x55')](_0x2537ed,{'networks':_0xd05a59||[]});fs['writeFileSync'](_0x2450('0x56'),_0x21a6f5);return respondWithRpcPromise(_0x2450('0x57'),'create',{'module':_0x2450('0x58')});}else if(_0x3cdfde['type'][_0x2450('0x50')]()=='TURN'){var _0x3a2e16=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x5b')),'utf8');var _0x322979=ejs[_0x2450('0x55')](_0x3a2e16,{'networks':_0xd05a59||[]});fs['writeFileSync'](_0x2450('0x5c'),_0x322979);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x4d'),{'module':_0x2450('0x58')});}else{var _0xbfa3b5=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x5d')),_0x2450('0x54'));var _0x4873fe=ejs[_0x2450('0x55')](_0xbfa3b5,{'networks':_0xd05a59||[]});fs[_0x2450('0x5e')](util[_0x2450('0x5f')](_0x2450('0x60'),_0x4bffc5[_0x2450('0x4f')]['type'][_0x2450('0x61')]()),_0x4873fe);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x4d'),{'module':_0x2450('0x62')});}return null;})[_0x2450('0x19')](function(){return _0x3cdfde;});})[_0x2450('0x19')](respondWithResult(_0xca30ac,0xc9))[_0x2450('0x21')](handleError(_0xca30ac,null));};exports[_0x2450('0x2e')]=function(_0x188034,_0x35f705,_0x426ba5){var _0x434c44;return db[_0x2450('0x4e')]['transaction'](function(_0x2e6d52){return db[_0x2450('0x47')]['find']({'where':{'id':_0x188034[_0x2450('0x4b')]['id']}})[_0x2450('0x19')](handleEntityNotFound(_0x35f705,null))[_0x2450('0x19')](saveUpdates(_0x188034[_0x2450('0x4f')],null))[_0x2450('0x19')](function(_0x2b7841){if(_0x2b7841){_0x434c44=_0x2b7841;return db[_0x2450('0x47')][_0x2450('0x48')]({'where':{'type':_0x434c44[_0x2450('0x33')]},'raw':!![]});}return null;})[_0x2450('0x19')](function(_0x19a1c6){if(_0x434c44[_0x2450('0x33')]['toUpperCase']()==_0x2450('0x51')){var _0x194cae=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],_0x2450('0x53')),_0x2450('0x54'));var _0x5c0790=ejs[_0x2450('0x55')](_0x194cae,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](_0x2450('0x56'),_0x5c0790);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2e'),{'module':_0x2450('0x58')});}else if(_0x434c44[_0x2450('0x33')][_0x2450('0x50')]()==_0x2450('0x63')){var _0x5bdd35=fs[_0x2450('0x52')](path[_0x2450('0x59')](config[_0x2450('0x5a')],'server/files/templates/turn_multiple.ejs'),_0x2450('0x54'));var _0x1c4a5c=ejs[_0x2450('0x55')](_0x5bdd35,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](_0x2450('0x5c'),_0x1c4a5c);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2e'),{'module':_0x2450('0x58')});}else{var _0x53d25f=fs['readFileSync'](path['join'](config[_0x2450('0x5a')],'server/files/templates/network.ejs'),_0x2450('0x54'));var _0x1b62ec=ejs[_0x2450('0x55')](_0x53d25f,{'networks':_0x19a1c6||[]});fs[_0x2450('0x5e')](util[_0x2450('0x5f')](_0x2450('0x60'),_0x188034[_0x2450('0x4f')][_0x2450('0x33')]['toLowerCase']()),_0x1b62ec);return respondWithRpcPromise('Reload',_0x2450('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x9109eb){if(_0x9109eb){return _0x434c44;}return null;});})[_0x2450('0x19')](respondWithResult(_0x35f705,null))[_0x2450('0x21')](handleError(_0x35f705,null));};exports['destroy']=function(_0x53b61e,_0x52457f,_0xd9f508){var _0x1b23af;return db[_0x2450('0x47')][_0x2450('0x4c')]({'where':{'id':_0x53b61e['params']['id']}})['then'](function(_0x198a65){_0x1b23af=_0x198a65;return _0x198a65;})[_0x2450('0x19')](handleEntityNotFound(_0x52457f,null))[_0x2450('0x19')](removeEntity(_0x52457f,null))[_0x2450('0x19')](function(){if(_0x1b23af){return db[_0x2450('0x47')][_0x2450('0x48')]({'where':{'type':_0x1b23af[_0x2450('0x33')]},'raw':!![]});}})[_0x2450('0x19')](function(_0xc0cba5){if(_0x1b23af[_0x2450('0x33')]['toUpperCase']()==_0x2450('0x51')){var _0x56934f=fs[_0x2450('0x52')](path[_0x2450('0x59')](config['root'],_0x2450('0x53')),_0x2450('0x54'));var _0x2e8abd=ejs[_0x2450('0x55')](_0x56934f,{'networks':_0xc0cba5||[]});fs['writeFileSync'](_0x2450('0x56'),_0x2e8abd);return respondWithRpcPromise('Reload',_0x2450('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x1b23af[_0x2450('0x33')][_0x2450('0x50')]()=='TURN'){var _0xd9ae97=fs[_0x2450('0x52')](path[_0x2450('0x59')](config['root'],_0x2450('0x5b')),_0x2450('0x54'));var _0x49449c=ejs[_0x2450('0x55')](_0xd9ae97,{'networks':_0xc0cba5||[]});fs['writeFileSync'](_0x2450('0x5c'),_0x49449c);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2f'),{'module':_0x2450('0x58')});}else{var _0x24a43d=fs[_0x2450('0x52')](path['join'](config['root'],_0x2450('0x5d')),_0x2450('0x54'));var _0x4e48bd=ejs[_0x2450('0x55')](_0x24a43d,{'networks':_0xc0cba5||[]});fs[_0x2450('0x5e')](util['format'](_0x2450('0x60'),_0x53b61e['body'][_0x2450('0x33')][_0x2450('0x61')]()),_0x4e48bd);return respondWithRpcPromise(_0x2450('0x57'),_0x2450('0x2f'),{'module':_0x2450('0x62')});}return null;})[_0x2450('0x21')](handleError(_0x52457f,null));}; \ No newline at end of file +var _0x6250=['sort','where','pick','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','show','params','keys','find','sequelize','create','body','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','root','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','transaction','toUpperCase','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','json','offset','undefined','count','set','apply','reject','save','update','destroy','status','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit'];(function(_0x382efe,_0x3cefd0){var _0x54c634=function(_0x180084){while(--_0x180084){_0x382efe['push'](_0x382efe['shift']());}};_0x54c634(++_0x3cefd0);}(_0x6250,0x91));var _0x0625=function(_0x33f002,_0x5c8533){_0x33f002=_0x33f002-0x0;var _0x283058=_0x6250[_0x33f002];return _0x283058;};'use strict';var emlformat=require(_0x0625('0x0'));var rimraf=require(_0x0625('0x1'));var zipdir=require(_0x0625('0x2'));var jsonpatch=require(_0x0625('0x3'));var rp=require(_0x0625('0x4'));var moment=require(_0x0625('0x5'));var BPromise=require(_0x0625('0x6'));var Mustache=require(_0x0625('0x7'));var util=require('util');var path=require(_0x0625('0x8'));var sox=require('sox');var csv=require(_0x0625('0x9'));var ejs=require(_0x0625('0xa'));var fs=require('fs');var fs_extra=require(_0x0625('0xb'));var _=require('lodash');var squel=require(_0x0625('0xc'));var crypto=require(_0x0625('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0625('0xe'));var Papa=require(_0x0625('0xf'));var Redis=require(_0x0625('0x10'));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(_0x0625('0x11'))(_0x0625('0x12'));var utils=require('../../config/utils');var config=require(_0x0625('0x13'));var licenseUtil=require(_0x0625('0x14'));var db=require(_0x0625('0x15'))['db'];var jayson=require(_0x0625('0x16'));var client=jayson[_0x0625('0x17')][_0x0625('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x17baea,_0x4e699f,_0x49fe0b,_0x463098){return new BPromise(function(_0x2d69f0,_0x17c4ef){var _0x2dee53=_0x463098||client;return _0x2dee53[_0x0625('0x19')](_0x17baea,_0x49fe0b)[_0x0625('0x1a')](function(_0x147897){logger[_0x0625('0x1b')](_0x0625('0x1c'),_0x4e699f,'request\x20sent');logger[_0x0625('0x1d')](_0x0625('0x1e'),_0x4e699f,'request\x20sent',JSON[_0x0625('0x1f')](_0x147897));if(_0x147897[_0x0625('0x20')]){if(_0x147897[_0x0625('0x20')]['code']===0x1f4){logger[_0x0625('0x20')]('Network,\x20%s,\x20%s',_0x4e699f,_0x147897[_0x0625('0x20')][_0x0625('0x21')]);return _0x17c4ef(_0x147897[_0x0625('0x20')]['message']);}logger['error'](_0x0625('0x1c'),_0x4e699f,_0x147897[_0x0625('0x20')][_0x0625('0x21')]);return _0x2d69f0(_0x147897[_0x0625('0x20')][_0x0625('0x21')]);}else{logger[_0x0625('0x1b')](_0x0625('0x1c'),_0x4e699f,_0x0625('0x22'));_0x2d69f0(_0x147897[_0x0625('0x23')][_0x0625('0x21')]);}})[_0x0625('0x24')](function(_0x327bec){logger[_0x0625('0x20')](_0x0625('0x1c'),_0x4e699f,_0x327bec);_0x17c4ef(_0x327bec);});});}function respondWithStatusCode(_0x27f911,_0x3d715d){_0x3d715d=_0x3d715d||0xcc;return function(_0xbf62d1){if(_0xbf62d1){return _0x27f911[_0x0625('0x25')](_0x3d715d);}return _0x27f911['status'](_0x3d715d)['end']();};}function respondWithResult(_0x5c8462,_0x18c295){_0x18c295=_0x18c295||0xc8;return function(_0x1707fc){if(_0x1707fc){return _0x5c8462['status'](_0x18c295)[_0x0625('0x26')](_0x1707fc);}};}function respondWithFilteredResult(_0x3effd8,_0x3ef1d5){return function(_0x5617be){if(_0x5617be){var _0x1766b5=typeof _0x3ef1d5[_0x0625('0x27')]===_0x0625('0x28')&&typeof _0x3ef1d5['limit']===_0x0625('0x28');var _0x309525=_0x5617be[_0x0625('0x29')];var _0x151314=_0x1766b5?0x0:_0x3ef1d5['offset'];var _0x1488a1=_0x1766b5?_0x5617be['count']:_0x3ef1d5[_0x0625('0x27')]+_0x3ef1d5['limit'];var _0x1143b9;if(_0x1488a1>=_0x309525){_0x1488a1=_0x309525;_0x1143b9=0xc8;}else{_0x1143b9=0xce;}_0x3effd8['status'](_0x1143b9);return _0x3effd8[_0x0625('0x2a')]('Content-Range',_0x151314+'-'+_0x1488a1+'/'+_0x309525)[_0x0625('0x26')](_0x5617be);}return null;};}function patchUpdates(_0x4533fc){return function(_0xed012a){try{jsonpatch[_0x0625('0x2b')](_0xed012a,_0x4533fc,!![]);}catch(_0x3bff99){return BPromise[_0x0625('0x2c')](_0x3bff99);}return _0xed012a[_0x0625('0x2d')]();};}function saveUpdates(_0x249ee4,_0x13b206){return function(_0x46f7f5){if(_0x46f7f5){return _0x46f7f5[_0x0625('0x2e')](_0x249ee4)[_0x0625('0x1a')](function(_0x1247c1){return _0x1247c1;});}return null;};}function removeEntity(_0xb1c7b5,_0x23aee2){return function(_0x41d7a4){if(_0x41d7a4){return _0x41d7a4[_0x0625('0x2f')]()[_0x0625('0x1a')](function(){_0xb1c7b5[_0x0625('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11185a,_0x1f4b75){return function(_0x597f52){if(!_0x597f52){_0x11185a[_0x0625('0x25')](0x194);}return _0x597f52;};}function handleError(_0x1bfd5f,_0xf932f1){_0xf932f1=_0xf932f1||0x1f4;return function(_0x2a11b4){logger[_0x0625('0x20')](_0x2a11b4[_0x0625('0x31')]);if(_0x2a11b4[_0x0625('0x32')]){delete _0x2a11b4['name'];}_0x1bfd5f[_0x0625('0x30')](_0xf932f1)[_0x0625('0x33')](_0x2a11b4);};}exports[_0x0625('0x34')]=function(_0x3b5b0a,_0x2b676b){var _0x242cee={},_0x2db488={},_0x5cc087={'count':0x0,'rows':[]};var _0x18650f=_[_0x0625('0x35')](db['Network'][_0x0625('0x36')],function(_0x1443bd){return{'name':_0x1443bd['fieldName'],'type':_0x1443bd[_0x0625('0x37')][_0x0625('0x38')]};});_0x2db488[_0x0625('0x39')]=_['map'](_0x18650f,_0x0625('0x32'));_0x2db488[_0x0625('0x3a')]=_['keys'](_0x3b5b0a[_0x0625('0x3a')]);_0x2db488[_0x0625('0x3b')]=_[_0x0625('0x3c')](_0x2db488[_0x0625('0x39')],_0x2db488['query']);_0x242cee['attributes']=_[_0x0625('0x3c')](_0x2db488[_0x0625('0x39')],qs[_0x0625('0x3d')](_0x3b5b0a['query'][_0x0625('0x3d')]));_0x242cee[_0x0625('0x3e')]=_0x242cee[_0x0625('0x3e')][_0x0625('0x3f')]?_0x242cee[_0x0625('0x3e')]:_0x2db488[_0x0625('0x39')];if(!_0x3b5b0a[_0x0625('0x3a')][_0x0625('0x40')](_0x0625('0x41'))){_0x242cee['limit']=qs[_0x0625('0x42')](_0x3b5b0a['query']['limit']);_0x242cee[_0x0625('0x27')]=qs['offset'](_0x3b5b0a[_0x0625('0x3a')][_0x0625('0x27')]);}_0x242cee['order']=qs[_0x0625('0x43')](_0x3b5b0a['query'][_0x0625('0x43')]);_0x242cee[_0x0625('0x44')]=qs[_0x0625('0x3b')](_[_0x0625('0x45')](_0x3b5b0a['query'],_0x2db488['filters']),_0x18650f);if(_0x3b5b0a[_0x0625('0x3a')][_0x0625('0x46')]){_0x242cee['where']=_[_0x0625('0x47')](_0x242cee[_0x0625('0x44')],{'$or':_[_0x0625('0x35')](_0x18650f,function(_0x5db772){if(_0x5db772[_0x0625('0x37')]!==_0x0625('0x48')){var _0x3ecf2a={};_0x3ecf2a[_0x5db772[_0x0625('0x32')]]={'$like':'%'+_0x3b5b0a['query']['filter']+'%'};return _0x3ecf2a;}})});}_0x242cee=_[_0x0625('0x47')]({},_0x242cee,_0x3b5b0a[_0x0625('0x49')]);var _0x23b757={'where':_0x242cee[_0x0625('0x44')]};return db[_0x0625('0x4a')]['count'](_0x23b757)[_0x0625('0x1a')](function(_0x1dc8f0){_0x5cc087[_0x0625('0x29')]=_0x1dc8f0;if(_0x3b5b0a['query'][_0x0625('0x4b')]){_0x242cee[_0x0625('0x4c')]=[{'all':!![]}];}return db['Network'][_0x0625('0x4d')](_0x242cee);})['then'](function(_0x353791){_0x5cc087['rows']=_0x353791;return _0x5cc087;})['then'](respondWithFilteredResult(_0x2b676b,_0x242cee))[_0x0625('0x24')](handleError(_0x2b676b,null));};exports[_0x0625('0x4e')]=function(_0x59bc61,_0x36f353){var _0x14689b={'raw':!![],'where':{'id':_0x59bc61[_0x0625('0x4f')]['id']}},_0x22d909={};_0x22d909[_0x0625('0x39')]=_['keys'](db[_0x0625('0x4a')][_0x0625('0x36')]);_0x22d909[_0x0625('0x3a')]=_[_0x0625('0x50')](_0x59bc61[_0x0625('0x3a')]);_0x22d909[_0x0625('0x3b')]=_[_0x0625('0x3c')](_0x22d909[_0x0625('0x39')],_0x22d909[_0x0625('0x3a')]);_0x14689b[_0x0625('0x3e')]=_[_0x0625('0x3c')](_0x22d909[_0x0625('0x39')],qs[_0x0625('0x3d')](_0x59bc61['query'][_0x0625('0x3d')]));_0x14689b['attributes']=_0x14689b[_0x0625('0x3e')][_0x0625('0x3f')]?_0x14689b[_0x0625('0x3e')]:_0x22d909[_0x0625('0x39')];if(_0x59bc61[_0x0625('0x3a')][_0x0625('0x4b')]){_0x14689b[_0x0625('0x4c')]=[{'all':!![]}];}_0x14689b=_[_0x0625('0x47')]({},_0x14689b,_0x59bc61[_0x0625('0x49')]);return db['Network'][_0x0625('0x51')](_0x14689b)[_0x0625('0x1a')](handleEntityNotFound(_0x36f353,null))['then'](respondWithResult(_0x36f353,null))[_0x0625('0x24')](handleError(_0x36f353,null));};exports['create']=function(_0x4b5278,_0x123dc9,_0x221f4b){var _0xbca04f;return db[_0x0625('0x52')]['transaction'](function(_0x1bd889){return db[_0x0625('0x4a')][_0x0625('0x53')](_0x4b5278[_0x0625('0x54')],{'raw':!![]})[_0x0625('0x1a')](function(_0x53f13e){_0xbca04f=_0x53f13e;return db[_0x0625('0x4a')]['findAll']({'where':{'type':_0x4b5278[_0x0625('0x54')][_0x0625('0x37')]},'raw':!![]});})['then'](function(_0xc308bb){if(_0xbca04f[_0x0625('0x37')]['toUpperCase']()==_0x0625('0x55')){var _0x159471=fs[_0x0625('0x56')](path[_0x0625('0x57')](config['root'],_0x0625('0x58')),'utf8');var _0x48eaea=ejs[_0x0625('0x59')](_0x159471,{'networks':_0xc308bb||[]});fs['writeFileSync'](_0x0625('0x5a'),_0x48eaea);return respondWithRpcPromise(_0x0625('0x5b'),'create',{'module':'res_stun_monitor.so'});}else if(_0xbca04f[_0x0625('0x37')]['toUpperCase']()==_0x0625('0x5c')){var _0x1b4a2c=fs[_0x0625('0x56')](path[_0x0625('0x57')](config[_0x0625('0x5d')],_0x0625('0x5e')),_0x0625('0x5f'));var _0x2cd817=ejs[_0x0625('0x59')](_0x1b4a2c,{'networks':_0xc308bb||[]});fs[_0x0625('0x60')]('/etc/asterisk/turn_xcally.conf',_0x2cd817);return respondWithRpcPromise('Reload',_0x0625('0x53'),{'module':_0x0625('0x61')});}else{var _0x3b7370=fs[_0x0625('0x56')](path['join'](config[_0x0625('0x5d')],'server/files/templates/network.ejs'),_0x0625('0x5f'));var _0x575529=ejs[_0x0625('0x59')](_0x3b7370,{'networks':_0xc308bb||[]});fs['writeFileSync'](util[_0x0625('0x62')](_0x0625('0x63'),_0x4b5278[_0x0625('0x54')]['type'][_0x0625('0x64')]()),_0x575529);return respondWithRpcPromise(_0x0625('0x5b'),_0x0625('0x53'),{'module':_0x0625('0x65')});}return null;})[_0x0625('0x1a')](function(){return _0xbca04f;});})[_0x0625('0x1a')](respondWithResult(_0x123dc9,0xc9))[_0x0625('0x24')](handleError(_0x123dc9,null));};exports[_0x0625('0x2e')]=function(_0x458e63,_0x391c25,_0x251d76){var _0x875538;return db[_0x0625('0x52')][_0x0625('0x66')](function(_0x23de23){return db[_0x0625('0x4a')][_0x0625('0x51')]({'where':{'id':_0x458e63[_0x0625('0x4f')]['id']}})['then'](handleEntityNotFound(_0x391c25,null))['then'](saveUpdates(_0x458e63[_0x0625('0x54')],null))[_0x0625('0x1a')](function(_0x3e3219){if(_0x3e3219){_0x875538=_0x3e3219;return db[_0x0625('0x4a')]['findAll']({'where':{'type':_0x875538['type']},'raw':!![]});}return null;})[_0x0625('0x1a')](function(_0x56fbea){if(_0x875538[_0x0625('0x37')][_0x0625('0x67')]()==_0x0625('0x55')){var _0x23eb8f=fs['readFileSync'](path[_0x0625('0x57')](config[_0x0625('0x5d')],_0x0625('0x58')),'utf8');var _0x5755ff=ejs[_0x0625('0x59')](_0x23eb8f,{'networks':_0x56fbea||[]});fs[_0x0625('0x60')]('/etc/asterisk/stun_xcally.conf',_0x5755ff);return respondWithRpcPromise(_0x0625('0x5b'),_0x0625('0x2e'),{'module':_0x0625('0x61')});}else if(_0x875538[_0x0625('0x37')][_0x0625('0x67')]()=='TURN'){var _0x2cc058=fs[_0x0625('0x56')](path[_0x0625('0x57')](config[_0x0625('0x5d')],_0x0625('0x5e')),_0x0625('0x5f'));var _0x232a43=ejs[_0x0625('0x59')](_0x2cc058,{'networks':_0x56fbea||[]});fs[_0x0625('0x60')](_0x0625('0x68'),_0x232a43);return respondWithRpcPromise(_0x0625('0x5b'),'update',{'module':'res_stun_monitor.so'});}else{var _0x21f03b=fs['readFileSync'](path['join'](config[_0x0625('0x5d')],_0x0625('0x69')),_0x0625('0x5f'));var _0x2d8c70=ejs[_0x0625('0x59')](_0x21f03b,{'networks':_0x56fbea||[]});fs[_0x0625('0x60')](util['format'](_0x0625('0x63'),_0x458e63['body'][_0x0625('0x37')][_0x0625('0x64')]()),_0x2d8c70);return respondWithRpcPromise(_0x0625('0x5b'),_0x0625('0x2e'),{'module':_0x0625('0x65')});}return null;})[_0x0625('0x1a')](function(_0x1f998a){if(_0x1f998a){return _0x875538;}return null;});})['then'](respondWithResult(_0x391c25,null))[_0x0625('0x24')](handleError(_0x391c25,null));};exports[_0x0625('0x2f')]=function(_0x3b57b7,_0x3d3f98,_0x5a4ab6){var _0x105480;return db['Network']['find']({'where':{'id':_0x3b57b7['params']['id']}})[_0x0625('0x1a')](function(_0xdf7591){_0x105480=_0xdf7591;return _0xdf7591;})[_0x0625('0x1a')](handleEntityNotFound(_0x3d3f98,null))[_0x0625('0x1a')](removeEntity(_0x3d3f98,null))[_0x0625('0x1a')](function(){if(_0x105480){return db[_0x0625('0x4a')]['findAll']({'where':{'type':_0x105480[_0x0625('0x37')]},'raw':!![]});}})['then'](function(_0x309aed){if(_0x105480[_0x0625('0x37')][_0x0625('0x67')]()==_0x0625('0x55')){var _0x1a548e=fs[_0x0625('0x56')](path[_0x0625('0x57')](config['root'],_0x0625('0x58')),_0x0625('0x5f'));var _0x13cb3c=ejs[_0x0625('0x59')](_0x1a548e,{'networks':_0x309aed||[]});fs[_0x0625('0x60')](_0x0625('0x5a'),_0x13cb3c);return respondWithRpcPromise(_0x0625('0x5b'),_0x0625('0x2f'),{'module':_0x0625('0x61')});}else if(_0x105480[_0x0625('0x37')][_0x0625('0x67')]()=='TURN'){var _0x10a481=fs[_0x0625('0x56')](path['join'](config[_0x0625('0x5d')],_0x0625('0x5e')),_0x0625('0x5f'));var _0x4dfb2d=ejs[_0x0625('0x59')](_0x10a481,{'networks':_0x309aed||[]});fs[_0x0625('0x60')](_0x0625('0x68'),_0x4dfb2d);return respondWithRpcPromise('Reload',_0x0625('0x2f'),{'module':_0x0625('0x61')});}else{var _0x5c2c05=fs[_0x0625('0x56')](path[_0x0625('0x57')](config[_0x0625('0x5d')],_0x0625('0x69')),_0x0625('0x5f'));var _0x392c74=ejs[_0x0625('0x59')](_0x5c2c05,{'networks':_0x309aed||[]});fs[_0x0625('0x60')](util[_0x0625('0x62')](_0x0625('0x63'),_0x3b57b7[_0x0625('0x54')][_0x0625('0x37')]['toLowerCase']()),_0x392c74);return respondWithRpcPromise(_0x0625('0x5b'),_0x0625('0x2f'),{'module':_0x0625('0x65')});}return null;})[_0x0625('0x24')](handleError(_0x3d3f98,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index eee5800..f021ef3 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 _0xd757=['./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd757,0x1e5));var _0x7d75=function(_0x2a3273,_0x1a59fa){_0x2a3273=_0x2a3273-0x0;var _0x29ff9e=_0xd757[_0x2a3273];return _0x29ff9e;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Network','network','lodash'];(function(_0x15890d,_0x52dae3){var _0x288694=function(_0x540d94){while(--_0x540d94){_0x15890d['push'](_0x15890d['shift']());}};_0x288694(++_0x52dae3);}(_0xdace,0xc5));var _0xedac=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xdace[_0x2a55f8];return _0x245efd;};'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('./network.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 diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 0126fc7..b75aa6f 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x256c20,_0x38aaaa){_0x256c20=_0x256c20-0x0;var _0x198eca=_0x7a54[_0x256c20];return _0x198eca;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e8151,_0x151062){var _0x3382ec=function(_0x389fee){while(--_0x389fee){_0x1e8151['push'](_0x1e8151['shift']());}};_0x3382ec(++_0x151062);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index d003be2..b2edfa5 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 _0x9fce=['getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addAgents','put','update','delete','removeDispositions','multer','util','path','connect-timeout','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x9fce,0x13d));var _0xe9fc=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x9fce[_0x1d426f];return _0x17f71a;};'use strict';var multer=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var path=require(_0xe9fc('0x2'));var timeout=require(_0xe9fc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9fc('0x4'));var controller=require(_0xe9fc('0x5'));router['get']('/',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x7')]);router[_0xe9fc('0x8')]('/describe',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x9')]);router[_0xe9fc('0x8')](_0xe9fc('0xa'),auth['isAuthenticated'](),controller[_0xe9fc('0xb')]);router[_0xe9fc('0x8')](_0xe9fc('0xc'),auth['isAuthenticated'](),controller[_0xe9fc('0xd')]);router[_0xe9fc('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe9fc('0xe')]);router[_0xe9fc('0x8')](_0xe9fc('0xf'),auth['isAuthenticated'](),controller[_0xe9fc('0x10')]);router[_0xe9fc('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe9fc('0x11')]);router[_0xe9fc('0x8')]('/:id/users',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x12')]);router[_0xe9fc('0x13')]('/',auth[_0xe9fc('0x6')](),controller['create']);router[_0xe9fc('0x13')](_0xe9fc('0xc'),auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x14')]);router['post'](_0xe9fc('0x15'),auth['isAuthenticated'](),controller[_0xe9fc('0x16')]);router[_0xe9fc('0x13')](_0xe9fc('0x17'),controller[_0xe9fc('0x18')]);router[_0xe9fc('0x13')](_0xe9fc('0xf'),auth[_0xe9fc('0x6')](),controller['addApplications']);router[_0xe9fc('0x13')]('/:id/users',auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x19')]);router[_0xe9fc('0x13')]('/:id/send',auth[_0xe9fc('0x6')](),controller['send']);router[_0xe9fc('0x1a')](_0xe9fc('0xa'),auth[_0xe9fc('0x6')](),controller[_0xe9fc('0x1b')]);router[_0xe9fc('0x1c')](_0xe9fc('0xa'),auth[_0xe9fc('0x6')](),controller['destroy']);router[_0xe9fc('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe9fc('0x1d')]);router[_0xe9fc('0x1c')](_0xe9fc('0x15'),auth[_0xe9fc('0x6')](),controller['removeAnswers']);router[_0xe9fc('0x1c')]('/:id/users',auth[_0xe9fc('0x6')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3ff2=['../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x57ce58,_0x243c52){var _0x7db2ed=function(_0x1beeb0){while(--_0x1beeb0){_0x57ce58['push'](_0x57ce58['shift']());}};_0x7db2ed(++_0x243c52);}(_0x3ff2,0x146));var _0x23ff=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3ff2[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x23ff('0x0'));var util=require(_0x23ff('0x1'));var path=require('path');var timeout=require(_0x23ff('0x2'));var express=require(_0x23ff('0x3'));var router=express[_0x23ff('0x4')]();var fs_extra=require(_0x23ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x23ff('0x6'));var config=require(_0x23ff('0x7'));var controller=require(_0x23ff('0x8'));router[_0x23ff('0x9')]('/',auth[_0x23ff('0xa')](),controller[_0x23ff('0xb')]);router['get'](_0x23ff('0xc'),auth[_0x23ff('0xa')](),controller['describe']);router[_0x23ff('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x23ff('0x9')](_0x23ff('0xd'),auth[_0x23ff('0xa')](),controller[_0x23ff('0xe')]);router[_0x23ff('0x9')](_0x23ff('0xf'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x10')]);router[_0x23ff('0x9')](_0x23ff('0x11'),auth[_0x23ff('0xa')](),controller['getApplications']);router[_0x23ff('0x9')](_0x23ff('0x12'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x13')]);router['get'](_0x23ff('0x14'),auth[_0x23ff('0xa')](),controller['getAgents']);router[_0x23ff('0x15')]('/',auth[_0x23ff('0xa')](),controller[_0x23ff('0x16')]);router[_0x23ff('0x15')]('/:id/dispositions',auth[_0x23ff('0xa')](),controller[_0x23ff('0x17')]);router[_0x23ff('0x15')]('/:id/canned_answers',auth[_0x23ff('0xa')](),controller[_0x23ff('0x18')]);router['post'](_0x23ff('0x19'),controller[_0x23ff('0x1a')]);router['post'](_0x23ff('0x11'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x1b')]);router[_0x23ff('0x15')]('/:id/users',auth[_0x23ff('0xa')](),controller[_0x23ff('0x1c')]);router['post'](_0x23ff('0x1d'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x1e')]);router[_0x23ff('0x1f')](_0x23ff('0x20'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x21')]);router[_0x23ff('0x22')](_0x23ff('0x20'),auth[_0x23ff('0xa')](),controller['destroy']);router[_0x23ff('0x22')](_0x23ff('0xd'),auth[_0x23ff('0xa')](),controller[_0x23ff('0x23')]);router[_0x23ff('0x22')](_0x23ff('0xf'),auth[_0x23ff('0xa')](),controller['removeAnswers']);router[_0x23ff('0x22')](_0x23ff('0x14'),auth[_0x23ff('0xa')](),controller['removeAgents']);module[_0x23ff('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 7ccd401..5461054 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 _0x6cbc=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','BOOLEAN'];(function(_0xd57e93,_0x2a2d36){var _0x5a9b37=function(_0x3f441c){while(--_0x3f441c){_0xd57e93['push'](_0xd57e93['shift']());}};_0x5a9b37(++_0x2a2d36);}(_0x6cbc,0x130));var _0xc6cb=function(_0x5d6105,_0x1f5ca9){_0x5d6105=_0x5d6105-0x0;var _0x15f36e=_0x6cbc[_0x5d6105];return _0x15f36e;};'use strict';var Sequelize=require(_0xc6cb('0x0'));var rs=require(_0xc6cb('0x1'));module['exports']={'name':{'type':Sequelize[_0xc6cb('0x2')],'unique':_0xc6cb('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc6cb('0x2')],'defaultValue':function(){return rs[_0xc6cb('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc6cb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc6cb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc6cb('0x5')],'defaultValue':![],'comment':_0xc6cb('0x7'),'set':function(_0x256d98){if(!_0x256d98)this[_0xc6cb('0x8')](_0xc6cb('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x256d98);}}}; \ No newline at end of file +var _0x6468=['setDataValue','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x421fc5,_0x41cc5f){var _0x38bb32=function(_0x307d8d){while(--_0x307d8d){_0x421fc5['push'](_0x421fc5['shift']());}};_0x38bb32(++_0x41cc5f);}(_0x6468,0x17a));var _0x8646=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x6468[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x8646('0x0'));var rs=require(_0x8646('0x1'));module[_0x8646('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x8646('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8646('0x4')],'defaultValue':function(){return rs[_0x8646('0x5')]();}},'replyUri':{'type':Sequelize[_0x8646('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8646('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8646('0x6')],'defaultValue':function(){return _0x8646('0x7');}},'notificationSound':{'type':Sequelize[_0x8646('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8646('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8646('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8646('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8646('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x8646('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x8646('0x8')],'defaultValue':![],'comment':_0x8646('0xb'),'set':function(_0x2d8b51){if(!_0x2d8b51)this[_0x8646('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x2d8b51);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8fe8aa5..274a9dd 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 _0x9af3=['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/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','getApplications','getInteractions','User','Owner','fullname','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel'];(function(_0x1c4a3f,_0x2ab7e7){var _0x25a810=function(_0x2b79a4){while(--_0x2b79a4){_0x1c4a3f['push'](_0x1c4a3f['shift']());}};_0x25a810(++_0x2ab7e7);}(_0x9af3,0x173));var _0x39af=function(_0x5d6a3c,_0x3b83d0){_0x5d6a3c=_0x5d6a3c-0x0;var _0x39aae4=_0x9af3[_0x5d6a3c];return _0x39aae4;};'use strict';var emlformat=require(_0x39af('0x0'));var rimraf=require(_0x39af('0x1'));var zipdir=require(_0x39af('0x2'));var jsonpatch=require(_0x39af('0x3'));var rp=require(_0x39af('0x4'));var moment=require(_0x39af('0x5'));var BPromise=require(_0x39af('0x6'));var Mustache=require(_0x39af('0x7'));var util=require(_0x39af('0x8'));var path=require('path');var sox=require(_0x39af('0x9'));var csv=require('to-csv');var ejs=require(_0x39af('0xa'));var fs=require('fs');var fs_extra=require(_0x39af('0xb'));var _=require('lodash');var squel=require(_0x39af('0xc'));var crypto=require(_0x39af('0xd'));var jsforce=require(_0x39af('0xe'));var deskjs=require(_0x39af('0xf'));var toCsv=require(_0x39af('0x10'));var querystring=require(_0x39af('0x11'));var Papa=require(_0x39af('0x12'));var Redis=require(_0x39af('0x13'));var authService=require(_0x39af('0x14'));var qs=require(_0x39af('0x15'));var as=require(_0x39af('0x16'));var hardwareService=require(_0x39af('0x17'));var logger=require(_0x39af('0x18'))(_0x39af('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x39af('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x39af('0x1b')](config[_0x39af('0x1c')],{'host':_0x39af('0x1d'),'port':0x18eb});var socket=require(_0x39af('0x1e'))(new Redis(config[_0x39af('0x1c')]));require(_0x39af('0x1f'))[_0x39af('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x39af('0x21')][_0x39af('0x22')]({'port':0x232c});var client9002=jayson[_0x39af('0x21')][_0x39af('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xa251c9,_0x178bbe,_0x4e5661,_0x37e2a1){return new BPromise(function(_0x4609cc,_0x453a67){var _0x573001=_0x37e2a1||client;return _0x573001[_0x39af('0x23')](_0xa251c9,_0x4e5661)[_0x39af('0x24')](function(_0x2998d3){logger[_0x39af('0x25')](_0x39af('0x26'),_0x178bbe,'request\x20sent');logger['debug'](_0x39af('0x27'),_0x178bbe,_0x39af('0x28'),JSON[_0x39af('0x29')](_0x2998d3));if(_0x2998d3[_0x39af('0x2a')]){if(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2b')]===0x1f4){logger[_0x39af('0x2a')](_0x39af('0x26'),_0x178bbe,_0x2998d3[_0x39af('0x2a')]['message']);return _0x453a67(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);}logger[_0x39af('0x2a')](_0x39af('0x26'),_0x178bbe,_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);return _0x4609cc(_0x2998d3[_0x39af('0x2a')][_0x39af('0x2c')]);}else{logger[_0x39af('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x178bbe,_0x39af('0x28'));_0x4609cc(_0x2998d3[_0x39af('0x2d')][_0x39af('0x2c')]);}})[_0x39af('0x2e')](function(_0x3a5208){logger[_0x39af('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x178bbe,_0x3a5208);_0x453a67(_0x3a5208);});});}function respondWithStatusCode(_0x23b1b3,_0x28fb47){_0x28fb47=_0x28fb47||0xcc;return function(_0xf6617b){if(_0xf6617b){return _0x23b1b3[_0x39af('0x2f')](_0x28fb47);}return _0x23b1b3['status'](_0x28fb47)[_0x39af('0x30')]();};}function respondWithResult(_0xd2170c,_0x136c0b){_0x136c0b=_0x136c0b||0xc8;return function(_0x1dd6b4){if(_0x1dd6b4){return _0xd2170c['status'](_0x136c0b)[_0x39af('0x31')](_0x1dd6b4);}};}function respondWithFilteredResult(_0x5d74f2,_0x4e6dba){return function(_0x327f3b){if(_0x327f3b){var _0x3c3fe2=typeof _0x4e6dba[_0x39af('0x32')]===_0x39af('0x33')&&typeof _0x4e6dba[_0x39af('0x34')]==='undefined';var _0x540bfe=_0x327f3b[_0x39af('0x35')];var _0x410ce1=_0x3c3fe2?0x0:_0x4e6dba[_0x39af('0x32')];var _0x5d47fe=_0x3c3fe2?_0x327f3b[_0x39af('0x35')]:_0x4e6dba[_0x39af('0x32')]+_0x4e6dba['limit'];var _0x1a624d;if(_0x5d47fe>=_0x540bfe){_0x5d47fe=_0x540bfe;_0x1a624d=0xc8;}else{_0x1a624d=0xce;}_0x5d74f2[_0x39af('0x36')](_0x1a624d);return _0x5d74f2[_0x39af('0x37')](_0x39af('0x38'),_0x410ce1+'-'+_0x5d47fe+'/'+_0x540bfe)[_0x39af('0x31')](_0x327f3b);}return null;};}function patchUpdates(_0x248667){return function(_0x1aeb43){try{jsonpatch[_0x39af('0x39')](_0x1aeb43,_0x248667,!![]);}catch(_0x6835d6){return BPromise[_0x39af('0x3a')](_0x6835d6);}return _0x1aeb43[_0x39af('0x3b')]();};}function saveUpdates(_0x3d14c2,_0x558952){return function(_0x5bdd9a){if(_0x5bdd9a){return _0x5bdd9a['update'](_0x3d14c2)['then'](function(_0xca48da){return _0xca48da;});}return null;};}function removeEntity(_0x5ac3bc,_0xed7d15){return function(_0x5c7d01){if(_0x5c7d01){return _0x5c7d01['destroy']()['then'](function(){var _0x38c93a=_0x5c7d01[_0x39af('0x3c')]({'plain':!![]});var _0x246b81=_0x39af('0x3d');return db[_0x39af('0x3e')]['destroy']({'where':{'type':_0x246b81,'resourceId':_0x38c93a['id']}})['then'](function(){return _0x5c7d01;});})['then'](function(){_0x5ac3bc[_0x39af('0x36')](0xcc)[_0x39af('0x30')]();});}};}function handleEntityNotFound(_0x3247ff,_0x1d0392){return function(_0x1a3137){if(!_0x1a3137){_0x3247ff[_0x39af('0x2f')](0x194);}return _0x1a3137;};}function handleError(_0x348d41,_0x17e777){_0x17e777=_0x17e777||0x1f4;return function(_0x2eef08){logger[_0x39af('0x2a')](_0x2eef08[_0x39af('0x3f')]);if(_0x2eef08[_0x39af('0x40')]){delete _0x2eef08['name'];}_0x348d41[_0x39af('0x36')](_0x17e777)[_0x39af('0x41')](_0x2eef08);};}exports[_0x39af('0x42')]=function(_0x1995e1,_0x3194e5){var _0x42a8dc={'include':[{'model':db[_0x39af('0x43')],'as':_0x39af('0x44')}]},_0x4d5d96={},_0x2c6396={'count':0x0,'rows':[]};var _0x15afa5=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x468280){return{'name':_0x468280[_0x39af('0x45')],'type':_0x468280['type'][_0x39af('0x46')]};});_0x4d5d96['model']=_[_0x39af('0x47')](_0x15afa5,_0x39af('0x40'));_0x4d5d96[_0x39af('0x48')]=_['keys'](_0x1995e1['query']);_0x4d5d96[_0x39af('0x49')]=_['intersection'](_0x4d5d96[_0x39af('0x4a')],_0x4d5d96['query']);_0x42a8dc[_0x39af('0x4b')]=_[_0x39af('0x4c')](_0x4d5d96[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x1995e1[_0x39af('0x48')][_0x39af('0x4d')]));_0x42a8dc['attributes']=_0x42a8dc[_0x39af('0x4b')][_0x39af('0x4e')]?_0x42a8dc[_0x39af('0x4b')]:_0x4d5d96[_0x39af('0x4a')];if(!_0x1995e1[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x42a8dc[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x1995e1[_0x39af('0x48')][_0x39af('0x34')]);_0x42a8dc[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x1995e1['query'][_0x39af('0x32')]);}_0x42a8dc[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x1995e1[_0x39af('0x48')][_0x39af('0x52')]);_0x42a8dc[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x1995e1[_0x39af('0x48')],_0x4d5d96['filters']),_0x15afa5);if(_0x1995e1[_0x39af('0x48')][_0x39af('0x55')]){_0x42a8dc[_0x39af('0x53')]=_[_0x39af('0x56')](_0x42a8dc[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x15afa5,function(_0x4f4336){if(_0x4f4336[_0x39af('0x57')]!==_0x39af('0x58')){var _0x5f2c48={};_0x5f2c48[_0x4f4336['name']]={'$like':'%'+_0x1995e1[_0x39af('0x48')][_0x39af('0x55')]+'%'};return _0x5f2c48;}})});}_0x42a8dc=_['merge']({},_0x42a8dc,_0x1995e1[_0x39af('0x59')]);var _0x282e7e={'where':_0x42a8dc[_0x39af('0x53')]};return db[_0x39af('0x5a')][_0x39af('0x35')](_0x282e7e)[_0x39af('0x24')](function(_0x2c628c){_0x2c6396[_0x39af('0x35')]=_0x2c628c;if(_0x1995e1[_0x39af('0x48')][_0x39af('0x5b')]){_0x42a8dc[_0x39af('0x5c')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x39af('0x5d')](_0x42a8dc);})[_0x39af('0x24')](function(_0x37a0ff){_0x2c6396[_0x39af('0x5e')]=_0x37a0ff;return _0x2c6396;})['then'](respondWithFilteredResult(_0x3194e5,_0x42a8dc))['catch'](handleError(_0x3194e5,null));};exports[_0x39af('0x5f')]=function(_0x328bf5,_0x231197){var _0x41be28={'raw':![],'where':{'id':_0x328bf5[_0x39af('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x39af('0x44')}]},_0x328c40={};_0x328c40['model']=_[_0x39af('0x61')](db[_0x39af('0x5a')][_0x39af('0x62')]);_0x328c40[_0x39af('0x48')]=_['keys'](_0x328bf5[_0x39af('0x48')]);_0x328c40['filters']=_[_0x39af('0x4c')](_0x328c40[_0x39af('0x4a')],_0x328c40[_0x39af('0x48')]);_0x41be28[_0x39af('0x4b')]=_[_0x39af('0x4c')](_0x328c40[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x328bf5['query'][_0x39af('0x4d')]));_0x41be28['attributes']=_0x41be28[_0x39af('0x4b')]['length']?_0x41be28['attributes']:_0x328c40[_0x39af('0x4a')];if(_0x328bf5['query'][_0x39af('0x5b')]){_0x41be28[_0x39af('0x5c')]=[{'all':!![]}];}_0x41be28=_[_0x39af('0x56')]({},_0x41be28,_0x328bf5[_0x39af('0x59')]);return db[_0x39af('0x5a')][_0x39af('0x63')](_0x41be28)['then'](handleEntityNotFound(_0x231197,null))[_0x39af('0x24')](respondWithResult(_0x231197,null))[_0x39af('0x2e')](handleError(_0x231197,null));};exports['create']=function(_0x32f675,_0xcdc58){return db[_0x39af('0x5a')][_0x39af('0x64')](_0x32f675[_0x39af('0x65')],{})[_0x39af('0x24')](function(_0x455107){var _0x315b5d=_0x32f675[_0x39af('0x66')]['get']({'plain':!![]});if(!_0x315b5d)throw new Error(_0x39af('0x67'));if(_0x315b5d[_0x39af('0x68')]===_0x39af('0x66')){var _0x5e06cf=_0x455107['get']({'plain':!![]});var _0x1f5f59=_0x39af('0x3d');return db[_0x39af('0x69')][_0x39af('0x63')]({'where':{'name':_0x1f5f59,'userProfileId':_0x315b5d[_0x39af('0x6a')]},'raw':!![]})[_0x39af('0x24')](function(_0x13becf){if(_0x13becf&&_0x13becf['autoAssociation']===0x0){return db[_0x39af('0x3e')][_0x39af('0x64')]({'name':_0x5e06cf[_0x39af('0x40')],'resourceId':_0x5e06cf['id'],'type':_0x13becf[_0x39af('0x40')],'sectionId':_0x13becf['id']},{})[_0x39af('0x24')](function(){return _0x455107;});}else{return _0x455107;}})[_0x39af('0x2e')](function(_0x3c9e9d){logger[_0x39af('0x2a')](_0x39af('0x6b'),_0x3c9e9d);throw _0x3c9e9d;});}return _0x455107;})['then'](respondWithResult(_0xcdc58,0xc9))[_0x39af('0x2e')](handleError(_0xcdc58,null));};exports['update']=function(_0x217c26,_0x270972){if(_0x217c26[_0x39af('0x65')]['id']){delete _0x217c26[_0x39af('0x65')]['id'];}return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x217c26['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x39af('0x24')](handleEntityNotFound(_0x270972,null))['then'](saveUpdates(_0x217c26['body'],null))[_0x39af('0x24')](respondWithResult(_0x270972,null))[_0x39af('0x2e')](handleError(_0x270972,null));};exports[_0x39af('0x6c')]=function(_0x4b9ff1,_0xbd953e){return db['OpenchannelAccount']['find']({'where':{'id':_0x4b9ff1['params']['id']}})[_0x39af('0x24')](handleEntityNotFound(_0xbd953e,null))[_0x39af('0x24')](removeEntity(_0xbd953e,null))[_0x39af('0x2e')](handleError(_0xbd953e,null));};exports[_0x39af('0x6d')]=function(_0x5694ee,_0x112ae6){return db[_0x39af('0x5a')][_0x39af('0x6d')]()['then'](respondWithResult(_0x112ae6,null))[_0x39af('0x2e')](handleError(_0x112ae6,null));};exports[_0x39af('0x6e')]=function(_0xf75020,_0x5f4453,_0xb697f0){if(_0xf75020[_0x39af('0x65')]['id']){delete _0xf75020[_0x39af('0x65')]['id'];}return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0xf75020['params']['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5f4453,null))[_0x39af('0x24')](function(_0x110cc4){if(_0x110cc4){_0xf75020['body'][_0x39af('0x6f')]=_0x110cc4['id'];return db[_0x39af('0x70')][_0x39af('0x64')](_0xf75020[_0x39af('0x65')]);}})[_0x39af('0x24')](respondWithResult(_0x5f4453,null))['catch'](handleError(_0x5f4453,null));};exports['getDispositions']=function(_0x257dfb,_0x68ff24,_0x3b7960){var _0x45c4a0={'raw':![],'where':{}};var _0x5c0adc={};var _0x2d424={'count':0x0,'rows':[]};return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x257dfb['params']['id']}})['then'](handleEntityNotFound(_0x68ff24,null))[_0x39af('0x24')](function(_0x5e9093){if(_0x5e9093){_0x5c0adc[_0x39af('0x4a')]=_['keys'](db['Disposition'][_0x39af('0x62')]);_0x5c0adc[_0x39af('0x48')]=_['keys'](_0x257dfb[_0x39af('0x48')]);_0x5c0adc['filters']=_[_0x39af('0x4c')](_0x5c0adc[_0x39af('0x4a')],_0x5c0adc[_0x39af('0x48')]);_0x45c4a0[_0x39af('0x4b')]=_['intersection'](_0x5c0adc['model'],qs['fields'](_0x257dfb[_0x39af('0x48')][_0x39af('0x4d')]));_0x45c4a0[_0x39af('0x4b')]=_0x45c4a0[_0x39af('0x4b')]['length']?_0x45c4a0['attributes']:_0x5c0adc[_0x39af('0x4a')];if(!_0x257dfb[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x45c4a0['limit']=qs[_0x39af('0x34')](_0x257dfb[_0x39af('0x48')][_0x39af('0x34')]);_0x45c4a0[_0x39af('0x32')]=qs['offset'](_0x257dfb[_0x39af('0x48')][_0x39af('0x32')]);}_0x45c4a0[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x257dfb['query']['sort']);_0x45c4a0[_0x39af('0x53')]=qs[_0x39af('0x49')](_['pick'](_0x257dfb[_0x39af('0x48')],_0x5c0adc[_0x39af('0x49')]));_0x45c4a0[_0x39af('0x53')][_0x39af('0x6f')]=_0x5e9093['id'];if(_0x257dfb[_0x39af('0x48')][_0x39af('0x55')]){_0x45c4a0[_0x39af('0x53')]=_[_0x39af('0x56')](_0x45c4a0[_0x39af('0x53')],{'$or':_['map'](_0x45c4a0[_0x39af('0x4b')],function(_0x2b43ec){var _0x19d729={};_0x19d729[_0x2b43ec]={'$like':'%'+_0x257dfb['query'][_0x39af('0x55')]+'%'};return _0x19d729;})});}_0x45c4a0=_[_0x39af('0x56')]({},_0x45c4a0,_0x257dfb[_0x39af('0x59')]);return db[_0x39af('0x70')]['count']({'where':_0x45c4a0['where']})[_0x39af('0x24')](function(_0x2fb8e5){_0x2d424[_0x39af('0x35')]=_0x2fb8e5;if(_0x257dfb[_0x39af('0x48')][_0x39af('0x5b')]){_0x45c4a0[_0x39af('0x5c')]=[{'all':!![]}];}return db[_0x39af('0x70')][_0x39af('0x5d')](_0x45c4a0);})['then'](function(_0x50c7f1){_0x2d424[_0x39af('0x5e')]=_0x50c7f1;return _0x2d424;});}})['then'](respondWithFilteredResult(_0x68ff24,_0x45c4a0))[_0x39af('0x2e')](handleError(_0x68ff24,null));};exports[_0x39af('0x72')]=function(_0x2c5c19,_0x18ce00,_0x3a4751){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x2c5c19['params']['id']}})['then'](handleEntityNotFound(_0x18ce00,null))['then'](function(_0x8ca773){if(_0x8ca773){return _0x8ca773[_0x39af('0x72')](_0x2c5c19[_0x39af('0x48')][_0x39af('0x73')]);}})['then'](respondWithStatusCode(_0x18ce00,null))[_0x39af('0x2e')](handleError(_0x18ce00,null));};exports[_0x39af('0x74')]=function(_0xeda21e,_0x9a726b,_0x207e37){if(_0xeda21e[_0x39af('0x65')]['id']){delete _0xeda21e['body']['id'];}return db[_0x39af('0x5a')]['find']({'where':{'id':_0xeda21e[_0x39af('0x60')]['id']}})['then'](handleEntityNotFound(_0x9a726b,null))[_0x39af('0x24')](function(_0x1e4d67){if(_0x1e4d67){_0xeda21e[_0x39af('0x65')][_0x39af('0x6f')]=_0x1e4d67['id'];return db['CannedAnswer'][_0x39af('0x64')](_0xeda21e['body']);}})[_0x39af('0x24')](respondWithResult(_0x9a726b,null))[_0x39af('0x2e')](handleError(_0x9a726b,null));};exports[_0x39af('0x75')]=function(_0x1dc382,_0x1639f4,_0x1c3849){var _0x5a92b8={'raw':![],'where':{}};var _0xc5f00={};var _0x3f4071={'count':0x0,'rows':[]};return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x1dc382[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x1639f4,null))[_0x39af('0x24')](function(_0x37f594){if(_0x37f594){_0xc5f00[_0x39af('0x4a')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0xc5f00[_0x39af('0x48')]=_[_0x39af('0x61')](_0x1dc382[_0x39af('0x48')]);_0xc5f00['filters']=_[_0x39af('0x4c')](_0xc5f00['model'],_0xc5f00[_0x39af('0x48')]);_0x5a92b8['attributes']=_[_0x39af('0x4c')](_0xc5f00[_0x39af('0x4a')],qs['fields'](_0x1dc382[_0x39af('0x48')][_0x39af('0x4d')]));_0x5a92b8['attributes']=_0x5a92b8[_0x39af('0x4b')]['length']?_0x5a92b8[_0x39af('0x4b')]:_0xc5f00[_0x39af('0x4a')];if(!_0x1dc382[_0x39af('0x48')][_0x39af('0x4f')](_0x39af('0x50'))){_0x5a92b8[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x1dc382[_0x39af('0x48')][_0x39af('0x34')]);_0x5a92b8[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x1dc382['query'][_0x39af('0x32')]);}_0x5a92b8[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x1dc382['query'][_0x39af('0x52')]);_0x5a92b8[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x1dc382[_0x39af('0x48')],_0xc5f00[_0x39af('0x49')]));_0x5a92b8[_0x39af('0x53')][_0x39af('0x6f')]=_0x37f594['id'];if(_0x1dc382[_0x39af('0x48')][_0x39af('0x55')]){_0x5a92b8[_0x39af('0x53')]=_['merge'](_0x5a92b8[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x5a92b8[_0x39af('0x4b')],function(_0x243e51){var _0x5e2e03={};_0x5e2e03[_0x243e51]={'$like':'%'+_0x1dc382['query'][_0x39af('0x55')]+'%'};return _0x5e2e03;})});}_0x5a92b8=_[_0x39af('0x56')]({},_0x5a92b8,_0x1dc382[_0x39af('0x59')]);return db[_0x39af('0x76')][_0x39af('0x35')]({'where':_0x5a92b8['where']})[_0x39af('0x24')](function(_0x4115fc){_0x3f4071['count']=_0x4115fc;if(_0x1dc382[_0x39af('0x48')][_0x39af('0x5b')]){_0x5a92b8[_0x39af('0x5c')]=[{'all':!![]}];}return db[_0x39af('0x76')][_0x39af('0x5d')](_0x5a92b8);})['then'](function(_0x2f4f5c){_0x3f4071[_0x39af('0x5e')]=_0x2f4f5c;return _0x3f4071;});}})['then'](respondWithFilteredResult(_0x1639f4,_0x5a92b8))[_0x39af('0x2e')](handleError(_0x1639f4,null));};exports[_0x39af('0x77')]=function(_0x3b9200,_0x105a03,_0x19545e){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x3b9200[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x105a03,null))['then'](function(_0x181762){if(_0x181762){return _0x181762[_0x39af('0x77')](_0x3b9200[_0x39af('0x48')][_0x39af('0x73')]);}})[_0x39af('0x24')](respondWithStatusCode(_0x105a03,null))[_0x39af('0x2e')](handleError(_0x105a03,null));};exports[_0x39af('0x78')]=function(_0x289336,_0x1bf188,_0x26ecff){var _0x53e3c8={'body':_0x289336['body'],'channel':_0x39af('0x79')};var _0x23ebd8=[];var _0xb2ada0=[];var _0x481d98={};var _0x2e64e4=![];return db[_0x39af('0x7a')]['describe']()['then'](function(_0x2aa20b){if(!_0x2aa20b){throw new db[(_0x39af('0x7b'))]['ValidationError'](_0x39af('0x7c'));}_0x23ebd8=_[_0x39af('0x7d')](_[_0x39af('0x61')](_0x2aa20b),[_0x39af('0x7e'),_0x39af('0x7f')]);_0xb2ada0=_[_0x39af('0x7d')](_[_0x39af('0x61')](_0x2aa20b),[_0x39af('0x7e'),_0x39af('0x7f'),_0x39af('0x80'),_0x39af('0x81')]);if(_0x289336['body']['id']){delete _0x289336[_0x39af('0x65')]['id'];}if(_[_0x39af('0x82')](_0x289336['body']['from'])){throw new db['Sequelize']['ValidationError'](_0x39af('0x83'));}if(_[_0x39af('0x82')](_0x289336[_0x39af('0x65')][_0x39af('0x65')])||_0x289336[_0x39af('0x65')][_0x39af('0x65')]===''){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))](_0x39af('0x85'));}if(_[_0x39af('0x82')](_0x289336[_0x39af('0x65')][_0x39af('0x86')])){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xb2ada0);}if(!_[_0x39af('0x87')](_0xb2ada0,_0x289336[_0x39af('0x65')]['mapKey'])){throw new db[(_0x39af('0x7b'))][(_0x39af('0x84'))](_0x39af('0x88')+_0xb2ada0);}_0x481d98[_0x289336['body'][_0x39af('0x86')]]=_0x289336[_0x39af('0x65')][_0x39af('0x89')];})[_0x39af('0x24')](function(){return db['OpenchannelAccount'][_0x39af('0x63')]({'where':{'id':_0x289336[_0x39af('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x39af('0x8a'),'include':[{'model':db[_0x39af('0x7a')],'as':_0x39af('0x8b'),'where':_0x481d98,'limit':0x1,'order':[[_0x39af('0x7f'),_0x39af('0x8c')]]}]},{'model':db[_0x39af('0x8d')],'as':_0x39af('0x8e')}]});})[_0x39af('0x24')](handleEntityNotFound(_0x1bf188,null))[_0x39af('0x24')](function(_0xc7d4cf){if(_0xc7d4cf&&_0xc7d4cf[_0x39af('0x8a')]){_0x53e3c8[_0x39af('0x8f')]=_0xc7d4cf;_0x53e3c8[_0x39af('0x90')]=_0xc7d4cf[_0x39af('0x8e')];_0x53e3c8['list']=_0xc7d4cf[_0x39af('0x8a')];_0x53e3c8['applications']=_[_0x39af('0x91')](_0x53e3c8[_0x39af('0x90')],[_0x39af('0x92')],[_0x39af('0x93')]);if(_0x53e3c8['account'][_0x39af('0x8e')]){delete _0x53e3c8[_0x39af('0x8f')][_0x39af('0x8e')];}if(_0x53e3c8['account'][_0x39af('0x8a')]&&_0x53e3c8[_0x39af('0x8f')][_0x39af('0x8a')][_0x39af('0x8b')][_0x39af('0x4e')]){return _0x53e3c8['account'][_0x39af('0x8a')][_0x39af('0x8b')][0x0];}var _0xe2249b=_[_0x39af('0x1b')](_0x289336[_0x39af('0x65')],{'firstName':_0x289336[_0x39af('0x65')][_0x39af('0x89')],'ListId':_0xc7d4cf['ListId']});_0xe2249b[_0x289336[_0x39af('0x65')][_0x39af('0x86')]]=_0x289336[_0x39af('0x65')][_0x39af('0x89')];return db[_0x39af('0x7a')][_0x39af('0x64')](_0xe2249b,{'fields':_0x23ebd8,'raw':!![]});}})['then'](handleEntityNotFound(_0x1bf188,null))['then'](function(_0x51b6e7){_0x53e3c8[_0x39af('0x94')]=_0x51b6e7;if(_0x51b6e7){var _0x5c061a={'ContactId':_0x51b6e7['id'],'OpenchannelAccountId':_0x289336[_0x39af('0x60')]['id'],'from':(_0x51b6e7['firstName']||'')+'\x20'+(_0x51b6e7[_0x39af('0x95')]||'')};var _0x2665c7={'OpenchannelAccountId':_0x289336[_0x39af('0x60')]['id'],'closed':![]};if(_0x289336['body'][_0x39af('0x96')]){_0x2665c7[_0x39af('0x96')]=_0x289336[_0x39af('0x65')][_0x39af('0x96')];return db[_0x39af('0x97')][_0x39af('0x63')]({'where':_0x2665c7})['then'](function(_0x592a31){if(_0x592a31){return[_0x592a31,![]];}_0x5c061a[_0x39af('0x96')]=_0x289336[_0x39af('0x65')][_0x39af('0x96')];_0x5c061a[_0x39af('0x98')]=_0x289336['body'][_0x39af('0x98')];return db[_0x39af('0x97')]['create'](_0x5c061a)[_0x39af('0x24')](function(_0xa74de6){return[_0xa74de6,!![]];});});}else{_0x2665c7[_0x39af('0x96')]=null;}_0x2665c7[_0x39af('0x99')]=_0x51b6e7['id'];return db[_0x39af('0x97')][_0x39af('0x63')]({'where':_0x2665c7})[_0x39af('0x24')](function(_0x41f199){if(_0x41f199){return[_0x41f199,![]];}return db[_0x39af('0x97')][_0x39af('0x64')](_0x5c061a)[_0x39af('0x24')](function(_0x272663){return[_0x272663,!![]];});});}})[_0x39af('0x9a')](function(_0x999d8e,_0x1f2044){if(_0x999d8e){_0x2e64e4=_0x1f2044;if(!_0x1f2044){var _0x57ca23={'from':(_0x53e3c8[_0x39af('0x94')]['firstName']||'')+'\x20'+(_0x53e3c8[_0x39af('0x94')][_0x39af('0x95')]||'')};if(_0x289336['body']['threadId']&&_0x289336[_0x39af('0x65')]['messageId']&&_0x289336[_0x39af('0x65')][_0x39af('0x96')]!=_0x289336[_0x39af('0x65')][_0x39af('0x9b')]){_0x57ca23[_0x39af('0x96')]=_0x289336[_0x39af('0x65')]['messageId'];}return _0x999d8e['update'](_0x57ca23);}else{return _0x999d8e;}}})['then'](function(_0x543151){_0x53e3c8['interaction']=_0x543151[_0x39af('0x3c')]({'plain':!![]});_0x53e3c8[_0x39af('0x9c')][_0x39af('0x9d')]=_0x2e64e4;if(_0x53e3c8[_0x39af('0x9c')]['created']){if(_0x53e3c8[_0x39af('0x8f')][_0x39af('0x9e')]){_0x53e3c8[_0x39af('0x90')]['push']({'id':0x0,'priority':_0x53e3c8[_0x39af('0x90')][_0x39af('0x4e')]+0x1,'app':_0x39af('0x9f'),'appdata':_0x39af('0xa0'),'interval':_0x39af('0xa1')});}}return db[_0x39af('0xa2')][_0x39af('0x64')]({'body':_0x289336[_0x39af('0x65')][_0x39af('0x65')],'OpenchannelAccountId':_0x289336['params']['id'],'OpenchannelInteractionId':_0x543151['id'],'direction':'in','ContactId':_0x53e3c8['contact']['id'],'AttachmentId':_0x289336[_0x39af('0x65')][_0x39af('0xa3')]});})[_0x39af('0x24')](function(_0x9a71b0){_0x53e3c8[_0x39af('0x2c')]=_0x9a71b0;if(_0x53e3c8[_0x39af('0x9c')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x53e3c8['interaction'][_0x39af('0xa4')]}})['then'](function(_0x1de46e){if(_0x1de46e){_0x53e3c8[_0x39af('0x90')][_0x39af('0xa5')]({'id':0x0,'priority':0x0,'app':_0x39af('0xa6'),'appdata':_0x1de46e[_0x39af('0x40')]+','+(_0x53e3c8[_0x39af('0x8f')]['waitForTheAssignedAgent']||0xa),'interval':_0x39af('0xa1')});_0x53e3c8['forcedOwnership']=![];}return respondWithRpcPromise(_0x39af('0xa7'),'startRouting',_0x53e3c8);});}return respondWithRpcPromise(_0x39af('0xa7'),_0x39af('0xa8'),_0x53e3c8);})[_0x39af('0x24')](function(_0x5967a3){respondWithRpcPromise(_0x39af('0xa9'),_0x39af('0xa9'),{'event':_0x39af('0x78'),'message':_0x5967a3},client9002);return _0x5967a3;})[_0x39af('0x24')](respondWithResult(_0x1bf188,null))[_0x39af('0x2e')](handleError(_0x1bf188,null));};exports[_0x39af('0xaa')]=function(_0x2f9949,_0x58c8dc,_0x1fd3e0){return db[_0x39af('0x5a')]['findOne']({'where':{'id':_0x2f9949['params']['id']}})['then'](handleEntityNotFound(_0x58c8dc,null))[_0x39af('0x24')](function(_0x42b97f){if(_0x42b97f){return db['sequelize'][_0x39af('0xab')](function(_0x4afe5b){return db[_0x39af('0x8d')]['destroy']({'where':{'OpenchannelAccountId':_0x2f9949[_0x39af('0x60')]['id']},'transaction':_0x4afe5b})['then'](function(_0xf3b839){var _0x5838d3=_['map'](_0x2f9949[_0x39af('0x65')],function(_0x2aa614){_0x2aa614[_0x39af('0x6f')]=_0x2f9949[_0x39af('0x60')]['id'];return _0x2aa614;});return db[_0x39af('0x8d')][_0x39af('0xac')](_0x5838d3,{'transaction':_0x4afe5b});});})[_0x39af('0x24')](function(){return db[_0x39af('0x8d')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2f9949[_0x39af('0x60')]['id']},'order':_0x39af('0x92')});});}})[_0x39af('0x24')](respondWithResult(_0x58c8dc,null))[_0x39af('0x2e')](handleError(_0x58c8dc,null));};exports[_0x39af('0xad')]=function(_0x406505,_0x5bdc23,_0x1f2065){var _0x54c3eb={};var _0x2fb8f1={};var _0x368233;var _0x3dd163;return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x406505[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5bdc23,null))['then'](function(_0x502b50){if(_0x502b50){_0x368233=_0x502b50;_0x2fb8f1[_0x39af('0x4a')]=_['keys'](db[_0x39af('0x8d')][_0x39af('0x62')]);_0x2fb8f1[_0x39af('0x48')]=_[_0x39af('0x61')](_0x406505[_0x39af('0x48')]);_0x2fb8f1[_0x39af('0x49')]=_['intersection'](_0x2fb8f1['model'],_0x2fb8f1[_0x39af('0x48')]);_0x54c3eb['attributes']=_[_0x39af('0x4c')](_0x2fb8f1['model'],qs[_0x39af('0x4d')](_0x406505['query']['fields']));_0x54c3eb[_0x39af('0x4b')]=_0x54c3eb[_0x39af('0x4b')]['length']?_0x54c3eb[_0x39af('0x4b')]:_0x2fb8f1['model'];_0x54c3eb[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x406505[_0x39af('0x48')]['sort']);_0x54c3eb['where']=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x406505[_0x39af('0x48')],_0x2fb8f1[_0x39af('0x49')]));if(_0x406505['query'][_0x39af('0x55')]){_0x54c3eb[_0x39af('0x53')]=_['merge'](_0x54c3eb[_0x39af('0x53')],{'$or':_['map'](_0x54c3eb[_0x39af('0x4b')],function(_0x1e8623){var _0x1956c6={};_0x1956c6[_0x1e8623]={'$like':'%'+_0x406505[_0x39af('0x48')]['filter']+'%'};return _0x1956c6;})});}_0x54c3eb=_[_0x39af('0x56')]({},_0x54c3eb,_0x406505[_0x39af('0x59')]);return _0x368233[_0x39af('0xad')](_0x54c3eb);}})['then'](function(_0x52ee49){if(_0x52ee49){_0x3dd163=_0x52ee49[_0x39af('0x4e')];if(!_0x406505['query'][_0x39af('0x4f')](_0x39af('0x50'))){_0x54c3eb[_0x39af('0x34')]=qs[_0x39af('0x34')](_0x406505[_0x39af('0x48')][_0x39af('0x34')]);_0x54c3eb['offset']=qs['offset'](_0x406505[_0x39af('0x48')][_0x39af('0x32')]);}return _0x368233[_0x39af('0xad')](_0x54c3eb);}})[_0x39af('0x24')](function(_0x219db6){if(_0x219db6){return _0x219db6?{'count':_0x3dd163,'rows':_0x219db6}:null;}})[_0x39af('0x24')](respondWithResult(_0x5bdc23,null))[_0x39af('0x2e')](handleError(_0x5bdc23,null));};exports[_0x39af('0xae')]=function(_0x4ab1ee,_0x437aa7,_0x443f0b){var _0x1fa4f6={'raw':![],'where':{}};var _0x1119c8={};var _0xb18f68={'count':0x0,'rows':[]};return db[_0x39af('0x5a')]['findOne']({'where':{'id':_0x4ab1ee[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x437aa7,null))[_0x39af('0x24')](function(_0x23895e){if(_0x23895e){_0x1119c8[_0x39af('0x4a')]=_[_0x39af('0x61')](db[_0x39af('0x97')][_0x39af('0x62')]);_0x1119c8['query']=_['keys'](_0x4ab1ee[_0x39af('0x48')]);_0x1119c8['filters']=_[_0x39af('0x4c')](_0x1119c8['model'],_0x1119c8[_0x39af('0x48')]);_0x1fa4f6['attributes']=_['intersection'](_0x1119c8[_0x39af('0x4a')],qs['fields'](_0x4ab1ee[_0x39af('0x48')]['fields']));_0x1fa4f6[_0x39af('0x4b')]=_0x1fa4f6[_0x39af('0x4b')][_0x39af('0x4e')]?_0x1fa4f6[_0x39af('0x4b')]:_0x1119c8[_0x39af('0x4a')];if(!_0x4ab1ee[_0x39af('0x48')][_0x39af('0x4f')]('nolimit')){_0x1fa4f6['limit']=qs[_0x39af('0x34')](_0x4ab1ee['query'][_0x39af('0x34')]);_0x1fa4f6[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x4ab1ee[_0x39af('0x48')]['offset']);}_0x1fa4f6[_0x39af('0x51')]=qs[_0x39af('0x52')](_0x4ab1ee['query'][_0x39af('0x52')]);_0x1fa4f6[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x4ab1ee[_0x39af('0x48')],_0x1119c8[_0x39af('0x49')]));_0x1fa4f6[_0x39af('0x53')][_0x39af('0x6f')]=_0x23895e['id'];if(_0x4ab1ee[_0x39af('0x48')][_0x39af('0x55')]){_0x1fa4f6['where']=_['merge'](_0x1fa4f6[_0x39af('0x53')],{'$or':_[_0x39af('0x47')](_0x1fa4f6['attributes'],function(_0x1ec3a8){var _0x5c24ac={};_0x5c24ac[_0x1ec3a8]={'$like':'%'+_0x4ab1ee['query'][_0x39af('0x55')]+'%'};return _0x5c24ac;})});}_0x1fa4f6=_[_0x39af('0x56')]({},_0x1fa4f6,_0x4ab1ee[_0x39af('0x59')]);return db[_0x39af('0x97')][_0x39af('0x35')]({'where':_0x1fa4f6[_0x39af('0x53')]})['then'](function(_0x21fa05){_0xb18f68[_0x39af('0x35')]=_0x21fa05;if(_0x4ab1ee[_0x39af('0x48')][_0x39af('0x5b')]){_0x1fa4f6[_0x39af('0x5c')]=[{'model':db[_0x39af('0x7a')],'as':'Contact','required':![]},{'model':db[_0x39af('0xaf')],'as':_0x39af('0xb0'),'attributes':[_0x39af('0x40'),_0x39af('0xb1'),'internal'],'required':![]},{'model':db[_0x39af('0xb2')],'as':'Tags','attributes':['id',_0x39af('0x40'),_0x39af('0xb3')],'where':_0x4ab1ee[_0x39af('0x48')][_0x39af('0xb4')]?{'id':_0x4ab1ee[_0x39af('0x48')]['tag']}:undefined,'required':_0x4ab1ee['query'][_0x39af('0xb4')]?!![]:![]}];}return db[_0x39af('0x97')][_0x39af('0x5d')](_0x1fa4f6);})['then'](function(_0x3975b4){_0xb18f68[_0x39af('0x5e')]=_0x3975b4;return _0xb18f68;});}})[_0x39af('0x24')](respondWithFilteredResult(_0x437aa7,_0x1fa4f6))[_0x39af('0x2e')](handleError(_0x437aa7,null));};exports[_0x39af('0xb5')]=function(_0x14224e,_0x29d66d,_0x5f2a0c){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x14224e['params']['id']}})['then'](handleEntityNotFound(_0x29d66d,null))[_0x39af('0x24')](function(_0x356ed9){if(_0x356ed9){return _0x356ed9[_0x39af('0xb5')](_0x14224e[_0x39af('0x65')][_0x39af('0x73')],_[_0x39af('0xb6')](_0x14224e[_0x39af('0x65')],[_0x39af('0x73'),'id'])||{})[_0x39af('0x9a')](function(_0x38c6a9){for(var _0x4157e7=0x0;_0x4157e7<_0x14224e[_0x39af('0x65')]['ids'][_0x39af('0x4e')];_0x4157e7+=0x1){socket[_0x39af('0xb7')](_0x39af('0xb8'),{'UserId':Number(_0x14224e['body'][_0x39af('0x73')][_0x4157e7]),'OpenchannelAccountId':Number(_0x14224e[_0x39af('0x60')]['id'])});}return _0x38c6a9;});}})[_0x39af('0x24')](respondWithResult(_0x29d66d,null))['catch'](handleError(_0x29d66d,null));};exports['removeAgents']=function(_0x5ec79c,_0x37f733,_0x380f5a){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x5ec79c[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x37f733,null))[_0x39af('0x24')](function(_0x425b17){if(_0x425b17){return _0x425b17[_0x39af('0xb9')](_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')])['then'](function(){if(_['isArray'](_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')])){for(var _0xaba046=0x0;_0xaba046<_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')][_0x39af('0x4e')];_0xaba046+=0x1){socket[_0x39af('0xb7')](_0x39af('0xba'),{'UserId':Number(_0x5ec79c[_0x39af('0x48')][_0x39af('0x73')][_0xaba046]),'OpenchannelAccountId':Number(_0x5ec79c[_0x39af('0x60')]['id'])});}}else{socket[_0x39af('0xb7')](_0x39af('0xba'),{'UserId':Number(_0x5ec79c['query'][_0x39af('0x73')]),'OpenchannelAccountId':Number(_0x5ec79c['params']['id'])});}});}})[_0x39af('0x24')](respondWithStatusCode(_0x37f733,null))[_0x39af('0x2e')](handleError(_0x37f733,null));};exports[_0x39af('0xbb')]=function(_0x5d8293,_0x5dd2e2,_0x255f13){var _0x4db7ce={};var _0x392628={};var _0x9b6618;var _0x18e250;return db[_0x39af('0x5a')][_0x39af('0x71')]({'where':{'id':_0x5d8293[_0x39af('0x60')]['id']}})[_0x39af('0x24')](handleEntityNotFound(_0x5dd2e2,null))[_0x39af('0x24')](function(_0x489e8d){if(_0x489e8d){_0x9b6618=_0x489e8d;_0x392628[_0x39af('0x4a')]=_[_0x39af('0x61')](db[_0x39af('0xaf')][_0x39af('0x62')]);_0x392628[_0x39af('0x48')]=_[_0x39af('0x61')](_0x5d8293[_0x39af('0x48')]);_0x392628['filters']=_['intersection'](_0x392628['model'],_0x392628[_0x39af('0x48')]);_0x4db7ce['attributes']=_[_0x39af('0x4c')](_0x392628[_0x39af('0x4a')],qs[_0x39af('0x4d')](_0x5d8293['query']['fields']));_0x4db7ce['attributes']=_0x4db7ce[_0x39af('0x4b')]['length']?_0x4db7ce[_0x39af('0x4b')]:_0x392628[_0x39af('0x4a')];_0x4db7ce['order']=qs['sort'](_0x5d8293[_0x39af('0x48')][_0x39af('0x52')]);_0x4db7ce[_0x39af('0x53')]=qs[_0x39af('0x49')](_[_0x39af('0x54')](_0x5d8293[_0x39af('0x48')],_0x392628[_0x39af('0x49')]));if(_0x5d8293[_0x39af('0x48')][_0x39af('0x55')]){_0x4db7ce[_0x39af('0x53')]=_['merge'](_0x4db7ce['where'],{'$or':_[_0x39af('0x47')](_0x4db7ce[_0x39af('0x4b')],function(_0x11c585){var _0x6b9cb9={};_0x6b9cb9[_0x11c585]={'$like':'%'+_0x5d8293['query'][_0x39af('0x55')]+'%'};return _0x6b9cb9;})});}_0x4db7ce=_['merge']({},_0x4db7ce,_0x5d8293['options']);return _0x9b6618['getAgents'](_0x4db7ce);}})[_0x39af('0x24')](function(_0x7c8195){if(_0x7c8195){_0x18e250=_0x7c8195[_0x39af('0x4e')];if(!_0x5d8293[_0x39af('0x48')][_0x39af('0x4f')]('nolimit')){_0x4db7ce['limit']=qs[_0x39af('0x34')](_0x5d8293[_0x39af('0x48')][_0x39af('0x34')]);_0x4db7ce[_0x39af('0x32')]=qs[_0x39af('0x32')](_0x5d8293['query'][_0x39af('0x32')]);}return _0x9b6618['getAgents'](_0x4db7ce);}})['then'](function(_0x280f4f){if(_0x280f4f){return _0x280f4f?{'count':_0x18e250,'rows':_0x280f4f}:null;}})[_0x39af('0x24')](respondWithResult(_0x5dd2e2,null))['catch'](handleError(_0x5dd2e2,null));};exports[_0x39af('0x41')]=function(_0x30c005,_0x40aaba,_0x308751){var _0x1f06fc,_0x3ec35f,_0x2f45d3;if(_[_0x39af('0x82')](_0x30c005[_0x39af('0x65')][_0x39af('0x65')])||_0x30c005['body']['body']===''){throw new db[(_0x39af('0x7b'))]['ValidationError'](_0x39af('0x85'));}if(_[_0x39af('0x82')](_0x30c005[_0x39af('0x65')]['to'])){}_0x1f06fc=_0x30c005['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x30c005[_0x39af('0x60')]['id']}})['then'](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x166f92){if(_0x166f92){return db[_0x39af('0x5a')][_0x39af('0x63')]({'where':{'id':_0x166f92['id']},'include':[{'model':db[_0x39af('0xbc')],'as':_0x39af('0x8a'),'include':[{'model':db['CmContact'],'as':_0x39af('0x8b'),'where':{[_0x166f92[_0x39af('0x86')]]:_0x1f06fc},'limit':0x1,'order':[[_0x39af('0x7f'),'DESC']]}]}]})[_0x39af('0x24')](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x4b4992){if(_0x4b4992&&_0x4b4992[_0x39af('0x8a')]){_0x3ec35f=_0x4b4992[_0x39af('0x3c')]({'plain':!![]});if(_0x3ec35f['List']&&_0x3ec35f['List'][_0x39af('0x8b')]['length']){return _0x3ec35f[_0x39af('0x8a')][_0x39af('0x8b')][0x0];}return db[_0x39af('0x7a')][_0x39af('0x64')](_[_0x39af('0x1b')](_0x30c005['body'],{'firstName':_0x1f06fc,[_0x4b4992[_0x39af('0x86')]]:_0x1f06fc,'phone':_0x1f06fc,'ListId':_0x3ec35f['ListId']}));}})[_0x39af('0x24')](handleEntityNotFound(_0x40aaba,null))[_0x39af('0x24')](function(_0x4bc14e){if(_0x4bc14e){_0x2f45d3=_0x4bc14e;return db['OpenchannelInteraction'][_0x39af('0x63')]({'where':{'ContactId':_0x2f45d3['id'],'closed':![],'OpenchannelAccountId':_0x3ec35f['id']}})['then'](function(_0x10c1e8){if(_0x10c1e8){return[_0x10c1e8,![]];}return db[_0x39af('0x97')][_0x39af('0x64')]({'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id'],'OpenchannelAccountId':_0x3ec35f['id'],'lastMsgDirection':_0x39af('0xbd'),'Messages':[_[_0x39af('0x56')](_0x30c005['body'],{'read':![],'body':_0x30c005[_0x39af('0x65')][_0x39af('0x65')],'OpenchannelAccountId':_0x3ec35f['id'],'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x39af('0xbe')}]})[_0x39af('0x24')](function(_0x29876b){return[_0x29876b,!![]];});});}})[_0x39af('0x9a')](function(_0x302518,_0x46b4d3){if(_0x46b4d3){return _0x302518;}return db[_0x39af('0xa2')]['create'](_[_0x39af('0x56')](_0x30c005[_0x39af('0x65')],{'read':![],'body':_0x30c005['body']['body'],'OpenchannelAccountId':_0x3ec35f['id'],'OpenchannelInteractionId':_0x302518['id'],'UserId':_0x30c005[_0x39af('0x66')]['id'],'ContactId':_0x2f45d3['id']}))['then'](function(_0x12778b){_0x302518[_0x39af('0xbf')][_0x39af('0xbe')]=[];_0x302518[_0x39af('0xbf')]['Messages']['push'](_0x12778b[_0x39af('0xbf')]);return _0x302518;});});}})[_0x39af('0x24')](respondWithResult(_0x40aaba,null))[_0x39af('0x2e')](handleError(_0x40aaba,null));}; \ No newline at end of file +var _0x3830=['*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','findAll','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','nolimit','order','pick','options','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','close','unmanaged'];(function(_0x533843,_0x3d5ec0){var _0x55a5f4=function(_0x3ee88f){while(--_0x3ee88f){_0x533843['push'](_0x533843['shift']());}};_0x55a5f4(++_0x3d5ec0);}(_0x3830,0x1a5));var _0x0383=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x3830[_0x1a9e78];return _0x113e06;};'use strict';var emlformat=require(_0x0383('0x0'));var rimraf=require(_0x0383('0x1'));var zipdir=require(_0x0383('0x2'));var jsonpatch=require(_0x0383('0x3'));var rp=require(_0x0383('0x4'));var moment=require(_0x0383('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0383('0x6'));var util=require(_0x0383('0x7'));var path=require(_0x0383('0x8'));var sox=require(_0x0383('0x9'));var csv=require(_0x0383('0xa'));var ejs=require(_0x0383('0xb'));var fs=require('fs');var fs_extra=require(_0x0383('0xc'));var _=require(_0x0383('0xd'));var squel=require(_0x0383('0xe'));var crypto=require('crypto');var jsforce=require(_0x0383('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0383('0xa'));var querystring=require('querystring');var Papa=require(_0x0383('0x10'));var Redis=require(_0x0383('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0383('0x12'));var hardwareService=require(_0x0383('0x13'));var logger=require(_0x0383('0x14'))(_0x0383('0x15'));var utils=require(_0x0383('0x16'));var config=require(_0x0383('0x17'));var licenseUtil=require(_0x0383('0x18'));var db=require('../../mysqldb')['db'];config[_0x0383('0x19')]=_[_0x0383('0x1a')](config[_0x0383('0x19')],{'host':_0x0383('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0383('0x19')]));require(_0x0383('0x1c'))[_0x0383('0x1d')](socket);var jayson=require(_0x0383('0x1e'));var client=jayson[_0x0383('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56bd8c,_0x12ee76,_0x2bd1ba,_0x21e420){return new BPromise(function(_0x38b024,_0x11826a){var _0x50d996=_0x21e420||client;return _0x50d996[_0x0383('0x20')](_0x56bd8c,_0x2bd1ba)[_0x0383('0x21')](function(_0x458418){logger[_0x0383('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x12ee76,_0x0383('0x23'));logger[_0x0383('0x24')](_0x0383('0x25'),_0x12ee76,_0x0383('0x23'),JSON[_0x0383('0x26')](_0x458418));if(_0x458418[_0x0383('0x27')]){if(_0x458418[_0x0383('0x27')]['code']===0x1f4){logger['error'](_0x0383('0x28'),_0x12ee76,_0x458418['error'][_0x0383('0x29')]);return _0x11826a(_0x458418[_0x0383('0x27')][_0x0383('0x29')]);}logger[_0x0383('0x27')](_0x0383('0x28'),_0x12ee76,_0x458418['error'][_0x0383('0x29')]);return _0x38b024(_0x458418[_0x0383('0x27')][_0x0383('0x29')]);}else{logger['info'](_0x0383('0x28'),_0x12ee76,_0x0383('0x23'));_0x38b024(_0x458418[_0x0383('0x2a')][_0x0383('0x29')]);}})[_0x0383('0x2b')](function(_0x5695b9){logger[_0x0383('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x12ee76,_0x5695b9);_0x11826a(_0x5695b9);});});}function respondWithStatusCode(_0x4e950c,_0x473636){_0x473636=_0x473636||0xcc;return function(_0x397e6f){if(_0x397e6f){return _0x4e950c['sendStatus'](_0x473636);}return _0x4e950c['status'](_0x473636)[_0x0383('0x2c')]();};}function respondWithResult(_0x36917d,_0x578e7f){_0x578e7f=_0x578e7f||0xc8;return function(_0x2e1e19){if(_0x2e1e19){return _0x36917d[_0x0383('0x2d')](_0x578e7f)[_0x0383('0x2e')](_0x2e1e19);}};}function respondWithFilteredResult(_0x1418fc,_0x198e1d){return function(_0x32a9f0){if(_0x32a9f0){var _0x1e6c8b=typeof _0x198e1d[_0x0383('0x2f')]===_0x0383('0x30')&&typeof _0x198e1d[_0x0383('0x31')]==='undefined';var _0xeee25a=_0x32a9f0['count'];var _0x585ee8=_0x1e6c8b?0x0:_0x198e1d[_0x0383('0x2f')];var _0x875bf6=_0x1e6c8b?_0x32a9f0[_0x0383('0x32')]:_0x198e1d[_0x0383('0x2f')]+_0x198e1d[_0x0383('0x31')];var _0x129416;if(_0x875bf6>=_0xeee25a){_0x875bf6=_0xeee25a;_0x129416=0xc8;}else{_0x129416=0xce;}_0x1418fc[_0x0383('0x2d')](_0x129416);return _0x1418fc['set'](_0x0383('0x33'),_0x585ee8+'-'+_0x875bf6+'/'+_0xeee25a)[_0x0383('0x2e')](_0x32a9f0);}return null;};}function patchUpdates(_0xebf320){return function(_0x446737){try{jsonpatch[_0x0383('0x34')](_0x446737,_0xebf320,!![]);}catch(_0x1a6892){return BPromise['reject'](_0x1a6892);}return _0x446737[_0x0383('0x35')]();};}function saveUpdates(_0x71a776,_0x5d520e){return function(_0x25fc92){if(_0x25fc92){return _0x25fc92['update'](_0x71a776)[_0x0383('0x21')](function(_0x313b5b){return _0x313b5b;});}return null;};}function removeEntity(_0x5b547c,_0x5bb6c6){return function(_0x1b1500){if(_0x1b1500){return _0x1b1500[_0x0383('0x36')]()['then'](function(){var _0x29c866=_0x1b1500[_0x0383('0x37')]({'plain':!![]});var _0x182b94=_0x0383('0x38');return db[_0x0383('0x39')]['destroy']({'where':{'type':_0x182b94,'resourceId':_0x29c866['id']}})[_0x0383('0x21')](function(){return _0x1b1500;});})['then'](function(){_0x5b547c[_0x0383('0x2d')](0xcc)[_0x0383('0x2c')]();});}};}function handleEntityNotFound(_0x3b6fa5,_0x24ee72){return function(_0x464877){if(!_0x464877){_0x3b6fa5[_0x0383('0x3a')](0x194);}return _0x464877;};}function handleError(_0x4c7bca,_0x28c1ba){_0x28c1ba=_0x28c1ba||0x1f4;return function(_0x1c8420){logger['error'](_0x1c8420[_0x0383('0x3b')]);if(_0x1c8420[_0x0383('0x3c')]){delete _0x1c8420[_0x0383('0x3c')];}_0x4c7bca[_0x0383('0x2d')](_0x28c1ba)['send'](_0x1c8420);};}exports[_0x0383('0x3d')]=function(_0x58d29e,_0x11e415){var _0x515665={'include':[{'model':db[_0x0383('0x3e')],'as':_0x0383('0x3f')}]},_0x765042={},_0x25bdaa={'count':0x0,'rows':[]};var _0x5286a9=_[_0x0383('0x40')](db[_0x0383('0x41')]['rawAttributes'],function(_0x342706){return{'name':_0x342706['fieldName'],'type':_0x342706['type']['key']};});_0x765042[_0x0383('0x42')]=_[_0x0383('0x40')](_0x5286a9,'name');_0x765042[_0x0383('0x43')]=_[_0x0383('0x44')](_0x58d29e[_0x0383('0x43')]);_0x765042['filters']=_[_0x0383('0x45')](_0x765042[_0x0383('0x42')],_0x765042[_0x0383('0x43')]);_0x515665['attributes']=_['intersection'](_0x765042[_0x0383('0x42')],qs[_0x0383('0x46')](_0x58d29e[_0x0383('0x43')]['fields']));_0x515665[_0x0383('0x47')]=_0x515665[_0x0383('0x47')][_0x0383('0x48')]?_0x515665[_0x0383('0x47')]:_0x765042['model'];if(!_0x58d29e[_0x0383('0x43')][_0x0383('0x49')]('nolimit')){_0x515665[_0x0383('0x31')]=qs[_0x0383('0x31')](_0x58d29e[_0x0383('0x43')]['limit']);_0x515665[_0x0383('0x2f')]=qs[_0x0383('0x2f')](_0x58d29e[_0x0383('0x43')][_0x0383('0x2f')]);}_0x515665['order']=qs[_0x0383('0x4a')](_0x58d29e[_0x0383('0x43')][_0x0383('0x4a')]);_0x515665[_0x0383('0x4b')]=qs[_0x0383('0x4c')](_['pick'](_0x58d29e['query'],_0x765042[_0x0383('0x4c')]),_0x5286a9);if(_0x58d29e['query']['filter']){_0x515665[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x515665[_0x0383('0x4b')],{'$or':_[_0x0383('0x40')](_0x5286a9,function(_0x57eed4){if(_0x57eed4[_0x0383('0x4e')]!==_0x0383('0x4f')){var _0x2d5476={};_0x2d5476[_0x57eed4[_0x0383('0x3c')]]={'$like':'%'+_0x58d29e[_0x0383('0x43')][_0x0383('0x50')]+'%'};return _0x2d5476;}})});}_0x515665=_['merge']({},_0x515665,_0x58d29e['options']);var _0x162bee={'where':_0x515665[_0x0383('0x4b')]};return db['OpenchannelAccount'][_0x0383('0x32')](_0x162bee)[_0x0383('0x21')](function(_0xe5399c){_0x25bdaa['count']=_0xe5399c;if(_0x58d29e[_0x0383('0x43')][_0x0383('0x51')]){_0x515665['include']=[{'all':!![]}];}return db[_0x0383('0x41')][_0x0383('0x52')](_0x515665);})[_0x0383('0x21')](function(_0x4c7e2c){_0x25bdaa['rows']=_0x4c7e2c;return _0x25bdaa;})['then'](respondWithFilteredResult(_0x11e415,_0x515665))[_0x0383('0x2b')](handleError(_0x11e415,null));};exports[_0x0383('0x53')]=function(_0x19a898,_0x17a703){var _0xdf140c={'raw':![],'where':{'id':_0x19a898[_0x0383('0x54')]['id']},'include':[{'model':db[_0x0383('0x3e')],'as':_0x0383('0x3f')}]},_0x534591={};_0x534591['model']=_[_0x0383('0x44')](db['OpenchannelAccount'][_0x0383('0x55')]);_0x534591['query']=_[_0x0383('0x44')](_0x19a898['query']);_0x534591[_0x0383('0x4c')]=_[_0x0383('0x45')](_0x534591[_0x0383('0x42')],_0x534591[_0x0383('0x43')]);_0xdf140c['attributes']=_['intersection'](_0x534591[_0x0383('0x42')],qs[_0x0383('0x46')](_0x19a898[_0x0383('0x43')][_0x0383('0x46')]));_0xdf140c[_0x0383('0x47')]=_0xdf140c[_0x0383('0x47')][_0x0383('0x48')]?_0xdf140c['attributes']:_0x534591[_0x0383('0x42')];if(_0x19a898[_0x0383('0x43')][_0x0383('0x51')]){_0xdf140c[_0x0383('0x56')]=[{'all':!![]}];}_0xdf140c=_[_0x0383('0x4d')]({},_0xdf140c,_0x19a898['options']);return db[_0x0383('0x41')][_0x0383('0x57')](_0xdf140c)[_0x0383('0x21')](handleEntityNotFound(_0x17a703,null))[_0x0383('0x21')](respondWithResult(_0x17a703,null))[_0x0383('0x2b')](handleError(_0x17a703,null));};exports[_0x0383('0x58')]=function(_0x4c656d,_0x55b186){return db[_0x0383('0x41')][_0x0383('0x58')](_0x4c656d[_0x0383('0x59')],{})[_0x0383('0x21')](function(_0xd48e9f){var _0x4da69c=_0x4c656d[_0x0383('0x5a')]['get']({'plain':!![]});if(!_0x4da69c)throw new Error(_0x0383('0x5b'));if(_0x4da69c['role']===_0x0383('0x5a')){var _0x415ca6=_0xd48e9f[_0x0383('0x37')]({'plain':!![]});var _0x3641ae='OpenchannelAccounts';return db[_0x0383('0x5c')][_0x0383('0x57')]({'where':{'name':_0x3641ae,'userProfileId':_0x4da69c[_0x0383('0x5d')]},'raw':!![]})[_0x0383('0x21')](function(_0x3aff3a){if(_0x3aff3a&&_0x3aff3a['autoAssociation']===0x0){return db[_0x0383('0x39')][_0x0383('0x58')]({'name':_0x415ca6[_0x0383('0x3c')],'resourceId':_0x415ca6['id'],'type':_0x3aff3a['name'],'sectionId':_0x3aff3a['id']},{})['then'](function(){return _0xd48e9f;});}else{return _0xd48e9f;}})['catch'](function(_0x39a3ad){logger[_0x0383('0x27')](_0x0383('0x5e'),_0x39a3ad);throw _0x39a3ad;});}return _0xd48e9f;})[_0x0383('0x21')](respondWithResult(_0x55b186,0xc9))['catch'](handleError(_0x55b186,null));};exports[_0x0383('0x5f')]=function(_0x1aba01,_0x53e84e){if(_0x1aba01[_0x0383('0x59')]['id']){delete _0x1aba01['body']['id'];}return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0x1aba01[_0x0383('0x54')]['id']},'include':[{'model':db[_0x0383('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x0383('0x21')](handleEntityNotFound(_0x53e84e,null))[_0x0383('0x21')](saveUpdates(_0x1aba01[_0x0383('0x59')],null))[_0x0383('0x21')](respondWithResult(_0x53e84e,null))[_0x0383('0x2b')](handleError(_0x53e84e,null));};exports[_0x0383('0x36')]=function(_0xa05eee,_0x2cc39a){return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0xa05eee['params']['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x2cc39a,null))[_0x0383('0x21')](removeEntity(_0x2cc39a,null))[_0x0383('0x2b')](handleError(_0x2cc39a,null));};exports['describe']=function(_0x3f9d19,_0x1d016c){return db[_0x0383('0x41')][_0x0383('0x60')]()[_0x0383('0x21')](respondWithResult(_0x1d016c,null))['catch'](handleError(_0x1d016c,null));};exports[_0x0383('0x61')]=function(_0x552cd6,_0x5bd42a,_0x1db8aa){if(_0x552cd6[_0x0383('0x59')]['id']){delete _0x552cd6[_0x0383('0x59')]['id'];}return db['OpenchannelAccount'][_0x0383('0x57')]({'where':{'id':_0x552cd6['params']['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x5bd42a,null))[_0x0383('0x21')](function(_0x2afa57){if(_0x2afa57){_0x552cd6[_0x0383('0x59')][_0x0383('0x62')]=_0x2afa57['id'];return db['Disposition']['create'](_0x552cd6[_0x0383('0x59')]);}})[_0x0383('0x21')](respondWithResult(_0x5bd42a,null))['catch'](handleError(_0x5bd42a,null));};exports[_0x0383('0x63')]=function(_0xe9d6f7,_0x358d39,_0x479502){var _0x41344a={'raw':![],'where':{}};var _0x11f9b9={};var _0x4a8d84={'count':0x0,'rows':[]};return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0xe9d6f7[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x358d39,null))[_0x0383('0x21')](function(_0x5507d5){if(_0x5507d5){_0x11f9b9['model']=_['keys'](db[_0x0383('0x65')]['rawAttributes']);_0x11f9b9[_0x0383('0x43')]=_['keys'](_0xe9d6f7[_0x0383('0x43')]);_0x11f9b9[_0x0383('0x4c')]=_[_0x0383('0x45')](_0x11f9b9['model'],_0x11f9b9[_0x0383('0x43')]);_0x41344a[_0x0383('0x47')]=_[_0x0383('0x45')](_0x11f9b9[_0x0383('0x42')],qs[_0x0383('0x46')](_0xe9d6f7[_0x0383('0x43')]['fields']));_0x41344a['attributes']=_0x41344a[_0x0383('0x47')][_0x0383('0x48')]?_0x41344a[_0x0383('0x47')]:_0x11f9b9[_0x0383('0x42')];if(!_0xe9d6f7['query'][_0x0383('0x49')](_0x0383('0x66'))){_0x41344a['limit']=qs[_0x0383('0x31')](_0xe9d6f7[_0x0383('0x43')][_0x0383('0x31')]);_0x41344a[_0x0383('0x2f')]=qs[_0x0383('0x2f')](_0xe9d6f7[_0x0383('0x43')][_0x0383('0x2f')]);}_0x41344a[_0x0383('0x67')]=qs[_0x0383('0x4a')](_0xe9d6f7[_0x0383('0x43')][_0x0383('0x4a')]);_0x41344a[_0x0383('0x4b')]=qs[_0x0383('0x4c')](_[_0x0383('0x68')](_0xe9d6f7[_0x0383('0x43')],_0x11f9b9[_0x0383('0x4c')]));_0x41344a[_0x0383('0x4b')][_0x0383('0x62')]=_0x5507d5['id'];if(_0xe9d6f7[_0x0383('0x43')]['filter']){_0x41344a[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x41344a[_0x0383('0x4b')],{'$or':_[_0x0383('0x40')](_0x41344a[_0x0383('0x47')],function(_0x1049a4){var _0xd18c72={};_0xd18c72[_0x1049a4]={'$like':'%'+_0xe9d6f7['query'][_0x0383('0x50')]+'%'};return _0xd18c72;})});}_0x41344a=_[_0x0383('0x4d')]({},_0x41344a,_0xe9d6f7[_0x0383('0x69')]);return db[_0x0383('0x65')][_0x0383('0x32')]({'where':_0x41344a[_0x0383('0x4b')]})[_0x0383('0x21')](function(_0x537033){_0x4a8d84['count']=_0x537033;if(_0xe9d6f7[_0x0383('0x43')][_0x0383('0x51')]){_0x41344a[_0x0383('0x56')]=[{'all':!![]}];}return db[_0x0383('0x65')]['findAll'](_0x41344a);})[_0x0383('0x21')](function(_0x303721){_0x4a8d84[_0x0383('0x6a')]=_0x303721;return _0x4a8d84;});}})[_0x0383('0x21')](respondWithFilteredResult(_0x358d39,_0x41344a))[_0x0383('0x2b')](handleError(_0x358d39,null));};exports[_0x0383('0x6b')]=function(_0x108eb0,_0x2963b5,_0x5ae392){return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0x108eb0[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x2963b5,null))[_0x0383('0x21')](function(_0x1933c2){if(_0x1933c2){return _0x1933c2['removeDispositions'](_0x108eb0[_0x0383('0x43')][_0x0383('0x6c')]);}})[_0x0383('0x21')](respondWithStatusCode(_0x2963b5,null))[_0x0383('0x2b')](handleError(_0x2963b5,null));};exports[_0x0383('0x6d')]=function(_0x51586e,_0x42b1ae,_0x3d9297){if(_0x51586e['body']['id']){delete _0x51586e[_0x0383('0x59')]['id'];}return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0x51586e[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x42b1ae,null))['then'](function(_0x945928){if(_0x945928){_0x51586e[_0x0383('0x59')][_0x0383('0x62')]=_0x945928['id'];return db[_0x0383('0x6e')]['create'](_0x51586e[_0x0383('0x59')]);}})[_0x0383('0x21')](respondWithResult(_0x42b1ae,null))[_0x0383('0x2b')](handleError(_0x42b1ae,null));};exports['getAnswers']=function(_0x50388d,_0x240cdd,_0x56792e){var _0x19bfce={'raw':![],'where':{}};var _0x412022={};var _0x210d70={'count':0x0,'rows':[]};return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0x50388d[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x240cdd,null))['then'](function(_0x3ad207){if(_0x3ad207){_0x412022[_0x0383('0x42')]=_[_0x0383('0x44')](db[_0x0383('0x6e')][_0x0383('0x55')]);_0x412022[_0x0383('0x43')]=_[_0x0383('0x44')](_0x50388d[_0x0383('0x43')]);_0x412022[_0x0383('0x4c')]=_[_0x0383('0x45')](_0x412022['model'],_0x412022['query']);_0x19bfce[_0x0383('0x47')]=_['intersection'](_0x412022[_0x0383('0x42')],qs[_0x0383('0x46')](_0x50388d[_0x0383('0x43')][_0x0383('0x46')]));_0x19bfce[_0x0383('0x47')]=_0x19bfce['attributes']['length']?_0x19bfce[_0x0383('0x47')]:_0x412022['model'];if(!_0x50388d[_0x0383('0x43')][_0x0383('0x49')](_0x0383('0x66'))){_0x19bfce[_0x0383('0x31')]=qs['limit'](_0x50388d[_0x0383('0x43')]['limit']);_0x19bfce[_0x0383('0x2f')]=qs[_0x0383('0x2f')](_0x50388d[_0x0383('0x43')]['offset']);}_0x19bfce['order']=qs[_0x0383('0x4a')](_0x50388d[_0x0383('0x43')][_0x0383('0x4a')]);_0x19bfce[_0x0383('0x4b')]=qs['filters'](_[_0x0383('0x68')](_0x50388d[_0x0383('0x43')],_0x412022[_0x0383('0x4c')]));_0x19bfce[_0x0383('0x4b')][_0x0383('0x62')]=_0x3ad207['id'];if(_0x50388d[_0x0383('0x43')]['filter']){_0x19bfce[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x19bfce['where'],{'$or':_[_0x0383('0x40')](_0x19bfce[_0x0383('0x47')],function(_0x33d887){var _0x40ce02={};_0x40ce02[_0x33d887]={'$like':'%'+_0x50388d[_0x0383('0x43')][_0x0383('0x50')]+'%'};return _0x40ce02;})});}_0x19bfce=_[_0x0383('0x4d')]({},_0x19bfce,_0x50388d[_0x0383('0x69')]);return db[_0x0383('0x6e')][_0x0383('0x32')]({'where':_0x19bfce[_0x0383('0x4b')]})[_0x0383('0x21')](function(_0x10773d){_0x210d70[_0x0383('0x32')]=_0x10773d;if(_0x50388d[_0x0383('0x43')]['includeAll']){_0x19bfce[_0x0383('0x56')]=[{'all':!![]}];}return db[_0x0383('0x6e')]['findAll'](_0x19bfce);})[_0x0383('0x21')](function(_0xfcc553){_0x210d70[_0x0383('0x6a')]=_0xfcc553;return _0x210d70;});}})[_0x0383('0x21')](respondWithFilteredResult(_0x240cdd,_0x19bfce))[_0x0383('0x2b')](handleError(_0x240cdd,null));};exports[_0x0383('0x6f')]=function(_0x1e1be1,_0x228c15,_0xe4e8cf){return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0x1e1be1['params']['id']}})['then'](handleEntityNotFound(_0x228c15,null))[_0x0383('0x21')](function(_0x45662b){if(_0x45662b){return _0x45662b[_0x0383('0x6f')](_0x1e1be1['query'][_0x0383('0x6c')]);}})[_0x0383('0x21')](respondWithStatusCode(_0x228c15,null))[_0x0383('0x2b')](handleError(_0x228c15,null));};exports['notify']=function(_0x74ee4,_0x58deea,_0x2efde1){var _0x1c9025={'body':_0x74ee4[_0x0383('0x59')],'channel':_0x0383('0x70')};var _0x43f813=[];var _0x4f47c5=[];var _0x26418c={};var _0x6b141e=![];return db[_0x0383('0x71')][_0x0383('0x60')]()[_0x0383('0x21')](function(_0x2ea49a){if(!_0x2ea49a){throw new db[(_0x0383('0x72'))][(_0x0383('0x73'))](_0x0383('0x74'));}_0x43f813=_['difference'](_[_0x0383('0x44')](_0x2ea49a),['createdAt',_0x0383('0x75')]);_0x4f47c5=_[_0x0383('0x76')](_[_0x0383('0x44')](_0x2ea49a),[_0x0383('0x77'),'updatedAt',_0x0383('0x78'),_0x0383('0x79')]);if(_0x74ee4[_0x0383('0x59')]['id']){delete _0x74ee4[_0x0383('0x59')]['id'];}if(_[_0x0383('0x7a')](_0x74ee4[_0x0383('0x59')][_0x0383('0x7b')])){throw new db[(_0x0383('0x72'))][(_0x0383('0x73'))](_0x0383('0x7c'));}if(_[_0x0383('0x7a')](_0x74ee4['body'][_0x0383('0x59')])||_0x74ee4[_0x0383('0x59')][_0x0383('0x59')]===''){throw new db[(_0x0383('0x72'))][(_0x0383('0x73'))](_0x0383('0x7d'));}if(_[_0x0383('0x7a')](_0x74ee4[_0x0383('0x59')][_0x0383('0x7e')])){throw new db[(_0x0383('0x72'))][(_0x0383('0x73'))](_0x0383('0x7f')+_0x4f47c5);}if(!_['includes'](_0x4f47c5,_0x74ee4['body']['mapKey'])){throw new db['Sequelize'][(_0x0383('0x73'))](_0x0383('0x80')+_0x4f47c5);}_0x26418c[_0x74ee4['body'][_0x0383('0x7e')]]=_0x74ee4[_0x0383('0x59')][_0x0383('0x7b')];})['then'](function(){return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0x74ee4[_0x0383('0x54')]['id']},'include':[{'model':db[_0x0383('0x81')],'as':_0x0383('0x82'),'include':[{'model':db['CmContact'],'as':_0x0383('0x83'),'where':_0x26418c,'limit':0x1,'order':[[_0x0383('0x75'),_0x0383('0x84')]]}]},{'model':db[_0x0383('0x85')],'as':_0x0383('0x86')}]});})[_0x0383('0x21')](handleEntityNotFound(_0x58deea,null))[_0x0383('0x21')](function(_0x4b65f5){if(_0x4b65f5&&_0x4b65f5[_0x0383('0x82')]){_0x1c9025[_0x0383('0x87')]=_0x4b65f5;_0x1c9025['applications']=_0x4b65f5[_0x0383('0x86')];_0x1c9025[_0x0383('0x88')]=_0x4b65f5[_0x0383('0x82')];_0x1c9025[_0x0383('0x89')]=_[_0x0383('0x8a')](_0x1c9025[_0x0383('0x89')],[_0x0383('0x8b')],['asc']);if(_0x1c9025['account'][_0x0383('0x86')]){delete _0x1c9025[_0x0383('0x87')]['Applications'];}if(_0x1c9025[_0x0383('0x87')][_0x0383('0x82')]&&_0x1c9025[_0x0383('0x87')]['List'][_0x0383('0x83')][_0x0383('0x48')]){return _0x1c9025[_0x0383('0x87')][_0x0383('0x82')]['Contacts'][0x0];}var _0x22f5a6=_[_0x0383('0x1a')](_0x74ee4[_0x0383('0x59')],{'firstName':_0x74ee4[_0x0383('0x59')][_0x0383('0x7b')],'ListId':_0x4b65f5[_0x0383('0x79')]});_0x22f5a6[_0x74ee4[_0x0383('0x59')]['mapKey']]=_0x74ee4[_0x0383('0x59')][_0x0383('0x7b')];return db[_0x0383('0x71')][_0x0383('0x58')](_0x22f5a6,{'fields':_0x43f813,'raw':!![]});}})[_0x0383('0x21')](handleEntityNotFound(_0x58deea,null))[_0x0383('0x21')](function(_0x401c13){_0x1c9025['contact']=_0x401c13;if(_0x401c13){var _0x33c1={'ContactId':_0x401c13['id'],'OpenchannelAccountId':_0x74ee4[_0x0383('0x54')]['id'],'from':(_0x401c13[_0x0383('0x8c')]||'')+'\x20'+(_0x401c13[_0x0383('0x8d')]||'')};var _0x11a8ac={'OpenchannelAccountId':_0x74ee4[_0x0383('0x54')]['id'],'closed':![]};if(_0x74ee4['body'][_0x0383('0x8e')]){_0x11a8ac['threadId']=_0x74ee4[_0x0383('0x59')][_0x0383('0x8e')];return db[_0x0383('0x8f')][_0x0383('0x57')]({'where':_0x11a8ac})[_0x0383('0x21')](function(_0x3e3c88){if(_0x3e3c88){return[_0x3e3c88,![]];}_0x33c1['threadId']=_0x74ee4[_0x0383('0x59')][_0x0383('0x8e')];_0x33c1[_0x0383('0x90')]=_0x74ee4['body']['externalUrl'];return db[_0x0383('0x8f')][_0x0383('0x58')](_0x33c1)['then'](function(_0x2ddd47){return[_0x2ddd47,!![]];});});}else{_0x11a8ac[_0x0383('0x8e')]=null;}_0x11a8ac['ContactId']=_0x401c13['id'];return db[_0x0383('0x8f')]['find']({'where':_0x11a8ac})[_0x0383('0x21')](function(_0x4d97d1){if(_0x4d97d1){return[_0x4d97d1,![]];}return db[_0x0383('0x8f')]['create'](_0x33c1)[_0x0383('0x21')](function(_0x23ea63){return[_0x23ea63,!![]];});});}})[_0x0383('0x91')](function(_0x378189,_0x1bee2d){if(_0x378189){_0x6b141e=_0x1bee2d;if(!_0x1bee2d){var _0x56bf2e={'from':(_0x1c9025[_0x0383('0x92')][_0x0383('0x8c')]||'')+'\x20'+(_0x1c9025[_0x0383('0x92')][_0x0383('0x8d')]||'')};if(_0x74ee4[_0x0383('0x59')][_0x0383('0x8e')]&&_0x74ee4['body'][_0x0383('0x93')]&&_0x74ee4[_0x0383('0x59')]['threadId']!=_0x74ee4['body'][_0x0383('0x93')]){_0x56bf2e[_0x0383('0x8e')]=_0x74ee4[_0x0383('0x59')]['messageId'];}return _0x378189[_0x0383('0x5f')](_0x56bf2e);}else{return _0x378189;}}})[_0x0383('0x21')](function(_0x1f8e03){_0x1c9025[_0x0383('0x94')]=_0x1f8e03[_0x0383('0x37')]({'plain':!![]});_0x1c9025[_0x0383('0x94')]['created']=_0x6b141e;if(_0x1c9025[_0x0383('0x94')][_0x0383('0x95')]){if(_0x1c9025[_0x0383('0x87')]['autoclose']){_0x1c9025[_0x0383('0x89')]['push']({'id':0x0,'priority':_0x1c9025[_0x0383('0x89')]['length']+0x1,'app':_0x0383('0x96'),'appdata':_0x0383('0x97'),'interval':_0x0383('0x98')});}}return db[_0x0383('0x99')]['create']({'body':_0x74ee4['body'][_0x0383('0x59')],'OpenchannelAccountId':_0x74ee4[_0x0383('0x54')]['id'],'OpenchannelInteractionId':_0x1f8e03['id'],'direction':'in','ContactId':_0x1c9025[_0x0383('0x92')]['id'],'AttachmentId':_0x74ee4[_0x0383('0x59')][_0x0383('0x9a')]});})[_0x0383('0x21')](function(_0x548f44){_0x1c9025[_0x0383('0x29')]=_0x548f44;if(_0x1c9025[_0x0383('0x94')]['UserId']){return db[_0x0383('0x9b')][_0x0383('0x57')]({'attributes':['id','name'],'where':{'id':_0x1c9025[_0x0383('0x94')][_0x0383('0x9c')]}})['then'](function(_0x134bb9){if(_0x134bb9){_0x1c9025[_0x0383('0x89')][_0x0383('0x9d')]({'id':0x0,'priority':0x0,'app':_0x0383('0x9e'),'appdata':_0x134bb9[_0x0383('0x3c')]+','+(_0x1c9025[_0x0383('0x87')][_0x0383('0x9f')]||0xa),'interval':_0x0383('0x98')});_0x1c9025[_0x0383('0xa0')]=![];}return respondWithRpcPromise('Start',_0x0383('0xa1'),_0x1c9025);});}return respondWithRpcPromise(_0x0383('0xa2'),_0x0383('0xa1'),_0x1c9025);})[_0x0383('0x21')](function(_0x4d33c8){respondWithRpcPromise(_0x0383('0xa3'),_0x0383('0xa3'),{'event':_0x0383('0xa4'),'message':_0x4d33c8},client9002);return _0x4d33c8;})[_0x0383('0x21')](respondWithResult(_0x58deea,null))[_0x0383('0x2b')](handleError(_0x58deea,null));};exports[_0x0383('0xa5')]=function(_0x82f0ac,_0x1d1566,_0x2ad720){return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0x82f0ac[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x1d1566,null))[_0x0383('0x21')](function(_0x3d5c0c){if(_0x3d5c0c){return db[_0x0383('0xa6')]['transaction'](function(_0x22b76f){return db[_0x0383('0x85')][_0x0383('0x36')]({'where':{'OpenchannelAccountId':_0x82f0ac[_0x0383('0x54')]['id']},'transaction':_0x22b76f})[_0x0383('0x21')](function(_0x2b861d){var _0x167077=_[_0x0383('0x40')](_0x82f0ac[_0x0383('0x59')],function(_0x155297){_0x155297[_0x0383('0x62')]=_0x82f0ac['params']['id'];return _0x155297;});return db[_0x0383('0x85')][_0x0383('0xa7')](_0x167077,{'transaction':_0x22b76f});});})[_0x0383('0x21')](function(){return db['OpenchannelApplication'][_0x0383('0xa8')]({'where':{'OpenchannelAccountId':_0x82f0ac[_0x0383('0x54')]['id']},'order':_0x0383('0x8b')});});}})[_0x0383('0x21')](respondWithResult(_0x1d1566,null))[_0x0383('0x2b')](handleError(_0x1d1566,null));};exports['getApplications']=function(_0x363544,_0x112c34,_0x434cf7){var _0x5a4f17={};var _0x5752dc={};var _0x4d84d4;var _0x142f12;return db[_0x0383('0x41')]['findOne']({'where':{'id':_0x363544[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x112c34,null))[_0x0383('0x21')](function(_0x25f08d){if(_0x25f08d){_0x4d84d4=_0x25f08d;_0x5752dc['model']=_[_0x0383('0x44')](db[_0x0383('0x85')][_0x0383('0x55')]);_0x5752dc[_0x0383('0x43')]=_[_0x0383('0x44')](_0x363544[_0x0383('0x43')]);_0x5752dc['filters']=_['intersection'](_0x5752dc['model'],_0x5752dc[_0x0383('0x43')]);_0x5a4f17['attributes']=_['intersection'](_0x5752dc['model'],qs[_0x0383('0x46')](_0x363544[_0x0383('0x43')]['fields']));_0x5a4f17[_0x0383('0x47')]=_0x5a4f17[_0x0383('0x47')][_0x0383('0x48')]?_0x5a4f17['attributes']:_0x5752dc['model'];_0x5a4f17[_0x0383('0x67')]=qs['sort'](_0x363544['query']['sort']);_0x5a4f17['where']=qs[_0x0383('0x4c')](_[_0x0383('0x68')](_0x363544[_0x0383('0x43')],_0x5752dc['filters']));if(_0x363544['query'][_0x0383('0x50')]){_0x5a4f17[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x5a4f17['where'],{'$or':_[_0x0383('0x40')](_0x5a4f17[_0x0383('0x47')],function(_0x5ca259){var _0x4203cf={};_0x4203cf[_0x5ca259]={'$like':'%'+_0x363544[_0x0383('0x43')][_0x0383('0x50')]+'%'};return _0x4203cf;})});}_0x5a4f17=_[_0x0383('0x4d')]({},_0x5a4f17,_0x363544[_0x0383('0x69')]);return _0x4d84d4[_0x0383('0xa9')](_0x5a4f17);}})[_0x0383('0x21')](function(_0x2c06a5){if(_0x2c06a5){_0x142f12=_0x2c06a5[_0x0383('0x48')];if(!_0x363544[_0x0383('0x43')][_0x0383('0x49')](_0x0383('0x66'))){_0x5a4f17[_0x0383('0x31')]=qs[_0x0383('0x31')](_0x363544['query'][_0x0383('0x31')]);_0x5a4f17[_0x0383('0x2f')]=qs[_0x0383('0x2f')](_0x363544['query'][_0x0383('0x2f')]);}return _0x4d84d4[_0x0383('0xa9')](_0x5a4f17);}})['then'](function(_0x4f092c){if(_0x4f092c){return _0x4f092c?{'count':_0x142f12,'rows':_0x4f092c}:null;}})[_0x0383('0x21')](respondWithResult(_0x112c34,null))[_0x0383('0x2b')](handleError(_0x112c34,null));};exports[_0x0383('0xaa')]=function(_0x7ac7a,_0xb61d2d,_0x2929c9){var _0x51ea83={'raw':![],'where':{}};var _0x34a269={};var _0x185c6c={'count':0x0,'rows':[]};return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0x7ac7a[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0xb61d2d,null))['then'](function(_0x2fc81d){if(_0x2fc81d){_0x34a269[_0x0383('0x42')]=_['keys'](db[_0x0383('0x8f')][_0x0383('0x55')]);_0x34a269[_0x0383('0x43')]=_['keys'](_0x7ac7a[_0x0383('0x43')]);_0x34a269['filters']=_['intersection'](_0x34a269[_0x0383('0x42')],_0x34a269[_0x0383('0x43')]);_0x51ea83[_0x0383('0x47')]=_[_0x0383('0x45')](_0x34a269[_0x0383('0x42')],qs[_0x0383('0x46')](_0x7ac7a[_0x0383('0x43')]['fields']));_0x51ea83[_0x0383('0x47')]=_0x51ea83[_0x0383('0x47')][_0x0383('0x48')]?_0x51ea83[_0x0383('0x47')]:_0x34a269[_0x0383('0x42')];if(!_0x7ac7a[_0x0383('0x43')][_0x0383('0x49')]('nolimit')){_0x51ea83['limit']=qs['limit'](_0x7ac7a['query'][_0x0383('0x31')]);_0x51ea83[_0x0383('0x2f')]=qs[_0x0383('0x2f')](_0x7ac7a[_0x0383('0x43')][_0x0383('0x2f')]);}_0x51ea83[_0x0383('0x67')]=qs[_0x0383('0x4a')](_0x7ac7a[_0x0383('0x43')][_0x0383('0x4a')]);_0x51ea83[_0x0383('0x4b')]=qs[_0x0383('0x4c')](_['pick'](_0x7ac7a['query'],_0x34a269['filters']));_0x51ea83[_0x0383('0x4b')][_0x0383('0x62')]=_0x2fc81d['id'];if(_0x7ac7a[_0x0383('0x43')][_0x0383('0x50')]){_0x51ea83[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x51ea83[_0x0383('0x4b')],{'$or':_[_0x0383('0x40')](_0x51ea83[_0x0383('0x47')],function(_0x299083){var _0xe06a03={};_0xe06a03[_0x299083]={'$like':'%'+_0x7ac7a[_0x0383('0x43')]['filter']+'%'};return _0xe06a03;})});}_0x51ea83=_[_0x0383('0x4d')]({},_0x51ea83,_0x7ac7a[_0x0383('0x69')]);return db['OpenchannelInteraction'][_0x0383('0x32')]({'where':_0x51ea83[_0x0383('0x4b')]})['then'](function(_0x3ea46f){_0x185c6c[_0x0383('0x32')]=_0x3ea46f;if(_0x7ac7a['query'][_0x0383('0x51')]){_0x51ea83['include']=[{'model':db[_0x0383('0x71')],'as':_0x0383('0xab'),'required':![]},{'model':db[_0x0383('0x9b')],'as':_0x0383('0xac'),'attributes':[_0x0383('0x3c'),'fullname',_0x0383('0xad')],'required':![]},{'model':db[_0x0383('0xae')],'as':_0x0383('0xaf'),'attributes':['id',_0x0383('0x3c'),_0x0383('0xb0')],'where':_0x7ac7a[_0x0383('0x43')][_0x0383('0xb1')]?{'id':_0x7ac7a[_0x0383('0x43')][_0x0383('0xb1')]}:undefined,'required':_0x7ac7a[_0x0383('0x43')][_0x0383('0xb1')]?!![]:![]}];}return db[_0x0383('0x8f')][_0x0383('0x52')](_0x51ea83);})[_0x0383('0x21')](function(_0x3b0e76){_0x185c6c[_0x0383('0x6a')]=_0x3b0e76;return _0x185c6c;});}})[_0x0383('0x21')](respondWithFilteredResult(_0xb61d2d,_0x51ea83))[_0x0383('0x2b')](handleError(_0xb61d2d,null));};exports[_0x0383('0xb2')]=function(_0xc0a9eb,_0x2dd75c,_0x45f881){return db[_0x0383('0x41')][_0x0383('0x57')]({'where':{'id':_0xc0a9eb[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x2dd75c,null))[_0x0383('0x21')](function(_0xb8a54a){if(_0xb8a54a){return _0xb8a54a[_0x0383('0xb2')](_0xc0a9eb[_0x0383('0x59')][_0x0383('0x6c')],_[_0x0383('0xb3')](_0xc0a9eb[_0x0383('0x59')],[_0x0383('0x6c'),'id'])||{})[_0x0383('0x91')](function(_0x357bdd){for(var _0x160a06=0x0;_0x160a06<_0xc0a9eb[_0x0383('0x59')][_0x0383('0x6c')]['length'];_0x160a06+=0x1){socket[_0x0383('0xb4')](_0x0383('0xb5'),{'UserId':Number(_0xc0a9eb['body'][_0x0383('0x6c')][_0x160a06]),'OpenchannelAccountId':Number(_0xc0a9eb[_0x0383('0x54')]['id'])});}return _0x357bdd;});}})[_0x0383('0x21')](respondWithResult(_0x2dd75c,null))[_0x0383('0x2b')](handleError(_0x2dd75c,null));};exports[_0x0383('0xb6')]=function(_0x1f62d3,_0x53afbb,_0x2a555c){return db[_0x0383('0x41')]['find']({'where':{'id':_0x1f62d3[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x53afbb,null))['then'](function(_0x39c135){if(_0x39c135){return _0x39c135[_0x0383('0xb6')](_0x1f62d3[_0x0383('0x43')][_0x0383('0x6c')])[_0x0383('0x21')](function(){if(_[_0x0383('0xb7')](_0x1f62d3[_0x0383('0x43')][_0x0383('0x6c')])){for(var _0x420765=0x0;_0x420765<_0x1f62d3[_0x0383('0x43')][_0x0383('0x6c')][_0x0383('0x48')];_0x420765+=0x1){socket['emit'](_0x0383('0xb8'),{'UserId':Number(_0x1f62d3[_0x0383('0x43')][_0x0383('0x6c')][_0x420765]),'OpenchannelAccountId':Number(_0x1f62d3['params']['id'])});}}else{socket[_0x0383('0xb4')](_0x0383('0xb8'),{'UserId':Number(_0x1f62d3['query'][_0x0383('0x6c')]),'OpenchannelAccountId':Number(_0x1f62d3[_0x0383('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x53afbb,null))[_0x0383('0x2b')](handleError(_0x53afbb,null));};exports[_0x0383('0xb9')]=function(_0x502c31,_0x4e33de,_0x20d0f1){var _0x544aa1={};var _0x44fb5a={};var _0x5533f7;var _0x5bbaf6;return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0x502c31[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x4e33de,null))[_0x0383('0x21')](function(_0x108d71){if(_0x108d71){_0x5533f7=_0x108d71;_0x44fb5a[_0x0383('0x42')]=_[_0x0383('0x44')](db[_0x0383('0x9b')][_0x0383('0x55')]);_0x44fb5a[_0x0383('0x43')]=_[_0x0383('0x44')](_0x502c31['query']);_0x44fb5a[_0x0383('0x4c')]=_[_0x0383('0x45')](_0x44fb5a[_0x0383('0x42')],_0x44fb5a[_0x0383('0x43')]);_0x544aa1[_0x0383('0x47')]=_['intersection'](_0x44fb5a[_0x0383('0x42')],qs[_0x0383('0x46')](_0x502c31['query'][_0x0383('0x46')]));_0x544aa1[_0x0383('0x47')]=_0x544aa1['attributes']['length']?_0x544aa1['attributes']:_0x44fb5a[_0x0383('0x42')];_0x544aa1['order']=qs['sort'](_0x502c31[_0x0383('0x43')][_0x0383('0x4a')]);_0x544aa1['where']=qs['filters'](_[_0x0383('0x68')](_0x502c31[_0x0383('0x43')],_0x44fb5a[_0x0383('0x4c')]));if(_0x502c31[_0x0383('0x43')]['filter']){_0x544aa1[_0x0383('0x4b')]=_[_0x0383('0x4d')](_0x544aa1[_0x0383('0x4b')],{'$or':_['map'](_0x544aa1[_0x0383('0x47')],function(_0x1b2f2a){var _0x14e102={};_0x14e102[_0x1b2f2a]={'$like':'%'+_0x502c31[_0x0383('0x43')]['filter']+'%'};return _0x14e102;})});}_0x544aa1=_[_0x0383('0x4d')]({},_0x544aa1,_0x502c31[_0x0383('0x69')]);return _0x5533f7[_0x0383('0xb9')](_0x544aa1);}})['then'](function(_0x4f2baa){if(_0x4f2baa){_0x5bbaf6=_0x4f2baa[_0x0383('0x48')];if(!_0x502c31[_0x0383('0x43')]['hasOwnProperty'](_0x0383('0x66'))){_0x544aa1[_0x0383('0x31')]=qs[_0x0383('0x31')](_0x502c31['query'][_0x0383('0x31')]);_0x544aa1[_0x0383('0x2f')]=qs['offset'](_0x502c31[_0x0383('0x43')]['offset']);}return _0x5533f7[_0x0383('0xb9')](_0x544aa1);}})[_0x0383('0x21')](function(_0x1b7ed5){if(_0x1b7ed5){return _0x1b7ed5?{'count':_0x5bbaf6,'rows':_0x1b7ed5}:null;}})[_0x0383('0x21')](respondWithResult(_0x4e33de,null))['catch'](handleError(_0x4e33de,null));};exports[_0x0383('0xba')]=function(_0x26c496,_0x473246,_0x366272){var _0x193f6d,_0x154f8f,_0x3d312c;if(_[_0x0383('0x7a')](_0x26c496[_0x0383('0x59')][_0x0383('0x59')])||_0x26c496[_0x0383('0x59')][_0x0383('0x59')]===''){throw new db[(_0x0383('0x72'))]['ValidationError'](_0x0383('0x7d'));}if(_[_0x0383('0x7a')](_0x26c496[_0x0383('0x59')]['to'])){}_0x193f6d=_0x26c496[_0x0383('0x59')]['to'];return db[_0x0383('0x41')][_0x0383('0x64')]({'where':{'id':_0x26c496[_0x0383('0x54')]['id']}})[_0x0383('0x21')](handleEntityNotFound(_0x473246,null))[_0x0383('0x21')](function(_0x4a0753){if(_0x4a0753){return db[_0x0383('0x41')]['find']({'where':{'id':_0x4a0753['id']},'include':[{'model':db[_0x0383('0x81')],'as':_0x0383('0x82'),'include':[{'model':db[_0x0383('0x71')],'as':_0x0383('0x83'),'where':{[_0x4a0753[_0x0383('0x7e')]]:_0x193f6d},'limit':0x1,'order':[[_0x0383('0x75'),_0x0383('0x84')]]}]}]})[_0x0383('0x21')](handleEntityNotFound(_0x473246,null))[_0x0383('0x21')](function(_0x566d9e){if(_0x566d9e&&_0x566d9e[_0x0383('0x82')]){_0x154f8f=_0x566d9e['get']({'plain':!![]});if(_0x154f8f['List']&&_0x154f8f['List'][_0x0383('0x83')]['length']){return _0x154f8f[_0x0383('0x82')][_0x0383('0x83')][0x0];}return db[_0x0383('0x71')][_0x0383('0x58')](_[_0x0383('0x1a')](_0x26c496[_0x0383('0x59')],{'firstName':_0x193f6d,[_0x566d9e[_0x0383('0x7e')]]:_0x193f6d,'phone':_0x193f6d,'ListId':_0x154f8f[_0x0383('0x79')]}));}})[_0x0383('0x21')](handleEntityNotFound(_0x473246,null))[_0x0383('0x21')](function(_0x10faf0){if(_0x10faf0){_0x3d312c=_0x10faf0;return db[_0x0383('0x8f')]['find']({'where':{'ContactId':_0x3d312c['id'],'closed':![],'OpenchannelAccountId':_0x154f8f['id']}})[_0x0383('0x21')](function(_0x343672){if(_0x343672){return[_0x343672,![]];}return db[_0x0383('0x8f')]['create']({'UserId':_0x26c496[_0x0383('0x5a')]['id'],'ContactId':_0x3d312c['id'],'OpenchannelAccountId':_0x154f8f['id'],'lastMsgDirection':_0x0383('0xbb'),'Messages':[_[_0x0383('0x4d')](_0x26c496[_0x0383('0x59')],{'read':![],'body':_0x26c496['body'][_0x0383('0x59')],'OpenchannelAccountId':_0x154f8f['id'],'UserId':_0x26c496[_0x0383('0x5a')]['id'],'ContactId':_0x3d312c['id']})]},{'include':[{'model':db[_0x0383('0x99')],'as':_0x0383('0xbc')}]})[_0x0383('0x21')](function(_0x3322ca){return[_0x3322ca,!![]];});});}})[_0x0383('0x91')](function(_0x4ad0f8,_0x49d993){if(_0x49d993){return _0x4ad0f8;}return db[_0x0383('0x99')][_0x0383('0x58')](_[_0x0383('0x4d')](_0x26c496[_0x0383('0x59')],{'read':![],'body':_0x26c496[_0x0383('0x59')][_0x0383('0x59')],'OpenchannelAccountId':_0x154f8f['id'],'OpenchannelInteractionId':_0x4ad0f8['id'],'UserId':_0x26c496[_0x0383('0x5a')]['id'],'ContactId':_0x3d312c['id']}))[_0x0383('0x21')](function(_0x49e31e){_0x4ad0f8[_0x0383('0xbd')][_0x0383('0xbc')]=[];_0x4ad0f8['dataValues'][_0x0383('0xbc')][_0x0383('0xbe')](_0x49e31e[_0x0383('0xbd')]);return _0x4ad0f8;});});}})[_0x0383('0x21')](respondWithResult(_0x473246,null))['catch'](handleError(_0x473246,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 707fb8c..f8525b4 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 _0x9354=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelAccount','save'];(function(_0x397421,_0x5160b2){var _0x422b12=function(_0x53dd59){while(--_0x53dd59){_0x397421['push'](_0x397421['shift']());}};_0x422b12(++_0x5160b2);}(_0x9354,0x96));var _0x4935=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x9354[_0x214a25];return _0x405988;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x4935('0x0'))['db'][_0x4935('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4935('0x2'),'afterUpdate':_0x4935('0x3'),'afterDestroy':_0x4935('0x4')};function emitEvent(_0x280bbc){return function(_0x5327fc,_0x46c7f9,_0x2d509b){OpenchannelAccountEvents[_0x4935('0x5')](_0x280bbc+':'+_0x5327fc['id'],_0x5327fc);OpenchannelAccountEvents[_0x4935('0x5')](_0x280bbc,_0x5327fc);_0x2d509b(null);};}for(var e in events){if(events[_0x4935('0x6')](e)){var event=events[e];OpenchannelAccount[_0x4935('0x7')](e,emitEvent(event));}}module[_0x4935('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x96cc,0x16c));var _0xc96c=function(_0x555c0b,_0x2a5cae){_0x555c0b=_0x555c0b-0x0;var _0x7f508=_0x96cc[_0x555c0b];return _0x7f508;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('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 68d9540..cd2eac2 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(_0x537bb4,_0x268b77){var _0x346ba3=function(_0x3606ef){while(--_0x3606ef){_0x537bb4['push'](_0x537bb4['shift']());}};_0x346ba3(++_0x268b77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3a1c8f,_0x550a69){var _0x558727=function(_0x3c56ce){while(--_0x3c56ce){_0x3a1c8f['push'](_0x3a1c8f['shift']());}};_0x558727(++_0x550a69);}(_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':'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 d2ce1f3..d043094 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 _0x4024=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','bluebird'];(function(_0x5a7f13,_0xf0f011){var _0x2a3c35=function(_0x1640df){while(--_0x1640df){_0x5a7f13['push'](_0x5a7f13['shift']());}};_0x2a3c35(++_0xf0f011);}(_0x4024,0x89));var _0x4402=function(_0x34ece7,_0x197dce){_0x34ece7=_0x34ece7-0x0;var _0x2bb837=_0x4024[_0x34ece7];return _0x2bb837;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});} \ No newline at end of file +var _0x1152=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','socket.io-emitter','redis','./openchannelAccount.socket','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x206c2a,_0x4fc47c){var _0x31df5b=function(_0x3ad74a){while(--_0x3ad74a){_0x206c2a['push'](_0x206c2a['shift']());}};_0x31df5b(++_0x4fc47c);}(_0x1152,0x182));var _0x2115=function(_0xf3f0cc,_0x5a6ff3){_0xf3f0cc=_0xf3f0cc-0x0;var _0x30935a=_0x1152[_0xf3f0cc];return _0x30935a;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2115('0xb'))(new Redis(config[_0x2115('0xc')]));require(_0x2115('0xd'))['register'](socket);function respondWithRpcPromise(_0x254648,_0x534958,_0x5ca468){return new BPromise(function(_0x225a1c,_0x272a95){return client[_0x2115('0xe')](_0x254648,_0x5ca468)['then'](function(_0x400b19){logger['info'](_0x2115('0xf'),_0x534958,_0x2115('0x10'));logger[_0x2115('0x11')](_0x2115('0x12'),_0x534958,_0x2115('0x10'),JSON['stringify'](_0x400b19));if(_0x400b19[_0x2115('0x13')]){if(_0x400b19['error'][_0x2115('0x14')]===0x1f4){logger[_0x2115('0x13')](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x272a95(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}logger['error'](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x225a1c(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}else{logger[_0x2115('0x16')](_0x2115('0xf'),_0x534958,_0x2115('0x10'));_0x225a1c(_0x400b19['result'][_0x2115('0x15')]);}})[_0x2115('0x17')](function(_0x38c26f){logger['error'](_0x2115('0xf'),_0x534958,_0x38c26f);_0x272a95(_0x38c26f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 459b865..d0ad7f6 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 _0xb04a=['save','remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xab04('0x0'));var events=[_0xab04('0x1'),_0xab04('0x2'),_0xab04('0x3')];function createListener(_0x565575,_0x28963e){return function(_0x4657c4){_0x28963e[_0xab04('0x4')](_0x565575,_0x4657c4);};}function removeListener(_0x4b8c0f,_0x2b5b06){return function(){OpenchannelAccountEvents[_0xab04('0x5')](_0x4b8c0f,_0x2b5b06);};}exports[_0xab04('0x6')]=function(_0x488ced){for(var _0x3b68e3=0x0,_0x46d9b2=events['length'];_0x3b68e3<_0x46d9b2;_0x3b68e3++){var _0x53a969=events[_0x3b68e3];var _0x4d47f5=createListener(_0xab04('0x7')+_0x53a969,_0x488ced);OpenchannelAccountEvents['on'](_0x53a969,_0x4d47f5);}}; \ No newline at end of file +var _0xe189=['update','removeListener','register','length','./openchannelAccount.events'];(function(_0x14b427,_0x29f7f1){var _0x5787bd=function(_0x45d43d){while(--_0x45d43d){_0x14b427['push'](_0x14b427['shift']());}};_0x5787bd(++_0x29f7f1);}(_0xe189,0x194));var _0x9e18=function(_0x620567,_0x32eabc){_0x620567=_0x620567-0x0;var _0x235788=_0xe189[_0x620567];return _0x235788;};'use strict';var OpenchannelAccountEvents=require(_0x9e18('0x0'));var events=['save','remove',_0x9e18('0x1')];function createListener(_0x2bc037,_0x22eac1){return function(_0x30a009){_0x22eac1['emit'](_0x2bc037,_0x30a009);};}function removeListener(_0x49b0f7,_0x1c652d){return function(){OpenchannelAccountEvents[_0x9e18('0x2')](_0x49b0f7,_0x1c652d);};}exports[_0x9e18('0x3')]=function(_0x53d7c9){for(var _0x3e6881=0x0,_0x5e6097=events[_0x9e18('0x4')];_0x3e6881<_0x5e6097;_0x3e6881++){var _0x2e4691=events[_0x3e6881];var _0x4656a4=createListener('openchannelAccount:'+_0x2e4691,_0x53d7c9);OpenchannelAccountEvents['on'](_0x2e4691,_0x4656a4);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 23bd174..bb07336 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 _0xc7e1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','put','exports','multer','util','path','connect-timeout','express'];(function(_0x54f7e2,_0x3b2a85){var _0xee8fd5=function(_0x468b0c){while(--_0x468b0c){_0x54f7e2['push'](_0x54f7e2['shift']());}};_0xee8fd5(++_0x3b2a85);}(_0xc7e1,0xdf));var _0x1c7e=function(_0x5272e6,_0xd01eb4){_0x5272e6=_0x5272e6-0x0;var _0x494f97=_0xc7e1[_0x5272e6];return _0x494f97;};'use strict';var multer=require(_0x1c7e('0x0'));var util=require(_0x1c7e('0x1'));var path=require(_0x1c7e('0x2'));var timeout=require(_0x1c7e('0x3'));var express=require(_0x1c7e('0x4'));var router=express[_0x1c7e('0x5')]();var fs_extra=require(_0x1c7e('0x6'));var auth=require(_0x1c7e('0x7'));var interaction=require(_0x1c7e('0x8'));var config=require(_0x1c7e('0x9'));var controller=require(_0x1c7e('0xa'));router[_0x1c7e('0xb')]('/',auth[_0x1c7e('0xc')](),controller[_0x1c7e('0xd')]);router[_0x1c7e('0xb')](_0x1c7e('0xe'),auth[_0x1c7e('0xc')](),controller[_0x1c7e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c7e('0x10')]);router[_0x1c7e('0x11')](_0x1c7e('0xe'),auth[_0x1c7e('0xc')](),controller['update']);router['delete'](_0x1c7e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1c7e('0x12')]=router; \ No newline at end of file +var _0x3d13=['Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','delete','multer','express'];(function(_0x3bf3ad,_0x1d5489){var _0x95f193=function(_0x635d37){while(--_0x635d37){_0x3bf3ad['push'](_0x3bf3ad['shift']());}};_0x95f193(++_0x1d5489);}(_0x3d13,0x7c));var _0x33d1=function(_0x231567,_0x3617fc){_0x231567=_0x231567-0x0;var _0x37e4ee=_0x3d13[_0x231567];return _0x37e4ee;};'use strict';var multer=require(_0x33d1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x33d1('0x1'));var router=express[_0x33d1('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x33d1('0x3'));var config=require(_0x33d1('0x4'));var controller=require(_0x33d1('0x5'));router[_0x33d1('0x6')]('/',auth[_0x33d1('0x7')](),controller[_0x33d1('0x8')]);router[_0x33d1('0x6')](_0x33d1('0x9'),auth[_0x33d1('0x7')](),controller[_0x33d1('0xa')]);router[_0x33d1('0xb')]('/',auth[_0x33d1('0x7')](),controller['create']);router[_0x33d1('0xc')](_0x33d1('0x9'),auth[_0x33d1('0x7')](),controller['update']);router[_0x33d1('0xd')](_0x33d1('0x9'),auth[_0x33d1('0x7')](),controller['destroy']);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 805ab2d..775fcd1 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 _0x1a1b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xe8f3bc,_0x12985f){var _0x4d1fe2=function(_0xd4eb9a){while(--_0xd4eb9a){_0xe8f3bc['push'](_0xe8f3bc['shift']());}};_0x4d1fe2(++_0x12985f);}(_0x1a1b,0x1d7));var _0xb1a1=function(_0x395db3,_0x5df510){_0x395db3=_0x395db3-0x0;var _0x2dfe66=_0x1a1b[_0x395db3];return _0x2dfe66;};'use strict';var Sequelize=require(_0xb1a1('0x0'));module[_0xb1a1('0x1')]={'priority':{'type':Sequelize[_0xb1a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb1a1('0x3')],'allowNull':![],'defaultValue':_0xb1a1('0x4')},'appdata':{'type':Sequelize[_0xb1a1('0x5')]()},'description':{'type':Sequelize[_0xb1a1('0x3')]},'interval':{'type':Sequelize[_0xb1a1('0x3')],'defaultValue':_0xb1a1('0x6')}}; \ No newline at end of file +var _0x12c1=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x12c1,0x9c));var _0x112c=function(_0x4a884a,_0x1567c3){_0x4a884a=_0x4a884a-0x0;var _0x5c900e=_0x12c1[_0x4a884a];return _0x5c900e;};'use strict';var Sequelize=require(_0x112c('0x0'));module[_0x112c('0x1')]={'priority':{'type':Sequelize[_0x112c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x112c('0x3')],'allowNull':![],'defaultValue':_0x112c('0x4')},'appdata':{'type':Sequelize[_0x112c('0x5')]()},'description':{'type':Sequelize[_0x112c('0x3')]},'interval':{'type':Sequelize[_0x112c('0x3')],'defaultValue':_0x112c('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index fad26c0..7338287 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 _0x51b6=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0x2010d4,_0x1d582a){var _0x5e2ff7=function(_0xb5bc06){while(--_0xb5bc06){_0x2010d4['push'](_0x2010d4['shift']());}};_0x5e2ff7(++_0x1d582a);}(_0x51b6,0x158));var _0x651b=function(_0x495732,_0x541539){_0x495732=_0x495732-0x0;var _0x42f3e5=_0x51b6[_0x495732];return _0x42f3e5;};'use strict';var emlformat=require(_0x651b('0x0'));var rimraf=require(_0x651b('0x1'));var zipdir=require(_0x651b('0x2'));var jsonpatch=require(_0x651b('0x3'));var rp=require(_0x651b('0x4'));var moment=require(_0x651b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x651b('0x6'));var util=require(_0x651b('0x7'));var path=require('path');var sox=require(_0x651b('0x8'));var csv=require(_0x651b('0x9'));var ejs=require(_0x651b('0xa'));var fs=require('fs');var fs_extra=require(_0x651b('0xb'));var _=require(_0x651b('0xc'));var squel=require(_0x651b('0xd'));var crypto=require(_0x651b('0xe'));var jsforce=require(_0x651b('0xf'));var deskjs=require(_0x651b('0x10'));var toCsv=require(_0x651b('0x9'));var querystring=require(_0x651b('0x11'));var Papa=require(_0x651b('0x12'));var Redis=require(_0x651b('0x13'));var authService=require(_0x651b('0x14'));var qs=require(_0x651b('0x15'));var as=require(_0x651b('0x16'));var hardwareService=require(_0x651b('0x17'));var logger=require(_0x651b('0x18'))(_0x651b('0x19'));var utils=require(_0x651b('0x1a'));var config=require(_0x651b('0x1b'));var licenseUtil=require(_0x651b('0x1c'));var db=require(_0x651b('0x1d'))['db'];function respondWithStatusCode(_0x13a374,_0x225767){_0x225767=_0x225767||0xcc;return function(_0x410df8){if(_0x410df8){return _0x13a374[_0x651b('0x1e')](_0x225767);}return _0x13a374[_0x651b('0x1f')](_0x225767)[_0x651b('0x20')]();};}function respondWithResult(_0x218fb4,_0x1d85f2){_0x1d85f2=_0x1d85f2||0xc8;return function(_0x19e594){if(_0x19e594){return _0x218fb4[_0x651b('0x1f')](_0x1d85f2)[_0x651b('0x21')](_0x19e594);}};}function respondWithFilteredResult(_0x1ab7e2,_0x33effe){return function(_0x1ec1fa){if(_0x1ec1fa){var _0x2ac535=typeof _0x33effe[_0x651b('0x22')]===_0x651b('0x23')&&typeof _0x33effe[_0x651b('0x24')]===_0x651b('0x23');var _0x18e1c6=_0x1ec1fa[_0x651b('0x25')];var _0x2eed0f=_0x2ac535?0x0:_0x33effe['offset'];var _0x194923=_0x2ac535?_0x1ec1fa['count']:_0x33effe[_0x651b('0x22')]+_0x33effe[_0x651b('0x24')];var _0x3de019;if(_0x194923>=_0x18e1c6){_0x194923=_0x18e1c6;_0x3de019=0xc8;}else{_0x3de019=0xce;}_0x1ab7e2[_0x651b('0x1f')](_0x3de019);return _0x1ab7e2[_0x651b('0x26')](_0x651b('0x27'),_0x2eed0f+'-'+_0x194923+'/'+_0x18e1c6)[_0x651b('0x21')](_0x1ec1fa);}return null;};}function patchUpdates(_0x3602b0){return function(_0x1732b1){try{jsonpatch[_0x651b('0x28')](_0x1732b1,_0x3602b0,!![]);}catch(_0x5894ad){return BPromise[_0x651b('0x29')](_0x5894ad);}return _0x1732b1[_0x651b('0x2a')]();};}function saveUpdates(_0x455080,_0x3996c9){return function(_0x18e8df){if(_0x18e8df){return _0x18e8df['update'](_0x455080)[_0x651b('0x2b')](function(_0x58ca37){return _0x58ca37;});}return null;};}function removeEntity(_0x5ecc94,_0x329d71){return function(_0x2cdc6c){if(_0x2cdc6c){return _0x2cdc6c[_0x651b('0x2c')]()[_0x651b('0x2b')](function(){_0x5ecc94['status'](0xcc)[_0x651b('0x20')]();});}};}function handleEntityNotFound(_0xcb418e,_0x18d065){return function(_0x133be2){if(!_0x133be2){_0xcb418e['sendStatus'](0x194);}return _0x133be2;};}function handleError(_0x29acab,_0x53c130){_0x53c130=_0x53c130||0x1f4;return function(_0x16282c){logger[_0x651b('0x2d')](_0x16282c['stack']);if(_0x16282c[_0x651b('0x2e')]){delete _0x16282c[_0x651b('0x2e')];}_0x29acab[_0x651b('0x1f')](_0x53c130)[_0x651b('0x2f')](_0x16282c);};}exports[_0x651b('0x30')]=function(_0x25e732,_0x26ef50){var _0x509ff5={},_0x244a60={},_0x118bc1={'count':0x0,'rows':[]};var _0xa8cd29=_['map'](db[_0x651b('0x31')][_0x651b('0x32')],function(_0x144f34){return{'name':_0x144f34[_0x651b('0x33')],'type':_0x144f34[_0x651b('0x34')][_0x651b('0x35')]};});_0x244a60[_0x651b('0x36')]=_['map'](_0xa8cd29,_0x651b('0x2e'));_0x244a60[_0x651b('0x37')]=_[_0x651b('0x38')](_0x25e732[_0x651b('0x37')]);_0x244a60[_0x651b('0x39')]=_[_0x651b('0x3a')](_0x244a60[_0x651b('0x36')],_0x244a60[_0x651b('0x37')]);_0x509ff5[_0x651b('0x3b')]=_[_0x651b('0x3a')](_0x244a60[_0x651b('0x36')],qs[_0x651b('0x3c')](_0x25e732[_0x651b('0x37')][_0x651b('0x3c')]));_0x509ff5[_0x651b('0x3b')]=_0x509ff5['attributes'][_0x651b('0x3d')]?_0x509ff5[_0x651b('0x3b')]:_0x244a60[_0x651b('0x36')];if(!_0x25e732[_0x651b('0x37')][_0x651b('0x3e')](_0x651b('0x3f'))){_0x509ff5[_0x651b('0x24')]=qs[_0x651b('0x24')](_0x25e732['query']['limit']);_0x509ff5[_0x651b('0x22')]=qs['offset'](_0x25e732[_0x651b('0x37')][_0x651b('0x22')]);}_0x509ff5['order']=qs[_0x651b('0x40')](_0x25e732[_0x651b('0x37')][_0x651b('0x40')]);_0x509ff5[_0x651b('0x41')]=qs[_0x651b('0x39')](_[_0x651b('0x42')](_0x25e732[_0x651b('0x37')],_0x244a60[_0x651b('0x39')]),_0xa8cd29);if(_0x25e732[_0x651b('0x37')][_0x651b('0x43')]){_0x509ff5[_0x651b('0x41')]=_[_0x651b('0x44')](_0x509ff5[_0x651b('0x41')],{'$or':_[_0x651b('0x45')](_0xa8cd29,function(_0x461742){if(_0x461742[_0x651b('0x34')]!==_0x651b('0x46')){var _0x44c55b={};_0x44c55b[_0x461742[_0x651b('0x2e')]]={'$like':'%'+_0x25e732[_0x651b('0x37')][_0x651b('0x43')]+'%'};return _0x44c55b;}})});}_0x509ff5=_[_0x651b('0x44')]({},_0x509ff5,_0x25e732[_0x651b('0x47')]);var _0x42c9e3={'where':_0x509ff5[_0x651b('0x41')]};return db[_0x651b('0x31')][_0x651b('0x25')](_0x42c9e3)[_0x651b('0x2b')](function(_0x319e59){_0x118bc1[_0x651b('0x25')]=_0x319e59;if(_0x25e732[_0x651b('0x37')][_0x651b('0x48')]){_0x509ff5[_0x651b('0x49')]=[{'all':!![]}];}return db[_0x651b('0x31')][_0x651b('0x4a')](_0x509ff5);})[_0x651b('0x2b')](function(_0x2c6ff7){_0x118bc1[_0x651b('0x4b')]=_0x2c6ff7;return _0x118bc1;})[_0x651b('0x2b')](respondWithFilteredResult(_0x26ef50,_0x509ff5))[_0x651b('0x4c')](handleError(_0x26ef50,null));};exports['show']=function(_0x1f6f6d,_0x2343d9){var _0x5db8a5={'raw':!![],'where':{'id':_0x1f6f6d['params']['id']}},_0x507596={};_0x507596[_0x651b('0x36')]=_['keys'](db[_0x651b('0x31')]['rawAttributes']);_0x507596[_0x651b('0x37')]=_[_0x651b('0x38')](_0x1f6f6d[_0x651b('0x37')]);_0x507596['filters']=_[_0x651b('0x3a')](_0x507596[_0x651b('0x36')],_0x507596[_0x651b('0x37')]);_0x5db8a5[_0x651b('0x3b')]=_[_0x651b('0x3a')](_0x507596[_0x651b('0x36')],qs[_0x651b('0x3c')](_0x1f6f6d[_0x651b('0x37')][_0x651b('0x3c')]));_0x5db8a5['attributes']=_0x5db8a5[_0x651b('0x3b')][_0x651b('0x3d')]?_0x5db8a5['attributes']:_0x507596[_0x651b('0x36')];if(_0x1f6f6d[_0x651b('0x37')][_0x651b('0x48')]){_0x5db8a5[_0x651b('0x49')]=[{'all':!![]}];}_0x5db8a5=_['merge']({},_0x5db8a5,_0x1f6f6d['options']);return db[_0x651b('0x31')]['find'](_0x5db8a5)[_0x651b('0x2b')](handleEntityNotFound(_0x2343d9,null))[_0x651b('0x2b')](respondWithResult(_0x2343d9,null))[_0x651b('0x4c')](handleError(_0x2343d9,null));};exports['create']=function(_0x39a009,_0x45adcf){return db[_0x651b('0x31')]['create'](_0x39a009[_0x651b('0x4d')],{})[_0x651b('0x2b')](respondWithResult(_0x45adcf,0xc9))[_0x651b('0x4c')](handleError(_0x45adcf,null));};exports['update']=function(_0x3a62bb,_0x1a2918){if(_0x3a62bb[_0x651b('0x4d')]['id']){delete _0x3a62bb[_0x651b('0x4d')]['id'];}return db[_0x651b('0x31')][_0x651b('0x4e')]({'where':{'id':_0x3a62bb[_0x651b('0x4f')]['id']}})[_0x651b('0x2b')](handleEntityNotFound(_0x1a2918,null))['then'](saveUpdates(_0x3a62bb['body'],null))[_0x651b('0x2b')](respondWithResult(_0x1a2918,null))[_0x651b('0x4c')](handleError(_0x1a2918,null));};exports[_0x651b('0x2c')]=function(_0x4b443b,_0x563c38){return db['OpenchannelApplication'][_0x651b('0x4e')]({'where':{'id':_0x4b443b[_0x651b('0x4f')]['id']}})[_0x651b('0x2b')](handleEntityNotFound(_0x563c38,null))[_0x651b('0x2b')](removeEntity(_0x563c38,null))[_0x651b('0x4c')](handleError(_0x563c38,null));}; \ No newline at end of file +var _0xdd1e=['limit','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelApplication','count','include','then','rows','show','params','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x1815ae,_0x3996e6){var _0x4fc185=function(_0x4d36ba){while(--_0x4d36ba){_0x1815ae['push'](_0x1815ae['shift']());}};_0x4fc185(++_0x3996e6);}(_0xdd1e,0x108));var _0xedd1=function(_0x25ef89,_0x11c89c){_0x25ef89=_0x25ef89-0x0;var _0xfba666=_0xdd1e[_0x25ef89];return _0xfba666;};'use strict';var emlformat=require(_0xedd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedd1('0x1'));var jsonpatch=require(_0xedd1('0x2'));var rp=require('request-promise');var moment=require(_0xedd1('0x3'));var BPromise=require(_0xedd1('0x4'));var Mustache=require(_0xedd1('0x5'));var util=require('util');var path=require(_0xedd1('0x6'));var sox=require(_0xedd1('0x7'));var csv=require(_0xedd1('0x8'));var ejs=require(_0xedd1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedd1('0xa'));var squel=require(_0xedd1('0xb'));var crypto=require(_0xedd1('0xc'));var jsforce=require(_0xedd1('0xd'));var deskjs=require(_0xedd1('0xe'));var toCsv=require(_0xedd1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xedd1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedd1('0x10'));var logger=require(_0xedd1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xedd1('0x12'));var db=require(_0xedd1('0x13'))['db'];function respondWithStatusCode(_0x382503,_0x54fbeb){_0x54fbeb=_0x54fbeb||0xcc;return function(_0x2a792a){if(_0x2a792a){return _0x382503['sendStatus'](_0x54fbeb);}return _0x382503[_0xedd1('0x14')](_0x54fbeb)[_0xedd1('0x15')]();};}function respondWithResult(_0x5d3b1f,_0x3a379b){_0x3a379b=_0x3a379b||0xc8;return function(_0x2d49bc){if(_0x2d49bc){return _0x5d3b1f[_0xedd1('0x14')](_0x3a379b)[_0xedd1('0x16')](_0x2d49bc);}};}function respondWithFilteredResult(_0x533fb1,_0x5e56d1){return function(_0x46b96a){if(_0x46b96a){var _0x911f53=typeof _0x5e56d1['offset']===_0xedd1('0x17')&&typeof _0x5e56d1[_0xedd1('0x18')]===_0xedd1('0x17');var _0x454aec=_0x46b96a['count'];var _0x32b2ae=_0x911f53?0x0:_0x5e56d1['offset'];var _0x27a48e=_0x911f53?_0x46b96a['count']:_0x5e56d1[_0xedd1('0x19')]+_0x5e56d1[_0xedd1('0x18')];var _0x36fb37;if(_0x27a48e>=_0x454aec){_0x27a48e=_0x454aec;_0x36fb37=0xc8;}else{_0x36fb37=0xce;}_0x533fb1[_0xedd1('0x14')](_0x36fb37);return _0x533fb1[_0xedd1('0x1a')](_0xedd1('0x1b'),_0x32b2ae+'-'+_0x27a48e+'/'+_0x454aec)[_0xedd1('0x16')](_0x46b96a);}return null;};}function patchUpdates(_0x53e153){return function(_0x3b26a4){try{jsonpatch[_0xedd1('0x1c')](_0x3b26a4,_0x53e153,!![]);}catch(_0x54ce18){return BPromise[_0xedd1('0x1d')](_0x54ce18);}return _0x3b26a4['save']();};}function saveUpdates(_0x47a64b,_0x2877a3){return function(_0x5c7c0e){if(_0x5c7c0e){return _0x5c7c0e[_0xedd1('0x1e')](_0x47a64b)['then'](function(_0x41af9c){return _0x41af9c;});}return null;};}function removeEntity(_0x4b37a4,_0x4e988f){return function(_0x10360d){if(_0x10360d){return _0x10360d[_0xedd1('0x1f')]()['then'](function(){_0x4b37a4['status'](0xcc)[_0xedd1('0x15')]();});}};}function handleEntityNotFound(_0x51ac89,_0x4a66e9){return function(_0x425759){if(!_0x425759){_0x51ac89[_0xedd1('0x20')](0x194);}return _0x425759;};}function handleError(_0x13637e,_0x1c0a78){_0x1c0a78=_0x1c0a78||0x1f4;return function(_0x105436){logger['error'](_0x105436[_0xedd1('0x21')]);if(_0x105436[_0xedd1('0x22')]){delete _0x105436['name'];}_0x13637e['status'](_0x1c0a78)[_0xedd1('0x23')](_0x105436);};}exports[_0xedd1('0x24')]=function(_0x12f70f,_0x5dfd56){var _0x1c7107={},_0x2e3e54={},_0x3844d9={'count':0x0,'rows':[]};var _0x5ef585=_['map'](db['OpenchannelApplication'][_0xedd1('0x25')],function(_0x1e48c4){return{'name':_0x1e48c4[_0xedd1('0x26')],'type':_0x1e48c4[_0xedd1('0x27')][_0xedd1('0x28')]};});_0x2e3e54[_0xedd1('0x29')]=_[_0xedd1('0x2a')](_0x5ef585,'name');_0x2e3e54[_0xedd1('0x2b')]=_[_0xedd1('0x2c')](_0x12f70f[_0xedd1('0x2b')]);_0x2e3e54[_0xedd1('0x2d')]=_['intersection'](_0x2e3e54['model'],_0x2e3e54['query']);_0x1c7107[_0xedd1('0x2e')]=_[_0xedd1('0x2f')](_0x2e3e54[_0xedd1('0x29')],qs['fields'](_0x12f70f[_0xedd1('0x2b')][_0xedd1('0x30')]));_0x1c7107[_0xedd1('0x2e')]=_0x1c7107[_0xedd1('0x2e')][_0xedd1('0x31')]?_0x1c7107[_0xedd1('0x2e')]:_0x2e3e54['model'];if(!_0x12f70f[_0xedd1('0x2b')][_0xedd1('0x32')](_0xedd1('0x33'))){_0x1c7107[_0xedd1('0x18')]=qs[_0xedd1('0x18')](_0x12f70f[_0xedd1('0x2b')]['limit']);_0x1c7107[_0xedd1('0x19')]=qs[_0xedd1('0x19')](_0x12f70f['query'][_0xedd1('0x19')]);}_0x1c7107[_0xedd1('0x34')]=qs[_0xedd1('0x35')](_0x12f70f['query'][_0xedd1('0x35')]);_0x1c7107[_0xedd1('0x36')]=qs['filters'](_[_0xedd1('0x37')](_0x12f70f['query'],_0x2e3e54['filters']),_0x5ef585);if(_0x12f70f[_0xedd1('0x2b')]['filter']){_0x1c7107['where']=_[_0xedd1('0x38')](_0x1c7107[_0xedd1('0x36')],{'$or':_[_0xedd1('0x2a')](_0x5ef585,function(_0x2abd6b){if(_0x2abd6b[_0xedd1('0x27')]!==_0xedd1('0x39')){var _0x3f5c8a={};_0x3f5c8a[_0x2abd6b[_0xedd1('0x22')]]={'$like':'%'+_0x12f70f['query'][_0xedd1('0x3a')]+'%'};return _0x3f5c8a;}})});}_0x1c7107=_[_0xedd1('0x38')]({},_0x1c7107,_0x12f70f[_0xedd1('0x3b')]);var _0x5b093b={'where':_0x1c7107[_0xedd1('0x36')]};return db[_0xedd1('0x3c')][_0xedd1('0x3d')](_0x5b093b)['then'](function(_0x2d141a){_0x3844d9[_0xedd1('0x3d')]=_0x2d141a;if(_0x12f70f[_0xedd1('0x2b')]['includeAll']){_0x1c7107[_0xedd1('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x1c7107);})[_0xedd1('0x3f')](function(_0x196b76){_0x3844d9[_0xedd1('0x40')]=_0x196b76;return _0x3844d9;})[_0xedd1('0x3f')](respondWithFilteredResult(_0x5dfd56,_0x1c7107))['catch'](handleError(_0x5dfd56,null));};exports[_0xedd1('0x41')]=function(_0x2da0d3,_0x3f56cf){var _0x5b3ab4={'raw':!![],'where':{'id':_0x2da0d3[_0xedd1('0x42')]['id']}},_0x170488={};_0x170488[_0xedd1('0x29')]=_[_0xedd1('0x2c')](db['OpenchannelApplication'][_0xedd1('0x25')]);_0x170488[_0xedd1('0x2b')]=_[_0xedd1('0x2c')](_0x2da0d3[_0xedd1('0x2b')]);_0x170488[_0xedd1('0x2d')]=_[_0xedd1('0x2f')](_0x170488[_0xedd1('0x29')],_0x170488[_0xedd1('0x2b')]);_0x5b3ab4[_0xedd1('0x2e')]=_[_0xedd1('0x2f')](_0x170488[_0xedd1('0x29')],qs[_0xedd1('0x30')](_0x2da0d3['query'][_0xedd1('0x30')]));_0x5b3ab4[_0xedd1('0x2e')]=_0x5b3ab4['attributes'][_0xedd1('0x31')]?_0x5b3ab4[_0xedd1('0x2e')]:_0x170488[_0xedd1('0x29')];if(_0x2da0d3[_0xedd1('0x2b')][_0xedd1('0x43')]){_0x5b3ab4[_0xedd1('0x3e')]=[{'all':!![]}];}_0x5b3ab4=_[_0xedd1('0x38')]({},_0x5b3ab4,_0x2da0d3[_0xedd1('0x3b')]);return db[_0xedd1('0x3c')][_0xedd1('0x44')](_0x5b3ab4)['then'](handleEntityNotFound(_0x3f56cf,null))[_0xedd1('0x3f')](respondWithResult(_0x3f56cf,null))[_0xedd1('0x45')](handleError(_0x3f56cf,null));};exports[_0xedd1('0x46')]=function(_0x2290dd,_0x190c97){return db[_0xedd1('0x3c')][_0xedd1('0x46')](_0x2290dd[_0xedd1('0x47')],{})['then'](respondWithResult(_0x190c97,0xc9))[_0xedd1('0x45')](handleError(_0x190c97,null));};exports[_0xedd1('0x1e')]=function(_0x1d83cf,_0x278125){if(_0x1d83cf[_0xedd1('0x47')]['id']){delete _0x1d83cf[_0xedd1('0x47')]['id'];}return db[_0xedd1('0x3c')][_0xedd1('0x44')]({'where':{'id':_0x1d83cf[_0xedd1('0x42')]['id']}})[_0xedd1('0x3f')](handleEntityNotFound(_0x278125,null))[_0xedd1('0x3f')](saveUpdates(_0x1d83cf[_0xedd1('0x47')],null))[_0xedd1('0x3f')](respondWithResult(_0x278125,null))[_0xedd1('0x45')](handleError(_0x278125,null));};exports['destroy']=function(_0x568c93,_0x1d19e1){return db[_0xedd1('0x3c')][_0xedd1('0x44')]({'where':{'id':_0x568c93[_0xedd1('0x42')]['id']}})[_0xedd1('0x3f')](handleEntityNotFound(_0x1d19e1,null))[_0xedd1('0x3f')](removeEntity(_0x1d19e1,null))[_0xedd1('0x45')](handleError(_0x1d19e1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c0bba80..ffcd599 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 _0x6017=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6017,0xb4));var _0x7601=function(_0x4348b1,_0x42b176){_0x4348b1=_0x4348b1-0x0;var _0x211b9c=_0x6017[_0x4348b1];return _0x211b9c;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var logger=require(_0x7601('0x2'))(_0x7601('0x3'));var moment=require(_0x7601('0x4'));var BPromise=require(_0x7601('0x5'));var rp=require(_0x7601('0x6'));var fs=require('fs');var path=require(_0x7601('0x7'));var rimraf=require(_0x7601('0x8'));var config=require(_0x7601('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x7601('0xa')]=function(_0x33b5cb,_0x5cfda7){return _0x33b5cb['define'](_0x7601('0xb'),attributes,{'tableName':_0x7601('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7601('0xd'),'collate':_0x7601('0xe')});}; \ No newline at end of file +var _0x8343=['lodash','moment','bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x476eda,_0x264370){var _0x4e218e=function(_0x5ab92c){while(--_0x5ab92c){_0x476eda['push'](_0x476eda['shift']());}};_0x4e218e(++_0x264370);}(_0x8343,0x140));var _0x3834=function(_0x22ef81,_0x2b6050){_0x22ef81=_0x22ef81-0x0;var _0xbfdf5b=_0x8343[_0x22ef81];return _0xbfdf5b;};'use strict';var _=require(_0x3834('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3834('0x1'));var BPromise=require(_0x3834('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3834('0x3'));var config=require(_0x3834('0x4'));var attributes=require(_0x3834('0x5'));module[_0x3834('0x6')]=function(_0x1d095f,_0x41af20){return _0x1d095f['define'](_0x3834('0x7'),attributes,{'tableName':_0x3834('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3834('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f8ed4cf..6ba0783 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 _0x5446=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelApplication','update','options','raw','where','attributes','limit','info','debug','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x216a80,_0x3d2904){var _0x48dbb0=function(_0x43ae90){while(--_0x43ae90){_0x216a80['push'](_0x216a80['shift']());}};_0x48dbb0(++_0x3d2904);}(_0x5446,0x114));var _0x6544=function(_0x58c978,_0x1455b2){_0x58c978=_0x58c978-0x0;var _0x4ca7fe=_0x5446[_0x58c978];return _0x4ca7fe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6544('0x0'));var BPromise=require(_0x6544('0x1'));var rs=require(_0x6544('0x2'));var fs=require('fs');var Redis=require(_0x6544('0x3'));var db=require(_0x6544('0x4'))['db'];var utils=require(_0x6544('0x5'));var logger=require(_0x6544('0x6'))(_0x6544('0x7'));var config=require('../../config/environment');var jayson=require(_0x6544('0x8'));var client=jayson['client'][_0x6544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7a3360,_0x344e3a,_0x523426){return new BPromise(function(_0x13c691,_0x217456){return client[_0x6544('0xa')](_0x7a3360,_0x523426)[_0x6544('0xb')](function(_0x3dc07d){logger['info'](_0x6544('0xc'),_0x344e3a,_0x6544('0xd'));logger['debug'](_0x6544('0xe'),_0x344e3a,_0x6544('0xd'),JSON[_0x6544('0xf')](_0x3dc07d));if(_0x3dc07d[_0x6544('0x10')]){if(_0x3dc07d[_0x6544('0x10')]['code']===0x1f4){logger[_0x6544('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x344e3a,_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);return _0x217456(_0x3dc07d[_0x6544('0x10')]['message']);}logger[_0x6544('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x344e3a,_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);return _0x13c691(_0x3dc07d[_0x6544('0x10')][_0x6544('0x11')]);}else{logger['info'](_0x6544('0xc'),_0x344e3a,'request\x20sent');_0x13c691(_0x3dc07d[_0x6544('0x12')][_0x6544('0x11')]);}})['catch'](function(_0x1592ca){logger[_0x6544('0x10')](_0x6544('0xc'),_0x344e3a,_0x1592ca);_0x217456(_0x1592ca);});});}exports[_0x6544('0x13')]=function(_0x4ff6e7){var _0x269b07=this;return new Promise(function(_0x30151a,_0x9b582){return db['OpenchannelApplication'][_0x6544('0x14')](_0x4ff6e7['body'],{'raw':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x17')]||null:null,'attributes':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x18')]||null:null,'limit':_0x4ff6e7[_0x6544('0x15')]?_0x4ff6e7[_0x6544('0x15')][_0x6544('0x19')]||null:null})[_0x6544('0xb')](function(_0x1a56ac){logger[_0x6544('0x1a')](_0x6544('0x13'),_0x4ff6e7);logger[_0x6544('0x1b')](_0x6544('0x13'),_0x4ff6e7,JSON['stringify'](_0x1a56ac));_0x30151a(_0x1a56ac);})[_0x6544('0x1c')](function(_0x330224){logger[_0x6544('0x10')](_0x6544('0x13'),_0x330224[_0x6544('0x11')],_0x4ff6e7);_0x9b582(_0x269b07[_0x6544('0x10')](0x1f4,_0x330224[_0x6544('0x11')]));});});}; \ No newline at end of file +var _0x8ae9=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util'];(function(_0x2f860e,_0x16a310){var _0x3a346c=function(_0x589499){while(--_0x589499){_0x2f860e['push'](_0x2f860e['shift']());}};_0x3a346c(++_0x16a310);}(_0x8ae9,0x9e));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x98ae('0x0'));var util=require(_0x98ae('0x1'));var moment=require(_0x98ae('0x2'));var BPromise=require(_0x98ae('0x3'));var rs=require(_0x98ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98ae('0x5'))['db'];var utils=require(_0x98ae('0x6'));var logger=require(_0x98ae('0x7'))(_0x98ae('0x8'));var config=require(_0x98ae('0x9'));var jayson=require(_0x98ae('0xa'));var client=jayson[_0x98ae('0xb')][_0x98ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c44b4,_0x45e754,_0x3a1258){return new BPromise(function(_0x34dfcf,_0x40c78b){return client[_0x98ae('0xd')](_0x1c44b4,_0x3a1258)['then'](function(_0x35de95){logger['info'](_0x98ae('0xe'),_0x45e754,_0x98ae('0xf'));logger[_0x98ae('0x10')](_0x98ae('0x11'),_0x45e754,_0x98ae('0xf'),JSON[_0x98ae('0x12')](_0x35de95));if(_0x35de95[_0x98ae('0x13')]){if(_0x35de95[_0x98ae('0x13')]['code']===0x1f4){logger[_0x98ae('0x13')](_0x98ae('0xe'),_0x45e754,_0x35de95[_0x98ae('0x13')][_0x98ae('0x14')]);return _0x40c78b(_0x35de95[_0x98ae('0x13')][_0x98ae('0x14')]);}logger[_0x98ae('0x13')](_0x98ae('0xe'),_0x45e754,_0x35de95[_0x98ae('0x13')][_0x98ae('0x14')]);return _0x34dfcf(_0x35de95[_0x98ae('0x13')][_0x98ae('0x14')]);}else{logger[_0x98ae('0x15')](_0x98ae('0xe'),_0x45e754,_0x98ae('0xf'));_0x34dfcf(_0x35de95[_0x98ae('0x16')][_0x98ae('0x14')]);}})[_0x98ae('0x17')](function(_0x5358db){logger[_0x98ae('0x13')](_0x98ae('0xe'),_0x45e754,_0x5358db);_0x40c78b(_0x5358db);});});}exports[_0x98ae('0x18')]=function(_0x3f2e8f){var _0x30ee28=this;return new Promise(function(_0x32acc5,_0xc50d66){return db[_0x98ae('0x19')]['update'](_0x3f2e8f[_0x98ae('0x1a')],{'raw':_0x3f2e8f[_0x98ae('0x1b')]?_0x3f2e8f[_0x98ae('0x1b')][_0x98ae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2e8f[_0x98ae('0x1b')]?_0x3f2e8f[_0x98ae('0x1b')][_0x98ae('0x1d')]||null:null,'attributes':_0x3f2e8f[_0x98ae('0x1b')]?_0x3f2e8f[_0x98ae('0x1b')][_0x98ae('0x1e')]||null:null,'limit':_0x3f2e8f['options']?_0x3f2e8f[_0x98ae('0x1b')][_0x98ae('0x1f')]||null:null})['then'](function(_0x3310e2){logger[_0x98ae('0x15')](_0x98ae('0x18'),_0x3f2e8f);logger[_0x98ae('0x10')]('UpdateOpenchannelApplication',_0x3f2e8f,JSON[_0x98ae('0x12')](_0x3310e2));_0x32acc5(_0x3310e2);})['catch'](function(_0x1e2e7e){logger['error'](_0x98ae('0x18'),_0x1e2e7e['message'],_0x3f2e8f);_0xc50d66(_0x30ee28[_0x98ae('0x13')](0x1f4,_0x1e2e7e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index cc0338d..40e6df4 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 _0xd4ea=['getMessages','/:id/download','post','create','addMessage','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','update','tracked','openchannel','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xd4ea,0xd1));var _0xad4e=function(_0xfe3d70,_0x7ed740){_0xfe3d70=_0xfe3d70-0x0;var _0x2a30ac=_0xd4ea[_0xfe3d70];return _0x2a30ac;};'use strict';var multer=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));var path=require(_0xad4e('0x2'));var timeout=require(_0xad4e('0x3'));var express=require(_0xad4e('0x4'));var router=express['Router']();var fs_extra=require(_0xad4e('0x5'));var auth=require(_0xad4e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad4e('0x7'));var controller=require(_0xad4e('0x8'));router['get']('/',auth[_0xad4e('0x9')](),controller[_0xad4e('0xa')]);router[_0xad4e('0xb')](_0xad4e('0xc'),auth['isAuthenticated'](),controller[_0xad4e('0xd')]);router[_0xad4e('0xb')]('/:id',auth[_0xad4e('0x9')](),controller[_0xad4e('0xe')]);router[_0xad4e('0xb')]('/:id/messages',auth[_0xad4e('0x9')](),controller[_0xad4e('0xf')]);router[_0xad4e('0xb')](_0xad4e('0x10'),auth[_0xad4e('0x9')](),controller['download']);router[_0xad4e('0x11')]('/',auth[_0xad4e('0x9')](),controller[_0xad4e('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xad4e('0x13')]);router[_0xad4e('0x11')]('/:id/tags',auth[_0xad4e('0x9')](),interaction['tracked']('openchannel',_0xad4e('0x14')),controller['addTags']);router[_0xad4e('0x15')](_0xad4e('0x16'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xad4e('0x17')),controller[_0xad4e('0x18')]);router['delete'](_0xad4e('0x16'),auth['isAuthenticated'](),interaction[_0xad4e('0x19')](_0xad4e('0x1a'),_0xad4e('0x1b')),controller[_0xad4e('0x1c')]);router['delete'](_0xad4e('0x1d'),auth[_0xad4e('0x9')](),controller[_0xad4e('0x1e')]);module[_0xad4e('0x1f')]=router; \ No newline at end of file +var _0xb017=['../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4a6362,_0x9e782a){var _0x2653a5=function(_0x52b12b){while(--_0x52b12b){_0x4a6362['push'](_0x4a6362['shift']());}};_0x2653a5(++_0x9e782a);}(_0xb017,0x11b));var _0x7b01=function(_0x451165,_0x55f4b3){_0x451165=_0x451165-0x0;var _0x5e0f1c=_0xb017[_0x451165];return _0x5e0f1c;};'use strict';var multer=require('multer');var util=require(_0x7b01('0x0'));var path=require('path');var timeout=require(_0x7b01('0x1'));var express=require('express');var router=express[_0x7b01('0x2')]();var fs_extra=require(_0x7b01('0x3'));var auth=require(_0x7b01('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7b01('0x5'));var controller=require(_0x7b01('0x6'));router[_0x7b01('0x7')]('/',auth['isAuthenticated'](),controller[_0x7b01('0x8')]);router['get'](_0x7b01('0x9'),auth[_0x7b01('0xa')](),controller[_0x7b01('0xb')]);router[_0x7b01('0x7')](_0x7b01('0xc'),auth[_0x7b01('0xa')](),controller['show']);router['get'](_0x7b01('0xd'),auth['isAuthenticated'](),controller[_0x7b01('0xe')]);router[_0x7b01('0x7')](_0x7b01('0xf'),auth[_0x7b01('0xa')](),controller[_0x7b01('0x10')]);router[_0x7b01('0x11')]('/',auth['isAuthenticated'](),controller[_0x7b01('0x12')]);router['post']('/:id/messages',auth[_0x7b01('0xa')](),controller[_0x7b01('0x13')]);router[_0x7b01('0x11')](_0x7b01('0x14'),auth[_0x7b01('0xa')](),interaction[_0x7b01('0x15')]('openchannel',_0x7b01('0x16')),controller[_0x7b01('0x17')]);router['put']('/:id',auth[_0x7b01('0xa')](),interaction['tracked'](_0x7b01('0x18'),_0x7b01('0x19')),controller[_0x7b01('0x1a')]);router['delete'](_0x7b01('0xc'),auth['isAuthenticated'](),interaction[_0x7b01('0x15')](_0x7b01('0x18'),_0x7b01('0x1b')),controller[_0x7b01('0x1c')]);router[_0x7b01('0x1d')](_0x7b01('0x14'),auth['isAuthenticated'](),controller[_0x7b01('0x1e')]);module[_0x7b01('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 55e1570..f76f3e5 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 _0xc3d6=['DATE','STRING','out','sequelize','exports','BOOLEAN'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0xc3d6,0x153));var _0x6c3d=function(_0x20a41b,_0x1dc833){_0x20a41b=_0x20a41b-0x0;var _0x388a1b=_0xc3d6[_0x20a41b];return _0x388a1b;};'use strict';var Sequelize=require(_0x6c3d('0x0'));module[_0x6c3d('0x1')]={'closed':{'type':Sequelize[_0x6c3d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6c3d('0x3')]},'disposition':{'type':Sequelize[_0x6c3d('0x4')]},'secondDisposition':{'type':Sequelize[_0x6c3d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6c3d('0x4')]},'note':{'type':Sequelize[_0x6c3d('0x4')]},'read1stAt':{'type':Sequelize[_0x6c3d('0x3')]},'threadId':{'type':Sequelize[_0x6c3d('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6c3d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6c3d('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x6c3d('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2b3e=['out','exports','DATE','STRING','ENUM'];(function(_0x597dba,_0x1b61ca){var _0x18f720=function(_0x18fa0e){while(--_0x18fa0e){_0x597dba['push'](_0x597dba['shift']());}};_0x18f720(++_0x1b61ca);}(_0x2b3e,0x83));var _0xe2b3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x2b3e[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require('sequelize');module[_0xe2b3('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe2b3('0x1')]},'disposition':{'type':Sequelize[_0xe2b3('0x2')]},'secondDisposition':{'type':Sequelize[_0xe2b3('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe2b3('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xe2b3('0x2')]},'externalUrl':{'type':Sequelize[_0xe2b3('0x2')]},'lastMsgAt':{'type':Sequelize[_0xe2b3('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xe2b3('0x3')]('in',_0xe2b3('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ae24b5c..9505828 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 _0x76c4=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','sort','where','select','field','name','color','tools_tags','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','find','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','CmContact','firstName','Attachment','Messages','createdAt','direction','OpenchannelAccount','Account','get','mkdirSync','Owner','N.A.','closed','disposition','Public','Private','pipe','createWriteStream','basename','lastName','secret','transcript-','.pdf','Openchannel','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0xb9254,_0x3266b9){var _0x14d065=function(_0xcbe995){while(--_0xcbe995){_0xb9254['push'](_0xb9254['shift']());}};_0x14d065(++_0x3266b9);}(_0x76c4,0xe6));var _0x476c=function(_0x4400ef,_0x5bf113){_0x4400ef=_0x4400ef-0x0;var _0x14bd3f=_0x76c4[_0x4400ef];return _0x14bd3f;};'use strict';var emlformat=require(_0x476c('0x0'));var rimraf=require(_0x476c('0x1'));var zipdir=require(_0x476c('0x2'));var jsonpatch=require(_0x476c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x476c('0x4'));var Mustache=require(_0x476c('0x5'));var util=require(_0x476c('0x6'));var path=require(_0x476c('0x7'));var sox=require(_0x476c('0x8'));var csv=require(_0x476c('0x9'));var ejs=require(_0x476c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x476c('0xb'));var squel=require('squel');var crypto=require(_0x476c('0xc'));var jsforce=require(_0x476c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x476c('0x9'));var querystring=require(_0x476c('0xe'));var Papa=require(_0x476c('0xf'));var Redis=require(_0x476c('0x10'));var authService=require(_0x476c('0x11'));var qs=require(_0x476c('0x12'));var as=require(_0x476c('0x13'));var pdf=require(_0x476c('0x14'));var hardwareService=require(_0x476c('0x15'));var logger=require(_0x476c('0x16'))(_0x476c('0x17'));var utils=require(_0x476c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x476c('0x19'));var db=require(_0x476c('0x1a'))['db'];config[_0x476c('0x1b')]=_[_0x476c('0x1c')](config[_0x476c('0x1b')],{'host':_0x476c('0x1d'),'port':0x18eb});var socket=require(_0x476c('0x1e'))(new Redis(config[_0x476c('0x1b')]));require(_0x476c('0x1f'))[_0x476c('0x20')](socket);function respondWithStatusCode(_0x163d84,_0x1c279f){_0x1c279f=_0x1c279f||0xcc;return function(_0x256e1c){if(_0x256e1c){return _0x163d84[_0x476c('0x21')](_0x1c279f);}return _0x163d84[_0x476c('0x22')](_0x1c279f)['end']();};}function respondWithResult(_0x423882,_0x3aba48){_0x3aba48=_0x3aba48||0xc8;return function(_0x79d894){if(_0x79d894){return _0x423882[_0x476c('0x22')](_0x3aba48)[_0x476c('0x23')](_0x79d894);}};}function respondWithFilteredResult(_0x64ed16,_0x5d7113){return function(_0x3b485d){if(_0x3b485d){var _0x736d9d=typeof _0x5d7113[_0x476c('0x24')]==='undefined'&&typeof _0x5d7113['limit']===_0x476c('0x25');var _0x2d7d5e=_0x3b485d[_0x476c('0x26')];var _0x5b3c91=_0x736d9d?0x0:_0x5d7113[_0x476c('0x24')];var _0x20419a=_0x736d9d?_0x3b485d[_0x476c('0x26')]:_0x5d7113['offset']+_0x5d7113['limit'];var _0x35d5f8;if(_0x20419a>=_0x2d7d5e){_0x20419a=_0x2d7d5e;_0x35d5f8=0xc8;}else{_0x35d5f8=0xce;}_0x64ed16[_0x476c('0x22')](_0x35d5f8);return _0x64ed16['set'](_0x476c('0x27'),_0x5b3c91+'-'+_0x20419a+'/'+_0x2d7d5e)[_0x476c('0x23')](_0x3b485d);}return null;};}function patchUpdates(_0x26ebc6){return function(_0x173a95){try{jsonpatch[_0x476c('0x28')](_0x173a95,_0x26ebc6,!![]);}catch(_0x4d1f56){return BPromise[_0x476c('0x29')](_0x4d1f56);}return _0x173a95[_0x476c('0x2a')]();};}function saveUpdates(_0x584596,_0x31ea22){return function(_0x16b984){if(_0x16b984){return _0x16b984[_0x476c('0x2b')](_0x584596)[_0x476c('0x2c')](function(_0x451529){return _0x451529;});}return null;};}function removeEntity(_0x4c3341,_0x49db6d){return function(_0x506f6c){if(_0x506f6c){return _0x506f6c[_0x476c('0x2d')]()[_0x476c('0x2c')](function(){_0x4c3341[_0x476c('0x22')](0xcc)[_0x476c('0x2e')]();});}};}function handleEntityNotFound(_0x5ad654,_0x3bcd36){return function(_0x201d21){if(!_0x201d21){_0x5ad654[_0x476c('0x21')](0x194);}return _0x201d21;};}function handleError(_0x59793a,_0x5e8d44){_0x5e8d44=_0x5e8d44||0x1f4;return function(_0x17b55a){logger[_0x476c('0x2f')](_0x17b55a[_0x476c('0x30')]);if(_0x17b55a['name']){delete _0x17b55a['name'];}_0x59793a[_0x476c('0x22')](_0x5e8d44)[_0x476c('0x31')](_0x17b55a);};}function getInteractionUsers(_0x188ada,_0x403e15){return new BPromise(function(_0x3540ee,_0x5d37f9){try{if(_0x403e15[_0x188ada['id']]){_0x188ada[_0x476c('0x32')]=_[_0x476c('0x33')](_0x403e15[_0x188ada['id']],function(_0x4e466f){return{'id':_0x4e466f['id'],'fullname':_0x4e466f[_0x476c('0x34')]};});}}catch(_0x36fec4){_0x5d37f9(_0x36fec4);}_0x3540ee(_0x188ada);});}function getInteractionTags(_0x3f30c6,_0x50891f){return new BPromise(function(_0x4acb27,_0x1d8c3e){try{if(_0x3f30c6['TagIds']){_0x3f30c6[_0x476c('0x35')]=[];_0x3f30c6[_0x476c('0x36')][_0x476c('0x37')](',')[_0x476c('0x38')](function(_0x3bbe61){_0x3f30c6[_0x476c('0x35')][_0x476c('0x39')](_0x50891f[_0x3bbe61]);});}delete _0x3f30c6[_0x476c('0x36')];}catch(_0xca9eec){_0x1d8c3e(_0xca9eec);}_0x4acb27(_0x3f30c6);});}function updateOpenchannelInteraction(_0x5852f4,_0x12bbfe,_0x29c942){return new BPromise(function(_0x12cf7d,_0x4ffba3){return getInteractionUsers(_0x5852f4,_0x29c942)[_0x476c('0x2c')](function(_0x5f1c22){return getInteractionTags(_0x5f1c22,_0x12bbfe);})['then'](function(_0x5e4f0e){_0x12cf7d(_0x5e4f0e);})[_0x476c('0x3a')](function(_0x2f404c){_0x4ffba3(_0x2f404c);});});}exports[_0x476c('0x3b')]=function(_0x2fa8bc,_0x367d03){var _0x498219={},_0x416edf={},_0x3cdaf4={'count':0x0,'rows':[]};var _0x150550=_[_0x476c('0x33')](db[_0x476c('0x3c')][_0x476c('0x3d')],function(_0x5d8c42){return{'name':_0x5d8c42[_0x476c('0x3e')],'type':_0x5d8c42['type'][_0x476c('0x3f')]};});_0x416edf['model']=_['map'](_0x150550,'name');_0x416edf[_0x476c('0x40')]=_[_0x476c('0x41')](_0x2fa8bc['query']);_0x416edf[_0x476c('0x42')]=_[_0x476c('0x43')](_0x416edf[_0x476c('0x44')],_0x416edf[_0x476c('0x40')]);_0x498219[_0x476c('0x45')]=_[_0x476c('0x43')](_0x416edf[_0x476c('0x44')],qs[_0x476c('0x46')](_0x2fa8bc[_0x476c('0x40')][_0x476c('0x46')]));_0x498219[_0x476c('0x45')]=_0x498219[_0x476c('0x45')]['length']?_0x498219[_0x476c('0x45')]:_0x416edf[_0x476c('0x44')];if(!_0x2fa8bc['query']['hasOwnProperty'](_0x476c('0x47'))){_0x498219[_0x476c('0x48')]=qs['limit'](_0x2fa8bc['query'][_0x476c('0x48')]);_0x498219['offset']=qs[_0x476c('0x24')](_0x2fa8bc['query']['offset']);}_0x498219['order']=qs['sort'](_0x2fa8bc['query'][_0x476c('0x49')]);_0x498219[_0x476c('0x4a')]=qs['filters'](_['pick'](_0x2fa8bc['query'],_0x416edf[_0x476c('0x42')]),_0x150550);var _0x43c70a=[];var _0x56ec92=squel[_0x476c('0x4b')]()['field']('id')[_0x476c('0x4c')](_0x476c('0x4d'))['field'](_0x476c('0x4e'))['from'](_0x476c('0x4f'));var _0x260012=squel['select']()[_0x476c('0x4c')](_0x476c('0x50'))['field']('u.fullname')[_0x476c('0x4c')](_0x476c('0x51'))[_0x476c('0x52')](_0x476c('0x53'),'ui')[_0x476c('0x54')](_0x476c('0x55'),'u',_0x476c('0x56'));var _0x468ee2=squel[_0x476c('0x4b')]()[_0x476c('0x52')](_0x476c('0x57'),'i')[_0x476c('0x54')](_0x476c('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x476c('0x54')](_0x476c('0x55'),'o',_0x476c('0x59'))[_0x476c('0x54')](_0x476c('0x5a'),'a',_0x476c('0x5b'))[_0x476c('0x54')](_0x476c('0x5c'),'me',_0x476c('0x5d'))[_0x476c('0x54')](_0x476c('0x5e'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x476c('0x5f'));var _0x25dfdc=squel['expr']();var _0x197a2e=[];var _0x20c67d=squel['expr']();var _0x284377;if(_0x2fa8bc['query'][_0x476c('0x60')]){_0x284377=as[_0x476c('0x61')](_0x2fa8bc[_0x476c('0x40')][_0x476c('0x60')]);var _0x1be882=_0x284377[_0x476c('0x62')];for(var _0xe3cfa1=0x0;_0xe3cfa1<_0x284377[_0x476c('0x63')][_0x476c('0x64')];_0xe3cfa1++){var _0x1291ce=_0x284377[_0x476c('0x63')][_0xe3cfa1];var _0x2a8bb1='i';var _0x25688a=_[_0x476c('0x65')](_0x150550,['name',_0x1291ce[_0x476c('0x4c')]]);if(!_0x25688a){switch(_0x1291ce[_0x476c('0x4c')]){case'unreadMessages':if(_0x1291ce[_0x476c('0x66')]==0x1){_0x468ee2[_0x476c('0x67')]('`'+_0x1291ce[_0x476c('0x4c')]+_0x476c('0x68'));}else{_0x468ee2[_0x476c('0x67')]('`'+_0x1291ce[_0x476c('0x4c')]+'`\x20>\x200');}break;case _0x476c('0x69'):if(_0x1291ce[_0x476c('0x6a')]===_0x476c('0x6b')){if(_0x1291ce[_0x476c('0x66')]['split']('\x20')[_0x476c('0x64')]>0x1){_0x25dfdc[_0x1be882](_0x476c('0x6c'),qs[_0x476c('0x6d')](_0x1291ce[_0x476c('0x66')]),null);}else{var _0x2fd754='%'+_0x1291ce[_0x476c('0x66')]+'%';_0x25dfdc[_0x1be882](_0x476c('0x6e'),_0x2fd754,_0x2fd754,_0x2fd754);}}else{_0x25688a=_[_0x476c('0x65')](_0x150550,[_0x476c('0x4d'),_0x476c('0x6f')]);_0x1291ce['field']=_0x476c('0x6f');_0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}break;case'Tag':var _0x5bd528=_0x1291ce['value']['split'](',')[_0x476c('0x33')](function(_0x4dca53){return Number(_0x4dca53);});_0x5bd528['forEach'](function(_0xf2e714){_0x20c67d['or'](_0x476c('0x74'),'%,'+_0xf2e714+',%');});_0x197a2e=_[_0x476c('0x75')](_0x197a2e,_0x5bd528);break;case _0x476c('0x76'):if(_0x1291ce['operator']===_0x476c('0x6b')){_0x25dfdc[_0x1be882](_0x476c('0x77'),'%'+_0x1291ce[_0x476c('0x66')]+'%',null);}else{_0x25688a=_[_0x476c('0x65')](_0x150550,[_0x476c('0x4d'),_0x476c('0x78')]);_0x1291ce['field']=_0x476c('0x78');_0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}break;case'body':_0xa314a9=as[_0x476c('0x70')]('me',null,_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9['text'],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')]['end']);break;}}else{var _0xa314a9=as[_0x476c('0x70')](_0x2a8bb1,_0x25688a[_0x476c('0x71')],_0x1291ce);_0x25dfdc[_0x1be882](_0xa314a9[_0x476c('0x72')],_0xa314a9[_0x476c('0x66')][_0x476c('0x73')],_0xa314a9[_0x476c('0x66')][_0x476c('0x2e')]);}}}else{var _0x5efae8=_(_0x2fa8bc['query'])[_0x476c('0x41')]()['map'](function(_0x10de76){return _[_0x476c('0x79')](_0x150550,['name',_0x10de76])?_0x10de76:undefined;})[_0x476c('0x7a')]()['value']();if(!_['isEmpty'](_0x5efae8)){_0x5efae8[_0x476c('0x38')](function(_0x124579){if(_0x124579===_0x476c('0x7b')){_0x468ee2[_0x476c('0x4a')](_0x476c('0x7c'),[][_0x476c('0x7d')](_0x2fa8bc[_0x476c('0x40')][_0x124579]));}else if(_0x124579==='createdAt'){var _0x2fcf22=JSON['parse'](_0x2fa8bc[_0x476c('0x40')][_0x124579])['$gte'];var _0xd81c8=JSON[_0x476c('0x7e')](_0x2fa8bc[_0x476c('0x40')][_0x124579])[_0x476c('0x7f')];_0x468ee2[_0x476c('0x4a')](_0x476c('0x80'),_0x2fcf22,_0xd81c8);}else{if(_0x2fa8bc[_0x476c('0x40')][_0x124579]===_0x476c('0x81')){_0x468ee2[_0x476c('0x4a')]('i.'+_0x124579+_0x476c('0x82'));}else{_0x468ee2[_0x476c('0x4a')]('i.'+_0x124579+_0x476c('0x83'),_0x2fa8bc[_0x476c('0x40')][_0x124579]);}}});}if(_0x2fa8bc['query'][_0x476c('0x84')]){if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x84')]==0x1){_0x468ee2[_0x476c('0x67')](_0x476c('0x85'));}else{_0x468ee2[_0x476c('0x67')](_0x476c('0x86'));}}if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x87')]){_0x197a2e=_['isArray'](_0x2fa8bc['query'][_0x476c('0x87')])?_0x2fa8bc['query'][_0x476c('0x87')]:new Array(_0x2fa8bc['query'][_0x476c('0x87')]);_0x197a2e[_0x476c('0x38')](function(_0x4167f7){_0x20c67d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4167f7+',%');});}if(_0x2fa8bc['query'][_0x476c('0x88')]){var _0x4aa00a=_0x2fa8bc[_0x476c('0x40')]['filter'][_0x476c('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x476c('0x8a')](_0x4aa00a)){_0x25dfdc['or'](_0x476c('0x8b'),_0x4aa00a+'%');}else{_0x25dfdc['or'](_0x476c('0x8c'),qs[_0x476c('0x6d')](_0x4aa00a))['or'](_0x476c('0x8d'),_0x4aa00a+'%')['or'](_0x476c('0x8e'),_0x4aa00a+'%');}}}_0x468ee2['where'](_0x25dfdc);_0x468ee2['group'](_0x476c('0x8f'));var _0x4b2b6b={'type':db[_0x476c('0x90')]['QueryTypes'][_0x476c('0x91')],'raw':!![]};var _0x36e3d2=_0x468ee2[_0x476c('0x92')]();_0x36e3d2[_0x476c('0x4c')](_0x476c('0x8f'));_0x36e3d2[_0x476c('0x4c')](_0x476c('0x93'),_0x476c('0x94'));if(_0x498219[_0x476c('0x95')]){_0x498219[_0x476c('0x95')][_0x476c('0x38')](function(_0x419e98){var _0x531a4d=_0x419e98[0x0]===_0x476c('0x96')?_0x419e98[0x0]:'i.'+_0x419e98[0x0];_0x468ee2[_0x476c('0x95')](_0x531a4d,_0x419e98[0x1]===_0x476c('0x97')?![]:!![]);});}if(!_[_0x476c('0x98')](_0x197a2e)){_0x468ee2['having'](_0x20c67d);_0x36e3d2[_0x476c('0x4a')]('t.id\x20IN\x20?',_0x197a2e);}BPromise[_0x476c('0x99')]()[_0x476c('0x2c')](function(){if(!_0x284377){if(_0x2fa8bc[_0x476c('0x40')][_0x476c('0x7b')])return;_0x36e3d2[_0x476c('0x4a')](_0x476c('0x9a'));_0x468ee2[_0x476c('0x4a')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2fa8bc[_0x476c('0x9b')][_0x476c('0x9c')]!==_0x476c('0x9d'))return;return _0x2fa8bc[_0x476c('0x9b')][_0x476c('0x9e')]({'attributes':['id'],'raw':!![]})[_0x476c('0x2c')](function(_0x127b0f){if(_[_0x476c('0x98')](_0x127b0f)){_0x36e3d2[_0x476c('0x4a')](_0x476c('0x9f'));_0x468ee2['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x36e3d2[_0x476c('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x127b0f,'id'));_0x468ee2['where'](_0x476c('0x7c'),_[_0x476c('0x33')](_0x127b0f,'id'));}});})[_0x476c('0x2c')](function(){if(_0x2fa8bc['user'][_0x476c('0x9c')]===_0x476c('0x9d')&&!_0x284377&&!_0x2fa8bc[_0x476c('0x40')]['OpenchannelAccountId'])return[];return db[_0x476c('0xa0')][_0x476c('0x40')](_0x36e3d2[_0x476c('0xa1')](),_0x4b2b6b);})['then'](function(_0x40d7ec){_0x3cdaf4[_0x476c('0x26')]=_0x40d7ec[_0x476c('0x64')];if(_0x3cdaf4['count']===0x0)return[];return db[_0x476c('0xa0')][_0x476c('0x40')](_0x56ec92[_0x476c('0xa1')](),_0x4b2b6b)[_0x476c('0x2c')](function(_0x348b8b){_0x43c70a=_['keyBy'](_0x348b8b,'id');_0x4b2b6b=_[_0x476c('0xa2')](_0x4b2b6b,{'model':db[_0x476c('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fa8bc[_0x476c('0x40')]['fields']){_0x498219[_0x476c('0x45')]['forEach'](function(_0xf96794){_0x468ee2['field']('i.'+_0xf96794);});}else{_0x468ee2[_0x476c('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x476c('0x94'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa3'),'Account.key');_0x468ee2[_0x476c('0x4c')](_0x476c('0xa4'),_0x476c('0xa5'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa6'),_0x476c('0x96'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xa7'));_0x468ee2['field'](_0x476c('0xa8'),_0x476c('0xa9'));_0x468ee2['field'](_0x476c('0xaa'),_0x476c('0xab'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xac'),_0x476c('0xad'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xae'),_0x476c('0xaf'));_0x468ee2[_0x476c('0x4c')](_0x476c('0xb0'),'Contact.mobile');_0x468ee2['field'](_0x476c('0xb1'),_0x476c('0xb2'));_0x468ee2['field'](_0x476c('0xb3'),_0x476c('0xb4'));_0x468ee2[_0x476c('0x4c')]('o.internal',_0x476c('0xb5'));_0x468ee2[_0x476c('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x476c('0x36'));}if(_0x498219[_0x476c('0x48')])_0x468ee2[_0x476c('0x48')](_0x498219[_0x476c('0x48')]);if(_0x498219[_0x476c('0x24')])_0x468ee2[_0x476c('0x24')](_0x498219[_0x476c('0x24')]);return db[_0x476c('0xa0')][_0x476c('0x40')](_0x468ee2[_0x476c('0xa1')](),_0x4b2b6b);})[_0x476c('0x2c')](function(_0x29f339){if(_0x29f339[_0x476c('0x64')]>0x0)_0x260012[_0x476c('0x4a')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x476c('0x33')](_0x29f339,'id'));return db[_0x476c('0xa0')]['query'](_0x260012[_0x476c('0xa1')](),_0x4b2b6b)[_0x476c('0x2c')](function(_0x28a2ba){var _0x4fbcce=_[_0x476c('0xb6')](_0x28a2ba,_0x476c('0xb7'));var _0x284140=[];_0x29f339[_0x476c('0x38')](function(_0x4c9b5c){_0x284140['push'](updateOpenchannelInteraction(_0x4c9b5c,_0x43c70a,_0x4fbcce));});return BPromise[_0x476c('0xb8')](_0x284140);});});})[_0x476c('0x2c')](function(_0x34fd63){_0x3cdaf4[_0x476c('0xb9')]=_0x34fd63;return _0x3cdaf4;})['then'](respondWithFilteredResult(_0x367d03,_0x498219))['catch'](handleError(_0x367d03,null));};exports[_0x476c('0xba')]=function(_0x3a72a3,_0x42fd96){var _0x589fcd={};if(_0x3a72a3['query']['type']&&_0x3a72a3['query'][_0x476c('0x71')]===_0x476c('0x52')){_0x589fcd[_0x476c('0x52')]=_0x3a72a3[_0x476c('0xbb')]['id'];}else{_0x589fcd['id']=_0x3a72a3['params']['id'];}var _0x1c366d={'raw':![],'where':_0x589fcd},_0x40603c={};_0x40603c[_0x476c('0x44')]=_['keys'](db[_0x476c('0x3c')]['rawAttributes']);_0x40603c['query']=_[_0x476c('0x41')](_0x3a72a3[_0x476c('0x40')]);_0x40603c['filters']=_['intersection'](_0x40603c[_0x476c('0x44')],_0x40603c[_0x476c('0x40')]);_0x1c366d[_0x476c('0x45')]=_[_0x476c('0x43')](_0x40603c[_0x476c('0x44')],qs['fields'](_0x3a72a3[_0x476c('0x40')][_0x476c('0x46')]));_0x1c366d[_0x476c('0x45')]=_0x1c366d[_0x476c('0x45')][_0x476c('0x64')]?_0x1c366d['attributes']:_0x40603c[_0x476c('0x44')];if(_0x3a72a3['query'][_0x476c('0xbc')]){_0x1c366d[_0x476c('0xbd')]=[{'all':!![]}];}_0x1c366d=_[_0x476c('0xa2')]({},_0x1c366d,_0x3a72a3[_0x476c('0xbe')]);return db[_0x476c('0x3c')][_0x476c('0x65')](_0x1c366d)[_0x476c('0x2c')](handleEntityNotFound(_0x42fd96,null))[_0x476c('0x2c')](respondWithResult(_0x42fd96,null))[_0x476c('0x3a')](handleError(_0x42fd96,null));};exports[_0x476c('0xbf')]=function(_0x15ffe8,_0x3db564){return db[_0x476c('0x3c')][_0x476c('0xbf')](_0x15ffe8['body'],{})[_0x476c('0x2c')](respondWithResult(_0x3db564,0xc9))[_0x476c('0x3a')](handleError(_0x3db564,null));};exports[_0x476c('0x2b')]=function(_0x26c90b,_0xff167f){if(_0x26c90b[_0x476c('0xc0')]['id']){delete _0x26c90b[_0x476c('0xc0')]['id'];}return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x26c90b[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0xff167f,null))[_0x476c('0x2c')](saveUpdates(_0x26c90b['body'],null))[_0x476c('0x2c')](respondWithResult(_0xff167f,null))[_0x476c('0x3a')](handleError(_0xff167f,null));};exports[_0x476c('0x2d')]=function(_0x43ef4d,_0x464888){return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x43ef4d[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x464888,null))[_0x476c('0x2c')](removeEntity(_0x464888,null))[_0x476c('0x3a')](handleError(_0x464888,null));};exports[_0x476c('0xc1')]=function(_0x1ca75,_0x54ab39){return db[_0x476c('0x3c')][_0x476c('0xc1')]()[_0x476c('0x2c')](respondWithResult(_0x54ab39,null))['catch'](handleError(_0x54ab39,null));};exports['addMessage']=function(_0x34f6ab,_0x1b57ca,_0x1dec48){return db[_0x476c('0xc2')][_0x476c('0x65')]({'where':{'id':_0x34f6ab['params']['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x1b57ca,null))[_0x476c('0x2c')](function(_0x516f66){if(_0x516f66){return _0x516f66[_0x476c('0xc3')](_0x34f6ab[_0x476c('0xc0')][_0x476c('0xc4')],_[_0x476c('0xc5')](_0x34f6ab[_0x476c('0xc0')],[_0x476c('0xc4'),'id'])||{});}})[_0x476c('0x2c')](respondWithResult(_0x1b57ca,null))[_0x476c('0x3a')](handleError(_0x1b57ca,null));};exports[_0x476c('0xc6')]=function(_0x44231e,_0x3ef1d1,_0x2523e2){var _0xb9af69={'raw':![],'where':{}};var _0x5e3c7f={};var _0x2b5cde={'count':0x0,'rows':[]};return db[_0x476c('0x3c')][_0x476c('0xc7')]({'where':{'id':_0x44231e[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x3ef1d1,null))['then'](function(_0x5296ce){if(_0x5296ce){_0x5e3c7f['model']=_['keys'](db[_0x476c('0xc2')][_0x476c('0x3d')]);_0x5e3c7f[_0x476c('0x40')]=_[_0x476c('0x41')](_0x44231e[_0x476c('0x40')]);_0x5e3c7f[_0x476c('0x42')]=_[_0x476c('0x43')](_0x5e3c7f[_0x476c('0x44')],_0x5e3c7f[_0x476c('0x40')]);_0xb9af69[_0x476c('0x45')]=_[_0x476c('0x43')](_0x5e3c7f[_0x476c('0x44')],qs[_0x476c('0x46')](_0x44231e[_0x476c('0x40')]['fields']));_0xb9af69[_0x476c('0x45')]=_0xb9af69[_0x476c('0x45')]['length']?_0xb9af69[_0x476c('0x45')]:_0x5e3c7f[_0x476c('0x44')];if(!_0x44231e[_0x476c('0x40')][_0x476c('0xc8')](_0x476c('0x47'))){_0xb9af69[_0x476c('0x48')]=qs[_0x476c('0x48')](_0x44231e[_0x476c('0x40')][_0x476c('0x48')]);_0xb9af69['offset']=qs[_0x476c('0x24')](_0x44231e[_0x476c('0x40')][_0x476c('0x24')]);}_0xb9af69[_0x476c('0x95')]=qs[_0x476c('0x49')](_0x44231e[_0x476c('0x40')][_0x476c('0x49')]);_0xb9af69[_0x476c('0x4a')]=qs[_0x476c('0x42')](_[_0x476c('0xc9')](_0x44231e[_0x476c('0x40')],_0x5e3c7f[_0x476c('0x42')]));_0xb9af69['where'][_0x476c('0xb7')]=_0x5296ce['id'];if(_0x44231e['query'][_0x476c('0x88')]){_0xb9af69['where']=_[_0x476c('0xa2')](_0xb9af69[_0x476c('0x4a')],{'$or':_['map'](_0xb9af69[_0x476c('0x45')],function(_0x3178de){var _0x1bf4b1={};_0x1bf4b1[_0x3178de]={'$like':'%'+_0x44231e[_0x476c('0x40')][_0x476c('0x88')]+'%'};return _0x1bf4b1;})});}if(_0x44231e[_0x476c('0x40')][_0x476c('0xca')]){var _0x4e88e0=_0x44231e['query']['$gte'][_0x476c('0x37')](',');var _0x5b4dca={};_0x5b4dca[_0x4e88e0[0x0]]={'$gte':moment(_0x4e88e0[0x1])[_0x476c('0xcb')](_0x476c('0xcc'))};_0xb9af69[_0x476c('0x4a')]=_[_0x476c('0xa2')](_0xb9af69['where'],_0x5b4dca);}_0xb9af69=_[_0x476c('0xa2')]({},_0xb9af69,_0x44231e[_0x476c('0xbe')]);return db[_0x476c('0xc2')][_0x476c('0x26')]({'where':_0xb9af69[_0x476c('0x4a')]})[_0x476c('0x2c')](function(_0x3b16e5){_0x2b5cde[_0x476c('0x26')]=_0x3b16e5;if(_0x44231e[_0x476c('0x40')]['includeAll']){_0xb9af69[_0x476c('0xbd')]=[{'all':!![]}];}return db[_0x476c('0xc2')][_0x476c('0xcd')](_0xb9af69);})[_0x476c('0x2c')](function(_0x3ed6fe){_0x2b5cde[_0x476c('0xb9')]=_0x3ed6fe;return _0x2b5cde;});}})['then'](respondWithFilteredResult(_0x3ef1d1,_0xb9af69))[_0x476c('0x3a')](handleError(_0x3ef1d1,null));};exports['addTags']=function(_0x167d2d,_0x182fc1,_0x46ac5a){return db['OpenchannelInteraction']['find']({'where':{'id':_0x167d2d[_0x476c('0xbb')]['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x182fc1,null))['then'](function(_0x29829c){if(_0x29829c){return _0x29829c[_0x476c('0xce')](_0x167d2d['body'][_0x476c('0xc4')],_[_0x476c('0xc5')](_0x167d2d[_0x476c('0xc0')],[_0x476c('0xc4'),'id'])||{})[_0x476c('0xcf')](function(){return db[_0x476c('0xd0')][_0x476c('0xcd')]({'attributes':['id',_0x476c('0x4d'),_0x476c('0x4e')],'where':{'id':_0x167d2d[_0x476c('0xc0')][_0x476c('0xc4')]}});})['then'](function(_0x5c86dd){socket['emit'](_0x476c('0xd1'),{'id':Number(_0x167d2d['params']['id']),'tags':_0x5c86dd||[]});return{'id':Number(_0x167d2d[_0x476c('0xbb')]['id']),'tags':_0x5c86dd||[]};});}})[_0x476c('0x2c')](respondWithResult(_0x182fc1,null))[_0x476c('0x3a')](handleError(_0x182fc1,null));};exports[_0x476c('0xd2')]=function(_0x411268,_0x19766d,_0x3d4234){return db[_0x476c('0x3c')][_0x476c('0x65')]({'where':{'id':_0x411268['params']['id']}})[_0x476c('0x2c')](handleEntityNotFound(_0x19766d,null))[_0x476c('0x2c')](function(_0x54168c){if(_0x54168c){return _0x54168c['removeTags'](_0x411268[_0x476c('0x40')][_0x476c('0xc4')]);}})[_0x476c('0x2c')](respondWithStatusCode(_0x19766d,null))[_0x476c('0x3a')](handleError(_0x19766d,null));};exports['download']=function(_0x472334,_0x59f7d8){var _0xc6a92f=moment()[_0x476c('0xd3')]()['toString']();var _0xc2cb9a=path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),'files','tmp');var _0x3903ab=path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),_0x476c('0xd7'),_0x476c('0xd8'));var _0x27bb51=path[_0x476c('0xd4')](_0xc2cb9a,_0xc6a92f);var _0xb5d926=util[_0x476c('0xcb')]('transcript-%d-%s.zip',_0x472334[_0x476c('0xbb')]['id'],_0xc6a92f);var _0x5467f8=path[_0x476c('0xd4')](_0xc2cb9a,_0xb5d926);var _0x50cf2c=[];_0x50cf2c[_0x476c('0x39')]({'model':db[_0x476c('0x76')],'as':_0x476c('0x76'),'attributes':['id',_0x476c('0x34')],'raw':!![]});_0x50cf2c[_0x476c('0x39')]({'model':db[_0x476c('0xd9')],'as':_0x476c('0x69'),'attributes':['id',_0x476c('0xda'),'lastName'],'raw':!![]});if(_0x472334[_0x476c('0x40')][_0x476c('0xd8')]){_0x50cf2c[_0x476c('0x39')]({'model':db['Attachment'],'as':_0x476c('0xdb'),'raw':!![]});}var _0x525531=[{'model':db['OpenchannelMessage'],'as':_0x476c('0xdc'),'attributes':['id',_0x476c('0xc0'),_0x476c('0xdd'),_0x476c('0xde'),'secret',_0x476c('0x84')],'include':_0x50cf2c}];_0x525531[_0x476c('0x39')]({'model':db[_0x476c('0xdf')],'as':_0x476c('0xe0'),'attributes':['id',_0x476c('0x4d')]});_0x525531['push']({'model':db[_0x476c('0x76')],'as':'Owner','attributes':['id',_0x476c('0x34')]});return db['OpenchannelInteraction'][_0x476c('0x65')]({'where':{'id':_0x472334[_0x476c('0xbb')]['id']},'include':_0x525531})[_0x476c('0x2c')](handleEntityNotFound(_0x59f7d8,null))[_0x476c('0x2c')](function(_0x4717a4){if(_0x4717a4){var _0x359083=_0x4717a4[_0x476c('0xe1')]({'plain':!![]});fs[_0x476c('0xe2')](_0x27bb51);var _0x153b0e={'channel':'Openchannel','account':_0x359083['Account'][_0x476c('0x4d')],'agent':_0x359083[_0x476c('0xe3')]?_0x359083[_0x476c('0xe3')]['fullname']:_0x476c('0xe4'),'createdAt':moment(_0x359083[_0x476c('0xdd')])[_0x476c('0xcb')](_0x476c('0xcc'))[_0x476c('0xa1')](),'closedAt':_0x359083[_0x476c('0xe5')]?moment(_0x359083['closedAt'])[_0x476c('0xcb')](_0x476c('0xcc'))[_0x476c('0xa1')]():'','disposition':_0x359083[_0x476c('0xe6')],'visibility':_0x359083['threadId']?_0x476c('0xe7'):_0x476c('0xe8'),'messages':_(_0x359083[_0x476c('0xdc')])[_0x476c('0x88')]({'secret':![]})[_0x476c('0x33')](function(_0x501ca3){if(_0x501ca3[_0x476c('0xdb')]){var _0x4d186d=path[_0x476c('0xd4')](_0x3903ab,_0x501ca3[_0x476c('0xdb')]['basename']);if(fs['existsSync'](_0x4d186d)){fs['createReadStream'](_0x4d186d)[_0x476c('0xe9')](fs[_0x476c('0xea')](path[_0x476c('0xd4')](_0x27bb51,_0x501ca3[_0x476c('0xdb')][_0x476c('0xeb')])));}}return{'date':moment(_0x501ca3[_0x476c('0xdd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x476c('0xa1')](),'sender':_0x501ca3[_0x476c('0xde')]==='out'?_0x501ca3[_0x476c('0x76')]?_0x501ca3[_0x476c('0x76')][_0x476c('0x34')]:'System':_0x501ca3[_0x476c('0x69')][_0x476c('0xda')]+(_0x501ca3['Contact']['lastName']?'\x20'+_0x501ca3['Contact'][_0x476c('0xec')]:''),'body':_0x501ca3[_0x476c('0xdb')]?_0x501ca3['Attachment'][_0x476c('0xeb')]:_0x501ca3[_0x476c('0xc0')],'direction':_0x501ca3[_0x476c('0xde')]==='out'?'A':'C','secret':_0x501ca3[_0x476c('0xed')],'read':_0x501ca3[_0x476c('0x84')],'attachment':_0x501ca3['Attachment']};})[_0x476c('0x66')]()};return ejs['renderFile'](path[_0x476c('0xd4')](config[_0x476c('0xd5')],_0x476c('0xd6'),'views','downloadInteraction.ejs'),{'interaction':_0x153b0e})[_0x476c('0x2c')](function(_0x53fb86){var _0x4be4a5=path[_0x476c('0xd4')](_0x27bb51,_0x476c('0xee')+_0x359083['id']+'-'+_0xc6a92f+_0x476c('0xef'));var _0x51da90={'path':_0x4be4a5,'channel':_0x476c('0xf0'),'interactionId':_0x359083['id']};return pdf['createPdfFromHTML'](_0x53fb86,_0x51da90);})['then'](function(){return new BPromise(function(_0x508f74,_0xd5e3f5){zipdir(_0x27bb51,{'saveTo':_0x5467f8},function(_0x1a65f0,_0x5c02ef){if(_0x1a65f0)return _0xd5e3f5(_0x1a65f0);return _0x508f74(_0x5c02ef);});})[_0x476c('0x2c')](function(){return new BPromise(function(_0x3456e9,_0xe3bd1c){rimraf(_0x27bb51,function(_0x5c9106){if(_0x5c9106)_0xe3bd1c(_0x5c9106);return _0x3456e9();});});})[_0x476c('0x2c')](function(){return _0x59f7d8[_0x476c('0xf1')](_0x5467f8,_0xb5d926,function(_0x521e23){if(_0x521e23){console[_0x476c('0xf2')]('err',_0x521e23);}else{fs[_0x476c('0xf3')](_0x5467f8);}});});});}else{return _0x59f7d8['sendStatus'](0xc8);}})[_0x476c('0x3a')](handleError(_0x59f7d8,null));}; \ No newline at end of file +var _0x95c2=['defaults','redis','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','fullname','TagIds','split','forEach','catch','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','field','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','type','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','text','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','params','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','keys','hasOwnProperty','nolimit','format','includeAll','findAll','addTags','color','openchannelInteractionTags:save','removeTags','download','root','files','tmp','server','attachments','join','CmContact','lastName','Attachment','Messages','direction','secret','get','mkdirSync','Openchannel','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','existsSync','createReadStream','pipe','createWriteStream','out','firstName','basename','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','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','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment'];(function(_0x36d4f1,_0x1ec7dd){var _0x5d616c=function(_0x3bb920){while(--_0x3bb920){_0x36d4f1['push'](_0x36d4f1['shift']());}};_0x5d616c(++_0x1ec7dd);}(_0x95c2,0x1c2));var _0x295c=function(_0x5dfb10,_0x566254){_0x5dfb10=_0x5dfb10-0x0;var _0x4da618=_0x95c2[_0x5dfb10];return _0x4da618;};'use strict';var emlformat=require(_0x295c('0x0'));var rimraf=require(_0x295c('0x1'));var zipdir=require(_0x295c('0x2'));var jsonpatch=require(_0x295c('0x3'));var rp=require(_0x295c('0x4'));var moment=require(_0x295c('0x5'));var BPromise=require(_0x295c('0x6'));var Mustache=require('mustache');var util=require(_0x295c('0x7'));var path=require(_0x295c('0x8'));var sox=require(_0x295c('0x9'));var csv=require(_0x295c('0xa'));var ejs=require(_0x295c('0xb'));var fs=require('fs');var fs_extra=require(_0x295c('0xc'));var _=require(_0x295c('0xd'));var squel=require('squel');var crypto=require(_0x295c('0xe'));var jsforce=require(_0x295c('0xf'));var deskjs=require(_0x295c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x295c('0x11'));var Papa=require(_0x295c('0x12'));var Redis=require(_0x295c('0x13'));var authService=require(_0x295c('0x14'));var qs=require(_0x295c('0x15'));var as=require(_0x295c('0x16'));var pdf=require(_0x295c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x295c('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x295c('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x295c('0x1a')](config[_0x295c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x295c('0x1c'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x295c('0x1d')](socket);function respondWithStatusCode(_0x1c6c82,_0x4f809a){_0x4f809a=_0x4f809a||0xcc;return function(_0x5a777e){if(_0x5a777e){return _0x1c6c82['sendStatus'](_0x4f809a);}return _0x1c6c82[_0x295c('0x1e')](_0x4f809a)[_0x295c('0x1f')]();};}function respondWithResult(_0x568a84,_0x363cf2){_0x363cf2=_0x363cf2||0xc8;return function(_0x5f1052){if(_0x5f1052){return _0x568a84[_0x295c('0x1e')](_0x363cf2)[_0x295c('0x20')](_0x5f1052);}};}function respondWithFilteredResult(_0x877815,_0x1d1d81){return function(_0x1144a8){if(_0x1144a8){var _0x44f65d=typeof _0x1d1d81[_0x295c('0x21')]===_0x295c('0x22')&&typeof _0x1d1d81[_0x295c('0x23')]===_0x295c('0x22');var _0x55b6cb=_0x1144a8['count'];var _0x105c4c=_0x44f65d?0x0:_0x1d1d81[_0x295c('0x21')];var _0x454c9d=_0x44f65d?_0x1144a8[_0x295c('0x24')]:_0x1d1d81[_0x295c('0x21')]+_0x1d1d81[_0x295c('0x23')];var _0x4a5ce7;if(_0x454c9d>=_0x55b6cb){_0x454c9d=_0x55b6cb;_0x4a5ce7=0xc8;}else{_0x4a5ce7=0xce;}_0x877815['status'](_0x4a5ce7);return _0x877815[_0x295c('0x25')](_0x295c('0x26'),_0x105c4c+'-'+_0x454c9d+'/'+_0x55b6cb)['json'](_0x1144a8);}return null;};}function patchUpdates(_0x423c6b){return function(_0x2dd1ac){try{jsonpatch[_0x295c('0x27')](_0x2dd1ac,_0x423c6b,!![]);}catch(_0x3488a8){return BPromise[_0x295c('0x28')](_0x3488a8);}return _0x2dd1ac[_0x295c('0x29')]();};}function saveUpdates(_0x32bf60,_0x1cf662){return function(_0x55df20){if(_0x55df20){return _0x55df20[_0x295c('0x2a')](_0x32bf60)['then'](function(_0x10f12e){return _0x10f12e;});}return null;};}function removeEntity(_0x561482,_0x5ca75f){return function(_0x11df89){if(_0x11df89){return _0x11df89[_0x295c('0x2b')]()[_0x295c('0x2c')](function(){_0x561482[_0x295c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ebf55,_0x3036b4){return function(_0x48463c){if(!_0x48463c){_0x4ebf55[_0x295c('0x2d')](0x194);}return _0x48463c;};}function handleError(_0x339667,_0x3005cd){_0x3005cd=_0x3005cd||0x1f4;return function(_0x4ab7a3){logger[_0x295c('0x2e')](_0x4ab7a3[_0x295c('0x2f')]);if(_0x4ab7a3[_0x295c('0x30')]){delete _0x4ab7a3[_0x295c('0x30')];}_0x339667['status'](_0x3005cd)[_0x295c('0x31')](_0x4ab7a3);};}function getInteractionUsers(_0x5b2f42,_0x3d0dd0){return new BPromise(function(_0x5adb55,_0x575308){try{if(_0x3d0dd0[_0x5b2f42['id']]){_0x5b2f42['Users']=_[_0x295c('0x32')](_0x3d0dd0[_0x5b2f42['id']],function(_0x2dbf94){return{'id':_0x2dbf94['id'],'fullname':_0x2dbf94[_0x295c('0x33')]};});}}catch(_0x57a5b5){_0x575308(_0x57a5b5);}_0x5adb55(_0x5b2f42);});}function getInteractionTags(_0x22bbce,_0x48b5ad){return new BPromise(function(_0x29a7bb,_0x3bd003){try{if(_0x22bbce[_0x295c('0x34')]){_0x22bbce['Tags']=[];_0x22bbce[_0x295c('0x34')][_0x295c('0x35')](',')[_0x295c('0x36')](function(_0x2ccb92){_0x22bbce['Tags']['push'](_0x48b5ad[_0x2ccb92]);});}delete _0x22bbce[_0x295c('0x34')];}catch(_0x593664){_0x3bd003(_0x593664);}_0x29a7bb(_0x22bbce);});}function updateOpenchannelInteraction(_0x53fcdb,_0x3f95bf,_0x2ec3bd){return new BPromise(function(_0x52e2da,_0x194129){return getInteractionUsers(_0x53fcdb,_0x2ec3bd)[_0x295c('0x2c')](function(_0x23e37b){return getInteractionTags(_0x23e37b,_0x3f95bf);})[_0x295c('0x2c')](function(_0x22bed3){_0x52e2da(_0x22bed3);})[_0x295c('0x37')](function(_0x6ed791){_0x194129(_0x6ed791);});});}exports['index']=function(_0x318880,_0xc54a1){var _0x5fad1b={},_0x256baf={},_0x526500={'count':0x0,'rows':[]};var _0x1d1851=_[_0x295c('0x32')](db['OpenchannelInteraction'][_0x295c('0x38')],function(_0x1a2839){return{'name':_0x1a2839[_0x295c('0x39')],'type':_0x1a2839['type'][_0x295c('0x3a')]};});_0x256baf[_0x295c('0x3b')]=_[_0x295c('0x32')](_0x1d1851,_0x295c('0x30'));_0x256baf['query']=_['keys'](_0x318880[_0x295c('0x3c')]);_0x256baf['filters']=_[_0x295c('0x3d')](_0x256baf[_0x295c('0x3b')],_0x256baf[_0x295c('0x3c')]);_0x5fad1b[_0x295c('0x3e')]=_[_0x295c('0x3d')](_0x256baf[_0x295c('0x3b')],qs['fields'](_0x318880['query'][_0x295c('0x3f')]));_0x5fad1b[_0x295c('0x3e')]=_0x5fad1b[_0x295c('0x3e')][_0x295c('0x40')]?_0x5fad1b['attributes']:_0x256baf[_0x295c('0x3b')];if(!_0x318880[_0x295c('0x3c')]['hasOwnProperty']('nolimit')){_0x5fad1b[_0x295c('0x23')]=qs[_0x295c('0x23')](_0x318880[_0x295c('0x3c')][_0x295c('0x23')]);_0x5fad1b[_0x295c('0x21')]=qs['offset'](_0x318880[_0x295c('0x3c')][_0x295c('0x21')]);}_0x5fad1b[_0x295c('0x41')]=qs[_0x295c('0x42')](_0x318880[_0x295c('0x3c')][_0x295c('0x42')]);_0x5fad1b[_0x295c('0x43')]=qs[_0x295c('0x44')](_[_0x295c('0x45')](_0x318880[_0x295c('0x3c')],_0x256baf[_0x295c('0x44')]),_0x1d1851);var _0x45847c=[];var _0x3a95e2=squel['select']()[_0x295c('0x46')]('id')[_0x295c('0x46')](_0x295c('0x30'))[_0x295c('0x46')]('color')[_0x295c('0x47')](_0x295c('0x48'));var _0x45f502=squel[_0x295c('0x49')]()[_0x295c('0x46')]('u.id')['field'](_0x295c('0x4a'))['field'](_0x295c('0x4b'))[_0x295c('0x47')](_0x295c('0x4c'),'ui')[_0x295c('0x4d')]('users','u',_0x295c('0x4e'));var _0x4500cc=squel[_0x295c('0x49')]()[_0x295c('0x47')]('openchannel_interactions','i')[_0x295c('0x4d')](_0x295c('0x4f'),'c',_0x295c('0x50'))[_0x295c('0x4d')]('users','o',_0x295c('0x51'))[_0x295c('0x4d')](_0x295c('0x52'),'a',_0x295c('0x53'))[_0x295c('0x4d')](_0x295c('0x54'),'me',_0x295c('0x55'))[_0x295c('0x4d')](_0x295c('0x56'),'it',_0x295c('0x57'))[_0x295c('0x4d')](_0x295c('0x48'),'t',_0x295c('0x58'));var _0x39ecd2=squel[_0x295c('0x59')]();var _0x57ae93=[];var _0x5b5556=squel[_0x295c('0x59')]();var _0x1801f6;if(_0x318880[_0x295c('0x3c')][_0x295c('0x5a')]){_0x1801f6=as[_0x295c('0x5b')](_0x318880['query'][_0x295c('0x5a')]);var _0x36bb85=_0x1801f6[_0x295c('0x5c')];for(var _0x1d3597=0x0;_0x1d3597<_0x1801f6[_0x295c('0x5d')][_0x295c('0x40')];_0x1d3597++){var _0x403edc=_0x1801f6['conditions'][_0x1d3597];var _0x2fa234='i';var _0x4cdc04=_[_0x295c('0x5e')](_0x1d1851,[_0x295c('0x30'),_0x403edc['field']]);if(!_0x4cdc04){switch(_0x403edc['field']){case _0x295c('0x5f'):if(_0x403edc[_0x295c('0x60')]==0x1){_0x4500cc[_0x295c('0x61')]('`'+_0x403edc[_0x295c('0x46')]+_0x295c('0x62'));}else{_0x4500cc[_0x295c('0x61')]('`'+_0x403edc['field']+_0x295c('0x63'));}break;case _0x295c('0x64'):if(_0x403edc[_0x295c('0x65')]===_0x295c('0x66')){if(_0x403edc['value'][_0x295c('0x35')]('\x20')[_0x295c('0x40')]>0x1){_0x39ecd2[_0x36bb85]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x295c('0x67')](_0x403edc[_0x295c('0x60')]),null);}else{var _0x406967='%'+_0x403edc[_0x295c('0x60')]+'%';_0x39ecd2[_0x36bb85]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x406967,_0x406967,_0x406967);}}else{_0x4cdc04=_['find'](_0x1d1851,[_0x295c('0x30'),'ContactId']);_0x403edc[_0x295c('0x46')]=_0x295c('0x68');_0x36dba2=as['buildExpression'](_0x2fa234,_0x4cdc04[_0x295c('0x69')],_0x403edc);_0x39ecd2[_0x36bb85](_0x36dba2['text'],_0x36dba2[_0x295c('0x60')]['start'],_0x36dba2['value'][_0x295c('0x1f')]);}break;case _0x295c('0x6a'):var _0x332c85=_0x403edc[_0x295c('0x60')][_0x295c('0x35')](',')['map'](function(_0x351bc6){return Number(_0x351bc6);});_0x332c85['forEach'](function(_0x3d2272){_0x5b5556['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d2272+',%');});_0x57ae93=_['union'](_0x57ae93,_0x332c85);break;case _0x295c('0x6b'):if(_0x403edc['operator']===_0x295c('0x66')){_0x39ecd2[_0x36bb85](_0x295c('0x6c'),'%'+_0x403edc['value']+'%',null);}else{_0x4cdc04=_[_0x295c('0x5e')](_0x1d1851,[_0x295c('0x30'),_0x295c('0x6d')]);_0x403edc[_0x295c('0x46')]=_0x295c('0x6d');_0x36dba2=as[_0x295c('0x6e')](_0x2fa234,_0x4cdc04[_0x295c('0x69')],_0x403edc);_0x39ecd2[_0x36bb85](_0x36dba2['text'],_0x36dba2[_0x295c('0x60')]['start'],_0x36dba2[_0x295c('0x60')][_0x295c('0x1f')]);}break;case _0x295c('0x6f'):_0x36dba2=as[_0x295c('0x6e')]('me',null,_0x403edc);_0x39ecd2[_0x36bb85](_0x36dba2['text'],_0x36dba2['value']['start'],_0x36dba2[_0x295c('0x60')]['end']);break;}}else{var _0x36dba2=as[_0x295c('0x6e')](_0x2fa234,_0x4cdc04[_0x295c('0x69')],_0x403edc);_0x39ecd2[_0x36bb85](_0x36dba2[_0x295c('0x70')],_0x36dba2['value']['start'],_0x36dba2[_0x295c('0x60')][_0x295c('0x1f')]);}}}else{var _0x4394b6=_(_0x318880[_0x295c('0x3c')])['keys']()['map'](function(_0x5d6b9f){return _['some'](_0x1d1851,[_0x295c('0x30'),_0x5d6b9f])?_0x5d6b9f:undefined;})[_0x295c('0x71')]()[_0x295c('0x60')]();if(!_[_0x295c('0x72')](_0x4394b6)){_0x4394b6['forEach'](function(_0x4e1cbb){if(_0x4e1cbb===_0x295c('0x73')){_0x4500cc[_0x295c('0x43')](_0x295c('0x74'),[]['concat'](_0x318880['query'][_0x4e1cbb]));}else if(_0x4e1cbb===_0x295c('0x75')){var _0x50875d=JSON[_0x295c('0x76')](_0x318880[_0x295c('0x3c')][_0x4e1cbb])[_0x295c('0x77')];var _0x7c0079=JSON['parse'](_0x318880[_0x295c('0x3c')][_0x4e1cbb])[_0x295c('0x78')];_0x4500cc[_0x295c('0x43')](_0x295c('0x79'),_0x50875d,_0x7c0079);}else{if(_0x318880[_0x295c('0x3c')][_0x4e1cbb]==='null'){_0x4500cc[_0x295c('0x43')]('i.'+_0x4e1cbb+_0x295c('0x7a'));}else{_0x4500cc[_0x295c('0x43')]('i.'+_0x4e1cbb+'\x20=\x20?',_0x318880['query'][_0x4e1cbb]);}}});}if(_0x318880[_0x295c('0x3c')][_0x295c('0x7b')]){if(_0x318880[_0x295c('0x3c')]['read']==0x1){_0x4500cc[_0x295c('0x61')](_0x295c('0x7c'));}else{_0x4500cc[_0x295c('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x318880[_0x295c('0x3c')][_0x295c('0x7d')]){_0x57ae93=_[_0x295c('0x7e')](_0x318880['query']['tag'])?_0x318880['query']['tag']:new Array(_0x318880['query'][_0x295c('0x7d')]);_0x57ae93[_0x295c('0x36')](function(_0x4f09e1){_0x5b5556['or'](_0x295c('0x7f'),'%,'+_0x4f09e1+',%');});}if(_0x318880[_0x295c('0x3c')][_0x295c('0x80')]){var _0x4a5d29=_0x318880[_0x295c('0x3c')][_0x295c('0x80')][_0x295c('0x81')]('\x5c','\x5c\x5c')[_0x295c('0x81')](/'/g,'\x27\x27');if(qs[_0x295c('0x82')](_0x4a5d29)){_0x39ecd2['or'](_0x295c('0x83'),_0x4a5d29+'%');}else{_0x39ecd2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x295c('0x67')](_0x4a5d29))['or'](_0x295c('0x84'),_0x4a5d29+'%')['or'](_0x295c('0x85'),_0x4a5d29+'%');}}}_0x4500cc[_0x295c('0x43')](_0x39ecd2);_0x4500cc[_0x295c('0x86')](_0x295c('0x87'));var _0x1c2b3e={'type':db[_0x295c('0x88')][_0x295c('0x89')][_0x295c('0x8a')],'raw':!![]};var _0x900191=_0x4500cc[_0x295c('0x8b')]();_0x900191['field'](_0x295c('0x87'));_0x900191['field'](_0x295c('0x8c'),_0x295c('0x5f'));if(_0x5fad1b[_0x295c('0x41')]){_0x5fad1b[_0x295c('0x41')][_0x295c('0x36')](function(_0xe13400){var _0x1137fe=_0xe13400[0x0]===_0x295c('0x8d')?_0xe13400[0x0]:'i.'+_0xe13400[0x0];_0x4500cc[_0x295c('0x41')](_0x1137fe,_0xe13400[0x1]===_0x295c('0x8e')?![]:!![]);});}if(!_[_0x295c('0x72')](_0x57ae93)){_0x4500cc[_0x295c('0x61')](_0x5b5556);_0x900191[_0x295c('0x43')](_0x295c('0x8f'),_0x57ae93);}BPromise[_0x295c('0x90')]()[_0x295c('0x2c')](function(){if(!_0x1801f6){if(_0x318880['query'][_0x295c('0x73')])return;_0x900191[_0x295c('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x4500cc[_0x295c('0x43')](_0x295c('0x91'));return;}if(_0x318880[_0x295c('0x92')][_0x295c('0x93')]!==_0x295c('0x94'))return;return _0x318880[_0x295c('0x92')][_0x295c('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4ff654){if(_[_0x295c('0x72')](_0x4ff654)){_0x900191[_0x295c('0x43')](_0x295c('0x96'));_0x4500cc[_0x295c('0x43')](_0x295c('0x96'));}else{_0x900191[_0x295c('0x43')](_0x295c('0x74'),_[_0x295c('0x32')](_0x4ff654,'id'));_0x4500cc[_0x295c('0x43')](_0x295c('0x74'),_[_0x295c('0x32')](_0x4ff654,'id'));}});})[_0x295c('0x2c')](function(){if(_0x318880['user'][_0x295c('0x93')]===_0x295c('0x94')&&!_0x1801f6&&!_0x318880[_0x295c('0x3c')][_0x295c('0x73')])return[];return db[_0x295c('0x97')][_0x295c('0x3c')](_0x900191[_0x295c('0x98')](),_0x1c2b3e);})[_0x295c('0x2c')](function(_0x1a6d83){_0x526500[_0x295c('0x24')]=_0x1a6d83[_0x295c('0x40')];if(_0x526500[_0x295c('0x24')]===0x0)return[];return db[_0x295c('0x97')][_0x295c('0x3c')](_0x3a95e2[_0x295c('0x98')](),_0x1c2b3e)['then'](function(_0x269310){_0x45847c=_['keyBy'](_0x269310,'id');_0x1c2b3e=_[_0x295c('0x99')](_0x1c2b3e,{'model':db[_0x295c('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x318880['query']['fields']){_0x5fad1b[_0x295c('0x3e')][_0x295c('0x36')](function(_0x8a505f){_0x4500cc['field']('i.'+_0x8a505f);});}else{_0x4500cc[_0x295c('0x46')](_0x295c('0x8c'),'unreadMessages');_0x4500cc[_0x295c('0x46')](_0x295c('0x9b'),'Account.key');_0x4500cc['field'](_0x295c('0x9c'),_0x295c('0x9d'));_0x4500cc[_0x295c('0x46')](_0x295c('0x9e'),'contactName');_0x4500cc[_0x295c('0x46')](_0x295c('0x9f'));_0x4500cc[_0x295c('0x46')](_0x295c('0xa0'),_0x295c('0xa1'));_0x4500cc[_0x295c('0x46')](_0x295c('0xa2'),_0x295c('0xa3'));_0x4500cc[_0x295c('0x46')](_0x295c('0xa4'),_0x295c('0xa5'));_0x4500cc[_0x295c('0x46')]('c.phone','Contact.phone');_0x4500cc[_0x295c('0x46')]('c.mobile','Contact.mobile');_0x4500cc['field'](_0x295c('0xa6'),_0x295c('0xa7'));_0x4500cc[_0x295c('0x46')](_0x295c('0xa8'),_0x295c('0xa9'));_0x4500cc[_0x295c('0x46')]('o.internal',_0x295c('0xaa'));_0x4500cc['field'](_0x295c('0xab'),_0x295c('0x34'));}if(_0x5fad1b['limit'])_0x4500cc['limit'](_0x5fad1b['limit']);if(_0x5fad1b[_0x295c('0x21')])_0x4500cc[_0x295c('0x21')](_0x5fad1b[_0x295c('0x21')]);return db[_0x295c('0x97')]['query'](_0x4500cc[_0x295c('0x98')](),_0x1c2b3e);})[_0x295c('0x2c')](function(_0x147f2f){if(_0x147f2f[_0x295c('0x40')]>0x0)_0x45f502['where'](_0x295c('0xac'),_[_0x295c('0x32')](_0x147f2f,'id'));return db['sequelize'][_0x295c('0x3c')](_0x45f502[_0x295c('0x98')](),_0x1c2b3e)[_0x295c('0x2c')](function(_0x3f4091){var _0x15aa14=_[_0x295c('0xad')](_0x3f4091,_0x295c('0xae'));var _0x42e257=[];_0x147f2f[_0x295c('0x36')](function(_0x3aaff0){_0x42e257[_0x295c('0xaf')](updateOpenchannelInteraction(_0x3aaff0,_0x45847c,_0x15aa14));});return BPromise[_0x295c('0xb0')](_0x42e257);});});})[_0x295c('0x2c')](function(_0x3e16f0){_0x526500[_0x295c('0xb1')]=_0x3e16f0;return _0x526500;})['then'](respondWithFilteredResult(_0xc54a1,_0x5fad1b))['catch'](handleError(_0xc54a1,null));};exports['show']=function(_0x2fbd0e,_0x132379){var _0x15a0cc={};if(_0x2fbd0e[_0x295c('0x3c')][_0x295c('0x69')]&&_0x2fbd0e[_0x295c('0x3c')]['type']==='from'){_0x15a0cc[_0x295c('0x47')]=_0x2fbd0e[_0x295c('0xb2')]['id'];}else{_0x15a0cc['id']=_0x2fbd0e[_0x295c('0xb2')]['id'];}var _0x20b4aa={'raw':![],'where':_0x15a0cc},_0x417268={};_0x417268['model']=_['keys'](db['OpenchannelInteraction'][_0x295c('0x38')]);_0x417268[_0x295c('0x3c')]=_['keys'](_0x2fbd0e[_0x295c('0x3c')]);_0x417268[_0x295c('0x44')]=_[_0x295c('0x3d')](_0x417268[_0x295c('0x3b')],_0x417268[_0x295c('0x3c')]);_0x20b4aa[_0x295c('0x3e')]=_['intersection'](_0x417268['model'],qs[_0x295c('0x3f')](_0x2fbd0e[_0x295c('0x3c')][_0x295c('0x3f')]));_0x20b4aa['attributes']=_0x20b4aa[_0x295c('0x3e')][_0x295c('0x40')]?_0x20b4aa[_0x295c('0x3e')]:_0x417268[_0x295c('0x3b')];if(_0x2fbd0e['query']['includeAll']){_0x20b4aa[_0x295c('0xb3')]=[{'all':!![]}];}_0x20b4aa=_[_0x295c('0x99')]({},_0x20b4aa,_0x2fbd0e[_0x295c('0xb4')]);return db['OpenchannelInteraction']['find'](_0x20b4aa)['then'](handleEntityNotFound(_0x132379,null))[_0x295c('0x2c')](respondWithResult(_0x132379,null))['catch'](handleError(_0x132379,null));};exports[_0x295c('0xb5')]=function(_0x4a98f1,_0x3475d6){return db['OpenchannelInteraction'][_0x295c('0xb5')](_0x4a98f1['body'],{})[_0x295c('0x2c')](respondWithResult(_0x3475d6,0xc9))[_0x295c('0x37')](handleError(_0x3475d6,null));};exports[_0x295c('0x2a')]=function(_0x408288,_0x297247){if(_0x408288[_0x295c('0x6f')]['id']){delete _0x408288[_0x295c('0x6f')]['id'];}return db[_0x295c('0x9a')][_0x295c('0x5e')]({'where':{'id':_0x408288['params']['id']}})[_0x295c('0x2c')](handleEntityNotFound(_0x297247,null))[_0x295c('0x2c')](saveUpdates(_0x408288['body'],null))[_0x295c('0x2c')](respondWithResult(_0x297247,null))[_0x295c('0x37')](handleError(_0x297247,null));};exports[_0x295c('0x2b')]=function(_0x5d7beb,_0x10c8dd){return db[_0x295c('0x9a')][_0x295c('0x5e')]({'where':{'id':_0x5d7beb[_0x295c('0xb2')]['id']}})['then'](handleEntityNotFound(_0x10c8dd,null))[_0x295c('0x2c')](removeEntity(_0x10c8dd,null))[_0x295c('0x37')](handleError(_0x10c8dd,null));};exports[_0x295c('0xb6')]=function(_0x30fe91,_0x6004f0){return db[_0x295c('0x9a')][_0x295c('0xb6')]()[_0x295c('0x2c')](respondWithResult(_0x6004f0,null))[_0x295c('0x37')](handleError(_0x6004f0,null));};exports['addMessage']=function(_0x5ea2e6,_0x49c896,_0x4e6fe2){return db['OpenchannelMessage']['find']({'where':{'id':_0x5ea2e6[_0x295c('0xb2')]['id']}})[_0x295c('0x2c')](handleEntityNotFound(_0x49c896,null))[_0x295c('0x2c')](function(_0x3491b9){if(_0x3491b9){return _0x3491b9[_0x295c('0xb7')](_0x5ea2e6[_0x295c('0x6f')][_0x295c('0xb8')],_[_0x295c('0xb9')](_0x5ea2e6[_0x295c('0x6f')],[_0x295c('0xb8'),'id'])||{});}})[_0x295c('0x2c')](respondWithResult(_0x49c896,null))[_0x295c('0x37')](handleError(_0x49c896,null));};exports[_0x295c('0xba')]=function(_0x379e79,_0x212b04,_0x1844f4){var _0x3a1886={'raw':![],'where':{}};var _0xdd6bbb={};var _0x285b40={'count':0x0,'rows':[]};return db[_0x295c('0x9a')][_0x295c('0xbb')]({'where':{'id':_0x379e79['params']['id']}})[_0x295c('0x2c')](handleEntityNotFound(_0x212b04,null))[_0x295c('0x2c')](function(_0x172013){if(_0x172013){_0xdd6bbb['model']=_['keys'](db[_0x295c('0xbc')][_0x295c('0x38')]);_0xdd6bbb[_0x295c('0x3c')]=_[_0x295c('0xbd')](_0x379e79['query']);_0xdd6bbb['filters']=_[_0x295c('0x3d')](_0xdd6bbb[_0x295c('0x3b')],_0xdd6bbb[_0x295c('0x3c')]);_0x3a1886[_0x295c('0x3e')]=_[_0x295c('0x3d')](_0xdd6bbb['model'],qs[_0x295c('0x3f')](_0x379e79['query'][_0x295c('0x3f')]));_0x3a1886['attributes']=_0x3a1886['attributes'][_0x295c('0x40')]?_0x3a1886['attributes']:_0xdd6bbb[_0x295c('0x3b')];if(!_0x379e79[_0x295c('0x3c')][_0x295c('0xbe')](_0x295c('0xbf'))){_0x3a1886['limit']=qs[_0x295c('0x23')](_0x379e79[_0x295c('0x3c')][_0x295c('0x23')]);_0x3a1886['offset']=qs[_0x295c('0x21')](_0x379e79[_0x295c('0x3c')][_0x295c('0x21')]);}_0x3a1886[_0x295c('0x41')]=qs['sort'](_0x379e79[_0x295c('0x3c')][_0x295c('0x42')]);_0x3a1886['where']=qs[_0x295c('0x44')](_[_0x295c('0x45')](_0x379e79[_0x295c('0x3c')],_0xdd6bbb[_0x295c('0x44')]));_0x3a1886['where'][_0x295c('0xae')]=_0x172013['id'];if(_0x379e79[_0x295c('0x3c')][_0x295c('0x80')]){_0x3a1886[_0x295c('0x43')]=_[_0x295c('0x99')](_0x3a1886[_0x295c('0x43')],{'$or':_[_0x295c('0x32')](_0x3a1886[_0x295c('0x3e')],function(_0x154239){var _0x59e42f={};_0x59e42f[_0x154239]={'$like':'%'+_0x379e79[_0x295c('0x3c')][_0x295c('0x80')]+'%'};return _0x59e42f;})});}if(_0x379e79['query'][_0x295c('0x77')]){var _0x4ae5f9=_0x379e79[_0x295c('0x3c')][_0x295c('0x77')][_0x295c('0x35')](',');var _0x402aef={};_0x402aef[_0x4ae5f9[0x0]]={'$gte':moment(_0x4ae5f9[0x1])[_0x295c('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3a1886[_0x295c('0x43')]=_[_0x295c('0x99')](_0x3a1886[_0x295c('0x43')],_0x402aef);}_0x3a1886=_[_0x295c('0x99')]({},_0x3a1886,_0x379e79[_0x295c('0xb4')]);return db[_0x295c('0xbc')]['count']({'where':_0x3a1886[_0x295c('0x43')]})[_0x295c('0x2c')](function(_0x3b768b){_0x285b40[_0x295c('0x24')]=_0x3b768b;if(_0x379e79[_0x295c('0x3c')][_0x295c('0xc1')]){_0x3a1886['include']=[{'all':!![]}];}return db[_0x295c('0xbc')][_0x295c('0xc2')](_0x3a1886);})[_0x295c('0x2c')](function(_0x39d584){_0x285b40['rows']=_0x39d584;return _0x285b40;});}})[_0x295c('0x2c')](respondWithFilteredResult(_0x212b04,_0x3a1886))['catch'](handleError(_0x212b04,null));};exports[_0x295c('0xc3')]=function(_0x5ba704,_0x214cf5,_0xd2cc54){return db['OpenchannelInteraction'][_0x295c('0x5e')]({'where':{'id':_0x5ba704['params']['id']}})[_0x295c('0x2c')](handleEntityNotFound(_0x214cf5,null))[_0x295c('0x2c')](function(_0x3f765f){if(_0x3f765f){return _0x3f765f['setTags'](_0x5ba704[_0x295c('0x6f')][_0x295c('0xb8')],_[_0x295c('0xb9')](_0x5ba704[_0x295c('0x6f')],[_0x295c('0xb8'),'id'])||{})['spread'](function(){return db[_0x295c('0x6a')][_0x295c('0xc2')]({'attributes':['id',_0x295c('0x30'),_0x295c('0xc4')],'where':{'id':_0x5ba704[_0x295c('0x6f')][_0x295c('0xb8')]}});})[_0x295c('0x2c')](function(_0x1128ee){socket['emit'](_0x295c('0xc5'),{'id':Number(_0x5ba704[_0x295c('0xb2')]['id']),'tags':_0x1128ee||[]});return{'id':Number(_0x5ba704[_0x295c('0xb2')]['id']),'tags':_0x1128ee||[]};});}})[_0x295c('0x2c')](respondWithResult(_0x214cf5,null))[_0x295c('0x37')](handleError(_0x214cf5,null));};exports['removeTags']=function(_0x400757,_0x2aa912,_0x3443ad){return db['OpenchannelInteraction'][_0x295c('0x5e')]({'where':{'id':_0x400757[_0x295c('0xb2')]['id']}})[_0x295c('0x2c')](handleEntityNotFound(_0x2aa912,null))['then'](function(_0x43239a){if(_0x43239a){return _0x43239a[_0x295c('0xc6')](_0x400757[_0x295c('0x3c')]['ids']);}})[_0x295c('0x2c')](respondWithStatusCode(_0x2aa912,null))[_0x295c('0x37')](handleError(_0x2aa912,null));};exports[_0x295c('0xc7')]=function(_0x6b8ff5,_0x5a5ca9){var _0x3c4a2b=moment()['unix']()[_0x295c('0x98')]();var _0x5ee4e8=path['join'](config[_0x295c('0xc8')],'server',_0x295c('0xc9'),_0x295c('0xca'));var _0x1fbd31=path['join'](config[_0x295c('0xc8')],_0x295c('0xcb'),_0x295c('0xc9'),_0x295c('0xcc'));var _0x5ae9dc=path[_0x295c('0xcd')](_0x5ee4e8,_0x3c4a2b);var _0x30bbeb=util['format']('transcript-%d-%s.zip',_0x6b8ff5[_0x295c('0xb2')]['id'],_0x3c4a2b);var _0x2212f6=path[_0x295c('0xcd')](_0x5ee4e8,_0x30bbeb);var _0x17bad1=[];_0x17bad1[_0x295c('0xaf')]({'model':db['User'],'as':_0x295c('0x6b'),'attributes':['id',_0x295c('0x33')],'raw':!![]});_0x17bad1[_0x295c('0xaf')]({'model':db[_0x295c('0xce')],'as':_0x295c('0x64'),'attributes':['id','firstName',_0x295c('0xcf')],'raw':!![]});if(_0x6b8ff5['query']['attachments']){_0x17bad1['push']({'model':db['Attachment'],'as':_0x295c('0xd0'),'raw':!![]});}var _0x52c278=[{'model':db[_0x295c('0xbc')],'as':_0x295c('0xd1'),'attributes':['id',_0x295c('0x6f'),'createdAt',_0x295c('0xd2'),_0x295c('0xd3'),_0x295c('0x7b')],'include':_0x17bad1}];_0x52c278[_0x295c('0xaf')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x52c278[_0x295c('0xaf')]({'model':db[_0x295c('0x6b')],'as':'Owner','attributes':['id',_0x295c('0x33')]});return db['OpenchannelInteraction'][_0x295c('0x5e')]({'where':{'id':_0x6b8ff5[_0x295c('0xb2')]['id']},'include':_0x52c278})[_0x295c('0x2c')](handleEntityNotFound(_0x5a5ca9,null))[_0x295c('0x2c')](function(_0x1d6790){if(_0x1d6790){var _0x527441=_0x1d6790[_0x295c('0xd4')]({'plain':!![]});fs[_0x295c('0xd5')](_0x5ae9dc);var _0x40e67b={'channel':_0x295c('0xd6'),'account':_0x527441[_0x295c('0xd7')][_0x295c('0x30')],'agent':_0x527441['Owner']?_0x527441[_0x295c('0xd8')]['fullname']:_0x295c('0xd9'),'createdAt':moment(_0x527441[_0x295c('0x75')])['format'](_0x295c('0xda'))[_0x295c('0x98')](),'closedAt':_0x527441[_0x295c('0xdb')]?moment(_0x527441[_0x295c('0xdc')])[_0x295c('0xc0')](_0x295c('0xda'))[_0x295c('0x98')]():'','disposition':_0x527441[_0x295c('0xdd')],'visibility':_0x527441[_0x295c('0xde')]?_0x295c('0xdf'):'Private','messages':_(_0x527441[_0x295c('0xd1')])['filter']({'secret':![]})[_0x295c('0x32')](function(_0xabf8f0){if(_0xabf8f0['Attachment']){var _0x29299c=path[_0x295c('0xcd')](_0x1fbd31,_0xabf8f0[_0x295c('0xd0')]['basename']);if(fs[_0x295c('0xe0')](_0x29299c)){fs[_0x295c('0xe1')](_0x29299c)[_0x295c('0xe2')](fs[_0x295c('0xe3')](path[_0x295c('0xcd')](_0x5ae9dc,_0xabf8f0[_0x295c('0xd0')]['basename'])));}}return{'date':moment(_0xabf8f0[_0x295c('0x75')])[_0x295c('0xc0')](_0x295c('0xda'))[_0x295c('0x98')](),'sender':_0xabf8f0[_0x295c('0xd2')]===_0x295c('0xe4')?_0xabf8f0[_0x295c('0x6b')]?_0xabf8f0[_0x295c('0x6b')][_0x295c('0x33')]:'System':_0xabf8f0[_0x295c('0x64')][_0x295c('0xe5')]+(_0xabf8f0['Contact'][_0x295c('0xcf')]?'\x20'+_0xabf8f0[_0x295c('0x64')][_0x295c('0xcf')]:''),'body':_0xabf8f0[_0x295c('0xd0')]?_0xabf8f0[_0x295c('0xd0')][_0x295c('0xe6')]:_0xabf8f0[_0x295c('0x6f')],'direction':_0xabf8f0['direction']===_0x295c('0xe4')?'A':'C','secret':_0xabf8f0[_0x295c('0xd3')],'read':_0xabf8f0[_0x295c('0x7b')],'attachment':_0xabf8f0[_0x295c('0xd0')]};})[_0x295c('0x60')]()};return ejs[_0x295c('0xe7')](path[_0x295c('0xcd')](config[_0x295c('0xc8')],'server',_0x295c('0xe8'),_0x295c('0xe9')),{'interaction':_0x40e67b})['then'](function(_0x549f50){var _0x217e57=path[_0x295c('0xcd')](_0x5ae9dc,_0x295c('0xea')+_0x527441['id']+'-'+_0x3c4a2b+_0x295c('0xeb'));var _0x58bec0={'path':_0x217e57,'channel':_0x295c('0xd6'),'interactionId':_0x527441['id']};return pdf['createPdfFromHTML'](_0x549f50,_0x58bec0);})[_0x295c('0x2c')](function(){return new BPromise(function(_0x50786e,_0x1348e7){zipdir(_0x5ae9dc,{'saveTo':_0x2212f6},function(_0x3c79d0,_0x9dea32){if(_0x3c79d0)return _0x1348e7(_0x3c79d0);return _0x50786e(_0x9dea32);});})[_0x295c('0x2c')](function(){return new BPromise(function(_0x218041,_0x103d7f){rimraf(_0x5ae9dc,function(_0x589cd6){if(_0x589cd6)_0x103d7f(_0x589cd6);return _0x218041();});});})[_0x295c('0x2c')](function(){return _0x5a5ca9['download'](_0x2212f6,_0x30bbeb,function(_0x9a4f6a){if(_0x9a4f6a){console['log'](_0x295c('0xec'),_0x9a4f6a);}else{fs[_0x295c('0xed')](_0x2212f6);}});});});}else{return _0x5a5ca9[_0x295c('0x2d')](0xc8);}})[_0x295c('0x37')](handleError(_0x5a5ca9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index fa0a886..13eb5d1 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 _0xad0a=['length','emit','hook','exports','events','OpenchannelInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x50cd70,_0x505afc){var _0x399f46=function(_0x3664e0){while(--_0x3664e0){_0x50cd70['push'](_0x50cd70['shift']());}};_0x399f46(++_0x505afc);}(_0xad0a,0xe1));var _0xaad0=function(_0xc19ba8,_0x21716a){_0xc19ba8=_0xc19ba8-0x0;var _0x500e54=_0xad0a[_0xc19ba8];return _0x500e54;};'use strict';var EventEmitter=require(_0xaad0('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xaad0('0x1')];var OpenchannelMessage=require(_0xaad0('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xaad0('0x3')](0x0);var events={'afterCreate':_0xaad0('0x4'),'afterUpdate':_0xaad0('0x5'),'afterDestroy':_0xaad0('0x6')};function emitEvent(_0x5423a4){return function(_0x3b094b,_0x14d81a,_0x2cc4b1){_0x3b094b['getUsers']({'attributes':['id'],'raw':!![]})[_0xaad0('0x7')](function(_0x57dc7c){_0x3b094b[_0xaad0('0x8')](_0xaad0('0x9'),_0x57dc7c[_0xaad0('0xa')](function(_0x2ee993){return{'id':_0x2ee993['id']};}));return OpenchannelMessage[_0xaad0('0xb')]({'where':{'OpenchannelInteractionId':_0x3b094b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaad0('0x7')](function(_0x4dc0b7){_0x3b094b[_0xaad0('0x8')](_0xaad0('0xc'),_0x4dc0b7[_0xaad0('0xd')]);OpenchannelInteractionEvents[_0xaad0('0xe')](_0x5423a4+':'+_0x3b094b['id'],_0x3b094b);OpenchannelInteractionEvents['emit'](_0x5423a4,_0x3b094b);_0x2cc4b1(null);})['catch'](_0x2cc4b1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xaad0('0xf')](e,emitEvent(event));}}module[_0xaad0('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xfbed=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x5343e8,_0x50301f){var _0x3a0ffe=function(_0x32bbd1){while(--_0x32bbd1){_0x5343e8['push'](_0x5343e8['shift']());}};_0x3a0ffe(++_0x50301f);}(_0xfbed,0x170));var _0xdfbe=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xfbed[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0xdfbe('0x0'));var OpenchannelInteraction=require(_0xdfbe('0x1'))['db'][_0xdfbe('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xdfbe('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdfbe('0x4')](0x0);var events={'afterCreate':_0xdfbe('0x5'),'afterUpdate':_0xdfbe('0x6'),'afterDestroy':_0xdfbe('0x7')};function emitEvent(_0x5064ea){return function(_0x7e5445,_0x1b53db,_0x3750d0){_0x7e5445[_0xdfbe('0x8')]({'attributes':['id'],'raw':!![]})[_0xdfbe('0x9')](function(_0x4a4987){_0x7e5445[_0xdfbe('0xa')](_0xdfbe('0xb'),_0x4a4987[_0xdfbe('0xc')](function(_0x504991){return{'id':_0x504991['id']};}));return OpenchannelMessage[_0xdfbe('0xd')]({'where':{'OpenchannelInteractionId':_0x7e5445['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2d7431){_0x7e5445[_0xdfbe('0xa')](_0xdfbe('0xe'),_0x2d7431[_0xdfbe('0xf')]);OpenchannelInteractionEvents[_0xdfbe('0x10')](_0x5064ea+':'+_0x7e5445['id'],_0x7e5445);OpenchannelInteractionEvents[_0xdfbe('0x10')](_0x5064ea,_0x7e5445);_0x3750d0(null);})[_0xdfbe('0x11')](_0x3750d0(null));};}for(var e in events){if(events[_0xdfbe('0x12')](e)){var event=events[e];OpenchannelInteraction[_0xdfbe('0x13')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3738f4f..a41be0b 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 _0x8451=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','rimraf','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','changed','closed','closedAt','format'];(function(_0x9aedb0,_0x1ddf6f){var _0x145a61=function(_0x4be476){while(--_0x4be476){_0x9aedb0['push'](_0x9aedb0['shift']());}};_0x145a61(++_0x1ddf6f);}(_0x8451,0x100));var _0x1845=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8451[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x1845('0x0'));var util=require(_0x1845('0x1'));var logger=require(_0x1845('0x2'))('api');var moment=require(_0x1845('0x3'));var BPromise=require('bluebird');var rp=require(_0x1845('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1845('0x5'));var config=require('../../config/environment');var attributes=require(_0x1845('0x6'));module['exports']=function(_0x222175,_0x310ff9){return _0x222175[_0x1845('0x7')]('OpenchannelInteraction',attributes,{'tableName':_0x1845('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1845('0x9'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x22c513,_0x52093f,_0x451163){if(_0x22c513[_0x1845('0xa')](_0x1845('0xb'))){_0x22c513[_0x1845('0xc')]=moment()[_0x1845('0xd')](_0x1845('0xe'));}_0x451163(null,_0x22c513);}}});}; \ No newline at end of file +var _0xa03d=['../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x17e3c4,_0x821010){var _0x2211b9=function(_0x33ab42){while(--_0x33ab42){_0x17e3c4['push'](_0x17e3c4['shift']());}};_0x2211b9(++_0x821010);}(_0xa03d,0x1e7));var _0xda03=function(_0x5d196c,_0xb8c0c8){_0x5d196c=_0x5d196c-0x0;var _0x8b0c52=_0xa03d[_0x5d196c];return _0x8b0c52;};'use strict';var _=require('lodash');var util=require(_0xda03('0x0'));var logger=require(_0xda03('0x1'))('api');var moment=require(_0xda03('0x2'));var BPromise=require(_0xda03('0x3'));var rp=require(_0xda03('0x4'));var fs=require('fs');var path=require(_0xda03('0x5'));var rimraf=require('rimraf');var config=require(_0xda03('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0xda03('0x7')]=function(_0x2ec20a,_0x1f800b){return _0x2ec20a[_0xda03('0x8')](_0xda03('0x9'),attributes,{'tableName':_0xda03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda03('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x36f5a9,_0x345997,_0xe0e238){if(_0x36f5a9[_0xda03('0xc')](_0xda03('0xd'))){_0x36f5a9[_0xda03('0xe')]=moment()[_0xda03('0xf')](_0xda03('0x10'));}_0xe0e238(null,_0x36f5a9);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4651682..cee1508 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 _0xdf5e=['message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d884d,_0x23fab6){var _0x7fa4ba=function(_0x33ff08){while(--_0x33ff08){_0x1d884d['push'](_0x1d884d['shift']());}};_0x7fa4ba(++_0x23fab6);}(_0xdf5e,0x130));var _0xedf5=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xdf5e[_0x54d4a8];return _0x3b321b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xedf5('0x0'));var BPromise=require(_0xedf5('0x1'));var rs=require(_0xedf5('0x2'));var fs=require('fs');var Redis=require(_0xedf5('0x3'));var db=require(_0xedf5('0x4'))['db'];var utils=require(_0xedf5('0x5'));var logger=require(_0xedf5('0x6'))(_0xedf5('0x7'));var config=require(_0xedf5('0x8'));var jayson=require(_0xedf5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xedf5('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xedf5('0xb'))(new Redis(config['redis']));require(_0xedf5('0xc'))[_0xedf5('0xd')](socket);function respondWithRpcPromise(_0x14e22d,_0x2b341c,_0xad29a0){return new BPromise(function(_0x193a20,_0xa7a51f){return client[_0xedf5('0xe')](_0x14e22d,_0xad29a0)[_0xedf5('0xf')](function(_0x5f19af){logger[_0xedf5('0x10')](_0xedf5('0x11'),_0x2b341c,_0xedf5('0x12'));logger[_0xedf5('0x13')](_0xedf5('0x14'),_0x2b341c,_0xedf5('0x12'),JSON[_0xedf5('0x15')](_0x5f19af));if(_0x5f19af[_0xedf5('0x16')]){if(_0x5f19af['error'][_0xedf5('0x17')]===0x1f4){logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);return _0xa7a51f(_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);}logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x5f19af[_0xedf5('0x16')][_0xedf5('0x18')]);return _0x193a20(_0x5f19af['error'][_0xedf5('0x18')]);}else{logger['info'](_0xedf5('0x11'),_0x2b341c,_0xedf5('0x12'));_0x193a20(_0x5f19af[_0xedf5('0x19')][_0xedf5('0x18')]);}})[_0xedf5('0x1a')](function(_0x468863){logger[_0xedf5('0x16')](_0xedf5('0x11'),_0x2b341c,_0x468863);_0xa7a51f(_0x468863);});});}exports[_0xedf5('0x1b')]=function(_0x4ac898){var _0x2be5a0=this;return new Promise(function(_0x2be7d7,_0x8ebd69){return db[_0xedf5('0x1c')][_0xedf5('0x1d')](_0x4ac898[_0xedf5('0x1e')],{'raw':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898['options'][_0xedf5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898[_0xedf5('0x1f')][_0xedf5('0x21')]||null:null,'attributes':_0x4ac898['options']?_0x4ac898[_0xedf5('0x1f')][_0xedf5('0x22')]||null:null,'limit':_0x4ac898[_0xedf5('0x1f')]?_0x4ac898[_0xedf5('0x1f')]['limit']||null:null})[_0xedf5('0xf')](function(_0x3879d4){logger[_0xedf5('0x10')](_0xedf5('0x1b'),_0x4ac898);logger[_0xedf5('0x13')](_0xedf5('0x1b'),_0x4ac898,JSON['stringify'](_0x3879d4));_0x2be7d7(_0x3879d4);})[_0xedf5('0x1a')](function(_0x1132e0){logger[_0xedf5('0x16')](_0xedf5('0x1b'),_0x1132e0[_0xedf5('0x18')],_0x4ac898);_0x8ebd69(_0x2be5a0['error'](0x1f4,_0x1132e0[_0xedf5('0x18')]));});});};exports[_0xedf5('0x23')]=function(_0x219dd0){return new Promise(function(_0x379040,_0xd077e6){return db[_0xedf5('0x1c')][_0xedf5('0x24')]({'where':_0x219dd0[_0xedf5('0x1f')]?_0x219dd0[_0xedf5('0x1f')][_0xedf5('0x21')]||null:null})[_0xedf5('0xf')](function(_0x19026c){if(_0x19026c){return _0x19026c['addTags'](_0x219dd0['body'][_0xedf5('0x25')],_[_0xedf5('0x26')](_0x219dd0[_0xedf5('0x1e')],[_0xedf5('0x25'),'id'])||{});}})[_0xedf5('0x27')](function(_0x2250e3){logger[_0xedf5('0x10')]('AddTags',_0x219dd0);logger['debug'](_0xedf5('0x28'),_0x219dd0,JSON['stringify'](_0x2250e3));_0x379040(_0x2250e3);})[_0xedf5('0x1a')](function(_0x3de3fc){logger[_0xedf5('0x16')](_0xedf5('0x28'),_0x3de3fc[_0xedf5('0x18')],_0x219dd0);_0xd077e6(_this[_0xedf5('0x16')](0x1f4,_0x3de3fc[_0xedf5('0x18')]));});});}; \ No newline at end of file +var _0xae49=['localhost','socket.io-emitter','redis','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','where','addTags','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults'];(function(_0x33bab6,_0x109130){var _0x1c1742=function(_0x1d73fc){while(--_0x1d73fc){_0x33bab6['push'](_0x33bab6['shift']());}};_0x1c1742(++_0x109130);}(_0xae49,0x143));var _0x9ae4=function(_0x5835d6,_0x38c5f8){_0x5835d6=_0x5835d6-0x0;var _0x487cfd=_0xae49[_0x5835d6];return _0x487cfd;};'use strict';var _=require(_0x9ae4('0x0'));var util=require('util');var moment=require(_0x9ae4('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ae4('0x2'));var fs=require('fs');var Redis=require(_0x9ae4('0x3'));var db=require(_0x9ae4('0x4'))['db'];var utils=require(_0x9ae4('0x5'));var logger=require('../../config/logger')(_0x9ae4('0x6'));var config=require(_0x9ae4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9ae4('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9ae4('0x9')](config['redis'],{'host':_0x9ae4('0xa'),'port':0x18eb});var socket=require(_0x9ae4('0xb'))(new Redis(config[_0x9ae4('0xc')]));require('./openchannelInteraction.socket')[_0x9ae4('0xd')](socket);function respondWithRpcPromise(_0x34cff3,_0x20a288,_0x13523a){return new BPromise(function(_0x1ec22a,_0xa0b8fd){return client['request'](_0x34cff3,_0x13523a)['then'](function(_0x2b9711){logger[_0x9ae4('0xe')](_0x9ae4('0xf'),_0x20a288,_0x9ae4('0x10'));logger[_0x9ae4('0x11')](_0x9ae4('0x12'),_0x20a288,_0x9ae4('0x10'),JSON[_0x9ae4('0x13')](_0x2b9711));if(_0x2b9711[_0x9ae4('0x14')]){if(_0x2b9711[_0x9ae4('0x14')]['code']===0x1f4){logger['error'](_0x9ae4('0xf'),_0x20a288,_0x2b9711[_0x9ae4('0x14')][_0x9ae4('0x15')]);return _0xa0b8fd(_0x2b9711['error'][_0x9ae4('0x15')]);}logger[_0x9ae4('0x14')](_0x9ae4('0xf'),_0x20a288,_0x2b9711['error']['message']);return _0x1ec22a(_0x2b9711[_0x9ae4('0x14')]['message']);}else{logger['info'](_0x9ae4('0xf'),_0x20a288,_0x9ae4('0x10'));_0x1ec22a(_0x2b9711[_0x9ae4('0x16')][_0x9ae4('0x15')]);}})[_0x9ae4('0x17')](function(_0x10dcb1){logger[_0x9ae4('0x14')](_0x9ae4('0xf'),_0x20a288,_0x10dcb1);_0xa0b8fd(_0x10dcb1);});});}exports[_0x9ae4('0x18')]=function(_0x57a68e){var _0x3c2ada=this;return new Promise(function(_0x5042f2,_0x8fe857){return db['OpenchannelInteraction'][_0x9ae4('0x19')](_0x57a68e[_0x9ae4('0x1a')],{'raw':_0x57a68e[_0x9ae4('0x1b')]?_0x57a68e[_0x9ae4('0x1b')][_0x9ae4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a68e[_0x9ae4('0x1b')]?_0x57a68e['options']['where']||null:null,'attributes':_0x57a68e[_0x9ae4('0x1b')]?_0x57a68e[_0x9ae4('0x1b')][_0x9ae4('0x1d')]||null:null,'limit':_0x57a68e[_0x9ae4('0x1b')]?_0x57a68e[_0x9ae4('0x1b')]['limit']||null:null})['then'](function(_0x3c6c8a){logger[_0x9ae4('0xe')]('UpdateOpenchannelInteraction',_0x57a68e);logger[_0x9ae4('0x11')](_0x9ae4('0x18'),_0x57a68e,JSON[_0x9ae4('0x13')](_0x3c6c8a));_0x5042f2(_0x3c6c8a);})[_0x9ae4('0x17')](function(_0x1d4d93){logger[_0x9ae4('0x14')]('UpdateOpenchannelInteraction',_0x1d4d93[_0x9ae4('0x15')],_0x57a68e);_0x8fe857(_0x3c2ada[_0x9ae4('0x14')](0x1f4,_0x1d4d93[_0x9ae4('0x15')]));});});};exports[_0x9ae4('0x1e')]=function(_0x45a705){return new Promise(function(_0x323e15,_0x47ee56){return db[_0x9ae4('0x1f')]['find']({'where':_0x45a705['options']?_0x45a705[_0x9ae4('0x1b')][_0x9ae4('0x20')]||null:null})['then'](function(_0x68abee){if(_0x68abee){return _0x68abee[_0x9ae4('0x21')](_0x45a705[_0x9ae4('0x1a')][_0x9ae4('0x22')],_['omit'](_0x45a705[_0x9ae4('0x1a')],[_0x9ae4('0x22'),'id'])||{});}})[_0x9ae4('0x23')](function(_0x742843){logger[_0x9ae4('0xe')](_0x9ae4('0x24'),_0x45a705);logger['debug']('AddTags',_0x45a705,JSON[_0x9ae4('0x13')](_0x742843));_0x323e15(_0x742843);})[_0x9ae4('0x17')](function(_0x5ddd67){logger[_0x9ae4('0x14')](_0x9ae4('0x24'),_0x5ddd67[_0x9ae4('0x15')],_0x45a705);_0x47ee56(_this[_0x9ae4('0x14')](0x1f4,_0x5ddd67[_0x9ae4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a3dc110..8bb7b46 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 _0xc212=['update','removeListener','register','length','openchannelInteraction:','save','remove'];(function(_0x70b3fa,_0x2dabb6){var _0x15b825=function(_0x209983){while(--_0x209983){_0x70b3fa['push'](_0x70b3fa['shift']());}};_0x15b825(++_0x2dabb6);}(_0xc212,0x186));var _0x2c21=function(_0x417cea,_0x261761){_0x417cea=_0x417cea-0x0;var _0x22d92e=_0xc212[_0x417cea];return _0x22d92e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2c21('0x0'),_0x2c21('0x1'),_0x2c21('0x2')];function createListener(_0x1a92f2,_0x3ccb1a){return function(_0x37a63e){_0x3ccb1a['emit'](_0x1a92f2,_0x37a63e);};}function removeListener(_0x4caa59,_0x2780f8){return function(){OpenchannelInteractionEvents[_0x2c21('0x3')](_0x4caa59,_0x2780f8);};}exports[_0x2c21('0x4')]=function(_0x41289f){for(var _0x4ff3e2=0x0,_0x79be49=events[_0x2c21('0x5')];_0x4ff3e2<_0x79be49;_0x4ff3e2++){var _0x5a03a9=events[_0x4ff3e2];var _0x11a705=createListener(_0x2c21('0x6')+_0x5a03a9,_0x41289f);OpenchannelInteractionEvents['on'](_0x5a03a9,_0x11a705);}}; \ No newline at end of file +var _0x6356=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','length'];(function(_0x34d4b0,_0x966fe1){var _0x57c491=function(_0x50e6e0){while(--_0x50e6e0){_0x34d4b0['push'](_0x34d4b0['shift']());}};_0x57c491(++_0x966fe1);}(_0x6356,0x71));var _0x6635=function(_0x58175f,_0x275d92){_0x58175f=_0x58175f-0x0;var _0x37e6bc=_0x6356[_0x58175f];return _0x37e6bc;};'use strict';var OpenchannelInteractionEvents=require(_0x6635('0x0'));var events=['save',_0x6635('0x1'),_0x6635('0x2')];function createListener(_0x3d0860,_0x2e10a8){return function(_0x52977e){_0x2e10a8[_0x6635('0x3')](_0x3d0860,_0x52977e);};}function removeListener(_0xf06f83,_0x4ba963){return function(){OpenchannelInteractionEvents[_0x6635('0x4')](_0xf06f83,_0x4ba963);};}exports['register']=function(_0x39a63b){for(var _0x21d6a7=0x0,_0x3ba79c=events[_0x6635('0x5')];_0x21d6a7<_0x3ba79c;_0x21d6a7++){var _0x4a4f03=events[_0x21d6a7];var _0x29068a=createListener(_0x6635('0x6')+_0x4a4f03,_0x39a63b);OpenchannelInteractionEvents['on'](_0x4a4f03,_0x29068a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 42d884c..d86e8ba 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _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(_0x514b64,_0x54ab07){var _0x1926fc=function(_0x289085){while(--_0x289085){_0x514b64['push'](_0x514b64['shift']());}};_0x1926fc(++_0x54ab07);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index c0b8eb0..edb8eb1 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 _0xcd31=['BOOLEAN','ENUM','out','DATE','STRING','exports','TEXT','medium'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0xcd31,0x15d));var _0x1cd3=function(_0x5664fd,_0x58f991){_0x5664fd=_0x5664fd-0x0;var _0x95a400=_0xcd31[_0x5664fd];return _0x95a400;};'use strict';var Sequelize=require('sequelize');module[_0x1cd3('0x0')]={'body':{'type':Sequelize[_0x1cd3('0x1')](_0x1cd3('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1cd3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1cd3('0x4')]('in',_0x1cd3('0x5')),'defaultValue':_0x1cd3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1cd3('0x6')]},'providerName':{'type':Sequelize[_0x1cd3('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfd7b=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x560cdd,_0x2667d7){var _0x10f689=function(_0x38d11d){while(--_0x38d11d){_0x560cdd['push'](_0x560cdd['shift']());}};_0x10f689(++_0x2667d7);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xfd7b[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'body':{'type':Sequelize[_0xbfd7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfd7('0x4')]('in','out'),'defaultValue':_0xbfd7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfd7('0x6')]},'providerName':{'type':Sequelize[_0xbfd7('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 187bb74..c7175ad 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 _0xc44c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','stack','name','index','OpenchannelMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0xc44c,0xfb));var _0xcc44=function(_0x2fa335,_0x59ea51){_0x2fa335=_0x2fa335-0x0;var _0x5eaf78=_0xc44c[_0x2fa335];return _0x5eaf78;};'use strict';var emlformat=require(_0xcc44('0x0'));var rimraf=require(_0xcc44('0x1'));var zipdir=require(_0xcc44('0x2'));var jsonpatch=require(_0xcc44('0x3'));var rp=require(_0xcc44('0x4'));var moment=require('moment');var BPromise=require(_0xcc44('0x5'));var Mustache=require(_0xcc44('0x6'));var util=require(_0xcc44('0x7'));var path=require(_0xcc44('0x8'));var sox=require(_0xcc44('0x9'));var csv=require(_0xcc44('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc44('0xb'));var _=require(_0xcc44('0xc'));var squel=require(_0xcc44('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc44('0xe'));var deskjs=require(_0xcc44('0xf'));var toCsv=require(_0xcc44('0xa'));var querystring=require(_0xcc44('0x10'));var Papa=require(_0xcc44('0x11'));var Redis=require(_0xcc44('0x12'));var authService=require(_0xcc44('0x13'));var qs=require(_0xcc44('0x14'));var as=require(_0xcc44('0x15'));var hardwareService=require(_0xcc44('0x16'));var logger=require(_0xcc44('0x17'))('api');var utils=require(_0xcc44('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc44('0x19'))['db'];config['redis']=_[_0xcc44('0x1a')](config[_0xcc44('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcc44('0x1c'))(new Redis(config[_0xcc44('0x1b')]));require(_0xcc44('0x1d'))[_0xcc44('0x1e')](socket);var jayson=require(_0xcc44('0x1f'));var client=jayson['client'][_0xcc44('0x20')]({'port':0x232c});var client9002=jayson[_0xcc44('0x21')][_0xcc44('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x59b0ee,_0x27feba,_0x2a4626,_0x46d6e9){return new BPromise(function(_0x2da8d6,_0xe6e047){var _0x267314=_0x46d6e9||client;return _0x267314[_0xcc44('0x22')](_0x59b0ee,_0x2a4626)[_0xcc44('0x23')](function(_0x591065){logger[_0xcc44('0x24')](_0xcc44('0x25'),_0x27feba,_0xcc44('0x26'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x27feba,'request\x20sent',JSON[_0xcc44('0x27')](_0x591065));if(_0x591065['error']){if(_0x591065['error'][_0xcc44('0x28')]===0x1f4){logger[_0xcc44('0x29')](_0xcc44('0x25'),_0x27feba,_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);return _0xe6e047(_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,_0x591065[_0xcc44('0x29')]['message']);return _0x2da8d6(_0x591065[_0xcc44('0x29')][_0xcc44('0x2a')]);}else{logger[_0xcc44('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,'request\x20sent');_0x2da8d6(_0x591065[_0xcc44('0x2b')][_0xcc44('0x2a')]);}})['catch'](function(_0x500c8e){logger[_0xcc44('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x27feba,_0x500c8e);_0xe6e047(_0x500c8e);});});}function respondWithStatusCode(_0x4a09fd,_0xa4de9a){_0xa4de9a=_0xa4de9a||0xcc;return function(_0x3291e2){if(_0x3291e2){return _0x4a09fd[_0xcc44('0x2c')](_0xa4de9a);}return _0x4a09fd[_0xcc44('0x2d')](_0xa4de9a)[_0xcc44('0x2e')]();};}function respondWithResult(_0x2a20fa,_0x3bd615){_0x3bd615=_0x3bd615||0xc8;return function(_0x406b6d){if(_0x406b6d){return _0x2a20fa[_0xcc44('0x2d')](_0x3bd615)['json'](_0x406b6d);}};}function respondWithFilteredResult(_0x21de2b,_0x55eb54){return function(_0x57f508){if(_0x57f508){var _0x2c7606=typeof _0x55eb54[_0xcc44('0x2f')]===_0xcc44('0x30')&&typeof _0x55eb54[_0xcc44('0x31')]===_0xcc44('0x30');var _0x416c16=_0x57f508[_0xcc44('0x32')];var _0x556905=_0x2c7606?0x0:_0x55eb54[_0xcc44('0x2f')];var _0x1e76df=_0x2c7606?_0x57f508[_0xcc44('0x32')]:_0x55eb54[_0xcc44('0x2f')]+_0x55eb54['limit'];var _0x3978e1;if(_0x1e76df>=_0x416c16){_0x1e76df=_0x416c16;_0x3978e1=0xc8;}else{_0x3978e1=0xce;}_0x21de2b[_0xcc44('0x2d')](_0x3978e1);return _0x21de2b[_0xcc44('0x33')](_0xcc44('0x34'),_0x556905+'-'+_0x1e76df+'/'+_0x416c16)[_0xcc44('0x35')](_0x57f508);}return null;};}function patchUpdates(_0x18b74f){return function(_0x415636){try{jsonpatch['apply'](_0x415636,_0x18b74f,!![]);}catch(_0x9bcfd){return BPromise[_0xcc44('0x36')](_0x9bcfd);}return _0x415636[_0xcc44('0x37')]();};}function saveUpdates(_0x305a5f,_0x210b07){return function(_0x2a0def){if(_0x2a0def){return _0x2a0def['update'](_0x305a5f)['then'](function(_0xcc9978){return _0xcc9978;});}return null;};}function removeEntity(_0x1d3942,_0x403a5c){return function(_0x4c7e0d){if(_0x4c7e0d){return _0x4c7e0d[_0xcc44('0x38')]()[_0xcc44('0x23')](function(){_0x1d3942['status'](0xcc)[_0xcc44('0x2e')]();});}};}function handleEntityNotFound(_0x58ca43,_0x126901){return function(_0x33f4c7){if(!_0x33f4c7){_0x58ca43[_0xcc44('0x2c')](0x194);}return _0x33f4c7;};}function handleError(_0xb4ae0a,_0x5866cb){_0x5866cb=_0x5866cb||0x1f4;return function(_0x46485d){logger[_0xcc44('0x29')](_0x46485d[_0xcc44('0x39')]);if(_0x46485d[_0xcc44('0x3a')]){delete _0x46485d['name'];}_0xb4ae0a[_0xcc44('0x2d')](_0x5866cb)['send'](_0x46485d);};}exports[_0xcc44('0x3b')]=function(_0xb20050,_0x129d84){var _0x2eb56c={},_0x46be7c={},_0x7df693={'count':0x0,'rows':[]};var _0x2da793=_['map'](db[_0xcc44('0x3c')][_0xcc44('0x3d')],function(_0x383b56){return{'name':_0x383b56['fieldName'],'type':_0x383b56[_0xcc44('0x3e')][_0xcc44('0x3f')]};});_0x46be7c[_0xcc44('0x40')]=_[_0xcc44('0x41')](_0x2da793,_0xcc44('0x3a'));_0x46be7c[_0xcc44('0x42')]=_[_0xcc44('0x43')](_0xb20050[_0xcc44('0x42')]);_0x46be7c[_0xcc44('0x44')]=_[_0xcc44('0x45')](_0x46be7c[_0xcc44('0x40')],_0x46be7c[_0xcc44('0x42')]);_0x2eb56c[_0xcc44('0x46')]=_[_0xcc44('0x45')](_0x46be7c[_0xcc44('0x40')],qs['fields'](_0xb20050[_0xcc44('0x42')][_0xcc44('0x47')]));_0x2eb56c[_0xcc44('0x46')]=_0x2eb56c['attributes']['length']?_0x2eb56c['attributes']:_0x46be7c[_0xcc44('0x40')];if(!_0xb20050[_0xcc44('0x42')][_0xcc44('0x48')](_0xcc44('0x49'))){_0x2eb56c[_0xcc44('0x31')]=qs[_0xcc44('0x31')](_0xb20050[_0xcc44('0x42')][_0xcc44('0x31')]);_0x2eb56c[_0xcc44('0x2f')]=qs[_0xcc44('0x2f')](_0xb20050[_0xcc44('0x42')]['offset']);}_0x2eb56c[_0xcc44('0x4a')]=qs[_0xcc44('0x4b')](_0xb20050[_0xcc44('0x42')][_0xcc44('0x4b')]);_0x2eb56c[_0xcc44('0x4c')]=qs[_0xcc44('0x44')](_['pick'](_0xb20050[_0xcc44('0x42')],_0x46be7c[_0xcc44('0x44')]),_0x2da793);if(_0xb20050[_0xcc44('0x42')]['filter']){_0x2eb56c[_0xcc44('0x4c')]=_['merge'](_0x2eb56c[_0xcc44('0x4c')],{'$or':_[_0xcc44('0x41')](_0x2da793,function(_0x19ea16){if(_0x19ea16['type']!==_0xcc44('0x4d')){var _0x16b8f1={};_0x16b8f1[_0x19ea16[_0xcc44('0x3a')]]={'$like':'%'+_0xb20050[_0xcc44('0x42')][_0xcc44('0x4e')]+'%'};return _0x16b8f1;}})});}_0x2eb56c=_[_0xcc44('0x4f')]({},_0x2eb56c,_0xb20050[_0xcc44('0x50')]);var _0x5b94ea={'where':_0x2eb56c['where']};return db[_0xcc44('0x3c')][_0xcc44('0x32')](_0x5b94ea)[_0xcc44('0x23')](function(_0x182a83){_0x7df693[_0xcc44('0x32')]=_0x182a83;if(_0xb20050[_0xcc44('0x42')][_0xcc44('0x51')]){_0x2eb56c[_0xcc44('0x52')]=[{'all':!![]}];}return db[_0xcc44('0x3c')][_0xcc44('0x53')](_0x2eb56c);})['then'](function(_0x22c7a7){_0x7df693[_0xcc44('0x54')]=_0x22c7a7;return _0x7df693;})[_0xcc44('0x23')](respondWithFilteredResult(_0x129d84,_0x2eb56c))['catch'](handleError(_0x129d84,null));};exports[_0xcc44('0x55')]=function(_0x14338b,_0x5335a9){var _0x638651={'raw':!![],'where':{'id':_0x14338b['params']['id']}},_0x410396={};_0x410396[_0xcc44('0x40')]=_['keys'](db[_0xcc44('0x3c')][_0xcc44('0x3d')]);_0x410396['query']=_[_0xcc44('0x43')](_0x14338b[_0xcc44('0x42')]);_0x410396['filters']=_[_0xcc44('0x45')](_0x410396['model'],_0x410396[_0xcc44('0x42')]);_0x638651[_0xcc44('0x46')]=_['intersection'](_0x410396['model'],qs['fields'](_0x14338b['query'][_0xcc44('0x47')]));_0x638651['attributes']=_0x638651[_0xcc44('0x46')]['length']?_0x638651[_0xcc44('0x46')]:_0x410396[_0xcc44('0x40')];if(_0x14338b['query']['includeAll']){_0x638651[_0xcc44('0x52')]=[{'all':!![]}];}_0x638651=_['merge']({},_0x638651,_0x14338b['options']);return db['OpenchannelMessage'][_0xcc44('0x56')](_0x638651)[_0xcc44('0x23')](handleEntityNotFound(_0x5335a9,null))['then'](respondWithResult(_0x5335a9,null))[_0xcc44('0x57')](handleError(_0x5335a9,null));};exports[_0xcc44('0x58')]=function(_0x3886ee,_0x26fc60){return db[_0xcc44('0x3c')][_0xcc44('0x58')](_0x3886ee['body'],{})['then'](respondWithResult(_0x26fc60,0xc9))[_0xcc44('0x57')](handleError(_0x26fc60,null));};exports['update']=function(_0x18a945,_0x13221d){if(_0x18a945[_0xcc44('0x59')]['id']){delete _0x18a945['body']['id'];}return db[_0xcc44('0x3c')]['find']({'where':{'id':_0x18a945[_0xcc44('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13221d,null))[_0xcc44('0x23')](saveUpdates(_0x18a945['body'],null))['then'](respondWithResult(_0x13221d,null))['catch'](handleError(_0x13221d,null));};exports[_0xcc44('0x38')]=function(_0x2f623a,_0x539dcd){return db[_0xcc44('0x3c')][_0xcc44('0x56')]({'where':{'id':_0x2f623a[_0xcc44('0x5a')]['id']}})[_0xcc44('0x23')](handleEntityNotFound(_0x539dcd,null))[_0xcc44('0x23')](removeEntity(_0x539dcd,null))[_0xcc44('0x57')](handleError(_0x539dcd,null));};exports[_0xcc44('0x5b')]=function(_0xb29a31,_0x164741){return db[_0xcc44('0x3c')][_0xcc44('0x5b')]()[_0xcc44('0x23')](respondWithResult(_0x164741,null))['catch'](handleError(_0x164741,null));};var interaction_log=require(_0xcc44('0x17'))(_0xcc44('0x5c'));exports[_0xcc44('0x5d')]=function(_0x55b1c5,_0x46e3df,_0x5a579b){var _0x275a1d={'agent':{},'channel':_0xcc44('0x5e')};if(_0x55b1c5[_0xcc44('0x59')]['id']){delete _0x55b1c5[_0xcc44('0x59')]['id'];}_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x5f')]=!![];_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x60')]=moment()['format'](_0xcc44('0x61'));_0x55b1c5['body'][_0xcc44('0x62')]=_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')]||_0x55b1c5['user']['id'];_0x275a1d[_0xcc44('0x63')]['id']=_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')];return db['OpenchannelMessage'][_0xcc44('0x56')]({'where':{'id':_0x55b1c5['params']['id'],'UserId':null}})[_0xcc44('0x23')](handleEntityNotFound(_0x46e3df,null))[_0xcc44('0x23')](saveUpdates(_0x55b1c5[_0xcc44('0x59')],null))[_0xcc44('0x23')](function(_0x1824eb){if(_0x1824eb){_0x275a1d[_0xcc44('0x2a')]=_0x1824eb[_0xcc44('0x64')]({'plain':!![]});return db[_0xcc44('0x65')][_0xcc44('0x56')]({'where':{'id':_0x1824eb[_0xcc44('0x66')]}});}return null;})[_0xcc44('0x23')](handleEntityNotFound(_0x46e3df,null))[_0xcc44('0x23')](function(_0x1b2ab6){if(_0x1b2ab6){return _0x1b2ab6[_0xcc44('0x67')]({'UserId':_0x55b1c5[_0xcc44('0x59')]['UserId'],'read1stAt':_[_0xcc44('0x68')](_0x1b2ab6[_0xcc44('0x69')])?moment()[_0xcc44('0x6a')](_0xcc44('0x61')):undefined});}return null;})[_0xcc44('0x23')](function(_0x274ea5){if(_0x274ea5){_0x275a1d[_0xcc44('0x6b')]=_0x274ea5[_0xcc44('0x64')]({'plain':!![]});interaction_log[_0xcc44('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55b1c5['user']['id'],_0x55b1c5['user'][_0xcc44('0x3a')],_0x55b1c5[_0xcc44('0x6c')][_0xcc44('0x6d')],_0x275a1d[_0xcc44('0x6b')]['id'],_0x55b1c5[_0xcc44('0x59')]?JSON[_0xcc44('0x27')](_0x55b1c5[_0xcc44('0x59')]):_0xcc44('0x6e'));return respondWithRpcPromise(_0xcc44('0x6f'),_0xcc44('0x70'),_0x275a1d);}return null;})[_0xcc44('0x23')](function(_0x3286dd){var _0x4e0692=_0xcc44('0x71')+_0x3286dd['message']['ContactId'];return db[_0xcc44('0x72')][_0xcc44('0x42')](_0x4e0692,{'type':db[_0xcc44('0x73')][_0xcc44('0x74')][_0xcc44('0x75')],'raw':!![]})[_0xcc44('0x23')](function(_0x2105be){return _0x2105be;});})[_0xcc44('0x23')](function(_0x75a8e5){if(_0x75a8e5){_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x76')]=_0x75a8e5[0x0];if(!_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')])return;return db[_0xcc44('0x77')]['find']({'where':{'id':_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x62')],'role':_0xcc44('0x63')},'attributes':['id',_0xcc44('0x3a'),_0xcc44('0x78'),_0xcc44('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1a7ef6){if(!_0x1a7ef6)return null;_0x275a1d['message'][_0xcc44('0x63')]=_0x1a7ef6;return _0x275a1d;})[_0xcc44('0x23')](function(_0x4ab234){if(_0x4ab234){if(_0x55b1c5[_0xcc44('0x59')][_0xcc44('0x7a')]){_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7b')]=util[_0xcc44('0x6a')](_0xcc44('0x7c'),_0x55b1c5[_0xcc44('0x6c')][_0xcc44('0x3a')]);_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7d')]=_0x275a1d[_0xcc44('0x7d')];_0x275a1d[_0xcc44('0x2a')]['motionChannel']=_0x275a1d[_0xcc44('0x7d')];_0x275a1d[_0xcc44('0x2a')][_0xcc44('0x7e')]='accept';return respondWithRpcPromise('EventManager',_0xcc44('0x7f'),{'event':_0xcc44('0x80'),'message':_0x275a1d[_0xcc44('0x2a')]},client9002)[_0xcc44('0x23')](function(){return _0x275a1d;});}return _0x275a1d;}return null;})[_0xcc44('0x23')](respondWithResult(_0x46e3df,null))[_0xcc44('0x57')](handleError(_0x46e3df,null));};var interaction_log=require(_0xcc44('0x17'))(_0xcc44('0x5c'));exports[_0xcc44('0x36')]=function(_0x49ed39,_0x50bb2d,_0x5043db){var _0x47c4c9={'agent':{},'channel':_0xcc44('0x5e')};if(_0x49ed39[_0xcc44('0x59')]['id']){delete _0x49ed39[_0xcc44('0x59')]['id'];}_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')]=_0x49ed39[_0xcc44('0x59')]['UserId']||_0x49ed39[_0xcc44('0x6c')]['id'];_0x47c4c9['agent']['id']=_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')];return db[_0xcc44('0x3c')][_0xcc44('0x56')]({'where':{'id':_0x49ed39[_0xcc44('0x5a')]['id'],'UserId':null}})[_0xcc44('0x23')](handleEntityNotFound(_0x50bb2d,null))[_0xcc44('0x23')](function(_0x386a04){if(_0x386a04){_0x47c4c9[_0xcc44('0x2a')]=_0x386a04[_0xcc44('0x64')]({'plain':!![]});return db[_0xcc44('0x65')][_0xcc44('0x56')]({'where':{'id':_0x386a04[_0xcc44('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x50bb2d,null))[_0xcc44('0x23')](function(_0x3850be){if(_0x3850be){_0x47c4c9[_0xcc44('0x6b')]=_0x3850be[_0xcc44('0x64')]({'plain':!![]});interaction_log[_0xcc44('0x24')](_0xcc44('0x81'),_0x49ed39[_0xcc44('0x6c')]['id'],_0x49ed39['user'][_0xcc44('0x3a')],_0x49ed39['user'][_0xcc44('0x6d')],_0x47c4c9[_0xcc44('0x6b')]['id'],_0x49ed39[_0xcc44('0x59')]?JSON[_0xcc44('0x27')](_0x49ed39['body']):_0xcc44('0x6e'));return respondWithRpcPromise(_0xcc44('0x82'),_0xcc44('0x83'),_0x47c4c9);}return null;})['then'](function(_0x3cdba6){var _0xb9f28a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cdba6[_0xcc44('0x2a')][_0xcc44('0x84')];return db[_0xcc44('0x72')][_0xcc44('0x42')](_0xb9f28a,{'type':db['Sequelize'][_0xcc44('0x74')][_0xcc44('0x75')],'raw':!![]})['then'](function(_0x2d8e6d){return _0x2d8e6d;});})[_0xcc44('0x23')](function(_0x24c3ba){if(_0x24c3ba){_0x47c4c9['message'][_0xcc44('0x76')]=_0x24c3ba[0x0];if(!_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')])return;return db[_0xcc44('0x77')][_0xcc44('0x56')]({'where':{'id':_0x49ed39[_0xcc44('0x59')][_0xcc44('0x62')],'role':_0xcc44('0x63')},'attributes':['id',_0xcc44('0x3a'),_0xcc44('0x78'),_0xcc44('0x79'),_0xcc44('0x85')],'raw':!![]});}return null;})[_0xcc44('0x23')](function(_0x2428c7){if(!_0x2428c7)return null;_0x47c4c9[_0xcc44('0x2a')][_0xcc44('0x63')]=_0x2428c7;return _0x47c4c9;})[_0xcc44('0x23')](function(_0x116f2a){if(_0x116f2a){_0x116f2a[_0xcc44('0x2a')][_0xcc44('0x7b')]=util['format'](_0xcc44('0x7c'),_0x49ed39[_0xcc44('0x6c')][_0xcc44('0x3a')]);_0x116f2a['message'][_0xcc44('0x7d')]=_0x47c4c9[_0xcc44('0x7d')];_0x116f2a[_0xcc44('0x2a')][_0xcc44('0x86')]=_0x47c4c9[_0xcc44('0x7d')];_0x116f2a['message']['event']=_0xcc44('0x36');respondWithRpcPromise('EventManager',_0xcc44('0x7f'),{'event':_0xcc44('0x87'),'message':_0x116f2a[_0xcc44('0x2a')]},client9002);return _0x47c4c9;}return null;})['then'](respondWithResult(_0x50bb2d,null))[_0xcc44('0x57')](handleError(_0x50bb2d,null));}; \ No newline at end of file +var _0xad1c=['options','find','create','body','update','describe','accept','read','readAt','format','UserId','agent','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','SIP/%s','rejectmessage','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','reject','save','destroy','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','keys'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xad1c,0x1bc));var _0xcad1=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xad1c[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcad1('0x0'));var jsonpatch=require(_0xcad1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcad1('0x2'));var util=require('util');var path=require(_0xcad1('0x3'));var sox=require(_0xcad1('0x4'));var csv=require(_0xcad1('0x5'));var ejs=require(_0xcad1('0x6'));var fs=require('fs');var fs_extra=require(_0xcad1('0x7'));var _=require(_0xcad1('0x8'));var squel=require('squel');var crypto=require(_0xcad1('0x9'));var jsforce=require(_0xcad1('0xa'));var deskjs=require(_0xcad1('0xb'));var toCsv=require(_0xcad1('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcad1('0xc'));var authService=require(_0xcad1('0xd'));var qs=require(_0xcad1('0xe'));var as=require(_0xcad1('0xf'));var hardwareService=require(_0xcad1('0x10'));var logger=require(_0xcad1('0x11'))(_0xcad1('0x12'));var utils=require(_0xcad1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcad1('0x14'));var db=require(_0xcad1('0x15'))['db'];config['redis']=_['defaults'](config[_0xcad1('0x16')],{'host':_0xcad1('0x17'),'port':0x18eb});var socket=require(_0xcad1('0x18'))(new Redis(config[_0xcad1('0x16')]));require(_0xcad1('0x19'))[_0xcad1('0x1a')](socket);var jayson=require(_0xcad1('0x1b'));var client=jayson[_0xcad1('0x1c')][_0xcad1('0x1d')]({'port':0x232c});var client9002=jayson[_0xcad1('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33f577,_0x333946,_0x193412,_0x490fe3){return new BPromise(function(_0x5ba35d,_0x1ad992){var _0x5c7066=_0x490fe3||client;return _0x5c7066['request'](_0x33f577,_0x193412)[_0xcad1('0x1e')](function(_0x207247){logger[_0xcad1('0x1f')](_0xcad1('0x20'),_0x333946,_0xcad1('0x21'));logger[_0xcad1('0x22')](_0xcad1('0x23'),_0x333946,_0xcad1('0x21'),JSON[_0xcad1('0x24')](_0x207247));if(_0x207247[_0xcad1('0x25')]){if(_0x207247[_0xcad1('0x25')][_0xcad1('0x26')]===0x1f4){logger[_0xcad1('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x333946,_0x207247[_0xcad1('0x25')]['message']);return _0x1ad992(_0x207247['error']['message']);}logger[_0xcad1('0x25')](_0xcad1('0x20'),_0x333946,_0x207247[_0xcad1('0x25')][_0xcad1('0x27')]);return _0x5ba35d(_0x207247[_0xcad1('0x25')][_0xcad1('0x27')]);}else{logger[_0xcad1('0x1f')](_0xcad1('0x20'),_0x333946,_0xcad1('0x21'));_0x5ba35d(_0x207247[_0xcad1('0x28')]['message']);}})[_0xcad1('0x29')](function(_0x44eec1){logger[_0xcad1('0x25')](_0xcad1('0x20'),_0x333946,_0x44eec1);_0x1ad992(_0x44eec1);});});}function respondWithStatusCode(_0xae8860,_0x111100){_0x111100=_0x111100||0xcc;return function(_0x92fe6a){if(_0x92fe6a){return _0xae8860[_0xcad1('0x2a')](_0x111100);}return _0xae8860[_0xcad1('0x2b')](_0x111100)['end']();};}function respondWithResult(_0xbccd57,_0x3237ad){_0x3237ad=_0x3237ad||0xc8;return function(_0xc53f9d){if(_0xc53f9d){return _0xbccd57[_0xcad1('0x2b')](_0x3237ad)['json'](_0xc53f9d);}};}function respondWithFilteredResult(_0x406de0,_0x131eac){return function(_0x3345dc){if(_0x3345dc){var _0x3d9125=typeof _0x131eac[_0xcad1('0x2c')]===_0xcad1('0x2d')&&typeof _0x131eac[_0xcad1('0x2e')]===_0xcad1('0x2d');var _0x433a8d=_0x3345dc[_0xcad1('0x2f')];var _0x29bd1d=_0x3d9125?0x0:_0x131eac[_0xcad1('0x2c')];var _0xc2f589=_0x3d9125?_0x3345dc['count']:_0x131eac[_0xcad1('0x2c')]+_0x131eac[_0xcad1('0x2e')];var _0x4c97eb;if(_0xc2f589>=_0x433a8d){_0xc2f589=_0x433a8d;_0x4c97eb=0xc8;}else{_0x4c97eb=0xce;}_0x406de0['status'](_0x4c97eb);return _0x406de0['set']('Content-Range',_0x29bd1d+'-'+_0xc2f589+'/'+_0x433a8d)[_0xcad1('0x30')](_0x3345dc);}return null;};}function patchUpdates(_0x2fca72){return function(_0x397f9e){try{jsonpatch['apply'](_0x397f9e,_0x2fca72,!![]);}catch(_0x249493){return BPromise[_0xcad1('0x31')](_0x249493);}return _0x397f9e[_0xcad1('0x32')]();};}function saveUpdates(_0x5998e8,_0x3563ed){return function(_0x2bf076){if(_0x2bf076){return _0x2bf076['update'](_0x5998e8)[_0xcad1('0x1e')](function(_0x588cad){return _0x588cad;});}return null;};}function removeEntity(_0x16b118,_0x5ba76f){return function(_0x40304c){if(_0x40304c){return _0x40304c[_0xcad1('0x33')]()[_0xcad1('0x1e')](function(){_0x16b118[_0xcad1('0x2b')](0xcc)[_0xcad1('0x34')]();});}};}function handleEntityNotFound(_0x1b5b2a,_0x110119){return function(_0x41f1fd){if(!_0x41f1fd){_0x1b5b2a[_0xcad1('0x2a')](0x194);}return _0x41f1fd;};}function handleError(_0x3ba3f9,_0x59fc55){_0x59fc55=_0x59fc55||0x1f4;return function(_0x50d728){logger[_0xcad1('0x25')](_0x50d728[_0xcad1('0x35')]);if(_0x50d728[_0xcad1('0x36')]){delete _0x50d728['name'];}_0x3ba3f9[_0xcad1('0x2b')](_0x59fc55)[_0xcad1('0x37')](_0x50d728);};}exports[_0xcad1('0x38')]=function(_0x19fe05,_0x359811){var _0x899421={},_0x476b4a={},_0x364a8b={'count':0x0,'rows':[]};var _0x1e98db=_[_0xcad1('0x39')](db[_0xcad1('0x3a')][_0xcad1('0x3b')],function(_0x20046d){return{'name':_0x20046d[_0xcad1('0x3c')],'type':_0x20046d['type'][_0xcad1('0x3d')]};});_0x476b4a[_0xcad1('0x3e')]=_['map'](_0x1e98db,_0xcad1('0x36'));_0x476b4a[_0xcad1('0x3f')]=_['keys'](_0x19fe05[_0xcad1('0x3f')]);_0x476b4a[_0xcad1('0x40')]=_[_0xcad1('0x41')](_0x476b4a['model'],_0x476b4a[_0xcad1('0x3f')]);_0x899421['attributes']=_[_0xcad1('0x41')](_0x476b4a[_0xcad1('0x3e')],qs['fields'](_0x19fe05[_0xcad1('0x3f')][_0xcad1('0x42')]));_0x899421['attributes']=_0x899421[_0xcad1('0x43')][_0xcad1('0x44')]?_0x899421[_0xcad1('0x43')]:_0x476b4a['model'];if(!_0x19fe05[_0xcad1('0x3f')][_0xcad1('0x45')](_0xcad1('0x46'))){_0x899421[_0xcad1('0x2e')]=qs[_0xcad1('0x2e')](_0x19fe05[_0xcad1('0x3f')][_0xcad1('0x2e')]);_0x899421[_0xcad1('0x2c')]=qs[_0xcad1('0x2c')](_0x19fe05['query'][_0xcad1('0x2c')]);}_0x899421['order']=qs[_0xcad1('0x47')](_0x19fe05[_0xcad1('0x3f')]['sort']);_0x899421[_0xcad1('0x48')]=qs[_0xcad1('0x40')](_[_0xcad1('0x49')](_0x19fe05[_0xcad1('0x3f')],_0x476b4a[_0xcad1('0x40')]),_0x1e98db);if(_0x19fe05[_0xcad1('0x3f')][_0xcad1('0x4a')]){_0x899421[_0xcad1('0x48')]=_[_0xcad1('0x4b')](_0x899421[_0xcad1('0x48')],{'$or':_[_0xcad1('0x39')](_0x1e98db,function(_0x1cde2a){if(_0x1cde2a[_0xcad1('0x4c')]!=='VIRTUAL'){var _0x2c963f={};_0x2c963f[_0x1cde2a[_0xcad1('0x36')]]={'$like':'%'+_0x19fe05['query'][_0xcad1('0x4a')]+'%'};return _0x2c963f;}})});}_0x899421=_['merge']({},_0x899421,_0x19fe05['options']);var _0x1557cd={'where':_0x899421['where']};return db[_0xcad1('0x3a')]['count'](_0x1557cd)[_0xcad1('0x1e')](function(_0x7b209d){_0x364a8b[_0xcad1('0x2f')]=_0x7b209d;if(_0x19fe05[_0xcad1('0x3f')][_0xcad1('0x4d')]){_0x899421[_0xcad1('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xcad1('0x4f')](_0x899421);})[_0xcad1('0x1e')](function(_0x24fdbf){_0x364a8b[_0xcad1('0x50')]=_0x24fdbf;return _0x364a8b;})[_0xcad1('0x1e')](respondWithFilteredResult(_0x359811,_0x899421))[_0xcad1('0x29')](handleError(_0x359811,null));};exports[_0xcad1('0x51')]=function(_0x3adaeb,_0xaf0265){var _0x5d73c0={'raw':!![],'where':{'id':_0x3adaeb[_0xcad1('0x52')]['id']}},_0x2af2f9={};_0x2af2f9['model']=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x2af2f9[_0xcad1('0x3f')]=_[_0xcad1('0x53')](_0x3adaeb[_0xcad1('0x3f')]);_0x2af2f9['filters']=_[_0xcad1('0x41')](_0x2af2f9[_0xcad1('0x3e')],_0x2af2f9[_0xcad1('0x3f')]);_0x5d73c0[_0xcad1('0x43')]=_[_0xcad1('0x41')](_0x2af2f9['model'],qs['fields'](_0x3adaeb[_0xcad1('0x3f')][_0xcad1('0x42')]));_0x5d73c0['attributes']=_0x5d73c0[_0xcad1('0x43')][_0xcad1('0x44')]?_0x5d73c0['attributes']:_0x2af2f9[_0xcad1('0x3e')];if(_0x3adaeb['query'][_0xcad1('0x4d')]){_0x5d73c0['include']=[{'all':!![]}];}_0x5d73c0=_[_0xcad1('0x4b')]({},_0x5d73c0,_0x3adaeb[_0xcad1('0x54')]);return db[_0xcad1('0x3a')][_0xcad1('0x55')](_0x5d73c0)[_0xcad1('0x1e')](handleEntityNotFound(_0xaf0265,null))[_0xcad1('0x1e')](respondWithResult(_0xaf0265,null))['catch'](handleError(_0xaf0265,null));};exports[_0xcad1('0x56')]=function(_0x1c20b8,_0x132a87){return db['OpenchannelMessage'][_0xcad1('0x56')](_0x1c20b8[_0xcad1('0x57')],{})[_0xcad1('0x1e')](respondWithResult(_0x132a87,0xc9))[_0xcad1('0x29')](handleError(_0x132a87,null));};exports[_0xcad1('0x58')]=function(_0x5c5980,_0x360aa3){if(_0x5c5980[_0xcad1('0x57')]['id']){delete _0x5c5980[_0xcad1('0x57')]['id'];}return db[_0xcad1('0x3a')][_0xcad1('0x55')]({'where':{'id':_0x5c5980[_0xcad1('0x52')]['id']}})[_0xcad1('0x1e')](handleEntityNotFound(_0x360aa3,null))[_0xcad1('0x1e')](saveUpdates(_0x5c5980[_0xcad1('0x57')],null))[_0xcad1('0x1e')](respondWithResult(_0x360aa3,null))[_0xcad1('0x29')](handleError(_0x360aa3,null));};exports[_0xcad1('0x33')]=function(_0xebe62d,_0x1e3835){return db[_0xcad1('0x3a')]['find']({'where':{'id':_0xebe62d[_0xcad1('0x52')]['id']}})[_0xcad1('0x1e')](handleEntityNotFound(_0x1e3835,null))[_0xcad1('0x1e')](removeEntity(_0x1e3835,null))[_0xcad1('0x29')](handleError(_0x1e3835,null));};exports[_0xcad1('0x59')]=function(_0xf69cf0,_0x48c1e5){return db[_0xcad1('0x3a')][_0xcad1('0x59')]()['then'](respondWithResult(_0x48c1e5,null))[_0xcad1('0x29')](handleError(_0x48c1e5,null));};var interaction_log=require(_0xcad1('0x11'))('openchannel-interactions');exports[_0xcad1('0x5a')]=function(_0x3f1b8a,_0x199414,_0x37d548){var _0x2ca1ab={'agent':{},'channel':'openchannel'};if(_0x3f1b8a[_0xcad1('0x57')]['id']){delete _0x3f1b8a[_0xcad1('0x57')]['id'];}_0x3f1b8a['body'][_0xcad1('0x5b')]=!![];_0x3f1b8a[_0xcad1('0x57')][_0xcad1('0x5c')]=moment()[_0xcad1('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f1b8a[_0xcad1('0x57')][_0xcad1('0x5e')]=_0x3f1b8a['body'][_0xcad1('0x5e')]||_0x3f1b8a['user']['id'];_0x2ca1ab[_0xcad1('0x5f')]['id']=_0x3f1b8a[_0xcad1('0x57')][_0xcad1('0x5e')];return db[_0xcad1('0x3a')][_0xcad1('0x55')]({'where':{'id':_0x3f1b8a[_0xcad1('0x52')]['id'],'UserId':null}})[_0xcad1('0x1e')](handleEntityNotFound(_0x199414,null))['then'](saveUpdates(_0x3f1b8a[_0xcad1('0x57')],null))['then'](function(_0x459928){if(_0x459928){_0x2ca1ab[_0xcad1('0x27')]=_0x459928['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xcad1('0x55')]({'where':{'id':_0x459928[_0xcad1('0x60')]}});}return null;})[_0xcad1('0x1e')](handleEntityNotFound(_0x199414,null))[_0xcad1('0x1e')](function(_0x54e219){if(_0x54e219){return _0x54e219[_0xcad1('0x58')]({'UserId':_0x3f1b8a['body']['UserId'],'read1stAt':_[_0xcad1('0x61')](_0x54e219[_0xcad1('0x62')])?moment()[_0xcad1('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcad1('0x1e')](function(_0x331efc){if(_0x331efc){_0x2ca1ab[_0xcad1('0x63')]=_0x331efc[_0xcad1('0x64')]({'plain':!![]});interaction_log['info'](_0xcad1('0x65'),_0x3f1b8a[_0xcad1('0x66')]['id'],_0x3f1b8a[_0xcad1('0x66')]['name'],_0x3f1b8a[_0xcad1('0x66')]['role'],_0x2ca1ab[_0xcad1('0x63')]['id'],_0x3f1b8a[_0xcad1('0x57')]?JSON[_0xcad1('0x24')](_0x3f1b8a['body']):_0xcad1('0x67'));return respondWithRpcPromise(_0xcad1('0x68'),_0xcad1('0x69'),_0x2ca1ab);}return null;})[_0xcad1('0x1e')](function(_0x4342d0){var _0x37134b=_0xcad1('0x6a')+_0x4342d0[_0xcad1('0x27')][_0xcad1('0x6b')];return db[_0xcad1('0x6c')]['query'](_0x37134b,{'type':db[_0xcad1('0x6d')][_0xcad1('0x6e')][_0xcad1('0x6f')],'raw':!![]})[_0xcad1('0x1e')](function(_0x1cfcef){return _0x1cfcef;});})[_0xcad1('0x1e')](function(_0xc9dfee){if(_0xc9dfee){_0x2ca1ab[_0xcad1('0x27')][_0xcad1('0x70')]=_0xc9dfee[0x0];if(!_0x3f1b8a[_0xcad1('0x57')][_0xcad1('0x5e')])return;return db[_0xcad1('0x71')][_0xcad1('0x55')]({'where':{'id':_0x3f1b8a[_0xcad1('0x57')]['UserId'],'role':_0xcad1('0x5f')},'attributes':['id',_0xcad1('0x36'),'fullname',_0xcad1('0x72'),_0xcad1('0x73')],'raw':!![]});}return null;})[_0xcad1('0x1e')](function(_0x5688f2){if(!_0x5688f2)return null;_0x2ca1ab[_0xcad1('0x27')][_0xcad1('0x5f')]=_0x5688f2;return _0x2ca1ab;})[_0xcad1('0x1e')](function(_0x351d44){if(_0x351d44){if(_0x3f1b8a[_0xcad1('0x57')][_0xcad1('0x74')]){_0x2ca1ab[_0xcad1('0x27')][_0xcad1('0x75')]=util[_0xcad1('0x5d')]('SIP/%s',_0x3f1b8a['user'][_0xcad1('0x36')]);_0x2ca1ab[_0xcad1('0x27')][_0xcad1('0x76')]=_0x2ca1ab[_0xcad1('0x76')];_0x2ca1ab['message'][_0xcad1('0x77')]=_0x2ca1ab[_0xcad1('0x76')];_0x2ca1ab[_0xcad1('0x27')][_0xcad1('0x78')]=_0xcad1('0x5a');return respondWithRpcPromise('EventManager',_0xcad1('0x79'),{'event':_0xcad1('0x7a'),'message':_0x2ca1ab[_0xcad1('0x27')]},client9002)['then'](function(){return _0x2ca1ab;});}return _0x2ca1ab;}return null;})[_0xcad1('0x1e')](respondWithResult(_0x199414,null))[_0xcad1('0x29')](handleError(_0x199414,null));};var interaction_log=require('../../config/logger')(_0xcad1('0x7b'));exports[_0xcad1('0x31')]=function(_0x13dcc7,_0x809b8d,_0x34ca7b){var _0x26ce28={'agent':{},'channel':_0xcad1('0x7c')};if(_0x13dcc7['body']['id']){delete _0x13dcc7[_0xcad1('0x57')]['id'];}_0x13dcc7[_0xcad1('0x57')][_0xcad1('0x5e')]=_0x13dcc7['body'][_0xcad1('0x5e')]||_0x13dcc7[_0xcad1('0x66')]['id'];_0x26ce28[_0xcad1('0x5f')]['id']=_0x13dcc7[_0xcad1('0x57')][_0xcad1('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x13dcc7[_0xcad1('0x52')]['id'],'UserId':null}})[_0xcad1('0x1e')](handleEntityNotFound(_0x809b8d,null))[_0xcad1('0x1e')](function(_0x21a3a4){if(_0x21a3a4){_0x26ce28[_0xcad1('0x27')]=_0x21a3a4[_0xcad1('0x64')]({'plain':!![]});return db[_0xcad1('0x7d')]['find']({'where':{'id':_0x21a3a4[_0xcad1('0x60')]}});}return null;})[_0xcad1('0x1e')](handleEntityNotFound(_0x809b8d,null))['then'](function(_0x3e33bd){if(_0x3e33bd){_0x26ce28[_0xcad1('0x63')]=_0x3e33bd[_0xcad1('0x64')]({'plain':!![]});interaction_log[_0xcad1('0x1f')](_0xcad1('0x7e'),_0x13dcc7['user']['id'],_0x13dcc7[_0xcad1('0x66')][_0xcad1('0x36')],_0x13dcc7[_0xcad1('0x66')]['role'],_0x26ce28[_0xcad1('0x63')]['id'],_0x13dcc7[_0xcad1('0x57')]?JSON[_0xcad1('0x24')](_0x13dcc7['body']):_0xcad1('0x67'));return respondWithRpcPromise(_0xcad1('0x7f'),_0xcad1('0x80'),_0x26ce28);}return null;})[_0xcad1('0x1e')](function(_0x1778a7){var _0x2c6302='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1778a7[_0xcad1('0x27')][_0xcad1('0x6b')];return db[_0xcad1('0x6c')][_0xcad1('0x3f')](_0x2c6302,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xcad1('0x1e')](function(_0x505f05){return _0x505f05;});})[_0xcad1('0x1e')](function(_0x3241ac){if(_0x3241ac){_0x26ce28['message'][_0xcad1('0x70')]=_0x3241ac[0x0];if(!_0x13dcc7[_0xcad1('0x57')][_0xcad1('0x5e')])return;return db[_0xcad1('0x71')][_0xcad1('0x55')]({'where':{'id':_0x13dcc7[_0xcad1('0x57')][_0xcad1('0x5e')],'role':_0xcad1('0x5f')},'attributes':['id',_0xcad1('0x36'),_0xcad1('0x81'),_0xcad1('0x72'),_0xcad1('0x73')],'raw':!![]});}return null;})['then'](function(_0x5e21b2){if(!_0x5e21b2)return null;_0x26ce28[_0xcad1('0x27')][_0xcad1('0x5f')]=_0x5e21b2;return _0x26ce28;})['then'](function(_0x3d2c87){if(_0x3d2c87){_0x3d2c87[_0xcad1('0x27')][_0xcad1('0x75')]=util['format'](_0xcad1('0x82'),_0x13dcc7[_0xcad1('0x66')][_0xcad1('0x36')]);_0x3d2c87[_0xcad1('0x27')][_0xcad1('0x76')]=_0x26ce28['channel'];_0x3d2c87['message']['motionChannel']=_0x26ce28['channel'];_0x3d2c87[_0xcad1('0x27')][_0xcad1('0x78')]=_0xcad1('0x31');respondWithRpcPromise(_0xcad1('0x79'),_0xcad1('0x79'),{'event':_0xcad1('0x83'),'message':_0x3d2c87[_0xcad1('0x27')]},client9002);return _0x26ce28;}return null;})[_0xcad1('0x1e')](respondWithResult(_0x809b8d,null))[_0xcad1('0x29')](handleError(_0x809b8d,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a81aa0e..16dddf3 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 _0x7b5b=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage'];(function(_0x215659,_0x44d4f5){var _0x29e732=function(_0x5e2905){while(--_0x5e2905){_0x215659['push'](_0x215659['shift']());}};_0x29e732(++_0x44d4f5);}(_0x7b5b,0x165));var _0xb7b5=function(_0x1f9029,_0x599e51){_0x1f9029=_0x1f9029-0x0;var _0x17d1f7=_0x7b5b[_0x1f9029];return _0x17d1f7;};'use strict';var EventEmitter=require(_0xb7b5('0x0'));var OpenchannelMessage=require(_0xb7b5('0x1'))['db'][_0xb7b5('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb7b5('0x3'),'afterUpdate':'update','afterDestroy':_0xb7b5('0x4')};function emitEvent(_0xddce6a){return function(_0xd4707f,_0x1522af,_0x125296){OpenchannelMessageEvents[_0xb7b5('0x5')](_0xddce6a+':'+_0xd4707f['id'],_0xd4707f);OpenchannelMessageEvents[_0xb7b5('0x5')](_0xddce6a,_0xd4707f);_0x125296(null);};}for(var e in events){if(events[_0xb7b5('0x6')](e)){var event=events[e];OpenchannelMessage[_0xb7b5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x6478=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2cd5df,_0x2ce81c){var _0x4b1b45=function(_0x27e2b9){while(--_0x27e2b9){_0x2cd5df['push'](_0x2cd5df['shift']());}};_0x4b1b45(++_0x2ce81c);}(_0x6478,0x165));var _0x8647=function(_0x9ded14,_0x34dbc9){_0x9ded14=_0x9ded14-0x0;var _0x20c47c=_0x6478[_0x9ded14];return _0x20c47c;};'use strict';var EventEmitter=require(_0x8647('0x0'));var OpenchannelMessage=require(_0x8647('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8647('0x2')](0x0);var events={'afterCreate':_0x8647('0x3'),'afterUpdate':'update','afterDestroy':_0x8647('0x4')};function emitEvent(_0x27cd75){return function(_0x33c4af,_0x4ce372,_0x16fa9b){OpenchannelMessageEvents[_0x8647('0x5')](_0x27cd75+':'+_0x33c4af['id'],_0x33c4af);OpenchannelMessageEvents[_0x8647('0x5')](_0x27cd75,_0x33c4af);_0x16fa9b(null);};}for(var e in events){if(events[_0x8647('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8647('0x7')](e,emitEvent(event));}}module[_0x8647('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 8401492..7e43e14 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 _0x6cb4=['define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes'];(function(_0x35f7db,_0x54269f){var _0x3a1b53=function(_0x459513){while(--_0x459513){_0x35f7db['push'](_0x35f7db['shift']());}};_0x3a1b53(++_0x54269f);}(_0x6cb4,0xff));var _0x46cb=function(_0x57ffd3,_0x5b19f8){_0x57ffd3=_0x57ffd3-0x0;var _0x534d1e=_0x6cb4[_0x57ffd3];return _0x534d1e;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[{'name':_0x46cb('0xd'),'fields':[_0x46cb('0xe')],'type':_0x46cb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56258a,_0x3d7663,_0x34f9e9){var _0x48101c=_0x3d9d3c[_0x46cb('0x10')];var _0x106a87=_0x56258a['get']({'plain':!![]});if(_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()==='in'||_0x106a87['direction']['toLowerCase']()==='out'&&!_0x106a87[_0x46cb('0x13')]&&!_[_0x46cb('0x14')](_0x106a87[_0x46cb('0x15')])){_0x48101c[_0x46cb('0x16')]['findOne']({'where':{'id':_0x106a87[_0x46cb('0x17')]}})[_0x46cb('0x18')](function(_0x2a1f9d){if(_0x2a1f9d){_0x2a1f9d[_0x46cb('0x19')]({'lastMsgAt':_0x106a87[_0x46cb('0x1a')],'lastMsgDirection':_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()});}})[_0x46cb('0x1b')](function(_0x37d368){console[_0x46cb('0x1c')](_0x37d368);});}if(_0x106a87[_0x46cb('0x11')]==='out'&&!_0x106a87[_0x46cb('0x13')]){var _0x5796d2;_0x48101c[_0x46cb('0x1d')]['describe']()['then'](function(_0x4e3454){return _0x48101c[_0x46cb('0x1e')][_0x46cb('0x1f')]({'where':{'id':_0x106a87[_0x46cb('0x20')]},'include':[{'model':_0x48101c[_0x46cb('0x16')],'as':_0x46cb('0x21'),'where':{'id':_0x106a87[_0x46cb('0x17')]},'limit':0x1,'include':[{'model':_0x48101c[_0x46cb('0x1d')],'as':_0x46cb('0x22'),'attributes':_[_0x46cb('0x23')](_0x4e3454)}]}]});})[_0x46cb('0x18')](function(_0x149483){_0x5796d2=_0x149483[_0x46cb('0x24')]({'plain':!![]});if(_0x5796d2&&_0x5796d2[_0x46cb('0x25')]){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x2a'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x5796d2[_0x46cb('0x21')]&&_0x5796d2[_0x46cb('0x21')][_0x46cb('0x2b')]){_0x106a87[_0x46cb('0x2c')]=_[_0x46cb('0x2d')](_0x5796d2[_0x46cb('0x21')][0x0],'Contact');_0x106a87['Contact']=_0x5796d2[_0x46cb('0x21')][0x0][_0x46cb('0x22')];}var _0x3d7663={'method':_0x46cb('0x2e'),'uri':encodeURI(_0x5796d2[_0x46cb('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d7663['method']){case _0x46cb('0x2f'):_0x3d7663['qs']=_0x106a87;break;case'POST':_0x3d7663['body']=_0x106a87;break;}return rp(_0x3d7663)['then'](function(_0x180ce1){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x30'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]&&_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]!=_0x106a87['Interaction'][_0x46cb('0x31')]){return _0x48101c[_0x46cb('0x16')]['update']({'threadId':_0x180ce1['body'][_0x46cb('0x31')]},{'logging':!![],'where':{'id':_0x106a87['Interaction']['id']}});}else{return;}})[_0x46cb('0x18')](function(){return _0x56258a[_0x46cb('0x19')]({'read':!![]});})[_0x46cb('0x1b')](function(_0xd96713){logger[_0x46cb('0x1c')](_0x46cb('0x27'),'afterCreate',util[_0x46cb('0x32')](_0xd96713,{'showHidden':![],'depth':null}));_0x34f9e9();});}else{_0x34f9e9();}})['finally'](function(){_0x34f9e9();});}else{_0x34f9e9();}}},'charset':_0x46cb('0x33'),'collate':_0x46cb('0x34')});}; \ No newline at end of file +var _0xb7e7=['../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','method','GET','POST','OpenchannelMessage,\x20%s,\x20%s','threadId','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0xf3a531,_0x4a9666){var _0x49d51=function(_0xa0ae64){while(--_0xa0ae64){_0xf3a531['push'](_0xf3a531['shift']());}};_0x49d51(++_0x4a9666);}(_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 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':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0xa')],'type':_0x7b7e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1647e5,_0x148964,_0x26bb8d){var _0x242e70=_0x53ed64['models'];var _0x299519=_0x1647e5[_0x7b7e('0xc')]({'plain':!![]});if(_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()==='in'||_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()===_0x7b7e('0xf')&&!_0x299519[_0x7b7e('0x10')]&&!_[_0x7b7e('0x11')](_0x299519['UserId'])){_0x242e70[_0x7b7e('0x12')][_0x7b7e('0x13')]({'where':{'id':_0x299519['OpenchannelInteractionId']}})[_0x7b7e('0x14')](function(_0x5976ac){if(_0x5976ac){_0x5976ac['update']({'lastMsgAt':_0x299519[_0x7b7e('0x15')],'lastMsgDirection':_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()});}})[_0x7b7e('0x16')](function(_0x3d2fb2){console['error'](_0x3d2fb2);});}if(_0x299519['direction']===_0x7b7e('0xf')&&!_0x299519[_0x7b7e('0x10')]){var _0x27f999;_0x242e70[_0x7b7e('0x17')][_0x7b7e('0x18')]()[_0x7b7e('0x14')](function(_0x242368){return _0x242e70[_0x7b7e('0x19')][_0x7b7e('0x1a')]({'where':{'id':_0x299519[_0x7b7e('0x1b')]},'include':[{'model':_0x242e70[_0x7b7e('0x12')],'as':_0x7b7e('0x1c'),'where':{'id':_0x299519[_0x7b7e('0x1d')]},'limit':0x1,'include':[{'model':_0x242e70[_0x7b7e('0x17')],'as':_0x7b7e('0x1e'),'attributes':_[_0x7b7e('0x1f')](_0x242368)}]}]});})[_0x7b7e('0x14')](function(_0x49eddb){_0x27f999=_0x49eddb[_0x7b7e('0xc')]({'plain':!![]});if(_0x27f999&&_0x27f999[_0x7b7e('0x20')]){logger[_0x7b7e('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x7b7e('0x22'),util[_0x7b7e('0x23')](_0x7b7e('0x24'),_0x299519['id'],_0x27f999[_0x7b7e('0x20')]));if(_0x27f999[_0x7b7e('0x1c')]&&_0x27f999[_0x7b7e('0x1c')][_0x7b7e('0x25')]){_0x299519[_0x7b7e('0x26')]=_['omit'](_0x27f999['Interactions'][0x0],'Contact');_0x299519[_0x7b7e('0x1e')]=_0x27f999[_0x7b7e('0x1c')][0x0][_0x7b7e('0x1e')];}var _0x148964={'method':'POST','uri':encodeURI(_0x27f999['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x148964[_0x7b7e('0x27')]){case _0x7b7e('0x28'):_0x148964['qs']=_0x299519;break;case _0x7b7e('0x29'):_0x148964[_0x7b7e('0xa')]=_0x299519;break;}return rp(_0x148964)[_0x7b7e('0x14')](function(_0x48fad1){logger[_0x7b7e('0x21')](_0x7b7e('0x2a'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x299519['id'],_0x27f999[_0x7b7e('0x20')]));if(_0x48fad1[_0x7b7e('0xa')]['threadId']&&_0x48fad1[_0x7b7e('0xa')]['threadId']!=_0x299519[_0x7b7e('0x26')][_0x7b7e('0x2b')]){return _0x242e70[_0x7b7e('0x12')]['update']({'threadId':_0x48fad1[_0x7b7e('0xa')][_0x7b7e('0x2b')]},{'logging':!![],'where':{'id':_0x299519[_0x7b7e('0x26')]['id']}});}else{return;}})[_0x7b7e('0x14')](function(){return _0x1647e5[_0x7b7e('0x2c')]({'read':!![]});})['catch'](function(_0x41af57){logger['error'](_0x7b7e('0x2a'),_0x7b7e('0x22'),util[_0x7b7e('0x2d')](_0x41af57,{'showHidden':![],'depth':null}));_0x26bb8d();});}else{_0x26bb8d();}})[_0x7b7e('0x2e')](function(){_0x26bb8d();});}else{_0x26bb8d();}}},'charset':_0x7b7e('0x2f'),'collate':_0x7b7e('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 121ebcf..c89cdfb 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x13df51,_0x5c63a7){var _0x27c283=function(_0x176f26){while(--_0x176f26){_0x13df51['push'](_0x13df51['shift']());}};_0x27c283(++_0x5c63a7);}(_0x1261,0x144));var _0x1126=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x1261[_0x1d29f6];return _0x491093;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x37c4e1,_0x43bf03){var _0x4a1c63=function(_0x442a27){while(--_0x442a27){_0x37c4e1['push'](_0x37c4e1['shift']());}};_0x4a1c63(++_0x43bf03);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index bfa8078..c36e401 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 _0x1052=['save','remove','update','emit','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x1052,0xf4));var _0x2105=function(_0xdac383,_0x505d99){_0xdac383=_0xdac383-0x0;var _0x3e783d=_0x1052[_0xdac383];return _0x3e783d;};'use strict';var OpenchannelMessageEvents=require(_0x2105('0x0'));var events=[_0x2105('0x1'),_0x2105('0x2'),_0x2105('0x3')];function createListener(_0x1644e8,_0x7d7b47){return function(_0x265e12){_0x7d7b47[_0x2105('0x4')](_0x1644e8,_0x265e12);};}function removeListener(_0x1e106c,_0x5c1e84){return function(){OpenchannelMessageEvents['removeListener'](_0x1e106c,_0x5c1e84);};}exports[_0x2105('0x5')]=function(_0x4a4e6b){for(var _0x126cd9=0x0,_0x9b262=events['length'];_0x126cd9<_0x9b262;_0x126cd9++){var _0x1e6ad5=events[_0x126cd9];var _0x20d2b4=createListener(_0x2105('0x6')+_0x1e6ad5,_0x4a4e6b);OpenchannelMessageEvents['on'](_0x1e6ad5,_0x20d2b4);}}; \ No newline at end of file +var _0xb835=['update','emit','register','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xb835,0xcd));var _0x5b83=function(_0x263e7b,_0x5c2b06){_0x263e7b=_0x263e7b-0x0;var _0x5a02b7=_0xb835[_0x263e7b];return _0x5a02b7;};'use strict';var OpenchannelMessageEvents=require(_0x5b83('0x0'));var events=[_0x5b83('0x1'),_0x5b83('0x2'),_0x5b83('0x3')];function createListener(_0x2b425c,_0x30c429){return function(_0x94077b){_0x30c429[_0x5b83('0x4')](_0x2b425c,_0x94077b);};}function removeListener(_0x2f0f36,_0x4ac305){return function(){OpenchannelMessageEvents['removeListener'](_0x2f0f36,_0x4ac305);};}exports[_0x5b83('0x5')]=function(_0x61ba21){for(var _0x4eb6a8=0x0,_0x42119b=events[_0x5b83('0x6')];_0x4eb6a8<_0x42119b;_0x4eb6a8++){var _0x50ff39=events[_0x4eb6a8];var _0x4eaa74=createListener(_0x5b83('0x7')+_0x50ff39,_0x61ba21);OpenchannelMessageEvents['on'](_0x50ff39,_0x4eaa74);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 35fa3d6..3fc172d 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 _0x3b59=['getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','getMembers','getTeams'];(function(_0x2e2032,_0x2a2de4){var _0x157128=function(_0x57ecf2){while(--_0x57ecf2){_0x2e2032['push'](_0x2e2032['shift']());}};_0x157128(++_0x2a2de4);}(_0x3b59,0x1d8));var _0x93b5=function(_0x636f04,_0x49360a){_0x636f04=_0x636f04-0x0;var _0x1c6cae=_0x3b59[_0x636f04];return _0x1c6cae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x93b5('0x0'));var express=require(_0x93b5('0x1'));var router=express[_0x93b5('0x2')]();var fs_extra=require(_0x93b5('0x3'));var auth=require(_0x93b5('0x4'));var interaction=require(_0x93b5('0x5'));var config=require(_0x93b5('0x6'));var controller=require(_0x93b5('0x7'));router[_0x93b5('0x8')]('/',auth[_0x93b5('0x9')](),controller['index']);router[_0x93b5('0x8')](_0x93b5('0xa'),auth[_0x93b5('0x9')](),controller['describe']);router['get'](_0x93b5('0xb'),auth[_0x93b5('0x9')](),controller['show']);router[_0x93b5('0x8')]('/:id/members',auth[_0x93b5('0x9')](),controller[_0x93b5('0xc')]);router[_0x93b5('0x8')]('/:id/teams',auth[_0x93b5('0x9')](),controller[_0x93b5('0xd')]);router[_0x93b5('0x8')]('/:id/users',auth[_0x93b5('0x9')](),controller[_0x93b5('0xe')]);router[_0x93b5('0xf')]('/',auth[_0x93b5('0x9')](),controller[_0x93b5('0x10')]);router[_0x93b5('0xf')](_0x93b5('0x11'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x12')]);router['post'](_0x93b5('0x13'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x14')]);router[_0x93b5('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x93b5('0x16')]('/:id',auth[_0x93b5('0x9')](),controller[_0x93b5('0x17')]);router['delete'](_0x93b5('0x11'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x18')]);router[_0x93b5('0x16')](_0x93b5('0x13'),auth[_0x93b5('0x9')](),controller[_0x93b5('0x19')]);module[_0x93b5('0x1a')]=router; \ No newline at end of file +var _0xa01a=['show','/:id/members','getMembers','getTeams','post','create','/:id/teams','addTeams','addAgents','update','delete','destroy','/:id/users','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x3e9bf7,_0x4305df){var _0x5769bf=function(_0x489093){while(--_0x489093){_0x3e9bf7['push'](_0x3e9bf7['shift']());}};_0x5769bf(++_0x4305df);}(_0xa01a,0x66));var _0xaa01=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa01a[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require(_0xaa01('0x0'));var path=require('path');var timeout=require(_0xaa01('0x1'));var express=require(_0xaa01('0x2'));var router=express[_0xaa01('0x3')]();var fs_extra=require(_0xaa01('0x4'));var auth=require(_0xaa01('0x5'));var interaction=require(_0xaa01('0x6'));var config=require('../../config/environment');var controller=require(_0xaa01('0x7'));router[_0xaa01('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa01('0x9')]);router[_0xaa01('0x8')](_0xaa01('0xa'),auth[_0xaa01('0xb')](),controller[_0xaa01('0xc')]);router['get'](_0xaa01('0xd'),auth[_0xaa01('0xb')](),controller[_0xaa01('0xe')]);router[_0xaa01('0x8')](_0xaa01('0xf'),auth[_0xaa01('0xb')](),controller[_0xaa01('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xaa01('0x11')]);router[_0xaa01('0x8')]('/:id/users',auth[_0xaa01('0xb')](),controller['getAgents']);router[_0xaa01('0x12')]('/',auth[_0xaa01('0xb')](),controller[_0xaa01('0x13')]);router[_0xaa01('0x12')](_0xaa01('0x14'),auth['isAuthenticated'](),controller[_0xaa01('0x15')]);router[_0xaa01('0x12')]('/:id/users',auth[_0xaa01('0xb')](),controller[_0xaa01('0x16')]);router['put'](_0xaa01('0xd'),auth['isAuthenticated'](),controller[_0xaa01('0x17')]);router[_0xaa01('0x18')](_0xaa01('0xd'),auth['isAuthenticated'](),controller[_0xaa01('0x19')]);router['delete'](_0xaa01('0x14'),auth[_0xaa01('0xb')](),controller['removeTeams']);router[_0xaa01('0x18')](_0xaa01('0x1a'),auth[_0xaa01('0xb')](),controller[_0xaa01('0x1b')]);module[_0xaa01('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a6509fa..c055efe 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 _0x9e18=['ENUM','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x9e18,0xb1));var _0x89e1=function(_0x54e856,_0x313d5c){_0x54e856=_0x54e856-0x0;var _0x124873=_0x9e18[_0x54e856];return _0x124873;};'use strict';var Sequelize=require(_0x89e1('0x0'));module[_0x89e1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x89e1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x89e1('0x3')]},'timeout':{'type':Sequelize[_0x89e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x89e1('0x5')]('rrmemory',_0x89e1('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x16da=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x16da,0x1b7));var _0xa16d=function(_0x5c8003,_0x1b403a){_0x5c8003=_0x5c8003-0x0;var _0x340164=_0x16da[_0x5c8003];return _0x340164;};'use strict';var Sequelize=require(_0xa16d('0x0'));module[_0xa16d('0x1')]={'name':{'type':Sequelize[_0xa16d('0x2')],'unique':_0xa16d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa16d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa16d('0x5')](_0xa16d('0x6'),_0xa16d('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d4e7ca0..7139c8e 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 _0x7837=['keys','filters','intersection','model','query','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelQueues','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','hasOwnProperty','nolimit','OpenchannelQueueId','UserOpenchannelQueue','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','forEach','omit','spread','isArray','userOpenchannelQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','stack','name','map','key'];(function(_0x15a1af,_0x40e4ac){var _0x574500=function(_0x29df02){while(--_0x29df02){_0x15a1af['push'](_0x15a1af['shift']());}};_0x574500(++_0x40e4ac);}(_0x7837,0xdb));var _0x7783=function(_0x58c444,_0x1dc41f){_0x58c444=_0x58c444-0x0;var _0x37789e=_0x7837[_0x58c444];return _0x37789e;};'use strict';var emlformat=require(_0x7783('0x0'));var rimraf=require(_0x7783('0x1'));var zipdir=require(_0x7783('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7783('0x3'));var moment=require(_0x7783('0x4'));var BPromise=require(_0x7783('0x5'));var Mustache=require('mustache');var util=require(_0x7783('0x6'));var path=require(_0x7783('0x7'));var sox=require(_0x7783('0x8'));var csv=require('to-csv');var ejs=require(_0x7783('0x9'));var fs=require('fs');var fs_extra=require(_0x7783('0xa'));var _=require(_0x7783('0xb'));var squel=require(_0x7783('0xc'));var crypto=require('crypto');var jsforce=require(_0x7783('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7783('0xe'));var querystring=require(_0x7783('0xf'));var Papa=require(_0x7783('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7783('0x11'));var hardwareService=require(_0x7783('0x12'));var logger=require(_0x7783('0x13'))(_0x7783('0x14'));var utils=require(_0x7783('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7783('0x16'));var db=require(_0x7783('0x17'))['db'];config['redis']=_[_0x7783('0x18')](config[_0x7783('0x19')],{'host':_0x7783('0x1a'),'port':0x18eb});var socket=require(_0x7783('0x1b'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x112698,_0x1121f8){_0x1121f8=_0x1121f8||0xcc;return function(_0x266330){if(_0x266330){return _0x112698[_0x7783('0x1c')](_0x1121f8);}return _0x112698[_0x7783('0x1d')](_0x1121f8)[_0x7783('0x1e')]();};}function respondWithResult(_0xf64d69,_0x3c38a6){_0x3c38a6=_0x3c38a6||0xc8;return function(_0x21a532){if(_0x21a532){return _0xf64d69[_0x7783('0x1d')](_0x3c38a6)[_0x7783('0x1f')](_0x21a532);}};}function respondWithFilteredResult(_0x178f70,_0x37f256){return function(_0x4849c5){if(_0x4849c5){var _0x40e37c=typeof _0x37f256['offset']==='undefined'&&typeof _0x37f256[_0x7783('0x20')]===_0x7783('0x21');var _0x4fd279=_0x4849c5[_0x7783('0x22')];var _0x2434de=_0x40e37c?0x0:_0x37f256[_0x7783('0x23')];var _0x1dcd9a=_0x40e37c?_0x4849c5[_0x7783('0x22')]:_0x37f256[_0x7783('0x23')]+_0x37f256[_0x7783('0x20')];var _0x36f68d;if(_0x1dcd9a>=_0x4fd279){_0x1dcd9a=_0x4fd279;_0x36f68d=0xc8;}else{_0x36f68d=0xce;}_0x178f70[_0x7783('0x1d')](_0x36f68d);return _0x178f70[_0x7783('0x24')](_0x7783('0x25'),_0x2434de+'-'+_0x1dcd9a+'/'+_0x4fd279)[_0x7783('0x1f')](_0x4849c5);}return null;};}function patchUpdates(_0x30dfaa){return function(_0x1ca13a){try{jsonpatch[_0x7783('0x26')](_0x1ca13a,_0x30dfaa,!![]);}catch(_0x4a1dde){return BPromise['reject'](_0x4a1dde);}return _0x1ca13a[_0x7783('0x27')]();};}function saveUpdates(_0x461037,_0x350aba){return function(_0x4057c8){if(_0x4057c8){return _0x4057c8[_0x7783('0x28')](_0x461037)['then'](function(_0x4c5b50){return _0x4c5b50;});}return null;};}function removeEntity(_0x1cd663,_0x59a191){return function(_0x24d85f){if(_0x24d85f){return _0x24d85f['destroy']()[_0x7783('0x29')](function(){var _0x5c07f7=_0x24d85f[_0x7783('0x2a')]({'plain':!![]});var _0xfcda89='OpenchannelQueues';return db[_0x7783('0x2b')]['destroy']({'where':{'type':_0xfcda89,'resourceId':_0x5c07f7['id']}})['then'](function(){return _0x24d85f;});})[_0x7783('0x29')](function(){_0x1cd663[_0x7783('0x1d')](0xcc)[_0x7783('0x1e')]();});}};}function handleEntityNotFound(_0x4ac1f4,_0x40e796){return function(_0x3a0fbc){if(!_0x3a0fbc){_0x4ac1f4[_0x7783('0x1c')](0x194);}return _0x3a0fbc;};}function handleError(_0x4405c4,_0x38c4a6){_0x38c4a6=_0x38c4a6||0x1f4;return function(_0x57b831){logger[_0x7783('0x2c')](_0x57b831[_0x7783('0x2d')]);if(_0x57b831[_0x7783('0x2e')]){delete _0x57b831['name'];}_0x4405c4[_0x7783('0x1d')](_0x38c4a6)['send'](_0x57b831);};}exports['index']=function(_0x5a7505,_0x1ba4e3){var _0x394fc3={},_0x3e3f88={},_0x2e6ba9={'count':0x0,'rows':[]};var _0x26a742=_[_0x7783('0x2f')](db['OpenchannelQueue']['rawAttributes'],function(_0x3d8a48){return{'name':_0x3d8a48['fieldName'],'type':_0x3d8a48['type'][_0x7783('0x30')]};});_0x3e3f88['model']=_[_0x7783('0x2f')](_0x26a742,_0x7783('0x2e'));_0x3e3f88['query']=_[_0x7783('0x31')](_0x5a7505['query']);_0x3e3f88[_0x7783('0x32')]=_[_0x7783('0x33')](_0x3e3f88[_0x7783('0x34')],_0x3e3f88[_0x7783('0x35')]);_0x394fc3[_0x7783('0x36')]=_['intersection'](_0x3e3f88[_0x7783('0x34')],qs[_0x7783('0x37')](_0x5a7505[_0x7783('0x35')]['fields']));_0x394fc3[_0x7783('0x36')]=_0x394fc3[_0x7783('0x36')][_0x7783('0x38')]?_0x394fc3[_0x7783('0x36')]:_0x3e3f88[_0x7783('0x34')];if(!_0x5a7505['query']['hasOwnProperty']('nolimit')){_0x394fc3[_0x7783('0x20')]=qs[_0x7783('0x20')](_0x5a7505['query'][_0x7783('0x20')]);_0x394fc3[_0x7783('0x23')]=qs[_0x7783('0x23')](_0x5a7505[_0x7783('0x35')][_0x7783('0x23')]);}_0x394fc3[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0x5a7505[_0x7783('0x35')][_0x7783('0x3a')]);_0x394fc3[_0x7783('0x3b')]=qs['filters'](_[_0x7783('0x3c')](_0x5a7505[_0x7783('0x35')],_0x3e3f88[_0x7783('0x32')]),_0x26a742);if(_0x5a7505['query'][_0x7783('0x3d')]){_0x394fc3[_0x7783('0x3b')]=_['merge'](_0x394fc3[_0x7783('0x3b')],{'$or':_['map'](_0x26a742,function(_0x4e5da8){if(_0x4e5da8[_0x7783('0x3e')]!==_0x7783('0x3f')){var _0x2a24ea={};_0x2a24ea[_0x4e5da8[_0x7783('0x2e')]]={'$like':'%'+_0x5a7505[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x2a24ea;}})});}_0x394fc3=_[_0x7783('0x40')]({},_0x394fc3,_0x5a7505['options']);var _0x167a68={'where':_0x394fc3[_0x7783('0x3b')]};return db[_0x7783('0x41')][_0x7783('0x22')](_0x167a68)[_0x7783('0x29')](function(_0x196057){_0x2e6ba9['count']=_0x196057;if(_0x5a7505[_0x7783('0x35')][_0x7783('0x42')]){_0x394fc3[_0x7783('0x43')]=[{'all':!![]}];}return db[_0x7783('0x41')][_0x7783('0x44')](_0x394fc3);})['then'](function(_0x1410a8){_0x2e6ba9[_0x7783('0x45')]=_0x1410a8;return _0x2e6ba9;})[_0x7783('0x29')](respondWithFilteredResult(_0x1ba4e3,_0x394fc3))[_0x7783('0x46')](handleError(_0x1ba4e3,null));};exports[_0x7783('0x47')]=function(_0x1335dc,_0x1e9609){var _0x4e0cf5={'raw':!![],'where':{'id':_0x1335dc[_0x7783('0x48')]['id']}},_0x2f5ec2={};_0x2f5ec2[_0x7783('0x34')]=_[_0x7783('0x31')](db['OpenchannelQueue'][_0x7783('0x49')]);_0x2f5ec2['query']=_[_0x7783('0x31')](_0x1335dc['query']);_0x2f5ec2[_0x7783('0x32')]=_[_0x7783('0x33')](_0x2f5ec2[_0x7783('0x34')],_0x2f5ec2[_0x7783('0x35')]);_0x4e0cf5['attributes']=_[_0x7783('0x33')](_0x2f5ec2[_0x7783('0x34')],qs[_0x7783('0x37')](_0x1335dc['query'][_0x7783('0x37')]));_0x4e0cf5['attributes']=_0x4e0cf5[_0x7783('0x36')][_0x7783('0x38')]?_0x4e0cf5['attributes']:_0x2f5ec2[_0x7783('0x34')];if(_0x1335dc[_0x7783('0x35')][_0x7783('0x42')]){_0x4e0cf5[_0x7783('0x43')]=[{'all':!![]}];}_0x4e0cf5=_[_0x7783('0x40')]({},_0x4e0cf5,_0x1335dc[_0x7783('0x4a')]);return db[_0x7783('0x41')]['find'](_0x4e0cf5)[_0x7783('0x29')](handleEntityNotFound(_0x1e9609,null))[_0x7783('0x29')](respondWithResult(_0x1e9609,null))['catch'](handleError(_0x1e9609,null));};exports[_0x7783('0x4b')]=function(_0x54680f,_0xcc6bd6){return db['OpenchannelQueue'][_0x7783('0x4b')](_0x54680f[_0x7783('0x4c')],{})['then'](function(_0x566fc4){var _0x3b5bb0=_0x54680f['user'][_0x7783('0x2a')]({'plain':!![]});if(!_0x3b5bb0)throw new Error(_0x7783('0x4d'));if(_0x3b5bb0['role']===_0x7783('0x4e')){var _0x1f71c9=_0x566fc4[_0x7783('0x2a')]({'plain':!![]});var _0x442700=_0x7783('0x4f');return db[_0x7783('0x50')][_0x7783('0x51')]({'where':{'name':_0x442700,'userProfileId':_0x3b5bb0[_0x7783('0x52')]},'raw':!![]})[_0x7783('0x29')](function(_0x2ab756){if(_0x2ab756&&_0x2ab756[_0x7783('0x53')]===0x0){return db[_0x7783('0x2b')][_0x7783('0x4b')]({'name':_0x1f71c9['name'],'resourceId':_0x1f71c9['id'],'type':_0x2ab756['name'],'sectionId':_0x2ab756['id']},{})[_0x7783('0x29')](function(){return _0x566fc4;});}else{return _0x566fc4;}})[_0x7783('0x46')](function(_0x3cdf9f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cdf9f);throw _0x3cdf9f;});}return _0x566fc4;})[_0x7783('0x29')](respondWithResult(_0xcc6bd6,0xc9))[_0x7783('0x46')](handleError(_0xcc6bd6,null));};exports[_0x7783('0x28')]=function(_0x2bba6f,_0x5e029a){if(_0x2bba6f['body']['id']){delete _0x2bba6f['body']['id'];}return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x2bba6f[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x5e029a,null))[_0x7783('0x29')](saveUpdates(_0x2bba6f[_0x7783('0x4c')],null))['then'](respondWithResult(_0x5e029a,null))[_0x7783('0x46')](handleError(_0x5e029a,null));};exports['destroy']=function(_0x213f78,_0x15f0b2){return db['OpenchannelQueue'][_0x7783('0x51')]({'where':{'id':_0x213f78[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x15f0b2,null))[_0x7783('0x29')](removeEntity(_0x15f0b2,null))[_0x7783('0x46')](handleError(_0x15f0b2,null));};exports[_0x7783('0x54')]=function(_0x48d387,_0x2da885){return db['OpenchannelQueue'][_0x7783('0x54')]()['then'](respondWithResult(_0x2da885,null))[_0x7783('0x46')](handleError(_0x2da885,null));};exports[_0x7783('0x55')]=function(_0xb4ff15,_0x440408,_0x2ff680){var _0x30bc44={'raw':!![],'where':{}},_0x22b011={},_0x39c8f3;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xb4ff15[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x440408,null))[_0x7783('0x29')](function(_0x4d92e4){if(_0x4d92e4){_0x39c8f3=_0x4d92e4[_0x7783('0x2a')]({'plain':!![]});_0x22b011[_0x7783('0x34')]=_[_0x7783('0x31')](db['UserOpenchannelQueue'][_0x7783('0x49')]);_0x22b011[_0x7783('0x35')]=_['keys'](_0xb4ff15[_0x7783('0x35')]);_0x22b011[_0x7783('0x32')]=_[_0x7783('0x33')](_0x22b011[_0x7783('0x34')],_0x22b011[_0x7783('0x35')]);_0x30bc44['attributes']=_[_0x7783('0x33')](_0x22b011['model'],qs[_0x7783('0x37')](_0xb4ff15[_0x7783('0x35')][_0x7783('0x37')]));_0x30bc44['attributes']=_0x30bc44[_0x7783('0x36')][_0x7783('0x38')]?_0x30bc44[_0x7783('0x36')]:_0x22b011['model'];if(!_0xb4ff15[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x30bc44[_0x7783('0x20')]=qs[_0x7783('0x20')](_0xb4ff15['query'][_0x7783('0x20')]);_0x30bc44[_0x7783('0x23')]=qs[_0x7783('0x23')](_0xb4ff15[_0x7783('0x35')]['offset']);}_0x30bc44[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0xb4ff15[_0x7783('0x35')][_0x7783('0x3a')]);_0x30bc44['where']=qs[_0x7783('0x32')](_['pick'](_0xb4ff15[_0x7783('0x35')],_0x22b011[_0x7783('0x32')]));_0x30bc44[_0x7783('0x3b')][_0x7783('0x58')]=_0x4d92e4['id'];if(_0xb4ff15[_0x7783('0x35')][_0x7783('0x3d')]){_0x30bc44['where']=_[_0x7783('0x40')](_0x30bc44[_0x7783('0x3b')],{'$or':_['map'](_0x30bc44[_0x7783('0x36')],function(_0x20cc01){var _0x584028={};_0x584028[_0x20cc01]={'$like':'%'+_0xb4ff15[_0x7783('0x35')]['filter']+'%'};return _0x584028;})});}_0x30bc44=_[_0x7783('0x40')]({},_0x30bc44,_0xb4ff15[_0x7783('0x4a')]);return db[_0x7783('0x59')][_0x7783('0x44')](_0x30bc44);}})['then'](function(_0x11c530){if(_0x11c530){return db['User']['findAndCountAll']({'where':{'id':_[_0x7783('0x2f')](_0x11c530,'UserId'),'role':'agent'},'attributes':['id',_0x7783('0x2e'),'openchannelPause','updatedAt',_0x7783('0x5a')]});}})[_0x7783('0x29')](function(_0x36830d){if(_0x36830d){return{'count':_0x36830d[_0x7783('0x22')],'rows':_['map'](_0x36830d[_0x7783('0x45')],function(_0x57cbf8){return{'membername':_0x57cbf8['name'],'UserId':_0x57cbf8['id'],'queue_name':_0x39c8f3[_0x7783('0x2e')],'OpenchannelQueueId':_0x39c8f3['id'],'interface':util[_0x7783('0x5b')]('%s/%s',_0x7783('0x5c'),_0x57cbf8[_0x7783('0x2e')]),'penalty':0x0,'paused':_0x57cbf8['openchannelPause'],'createdAt':_0x57cbf8[_0x7783('0x5a')],'updatedAt':_0x57cbf8[_0x7783('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7783('0x29')](respondWithFilteredResult(_0x440408,_0x30bc44))[_0x7783('0x46')](handleError(_0x440408,null));};exports[_0x7783('0x5e')]=function(_0x244ce3,_0x5f449d,_0x16328d){var _0x4f44e6={};var _0x1e6ca3={};var _0x303205;var _0x41d9d1;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x244ce3['params']['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x5f449d,null))['then'](function(_0x3e6111){if(_0x3e6111){_0x303205=_0x3e6111;_0x1e6ca3[_0x7783('0x34')]=_[_0x7783('0x31')](db[_0x7783('0x5f')][_0x7783('0x49')]);_0x1e6ca3[_0x7783('0x35')]=_[_0x7783('0x31')](_0x244ce3[_0x7783('0x35')]);_0x1e6ca3['filters']=_[_0x7783('0x33')](_0x1e6ca3[_0x7783('0x34')],_0x1e6ca3[_0x7783('0x35')]);_0x4f44e6['attributes']=_[_0x7783('0x33')](_0x1e6ca3[_0x7783('0x34')],qs[_0x7783('0x37')](_0x244ce3[_0x7783('0x35')][_0x7783('0x37')]));_0x4f44e6[_0x7783('0x36')]=_0x4f44e6[_0x7783('0x36')][_0x7783('0x38')]?_0x4f44e6[_0x7783('0x36')]:_0x1e6ca3[_0x7783('0x34')];_0x4f44e6[_0x7783('0x39')]=qs['sort'](_0x244ce3[_0x7783('0x35')][_0x7783('0x3a')]);_0x4f44e6['where']=qs['filters'](_['pick'](_0x244ce3[_0x7783('0x35')],_0x1e6ca3[_0x7783('0x32')]));if(_0x244ce3['query'][_0x7783('0x3d')]){_0x4f44e6[_0x7783('0x3b')]=_[_0x7783('0x40')](_0x4f44e6[_0x7783('0x3b')],{'$or':_[_0x7783('0x2f')](_0x4f44e6[_0x7783('0x36')],function(_0x59db98){var _0x2b41b4={};_0x2b41b4[_0x59db98]={'$like':'%'+_0x244ce3[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x2b41b4;})});}_0x4f44e6=_[_0x7783('0x40')]({},_0x4f44e6,_0x244ce3[_0x7783('0x4a')]);return _0x303205[_0x7783('0x5e')](_0x4f44e6);}})[_0x7783('0x29')](function(_0x2e2d5a){if(_0x2e2d5a){_0x41d9d1=_0x2e2d5a['length'];if(!_0x244ce3[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x4f44e6[_0x7783('0x20')]=qs[_0x7783('0x20')](_0x244ce3[_0x7783('0x35')][_0x7783('0x20')]);_0x4f44e6[_0x7783('0x23')]=qs['offset'](_0x244ce3[_0x7783('0x35')][_0x7783('0x23')]);}return _0x303205[_0x7783('0x5e')](_0x4f44e6);}})['then'](function(_0xb1f160){if(_0xb1f160){return _0xb1f160?{'count':_0x41d9d1,'rows':_0xb1f160}:null;}})[_0x7783('0x29')](respondWithResult(_0x5f449d,null))[_0x7783('0x46')](handleError(_0x5f449d,null));};exports[_0x7783('0x60')]=function(_0xb14a69,_0x4344fc,_0x560917){var _0x1b327d=_0xb14a69[_0x7783('0x4c')][_0x7783('0x61')];return db[_0x7783('0x5f')][_0x7783('0x44')]({'where':{'id':_0x1b327d},'attributes':['id'],'include':[{'model':db[_0x7783('0x62')],'as':'Agents','attributes':['id','name',_0x7783('0x63'),_0x7783('0x64'),_0x7783('0x65')],'raw':!![]}]})[_0x7783('0x29')](function(_0x20ce52){if(_0x20ce52){var _0x5a83cf=_[_0x7783('0x66')](_0x20ce52,function(_0x5a181a){var _0x176a46=_0x5a181a[_0x7783('0x2a')]({'plain':!![]});return _0x176a46[_0x7783('0x67')];});return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0xb14a69[_0x7783('0x48')]['id']}})[_0x7783('0x29')](function(_0x290d16){return db[_0x7783('0x68')][_0x7783('0x69')](function(_0x10ee34){return _0x290d16['addTeams'](_0x1b327d,{'transaction':_0x10ee34})[_0x7783('0x29')](function(){return BPromise[_0x7783('0x6a')](_0x5a83cf,function(_0x2e5948){return db[_0x7783('0x59')]['findOrCreate']({'where':{'UserId':_0x2e5948['id'],'OpenchannelQueueId':_0xb14a69[_0x7783('0x48')]['id']},'transaction':_0x10ee34});});})[_0x7783('0x29')](function(){_0x5a83cf['forEach'](function(_0x1ae2dc){socket[_0x7783('0x6b')](_0x7783('0x6c'),{'UserId':_0x1ae2dc['id'],'OpenchannelQueueId':_0x290d16['id']});});});});});}})['then'](respondWithStatusCode(_0x4344fc,null))[_0x7783('0x46')](handleError(_0x4344fc,null));};exports[_0x7783('0x6d')]=function(_0x20e32d,_0x1b487d,_0x1043eb){return db[_0x7783('0x5f')][_0x7783('0x44')]({'where':{'id':_0x20e32d[_0x7783('0x35')][_0x7783('0x61')]},'attributes':['id'],'include':[{'model':db[_0x7783('0x62')],'as':_0x7783('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b487d,null))[_0x7783('0x29')](function(_0x2739bd){var _0x374bac=_[_0x7783('0x2f')](_0x2739bd,'id');var _0x563fb2=[];var _0x597107=[];var _0x839a83=squel['select']();_0x839a83['field'](_0x7783('0x6e'))[_0x7783('0x6f')](_0x7783('0x70'),'tq')[_0x7783('0x71')](_0x7783('0x72'),'ut',_0x7783('0x73'))[_0x7783('0x3b')]('OpenchannelQueueId\x20=\x20?',_0x20e32d['params']['id']);for(var _0x1ffe19=0x0;_0x1ffe19<_0x2739bd[_0x7783('0x38')];_0x1ffe19+=0x1){let _0x223700=_0x2739bd[_0x1ffe19];for(var _0xe57600=0x0;_0xe57600<_0x223700[_0x7783('0x67')]['length'];_0xe57600+=0x1){let _0x37323a=_0x223700['Agents'][_0xe57600];var _0x7deef7=_0x839a83['clone']();_0x7deef7[_0x7783('0x3b')](_0x7783('0x74'),_0x37323a['id']);_0x597107[_0x7783('0x75')](db[_0x7783('0x68')]['query'](_0x7deef7['toString'](),{'type':db['sequelize'][_0x7783('0x76')][_0x7783('0x77')]})['then'](function(_0x4af293){if(_0x4af293[_0x7783('0x38')]===0x1){return _0x37323a['id'];}else{var _0x3c9035=_[_0x7783('0x78')](_[_0x7783('0x2f')](_0x4af293,'TeamId'),function(_0x158417){return _[_0x7783('0x79')](_0x374bac,_0x158417);});if(_0x3c9035){return _0x37323a['id'];}}}));}}return BPromise[_0x7783('0x7a')](_0x597107)[_0x7783('0x29')](function(_0x4ac514){_0x563fb2=_(_0x563fb2)[_0x7783('0x7b')](_0x4ac514)[_0x7783('0x7c')]()['value']();return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x20e32d['params']['id']}})['then'](function(_0x18e87a){return db['sequelize'][_0x7783('0x69')](function(_0x41f33c){return _0x18e87a['removeTeams'](_0x20e32d[_0x7783('0x35')][_0x7783('0x61')],{'transaction':_0x41f33c})['then'](function(){if(!_[_0x7783('0x7d')](_0x563fb2)){return _0x18e87a[_0x7783('0x7e')](_0x563fb2,{'transaction':_0x41f33c});}})[_0x7783('0x29')](function(){_0x563fb2[_0x7783('0x7f')](function(_0x2164be){socket[_0x7783('0x6b')]('userOpenchannelQueue:remove',{'UserId':_0x2164be,'OpenchannelQueueId':_0x18e87a['id']});});});});});});})['then'](respondWithStatusCode(_0x1b487d,null))[_0x7783('0x46')](handleError(_0x1b487d,null));};exports['addAgents']=function(_0x50b998,_0x3c83ab,_0x10127b){return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x50b998[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x3c83ab,null))[_0x7783('0x29')](function(_0x225119){if(_0x225119){return _0x225119['addAgents'](_0x50b998[_0x7783('0x4c')][_0x7783('0x61')],_[_0x7783('0x80')](_0x50b998[_0x7783('0x4c')],[_0x7783('0x61'),'id'])||{})[_0x7783('0x81')](function(_0x5666ac){for(var _0x4201e0=0x0;_0x4201e0<_0x50b998['body'][_0x7783('0x61')][_0x7783('0x38')];_0x4201e0+=0x1){socket[_0x7783('0x6b')]('userOpenchannelQueue:save',{'UserId':Number(_0x50b998[_0x7783('0x4c')][_0x7783('0x61')][_0x4201e0]),'OpenchannelQueueId':Number(_0x50b998['params']['id'])});}return _0x5666ac;});}})[_0x7783('0x29')](respondWithResult(_0x3c83ab,null))[_0x7783('0x46')](handleError(_0x3c83ab,null));};exports[_0x7783('0x7e')]=function(_0x2eccec,_0x4ff000,_0x4d313d){return db[_0x7783('0x41')][_0x7783('0x51')]({'where':{'id':_0x2eccec[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x4ff000,null))['then'](function(_0x41df12){if(_0x41df12){return _0x41df12[_0x7783('0x7e')](_0x2eccec[_0x7783('0x35')][_0x7783('0x61')])[_0x7783('0x29')](function(){if(_[_0x7783('0x82')](_0x2eccec[_0x7783('0x35')][_0x7783('0x61')])){for(var _0x454534=0x0;_0x454534<_0x2eccec[_0x7783('0x35')]['ids']['length'];_0x454534+=0x1){socket[_0x7783('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2eccec[_0x7783('0x35')][_0x7783('0x61')][_0x454534]),'OpenchannelQueueId':Number(_0x2eccec[_0x7783('0x48')]['id'])});}}else{socket[_0x7783('0x6b')](_0x7783('0x83'),{'UserId':Number(_0x2eccec[_0x7783('0x35')][_0x7783('0x61')]),'OpenchannelQueueId':Number(_0x2eccec[_0x7783('0x48')]['id'])});}});}})[_0x7783('0x29')](respondWithStatusCode(_0x4ff000,null))['catch'](handleError(_0x4ff000,null));};exports['getAgents']=function(_0x203331,_0x30d8b3,_0x820c77){var _0x35fac8={};var _0xd95ad={};var _0x22f9c5;var _0x5df058;return db['OpenchannelQueue'][_0x7783('0x84')]({'where':{'id':_0x203331[_0x7783('0x48')]['id']}})[_0x7783('0x29')](handleEntityNotFound(_0x30d8b3,null))['then'](function(_0x321212){if(_0x321212){_0x22f9c5=_0x321212;_0xd95ad[_0x7783('0x34')]=_[_0x7783('0x31')](db['User'][_0x7783('0x49')]);_0xd95ad[_0x7783('0x35')]=_[_0x7783('0x31')](_0x203331[_0x7783('0x35')]);_0xd95ad[_0x7783('0x32')]=_[_0x7783('0x33')](_0xd95ad[_0x7783('0x34')],_0xd95ad['query']);_0x35fac8['attributes']=_[_0x7783('0x33')](_0xd95ad['model'],qs[_0x7783('0x37')](_0x203331[_0x7783('0x35')][_0x7783('0x37')]));_0x35fac8[_0x7783('0x36')]=_0x35fac8['attributes'][_0x7783('0x38')]?_0x35fac8[_0x7783('0x36')]:_0xd95ad[_0x7783('0x34')];_0x35fac8[_0x7783('0x39')]=qs[_0x7783('0x3a')](_0x203331['query'][_0x7783('0x3a')]);_0x35fac8[_0x7783('0x3b')]=qs[_0x7783('0x32')](_[_0x7783('0x3c')](_0x203331['query'],_0xd95ad[_0x7783('0x32')]));if(_0x203331[_0x7783('0x35')][_0x7783('0x3d')]){_0x35fac8[_0x7783('0x3b')]=_[_0x7783('0x40')](_0x35fac8['where'],{'$or':_['map'](_0x35fac8[_0x7783('0x36')],function(_0x20a061){var _0x4a862a={};_0x4a862a[_0x20a061]={'$like':'%'+_0x203331[_0x7783('0x35')][_0x7783('0x3d')]+'%'};return _0x4a862a;})});}_0x35fac8=_[_0x7783('0x40')]({},_0x35fac8,_0x203331[_0x7783('0x4a')]);return _0x22f9c5[_0x7783('0x85')](_0x35fac8);}})[_0x7783('0x29')](function(_0x2827bd){if(_0x2827bd){_0x5df058=_0x2827bd[_0x7783('0x38')];if(!_0x203331[_0x7783('0x35')][_0x7783('0x56')](_0x7783('0x57'))){_0x35fac8['limit']=qs[_0x7783('0x20')](_0x203331[_0x7783('0x35')][_0x7783('0x20')]);_0x35fac8[_0x7783('0x23')]=qs[_0x7783('0x23')](_0x203331[_0x7783('0x35')]['offset']);}return _0x22f9c5[_0x7783('0x85')](_0x35fac8);}})['then'](function(_0x1fc66b){if(_0x1fc66b){return _0x1fc66b?{'count':_0x5df058,'rows':_0x1fc66b}:null;}})[_0x7783('0x29')](respondWithResult(_0x30d8b3,null))[_0x7783('0x46')](handleError(_0x30d8b3,null));}; \ No newline at end of file +var _0xf71d=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','rows','format','%s/%s','updatedAt','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x595db,_0x49d793){var _0xf14161=function(_0x4dada4){while(--_0x4dada4){_0x595db['push'](_0x595db['shift']());}};_0xf14161(++_0x49d793);}(_0xf71d,0x178));var _0xdf71=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xf71d[_0x4eafed];return _0x159c85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf71('0x0'));var zipdir=require(_0xdf71('0x1'));var jsonpatch=require(_0xdf71('0x2'));var rp=require(_0xdf71('0x3'));var moment=require(_0xdf71('0x4'));var BPromise=require(_0xdf71('0x5'));var Mustache=require(_0xdf71('0x6'));var util=require(_0xdf71('0x7'));var path=require(_0xdf71('0x8'));var sox=require(_0xdf71('0x9'));var csv=require(_0xdf71('0xa'));var ejs=require(_0xdf71('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf71('0xc'));var squel=require(_0xdf71('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf71('0xe'));var deskjs=require(_0xdf71('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdf71('0x10'));var Papa=require(_0xdf71('0x11'));var Redis=require(_0xdf71('0x12'));var authService=require(_0xdf71('0x13'));var qs=require(_0xdf71('0x14'));var as=require(_0xdf71('0x15'));var hardwareService=require(_0xdf71('0x16'));var logger=require(_0xdf71('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xdf71('0x18'));var licenseUtil=require(_0xdf71('0x19'));var db=require(_0xdf71('0x1a'))['db'];config['redis']=_[_0xdf71('0x1b')](config['redis'],{'host':_0xdf71('0x1c'),'port':0x18eb});var socket=require(_0xdf71('0x1d'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xdf71('0x1e')](socket);function respondWithStatusCode(_0x1c6535,_0x243587){_0x243587=_0x243587||0xcc;return function(_0x285033){if(_0x285033){return _0x1c6535[_0xdf71('0x1f')](_0x243587);}return _0x1c6535[_0xdf71('0x20')](_0x243587)[_0xdf71('0x21')]();};}function respondWithResult(_0x159dfc,_0x1cb907){_0x1cb907=_0x1cb907||0xc8;return function(_0x13fe76){if(_0x13fe76){return _0x159dfc['status'](_0x1cb907)[_0xdf71('0x22')](_0x13fe76);}};}function respondWithFilteredResult(_0x4e38ab,_0x5ef537){return function(_0x205b7a){if(_0x205b7a){var _0x1a77c2=typeof _0x5ef537[_0xdf71('0x23')]===_0xdf71('0x24')&&typeof _0x5ef537['limit']===_0xdf71('0x24');var _0x1b677a=_0x205b7a[_0xdf71('0x25')];var _0x2f57b7=_0x1a77c2?0x0:_0x5ef537[_0xdf71('0x23')];var _0x20c44b=_0x1a77c2?_0x205b7a[_0xdf71('0x25')]:_0x5ef537['offset']+_0x5ef537[_0xdf71('0x26')];var _0x5f2c1e;if(_0x20c44b>=_0x1b677a){_0x20c44b=_0x1b677a;_0x5f2c1e=0xc8;}else{_0x5f2c1e=0xce;}_0x4e38ab['status'](_0x5f2c1e);return _0x4e38ab[_0xdf71('0x27')](_0xdf71('0x28'),_0x2f57b7+'-'+_0x20c44b+'/'+_0x1b677a)[_0xdf71('0x22')](_0x205b7a);}return null;};}function patchUpdates(_0x3b5047){return function(_0x4b0654){try{jsonpatch[_0xdf71('0x29')](_0x4b0654,_0x3b5047,!![]);}catch(_0x146fed){return BPromise[_0xdf71('0x2a')](_0x146fed);}return _0x4b0654['save']();};}function saveUpdates(_0x28541e,_0xab9da4){return function(_0x38af0b){if(_0x38af0b){return _0x38af0b[_0xdf71('0x2b')](_0x28541e)[_0xdf71('0x2c')](function(_0x29beea){return _0x29beea;});}return null;};}function removeEntity(_0x1a2107,_0x33ad1f){return function(_0x42ff01){if(_0x42ff01){return _0x42ff01[_0xdf71('0x2d')]()['then'](function(){var _0xfae519=_0x42ff01['get']({'plain':!![]});var _0x1cfcd1=_0xdf71('0x2e');return db[_0xdf71('0x2f')][_0xdf71('0x2d')]({'where':{'type':_0x1cfcd1,'resourceId':_0xfae519['id']}})[_0xdf71('0x2c')](function(){return _0x42ff01;});})['then'](function(){_0x1a2107[_0xdf71('0x20')](0xcc)[_0xdf71('0x21')]();});}};}function handleEntityNotFound(_0x279123,_0x3631e5){return function(_0x43164d){if(!_0x43164d){_0x279123[_0xdf71('0x1f')](0x194);}return _0x43164d;};}function handleError(_0x14f157,_0x34df8a){_0x34df8a=_0x34df8a||0x1f4;return function(_0x3e5700){logger['error'](_0x3e5700[_0xdf71('0x30')]);if(_0x3e5700[_0xdf71('0x31')]){delete _0x3e5700[_0xdf71('0x31')];}_0x14f157['status'](_0x34df8a)[_0xdf71('0x32')](_0x3e5700);};}exports['index']=function(_0x328bd9,_0x16fed0){var _0x456e83={},_0x5284ca={},_0x5cb9c6={'count':0x0,'rows':[]};var _0xa8d2f=_[_0xdf71('0x33')](db[_0xdf71('0x34')][_0xdf71('0x35')],function(_0x4c28bb){return{'name':_0x4c28bb[_0xdf71('0x36')],'type':_0x4c28bb['type'][_0xdf71('0x37')]};});_0x5284ca['model']=_[_0xdf71('0x33')](_0xa8d2f,_0xdf71('0x31'));_0x5284ca[_0xdf71('0x38')]=_[_0xdf71('0x39')](_0x328bd9[_0xdf71('0x38')]);_0x5284ca[_0xdf71('0x3a')]=_[_0xdf71('0x3b')](_0x5284ca[_0xdf71('0x3c')],_0x5284ca[_0xdf71('0x38')]);_0x456e83[_0xdf71('0x3d')]=_[_0xdf71('0x3b')](_0x5284ca[_0xdf71('0x3c')],qs[_0xdf71('0x3e')](_0x328bd9[_0xdf71('0x38')][_0xdf71('0x3e')]));_0x456e83[_0xdf71('0x3d')]=_0x456e83['attributes'][_0xdf71('0x3f')]?_0x456e83['attributes']:_0x5284ca[_0xdf71('0x3c')];if(!_0x328bd9[_0xdf71('0x38')][_0xdf71('0x40')](_0xdf71('0x41'))){_0x456e83[_0xdf71('0x26')]=qs['limit'](_0x328bd9['query']['limit']);_0x456e83[_0xdf71('0x23')]=qs[_0xdf71('0x23')](_0x328bd9[_0xdf71('0x38')]['offset']);}_0x456e83['order']=qs['sort'](_0x328bd9['query'][_0xdf71('0x42')]);_0x456e83[_0xdf71('0x43')]=qs[_0xdf71('0x3a')](_[_0xdf71('0x44')](_0x328bd9['query'],_0x5284ca[_0xdf71('0x3a')]),_0xa8d2f);if(_0x328bd9['query'][_0xdf71('0x45')]){_0x456e83[_0xdf71('0x43')]=_[_0xdf71('0x46')](_0x456e83[_0xdf71('0x43')],{'$or':_['map'](_0xa8d2f,function(_0x455ca1){if(_0x455ca1[_0xdf71('0x47')]!=='VIRTUAL'){var _0x36caf6={};_0x36caf6[_0x455ca1[_0xdf71('0x31')]]={'$like':'%'+_0x328bd9[_0xdf71('0x38')][_0xdf71('0x45')]+'%'};return _0x36caf6;}})});}_0x456e83=_[_0xdf71('0x46')]({},_0x456e83,_0x328bd9[_0xdf71('0x48')]);var _0x66e3f4={'where':_0x456e83[_0xdf71('0x43')]};return db['OpenchannelQueue']['count'](_0x66e3f4)[_0xdf71('0x2c')](function(_0x819e71){_0x5cb9c6[_0xdf71('0x25')]=_0x819e71;if(_0x328bd9[_0xdf71('0x38')][_0xdf71('0x49')]){_0x456e83[_0xdf71('0x4a')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xdf71('0x4b')](_0x456e83);})[_0xdf71('0x2c')](function(_0x2a9bbb){_0x5cb9c6['rows']=_0x2a9bbb;return _0x5cb9c6;})[_0xdf71('0x2c')](respondWithFilteredResult(_0x16fed0,_0x456e83))[_0xdf71('0x4c')](handleError(_0x16fed0,null));};exports[_0xdf71('0x4d')]=function(_0x1a8eb6,_0x2a52fd){var _0xd05788={'raw':!![],'where':{'id':_0x1a8eb6[_0xdf71('0x4e')]['id']}},_0x295bb8={};_0x295bb8[_0xdf71('0x3c')]=_[_0xdf71('0x39')](db[_0xdf71('0x34')][_0xdf71('0x35')]);_0x295bb8['query']=_[_0xdf71('0x39')](_0x1a8eb6[_0xdf71('0x38')]);_0x295bb8[_0xdf71('0x3a')]=_['intersection'](_0x295bb8[_0xdf71('0x3c')],_0x295bb8['query']);_0xd05788[_0xdf71('0x3d')]=_[_0xdf71('0x3b')](_0x295bb8['model'],qs[_0xdf71('0x3e')](_0x1a8eb6[_0xdf71('0x38')][_0xdf71('0x3e')]));_0xd05788['attributes']=_0xd05788['attributes'][_0xdf71('0x3f')]?_0xd05788[_0xdf71('0x3d')]:_0x295bb8['model'];if(_0x1a8eb6[_0xdf71('0x38')][_0xdf71('0x49')]){_0xd05788[_0xdf71('0x4a')]=[{'all':!![]}];}_0xd05788=_[_0xdf71('0x46')]({},_0xd05788,_0x1a8eb6[_0xdf71('0x48')]);return db[_0xdf71('0x34')][_0xdf71('0x4f')](_0xd05788)[_0xdf71('0x2c')](handleEntityNotFound(_0x2a52fd,null))[_0xdf71('0x2c')](respondWithResult(_0x2a52fd,null))[_0xdf71('0x4c')](handleError(_0x2a52fd,null));};exports[_0xdf71('0x50')]=function(_0x51df28,_0x7f222e){return db['OpenchannelQueue'][_0xdf71('0x50')](_0x51df28[_0xdf71('0x51')],{})[_0xdf71('0x2c')](function(_0xf8d745){var _0x37dbb6=_0x51df28[_0xdf71('0x52')][_0xdf71('0x53')]({'plain':!![]});if(!_0x37dbb6)throw new Error(_0xdf71('0x54'));if(_0x37dbb6['role']===_0xdf71('0x52')){var _0x24f3f9=_0xf8d745[_0xdf71('0x53')]({'plain':!![]});var _0x55e7c7=_0xdf71('0x2e');return db['UserProfileSection'][_0xdf71('0x4f')]({'where':{'name':_0x55e7c7,'userProfileId':_0x37dbb6[_0xdf71('0x55')]},'raw':!![]})[_0xdf71('0x2c')](function(_0x53b12c){if(_0x53b12c&&_0x53b12c['autoAssociation']===0x0){return db[_0xdf71('0x2f')][_0xdf71('0x50')]({'name':_0x24f3f9[_0xdf71('0x31')],'resourceId':_0x24f3f9['id'],'type':_0x53b12c['name'],'sectionId':_0x53b12c['id']},{})[_0xdf71('0x2c')](function(){return _0xf8d745;});}else{return _0xf8d745;}})[_0xdf71('0x4c')](function(_0x5d59c4){logger[_0xdf71('0x56')](_0xdf71('0x57'),_0x5d59c4);throw _0x5d59c4;});}return _0xf8d745;})[_0xdf71('0x2c')](respondWithResult(_0x7f222e,0xc9))['catch'](handleError(_0x7f222e,null));};exports['update']=function(_0x23c7aa,_0x28b02d){if(_0x23c7aa[_0xdf71('0x51')]['id']){delete _0x23c7aa['body']['id'];}return db[_0xdf71('0x34')][_0xdf71('0x4f')]({'where':{'id':_0x23c7aa[_0xdf71('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28b02d,null))['then'](saveUpdates(_0x23c7aa[_0xdf71('0x51')],null))[_0xdf71('0x2c')](respondWithResult(_0x28b02d,null))[_0xdf71('0x4c')](handleError(_0x28b02d,null));};exports[_0xdf71('0x2d')]=function(_0x5f59c6,_0x6e99fa){return db['OpenchannelQueue'][_0xdf71('0x4f')]({'where':{'id':_0x5f59c6[_0xdf71('0x4e')]['id']}})[_0xdf71('0x2c')](handleEntityNotFound(_0x6e99fa,null))[_0xdf71('0x2c')](removeEntity(_0x6e99fa,null))[_0xdf71('0x4c')](handleError(_0x6e99fa,null));};exports[_0xdf71('0x58')]=function(_0x31126b,_0x1cd9f1){return db[_0xdf71('0x34')][_0xdf71('0x58')]()[_0xdf71('0x2c')](respondWithResult(_0x1cd9f1,null))[_0xdf71('0x4c')](handleError(_0x1cd9f1,null));};exports[_0xdf71('0x59')]=function(_0x1b2f32,_0x1f0f05,_0x436498){var _0x391efb={'raw':!![],'where':{}},_0x3bdcc9={},_0x2852dd;return db[_0xdf71('0x34')][_0xdf71('0x5a')]({'where':{'id':_0x1b2f32['params']['id']}})['then'](handleEntityNotFound(_0x1f0f05,null))[_0xdf71('0x2c')](function(_0x92f15){if(_0x92f15){_0x2852dd=_0x92f15[_0xdf71('0x53')]({'plain':!![]});_0x3bdcc9[_0xdf71('0x3c')]=_[_0xdf71('0x39')](db[_0xdf71('0x5b')][_0xdf71('0x35')]);_0x3bdcc9[_0xdf71('0x38')]=_['keys'](_0x1b2f32['query']);_0x3bdcc9[_0xdf71('0x3a')]=_[_0xdf71('0x3b')](_0x3bdcc9[_0xdf71('0x3c')],_0x3bdcc9['query']);_0x391efb[_0xdf71('0x3d')]=_[_0xdf71('0x3b')](_0x3bdcc9[_0xdf71('0x3c')],qs[_0xdf71('0x3e')](_0x1b2f32[_0xdf71('0x38')][_0xdf71('0x3e')]));_0x391efb['attributes']=_0x391efb[_0xdf71('0x3d')]['length']?_0x391efb[_0xdf71('0x3d')]:_0x3bdcc9[_0xdf71('0x3c')];if(!_0x1b2f32[_0xdf71('0x38')]['hasOwnProperty'](_0xdf71('0x41'))){_0x391efb[_0xdf71('0x26')]=qs[_0xdf71('0x26')](_0x1b2f32[_0xdf71('0x38')][_0xdf71('0x26')]);_0x391efb[_0xdf71('0x23')]=qs[_0xdf71('0x23')](_0x1b2f32['query'][_0xdf71('0x23')]);}_0x391efb['order']=qs['sort'](_0x1b2f32[_0xdf71('0x38')][_0xdf71('0x42')]);_0x391efb[_0xdf71('0x43')]=qs[_0xdf71('0x3a')](_[_0xdf71('0x44')](_0x1b2f32[_0xdf71('0x38')],_0x3bdcc9['filters']));_0x391efb[_0xdf71('0x43')][_0xdf71('0x5c')]=_0x92f15['id'];if(_0x1b2f32[_0xdf71('0x38')]['filter']){_0x391efb[_0xdf71('0x43')]=_[_0xdf71('0x46')](_0x391efb[_0xdf71('0x43')],{'$or':_[_0xdf71('0x33')](_0x391efb[_0xdf71('0x3d')],function(_0x374401){var _0x2c1824={};_0x2c1824[_0x374401]={'$like':'%'+_0x1b2f32['query'][_0xdf71('0x45')]+'%'};return _0x2c1824;})});}_0x391efb=_['merge']({},_0x391efb,_0x1b2f32[_0xdf71('0x48')]);return db[_0xdf71('0x5b')][_0xdf71('0x4b')](_0x391efb);}})[_0xdf71('0x2c')](function(_0x4a06b8){if(_0x4a06b8){return db[_0xdf71('0x5d')][_0xdf71('0x5e')]({'where':{'id':_[_0xdf71('0x33')](_0x4a06b8,_0xdf71('0x5f')),'role':_0xdf71('0x60')},'attributes':['id','name',_0xdf71('0x61'),'updatedAt',_0xdf71('0x62')]});}})[_0xdf71('0x2c')](function(_0x5963c8){if(_0x5963c8){return{'count':_0x5963c8['count'],'rows':_['map'](_0x5963c8[_0xdf71('0x63')],function(_0x51f3d2){return{'membername':_0x51f3d2[_0xdf71('0x31')],'UserId':_0x51f3d2['id'],'queue_name':_0x2852dd[_0xdf71('0x31')],'OpenchannelQueueId':_0x2852dd['id'],'interface':util[_0xdf71('0x64')](_0xdf71('0x65'),'SIP',_0x51f3d2[_0xdf71('0x31')]),'penalty':0x0,'paused':_0x51f3d2[_0xdf71('0x61')],'createdAt':_0x51f3d2['createdAt'],'updatedAt':_0x51f3d2[_0xdf71('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdf71('0x2c')](respondWithFilteredResult(_0x1f0f05,_0x391efb))[_0xdf71('0x4c')](handleError(_0x1f0f05,null));};exports[_0xdf71('0x67')]=function(_0x264b3f,_0x1feba2,_0x52c647){var _0x342d28={};var _0xd92bc3={};var _0x2a1d0e;var _0xdfb3ad;return db[_0xdf71('0x34')][_0xdf71('0x5a')]({'where':{'id':_0x264b3f[_0xdf71('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1feba2,null))[_0xdf71('0x2c')](function(_0x265c42){if(_0x265c42){_0x2a1d0e=_0x265c42;_0xd92bc3[_0xdf71('0x3c')]=_[_0xdf71('0x39')](db[_0xdf71('0x68')]['rawAttributes']);_0xd92bc3[_0xdf71('0x38')]=_[_0xdf71('0x39')](_0x264b3f['query']);_0xd92bc3[_0xdf71('0x3a')]=_[_0xdf71('0x3b')](_0xd92bc3[_0xdf71('0x3c')],_0xd92bc3[_0xdf71('0x38')]);_0x342d28[_0xdf71('0x3d')]=_[_0xdf71('0x3b')](_0xd92bc3['model'],qs[_0xdf71('0x3e')](_0x264b3f[_0xdf71('0x38')]['fields']));_0x342d28[_0xdf71('0x3d')]=_0x342d28['attributes'][_0xdf71('0x3f')]?_0x342d28[_0xdf71('0x3d')]:_0xd92bc3['model'];_0x342d28[_0xdf71('0x69')]=qs['sort'](_0x264b3f[_0xdf71('0x38')][_0xdf71('0x42')]);_0x342d28[_0xdf71('0x43')]=qs[_0xdf71('0x3a')](_['pick'](_0x264b3f['query'],_0xd92bc3[_0xdf71('0x3a')]));if(_0x264b3f[_0xdf71('0x38')]['filter']){_0x342d28[_0xdf71('0x43')]=_['merge'](_0x342d28[_0xdf71('0x43')],{'$or':_[_0xdf71('0x33')](_0x342d28[_0xdf71('0x3d')],function(_0x1d9a79){var _0x2ceb6e={};_0x2ceb6e[_0x1d9a79]={'$like':'%'+_0x264b3f['query'][_0xdf71('0x45')]+'%'};return _0x2ceb6e;})});}_0x342d28=_[_0xdf71('0x46')]({},_0x342d28,_0x264b3f[_0xdf71('0x48')]);return _0x2a1d0e['getTeams'](_0x342d28);}})[_0xdf71('0x2c')](function(_0x5e10c9){if(_0x5e10c9){_0xdfb3ad=_0x5e10c9['length'];if(!_0x264b3f[_0xdf71('0x38')]['hasOwnProperty']('nolimit')){_0x342d28['limit']=qs['limit'](_0x264b3f[_0xdf71('0x38')][_0xdf71('0x26')]);_0x342d28['offset']=qs[_0xdf71('0x23')](_0x264b3f[_0xdf71('0x38')][_0xdf71('0x23')]);}return _0x2a1d0e[_0xdf71('0x67')](_0x342d28);}})[_0xdf71('0x2c')](function(_0x3a4568){if(_0x3a4568){return _0x3a4568?{'count':_0xdfb3ad,'rows':_0x3a4568}:null;}})['then'](respondWithResult(_0x1feba2,null))[_0xdf71('0x4c')](handleError(_0x1feba2,null));};exports[_0xdf71('0x6a')]=function(_0x51e970,_0x166c12,_0x46ebde){var _0x446d9d=_0x51e970[_0xdf71('0x51')][_0xdf71('0x6b')];return db[_0xdf71('0x68')][_0xdf71('0x4b')]({'where':{'id':_0x446d9d},'attributes':['id'],'include':[{'model':db[_0xdf71('0x5d')],'as':_0xdf71('0x6c'),'attributes':['id','name',_0xdf71('0x6d'),_0xdf71('0x6e'),_0xdf71('0x6f')],'raw':!![]}]})[_0xdf71('0x2c')](function(_0x7c7b0d){if(_0x7c7b0d){var _0x4e01ae=_[_0xdf71('0x70')](_0x7c7b0d,function(_0x471377){var _0x135724=_0x471377[_0xdf71('0x53')]({'plain':!![]});return _0x135724[_0xdf71('0x6c')];});return db[_0xdf71('0x34')][_0xdf71('0x4f')]({'where':{'id':_0x51e970[_0xdf71('0x4e')]['id']}})[_0xdf71('0x2c')](function(_0x402c6e){return db[_0xdf71('0x71')][_0xdf71('0x72')](function(_0x1c1634){return _0x402c6e[_0xdf71('0x6a')](_0x446d9d,{'transaction':_0x1c1634})[_0xdf71('0x2c')](function(){return BPromise[_0xdf71('0x73')](_0x4e01ae,function(_0x5166d8){return db[_0xdf71('0x5b')][_0xdf71('0x74')]({'where':{'UserId':_0x5166d8['id'],'OpenchannelQueueId':_0x51e970[_0xdf71('0x4e')]['id']},'transaction':_0x1c1634});});})[_0xdf71('0x2c')](function(){_0x4e01ae['forEach'](function(_0x1e0d76){socket[_0xdf71('0x75')](_0xdf71('0x76'),{'UserId':_0x1e0d76['id'],'OpenchannelQueueId':_0x402c6e['id']});});});});});}})['then'](respondWithStatusCode(_0x166c12,null))[_0xdf71('0x4c')](handleError(_0x166c12,null));};exports[_0xdf71('0x77')]=function(_0x114f5a,_0x5efc7c,_0x5d662f){return db[_0xdf71('0x68')][_0xdf71('0x4b')]({'where':{'id':_0x114f5a['query'][_0xdf71('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xdf71('0x5d')],'as':_0xdf71('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xdf71('0x2c')](handleEntityNotFound(_0x5efc7c,null))[_0xdf71('0x2c')](function(_0x5c007c){var _0x42dc12=_[_0xdf71('0x33')](_0x5c007c,'id');var _0x275e44=[];var _0x143546=[];var _0x122c45=squel[_0xdf71('0x78')]();_0x122c45[_0xdf71('0x79')](_0xdf71('0x7a'))['from'](_0xdf71('0x7b'),'tq')[_0xdf71('0x7c')](_0xdf71('0x7d'),'ut',_0xdf71('0x7e'))[_0xdf71('0x43')](_0xdf71('0x7f'),_0x114f5a[_0xdf71('0x4e')]['id']);for(var _0x546721=0x0;_0x546721<_0x5c007c[_0xdf71('0x3f')];_0x546721+=0x1){let _0x3425b8=_0x5c007c[_0x546721];for(var _0x20c1a2=0x0;_0x20c1a2<_0x3425b8[_0xdf71('0x6c')]['length'];_0x20c1a2+=0x1){let _0x4c5bd6=_0x3425b8['Agents'][_0x20c1a2];var _0x1c5aa8=_0x122c45['clone']();_0x1c5aa8[_0xdf71('0x43')](_0xdf71('0x80'),_0x4c5bd6['id']);_0x143546[_0xdf71('0x81')](db[_0xdf71('0x71')]['query'](_0x1c5aa8['toString'](),{'type':db[_0xdf71('0x71')][_0xdf71('0x82')][_0xdf71('0x83')]})[_0xdf71('0x2c')](function(_0x3fc542){if(_0x3fc542['length']===0x1){return _0x4c5bd6['id'];}else{var _0x5e57f1=_['every'](_[_0xdf71('0x33')](_0x3fc542,_0xdf71('0x84')),function(_0x17e94c){return _[_0xdf71('0x85')](_0x42dc12,_0x17e94c);});if(_0x5e57f1){return _0x4c5bd6['id'];}}}));}}return BPromise[_0xdf71('0x86')](_0x143546)[_0xdf71('0x2c')](function(_0x3ca8de){_0x275e44=_(_0x275e44)[_0xdf71('0x87')](_0x3ca8de)[_0xdf71('0x88')]()['value']();return db['OpenchannelQueue'][_0xdf71('0x4f')]({'where':{'id':_0x114f5a['params']['id']}})[_0xdf71('0x2c')](function(_0xd8011f){return db[_0xdf71('0x71')]['transaction'](function(_0x3ee711){return _0xd8011f[_0xdf71('0x77')](_0x114f5a[_0xdf71('0x38')][_0xdf71('0x6b')],{'transaction':_0x3ee711})[_0xdf71('0x2c')](function(){if(!_[_0xdf71('0x89')](_0x275e44)){return _0xd8011f[_0xdf71('0x8a')](_0x275e44,{'transaction':_0x3ee711});}})[_0xdf71('0x2c')](function(){_0x275e44[_0xdf71('0x8b')](function(_0x2c6bf2){socket[_0xdf71('0x75')](_0xdf71('0x8c'),{'UserId':_0x2c6bf2,'OpenchannelQueueId':_0xd8011f['id']});});});});});});})[_0xdf71('0x2c')](respondWithStatusCode(_0x5efc7c,null))[_0xdf71('0x4c')](handleError(_0x5efc7c,null));};exports['addAgents']=function(_0x45e89e,_0x2a3828,_0x39dfb5){return db[_0xdf71('0x34')][_0xdf71('0x4f')]({'where':{'id':_0x45e89e[_0xdf71('0x4e')]['id']}})[_0xdf71('0x2c')](handleEntityNotFound(_0x2a3828,null))[_0xdf71('0x2c')](function(_0x305308){if(_0x305308){return _0x305308['addAgents'](_0x45e89e['body'][_0xdf71('0x6b')],_[_0xdf71('0x8d')](_0x45e89e[_0xdf71('0x51')],[_0xdf71('0x6b'),'id'])||{})[_0xdf71('0x8e')](function(_0x241aa1){for(var _0x5bb60e=0x0;_0x5bb60e<_0x45e89e[_0xdf71('0x51')][_0xdf71('0x6b')][_0xdf71('0x3f')];_0x5bb60e+=0x1){socket['emit'](_0xdf71('0x76'),{'UserId':Number(_0x45e89e[_0xdf71('0x51')]['ids'][_0x5bb60e]),'OpenchannelQueueId':Number(_0x45e89e[_0xdf71('0x4e')]['id'])});}return _0x241aa1;});}})[_0xdf71('0x2c')](respondWithResult(_0x2a3828,null))[_0xdf71('0x4c')](handleError(_0x2a3828,null));};exports[_0xdf71('0x8a')]=function(_0x3493e7,_0x22430f,_0x55a34d){return db[_0xdf71('0x34')][_0xdf71('0x4f')]({'where':{'id':_0x3493e7['params']['id']}})[_0xdf71('0x2c')](handleEntityNotFound(_0x22430f,null))[_0xdf71('0x2c')](function(_0x237836){if(_0x237836){return _0x237836[_0xdf71('0x8a')](_0x3493e7['query'][_0xdf71('0x6b')])[_0xdf71('0x2c')](function(){if(_[_0xdf71('0x8f')](_0x3493e7[_0xdf71('0x38')][_0xdf71('0x6b')])){for(var _0x11c885=0x0;_0x11c885<_0x3493e7[_0xdf71('0x38')][_0xdf71('0x6b')][_0xdf71('0x3f')];_0x11c885+=0x1){socket[_0xdf71('0x75')](_0xdf71('0x8c'),{'UserId':Number(_0x3493e7['query'][_0xdf71('0x6b')][_0x11c885]),'OpenchannelQueueId':Number(_0x3493e7['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x3493e7[_0xdf71('0x38')][_0xdf71('0x6b')]),'OpenchannelQueueId':Number(_0x3493e7['params']['id'])});}});}})[_0xdf71('0x2c')](respondWithStatusCode(_0x22430f,null))[_0xdf71('0x4c')](handleError(_0x22430f,null));};exports['getAgents']=function(_0xa714ed,_0x42d9a6,_0x5e0059){var _0xd7c972={};var _0x4ae9c1={};var _0x2f9d06;var _0x5a8329;return db[_0xdf71('0x34')][_0xdf71('0x5a')]({'where':{'id':_0xa714ed[_0xdf71('0x4e')]['id']}})[_0xdf71('0x2c')](handleEntityNotFound(_0x42d9a6,null))[_0xdf71('0x2c')](function(_0x1dda40){if(_0x1dda40){_0x2f9d06=_0x1dda40;_0x4ae9c1[_0xdf71('0x3c')]=_[_0xdf71('0x39')](db[_0xdf71('0x5d')][_0xdf71('0x35')]);_0x4ae9c1[_0xdf71('0x38')]=_[_0xdf71('0x39')](_0xa714ed['query']);_0x4ae9c1[_0xdf71('0x3a')]=_['intersection'](_0x4ae9c1[_0xdf71('0x3c')],_0x4ae9c1['query']);_0xd7c972[_0xdf71('0x3d')]=_[_0xdf71('0x3b')](_0x4ae9c1[_0xdf71('0x3c')],qs[_0xdf71('0x3e')](_0xa714ed[_0xdf71('0x38')]['fields']));_0xd7c972[_0xdf71('0x3d')]=_0xd7c972[_0xdf71('0x3d')][_0xdf71('0x3f')]?_0xd7c972['attributes']:_0x4ae9c1['model'];_0xd7c972['order']=qs[_0xdf71('0x42')](_0xa714ed['query'][_0xdf71('0x42')]);_0xd7c972[_0xdf71('0x43')]=qs[_0xdf71('0x3a')](_[_0xdf71('0x44')](_0xa714ed[_0xdf71('0x38')],_0x4ae9c1[_0xdf71('0x3a')]));if(_0xa714ed['query'][_0xdf71('0x45')]){_0xd7c972[_0xdf71('0x43')]=_[_0xdf71('0x46')](_0xd7c972[_0xdf71('0x43')],{'$or':_[_0xdf71('0x33')](_0xd7c972[_0xdf71('0x3d')],function(_0x3b5ba7){var _0x12311d={};_0x12311d[_0x3b5ba7]={'$like':'%'+_0xa714ed[_0xdf71('0x38')][_0xdf71('0x45')]+'%'};return _0x12311d;})});}_0xd7c972=_[_0xdf71('0x46')]({},_0xd7c972,_0xa714ed['options']);return _0x2f9d06[_0xdf71('0x90')](_0xd7c972);}})['then'](function(_0x170414){if(_0x170414){_0x5a8329=_0x170414[_0xdf71('0x3f')];if(!_0xa714ed[_0xdf71('0x38')][_0xdf71('0x40')](_0xdf71('0x41'))){_0xd7c972[_0xdf71('0x26')]=qs['limit'](_0xa714ed[_0xdf71('0x38')]['limit']);_0xd7c972[_0xdf71('0x23')]=qs[_0xdf71('0x23')](_0xa714ed[_0xdf71('0x38')][_0xdf71('0x23')]);}return _0x2f9d06[_0xdf71('0x90')](_0xd7c972);}})[_0xdf71('0x2c')](function(_0x122176){if(_0x122176){return _0x122176?{'count':_0x5a8329,'rows':_0x122176}:null;}})[_0xdf71('0x2c')](respondWithResult(_0x42d9a6,null))[_0xdf71('0x4c')](handleError(_0x42d9a6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index df8edf0..a5cf75c 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 _0x8bc2=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x3c41fb,_0x2ae079){var _0xe4e126=function(_0x246488){while(--_0x246488){_0x3c41fb['push'](_0x3c41fb['shift']());}};_0xe4e126(++_0x2ae079);}(_0x8bc2,0x137));var _0x28bc=function(_0xa00ecc,_0x4aa7b0){_0xa00ecc=_0xa00ecc-0x0;var _0x5c3a53=_0x8bc2[_0xa00ecc];return _0x5c3a53;};'use strict';var EventEmitter=require(_0x28bc('0x0'));var OpenchannelQueue=require(_0x28bc('0x1'))['db'][_0x28bc('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x28bc('0x3')](0x0);var events={'afterCreate':_0x28bc('0x4'),'afterUpdate':_0x28bc('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd26a22){return function(_0x3c14b3,_0x2f4805,_0x7f71fc){OpenchannelQueueEvents[_0x28bc('0x6')](_0xd26a22+':'+_0x3c14b3['id'],_0x3c14b3);OpenchannelQueueEvents[_0x28bc('0x6')](_0xd26a22,_0x3c14b3);_0x7f71fc(null);};}for(var e in events){if(events[_0x28bc('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x28bc('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x6d61=['remove','emit','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x3d313d,_0x362ec3){var _0x19535c=function(_0x56282f){while(--_0x56282f){_0x3d313d['push'](_0x3d313d['shift']());}};_0x19535c(++_0x362ec3);}(_0x6d61,0x1bc));var _0x16d6=function(_0x23b31c,_0xed724b){_0x23b31c=_0x23b31c-0x0;var _0x3f8948=_0x6d61[_0x23b31c];return _0x3f8948;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x16d6('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x16d6('0x1')](0x0);var events={'afterCreate':_0x16d6('0x2'),'afterUpdate':_0x16d6('0x3'),'afterDestroy':_0x16d6('0x4')};function emitEvent(_0x3339c7){return function(_0x18980f,_0x3d34c1,_0x296a0e){OpenchannelQueueEvents[_0x16d6('0x5')](_0x3339c7+':'+_0x18980f['id'],_0x18980f);OpenchannelQueueEvents[_0x16d6('0x5')](_0x3339c7,_0x18980f);_0x296a0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x16d6('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 58b4140..00fcd66 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 _0xc29f=['../../config/logger','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util'];(function(_0x22bcae,_0x39378d){var _0x3a2fb9=function(_0x19618f){while(--_0x19618f){_0x22bcae['push'](_0x22bcae['shift']());}};_0x3a2fb9(++_0x39378d);}(_0xc29f,0x1a0));var _0xfc29=function(_0x22a2b4,_0x437e2c){_0x22a2b4=_0x22a2b4-0x0;var _0x53dfac=_0xc29f[_0x22a2b4];return _0x53dfac;};'use strict';var _=require(_0xfc29('0x0'));var util=require(_0xfc29('0x1'));var logger=require(_0xfc29('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfc29('0x3'));var rp=require(_0xfc29('0x4'));var fs=require('fs');var path=require(_0xfc29('0x5'));var rimraf=require('rimraf');var config=require(_0xfc29('0x6'));var attributes=require(_0xfc29('0x7'));module[_0xfc29('0x8')]=function(_0x3cfb11,_0x162dba){return _0x3cfb11[_0xfc29('0x9')](_0xfc29('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65e6=['../../config/logger','bluebird','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x29f1f0,_0x2668e1){var _0x384ee5=function(_0x887977){while(--_0x887977){_0x29f1f0['push'](_0x29f1f0['shift']());}};_0x384ee5(++_0x2668e1);}(_0x65e6,0x195));var _0x665e=function(_0x3c561e,_0x3b549e){_0x3c561e=_0x3c561e-0x0;var _0x2e11d3=_0x65e6[_0x3c561e];return _0x2e11d3;};'use strict';var _=require(_0x665e('0x0'));var util=require(_0x665e('0x1'));var logger=require(_0x665e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x665e('0x3'));var rp=require(_0x665e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x665e('0x5'));var config=require('../../config/environment');var attributes=require(_0x665e('0x6'));module[_0x665e('0x7')]=function(_0x2be62c,_0x1235c0){return _0x2be62c[_0x665e('0x8')](_0x665e('0x9'),attributes,{'tableName':_0x665e('0xa'),'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 c81b52d..b244e5e 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 _0x2a40=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowOpenchannelQueue','find','then','lodash'];(function(_0x3648cc,_0x20530c){var _0x33fdc3=function(_0x5f1c66){while(--_0x5f1c66){_0x3648cc['push'](_0x3648cc['shift']());}};_0x33fdc3(++_0x20530c);}(_0x2a40,0x1c7));var _0x02a4=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x2a40[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0x02a4('0x0'));var util=require(_0x02a4('0x1'));var moment=require(_0x02a4('0x2'));var BPromise=require(_0x02a4('0x3'));var rs=require(_0x02a4('0x4'));var fs=require('fs');var Redis=require(_0x02a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x02a4('0x6'));var logger=require(_0x02a4('0x7'))(_0x02a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x02a4('0x9')][_0x02a4('0xa')]({'port':0x232a});config[_0x02a4('0xb')]=_['defaults'](config[_0x02a4('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x02a4('0xc'))['register'](socket);function respondWithRpcPromise(_0x422239,_0x4b7aa3,_0x24338a){return new BPromise(function(_0x522297,_0x3bef75){return client[_0x02a4('0xd')](_0x422239,_0x24338a)['then'](function(_0xe073a9){logger[_0x02a4('0xe')](_0x02a4('0xf'),_0x4b7aa3,_0x02a4('0x10'));logger['debug'](_0x02a4('0x11'),_0x4b7aa3,'request\x20sent',JSON[_0x02a4('0x12')](_0xe073a9));if(_0xe073a9[_0x02a4('0x13')]){if(_0xe073a9['error']['code']===0x1f4){logger[_0x02a4('0x13')](_0x02a4('0xf'),_0x4b7aa3,_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);return _0x3bef75(_0xe073a9[_0x02a4('0x13')]['message']);}logger[_0x02a4('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4b7aa3,_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);return _0x522297(_0xe073a9[_0x02a4('0x13')][_0x02a4('0x14')]);}else{logger[_0x02a4('0xe')](_0x02a4('0xf'),_0x4b7aa3,'request\x20sent');_0x522297(_0xe073a9[_0x02a4('0x15')]['message']);}})['catch'](function(_0x2e747e){logger['error'](_0x02a4('0xf'),_0x4b7aa3,_0x2e747e);_0x3bef75(_0x2e747e);});});}exports[_0x02a4('0x16')]=function(_0x14934b){var _0x50838f=this;return new Promise(function(_0x3e0824,_0x2af121){return db[_0x02a4('0x17')][_0x02a4('0x18')]({'raw':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1a')]===undefined?!![]:![]:!![],'where':_0x14934b[_0x02a4('0x19')]?_0x14934b['options'][_0x02a4('0x1b')]||null:null,'attributes':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1c')]||null:null,'limit':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1d')]||null:null,'include':_0x14934b[_0x02a4('0x19')]?_0x14934b[_0x02a4('0x19')][_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x14934b[_0x02a4('0x19')][_0x02a4('0x1e')],function(_0xdd2031){return{'model':db[_0xdd2031[_0x02a4('0x20')]],'as':_0xdd2031['as'],'attributes':_0xdd2031[_0x02a4('0x1c')],'include':_0xdd2031[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0xdd2031[_0x02a4('0x1e')],function(_0x210d91){return{'model':db[_0x210d91['model']],'as':_0x210d91['as'],'attributes':_0x210d91[_0x02a4('0x1c')],'include':_0x210d91[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x210d91[_0x02a4('0x1e')],function(_0xd80bfe){return{'model':db[_0xd80bfe[_0x02a4('0x20')]],'as':_0xd80bfe['as'],'attributes':_0xd80bfe[_0x02a4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17c3d4){logger['info'](_0x02a4('0x16'),_0x14934b);logger[_0x02a4('0x21')](_0x02a4('0x16'),_0x14934b,JSON[_0x02a4('0x12')](_0x17c3d4));_0x3e0824(_0x17c3d4);})[_0x02a4('0x22')](function(_0x5b4569){logger[_0x02a4('0x13')](_0x02a4('0x16'),_0x5b4569['message'],_0x14934b);_0x2af121(_0x50838f['error'](0x1f4,_0x5b4569['message']));});});};exports[_0x02a4('0x23')]=function(_0x520391){var _0x1f0697=this;return new Promise(function(_0x342022,_0x383874){return db[_0x02a4('0x17')][_0x02a4('0x24')]({'raw':_0x520391[_0x02a4('0x19')]?_0x520391[_0x02a4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x520391[_0x02a4('0x19')]?_0x520391[_0x02a4('0x19')][_0x02a4('0x1b')]||null:null,'attributes':_0x520391[_0x02a4('0x19')]?_0x520391['options'][_0x02a4('0x1c')]||null:null,'include':_0x520391['options']?_0x520391[_0x02a4('0x19')][_0x02a4('0x1e')]?_['map'](_0x520391[_0x02a4('0x19')][_0x02a4('0x1e')],function(_0x24bec3){return{'model':db[_0x24bec3['model']],'as':_0x24bec3['as'],'attributes':_0x24bec3[_0x02a4('0x1c')],'include':_0x24bec3[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x24bec3[_0x02a4('0x1e')],function(_0x55339b){return{'model':db[_0x55339b[_0x02a4('0x20')]],'as':_0x55339b['as'],'attributes':_0x55339b['attributes'],'include':_0x55339b[_0x02a4('0x1e')]?_[_0x02a4('0x1f')](_0x55339b['include'],function(_0x533e72){return{'model':db[_0x533e72[_0x02a4('0x20')]],'as':_0x533e72['as'],'attributes':_0x533e72[_0x02a4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x02a4('0x25')](function(_0x1e58fe){logger['info'](_0x02a4('0x23'),_0x520391);logger['debug'](_0x02a4('0x23'),_0x520391,JSON[_0x02a4('0x12')](_0x1e58fe));_0x342022(_0x1e58fe);})[_0x02a4('0x22')](function(_0x2993c0){logger[_0x02a4('0x13')](_0x02a4('0x23'),_0x2993c0['message'],_0x520391);_0x383874(_0x1f0697['error'](0x1f4,_0x2993c0['message']));});});}; \ No newline at end of file +var _0xfb04=['redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelQueue,\x20%s,\x20%s','result','OpenchannelQueue','findAll','raw','where','options','attributes','limit','include','map','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults'];(function(_0x306bb,_0x224547){var _0x3eb27f=function(_0x25dbbc){while(--_0x25dbbc){_0x306bb['push'](_0x306bb['shift']());}};_0x3eb27f(++_0x224547);}(_0xfb04,0x72));var _0x4fb0=function(_0x3b0af9,_0x1f6412){_0x3b0af9=_0x3b0af9-0x0;var _0x53c005=_0xfb04[_0x3b0af9];return _0x53c005;};'use strict';var _=require(_0x4fb0('0x0'));var util=require(_0x4fb0('0x1'));var moment=require(_0x4fb0('0x2'));var BPromise=require('bluebird');var rs=require(_0x4fb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fb0('0x4'))['db'];var utils=require(_0x4fb0('0x5'));var logger=require(_0x4fb0('0x6'))(_0x4fb0('0x7'));var config=require(_0x4fb0('0x8'));var jayson=require(_0x4fb0('0x9'));var client=jayson[_0x4fb0('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4fb0('0xb')](config[_0x4fb0('0xc')],{'host':_0x4fb0('0xd'),'port':0x18eb});var socket=require(_0x4fb0('0xe'))(new Redis(config['redis']));require(_0x4fb0('0xf'))[_0x4fb0('0x10')](socket);function respondWithRpcPromise(_0x37d8cf,_0x1ee2e4,_0x30ec4f){return new BPromise(function(_0x486fc0,_0x402cbb){return client[_0x4fb0('0x11')](_0x37d8cf,_0x30ec4f)[_0x4fb0('0x12')](function(_0x53d3b0){logger[_0x4fb0('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ee2e4,'request\x20sent');logger[_0x4fb0('0x14')](_0x4fb0('0x15'),_0x1ee2e4,_0x4fb0('0x16'),JSON[_0x4fb0('0x17')](_0x53d3b0));if(_0x53d3b0[_0x4fb0('0x18')]){if(_0x53d3b0[_0x4fb0('0x18')]['code']===0x1f4){logger[_0x4fb0('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ee2e4,_0x53d3b0[_0x4fb0('0x18')][_0x4fb0('0x19')]);return _0x402cbb(_0x53d3b0[_0x4fb0('0x18')][_0x4fb0('0x19')]);}logger['error'](_0x4fb0('0x1a'),_0x1ee2e4,_0x53d3b0[_0x4fb0('0x18')][_0x4fb0('0x19')]);return _0x486fc0(_0x53d3b0[_0x4fb0('0x18')][_0x4fb0('0x19')]);}else{logger[_0x4fb0('0x13')](_0x4fb0('0x1a'),_0x1ee2e4,'request\x20sent');_0x486fc0(_0x53d3b0[_0x4fb0('0x1b')]['message']);}})['catch'](function(_0x282368){logger[_0x4fb0('0x18')](_0x4fb0('0x1a'),_0x1ee2e4,_0x282368);_0x402cbb(_0x282368);});});}exports['GetOpenchannelQueue']=function(_0x2117e){var _0x64bc6a=this;return new Promise(function(_0x245488,_0x28b5da){return db[_0x4fb0('0x1c')][_0x4fb0('0x1d')]({'raw':_0x2117e['options']?_0x2117e['options'][_0x4fb0('0x1e')]===undefined?!![]:![]:!![],'where':_0x2117e['options']?_0x2117e['options'][_0x4fb0('0x1f')]||null:null,'attributes':_0x2117e[_0x4fb0('0x20')]?_0x2117e['options'][_0x4fb0('0x21')]||null:null,'limit':_0x2117e['options']?_0x2117e[_0x4fb0('0x20')][_0x4fb0('0x22')]||null:null,'include':_0x2117e['options']?_0x2117e[_0x4fb0('0x20')][_0x4fb0('0x23')]?_[_0x4fb0('0x24')](_0x2117e[_0x4fb0('0x20')]['include'],function(_0x320969){return{'model':db[_0x320969[_0x4fb0('0x25')]],'as':_0x320969['as'],'attributes':_0x320969[_0x4fb0('0x21')],'include':_0x320969[_0x4fb0('0x23')]?_[_0x4fb0('0x24')](_0x320969[_0x4fb0('0x23')],function(_0x5ee060){return{'model':db[_0x5ee060[_0x4fb0('0x25')]],'as':_0x5ee060['as'],'attributes':_0x5ee060[_0x4fb0('0x21')],'include':_0x5ee060[_0x4fb0('0x23')]?_['map'](_0x5ee060[_0x4fb0('0x23')],function(_0x571837){return{'model':db[_0x571837[_0x4fb0('0x25')]],'as':_0x571837['as'],'attributes':_0x571837[_0x4fb0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dc3f2){logger['info'](_0x4fb0('0x26'),_0x2117e);logger[_0x4fb0('0x14')]('GetOpenchannelQueue',_0x2117e,JSON['stringify'](_0x4dc3f2));_0x245488(_0x4dc3f2);})[_0x4fb0('0x27')](function(_0xb78314){logger[_0x4fb0('0x18')](_0x4fb0('0x26'),_0xb78314[_0x4fb0('0x19')],_0x2117e);_0x28b5da(_0x64bc6a['error'](0x1f4,_0xb78314[_0x4fb0('0x19')]));});});};exports[_0x4fb0('0x28')]=function(_0x405d02){var _0x240c7f=this;return new Promise(function(_0x5ac780,_0x4a873a){return db[_0x4fb0('0x1c')][_0x4fb0('0x29')]({'raw':_0x405d02['options']?_0x405d02['options'][_0x4fb0('0x1e')]===undefined?!![]:![]:!![],'where':_0x405d02[_0x4fb0('0x20')]?_0x405d02[_0x4fb0('0x20')][_0x4fb0('0x1f')]||null:null,'attributes':_0x405d02[_0x4fb0('0x20')]?_0x405d02['options'][_0x4fb0('0x21')]||null:null,'include':_0x405d02[_0x4fb0('0x20')]?_0x405d02[_0x4fb0('0x20')][_0x4fb0('0x23')]?_['map'](_0x405d02[_0x4fb0('0x20')][_0x4fb0('0x23')],function(_0x56d156){return{'model':db[_0x56d156['model']],'as':_0x56d156['as'],'attributes':_0x56d156['attributes'],'include':_0x56d156[_0x4fb0('0x23')]?_['map'](_0x56d156['include'],function(_0x2a52a2){return{'model':db[_0x2a52a2[_0x4fb0('0x25')]],'as':_0x2a52a2['as'],'attributes':_0x2a52a2[_0x4fb0('0x21')],'include':_0x2a52a2['include']?_['map'](_0x2a52a2[_0x4fb0('0x23')],function(_0x4b8b4b){return{'model':db[_0x4b8b4b[_0x4fb0('0x25')]],'as':_0x4b8b4b['as'],'attributes':_0x4b8b4b[_0x4fb0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4fb0('0x12')](function(_0x11e28d){logger['info']('ShowOpenchannelQueue',_0x405d02);logger[_0x4fb0('0x14')](_0x4fb0('0x28'),_0x405d02,JSON[_0x4fb0('0x17')](_0x11e28d));_0x5ac780(_0x11e28d);})[_0x4fb0('0x27')](function(_0x236319){logger[_0x4fb0('0x18')](_0x4fb0('0x28'),_0x236319[_0x4fb0('0x19')],_0x405d02);_0x4a873a(_0x240c7f['error'](0x1f4,_0x236319['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cf34f4a..a4006dd 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 _0x42c0=['register','./openchannelQueue.events','emit'];(function(_0x5c63f5,_0x3bef9e){var _0x5d757e=function(_0x24435d){while(--_0x24435d){_0x5c63f5['push'](_0x5c63f5['shift']());}};_0x5d757e(++_0x3bef9e);}(_0x42c0,0x1cf));var _0x042c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x42c0[_0x27af45];return _0x18df21;};'use strict';var OpenchannelQueueEvents=require(_0x042c('0x0'));var events=['save','remove','update'];function createListener(_0x5a9b38,_0x3f3b4a){return function(_0x4e4b2e){_0x3f3b4a[_0x042c('0x1')](_0x5a9b38,_0x4e4b2e);};}function removeListener(_0x5e473f,_0x467edb){return function(){OpenchannelQueueEvents['removeListener'](_0x5e473f,_0x467edb);};}exports[_0x042c('0x2')]=function(_0x301dc8){for(var _0x3e9d32=0x0,_0xc6e34a=events['length'];_0x3e9d32<_0xc6e34a;_0x3e9d32++){var _0x17e3c5=events[_0x3e9d32];var _0x3420a7=createListener('openchannelQueue:'+_0x17e3c5,_0x301dc8);OpenchannelQueueEvents['on'](_0x17e3c5,_0x3420a7);}}; \ No newline at end of file +var _0xf2ba=['openchannelQueue:','./openchannelQueue.events','save','removeListener','length'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0xf2ba,0xab));var _0xaf2b=function(_0x4ec119,_0x5e20f7){_0x4ec119=_0x4ec119-0x0;var _0x1f45a9=_0xf2ba[_0x4ec119];return _0x1f45a9;};'use strict';var OpenchannelQueueEvents=require(_0xaf2b('0x0'));var events=[_0xaf2b('0x1'),'remove','update'];function createListener(_0x19f781,_0x278600){return function(_0x53e5d8){_0x278600['emit'](_0x19f781,_0x53e5d8);};}function removeListener(_0x270bcd,_0x470eae){return function(){OpenchannelQueueEvents[_0xaf2b('0x2')](_0x270bcd,_0x470eae);};}exports['register']=function(_0x4e6e12){for(var _0x57f9b6=0x0,_0x32081f=events[_0xaf2b('0x3')];_0x57f9b6<_0x32081f;_0x57f9b6++){var _0x59c0e9=events[_0x57f9b6];var _0x429e47=createListener(_0xaf2b('0x4')+_0x59c0e9,_0x4e6e12);OpenchannelQueueEvents['on'](_0x59c0e9,_0x429e47);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index c2200af..a4ee1d0 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 _0xb84e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','/:id','update','delete','destroy','multer','util','path'];(function(_0x97688b,_0x24a0aa){var _0x4e0ca4=function(_0x1820e3){while(--_0x1820e3){_0x97688b['push'](_0x97688b['shift']());}};_0x4e0ca4(++_0x24a0aa);}(_0xb84e,0x165));var _0xeb84=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xb84e[_0x35485a];return _0x5148e6;};'use strict';var multer=require(_0xeb84('0x0'));var util=require(_0xeb84('0x1'));var path=require(_0xeb84('0x2'));var timeout=require(_0xeb84('0x3'));var express=require('express');var router=express[_0xeb84('0x4')]();var fs_extra=require(_0xeb84('0x5'));var auth=require(_0xeb84('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb84('0x7'));var controller=require(_0xeb84('0x8'));router[_0xeb84('0x9')]('/',auth[_0xeb84('0xa')](),controller[_0xeb84('0xb')]);router[_0xeb84('0x9')]('/describe',auth[_0xeb84('0xa')](),controller[_0xeb84('0xc')]);router[_0xeb84('0x9')]('/:id',auth[_0xeb84('0xa')](),controller[_0xeb84('0xd')]);router[_0xeb84('0xe')]('/',auth['isAuthenticated'](),controller[_0xeb84('0xf')]);router['put'](_0xeb84('0x10'),auth[_0xeb84('0xa')](),controller[_0xeb84('0x11')]);router[_0xeb84('0x12')](_0xeb84('0x10'),auth[_0xeb84('0xa')](),controller[_0xeb84('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5fb7=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','multer','path','connect-timeout','express'];(function(_0x314d82,_0x52f61c){var _0x2f01bc=function(_0x531836){while(--_0x531836){_0x314d82['push'](_0x314d82['shift']());}};_0x2f01bc(++_0x52f61c);}(_0x5fb7,0xd8));var _0x75fb=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x5fb7[_0xd511d];return _0x3f148e;};'use strict';var multer=require(_0x75fb('0x0'));var util=require('util');var path=require(_0x75fb('0x1'));var timeout=require(_0x75fb('0x2'));var express=require(_0x75fb('0x3'));var router=express['Router']();var fs_extra=require(_0x75fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75fb('0x5'));var config=require(_0x75fb('0x6'));var controller=require(_0x75fb('0x7'));router['get']('/',auth[_0x75fb('0x8')](),controller[_0x75fb('0x9')]);router[_0x75fb('0xa')](_0x75fb('0xb'),auth[_0x75fb('0x8')](),controller[_0x75fb('0xc')]);router[_0x75fb('0xa')]('/:id',auth[_0x75fb('0x8')](),controller[_0x75fb('0xd')]);router[_0x75fb('0xe')]('/',auth[_0x75fb('0x8')](),controller[_0x75fb('0xf')]);router[_0x75fb('0x10')](_0x75fb('0x11'),auth[_0x75fb('0x8')](),controller[_0x75fb('0x12')]);router['delete'](_0x75fb('0x11'),auth[_0x75fb('0x8')](),controller[_0x75fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 76165d9..272651a 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 _0x3123=['sequelize','STRING','DATE','moment'];(function(_0x578444,_0x239e6c){var _0x154c77=function(_0x475f11){while(--_0x475f11){_0x578444['push'](_0x578444['shift']());}};_0x154c77(++_0x239e6c);}(_0x3123,0x1f3));var _0x3312=function(_0x3b9a90,_0x42e652){_0x3b9a90=_0x3b9a90-0x0;var _0x5b765d=_0x3123[_0x3b9a90];return _0x5b765d;};'use strict';var moment=require(_0x3312('0x0'));var Sequelize=require(_0x3312('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3312('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3312('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3312('0x3')]},'acceptAt':{'type':Sequelize[_0x3312('0x3')]},'exitAt':{'type':Sequelize[_0x3312('0x3')]},'reason':{'type':Sequelize[_0x3312('0x2')]}}; \ No newline at end of file +var _0x7631=['moment','exports','STRING','DATE'];(function(_0x4b3300,_0x1137f1){var _0x2d26d3=function(_0x4678b5){while(--_0x4678b5){_0x4b3300['push'](_0x4b3300['shift']());}};_0x2d26d3(++_0x1137f1);}(_0x7631,0x108));var _0x1763=function(_0x463f0a,_0x4267f9){_0x463f0a=_0x463f0a-0x0;var _0x5501f2=_0x7631[_0x463f0a];return _0x5501f2;};'use strict';var moment=require(_0x1763('0x0'));var Sequelize=require('sequelize');module[_0x1763('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1763('0x2')]},'joinAt':{'type':Sequelize[_0x1763('0x3')]},'leaveAt':{'type':Sequelize[_0x1763('0x3')]},'acceptAt':{'type':Sequelize[_0x1763('0x3')]},'exitAt':{'type':Sequelize[_0x1763('0x3')]},'reason':{'type':Sequelize[_0x1763('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index d2cf565..b8354cb 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 _0x95e1=['includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','save','then','status','end','sendStatus','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','filter','merge','options'];(function(_0x2be8a8,_0xb7ddc){var _0x50845f=function(_0x5302f9){while(--_0x5302f9){_0x2be8a8['push'](_0x2be8a8['shift']());}};_0x50845f(++_0xb7ddc);}(_0x95e1,0x183));var _0x195e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x95e1[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x195e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x195e('0x1'));var jsonpatch=require(_0x195e('0x2'));var rp=require(_0x195e('0x3'));var moment=require(_0x195e('0x4'));var BPromise=require(_0x195e('0x5'));var Mustache=require(_0x195e('0x6'));var util=require(_0x195e('0x7'));var path=require(_0x195e('0x8'));var sox=require(_0x195e('0x9'));var csv=require('to-csv');var ejs=require(_0x195e('0xa'));var fs=require('fs');var fs_extra=require(_0x195e('0xb'));var _=require(_0x195e('0xc'));var squel=require(_0x195e('0xd'));var crypto=require(_0x195e('0xe'));var jsforce=require(_0x195e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x195e('0x10'));var Papa=require('papaparse');var Redis=require(_0x195e('0x11'));var authService=require(_0x195e('0x12'));var qs=require(_0x195e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x195e('0x14'));var logger=require(_0x195e('0x15'))('api');var utils=require(_0x195e('0x16'));var config=require(_0x195e('0x17'));var licenseUtil=require(_0x195e('0x18'));var db=require(_0x195e('0x19'))['db'];function respondWithStatusCode(_0xd1d758,_0x2d8321){_0x2d8321=_0x2d8321||0xcc;return function(_0x17f8ba){if(_0x17f8ba){return _0xd1d758['sendStatus'](_0x2d8321);}return _0xd1d758['status'](_0x2d8321)['end']();};}function respondWithResult(_0x562124,_0x26df61){_0x26df61=_0x26df61||0xc8;return function(_0x2ce7aa){if(_0x2ce7aa){return _0x562124['status'](_0x26df61)[_0x195e('0x1a')](_0x2ce7aa);}};}function respondWithFilteredResult(_0x89f1f0,_0x31782d){return function(_0x26120c){if(_0x26120c){var _0x484633=typeof _0x31782d[_0x195e('0x1b')]===_0x195e('0x1c')&&typeof _0x31782d['limit']===_0x195e('0x1c');var _0x483329=_0x26120c[_0x195e('0x1d')];var _0x2012ee=_0x484633?0x0:_0x31782d[_0x195e('0x1b')];var _0x409a0f=_0x484633?_0x26120c[_0x195e('0x1d')]:_0x31782d[_0x195e('0x1b')]+_0x31782d[_0x195e('0x1e')];var _0x10f7ee;if(_0x409a0f>=_0x483329){_0x409a0f=_0x483329;_0x10f7ee=0xc8;}else{_0x10f7ee=0xce;}_0x89f1f0['status'](_0x10f7ee);return _0x89f1f0[_0x195e('0x1f')](_0x195e('0x20'),_0x2012ee+'-'+_0x409a0f+'/'+_0x483329)[_0x195e('0x1a')](_0x26120c);}return null;};}function patchUpdates(_0xabb958){return function(_0x31a202){try{jsonpatch['apply'](_0x31a202,_0xabb958,!![]);}catch(_0x6ffc7a){return BPromise['reject'](_0x6ffc7a);}return _0x31a202[_0x195e('0x21')]();};}function saveUpdates(_0x31c637,_0x40c454){return function(_0x411715){if(_0x411715){return _0x411715['update'](_0x31c637)[_0x195e('0x22')](function(_0x39a747){return _0x39a747;});}return null;};}function removeEntity(_0x352e54,_0x482099){return function(_0x195796){if(_0x195796){return _0x195796['destroy']()['then'](function(){_0x352e54[_0x195e('0x23')](0xcc)[_0x195e('0x24')]();});}};}function handleEntityNotFound(_0x41c8d7,_0x4a1db0){return function(_0x569ed2){if(!_0x569ed2){_0x41c8d7[_0x195e('0x25')](0x194);}return _0x569ed2;};}function handleError(_0x363c5d,_0x4590e6){_0x4590e6=_0x4590e6||0x1f4;return function(_0x315d91){logger[_0x195e('0x26')](_0x315d91[_0x195e('0x27')]);if(_0x315d91[_0x195e('0x28')]){delete _0x315d91['name'];}_0x363c5d['status'](_0x4590e6)[_0x195e('0x29')](_0x315d91);};}exports['index']=function(_0xdbedff,_0x4efd91){var _0x1647b4={},_0x168c42={},_0x1fb3f3={'count':0x0,'rows':[]};var _0xc5bb9c=_[_0x195e('0x2a')](db[_0x195e('0x2b')][_0x195e('0x2c')],function(_0x479895){return{'name':_0x479895['fieldName'],'type':_0x479895[_0x195e('0x2d')][_0x195e('0x2e')]};});_0x168c42['model']=_[_0x195e('0x2a')](_0xc5bb9c,'name');_0x168c42[_0x195e('0x2f')]=_[_0x195e('0x30')](_0xdbedff[_0x195e('0x2f')]);_0x168c42['filters']=_[_0x195e('0x31')](_0x168c42['model'],_0x168c42[_0x195e('0x2f')]);_0x1647b4[_0x195e('0x32')]=_[_0x195e('0x31')](_0x168c42[_0x195e('0x33')],qs[_0x195e('0x34')](_0xdbedff['query'][_0x195e('0x34')]));_0x1647b4[_0x195e('0x32')]=_0x1647b4[_0x195e('0x32')][_0x195e('0x35')]?_0x1647b4[_0x195e('0x32')]:_0x168c42[_0x195e('0x33')];if(!_0xdbedff[_0x195e('0x2f')][_0x195e('0x36')]('nolimit')){_0x1647b4[_0x195e('0x1e')]=qs['limit'](_0xdbedff[_0x195e('0x2f')][_0x195e('0x1e')]);_0x1647b4[_0x195e('0x1b')]=qs[_0x195e('0x1b')](_0xdbedff['query'][_0x195e('0x1b')]);}_0x1647b4[_0x195e('0x37')]=qs['sort'](_0xdbedff[_0x195e('0x2f')][_0x195e('0x38')]);_0x1647b4['where']=qs[_0x195e('0x39')](_[_0x195e('0x3a')](_0xdbedff[_0x195e('0x2f')],_0x168c42['filters']),_0xc5bb9c);if(_0xdbedff[_0x195e('0x2f')]['filter']){_0x1647b4[_0x195e('0x3b')]=_['merge'](_0x1647b4[_0x195e('0x3b')],{'$or':_['map'](_0xc5bb9c,function(_0x3e3982){if(_0x3e3982[_0x195e('0x2d')]!=='VIRTUAL'){var _0x9be974={};_0x9be974[_0x3e3982[_0x195e('0x28')]]={'$like':'%'+_0xdbedff['query'][_0x195e('0x3c')]+'%'};return _0x9be974;}})});}_0x1647b4=_[_0x195e('0x3d')]({},_0x1647b4,_0xdbedff[_0x195e('0x3e')]);var _0x48eec5={'where':_0x1647b4['where']};return db[_0x195e('0x2b')]['count'](_0x48eec5)[_0x195e('0x22')](function(_0x2c5ae0){_0x1fb3f3[_0x195e('0x1d')]=_0x2c5ae0;if(_0xdbedff['query'][_0x195e('0x3f')]){_0x1647b4[_0x195e('0x40')]=[{'all':!![]}];}return db[_0x195e('0x2b')]['findAll'](_0x1647b4);})[_0x195e('0x22')](function(_0x2615eb){_0x1fb3f3[_0x195e('0x41')]=_0x2615eb;return _0x1fb3f3;})[_0x195e('0x22')](respondWithFilteredResult(_0x4efd91,_0x1647b4))[_0x195e('0x42')](handleError(_0x4efd91,null));};exports[_0x195e('0x43')]=function(_0x26df2c,_0x3139b2){var _0x367f3c={'raw':!![],'where':{'id':_0x26df2c[_0x195e('0x44')]['id']}},_0x46cc88={};_0x46cc88['model']=_[_0x195e('0x30')](db[_0x195e('0x2b')]['rawAttributes']);_0x46cc88[_0x195e('0x2f')]=_[_0x195e('0x30')](_0x26df2c['query']);_0x46cc88[_0x195e('0x39')]=_[_0x195e('0x31')](_0x46cc88['model'],_0x46cc88[_0x195e('0x2f')]);_0x367f3c[_0x195e('0x32')]=_['intersection'](_0x46cc88['model'],qs[_0x195e('0x34')](_0x26df2c[_0x195e('0x2f')][_0x195e('0x34')]));_0x367f3c['attributes']=_0x367f3c[_0x195e('0x32')]['length']?_0x367f3c['attributes']:_0x46cc88['model'];if(_0x26df2c[_0x195e('0x2f')][_0x195e('0x3f')]){_0x367f3c[_0x195e('0x40')]=[{'all':!![]}];}_0x367f3c=_[_0x195e('0x3d')]({},_0x367f3c,_0x26df2c['options']);return db[_0x195e('0x2b')][_0x195e('0x45')](_0x367f3c)[_0x195e('0x22')](handleEntityNotFound(_0x3139b2,null))[_0x195e('0x22')](respondWithResult(_0x3139b2,null))['catch'](handleError(_0x3139b2,null));};exports[_0x195e('0x46')]=function(_0x2c5749,_0x5f3327){return db[_0x195e('0x2b')][_0x195e('0x46')](_0x2c5749[_0x195e('0x47')],{})[_0x195e('0x22')](respondWithResult(_0x5f3327,0xc9))[_0x195e('0x42')](handleError(_0x5f3327,null));};exports[_0x195e('0x48')]=function(_0x31d90a,_0x5d38d3){if(_0x31d90a['body']['id']){delete _0x31d90a[_0x195e('0x47')]['id'];}return db[_0x195e('0x2b')][_0x195e('0x45')]({'where':{'id':_0x31d90a[_0x195e('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d38d3,null))['then'](saveUpdates(_0x31d90a[_0x195e('0x47')],null))[_0x195e('0x22')](respondWithResult(_0x5d38d3,null))['catch'](handleError(_0x5d38d3,null));};exports[_0x195e('0x49')]=function(_0x12bba7,_0xc8d9f6){return db[_0x195e('0x2b')]['find']({'where':{'id':_0x12bba7[_0x195e('0x44')]['id']}})[_0x195e('0x22')](handleEntityNotFound(_0xc8d9f6,null))[_0x195e('0x22')](removeEntity(_0xc8d9f6,null))[_0x195e('0x42')](handleError(_0xc8d9f6,null));};exports[_0x195e('0x4a')]=function(_0x2eab0c,_0x53b954){return db[_0x195e('0x2b')][_0x195e('0x4a')]()[_0x195e('0x22')](respondWithResult(_0x53b954,null))['catch'](handleError(_0x53b954,null));}; \ No newline at end of file +var _0x46ee=['moment','bluebird','mustache','util','path','sox','ejs','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','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3a8b12,_0x294dfd){var _0x44fb1d=function(_0x4b1fed){while(--_0x4b1fed){_0x3a8b12['push'](_0x3a8b12['shift']());}};_0x44fb1d(++_0x294dfd);}(_0x46ee,0x186));var _0xe46e=function(_0x3269bf,_0x29a387){_0x3269bf=_0x3269bf-0x0;var _0x4500cd=_0x46ee[_0x3269bf];return _0x4500cd;};'use strict';var emlformat=require(_0xe46e('0x0'));var rimraf=require(_0xe46e('0x1'));var zipdir=require(_0xe46e('0x2'));var jsonpatch=require(_0xe46e('0x3'));var rp=require(_0xe46e('0x4'));var moment=require(_0xe46e('0x5'));var BPromise=require(_0xe46e('0x6'));var Mustache=require(_0xe46e('0x7'));var util=require(_0xe46e('0x8'));var path=require(_0xe46e('0x9'));var sox=require(_0xe46e('0xa'));var csv=require('to-csv');var ejs=require(_0xe46e('0xb'));var fs=require('fs');var fs_extra=require(_0xe46e('0xc'));var _=require('lodash');var squel=require(_0xe46e('0xd'));var crypto=require(_0xe46e('0xe'));var jsforce=require(_0xe46e('0xf'));var deskjs=require(_0xe46e('0x10'));var toCsv=require(_0xe46e('0x11'));var querystring=require(_0xe46e('0x12'));var Papa=require(_0xe46e('0x13'));var Redis=require(_0xe46e('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe46e('0x15'));var as=require(_0xe46e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe46e('0x17'));var utils=require(_0xe46e('0x18'));var config=require(_0xe46e('0x19'));var licenseUtil=require(_0xe46e('0x1a'));var db=require(_0xe46e('0x1b'))['db'];function respondWithStatusCode(_0x158b5d,_0x33be70){_0x33be70=_0x33be70||0xcc;return function(_0x42e65d){if(_0x42e65d){return _0x158b5d[_0xe46e('0x1c')](_0x33be70);}return _0x158b5d[_0xe46e('0x1d')](_0x33be70)[_0xe46e('0x1e')]();};}function respondWithResult(_0x3bf916,_0x19601f){_0x19601f=_0x19601f||0xc8;return function(_0x13b2c2){if(_0x13b2c2){return _0x3bf916['status'](_0x19601f)['json'](_0x13b2c2);}};}function respondWithFilteredResult(_0x343b5f,_0x39b8b9){return function(_0x438a88){if(_0x438a88){var _0x1df968=typeof _0x39b8b9[_0xe46e('0x1f')]===_0xe46e('0x20')&&typeof _0x39b8b9['limit']===_0xe46e('0x20');var _0x3599ac=_0x438a88[_0xe46e('0x21')];var _0x57705e=_0x1df968?0x0:_0x39b8b9['offset'];var _0x12e10d=_0x1df968?_0x438a88['count']:_0x39b8b9[_0xe46e('0x1f')]+_0x39b8b9[_0xe46e('0x22')];var _0x5267ee;if(_0x12e10d>=_0x3599ac){_0x12e10d=_0x3599ac;_0x5267ee=0xc8;}else{_0x5267ee=0xce;}_0x343b5f[_0xe46e('0x1d')](_0x5267ee);return _0x343b5f[_0xe46e('0x23')](_0xe46e('0x24'),_0x57705e+'-'+_0x12e10d+'/'+_0x3599ac)[_0xe46e('0x25')](_0x438a88);}return null;};}function patchUpdates(_0x113d65){return function(_0x230d4e){try{jsonpatch[_0xe46e('0x26')](_0x230d4e,_0x113d65,!![]);}catch(_0x4d37ef){return BPromise[_0xe46e('0x27')](_0x4d37ef);}return _0x230d4e[_0xe46e('0x28')]();};}function saveUpdates(_0x5a46de,_0x375b2b){return function(_0x1920b4){if(_0x1920b4){return _0x1920b4['update'](_0x5a46de)[_0xe46e('0x29')](function(_0x28ef2f){return _0x28ef2f;});}return null;};}function removeEntity(_0x54c539,_0x1f8a2b){return function(_0x3b4c3b){if(_0x3b4c3b){return _0x3b4c3b[_0xe46e('0x2a')]()[_0xe46e('0x29')](function(){_0x54c539[_0xe46e('0x1d')](0xcc)[_0xe46e('0x1e')]();});}};}function handleEntityNotFound(_0x8d55f2,_0x645b43){return function(_0xf917b8){if(!_0xf917b8){_0x8d55f2[_0xe46e('0x1c')](0x194);}return _0xf917b8;};}function handleError(_0x4e8993,_0x24c38a){_0x24c38a=_0x24c38a||0x1f4;return function(_0x3b63c1){logger['error'](_0x3b63c1[_0xe46e('0x2b')]);if(_0x3b63c1[_0xe46e('0x2c')]){delete _0x3b63c1[_0xe46e('0x2c')];}_0x4e8993[_0xe46e('0x1d')](_0x24c38a)['send'](_0x3b63c1);};}exports[_0xe46e('0x2d')]=function(_0x22d0d2,_0x1ef118){var _0x154deb={},_0x3178ab={},_0x115be5={'count':0x0,'rows':[]};var _0x31cf67=_[_0xe46e('0x2e')](db[_0xe46e('0x2f')][_0xe46e('0x30')],function(_0x3893f6){return{'name':_0x3893f6[_0xe46e('0x31')],'type':_0x3893f6['type'][_0xe46e('0x32')]};});_0x3178ab[_0xe46e('0x33')]=_[_0xe46e('0x2e')](_0x31cf67,'name');_0x3178ab[_0xe46e('0x34')]=_[_0xe46e('0x35')](_0x22d0d2['query']);_0x3178ab['filters']=_[_0xe46e('0x36')](_0x3178ab['model'],_0x3178ab[_0xe46e('0x34')]);_0x154deb[_0xe46e('0x37')]=_['intersection'](_0x3178ab[_0xe46e('0x33')],qs[_0xe46e('0x38')](_0x22d0d2['query'][_0xe46e('0x38')]));_0x154deb[_0xe46e('0x37')]=_0x154deb[_0xe46e('0x37')]['length']?_0x154deb[_0xe46e('0x37')]:_0x3178ab['model'];if(!_0x22d0d2['query']['hasOwnProperty']('nolimit')){_0x154deb[_0xe46e('0x22')]=qs[_0xe46e('0x22')](_0x22d0d2[_0xe46e('0x34')]['limit']);_0x154deb['offset']=qs['offset'](_0x22d0d2[_0xe46e('0x34')][_0xe46e('0x1f')]);}_0x154deb[_0xe46e('0x39')]=qs[_0xe46e('0x3a')](_0x22d0d2['query']['sort']);_0x154deb[_0xe46e('0x3b')]=qs[_0xe46e('0x3c')](_[_0xe46e('0x3d')](_0x22d0d2[_0xe46e('0x34')],_0x3178ab[_0xe46e('0x3c')]),_0x31cf67);if(_0x22d0d2[_0xe46e('0x34')][_0xe46e('0x3e')]){_0x154deb[_0xe46e('0x3b')]=_[_0xe46e('0x3f')](_0x154deb[_0xe46e('0x3b')],{'$or':_[_0xe46e('0x2e')](_0x31cf67,function(_0x4d0b7c){if(_0x4d0b7c[_0xe46e('0x40')]!==_0xe46e('0x41')){var _0x5e0c56={};_0x5e0c56[_0x4d0b7c['name']]={'$like':'%'+_0x22d0d2[_0xe46e('0x34')]['filter']+'%'};return _0x5e0c56;}})});}_0x154deb=_['merge']({},_0x154deb,_0x22d0d2[_0xe46e('0x42')]);var _0x3c4818={'where':_0x154deb[_0xe46e('0x3b')]};return db[_0xe46e('0x2f')][_0xe46e('0x21')](_0x3c4818)[_0xe46e('0x29')](function(_0x354f22){_0x115be5[_0xe46e('0x21')]=_0x354f22;if(_0x22d0d2['query'][_0xe46e('0x43')]){_0x154deb[_0xe46e('0x44')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x154deb);})[_0xe46e('0x29')](function(_0x308810){_0x115be5[_0xe46e('0x45')]=_0x308810;return _0x115be5;})['then'](respondWithFilteredResult(_0x1ef118,_0x154deb))['catch'](handleError(_0x1ef118,null));};exports[_0xe46e('0x46')]=function(_0x5b3089,_0x200b51){var _0xe7b55c={'raw':!![],'where':{'id':_0x5b3089[_0xe46e('0x47')]['id']}},_0x20621d={};_0x20621d[_0xe46e('0x33')]=_[_0xe46e('0x35')](db['OpenchannelQueueReport'][_0xe46e('0x30')]);_0x20621d[_0xe46e('0x34')]=_[_0xe46e('0x35')](_0x5b3089[_0xe46e('0x34')]);_0x20621d[_0xe46e('0x3c')]=_[_0xe46e('0x36')](_0x20621d['model'],_0x20621d[_0xe46e('0x34')]);_0xe7b55c[_0xe46e('0x37')]=_[_0xe46e('0x36')](_0x20621d['model'],qs[_0xe46e('0x38')](_0x5b3089['query'][_0xe46e('0x38')]));_0xe7b55c[_0xe46e('0x37')]=_0xe7b55c[_0xe46e('0x37')][_0xe46e('0x48')]?_0xe7b55c[_0xe46e('0x37')]:_0x20621d['model'];if(_0x5b3089[_0xe46e('0x34')][_0xe46e('0x43')]){_0xe7b55c[_0xe46e('0x44')]=[{'all':!![]}];}_0xe7b55c=_[_0xe46e('0x3f')]({},_0xe7b55c,_0x5b3089[_0xe46e('0x42')]);return db['OpenchannelQueueReport'][_0xe46e('0x49')](_0xe7b55c)[_0xe46e('0x29')](handleEntityNotFound(_0x200b51,null))[_0xe46e('0x29')](respondWithResult(_0x200b51,null))['catch'](handleError(_0x200b51,null));};exports[_0xe46e('0x4a')]=function(_0x12fa5c,_0x548579){return db[_0xe46e('0x2f')][_0xe46e('0x4a')](_0x12fa5c[_0xe46e('0x4b')],{})[_0xe46e('0x29')](respondWithResult(_0x548579,0xc9))[_0xe46e('0x4c')](handleError(_0x548579,null));};exports[_0xe46e('0x4d')]=function(_0x22a8b7,_0x20955a){if(_0x22a8b7[_0xe46e('0x4b')]['id']){delete _0x22a8b7[_0xe46e('0x4b')]['id'];}return db[_0xe46e('0x2f')][_0xe46e('0x49')]({'where':{'id':_0x22a8b7['params']['id']}})[_0xe46e('0x29')](handleEntityNotFound(_0x20955a,null))['then'](saveUpdates(_0x22a8b7[_0xe46e('0x4b')],null))[_0xe46e('0x29')](respondWithResult(_0x20955a,null))[_0xe46e('0x4c')](handleError(_0x20955a,null));};exports[_0xe46e('0x2a')]=function(_0x36496a,_0x4fc311){return db[_0xe46e('0x2f')]['find']({'where':{'id':_0x36496a[_0xe46e('0x47')]['id']}})[_0xe46e('0x29')](handleEntityNotFound(_0x4fc311,null))[_0xe46e('0x29')](removeEntity(_0x4fc311,null))[_0xe46e('0x4c')](handleError(_0x4fc311,null));};exports[_0xe46e('0x4e')]=function(_0x405920,_0x3f35c0){return db['OpenchannelQueueReport'][_0xe46e('0x4e')]()[_0xe46e('0x29')](respondWithResult(_0x3f35c0,null))[_0xe46e('0x4c')](handleError(_0x3f35c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6a7e5e8..976ac33 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xafd652,_0x2780ee){var _0x217596=function(_0x78dcd8){while(--_0x78dcd8){_0xafd652['push'](_0xafd652['shift']());}};_0x217596(++_0x2780ee);}(_0xe14b,0x93));var _0xbe14=function(_0x35f843,_0x414c38){_0x35f843=_0x35f843-0x0;var _0x1dddae=_0xe14b[_0x35f843];return _0x1dddae;};'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 +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x48bcb0,_0x5d1635){var _0xcaeaa0=function(_0x817f83){while(--_0x817f83){_0x48bcb0['push'](_0x48bcb0['shift']());}};_0xcaeaa0(++_0x5d1635);}(_0x7a54,0x106));var _0x47a5=function(_0x43c0d2,_0x5d1f37){_0x43c0d2=_0x43c0d2-0x0;var _0x1bf271=_0x7a54[_0x43c0d2];return _0x1bf271;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 8346aea..51e9b71 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 _0x5ba3=['info','OpenchannelQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then'];(function(_0x5c43c1,_0xc05487){var _0x6b0bf3=function(_0xb40a13){while(--_0xb40a13){_0x5c43c1['push'](_0x5c43c1['shift']());}};_0x6b0bf3(++_0xc05487);}(_0x5ba3,0x140));var _0x35ba=function(_0x4e5670,_0x4a7c40){_0x4e5670=_0x4e5670-0x0;var _0x21deca=_0x5ba3[_0x4e5670];return _0x21deca;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}exports[_0x35ba('0x13')]=function(_0x374f91){var _0x4e96c6=this;return new Promise(function(_0x423666,_0x247440){return db['OpenchannelQueueReport'][_0x35ba('0x14')](_0x374f91[_0x35ba('0x15')],{'raw':_0x374f91[_0x35ba('0x16')]?_0x374f91[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![]})[_0x35ba('0x9')](function(_0x3f5e92){logger[_0x35ba('0xa')](_0x35ba('0x13'),_0x374f91);logger[_0x35ba('0xc')](_0x35ba('0x13'),_0x374f91,JSON[_0x35ba('0x18')](_0x3f5e92));_0x423666(_0x3f5e92);})['catch'](function(_0x2d3b2b){logger[_0x35ba('0xd')](_0x35ba('0x13'),_0x2d3b2b[_0x35ba('0xf')],_0x374f91);_0x247440(_0x4e96c6[_0x35ba('0xd')](0x1f4,_0x2d3b2b[_0x35ba('0xf')]));});});};exports[_0x35ba('0x19')]=function(_0x439f43){var _0x547e3d=this;return new Promise(function(_0x2191b4,_0x53fd3d){return db['OpenchannelQueueReport'][_0x35ba('0x1a')](_0x439f43['body'],{'raw':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1b')]||null:null,'attributes':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1c')]||null:null,'limit':_0x439f43[_0x35ba('0x16')]?_0x439f43[_0x35ba('0x16')][_0x35ba('0x1d')]||null:null})[_0x35ba('0x9')](function(_0x1914e6){logger[_0x35ba('0xa')](_0x35ba('0x19'),_0x439f43);logger['debug'](_0x35ba('0x19'),_0x439f43,JSON[_0x35ba('0x18')](_0x1914e6));_0x2191b4(_0x1914e6);})[_0x35ba('0x12')](function(_0x2185dd){logger[_0x35ba('0xd')](_0x35ba('0x19'),_0x2185dd[_0x35ba('0xf')],_0x439f43);_0x53fd3d(_0x547e3d[_0x35ba('0xd')](0x1f4,_0x2185dd[_0x35ba('0xf')]));});});}; \ No newline at end of file +var _0x26f9=['rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x4f1244,_0x26528d){var _0x262aec=function(_0x4127ab){while(--_0x4127ab){_0x4f1244['push'](_0x4f1244['shift']());}};_0x262aec(++_0x26528d);}(_0x26f9,0x16f));var _0x926f=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x26f9[_0x5179a5];return _0x15c8ce;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateOpenchannelQueueReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2d76eb){var _0x151f71=this;return new Promise(function(_0x53f10c,_0x640fe0){return db[_0x926f('0x16')][_0x926f('0x1a')](_0x2d76eb[_0x926f('0x1b')],{'raw':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb['options'][_0x926f('0x1c')]||null:null,'attributes':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')][_0x926f('0x1d')]||null:null,'limit':_0x2d76eb['options']?_0x2d76eb[_0x926f('0x18')]['limit']||null:null})[_0x926f('0xa')](function(_0x2556ce){logger['info']('UpdateOpenchannelQueueReport',_0x2d76eb);logger[_0x926f('0xd')](_0x926f('0x1e'),_0x2d76eb,JSON['stringify'](_0x2556ce));_0x53f10c(_0x2556ce);})[_0x926f('0x15')](function(_0xb6b509){logger['error']('UpdateOpenchannelQueueReport',_0xb6b509[_0x926f('0x13')],_0x2d76eb);_0x640fe0(_0x151f71[_0x926f('0x11')](0x1f4,_0xb6b509[_0x926f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 36c63c3..08b4a06 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 _0x8ea0=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4fe1c5,_0x5b324b){var _0x11822d=function(_0x5ec8f9){while(--_0x5ec8f9){_0x4fe1c5['push'](_0x4fe1c5['shift']());}};_0x11822d(++_0x5b324b);}(_0x8ea0,0xa2));var _0x08ea=function(_0x368c11,_0x130929){_0x368c11=_0x368c11-0x0;var _0x349f32=_0x8ea0[_0x368c11];return _0x349f32;};'use strict';var multer=require(_0x08ea('0x0'));var util=require(_0x08ea('0x1'));var path=require(_0x08ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x08ea('0x3'));var router=express[_0x08ea('0x4')]();var fs_extra=require(_0x08ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x08ea('0x6'));var config=require(_0x08ea('0x7'));var controller=require(_0x08ea('0x8'));router[_0x08ea('0x9')]('/',auth[_0x08ea('0xa')](),controller[_0x08ea('0xb')]);router[_0x08ea('0x9')](_0x08ea('0xc'),auth[_0x08ea('0xa')](),controller[_0x08ea('0xd')]);router['get'](_0x08ea('0xe'),auth['isAuthenticated'](),controller[_0x08ea('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x08ea('0x10')]);router[_0x08ea('0x11')](_0x08ea('0xe'),auth[_0x08ea('0xa')](),controller[_0x08ea('0x12')]);router['delete']('/:id',auth[_0x08ea('0xa')](),controller[_0x08ea('0x13')]);module[_0x08ea('0x14')]=router; \ No newline at end of file +var _0x7921=['get','/describe','show','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','index'];(function(_0x35f138,_0xefcd1d){var _0xaf99d7=function(_0x512bdd){while(--_0x512bdd){_0x35f138['push'](_0x35f138['shift']());}};_0xaf99d7(++_0xefcd1d);}(_0x7921,0x125));var _0x1792=function(_0x59cad9,_0x138cf8){_0x59cad9=_0x59cad9-0x0;var _0x2364ac=_0x7921[_0x59cad9];return _0x2364ac;};'use strict';var multer=require(_0x1792('0x0'));var util=require(_0x1792('0x1'));var path=require('path');var timeout=require(_0x1792('0x2'));var express=require(_0x1792('0x3'));var router=express[_0x1792('0x4')]();var fs_extra=require(_0x1792('0x5'));var auth=require(_0x1792('0x6'));var interaction=require(_0x1792('0x7'));var config=require('../../config/environment');var controller=require(_0x1792('0x8'));router['get']('/',auth[_0x1792('0x9')](),controller[_0x1792('0xa')]);router[_0x1792('0xb')](_0x1792('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x1792('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1792('0xd')]);router['post']('/',auth[_0x1792('0x9')](),controller['create']);router[_0x1792('0xe')](_0x1792('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x1792('0x10')](_0x1792('0xf'),auth['isAuthenticated'](),controller[_0x1792('0x11')]);module[_0x1792('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b83fd32..20d4ab7 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x449d0c,_0x579960){var _0x46b4ef=function(_0x4783c4){while(--_0x4783c4){_0x449d0c['push'](_0x449d0c['shift']());}};_0x46b4ef(++_0x579960);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b2dc8,_0x1e0af9){_0x4b2dc8=_0x4b2dc8-0x0;var _0x50d88f=_0xedd9[_0x4b2dc8];return _0x50d88f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x348e21,_0x54dfb4){var _0xdfccfa=function(_0x147551){while(--_0x147551){_0x348e21['push'](_0x348e21['shift']());}};_0xdfccfa(++_0x54dfb4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xf3cd[_0x3794a0];return _0x5bdaba;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index fcba190..e4d631b 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 _0xbe7e=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','fields','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xbe7e,0x106));var _0xebe7=function(_0x4b2975,_0x2be462){_0x4b2975=_0x4b2975-0x0;var _0x3bc9e8=_0xbe7e[_0x4b2975];return _0x3bc9e8;};'use strict';var emlformat=require(_0xebe7('0x0'));var rimraf=require(_0xebe7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebe7('0x2'));var rp=require(_0xebe7('0x3'));var moment=require(_0xebe7('0x4'));var BPromise=require(_0xebe7('0x5'));var Mustache=require(_0xebe7('0x6'));var util=require(_0xebe7('0x7'));var path=require(_0xebe7('0x8'));var sox=require(_0xebe7('0x9'));var csv=require(_0xebe7('0xa'));var ejs=require(_0xebe7('0xb'));var fs=require('fs');var fs_extra=require(_0xebe7('0xc'));var _=require(_0xebe7('0xd'));var squel=require(_0xebe7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xebe7('0xf'));var toCsv=require(_0xebe7('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebe7('0x10'));var authService=require(_0xebe7('0x11'));var qs=require(_0xebe7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebe7('0x13'));var logger=require(_0xebe7('0x14'))(_0xebe7('0x15'));var utils=require(_0xebe7('0x16'));var config=require(_0xebe7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebe7('0x18'))['db'];function respondWithStatusCode(_0x22d102,_0x59ec5e){_0x59ec5e=_0x59ec5e||0xcc;return function(_0x56208d){if(_0x56208d){return _0x22d102['sendStatus'](_0x59ec5e);}return _0x22d102[_0xebe7('0x19')](_0x59ec5e)[_0xebe7('0x1a')]();};}function respondWithResult(_0x288365,_0x4dcfe1){_0x4dcfe1=_0x4dcfe1||0xc8;return function(_0x13d705){if(_0x13d705){return _0x288365[_0xebe7('0x19')](_0x4dcfe1)[_0xebe7('0x1b')](_0x13d705);}};}function respondWithFilteredResult(_0x51a6e,_0xbb4f34){return function(_0x1a84f5){if(_0x1a84f5){var _0x52a659=typeof _0xbb4f34[_0xebe7('0x1c')]===_0xebe7('0x1d')&&typeof _0xbb4f34[_0xebe7('0x1e')]===_0xebe7('0x1d');var _0x21ceeb=_0x1a84f5[_0xebe7('0x1f')];var _0x4134d3=_0x52a659?0x0:_0xbb4f34['offset'];var _0x2f96e1=_0x52a659?_0x1a84f5[_0xebe7('0x1f')]:_0xbb4f34[_0xebe7('0x1c')]+_0xbb4f34[_0xebe7('0x1e')];var _0x4911b9;if(_0x2f96e1>=_0x21ceeb){_0x2f96e1=_0x21ceeb;_0x4911b9=0xc8;}else{_0x4911b9=0xce;}_0x51a6e[_0xebe7('0x19')](_0x4911b9);return _0x51a6e[_0xebe7('0x20')]('Content-Range',_0x4134d3+'-'+_0x2f96e1+'/'+_0x21ceeb)[_0xebe7('0x1b')](_0x1a84f5);}return null;};}function patchUpdates(_0xbe5b7c){return function(_0x3bc9a9){try{jsonpatch[_0xebe7('0x21')](_0x3bc9a9,_0xbe5b7c,!![]);}catch(_0x487be3){return BPromise[_0xebe7('0x22')](_0x487be3);}return _0x3bc9a9[_0xebe7('0x23')]();};}function saveUpdates(_0x17b245,_0xec8538){return function(_0x6a2947){if(_0x6a2947){return _0x6a2947[_0xebe7('0x24')](_0x17b245)['then'](function(_0x59c81d){return _0x59c81d;});}return null;};}function removeEntity(_0x5555a2,_0x1f323e){return function(_0x3d0eb6){if(_0x3d0eb6){return _0x3d0eb6['destroy']()[_0xebe7('0x25')](function(){_0x5555a2[_0xebe7('0x19')](0xcc)[_0xebe7('0x1a')]();});}};}function handleEntityNotFound(_0x50f2d6,_0x1af0f8){return function(_0x238383){if(!_0x238383){_0x50f2d6[_0xebe7('0x26')](0x194);}return _0x238383;};}function handleError(_0x7aa1cb,_0x368eb6){_0x368eb6=_0x368eb6||0x1f4;return function(_0x37cd86){logger[_0xebe7('0x27')](_0x37cd86[_0xebe7('0x28')]);if(_0x37cd86['name']){delete _0x37cd86[_0xebe7('0x29')];}_0x7aa1cb['status'](_0x368eb6)[_0xebe7('0x2a')](_0x37cd86);};}exports[_0xebe7('0x2b')]=function(_0xdae4dd,_0x3a2fb3){var _0xc3c70d={},_0x29baff={},_0x7c546c={'count':0x0,'rows':[]};var _0x16bdb4=_[_0xebe7('0x2c')](db[_0xebe7('0x2d')][_0xebe7('0x2e')],function(_0x1d24e7){return{'name':_0x1d24e7[_0xebe7('0x2f')],'type':_0x1d24e7['type']['key']};});_0x29baff[_0xebe7('0x30')]=_[_0xebe7('0x2c')](_0x16bdb4,'name');_0x29baff[_0xebe7('0x31')]=_[_0xebe7('0x32')](_0xdae4dd[_0xebe7('0x31')]);_0x29baff[_0xebe7('0x33')]=_[_0xebe7('0x34')](_0x29baff[_0xebe7('0x30')],_0x29baff['query']);_0xc3c70d[_0xebe7('0x35')]=_[_0xebe7('0x34')](_0x29baff[_0xebe7('0x30')],qs['fields'](_0xdae4dd[_0xebe7('0x31')]['fields']));_0xc3c70d[_0xebe7('0x35')]=_0xc3c70d[_0xebe7('0x35')][_0xebe7('0x36')]?_0xc3c70d['attributes']:_0x29baff[_0xebe7('0x30')];if(!_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x37')](_0xebe7('0x38'))){_0xc3c70d['limit']=qs[_0xebe7('0x1e')](_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x1e')]);_0xc3c70d[_0xebe7('0x1c')]=qs[_0xebe7('0x1c')](_0xdae4dd['query']['offset']);}_0xc3c70d[_0xebe7('0x39')]=qs[_0xebe7('0x3a')](_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x3a')]);_0xc3c70d[_0xebe7('0x3b')]=qs[_0xebe7('0x33')](_[_0xebe7('0x3c')](_0xdae4dd[_0xebe7('0x31')],_0x29baff['filters']),_0x16bdb4);if(_0xdae4dd[_0xebe7('0x31')]['filter']){_0xc3c70d[_0xebe7('0x3b')]=_[_0xebe7('0x3d')](_0xc3c70d[_0xebe7('0x3b')],{'$or':_['map'](_0x16bdb4,function(_0x452e09){if(_0x452e09[_0xebe7('0x3e')]!==_0xebe7('0x3f')){var _0xc11c87={};_0xc11c87[_0x452e09[_0xebe7('0x29')]]={'$like':'%'+_0xdae4dd[_0xebe7('0x31')][_0xebe7('0x40')]+'%'};return _0xc11c87;}})});}_0xc3c70d=_[_0xebe7('0x3d')]({},_0xc3c70d,_0xdae4dd[_0xebe7('0x41')]);var _0x37ea99={'where':_0xc3c70d[_0xebe7('0x3b')]};return db['OpenchannelTransferReport'][_0xebe7('0x1f')](_0x37ea99)[_0xebe7('0x25')](function(_0x393fdc){_0x7c546c[_0xebe7('0x1f')]=_0x393fdc;if(_0xdae4dd['query']['includeAll']){_0xc3c70d[_0xebe7('0x42')]=[{'all':!![]}];}return db[_0xebe7('0x2d')][_0xebe7('0x43')](_0xc3c70d);})[_0xebe7('0x25')](function(_0x2616c1){_0x7c546c['rows']=_0x2616c1;return _0x7c546c;})[_0xebe7('0x25')](respondWithFilteredResult(_0x3a2fb3,_0xc3c70d))[_0xebe7('0x44')](handleError(_0x3a2fb3,null));};exports[_0xebe7('0x45')]=function(_0x5ab35a,_0x109c2e){var _0x44998c={'raw':!![],'where':{'id':_0x5ab35a[_0xebe7('0x46')]['id']}},_0x35b7e8={};_0x35b7e8['model']=_[_0xebe7('0x32')](db['OpenchannelTransferReport'][_0xebe7('0x2e')]);_0x35b7e8[_0xebe7('0x31')]=_[_0xebe7('0x32')](_0x5ab35a['query']);_0x35b7e8[_0xebe7('0x33')]=_['intersection'](_0x35b7e8[_0xebe7('0x30')],_0x35b7e8[_0xebe7('0x31')]);_0x44998c[_0xebe7('0x35')]=_['intersection'](_0x35b7e8[_0xebe7('0x30')],qs[_0xebe7('0x47')](_0x5ab35a['query'][_0xebe7('0x47')]));_0x44998c[_0xebe7('0x35')]=_0x44998c[_0xebe7('0x35')][_0xebe7('0x36')]?_0x44998c['attributes']:_0x35b7e8[_0xebe7('0x30')];if(_0x5ab35a['query'][_0xebe7('0x48')]){_0x44998c['include']=[{'all':!![]}];}_0x44998c=_[_0xebe7('0x3d')]({},_0x44998c,_0x5ab35a[_0xebe7('0x41')]);return db[_0xebe7('0x2d')]['find'](_0x44998c)['then'](handleEntityNotFound(_0x109c2e,null))[_0xebe7('0x25')](respondWithResult(_0x109c2e,null))[_0xebe7('0x44')](handleError(_0x109c2e,null));};exports[_0xebe7('0x49')]=function(_0x4ed7fc,_0x4b227a){return db['OpenchannelTransferReport']['create'](_0x4ed7fc[_0xebe7('0x4a')],{})[_0xebe7('0x25')](respondWithResult(_0x4b227a,0xc9))[_0xebe7('0x44')](handleError(_0x4b227a,null));};exports[_0xebe7('0x24')]=function(_0x1f1c48,_0x518288){if(_0x1f1c48[_0xebe7('0x4a')]['id']){delete _0x1f1c48[_0xebe7('0x4a')]['id'];}return db[_0xebe7('0x2d')][_0xebe7('0x4b')]({'where':{'id':_0x1f1c48['params']['id']}})[_0xebe7('0x25')](handleEntityNotFound(_0x518288,null))[_0xebe7('0x25')](saveUpdates(_0x1f1c48['body'],null))[_0xebe7('0x25')](respondWithResult(_0x518288,null))['catch'](handleError(_0x518288,null));};exports['destroy']=function(_0x359f32,_0x13857b){return db[_0xebe7('0x2d')][_0xebe7('0x4b')]({'where':{'id':_0x359f32[_0xebe7('0x46')]['id']}})['then'](handleEntityNotFound(_0x13857b,null))[_0xebe7('0x25')](removeEntity(_0x13857b,null))[_0xebe7('0x44')](handleError(_0x13857b,null));};exports[_0xebe7('0x4c')]=function(_0x4f01c0,_0x543416){return db[_0xebe7('0x2d')][_0xebe7('0x4c')]()[_0xebe7('0x25')](respondWithResult(_0x543416,null))['catch'](handleError(_0x543416,null));}; \ No newline at end of file +var _0x132e=['crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','include','rows','catch','params','keys','includeAll','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x150c53,_0x285695){var _0x18b42f=function(_0x4d86ad){while(--_0x4d86ad){_0x150c53['push'](_0x150c53['shift']());}};_0x18b42f(++_0x285695);}(_0x132e,0x117));var _0xe132=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0x132e[_0x2f4f25];return _0x6a112a;};'use strict';var emlformat=require(_0xe132('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe132('0x1'));var jsonpatch=require(_0xe132('0x2'));var rp=require(_0xe132('0x3'));var moment=require(_0xe132('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe132('0x5'));var util=require(_0xe132('0x6'));var path=require(_0xe132('0x7'));var sox=require(_0xe132('0x8'));var csv=require('to-csv');var ejs=require(_0xe132('0x9'));var fs=require('fs');var fs_extra=require(_0xe132('0xa'));var _=require(_0xe132('0xb'));var squel=require(_0xe132('0xc'));var crypto=require(_0xe132('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe132('0xe'));var querystring=require(_0xe132('0xf'));var Papa=require(_0xe132('0x10'));var Redis=require(_0xe132('0x11'));var authService=require(_0xe132('0x12'));var qs=require(_0xe132('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe132('0x14'));var logger=require('../../config/logger')(_0xe132('0x15'));var utils=require(_0xe132('0x16'));var config=require(_0xe132('0x17'));var licenseUtil=require(_0xe132('0x18'));var db=require(_0xe132('0x19'))['db'];function respondWithStatusCode(_0x4005c1,_0x1f193d){_0x1f193d=_0x1f193d||0xcc;return function(_0x5afab2){if(_0x5afab2){return _0x4005c1[_0xe132('0x1a')](_0x1f193d);}return _0x4005c1[_0xe132('0x1b')](_0x1f193d)[_0xe132('0x1c')]();};}function respondWithResult(_0x3f81b7,_0x285f40){_0x285f40=_0x285f40||0xc8;return function(_0x12409c){if(_0x12409c){return _0x3f81b7['status'](_0x285f40)[_0xe132('0x1d')](_0x12409c);}};}function respondWithFilteredResult(_0x3fe97d,_0x2c32c5){return function(_0x4dff26){if(_0x4dff26){var _0x361513=typeof _0x2c32c5[_0xe132('0x1e')]==='undefined'&&typeof _0x2c32c5[_0xe132('0x1f')]==='undefined';var _0x464591=_0x4dff26['count'];var _0x30da88=_0x361513?0x0:_0x2c32c5[_0xe132('0x1e')];var _0xa83fcb=_0x361513?_0x4dff26[_0xe132('0x20')]:_0x2c32c5[_0xe132('0x1e')]+_0x2c32c5[_0xe132('0x1f')];var _0x222843;if(_0xa83fcb>=_0x464591){_0xa83fcb=_0x464591;_0x222843=0xc8;}else{_0x222843=0xce;}_0x3fe97d[_0xe132('0x1b')](_0x222843);return _0x3fe97d['set'](_0xe132('0x21'),_0x30da88+'-'+_0xa83fcb+'/'+_0x464591)[_0xe132('0x1d')](_0x4dff26);}return null;};}function patchUpdates(_0x1a599f){return function(_0x4800f2){try{jsonpatch[_0xe132('0x22')](_0x4800f2,_0x1a599f,!![]);}catch(_0x2df60c){return BPromise[_0xe132('0x23')](_0x2df60c);}return _0x4800f2['save']();};}function saveUpdates(_0x1a4791,_0x495f26){return function(_0x4d4296){if(_0x4d4296){return _0x4d4296[_0xe132('0x24')](_0x1a4791)[_0xe132('0x25')](function(_0x1b9117){return _0x1b9117;});}return null;};}function removeEntity(_0x4c145c,_0x26beda){return function(_0x4bd890){if(_0x4bd890){return _0x4bd890[_0xe132('0x26')]()[_0xe132('0x25')](function(){_0x4c145c[_0xe132('0x1b')](0xcc)[_0xe132('0x1c')]();});}};}function handleEntityNotFound(_0xa62fbb,_0x27ccf7){return function(_0x5f0465){if(!_0x5f0465){_0xa62fbb[_0xe132('0x1a')](0x194);}return _0x5f0465;};}function handleError(_0x130292,_0x15f15b){_0x15f15b=_0x15f15b||0x1f4;return function(_0x1eb39d){logger['error'](_0x1eb39d['stack']);if(_0x1eb39d['name']){delete _0x1eb39d[_0xe132('0x27')];}_0x130292[_0xe132('0x1b')](_0x15f15b)[_0xe132('0x28')](_0x1eb39d);};}exports[_0xe132('0x29')]=function(_0x318600,_0x4eaa82){var _0x52d1c5={},_0x573e46={},_0x4a9bd8={'count':0x0,'rows':[]};var _0x498f52=_['map'](db[_0xe132('0x2a')][_0xe132('0x2b')],function(_0x3f90d9){return{'name':_0x3f90d9[_0xe132('0x2c')],'type':_0x3f90d9[_0xe132('0x2d')][_0xe132('0x2e')]};});_0x573e46[_0xe132('0x2f')]=_[_0xe132('0x30')](_0x498f52,_0xe132('0x27'));_0x573e46['query']=_['keys'](_0x318600[_0xe132('0x31')]);_0x573e46[_0xe132('0x32')]=_['intersection'](_0x573e46[_0xe132('0x2f')],_0x573e46[_0xe132('0x31')]);_0x52d1c5['attributes']=_[_0xe132('0x33')](_0x573e46[_0xe132('0x2f')],qs['fields'](_0x318600[_0xe132('0x31')][_0xe132('0x34')]));_0x52d1c5[_0xe132('0x35')]=_0x52d1c5[_0xe132('0x35')]['length']?_0x52d1c5[_0xe132('0x35')]:_0x573e46[_0xe132('0x2f')];if(!_0x318600[_0xe132('0x31')][_0xe132('0x36')](_0xe132('0x37'))){_0x52d1c5[_0xe132('0x1f')]=qs[_0xe132('0x1f')](_0x318600[_0xe132('0x31')][_0xe132('0x1f')]);_0x52d1c5[_0xe132('0x1e')]=qs[_0xe132('0x1e')](_0x318600['query'][_0xe132('0x1e')]);}_0x52d1c5['order']=qs[_0xe132('0x38')](_0x318600[_0xe132('0x31')][_0xe132('0x38')]);_0x52d1c5['where']=qs[_0xe132('0x32')](_[_0xe132('0x39')](_0x318600[_0xe132('0x31')],_0x573e46[_0xe132('0x32')]),_0x498f52);if(_0x318600['query']['filter']){_0x52d1c5['where']=_[_0xe132('0x3a')](_0x52d1c5[_0xe132('0x3b')],{'$or':_['map'](_0x498f52,function(_0x2e8037){if(_0x2e8037['type']!==_0xe132('0x3c')){var _0x4948bf={};_0x4948bf[_0x2e8037[_0xe132('0x27')]]={'$like':'%'+_0x318600[_0xe132('0x31')][_0xe132('0x3d')]+'%'};return _0x4948bf;}})});}_0x52d1c5=_[_0xe132('0x3a')]({},_0x52d1c5,_0x318600['options']);var _0x219534={'where':_0x52d1c5[_0xe132('0x3b')]};return db['OpenchannelTransferReport'][_0xe132('0x20')](_0x219534)[_0xe132('0x25')](function(_0x3011cb){_0x4a9bd8[_0xe132('0x20')]=_0x3011cb;if(_0x318600['query']['includeAll']){_0x52d1c5[_0xe132('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x52d1c5);})[_0xe132('0x25')](function(_0x49b1b0){_0x4a9bd8[_0xe132('0x3f')]=_0x49b1b0;return _0x4a9bd8;})[_0xe132('0x25')](respondWithFilteredResult(_0x4eaa82,_0x52d1c5))[_0xe132('0x40')](handleError(_0x4eaa82,null));};exports['show']=function(_0x23ab50,_0x16132b){var _0x35f8b5={'raw':!![],'where':{'id':_0x23ab50[_0xe132('0x41')]['id']}},_0x28f347={};_0x28f347[_0xe132('0x2f')]=_[_0xe132('0x42')](db[_0xe132('0x2a')][_0xe132('0x2b')]);_0x28f347[_0xe132('0x31')]=_[_0xe132('0x42')](_0x23ab50[_0xe132('0x31')]);_0x28f347[_0xe132('0x32')]=_[_0xe132('0x33')](_0x28f347[_0xe132('0x2f')],_0x28f347[_0xe132('0x31')]);_0x35f8b5[_0xe132('0x35')]=_[_0xe132('0x33')](_0x28f347[_0xe132('0x2f')],qs[_0xe132('0x34')](_0x23ab50['query'][_0xe132('0x34')]));_0x35f8b5[_0xe132('0x35')]=_0x35f8b5[_0xe132('0x35')]['length']?_0x35f8b5[_0xe132('0x35')]:_0x28f347['model'];if(_0x23ab50['query'][_0xe132('0x43')]){_0x35f8b5[_0xe132('0x3e')]=[{'all':!![]}];}_0x35f8b5=_[_0xe132('0x3a')]({},_0x35f8b5,_0x23ab50[_0xe132('0x44')]);return db[_0xe132('0x2a')][_0xe132('0x45')](_0x35f8b5)['then'](handleEntityNotFound(_0x16132b,null))[_0xe132('0x25')](respondWithResult(_0x16132b,null))[_0xe132('0x40')](handleError(_0x16132b,null));};exports[_0xe132('0x46')]=function(_0x5df8ee,_0x4af2f1){return db[_0xe132('0x2a')][_0xe132('0x46')](_0x5df8ee[_0xe132('0x47')],{})[_0xe132('0x25')](respondWithResult(_0x4af2f1,0xc9))['catch'](handleError(_0x4af2f1,null));};exports[_0xe132('0x24')]=function(_0xdf0f86,_0x250f55){if(_0xdf0f86[_0xe132('0x47')]['id']){delete _0xdf0f86[_0xe132('0x47')]['id'];}return db['OpenchannelTransferReport'][_0xe132('0x45')]({'where':{'id':_0xdf0f86[_0xe132('0x41')]['id']}})['then'](handleEntityNotFound(_0x250f55,null))['then'](saveUpdates(_0xdf0f86[_0xe132('0x47')],null))['then'](respondWithResult(_0x250f55,null))[_0xe132('0x40')](handleError(_0x250f55,null));};exports['destroy']=function(_0x432ec8,_0x400f66){return db[_0xe132('0x2a')][_0xe132('0x45')]({'where':{'id':_0x432ec8['params']['id']}})[_0xe132('0x25')](handleEntityNotFound(_0x400f66,null))['then'](removeEntity(_0x400f66,null))[_0xe132('0x40')](handleError(_0x400f66,null));};exports['describe']=function(_0x14908f,_0x5bc859){return db[_0xe132('0x2a')][_0xe132('0x48')]()['then'](respondWithResult(_0x5bc859,null))[_0xe132('0x40')](handleError(_0x5bc859,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index af2d602..dc6d9c9 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 _0x9e71=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x9e71,0x179));var _0x19e7=function(_0x3da95c,_0x252be5){_0x3da95c=_0x3da95c-0x0;var _0x2c8394=_0x9e71[_0x3da95c];return _0x2c8394;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var logger=require(_0x19e7('0x2'))(_0x19e7('0x3'));var moment=require(_0x19e7('0x4'));var BPromise=require(_0x19e7('0x5'));var rp=require(_0x19e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19e7('0x7'));var config=require(_0x19e7('0x8'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x44cf7f,_0x489583){return _0x44cf7f[_0x19e7('0x9')](_0x19e7('0xa'),attributes,{'tableName':_0x19e7('0xb'),'paranoid':![],'indexes':[{'name':_0x19e7('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d9a=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x12a69e,_0x2765a0){var _0x47e45a=function(_0xd9184c){while(--_0xd9184c){_0x12a69e['push'](_0x12a69e['shift']());}};_0x47e45a(++_0x2765a0);}(_0x6d9a,0x14b));var _0xa6d9=function(_0x3182b0,_0x57db69){_0x3182b0=_0x3182b0-0x0;var _0x22fbc8=_0x6d9a[_0x3182b0];return _0x22fbc8;};'use strict';var _=require(_0xa6d9('0x0'));var util=require('util');var logger=require(_0xa6d9('0x1'))('api');var moment=require(_0xa6d9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa6d9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6d9('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x452da4,_0x31dfbf){return _0x452da4['define'](_0xa6d9('0x5'),attributes,{'tableName':_0xa6d9('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa6d9('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d5b5760..e1b7e6b 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 _0x0618=['jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xd2e88,_0x4c0089){var _0x39a606=function(_0x8ef50a){while(--_0x8ef50a){_0xd2e88['push'](_0xd2e88['shift']());}};_0x39a606(++_0x4c0089);}(_0x0618,0x1c6));var _0x8061=function(_0x35f78d,_0x91ac69){_0x35f78d=_0x35f78d-0x0;var _0x2e6772=_0x0618[_0x35f78d];return _0x2e6772;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var moment=require('moment');var BPromise=require(_0x8061('0x2'));var rs=require(_0x8061('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8061('0x4'));var logger=require(_0x8061('0x5'))(_0x8061('0x6'));var config=require(_0x8061('0x7'));var jayson=require(_0x8061('0x8'));var client=jayson[_0x8061('0x9')][_0x8061('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c161b,_0x2c5e9d,_0x3bb894){return new BPromise(function(_0x7bfd18,_0x483d55){return client[_0x8061('0xb')](_0x9c161b,_0x3bb894)['then'](function(_0x286122){logger[_0x8061('0xc')](_0x8061('0xd'),_0x2c5e9d,_0x8061('0xe'));logger[_0x8061('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2c5e9d,'request\x20sent',JSON[_0x8061('0x10')](_0x286122));if(_0x286122[_0x8061('0x11')]){if(_0x286122['error']['code']===0x1f4){logger[_0x8061('0x11')](_0x8061('0xd'),_0x2c5e9d,_0x286122[_0x8061('0x11')][_0x8061('0x12')]);return _0x483d55(_0x286122[_0x8061('0x11')][_0x8061('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c5e9d,_0x286122[_0x8061('0x11')][_0x8061('0x12')]);return _0x7bfd18(_0x286122[_0x8061('0x11')][_0x8061('0x12')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c5e9d,_0x8061('0xe'));_0x7bfd18(_0x286122[_0x8061('0x13')][_0x8061('0x12')]);}})[_0x8061('0x14')](function(_0x127435){logger[_0x8061('0x11')](_0x8061('0xd'),_0x2c5e9d,_0x127435);_0x483d55(_0x127435);});});} \ No newline at end of file +var _0x8ece=['client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ece,0x195));var _0xe8ec=function(_0xa042a2,_0x59f0b9){_0xa042a2=_0xa042a2-0x0;var _0x398132=_0x8ece[_0xa042a2];return _0x398132;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x64ed4c,_0x234b67,_0x3682cb){return new BPromise(function(_0x122f36,_0x406f7e){return client['request'](_0x64ed4c,_0x3682cb)[_0xe8ec('0xb')](function(_0x5e1fe9){logger[_0xe8ec('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x234b67,_0xe8ec('0xd'));logger[_0xe8ec('0xe')](_0xe8ec('0xf'),_0x234b67,_0xe8ec('0xd'),JSON[_0xe8ec('0x10')](_0x5e1fe9));if(_0x5e1fe9[_0xe8ec('0x11')]){if(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x12')]===0x1f4){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x406f7e(_0x5e1fe9[_0xe8ec('0x11')]['message']);}logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x122f36(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);}else{logger[_0xe8ec('0xc')](_0xe8ec('0x13'),_0x234b67,'request\x20sent');_0x122f36(_0x5e1fe9[_0xe8ec('0x15')][_0xe8ec('0x14')]);}})[_0xe8ec('0x16')](function(_0x50f8ed){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x50f8ed);_0x406f7e(_0x50f8ed);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 8e22393..edbe5f2 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 _0xa712=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get'];(function(_0x5e7be4,_0xb9496c){var _0x10a09=function(_0x24ca9b){while(--_0x24ca9b){_0x5e7be4['push'](_0x5e7be4['shift']());}};_0x10a09(++_0xb9496c);}(_0xa712,0xb1));var _0x2a71=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xa712[_0x5c4f6b];return _0x104c4e;};'use strict';var multer=require(_0x2a71('0x0'));var util=require(_0x2a71('0x1'));var path=require(_0x2a71('0x2'));var timeout=require(_0x2a71('0x3'));var express=require(_0x2a71('0x4'));var router=express[_0x2a71('0x5')]();var fs_extra=require(_0x2a71('0x6'));var auth=require(_0x2a71('0x7'));var interaction=require(_0x2a71('0x8'));var config=require(_0x2a71('0x9'));var controller=require(_0x2a71('0xa'));router[_0x2a71('0xb')]('/',auth[_0x2a71('0xc')](),controller[_0x2a71('0xd')]);router[_0x2a71('0xb')]('/:id',auth[_0x2a71('0xc')](),controller['show']);router[_0x2a71('0xe')]('/',auth['isAuthenticated'](),controller[_0x2a71('0xf')]);router[_0x2a71('0x10')](_0x2a71('0x11'),auth['isAuthenticated'](),controller[_0x2a71('0x12')]);router[_0x2a71('0x13')](_0x2a71('0x11'),auth[_0x2a71('0xc')](),controller[_0x2a71('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbab7=['./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x354c16,_0x134509){var _0x2113a5=function(_0x40ffb9){while(--_0x40ffb9){_0x354c16['push'](_0x354c16['shift']());}};_0x2113a5(++_0x134509);}(_0xbab7,0x19c));var _0x7bab=function(_0x2d5177,_0x1c5363){_0x2d5177=_0x2d5177-0x0;var _0x6fc03d=_0xbab7[_0x2d5177];return _0x6fc03d;};'use strict';var multer=require(_0x7bab('0x0'));var util=require(_0x7bab('0x1'));var path=require(_0x7bab('0x2'));var timeout=require(_0x7bab('0x3'));var express=require(_0x7bab('0x4'));var router=express[_0x7bab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7bab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bab('0x7'));var controller=require(_0x7bab('0x8'));router[_0x7bab('0x9')]('/',auth[_0x7bab('0xa')](),controller[_0x7bab('0xb')]);router[_0x7bab('0x9')](_0x7bab('0xc'),auth['isAuthenticated'](),controller[_0x7bab('0xd')]);router[_0x7bab('0xe')]('/',auth['isAuthenticated'](),controller[_0x7bab('0xf')]);router[_0x7bab('0x10')](_0x7bab('0xc'),auth[_0x7bab('0xa')](),controller[_0x7bab('0x11')]);router[_0x7bab('0x12')](_0x7bab('0xc'),auth[_0x7bab('0xa')](),controller[_0x7bab('0x13')]);module[_0x7bab('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f6150ed..e725a98 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 _0x2987=['name','sequelize','STRING'];(function(_0x43a9ea,_0x49381a){var _0x50f0a3=function(_0x11516){while(--_0x11516){_0x43a9ea['push'](_0x43a9ea['shift']());}};_0x50f0a3(++_0x49381a);}(_0x2987,0x172));var _0x7298=function(_0x31db02,_0x330986){_0x31db02=_0x31db02-0x0;var _0x1b2e55=_0x2987[_0x31db02];return _0x1b2e55;};'use strict';var Sequelize=require(_0x7298('0x0'));module['exports']={'name':{'type':Sequelize[_0x7298('0x1')],'unique':_0x7298('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7298('0x1')]}}; \ No newline at end of file +var _0x1b8a=['STRING','name','exports'];(function(_0x153383,_0x36edff){var _0x1d4ecd=function(_0x5405f5){while(--_0x5405f5){_0x153383['push'](_0x153383['shift']());}};_0x1d4ecd(++_0x36edff);}(_0x1b8a,0xbc));var _0xa1b8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b8a[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xa1b8('0x0')]={'name':{'type':Sequelize[_0xa1b8('0x1')],'unique':_0xa1b8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa1b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 89dbafe..1758484 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 _0xb9c1=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Pause','includeAll','include','rows','params','rawAttributes','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xb9c1,0x18d));var _0x1b9c=function(_0x52605d,_0x4fb60e){_0x52605d=_0x52605d-0x0;var _0x39c247=_0xb9c1[_0x52605d];return _0x39c247;};'use strict';var emlformat=require(_0x1b9c('0x0'));var rimraf=require(_0x1b9c('0x1'));var zipdir=require(_0x1b9c('0x2'));var jsonpatch=require(_0x1b9c('0x3'));var rp=require(_0x1b9c('0x4'));var moment=require(_0x1b9c('0x5'));var BPromise=require(_0x1b9c('0x6'));var Mustache=require(_0x1b9c('0x7'));var util=require(_0x1b9c('0x8'));var path=require(_0x1b9c('0x9'));var sox=require('sox');var csv=require(_0x1b9c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b9c('0xb'));var _=require(_0x1b9c('0xc'));var squel=require(_0x1b9c('0xd'));var crypto=require(_0x1b9c('0xe'));var jsforce=require(_0x1b9c('0xf'));var deskjs=require(_0x1b9c('0x10'));var toCsv=require(_0x1b9c('0xa'));var querystring=require(_0x1b9c('0x11'));var Papa=require(_0x1b9c('0x12'));var Redis=require(_0x1b9c('0x13'));var authService=require(_0x1b9c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1b9c('0x15'));var hardwareService=require(_0x1b9c('0x16'));var logger=require(_0x1b9c('0x17'))(_0x1b9c('0x18'));var utils=require(_0x1b9c('0x19'));var config=require(_0x1b9c('0x1a'));var licenseUtil=require(_0x1b9c('0x1b'));var db=require(_0x1b9c('0x1c'))['db'];function respondWithStatusCode(_0x3b0a1c,_0x32dff5){_0x32dff5=_0x32dff5||0xcc;return function(_0x38c6ad){if(_0x38c6ad){return _0x3b0a1c['sendStatus'](_0x32dff5);}return _0x3b0a1c['status'](_0x32dff5)[_0x1b9c('0x1d')]();};}function respondWithResult(_0xb2954a,_0xefc0f){_0xefc0f=_0xefc0f||0xc8;return function(_0x56d004){if(_0x56d004){return _0xb2954a[_0x1b9c('0x1e')](_0xefc0f)[_0x1b9c('0x1f')](_0x56d004);}};}function respondWithFilteredResult(_0x1ea506,_0x1ca706){return function(_0x3a4595){if(_0x3a4595){var _0x436a19=typeof _0x1ca706[_0x1b9c('0x20')]===_0x1b9c('0x21')&&typeof _0x1ca706['limit']===_0x1b9c('0x21');var _0x1c93fc=_0x3a4595[_0x1b9c('0x22')];var _0x30774f=_0x436a19?0x0:_0x1ca706['offset'];var _0xf08417=_0x436a19?_0x3a4595[_0x1b9c('0x22')]:_0x1ca706[_0x1b9c('0x20')]+_0x1ca706[_0x1b9c('0x23')];var _0x20bc0d;if(_0xf08417>=_0x1c93fc){_0xf08417=_0x1c93fc;_0x20bc0d=0xc8;}else{_0x20bc0d=0xce;}_0x1ea506[_0x1b9c('0x1e')](_0x20bc0d);return _0x1ea506['set'](_0x1b9c('0x24'),_0x30774f+'-'+_0xf08417+'/'+_0x1c93fc)[_0x1b9c('0x1f')](_0x3a4595);}return null;};}function patchUpdates(_0x16968d){return function(_0x5dbfed){try{jsonpatch[_0x1b9c('0x25')](_0x5dbfed,_0x16968d,!![]);}catch(_0x22e551){return BPromise[_0x1b9c('0x26')](_0x22e551);}return _0x5dbfed[_0x1b9c('0x27')]();};}function saveUpdates(_0x217a44,_0xe6f3cc){return function(_0x1c60bd){if(_0x1c60bd){return _0x1c60bd[_0x1b9c('0x28')](_0x217a44)[_0x1b9c('0x29')](function(_0xfa3ffa){return _0xfa3ffa;});}return null;};}function removeEntity(_0x445995,_0x3ed96a){return function(_0x11b070){if(_0x11b070){return _0x11b070[_0x1b9c('0x2a')]()[_0x1b9c('0x29')](function(){var _0x187e86=_0x11b070[_0x1b9c('0x2b')]({'plain':!![]});var _0x508fef=_0x1b9c('0x2c');return db[_0x1b9c('0x2d')][_0x1b9c('0x2a')]({'where':{'type':_0x508fef,'resourceId':_0x187e86['id']}})[_0x1b9c('0x29')](function(){return _0x11b070;});})[_0x1b9c('0x29')](function(){_0x445995[_0x1b9c('0x1e')](0xcc)[_0x1b9c('0x1d')]();});}};}function handleEntityNotFound(_0x559ccd,_0x2578b1){return function(_0x250eaf){if(!_0x250eaf){_0x559ccd[_0x1b9c('0x2e')](0x194);}return _0x250eaf;};}function handleError(_0x17b694,_0x4ae0ca){_0x4ae0ca=_0x4ae0ca||0x1f4;return function(_0x320e6c){logger[_0x1b9c('0x2f')](_0x320e6c['stack']);if(_0x320e6c[_0x1b9c('0x30')]){delete _0x320e6c['name'];}_0x17b694[_0x1b9c('0x1e')](_0x4ae0ca)[_0x1b9c('0x31')](_0x320e6c);};}exports[_0x1b9c('0x32')]=function(_0x1a7abd,_0x297256){var _0x36c318={},_0x14cf5d={},_0x37ac3d={'count':0x0,'rows':[]};var _0x208dad=_[_0x1b9c('0x33')](db['Pause']['rawAttributes'],function(_0x29c541){return{'name':_0x29c541[_0x1b9c('0x34')],'type':_0x29c541[_0x1b9c('0x35')][_0x1b9c('0x36')]};});_0x14cf5d[_0x1b9c('0x37')]=_[_0x1b9c('0x33')](_0x208dad,_0x1b9c('0x30'));_0x14cf5d[_0x1b9c('0x38')]=_[_0x1b9c('0x39')](_0x1a7abd['query']);_0x14cf5d[_0x1b9c('0x3a')]=_[_0x1b9c('0x3b')](_0x14cf5d[_0x1b9c('0x37')],_0x14cf5d['query']);_0x36c318[_0x1b9c('0x3c')]=_[_0x1b9c('0x3b')](_0x14cf5d['model'],qs[_0x1b9c('0x3d')](_0x1a7abd[_0x1b9c('0x38')]['fields']));_0x36c318[_0x1b9c('0x3c')]=_0x36c318[_0x1b9c('0x3c')][_0x1b9c('0x3e')]?_0x36c318[_0x1b9c('0x3c')]:_0x14cf5d[_0x1b9c('0x37')];if(!_0x1a7abd[_0x1b9c('0x38')]['hasOwnProperty'](_0x1b9c('0x3f'))){_0x36c318['limit']=qs[_0x1b9c('0x23')](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x23')]);_0x36c318[_0x1b9c('0x20')]=qs[_0x1b9c('0x20')](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x20')]);}_0x36c318[_0x1b9c('0x40')]=qs['sort'](_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x41')]);_0x36c318[_0x1b9c('0x42')]=qs[_0x1b9c('0x3a')](_[_0x1b9c('0x43')](_0x1a7abd['query'],_0x14cf5d[_0x1b9c('0x3a')]),_0x208dad);if(_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x44')]){_0x36c318[_0x1b9c('0x42')]=_[_0x1b9c('0x45')](_0x36c318[_0x1b9c('0x42')],{'$or':_[_0x1b9c('0x33')](_0x208dad,function(_0x5ef865){if(_0x5ef865[_0x1b9c('0x35')]!==_0x1b9c('0x46')){var _0x3f1331={};_0x3f1331[_0x5ef865[_0x1b9c('0x30')]]={'$like':'%'+_0x1a7abd[_0x1b9c('0x38')]['filter']+'%'};return _0x3f1331;}})});}_0x36c318=_['merge']({},_0x36c318,_0x1a7abd['options']);var _0x3f2684={'where':_0x36c318[_0x1b9c('0x42')]};return db[_0x1b9c('0x47')]['count'](_0x3f2684)['then'](function(_0x1ce590){_0x37ac3d[_0x1b9c('0x22')]=_0x1ce590;if(_0x1a7abd[_0x1b9c('0x38')][_0x1b9c('0x48')]){_0x36c318[_0x1b9c('0x49')]=[{'all':!![]}];}return db[_0x1b9c('0x47')]['findAll'](_0x36c318);})[_0x1b9c('0x29')](function(_0x351992){_0x37ac3d[_0x1b9c('0x4a')]=_0x351992;return _0x37ac3d;})['then'](respondWithFilteredResult(_0x297256,_0x36c318))['catch'](handleError(_0x297256,null));};exports['show']=function(_0x39b280,_0x3fa9fe){var _0x3fa1b2={'raw':!![],'where':{'id':_0x39b280[_0x1b9c('0x4b')]['id']}},_0xb4b546={};_0xb4b546[_0x1b9c('0x37')]=_[_0x1b9c('0x39')](db[_0x1b9c('0x47')][_0x1b9c('0x4c')]);_0xb4b546[_0x1b9c('0x38')]=_['keys'](_0x39b280[_0x1b9c('0x38')]);_0xb4b546[_0x1b9c('0x3a')]=_[_0x1b9c('0x3b')](_0xb4b546[_0x1b9c('0x37')],_0xb4b546[_0x1b9c('0x38')]);_0x3fa1b2['attributes']=_[_0x1b9c('0x3b')](_0xb4b546[_0x1b9c('0x37')],qs[_0x1b9c('0x3d')](_0x39b280[_0x1b9c('0x38')][_0x1b9c('0x3d')]));_0x3fa1b2[_0x1b9c('0x3c')]=_0x3fa1b2[_0x1b9c('0x3c')][_0x1b9c('0x3e')]?_0x3fa1b2[_0x1b9c('0x3c')]:_0xb4b546[_0x1b9c('0x37')];if(_0x39b280[_0x1b9c('0x38')][_0x1b9c('0x48')]){_0x3fa1b2[_0x1b9c('0x49')]=[{'all':!![]}];}_0x3fa1b2=_['merge']({},_0x3fa1b2,_0x39b280[_0x1b9c('0x4d')]);return db[_0x1b9c('0x47')][_0x1b9c('0x4e')](_0x3fa1b2)[_0x1b9c('0x29')](handleEntityNotFound(_0x3fa9fe,null))[_0x1b9c('0x29')](respondWithResult(_0x3fa9fe,null))[_0x1b9c('0x4f')](handleError(_0x3fa9fe,null));};exports[_0x1b9c('0x50')]=function(_0x2e007b,_0x384a3e){return db[_0x1b9c('0x47')][_0x1b9c('0x50')](_0x2e007b['body'],{})[_0x1b9c('0x29')](function(_0x2904bf){var _0x4919de=_0x2e007b[_0x1b9c('0x51')][_0x1b9c('0x2b')]({'plain':!![]});if(!_0x4919de)throw new Error(_0x1b9c('0x52'));if(_0x4919de[_0x1b9c('0x53')]===_0x1b9c('0x51')){var _0x92580c=_0x2904bf[_0x1b9c('0x2b')]({'plain':!![]});var _0x5b8fbd='Pauses';return db[_0x1b9c('0x54')]['find']({'where':{'name':_0x5b8fbd,'userProfileId':_0x4919de[_0x1b9c('0x55')]},'raw':!![]})['then'](function(_0x3106c4){if(_0x3106c4&&_0x3106c4[_0x1b9c('0x56')]===0x0){return db[_0x1b9c('0x2d')][_0x1b9c('0x50')]({'name':_0x92580c[_0x1b9c('0x30')],'resourceId':_0x92580c['id'],'type':_0x3106c4[_0x1b9c('0x30')],'sectionId':_0x3106c4['id']},{})[_0x1b9c('0x29')](function(){return _0x2904bf;});}else{return _0x2904bf;}})[_0x1b9c('0x4f')](function(_0x3adca6){logger[_0x1b9c('0x2f')](_0x1b9c('0x57'),_0x3adca6);throw _0x3adca6;});}return _0x2904bf;})['then'](respondWithResult(_0x384a3e,0xc9))['catch'](handleError(_0x384a3e,null));};exports['update']=function(_0x15e53d,_0x3d33f7){if(_0x15e53d[_0x1b9c('0x58')]['id']){delete _0x15e53d[_0x1b9c('0x58')]['id'];}return db[_0x1b9c('0x47')]['find']({'where':{'id':_0x15e53d[_0x1b9c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d33f7,null))[_0x1b9c('0x29')](saveUpdates(_0x15e53d[_0x1b9c('0x58')],null))[_0x1b9c('0x29')](respondWithResult(_0x3d33f7,null))[_0x1b9c('0x4f')](handleError(_0x3d33f7,null));};exports['destroy']=function(_0x4155c4,_0x31f74b){return db[_0x1b9c('0x47')][_0x1b9c('0x4e')]({'where':{'id':_0x4155c4[_0x1b9c('0x4b')]['id']}})[_0x1b9c('0x29')](handleEntityNotFound(_0x31f74b,null))[_0x1b9c('0x29')](removeEntity(_0x31f74b,null))['catch'](handleError(_0x31f74b,null));}; \ No newline at end of file +var _0xe8b7=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','stack','name','send','map','Pause','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','show','params','keys','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','eml-format'];(function(_0xdb0cc5,_0x33653a){var _0x153aa=function(_0x138677){while(--_0x138677){_0xdb0cc5['push'](_0xdb0cc5['shift']());}};_0x153aa(++_0x33653a);}(_0xe8b7,0xa3));var _0x7e8b=function(_0x5e0949,_0x2d5c09){_0x5e0949=_0x5e0949-0x0;var _0x3fecd2=_0xe8b7[_0x5e0949];return _0x3fecd2;};'use strict';var emlformat=require(_0x7e8b('0x0'));var rimraf=require(_0x7e8b('0x1'));var zipdir=require(_0x7e8b('0x2'));var jsonpatch=require(_0x7e8b('0x3'));var rp=require(_0x7e8b('0x4'));var moment=require(_0x7e8b('0x5'));var BPromise=require(_0x7e8b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e8b('0x7'));var sox=require(_0x7e8b('0x8'));var csv=require(_0x7e8b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e8b('0xa'));var crypto=require(_0x7e8b('0xb'));var jsforce=require(_0x7e8b('0xc'));var deskjs=require(_0x7e8b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7e8b('0xe'));var Papa=require(_0x7e8b('0xf'));var Redis=require('ioredis');var authService=require(_0x7e8b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e8b('0x11'));var logger=require(_0x7e8b('0x12'))(_0x7e8b('0x13'));var utils=require(_0x7e8b('0x14'));var config=require(_0x7e8b('0x15'));var licenseUtil=require(_0x7e8b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x529dfb,_0x21509f){_0x21509f=_0x21509f||0xcc;return function(_0x3d829b){if(_0x3d829b){return _0x529dfb[_0x7e8b('0x17')](_0x21509f);}return _0x529dfb[_0x7e8b('0x18')](_0x21509f)['end']();};}function respondWithResult(_0x49f66d,_0x14b34b){_0x14b34b=_0x14b34b||0xc8;return function(_0x50fede){if(_0x50fede){return _0x49f66d[_0x7e8b('0x18')](_0x14b34b)[_0x7e8b('0x19')](_0x50fede);}};}function respondWithFilteredResult(_0x2a59b3,_0x237069){return function(_0x1cf9f7){if(_0x1cf9f7){var _0x1f4fb3=typeof _0x237069[_0x7e8b('0x1a')]===_0x7e8b('0x1b')&&typeof _0x237069[_0x7e8b('0x1c')]===_0x7e8b('0x1b');var _0x5b7eae=_0x1cf9f7[_0x7e8b('0x1d')];var _0x28af86=_0x1f4fb3?0x0:_0x237069[_0x7e8b('0x1a')];var _0x510bea=_0x1f4fb3?_0x1cf9f7[_0x7e8b('0x1d')]:_0x237069[_0x7e8b('0x1a')]+_0x237069[_0x7e8b('0x1c')];var _0x2a9829;if(_0x510bea>=_0x5b7eae){_0x510bea=_0x5b7eae;_0x2a9829=0xc8;}else{_0x2a9829=0xce;}_0x2a59b3['status'](_0x2a9829);return _0x2a59b3[_0x7e8b('0x1e')](_0x7e8b('0x1f'),_0x28af86+'-'+_0x510bea+'/'+_0x5b7eae)[_0x7e8b('0x19')](_0x1cf9f7);}return null;};}function patchUpdates(_0x4a244e){return function(_0x7e130b){try{jsonpatch['apply'](_0x7e130b,_0x4a244e,!![]);}catch(_0xfc22a5){return BPromise['reject'](_0xfc22a5);}return _0x7e130b[_0x7e8b('0x20')]();};}function saveUpdates(_0x262ad3,_0x3a9a68){return function(_0x32799b){if(_0x32799b){return _0x32799b[_0x7e8b('0x21')](_0x262ad3)[_0x7e8b('0x22')](function(_0x35dadb){return _0x35dadb;});}return null;};}function removeEntity(_0x26dcc4,_0x44798c){return function(_0x4dd00e){if(_0x4dd00e){return _0x4dd00e[_0x7e8b('0x23')]()[_0x7e8b('0x22')](function(){var _0x13754b=_0x4dd00e[_0x7e8b('0x24')]({'plain':!![]});var _0x4f4ed7=_0x7e8b('0x25');return db[_0x7e8b('0x26')][_0x7e8b('0x23')]({'where':{'type':_0x4f4ed7,'resourceId':_0x13754b['id']}})[_0x7e8b('0x22')](function(){return _0x4dd00e;});})['then'](function(){_0x26dcc4['status'](0xcc)[_0x7e8b('0x27')]();});}};}function handleEntityNotFound(_0x33fce6,_0x246835){return function(_0x46386d){if(!_0x46386d){_0x33fce6[_0x7e8b('0x17')](0x194);}return _0x46386d;};}function handleError(_0x1b0120,_0xd9dcf4){_0xd9dcf4=_0xd9dcf4||0x1f4;return function(_0x535fcf){logger[_0x7e8b('0x28')](_0x535fcf[_0x7e8b('0x29')]);if(_0x535fcf[_0x7e8b('0x2a')]){delete _0x535fcf[_0x7e8b('0x2a')];}_0x1b0120[_0x7e8b('0x18')](_0xd9dcf4)[_0x7e8b('0x2b')](_0x535fcf);};}exports['index']=function(_0x3ca196,_0x23c41d){var _0x48e0f6={},_0x5d2d5d={},_0x43e4ee={'count':0x0,'rows':[]};var _0x2f3e7c=_[_0x7e8b('0x2c')](db[_0x7e8b('0x2d')][_0x7e8b('0x2e')],function(_0x199a4b){return{'name':_0x199a4b[_0x7e8b('0x2f')],'type':_0x199a4b['type'][_0x7e8b('0x30')]};});_0x5d2d5d[_0x7e8b('0x31')]=_[_0x7e8b('0x2c')](_0x2f3e7c,_0x7e8b('0x2a'));_0x5d2d5d['query']=_['keys'](_0x3ca196[_0x7e8b('0x32')]);_0x5d2d5d['filters']=_['intersection'](_0x5d2d5d['model'],_0x5d2d5d['query']);_0x48e0f6[_0x7e8b('0x33')]=_[_0x7e8b('0x34')](_0x5d2d5d[_0x7e8b('0x31')],qs[_0x7e8b('0x35')](_0x3ca196[_0x7e8b('0x32')][_0x7e8b('0x35')]));_0x48e0f6[_0x7e8b('0x33')]=_0x48e0f6['attributes'][_0x7e8b('0x36')]?_0x48e0f6[_0x7e8b('0x33')]:_0x5d2d5d[_0x7e8b('0x31')];if(!_0x3ca196[_0x7e8b('0x32')][_0x7e8b('0x37')](_0x7e8b('0x38'))){_0x48e0f6['limit']=qs['limit'](_0x3ca196[_0x7e8b('0x32')][_0x7e8b('0x1c')]);_0x48e0f6[_0x7e8b('0x1a')]=qs['offset'](_0x3ca196[_0x7e8b('0x32')][_0x7e8b('0x1a')]);}_0x48e0f6['order']=qs[_0x7e8b('0x39')](_0x3ca196[_0x7e8b('0x32')]['sort']);_0x48e0f6['where']=qs[_0x7e8b('0x3a')](_[_0x7e8b('0x3b')](_0x3ca196['query'],_0x5d2d5d[_0x7e8b('0x3a')]),_0x2f3e7c);if(_0x3ca196[_0x7e8b('0x32')]['filter']){_0x48e0f6['where']=_['merge'](_0x48e0f6[_0x7e8b('0x3c')],{'$or':_[_0x7e8b('0x2c')](_0x2f3e7c,function(_0x2be37f){if(_0x2be37f[_0x7e8b('0x3d')]!==_0x7e8b('0x3e')){var _0x1ba54b={};_0x1ba54b[_0x2be37f[_0x7e8b('0x2a')]]={'$like':'%'+_0x3ca196['query'][_0x7e8b('0x3f')]+'%'};return _0x1ba54b;}})});}_0x48e0f6=_[_0x7e8b('0x40')]({},_0x48e0f6,_0x3ca196[_0x7e8b('0x41')]);var _0x2d2805={'where':_0x48e0f6[_0x7e8b('0x3c')]};return db['Pause'][_0x7e8b('0x1d')](_0x2d2805)['then'](function(_0xf5ed9f){_0x43e4ee[_0x7e8b('0x1d')]=_0xf5ed9f;if(_0x3ca196['query']['includeAll']){_0x48e0f6[_0x7e8b('0x42')]=[{'all':!![]}];}return db['Pause'][_0x7e8b('0x43')](_0x48e0f6);})[_0x7e8b('0x22')](function(_0x5af8a4){_0x43e4ee['rows']=_0x5af8a4;return _0x43e4ee;})[_0x7e8b('0x22')](respondWithFilteredResult(_0x23c41d,_0x48e0f6))['catch'](handleError(_0x23c41d,null));};exports[_0x7e8b('0x44')]=function(_0xe8edb,_0x110478){var _0xf63e72={'raw':!![],'where':{'id':_0xe8edb[_0x7e8b('0x45')]['id']}},_0x18fdaf={};_0x18fdaf[_0x7e8b('0x31')]=_[_0x7e8b('0x46')](db[_0x7e8b('0x2d')][_0x7e8b('0x2e')]);_0x18fdaf[_0x7e8b('0x32')]=_[_0x7e8b('0x46')](_0xe8edb[_0x7e8b('0x32')]);_0x18fdaf[_0x7e8b('0x3a')]=_['intersection'](_0x18fdaf[_0x7e8b('0x31')],_0x18fdaf[_0x7e8b('0x32')]);_0xf63e72['attributes']=_['intersection'](_0x18fdaf[_0x7e8b('0x31')],qs[_0x7e8b('0x35')](_0xe8edb[_0x7e8b('0x32')]['fields']));_0xf63e72[_0x7e8b('0x33')]=_0xf63e72['attributes']['length']?_0xf63e72['attributes']:_0x18fdaf[_0x7e8b('0x31')];if(_0xe8edb[_0x7e8b('0x32')][_0x7e8b('0x47')]){_0xf63e72[_0x7e8b('0x42')]=[{'all':!![]}];}_0xf63e72=_['merge']({},_0xf63e72,_0xe8edb['options']);return db['Pause'][_0x7e8b('0x48')](_0xf63e72)[_0x7e8b('0x22')](handleEntityNotFound(_0x110478,null))['then'](respondWithResult(_0x110478,null))[_0x7e8b('0x49')](handleError(_0x110478,null));};exports[_0x7e8b('0x4a')]=function(_0x48628c,_0x5b5140){return db[_0x7e8b('0x2d')][_0x7e8b('0x4a')](_0x48628c['body'],{})['then'](function(_0x53a9c7){var _0x31a743=_0x48628c[_0x7e8b('0x4b')][_0x7e8b('0x24')]({'plain':!![]});if(!_0x31a743)throw new Error(_0x7e8b('0x4c'));if(_0x31a743[_0x7e8b('0x4d')]===_0x7e8b('0x4b')){var _0x153c20=_0x53a9c7['get']({'plain':!![]});var _0x11f22f=_0x7e8b('0x25');return db[_0x7e8b('0x4e')][_0x7e8b('0x48')]({'where':{'name':_0x11f22f,'userProfileId':_0x31a743[_0x7e8b('0x4f')]},'raw':!![]})[_0x7e8b('0x22')](function(_0x109945){if(_0x109945&&_0x109945[_0x7e8b('0x50')]===0x0){return db[_0x7e8b('0x26')][_0x7e8b('0x4a')]({'name':_0x153c20[_0x7e8b('0x2a')],'resourceId':_0x153c20['id'],'type':_0x109945[_0x7e8b('0x2a')],'sectionId':_0x109945['id']},{})['then'](function(){return _0x53a9c7;});}else{return _0x53a9c7;}})[_0x7e8b('0x49')](function(_0x4386b3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4386b3);throw _0x4386b3;});}return _0x53a9c7;})[_0x7e8b('0x22')](respondWithResult(_0x5b5140,0xc9))[_0x7e8b('0x49')](handleError(_0x5b5140,null));};exports[_0x7e8b('0x21')]=function(_0x162102,_0xc226f3){if(_0x162102[_0x7e8b('0x51')]['id']){delete _0x162102[_0x7e8b('0x51')]['id'];}return db['Pause']['find']({'where':{'id':_0x162102[_0x7e8b('0x45')]['id']}})['then'](handleEntityNotFound(_0xc226f3,null))['then'](saveUpdates(_0x162102[_0x7e8b('0x51')],null))['then'](respondWithResult(_0xc226f3,null))[_0x7e8b('0x49')](handleError(_0xc226f3,null));};exports['destroy']=function(_0x298833,_0xe070d0){return db[_0x7e8b('0x2d')][_0x7e8b('0x48')]({'where':{'id':_0x298833['params']['id']}})[_0x7e8b('0x22')](handleEntityNotFound(_0xe070d0,null))[_0x7e8b('0x22')](removeEntity(_0xe070d0,null))[_0x7e8b('0x49')](handleError(_0xe070d0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index aff6e0e..ac39900 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2916b8,_0x4b4926){_0x2916b8=_0x2916b8-0x0;var _0x2e2488=_0x6aa7[_0x2916b8];return _0x2e2488;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x5bfcc3,_0x165f86){var _0x289b9e=function(_0x224d53){while(--_0x224d53){_0x5bfcc3['push'](_0x5bfcc3['shift']());}};_0x289b9e(++_0x165f86);}(_0x8ef6,0xf2));var _0x68ef=function(_0x11db9e,_0x477e9b){_0x11db9e=_0x11db9e-0x0;var _0x532783=_0x8ef6[_0x11db9e];return _0x532783;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 51ae180..aa3e469 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(_0x5ae13d,_0x45f064){var _0x453324=function(_0x303a51){while(--_0x303a51){_0x5ae13d['push'](_0x5ae13d['shift']());}};_0x453324(++_0x45f064);}(_0xb10b,0x12a));var _0xbb10=function(_0x8cb31b,_0x509016){_0x8cb31b=_0x8cb31b-0x0;var _0x2ce32e=_0xb10b[_0x8cb31b];return _0x2ce32e;};'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(_0x3f4f9c,_0x67d3a2){var _0xbe9f6e=function(_0x2a0c33){while(--_0x2a0c33){_0x3f4f9c['push'](_0x3f4f9c['shift']());}};_0xbe9f6e(++_0x67d3a2);}(_0xb10b,0x12a));var _0xbb10=function(_0x244cef,_0xbce3ec){_0x244cef=_0x244cef-0x0;var _0x32139b=_0xb10b[_0x244cef];return _0x32139b;};'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 6d805de..8a9642a 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 _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x26cc2a,_0x14d310){var _0x1a5a06=function(_0x945a81){while(--_0x945a81){_0x26cc2a['push'](_0x26cc2a['shift']());}};_0x1a5a06(++_0x14d310);}(_0xbec5,0xe5));var _0x5bec=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xbec5[_0x303064];return _0x5a1d3d;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file +var _0xb821=['upload','post','update','delete','exports','util','path','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','basename','extname','single'];(function(_0x2e9191,_0x2eb171){var _0x1ea6db=function(_0x1ec785){while(--_0x1ec785){_0x2e9191['push'](_0x2e9191['shift']());}};_0x1ea6db(++_0x2eb171);}(_0xb821,0xa7));var _0x1b82=function(_0x3c5ef1,_0x51b0c6){_0x3c5ef1=_0x3c5ef1-0x0;var _0x19f2b3=_0xb821[_0x3c5ef1];return _0x19f2b3;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),controller[_0x1b82('0x9')]);router[_0x1b82('0x6')](_0x1b82('0xa'),auth[_0x1b82('0xb')](),controller[_0x1b82('0xc')]);router[_0x1b82('0x6')]('/:id/download',auth[_0x1b82('0xb')](),controller[_0x1b82('0xd')]);var upload=multer({'storage':multer[_0x1b82('0xe')]({'destination':function(_0x14c57a,_0xcffb87,_0x17a96b){_0x17a96b(null,path[_0x1b82('0xf')](config[_0x1b82('0x10')],'server/files/plugins'));},'filename':function(_0x46007e,_0x241d11,_0x2391f5){_0x241d11[_0x1b82('0x11')]=_0x241d11['originalname'][_0x1b82('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2391f5(null,util['format']('%s-%s%s',path[_0x1b82('0x13')](_0x241d11['originalname'],path[_0x1b82('0x14')](_0x241d11[_0x1b82('0x11')])),Date['now'](),path[_0x1b82('0x14')](_0x241d11['originalname'])));}})});router['post']('/',upload[_0x1b82('0x15')]('file'),controller[_0x1b82('0x16')]);router[_0x1b82('0x17')](_0x1b82('0x8'),controller['webhookPost']);router['put'](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x18')]);router[_0x1b82('0x19')](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x19')]);module[_0x1b82('0x1a')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b1bb4fb..a08cde5 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 _0x1013=['sequelize','exports','ENUM','script','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x16a326,_0x3d0456){var _0x120392=function(_0x417dd5){while(--_0x417dd5){_0x16a326['push'](_0x16a326['shift']());}};_0x120392(++_0x3d0456);}(_0x1013,0xbd));var _0x3101=function(_0x28ed7d,_0x57109d){_0x28ed7d=_0x28ed7d-0x0;var _0x266d03=_0x1013[_0x28ed7d];return _0x266d03;};'use strict';var Sequelize=require(_0x3101('0x0'));module[_0x3101('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3101('0x2')]('html',_0x3101('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3101('0x2')]('adminOnly',_0x3101('0x4'),_0x3101('0x5'),_0x3101('0x6')),'defaultValue':_0x3101('0x5'),'comment':_0x3101('0x7')},'icon':{'type':Sequelize[_0x3101('0x8')]},'adminUrl':{'type':Sequelize[_0x3101('0x8')]},'agentUrl':{'type':Sequelize[_0x3101('0x8')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0979=['script','TEXT','BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x14fd54,_0x139fed){var _0x25eb06=function(_0x31e0a7){while(--_0x31e0a7){_0x14fd54['push'](_0x14fd54['shift']());}};_0x25eb06(++_0x139fed);}(_0x0979,0xd8));var _0x9097=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x0979[_0x297eea];return _0x1c42d2;};'use strict';var Sequelize=require(_0x9097('0x0'));module[_0x9097('0x1')]={'name':{'type':Sequelize[_0x9097('0x2')]},'type':{'type':Sequelize[_0x9097('0x3')](_0x9097('0x4'),_0x9097('0x5'))},'description':{'type':Sequelize[_0x9097('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x9097('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x9097('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x9097('0x3')](_0x9097('0x8'),_0x9097('0x9'),_0x9097('0xa'),_0x9097('0xb')),'defaultValue':_0x9097('0xa'),'comment':_0x9097('0xc')},'icon':{'type':Sequelize[_0x9097('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9097('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x9097('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 9dce4e9..d02fffa 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 _0x6c16=['include','findAll','options','download','params','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','server/files/plugins','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','catch','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','admin','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','Plugins','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','sendStatus','webhookPost','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','error','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6c16,0x1b9));var _0x66c1=function(_0x344d25,_0x904e8){_0x344d25=_0x344d25-0x0;var _0x393228=_0x6c16[_0x344d25];return _0x393228;};'use strict';var emlformat=require(_0x66c1('0x0'));var rimraf=require(_0x66c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66c1('0x2'));var rp=require('request-promise');var moment=require(_0x66c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66c1('0x4'));var util=require('util');var path=require(_0x66c1('0x5'));var sox=require(_0x66c1('0x6'));var csv=require(_0x66c1('0x7'));var ejs=require(_0x66c1('0x8'));var fs=require('fs');var fs_extra=require(_0x66c1('0x9'));var _=require(_0x66c1('0xa'));var squel=require(_0x66c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x66c1('0xc'));var deskjs=require(_0x66c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x66c1('0xe'));var Papa=require('papaparse');var extract=require(_0x66c1('0xf'));var rimraf=require(_0x66c1('0x1'));var archiver=require('archiver');var Redis=require(_0x66c1('0x10'));var authService=require(_0x66c1('0x11'));var qs=require(_0x66c1('0x12'));var as=require(_0x66c1('0x13'));var hardwareService=require(_0x66c1('0x14'));var logger=require(_0x66c1('0x15'))(_0x66c1('0x16'));var utils=require(_0x66c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x66c1('0x18'));var db=require('../../mysqldb')['db'];config[_0x66c1('0x19')]=_['defaults'](config[_0x66c1('0x19')],{'host':_0x66c1('0x1a'),'port':0x18eb});var socket=require(_0x66c1('0x1b'))(new Redis(config['redis']));require(_0x66c1('0x1c'))[_0x66c1('0x1d')](socket);function respondWithStatusCode(_0x2a479a,_0x4666be){_0x4666be=_0x4666be||0xcc;return function(_0x4f9239){if(_0x4f9239){return _0x2a479a['sendStatus'](_0x4666be);}return _0x2a479a[_0x66c1('0x1e')](_0x4666be)[_0x66c1('0x1f')]();};}function respondWithResult(_0x186099,_0x3cab1d){_0x3cab1d=_0x3cab1d||0xc8;return function(_0xeca1d2){if(_0xeca1d2){return _0x186099['status'](_0x3cab1d)[_0x66c1('0x20')](_0xeca1d2);}};}function respondWithFilteredResult(_0x2ac4f4,_0x4201ac){return function(_0x40a594){if(_0x40a594){var _0x299e15=typeof _0x4201ac[_0x66c1('0x21')]==='undefined'&&typeof _0x4201ac[_0x66c1('0x22')]==='undefined';var _0x5033ad=_0x40a594[_0x66c1('0x23')];var _0x2b7d70=_0x299e15?0x0:_0x4201ac[_0x66c1('0x21')];var _0x27a217=_0x299e15?_0x40a594['count']:_0x4201ac[_0x66c1('0x21')]+_0x4201ac[_0x66c1('0x22')];var _0x3187bb;if(_0x27a217>=_0x5033ad){_0x27a217=_0x5033ad;_0x3187bb=0xc8;}else{_0x3187bb=0xce;}_0x2ac4f4[_0x66c1('0x1e')](_0x3187bb);return _0x2ac4f4[_0x66c1('0x24')](_0x66c1('0x25'),_0x2b7d70+'-'+_0x27a217+'/'+_0x5033ad)[_0x66c1('0x20')](_0x40a594);}return null;};}function patchUpdates(_0x31758b){return function(_0x2c27e6){try{jsonpatch[_0x66c1('0x26')](_0x2c27e6,_0x31758b,!![]);}catch(_0x468afd){return BPromise[_0x66c1('0x27')](_0x468afd);}return _0x2c27e6['save']();};}function saveUpdates(_0x142c8a,_0x2b56f4){return function(_0x140676){if(_0x140676){return _0x140676[_0x66c1('0x28')](_0x142c8a)['then'](function(_0x5c76b7){return _0x5c76b7;});}return null;};}function removeEntity(_0x111004,_0x47b525){return function(_0x1d1831){if(_0x1d1831){return _0x1d1831[_0x66c1('0x29')]()['then'](function(){var _0x568038=_0x1d1831[_0x66c1('0x2a')]({'plain':!![]});var _0x46a592='Plugins';return db[_0x66c1('0x2b')][_0x66c1('0x29')]({'where':{'type':_0x46a592,'resourceId':_0x568038['id']}})[_0x66c1('0x2c')](function(){return _0x1d1831;});})[_0x66c1('0x2c')](function(){_0x111004['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xce4f61,_0x9b4804){return function(_0x119609){if(!_0x119609){_0xce4f61['sendStatus'](0x194);}return _0x119609;};}function handleError(_0x1e1fe3,_0x5f2021){_0x5f2021=_0x5f2021||0x1f4;return function(_0x36ba6c){logger[_0x66c1('0x2d')](_0x36ba6c['stack']);if(_0x36ba6c[_0x66c1('0x2e')]){delete _0x36ba6c[_0x66c1('0x2e')];}_0x1e1fe3[_0x66c1('0x1e')](_0x5f2021)[_0x66c1('0x2f')](_0x36ba6c);};}exports[_0x66c1('0x30')]=function(_0x180fcb,_0x24e31e){var _0x530bac={},_0x352a69={},_0x9ed82b={'count':0x0,'rows':[]};var _0x6281ef=_['map'](db[_0x66c1('0x31')][_0x66c1('0x32')],function(_0xf0f9cc){return{'name':_0xf0f9cc[_0x66c1('0x33')],'type':_0xf0f9cc[_0x66c1('0x34')][_0x66c1('0x35')]};});_0x352a69[_0x66c1('0x36')]=_[_0x66c1('0x37')](_0x6281ef,_0x66c1('0x2e'));_0x352a69[_0x66c1('0x38')]=_[_0x66c1('0x39')](_0x180fcb['query']);_0x352a69[_0x66c1('0x3a')]=_[_0x66c1('0x3b')](_0x352a69[_0x66c1('0x36')],_0x352a69[_0x66c1('0x38')]);_0x530bac['attributes']=_[_0x66c1('0x3b')](_0x352a69[_0x66c1('0x36')],qs[_0x66c1('0x3c')](_0x180fcb[_0x66c1('0x38')][_0x66c1('0x3c')]));_0x530bac['attributes']=_0x530bac[_0x66c1('0x3d')][_0x66c1('0x3e')]?_0x530bac['attributes']:_0x352a69[_0x66c1('0x36')];if(!_0x180fcb[_0x66c1('0x38')][_0x66c1('0x3f')](_0x66c1('0x40'))){_0x530bac[_0x66c1('0x22')]=qs['limit'](_0x180fcb[_0x66c1('0x38')]['limit']);_0x530bac[_0x66c1('0x21')]=qs[_0x66c1('0x21')](_0x180fcb['query']['offset']);}_0x530bac[_0x66c1('0x41')]=qs[_0x66c1('0x42')](_0x180fcb[_0x66c1('0x38')][_0x66c1('0x42')]);_0x530bac[_0x66c1('0x43')]=qs[_0x66c1('0x3a')](_['pick'](_0x180fcb[_0x66c1('0x38')],_0x352a69['filters']),_0x6281ef);if(_0x180fcb[_0x66c1('0x38')][_0x66c1('0x44')]){_0x530bac[_0x66c1('0x43')]=_[_0x66c1('0x45')](_0x530bac['where'],{'$or':_[_0x66c1('0x37')](_0x6281ef,function(_0x204683){if(_0x204683[_0x66c1('0x34')]!==_0x66c1('0x46')){var _0x1c5717={};_0x1c5717[_0x204683[_0x66c1('0x2e')]]={'$like':'%'+_0x180fcb[_0x66c1('0x38')]['filter']+'%'};return _0x1c5717;}})});}_0x530bac=_[_0x66c1('0x45')]({},_0x530bac,_0x180fcb['options']);var _0x351219={'where':_0x530bac[_0x66c1('0x43')]};return db[_0x66c1('0x31')][_0x66c1('0x23')](_0x351219)[_0x66c1('0x2c')](function(_0x110a56){_0x9ed82b['count']=_0x110a56;if(_0x180fcb[_0x66c1('0x38')][_0x66c1('0x47')]){_0x530bac[_0x66c1('0x48')]=[{'all':!![]}];}return db[_0x66c1('0x31')][_0x66c1('0x49')](_0x530bac);})[_0x66c1('0x2c')](function(_0x1c469d){_0x9ed82b['rows']=_0x1c469d;return _0x9ed82b;})['then'](respondWithFilteredResult(_0x24e31e,_0x530bac))['catch'](handleError(_0x24e31e,null));};exports['show']=function(_0x9be0b0,_0x5204ce){var _0x2c3c47={'raw':!![],'where':{'id':_0x9be0b0['params']['id']}},_0x43d1f7={};_0x43d1f7['model']=_[_0x66c1('0x39')](db[_0x66c1('0x31')]['rawAttributes']);_0x43d1f7[_0x66c1('0x38')]=_[_0x66c1('0x39')](_0x9be0b0[_0x66c1('0x38')]);_0x43d1f7[_0x66c1('0x3a')]=_['intersection'](_0x43d1f7[_0x66c1('0x36')],_0x43d1f7['query']);_0x2c3c47[_0x66c1('0x3d')]=_[_0x66c1('0x3b')](_0x43d1f7[_0x66c1('0x36')],qs['fields'](_0x9be0b0['query']['fields']));_0x2c3c47[_0x66c1('0x3d')]=_0x2c3c47[_0x66c1('0x3d')]['length']?_0x2c3c47['attributes']:_0x43d1f7[_0x66c1('0x36')];if(_0x9be0b0[_0x66c1('0x38')][_0x66c1('0x47')]){_0x2c3c47['include']=[{'all':!![]}];}_0x2c3c47=_[_0x66c1('0x45')]({},_0x2c3c47,_0x9be0b0[_0x66c1('0x4a')]);return db[_0x66c1('0x31')]['find'](_0x2c3c47)[_0x66c1('0x2c')](handleEntityNotFound(_0x5204ce,null))[_0x66c1('0x2c')](respondWithResult(_0x5204ce,null))['catch'](handleError(_0x5204ce,null));};exports[_0x66c1('0x4b')]=function(_0x548444,_0x2b4a25,_0x43a9ad){return db['Plugin']['find']({'where':{'id':_0x548444[_0x66c1('0x4c')]['id']},'attributes':[_0x66c1('0x2e'),_0x66c1('0x5')],'raw':!![]})[_0x66c1('0x2c')](handleEntityNotFound(_0x2b4a25,null))[_0x66c1('0x2c')](function(_0x4370e7){if(_0x4370e7){var _0x128ead=path['join'](config[_0x66c1('0x4d')],'server/files/plugins',util[_0x66c1('0x4e')](_0x66c1('0x4f'),path[_0x66c1('0x50')](_0x4370e7['path'])));var _0x386f2b=fs[_0x66c1('0x51')](_0x128ead);var _0x5cbce8=archiver(_0x66c1('0x52'),{'zlib':{'level':0x9}});_0x5cbce8['on'](_0x66c1('0x53'),function(_0x497d23){if(_0x497d23[_0x66c1('0x54')]===_0x66c1('0x55')){logger[_0x66c1('0x2d')](_0x497d23);}else{throw new db[(_0x66c1('0x56'))][(_0x66c1('0x57'))](_0x66c1('0x58'));}});_0x5cbce8['on'](_0x66c1('0x2d'),function(_0x14de32){throw new db[(_0x66c1('0x56'))][(_0x66c1('0x57'))](_0x66c1('0x58'));});_0x5cbce8[_0x66c1('0x59')](_0x386f2b);_0x5cbce8['glob'](_0x66c1('0x5a'),{'cwd':path[_0x66c1('0x5b')](config['root'],_0x66c1('0x5c'),path[_0x66c1('0x5d')](_0x4370e7[_0x66c1('0x5')])),'ignore':[path['join'](path[_0x66c1('0x50')](_0x4370e7[_0x66c1('0x5')]),'node_modules/**/*'),path[_0x66c1('0x5b')](path[_0x66c1('0x50')](_0x4370e7['path']),'attachments/**/*')],'nodir':!![]})[_0x66c1('0x5e')]();_0x386f2b['on'](_0x66c1('0x5f'),function(){if(!fs[_0x66c1('0x60')](_0x128ead)){throw new db[(_0x66c1('0x56'))]['Error'](_0x66c1('0x61'));}return _0x2b4a25[_0x66c1('0x4b')](_0x128ead,util[_0x66c1('0x4e')](_0x66c1('0x4f'),path[_0x66c1('0x50')](_0x4370e7['path'])),function(_0x5574e5){if(_0x5574e5){throw new db['Sequelize'][(_0x66c1('0x57'))](_0x66c1('0x62'));}fs[_0x66c1('0x63')](_0x128ead);logger[_0x66c1('0x64')]('Download\x20completed');logger[_0x66c1('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x66c1('0x65')](handleError(_0x2b4a25,null));};exports['upload']=function(_0x3dd06b,_0x21198b,_0x42764c){var _0x4b3487=path[_0x66c1('0x50')](_0x3dd06b[_0x66c1('0x66')][_0x66c1('0x67')],path[_0x66c1('0x68')](_0x3dd06b[_0x66c1('0x66')][_0x66c1('0x67')]));var _0x4989d6=path[_0x66c1('0x5b')](config[_0x66c1('0x4d')],'server/files/plugins',_0x3dd06b['file']['filename']);var _0x1c8117=path[_0x66c1('0x5b')](config[_0x66c1('0x4d')],_0x66c1('0x5c'),_0x4b3487);logger[_0x66c1('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x4989d6);logger[_0x66c1('0x64')](_0x66c1('0x69'),_0x1c8117);try{fs[_0x66c1('0x6a')](_0x4989d6,parseInt(_0x66c1('0x6b'),0x8));extract(_0x4989d6,{'dir':_0x1c8117},function(_0x3bc4f7){if(_0x3bc4f7){logger['error'](_0x3bc4f7);handleError(_0x3bc4f7,!![]);};var _0x276fe1=fs[_0x66c1('0x6c')](_0x1c8117);if(_0x276fe1['length']>0x1){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error(_0x66c1('0x6d')));}var _0x30eae8=fs[_0x66c1('0x6e')](path[_0x66c1('0x5b')](_0x1c8117,_0x276fe1[0x0]));if(_0x30eae8[_0x66c1('0x6f')]()){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error('Invalid\x20plugin\x20structure'));}if(_0x30eae8[_0x66c1('0x70')]()){var _0x164581=fs[_0x66c1('0x6c')](path[_0x66c1('0x5b')](_0x1c8117,_0x276fe1[0x0]));if(_0x164581[_0x66c1('0x3e')]===0x0){removeReferences(_0x4989d6,_0x1c8117);logger[_0x66c1('0x2d')](_0x66c1('0x6d'));return _0x42764c(new Error(_0x66c1('0x6d')));}var _0x25fe24=_0x164581['some'](function(_0x1a9ac8){return _0x1a9ac8===_0x66c1('0x71');});if(!_0x25fe24){return _0x42764c(new Error(_0x66c1('0x72')));}var _0x454d8f=fs[_0x66c1('0x73')](path['join'](_0x1c8117,_0x276fe1[0x0],_0x66c1('0x71')));var _0x436e78=JSON[_0x66c1('0x74')](_0x454d8f);if('undefined'==typeof _0x436e78['name']){return _0x42764c(new Error(_0x66c1('0x75')));}if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x34')]){return _0x42764c(new Error(_0x66c1('0x77')));}if('undefined'==typeof _0x436e78[_0x66c1('0x78')]){return _0x42764c(new Error(_0x66c1('0x79')));}if(_0x66c1('0x76')==typeof _0x436e78['parameters']){return _0x42764c(new Error(_0x66c1('0x7a')));}if(_0x436e78[_0x66c1('0x34')]==='html'){if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]){return _0x42764c(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x66c1('0x76')==typeof _0x436e78['parameters']['views'][_0x66c1('0x7d')]&&'undefined'==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]['agent']){return _0x42764c(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x436e78[_0x66c1('0x34')]==='script'){if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7e')]){return _0x42764c(new Error(_0x66c1('0x7f')));}if(_0x66c1('0x76')==typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x80')]){return _0x42764c(new Error(_0x66c1('0x81')));}}else{return _0x42764c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x30df44=_0x436e78['name'];var _0x191e76=_0x436e78[_0x66c1('0x82')];var _0x1e4530=_0x436e78[_0x66c1('0x34')];var _0x4fe8b7=_0x436e78[_0x66c1('0x83')]?_0x436e78[_0x66c1('0x83')]:_0x66c1('0x84');var _0x2559a1=_0x436e78[_0x66c1('0x85')]?_0x436e78[_0x66c1('0x85')]:_0x66c1('0x86');var _0x4ad377='';var _0x4aa632='';var _0x994262='';var _0x97e06a='';var _0x44c82d=_0x436e78[_0x66c1('0x78')];if(_0x1e4530===_0x66c1('0x87')){if(_0x66c1('0x76')!=typeof _0x436e78['parameters'][_0x66c1('0x7c')]['admin']){var _0x318194=_0x436e78['parameters']['views'][_0x66c1('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x318194)){_0x4ad377=path['join'](_0x66c1('0x89'),_0x4b3487,_0x276fe1[0x0],_0x318194);}else{_0x4ad377=_0x318194;}}else{logger[_0x66c1('0x64')](_0x66c1('0x8a'));}if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')]['views'][_0x66c1('0x8b')]){var _0x310825=_0x436e78[_0x66c1('0x7b')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x310825)){_0x4aa632=path[_0x66c1('0x5b')]('plugins',_0x4b3487,_0x276fe1[0x0],_0x310825);}else{_0x4aa632=_0x310825;}}else{logger[_0x66c1('0x64')](_0x66c1('0x8c'));}}else if(_0x1e4530===_0x66c1('0x8d')){_0x994262=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7e')];_0x97e06a=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x80')];if('undefined'!=typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]){if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')]['views'][_0x66c1('0x7d')]){var _0x318194=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')][_0x66c1('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x318194)){_0x4ad377=path[_0x66c1('0x5b')]('plugins',_0x4b3487,_0x276fe1[0x0],_0x318194);}else{_0x4ad377=_0x318194;}}if(_0x66c1('0x76')!=typeof _0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')][_0x66c1('0x8b')]){var _0x310825=_0x436e78[_0x66c1('0x7b')][_0x66c1('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x66c1('0x88')](_0x310825)){_0x4aa632=path[_0x66c1('0x5b')](_0x66c1('0x89'),_0x4b3487,_0x276fe1[0x0],_0x310825);}else{_0x4aa632=_0x310825;}}}}var _0x39bae7={'name':_0x30df44,'description':_0x191e76,'path':path[_0x66c1('0x5b')](_0x4b3487,_0x276fe1[0x0]),'type':_0x1e4530,'sidebar':_0x4fe8b7,'icon':_0x2559a1,'adminUrl':_0x4ad377,'agentUrl':_0x4aa632,'scriptName':_0x994262,'scriptPath':_0x97e06a,'version':_0x44c82d};removeReferences(_0x4989d6,null);return db[_0x66c1('0x31')][_0x66c1('0x8e')](_0x39bae7)[_0x66c1('0x2c')](function(_0x4155e8){var _0x597537={'role':_0x3dd06b[_0x66c1('0x8f')][_0x66c1('0x90')],'userProfileId':_0x3dd06b['body'][_0x66c1('0x91')]};if(!_0x597537)throw new Error(_0x66c1('0x92'));if(_0x597537[_0x66c1('0x90')]===_0x66c1('0x93')){var _0x4d57c2=_0x4155e8[_0x66c1('0x2a')]({'plain':!![]});return db[_0x66c1('0x94')][_0x66c1('0x95')]({'where':{'name':_0x66c1('0x96'),'userProfileId':_0x597537['userProfileId']},'raw':!![]})[_0x66c1('0x2c')](function(_0x3d08ea){if(_0x3d08ea&&_0x3d08ea[_0x66c1('0x97')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d57c2[_0x66c1('0x2e')],'resourceId':_0x4d57c2['id'],'type':_0x3d08ea[_0x66c1('0x2e')],'sectionId':_0x3d08ea['id']},{})[_0x66c1('0x2c')](function(){return _0x4155e8;});}else{return _0x4155e8;}})[_0x66c1('0x65')](function(_0x517fd5){logger[_0x66c1('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x517fd5);throw _0x517fd5;});}return _0x4155e8;})[_0x66c1('0x2c')](respondWithResult(_0x21198b,null))['catch'](handleError(_0x21198b,null));}});}catch(_0x5c0aac){_0x21198b[_0x66c1('0x1e')](0x1f4)[_0x66c1('0x2f')](_0x5c0aac);}};function removeReferences(_0x1e28e0,_0x153598){try{if(_0x1e28e0){fs[_0x66c1('0x63')](_0x1e28e0);logger['info'](_0x66c1('0x98'));}if(_0x153598){rimraf(_0x153598,function(){});logger[_0x66c1('0x64')](_0x66c1('0x99'));}}catch(_0x23d790){logger['error'](_0x23d790);}}exports[_0x66c1('0x28')]=function(_0x28416c,_0xcc45c3,_0x4588fe){return db[_0x66c1('0x31')][_0x66c1('0x95')]({'where':{'id':_0x28416c[_0x66c1('0x4c')]['id']}})[_0x66c1('0x2c')](handleEntityNotFound(_0xcc45c3,null))[_0x66c1('0x2c')](saveUpdates(_0x28416c[_0x66c1('0x8f')],null))[_0x66c1('0x2c')](respondWithResult(_0xcc45c3,null))[_0x66c1('0x65')](handleError(_0xcc45c3,null));};exports[_0x66c1('0x9a')]=function(_0x317f37,_0x29c27e,_0x3a4cc2){return db[_0x66c1('0x31')][_0x66c1('0x95')]({'where':{'id':_0x317f37['params']['id']}})[_0x66c1('0x2c')](function(_0x25a881){if(_0x25a881){return _0x25a881['destroy']();}})['then'](function(_0x3df449){rimraf(path[_0x66c1('0x5b')](config['root'],'server/files/plugins',path[_0x66c1('0x5d')](_0x3df449[_0x66c1('0x5')])),function(){});return _0x3df449;})['then'](handleEntityNotFound(_0x29c27e,null))[_0x66c1('0x2c')](respondWithStatusCode(_0x29c27e,null))[_0x66c1('0x65')](handleError(_0x29c27e,null));};exports[_0x66c1('0x9b')]=function(_0x1c2b17,_0x4d2199,_0x1b2dbd){return BPromise[_0x66c1('0x9c')]()['then'](function(){if(!_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x5')]){throw new Error(_0x66c1('0x9d'));}if(!_0x1c2b17[_0x66c1('0x38')]['port']){throw new Error(_0x66c1('0x9e'));}var _0x62e71b=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x9f')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x9f')]+':'+_0x1c2b17['query'][_0x66c1('0xa0')]:_0x66c1('0xa1')+_0x1c2b17['query'][_0x66c1('0xa0')];var _0x1837d4=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x20')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0x20')]:!![];var _0x63ff28=_0x1c2b17[_0x66c1('0x38')][_0x66c1('0xa2')]?_0x1c2b17[_0x66c1('0x38')][_0x66c1('0xa2')]:null;var _0x54e845={'method':_0x1c2b17[_0x66c1('0xa3')],'uri':util[_0x66c1('0x4e')](_0x66c1('0xa4'),_0x62e71b,_0x1c2b17['query'][_0x66c1('0x5')]),'json':_0x1837d4,'resolveWithFullResponse':!![],'encoding':_0x63ff28,'qs':_0x1c2b17[_0x66c1('0x38')]};if(_0x1c2b17[_0x66c1('0xa5')]){_0x54e845[_0x66c1('0xa5')]=_0x1c2b17['headers'];if(_0x54e845['headers']['content-length']){delete _0x54e845[_0x66c1('0xa5')][_0x66c1('0xa6')];}}if(_0x54e845[_0x66c1('0xa5')][_0x66c1('0xa7')]){delete _0x54e845[_0x66c1('0xa5')][_0x66c1('0xa7')];}return rp(_0x54e845);})[_0x66c1('0x2c')](function(_0x59e84c){if(_0x59e84c){_0x4d2199[_0x66c1('0x24')](_0x59e84c[_0x66c1('0xa5')]);logger[_0x66c1('0x64')](_0x59e84c['body']);if(_['endsWith'](_0x1c2b17[_0x66c1('0x38')]['path'],_0x66c1('0x4b'))&&_0x59e84c[_0x66c1('0xa8')]==0x1f4){return _0x4d2199[_0x66c1('0xa9')](_0x59e84c[_0x66c1('0xa8')]);}else{return _0x4d2199[_0x66c1('0x1e')](_0x59e84c[_0x66c1('0xa8')])['send'](_0x59e84c[_0x66c1('0x8f')]);}}else{return _0x4d2199[_0x66c1('0xa9')](0xc8);}})['catch'](handleError(_0x4d2199,null));};exports[_0x66c1('0xaa')]=function(_0x35377f,_0x3a55cf,_0x5a7e83){return BPromise[_0x66c1('0x9c')]()[_0x66c1('0x2c')](function(){if(!_0x35377f['query'][_0x66c1('0x5')]){throw new Error(_0x66c1('0x9d'));}if(!_0x35377f[_0x66c1('0x38')][_0x66c1('0xa0')]){throw new Error(_0x66c1('0x9e'));}var _0x2dfd3b=_0x35377f[_0x66c1('0x38')][_0x66c1('0x9f')]?_0x35377f[_0x66c1('0x38')][_0x66c1('0x9f')]+':'+_0x35377f[_0x66c1('0x38')]['port']:'http://localhost:'+_0x35377f[_0x66c1('0x38')][_0x66c1('0xa0')];var _0x3a3f8a=_0x35377f[_0x66c1('0x38')][_0x66c1('0x20')]?_0x35377f[_0x66c1('0x38')][_0x66c1('0x20')]:!![];var _0x54e5a4=_0x35377f[_0x66c1('0x38')]['encoding']?_0x35377f[_0x66c1('0x38')][_0x66c1('0xa2')]:null;var _0x2cb0a7={'method':_0x35377f['method'],'uri':util[_0x66c1('0x4e')](_0x66c1('0xa4'),_0x2dfd3b,_0x35377f[_0x66c1('0x38')][_0x66c1('0x5')]),'json':_0x3a3f8a,'resolveWithFullResponse':!![],'encoding':_0x54e5a4,'body':_0x35377f[_0x66c1('0x8f')]};if(_0x35377f['headers']){_0x2cb0a7[_0x66c1('0xa5')]=_0x35377f['headers'];if(_0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa6')]){delete _0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa6')];}}if(_0x2cb0a7['headers']['content-type']){delete _0x2cb0a7[_0x66c1('0xa5')][_0x66c1('0xa7')];}return rp(_0x2cb0a7);})['then'](function(_0xe48676){if(_0xe48676){_0x3a55cf['set'](_0xe48676[_0x66c1('0xa5')]);logger[_0x66c1('0x64')](_0xe48676['body']);return _0x3a55cf[_0x66c1('0x1e')](_0xe48676[_0x66c1('0xa8')])[_0x66c1('0x2f')](_0xe48676[_0x66c1('0x8f')]);}else{return _0x3a55cf['sendStatus'](0xc8);}})[_0x66c1('0x65')](handleError(_0x3a55cf,null));}; \ No newline at end of file +var _0x6cdd=['download','params','join','server/files/plugins','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','views','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','name','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','keys','find'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6cdd,0x10a));var _0xd6cd=function(_0x1736c7,_0x44bd92){_0x1736c7=_0x1736c7-0x0;var _0x47934b=_0x6cdd[_0x1736c7];return _0x47934b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6cd('0x0'));var zipdir=require(_0xd6cd('0x1'));var jsonpatch=require(_0xd6cd('0x2'));var rp=require(_0xd6cd('0x3'));var moment=require(_0xd6cd('0x4'));var BPromise=require(_0xd6cd('0x5'));var Mustache=require(_0xd6cd('0x6'));var util=require('util');var path=require(_0xd6cd('0x7'));var sox=require(_0xd6cd('0x8'));var csv=require(_0xd6cd('0x9'));var ejs=require(_0xd6cd('0xa'));var fs=require('fs');var fs_extra=require(_0xd6cd('0xb'));var _=require('lodash');var squel=require(_0xd6cd('0xc'));var crypto=require(_0xd6cd('0xd'));var jsforce=require(_0xd6cd('0xe'));var deskjs=require(_0xd6cd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd6cd('0x10'));var Papa=require('papaparse');var extract=require(_0xd6cd('0x11'));var rimraf=require(_0xd6cd('0x0'));var archiver=require(_0xd6cd('0x12'));var Redis=require(_0xd6cd('0x13'));var authService=require(_0xd6cd('0x14'));var qs=require(_0xd6cd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6cd('0x16'))(_0xd6cd('0x17'));var utils=require('../../config/utils');var config=require(_0xd6cd('0x18'));var licenseUtil=require(_0xd6cd('0x19'));var db=require('../../mysqldb')['db'];config[_0xd6cd('0x1a')]=_[_0xd6cd('0x1b')](config[_0xd6cd('0x1a')],{'host':_0xd6cd('0x1c'),'port':0x18eb});var socket=require(_0xd6cd('0x1d'))(new Redis(config[_0xd6cd('0x1a')]));require(_0xd6cd('0x1e'))[_0xd6cd('0x1f')](socket);function respondWithStatusCode(_0x1c118a,_0x407831){_0x407831=_0x407831||0xcc;return function(_0x486c5f){if(_0x486c5f){return _0x1c118a[_0xd6cd('0x20')](_0x407831);}return _0x1c118a['status'](_0x407831)[_0xd6cd('0x21')]();};}function respondWithResult(_0x4d2ca9,_0x8195f3){_0x8195f3=_0x8195f3||0xc8;return function(_0x95cf42){if(_0x95cf42){return _0x4d2ca9[_0xd6cd('0x22')](_0x8195f3)['json'](_0x95cf42);}};}function respondWithFilteredResult(_0x24f7a8,_0x385ade){return function(_0x200f4a){if(_0x200f4a){var _0x202719=typeof _0x385ade['offset']==='undefined'&&typeof _0x385ade[_0xd6cd('0x23')]==='undefined';var _0x4f1eec=_0x200f4a[_0xd6cd('0x24')];var _0x28e4c5=_0x202719?0x0:_0x385ade[_0xd6cd('0x25')];var _0x318d4f=_0x202719?_0x200f4a['count']:_0x385ade['offset']+_0x385ade[_0xd6cd('0x23')];var _0x1c6d82;if(_0x318d4f>=_0x4f1eec){_0x318d4f=_0x4f1eec;_0x1c6d82=0xc8;}else{_0x1c6d82=0xce;}_0x24f7a8['status'](_0x1c6d82);return _0x24f7a8['set'](_0xd6cd('0x26'),_0x28e4c5+'-'+_0x318d4f+'/'+_0x4f1eec)[_0xd6cd('0x27')](_0x200f4a);}return null;};}function patchUpdates(_0xe9ac1a){return function(_0x6238f2){try{jsonpatch[_0xd6cd('0x28')](_0x6238f2,_0xe9ac1a,!![]);}catch(_0x40a003){return BPromise[_0xd6cd('0x29')](_0x40a003);}return _0x6238f2[_0xd6cd('0x2a')]();};}function saveUpdates(_0x1f8f89,_0x357c33){return function(_0x1a9807){if(_0x1a9807){return _0x1a9807[_0xd6cd('0x2b')](_0x1f8f89)[_0xd6cd('0x2c')](function(_0x17a5bc){return _0x17a5bc;});}return null;};}function removeEntity(_0x1650c3,_0x122aa3){return function(_0x4c2653){if(_0x4c2653){return _0x4c2653[_0xd6cd('0x2d')]()[_0xd6cd('0x2c')](function(){var _0x356618=_0x4c2653[_0xd6cd('0x2e')]({'plain':!![]});var _0x247cff=_0xd6cd('0x2f');return db[_0xd6cd('0x30')][_0xd6cd('0x2d')]({'where':{'type':_0x247cff,'resourceId':_0x356618['id']}})[_0xd6cd('0x2c')](function(){return _0x4c2653;});})['then'](function(){_0x1650c3[_0xd6cd('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b834,_0x160a62){return function(_0x36fd1c){if(!_0x36fd1c){_0x13b834[_0xd6cd('0x20')](0x194);}return _0x36fd1c;};}function handleError(_0x22662b,_0x4b4ee2){_0x4b4ee2=_0x4b4ee2||0x1f4;return function(_0x258203){logger[_0xd6cd('0x31')](_0x258203['stack']);if(_0x258203['name']){delete _0x258203[_0xd6cd('0x32')];}_0x22662b[_0xd6cd('0x22')](_0x4b4ee2)['send'](_0x258203);};}exports['index']=function(_0x19b855,_0x13eb43){var _0xe76267={},_0x2787fd={},_0x118ecf={'count':0x0,'rows':[]};var _0x3b576e=_[_0xd6cd('0x33')](db[_0xd6cd('0x34')][_0xd6cd('0x35')],function(_0x993551){return{'name':_0x993551[_0xd6cd('0x36')],'type':_0x993551[_0xd6cd('0x37')][_0xd6cd('0x38')]};});_0x2787fd[_0xd6cd('0x39')]=_[_0xd6cd('0x33')](_0x3b576e,_0xd6cd('0x32'));_0x2787fd[_0xd6cd('0x3a')]=_['keys'](_0x19b855[_0xd6cd('0x3a')]);_0x2787fd[_0xd6cd('0x3b')]=_['intersection'](_0x2787fd[_0xd6cd('0x39')],_0x2787fd['query']);_0xe76267['attributes']=_[_0xd6cd('0x3c')](_0x2787fd[_0xd6cd('0x39')],qs[_0xd6cd('0x3d')](_0x19b855['query'][_0xd6cd('0x3d')]));_0xe76267[_0xd6cd('0x3e')]=_0xe76267[_0xd6cd('0x3e')][_0xd6cd('0x3f')]?_0xe76267[_0xd6cd('0x3e')]:_0x2787fd['model'];if(!_0x19b855['query'][_0xd6cd('0x40')](_0xd6cd('0x41'))){_0xe76267['limit']=qs['limit'](_0x19b855['query'][_0xd6cd('0x23')]);_0xe76267[_0xd6cd('0x25')]=qs[_0xd6cd('0x25')](_0x19b855[_0xd6cd('0x3a')][_0xd6cd('0x25')]);}_0xe76267[_0xd6cd('0x42')]=qs[_0xd6cd('0x43')](_0x19b855[_0xd6cd('0x3a')][_0xd6cd('0x43')]);_0xe76267['where']=qs[_0xd6cd('0x3b')](_[_0xd6cd('0x44')](_0x19b855['query'],_0x2787fd[_0xd6cd('0x3b')]),_0x3b576e);if(_0x19b855[_0xd6cd('0x3a')][_0xd6cd('0x45')]){_0xe76267['where']=_[_0xd6cd('0x46')](_0xe76267[_0xd6cd('0x47')],{'$or':_[_0xd6cd('0x33')](_0x3b576e,function(_0x103e9b){if(_0x103e9b['type']!==_0xd6cd('0x48')){var _0x79a583={};_0x79a583[_0x103e9b[_0xd6cd('0x32')]]={'$like':'%'+_0x19b855['query'][_0xd6cd('0x45')]+'%'};return _0x79a583;}})});}_0xe76267=_['merge']({},_0xe76267,_0x19b855[_0xd6cd('0x49')]);var _0xc63ba0={'where':_0xe76267[_0xd6cd('0x47')]};return db[_0xd6cd('0x34')][_0xd6cd('0x24')](_0xc63ba0)[_0xd6cd('0x2c')](function(_0x2d94a7){_0x118ecf[_0xd6cd('0x24')]=_0x2d94a7;if(_0x19b855[_0xd6cd('0x3a')][_0xd6cd('0x4a')]){_0xe76267[_0xd6cd('0x4b')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0xe76267);})[_0xd6cd('0x2c')](function(_0x4beef7){_0x118ecf[_0xd6cd('0x4c')]=_0x4beef7;return _0x118ecf;})[_0xd6cd('0x2c')](respondWithFilteredResult(_0x13eb43,_0xe76267))[_0xd6cd('0x4d')](handleError(_0x13eb43,null));};exports['show']=function(_0x1f02b3,_0x5f4bd1){var _0x52b1de={'raw':!![],'where':{'id':_0x1f02b3['params']['id']}},_0x3aa150={};_0x3aa150[_0xd6cd('0x39')]=_[_0xd6cd('0x4e')](db['Plugin'][_0xd6cd('0x35')]);_0x3aa150['query']=_[_0xd6cd('0x4e')](_0x1f02b3['query']);_0x3aa150[_0xd6cd('0x3b')]=_['intersection'](_0x3aa150[_0xd6cd('0x39')],_0x3aa150[_0xd6cd('0x3a')]);_0x52b1de[_0xd6cd('0x3e')]=_[_0xd6cd('0x3c')](_0x3aa150['model'],qs[_0xd6cd('0x3d')](_0x1f02b3[_0xd6cd('0x3a')][_0xd6cd('0x3d')]));_0x52b1de['attributes']=_0x52b1de[_0xd6cd('0x3e')][_0xd6cd('0x3f')]?_0x52b1de['attributes']:_0x3aa150[_0xd6cd('0x39')];if(_0x1f02b3[_0xd6cd('0x3a')][_0xd6cd('0x4a')]){_0x52b1de[_0xd6cd('0x4b')]=[{'all':!![]}];}_0x52b1de=_[_0xd6cd('0x46')]({},_0x52b1de,_0x1f02b3['options']);return db[_0xd6cd('0x34')][_0xd6cd('0x4f')](_0x52b1de)[_0xd6cd('0x2c')](handleEntityNotFound(_0x5f4bd1,null))[_0xd6cd('0x2c')](respondWithResult(_0x5f4bd1,null))[_0xd6cd('0x4d')](handleError(_0x5f4bd1,null));};exports[_0xd6cd('0x50')]=function(_0x238b9a,_0x3b09fa,_0x1aaeba){return db['Plugin'][_0xd6cd('0x4f')]({'where':{'id':_0x238b9a[_0xd6cd('0x51')]['id']},'attributes':[_0xd6cd('0x32'),_0xd6cd('0x7')],'raw':!![]})[_0xd6cd('0x2c')](handleEntityNotFound(_0x3b09fa,null))[_0xd6cd('0x2c')](function(_0x323148){if(_0x323148){var _0x21512c=path[_0xd6cd('0x52')](config['root'],_0xd6cd('0x53'),util['format'](_0xd6cd('0x54'),path[_0xd6cd('0x55')](_0x323148[_0xd6cd('0x7')])));var _0x3d0edb=fs['createWriteStream'](_0x21512c);var _0x18e1c4=archiver(_0xd6cd('0x56'),{'zlib':{'level':0x9}});_0x18e1c4['on'](_0xd6cd('0x57'),function(_0x21813c){if(_0x21813c[_0xd6cd('0x58')]===_0xd6cd('0x59')){logger[_0xd6cd('0x31')](_0x21813c);}else{throw new db[(_0xd6cd('0x5a'))][(_0xd6cd('0x5b'))](_0xd6cd('0x5c'));}});_0x18e1c4['on'](_0xd6cd('0x31'),function(_0x297474){throw new db[(_0xd6cd('0x5a'))][(_0xd6cd('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x18e1c4['pipe'](_0x3d0edb);_0x18e1c4[_0xd6cd('0x5d')](_0xd6cd('0x5e'),{'cwd':path['join'](config['root'],_0xd6cd('0x53'),path[_0xd6cd('0x5f')](_0x323148[_0xd6cd('0x7')])),'ignore':[path[_0xd6cd('0x52')](path[_0xd6cd('0x55')](_0x323148[_0xd6cd('0x7')]),'node_modules/**/*'),path[_0xd6cd('0x52')](path['basename'](_0x323148[_0xd6cd('0x7')]),_0xd6cd('0x60'))],'nodir':!![]})[_0xd6cd('0x61')]();_0x3d0edb['on'](_0xd6cd('0x62'),function(){if(!fs[_0xd6cd('0x63')](_0x21512c)){throw new db[(_0xd6cd('0x5a'))]['Error'](_0xd6cd('0x64'));}return _0x3b09fa['download'](_0x21512c,util[_0xd6cd('0x65')](_0xd6cd('0x54'),path[_0xd6cd('0x55')](_0x323148[_0xd6cd('0x7')])),function(_0x2a7809){if(_0x2a7809){throw new db[(_0xd6cd('0x5a'))][(_0xd6cd('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xd6cd('0x66')](_0x21512c);logger[_0xd6cd('0x67')](_0xd6cd('0x68'));logger[_0xd6cd('0x67')](_0xd6cd('0x69'));});});}return null;})[_0xd6cd('0x4d')](handleError(_0x3b09fa,null));};exports[_0xd6cd('0x6a')]=function(_0x5c8df7,_0x29bc57,_0x9e1637){var _0x1085d8=path[_0xd6cd('0x55')](_0x5c8df7[_0xd6cd('0x6b')][_0xd6cd('0x6c')],path[_0xd6cd('0x6d')](_0x5c8df7['file']['filename']));var _0x47301a=path['join'](config[_0xd6cd('0x6e')],_0xd6cd('0x53'),_0x5c8df7[_0xd6cd('0x6b')][_0xd6cd('0x6c')]);var _0x34e645=path[_0xd6cd('0x52')](config[_0xd6cd('0x6e')],_0xd6cd('0x53'),_0x1085d8);logger[_0xd6cd('0x67')](_0xd6cd('0x6f'),_0x47301a);logger[_0xd6cd('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x34e645);try{fs[_0xd6cd('0x70')](_0x47301a,parseInt('0777',0x8));extract(_0x47301a,{'dir':_0x34e645},function(_0x2cba05){if(_0x2cba05){logger['error'](_0x2cba05);handleError(_0x2cba05,!![]);};var _0x597736=fs['readdirSync'](_0x34e645);if(_0x597736['length']>0x1){removeReferences(_0x47301a,_0x34e645);logger[_0xd6cd('0x31')](_0xd6cd('0x71'));return _0x9e1637(new Error(_0xd6cd('0x71')));}var _0x4b736f=fs[_0xd6cd('0x72')](path[_0xd6cd('0x52')](_0x34e645,_0x597736[0x0]));if(_0x4b736f[_0xd6cd('0x73')]()){removeReferences(_0x47301a,_0x34e645);logger[_0xd6cd('0x31')](_0xd6cd('0x71'));return _0x9e1637(new Error(_0xd6cd('0x71')));}if(_0x4b736f[_0xd6cd('0x74')]()){var _0x3797f1=fs[_0xd6cd('0x75')](path['join'](_0x34e645,_0x597736[0x0]));if(_0x3797f1[_0xd6cd('0x3f')]===0x0){removeReferences(_0x47301a,_0x34e645);logger[_0xd6cd('0x31')]('Invalid\x20plugin\x20structure');return _0x9e1637(new Error('Invalid\x20plugin\x20structure'));}var _0x4ad83f=_0x3797f1[_0xd6cd('0x76')](function(_0x3a6875){return _0x3a6875==='manifest.json';});if(!_0x4ad83f){return _0x9e1637(new Error(_0xd6cd('0x77')));}var _0xe23955=fs[_0xd6cd('0x78')](path[_0xd6cd('0x52')](_0x34e645,_0x597736[0x0],_0xd6cd('0x79')));var _0x1abb11=JSON['parse'](_0xe23955);if(_0xd6cd('0x7a')==typeof _0x1abb11['name']){return _0x9e1637(new Error(_0xd6cd('0x7b')));}if(_0xd6cd('0x7a')==typeof _0x1abb11['type']){return _0x9e1637(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xd6cd('0x7a')==typeof _0x1abb11['version']){return _0x9e1637(new Error(_0xd6cd('0x7c')));}if('undefined'==typeof _0x1abb11[_0xd6cd('0x7d')]){return _0x9e1637(new Error(_0xd6cd('0x7e')));}if(_0x1abb11['type']===_0xd6cd('0x7f')){if(_0xd6cd('0x7a')==typeof _0x1abb11['parameters']['views']){return _0x9e1637(new Error(_0xd6cd('0x80')));}if(_0xd6cd('0x7a')==typeof _0x1abb11[_0xd6cd('0x7d')]['views'][_0xd6cd('0x81')]&&_0xd6cd('0x7a')==typeof _0x1abb11['parameters']['views']['agent']){return _0x9e1637(new Error(_0xd6cd('0x82')));}}else if(_0x1abb11['type']===_0xd6cd('0x83')){if('undefined'==typeof _0x1abb11[_0xd6cd('0x7d')]['scriptName']){return _0x9e1637(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x1abb11['parameters'][_0xd6cd('0x84')]){return _0x9e1637(new Error(_0xd6cd('0x85')));}}else{return _0x9e1637(new Error(_0xd6cd('0x86')));}var _0x5dfaf9=_0x1abb11[_0xd6cd('0x32')];var _0x26e1bb=_0x1abb11[_0xd6cd('0x87')];var _0x2b1fa5=_0x1abb11[_0xd6cd('0x37')];var _0x1a4c99=_0x1abb11[_0xd6cd('0x88')]?_0x1abb11['sidebar']:_0xd6cd('0x89');var _0x238e13=_0x1abb11[_0xd6cd('0x8a')]?_0x1abb11[_0xd6cd('0x8a')]:_0xd6cd('0x8b');var _0x3a1e5a='';var _0x2df078='';var _0x59ed99='';var _0x491baa='';var _0x252b33=_0x1abb11['version'];if(_0x2b1fa5===_0xd6cd('0x7f')){if(_0xd6cd('0x7a')!=typeof _0x1abb11[_0xd6cd('0x7d')]['views'][_0xd6cd('0x81')]){var _0x3b0b8e=_0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x8c')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd6cd('0x8d')](_0x3b0b8e)){_0x3a1e5a=path[_0xd6cd('0x52')](_0xd6cd('0x8e'),_0x1085d8,_0x597736[0x0],_0x3b0b8e);}else{_0x3a1e5a=_0x3b0b8e;}}else{logger['info'](_0xd6cd('0x8f'));}if(_0xd6cd('0x7a')!=typeof _0x1abb11['parameters'][_0xd6cd('0x8c')][_0xd6cd('0x90')]){var _0x47d606=_0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x8c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd6cd('0x8d')](_0x47d606)){_0x2df078=path[_0xd6cd('0x52')]('plugins',_0x1085d8,_0x597736[0x0],_0x47d606);}else{_0x2df078=_0x47d606;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2b1fa5==='script'){_0x59ed99=_0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x91')];_0x491baa=_0x1abb11['parameters'][_0xd6cd('0x84')];if(_0xd6cd('0x7a')!=typeof _0x1abb11[_0xd6cd('0x7d')]['views']){if(_0xd6cd('0x7a')!=typeof _0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x8c')][_0xd6cd('0x81')]){var _0x3b0b8e=_0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x8c')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd6cd('0x8d')](_0x3b0b8e)){_0x3a1e5a=path[_0xd6cd('0x52')](_0xd6cd('0x8e'),_0x1085d8,_0x597736[0x0],_0x3b0b8e);}else{_0x3a1e5a=_0x3b0b8e;}}if(_0xd6cd('0x7a')!=typeof _0x1abb11['parameters']['views'][_0xd6cd('0x90')]){var _0x47d606=_0x1abb11[_0xd6cd('0x7d')][_0xd6cd('0x8c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd6cd('0x8d')](_0x47d606)){_0x2df078=path[_0xd6cd('0x52')](_0xd6cd('0x8e'),_0x1085d8,_0x597736[0x0],_0x47d606);}else{_0x2df078=_0x47d606;}}}}var _0x248aa2={'name':_0x5dfaf9,'description':_0x26e1bb,'path':path[_0xd6cd('0x52')](_0x1085d8,_0x597736[0x0]),'type':_0x2b1fa5,'sidebar':_0x1a4c99,'icon':_0x238e13,'adminUrl':_0x3a1e5a,'agentUrl':_0x2df078,'scriptName':_0x59ed99,'scriptPath':_0x491baa,'version':_0x252b33};removeReferences(_0x47301a,null);return db[_0xd6cd('0x34')][_0xd6cd('0x92')](_0x248aa2)[_0xd6cd('0x2c')](function(_0x4ff0ed){var _0x3ad72f={'role':_0x5c8df7[_0xd6cd('0x93')][_0xd6cd('0x94')],'userProfileId':_0x5c8df7[_0xd6cd('0x93')][_0xd6cd('0x95')]};if(!_0x3ad72f)throw new Error(_0xd6cd('0x96'));if(_0x3ad72f[_0xd6cd('0x94')]==='user'){var _0x38a62a=_0x4ff0ed[_0xd6cd('0x2e')]({'plain':!![]});return db[_0xd6cd('0x97')]['find']({'where':{'name':_0xd6cd('0x2f'),'userProfileId':_0x3ad72f[_0xd6cd('0x95')]},'raw':!![]})[_0xd6cd('0x2c')](function(_0x120fae){if(_0x120fae&&_0x120fae[_0xd6cd('0x98')]===0x0){return db[_0xd6cd('0x30')][_0xd6cd('0x92')]({'name':_0x38a62a[_0xd6cd('0x32')],'resourceId':_0x38a62a['id'],'type':_0x120fae[_0xd6cd('0x32')],'sectionId':_0x120fae['id']},{})[_0xd6cd('0x2c')](function(){return _0x4ff0ed;});}else{return _0x4ff0ed;}})[_0xd6cd('0x4d')](function(_0x19e9c2){logger[_0xd6cd('0x31')](_0xd6cd('0x99'),_0x19e9c2);throw _0x19e9c2;});}return _0x4ff0ed;})[_0xd6cd('0x2c')](respondWithResult(_0x29bc57,null))[_0xd6cd('0x4d')](handleError(_0x29bc57,null));}});}catch(_0x528e20){_0x29bc57[_0xd6cd('0x22')](0x1f4)[_0xd6cd('0x9a')](_0x528e20);}};function removeReferences(_0x3d8c1f,_0x3f7930){try{if(_0x3d8c1f){fs[_0xd6cd('0x66')](_0x3d8c1f);logger[_0xd6cd('0x67')](_0xd6cd('0x9b'));}if(_0x3f7930){rimraf(_0x3f7930,function(){});logger[_0xd6cd('0x67')](_0xd6cd('0x9c'));}}catch(_0xa6b6a3){logger['error'](_0xa6b6a3);}}exports[_0xd6cd('0x2b')]=function(_0x3178ab,_0x306a11,_0x46d098){return db[_0xd6cd('0x34')]['find']({'where':{'id':_0x3178ab[_0xd6cd('0x51')]['id']}})[_0xd6cd('0x2c')](handleEntityNotFound(_0x306a11,null))[_0xd6cd('0x2c')](saveUpdates(_0x3178ab[_0xd6cd('0x93')],null))['then'](respondWithResult(_0x306a11,null))['catch'](handleError(_0x306a11,null));};exports[_0xd6cd('0x9d')]=function(_0x24e135,_0xd5530d,_0x51484c){return db[_0xd6cd('0x34')][_0xd6cd('0x4f')]({'where':{'id':_0x24e135[_0xd6cd('0x51')]['id']}})[_0xd6cd('0x2c')](function(_0xad06ee){if(_0xad06ee){return _0xad06ee['destroy']();}})[_0xd6cd('0x2c')](function(_0x41bb75){rimraf(path[_0xd6cd('0x52')](config[_0xd6cd('0x6e')],_0xd6cd('0x53'),path['dirname'](_0x41bb75[_0xd6cd('0x7')])),function(){});return _0x41bb75;})[_0xd6cd('0x2c')](handleEntityNotFound(_0xd5530d,null))[_0xd6cd('0x2c')](respondWithStatusCode(_0xd5530d,null))['catch'](handleError(_0xd5530d,null));};exports[_0xd6cd('0x9e')]=function(_0xb0ee,_0x1672e7,_0x458991){return BPromise[_0xd6cd('0x9f')]()[_0xd6cd('0x2c')](function(){if(!_0xb0ee[_0xd6cd('0x3a')][_0xd6cd('0x7')]){throw new Error(_0xd6cd('0xa0'));}if(!_0xb0ee[_0xd6cd('0x3a')]['port']){throw new Error(_0xd6cd('0xa1'));}var _0x469340=_0xb0ee[_0xd6cd('0x3a')][_0xd6cd('0xa2')]?_0xb0ee[_0xd6cd('0x3a')][_0xd6cd('0xa2')]+':'+_0xb0ee[_0xd6cd('0x3a')]['port']:_0xd6cd('0xa3')+_0xb0ee['query'][_0xd6cd('0xa4')];var _0x229355=_0xb0ee['query']['json']?_0xb0ee[_0xd6cd('0x3a')]['json']:!![];var _0x5294e8=_0xb0ee[_0xd6cd('0x3a')][_0xd6cd('0xa5')]?_0xb0ee['query'][_0xd6cd('0xa5')]:null;var _0x4d1c0a={'method':_0xb0ee[_0xd6cd('0xa6')],'uri':util['format'](_0xd6cd('0xa7'),_0x469340,_0xb0ee['query']['path']),'json':_0x229355,'resolveWithFullResponse':!![],'encoding':_0x5294e8,'qs':_0xb0ee[_0xd6cd('0x3a')]};if(_0xb0ee[_0xd6cd('0xa8')]){_0x4d1c0a['headers']=_0xb0ee['headers'];if(_0x4d1c0a['headers'][_0xd6cd('0xa9')]){delete _0x4d1c0a[_0xd6cd('0xa8')][_0xd6cd('0xa9')];}}if(_0x4d1c0a['headers'][_0xd6cd('0xaa')]){delete _0x4d1c0a[_0xd6cd('0xa8')][_0xd6cd('0xaa')];}return rp(_0x4d1c0a);})[_0xd6cd('0x2c')](function(_0x52d4e7){if(_0x52d4e7){_0x1672e7[_0xd6cd('0xab')](_0x52d4e7['headers']);logger[_0xd6cd('0x67')](_0x52d4e7['body']);if(_['endsWith'](_0xb0ee[_0xd6cd('0x3a')][_0xd6cd('0x7')],_0xd6cd('0x50'))&&_0x52d4e7[_0xd6cd('0xac')]==0x1f4){return _0x1672e7['sendStatus'](_0x52d4e7[_0xd6cd('0xac')]);}else{return _0x1672e7['status'](_0x52d4e7[_0xd6cd('0xac')])[_0xd6cd('0x9a')](_0x52d4e7[_0xd6cd('0x93')]);}}else{return _0x1672e7[_0xd6cd('0x20')](0xc8);}})[_0xd6cd('0x4d')](handleError(_0x1672e7,null));};exports['webhookPost']=function(_0x3a7280,_0x138ec5,_0x46a385){return BPromise[_0xd6cd('0x9f')]()[_0xd6cd('0x2c')](function(){if(!_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0x7')]){throw new Error(_0xd6cd('0xa0'));}if(!_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0xa4')]){throw new Error(_0xd6cd('0xa1'));}var _0x404f16=_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0xa2')]?_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0xa2')]+':'+_0x3a7280['query'][_0xd6cd('0xa4')]:_0xd6cd('0xa3')+_0x3a7280['query']['port'];var _0x3adbac=_0x3a7280[_0xd6cd('0x3a')]['json']?_0x3a7280[_0xd6cd('0x3a')]['json']:!![];var _0x541e57=_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0xa5')]?_0x3a7280[_0xd6cd('0x3a')][_0xd6cd('0xa5')]:null;var _0x5c60ef={'method':_0x3a7280[_0xd6cd('0xa6')],'uri':util[_0xd6cd('0x65')](_0xd6cd('0xa7'),_0x404f16,_0x3a7280[_0xd6cd('0x3a')]['path']),'json':_0x3adbac,'resolveWithFullResponse':!![],'encoding':_0x541e57,'body':_0x3a7280[_0xd6cd('0x93')]};if(_0x3a7280[_0xd6cd('0xa8')]){_0x5c60ef[_0xd6cd('0xa8')]=_0x3a7280[_0xd6cd('0xa8')];if(_0x5c60ef[_0xd6cd('0xa8')][_0xd6cd('0xa9')]){delete _0x5c60ef[_0xd6cd('0xa8')][_0xd6cd('0xa9')];}}if(_0x5c60ef['headers'][_0xd6cd('0xaa')]){delete _0x5c60ef[_0xd6cd('0xa8')][_0xd6cd('0xaa')];}return rp(_0x5c60ef);})[_0xd6cd('0x2c')](function(_0x563f3a){if(_0x563f3a){_0x138ec5[_0xd6cd('0xab')](_0x563f3a['headers']);logger[_0xd6cd('0x67')](_0x563f3a[_0xd6cd('0x93')]);return _0x138ec5[_0xd6cd('0x22')](_0x563f3a[_0xd6cd('0xac')])[_0xd6cd('0x9a')](_0x563f3a['body']);}else{return _0x138ec5[_0xd6cd('0x20')](0xc8);}})[_0xd6cd('0x4d')](handleError(_0x138ec5,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index faa7518..eccbcec 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 _0xf8af=['Plugin','setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x181d28,_0xdbb6e7){var _0x4e3e5e=function(_0x232041){while(--_0x232041){_0x181d28['push'](_0x181d28['shift']());}};_0x4e3e5e(++_0xdbb6e7);}(_0xf8af,0x8b));var _0xff8a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf8af[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xff8a('0x0'));var Plugin=require('../../mysqldb')['db'][_0xff8a('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xff8a('0x2')](0x0);var events={'afterCreate':_0xff8a('0x3'),'afterUpdate':_0xff8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b1bb0){return function(_0x460bf6,_0x11cfa2,_0x3bd9c2){PluginEvents['emit'](_0x7b1bb0+':'+_0x460bf6['id'],_0x460bf6);PluginEvents['emit'](_0x7b1bb0,_0x460bf6);_0x3bd9c2(null);};}for(var e in events){if(events[_0xff8a('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xff8a('0x6')]=PluginEvents; \ No newline at end of file +var _0x02ca=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','Plugin'];(function(_0x51cb76,_0x42b592){var _0x238dd4=function(_0x4c5a91){while(--_0x4c5a91){_0x51cb76['push'](_0x51cb76['shift']());}};_0x238dd4(++_0x42b592);}(_0x02ca,0x97));var _0xa02c=function(_0x12bb47,_0xfb1cd1){_0x12bb47=_0x12bb47-0x0;var _0x358810=_0x02ca[_0x12bb47];return _0x358810;};'use strict';var EventEmitter=require(_0xa02c('0x0'));var Plugin=require('../../mysqldb')['db'][_0xa02c('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xa02c('0x2')](0x0);var events={'afterCreate':_0xa02c('0x3'),'afterUpdate':_0xa02c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x267a6c){return function(_0x18c88a,_0x31c03a,_0xb1afd3){PluginEvents[_0xa02c('0x5')](_0x267a6c+':'+_0x18c88a['id'],_0x18c88a);PluginEvents[_0xa02c('0x5')](_0x267a6c,_0x18c88a);_0xb1afd3(null);};}for(var e in events){if(events[_0xa02c('0x6')](e)){var event=events[e];Plugin[_0xa02c('0x7')](e,emitEvent(event));}}module[_0xa02c('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 349349d..f328fb3 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 _0x13a6=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x28e119,_0x18c655){var _0x18d03c=function(_0x241fb1){while(--_0x241fb1){_0x28e119['push'](_0x28e119['shift']());}};_0x18d03c(++_0x18c655);}(_0x13a6,0x9c));var _0x613a=function(_0x5ca51a,_0x11eda2){_0x5ca51a=_0x5ca51a-0x0;var _0x425471=_0x13a6[_0x5ca51a];return _0x425471;};'use strict';var _=require(_0x613a('0x0'));var util=require('util');var logger=require(_0x613a('0x1'))(_0x613a('0x2'));var moment=require(_0x613a('0x3'));var BPromise=require(_0x613a('0x4'));var rp=require(_0x613a('0x5'));var fs=require('fs');var path=require(_0x613a('0x6'));var rimraf=require(_0x613a('0x7'));var config=require(_0x613a('0x8'));var attributes=require(_0x613a('0x9'));module[_0x613a('0xa')]=function(_0x346f71,_0x44216c){return _0x346f71[_0x613a('0xb')](_0x613a('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd29f=['./plugin.attributes','exports','define','Plugin','plugins','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xe7e068,_0xeb3c64){var _0x4fd73e=function(_0x2b045a){while(--_0x2b045a){_0xe7e068['push'](_0xe7e068['shift']());}};_0x4fd73e(++_0xeb3c64);}(_0xd29f,0x13d));var _0xfd29=function(_0x36ee10,_0x3e4e4b){_0x36ee10=_0x36ee10-0x0;var _0x1ae7e8=_0xd29f[_0x36ee10];return _0x1ae7e8;};'use strict';var _=require(_0xfd29('0x0'));var util=require(_0xfd29('0x1'));var logger=require('../../config/logger')(_0xfd29('0x2'));var moment=require(_0xfd29('0x3'));var BPromise=require(_0xfd29('0x4'));var rp=require(_0xfd29('0x5'));var fs=require('fs');var path=require(_0xfd29('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd29('0x7'));module[_0xfd29('0x8')]=function(_0x11413a,_0x482d16){return _0x11413a[_0xfd29('0x9')](_0xfd29('0xa'),attributes,{'tableName':_0xfd29('0xb'),'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 6244e9a..a9cda68 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 _0x2884=['stringify','error','code','message','result','CreatePlugin','Plugin','create','options','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x57cc14,_0x5251f6){var _0x4cb999=function(_0x5725d4){while(--_0x5725d4){_0x57cc14['push'](_0x57cc14['shift']());}};_0x4cb999(++_0x5251f6);}(_0x2884,0x1eb));var _0x4288=function(_0x400da3,_0x55d4fa){_0x400da3=_0x400da3-0x0;var _0x1c7073=_0x2884[_0x400da3];return _0x1c7073;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4288('0x9')](config['redis'],{'host':_0x4288('0xa'),'port':0x18eb});var socket=require(_0x4288('0xb'))(new Redis(config['redis']));require(_0x4288('0xc'))[_0x4288('0xd')](socket);function respondWithRpcPromise(_0x41794a,_0x55c9ee,_0x55a4f7){return new BPromise(function(_0x5c0e2d,_0x42a234){return client[_0x4288('0xe')](_0x41794a,_0x55a4f7)[_0x4288('0xf')](function(_0x2445eb){logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');logger[_0x4288('0x12')](_0x4288('0x13'),_0x55c9ee,_0x4288('0x14'),JSON[_0x4288('0x15')](_0x2445eb));if(_0x2445eb['error']){if(_0x2445eb[_0x4288('0x16')][_0x4288('0x17')]===0x1f4){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x2445eb['error'][_0x4288('0x18')]);return _0x42a234(_0x2445eb['error'][_0x4288('0x18')]);}logger[_0x4288('0x16')](_0x4288('0x11'),_0x55c9ee,_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);return _0x5c0e2d(_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);}else{logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');_0x5c0e2d(_0x2445eb[_0x4288('0x19')][_0x4288('0x18')]);}})['catch'](function(_0x479d52){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x479d52);_0x42a234(_0x479d52);});});}exports[_0x4288('0x1a')]=function(_0x5e891c){var _0x24b071=this;return new Promise(function(_0x51d472,_0x865365){return db[_0x4288('0x1b')][_0x4288('0x1c')](_0x5e891c['body'],{'raw':_0x5e891c[_0x4288('0x1d')]?_0x5e891c[_0x4288('0x1d')][_0x4288('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4fc547){logger[_0x4288('0x10')](_0x4288('0x1a'),_0x5e891c);logger[_0x4288('0x12')](_0x4288('0x1a'),_0x5e891c,JSON[_0x4288('0x15')](_0x4fc547));_0x51d472(_0x4fc547);})[_0x4288('0x1f')](function(_0x500c1e){logger['error'](_0x4288('0x1a'),_0x500c1e[_0x4288('0x18')],_0x5e891c);_0x865365(_0x24b071['error'](0x1f4,_0x500c1e[_0x4288('0x18')]));});});}; \ No newline at end of file +var _0x5edf=['localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults'];(function(_0x35c7e8,_0x169de3){var _0x3957b7=function(_0x6eff8b){while(--_0x6eff8b){_0x35c7e8['push'](_0x35c7e8['shift']());}};_0x3957b7(++_0x169de3);}(_0x5edf,0x188));var _0xf5ed=function(_0x390b0a,_0x43078a){_0x390b0a=_0x390b0a-0x0;var _0x2a8b93=_0x5edf[_0x390b0a];return _0x2a8b93;};'use strict';var _=require(_0xf5ed('0x0'));var util=require('util');var moment=require(_0xf5ed('0x1'));var BPromise=require(_0xf5ed('0x2'));var rs=require(_0xf5ed('0x3'));var fs=require('fs');var Redis=require(_0xf5ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5ed('0x5'));var logger=require('../../config/logger')(_0xf5ed('0x6'));var config=require('../../config/environment');var jayson=require(_0xf5ed('0x7'));var client=jayson[_0xf5ed('0x8')]['http']({'port':0x232a});config[_0xf5ed('0x9')]=_[_0xf5ed('0xa')](config[_0xf5ed('0x9')],{'host':_0xf5ed('0xb'),'port':0x18eb});var socket=require(_0xf5ed('0xc'))(new Redis(config[_0xf5ed('0x9')]));require(_0xf5ed('0xd'))[_0xf5ed('0xe')](socket);function respondWithRpcPromise(_0x2d0e24,_0x4806ba,_0x2ce118){return new BPromise(function(_0x3c0648,_0x326bae){return client[_0xf5ed('0xf')](_0x2d0e24,_0x2ce118)[_0xf5ed('0x10')](function(_0x25d45a){logger[_0xf5ed('0x11')](_0xf5ed('0x12'),_0x4806ba,_0xf5ed('0x13'));logger['debug'](_0xf5ed('0x14'),_0x4806ba,_0xf5ed('0x13'),JSON[_0xf5ed('0x15')](_0x25d45a));if(_0x25d45a['error']){if(_0x25d45a[_0xf5ed('0x16')][_0xf5ed('0x17')]===0x1f4){logger[_0xf5ed('0x16')]('Plugin,\x20%s,\x20%s',_0x4806ba,_0x25d45a['error']['message']);return _0x326bae(_0x25d45a[_0xf5ed('0x16')][_0xf5ed('0x18')]);}logger[_0xf5ed('0x16')](_0xf5ed('0x12'),_0x4806ba,_0x25d45a[_0xf5ed('0x16')]['message']);return _0x3c0648(_0x25d45a['error'][_0xf5ed('0x18')]);}else{logger[_0xf5ed('0x11')](_0xf5ed('0x12'),_0x4806ba,_0xf5ed('0x13'));_0x3c0648(_0x25d45a[_0xf5ed('0x19')][_0xf5ed('0x18')]);}})[_0xf5ed('0x1a')](function(_0x3c87c6){logger[_0xf5ed('0x16')](_0xf5ed('0x12'),_0x4806ba,_0x3c87c6);_0x326bae(_0x3c87c6);});});}exports[_0xf5ed('0x1b')]=function(_0x260abe){var _0xc71cfa=this;return new Promise(function(_0x48f29d,_0x27ce9e){return db[_0xf5ed('0x1c')]['create'](_0x260abe['body'],{'raw':_0x260abe['options']?_0x260abe['options'][_0xf5ed('0x1d')]===undefined?!![]:![]:!![]})[_0xf5ed('0x10')](function(_0x316f69){logger[_0xf5ed('0x11')](_0xf5ed('0x1b'),_0x260abe);logger[_0xf5ed('0x1e')]('CreatePlugin',_0x260abe,JSON[_0xf5ed('0x15')](_0x316f69));_0x48f29d(_0x316f69);})['catch'](function(_0x2230aa){logger['error'](_0xf5ed('0x1b'),_0x2230aa[_0xf5ed('0x18')],_0x260abe);_0x27ce9e(_0xc71cfa[_0xf5ed('0x16')](0x1f4,_0x2230aa['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a852163..30a3bcc 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 _0x2e55=['removeListener','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x2e55,0x1bb));var _0x52e5=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x2e55[_0x1a3e23];return _0x5ee0d8;};'use strict';var PluginEvents=require(_0x52e5('0x0'));var events=[_0x52e5('0x1'),_0x52e5('0x2'),_0x52e5('0x3')];function createListener(_0x2449c8,_0x279604){return function(_0x355043){_0x279604[_0x52e5('0x4')](_0x2449c8,_0x355043);};}function removeListener(_0x464be9,_0x56daf4){return function(){PluginEvents[_0x52e5('0x5')](_0x464be9,_0x56daf4);};}exports['register']=function(_0x40c34c){for(var _0x229148=0x0,_0x961240=events[_0x52e5('0x6')];_0x229148<_0x961240;_0x229148++){var _0x261765=events[_0x229148];var _0x42c07b=createListener(_0x52e5('0x7')+_0x261765,_0x40c34c);PluginEvents['on'](_0x261765,_0x42c07b);}}; \ No newline at end of file +var _0xe2d0=['plugin:','./plugin.events','save','remove','removeListener','register','length'];(function(_0x3046d8,_0x19af5e){var _0x56ecb6=function(_0x4d50f9){while(--_0x4d50f9){_0x3046d8['push'](_0x3046d8['shift']());}};_0x56ecb6(++_0x19af5e);}(_0xe2d0,0x14a));var _0x0e2d=function(_0x22e751,_0x15633c){_0x22e751=_0x22e751-0x0;var _0x5c1f14=_0xe2d0[_0x22e751];return _0x5c1f14;};'use strict';var PluginEvents=require(_0x0e2d('0x0'));var events=[_0x0e2d('0x1'),_0x0e2d('0x2'),'update'];function createListener(_0x18f3c8,_0x5664c6){return function(_0x20e1f0){_0x5664c6['emit'](_0x18f3c8,_0x20e1f0);};}function removeListener(_0x488b3d,_0x22fd54){return function(){PluginEvents[_0x0e2d('0x3')](_0x488b3d,_0x22fd54);};}exports[_0x0e2d('0x4')]=function(_0x42cff3){for(var _0x558f52=0x0,_0x2fba49=events[_0x0e2d('0x5')];_0x558f52<_0x2fba49;_0x558f52++){var _0x33ca73=events[_0x558f52];var _0x3dbbaf=createListener(_0x0e2d('0x6')+_0x33ca73,_0x42cff3);PluginEvents['on'](_0x33ca73,_0x3dbbaf);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 03f072f..ce4ae99 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(_0x84e532,_0x59a0eb){var _0x2a8bfe=function(_0x53e0fe){while(--_0x53e0fe){_0x84e532['push'](_0x84e532['shift']());}};_0x2a8bfe(++_0x59a0eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x4793fa,_0x55cc7c){var _0x4ef370=function(_0xbd532f){while(--_0xbd532f){_0x4793fa['push'](_0x4793fa['shift']());}};_0x4ef370(++_0x55cc7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 28dd83f..34411f8 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 _0x16d2=['cwd','chdir','start','dump','update','stop','send','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','express','motion2','length','then','catch','show','params','create','body','script','join'];(function(_0x446e71,_0x43dc1e){var _0x3fd150=function(_0x54e99e){while(--_0x54e99e){_0x446e71['push'](_0x446e71['shift']());}};_0x3fd150(++_0x43dc1e);}(_0x16d2,0x123));var _0x216d=function(_0x6ba442,_0x171341){_0x6ba442=_0x6ba442-0x0;var _0x277c57=_0x16d2[_0x6ba442];return _0x277c57;};'use strict';var _=require(_0x216d('0x0'));var pm2=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var path=require(_0x216d('0x4'));var exec=require(_0x216d('0x5'))[_0x216d('0x6')];var BPromise=require(_0x216d('0x7'));function handleEntityNotFound(_0xfd7306,_0x593bb0){return function(_0x2c662d){if(!_0x2c662d){_0xfd7306[_0x216d('0x8')](0x194);;}return _0x2c662d;};}function respondWithResult(_0xef687c,_0x205101){_0x205101=_0x205101||0xc8;return function(_0x1dd8e2){if(_0x1dd8e2){return _0xef687c[_0x216d('0x9')](_0x205101)[_0x216d('0xa')](_0x1dd8e2);}return null;};}function handleError(_0x28da14,_0x57accc){_0x57accc=_0x57accc||0x1f4;return function(_0x22c7b3){logger[_0x216d('0xb')](_0x22c7b3[_0x216d('0xc')]);if(_0x22c7b3[_0x216d('0xd')]){delete _0x22c7b3[_0x216d('0xd')];}_0x28da14[_0x216d('0x9')](_0x57accc)['send'](_0x22c7b3);};}function execChildProcess(){return new BPromise(function(_0x7ca9c9,_0x50db30){exec(_0x216d('0xe'),function(_0x2e02ce,_0x332e30,_0x398970){logger[_0x216d('0xf')](_0x332e30);logger[_0x216d('0xf')](_0x398970);if(_0x2e02ce){logger['error'](_0x2e02ce);return _0x50db30(_0x2e02ce);}return _0x7ca9c9(_0x332e30);});});}exports[_0x216d('0x10')]=function(_0x4c07d0,_0x271bb1){return pm2[_0x216d('0x11')]()['then'](function(_0x165c19){if(_0x165c19){var _0x322e4b=_['reject'](_0x165c19,function(_0x1b3215){return _0x1b3215['name']===_0x216d('0x12')||_0x1b3215[_0x216d('0xd')]===_0x216d('0x13');});return{'rows':_0x322e4b,'count':_0x322e4b[_0x216d('0x14')]};}return null;})[_0x216d('0x15')](respondWithResult(_0x271bb1,null))[_0x216d('0x16')](handleError(_0x271bb1,null));};exports[_0x216d('0x17')]=function(_0x1496fe,_0x19fdac){return pm2['describe'](_0x1496fe[_0x216d('0x18')]['id'])['then'](respondWithResult(_0x19fdac,null))['then'](handleEntityNotFound(_0x19fdac,null))[_0x216d('0x16')](handleError(_0x19fdac,null));};exports[_0x216d('0x19')]=function(_0x574758,_0x3f32e0){if(_0x574758[_0x216d('0x1a')]['name']&&_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]){var _0x430e81=path[_0x216d('0x1c')](__dirname,'../../files/plugins',_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]);var _0x10f299=process[_0x216d('0x1d')]();process[_0x216d('0x1e')](path['dirname'](_0x430e81));return execChildProcess()[_0x216d('0x15')](function(_0x1bd4db){process[_0x216d('0x1e')](_0x10f299);return pm2[_0x216d('0x1f')]({'name':_0x574758[_0x216d('0x1a')]['name'],'script':_0x430e81});})[_0x216d('0x15')](function(_0xab672){pm2[_0x216d('0x20')]();return _0xab672[0x0];})['then'](respondWithResult(_0x3f32e0,0xc9))['catch'](handleError(_0x3f32e0,null));}else{return _0x3f32e0['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x216d('0x21')]=function(_0x470d8a,_0x189413){if(_0x470d8a[_0x216d('0x1a')]['id']){delete _0x470d8a[_0x216d('0x1a')]['id'];}var _0x47fa6d={'online':'restart','stopped':_0x216d('0x22')};if(_0x47fa6d['hasOwnProperty'](_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')])){return pm2[_0x47fa6d[_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')]]](_0x470d8a[_0x216d('0x18')]['id'])[_0x216d('0x15')](respondWithResult(_0x189413,0xc8))[_0x216d('0x16')](handleError(_0x189413,null));}else{return _0x189413[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x24')});}};exports[_0x216d('0x25')]=function(_0x260134,_0x4537fd){if(_0x260134['body']['id']){delete _0x260134[_0x216d('0x1a')]['id'];}if(_0x260134[_0x216d('0x18')]['id']){return pm2[_0x216d('0x26')](_0x260134['params']['id'])[_0x216d('0x15')](function(_0x1743ee){pm2[_0x216d('0x20')]();return _0x1743ee[0x0];})[_0x216d('0x15')](respondWithResult(_0x4537fd,null))['catch'](handleError(_0x4537fd,null));}else{return _0x4537fd[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x27')});}}; \ No newline at end of file +var _0x34e5=['info','error','list','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','name','npm\x20install'];(function(_0x1d69ed,_0xb41917){var _0x474b6a=function(_0x4adf65){while(--_0x4adf65){_0x1d69ed['push'](_0x1d69ed['shift']());}};_0x474b6a(++_0xb41917);}(_0x34e5,0x172));var _0x534e=function(_0x3e5a7e,_0x1921b9){_0x3e5a7e=_0x3e5a7e-0x0;var _0x1b29ab=_0x34e5[_0x3e5a7e];return _0x1b29ab;};'use strict';var _=require('lodash');var pm2=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var path=require(_0x534e('0x2'));var exec=require(_0x534e('0x3'))[_0x534e('0x4')];var BPromise=require(_0x534e('0x5'));function handleEntityNotFound(_0x50b790,_0x11a158){return function(_0x3d8287){if(!_0x3d8287){_0x50b790[_0x534e('0x6')](0x194);;}return _0x3d8287;};}function respondWithResult(_0x117f0c,_0x436a92){_0x436a92=_0x436a92||0xc8;return function(_0x2d0370){if(_0x2d0370){return _0x117f0c[_0x534e('0x7')](_0x436a92)['json'](_0x2d0370);}return null;};}function handleError(_0x24d562,_0x929597){_0x929597=_0x929597||0x1f4;return function(_0xa836bb){logger['error'](_0xa836bb['stack']);if(_0xa836bb[_0x534e('0x8')]){delete _0xa836bb['name'];}_0x24d562[_0x534e('0x7')](_0x929597)['send'](_0xa836bb);};}function execChildProcess(){return new BPromise(function(_0xb30dd6,_0x310b6d){exec(_0x534e('0x9'),function(_0x529726,_0x1b7a5a,_0x229352){logger[_0x534e('0xa')](_0x1b7a5a);logger[_0x534e('0xa')](_0x229352);if(_0x529726){logger[_0x534e('0xb')](_0x529726);return _0x310b6d(_0x529726);}return _0xb30dd6(_0x1b7a5a);});});}exports['index']=function(_0x31d764,_0x23c11c){return pm2[_0x534e('0xc')]()[_0x534e('0xd')](function(_0x359565){if(_0x359565){var _0x478027=_[_0x534e('0xe')](_0x359565,function(_0x17c068){return _0x17c068[_0x534e('0x8')]==='express'||_0x17c068[_0x534e('0x8')]===_0x534e('0xf');});return{'rows':_0x478027,'count':_0x478027['length']};}return null;})['then'](respondWithResult(_0x23c11c,null))[_0x534e('0x10')](handleError(_0x23c11c,null));};exports[_0x534e('0x11')]=function(_0x9297b6,_0x16ad40){return pm2[_0x534e('0x12')](_0x9297b6[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x16ad40,null))['then'](handleEntityNotFound(_0x16ad40,null))[_0x534e('0x10')](handleError(_0x16ad40,null));};exports[_0x534e('0x14')]=function(_0x466d74,_0x1bef0a){if(_0x466d74[_0x534e('0x15')]['name']&&_0x466d74[_0x534e('0x15')][_0x534e('0x16')]){var _0x5f9ae9=path[_0x534e('0x17')](__dirname,_0x534e('0x18'),_0x466d74[_0x534e('0x15')][_0x534e('0x16')]);var _0x85188b=process[_0x534e('0x19')]();process['chdir'](path[_0x534e('0x1a')](_0x5f9ae9));return execChildProcess()[_0x534e('0xd')](function(_0x39466c){process[_0x534e('0x1b')](_0x85188b);return pm2[_0x534e('0x1c')]({'name':_0x466d74[_0x534e('0x15')][_0x534e('0x8')],'script':_0x5f9ae9});})[_0x534e('0xd')](function(_0x53a6ef){pm2[_0x534e('0x1d')]();return _0x53a6ef[0x0];})['then'](respondWithResult(_0x1bef0a,0xc9))[_0x534e('0x10')](handleError(_0x1bef0a,null));}else{return _0x1bef0a[_0x534e('0x7')](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x1f')});}};exports[_0x534e('0x20')]=function(_0x57b216,_0x743974){if(_0x57b216[_0x534e('0x15')]['id']){delete _0x57b216['body']['id'];}var _0x4bd073={'online':_0x534e('0x21'),'stopped':'stop'};if(_0x4bd073[_0x534e('0x22')](_0x57b216[_0x534e('0x15')][_0x534e('0x7')])){return pm2[_0x4bd073[_0x57b216[_0x534e('0x15')][_0x534e('0x7')]]](_0x57b216[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x743974,0xc8))['catch'](handleError(_0x743974,null));}else{return _0x743974['status'](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x23')});}};exports[_0x534e('0x24')]=function(_0x2f1c49,_0x423502){if(_0x2f1c49[_0x534e('0x15')]['id']){delete _0x2f1c49[_0x534e('0x15')]['id'];}if(_0x2f1c49[_0x534e('0x13')]['id']){return pm2[_0x534e('0x25')](_0x2f1c49[_0x534e('0x13')]['id'])[_0x534e('0xd')](function(_0x1d6fb1){pm2['dump']();return _0x1d6fb1[0x0];})[_0x534e('0xd')](respondWithResult(_0x423502,null))[_0x534e('0x10')](handleError(_0x423502,null));}else{return _0x423502['status'](0x1f4)[_0x534e('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 57653bb..8e10bb3 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 _0x1574=['express','Router','../../components/auth/service','./realtime.controller','/queues','isAuthenticated','getQueues','exports'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x1574,0x148));var _0x4157=function(_0x1bad5d,_0x452ae5){_0x1bad5d=_0x1bad5d-0x0;var _0x122167=_0x1574[_0x1bad5d];return _0x122167;};'use strict';var express=require(_0x4157('0x0'));var router=express[_0x4157('0x1')]();var auth=require(_0x4157('0x2'));var controller=require(_0x4157('0x3'));router['get'](_0x4157('0x4'),auth[_0x4157('0x5')](),controller[_0x4157('0x6')]);module[_0x4157('0x7')]=router; \ No newline at end of file +var _0xa775=['express','../../components/auth/service','/queues','isAuthenticated','getQueues','exports'];(function(_0x174557,_0x490ada){var _0x60c90b=function(_0xb494c6){while(--_0xb494c6){_0x174557['push'](_0x174557['shift']());}};_0x60c90b(++_0x490ada);}(_0xa775,0xf6));var _0x5a77=function(_0x3c91a8,_0xf7c601){_0x3c91a8=_0x3c91a8-0x0;var _0x8beb52=_0xa775[_0x3c91a8];return _0x8beb52;};'use strict';var express=require(_0x5a77('0x0'));var router=express['Router']();var auth=require(_0x5a77('0x1'));var controller=require('./realtime.controller');router['get'](_0x5a77('0x2'),auth[_0x5a77('0x3')](),controller[_0x5a77('0x4')]);module[_0x5a77('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index dcbcf85..93199f7 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 _0x5162=['mail','chat','sms','openchannel','fax','voice','resolve','channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','request','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','paused','agents','find','merge','pick','getAgents','online','getMembers','length','UserId','loggedInDb','User','findAll','QueueId','all','catch','util','api','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','json','error','stack','name','status','send','getQueues'];(function(_0x2e9c83,_0x482cd5){var _0x58f892=function(_0x42a0f6){while(--_0x42a0f6){_0x2e9c83['push'](_0x2e9c83['shift']());}};_0x58f892(++_0x482cd5);}(_0x5162,0x103));var _0x2516=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0x5162[_0x2ccb91];return _0x4136ca;};'use strict';var util=require(_0x2516('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var client=jayson[_0x2516('0x3')][_0x2516('0x4')]({'port':0x232a});var routingClient=jayson[_0x2516('0x3')][_0x2516('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x3a7984,_0x5b71b5){return function(_0x48f411){if(_0x48f411){var _0x5beeb3=typeof _0x5b71b5[_0x2516('0x5')]===_0x2516('0x6')&&typeof _0x5b71b5[_0x2516('0x7')]===_0x2516('0x6');var _0x3abc5d=_0x48f411[_0x2516('0x8')];var _0x1cb817=_0x5beeb3?0x0:_0x5b71b5['offset'];var _0x409550=_0x5beeb3?_0x48f411[_0x2516('0x8')]:_0x5b71b5[_0x2516('0x5')]+_0x5b71b5['limit'];var _0x530b1b;if(_0x409550>=_0x3abc5d){_0x409550=_0x3abc5d;_0x530b1b=0xc8;}else{_0x530b1b=0xce;}_0x3a7984['status'](_0x530b1b);return _0x3a7984['set'](_0x2516('0x9'),_0x1cb817+'-'+_0x409550+'/'+_0x3abc5d)[_0x2516('0xa')](_0x48f411);}return null;};}function handleError(_0x310d1a,_0x3ef6ff){_0x3ef6ff=_0x3ef6ff||0x1f4;return function(_0x56c69c){logger[_0x2516('0xb')](_0x56c69c[_0x2516('0xc')]);if(_0x56c69c[_0x2516('0xd')]){delete _0x56c69c[_0x2516('0xd')];}_0x310d1a[_0x2516('0xe')](_0x3ef6ff)[_0x2516('0xf')](_0x56c69c);};}exports[_0x2516('0x10')]=function(_0x2edb47,_0x1b3c7e){var _0x181a28=[_0x2516('0x11'),_0x2516('0x12'),_0x2516('0x13'),_0x2516('0x14'),_0x2516('0x15'),'whatsapp',_0x2516('0x16')];var _0x1ced29={'count':0x0,'rows':[]},_0x1a1005={},_0x564d05;Promise[_0x2516('0x17')]()['then'](function(){if(_0x2edb47['query'][_0x2516('0x18')]){if(!_[_0x2516('0x19')](_0x181a28,_0x2edb47[_0x2516('0x1a')][_0x2516('0x18')][_0x2516('0x1b')]()))throw new Error(_0x2516('0x1c'));_0x564d05=_0x2edb47[_0x2516('0x1a')][_0x2516('0x18')][_0x2516('0x1b')]();}var _0x37485b=_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x1e');var _0x1b0831=_['map'](db[_0x37485b]['rawAttributes'],function(_0x12db4d){return{'name':_0x12db4d[_0x2516('0x1f')],'type':_0x12db4d[_0x2516('0x20')][_0x2516('0x21')]};});_0x1a1005=qs[_0x2516('0x22')](_0x1b0831,_0x2edb47);if(_0x2edb47[_0x2516('0x23')][_0x2516('0x24')]===_0x2516('0x23')){var _0x4b1d4f={'params':{'id':_0x2edb47[_0x2516('0x23')][_0x2516('0x25')]},'query':{'section':_0x564d05===_0x2516('0x16')&&_0x2edb47[_0x2516('0x1a')]['type']===_0x2516('0x26')?_0x2516('0x27'):_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x28'),'type':_0x2edb47[_0x2516('0x1a')]['type'],'nolimit':!![],'sort':_0x2516('0xd'),'filter':_0x2edb47[_0x2516('0x1a')][_0x2516('0x29')]}};return db[_0x2516('0x2a')][_0x2516('0x2b')](_0x4b1d4f);}return db[_0x37485b][_0x2516('0x2c')](_0x1a1005);})['then'](function(_0x136893){_0x1ced29[_0x2516('0x8')]=_0x136893['count'];var _0x19d90d=_0x564d05===_0x2516('0x16')?client:routingClient;return _0x19d90d[_0x2516('0x2d')](_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x28'),_0x2edb47)[_0x2516('0x2e')](function(_0x2e92f2){if(_0x2e92f2[_0x2516('0xb')])throw new Error(util[_0x2516('0x2f')](_0x2516('0x30'),_0x564d05));var _0xc0d4a9=_0x2e92f2[_0x2516('0x31')];var _0x2a5346=[_0x2516('0x32'),_0x2516('0x33'),'waiting',_0x2516('0x34'),'paused'];if(_0x564d05===_0x2516('0x16')&&_0x2edb47['query'][_0x2516('0x20')]==='outbound'){_0x2a5346[_0x2516('0x35')](_0x2516('0x36'),_0x2516('0x37'),_0x2516('0x38'),_0x2516('0x39'),_0x2516('0x3a'),_0x2516('0x3b'),_0x2516('0x3c'),_0x2516('0x3d'),'erlangCalls',_0x2516('0x3e'),_0x2516('0x3f'),_0x2516('0x40'),_0x2516('0x41'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x2516('0x42'),_0x2516('0x43'),_0x2516('0x44'),_0x2516('0x45'),_0x2516('0x46'),_0x2516('0x47'),_0x2516('0x48'));}var _0x1bc9ee=_0x136893[_0x2516('0x49')][_0x2516('0x4a')](function(_0x541d69){var _0x4844a1=_0x541d69[_0x2516('0x4b')]({'plain':!![]});_0x4844a1[_0x2516('0x4c')]=0x0;_0x4844a1['loggedInDb']=0x0;_0x4844a1['loggedIn']=0x0;_0x4844a1[_0x2516('0x33')]=0x0;_0x4844a1[_0x2516('0x4c')]=0x0;_0x4844a1['waiting']=0x0;if(_0x564d05===_0x2516('0x16')){_0x4844a1['talking']=0x0;if(_0x2edb47[_0x2516('0x1a')][_0x2516('0x20')]==='outbound'){_0x4844a1[_0x2516('0x36')]=0x0;_0x4844a1[_0x2516('0x37')]=0x0;}}_0x4844a1[_0x2516('0x4d')]=[];var _0x194c9d=_[_0x2516('0x4e')](_0xc0d4a9[_0x2516('0x49')],['id',_0x4844a1['id']]);if(_0x194c9d)_[_0x2516('0x4f')](_0x4844a1,_[_0x2516('0x50')](_0x194c9d,_0x2a5346));if(_0x564d05===_0x2516('0x16')){return _0x541d69[_0x2516('0x51')]({'attributes':['id',_0x2516('0xd'),_0x2516('0x52')],'joinTableAttributes':[],'raw':!![]})[_0x2516('0x2e')](function(_0x4c832b){return _0x541d69[_0x2516('0x53')]({'raw':!![]})[_0x2516('0x2e')](function(_0x5debf2){for(var _0xfd6236=0x0;_0xfd6236<_0x4c832b[_0x2516('0x54')];_0xfd6236++){var _0x2eadc7=_[_0x2516('0x4e')](_0x5debf2,[_0x2516('0x55'),_0x4c832b[_0xfd6236]['id']]);var _0x582cb6={'id':_0x4c832b[_0xfd6236]['id'],'name':_0x4c832b[_0xfd6236][_0x2516('0xd')],'online':Boolean(_0x4c832b[_0xfd6236][_0x2516('0x52')]),'paused':_0x2eadc7?Boolean(_0x2eadc7[_0x2516('0x4c')]):![]};if(_0x582cb6[_0x2516('0x52')])_0x4844a1[_0x2516('0x56')]++;if(_0x582cb6[_0x2516('0x4c')])_0x4844a1['paused']++;_0x4844a1[_0x2516('0x4d')][_0x2516('0x35')](_0x582cb6);}return _0x4844a1;});});}else{var _0xe64acc=_0x2516('0x57')+_[_0x2516('0x1d')](_0x564d05)+_0x2516('0x1e');var _0x18027f=_0x564d05+'Pause';return db[_0xe64acc][_0x2516('0x58')]({'where':{[_['startCase'](_0x564d05)+_0x2516('0x59')]:_0x541d69['id']},'raw':!![]})['then'](function(_0x396be6){return db[_0x2516('0x57')][_0x2516('0x58')]({'attributes':['id','name','online',_0x18027f],'where':{'id':_[_0x2516('0x4a')](_0x396be6,_0x2516('0x55')),'role':'agent'},'raw':!![]});})['then'](function(_0x33ed52){for(var _0x147e05=0x0;_0x147e05<_0x33ed52[_0x2516('0x54')];_0x147e05++){var _0x53e61c={'id':_0x33ed52[_0x147e05]['id'],'name':_0x33ed52[_0x147e05][_0x2516('0xd')],'online':Boolean(_0x33ed52[_0x147e05]['online']),'paused':Boolean(_0x33ed52[_0x147e05][_0x18027f])};if(_0x53e61c[_0x2516('0x52')])_0x4844a1[_0x2516('0x56')]++;if(_0x53e61c[_0x2516('0x4c')])_0x4844a1[_0x2516('0x4c')]++;_0x4844a1['agents'][_0x2516('0x35')](_0x53e61c);}return _0x4844a1;});}});return Promise[_0x2516('0x5a')](_0x1bc9ee);});})[_0x2516('0x2e')](function(_0x236048){_0x1ced29[_0x2516('0x49')]=_0x236048;return _0x1ced29;})['then'](respondWithFilteredResult(_0x1b3c7e,_0x1a1005))[_0x2516('0x5b')](handleError(_0x1b3c7e,null));}; \ No newline at end of file +var _0x6050=['Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','loggedInDb','rows','merge','pick','getMembers','length','find','UserId','online','agents','User','findAll','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','limit','undefined','count','offset','status','set','Content-Range','json','error','stack','name','send','getQueues','mail','openchannel','fax','whatsapp','voice','resolve','then','query','channel','includes','Invalid\x20channel','toLowerCase','startCase','Queue','map','type','key','getOptions','user','role','userProfileId','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6050,0x196));var _0x0605=function(_0x25fb2d,_0x368070){_0x25fb2d=_0x25fb2d-0x0;var _0x4b6432=_0x6050[_0x25fb2d];return _0x4b6432;};'use strict';var util=require(_0x0605('0x0'));var _=require(_0x0605('0x1'));var jayson=require(_0x0605('0x2'));var qs=require(_0x0605('0x3'));var logger=require(_0x0605('0x4'))(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var client=jayson[_0x0605('0x6')][_0x0605('0x7')]({'port':0x232a});var routingClient=jayson[_0x0605('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x533b6d,_0x4aca21){return function(_0xd78d96){if(_0xd78d96){var _0x578623=typeof _0x4aca21['offset']==='undefined'&&typeof _0x4aca21[_0x0605('0x8')]===_0x0605('0x9');var _0xa08eca=_0xd78d96[_0x0605('0xa')];var _0x44fdd3=_0x578623?0x0:_0x4aca21['offset'];var _0x1882e6=_0x578623?_0xd78d96[_0x0605('0xa')]:_0x4aca21[_0x0605('0xb')]+_0x4aca21[_0x0605('0x8')];var _0x203772;if(_0x1882e6>=_0xa08eca){_0x1882e6=_0xa08eca;_0x203772=0xc8;}else{_0x203772=0xce;}_0x533b6d[_0x0605('0xc')](_0x203772);return _0x533b6d[_0x0605('0xd')](_0x0605('0xe'),_0x44fdd3+'-'+_0x1882e6+'/'+_0xa08eca)[_0x0605('0xf')](_0xd78d96);}return null;};}function handleError(_0x434e62,_0xd22e35){_0xd22e35=_0xd22e35||0x1f4;return function(_0x39e288){logger[_0x0605('0x10')](_0x39e288[_0x0605('0x11')]);if(_0x39e288[_0x0605('0x12')]){delete _0x39e288[_0x0605('0x12')];}_0x434e62[_0x0605('0xc')](_0xd22e35)[_0x0605('0x13')](_0x39e288);};}exports[_0x0605('0x14')]=function(_0x5b08ba,_0x2b4610){var _0x1a802b=[_0x0605('0x15'),'chat','sms',_0x0605('0x16'),_0x0605('0x17'),_0x0605('0x18'),_0x0605('0x19')];var _0xefc557={'count':0x0,'rows':[]},_0x351dbd={},_0x2b7b5a;Promise[_0x0605('0x1a')]()[_0x0605('0x1b')](function(){if(_0x5b08ba[_0x0605('0x1c')][_0x0605('0x1d')]){if(!_[_0x0605('0x1e')](_0x1a802b,_0x5b08ba[_0x0605('0x1c')][_0x0605('0x1d')]['toLowerCase']()))throw new Error(_0x0605('0x1f'));_0x2b7b5a=_0x5b08ba[_0x0605('0x1c')][_0x0605('0x1d')][_0x0605('0x20')]();}var _0x1e8c6d=_[_0x0605('0x21')](_0x2b7b5a)+_0x0605('0x22');var _0x2c90ed=_[_0x0605('0x23')](db[_0x1e8c6d]['rawAttributes'],function(_0xc334b8){return{'name':_0xc334b8['fieldName'],'type':_0xc334b8[_0x0605('0x24')][_0x0605('0x25')]};});_0x351dbd=qs[_0x0605('0x26')](_0x2c90ed,_0x5b08ba);if(_0x5b08ba[_0x0605('0x27')][_0x0605('0x28')]===_0x0605('0x27')){var _0x2ea61d={'params':{'id':_0x5b08ba[_0x0605('0x27')][_0x0605('0x29')]},'query':{'section':_0x2b7b5a===_0x0605('0x19')&&_0x5b08ba[_0x0605('0x1c')][_0x0605('0x24')]==='outbound'?_0x0605('0x2a'):_[_0x0605('0x21')](_0x2b7b5a)+'Queues','type':_0x5b08ba['query']['type'],'nolimit':!![],'sort':_0x0605('0x12'),'filter':_0x5b08ba[_0x0605('0x1c')][_0x0605('0x2b')]}};return db[_0x0605('0x2c')][_0x0605('0x2d')](_0x2ea61d);}return db[_0x1e8c6d][_0x0605('0x2e')](_0x351dbd);})['then'](function(_0x34f25d){_0xefc557['count']=_0x34f25d[_0x0605('0xa')];var _0x3640b9=_0x2b7b5a===_0x0605('0x19')?client:routingClient;return _0x3640b9[_0x0605('0x2f')](_[_0x0605('0x21')](_0x2b7b5a)+_0x0605('0x30'),_0x5b08ba)['then'](function(_0x165a0c){if(_0x165a0c[_0x0605('0x10')])throw new Error(util[_0x0605('0x31')](_0x0605('0x32'),_0x2b7b5a));var _0x25d397=_0x165a0c[_0x0605('0x33')];var _0x2db998=[_0x0605('0x34'),_0x0605('0x35'),_0x0605('0x36'),_0x0605('0x37'),_0x0605('0x38')];if(_0x2b7b5a===_0x0605('0x19')&&_0x5b08ba[_0x0605('0x1c')][_0x0605('0x24')]===_0x0605('0x39')){_0x2db998[_0x0605('0x3a')](_0x0605('0x3b'),_0x0605('0x3c'),_0x0605('0x3d'),_0x0605('0x3e'),_0x0605('0x3f'),_0x0605('0x40'),_0x0605('0x41'),_0x0605('0x42'),_0x0605('0x43'),_0x0605('0x44'),'erlangAbandonmentRate',_0x0605('0x45'),_0x0605('0x46'),'dialPredictiveIntervalMaxThreshold',_0x0605('0x47'),_0x0605('0x48'),'predictiveIntervalTotalCalls',_0x0605('0x49'),_0x0605('0x4a'),_0x0605('0x4b'),_0x0605('0x4c'),_0x0605('0x4d'));}var _0x17cd94=_0x34f25d['rows']['map'](function(_0x216f82){var _0x18f7f2=_0x216f82[_0x0605('0x4e')]({'plain':!![]});_0x18f7f2['paused']=0x0;_0x18f7f2[_0x0605('0x4f')]=0x0;_0x18f7f2['loggedIn']=0x0;_0x18f7f2[_0x0605('0x35')]=0x0;_0x18f7f2[_0x0605('0x38')]=0x0;_0x18f7f2[_0x0605('0x36')]=0x0;if(_0x2b7b5a===_0x0605('0x19')){_0x18f7f2[_0x0605('0x37')]=0x0;if(_0x5b08ba[_0x0605('0x1c')][_0x0605('0x24')]===_0x0605('0x39')){_0x18f7f2[_0x0605('0x3b')]=0x0;_0x18f7f2[_0x0605('0x3c')]=0x0;}}_0x18f7f2['agents']=[];var _0x3aa844=_['find'](_0x25d397[_0x0605('0x50')],['id',_0x18f7f2['id']]);if(_0x3aa844)_[_0x0605('0x51')](_0x18f7f2,_[_0x0605('0x52')](_0x3aa844,_0x2db998));if(_0x2b7b5a==='voice'){return _0x216f82['getAgents']({'attributes':['id',_0x0605('0x12'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x0605('0x1b')](function(_0x52f4b6){return _0x216f82[_0x0605('0x53')]({'raw':!![]})[_0x0605('0x1b')](function(_0x354f4e){for(var _0x3099b4=0x0;_0x3099b4<_0x52f4b6[_0x0605('0x54')];_0x3099b4++){var _0x1fdd42=_[_0x0605('0x55')](_0x354f4e,[_0x0605('0x56'),_0x52f4b6[_0x3099b4]['id']]);var _0x18d3ce={'id':_0x52f4b6[_0x3099b4]['id'],'name':_0x52f4b6[_0x3099b4][_0x0605('0x12')],'online':Boolean(_0x52f4b6[_0x3099b4][_0x0605('0x57')]),'paused':_0x1fdd42?Boolean(_0x1fdd42['paused']):![]};if(_0x18d3ce['online'])_0x18f7f2[_0x0605('0x4f')]++;if(_0x18d3ce['paused'])_0x18f7f2[_0x0605('0x38')]++;_0x18f7f2[_0x0605('0x58')]['push'](_0x18d3ce);}return _0x18f7f2;});});}else{var _0x44db50=_0x0605('0x59')+_['startCase'](_0x2b7b5a)+_0x0605('0x22');var _0x21d6d9=_0x2b7b5a+'Pause';return db[_0x44db50][_0x0605('0x5a')]({'where':{[_[_0x0605('0x21')](_0x2b7b5a)+'QueueId']:_0x216f82['id']},'raw':!![]})[_0x0605('0x1b')](function(_0x5e278f){return db['User'][_0x0605('0x5a')]({'attributes':['id',_0x0605('0x12'),_0x0605('0x57'),_0x21d6d9],'where':{'id':_[_0x0605('0x23')](_0x5e278f,_0x0605('0x56')),'role':_0x0605('0x5b')},'raw':!![]});})[_0x0605('0x1b')](function(_0x232c93){for(var _0x56190c=0x0;_0x56190c<_0x232c93[_0x0605('0x54')];_0x56190c++){var _0x415b31={'id':_0x232c93[_0x56190c]['id'],'name':_0x232c93[_0x56190c][_0x0605('0x12')],'online':Boolean(_0x232c93[_0x56190c]['online']),'paused':Boolean(_0x232c93[_0x56190c][_0x21d6d9])};if(_0x415b31[_0x0605('0x57')])_0x18f7f2[_0x0605('0x4f')]++;if(_0x415b31[_0x0605('0x38')])_0x18f7f2[_0x0605('0x38')]++;_0x18f7f2[_0x0605('0x58')][_0x0605('0x3a')](_0x415b31);}return _0x18f7f2;});}});return Promise[_0x0605('0x5c')](_0x17cd94);});})[_0x0605('0x1b')](function(_0x3cc131){_0xefc557['rows']=_0x3cc131;return _0xefc557;})[_0x0605('0x1b')](respondWithFilteredResult(_0x2b4610,_0x351dbd))[_0x0605('0x5d')](handleError(_0x2b4610,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 9539b78..7846919 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20f9ab,_0x26a12e){var _0x138019=function(_0x2445b8){while(--_0x2445b8){_0x20f9ab['push'](_0x20f9ab['shift']());}};_0x138019(++_0x26a12e);}(_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(_0x37c8c6,_0x5377c9){var _0x1fec75=function(_0x2f926d){while(--_0x2f926d){_0x37c8c6['push'](_0x37c8c6['shift']());}};_0x1fec75(++_0x5377c9);}(_0xe706,0xa3));var _0x6e70=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xe706[_0x3b231a];return _0x18d67a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index ec8cda7..b963ed4 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 _0x307e=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x3c77b8,_0x43b354){var _0x1da9a2=function(_0x2e2a1a){while(--_0x2e2a1a){_0x3c77b8['push'](_0x3c77b8['shift']());}};_0x1da9a2(++_0x43b354);}(_0x307e,0xc9));var _0xe307=function(_0x50b72b,_0x25d8e9){_0x50b72b=_0x50b72b-0x0;var _0x3063a7=_0x307e[_0x50b72b];return _0x3063a7;};'use strict';var Sequelize=require(_0xe307('0x0'));module[_0xe307('0x1')]={'state':{'type':Sequelize[_0xe307('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe307('0x3')]},'scheduledat':{'type':Sequelize[_0xe307('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe307('0x4')]},'responsetime':{'type':Sequelize[_0xe307('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe307('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe307('0x3')]}}; \ No newline at end of file +var _0xf483=['DATE','INTEGER','exports','STRING'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xf483,0xf2));var _0x3f48=function(_0x1700ed,_0x2904f4){_0x1700ed=_0x1700ed-0x0;var _0x3f265a=_0xf483[_0x1700ed];return _0x3f265a;};'use strict';var Sequelize=require('sequelize');module[_0x3f48('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3f48('0x1')]},'scheduledat':{'type':Sequelize[_0x3f48('0x2')]},'uniqueid':{'type':Sequelize[_0x3f48('0x1')]},'starttime':{'type':Sequelize[_0x3f48('0x2')]},'responsetime':{'type':Sequelize[_0x3f48('0x2')]},'ringtime':{'type':Sequelize[_0x3f48('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'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 99a7d8a..7ebcddf 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 _0x530a=['../../config/environment','exports','define','ReportAgentPreview','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x207c0a,_0x939576){var _0x173a55=function(_0x29c7bd){while(--_0x29c7bd){_0x207c0a['push'](_0x207c0a['shift']());}};_0x173a55(++_0x939576);}(_0x530a,0x1bc));var _0xa530=function(_0x8ffc80,_0x208e2b){_0x8ffc80=_0x8ffc80-0x0;var _0x5cd45a=_0x530a[_0x8ffc80];return _0x5cd45a;};'use strict';var _=require(_0xa530('0x0'));var util=require(_0xa530('0x1'));var logger=require('../../config/logger')(_0xa530('0x2'));var moment=require(_0xa530('0x3'));var BPromise=require('bluebird');var rp=require(_0xa530('0x4'));var fs=require('fs');var path=require(_0xa530('0x5'));var rimraf=require(_0xa530('0x6'));var config=require(_0xa530('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xa530('0x8')]=function(_0x123dad,_0x35a769){return _0x123dad[_0xa530('0x9')](_0xa530('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0c5=['bluebird','request-promise','path','../../config/environment','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api'];(function(_0x59cf0b,_0x53707a){var _0x51b771=function(_0x139cbf){while(--_0x139cbf){_0x59cf0b['push'](_0x59cf0b['shift']());}};_0x51b771(++_0x53707a);}(_0xa0c5,0xa1));var _0x5a0c=function(_0x11362f,_0x2fc8f0){_0x11362f=_0x11362f-0x0;var _0x5a446c=_0xa0c5[_0x11362f];return _0x5a446c;};'use strict';var _=require(_0x5a0c('0x0'));var util=require(_0x5a0c('0x1'));var logger=require(_0x5a0c('0x2'))(_0x5a0c('0x3'));var moment=require('moment');var BPromise=require(_0x5a0c('0x4'));var rp=require(_0x5a0c('0x5'));var fs=require('fs');var path=require(_0x5a0c('0x6'));var rimraf=require('rimraf');var config=require(_0x5a0c('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0x5a0c('0x8')]=function(_0x5dca97,_0x3041e6){return _0x5dca97[_0x5a0c('0x9')](_0x5a0c('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 60a54f7..e2101c4 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 _0x3ef3=['request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x2f55b5,_0x387971){var _0x5d2a16=function(_0x44ef52){while(--_0x44ef52){_0x2f55b5['push'](_0x2f55b5['shift']());}};_0x5d2a16(++_0x387971);}(_0x3ef3,0x16b));var _0x33ef=function(_0x240e46,_0x141d91){_0x240e46=_0x240e46-0x0;var _0x9bc15e=_0x3ef3[_0x240e46];return _0x9bc15e;};'use strict';var _=require('lodash');var util=require(_0x33ef('0x0'));var moment=require(_0x33ef('0x1'));var BPromise=require(_0x33ef('0x2'));var rs=require(_0x33ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x33ef('0x5'))(_0x33ef('0x6'));var config=require(_0x33ef('0x7'));var jayson=require(_0x33ef('0x8'));var client=jayson[_0x33ef('0x9')][_0x33ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36449b,_0x27beb2,_0xfaa416){return new BPromise(function(_0x1b56a0,_0x5bd8ee){return client[_0x33ef('0xb')](_0x36449b,_0xfaa416)['then'](function(_0x10e023){logger[_0x33ef('0xc')](_0x33ef('0xd'),_0x27beb2,_0x33ef('0xe'));logger[_0x33ef('0xf')](_0x33ef('0x10'),_0x27beb2,'request\x20sent',JSON[_0x33ef('0x11')](_0x10e023));if(_0x10e023['error']){if(_0x10e023[_0x33ef('0x12')][_0x33ef('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x27beb2,_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);return _0x5bd8ee(_0x10e023['error']['message']);}logger[_0x33ef('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x27beb2,_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);return _0x1b56a0(_0x10e023[_0x33ef('0x12')][_0x33ef('0x14')]);}else{logger[_0x33ef('0xc')](_0x33ef('0xd'),_0x27beb2,_0x33ef('0xe'));_0x1b56a0(_0x10e023[_0x33ef('0x15')][_0x33ef('0x14')]);}})[_0x33ef('0x16')](function(_0x1ce2df){logger[_0x33ef('0x12')](_0x33ef('0xd'),_0x27beb2,_0x1ce2df);_0x5bd8ee(_0x1ce2df);});});}exports[_0x33ef('0x17')]=function(_0x222149){var _0x803fe2=this;return new Promise(function(_0x2de684,_0x58eb54){return db[_0x33ef('0x18')]['create'](_0x222149[_0x33ef('0x19')],{'raw':_0x222149[_0x33ef('0x1a')]?_0x222149['options'][_0x33ef('0x1b')]===undefined?!![]:![]:!![]})[_0x33ef('0x1c')](function(_0x553d95){logger[_0x33ef('0xc')](_0x33ef('0x17'),_0x222149);logger[_0x33ef('0xf')](_0x33ef('0x17'),_0x222149,JSON[_0x33ef('0x11')](_0x553d95));_0x2de684(_0x553d95);})['catch'](function(_0x135b94){logger['error'](_0x33ef('0x17'),_0x135b94[_0x33ef('0x14')],_0x222149);_0x58eb54(_0x803fe2['error'](0x1f4,_0x135b94['message']));});});}; \ No newline at end of file +var _0xfe4b=['bluebird','ioredis','../../config/utils','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','lodash','util','moment'];(function(_0xa3896f,_0x112166){var _0x4d8397=function(_0x23e524){while(--_0x23e524){_0xa3896f['push'](_0xa3896f['shift']());}};_0x4d8397(++_0x112166);}(_0xfe4b,0xc5));var _0xbfe4=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xfe4b[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0xbfe4('0x0'));var util=require(_0xbfe4('0x1'));var moment=require(_0xbfe4('0x2'));var BPromise=require(_0xbfe4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfe4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfe4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfe4('0x6')][_0xbfe4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x364d16,_0x27f453,_0x5efe97){return new BPromise(function(_0xa63092,_0x4dc6e9){return client[_0xbfe4('0x8')](_0x364d16,_0x5efe97)['then'](function(_0x4bdd95){logger[_0xbfe4('0x9')](_0xbfe4('0xa'),_0x27f453,_0xbfe4('0xb'));logger[_0xbfe4('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x27f453,_0xbfe4('0xb'),JSON[_0xbfe4('0xd')](_0x4bdd95));if(_0x4bdd95['error']){if(_0x4bdd95[_0xbfe4('0xe')][_0xbfe4('0xf')]===0x1f4){logger[_0xbfe4('0xe')](_0xbfe4('0xa'),_0x27f453,_0x4bdd95[_0xbfe4('0xe')][_0xbfe4('0x10')]);return _0x4dc6e9(_0x4bdd95[_0xbfe4('0xe')]['message']);}logger[_0xbfe4('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x27f453,_0x4bdd95['error'][_0xbfe4('0x10')]);return _0xa63092(_0x4bdd95['error']['message']);}else{logger[_0xbfe4('0x9')](_0xbfe4('0xa'),_0x27f453,_0xbfe4('0xb'));_0xa63092(_0x4bdd95[_0xbfe4('0x11')][_0xbfe4('0x10')]);}})[_0xbfe4('0x12')](function(_0x5c4f53){logger[_0xbfe4('0xe')](_0xbfe4('0xa'),_0x27f453,_0x5c4f53);_0x4dc6e9(_0x5c4f53);});});}exports[_0xbfe4('0x13')]=function(_0x5bf29c){var _0x5d002a=this;return new Promise(function(_0x12cd4b,_0xa0eb36){return db[_0xbfe4('0x14')][_0xbfe4('0x15')](_0x5bf29c[_0xbfe4('0x16')],{'raw':_0x5bf29c[_0xbfe4('0x17')]?_0x5bf29c[_0xbfe4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbfe4('0x18')](function(_0x5e2ca3){logger['info'](_0xbfe4('0x13'),_0x5bf29c);logger[_0xbfe4('0xc')](_0xbfe4('0x13'),_0x5bf29c,JSON[_0xbfe4('0xd')](_0x5e2ca3));_0x12cd4b(_0x5e2ca3);})[_0xbfe4('0x12')](function(_0xd0c445){logger[_0xbfe4('0xe')](_0xbfe4('0x13'),_0xd0c445[_0xbfe4('0x10')],_0x5bf29c);_0xa0eb36(_0x5d002a[_0xbfe4('0xe')](0x1f4,_0xd0c445[_0xbfe4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 2da78f9..0709296 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 _0x61a8=['multer','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','openchannel','/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','exports'];(function(_0x24abab,_0x5860aa){var _0x2fa984=function(_0x245510){while(--_0x245510){_0x24abab['push'](_0x24abab['shift']());}};_0x2fa984(++_0x5860aa);}(_0x61a8,0xed));var _0x861a=function(_0x3cae30,_0x5d8b99){_0x3cae30=_0x3cae30-0x0;var _0x263f77=_0x61a8[_0x3cae30];return _0x263f77;};'use strict';var multer=require(_0x861a('0x0'));var util=require('util');var path=require(_0x861a('0x1'));var express=require(_0x861a('0x2'));var router=express[_0x861a('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x861a('0x4')](_0x861a('0x5'),auth[_0x861a('0x6')](),controller[_0x861a('0x7')]);router[_0x861a('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x861a('0x6')](),controller['voiceChannelMixMonitor']);router['get'](_0x861a('0x8'),auth[_0x861a('0x6')](),controller[_0x861a('0x9')]);router[_0x861a('0x4')](_0x861a('0xa'),auth[_0x861a('0x6')](),controller[_0x861a('0xb')]);router[_0x861a('0x4')](_0x861a('0xc'),auth[_0x861a('0x6')](),controller['chatQueues']);router[_0x861a('0x4')](_0x861a('0xd'),auth['isAuthenticated'](),controller[_0x861a('0xe')]);router[_0x861a('0x4')]('/mail/accounts',auth[_0x861a('0x6')](),controller[_0x861a('0xf')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x861a('0x4')](_0x861a('0x10'),auth[_0x861a('0x6')](),controller[_0x861a('0x11')]);router['get'](_0x861a('0x12'),auth[_0x861a('0x6')](),controller[_0x861a('0x13')]);router[_0x861a('0x4')]('/fax/queues',auth['isAuthenticated'](),controller[_0x861a('0x14')]);router['get']('/voice/queues/preview/:id',auth[_0x861a('0x6')](),controller[_0x861a('0x15')]);router[_0x861a('0x4')](_0x861a('0x16'),auth[_0x861a('0x6')](),controller[_0x861a('0x17')]);router['get'](_0x861a('0x18'),auth[_0x861a('0x6')](),controller['voiceQueuesChannel']);router[_0x861a('0x4')](_0x861a('0x19'),auth[_0x861a('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x861a('0x4')](_0x861a('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x861a('0x4')]('/voice/queues/:id',auth[_0x861a('0x6')](),controller['showVoiceQueues']);router['put'](_0x861a('0x1b'),auth[_0x861a('0x6')](),controller[_0x861a('0x1c')]);router['get'](_0x861a('0x1d'),auth['isAuthenticated'](),controller[_0x861a('0x1e')]);router['get']('/outbound/channels',auth[_0x861a('0x6')](),controller[_0x861a('0x1f')]);router[_0x861a('0x4')](_0x861a('0x20'),auth[_0x861a('0x6')](),controller[_0x861a('0x21')]);router[_0x861a('0x22')](_0x861a('0x23'),auth[_0x861a('0x6')](),controller[_0x861a('0x24')]);router[_0x861a('0x4')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router[_0x861a('0x4')](_0x861a('0x25'),auth[_0x861a('0x6')](),controller[_0x861a('0x26')]);router[_0x861a('0x4')](_0x861a('0x27'),auth[_0x861a('0x6')](),controller[_0x861a('0x28')]);router['get'](_0x861a('0x29'),auth[_0x861a('0x6')](),controller['faxAccounts']);router[_0x861a('0x4')](_0x861a('0x2a'),auth[_0x861a('0x6')](),controller[_0x861a('0x2b')]);router[_0x861a('0x4')](_0x861a('0x2c'),auth[_0x861a('0x6')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x861a('0x2d'),auth[_0x861a('0x6')](),controller[_0x861a('0x2e')]);router[_0x861a('0x4')](_0x861a('0x2f'),auth['isAuthenticated'](),controller[_0x861a('0x30')]);router[_0x861a('0x4')](_0x861a('0x31'),auth[_0x861a('0x6')](),controller[_0x861a('0x32')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x861a('0x33')]);router[_0x861a('0x4')](_0x861a('0x34'),auth[_0x861a('0x6')](),controller[_0x861a('0x35')]);router[_0x861a('0x36')](_0x861a('0x37'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x39')));router[_0x861a('0x4')](_0x861a('0x3a'),auth[_0x861a('0x6')](),controller[_0x861a('0x3b')]);router[_0x861a('0x36')](_0x861a('0x3c'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x3d')));router['get'](_0x861a('0x3e'),auth[_0x861a('0x6')](),controller[_0x861a('0x3f')]);router[_0x861a('0x36')]('/fax/queues/:id/notify',auth[_0x861a('0x6')](),controller['queueNotify'](_0x861a('0x40')));router[_0x861a('0x4')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x861a('0x41')]);router[_0x861a('0x36')]('/openchannel/queues/:id/notify',auth[_0x861a('0x6')](),controller['queueNotify'](_0x861a('0x42')));router[_0x861a('0x4')](_0x861a('0x43'),auth[_0x861a('0x6')](),controller[_0x861a('0x44')]);router[_0x861a('0x36')](_0x861a('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0x861a('0x46')));router[_0x861a('0x36')](_0x861a('0x47'),auth[_0x861a('0x6')](),controller[_0x861a('0x38')](_0x861a('0x48')));router[_0x861a('0x4')](_0x861a('0x49'),auth[_0x861a('0x6')](),controller[_0x861a('0x4a')]);router[_0x861a('0x4')](_0x861a('0x4b'),auth[_0x861a('0x6')](),controller[_0x861a('0x4c')]);router[_0x861a('0x36')](_0x861a('0x4d'),auth[_0x861a('0x6')](),controller['agentNotify']);module[_0x861a('0x4e')]=router; \ No newline at end of file +var _0x7102=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/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','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get'];(function(_0x486d91,_0x239cfc){var _0x518f8f=function(_0x77e38e){while(--_0x77e38e){_0x486d91['push'](_0x486d91['shift']());}};_0x518f8f(++_0x239cfc);}(_0x7102,0xe3));var _0x2710=function(_0xe2beed,_0x5dbd4d){_0xe2beed=_0xe2beed-0x0;var _0x5c0b7f=_0x7102[_0xe2beed];return _0x5c0b7f;};'use strict';var multer=require(_0x2710('0x0'));var util=require(_0x2710('0x1'));var path=require('path');var express=require(_0x2710('0x2'));var router=express[_0x2710('0x3')]();var auth=require(_0x2710('0x4'));var controller=require(_0x2710('0x5'));router[_0x2710('0x6')](_0x2710('0x7'),auth[_0x2710('0x8')](),controller[_0x2710('0x9')]);router[_0x2710('0x6')](_0x2710('0xa'),auth[_0x2710('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0x2710('0xb'),auth[_0x2710('0x8')](),controller[_0x2710('0xc')]);router['get'](_0x2710('0xd'),auth[_0x2710('0x8')](),controller[_0x2710('0xe')]);router[_0x2710('0x6')](_0x2710('0xf'),auth['isAuthenticated'](),controller[_0x2710('0x10')]);router['get'](_0x2710('0x11'),auth[_0x2710('0x8')](),controller[_0x2710('0x12')]);router['get']('/mail/accounts',auth[_0x2710('0x8')](),controller[_0x2710('0x13')]);router[_0x2710('0x6')](_0x2710('0x14'),auth['isAuthenticated'](),controller[_0x2710('0x15')]);router[_0x2710('0x6')](_0x2710('0x16'),auth['isAuthenticated'](),controller[_0x2710('0x17')]);router[_0x2710('0x6')](_0x2710('0x18'),auth[_0x2710('0x8')](),controller['whatsappQueues']);router[_0x2710('0x6')](_0x2710('0x19'),auth['isAuthenticated'](),controller[_0x2710('0x1a')]);router[_0x2710('0x6')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x2710('0x1b')]);router['get'](_0x2710('0x1c'),auth[_0x2710('0x8')](),controller[_0x2710('0x1d')]);router[_0x2710('0x6')](_0x2710('0x1e'),auth[_0x2710('0x8')](),controller[_0x2710('0x1f')]);router[_0x2710('0x6')](_0x2710('0x20'),auth['isAuthenticated'](),controller[_0x2710('0x21')]);router[_0x2710('0x6')](_0x2710('0x22'),auth[_0x2710('0x8')](),controller[_0x2710('0x23')]);router['get'](_0x2710('0x24'),auth[_0x2710('0x8')](),controller['showVoiceQueues']);router['put'](_0x2710('0x24'),auth[_0x2710('0x8')](),controller[_0x2710('0x25')]);router['get']('/outbound',auth[_0x2710('0x8')](),controller[_0x2710('0x26')]);router[_0x2710('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x2710('0x27')]);router[_0x2710('0x6')](_0x2710('0x28'),auth['isAuthenticated'](),controller[_0x2710('0x29')]);router[_0x2710('0x2a')](_0x2710('0x2b'),auth[_0x2710('0x8')](),controller['agentCapacity']);router['get'](_0x2710('0x2c'),auth['isAuthenticated'](),controller[_0x2710('0x2d')]);router[_0x2710('0x6')]('/trunks',auth[_0x2710('0x8')](),controller[_0x2710('0x2e')]);router[_0x2710('0x6')](_0x2710('0x2f'),auth[_0x2710('0x8')](),controller[_0x2710('0x30')]);router[_0x2710('0x6')]('/fax/accounts',auth[_0x2710('0x8')](),controller[_0x2710('0x31')]);router[_0x2710('0x6')]('/chat/queues/waitinginteractions',auth[_0x2710('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0x2710('0x6')]('/mail/queues/waitinginteractions',auth[_0x2710('0x8')](),controller[_0x2710('0x32')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x2710('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x2710('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x2710('0x8')](),controller[_0x2710('0x33')]);router[_0x2710('0x6')](_0x2710('0x34'),auth[_0x2710('0x8')](),controller[_0x2710('0x35')]);router['get'](_0x2710('0x36'),auth[_0x2710('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x2710('0x6')](_0x2710('0x37'),auth[_0x2710('0x8')](),controller[_0x2710('0x38')]);router[_0x2710('0x39')]('/mail/queues/:id/notify',auth[_0x2710('0x8')](),controller[_0x2710('0x3a')](_0x2710('0x3b')));router[_0x2710('0x6')]('/mail/queues/:id',auth[_0x2710('0x8')](),controller[_0x2710('0x3c')]);router[_0x2710('0x39')]('/chat/queues/:id/notify',auth[_0x2710('0x8')](),controller['queueNotify']('chat'));router[_0x2710('0x6')]('/chat/queues/:id',auth[_0x2710('0x8')](),controller[_0x2710('0x3d')]);router[_0x2710('0x39')](_0x2710('0x3e'),auth[_0x2710('0x8')](),controller[_0x2710('0x3a')](_0x2710('0x3f')));router[_0x2710('0x6')](_0x2710('0x40'),auth[_0x2710('0x8')](),controller['showFaxQueues']);router[_0x2710('0x39')](_0x2710('0x41'),auth[_0x2710('0x8')](),controller[_0x2710('0x3a')]('openchannel'));router[_0x2710('0x6')](_0x2710('0x42'),auth[_0x2710('0x8')](),controller[_0x2710('0x43')]);router[_0x2710('0x39')](_0x2710('0x44'),auth['isAuthenticated'](),controller[_0x2710('0x3a')](_0x2710('0x45')));router['post'](_0x2710('0x46'),auth[_0x2710('0x8')](),controller[_0x2710('0x3a')](_0x2710('0x47')));router[_0x2710('0x6')](_0x2710('0x48'),auth[_0x2710('0x8')](),controller[_0x2710('0x49')]);router['get'](_0x2710('0x4a'),auth[_0x2710('0x8')](),controller[_0x2710('0x4b')]);router['post'](_0x2710('0x4c'),auth[_0x2710('0x8')](),controller['agentNotify']);module[_0x2710('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 24a50fd..eacfbc8 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 _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x3bcc59,_0x194389){var _0x4f8f7e=function(_0x152ace){while(--_0x152ace){_0x3bcc59['push'](_0x3bcc59['shift']());}};_0x4f8f7e(++_0x194389);}(_0x55ca,0x126));var _0xa55c=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x55ca[_0x316b13];return _0x29ab59;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));}; \ No newline at end of file +var _0xae24=['InteractionId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','bluebird','lodash','../../mysqldb','../../config/logger','client','http','then','error','code','message','result','catch','status','json','sendStatus','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','voiceQueuesPreview','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','length','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','OpenchannelQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId'];(function(_0x389e1d,_0x5c0309){var _0x2e3e24=function(_0xff6ce1){while(--_0xff6ce1){_0x389e1d['push'](_0x389e1d['shift']());}};_0x2e3e24(++_0x5c0309);}(_0xae24,0x182));var _0x4ae2=function(_0x51c656,_0x2a5d57){_0x51c656=_0x51c656-0x0;var _0x2a4e55=_0xae24[_0x51c656];return _0x2a4e55;};'use strict';var BPromise=require(_0x4ae2('0x0'));var moment=require('moment');var _=require(_0x4ae2('0x1'));var util=require('util');var db=require(_0x4ae2('0x2'))['db'];var logger=require(_0x4ae2('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x4ae2('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232b});var routingClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){var _0x4d3d8a=_0x4f2e84?_0x4f2e84:amiClient;return _0x4d3d8a['request'](_0x428054,_0x307247)[_0x4ae2('0x6')](function(_0xb01e8e){if(_0xb01e8e['error']){if(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x8')]===0x1f4){return _0x41cdf1(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x9')]);}return _0x5f589a(_0xb01e8e['error'][_0x4ae2('0x9')]);}else{_0x5f589a(_0xb01e8e[_0x4ae2('0xa')]);}})[_0x4ae2('0xb')](function(_0x4d7dc3){_0x41cdf1(_0x4d7dc3);});});}function respondWithResult(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xc8;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0xc')](_0x22ac1e)[_0x4ae2('0xd')](_0x30d6c4);}return _0x25d2b4[_0x4ae2('0xe')](0x194);};}function handleError(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0x1f4;return function(_0xd527a0){logger['error'](_0xd527a0['stack']);if(_0xd527a0['name']){delete _0xd527a0[_0x4ae2('0xf')];}_0x145287[_0x4ae2('0xc')](_0x3cabc9)['send'](_0xd527a0);};}function findById(_0x463765){return function(_0x9fb8db){if(!_[_0x4ae2('0x10')](_0x463765)&&!_[_0x4ae2('0x10')](_0x9fb8db)&&!_[_0x4ae2('0x10')](_0x9fb8db[_0x4ae2('0x11')])){return _[_0x4ae2('0x12')](_0x9fb8db[_0x4ae2('0x11')],function(_0x41b672){return _0x41b672['id']==_0x463765;});}return null;};}exports[_0x4ae2('0x13')]=function(_0x4d5071,_0x4a97af){return respondWithRpcPromise(_0x4ae2('0x14'),_0x4d5071[_0x4ae2('0x15')])['then'](respondWithResult(_0x4a97af,null))[_0x4ae2('0xb')](handleError(_0x4a97af,null));};exports[_0x4ae2('0x16')]=function(_0xccb3b,_0x2ad222){return respondWithRpcPromise(_0x4ae2('0x17'),_['merge'](_0xccb3b[_0x4ae2('0x15')],_0xccb3b['params']))['then'](respondWithResult(_0x2ad222,null))[_0x4ae2('0xb')](handleError(_0x2ad222,null));};exports[_0x4ae2('0x18')]=function(_0x802bf0,_0x17041e){return respondWithRpcPromise(_0x4ae2('0x19'),_['merge'](_0x802bf0[_0x4ae2('0x15')],_0x802bf0['params']))[_0x4ae2('0x6')](respondWithResult(_0x17041e,null))[_0x4ae2('0xb')](handleError(_0x17041e,null));};exports[_0x4ae2('0x1a')]=function(_0x57933b,_0x43f112){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x57933b[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x43f112,null))[_0x4ae2('0xb')](handleError(_0x43f112,null));};exports[_0x4ae2('0x1c')]=function(_0x5b2e65,_0x5962b0){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x5b2e65[_0x4ae2('0x15')])[_0x4ae2('0x6')](findById(_0x5b2e65[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x5962b0,null))[_0x4ae2('0xb')](handleError(_0x5962b0,null));};exports['updateVoiceQueue']=function(_0x5ec1fd,_0x3e2666){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x5ec1fd['body'],_0x5ec1fd[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3e2666,null))['catch'](handleError(_0x3e2666,null));};exports[_0x4ae2('0x1e')]=function(_0x37e3e5,_0x3d56ea){return respondWithRpcPromise(_0x4ae2('0x1f'),_[_0x4ae2('0x20')](_0x37e3e5[_0x4ae2('0x15')],_0x37e3e5[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3d56ea,null))[_0x4ae2('0xb')](handleError(_0x3d56ea,null));};exports[_0x4ae2('0x21')]=function(_0x386687,_0x12815f){return respondWithRpcPromise(_0x4ae2('0x22'),_0x386687[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x12815f,null))[_0x4ae2('0xb')](handleError(_0x12815f,null));};exports[_0x4ae2('0x23')]=function(_0x4bd47f,_0xdcd11e){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x4ae2('0x20')](_0x4bd47f[_0x4ae2('0x15')],_0x4bd47f['params']))[_0x4ae2('0x6')](respondWithResult(_0xdcd11e,null))[_0x4ae2('0xb')](handleError(_0xdcd11e,null));};exports[_0x4ae2('0x24')]=function(_0x2dde26,_0x5256d3){return respondWithRpcPromise(_0x4ae2('0x25'),_[_0x4ae2('0x20')](_0x2dde26[_0x4ae2('0x15')],_0x2dde26[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x5256d3,null))[_0x4ae2('0xb')](handleError(_0x5256d3,null));};exports[_0x4ae2('0x26')]=function(_0x46f3a2,_0xe99f9d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ae2('0x20')](_0x46f3a2['query'],_0x46f3a2[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0xe99f9d,null))[_0x4ae2('0xb')](handleError(_0xe99f9d,null));};exports[_0x4ae2('0x27')]=function(_0x771c14,_0x129adf){return respondWithRpcPromise('Outbound',_0x771c14[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x129adf,null))[_0x4ae2('0xb')](handleError(_0x129adf,null));};exports[_0x4ae2('0x28')]=function(_0x49baf9,_0x2d4737){return respondWithRpcPromise(_0x4ae2('0x29'),_0x49baf9[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x2d4737,null))[_0x4ae2('0xb')](handleError(_0x2d4737,null));};exports[_0x4ae2('0x2a')]=function(_0x1fdc61,_0x1b04ee){var _0x1d5888;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')])['then'](function(_0x2c3676){_0x1d5888=_0x2c3676;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')],routingClient);})[_0x4ae2('0x6')](function(_0x5bade3){return _['merge']({},_0x5bade3,_0x1d5888);})[_0x4ae2('0x6')](respondWithResult(_0x1b04ee,null))[_0x4ae2('0xb')](handleError(_0x1b04ee,null));};exports[_0x4ae2('0x2c')]=function(_0x3cdf23,_0x567371){if(_0x3cdf23[_0x4ae2('0x2d')]&&_0x3cdf23[_0x4ae2('0x2d')]['interaction']&&_0x3cdf23[_0x4ae2('0x2e')]&&_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]){for(var _0x5a9126 in _0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')]){if(_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x4ae2('0x30')](_0x5a9126)){db[_0x4ae2('0x31')][_0x4ae2('0x32')]({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')]['name'],'type':_0x4ae2('0x33'),'exitAt':null,'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126]&&_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]['length']?{'$notIn':_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]}:{'$ne':null}}})['then'](function(_0x21baf4){var _0x2ab00f=moment()[_0x4ae2('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4fc82f=0x0,_0x26681b=_0x21baf4[_0x4ae2('0x35')];_0x4fc82f<_0x26681b;_0x4fc82f+=0x1){_0x21baf4[_0x4fc82f][_0x4ae2('0x36')]({'exitAt':_0x2ab00f});}});for(var _0x8a17a4=0x0;_0x8a17a4<_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x4ae2('0x35')];_0x8a17a4+=0x1){db[_0x4ae2('0x31')]['findOrCreate']({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'type':_0x4ae2('0x33'),'uniqueid':_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x8a17a4],'exitAt':null},'defaults':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'interface':_[_0x4ae2('0x10')](_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x37')])?util[_0x4ae2('0x34')](_0x4ae2('0x38'),_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]):_0x3cdf23['user'][_0x4ae2('0x37')],'type':_0x4ae2('0x33'),'enterAt':moment()[_0x4ae2('0x34')](_0x4ae2('0x39')),'role':_0x4ae2('0x3a'),'internal':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x3b')],'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126][_0x8a17a4]}});}}}}return respondWithRpcPromise(_0x4ae2('0x3c'),{'id':_0x3cdf23[_0x4ae2('0x1d')]['id'],'capacity':_0x3cdf23['body'][_0x4ae2('0x3d')]},routingClient)[_0x4ae2('0x6')](respondWithResult(_0x567371,null))['catch'](handleError(_0x567371,null));};exports[_0x4ae2('0x3e')]=function(_0x4d6560,_0x426d29){return respondWithRpcPromise('Telephones',_0x4d6560[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x426d29,null))[_0x4ae2('0xb')](handleError(_0x426d29,null));};exports[_0x4ae2('0x3f')]=function(_0x8525c4,_0x153673){return respondWithRpcPromise(_0x4ae2('0x40'),_0x8525c4[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x153673,null))['catch'](handleError(_0x153673,null));};exports[_0x4ae2('0x41')]=function(_0x4284b4,_0x825c3a){return respondWithRpcPromise(_0x4ae2('0x42'),_0x4284b4['query'])[_0x4ae2('0x6')](respondWithResult(_0x825c3a,null))[_0x4ae2('0xb')](handleError(_0x825c3a,null));};exports[_0x4ae2('0x43')]=function(_0x49029e,_0x51f845){return respondWithRpcPromise(_0x4ae2('0x44'),_0x49029e[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51f845,null))[_0x4ae2('0xb')](handleError(_0x51f845,null));};exports[_0x4ae2('0x45')]=function(_0x28d68e,_0x18a8e6){return respondWithRpcPromise(_0x4ae2('0x44'),_0x28d68e[_0x4ae2('0x15')],routingClient)['then'](findById(_0x28d68e[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x18a8e6,null))[_0x4ae2('0xb')](handleError(_0x18a8e6,null));};exports[_0x4ae2('0x46')]=function(_0x28e7a8,_0x2143fe){return respondWithRpcPromise(_0x4ae2('0x47'),_0x28e7a8[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x2143fe,null))[_0x4ae2('0xb')](handleError(_0x2143fe,null));};exports['showMailQueues']=function(_0x496f98,_0x33fb77){return respondWithRpcPromise(_0x4ae2('0x47'),_0x496f98[_0x4ae2('0x15')],routingClient)['then'](findById(_0x496f98['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x33fb77,null))[_0x4ae2('0xb')](handleError(_0x33fb77,null));};exports[_0x4ae2('0x48')]=function(_0x201b25,_0x41601d){return respondWithRpcPromise('MailAccounts',_0x201b25['query'],mailClient)['then'](respondWithResult(_0x41601d,null))[_0x4ae2('0xb')](handleError(_0x41601d,null));};exports['openchannelQueues']=function(_0x4e54d1,_0x17f023){return respondWithRpcPromise('OpenchannelQueues',_0x4e54d1[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x17f023,null))[_0x4ae2('0xb')](handleError(_0x17f023,null));};exports['showOpenchannelQueues']=function(_0xf417c0,_0x51141d){return respondWithRpcPromise(_0x4ae2('0x49'),_0xf417c0[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xf417c0[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x51141d,null))['catch'](handleError(_0x51141d,null));};exports['smsQueues']=function(_0x344963,_0x256d2f){return respondWithRpcPromise('SmsQueues',_0x344963[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x256d2f,null))['catch'](handleError(_0x256d2f,null));};exports[_0x4ae2('0x4a')]=function(_0xefd494,_0x49c58c){return respondWithRpcPromise('SmsQueues',_0xefd494[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xefd494['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x49c58c,null))[_0x4ae2('0xb')](handleError(_0x49c58c,null));};exports[_0x4ae2('0x4b')]=function(_0x30003b,_0x5af418){return respondWithRpcPromise(_0x4ae2('0x4c'),_0x30003b[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x5af418,null))[_0x4ae2('0xb')](handleError(_0x5af418,null));};exports[_0x4ae2('0x4d')]=function(_0x3412a1,_0x525cc5){return respondWithRpcPromise('WhatsappQueues',_0x3412a1[_0x4ae2('0x15')],routingClient)['then'](findById(_0x3412a1[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x525cc5,null))[_0x4ae2('0xb')](handleError(_0x525cc5,null));};exports['faxQueues']=function(_0x2758c0,_0x519763){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x2758c0['query'],routingClient)['then'](respondWithResult(_0x519763,null))[_0x4ae2('0xb')](handleError(_0x519763,null));};exports[_0x4ae2('0x4f')]=function(_0x1a603b,_0xde3aac){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x1a603b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0x1a603b[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0xde3aac,null))[_0x4ae2('0xb')](handleError(_0xde3aac,null));};exports[_0x4ae2('0x50')]=function(_0x4403ed,_0x55f1fe){return respondWithRpcPromise(_0x4ae2('0x51'),_0x4403ed[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x55f1fe,null))[_0x4ae2('0xb')](handleError(_0x55f1fe,null));};exports['chatQueuesWaitingInteractions']=function(_0x18f568,_0x5add54){return respondWithRpcPromise(_0x4ae2('0x52'),_0x18f568[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x5add54,null))[_0x4ae2('0xb')](handleError(_0x5add54,null));};exports[_0x4ae2('0x53')]=function(_0x318b4a,_0x4ed285){return respondWithRpcPromise(_0x4ae2('0x54'),_0x318b4a[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4ed285,null))['catch'](handleError(_0x4ed285,null));};exports[_0x4ae2('0x55')]=function(_0x36f5c4,_0x4082d4){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x36f5c4[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4082d4,null))[_0x4ae2('0xb')](handleError(_0x4082d4,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2bb165,_0x278c5e){return respondWithRpcPromise(_0x4ae2('0x56'),_0x2bb165[_0x4ae2('0x15')],routingClient)['then'](function(_0x390c71){if(_0x2bb165[_0x4ae2('0x15')][_0x4ae2('0x57')]!==undefined){var _0x98272b=_(_0x390c71[_0x4ae2('0x11')])[_0x4ae2('0x58')]([_0x2bb165[_0x4ae2('0x15')]['type'],_0x2bb165['params']['id']])[_0x4ae2('0x59')](_0x4ae2('0x5a'))[_0x4ae2('0x5b')]()[_0x4ae2('0x5c')]();return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x4b0606){return _0x98272b[_0x4ae2('0x5d')](_0x4b0606[_0x4ae2('0x5a')])>-0x1;});}else{return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x22a880){return _0x22a880[_0x4ae2('0x5a')]===parseInt(_0x2bb165['params']['id']);});}})[_0x4ae2('0x6')](respondWithResult(_0x278c5e,null))[_0x4ae2('0xb')](handleError(_0x278c5e,null));};exports[_0x4ae2('0x5e')]=function(_0x3a84d7,_0x1bf2a4){return respondWithRpcPromise(_0x4ae2('0x5f'),_0x3a84d7['query'],routingClient)['then'](respondWithResult(_0x1bf2a4,null))[_0x4ae2('0xb')](handleError(_0x1bf2a4,null));};exports[_0x4ae2('0x60')]=function(_0x517ecb,_0x9320c1){return respondWithRpcPromise(_0x4ae2('0x61'),_0x517ecb[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x9320c1,null))[_0x4ae2('0xb')](handleError(_0x9320c1,null));};exports[_0x4ae2('0x62')]=function(_0xc4748b,_0x51cbf9){return respondWithRpcPromise(_0x4ae2('0x63'),_0xc4748b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51cbf9,null))[_0x4ae2('0xb')](handleError(_0x51cbf9,null));};exports[_0x4ae2('0x64')]=function(_0x29b0d0){return function(_0x555d17,_0x2cba96){var _0x417774,_0x17f398;var _0x58474e=_[_0x4ae2('0x65')](_0x29b0d0);var _0x49da03=_0x29b0d0===_0x4ae2('0x66')?_0x4ae2('0x67'):_0x4ae2('0x68');return db[_0x58474e+_0x4ae2('0x69')][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0x555d17['params']['id']}})[_0x4ae2('0x6')](function(_0x384c7e){if(_[_0x4ae2('0x10')](_0x384c7e)){throw new Error(_0x58474e+_0x4ae2('0x6b'));}_0x417774=_0x384c7e;return db[_0x58474e+'Message'][_0x4ae2('0x6a')]({'where':{'id':_0x555d17['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x58474e+_0x4ae2('0x6d')],'as':'Interaction'},{'model':db[_0x58474e+_0x49da03],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x29eaf4){if(_[_0x4ae2('0x10')](_0x29eaf4)){throw new Error(_0x58474e+_0x4ae2('0x6e'));}_0x17f398=_0x29eaf4;return _0x29eaf4[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2f97d7={'uniqueid':_0x29b0d0+'.'+_0x17f398['id']+'.'+_0x17f398['Interaction']['id'],'FromUserId':_0x555d17[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70')};_0x2f97d7[_0x58474e+_0x4ae2('0x71')]=_0x17f398['id'];_0x2f97d7[_0x58474e+_0x4ae2('0x72')]=_0x17f398[_0x4ae2('0x6d')]['id'];_0x2f97d7[_0x4ae2('0x73')+_0x58474e+_0x49da03+'Id']=_0x17f398['Account']['id'];_0x2f97d7['To'+_0x58474e+'QueueId']=_0x417774['id'];return db[_0x58474e+_0x4ae2('0x74')][_0x4ae2('0x75')](_0x2f97d7);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x29b0d0,'interaction':_0x17f398[_0x4ae2('0x6d')],'message':_0x17f398,'account':_0x17f398[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x70'),'appdata':_0x417774[_0x4ae2('0xf')]+','+(_0x17f398['Account'][_0x4ae2('0x77')]||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0x2cba96,null))[_0x4ae2('0xb')](handleError(_0x2cba96,null));};};exports[_0x4ae2('0x79')]=function(_0xa79171,_0xa42e4d){var _0x1deb7d,_0x8d0217;if(_[_0x4ae2('0x10')](_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')])){throw new Error(_0x4ae2('0x7b'));}var _0x310f93=_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')];var _0x31c1f7=_['capitalize'](_0x310f93);var _0x3de590=_0x310f93===_0x4ae2('0x66')?_0x4ae2('0x67'):'Account';return db['User'][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0xa79171[_0x4ae2('0x1d')]['id'],'role':'agent'}})[_0x4ae2('0x6')](function(_0x21c4ec){if(_['isNil'](_0x21c4ec)){throw new Error(_0x4ae2('0x7c'));}_0x1deb7d=_0x21c4ec;return db[_0x31c1f7+'Message']['findOne']({'where':{'id':_0xa79171['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x31c1f7+'Interaction'],'as':_0x4ae2('0x6d')},{'model':db[_0x31c1f7+_0x3de590],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x232e64){if(_[_0x4ae2('0x10')](_0x232e64)){throw new Error(_0x31c1f7+_0x4ae2('0x6e'));}_0x8d0217=_0x232e64;return _0x232e64[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ae2('0x6')](function(){var _0x386c80={'uniqueid':_0x310f93+'.'+_0x8d0217['id']+'.'+_0x8d0217['Interaction']['id'],'FromUserId':_0xa79171[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70'),'ToUserId':_0x1deb7d['id']};_0x386c80[_0x31c1f7+_0x4ae2('0x71')]=_0x8d0217['id'];_0x386c80[_0x31c1f7+_0x4ae2('0x72')]=_0x8d0217['Interaction']['id'];_0x386c80[_0x4ae2('0x73')+_0x31c1f7+_0x3de590+'Id']=_0x8d0217[_0x4ae2('0x68')]['id'];return db[_0x31c1f7+_0x4ae2('0x74')]['create'](_0x386c80);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x310f93,'interaction':_0x8d0217[_0x4ae2('0x6d')],'message':_0x8d0217,'account':_0x8d0217[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x3a'),'appdata':_0x1deb7d[_0x4ae2('0xf')]+','+(_0x8d0217[_0x4ae2('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0xa42e4d,null))[_0x4ae2('0xb')](handleError(_0xa42e4d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 789865e..b58662e 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 _0xbdc0=['run','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run'];(function(_0x54d370,_0x5db358){var _0x36a931=function(_0x50e976){while(--_0x50e976){_0x54d370['push'](_0x54d370['shift']());}};_0x36a931(++_0x5db358);}(_0xbdc0,0x103));var _0x0bdc=function(_0x33a039,_0x4dd19a){_0x33a039=_0x33a039-0x0;var _0x34cae7=_0xbdc0[_0x33a039];return _0x34cae7;};'use strict';var multer=require('multer');var util=require(_0x0bdc('0x0'));var path=require(_0x0bdc('0x1'));var timeout=require(_0x0bdc('0x2'));var express=require(_0x0bdc('0x3'));var router=express[_0x0bdc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0bdc('0x5'));var interaction=require(_0x0bdc('0x6'));var config=require(_0x0bdc('0x7'));var controller=require(_0x0bdc('0x8'));router[_0x0bdc('0x9')]('/',auth[_0x0bdc('0xa')](),controller[_0x0bdc('0xb')]);router[_0x0bdc('0x9')](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller['show']);router[_0x0bdc('0x9')](_0x0bdc('0xd'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0xe')]);router[_0x0bdc('0xf')]('/',auth['isAuthenticated'](),controller[_0x0bdc('0x10')]);router['put'](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x11')]);router[_0x0bdc('0x12')](_0x0bdc('0xc'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x13')]);module[_0x0bdc('0x14')]=router; \ No newline at end of file +var _0xaa93=['fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','/:id/run','run','post','create','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xaa93,0x9d));var _0x3aa9=function(_0x21c28b,_0xadecec){_0x21c28b=_0x21c28b-0x0;var _0x67488a=_0xaa93[_0x21c28b];return _0x67488a;};'use strict';var multer=require(_0x3aa9('0x0'));var util=require(_0x3aa9('0x1'));var path=require('path');var timeout=require(_0x3aa9('0x2'));var express=require(_0x3aa9('0x3'));var router=express[_0x3aa9('0x4')]();var fs_extra=require(_0x3aa9('0x5'));var auth=require(_0x3aa9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3aa9('0x7'));var controller=require(_0x3aa9('0x8'));router[_0x3aa9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3aa9('0x9')](_0x3aa9('0xa'),auth[_0x3aa9('0xb')](),controller['show']);router[_0x3aa9('0x9')](_0x3aa9('0xc'),auth[_0x3aa9('0xb')](),controller[_0x3aa9('0xd')]);router[_0x3aa9('0xe')]('/',auth[_0x3aa9('0xb')](),controller[_0x3aa9('0xf')]);router['put'](_0x3aa9('0xa'),auth[_0x3aa9('0xb')](),controller['update']);router[_0x3aa9('0x10')](_0x3aa9('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3aa9('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5f57d02..69977a1 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 _0x31da=['minutes','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','days','hours'];(function(_0x5700e7,_0x1bf281){var _0x79aee6=function(_0x276817){while(--_0x276817){_0x5700e7['push'](_0x5700e7['shift']());}};_0x79aee6(++_0x1bf281);}(_0x31da,0x196));var _0xa31d=function(_0x1ea9e8,_0x518c3e){_0x1ea9e8=_0x1ea9e8-0x0;var _0x16a9ec=_0x31da[_0x1ea9e8];return _0x16a9ec;};'use strict';var Sequelize=require('sequelize');module[_0xa31d('0x0')]={'name':{'type':Sequelize[_0xa31d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa31d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa31d('0x1')],'allowNull':![],'defaultValue':_0xa31d('0x3')},'startAt':{'type':Sequelize[_0xa31d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa31d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa31d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0x7'),'quarters',_0xa31d('0x8'),_0xa31d('0x9'),_0xa31d('0xa'),_0xa31d('0xb'),_0xa31d('0xc')),'allowNull':![],'defaultValue':_0xa31d('0xa')},'output':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0xd'),_0xa31d('0xe'),_0xa31d('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xa31d('0x6')](_0xa31d('0x10'),_0xa31d('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa31d('0x1')]},'cc':{'type':Sequelize[_0xa31d('0x12')]},'bcc':{'type':Sequelize[_0xa31d('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x73dd=['months','weeks','days','hours','minutes','xlsx','default','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x73dd,0x1cb));var _0xd73d=function(_0x369e6b,_0x3e210a){_0x369e6b=_0x369e6b-0x0;var _0x5f1e9d=_0x73dd[_0x369e6b];return _0x5f1e9d;};'use strict';var Sequelize=require(_0xd73d('0x0'));module['exports']={'name':{'type':Sequelize[_0xd73d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd73d('0x1')]},'active':{'type':Sequelize[_0xd73d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd73d('0x1')],'allowNull':![],'defaultValue':_0xd73d('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xd73d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd73d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd73d('0x6')](_0xd73d('0x7'),_0xd73d('0x8'),_0xd73d('0x9'),_0xd73d('0xa'),_0xd73d('0xb'),_0xd73d('0xc'),_0xd73d('0xd')),'allowNull':![],'defaultValue':_0xd73d('0xb')},'output':{'type':Sequelize[_0xd73d('0x6')]('csv','pdf',_0xd73d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xd73d('0x6')]('custom',_0xd73d('0xf')),'allowNull':![],'defaultValue':_0xd73d('0x10')},'sendMail':{'type':Sequelize[_0xd73d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xd73d('0x1')]},'cc':{'type':Sequelize[_0xd73d('0x11')]},'bcc':{'type':Sequelize[_0xd73d('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 72e6762..e0b8b5c 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 _0x6355=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','merge','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x6355,0xa4));var _0x5635=function(_0xd7ee0e,_0x2a69b0){_0xd7ee0e=_0xd7ee0e-0x0;var _0x5f2b3e=_0x6355[_0xd7ee0e];return _0x5f2b3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5635('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5635('0x1'));var rp=require(_0x5635('0x2'));var moment=require(_0x5635('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5635('0x4'));var path=require('path');var sox=require(_0x5635('0x5'));var csv=require('to-csv');var ejs=require(_0x5635('0x6'));var fs=require('fs');var fs_extra=require(_0x5635('0x7'));var _=require(_0x5635('0x8'));var squel=require(_0x5635('0x9'));var crypto=require(_0x5635('0xa'));var jsforce=require(_0x5635('0xb'));var deskjs=require(_0x5635('0xc'));var toCsv=require(_0x5635('0xd'));var querystring=require(_0x5635('0xe'));var Papa=require(_0x5635('0xf'));var Redis=require(_0x5635('0x10'));var authService=require(_0x5635('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5635('0x12'));var hardwareService=require(_0x5635('0x13'));var logger=require(_0x5635('0x14'))(_0x5635('0x15'));var utils=require(_0x5635('0x16'));var config=require(_0x5635('0x17'));var licenseUtil=require(_0x5635('0x18'));var db=require(_0x5635('0x19'))['db'];function respondWithStatusCode(_0x3218da,_0x17d622){_0x17d622=_0x17d622||0xcc;return function(_0x16c4ff){if(_0x16c4ff){return _0x3218da[_0x5635('0x1a')](_0x17d622);}return _0x3218da[_0x5635('0x1b')](_0x17d622)['end']();};}function respondWithResult(_0x133495,_0x57fbdf){_0x57fbdf=_0x57fbdf||0xc8;return function(_0x2adbe2){if(_0x2adbe2){return _0x133495['status'](_0x57fbdf)[_0x5635('0x1c')](_0x2adbe2);}};}function respondWithFilteredResult(_0x2c88a7,_0x3415cf){return function(_0x5be125){if(_0x5be125){var _0xf38b2e=typeof _0x3415cf[_0x5635('0x1d')]===_0x5635('0x1e')&&typeof _0x3415cf[_0x5635('0x1f')]===_0x5635('0x1e');var _0xb78c98=_0x5be125[_0x5635('0x20')];var _0x7ca724=_0xf38b2e?0x0:_0x3415cf[_0x5635('0x1d')];var _0x8a24ed=_0xf38b2e?_0x5be125[_0x5635('0x20')]:_0x3415cf['offset']+_0x3415cf[_0x5635('0x1f')];var _0x202836;if(_0x8a24ed>=_0xb78c98){_0x8a24ed=_0xb78c98;_0x202836=0xc8;}else{_0x202836=0xce;}_0x2c88a7['status'](_0x202836);return _0x2c88a7[_0x5635('0x21')](_0x5635('0x22'),_0x7ca724+'-'+_0x8a24ed+'/'+_0xb78c98)['json'](_0x5be125);}return null;};}function patchUpdates(_0x23bb1c){return function(_0x55b89a){try{jsonpatch[_0x5635('0x23')](_0x55b89a,_0x23bb1c,!![]);}catch(_0xf47e22){return BPromise[_0x5635('0x24')](_0xf47e22);}return _0x55b89a[_0x5635('0x25')]();};}function saveUpdates(_0x350b08,_0x18d223){return function(_0x57304f){if(_0x57304f){return _0x57304f[_0x5635('0x26')](_0x350b08)[_0x5635('0x27')](function(_0x423c88){return _0x423c88;});}return null;};}function removeEntity(_0x40698a,_0x3feabf){return function(_0x1ec181){if(_0x1ec181){return _0x1ec181['destroy']()[_0x5635('0x27')](function(){var _0x9cfdee=_0x1ec181[_0x5635('0x28')]({'plain':!![]});var _0x2133a6=_0x5635('0x29');return db[_0x5635('0x2a')]['destroy']({'where':{'type':_0x2133a6,'resourceId':_0x9cfdee['id']}})['then'](function(){return _0x1ec181;});})[_0x5635('0x27')](function(){_0x40698a[_0x5635('0x1b')](0xcc)[_0x5635('0x2b')]();});}};}function handleEntityNotFound(_0x4c6c26,_0x52b0d0){return function(_0x5dddcb){if(!_0x5dddcb){_0x4c6c26['sendStatus'](0x194);}return _0x5dddcb;};}function handleError(_0x21641a,_0x2978c1){_0x2978c1=_0x2978c1||0x1f4;return function(_0xa67797){logger[_0x5635('0x2c')](_0xa67797[_0x5635('0x2d')]);if(_0xa67797[_0x5635('0x2e')]){delete _0xa67797[_0x5635('0x2e')];}_0x21641a[_0x5635('0x1b')](_0x2978c1)[_0x5635('0x2f')](_0xa67797);};}exports[_0x5635('0x30')]=function(_0x23a1b1,_0x4d0e21){var _0x34f974={},_0x12a830={},_0x58b0a8={'count':0x0,'rows':[]};var _0x3decc8=_[_0x5635('0x31')](db[_0x5635('0x32')]['rawAttributes'],function(_0xf9eeb8){return{'name':_0xf9eeb8[_0x5635('0x33')],'type':_0xf9eeb8[_0x5635('0x34')][_0x5635('0x35')]};});_0x12a830[_0x5635('0x36')]=_['map'](_0x3decc8,_0x5635('0x2e'));_0x12a830[_0x5635('0x37')]=_['keys'](_0x23a1b1[_0x5635('0x37')]);_0x12a830['filters']=_[_0x5635('0x38')](_0x12a830[_0x5635('0x36')],_0x12a830[_0x5635('0x37')]);_0x34f974[_0x5635('0x39')]=_['intersection'](_0x12a830[_0x5635('0x36')],qs[_0x5635('0x3a')](_0x23a1b1['query'][_0x5635('0x3a')]));_0x34f974['attributes']=_0x34f974[_0x5635('0x39')]['length']?_0x34f974['attributes']:_0x12a830[_0x5635('0x36')];if(!_0x23a1b1[_0x5635('0x37')]['hasOwnProperty'](_0x5635('0x3b'))){_0x34f974[_0x5635('0x1f')]=qs[_0x5635('0x1f')](_0x23a1b1['query'][_0x5635('0x1f')]);_0x34f974[_0x5635('0x1d')]=qs[_0x5635('0x1d')](_0x23a1b1[_0x5635('0x37')]['offset']);}_0x34f974[_0x5635('0x3c')]=qs[_0x5635('0x3d')](_0x23a1b1[_0x5635('0x37')]['sort']);_0x34f974[_0x5635('0x3e')]=qs['filters'](_[_0x5635('0x3f')](_0x23a1b1['query'],_0x12a830[_0x5635('0x40')]),_0x3decc8);if(_0x23a1b1[_0x5635('0x37')]['filter']){_0x34f974[_0x5635('0x3e')]=_[_0x5635('0x41')](_0x34f974['where'],{'$or':_[_0x5635('0x31')](_0x3decc8,function(_0x1de1ab){if(_0x1de1ab[_0x5635('0x34')]!=='VIRTUAL'){var _0x3a5ce3={};_0x3a5ce3[_0x1de1ab[_0x5635('0x2e')]]={'$like':'%'+_0x23a1b1[_0x5635('0x37')][_0x5635('0x42')]+'%'};return _0x3a5ce3;}})});}_0x34f974=_[_0x5635('0x41')]({},_0x34f974,_0x23a1b1[_0x5635('0x43')]);var _0xbf25d5={'where':_0x34f974[_0x5635('0x3e')]};return db[_0x5635('0x32')]['count'](_0xbf25d5)[_0x5635('0x27')](function(_0x243de2){_0x58b0a8[_0x5635('0x20')]=_0x243de2;if(_0x23a1b1[_0x5635('0x37')]['includeAll']){_0x34f974[_0x5635('0x44')]=[{'all':!![]}];}return db[_0x5635('0x32')][_0x5635('0x45')](_0x34f974);})['then'](function(_0x549c59){_0x58b0a8[_0x5635('0x46')]=_0x549c59;return _0x58b0a8;})['then'](respondWithFilteredResult(_0x4d0e21,_0x34f974))[_0x5635('0x47')](handleError(_0x4d0e21,null));};exports[_0x5635('0x48')]=function(_0x570c01,_0x19f7e7){var _0x294e89={'raw':![],'where':{'id':_0x570c01[_0x5635('0x49')]['id']}},_0x217e43={};_0x217e43['model']=_[_0x5635('0x4a')](db[_0x5635('0x32')][_0x5635('0x4b')]);_0x217e43[_0x5635('0x37')]=_[_0x5635('0x4a')](_0x570c01[_0x5635('0x37')]);_0x217e43['filters']=_[_0x5635('0x38')](_0x217e43[_0x5635('0x36')],_0x217e43['query']);_0x294e89['attributes']=_[_0x5635('0x38')](_0x217e43[_0x5635('0x36')],qs[_0x5635('0x3a')](_0x570c01[_0x5635('0x37')][_0x5635('0x3a')]));_0x294e89['attributes']=_0x294e89[_0x5635('0x39')][_0x5635('0x4c')]?_0x294e89['attributes']:_0x217e43['model'];if(_0x570c01['query'][_0x5635('0x4d')]){_0x294e89['include']=[{'all':!![]}];}_0x294e89=_['merge']({},_0x294e89,_0x570c01[_0x5635('0x43')]);return db[_0x5635('0x32')][_0x5635('0x4e')](_0x294e89)[_0x5635('0x27')](handleEntityNotFound(_0x19f7e7,null))['then'](respondWithResult(_0x19f7e7,null))[_0x5635('0x47')](handleError(_0x19f7e7,null));};exports[_0x5635('0x4f')]=function(_0x3dd045,_0x46f270){return db[_0x5635('0x32')][_0x5635('0x4f')](_0x3dd045[_0x5635('0x50')],{})['then'](function(_0x46b96a){var _0x1968e8=_0x3dd045[_0x5635('0x51')]['get']({'plain':!![]});if(!_0x1968e8)throw new Error(_0x5635('0x52'));if(_0x1968e8[_0x5635('0x53')]===_0x5635('0x51')){var _0x5efa2e=_0x46b96a[_0x5635('0x28')]({'plain':!![]});var _0x967bf9='Scheduler';return db['UserProfileSection'][_0x5635('0x4e')]({'where':{'name':_0x967bf9,'userProfileId':_0x1968e8[_0x5635('0x54')]},'raw':!![]})[_0x5635('0x27')](function(_0xe35cae){if(_0xe35cae&&_0xe35cae['autoAssociation']===0x0){return db[_0x5635('0x2a')]['create']({'name':_0x5efa2e[_0x5635('0x2e')],'resourceId':_0x5efa2e['id'],'type':_0xe35cae[_0x5635('0x2e')],'sectionId':_0xe35cae['id']},{})[_0x5635('0x27')](function(){return _0x46b96a;});}else{return _0x46b96a;}})[_0x5635('0x47')](function(_0x514f1c){logger['error'](_0x5635('0x55'),_0x514f1c);throw _0x514f1c;});}return _0x46b96a;})[_0x5635('0x27')](respondWithResult(_0x46f270,0xc9))[_0x5635('0x47')](handleError(_0x46f270,null));};exports[_0x5635('0x26')]=function(_0x20b921,_0x3ecaae){if(_0x20b921[_0x5635('0x50')]['id']){delete _0x20b921[_0x5635('0x50')]['id'];}return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x20b921[_0x5635('0x49')]['id']}})[_0x5635('0x27')](handleEntityNotFound(_0x3ecaae,null))[_0x5635('0x27')](saveUpdates(_0x20b921[_0x5635('0x50')],null))[_0x5635('0x27')](respondWithResult(_0x3ecaae,null))[_0x5635('0x47')](handleError(_0x3ecaae,null));};exports['destroy']=function(_0x305747,_0x43bf94){return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x305747[_0x5635('0x49')]['id']}})['then'](handleEntityNotFound(_0x43bf94,null))[_0x5635('0x27')](removeEntity(_0x43bf94,null))[_0x5635('0x47')](handleError(_0x43bf94,null));};exports[_0x5635('0x56')]=function(_0x13f9b8,_0x118744,_0x404f69){var _0x2248ae=require(_0x5635('0x57'));return db[_0x5635('0x32')][_0x5635('0x4e')]({'where':{'id':_0x13f9b8[_0x5635('0x49')]['id']},'raw':!![]})[_0x5635('0x27')](handleEntityNotFound(_0x118744,null))[_0x5635('0x27')](function(){_0x2248ae['run'](_0x13f9b8[_0x5635('0x49')]['id']);})[_0x5635('0x27')](respondWithStatusCode(_0x118744,null))[_0x5635('0x47')](handleError(_0x118744,null));}; \ No newline at end of file +var _0x3a37=['catch','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','status','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','map','Schedule','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows'];(function(_0x492eba,_0x54945f){var _0x195faa=function(_0x186d7f){while(--_0x186d7f){_0x492eba['push'](_0x492eba['shift']());}};_0x195faa(++_0x54945f);}(_0x3a37,0xaf));var _0x73a3=function(_0x3ae812,_0x104449){_0x3ae812=_0x3ae812-0x0;var _0x4dd965=_0x3a37[_0x3ae812];return _0x4dd965;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73a3('0x0'));var jsonpatch=require(_0x73a3('0x1'));var rp=require('request-promise');var moment=require(_0x73a3('0x2'));var BPromise=require(_0x73a3('0x3'));var Mustache=require(_0x73a3('0x4'));var util=require('util');var path=require(_0x73a3('0x5'));var sox=require(_0x73a3('0x6'));var csv=require(_0x73a3('0x7'));var ejs=require(_0x73a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73a3('0x9'));var squel=require(_0x73a3('0xa'));var crypto=require(_0x73a3('0xb'));var jsforce=require(_0x73a3('0xc'));var deskjs=require(_0x73a3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x73a3('0xe'));var Papa=require('papaparse');var Redis=require(_0x73a3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x73a3('0x10'));var as=require(_0x73a3('0x11'));var hardwareService=require(_0x73a3('0x12'));var logger=require('../../config/logger')(_0x73a3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x73a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58a6cb,_0x6ee9d6){_0x6ee9d6=_0x6ee9d6||0xcc;return function(_0x4cadc4){if(_0x4cadc4){return _0x58a6cb['sendStatus'](_0x6ee9d6);}return _0x58a6cb[_0x73a3('0x15')](_0x6ee9d6)['end']();};}function respondWithResult(_0xa53e1e,_0x28b619){_0x28b619=_0x28b619||0xc8;return function(_0x3709a4){if(_0x3709a4){return _0xa53e1e[_0x73a3('0x15')](_0x28b619)[_0x73a3('0x16')](_0x3709a4);}};}function respondWithFilteredResult(_0x5cc9fd,_0x5135bf){return function(_0x5e8700){if(_0x5e8700){var _0x5edd4b=typeof _0x5135bf[_0x73a3('0x17')]==='undefined'&&typeof _0x5135bf[_0x73a3('0x18')]==='undefined';var _0x3c73eb=_0x5e8700[_0x73a3('0x19')];var _0x20ab6b=_0x5edd4b?0x0:_0x5135bf['offset'];var _0x484c25=_0x5edd4b?_0x5e8700[_0x73a3('0x19')]:_0x5135bf['offset']+_0x5135bf[_0x73a3('0x18')];var _0x2d2fb2;if(_0x484c25>=_0x3c73eb){_0x484c25=_0x3c73eb;_0x2d2fb2=0xc8;}else{_0x2d2fb2=0xce;}_0x5cc9fd[_0x73a3('0x15')](_0x2d2fb2);return _0x5cc9fd['set'](_0x73a3('0x1a'),_0x20ab6b+'-'+_0x484c25+'/'+_0x3c73eb)[_0x73a3('0x16')](_0x5e8700);}return null;};}function patchUpdates(_0x4256b9){return function(_0x52c033){try{jsonpatch['apply'](_0x52c033,_0x4256b9,!![]);}catch(_0x31d3fe){return BPromise[_0x73a3('0x1b')](_0x31d3fe);}return _0x52c033[_0x73a3('0x1c')]();};}function saveUpdates(_0x12b715,_0x70dbbd){return function(_0x48b2c3){if(_0x48b2c3){return _0x48b2c3[_0x73a3('0x1d')](_0x12b715)[_0x73a3('0x1e')](function(_0x2c2f90){return _0x2c2f90;});}return null;};}function removeEntity(_0x13be79,_0x4dab72){return function(_0x3f6c2e){if(_0x3f6c2e){return _0x3f6c2e[_0x73a3('0x1f')]()[_0x73a3('0x1e')](function(){var _0x583bd2=_0x3f6c2e[_0x73a3('0x20')]({'plain':!![]});var _0x462c04=_0x73a3('0x21');return db[_0x73a3('0x22')][_0x73a3('0x1f')]({'where':{'type':_0x462c04,'resourceId':_0x583bd2['id']}})['then'](function(){return _0x3f6c2e;});})['then'](function(){_0x13be79[_0x73a3('0x15')](0xcc)[_0x73a3('0x23')]();});}};}function handleEntityNotFound(_0x35d9a2,_0x3bed7b){return function(_0x54a6b7){if(!_0x54a6b7){_0x35d9a2[_0x73a3('0x24')](0x194);}return _0x54a6b7;};}function handleError(_0x4f97ba,_0x3e012e){_0x3e012e=_0x3e012e||0x1f4;return function(_0x372a99){logger[_0x73a3('0x25')](_0x372a99[_0x73a3('0x26')]);if(_0x372a99[_0x73a3('0x27')]){delete _0x372a99[_0x73a3('0x27')];}_0x4f97ba[_0x73a3('0x15')](_0x3e012e)[_0x73a3('0x28')](_0x372a99);};}exports['index']=function(_0x369667,_0x55b2c6){var _0xf1d92f={},_0x3f9942={},_0x5c0afc={'count':0x0,'rows':[]};var _0x379a2e=_[_0x73a3('0x29')](db[_0x73a3('0x2a')]['rawAttributes'],function(_0x179ba4){return{'name':_0x179ba4[_0x73a3('0x2b')],'type':_0x179ba4['type']['key']};});_0x3f9942[_0x73a3('0x2c')]=_['map'](_0x379a2e,_0x73a3('0x27'));_0x3f9942[_0x73a3('0x2d')]=_[_0x73a3('0x2e')](_0x369667[_0x73a3('0x2d')]);_0x3f9942[_0x73a3('0x2f')]=_[_0x73a3('0x30')](_0x3f9942[_0x73a3('0x2c')],_0x3f9942['query']);_0xf1d92f[_0x73a3('0x31')]=_['intersection'](_0x3f9942['model'],qs[_0x73a3('0x32')](_0x369667['query'][_0x73a3('0x32')]));_0xf1d92f[_0x73a3('0x31')]=_0xf1d92f[_0x73a3('0x31')][_0x73a3('0x33')]?_0xf1d92f[_0x73a3('0x31')]:_0x3f9942[_0x73a3('0x2c')];if(!_0x369667[_0x73a3('0x2d')][_0x73a3('0x34')](_0x73a3('0x35'))){_0xf1d92f[_0x73a3('0x18')]=qs[_0x73a3('0x18')](_0x369667[_0x73a3('0x2d')]['limit']);_0xf1d92f['offset']=qs[_0x73a3('0x17')](_0x369667[_0x73a3('0x2d')]['offset']);}_0xf1d92f[_0x73a3('0x36')]=qs[_0x73a3('0x37')](_0x369667[_0x73a3('0x2d')][_0x73a3('0x37')]);_0xf1d92f[_0x73a3('0x38')]=qs['filters'](_[_0x73a3('0x39')](_0x369667[_0x73a3('0x2d')],_0x3f9942[_0x73a3('0x2f')]),_0x379a2e);if(_0x369667['query'][_0x73a3('0x3a')]){_0xf1d92f[_0x73a3('0x38')]=_[_0x73a3('0x3b')](_0xf1d92f[_0x73a3('0x38')],{'$or':_[_0x73a3('0x29')](_0x379a2e,function(_0x39c082){if(_0x39c082[_0x73a3('0x3c')]!=='VIRTUAL'){var _0x425078={};_0x425078[_0x39c082[_0x73a3('0x27')]]={'$like':'%'+_0x369667[_0x73a3('0x2d')][_0x73a3('0x3a')]+'%'};return _0x425078;}})});}_0xf1d92f=_[_0x73a3('0x3b')]({},_0xf1d92f,_0x369667['options']);var _0x1ef0b7={'where':_0xf1d92f[_0x73a3('0x38')]};return db[_0x73a3('0x2a')]['count'](_0x1ef0b7)[_0x73a3('0x1e')](function(_0x4356a7){_0x5c0afc[_0x73a3('0x19')]=_0x4356a7;if(_0x369667[_0x73a3('0x2d')][_0x73a3('0x3d')]){_0xf1d92f[_0x73a3('0x3e')]=[{'all':!![]}];}return db['Schedule'][_0x73a3('0x3f')](_0xf1d92f);})['then'](function(_0x3f51b7){_0x5c0afc[_0x73a3('0x40')]=_0x3f51b7;return _0x5c0afc;})[_0x73a3('0x1e')](respondWithFilteredResult(_0x55b2c6,_0xf1d92f))[_0x73a3('0x41')](handleError(_0x55b2c6,null));};exports['show']=function(_0x30549c,_0x36beca){var _0x30c0ab={'raw':![],'where':{'id':_0x30549c[_0x73a3('0x42')]['id']}},_0x5d050d={};_0x5d050d['model']=_[_0x73a3('0x2e')](db[_0x73a3('0x2a')][_0x73a3('0x43')]);_0x5d050d[_0x73a3('0x2d')]=_['keys'](_0x30549c[_0x73a3('0x2d')]);_0x5d050d[_0x73a3('0x2f')]=_['intersection'](_0x5d050d['model'],_0x5d050d[_0x73a3('0x2d')]);_0x30c0ab[_0x73a3('0x31')]=_[_0x73a3('0x30')](_0x5d050d[_0x73a3('0x2c')],qs[_0x73a3('0x32')](_0x30549c[_0x73a3('0x2d')]['fields']));_0x30c0ab[_0x73a3('0x31')]=_0x30c0ab[_0x73a3('0x31')]['length']?_0x30c0ab[_0x73a3('0x31')]:_0x5d050d[_0x73a3('0x2c')];if(_0x30549c[_0x73a3('0x2d')]['includeAll']){_0x30c0ab[_0x73a3('0x3e')]=[{'all':!![]}];}_0x30c0ab=_[_0x73a3('0x3b')]({},_0x30c0ab,_0x30549c[_0x73a3('0x44')]);return db[_0x73a3('0x2a')][_0x73a3('0x45')](_0x30c0ab)['then'](handleEntityNotFound(_0x36beca,null))['then'](respondWithResult(_0x36beca,null))[_0x73a3('0x41')](handleError(_0x36beca,null));};exports[_0x73a3('0x46')]=function(_0x2603cd,_0x4ebfc9){return db['Schedule'][_0x73a3('0x46')](_0x2603cd[_0x73a3('0x47')],{})['then'](function(_0x4799f6){var _0x5420f9=_0x2603cd[_0x73a3('0x48')][_0x73a3('0x20')]({'plain':!![]});if(!_0x5420f9)throw new Error(_0x73a3('0x49'));if(_0x5420f9[_0x73a3('0x4a')]===_0x73a3('0x48')){var _0x18c922=_0x4799f6[_0x73a3('0x20')]({'plain':!![]});var _0x381765=_0x73a3('0x21');return db[_0x73a3('0x4b')][_0x73a3('0x45')]({'where':{'name':_0x381765,'userProfileId':_0x5420f9['userProfileId']},'raw':!![]})[_0x73a3('0x1e')](function(_0x944b11){if(_0x944b11&&_0x944b11[_0x73a3('0x4c')]===0x0){return db[_0x73a3('0x22')][_0x73a3('0x46')]({'name':_0x18c922[_0x73a3('0x27')],'resourceId':_0x18c922['id'],'type':_0x944b11[_0x73a3('0x27')],'sectionId':_0x944b11['id']},{})[_0x73a3('0x1e')](function(){return _0x4799f6;});}else{return _0x4799f6;}})['catch'](function(_0xc901b4){logger['error'](_0x73a3('0x4d'),_0xc901b4);throw _0xc901b4;});}return _0x4799f6;})[_0x73a3('0x1e')](respondWithResult(_0x4ebfc9,0xc9))[_0x73a3('0x41')](handleError(_0x4ebfc9,null));};exports['update']=function(_0x4fceba,_0x3370d2){if(_0x4fceba[_0x73a3('0x47')]['id']){delete _0x4fceba[_0x73a3('0x47')]['id'];}return db[_0x73a3('0x2a')][_0x73a3('0x45')]({'where':{'id':_0x4fceba['params']['id']}})[_0x73a3('0x1e')](handleEntityNotFound(_0x3370d2,null))[_0x73a3('0x1e')](saveUpdates(_0x4fceba[_0x73a3('0x47')],null))[_0x73a3('0x1e')](respondWithResult(_0x3370d2,null))['catch'](handleError(_0x3370d2,null));};exports[_0x73a3('0x1f')]=function(_0x885398,_0x547387){return db['Schedule'][_0x73a3('0x45')]({'where':{'id':_0x885398[_0x73a3('0x42')]['id']}})[_0x73a3('0x1e')](handleEntityNotFound(_0x547387,null))[_0x73a3('0x1e')](removeEntity(_0x547387,null))['catch'](handleError(_0x547387,null));};exports[_0x73a3('0x4e')]=function(_0x382720,_0x3c200c,_0x240c7d){var _0xa4bb6e=require(_0x73a3('0x4f'));return db[_0x73a3('0x2a')][_0x73a3('0x45')]({'where':{'id':_0x382720[_0x73a3('0x42')]['id']},'raw':!![]})[_0x73a3('0x1e')](handleEntityNotFound(_0x3c200c,null))[_0x73a3('0x1e')](function(){_0xa4bb6e[_0x73a3('0x4e')](_0x382720['params']['id']);})['then'](respondWithStatusCode(_0x3c200c,null))[_0x73a3('0x41')](handleError(_0x3c200c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f50aa87..5d83f5a 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 _0x7fa4=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x7fa4,0x197));var _0x47fa=function(_0x52d042,_0x4c96a7){_0x52d042=_0x52d042-0x0;var _0x48b524=_0x7fa4[_0x52d042];return _0x48b524;};'use strict';var _=require(_0x47fa('0x0'));var util=require('util');var logger=require(_0x47fa('0x1'))(_0x47fa('0x2'));var moment=require(_0x47fa('0x3'));var BPromise=require('bluebird');var rp=require(_0x47fa('0x4'));var fs=require('fs');var path=require(_0x47fa('0x5'));var rimraf=require('rimraf');var config=require(_0x47fa('0x6'));var attributes=require(_0x47fa('0x7'));module['exports']=function(_0x395f61,_0x37abda){return _0x395f61[_0x47fa('0x8')](_0x47fa('0x9'),attributes,{'tableName':_0x47fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba75=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules'];(function(_0x43a512,_0x915abe){var _0x58e069=function(_0x30d318){while(--_0x30d318){_0x43a512['push'](_0x43a512['shift']());}};_0x58e069(++_0x915abe);}(_0xba75,0x15c));var _0x5ba7=function(_0xeceed2,_0x1167ab){_0xeceed2=_0xeceed2-0x0;var _0x2ddb79=_0xba75[_0xeceed2];return _0x2ddb79;};'use strict';var _=require(_0x5ba7('0x0'));var util=require(_0x5ba7('0x1'));var logger=require(_0x5ba7('0x2'))(_0x5ba7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ba7('0x4'));var fs=require('fs');var path=require(_0x5ba7('0x5'));var rimraf=require(_0x5ba7('0x6'));var config=require(_0x5ba7('0x7'));var attributes=require(_0x5ba7('0x8'));module[_0x5ba7('0x9')]=function(_0x2d0475,_0x5ec534){return _0x2d0475['define'](_0x5ba7('0xa'),attributes,{'tableName':_0x5ba7('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 5a9fb1d..76658e9 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 _0xc776=['bluebird','randomstring','ioredis','../../config/environment','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x396e47,_0x3c102d){var _0x1417e9=function(_0x649ff6){while(--_0x649ff6){_0x396e47['push'](_0x396e47['shift']());}};_0x1417e9(++_0x3c102d);}(_0xc776,0x1a1));var _0x6c77=function(_0xc5d72f,_0x32493a){_0xc5d72f=_0xc5d72f-0x0;var _0x571b6f=_0xc776[_0xc5d72f];return _0x571b6f;};'use strict';var _=require(_0x6c77('0x0'));var util=require(_0x6c77('0x1'));var moment=require(_0x6c77('0x2'));var BPromise=require(_0x6c77('0x3'));var rs=require(_0x6c77('0x4'));var fs=require('fs');var Redis=require(_0x6c77('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6c77('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c77('0x7')][_0x6c77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf1654d,_0x47a1ab,_0x4f02de){return new BPromise(function(_0xb0b6ea,_0x586d2a){return client[_0x6c77('0x9')](_0xf1654d,_0x4f02de)['then'](function(_0x4f91ea){logger[_0x6c77('0xa')](_0x6c77('0xb'),_0x47a1ab,'request\x20sent');logger[_0x6c77('0xc')](_0x6c77('0xd'),_0x47a1ab,_0x6c77('0xe'),JSON[_0x6c77('0xf')](_0x4f91ea));if(_0x4f91ea[_0x6c77('0x10')]){if(_0x4f91ea[_0x6c77('0x10')][_0x6c77('0x11')]===0x1f4){logger['error'](_0x6c77('0xb'),_0x47a1ab,_0x4f91ea[_0x6c77('0x10')]['message']);return _0x586d2a(_0x4f91ea['error'][_0x6c77('0x12')]);}logger[_0x6c77('0x10')](_0x6c77('0xb'),_0x47a1ab,_0x4f91ea['error'][_0x6c77('0x12')]);return _0xb0b6ea(_0x4f91ea[_0x6c77('0x10')]['message']);}else{logger[_0x6c77('0xa')]('Schedule,\x20%s,\x20%s',_0x47a1ab,_0x6c77('0xe'));_0xb0b6ea(_0x4f91ea[_0x6c77('0x13')][_0x6c77('0x12')]);}})[_0x6c77('0x14')](function(_0x4fbcf8){logger[_0x6c77('0x10')]('Schedule,\x20%s,\x20%s',_0x47a1ab,_0x4fbcf8);_0x586d2a(_0x4fbcf8);});});} \ No newline at end of file +var _0x5787=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x469b9f,_0xb7f2af){var _0x374be9=function(_0x1dd6f4){while(--_0x1dd6f4){_0x469b9f['push'](_0x469b9f['shift']());}};_0x374be9(++_0xb7f2af);}(_0x5787,0x79));var _0x7578=function(_0x261720,_0xb95245){_0x261720=_0x261720-0x0;var _0x47e0f4=_0x5787[_0x261720];return _0x47e0f4;};'use strict';var _=require('lodash');var util=require(_0x7578('0x0'));var moment=require(_0x7578('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7578('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7578('0x3'));var logger=require(_0x7578('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7578('0x5')][_0x7578('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31514d,_0x50b303,_0x461d11){return new BPromise(function(_0x594157,_0x1564ff){return client[_0x7578('0x7')](_0x31514d,_0x461d11)[_0x7578('0x8')](function(_0x1d6040){logger[_0x7578('0x9')](_0x7578('0xa'),_0x50b303,_0x7578('0xb'));logger['debug'](_0x7578('0xc'),_0x50b303,_0x7578('0xb'),JSON[_0x7578('0xd')](_0x1d6040));if(_0x1d6040[_0x7578('0xe')]){if(_0x1d6040['error'][_0x7578('0xf')]===0x1f4){logger[_0x7578('0xe')](_0x7578('0xa'),_0x50b303,_0x1d6040[_0x7578('0xe')]['message']);return _0x1564ff(_0x1d6040['error'][_0x7578('0x10')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x50b303,_0x1d6040[_0x7578('0xe')][_0x7578('0x10')]);return _0x594157(_0x1d6040['error']['message']);}else{logger[_0x7578('0x9')](_0x7578('0xa'),_0x50b303,'request\x20sent');_0x594157(_0x1d6040[_0x7578('0x11')][_0x7578('0x10')]);}})[_0x7578('0x12')](function(_0xb49c26){logger[_0x7578('0xe')](_0x7578('0xa'),_0x50b303,_0xb49c26);_0x1564ff(_0xb49c26);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 22cf296..da02362 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 _0x51aa=['./screenRecording.controller','get','index','/describe','isAuthenticated','/:id','/:id/download','download','post','create','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x58361c,_0x3e8833){var _0x423bcc=function(_0x4228a6){while(--_0x4228a6){_0x58361c['push'](_0x58361c['shift']());}};_0x423bcc(++_0x3e8833);}(_0x51aa,0x1ed));var _0xa51a=function(_0x114c82,_0x89fb23){_0x114c82=_0x114c82-0x0;var _0x10889c=_0x51aa[_0x114c82];return _0x10889c;};'use strict';var multer=require(_0xa51a('0x0'));var util=require('util');var path=require(_0xa51a('0x1'));var timeout=require(_0xa51a('0x2'));var express=require('express');var router=express[_0xa51a('0x3')]();var fs_extra=require(_0xa51a('0x4'));var auth=require(_0xa51a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa51a('0x6'));var controller=require(_0xa51a('0x7'));router[_0xa51a('0x8')]('/',auth['isAuthenticated'](),controller[_0xa51a('0x9')]);router[_0xa51a('0x8')](_0xa51a('0xa'),auth[_0xa51a('0xb')](),controller['describe']);router['get'](_0xa51a('0xc'),auth[_0xa51a('0xb')](),controller['show']);router[_0xa51a('0x8')](_0xa51a('0xd'),auth[_0xa51a('0xb')](),controller[_0xa51a('0xe')]);router[_0xa51a('0xf')]('/',auth[_0xa51a('0xb')](),controller[_0xa51a('0x10')]);router['put'](_0xa51a('0xc'),auth[_0xa51a('0xb')](),controller[_0xa51a('0x11')]);router[_0xa51a('0x12')](_0xa51a('0xc'),auth['isAuthenticated'](),controller[_0xa51a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7cba=['create','update','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post'];(function(_0xd4b7e3,_0x36c198){var _0x14e1c2=function(_0x2bcc4b){while(--_0x2bcc4b){_0xd4b7e3['push'](_0xd4b7e3['shift']());}};_0x14e1c2(++_0x36c198);}(_0x7cba,0x158));var _0xa7cb=function(_0x12e8c0,_0x1399e1){_0x12e8c0=_0x12e8c0-0x0;var _0x423c2a=_0x7cba[_0x12e8c0];return _0x423c2a;};'use strict';var multer=require(_0xa7cb('0x0'));var util=require('util');var path=require(_0xa7cb('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7cb('0x2'));var router=express[_0xa7cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa7cb('0x4'));var interaction=require(_0xa7cb('0x5'));var config=require(_0xa7cb('0x6'));var controller=require(_0xa7cb('0x7'));router[_0xa7cb('0x8')]('/',auth[_0xa7cb('0x9')](),controller[_0xa7cb('0xa')]);router[_0xa7cb('0x8')](_0xa7cb('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa7cb('0x8')](_0xa7cb('0xc'),auth['isAuthenticated'](),controller[_0xa7cb('0xd')]);router[_0xa7cb('0x8')](_0xa7cb('0xe'),auth[_0xa7cb('0x9')](),controller[_0xa7cb('0xf')]);router[_0xa7cb('0x10')]('/',auth['isAuthenticated'](),controller[_0xa7cb('0x11')]);router['put'](_0xa7cb('0xc'),auth[_0xa7cb('0x9')](),controller[_0xa7cb('0x12')]);router['delete'](_0xa7cb('0xc'),auth[_0xa7cb('0x9')](),controller['destroy']);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 a5c15ef..042ab34 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 _0xbe9d=['extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value'];(function(_0x5a72f2,_0x72f5f){var _0x15b408=function(_0x585799){while(--_0x585799){_0x5a72f2['push'](_0x5a72f2['shift']());}};_0x15b408(++_0x72f5f);}(_0xbe9d,0x99));var _0xdbe9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbe9d[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xdbe9('0x0'));var moment=require(_0xdbe9('0x1'));var path=require(_0xdbe9('0x2'));var config=require(_0xdbe9('0x3'));module[_0xdbe9('0x4')]={'format':{'type':Sequelize[_0xdbe9('0x5')],'get':function(){return this[_0xdbe9('0x6')](_0xdbe9('0x7'))?path[_0xdbe9('0x8')](this[_0xdbe9('0x6')](_0xdbe9('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xdbe9('0x9')]},'channel':{'type':Sequelize[_0xdbe9('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x56e9be){var _0x3d5165=_0x56e9be[_0xdbe9('0xa')](/\\/g,'/');this['setDataValue'](_0xdbe9('0x7'),_0x3d5165);}},'rating':{'type':Sequelize[_0xdbe9('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdbe9('0xb')],'set':function(_0x56470c){this['setDataValue'](_0xdbe9('0xc'),moment()[_0xdbe9('0xd')](_0x56470c,'ms'));this[_0xdbe9('0xe')](_0xdbe9('0xf'),moment());this['setDataValue'](_0xdbe9('0x10'),_0x56470c);}},'startedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xc')))['format'](_0xdbe9('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xf')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'createdAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x14')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'updatedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x15')))[_0xdbe9('0x16')](_0xdbe9('0x12'))['toString']();}}}; \ No newline at end of file +var _0x3ef7=['extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x4c2a34,_0x498f60){var _0x3b0e5f=function(_0x529312){while(--_0x529312){_0x4c2a34['push'](_0x4c2a34['shift']());}};_0x3b0e5f(++_0x498f60);}(_0x3ef7,0xa2));var _0x73ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ef7[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x73ef('0x0'));var moment=require('moment');var path=require(_0x73ef('0x1'));var config=require(_0x73ef('0x2'));module[_0x73ef('0x3')]={'format':{'type':Sequelize[_0x73ef('0x4')],'get':function(){return this[_0x73ef('0x5')]('value')?path[_0x73ef('0x6')](this[_0x73ef('0x5')](_0x73ef('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x73ef('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x73ef('0x8')],'set':function(_0x137f35){var _0x1bc285=_0x137f35[_0x73ef('0x9')](/\\/g,'/');this[_0x73ef('0xa')]('value',_0x1bc285);}},'rating':{'type':Sequelize[_0x73ef('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x73ef('0xb')],'set':function(_0x50098a){this[_0x73ef('0xa')](_0x73ef('0xc'),moment()[_0x73ef('0xd')](_0x50098a,'ms'));this[_0x73ef('0xa')](_0x73ef('0xe'),moment());this['setDataValue'](_0x73ef('0xf'),_0x50098a);}},'startedAt':{'type':Sequelize[_0x73ef('0x10')],'get':function(){return moment(this[_0x73ef('0x5')](_0x73ef('0xc')))[_0x73ef('0x11')](_0x73ef('0x12'))[_0x73ef('0x13')]();}},'closedAt':{'type':Sequelize[_0x73ef('0x10')],'get':function(){return moment(this[_0x73ef('0x5')](_0x73ef('0xe')))[_0x73ef('0x11')](_0x73ef('0x12'))[_0x73ef('0x13')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x73ef('0x5')]('createdAt'))[_0x73ef('0x11')](_0x73ef('0x12'))[_0x73ef('0x13')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x73ef('0x5')](_0x73ef('0x14')))['format'](_0x73ef('0x12'))[_0x73ef('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4041ef9..f4799ea 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 _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../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','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x464bf8,_0x1af475){var _0x5e4ef7=function(_0x51d120){while(--_0x51d120){_0x464bf8['push'](_0x464bf8['shift']());}};_0x5e4ef7(++_0x1af475);}(_0xb138,0x1dd));var _0x8b13=function(_0x2a8ee5,_0x562354){_0x2a8ee5=_0x2a8ee5-0x0;var _0x58dc84=_0xb138[_0x2a8ee5];return _0x58dc84;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file +var _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2e494d,_0xc92564){_0x2e494d=_0x2e494d-0x0;var _0x37c995=_0x4c4e[_0x2e494d];return _0x37c995;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 9905680..d46fe3f 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 _0x23ef=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x406586,_0x405e97){var _0x453bf3=function(_0x396770){while(--_0x396770){_0x406586['push'](_0x406586['shift']());}};_0x453bf3(++_0x405e97);}(_0x23ef,0x179));var _0xf23e=function(_0x4366a3,_0x4e8c2f){_0x4366a3=_0x4366a3-0x0;var _0x357319=_0x23ef[_0x4366a3];return _0x357319;};'use strict';var _=require(_0xf23e('0x0'));var util=require(_0xf23e('0x1'));var logger=require(_0xf23e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf23e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf23e('0x4'));var rimraf=require(_0xf23e('0x5'));var config=require(_0xf23e('0x6'));var attributes=require(_0xf23e('0x7'));module[_0xf23e('0x8')]=function(_0x57a972,_0x17f3fe){return _0x57a972[_0xf23e('0x9')](_0xf23e('0xa'),attributes,{'tableName':_0xf23e('0xb'),'paranoid':![],'indexes':[{'name':_0xf23e('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x55df=['define','ScreenRecording','interactionid','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x5b66e9,_0x29eddd){var _0x2105b6=function(_0x38190f){while(--_0x38190f){_0x5b66e9['push'](_0x5b66e9['shift']());}};_0x2105b6(++_0x29eddd);}(_0x55df,0x6f));var _0xf55d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x55df[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xf55d('0x0'));var util=require('util');var logger=require(_0xf55d('0x1'))(_0xf55d('0x2'));var moment=require(_0xf55d('0x3'));var BPromise=require('bluebird');var rp=require(_0xf55d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf55d('0x5'));var config=require(_0xf55d('0x6'));var attributes=require(_0xf55d('0x7'));module[_0xf55d('0x8')]=function(_0x5ba29b,_0x22d269){return _0x5ba29b[_0xf55d('0x9')](_0xf55d('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xf55d('0xb'),'fields':[_0xf55d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index ab0844f..8884e0f 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 _0x6d24=['info','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x10aad9,_0x6483d5){var _0x6108d2=function(_0x27a39e){while(--_0x27a39e){_0x10aad9['push'](_0x10aad9['shift']());}};_0x6108d2(++_0x6483d5);}(_0x6d24,0x68));var _0x46d2=function(_0x33cc25,_0x3a332e){_0x33cc25=_0x33cc25-0x0;var _0x8e1967=_0x6d24[_0x33cc25];return _0x8e1967;};'use strict';var _=require(_0x46d2('0x0'));var util=require(_0x46d2('0x1'));var moment=require(_0x46d2('0x2'));var BPromise=require(_0x46d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46d2('0x5'))(_0x46d2('0x6'));var config=require('../../config/environment');var jayson=require(_0x46d2('0x7'));var client=jayson[_0x46d2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7d70,_0x589772,_0x43fb68){return new BPromise(function(_0x45c55a,_0x5ca6f5){return client[_0x46d2('0x9')](_0x4c7d70,_0x43fb68)['then'](function(_0x521a93){logger[_0x46d2('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x589772,'request\x20sent');logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x589772,_0x46d2('0xb'),JSON[_0x46d2('0xc')](_0x521a93));if(_0x521a93[_0x46d2('0xd')]){if(_0x521a93[_0x46d2('0xd')][_0x46d2('0xe')]===0x1f4){logger[_0x46d2('0xd')](_0x46d2('0xf'),_0x589772,_0x521a93['error']['message']);return _0x5ca6f5(_0x521a93['error'][_0x46d2('0x10')]);}logger[_0x46d2('0xd')](_0x46d2('0xf'),_0x589772,_0x521a93[_0x46d2('0xd')][_0x46d2('0x10')]);return _0x45c55a(_0x521a93[_0x46d2('0xd')][_0x46d2('0x10')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x589772,'request\x20sent');_0x45c55a(_0x521a93[_0x46d2('0x11')][_0x46d2('0x10')]);}})[_0x46d2('0x12')](function(_0x4e0c15){logger['error'](_0x46d2('0xf'),_0x589772,_0x4e0c15);_0x5ca6f5(_0x4e0c15);});});} \ No newline at end of file +var _0x8b7f=['../../config/environment','http','request','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b7f,0x1b0));var _0xf8b7=function(_0x373e61,_0x3abac1){_0x373e61=_0x373e61-0x0;var _0x518839=_0x8b7f[_0x373e61];return _0x518839;};'use strict';var _=require(_0xf8b7('0x0'));var util=require(_0xf8b7('0x1'));var moment=require(_0xf8b7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8b7('0x3'));var db=require(_0xf8b7('0x4'))['db'];var utils=require(_0xf8b7('0x5'));var logger=require(_0xf8b7('0x6'))(_0xf8b7('0x7'));var config=require(_0xf8b7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e898f,_0x2d2efc,_0x3403ee){return new BPromise(function(_0x429d50,_0x5bba90){return client[_0xf8b7('0xa')](_0x3e898f,_0x3403ee)['then'](function(_0x95832){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x2d2efc,_0xf8b7('0xb'));logger[_0xf8b7('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2d2efc,_0xf8b7('0xb'),JSON[_0xf8b7('0xd')](_0x95832));if(_0x95832['error']){if(_0x95832[_0xf8b7('0xe')][_0xf8b7('0xf')]===0x1f4){logger['error'](_0xf8b7('0x10'),_0x2d2efc,_0x95832['error'][_0xf8b7('0x11')]);return _0x5bba90(_0x95832[_0xf8b7('0xe')][_0xf8b7('0x11')]);}logger[_0xf8b7('0xe')](_0xf8b7('0x10'),_0x2d2efc,_0x95832[_0xf8b7('0xe')]['message']);return _0x429d50(_0x95832[_0xf8b7('0xe')][_0xf8b7('0x11')]);}else{logger[_0xf8b7('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2d2efc,_0xf8b7('0xb'));_0x429d50(_0x95832[_0xf8b7('0x13')]['message']);}})['catch'](function(_0x114af2){logger['error'](_0xf8b7('0x10'),_0x2d2efc,_0x114af2);_0x5bba90(_0x114af2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index ff68e81..0118d19 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 _0xe0ce=['index','/now','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','originalname','post','/:id/logo','file','addLogo','join','logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','favicon','extname','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe0ce,0x1b7));var _0xee0c=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0xe0ce[_0x3e8bf8];return _0x3391ce;};'use strict';var multer=require(_0xee0c('0x0'));var util=require('util');var path=require(_0xee0c('0x1'));var timeout=require(_0xee0c('0x2'));var express=require(_0xee0c('0x3'));var router=express[_0xee0c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee0c('0x5'));var interaction=require(_0xee0c('0x6'));var config=require(_0xee0c('0x7'));var controller=require(_0xee0c('0x8'));router[_0xee0c('0x9')]('/',auth[_0xee0c('0xa')](),controller[_0xee0c('0xb')]);router['get'](_0xee0c('0xc'),controller[_0xee0c('0xd')]);router[_0xee0c('0x9')](_0xee0c('0xe'),controller[_0xee0c('0xf')]);router[_0xee0c('0x9')]('/:id/logo',controller[_0xee0c('0x10')]);router['get']('/:id/logo_login',controller[_0xee0c('0x11')]);router[_0xee0c('0x9')](_0xee0c('0x12'),controller[_0xee0c('0x13')]);router[_0xee0c('0x9')](_0xee0c('0x14'),controller['getPreferred']);router[_0xee0c('0x9')](_0xee0c('0x15'),controller[_0xee0c('0x16')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x56f55f,_0x2214b1,_0xb5cc84){_0xb5cc84(null,path['join'](config[_0xee0c('0x18')],_0xee0c('0x19')));},'filename':function(_0x86ce5b,_0x4ee4b8,_0x381bf5){_0x381bf5(null,util[_0xee0c('0x1a')](_0xee0c('0x1b'),'logo',path['extname'](_0x4ee4b8[_0xee0c('0x1c')])));}})});router[_0xee0c('0x1d')](_0xee0c('0x1e'),upload['single'](_0xee0c('0x1f')),controller[_0xee0c('0x20')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x3b9232,_0x19e3dc,_0x386ba2){_0x386ba2(null,path[_0xee0c('0x21')](config['root'],_0xee0c('0x19')));},'filename':function(_0x6c2c9a,_0x5dbc5e,_0x5b6fff){_0x5b6fff(null,util['format'](_0xee0c('0x1b'),_0xee0c('0x22'),path['extname'](_0x5dbc5e['originalname'])));}})});router[_0xee0c('0x1d')](_0xee0c('0x23'),upload[_0xee0c('0x24')](_0xee0c('0x1f')),controller[_0xee0c('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x158c93,_0x3ca39d,_0x3d40e2){_0x3d40e2(null,path[_0xee0c('0x21')](config['root'],_0xee0c('0x19')));},'filename':function(_0x2fd8ff,_0x119dfe,_0x43610c){_0x43610c(null,util[_0xee0c('0x1a')]('%s%s',_0xee0c('0x26'),path['extname'](_0x119dfe[_0xee0c('0x1c')])));}})});router[_0xee0c('0x1d')](_0xee0c('0x14'),upload[_0xee0c('0x24')](_0xee0c('0x1f')),controller[_0xee0c('0x27')]);var upload=multer({'storage':multer[_0xee0c('0x17')]({'destination':function(_0x54ba85,_0x27ceb1,_0x1c831f){_0x1c831f(null,path[_0xee0c('0x21')](config[_0xee0c('0x18')],_0xee0c('0x19')));},'filename':function(_0x3865d7,_0x3c3486,_0x8394e8){_0x8394e8(null,util[_0xee0c('0x1a')](_0xee0c('0x1b'),_0xee0c('0x28'),path[_0xee0c('0x29')](_0x3c3486['originalname'])));}})});router[_0xee0c('0x1d')]('/:id/favicon',upload['single'](_0xee0c('0x1f')),controller['addFavicon']);router[_0xee0c('0x2a')](_0xee0c('0xe'),auth[_0xee0c('0xa')](),controller[_0xee0c('0x2b')]);module[_0xee0c('0x2c')]=router; \ No newline at end of file +var _0x2989=['%s%s','logo','originalname','post','single','file','diskStorage','extname','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format'];(function(_0x40d2c8,_0x7e0316){var _0xc32fe5=function(_0x54b9a9){while(--_0x54b9a9){_0x40d2c8['push'](_0x40d2c8['shift']());}};_0xc32fe5(++_0x7e0316);}(_0x2989,0x1d7));var _0x9298=function(_0x4ec728,_0x342eed){_0x4ec728=_0x4ec728-0x0;var _0x4c1c2c=_0x2989[_0x4ec728];return _0x4c1c2c;};'use strict';var multer=require(_0x9298('0x0'));var util=require(_0x9298('0x1'));var path=require(_0x9298('0x2'));var timeout=require(_0x9298('0x3'));var express=require(_0x9298('0x4'));var router=express[_0x9298('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9298('0x6'));var interaction=require(_0x9298('0x7'));var config=require(_0x9298('0x8'));var controller=require('./setting.controller');router[_0x9298('0x9')]('/',auth[_0x9298('0xa')](),controller['index']);router[_0x9298('0x9')]('/now',controller['getDate']);router[_0x9298('0x9')](_0x9298('0xb'),controller['show']);router[_0x9298('0x9')](_0x9298('0xc'),controller['getLogo']);router[_0x9298('0x9')](_0x9298('0xd'),controller[_0x9298('0xe')]);router[_0x9298('0x9')]('/:id/gdpr',controller[_0x9298('0xf')]);router[_0x9298('0x9')](_0x9298('0x10'),controller['getPreferred']);router['get'](_0x9298('0x11'),controller[_0x9298('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59452,_0xb90e2a,_0x20e087){_0x20e087(null,path[_0x9298('0x13')](config[_0x9298('0x14')],_0x9298('0x15')));},'filename':function(_0x4ce2b3,_0x588bcd,_0x33d823){_0x33d823(null,util[_0x9298('0x16')](_0x9298('0x17'),_0x9298('0x18'),path['extname'](_0x588bcd[_0x9298('0x19')])));}})});router[_0x9298('0x1a')](_0x9298('0xc'),upload[_0x9298('0x1b')](_0x9298('0x1c')),controller['addLogo']);var upload=multer({'storage':multer[_0x9298('0x1d')]({'destination':function(_0x4bd95d,_0x6473fb,_0x4e3ed2){_0x4e3ed2(null,path[_0x9298('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x16dce4,_0x2e920a,_0xa15966){_0xa15966(null,util[_0x9298('0x16')](_0x9298('0x17'),'logologin',path[_0x9298('0x1e')](_0x2e920a['originalname'])));}})});router['post'](_0x9298('0xd'),upload[_0x9298('0x1b')](_0x9298('0x1c')),controller[_0x9298('0x1f')]);var upload=multer({'storage':multer[_0x9298('0x1d')]({'destination':function(_0x596d21,_0x14846c,_0x35c2c0){_0x35c2c0(null,path[_0x9298('0x13')](config[_0x9298('0x14')],_0x9298('0x15')));},'filename':function(_0x57fa0a,_0x1c469b,_0x421e84){_0x421e84(null,util[_0x9298('0x16')](_0x9298('0x17'),_0x9298('0x20'),path['extname'](_0x1c469b[_0x9298('0x19')])));}})});router['post'](_0x9298('0x10'),upload[_0x9298('0x1b')](_0x9298('0x1c')),controller[_0x9298('0x21')]);var upload=multer({'storage':multer[_0x9298('0x1d')]({'destination':function(_0x36f929,_0x3355e5,_0x18acc3){_0x18acc3(null,path[_0x9298('0x13')](config[_0x9298('0x14')],'server/files/images/logos/'));},'filename':function(_0x172839,_0x46fd2b,_0x1c031b){_0x1c031b(null,util[_0x9298('0x16')]('%s%s',_0x9298('0x22'),path[_0x9298('0x1e')](_0x46fd2b['originalname'])));}})});router['post']('/:id/favicon',upload[_0x9298('0x1b')](_0x9298('0x1c')),controller['addFavicon']);router[_0x9298('0x23')]('/:id',auth['isAuthenticated'](),controller[_0x9298('0x24')]);module[_0x9298('0x25')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 1f60678..6431645 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0xdab073,_0x52d0b3){var _0x5082db=function(_0x224b76){while(--_0x224b76){_0xdab073['push'](_0xdab073['shift']());}};_0x5082db(++_0x52d0b3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6e79ca,_0x536e91){_0x6e79ca=_0x6e79ca-0x0;var _0x2884ec=_0x5f2f[_0x6e79ca];return _0x2884ec;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f66=['STRING','BOOLEAN','UNSIGNED','exports','min_internal','INTEGER','min_mailbox'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x65f6('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x65f6('0x2')](0xb),'unique':_0x65f6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnusername':{'type':Sequelize[_0x65f6('0x4')]},'turnpassword':{'type':Sequelize[_0x65f6('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x65f6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x65f6('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x65f6('0x4')]},'defaultFavicon':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x65f6('0x4')]},'sentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x65f6('0x2')]},'sentimentRegion':{'type':Sequelize[_0x65f6('0x4')]},'language':{'type':Sequelize[_0x65f6('0x4')]},'bucket':{'type':Sequelize[_0x65f6('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 46b58a0..c77d4a0 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 _0xdc8c=['Setting,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','defaultPreferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','preferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3154f6,_0xf93e8d){var _0x261d9f=function(_0x17759d){while(--_0x17759d){_0x3154f6['push'](_0x3154f6['shift']());}};_0x261d9f(++_0xf93e8d);}(_0xdc8c,0xd9));var _0xcdc8=function(_0x49c9eb,_0x25b227){_0x49c9eb=_0x49c9eb-0x0;var _0x29374c=_0xdc8c[_0x49c9eb];return _0x29374c;};'use strict';var emlformat=require(_0xcdc8('0x0'));var rimraf=require(_0xcdc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcdc8('0x2'));var moment=require('moment');var BPromise=require(_0xcdc8('0x3'));var Mustache=require('mustache');var util=require(_0xcdc8('0x4'));var path=require(_0xcdc8('0x5'));var sox=require(_0xcdc8('0x6'));var csv=require('to-csv');var ejs=require(_0xcdc8('0x7'));var fs=require('fs');var fs_extra=require(_0xcdc8('0x8'));var _=require(_0xcdc8('0x9'));var squel=require(_0xcdc8('0xa'));var crypto=require(_0xcdc8('0xb'));var jsforce=require(_0xcdc8('0xc'));var deskjs=require(_0xcdc8('0xd'));var toCsv=require(_0xcdc8('0xe'));var querystring=require(_0xcdc8('0xf'));var Papa=require(_0xcdc8('0x10'));var Redis=require(_0xcdc8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcdc8('0x12'));var as=require(_0xcdc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdc8('0x14'))(_0xcdc8('0x15'));var utils=require(_0xcdc8('0x16'));var config=require(_0xcdc8('0x17'));var licenseUtil=require(_0xcdc8('0x18'));var db=require(_0xcdc8('0x19'))['db'];var jayson=require(_0xcdc8('0x1a'));var client=jayson[_0xcdc8('0x1b')][_0xcdc8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xec7c11,_0x1120fb,_0xc9203e,_0x40f385){return new BPromise(function(_0x4349d3,_0x5264b5){var _0x192ca8=_0x40f385||client;return _0x192ca8[_0xcdc8('0x1d')](_0xec7c11,_0xc9203e)[_0xcdc8('0x1e')](function(_0x604383){logger[_0xcdc8('0x1f')](_0xcdc8('0x20'),_0x1120fb,_0xcdc8('0x21'));logger[_0xcdc8('0x22')](_0xcdc8('0x23'),_0x1120fb,_0xcdc8('0x21'),JSON['stringify'](_0x604383));if(_0x604383[_0xcdc8('0x24')]){if(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x25')]===0x1f4){logger[_0xcdc8('0x24')](_0xcdc8('0x20'),_0x1120fb,_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);return _0x5264b5(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);}logger[_0xcdc8('0x24')]('Setting,\x20%s,\x20%s',_0x1120fb,_0x604383['error'][_0xcdc8('0x26')]);return _0x4349d3(_0x604383[_0xcdc8('0x24')][_0xcdc8('0x26')]);}else{logger['info'](_0xcdc8('0x20'),_0x1120fb,'request\x20sent');_0x4349d3(_0x604383['result'][_0xcdc8('0x26')]);}})['catch'](function(_0xd545bc){logger['error'](_0xcdc8('0x20'),_0x1120fb,_0xd545bc);_0x5264b5(_0xd545bc);});});}function respondWithStatusCode(_0x564015,_0x56c9df){_0x56c9df=_0x56c9df||0xcc;return function(_0x194388){if(_0x194388){return _0x564015[_0xcdc8('0x27')](_0x56c9df);}return _0x564015[_0xcdc8('0x28')](_0x56c9df)[_0xcdc8('0x29')]();};}function respondWithResult(_0x3346b5,_0x5d2413){_0x5d2413=_0x5d2413||0xc8;return function(_0x159b90){if(_0x159b90){return _0x3346b5[_0xcdc8('0x28')](_0x5d2413)[_0xcdc8('0x2a')](_0x159b90);}};}function respondWithFilteredResult(_0x44afcb,_0x3c51b1){return function(_0x284c2e){if(_0x284c2e){var _0x165db7=typeof _0x3c51b1[_0xcdc8('0x2b')]===_0xcdc8('0x2c')&&typeof _0x3c51b1[_0xcdc8('0x2d')]===_0xcdc8('0x2c');var _0x4216c7=_0x284c2e[_0xcdc8('0x2e')];var _0x459841=_0x165db7?0x0:_0x3c51b1[_0xcdc8('0x2b')];var _0x36f232=_0x165db7?_0x284c2e[_0xcdc8('0x2e')]:_0x3c51b1[_0xcdc8('0x2b')]+_0x3c51b1[_0xcdc8('0x2d')];var _0x298d66;if(_0x36f232>=_0x4216c7){_0x36f232=_0x4216c7;_0x298d66=0xc8;}else{_0x298d66=0xce;}_0x44afcb[_0xcdc8('0x28')](_0x298d66);return _0x44afcb[_0xcdc8('0x2f')](_0xcdc8('0x30'),_0x459841+'-'+_0x36f232+'/'+_0x4216c7)[_0xcdc8('0x2a')](_0x284c2e);}return null;};}function patchUpdates(_0x63cb){return function(_0x4dc36d){try{jsonpatch['apply'](_0x4dc36d,_0x63cb,!![]);}catch(_0x39abde){return BPromise[_0xcdc8('0x31')](_0x39abde);}return _0x4dc36d['save']();};}function saveUpdates(_0x5c3aff,_0x2f8028){return function(_0x331fb0){if(_0x331fb0){return _0x331fb0[_0xcdc8('0x32')](_0x5c3aff)[_0xcdc8('0x1e')](function(_0x15a068){return _0x15a068;});}return null;};}function removeEntity(_0x423647,_0x1deee2){return function(_0x48c3fb){if(_0x48c3fb){return _0x48c3fb[_0xcdc8('0x33')]()[_0xcdc8('0x1e')](function(){_0x423647[_0xcdc8('0x28')](0xcc)[_0xcdc8('0x29')]();});}};}function handleEntityNotFound(_0x3714ec,_0x683c4){return function(_0x8d7c11){if(!_0x8d7c11){_0x3714ec[_0xcdc8('0x27')](0x194);}return _0x8d7c11;};}function handleError(_0x2f8451,_0x23ba31){_0x23ba31=_0x23ba31||0x1f4;return function(_0x2cc2c3){logger['error'](_0x2cc2c3[_0xcdc8('0x34')]);if(_0x2cc2c3['name']){delete _0x2cc2c3[_0xcdc8('0x35')];}_0x2f8451[_0xcdc8('0x28')](_0x23ba31)[_0xcdc8('0x36')](_0x2cc2c3);};}exports[_0xcdc8('0x37')]=function(_0x5bbff2,_0x336d4e){var _0x3729af={},_0x28fcd8={},_0x3c7929={'count':0x0,'rows':[]};var _0x11540a=_[_0xcdc8('0x38')](db[_0xcdc8('0x39')][_0xcdc8('0x3a')],function(_0x900cc5){return{'name':_0x900cc5['fieldName'],'type':_0x900cc5[_0xcdc8('0x3b')][_0xcdc8('0x3c')]};});_0x28fcd8['model']=_[_0xcdc8('0x38')](_0x11540a,_0xcdc8('0x35'));_0x28fcd8['query']=_[_0xcdc8('0x3d')](_0x5bbff2[_0xcdc8('0x3e')]);_0x28fcd8[_0xcdc8('0x3f')]=_[_0xcdc8('0x40')](_0x28fcd8[_0xcdc8('0x41')],_0x28fcd8[_0xcdc8('0x3e')]);_0x3729af[_0xcdc8('0x42')]=_[_0xcdc8('0x40')](_0x28fcd8['model'],qs[_0xcdc8('0x43')](_0x5bbff2['query'][_0xcdc8('0x43')]));_0x3729af[_0xcdc8('0x42')]=_0x3729af[_0xcdc8('0x42')][_0xcdc8('0x44')]?_0x3729af[_0xcdc8('0x42')]:_0x28fcd8[_0xcdc8('0x41')];if(!_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x45')](_0xcdc8('0x46'))){_0x3729af['limit']=qs[_0xcdc8('0x2d')](_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x2d')]);_0x3729af[_0xcdc8('0x2b')]=qs[_0xcdc8('0x2b')](_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x2b')]);}_0x3729af[_0xcdc8('0x47')]=qs[_0xcdc8('0x48')](_0x5bbff2['query']['sort']);_0x3729af['where']=qs[_0xcdc8('0x3f')](_[_0xcdc8('0x49')](_0x5bbff2[_0xcdc8('0x3e')],_0x28fcd8['filters']),_0x11540a);if(_0x5bbff2[_0xcdc8('0x3e')]['filter']){_0x3729af['where']=_[_0xcdc8('0x4a')](_0x3729af[_0xcdc8('0x4b')],{'$or':_['map'](_0x11540a,function(_0x5f0ba8){if(_0x5f0ba8[_0xcdc8('0x3b')]!==_0xcdc8('0x4c')){var _0x49e3d6={};_0x49e3d6[_0x5f0ba8[_0xcdc8('0x35')]]={'$like':'%'+_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x4d')]+'%'};return _0x49e3d6;}})});}_0x3729af=_['merge']({},_0x3729af,_0x5bbff2[_0xcdc8('0x4e')]);var _0x161aa1={'where':_0x3729af['where']};return db[_0xcdc8('0x39')][_0xcdc8('0x2e')](_0x161aa1)[_0xcdc8('0x1e')](function(_0x3021c3){_0x3c7929[_0xcdc8('0x2e')]=_0x3021c3;if(_0x5bbff2[_0xcdc8('0x3e')][_0xcdc8('0x4f')]){_0x3729af['include']=[{'all':!![]}];}return db[_0xcdc8('0x39')][_0xcdc8('0x50')](_0x3729af);})['then'](function(_0x363f6d){_0x3c7929['rows']=_0x363f6d;return _0x3c7929;})[_0xcdc8('0x1e')](respondWithFilteredResult(_0x336d4e,_0x3729af))[_0xcdc8('0x51')](handleError(_0x336d4e,null));};exports[_0xcdc8('0x52')]=function(_0x186759,_0x1d0b84){var _0x3e3c13={'raw':![],'where':{'id':_0x186759[_0xcdc8('0x53')]['id']}},_0x9cbe6a={};_0x9cbe6a[_0xcdc8('0x41')]=_[_0xcdc8('0x3d')](db['Setting'][_0xcdc8('0x3a')]);_0x9cbe6a[_0xcdc8('0x3e')]=_[_0xcdc8('0x3d')](_0x186759[_0xcdc8('0x3e')]);_0x9cbe6a['filters']=_[_0xcdc8('0x40')](_0x9cbe6a[_0xcdc8('0x41')],_0x9cbe6a[_0xcdc8('0x3e')]);_0x3e3c13['attributes']=_[_0xcdc8('0x40')](_0x9cbe6a[_0xcdc8('0x41')],qs[_0xcdc8('0x43')](_0x186759[_0xcdc8('0x3e')][_0xcdc8('0x43')]));_0x3e3c13['attributes']=_0x3e3c13[_0xcdc8('0x42')][_0xcdc8('0x44')]?_0x3e3c13[_0xcdc8('0x42')]:_0x9cbe6a[_0xcdc8('0x41')];if(_0x186759[_0xcdc8('0x3e')][_0xcdc8('0x4f')]){_0x3e3c13[_0xcdc8('0x54')]=[{'all':!![]}];}_0x3e3c13=_[_0xcdc8('0x4a')]({},_0x3e3c13,_0x186759[_0xcdc8('0x4e')]);return db[_0xcdc8('0x39')][_0xcdc8('0x55')](_0x3e3c13)['then'](handleEntityNotFound(_0x1d0b84,null))['then'](respondWithResult(_0x1d0b84,null))['catch'](handleError(_0x1d0b84,null));};exports['update']=function(_0x3489a1,_0x1834ee){if(_0x3489a1[_0xcdc8('0x56')]['id']){delete _0x3489a1[_0xcdc8('0x56')]['id'];}return db[_0xcdc8('0x39')]['find']({'where':{'id':_0x3489a1['params']['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x1834ee,null))[_0xcdc8('0x1e')](saveUpdates(_0x3489a1[_0xcdc8('0x56')],null))[_0xcdc8('0x1e')](respondWithResult(_0x1834ee,null))[_0xcdc8('0x51')](handleError(_0x1834ee,null));};exports[_0xcdc8('0x57')]=function(_0x11d200,_0x605727,_0x12c9e2){if(_0x11d200[_0xcdc8('0x58')]&&_0x11d200[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x11d200[_0xcdc8('0x56')][_0xcdc8('0x5a')]=_0x11d200[_0xcdc8('0x58')][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')]['find']({'where':{'id':_0x11d200[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x605727,null))[_0xcdc8('0x1e')](saveUpdates(_0x11d200['body'],null))['then'](respondWithResult(_0x605727,null))['catch'](handleError(_0x605727,null));};exports[_0xcdc8('0x5b')]=function(_0x1b38b3,_0x1c0211,_0x155386){if(_0x1b38b3[_0xcdc8('0x58')]&&_0x1b38b3[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x1b38b3[_0xcdc8('0x56')][_0xcdc8('0x5c')]=_0x1b38b3['file'][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x1b38b3[_0xcdc8('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c0211,null))[_0xcdc8('0x1e')](saveUpdates(_0x1b38b3['body'],null))[_0xcdc8('0x1e')](respondWithResult(_0x1c0211,null))['catch'](handleError(_0x1c0211,null));};var utilLicense=require(_0xcdc8('0x18'));exports['getLogo']=function(_0x539d7c,_0x5a6d53,_0x14f2ae){var _0x5cfc9b=_0xcdc8('0x5d');var _0x18b59b={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()[_0xcdc8('0x1e')](function(_0x21c4d5){if(_0x21c4d5){_0x18b59b=_0x21c4d5;}return db['Setting'][_0xcdc8('0x55')]({'where':{'id':_0x539d7c[_0xcdc8('0x53')]['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),'defaultPreferred',_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x5a6d53,null))[_0xcdc8('0x1e')](function(_0x192194){if(_0x192194){var _0x2badeb=_0x192194[_0xcdc8('0x5a')]&&fs[_0xcdc8('0x63')](path['join'](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0x192194[_0xcdc8('0x5a')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0x192194[_0xcdc8('0x5a')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_[_0xcdc8('0x65')](_0xcdc8('0x67')));var _0x52f3ee=_0xcdc8('0x68')+_[_0xcdc8('0x69')](_0xcdc8('0x5a'));if(_0x192194[_0x52f3ee]||!_0x18b59b[_0xcdc8('0x6a')]){_0x2badeb=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x5cfc9b,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0x2badeb)){throw new db['Sequelize'][(_0xcdc8('0x6b'))](_[_0xcdc8('0x69')](_0xcdc8('0x5a'))+_0xcdc8('0x6c'));}return _0x5a6d53[_0xcdc8('0x6d')](_0x2badeb);}})[_0xcdc8('0x51')](handleError(_0x5a6d53,null));};var utilLicense=require(_0xcdc8('0x18'));exports['getLogoLogin']=function(_0x51da47,_0x106df7,_0xfa0d84){var _0x1a8851='server/files/images/logos';var _0x306dea={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()[_0xcdc8('0x1e')](function(_0x15aecc){if(_0x15aecc){_0x306dea=_0x15aecc;}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x51da47['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),_0xcdc8('0x6e'),'defaultFavicon'],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x106df7,null))[_0xcdc8('0x1e')](function(_0x21afb1){if(_0x21afb1){var _0xbf151d=_0x21afb1[_0xcdc8('0x5c')]&&fs[_0xcdc8('0x63')](path['join'](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0x21afb1[_0xcdc8('0x5c')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0x21afb1[_0xcdc8('0x5c')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_['toLower'](_0xcdc8('0x6f')));var _0x46cf45=_0xcdc8('0x68')+_[_0xcdc8('0x69')](_0xcdc8('0x5c'));if(_0x21afb1[_0x46cf45]||!_0x306dea[_0xcdc8('0x6a')]){_0xbf151d=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x1a8851,_[_0xcdc8('0x65')](_0xcdc8('0x6f')));}if(!fs[_0xcdc8('0x63')](_0xbf151d)){throw new db[(_0xcdc8('0x70'))][(_0xcdc8('0x6b'))](_['upperFirst']('loginLogo')+_0xcdc8('0x6c'));}return _0x106df7[_0xcdc8('0x6d')](_0xbf151d);}})[_0xcdc8('0x51')](handleError(_0x106df7,null));};exports[_0xcdc8('0x71')]=function(_0x379e07,_0x49d9c4){return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x379e07[_0xcdc8('0x53')]['id']},'attributes':[_0xcdc8('0x72')]})[_0xcdc8('0x1e')](respondWithResult(_0x49d9c4,null))[_0xcdc8('0x51')](handleError(_0x49d9c4,null));};exports['addPreferred']=function(_0x507912,_0x55808c,_0x28fcb3){if(_0x507912[_0xcdc8('0x58')]&&_0x507912[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x507912[_0xcdc8('0x56')][_0xcdc8('0x73')]=_0x507912[_0xcdc8('0x58')]['filename'];}return db['Setting']['find']({'where':{'id':_0x507912[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x55808c,null))[_0xcdc8('0x1e')](saveUpdates(_0x507912[_0xcdc8('0x56')],null))['then'](respondWithResult(_0x55808c,null))['catch'](handleError(_0x55808c,null));};var utilLicense=require('../../config/license/util');exports[_0xcdc8('0x74')]=function(_0x34a581,_0x38f561,_0x3d6e12){var _0x54c1e7='server/files/images/logos';var _0x344d22={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()['then'](function(_0x3b3862){if(_0x3b3862){_0x344d22=_0x3b3862;}return db['Setting'][_0xcdc8('0x55')]({'where':{'id':_0x34a581['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),'preferred',_0xcdc8('0x5f'),_0xcdc8('0x60'),'defaultLoginLogo',_0xcdc8('0x6e'),_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x38f561,null))[_0xcdc8('0x1e')](function(_0x37e6a3){if(_0x37e6a3){var _0x3d3252=_0x37e6a3[_0xcdc8('0x73')]&&fs[_0xcdc8('0x63')](path[_0xcdc8('0x66')](config['root'],_0x54c1e7,_['toLower'](_0x37e6a3['preferred'])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_['toLower'](_0x37e6a3[_0xcdc8('0x73')])):path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_[_0xcdc8('0x65')](_0xcdc8('0x75')));var _0x422324=_0xcdc8('0x68')+_['upperFirst'](_0xcdc8('0x73'));if(_0x37e6a3[_0x422324]||!_0x344d22[_0xcdc8('0x6a')]||!_0x344d22[_0xcdc8('0x73')]){_0x3d3252=path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x54c1e7,_[_0xcdc8('0x65')](_0xcdc8('0x75')));}if(!fs['existsSync'](_0x3d3252)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0xcdc8('0x73'))+_0xcdc8('0x6c'));}return _0x38f561[_0xcdc8('0x6d')](_0x3d3252);}})[_0xcdc8('0x51')](handleError(_0x38f561,null));};exports[_0xcdc8('0x76')]=function(_0x4e3198,_0x14da12,_0x49e18e){if(_0x4e3198[_0xcdc8('0x58')]&&_0x4e3198[_0xcdc8('0x58')][_0xcdc8('0x59')]){_0x4e3198['body'][_0xcdc8('0x5f')]=_0x4e3198[_0xcdc8('0x58')][_0xcdc8('0x59')];}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x4e3198[_0xcdc8('0x53')]['id']}})[_0xcdc8('0x1e')](handleEntityNotFound(_0x14da12,null))[_0xcdc8('0x1e')](saveUpdates(_0x4e3198[_0xcdc8('0x56')],null))[_0xcdc8('0x1e')](respondWithResult(_0x14da12,null))[_0xcdc8('0x51')](handleError(_0x14da12,null));};var utilLicense=require('../../config/license/util');exports[_0xcdc8('0x77')]=function(_0x31df73,_0x2dcdc5,_0x466c89){var _0x572756=_0xcdc8('0x5d');var _0x127eb0={'custom':![]};return utilLicense[_0xcdc8('0x5e')]()['then'](function(_0xd02ba8){if(_0xd02ba8){_0x127eb0=_0xd02ba8;}return db[_0xcdc8('0x39')][_0xcdc8('0x55')]({'where':{'id':_0x31df73['params']['id']},'attributes':[_0xcdc8('0x5a'),_0xcdc8('0x5c'),_0xcdc8('0x73'),_0xcdc8('0x5f'),_0xcdc8('0x60'),_0xcdc8('0x61'),_0xcdc8('0x6e'),_0xcdc8('0x62')],'raw':!![]});})[_0xcdc8('0x1e')](handleEntityNotFound(_0x2dcdc5,null))[_0xcdc8('0x1e')](function(_0x3612b0){if(_0x3612b0){var _0x240bf0=_0x3612b0[_0xcdc8('0x5f')]&&fs[_0xcdc8('0x63')](path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0x3612b0[_0xcdc8('0x5f')])))?path[_0xcdc8('0x66')](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0x3612b0[_0xcdc8('0x5f')])):path['join'](config[_0xcdc8('0x64')],_0x572756,_[_0xcdc8('0x65')](_0xcdc8('0x78')));var _0x159aaa=_0xcdc8('0x68')+_[_0xcdc8('0x69')]('favicon');if(_0x3612b0[_0x159aaa]||!_0x127eb0['custom']){_0x240bf0=path[_0xcdc8('0x66')](config['root'],_0x572756,_[_0xcdc8('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x240bf0)){throw new db[(_0xcdc8('0x70'))]['ValidationError'](_['upperFirst']('favicon')+_0xcdc8('0x6c'));}return _0x2dcdc5[_0xcdc8('0x6d')](_0x240bf0);}})[_0xcdc8('0x51')](handleError(_0x2dcdc5,null));};exports[_0xcdc8('0x79')]=function(_0x16bae0,_0x450fe1){var _0x298a38={'offset':moment()[_0xcdc8('0x7a')]()};_0x298a38[_0xcdc8('0x7b')]=moment()[_0xcdc8('0x7a')](_0x298a38[_0xcdc8('0x2b')])[_0xcdc8('0x7c')](_0xcdc8('0x7d'));return _0x450fe1[_0xcdc8('0x28')](0xc8)['send'](_0x298a38);}; \ No newline at end of file +var _0xf322=['sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','status','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','keys','options','find','body','file','filename','logo','params','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','download','getLogoLogin','defaultLogo','default_loginLogo.svg','addPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x265a63,_0x322069){var _0x2090d1=function(_0x117d74){while(--_0x117d74){_0x265a63['push'](_0x265a63['shift']());}};_0x2090d1(++_0x322069);}(_0xf322,0x141));var _0x2f32=function(_0x28fc08,_0x18b054){_0x28fc08=_0x28fc08-0x0;var _0xa6a26b=_0xf322[_0x28fc08];return _0xa6a26b;};'use strict';var emlformat=require(_0x2f32('0x0'));var rimraf=require(_0x2f32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f32('0x2'));var rp=require(_0x2f32('0x3'));var moment=require('moment');var BPromise=require(_0x2f32('0x4'));var Mustache=require(_0x2f32('0x5'));var util=require('util');var path=require(_0x2f32('0x6'));var sox=require(_0x2f32('0x7'));var csv=require(_0x2f32('0x8'));var ejs=require(_0x2f32('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f32('0xa'));var squel=require(_0x2f32('0xb'));var crypto=require(_0x2f32('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2f32('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2f32('0xe'));var Papa=require(_0x2f32('0xf'));var Redis=require(_0x2f32('0x10'));var authService=require(_0x2f32('0x11'));var qs=require(_0x2f32('0x12'));var as=require(_0x2f32('0x13'));var hardwareService=require(_0x2f32('0x14'));var logger=require('../../config/logger')(_0x2f32('0x15'));var utils=require('../../config/utils');var config=require(_0x2f32('0x16'));var licenseUtil=require(_0x2f32('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2f32('0x18'));var client=jayson[_0x2f32('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e228,_0x43f7d7,_0x5cbad1,_0x209873){return new BPromise(function(_0x2c8a10,_0x1f6668){var _0x23d666=_0x209873||client;return _0x23d666[_0x2f32('0x1a')](_0x8e228,_0x5cbad1)['then'](function(_0x21ee39){logger[_0x2f32('0x1b')](_0x2f32('0x1c'),_0x43f7d7,'request\x20sent');logger[_0x2f32('0x1d')](_0x2f32('0x1e'),_0x43f7d7,_0x2f32('0x1f'),JSON[_0x2f32('0x20')](_0x21ee39));if(_0x21ee39[_0x2f32('0x21')]){if(_0x21ee39['error']['code']===0x1f4){logger[_0x2f32('0x21')](_0x2f32('0x1c'),_0x43f7d7,_0x21ee39[_0x2f32('0x21')][_0x2f32('0x22')]);return _0x1f6668(_0x21ee39[_0x2f32('0x21')][_0x2f32('0x22')]);}logger[_0x2f32('0x21')](_0x2f32('0x1c'),_0x43f7d7,_0x21ee39['error'][_0x2f32('0x22')]);return _0x2c8a10(_0x21ee39[_0x2f32('0x21')][_0x2f32('0x22')]);}else{logger[_0x2f32('0x1b')](_0x2f32('0x1c'),_0x43f7d7,_0x2f32('0x1f'));_0x2c8a10(_0x21ee39['result'][_0x2f32('0x22')]);}})[_0x2f32('0x23')](function(_0x3cc678){logger[_0x2f32('0x21')]('Setting,\x20%s,\x20%s',_0x43f7d7,_0x3cc678);_0x1f6668(_0x3cc678);});});}function respondWithStatusCode(_0x1fa915,_0x5ac29e){_0x5ac29e=_0x5ac29e||0xcc;return function(_0x1500db){if(_0x1500db){return _0x1fa915[_0x2f32('0x24')](_0x5ac29e);}return _0x1fa915['status'](_0x5ac29e)[_0x2f32('0x25')]();};}function respondWithResult(_0x55b300,_0x3752fd){_0x3752fd=_0x3752fd||0xc8;return function(_0x3b1f2d){if(_0x3b1f2d){return _0x55b300['status'](_0x3752fd)[_0x2f32('0x26')](_0x3b1f2d);}};}function respondWithFilteredResult(_0x166ee3,_0x106c6d){return function(_0x1c509f){if(_0x1c509f){var _0x61f1ed=typeof _0x106c6d[_0x2f32('0x27')]===_0x2f32('0x28')&&typeof _0x106c6d[_0x2f32('0x29')]===_0x2f32('0x28');var _0x3eb65c=_0x1c509f[_0x2f32('0x2a')];var _0x25eb29=_0x61f1ed?0x0:_0x106c6d[_0x2f32('0x27')];var _0xccd663=_0x61f1ed?_0x1c509f[_0x2f32('0x2a')]:_0x106c6d['offset']+_0x106c6d[_0x2f32('0x29')];var _0x279020;if(_0xccd663>=_0x3eb65c){_0xccd663=_0x3eb65c;_0x279020=0xc8;}else{_0x279020=0xce;}_0x166ee3['status'](_0x279020);return _0x166ee3[_0x2f32('0x2b')](_0x2f32('0x2c'),_0x25eb29+'-'+_0xccd663+'/'+_0x3eb65c)[_0x2f32('0x26')](_0x1c509f);}return null;};}function patchUpdates(_0x17627b){return function(_0x119fea){try{jsonpatch[_0x2f32('0x2d')](_0x119fea,_0x17627b,!![]);}catch(_0x491dbc){return BPromise[_0x2f32('0x2e')](_0x491dbc);}return _0x119fea[_0x2f32('0x2f')]();};}function saveUpdates(_0x1372d0,_0x362a86){return function(_0x404d06){if(_0x404d06){return _0x404d06[_0x2f32('0x30')](_0x1372d0)['then'](function(_0x160535){return _0x160535;});}return null;};}function removeEntity(_0x40017c,_0x492464){return function(_0x9ed148){if(_0x9ed148){return _0x9ed148[_0x2f32('0x31')]()[_0x2f32('0x32')](function(){_0x40017c[_0x2f32('0x33')](0xcc)[_0x2f32('0x25')]();});}};}function handleEntityNotFound(_0x389876,_0x3144b8){return function(_0xa2ab67){if(!_0xa2ab67){_0x389876[_0x2f32('0x24')](0x194);}return _0xa2ab67;};}function handleError(_0x5cefcb,_0x1a64e5){_0x1a64e5=_0x1a64e5||0x1f4;return function(_0x396b9b){logger[_0x2f32('0x21')](_0x396b9b[_0x2f32('0x34')]);if(_0x396b9b[_0x2f32('0x35')]){delete _0x396b9b[_0x2f32('0x35')];}_0x5cefcb[_0x2f32('0x33')](_0x1a64e5)[_0x2f32('0x36')](_0x396b9b);};}exports[_0x2f32('0x37')]=function(_0x528193,_0x198f0a){var _0xa1e39c={},_0xe9bcea={},_0x5430ee={'count':0x0,'rows':[]};var _0x4aea4c=_[_0x2f32('0x38')](db[_0x2f32('0x39')][_0x2f32('0x3a')],function(_0x2acfff){return{'name':_0x2acfff[_0x2f32('0x3b')],'type':_0x2acfff[_0x2f32('0x3c')]['key']};});_0xe9bcea['model']=_[_0x2f32('0x38')](_0x4aea4c,'name');_0xe9bcea[_0x2f32('0x3d')]=_['keys'](_0x528193[_0x2f32('0x3d')]);_0xe9bcea[_0x2f32('0x3e')]=_['intersection'](_0xe9bcea['model'],_0xe9bcea[_0x2f32('0x3d')]);_0xa1e39c[_0x2f32('0x3f')]=_[_0x2f32('0x40')](_0xe9bcea[_0x2f32('0x41')],qs['fields'](_0x528193[_0x2f32('0x3d')][_0x2f32('0x42')]));_0xa1e39c[_0x2f32('0x3f')]=_0xa1e39c[_0x2f32('0x3f')][_0x2f32('0x43')]?_0xa1e39c['attributes']:_0xe9bcea[_0x2f32('0x41')];if(!_0x528193[_0x2f32('0x3d')][_0x2f32('0x44')](_0x2f32('0x45'))){_0xa1e39c[_0x2f32('0x29')]=qs['limit'](_0x528193[_0x2f32('0x3d')]['limit']);_0xa1e39c[_0x2f32('0x27')]=qs[_0x2f32('0x27')](_0x528193['query'][_0x2f32('0x27')]);}_0xa1e39c[_0x2f32('0x46')]=qs[_0x2f32('0x47')](_0x528193[_0x2f32('0x3d')][_0x2f32('0x47')]);_0xa1e39c[_0x2f32('0x48')]=qs[_0x2f32('0x3e')](_[_0x2f32('0x49')](_0x528193[_0x2f32('0x3d')],_0xe9bcea['filters']),_0x4aea4c);if(_0x528193[_0x2f32('0x3d')][_0x2f32('0x4a')]){_0xa1e39c[_0x2f32('0x48')]=_['merge'](_0xa1e39c[_0x2f32('0x48')],{'$or':_[_0x2f32('0x38')](_0x4aea4c,function(_0x153179){if(_0x153179[_0x2f32('0x3c')]!==_0x2f32('0x4b')){var _0x5deffa={};_0x5deffa[_0x153179[_0x2f32('0x35')]]={'$like':'%'+_0x528193[_0x2f32('0x3d')]['filter']+'%'};return _0x5deffa;}})});}_0xa1e39c=_[_0x2f32('0x4c')]({},_0xa1e39c,_0x528193['options']);var _0x220119={'where':_0xa1e39c['where']};return db[_0x2f32('0x39')][_0x2f32('0x2a')](_0x220119)[_0x2f32('0x32')](function(_0x1898c5){_0x5430ee[_0x2f32('0x2a')]=_0x1898c5;if(_0x528193['query'][_0x2f32('0x4d')]){_0xa1e39c[_0x2f32('0x4e')]=[{'all':!![]}];}return db['Setting']['findAll'](_0xa1e39c);})[_0x2f32('0x32')](function(_0x66df18){_0x5430ee['rows']=_0x66df18;return _0x5430ee;})[_0x2f32('0x32')](respondWithFilteredResult(_0x198f0a,_0xa1e39c))[_0x2f32('0x23')](handleError(_0x198f0a,null));};exports[_0x2f32('0x4f')]=function(_0x2fe506,_0x3dc280){var _0x3ce16c={'raw':![],'where':{'id':_0x2fe506['params']['id']}},_0xf5fca4={};_0xf5fca4[_0x2f32('0x41')]=_['keys'](db[_0x2f32('0x39')][_0x2f32('0x3a')]);_0xf5fca4[_0x2f32('0x3d')]=_[_0x2f32('0x50')](_0x2fe506[_0x2f32('0x3d')]);_0xf5fca4['filters']=_['intersection'](_0xf5fca4[_0x2f32('0x41')],_0xf5fca4[_0x2f32('0x3d')]);_0x3ce16c[_0x2f32('0x3f')]=_[_0x2f32('0x40')](_0xf5fca4[_0x2f32('0x41')],qs[_0x2f32('0x42')](_0x2fe506[_0x2f32('0x3d')][_0x2f32('0x42')]));_0x3ce16c[_0x2f32('0x3f')]=_0x3ce16c[_0x2f32('0x3f')][_0x2f32('0x43')]?_0x3ce16c['attributes']:_0xf5fca4['model'];if(_0x2fe506[_0x2f32('0x3d')][_0x2f32('0x4d')]){_0x3ce16c[_0x2f32('0x4e')]=[{'all':!![]}];}_0x3ce16c=_[_0x2f32('0x4c')]({},_0x3ce16c,_0x2fe506[_0x2f32('0x51')]);return db[_0x2f32('0x39')][_0x2f32('0x52')](_0x3ce16c)['then'](handleEntityNotFound(_0x3dc280,null))['then'](respondWithResult(_0x3dc280,null))['catch'](handleError(_0x3dc280,null));};exports[_0x2f32('0x30')]=function(_0x45f44b,_0xa42e33){if(_0x45f44b[_0x2f32('0x53')]['id']){delete _0x45f44b['body']['id'];}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x45f44b['params']['id']}})[_0x2f32('0x32')](handleEntityNotFound(_0xa42e33,null))[_0x2f32('0x32')](saveUpdates(_0x45f44b['body'],null))[_0x2f32('0x32')](respondWithResult(_0xa42e33,null))[_0x2f32('0x23')](handleError(_0xa42e33,null));};exports['addLogo']=function(_0x2b1cd7,_0x179cf0,_0x3a65e2){if(_0x2b1cd7['file']&&_0x2b1cd7[_0x2f32('0x54')][_0x2f32('0x55')]){_0x2b1cd7[_0x2f32('0x53')][_0x2f32('0x56')]=_0x2b1cd7[_0x2f32('0x54')][_0x2f32('0x55')];}return db['Setting'][_0x2f32('0x52')]({'where':{'id':_0x2b1cd7[_0x2f32('0x57')]['id']}})['then'](handleEntityNotFound(_0x179cf0,null))[_0x2f32('0x32')](saveUpdates(_0x2b1cd7[_0x2f32('0x53')],null))['then'](respondWithResult(_0x179cf0,null))[_0x2f32('0x23')](handleError(_0x179cf0,null));};exports['addLogoLogin']=function(_0x2a915c,_0x4ab850,_0x31f8b8){if(_0x2a915c[_0x2f32('0x54')]&&_0x2a915c[_0x2f32('0x54')][_0x2f32('0x55')]){_0x2a915c[_0x2f32('0x53')]['loginLogo']=_0x2a915c[_0x2f32('0x54')][_0x2f32('0x55')];}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x2a915c['params']['id']}})[_0x2f32('0x32')](handleEntityNotFound(_0x4ab850,null))[_0x2f32('0x32')](saveUpdates(_0x2a915c['body'],null))['then'](respondWithResult(_0x4ab850,null))[_0x2f32('0x23')](handleError(_0x4ab850,null));};var utilLicense=require(_0x2f32('0x17'));exports['getLogo']=function(_0x56d1f8,_0x24d6db,_0x22cacd){var _0x1f479a=_0x2f32('0x58');var _0xccacb0={'custom':![]};return utilLicense[_0x2f32('0x59')]()['then'](function(_0x27a657){if(_0x27a657){_0xccacb0=_0x27a657;}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x56d1f8[_0x2f32('0x57')]['id']},'attributes':[_0x2f32('0x56'),_0x2f32('0x5a'),_0x2f32('0x5b'),_0x2f32('0x5c'),'defaultLogo',_0x2f32('0x5d'),_0x2f32('0x5e'),_0x2f32('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x24d6db,null))[_0x2f32('0x32')](function(_0x18dd57){if(_0x18dd57){var _0x2ee75a=_0x18dd57['logo']&&fs['existsSync'](path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x1f479a,_['toLower'](_0x18dd57[_0x2f32('0x56')])))?path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x1f479a,_[_0x2f32('0x62')](_0x18dd57[_0x2f32('0x56')])):path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x1f479a,_[_0x2f32('0x62')](_0x2f32('0x63')));var _0x28fd0d=_0x2f32('0x64')+_[_0x2f32('0x65')](_0x2f32('0x56'));if(_0x18dd57[_0x28fd0d]||!_0xccacb0[_0x2f32('0x66')]){_0x2ee75a=path['join'](config[_0x2f32('0x61')],_0x1f479a,_[_0x2f32('0x62')](_0x2f32('0x63')));}if(!fs[_0x2f32('0x67')](_0x2ee75a)){throw new db[(_0x2f32('0x68'))][(_0x2f32('0x69'))](_['upperFirst'](_0x2f32('0x56'))+'\x20not\x20found');}return _0x24d6db[_0x2f32('0x6a')](_0x2ee75a);}})[_0x2f32('0x23')](handleError(_0x24d6db,null));};var utilLicense=require(_0x2f32('0x17'));exports[_0x2f32('0x6b')]=function(_0x2fd34b,_0x31bfb0,_0x47d119){var _0x3ffab5='server/files/images/logos';var _0x3cb990={'custom':![]};return utilLicense[_0x2f32('0x59')]()[_0x2f32('0x32')](function(_0x3839a3){if(_0x3839a3){_0x3cb990=_0x3839a3;}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x2fd34b[_0x2f32('0x57')]['id']},'attributes':[_0x2f32('0x56'),_0x2f32('0x5a'),'preferred',_0x2f32('0x5c'),_0x2f32('0x6c'),'defaultLoginLogo',_0x2f32('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x2f32('0x32')](handleEntityNotFound(_0x31bfb0,null))[_0x2f32('0x32')](function(_0x5514be){if(_0x5514be){var _0x4cb3be=_0x5514be[_0x2f32('0x5a')]&&fs[_0x2f32('0x67')](path['join'](config['root'],_0x3ffab5,_[_0x2f32('0x62')](_0x5514be[_0x2f32('0x5a')])))?path['join'](config[_0x2f32('0x61')],_0x3ffab5,_[_0x2f32('0x62')](_0x5514be[_0x2f32('0x5a')])):path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x3ffab5,_[_0x2f32('0x62')](_0x2f32('0x6d')));var _0x22460f=_0x2f32('0x64')+_[_0x2f32('0x65')](_0x2f32('0x5a'));if(_0x5514be[_0x22460f]||!_0x3cb990[_0x2f32('0x66')]){_0x4cb3be=path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x3ffab5,_[_0x2f32('0x62')](_0x2f32('0x6d')));}if(!fs[_0x2f32('0x67')](_0x4cb3be)){throw new db[(_0x2f32('0x68'))]['ValidationError'](_[_0x2f32('0x65')]('loginLogo')+'\x20not\x20found');}return _0x31bfb0[_0x2f32('0x6a')](_0x4cb3be);}})[_0x2f32('0x23')](handleError(_0x31bfb0,null));};exports['gdpr']=function(_0x2014a6,_0x2ca72a){return db['Setting']['find']({'where':{'id':_0x2014a6['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x2ca72a,null))[_0x2f32('0x23')](handleError(_0x2ca72a,null));};exports[_0x2f32('0x6e')]=function(_0x190571,_0x7a8716,_0x66d188){if(_0x190571[_0x2f32('0x54')]&&_0x190571[_0x2f32('0x54')][_0x2f32('0x55')]){_0x190571[_0x2f32('0x53')][_0x2f32('0x5b')]=_0x190571[_0x2f32('0x54')][_0x2f32('0x55')];}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x190571[_0x2f32('0x57')]['id']}})[_0x2f32('0x32')](handleEntityNotFound(_0x7a8716,null))[_0x2f32('0x32')](saveUpdates(_0x190571[_0x2f32('0x53')],null))[_0x2f32('0x32')](respondWithResult(_0x7a8716,null))[_0x2f32('0x23')](handleError(_0x7a8716,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x5a7efd,_0x2f88b0,_0x47ab6d){var _0x4b0c10=_0x2f32('0x58');var _0x40ad3a={'custom':![]};return utilLicense[_0x2f32('0x59')]()[_0x2f32('0x32')](function(_0x32acdb){if(_0x32acdb){_0x40ad3a=_0x32acdb;}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x5a7efd['params']['id']},'attributes':[_0x2f32('0x56'),'loginLogo','preferred','favicon',_0x2f32('0x6c'),_0x2f32('0x5d'),_0x2f32('0x5e'),_0x2f32('0x5f')],'raw':!![]});})[_0x2f32('0x32')](handleEntityNotFound(_0x2f88b0,null))[_0x2f32('0x32')](function(_0xe8e232){if(_0xe8e232){var _0x424da7=_0xe8e232[_0x2f32('0x5b')]&&fs[_0x2f32('0x67')](path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x4b0c10,_['toLower'](_0xe8e232[_0x2f32('0x5b')])))?path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x4b0c10,_[_0x2f32('0x62')](_0xe8e232['preferred'])):path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x4b0c10,_[_0x2f32('0x62')](_0x2f32('0x6f')));var _0x384ecf=_0x2f32('0x64')+_[_0x2f32('0x65')](_0x2f32('0x5b'));if(_0xe8e232[_0x384ecf]||!_0x40ad3a[_0x2f32('0x66')]||!_0x40ad3a[_0x2f32('0x5b')]){_0x424da7=path[_0x2f32('0x60')](config['root'],_0x4b0c10,_[_0x2f32('0x62')](_0x2f32('0x6f')));}if(!fs['existsSync'](_0x424da7)){throw new db['Sequelize'][(_0x2f32('0x69'))](_[_0x2f32('0x65')](_0x2f32('0x5b'))+_0x2f32('0x70'));}return _0x2f88b0[_0x2f32('0x6a')](_0x424da7);}})['catch'](handleError(_0x2f88b0,null));};exports[_0x2f32('0x71')]=function(_0x53387d,_0x116437,_0x129802){if(_0x53387d['file']&&_0x53387d[_0x2f32('0x54')]['filename']){_0x53387d[_0x2f32('0x53')]['favicon']=_0x53387d[_0x2f32('0x54')][_0x2f32('0x55')];}return db[_0x2f32('0x39')][_0x2f32('0x52')]({'where':{'id':_0x53387d[_0x2f32('0x57')]['id']}})['then'](handleEntityNotFound(_0x116437,null))[_0x2f32('0x32')](saveUpdates(_0x53387d[_0x2f32('0x53')],null))[_0x2f32('0x32')](respondWithResult(_0x116437,null))['catch'](handleError(_0x116437,null));};var utilLicense=require(_0x2f32('0x17'));exports[_0x2f32('0x72')]=function(_0x34a86c,_0x458bd8,_0x3d1601){var _0x21f49c='server/files/images/logos';var _0x956619={'custom':![]};return utilLicense[_0x2f32('0x59')]()[_0x2f32('0x32')](function(_0x2b0451){if(_0x2b0451){_0x956619=_0x2b0451;}return db['Setting'][_0x2f32('0x52')]({'where':{'id':_0x34a86c[_0x2f32('0x57')]['id']},'attributes':[_0x2f32('0x56'),'loginLogo',_0x2f32('0x5b'),_0x2f32('0x5c'),'defaultLogo',_0x2f32('0x5d'),'defaultPreferred',_0x2f32('0x5f')],'raw':!![]});})[_0x2f32('0x32')](handleEntityNotFound(_0x458bd8,null))[_0x2f32('0x32')](function(_0x3ae0f0){if(_0x3ae0f0){var _0x9d4ca7=_0x3ae0f0[_0x2f32('0x5c')]&&fs[_0x2f32('0x67')](path['join'](config[_0x2f32('0x61')],_0x21f49c,_[_0x2f32('0x62')](_0x3ae0f0[_0x2f32('0x5c')])))?path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x21f49c,_[_0x2f32('0x62')](_0x3ae0f0[_0x2f32('0x5c')])):path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x21f49c,_[_0x2f32('0x62')](_0x2f32('0x73')));var _0x1543cd=_0x2f32('0x64')+_[_0x2f32('0x65')](_0x2f32('0x5c'));if(_0x3ae0f0[_0x1543cd]||!_0x956619['custom']){_0x9d4ca7=path[_0x2f32('0x60')](config[_0x2f32('0x61')],_0x21f49c,_['toLower'](_0x2f32('0x73')));}if(!fs[_0x2f32('0x67')](_0x9d4ca7)){throw new db[(_0x2f32('0x68'))]['ValidationError'](_['upperFirst'](_0x2f32('0x5c'))+_0x2f32('0x70'));}return _0x458bd8[_0x2f32('0x6a')](_0x9d4ca7);}})[_0x2f32('0x23')](handleError(_0x458bd8,null));};exports[_0x2f32('0x74')]=function(_0x80df30,_0x2e0dae){var _0x2c4fad={'offset':moment()[_0x2f32('0x75')]()};_0x2c4fad['now']=moment()[_0x2f32('0x75')](_0x2c4fad['offset'])[_0x2f32('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2e0dae['status'](0xc8)['send'](_0x2c4fad);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 26e3400..ffcb73e 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(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x55ca,0x126));var _0xa55c=function(_0xf3f1ed,_0x57e63e){_0xf3f1ed=_0xf3f1ed-0x0;var _0x3f5837=_0x55ca[_0xf3f1ed];return _0x3f5837;};'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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x49c78a,_0x2256d1){var _0x566474=function(_0x5c8f76){while(--_0x5c8f76){_0x49c78a['push'](_0x49c78a['shift']());}};_0x566474(++_0x2256d1);}(_0xe14b,0x93));var _0xbe14=function(_0x522ace,_0x47433e){_0x522ace=_0x522ace-0x0;var _0x2083b2=_0xe14b[_0x522ace];return _0x2083b2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c025d3b..ef521ae 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 _0xab88=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','options','where','include','map','model','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab88,0x71));var _0x8ab8=function(_0x15de7b,_0x1f9e4e){_0x15de7b=_0x15de7b-0x0;var _0x1456c4=_0xab88[_0x15de7b];return _0x1456c4;};'use strict';var _=require(_0x8ab8('0x0'));var util=require('util');var moment=require(_0x8ab8('0x1'));var BPromise=require(_0x8ab8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ab8('0x3'));var db=require(_0x8ab8('0x4'))['db'];var utils=require(_0x8ab8('0x5'));var logger=require(_0x8ab8('0x6'))(_0x8ab8('0x7'));var config=require(_0x8ab8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ab8('0x9')][_0x8ab8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4937,_0x44d200,_0x255a1c){return new BPromise(function(_0x4509db,_0x37e064){return client[_0x8ab8('0xb')](_0x2b4937,_0x255a1c)[_0x8ab8('0xc')](function(_0x127351){logger[_0x8ab8('0xd')](_0x8ab8('0xe'),_0x44d200,_0x8ab8('0xf'));logger[_0x8ab8('0x10')](_0x8ab8('0x11'),_0x44d200,_0x8ab8('0xf'),JSON[_0x8ab8('0x12')](_0x127351));if(_0x127351[_0x8ab8('0x13')]){if(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x14')]===0x1f4){logger[_0x8ab8('0x13')](_0x8ab8('0xe'),_0x44d200,_0x127351[_0x8ab8('0x13')]['message']);return _0x37e064(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);}logger['error']('Setting,\x20%s,\x20%s',_0x44d200,_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);return _0x4509db(_0x127351[_0x8ab8('0x13')][_0x8ab8('0x15')]);}else{logger[_0x8ab8('0xd')](_0x8ab8('0xe'),_0x44d200,_0x8ab8('0xf'));_0x4509db(_0x127351['result'][_0x8ab8('0x15')]);}})[_0x8ab8('0x16')](function(_0x553318){logger[_0x8ab8('0x13')](_0x8ab8('0xe'),_0x44d200,_0x553318);_0x37e064(_0x553318);});});}exports[_0x8ab8('0x17')]=function(_0x4edfb5){var _0x555290=this;return new Promise(function(_0x196151,_0x2cacde){return db[_0x8ab8('0x18')]['find']({'raw':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5['options']['raw']===undefined?!![]:![]:!![],'where':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5[_0x8ab8('0x19')][_0x8ab8('0x1a')]||null:null,'attributes':_0x4edfb5[_0x8ab8('0x19')]?_0x4edfb5['options']['attributes']||null:null,'include':_0x4edfb5['options']?_0x4edfb5['options'][_0x8ab8('0x1b')]?_[_0x8ab8('0x1c')](_0x4edfb5[_0x8ab8('0x19')][_0x8ab8('0x1b')],function(_0x4ac40e){return{'model':db[_0x4ac40e[_0x8ab8('0x1d')]],'as':_0x4ac40e['as'],'attributes':_0x4ac40e['attributes'],'include':_0x4ac40e[_0x8ab8('0x1b')]?_[_0x8ab8('0x1c')](_0x4ac40e[_0x8ab8('0x1b')],function(_0x24f748){return{'model':db[_0x24f748['model']],'as':_0x24f748['as'],'attributes':_0x24f748['attributes'],'include':_0x24f748[_0x8ab8('0x1b')]?_['map'](_0x24f748[_0x8ab8('0x1b')],function(_0x3802cd){return{'model':db[_0x3802cd[_0x8ab8('0x1d')]],'as':_0x3802cd['as'],'attributes':_0x3802cd[_0x8ab8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ab8('0xc')](function(_0xb8e4ef){logger['info'](_0x8ab8('0x17'),_0x4edfb5);logger[_0x8ab8('0x10')]('ShowSetting',_0x4edfb5,JSON[_0x8ab8('0x12')](_0xb8e4ef));_0x196151(_0xb8e4ef);})['catch'](function(_0x40cad1){logger[_0x8ab8('0x13')](_0x8ab8('0x17'),_0x40cad1[_0x8ab8('0x15')],_0x4edfb5);_0x2cacde(_0x555290[_0x8ab8('0x13')](0x1f4,_0x40cad1[_0x8ab8('0x15')]));});});}; \ No newline at end of file +var _0x6ce2=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','ShowSetting','Setting','options','raw','attributes','include','map','model','debug','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0xf15d79,_0xd2aa97){var _0x41dcc9=function(_0x5a55d8){while(--_0x5a55d8){_0xf15d79['push'](_0xf15d79['shift']());}};_0x41dcc9(++_0xd2aa97);}(_0x6ce2,0x77));var _0x26ce=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x6ce2[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x26ce('0x0'));var util=require(_0x26ce('0x1'));var moment=require(_0x26ce('0x2'));var BPromise=require(_0x26ce('0x3'));var rs=require(_0x26ce('0x4'));var fs=require('fs');var Redis=require(_0x26ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26ce('0x6'));var logger=require('../../config/logger')(_0x26ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ce('0x8'));var client=jayson[_0x26ce('0x9')][_0x26ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44dc9c,_0x5b3f71,_0x3885e3){return new BPromise(function(_0x47a0d1,_0x569526){return client[_0x26ce('0xb')](_0x44dc9c,_0x3885e3)[_0x26ce('0xc')](function(_0x1a4eb2){logger['info'](_0x26ce('0xd'),_0x5b3f71,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x5b3f71,_0x26ce('0xe'),JSON['stringify'](_0x1a4eb2));if(_0x1a4eb2[_0x26ce('0xf')]){if(_0x1a4eb2[_0x26ce('0xf')][_0x26ce('0x10')]===0x1f4){logger[_0x26ce('0xf')](_0x26ce('0xd'),_0x5b3f71,_0x1a4eb2[_0x26ce('0xf')][_0x26ce('0x11')]);return _0x569526(_0x1a4eb2[_0x26ce('0xf')][_0x26ce('0x11')]);}logger[_0x26ce('0xf')](_0x26ce('0xd'),_0x5b3f71,_0x1a4eb2[_0x26ce('0xf')]['message']);return _0x47a0d1(_0x1a4eb2[_0x26ce('0xf')][_0x26ce('0x11')]);}else{logger[_0x26ce('0x12')](_0x26ce('0xd'),_0x5b3f71,_0x26ce('0xe'));_0x47a0d1(_0x1a4eb2[_0x26ce('0x13')][_0x26ce('0x11')]);}})[_0x26ce('0x14')](function(_0x2c33f8){logger[_0x26ce('0xf')](_0x26ce('0xd'),_0x5b3f71,_0x2c33f8);_0x569526(_0x2c33f8);});});}exports[_0x26ce('0x15')]=function(_0x91e787){var _0x3b8b46=this;return new Promise(function(_0x1a687b,_0xae0f6b){return db[_0x26ce('0x16')]['find']({'raw':_0x91e787[_0x26ce('0x17')]?_0x91e787[_0x26ce('0x17')][_0x26ce('0x18')]===undefined?!![]:![]:!![],'where':_0x91e787['options']?_0x91e787[_0x26ce('0x17')]['where']||null:null,'attributes':_0x91e787[_0x26ce('0x17')]?_0x91e787['options'][_0x26ce('0x19')]||null:null,'include':_0x91e787[_0x26ce('0x17')]?_0x91e787[_0x26ce('0x17')][_0x26ce('0x1a')]?_[_0x26ce('0x1b')](_0x91e787[_0x26ce('0x17')][_0x26ce('0x1a')],function(_0x459949){return{'model':db[_0x459949[_0x26ce('0x1c')]],'as':_0x459949['as'],'attributes':_0x459949[_0x26ce('0x19')],'include':_0x459949[_0x26ce('0x1a')]?_['map'](_0x459949[_0x26ce('0x1a')],function(_0x3dc81b){return{'model':db[_0x3dc81b[_0x26ce('0x1c')]],'as':_0x3dc81b['as'],'attributes':_0x3dc81b[_0x26ce('0x19')],'include':_0x3dc81b[_0x26ce('0x1a')]?_[_0x26ce('0x1b')](_0x3dc81b[_0x26ce('0x1a')],function(_0x5e633d){return{'model':db[_0x5e633d[_0x26ce('0x1c')]],'as':_0x5e633d['as'],'attributes':_0x5e633d[_0x26ce('0x19')]};}):[]};}):[]};}):[]:[]})[_0x26ce('0xc')](function(_0x1c5a04){logger[_0x26ce('0x12')](_0x26ce('0x15'),_0x91e787);logger[_0x26ce('0x1d')](_0x26ce('0x15'),_0x91e787,JSON[_0x26ce('0x1e')](_0x1c5a04));_0x1a687b(_0x1c5a04);})[_0x26ce('0x14')](function(_0x43dcb1){logger[_0x26ce('0xf')]('ShowSetting',_0x43dcb1['message'],_0x91e787);_0xae0f6b(_0x3b8b46[_0x26ce('0xf')](0x1f4,_0x43dcb1[_0x26ce('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 7e6e4f4..8f38c4e 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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0xe14b,0x93));var _0xbe14=function(_0x4b3661,_0x1be781){_0x4b3661=_0x4b3661-0x0;var _0x582d0c=_0xe14b[_0x4b3661];return _0x582d0c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x10597c,_0x499702){var _0x12f98d=function(_0x3f5b0e){while(--_0x3f5b0e){_0x10597c['push'](_0x10597c['shift']());}};_0x12f98d(++_0x499702);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0x7fbe[_0xf1af27];return _0x46b274;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 6ec89ae..b2db402 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 _0x8cdb=['setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5a7d9d,_0x23a199){var _0x5079d9=function(_0x2dcdab){while(--_0x2dcdab){_0x5a7d9d['push'](_0x5a7d9d['shift']());}};_0x5079d9(++_0x23a199);}(_0x8cdb,0x120));var _0xb8cd=function(_0x100448,_0x7a65d7){_0x100448=_0x100448-0x0;var _0x52aaf4=_0x8cdb[_0x100448];return _0x52aaf4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb8cd('0x0'));module[_0xb8cd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb8cd('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xb8cd('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb8cd('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb8cd('0x4')]();}},'phone':{'type':Sequelize[_0xb8cd('0x3')]},'type':{'type':Sequelize[_0xb8cd('0x5')](_0xb8cd('0x6'),_0xb8cd('0x7'),_0xb8cd('0x8'),_0xb8cd('0x9'),'plivo',_0xb8cd('0xa'),_0xb8cd('0xb'),_0xb8cd('0xc'),_0xb8cd('0xd'),_0xb8cd('0xe'))},'accountSid':{'type':Sequelize[_0xb8cd('0x3')]},'authId':{'type':Sequelize[_0xb8cd('0x3')]},'authToken':{'type':Sequelize[_0xb8cd('0x3')]},'smsMethod':{'type':Sequelize[_0xb8cd('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb8cd('0x3')]},'password':{'type':Sequelize[_0xb8cd('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xb8cd('0x3')]},'accountId':{'type':Sequelize[_0xb8cd('0x3')]},'senderString':{'type':Sequelize[_0xb8cd('0x3')]},'deliveryReport':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xb8cd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb8cd('0x10')],'defaultValue':function(){return _0xb8cd('0x11');}},'notificationSound':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb8cd('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb8cd('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb8cd('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb8cd('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb8cd('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb8cd('0x13'),'set':function(_0x36a444){if(!_0x36a444)this[_0xb8cd('0x14')]('mandatoryDispositionPauseId',null);this[_0xb8cd('0x14')](_0xb8cd('0x15'),_0x36a444);}}}; \ No newline at end of file +var _0xdcc6=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','ENUM','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdcc6,0x1bc));var _0x6dcc=function(_0x4ce46c,_0x3002e5){_0x4ce46c=_0x4ce46c-0x0;var _0x132542=_0xdcc6[_0x4ce46c];return _0x132542;};'use strict';var Sequelize=require(_0x6dcc('0x0'));var rs=require('randomstring');module[_0x6dcc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6dcc('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6dcc('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x6dcc('0x3')]},'type':{'type':Sequelize['ENUM'](_0x6dcc('0x4'),_0x6dcc('0x5'),_0x6dcc('0x6'),_0x6dcc('0x7'),_0x6dcc('0x8'),'clickatell',_0x6dcc('0x9'),_0x6dcc('0xa'),_0x6dcc('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0x6dcc('0x3')]},'authId':{'type':Sequelize[_0x6dcc('0x3')]},'authToken':{'type':Sequelize[_0x6dcc('0x3')]},'smsMethod':{'type':Sequelize[_0x6dcc('0xc')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6dcc('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x6dcc('0x3')]},'accountId':{'type':Sequelize[_0x6dcc('0x3')]},'senderString':{'type':Sequelize[_0x6dcc('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x6dcc('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6dcc('0xd');}},'notificationSound':{'type':Sequelize[_0x6dcc('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6dcc('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dcc('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dcc('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dcc('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dcc('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6dcc('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dcc('0xf')],'comment':_0x6dcc('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x6dcc('0xe')],'defaultValue':![],'comment':_0x6dcc('0x11'),'set':function(_0x3b525e){if(!_0x3b525e)this[_0x6dcc('0x12')](_0x6dcc('0x13'),null);this[_0x6dcc('0x12')](_0x6dcc('0x14'),_0x3b525e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5f64f60..4cc1aef 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 _0x000c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','sms','SmsApplication','Applications','account','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','type','twilio','From','messageId','from','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','debug','entity\x20found','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','User','Owner','fullname','internal','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','inspect','error_code','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','rows','catch','keys','intersection','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x000c,0x7d));var _0xc000=function(_0x319f09,_0x555c99){_0x319f09=_0x319f09-0x0;var _0x269422=_0x000c[_0x319f09];return _0x269422;};'use strict';var emlformat=require(_0xc000('0x0'));var rimraf=require(_0xc000('0x1'));var zipdir=require(_0xc000('0x2'));var jsonpatch=require(_0xc000('0x3'));var rp=require(_0xc000('0x4'));var moment=require(_0xc000('0x5'));var BPromise=require(_0xc000('0x6'));var Mustache=require(_0xc000('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc000('0x8'));var csv=require(_0xc000('0x9'));var ejs=require(_0xc000('0xa'));var fs=require('fs');var fs_extra=require(_0xc000('0xb'));var _=require(_0xc000('0xc'));var squel=require(_0xc000('0xd'));var crypto=require('crypto');var jsforce=require(_0xc000('0xe'));var deskjs=require(_0xc000('0xf'));var toCsv=require(_0xc000('0x9'));var querystring=require(_0xc000('0x10'));var Papa=require(_0xc000('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc000('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc000('0x13'))('api');var utils=require(_0xc000('0x14'));var config=require(_0xc000('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc000('0x16'))['db'];config[_0xc000('0x17')]=_[_0xc000('0x18')](config['redis'],{'host':_0xc000('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc000('0x17')]));require(_0xc000('0x1a'))[_0xc000('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1d1a05,_0x10a04c,_0x712baf,_0x87a518){return new BPromise(function(_0x27fc2d,_0x2a90ae){var _0xcbd2f8=_0x87a518||client;return _0xcbd2f8[_0xc000('0x1c')](_0x1d1a05,_0x712baf)[_0xc000('0x1d')](function(_0x5c030f){logger[_0xc000('0x1e')](_0xc000('0x1f'),_0x10a04c,'request\x20sent');logger['debug'](_0xc000('0x20'),_0x10a04c,'request\x20sent',JSON[_0xc000('0x21')](_0x5c030f));if(_0x5c030f[_0xc000('0x22')]){if(_0x5c030f[_0xc000('0x22')][_0xc000('0x23')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x5c030f[_0xc000('0x22')]['message']);return _0x2a90ae(_0x5c030f[_0xc000('0x22')][_0xc000('0x24')]);}logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x5c030f[_0xc000('0x22')]['message']);return _0x27fc2d(_0x5c030f['error'][_0xc000('0x24')]);}else{logger[_0xc000('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,'request\x20sent');_0x27fc2d(_0x5c030f[_0xc000('0x25')]['message']);}})['catch'](function(_0x486741){logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s',_0x10a04c,_0x486741);_0x2a90ae(_0x486741);});});}function respondWithStatusCode(_0x52e081,_0x8288af){_0x8288af=_0x8288af||0xcc;return function(_0x25c9b4){if(_0x25c9b4){return _0x52e081[_0xc000('0x26')](_0x8288af);}return _0x52e081[_0xc000('0x27')](_0x8288af)[_0xc000('0x28')]();};}function respondWithResult(_0x3915b6,_0x24ca79){_0x24ca79=_0x24ca79||0xc8;return function(_0x215ef6){if(_0x215ef6){return _0x3915b6[_0xc000('0x27')](_0x24ca79)[_0xc000('0x29')](_0x215ef6);}};}function respondWithFilteredResult(_0x28915d,_0x47058c){return function(_0x27b41a){if(_0x27b41a){var _0x2fbc26=typeof _0x47058c[_0xc000('0x2a')]===_0xc000('0x2b')&&typeof _0x47058c['limit']===_0xc000('0x2b');var _0x1c763a=_0x27b41a[_0xc000('0x2c')];var _0x1ddb33=_0x2fbc26?0x0:_0x47058c[_0xc000('0x2a')];var _0x2be652=_0x2fbc26?_0x27b41a[_0xc000('0x2c')]:_0x47058c[_0xc000('0x2a')]+_0x47058c[_0xc000('0x2d')];var _0x22b7e0;if(_0x2be652>=_0x1c763a){_0x2be652=_0x1c763a;_0x22b7e0=0xc8;}else{_0x22b7e0=0xce;}_0x28915d[_0xc000('0x27')](_0x22b7e0);return _0x28915d[_0xc000('0x2e')](_0xc000('0x2f'),_0x1ddb33+'-'+_0x2be652+'/'+_0x1c763a)[_0xc000('0x29')](_0x27b41a);}return null;};}function patchUpdates(_0x1990b8){return function(_0x1bbe90){try{jsonpatch[_0xc000('0x30')](_0x1bbe90,_0x1990b8,!![]);}catch(_0x1028fb){return BPromise[_0xc000('0x31')](_0x1028fb);}return _0x1bbe90[_0xc000('0x32')]();};}function saveUpdates(_0x438738,_0x2d65e0){return function(_0x5b3558){if(_0x5b3558){return _0x5b3558[_0xc000('0x33')](_0x438738)[_0xc000('0x1d')](function(_0x35e842){return _0x35e842;});}return null;};}function removeEntity(_0x3826e0,_0x48549b){return function(_0x1e385c){if(_0x1e385c){return _0x1e385c[_0xc000('0x34')]()[_0xc000('0x1d')](function(){var _0x2383d3=_0x1e385c['get']({'plain':!![]});var _0x5cbe2b='SmsAccounts';return db[_0xc000('0x35')][_0xc000('0x34')]({'where':{'type':_0x5cbe2b,'resourceId':_0x2383d3['id']}})['then'](function(){return _0x1e385c;});})['then'](function(){_0x3826e0[_0xc000('0x27')](0xcc)[_0xc000('0x28')]();});}};}function handleEntityNotFound(_0x287111,_0x5c73fc){return function(_0x35bde1){if(!_0x35bde1){_0x287111[_0xc000('0x26')](0x194);}return _0x35bde1;};}function handleError(_0x3f5704,_0x49b606){_0x49b606=_0x49b606||0x1f4;return function(_0x5122d6){logger[_0xc000('0x22')](_0x5122d6[_0xc000('0x36')]);if(_0x5122d6[_0xc000('0x37')]){delete _0x5122d6[_0xc000('0x37')];}_0x3f5704[_0xc000('0x27')](_0x49b606)[_0xc000('0x38')](_0x5122d6);};}exports['index']=function(_0x36f5a9,_0x37bdee){var _0x2a3dba={'include':[{'model':db[_0xc000('0x39')],'as':_0xc000('0x3a')}]},_0x16303c={},_0x58ef1d={'count':0x0,'rows':[]};var _0x3f21a6=_[_0xc000('0x3b')](db[_0xc000('0x3c')][_0xc000('0x3d')],function(_0x1413fc){return{'name':_0x1413fc[_0xc000('0x3e')],'type':_0x1413fc['type'][_0xc000('0x3f')]};});_0x16303c[_0xc000('0x40')]=_['map'](_0x3f21a6,_0xc000('0x37'));_0x16303c[_0xc000('0x41')]=_['keys'](_0x36f5a9[_0xc000('0x41')]);_0x16303c[_0xc000('0x42')]=_['intersection'](_0x16303c[_0xc000('0x40')],_0x16303c[_0xc000('0x41')]);_0x2a3dba[_0xc000('0x43')]=_['intersection'](_0x16303c['model'],qs[_0xc000('0x44')](_0x36f5a9['query'][_0xc000('0x44')]));_0x2a3dba['attributes']=_0x2a3dba[_0xc000('0x43')][_0xc000('0x45')]?_0x2a3dba[_0xc000('0x43')]:_0x16303c['model'];if(!_0x36f5a9[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x2a3dba[_0xc000('0x2d')]=qs['limit'](_0x36f5a9[_0xc000('0x41')][_0xc000('0x2d')]);_0x2a3dba[_0xc000('0x2a')]=qs[_0xc000('0x2a')](_0x36f5a9[_0xc000('0x41')]['offset']);}_0x2a3dba['order']=qs[_0xc000('0x48')](_0x36f5a9['query']['sort']);_0x2a3dba['where']=qs[_0xc000('0x42')](_[_0xc000('0x49')](_0x36f5a9['query'],_0x16303c[_0xc000('0x42')]),_0x3f21a6);if(_0x36f5a9[_0xc000('0x41')][_0xc000('0x4a')]){_0x2a3dba[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x2a3dba[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x3f21a6,function(_0x25ca43){if(_0x25ca43['type']!=='VIRTUAL'){var _0xac0298={};_0xac0298[_0x25ca43[_0xc000('0x37')]]={'$like':'%'+_0x36f5a9['query'][_0xc000('0x4a')]+'%'};return _0xac0298;}})});}_0x2a3dba=_['merge']({},_0x2a3dba,_0x36f5a9['options']);var _0x5eabb4={'where':_0x2a3dba[_0xc000('0x4b')]};return db[_0xc000('0x3c')][_0xc000('0x2c')](_0x5eabb4)[_0xc000('0x1d')](function(_0x3edc2e){_0x58ef1d[_0xc000('0x2c')]=_0x3edc2e;if(_0x36f5a9['query'][_0xc000('0x4d')]){_0x2a3dba[_0xc000('0x4e')]=[{'all':!![]}];}return db[_0xc000('0x3c')]['findAll'](_0x2a3dba);})[_0xc000('0x1d')](function(_0x164b22){_0x58ef1d[_0xc000('0x4f')]=_0x164b22;return _0x58ef1d;})['then'](respondWithFilteredResult(_0x37bdee,_0x2a3dba))[_0xc000('0x50')](handleError(_0x37bdee,null));};exports['show']=function(_0x1290de,_0x1b1451){var _0xaf4334={'raw':![],'where':{'id':_0x1290de['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x244fe3={};_0x244fe3[_0xc000('0x40')]=_[_0xc000('0x51')](db[_0xc000('0x3c')][_0xc000('0x3d')]);_0x244fe3[_0xc000('0x41')]=_['keys'](_0x1290de[_0xc000('0x41')]);_0x244fe3[_0xc000('0x42')]=_[_0xc000('0x52')](_0x244fe3[_0xc000('0x40')],_0x244fe3[_0xc000('0x41')]);_0xaf4334[_0xc000('0x43')]=_[_0xc000('0x52')](_0x244fe3[_0xc000('0x40')],qs[_0xc000('0x44')](_0x1290de[_0xc000('0x41')][_0xc000('0x44')]));_0xaf4334[_0xc000('0x43')]=_0xaf4334[_0xc000('0x43')][_0xc000('0x45')]?_0xaf4334[_0xc000('0x43')]:_0x244fe3['model'];if(_0x1290de[_0xc000('0x41')]['includeAll']){_0xaf4334['include']=[{'all':!![]}];}_0xaf4334=_[_0xc000('0x4c')]({},_0xaf4334,_0x1290de[_0xc000('0x53')]);return db['SmsAccount'][_0xc000('0x54')](_0xaf4334)['then'](handleEntityNotFound(_0x1b1451,null))[_0xc000('0x1d')](respondWithResult(_0x1b1451,null))[_0xc000('0x50')](handleError(_0x1b1451,null));};exports[_0xc000('0x55')]=function(_0xc0d695,_0x1c1630){return db[_0xc000('0x3c')][_0xc000('0x55')](_0xc0d695[_0xc000('0x56')],{})['then'](function(_0x3781ed){var _0x2237cf=_0xc0d695[_0xc000('0x57')][_0xc000('0x58')]({'plain':!![]});if(!_0x2237cf)throw new Error(_0xc000('0x59'));if(_0x2237cf['role']==='user'){var _0x1af564=_0x3781ed[_0xc000('0x58')]({'plain':!![]});var _0x438714=_0xc000('0x5a');return db[_0xc000('0x5b')][_0xc000('0x54')]({'where':{'name':_0x438714,'userProfileId':_0x2237cf[_0xc000('0x5c')]},'raw':!![]})[_0xc000('0x1d')](function(_0x37c421){if(_0x37c421&&_0x37c421[_0xc000('0x5d')]===0x0){return db[_0xc000('0x35')][_0xc000('0x55')]({'name':_0x1af564[_0xc000('0x37')],'resourceId':_0x1af564['id'],'type':_0x37c421['name'],'sectionId':_0x37c421['id']},{})[_0xc000('0x1d')](function(){return _0x3781ed;});}else{return _0x3781ed;}})['catch'](function(_0x5a42f8){logger[_0xc000('0x22')](_0xc000('0x5e'),_0x5a42f8);throw _0x5a42f8;});}return _0x3781ed;})[_0xc000('0x1d')](respondWithResult(_0x1c1630,0xc9))[_0xc000('0x50')](handleError(_0x1c1630,null));};exports[_0xc000('0x33')]=function(_0x4e87fc,_0x45a567){if(_0x4e87fc[_0xc000('0x56')]['id']){delete _0x4e87fc[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4e87fc[_0xc000('0x5f')]['id']},'include':[{'model':db[_0xc000('0x39')],'as':_0xc000('0x3a')}]})[_0xc000('0x1d')](handleEntityNotFound(_0x45a567,null))[_0xc000('0x1d')](saveUpdates(_0x4e87fc[_0xc000('0x56')],null))[_0xc000('0x1d')](respondWithResult(_0x45a567,null))[_0xc000('0x50')](handleError(_0x45a567,null));};exports['destroy']=function(_0x14fc94,_0x4d4dc3){return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x14fc94[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4d4dc3,null))[_0xc000('0x1d')](removeEntity(_0x4d4dc3,null))['catch'](handleError(_0x4d4dc3,null));};exports[_0xc000('0x60')]=function(_0x82f774,_0xd9bb02){return db['SmsAccount'][_0xc000('0x60')]()[_0xc000('0x1d')](respondWithResult(_0xd9bb02,null))[_0xc000('0x50')](handleError(_0xd9bb02,null));};exports['addDisposition']=function(_0x4f9d85,_0x59196c,_0x16b340){if(_0x4f9d85[_0xc000('0x56')]['id']){delete _0x4f9d85[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4f9d85[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x59196c,null))[_0xc000('0x1d')](function(_0x4d8972){if(_0x4d8972){_0x4f9d85[_0xc000('0x56')][_0xc000('0x61')]=_0x4d8972['id'];return db[_0xc000('0x62')][_0xc000('0x55')](_0x4f9d85['body']);}})[_0xc000('0x1d')](respondWithResult(_0x59196c,null))['catch'](handleError(_0x59196c,null));};exports[_0xc000('0x63')]=function(_0x1ef88d,_0x5d6104,_0x3a4202){var _0x4d97fe={'raw':![],'where':{}};var _0x1726e8={};var _0x331c77={'count':0x0,'rows':[]};return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x1ef88d[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x5d6104,null))[_0xc000('0x1d')](function(_0x2d5c7c){if(_0x2d5c7c){_0x1726e8[_0xc000('0x40')]=_['keys'](db[_0xc000('0x62')]['rawAttributes']);_0x1726e8[_0xc000('0x41')]=_[_0xc000('0x51')](_0x1ef88d['query']);_0x1726e8[_0xc000('0x42')]=_[_0xc000('0x52')](_0x1726e8['model'],_0x1726e8[_0xc000('0x41')]);_0x4d97fe[_0xc000('0x43')]=_['intersection'](_0x1726e8['model'],qs[_0xc000('0x44')](_0x1ef88d[_0xc000('0x41')][_0xc000('0x44')]));_0x4d97fe[_0xc000('0x43')]=_0x4d97fe['attributes'][_0xc000('0x45')]?_0x4d97fe[_0xc000('0x43')]:_0x1726e8[_0xc000('0x40')];if(!_0x1ef88d[_0xc000('0x41')]['hasOwnProperty'](_0xc000('0x47'))){_0x4d97fe[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x1ef88d['query'][_0xc000('0x2d')]);_0x4d97fe[_0xc000('0x2a')]=qs['offset'](_0x1ef88d[_0xc000('0x41')][_0xc000('0x2a')]);}_0x4d97fe['order']=qs[_0xc000('0x48')](_0x1ef88d['query'][_0xc000('0x48')]);_0x4d97fe[_0xc000('0x4b')]=qs[_0xc000('0x42')](_['pick'](_0x1ef88d['query'],_0x1726e8[_0xc000('0x42')]));_0x4d97fe[_0xc000('0x4b')][_0xc000('0x61')]=_0x2d5c7c['id'];if(_0x1ef88d['query'][_0xc000('0x4a')]){_0x4d97fe['where']=_[_0xc000('0x4c')](_0x4d97fe[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x4d97fe[_0xc000('0x43')],function(_0x48dd03){var _0x13b88b={};_0x13b88b[_0x48dd03]={'$like':'%'+_0x1ef88d[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x13b88b;})});}_0x4d97fe=_[_0xc000('0x4c')]({},_0x4d97fe,_0x1ef88d[_0xc000('0x53')]);return db[_0xc000('0x62')][_0xc000('0x2c')]({'where':_0x4d97fe[_0xc000('0x4b')]})['then'](function(_0x157eff){_0x331c77['count']=_0x157eff;if(_0x1ef88d[_0xc000('0x41')][_0xc000('0x4d')]){_0x4d97fe[_0xc000('0x4e')]=[{'all':!![]}];}return db[_0xc000('0x62')][_0xc000('0x65')](_0x4d97fe);})[_0xc000('0x1d')](function(_0x54694c){_0x331c77[_0xc000('0x4f')]=_0x54694c;return _0x331c77;});}})[_0xc000('0x1d')](respondWithFilteredResult(_0x5d6104,_0x4d97fe))[_0xc000('0x50')](handleError(_0x5d6104,null));};exports[_0xc000('0x66')]=function(_0x5d3283,_0x1e28ee,_0x495244){return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x5d3283[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x1e28ee,null))[_0xc000('0x1d')](function(_0x7d8214){if(_0x7d8214){return _0x7d8214[_0xc000('0x66')](_0x5d3283['query'][_0xc000('0x67')]);}})['then'](respondWithStatusCode(_0x1e28ee,null))['catch'](handleError(_0x1e28ee,null));};exports[_0xc000('0x68')]=function(_0x42c4a3,_0x2bbb9b,_0x5aeaa5){if(_0x42c4a3[_0xc000('0x56')]['id']){delete _0x42c4a3[_0xc000('0x56')]['id'];}return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x42c4a3[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x2bbb9b,null))[_0xc000('0x1d')](function(_0x154493){if(_0x154493){_0x42c4a3[_0xc000('0x56')][_0xc000('0x61')]=_0x154493['id'];return db[_0xc000('0x69')][_0xc000('0x55')](_0x42c4a3['body']);}})[_0xc000('0x1d')](respondWithResult(_0x2bbb9b,null))['catch'](handleError(_0x2bbb9b,null));};exports[_0xc000('0x6a')]=function(_0x4b778b,_0x4ae242,_0x153fd0){var _0x2858be={'raw':![],'where':{}};var _0x412c4a={};var _0x4caeb8={'count':0x0,'rows':[]};return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x4b778b[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4ae242,null))[_0xc000('0x1d')](function(_0x5f2dd7){if(_0x5f2dd7){_0x412c4a[_0xc000('0x40')]=_[_0xc000('0x51')](db['CannedAnswer'][_0xc000('0x3d')]);_0x412c4a[_0xc000('0x41')]=_[_0xc000('0x51')](_0x4b778b[_0xc000('0x41')]);_0x412c4a[_0xc000('0x42')]=_[_0xc000('0x52')](_0x412c4a['model'],_0x412c4a['query']);_0x2858be[_0xc000('0x43')]=_[_0xc000('0x52')](_0x412c4a[_0xc000('0x40')],qs['fields'](_0x4b778b[_0xc000('0x41')][_0xc000('0x44')]));_0x2858be[_0xc000('0x43')]=_0x2858be['attributes']['length']?_0x2858be[_0xc000('0x43')]:_0x412c4a[_0xc000('0x40')];if(!_0x4b778b['query'][_0xc000('0x46')](_0xc000('0x47'))){_0x2858be[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x4b778b['query'][_0xc000('0x2d')]);_0x2858be['offset']=qs[_0xc000('0x2a')](_0x4b778b['query'][_0xc000('0x2a')]);}_0x2858be[_0xc000('0x6b')]=qs[_0xc000('0x48')](_0x4b778b[_0xc000('0x41')][_0xc000('0x48')]);_0x2858be[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0x4b778b[_0xc000('0x41')],_0x412c4a['filters']));_0x2858be[_0xc000('0x4b')]['SmsAccountId']=_0x5f2dd7['id'];if(_0x4b778b[_0xc000('0x41')]['filter']){_0x2858be[_0xc000('0x4b')]=_['merge'](_0x2858be[_0xc000('0x4b')],{'$or':_['map'](_0x2858be['attributes'],function(_0x9cc70a){var _0x76af19={};_0x76af19[_0x9cc70a]={'$like':'%'+_0x4b778b[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x76af19;})});}_0x2858be=_[_0xc000('0x4c')]({},_0x2858be,_0x4b778b[_0xc000('0x53')]);return db['CannedAnswer'][_0xc000('0x2c')]({'where':_0x2858be['where']})[_0xc000('0x1d')](function(_0x72549e){_0x4caeb8[_0xc000('0x2c')]=_0x72549e;if(_0x4b778b[_0xc000('0x41')]['includeAll']){_0x2858be['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2858be);})['then'](function(_0x14f08a){_0x4caeb8[_0xc000('0x4f')]=_0x14f08a;return _0x4caeb8;});}})['then'](respondWithFilteredResult(_0x4ae242,_0x2858be))[_0xc000('0x50')](handleError(_0x4ae242,null));};exports[_0xc000('0x6c')]=function(_0x2efddb,_0x4067c5,_0x5e3d77){return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x2efddb[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x4067c5,null))['then'](function(_0x363f89){if(_0x363f89){return _0x363f89[_0xc000('0x6c')](_0x2efddb[_0xc000('0x41')][_0xc000('0x67')]);}})[_0xc000('0x1d')](respondWithStatusCode(_0x4067c5,null))[_0xc000('0x50')](handleError(_0x4067c5,null));};exports['notify']=function(_0x383142,_0x558dae,_0x23952d){var _0x53c727={'channel':_0xc000('0x6d')};var _0x581482=[];var _0x200d6b=[];var _0x4edab0={};return db['SmsAccount'][_0xc000('0x54')]({'where':{'id':_0x383142[_0xc000('0x5f')]['id']},'include':[{'model':db[_0xc000('0x6e')],'as':_0xc000('0x6f')}]})['then'](handleEntityNotFound(_0x558dae,null))['then'](function(_0x3dfba4){_0x53c727[_0xc000('0x70')]=_0x3dfba4;_0x53c727[_0xc000('0x71')]=_['orderBy'](_0x3dfba4[_0xc000('0x6f')],['priority'],[_0xc000('0x72')]);if(_0x53c727[_0xc000('0x70')]['Applications']){delete _0x53c727[_0xc000('0x70')][_0xc000('0x6f')];}return db[_0xc000('0x73')][_0xc000('0x60')]();})[_0xc000('0x1d')](function(_0x52feee){if(!_0x52feee){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0x75'));}_0x581482=_[_0xc000('0x76')](_['keys'](_0x52feee),[_0xc000('0x77'),_0xc000('0x78')]);_0x200d6b=_[_0xc000('0x76')](_['keys'](_0x52feee),[_0xc000('0x77'),'updatedAt',_0xc000('0x79'),_0xc000('0x7a')]);_0x53c727[_0xc000('0x56')]={'mapKey':'mobile'};if(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]){switch(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]){case _0xc000('0x7c'):_0x53c727[_0xc000('0x56')]['from']=_0x383142[_0xc000('0x56')][_0xc000('0x7d')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')]['Body'];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')]['MessageSid'];break;case'skebby':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]='+'+_0x383142[_0xc000('0x56')]['sender'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x80')];break;case _0xc000('0x81'):_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')]['message'];break;case _0xc000('0x82'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')]['from'];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x56')];_0x53c727[_0xc000('0x56')]['messageId']=_0x383142[_0xc000('0x56')][_0xc000('0x83')];break;case'plivo':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body'][_0xc000('0x7d')];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x84')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x85')];break;case _0xc000('0x86'):_0x53c727['body'][_0xc000('0x7f')]='+'+_0x383142[_0xc000('0x56')][_0xc000('0x87')][0x0]['from'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x87')][0x0]['text'];_0x53c727[_0xc000('0x56')]['messageId']=_0x383142['body'][_0xc000('0x87')][0x0][_0xc000('0x7e')];break;case _0xc000('0x88'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body']['originatingAddress'];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x89')]['message'];break;case _0xc000('0x8a'):_0x53c727[_0xc000('0x56')][_0xc000('0x7f')]=_0x383142['body'][_0xc000('0x8b')];_0x53c727['body'][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][_0xc000('0x80')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x8c')];break;case'bandwidth':_0x53c727['body'][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][0x0]['message']['id'];_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][0x0]['message'][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')][_0xc000('0x56')]=_0x383142[_0xc000('0x56')][0x0]['message'][_0xc000('0x80')];break;case _0xc000('0x8d'):_0x53c727['body'][_0xc000('0x7f')]=_0x383142[_0xc000('0x56')][_0xc000('0x7f')];_0x53c727[_0xc000('0x56')]['body']=_0x383142[_0xc000('0x56')][_0xc000('0x24')];_0x53c727[_0xc000('0x56')][_0xc000('0x7e')]=_0x383142[_0xc000('0x56')][_0xc000('0x8e')];break;}}if(_0x53c727[_0xc000('0x56')]['id']){delete _0x53c727[_0xc000('0x56')]['id'];}if(_[_0xc000('0x8f')](_0x53c727[_0xc000('0x56')][_0xc000('0x7f')])){throw new db['Sequelize'][(_0xc000('0x90'))](_0xc000('0x91'));}if(_['isNil'](_0x53c727[_0xc000('0x56')][_0xc000('0x56')])||_0x53c727[_0xc000('0x56')][_0xc000('0x56')]===''){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))](_0xc000('0x92'));}if(_[_0xc000('0x8f')](_0x53c727[_0xc000('0x56')][_0xc000('0x93')])){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0x94')+_0x200d6b);}if(!_[_0xc000('0x95')](_0x200d6b,_0x53c727[_0xc000('0x56')][_0xc000('0x93')])){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x200d6b);}_0x4edab0[_0x53c727['body'][_0xc000('0x93')]]=_0x53c727['body'][_0xc000('0x7f')];return db[_0xc000('0x96')][_0xc000('0x54')]({'where':{'id':_0x53c727[_0xc000('0x70')][_0xc000('0x7a')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4edab0,'limit':0x1,'order':[['updatedAt',_0xc000('0x97')]]}]});})[_0xc000('0x1d')](handleEntityNotFound(_0x558dae,null))['then'](function(_0x521680){if(_0x521680){_0x53c727[_0xc000('0x98')]=_[_0xc000('0x99')](_0x521680,[_0xc000('0x9a')]);if(_0x521680['Contacts']['length']){return _0x521680['Contacts'][0x0];}var _0x247b35=_[_0xc000('0x18')](_0x53c727[_0xc000('0x56')],{'firstName':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')],'ListId':_0x521680['id']});_0x247b35[_0x53c727['body'][_0xc000('0x93')]]=_0x53c727[_0xc000('0x56')][_0xc000('0x7f')];return db[_0xc000('0x73')][_0xc000('0x55')](_0x247b35,{'fields':_0x581482,'raw':!![]});}})[_0xc000('0x1d')](handleEntityNotFound(_0x558dae,null))[_0xc000('0x1d')](function(_0x3dc161){if(_0x3dc161){_0x53c727[_0xc000('0x9b')]=_0x3dc161;var _0x529259={'ContactId':_0x3dc161['id'],'phone':_0x53c727[_0xc000('0x56')][_0xc000('0x7f')],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id']};var _0x3b0bd8={'ContactId':_0x3dc161['id'],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3b0bd8})[_0xc000('0x1d')](function(_0x4cdf2a){if(_0x4cdf2a){return[_0x4cdf2a,![]];}return db[_0xc000('0x9c')]['create'](_0x529259)['then'](function(_0xb8374c){return[_0xb8374c,!![]];});});}})[_0xc000('0x9d')](function(_0x24ceb6,_0x2102e3){_0x53c727['interaction']=_0x24ceb6[_0xc000('0x58')]({'plain':!![]});_0x53c727[_0xc000('0x9e')][_0xc000('0x9f')]=![];if(_0x2102e3){if(_0x53c727['account'][_0xc000('0xa0')]){_0x53c727[_0xc000('0x71')][_0xc000('0xa1')]({'id':0x0,'priority':_0x53c727[_0xc000('0x71')][_0xc000('0x45')]+0x1,'app':_0xc000('0xa2'),'appdata':_0xc000('0xa3'),'interval':_0xc000('0xa4')});}_0x53c727['interaction'][_0xc000('0x9f')]=!![];}return db[_0xc000('0xa5')][_0xc000('0x55')]({'phone':_0x53c727['body']['from'],'messageId':_0x53c727[_0xc000('0x56')][_0xc000('0x7e')],'body':_0x53c727[_0xc000('0x56')][_0xc000('0x56')],'SmsAccountId':_0x383142[_0xc000('0x5f')]['id'],'SmsInteractionId':_0x24ceb6['id'],'direction':'in','ContactId':_0x24ceb6['ContactId'],'AttachmentId':_0x53c727['body'][_0xc000('0xa6')]});})[_0xc000('0x1d')](function(_0x5216de){_0x53c727[_0xc000('0x24')]=_0x5216de;if(_0x53c727['interaction'][_0xc000('0xa7')]){return db['User'][_0xc000('0x54')]({'attributes':['id',_0xc000('0x37')],'where':{'id':_0x53c727[_0xc000('0x9e')][_0xc000('0xa7')]}})[_0xc000('0x1d')](function(_0x22928b){if(_0x22928b){_0x53c727[_0xc000('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc000('0xa8'),'appdata':_0x22928b[_0xc000('0x37')]+','+(_0x53c727['account'][_0xc000('0xa9')]||0xa),'interval':_0xc000('0xa4')});}return respondWithRpcPromise(_0xc000('0xaa'),_0xc000('0xab'),_0x53c727);});}return respondWithRpcPromise(_0xc000('0xaa'),_0xc000('0xab'),_0x53c727);})[_0xc000('0x1d')](function(_0x299523){if(_0x299523){var _0x338ac0=0xc8;var _0x4cb185='receiveMessage';logger[_0xc000('0x1e')](_0xc000('0x20'),_0x4cb185,_0x338ac0,'entity\x20found');logger[_0xc000('0xac')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4cb185,_0x338ac0,_0xc000('0xad'),JSON[_0xc000('0x21')](_0x299523));if(_0x53c727[_0xc000('0x70')][_0xc000('0x7b')]===_0xc000('0x7c')){return _0x558dae[_0xc000('0x27')](_0x338ac0)[_0xc000('0x2e')]('Content-Type',_0xc000('0xae'))['send'](_0xc000('0xaf'));}else{return _0x558dae[_0xc000('0x27')](_0x338ac0)[_0xc000('0x29')](_0x299523);}}})['catch'](handleError(_0x558dae,null));};exports[_0xc000('0xb0')]=function(_0x40e264,_0x499b38,_0x251acf){return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x40e264[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x499b38,null))[_0xc000('0x1d')](function(_0x365bb9){if(_0x365bb9){return db[_0xc000('0xb1')][_0xc000('0xb2')](function(_0x3b32c1){return db[_0xc000('0x6e')]['destroy']({'where':{'SmsAccountId':_0x40e264['params']['id']},'transaction':_0x3b32c1})[_0xc000('0x1d')](function(_0x15e641){var _0x4e196c=_[_0xc000('0x3b')](_0x40e264['body'],function(_0x34046c){_0x34046c['SmsAccountId']=_0x40e264['params']['id'];return _0x34046c;});return db[_0xc000('0x6e')][_0xc000('0xb3')](_0x4e196c,{'transaction':_0x3b32c1});});})[_0xc000('0x1d')](function(){return db[_0xc000('0x6e')][_0xc000('0xb4')]({'where':{'SmsAccountId':_0x40e264[_0xc000('0x5f')]['id']},'order':_0xc000('0xb5')});});}})[_0xc000('0x1d')](respondWithResult(_0x499b38,null))[_0xc000('0x50')](handleError(_0x499b38,null));};exports['getApplications']=function(_0x2c837a,_0xbb6983,_0x2f40bf){var _0x21a4d8={};var _0x1aca11={};var _0x363cfe;var _0x3a70e0;return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0x2c837a[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0xbb6983,null))['then'](function(_0x19d0e3){if(_0x19d0e3){_0x363cfe=_0x19d0e3;_0x1aca11[_0xc000('0x40')]=_[_0xc000('0x51')](db[_0xc000('0x6e')][_0xc000('0x3d')]);_0x1aca11[_0xc000('0x41')]=_[_0xc000('0x51')](_0x2c837a[_0xc000('0x41')]);_0x1aca11[_0xc000('0x42')]=_[_0xc000('0x52')](_0x1aca11[_0xc000('0x40')],_0x1aca11[_0xc000('0x41')]);_0x21a4d8['attributes']=_[_0xc000('0x52')](_0x1aca11[_0xc000('0x40')],qs[_0xc000('0x44')](_0x2c837a['query'][_0xc000('0x44')]));_0x21a4d8[_0xc000('0x43')]=_0x21a4d8['attributes'][_0xc000('0x45')]?_0x21a4d8['attributes']:_0x1aca11[_0xc000('0x40')];_0x21a4d8['order']=qs[_0xc000('0x48')](_0x2c837a[_0xc000('0x41')]['sort']);_0x21a4d8[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0x2c837a[_0xc000('0x41')],_0x1aca11[_0xc000('0x42')]));if(_0x2c837a[_0xc000('0x41')][_0xc000('0x4a')]){_0x21a4d8[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x21a4d8['where'],{'$or':_[_0xc000('0x3b')](_0x21a4d8['attributes'],function(_0x4d791e){var _0x4ce917={};_0x4ce917[_0x4d791e]={'$like':'%'+_0x2c837a[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x4ce917;})});}_0x21a4d8=_[_0xc000('0x4c')]({},_0x21a4d8,_0x2c837a[_0xc000('0x53')]);return _0x363cfe[_0xc000('0xb6')](_0x21a4d8);}})[_0xc000('0x1d')](function(_0x73e02){if(_0x73e02){_0x3a70e0=_0x73e02[_0xc000('0x45')];if(!_0x2c837a[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x21a4d8[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x2c837a[_0xc000('0x41')][_0xc000('0x2d')]);_0x21a4d8[_0xc000('0x2a')]=qs['offset'](_0x2c837a[_0xc000('0x41')]['offset']);}return _0x363cfe[_0xc000('0xb6')](_0x21a4d8);}})[_0xc000('0x1d')](function(_0x381b5f){if(_0x381b5f){return _0x381b5f?{'count':_0x3a70e0,'rows':_0x381b5f}:null;}})[_0xc000('0x1d')](respondWithResult(_0xbb6983,null))[_0xc000('0x50')](handleError(_0xbb6983,null));};exports[_0xc000('0xb7')]=function(_0x4ca087,_0x5dce8a,_0x249d23){var _0x2369a6={'raw':![],'where':{}};var _0x48945c={};var _0x261853={'count':0x0,'rows':[]};return db['SmsAccount'][_0xc000('0x64')]({'where':{'id':_0x4ca087[_0xc000('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5dce8a,null))[_0xc000('0x1d')](function(_0x57e4d1){if(_0x57e4d1){_0x48945c[_0xc000('0x40')]=_[_0xc000('0x51')](db['SmsInteraction'][_0xc000('0x3d')]);_0x48945c['query']=_[_0xc000('0x51')](_0x4ca087['query']);_0x48945c[_0xc000('0x42')]=_[_0xc000('0x52')](_0x48945c[_0xc000('0x40')],_0x48945c[_0xc000('0x41')]);_0x2369a6[_0xc000('0x43')]=_[_0xc000('0x52')](_0x48945c[_0xc000('0x40')],qs[_0xc000('0x44')](_0x4ca087['query'][_0xc000('0x44')]));_0x2369a6[_0xc000('0x43')]=_0x2369a6[_0xc000('0x43')][_0xc000('0x45')]?_0x2369a6[_0xc000('0x43')]:_0x48945c['model'];if(!_0x4ca087['query']['hasOwnProperty']('nolimit')){_0x2369a6[_0xc000('0x2d')]=qs[_0xc000('0x2d')](_0x4ca087[_0xc000('0x41')][_0xc000('0x2d')]);_0x2369a6[_0xc000('0x2a')]=qs['offset'](_0x4ca087[_0xc000('0x41')][_0xc000('0x2a')]);}_0x2369a6[_0xc000('0x6b')]=qs[_0xc000('0x48')](_0x4ca087[_0xc000('0x41')][_0xc000('0x48')]);_0x2369a6[_0xc000('0x4b')]=qs[_0xc000('0x42')](_[_0xc000('0x49')](_0x4ca087[_0xc000('0x41')],_0x48945c['filters']));_0x2369a6[_0xc000('0x4b')][_0xc000('0x61')]=_0x57e4d1['id'];if(_0x4ca087[_0xc000('0x41')][_0xc000('0x4a')]){_0x2369a6[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x2369a6[_0xc000('0x4b')],{'$or':_[_0xc000('0x3b')](_0x2369a6['attributes'],function(_0x207d0e){var _0x58af70={};_0x58af70[_0x207d0e]={'$like':'%'+_0x4ca087[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x58af70;})});}_0x2369a6=_[_0xc000('0x4c')]({},_0x2369a6,_0x4ca087[_0xc000('0x53')]);return db['SmsInteraction'][_0xc000('0x2c')]({'where':_0x2369a6[_0xc000('0x4b')]})[_0xc000('0x1d')](function(_0x259f34){_0x261853['count']=_0x259f34;if(_0x4ca087[_0xc000('0x41')][_0xc000('0x4d')]){_0x2369a6[_0xc000('0x4e')]=[{'model':db['CmContact'],'as':_0xc000('0xb8'),'required':![]},{'model':db[_0xc000('0xb9')],'as':_0xc000('0xba'),'attributes':['name',_0xc000('0xbb'),_0xc000('0xbc')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x4ca087[_0xc000('0x41')][_0xc000('0xbd')]?{'id':_0x4ca087['query'][_0xc000('0xbd')]}:undefined,'required':_0x4ca087[_0xc000('0x41')][_0xc000('0xbd')]?!![]:![]}];}return db[_0xc000('0x9c')][_0xc000('0x65')](_0x2369a6);})[_0xc000('0x1d')](function(_0x323d32){_0x261853[_0xc000('0x4f')]=_0x323d32;return _0x261853;});}})[_0xc000('0x1d')](respondWithFilteredResult(_0x5dce8a,_0x2369a6))[_0xc000('0x50')](handleError(_0x5dce8a,null));};exports[_0xc000('0x38')]=function(_0x1099db,_0x4bdae2,_0x1c559c){var _0xf6de55,_0x3e552d,_0x54f67a;if(_['isNil'](_0x1099db['body'][_0xc000('0x56')])||_0x1099db[_0xc000('0x56')][_0xc000('0x56')]===''){throw new db[(_0xc000('0x74'))][(_0xc000('0x90'))](_0xc000('0x92'));}if(_[_0xc000('0x8f')](_0x1099db['body']['to'])){throw new db[(_0xc000('0x74'))]['ValidationError'](_0xc000('0xbe'));}_0xf6de55=_0x1099db[_0xc000('0x56')]['to'];return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x1099db[_0xc000('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xc000('0xbf'),'include':[{'model':db[_0xc000('0x73')],'as':_0xc000('0x9a'),'where':{'mobile':_0xf6de55},'limit':0x1,'order':[[_0xc000('0x78'),_0xc000('0x97')]]}]}]})[_0xc000('0x1d')](handleEntityNotFound(_0x4bdae2,null))[_0xc000('0x1d')](function(_0x4dedad){if(_0x4dedad&&_0x4dedad[_0xc000('0xbf')]){_0x3e552d=_0x4dedad[_0xc000('0x58')]({'plain':!![]});if(_0x3e552d['List']&&_0x3e552d[_0xc000('0xbf')]['Contacts']['length']){return _0x3e552d[_0xc000('0xbf')][_0xc000('0x9a')][0x0];}return db[_0xc000('0x73')][_0xc000('0x55')](_[_0xc000('0x18')](_0x1099db[_0xc000('0x56')],{'firstName':_0xf6de55,'mobile':_0xf6de55,'phone':_0xf6de55,'ListId':_0x3e552d[_0xc000('0x7a')]}));}})[_0xc000('0x1d')](handleEntityNotFound(_0x4bdae2,null))[_0xc000('0x1d')](function(_0x11450a){if(_0x11450a){_0x54f67a=_0x11450a;return db[_0xc000('0x9c')][_0xc000('0x54')]({'where':{'ContactId':_0x54f67a['id'],'closed':![],'SmsAccountId':_0x3e552d['id']}})[_0xc000('0x1d')](function(_0x21c870){if(_0x21c870){return[_0x21c870,![]];}return db[_0xc000('0x9c')][_0xc000('0x55')]({'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id'],'SmsAccountId':_0x3e552d['id'],'phone':_0xf6de55,'firstMsgDirection':_0xc000('0xc0'),'Messages':[_[_0xc000('0x4c')](_0x1099db[_0xc000('0x56')],{'read':![],'body':_0x1099db['body'][_0xc000('0x56')],'phone':_0xf6de55,'SmsAccountId':_0x3e552d['id'],'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id']})]},{'include':[{'model':db[_0xc000('0xa5')],'as':_0xc000('0xc1')}]})[_0xc000('0x1d')](function(_0x25d5fb){return[_0x25d5fb,!![]];});});}})[_0xc000('0x9d')](function(_0x4bd0f9,_0x2c48e4){if(_0x2c48e4){return _0x4bd0f9;}return db[_0xc000('0xa5')]['create'](_[_0xc000('0x4c')](_0x1099db[_0xc000('0x56')],{'read':![],'body':_0x1099db[_0xc000('0x56')][_0xc000('0x56')],'phone':_0xf6de55,'SmsAccountId':_0x3e552d['id'],'SmsInteractionId':_0x4bd0f9['id'],'UserId':_0x1099db[_0xc000('0x57')]['id'],'ContactId':_0x54f67a['id']}))[_0xc000('0x1d')](function(_0x4f2ada){_0x4bd0f9['dataValues'][_0xc000('0xc1')]=[];_0x4bd0f9[_0xc000('0xc2')]['Messages'][_0xc000('0xa1')](_0x4f2ada[_0xc000('0xc2')]);return _0x4bd0f9;});})['then'](respondWithResult(_0x4bdae2,null))['catch'](handleError(_0x4bdae2,null));};exports[_0xc000('0x27')]=function(_0x4ce8c7,_0x333b37,_0x28a36b){if(_0x4ce8c7['body']['id']){delete _0x4ce8c7[_0xc000('0x56')]['id'];}var _0x3e306c,_0x16d8b4,_0x37bd49;return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x4ce8c7[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x333b37,null))[_0xc000('0x1d')](function(_0x49367b){if(_0x49367b){_0x37bd49=_0x49367b;logger['debug'](_0xc000('0x20'),_0xc000('0x27'),'received\x20delivery\x20report\x20from',_0x49367b[_0xc000('0x7b')],util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));switch(_0x49367b['type']){case _0xc000('0xc3'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc4')]&&_0x4ce8c7['body']['status']){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')]['status'];return db[_0xc000('0xa5')]['find']({'where':{'messageId':_0x4ce8c7['body'][_0xc000('0xc4')]}});}break;case _0xc000('0x81'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc5')]&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc6')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc6')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc5')]}});}break;case _0xc000('0x82'):if(_0x4ce8c7[_0xc000('0x56')][_0xc000('0x83')]&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0xc7')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')]['status_code'];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][_0xc000('0x83')]}});}break;case _0xc000('0x86'):var _0x413f9c=_0x4ce8c7['body'][_0xc000('0x87')][0x0];if(_0x413f9c['messageId']&&_0x413f9c[_0xc000('0x27')][_0xc000('0xc8')]===_0xc000('0xc9')){_0x16d8b4=_0x413f9c[_0xc000('0x27')][_0xc000('0xc8')];return db['SmsMessage'][_0xc000('0x54')]({'where':{'messageId':_0x413f9c[_0xc000('0x7e')]}});}break;case _0xc000('0x8a'):if(_0x4ce8c7[_0xc000('0x56')]['messageId']&&_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7['body']['messageId']}});}break;case'bandwidth':if(_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x24')]['id']){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x7b')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7[_0xc000('0x56')][0x0][_0xc000('0x24')]['id']}});}break;case _0xc000('0x8d'):if(_0x4ce8c7['body']['redif']&&_0x4ce8c7['body'][_0xc000('0x27')]){_0x16d8b4=_0x4ce8c7[_0xc000('0x56')][_0xc000('0x27')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x4ce8c7['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x333b37,null))[_0xc000('0x1d')](function(_0x140384){if(_0x140384){_0x3e306c=_0x140384;switch(_0x37bd49[_0xc000('0x7b')]){case _0xc000('0xc3'):if(_0x16d8b4===_0xc000('0xc9')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger['error'](_0xc000('0x20'),_0xc000('0x27'),'skebby',util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x16d8b4==='1'){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0xc3'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x82'):if(!_0x4ce8c7[_0xc000('0x56')][_0xc000('0xcb')]&&_0x16d8b4>=0xc8&&_0x16d8b4<=0xce){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc000('0x82'),util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xe42beb=_0x4ce8c7[_0xc000('0x56')]['results'][0x0];if(_0xe42beb[_0xc000('0x27')]['groupName']===_0xc000('0xc9')){return _0x3e306c['update']({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x86'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x8a'):if(_0x16d8b4=='DELIVERED_TO_GATEWAY'||_0x16d8b4==_0xc000('0xcc')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger['error'](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x8a'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0xcd'):if(_0x16d8b4==_0xc000('0xce')){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0xcd'),util[_0xc000('0xca')](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc000('0x8d'):if(_0x16d8b4===_0xc000('0xcf')||_0x16d8b4==='ACCEPTD'){return _0x3e306c[_0xc000('0x33')]({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),_0xc000('0x8d'),util['inspect'](_0x4ce8c7[_0xc000('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3e306c;}})[_0xc000('0x1d')](respondWithResult(_0x333b37,null))[_0xc000('0x50')](handleError(_0x333b37,null));};exports[_0xc000('0xd0')]=function(_0x53bab9,_0x46b93f,_0xd54e83){var _0x5733fe,_0x231348,_0x2cc4c4;return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x53bab9[_0xc000('0x5f')]['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x46b93f,null))['then'](function(_0x2f13e0){if(_0x2f13e0){_0x2cc4c4=_0x2f13e0;logger[_0xc000('0xac')](_0xc000('0x20'),_0xc000('0x27'),'received\x20delivery\x20report\x20from',_0x2f13e0['type'],util['inspect'](_0x53bab9[_0xc000('0x41')],{'showHidden':![],'depth':null}));switch(_0x2f13e0[_0xc000('0x7b')]){case _0xc000('0x88'):if(_0x53bab9[_0xc000('0x41')][_0xc000('0xd1')]&&_0x53bab9['query'][_0xc000('0xd2')]){_0x231348=_0x53bab9[_0xc000('0x41')][_0xc000('0xd2')];return db[_0xc000('0xa5')][_0xc000('0x54')]({'where':{'messageId':_0x53bab9[_0xc000('0x41')][_0xc000('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x46b93f,null))[_0xc000('0x1d')](function(_0x115a44){if(_0x115a44){_0x5733fe=_0x115a44;switch(_0x2cc4c4['type']){case _0xc000('0x88'):if(_0x231348==='2'||_0x231348==='6'){return _0x5733fe['update']({'read':!![]});}else{logger[_0xc000('0x22')](_0xc000('0x20'),_0xc000('0x27'),'csc',util[_0xc000('0xca')](_0x53bab9[_0xc000('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x5733fe;}})[_0xc000('0x1d')](respondWithResult(_0x46b93f,null))[_0xc000('0x50')](handleError(_0x46b93f,null));};exports[_0xc000('0xd3')]=function(_0x4fab58,_0x3d168b,_0x466e36){return db[_0xc000('0x3c')]['find']({'where':{'id':_0x4fab58['params']['id']}})['then'](handleEntityNotFound(_0x3d168b,null))[_0xc000('0x1d')](function(_0x4f7126){if(_0x4f7126){return _0x4f7126[_0xc000('0xd3')](_0x4fab58[_0xc000('0x56')][_0xc000('0x67')],_[_0xc000('0x99')](_0x4fab58[_0xc000('0x56')],[_0xc000('0x67'),'id'])||{})[_0xc000('0x9d')](function(_0x2fdc77){for(var _0x28ed5f=0x0;_0x28ed5f<_0x4fab58['body'][_0xc000('0x67')][_0xc000('0x45')];_0x28ed5f+=0x1){socket[_0xc000('0xd4')](_0xc000('0xd5'),{'UserId':Number(_0x4fab58[_0xc000('0x56')][_0xc000('0x67')][_0x28ed5f]),'SmsAccountId':Number(_0x4fab58[_0xc000('0x5f')]['id'])});}return _0x2fdc77;});}})[_0xc000('0x1d')](respondWithResult(_0x3d168b,null))[_0xc000('0x50')](handleError(_0x3d168b,null));};exports['removeAgents']=function(_0x29951e,_0x559279,_0x3e55c6){return db[_0xc000('0x3c')][_0xc000('0x54')]({'where':{'id':_0x29951e['params']['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x559279,null))[_0xc000('0x1d')](function(_0x154680){if(_0x154680){return _0x154680[_0xc000('0xd6')](_0x29951e[_0xc000('0x41')][_0xc000('0x67')])['then'](function(){if(_[_0xc000('0xd7')](_0x29951e[_0xc000('0x41')][_0xc000('0x67')])){for(var _0x56aa36=0x0;_0x56aa36<_0x29951e[_0xc000('0x41')][_0xc000('0x67')][_0xc000('0x45')];_0x56aa36+=0x1){socket['emit'](_0xc000('0xd8'),{'UserId':Number(_0x29951e[_0xc000('0x41')][_0xc000('0x67')][_0x56aa36]),'SmsAccountId':Number(_0x29951e[_0xc000('0x5f')]['id'])});}}else{socket['emit'](_0xc000('0xd8'),{'UserId':Number(_0x29951e[_0xc000('0x41')][_0xc000('0x67')]),'SmsAccountId':Number(_0x29951e['params']['id'])});}});}})[_0xc000('0x1d')](respondWithStatusCode(_0x559279,null))['catch'](handleError(_0x559279,null));};exports[_0xc000('0xd9')]=function(_0xd1fd6d,_0x2dc469,_0x279a2e){var _0x7e43eb={};var _0x2fc3d5={};var _0x42603b;var _0x330401;return db[_0xc000('0x3c')][_0xc000('0x64')]({'where':{'id':_0xd1fd6d['params']['id']}})[_0xc000('0x1d')](handleEntityNotFound(_0x2dc469,null))['then'](function(_0x51a766){if(_0x51a766){_0x42603b=_0x51a766;_0x2fc3d5[_0xc000('0x40')]=_['keys'](db[_0xc000('0xb9')][_0xc000('0x3d')]);_0x2fc3d5[_0xc000('0x41')]=_[_0xc000('0x51')](_0xd1fd6d[_0xc000('0x41')]);_0x2fc3d5[_0xc000('0x42')]=_[_0xc000('0x52')](_0x2fc3d5['model'],_0x2fc3d5[_0xc000('0x41')]);_0x7e43eb[_0xc000('0x43')]=_[_0xc000('0x52')](_0x2fc3d5[_0xc000('0x40')],qs[_0xc000('0x44')](_0xd1fd6d[_0xc000('0x41')]['fields']));_0x7e43eb[_0xc000('0x43')]=_0x7e43eb[_0xc000('0x43')][_0xc000('0x45')]?_0x7e43eb[_0xc000('0x43')]:_0x2fc3d5[_0xc000('0x40')];_0x7e43eb['order']=qs[_0xc000('0x48')](_0xd1fd6d[_0xc000('0x41')]['sort']);_0x7e43eb[_0xc000('0x4b')]=qs['filters'](_[_0xc000('0x49')](_0xd1fd6d[_0xc000('0x41')],_0x2fc3d5[_0xc000('0x42')]));if(_0xd1fd6d['query']['filter']){_0x7e43eb[_0xc000('0x4b')]=_[_0xc000('0x4c')](_0x7e43eb['where'],{'$or':_[_0xc000('0x3b')](_0x7e43eb[_0xc000('0x43')],function(_0x369cc8){var _0x3fd06d={};_0x3fd06d[_0x369cc8]={'$like':'%'+_0xd1fd6d[_0xc000('0x41')][_0xc000('0x4a')]+'%'};return _0x3fd06d;})});}_0x7e43eb=_[_0xc000('0x4c')]({},_0x7e43eb,_0xd1fd6d[_0xc000('0x53')]);return _0x42603b[_0xc000('0xd9')](_0x7e43eb);}})[_0xc000('0x1d')](function(_0xea26f4){if(_0xea26f4){_0x330401=_0xea26f4['length'];if(!_0xd1fd6d[_0xc000('0x41')][_0xc000('0x46')](_0xc000('0x47'))){_0x7e43eb[_0xc000('0x2d')]=qs['limit'](_0xd1fd6d[_0xc000('0x41')]['limit']);_0x7e43eb[_0xc000('0x2a')]=qs[_0xc000('0x2a')](_0xd1fd6d[_0xc000('0x41')][_0xc000('0x2a')]);}return _0x42603b[_0xc000('0xd9')](_0x7e43eb);}})[_0xc000('0x1d')](function(_0x2a9e3f){if(_0x2a9e3f){return _0x2a9e3f?{'count':_0x330401,'rows':_0x2a9e3f}:null;}})['then'](respondWithResult(_0x2dc469,null))[_0xc000('0x50')](handleError(_0x2dc469,null));}; \ No newline at end of file +var _0x7ddd=['push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','sort','filter','removeDispositions','ids','CannedAnswer','getAnswers','findOne','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','type','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','defaults','SmsInteraction','spread','interaction','created','autoclose','applications'];(function(_0x21f9c2,_0x2b3d2a){var _0x3da17f=function(_0x57e2b9){while(--_0x57e2b9){_0x21f9c2['push'](_0x21f9c2['shift']());}};_0x3da17f(++_0x2b3d2a);}(_0x7ddd,0x125));var _0xd7dd=function(_0x1bf6e4,_0x2932b4){_0x1bf6e4=_0x1bf6e4-0x0;var _0x4a4a01=_0x7ddd[_0x1bf6e4];return _0x4a4a01;};'use strict';var emlformat=require(_0xd7dd('0x0'));var rimraf=require(_0xd7dd('0x1'));var zipdir=require(_0xd7dd('0x2'));var jsonpatch=require(_0xd7dd('0x3'));var rp=require('request-promise');var moment=require(_0xd7dd('0x4'));var BPromise=require(_0xd7dd('0x5'));var Mustache=require(_0xd7dd('0x6'));var util=require(_0xd7dd('0x7'));var path=require(_0xd7dd('0x8'));var sox=require(_0xd7dd('0x9'));var csv=require(_0xd7dd('0xa'));var ejs=require(_0xd7dd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7dd('0xc'));var squel=require(_0xd7dd('0xd'));var crypto=require(_0xd7dd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd7dd('0xa'));var querystring=require(_0xd7dd('0xf'));var Papa=require(_0xd7dd('0x10'));var Redis=require(_0xd7dd('0x11'));var authService=require(_0xd7dd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd7dd('0x13'));var hardwareService=require(_0xd7dd('0x14'));var logger=require(_0xd7dd('0x15'))(_0xd7dd('0x16'));var utils=require(_0xd7dd('0x17'));var config=require(_0xd7dd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7dd('0x19'))['db'];config[_0xd7dd('0x1a')]=_['defaults'](config[_0xd7dd('0x1a')],{'host':_0xd7dd('0x1b'),'port':0x18eb});var socket=require(_0xd7dd('0x1c'))(new Redis(config[_0xd7dd('0x1a')]));require(_0xd7dd('0x1d'))['register'](socket);var jayson=require(_0xd7dd('0x1e'));var client=jayson['client'][_0xd7dd('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x83d1c0,_0x44bb9d,_0x12730a,_0x265a94){return new BPromise(function(_0x54e0d1,_0x19b364){var _0x4d1563=_0x265a94||client;return _0x4d1563['request'](_0x83d1c0,_0x12730a)['then'](function(_0x150b03){logger[_0xd7dd('0x20')](_0xd7dd('0x21'),_0x44bb9d,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x44bb9d,_0xd7dd('0x22'),JSON[_0xd7dd('0x23')](_0x150b03));if(_0x150b03['error']){if(_0x150b03[_0xd7dd('0x24')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x44bb9d,_0x150b03['error'][_0xd7dd('0x25')]);return _0x19b364(_0x150b03[_0xd7dd('0x24')][_0xd7dd('0x25')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x44bb9d,_0x150b03[_0xd7dd('0x24')][_0xd7dd('0x25')]);return _0x54e0d1(_0x150b03[_0xd7dd('0x24')]['message']);}else{logger[_0xd7dd('0x20')](_0xd7dd('0x21'),_0x44bb9d,_0xd7dd('0x22'));_0x54e0d1(_0x150b03[_0xd7dd('0x26')][_0xd7dd('0x25')]);}})['catch'](function(_0xf37a27){logger[_0xd7dd('0x24')]('SmsAccount,\x20%s,\x20%s',_0x44bb9d,_0xf37a27);_0x19b364(_0xf37a27);});});}function respondWithStatusCode(_0x3f8fc0,_0xfdf7de){_0xfdf7de=_0xfdf7de||0xcc;return function(_0xe05567){if(_0xe05567){return _0x3f8fc0[_0xd7dd('0x27')](_0xfdf7de);}return _0x3f8fc0[_0xd7dd('0x28')](_0xfdf7de)[_0xd7dd('0x29')]();};}function respondWithResult(_0x38a038,_0x38ddc9){_0x38ddc9=_0x38ddc9||0xc8;return function(_0x529c14){if(_0x529c14){return _0x38a038[_0xd7dd('0x28')](_0x38ddc9)[_0xd7dd('0x2a')](_0x529c14);}};}function respondWithFilteredResult(_0x287c49,_0x5b4000){return function(_0x3bf10d){if(_0x3bf10d){var _0x373177=typeof _0x5b4000['offset']==='undefined'&&typeof _0x5b4000[_0xd7dd('0x2b')]===_0xd7dd('0x2c');var _0x25e5b6=_0x3bf10d[_0xd7dd('0x2d')];var _0xcced4c=_0x373177?0x0:_0x5b4000['offset'];var _0x196d50=_0x373177?_0x3bf10d[_0xd7dd('0x2d')]:_0x5b4000['offset']+_0x5b4000[_0xd7dd('0x2b')];var _0x4b504a;if(_0x196d50>=_0x25e5b6){_0x196d50=_0x25e5b6;_0x4b504a=0xc8;}else{_0x4b504a=0xce;}_0x287c49[_0xd7dd('0x28')](_0x4b504a);return _0x287c49[_0xd7dd('0x2e')](_0xd7dd('0x2f'),_0xcced4c+'-'+_0x196d50+'/'+_0x25e5b6)[_0xd7dd('0x2a')](_0x3bf10d);}return null;};}function patchUpdates(_0x1719b7){return function(_0x38a55b){try{jsonpatch['apply'](_0x38a55b,_0x1719b7,!![]);}catch(_0x398885){return BPromise[_0xd7dd('0x30')](_0x398885);}return _0x38a55b['save']();};}function saveUpdates(_0x48c340,_0x3f79e6){return function(_0x28b967){if(_0x28b967){return _0x28b967[_0xd7dd('0x31')](_0x48c340)[_0xd7dd('0x32')](function(_0x34291c){return _0x34291c;});}return null;};}function removeEntity(_0x421a09,_0x5d4e4){return function(_0x2cae6a){if(_0x2cae6a){return _0x2cae6a[_0xd7dd('0x33')]()[_0xd7dd('0x32')](function(){var _0x2f43df=_0x2cae6a[_0xd7dd('0x34')]({'plain':!![]});var _0x15452b='SmsAccounts';return db[_0xd7dd('0x35')][_0xd7dd('0x33')]({'where':{'type':_0x15452b,'resourceId':_0x2f43df['id']}})[_0xd7dd('0x32')](function(){return _0x2cae6a;});})[_0xd7dd('0x32')](function(){_0x421a09[_0xd7dd('0x28')](0xcc)[_0xd7dd('0x29')]();});}};}function handleEntityNotFound(_0x297c02,_0x4c2b72){return function(_0x40dc78){if(!_0x40dc78){_0x297c02[_0xd7dd('0x27')](0x194);}return _0x40dc78;};}function handleError(_0xa7289c,_0x56f7f5){_0x56f7f5=_0x56f7f5||0x1f4;return function(_0x42f872){logger[_0xd7dd('0x24')](_0x42f872[_0xd7dd('0x36')]);if(_0x42f872[_0xd7dd('0x37')]){delete _0x42f872['name'];}_0xa7289c[_0xd7dd('0x28')](_0x56f7f5)['send'](_0x42f872);};}exports[_0xd7dd('0x38')]=function(_0x5aaf84,_0x36746b){var _0x505c6={'include':[{'model':db[_0xd7dd('0x39')],'as':_0xd7dd('0x3a')}]},_0x52f4d1={},_0xa462a={'count':0x0,'rows':[]};var _0xb30fc2=_[_0xd7dd('0x3b')](db[_0xd7dd('0x3c')][_0xd7dd('0x3d')],function(_0xa5584c){return{'name':_0xa5584c[_0xd7dd('0x3e')],'type':_0xa5584c['type'][_0xd7dd('0x3f')]};});_0x52f4d1[_0xd7dd('0x40')]=_[_0xd7dd('0x3b')](_0xb30fc2,_0xd7dd('0x37'));_0x52f4d1[_0xd7dd('0x41')]=_[_0xd7dd('0x42')](_0x5aaf84[_0xd7dd('0x41')]);_0x52f4d1['filters']=_[_0xd7dd('0x43')](_0x52f4d1['model'],_0x52f4d1[_0xd7dd('0x41')]);_0x505c6[_0xd7dd('0x44')]=_[_0xd7dd('0x43')](_0x52f4d1['model'],qs[_0xd7dd('0x45')](_0x5aaf84[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x505c6[_0xd7dd('0x44')]=_0x505c6['attributes'][_0xd7dd('0x46')]?_0x505c6[_0xd7dd('0x44')]:_0x52f4d1[_0xd7dd('0x40')];if(!_0x5aaf84['query'][_0xd7dd('0x47')](_0xd7dd('0x48'))){_0x505c6[_0xd7dd('0x2b')]=qs[_0xd7dd('0x2b')](_0x5aaf84['query']['limit']);_0x505c6[_0xd7dd('0x49')]=qs[_0xd7dd('0x49')](_0x5aaf84[_0xd7dd('0x41')][_0xd7dd('0x49')]);}_0x505c6[_0xd7dd('0x4a')]=qs['sort'](_0x5aaf84[_0xd7dd('0x41')]['sort']);_0x505c6['where']=qs[_0xd7dd('0x4b')](_[_0xd7dd('0x4c')](_0x5aaf84['query'],_0x52f4d1[_0xd7dd('0x4b')]),_0xb30fc2);if(_0x5aaf84['query']['filter']){_0x505c6[_0xd7dd('0x4d')]=_[_0xd7dd('0x4e')](_0x505c6['where'],{'$or':_[_0xd7dd('0x3b')](_0xb30fc2,function(_0x4beac2){if(_0x4beac2['type']!==_0xd7dd('0x4f')){var _0x4b12d4={};_0x4b12d4[_0x4beac2[_0xd7dd('0x37')]]={'$like':'%'+_0x5aaf84['query']['filter']+'%'};return _0x4b12d4;}})});}_0x505c6=_['merge']({},_0x505c6,_0x5aaf84[_0xd7dd('0x50')]);var _0x47e690={'where':_0x505c6[_0xd7dd('0x4d')]};return db[_0xd7dd('0x3c')][_0xd7dd('0x2d')](_0x47e690)[_0xd7dd('0x32')](function(_0x10af6c){_0xa462a[_0xd7dd('0x2d')]=_0x10af6c;if(_0x5aaf84[_0xd7dd('0x41')][_0xd7dd('0x51')]){_0x505c6[_0xd7dd('0x52')]=[{'all':!![]}];}return db[_0xd7dd('0x3c')][_0xd7dd('0x53')](_0x505c6);})[_0xd7dd('0x32')](function(_0x6e8c0a){_0xa462a[_0xd7dd('0x54')]=_0x6e8c0a;return _0xa462a;})[_0xd7dd('0x32')](respondWithFilteredResult(_0x36746b,_0x505c6))['catch'](handleError(_0x36746b,null));};exports[_0xd7dd('0x55')]=function(_0x46acb1,_0x125a18){var _0x1167ef={'raw':![],'where':{'id':_0x46acb1[_0xd7dd('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xd7dd('0x3a')}]},_0x246150={};_0x246150[_0xd7dd('0x40')]=_[_0xd7dd('0x42')](db['SmsAccount'][_0xd7dd('0x3d')]);_0x246150[_0xd7dd('0x41')]=_[_0xd7dd('0x42')](_0x46acb1[_0xd7dd('0x41')]);_0x246150[_0xd7dd('0x4b')]=_[_0xd7dd('0x43')](_0x246150[_0xd7dd('0x40')],_0x246150[_0xd7dd('0x41')]);_0x1167ef[_0xd7dd('0x44')]=_[_0xd7dd('0x43')](_0x246150[_0xd7dd('0x40')],qs['fields'](_0x46acb1[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x1167ef[_0xd7dd('0x44')]=_0x1167ef[_0xd7dd('0x44')][_0xd7dd('0x46')]?_0x1167ef[_0xd7dd('0x44')]:_0x246150[_0xd7dd('0x40')];if(_0x46acb1['query'][_0xd7dd('0x51')]){_0x1167ef['include']=[{'all':!![]}];}_0x1167ef=_[_0xd7dd('0x4e')]({},_0x1167ef,_0x46acb1[_0xd7dd('0x50')]);return db[_0xd7dd('0x3c')][_0xd7dd('0x57')](_0x1167ef)[_0xd7dd('0x32')](handleEntityNotFound(_0x125a18,null))['then'](respondWithResult(_0x125a18,null))[_0xd7dd('0x58')](handleError(_0x125a18,null));};exports['create']=function(_0x1d7e8b,_0x4f400b){return db[_0xd7dd('0x3c')][_0xd7dd('0x59')](_0x1d7e8b[_0xd7dd('0x5a')],{})[_0xd7dd('0x32')](function(_0x2b7a9d){var _0xba5706=_0x1d7e8b[_0xd7dd('0x5b')]['get']({'plain':!![]});if(!_0xba5706)throw new Error(_0xd7dd('0x5c'));if(_0xba5706[_0xd7dd('0x5d')]===_0xd7dd('0x5b')){var _0x28553b=_0x2b7a9d[_0xd7dd('0x34')]({'plain':!![]});var _0x728868=_0xd7dd('0x5e');return db[_0xd7dd('0x5f')][_0xd7dd('0x57')]({'where':{'name':_0x728868,'userProfileId':_0xba5706['userProfileId']},'raw':!![]})[_0xd7dd('0x32')](function(_0x539888){if(_0x539888&&_0x539888[_0xd7dd('0x60')]===0x0){return db[_0xd7dd('0x35')][_0xd7dd('0x59')]({'name':_0x28553b[_0xd7dd('0x37')],'resourceId':_0x28553b['id'],'type':_0x539888[_0xd7dd('0x37')],'sectionId':_0x539888['id']},{})[_0xd7dd('0x32')](function(){return _0x2b7a9d;});}else{return _0x2b7a9d;}})['catch'](function(_0x93f7d5){logger[_0xd7dd('0x24')](_0xd7dd('0x61'),_0x93f7d5);throw _0x93f7d5;});}return _0x2b7a9d;})[_0xd7dd('0x32')](respondWithResult(_0x4f400b,0xc9))[_0xd7dd('0x58')](handleError(_0x4f400b,null));};exports[_0xd7dd('0x31')]=function(_0x3d7c59,_0x13a4d6){if(_0x3d7c59[_0xd7dd('0x5a')]['id']){delete _0x3d7c59[_0xd7dd('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x3d7c59[_0xd7dd('0x56')]['id']},'include':[{'model':db[_0xd7dd('0x39')],'as':_0xd7dd('0x3a')}]})[_0xd7dd('0x32')](handleEntityNotFound(_0x13a4d6,null))[_0xd7dd('0x32')](saveUpdates(_0x3d7c59[_0xd7dd('0x5a')],null))[_0xd7dd('0x32')](respondWithResult(_0x13a4d6,null))['catch'](handleError(_0x13a4d6,null));};exports[_0xd7dd('0x33')]=function(_0x4ee669,_0x6ec06a){return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x4ee669[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x6ec06a,null))[_0xd7dd('0x32')](removeEntity(_0x6ec06a,null))[_0xd7dd('0x58')](handleError(_0x6ec06a,null));};exports[_0xd7dd('0x62')]=function(_0x4177da,_0x4ed958){return db['SmsAccount'][_0xd7dd('0x62')]()[_0xd7dd('0x32')](respondWithResult(_0x4ed958,null))['catch'](handleError(_0x4ed958,null));};exports['addDisposition']=function(_0x36e3e6,_0x13c28f,_0x1d26ac){if(_0x36e3e6[_0xd7dd('0x5a')]['id']){delete _0x36e3e6[_0xd7dd('0x5a')]['id'];}return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x36e3e6[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x13c28f,null))[_0xd7dd('0x32')](function(_0x294ee6){if(_0x294ee6){_0x36e3e6[_0xd7dd('0x5a')][_0xd7dd('0x63')]=_0x294ee6['id'];return db[_0xd7dd('0x64')][_0xd7dd('0x59')](_0x36e3e6[_0xd7dd('0x5a')]);}})[_0xd7dd('0x32')](respondWithResult(_0x13c28f,null))[_0xd7dd('0x58')](handleError(_0x13c28f,null));};exports[_0xd7dd('0x65')]=function(_0x4f912b,_0x64ef09,_0x4f0125){var _0x28c5b0={'raw':![],'where':{}};var _0x1e399f={};var _0x2bd8a6={'count':0x0,'rows':[]};return db[_0xd7dd('0x3c')]['findOne']({'where':{'id':_0x4f912b['params']['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x64ef09,null))[_0xd7dd('0x32')](function(_0x5d4654){if(_0x5d4654){_0x1e399f[_0xd7dd('0x40')]=_['keys'](db[_0xd7dd('0x64')][_0xd7dd('0x3d')]);_0x1e399f['query']=_[_0xd7dd('0x42')](_0x4f912b[_0xd7dd('0x41')]);_0x1e399f[_0xd7dd('0x4b')]=_[_0xd7dd('0x43')](_0x1e399f[_0xd7dd('0x40')],_0x1e399f[_0xd7dd('0x41')]);_0x28c5b0[_0xd7dd('0x44')]=_[_0xd7dd('0x43')](_0x1e399f['model'],qs[_0xd7dd('0x45')](_0x4f912b[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x28c5b0['attributes']=_0x28c5b0[_0xd7dd('0x44')]['length']?_0x28c5b0[_0xd7dd('0x44')]:_0x1e399f[_0xd7dd('0x40')];if(!_0x4f912b[_0xd7dd('0x41')][_0xd7dd('0x47')](_0xd7dd('0x48'))){_0x28c5b0[_0xd7dd('0x2b')]=qs[_0xd7dd('0x2b')](_0x4f912b[_0xd7dd('0x41')]['limit']);_0x28c5b0['offset']=qs['offset'](_0x4f912b['query'][_0xd7dd('0x49')]);}_0x28c5b0[_0xd7dd('0x4a')]=qs[_0xd7dd('0x66')](_0x4f912b['query'][_0xd7dd('0x66')]);_0x28c5b0[_0xd7dd('0x4d')]=qs[_0xd7dd('0x4b')](_[_0xd7dd('0x4c')](_0x4f912b[_0xd7dd('0x41')],_0x1e399f[_0xd7dd('0x4b')]));_0x28c5b0['where'][_0xd7dd('0x63')]=_0x5d4654['id'];if(_0x4f912b[_0xd7dd('0x41')][_0xd7dd('0x67')]){_0x28c5b0[_0xd7dd('0x4d')]=_['merge'](_0x28c5b0[_0xd7dd('0x4d')],{'$or':_[_0xd7dd('0x3b')](_0x28c5b0['attributes'],function(_0x67eabe){var _0x32d62b={};_0x32d62b[_0x67eabe]={'$like':'%'+_0x4f912b[_0xd7dd('0x41')][_0xd7dd('0x67')]+'%'};return _0x32d62b;})});}_0x28c5b0=_[_0xd7dd('0x4e')]({},_0x28c5b0,_0x4f912b[_0xd7dd('0x50')]);return db[_0xd7dd('0x64')][_0xd7dd('0x2d')]({'where':_0x28c5b0[_0xd7dd('0x4d')]})['then'](function(_0x2c8cf1){_0x2bd8a6[_0xd7dd('0x2d')]=_0x2c8cf1;if(_0x4f912b[_0xd7dd('0x41')][_0xd7dd('0x51')]){_0x28c5b0['include']=[{'all':!![]}];}return db[_0xd7dd('0x64')]['findAll'](_0x28c5b0);})['then'](function(_0x40d7d0){_0x2bd8a6[_0xd7dd('0x54')]=_0x40d7d0;return _0x2bd8a6;});}})[_0xd7dd('0x32')](respondWithFilteredResult(_0x64ef09,_0x28c5b0))[_0xd7dd('0x58')](handleError(_0x64ef09,null));};exports[_0xd7dd('0x68')]=function(_0x2ffe5d,_0x53f63c,_0x501e28){return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x2ffe5d[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x53f63c,null))[_0xd7dd('0x32')](function(_0x5c745d){if(_0x5c745d){return _0x5c745d[_0xd7dd('0x68')](_0x2ffe5d[_0xd7dd('0x41')][_0xd7dd('0x69')]);}})[_0xd7dd('0x32')](respondWithStatusCode(_0x53f63c,null))['catch'](handleError(_0x53f63c,null));};exports['addAnswer']=function(_0x115bf8,_0x381854,_0x5f430d){if(_0x115bf8[_0xd7dd('0x5a')]['id']){delete _0x115bf8[_0xd7dd('0x5a')]['id'];}return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x115bf8[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x381854,null))[_0xd7dd('0x32')](function(_0x333672){if(_0x333672){_0x115bf8[_0xd7dd('0x5a')][_0xd7dd('0x63')]=_0x333672['id'];return db[_0xd7dd('0x6a')][_0xd7dd('0x59')](_0x115bf8['body']);}})['then'](respondWithResult(_0x381854,null))[_0xd7dd('0x58')](handleError(_0x381854,null));};exports[_0xd7dd('0x6b')]=function(_0x1a6fc8,_0x41728b,_0x5af942){var _0x36ea33={'raw':![],'where':{}};var _0x402e02={};var _0x2ed60a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xd7dd('0x6c')]({'where':{'id':_0x1a6fc8[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x41728b,null))[_0xd7dd('0x32')](function(_0x41b570){if(_0x41b570){_0x402e02['model']=_['keys'](db[_0xd7dd('0x6a')][_0xd7dd('0x3d')]);_0x402e02['query']=_[_0xd7dd('0x42')](_0x1a6fc8[_0xd7dd('0x41')]);_0x402e02[_0xd7dd('0x4b')]=_['intersection'](_0x402e02['model'],_0x402e02[_0xd7dd('0x41')]);_0x36ea33['attributes']=_[_0xd7dd('0x43')](_0x402e02[_0xd7dd('0x40')],qs['fields'](_0x1a6fc8[_0xd7dd('0x41')]['fields']));_0x36ea33[_0xd7dd('0x44')]=_0x36ea33['attributes'][_0xd7dd('0x46')]?_0x36ea33['attributes']:_0x402e02[_0xd7dd('0x40')];if(!_0x1a6fc8[_0xd7dd('0x41')][_0xd7dd('0x47')](_0xd7dd('0x48'))){_0x36ea33[_0xd7dd('0x2b')]=qs[_0xd7dd('0x2b')](_0x1a6fc8[_0xd7dd('0x41')][_0xd7dd('0x2b')]);_0x36ea33['offset']=qs[_0xd7dd('0x49')](_0x1a6fc8[_0xd7dd('0x41')][_0xd7dd('0x49')]);}_0x36ea33[_0xd7dd('0x4a')]=qs[_0xd7dd('0x66')](_0x1a6fc8[_0xd7dd('0x41')]['sort']);_0x36ea33[_0xd7dd('0x4d')]=qs[_0xd7dd('0x4b')](_[_0xd7dd('0x4c')](_0x1a6fc8[_0xd7dd('0x41')],_0x402e02[_0xd7dd('0x4b')]));_0x36ea33['where'][_0xd7dd('0x63')]=_0x41b570['id'];if(_0x1a6fc8[_0xd7dd('0x41')]['filter']){_0x36ea33[_0xd7dd('0x4d')]=_[_0xd7dd('0x4e')](_0x36ea33[_0xd7dd('0x4d')],{'$or':_[_0xd7dd('0x3b')](_0x36ea33[_0xd7dd('0x44')],function(_0x17aba7){var _0x48e9f0={};_0x48e9f0[_0x17aba7]={'$like':'%'+_0x1a6fc8[_0xd7dd('0x41')][_0xd7dd('0x67')]+'%'};return _0x48e9f0;})});}_0x36ea33=_[_0xd7dd('0x4e')]({},_0x36ea33,_0x1a6fc8[_0xd7dd('0x50')]);return db[_0xd7dd('0x6a')][_0xd7dd('0x2d')]({'where':_0x36ea33[_0xd7dd('0x4d')]})['then'](function(_0x5dd71d){_0x2ed60a[_0xd7dd('0x2d')]=_0x5dd71d;if(_0x1a6fc8[_0xd7dd('0x41')][_0xd7dd('0x51')]){_0x36ea33['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xd7dd('0x53')](_0x36ea33);})[_0xd7dd('0x32')](function(_0x28ee23){_0x2ed60a['rows']=_0x28ee23;return _0x2ed60a;});}})[_0xd7dd('0x32')](respondWithFilteredResult(_0x41728b,_0x36ea33))[_0xd7dd('0x58')](handleError(_0x41728b,null));};exports['removeAnswers']=function(_0x193347,_0x3326f6,_0x45a9b8){return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x193347[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x3326f6,null))[_0xd7dd('0x32')](function(_0xd89c1c){if(_0xd89c1c){return _0xd89c1c['removeAnswers'](_0x193347[_0xd7dd('0x41')][_0xd7dd('0x69')]);}})['then'](respondWithStatusCode(_0x3326f6,null))[_0xd7dd('0x58')](handleError(_0x3326f6,null));};exports[_0xd7dd('0x6d')]=function(_0x5ec889,_0x426e17,_0x30545e){var _0x3e8cab={'channel':_0xd7dd('0x6e')};var _0x371395=[];var _0x473d52=[];var _0x4d6810={};return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x5ec889[_0xd7dd('0x56')]['id']},'include':[{'model':db[_0xd7dd('0x6f')],'as':_0xd7dd('0x70')}]})[_0xd7dd('0x32')](handleEntityNotFound(_0x426e17,null))[_0xd7dd('0x32')](function(_0x2af43a){_0x3e8cab[_0xd7dd('0x71')]=_0x2af43a;_0x3e8cab['applications']=_[_0xd7dd('0x72')](_0x2af43a['Applications'],[_0xd7dd('0x73')],[_0xd7dd('0x74')]);if(_0x3e8cab[_0xd7dd('0x71')]['Applications']){delete _0x3e8cab[_0xd7dd('0x71')]['Applications'];}return db[_0xd7dd('0x75')][_0xd7dd('0x62')]();})[_0xd7dd('0x32')](function(_0x550f34){if(!_0x550f34){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x78'));}_0x371395=_[_0xd7dd('0x79')](_[_0xd7dd('0x42')](_0x550f34),[_0xd7dd('0x7a'),_0xd7dd('0x7b')]);_0x473d52=_[_0xd7dd('0x79')](_['keys'](_0x550f34),[_0xd7dd('0x7a'),_0xd7dd('0x7b'),_0xd7dd('0x7c'),'ListId']);_0x3e8cab['body']={'mapKey':'mobile'};if(_0x3e8cab[_0xd7dd('0x71')][_0xd7dd('0x7d')]){switch(_0x3e8cab[_0xd7dd('0x71')]['type']){case _0xd7dd('0x7e'):_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x80')];_0x3e8cab[_0xd7dd('0x5a')]['body']=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x81')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x83')];break;case _0xd7dd('0x84'):_0x3e8cab['body'][_0xd7dd('0x7f')]='+'+_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x85')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x86')];break;case _0xd7dd('0x87'):_0x3e8cab['body']['from']=_0x5ec889['body'][_0xd7dd('0x7f')];_0x3e8cab[_0xd7dd('0x5a')]['body']=_0x5ec889['body'][_0xd7dd('0x25')];break;case _0xd7dd('0x88'):_0x3e8cab[_0xd7dd('0x5a')]['from']=_0x5ec889['body'][_0xd7dd('0x7f')];_0x3e8cab['body'][_0xd7dd('0x5a')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x5a')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')]=_0x5ec889['body'][_0xd7dd('0x89')];break;case'plivo':_0x3e8cab[_0xd7dd('0x5a')]['from']=_0x5ec889[_0xd7dd('0x5a')]['From'];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x8a')];_0x3e8cab[_0xd7dd('0x5a')]['messageId']=_0x5ec889['body']['MessageUUID'];break;case _0xd7dd('0x8b'):_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')]='+'+_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x8c')][0x0]['from'];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x8c')][0x0][_0xd7dd('0x86')];_0x3e8cab['body']['messageId']=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x8c')][0x0][_0xd7dd('0x82')];break;case _0xd7dd('0x8d'):_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x8e')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')]=_0x5ec889['body'][_0xd7dd('0x8f')][_0xd7dd('0x25')];break;case _0xd7dd('0x90'):_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x91')];_0x3e8cab[_0xd7dd('0x5a')]['body']=_0x5ec889['body'][_0xd7dd('0x86')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')]=_0x5ec889['body'][_0xd7dd('0x92')];break;case'bandwidth':_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')]=_0x5ec889[_0xd7dd('0x5a')][0x0][_0xd7dd('0x25')]['id'];_0x3e8cab[_0xd7dd('0x5a')]['from']=_0x5ec889[_0xd7dd('0x5a')][0x0][_0xd7dd('0x25')][_0xd7dd('0x7f')];_0x3e8cab['body'][_0xd7dd('0x5a')]=_0x5ec889[_0xd7dd('0x5a')][0x0][_0xd7dd('0x25')]['text'];break;case _0xd7dd('0x93'):_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')]=_0x5ec889['body'][_0xd7dd('0x7f')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')]=_0x5ec889['body'][_0xd7dd('0x25')];_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')]=_0x5ec889[_0xd7dd('0x5a')][_0xd7dd('0x94')];break;}}if(_0x3e8cab[_0xd7dd('0x5a')]['id']){delete _0x3e8cab['body']['id'];}if(_[_0xd7dd('0x95')](_0x3e8cab[_0xd7dd('0x5a')]['from'])){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x96'));}if(_[_0xd7dd('0x95')](_0x3e8cab['body'][_0xd7dd('0x5a')])||_0x3e8cab[_0xd7dd('0x5a')]['body']===''){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x97'));}if(_[_0xd7dd('0x95')](_0x3e8cab['body'][_0xd7dd('0x98')])){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x99')+_0x473d52);}if(!_[_0xd7dd('0x9a')](_0x473d52,_0x3e8cab['body'][_0xd7dd('0x98')])){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x9b')+_0x473d52);}_0x4d6810[_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x98')]]=_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x7f')];return db[_0xd7dd('0x9c')][_0xd7dd('0x57')]({'where':{'id':_0x3e8cab['account'][_0xd7dd('0x9d')]},'include':[{'model':db['CmContact'],'as':_0xd7dd('0x9e'),'where':_0x4d6810,'limit':0x1,'order':[[_0xd7dd('0x7b'),_0xd7dd('0x9f')]]}]});})[_0xd7dd('0x32')](handleEntityNotFound(_0x426e17,null))['then'](function(_0x589323){if(_0x589323){_0x3e8cab[_0xd7dd('0xa0')]=_[_0xd7dd('0xa1')](_0x589323,[_0xd7dd('0x9e')]);if(_0x589323[_0xd7dd('0x9e')][_0xd7dd('0x46')]){return _0x589323[_0xd7dd('0x9e')][0x0];}var _0x578e8a=_[_0xd7dd('0xa2')](_0x3e8cab['body'],{'firstName':_0x3e8cab['body'][_0xd7dd('0x7f')],'ListId':_0x589323['id']});_0x578e8a[_0x3e8cab['body'][_0xd7dd('0x98')]]=_0x3e8cab['body'][_0xd7dd('0x7f')];return db['CmContact'][_0xd7dd('0x59')](_0x578e8a,{'fields':_0x371395,'raw':!![]});}})[_0xd7dd('0x32')](handleEntityNotFound(_0x426e17,null))[_0xd7dd('0x32')](function(_0x24de3f){if(_0x24de3f){_0x3e8cab['contact']=_0x24de3f;var _0x35e598={'ContactId':_0x24de3f['id'],'phone':_0x3e8cab[_0xd7dd('0x5a')]['from'],'SmsAccountId':_0x5ec889['params']['id']};var _0x384df6={'ContactId':_0x24de3f['id'],'SmsAccountId':_0x5ec889[_0xd7dd('0x56')]['id'],'closed':![]};return db[_0xd7dd('0xa3')][_0xd7dd('0x57')]({'where':_0x384df6})[_0xd7dd('0x32')](function(_0x87a120){if(_0x87a120){return[_0x87a120,![]];}return db[_0xd7dd('0xa3')]['create'](_0x35e598)['then'](function(_0xd0fd45){return[_0xd0fd45,!![]];});});}})[_0xd7dd('0xa4')](function(_0x136652,_0x553151){_0x3e8cab[_0xd7dd('0xa5')]=_0x136652[_0xd7dd('0x34')]({'plain':!![]});_0x3e8cab['interaction'][_0xd7dd('0xa6')]=![];if(_0x553151){if(_0x3e8cab[_0xd7dd('0x71')][_0xd7dd('0xa7')]){_0x3e8cab[_0xd7dd('0xa8')][_0xd7dd('0xa9')]({'id':0x0,'priority':_0x3e8cab[_0xd7dd('0xa8')]['length']+0x1,'app':_0xd7dd('0xaa'),'appdata':'unmanaged','interval':_0xd7dd('0xab')});}_0x3e8cab['interaction'][_0xd7dd('0xa6')]=!![];}return db[_0xd7dd('0xac')][_0xd7dd('0x59')]({'phone':_0x3e8cab[_0xd7dd('0x5a')]['from'],'messageId':_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x82')],'body':_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0x5a')],'SmsAccountId':_0x5ec889[_0xd7dd('0x56')]['id'],'SmsInteractionId':_0x136652['id'],'direction':'in','ContactId':_0x136652[_0xd7dd('0xad')],'AttachmentId':_0x3e8cab[_0xd7dd('0x5a')][_0xd7dd('0xae')]});})[_0xd7dd('0x32')](function(_0x596a2f){_0x3e8cab['message']=_0x596a2f;if(_0x3e8cab[_0xd7dd('0xa5')][_0xd7dd('0xaf')]){return db[_0xd7dd('0xb0')]['find']({'attributes':['id','name'],'where':{'id':_0x3e8cab[_0xd7dd('0xa5')][_0xd7dd('0xaf')]}})['then'](function(_0x4b1c53){if(_0x4b1c53){_0x3e8cab[_0xd7dd('0xa8')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd7dd('0xb1'),'appdata':_0x4b1c53[_0xd7dd('0x37')]+','+(_0x3e8cab[_0xd7dd('0x71')][_0xd7dd('0xb2')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd7dd('0xb3'),_0xd7dd('0xb4'),_0x3e8cab);});}return respondWithRpcPromise(_0xd7dd('0xb3'),_0xd7dd('0xb4'),_0x3e8cab);})[_0xd7dd('0x32')](function(_0x283ec4){if(_0x283ec4){var _0x36b098=0xc8;var _0x372ffa=_0xd7dd('0xb5');logger[_0xd7dd('0x20')](_0xd7dd('0xb6'),_0x372ffa,_0x36b098,_0xd7dd('0xb7'));logger[_0xd7dd('0xb8')](_0xd7dd('0xb9'),_0x372ffa,_0x36b098,'entity\x20found',JSON['stringify'](_0x283ec4));if(_0x3e8cab[_0xd7dd('0x71')][_0xd7dd('0x7d')]==='twilio'){return _0x426e17[_0xd7dd('0x28')](_0x36b098)[_0xd7dd('0x2e')](_0xd7dd('0xba'),_0xd7dd('0xbb'))[_0xd7dd('0xbc')]('\x0a');}else{return _0x426e17[_0xd7dd('0x28')](_0x36b098)[_0xd7dd('0x2a')](_0x283ec4);}}})[_0xd7dd('0x58')](handleError(_0x426e17,null));};exports[_0xd7dd('0xbd')]=function(_0x3f533b,_0x4c9332,_0x4d0925){return db['SmsAccount'][_0xd7dd('0x6c')]({'where':{'id':_0x3f533b['params']['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x4c9332,null))[_0xd7dd('0x32')](function(_0x321c31){if(_0x321c31){return db[_0xd7dd('0xbe')][_0xd7dd('0xbf')](function(_0x345e3f){return db['SmsApplication'][_0xd7dd('0x33')]({'where':{'SmsAccountId':_0x3f533b['params']['id']},'transaction':_0x345e3f})[_0xd7dd('0x32')](function(_0x103267){var _0x593c2e=_[_0xd7dd('0x3b')](_0x3f533b[_0xd7dd('0x5a')],function(_0x5e5f39){_0x5e5f39[_0xd7dd('0x63')]=_0x3f533b[_0xd7dd('0x56')]['id'];return _0x5e5f39;});return db['SmsApplication'][_0xd7dd('0xc0')](_0x593c2e,{'transaction':_0x345e3f});});})['then'](function(){return db[_0xd7dd('0x6f')][_0xd7dd('0xc1')]({'where':{'SmsAccountId':_0x3f533b[_0xd7dd('0x56')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4c9332,null))[_0xd7dd('0x58')](handleError(_0x4c9332,null));};exports['getApplications']=function(_0x256092,_0x145a40,_0x235cfe){var _0x4f4d86={};var _0x361b5a={};var _0xc5a11f;var _0x2c402d;return db['SmsAccount']['findOne']({'where':{'id':_0x256092[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x145a40,null))[_0xd7dd('0x32')](function(_0x40de4b){if(_0x40de4b){_0xc5a11f=_0x40de4b;_0x361b5a[_0xd7dd('0x40')]=_['keys'](db[_0xd7dd('0x6f')][_0xd7dd('0x3d')]);_0x361b5a[_0xd7dd('0x41')]=_[_0xd7dd('0x42')](_0x256092[_0xd7dd('0x41')]);_0x361b5a[_0xd7dd('0x4b')]=_[_0xd7dd('0x43')](_0x361b5a[_0xd7dd('0x40')],_0x361b5a['query']);_0x4f4d86[_0xd7dd('0x44')]=_[_0xd7dd('0x43')](_0x361b5a['model'],qs[_0xd7dd('0x45')](_0x256092[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x4f4d86[_0xd7dd('0x44')]=_0x4f4d86[_0xd7dd('0x44')][_0xd7dd('0x46')]?_0x4f4d86[_0xd7dd('0x44')]:_0x361b5a['model'];_0x4f4d86[_0xd7dd('0x4a')]=qs[_0xd7dd('0x66')](_0x256092[_0xd7dd('0x41')][_0xd7dd('0x66')]);_0x4f4d86['where']=qs[_0xd7dd('0x4b')](_[_0xd7dd('0x4c')](_0x256092[_0xd7dd('0x41')],_0x361b5a[_0xd7dd('0x4b')]));if(_0x256092[_0xd7dd('0x41')]['filter']){_0x4f4d86[_0xd7dd('0x4d')]=_['merge'](_0x4f4d86[_0xd7dd('0x4d')],{'$or':_[_0xd7dd('0x3b')](_0x4f4d86[_0xd7dd('0x44')],function(_0x473475){var _0x5582e0={};_0x5582e0[_0x473475]={'$like':'%'+_0x256092[_0xd7dd('0x41')][_0xd7dd('0x67')]+'%'};return _0x5582e0;})});}_0x4f4d86=_[_0xd7dd('0x4e')]({},_0x4f4d86,_0x256092['options']);return _0xc5a11f['getApplications'](_0x4f4d86);}})[_0xd7dd('0x32')](function(_0xec5235){if(_0xec5235){_0x2c402d=_0xec5235[_0xd7dd('0x46')];if(!_0x256092['query']['hasOwnProperty'](_0xd7dd('0x48'))){_0x4f4d86['limit']=qs['limit'](_0x256092['query'][_0xd7dd('0x2b')]);_0x4f4d86[_0xd7dd('0x49')]=qs['offset'](_0x256092[_0xd7dd('0x41')][_0xd7dd('0x49')]);}return _0xc5a11f[_0xd7dd('0xc2')](_0x4f4d86);}})[_0xd7dd('0x32')](function(_0x2390ff){if(_0x2390ff){return _0x2390ff?{'count':_0x2c402d,'rows':_0x2390ff}:null;}})[_0xd7dd('0x32')](respondWithResult(_0x145a40,null))[_0xd7dd('0x58')](handleError(_0x145a40,null));};exports['getInteractions']=function(_0xe26fb3,_0x42ed2c,_0x5b5c56){var _0x3be39b={'raw':![],'where':{}};var _0x3dba5c={};var _0x516978={'count':0x0,'rows':[]};return db[_0xd7dd('0x3c')][_0xd7dd('0x6c')]({'where':{'id':_0xe26fb3['params']['id']}})['then'](handleEntityNotFound(_0x42ed2c,null))[_0xd7dd('0x32')](function(_0x9100bd){if(_0x9100bd){_0x3dba5c['model']=_['keys'](db[_0xd7dd('0xa3')][_0xd7dd('0x3d')]);_0x3dba5c['query']=_[_0xd7dd('0x42')](_0xe26fb3[_0xd7dd('0x41')]);_0x3dba5c[_0xd7dd('0x4b')]=_['intersection'](_0x3dba5c[_0xd7dd('0x40')],_0x3dba5c[_0xd7dd('0x41')]);_0x3be39b[_0xd7dd('0x44')]=_['intersection'](_0x3dba5c['model'],qs[_0xd7dd('0x45')](_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x3be39b['attributes']=_0x3be39b['attributes'][_0xd7dd('0x46')]?_0x3be39b['attributes']:_0x3dba5c[_0xd7dd('0x40')];if(!_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0x47')](_0xd7dd('0x48'))){_0x3be39b[_0xd7dd('0x2b')]=qs[_0xd7dd('0x2b')](_0xe26fb3['query'][_0xd7dd('0x2b')]);_0x3be39b[_0xd7dd('0x49')]=qs[_0xd7dd('0x49')](_0xe26fb3['query'][_0xd7dd('0x49')]);}_0x3be39b[_0xd7dd('0x4a')]=qs[_0xd7dd('0x66')](_0xe26fb3['query'][_0xd7dd('0x66')]);_0x3be39b['where']=qs[_0xd7dd('0x4b')](_[_0xd7dd('0x4c')](_0xe26fb3['query'],_0x3dba5c['filters']));_0x3be39b[_0xd7dd('0x4d')]['SmsAccountId']=_0x9100bd['id'];if(_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0x67')]){_0x3be39b['where']=_['merge'](_0x3be39b[_0xd7dd('0x4d')],{'$or':_[_0xd7dd('0x3b')](_0x3be39b[_0xd7dd('0x44')],function(_0x25304d){var _0x53d6a7={};_0x53d6a7[_0x25304d]={'$like':'%'+_0xe26fb3['query'][_0xd7dd('0x67')]+'%'};return _0x53d6a7;})});}_0x3be39b=_['merge']({},_0x3be39b,_0xe26fb3['options']);return db[_0xd7dd('0xa3')][_0xd7dd('0x2d')]({'where':_0x3be39b[_0xd7dd('0x4d')]})[_0xd7dd('0x32')](function(_0x1ed677){_0x516978[_0xd7dd('0x2d')]=_0x1ed677;if(_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0x51')]){_0x3be39b[_0xd7dd('0x52')]=[{'model':db[_0xd7dd('0x75')],'as':_0xd7dd('0xc3'),'required':![]},{'model':db[_0xd7dd('0xb0')],'as':_0xd7dd('0xc4'),'attributes':[_0xd7dd('0x37'),_0xd7dd('0xc5'),_0xd7dd('0xc6')],'required':![]},{'model':db['Tag'],'as':_0xd7dd('0xc7'),'attributes':['id',_0xd7dd('0x37'),_0xd7dd('0xc8')],'where':_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0xc9')]?{'id':_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0xc9')]}:undefined,'required':_0xe26fb3[_0xd7dd('0x41')][_0xd7dd('0xc9')]?!![]:![]}];}return db[_0xd7dd('0xa3')][_0xd7dd('0x53')](_0x3be39b);})[_0xd7dd('0x32')](function(_0x128eb9){_0x516978[_0xd7dd('0x54')]=_0x128eb9;return _0x516978;});}})['then'](respondWithFilteredResult(_0x42ed2c,_0x3be39b))['catch'](handleError(_0x42ed2c,null));};exports[_0xd7dd('0xbc')]=function(_0xce140a,_0x159acc,_0x1e8284){var _0x58816c,_0x55ca4a,_0x4e1e01;if(_[_0xd7dd('0x95')](_0xce140a[_0xd7dd('0x5a')][_0xd7dd('0x5a')])||_0xce140a[_0xd7dd('0x5a')][_0xd7dd('0x5a')]===''){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0x97'));}if(_[_0xd7dd('0x95')](_0xce140a[_0xd7dd('0x5a')]['to'])){throw new db[(_0xd7dd('0x76'))][(_0xd7dd('0x77'))](_0xd7dd('0xca'));}_0x58816c=_0xce140a[_0xd7dd('0x5a')]['to'];return db['SmsAccount'][_0xd7dd('0x57')]({'where':{'id':_0xce140a['params']['id']},'include':[{'model':db[_0xd7dd('0x9c')],'as':_0xd7dd('0xcb'),'include':[{'model':db[_0xd7dd('0x75')],'as':_0xd7dd('0x9e'),'where':{'mobile':_0x58816c},'limit':0x1,'order':[[_0xd7dd('0x7b'),_0xd7dd('0x9f')]]}]}]})[_0xd7dd('0x32')](handleEntityNotFound(_0x159acc,null))['then'](function(_0x128f2a){if(_0x128f2a&&_0x128f2a[_0xd7dd('0xcb')]){_0x55ca4a=_0x128f2a['get']({'plain':!![]});if(_0x55ca4a[_0xd7dd('0xcb')]&&_0x55ca4a[_0xd7dd('0xcb')]['Contacts'][_0xd7dd('0x46')]){return _0x55ca4a['List']['Contacts'][0x0];}return db[_0xd7dd('0x75')][_0xd7dd('0x59')](_[_0xd7dd('0xa2')](_0xce140a[_0xd7dd('0x5a')],{'firstName':_0x58816c,'mobile':_0x58816c,'phone':_0x58816c,'ListId':_0x55ca4a[_0xd7dd('0x9d')]}));}})[_0xd7dd('0x32')](handleEntityNotFound(_0x159acc,null))[_0xd7dd('0x32')](function(_0x358b5b){if(_0x358b5b){_0x4e1e01=_0x358b5b;return db[_0xd7dd('0xa3')][_0xd7dd('0x57')]({'where':{'ContactId':_0x4e1e01['id'],'closed':![],'SmsAccountId':_0x55ca4a['id']}})[_0xd7dd('0x32')](function(_0x35bada){if(_0x35bada){return[_0x35bada,![]];}return db['SmsInteraction'][_0xd7dd('0x59')]({'UserId':_0xce140a[_0xd7dd('0x5b')]['id'],'ContactId':_0x4e1e01['id'],'SmsAccountId':_0x55ca4a['id'],'phone':_0x58816c,'firstMsgDirection':'out','Messages':[_['merge'](_0xce140a[_0xd7dd('0x5a')],{'read':![],'body':_0xce140a['body'][_0xd7dd('0x5a')],'phone':_0x58816c,'SmsAccountId':_0x55ca4a['id'],'UserId':_0xce140a[_0xd7dd('0x5b')]['id'],'ContactId':_0x4e1e01['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0xe00137){return[_0xe00137,!![]];});});}})[_0xd7dd('0xa4')](function(_0x2d9e63,_0x25c2ad){if(_0x25c2ad){return _0x2d9e63;}return db['SmsMessage'][_0xd7dd('0x59')](_[_0xd7dd('0x4e')](_0xce140a[_0xd7dd('0x5a')],{'read':![],'body':_0xce140a[_0xd7dd('0x5a')][_0xd7dd('0x5a')],'phone':_0x58816c,'SmsAccountId':_0x55ca4a['id'],'SmsInteractionId':_0x2d9e63['id'],'UserId':_0xce140a[_0xd7dd('0x5b')]['id'],'ContactId':_0x4e1e01['id']}))[_0xd7dd('0x32')](function(_0x339bdc){_0x2d9e63[_0xd7dd('0xcc')][_0xd7dd('0xcd')]=[];_0x2d9e63['dataValues']['Messages'][_0xd7dd('0xa9')](_0x339bdc[_0xd7dd('0xcc')]);return _0x2d9e63;});})['then'](respondWithResult(_0x159acc,null))[_0xd7dd('0x58')](handleError(_0x159acc,null));};exports[_0xd7dd('0x28')]=function(_0x4f2843,_0x4affbc,_0x306020){if(_0x4f2843['body']['id']){delete _0x4f2843['body']['id'];}var _0x21a861,_0x11a8d7,_0x27fbe5;return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x4f2843[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x4affbc,null))[_0xd7dd('0x32')](function(_0x2fb206){if(_0x2fb206){_0x27fbe5=_0x2fb206;logger['debug'](_0xd7dd('0xb6'),_0xd7dd('0x28'),_0xd7dd('0xce'),_0x2fb206[_0xd7dd('0x7d')],util['inspect'](_0x4f2843[_0xd7dd('0x5a')],{'showHidden':![],'depth':null}));switch(_0x2fb206[_0xd7dd('0x7d')]){case _0xd7dd('0x84'):if(_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0xcf')]&&_0x4f2843['body'][_0xd7dd('0x28')]){_0x11a8d7=_0x4f2843[_0xd7dd('0x5a')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0xcf')]}});}break;case _0xd7dd('0x87'):if(_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0xd0')]&&_0x4f2843[_0xd7dd('0x5a')]['statusInt']){_0x11a8d7=_0x4f2843['body'][_0xd7dd('0xd1')];return db['SmsMessage'][_0xd7dd('0x57')]({'where':{'messageId':_0x4f2843['body'][_0xd7dd('0xd0')]}});}break;case _0xd7dd('0x88'):if(_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0x89')]&&_0x4f2843[_0xd7dd('0x5a')]['status_code']){_0x11a8d7=_0x4f2843['body'][_0xd7dd('0xd2')];return db[_0xd7dd('0xac')]['find']({'where':{'messageId':_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0x89')]}});}break;case _0xd7dd('0x8b'):var _0x276b1e=_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0x8c')][0x0];if(_0x276b1e[_0xd7dd('0x82')]&&_0x276b1e[_0xd7dd('0x28')][_0xd7dd('0xd3')]===_0xd7dd('0xd4')){_0x11a8d7=_0x276b1e[_0xd7dd('0x28')][_0xd7dd('0xd3')];return db[_0xd7dd('0xac')][_0xd7dd('0x57')]({'where':{'messageId':_0x276b1e[_0xd7dd('0x82')]}});}break;case _0xd7dd('0x90'):if(_0x4f2843['body'][_0xd7dd('0x82')]&&_0x4f2843['body']['status']){_0x11a8d7=_0x4f2843['body'][_0xd7dd('0x28')];return db[_0xd7dd('0xac')][_0xd7dd('0x57')]({'where':{'messageId':_0x4f2843[_0xd7dd('0x5a')]['messageId']}});}break;case _0xd7dd('0xd5'):if(_0x4f2843[_0xd7dd('0x5a')][0x0][_0xd7dd('0x25')]['id']){_0x11a8d7=_0x4f2843[_0xd7dd('0x5a')][0x0][_0xd7dd('0x7d')];return db[_0xd7dd('0xac')]['find']({'where':{'messageId':_0x4f2843[_0xd7dd('0x5a')][0x0][_0xd7dd('0x25')]['id']}});}break;case _0xd7dd('0x93'):if(_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0xd6')]&&_0x4f2843['body'][_0xd7dd('0x28')]){_0x11a8d7=_0x4f2843['body'][_0xd7dd('0x28')];return db['SmsMessage'][_0xd7dd('0x57')]({'where':{'messageId':_0x4f2843[_0xd7dd('0x5a')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x4affbc,null))[_0xd7dd('0x32')](function(_0x5f5c61){if(_0x5f5c61){_0x21a861=_0x5f5c61;switch(_0x27fbe5[_0xd7dd('0x7d')]){case'skebby':if(_0x11a8d7===_0xd7dd('0xd4')){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd7dd('0x28'),'skebby',util[_0xd7dd('0xd7')](_0x4f2843['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x11a8d7==='1'){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd7dd('0x28'),_0xd7dd('0x84'),util[_0xd7dd('0xd7')](_0x4f2843[_0xd7dd('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4f2843['body'][_0xd7dd('0xd8')]&&_0x11a8d7>=0xc8&&_0x11a8d7<=0xce){return _0x21a861['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd7dd('0x28'),_0xd7dd('0x88'),util[_0xd7dd('0xd7')](_0x4f2843['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3d7801=_0x4f2843[_0xd7dd('0x5a')][_0xd7dd('0x8c')][0x0];if(_0x3d7801['status'][_0xd7dd('0xd3')]==='DELIVERED'){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')](_0xd7dd('0xb6'),'status',_0xd7dd('0x8b'),util['inspect'](_0x4f2843[_0xd7dd('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd7dd('0x90'):if(_0x11a8d7==_0xd7dd('0xd9')||_0x11a8d7==_0xd7dd('0xda')){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')](_0xd7dd('0xb6'),_0xd7dd('0x28'),_0xd7dd('0x90'),util[_0xd7dd('0xd7')](_0x4f2843['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x11a8d7==_0xd7dd('0xdb')){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')](_0xd7dd('0xb6'),_0xd7dd('0x28'),_0xd7dd('0xd5'),util[_0xd7dd('0xd7')](_0x4f2843[_0xd7dd('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd7dd('0x93'):if(_0x11a8d7==='DELIVRD'||_0x11a8d7===_0xd7dd('0xdc')){return _0x21a861[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')](_0xd7dd('0xb6'),'status','intelepeer',util[_0xd7dd('0xd7')](_0x4f2843[_0xd7dd('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x21a861;}})['then'](respondWithResult(_0x4affbc,null))[_0xd7dd('0x58')](handleError(_0x4affbc,null));};exports[_0xd7dd('0xdd')]=function(_0x5a7503,_0x277288,_0x52fb8d){var _0x5d896b,_0x5b3d95,_0x322f20;return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x5a7503[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x277288,null))[_0xd7dd('0x32')](function(_0x4955cd){if(_0x4955cd){_0x322f20=_0x4955cd;logger[_0xd7dd('0xb8')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd7dd('0x28'),_0xd7dd('0xce'),_0x4955cd[_0xd7dd('0x7d')],util[_0xd7dd('0xd7')](_0x5a7503[_0xd7dd('0x41')],{'showHidden':![],'depth':null}));switch(_0x4955cd[_0xd7dd('0x7d')]){case _0xd7dd('0x8d'):if(_0x5a7503[_0xd7dd('0x41')][_0xd7dd('0xde')]&&_0x5a7503[_0xd7dd('0x41')]['state']){_0x5b3d95=_0x5a7503[_0xd7dd('0x41')][_0xd7dd('0xdf')];return db[_0xd7dd('0xac')][_0xd7dd('0x57')]({'where':{'messageId':_0x5a7503['query'][_0xd7dd('0xde')]}});}break;}}})[_0xd7dd('0x32')](handleEntityNotFound(_0x277288,null))[_0xd7dd('0x32')](function(_0x3933f6){if(_0x3933f6){_0x5d896b=_0x3933f6;switch(_0x322f20[_0xd7dd('0x7d')]){case _0xd7dd('0x8d'):if(_0x5b3d95==='2'||_0x5b3d95==='6'){return _0x5d896b[_0xd7dd('0x31')]({'read':!![]});}else{logger[_0xd7dd('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd7dd('0x28'),'csc',util[_0xd7dd('0xd7')](_0x5a7503['query'],{'showHidden':![],'depth':null}));};break;}return _0x5d896b;}})[_0xd7dd('0x32')](respondWithResult(_0x277288,null))[_0xd7dd('0x58')](handleError(_0x277288,null));};exports[_0xd7dd('0xe0')]=function(_0x209ab3,_0x271212,_0x48dff0){return db[_0xd7dd('0x3c')][_0xd7dd('0x57')]({'where':{'id':_0x209ab3[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x271212,null))[_0xd7dd('0x32')](function(_0x4c1811){if(_0x4c1811){return _0x4c1811['addAgents'](_0x209ab3[_0xd7dd('0x5a')]['ids'],_[_0xd7dd('0xa1')](_0x209ab3[_0xd7dd('0x5a')],[_0xd7dd('0x69'),'id'])||{})[_0xd7dd('0xa4')](function(_0x520be1){for(var _0x3d3b37=0x0;_0x3d3b37<_0x209ab3[_0xd7dd('0x5a')][_0xd7dd('0x69')][_0xd7dd('0x46')];_0x3d3b37+=0x1){socket['emit'](_0xd7dd('0xe1'),{'UserId':Number(_0x209ab3['body'][_0xd7dd('0x69')][_0x3d3b37]),'SmsAccountId':Number(_0x209ab3[_0xd7dd('0x56')]['id'])});}return _0x520be1;});}})['then'](respondWithResult(_0x271212,null))[_0xd7dd('0x58')](handleError(_0x271212,null));};exports[_0xd7dd('0xe2')]=function(_0x880f6,_0x290777,_0x2264bd){return db[_0xd7dd('0x3c')]['find']({'where':{'id':_0x880f6[_0xd7dd('0x56')]['id']}})[_0xd7dd('0x32')](handleEntityNotFound(_0x290777,null))[_0xd7dd('0x32')](function(_0x3de741){if(_0x3de741){return _0x3de741[_0xd7dd('0xe2')](_0x880f6['query'][_0xd7dd('0x69')])[_0xd7dd('0x32')](function(){if(_[_0xd7dd('0xe3')](_0x880f6['query'][_0xd7dd('0x69')])){for(var _0x520beb=0x0;_0x520beb<_0x880f6[_0xd7dd('0x41')]['ids']['length'];_0x520beb+=0x1){socket[_0xd7dd('0xe4')](_0xd7dd('0xe5'),{'UserId':Number(_0x880f6[_0xd7dd('0x41')]['ids'][_0x520beb]),'SmsAccountId':Number(_0x880f6[_0xd7dd('0x56')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x880f6[_0xd7dd('0x41')][_0xd7dd('0x69')]),'SmsAccountId':Number(_0x880f6[_0xd7dd('0x56')]['id'])});}});}})[_0xd7dd('0x32')](respondWithStatusCode(_0x290777,null))['catch'](handleError(_0x290777,null));};exports[_0xd7dd('0xe6')]=function(_0x3dfd2d,_0x3c163a,_0x532391){var _0x20e84f={};var _0x30d92d={};var _0xd60c2f;var _0x1c0aa1;return db[_0xd7dd('0x3c')][_0xd7dd('0x6c')]({'where':{'id':_0x3dfd2d[_0xd7dd('0x56')]['id']}})['then'](handleEntityNotFound(_0x3c163a,null))[_0xd7dd('0x32')](function(_0x34a364){if(_0x34a364){_0xd60c2f=_0x34a364;_0x30d92d[_0xd7dd('0x40')]=_[_0xd7dd('0x42')](db[_0xd7dd('0xb0')]['rawAttributes']);_0x30d92d[_0xd7dd('0x41')]=_[_0xd7dd('0x42')](_0x3dfd2d['query']);_0x30d92d[_0xd7dd('0x4b')]=_[_0xd7dd('0x43')](_0x30d92d[_0xd7dd('0x40')],_0x30d92d['query']);_0x20e84f[_0xd7dd('0x44')]=_['intersection'](_0x30d92d[_0xd7dd('0x40')],qs[_0xd7dd('0x45')](_0x3dfd2d[_0xd7dd('0x41')][_0xd7dd('0x45')]));_0x20e84f['attributes']=_0x20e84f[_0xd7dd('0x44')]['length']?_0x20e84f[_0xd7dd('0x44')]:_0x30d92d['model'];_0x20e84f[_0xd7dd('0x4a')]=qs[_0xd7dd('0x66')](_0x3dfd2d[_0xd7dd('0x41')][_0xd7dd('0x66')]);_0x20e84f[_0xd7dd('0x4d')]=qs[_0xd7dd('0x4b')](_['pick'](_0x3dfd2d['query'],_0x30d92d[_0xd7dd('0x4b')]));if(_0x3dfd2d[_0xd7dd('0x41')]['filter']){_0x20e84f[_0xd7dd('0x4d')]=_[_0xd7dd('0x4e')](_0x20e84f['where'],{'$or':_[_0xd7dd('0x3b')](_0x20e84f[_0xd7dd('0x44')],function(_0x254b9b){var _0x3027a1={};_0x3027a1[_0x254b9b]={'$like':'%'+_0x3dfd2d[_0xd7dd('0x41')][_0xd7dd('0x67')]+'%'};return _0x3027a1;})});}_0x20e84f=_[_0xd7dd('0x4e')]({},_0x20e84f,_0x3dfd2d[_0xd7dd('0x50')]);return _0xd60c2f[_0xd7dd('0xe6')](_0x20e84f);}})[_0xd7dd('0x32')](function(_0x76f02a){if(_0x76f02a){_0x1c0aa1=_0x76f02a[_0xd7dd('0x46')];if(!_0x3dfd2d[_0xd7dd('0x41')]['hasOwnProperty'](_0xd7dd('0x48'))){_0x20e84f[_0xd7dd('0x2b')]=qs[_0xd7dd('0x2b')](_0x3dfd2d[_0xd7dd('0x41')][_0xd7dd('0x2b')]);_0x20e84f['offset']=qs[_0xd7dd('0x49')](_0x3dfd2d['query']['offset']);}return _0xd60c2f[_0xd7dd('0xe6')](_0x20e84f);}})['then'](function(_0x5811ec){if(_0x5811ec){return _0x5811ec?{'count':_0x1c0aa1,'rows':_0x5811ec}:null;}})[_0xd7dd('0x32')](respondWithResult(_0x3c163a,null))[_0xd7dd('0x58')](handleError(_0x3c163a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 57a5a83..c59b586 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 _0x14c7=['update','remove','exports','SmsAccount','setMaxListeners','save'];(function(_0x1aa13e,_0x12a40b){var _0x1144bd=function(_0x5f5cae){while(--_0x5f5cae){_0x1aa13e['push'](_0x1aa13e['shift']());}};_0x1144bd(++_0x12a40b);}(_0x14c7,0x1b3));var _0x714c=function(_0x3a8de1,_0x2e8c13){_0x3a8de1=_0x3a8de1-0x0;var _0x375c03=_0x14c7[_0x3a8de1];return _0x375c03;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x714c('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x714c('0x1')](0x0);var events={'afterCreate':_0x714c('0x2'),'afterUpdate':_0x714c('0x3'),'afterDestroy':_0x714c('0x4')};function emitEvent(_0x253b45){return function(_0x3aa9ff,_0x1c99ec,_0x5be7fb){SmsAccountEvents['emit'](_0x253b45+':'+_0x3aa9ff['id'],_0x3aa9ff);SmsAccountEvents['emit'](_0x253b45,_0x3aa9ff);_0x5be7fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x714c('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0xb1d5=['SmsAccount','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x161d96,_0x296ba7){var _0x2d9a9d=function(_0x3c6440){while(--_0x3c6440){_0x161d96['push'](_0x161d96['shift']());}};_0x2d9a9d(++_0x296ba7);}(_0xb1d5,0x14e));var _0x5b1d=function(_0xaa5e25,_0x6d7208){_0xaa5e25=_0xaa5e25-0x0;var _0x461514=_0xb1d5[_0xaa5e25];return _0x461514;};'use strict';var EventEmitter=require(_0x5b1d('0x0'));var SmsAccount=require(_0x5b1d('0x1'))['db'][_0x5b1d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b1d('0x3'),'afterUpdate':'update','afterDestroy':_0x5b1d('0x4')};function emitEvent(_0x1fc252){return function(_0x515456,_0x1ce933,_0x567a22){SmsAccountEvents['emit'](_0x1fc252+':'+_0x515456['id'],_0x515456);SmsAccountEvents[_0x5b1d('0x5')](_0x1fc252,_0x515456);_0x567a22(null);};}for(var e in events){if(events[_0x5b1d('0x6')](e)){var event=events[e];SmsAccount[_0x5b1d('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 937bcdc..3df1dc5 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 _0xd92a=['api','moment','request-promise','path','rimraf','define','SmsAccount','lodash'];(function(_0x5b5fe5,_0x46284e){var _0x2a5193=function(_0x13c1d9){while(--_0x13c1d9){_0x5b5fe5['push'](_0x5b5fe5['shift']());}};_0x2a5193(++_0x46284e);}(_0xd92a,0xaf));var _0xad92=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd92a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xad92('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xad92('0x1'));var moment=require(_0xad92('0x2'));var BPromise=require('bluebird');var rp=require(_0xad92('0x3'));var fs=require('fs');var path=require(_0xad92('0x4'));var rimraf=require(_0xad92('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0x5e9ff4,_0x5521ea){return _0x5e9ff4[_0xad92('0x6')](_0xad92('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9ce=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x447b17,_0x586b97){var _0x305bf3=function(_0x57d4ef){while(--_0x57d4ef){_0x447b17['push'](_0x447b17['shift']());}};_0x305bf3(++_0x586b97);}(_0xd9ce,0x161));var _0xed9c=function(_0x5a7da7,_0x4f132a){_0x5a7da7=_0x5a7da7-0x0;var _0x14459e=_0xd9ce[_0x5a7da7];return _0x14459e;};'use strict';var _=require(_0xed9c('0x0'));var util=require(_0xed9c('0x1'));var logger=require(_0xed9c('0x2'))(_0xed9c('0x3'));var moment=require(_0xed9c('0x4'));var BPromise=require(_0xed9c('0x5'));var rp=require(_0xed9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed9c('0x7'));var attributes=require(_0xed9c('0x8'));module[_0xed9c('0x9')]=function(_0x2a7fb6,_0x17ef24){return _0x2a7fb6[_0xed9c('0xa')](_0xed9c('0xb'),attributes,{'tableName':_0xed9c('0xc'),'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 8ba8f88..d2f503a 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 _0xb6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount','stringify','lodash','util','bluebird'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb6ea,0xc0));var _0xab6e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb6ea[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab6e('0x0'));var util=require(_0xab6e('0x1'));var moment=require('moment');var BPromise=require(_0xab6e('0x2'));var rs=require(_0xab6e('0x3'));var fs=require('fs');var Redis=require(_0xab6e('0x4'));var db=require(_0xab6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab6e('0x6'))(_0xab6e('0x7'));var config=require('../../config/environment');var jayson=require(_0xab6e('0x8'));var client=jayson[_0xab6e('0x9')][_0xab6e('0xa')]({'port':0x232a});config[_0xab6e('0xb')]=_[_0xab6e('0xc')](config[_0xab6e('0xb')],{'host':_0xab6e('0xd'),'port':0x18eb});var socket=require(_0xab6e('0xe'))(new Redis(config[_0xab6e('0xb')]));require(_0xab6e('0xf'))[_0xab6e('0x10')](socket);function respondWithRpcPromise(_0x4b6942,_0x19e272,_0x3fa196){return new BPromise(function(_0x27dc58,_0x35e11c){return client[_0xab6e('0x11')](_0x4b6942,_0x3fa196)[_0xab6e('0x12')](function(_0x396201){logger[_0xab6e('0x13')](_0xab6e('0x14'),_0x19e272,_0xab6e('0x15'));logger[_0xab6e('0x16')](_0xab6e('0x17'),_0x19e272,_0xab6e('0x15'),JSON['stringify'](_0x396201));if(_0x396201[_0xab6e('0x18')]){if(_0x396201[_0xab6e('0x18')][_0xab6e('0x19')]===0x1f4){logger[_0xab6e('0x18')]('SmsAccount,\x20%s,\x20%s',_0x19e272,_0x396201[_0xab6e('0x18')]['message']);return _0x35e11c(_0x396201[_0xab6e('0x18')][_0xab6e('0x1a')]);}logger[_0xab6e('0x18')](_0xab6e('0x14'),_0x19e272,_0x396201['error'][_0xab6e('0x1a')]);return _0x27dc58(_0x396201[_0xab6e('0x18')]['message']);}else{logger[_0xab6e('0x13')](_0xab6e('0x14'),_0x19e272,_0xab6e('0x15'));_0x27dc58(_0x396201[_0xab6e('0x1b')]['message']);}})[_0xab6e('0x1c')](function(_0x3134ff){logger['error'](_0xab6e('0x14'),_0x19e272,_0x3134ff);_0x35e11c(_0x3134ff);});});}exports['ShowSmsAccount']=function(_0x5d9069){var _0x5ac6ea=this;return new Promise(function(_0x551466,_0x4d855a){return db[_0xab6e('0x1d')][_0xab6e('0x1e')]({'raw':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069[_0xab6e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069['options'][_0xab6e('0x20')]||null:null,'attributes':_0x5d9069['options']?_0x5d9069[_0xab6e('0x1f')][_0xab6e('0x21')]||null:null,'include':_0x5d9069[_0xab6e('0x1f')]?_0x5d9069['options'][_0xab6e('0x22')]?_[_0xab6e('0x23')](_0x5d9069['options'][_0xab6e('0x22')],function(_0x99571e){return{'model':db[_0x99571e['model']],'as':_0x99571e['as'],'attributes':_0x99571e[_0xab6e('0x21')],'include':_0x99571e[_0xab6e('0x22')]?_['map'](_0x99571e[_0xab6e('0x22')],function(_0x171337){return{'model':db[_0x171337[_0xab6e('0x24')]],'as':_0x171337['as'],'attributes':_0x171337[_0xab6e('0x21')],'include':_0x171337[_0xab6e('0x22')]?_[_0xab6e('0x23')](_0x171337[_0xab6e('0x22')],function(_0x45bc4b){return{'model':db[_0x45bc4b[_0xab6e('0x24')]],'as':_0x45bc4b['as'],'attributes':_0x45bc4b['attributes']};}):[]};}):[]};}):[]:[]})[_0xab6e('0x12')](function(_0x1aa588){logger['info'](_0xab6e('0x25'),_0x5d9069);logger['debug'](_0xab6e('0x25'),_0x5d9069,JSON[_0xab6e('0x26')](_0x1aa588));_0x551466(_0x1aa588);})[_0xab6e('0x1c')](function(_0x11b45b){logger[_0xab6e('0x18')](_0xab6e('0x25'),_0x11b45b[_0xab6e('0x1a')],_0x5d9069);_0x4d855a(_0x5ac6ea[_0xab6e('0x18')](0x1f4,_0x11b45b['message']));});});}; \ No newline at end of file +var _0x8a0e=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','model','map','then','debug','lodash','moment'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0x8a0e,0x1ba));var _0xe8a0=function(_0x4032d4,_0x296b0a){_0x4032d4=_0x4032d4-0x0;var _0x3d5b52=_0x8a0e[_0x4032d4];return _0x3d5b52;};'use strict';var _=require(_0xe8a0('0x0'));var util=require('util');var moment=require(_0xe8a0('0x1'));var BPromise=require(_0xe8a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8a0('0x3'));var db=require(_0xe8a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8a0('0x5'));var config=require(_0xe8a0('0x6'));var jayson=require(_0xe8a0('0x7'));var client=jayson[_0xe8a0('0x8')][_0xe8a0('0x9')]({'port':0x232a});config[_0xe8a0('0xa')]=_[_0xe8a0('0xb')](config[_0xe8a0('0xa')],{'host':_0xe8a0('0xc'),'port':0x18eb});var socket=require(_0xe8a0('0xd'))(new Redis(config[_0xe8a0('0xa')]));require(_0xe8a0('0xe'))[_0xe8a0('0xf')](socket);function respondWithRpcPromise(_0x469b48,_0x1a5312,_0x43ca67){return new BPromise(function(_0x572bc7,_0x216e0d){return client[_0xe8a0('0x10')](_0x469b48,_0x43ca67)['then'](function(_0x4bcf53){logger['info'](_0xe8a0('0x11'),_0x1a5312,_0xe8a0('0x12'));logger['debug'](_0xe8a0('0x13'),_0x1a5312,_0xe8a0('0x12'),JSON[_0xe8a0('0x14')](_0x4bcf53));if(_0x4bcf53[_0xe8a0('0x15')]){if(_0x4bcf53['error'][_0xe8a0('0x16')]===0x1f4){logger[_0xe8a0('0x15')](_0xe8a0('0x11'),_0x1a5312,_0x4bcf53[_0xe8a0('0x15')]['message']);return _0x216e0d(_0x4bcf53[_0xe8a0('0x15')][_0xe8a0('0x17')]);}logger['error'](_0xe8a0('0x11'),_0x1a5312,_0x4bcf53[_0xe8a0('0x15')][_0xe8a0('0x17')]);return _0x572bc7(_0x4bcf53[_0xe8a0('0x15')]['message']);}else{logger[_0xe8a0('0x18')](_0xe8a0('0x11'),_0x1a5312,_0xe8a0('0x12'));_0x572bc7(_0x4bcf53['result'][_0xe8a0('0x17')]);}})[_0xe8a0('0x19')](function(_0x481b99){logger[_0xe8a0('0x15')](_0xe8a0('0x11'),_0x1a5312,_0x481b99);_0x216e0d(_0x481b99);});});}exports[_0xe8a0('0x1a')]=function(_0x4c3d33){var _0x375c7f=this;return new Promise(function(_0x26e9d9,_0x4ccea8){return db[_0xe8a0('0x1b')][_0xe8a0('0x1c')]({'raw':_0x4c3d33['options']?_0x4c3d33[_0xe8a0('0x1d')][_0xe8a0('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c3d33[_0xe8a0('0x1d')]?_0x4c3d33[_0xe8a0('0x1d')]['where']||null:null,'attributes':_0x4c3d33[_0xe8a0('0x1d')]?_0x4c3d33[_0xe8a0('0x1d')][_0xe8a0('0x1f')]||null:null,'include':_0x4c3d33[_0xe8a0('0x1d')]?_0x4c3d33['options'][_0xe8a0('0x20')]?_['map'](_0x4c3d33['options']['include'],function(_0x298d37){return{'model':db[_0x298d37[_0xe8a0('0x21')]],'as':_0x298d37['as'],'attributes':_0x298d37[_0xe8a0('0x1f')],'include':_0x298d37[_0xe8a0('0x20')]?_[_0xe8a0('0x22')](_0x298d37['include'],function(_0x15ca0a){return{'model':db[_0x15ca0a[_0xe8a0('0x21')]],'as':_0x15ca0a['as'],'attributes':_0x15ca0a['attributes'],'include':_0x15ca0a[_0xe8a0('0x20')]?_[_0xe8a0('0x22')](_0x15ca0a['include'],function(_0x2c95de){return{'model':db[_0x2c95de['model']],'as':_0x2c95de['as'],'attributes':_0x2c95de['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8a0('0x23')](function(_0xaca73f){logger[_0xe8a0('0x18')]('ShowSmsAccount',_0x4c3d33);logger[_0xe8a0('0x24')](_0xe8a0('0x1a'),_0x4c3d33,JSON[_0xe8a0('0x14')](_0xaca73f));_0x26e9d9(_0xaca73f);})[_0xe8a0('0x19')](function(_0x3c1fe7){logger[_0xe8a0('0x15')](_0xe8a0('0x1a'),_0x3c1fe7[_0xe8a0('0x17')],_0x4c3d33);_0x4ccea8(_0x375c7f[_0xe8a0('0x15')](0x1f4,_0x3c1fe7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ad1633d..ddd1225 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(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 3e33916..f479760 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x38ddb2,_0x1141e1){var _0x22ee32=function(_0x4f48d7){while(--_0x4f48d7){_0x38ddb2['push'](_0x38ddb2['shift']());}};_0x22ee32(++_0x1141e1);}(_0x3e74,0x175));var _0x43e7=function(_0x1f2e93,_0x3c2493){_0x1f2e93=_0x1f2e93-0x0;var _0x445f26=_0x3e74[_0x1f2e93];return _0x445f26;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +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(_0x466414,_0x3df7a9){var _0x31fa1f=function(_0x1e3c7b){while(--_0x1e3c7b){_0x466414['push'](_0x466414['shift']());}};_0x31fa1f(++_0x3df7a9);}(_0xedd9,0xfc));var _0x9edd=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0xedd9[_0x2de753];return _0x8e70a5;};'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 8ac56c5..7a7322b 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 _0x821c=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x821c,0xa5));var _0xc821=function(_0x5685f7,_0x53e368){_0x5685f7=_0x5685f7-0x0;var _0x446dab=_0x821c[_0x5685f7];return _0x446dab;};'use strict';var Sequelize=require(_0xc821('0x0'));module[_0xc821('0x1')]={'priority':{'type':Sequelize[_0xc821('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc821('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc821('0x4')]()},'description':{'type':Sequelize[_0xc821('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc821('0x5')}}; \ No newline at end of file +var _0x8adb=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x401fdf,_0x1a3185){var _0x2198a6=function(_0x3fe20b){while(--_0x3fe20b){_0x401fdf['push'](_0x401fdf['shift']());}};_0x2198a6(++_0x1a3185);}(_0x8adb,0x1ce));var _0xb8ad=function(_0x471ec3,_0x25bcf7){_0x471ec3=_0x471ec3-0x0;var _0x1e4bdd=_0x8adb[_0x471ec3];return _0x1e4bdd;};'use strict';var Sequelize=require(_0xb8ad('0x0'));module[_0xb8ad('0x1')]={'priority':{'type':Sequelize[_0xb8ad('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb8ad('0x3')],'allowNull':![],'defaultValue':_0xb8ad('0x4')},'appdata':{'type':Sequelize[_0xb8ad('0x5')]()},'description':{'type':Sequelize[_0xb8ad('0x3')]},'interval':{'type':Sequelize[_0xb8ad('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c2e144a..61db9bd 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 _0x3ba2=['includeAll','include','findAll','catch','show','params','intersection','find','create','body','update','destroy','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','save','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','merge','options'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3ba2,0x147));var _0x23ba=function(_0x3f1660,_0x2df909){_0x3f1660=_0x3f1660-0x0;var _0x55c246=_0x3ba2[_0x3f1660];return _0x55c246;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23ba('0x0'));var zipdir=require(_0x23ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23ba('0x2'));var moment=require(_0x23ba('0x3'));var BPromise=require(_0x23ba('0x4'));var Mustache=require('mustache');var util=require(_0x23ba('0x5'));var path=require(_0x23ba('0x6'));var sox=require('sox');var csv=require(_0x23ba('0x7'));var ejs=require(_0x23ba('0x8'));var fs=require('fs');var fs_extra=require(_0x23ba('0x9'));var _=require('lodash');var squel=require(_0x23ba('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x23ba('0xb'));var toCsv=require('to-csv');var querystring=require(_0x23ba('0xc'));var Papa=require(_0x23ba('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x23ba('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x23ba('0xf'));var utils=require(_0x23ba('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x23ba('0x11'))['db'];function respondWithStatusCode(_0x4371df,_0x1c7821){_0x1c7821=_0x1c7821||0xcc;return function(_0xd58ba6){if(_0xd58ba6){return _0x4371df[_0x23ba('0x12')](_0x1c7821);}return _0x4371df[_0x23ba('0x13')](_0x1c7821)['end']();};}function respondWithResult(_0x404a7f,_0x497515){_0x497515=_0x497515||0xc8;return function(_0x3eb221){if(_0x3eb221){return _0x404a7f['status'](_0x497515)['json'](_0x3eb221);}};}function respondWithFilteredResult(_0x164b64,_0x4c3bfb){return function(_0x5b44d1){if(_0x5b44d1){var _0x447526=typeof _0x4c3bfb[_0x23ba('0x14')]===_0x23ba('0x15')&&typeof _0x4c3bfb[_0x23ba('0x16')]===_0x23ba('0x15');var _0x3cc567=_0x5b44d1['count'];var _0x4ad629=_0x447526?0x0:_0x4c3bfb[_0x23ba('0x14')];var _0x3776ff=_0x447526?_0x5b44d1['count']:_0x4c3bfb[_0x23ba('0x14')]+_0x4c3bfb[_0x23ba('0x16')];var _0x3049df;if(_0x3776ff>=_0x3cc567){_0x3776ff=_0x3cc567;_0x3049df=0xc8;}else{_0x3049df=0xce;}_0x164b64[_0x23ba('0x13')](_0x3049df);return _0x164b64['set']('Content-Range',_0x4ad629+'-'+_0x3776ff+'/'+_0x3cc567)['json'](_0x5b44d1);}return null;};}function patchUpdates(_0x117ced){return function(_0xc28276){try{jsonpatch['apply'](_0xc28276,_0x117ced,!![]);}catch(_0x48e484){return BPromise['reject'](_0x48e484);}return _0xc28276[_0x23ba('0x17')]();};}function saveUpdates(_0x5e6d45,_0x2e43c7){return function(_0x20fade){if(_0x20fade){return _0x20fade['update'](_0x5e6d45)[_0x23ba('0x18')](function(_0x10aa86){return _0x10aa86;});}return null;};}function removeEntity(_0x2db9dd,_0x412f4f){return function(_0x4cb83e){if(_0x4cb83e){return _0x4cb83e['destroy']()[_0x23ba('0x18')](function(){_0x2db9dd[_0x23ba('0x13')](0xcc)[_0x23ba('0x19')]();});}};}function handleEntityNotFound(_0x2b6d1d,_0x17e058){return function(_0x29784a){if(!_0x29784a){_0x2b6d1d[_0x23ba('0x12')](0x194);}return _0x29784a;};}function handleError(_0x13b055,_0x39904e){_0x39904e=_0x39904e||0x1f4;return function(_0x408f9c){logger[_0x23ba('0x1a')](_0x408f9c[_0x23ba('0x1b')]);if(_0x408f9c['name']){delete _0x408f9c[_0x23ba('0x1c')];}_0x13b055['status'](_0x39904e)[_0x23ba('0x1d')](_0x408f9c);};}exports[_0x23ba('0x1e')]=function(_0x3c1096,_0x56539e){var _0x4aa51e={},_0x1031ca={},_0x49c427={'count':0x0,'rows':[]};var _0x4c710f=_[_0x23ba('0x1f')](db[_0x23ba('0x20')][_0x23ba('0x21')],function(_0x150cc9){return{'name':_0x150cc9[_0x23ba('0x22')],'type':_0x150cc9[_0x23ba('0x23')][_0x23ba('0x24')]};});_0x1031ca[_0x23ba('0x25')]=_[_0x23ba('0x1f')](_0x4c710f,_0x23ba('0x1c'));_0x1031ca[_0x23ba('0x26')]=_[_0x23ba('0x27')](_0x3c1096[_0x23ba('0x26')]);_0x1031ca[_0x23ba('0x28')]=_['intersection'](_0x1031ca[_0x23ba('0x25')],_0x1031ca['query']);_0x4aa51e[_0x23ba('0x29')]=_['intersection'](_0x1031ca[_0x23ba('0x25')],qs[_0x23ba('0x2a')](_0x3c1096['query']['fields']));_0x4aa51e[_0x23ba('0x29')]=_0x4aa51e[_0x23ba('0x29')][_0x23ba('0x2b')]?_0x4aa51e[_0x23ba('0x29')]:_0x1031ca[_0x23ba('0x25')];if(!_0x3c1096[_0x23ba('0x26')]['hasOwnProperty']('nolimit')){_0x4aa51e[_0x23ba('0x16')]=qs[_0x23ba('0x16')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x16')]);_0x4aa51e[_0x23ba('0x14')]=qs[_0x23ba('0x14')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x14')]);}_0x4aa51e[_0x23ba('0x2c')]=qs[_0x23ba('0x2d')](_0x3c1096[_0x23ba('0x26')][_0x23ba('0x2d')]);_0x4aa51e[_0x23ba('0x2e')]=qs[_0x23ba('0x28')](_[_0x23ba('0x2f')](_0x3c1096[_0x23ba('0x26')],_0x1031ca[_0x23ba('0x28')]),_0x4c710f);if(_0x3c1096[_0x23ba('0x26')][_0x23ba('0x30')]){_0x4aa51e[_0x23ba('0x2e')]=_[_0x23ba('0x31')](_0x4aa51e[_0x23ba('0x2e')],{'$or':_[_0x23ba('0x1f')](_0x4c710f,function(_0x5d8302){if(_0x5d8302['type']!=='VIRTUAL'){var _0x4d28b8={};_0x4d28b8[_0x5d8302[_0x23ba('0x1c')]]={'$like':'%'+_0x3c1096[_0x23ba('0x26')]['filter']+'%'};return _0x4d28b8;}})});}_0x4aa51e=_[_0x23ba('0x31')]({},_0x4aa51e,_0x3c1096[_0x23ba('0x32')]);var _0x204379={'where':_0x4aa51e[_0x23ba('0x2e')]};return db[_0x23ba('0x20')]['count'](_0x204379)['then'](function(_0x52056c){_0x49c427['count']=_0x52056c;if(_0x3c1096[_0x23ba('0x26')][_0x23ba('0x33')]){_0x4aa51e[_0x23ba('0x34')]=[{'all':!![]}];}return db['SmsApplication'][_0x23ba('0x35')](_0x4aa51e);})[_0x23ba('0x18')](function(_0x46cf85){_0x49c427['rows']=_0x46cf85;return _0x49c427;})['then'](respondWithFilteredResult(_0x56539e,_0x4aa51e))[_0x23ba('0x36')](handleError(_0x56539e,null));};exports[_0x23ba('0x37')]=function(_0x595c7d,_0x239151){var _0x159174={'raw':!![],'where':{'id':_0x595c7d[_0x23ba('0x38')]['id']}},_0x2c8cba={};_0x2c8cba[_0x23ba('0x25')]=_['keys'](db['SmsApplication'][_0x23ba('0x21')]);_0x2c8cba[_0x23ba('0x26')]=_[_0x23ba('0x27')](_0x595c7d[_0x23ba('0x26')]);_0x2c8cba[_0x23ba('0x28')]=_[_0x23ba('0x39')](_0x2c8cba[_0x23ba('0x25')],_0x2c8cba['query']);_0x159174[_0x23ba('0x29')]=_[_0x23ba('0x39')](_0x2c8cba['model'],qs['fields'](_0x595c7d[_0x23ba('0x26')][_0x23ba('0x2a')]));_0x159174['attributes']=_0x159174[_0x23ba('0x29')]['length']?_0x159174[_0x23ba('0x29')]:_0x2c8cba[_0x23ba('0x25')];if(_0x595c7d[_0x23ba('0x26')]['includeAll']){_0x159174[_0x23ba('0x34')]=[{'all':!![]}];}_0x159174=_[_0x23ba('0x31')]({},_0x159174,_0x595c7d[_0x23ba('0x32')]);return db[_0x23ba('0x20')][_0x23ba('0x3a')](_0x159174)[_0x23ba('0x18')](handleEntityNotFound(_0x239151,null))[_0x23ba('0x18')](respondWithResult(_0x239151,null))[_0x23ba('0x36')](handleError(_0x239151,null));};exports[_0x23ba('0x3b')]=function(_0x159aaa,_0x4f7d0f){return db[_0x23ba('0x20')][_0x23ba('0x3b')](_0x159aaa[_0x23ba('0x3c')],{})[_0x23ba('0x18')](respondWithResult(_0x4f7d0f,0xc9))[_0x23ba('0x36')](handleError(_0x4f7d0f,null));};exports[_0x23ba('0x3d')]=function(_0x5173cb,_0x408e83){if(_0x5173cb[_0x23ba('0x3c')]['id']){delete _0x5173cb[_0x23ba('0x3c')]['id'];}return db[_0x23ba('0x20')][_0x23ba('0x3a')]({'where':{'id':_0x5173cb[_0x23ba('0x38')]['id']}})[_0x23ba('0x18')](handleEntityNotFound(_0x408e83,null))[_0x23ba('0x18')](saveUpdates(_0x5173cb[_0x23ba('0x3c')],null))[_0x23ba('0x18')](respondWithResult(_0x408e83,null))[_0x23ba('0x36')](handleError(_0x408e83,null));};exports[_0x23ba('0x3e')]=function(_0x5240be,_0x183db5){return db[_0x23ba('0x20')][_0x23ba('0x3a')]({'where':{'id':_0x5240be['params']['id']}})[_0x23ba('0x18')](handleEntityNotFound(_0x183db5,null))[_0x23ba('0x18')](removeEntity(_0x183db5,null))[_0x23ba('0x36')](handleError(_0x183db5,null));}; \ No newline at end of file +var _0xc2de=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','SmsApplication','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x20c47c,_0xd10884){var _0x58b234=function(_0x25dd63){while(--_0x25dd63){_0x20c47c['push'](_0x20c47c['shift']());}};_0x58b234(++_0xd10884);}(_0xc2de,0x142));var _0xec2d=function(_0x5cf933,_0x2a54df){_0x5cf933=_0x5cf933-0x0;var _0x48ee77=_0xc2de[_0x5cf933];return _0x48ee77;};'use strict';var emlformat=require(_0xec2d('0x0'));var rimraf=require(_0xec2d('0x1'));var zipdir=require(_0xec2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec2d('0x3'));var moment=require(_0xec2d('0x4'));var BPromise=require(_0xec2d('0x5'));var Mustache=require(_0xec2d('0x6'));var util=require(_0xec2d('0x7'));var path=require('path');var sox=require(_0xec2d('0x8'));var csv=require(_0xec2d('0x9'));var ejs=require(_0xec2d('0xa'));var fs=require('fs');var fs_extra=require(_0xec2d('0xb'));var _=require(_0xec2d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec2d('0xd'));var deskjs=require(_0xec2d('0xe'));var toCsv=require(_0xec2d('0x9'));var querystring=require(_0xec2d('0xf'));var Papa=require(_0xec2d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec2d('0x11'));var as=require(_0xec2d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec2d('0x13'))(_0xec2d('0x14'));var utils=require('../../config/utils');var config=require(_0xec2d('0x15'));var licenseUtil=require(_0xec2d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aecc2,_0x480517){_0x480517=_0x480517||0xcc;return function(_0x4d1971){if(_0x4d1971){return _0x2aecc2[_0xec2d('0x17')](_0x480517);}return _0x2aecc2[_0xec2d('0x18')](_0x480517)[_0xec2d('0x19')]();};}function respondWithResult(_0x357134,_0x198929){_0x198929=_0x198929||0xc8;return function(_0x1a3e14){if(_0x1a3e14){return _0x357134[_0xec2d('0x18')](_0x198929)[_0xec2d('0x1a')](_0x1a3e14);}};}function respondWithFilteredResult(_0x40b4e2,_0x37918d){return function(_0xb9d2b0){if(_0xb9d2b0){var _0x1ca962=typeof _0x37918d[_0xec2d('0x1b')]===_0xec2d('0x1c')&&typeof _0x37918d[_0xec2d('0x1d')]===_0xec2d('0x1c');var _0x40fcc3=_0xb9d2b0['count'];var _0x4247f6=_0x1ca962?0x0:_0x37918d[_0xec2d('0x1b')];var _0x1e517c=_0x1ca962?_0xb9d2b0[_0xec2d('0x1e')]:_0x37918d[_0xec2d('0x1b')]+_0x37918d['limit'];var _0xbc0158;if(_0x1e517c>=_0x40fcc3){_0x1e517c=_0x40fcc3;_0xbc0158=0xc8;}else{_0xbc0158=0xce;}_0x40b4e2[_0xec2d('0x18')](_0xbc0158);return _0x40b4e2[_0xec2d('0x1f')](_0xec2d('0x20'),_0x4247f6+'-'+_0x1e517c+'/'+_0x40fcc3)[_0xec2d('0x1a')](_0xb9d2b0);}return null;};}function patchUpdates(_0x4a146f){return function(_0x23a59e){try{jsonpatch[_0xec2d('0x21')](_0x23a59e,_0x4a146f,!![]);}catch(_0x3973c7){return BPromise['reject'](_0x3973c7);}return _0x23a59e['save']();};}function saveUpdates(_0x1effa6,_0x2988f0){return function(_0x260a63){if(_0x260a63){return _0x260a63[_0xec2d('0x22')](_0x1effa6)[_0xec2d('0x23')](function(_0x4b814a){return _0x4b814a;});}return null;};}function removeEntity(_0x2cb6a0,_0x185c23){return function(_0x4480d4){if(_0x4480d4){return _0x4480d4[_0xec2d('0x24')]()[_0xec2d('0x23')](function(){_0x2cb6a0[_0xec2d('0x18')](0xcc)[_0xec2d('0x19')]();});}};}function handleEntityNotFound(_0xbc6a47,_0x243ecd){return function(_0x40f480){if(!_0x40f480){_0xbc6a47[_0xec2d('0x17')](0x194);}return _0x40f480;};}function handleError(_0x2a3cc6,_0x1914a8){_0x1914a8=_0x1914a8||0x1f4;return function(_0x51bd41){logger['error'](_0x51bd41[_0xec2d('0x25')]);if(_0x51bd41[_0xec2d('0x26')]){delete _0x51bd41[_0xec2d('0x26')];}_0x2a3cc6[_0xec2d('0x18')](_0x1914a8)['send'](_0x51bd41);};}exports['index']=function(_0x16e30d,_0x495e5e){var _0x539b10={},_0x3bc31b={},_0x5f0a77={'count':0x0,'rows':[]};var _0x4892d6=_['map'](db[_0xec2d('0x27')]['rawAttributes'],function(_0x410df3){return{'name':_0x410df3['fieldName'],'type':_0x410df3[_0xec2d('0x28')][_0xec2d('0x29')]};});_0x3bc31b['model']=_[_0xec2d('0x2a')](_0x4892d6,_0xec2d('0x26'));_0x3bc31b[_0xec2d('0x2b')]=_[_0xec2d('0x2c')](_0x16e30d[_0xec2d('0x2b')]);_0x3bc31b['filters']=_[_0xec2d('0x2d')](_0x3bc31b[_0xec2d('0x2e')],_0x3bc31b['query']);_0x539b10['attributes']=_[_0xec2d('0x2d')](_0x3bc31b[_0xec2d('0x2e')],qs[_0xec2d('0x2f')](_0x16e30d['query'][_0xec2d('0x2f')]));_0x539b10[_0xec2d('0x30')]=_0x539b10[_0xec2d('0x30')][_0xec2d('0x31')]?_0x539b10['attributes']:_0x3bc31b['model'];if(!_0x16e30d[_0xec2d('0x2b')][_0xec2d('0x32')]('nolimit')){_0x539b10[_0xec2d('0x1d')]=qs[_0xec2d('0x1d')](_0x16e30d[_0xec2d('0x2b')][_0xec2d('0x1d')]);_0x539b10[_0xec2d('0x1b')]=qs['offset'](_0x16e30d[_0xec2d('0x2b')][_0xec2d('0x1b')]);}_0x539b10['order']=qs[_0xec2d('0x33')](_0x16e30d['query'][_0xec2d('0x33')]);_0x539b10[_0xec2d('0x34')]=qs[_0xec2d('0x35')](_[_0xec2d('0x36')](_0x16e30d[_0xec2d('0x2b')],_0x3bc31b[_0xec2d('0x35')]),_0x4892d6);if(_0x16e30d[_0xec2d('0x2b')][_0xec2d('0x37')]){_0x539b10[_0xec2d('0x34')]=_[_0xec2d('0x38')](_0x539b10[_0xec2d('0x34')],{'$or':_[_0xec2d('0x2a')](_0x4892d6,function(_0x14ebf6){if(_0x14ebf6[_0xec2d('0x28')]!=='VIRTUAL'){var _0x33bfb5={};_0x33bfb5[_0x14ebf6['name']]={'$like':'%'+_0x16e30d['query'][_0xec2d('0x37')]+'%'};return _0x33bfb5;}})});}_0x539b10=_[_0xec2d('0x38')]({},_0x539b10,_0x16e30d[_0xec2d('0x39')]);var _0x3db371={'where':_0x539b10[_0xec2d('0x34')]};return db[_0xec2d('0x27')]['count'](_0x3db371)[_0xec2d('0x23')](function(_0xdba63d){_0x5f0a77[_0xec2d('0x1e')]=_0xdba63d;if(_0x16e30d['query']['includeAll']){_0x539b10['include']=[{'all':!![]}];}return db['SmsApplication'][_0xec2d('0x3a')](_0x539b10);})[_0xec2d('0x23')](function(_0x782dc0){_0x5f0a77[_0xec2d('0x3b')]=_0x782dc0;return _0x5f0a77;})['then'](respondWithFilteredResult(_0x495e5e,_0x539b10))[_0xec2d('0x3c')](handleError(_0x495e5e,null));};exports[_0xec2d('0x3d')]=function(_0x5c6178,_0x3ca874){var _0x943186={'raw':!![],'where':{'id':_0x5c6178[_0xec2d('0x3e')]['id']}},_0x3c1468={};_0x3c1468[_0xec2d('0x2e')]=_[_0xec2d('0x2c')](db[_0xec2d('0x27')][_0xec2d('0x3f')]);_0x3c1468[_0xec2d('0x2b')]=_['keys'](_0x5c6178[_0xec2d('0x2b')]);_0x3c1468[_0xec2d('0x35')]=_[_0xec2d('0x2d')](_0x3c1468[_0xec2d('0x2e')],_0x3c1468[_0xec2d('0x2b')]);_0x943186[_0xec2d('0x30')]=_[_0xec2d('0x2d')](_0x3c1468[_0xec2d('0x2e')],qs['fields'](_0x5c6178[_0xec2d('0x2b')][_0xec2d('0x2f')]));_0x943186[_0xec2d('0x30')]=_0x943186['attributes'][_0xec2d('0x31')]?_0x943186[_0xec2d('0x30')]:_0x3c1468[_0xec2d('0x2e')];if(_0x5c6178[_0xec2d('0x2b')][_0xec2d('0x40')]){_0x943186[_0xec2d('0x41')]=[{'all':!![]}];}_0x943186=_[_0xec2d('0x38')]({},_0x943186,_0x5c6178['options']);return db[_0xec2d('0x27')][_0xec2d('0x42')](_0x943186)[_0xec2d('0x23')](handleEntityNotFound(_0x3ca874,null))[_0xec2d('0x23')](respondWithResult(_0x3ca874,null))['catch'](handleError(_0x3ca874,null));};exports['create']=function(_0x21b8d5,_0x218938){return db[_0xec2d('0x27')][_0xec2d('0x43')](_0x21b8d5[_0xec2d('0x44')],{})[_0xec2d('0x23')](respondWithResult(_0x218938,0xc9))['catch'](handleError(_0x218938,null));};exports[_0xec2d('0x22')]=function(_0x2bcd37,_0x1b8fad){if(_0x2bcd37[_0xec2d('0x44')]['id']){delete _0x2bcd37[_0xec2d('0x44')]['id'];}return db[_0xec2d('0x27')][_0xec2d('0x42')]({'where':{'id':_0x2bcd37[_0xec2d('0x3e')]['id']}})[_0xec2d('0x23')](handleEntityNotFound(_0x1b8fad,null))[_0xec2d('0x23')](saveUpdates(_0x2bcd37[_0xec2d('0x44')],null))['then'](respondWithResult(_0x1b8fad,null))[_0xec2d('0x3c')](handleError(_0x1b8fad,null));};exports[_0xec2d('0x24')]=function(_0x53b3f1,_0x128c0d){return db[_0xec2d('0x27')][_0xec2d('0x42')]({'where':{'id':_0x53b3f1[_0xec2d('0x3e')]['id']}})[_0xec2d('0x23')](handleEntityNotFound(_0x128c0d,null))[_0xec2d('0x23')](removeEntity(_0x128c0d,null))[_0xec2d('0x3c')](handleError(_0x128c0d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index efb83c7..7be8137 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 _0x6076=['../../config/logger','api','moment','bluebird','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x353222,_0x2e391e){var _0x4e304e=function(_0x1bc2d7){while(--_0x1bc2d7){_0x353222['push'](_0x353222['shift']());}};_0x4e304e(++_0x2e391e);}(_0x6076,0xb4));var _0x6607=function(_0x2fb35d,_0x4760a5){_0x2fb35d=_0x2fb35d-0x0;var _0x55e797=_0x6076[_0x2fb35d];return _0x55e797;};'use strict';var _=require(_0x6607('0x0'));var util=require(_0x6607('0x1'));var logger=require(_0x6607('0x2'))(_0x6607('0x3'));var moment=require(_0x6607('0x4'));var BPromise=require(_0x6607('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6607('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6607('0x7'));module[_0x6607('0x8')]=function(_0x25ad19,_0xe77a33){return _0x25ad19[_0x6607('0x9')](_0x6607('0xa'),attributes,{'tableName':_0x6607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6607('0xc')});}; \ No newline at end of file +var _0x2ba2=['../../config/environment','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x2ba2,0xf6));var _0x22ba=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x2ba2[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x22ba('0x0'))('api');var moment=require(_0x22ba('0x1'));var BPromise=require(_0x22ba('0x2'));var rp=require(_0x22ba('0x3'));var fs=require('fs');var path=require(_0x22ba('0x4'));var rimraf=require(_0x22ba('0x5'));var config=require(_0x22ba('0x6'));var attributes=require('./smsApplication.attributes');module[_0x22ba('0x7')]=function(_0xb0792e,_0x527e17){return _0xb0792e[_0x22ba('0x8')]('SmsApplication',attributes,{'tableName':_0x22ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22ba('0xa'),'collate':_0x22ba('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 94eef14..d083a58 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 _0x5b12=['SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x5b12,0xa3));var _0x25b1=function(_0x477f58,_0x3f54d5){_0x477f58=_0x477f58-0x0;var _0x58a11f=_0x5b12[_0x477f58];return _0x58a11f;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SmsApplication,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});} \ No newline at end of file +var _0x6629=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1861d4,_0x173812){var _0xdfa21b=function(_0xe8ab00){while(--_0xe8ab00){_0x1861d4['push'](_0x1861d4['shift']());}};_0xdfa21b(++_0x173812);}(_0x6629,0x1c2));var _0x9662=function(_0x159aae,_0x832fa4){_0x159aae=_0x159aae-0x0;var _0x452932=_0x6629[_0x159aae];return _0x452932;};'use strict';var _=require(_0x9662('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9662('0x1'));var rs=require(_0x9662('0x2'));var fs=require('fs');var Redis=require(_0x9662('0x3'));var db=require(_0x9662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9662('0x5'))(_0x9662('0x6'));var config=require(_0x9662('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x8')][_0x9662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x457681,_0x5ec533,_0x1a1809){return new BPromise(function(_0x58e45a,_0xa866f2){return client[_0x9662('0xa')](_0x457681,_0x1a1809)[_0x9662('0xb')](function(_0x11ae91){logger[_0x9662('0xc')](_0x9662('0xd'),_0x5ec533,_0x9662('0xe'));logger[_0x9662('0xf')](_0x9662('0x10'),_0x5ec533,_0x9662('0xe'),JSON[_0x9662('0x11')](_0x11ae91));if(_0x11ae91['error']){if(_0x11ae91[_0x9662('0x12')]['code']===0x1f4){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x11ae91['error'][_0x9662('0x13')]);return _0xa866f2(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x5ec533,_0x11ae91[_0x9662('0x12')]['message']);return _0x58e45a(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}else{logger[_0x9662('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5ec533,'request\x20sent');_0x58e45a(_0x11ae91['result'][_0x9662('0x13')]);}})[_0x9662('0x14')](function(_0x4930c5){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x4930c5);_0xa866f2(_0x4930c5);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5458342..a344ed6 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 _0x7916=['smsinteraction:update','update','sms','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','smsinteraction:addtags','put','/:id'];(function(_0x12d44c,_0xf11296){var _0x4fde20=function(_0x3c1ad6){while(--_0x3c1ad6){_0x12d44c['push'](_0x12d44c['shift']());}};_0x4fde20(++_0xf11296);}(_0x7916,0x128));var _0x6791=function(_0x51a9f6,_0x38992e){_0x51a9f6=_0x51a9f6-0x0;var _0x164641=_0x7916[_0x51a9f6];return _0x164641;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x12')]);router[_0x6791('0x11')](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x15')),controller['addTags']);router[_0x6791('0x16')](_0x6791('0x17'),auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x18')),controller[_0x6791('0x19')]);router['delete'](_0x6791('0x17'),auth[_0x6791('0x8')](),interaction['tracked'](_0x6791('0x1a'),'smsinteraction:destroy'),controller[_0x6791('0x1b')]);router[_0x6791('0x1c')](_0x6791('0x1d'),auth[_0x6791('0x8')](),controller[_0x6791('0x1e')]);module[_0x6791('0x1f')]=router; \ No newline at end of file +var _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x3c10b7,_0x10fb4a){var _0xbd891b=function(_0x256dc3){while(--_0x256dc3){_0x3c10b7['push'](_0x3c10b7['shift']());}};_0xbd891b(++_0x10fb4a);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x1eba[_0x4715d2];return _0x141811;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 5727ff5..cf4d4d2 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 _0xbea5=['DATE','STRING','out','sequelize','moment','BOOLEAN'];(function(_0x31c74a,_0x7a50c1){var _0x170048=function(_0x57fa00){while(--_0x57fa00){_0x31c74a['push'](_0x31c74a['shift']());}};_0x170048(++_0x7a50c1);}(_0xbea5,0x177));var _0x5bea=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0xbea5[_0x5a7f64];return _0x3d30f1;};'use strict';var Sequelize=require(_0x5bea('0x0'));var moment=require(_0x5bea('0x1'));module['exports']={'closed':{'type':Sequelize[_0x5bea('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5bea('0x3')]},'disposition':{'type':Sequelize[_0x5bea('0x4')]},'secondDisposition':{'type':Sequelize[_0x5bea('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5bea('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5bea('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5bea('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5bea('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9fc5=['ENUM','out','moment','exports','DATE','STRING'];(function(_0x26adfa,_0x5033f6){var _0x2a6579=function(_0x268d2d){while(--_0x268d2d){_0x26adfa['push'](_0x26adfa['shift']());}};_0x2a6579(++_0x5033f6);}(_0x9fc5,0xb6));var _0x59fc=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x9fc5[_0x3f1710];return _0x528458;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x59fc('0x0'));module[_0x59fc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x59fc('0x2')]},'disposition':{'type':Sequelize[_0x59fc('0x3')]},'secondDisposition':{'type':Sequelize[_0x59fc('0x3')]},'thirdDisposition':{'type':Sequelize[_0x59fc('0x3')]},'note':{'type':Sequelize[_0x59fc('0x3')]},'phone':{'type':Sequelize[_0x59fc('0x3')]},'read1stAt':{'type':Sequelize[_0x59fc('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x59fc('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x59fc('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x59fc('0x4')]('in',_0x59fc('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index d521e9e..5d0d4fa 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 _0x2ba6=['error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','SmsInteractionId','all','show','params','SmsInteraction','includeAll','include','merge','options','create','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','System','out','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then'];(function(_0x12a87f,_0x2c18e4){var _0x2c5e04=function(_0x4d0aa6){while(--_0x4d0aa6){_0x12a87f['push'](_0x12a87f['shift']());}};_0x2c5e04(++_0x2c18e4);}(_0x2ba6,0x199));var _0x62ba=function(_0x8f3661,_0x26b9bb){_0x8f3661=_0x8f3661-0x0;var _0x32f28f=_0x2ba6[_0x8f3661];return _0x32f28f;};'use strict';var emlformat=require(_0x62ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62ba('0x1'));var rp=require(_0x62ba('0x2'));var moment=require(_0x62ba('0x3'));var BPromise=require(_0x62ba('0x4'));var Mustache=require('mustache');var util=require(_0x62ba('0x5'));var path=require(_0x62ba('0x6'));var sox=require(_0x62ba('0x7'));var csv=require(_0x62ba('0x8'));var ejs=require(_0x62ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x62ba('0xa'));var crypto=require('crypto');var jsforce=require(_0x62ba('0xb'));var deskjs=require(_0x62ba('0xc'));var toCsv=require(_0x62ba('0x8'));var querystring=require(_0x62ba('0xd'));var Papa=require(_0x62ba('0xe'));var Redis=require('ioredis');var authService=require(_0x62ba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x62ba('0x10'));var pdf=require(_0x62ba('0x11'));var hardwareService=require(_0x62ba('0x12'));var logger=require(_0x62ba('0x13'))(_0x62ba('0x14'));var utils=require(_0x62ba('0x15'));var config=require(_0x62ba('0x16'));var licenseUtil=require(_0x62ba('0x17'));var db=require(_0x62ba('0x18'))['db'];config[_0x62ba('0x19')]=_[_0x62ba('0x1a')](config[_0x62ba('0x19')],{'host':_0x62ba('0x1b'),'port':0x18eb});var socket=require(_0x62ba('0x1c'))(new Redis(config[_0x62ba('0x19')]));require(_0x62ba('0x1d'))[_0x62ba('0x1e')](socket);function respondWithStatusCode(_0x11f7b3,_0x592b9f){_0x592b9f=_0x592b9f||0xcc;return function(_0x1c670f){if(_0x1c670f){return _0x11f7b3[_0x62ba('0x1f')](_0x592b9f);}return _0x11f7b3[_0x62ba('0x20')](_0x592b9f)[_0x62ba('0x21')]();};}function respondWithResult(_0x364a67,_0x218965){_0x218965=_0x218965||0xc8;return function(_0x70e13){if(_0x70e13){return _0x364a67[_0x62ba('0x20')](_0x218965)[_0x62ba('0x22')](_0x70e13);}};}function respondWithFilteredResult(_0x21ce76,_0x5f407f){return function(_0x522eb4){if(_0x522eb4){var _0x52210f=typeof _0x5f407f[_0x62ba('0x23')]==='undefined'&&typeof _0x5f407f[_0x62ba('0x24')]===_0x62ba('0x25');var _0x476cb2=_0x522eb4[_0x62ba('0x26')];var _0x2b006b=_0x52210f?0x0:_0x5f407f[_0x62ba('0x23')];var _0x56725b=_0x52210f?_0x522eb4[_0x62ba('0x26')]:_0x5f407f['offset']+_0x5f407f[_0x62ba('0x24')];var _0x53d3b7;if(_0x56725b>=_0x476cb2){_0x56725b=_0x476cb2;_0x53d3b7=0xc8;}else{_0x53d3b7=0xce;}_0x21ce76['status'](_0x53d3b7);return _0x21ce76[_0x62ba('0x27')]('Content-Range',_0x2b006b+'-'+_0x56725b+'/'+_0x476cb2)[_0x62ba('0x22')](_0x522eb4);}return null;};}function patchUpdates(_0x1d4e29){return function(_0x49d5c6){try{jsonpatch['apply'](_0x49d5c6,_0x1d4e29,!![]);}catch(_0x235882){return BPromise['reject'](_0x235882);}return _0x49d5c6[_0x62ba('0x28')]();};}function saveUpdates(_0x4e5d2e,_0x1cc733){return function(_0x4c250b){if(_0x4c250b){return _0x4c250b[_0x62ba('0x29')](_0x4e5d2e)[_0x62ba('0x2a')](function(_0x1a9a56){return _0x1a9a56;});}return null;};}function removeEntity(_0x181436,_0x1b7dde){return function(_0x33e8e4){if(_0x33e8e4){return _0x33e8e4['destroy']()['then'](function(){_0x181436[_0x62ba('0x20')](0xcc)[_0x62ba('0x21')]();});}};}function handleEntityNotFound(_0x54c6ba,_0x36826d){return function(_0x30d214){if(!_0x30d214){_0x54c6ba[_0x62ba('0x1f')](0x194);}return _0x30d214;};}function handleError(_0x2bf493,_0x2915b7){_0x2915b7=_0x2915b7||0x1f4;return function(_0x2e5b87){logger[_0x62ba('0x2b')](_0x2e5b87[_0x62ba('0x2c')]);if(_0x2e5b87[_0x62ba('0x2d')]){delete _0x2e5b87[_0x62ba('0x2d')];}_0x2bf493['status'](_0x2915b7)[_0x62ba('0x2e')](_0x2e5b87);};}function getInteractionUsers(_0x49311a,_0x670084){return new BPromise(function(_0x368333,_0x5bf7a9){try{if(_0x670084[_0x49311a['id']]){_0x49311a[_0x62ba('0x2f')]=_[_0x62ba('0x30')](_0x670084[_0x49311a['id']],function(_0x40fc34){return{'id':_0x40fc34['id'],'fullname':_0x40fc34[_0x62ba('0x31')]};});}}catch(_0x1a524a){_0x5bf7a9(_0x1a524a);}_0x368333(_0x49311a);});}function getInteractionTags(_0x5c098c,_0x5397c8){return new BPromise(function(_0x3f581d,_0xedd897){try{if(_0x5c098c[_0x62ba('0x32')]){_0x5c098c['Tags']=[];_0x5c098c['TagIds']['split'](',')['forEach'](function(_0x308c31){_0x5c098c[_0x62ba('0x33')][_0x62ba('0x34')](_0x5397c8[_0x308c31]);});}delete _0x5c098c[_0x62ba('0x32')];}catch(_0x1f7599){_0xedd897(_0x1f7599);}_0x3f581d(_0x5c098c);});}function updateSmsInteraction(_0x3b7dcd,_0x508af2,_0x3694db){return new BPromise(function(_0x589647,_0x823a5f){return getInteractionUsers(_0x3b7dcd,_0x3694db)['then'](function(_0x38d9b9){return getInteractionTags(_0x38d9b9,_0x508af2);})['then'](function(_0x262b2c){_0x589647(_0x262b2c);})[_0x62ba('0x35')](function(_0x1f6e8c){_0x823a5f(_0x1f6e8c);});});}exports['index']=function(_0xf51b6b,_0x161ac8){var _0x126c98={},_0xe38c34={},_0x7f8038={'count':0x0,'rows':[]};var _0xc0f29b=_[_0x62ba('0x30')](db['SmsInteraction'][_0x62ba('0x36')],function(_0x4283c4){return{'name':_0x4283c4[_0x62ba('0x37')],'type':_0x4283c4[_0x62ba('0x38')][_0x62ba('0x39')]};});_0xe38c34[_0x62ba('0x3a')]=_['map'](_0xc0f29b,_0x62ba('0x2d'));_0xe38c34[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0xf51b6b[_0x62ba('0x3b')]);_0xe38c34[_0x62ba('0x3d')]=_[_0x62ba('0x3e')](_0xe38c34[_0x62ba('0x3a')],_0xe38c34['query']);_0x126c98[_0x62ba('0x3f')]=_[_0x62ba('0x3e')](_0xe38c34[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x40')]));_0x126c98[_0x62ba('0x3f')]=_0x126c98['attributes'][_0x62ba('0x41')]?_0x126c98[_0x62ba('0x3f')]:_0xe38c34[_0x62ba('0x3a')];if(!_0xf51b6b[_0x62ba('0x3b')]['hasOwnProperty'](_0x62ba('0x42'))){_0x126c98[_0x62ba('0x24')]=qs[_0x62ba('0x24')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x24')]);_0x126c98[_0x62ba('0x23')]=qs[_0x62ba('0x23')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x23')]);}_0x126c98[_0x62ba('0x43')]=qs[_0x62ba('0x44')](_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x44')]);_0x126c98['where']=qs[_0x62ba('0x3d')](_[_0x62ba('0x45')](_0xf51b6b[_0x62ba('0x3b')],_0xe38c34[_0x62ba('0x3d')]),_0xc0f29b);var _0x4f3dee=[];var _0x37c97a=squel[_0x62ba('0x46')]()[_0x62ba('0x47')]('id')['field']('name')['field'](_0x62ba('0x48'))['from'](_0x62ba('0x49'));var _0x1e1539=squel[_0x62ba('0x46')]()[_0x62ba('0x47')](_0x62ba('0x4a'))[_0x62ba('0x47')](_0x62ba('0x4b'))['field'](_0x62ba('0x4c'))[_0x62ba('0x4d')](_0x62ba('0x4e'),'ui')[_0x62ba('0x4f')](_0x62ba('0x50'),'u',_0x62ba('0x51'));var _0x3e78a2=squel['select']()[_0x62ba('0x4d')](_0x62ba('0x52'),'i')[_0x62ba('0x4f')](_0x62ba('0x53'),'c',_0x62ba('0x54'))['left_join'](_0x62ba('0x50'),'o',_0x62ba('0x55'))[_0x62ba('0x4f')]('sms_accounts','a',_0x62ba('0x56'))[_0x62ba('0x4f')]('sms_messages','me',_0x62ba('0x57'))[_0x62ba('0x4f')](_0x62ba('0x58'),'it',_0x62ba('0x59'))['left_join'](_0x62ba('0x49'),'t','t.id\x20=\x20it.TagId');var _0x285c61=squel['expr']();var _0x2ae52a=[];var _0x466d8c=squel[_0x62ba('0x5a')]();var _0xb22eec;if(_0xf51b6b['query']['search']){_0xb22eec=as[_0x62ba('0x5b')](_0xf51b6b[_0x62ba('0x3b')]['search']);var _0x9db8ed=_0xb22eec[_0x62ba('0x5c')];for(var _0x5cd152=0x0;_0x5cd152<_0xb22eec[_0x62ba('0x5d')][_0x62ba('0x41')];_0x5cd152++){var _0x429b46=_0xb22eec[_0x62ba('0x5d')][_0x5cd152];var _0x222a87='i';var _0x34a469=_['find'](_0xc0f29b,[_0x62ba('0x2d'),_0x429b46[_0x62ba('0x47')]]);if(!_0x34a469){switch(_0x429b46[_0x62ba('0x47')]){case _0x62ba('0x5e'):if(_0x429b46[_0x62ba('0x5f')]==0x1){_0x3e78a2[_0x62ba('0x60')]('`'+_0x429b46['field']+'`\x20=\x200');}else{_0x3e78a2['having']('`'+_0x429b46[_0x62ba('0x47')]+_0x62ba('0x61'));}break;case'Contact':if(_0x429b46[_0x62ba('0x62')]===_0x62ba('0x63')){if(_0x429b46[_0x62ba('0x5f')][_0x62ba('0x64')]('\x20')['length']>0x1){_0x285c61[_0x9db8ed](_0x62ba('0x65'),qs[_0x62ba('0x66')](_0x429b46['value']),null);}else{var _0x450b99='%'+_0x429b46[_0x62ba('0x5f')]+'%';_0x285c61[_0x9db8ed](_0x62ba('0x67'),_0x450b99,_0x450b99,_0x450b99);}}else{_0x34a469=_['find'](_0xc0f29b,[_0x62ba('0x2d'),'ContactId']);_0x429b46[_0x62ba('0x47')]='ContactId';_0x395687=as[_0x62ba('0x68')](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687['value'][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}break;case'Tag':var _0x232eb8=_0x429b46[_0x62ba('0x5f')][_0x62ba('0x64')](',')['map'](function(_0x23fb19){return Number(_0x23fb19);});_0x232eb8[_0x62ba('0x6b')](function(_0x5b8184){_0x466d8c['or'](_0x62ba('0x6c'),'%,'+_0x5b8184+',%');});_0x2ae52a=_['union'](_0x2ae52a,_0x232eb8);break;case _0x62ba('0x6d'):if(_0x429b46['operator']===_0x62ba('0x63')){_0x285c61[_0x9db8ed](_0x62ba('0x6e'),'%'+_0x429b46['value']+'%',null);}else{_0x34a469=_[_0x62ba('0x6f')](_0xc0f29b,[_0x62ba('0x2d'),'UserId']);_0x429b46[_0x62ba('0x47')]=_0x62ba('0x70');_0x395687=as['buildExpression'](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}break;case _0x62ba('0x71'):_0x395687=as[_0x62ba('0x68')]('me',null,_0x429b46);_0x285c61[_0x9db8ed](_0x395687['text'],_0x395687[_0x62ba('0x5f')][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);break;}}else{var _0x395687=as['buildExpression'](_0x222a87,_0x34a469[_0x62ba('0x38')],_0x429b46);_0x285c61[_0x9db8ed](_0x395687[_0x62ba('0x69')],_0x395687['value'][_0x62ba('0x6a')],_0x395687[_0x62ba('0x5f')][_0x62ba('0x21')]);}}}else{var _0x37fe7a=_(_0xf51b6b['query'])[_0x62ba('0x3c')]()[_0x62ba('0x30')](function(_0xb91301){return _[_0x62ba('0x72')](_0xc0f29b,[_0x62ba('0x2d'),_0xb91301])?_0xb91301:undefined;})[_0x62ba('0x73')]()['value']();if(!_[_0x62ba('0x74')](_0x37fe7a)){_0x37fe7a[_0x62ba('0x6b')](function(_0x3f3421){if(_0x3f3421===_0x62ba('0x75')){_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x77'),[][_0x62ba('0x78')](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421]));}else if(_0x3f3421===_0x62ba('0x79')){var _0x5cf9fa=JSON['parse'](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421])[_0x62ba('0x7a')];var _0x15507e=JSON[_0x62ba('0x7b')](_0xf51b6b[_0x62ba('0x3b')][_0x3f3421])['$lte'];_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x7c'),_0x5cf9fa,_0x15507e);}else{if(_0xf51b6b[_0x62ba('0x3b')][_0x3f3421]==='null'){_0x3e78a2[_0x62ba('0x76')]('i.'+_0x3f3421+_0x62ba('0x7d'));}else{_0x3e78a2[_0x62ba('0x76')]('i.'+_0x3f3421+_0x62ba('0x7e'),_0xf51b6b['query'][_0x3f3421]);}}});}if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x7f')]){if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x7f')]==0x1){_0x3e78a2[_0x62ba('0x60')](_0x62ba('0x80'));}else{_0x3e78a2['having'](_0x62ba('0x81'));}}if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]){_0x2ae52a=_['isArray'](_0xf51b6b['query'][_0x62ba('0x82')])?_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]:new Array(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x82')]);_0x2ae52a[_0x62ba('0x6b')](function(_0x32e56c){_0x466d8c['or'](_0x62ba('0x6c'),'%,'+_0x32e56c+',%');});}if(_0xf51b6b[_0x62ba('0x3b')]['filter']){var _0x3a6e19=_0xf51b6b[_0x62ba('0x3b')]['filter'][_0x62ba('0x83')]('\x5c','\x5c\x5c')[_0x62ba('0x83')](/'/g,'\x27\x27');if(qs[_0x62ba('0x84')](_0x3a6e19)){_0x285c61['or'](_0x62ba('0x85'),_0x3a6e19+'%')['or'](_0x62ba('0x86'),_0x3a6e19+'%');}else{_0x285c61['or'](_0x62ba('0x87'),qs[_0x62ba('0x66')](_0x3a6e19))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3a6e19+'%');}}}_0x3e78a2[_0x62ba('0x76')](_0x285c61);_0x3e78a2[_0x62ba('0x88')](_0x62ba('0x89'));var _0x86a068={'type':db[_0x62ba('0x8a')][_0x62ba('0x8b')]['SELECT'],'raw':!![]};var _0x3aaaf4=_0x3e78a2['clone']();_0x3aaaf4[_0x62ba('0x47')](_0x62ba('0x89'));_0x3aaaf4[_0x62ba('0x47')](_0x62ba('0x8c'),_0x62ba('0x5e'));if(_0x126c98[_0x62ba('0x43')]){_0x126c98['order'][_0x62ba('0x6b')](function(_0x2371f3){var _0x135c47=_0x2371f3[0x0]===_0x62ba('0x8d')?_0x2371f3[0x0]:'i.'+_0x2371f3[0x0];_0x3e78a2[_0x62ba('0x43')](_0x135c47,_0x2371f3[0x1]===_0x62ba('0x8e')?![]:!![]);});}if(!_[_0x62ba('0x74')](_0x2ae52a)){_0x3e78a2[_0x62ba('0x60')](_0x466d8c);_0x3aaaf4[_0x62ba('0x76')]('t.id\x20IN\x20?',_0x2ae52a);}BPromise[_0x62ba('0x8f')]()[_0x62ba('0x2a')](function(){if(!_0xb22eec){if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x75')])return;_0x3aaaf4['where'](_0x62ba('0x90'));_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x90'));return;}if(_0xf51b6b[_0x62ba('0x91')][_0x62ba('0x92')]!==_0x62ba('0x93'))return;return _0xf51b6b[_0x62ba('0x91')][_0x62ba('0x94')]({'attributes':['id'],'raw':!![]})[_0x62ba('0x2a')](function(_0xe2afec){if(_[_0x62ba('0x74')](_0xe2afec)){_0x3aaaf4[_0x62ba('0x76')](_0x62ba('0x95'));_0x3e78a2[_0x62ba('0x76')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x3aaaf4[_0x62ba('0x76')]('i.SmsAccountId\x20IN\x20?',_[_0x62ba('0x30')](_0xe2afec,'id'));_0x3e78a2[_0x62ba('0x76')](_0x62ba('0x77'),_[_0x62ba('0x30')](_0xe2afec,'id'));}});})[_0x62ba('0x2a')](function(){if(_0xf51b6b[_0x62ba('0x91')][_0x62ba('0x92')]==='agent'&&!_0xb22eec&&!_0xf51b6b[_0x62ba('0x3b')]['SmsAccountId'])return[];return db[_0x62ba('0x96')][_0x62ba('0x3b')](_0x3aaaf4['toString'](),_0x86a068);})[_0x62ba('0x2a')](function(_0x95308a){_0x7f8038['count']=_0x95308a[_0x62ba('0x41')];if(_0x7f8038[_0x62ba('0x26')]===0x0)return[];return db[_0x62ba('0x96')]['query'](_0x37c97a[_0x62ba('0x97')](),_0x86a068)[_0x62ba('0x2a')](function(_0x270536){_0x4f3dee=_[_0x62ba('0x98')](_0x270536,'id');_0x86a068=_['merge'](_0x86a068,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf51b6b[_0x62ba('0x3b')][_0x62ba('0x40')]){_0x126c98[_0x62ba('0x3f')][_0x62ba('0x6b')](function(_0x29d751){_0x3e78a2[_0x62ba('0x47')]('i.'+_0x29d751);});}else{_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x8c'),'unreadMessages');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x99'),'Account.key');_0x3e78a2[_0x62ba('0x47')]('a.mandatoryDisposition',_0x62ba('0x9a'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9b'),_0x62ba('0x8d'));_0x3e78a2['field']('i.*');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9c'),'Contact.firstName');_0x3e78a2['field'](_0x62ba('0x9d'),_0x62ba('0x9e'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0x9f'),_0x62ba('0xa0'));_0x3e78a2[_0x62ba('0x47')]('c.phone','Contact.phone');_0x3e78a2[_0x62ba('0x47')]('c.mobile',_0x62ba('0xa1'));_0x3e78a2[_0x62ba('0x47')]('c.fax',_0x62ba('0xa2'));_0x3e78a2[_0x62ba('0x47')](_0x62ba('0xa3'),_0x62ba('0xa4'));_0x3e78a2['field'](_0x62ba('0xa5'),'Owner.internal');_0x3e78a2[_0x62ba('0x47')](_0x62ba('0xa6'),_0x62ba('0x32'));}if(_0x126c98[_0x62ba('0x24')])_0x3e78a2[_0x62ba('0x24')](_0x126c98[_0x62ba('0x24')]);if(_0x126c98[_0x62ba('0x23')])_0x3e78a2[_0x62ba('0x23')](_0x126c98[_0x62ba('0x23')]);return db['sequelize'][_0x62ba('0x3b')](_0x3e78a2[_0x62ba('0x97')](),_0x86a068);})[_0x62ba('0x2a')](function(_0x39232f){if(_0x39232f[_0x62ba('0x41')]>0x0)_0x1e1539[_0x62ba('0x76')]('ui.SmsInteractionId\x20IN\x20?',_[_0x62ba('0x30')](_0x39232f,'id'));return db[_0x62ba('0x96')][_0x62ba('0x3b')](_0x1e1539[_0x62ba('0x97')](),_0x86a068)[_0x62ba('0x2a')](function(_0x5f566d){var _0x39b31e=_['groupBy'](_0x5f566d,_0x62ba('0xa7'));var _0x35407a=[];_0x39232f[_0x62ba('0x6b')](function(_0x50eaf7){_0x35407a[_0x62ba('0x34')](updateSmsInteraction(_0x50eaf7,_0x4f3dee,_0x39b31e));});return BPromise[_0x62ba('0xa8')](_0x35407a);});});})[_0x62ba('0x2a')](function(_0x440dde){_0x7f8038['rows']=_0x440dde;return _0x7f8038;})['then'](respondWithFilteredResult(_0x161ac8,_0x126c98))[_0x62ba('0x35')](handleError(_0x161ac8,null));};exports[_0x62ba('0xa9')]=function(_0x5c2ca7,_0x45358b){var _0xdd41c2={'raw':![],'where':{'id':_0x5c2ca7[_0x62ba('0xaa')]['id']}},_0x12891a={};_0x12891a[_0x62ba('0x3a')]=_[_0x62ba('0x3c')](db[_0x62ba('0xab')][_0x62ba('0x36')]);_0x12891a[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0x5c2ca7['query']);_0x12891a['filters']=_[_0x62ba('0x3e')](_0x12891a['model'],_0x12891a['query']);_0xdd41c2['attributes']=_[_0x62ba('0x3e')](_0x12891a[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0x5c2ca7[_0x62ba('0x3b')][_0x62ba('0x40')]));_0xdd41c2['attributes']=_0xdd41c2[_0x62ba('0x3f')]['length']?_0xdd41c2['attributes']:_0x12891a[_0x62ba('0x3a')];if(_0x5c2ca7[_0x62ba('0x3b')][_0x62ba('0xac')]){_0xdd41c2[_0x62ba('0xad')]=[{'all':!![]}];}_0xdd41c2=_[_0x62ba('0xae')]({},_0xdd41c2,_0x5c2ca7[_0x62ba('0xaf')]);return db[_0x62ba('0xab')][_0x62ba('0x6f')](_0xdd41c2)[_0x62ba('0x2a')](handleEntityNotFound(_0x45358b,null))['then'](respondWithResult(_0x45358b,null))[_0x62ba('0x35')](handleError(_0x45358b,null));};exports[_0x62ba('0xb0')]=function(_0x136da2,_0x48ce13){return db[_0x62ba('0xab')]['create'](_0x136da2[_0x62ba('0x71')],{})[_0x62ba('0x2a')](respondWithResult(_0x48ce13,0xc9))[_0x62ba('0x35')](handleError(_0x48ce13,null));};exports[_0x62ba('0x29')]=function(_0x48f411,_0x5a850b){if(_0x48f411[_0x62ba('0x71')]['id']){delete _0x48f411[_0x62ba('0x71')]['id'];}return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x48f411[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x5a850b,null))[_0x62ba('0x2a')](saveUpdates(_0x48f411[_0x62ba('0x71')],null))[_0x62ba('0x2a')](respondWithResult(_0x5a850b,null))['catch'](handleError(_0x5a850b,null));};exports[_0x62ba('0xb1')]=function(_0x3018f8,_0x312a5a){return db[_0x62ba('0xab')]['find']({'where':{'id':_0x3018f8[_0x62ba('0xaa')]['id']}})['then'](handleEntityNotFound(_0x312a5a,null))[_0x62ba('0x2a')](removeEntity(_0x312a5a,null))[_0x62ba('0x35')](handleError(_0x312a5a,null));};exports[_0x62ba('0xb2')]=function(_0x5875c0,_0x27c47f){return db[_0x62ba('0xab')][_0x62ba('0xb2')]()['then'](respondWithResult(_0x27c47f,null))[_0x62ba('0x35')](handleError(_0x27c47f,null));};exports[_0x62ba('0xb3')]=function(_0x4b9083,_0x529c3e,_0x93fbc1){return db[_0x62ba('0xb4')]['find']({'where':{'id':_0x4b9083[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x529c3e,null))[_0x62ba('0x2a')](function(_0xc2562e){if(_0xc2562e){return _0xc2562e[_0x62ba('0xb3')](_0x4b9083['body'][_0x62ba('0xb5')],_[_0x62ba('0xb6')](_0x4b9083[_0x62ba('0x71')],['ids','id'])||{});}})[_0x62ba('0x2a')](respondWithResult(_0x529c3e,null))[_0x62ba('0x35')](handleError(_0x529c3e,null));};exports[_0x62ba('0xb7')]=function(_0x5d2d34,_0xff3f48,_0x146180){var _0x46c34c={'raw':![],'where':{}};var _0x462299={};var _0x31d0aa={'count':0x0,'rows':[]};return db[_0x62ba('0xab')]['findOne']({'where':{'id':_0x5d2d34[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0xff3f48,null))[_0x62ba('0x2a')](function(_0x5d44c7){if(_0x5d44c7){_0x462299[_0x62ba('0x3a')]=_['keys'](db[_0x62ba('0xb4')][_0x62ba('0x36')]);_0x462299[_0x62ba('0x3b')]=_[_0x62ba('0x3c')](_0x5d2d34['query']);_0x462299[_0x62ba('0x3d')]=_[_0x62ba('0x3e')](_0x462299[_0x62ba('0x3a')],_0x462299[_0x62ba('0x3b')]);_0x46c34c['attributes']=_[_0x62ba('0x3e')](_0x462299[_0x62ba('0x3a')],qs[_0x62ba('0x40')](_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x40')]));_0x46c34c[_0x62ba('0x3f')]=_0x46c34c[_0x62ba('0x3f')]['length']?_0x46c34c[_0x62ba('0x3f')]:_0x462299[_0x62ba('0x3a')];if(!_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xb8')](_0x62ba('0x42'))){_0x46c34c[_0x62ba('0x24')]=qs[_0x62ba('0x24')](_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x24')]);_0x46c34c[_0x62ba('0x23')]=qs[_0x62ba('0x23')](_0x5d2d34['query'][_0x62ba('0x23')]);}_0x46c34c[_0x62ba('0x43')]=qs['sort'](_0x5d2d34[_0x62ba('0x3b')]['sort']);_0x46c34c[_0x62ba('0x76')]=qs['filters'](_[_0x62ba('0x45')](_0x5d2d34[_0x62ba('0x3b')],_0x462299['filters']));_0x46c34c[_0x62ba('0x76')]['SmsInteractionId']=_0x5d44c7['id'];if(_0x5d2d34['query'][_0x62ba('0xb9')]){_0x46c34c[_0x62ba('0x76')]=_[_0x62ba('0xae')](_0x46c34c['where'],{'$or':_[_0x62ba('0x30')](_0x46c34c['attributes'],function(_0x8fd9a5){var _0x136ecf={};_0x136ecf[_0x8fd9a5]={'$like':'%'+_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xb9')]+'%'};return _0x136ecf;})});}if(_0x5d2d34['query'][_0x62ba('0x7a')]){var _0x18384f=_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0x7a')][_0x62ba('0x64')](',');var _0x2c8f5f={};_0x2c8f5f[_0x18384f[0x0]]={'$gte':moment(_0x18384f[0x1])[_0x62ba('0xba')](_0x62ba('0xbb'))};_0x46c34c[_0x62ba('0x76')]=_['merge'](_0x46c34c['where'],_0x2c8f5f);}_0x46c34c=_['merge']({},_0x46c34c,_0x5d2d34[_0x62ba('0xaf')]);return db[_0x62ba('0xb4')]['count']({'where':_0x46c34c[_0x62ba('0x76')]})[_0x62ba('0x2a')](function(_0x4e2478){_0x31d0aa[_0x62ba('0x26')]=_0x4e2478;if(_0x5d2d34[_0x62ba('0x3b')][_0x62ba('0xac')]){_0x46c34c['include']=[{'all':!![]}];}return db[_0x62ba('0xb4')][_0x62ba('0xbc')](_0x46c34c);})['then'](function(_0x273cb5){_0x31d0aa[_0x62ba('0xbd')]=_0x273cb5;return _0x31d0aa;});}})[_0x62ba('0x2a')](respondWithFilteredResult(_0xff3f48,_0x46c34c))[_0x62ba('0x35')](handleError(_0xff3f48,null));};exports[_0x62ba('0xbe')]=function(_0x3de014,_0x1048f1,_0x3ea29e){return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x3de014['params']['id']}})['then'](handleEntityNotFound(_0x1048f1,null))[_0x62ba('0x2a')](function(_0x17e01a){if(_0x17e01a){return _0x17e01a[_0x62ba('0xbf')](_0x3de014['body'][_0x62ba('0xb5')],_[_0x62ba('0xb6')](_0x3de014[_0x62ba('0x71')],[_0x62ba('0xb5'),'id'])||{})[_0x62ba('0xc0')](function(){return db['Tag']['findAll']({'attributes':['id',_0x62ba('0x2d'),_0x62ba('0x48')],'where':{'id':_0x3de014[_0x62ba('0x71')]['ids']}});})[_0x62ba('0x2a')](function(_0x585196){socket[_0x62ba('0xc1')]('smsInteractionTags:save',{'id':Number(_0x3de014[_0x62ba('0xaa')]['id']),'tags':_0x585196||[]});return{'id':Number(_0x3de014[_0x62ba('0xaa')]['id']),'tags':_0x585196||[]};});}})[_0x62ba('0x2a')](respondWithResult(_0x1048f1,null))[_0x62ba('0x35')](handleError(_0x1048f1,null));};exports[_0x62ba('0xc2')]=function(_0x5af143,_0x31264b,_0xed9c6d){return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x5af143[_0x62ba('0xaa')]['id']}})[_0x62ba('0x2a')](handleEntityNotFound(_0x31264b,null))[_0x62ba('0x2a')](function(_0x514ef1){if(_0x514ef1){return _0x514ef1['removeTags'](_0x5af143[_0x62ba('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x31264b,null))[_0x62ba('0x35')](handleError(_0x31264b,null));};exports[_0x62ba('0xc3')]=function(_0x5842fa,_0x20b17b){var _0x5ebbdc=moment()[_0x62ba('0xc4')]()[_0x62ba('0x97')]();var _0x4ab707=path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],_0x62ba('0xc7'),_0x62ba('0xc8'),_0x62ba('0xc9'));var _0x16790f=path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],_0x62ba('0xc7'),_0x62ba('0xc8'),_0x62ba('0xca'));var _0x2ad5ae=path[_0x62ba('0xc5')](_0x4ab707,_0x5ebbdc);var _0x10a937=util[_0x62ba('0xba')]('transcript-%d-%s.zip',_0x5842fa[_0x62ba('0xaa')]['id'],_0x5ebbdc);var _0x588d01=path['join'](_0x4ab707,_0x10a937);var _0x2c3d38=[];_0x2c3d38['push']({'model':db[_0x62ba('0x6d')],'as':_0x62ba('0x6d'),'attributes':['id',_0x62ba('0x31')],'raw':!![]});_0x2c3d38['push']({'model':db['CmContact'],'as':_0x62ba('0xcb'),'attributes':['id',_0x62ba('0xcc'),_0x62ba('0xcd')],'raw':!![]});var _0x1c4393=[{'model':db['SmsMessage'],'as':_0x62ba('0xce'),'attributes':['id','body',_0x62ba('0x79'),_0x62ba('0xcf'),_0x62ba('0xd0'),_0x62ba('0x7f')],'include':_0x2c3d38}];_0x1c4393['push']({'model':db[_0x62ba('0xd1')],'as':_0x62ba('0xd2'),'attributes':['id',_0x62ba('0x2d')]});_0x1c4393[_0x62ba('0x34')]({'model':db[_0x62ba('0x6d')],'as':'Owner','attributes':['id',_0x62ba('0x31')]});return db[_0x62ba('0xab')][_0x62ba('0x6f')]({'where':{'id':_0x5842fa['params']['id']},'include':_0x1c4393})['then'](handleEntityNotFound(_0x20b17b,null))['then'](function(_0x58532f){if(_0x58532f){var _0x104f28=_0x58532f[_0x62ba('0xd3')]({'plain':!![]});fs[_0x62ba('0xd4')](_0x2ad5ae);var _0x1c5dd9={'channel':_0x62ba('0xd5'),'account':_0x104f28[_0x62ba('0xd2')][_0x62ba('0x2d')],'agent':_0x104f28[_0x62ba('0xd6')]?_0x104f28[_0x62ba('0xd6')]['fullname']:_0x62ba('0xd7'),'createdAt':moment(_0x104f28[_0x62ba('0x79')])[_0x62ba('0xba')](_0x62ba('0xbb'))['toString'](),'closedAt':_0x104f28['closed']?moment(_0x104f28[_0x62ba('0xd8')])[_0x62ba('0xba')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x104f28[_0x62ba('0xd9')],'messages':_(_0x104f28[_0x62ba('0xce')])[_0x62ba('0xb9')]({'secret':![]})['map'](function(_0x3b555b){return{'date':moment(_0x3b555b['createdAt'])[_0x62ba('0xba')](_0x62ba('0xbb'))['toString'](),'sender':_0x3b555b['direction']==='out'?_0x3b555b[_0x62ba('0x6d')]?_0x3b555b['User'][_0x62ba('0x31')]:_0x62ba('0xda'):_0x3b555b[_0x62ba('0xcb')][_0x62ba('0xcc')]+(_0x3b555b[_0x62ba('0xcb')][_0x62ba('0xcd')]?'\x20'+_0x3b555b[_0x62ba('0xcb')]['lastName']:''),'body':_0x3b555b[_0x62ba('0x71')],'direction':_0x3b555b[_0x62ba('0xcf')]===_0x62ba('0xdb')?'A':'C','secret':_0x3b555b[_0x62ba('0xd0')],'read':_0x3b555b[_0x62ba('0x7f')]};})['value']()};return ejs['renderFile'](path[_0x62ba('0xc5')](config[_0x62ba('0xc6')],'server',_0x62ba('0xdc'),'downloadInteraction.ejs'),{'interaction':_0x1c5dd9})['then'](function(_0x353a2d){var _0xc6e880=path[_0x62ba('0xc5')](_0x2ad5ae,_0x62ba('0xdd')+_0x104f28['id']+'-'+_0x5ebbdc+_0x62ba('0xde'));var _0x245b03={'path':_0xc6e880,'channel':_0x62ba('0xd5'),'interactionId':_0x104f28['id']};return pdf[_0x62ba('0xdf')](_0x353a2d,_0x245b03);})['then'](function(){return new BPromise(function(_0x3f74c8,_0x58d04e){zipdir(_0x2ad5ae,{'saveTo':_0x588d01},function(_0x2fd803,_0x4e4c4a){if(_0x2fd803)return _0x58d04e(_0x2fd803);return _0x3f74c8(_0x4e4c4a);});})['then'](function(){return new BPromise(function(_0x2111bb,_0x157ff1){rimraf(_0x2ad5ae,function(_0x3e8694){if(_0x3e8694)_0x157ff1(_0x3e8694);return _0x2111bb();});});})[_0x62ba('0x2a')](function(){return _0x20b17b[_0x62ba('0xc3')](_0x588d01,_0x10a937,function(_0x1226d1){if(_0x1226d1){console['log'](_0x62ba('0xe0'),_0x1226d1);}else{fs[_0x62ba('0xe1')](_0x588d01);}});});});}else{return _0x20b17b['sendStatus'](0xc8);}})['catch'](handleError(_0x20b17b,null));}; \ No newline at end of file +var _0x841e=['find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','clone','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','groupBy','SmsInteractionId','push','rows','show','params','includeAll','include','merge','options','create','update','SmsMessage','addMessage','ids','omit','getMessages','format','findAll','spread','emit','smsInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','CmContact','firstName','Messages','direction','SmsAccount','Account','get','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','System','lastName','secret','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','split','forEach','catch','index','map','SmsInteraction','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x841e,0x15b));var _0xe841=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x841e[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xe841('0x0'));var rimraf=require(_0xe841('0x1'));var zipdir=require(_0xe841('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe841('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe841('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe841('0x5'));var csv=require(_0xe841('0x6'));var ejs=require(_0xe841('0x7'));var fs=require('fs');var fs_extra=require(_0xe841('0x8'));var _=require(_0xe841('0x9'));var squel=require('squel');var crypto=require(_0xe841('0xa'));var jsforce=require(_0xe841('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe841('0x6'));var querystring=require(_0xe841('0xc'));var Papa=require(_0xe841('0xd'));var Redis=require(_0xe841('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe841('0xf'));var as=require(_0xe841('0x10'));var pdf=require(_0xe841('0x11'));var hardwareService=require(_0xe841('0x12'));var logger=require(_0xe841('0x13'))(_0xe841('0x14'));var utils=require(_0xe841('0x15'));var config=require(_0xe841('0x16'));var licenseUtil=require(_0xe841('0x17'));var db=require(_0xe841('0x18'))['db'];config[_0xe841('0x19')]=_[_0xe841('0x1a')](config[_0xe841('0x19')],{'host':_0xe841('0x1b'),'port':0x18eb});var socket=require(_0xe841('0x1c'))(new Redis(config[_0xe841('0x19')]));require(_0xe841('0x1d'))[_0xe841('0x1e')](socket);function respondWithStatusCode(_0x81081d,_0x5b1c6e){_0x5b1c6e=_0x5b1c6e||0xcc;return function(_0x1ff15c){if(_0x1ff15c){return _0x81081d[_0xe841('0x1f')](_0x5b1c6e);}return _0x81081d[_0xe841('0x20')](_0x5b1c6e)[_0xe841('0x21')]();};}function respondWithResult(_0x53d77a,_0x4b5d20){_0x4b5d20=_0x4b5d20||0xc8;return function(_0x1786ea){if(_0x1786ea){return _0x53d77a[_0xe841('0x20')](_0x4b5d20)['json'](_0x1786ea);}};}function respondWithFilteredResult(_0x38dbf9,_0x4b1f76){return function(_0x2d8bd6){if(_0x2d8bd6){var _0x2b5543=typeof _0x4b1f76[_0xe841('0x22')]===_0xe841('0x23')&&typeof _0x4b1f76[_0xe841('0x24')]==='undefined';var _0x1b40d3=_0x2d8bd6[_0xe841('0x25')];var _0x25558f=_0x2b5543?0x0:_0x4b1f76[_0xe841('0x22')];var _0x383609=_0x2b5543?_0x2d8bd6[_0xe841('0x25')]:_0x4b1f76[_0xe841('0x22')]+_0x4b1f76[_0xe841('0x24')];var _0x357553;if(_0x383609>=_0x1b40d3){_0x383609=_0x1b40d3;_0x357553=0xc8;}else{_0x357553=0xce;}_0x38dbf9[_0xe841('0x20')](_0x357553);return _0x38dbf9[_0xe841('0x26')](_0xe841('0x27'),_0x25558f+'-'+_0x383609+'/'+_0x1b40d3)[_0xe841('0x28')](_0x2d8bd6);}return null;};}function patchUpdates(_0x14dd18){return function(_0x14de04){try{jsonpatch[_0xe841('0x29')](_0x14de04,_0x14dd18,!![]);}catch(_0x22849e){return BPromise[_0xe841('0x2a')](_0x22849e);}return _0x14de04[_0xe841('0x2b')]();};}function saveUpdates(_0x2dc838,_0x4dc733){return function(_0x48fa95){if(_0x48fa95){return _0x48fa95['update'](_0x2dc838)[_0xe841('0x2c')](function(_0x56c7a5){return _0x56c7a5;});}return null;};}function removeEntity(_0x21f392,_0x58a7b0){return function(_0x2c5fc1){if(_0x2c5fc1){return _0x2c5fc1[_0xe841('0x2d')]()['then'](function(){_0x21f392[_0xe841('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12109d,_0x1dda27){return function(_0x279517){if(!_0x279517){_0x12109d['sendStatus'](0x194);}return _0x279517;};}function handleError(_0x3a8d2b,_0x406d88){_0x406d88=_0x406d88||0x1f4;return function(_0x5da558){logger[_0xe841('0x2e')](_0x5da558[_0xe841('0x2f')]);if(_0x5da558[_0xe841('0x30')]){delete _0x5da558['name'];}_0x3a8d2b['status'](_0x406d88)[_0xe841('0x31')](_0x5da558);};}function getInteractionUsers(_0x17c9c4,_0x3dcc24){return new BPromise(function(_0x5098d6,_0x1bf3cd){try{if(_0x3dcc24[_0x17c9c4['id']]){_0x17c9c4[_0xe841('0x32')]=_['map'](_0x3dcc24[_0x17c9c4['id']],function(_0x5bdebb){return{'id':_0x5bdebb['id'],'fullname':_0x5bdebb[_0xe841('0x33')]};});}}catch(_0x223f5b){_0x1bf3cd(_0x223f5b);}_0x5098d6(_0x17c9c4);});}function getInteractionTags(_0x518814,_0x1da1ea){return new BPromise(function(_0x4fd3d5,_0x27d219){try{if(_0x518814[_0xe841('0x34')]){_0x518814['Tags']=[];_0x518814[_0xe841('0x34')][_0xe841('0x35')](',')[_0xe841('0x36')](function(_0x557978){_0x518814['Tags']['push'](_0x1da1ea[_0x557978]);});}delete _0x518814[_0xe841('0x34')];}catch(_0x196d98){_0x27d219(_0x196d98);}_0x4fd3d5(_0x518814);});}function updateSmsInteraction(_0x2ba3ea,_0x35b265,_0x3771d4){return new BPromise(function(_0x553687,_0x3219c4){return getInteractionUsers(_0x2ba3ea,_0x3771d4)[_0xe841('0x2c')](function(_0x2e43f3){return getInteractionTags(_0x2e43f3,_0x35b265);})['then'](function(_0x5d44ec){_0x553687(_0x5d44ec);})[_0xe841('0x37')](function(_0x55761a){_0x3219c4(_0x55761a);});});}exports[_0xe841('0x38')]=function(_0x3e7c3f,_0x3f30f5){var _0x34cda6={},_0x102dda={},_0x4632d1={'count':0x0,'rows':[]};var _0x5e5cc2=_[_0xe841('0x39')](db[_0xe841('0x3a')][_0xe841('0x3b')],function(_0x1d735c){return{'name':_0x1d735c[_0xe841('0x3c')],'type':_0x1d735c[_0xe841('0x3d')]['key']};});_0x102dda['model']=_[_0xe841('0x39')](_0x5e5cc2,'name');_0x102dda[_0xe841('0x3e')]=_[_0xe841('0x3f')](_0x3e7c3f[_0xe841('0x3e')]);_0x102dda['filters']=_[_0xe841('0x40')](_0x102dda['model'],_0x102dda[_0xe841('0x3e')]);_0x34cda6['attributes']=_[_0xe841('0x40')](_0x102dda[_0xe841('0x41')],qs[_0xe841('0x42')](_0x3e7c3f['query'][_0xe841('0x42')]));_0x34cda6[_0xe841('0x43')]=_0x34cda6['attributes']['length']?_0x34cda6[_0xe841('0x43')]:_0x102dda['model'];if(!_0x3e7c3f['query'][_0xe841('0x44')](_0xe841('0x45'))){_0x34cda6[_0xe841('0x24')]=qs[_0xe841('0x24')](_0x3e7c3f['query'][_0xe841('0x24')]);_0x34cda6['offset']=qs[_0xe841('0x22')](_0x3e7c3f[_0xe841('0x3e')]['offset']);}_0x34cda6[_0xe841('0x46')]=qs[_0xe841('0x47')](_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x47')]);_0x34cda6[_0xe841('0x48')]=qs['filters'](_[_0xe841('0x49')](_0x3e7c3f[_0xe841('0x3e')],_0x102dda[_0xe841('0x4a')]),_0x5e5cc2);var _0x343f6f=[];var _0x2d3a58=squel['select']()[_0xe841('0x4b')]('id')[_0xe841('0x4b')](_0xe841('0x30'))[_0xe841('0x4b')](_0xe841('0x4c'))['from'](_0xe841('0x4d'));var _0x5f52c8=squel['select']()['field'](_0xe841('0x4e'))[_0xe841('0x4b')](_0xe841('0x4f'))[_0xe841('0x4b')](_0xe841('0x50'))[_0xe841('0x51')](_0xe841('0x52'),'ui')[_0xe841('0x53')](_0xe841('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x598ced=squel[_0xe841('0x55')]()['from'](_0xe841('0x56'),'i')['left_join'](_0xe841('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xe841('0x54'),'o',_0xe841('0x58'))[_0xe841('0x53')](_0xe841('0x59'),'a','a.id\x20=\x20i.SmsAccountId')[_0xe841('0x53')](_0xe841('0x5a'),'me',_0xe841('0x5b'))[_0xe841('0x53')](_0xe841('0x5c'),'it',_0xe841('0x5d'))[_0xe841('0x53')](_0xe841('0x4d'),'t',_0xe841('0x5e'));var _0x4dee92=squel['expr']();var _0x418ff4=[];var _0x506609=squel[_0xe841('0x5f')]();var _0x21415a;if(_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x60')]){_0x21415a=as['parseSearch'](_0x3e7c3f[_0xe841('0x3e')]['search']);var _0x5e4f28=_0x21415a['sqlOperator'];for(var _0x45a6e7=0x0;_0x45a6e7<_0x21415a[_0xe841('0x61')][_0xe841('0x62')];_0x45a6e7++){var _0x3af245=_0x21415a[_0xe841('0x61')][_0x45a6e7];var _0x3357fb='i';var _0x50bbac=_['find'](_0x5e5cc2,[_0xe841('0x30'),_0x3af245[_0xe841('0x4b')]]);if(!_0x50bbac){switch(_0x3af245['field']){case _0xe841('0x63'):if(_0x3af245['value']==0x1){_0x598ced[_0xe841('0x64')]('`'+_0x3af245[_0xe841('0x4b')]+_0xe841('0x65'));}else{_0x598ced[_0xe841('0x64')]('`'+_0x3af245[_0xe841('0x4b')]+_0xe841('0x66'));}break;case _0xe841('0x67'):if(_0x3af245[_0xe841('0x68')]==='$substring'){if(_0x3af245['value'][_0xe841('0x35')]('\x20')['length']>0x1){_0x4dee92[_0x5e4f28](_0xe841('0x69'),qs[_0xe841('0x6a')](_0x3af245[_0xe841('0x6b')]),null);}else{var _0x3365e8='%'+_0x3af245[_0xe841('0x6b')]+'%';_0x4dee92[_0x5e4f28](_0xe841('0x6c'),_0x3365e8,_0x3365e8,_0x3365e8);}}else{_0x50bbac=_[_0xe841('0x6d')](_0x5e5cc2,[_0xe841('0x30'),_0xe841('0x6e')]);_0x3af245[_0xe841('0x4b')]=_0xe841('0x6e');_0x52491d=as[_0xe841('0x6f')](_0x3357fb,_0x50bbac[_0xe841('0x3d')],_0x3af245);_0x4dee92[_0x5e4f28](_0x52491d[_0xe841('0x70')],_0x52491d['value'][_0xe841('0x71')],_0x52491d[_0xe841('0x6b')][_0xe841('0x21')]);}break;case _0xe841('0x72'):var _0x1f5c45=_0x3af245[_0xe841('0x6b')][_0xe841('0x35')](',')['map'](function(_0x2d0192){return Number(_0x2d0192);});_0x1f5c45[_0xe841('0x36')](function(_0x3c5380){_0x506609['or'](_0xe841('0x73'),'%,'+_0x3c5380+',%');});_0x418ff4=_[_0xe841('0x74')](_0x418ff4,_0x1f5c45);break;case _0xe841('0x75'):if(_0x3af245[_0xe841('0x68')]===_0xe841('0x76')){_0x4dee92[_0x5e4f28](_0xe841('0x77'),'%'+_0x3af245['value']+'%',null);}else{_0x50bbac=_[_0xe841('0x6d')](_0x5e5cc2,['name',_0xe841('0x78')]);_0x3af245[_0xe841('0x4b')]='UserId';_0x52491d=as['buildExpression'](_0x3357fb,_0x50bbac[_0xe841('0x3d')],_0x3af245);_0x4dee92[_0x5e4f28](_0x52491d[_0xe841('0x70')],_0x52491d[_0xe841('0x6b')][_0xe841('0x71')],_0x52491d[_0xe841('0x6b')][_0xe841('0x21')]);}break;case _0xe841('0x79'):_0x52491d=as[_0xe841('0x6f')]('me',null,_0x3af245);_0x4dee92[_0x5e4f28](_0x52491d[_0xe841('0x70')],_0x52491d[_0xe841('0x6b')][_0xe841('0x71')],_0x52491d[_0xe841('0x6b')][_0xe841('0x21')]);break;}}else{var _0x52491d=as['buildExpression'](_0x3357fb,_0x50bbac[_0xe841('0x3d')],_0x3af245);_0x4dee92[_0x5e4f28](_0x52491d[_0xe841('0x70')],_0x52491d[_0xe841('0x6b')][_0xe841('0x71')],_0x52491d[_0xe841('0x6b')][_0xe841('0x21')]);}}}else{var _0x5d3c18=_(_0x3e7c3f['query'])[_0xe841('0x3f')]()[_0xe841('0x39')](function(_0x10b744){return _[_0xe841('0x7a')](_0x5e5cc2,['name',_0x10b744])?_0x10b744:undefined;})[_0xe841('0x7b')]()['value']();if(!_[_0xe841('0x7c')](_0x5d3c18)){_0x5d3c18[_0xe841('0x36')](function(_0xa212c2){if(_0xa212c2==='SmsAccountId'){_0x598ced[_0xe841('0x48')](_0xe841('0x7d'),[][_0xe841('0x7e')](_0x3e7c3f[_0xe841('0x3e')][_0xa212c2]));}else if(_0xa212c2===_0xe841('0x7f')){var _0x5ad73d=JSON[_0xe841('0x80')](_0x3e7c3f[_0xe841('0x3e')][_0xa212c2])[_0xe841('0x81')];var _0x193cb6=JSON['parse'](_0x3e7c3f[_0xe841('0x3e')][_0xa212c2])[_0xe841('0x82')];_0x598ced[_0xe841('0x48')](_0xe841('0x83'),_0x5ad73d,_0x193cb6);}else{if(_0x3e7c3f['query'][_0xa212c2]===_0xe841('0x84')){_0x598ced['where']('i.'+_0xa212c2+_0xe841('0x85'));}else{_0x598ced[_0xe841('0x48')]('i.'+_0xa212c2+_0xe841('0x86'),_0x3e7c3f['query'][_0xa212c2]);}}});}if(_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x87')]){if(_0x3e7c3f[_0xe841('0x3e')]['read']==0x1){_0x598ced[_0xe841('0x64')](_0xe841('0x88'));}else{_0x598ced['having'](_0xe841('0x89'));}}if(_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x8a')]){_0x418ff4=_[_0xe841('0x8b')](_0x3e7c3f[_0xe841('0x3e')]['tag'])?_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x8a')]:new Array(_0x3e7c3f[_0xe841('0x3e')][_0xe841('0x8a')]);_0x418ff4[_0xe841('0x36')](function(_0x272c99){_0x506609['or'](_0xe841('0x73'),'%,'+_0x272c99+',%');});}if(_0x3e7c3f['query'][_0xe841('0x8c')]){var _0x4a9004=_0x3e7c3f['query'][_0xe841('0x8c')][_0xe841('0x8d')]('\x5c','\x5c\x5c')[_0xe841('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4a9004)){_0x4dee92['or']('i.id\x20LIKE\x20?',_0x4a9004+'%')['or'](_0xe841('0x8e'),_0x4a9004+'%');}else{_0x4dee92['or'](_0xe841('0x8f'),qs[_0xe841('0x6a')](_0x4a9004))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4a9004+'%');}}}_0x598ced[_0xe841('0x48')](_0x4dee92);_0x598ced['group'](_0xe841('0x90'));var _0x23d71c={'type':db['Sequelize'][_0xe841('0x91')][_0xe841('0x92')],'raw':!![]};var _0x3bd8d2=_0x598ced[_0xe841('0x93')]();_0x3bd8d2[_0xe841('0x4b')](_0xe841('0x90'));_0x3bd8d2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe841('0x63'));if(_0x34cda6[_0xe841('0x46')]){_0x34cda6[_0xe841('0x46')][_0xe841('0x36')](function(_0x208db8){var _0x2ac712=_0x208db8[0x0]==='contactName'?_0x208db8[0x0]:'i.'+_0x208db8[0x0];_0x598ced[_0xe841('0x46')](_0x2ac712,_0x208db8[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe841('0x7c')](_0x418ff4)){_0x598ced[_0xe841('0x64')](_0x506609);_0x3bd8d2[_0xe841('0x48')]('t.id\x20IN\x20?',_0x418ff4);}BPromise[_0xe841('0x94')]()['then'](function(){if(!_0x21415a){if(_0x3e7c3f[_0xe841('0x3e')]['SmsAccountId'])return;_0x3bd8d2['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x598ced[_0xe841('0x48')](_0xe841('0x95'));return;}if(_0x3e7c3f[_0xe841('0x96')][_0xe841('0x97')]!==_0xe841('0x98'))return;return _0x3e7c3f[_0xe841('0x96')][_0xe841('0x99')]({'attributes':['id'],'raw':!![]})[_0xe841('0x2c')](function(_0x4d06f3){if(_['isEmpty'](_0x4d06f3)){_0x3bd8d2['where'](_0xe841('0x9a'));_0x598ced[_0xe841('0x48')](_0xe841('0x9a'));}else{_0x3bd8d2[_0xe841('0x48')](_0xe841('0x7d'),_['map'](_0x4d06f3,'id'));_0x598ced[_0xe841('0x48')](_0xe841('0x7d'),_[_0xe841('0x39')](_0x4d06f3,'id'));}});})['then'](function(){if(_0x3e7c3f[_0xe841('0x96')][_0xe841('0x97')]===_0xe841('0x98')&&!_0x21415a&&!_0x3e7c3f[_0xe841('0x3e')]['SmsAccountId'])return[];return db[_0xe841('0x9b')][_0xe841('0x3e')](_0x3bd8d2['toString'](),_0x23d71c);})[_0xe841('0x2c')](function(_0x3d53c7){_0x4632d1[_0xe841('0x25')]=_0x3d53c7[_0xe841('0x62')];if(_0x4632d1['count']===0x0)return[];return db[_0xe841('0x9b')][_0xe841('0x3e')](_0x2d3a58[_0xe841('0x9c')](),_0x23d71c)['then'](function(_0x32c61b){_0x343f6f=_['keyBy'](_0x32c61b,'id');_0x23d71c=_['merge'](_0x23d71c,{'model':db[_0xe841('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e7c3f['query'][_0xe841('0x42')]){_0x34cda6[_0xe841('0x43')][_0xe841('0x36')](function(_0x3b7386){_0x598ced['field']('i.'+_0x3b7386);});}else{_0x598ced['field'](_0xe841('0x9d'),'unreadMessages');_0x598ced[_0xe841('0x4b')](_0xe841('0x9e'),'Account.key');_0x598ced[_0xe841('0x4b')](_0xe841('0x9f'),'Account.mandatoryDisposition');_0x598ced['field'](_0xe841('0xa0'),_0xe841('0xa1'));_0x598ced['field']('i.*');_0x598ced[_0xe841('0x4b')](_0xe841('0xa2'),_0xe841('0xa3'));_0x598ced['field'](_0xe841('0xa4'),_0xe841('0xa5'));_0x598ced['field'](_0xe841('0xa6'),_0xe841('0xa7'));_0x598ced[_0xe841('0x4b')](_0xe841('0xa8'),_0xe841('0xa9'));_0x598ced[_0xe841('0x4b')]('c.mobile',_0xe841('0xaa'));_0x598ced[_0xe841('0x4b')](_0xe841('0xab'),_0xe841('0xac'));_0x598ced[_0xe841('0x4b')]('o.fullname','Owner.fullname');_0x598ced[_0xe841('0x4b')](_0xe841('0xad'),'Owner.internal');_0x598ced[_0xe841('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe841('0x34'));}if(_0x34cda6[_0xe841('0x24')])_0x598ced[_0xe841('0x24')](_0x34cda6[_0xe841('0x24')]);if(_0x34cda6[_0xe841('0x22')])_0x598ced[_0xe841('0x22')](_0x34cda6[_0xe841('0x22')]);return db[_0xe841('0x9b')][_0xe841('0x3e')](_0x598ced['toString'](),_0x23d71c);})[_0xe841('0x2c')](function(_0x2bc0f4){if(_0x2bc0f4[_0xe841('0x62')]>0x0)_0x5f52c8[_0xe841('0x48')]('ui.SmsInteractionId\x20IN\x20?',_[_0xe841('0x39')](_0x2bc0f4,'id'));return db[_0xe841('0x9b')][_0xe841('0x3e')](_0x5f52c8['toString'](),_0x23d71c)[_0xe841('0x2c')](function(_0x18e687){var _0x7903c4=_[_0xe841('0xae')](_0x18e687,_0xe841('0xaf'));var _0x31ce22=[];_0x2bc0f4['forEach'](function(_0x3537c5){_0x31ce22[_0xe841('0xb0')](updateSmsInteraction(_0x3537c5,_0x343f6f,_0x7903c4));});return BPromise['all'](_0x31ce22);});});})[_0xe841('0x2c')](function(_0x27d3e9){_0x4632d1[_0xe841('0xb1')]=_0x27d3e9;return _0x4632d1;})[_0xe841('0x2c')](respondWithFilteredResult(_0x3f30f5,_0x34cda6))['catch'](handleError(_0x3f30f5,null));};exports[_0xe841('0xb2')]=function(_0x2484f2,_0x11374a){var _0x9872e7={'raw':![],'where':{'id':_0x2484f2[_0xe841('0xb3')]['id']}},_0x1a33ed={};_0x1a33ed['model']=_['keys'](db[_0xe841('0x3a')][_0xe841('0x3b')]);_0x1a33ed[_0xe841('0x3e')]=_[_0xe841('0x3f')](_0x2484f2[_0xe841('0x3e')]);_0x1a33ed[_0xe841('0x4a')]=_[_0xe841('0x40')](_0x1a33ed[_0xe841('0x41')],_0x1a33ed[_0xe841('0x3e')]);_0x9872e7[_0xe841('0x43')]=_[_0xe841('0x40')](_0x1a33ed[_0xe841('0x41')],qs['fields'](_0x2484f2[_0xe841('0x3e')]['fields']));_0x9872e7[_0xe841('0x43')]=_0x9872e7[_0xe841('0x43')][_0xe841('0x62')]?_0x9872e7[_0xe841('0x43')]:_0x1a33ed[_0xe841('0x41')];if(_0x2484f2[_0xe841('0x3e')][_0xe841('0xb4')]){_0x9872e7[_0xe841('0xb5')]=[{'all':!![]}];}_0x9872e7=_[_0xe841('0xb6')]({},_0x9872e7,_0x2484f2[_0xe841('0xb7')]);return db[_0xe841('0x3a')][_0xe841('0x6d')](_0x9872e7)['then'](handleEntityNotFound(_0x11374a,null))[_0xe841('0x2c')](respondWithResult(_0x11374a,null))['catch'](handleError(_0x11374a,null));};exports[_0xe841('0xb8')]=function(_0x45d203,_0x3fd09b){return db[_0xe841('0x3a')][_0xe841('0xb8')](_0x45d203['body'],{})[_0xe841('0x2c')](respondWithResult(_0x3fd09b,0xc9))[_0xe841('0x37')](handleError(_0x3fd09b,null));};exports[_0xe841('0xb9')]=function(_0x5789ec,_0x58b732){if(_0x5789ec[_0xe841('0x79')]['id']){delete _0x5789ec[_0xe841('0x79')]['id'];}return db[_0xe841('0x3a')][_0xe841('0x6d')]({'where':{'id':_0x5789ec[_0xe841('0xb3')]['id']}})['then'](handleEntityNotFound(_0x58b732,null))[_0xe841('0x2c')](saveUpdates(_0x5789ec[_0xe841('0x79')],null))['then'](respondWithResult(_0x58b732,null))[_0xe841('0x37')](handleError(_0x58b732,null));};exports[_0xe841('0x2d')]=function(_0x568b09,_0x19dba5){return db[_0xe841('0x3a')][_0xe841('0x6d')]({'where':{'id':_0x568b09[_0xe841('0xb3')]['id']}})[_0xe841('0x2c')](handleEntityNotFound(_0x19dba5,null))[_0xe841('0x2c')](removeEntity(_0x19dba5,null))[_0xe841('0x37')](handleError(_0x19dba5,null));};exports['describe']=function(_0x4ab322,_0x9077ae){return db[_0xe841('0x3a')]['describe']()[_0xe841('0x2c')](respondWithResult(_0x9077ae,null))['catch'](handleError(_0x9077ae,null));};exports['addMessage']=function(_0x13c9eb,_0x5f4f17,_0x38106b){return db[_0xe841('0xba')]['find']({'where':{'id':_0x13c9eb[_0xe841('0xb3')]['id']}})[_0xe841('0x2c')](handleEntityNotFound(_0x5f4f17,null))['then'](function(_0x269222){if(_0x269222){return _0x269222[_0xe841('0xbb')](_0x13c9eb['body'][_0xe841('0xbc')],_[_0xe841('0xbd')](_0x13c9eb[_0xe841('0x79')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f4f17,null))[_0xe841('0x37')](handleError(_0x5f4f17,null));};exports[_0xe841('0xbe')]=function(_0xc5b9b2,_0x12ec47,_0x46847c){var _0x495e3c={'raw':![],'where':{}};var _0x1cd31a={};var _0xbc85f6={'count':0x0,'rows':[]};return db[_0xe841('0x3a')]['findOne']({'where':{'id':_0xc5b9b2[_0xe841('0xb3')]['id']}})[_0xe841('0x2c')](handleEntityNotFound(_0x12ec47,null))[_0xe841('0x2c')](function(_0x5e48c8){if(_0x5e48c8){_0x1cd31a['model']=_[_0xe841('0x3f')](db['SmsMessage'][_0xe841('0x3b')]);_0x1cd31a[_0xe841('0x3e')]=_['keys'](_0xc5b9b2[_0xe841('0x3e')]);_0x1cd31a[_0xe841('0x4a')]=_[_0xe841('0x40')](_0x1cd31a[_0xe841('0x41')],_0x1cd31a[_0xe841('0x3e')]);_0x495e3c[_0xe841('0x43')]=_[_0xe841('0x40')](_0x1cd31a[_0xe841('0x41')],qs['fields'](_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x42')]));_0x495e3c[_0xe841('0x43')]=_0x495e3c[_0xe841('0x43')][_0xe841('0x62')]?_0x495e3c['attributes']:_0x1cd31a['model'];if(!_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x44')](_0xe841('0x45'))){_0x495e3c[_0xe841('0x24')]=qs[_0xe841('0x24')](_0xc5b9b2['query']['limit']);_0x495e3c['offset']=qs[_0xe841('0x22')](_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x22')]);}_0x495e3c[_0xe841('0x46')]=qs[_0xe841('0x47')](_0xc5b9b2['query'][_0xe841('0x47')]);_0x495e3c['where']=qs[_0xe841('0x4a')](_['pick'](_0xc5b9b2[_0xe841('0x3e')],_0x1cd31a[_0xe841('0x4a')]));_0x495e3c['where'][_0xe841('0xaf')]=_0x5e48c8['id'];if(_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x8c')]){_0x495e3c[_0xe841('0x48')]=_[_0xe841('0xb6')](_0x495e3c[_0xe841('0x48')],{'$or':_['map'](_0x495e3c[_0xe841('0x43')],function(_0x2391b6){var _0x142e4c={};_0x142e4c[_0x2391b6]={'$like':'%'+_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x8c')]+'%'};return _0x142e4c;})});}if(_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x81')]){var _0x3bcbf9=_0xc5b9b2[_0xe841('0x3e')][_0xe841('0x81')][_0xe841('0x35')](',');var _0x1f4a9b={};_0x1f4a9b[_0x3bcbf9[0x0]]={'$gte':moment(_0x3bcbf9[0x1])[_0xe841('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x495e3c[_0xe841('0x48')]=_[_0xe841('0xb6')](_0x495e3c[_0xe841('0x48')],_0x1f4a9b);}_0x495e3c=_[_0xe841('0xb6')]({},_0x495e3c,_0xc5b9b2[_0xe841('0xb7')]);return db[_0xe841('0xba')][_0xe841('0x25')]({'where':_0x495e3c['where']})['then'](function(_0x49a887){_0xbc85f6[_0xe841('0x25')]=_0x49a887;if(_0xc5b9b2[_0xe841('0x3e')][_0xe841('0xb4')]){_0x495e3c['include']=[{'all':!![]}];}return db[_0xe841('0xba')][_0xe841('0xc0')](_0x495e3c);})[_0xe841('0x2c')](function(_0x1ab45d){_0xbc85f6[_0xe841('0xb1')]=_0x1ab45d;return _0xbc85f6;});}})[_0xe841('0x2c')](respondWithFilteredResult(_0x12ec47,_0x495e3c))[_0xe841('0x37')](handleError(_0x12ec47,null));};exports['addTags']=function(_0x205ba2,_0x3d9dc1,_0x414387){return db['SmsInteraction']['find']({'where':{'id':_0x205ba2['params']['id']}})[_0xe841('0x2c')](handleEntityNotFound(_0x3d9dc1,null))[_0xe841('0x2c')](function(_0x1f8031){if(_0x1f8031){return _0x1f8031['setTags'](_0x205ba2[_0xe841('0x79')][_0xe841('0xbc')],_[_0xe841('0xbd')](_0x205ba2[_0xe841('0x79')],[_0xe841('0xbc'),'id'])||{})[_0xe841('0xc1')](function(){return db[_0xe841('0x72')][_0xe841('0xc0')]({'attributes':['id',_0xe841('0x30'),_0xe841('0x4c')],'where':{'id':_0x205ba2[_0xe841('0x79')]['ids']}});})[_0xe841('0x2c')](function(_0x5c7235){socket[_0xe841('0xc2')](_0xe841('0xc3'),{'id':Number(_0x205ba2[_0xe841('0xb3')]['id']),'tags':_0x5c7235||[]});return{'id':Number(_0x205ba2['params']['id']),'tags':_0x5c7235||[]};});}})[_0xe841('0x2c')](respondWithResult(_0x3d9dc1,null))[_0xe841('0x37')](handleError(_0x3d9dc1,null));};exports[_0xe841('0xc4')]=function(_0x57929f,_0xfa0614,_0x21c5fe){return db[_0xe841('0x3a')][_0xe841('0x6d')]({'where':{'id':_0x57929f[_0xe841('0xb3')]['id']}})[_0xe841('0x2c')](handleEntityNotFound(_0xfa0614,null))['then'](function(_0x25beb9){if(_0x25beb9){return _0x25beb9[_0xe841('0xc4')](_0x57929f['query']['ids']);}})[_0xe841('0x2c')](respondWithStatusCode(_0xfa0614,null))['catch'](handleError(_0xfa0614,null));};exports['download']=function(_0x2abd32,_0x4120b5){var _0x2767da=moment()[_0xe841('0xc5')]()[_0xe841('0x9c')]();var _0x2500d1=path[_0xe841('0xc6')](config[_0xe841('0xc7')],_0xe841('0xc8'),'files',_0xe841('0xc9'));var _0x1296d2=path['join'](config[_0xe841('0xc7')],_0xe841('0xc8'),_0xe841('0xca'),_0xe841('0xcb'));var _0x578afb=path['join'](_0x2500d1,_0x2767da);var _0x51f237=util[_0xe841('0xbf')]('transcript-%d-%s.zip',_0x2abd32[_0xe841('0xb3')]['id'],_0x2767da);var _0x2ca7cf=path['join'](_0x2500d1,_0x51f237);var _0x483462=[];_0x483462[_0xe841('0xb0')]({'model':db[_0xe841('0x75')],'as':_0xe841('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x483462[_0xe841('0xb0')]({'model':db[_0xe841('0xcc')],'as':_0xe841('0x67'),'attributes':['id',_0xe841('0xcd'),'lastName'],'raw':!![]});var _0x12ecf3=[{'model':db['SmsMessage'],'as':_0xe841('0xce'),'attributes':['id','body',_0xe841('0x7f'),_0xe841('0xcf'),'secret',_0xe841('0x87')],'include':_0x483462}];_0x12ecf3['push']({'model':db[_0xe841('0xd0')],'as':_0xe841('0xd1'),'attributes':['id',_0xe841('0x30')]});_0x12ecf3[_0xe841('0xb0')]({'model':db[_0xe841('0x75')],'as':'Owner','attributes':['id',_0xe841('0x33')]});return db[_0xe841('0x3a')][_0xe841('0x6d')]({'where':{'id':_0x2abd32[_0xe841('0xb3')]['id']},'include':_0x12ecf3})[_0xe841('0x2c')](handleEntityNotFound(_0x4120b5,null))[_0xe841('0x2c')](function(_0x110529){if(_0x110529){var _0x8f9d5=_0x110529[_0xe841('0xd2')]({'plain':!![]});fs['mkdirSync'](_0x578afb);var _0xbc01f4={'channel':'Sms','account':_0x8f9d5[_0xe841('0xd1')][_0xe841('0x30')],'agent':_0x8f9d5[_0xe841('0xd3')]?_0x8f9d5[_0xe841('0xd3')][_0xe841('0x33')]:_0xe841('0xd4'),'createdAt':moment(_0x8f9d5[_0xe841('0x7f')])['format'](_0xe841('0xd5'))[_0xe841('0x9c')](),'closedAt':_0x8f9d5[_0xe841('0xd6')]?moment(_0x8f9d5[_0xe841('0xd7')])[_0xe841('0xbf')](_0xe841('0xd5'))['toString']():'','disposition':_0x8f9d5[_0xe841('0xd8')],'messages':_(_0x8f9d5[_0xe841('0xce')])[_0xe841('0x8c')]({'secret':![]})['map'](function(_0x13e8a3){return{'date':moment(_0x13e8a3[_0xe841('0x7f')])['format'](_0xe841('0xd5'))[_0xe841('0x9c')](),'sender':_0x13e8a3['direction']===_0xe841('0xd9')?_0x13e8a3[_0xe841('0x75')]?_0x13e8a3['User']['fullname']:_0xe841('0xda'):_0x13e8a3['Contact'][_0xe841('0xcd')]+(_0x13e8a3['Contact'][_0xe841('0xdb')]?'\x20'+_0x13e8a3['Contact'][_0xe841('0xdb')]:''),'body':_0x13e8a3['body'],'direction':_0x13e8a3[_0xe841('0xcf')]===_0xe841('0xd9')?'A':'C','secret':_0x13e8a3[_0xe841('0xdc')],'read':_0x13e8a3[_0xe841('0x87')]};})[_0xe841('0x6b')]()};return ejs['renderFile'](path['join'](config[_0xe841('0xc7')],_0xe841('0xc8'),'views',_0xe841('0xdd')),{'interaction':_0xbc01f4})['then'](function(_0x3f05b6){var _0x3908a9=path[_0xe841('0xc6')](_0x578afb,_0xe841('0xde')+_0x8f9d5['id']+'-'+_0x2767da+_0xe841('0xdf'));var _0x598378={'path':_0x3908a9,'channel':_0xe841('0xe0'),'interactionId':_0x8f9d5['id']};return pdf[_0xe841('0xe1')](_0x3f05b6,_0x598378);})['then'](function(){return new BPromise(function(_0x2f068a,_0x11e1e8){zipdir(_0x578afb,{'saveTo':_0x2ca7cf},function(_0x26b15b,_0x54369b){if(_0x26b15b)return _0x11e1e8(_0x26b15b);return _0x2f068a(_0x54369b);});})[_0xe841('0x2c')](function(){return new BPromise(function(_0x534aa1,_0x5ab703){rimraf(_0x578afb,function(_0x246872){if(_0x246872)_0x5ab703(_0x246872);return _0x534aa1();});});})[_0xe841('0x2c')](function(){return _0x4120b5['download'](_0x2ca7cf,_0x51f237,function(_0x22165f){if(_0x22165f){console[_0xe841('0xe2')]('err',_0x22165f);}else{fs[_0xe841('0xe3')](_0x2ca7cf);}});});});}else{return _0x4120b5[_0xe841('0x1f')](0xc8);}})[_0xe841('0x37')](handleError(_0x4120b5,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7c2a973..0828597 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 _0x9f0e=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','update','remove','then','setDataValue','map','findAll'];(function(_0x28b3d7,_0x17b41d){var _0x49619d=function(_0x51a700){while(--_0x51a700){_0x28b3d7['push'](_0x28b3d7['shift']());}};_0x49619d(++_0x17b41d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4f5f46,_0x2e37cf){_0x4f5f46=_0x4f5f46-0x0;var _0x5c06ec=_0x9f0e[_0x4f5f46];return _0x5c06ec;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var SmsInteraction=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var SmsMessage=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9f0('0x4'),'afterDestroy':_0xe9f0('0x5')};function emitEvent(_0x3c589d){return function(_0x202d69,_0x1eed45,_0x50313d){_0x202d69['getUsers']({'attributes':['id'],'raw':!![]})[_0xe9f0('0x6')](function(_0x167198){_0x202d69[_0xe9f0('0x7')]('Users',_0x167198[_0xe9f0('0x8')](function(_0x335b82){return{'id':_0x335b82['id']};}));return SmsMessage[_0xe9f0('0x9')]({'where':{'SmsInteractionId':_0x202d69['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe9f0('0x6')](function(_0xa523c0){_0x202d69[_0xe9f0('0x7')](_0xe9f0('0xa'),_0xa523c0[_0xe9f0('0xb')]);SmsInteractionEvents[_0xe9f0('0xc')](_0x3c589d+':'+_0x202d69['id'],_0x202d69);SmsInteractionEvents['emit'](_0x3c589d,_0x202d69);_0x50313d(null);})[_0xe9f0('0xd')](_0x50313d(null));};}for(var e in events){if(events[_0xe9f0('0xe')](e)){var event=events[e];SmsInteraction[_0xe9f0('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x5b12=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x378f7d,_0x1d848d){var _0x4454fa=function(_0xb12e9d){while(--_0xb12e9d){_0x378f7d['push'](_0x378f7d['shift']());}};_0x4454fa(++_0x1d848d);}(_0x5b12,0xa3));var _0x25b1=function(_0x224592,_0x507ae9){_0x224592=_0x224592-0x0;var _0x4a58a4=_0x5b12[_0x224592];return _0x4a58a4;};'use strict';var EventEmitter=require(_0x25b1('0x0'));var SmsInteraction=require(_0x25b1('0x1'))['db'][_0x25b1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x25b1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25b1('0x4'),'afterUpdate':_0x25b1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31f3fc){return function(_0x56378e,_0x5248c2,_0x35d90b){_0x56378e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1f715d){_0x56378e[_0x25b1('0x6')](_0x25b1('0x7'),_0x1f715d[_0x25b1('0x8')](function(_0x1ed594){return{'id':_0x1ed594['id']};}));return SmsMessage[_0x25b1('0x9')]({'where':{'SmsInteractionId':_0x56378e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x25b1('0xa')](function(_0x6235e2){_0x56378e['setDataValue'](_0x25b1('0xb'),_0x6235e2[_0x25b1('0xc')]);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc+':'+_0x56378e['id'],_0x56378e);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc,_0x56378e);_0x35d90b(null);})[_0x25b1('0xe')](_0x35d90b(null));};}for(var e in events){if(events[_0x25b1('0xf')](e)){var event=events[e];SmsInteraction[_0x25b1('0x10')](e,emitEvent(event));}}module[_0x25b1('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a6f299b..8530916 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 _0x954e=['./smsInteraction.attributes','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','request-promise','rimraf'];(function(_0x25997b,_0xeddec4){var _0x43f8e1=function(_0x3a1005){while(--_0x3a1005){_0x25997b['push'](_0x25997b['shift']());}};_0x43f8e1(++_0xeddec4);}(_0x954e,0x164));var _0xe954=function(_0x35761d,_0x3a1cbf){_0x35761d=_0x35761d-0x0;var _0x381548=_0x954e[_0x35761d];return _0x381548;};'use strict';var _=require(_0xe954('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe954('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe954('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe954('0x3'));var config=require('../../config/environment');var attributes=require(_0xe954('0x4'));module[_0xe954('0x5')]=function(_0xfbe304,_0xb5d57a){return _0xfbe304[_0xe954('0x6')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd29017,_0x3f19be,_0x3934be){if(_0xd29017[_0xe954('0x7')]('closed')){_0xd29017[_0xe954('0x8')]=moment()['format'](_0xe954('0x9'));}_0x3934be(null,_0xd29017);}}});}; \ No newline at end of file +var _0x2ff9=['define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x19e3c2,_0x177a95){var _0x2bb88f=function(_0x165f84){while(--_0x165f84){_0x19e3c2['push'](_0x19e3c2['shift']());}};_0x2bb88f(++_0x177a95);}(_0x2ff9,0xf1));var _0x92ff=function(_0x2d4384,_0x1e55e1){_0x2d4384=_0x2d4384-0x0;var _0x1b8a55=_0x2ff9[_0x2d4384];return _0x1b8a55;};'use strict';var _=require(_0x92ff('0x0'));var util=require(_0x92ff('0x1'));var logger=require(_0x92ff('0x2'))(_0x92ff('0x3'));var moment=require(_0x92ff('0x4'));var BPromise=require(_0x92ff('0x5'));var rp=require(_0x92ff('0x6'));var fs=require('fs');var path=require(_0x92ff('0x7'));var rimraf=require(_0x92ff('0x8'));var config=require(_0x92ff('0x9'));var attributes=require(_0x92ff('0xa'));module['exports']=function(_0x5b9b94,_0x1d7f20){return _0x5b9b94[_0x92ff('0xb')](_0x92ff('0xc'),attributes,{'tableName':_0x92ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39b35b,_0x6c35aa,_0x318f4f){if(_0x39b35b[_0x92ff('0xe')](_0x92ff('0xf'))){_0x39b35b[_0x92ff('0x10')]=moment()['format'](_0x92ff('0x11'));}_0x318f4f(null,_0x39b35b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9cfb7ac..45cb56f 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 _0xc6b0=['addTags','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','stringify','find','where'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xc6b0,0x1f0));var _0x0c6b=function(_0x1694f0,_0x407ca2){_0x1694f0=_0x1694f0-0x0;var _0x2502bc=_0xc6b0[_0x1694f0];return _0x2502bc;};'use strict';var _=require(_0x0c6b('0x0'));var util=require(_0x0c6b('0x1'));var moment=require(_0x0c6b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c6b('0x3'));var fs=require('fs');var Redis=require(_0x0c6b('0x4'));var db=require(_0x0c6b('0x5'))['db'];var utils=require(_0x0c6b('0x6'));var logger=require('../../config/logger')(_0x0c6b('0x7'));var config=require(_0x0c6b('0x8'));var jayson=require(_0x0c6b('0x9'));var client=jayson['client'][_0x0c6b('0xa')]({'port':0x232a});config[_0x0c6b('0xb')]=_['defaults'](config[_0x0c6b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c6b('0xc'))(new Redis(config['redis']));require(_0x0c6b('0xd'))[_0x0c6b('0xe')](socket);function respondWithRpcPromise(_0x4abb0d,_0x49d9b2,_0x460e0a){return new BPromise(function(_0x56710a,_0x31d988){return client[_0x0c6b('0xf')](_0x4abb0d,_0x460e0a)[_0x0c6b('0x10')](function(_0x31054f){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x49d9b2,_0x0c6b('0x11'));logger[_0x0c6b('0x12')](_0x0c6b('0x13'),_0x49d9b2,_0x0c6b('0x11'),JSON['stringify'](_0x31054f));if(_0x31054f[_0x0c6b('0x14')]){if(_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x15')]===0x1f4){logger['error'](_0x0c6b('0x16'),_0x49d9b2,_0x31054f['error'][_0x0c6b('0x17')]);return _0x31d988(_0x31054f[_0x0c6b('0x14')]['message']);}logger[_0x0c6b('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x49d9b2,_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x17')]);return _0x56710a(_0x31054f[_0x0c6b('0x14')][_0x0c6b('0x17')]);}else{logger[_0x0c6b('0x18')](_0x0c6b('0x16'),_0x49d9b2,_0x0c6b('0x11'));_0x56710a(_0x31054f[_0x0c6b('0x19')][_0x0c6b('0x17')]);}})[_0x0c6b('0x1a')](function(_0x2f2be7){logger[_0x0c6b('0x14')](_0x0c6b('0x16'),_0x49d9b2,_0x2f2be7);_0x31d988(_0x2f2be7);});});}exports[_0x0c6b('0x1b')]=function(_0x5fa67){var _0x5558c9=this;return new Promise(function(_0x4d6b70,_0xdcc3ad){return db[_0x0c6b('0x1c')][_0x0c6b('0x1d')](_0x5fa67[_0x0c6b('0x1e')],{'raw':_0x5fa67['options']?_0x5fa67[_0x0c6b('0x1f')][_0x0c6b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67[_0x0c6b('0x1f')]['where']||null:null,'attributes':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67['options'][_0x0c6b('0x21')]||null:null,'limit':_0x5fa67[_0x0c6b('0x1f')]?_0x5fa67['options']['limit']||null:null})[_0x0c6b('0x10')](function(_0x3af2fc){logger[_0x0c6b('0x18')](_0x0c6b('0x1b'),_0x5fa67);logger[_0x0c6b('0x12')](_0x0c6b('0x1b'),_0x5fa67,JSON[_0x0c6b('0x22')](_0x3af2fc));_0x4d6b70(_0x3af2fc);})[_0x0c6b('0x1a')](function(_0x444e3a){logger['error'](_0x0c6b('0x1b'),_0x444e3a[_0x0c6b('0x17')],_0x5fa67);_0xdcc3ad(_0x5558c9['error'](0x1f4,_0x444e3a[_0x0c6b('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x41940f){return new Promise(function(_0x423d54,_0x4259b9){return db['SmsInteraction'][_0x0c6b('0x23')]({'where':_0x41940f['options']?_0x41940f[_0x0c6b('0x1f')][_0x0c6b('0x24')]||null:null})[_0x0c6b('0x10')](function(_0x5cec47){if(_0x5cec47){return _0x5cec47[_0x0c6b('0x25')](_0x41940f[_0x0c6b('0x1e')][_0x0c6b('0x26')],_[_0x0c6b('0x27')](_0x41940f['body'],[_0x0c6b('0x26'),'id'])||{});}})['spread'](function(_0x41d1fa){logger[_0x0c6b('0x18')](_0x0c6b('0x28'),_0x41940f);logger[_0x0c6b('0x12')](_0x0c6b('0x28'),_0x41940f,JSON[_0x0c6b('0x22')](_0x41d1fa));_0x423d54(_0x41d1fa);})[_0x0c6b('0x1a')](function(_0x437cbd){logger['error'](_0x0c6b('0x28'),_0x437cbd[_0x0c6b('0x17')],_0x41940f);_0x4259b9(_this[_0x0c6b('0x14')](0x1f4,_0x437cbd[_0x0c6b('0x17')]));});});}; \ No newline at end of file +var _0x14a3=['redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','SmsInteraction','body','options','raw','where','attributes','limit','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10d030,_0x449fc0){var _0x592482=function(_0x3d274b){while(--_0x3d274b){_0x10d030['push'](_0x10d030['shift']());}};_0x592482(++_0x449fc0);}(_0x14a3,0xfc));var _0x314a=function(_0x1d3046,_0x8b14e1){_0x1d3046=_0x1d3046-0x0;var _0x3b9b62=_0x14a3[_0x1d3046];return _0x3b9b62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x314a('0x0'));var BPromise=require(_0x314a('0x1'));var rs=require(_0x314a('0x2'));var fs=require('fs');var Redis=require(_0x314a('0x3'));var db=require(_0x314a('0x4'))['db'];var utils=require(_0x314a('0x5'));var logger=require(_0x314a('0x6'))(_0x314a('0x7'));var config=require(_0x314a('0x8'));var jayson=require(_0x314a('0x9'));var client=jayson[_0x314a('0xa')][_0x314a('0xb')]({'port':0x232a});config[_0x314a('0xc')]=_[_0x314a('0xd')](config[_0x314a('0xc')],{'host':_0x314a('0xe'),'port':0x18eb});var socket=require(_0x314a('0xf'))(new Redis(config[_0x314a('0xc')]));require(_0x314a('0x10'))[_0x314a('0x11')](socket);function respondWithRpcPromise(_0x44e905,_0x1cf7ec,_0x47169b){return new BPromise(function(_0x4cca61,_0x5f5065){return client[_0x314a('0x12')](_0x44e905,_0x47169b)[_0x314a('0x13')](function(_0x2e3dc8){logger['info'](_0x314a('0x14'),_0x1cf7ec,_0x314a('0x15'));logger[_0x314a('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1cf7ec,'request\x20sent',JSON['stringify'](_0x2e3dc8));if(_0x2e3dc8[_0x314a('0x17')]){if(_0x2e3dc8[_0x314a('0x17')][_0x314a('0x18')]===0x1f4){logger[_0x314a('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x1cf7ec,_0x2e3dc8[_0x314a('0x17')]['message']);return _0x5f5065(_0x2e3dc8[_0x314a('0x17')][_0x314a('0x19')]);}logger[_0x314a('0x17')](_0x314a('0x14'),_0x1cf7ec,_0x2e3dc8['error']['message']);return _0x4cca61(_0x2e3dc8[_0x314a('0x17')][_0x314a('0x19')]);}else{logger[_0x314a('0x1a')](_0x314a('0x14'),_0x1cf7ec,_0x314a('0x15'));_0x4cca61(_0x2e3dc8['result']['message']);}})[_0x314a('0x1b')](function(_0x4828f8){logger[_0x314a('0x17')](_0x314a('0x14'),_0x1cf7ec,_0x4828f8);_0x5f5065(_0x4828f8);});});}exports['UpdateSmsInteraction']=function(_0x1d7f15){var _0x2d1fbd=this;return new Promise(function(_0x36b29c,_0x45375c){return db[_0x314a('0x1c')]['update'](_0x1d7f15[_0x314a('0x1d')],{'raw':_0x1d7f15[_0x314a('0x1e')]?_0x1d7f15[_0x314a('0x1e')][_0x314a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d7f15[_0x314a('0x1e')]?_0x1d7f15[_0x314a('0x1e')][_0x314a('0x20')]||null:null,'attributes':_0x1d7f15['options']?_0x1d7f15['options'][_0x314a('0x21')]||null:null,'limit':_0x1d7f15[_0x314a('0x1e')]?_0x1d7f15[_0x314a('0x1e')][_0x314a('0x22')]||null:null})[_0x314a('0x13')](function(_0x30cdfe){logger[_0x314a('0x1a')](_0x314a('0x23'),_0x1d7f15);logger[_0x314a('0x16')](_0x314a('0x23'),_0x1d7f15,JSON[_0x314a('0x24')](_0x30cdfe));_0x36b29c(_0x30cdfe);})[_0x314a('0x1b')](function(_0xf2f12b){logger[_0x314a('0x17')]('UpdateSmsInteraction',_0xf2f12b[_0x314a('0x19')],_0x1d7f15);_0x45375c(_0x2d1fbd[_0x314a('0x17')](0x1f4,_0xf2f12b[_0x314a('0x19')]));});});};exports[_0x314a('0x25')]=function(_0x55cd29){return new Promise(function(_0x2abed1,_0x1acd00){return db[_0x314a('0x1c')][_0x314a('0x26')]({'where':_0x55cd29[_0x314a('0x1e')]?_0x55cd29[_0x314a('0x1e')][_0x314a('0x20')]||null:null})['then'](function(_0x427f95){if(_0x427f95){return _0x427f95[_0x314a('0x27')](_0x55cd29['body'][_0x314a('0x28')],_[_0x314a('0x29')](_0x55cd29['body'],[_0x314a('0x28'),'id'])||{});}})[_0x314a('0x2a')](function(_0x544034){logger[_0x314a('0x1a')]('AddTags',_0x55cd29);logger['debug']('AddTags',_0x55cd29,JSON[_0x314a('0x24')](_0x544034));_0x2abed1(_0x544034);})['catch'](function(_0xe882c8){logger['error'](_0x314a('0x2b'),_0xe882c8['message'],_0x55cd29);_0x1acd00(_this[_0x314a('0x17')](0x1f4,_0xe882c8[_0x314a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 06f9432..c33a3ad 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 _0x7f37=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x16a551,_0x5ef12a){var _0x3ee8ec=function(_0x3fba9b){while(--_0x3fba9b){_0x16a551['push'](_0x16a551['shift']());}};_0x3ee8ec(++_0x5ef12a);}(_0x7f37,0xab));var _0x77f3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f37[_0x5d6456];return _0x4d66c1;};'use strict';var SmsInteractionEvents=require(_0x77f3('0x0'));var events=[_0x77f3('0x1'),_0x77f3('0x2'),_0x77f3('0x3')];function createListener(_0x4ddac3,_0x3b4ff0){return function(_0x540637){_0x3b4ff0[_0x77f3('0x4')](_0x4ddac3,_0x540637);};}function removeListener(_0xe6dc8,_0x5de9e2){return function(){SmsInteractionEvents[_0x77f3('0x5')](_0xe6dc8,_0x5de9e2);};}exports[_0x77f3('0x6')]=function(_0x1286d0){for(var _0x38e7b2=0x0,_0x3b7cc7=events[_0x77f3('0x7')];_0x38e7b2<_0x3b7cc7;_0x38e7b2++){var _0x564c8d=events[_0x38e7b2];var _0xf28330=createListener(_0x77f3('0x8')+_0x564c8d,_0x1286d0);SmsInteractionEvents['on'](_0x564c8d,_0xf28330);}}; \ No newline at end of file +var _0x88cf=['./smsInteraction.events','save','remove','update','emit','removeListener','length','smsInteraction:'];(function(_0x3c30ea,_0x4aa056){var _0x1767df=function(_0x5289fb){while(--_0x5289fb){_0x3c30ea['push'](_0x3c30ea['shift']());}};_0x1767df(++_0x4aa056);}(_0x88cf,0xe8));var _0xf88c=function(_0x2f7a11,_0x4386f6){_0x2f7a11=_0x2f7a11-0x0;var _0x5227ad=_0x88cf[_0x2f7a11];return _0x5227ad;};'use strict';var SmsInteractionEvents=require(_0xf88c('0x0'));var events=[_0xf88c('0x1'),_0xf88c('0x2'),_0xf88c('0x3')];function createListener(_0x496aaf,_0x51d462){return function(_0x3877ca){_0x51d462[_0xf88c('0x4')](_0x496aaf,_0x3877ca);};}function removeListener(_0x485ba2,_0x1fe7bd){return function(){SmsInteractionEvents[_0xf88c('0x5')](_0x485ba2,_0x1fe7bd);};}exports['register']=function(_0x17c341){for(var _0x3bdcdd=0x0,_0x5affbe=events[_0xf88c('0x6')];_0x3bdcdd<_0x5affbe;_0x3bdcdd++){var _0x16138f=events[_0x3bdcdd];var _0x27be68=createListener(_0xf88c('0x7')+_0x16138f,_0x17c341);SmsInteractionEvents['on'](_0x16138f,_0x27be68);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index cbfae14..46b605d 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 _0xe62d=['/describe','/:id','post','tracked','sms','/:id/status','status','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get'];(function(_0x215c7f,_0x445791){var _0x5e0d70=function(_0x998e7a){while(--_0x998e7a){_0x215c7f['push'](_0x215c7f['shift']());}};_0x5e0d70(++_0x445791);}(_0xe62d,0xb6));var _0xde62=function(_0x55cf47,_0x3d037b){_0x55cf47=_0x55cf47-0x0;var _0x42bf2b=_0xe62d[_0x55cf47];return _0x42bf2b;};'use strict';var multer=require('multer');var util=require(_0xde62('0x0'));var path=require('path');var timeout=require(_0xde62('0x1'));var express=require(_0xde62('0x2'));var router=express[_0xde62('0x3')]();var fs_extra=require(_0xde62('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde62('0x5'));var config=require('../../config/environment');var controller=require(_0xde62('0x6'));router['get']('/',auth[_0xde62('0x7')](),controller[_0xde62('0x8')]);router[_0xde62('0x9')](_0xde62('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xde62('0x9')](_0xde62('0xb'),auth[_0xde62('0x7')](),controller['show']);router[_0xde62('0xc')]('/',auth[_0xde62('0x7')](),interaction[_0xde62('0xd')](_0xde62('0xe'),'smsmessage:create'),controller['create']);router[_0xde62('0xc')](_0xde62('0xf'),controller[_0xde62('0x10')]);router[_0xde62('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xde62('0x11')](_0xde62('0x12'),auth[_0xde62('0x7')](),controller[_0xde62('0x13')]);router[_0xde62('0x11')]('/:id/reject',auth[_0xde62('0x7')](),controller[_0xde62('0x14')]);router[_0xde62('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xde62('0x16')]);module[_0xde62('0x17')]=router; \ No newline at end of file +var _0x9464=['tracked','sms','smsmessage:create','status','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9464,0xd7));var _0x4946=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x9464[_0x21c6b8];return _0x39d474;};'use strict';var multer=require('multer');var util=require(_0x4946('0x0'));var path=require('path');var timeout=require(_0x4946('0x1'));var express=require(_0x4946('0x2'));var router=express[_0x4946('0x3')]();var fs_extra=require(_0x4946('0x4'));var auth=require(_0x4946('0x5'));var interaction=require(_0x4946('0x6'));var config=require(_0x4946('0x7'));var controller=require(_0x4946('0x8'));router[_0x4946('0x9')]('/',auth[_0x4946('0xa')](),controller[_0x4946('0xb')]);router[_0x4946('0x9')](_0x4946('0xc'),auth['isAuthenticated'](),controller[_0x4946('0xd')]);router['get'](_0x4946('0xe'),auth[_0x4946('0xa')](),controller[_0x4946('0xf')]);router[_0x4946('0x10')]('/',auth[_0x4946('0xa')](),interaction[_0x4946('0x11')](_0x4946('0x12'),_0x4946('0x13')),controller['create']);router[_0x4946('0x10')]('/:id/status',controller[_0x4946('0x14')]);router[_0x4946('0x15')](_0x4946('0xe'),auth[_0x4946('0xa')](),controller[_0x4946('0x16')]);router[_0x4946('0x15')]('/:id/accept',auth[_0x4946('0xa')](),controller[_0x4946('0x17')]);router[_0x4946('0x15')](_0x4946('0x18'),auth[_0x4946('0xa')](),controller[_0x4946('0x19')]);router[_0x4946('0x1a')](_0x4946('0xe'),auth[_0x4946('0xa')](),controller[_0x4946('0x1b')]);module[_0x4946('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 52950c1..509a480 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 _0x4b31=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x393b0a,_0x56e28a){var _0xfd8fb4=function(_0x41648b){while(--_0x41648b){_0x393b0a['push'](_0x393b0a['shift']());}};_0xfd8fb4(++_0x56e28a);}(_0x4b31,0x1c4));var _0x14b3=function(_0xf60cd0,_0x34bf81){_0xf60cd0=_0xf60cd0-0x0;var _0x32ad56=_0x4b31[_0xf60cd0];return _0x32ad56;};'use strict';var Sequelize=require(_0x14b3('0x0'));module[_0x14b3('0x1')]={'body':{'type':Sequelize[_0x14b3('0x2')](_0x14b3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x14b3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14b3('0x5')]('in','out'),'defaultValue':_0x14b3('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x14b3('0x7')](0xbe)},'phone':{'type':Sequelize[_0x14b3('0x7')]},'readAt':{'type':Sequelize[_0x14b3('0x8')]},'secret':{'type':Sequelize[_0x14b3('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x14b3('0x7')]},'providerResponse':{'type':Sequelize[_0x14b3('0x2')]}}; \ No newline at end of file +var _0x6f3a=['out','STRING','DATE','exports','TEXT','BOOLEAN'];(function(_0x4e61ca,_0x428a6b){var _0x547291=function(_0xade5a0){while(--_0xade5a0){_0x4e61ca['push'](_0x4e61ca['shift']());}};_0x547291(++_0x428a6b);}(_0x6f3a,0xe7));var _0xa6f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6f3a[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xa6f3('0x0')]={'body':{'type':Sequelize[_0xa6f3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa6f3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa6f3('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa6f3('0x4')](0xbe)},'phone':{'type':Sequelize[_0xa6f3('0x4')]},'readAt':{'type':Sequelize[_0xa6f3('0x5')]},'secret':{'type':Sequelize[_0xa6f3('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa6f3('0x4')]},'providerResponse':{'type':Sequelize[_0xa6f3('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8bb3d5c..7d5ff6e 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f3c=['include','findAll','rows','show','params','fields','create','body','find','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','User','SIP/%s','SmsAccount','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','offset','limit','count','status','Content-Range','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x1f3c[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0xc1f3('0x0'));var rimraf=require(_0xc1f3('0x1'));var zipdir=require(_0xc1f3('0x2'));var jsonpatch=require(_0xc1f3('0x3'));var rp=require(_0xc1f3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc1f3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1f3('0x6'));var _=require(_0xc1f3('0x7'));var squel=require('squel');var crypto=require(_0xc1f3('0x8'));var jsforce=require(_0xc1f3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc1f3('0x5'));var querystring=require(_0xc1f3('0xa'));var Papa=require(_0xc1f3('0xb'));var Redis=require(_0xc1f3('0xc'));var authService=require(_0xc1f3('0xd'));var qs=require(_0xc1f3('0xe'));var as=require(_0xc1f3('0xf'));var hardwareService=require(_0xc1f3('0x10'));var logger=require(_0xc1f3('0x11'))(_0xc1f3('0x12'));var utils=require(_0xc1f3('0x13'));var config=require(_0xc1f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1f3('0x15'))['db'];config['redis']=_[_0xc1f3('0x16')](config['redis'],{'host':_0xc1f3('0x17'),'port':0x18eb});var socket=require(_0xc1f3('0x18'))(new Redis(config[_0xc1f3('0x19')]));require(_0xc1f3('0x1a'))[_0xc1f3('0x1b')](socket);var jayson=require(_0xc1f3('0x1c'));var client=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232c});var client9002=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3aee70,_0xd96b1a,_0x1d028c,_0x224405){return new BPromise(function(_0x1d0bbf,_0x18718f){var _0x292200=_0x224405||client;return _0x292200[_0xc1f3('0x1f')](_0x3aee70,_0x1d028c)[_0xc1f3('0x20')](function(_0x384e34){logger[_0xc1f3('0x21')](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xd96b1a,_0xc1f3('0x23'),JSON[_0xc1f3('0x26')](_0x384e34));if(_0x384e34[_0xc1f3('0x27')]){if(_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x28')]===0x1f4){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x18718f(_0x384e34[_0xc1f3('0x27')]['message']);}logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x1d0bbf(_0x384e34['error']['message']);}else{logger['info'](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));_0x1d0bbf(_0x384e34['result']['message']);}})[_0xc1f3('0x2a')](function(_0x32cc58){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x32cc58);_0x18718f(_0x32cc58);});});}function respondWithStatusCode(_0x247273,_0xca9551){_0xca9551=_0xca9551||0xcc;return function(_0x4d8b22){if(_0x4d8b22){return _0x247273[_0xc1f3('0x2b')](_0xca9551);}return _0x247273['status'](_0xca9551)[_0xc1f3('0x2c')]();};}function respondWithResult(_0x5a308f,_0x3d6ffa){_0x3d6ffa=_0x3d6ffa||0xc8;return function(_0xe82fda){if(_0xe82fda){return _0x5a308f['status'](_0x3d6ffa)[_0xc1f3('0x2d')](_0xe82fda);}};}function respondWithFilteredResult(_0xa634b2,_0x48d8d9){return function(_0x5134e2){if(_0x5134e2){var _0xba1594=typeof _0x48d8d9[_0xc1f3('0x2e')]==='undefined'&&typeof _0x48d8d9[_0xc1f3('0x2f')]==='undefined';var _0x5c496b=_0x5134e2[_0xc1f3('0x30')];var _0x1f93eb=_0xba1594?0x0:_0x48d8d9['offset'];var _0x29e377=_0xba1594?_0x5134e2[_0xc1f3('0x30')]:_0x48d8d9[_0xc1f3('0x2e')]+_0x48d8d9[_0xc1f3('0x2f')];var _0x4511dc;if(_0x29e377>=_0x5c496b){_0x29e377=_0x5c496b;_0x4511dc=0xc8;}else{_0x4511dc=0xce;}_0xa634b2[_0xc1f3('0x31')](_0x4511dc);return _0xa634b2['set'](_0xc1f3('0x32'),_0x1f93eb+'-'+_0x29e377+'/'+_0x5c496b)[_0xc1f3('0x2d')](_0x5134e2);}return null;};}function patchUpdates(_0x3a682e){return function(_0x376188){try{jsonpatch[_0xc1f3('0x33')](_0x376188,_0x3a682e,!![]);}catch(_0x3d3651){return BPromise['reject'](_0x3d3651);}return _0x376188[_0xc1f3('0x34')]();};}function saveUpdates(_0x5ad983,_0x59cc66){return function(_0x39385f){if(_0x39385f){return _0x39385f[_0xc1f3('0x35')](_0x5ad983)[_0xc1f3('0x20')](function(_0x12f945){return _0x12f945;});}return null;};}function removeEntity(_0x5e058f,_0x76c393){return function(_0xbfc61b){if(_0xbfc61b){return _0xbfc61b[_0xc1f3('0x36')]()['then'](function(){_0x5e058f[_0xc1f3('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56eb94,_0x24c9ab){return function(_0x285b7e){if(!_0x285b7e){_0x56eb94[_0xc1f3('0x2b')](0x194);}return _0x285b7e;};}function handleError(_0x14f688,_0x5b8762){_0x5b8762=_0x5b8762||0x1f4;return function(_0x36494e){logger[_0xc1f3('0x27')](_0x36494e['stack']);if(_0x36494e['name']){delete _0x36494e[_0xc1f3('0x37')];}_0x14f688[_0xc1f3('0x31')](_0x5b8762)[_0xc1f3('0x38')](_0x36494e);};}exports[_0xc1f3('0x39')]=function(_0x17640c,_0x365654){var _0x255bc9={},_0x23c53b={},_0x4d71cc={'count':0x0,'rows':[]};var _0x30b90b=_[_0xc1f3('0x3a')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')],function(_0x28c2ab){return{'name':_0x28c2ab['fieldName'],'type':_0x28c2ab['type'][_0xc1f3('0x3d')]};});_0x23c53b[_0xc1f3('0x3e')]=_[_0xc1f3('0x3a')](_0x30b90b,_0xc1f3('0x37'));_0x23c53b[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x17640c[_0xc1f3('0x3f')]);_0x23c53b['filters']=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],_0x23c53b['query']);_0x255bc9[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],qs['fields'](_0x17640c[_0xc1f3('0x3f')]['fields']));_0x255bc9[_0xc1f3('0x42')]=_0x255bc9[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x255bc9[_0xc1f3('0x42')]:_0x23c53b[_0xc1f3('0x3e')];if(!_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x44')](_0xc1f3('0x45'))){_0x255bc9[_0xc1f3('0x2f')]=qs['limit'](_0x17640c['query'][_0xc1f3('0x2f')]);_0x255bc9[_0xc1f3('0x2e')]=qs[_0xc1f3('0x2e')](_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x2e')]);}_0x255bc9[_0xc1f3('0x46')]=qs[_0xc1f3('0x47')](_0x17640c['query'][_0xc1f3('0x47')]);_0x255bc9[_0xc1f3('0x48')]=qs[_0xc1f3('0x49')](_[_0xc1f3('0x4a')](_0x17640c['query'],_0x23c53b[_0xc1f3('0x49')]),_0x30b90b);if(_0x17640c[_0xc1f3('0x3f')]['filter']){_0x255bc9[_0xc1f3('0x48')]=_[_0xc1f3('0x4b')](_0x255bc9[_0xc1f3('0x48')],{'$or':_[_0xc1f3('0x3a')](_0x30b90b,function(_0x3a1b67){if(_0x3a1b67['type']!=='VIRTUAL'){var _0x1aa9c4={};_0x1aa9c4[_0x3a1b67['name']]={'$like':'%'+_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x4c')]+'%'};return _0x1aa9c4;}})});}_0x255bc9=_[_0xc1f3('0x4b')]({},_0x255bc9,_0x17640c[_0xc1f3('0x4d')]);var _0x5adf0d={'where':_0x255bc9[_0xc1f3('0x48')]};return db[_0xc1f3('0x3b')][_0xc1f3('0x30')](_0x5adf0d)[_0xc1f3('0x20')](function(_0x21bb48){_0x4d71cc[_0xc1f3('0x30')]=_0x21bb48;if(_0x17640c['query'][_0xc1f3('0x4e')]){_0x255bc9[_0xc1f3('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xc1f3('0x50')](_0x255bc9);})['then'](function(_0x556c2a){_0x4d71cc[_0xc1f3('0x51')]=_0x556c2a;return _0x4d71cc;})[_0xc1f3('0x20')](respondWithFilteredResult(_0x365654,_0x255bc9))[_0xc1f3('0x2a')](handleError(_0x365654,null));};exports[_0xc1f3('0x52')]=function(_0x226ac6,_0x4f3d36){var _0x3f3e56={'raw':!![],'where':{'id':_0x226ac6[_0xc1f3('0x53')]['id']}},_0xddadbc={};_0xddadbc[_0xc1f3('0x3e')]=_[_0xc1f3('0x40')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')]);_0xddadbc[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x226ac6[_0xc1f3('0x3f')]);_0xddadbc['filters']=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],_0xddadbc['query']);_0x3f3e56[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],qs[_0xc1f3('0x54')](_0x226ac6[_0xc1f3('0x3f')]['fields']));_0x3f3e56[_0xc1f3('0x42')]=_0x3f3e56[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x3f3e56[_0xc1f3('0x42')]:_0xddadbc['model'];if(_0x226ac6[_0xc1f3('0x3f')][_0xc1f3('0x4e')]){_0x3f3e56[_0xc1f3('0x4f')]=[{'all':!![]}];}_0x3f3e56=_[_0xc1f3('0x4b')]({},_0x3f3e56,_0x226ac6['options']);return db[_0xc1f3('0x3b')]['find'](_0x3f3e56)[_0xc1f3('0x20')](handleEntityNotFound(_0x4f3d36,null))[_0xc1f3('0x20')](respondWithResult(_0x4f3d36,null))[_0xc1f3('0x2a')](handleError(_0x4f3d36,null));};exports[_0xc1f3('0x55')]=function(_0x30a98a,_0x56b13e){return db[_0xc1f3('0x3b')][_0xc1f3('0x55')](_0x30a98a[_0xc1f3('0x56')],{})[_0xc1f3('0x20')](respondWithResult(_0x56b13e,0xc9))['catch'](handleError(_0x56b13e,null));};exports['update']=function(_0x5a892e,_0x351d91){if(_0x5a892e[_0xc1f3('0x56')]['id']){delete _0x5a892e[_0xc1f3('0x56')]['id'];}return db[_0xc1f3('0x3b')]['find']({'where':{'id':_0x5a892e[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x351d91,null))[_0xc1f3('0x20')](saveUpdates(_0x5a892e[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](respondWithResult(_0x351d91,null))[_0xc1f3('0x2a')](handleError(_0x351d91,null));};exports[_0xc1f3('0x36')]=function(_0x1c1f98,_0x26a404){return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x1c1f98[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x26a404,null))[_0xc1f3('0x20')](removeEntity(_0x26a404,null))['catch'](handleError(_0x26a404,null));};exports[_0xc1f3('0x58')]=function(_0x5a180a,_0x51c871){return db['SmsMessage']['describe']()[_0xc1f3('0x20')](respondWithResult(_0x51c871,null))[_0xc1f3('0x2a')](handleError(_0x51c871,null));};var interaction_log=require(_0xc1f3('0x11'))(_0xc1f3('0x59'));exports[_0xc1f3('0x5a')]=function(_0x3d014c,_0x59e3b2,_0x3ed229){var _0x1fb566={'agent':{},'channel':'sms'};if(_0x3d014c['body']['id']){delete _0x3d014c[_0xc1f3('0x56')]['id'];}_0x3d014c[_0xc1f3('0x56')]['read']=!![];_0x3d014c['body']['readAt']=moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c'));_0x3d014c['body']['UserId']=_0x3d014c[_0xc1f3('0x56')]['UserId']||_0x3d014c['user']['id'];_0x1fb566[_0xc1f3('0x5d')]['id']=_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x3d014c[_0xc1f3('0x53')]['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))[_0xc1f3('0x20')](saveUpdates(_0x3d014c[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](function(_0x4858d1){if(_0x4858d1){_0x1fb566[_0xc1f3('0x29')]=_0x4858d1['get']({'plain':!![]});return db['SmsInteraction'][_0xc1f3('0x57')]({'where':{'id':_0x4858d1[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))['then'](function(_0x8d1afc){if(_0x8d1afc){return _0x8d1afc['update']({'UserId':_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')],'read1stAt':_[_0xc1f3('0x60')](_0x8d1afc['read1stAt'])?moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c')):undefined});}return null;})['then'](function(_0x1dcd45){if(_0x1dcd45){_0x1fb566[_0xc1f3('0x61')]=_0x1dcd45[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x63'),_0x3d014c[_0xc1f3('0x64')]['id'],_0x3d014c['user']['name'],_0x3d014c[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x1fb566[_0xc1f3('0x61')]['id'],_0x3d014c[_0xc1f3('0x56')]?JSON[_0xc1f3('0x26')](_0x3d014c[_0xc1f3('0x56')]):'null');return respondWithRpcPromise(_0xc1f3('0x66'),_0xc1f3('0x67'),_0x1fb566);}return null;})[_0xc1f3('0x20')](function(_0x1ea368){var _0x5a017e=_0xc1f3('0x68')+_0x1ea368['message'][_0xc1f3('0x69')];return db['sequelize']['query'](_0x5a017e,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x3741e9){return _0x3741e9;});})[_0xc1f3('0x20')](function(_0x28988e){if(_0x28988e){_0x1fb566[_0xc1f3('0x29')]['contact']=_0x28988e[0x0];if(!_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db['User'][_0xc1f3('0x57')]({'where':{'id':_0x3d014c['body'][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),_0xc1f3('0x6d'),_0xc1f3('0x6e'),_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x2a3c59){if(!_0x2a3c59)return null;_0x1fb566[_0xc1f3('0x29')]['agent']=_0x2a3c59;return _0x1fb566;})[_0xc1f3('0x20')](function(_0x2341d9){if(_0x2341d9){if(_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x70')]){_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x71')]=util['format']('SIP/%s',_0x3d014c['user'][_0xc1f3('0x37')]);_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566['message'][_0xc1f3('0x73')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x74')]=_0xc1f3('0x5a');return respondWithRpcPromise(_0xc1f3('0x75'),'EventManager',{'event':_0xc1f3('0x76'),'message':_0x1fb566[_0xc1f3('0x29')]},client9002)[_0xc1f3('0x20')](function(){return _0x1fb566;});}return _0x1fb566;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x59e3b2,null))[_0xc1f3('0x2a')](handleError(_0x59e3b2,null));};var interaction_log=require('../../config/logger')(_0xc1f3('0x59'));exports[_0xc1f3('0x77')]=function(_0x27c584,_0x4f7801,_0x5143e1){var _0x18fa9e={'agent':{},'channel':'sms'};if(_0x27c584[_0xc1f3('0x56')]['id']){delete _0x27c584[_0xc1f3('0x56')]['id'];}_0x27c584[_0xc1f3('0x56')]['UserId']=_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')]||_0x27c584[_0xc1f3('0x64')]['id'];_0x18fa9e[_0xc1f3('0x5d')]['id']=_0x27c584['body'][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x27c584['params']['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0x2ab773){if(_0x2ab773){_0x18fa9e[_0xc1f3('0x29')]=_0x2ab773[_0xc1f3('0x62')]({'plain':!![]});return db[_0xc1f3('0x78')][_0xc1f3('0x57')]({'where':{'id':_0x2ab773[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0xabb11b){if(_0xabb11b){_0x18fa9e[_0xc1f3('0x61')]=_0xabb11b[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x79'),_0x27c584[_0xc1f3('0x64')]['id'],_0x27c584[_0xc1f3('0x64')]['name'],_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x18fa9e[_0xc1f3('0x61')]['id'],_0x27c584[_0xc1f3('0x56')]?JSON['stringify'](_0x27c584[_0xc1f3('0x56')]):_0xc1f3('0x7a'));return respondWithRpcPromise(_0xc1f3('0x7b'),_0xc1f3('0x7c'),_0x18fa9e);}return null;})[_0xc1f3('0x20')](function(_0x12bcad){var _0x12d5f2=_0xc1f3('0x68')+_0x12bcad[_0xc1f3('0x29')][_0xc1f3('0x69')];return db[_0xc1f3('0x7d')][_0xc1f3('0x3f')](_0x12d5f2,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x4de1ad){return _0x4de1ad;});})[_0xc1f3('0x20')](function(_0x47df10){if(_0x47df10){_0x18fa9e['message'][_0xc1f3('0x7e')]=_0x47df10[0x0];if(!_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db[_0xc1f3('0x7f')][_0xc1f3('0x57')]({'where':{'id':_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),'fullname','email',_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x575168){if(!_0x575168)return null;_0x18fa9e[_0xc1f3('0x29')][_0xc1f3('0x5d')]=_0x575168;return _0x18fa9e;})[_0xc1f3('0x20')](function(_0x2ae53f){if(_0x2ae53f){_0x2ae53f[_0xc1f3('0x29')]['interface']=util[_0xc1f3('0x5b')](_0xc1f3('0x80'),_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x37')]);_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x73')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f['message'][_0xc1f3('0x74')]='reject';respondWithRpcPromise(_0xc1f3('0x75'),_0xc1f3('0x75'),{'event':'rejectmessage','message':_0x2ae53f[_0xc1f3('0x29')]},client9002);return _0x18fa9e;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x4f7801,null))['catch'](handleError(_0x4f7801,null));};exports['status']=function(_0x4776a7,_0xb21983,_0x1b2d6a){if(_0x4776a7[_0xc1f3('0x56')]['id']){delete _0x4776a7['body']['id'];}var _0x30f853;return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x4776a7[_0xc1f3('0x53')]['id']}})['then'](handleEntityNotFound(_0xb21983,null))['then'](function(_0xb52f9f){if(_0xb52f9f){_0x30f853=_0xb52f9f;return db[_0xc1f3('0x81')]['find']({'where':{'id':_0xb52f9f['SmsAccountId']}});}})[_0xc1f3('0x20')](handleEntityNotFound(_0xb21983,null))[_0xc1f3('0x20')](function(_0x2c8e93){if(_0x2c8e93){logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xc1f3('0x31'),_0xc1f3('0x82'),_0x2c8e93[_0xc1f3('0x83')],util['inspect'](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));switch(_0x2c8e93[_0xc1f3('0x83')]){case _0xc1f3('0x84'):if(_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x85')]&&_0x4776a7[_0xc1f3('0x56')]['MessageSid']===_0x30f853[_0xc1f3('0x86')]){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),'status','twilio',util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x89'):if(_0x4776a7[_0xc1f3('0x56')]['MessageUUID']&&_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x8a')]===_0x30f853[_0xc1f3('0x86')]&&_[_0xc1f3('0x8b')]([_0xc1f3('0x8c'),_0xc1f3('0x8d')],_0x4776a7['body'][_0xc1f3('0x8e')])>=0x0){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x8f'),util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x90'):var _0x3c835c=_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x91')][0x0];if(_0x3c835c[_0xc1f3('0x31')]['groupName']===_0xc1f3('0x92')){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x90'),util['inspect'](_0x4776a7['body'],{'showHidden':![],'depth':null}));}break;}return _0x30f853;}})['then'](respondWithResult(_0xb21983,null))[_0xc1f3('0x2a')](handleError(_0xb21983,null));}; \ No newline at end of file +var _0x6a55=['length','nolimit','sort','where','pick','merge','options','includeAll','include','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','[SMSMESSAGE: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','sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','null','RejectMessage','rejectMessage','Sequelize','User','fullname','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','results','DELIVERED','infobip','eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','reject','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2ab67a,_0x3016b){var _0x5c5fd6=function(_0x1ecd47){while(--_0x1ecd47){_0x2ab67a['push'](_0x2ab67a['shift']());}};_0x5c5fd6(++_0x3016b);}(_0x6a55,0xdb));var _0x56a5=function(_0x279f6d,_0x122316){_0x279f6d=_0x279f6d-0x0;var _0x5874a5=_0x6a55[_0x279f6d];return _0x5874a5;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];config[_0x56a5('0x17')]=_[_0x56a5('0x18')](config[_0x56a5('0x17')],{'host':_0x56a5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x56a5('0x1a'))[_0x56a5('0x1b')](socket);var jayson=require(_0x56a5('0x1c'));var client=jayson[_0x56a5('0x1d')][_0x56a5('0x1e')]({'port':0x232c});var client9002=jayson[_0x56a5('0x1d')][_0x56a5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c4028,_0x360297,_0x5488c6,_0x41e8b6){return new BPromise(function(_0x51d031,_0x14ab5b){var _0x3f3e5b=_0x41e8b6||client;return _0x3f3e5b[_0x56a5('0x1f')](_0x5c4028,_0x5488c6)[_0x56a5('0x20')](function(_0x1ba472){logger[_0x56a5('0x21')](_0x56a5('0x22'),_0x360297,'request\x20sent');logger[_0x56a5('0x23')](_0x56a5('0x24'),_0x360297,_0x56a5('0x25'),JSON[_0x56a5('0x26')](_0x1ba472));if(_0x1ba472['error']){if(_0x1ba472[_0x56a5('0x27')][_0x56a5('0x28')]===0x1f4){logger[_0x56a5('0x27')](_0x56a5('0x22'),_0x360297,_0x1ba472[_0x56a5('0x27')]['message']);return _0x14ab5b(_0x1ba472['error'][_0x56a5('0x29')]);}logger[_0x56a5('0x27')]('SmsMessage,\x20%s,\x20%s',_0x360297,_0x1ba472[_0x56a5('0x27')][_0x56a5('0x29')]);return _0x51d031(_0x1ba472[_0x56a5('0x27')][_0x56a5('0x29')]);}else{logger[_0x56a5('0x21')](_0x56a5('0x22'),_0x360297,_0x56a5('0x25'));_0x51d031(_0x1ba472[_0x56a5('0x2a')][_0x56a5('0x29')]);}})[_0x56a5('0x2b')](function(_0xcf212){logger[_0x56a5('0x27')](_0x56a5('0x22'),_0x360297,_0xcf212);_0x14ab5b(_0xcf212);});});}function respondWithStatusCode(_0x4f68b9,_0x5c76a7){_0x5c76a7=_0x5c76a7||0xcc;return function(_0x2d8e68){if(_0x2d8e68){return _0x4f68b9[_0x56a5('0x2c')](_0x5c76a7);}return _0x4f68b9[_0x56a5('0x2d')](_0x5c76a7)[_0x56a5('0x2e')]();};}function respondWithResult(_0x527e84,_0x18e863){_0x18e863=_0x18e863||0xc8;return function(_0x54ec36){if(_0x54ec36){return _0x527e84[_0x56a5('0x2d')](_0x18e863)[_0x56a5('0x2f')](_0x54ec36);}};}function respondWithFilteredResult(_0x1b27b5,_0x284ee5){return function(_0x4e7afd){if(_0x4e7afd){var _0x3b55e6=typeof _0x284ee5[_0x56a5('0x30')]===_0x56a5('0x31')&&typeof _0x284ee5['limit']===_0x56a5('0x31');var _0x29dbe7=_0x4e7afd[_0x56a5('0x32')];var _0x214649=_0x3b55e6?0x0:_0x284ee5[_0x56a5('0x30')];var _0x4e1a6b=_0x3b55e6?_0x4e7afd[_0x56a5('0x32')]:_0x284ee5[_0x56a5('0x30')]+_0x284ee5[_0x56a5('0x33')];var _0x34477c;if(_0x4e1a6b>=_0x29dbe7){_0x4e1a6b=_0x29dbe7;_0x34477c=0xc8;}else{_0x34477c=0xce;}_0x1b27b5[_0x56a5('0x2d')](_0x34477c);return _0x1b27b5['set']('Content-Range',_0x214649+'-'+_0x4e1a6b+'/'+_0x29dbe7)[_0x56a5('0x2f')](_0x4e7afd);}return null;};}function patchUpdates(_0xe17c5e){return function(_0x44649a){try{jsonpatch['apply'](_0x44649a,_0xe17c5e,!![]);}catch(_0x1de021){return BPromise[_0x56a5('0x34')](_0x1de021);}return _0x44649a['save']();};}function saveUpdates(_0x5c1b6a,_0x48b078){return function(_0x5ec891){if(_0x5ec891){return _0x5ec891[_0x56a5('0x35')](_0x5c1b6a)[_0x56a5('0x20')](function(_0x129cb9){return _0x129cb9;});}return null;};}function removeEntity(_0x5cb9c8,_0x5e778a){return function(_0x4ec189){if(_0x4ec189){return _0x4ec189[_0x56a5('0x36')]()[_0x56a5('0x20')](function(){_0x5cb9c8['status'](0xcc)[_0x56a5('0x2e')]();});}};}function handleEntityNotFound(_0x4e44bf,_0x112e26){return function(_0x1924df){if(!_0x1924df){_0x4e44bf[_0x56a5('0x2c')](0x194);}return _0x1924df;};}function handleError(_0x52b23f,_0x20d1cc){_0x20d1cc=_0x20d1cc||0x1f4;return function(_0x373243){logger[_0x56a5('0x27')](_0x373243['stack']);if(_0x373243[_0x56a5('0x37')]){delete _0x373243[_0x56a5('0x37')];}_0x52b23f[_0x56a5('0x2d')](_0x20d1cc)[_0x56a5('0x38')](_0x373243);};}exports[_0x56a5('0x39')]=function(_0x594b14,_0x4f2a18){var _0xbbe90e={},_0x84f99a={},_0x2b4661={'count':0x0,'rows':[]};var _0x436cb9=_[_0x56a5('0x3a')](db[_0x56a5('0x3b')][_0x56a5('0x3c')],function(_0x652028){return{'name':_0x652028[_0x56a5('0x3d')],'type':_0x652028[_0x56a5('0x3e')][_0x56a5('0x3f')]};});_0x84f99a[_0x56a5('0x40')]=_[_0x56a5('0x3a')](_0x436cb9,_0x56a5('0x37'));_0x84f99a[_0x56a5('0x41')]=_[_0x56a5('0x42')](_0x594b14[_0x56a5('0x41')]);_0x84f99a[_0x56a5('0x43')]=_[_0x56a5('0x44')](_0x84f99a[_0x56a5('0x40')],_0x84f99a[_0x56a5('0x41')]);_0xbbe90e[_0x56a5('0x45')]=_['intersection'](_0x84f99a['model'],qs[_0x56a5('0x46')](_0x594b14['query'][_0x56a5('0x46')]));_0xbbe90e[_0x56a5('0x45')]=_0xbbe90e[_0x56a5('0x45')][_0x56a5('0x47')]?_0xbbe90e[_0x56a5('0x45')]:_0x84f99a[_0x56a5('0x40')];if(!_0x594b14['query']['hasOwnProperty'](_0x56a5('0x48'))){_0xbbe90e[_0x56a5('0x33')]=qs[_0x56a5('0x33')](_0x594b14[_0x56a5('0x41')][_0x56a5('0x33')]);_0xbbe90e[_0x56a5('0x30')]=qs['offset'](_0x594b14[_0x56a5('0x41')][_0x56a5('0x30')]);}_0xbbe90e['order']=qs[_0x56a5('0x49')](_0x594b14[_0x56a5('0x41')][_0x56a5('0x49')]);_0xbbe90e[_0x56a5('0x4a')]=qs['filters'](_[_0x56a5('0x4b')](_0x594b14['query'],_0x84f99a[_0x56a5('0x43')]),_0x436cb9);if(_0x594b14[_0x56a5('0x41')]['filter']){_0xbbe90e[_0x56a5('0x4a')]=_['merge'](_0xbbe90e[_0x56a5('0x4a')],{'$or':_[_0x56a5('0x3a')](_0x436cb9,function(_0x5414de){if(_0x5414de[_0x56a5('0x3e')]!=='VIRTUAL'){var _0x2abac7={};_0x2abac7[_0x5414de['name']]={'$like':'%'+_0x594b14[_0x56a5('0x41')]['filter']+'%'};return _0x2abac7;}})});}_0xbbe90e=_[_0x56a5('0x4c')]({},_0xbbe90e,_0x594b14[_0x56a5('0x4d')]);var _0x30b5a6={'where':_0xbbe90e[_0x56a5('0x4a')]};return db[_0x56a5('0x3b')][_0x56a5('0x32')](_0x30b5a6)[_0x56a5('0x20')](function(_0x5ba74f){_0x2b4661['count']=_0x5ba74f;if(_0x594b14['query'][_0x56a5('0x4e')]){_0xbbe90e[_0x56a5('0x4f')]=[{'all':!![]}];}return db[_0x56a5('0x3b')]['findAll'](_0xbbe90e);})[_0x56a5('0x20')](function(_0x38aa81){_0x2b4661[_0x56a5('0x50')]=_0x38aa81;return _0x2b4661;})['then'](respondWithFilteredResult(_0x4f2a18,_0xbbe90e))[_0x56a5('0x2b')](handleError(_0x4f2a18,null));};exports[_0x56a5('0x51')]=function(_0x542cb3,_0x432fdb){var _0x1080f8={'raw':!![],'where':{'id':_0x542cb3[_0x56a5('0x52')]['id']}},_0x3ec2fa={};_0x3ec2fa[_0x56a5('0x40')]=_['keys'](db[_0x56a5('0x3b')][_0x56a5('0x3c')]);_0x3ec2fa[_0x56a5('0x41')]=_[_0x56a5('0x42')](_0x542cb3[_0x56a5('0x41')]);_0x3ec2fa['filters']=_[_0x56a5('0x44')](_0x3ec2fa[_0x56a5('0x40')],_0x3ec2fa['query']);_0x1080f8[_0x56a5('0x45')]=_[_0x56a5('0x44')](_0x3ec2fa[_0x56a5('0x40')],qs['fields'](_0x542cb3[_0x56a5('0x41')]['fields']));_0x1080f8[_0x56a5('0x45')]=_0x1080f8['attributes'][_0x56a5('0x47')]?_0x1080f8[_0x56a5('0x45')]:_0x3ec2fa[_0x56a5('0x40')];if(_0x542cb3[_0x56a5('0x41')]['includeAll']){_0x1080f8[_0x56a5('0x4f')]=[{'all':!![]}];}_0x1080f8=_['merge']({},_0x1080f8,_0x542cb3[_0x56a5('0x4d')]);return db[_0x56a5('0x3b')][_0x56a5('0x53')](_0x1080f8)[_0x56a5('0x20')](handleEntityNotFound(_0x432fdb,null))[_0x56a5('0x20')](respondWithResult(_0x432fdb,null))[_0x56a5('0x2b')](handleError(_0x432fdb,null));};exports[_0x56a5('0x54')]=function(_0x1c84e9,_0x331bbd){return db[_0x56a5('0x3b')]['create'](_0x1c84e9[_0x56a5('0x55')],{})[_0x56a5('0x20')](respondWithResult(_0x331bbd,0xc9))['catch'](handleError(_0x331bbd,null));};exports[_0x56a5('0x35')]=function(_0x5b9a2c,_0x241ccb){if(_0x5b9a2c[_0x56a5('0x55')]['id']){delete _0x5b9a2c[_0x56a5('0x55')]['id'];}return db[_0x56a5('0x3b')][_0x56a5('0x53')]({'where':{'id':_0x5b9a2c['params']['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x241ccb,null))[_0x56a5('0x20')](saveUpdates(_0x5b9a2c[_0x56a5('0x55')],null))[_0x56a5('0x20')](respondWithResult(_0x241ccb,null))['catch'](handleError(_0x241ccb,null));};exports['destroy']=function(_0x3455c5,_0x1b449a){return db[_0x56a5('0x3b')][_0x56a5('0x53')]({'where':{'id':_0x3455c5[_0x56a5('0x52')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x1b449a,null))[_0x56a5('0x20')](removeEntity(_0x1b449a,null))['catch'](handleError(_0x1b449a,null));};exports[_0x56a5('0x56')]=function(_0x3c9832,_0x190728){return db['SmsMessage']['describe']()[_0x56a5('0x20')](respondWithResult(_0x190728,null))[_0x56a5('0x2b')](handleError(_0x190728,null));};var interaction_log=require(_0x56a5('0x13'))(_0x56a5('0x57'));exports[_0x56a5('0x58')]=function(_0x2896d3,_0x3624b1,_0x47938a){var _0x405eac={'agent':{},'channel':_0x56a5('0x59')};if(_0x2896d3[_0x56a5('0x55')]['id']){delete _0x2896d3[_0x56a5('0x55')]['id'];}_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5a')]=!![];_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5b')]=moment()[_0x56a5('0x5c')](_0x56a5('0x5d'));_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5e')]=_0x2896d3[_0x56a5('0x55')]['UserId']||_0x2896d3['user']['id'];_0x405eac[_0x56a5('0x5f')]['id']=_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5e')];return db['SmsMessage'][_0x56a5('0x53')]({'where':{'id':_0x2896d3[_0x56a5('0x52')]['id'],'UserId':null}})[_0x56a5('0x20')](handleEntityNotFound(_0x3624b1,null))[_0x56a5('0x20')](saveUpdates(_0x2896d3[_0x56a5('0x55')],null))[_0x56a5('0x20')](function(_0x1923c5){if(_0x1923c5){_0x405eac[_0x56a5('0x29')]=_0x1923c5['get']({'plain':!![]});return db[_0x56a5('0x60')][_0x56a5('0x53')]({'where':{'id':_0x1923c5[_0x56a5('0x61')]}});}return null;})[_0x56a5('0x20')](handleEntityNotFound(_0x3624b1,null))[_0x56a5('0x20')](function(_0x30df23){if(_0x30df23){return _0x30df23[_0x56a5('0x35')]({'UserId':_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5e')],'read1stAt':_[_0x56a5('0x62')](_0x30df23[_0x56a5('0x63')])?moment()[_0x56a5('0x5c')](_0x56a5('0x5d')):undefined});}return null;})[_0x56a5('0x20')](function(_0x3c957b){if(_0x3c957b){_0x405eac['interaction']=_0x3c957b[_0x56a5('0x64')]({'plain':!![]});interaction_log[_0x56a5('0x21')](_0x56a5('0x65'),_0x2896d3['user']['id'],_0x2896d3[_0x56a5('0x66')]['name'],_0x2896d3[_0x56a5('0x66')][_0x56a5('0x67')],_0x405eac[_0x56a5('0x68')]['id'],_0x2896d3[_0x56a5('0x55')]?JSON[_0x56a5('0x26')](_0x2896d3[_0x56a5('0x55')]):'null');return respondWithRpcPromise(_0x56a5('0x69'),_0x56a5('0x6a'),_0x405eac);}return null;})[_0x56a5('0x20')](function(_0x46b7cc){var _0x1a9748=_0x56a5('0x6b')+_0x46b7cc[_0x56a5('0x29')]['ContactId'];return db[_0x56a5('0x6c')]['query'](_0x1a9748,{'type':db['Sequelize'][_0x56a5('0x6d')][_0x56a5('0x6e')],'raw':!![]})[_0x56a5('0x20')](function(_0x443b60){return _0x443b60;});})['then'](function(_0x314c85){if(_0x314c85){_0x405eac[_0x56a5('0x29')][_0x56a5('0x6f')]=_0x314c85[0x0];if(!_0x2896d3['body'][_0x56a5('0x5e')])return;return db['User'][_0x56a5('0x53')]({'where':{'id':_0x2896d3[_0x56a5('0x55')][_0x56a5('0x5e')],'role':_0x56a5('0x5f')},'attributes':['id',_0x56a5('0x37'),'fullname',_0x56a5('0x70'),_0x56a5('0x71')],'raw':!![]});}return null;})['then'](function(_0x3f2128){if(!_0x3f2128)return null;_0x405eac[_0x56a5('0x29')][_0x56a5('0x5f')]=_0x3f2128;return _0x405eac;})['then'](function(_0x1f2e6f){if(_0x1f2e6f){if(_0x2896d3[_0x56a5('0x55')][_0x56a5('0x72')]){_0x405eac[_0x56a5('0x29')][_0x56a5('0x73')]=util[_0x56a5('0x5c')](_0x56a5('0x74'),_0x2896d3[_0x56a5('0x66')][_0x56a5('0x37')]);_0x405eac[_0x56a5('0x29')][_0x56a5('0x75')]=_0x405eac[_0x56a5('0x75')];_0x405eac['message']['motionChannel']=_0x405eac[_0x56a5('0x75')];_0x405eac[_0x56a5('0x29')][_0x56a5('0x76')]=_0x56a5('0x58');return respondWithRpcPromise(_0x56a5('0x77'),_0x56a5('0x77'),{'event':_0x56a5('0x78'),'message':_0x405eac[_0x56a5('0x29')]},client9002)[_0x56a5('0x20')](function(){return _0x405eac;});}return _0x405eac;}return null;})[_0x56a5('0x20')](respondWithResult(_0x3624b1,null))[_0x56a5('0x2b')](handleError(_0x3624b1,null));};var interaction_log=require(_0x56a5('0x13'))(_0x56a5('0x57'));exports[_0x56a5('0x34')]=function(_0x39b56c,_0x5a58bc,_0x294b93){var _0x537cd4={'agent':{},'channel':_0x56a5('0x59')};if(_0x39b56c[_0x56a5('0x55')]['id']){delete _0x39b56c[_0x56a5('0x55')]['id'];}_0x39b56c[_0x56a5('0x55')][_0x56a5('0x5e')]=_0x39b56c['body'][_0x56a5('0x5e')]||_0x39b56c[_0x56a5('0x66')]['id'];_0x537cd4[_0x56a5('0x5f')]['id']=_0x39b56c['body'][_0x56a5('0x5e')];return db[_0x56a5('0x3b')][_0x56a5('0x53')]({'where':{'id':_0x39b56c[_0x56a5('0x52')]['id'],'UserId':null}})[_0x56a5('0x20')](handleEntityNotFound(_0x5a58bc,null))[_0x56a5('0x20')](function(_0x4f8986){if(_0x4f8986){_0x537cd4['message']=_0x4f8986[_0x56a5('0x64')]({'plain':!![]});return db[_0x56a5('0x60')]['find']({'where':{'id':_0x4f8986['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5a58bc,null))[_0x56a5('0x20')](function(_0x4c2253){if(_0x4c2253){_0x537cd4[_0x56a5('0x68')]=_0x4c2253[_0x56a5('0x64')]({'plain':!![]});interaction_log[_0x56a5('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39b56c[_0x56a5('0x66')]['id'],_0x39b56c[_0x56a5('0x66')][_0x56a5('0x37')],_0x39b56c[_0x56a5('0x66')][_0x56a5('0x67')],_0x537cd4['interaction']['id'],_0x39b56c['body']?JSON[_0x56a5('0x26')](_0x39b56c[_0x56a5('0x55')]):_0x56a5('0x79'));return respondWithRpcPromise(_0x56a5('0x7a'),_0x56a5('0x7b'),_0x537cd4);}return null;})['then'](function(_0x565e9b){var _0x1900ca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x565e9b[_0x56a5('0x29')]['ContactId'];return db[_0x56a5('0x6c')][_0x56a5('0x41')](_0x1900ca,{'type':db[_0x56a5('0x7c')]['QueryTypes'][_0x56a5('0x6e')],'raw':!![]})[_0x56a5('0x20')](function(_0x2bfa59){return _0x2bfa59;});})[_0x56a5('0x20')](function(_0x441668){if(_0x441668){_0x537cd4[_0x56a5('0x29')][_0x56a5('0x6f')]=_0x441668[0x0];if(!_0x39b56c[_0x56a5('0x55')]['UserId'])return;return db[_0x56a5('0x7d')][_0x56a5('0x53')]({'where':{'id':_0x39b56c['body'][_0x56a5('0x5e')],'role':_0x56a5('0x5f')},'attributes':['id','name',_0x56a5('0x7e'),_0x56a5('0x70'),_0x56a5('0x71')],'raw':!![]});}return null;})[_0x56a5('0x20')](function(_0x547efa){if(!_0x547efa)return null;_0x537cd4['message'][_0x56a5('0x5f')]=_0x547efa;return _0x537cd4;})[_0x56a5('0x20')](function(_0x1b9814){if(_0x1b9814){_0x1b9814['message'][_0x56a5('0x73')]=util[_0x56a5('0x5c')](_0x56a5('0x74'),_0x39b56c['user'][_0x56a5('0x37')]);_0x1b9814[_0x56a5('0x29')]['channel']=_0x537cd4[_0x56a5('0x75')];_0x1b9814['message'][_0x56a5('0x7f')]=_0x537cd4[_0x56a5('0x75')];_0x1b9814[_0x56a5('0x29')][_0x56a5('0x76')]=_0x56a5('0x34');respondWithRpcPromise(_0x56a5('0x77'),_0x56a5('0x77'),{'event':_0x56a5('0x80'),'message':_0x1b9814['message']},client9002);return _0x537cd4;}return null;})[_0x56a5('0x20')](respondWithResult(_0x5a58bc,null))[_0x56a5('0x2b')](handleError(_0x5a58bc,null));};exports[_0x56a5('0x2d')]=function(_0x4b94b8,_0x1cdb25,_0x3a0885){if(_0x4b94b8[_0x56a5('0x55')]['id']){delete _0x4b94b8[_0x56a5('0x55')]['id'];}var _0x987877;return db[_0x56a5('0x3b')]['find']({'where':{'id':_0x4b94b8[_0x56a5('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cdb25,null))['then'](function(_0x477e2f){if(_0x477e2f){_0x987877=_0x477e2f;return db[_0x56a5('0x81')][_0x56a5('0x53')]({'where':{'id':_0x477e2f[_0x56a5('0x82')]}});}})['then'](handleEntityNotFound(_0x1cdb25,null))['then'](function(_0x5bd07b){if(_0x5bd07b){logger[_0x56a5('0x23')](_0x56a5('0x24'),_0x56a5('0x2d'),_0x56a5('0x83'),_0x5bd07b[_0x56a5('0x3e')],util['inspect'](_0x4b94b8[_0x56a5('0x55')],{'showHidden':![],'depth':null}));switch(_0x5bd07b[_0x56a5('0x3e')]){case _0x56a5('0x84'):if(_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x85')]&&_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x85')]===_0x987877[_0x56a5('0x86')]){return _0x987877['update']({'read':!![]});}else{logger['error'](_0x56a5('0x87'),_0x56a5('0x2d'),_0x56a5('0x84'),util[_0x56a5('0x88')](_0x4b94b8['body'],{'showHidden':![],'depth':null}));}break;case _0x56a5('0x89'):if(_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x8a')]&&_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x8a')]===_0x987877[_0x56a5('0x86')]&&_['indexOf']([_0x56a5('0x8b'),_0x56a5('0x8c')],_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x8d')])>=0x0){return _0x987877[_0x56a5('0x35')]({'read':!![]});}else{logger[_0x56a5('0x27')](_0x56a5('0x87'),'status','plivio',util['inspect'](_0x4b94b8['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x29065b=_0x4b94b8[_0x56a5('0x55')][_0x56a5('0x8e')][0x0];if(_0x29065b[_0x56a5('0x2d')]['groupName']===_0x56a5('0x8f')){return _0x987877[_0x56a5('0x35')]({'read':!![]});}else{logger['error'](_0x56a5('0x87'),_0x56a5('0x2d'),_0x56a5('0x90'),util[_0x56a5('0x88')](_0x4b94b8[_0x56a5('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x987877;}})[_0x56a5('0x20')](respondWithResult(_0x1cdb25,null))[_0x56a5('0x2b')](handleError(_0x1cdb25,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 36d4e04..679773b 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 _0x2587=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x2587,0x14f));var _0x7258=function(_0x309f89,_0x4dcee4){_0x309f89=_0x309f89-0x0;var _0xbbbf35=_0x2587[_0x309f89];return _0xbbbf35;};'use strict';var EventEmitter=require(_0x7258('0x0'));var SmsMessage=require(_0x7258('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7258('0x2')](0x0);var events={'afterCreate':_0x7258('0x3'),'afterUpdate':'update','afterDestroy':_0x7258('0x4')};function emitEvent(_0x38d842){return function(_0x1b981e,_0x53712d,_0x47e25f){SmsMessageEvents[_0x7258('0x5')](_0x38d842+':'+_0x1b981e['id'],_0x1b981e);SmsMessageEvents[_0x7258('0x5')](_0x38d842,_0x1b981e);_0x47e25f(null);};}for(var e in events){if(events[_0x7258('0x6')](e)){var event=events[e];SmsMessage[_0x7258('0x7')](e,emitEvent(event));}}module[_0x7258('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xce30=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xce30,0x180));var _0x0ce3=function(_0x341ced,_0x5774ad){_0x341ced=_0x341ced-0x0;var _0x5726b5=_0xce30[_0x341ced];return _0x5726b5;};'use strict';var EventEmitter=require(_0x0ce3('0x0'));var SmsMessage=require(_0x0ce3('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ce3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0ce3('0x3')};function emitEvent(_0x5b3fb8){return function(_0x2cfde8,_0x58a652,_0x513be0){SmsMessageEvents['emit'](_0x5b3fb8+':'+_0x2cfde8['id'],_0x2cfde8);SmsMessageEvents[_0x0ce3('0x4')](_0x5b3fb8,_0x2cfde8);_0x513be0(null);};}for(var e in events){if(events[_0x0ce3('0x5')](e)){var event=events[e];SmsMessage[_0x0ce3('0x6')](e,emitEvent(event));}}module[_0x0ce3('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 5634190..ef7f3f6 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 _0x4fdb=['Missing\x20parameters:\x20base_url','csc','login','sender','text','keys','sort','length','apiKey','md5','digest','hex','signature=','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','error','secret','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','/api/sms/messages/','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','inspect','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','username','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','messages','infobip'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x332475,_0x2049df){_0x332475=_0x332475-0x0;var _0x34d1eb=_0x4fdb[_0x332475];return _0x34d1eb;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xb4fd('0xd')],'type':_0xb4fd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x18c0f7,_0x4eb1ae,_0x1e1e16){var _0x17ac4b=_0x14052b[_0xb4fd('0xf')];var _0x23b08f=_0x18c0f7[_0xb4fd('0x10')]({'plain':!![]});if(_0x23b08f['direction'][_0xb4fd('0x11')]()==='in'||_0x23b08f[_0xb4fd('0x12')][_0xb4fd('0x11')]()===_0xb4fd('0x13')&&!_0x23b08f['secret']&&!_[_0xb4fd('0x14')](_0x23b08f[_0xb4fd('0x15')])){_0x17ac4b[_0xb4fd('0x16')]['findOne']({'where':{'id':_0x23b08f[_0xb4fd('0x17')]}})[_0xb4fd('0x18')](function(_0xc35d8d){if(_0xc35d8d){_0xc35d8d[_0xb4fd('0x19')]({'lastMsgAt':_0x23b08f[_0xb4fd('0x1a')],'lastMsgDirection':_0x23b08f[_0xb4fd('0x12')][_0xb4fd('0x11')]()});}})['catch'](function(_0x2076d5){console[_0xb4fd('0x1b')](_0x2076d5);});}if(_0x23b08f[_0xb4fd('0x12')]===_0xb4fd('0x13')&&!_0x23b08f[_0xb4fd('0x1c')]){var _0x137e51;_0x17ac4b[_0xb4fd('0x1d')][_0xb4fd('0x1e')]({'where':{'id':_0x23b08f[_0xb4fd('0x1f')]},'raw':!![]})[_0xb4fd('0x18')](function(_0x19f7b0){_0x137e51=_0x19f7b0;if(_0x137e51&&_0x137e51['type']){switch(_0x137e51['type']){case'twilio':var _0x5c14c0=require(_0xb4fd('0x20'));if(_0x137e51[_0xb4fd('0x21')]&&_0x137e51[_0xb4fd('0x22')]&&_0x137e51[_0xb4fd('0x23')]){var _0x458133=new _0x5c14c0(_0x137e51[_0xb4fd('0x21')],_0x137e51[_0xb4fd('0x22')]);_0x458133['messages']['create']({'body':_0x23b08f[_0xb4fd('0xd')],'to':_0x23b08f[_0xb4fd('0x23')],'from':_0x137e51[_0xb4fd('0x23')],'statusCallback':_0x137e51['remote']+_0xb4fd('0x24')+_0x23b08f['id']+'/status?token='+_0x137e51[_0xb4fd('0x25')]})['then'](function(_0x2a9c8c){if(_0x2a9c8c[_0xb4fd('0x26')]){return _0x18c0f7[_0xb4fd('0x19')]({'messageId':_0x2a9c8c[_0xb4fd('0x26')]});}})[_0xb4fd('0x27')](function(_0x456f35){logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate','twilio',util['inspect'](_0x456f35,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xb4fd('0x2a'):var _0x7c5313=_0xb4fd('0x2b');if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){var _0x477a53={'recipient':[_0x23b08f[_0xb4fd('0x23')]],'message':_0x23b08f[_0xb4fd('0xd')],'message_type':_0x137e51['smsMethod']};if(_0x137e51[_0xb4fd('0x2d')]&&_0x137e51[_0xb4fd('0x2d')]!=='SI'){_0x477a53['sender']=_0x137e51[_0xb4fd('0x23')];}var _0x57ce81={'url':_0x7c5313+_0xb4fd('0x2e')+_0x137e51['username']+_0xb4fd('0x2f')+_0x137e51[_0xb4fd('0x2c')],'method':_0xb4fd('0x30')};rp(_0x57ce81)['then'](function(_0x55eed3){var _0x4d7a63=_0x55eed3['split'](';');var _0x1eeb9c={'user_key':_0x4d7a63[0x0],'session_key':_0x4d7a63[0x1]};_0x57ce81={'url':_0x7c5313+_0xb4fd('0x31'),'method':_0xb4fd('0x32'),'headers':{'user_key':_0x1eeb9c[_0xb4fd('0x33')],'Session_key':_0x1eeb9c[_0xb4fd('0x34')]},'json':!![],'body':_0x477a53};return rp(_0x57ce81);})[_0xb4fd('0x18')](function(_0xbf95eb){if(_0xbf95eb[_0xb4fd('0x35')]>=0x1){var _0x16a08a={'messageId':_0xbf95eb[_0xb4fd('0x36')]};if(_0x137e51[_0xb4fd('0x2d')]!=='GP'||!_0x137e51[_0xb4fd('0x37')]){_0x16a08a[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x16a08a);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),util['inspect'](_0xbf95eb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x930751){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),util['inspect'](_0x930751,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x2a'),_0xb4fd('0x39'));}break;case'connectel':if(_0x137e51[_0xb4fd('0x22')]){var _0x4bc6b2={'recipient':_0x23b08f[_0xb4fd('0x23')],'message':_0x23b08f[_0xb4fd('0xd')],'sender':_0x137e51['senderString']||_0x137e51['phone'],'authorization':_0x137e51[_0xb4fd('0x22')]};var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x3a'),'body':_0x4bc6b2,'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x2718a0){var _0x478cf3={'messageId':_0x2718a0[_0xb4fd('0x3b')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x478cf3['read']=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x478cf3);})[_0xb4fd('0x27')](function(_0x17e024){logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x3c'),util[_0xb4fd('0x3d')](_0x17e024,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),'connectel',_0xb4fd('0x3e'));}break;case _0xb4fd('0x3f'):if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){var _0x4bc6b2={'messages':[{'source':_0xb4fd('0x40'),'to':_0x23b08f[_0xb4fd('0x23')],'body':_0x23b08f[_0xb4fd('0xd')],'from':_0x137e51['senderString']||_0x137e51[_0xb4fd('0x23')]}]};var _0x671ce5=util[_0xb4fd('0x41')]('%s:%s',_0x137e51[_0xb4fd('0x42')],_0x137e51['password']);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4bc6b2,'headers':{'Authorization':util[_0xb4fd('0x41')]('Basic\x20%s',new Buffer(_0x671ce5)[_0xb4fd('0x43')](_0xb4fd('0x44')))},'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x5500ef){if(_0x5500ef[_0xb4fd('0x45')]>=0xc8&&_0x5500ef[_0xb4fd('0x45')]<=0xce){if(_0x5500ef[_0xb4fd('0x46')]&&_0x5500ef[_0xb4fd('0x46')][_0xb4fd('0x47')]>0x0){var _0x3415cd=_[_0xb4fd('0x48')](_0x5500ef['data']['messages']);var _0x1595f2={'messageId':_0x3415cd[_0xb4fd('0x49')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x1595f2[_0xb4fd('0x38')]=!![];}return _0x18c0f7['update'](_0x1595f2);}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb4fd('0x4a'),util[_0xb4fd('0x3d')](_0x5500ef,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'clickSend',util[_0xb4fd('0x3d')](_0x5500ef,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x3b6014){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x4a'),util[_0xb4fd('0x3d')](_0x3b6014,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x4a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb4fd('0x4b'):if(_0x137e51[_0xb4fd('0x4c')]&&_0x137e51[_0xb4fd('0x22')]){var _0x4bc6b2={'dst':_0x23b08f[_0xb4fd('0x23')],'text':_0x23b08f[_0xb4fd('0xd')],'src':_0x137e51['senderString']||_0x137e51[_0xb4fd('0x23')],'url':_0x137e51['remote']+'/api/sms/messages/'+_0x23b08f['id']+_0xb4fd('0x4d')+_0x137e51[_0xb4fd('0x25')]};var _0x671ce5=util[_0xb4fd('0x41')](_0xb4fd('0x4e'),_0x137e51[_0xb4fd('0x4c')],_0x137e51[_0xb4fd('0x22')]);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':util[_0xb4fd('0x41')](_0xb4fd('0x4f'),_0x137e51[_0xb4fd('0x4c')]),'body':_0x4bc6b2,'headers':{'Authorization':util[_0xb4fd('0x41')](_0xb4fd('0x50'),new Buffer(_0x671ce5)[_0xb4fd('0x43')]('base64'))},'json':!![]};rp(_0x4eb1ae)['then'](function(_0x130a5b){var _0x7c85e8={'messageId':_0x130a5b[_0xb4fd('0x51')][0x0]};return _0x18c0f7[_0xb4fd('0x19')](_0x7c85e8);})[_0xb4fd('0x27')](function(_0x5d1625){logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'plivo',util['inspect'](_0x5d1625,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x4b'),_0xb4fd('0x52'));}break;case'infobip':if(_0x137e51['username']&&_0x137e51[_0xb4fd('0x2c')]){if(_0x137e51[_0xb4fd('0x53')]){var _0x22ec0d={'method':'POST','uri':_0x137e51[_0xb4fd('0x53')]+_0xb4fd('0x54'),'body':{'username':_0x137e51[_0xb4fd('0x42')],'password':_0x137e51[_0xb4fd('0x2c')]},'json':!![]};return rp(_0x22ec0d)['then'](function(_0x423112){var _0x16c8e6={'method':'POST','uri':_0x137e51[_0xb4fd('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x137e51[_0xb4fd('0x23')],'destinations':[{'to':_0x23b08f['phone']}],'text':_0x23b08f[_0xb4fd('0xd')],'notifyUrl':_0x137e51[_0xb4fd('0x55')]+_0xb4fd('0x24')+_0x23b08f['id']+_0xb4fd('0x4d')+_0x137e51[_0xb4fd('0x25')],'notifyContentType':_0xb4fd('0x56'),'callbackData':_0x137e51[_0xb4fd('0x23')]+';'+_0x23b08f[_0xb4fd('0xd')]}]},'headers':{'Authorization':_0xb4fd('0x57')+_0x423112[_0xb4fd('0x25')]},'json':!![]};return rp(_0x16c8e6)[_0xb4fd('0x18')](function(_0x40882b){if(_0x40882b[_0xb4fd('0x58')]){var _0x454acd={'messageId':_0x40882b['messages'][0x0][_0xb4fd('0xc')]};if(!_0x137e51['deliveryReport']){_0x454acd[_0xb4fd('0x38')]=!![];}return _0x18c0f7['update'](_0x454acd);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x59'),util['inspect'](_0x40882b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x23333c){return logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x59'),util['inspect'](_0x23333c,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x59'),_0xb4fd('0x5a'));}}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),'infobip',_0xb4fd('0x39'));}break;case _0xb4fd('0x5b'):var _0x28a12c=require('crypto');if(_0x137e51['apiKey']){var _0x571571={};_0x571571[_0xb4fd('0x5c')]=_0x137e51['username'];_0x571571[_0xb4fd('0x23')]=_0x23b08f['phone'];_0x571571[_0xb4fd('0x5d')]=_0x137e51[_0xb4fd('0x23')];_0x571571[_0xb4fd('0x5e')]=_0x23b08f[_0xb4fd('0xd')];_0x571571['timestamp']=+new Date();var _0x216173='';var _0x155942='';var _0x5b4ebe=Object[_0xb4fd('0x5f')](_0x571571);_0x5b4ebe[_0xb4fd('0x60')]();for(var _0x5a2bf1=0x0;_0x5a2bf1<_0x5b4ebe[_0xb4fd('0x61')];_0x5a2bf1++){if(_0x216173!=''){_0x216173+='&';}_0x216173+=_0x5b4ebe[_0x5a2bf1]+'='+encodeURIComponent(_0x571571[_0x5b4ebe[_0x5a2bf1]]);_0x155942+=_0x571571[_0x5b4ebe[_0x5a2bf1]];}_0x155942+=_0x137e51[_0xb4fd('0x62')];_0x155942=_0x28a12c['createHash'](_0xb4fd('0x63'))[_0xb4fd('0x19')](_0x155942)[_0xb4fd('0x64')](_0xb4fd('0x65'));if(_0x216173!==''){_0x216173+='&';}_0x216173+=_0xb4fd('0x66')+_0x155942;var _0x57ce81={'method':'GET','uri':_0x137e51[_0xb4fd('0x53')]+_0xb4fd('0x67')+_0x216173,'json':!![]};return rp(_0x57ce81)[_0xb4fd('0x18')](function(_0xb0c444){var _0x3596f7=Object[_0xb4fd('0x5f')](_0xb0c444);if(_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x1b')]&&parseInt(_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x1b')])===0x0){var _0x4042c1={'messageId':_0xb0c444[_0x3596f7[0x0]][_0xb4fd('0x68')]};if(!_0x137e51[_0xb4fd('0x37')]){_0x4042c1[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0x4042c1);}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x5b'),util[_0xb4fd('0x3d')](_0xb0c444[_0xb4fd('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x462ae3){return logger['error'](_0xb4fd('0x28'),'afterCreate','csc',util['inspect'](_0x462ae3,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb4fd('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x137e51[_0xb4fd('0x62')]){var _0x53e09a={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x69'),'headers':{'Authorization':_0x137e51[_0xb4fd('0x62')]},'body':{'content':_0x23b08f[_0xb4fd('0xd')],'to':[_0x23b08f[_0xb4fd('0x23')]],'from':_0x137e51['phone'],'binary':![],'clientMessageId':'uuid','charset':_0xb4fd('0x6a')},'json':!![]};rp(_0x53e09a)[_0xb4fd('0x18')](function(_0x4d44ff){if(!_0x4d44ff[_0xb4fd('0x1b')]){var _0xc5c8b7={'messageId':_0x4d44ff[_0xb4fd('0x58')][0x0][_0xb4fd('0x6b')]};if(!_0x137e51['deliveryReport']){_0xc5c8b7[_0xb4fd('0x38')]=!![];}return _0x18c0f7[_0xb4fd('0x19')](_0xc5c8b7);}else{return logger[_0xb4fd('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb4fd('0x29'),_0xb4fd('0x6c'),util['inspect'](_0x4d44ff[_0xb4fd('0x1b')],{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0xc171d9){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6c'),util[_0xb4fd('0x3d')](_0xc171d9,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0xb4fd('0x6d'):if(_0x137e51[_0xb4fd('0x42')]&&_0x137e51[_0xb4fd('0x2c')]){var _0x671ce5=util[_0xb4fd('0x41')](_0xb4fd('0x4e'),_0x137e51[_0xb4fd('0x42')],_0x137e51[_0xb4fd('0x2c')]);var _0x4eb1ae={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x6e')+_0x137e51[_0xb4fd('0x6f')]+_0xb4fd('0x70'),'body':{'to':[_0x23b08f[_0xb4fd('0x23')]],'text':_0x23b08f['body'],'from':_0x137e51[_0xb4fd('0x23')],'applicationId':_0x137e51['applicationId']},'headers':{'Authorization':util[_0xb4fd('0x41')]('Basic\x20%s',new Buffer(_0x671ce5)[_0xb4fd('0x43')]('base64'))},'json':!![]};rp(_0x4eb1ae)[_0xb4fd('0x18')](function(_0x57deab){if(_0x57deab['id']){var _0x3c5042={'messageId':_0x57deab['id']};return _0x18c0f7[_0xb4fd('0x19')](_0x3c5042);}else{logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),util[_0xb4fd('0x3d')](_0x57deab,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x9ead9e){logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),util['inspect'](_0x9ead9e,{'showHidden':![],'depth':null}));});}else{logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb4fd('0x71'):if(_0x137e51[_0xb4fd('0x62')]){var _0x228d40={};var _0x57ce81={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x137e51[_0xb4fd('0x62')],'Content-Type':_0xb4fd('0x56')},'body':{'from':_0x137e51['phone'],'to':_0x23b08f[_0xb4fd('0x23')],'text':_0x23b08f[_0xb4fd('0xd')]},'json':!![]};return rp(_0x57ce81)[_0xb4fd('0x18')](function(_0x4b18f3){if(_0x4b18f3[_0xb4fd('0x72')]==0xca){_0x228d40[_0xb4fd('0x73')]=_0x4b18f3;var _0x2efa1a={'method':_0xb4fd('0x32'),'uri':_0xb4fd('0x74'),'headers':{'Authorization':_0xb4fd('0x75')+_0x137e51['apiKey'],'Content-Type':_0xb4fd('0x56')},'body':{'refid':_0x228d40[_0xb4fd('0x73')][_0xb4fd('0x76')]},'json':!![]};return rp(_0x2efa1a)[_0xb4fd('0x18')](function(_0x5b7898){_0x228d40[_0xb4fd('0x77')]=_0x5b7898;var _0x36241d={'messageId':_0x228d40[_0xb4fd('0x73')][_0xb4fd('0x76')],'read':!![]};return _0x18c0f7[_0xb4fd('0x19')](_0x36241d);});}else{return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),'afterCreate',_0xb4fd('0x71'),util[_0xb4fd('0x3d')](_0x4b18f3,{'showHidden':![],'depth':null}));}})[_0xb4fd('0x27')](function(_0x8313a8){return logger[_0xb4fd('0x1b')](_0xb4fd('0x28'),_0xb4fd('0x29'),_0xb4fd('0x71'),util[_0xb4fd('0x3d')](_0x8313a8,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xb4fd('0x28'),_0xb4fd('0x29'),'intelepeer',_0xb4fd('0x78'));}break;}}})['finally'](function(){_0x1e1e16();});}else{_0x1e1e16();}}},'charset':_0xb4fd('0x79'),'collate':_0xb4fd('0x7a')});}; \ No newline at end of file +var _0x44d4=['utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','SmsInteractionId','then','update','catch','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','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','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','remote','IBSSO\x20','Missing\x20parameters:\x20base_url','login','sender','text','timestamp','keys','length','apiKey','createHash','digest','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','intelepeer','Token\x20not\x20received','finally'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x44d4,0x161));var _0x444d=function(_0x201f73,_0x17489c){_0x201f73=_0x201f73-0x0;var _0x24516d=_0x44d4[_0x201f73];return _0x24516d;};'use strict';var _=require(_0x444d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x444d('0x1'));var BPromise=require(_0x444d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x444d('0x3'));var attributes=require(_0x444d('0x4'));module[_0x444d('0x5')]=function(_0x24f601,_0x45dfdb){return _0x24f601[_0x444d('0x6')](_0x444d('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x444d('0x8'),'fields':['messageId']},{'name':_0x444d('0x9'),'fields':[_0x444d('0xa')],'type':_0x444d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3982b2,_0x26f553,_0x44cd15){var _0x2e98c9=_0x24f601[_0x444d('0xc')];var _0x2fd224=_0x3982b2[_0x444d('0xd')]({'plain':!![]});if(_0x2fd224[_0x444d('0xe')]['toLowerCase']()==='in'||_0x2fd224[_0x444d('0xe')][_0x444d('0xf')]()==='out'&&!_0x2fd224[_0x444d('0x10')]&&!_[_0x444d('0x11')](_0x2fd224[_0x444d('0x12')])){_0x2e98c9['SmsInteraction'][_0x444d('0x13')]({'where':{'id':_0x2fd224[_0x444d('0x14')]}})[_0x444d('0x15')](function(_0x545a4b){if(_0x545a4b){_0x545a4b[_0x444d('0x16')]({'lastMsgAt':_0x2fd224['createdAt'],'lastMsgDirection':_0x2fd224[_0x444d('0xe')][_0x444d('0xf')]()});}})[_0x444d('0x17')](function(_0x1bd5db){console['error'](_0x1bd5db);});}if(_0x2fd224['direction']==='out'&&!_0x2fd224['secret']){var _0x1a0e21;_0x2e98c9[_0x444d('0x18')][_0x444d('0x19')]({'where':{'id':_0x2fd224['SmsAccountId']},'raw':!![]})['then'](function(_0x2f7809){_0x1a0e21=_0x2f7809;if(_0x1a0e21&&_0x1a0e21[_0x444d('0x1a')]){switch(_0x1a0e21[_0x444d('0x1a')]){case _0x444d('0x1b'):var _0x3e2bd2=require('twilio');if(_0x1a0e21[_0x444d('0x1c')]&&_0x1a0e21[_0x444d('0x1d')]&&_0x1a0e21[_0x444d('0x1e')]){var _0x3bac2f=new _0x3e2bd2(_0x1a0e21[_0x444d('0x1c')],_0x1a0e21[_0x444d('0x1d')]);_0x3bac2f[_0x444d('0x1f')]['create']({'body':_0x2fd224['body'],'to':_0x2fd224[_0x444d('0x1e')],'from':_0x1a0e21['phone'],'statusCallback':_0x1a0e21['remote']+_0x444d('0x20')+_0x2fd224['id']+_0x444d('0x21')+_0x1a0e21[_0x444d('0x22')]})['then'](function(_0x17cc83){if(_0x17cc83[_0x444d('0x23')]){return _0x3982b2[_0x444d('0x16')]({'messageId':_0x17cc83[_0x444d('0x23')]});}})[_0x444d('0x17')](function(_0x2faf9e){logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),'twilio',util['inspect'](_0x2faf9e,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x444d('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x444d('0x27'):var _0x197e30='https://api.skebby.it/API/v1.0/REST/';if(_0x1a0e21[_0x444d('0x28')]&&_0x1a0e21[_0x444d('0x29')]){var _0x3a4806={'recipient':[_0x2fd224[_0x444d('0x1e')]],'message':_0x2fd224['body'],'message_type':_0x1a0e21[_0x444d('0x2a')]};if(_0x1a0e21['smsMethod']&&_0x1a0e21[_0x444d('0x2a')]!=='SI'){_0x3a4806['sender']=_0x1a0e21[_0x444d('0x1e')];}var _0xd839f5={'url':_0x197e30+_0x444d('0x2b')+_0x1a0e21[_0x444d('0x28')]+_0x444d('0x2c')+_0x1a0e21['password'],'method':_0x444d('0x2d')};rp(_0xd839f5)[_0x444d('0x15')](function(_0x18b19c){var _0x371380=_0x18b19c[_0x444d('0x2e')](';');var _0x426062={'user_key':_0x371380[0x0],'session_key':_0x371380[0x1]};_0xd839f5={'url':_0x197e30+_0x444d('0x2f'),'method':_0x444d('0x30'),'headers':{'user_key':_0x426062[_0x444d('0x31')],'Session_key':_0x426062['session_key']},'json':!![],'body':_0x3a4806};return rp(_0xd839f5);})['then'](function(_0x46c94b){if(_0x46c94b[_0x444d('0x32')]>=0x1){var _0x48679e={'messageId':_0x46c94b[_0x444d('0x33')]};if(_0x1a0e21[_0x444d('0x2a')]!=='GP'||!_0x1a0e21[_0x444d('0x34')]){_0x48679e[_0x444d('0x35')]=!![];}return _0x3982b2[_0x444d('0x16')](_0x48679e);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x444d('0x27'),util[_0x444d('0x36')](_0x46c94b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x8a8b02){return logger['error'](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x27'),util[_0x444d('0x36')](_0x8a8b02,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x444d('0x27'),_0x444d('0x37'));}break;case _0x444d('0x38'):if(_0x1a0e21[_0x444d('0x1d')]){var _0x5486a6={'recipient':_0x2fd224[_0x444d('0x1e')],'message':_0x2fd224[_0x444d('0xa')],'sender':_0x1a0e21['senderString']||_0x1a0e21[_0x444d('0x1e')],'authorization':_0x1a0e21[_0x444d('0x1d')]};var _0x26f553={'method':'POST','uri':_0x444d('0x39'),'body':_0x5486a6,'json':!![]};rp(_0x26f553)[_0x444d('0x15')](function(_0x54d632){var _0x4352f1={'messageId':_0x54d632[_0x444d('0x3a')]};if(!_0x1a0e21[_0x444d('0x34')]){_0x4352f1[_0x444d('0x35')]=!![];}return _0x3982b2['update'](_0x4352f1);})['catch'](function(_0x57d0b8){logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x444d('0x26'),_0x444d('0x38'),util['inspect'](_0x57d0b8,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),'afterCreate',_0x444d('0x38'),_0x444d('0x3b'));}break;case _0x444d('0x3c'):if(_0x1a0e21[_0x444d('0x28')]&&_0x1a0e21[_0x444d('0x29')]){var _0x5486a6={'messages':[{'source':_0x444d('0x3d'),'to':_0x2fd224[_0x444d('0x1e')],'body':_0x2fd224['body'],'from':_0x1a0e21['senderString']||_0x1a0e21['phone']}]};var _0x2b37d7=util[_0x444d('0x3e')](_0x444d('0x3f'),_0x1a0e21[_0x444d('0x28')],_0x1a0e21['password']);var _0x26f553={'method':_0x444d('0x30'),'uri':_0x444d('0x40'),'body':_0x5486a6,'headers':{'Authorization':util['format'](_0x444d('0x41'),new Buffer(_0x2b37d7)['toString'](_0x444d('0x42')))},'json':!![]};rp(_0x26f553)[_0x444d('0x15')](function(_0xda6e33){if(_0xda6e33[_0x444d('0x43')]>=0xc8&&_0xda6e33['http_code']<=0xce){if(_0xda6e33[_0x444d('0x44')]&&_0xda6e33[_0x444d('0x44')][_0x444d('0x45')]>0x0){var _0x24728e=_[_0x444d('0x46')](_0xda6e33[_0x444d('0x44')][_0x444d('0x1f')]);var _0x20ebdf={'messageId':_0x24728e[_0x444d('0x47')]};if(!_0x1a0e21[_0x444d('0x34')]){_0x20ebdf[_0x444d('0x35')]=!![];}return _0x3982b2[_0x444d('0x16')](_0x20ebdf);}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x48'),util[_0x444d('0x36')](_0xda6e33,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x444d('0x26'),_0x444d('0x48'),util[_0x444d('0x36')](_0xda6e33,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4f9c27){logger['error'](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x48'),util[_0x444d('0x36')](_0x4f9c27,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x48'),_0x444d('0x37'));}break;case _0x444d('0x49'):if(_0x1a0e21[_0x444d('0x4a')]&&_0x1a0e21[_0x444d('0x1d')]){var _0x5486a6={'dst':_0x2fd224[_0x444d('0x1e')],'text':_0x2fd224['body'],'src':_0x1a0e21[_0x444d('0x4b')]||_0x1a0e21[_0x444d('0x1e')],'url':_0x1a0e21['remote']+_0x444d('0x20')+_0x2fd224['id']+_0x444d('0x21')+_0x1a0e21[_0x444d('0x22')]};var _0x2b37d7=util['format'](_0x444d('0x3f'),_0x1a0e21[_0x444d('0x4a')],_0x1a0e21[_0x444d('0x1d')]);var _0x26f553={'method':_0x444d('0x30'),'uri':util[_0x444d('0x3e')](_0x444d('0x4c'),_0x1a0e21[_0x444d('0x4a')]),'body':_0x5486a6,'headers':{'Authorization':util[_0x444d('0x3e')](_0x444d('0x41'),new Buffer(_0x2b37d7)['toString'](_0x444d('0x42')))},'json':!![]};rp(_0x26f553)['then'](function(_0x56d482){var _0x2958b3={'messageId':_0x56d482['message_uuid'][0x0]};return _0x3982b2[_0x444d('0x16')](_0x2958b3);})[_0x444d('0x17')](function(_0x451fe3){logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x444d('0x26'),_0x444d('0x49'),util[_0x444d('0x36')](_0x451fe3,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x49'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x444d('0x4d'):if(_0x1a0e21[_0x444d('0x28')]&&_0x1a0e21['password']){if(_0x1a0e21[_0x444d('0x4e')]){var _0x5d518d={'method':'POST','uri':_0x1a0e21[_0x444d('0x4e')]+'/auth/1/session','body':{'username':_0x1a0e21[_0x444d('0x28')],'password':_0x1a0e21[_0x444d('0x29')]},'json':!![]};return rp(_0x5d518d)[_0x444d('0x15')](function(_0x1d2803){var _0x4aa689={'method':_0x444d('0x30'),'uri':_0x1a0e21['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1a0e21[_0x444d('0x1e')],'destinations':[{'to':_0x2fd224[_0x444d('0x1e')]}],'text':_0x2fd224[_0x444d('0xa')],'notifyUrl':_0x1a0e21[_0x444d('0x4f')]+_0x444d('0x20')+_0x2fd224['id']+_0x444d('0x21')+_0x1a0e21[_0x444d('0x22')],'notifyContentType':'application/json','callbackData':_0x1a0e21[_0x444d('0x1e')]+';'+_0x2fd224[_0x444d('0xa')]}]},'headers':{'Authorization':_0x444d('0x50')+_0x1d2803['token']},'json':!![]};return rp(_0x4aa689)[_0x444d('0x15')](function(_0x2b3fcb){if(_0x2b3fcb[_0x444d('0x1f')]){var _0x508c70={'messageId':_0x2b3fcb[_0x444d('0x1f')][0x0][_0x444d('0x8')]};if(!_0x1a0e21[_0x444d('0x34')]){_0x508c70[_0x444d('0x35')]=!![];}return _0x3982b2[_0x444d('0x16')](_0x508c70);}else{return logger[_0x444d('0x24')](_0x444d('0x25'),'afterCreate','infobip',util[_0x444d('0x36')](_0x2b3fcb,{'showHidden':![],'depth':null}));}});})[_0x444d('0x17')](function(_0x435fa7){return logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x444d('0x26'),_0x444d('0x4d'),util[_0x444d('0x36')](_0x435fa7,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),'afterCreate',_0x444d('0x4d'),_0x444d('0x51'));}}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),'infobip',_0x444d('0x37'));}break;case'csc':var _0x36fdf6=require('crypto');if(_0x1a0e21['apiKey']){var _0x49057a={};_0x49057a[_0x444d('0x52')]=_0x1a0e21['username'];_0x49057a[_0x444d('0x1e')]=_0x2fd224['phone'];_0x49057a[_0x444d('0x53')]=_0x1a0e21[_0x444d('0x1e')];_0x49057a[_0x444d('0x54')]=_0x2fd224['body'];_0x49057a[_0x444d('0x55')]=+new Date();var _0xbad6a7='';var _0x2b669a='';var _0x233b04=Object[_0x444d('0x56')](_0x49057a);_0x233b04['sort']();for(var _0x20bb28=0x0;_0x20bb28<_0x233b04[_0x444d('0x57')];_0x20bb28++){if(_0xbad6a7!=''){_0xbad6a7+='&';}_0xbad6a7+=_0x233b04[_0x20bb28]+'='+encodeURIComponent(_0x49057a[_0x233b04[_0x20bb28]]);_0x2b669a+=_0x49057a[_0x233b04[_0x20bb28]];}_0x2b669a+=_0x1a0e21[_0x444d('0x58')];_0x2b669a=_0x36fdf6[_0x444d('0x59')]('md5')[_0x444d('0x16')](_0x2b669a)[_0x444d('0x5a')]('hex');if(_0xbad6a7!==''){_0xbad6a7+='&';}_0xbad6a7+=_0x444d('0x5b')+_0x2b669a;var _0xd839f5={'method':_0x444d('0x2d'),'uri':_0x1a0e21[_0x444d('0x4e')]+_0x444d('0x5c')+_0xbad6a7,'json':!![]};return rp(_0xd839f5)['then'](function(_0x22d771){var _0x43fe07=Object['keys'](_0x22d771);if(_0x22d771[_0x43fe07[0x0]][_0x444d('0x24')]&&parseInt(_0x22d771[_0x43fe07[0x0]][_0x444d('0x24')])===0x0){var _0x44a569={'messageId':_0x22d771[_0x43fe07[0x0]][_0x444d('0x5d')]};if(!_0x1a0e21['deliveryReport']){_0x44a569['read']=!![];}return _0x3982b2[_0x444d('0x16')](_0x44a569);}else{return logger[_0x444d('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x444d('0x5e'),util[_0x444d('0x36')](_0x22d771[_0x444d('0x24')],{'showHidden':![],'depth':null}));}})[_0x444d('0x17')](function(_0x2fff43){return logger['error'](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x5e'),util[_0x444d('0x36')](_0x2fff43,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),'csc',_0x444d('0x5f'));}break;case'clickatell':if(_0x1a0e21['apiKey']){var _0x3146f8={'method':_0x444d('0x30'),'uri':_0x444d('0x60'),'headers':{'Authorization':_0x1a0e21[_0x444d('0x58')]},'body':{'content':_0x2fd224[_0x444d('0xa')],'to':[_0x2fd224[_0x444d('0x1e')]],'from':_0x1a0e21[_0x444d('0x1e')],'binary':![],'clientMessageId':_0x444d('0x61'),'charset':'UTF-8'},'json':!![]};rp(_0x3146f8)[_0x444d('0x15')](function(_0x25838c){if(!_0x25838c[_0x444d('0x24')]){var _0x21640c={'messageId':_0x25838c[_0x444d('0x1f')][0x0][_0x444d('0x62')]};if(!_0x1a0e21[_0x444d('0x34')]){_0x21640c['read']=!![];}return _0x3982b2[_0x444d('0x16')](_0x21640c);}else{return logger['error'](_0x444d('0x25'),'afterCreate',_0x444d('0x63'),util['inspect'](_0x25838c[_0x444d('0x24')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3e7507){return logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x63'),util['inspect'](_0x3e7507,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x1a0e21[_0x444d('0x28')]&&_0x1a0e21[_0x444d('0x29')]){var _0x2b37d7=util[_0x444d('0x3e')](_0x444d('0x3f'),_0x1a0e21[_0x444d('0x28')],_0x1a0e21['password']);var _0x26f553={'method':'POST','uri':_0x444d('0x64')+_0x1a0e21[_0x444d('0x65')]+_0x444d('0x66'),'body':{'to':[_0x2fd224[_0x444d('0x1e')]],'text':_0x2fd224[_0x444d('0xa')],'from':_0x1a0e21[_0x444d('0x1e')],'applicationId':_0x1a0e21[_0x444d('0x67')]},'headers':{'Authorization':util[_0x444d('0x3e')](_0x444d('0x41'),new Buffer(_0x2b37d7)['toString'](_0x444d('0x42')))},'json':!![]};rp(_0x26f553)[_0x444d('0x15')](function(_0x4e986e){if(_0x4e986e['id']){var _0x1e72b7={'messageId':_0x4e986e['id']};return _0x3982b2['update'](_0x1e72b7);}else{logger[_0x444d('0x24')](_0x444d('0x25'),'afterCreate',_0x444d('0x68'),util[_0x444d('0x36')](_0x4e986e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2298e1){logger['error'](_0x444d('0x25'),'afterCreate','bandwidth',util[_0x444d('0x36')](_0x2298e1,{'showHidden':![],'depth':null}));});}else{logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x68'),_0x444d('0x37'));}break;case'intelepeer':if(_0x1a0e21[_0x444d('0x58')]){var _0x18185a={};var _0xd839f5={'method':_0x444d('0x30'),'uri':_0x444d('0x69'),'headers':{'Authorization':'Bearer\x20'+_0x1a0e21[_0x444d('0x58')],'Content-Type':_0x444d('0x6a')},'body':{'from':_0x1a0e21['phone'],'to':_0x2fd224[_0x444d('0x1e')],'text':_0x2fd224[_0x444d('0xa')]},'json':!![]};return rp(_0xd839f5)[_0x444d('0x15')](function(_0x1ad018){if(_0x1ad018[_0x444d('0x6b')]==0xca){_0x18185a['message']=_0x1ad018;var _0x5cd152={'method':_0x444d('0x30'),'uri':_0x444d('0x6c'),'headers':{'Authorization':_0x444d('0x6d')+_0x1a0e21['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x18185a[_0x444d('0x6e')][_0x444d('0x6f')]},'json':!![]};return rp(_0x5cd152)[_0x444d('0x15')](function(_0x4ce4d3){_0x18185a['status']=_0x4ce4d3;var _0x1cd594={'messageId':_0x18185a[_0x444d('0x6e')][_0x444d('0x6f')],'read':!![]};return _0x3982b2['update'](_0x1cd594);});}else{return logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x70'),util[_0x444d('0x36')](_0x1ad018,{'showHidden':![],'depth':null}));}})[_0x444d('0x17')](function(_0x2b9d89){return logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x70'),util[_0x444d('0x36')](_0x2b9d89,{'showHidden':![],'depth':null}));});}else{return logger[_0x444d('0x24')](_0x444d('0x25'),_0x444d('0x26'),_0x444d('0x70'),_0x444d('0x71'));}break;}}})[_0x444d('0x72')](function(){_0x44cd15();});}else{_0x44cd15();}}},'charset':_0x444d('0x73'),'collate':_0x444d('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8ecb2d5..d0e3646 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 _0x9a8c=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring'];(function(_0x5cf4ea,_0x49625f){var _0x165f92=function(_0x2cf4d1){while(--_0x2cf4d1){_0x5cf4ea['push'](_0x5cf4ea['shift']());}};_0x165f92(++_0x49625f);}(_0x9a8c,0xce));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc9a8('0x0'));var moment=require(_0xc9a8('0x1'));var BPromise=require(_0xc9a8('0x2'));var rs=require(_0xc9a8('0x3'));var fs=require('fs');var Redis=require(_0xc9a8('0x4'));var db=require(_0xc9a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a8('0x6'))(_0xc9a8('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9a8('0x8'));var client=jayson[_0xc9a8('0x9')][_0xc9a8('0xa')]({'port':0x232a});config[_0xc9a8('0xb')]=_['defaults'](config['redis'],{'host':_0xc9a8('0xc'),'port':0x18eb});var socket=require(_0xc9a8('0xd'))(new Redis(config[_0xc9a8('0xb')]));require(_0xc9a8('0xe'))[_0xc9a8('0xf')](socket);function respondWithRpcPromise(_0x201ca9,_0x547da2,_0x51e8c6){return new BPromise(function(_0x3d22e4,_0x12df3b){return client[_0xc9a8('0x10')](_0x201ca9,_0x51e8c6)[_0xc9a8('0x11')](function(_0x2ee8b3){logger[_0xc9a8('0x12')](_0xc9a8('0x13'),_0x547da2,'request\x20sent');logger[_0xc9a8('0x14')](_0xc9a8('0x15'),_0x547da2,'request\x20sent',JSON['stringify'](_0x2ee8b3));if(_0x2ee8b3[_0xc9a8('0x16')]){if(_0x2ee8b3['error'][_0xc9a8('0x17')]===0x1f4){logger[_0xc9a8('0x16')](_0xc9a8('0x13'),_0x547da2,_0x2ee8b3[_0xc9a8('0x16')][_0xc9a8('0x18')]);return _0x12df3b(_0x2ee8b3[_0xc9a8('0x16')][_0xc9a8('0x18')]);}logger['error'](_0xc9a8('0x13'),_0x547da2,_0x2ee8b3['error'][_0xc9a8('0x18')]);return _0x3d22e4(_0x2ee8b3['error'][_0xc9a8('0x18')]);}else{logger[_0xc9a8('0x12')](_0xc9a8('0x13'),_0x547da2,_0xc9a8('0x19'));_0x3d22e4(_0x2ee8b3[_0xc9a8('0x1a')]['message']);}})[_0xc9a8('0x1b')](function(_0x45a877){logger[_0xc9a8('0x16')]('SmsMessage,\x20%s,\x20%s',_0x547da2,_0x45a877);_0x12df3b(_0x45a877);});});}exports[_0xc9a8('0x1c')]=function(_0x484ac8){var _0x1ef992=this;return new Promise(function(_0x437bea,_0xcf910f){return db[_0xc9a8('0x1d')][_0xc9a8('0x1e')](_0x484ac8[_0xc9a8('0x1f')],{'raw':_0x484ac8['options']?_0x484ac8[_0xc9a8('0x20')][_0xc9a8('0x21')]===undefined?!![]:![]:!![]})[_0xc9a8('0x11')](function(_0x257d77){logger[_0xc9a8('0x12')](_0xc9a8('0x1c'),_0x484ac8);logger['debug'](_0xc9a8('0x1c'),_0x484ac8,JSON[_0xc9a8('0x22')](_0x257d77));_0x437bea(_0x257d77);})[_0xc9a8('0x1b')](function(_0x4e9a4){logger[_0xc9a8('0x16')](_0xc9a8('0x1c'),_0x4e9a4[_0xc9a8('0x18')],_0x484ac8);_0xcf910f(_0x1ef992['error'](0x1f4,_0x4e9a4[_0xc9a8('0x18')]));});});}; \ No newline at end of file +var _0xf450=['message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','./smsMessage.socket','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x86b61d,_0xaead61){var _0xf3b1d3=function(_0x43be24){while(--_0x43be24){_0x86b61d['push'](_0x86b61d['shift']());}};_0xf3b1d3(++_0xaead61);}(_0xf450,0x67));var _0x0f45=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf450[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0f45('0x0'));var util=require('util');var moment=require(_0x0f45('0x1'));var BPromise=require(_0x0f45('0x2'));var rs=require(_0x0f45('0x3'));var fs=require('fs');var Redis=require(_0x0f45('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f45('0x5'));var logger=require('../../config/logger')(_0x0f45('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f45('0x7'));var client=jayson[_0x0f45('0x8')][_0x0f45('0x9')]({'port':0x232a});config[_0x0f45('0xa')]=_[_0x0f45('0xb')](config[_0x0f45('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f45('0xa')]));require(_0x0f45('0xc'))[_0x0f45('0xd')](socket);function respondWithRpcPromise(_0xf491cf,_0x239b23,_0xcb0ab8){return new BPromise(function(_0x36b48d,_0x584783){return client['request'](_0xf491cf,_0xcb0ab8)[_0x0f45('0xe')](function(_0x1b4e38){logger['info'](_0x0f45('0xf'),_0x239b23,_0x0f45('0x10'));logger[_0x0f45('0x11')](_0x0f45('0x12'),_0x239b23,'request\x20sent',JSON['stringify'](_0x1b4e38));if(_0x1b4e38[_0x0f45('0x13')]){if(_0x1b4e38[_0x0f45('0x13')][_0x0f45('0x14')]===0x1f4){logger[_0x0f45('0x13')](_0x0f45('0xf'),_0x239b23,_0x1b4e38['error'][_0x0f45('0x15')]);return _0x584783(_0x1b4e38[_0x0f45('0x13')][_0x0f45('0x15')]);}logger[_0x0f45('0x13')]('SmsMessage,\x20%s,\x20%s',_0x239b23,_0x1b4e38[_0x0f45('0x13')]['message']);return _0x36b48d(_0x1b4e38[_0x0f45('0x13')][_0x0f45('0x15')]);}else{logger[_0x0f45('0x16')]('SmsMessage,\x20%s,\x20%s',_0x239b23,'request\x20sent');_0x36b48d(_0x1b4e38[_0x0f45('0x17')]['message']);}})[_0x0f45('0x18')](function(_0x2fe6d0){logger[_0x0f45('0x13')](_0x0f45('0xf'),_0x239b23,_0x2fe6d0);_0x584783(_0x2fe6d0);});});}exports[_0x0f45('0x19')]=function(_0x4e3cfb){var _0x3af2a7=this;return new Promise(function(_0x5cf38c,_0x3651e2){return db[_0x0f45('0x1a')][_0x0f45('0x1b')](_0x4e3cfb[_0x0f45('0x1c')],{'raw':_0x4e3cfb[_0x0f45('0x1d')]?_0x4e3cfb[_0x0f45('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x0f45('0xe')](function(_0x16cbc3){logger[_0x0f45('0x16')](_0x0f45('0x19'),_0x4e3cfb);logger[_0x0f45('0x11')](_0x0f45('0x19'),_0x4e3cfb,JSON[_0x0f45('0x1e')](_0x16cbc3));_0x5cf38c(_0x16cbc3);})[_0x0f45('0x18')](function(_0x2e34a3){logger[_0x0f45('0x13')](_0x0f45('0x19'),_0x2e34a3[_0x0f45('0x15')],_0x4e3cfb);_0x3651e2(_0x3af2a7[_0x0f45('0x13')](0x1f4,_0x2e34a3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4318e28..0ec250f 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 _0x105a=['save','update','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x47bf90,_0xb9a03b){var _0x608d23=function(_0x1c4952){while(--_0x1c4952){_0x47bf90['push'](_0x47bf90['shift']());}};_0x608d23(++_0xb9a03b);}(_0x105a,0x19c));var _0xa105=function(_0xb72077,_0x2220ff){_0xb72077=_0xb72077-0x0;var _0x23a7c3=_0x105a[_0xb72077];return _0x23a7c3;};'use strict';var SmsMessageEvents=require(_0xa105('0x0'));var events=[_0xa105('0x1'),'remove',_0xa105('0x2')];function createListener(_0x50fb7d,_0x2d6773){return function(_0x3ac2a4){_0x2d6773[_0xa105('0x3')](_0x50fb7d,_0x3ac2a4);};}function removeListener(_0x546217,_0x354c8f){return function(){SmsMessageEvents[_0xa105('0x4')](_0x546217,_0x354c8f);};}exports['register']=function(_0x1c7cd7){for(var _0x29bb48=0x0,_0x4a796d=events[_0xa105('0x5')];_0x29bb48<_0x4a796d;_0x29bb48++){var _0x6c5ff4=events[_0x29bb48];var _0x27056a=createListener(_0xa105('0x6')+_0x6c5ff4,_0x1c7cd7);SmsMessageEvents['on'](_0x6c5ff4,_0x27056a);}}; \ No newline at end of file +var _0x25d2=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x69662e,_0x4bfd53){var _0x126a16=function(_0xd5b1c){while(--_0xd5b1c){_0x69662e['push'](_0x69662e['shift']());}};_0x126a16(++_0x4bfd53);}(_0x25d2,0xfa));var _0x225d=function(_0x4ab4a1,_0x480781){_0x4ab4a1=_0x4ab4a1-0x0;var _0x417877=_0x25d2[_0x4ab4a1];return _0x417877;};'use strict';var SmsMessageEvents=require(_0x225d('0x0'));var events=['save',_0x225d('0x1'),'update'];function createListener(_0x63b49e,_0x598228){return function(_0x22bdef){_0x598228[_0x225d('0x2')](_0x63b49e,_0x22bdef);};}function removeListener(_0x1e93c0,_0x390d2b){return function(){SmsMessageEvents[_0x225d('0x3')](_0x1e93c0,_0x390d2b);};}exports[_0x225d('0x4')]=function(_0x3131db){for(var _0x3bf97e=0x0,_0x4c4b7f=events[_0x225d('0x5')];_0x3bf97e<_0x4c4b7f;_0x3bf97e++){var _0x387c71=events[_0x3bf97e];var _0x13b5e2=createListener(_0x225d('0x6')+_0x387c71,_0x3131db);SmsMessageEvents['on'](_0x387c71,_0x13b5e2);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6aecc43..5aba8e1 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 _0x2472=['describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated'];(function(_0x396fb3,_0x595c53){var _0x3d298f=function(_0x47870d){while(--_0x47870d){_0x396fb3['push'](_0x396fb3['shift']());}};_0x3d298f(++_0x595c53);}(_0x2472,0x88));var _0x2247=function(_0x32da2b,_0x38bc0a){_0x32da2b=_0x32da2b-0x0;var _0x5bc582=_0x2472[_0x32da2b];return _0x5bc582;};'use strict';var multer=require(_0x2247('0x0'));var util=require(_0x2247('0x1'));var path=require(_0x2247('0x2'));var timeout=require(_0x2247('0x3'));var express=require(_0x2247('0x4'));var router=express[_0x2247('0x5')]();var fs_extra=require(_0x2247('0x6'));var auth=require(_0x2247('0x7'));var interaction=require(_0x2247('0x8'));var config=require(_0x2247('0x9'));var controller=require(_0x2247('0xa'));router[_0x2247('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2247('0xc'),auth[_0x2247('0xd')](),controller[_0x2247('0xe')]);router[_0x2247('0xb')](_0x2247('0xf'),auth[_0x2247('0xd')](),controller[_0x2247('0x10')]);router[_0x2247('0xb')](_0x2247('0x11'),auth[_0x2247('0xd')](),controller['getMembers']);router[_0x2247('0xb')](_0x2247('0x12'),auth[_0x2247('0xd')](),controller[_0x2247('0x13')]);router[_0x2247('0xb')](_0x2247('0x14'),auth[_0x2247('0xd')](),controller[_0x2247('0x15')]);router[_0x2247('0x16')]('/',auth[_0x2247('0xd')](),controller[_0x2247('0x17')]);router[_0x2247('0x16')](_0x2247('0x12'),auth[_0x2247('0xd')](),controller['addTeams']);router[_0x2247('0x16')]('/:id/users',auth[_0x2247('0xd')](),controller[_0x2247('0x18')]);router['put']('/:id',auth[_0x2247('0xd')](),controller['update']);router['delete'](_0x2247('0xf'),auth[_0x2247('0xd')](),controller[_0x2247('0x19')]);router['delete'](_0x2247('0x12'),auth['isAuthenticated'](),controller[_0x2247('0x1a')]);router[_0x2247('0x1b')](_0x2247('0x14'),auth['isAuthenticated'](),controller[_0x2247('0x1c')]);module[_0x2247('0x1d')]=router; \ No newline at end of file +var _0x23e2=['update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0x23e2,0x11c));var _0x223e=function(_0x5391ef,_0x3c8788){_0x5391ef=_0x5391ef-0x0;var _0x136499=_0x23e2[_0x5391ef];return _0x136499;};'use strict';var multer=require(_0x223e('0x0'));var util=require(_0x223e('0x1'));var path=require(_0x223e('0x2'));var timeout=require(_0x223e('0x3'));var express=require(_0x223e('0x4'));var router=express[_0x223e('0x5')]();var fs_extra=require(_0x223e('0x6'));var auth=require(_0x223e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x223e('0x8'));var controller=require(_0x223e('0x9'));router[_0x223e('0xa')]('/',auth[_0x223e('0xb')](),controller[_0x223e('0xc')]);router[_0x223e('0xa')]('/describe',auth[_0x223e('0xb')](),controller[_0x223e('0xd')]);router['get'](_0x223e('0xe'),auth['isAuthenticated'](),controller[_0x223e('0xf')]);router[_0x223e('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x223e('0x10')]);router[_0x223e('0xa')]('/:id/teams',auth[_0x223e('0xb')](),controller[_0x223e('0x11')]);router[_0x223e('0xa')](_0x223e('0x12'),auth['isAuthenticated'](),controller[_0x223e('0x13')]);router['post']('/',auth[_0x223e('0xb')](),controller[_0x223e('0x14')]);router[_0x223e('0x15')](_0x223e('0x16'),auth[_0x223e('0xb')](),controller[_0x223e('0x17')]);router[_0x223e('0x15')](_0x223e('0x12'),auth[_0x223e('0xb')](),controller[_0x223e('0x18')]);router[_0x223e('0x19')](_0x223e('0xe'),auth[_0x223e('0xb')](),controller[_0x223e('0x1a')]);router[_0x223e('0x1b')]('/:id',auth[_0x223e('0xb')](),controller[_0x223e('0x1c')]);router[_0x223e('0x1b')](_0x223e('0x16'),auth[_0x223e('0xb')](),controller['removeTeams']);router[_0x223e('0x1b')](_0x223e('0x12'),auth[_0x223e('0xb')](),controller[_0x223e('0x1d')]);module[_0x223e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 650f114..996b668 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 _0x7774=['roundrobin','exports','STRING','ENUM','beepall'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7774,0x1b9));var _0x4777=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x7774[_0x868b7c];return _0x21683c;};'use strict';var Sequelize=require('sequelize');module[_0x4777('0x0')]={'name':{'type':Sequelize[_0x4777('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4777('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4777('0x2')]('rrmemory',_0x4777('0x3'),_0x4777('0x4'))}}; \ No newline at end of file +var _0xc6b7=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x42099a,_0x1de86e){var _0xfb11c8=function(_0x27593f){while(--_0x27593f){_0x42099a['push'](_0x42099a['shift']());}};_0xfb11c8(++_0x1de86e);}(_0xc6b7,0xba));var _0x7c6b=function(_0x2bcaca,_0x1ee50b){_0x2bcaca=_0x2bcaca-0x0;var _0x1e7efe=_0xc6b7[_0x2bcaca];return _0x1e7efe;};'use strict';var Sequelize=require(_0x7c6b('0x0'));module[_0x7c6b('0x1')]={'name':{'type':Sequelize[_0x7c6b('0x2')],'unique':_0x7c6b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c6b('0x2')]},'timeout':{'type':Sequelize[_0x7c6b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7c6b('0x5'),_0x7c6b('0x6'),_0x7c6b('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2c8ef22..e21e85d 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 _0xad04=['every','all','union','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserSmsQueue','order','SmsQueueId','User','UserId','agent','smsPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','findOne','ids','Agents','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','Team','select','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xad04,0x96));var _0x4ad0=function(_0x4c53b8,_0x445335){_0x4c53b8=_0x4c53b8-0x0;var _0x7cd78b=_0xad04[_0x4c53b8];return _0x7cd78b;};'use strict';var emlformat=require(_0x4ad0('0x0'));var rimraf=require(_0x4ad0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ad0('0x2'));var Mustache=require(_0x4ad0('0x3'));var util=require(_0x4ad0('0x4'));var path=require('path');var sox=require(_0x4ad0('0x5'));var csv=require(_0x4ad0('0x6'));var ejs=require(_0x4ad0('0x7'));var fs=require('fs');var fs_extra=require(_0x4ad0('0x8'));var _=require(_0x4ad0('0x9'));var squel=require(_0x4ad0('0xa'));var crypto=require(_0x4ad0('0xb'));var jsforce=require(_0x4ad0('0xc'));var deskjs=require(_0x4ad0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ad0('0xe'));var Redis=require(_0x4ad0('0xf'));var authService=require(_0x4ad0('0x10'));var qs=require(_0x4ad0('0x11'));var as=require(_0x4ad0('0x12'));var hardwareService=require(_0x4ad0('0x13'));var logger=require(_0x4ad0('0x14'))(_0x4ad0('0x15'));var utils=require('../../config/utils');var config=require(_0x4ad0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ad0('0x17'))['db'];config[_0x4ad0('0x18')]=_[_0x4ad0('0x19')](config['redis'],{'host':_0x4ad0('0x1a'),'port':0x18eb});var socket=require(_0x4ad0('0x1b'))(new Redis(config['redis']));require(_0x4ad0('0x1c'))[_0x4ad0('0x1d')](socket);function respondWithStatusCode(_0x1ee87f,_0x1b18b1){_0x1b18b1=_0x1b18b1||0xcc;return function(_0x4d5272){if(_0x4d5272){return _0x1ee87f[_0x4ad0('0x1e')](_0x1b18b1);}return _0x1ee87f[_0x4ad0('0x1f')](_0x1b18b1)[_0x4ad0('0x20')]();};}function respondWithResult(_0x3b5001,_0x1c3065){_0x1c3065=_0x1c3065||0xc8;return function(_0x88383c){if(_0x88383c){return _0x3b5001['status'](_0x1c3065)[_0x4ad0('0x21')](_0x88383c);}};}function respondWithFilteredResult(_0x3a634c,_0x53c63b){return function(_0xcadde5){if(_0xcadde5){var _0x1a0a58=typeof _0x53c63b[_0x4ad0('0x22')]===_0x4ad0('0x23')&&typeof _0x53c63b['limit']===_0x4ad0('0x23');var _0x34317e=_0xcadde5['count'];var _0x5a5802=_0x1a0a58?0x0:_0x53c63b[_0x4ad0('0x22')];var _0x39e58b=_0x1a0a58?_0xcadde5[_0x4ad0('0x24')]:_0x53c63b[_0x4ad0('0x22')]+_0x53c63b[_0x4ad0('0x25')];var _0x2a45f6;if(_0x39e58b>=_0x34317e){_0x39e58b=_0x34317e;_0x2a45f6=0xc8;}else{_0x2a45f6=0xce;}_0x3a634c[_0x4ad0('0x1f')](_0x2a45f6);return _0x3a634c[_0x4ad0('0x26')](_0x4ad0('0x27'),_0x5a5802+'-'+_0x39e58b+'/'+_0x34317e)[_0x4ad0('0x21')](_0xcadde5);}return null;};}function patchUpdates(_0x5af5cf){return function(_0x106222){try{jsonpatch['apply'](_0x106222,_0x5af5cf,!![]);}catch(_0x1299ea){return BPromise[_0x4ad0('0x28')](_0x1299ea);}return _0x106222[_0x4ad0('0x29')]();};}function saveUpdates(_0x1f2398,_0x17274c){return function(_0x2f2e6b){if(_0x2f2e6b){return _0x2f2e6b[_0x4ad0('0x2a')](_0x1f2398)[_0x4ad0('0x2b')](function(_0x3b880c){return _0x3b880c;});}return null;};}function removeEntity(_0x56012d,_0x305cbc){return function(_0x263726){if(_0x263726){return _0x263726['destroy']()[_0x4ad0('0x2b')](function(){var _0x550f35=_0x263726[_0x4ad0('0x2c')]({'plain':!![]});var _0x3426a8=_0x4ad0('0x2d');return db[_0x4ad0('0x2e')][_0x4ad0('0x2f')]({'where':{'type':_0x3426a8,'resourceId':_0x550f35['id']}})[_0x4ad0('0x2b')](function(){return _0x263726;});})[_0x4ad0('0x2b')](function(){_0x56012d[_0x4ad0('0x1f')](0xcc)[_0x4ad0('0x20')]();});}};}function handleEntityNotFound(_0x692799,_0x4ec496){return function(_0x5df6c6){if(!_0x5df6c6){_0x692799[_0x4ad0('0x1e')](0x194);}return _0x5df6c6;};}function handleError(_0x5f1b23,_0x34cfc2){_0x34cfc2=_0x34cfc2||0x1f4;return function(_0x489d87){logger[_0x4ad0('0x30')](_0x489d87[_0x4ad0('0x31')]);if(_0x489d87[_0x4ad0('0x32')]){delete _0x489d87[_0x4ad0('0x32')];}_0x5f1b23[_0x4ad0('0x1f')](_0x34cfc2)[_0x4ad0('0x33')](_0x489d87);};}exports[_0x4ad0('0x34')]=function(_0xd4164b,_0x297712){var _0x1191d9={},_0x13e30c={},_0x1cbe18={'count':0x0,'rows':[]};var _0x5618d3=_[_0x4ad0('0x35')](db[_0x4ad0('0x36')][_0x4ad0('0x37')],function(_0x524d60){return{'name':_0x524d60['fieldName'],'type':_0x524d60[_0x4ad0('0x38')][_0x4ad0('0x39')]};});_0x13e30c['model']=_[_0x4ad0('0x35')](_0x5618d3,_0x4ad0('0x32'));_0x13e30c[_0x4ad0('0x3a')]=_['keys'](_0xd4164b[_0x4ad0('0x3a')]);_0x13e30c[_0x4ad0('0x3b')]=_['intersection'](_0x13e30c[_0x4ad0('0x3c')],_0x13e30c['query']);_0x1191d9['attributes']=_[_0x4ad0('0x3d')](_0x13e30c[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x1191d9[_0x4ad0('0x3f')]=_0x1191d9[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x1191d9[_0x4ad0('0x3f')]:_0x13e30c['model'];if(!_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x41')](_0x4ad0('0x42'))){_0x1191d9['limit']=qs[_0x4ad0('0x25')](_0xd4164b['query'][_0x4ad0('0x25')]);_0x1191d9[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}_0x1191d9['order']=qs[_0x4ad0('0x43')](_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x1191d9[_0x4ad0('0x44')]=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0xd4164b[_0x4ad0('0x3a')],_0x13e30c['filters']),_0x5618d3);if(_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x1191d9[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x1191d9[_0x4ad0('0x44')],{'$or':_['map'](_0x5618d3,function(_0x1203a4){if(_0x1203a4[_0x4ad0('0x38')]!=='VIRTUAL'){var _0xc9bc9e={};_0xc9bc9e[_0x1203a4[_0x4ad0('0x32')]]={'$like':'%'+_0xd4164b['query'][_0x4ad0('0x46')]+'%'};return _0xc9bc9e;}})});}_0x1191d9=_['merge']({},_0x1191d9,_0xd4164b[_0x4ad0('0x48')]);var _0xde843b={'where':_0x1191d9[_0x4ad0('0x44')]};return db[_0x4ad0('0x36')][_0x4ad0('0x24')](_0xde843b)[_0x4ad0('0x2b')](function(_0x417ef8){_0x1cbe18[_0x4ad0('0x24')]=_0x417ef8;if(_0xd4164b[_0x4ad0('0x3a')][_0x4ad0('0x49')]){_0x1191d9['include']=[{'all':!![]}];}return db[_0x4ad0('0x36')][_0x4ad0('0x4a')](_0x1191d9);})['then'](function(_0x56c2aa){_0x1cbe18[_0x4ad0('0x4b')]=_0x56c2aa;return _0x1cbe18;})[_0x4ad0('0x2b')](respondWithFilteredResult(_0x297712,_0x1191d9))[_0x4ad0('0x4c')](handleError(_0x297712,null));};exports[_0x4ad0('0x4d')]=function(_0x5470a1,_0x27ad09){var _0x35e0a4={'raw':!![],'where':{'id':_0x5470a1['params']['id']}},_0x1314f4={};_0x1314f4[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db[_0x4ad0('0x36')]['rawAttributes']);_0x1314f4[_0x4ad0('0x3a')]=_['keys'](_0x5470a1[_0x4ad0('0x3a')]);_0x1314f4['filters']=_[_0x4ad0('0x3d')](_0x1314f4[_0x4ad0('0x3c')],_0x1314f4[_0x4ad0('0x3a')]);_0x35e0a4[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x1314f4['model'],qs['fields'](_0x5470a1[_0x4ad0('0x3a')]['fields']));_0x35e0a4[_0x4ad0('0x3f')]=_0x35e0a4[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x35e0a4['attributes']:_0x1314f4[_0x4ad0('0x3c')];if(_0x5470a1[_0x4ad0('0x3a')]['includeAll']){_0x35e0a4[_0x4ad0('0x4f')]=[{'all':!![]}];}_0x35e0a4=_['merge']({},_0x35e0a4,_0x5470a1[_0x4ad0('0x48')]);return db[_0x4ad0('0x36')]['find'](_0x35e0a4)[_0x4ad0('0x2b')](handleEntityNotFound(_0x27ad09,null))[_0x4ad0('0x2b')](respondWithResult(_0x27ad09,null))[_0x4ad0('0x4c')](handleError(_0x27ad09,null));};exports[_0x4ad0('0x50')]=function(_0x2dc8e0,_0x23cbf8){return db[_0x4ad0('0x36')][_0x4ad0('0x50')](_0x2dc8e0[_0x4ad0('0x51')],{})['then'](function(_0x37d816){var _0x4a38ab=_0x2dc8e0[_0x4ad0('0x52')]['get']({'plain':!![]});if(!_0x4a38ab)throw new Error(_0x4ad0('0x53'));if(_0x4a38ab[_0x4ad0('0x54')]===_0x4ad0('0x52')){var _0x5355ab=_0x37d816[_0x4ad0('0x2c')]({'plain':!![]});var _0x21a1ac=_0x4ad0('0x2d');return db[_0x4ad0('0x55')][_0x4ad0('0x56')]({'where':{'name':_0x21a1ac,'userProfileId':_0x4a38ab['userProfileId']},'raw':!![]})[_0x4ad0('0x2b')](function(_0x20db34){if(_0x20db34&&_0x20db34[_0x4ad0('0x57')]===0x0){return db[_0x4ad0('0x2e')][_0x4ad0('0x50')]({'name':_0x5355ab[_0x4ad0('0x32')],'resourceId':_0x5355ab['id'],'type':_0x20db34[_0x4ad0('0x32')],'sectionId':_0x20db34['id']},{})[_0x4ad0('0x2b')](function(){return _0x37d816;});}else{return _0x37d816;}})[_0x4ad0('0x4c')](function(_0x5a4bc2){logger[_0x4ad0('0x30')](_0x4ad0('0x58'),_0x5a4bc2);throw _0x5a4bc2;});}return _0x37d816;})[_0x4ad0('0x2b')](respondWithResult(_0x23cbf8,0xc9))['catch'](handleError(_0x23cbf8,null));};exports[_0x4ad0('0x2a')]=function(_0x37664e,_0x959612){if(_0x37664e[_0x4ad0('0x51')]['id']){delete _0x37664e[_0x4ad0('0x51')]['id'];}return db[_0x4ad0('0x36')][_0x4ad0('0x56')]({'where':{'id':_0x37664e[_0x4ad0('0x59')]['id']}})['then'](handleEntityNotFound(_0x959612,null))[_0x4ad0('0x2b')](saveUpdates(_0x37664e[_0x4ad0('0x51')],null))['then'](respondWithResult(_0x959612,null))[_0x4ad0('0x4c')](handleError(_0x959612,null));};exports[_0x4ad0('0x2f')]=function(_0x4aead4,_0x23030e){return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x4aead4[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x23030e,null))[_0x4ad0('0x2b')](removeEntity(_0x23030e,null))[_0x4ad0('0x4c')](handleError(_0x23030e,null));};exports[_0x4ad0('0x5a')]=function(_0x3cdd2b,_0x315abf){return db[_0x4ad0('0x36')][_0x4ad0('0x5a')]()[_0x4ad0('0x2b')](respondWithResult(_0x315abf,null))[_0x4ad0('0x4c')](handleError(_0x315abf,null));};exports[_0x4ad0('0x5b')]=function(_0x1e25a2,_0x179647,_0x50a18f){var _0x6f80e3={'raw':!![],'where':{}},_0x509fd0={},_0x24a233;return db['SmsQueue']['findOne']({'where':{'id':_0x1e25a2['params']['id']}})['then'](handleEntityNotFound(_0x179647,null))[_0x4ad0('0x2b')](function(_0x2e0540){if(_0x2e0540){_0x24a233=_0x2e0540[_0x4ad0('0x2c')]({'plain':!![]});_0x509fd0[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db[_0x4ad0('0x5c')][_0x4ad0('0x37')]);_0x509fd0[_0x4ad0('0x3a')]=_[_0x4ad0('0x4e')](_0x1e25a2[_0x4ad0('0x3a')]);_0x509fd0[_0x4ad0('0x3b')]=_[_0x4ad0('0x3d')](_0x509fd0[_0x4ad0('0x3c')],_0x509fd0[_0x4ad0('0x3a')]);_0x6f80e3[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x509fd0[_0x4ad0('0x3c')],qs['fields'](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x6f80e3[_0x4ad0('0x3f')]=_0x6f80e3['attributes'][_0x4ad0('0x40')]?_0x6f80e3['attributes']:_0x509fd0[_0x4ad0('0x3c')];if(!_0x1e25a2[_0x4ad0('0x3a')]['hasOwnProperty']('nolimit')){_0x6f80e3[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x25')]);_0x6f80e3[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}_0x6f80e3[_0x4ad0('0x5d')]=qs[_0x4ad0('0x43')](_0x1e25a2['query'][_0x4ad0('0x43')]);_0x6f80e3['where']=qs['filters'](_[_0x4ad0('0x45')](_0x1e25a2['query'],_0x509fd0[_0x4ad0('0x3b')]));_0x6f80e3[_0x4ad0('0x44')][_0x4ad0('0x5e')]=_0x2e0540['id'];if(_0x1e25a2[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x6f80e3[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x6f80e3[_0x4ad0('0x44')],{'$or':_[_0x4ad0('0x35')](_0x6f80e3[_0x4ad0('0x3f')],function(_0x2afbc4){var _0xeab59={};_0xeab59[_0x2afbc4]={'$like':'%'+_0x1e25a2['query']['filter']+'%'};return _0xeab59;})});}_0x6f80e3=_[_0x4ad0('0x47')]({},_0x6f80e3,_0x1e25a2['options']);return db['UserSmsQueue'][_0x4ad0('0x4a')](_0x6f80e3);}})['then'](function(_0x379913){if(_0x379913){return db[_0x4ad0('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x379913,_0x4ad0('0x60')),'role':_0x4ad0('0x61')},'attributes':['id',_0x4ad0('0x32'),_0x4ad0('0x62'),'updatedAt','createdAt']});}})['then'](function(_0x5ec857){if(_0x5ec857){return{'count':_0x5ec857['count'],'rows':_[_0x4ad0('0x35')](_0x5ec857[_0x4ad0('0x4b')],function(_0x246ac0){return{'membername':_0x246ac0['name'],'UserId':_0x246ac0['id'],'queue_name':_0x24a233[_0x4ad0('0x32')],'SmsQueueId':_0x24a233['id'],'interface':util[_0x4ad0('0x63')](_0x4ad0('0x64'),_0x4ad0('0x65'),_0x246ac0[_0x4ad0('0x32')]),'penalty':0x0,'paused':_0x246ac0[_0x4ad0('0x62')],'createdAt':_0x246ac0[_0x4ad0('0x66')],'updatedAt':_0x246ac0[_0x4ad0('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4ad0('0x2b')](respondWithFilteredResult(_0x179647,_0x6f80e3))['catch'](handleError(_0x179647,null));};exports[_0x4ad0('0x68')]=function(_0x5869eb,_0x445013,_0x55d603){var _0x5363a3={};var _0x28a731={};var _0x266138;var _0x44ede8;return db[_0x4ad0('0x36')][_0x4ad0('0x69')]({'where':{'id':_0x5869eb['params']['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x445013,null))['then'](function(_0x4e5b7d){if(_0x4e5b7d){_0x266138=_0x4e5b7d;_0x28a731[_0x4ad0('0x3c')]=_[_0x4ad0('0x4e')](db['Team'][_0x4ad0('0x37')]);_0x28a731[_0x4ad0('0x3a')]=_[_0x4ad0('0x4e')](_0x5869eb[_0x4ad0('0x3a')]);_0x28a731['filters']=_[_0x4ad0('0x3d')](_0x28a731[_0x4ad0('0x3c')],_0x28a731[_0x4ad0('0x3a')]);_0x5363a3['attributes']=_['intersection'](_0x28a731[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x5363a3[_0x4ad0('0x3f')]=_0x5363a3[_0x4ad0('0x3f')]['length']?_0x5363a3[_0x4ad0('0x3f')]:_0x28a731[_0x4ad0('0x3c')];_0x5363a3['order']=qs[_0x4ad0('0x43')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x5363a3['where']=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0x5869eb[_0x4ad0('0x3a')],_0x28a731[_0x4ad0('0x3b')]));if(_0x5869eb[_0x4ad0('0x3a')]['filter']){_0x5363a3['where']=_[_0x4ad0('0x47')](_0x5363a3[_0x4ad0('0x44')],{'$or':_['map'](_0x5363a3[_0x4ad0('0x3f')],function(_0x33c17a){var _0x4ed51c={};_0x4ed51c[_0x33c17a]={'$like':'%'+_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x46')]+'%'};return _0x4ed51c;})});}_0x5363a3=_[_0x4ad0('0x47')]({},_0x5363a3,_0x5869eb[_0x4ad0('0x48')]);return _0x266138[_0x4ad0('0x68')](_0x5363a3);}})[_0x4ad0('0x2b')](function(_0x11ede4){if(_0x11ede4){_0x44ede8=_0x11ede4[_0x4ad0('0x40')];if(!_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x41')]('nolimit')){_0x5363a3[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0x5869eb[_0x4ad0('0x3a')]['limit']);_0x5363a3[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0x5869eb[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}return _0x266138[_0x4ad0('0x68')](_0x5363a3);}})[_0x4ad0('0x2b')](function(_0x47f1ea){if(_0x47f1ea){return _0x47f1ea?{'count':_0x44ede8,'rows':_0x47f1ea}:null;}})[_0x4ad0('0x2b')](respondWithResult(_0x445013,null))['catch'](handleError(_0x445013,null));};exports['addTeams']=function(_0xf79e0b,_0x8d0787,_0x2ea500){var _0x411f95=_0xf79e0b[_0x4ad0('0x51')][_0x4ad0('0x6a')];return db['Team'][_0x4ad0('0x4a')]({'where':{'id':_0x411f95},'attributes':['id'],'include':[{'model':db[_0x4ad0('0x5f')],'as':_0x4ad0('0x6b'),'attributes':['id',_0x4ad0('0x32'),'online','voicePause',_0x4ad0('0x6c')],'raw':!![]}]})[_0x4ad0('0x2b')](function(_0x50b1dd){if(_0x50b1dd){var _0x3723fa=_['flatMap'](_0x50b1dd,function(_0x160c8d){var _0x240f7b=_0x160c8d['get']({'plain':!![]});return _0x240f7b[_0x4ad0('0x6b')];});return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0xf79e0b[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](function(_0x42f9eb){return db[_0x4ad0('0x6d')][_0x4ad0('0x6e')](function(_0x5a13e5){return _0x42f9eb[_0x4ad0('0x6f')](_0x411f95,{'transaction':_0x5a13e5})[_0x4ad0('0x2b')](function(){return BPromise['each'](_0x3723fa,function(_0x58da96){return db[_0x4ad0('0x5c')][_0x4ad0('0x70')]({'where':{'UserId':_0x58da96['id'],'SmsQueueId':_0xf79e0b[_0x4ad0('0x59')]['id']},'transaction':_0x5a13e5});});})['then'](function(){_0x3723fa[_0x4ad0('0x71')](function(_0x20c7d5){socket[_0x4ad0('0x72')](_0x4ad0('0x73'),{'UserId':_0x20c7d5['id'],'SmsQueueId':_0x42f9eb['id']});});});});});}})['then'](respondWithStatusCode(_0x8d0787,null))[_0x4ad0('0x4c')](handleError(_0x8d0787,null));};exports['removeTeams']=function(_0x2f0466,_0x3dae30,_0x4ae528){return db[_0x4ad0('0x74')][_0x4ad0('0x4a')]({'where':{'id':_0x2f0466[_0x4ad0('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4ad0('0x5f')],'as':_0x4ad0('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4ad0('0x2b')](handleEntityNotFound(_0x3dae30,null))[_0x4ad0('0x2b')](function(_0x57ee56){var _0xea8717=_[_0x4ad0('0x35')](_0x57ee56,'id');var _0x4ff155=[];var _0x50420a=[];var _0x1c0d06=squel[_0x4ad0('0x75')]();_0x1c0d06['field']('tq.TeamId')[_0x4ad0('0x76')](_0x4ad0('0x77'),'tq')[_0x4ad0('0x78')]('user_has_teams','ut',_0x4ad0('0x79'))[_0x4ad0('0x44')](_0x4ad0('0x7a'),_0x2f0466[_0x4ad0('0x59')]['id']);for(var _0x1461ad=0x0;_0x1461ad<_0x57ee56[_0x4ad0('0x40')];_0x1461ad+=0x1){let _0x18ed03=_0x57ee56[_0x1461ad];for(var _0x1d884=0x0;_0x1d884<_0x18ed03['Agents'][_0x4ad0('0x40')];_0x1d884+=0x1){let _0x4b2262=_0x18ed03[_0x4ad0('0x6b')][_0x1d884];var _0x2b3c76=_0x1c0d06[_0x4ad0('0x7b')]();_0x2b3c76[_0x4ad0('0x44')](_0x4ad0('0x7c'),_0x4b2262['id']);_0x50420a[_0x4ad0('0x7d')](db['sequelize'][_0x4ad0('0x3a')](_0x2b3c76[_0x4ad0('0x7e')](),{'type':db[_0x4ad0('0x6d')]['QueryTypes'][_0x4ad0('0x7f')]})['then'](function(_0x26efc3){if(_0x26efc3[_0x4ad0('0x40')]===0x1){return _0x4b2262['id'];}else{var _0x559a69=_[_0x4ad0('0x80')](_[_0x4ad0('0x35')](_0x26efc3,'TeamId'),function(_0x422ea6){return _['includes'](_0xea8717,_0x422ea6);});if(_0x559a69){return _0x4b2262['id'];}}}));}}return BPromise[_0x4ad0('0x81')](_0x50420a)[_0x4ad0('0x2b')](function(_0x21b6d0){_0x4ff155=_(_0x4ff155)[_0x4ad0('0x82')](_0x21b6d0)['compact']()[_0x4ad0('0x83')]();return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x2f0466['params']['id']}})[_0x4ad0('0x2b')](function(_0x47e51f){return db[_0x4ad0('0x6d')][_0x4ad0('0x6e')](function(_0x20b5a){return _0x47e51f[_0x4ad0('0x84')](_0x2f0466[_0x4ad0('0x3a')][_0x4ad0('0x6a')],{'transaction':_0x20b5a})[_0x4ad0('0x2b')](function(){if(!_[_0x4ad0('0x85')](_0x4ff155)){return _0x47e51f[_0x4ad0('0x86')](_0x4ff155,{'transaction':_0x20b5a});}})[_0x4ad0('0x2b')](function(){_0x4ff155[_0x4ad0('0x71')](function(_0xa3e3dc){socket['emit'](_0x4ad0('0x87'),{'UserId':_0xa3e3dc,'SmsQueueId':_0x47e51f['id']});});});});});});})[_0x4ad0('0x2b')](respondWithStatusCode(_0x3dae30,null))['catch'](handleError(_0x3dae30,null));};exports[_0x4ad0('0x88')]=function(_0x131080,_0x324f4b,_0x3159e0){return db[_0x4ad0('0x36')][_0x4ad0('0x56')]({'where':{'id':_0x131080[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x324f4b,null))['then'](function(_0x3a5c63){if(_0x3a5c63){return _0x3a5c63[_0x4ad0('0x88')](_0x131080[_0x4ad0('0x51')][_0x4ad0('0x6a')],_[_0x4ad0('0x89')](_0x131080['body'],['ids','id'])||{})['spread'](function(_0x25cf29){for(var _0x1b317c=0x0;_0x1b317c<_0x131080['body'][_0x4ad0('0x6a')]['length'];_0x1b317c+=0x1){socket[_0x4ad0('0x72')](_0x4ad0('0x73'),{'UserId':Number(_0x131080['body'][_0x4ad0('0x6a')][_0x1b317c]),'SmsQueueId':Number(_0x131080[_0x4ad0('0x59')]['id'])});}return _0x25cf29;});}})[_0x4ad0('0x2b')](respondWithResult(_0x324f4b,null))['catch'](handleError(_0x324f4b,null));};exports[_0x4ad0('0x86')]=function(_0x6c4639,_0x248fb2,_0x45d169){return db['SmsQueue'][_0x4ad0('0x56')]({'where':{'id':_0x6c4639[_0x4ad0('0x59')]['id']}})[_0x4ad0('0x2b')](handleEntityNotFound(_0x248fb2,null))['then'](function(_0x4a221a){if(_0x4a221a){return _0x4a221a[_0x4ad0('0x86')](_0x6c4639[_0x4ad0('0x3a')]['ids'])[_0x4ad0('0x2b')](function(){if(_['isArray'](_0x6c4639[_0x4ad0('0x3a')]['ids'])){for(var _0x129e9a=0x0;_0x129e9a<_0x6c4639[_0x4ad0('0x3a')][_0x4ad0('0x6a')][_0x4ad0('0x40')];_0x129e9a+=0x1){socket[_0x4ad0('0x72')](_0x4ad0('0x87'),{'UserId':Number(_0x6c4639[_0x4ad0('0x3a')][_0x4ad0('0x6a')][_0x129e9a]),'SmsQueueId':Number(_0x6c4639[_0x4ad0('0x59')]['id'])});}}else{socket[_0x4ad0('0x72')](_0x4ad0('0x87'),{'UserId':Number(_0x6c4639['query'][_0x4ad0('0x6a')]),'SmsQueueId':Number(_0x6c4639[_0x4ad0('0x59')]['id'])});}});}})[_0x4ad0('0x2b')](respondWithStatusCode(_0x248fb2,null))['catch'](handleError(_0x248fb2,null));};exports['getAgents']=function(_0xb0b73d,_0x1ac763,_0x15a8fe){var _0x4ce3c8={};var _0x503ddb={};var _0x2e7940;var _0x3d86fa;return db[_0x4ad0('0x36')]['findOne']({'where':{'id':_0xb0b73d[_0x4ad0('0x59')]['id']}})['then'](handleEntityNotFound(_0x1ac763,null))[_0x4ad0('0x2b')](function(_0x2a915b){if(_0x2a915b){_0x2e7940=_0x2a915b;_0x503ddb['model']=_[_0x4ad0('0x4e')](db[_0x4ad0('0x5f')]['rawAttributes']);_0x503ddb[_0x4ad0('0x3a')]=_['keys'](_0xb0b73d[_0x4ad0('0x3a')]);_0x503ddb[_0x4ad0('0x3b')]=_[_0x4ad0('0x3d')](_0x503ddb[_0x4ad0('0x3c')],_0x503ddb['query']);_0x4ce3c8[_0x4ad0('0x3f')]=_[_0x4ad0('0x3d')](_0x503ddb[_0x4ad0('0x3c')],qs[_0x4ad0('0x3e')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x3e')]));_0x4ce3c8[_0x4ad0('0x3f')]=_0x4ce3c8[_0x4ad0('0x3f')][_0x4ad0('0x40')]?_0x4ce3c8['attributes']:_0x503ddb[_0x4ad0('0x3c')];_0x4ce3c8['order']=qs[_0x4ad0('0x43')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x43')]);_0x4ce3c8[_0x4ad0('0x44')]=qs[_0x4ad0('0x3b')](_[_0x4ad0('0x45')](_0xb0b73d[_0x4ad0('0x3a')],_0x503ddb[_0x4ad0('0x3b')]));if(_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x46')]){_0x4ce3c8[_0x4ad0('0x44')]=_[_0x4ad0('0x47')](_0x4ce3c8[_0x4ad0('0x44')],{'$or':_[_0x4ad0('0x35')](_0x4ce3c8[_0x4ad0('0x3f')],function(_0x438142){var _0x59b690={};_0x59b690[_0x438142]={'$like':'%'+_0xb0b73d['query'][_0x4ad0('0x46')]+'%'};return _0x59b690;})});}_0x4ce3c8=_[_0x4ad0('0x47')]({},_0x4ce3c8,_0xb0b73d[_0x4ad0('0x48')]);return _0x2e7940['getAgents'](_0x4ce3c8);}})['then'](function(_0x144a23){if(_0x144a23){_0x3d86fa=_0x144a23[_0x4ad0('0x40')];if(!_0xb0b73d[_0x4ad0('0x3a')]['hasOwnProperty'](_0x4ad0('0x42'))){_0x4ce3c8[_0x4ad0('0x25')]=qs[_0x4ad0('0x25')](_0xb0b73d['query'][_0x4ad0('0x25')]);_0x4ce3c8[_0x4ad0('0x22')]=qs[_0x4ad0('0x22')](_0xb0b73d[_0x4ad0('0x3a')][_0x4ad0('0x22')]);}return _0x2e7940[_0x4ad0('0x8a')](_0x4ce3c8);}})[_0x4ad0('0x2b')](function(_0x2915f2){if(_0x2915f2){return _0x2915f2?{'count':_0x3d86fa,'rows':_0x2915f2}:null;}})[_0x4ad0('0x2b')](respondWithResult(_0x1ac763,null))['catch'](handleError(_0x1ac763,null));}; \ No newline at end of file +var _0x6380=['UserId','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserSmsQueue','pick','SmsQueueId','User','findAndCountAll'];(function(_0x5e0ca0,_0x3f3560){var _0x3dd119=function(_0x157600){while(--_0x157600){_0x5e0ca0['push'](_0x5e0ca0['shift']());}};_0x3dd119(++_0x3f3560);}(_0x6380,0x159));var _0x0638=function(_0x123590,_0xb771ea){_0x123590=_0x123590-0x0;var _0x28bfda=_0x6380[_0x123590];return _0x28bfda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0638('0x0'));var zipdir=require(_0x0638('0x1'));var jsonpatch=require(_0x0638('0x2'));var rp=require(_0x0638('0x3'));var moment=require(_0x0638('0x4'));var BPromise=require(_0x0638('0x5'));var Mustache=require(_0x0638('0x6'));var util=require('util');var path=require(_0x0638('0x7'));var sox=require(_0x0638('0x8'));var csv=require(_0x0638('0x9'));var ejs=require(_0x0638('0xa'));var fs=require('fs');var fs_extra=require(_0x0638('0xb'));var _=require(_0x0638('0xc'));var squel=require(_0x0638('0xd'));var crypto=require(_0x0638('0xe'));var jsforce=require(_0x0638('0xf'));var deskjs=require(_0x0638('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0638('0x11'));var Papa=require('papaparse');var Redis=require(_0x0638('0x12'));var authService=require(_0x0638('0x13'));var qs=require(_0x0638('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0638('0x15'))(_0x0638('0x16'));var utils=require(_0x0638('0x17'));var config=require(_0x0638('0x18'));var licenseUtil=require(_0x0638('0x19'));var db=require(_0x0638('0x1a'))['db'];config['redis']=_[_0x0638('0x1b')](config[_0x0638('0x1c')],{'host':_0x0638('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0638('0x1c')]));require(_0x0638('0x1e'))['register'](socket);function respondWithStatusCode(_0x109f57,_0x55113f){_0x55113f=_0x55113f||0xcc;return function(_0xce17c3){if(_0xce17c3){return _0x109f57[_0x0638('0x1f')](_0x55113f);}return _0x109f57['status'](_0x55113f)[_0x0638('0x20')]();};}function respondWithResult(_0x55ae4e,_0x465a4c){_0x465a4c=_0x465a4c||0xc8;return function(_0x1ef5ed){if(_0x1ef5ed){return _0x55ae4e[_0x0638('0x21')](_0x465a4c)[_0x0638('0x22')](_0x1ef5ed);}};}function respondWithFilteredResult(_0x2722b7,_0x514e6c){return function(_0x49ee55){if(_0x49ee55){var _0x1bf327=typeof _0x514e6c[_0x0638('0x23')]==='undefined'&&typeof _0x514e6c[_0x0638('0x24')]==='undefined';var _0x3bac8a=_0x49ee55[_0x0638('0x25')];var _0x4ff09f=_0x1bf327?0x0:_0x514e6c[_0x0638('0x23')];var _0x40f53d=_0x1bf327?_0x49ee55['count']:_0x514e6c[_0x0638('0x23')]+_0x514e6c[_0x0638('0x24')];var _0x4bc376;if(_0x40f53d>=_0x3bac8a){_0x40f53d=_0x3bac8a;_0x4bc376=0xc8;}else{_0x4bc376=0xce;}_0x2722b7['status'](_0x4bc376);return _0x2722b7['set'](_0x0638('0x26'),_0x4ff09f+'-'+_0x40f53d+'/'+_0x3bac8a)['json'](_0x49ee55);}return null;};}function patchUpdates(_0x49dfdd){return function(_0x1223eb){try{jsonpatch[_0x0638('0x27')](_0x1223eb,_0x49dfdd,!![]);}catch(_0xb5d62){return BPromise[_0x0638('0x28')](_0xb5d62);}return _0x1223eb[_0x0638('0x29')]();};}function saveUpdates(_0x38a4f0,_0x40f4cc){return function(_0x3238d6){if(_0x3238d6){return _0x3238d6[_0x0638('0x2a')](_0x38a4f0)[_0x0638('0x2b')](function(_0x15d2cf){return _0x15d2cf;});}return null;};}function removeEntity(_0x5442c1,_0x1d35e3){return function(_0x4dbd38){if(_0x4dbd38){return _0x4dbd38[_0x0638('0x2c')]()[_0x0638('0x2b')](function(){var _0x536996=_0x4dbd38[_0x0638('0x2d')]({'plain':!![]});var _0x4b8ad2=_0x0638('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x4b8ad2,'resourceId':_0x536996['id']}})[_0x0638('0x2b')](function(){return _0x4dbd38;});})[_0x0638('0x2b')](function(){_0x5442c1[_0x0638('0x21')](0xcc)[_0x0638('0x20')]();});}};}function handleEntityNotFound(_0x55f3d0,_0x730b66){return function(_0x2548cd){if(!_0x2548cd){_0x55f3d0[_0x0638('0x1f')](0x194);}return _0x2548cd;};}function handleError(_0x216acb,_0x43a9ff){_0x43a9ff=_0x43a9ff||0x1f4;return function(_0x4d8f49){logger['error'](_0x4d8f49[_0x0638('0x2f')]);if(_0x4d8f49[_0x0638('0x30')]){delete _0x4d8f49[_0x0638('0x30')];}_0x216acb[_0x0638('0x21')](_0x43a9ff)[_0x0638('0x31')](_0x4d8f49);};}exports[_0x0638('0x32')]=function(_0x40b008,_0x3f2ba7){var _0x36c9cc={},_0x56ce80={},_0x442fd2={'count':0x0,'rows':[]};var _0xffaa77=_['map'](db[_0x0638('0x33')][_0x0638('0x34')],function(_0x530594){return{'name':_0x530594[_0x0638('0x35')],'type':_0x530594[_0x0638('0x36')][_0x0638('0x37')]};});_0x56ce80[_0x0638('0x38')]=_[_0x0638('0x39')](_0xffaa77,'name');_0x56ce80[_0x0638('0x3a')]=_[_0x0638('0x3b')](_0x40b008[_0x0638('0x3a')]);_0x56ce80[_0x0638('0x3c')]=_[_0x0638('0x3d')](_0x56ce80[_0x0638('0x38')],_0x56ce80[_0x0638('0x3a')]);_0x36c9cc['attributes']=_[_0x0638('0x3d')](_0x56ce80[_0x0638('0x38')],qs[_0x0638('0x3e')](_0x40b008['query']['fields']));_0x36c9cc[_0x0638('0x3f')]=_0x36c9cc[_0x0638('0x3f')][_0x0638('0x40')]?_0x36c9cc['attributes']:_0x56ce80['model'];if(!_0x40b008[_0x0638('0x3a')][_0x0638('0x41')](_0x0638('0x42'))){_0x36c9cc[_0x0638('0x24')]=qs[_0x0638('0x24')](_0x40b008[_0x0638('0x3a')][_0x0638('0x24')]);_0x36c9cc[_0x0638('0x23')]=qs[_0x0638('0x23')](_0x40b008[_0x0638('0x3a')][_0x0638('0x23')]);}_0x36c9cc[_0x0638('0x43')]=qs[_0x0638('0x44')](_0x40b008[_0x0638('0x3a')]['sort']);_0x36c9cc[_0x0638('0x45')]=qs[_0x0638('0x3c')](_['pick'](_0x40b008[_0x0638('0x3a')],_0x56ce80[_0x0638('0x3c')]),_0xffaa77);if(_0x40b008[_0x0638('0x3a')][_0x0638('0x46')]){_0x36c9cc[_0x0638('0x45')]=_['merge'](_0x36c9cc[_0x0638('0x45')],{'$or':_[_0x0638('0x39')](_0xffaa77,function(_0x50a08b){if(_0x50a08b[_0x0638('0x36')]!==_0x0638('0x47')){var _0x271e8c={};_0x271e8c[_0x50a08b['name']]={'$like':'%'+_0x40b008[_0x0638('0x3a')][_0x0638('0x46')]+'%'};return _0x271e8c;}})});}_0x36c9cc=_[_0x0638('0x48')]({},_0x36c9cc,_0x40b008[_0x0638('0x49')]);var _0x22494a={'where':_0x36c9cc[_0x0638('0x45')]};return db[_0x0638('0x33')][_0x0638('0x25')](_0x22494a)['then'](function(_0x58d11e){_0x442fd2[_0x0638('0x25')]=_0x58d11e;if(_0x40b008[_0x0638('0x3a')][_0x0638('0x4a')]){_0x36c9cc[_0x0638('0x4b')]=[{'all':!![]}];}return db[_0x0638('0x33')][_0x0638('0x4c')](_0x36c9cc);})[_0x0638('0x2b')](function(_0x412a02){_0x442fd2[_0x0638('0x4d')]=_0x412a02;return _0x442fd2;})[_0x0638('0x2b')](respondWithFilteredResult(_0x3f2ba7,_0x36c9cc))[_0x0638('0x4e')](handleError(_0x3f2ba7,null));};exports[_0x0638('0x4f')]=function(_0x5a5d7b,_0x11f013){var _0x2ee411={'raw':!![],'where':{'id':_0x5a5d7b['params']['id']}},_0x3c2a7a={};_0x3c2a7a[_0x0638('0x38')]=_[_0x0638('0x3b')](db[_0x0638('0x33')]['rawAttributes']);_0x3c2a7a[_0x0638('0x3a')]=_['keys'](_0x5a5d7b[_0x0638('0x3a')]);_0x3c2a7a[_0x0638('0x3c')]=_['intersection'](_0x3c2a7a[_0x0638('0x38')],_0x3c2a7a['query']);_0x2ee411[_0x0638('0x3f')]=_[_0x0638('0x3d')](_0x3c2a7a[_0x0638('0x38')],qs[_0x0638('0x3e')](_0x5a5d7b[_0x0638('0x3a')]['fields']));_0x2ee411[_0x0638('0x3f')]=_0x2ee411[_0x0638('0x3f')][_0x0638('0x40')]?_0x2ee411['attributes']:_0x3c2a7a[_0x0638('0x38')];if(_0x5a5d7b['query']['includeAll']){_0x2ee411[_0x0638('0x4b')]=[{'all':!![]}];}_0x2ee411=_[_0x0638('0x48')]({},_0x2ee411,_0x5a5d7b[_0x0638('0x49')]);return db[_0x0638('0x33')][_0x0638('0x50')](_0x2ee411)[_0x0638('0x2b')](handleEntityNotFound(_0x11f013,null))['then'](respondWithResult(_0x11f013,null))[_0x0638('0x4e')](handleError(_0x11f013,null));};exports['create']=function(_0xec821c,_0x394022){return db[_0x0638('0x33')][_0x0638('0x51')](_0xec821c[_0x0638('0x52')],{})[_0x0638('0x2b')](function(_0x5863fb){var _0x459014=_0xec821c[_0x0638('0x53')][_0x0638('0x2d')]({'plain':!![]});if(!_0x459014)throw new Error(_0x0638('0x54'));if(_0x459014['role']===_0x0638('0x53')){var _0x20223c=_0x5863fb[_0x0638('0x2d')]({'plain':!![]});var _0x9e582e=_0x0638('0x2e');return db[_0x0638('0x55')]['find']({'where':{'name':_0x9e582e,'userProfileId':_0x459014[_0x0638('0x56')]},'raw':!![]})['then'](function(_0x189e49){if(_0x189e49&&_0x189e49[_0x0638('0x57')]===0x0){return db['UserProfileResource'][_0x0638('0x51')]({'name':_0x20223c['name'],'resourceId':_0x20223c['id'],'type':_0x189e49[_0x0638('0x30')],'sectionId':_0x189e49['id']},{})[_0x0638('0x2b')](function(){return _0x5863fb;});}else{return _0x5863fb;}})['catch'](function(_0x3875a1){logger['error'](_0x0638('0x58'),_0x3875a1);throw _0x3875a1;});}return _0x5863fb;})[_0x0638('0x2b')](respondWithResult(_0x394022,0xc9))[_0x0638('0x4e')](handleError(_0x394022,null));};exports[_0x0638('0x2a')]=function(_0x58c06a,_0x5dc031){if(_0x58c06a[_0x0638('0x52')]['id']){delete _0x58c06a['body']['id'];}return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x58c06a[_0x0638('0x59')]['id']}})[_0x0638('0x2b')](handleEntityNotFound(_0x5dc031,null))[_0x0638('0x2b')](saveUpdates(_0x58c06a[_0x0638('0x52')],null))['then'](respondWithResult(_0x5dc031,null))[_0x0638('0x4e')](handleError(_0x5dc031,null));};exports[_0x0638('0x2c')]=function(_0x1c7f77,_0x7e6a71){return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x1c7f77[_0x0638('0x59')]['id']}})['then'](handleEntityNotFound(_0x7e6a71,null))['then'](removeEntity(_0x7e6a71,null))[_0x0638('0x4e')](handleError(_0x7e6a71,null));};exports['describe']=function(_0x3e7269,_0xf8883){return db['SmsQueue']['describe']()[_0x0638('0x2b')](respondWithResult(_0xf8883,null))[_0x0638('0x4e')](handleError(_0xf8883,null));};exports[_0x0638('0x5a')]=function(_0x3d8442,_0x492d71,_0x5ca23a){var _0x7e7460={'raw':!![],'where':{}},_0x4bb043={},_0x5bcb7f;return db[_0x0638('0x33')]['findOne']({'where':{'id':_0x3d8442[_0x0638('0x59')]['id']}})['then'](handleEntityNotFound(_0x492d71,null))[_0x0638('0x2b')](function(_0x1ebb74){if(_0x1ebb74){_0x5bcb7f=_0x1ebb74[_0x0638('0x2d')]({'plain':!![]});_0x4bb043['model']=_[_0x0638('0x3b')](db[_0x0638('0x5b')][_0x0638('0x34')]);_0x4bb043[_0x0638('0x3a')]=_[_0x0638('0x3b')](_0x3d8442[_0x0638('0x3a')]);_0x4bb043[_0x0638('0x3c')]=_[_0x0638('0x3d')](_0x4bb043[_0x0638('0x38')],_0x4bb043[_0x0638('0x3a')]);_0x7e7460[_0x0638('0x3f')]=_['intersection'](_0x4bb043[_0x0638('0x38')],qs['fields'](_0x3d8442[_0x0638('0x3a')][_0x0638('0x3e')]));_0x7e7460[_0x0638('0x3f')]=_0x7e7460[_0x0638('0x3f')][_0x0638('0x40')]?_0x7e7460[_0x0638('0x3f')]:_0x4bb043[_0x0638('0x38')];if(!_0x3d8442[_0x0638('0x3a')][_0x0638('0x41')]('nolimit')){_0x7e7460[_0x0638('0x24')]=qs[_0x0638('0x24')](_0x3d8442['query'][_0x0638('0x24')]);_0x7e7460[_0x0638('0x23')]=qs[_0x0638('0x23')](_0x3d8442[_0x0638('0x3a')][_0x0638('0x23')]);}_0x7e7460[_0x0638('0x43')]=qs[_0x0638('0x44')](_0x3d8442[_0x0638('0x3a')][_0x0638('0x44')]);_0x7e7460['where']=qs[_0x0638('0x3c')](_[_0x0638('0x5c')](_0x3d8442[_0x0638('0x3a')],_0x4bb043[_0x0638('0x3c')]));_0x7e7460['where'][_0x0638('0x5d')]=_0x1ebb74['id'];if(_0x3d8442[_0x0638('0x3a')]['filter']){_0x7e7460['where']=_[_0x0638('0x48')](_0x7e7460[_0x0638('0x45')],{'$or':_['map'](_0x7e7460[_0x0638('0x3f')],function(_0x4b7351){var _0xd6aa32={};_0xd6aa32[_0x4b7351]={'$like':'%'+_0x3d8442[_0x0638('0x3a')][_0x0638('0x46')]+'%'};return _0xd6aa32;})});}_0x7e7460=_[_0x0638('0x48')]({},_0x7e7460,_0x3d8442[_0x0638('0x49')]);return db[_0x0638('0x5b')]['findAll'](_0x7e7460);}})[_0x0638('0x2b')](function(_0x77b8f5){if(_0x77b8f5){return db[_0x0638('0x5e')][_0x0638('0x5f')]({'where':{'id':_[_0x0638('0x39')](_0x77b8f5,_0x0638('0x60')),'role':'agent'},'attributes':['id','name',_0x0638('0x61'),_0x0638('0x62'),_0x0638('0x63')]});}})[_0x0638('0x2b')](function(_0x4ae2e9){if(_0x4ae2e9){return{'count':_0x4ae2e9[_0x0638('0x25')],'rows':_[_0x0638('0x39')](_0x4ae2e9[_0x0638('0x4d')],function(_0xa5d4f0){return{'membername':_0xa5d4f0[_0x0638('0x30')],'UserId':_0xa5d4f0['id'],'queue_name':_0x5bcb7f[_0x0638('0x30')],'SmsQueueId':_0x5bcb7f['id'],'interface':util['format'](_0x0638('0x64'),_0x0638('0x65'),_0xa5d4f0[_0x0638('0x30')]),'penalty':0x0,'paused':_0xa5d4f0[_0x0638('0x61')],'createdAt':_0xa5d4f0['createdAt'],'updatedAt':_0xa5d4f0[_0x0638('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0638('0x2b')](respondWithFilteredResult(_0x492d71,_0x7e7460))['catch'](handleError(_0x492d71,null));};exports[_0x0638('0x66')]=function(_0x267f85,_0x2eff7f,_0x2c6c22){var _0x5660e9={};var _0x1cf5a0={};var _0x3a647b;var _0x32296b;return db['SmsQueue']['findOne']({'where':{'id':_0x267f85['params']['id']}})[_0x0638('0x2b')](handleEntityNotFound(_0x2eff7f,null))['then'](function(_0x21af54){if(_0x21af54){_0x3a647b=_0x21af54;_0x1cf5a0[_0x0638('0x38')]=_[_0x0638('0x3b')](db[_0x0638('0x67')][_0x0638('0x34')]);_0x1cf5a0[_0x0638('0x3a')]=_[_0x0638('0x3b')](_0x267f85['query']);_0x1cf5a0[_0x0638('0x3c')]=_[_0x0638('0x3d')](_0x1cf5a0[_0x0638('0x38')],_0x1cf5a0[_0x0638('0x3a')]);_0x5660e9[_0x0638('0x3f')]=_[_0x0638('0x3d')](_0x1cf5a0[_0x0638('0x38')],qs['fields'](_0x267f85['query']['fields']));_0x5660e9[_0x0638('0x3f')]=_0x5660e9[_0x0638('0x3f')]['length']?_0x5660e9['attributes']:_0x1cf5a0[_0x0638('0x38')];_0x5660e9['order']=qs[_0x0638('0x44')](_0x267f85[_0x0638('0x3a')][_0x0638('0x44')]);_0x5660e9[_0x0638('0x45')]=qs[_0x0638('0x3c')](_[_0x0638('0x5c')](_0x267f85[_0x0638('0x3a')],_0x1cf5a0[_0x0638('0x3c')]));if(_0x267f85['query'][_0x0638('0x46')]){_0x5660e9[_0x0638('0x45')]=_[_0x0638('0x48')](_0x5660e9[_0x0638('0x45')],{'$or':_[_0x0638('0x39')](_0x5660e9[_0x0638('0x3f')],function(_0x484b89){var _0x2b9ca8={};_0x2b9ca8[_0x484b89]={'$like':'%'+_0x267f85['query'][_0x0638('0x46')]+'%'};return _0x2b9ca8;})});}_0x5660e9=_[_0x0638('0x48')]({},_0x5660e9,_0x267f85[_0x0638('0x49')]);return _0x3a647b[_0x0638('0x66')](_0x5660e9);}})[_0x0638('0x2b')](function(_0x29a763){if(_0x29a763){_0x32296b=_0x29a763[_0x0638('0x40')];if(!_0x267f85[_0x0638('0x3a')][_0x0638('0x41')](_0x0638('0x42'))){_0x5660e9[_0x0638('0x24')]=qs[_0x0638('0x24')](_0x267f85[_0x0638('0x3a')][_0x0638('0x24')]);_0x5660e9[_0x0638('0x23')]=qs[_0x0638('0x23')](_0x267f85[_0x0638('0x3a')][_0x0638('0x23')]);}return _0x3a647b[_0x0638('0x66')](_0x5660e9);}})['then'](function(_0xa2e489){if(_0xa2e489){return _0xa2e489?{'count':_0x32296b,'rows':_0xa2e489}:null;}})[_0x0638('0x2b')](respondWithResult(_0x2eff7f,null))[_0x0638('0x4e')](handleError(_0x2eff7f,null));};exports['addTeams']=function(_0x5257ae,_0x536cd8,_0x8a8ed0){var _0x397a2b=_0x5257ae['body']['ids'];return db['Team'][_0x0638('0x4c')]({'where':{'id':_0x397a2b},'attributes':['id'],'include':[{'model':db[_0x0638('0x5e')],'as':_0x0638('0x68'),'attributes':['id',_0x0638('0x30'),_0x0638('0x69'),_0x0638('0x6a'),_0x0638('0x6b')],'raw':!![]}]})[_0x0638('0x2b')](function(_0x360a7c){if(_0x360a7c){var _0x43fe4d=_[_0x0638('0x6c')](_0x360a7c,function(_0x150ac1){var _0x52cb6e=_0x150ac1[_0x0638('0x2d')]({'plain':!![]});return _0x52cb6e[_0x0638('0x68')];});return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x5257ae[_0x0638('0x59')]['id']}})[_0x0638('0x2b')](function(_0x3c048b){return db[_0x0638('0x6d')][_0x0638('0x6e')](function(_0x56209b){return _0x3c048b[_0x0638('0x6f')](_0x397a2b,{'transaction':_0x56209b})[_0x0638('0x2b')](function(){return BPromise[_0x0638('0x70')](_0x43fe4d,function(_0x2485ac){return db[_0x0638('0x5b')][_0x0638('0x71')]({'where':{'UserId':_0x2485ac['id'],'SmsQueueId':_0x5257ae[_0x0638('0x59')]['id']},'transaction':_0x56209b});});})[_0x0638('0x2b')](function(){_0x43fe4d[_0x0638('0x72')](function(_0x489f74){socket[_0x0638('0x73')](_0x0638('0x74'),{'UserId':_0x489f74['id'],'SmsQueueId':_0x3c048b['id']});});});});});}})[_0x0638('0x2b')](respondWithStatusCode(_0x536cd8,null))[_0x0638('0x4e')](handleError(_0x536cd8,null));};exports[_0x0638('0x75')]=function(_0x354e4e,_0x5b4d03,_0x475932){return db['Team'][_0x0638('0x4c')]({'where':{'id':_0x354e4e[_0x0638('0x3a')][_0x0638('0x76')]},'attributes':['id'],'include':[{'model':db[_0x0638('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5b4d03,null))[_0x0638('0x2b')](function(_0x13a8de){var _0x474b89=_[_0x0638('0x39')](_0x13a8de,'id');var _0x254150=[];var _0xf06a83=[];var _0x77d233=squel[_0x0638('0x77')]();_0x77d233[_0x0638('0x78')](_0x0638('0x79'))[_0x0638('0x7a')](_0x0638('0x7b'),'tq')[_0x0638('0x7c')](_0x0638('0x7d'),'ut',_0x0638('0x7e'))[_0x0638('0x45')]('SmsQueueId\x20=\x20?',_0x354e4e[_0x0638('0x59')]['id']);for(var _0x4db67b=0x0;_0x4db67b<_0x13a8de[_0x0638('0x40')];_0x4db67b+=0x1){let _0x1a0c93=_0x13a8de[_0x4db67b];for(var _0x45631f=0x0;_0x45631f<_0x1a0c93[_0x0638('0x68')]['length'];_0x45631f+=0x1){let _0x477833=_0x1a0c93['Agents'][_0x45631f];var _0x53b1a4=_0x77d233[_0x0638('0x7f')]();_0x53b1a4['where'](_0x0638('0x80'),_0x477833['id']);_0xf06a83[_0x0638('0x81')](db[_0x0638('0x6d')][_0x0638('0x3a')](_0x53b1a4[_0x0638('0x82')](),{'type':db[_0x0638('0x6d')][_0x0638('0x83')][_0x0638('0x84')]})[_0x0638('0x2b')](function(_0x2bc829){if(_0x2bc829['length']===0x1){return _0x477833['id'];}else{var _0xbd42a0=_[_0x0638('0x85')](_[_0x0638('0x39')](_0x2bc829,_0x0638('0x86')),function(_0x3e38b5){return _[_0x0638('0x87')](_0x474b89,_0x3e38b5);});if(_0xbd42a0){return _0x477833['id'];}}}));}}return BPromise[_0x0638('0x88')](_0xf06a83)[_0x0638('0x2b')](function(_0x4b0495){_0x254150=_(_0x254150)['union'](_0x4b0495)[_0x0638('0x89')]()['value']();return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x354e4e[_0x0638('0x59')]['id']}})[_0x0638('0x2b')](function(_0x1e4a42){return db[_0x0638('0x6d')]['transaction'](function(_0x90e6de){return _0x1e4a42[_0x0638('0x75')](_0x354e4e[_0x0638('0x3a')][_0x0638('0x76')],{'transaction':_0x90e6de})['then'](function(){if(!_[_0x0638('0x8a')](_0x254150)){return _0x1e4a42[_0x0638('0x8b')](_0x254150,{'transaction':_0x90e6de});}})[_0x0638('0x2b')](function(){_0x254150['forEach'](function(_0x339b89){socket[_0x0638('0x73')](_0x0638('0x8c'),{'UserId':_0x339b89,'SmsQueueId':_0x1e4a42['id']});});});});});});})[_0x0638('0x2b')](respondWithStatusCode(_0x5b4d03,null))[_0x0638('0x4e')](handleError(_0x5b4d03,null));};exports[_0x0638('0x8d')]=function(_0x4c4dcc,_0x38e238,_0x2d73d4){return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x4c4dcc[_0x0638('0x59')]['id']}})[_0x0638('0x2b')](handleEntityNotFound(_0x38e238,null))['then'](function(_0x5a82e0){if(_0x5a82e0){return _0x5a82e0[_0x0638('0x8d')](_0x4c4dcc[_0x0638('0x52')][_0x0638('0x76')],_[_0x0638('0x8e')](_0x4c4dcc['body'],['ids','id'])||{})[_0x0638('0x8f')](function(_0x2111f1){for(var _0x2b62a4=0x0;_0x2b62a4<_0x4c4dcc[_0x0638('0x52')]['ids'][_0x0638('0x40')];_0x2b62a4+=0x1){socket[_0x0638('0x73')](_0x0638('0x74'),{'UserId':Number(_0x4c4dcc[_0x0638('0x52')][_0x0638('0x76')][_0x2b62a4]),'SmsQueueId':Number(_0x4c4dcc[_0x0638('0x59')]['id'])});}return _0x2111f1;});}})['then'](respondWithResult(_0x38e238,null))[_0x0638('0x4e')](handleError(_0x38e238,null));};exports[_0x0638('0x8b')]=function(_0x276d12,_0x158c0f,_0x5cfd2e){return db[_0x0638('0x33')][_0x0638('0x50')]({'where':{'id':_0x276d12['params']['id']}})[_0x0638('0x2b')](handleEntityNotFound(_0x158c0f,null))['then'](function(_0xcecc83){if(_0xcecc83){return _0xcecc83[_0x0638('0x8b')](_0x276d12[_0x0638('0x3a')][_0x0638('0x76')])[_0x0638('0x2b')](function(){if(_[_0x0638('0x90')](_0x276d12[_0x0638('0x3a')][_0x0638('0x76')])){for(var _0x15d327=0x0;_0x15d327<_0x276d12[_0x0638('0x3a')][_0x0638('0x76')][_0x0638('0x40')];_0x15d327+=0x1){socket[_0x0638('0x73')](_0x0638('0x8c'),{'UserId':Number(_0x276d12['query']['ids'][_0x15d327]),'SmsQueueId':Number(_0x276d12['params']['id'])});}}else{socket[_0x0638('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x276d12[_0x0638('0x3a')][_0x0638('0x76')]),'SmsQueueId':Number(_0x276d12[_0x0638('0x59')]['id'])});}});}})[_0x0638('0x2b')](respondWithStatusCode(_0x158c0f,null))[_0x0638('0x4e')](handleError(_0x158c0f,null));};exports[_0x0638('0x91')]=function(_0x35b0aa,_0x780b41,_0x5f0847){var _0x20ac4c={};var _0x21fcba={};var _0x537720;var _0x12069c;return db[_0x0638('0x33')][_0x0638('0x92')]({'where':{'id':_0x35b0aa[_0x0638('0x59')]['id']}})[_0x0638('0x2b')](handleEntityNotFound(_0x780b41,null))[_0x0638('0x2b')](function(_0x14b2ff){if(_0x14b2ff){_0x537720=_0x14b2ff;_0x21fcba[_0x0638('0x38')]=_[_0x0638('0x3b')](db[_0x0638('0x5e')][_0x0638('0x34')]);_0x21fcba[_0x0638('0x3a')]=_['keys'](_0x35b0aa[_0x0638('0x3a')]);_0x21fcba['filters']=_['intersection'](_0x21fcba['model'],_0x21fcba[_0x0638('0x3a')]);_0x20ac4c[_0x0638('0x3f')]=_['intersection'](_0x21fcba[_0x0638('0x38')],qs[_0x0638('0x3e')](_0x35b0aa[_0x0638('0x3a')][_0x0638('0x3e')]));_0x20ac4c[_0x0638('0x3f')]=_0x20ac4c[_0x0638('0x3f')][_0x0638('0x40')]?_0x20ac4c['attributes']:_0x21fcba[_0x0638('0x38')];_0x20ac4c[_0x0638('0x43')]=qs[_0x0638('0x44')](_0x35b0aa['query'][_0x0638('0x44')]);_0x20ac4c[_0x0638('0x45')]=qs[_0x0638('0x3c')](_[_0x0638('0x5c')](_0x35b0aa[_0x0638('0x3a')],_0x21fcba[_0x0638('0x3c')]));if(_0x35b0aa[_0x0638('0x3a')][_0x0638('0x46')]){_0x20ac4c['where']=_['merge'](_0x20ac4c[_0x0638('0x45')],{'$or':_[_0x0638('0x39')](_0x20ac4c[_0x0638('0x3f')],function(_0x3218e2){var _0x32cd3a={};_0x32cd3a[_0x3218e2]={'$like':'%'+_0x35b0aa[_0x0638('0x3a')][_0x0638('0x46')]+'%'};return _0x32cd3a;})});}_0x20ac4c=_[_0x0638('0x48')]({},_0x20ac4c,_0x35b0aa[_0x0638('0x49')]);return _0x537720[_0x0638('0x91')](_0x20ac4c);}})[_0x0638('0x2b')](function(_0xa3238){if(_0xa3238){_0x12069c=_0xa3238['length'];if(!_0x35b0aa[_0x0638('0x3a')][_0x0638('0x41')](_0x0638('0x42'))){_0x20ac4c[_0x0638('0x24')]=qs['limit'](_0x35b0aa['query'][_0x0638('0x24')]);_0x20ac4c['offset']=qs[_0x0638('0x23')](_0x35b0aa[_0x0638('0x3a')][_0x0638('0x23')]);}return _0x537720['getAgents'](_0x20ac4c);}})[_0x0638('0x2b')](function(_0x3236af){if(_0x3236af){return _0x3236af?{'count':_0x12069c,'rows':_0x3236af}:null;}})['then'](respondWithResult(_0x780b41,null))[_0x0638('0x4e')](handleError(_0x780b41,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 2bb7d91..c36e1b8 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 _0x5dad=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1c1081,_0xe2cb8c){var _0x506a1a=function(_0x16dede){while(--_0x16dede){_0x1c1081['push'](_0x1c1081['shift']());}};_0x506a1a(++_0xe2cb8c);}(_0x5dad,0x17e));var _0xd5da=function(_0x431f4b,_0x30c0b6){_0x431f4b=_0x431f4b-0x0;var _0xfcbc3c=_0x5dad[_0x431f4b];return _0xfcbc3c;};'use strict';var EventEmitter=require(_0xd5da('0x0'));var SmsQueue=require(_0xd5da('0x1'))['db'][_0xd5da('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd5da('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd5da('0x4'),'afterDestroy':_0xd5da('0x5')};function emitEvent(_0x526b9d){return function(_0x58f7e9,_0x1df3e1,_0x5b41e4){SmsQueueEvents['emit'](_0x526b9d+':'+_0x58f7e9['id'],_0x58f7e9);SmsQueueEvents[_0xd5da('0x6')](_0x526b9d,_0x58f7e9);_0x5b41e4(null);};}for(var e in events){if(events[_0xd5da('0x7')](e)){var event=events[e];SmsQueue[_0xd5da('0x8')](e,emitEvent(event));}}module[_0xd5da('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x9613=['SmsQueue','setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x349883,_0x53efaa){var _0x47871e=function(_0x6375a3){while(--_0x6375a3){_0x349883['push'](_0x349883['shift']());}};_0x47871e(++_0x53efaa);}(_0x9613,0x1c9));var _0x3961=function(_0x317548,_0x29845b){_0x317548=_0x317548-0x0;var _0x5ebdac=_0x9613[_0x317548];return _0x5ebdac;};'use strict';var EventEmitter=require(_0x3961('0x0'));var SmsQueue=require(_0x3961('0x1'))['db'][_0x3961('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3961('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3961('0x4'),'afterDestroy':_0x3961('0x5')};function emitEvent(_0x11eee1){return function(_0x1a9c39,_0x5f567d,_0x26b49c){SmsQueueEvents['emit'](_0x11eee1+':'+_0x1a9c39['id'],_0x1a9c39);SmsQueueEvents['emit'](_0x11eee1,_0x1a9c39);_0x26b49c(null);};}for(var e in events){if(events[_0x3961('0x6')](e)){var event=events[e];SmsQueue[_0x3961('0x7')](e,emitEvent(event));}}module[_0x3961('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 17c091e..01bd386 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 _0x619d=['util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','sms_queues','lodash'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x619d,0x1b7));var _0xd619=function(_0x4c8be3,_0x3c3591){_0x4c8be3=_0x4c8be3-0x0;var _0x4b2ce1=_0x619d[_0x4c8be3];return _0x4b2ce1;};'use strict';var _=require(_0xd619('0x0'));var util=require(_0xd619('0x1'));var logger=require('../../config/logger')(_0xd619('0x2'));var moment=require(_0xd619('0x3'));var BPromise=require('bluebird');var rp=require(_0xd619('0x4'));var fs=require('fs');var path=require(_0xd619('0x5'));var rimraf=require(_0xd619('0x6'));var config=require(_0xd619('0x7'));var attributes=require('./smsQueue.attributes');module[_0xd619('0x8')]=function(_0x2f1321,_0x4e1d9c){return _0x2f1321[_0xd619('0x9')]('SmsQueue',attributes,{'tableName':_0xd619('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc56=['path','exports','sms_queues','util','api','moment','bluebird','request-promise'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xdc56,0x18b));var _0x6dc5=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xdc56[_0x42245d];return _0x4b211a;};'use strict';var _=require('lodash');var util=require(_0x6dc5('0x0'));var logger=require('../../config/logger')(_0x6dc5('0x1'));var moment=require(_0x6dc5('0x2'));var BPromise=require(_0x6dc5('0x3'));var rp=require(_0x6dc5('0x4'));var fs=require('fs');var path=require(_0x6dc5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x6dc5('0x6')]=function(_0x43514c,_0x6a88df){return _0x43514c['define']('SmsQueue',attributes,{'tableName':_0x6dc5('0x7'),'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 a595441..4acf15f 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 _0x7a95=['rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x505965,_0x1ed452){var _0x1b01c4=function(_0x4a6118){while(--_0x4a6118){_0x505965['push'](_0x505965['shift']());}};_0x1b01c4(++_0x1ed452);}(_0x7a95,0xee));var _0x57a9=function(_0x376d67,_0x44db80){_0x376d67=_0x376d67-0x0;var _0x49fff4=_0x7a95[_0x376d67];return _0x49fff4;};'use strict';var _=require(_0x57a9('0x0'));var util=require(_0x57a9('0x1'));var moment=require(_0x57a9('0x2'));var BPromise=require(_0x57a9('0x3'));var rs=require(_0x57a9('0x4'));var fs=require('fs');var Redis=require(_0x57a9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x57a9('0x6'));var logger=require(_0x57a9('0x7'))(_0x57a9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57a9('0x9')]['http']({'port':0x232a});config[_0x57a9('0xa')]=_[_0x57a9('0xb')](config[_0x57a9('0xa')],{'host':_0x57a9('0xc'),'port':0x18eb});var socket=require(_0x57a9('0xd'))(new Redis(config[_0x57a9('0xa')]));require(_0x57a9('0xe'))[_0x57a9('0xf')](socket);function respondWithRpcPromise(_0x4fc8ed,_0x20830c,_0x322a79){return new BPromise(function(_0x1277bd,_0x4c8fd6){return client[_0x57a9('0x10')](_0x4fc8ed,_0x322a79)[_0x57a9('0x11')](function(_0x43a92f){logger[_0x57a9('0x12')]('SmsQueue,\x20%s,\x20%s',_0x20830c,_0x57a9('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x20830c,_0x57a9('0x13'),JSON[_0x57a9('0x14')](_0x43a92f));if(_0x43a92f[_0x57a9('0x15')]){if(_0x43a92f[_0x57a9('0x15')][_0x57a9('0x16')]===0x1f4){logger[_0x57a9('0x15')](_0x57a9('0x17'),_0x20830c,_0x43a92f[_0x57a9('0x15')][_0x57a9('0x18')]);return _0x4c8fd6(_0x43a92f[_0x57a9('0x15')]['message']);}logger[_0x57a9('0x15')]('SmsQueue,\x20%s,\x20%s',_0x20830c,_0x43a92f[_0x57a9('0x15')]['message']);return _0x1277bd(_0x43a92f[_0x57a9('0x15')][_0x57a9('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x20830c,'request\x20sent');_0x1277bd(_0x43a92f[_0x57a9('0x19')][_0x57a9('0x18')]);}})[_0x57a9('0x1a')](function(_0x530fdc){logger[_0x57a9('0x15')](_0x57a9('0x17'),_0x20830c,_0x530fdc);_0x4c8fd6(_0x530fdc);});});}exports[_0x57a9('0x1b')]=function(_0x5ef462){var _0x294b71=this;return new Promise(function(_0x5d977f,_0x3262a2){return db[_0x57a9('0x1c')][_0x57a9('0x1d')]({'raw':_0x5ef462['options']?_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462['options'][_0x57a9('0x20')]||null:null,'attributes':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462[_0x57a9('0x1e')]['attributes']||null:null,'limit':_0x5ef462['options']?_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x21')]||null:null,'include':_0x5ef462[_0x57a9('0x1e')]?_0x5ef462[_0x57a9('0x1e')]['include']?_[_0x57a9('0x22')](_0x5ef462[_0x57a9('0x1e')][_0x57a9('0x23')],function(_0x2feba7){return{'model':db[_0x2feba7['model']],'as':_0x2feba7['as'],'attributes':_0x2feba7['attributes'],'include':_0x2feba7[_0x57a9('0x23')]?_['map'](_0x2feba7[_0x57a9('0x23')],function(_0x5806de){return{'model':db[_0x5806de[_0x57a9('0x24')]],'as':_0x5806de['as'],'attributes':_0x5806de[_0x57a9('0x25')],'include':_0x5806de[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x5806de[_0x57a9('0x23')],function(_0x554e3c){return{'model':db[_0x554e3c[_0x57a9('0x24')]],'as':_0x554e3c['as'],'attributes':_0x554e3c[_0x57a9('0x25')]};}):[]};}):[]};}):[]:[]})[_0x57a9('0x11')](function(_0x475565){logger[_0x57a9('0x12')](_0x57a9('0x1b'),_0x5ef462);logger[_0x57a9('0x26')](_0x57a9('0x1b'),_0x5ef462,JSON[_0x57a9('0x14')](_0x475565));_0x5d977f(_0x475565);})[_0x57a9('0x1a')](function(_0x25696f){logger[_0x57a9('0x15')](_0x57a9('0x1b'),_0x25696f[_0x57a9('0x18')],_0x5ef462);_0x3262a2(_0x294b71[_0x57a9('0x15')](0x1f4,_0x25696f[_0x57a9('0x18')]));});});};exports[_0x57a9('0x27')]=function(_0x440d4d){var _0x56a731=this;return new Promise(function(_0x4ea00d,_0xd8f20){return db[_0x57a9('0x1c')][_0x57a9('0x28')]({'raw':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x20')]||null:null,'attributes':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x25')]||null:null,'include':_0x440d4d[_0x57a9('0x1e')]?_0x440d4d['options'][_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x440d4d[_0x57a9('0x1e')][_0x57a9('0x23')],function(_0x1dba30){return{'model':db[_0x1dba30[_0x57a9('0x24')]],'as':_0x1dba30['as'],'attributes':_0x1dba30['attributes'],'include':_0x1dba30[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x1dba30[_0x57a9('0x23')],function(_0x8e27b3){return{'model':db[_0x8e27b3['model']],'as':_0x8e27b3['as'],'attributes':_0x8e27b3[_0x57a9('0x25')],'include':_0x8e27b3[_0x57a9('0x23')]?_[_0x57a9('0x22')](_0x8e27b3[_0x57a9('0x23')],function(_0x169fa1){return{'model':db[_0x169fa1[_0x57a9('0x24')]],'as':_0x169fa1['as'],'attributes':_0x169fa1[_0x57a9('0x25')]};}):[]};}):[]};}):[]:[]})[_0x57a9('0x11')](function(_0x49c66e){logger[_0x57a9('0x12')](_0x57a9('0x27'),_0x440d4d);logger[_0x57a9('0x26')](_0x57a9('0x27'),_0x440d4d,JSON['stringify'](_0x49c66e));_0x4ea00d(_0x49c66e);})[_0x57a9('0x1a')](function(_0x22eed3){logger[_0x57a9('0x15')](_0x57a9('0x27'),_0x22eed3[_0x57a9('0x18')],_0x440d4d);_0xd8f20(_0x56a731[_0x57a9('0x15')](0x1f4,_0x22eed3[_0x57a9('0x18')]));});});}; \ No newline at end of file +var _0xbd45=['include','map','model','then','ShowSmsQueue','SmsQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes'];(function(_0x1c206c,_0x30bdcf){var _0x188aaa=function(_0x49ff11){while(--_0x49ff11){_0x1c206c['push'](_0x1c206c['shift']());}};_0x188aaa(++_0x30bdcf);}(_0xbd45,0x110));var _0x5bd4=function(_0x38dbf0,_0x4f8a7f){_0x38dbf0=_0x38dbf0-0x0;var _0x1eb9df=_0xbd45[_0x38dbf0];return _0x1eb9df;};'use strict';var _=require(_0x5bd4('0x0'));var util=require(_0x5bd4('0x1'));var moment=require('moment');var BPromise=require(_0x5bd4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bd4('0x3'));var db=require(_0x5bd4('0x4'))['db'];var utils=require(_0x5bd4('0x5'));var logger=require(_0x5bd4('0x6'))(_0x5bd4('0x7'));var config=require(_0x5bd4('0x8'));var jayson=require(_0x5bd4('0x9'));var client=jayson[_0x5bd4('0xa')]['http']({'port':0x232a});config[_0x5bd4('0xb')]=_[_0x5bd4('0xc')](config[_0x5bd4('0xb')],{'host':_0x5bd4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bd4('0xb')]));require('./smsQueue.socket')[_0x5bd4('0xe')](socket);function respondWithRpcPromise(_0x5f0c98,_0x39da04,_0x5def05){return new BPromise(function(_0x517235,_0x52a8be){return client[_0x5bd4('0xf')](_0x5f0c98,_0x5def05)['then'](function(_0x58c0d3){logger[_0x5bd4('0x10')](_0x5bd4('0x11'),_0x39da04,_0x5bd4('0x12'));logger[_0x5bd4('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x39da04,'request\x20sent',JSON[_0x5bd4('0x14')](_0x58c0d3));if(_0x58c0d3['error']){if(_0x58c0d3[_0x5bd4('0x15')][_0x5bd4('0x16')]===0x1f4){logger[_0x5bd4('0x15')](_0x5bd4('0x11'),_0x39da04,_0x58c0d3['error'][_0x5bd4('0x17')]);return _0x52a8be(_0x58c0d3['error']['message']);}logger['error'](_0x5bd4('0x11'),_0x39da04,_0x58c0d3[_0x5bd4('0x15')][_0x5bd4('0x17')]);return _0x517235(_0x58c0d3[_0x5bd4('0x15')][_0x5bd4('0x17')]);}else{logger[_0x5bd4('0x10')](_0x5bd4('0x11'),_0x39da04,_0x5bd4('0x12'));_0x517235(_0x58c0d3[_0x5bd4('0x18')][_0x5bd4('0x17')]);}})[_0x5bd4('0x19')](function(_0x22789b){logger['error'](_0x5bd4('0x11'),_0x39da04,_0x22789b);_0x52a8be(_0x22789b);});});}exports[_0x5bd4('0x1a')]=function(_0x308fcd){var _0x45636a=this;return new Promise(function(_0x25b57f,_0x533ec1){return db['SmsQueue'][_0x5bd4('0x1b')]({'raw':_0x308fcd[_0x5bd4('0x1c')]?_0x308fcd[_0x5bd4('0x1c')][_0x5bd4('0x1d')]===undefined?!![]:![]:!![],'where':_0x308fcd[_0x5bd4('0x1c')]?_0x308fcd[_0x5bd4('0x1c')][_0x5bd4('0x1e')]||null:null,'attributes':_0x308fcd[_0x5bd4('0x1c')]?_0x308fcd[_0x5bd4('0x1c')][_0x5bd4('0x1f')]||null:null,'limit':_0x308fcd[_0x5bd4('0x1c')]?_0x308fcd[_0x5bd4('0x1c')]['limit']||null:null,'include':_0x308fcd[_0x5bd4('0x1c')]?_0x308fcd[_0x5bd4('0x1c')][_0x5bd4('0x20')]?_[_0x5bd4('0x21')](_0x308fcd[_0x5bd4('0x1c')][_0x5bd4('0x20')],function(_0x5e99b5){return{'model':db[_0x5e99b5[_0x5bd4('0x22')]],'as':_0x5e99b5['as'],'attributes':_0x5e99b5[_0x5bd4('0x1f')],'include':_0x5e99b5[_0x5bd4('0x20')]?_[_0x5bd4('0x21')](_0x5e99b5[_0x5bd4('0x20')],function(_0x580126){return{'model':db[_0x580126[_0x5bd4('0x22')]],'as':_0x580126['as'],'attributes':_0x580126[_0x5bd4('0x1f')],'include':_0x580126[_0x5bd4('0x20')]?_[_0x5bd4('0x21')](_0x580126[_0x5bd4('0x20')],function(_0x3e82d0){return{'model':db[_0x3e82d0[_0x5bd4('0x22')]],'as':_0x3e82d0['as'],'attributes':_0x3e82d0[_0x5bd4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5bd4('0x23')](function(_0x42e2fb){logger[_0x5bd4('0x10')]('GetSmsQueue',_0x308fcd);logger[_0x5bd4('0x13')]('GetSmsQueue',_0x308fcd,JSON[_0x5bd4('0x14')](_0x42e2fb));_0x25b57f(_0x42e2fb);})[_0x5bd4('0x19')](function(_0x50dc68){logger[_0x5bd4('0x15')](_0x5bd4('0x1a'),_0x50dc68[_0x5bd4('0x17')],_0x308fcd);_0x533ec1(_0x45636a['error'](0x1f4,_0x50dc68[_0x5bd4('0x17')]));});});};exports[_0x5bd4('0x24')]=function(_0x2f38ce){var _0x13312e=this;return new Promise(function(_0xfcc9e6,_0x3c55c5){return db[_0x5bd4('0x25')]['find']({'raw':_0x2f38ce[_0x5bd4('0x1c')]?_0x2f38ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f38ce[_0x5bd4('0x1c')]?_0x2f38ce[_0x5bd4('0x1c')][_0x5bd4('0x1e')]||null:null,'attributes':_0x2f38ce[_0x5bd4('0x1c')]?_0x2f38ce['options'][_0x5bd4('0x1f')]||null:null,'include':_0x2f38ce[_0x5bd4('0x1c')]?_0x2f38ce[_0x5bd4('0x1c')]['include']?_[_0x5bd4('0x21')](_0x2f38ce[_0x5bd4('0x1c')]['include'],function(_0x2f6c59){return{'model':db[_0x2f6c59['model']],'as':_0x2f6c59['as'],'attributes':_0x2f6c59[_0x5bd4('0x1f')],'include':_0x2f6c59[_0x5bd4('0x20')]?_['map'](_0x2f6c59[_0x5bd4('0x20')],function(_0x3a5ca2){return{'model':db[_0x3a5ca2[_0x5bd4('0x22')]],'as':_0x3a5ca2['as'],'attributes':_0x3a5ca2[_0x5bd4('0x1f')],'include':_0x3a5ca2[_0x5bd4('0x20')]?_['map'](_0x3a5ca2['include'],function(_0x1351bb){return{'model':db[_0x1351bb[_0x5bd4('0x22')]],'as':_0x1351bb['as'],'attributes':_0x1351bb[_0x5bd4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5bd4('0x23')](function(_0x4155d0){logger[_0x5bd4('0x10')](_0x5bd4('0x24'),_0x2f38ce);logger[_0x5bd4('0x13')](_0x5bd4('0x24'),_0x2f38ce,JSON[_0x5bd4('0x14')](_0x4155d0));_0xfcc9e6(_0x4155d0);})[_0x5bd4('0x19')](function(_0x15c605){logger[_0x5bd4('0x15')](_0x5bd4('0x24'),_0x15c605[_0x5bd4('0x17')],_0x2f38ce);_0x3c55c5(_0x13312e[_0x5bd4('0x15')](0x1f4,_0x15c605[_0x5bd4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5d871c5..bd4518c 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 _0x61ad=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x61ad,0x1b4));var _0xd61a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61ad[_0x321bb2];return _0x9c12ed;};'use strict';var SmsQueueEvents=require(_0xd61a('0x0'));var events=[_0xd61a('0x1'),_0xd61a('0x2'),_0xd61a('0x3')];function createListener(_0x2bcdd0,_0x2b7e5d){return function(_0x58a278){_0x2b7e5d[_0xd61a('0x4')](_0x2bcdd0,_0x58a278);};}function removeListener(_0x1a44e3,_0x575e23){return function(){SmsQueueEvents[_0xd61a('0x5')](_0x1a44e3,_0x575e23);};}exports['register']=function(_0x2eb06d){for(var _0x40ebbf=0x0,_0xa9d28b=events[_0xd61a('0x6')];_0x40ebbf<_0xa9d28b;_0x40ebbf++){var _0x1a195d=events[_0x40ebbf];var _0x22e54f=createListener(_0xd61a('0x7')+_0x1a195d,_0x2eb06d);SmsQueueEvents['on'](_0x1a195d,_0x22e54f);}}; \ No newline at end of file +var _0xb935=['length','smsQueue:','./smsQueue.events','remove','update','removeListener'];(function(_0x5c248a,_0x4e712c){var _0x3b3498=function(_0x46a158){while(--_0x46a158){_0x5c248a['push'](_0x5c248a['shift']());}};_0x3b3498(++_0x4e712c);}(_0xb935,0x14c));var _0x5b93=function(_0x33a6de,_0xc2e0b8){_0x33a6de=_0x33a6de-0x0;var _0x3d2151=_0xb935[_0x33a6de];return _0x3d2151;};'use strict';var SmsQueueEvents=require(_0x5b93('0x0'));var events=['save',_0x5b93('0x1'),_0x5b93('0x2')];function createListener(_0xef3d8f,_0x187d11){return function(_0x5ad21e){_0x187d11['emit'](_0xef3d8f,_0x5ad21e);};}function removeListener(_0x34a194,_0x4f02c1){return function(){SmsQueueEvents[_0x5b93('0x3')](_0x34a194,_0x4f02c1);};}exports['register']=function(_0xce2ecb){for(var _0x2fc163=0x0,_0x195cc2=events[_0x5b93('0x4')];_0x2fc163<_0x195cc2;_0x2fc163++){var _0x526c30=events[_0x2fc163];var _0x26d7da=createListener(_0x5b93('0x5')+_0x526c30,_0xce2ecb);SmsQueueEvents['on'](_0x526c30,_0x26d7da);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 0f4e561..826b750 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 _0x6a3b=['./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update','delete','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28df22,_0x5af00d){var _0x225ecb=function(_0x5b5079){while(--_0x5b5079){_0x28df22['push'](_0x28df22['shift']());}};_0x225ecb(++_0x5af00d);}(_0x6a3b,0x134));var _0xb6a3=function(_0x59b4a6,_0x321bd4){_0x59b4a6=_0x59b4a6-0x0;var _0x33d150=_0x6a3b[_0x59b4a6];return _0x33d150;};'use strict';var multer=require('multer');var util=require(_0xb6a3('0x0'));var path=require(_0xb6a3('0x1'));var timeout=require(_0xb6a3('0x2'));var express=require('express');var router=express[_0xb6a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb6a3('0x4'));var interaction=require(_0xb6a3('0x5'));var config=require(_0xb6a3('0x6'));var controller=require(_0xb6a3('0x7'));router['get']('/',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0x9')]);router[_0xb6a3('0xa')](_0xb6a3('0xb'),auth[_0xb6a3('0x8')](),controller[_0xb6a3('0xc')]);router[_0xb6a3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb6a3('0xd')]);router[_0xb6a3('0xe')]('/',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0xf')]);router[_0xb6a3('0x10')]('/:id',auth[_0xb6a3('0x8')](),controller[_0xb6a3('0x11')]);router[_0xb6a3('0x12')](_0xb6a3('0x13'),auth[_0xb6a3('0x8')](),controller['destroy']);module[_0xb6a3('0x14')]=router; \ No newline at end of file +var _0xa2f3=['isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x53468a,_0x286986){var _0x205efd=function(_0x5eb1e9){while(--_0x5eb1e9){_0x53468a['push'](_0x53468a['shift']());}};_0x205efd(++_0x286986);}(_0xa2f3,0x76));var _0x3a2f=function(_0x3c8599,_0x234eaa){_0x3c8599=_0x3c8599-0x0;var _0x253d47=_0xa2f3[_0x3c8599];return _0x253d47;};'use strict';var multer=require('multer');var util=require(_0x3a2f('0x0'));var path=require('path');var timeout=require(_0x3a2f('0x1'));var express=require(_0x3a2f('0x2'));var router=express['Router']();var fs_extra=require(_0x3a2f('0x3'));var auth=require(_0x3a2f('0x4'));var interaction=require(_0x3a2f('0x5'));var config=require(_0x3a2f('0x6'));var controller=require('./smsQueueReport.controller');router[_0x3a2f('0x7')]('/',auth[_0x3a2f('0x8')](),controller['index']);router[_0x3a2f('0x7')](_0x3a2f('0x9'),auth[_0x3a2f('0x8')](),controller['describe']);router[_0x3a2f('0x7')](_0x3a2f('0xa'),auth[_0x3a2f('0x8')](),controller[_0x3a2f('0xb')]);router['post']('/',auth[_0x3a2f('0x8')](),controller[_0x3a2f('0xc')]);router[_0x3a2f('0xd')](_0x3a2f('0xa'),auth[_0x3a2f('0x8')](),controller[_0x3a2f('0xe')]);router[_0x3a2f('0xf')]('/:id',auth[_0x3a2f('0x8')](),controller[_0x3a2f('0x10')]);module[_0x3a2f('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e2350a4..7862e6f 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 _0x415d=['exports','STRING','DATE','moment'];(function(_0xcb98a7,_0x5a8f09){var _0xc17dba=function(_0xa75f10){while(--_0xa75f10){_0xcb98a7['push'](_0xcb98a7['shift']());}};_0xc17dba(++_0x5a8f09);}(_0x415d,0x1eb));var _0xd415=function(_0x3a8463,_0x516de1){_0x3a8463=_0x3a8463-0x0;var _0x18cbdf=_0x415d[_0x3a8463];return _0x18cbdf;};'use strict';var moment=require(_0xd415('0x0'));var Sequelize=require('sequelize');module[_0xd415('0x1')]={'uniqueid':{'type':Sequelize[_0xd415('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd415('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd415('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd415('0x2')]}}; \ No newline at end of file +var _0xef4b=['sequelize','DATE'];(function(_0x497b34,_0xd7a3dd){var _0x4b0819=function(_0x476511){while(--_0x476511){_0x497b34['push'](_0x497b34['shift']());}};_0x4b0819(++_0xd7a3dd);}(_0xef4b,0x86));var _0xbef4=function(_0x56d1b5,_0x289333){_0x56d1b5=_0x56d1b5-0x0;var _0x4ad91e=_0xef4b[_0x56d1b5];return _0x4ad91e;};'use strict';var moment=require('moment');var Sequelize=require(_0xbef4('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbef4('0x1')]},'acceptAt':{'type':Sequelize[_0xbef4('0x1')]},'exitAt':{'type':Sequelize[_0xbef4('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index eaeb6d1..120f9bb 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 _0xf66f=['options','SmsQueueReport','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x121516,_0x51bde8){var _0x3b0eab=function(_0x375627){while(--_0x375627){_0x121516['push'](_0x121516['shift']());}};_0x3b0eab(++_0x51bde8);}(_0xf66f,0x141));var _0xff66=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xf66f[_0x280ae7];return _0x418b9e;};'use strict';var emlformat=require(_0xff66('0x0'));var rimraf=require(_0xff66('0x1'));var zipdir=require(_0xff66('0x2'));var jsonpatch=require(_0xff66('0x3'));var rp=require(_0xff66('0x4'));var moment=require(_0xff66('0x5'));var BPromise=require(_0xff66('0x6'));var Mustache=require(_0xff66('0x7'));var util=require(_0xff66('0x8'));var path=require(_0xff66('0x9'));var sox=require(_0xff66('0xa'));var csv=require(_0xff66('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff66('0xc'));var _=require(_0xff66('0xd'));var squel=require('squel');var crypto=require(_0xff66('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xff66('0xf'));var toCsv=require(_0xff66('0xb'));var querystring=require('querystring');var Papa=require(_0xff66('0x10'));var Redis=require(_0xff66('0x11'));var authService=require(_0xff66('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff66('0x13'));var logger=require('../../config/logger')(_0xff66('0x14'));var utils=require(_0xff66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff66('0x16'));var db=require(_0xff66('0x17'))['db'];function respondWithStatusCode(_0xe9b68f,_0x2a1f3e){_0x2a1f3e=_0x2a1f3e||0xcc;return function(_0x3d1023){if(_0x3d1023){return _0xe9b68f['sendStatus'](_0x2a1f3e);}return _0xe9b68f['status'](_0x2a1f3e)[_0xff66('0x18')]();};}function respondWithResult(_0x2565e,_0x1047bf){_0x1047bf=_0x1047bf||0xc8;return function(_0x490f23){if(_0x490f23){return _0x2565e['status'](_0x1047bf)[_0xff66('0x19')](_0x490f23);}};}function respondWithFilteredResult(_0x1149fe,_0x369fa8){return function(_0x4713c2){if(_0x4713c2){var _0x1b4799=typeof _0x369fa8['offset']===_0xff66('0x1a')&&typeof _0x369fa8[_0xff66('0x1b')]===_0xff66('0x1a');var _0xeb1789=_0x4713c2[_0xff66('0x1c')];var _0x1e2f6e=_0x1b4799?0x0:_0x369fa8['offset'];var _0x69b6f6=_0x1b4799?_0x4713c2[_0xff66('0x1c')]:_0x369fa8['offset']+_0x369fa8['limit'];var _0x351bcc;if(_0x69b6f6>=_0xeb1789){_0x69b6f6=_0xeb1789;_0x351bcc=0xc8;}else{_0x351bcc=0xce;}_0x1149fe[_0xff66('0x1d')](_0x351bcc);return _0x1149fe[_0xff66('0x1e')](_0xff66('0x1f'),_0x1e2f6e+'-'+_0x69b6f6+'/'+_0xeb1789)[_0xff66('0x19')](_0x4713c2);}return null;};}function patchUpdates(_0xbc021d){return function(_0x5af759){try{jsonpatch[_0xff66('0x20')](_0x5af759,_0xbc021d,!![]);}catch(_0x3a6ec7){return BPromise[_0xff66('0x21')](_0x3a6ec7);}return _0x5af759[_0xff66('0x22')]();};}function saveUpdates(_0xac510b,_0x342d1b){return function(_0x1e7238){if(_0x1e7238){return _0x1e7238[_0xff66('0x23')](_0xac510b)[_0xff66('0x24')](function(_0x5b7c39){return _0x5b7c39;});}return null;};}function removeEntity(_0x5706df,_0x4606d9){return function(_0x254100){if(_0x254100){return _0x254100[_0xff66('0x25')]()[_0xff66('0x24')](function(){_0x5706df[_0xff66('0x1d')](0xcc)[_0xff66('0x18')]();});}};}function handleEntityNotFound(_0x5e16c6,_0x525e0e){return function(_0x3a2a7c){if(!_0x3a2a7c){_0x5e16c6[_0xff66('0x26')](0x194);}return _0x3a2a7c;};}function handleError(_0x2131b8,_0x58f9cc){_0x58f9cc=_0x58f9cc||0x1f4;return function(_0x14a25d){logger['error'](_0x14a25d[_0xff66('0x27')]);if(_0x14a25d[_0xff66('0x28')]){delete _0x14a25d[_0xff66('0x28')];}_0x2131b8[_0xff66('0x1d')](_0x58f9cc)[_0xff66('0x29')](_0x14a25d);};}exports[_0xff66('0x2a')]=function(_0x2180dd,_0xca6042){var _0x324042={},_0xd0285d={},_0x5b3189={'count':0x0,'rows':[]};var _0x7a7c83=_[_0xff66('0x2b')](db['SmsQueueReport']['rawAttributes'],function(_0x3d5e82){return{'name':_0x3d5e82[_0xff66('0x2c')],'type':_0x3d5e82['type'][_0xff66('0x2d')]};});_0xd0285d[_0xff66('0x2e')]=_['map'](_0x7a7c83,_0xff66('0x28'));_0xd0285d[_0xff66('0x2f')]=_[_0xff66('0x30')](_0x2180dd[_0xff66('0x2f')]);_0xd0285d['filters']=_['intersection'](_0xd0285d[_0xff66('0x2e')],_0xd0285d[_0xff66('0x2f')]);_0x324042['attributes']=_[_0xff66('0x31')](_0xd0285d[_0xff66('0x2e')],qs[_0xff66('0x32')](_0x2180dd[_0xff66('0x2f')]['fields']));_0x324042[_0xff66('0x33')]=_0x324042[_0xff66('0x33')][_0xff66('0x34')]?_0x324042[_0xff66('0x33')]:_0xd0285d['model'];if(!_0x2180dd[_0xff66('0x2f')][_0xff66('0x35')](_0xff66('0x36'))){_0x324042[_0xff66('0x1b')]=qs[_0xff66('0x1b')](_0x2180dd[_0xff66('0x2f')][_0xff66('0x1b')]);_0x324042[_0xff66('0x37')]=qs[_0xff66('0x37')](_0x2180dd['query'][_0xff66('0x37')]);}_0x324042[_0xff66('0x38')]=qs[_0xff66('0x39')](_0x2180dd[_0xff66('0x2f')][_0xff66('0x39')]);_0x324042[_0xff66('0x3a')]=qs['filters'](_['pick'](_0x2180dd['query'],_0xd0285d[_0xff66('0x3b')]),_0x7a7c83);if(_0x2180dd[_0xff66('0x2f')][_0xff66('0x3c')]){_0x324042[_0xff66('0x3a')]=_[_0xff66('0x3d')](_0x324042['where'],{'$or':_[_0xff66('0x2b')](_0x7a7c83,function(_0x42c55f){if(_0x42c55f[_0xff66('0x3e')]!==_0xff66('0x3f')){var _0x336080={};_0x336080[_0x42c55f[_0xff66('0x28')]]={'$like':'%'+_0x2180dd[_0xff66('0x2f')][_0xff66('0x3c')]+'%'};return _0x336080;}})});}_0x324042=_[_0xff66('0x3d')]({},_0x324042,_0x2180dd[_0xff66('0x40')]);var _0x3f0825={'where':_0x324042['where']};return db[_0xff66('0x41')][_0xff66('0x1c')](_0x3f0825)['then'](function(_0x1b1b12){_0x5b3189[_0xff66('0x1c')]=_0x1b1b12;if(_0x2180dd[_0xff66('0x2f')]['includeAll']){_0x324042[_0xff66('0x42')]=[{'all':!![]}];}return db[_0xff66('0x41')][_0xff66('0x43')](_0x324042);})['then'](function(_0x11c961){_0x5b3189[_0xff66('0x44')]=_0x11c961;return _0x5b3189;})[_0xff66('0x24')](respondWithFilteredResult(_0xca6042,_0x324042))[_0xff66('0x45')](handleError(_0xca6042,null));};exports[_0xff66('0x46')]=function(_0x4b1c50,_0x3a9a58){var _0x295a7a={'raw':!![],'where':{'id':_0x4b1c50[_0xff66('0x47')]['id']}},_0x47b1d6={};_0x47b1d6[_0xff66('0x2e')]=_[_0xff66('0x30')](db[_0xff66('0x41')][_0xff66('0x48')]);_0x47b1d6[_0xff66('0x2f')]=_[_0xff66('0x30')](_0x4b1c50[_0xff66('0x2f')]);_0x47b1d6[_0xff66('0x3b')]=_[_0xff66('0x31')](_0x47b1d6[_0xff66('0x2e')],_0x47b1d6['query']);_0x295a7a[_0xff66('0x33')]=_[_0xff66('0x31')](_0x47b1d6['model'],qs[_0xff66('0x32')](_0x4b1c50['query'][_0xff66('0x32')]));_0x295a7a[_0xff66('0x33')]=_0x295a7a[_0xff66('0x33')][_0xff66('0x34')]?_0x295a7a['attributes']:_0x47b1d6[_0xff66('0x2e')];if(_0x4b1c50[_0xff66('0x2f')]['includeAll']){_0x295a7a[_0xff66('0x42')]=[{'all':!![]}];}_0x295a7a=_[_0xff66('0x3d')]({},_0x295a7a,_0x4b1c50['options']);return db[_0xff66('0x41')][_0xff66('0x49')](_0x295a7a)['then'](handleEntityNotFound(_0x3a9a58,null))[_0xff66('0x24')](respondWithResult(_0x3a9a58,null))[_0xff66('0x45')](handleError(_0x3a9a58,null));};exports[_0xff66('0x4a')]=function(_0x5cd6b2,_0x2c1f6d){return db['SmsQueueReport'][_0xff66('0x4a')](_0x5cd6b2[_0xff66('0x4b')],{})['then'](respondWithResult(_0x2c1f6d,0xc9))['catch'](handleError(_0x2c1f6d,null));};exports['update']=function(_0x4b6e6c,_0x5981c0){if(_0x4b6e6c[_0xff66('0x4b')]['id']){delete _0x4b6e6c[_0xff66('0x4b')]['id'];}return db[_0xff66('0x41')]['find']({'where':{'id':_0x4b6e6c[_0xff66('0x47')]['id']}})[_0xff66('0x24')](handleEntityNotFound(_0x5981c0,null))[_0xff66('0x24')](saveUpdates(_0x4b6e6c[_0xff66('0x4b')],null))[_0xff66('0x24')](respondWithResult(_0x5981c0,null))[_0xff66('0x45')](handleError(_0x5981c0,null));};exports['destroy']=function(_0x5e2f63,_0x3670be){return db['SmsQueueReport'][_0xff66('0x49')]({'where':{'id':_0x5e2f63['params']['id']}})[_0xff66('0x24')](handleEntityNotFound(_0x3670be,null))['then'](removeEntity(_0x3670be,null))['catch'](handleError(_0x3670be,null));};exports[_0xff66('0x4c')]=function(_0x70d430,_0x577b77){return db['SmsQueueReport'][_0xff66('0x4c')]()[_0xff66('0x24')](respondWithResult(_0x577b77,null))[_0xff66('0x45')](handleError(_0x577b77,null));}; \ No newline at end of file +var _0x48b8=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0xdb74,_0x3ecc31){var _0x162400=function(_0x2a2a84){while(--_0x2a2a84){_0xdb74['push'](_0xdb74['shift']());}};_0x162400(++_0x3ecc31);}(_0x48b8,0xc8));var _0x848b=function(_0x32b1eb,_0x5886c6){_0x32b1eb=_0x32b1eb-0x0;var _0x5d320c=_0x48b8[_0x32b1eb];return _0x5d320c;};'use strict';var emlformat=require(_0x848b('0x0'));var rimraf=require(_0x848b('0x1'));var zipdir=require(_0x848b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x848b('0x3'));var moment=require(_0x848b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x848b('0x5'));var util=require(_0x848b('0x6'));var path=require('path');var sox=require(_0x848b('0x7'));var csv=require(_0x848b('0x8'));var ejs=require(_0x848b('0x9'));var fs=require('fs');var fs_extra=require(_0x848b('0xa'));var _=require(_0x848b('0xb'));var squel=require(_0x848b('0xc'));var crypto=require(_0x848b('0xd'));var jsforce=require(_0x848b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x848b('0x8'));var querystring=require(_0x848b('0xf'));var Papa=require('papaparse');var Redis=require(_0x848b('0x10'));var authService=require(_0x848b('0x11'));var qs=require(_0x848b('0x12'));var as=require(_0x848b('0x13'));var hardwareService=require(_0x848b('0x14'));var logger=require(_0x848b('0x15'))(_0x848b('0x16'));var utils=require(_0x848b('0x17'));var config=require(_0x848b('0x18'));var licenseUtil=require(_0x848b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51bf2b,_0x434625){_0x434625=_0x434625||0xcc;return function(_0x53e07d){if(_0x53e07d){return _0x51bf2b[_0x848b('0x1a')](_0x434625);}return _0x51bf2b[_0x848b('0x1b')](_0x434625)[_0x848b('0x1c')]();};}function respondWithResult(_0x313e82,_0x46f92e){_0x46f92e=_0x46f92e||0xc8;return function(_0x1bf908){if(_0x1bf908){return _0x313e82[_0x848b('0x1b')](_0x46f92e)[_0x848b('0x1d')](_0x1bf908);}};}function respondWithFilteredResult(_0x4c6cf5,_0x3dd2b4){return function(_0x509902){if(_0x509902){var _0x464658=typeof _0x3dd2b4['offset']===_0x848b('0x1e')&&typeof _0x3dd2b4[_0x848b('0x1f')]===_0x848b('0x1e');var _0x405d55=_0x509902[_0x848b('0x20')];var _0x5a8b13=_0x464658?0x0:_0x3dd2b4['offset'];var _0x294584=_0x464658?_0x509902[_0x848b('0x20')]:_0x3dd2b4['offset']+_0x3dd2b4[_0x848b('0x1f')];var _0x4f34da;if(_0x294584>=_0x405d55){_0x294584=_0x405d55;_0x4f34da=0xc8;}else{_0x4f34da=0xce;}_0x4c6cf5['status'](_0x4f34da);return _0x4c6cf5[_0x848b('0x21')](_0x848b('0x22'),_0x5a8b13+'-'+_0x294584+'/'+_0x405d55)[_0x848b('0x1d')](_0x509902);}return null;};}function patchUpdates(_0xadf2){return function(_0x4fd5cb){try{jsonpatch[_0x848b('0x23')](_0x4fd5cb,_0xadf2,!![]);}catch(_0x21a75c){return BPromise[_0x848b('0x24')](_0x21a75c);}return _0x4fd5cb[_0x848b('0x25')]();};}function saveUpdates(_0x13ddc7,_0x3e5d2f){return function(_0x5d08a8){if(_0x5d08a8){return _0x5d08a8[_0x848b('0x26')](_0x13ddc7)[_0x848b('0x27')](function(_0xb5560){return _0xb5560;});}return null;};}function removeEntity(_0x43b69c,_0x2fbcd5){return function(_0x3ee240){if(_0x3ee240){return _0x3ee240[_0x848b('0x28')]()[_0x848b('0x27')](function(){_0x43b69c[_0x848b('0x1b')](0xcc)[_0x848b('0x1c')]();});}};}function handleEntityNotFound(_0x3ed195,_0xb7bd0d){return function(_0x427a36){if(!_0x427a36){_0x3ed195[_0x848b('0x1a')](0x194);}return _0x427a36;};}function handleError(_0x4f72b6,_0x1795a2){_0x1795a2=_0x1795a2||0x1f4;return function(_0x143f65){logger[_0x848b('0x29')](_0x143f65[_0x848b('0x2a')]);if(_0x143f65[_0x848b('0x2b')]){delete _0x143f65['name'];}_0x4f72b6[_0x848b('0x1b')](_0x1795a2)[_0x848b('0x2c')](_0x143f65);};}exports['index']=function(_0x17f32f,_0x1a08ae){var _0x1b034a={},_0x9449c2={},_0x24d85b={'count':0x0,'rows':[]};var _0x2274f7=_[_0x848b('0x2d')](db[_0x848b('0x2e')]['rawAttributes'],function(_0xd96ec7){return{'name':_0xd96ec7[_0x848b('0x2f')],'type':_0xd96ec7[_0x848b('0x30')][_0x848b('0x31')]};});_0x9449c2[_0x848b('0x32')]=_[_0x848b('0x2d')](_0x2274f7,_0x848b('0x2b'));_0x9449c2[_0x848b('0x33')]=_[_0x848b('0x34')](_0x17f32f[_0x848b('0x33')]);_0x9449c2['filters']=_[_0x848b('0x35')](_0x9449c2['model'],_0x9449c2['query']);_0x1b034a[_0x848b('0x36')]=_[_0x848b('0x35')](_0x9449c2['model'],qs[_0x848b('0x37')](_0x17f32f['query'][_0x848b('0x37')]));_0x1b034a[_0x848b('0x36')]=_0x1b034a[_0x848b('0x36')][_0x848b('0x38')]?_0x1b034a[_0x848b('0x36')]:_0x9449c2[_0x848b('0x32')];if(!_0x17f32f[_0x848b('0x33')][_0x848b('0x39')](_0x848b('0x3a'))){_0x1b034a[_0x848b('0x1f')]=qs[_0x848b('0x1f')](_0x17f32f[_0x848b('0x33')][_0x848b('0x1f')]);_0x1b034a[_0x848b('0x3b')]=qs['offset'](_0x17f32f[_0x848b('0x33')]['offset']);}_0x1b034a['order']=qs[_0x848b('0x3c')](_0x17f32f['query']['sort']);_0x1b034a[_0x848b('0x3d')]=qs[_0x848b('0x3e')](_[_0x848b('0x3f')](_0x17f32f[_0x848b('0x33')],_0x9449c2[_0x848b('0x3e')]),_0x2274f7);if(_0x17f32f[_0x848b('0x33')]['filter']){_0x1b034a[_0x848b('0x3d')]=_[_0x848b('0x40')](_0x1b034a[_0x848b('0x3d')],{'$or':_['map'](_0x2274f7,function(_0xd3378a){if(_0xd3378a[_0x848b('0x30')]!==_0x848b('0x41')){var _0x334505={};_0x334505[_0xd3378a['name']]={'$like':'%'+_0x17f32f['query'][_0x848b('0x42')]+'%'};return _0x334505;}})});}_0x1b034a=_[_0x848b('0x40')]({},_0x1b034a,_0x17f32f[_0x848b('0x43')]);var _0x4d6f99={'where':_0x1b034a['where']};return db[_0x848b('0x2e')][_0x848b('0x20')](_0x4d6f99)['then'](function(_0x368199){_0x24d85b[_0x848b('0x20')]=_0x368199;if(_0x17f32f[_0x848b('0x33')][_0x848b('0x44')]){_0x1b034a[_0x848b('0x45')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x1b034a);})[_0x848b('0x27')](function(_0x3ed946){_0x24d85b['rows']=_0x3ed946;return _0x24d85b;})[_0x848b('0x27')](respondWithFilteredResult(_0x1a08ae,_0x1b034a))[_0x848b('0x46')](handleError(_0x1a08ae,null));};exports[_0x848b('0x47')]=function(_0x331b79,_0x22458a){var _0x2b088e={'raw':!![],'where':{'id':_0x331b79['params']['id']}},_0x3cb52a={};_0x3cb52a[_0x848b('0x32')]=_[_0x848b('0x34')](db[_0x848b('0x2e')]['rawAttributes']);_0x3cb52a['query']=_['keys'](_0x331b79['query']);_0x3cb52a['filters']=_['intersection'](_0x3cb52a['model'],_0x3cb52a[_0x848b('0x33')]);_0x2b088e[_0x848b('0x36')]=_[_0x848b('0x35')](_0x3cb52a[_0x848b('0x32')],qs[_0x848b('0x37')](_0x331b79[_0x848b('0x33')]['fields']));_0x2b088e[_0x848b('0x36')]=_0x2b088e[_0x848b('0x36')][_0x848b('0x38')]?_0x2b088e[_0x848b('0x36')]:_0x3cb52a[_0x848b('0x32')];if(_0x331b79[_0x848b('0x33')][_0x848b('0x44')]){_0x2b088e[_0x848b('0x45')]=[{'all':!![]}];}_0x2b088e=_['merge']({},_0x2b088e,_0x331b79[_0x848b('0x43')]);return db[_0x848b('0x2e')][_0x848b('0x48')](_0x2b088e)['then'](handleEntityNotFound(_0x22458a,null))[_0x848b('0x27')](respondWithResult(_0x22458a,null))['catch'](handleError(_0x22458a,null));};exports['create']=function(_0x263c18,_0xbac571){return db['SmsQueueReport'][_0x848b('0x49')](_0x263c18[_0x848b('0x4a')],{})[_0x848b('0x27')](respondWithResult(_0xbac571,0xc9))[_0x848b('0x46')](handleError(_0xbac571,null));};exports['update']=function(_0x1455ac,_0x4069df){if(_0x1455ac['body']['id']){delete _0x1455ac['body']['id'];}return db[_0x848b('0x2e')][_0x848b('0x48')]({'where':{'id':_0x1455ac[_0x848b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4069df,null))[_0x848b('0x27')](saveUpdates(_0x1455ac['body'],null))[_0x848b('0x27')](respondWithResult(_0x4069df,null))['catch'](handleError(_0x4069df,null));};exports[_0x848b('0x28')]=function(_0x4e15c1,_0x27a36d){return db[_0x848b('0x2e')][_0x848b('0x48')]({'where':{'id':_0x4e15c1['params']['id']}})[_0x848b('0x27')](handleEntityNotFound(_0x27a36d,null))[_0x848b('0x27')](removeEntity(_0x27a36d,null))[_0x848b('0x46')](handleError(_0x27a36d,null));};exports[_0x848b('0x4c')]=function(_0x38b9f2,_0x58452e){return db[_0x848b('0x2e')][_0x848b('0x4c')]()[_0x848b('0x27')](respondWithResult(_0x58452e,null))[_0x848b('0x46')](handleError(_0x58452e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d90f541..7889d4d 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0xe706,0xa3));var _0x6e70=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xe706[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 614c277..0f524cd 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 _0xb25d=['jayson/promise','client','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','where','limit','then','UpdateSmsQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f0396,_0x23837b){var _0x34cafd=function(_0x1a00a0){while(--_0x1a00a0){_0x2f0396['push'](_0x2f0396['shift']());}};_0x34cafd(++_0x23837b);}(_0xb25d,0x1f0));var _0xdb25=function(_0x385b04,_0x2ce85e){_0x385b04=_0x385b04-0x0;var _0x21ec67=_0xb25d[_0x385b04];return _0x21ec67;};'use strict';var _=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var moment=require(_0xdb25('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb25('0x4'))['db'];var utils=require(_0xdb25('0x5'));var logger=require(_0xdb25('0x6'))('rpc');var config=require(_0xdb25('0x7'));var jayson=require(_0xdb25('0x8'));var client=jayson[_0xdb25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2177b0,_0x2eba38,_0x5ca60e){return new BPromise(function(_0x31626b,_0x2a6d1c){return client['request'](_0x2177b0,_0x5ca60e)['then'](function(_0xbdf0db){logger[_0xdb25('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x2eba38,_0xdb25('0xb'));logger[_0xdb25('0xc')](_0xdb25('0xd'),_0x2eba38,_0xdb25('0xb'),JSON[_0xdb25('0xe')](_0xbdf0db));if(_0xbdf0db['error']){if(_0xbdf0db[_0xdb25('0xf')]['code']===0x1f4){logger[_0xdb25('0xf')](_0xdb25('0x10'),_0x2eba38,_0xbdf0db['error'][_0xdb25('0x11')]);return _0x2a6d1c(_0xbdf0db[_0xdb25('0xf')]['message']);}logger['error'](_0xdb25('0x10'),_0x2eba38,_0xbdf0db[_0xdb25('0xf')][_0xdb25('0x11')]);return _0x31626b(_0xbdf0db['error']['message']);}else{logger[_0xdb25('0xa')](_0xdb25('0x10'),_0x2eba38,_0xdb25('0xb'));_0x31626b(_0xbdf0db['result'][_0xdb25('0x11')]);}})[_0xdb25('0x12')](function(_0x2b113e){logger['error'](_0xdb25('0x10'),_0x2eba38,_0x2b113e);_0x2a6d1c(_0x2b113e);});});}exports[_0xdb25('0x13')]=function(_0x3f43d8){var _0x3f261c=this;return new Promise(function(_0x474116,_0x4792ed){return db[_0xdb25('0x14')]['create'](_0x3f43d8[_0xdb25('0x15')],{'raw':_0x3f43d8[_0xdb25('0x16')]?_0x3f43d8[_0xdb25('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x13cbff){logger[_0xdb25('0xa')](_0xdb25('0x13'),_0x3f43d8);logger[_0xdb25('0xc')]('CreateSmsQueueReport',_0x3f43d8,JSON[_0xdb25('0xe')](_0x13cbff));_0x474116(_0x13cbff);})[_0xdb25('0x12')](function(_0x46e0e3){logger[_0xdb25('0xf')]('CreateSmsQueueReport',_0x46e0e3[_0xdb25('0x11')],_0x3f43d8);_0x4792ed(_0x3f261c[_0xdb25('0xf')](0x1f4,_0x46e0e3[_0xdb25('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x2bec8f){var _0x210fe8=this;return new Promise(function(_0x1944a0,_0x96c72b){return db['SmsQueueReport']['update'](_0x2bec8f[_0xdb25('0x15')],{'raw':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x18')]||null:null,'attributes':_0x2bec8f[_0xdb25('0x16')]?_0x2bec8f[_0xdb25('0x16')]['attributes']||null:null,'limit':_0x2bec8f['options']?_0x2bec8f[_0xdb25('0x16')][_0xdb25('0x19')]||null:null})[_0xdb25('0x1a')](function(_0x4ceeec){logger[_0xdb25('0xa')](_0xdb25('0x1b'),_0x2bec8f);logger['debug'](_0xdb25('0x1b'),_0x2bec8f,JSON[_0xdb25('0xe')](_0x4ceeec));_0x1944a0(_0x4ceeec);})['catch'](function(_0x498a7b){logger['error'](_0xdb25('0x1b'),_0x498a7b[_0xdb25('0x11')],_0x2bec8f);_0x96c72b(_0x210fe8[_0xdb25('0xf')](0x1f4,_0x498a7b['message']));});});}; \ No newline at end of file +var _0xfd48=['catch','UpdateSmsQueueReport','update','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsQueueReport,\x20%s,\x20%s','message','info','result','CreateSmsQueueReport','SmsQueueReport','body','options','raw'];(function(_0x2069aa,_0x2d5dbf){var _0x2702b9=function(_0x2e4a1d){while(--_0x2e4a1d){_0x2069aa['push'](_0x2069aa['shift']());}};_0x2702b9(++_0x2d5dbf);}(_0xfd48,0x6d));var _0x8fd4=function(_0x5e6f9e,_0x14e57e){_0x5e6f9e=_0x5e6f9e-0x0;var _0x1fe3fa=_0xfd48[_0x5e6f9e];return _0x1fe3fa;};'use strict';var _=require('lodash');var util=require(_0x8fd4('0x0'));var moment=require(_0x8fd4('0x1'));var BPromise=require(_0x8fd4('0x2'));var rs=require(_0x8fd4('0x3'));var fs=require('fs');var Redis=require(_0x8fd4('0x4'));var db=require(_0x8fd4('0x5'))['db'];var utils=require(_0x8fd4('0x6'));var logger=require(_0x8fd4('0x7'))(_0x8fd4('0x8'));var config=require(_0x8fd4('0x9'));var jayson=require(_0x8fd4('0xa'));var client=jayson[_0x8fd4('0xb')][_0x8fd4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58ec33,_0x205406,_0x5f45b4){return new BPromise(function(_0x58edb2,_0xe5aa28){return client[_0x8fd4('0xd')](_0x58ec33,_0x5f45b4)[_0x8fd4('0xe')](function(_0x2194e8){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x205406,'request\x20sent');logger['debug'](_0x8fd4('0xf'),_0x205406,_0x8fd4('0x10'),JSON['stringify'](_0x2194e8));if(_0x2194e8[_0x8fd4('0x11')]){if(_0x2194e8[_0x8fd4('0x11')]['code']===0x1f4){logger[_0x8fd4('0x11')](_0x8fd4('0x12'),_0x205406,_0x2194e8[_0x8fd4('0x11')][_0x8fd4('0x13')]);return _0xe5aa28(_0x2194e8[_0x8fd4('0x11')]['message']);}logger['error'](_0x8fd4('0x12'),_0x205406,_0x2194e8[_0x8fd4('0x11')][_0x8fd4('0x13')]);return _0x58edb2(_0x2194e8[_0x8fd4('0x11')][_0x8fd4('0x13')]);}else{logger[_0x8fd4('0x14')](_0x8fd4('0x12'),_0x205406,_0x8fd4('0x10'));_0x58edb2(_0x2194e8[_0x8fd4('0x15')]['message']);}})['catch'](function(_0x18225a){logger[_0x8fd4('0x11')](_0x8fd4('0x12'),_0x205406,_0x18225a);_0xe5aa28(_0x18225a);});});}exports[_0x8fd4('0x16')]=function(_0x143fbd){var _0x28d331=this;return new Promise(function(_0x11f3c2,_0x286895){return db[_0x8fd4('0x17')]['create'](_0x143fbd[_0x8fd4('0x18')],{'raw':_0x143fbd[_0x8fd4('0x19')]?_0x143fbd[_0x8fd4('0x19')][_0x8fd4('0x1a')]===undefined?!![]:![]:!![]})[_0x8fd4('0xe')](function(_0x385983){logger[_0x8fd4('0x14')]('CreateSmsQueueReport',_0x143fbd);logger['debug'](_0x8fd4('0x16'),_0x143fbd,JSON['stringify'](_0x385983));_0x11f3c2(_0x385983);})[_0x8fd4('0x1b')](function(_0x272c76){logger[_0x8fd4('0x11')](_0x8fd4('0x16'),_0x272c76['message'],_0x143fbd);_0x286895(_0x28d331[_0x8fd4('0x11')](0x1f4,_0x272c76[_0x8fd4('0x13')]));});});};exports[_0x8fd4('0x1c')]=function(_0x10fedc){var _0x45becf=this;return new Promise(function(_0x172958,_0x3e0b82){return db[_0x8fd4('0x17')][_0x8fd4('0x1d')](_0x10fedc[_0x8fd4('0x18')],{'raw':_0x10fedc[_0x8fd4('0x19')]?_0x10fedc['options'][_0x8fd4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10fedc[_0x8fd4('0x19')]?_0x10fedc[_0x8fd4('0x19')][_0x8fd4('0x1e')]||null:null,'attributes':_0x10fedc['options']?_0x10fedc[_0x8fd4('0x19')][_0x8fd4('0x1f')]||null:null,'limit':_0x10fedc[_0x8fd4('0x19')]?_0x10fedc[_0x8fd4('0x19')][_0x8fd4('0x20')]||null:null})[_0x8fd4('0xe')](function(_0x43556f){logger[_0x8fd4('0x14')]('UpdateSmsQueueReport',_0x10fedc);logger[_0x8fd4('0x21')](_0x8fd4('0x1c'),_0x10fedc,JSON['stringify'](_0x43556f));_0x172958(_0x43556f);})[_0x8fd4('0x1b')](function(_0x5d31f4){logger[_0x8fd4('0x11')](_0x8fd4('0x1c'),_0x5d31f4['message'],_0x10fedc);_0x3e0b82(_0x45becf[_0x8fd4('0x11')](0x1f4,_0x5d31f4[_0x8fd4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c73c7fe..b81efd7 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 _0xe0c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x33e7c3,_0x195049){var _0x1e19f6=function(_0x6cb1ee){while(--_0x6cb1ee){_0x33e7c3['push'](_0x33e7c3['shift']());}};_0x1e19f6(++_0x195049);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xb')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')]('/',auth[_0x3e0c('0xd')](),controller['create']);router['put'](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xbd50,0x196));var _0x0bd5=function(_0x54d70a,_0x623a3){_0x54d70a=_0x54d70a-0x0;var _0x5f3214=_0xbd50[_0x54d70a];return _0x5f3214;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0a36dfe..b58f32e 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5b9448,_0x5b9253){var _0x303709=function(_0x3e1407){while(--_0x3e1407){_0x5b9448['push'](_0x5b9448['shift']());}};_0x303709(++_0x5b9253);}(_0x70e0,0x17b));var _0x070e=function(_0x5df167,_0x478587){_0x5df167=_0x5df167-0x0;var _0x5a9c01=_0x70e0[_0x5df167];return _0x5a9c01;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5016c9,_0x57cdf0){var _0x5371ee=function(_0x494af9){while(--_0x494af9){_0x5016c9['push'](_0x5016c9['shift']());}};_0x5371ee(++_0x57cdf0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 2f9b77d..862483a 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 _0x2635=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','query'];(function(_0x30a34b,_0x5140b9){var _0x29fc8c=function(_0x49d435){while(--_0x49d435){_0x30a34b['push'](_0x30a34b['shift']());}};_0x29fc8c(++_0x5140b9);}(_0x2635,0x175));var _0x5263=function(_0x5b9bfb,_0x537cac){_0x5b9bfb=_0x5b9bfb-0x0;var _0xad636b=_0x2635[_0x5b9bfb];return _0xad636b;};'use strict';var emlformat=require(_0x5263('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5263('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5263('0x2'));var moment=require(_0x5263('0x3'));var BPromise=require(_0x5263('0x4'));var Mustache=require(_0x5263('0x5'));var util=require('util');var path=require(_0x5263('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5263('0x7'));var fs=require('fs');var fs_extra=require(_0x5263('0x8'));var _=require(_0x5263('0x9'));var squel=require(_0x5263('0xa'));var crypto=require(_0x5263('0xb'));var jsforce=require(_0x5263('0xc'));var deskjs=require(_0x5263('0xd'));var toCsv=require(_0x5263('0xe'));var querystring=require(_0x5263('0xf'));var Papa=require(_0x5263('0x10'));var Redis=require(_0x5263('0x11'));var authService=require(_0x5263('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5263('0x13'));var logger=require(_0x5263('0x14'))(_0x5263('0x15'));var utils=require(_0x5263('0x16'));var config=require(_0x5263('0x17'));var licenseUtil=require(_0x5263('0x18'));var db=require(_0x5263('0x19'))['db'];function respondWithStatusCode(_0x2a67c7,_0x5e1089){_0x5e1089=_0x5e1089||0xcc;return function(_0x22f19a){if(_0x22f19a){return _0x2a67c7['sendStatus'](_0x5e1089);}return _0x2a67c7[_0x5263('0x1a')](_0x5e1089)['end']();};}function respondWithResult(_0x243e4b,_0x47e2d8){_0x47e2d8=_0x47e2d8||0xc8;return function(_0x1d0733){if(_0x1d0733){return _0x243e4b['status'](_0x47e2d8)[_0x5263('0x1b')](_0x1d0733);}};}function respondWithFilteredResult(_0x3b75b0,_0x5afefe){return function(_0x23de24){if(_0x23de24){var _0x5cc00c=typeof _0x5afefe[_0x5263('0x1c')]===_0x5263('0x1d')&&typeof _0x5afefe[_0x5263('0x1e')]===_0x5263('0x1d');var _0x5f1d36=_0x23de24['count'];var _0x4663d0=_0x5cc00c?0x0:_0x5afefe['offset'];var _0x3219f3=_0x5cc00c?_0x23de24[_0x5263('0x1f')]:_0x5afefe[_0x5263('0x1c')]+_0x5afefe[_0x5263('0x1e')];var _0x2168f3;if(_0x3219f3>=_0x5f1d36){_0x3219f3=_0x5f1d36;_0x2168f3=0xc8;}else{_0x2168f3=0xce;}_0x3b75b0[_0x5263('0x1a')](_0x2168f3);return _0x3b75b0[_0x5263('0x20')](_0x5263('0x21'),_0x4663d0+'-'+_0x3219f3+'/'+_0x5f1d36)[_0x5263('0x1b')](_0x23de24);}return null;};}function patchUpdates(_0x2445a6){return function(_0x42197c){try{jsonpatch['apply'](_0x42197c,_0x2445a6,!![]);}catch(_0x468657){return BPromise['reject'](_0x468657);}return _0x42197c[_0x5263('0x22')]();};}function saveUpdates(_0x218a84,_0x34ae61){return function(_0x225828){if(_0x225828){return _0x225828[_0x5263('0x23')](_0x218a84)['then'](function(_0x2bacea){return _0x2bacea;});}return null;};}function removeEntity(_0x14d08f,_0x131970){return function(_0x70b8b5){if(_0x70b8b5){return _0x70b8b5['destroy']()[_0x5263('0x24')](function(){_0x14d08f['status'](0xcc)[_0x5263('0x25')]();});}};}function handleEntityNotFound(_0x1daa1e,_0x240c51){return function(_0x2a3c31){if(!_0x2a3c31){_0x1daa1e['sendStatus'](0x194);}return _0x2a3c31;};}function handleError(_0xcbbbba,_0x2a1dc6){_0x2a1dc6=_0x2a1dc6||0x1f4;return function(_0x3731e9){logger['error'](_0x3731e9[_0x5263('0x26')]);if(_0x3731e9[_0x5263('0x27')]){delete _0x3731e9[_0x5263('0x27')];}_0xcbbbba[_0x5263('0x1a')](_0x2a1dc6)[_0x5263('0x28')](_0x3731e9);};}exports[_0x5263('0x29')]=function(_0x524ffe,_0xe64d5b){var _0x5b840f={},_0x57b20d={},_0x2dc7b1={'count':0x0,'rows':[]};var _0x54a939=_[_0x5263('0x2a')](db[_0x5263('0x2b')][_0x5263('0x2c')],function(_0x57b55e){return{'name':_0x57b55e[_0x5263('0x2d')],'type':_0x57b55e['type']['key']};});_0x57b20d['model']=_['map'](_0x54a939,_0x5263('0x27'));_0x57b20d[_0x5263('0x2e')]=_[_0x5263('0x2f')](_0x524ffe[_0x5263('0x2e')]);_0x57b20d[_0x5263('0x30')]=_[_0x5263('0x31')](_0x57b20d['model'],_0x57b20d[_0x5263('0x2e')]);_0x5b840f['attributes']=_[_0x5263('0x31')](_0x57b20d[_0x5263('0x32')],qs[_0x5263('0x33')](_0x524ffe[_0x5263('0x2e')][_0x5263('0x33')]));_0x5b840f[_0x5263('0x34')]=_0x5b840f[_0x5263('0x34')][_0x5263('0x35')]?_0x5b840f[_0x5263('0x34')]:_0x57b20d['model'];if(!_0x524ffe['query'][_0x5263('0x36')]('nolimit')){_0x5b840f[_0x5263('0x1e')]=qs[_0x5263('0x1e')](_0x524ffe[_0x5263('0x2e')][_0x5263('0x1e')]);_0x5b840f['offset']=qs[_0x5263('0x1c')](_0x524ffe['query'][_0x5263('0x1c')]);}_0x5b840f[_0x5263('0x37')]=qs['sort'](_0x524ffe[_0x5263('0x2e')]['sort']);_0x5b840f[_0x5263('0x38')]=qs['filters'](_['pick'](_0x524ffe[_0x5263('0x2e')],_0x57b20d[_0x5263('0x30')]),_0x54a939);if(_0x524ffe[_0x5263('0x2e')][_0x5263('0x39')]){_0x5b840f[_0x5263('0x38')]=_['merge'](_0x5b840f[_0x5263('0x38')],{'$or':_[_0x5263('0x2a')](_0x54a939,function(_0x598d45){if(_0x598d45['type']!==_0x5263('0x3a')){var _0x54ac37={};_0x54ac37[_0x598d45['name']]={'$like':'%'+_0x524ffe[_0x5263('0x2e')][_0x5263('0x39')]+'%'};return _0x54ac37;}})});}_0x5b840f=_[_0x5263('0x3b')]({},_0x5b840f,_0x524ffe[_0x5263('0x3c')]);var _0x1d0cc7={'where':_0x5b840f[_0x5263('0x38')]};return db[_0x5263('0x2b')]['count'](_0x1d0cc7)['then'](function(_0x3e4821){_0x2dc7b1[_0x5263('0x1f')]=_0x3e4821;if(_0x524ffe[_0x5263('0x2e')][_0x5263('0x3d')]){_0x5b840f[_0x5263('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x5263('0x3f')](_0x5b840f);})['then'](function(_0x1047cd){_0x2dc7b1['rows']=_0x1047cd;return _0x2dc7b1;})[_0x5263('0x24')](respondWithFilteredResult(_0xe64d5b,_0x5b840f))[_0x5263('0x40')](handleError(_0xe64d5b,null));};exports[_0x5263('0x41')]=function(_0xe3e6b3,_0x4dced9){var _0x1fb0f6={'raw':!![],'where':{'id':_0xe3e6b3[_0x5263('0x42')]['id']}},_0x3fa676={};_0x3fa676[_0x5263('0x32')]=_[_0x5263('0x2f')](db[_0x5263('0x2b')][_0x5263('0x2c')]);_0x3fa676[_0x5263('0x2e')]=_[_0x5263('0x2f')](_0xe3e6b3[_0x5263('0x2e')]);_0x3fa676[_0x5263('0x30')]=_[_0x5263('0x31')](_0x3fa676[_0x5263('0x32')],_0x3fa676['query']);_0x1fb0f6['attributes']=_[_0x5263('0x31')](_0x3fa676['model'],qs[_0x5263('0x33')](_0xe3e6b3[_0x5263('0x2e')]['fields']));_0x1fb0f6[_0x5263('0x34')]=_0x1fb0f6['attributes'][_0x5263('0x35')]?_0x1fb0f6[_0x5263('0x34')]:_0x3fa676[_0x5263('0x32')];if(_0xe3e6b3['query'][_0x5263('0x3d')]){_0x1fb0f6[_0x5263('0x3e')]=[{'all':!![]}];}_0x1fb0f6=_['merge']({},_0x1fb0f6,_0xe3e6b3[_0x5263('0x3c')]);return db['SmsTransferReport'][_0x5263('0x43')](_0x1fb0f6)[_0x5263('0x24')](handleEntityNotFound(_0x4dced9,null))['then'](respondWithResult(_0x4dced9,null))[_0x5263('0x40')](handleError(_0x4dced9,null));};exports['create']=function(_0x19f26a,_0x2eb0a6){return db[_0x5263('0x2b')]['create'](_0x19f26a[_0x5263('0x44')],{})[_0x5263('0x24')](respondWithResult(_0x2eb0a6,0xc9))['catch'](handleError(_0x2eb0a6,null));};exports[_0x5263('0x23')]=function(_0x5b415c,_0x1d3708){if(_0x5b415c[_0x5263('0x44')]['id']){delete _0x5b415c[_0x5263('0x44')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x5b415c[_0x5263('0x42')]['id']}})[_0x5263('0x24')](handleEntityNotFound(_0x1d3708,null))[_0x5263('0x24')](saveUpdates(_0x5b415c[_0x5263('0x44')],null))['then'](respondWithResult(_0x1d3708,null))[_0x5263('0x40')](handleError(_0x1d3708,null));};exports[_0x5263('0x45')]=function(_0x323e38,_0x4995ab){return db[_0x5263('0x2b')]['find']({'where':{'id':_0x323e38['params']['id']}})[_0x5263('0x24')](handleEntityNotFound(_0x4995ab,null))[_0x5263('0x24')](removeEntity(_0x4995ab,null))[_0x5263('0x40')](handleError(_0x4995ab,null));};exports['describe']=function(_0x5c6795,_0x3f42b6){return db[_0x5263('0x2b')]['describe']()[_0x5263('0x24')](respondWithResult(_0x3f42b6,null))[_0x5263('0x40')](handleError(_0x3f42b6,null));}; \ No newline at end of file +var _0xe2d3=['fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x10a62d,_0x4d9e7e){var _0x1a3594=function(_0x13ad14){while(--_0x13ad14){_0x10a62d['push'](_0x10a62d['shift']());}};_0x1a3594(++_0x4d9e7e);}(_0xe2d3,0x109));var _0x3e2d=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xe2d3[_0xc67528];return _0x38e26d;};'use strict';var emlformat=require(_0x3e2d('0x0'));var rimraf=require(_0x3e2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3e2d('0x2'));var moment=require(_0x3e2d('0x3'));var BPromise=require(_0x3e2d('0x4'));var Mustache=require(_0x3e2d('0x5'));var util=require(_0x3e2d('0x6'));var path=require(_0x3e2d('0x7'));var sox=require(_0x3e2d('0x8'));var csv=require(_0x3e2d('0x9'));var ejs=require(_0x3e2d('0xa'));var fs=require('fs');var fs_extra=require(_0x3e2d('0xb'));var _=require(_0x3e2d('0xc'));var squel=require(_0x3e2d('0xd'));var crypto=require(_0x3e2d('0xe'));var jsforce=require(_0x3e2d('0xf'));var deskjs=require(_0x3e2d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3e2d('0x11'));var Papa=require(_0x3e2d('0x12'));var Redis=require(_0x3e2d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3e2d('0x14'));var as=require(_0x3e2d('0x15'));var hardwareService=require(_0x3e2d('0x16'));var logger=require(_0x3e2d('0x17'))(_0x3e2d('0x18'));var utils=require(_0x3e2d('0x19'));var config=require(_0x3e2d('0x1a'));var licenseUtil=require(_0x3e2d('0x1b'));var db=require(_0x3e2d('0x1c'))['db'];function respondWithStatusCode(_0x53bc18,_0x51d891){_0x51d891=_0x51d891||0xcc;return function(_0x4e5505){if(_0x4e5505){return _0x53bc18[_0x3e2d('0x1d')](_0x51d891);}return _0x53bc18[_0x3e2d('0x1e')](_0x51d891)[_0x3e2d('0x1f')]();};}function respondWithResult(_0x3157a2,_0x268ba7){_0x268ba7=_0x268ba7||0xc8;return function(_0x3522d2){if(_0x3522d2){return _0x3157a2[_0x3e2d('0x1e')](_0x268ba7)[_0x3e2d('0x20')](_0x3522d2);}};}function respondWithFilteredResult(_0xb6234d,_0x2ec6e1){return function(_0x591953){if(_0x591953){var _0x47c4a2=typeof _0x2ec6e1[_0x3e2d('0x21')]===_0x3e2d('0x22')&&typeof _0x2ec6e1[_0x3e2d('0x23')]===_0x3e2d('0x22');var _0x5cbf0e=_0x591953[_0x3e2d('0x24')];var _0xf4d898=_0x47c4a2?0x0:_0x2ec6e1[_0x3e2d('0x21')];var _0x42ab2=_0x47c4a2?_0x591953['count']:_0x2ec6e1[_0x3e2d('0x21')]+_0x2ec6e1[_0x3e2d('0x23')];var _0x693906;if(_0x42ab2>=_0x5cbf0e){_0x42ab2=_0x5cbf0e;_0x693906=0xc8;}else{_0x693906=0xce;}_0xb6234d[_0x3e2d('0x1e')](_0x693906);return _0xb6234d[_0x3e2d('0x25')](_0x3e2d('0x26'),_0xf4d898+'-'+_0x42ab2+'/'+_0x5cbf0e)['json'](_0x591953);}return null;};}function patchUpdates(_0x3310cf){return function(_0x14472f){try{jsonpatch[_0x3e2d('0x27')](_0x14472f,_0x3310cf,!![]);}catch(_0x21536e){return BPromise[_0x3e2d('0x28')](_0x21536e);}return _0x14472f[_0x3e2d('0x29')]();};}function saveUpdates(_0x6b4206,_0x5d0ed6){return function(_0x44215d){if(_0x44215d){return _0x44215d[_0x3e2d('0x2a')](_0x6b4206)[_0x3e2d('0x2b')](function(_0x182a04){return _0x182a04;});}return null;};}function removeEntity(_0x4144cd,_0x1f5e07){return function(_0x432987){if(_0x432987){return _0x432987[_0x3e2d('0x2c')]()[_0x3e2d('0x2b')](function(){_0x4144cd['status'](0xcc)[_0x3e2d('0x1f')]();});}};}function handleEntityNotFound(_0x2204ce,_0x3117d2){return function(_0x1ef7df){if(!_0x1ef7df){_0x2204ce['sendStatus'](0x194);}return _0x1ef7df;};}function handleError(_0x3d8cee,_0x49ff72){_0x49ff72=_0x49ff72||0x1f4;return function(_0x4ce95b){logger[_0x3e2d('0x2d')](_0x4ce95b['stack']);if(_0x4ce95b[_0x3e2d('0x2e')]){delete _0x4ce95b[_0x3e2d('0x2e')];}_0x3d8cee[_0x3e2d('0x1e')](_0x49ff72)[_0x3e2d('0x2f')](_0x4ce95b);};}exports['index']=function(_0xad414,_0x12a996){var _0xa22263={},_0x4f2f1a={},_0x2b991a={'count':0x0,'rows':[]};var _0x3684f3=_['map'](db[_0x3e2d('0x30')][_0x3e2d('0x31')],function(_0x28ebf8){return{'name':_0x28ebf8[_0x3e2d('0x32')],'type':_0x28ebf8[_0x3e2d('0x33')][_0x3e2d('0x34')]};});_0x4f2f1a[_0x3e2d('0x35')]=_[_0x3e2d('0x36')](_0x3684f3,_0x3e2d('0x2e'));_0x4f2f1a[_0x3e2d('0x37')]=_[_0x3e2d('0x38')](_0xad414[_0x3e2d('0x37')]);_0x4f2f1a[_0x3e2d('0x39')]=_[_0x3e2d('0x3a')](_0x4f2f1a[_0x3e2d('0x35')],_0x4f2f1a[_0x3e2d('0x37')]);_0xa22263['attributes']=_[_0x3e2d('0x3a')](_0x4f2f1a[_0x3e2d('0x35')],qs['fields'](_0xad414[_0x3e2d('0x37')][_0x3e2d('0x3b')]));_0xa22263[_0x3e2d('0x3c')]=_0xa22263[_0x3e2d('0x3c')]['length']?_0xa22263[_0x3e2d('0x3c')]:_0x4f2f1a[_0x3e2d('0x35')];if(!_0xad414[_0x3e2d('0x37')]['hasOwnProperty'](_0x3e2d('0x3d'))){_0xa22263[_0x3e2d('0x23')]=qs['limit'](_0xad414['query'][_0x3e2d('0x23')]);_0xa22263['offset']=qs['offset'](_0xad414[_0x3e2d('0x37')][_0x3e2d('0x21')]);}_0xa22263[_0x3e2d('0x3e')]=qs[_0x3e2d('0x3f')](_0xad414['query'][_0x3e2d('0x3f')]);_0xa22263[_0x3e2d('0x40')]=qs[_0x3e2d('0x39')](_[_0x3e2d('0x41')](_0xad414[_0x3e2d('0x37')],_0x4f2f1a[_0x3e2d('0x39')]),_0x3684f3);if(_0xad414[_0x3e2d('0x37')][_0x3e2d('0x42')]){_0xa22263['where']=_[_0x3e2d('0x43')](_0xa22263[_0x3e2d('0x40')],{'$or':_['map'](_0x3684f3,function(_0x479f67){if(_0x479f67[_0x3e2d('0x33')]!==_0x3e2d('0x44')){var _0x54d308={};_0x54d308[_0x479f67[_0x3e2d('0x2e')]]={'$like':'%'+_0xad414['query']['filter']+'%'};return _0x54d308;}})});}_0xa22263=_[_0x3e2d('0x43')]({},_0xa22263,_0xad414[_0x3e2d('0x45')]);var _0x392554={'where':_0xa22263[_0x3e2d('0x40')]};return db[_0x3e2d('0x30')]['count'](_0x392554)[_0x3e2d('0x2b')](function(_0x114c79){_0x2b991a[_0x3e2d('0x24')]=_0x114c79;if(_0xad414[_0x3e2d('0x37')][_0x3e2d('0x46')]){_0xa22263[_0x3e2d('0x47')]=[{'all':!![]}];}return db[_0x3e2d('0x30')][_0x3e2d('0x48')](_0xa22263);})[_0x3e2d('0x2b')](function(_0x40648a){_0x2b991a[_0x3e2d('0x49')]=_0x40648a;return _0x2b991a;})['then'](respondWithFilteredResult(_0x12a996,_0xa22263))['catch'](handleError(_0x12a996,null));};exports[_0x3e2d('0x4a')]=function(_0x392058,_0x31b7f7){var _0x218df2={'raw':!![],'where':{'id':_0x392058[_0x3e2d('0x4b')]['id']}},_0x4d814d={};_0x4d814d[_0x3e2d('0x35')]=_[_0x3e2d('0x38')](db[_0x3e2d('0x30')][_0x3e2d('0x31')]);_0x4d814d['query']=_[_0x3e2d('0x38')](_0x392058[_0x3e2d('0x37')]);_0x4d814d['filters']=_['intersection'](_0x4d814d[_0x3e2d('0x35')],_0x4d814d[_0x3e2d('0x37')]);_0x218df2['attributes']=_['intersection'](_0x4d814d['model'],qs[_0x3e2d('0x3b')](_0x392058[_0x3e2d('0x37')][_0x3e2d('0x3b')]));_0x218df2['attributes']=_0x218df2['attributes']['length']?_0x218df2['attributes']:_0x4d814d[_0x3e2d('0x35')];if(_0x392058[_0x3e2d('0x37')][_0x3e2d('0x46')]){_0x218df2['include']=[{'all':!![]}];}_0x218df2=_[_0x3e2d('0x43')]({},_0x218df2,_0x392058[_0x3e2d('0x45')]);return db['SmsTransferReport'][_0x3e2d('0x4c')](_0x218df2)[_0x3e2d('0x2b')](handleEntityNotFound(_0x31b7f7,null))[_0x3e2d('0x2b')](respondWithResult(_0x31b7f7,null))[_0x3e2d('0x4d')](handleError(_0x31b7f7,null));};exports[_0x3e2d('0x4e')]=function(_0x3c06a9,_0x9b8e50){return db[_0x3e2d('0x30')]['create'](_0x3c06a9[_0x3e2d('0x4f')],{})[_0x3e2d('0x2b')](respondWithResult(_0x9b8e50,0xc9))[_0x3e2d('0x4d')](handleError(_0x9b8e50,null));};exports[_0x3e2d('0x2a')]=function(_0xdababa,_0x485dec){if(_0xdababa[_0x3e2d('0x4f')]['id']){delete _0xdababa['body']['id'];}return db[_0x3e2d('0x30')][_0x3e2d('0x4c')]({'where':{'id':_0xdababa[_0x3e2d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x485dec,null))[_0x3e2d('0x2b')](saveUpdates(_0xdababa[_0x3e2d('0x4f')],null))[_0x3e2d('0x2b')](respondWithResult(_0x485dec,null))[_0x3e2d('0x4d')](handleError(_0x485dec,null));};exports['destroy']=function(_0x530aca,_0x47e9d8){return db[_0x3e2d('0x30')][_0x3e2d('0x4c')]({'where':{'id':_0x530aca[_0x3e2d('0x4b')]['id']}})[_0x3e2d('0x2b')](handleEntityNotFound(_0x47e9d8,null))[_0x3e2d('0x2b')](removeEntity(_0x47e9d8,null))['catch'](handleError(_0x47e9d8,null));};exports[_0x3e2d('0x50')]=function(_0x32eec9,_0x994964){return db[_0x3e2d('0x30')][_0x3e2d('0x50')]()[_0x3e2d('0x2b')](respondWithResult(_0x994964,null))['catch'](handleError(_0x994964,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 90d1270..e03ab74 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 _0x6dd6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x49e533,_0x5daa8a){var _0x17769d=function(_0x22c440){while(--_0x22c440){_0x49e533['push'](_0x49e533['shift']());}};_0x17769d(++_0x5daa8a);}(_0x6dd6,0xcc));var _0x66dd=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x6dd6[_0xea343d];return _0x2c6e9c;};'use strict';var _=require('lodash');var util=require(_0x66dd('0x0'));var logger=require(_0x66dd('0x1'))(_0x66dd('0x2'));var moment=require(_0x66dd('0x3'));var BPromise=require(_0x66dd('0x4'));var rp=require(_0x66dd('0x5'));var fs=require('fs');var path=require(_0x66dd('0x6'));var rimraf=require(_0x66dd('0x7'));var config=require(_0x66dd('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x66dd('0x9')]=function(_0x52de86,_0x2c45c7){return _0x52de86['define'](_0x66dd('0xa'),attributes,{'tableName':_0x66dd('0xb'),'paranoid':![],'indexes':[{'name':_0x66dd('0xc'),'fields':[_0x66dd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x345e=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0x830dae,_0x121277){var _0x54bd2b=function(_0x44dea6){while(--_0x44dea6){_0x830dae['push'](_0x830dae['shift']());}};_0x54bd2b(++_0x121277);}(_0x345e,0x1b6));var _0xe345=function(_0xb4bdb3,_0x48dca0){_0xb4bdb3=_0xb4bdb3-0x0;var _0x4c8c02=_0x345e[_0xb4bdb3];return _0x4c8c02;};'use strict';var _=require('lodash');var util=require(_0xe345('0x0'));var logger=require(_0xe345('0x1'))(_0xe345('0x2'));var moment=require('moment');var BPromise=require(_0xe345('0x3'));var rp=require(_0xe345('0x4'));var fs=require('fs');var path=require(_0xe345('0x5'));var rimraf=require(_0xe345('0x6'));var config=require(_0xe345('0x7'));var attributes=require(_0xe345('0x8'));module[_0xe345('0x9')]=function(_0x4bc854,_0x1f5647){return _0x4bc854['define'](_0xe345('0xa'),attributes,{'tableName':_0xe345('0xb'),'paranoid':![],'indexes':[{'name':_0xe345('0xc'),'fields':[_0xe345('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0744e25..94b480d 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 _0x0cd6=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x4252fb,_0x2875b6){var _0x40b2ae=function(_0xf9ca79){while(--_0xf9ca79){_0x4252fb['push'](_0x4252fb['shift']());}};_0x40b2ae(++_0x2875b6);}(_0x0cd6,0x113));var _0x60cd=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x0cd6[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var moment=require('moment');var BPromise=require(_0x60cd('0x2'));var rs=require(_0x60cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60cd('0x4'))['db'];var utils=require(_0x60cd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x60cd('0x6'));var jayson=require(_0x60cd('0x7'));var client=jayson[_0x60cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x381044,_0x4b66cd,_0x1249cb){return new BPromise(function(_0x2c973,_0x160a7f){return client[_0x60cd('0x9')](_0x381044,_0x1249cb)[_0x60cd('0xa')](function(_0x3f2991){logger[_0x60cd('0xb')](_0x60cd('0xc'),_0x4b66cd,_0x60cd('0xd'));logger['debug'](_0x60cd('0xe'),_0x4b66cd,_0x60cd('0xd'),JSON['stringify'](_0x3f2991));if(_0x3f2991[_0x60cd('0xf')]){if(_0x3f2991['error'][_0x60cd('0x10')]===0x1f4){logger[_0x60cd('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x4b66cd,_0x3f2991[_0x60cd('0xf')][_0x60cd('0x11')]);return _0x160a7f(_0x3f2991[_0x60cd('0xf')]['message']);}logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x3f2991['error'][_0x60cd('0x11')]);return _0x2c973(_0x3f2991['error'][_0x60cd('0x11')]);}else{logger[_0x60cd('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x4b66cd,'request\x20sent');_0x2c973(_0x3f2991[_0x60cd('0x12')][_0x60cd('0x11')]);}})[_0x60cd('0x13')](function(_0x5d0125){logger[_0x60cd('0xf')](_0x60cd('0xc'),_0x4b66cd,_0x5d0125);_0x160a7f(_0x5d0125);});});} \ No newline at end of file +var _0xe4b8=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0x12abe5,_0x282181){var _0x13fd5a=function(_0x18d807){while(--_0x18d807){_0x12abe5['push'](_0x12abe5['shift']());}};_0x13fd5a(++_0x282181);}(_0xe4b8,0x179));var _0x8e4b=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xe4b8[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var moment=require(_0x8e4b('0x2'));var BPromise=require(_0x8e4b('0x3'));var rs=require(_0x8e4b('0x4'));var fs=require('fs');var Redis=require(_0x8e4b('0x5'));var db=require(_0x8e4b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e4b('0x7'));var config=require(_0x8e4b('0x8'));var jayson=require(_0x8e4b('0x9'));var client=jayson['client'][_0x8e4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d0472,_0x2be426,_0x5642a3){return new BPromise(function(_0x4e0535,_0x5801c3){return client['request'](_0x4d0472,_0x5642a3)['then'](function(_0x2e048b){logger['info'](_0x8e4b('0xb'),_0x2be426,_0x8e4b('0xc'));logger['debug'](_0x8e4b('0xd'),_0x2be426,_0x8e4b('0xc'),JSON[_0x8e4b('0xe')](_0x2e048b));if(_0x2e048b['error']){if(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x10')]===0x1f4){logger[_0x8e4b('0xf')](_0x8e4b('0xb'),_0x2be426,_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);return _0x5801c3(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2be426,_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);return _0x4e0535(_0x2e048b[_0x8e4b('0xf')][_0x8e4b('0x11')]);}else{logger[_0x8e4b('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x2be426,'request\x20sent');_0x4e0535(_0x2e048b[_0x8e4b('0x13')]['message']);}})['catch'](function(_0x417e71){logger['error'](_0x8e4b('0xb'),_0x2be426,_0x417e71);_0x5801c3(_0x417e71);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 2665573..b7f8d9b 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 _0xe1d3=['index','get','/:id','isAuthenticated','show','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./sound.controller'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xe1d3,0x160));var _0x3e1d=function(_0x534ce8,_0x17b58){_0x534ce8=_0x534ce8-0x0;var _0x3d9422=_0xe1d3[_0x534ce8];return _0x3d9422;};'use strict';var multer=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var path=require(_0x3e1d('0x2'));var timeout=require(_0x3e1d('0x3'));var express=require(_0x3e1d('0x4'));var router=express['Router']();var fs_extra=require(_0x3e1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1d('0x6'));var config=require('../../config/environment');var controller=require(_0x3e1d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e1d('0x8')]);router[_0x3e1d('0x9')](_0x3e1d('0xa'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xc')]);router[_0x3e1d('0x9')]('/:id/download',auth[_0x3e1d('0xb')](),controller[_0x3e1d('0xd')]);var upload=multer({'storage':multer[_0x3e1d('0xe')]({'destination':function(_0x10e12f,_0x51d248,_0x5ad79c){_0x5ad79c(null,path['join'](config[_0x3e1d('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2778b6,_0x3fcde3,_0x599117){_0x3fcde3[_0x3e1d('0x10')]=_0x3fcde3[_0x3e1d('0x10')][_0x3e1d('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x599117(null,util[_0x3e1d('0x12')](_0x3e1d('0x13'),path[_0x3e1d('0x14')](_0x3fcde3['originalname'],path[_0x3e1d('0x15')](_0x3fcde3[_0x3e1d('0x10')])),Date[_0x3e1d('0x16')](),path[_0x3e1d('0x15')](_0x3fcde3[_0x3e1d('0x10')])));}})});router[_0x3e1d('0x17')]('/',upload[_0x3e1d('0x18')](_0x3e1d('0x19')),controller['create']);router[_0x3e1d('0x1a')](_0x3e1d('0xa'),auth['isAuthenticated'](),controller[_0x3e1d('0x1b')]);router[_0x3e1d('0x1c')](_0x3e1d('0xa'),auth[_0x3e1d('0xb')](),controller[_0x3e1d('0x1c')]);module[_0x3e1d('0x1d')]=router; \ No newline at end of file +var _0xe17a=['download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download'];(function(_0x162c4c,_0x5d5346){var _0x4036e1=function(_0x4d5091){while(--_0x4d5091){_0x162c4c['push'](_0x162c4c['shift']());}};_0x4036e1(++_0x5d5346);}(_0xe17a,0x128));var _0xae17=function(_0x3da8a1,_0x11cc54){_0x3da8a1=_0x3da8a1-0x0;var _0xe0be1f=_0xe17a[_0x3da8a1];return _0xe0be1f;};'use strict';var multer=require(_0xae17('0x0'));var util=require(_0xae17('0x1'));var path=require(_0xae17('0x2'));var timeout=require(_0xae17('0x3'));var express=require(_0xae17('0x4'));var router=express[_0xae17('0x5')]();var fs_extra=require(_0xae17('0x6'));var auth=require(_0xae17('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xae17('0x8'));var controller=require(_0xae17('0x9'));router[_0xae17('0xa')]('/',auth[_0xae17('0xb')](),controller['index']);router[_0xae17('0xa')]('/:id',auth[_0xae17('0xb')](),controller[_0xae17('0xc')]);router[_0xae17('0xa')](_0xae17('0xd'),auth[_0xae17('0xb')](),controller[_0xae17('0xe')]);var upload=multer({'storage':multer[_0xae17('0xf')]({'destination':function(_0x27f9a0,_0x2ef3c0,_0x2ad523){_0x2ad523(null,path[_0xae17('0x10')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x6ce7f2,_0x804bde,_0x2588b2){_0x804bde[_0xae17('0x11')]=_0x804bde['originalname'][_0xae17('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2588b2(null,util[_0xae17('0x13')](_0xae17('0x14'),path[_0xae17('0x15')](_0x804bde[_0xae17('0x11')],path[_0xae17('0x16')](_0x804bde[_0xae17('0x11')])),Date['now'](),path[_0xae17('0x16')](_0x804bde[_0xae17('0x11')])));}})});router[_0xae17('0x17')]('/',upload[_0xae17('0x18')](_0xae17('0x19')),controller[_0xae17('0x1a')]);router[_0xae17('0x1b')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xae17('0x1c')](_0xae17('0x1d'),auth[_0xae17('0xb')](),controller[_0xae17('0x1c')]);module[_0xae17('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 86870a9..6eba066 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 _0xec2f=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x6c9b2c,_0x2e1e98){var _0x2dbb9c=function(_0x421b99){while(--_0x421b99){_0x6c9b2c['push'](_0x6c9b2c['shift']());}};_0x2dbb9c(++_0x2e1e98);}(_0xec2f,0xa8));var _0xfec2=function(_0x4f8e84,_0x36adc9){_0x4f8e84=_0x4f8e84-0x0;var _0x2ab68f=_0xec2f[_0x4f8e84];return _0x2ab68f;};'use strict';var Sequelize=require(_0xfec2('0x0'));module[_0xfec2('0x1')]={'name':{'type':Sequelize[_0xfec2('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xfec2('0x2')]},'display_name':{'type':Sequelize[_0xfec2('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xfec2('0x3')]},'original_sampleCount':{'type':Sequelize[_0xfec2('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xfec2('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xfec2('0x2')]},'converted_duration':{'type':Sequelize[_0xfec2('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xfec2('0x5')]},'converted_bitRate':{'type':Sequelize[_0xfec2('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xfec2('0x5')]}}; \ No newline at end of file +var _0x2dbd=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x1602be,_0x2451d9){var _0x3d0afd=function(_0x1607f7){while(--_0x1607f7){_0x1602be['push'](_0x1602be['shift']());}};_0x3d0afd(++_0x2451d9);}(_0x2dbd,0x67));var _0xd2db=function(_0x1823bf,_0x15815c){_0x1823bf=_0x1823bf-0x0;var _0x52f2e4=_0x2dbd[_0x1823bf];return _0x52f2e4;};'use strict';var Sequelize=require(_0xd2db('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2db('0x1')],'unique':_0xd2db('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd2db('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xd2db('0x1')]},'original_format':{'type':Sequelize[_0xd2db('0x1')]},'original_duration':{'type':Sequelize[_0xd2db('0x3')]},'original_sampleCount':{'type':Sequelize[_0xd2db('0x4')]},'original_channelCount':{'type':Sequelize[_0xd2db('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xd2db('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xd2db('0x4')]},'converted_channelCount':{'type':Sequelize[_0xd2db('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd2db('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xd2db('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index f7c38b2..d91c044 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 _0x6770=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','catch','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','eml-format','rimraf','zip-dir','request-promise'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0x6770,0x7d));var _0x0677=function(_0x12f91c,_0xda1390){_0x12f91c=_0x12f91c-0x0;var _0x4daf5e=_0x6770[_0x12f91c];return _0x4daf5e;};'use strict';var emlformat=require(_0x0677('0x0'));var rimraf=require(_0x0677('0x1'));var zipdir=require(_0x0677('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0677('0x3'));var moment=require(_0x0677('0x4'));var BPromise=require(_0x0677('0x5'));var Mustache=require(_0x0677('0x6'));var util=require(_0x0677('0x7'));var path=require(_0x0677('0x8'));var sox=require(_0x0677('0x9'));var csv=require(_0x0677('0xa'));var ejs=require(_0x0677('0xb'));var fs=require('fs');var fs_extra=require(_0x0677('0xc'));var _=require(_0x0677('0xd'));var squel=require(_0x0677('0xe'));var crypto=require(_0x0677('0xf'));var jsforce=require(_0x0677('0x10'));var deskjs=require(_0x0677('0x11'));var toCsv=require(_0x0677('0xa'));var querystring=require(_0x0677('0x12'));var Papa=require('papaparse');var Redis=require(_0x0677('0x13'));var authService=require(_0x0677('0x14'));var qs=require(_0x0677('0x15'));var as=require(_0x0677('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0677('0x17'))(_0x0677('0x18'));var utils=require(_0x0677('0x19'));var config=require(_0x0677('0x1a'));var licenseUtil=require(_0x0677('0x1b'));var db=require(_0x0677('0x1c'))['db'];function respondWithStatusCode(_0x557dc7,_0x5a21c9){_0x5a21c9=_0x5a21c9||0xcc;return function(_0x525a85){if(_0x525a85){return _0x557dc7[_0x0677('0x1d')](_0x5a21c9);}return _0x557dc7['status'](_0x5a21c9)[_0x0677('0x1e')]();};}function respondWithResult(_0x37cd5b,_0x364191){_0x364191=_0x364191||0xc8;return function(_0x101204){if(_0x101204){return _0x37cd5b[_0x0677('0x1f')](_0x364191)[_0x0677('0x20')](_0x101204);}};}function respondWithFilteredResult(_0x1d6cda,_0x2d4135){return function(_0x468591){if(_0x468591){var _0x152d78=typeof _0x2d4135[_0x0677('0x21')]===_0x0677('0x22')&&typeof _0x2d4135[_0x0677('0x23')]===_0x0677('0x22');var _0x516197=_0x468591[_0x0677('0x24')];var _0x488654=_0x152d78?0x0:_0x2d4135[_0x0677('0x21')];var _0x1a26f1=_0x152d78?_0x468591[_0x0677('0x24')]:_0x2d4135[_0x0677('0x21')]+_0x2d4135[_0x0677('0x23')];var _0x4d97b1;if(_0x1a26f1>=_0x516197){_0x1a26f1=_0x516197;_0x4d97b1=0xc8;}else{_0x4d97b1=0xce;}_0x1d6cda[_0x0677('0x1f')](_0x4d97b1);return _0x1d6cda['set'](_0x0677('0x25'),_0x488654+'-'+_0x1a26f1+'/'+_0x516197)[_0x0677('0x20')](_0x468591);}return null;};}function patchUpdates(_0x2e926e){return function(_0x15fea5){try{jsonpatch[_0x0677('0x26')](_0x15fea5,_0x2e926e,!![]);}catch(_0x58c961){return BPromise[_0x0677('0x27')](_0x58c961);}return _0x15fea5[_0x0677('0x28')]();};}function saveUpdates(_0x3d69be,_0x4a41d0){return function(_0x21c61e){if(_0x21c61e){return _0x21c61e['update'](_0x3d69be)['then'](function(_0x2daa63){return _0x2daa63;});}return null;};}function removeEntity(_0x1cf56d,_0x532f2e){return function(_0x342f24){if(_0x342f24){return _0x342f24[_0x0677('0x29')]()[_0x0677('0x2a')](function(){var _0xb1f39e=_0x342f24[_0x0677('0x2b')]({'plain':!![]});var _0x14518b='Sounds';return db['UserProfileResource'][_0x0677('0x29')]({'where':{'type':_0x14518b,'resourceId':_0xb1f39e['id']}})[_0x0677('0x2a')](function(){return _0x342f24;});})[_0x0677('0x2a')](function(){_0x1cf56d[_0x0677('0x1f')](0xcc)[_0x0677('0x1e')]();});}};}function handleEntityNotFound(_0xbb0eb0,_0x2fffab){return function(_0x1faeea){if(!_0x1faeea){_0xbb0eb0[_0x0677('0x1d')](0x194);}return _0x1faeea;};}function handleError(_0x193ee4,_0x263ebe){_0x263ebe=_0x263ebe||0x1f4;return function(_0x363f0d){logger[_0x0677('0x2c')](_0x363f0d[_0x0677('0x2d')]);if(_0x363f0d[_0x0677('0x2e')]){delete _0x363f0d[_0x0677('0x2e')];}_0x193ee4[_0x0677('0x1f')](_0x263ebe)[_0x0677('0x2f')](_0x363f0d);};}exports[_0x0677('0x30')]=function(_0xa7178f,_0x58edee){var _0x5aaa4c={},_0x45118a={},_0x537fc8={'count':0x0,'rows':[]};var _0x2e9631=_[_0x0677('0x31')](db[_0x0677('0x32')]['rawAttributes'],function(_0x205ef7){return{'name':_0x205ef7[_0x0677('0x33')],'type':_0x205ef7[_0x0677('0x34')][_0x0677('0x35')]};});_0x45118a[_0x0677('0x36')]=_['map'](_0x2e9631,_0x0677('0x2e'));_0x45118a[_0x0677('0x37')]=_[_0x0677('0x38')](_0xa7178f[_0x0677('0x37')]);_0x45118a[_0x0677('0x39')]=_['intersection'](_0x45118a[_0x0677('0x36')],_0x45118a['query']);_0x5aaa4c[_0x0677('0x3a')]=_[_0x0677('0x3b')](_0x45118a[_0x0677('0x36')],qs[_0x0677('0x3c')](_0xa7178f[_0x0677('0x37')][_0x0677('0x3c')]));_0x5aaa4c[_0x0677('0x3a')]=_0x5aaa4c[_0x0677('0x3a')][_0x0677('0x3d')]?_0x5aaa4c[_0x0677('0x3a')]:_0x45118a[_0x0677('0x36')];if(!_0xa7178f['query'][_0x0677('0x3e')]('nolimit')){_0x5aaa4c[_0x0677('0x23')]=qs[_0x0677('0x23')](_0xa7178f['query'][_0x0677('0x23')]);_0x5aaa4c[_0x0677('0x21')]=qs[_0x0677('0x21')](_0xa7178f[_0x0677('0x37')]['offset']);}_0x5aaa4c['order']=qs[_0x0677('0x3f')](_0xa7178f['query']['sort']);_0x5aaa4c[_0x0677('0x40')]=qs['filters'](_[_0x0677('0x41')](_0xa7178f[_0x0677('0x37')],_0x45118a['filters']),_0x2e9631);if(_0xa7178f[_0x0677('0x37')][_0x0677('0x42')]){_0x5aaa4c[_0x0677('0x40')]=_[_0x0677('0x43')](_0x5aaa4c['where'],{'$or':_[_0x0677('0x31')](_0x2e9631,function(_0x1764f7){if(_0x1764f7[_0x0677('0x34')]!==_0x0677('0x44')){var _0x4071be={};_0x4071be[_0x1764f7[_0x0677('0x2e')]]={'$like':'%'+_0xa7178f['query']['filter']+'%'};return _0x4071be;}})});}_0x5aaa4c=_['merge']({},_0x5aaa4c,_0xa7178f[_0x0677('0x45')]);var _0x15322d={'where':_0x5aaa4c['where']};return db[_0x0677('0x32')][_0x0677('0x24')](_0x15322d)[_0x0677('0x2a')](function(_0x492f8a){_0x537fc8[_0x0677('0x24')]=_0x492f8a;if(_0xa7178f[_0x0677('0x37')]['includeAll']){_0x5aaa4c[_0x0677('0x46')]=[{'all':!![]}];}return db['Sound'][_0x0677('0x47')](_0x5aaa4c);})['then'](function(_0x442311){_0x537fc8[_0x0677('0x48')]=_0x442311;return _0x537fc8;})[_0x0677('0x2a')](respondWithFilteredResult(_0x58edee,_0x5aaa4c))['catch'](handleError(_0x58edee,null));};exports[_0x0677('0x49')]=function(_0x36feaf,_0x2a0c37){var _0x16381b={'raw':!![],'where':{'id':_0x36feaf[_0x0677('0x4a')]['id']}},_0x529bbf={};_0x529bbf[_0x0677('0x36')]=_['keys'](db[_0x0677('0x32')]['rawAttributes']);_0x529bbf[_0x0677('0x37')]=_['keys'](_0x36feaf['query']);_0x529bbf['filters']=_['intersection'](_0x529bbf[_0x0677('0x36')],_0x529bbf[_0x0677('0x37')]);_0x16381b[_0x0677('0x3a')]=_[_0x0677('0x3b')](_0x529bbf['model'],qs[_0x0677('0x3c')](_0x36feaf[_0x0677('0x37')][_0x0677('0x3c')]));_0x16381b[_0x0677('0x3a')]=_0x16381b[_0x0677('0x3a')][_0x0677('0x3d')]?_0x16381b[_0x0677('0x3a')]:_0x529bbf[_0x0677('0x36')];if(_0x36feaf[_0x0677('0x37')][_0x0677('0x4b')]){_0x16381b[_0x0677('0x46')]=[{'all':!![]}];}_0x16381b=_['merge']({},_0x16381b,_0x36feaf[_0x0677('0x45')]);return db[_0x0677('0x32')][_0x0677('0x4c')](_0x16381b)[_0x0677('0x2a')](handleEntityNotFound(_0x2a0c37,null))[_0x0677('0x2a')](respondWithResult(_0x2a0c37,null))['catch'](handleError(_0x2a0c37,null));};exports[_0x0677('0x4d')]=function(_0x139fe7,_0x3552e8,_0x13d875){return db[_0x0677('0x32')]['find']({'where':{'id':_0x139fe7[_0x0677('0x4a')]['id']},'attributes':[_0x0677('0x2e'),_0x0677('0x4e'),_0x0677('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x3552e8,null))[_0x0677('0x2a')](function(_0x493d41){if(_0x493d41){if(!fs[_0x0677('0x50')](path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),_0x493d41[_0x0677('0x4e')]+'.'+_0x493d41['converted_format']))){throw new db[(_0x0677('0x54'))][(_0x0677('0x55'))](_0x0677('0x56'));}return _0x3552e8[_0x0677('0x4d')](path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util['format'](_0x0677('0x57'),_0x493d41[_0x0677('0x4e')],_0x493d41[_0x0677('0x4f')])),util[_0x0677('0x58')]('%s.%s',_0x493d41[_0x0677('0x2e')],_0x493d41[_0x0677('0x4f')]));}return null;})[_0x0677('0x59')](handleError(_0x3552e8,null));};exports[_0x0677('0x5a')]=function(_0x59f07c,_0x13680d,_0x4d598b){var _0x3f56f4={'name':path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5d')],path['extname'](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5d')])),'save_name':path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')]['filename'],path[_0x0677('0x5e')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')])),'original_format':path[_0x0677('0x5e')](_0x59f07c['file'][_0x0677('0x5d')])[_0x0677('0x60')](0x1),'converted_format':_0x0677('0x61')};var _0x20ce09=path['join'](config[_0x0677('0x52')],_0x0677('0x62'),_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')]);var _0x4c1350=path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util[_0x0677('0x58')](_0x0677('0x57'),path[_0x0677('0x5b')](_0x59f07c[_0x0677('0x5c')]['filename'],path[_0x0677('0x5e')](_0x59f07c[_0x0677('0x5c')][_0x0677('0x5f')])),_0x3f56f4[_0x0677('0x4f')]));logger[_0x0677('0x63')](_0x0677('0x64'),_0x20ce09);logger[_0x0677('0x63')]('Sound\x20upload\x20destination:\x20%s',_0x4c1350);try{fs[_0x0677('0x65')](_0x20ce09,parseInt('0777',0x8));var _0x24fb2c=sox['transcode'](_0x20ce09,_0x4c1350,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x24fb2c['on'](_0x0677('0x2c'),function(_0x2bc73d){fs[_0x0677('0x66')](_0x20ce09);_0x13680d[_0x0677('0x1f')](0x1f4)[_0x0677('0x2f')](_0x2bc73d);});_0x24fb2c['on']('src',function(_0x2a658b){_0x3f56f4[_0x0677('0x67')]=isNaN(_0x2a658b[_0x0677('0x68')])?null:_0x2a658b[_0x0677('0x68')]*0x3e8;_0x3f56f4[_0x0677('0x69')]=isNaN(_0x2a658b[_0x0677('0x6a')])?null:_0x2a658b[_0x0677('0x6a')];_0x3f56f4['original_channelCount']=isNaN(_0x2a658b['channelCount'])?null:_0x2a658b[_0x0677('0x6b')];_0x3f56f4[_0x0677('0x6c')]=isNaN(_0x2a658b[_0x0677('0x6d')])?null:_0x2a658b[_0x0677('0x6d')];_0x3f56f4[_0x0677('0x6e')]=isNaN(_0x2a658b[_0x0677('0x6f')])?null:_0x2a658b[_0x0677('0x6f')];});_0x24fb2c['on'](_0x0677('0x70'),function(_0x29ae02){_0x3f56f4[_0x0677('0x71')]=isNaN(_0x29ae02[_0x0677('0x68')])?null:_0x29ae02[_0x0677('0x68')]*0x3e8;_0x3f56f4[_0x0677('0x72')]=isNaN(_0x29ae02[_0x0677('0x6a')])?null:_0x29ae02[_0x0677('0x6a')];_0x3f56f4[_0x0677('0x73')]=isNaN(_0x29ae02['channelCount'])?null:_0x29ae02[_0x0677('0x6b')];_0x3f56f4['converted_bitRate']=isNaN(_0x29ae02[_0x0677('0x6d')])?null:_0x29ae02['bitRate'];_0x3f56f4[_0x0677('0x74')]=isNaN(_0x29ae02[_0x0677('0x6f')])?null:_0x29ae02['sampleRate'];});_0x24fb2c['on'](_0x0677('0x1e'),function(){fs['chmodSync'](_0x4c1350,parseInt('0777',0x8));return db[_0x0677('0x32')]['create'](_0x3f56f4)['then'](function(_0x3c549c){var _0x5915e4={'role':_0x59f07c[_0x0677('0x75')]['role'],'userProfileId':_0x59f07c[_0x0677('0x75')]['userProfileId']};if(!_0x5915e4)throw new Error(_0x0677('0x76'));if(_0x5915e4['role']===_0x0677('0x77')){var _0x34ca9a=_0x3c549c[_0x0677('0x2b')]({'plain':!![]});return db[_0x0677('0x78')][_0x0677('0x4c')]({'where':{'name':_0x0677('0x79'),'userProfileId':_0x5915e4[_0x0677('0x7a')]},'raw':!![]})[_0x0677('0x2a')](function(_0x1be23c){if(_0x1be23c&&_0x1be23c[_0x0677('0x7b')]===0x0){return db['UserProfileResource']['create']({'name':_0x34ca9a[_0x0677('0x2e')],'resourceId':_0x34ca9a['id'],'type':_0x1be23c['name'],'sectionId':_0x1be23c['id']},{})[_0x0677('0x2a')](function(){return _0x3c549c;});}else{return _0x3c549c;}})[_0x0677('0x59')](function(_0x587ec2){logger[_0x0677('0x2c')](_0x0677('0x7c'),_0x587ec2);throw _0x587ec2;});}return _0x3c549c;})[_0x0677('0x2a')](respondWithResult(_0x13680d,null))[_0x0677('0x59')](handleError(_0x13680d,null));});_0x24fb2c[_0x0677('0x7d')]();}catch(_0x4c5fe8){_0x13680d['status'](0x1f4)['send'](_0x4c5fe8);}};exports[_0x0677('0x7e')]=function(_0x2e2525,_0x4cdc9a,_0x7b0c8d){return db['Sound'][_0x0677('0x4c')]({'where':{'id':_0x2e2525[_0x0677('0x4a')]['id']}})[_0x0677('0x2a')](handleEntityNotFound(_0x4cdc9a,null))[_0x0677('0x2a')](saveUpdates(_[_0x0677('0x41')](_0x2e2525['body'],[_0x0677('0x2e'),_0x0677('0x7f')]),null))['then'](respondWithResult(_0x4cdc9a,null))[_0x0677('0x59')](handleError(_0x4cdc9a,null));};exports[_0x0677('0x80')]=function(_0x15e931,_0x3d8b00,_0x1262c4){return db[_0x0677('0x32')]['find']({'where':{'id':_0x15e931[_0x0677('0x4a')]['id']}})[_0x0677('0x2a')](function(_0x382da1){if(_0x382da1){return _0x382da1[_0x0677('0x29')]();}})[_0x0677('0x2a')](function(_0xee8243){var _0x208f1c=path['join'](config[_0x0677('0x52')],_0x0677('0x62'),util['format'](_0x0677('0x57'),_0xee8243[_0x0677('0x4e')],_0xee8243['original_format']));var _0xd8510d=path[_0x0677('0x51')](config[_0x0677('0x52')],_0x0677('0x53'),util[_0x0677('0x58')](_0x0677('0x57'),_0xee8243[_0x0677('0x4e')],_0xee8243[_0x0677('0x4f')]));fs['unlinkSync'](_0x208f1c);fs[_0x0677('0x66')](_0xd8510d);return _0xee8243;})[_0x0677('0x2a')](function(_0x3408d4){if(_0x3408d4){return _0x3d8b00[_0x0677('0x1f')](0xcc)[_0x0677('0x1e')]();}})[_0x0677('0x2a')](handleEntityNotFound(_0x3d8b00,null))[_0x0677('0x59')](handleError(_0x3d8b00,null));}; \ No newline at end of file +var _0x81d3=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','basename','file','extname','filename','originalname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_bitRate','converted_sampleRate','0777','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','start','description','delete','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5074e6,_0x7771dc){var _0x2b6623=function(_0x95d734){while(--_0x95d734){_0x5074e6['push'](_0x5074e6['shift']());}};_0x2b6623(++_0x7771dc);}(_0x81d3,0xe8));var _0x381d=function(_0x2f5734,_0x5f4d0a){_0x2f5734=_0x2f5734-0x0;var _0x44f694=_0x81d3[_0x2f5734];return _0x44f694;};'use strict';var emlformat=require(_0x381d('0x0'));var rimraf=require(_0x381d('0x1'));var zipdir=require(_0x381d('0x2'));var jsonpatch=require(_0x381d('0x3'));var rp=require(_0x381d('0x4'));var moment=require(_0x381d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x381d('0x6'));var util=require(_0x381d('0x7'));var path=require('path');var sox=require(_0x381d('0x8'));var csv=require(_0x381d('0x9'));var ejs=require(_0x381d('0xa'));var fs=require('fs');var fs_extra=require(_0x381d('0xb'));var _=require(_0x381d('0xc'));var squel=require(_0x381d('0xd'));var crypto=require(_0x381d('0xe'));var jsforce=require(_0x381d('0xf'));var deskjs=require(_0x381d('0x10'));var toCsv=require(_0x381d('0x9'));var querystring=require(_0x381d('0x11'));var Papa=require(_0x381d('0x12'));var Redis=require(_0x381d('0x13'));var authService=require(_0x381d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x381d('0x15'));var hardwareService=require(_0x381d('0x16'));var logger=require(_0x381d('0x17'))(_0x381d('0x18'));var utils=require(_0x381d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x381d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a73a,_0x558809){_0x558809=_0x558809||0xcc;return function(_0x27e4c2){if(_0x27e4c2){return _0x32a73a[_0x381d('0x1b')](_0x558809);}return _0x32a73a[_0x381d('0x1c')](_0x558809)[_0x381d('0x1d')]();};}function respondWithResult(_0x3f9306,_0x58f928){_0x58f928=_0x58f928||0xc8;return function(_0x49578d){if(_0x49578d){return _0x3f9306[_0x381d('0x1c')](_0x58f928)['json'](_0x49578d);}};}function respondWithFilteredResult(_0x1211d6,_0x207db2){return function(_0x26715a){if(_0x26715a){var _0x556f18=typeof _0x207db2[_0x381d('0x1e')]===_0x381d('0x1f')&&typeof _0x207db2[_0x381d('0x20')]==='undefined';var _0x1a5990=_0x26715a['count'];var _0x5e7d23=_0x556f18?0x0:_0x207db2[_0x381d('0x1e')];var _0x5cb973=_0x556f18?_0x26715a[_0x381d('0x21')]:_0x207db2[_0x381d('0x1e')]+_0x207db2['limit'];var _0x579de3;if(_0x5cb973>=_0x1a5990){_0x5cb973=_0x1a5990;_0x579de3=0xc8;}else{_0x579de3=0xce;}_0x1211d6['status'](_0x579de3);return _0x1211d6[_0x381d('0x22')]('Content-Range',_0x5e7d23+'-'+_0x5cb973+'/'+_0x1a5990)['json'](_0x26715a);}return null;};}function patchUpdates(_0x51c431){return function(_0x5c1915){try{jsonpatch[_0x381d('0x23')](_0x5c1915,_0x51c431,!![]);}catch(_0x5d9f34){return BPromise[_0x381d('0x24')](_0x5d9f34);}return _0x5c1915[_0x381d('0x25')]();};}function saveUpdates(_0x17a4e3,_0x5c79b7){return function(_0x2eefaa){if(_0x2eefaa){return _0x2eefaa[_0x381d('0x26')](_0x17a4e3)[_0x381d('0x27')](function(_0x41b778){return _0x41b778;});}return null;};}function removeEntity(_0x6165b5,_0x32e304){return function(_0x54eb2a){if(_0x54eb2a){return _0x54eb2a[_0x381d('0x28')]()['then'](function(){var _0xb2f854=_0x54eb2a['get']({'plain':!![]});var _0x64f414=_0x381d('0x29');return db[_0x381d('0x2a')]['destroy']({'where':{'type':_0x64f414,'resourceId':_0xb2f854['id']}})[_0x381d('0x27')](function(){return _0x54eb2a;});})[_0x381d('0x27')](function(){_0x6165b5['status'](0xcc)[_0x381d('0x1d')]();});}};}function handleEntityNotFound(_0x1d2bb0,_0x162c5c){return function(_0xa9cf5e){if(!_0xa9cf5e){_0x1d2bb0['sendStatus'](0x194);}return _0xa9cf5e;};}function handleError(_0x450a3d,_0x2f6698){_0x2f6698=_0x2f6698||0x1f4;return function(_0x3e71ee){logger[_0x381d('0x2b')](_0x3e71ee[_0x381d('0x2c')]);if(_0x3e71ee[_0x381d('0x2d')]){delete _0x3e71ee[_0x381d('0x2d')];}_0x450a3d['status'](_0x2f6698)[_0x381d('0x2e')](_0x3e71ee);};}exports[_0x381d('0x2f')]=function(_0xb5dd1d,_0x1d4e14){var _0x4b1a33={},_0x4c4e33={},_0x4007d9={'count':0x0,'rows':[]};var _0x3bd868=_[_0x381d('0x30')](db[_0x381d('0x31')][_0x381d('0x32')],function(_0x1cdf49){return{'name':_0x1cdf49[_0x381d('0x33')],'type':_0x1cdf49[_0x381d('0x34')]['key']};});_0x4c4e33[_0x381d('0x35')]=_['map'](_0x3bd868,_0x381d('0x2d'));_0x4c4e33[_0x381d('0x36')]=_[_0x381d('0x37')](_0xb5dd1d[_0x381d('0x36')]);_0x4c4e33[_0x381d('0x38')]=_[_0x381d('0x39')](_0x4c4e33[_0x381d('0x35')],_0x4c4e33[_0x381d('0x36')]);_0x4b1a33['attributes']=_[_0x381d('0x39')](_0x4c4e33[_0x381d('0x35')],qs[_0x381d('0x3a')](_0xb5dd1d[_0x381d('0x36')][_0x381d('0x3a')]));_0x4b1a33[_0x381d('0x3b')]=_0x4b1a33[_0x381d('0x3b')][_0x381d('0x3c')]?_0x4b1a33[_0x381d('0x3b')]:_0x4c4e33['model'];if(!_0xb5dd1d[_0x381d('0x36')]['hasOwnProperty'](_0x381d('0x3d'))){_0x4b1a33[_0x381d('0x20')]=qs[_0x381d('0x20')](_0xb5dd1d['query'][_0x381d('0x20')]);_0x4b1a33[_0x381d('0x1e')]=qs[_0x381d('0x1e')](_0xb5dd1d[_0x381d('0x36')][_0x381d('0x1e')]);}_0x4b1a33[_0x381d('0x3e')]=qs[_0x381d('0x3f')](_0xb5dd1d[_0x381d('0x36')][_0x381d('0x3f')]);_0x4b1a33[_0x381d('0x40')]=qs[_0x381d('0x38')](_[_0x381d('0x41')](_0xb5dd1d[_0x381d('0x36')],_0x4c4e33[_0x381d('0x38')]),_0x3bd868);if(_0xb5dd1d[_0x381d('0x36')]['filter']){_0x4b1a33[_0x381d('0x40')]=_[_0x381d('0x42')](_0x4b1a33[_0x381d('0x40')],{'$or':_['map'](_0x3bd868,function(_0x17b140){if(_0x17b140['type']!==_0x381d('0x43')){var _0x478b24={};_0x478b24[_0x17b140[_0x381d('0x2d')]]={'$like':'%'+_0xb5dd1d[_0x381d('0x36')][_0x381d('0x44')]+'%'};return _0x478b24;}})});}_0x4b1a33=_[_0x381d('0x42')]({},_0x4b1a33,_0xb5dd1d['options']);var _0x906edf={'where':_0x4b1a33[_0x381d('0x40')]};return db[_0x381d('0x31')][_0x381d('0x21')](_0x906edf)[_0x381d('0x27')](function(_0xbd3193){_0x4007d9[_0x381d('0x21')]=_0xbd3193;if(_0xb5dd1d[_0x381d('0x36')][_0x381d('0x45')]){_0x4b1a33[_0x381d('0x46')]=[{'all':!![]}];}return db[_0x381d('0x31')][_0x381d('0x47')](_0x4b1a33);})[_0x381d('0x27')](function(_0x3b5d61){_0x4007d9[_0x381d('0x48')]=_0x3b5d61;return _0x4007d9;})[_0x381d('0x27')](respondWithFilteredResult(_0x1d4e14,_0x4b1a33))['catch'](handleError(_0x1d4e14,null));};exports[_0x381d('0x49')]=function(_0x77d2c3,_0x28b92b){var _0x386347={'raw':!![],'where':{'id':_0x77d2c3[_0x381d('0x4a')]['id']}},_0x346cf6={};_0x346cf6['model']=_[_0x381d('0x37')](db['Sound']['rawAttributes']);_0x346cf6['query']=_[_0x381d('0x37')](_0x77d2c3[_0x381d('0x36')]);_0x346cf6[_0x381d('0x38')]=_[_0x381d('0x39')](_0x346cf6[_0x381d('0x35')],_0x346cf6['query']);_0x386347[_0x381d('0x3b')]=_['intersection'](_0x346cf6['model'],qs[_0x381d('0x3a')](_0x77d2c3[_0x381d('0x36')]['fields']));_0x386347[_0x381d('0x3b')]=_0x386347['attributes'][_0x381d('0x3c')]?_0x386347['attributes']:_0x346cf6[_0x381d('0x35')];if(_0x77d2c3['query'][_0x381d('0x45')]){_0x386347['include']=[{'all':!![]}];}_0x386347=_[_0x381d('0x42')]({},_0x386347,_0x77d2c3[_0x381d('0x4b')]);return db[_0x381d('0x31')][_0x381d('0x4c')](_0x386347)['then'](handleEntityNotFound(_0x28b92b,null))[_0x381d('0x27')](respondWithResult(_0x28b92b,null))[_0x381d('0x4d')](handleError(_0x28b92b,null));};exports['download']=function(_0x637f46,_0x537d28,_0x43f4ca){return db[_0x381d('0x31')]['find']({'where':{'id':_0x637f46[_0x381d('0x4a')]['id']},'attributes':[_0x381d('0x2d'),_0x381d('0x4e'),'converted_format'],'raw':!![]})[_0x381d('0x27')](handleEntityNotFound(_0x537d28,null))[_0x381d('0x27')](function(_0x28c66a){if(_0x28c66a){if(!fs[_0x381d('0x4f')](path[_0x381d('0x50')](config[_0x381d('0x51')],_0x381d('0x52'),_0x28c66a[_0x381d('0x4e')]+'.'+_0x28c66a[_0x381d('0x53')]))){throw new db[(_0x381d('0x54'))][(_0x381d('0x55'))](_0x381d('0x56'));}return _0x537d28[_0x381d('0x57')](path[_0x381d('0x50')](config[_0x381d('0x51')],_0x381d('0x52'),util[_0x381d('0x58')](_0x381d('0x59'),_0x28c66a[_0x381d('0x4e')],_0x28c66a['converted_format'])),util[_0x381d('0x58')](_0x381d('0x59'),_0x28c66a['name'],_0x28c66a[_0x381d('0x53')]));}return null;})[_0x381d('0x4d')](handleError(_0x537d28,null));};exports['create']=function(_0x53e6f2,_0x5d7efa,_0xe7ddb1){var _0x4ad403={'name':path[_0x381d('0x5a')](_0x53e6f2[_0x381d('0x5b')]['originalname'],path[_0x381d('0x5c')](_0x53e6f2[_0x381d('0x5b')]['originalname'])),'save_name':path[_0x381d('0x5a')](_0x53e6f2[_0x381d('0x5b')][_0x381d('0x5d')],path['extname'](_0x53e6f2[_0x381d('0x5b')][_0x381d('0x5d')])),'original_format':path[_0x381d('0x5c')](_0x53e6f2[_0x381d('0x5b')][_0x381d('0x5e')])[_0x381d('0x5f')](0x1),'converted_format':_0x381d('0x60')};var _0xc0b5d=path[_0x381d('0x50')](config['root'],_0x381d('0x61'),_0x53e6f2[_0x381d('0x5b')]['filename']);var _0x275353=path['join'](config['root'],_0x381d('0x52'),util['format'](_0x381d('0x59'),path[_0x381d('0x5a')](_0x53e6f2[_0x381d('0x5b')][_0x381d('0x5d')],path['extname'](_0x53e6f2[_0x381d('0x5b')]['filename'])),_0x4ad403['converted_format']));logger[_0x381d('0x62')](_0x381d('0x63'),_0xc0b5d);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x275353);try{fs[_0x381d('0x64')](_0xc0b5d,parseInt('0777',0x8));var _0x1b0049=sox[_0x381d('0x65')](_0xc0b5d,_0x275353,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b0049['on'](_0x381d('0x2b'),function(_0x5643ac){fs[_0x381d('0x66')](_0xc0b5d);_0x5d7efa['status'](0x1f4)[_0x381d('0x2e')](_0x5643ac);});_0x1b0049['on']('src',function(_0xfbdf38){_0x4ad403[_0x381d('0x67')]=isNaN(_0xfbdf38['duration'])?null:_0xfbdf38[_0x381d('0x68')]*0x3e8;_0x4ad403[_0x381d('0x69')]=isNaN(_0xfbdf38[_0x381d('0x6a')])?null:_0xfbdf38[_0x381d('0x6a')];_0x4ad403['original_channelCount']=isNaN(_0xfbdf38[_0x381d('0x6b')])?null:_0xfbdf38[_0x381d('0x6b')];_0x4ad403['original_bitRate']=isNaN(_0xfbdf38[_0x381d('0x6c')])?null:_0xfbdf38[_0x381d('0x6c')];_0x4ad403['original_sampleRate']=isNaN(_0xfbdf38['sampleRate'])?null:_0xfbdf38[_0x381d('0x6d')];});_0x1b0049['on'](_0x381d('0x6e'),function(_0xab2ea5){_0x4ad403[_0x381d('0x6f')]=isNaN(_0xab2ea5[_0x381d('0x68')])?null:_0xab2ea5[_0x381d('0x68')]*0x3e8;_0x4ad403['converted_sampleCount']=isNaN(_0xab2ea5['sampleCount'])?null:_0xab2ea5[_0x381d('0x6a')];_0x4ad403['converted_channelCount']=isNaN(_0xab2ea5[_0x381d('0x6b')])?null:_0xab2ea5[_0x381d('0x6b')];_0x4ad403[_0x381d('0x70')]=isNaN(_0xab2ea5['bitRate'])?null:_0xab2ea5['bitRate'];_0x4ad403[_0x381d('0x71')]=isNaN(_0xab2ea5[_0x381d('0x6d')])?null:_0xab2ea5[_0x381d('0x6d')];});_0x1b0049['on'](_0x381d('0x1d'),function(){fs['chmodSync'](_0x275353,parseInt(_0x381d('0x72'),0x8));return db[_0x381d('0x31')][_0x381d('0x73')](_0x4ad403)[_0x381d('0x27')](function(_0x50e59d){var _0x542b23={'role':_0x53e6f2[_0x381d('0x74')][_0x381d('0x75')],'userProfileId':_0x53e6f2[_0x381d('0x74')][_0x381d('0x76')]};if(!_0x542b23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x542b23[_0x381d('0x75')]===_0x381d('0x77')){var _0x36aaab=_0x50e59d['get']({'plain':!![]});return db[_0x381d('0x78')][_0x381d('0x4c')]({'where':{'name':_0x381d('0x29'),'userProfileId':_0x542b23[_0x381d('0x76')]},'raw':!![]})['then'](function(_0xf68e16){if(_0xf68e16&&_0xf68e16[_0x381d('0x79')]===0x0){return db[_0x381d('0x2a')][_0x381d('0x73')]({'name':_0x36aaab[_0x381d('0x2d')],'resourceId':_0x36aaab['id'],'type':_0xf68e16[_0x381d('0x2d')],'sectionId':_0xf68e16['id']},{})[_0x381d('0x27')](function(){return _0x50e59d;});}else{return _0x50e59d;}})['catch'](function(_0x51a2bd){logger[_0x381d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51a2bd);throw _0x51a2bd;});}return _0x50e59d;})['then'](respondWithResult(_0x5d7efa,null))[_0x381d('0x4d')](handleError(_0x5d7efa,null));});_0x1b0049[_0x381d('0x7a')]();}catch(_0x407a3c){_0x5d7efa[_0x381d('0x1c')](0x1f4)[_0x381d('0x2e')](_0x407a3c);}};exports['update']=function(_0x361515,_0x29e767,_0x3aa2ef){return db[_0x381d('0x31')][_0x381d('0x4c')]({'where':{'id':_0x361515[_0x381d('0x4a')]['id']}})[_0x381d('0x27')](handleEntityNotFound(_0x29e767,null))[_0x381d('0x27')](saveUpdates(_[_0x381d('0x41')](_0x361515['body'],[_0x381d('0x2d'),_0x381d('0x7b')]),null))[_0x381d('0x27')](respondWithResult(_0x29e767,null))[_0x381d('0x4d')](handleError(_0x29e767,null));};exports[_0x381d('0x7c')]=function(_0x402ade,_0x54af47,_0x3201b4){return db['Sound'][_0x381d('0x4c')]({'where':{'id':_0x402ade[_0x381d('0x4a')]['id']}})[_0x381d('0x27')](function(_0xac3033){if(_0xac3033){return _0xac3033[_0x381d('0x28')]();}})[_0x381d('0x27')](function(_0x2eb0d1){var _0x1c995b=path['join'](config['root'],_0x381d('0x61'),util[_0x381d('0x58')](_0x381d('0x59'),_0x2eb0d1[_0x381d('0x4e')],_0x2eb0d1['original_format']));var _0x3ce28a=path[_0x381d('0x50')](config[_0x381d('0x51')],_0x381d('0x52'),util[_0x381d('0x58')]('%s.%s',_0x2eb0d1['save_name'],_0x2eb0d1[_0x381d('0x53')]));fs[_0x381d('0x66')](_0x1c995b);fs[_0x381d('0x66')](_0x3ce28a);return _0x2eb0d1;})[_0x381d('0x27')](function(_0x275d7b){if(_0x275d7b){return _0x54af47[_0x381d('0x1c')](0xcc)[_0x381d('0x1d')]();}})[_0x381d('0x27')](handleEntityNotFound(_0x54af47,null))[_0x381d('0x4d')](handleError(_0x54af47,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f614307..7e62260 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 _0xb81e=['api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger'];(function(_0x5cfa6a,_0x4d69e8){var _0x204e10=function(_0x364f3a){while(--_0x364f3a){_0x5cfa6a['push'](_0x5cfa6a['shift']());}};_0x204e10(++_0x4d69e8);}(_0xb81e,0x177));var _0xeb81=function(_0x1de396,_0x4c4cdf){_0x1de396=_0x1de396-0x0;var _0x4f17b0=_0xb81e[_0x1de396];return _0x4f17b0;};'use strict';var _=require('lodash');var util=require(_0xeb81('0x0'));var logger=require(_0xeb81('0x1'))(_0xeb81('0x2'));var moment=require(_0xeb81('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb81('0x4'));var fs=require('fs');var path=require(_0xeb81('0x5'));var rimraf=require(_0xeb81('0x6'));var config=require(_0xeb81('0x7'));var attributes=require(_0xeb81('0x8'));module[_0xeb81('0x9')]=function(_0x533d0b,_0x59a470){return _0x533d0b[_0xeb81('0xa')](_0xeb81('0xb'),attributes,{'tableName':_0xeb81('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa345=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa345,0xf6));var _0x5a34=function(_0x57377f,_0x575b2e){_0x57377f=_0x57377f-0x0;var _0xd96691=_0xa345[_0x57377f];return _0xd96691;};'use strict';var _=require(_0x5a34('0x0'));var util=require(_0x5a34('0x1'));var logger=require(_0x5a34('0x2'))(_0x5a34('0x3'));var moment=require(_0x5a34('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a34('0x5'));var fs=require('fs');var path=require(_0x5a34('0x6'));var rimraf=require(_0x5a34('0x7'));var config=require(_0x5a34('0x8'));var attributes=require(_0x5a34('0x9'));module[_0x5a34('0xa')]=function(_0x578fc2,_0x3cd5fe){return _0x578fc2['define'](_0x5a34('0xb'),attributes,{'tableName':_0x5a34('0xc'),'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 800d2ff..2969fe1 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 _0x76ef=['request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','find','raw','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x76ef,0x194));var _0xf76e=function(_0x2f12cb,_0x382a3a){_0x2f12cb=_0x2f12cb-0x0;var _0x4ef50e=_0x76ef[_0x2f12cb];return _0x4ef50e;};'use strict';var _=require(_0xf76e('0x0'));var util=require(_0xf76e('0x1'));var moment=require(_0xf76e('0x2'));var BPromise=require(_0xf76e('0x3'));var rs=require(_0xf76e('0x4'));var fs=require('fs');var Redis=require(_0xf76e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf76e('0x6'));var logger=require(_0xf76e('0x7'))(_0xf76e('0x8'));var config=require(_0xf76e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf76e('0xa')][_0xf76e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bf384,_0xc608c0,_0x5106de){return new BPromise(function(_0x1d81b6,_0x40f165){return client[_0xf76e('0xc')](_0x3bf384,_0x5106de)['then'](function(_0x4c58a8){logger[_0xf76e('0xd')](_0xf76e('0xe'),_0xc608c0,_0xf76e('0xf'));logger[_0xf76e('0x10')](_0xf76e('0x11'),_0xc608c0,'request\x20sent',JSON[_0xf76e('0x12')](_0x4c58a8));if(_0x4c58a8['error']){if(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x14')]===0x1f4){logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0x4c58a8['error'][_0xf76e('0x15')]);return _0x40f165(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);}logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);return _0x1d81b6(_0x4c58a8[_0xf76e('0x13')][_0xf76e('0x15')]);}else{logger['info'](_0xf76e('0xe'),_0xc608c0,_0xf76e('0xf'));_0x1d81b6(_0x4c58a8['result'][_0xf76e('0x15')]);}})[_0xf76e('0x16')](function(_0xf9eb12){logger[_0xf76e('0x13')]('Sound,\x20%s,\x20%s',_0xc608c0,_0xf9eb12);_0x40f165(_0xf9eb12);});});}exports[_0xf76e('0x17')]=function(_0x44aeec){var _0x41ac2a=this;return new Promise(function(_0x5f3d87,_0x4d0b8f){return db['Sound'][_0xf76e('0x18')]({'raw':_0x44aeec['options']?_0x44aeec['options'][_0xf76e('0x19')]===undefined?!![]:![]:!![],'where':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')][_0xf76e('0x1b')]||null:null,'attributes':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')]['attributes']||null:null,'include':_0x44aeec[_0xf76e('0x1a')]?_0x44aeec[_0xf76e('0x1a')][_0xf76e('0x1c')]?_[_0xf76e('0x1d')](_0x44aeec['options'][_0xf76e('0x1c')],function(_0x1283e){return{'model':db[_0x1283e[_0xf76e('0x1e')]],'as':_0x1283e['as'],'attributes':_0x1283e[_0xf76e('0x1f')],'include':_0x1283e[_0xf76e('0x1c')]?_['map'](_0x1283e[_0xf76e('0x1c')],function(_0x4701d0){return{'model':db[_0x4701d0['model']],'as':_0x4701d0['as'],'attributes':_0x4701d0[_0xf76e('0x1f')],'include':_0x4701d0[_0xf76e('0x1c')]?_[_0xf76e('0x1d')](_0x4701d0[_0xf76e('0x1c')],function(_0x2abb5d){return{'model':db[_0x2abb5d[_0xf76e('0x1e')]],'as':_0x2abb5d['as'],'attributes':_0x2abb5d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6cb2){logger[_0xf76e('0xd')](_0xf76e('0x17'),_0x44aeec);logger['debug'](_0xf76e('0x17'),_0x44aeec,JSON[_0xf76e('0x12')](_0x4f6cb2));_0x5f3d87(_0x4f6cb2);})[_0xf76e('0x16')](function(_0x5e1dea){logger[_0xf76e('0x13')](_0xf76e('0x17'),_0x5e1dea[_0xf76e('0x15')],_0x44aeec);_0x4d0b8f(_0x41ac2a[_0xf76e('0x13')](0x1f4,_0x5e1dea[_0xf76e('0x15')]));});});}; \ No newline at end of file +var _0x16e0=['debug','ShowSound','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Sound','find','options','raw','where','attributes','include','map','model'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x16e0,0x122));var _0x016e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16e0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x016e('0x0'));var moment=require(_0x016e('0x1'));var BPromise=require('bluebird');var rs=require(_0x016e('0x2'));var fs=require('fs');var Redis=require(_0x016e('0x3'));var db=require(_0x016e('0x4'))['db'];var utils=require(_0x016e('0x5'));var logger=require('../../config/logger')(_0x016e('0x6'));var config=require(_0x016e('0x7'));var jayson=require(_0x016e('0x8'));var client=jayson['client'][_0x016e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf55d,_0x31bb1d,_0x5e8986){return new BPromise(function(_0xcfcf10,_0x317136){return client['request'](_0x1bf55d,_0x5e8986)[_0x016e('0xa')](function(_0x3ed1f4){logger[_0x016e('0xb')](_0x016e('0xc'),_0x31bb1d,'request\x20sent');logger['debug'](_0x016e('0xd'),_0x31bb1d,_0x016e('0xe'),JSON[_0x016e('0xf')](_0x3ed1f4));if(_0x3ed1f4[_0x016e('0x10')]){if(_0x3ed1f4[_0x016e('0x10')][_0x016e('0x11')]===0x1f4){logger[_0x016e('0x10')](_0x016e('0xc'),_0x31bb1d,_0x3ed1f4['error'][_0x016e('0x12')]);return _0x317136(_0x3ed1f4[_0x016e('0x10')]['message']);}logger[_0x016e('0x10')](_0x016e('0xc'),_0x31bb1d,_0x3ed1f4[_0x016e('0x10')][_0x016e('0x12')]);return _0xcfcf10(_0x3ed1f4['error'][_0x016e('0x12')]);}else{logger[_0x016e('0xb')](_0x016e('0xc'),_0x31bb1d,'request\x20sent');_0xcfcf10(_0x3ed1f4[_0x016e('0x13')][_0x016e('0x12')]);}})[_0x016e('0x14')](function(_0x50a4b4){logger[_0x016e('0x10')](_0x016e('0xc'),_0x31bb1d,_0x50a4b4);_0x317136(_0x50a4b4);});});}exports['ShowSound']=function(_0x35e6f3){var _0x16b4b2=this;return new Promise(function(_0x43c595,_0xc6358){return db[_0x016e('0x15')][_0x016e('0x16')]({'raw':_0x35e6f3[_0x016e('0x17')]?_0x35e6f3[_0x016e('0x17')][_0x016e('0x18')]===undefined?!![]:![]:!![],'where':_0x35e6f3[_0x016e('0x17')]?_0x35e6f3[_0x016e('0x17')][_0x016e('0x19')]||null:null,'attributes':_0x35e6f3['options']?_0x35e6f3[_0x016e('0x17')][_0x016e('0x1a')]||null:null,'include':_0x35e6f3[_0x016e('0x17')]?_0x35e6f3[_0x016e('0x17')][_0x016e('0x1b')]?_[_0x016e('0x1c')](_0x35e6f3[_0x016e('0x17')]['include'],function(_0x4d4719){return{'model':db[_0x4d4719['model']],'as':_0x4d4719['as'],'attributes':_0x4d4719[_0x016e('0x1a')],'include':_0x4d4719[_0x016e('0x1b')]?_[_0x016e('0x1c')](_0x4d4719[_0x016e('0x1b')],function(_0xce9ea2){return{'model':db[_0xce9ea2[_0x016e('0x1d')]],'as':_0xce9ea2['as'],'attributes':_0xce9ea2['attributes'],'include':_0xce9ea2[_0x016e('0x1b')]?_[_0x016e('0x1c')](_0xce9ea2[_0x016e('0x1b')],function(_0x4164ab){return{'model':db[_0x4164ab[_0x016e('0x1d')]],'as':_0x4164ab['as'],'attributes':_0x4164ab[_0x016e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x016e('0xa')](function(_0x4aceda){logger[_0x016e('0xb')]('ShowSound',_0x35e6f3);logger[_0x016e('0x1e')](_0x016e('0x1f'),_0x35e6f3,JSON[_0x016e('0xf')](_0x4aceda));_0x43c595(_0x4aceda);})[_0x016e('0x14')](function(_0xc5c19){logger[_0x016e('0x10')]('ShowSound',_0xc5c19['message'],_0x35e6f3);_0xc6358(_0x16b4b2[_0x016e('0x10')](0x1f4,_0xc5c19[_0x016e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 808a0d1..a71ca58 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x5acd05,_0xdcb73b){var _0x160b9e=function(_0x3bb9df){while(--_0x3bb9df){_0x5acd05['push'](_0x5acd05['shift']());}};_0x160b9e(++_0xdcb73b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x1b0928,_0x2322df){var _0x56b397=function(_0x110326){while(--_0x110326){_0x1b0928['push'](_0x1b0928['shift']());}};_0x56b397(++_0x2322df);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index bc3c8ed..61b07e8 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 _0x9b66=['TEXT','ENUM','out','STRING','sequelize','exports'];(function(_0x34ebf3,_0x5935c5){var _0x3a634d=function(_0x4f5d92){while(--_0x4f5d92){_0x34ebf3['push'](_0x34ebf3['shift']());}};_0x3a634d(++_0x5935c5);}(_0x9b66,0xa6));var _0x69b6=function(_0x51723e,_0x28d019){_0x51723e=_0x51723e-0x0;var _0x43936a=_0x9b66[_0x51723e];return _0x43936a;};'use strict';var Sequelize=require(_0x69b6('0x0'));module[_0x69b6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x69b6('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x69b6('0x3')]('in',_0x69b6('0x4')),'defaultValue':_0x69b6('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x69b6('0x5')]},'providerResponse':{'type':Sequelize[_0x69b6('0x2')]}}; \ No newline at end of file +var _0x39fd=['medium','ENUM','out','STRING','TEXT','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x39fd,0xad));var _0xd39f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x39fd[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xd39f('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xd39f('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0xd39f('0x2')]('in',_0xd39f('0x3')),'defaultValue':_0xd39f('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xd39f('0x4')]},'providerResponse':{'type':Sequelize[_0xd39f('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 17c86a6..2ead494 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 _0x5f88=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','json','reject','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1c0f02,_0x248e33){var _0x5520fc=function(_0x2cbc86){while(--_0x2cbc86){_0x1c0f02['push'](_0x1c0f02['shift']());}};_0x5520fc(++_0x248e33);}(_0x5f88,0x1bb));var _0x85f8=function(_0x1027bc,_0x5484d4){_0x1027bc=_0x1027bc-0x0;var _0x48fcf1=_0x5f88[_0x1027bc];return _0x48fcf1;};'use strict';var emlformat=require(_0x85f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85f8('0x1'));var jsonpatch=require(_0x85f8('0x2'));var rp=require(_0x85f8('0x3'));var moment=require(_0x85f8('0x4'));var BPromise=require(_0x85f8('0x5'));var Mustache=require(_0x85f8('0x6'));var util=require('util');var path=require(_0x85f8('0x7'));var sox=require(_0x85f8('0x8'));var csv=require(_0x85f8('0x9'));var ejs=require(_0x85f8('0xa'));var fs=require('fs');var fs_extra=require(_0x85f8('0xb'));var _=require(_0x85f8('0xc'));var squel=require(_0x85f8('0xd'));var crypto=require('crypto');var jsforce=require(_0x85f8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85f8('0x9'));var querystring=require('querystring');var Papa=require(_0x85f8('0xf'));var Redis=require(_0x85f8('0x10'));var authService=require(_0x85f8('0x11'));var qs=require(_0x85f8('0x12'));var as=require(_0x85f8('0x13'));var hardwareService=require(_0x85f8('0x14'));var logger=require(_0x85f8('0x15'))(_0x85f8('0x16'));var utils=require(_0x85f8('0x17'));var config=require(_0x85f8('0x18'));var licenseUtil=require(_0x85f8('0x19'));var db=require(_0x85f8('0x1a'))['db'];function respondWithStatusCode(_0x31c633,_0x49132f){_0x49132f=_0x49132f||0xcc;return function(_0x22be91){if(_0x22be91){return _0x31c633[_0x85f8('0x1b')](_0x49132f);}return _0x31c633['status'](_0x49132f)[_0x85f8('0x1c')]();};}function respondWithResult(_0x5d3912,_0x1bdb03){_0x1bdb03=_0x1bdb03||0xc8;return function(_0x543268){if(_0x543268){return _0x5d3912[_0x85f8('0x1d')](_0x1bdb03)['json'](_0x543268);}};}function respondWithFilteredResult(_0x1ab625,_0x4cf729){return function(_0xe8c7e0){if(_0xe8c7e0){var _0x3d6c11=typeof _0x4cf729['offset']==='undefined'&&typeof _0x4cf729[_0x85f8('0x1e')]===_0x85f8('0x1f');var _0xe4515d=_0xe8c7e0[_0x85f8('0x20')];var _0x34e651=_0x3d6c11?0x0:_0x4cf729['offset'];var _0x5dd414=_0x3d6c11?_0xe8c7e0[_0x85f8('0x20')]:_0x4cf729['offset']+_0x4cf729[_0x85f8('0x1e')];var _0x2706b6;if(_0x5dd414>=_0xe4515d){_0x5dd414=_0xe4515d;_0x2706b6=0xc8;}else{_0x2706b6=0xce;}_0x1ab625[_0x85f8('0x1d')](_0x2706b6);return _0x1ab625['set']('Content-Range',_0x34e651+'-'+_0x5dd414+'/'+_0xe4515d)[_0x85f8('0x21')](_0xe8c7e0);}return null;};}function patchUpdates(_0x2ec074){return function(_0x4c8dd4){try{jsonpatch['apply'](_0x4c8dd4,_0x2ec074,!![]);}catch(_0x1a27eb){return BPromise[_0x85f8('0x22')](_0x1a27eb);}return _0x4c8dd4[_0x85f8('0x23')]();};}function saveUpdates(_0x1c014b,_0x23073a){return function(_0x38721e){if(_0x38721e){return _0x38721e[_0x85f8('0x24')](_0x1c014b)[_0x85f8('0x25')](function(_0x5780d4){return _0x5780d4;});}return null;};}function removeEntity(_0x1a2e37,_0x4536b8){return function(_0x1e3b05){if(_0x1e3b05){return _0x1e3b05[_0x85f8('0x26')]()[_0x85f8('0x25')](function(){_0x1a2e37[_0x85f8('0x1d')](0xcc)[_0x85f8('0x1c')]();});}};}function handleEntityNotFound(_0x24e676,_0xcb06c0){return function(_0x2cf9e8){if(!_0x2cf9e8){_0x24e676[_0x85f8('0x1b')](0x194);}return _0x2cf9e8;};}function handleError(_0xa7832a,_0x2c03ca){_0x2c03ca=_0x2c03ca||0x1f4;return function(_0x19d1f8){logger[_0x85f8('0x27')](_0x19d1f8['stack']);if(_0x19d1f8['name']){delete _0x19d1f8[_0x85f8('0x28')];}_0xa7832a[_0x85f8('0x1d')](_0x2c03ca)[_0x85f8('0x29')](_0x19d1f8);};}exports[_0x85f8('0x2a')]=function(_0x1e45d9,_0x4d2b2f){var _0x2f4097={},_0x1e2ffa={},_0x16e893={'count':0x0,'rows':[]};var _0x5d9eef=_[_0x85f8('0x2b')](db[_0x85f8('0x2c')][_0x85f8('0x2d')],function(_0x4efcd7){return{'name':_0x4efcd7[_0x85f8('0x2e')],'type':_0x4efcd7[_0x85f8('0x2f')][_0x85f8('0x30')]};});_0x1e2ffa['model']=_['map'](_0x5d9eef,_0x85f8('0x28'));_0x1e2ffa[_0x85f8('0x31')]=_['keys'](_0x1e45d9['query']);_0x1e2ffa[_0x85f8('0x32')]=_[_0x85f8('0x33')](_0x1e2ffa[_0x85f8('0x34')],_0x1e2ffa[_0x85f8('0x31')]);_0x2f4097[_0x85f8('0x35')]=_[_0x85f8('0x33')](_0x1e2ffa[_0x85f8('0x34')],qs[_0x85f8('0x36')](_0x1e45d9['query'][_0x85f8('0x36')]));_0x2f4097[_0x85f8('0x35')]=_0x2f4097[_0x85f8('0x35')]['length']?_0x2f4097[_0x85f8('0x35')]:_0x1e2ffa[_0x85f8('0x34')];if(!_0x1e45d9[_0x85f8('0x31')][_0x85f8('0x37')](_0x85f8('0x38'))){_0x2f4097[_0x85f8('0x1e')]=qs['limit'](_0x1e45d9[_0x85f8('0x31')]['limit']);_0x2f4097[_0x85f8('0x39')]=qs['offset'](_0x1e45d9['query'][_0x85f8('0x39')]);}_0x2f4097[_0x85f8('0x3a')]=qs['sort'](_0x1e45d9['query'][_0x85f8('0x3b')]);_0x2f4097[_0x85f8('0x3c')]=qs[_0x85f8('0x32')](_['pick'](_0x1e45d9[_0x85f8('0x31')],_0x1e2ffa['filters']),_0x5d9eef);if(_0x1e45d9['query']['filter']){_0x2f4097[_0x85f8('0x3c')]=_['merge'](_0x2f4097[_0x85f8('0x3c')],{'$or':_[_0x85f8('0x2b')](_0x5d9eef,function(_0x41952b){if(_0x41952b[_0x85f8('0x2f')]!==_0x85f8('0x3d')){var _0x11f3ab={};_0x11f3ab[_0x41952b[_0x85f8('0x28')]]={'$like':'%'+_0x1e45d9[_0x85f8('0x31')][_0x85f8('0x3e')]+'%'};return _0x11f3ab;}})});}_0x2f4097=_[_0x85f8('0x3f')]({},_0x2f4097,_0x1e45d9['options']);var _0x1757c1={'where':_0x2f4097[_0x85f8('0x3c')]};return db[_0x85f8('0x2c')]['count'](_0x1757c1)[_0x85f8('0x25')](function(_0x1bd113){_0x16e893['count']=_0x1bd113;if(_0x1e45d9['query'][_0x85f8('0x40')]){_0x2f4097[_0x85f8('0x41')]=[{'all':!![]}];}return db[_0x85f8('0x2c')][_0x85f8('0x42')](_0x2f4097);})['then'](function(_0x20e72b){_0x16e893[_0x85f8('0x43')]=_0x20e72b;return _0x16e893;})[_0x85f8('0x25')](respondWithFilteredResult(_0x4d2b2f,_0x2f4097))[_0x85f8('0x44')](handleError(_0x4d2b2f,null));};exports[_0x85f8('0x45')]=function(_0x2d22f8,_0x5fd4a4){var _0x26c506={'raw':!![],'where':{'id':_0x2d22f8[_0x85f8('0x46')]['id']}},_0x55b446={};_0x55b446[_0x85f8('0x34')]=_[_0x85f8('0x47')](db[_0x85f8('0x2c')][_0x85f8('0x2d')]);_0x55b446[_0x85f8('0x31')]=_[_0x85f8('0x47')](_0x2d22f8[_0x85f8('0x31')]);_0x55b446[_0x85f8('0x32')]=_[_0x85f8('0x33')](_0x55b446[_0x85f8('0x34')],_0x55b446[_0x85f8('0x31')]);_0x26c506[_0x85f8('0x35')]=_['intersection'](_0x55b446['model'],qs[_0x85f8('0x36')](_0x2d22f8[_0x85f8('0x31')][_0x85f8('0x36')]));_0x26c506[_0x85f8('0x35')]=_0x26c506[_0x85f8('0x35')][_0x85f8('0x48')]?_0x26c506[_0x85f8('0x35')]:_0x55b446[_0x85f8('0x34')];if(_0x2d22f8['query'][_0x85f8('0x40')]){_0x26c506[_0x85f8('0x41')]=[{'all':!![]}];}_0x26c506=_[_0x85f8('0x3f')]({},_0x26c506,_0x2d22f8[_0x85f8('0x49')]);return db['SquareMessage'][_0x85f8('0x4a')](_0x26c506)[_0x85f8('0x25')](handleEntityNotFound(_0x5fd4a4,null))[_0x85f8('0x25')](respondWithResult(_0x5fd4a4,null))[_0x85f8('0x44')](handleError(_0x5fd4a4,null));};exports[_0x85f8('0x4b')]=function(_0x42ece6,_0x5e39a4){return db['SquareMessage'][_0x85f8('0x4b')](_0x42ece6[_0x85f8('0x4c')],{})[_0x85f8('0x25')](respondWithResult(_0x5e39a4,0xc9))[_0x85f8('0x44')](handleError(_0x5e39a4,null));};exports[_0x85f8('0x24')]=function(_0x3ab071,_0x1bfd5d){if(_0x3ab071['body']['id']){delete _0x3ab071['body']['id'];}return db[_0x85f8('0x2c')][_0x85f8('0x4a')]({'where':{'id':_0x3ab071[_0x85f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bfd5d,null))[_0x85f8('0x25')](saveUpdates(_0x3ab071[_0x85f8('0x4c')],null))[_0x85f8('0x25')](respondWithResult(_0x1bfd5d,null))[_0x85f8('0x44')](handleError(_0x1bfd5d,null));};exports[_0x85f8('0x26')]=function(_0x2e3a35,_0x54098b){return db['SquareMessage'][_0x85f8('0x4a')]({'where':{'id':_0x2e3a35[_0x85f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x54098b,null))[_0x85f8('0x25')](removeEntity(_0x54098b,null))[_0x85f8('0x44')](handleError(_0x54098b,null));}; \ No newline at end of file +var _0xe6e4=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SquareMessage','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0xe6e4,0x139));var _0x4e6e=function(_0x6bc26,_0x59d229){_0x6bc26=_0x6bc26-0x0;var _0x420728=_0xe6e4[_0x6bc26];return _0x420728;};'use strict';var emlformat=require(_0x4e6e('0x0'));var rimraf=require(_0x4e6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e6e('0x2'));var rp=require(_0x4e6e('0x3'));var moment=require(_0x4e6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e6e('0x5'));var util=require(_0x4e6e('0x6'));var path=require(_0x4e6e('0x7'));var sox=require(_0x4e6e('0x8'));var csv=require('to-csv');var ejs=require(_0x4e6e('0x9'));var fs=require('fs');var fs_extra=require(_0x4e6e('0xa'));var _=require(_0x4e6e('0xb'));var squel=require(_0x4e6e('0xc'));var crypto=require(_0x4e6e('0xd'));var jsforce=require(_0x4e6e('0xe'));var deskjs=require(_0x4e6e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e6e('0x10'));var Papa=require(_0x4e6e('0x11'));var Redis=require(_0x4e6e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4e6e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e6e('0x14'));var logger=require(_0x4e6e('0x15'))(_0x4e6e('0x16'));var utils=require('../../config/utils');var config=require(_0x4e6e('0x17'));var licenseUtil=require(_0x4e6e('0x18'));var db=require(_0x4e6e('0x19'))['db'];function respondWithStatusCode(_0x2163e8,_0x2b1ef8){_0x2b1ef8=_0x2b1ef8||0xcc;return function(_0xef9381){if(_0xef9381){return _0x2163e8[_0x4e6e('0x1a')](_0x2b1ef8);}return _0x2163e8['status'](_0x2b1ef8)['end']();};}function respondWithResult(_0x1795ee,_0x30712c){_0x30712c=_0x30712c||0xc8;return function(_0x22b970){if(_0x22b970){return _0x1795ee[_0x4e6e('0x1b')](_0x30712c)[_0x4e6e('0x1c')](_0x22b970);}};}function respondWithFilteredResult(_0x1a3a68,_0x75fa54){return function(_0x3dad06){if(_0x3dad06){var _0x2af2fe=typeof _0x75fa54[_0x4e6e('0x1d')]===_0x4e6e('0x1e')&&typeof _0x75fa54[_0x4e6e('0x1f')]===_0x4e6e('0x1e');var _0x361feb=_0x3dad06[_0x4e6e('0x20')];var _0x4924e9=_0x2af2fe?0x0:_0x75fa54['offset'];var _0x45f45b=_0x2af2fe?_0x3dad06[_0x4e6e('0x20')]:_0x75fa54['offset']+_0x75fa54[_0x4e6e('0x1f')];var _0x575591;if(_0x45f45b>=_0x361feb){_0x45f45b=_0x361feb;_0x575591=0xc8;}else{_0x575591=0xce;}_0x1a3a68[_0x4e6e('0x1b')](_0x575591);return _0x1a3a68[_0x4e6e('0x21')](_0x4e6e('0x22'),_0x4924e9+'-'+_0x45f45b+'/'+_0x361feb)['json'](_0x3dad06);}return null;};}function patchUpdates(_0x56f592){return function(_0x65770){try{jsonpatch[_0x4e6e('0x23')](_0x65770,_0x56f592,!![]);}catch(_0x1767eb){return BPromise[_0x4e6e('0x24')](_0x1767eb);}return _0x65770[_0x4e6e('0x25')]();};}function saveUpdates(_0x5860a2,_0x16f958){return function(_0x13b0b9){if(_0x13b0b9){return _0x13b0b9[_0x4e6e('0x26')](_0x5860a2)[_0x4e6e('0x27')](function(_0x105c60){return _0x105c60;});}return null;};}function removeEntity(_0x5df95f,_0x44eab1){return function(_0x53d08c){if(_0x53d08c){return _0x53d08c[_0x4e6e('0x28')]()[_0x4e6e('0x27')](function(){_0x5df95f[_0x4e6e('0x1b')](0xcc)[_0x4e6e('0x29')]();});}};}function handleEntityNotFound(_0x2122fc,_0xeff3af){return function(_0x3419f2){if(!_0x3419f2){_0x2122fc[_0x4e6e('0x1a')](0x194);}return _0x3419f2;};}function handleError(_0x4ac91a,_0x164c3c){_0x164c3c=_0x164c3c||0x1f4;return function(_0x334bac){logger[_0x4e6e('0x2a')](_0x334bac[_0x4e6e('0x2b')]);if(_0x334bac[_0x4e6e('0x2c')]){delete _0x334bac['name'];}_0x4ac91a[_0x4e6e('0x1b')](_0x164c3c)[_0x4e6e('0x2d')](_0x334bac);};}exports[_0x4e6e('0x2e')]=function(_0x4d9ac9,_0x598bb6){var _0x476b4b={},_0x406dd6={},_0x137ce0={'count':0x0,'rows':[]};var _0x4f01dd=_['map'](db['SquareMessage'][_0x4e6e('0x2f')],function(_0x25da20){return{'name':_0x25da20[_0x4e6e('0x30')],'type':_0x25da20['type'][_0x4e6e('0x31')]};});_0x406dd6['model']=_[_0x4e6e('0x32')](_0x4f01dd,'name');_0x406dd6[_0x4e6e('0x33')]=_[_0x4e6e('0x34')](_0x4d9ac9[_0x4e6e('0x33')]);_0x406dd6[_0x4e6e('0x35')]=_['intersection'](_0x406dd6[_0x4e6e('0x36')],_0x406dd6[_0x4e6e('0x33')]);_0x476b4b[_0x4e6e('0x37')]=_[_0x4e6e('0x38')](_0x406dd6[_0x4e6e('0x36')],qs[_0x4e6e('0x39')](_0x4d9ac9[_0x4e6e('0x33')][_0x4e6e('0x39')]));_0x476b4b[_0x4e6e('0x37')]=_0x476b4b[_0x4e6e('0x37')][_0x4e6e('0x3a')]?_0x476b4b[_0x4e6e('0x37')]:_0x406dd6['model'];if(!_0x4d9ac9[_0x4e6e('0x33')][_0x4e6e('0x3b')](_0x4e6e('0x3c'))){_0x476b4b[_0x4e6e('0x1f')]=qs[_0x4e6e('0x1f')](_0x4d9ac9[_0x4e6e('0x33')][_0x4e6e('0x1f')]);_0x476b4b[_0x4e6e('0x1d')]=qs[_0x4e6e('0x1d')](_0x4d9ac9[_0x4e6e('0x33')]['offset']);}_0x476b4b[_0x4e6e('0x3d')]=qs[_0x4e6e('0x3e')](_0x4d9ac9['query'][_0x4e6e('0x3e')]);_0x476b4b[_0x4e6e('0x3f')]=qs[_0x4e6e('0x35')](_[_0x4e6e('0x40')](_0x4d9ac9[_0x4e6e('0x33')],_0x406dd6[_0x4e6e('0x35')]),_0x4f01dd);if(_0x4d9ac9[_0x4e6e('0x33')][_0x4e6e('0x41')]){_0x476b4b['where']=_[_0x4e6e('0x42')](_0x476b4b['where'],{'$or':_[_0x4e6e('0x32')](_0x4f01dd,function(_0x3f74c8){if(_0x3f74c8[_0x4e6e('0x43')]!==_0x4e6e('0x44')){var _0x2ba26c={};_0x2ba26c[_0x3f74c8[_0x4e6e('0x2c')]]={'$like':'%'+_0x4d9ac9[_0x4e6e('0x33')]['filter']+'%'};return _0x2ba26c;}})});}_0x476b4b=_[_0x4e6e('0x42')]({},_0x476b4b,_0x4d9ac9['options']);var _0x19281a={'where':_0x476b4b[_0x4e6e('0x3f')]};return db[_0x4e6e('0x45')][_0x4e6e('0x20')](_0x19281a)[_0x4e6e('0x27')](function(_0xff8fcd){_0x137ce0[_0x4e6e('0x20')]=_0xff8fcd;if(_0x4d9ac9[_0x4e6e('0x33')][_0x4e6e('0x46')]){_0x476b4b[_0x4e6e('0x47')]=[{'all':!![]}];}return db['SquareMessage'][_0x4e6e('0x48')](_0x476b4b);})[_0x4e6e('0x27')](function(_0x210083){_0x137ce0[_0x4e6e('0x49')]=_0x210083;return _0x137ce0;})['then'](respondWithFilteredResult(_0x598bb6,_0x476b4b))[_0x4e6e('0x4a')](handleError(_0x598bb6,null));};exports[_0x4e6e('0x4b')]=function(_0x2051cb,_0x37b306){var _0x25ba3e={'raw':!![],'where':{'id':_0x2051cb[_0x4e6e('0x4c')]['id']}},_0x5c1948={};_0x5c1948[_0x4e6e('0x36')]=_['keys'](db[_0x4e6e('0x45')][_0x4e6e('0x2f')]);_0x5c1948['query']=_[_0x4e6e('0x34')](_0x2051cb[_0x4e6e('0x33')]);_0x5c1948[_0x4e6e('0x35')]=_[_0x4e6e('0x38')](_0x5c1948['model'],_0x5c1948[_0x4e6e('0x33')]);_0x25ba3e[_0x4e6e('0x37')]=_[_0x4e6e('0x38')](_0x5c1948[_0x4e6e('0x36')],qs[_0x4e6e('0x39')](_0x2051cb[_0x4e6e('0x33')][_0x4e6e('0x39')]));_0x25ba3e[_0x4e6e('0x37')]=_0x25ba3e[_0x4e6e('0x37')][_0x4e6e('0x3a')]?_0x25ba3e['attributes']:_0x5c1948[_0x4e6e('0x36')];if(_0x2051cb['query']['includeAll']){_0x25ba3e[_0x4e6e('0x47')]=[{'all':!![]}];}_0x25ba3e=_[_0x4e6e('0x42')]({},_0x25ba3e,_0x2051cb[_0x4e6e('0x4d')]);return db[_0x4e6e('0x45')][_0x4e6e('0x4e')](_0x25ba3e)['then'](handleEntityNotFound(_0x37b306,null))[_0x4e6e('0x27')](respondWithResult(_0x37b306,null))[_0x4e6e('0x4a')](handleError(_0x37b306,null));};exports[_0x4e6e('0x4f')]=function(_0x4379b7,_0x358e9a){return db['SquareMessage'][_0x4e6e('0x4f')](_0x4379b7[_0x4e6e('0x50')],{})[_0x4e6e('0x27')](respondWithResult(_0x358e9a,0xc9))[_0x4e6e('0x4a')](handleError(_0x358e9a,null));};exports[_0x4e6e('0x26')]=function(_0x1c562c,_0x3f3aae){if(_0x1c562c[_0x4e6e('0x50')]['id']){delete _0x1c562c[_0x4e6e('0x50')]['id'];}return db['SquareMessage'][_0x4e6e('0x4e')]({'where':{'id':_0x1c562c[_0x4e6e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f3aae,null))[_0x4e6e('0x27')](saveUpdates(_0x1c562c[_0x4e6e('0x50')],null))[_0x4e6e('0x27')](respondWithResult(_0x3f3aae,null))[_0x4e6e('0x4a')](handleError(_0x3f3aae,null));};exports[_0x4e6e('0x28')]=function(_0x31ed68,_0x36fc43){return db[_0x4e6e('0x45')]['find']({'where':{'id':_0x31ed68['params']['id']}})[_0x4e6e('0x27')](handleEntityNotFound(_0x36fc43,null))['then'](removeEntity(_0x36fc43,null))[_0x4e6e('0x4a')](handleError(_0x36fc43,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 6bc0f97..303e1b3 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 _0xbf05=['path','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','api','moment','bluebird'];(function(_0x4c0b94,_0x31aee5){var _0x221afa=function(_0xc8c263){while(--_0xc8c263){_0x4c0b94['push'](_0x4c0b94['shift']());}};_0x221afa(++_0x31aee5);}(_0xbf05,0x114));var _0x5bf0=function(_0x58aefd,_0x249251){_0x58aefd=_0x58aefd-0x0;var _0xdae2d7=_0xbf05[_0x58aefd];return _0xdae2d7;};'use strict';var _=require(_0x5bf0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5bf0('0x1'));var moment=require(_0x5bf0('0x2'));var BPromise=require(_0x5bf0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bf0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5bf0('0x5'));module[_0x5bf0('0x6')]=function(_0x4dc051,_0x553530){return _0x4dc051[_0x5bf0('0x7')](_0x5bf0('0x8'),attributes,{'tableName':_0x5bf0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd60=['bluebird','request-promise','rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xcd60,0x188));var _0x0cd6=function(_0x318fe7,_0x30143d){_0x318fe7=_0x318fe7-0x0;var _0x270db9=_0xcd60[_0x318fe7];return _0x270db9;};'use strict';var _=require(_0x0cd6('0x0'));var util=require('util');var logger=require(_0x0cd6('0x1'))(_0x0cd6('0x2'));var moment=require(_0x0cd6('0x3'));var BPromise=require(_0x0cd6('0x4'));var rp=require(_0x0cd6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cd6('0x6'));var config=require('../../config/environment');var attributes=require(_0x0cd6('0x7'));module['exports']=function(_0x57490b,_0x3f362e){return _0x57490b[_0x0cd6('0x8')](_0x0cd6('0x9'),attributes,{'tableName':_0x0cd6('0xa'),'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 43831c4..3986504 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 _0x634d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','raw','lodash','util'];(function(_0x4501a6,_0x561517){var _0x309313=function(_0x3fa424){while(--_0x3fa424){_0x4501a6['push'](_0x4501a6['shift']());}};_0x309313(++_0x561517);}(_0x634d,0xbb));var _0xd634=function(_0x105e88,_0x54ff10){_0x105e88=_0x105e88-0x0;var _0x18e625=_0x634d[_0x105e88];return _0x18e625;};'use strict';var _=require(_0xd634('0x0'));var util=require(_0xd634('0x1'));var moment=require('moment');var BPromise=require(_0xd634('0x2'));var rs=require(_0xd634('0x3'));var fs=require('fs');var Redis=require(_0xd634('0x4'));var db=require(_0xd634('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd634('0x6'));var jayson=require(_0xd634('0x7'));var client=jayson[_0xd634('0x8')][_0xd634('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38fe3b,_0x1e2d9a,_0x576e5d){return new BPromise(function(_0x1017c8,_0x41732e){return client[_0xd634('0xa')](_0x38fe3b,_0x576e5d)[_0xd634('0xb')](function(_0x5c889a){logger[_0xd634('0xc')](_0xd634('0xd'),_0x1e2d9a,'request\x20sent');logger[_0xd634('0xe')](_0xd634('0xf'),_0x1e2d9a,_0xd634('0x10'),JSON[_0xd634('0x11')](_0x5c889a));if(_0x5c889a[_0xd634('0x12')]){if(_0x5c889a[_0xd634('0x12')][_0xd634('0x13')]===0x1f4){logger['error'](_0xd634('0xd'),_0x1e2d9a,_0x5c889a[_0xd634('0x12')][_0xd634('0x14')]);return _0x41732e(_0x5c889a[_0xd634('0x12')][_0xd634('0x14')]);}logger[_0xd634('0x12')]('SquareMessage,\x20%s,\x20%s',_0x1e2d9a,_0x5c889a[_0xd634('0x12')]['message']);return _0x1017c8(_0x5c889a['error'][_0xd634('0x14')]);}else{logger[_0xd634('0xc')](_0xd634('0xd'),_0x1e2d9a,_0xd634('0x10'));_0x1017c8(_0x5c889a['result'][_0xd634('0x14')]);}})[_0xd634('0x15')](function(_0x119ad3){logger[_0xd634('0x12')]('SquareMessage,\x20%s,\x20%s',_0x1e2d9a,_0x119ad3);_0x41732e(_0x119ad3);});});}exports[_0xd634('0x16')]=function(_0x531224){var _0x4206d5=this;return new Promise(function(_0x550140,_0x1e41cc){return db[_0xd634('0x17')][_0xd634('0x18')](_0x531224[_0xd634('0x19')],{'raw':_0x531224['options']?_0x531224['options'][_0xd634('0x1a')]===undefined?!![]:![]:!![]})[_0xd634('0xb')](function(_0x5b845b){logger[_0xd634('0xc')](_0xd634('0x16'),_0x531224);logger[_0xd634('0xe')]('CreateSquareMessage',_0x531224,JSON[_0xd634('0x11')](_0x5b845b));_0x550140(_0x5b845b);})[_0xd634('0x15')](function(_0x306bb8){logger[_0xd634('0x12')](_0xd634('0x16'),_0x306bb8[_0xd634('0x14')],_0x531224);_0x1e41cc(_0x4206d5['error'](0x1f4,_0x306bb8['message']));});});}; \ No newline at end of file +var _0xc202=['../../config/utils','rpc','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','create','options','raw','CreateSquareMessage','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22f88a,_0xf5e068){var _0x7c0bd8=function(_0x4c4a16){while(--_0x4c4a16){_0x22f88a['push'](_0x22f88a['shift']());}};_0x7c0bd8(++_0xf5e068);}(_0xc202,0xba));var _0x2c20=function(_0x28e309,_0x3beb26){_0x28e309=_0x28e309-0x0;var _0x585e0f=_0xc202[_0x28e309];return _0x585e0f;};'use strict';var _=require('lodash');var util=require(_0x2c20('0x0'));var moment=require(_0x2c20('0x1'));var BPromise=require(_0x2c20('0x2'));var rs=require(_0x2c20('0x3'));var fs=require('fs');var Redis=require(_0x2c20('0x4'));var db=require(_0x2c20('0x5'))['db'];var utils=require(_0x2c20('0x6'));var logger=require('../../config/logger')(_0x2c20('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c20('0x8'));var client=jayson[_0x2c20('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13fe76,_0x1fa388,_0x1d8e3a){return new BPromise(function(_0x334f4b,_0x28e876){return client['request'](_0x13fe76,_0x1d8e3a)[_0x2c20('0xa')](function(_0x57cf68){logger[_0x2c20('0xb')](_0x2c20('0xc'),_0x1fa388,_0x2c20('0xd'));logger[_0x2c20('0xe')](_0x2c20('0xf'),_0x1fa388,'request\x20sent',JSON[_0x2c20('0x10')](_0x57cf68));if(_0x57cf68[_0x2c20('0x11')]){if(_0x57cf68[_0x2c20('0x11')]['code']===0x1f4){logger[_0x2c20('0x11')](_0x2c20('0xc'),_0x1fa388,_0x57cf68[_0x2c20('0x11')]['message']);return _0x28e876(_0x57cf68[_0x2c20('0x11')][_0x2c20('0x12')]);}logger[_0x2c20('0x11')](_0x2c20('0xc'),_0x1fa388,_0x57cf68[_0x2c20('0x11')][_0x2c20('0x12')]);return _0x334f4b(_0x57cf68['error']['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x1fa388,_0x2c20('0xd'));_0x334f4b(_0x57cf68['result']['message']);}})['catch'](function(_0x10e9f7){logger['error'](_0x2c20('0xc'),_0x1fa388,_0x10e9f7);_0x28e876(_0x10e9f7);});});}exports['CreateSquareMessage']=function(_0x43335b){var _0x34b6bb=this;return new Promise(function(_0x493cbe,_0x1c88fa){return db['SquareMessage'][_0x2c20('0x13')](_0x43335b['body'],{'raw':_0x43335b[_0x2c20('0x14')]?_0x43335b[_0x2c20('0x14')][_0x2c20('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x18de4d){logger[_0x2c20('0xb')](_0x2c20('0x16'),_0x43335b);logger[_0x2c20('0xe')](_0x2c20('0x16'),_0x43335b,JSON['stringify'](_0x18de4d));_0x493cbe(_0x18de4d);})[_0x2c20('0x17')](function(_0x1132d3){logger['error']('CreateSquareMessage',_0x1132d3[_0x2c20('0x12')],_0x43335b);_0x1c88fa(_0x34b6bb['error'](0x1f4,_0x1132d3[_0x2c20('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index bce3727..290f02e 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 _0x946a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','isAuthenticated','show','/:id/test','15s','test','create','put','destroy','path'];(function(_0x31b90f,_0x35ef73){var _0x15653b=function(_0x3b992f){while(--_0x3b992f){_0x31b90f['push'](_0x31b90f['shift']());}};_0x15653b(++_0x35ef73);}(_0x946a,0xe3));var _0xa946=function(_0x4152c4,_0x3cc091){_0x4152c4=_0x4152c4-0x0;var _0xc6d75a=_0x946a[_0x4152c4];return _0xc6d75a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa946('0x0'));var timeout=require(_0xa946('0x1'));var express=require('express');var router=express[_0xa946('0x2')]();var fs_extra=require(_0xa946('0x3'));var auth=require(_0xa946('0x4'));var interaction=require(_0xa946('0x5'));var config=require(_0xa946('0x6'));var controller=require(_0xa946('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa946('0x8')]);router[_0xa946('0x9')](_0xa946('0xa'),auth[_0xa946('0xb')](),controller[_0xa946('0xc')]);router[_0xa946('0x9')](_0xa946('0xd'),auth[_0xa946('0xb')](),timeout(_0xa946('0xe')),controller[_0xa946('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa946('0x10')]);router[_0xa946('0x11')](_0xa946('0xa'),auth[_0xa946('0xb')](),controller['update']);router['delete'](_0xa946('0xa'),auth[_0xa946('0xb')](),controller[_0xa946('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2d66=['15s','test','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','/:id/test'];(function(_0x592df2,_0x58a88b){var _0x312088=function(_0x114dc8){while(--_0x114dc8){_0x592df2['push'](_0x592df2['shift']());}};_0x312088(++_0x58a88b);}(_0x2d66,0xf0));var _0x62d6=function(_0x1c715b,_0x5eb2d6){_0x1c715b=_0x1c715b-0x0;var _0x4e9988=_0x2d66[_0x1c715b];return _0x4e9988;};'use strict';var multer=require(_0x62d6('0x0'));var util=require(_0x62d6('0x1'));var path=require(_0x62d6('0x2'));var timeout=require(_0x62d6('0x3'));var express=require(_0x62d6('0x4'));var router=express[_0x62d6('0x5')]();var fs_extra=require(_0x62d6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x62d6('0x7'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x62d6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x62d6('0x8')](_0x62d6('0x9'),auth[_0x62d6('0xa')](),controller['show']);router[_0x62d6('0x8')](_0x62d6('0xb'),auth['isAuthenticated'](),timeout(_0x62d6('0xc')),controller[_0x62d6('0xd')]);router[_0x62d6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x62d6('0xf')]('/:id',auth[_0x62d6('0xa')](),controller['update']);router['delete'](_0x62d6('0x9'),auth[_0x62d6('0xa')](),controller[_0x62d6('0x10')]);module[_0x62d6('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 498a355..0acf764 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 _0x889d=['name','sequelize','exports','STRING'];(function(_0x2167c4,_0x3f2467){var _0x424dd0=function(_0x1a09cb){while(--_0x1a09cb){_0x2167c4['push'](_0x2167c4['shift']());}};_0x424dd0(++_0x3f2467);}(_0x889d,0x8d));var _0xd889=function(_0x2a4e92,_0x4c19d6){_0x2a4e92=_0x2a4e92-0x0;var _0x5964ab=_0x889d[_0x2a4e92];return _0x5964ab;};'use strict';var Sequelize=require(_0xd889('0x0'));module[_0xd889('0x1')]={'name':{'type':Sequelize[_0xd889('0x2')],'unique':_0xd889('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd889('0x2')]},'description':{'type':Sequelize[_0xd889('0x2')]}}; \ No newline at end of file +var _0x6ebe=['sequelize','exports','STRING','name'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x6ebe,0x13c));var _0xe6eb=function(_0x49d352,_0x2fa521){_0x49d352=_0x49d352-0x0;var _0x1fdb44=_0x6ebe[_0x49d352];return _0x1fdb44;};'use strict';var Sequelize=require(_0xe6eb('0x0'));module[_0xe6eb('0x1')]={'name':{'type':Sequelize[_0xe6eb('0x2')],'unique':_0xe6eb('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe6eb('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 1f57371..5a495d8 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 _0xddb2=['end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','ODBC','UserProfileResource','stack','index','map','SquareOdbc','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','test','dsn','odbc','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x30db36,_0x149fa8){var _0x3f8e3=function(_0x26cfa1){while(--_0x26cfa1){_0x30db36['push'](_0x30db36['shift']());}};_0x3f8e3(++_0x149fa8);}(_0xddb2,0x195));var _0x2ddb=function(_0x150497,_0x3e3412){_0x150497=_0x150497-0x0;var _0x1d057a=_0xddb2[_0x150497];return _0x1d057a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ddb('0x0'));var zipdir=require(_0x2ddb('0x1'));var jsonpatch=require(_0x2ddb('0x2'));var rp=require(_0x2ddb('0x3'));var moment=require(_0x2ddb('0x4'));var BPromise=require(_0x2ddb('0x5'));var Mustache=require(_0x2ddb('0x6'));var util=require(_0x2ddb('0x7'));var path=require('path');var sox=require(_0x2ddb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ddb('0x9'));var _=require(_0x2ddb('0xa'));var squel=require(_0x2ddb('0xb'));var crypto=require(_0x2ddb('0xc'));var jsforce=require(_0x2ddb('0xd'));var deskjs=require(_0x2ddb('0xe'));var toCsv=require(_0x2ddb('0xf'));var querystring=require(_0x2ddb('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ddb('0x11'));var authService=require(_0x2ddb('0x12'));var qs=require(_0x2ddb('0x13'));var as=require(_0x2ddb('0x14'));var hardwareService=require(_0x2ddb('0x15'));var logger=require(_0x2ddb('0x16'))(_0x2ddb('0x17'));var utils=require(_0x2ddb('0x18'));var config=require(_0x2ddb('0x19'));var licenseUtil=require(_0x2ddb('0x1a'));var db=require(_0x2ddb('0x1b'))['db'];function respondWithStatusCode(_0x28970b,_0x4af57c){_0x4af57c=_0x4af57c||0xcc;return function(_0x4a501f){if(_0x4a501f){return _0x28970b[_0x2ddb('0x1c')](_0x4af57c);}return _0x28970b[_0x2ddb('0x1d')](_0x4af57c)[_0x2ddb('0x1e')]();};}function respondWithResult(_0x187da8,_0x1e3f0f){_0x1e3f0f=_0x1e3f0f||0xc8;return function(_0x25f6d4){if(_0x25f6d4){return _0x187da8[_0x2ddb('0x1d')](_0x1e3f0f)[_0x2ddb('0x1f')](_0x25f6d4);}};}function respondWithFilteredResult(_0x505c09,_0x4410f3){return function(_0x2bde97){if(_0x2bde97){var _0x269402=typeof _0x4410f3[_0x2ddb('0x20')]===_0x2ddb('0x21')&&typeof _0x4410f3[_0x2ddb('0x22')]===_0x2ddb('0x21');var _0x19e3aa=_0x2bde97[_0x2ddb('0x23')];var _0x2f4d98=_0x269402?0x0:_0x4410f3['offset'];var _0xe7b7a7=_0x269402?_0x2bde97[_0x2ddb('0x23')]:_0x4410f3['offset']+_0x4410f3[_0x2ddb('0x22')];var _0x52c457;if(_0xe7b7a7>=_0x19e3aa){_0xe7b7a7=_0x19e3aa;_0x52c457=0xc8;}else{_0x52c457=0xce;}_0x505c09[_0x2ddb('0x1d')](_0x52c457);return _0x505c09['set'](_0x2ddb('0x24'),_0x2f4d98+'-'+_0xe7b7a7+'/'+_0x19e3aa)['json'](_0x2bde97);}return null;};}function patchUpdates(_0x292f4e){return function(_0x37bbc9){try{jsonpatch['apply'](_0x37bbc9,_0x292f4e,!![]);}catch(_0x525838){return BPromise[_0x2ddb('0x25')](_0x525838);}return _0x37bbc9['save']();};}function saveUpdates(_0x35dbd2,_0x26c45c){return function(_0x359d86){if(_0x359d86){return _0x359d86['update'](_0x35dbd2)[_0x2ddb('0x26')](function(_0x221f76){return _0x221f76;});}return null;};}function removeEntity(_0x56fe12,_0x49cf76){return function(_0x1febb){if(_0x1febb){return _0x1febb[_0x2ddb('0x27')]()[_0x2ddb('0x26')](function(){var _0x57626a=_0x1febb[_0x2ddb('0x28')]({'plain':!![]});var _0x4f9978=_0x2ddb('0x29');return db[_0x2ddb('0x2a')][_0x2ddb('0x27')]({'where':{'type':_0x4f9978,'resourceId':_0x57626a['id']}})['then'](function(){return _0x1febb;});})[_0x2ddb('0x26')](function(){_0x56fe12[_0x2ddb('0x1d')](0xcc)[_0x2ddb('0x1e')]();});}};}function handleEntityNotFound(_0xc868d2,_0x44847d){return function(_0x2944a9){if(!_0x2944a9){_0xc868d2[_0x2ddb('0x1c')](0x194);}return _0x2944a9;};}function handleError(_0x3d5170,_0x34fc1c){_0x34fc1c=_0x34fc1c||0x1f4;return function(_0xcbcadc){logger['error'](_0xcbcadc[_0x2ddb('0x2b')]);if(_0xcbcadc['name']){delete _0xcbcadc['name'];}_0x3d5170['status'](_0x34fc1c)['send'](_0xcbcadc);};}exports[_0x2ddb('0x2c')]=function(_0x276e37,_0x421af2){var _0x4e0010={},_0x3aea23={},_0x21b55f={'count':0x0,'rows':[]};var _0x34542b=_[_0x2ddb('0x2d')](db[_0x2ddb('0x2e')]['rawAttributes'],function(_0x37ecb4){return{'name':_0x37ecb4['fieldName'],'type':_0x37ecb4[_0x2ddb('0x2f')]['key']};});_0x3aea23[_0x2ddb('0x30')]=_[_0x2ddb('0x2d')](_0x34542b,_0x2ddb('0x31'));_0x3aea23[_0x2ddb('0x32')]=_[_0x2ddb('0x33')](_0x276e37[_0x2ddb('0x32')]);_0x3aea23[_0x2ddb('0x34')]=_[_0x2ddb('0x35')](_0x3aea23[_0x2ddb('0x30')],_0x3aea23['query']);_0x4e0010['attributes']=_[_0x2ddb('0x35')](_0x3aea23[_0x2ddb('0x30')],qs[_0x2ddb('0x36')](_0x276e37['query'][_0x2ddb('0x36')]));_0x4e0010['attributes']=_0x4e0010[_0x2ddb('0x37')][_0x2ddb('0x38')]?_0x4e0010['attributes']:_0x3aea23[_0x2ddb('0x30')];if(!_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x39')](_0x2ddb('0x3a'))){_0x4e0010[_0x2ddb('0x22')]=qs[_0x2ddb('0x22')](_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x22')]);_0x4e0010['offset']=qs['offset'](_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x20')]);}_0x4e0010[_0x2ddb('0x3b')]=qs[_0x2ddb('0x3c')](_0x276e37['query']['sort']);_0x4e0010[_0x2ddb('0x3d')]=qs['filters'](_['pick'](_0x276e37[_0x2ddb('0x32')],_0x3aea23[_0x2ddb('0x34')]),_0x34542b);if(_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x3e')]){_0x4e0010[_0x2ddb('0x3d')]=_['merge'](_0x4e0010[_0x2ddb('0x3d')],{'$or':_['map'](_0x34542b,function(_0x13775e){if(_0x13775e[_0x2ddb('0x2f')]!==_0x2ddb('0x3f')){var _0x4ff1b7={};_0x4ff1b7[_0x13775e[_0x2ddb('0x31')]]={'$like':'%'+_0x276e37[_0x2ddb('0x32')][_0x2ddb('0x3e')]+'%'};return _0x4ff1b7;}})});}_0x4e0010=_[_0x2ddb('0x40')]({},_0x4e0010,_0x276e37['options']);var _0x32e618={'where':_0x4e0010[_0x2ddb('0x3d')]};return db['SquareOdbc'][_0x2ddb('0x23')](_0x32e618)[_0x2ddb('0x26')](function(_0x52b9d5){_0x21b55f[_0x2ddb('0x23')]=_0x52b9d5;if(_0x276e37['query'][_0x2ddb('0x41')]){_0x4e0010[_0x2ddb('0x42')]=[{'all':!![]}];}return db[_0x2ddb('0x2e')][_0x2ddb('0x43')](_0x4e0010);})['then'](function(_0x4975c9){_0x21b55f[_0x2ddb('0x44')]=_0x4975c9;return _0x21b55f;})[_0x2ddb('0x26')](respondWithFilteredResult(_0x421af2,_0x4e0010))[_0x2ddb('0x45')](handleError(_0x421af2,null));};exports[_0x2ddb('0x46')]=function(_0x232caf,_0x3bbe5c){var _0x3698dc={'raw':!![],'where':{'id':_0x232caf['params']['id']}},_0x4ce024={};_0x4ce024[_0x2ddb('0x30')]=_[_0x2ddb('0x33')](db['SquareOdbc'][_0x2ddb('0x47')]);_0x4ce024['query']=_['keys'](_0x232caf[_0x2ddb('0x32')]);_0x4ce024[_0x2ddb('0x34')]=_['intersection'](_0x4ce024[_0x2ddb('0x30')],_0x4ce024[_0x2ddb('0x32')]);_0x3698dc[_0x2ddb('0x37')]=_['intersection'](_0x4ce024[_0x2ddb('0x30')],qs['fields'](_0x232caf[_0x2ddb('0x32')][_0x2ddb('0x36')]));_0x3698dc['attributes']=_0x3698dc[_0x2ddb('0x37')]['length']?_0x3698dc['attributes']:_0x4ce024[_0x2ddb('0x30')];if(_0x232caf[_0x2ddb('0x32')]['includeAll']){_0x3698dc[_0x2ddb('0x42')]=[{'all':!![]}];}_0x3698dc=_[_0x2ddb('0x40')]({},_0x3698dc,_0x232caf['options']);return db[_0x2ddb('0x2e')][_0x2ddb('0x48')](_0x3698dc)[_0x2ddb('0x26')](handleEntityNotFound(_0x3bbe5c,null))[_0x2ddb('0x26')](respondWithResult(_0x3bbe5c,null))[_0x2ddb('0x45')](handleError(_0x3bbe5c,null));};exports[_0x2ddb('0x49')]=function(_0x1c73b5,_0x326f9f){return db[_0x2ddb('0x2e')][_0x2ddb('0x49')](_0x1c73b5['body'],{})['then'](function(_0x8831ed){var _0x4fe152=_0x1c73b5[_0x2ddb('0x4a')][_0x2ddb('0x28')]({'plain':!![]});if(!_0x4fe152)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe152[_0x2ddb('0x4b')]===_0x2ddb('0x4a')){var _0x6169b0=_0x8831ed[_0x2ddb('0x28')]({'plain':!![]});var _0x416f97='ODBC';return db[_0x2ddb('0x4c')]['find']({'where':{'name':_0x416f97,'userProfileId':_0x4fe152[_0x2ddb('0x4d')]},'raw':!![]})[_0x2ddb('0x26')](function(_0x44153e){if(_0x44153e&&_0x44153e['autoAssociation']===0x0){return db[_0x2ddb('0x2a')][_0x2ddb('0x49')]({'name':_0x6169b0[_0x2ddb('0x31')],'resourceId':_0x6169b0['id'],'type':_0x44153e['name'],'sectionId':_0x44153e['id']},{})[_0x2ddb('0x26')](function(){return _0x8831ed;});}else{return _0x8831ed;}})['catch'](function(_0x1d86eb){logger[_0x2ddb('0x4e')](_0x2ddb('0x4f'),_0x1d86eb);throw _0x1d86eb;});}return _0x8831ed;})[_0x2ddb('0x26')](respondWithResult(_0x326f9f,0xc9))[_0x2ddb('0x45')](handleError(_0x326f9f,null));};exports[_0x2ddb('0x50')]=function(_0x112314,_0x3967d9){if(_0x112314[_0x2ddb('0x51')]['id']){delete _0x112314[_0x2ddb('0x51')]['id'];}return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0x112314[_0x2ddb('0x52')]['id']}})[_0x2ddb('0x26')](handleEntityNotFound(_0x3967d9,null))[_0x2ddb('0x26')](saveUpdates(_0x112314[_0x2ddb('0x51')],null))[_0x2ddb('0x26')](respondWithResult(_0x3967d9,null))[_0x2ddb('0x45')](handleError(_0x3967d9,null));};exports[_0x2ddb('0x27')]=function(_0xf0b5ee,_0x10d80a){return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0xf0b5ee[_0x2ddb('0x52')]['id']}})[_0x2ddb('0x26')](handleEntityNotFound(_0x10d80a,null))[_0x2ddb('0x26')](removeEntity(_0x10d80a,null))['catch'](handleError(_0x10d80a,null));};exports[_0x2ddb('0x53')]=function(_0x476d05,_0x862035,_0x5e3a06){var _0x56aa3f;return db[_0x2ddb('0x2e')][_0x2ddb('0x48')]({'where':{'id':_0x476d05[_0x2ddb('0x52')]['id']},'attributes':['id',_0x2ddb('0x54')]})['then'](handleEntityNotFound(_0x862035,null))[_0x2ddb('0x26')](function(_0x4e49bb){if(_0x4e49bb){var _0x11bbdb=require(_0x2ddb('0x55'))();_0x11bbdb['openSync'](_0x4e49bb[_0x2ddb('0x54')]);_0x11bbdb[_0x2ddb('0x56')]();return _0x4e49bb;}})[_0x2ddb('0x26')](respondWithResult(_0x862035,null))[_0x2ddb('0x45')](handleError(_0x862035,null));}; \ No newline at end of file +var _0x5446=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','options','count','include','findAll','rows','catch','show','keys','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','dsn','closeSync','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','set','json','reject','save','then','get','ODBC','UserProfileResource','destroy','error','stack','name','index','map','SquareOdbc'];(function(_0x25564e,_0x255dd1){var _0x2458c0=function(_0x7b99fc){while(--_0x7b99fc){_0x25564e['push'](_0x25564e['shift']());}};_0x2458c0(++_0x255dd1);}(_0x5446,0x114));var _0x6544=function(_0x30ad18,_0x5e57f2){_0x30ad18=_0x30ad18-0x0;var _0x5d09a7=_0x5446[_0x30ad18];return _0x5d09a7;};'use strict';var emlformat=require(_0x6544('0x0'));var rimraf=require(_0x6544('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6544('0x2'));var moment=require(_0x6544('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6544('0x4'));var util=require(_0x6544('0x5'));var path=require('path');var sox=require(_0x6544('0x6'));var csv=require('to-csv');var ejs=require(_0x6544('0x7'));var fs=require('fs');var fs_extra=require(_0x6544('0x8'));var _=require(_0x6544('0x9'));var squel=require(_0x6544('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6544('0xb'));var toCsv=require(_0x6544('0xc'));var querystring=require('querystring');var Papa=require(_0x6544('0xd'));var Redis=require('ioredis');var authService=require(_0x6544('0xe'));var qs=require(_0x6544('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6544('0x10'))('api');var utils=require(_0x6544('0x11'));var config=require(_0x6544('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6544('0x13'))['db'];function respondWithStatusCode(_0x40e9e7,_0x266be1){_0x266be1=_0x266be1||0xcc;return function(_0xad2dc2){if(_0xad2dc2){return _0x40e9e7['sendStatus'](_0x266be1);}return _0x40e9e7['status'](_0x266be1)[_0x6544('0x14')]();};}function respondWithResult(_0x8340ef,_0x2d280e){_0x2d280e=_0x2d280e||0xc8;return function(_0x252fa4){if(_0x252fa4){return _0x8340ef[_0x6544('0x15')](_0x2d280e)['json'](_0x252fa4);}};}function respondWithFilteredResult(_0x241136,_0x2989f8){return function(_0x4e543d){if(_0x4e543d){var _0x3c41a1=typeof _0x2989f8[_0x6544('0x16')]===_0x6544('0x17')&&typeof _0x2989f8[_0x6544('0x18')]===_0x6544('0x17');var _0x474076=_0x4e543d['count'];var _0x5d14df=_0x3c41a1?0x0:_0x2989f8[_0x6544('0x16')];var _0x191dc6=_0x3c41a1?_0x4e543d['count']:_0x2989f8[_0x6544('0x16')]+_0x2989f8['limit'];var _0x6f9c50;if(_0x191dc6>=_0x474076){_0x191dc6=_0x474076;_0x6f9c50=0xc8;}else{_0x6f9c50=0xce;}_0x241136[_0x6544('0x15')](_0x6f9c50);return _0x241136[_0x6544('0x19')]('Content-Range',_0x5d14df+'-'+_0x191dc6+'/'+_0x474076)[_0x6544('0x1a')](_0x4e543d);}return null;};}function patchUpdates(_0x25f9f7){return function(_0x244905){try{jsonpatch['apply'](_0x244905,_0x25f9f7,!![]);}catch(_0xd6f5ff){return BPromise[_0x6544('0x1b')](_0xd6f5ff);}return _0x244905[_0x6544('0x1c')]();};}function saveUpdates(_0x2719ca,_0x197efc){return function(_0x4e6439){if(_0x4e6439){return _0x4e6439['update'](_0x2719ca)[_0x6544('0x1d')](function(_0x203ec3){return _0x203ec3;});}return null;};}function removeEntity(_0x448497,_0x20a3c7){return function(_0x2d87b8){if(_0x2d87b8){return _0x2d87b8['destroy']()[_0x6544('0x1d')](function(){var _0x3f3d85=_0x2d87b8[_0x6544('0x1e')]({'plain':!![]});var _0x4b9c0d=_0x6544('0x1f');return db[_0x6544('0x20')][_0x6544('0x21')]({'where':{'type':_0x4b9c0d,'resourceId':_0x3f3d85['id']}})[_0x6544('0x1d')](function(){return _0x2d87b8;});})[_0x6544('0x1d')](function(){_0x448497[_0x6544('0x15')](0xcc)[_0x6544('0x14')]();});}};}function handleEntityNotFound(_0x184708,_0x2bc4b6){return function(_0x30bee7){if(!_0x30bee7){_0x184708['sendStatus'](0x194);}return _0x30bee7;};}function handleError(_0x2ab157,_0x3ec47c){_0x3ec47c=_0x3ec47c||0x1f4;return function(_0x503c37){logger[_0x6544('0x22')](_0x503c37[_0x6544('0x23')]);if(_0x503c37[_0x6544('0x24')]){delete _0x503c37[_0x6544('0x24')];}_0x2ab157[_0x6544('0x15')](_0x3ec47c)['send'](_0x503c37);};}exports[_0x6544('0x25')]=function(_0xda0e7f,_0x360c80){var _0x60495c={},_0x355bf7={},_0x5d8002={'count':0x0,'rows':[]};var _0x19664a=_[_0x6544('0x26')](db[_0x6544('0x27')][_0x6544('0x28')],function(_0x3f7f36){return{'name':_0x3f7f36[_0x6544('0x29')],'type':_0x3f7f36[_0x6544('0x2a')][_0x6544('0x2b')]};});_0x355bf7[_0x6544('0x2c')]=_['map'](_0x19664a,_0x6544('0x24'));_0x355bf7[_0x6544('0x2d')]=_['keys'](_0xda0e7f[_0x6544('0x2d')]);_0x355bf7[_0x6544('0x2e')]=_[_0x6544('0x2f')](_0x355bf7['model'],_0x355bf7[_0x6544('0x2d')]);_0x60495c[_0x6544('0x30')]=_[_0x6544('0x2f')](_0x355bf7[_0x6544('0x2c')],qs[_0x6544('0x31')](_0xda0e7f['query']['fields']));_0x60495c[_0x6544('0x30')]=_0x60495c[_0x6544('0x30')][_0x6544('0x32')]?_0x60495c['attributes']:_0x355bf7[_0x6544('0x2c')];if(!_0xda0e7f[_0x6544('0x2d')]['hasOwnProperty']('nolimit')){_0x60495c['limit']=qs['limit'](_0xda0e7f[_0x6544('0x2d')]['limit']);_0x60495c[_0x6544('0x16')]=qs[_0x6544('0x16')](_0xda0e7f[_0x6544('0x2d')][_0x6544('0x16')]);}_0x60495c[_0x6544('0x33')]=qs[_0x6544('0x34')](_0xda0e7f[_0x6544('0x2d')][_0x6544('0x34')]);_0x60495c[_0x6544('0x35')]=qs['filters'](_['pick'](_0xda0e7f['query'],_0x355bf7[_0x6544('0x2e')]),_0x19664a);if(_0xda0e7f['query'][_0x6544('0x36')]){_0x60495c['where']=_['merge'](_0x60495c[_0x6544('0x35')],{'$or':_[_0x6544('0x26')](_0x19664a,function(_0x2fc739){if(_0x2fc739[_0x6544('0x2a')]!==_0x6544('0x37')){var _0x1bafd4={};_0x1bafd4[_0x2fc739[_0x6544('0x24')]]={'$like':'%'+_0xda0e7f[_0x6544('0x2d')]['filter']+'%'};return _0x1bafd4;}})});}_0x60495c=_['merge']({},_0x60495c,_0xda0e7f[_0x6544('0x38')]);var _0x3c6470={'where':_0x60495c[_0x6544('0x35')]};return db[_0x6544('0x27')][_0x6544('0x39')](_0x3c6470)[_0x6544('0x1d')](function(_0x2ac502){_0x5d8002[_0x6544('0x39')]=_0x2ac502;if(_0xda0e7f[_0x6544('0x2d')]['includeAll']){_0x60495c[_0x6544('0x3a')]=[{'all':!![]}];}return db[_0x6544('0x27')][_0x6544('0x3b')](_0x60495c);})[_0x6544('0x1d')](function(_0x4118c0){_0x5d8002[_0x6544('0x3c')]=_0x4118c0;return _0x5d8002;})[_0x6544('0x1d')](respondWithFilteredResult(_0x360c80,_0x60495c))[_0x6544('0x3d')](handleError(_0x360c80,null));};exports[_0x6544('0x3e')]=function(_0x4f274a,_0x49ce52){var _0x2d090a={'raw':!![],'where':{'id':_0x4f274a['params']['id']}},_0x32847d={};_0x32847d[_0x6544('0x2c')]=_[_0x6544('0x3f')](db[_0x6544('0x27')][_0x6544('0x28')]);_0x32847d['query']=_[_0x6544('0x3f')](_0x4f274a[_0x6544('0x2d')]);_0x32847d['filters']=_[_0x6544('0x2f')](_0x32847d[_0x6544('0x2c')],_0x32847d[_0x6544('0x2d')]);_0x2d090a[_0x6544('0x30')]=_['intersection'](_0x32847d[_0x6544('0x2c')],qs[_0x6544('0x31')](_0x4f274a[_0x6544('0x2d')][_0x6544('0x31')]));_0x2d090a['attributes']=_0x2d090a['attributes'][_0x6544('0x32')]?_0x2d090a[_0x6544('0x30')]:_0x32847d[_0x6544('0x2c')];if(_0x4f274a['query']['includeAll']){_0x2d090a[_0x6544('0x3a')]=[{'all':!![]}];}_0x2d090a=_[_0x6544('0x40')]({},_0x2d090a,_0x4f274a['options']);return db[_0x6544('0x27')][_0x6544('0x41')](_0x2d090a)[_0x6544('0x1d')](handleEntityNotFound(_0x49ce52,null))[_0x6544('0x1d')](respondWithResult(_0x49ce52,null))[_0x6544('0x3d')](handleError(_0x49ce52,null));};exports[_0x6544('0x42')]=function(_0x107648,_0x225d83){return db['SquareOdbc']['create'](_0x107648[_0x6544('0x43')],{})['then'](function(_0x562f59){var _0x474555=_0x107648[_0x6544('0x44')][_0x6544('0x1e')]({'plain':!![]});if(!_0x474555)throw new Error(_0x6544('0x45'));if(_0x474555[_0x6544('0x46')]===_0x6544('0x44')){var _0x209a45=_0x562f59['get']({'plain':!![]});var _0x246eb8='ODBC';return db[_0x6544('0x47')][_0x6544('0x41')]({'where':{'name':_0x246eb8,'userProfileId':_0x474555[_0x6544('0x48')]},'raw':!![]})[_0x6544('0x1d')](function(_0x3f649a){if(_0x3f649a&&_0x3f649a[_0x6544('0x49')]===0x0){return db[_0x6544('0x20')][_0x6544('0x42')]({'name':_0x209a45[_0x6544('0x24')],'resourceId':_0x209a45['id'],'type':_0x3f649a[_0x6544('0x24')],'sectionId':_0x3f649a['id']},{})[_0x6544('0x1d')](function(){return _0x562f59;});}else{return _0x562f59;}})[_0x6544('0x3d')](function(_0x121b38){logger['error'](_0x6544('0x4a'),_0x121b38);throw _0x121b38;});}return _0x562f59;})['then'](respondWithResult(_0x225d83,0xc9))[_0x6544('0x3d')](handleError(_0x225d83,null));};exports[_0x6544('0x4b')]=function(_0x4743fe,_0x30859f){if(_0x4743fe['body']['id']){delete _0x4743fe['body']['id'];}return db[_0x6544('0x27')][_0x6544('0x41')]({'where':{'id':_0x4743fe[_0x6544('0x4c')]['id']}})[_0x6544('0x1d')](handleEntityNotFound(_0x30859f,null))[_0x6544('0x1d')](saveUpdates(_0x4743fe[_0x6544('0x43')],null))['then'](respondWithResult(_0x30859f,null))[_0x6544('0x3d')](handleError(_0x30859f,null));};exports[_0x6544('0x21')]=function(_0x1b3164,_0x21abb7){return db['SquareOdbc'][_0x6544('0x41')]({'where':{'id':_0x1b3164[_0x6544('0x4c')]['id']}})[_0x6544('0x1d')](handleEntityNotFound(_0x21abb7,null))[_0x6544('0x1d')](removeEntity(_0x21abb7,null))[_0x6544('0x3d')](handleError(_0x21abb7,null));};exports['test']=function(_0x3c5433,_0x47ef56,_0x1d5c78){var _0x1903cb;return db[_0x6544('0x27')]['find']({'where':{'id':_0x3c5433['params']['id']},'attributes':['id',_0x6544('0x4d')]})[_0x6544('0x1d')](handleEntityNotFound(_0x47ef56,null))['then'](function(_0x3b205f){if(_0x3b205f){var _0x567ef8=require('odbc')();_0x567ef8['openSync'](_0x3b205f[_0x6544('0x4d')]);_0x567ef8[_0x6544('0x4e')]();return _0x3b205f;}})['then'](respondWithResult(_0x47ef56,null))['catch'](handleError(_0x47ef56,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index b4d3cfe..0553f2e 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 _0xf01e=['moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util','../../config/logger'];(function(_0x390e5c,_0x8b8d52){var _0x2cd34a=function(_0x1774a4){while(--_0x1774a4){_0x390e5c['push'](_0x390e5c['shift']());}};_0x2cd34a(++_0x8b8d52);}(_0xf01e,0xd6));var _0xef01=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xf01e[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var util=require(_0xef01('0x0'));var logger=require(_0xef01('0x1'))('api');var moment=require(_0xef01('0x2'));var BPromise=require('bluebird');var rp=require(_0xef01('0x3'));var fs=require('fs');var path=require(_0xef01('0x4'));var rimraf=require(_0xef01('0x5'));var config=require(_0xef01('0x6'));var attributes=require(_0xef01('0x7'));module[_0xef01('0x8')]=function(_0x2d2829,_0x2c7e8f){return _0x2d2829[_0xef01('0x9')](_0xef01('0xa'),attributes,{'tableName':_0xef01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42f6=['define','SquareOdbc','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2f20b6,_0x1405b6){var _0x4b7b09=function(_0x2d5f06){while(--_0x2d5f06){_0x2f20b6['push'](_0x2f20b6['shift']());}};_0x4b7b09(++_0x1405b6);}(_0x42f6,0x1a4));var _0x642f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x42f6[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x642f('0x0'));var logger=require(_0x642f('0x1'))(_0x642f('0x2'));var moment=require('moment');var BPromise=require(_0x642f('0x3'));var rp=require(_0x642f('0x4'));var fs=require('fs');var path=require(_0x642f('0x5'));var rimraf=require(_0x642f('0x6'));var config=require(_0x642f('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x642f('0x8')]=function(_0x3ee567,_0x2e921b){return _0x3ee567[_0x642f('0x9')](_0x642f('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 8d514e6..c57fa7e 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 _0x84aa=['options','where','attributes','map','include','model','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','ShowSquareOdbc','find'];(function(_0x46becd,_0xd3cf52){var _0x4ebe1d=function(_0x49963a){while(--_0x49963a){_0x46becd['push'](_0x46becd['shift']());}};_0x4ebe1d(++_0xd3cf52);}(_0x84aa,0xc8));var _0xa84a=function(_0x34babd,_0x5f1cba){_0x34babd=_0x34babd-0x0;var _0x9faa8a=_0x84aa[_0x34babd];return _0x9faa8a;};'use strict';var _=require(_0xa84a('0x0'));var util=require(_0xa84a('0x1'));var moment=require('moment');var BPromise=require(_0xa84a('0x2'));var rs=require(_0xa84a('0x3'));var fs=require('fs');var Redis=require(_0xa84a('0x4'));var db=require(_0xa84a('0x5'))['db'];var utils=require(_0xa84a('0x6'));var logger=require(_0xa84a('0x7'))(_0xa84a('0x8'));var config=require(_0xa84a('0x9'));var jayson=require(_0xa84a('0xa'));var client=jayson[_0xa84a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e75ec,_0x38f783,_0x2e37d4){return new BPromise(function(_0x33499d,_0x5739ad){return client[_0xa84a('0xc')](_0x3e75ec,_0x2e37d4)['then'](function(_0x595361){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x38f783,_0xa84a('0xd'));logger[_0xa84a('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x38f783,_0xa84a('0xd'),JSON[_0xa84a('0xf')](_0x595361));if(_0x595361['error']){if(_0x595361[_0xa84a('0x10')][_0xa84a('0x11')]===0x1f4){logger[_0xa84a('0x10')](_0xa84a('0x12'),_0x38f783,_0x595361[_0xa84a('0x10')][_0xa84a('0x13')]);return _0x5739ad(_0x595361['error'][_0xa84a('0x13')]);}logger['error'](_0xa84a('0x12'),_0x38f783,_0x595361['error'][_0xa84a('0x13')]);return _0x33499d(_0x595361[_0xa84a('0x10')][_0xa84a('0x13')]);}else{logger[_0xa84a('0x14')](_0xa84a('0x12'),_0x38f783,_0xa84a('0xd'));_0x33499d(_0x595361[_0xa84a('0x15')][_0xa84a('0x13')]);}})['catch'](function(_0x15e0f7){logger[_0xa84a('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x38f783,_0x15e0f7);_0x5739ad(_0x15e0f7);});});}exports[_0xa84a('0x16')]=function(_0x5f5dc5){var _0xddc002=this;return new Promise(function(_0x5c4887,_0x5a99ac){return db['SquareOdbc'][_0xa84a('0x17')]({'raw':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5[_0xa84a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5['options'][_0xa84a('0x19')]||null:null,'attributes':_0x5f5dc5['options']?_0x5f5dc5[_0xa84a('0x18')][_0xa84a('0x1a')]||null:null,'include':_0x5f5dc5[_0xa84a('0x18')]?_0x5f5dc5[_0xa84a('0x18')]['include']?_[_0xa84a('0x1b')](_0x5f5dc5[_0xa84a('0x18')][_0xa84a('0x1c')],function(_0x750cdc){return{'model':db[_0x750cdc[_0xa84a('0x1d')]],'as':_0x750cdc['as'],'attributes':_0x750cdc['attributes'],'include':_0x750cdc[_0xa84a('0x1c')]?_[_0xa84a('0x1b')](_0x750cdc[_0xa84a('0x1c')],function(_0x563290){return{'model':db[_0x563290[_0xa84a('0x1d')]],'as':_0x563290['as'],'attributes':_0x563290[_0xa84a('0x1a')],'include':_0x563290[_0xa84a('0x1c')]?_['map'](_0x563290[_0xa84a('0x1c')],function(_0x400986){return{'model':db[_0x400986[_0xa84a('0x1d')]],'as':_0x400986['as'],'attributes':_0x400986[_0xa84a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa84a('0x1e')](function(_0x274d7d){logger[_0xa84a('0x14')]('ShowSquareOdbc',_0x5f5dc5);logger[_0xa84a('0xe')](_0xa84a('0x16'),_0x5f5dc5,JSON[_0xa84a('0xf')](_0x274d7d));_0x5c4887(_0x274d7d);})[_0xa84a('0x1f')](function(_0x2a7f97){logger[_0xa84a('0x10')](_0xa84a('0x16'),_0x2a7f97[_0xa84a('0x13')],_0x5f5dc5);_0x5a99ac(_0xddc002[_0xa84a('0x10')](0x1f4,_0x2a7f97[_0xa84a('0x13')]));});});}; \ No newline at end of file +var _0xb1e7=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','ShowSquareOdbc','SquareOdbc','find','raw','options','attributes','map','include','model','then','debug','lodash','bluebird','ioredis'];(function(_0xea4457,_0x2eea4c){var _0xd07521=function(_0xf902d4){while(--_0xf902d4){_0xea4457['push'](_0xea4457['shift']());}};_0xd07521(++_0x2eea4c);}(_0xb1e7,0x1cd));var _0x7b1e=function(_0x7671bc,_0x171145){_0x7671bc=_0x7671bc-0x0;var _0x55229f=_0xb1e7[_0x7671bc];return _0x55229f;};'use strict';var _=require(_0x7b1e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b1e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b1e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b1e('0x3'));var logger=require(_0x7b1e('0x4'))(_0x7b1e('0x5'));var config=require('../../config/environment');var jayson=require(_0x7b1e('0x6'));var client=jayson[_0x7b1e('0x7')][_0x7b1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ce50f,_0x50de19,_0x37fbac){return new BPromise(function(_0x2510c0,_0x342987){return client[_0x7b1e('0x9')](_0x7ce50f,_0x37fbac)['then'](function(_0x55e0ed){logger[_0x7b1e('0xa')](_0x7b1e('0xb'),_0x50de19,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x50de19,'request\x20sent',JSON[_0x7b1e('0xc')](_0x55e0ed));if(_0x55e0ed['error']){if(_0x55e0ed['error'][_0x7b1e('0xd')]===0x1f4){logger[_0x7b1e('0xe')](_0x7b1e('0xb'),_0x50de19,_0x55e0ed['error']['message']);return _0x342987(_0x55e0ed[_0x7b1e('0xe')]['message']);}logger[_0x7b1e('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x50de19,_0x55e0ed[_0x7b1e('0xe')][_0x7b1e('0xf')]);return _0x2510c0(_0x55e0ed[_0x7b1e('0xe')][_0x7b1e('0xf')]);}else{logger[_0x7b1e('0xa')](_0x7b1e('0xb'),_0x50de19,_0x7b1e('0x10'));_0x2510c0(_0x55e0ed[_0x7b1e('0x11')][_0x7b1e('0xf')]);}})['catch'](function(_0x5a8ba2){logger[_0x7b1e('0xe')](_0x7b1e('0xb'),_0x50de19,_0x5a8ba2);_0x342987(_0x5a8ba2);});});}exports[_0x7b1e('0x12')]=function(_0x338d1a){var _0x506d11=this;return new Promise(function(_0x34c3a3,_0x3b7909){return db[_0x7b1e('0x13')][_0x7b1e('0x14')]({'raw':_0x338d1a['options']?_0x338d1a['options'][_0x7b1e('0x15')]===undefined?!![]:![]:!![],'where':_0x338d1a[_0x7b1e('0x16')]?_0x338d1a[_0x7b1e('0x16')]['where']||null:null,'attributes':_0x338d1a['options']?_0x338d1a[_0x7b1e('0x16')][_0x7b1e('0x17')]||null:null,'include':_0x338d1a['options']?_0x338d1a[_0x7b1e('0x16')]['include']?_[_0x7b1e('0x18')](_0x338d1a[_0x7b1e('0x16')][_0x7b1e('0x19')],function(_0xdda134){return{'model':db[_0xdda134[_0x7b1e('0x1a')]],'as':_0xdda134['as'],'attributes':_0xdda134[_0x7b1e('0x17')],'include':_0xdda134[_0x7b1e('0x19')]?_[_0x7b1e('0x18')](_0xdda134[_0x7b1e('0x19')],function(_0x4fc5a4){return{'model':db[_0x4fc5a4[_0x7b1e('0x1a')]],'as':_0x4fc5a4['as'],'attributes':_0x4fc5a4['attributes'],'include':_0x4fc5a4['include']?_[_0x7b1e('0x18')](_0x4fc5a4[_0x7b1e('0x19')],function(_0x525bda){return{'model':db[_0x525bda[_0x7b1e('0x1a')]],'as':_0x525bda['as'],'attributes':_0x525bda[_0x7b1e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7b1e('0x1b')](function(_0x140ada){logger[_0x7b1e('0xa')](_0x7b1e('0x12'),_0x338d1a);logger[_0x7b1e('0x1c')](_0x7b1e('0x12'),_0x338d1a,JSON[_0x7b1e('0xc')](_0x140ada));_0x34c3a3(_0x140ada);})['catch'](function(_0x3ff8be){logger[_0x7b1e('0xe')](_0x7b1e('0x12'),_0x3ff8be[_0x7b1e('0xf')],_0x338d1a);_0x3b7909(_0x506d11['error'](0x1f4,_0x3ff8be['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index b37d7bb..ae322bf 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 _0xca73=['/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','removeUsers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x45094e,_0xe85c5a){var _0x4a8e9f=function(_0x2fb2f0){while(--_0x2fb2f0){_0x45094e['push'](_0x45094e['shift']());}};_0x4a8e9f(++_0xe85c5a);}(_0xca73,0x1ee));var _0x3ca7=function(_0x1b1e67,_0x16b059){_0x1b1e67=_0x1b1e67-0x0;var _0x5b63d2=_0xca73[_0x1b1e67];return _0x5b63d2;};'use strict';var multer=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var path=require('path');var timeout=require(_0x3ca7('0x2'));var express=require(_0x3ca7('0x3'));var router=express[_0x3ca7('0x4')]();var fs_extra=require(_0x3ca7('0x5'));var auth=require(_0x3ca7('0x6'));var interaction=require(_0x3ca7('0x7'));var config=require(_0x3ca7('0x8'));var controller=require(_0x3ca7('0x9'));router[_0x3ca7('0xa')]('/',auth[_0x3ca7('0xb')](),controller['index']);router[_0x3ca7('0xa')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0xd')]);router[_0x3ca7('0xa')](_0x3ca7('0xe'),auth['isAuthenticated'](),controller[_0x3ca7('0xf')]);router[_0x3ca7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3ca7('0x10')](_0x3ca7('0xe'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x11')]);router[_0x3ca7('0x12')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x13')]);router[_0x3ca7('0x14')](_0x3ca7('0xc'),auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x15')]);router[_0x3ca7('0x14')]('/:id/users',auth[_0x3ca7('0xb')](),controller[_0x3ca7('0x16')]);module['exports']=router; \ No newline at end of file +var _0x51c5=['addUsers','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post'];(function(_0x12cbd8,_0x8ef0ce){var _0x2fb1ab=function(_0x57242c){while(--_0x57242c){_0x12cbd8['push'](_0x12cbd8['shift']());}};_0x2fb1ab(++_0x8ef0ce);}(_0x51c5,0x8f));var _0x551c=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x51c5[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var path=require(_0x551c('0x2'));var timeout=require(_0x551c('0x3'));var express=require(_0x551c('0x4'));var router=express[_0x551c('0x5')]();var fs_extra=require(_0x551c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x551c('0x7'));var config=require(_0x551c('0x8'));var controller=require(_0x551c('0x9'));router[_0x551c('0xa')]('/',auth[_0x551c('0xb')](),controller[_0x551c('0xc')]);router[_0x551c('0xa')](_0x551c('0xd'),auth['isAuthenticated'](),controller[_0x551c('0xe')]);router[_0x551c('0xa')](_0x551c('0xf'),auth['isAuthenticated'](),controller[_0x551c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x551c('0x11')]('/:id/users',auth[_0x551c('0xb')](),controller[_0x551c('0x12')]);router[_0x551c('0x13')](_0x551c('0xd'),auth[_0x551c('0xb')](),controller[_0x551c('0x14')]);router['delete'](_0x551c('0xd'),auth[_0x551c('0xb')](),controller[_0x551c('0x15')]);router['delete'](_0x551c('0xf'),auth[_0x551c('0xb')](),controller['removeUsers']);module[_0x551c('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2e97a81..ab940aa 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 _0x43d9=['name','STRING','BLOB','preproduction','getDataValue','toString','utf8','long','production','DATE','sequelize','exports'];(function(_0x216c8b,_0x7ab61){var _0xbc362c=function(_0x27418b){while(--_0x27418b){_0x216c8b['push'](_0x216c8b['shift']());}};_0xbc362c(++_0x7ab61);}(_0x43d9,0x17e));var _0x943d=function(_0x42be41,_0x108a41){_0x42be41=_0x42be41-0x0;var _0x23cc4a=_0x43d9[_0x42be41];return _0x23cc4a;};'use strict';var Sequelize=require(_0x943d('0x0'));module[_0x943d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x943d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x943d('0x3')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x943d('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x943d('0x5'))){return this[_0x943d('0x6')](_0x943d('0x5'))[_0x943d('0x7')](_0x943d('0x8'));}}},'production':{'type':Sequelize[_0x943d('0x4')](_0x943d('0x9')),'get':function(){if(this[_0x943d('0x6')](_0x943d('0xa'))){return this[_0x943d('0x6')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x943d('0xb')]},'publishedAt':{'type':Sequelize[_0x943d('0xb')]}}; \ No newline at end of file +var _0x1198=['toString','utf8','production','DATE','sequelize','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x3e16b2,_0x460858){var _0x20ce48=function(_0x1d343a){while(--_0x1d343a){_0x3e16b2['push'](_0x3e16b2['shift']());}};_0x20ce48(++_0x460858);}(_0x1198,0x1b4));var _0x8119=function(_0x3bac9c,_0x5f5beb){_0x3bac9c=_0x3bac9c-0x0;var _0x58611e=_0x1198[_0x3bac9c];return _0x58611e;};'use strict';var Sequelize=require(_0x8119('0x0'));module['exports']={'name':{'type':Sequelize[_0x8119('0x1')],'unique':_0x8119('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x8119('0x3')]},'preproduction':{'type':Sequelize[_0x8119('0x4')](_0x8119('0x5')),'get':function(){if(this[_0x8119('0x6')]('preproduction')){return this[_0x8119('0x6')](_0x8119('0x7'))[_0x8119('0x8')](_0x8119('0x9'));}}},'production':{'type':Sequelize[_0x8119('0x4')](_0x8119('0x5')),'get':function(){if(this[_0x8119('0x6')](_0x8119('0xa'))){return this[_0x8119('0x6')]('production')['toString'](_0x8119('0x9'));}}},'savedAt':{'type':Sequelize[_0x8119('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cd032ba..d20d62e 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 _0xe483=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','error','name','SquareProject','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find'];(function(_0x458b57,_0x59514f){var _0x4b8799=function(_0x1c98a6){while(--_0x1c98a6){_0x458b57['push'](_0x458b57['shift']());}};_0x4b8799(++_0x59514f);}(_0xe483,0xd2));var _0x3e48=function(_0x255de9,_0x4ddef8){_0x255de9=_0x255de9-0x0;var _0x2d5bf8=_0xe483[_0x255de9];return _0x2d5bf8;};'use strict';var emlformat=require(_0x3e48('0x0'));var rimraf=require(_0x3e48('0x1'));var zipdir=require(_0x3e48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e48('0x3'));var moment=require(_0x3e48('0x4'));var BPromise=require(_0x3e48('0x5'));var Mustache=require('mustache');var util=require(_0x3e48('0x6'));var path=require(_0x3e48('0x7'));var sox=require(_0x3e48('0x8'));var csv=require(_0x3e48('0x9'));var ejs=require(_0x3e48('0xa'));var fs=require('fs');var fs_extra=require(_0x3e48('0xb'));var _=require('lodash');var squel=require(_0x3e48('0xc'));var crypto=require(_0x3e48('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e48('0x9'));var querystring=require(_0x3e48('0xe'));var Papa=require(_0x3e48('0xf'));var Redis=require('ioredis');var authService=require(_0x3e48('0x10'));var qs=require(_0x3e48('0x11'));var as=require(_0x3e48('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e48('0x13'))(_0x3e48('0x14'));var utils=require(_0x3e48('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e48('0x16'))['db'];config[_0x3e48('0x17')]=_[_0x3e48('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3e48('0x19'))(new Redis(config[_0x3e48('0x17')]));require(_0x3e48('0x1a'))[_0x3e48('0x1b')](socket);function respondWithStatusCode(_0x50b7bb,_0x2d70e0){_0x2d70e0=_0x2d70e0||0xcc;return function(_0x3aee1d){if(_0x3aee1d){return _0x50b7bb[_0x3e48('0x1c')](_0x2d70e0);}return _0x50b7bb[_0x3e48('0x1d')](_0x2d70e0)[_0x3e48('0x1e')]();};}function respondWithResult(_0x1e443f,_0x423c42){_0x423c42=_0x423c42||0xc8;return function(_0x520dd6){if(_0x520dd6){return _0x1e443f[_0x3e48('0x1d')](_0x423c42)[_0x3e48('0x1f')](_0x520dd6);}};}function respondWithFilteredResult(_0x1db514,_0x593595){return function(_0x252948){if(_0x252948){var _0x9816ae=typeof _0x593595[_0x3e48('0x20')]===_0x3e48('0x21')&&typeof _0x593595[_0x3e48('0x22')]==='undefined';var _0x3d1d9e=_0x252948[_0x3e48('0x23')];var _0x4da08a=_0x9816ae?0x0:_0x593595['offset'];var _0x2bf8d7=_0x9816ae?_0x252948[_0x3e48('0x23')]:_0x593595[_0x3e48('0x20')]+_0x593595[_0x3e48('0x22')];var _0x2967e5;if(_0x2bf8d7>=_0x3d1d9e){_0x2bf8d7=_0x3d1d9e;_0x2967e5=0xc8;}else{_0x2967e5=0xce;}_0x1db514['status'](_0x2967e5);return _0x1db514[_0x3e48('0x24')](_0x3e48('0x25'),_0x4da08a+'-'+_0x2bf8d7+'/'+_0x3d1d9e)[_0x3e48('0x1f')](_0x252948);}return null;};}function patchUpdates(_0x4757f9){return function(_0x526dfd){try{jsonpatch[_0x3e48('0x26')](_0x526dfd,_0x4757f9,!![]);}catch(_0x283fbc){return BPromise[_0x3e48('0x27')](_0x283fbc);}return _0x526dfd[_0x3e48('0x28')]();};}function saveUpdates(_0x47e0d2,_0x147f0c){return function(_0x1fff3e){if(_0x1fff3e){return _0x1fff3e['update'](_0x47e0d2)[_0x3e48('0x29')](function(_0x2bafa2){return _0x2bafa2;});}return null;};}function removeEntity(_0x296aff,_0x48694a){return function(_0x820530){if(_0x820530){return _0x820530[_0x3e48('0x2a')]()['then'](function(){var _0x5088a7=_0x820530[_0x3e48('0x2b')]({'plain':!![]});var _0x5b7224=_0x3e48('0x2c');return db[_0x3e48('0x2d')][_0x3e48('0x2a')]({'where':{'type':_0x5b7224,'resourceId':_0x5088a7['id']}})[_0x3e48('0x29')](function(){return _0x820530;});})['then'](function(){_0x296aff[_0x3e48('0x1d')](0xcc)[_0x3e48('0x1e')]();});}};}function handleEntityNotFound(_0x28e178,_0x43de6a){return function(_0x1222b4){if(!_0x1222b4){_0x28e178[_0x3e48('0x1c')](0x194);}return _0x1222b4;};}function handleError(_0x37a543,_0x180c1a){_0x180c1a=_0x180c1a||0x1f4;return function(_0x407da0){logger[_0x3e48('0x2e')](_0x407da0['stack']);if(_0x407da0[_0x3e48('0x2f')]){delete _0x407da0['name'];}_0x37a543['status'](_0x180c1a)['send'](_0x407da0);};}exports['index']=function(_0x512f08,_0x34e261){var _0x32bfe8={},_0x285929={},_0x238e1e={'count':0x0,'rows':[]};var _0xbeef42=_['map'](db[_0x3e48('0x30')][_0x3e48('0x31')],function(_0x32aac5){return{'name':_0x32aac5['fieldName'],'type':_0x32aac5[_0x3e48('0x32')][_0x3e48('0x33')]};});_0x285929[_0x3e48('0x34')]=_['map'](_0xbeef42,_0x3e48('0x2f'));_0x285929['query']=_[_0x3e48('0x35')](_0x512f08[_0x3e48('0x36')]);_0x285929[_0x3e48('0x37')]=_['intersection'](_0x285929[_0x3e48('0x34')],_0x285929[_0x3e48('0x36')]);_0x32bfe8['attributes']=_[_0x3e48('0x38')](_0x285929[_0x3e48('0x34')],qs['fields'](_0x512f08['query'][_0x3e48('0x39')]));_0x32bfe8[_0x3e48('0x3a')]=_0x32bfe8['attributes'][_0x3e48('0x3b')]?_0x32bfe8[_0x3e48('0x3a')]:_0x285929[_0x3e48('0x34')];if(!_0x512f08[_0x3e48('0x36')][_0x3e48('0x3c')](_0x3e48('0x3d'))){_0x32bfe8[_0x3e48('0x22')]=qs[_0x3e48('0x22')](_0x512f08['query'][_0x3e48('0x22')]);_0x32bfe8[_0x3e48('0x20')]=qs[_0x3e48('0x20')](_0x512f08['query'][_0x3e48('0x20')]);}_0x32bfe8['order']=qs[_0x3e48('0x3e')](_0x512f08['query'][_0x3e48('0x3e')]);_0x32bfe8['where']=qs[_0x3e48('0x37')](_[_0x3e48('0x3f')](_0x512f08['query'],_0x285929['filters']),_0xbeef42);if(_0x512f08['query']['filter']){_0x32bfe8[_0x3e48('0x40')]=_[_0x3e48('0x41')](_0x32bfe8[_0x3e48('0x40')],{'$or':_[_0x3e48('0x42')](_0xbeef42,function(_0xad2806){if(_0xad2806[_0x3e48('0x32')]!==_0x3e48('0x43')){var _0x48397b={};_0x48397b[_0xad2806[_0x3e48('0x2f')]]={'$like':'%'+_0x512f08[_0x3e48('0x36')][_0x3e48('0x44')]+'%'};return _0x48397b;}})});}_0x32bfe8=_[_0x3e48('0x41')]({},_0x32bfe8,_0x512f08[_0x3e48('0x45')]);var _0x46fb8e={'where':_0x32bfe8[_0x3e48('0x40')]};return db[_0x3e48('0x30')][_0x3e48('0x23')](_0x46fb8e)[_0x3e48('0x29')](function(_0x7ececc){_0x238e1e[_0x3e48('0x23')]=_0x7ececc;if(_0x512f08[_0x3e48('0x36')][_0x3e48('0x46')]){_0x32bfe8['include']=[{'all':!![]}];}return db[_0x3e48('0x30')][_0x3e48('0x47')](_0x32bfe8);})['then'](function(_0x4dc326){_0x238e1e[_0x3e48('0x48')]=_0x4dc326;return _0x238e1e;})[_0x3e48('0x29')](respondWithFilteredResult(_0x34e261,_0x32bfe8))['catch'](handleError(_0x34e261,null));};exports[_0x3e48('0x49')]=function(_0xffa3de,_0x3c3a20){var _0x194da4={'raw':![],'where':{'id':_0xffa3de[_0x3e48('0x4a')]['id']}},_0x2e54be={};_0x2e54be[_0x3e48('0x34')]=_[_0x3e48('0x35')](db[_0x3e48('0x30')][_0x3e48('0x31')]);_0x2e54be[_0x3e48('0x36')]=_[_0x3e48('0x35')](_0xffa3de[_0x3e48('0x36')]);_0x2e54be[_0x3e48('0x37')]=_['intersection'](_0x2e54be['model'],_0x2e54be[_0x3e48('0x36')]);_0x194da4[_0x3e48('0x3a')]=_['intersection'](_0x2e54be[_0x3e48('0x34')],qs[_0x3e48('0x39')](_0xffa3de[_0x3e48('0x36')][_0x3e48('0x39')]));_0x194da4[_0x3e48('0x3a')]=_0x194da4[_0x3e48('0x3a')][_0x3e48('0x3b')]?_0x194da4[_0x3e48('0x3a')]:_0x2e54be[_0x3e48('0x34')];if(_0xffa3de[_0x3e48('0x36')][_0x3e48('0x46')]){_0x194da4[_0x3e48('0x4b')]=[{'all':!![]}];}_0x194da4=_[_0x3e48('0x41')]({},_0x194da4,_0xffa3de['options']);return db['SquareProject']['find'](_0x194da4)['then'](handleEntityNotFound(_0x3c3a20,null))[_0x3e48('0x29')](respondWithResult(_0x3c3a20,null))[_0x3e48('0x4c')](handleError(_0x3c3a20,null));};exports[_0x3e48('0x4d')]=function(_0x5cccd3,_0x19510d){return db[_0x3e48('0x30')]['create'](_0x5cccd3[_0x3e48('0x4e')],{})[_0x3e48('0x29')](function(_0x1a1969){var _0x4859b0=_0x5cccd3[_0x3e48('0x4f')][_0x3e48('0x2b')]({'plain':!![]});if(!_0x4859b0)throw new Error(_0x3e48('0x50'));if(_0x4859b0[_0x3e48('0x51')]===_0x3e48('0x4f')){var _0x6404b3=_0x1a1969[_0x3e48('0x2b')]({'plain':!![]});var _0x160d21='SquareProjects';return db[_0x3e48('0x52')][_0x3e48('0x53')]({'where':{'name':_0x160d21,'userProfileId':_0x4859b0[_0x3e48('0x54')]},'raw':!![]})[_0x3e48('0x29')](function(_0x171353){if(_0x171353&&_0x171353['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e48('0x4d')]({'name':_0x6404b3[_0x3e48('0x2f')],'resourceId':_0x6404b3['id'],'type':_0x171353[_0x3e48('0x2f')],'sectionId':_0x171353['id']},{})['then'](function(){return _0x1a1969;});}else{return _0x1a1969;}})[_0x3e48('0x4c')](function(_0x3f48ad){logger[_0x3e48('0x2e')](_0x3e48('0x55'),_0x3f48ad);throw _0x3f48ad;});}return _0x1a1969;})[_0x3e48('0x29')](respondWithResult(_0x19510d,0xc9))[_0x3e48('0x4c')](handleError(_0x19510d,null));};exports[_0x3e48('0x56')]=function(_0x26f978,_0x1b8dd4){if(_0x26f978[_0x3e48('0x4e')]['id']){delete _0x26f978[_0x3e48('0x4e')]['id'];}return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x26f978[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x1b8dd4,null))[_0x3e48('0x29')](saveUpdates(_0x26f978[_0x3e48('0x4e')],null))[_0x3e48('0x29')](respondWithResult(_0x1b8dd4,null))[_0x3e48('0x4c')](handleError(_0x1b8dd4,null));};exports[_0x3e48('0x2a')]=function(_0x1aaa8e,_0x1f95fb){return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x1aaa8e[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x1f95fb,null))[_0x3e48('0x29')](removeEntity(_0x1f95fb,null))['catch'](handleError(_0x1f95fb,null));};exports[_0x3e48('0x57')]=function(_0x183489,_0x27b50c,_0x288657){return db[_0x3e48('0x30')][_0x3e48('0x53')]({'where':{'id':_0x183489[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x27b50c,null))['then'](function(_0x24db78){if(_0x24db78){return _0x24db78[_0x3e48('0x57')](_0x183489[_0x3e48('0x4e')][_0x3e48('0x58')],_[_0x3e48('0x59')](_0x183489['body'],[_0x3e48('0x58'),'id'])||{});}})[_0x3e48('0x29')](respondWithResult(_0x27b50c,null))[_0x3e48('0x4c')](handleError(_0x27b50c,null));};exports[_0x3e48('0x5a')]=function(_0x34ec02,_0x276183,_0x2a4909){return db[_0x3e48('0x30')]['find']({'where':{'id':_0x34ec02[_0x3e48('0x4a')]['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x276183,null))[_0x3e48('0x29')](function(_0x29dcdd){if(_0x29dcdd){return _0x29dcdd['removeUsers'](_0x34ec02[_0x3e48('0x36')]['ids'])[_0x3e48('0x29')](function(){if(_[_0x3e48('0x5b')](_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')])){for(var _0x17a676=0x0;_0x17a676<_0x34ec02['query'][_0x3e48('0x58')][_0x3e48('0x3b')];_0x17a676+=0x1){socket[_0x3e48('0x5c')](_0x3e48('0x5d'),{'UserId':Number(_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')][_0x17a676]),'SquareProjectId':Number(_0x34ec02[_0x3e48('0x4a')]['id'])});}}else{socket[_0x3e48('0x5c')](_0x3e48('0x5d'),{'UserId':Number(_0x34ec02[_0x3e48('0x36')][_0x3e48('0x58')]),'SquareProjectId':Number(_0x34ec02[_0x3e48('0x4a')]['id'])});}});}})[_0x3e48('0x29')](respondWithStatusCode(_0x276183,null))['catch'](handleError(_0x276183,null));};exports[_0x3e48('0x5e')]=function(_0x5a1c9d,_0x996b3d,_0x12a688){var _0x147e4c={};var _0xe88cd7={};var _0x3ec53d;var _0x5de901;return db[_0x3e48('0x30')][_0x3e48('0x5f')]({'where':{'id':_0x5a1c9d['params']['id']}})[_0x3e48('0x29')](handleEntityNotFound(_0x996b3d,null))['then'](function(_0x1781b9){if(_0x1781b9){_0x3ec53d=_0x1781b9;_0xe88cd7[_0x3e48('0x34')]=_[_0x3e48('0x35')](db[_0x3e48('0x60')][_0x3e48('0x31')]);_0xe88cd7[_0x3e48('0x36')]=_['keys'](_0x5a1c9d[_0x3e48('0x36')]);_0xe88cd7[_0x3e48('0x37')]=_[_0x3e48('0x38')](_0xe88cd7[_0x3e48('0x34')],_0xe88cd7[_0x3e48('0x36')]);_0x147e4c[_0x3e48('0x3a')]=_[_0x3e48('0x38')](_0xe88cd7[_0x3e48('0x34')],qs[_0x3e48('0x39')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x39')]));_0x147e4c[_0x3e48('0x3a')]=_0x147e4c[_0x3e48('0x3a')][_0x3e48('0x3b')]?_0x147e4c['attributes']:_0xe88cd7[_0x3e48('0x34')];_0x147e4c[_0x3e48('0x61')]=qs[_0x3e48('0x3e')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x3e')]);_0x147e4c[_0x3e48('0x40')]=qs[_0x3e48('0x37')](_[_0x3e48('0x3f')](_0x5a1c9d[_0x3e48('0x36')],_0xe88cd7[_0x3e48('0x37')]));if(_0x5a1c9d['query'][_0x3e48('0x44')]){_0x147e4c[_0x3e48('0x40')]=_[_0x3e48('0x41')](_0x147e4c[_0x3e48('0x40')],{'$or':_[_0x3e48('0x42')](_0x147e4c[_0x3e48('0x3a')],function(_0x4f2fbc){var _0x1de119={};_0x1de119[_0x4f2fbc]={'$like':'%'+_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x44')]+'%'};return _0x1de119;})});}_0x147e4c=_[_0x3e48('0x41')]({},_0x147e4c,_0x5a1c9d['options']);return _0x3ec53d[_0x3e48('0x5e')](_0x147e4c);}})['then'](function(_0x4fc596){if(_0x4fc596){_0x5de901=_0x4fc596['length'];if(!_0x5a1c9d[_0x3e48('0x36')]['hasOwnProperty'](_0x3e48('0x3d'))){_0x147e4c[_0x3e48('0x22')]=qs[_0x3e48('0x22')](_0x5a1c9d[_0x3e48('0x36')][_0x3e48('0x22')]);_0x147e4c[_0x3e48('0x20')]=qs[_0x3e48('0x20')](_0x5a1c9d[_0x3e48('0x36')]['offset']);}return _0x3ec53d['getUsers'](_0x147e4c);}})[_0x3e48('0x29')](function(_0x53960e){if(_0x53960e){return _0x53960e?{'count':_0x5de901,'rows':_0x53960e}:null;}})[_0x3e48('0x29')](respondWithResult(_0x996b3d,null))[_0x3e48('0x4c')](handleError(_0x996b3d,null));}; \ No newline at end of file +var _0x2c2d=['socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','SquareProjects','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','options','SquareProject','includeAll','findAll','rows','catch','params','length','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','order','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x2c2d,0x1d1));var _0xd2c2=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x2c2d[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0xd2c2('0x0'));var rimraf=require(_0xd2c2('0x1'));var zipdir=require(_0xd2c2('0x2'));var jsonpatch=require(_0xd2c2('0x3'));var rp=require('request-promise');var moment=require(_0xd2c2('0x4'));var BPromise=require(_0xd2c2('0x5'));var Mustache=require(_0xd2c2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd2c2('0x7'));var csv=require(_0xd2c2('0x8'));var ejs=require(_0xd2c2('0x9'));var fs=require('fs');var fs_extra=require(_0xd2c2('0xa'));var _=require(_0xd2c2('0xb'));var squel=require(_0xd2c2('0xc'));var crypto=require(_0xd2c2('0xd'));var jsforce=require(_0xd2c2('0xe'));var deskjs=require(_0xd2c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd2c2('0x10'));var Papa=require(_0xd2c2('0x11'));var Redis=require('ioredis');var authService=require(_0xd2c2('0x12'));var qs=require(_0xd2c2('0x13'));var as=require(_0xd2c2('0x14'));var hardwareService=require(_0xd2c2('0x15'));var logger=require(_0xd2c2('0x16'))(_0xd2c2('0x17'));var utils=require(_0xd2c2('0x18'));var config=require(_0xd2c2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2c2('0x1a'))['db'];config[_0xd2c2('0x1b')]=_[_0xd2c2('0x1c')](config[_0xd2c2('0x1b')],{'host':_0xd2c2('0x1d'),'port':0x18eb});var socket=require(_0xd2c2('0x1e'))(new Redis(config[_0xd2c2('0x1b')]));require(_0xd2c2('0x1f'))['register'](socket);function respondWithStatusCode(_0x25db91,_0x1a7972){_0x1a7972=_0x1a7972||0xcc;return function(_0x56a4b4){if(_0x56a4b4){return _0x25db91[_0xd2c2('0x20')](_0x1a7972);}return _0x25db91[_0xd2c2('0x21')](_0x1a7972)[_0xd2c2('0x22')]();};}function respondWithResult(_0x5402e0,_0x348180){_0x348180=_0x348180||0xc8;return function(_0x22c53d){if(_0x22c53d){return _0x5402e0['status'](_0x348180)[_0xd2c2('0x23')](_0x22c53d);}};}function respondWithFilteredResult(_0x22c7dc,_0x172378){return function(_0x542c81){if(_0x542c81){var _0x5c20d0=typeof _0x172378[_0xd2c2('0x24')]===_0xd2c2('0x25')&&typeof _0x172378[_0xd2c2('0x26')]===_0xd2c2('0x25');var _0x168c36=_0x542c81[_0xd2c2('0x27')];var _0x259f44=_0x5c20d0?0x0:_0x172378[_0xd2c2('0x24')];var _0x2780ee=_0x5c20d0?_0x542c81['count']:_0x172378[_0xd2c2('0x24')]+_0x172378['limit'];var _0x547084;if(_0x2780ee>=_0x168c36){_0x2780ee=_0x168c36;_0x547084=0xc8;}else{_0x547084=0xce;}_0x22c7dc[_0xd2c2('0x21')](_0x547084);return _0x22c7dc[_0xd2c2('0x28')](_0xd2c2('0x29'),_0x259f44+'-'+_0x2780ee+'/'+_0x168c36)[_0xd2c2('0x23')](_0x542c81);}return null;};}function patchUpdates(_0x157783){return function(_0x344dfe){try{jsonpatch[_0xd2c2('0x2a')](_0x344dfe,_0x157783,!![]);}catch(_0x2efca8){return BPromise[_0xd2c2('0x2b')](_0x2efca8);}return _0x344dfe[_0xd2c2('0x2c')]();};}function saveUpdates(_0x227161,_0x1df7bb){return function(_0x3c17c2){if(_0x3c17c2){return _0x3c17c2[_0xd2c2('0x2d')](_0x227161)[_0xd2c2('0x2e')](function(_0x5a3a07){return _0x5a3a07;});}return null;};}function removeEntity(_0x547bcc,_0x2c723d){return function(_0x1eb8fa){if(_0x1eb8fa){return _0x1eb8fa[_0xd2c2('0x2f')]()[_0xd2c2('0x2e')](function(){var _0xdef2e2=_0x1eb8fa['get']({'plain':!![]});var _0x57eb36=_0xd2c2('0x30');return db[_0xd2c2('0x31')][_0xd2c2('0x2f')]({'where':{'type':_0x57eb36,'resourceId':_0xdef2e2['id']}})['then'](function(){return _0x1eb8fa;});})['then'](function(){_0x547bcc[_0xd2c2('0x21')](0xcc)[_0xd2c2('0x22')]();});}};}function handleEntityNotFound(_0x416476,_0x4215c9){return function(_0x314779){if(!_0x314779){_0x416476[_0xd2c2('0x20')](0x194);}return _0x314779;};}function handleError(_0x5904cd,_0x590984){_0x590984=_0x590984||0x1f4;return function(_0x5a8f66){logger[_0xd2c2('0x32')](_0x5a8f66[_0xd2c2('0x33')]);if(_0x5a8f66[_0xd2c2('0x34')]){delete _0x5a8f66[_0xd2c2('0x34')];}_0x5904cd[_0xd2c2('0x21')](_0x590984)[_0xd2c2('0x35')](_0x5a8f66);};}exports['index']=function(_0x5e1630,_0x3ce91e){var _0xc392c5={},_0xad8efb={},_0x20ace7={'count':0x0,'rows':[]};var _0x2c97e2=_[_0xd2c2('0x36')](db['SquareProject']['rawAttributes'],function(_0x43bfff){return{'name':_0x43bfff[_0xd2c2('0x37')],'type':_0x43bfff[_0xd2c2('0x38')][_0xd2c2('0x39')]};});_0xad8efb[_0xd2c2('0x3a')]=_[_0xd2c2('0x36')](_0x2c97e2,_0xd2c2('0x34'));_0xad8efb['query']=_[_0xd2c2('0x3b')](_0x5e1630[_0xd2c2('0x3c')]);_0xad8efb[_0xd2c2('0x3d')]=_[_0xd2c2('0x3e')](_0xad8efb[_0xd2c2('0x3a')],_0xad8efb[_0xd2c2('0x3c')]);_0xc392c5[_0xd2c2('0x3f')]=_[_0xd2c2('0x3e')](_0xad8efb[_0xd2c2('0x3a')],qs['fields'](_0x5e1630[_0xd2c2('0x3c')][_0xd2c2('0x40')]));_0xc392c5['attributes']=_0xc392c5['attributes']['length']?_0xc392c5[_0xd2c2('0x3f')]:_0xad8efb[_0xd2c2('0x3a')];if(!_0x5e1630[_0xd2c2('0x3c')][_0xd2c2('0x41')](_0xd2c2('0x42'))){_0xc392c5['limit']=qs['limit'](_0x5e1630['query'][_0xd2c2('0x26')]);_0xc392c5[_0xd2c2('0x24')]=qs[_0xd2c2('0x24')](_0x5e1630[_0xd2c2('0x3c')][_0xd2c2('0x24')]);}_0xc392c5['order']=qs[_0xd2c2('0x43')](_0x5e1630[_0xd2c2('0x3c')]['sort']);_0xc392c5[_0xd2c2('0x44')]=qs[_0xd2c2('0x3d')](_['pick'](_0x5e1630['query'],_0xad8efb[_0xd2c2('0x3d')]),_0x2c97e2);if(_0x5e1630[_0xd2c2('0x3c')]['filter']){_0xc392c5[_0xd2c2('0x44')]=_[_0xd2c2('0x45')](_0xc392c5[_0xd2c2('0x44')],{'$or':_[_0xd2c2('0x36')](_0x2c97e2,function(_0x5c17ee){if(_0x5c17ee['type']!=='VIRTUAL'){var _0x2f42cd={};_0x2f42cd[_0x5c17ee['name']]={'$like':'%'+_0x5e1630['query']['filter']+'%'};return _0x2f42cd;}})});}_0xc392c5=_[_0xd2c2('0x45')]({},_0xc392c5,_0x5e1630[_0xd2c2('0x46')]);var _0x315f26={'where':_0xc392c5['where']};return db[_0xd2c2('0x47')]['count'](_0x315f26)['then'](function(_0x206cd4){_0x20ace7[_0xd2c2('0x27')]=_0x206cd4;if(_0x5e1630['query'][_0xd2c2('0x48')]){_0xc392c5['include']=[{'all':!![]}];}return db[_0xd2c2('0x47')][_0xd2c2('0x49')](_0xc392c5);})[_0xd2c2('0x2e')](function(_0x4521bc){_0x20ace7[_0xd2c2('0x4a')]=_0x4521bc;return _0x20ace7;})['then'](respondWithFilteredResult(_0x3ce91e,_0xc392c5))[_0xd2c2('0x4b')](handleError(_0x3ce91e,null));};exports['show']=function(_0x5df82e,_0x27de96){var _0x81162c={'raw':![],'where':{'id':_0x5df82e[_0xd2c2('0x4c')]['id']}},_0x31fe91={};_0x31fe91[_0xd2c2('0x3a')]=_[_0xd2c2('0x3b')](db[_0xd2c2('0x47')]['rawAttributes']);_0x31fe91[_0xd2c2('0x3c')]=_[_0xd2c2('0x3b')](_0x5df82e[_0xd2c2('0x3c')]);_0x31fe91[_0xd2c2('0x3d')]=_['intersection'](_0x31fe91[_0xd2c2('0x3a')],_0x31fe91['query']);_0x81162c[_0xd2c2('0x3f')]=_['intersection'](_0x31fe91['model'],qs[_0xd2c2('0x40')](_0x5df82e[_0xd2c2('0x3c')][_0xd2c2('0x40')]));_0x81162c['attributes']=_0x81162c[_0xd2c2('0x3f')][_0xd2c2('0x4d')]?_0x81162c['attributes']:_0x31fe91[_0xd2c2('0x3a')];if(_0x5df82e[_0xd2c2('0x3c')][_0xd2c2('0x48')]){_0x81162c[_0xd2c2('0x4e')]=[{'all':!![]}];}_0x81162c=_[_0xd2c2('0x45')]({},_0x81162c,_0x5df82e[_0xd2c2('0x46')]);return db[_0xd2c2('0x47')]['find'](_0x81162c)[_0xd2c2('0x2e')](handleEntityNotFound(_0x27de96,null))[_0xd2c2('0x2e')](respondWithResult(_0x27de96,null))[_0xd2c2('0x4b')](handleError(_0x27de96,null));};exports[_0xd2c2('0x4f')]=function(_0x440064,_0x415e37){return db[_0xd2c2('0x47')][_0xd2c2('0x4f')](_0x440064[_0xd2c2('0x50')],{})[_0xd2c2('0x2e')](function(_0x2936c3){var _0x21ab47=_0x440064[_0xd2c2('0x51')][_0xd2c2('0x52')]({'plain':!![]});if(!_0x21ab47)throw new Error(_0xd2c2('0x53'));if(_0x21ab47['role']==='user'){var _0x29e41a=_0x2936c3[_0xd2c2('0x52')]({'plain':!![]});var _0xb98b20=_0xd2c2('0x30');return db['UserProfileSection'][_0xd2c2('0x54')]({'where':{'name':_0xb98b20,'userProfileId':_0x21ab47['userProfileId']},'raw':!![]})[_0xd2c2('0x2e')](function(_0x2a7af6){if(_0x2a7af6&&_0x2a7af6[_0xd2c2('0x55')]===0x0){return db[_0xd2c2('0x31')][_0xd2c2('0x4f')]({'name':_0x29e41a[_0xd2c2('0x34')],'resourceId':_0x29e41a['id'],'type':_0x2a7af6['name'],'sectionId':_0x2a7af6['id']},{})[_0xd2c2('0x2e')](function(){return _0x2936c3;});}else{return _0x2936c3;}})[_0xd2c2('0x4b')](function(_0x1ac779){logger['error'](_0xd2c2('0x56'),_0x1ac779);throw _0x1ac779;});}return _0x2936c3;})[_0xd2c2('0x2e')](respondWithResult(_0x415e37,0xc9))[_0xd2c2('0x4b')](handleError(_0x415e37,null));};exports[_0xd2c2('0x2d')]=function(_0x3f7641,_0x7cdbe4){if(_0x3f7641[_0xd2c2('0x50')]['id']){delete _0x3f7641[_0xd2c2('0x50')]['id'];}return db[_0xd2c2('0x47')][_0xd2c2('0x54')]({'where':{'id':_0x3f7641[_0xd2c2('0x4c')]['id']}})[_0xd2c2('0x2e')](handleEntityNotFound(_0x7cdbe4,null))[_0xd2c2('0x2e')](saveUpdates(_0x3f7641['body'],null))['then'](respondWithResult(_0x7cdbe4,null))[_0xd2c2('0x4b')](handleError(_0x7cdbe4,null));};exports[_0xd2c2('0x2f')]=function(_0x269e2c,_0x451127){return db[_0xd2c2('0x47')][_0xd2c2('0x54')]({'where':{'id':_0x269e2c['params']['id']}})[_0xd2c2('0x2e')](handleEntityNotFound(_0x451127,null))['then'](removeEntity(_0x451127,null))[_0xd2c2('0x4b')](handleError(_0x451127,null));};exports[_0xd2c2('0x57')]=function(_0x1b3ce8,_0x2c5325,_0xc10c68){return db[_0xd2c2('0x47')]['find']({'where':{'id':_0x1b3ce8[_0xd2c2('0x4c')]['id']}})[_0xd2c2('0x2e')](handleEntityNotFound(_0x2c5325,null))[_0xd2c2('0x2e')](function(_0x3c5dcc){if(_0x3c5dcc){return _0x3c5dcc[_0xd2c2('0x57')](_0x1b3ce8[_0xd2c2('0x50')][_0xd2c2('0x58')],_[_0xd2c2('0x59')](_0x1b3ce8[_0xd2c2('0x50')],['ids','id'])||{});}})[_0xd2c2('0x2e')](respondWithResult(_0x2c5325,null))['catch'](handleError(_0x2c5325,null));};exports[_0xd2c2('0x5a')]=function(_0x26d505,_0x3e91c0,_0x314c4f){return db[_0xd2c2('0x47')]['find']({'where':{'id':_0x26d505[_0xd2c2('0x4c')]['id']}})[_0xd2c2('0x2e')](handleEntityNotFound(_0x3e91c0,null))[_0xd2c2('0x2e')](function(_0x448cb8){if(_0x448cb8){return _0x448cb8[_0xd2c2('0x5a')](_0x26d505[_0xd2c2('0x3c')][_0xd2c2('0x58')])['then'](function(){if(_['isArray'](_0x26d505['query'][_0xd2c2('0x58')])){for(var _0x4cfcd8=0x0;_0x4cfcd8<_0x26d505['query']['ids']['length'];_0x4cfcd8+=0x1){socket[_0xd2c2('0x5b')](_0xd2c2('0x5c'),{'UserId':Number(_0x26d505['query'][_0xd2c2('0x58')][_0x4cfcd8]),'SquareProjectId':Number(_0x26d505['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x26d505[_0xd2c2('0x3c')][_0xd2c2('0x58')]),'SquareProjectId':Number(_0x26d505[_0xd2c2('0x4c')]['id'])});}});}})[_0xd2c2('0x2e')](respondWithStatusCode(_0x3e91c0,null))[_0xd2c2('0x4b')](handleError(_0x3e91c0,null));};exports[_0xd2c2('0x5d')]=function(_0x48d19b,_0x20f682,_0x32c6e9){var _0x30e56c={};var _0x1ad42f={};var _0x513530;var _0x176c28;return db[_0xd2c2('0x47')][_0xd2c2('0x5e')]({'where':{'id':_0x48d19b[_0xd2c2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20f682,null))[_0xd2c2('0x2e')](function(_0x20553b){if(_0x20553b){_0x513530=_0x20553b;_0x1ad42f[_0xd2c2('0x3a')]=_['keys'](db[_0xd2c2('0x5f')]['rawAttributes']);_0x1ad42f['query']=_['keys'](_0x48d19b[_0xd2c2('0x3c')]);_0x1ad42f['filters']=_[_0xd2c2('0x3e')](_0x1ad42f[_0xd2c2('0x3a')],_0x1ad42f['query']);_0x30e56c[_0xd2c2('0x3f')]=_[_0xd2c2('0x3e')](_0x1ad42f[_0xd2c2('0x3a')],qs[_0xd2c2('0x40')](_0x48d19b[_0xd2c2('0x3c')][_0xd2c2('0x40')]));_0x30e56c['attributes']=_0x30e56c['attributes'][_0xd2c2('0x4d')]?_0x30e56c[_0xd2c2('0x3f')]:_0x1ad42f[_0xd2c2('0x3a')];_0x30e56c[_0xd2c2('0x60')]=qs[_0xd2c2('0x43')](_0x48d19b[_0xd2c2('0x3c')]['sort']);_0x30e56c[_0xd2c2('0x44')]=qs['filters'](_[_0xd2c2('0x61')](_0x48d19b['query'],_0x1ad42f['filters']));if(_0x48d19b[_0xd2c2('0x3c')][_0xd2c2('0x62')]){_0x30e56c[_0xd2c2('0x44')]=_[_0xd2c2('0x45')](_0x30e56c[_0xd2c2('0x44')],{'$or':_[_0xd2c2('0x36')](_0x30e56c[_0xd2c2('0x3f')],function(_0x51e3ef){var _0x548f3a={};_0x548f3a[_0x51e3ef]={'$like':'%'+_0x48d19b[_0xd2c2('0x3c')][_0xd2c2('0x62')]+'%'};return _0x548f3a;})});}_0x30e56c=_[_0xd2c2('0x45')]({},_0x30e56c,_0x48d19b[_0xd2c2('0x46')]);return _0x513530[_0xd2c2('0x5d')](_0x30e56c);}})[_0xd2c2('0x2e')](function(_0x37468e){if(_0x37468e){_0x176c28=_0x37468e['length'];if(!_0x48d19b[_0xd2c2('0x3c')][_0xd2c2('0x41')](_0xd2c2('0x42'))){_0x30e56c[_0xd2c2('0x26')]=qs[_0xd2c2('0x26')](_0x48d19b[_0xd2c2('0x3c')]['limit']);_0x30e56c[_0xd2c2('0x24')]=qs[_0xd2c2('0x24')](_0x48d19b['query']['offset']);}return _0x513530[_0xd2c2('0x5d')](_0x30e56c);}})['then'](function(_0x16daf7){if(_0x16daf7){return _0x16daf7?{'count':_0x176c28,'rows':_0x16daf7}:null;}})['then'](respondWithResult(_0x20f682,null))[_0xd2c2('0x4b')](handleError(_0x20f682,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 4069535..969cab9 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 _0x8187=['emit','hook','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x8187,0xb9));var _0x7818=function(_0x3125f0,_0x16a51e){_0x3125f0=_0x3125f0-0x0;var _0x19cae4=_0x8187[_0x3125f0];return _0x19cae4;};'use strict';var EventEmitter=require(_0x7818('0x0'));var SquareProject=require(_0x7818('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7818('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7818('0x3')};function emitEvent(_0x37221f){return function(_0x16fc84,_0x583299,_0x2d32a5){SquareProjectEvents[_0x7818('0x4')](_0x37221f+':'+_0x16fc84['id'],_0x16fc84);SquareProjectEvents[_0x7818('0x4')](_0x37221f,_0x16fc84);_0x2d32a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7818('0x5')](e,emitEvent(event));}}module[_0x7818('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x7780=['exports','events','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x4dfe4a,_0x21a7f0){var _0x5f5ce4=function(_0x8b2a3f){while(--_0x8b2a3f){_0x4dfe4a['push'](_0x4dfe4a['shift']());}};_0x5f5ce4(++_0x21a7f0);}(_0x7780,0xda));var _0x0778=function(_0x532155,_0x110247){_0x532155=_0x532155-0x0;var _0x3f2619=_0x7780[_0x532155];return _0x3f2619;};'use strict';var EventEmitter=require(_0x0778('0x0'));var SquareProject=require(_0x0778('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0778('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1c5296){return function(_0x9edc09,_0x3ffb4c,_0x3fa10b){SquareProjectEvents[_0x0778('0x3')](_0x1c5296+':'+_0x9edc09['id'],_0x9edc09);SquareProjectEvents[_0x0778('0x3')](_0x1c5296,_0x9edc09);_0x3fa10b(null);};}for(var e in events){if(events[_0x0778('0x4')](e)){var event=events[e];SquareProject[_0x0778('0x5')](e,emitEvent(event));}}module[_0x0778('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index d881b2e..c6afd51 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 _0x7d30=['define','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c9a89,_0x378778){var _0x1eb47b=function(_0x57998a){while(--_0x57998a){_0x3c9a89['push'](_0x3c9a89['shift']());}};_0x1eb47b(++_0x378778);}(_0x7d30,0xaf));var _0x07d3=function(_0x2ecf31,_0x1a7245){_0x2ecf31=_0x2ecf31-0x0;var _0x41c36f=_0x7d30[_0x2ecf31];return _0x41c36f;};'use strict';var _=require('lodash');var util=require(_0x07d3('0x0'));var logger=require('../../config/logger')(_0x07d3('0x1'));var moment=require(_0x07d3('0x2'));var BPromise=require(_0x07d3('0x3'));var rp=require(_0x07d3('0x4'));var fs=require('fs');var path=require(_0x07d3('0x5'));var rimraf=require(_0x07d3('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x58a238,_0x5bc499){return _0x58a238[_0x07d3('0x7')]('SquareProject',attributes,{'tableName':_0x07d3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ccbcc,_0x2d1d7a,_0x59608b){if(_0x3ccbcc[_0x07d3('0x9')]('preproduction')){_0x3ccbcc['savedAt']=moment()[_0x07d3('0xa')](_0x07d3('0xb'));}if(_0x3ccbcc['changed'](_0x07d3('0xc'))){_0x3ccbcc[_0x07d3('0xd')]=moment()[_0x07d3('0xa')](_0x07d3('0xb'));}_0x59608b(null,_0x3ccbcc);}}});}; \ No newline at end of file +var _0x6150=['SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x31955e,_0x50cbbc){var _0x54a287=function(_0x127a7e){while(--_0x127a7e){_0x31955e['push'](_0x31955e['shift']());}};_0x54a287(++_0x50cbbc);}(_0x6150,0x1d3));var _0x0615=function(_0xd618f5,_0x45a952){_0xd618f5=_0xd618f5-0x0;var _0x742ed2=_0x6150[_0xd618f5];return _0x742ed2;};'use strict';var _=require('lodash');var util=require(_0x0615('0x0'));var logger=require(_0x0615('0x1'))(_0x0615('0x2'));var moment=require('moment');var BPromise=require(_0x0615('0x3'));var rp=require(_0x0615('0x4'));var fs=require('fs');var path=require(_0x0615('0x5'));var rimraf=require(_0x0615('0x6'));var config=require(_0x0615('0x7'));var attributes=require(_0x0615('0x8'));module['exports']=function(_0x5a7e42,_0x723348){return _0x5a7e42['define'](_0x0615('0x9'),attributes,{'tableName':_0x0615('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a218e,_0x387c06,_0x29a7f8){if(_0x2a218e['changed'](_0x0615('0xb'))){_0x2a218e[_0x0615('0xc')]=moment()[_0x0615('0xd')](_0x0615('0xe'));}if(_0x2a218e['changed'](_0x0615('0xf'))){_0x2a218e[_0x0615('0x10')]=moment()[_0x0615('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29a7f8(null,_0x2a218e);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 2f2d7eb..a967de8 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 _0x7c39=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','map','include','model'];(function(_0x5c774b,_0x14d182){var _0x572a8d=function(_0x514c14){while(--_0x514c14){_0x5c774b['push'](_0x5c774b['shift']());}};_0x572a8d(++_0x14d182);}(_0x7c39,0xfc));var _0x97c3=function(_0x102241,_0x385f6e){_0x102241=_0x102241-0x0;var _0x52e04f=_0x7c39[_0x102241];return _0x52e04f;};'use strict';var _=require(_0x97c3('0x0'));var util=require(_0x97c3('0x1'));var moment=require(_0x97c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97c3('0x3'));var db=require(_0x97c3('0x4'))['db'];var utils=require(_0x97c3('0x5'));var logger=require(_0x97c3('0x6'))('rpc');var config=require(_0x97c3('0x7'));var jayson=require(_0x97c3('0x8'));var client=jayson[_0x97c3('0x9')]['http']({'port':0x232a});config[_0x97c3('0xa')]=_[_0x97c3('0xb')](config[_0x97c3('0xa')],{'host':_0x97c3('0xc'),'port':0x18eb});var socket=require(_0x97c3('0xd'))(new Redis(config['redis']));require(_0x97c3('0xe'))[_0x97c3('0xf')](socket);function respondWithRpcPromise(_0x4cee6a,_0x409425,_0x1b56b4){return new BPromise(function(_0x2c5736,_0x3d6606){return client[_0x97c3('0x10')](_0x4cee6a,_0x1b56b4)[_0x97c3('0x11')](function(_0xdaceb7){logger[_0x97c3('0x12')](_0x97c3('0x13'),_0x409425,'request\x20sent');logger[_0x97c3('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x409425,_0x97c3('0x15'),JSON[_0x97c3('0x16')](_0xdaceb7));if(_0xdaceb7[_0x97c3('0x17')]){if(_0xdaceb7['error']['code']===0x1f4){logger[_0x97c3('0x17')](_0x97c3('0x13'),_0x409425,_0xdaceb7[_0x97c3('0x17')]['message']);return _0x3d6606(_0xdaceb7['error']['message']);}logger[_0x97c3('0x17')]('SquareProject,\x20%s,\x20%s',_0x409425,_0xdaceb7[_0x97c3('0x17')][_0x97c3('0x18')]);return _0x2c5736(_0xdaceb7[_0x97c3('0x17')][_0x97c3('0x18')]);}else{logger[_0x97c3('0x12')](_0x97c3('0x13'),_0x409425,'request\x20sent');_0x2c5736(_0xdaceb7[_0x97c3('0x19')][_0x97c3('0x18')]);}})[_0x97c3('0x1a')](function(_0x1909c0){logger['error']('SquareProject,\x20%s,\x20%s',_0x409425,_0x1909c0);_0x3d6606(_0x1909c0);});});}exports[_0x97c3('0x1b')]=function(_0x181309){var _0x12a042=this;return new Promise(function(_0x3c4ae7,_0x33db33){return db[_0x97c3('0x1c')][_0x97c3('0x1d')]({'raw':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')][_0x97c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x181309[_0x97c3('0x1e')]?_0x181309['options']['where']||null:null,'attributes':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')][_0x97c3('0x20')]||null:null,'include':_0x181309[_0x97c3('0x1e')]?_0x181309[_0x97c3('0x1e')]['include']?_[_0x97c3('0x21')](_0x181309[_0x97c3('0x1e')][_0x97c3('0x22')],function(_0x34ddfd){return{'model':db[_0x34ddfd[_0x97c3('0x23')]],'as':_0x34ddfd['as'],'attributes':_0x34ddfd[_0x97c3('0x20')],'include':_0x34ddfd[_0x97c3('0x22')]?_[_0x97c3('0x21')](_0x34ddfd[_0x97c3('0x22')],function(_0x27a33f){return{'model':db[_0x27a33f[_0x97c3('0x23')]],'as':_0x27a33f['as'],'attributes':_0x27a33f['attributes'],'include':_0x27a33f[_0x97c3('0x22')]?_[_0x97c3('0x21')](_0x27a33f[_0x97c3('0x22')],function(_0x25e5d6){return{'model':db[_0x25e5d6['model']],'as':_0x25e5d6['as'],'attributes':_0x25e5d6[_0x97c3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x97c3('0x11')](function(_0x58e26c){logger['info'](_0x97c3('0x1b'),_0x181309);logger[_0x97c3('0x14')](_0x97c3('0x1b'),_0x181309,JSON[_0x97c3('0x16')](_0x58e26c));_0x3c4ae7(_0x58e26c);})['catch'](function(_0x45f2d5){logger[_0x97c3('0x17')](_0x97c3('0x1b'),_0x45f2d5[_0x97c3('0x18')],_0x181309);_0x33db33(_0x12a042[_0x97c3('0x17')](0x1f4,_0x45f2d5['message']));});});}; \ No newline at end of file +var _0x2a35=['message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x488818,_0x17c6de){var _0x30783c=function(_0x1b418c){while(--_0x1b418c){_0x488818['push'](_0x488818['shift']());}};_0x30783c(++_0x17c6de);}(_0x2a35,0xf2));var _0x52a3=function(_0x19920b,_0x4b1fb5){_0x19920b=_0x19920b-0x0;var _0x572afb=_0x2a35[_0x19920b];return _0x572afb;};'use strict';var _=require(_0x52a3('0x0'));var util=require(_0x52a3('0x1'));var moment=require(_0x52a3('0x2'));var BPromise=require(_0x52a3('0x3'));var rs=require(_0x52a3('0x4'));var fs=require('fs');var Redis=require(_0x52a3('0x5'));var db=require(_0x52a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x52a3('0x7'))(_0x52a3('0x8'));var config=require('../../config/environment');var jayson=require(_0x52a3('0x9'));var client=jayson[_0x52a3('0xa')][_0x52a3('0xb')]({'port':0x232a});config[_0x52a3('0xc')]=_[_0x52a3('0xd')](config['redis'],{'host':_0x52a3('0xe'),'port':0x18eb});var socket=require(_0x52a3('0xf'))(new Redis(config[_0x52a3('0xc')]));require(_0x52a3('0x10'))['register'](socket);function respondWithRpcPromise(_0x26e52e,_0x3fff65,_0x339280){return new BPromise(function(_0x91338c,_0x2822c3){return client[_0x52a3('0x11')](_0x26e52e,_0x339280)['then'](function(_0x305f97){logger[_0x52a3('0x12')](_0x52a3('0x13'),_0x3fff65,_0x52a3('0x14'));logger[_0x52a3('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3fff65,_0x52a3('0x14'),JSON['stringify'](_0x305f97));if(_0x305f97[_0x52a3('0x16')]){if(_0x305f97['error'][_0x52a3('0x17')]===0x1f4){logger[_0x52a3('0x16')](_0x52a3('0x13'),_0x3fff65,_0x305f97[_0x52a3('0x16')][_0x52a3('0x18')]);return _0x2822c3(_0x305f97[_0x52a3('0x16')][_0x52a3('0x18')]);}logger[_0x52a3('0x16')](_0x52a3('0x13'),_0x3fff65,_0x305f97[_0x52a3('0x16')][_0x52a3('0x18')]);return _0x91338c(_0x305f97[_0x52a3('0x16')]['message']);}else{logger[_0x52a3('0x12')](_0x52a3('0x13'),_0x3fff65,_0x52a3('0x14'));_0x91338c(_0x305f97[_0x52a3('0x19')][_0x52a3('0x18')]);}})[_0x52a3('0x1a')](function(_0x307240){logger['error']('SquareProject,\x20%s,\x20%s',_0x3fff65,_0x307240);_0x2822c3(_0x307240);});});}exports[_0x52a3('0x1b')]=function(_0x521621){var _0x2c8b16=this;return new Promise(function(_0x5a994b,_0x5b6613){return db['SquareProject'][_0x52a3('0x1c')]({'raw':_0x521621['options']?_0x521621[_0x52a3('0x1d')][_0x52a3('0x1e')]===undefined?!![]:![]:!![],'where':_0x521621[_0x52a3('0x1d')]?_0x521621[_0x52a3('0x1d')][_0x52a3('0x1f')]||null:null,'attributes':_0x521621[_0x52a3('0x1d')]?_0x521621[_0x52a3('0x1d')][_0x52a3('0x20')]||null:null,'include':_0x521621[_0x52a3('0x1d')]?_0x521621['options'][_0x52a3('0x21')]?_[_0x52a3('0x22')](_0x521621[_0x52a3('0x1d')]['include'],function(_0x31aa5f){return{'model':db[_0x31aa5f[_0x52a3('0x23')]],'as':_0x31aa5f['as'],'attributes':_0x31aa5f[_0x52a3('0x20')],'include':_0x31aa5f[_0x52a3('0x21')]?_['map'](_0x31aa5f[_0x52a3('0x21')],function(_0x20ecc4){return{'model':db[_0x20ecc4[_0x52a3('0x23')]],'as':_0x20ecc4['as'],'attributes':_0x20ecc4[_0x52a3('0x20')],'include':_0x20ecc4['include']?_[_0x52a3('0x22')](_0x20ecc4['include'],function(_0xc6303b){return{'model':db[_0xc6303b[_0x52a3('0x23')]],'as':_0xc6303b['as'],'attributes':_0xc6303b['attributes']};}):[]};}):[]};}):[]:[]})[_0x52a3('0x24')](function(_0x53a05d){logger['info']('ShowSquareProject',_0x521621);logger[_0x52a3('0x15')](_0x52a3('0x1b'),_0x521621,JSON[_0x52a3('0x25')](_0x53a05d));_0x5a994b(_0x53a05d);})['catch'](function(_0x230cc3){logger[_0x52a3('0x16')](_0x52a3('0x1b'),_0x230cc3['message'],_0x521621);_0x5b6613(_0x2c8b16[_0x52a3('0x16')](0x1f4,_0x230cc3[_0x52a3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0ab3626..1b89fdd 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 _0x5511=['remove','update','emit','removeListener','squareProject:','./squareProject.events','save'];(function(_0x1ae1fb,_0x81c2ec){var _0x57166=function(_0x48c137){while(--_0x48c137){_0x1ae1fb['push'](_0x1ae1fb['shift']());}};_0x57166(++_0x81c2ec);}(_0x5511,0x124));var _0x1551=function(_0x26986a,_0x168f62){_0x26986a=_0x26986a-0x0;var _0x361f12=_0x5511[_0x26986a];return _0x361f12;};'use strict';var SquareProjectEvents=require(_0x1551('0x0'));var events=[_0x1551('0x1'),_0x1551('0x2'),_0x1551('0x3')];function createListener(_0x1b7a2c,_0x4a466d){return function(_0x4e8cd4){_0x4a466d[_0x1551('0x4')](_0x1b7a2c,_0x4e8cd4);};}function removeListener(_0x1bc1e2,_0x429c8b){return function(){SquareProjectEvents[_0x1551('0x5')](_0x1bc1e2,_0x429c8b);};}exports['register']=function(_0x5912c3){for(var _0x1cd5fb=0x0,_0x4fb3bd=events['length'];_0x1cd5fb<_0x4fb3bd;_0x1cd5fb++){var _0x1dcb98=events[_0x1cd5fb];var _0x5df0c2=createListener(_0x1551('0x6')+_0x1dcb98,_0x5912c3);SquareProjectEvents['on'](_0x1dcb98,_0x5df0c2);}}; \ No newline at end of file +var _0x7531=['removeListener','register','squareProject:','save','remove','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7531,0x1bf));var _0x1753=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7531[_0x397e5f];return _0x5302b8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1753('0x0'),_0x1753('0x1'),_0x1753('0x2')];function createListener(_0x57e702,_0xcacc39){return function(_0x1e9e8b){_0xcacc39['emit'](_0x57e702,_0x1e9e8b);};}function removeListener(_0x2e73f7,_0xc9d875){return function(){SquareProjectEvents[_0x1753('0x3')](_0x2e73f7,_0xc9d875);};}exports[_0x1753('0x4')]=function(_0x31bc83){for(var _0x142fe8=0x0,_0x21a770=events['length'];_0x142fe8<_0x21a770;_0x142fe8++){var _0x2f7088=events[_0x142fe8];var _0x233722=createListener(_0x1753('0x5')+_0x2f7088,_0x31bc83);SquareProjectEvents['on'](_0x2f7088,_0x233722);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index d96d6aa..3c93e43 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x58afd3,_0x3caa18){var _0x270f8b=function(_0x130fe0){while(--_0x130fe0){_0x58afd3['push'](_0x58afd3['shift']());}};_0x270f8b(++_0x3caa18);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x4648b7,_0x2e411f){var _0x299df0=function(_0x30dd13){while(--_0x30dd13){_0x4648b7['push'](_0x4648b7['shift']());}};_0x299df0(++_0x2e411f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 32f069e..f3f2db9 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 _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x4c42ad,_0x472d2f){var _0x304771=function(_0x4b4acb){while(--_0x4b4acb){_0x4c42ad['push'](_0x4c42ad['shift']());}};_0x304771(++_0x472d2f);}(_0xa41a,0x6b));var _0xaa41=function(_0x4b84ef,_0x22f040){_0x4b84ef=_0x4b84ef-0x0;var _0x12df58=_0xa41a[_0x4b84ef];return _0x12df58;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x5537e6,_0xddf3dc){var _0x44115a=function(_0x5beb06){while(--_0x5beb06){_0x5537e6['push'](_0x5537e6['shift']());}};_0x44115a(++_0xddf3dc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x386593,_0x5258a8){_0x386593=_0x386593-0x0;var _0x4e93a8=_0x8ef6[_0x386593];return _0x4e93a8;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index af19a7f..8964224 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 _0x3b90=['merge','options','includeAll','include','findAll','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b90,0x82));var _0x03b9=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x3b90[_0x4e8286];return _0x44a440;};'use strict';var emlformat=require(_0x03b9('0x0'));var rimraf=require(_0x03b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03b9('0x2'));var rp=require('request-promise');var moment=require(_0x03b9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x03b9('0x4'));var util=require('util');var path=require(_0x03b9('0x5'));var sox=require(_0x03b9('0x6'));var csv=require(_0x03b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03b9('0x8'));var squel=require('squel');var crypto=require(_0x03b9('0x9'));var jsforce=require(_0x03b9('0xa'));var deskjs=require(_0x03b9('0xb'));var toCsv=require(_0x03b9('0x7'));var querystring=require(_0x03b9('0xc'));var Papa=require(_0x03b9('0xd'));var Redis=require(_0x03b9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x03b9('0xf'));var as=require(_0x03b9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03b9('0x11'))(_0x03b9('0x12'));var utils=require(_0x03b9('0x13'));var config=require(_0x03b9('0x14'));var licenseUtil=require(_0x03b9('0x15'));var db=require(_0x03b9('0x16'))['db'];function respondWithStatusCode(_0x48a8c0,_0x273057){_0x273057=_0x273057||0xcc;return function(_0x1641ef){if(_0x1641ef){return _0x48a8c0[_0x03b9('0x17')](_0x273057);}return _0x48a8c0[_0x03b9('0x18')](_0x273057)[_0x03b9('0x19')]();};}function respondWithResult(_0x539539,_0xb8b897){_0xb8b897=_0xb8b897||0xc8;return function(_0x1e7fba){if(_0x1e7fba){return _0x539539['status'](_0xb8b897)['json'](_0x1e7fba);}};}function respondWithFilteredResult(_0x42c4f3,_0x49482c){return function(_0x1a20ae){if(_0x1a20ae){var _0x4fa459=typeof _0x49482c[_0x03b9('0x1a')]===_0x03b9('0x1b')&&typeof _0x49482c[_0x03b9('0x1c')]===_0x03b9('0x1b');var _0x211daf=_0x1a20ae[_0x03b9('0x1d')];var _0x185e4d=_0x4fa459?0x0:_0x49482c['offset'];var _0x1e7af6=_0x4fa459?_0x1a20ae['count']:_0x49482c[_0x03b9('0x1a')]+_0x49482c[_0x03b9('0x1c')];var _0xf25e9b;if(_0x1e7af6>=_0x211daf){_0x1e7af6=_0x211daf;_0xf25e9b=0xc8;}else{_0xf25e9b=0xce;}_0x42c4f3[_0x03b9('0x18')](_0xf25e9b);return _0x42c4f3['set'](_0x03b9('0x1e'),_0x185e4d+'-'+_0x1e7af6+'/'+_0x211daf)['json'](_0x1a20ae);}return null;};}function patchUpdates(_0xb404f2){return function(_0x282f7d){try{jsonpatch['apply'](_0x282f7d,_0xb404f2,!![]);}catch(_0x56c6de){return BPromise['reject'](_0x56c6de);}return _0x282f7d['save']();};}function saveUpdates(_0x1cf892,_0x5bef9e){return function(_0x2748a8){if(_0x2748a8){return _0x2748a8[_0x03b9('0x1f')](_0x1cf892)[_0x03b9('0x20')](function(_0x12cd26){return _0x12cd26;});}return null;};}function removeEntity(_0x220c60,_0x54662c){return function(_0x5c9054){if(_0x5c9054){return _0x5c9054[_0x03b9('0x21')]()[_0x03b9('0x20')](function(){_0x220c60[_0x03b9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4277be,_0x19a361){return function(_0x41a807){if(!_0x41a807){_0x4277be['sendStatus'](0x194);}return _0x41a807;};}function handleError(_0x4bc046,_0x5a9105){_0x5a9105=_0x5a9105||0x1f4;return function(_0x1f6249){logger[_0x03b9('0x22')](_0x1f6249[_0x03b9('0x23')]);if(_0x1f6249[_0x03b9('0x24')]){delete _0x1f6249[_0x03b9('0x24')];}_0x4bc046[_0x03b9('0x18')](_0x5a9105)[_0x03b9('0x25')](_0x1f6249);};}exports[_0x03b9('0x26')]=function(_0x38ef50,_0x2ebb34){var _0x541eb1={},_0x456fc7={},_0x1686ec={'count':0x0,'rows':[]};var _0x27490d=_[_0x03b9('0x27')](db[_0x03b9('0x28')][_0x03b9('0x29')],function(_0x20dfec){return{'name':_0x20dfec[_0x03b9('0x2a')],'type':_0x20dfec[_0x03b9('0x2b')][_0x03b9('0x2c')]};});_0x456fc7[_0x03b9('0x2d')]=_[_0x03b9('0x27')](_0x27490d,_0x03b9('0x24'));_0x456fc7[_0x03b9('0x2e')]=_[_0x03b9('0x2f')](_0x38ef50['query']);_0x456fc7[_0x03b9('0x30')]=_[_0x03b9('0x31')](_0x456fc7[_0x03b9('0x2d')],_0x456fc7[_0x03b9('0x2e')]);_0x541eb1[_0x03b9('0x32')]=_[_0x03b9('0x31')](_0x456fc7['model'],qs[_0x03b9('0x33')](_0x38ef50['query'][_0x03b9('0x33')]));_0x541eb1[_0x03b9('0x32')]=_0x541eb1['attributes'][_0x03b9('0x34')]?_0x541eb1[_0x03b9('0x32')]:_0x456fc7[_0x03b9('0x2d')];if(!_0x38ef50[_0x03b9('0x2e')]['hasOwnProperty'](_0x03b9('0x35'))){_0x541eb1[_0x03b9('0x1c')]=qs['limit'](_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x1c')]);_0x541eb1[_0x03b9('0x1a')]=qs[_0x03b9('0x1a')](_0x38ef50['query'][_0x03b9('0x1a')]);}_0x541eb1[_0x03b9('0x36')]=qs[_0x03b9('0x37')](_0x38ef50[_0x03b9('0x2e')]['sort']);_0x541eb1[_0x03b9('0x38')]=qs['filters'](_[_0x03b9('0x39')](_0x38ef50[_0x03b9('0x2e')],_0x456fc7[_0x03b9('0x30')]),_0x27490d);if(_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3a')]){_0x541eb1[_0x03b9('0x38')]=_['merge'](_0x541eb1['where'],{'$or':_[_0x03b9('0x27')](_0x27490d,function(_0x1951b2){if(_0x1951b2['type']!==_0x03b9('0x3b')){var _0x1e4099={};_0x1e4099[_0x1951b2[_0x03b9('0x24')]]={'$like':'%'+_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3a')]+'%'};return _0x1e4099;}})});}_0x541eb1=_[_0x03b9('0x3c')]({},_0x541eb1,_0x38ef50[_0x03b9('0x3d')]);var _0x33a5cf={'where':_0x541eb1[_0x03b9('0x38')]};return db[_0x03b9('0x28')][_0x03b9('0x1d')](_0x33a5cf)[_0x03b9('0x20')](function(_0x155fd6){_0x1686ec['count']=_0x155fd6;if(_0x38ef50[_0x03b9('0x2e')][_0x03b9('0x3e')]){_0x541eb1[_0x03b9('0x3f')]=[{'all':!![]}];}return db[_0x03b9('0x28')][_0x03b9('0x40')](_0x541eb1);})[_0x03b9('0x20')](function(_0x50d8ad){_0x1686ec['rows']=_0x50d8ad;return _0x1686ec;})[_0x03b9('0x20')](respondWithFilteredResult(_0x2ebb34,_0x541eb1))[_0x03b9('0x41')](handleError(_0x2ebb34,null));};exports[_0x03b9('0x42')]=function(_0x47314b,_0x26c09c){var _0x553aa9={'raw':!![],'where':{'id':_0x47314b[_0x03b9('0x43')]['id']}},_0x5c2cf4={};_0x5c2cf4[_0x03b9('0x2d')]=_[_0x03b9('0x2f')](db[_0x03b9('0x28')][_0x03b9('0x29')]);_0x5c2cf4[_0x03b9('0x2e')]=_[_0x03b9('0x2f')](_0x47314b['query']);_0x5c2cf4[_0x03b9('0x30')]=_[_0x03b9('0x31')](_0x5c2cf4[_0x03b9('0x2d')],_0x5c2cf4['query']);_0x553aa9[_0x03b9('0x32')]=_[_0x03b9('0x31')](_0x5c2cf4['model'],qs[_0x03b9('0x33')](_0x47314b['query'][_0x03b9('0x33')]));_0x553aa9[_0x03b9('0x32')]=_0x553aa9[_0x03b9('0x32')]['length']?_0x553aa9[_0x03b9('0x32')]:_0x5c2cf4[_0x03b9('0x2d')];if(_0x47314b[_0x03b9('0x2e')][_0x03b9('0x3e')]){_0x553aa9[_0x03b9('0x3f')]=[{'all':!![]}];}_0x553aa9=_[_0x03b9('0x3c')]({},_0x553aa9,_0x47314b[_0x03b9('0x3d')]);return db[_0x03b9('0x28')][_0x03b9('0x44')](_0x553aa9)[_0x03b9('0x20')](handleEntityNotFound(_0x26c09c,null))['then'](respondWithResult(_0x26c09c,null))[_0x03b9('0x41')](handleError(_0x26c09c,null));};exports[_0x03b9('0x45')]=function(_0x27848f,_0x40bd1b){return db['SquareRecording']['create'](_0x27848f['body'],{})[_0x03b9('0x20')](respondWithResult(_0x40bd1b,0xc9))[_0x03b9('0x41')](handleError(_0x40bd1b,null));};exports['update']=function(_0x552cc1,_0x31a5c3){if(_0x552cc1[_0x03b9('0x46')]['id']){delete _0x552cc1['body']['id'];}return db['SquareRecording'][_0x03b9('0x44')]({'where':{'id':_0x552cc1['params']['id']}})[_0x03b9('0x20')](handleEntityNotFound(_0x31a5c3,null))[_0x03b9('0x20')](saveUpdates(_0x552cc1[_0x03b9('0x46')],null))[_0x03b9('0x20')](respondWithResult(_0x31a5c3,null))[_0x03b9('0x41')](handleError(_0x31a5c3,null));};exports[_0x03b9('0x47')]=function(_0x3902e6,_0x5b09a2,_0x32bd5e){var _0xab1bb2=require(_0x03b9('0x48'));var _0x3072b7=![];var _0x3fd67d={};if(_0x3902e6[_0x03b9('0x2e')][_0x03b9('0x2b')]&&_0x3902e6[_0x03b9('0x2e')][_0x03b9('0x2b')]===_0x03b9('0x49')){_0x3fd67d[_0x03b9('0x49')]=_0x3902e6['params']['id'];}else{_0x3fd67d['id']=_0x3902e6[_0x03b9('0x43')]['id'];}return db[_0x03b9('0x28')][_0x03b9('0x44')]({'where':_0x3fd67d,'attributes':['id',_0x03b9('0x4a'),'filename'],'raw':!![]})[_0x03b9('0x20')](handleEntityNotFound(_0x5b09a2,null))[_0x03b9('0x20')](function(_0x27d1df){if(_0x27d1df){var _0x4fd348=_0x27d1df[_0x03b9('0x4a')];var _0x32e0c8=util[_0x03b9('0x4b')](_0x03b9('0x4c'),_0x4fd348);if(fs[_0x03b9('0x4d')](_0x32e0c8)){_0x3072b7=!![];return _0xab1bb2[_0x03b9('0x4e')](_0x32e0c8,_0x4fd348,config[_0x03b9('0x4f')][_0x03b9('0x50')])['then'](function(){return _0x27d1df;});}return _0x27d1df;}})[_0x03b9('0x20')](function(_0x19d7cf){if(_0x19d7cf){var _0x2eb01c=_0x19d7cf[_0x03b9('0x4a')];if(!fs[_0x03b9('0x4d')](_0x2eb01c)){throw new db[(_0x03b9('0x51'))][(_0x03b9('0x52'))](_0x03b9('0x53'));}if(_0x19d7cf['filename']){return _0x5b09a2['download'](_0x2eb01c,_0x19d7cf[_0x03b9('0x54')]+path[_0x03b9('0x55')](_0x2eb01c),function(){if(_0x3072b7){fs[_0x03b9('0x56')](_0x2eb01c);}});}else{return _0x5b09a2['download'](_0x2eb01c,function(_0x338720){if(_0x3072b7){fs[_0x03b9('0x56')](_0x2eb01c);}});}}})[_0x03b9('0x41')](function(_0x3d62bb){if(_0x3d62bb[_0x03b9('0x57')]===_0x03b9('0x53')){_0x5b09a2[_0x03b9('0x18')](0x194)[_0x03b9('0x25')](_0x03b9('0x58'));}else{return handleError(_0x5b09a2,null);}});};exports['destroy']=function(_0x448868,_0x80572f){return db[_0x03b9('0x28')]['find']({'where':{'id':_0x448868[_0x03b9('0x43')]['id']}})['then'](function(_0x43fe15){if(_[_0x03b9('0x59')](_0x43fe15)){throw new ReferenceError(_0x03b9('0x5a'));}return _0x43fe15;})[_0x03b9('0x20')](function(_0x41797a){var _0x48c562=_0x41797a[_0x03b9('0x4a')];logger[_0x03b9('0x5b')]('cancellazione\x20fisica\x20documento\x20%s',_0x48c562);if(!_[_0x03b9('0x59')](_0x41797a[_0x03b9('0x4a')])&&fs['existsSync'](_0x48c562)){logger[_0x03b9('0x5b')](_0x03b9('0x5c')+_0x48c562+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x03b9('0x5d')](_0x48c562);}_0x48c562=_0x48c562+'.cypher';if(!_[_0x03b9('0x59')](_0x41797a[_0x03b9('0x4a')])&&fs[_0x03b9('0x4d')](_0x48c562)){logger['info'](_0x03b9('0x5c')+_0x48c562+_0x03b9('0x5e'));fs[_0x03b9('0x5d')](_0x48c562);}return _0x41797a;})[_0x03b9('0x20')](function(_0x45e820){if(!_0x45e820)throw new InternalError();return _0x45e820['destroy']();})['then'](function(){_0x80572f[_0x03b9('0x18')](0xcc)[_0x03b9('0x19')]();})[_0x03b9('0x41')](handleError(_0x80572f,null));}; \ No newline at end of file +var _0xa852=['recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets'];(function(_0x55efdd,_0x1c6191){var _0x15a63b=function(_0x2ac776){while(--_0x2ac776){_0x55efdd['push'](_0x55efdd['shift']());}};_0x15a63b(++_0x1c6191);}(_0xa852,0x1a2));var _0x2a85=function(_0x58f7ea,_0x3293a7){_0x58f7ea=_0x58f7ea-0x0;var _0x43b2b1=_0xa852[_0x58f7ea];return _0x43b2b1;};'use strict';var emlformat=require(_0x2a85('0x0'));var rimraf=require(_0x2a85('0x1'));var zipdir=require(_0x2a85('0x2'));var jsonpatch=require(_0x2a85('0x3'));var rp=require(_0x2a85('0x4'));var moment=require(_0x2a85('0x5'));var BPromise=require(_0x2a85('0x6'));var Mustache=require('mustache');var util=require(_0x2a85('0x7'));var path=require(_0x2a85('0x8'));var sox=require('sox');var csv=require(_0x2a85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a85('0xa'));var _=require(_0x2a85('0xb'));var squel=require(_0x2a85('0xc'));var crypto=require(_0x2a85('0xd'));var jsforce=require(_0x2a85('0xe'));var deskjs=require(_0x2a85('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2a85('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2a85('0x11'));var qs=require(_0x2a85('0x12'));var as=require(_0x2a85('0x13'));var hardwareService=require(_0x2a85('0x14'));var logger=require(_0x2a85('0x15'))(_0x2a85('0x16'));var utils=require(_0x2a85('0x17'));var config=require(_0x2a85('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a85('0x19'))['db'];function respondWithStatusCode(_0x55360b,_0x517cd0){_0x517cd0=_0x517cd0||0xcc;return function(_0x1bc86b){if(_0x1bc86b){return _0x55360b[_0x2a85('0x1a')](_0x517cd0);}return _0x55360b['status'](_0x517cd0)[_0x2a85('0x1b')]();};}function respondWithResult(_0x3ddbcc,_0x4a8a7a){_0x4a8a7a=_0x4a8a7a||0xc8;return function(_0x1d3dfc){if(_0x1d3dfc){return _0x3ddbcc['status'](_0x4a8a7a)[_0x2a85('0x1c')](_0x1d3dfc);}};}function respondWithFilteredResult(_0x493c16,_0x44b775){return function(_0x2e07e0){if(_0x2e07e0){var _0x2c2356=typeof _0x44b775[_0x2a85('0x1d')]===_0x2a85('0x1e')&&typeof _0x44b775[_0x2a85('0x1f')]===_0x2a85('0x1e');var _0x30702b=_0x2e07e0[_0x2a85('0x20')];var _0x4cc3fe=_0x2c2356?0x0:_0x44b775[_0x2a85('0x1d')];var _0x176e39=_0x2c2356?_0x2e07e0['count']:_0x44b775['offset']+_0x44b775['limit'];var _0x4af923;if(_0x176e39>=_0x30702b){_0x176e39=_0x30702b;_0x4af923=0xc8;}else{_0x4af923=0xce;}_0x493c16[_0x2a85('0x21')](_0x4af923);return _0x493c16[_0x2a85('0x22')](_0x2a85('0x23'),_0x4cc3fe+'-'+_0x176e39+'/'+_0x30702b)[_0x2a85('0x1c')](_0x2e07e0);}return null;};}function patchUpdates(_0x26ef81){return function(_0x2a860c){try{jsonpatch['apply'](_0x2a860c,_0x26ef81,!![]);}catch(_0x308622){return BPromise[_0x2a85('0x24')](_0x308622);}return _0x2a860c[_0x2a85('0x25')]();};}function saveUpdates(_0x1d2b13,_0x35bfb6){return function(_0x3e294d){if(_0x3e294d){return _0x3e294d[_0x2a85('0x26')](_0x1d2b13)[_0x2a85('0x27')](function(_0x3e4791){return _0x3e4791;});}return null;};}function removeEntity(_0x12b471,_0x5c7efc){return function(_0x2783ba){if(_0x2783ba){return _0x2783ba[_0x2a85('0x28')]()['then'](function(){_0x12b471[_0x2a85('0x21')](0xcc)[_0x2a85('0x1b')]();});}};}function handleEntityNotFound(_0x1b7822,_0x526509){return function(_0x4ada08){if(!_0x4ada08){_0x1b7822[_0x2a85('0x1a')](0x194);}return _0x4ada08;};}function handleError(_0x38370a,_0x16abab){_0x16abab=_0x16abab||0x1f4;return function(_0x7b973f){logger[_0x2a85('0x29')](_0x7b973f[_0x2a85('0x2a')]);if(_0x7b973f['name']){delete _0x7b973f[_0x2a85('0x2b')];}_0x38370a[_0x2a85('0x21')](_0x16abab)[_0x2a85('0x2c')](_0x7b973f);};}exports['index']=function(_0x956c07,_0x18537b){var _0x21408a={},_0x5cf7bd={},_0x904fd5={'count':0x0,'rows':[]};var _0x13197d=_['map'](db[_0x2a85('0x2d')][_0x2a85('0x2e')],function(_0x11177b){return{'name':_0x11177b['fieldName'],'type':_0x11177b[_0x2a85('0x2f')][_0x2a85('0x30')]};});_0x5cf7bd[_0x2a85('0x31')]=_[_0x2a85('0x32')](_0x13197d,'name');_0x5cf7bd[_0x2a85('0x33')]=_[_0x2a85('0x34')](_0x956c07['query']);_0x5cf7bd['filters']=_[_0x2a85('0x35')](_0x5cf7bd[_0x2a85('0x31')],_0x5cf7bd['query']);_0x21408a[_0x2a85('0x36')]=_[_0x2a85('0x35')](_0x5cf7bd['model'],qs[_0x2a85('0x37')](_0x956c07['query'][_0x2a85('0x37')]));_0x21408a['attributes']=_0x21408a['attributes'][_0x2a85('0x38')]?_0x21408a['attributes']:_0x5cf7bd['model'];if(!_0x956c07[_0x2a85('0x33')][_0x2a85('0x39')]('nolimit')){_0x21408a[_0x2a85('0x1f')]=qs['limit'](_0x956c07[_0x2a85('0x33')][_0x2a85('0x1f')]);_0x21408a[_0x2a85('0x1d')]=qs[_0x2a85('0x1d')](_0x956c07[_0x2a85('0x33')]['offset']);}_0x21408a[_0x2a85('0x3a')]=qs[_0x2a85('0x3b')](_0x956c07[_0x2a85('0x33')][_0x2a85('0x3b')]);_0x21408a[_0x2a85('0x3c')]=qs[_0x2a85('0x3d')](_[_0x2a85('0x3e')](_0x956c07['query'],_0x5cf7bd[_0x2a85('0x3d')]),_0x13197d);if(_0x956c07[_0x2a85('0x33')]['filter']){_0x21408a[_0x2a85('0x3c')]=_[_0x2a85('0x3f')](_0x21408a[_0x2a85('0x3c')],{'$or':_[_0x2a85('0x32')](_0x13197d,function(_0x5805fa){if(_0x5805fa[_0x2a85('0x2f')]!==_0x2a85('0x40')){var _0x6a2de2={};_0x6a2de2[_0x5805fa[_0x2a85('0x2b')]]={'$like':'%'+_0x956c07['query'][_0x2a85('0x41')]+'%'};return _0x6a2de2;}})});}_0x21408a=_[_0x2a85('0x3f')]({},_0x21408a,_0x956c07['options']);var _0x22fb8a={'where':_0x21408a['where']};return db['SquareRecording']['count'](_0x22fb8a)[_0x2a85('0x27')](function(_0x229a9d){_0x904fd5[_0x2a85('0x20')]=_0x229a9d;if(_0x956c07['query'][_0x2a85('0x42')]){_0x21408a['include']=[{'all':!![]}];}return db[_0x2a85('0x2d')][_0x2a85('0x43')](_0x21408a);})[_0x2a85('0x27')](function(_0x1d9dcc){_0x904fd5[_0x2a85('0x44')]=_0x1d9dcc;return _0x904fd5;})[_0x2a85('0x27')](respondWithFilteredResult(_0x18537b,_0x21408a))['catch'](handleError(_0x18537b,null));};exports[_0x2a85('0x45')]=function(_0x68cc8,_0x38dae2){var _0x5a0d06={'raw':!![],'where':{'id':_0x68cc8[_0x2a85('0x46')]['id']}},_0x746ef7={};_0x746ef7['model']=_['keys'](db[_0x2a85('0x2d')][_0x2a85('0x2e')]);_0x746ef7['query']=_[_0x2a85('0x34')](_0x68cc8[_0x2a85('0x33')]);_0x746ef7[_0x2a85('0x3d')]=_[_0x2a85('0x35')](_0x746ef7['model'],_0x746ef7['query']);_0x5a0d06['attributes']=_['intersection'](_0x746ef7[_0x2a85('0x31')],qs[_0x2a85('0x37')](_0x68cc8['query'][_0x2a85('0x37')]));_0x5a0d06[_0x2a85('0x36')]=_0x5a0d06[_0x2a85('0x36')][_0x2a85('0x38')]?_0x5a0d06[_0x2a85('0x36')]:_0x746ef7[_0x2a85('0x31')];if(_0x68cc8[_0x2a85('0x33')][_0x2a85('0x42')]){_0x5a0d06[_0x2a85('0x47')]=[{'all':!![]}];}_0x5a0d06=_[_0x2a85('0x3f')]({},_0x5a0d06,_0x68cc8[_0x2a85('0x48')]);return db[_0x2a85('0x2d')][_0x2a85('0x49')](_0x5a0d06)[_0x2a85('0x27')](handleEntityNotFound(_0x38dae2,null))[_0x2a85('0x27')](respondWithResult(_0x38dae2,null))[_0x2a85('0x4a')](handleError(_0x38dae2,null));};exports['create']=function(_0x2eee81,_0x170dbb){return db[_0x2a85('0x2d')][_0x2a85('0x4b')](_0x2eee81[_0x2a85('0x4c')],{})[_0x2a85('0x27')](respondWithResult(_0x170dbb,0xc9))[_0x2a85('0x4a')](handleError(_0x170dbb,null));};exports[_0x2a85('0x26')]=function(_0x56f2cc,_0x3551bd){if(_0x56f2cc[_0x2a85('0x4c')]['id']){delete _0x56f2cc[_0x2a85('0x4c')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x56f2cc[_0x2a85('0x46')]['id']}})[_0x2a85('0x27')](handleEntityNotFound(_0x3551bd,null))[_0x2a85('0x27')](saveUpdates(_0x56f2cc[_0x2a85('0x4c')],null))['then'](respondWithResult(_0x3551bd,null))[_0x2a85('0x4a')](handleError(_0x3551bd,null));};exports[_0x2a85('0x4d')]=function(_0x2be4a4,_0x2534a4,_0x305c84){var _0x4aca38=require(_0x2a85('0x4e'));var _0x3cbaf9=![];var _0x347d43={};if(_0x2be4a4['query'][_0x2a85('0x2f')]&&_0x2be4a4['query'][_0x2a85('0x2f')]===_0x2a85('0x4f')){_0x347d43[_0x2a85('0x4f')]=_0x2be4a4[_0x2a85('0x46')]['id'];}else{_0x347d43['id']=_0x2be4a4[_0x2a85('0x46')]['id'];}return db[_0x2a85('0x2d')]['find']({'where':_0x347d43,'attributes':['id',_0x2a85('0x50'),_0x2a85('0x51')],'raw':!![]})[_0x2a85('0x27')](handleEntityNotFound(_0x2534a4,null))['then'](function(_0x56f16c){if(_0x56f16c){var _0x3eb96a=_0x56f16c[_0x2a85('0x50')];var _0x2f1f85=util[_0x2a85('0x52')](_0x2a85('0x53'),_0x3eb96a);if(fs[_0x2a85('0x54')](_0x2f1f85)){_0x3cbaf9=!![];return _0x4aca38[_0x2a85('0x55')](_0x2f1f85,_0x3eb96a,config[_0x2a85('0x56')][_0x2a85('0x57')])['then'](function(){return _0x56f16c;});}return _0x56f16c;}})[_0x2a85('0x27')](function(_0x42f2ce){if(_0x42f2ce){var _0x2094cd=_0x42f2ce[_0x2a85('0x50')];if(!fs[_0x2a85('0x54')](_0x2094cd)){throw new db[(_0x2a85('0x58'))]['ValidationError'](_0x2a85('0x59'));}if(_0x42f2ce[_0x2a85('0x51')]){return _0x2534a4[_0x2a85('0x4d')](_0x2094cd,_0x42f2ce[_0x2a85('0x51')]+path[_0x2a85('0x5a')](_0x2094cd),function(){if(_0x3cbaf9){fs[_0x2a85('0x5b')](_0x2094cd);}});}else{return _0x2534a4['download'](_0x2094cd,function(_0x1c8e2a){if(_0x3cbaf9){fs[_0x2a85('0x5b')](_0x2094cd);}});}}})[_0x2a85('0x4a')](function(_0x5a4c26){if(_0x5a4c26[_0x2a85('0x5c')]===_0x2a85('0x59')){_0x2534a4['status'](0x194)[_0x2a85('0x2c')](_0x2a85('0x5d'));}else{return handleError(_0x2534a4,null);}});};exports[_0x2a85('0x28')]=function(_0x111f93,_0x19c01a){return db[_0x2a85('0x2d')][_0x2a85('0x49')]({'where':{'id':_0x111f93[_0x2a85('0x46')]['id']}})[_0x2a85('0x27')](function(_0x569a68){if(_['isNil'](_0x569a68)){throw new ReferenceError('Entity\x20not\x20found');}return _0x569a68;})[_0x2a85('0x27')](function(_0x46cc64){var _0x4b7ce6=_0x46cc64[_0x2a85('0x50')];logger['info'](_0x2a85('0x5e'),_0x4b7ce6);if(!_[_0x2a85('0x5f')](_0x46cc64['savePath'])&&fs['existsSync'](_0x4b7ce6)){logger[_0x2a85('0x60')]('File:\x20\x22'+_0x4b7ce6+_0x2a85('0x61'));fs[_0x2a85('0x62')](_0x4b7ce6);}_0x4b7ce6=_0x4b7ce6+_0x2a85('0x63');if(!_[_0x2a85('0x5f')](_0x46cc64[_0x2a85('0x50')])&&fs[_0x2a85('0x54')](_0x4b7ce6)){logger['info'](_0x2a85('0x64')+_0x4b7ce6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2a85('0x62')](_0x4b7ce6);}return _0x46cc64;})[_0x2a85('0x27')](function(_0x22c90c){if(!_0x22c90c)throw new InternalError();return _0x22c90c['destroy']();})[_0x2a85('0x27')](function(){_0x19c01a[_0x2a85('0x21')](0xcc)[_0x2a85('0x1b')]();})[_0x2a85('0x4a')](handleError(_0x19c01a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 50e4f70..df1abaf 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 _0x16ce=['square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','./squareRecording.attributes','define','SquareRecording'];(function(_0x16a82a,_0x1e00e4){var _0x401b80=function(_0x421dfc){while(--_0x421dfc){_0x16a82a['push'](_0x16a82a['shift']());}};_0x401b80(++_0x1e00e4);}(_0x16ce,0xfb));var _0xe16c=function(_0x2c3d32,_0x1e03dd){_0x2c3d32=_0x2c3d32-0x0;var _0x1bab0c=_0x16ce[_0x2c3d32];return _0x1bab0c;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var logger=require(_0xe16c('0x1'))(_0xe16c('0x2'));var moment=require(_0xe16c('0x3'));var BPromise=require(_0xe16c('0x4'));var rp=require(_0xe16c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe16c('0x6'));module['exports']=function(_0x1707f9,_0x13ee4a){return _0x1707f9[_0xe16c('0x7')](_0xe16c('0x8'),attributes,{'tableName':_0xe16c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bd0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x363143,_0x229d84){var _0x11bc33=function(_0x299f03){while(--_0x299f03){_0x363143['push'](_0x363143['shift']());}};_0x11bc33(++_0x229d84);}(_0x7bd0,0x111));var _0x07bd=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x7bd0[_0x2c7dc6];return _0x10002b;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 041e6ad..4b8d366 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 _0x94f9=['moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util'];(function(_0x22566a,_0x409733){var _0x47fff6=function(_0x15e481){while(--_0x15e481){_0x22566a['push'](_0x22566a['shift']());}};_0x47fff6(++_0x409733);}(_0x94f9,0x194));var _0x994f=function(_0x54c778,_0x4a859f){_0x54c778=_0x54c778-0x0;var _0x2c4be9=_0x94f9[_0x54c778];return _0x2c4be9;};'use strict';var _=require('lodash');var util=require(_0x994f('0x0'));var moment=require(_0x994f('0x1'));var BPromise=require(_0x994f('0x2'));var rs=require(_0x994f('0x3'));var fs=require('fs');var Redis=require(_0x994f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x994f('0x5'))('rpc');var config=require(_0x994f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x994f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496b24,_0x1c8eb7,_0xff9a53){return new BPromise(function(_0x124a20,_0x4021c3){return client[_0x994f('0x8')](_0x496b24,_0xff9a53)[_0x994f('0x9')](function(_0x1605e0){logger[_0x994f('0xa')](_0x994f('0xb'),_0x1c8eb7,'request\x20sent');logger[_0x994f('0xc')](_0x994f('0xd'),_0x1c8eb7,_0x994f('0xe'),JSON[_0x994f('0xf')](_0x1605e0));if(_0x1605e0[_0x994f('0x10')]){if(_0x1605e0[_0x994f('0x10')][_0x994f('0x11')]===0x1f4){logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);return _0x4021c3(_0x1605e0[_0x994f('0x10')]['message']);}logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);return _0x124a20(_0x1605e0[_0x994f('0x10')][_0x994f('0x12')]);}else{logger['info'](_0x994f('0xb'),_0x1c8eb7,_0x994f('0xe'));_0x124a20(_0x1605e0[_0x994f('0x13')][_0x994f('0x12')]);}})[_0x994f('0x14')](function(_0x10c3d7){logger[_0x994f('0x10')](_0x994f('0xb'),_0x1c8eb7,_0x10c3d7);_0x4021c3(_0x10c3d7);});});}exports[_0x994f('0x15')]=function(_0x4da3e4){var _0x4008ee=this;return new Promise(function(_0x283c64,_0x2d598e){return db[_0x994f('0x16')][_0x994f('0x17')](_0x4da3e4[_0x994f('0x18')],{'raw':_0x4da3e4[_0x994f('0x19')]?_0x4da3e4[_0x994f('0x19')][_0x994f('0x1a')]===undefined?!![]:![]:!![]})[_0x994f('0x9')](function(_0x525445){logger['info'](_0x994f('0x15'),_0x4da3e4);logger[_0x994f('0xc')](_0x994f('0x15'),_0x4da3e4,JSON['stringify'](_0x525445));_0x283c64(_0x525445);})[_0x994f('0x14')](function(_0x17d714){logger[_0x994f('0x10')](_0x994f('0x15'),_0x17d714[_0x994f('0x12')],_0x4da3e4);_0x2d598e(_0x4008ee[_0x994f('0x10')](0x1f4,_0x17d714[_0x994f('0x12')]));});});}; \ No newline at end of file +var _0x9e6f=['debug','error','code','SquareRecording,\x20%s,\x20%s','message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x9e6f,0x19d));var _0xf9e6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x9e6f[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xf9e6('0x0'));var util=require(_0xf9e6('0x1'));var moment=require(_0xf9e6('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9e6('0x5'))(_0xf9e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xf9e6('0x7'));var client=jayson[_0xf9e6('0x8')][_0xf9e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12e85e,_0x5589c6,_0x51bc35){return new BPromise(function(_0x1822a7,_0x389983){return client[_0xf9e6('0xa')](_0x12e85e,_0x51bc35)['then'](function(_0x27f2dd){logger['info']('SquareRecording,\x20%s,\x20%s',_0x5589c6,_0xf9e6('0xb'));logger[_0xf9e6('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5589c6,_0xf9e6('0xb'),JSON['stringify'](_0x27f2dd));if(_0x27f2dd[_0xf9e6('0xd')]){if(_0x27f2dd[_0xf9e6('0xd')][_0xf9e6('0xe')]===0x1f4){logger['error'](_0xf9e6('0xf'),_0x5589c6,_0x27f2dd[_0xf9e6('0xd')][_0xf9e6('0x10')]);return _0x389983(_0x27f2dd[_0xf9e6('0xd')][_0xf9e6('0x10')]);}logger[_0xf9e6('0xd')](_0xf9e6('0xf'),_0x5589c6,_0x27f2dd[_0xf9e6('0xd')][_0xf9e6('0x10')]);return _0x1822a7(_0x27f2dd[_0xf9e6('0xd')][_0xf9e6('0x10')]);}else{logger[_0xf9e6('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5589c6,'request\x20sent');_0x1822a7(_0x27f2dd[_0xf9e6('0x12')]['message']);}})[_0xf9e6('0x13')](function(_0x2346df){logger[_0xf9e6('0xd')](_0xf9e6('0xf'),_0x5589c6,_0x2346df);_0x389983(_0x2346df);});});}exports[_0xf9e6('0x14')]=function(_0x3924d7){var _0xf65b5a=this;return new Promise(function(_0x3365e1,_0x2e5f07){return db[_0xf9e6('0x15')]['create'](_0x3924d7[_0xf9e6('0x16')],{'raw':_0x3924d7[_0xf9e6('0x17')]?_0x3924d7[_0xf9e6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1b79cf){logger[_0xf9e6('0x11')](_0xf9e6('0x14'),_0x3924d7);logger[_0xf9e6('0xc')](_0xf9e6('0x14'),_0x3924d7,JSON[_0xf9e6('0x18')](_0x1b79cf));_0x3365e1(_0x1b79cf);})[_0xf9e6('0x13')](function(_0x1481bd){logger[_0xf9e6('0xd')](_0xf9e6('0x14'),_0x1481bd[_0xf9e6('0x10')],_0x3924d7);_0x2e5f07(_0xf65b5a['error'](0x1f4,_0x1481bd[_0xf9e6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9428504..64b5324 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_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('./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 5cafe4b..76ef8b3 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 _0x1dba=['sequelize','STRING','BOOLEAN'];(function(_0xf7b283,_0xd807fa){var _0x48ac64=function(_0x53e795){while(--_0x53e795){_0xf7b283['push'](_0xf7b283['shift']());}};_0x48ac64(++_0xd807fa);}(_0x1dba,0xf9));var _0xa1db=function(_0x406b38,_0x48f4be){_0x406b38=_0x406b38-0x0;var _0x2650cc=_0x1dba[_0x406b38];return _0x2650cc;};'use strict';var Sequelize=require(_0xa1db('0x0'));module['exports']={'network':{'type':Sequelize[_0xa1db('0x1')]},'network_script':{'type':Sequelize[_0xa1db('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa1db('0x1')]},'type':{'type':Sequelize[_0xa1db('0x1')]},'uniqueid':{'type':Sequelize[_0xa1db('0x1')]},'version':{'type':Sequelize[_0xa1db('0x1')]},'callerid':{'type':Sequelize[_0xa1db('0x1')]},'calleridname':{'type':Sequelize[_0xa1db('0x1')]},'callingpres':{'type':Sequelize[_0xa1db('0x1')]},'callingani2':{'type':Sequelize[_0xa1db('0x1')]},'callington':{'type':Sequelize[_0xa1db('0x1')]},'callingtns':{'type':Sequelize[_0xa1db('0x1')]},'dnid':{'type':Sequelize[_0xa1db('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa1db('0x1')]},'extension':{'type':Sequelize[_0xa1db('0x1')]},'priority':{'type':Sequelize[_0xa1db('0x1')]},'enhanced':{'type':Sequelize[_0xa1db('0x1')]},'accountcode':{'type':Sequelize[_0xa1db('0x1')]},'threadid':{'type':Sequelize[_0xa1db('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa1db('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xa10d=['STRING','DATE','BOOLEAN'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa10d,0x14d));var _0xda10=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa10d[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xda10('0x0')]},'network_script':{'type':Sequelize[_0xda10('0x0')]},'request':{'type':Sequelize[_0xda10('0x0')]},'channel':{'type':Sequelize[_0xda10('0x0')]},'language':{'type':Sequelize[_0xda10('0x0')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xda10('0x0')]},'version':{'type':Sequelize[_0xda10('0x0')]},'callerid':{'type':Sequelize[_0xda10('0x0')]},'calleridname':{'type':Sequelize[_0xda10('0x0')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xda10('0x0')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xda10('0x0')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xda10('0x0')]},'context':{'type':Sequelize[_0xda10('0x0')]},'extension':{'type':Sequelize[_0xda10('0x0')]},'priority':{'type':Sequelize[_0xda10('0x0')]},'enhanced':{'type':Sequelize[_0xda10('0x0')]},'accountcode':{'type':Sequelize[_0xda10('0x0')]},'threadid':{'type':Sequelize[_0xda10('0x0')]},'project_name':{'type':Sequelize[_0xda10('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xda10('0x1')]},'bot':{'type':Sequelize[_0xda10('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index ce85897..5e424b7 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 _0x2e27=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','filters','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x2e27,0xcf));var _0x72e2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x2e27[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x72e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72e2('0x1'));var jsonpatch=require(_0x72e2('0x2'));var rp=require('request-promise');var moment=require(_0x72e2('0x3'));var BPromise=require(_0x72e2('0x4'));var Mustache=require(_0x72e2('0x5'));var util=require(_0x72e2('0x6'));var path=require('path');var sox=require(_0x72e2('0x7'));var csv=require(_0x72e2('0x8'));var ejs=require(_0x72e2('0x9'));var fs=require('fs');var fs_extra=require(_0x72e2('0xa'));var _=require(_0x72e2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x72e2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x72e2('0xd'));var Papa=require('papaparse');var Redis=require(_0x72e2('0xe'));var authService=require(_0x72e2('0xf'));var qs=require(_0x72e2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72e2('0x11'));var logger=require(_0x72e2('0x12'))(_0x72e2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x72e2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x232fef,_0x450cc7){_0x450cc7=_0x450cc7||0xcc;return function(_0x3ebc98){if(_0x3ebc98){return _0x232fef[_0x72e2('0x15')](_0x450cc7);}return _0x232fef[_0x72e2('0x16')](_0x450cc7)[_0x72e2('0x17')]();};}function respondWithResult(_0x23a591,_0x5b5ab1){_0x5b5ab1=_0x5b5ab1||0xc8;return function(_0x1dcf94){if(_0x1dcf94){return _0x23a591[_0x72e2('0x16')](_0x5b5ab1)[_0x72e2('0x18')](_0x1dcf94);}};}function respondWithFilteredResult(_0x128afc,_0x3f5d09){return function(_0x399d3b){if(_0x399d3b){var _0x484893=typeof _0x3f5d09[_0x72e2('0x19')]===_0x72e2('0x1a')&&typeof _0x3f5d09[_0x72e2('0x1b')]==='undefined';var _0x37fc1d=_0x399d3b[_0x72e2('0x1c')];var _0x1dfdcd=_0x484893?0x0:_0x3f5d09[_0x72e2('0x19')];var _0x3f4ab3=_0x484893?_0x399d3b[_0x72e2('0x1c')]:_0x3f5d09[_0x72e2('0x19')]+_0x3f5d09[_0x72e2('0x1b')];var _0x3c4dd9;if(_0x3f4ab3>=_0x37fc1d){_0x3f4ab3=_0x37fc1d;_0x3c4dd9=0xc8;}else{_0x3c4dd9=0xce;}_0x128afc[_0x72e2('0x16')](_0x3c4dd9);return _0x128afc[_0x72e2('0x1d')]('Content-Range',_0x1dfdcd+'-'+_0x3f4ab3+'/'+_0x37fc1d)['json'](_0x399d3b);}return null;};}function patchUpdates(_0x2c7e4b){return function(_0x17041a){try{jsonpatch[_0x72e2('0x1e')](_0x17041a,_0x2c7e4b,!![]);}catch(_0x26f384){return BPromise[_0x72e2('0x1f')](_0x26f384);}return _0x17041a[_0x72e2('0x20')]();};}function saveUpdates(_0x36b981,_0x4683a6){return function(_0x46b8f7){if(_0x46b8f7){return _0x46b8f7[_0x72e2('0x21')](_0x36b981)[_0x72e2('0x22')](function(_0x1fc411){return _0x1fc411;});}return null;};}function removeEntity(_0x2d1c9f,_0x39c70a){return function(_0x591644){if(_0x591644){return _0x591644['destroy']()[_0x72e2('0x22')](function(){_0x2d1c9f[_0x72e2('0x16')](0xcc)[_0x72e2('0x17')]();});}};}function handleEntityNotFound(_0x2379a7,_0x3b552f){return function(_0x24e3f7){if(!_0x24e3f7){_0x2379a7['sendStatus'](0x194);}return _0x24e3f7;};}function handleError(_0x2c6503,_0xb108eb){_0xb108eb=_0xb108eb||0x1f4;return function(_0x427c14){logger[_0x72e2('0x23')](_0x427c14[_0x72e2('0x24')]);if(_0x427c14[_0x72e2('0x25')]){delete _0x427c14['name'];}_0x2c6503['status'](_0xb108eb)['send'](_0x427c14);};}exports[_0x72e2('0x26')]=function(_0x3dcfd2,_0x158ddf){var _0x58e1a4={},_0x28a8b5={},_0x23c46b={'count':0x0,'rows':[]};var _0x20805f=_[_0x72e2('0x27')](db[_0x72e2('0x28')][_0x72e2('0x29')],function(_0x2e2083){return{'name':_0x2e2083[_0x72e2('0x2a')],'type':_0x2e2083[_0x72e2('0x2b')]['key']};});_0x28a8b5[_0x72e2('0x2c')]=_['map'](_0x20805f,_0x72e2('0x25'));_0x28a8b5[_0x72e2('0x2d')]=_['keys'](_0x3dcfd2[_0x72e2('0x2d')]);_0x28a8b5['filters']=_[_0x72e2('0x2e')](_0x28a8b5['model'],_0x28a8b5[_0x72e2('0x2d')]);_0x58e1a4[_0x72e2('0x2f')]=_[_0x72e2('0x2e')](_0x28a8b5[_0x72e2('0x2c')],qs[_0x72e2('0x30')](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x30')]));_0x58e1a4[_0x72e2('0x2f')]=_0x58e1a4[_0x72e2('0x2f')][_0x72e2('0x31')]?_0x58e1a4[_0x72e2('0x2f')]:_0x28a8b5[_0x72e2('0x2c')];if(!_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x32')](_0x72e2('0x33'))){_0x58e1a4[_0x72e2('0x1b')]=qs['limit'](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x1b')]);_0x58e1a4[_0x72e2('0x19')]=qs[_0x72e2('0x19')](_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x19')]);}_0x58e1a4[_0x72e2('0x34')]=qs[_0x72e2('0x35')](_0x3dcfd2[_0x72e2('0x2d')]['sort']);_0x58e1a4[_0x72e2('0x36')]=qs['filters'](_[_0x72e2('0x37')](_0x3dcfd2[_0x72e2('0x2d')],_0x28a8b5['filters']),_0x20805f);if(_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x38')]){_0x58e1a4['where']=_[_0x72e2('0x39')](_0x58e1a4['where'],{'$or':_['map'](_0x20805f,function(_0x1efb4f){if(_0x1efb4f[_0x72e2('0x2b')]!==_0x72e2('0x3a')){var _0x5a52c0={};_0x5a52c0[_0x1efb4f[_0x72e2('0x25')]]={'$like':'%'+_0x3dcfd2['query'][_0x72e2('0x38')]+'%'};return _0x5a52c0;}})});}_0x58e1a4=_['merge']({},_0x58e1a4,_0x3dcfd2[_0x72e2('0x3b')]);var _0x4fde5c={'where':_0x58e1a4[_0x72e2('0x36')]};return db['SquareReport']['count'](_0x4fde5c)[_0x72e2('0x22')](function(_0x511adc){_0x23c46b[_0x72e2('0x1c')]=_0x511adc;if(_0x3dcfd2[_0x72e2('0x2d')][_0x72e2('0x3c')]){_0x58e1a4[_0x72e2('0x3d')]=[{'all':!![]}];}return db[_0x72e2('0x28')][_0x72e2('0x3e')](_0x58e1a4);})['then'](function(_0x1aebdb){_0x23c46b['rows']=_0x1aebdb;return _0x23c46b;})[_0x72e2('0x22')](respondWithFilteredResult(_0x158ddf,_0x58e1a4))[_0x72e2('0x3f')](handleError(_0x158ddf,null));};exports[_0x72e2('0x40')]=function(_0x181837,_0x5a2b8e){var _0x36beb5={'raw':!![],'where':{'id':_0x181837[_0x72e2('0x41')]['id']}},_0x5d53cc={};_0x5d53cc[_0x72e2('0x2c')]=_[_0x72e2('0x42')](db[_0x72e2('0x28')][_0x72e2('0x29')]);_0x5d53cc['query']=_[_0x72e2('0x42')](_0x181837[_0x72e2('0x2d')]);_0x5d53cc[_0x72e2('0x43')]=_['intersection'](_0x5d53cc[_0x72e2('0x2c')],_0x5d53cc['query']);_0x36beb5[_0x72e2('0x2f')]=_['intersection'](_0x5d53cc[_0x72e2('0x2c')],qs[_0x72e2('0x30')](_0x181837[_0x72e2('0x2d')][_0x72e2('0x30')]));_0x36beb5[_0x72e2('0x2f')]=_0x36beb5['attributes'][_0x72e2('0x31')]?_0x36beb5['attributes']:_0x5d53cc[_0x72e2('0x2c')];if(_0x181837[_0x72e2('0x2d')][_0x72e2('0x3c')]){_0x36beb5[_0x72e2('0x3d')]=[{'all':!![]}];}_0x36beb5=_['merge']({},_0x36beb5,_0x181837[_0x72e2('0x3b')]);return db[_0x72e2('0x28')][_0x72e2('0x44')](_0x36beb5)[_0x72e2('0x22')](handleEntityNotFound(_0x5a2b8e,null))[_0x72e2('0x22')](respondWithResult(_0x5a2b8e,null))['catch'](handleError(_0x5a2b8e,null));};exports[_0x72e2('0x45')]=function(_0x42498a,_0xb661fd){return db[_0x72e2('0x28')]['create'](_0x42498a[_0x72e2('0x46')],{})['then'](respondWithResult(_0xb661fd,0xc9))[_0x72e2('0x3f')](handleError(_0xb661fd,null));};exports[_0x72e2('0x21')]=function(_0x2c36b2,_0x54c55b){if(_0x2c36b2['body']['id']){delete _0x2c36b2[_0x72e2('0x46')]['id'];}return db[_0x72e2('0x28')][_0x72e2('0x44')]({'where':{'id':_0x2c36b2['params']['id']}})['then'](handleEntityNotFound(_0x54c55b,null))[_0x72e2('0x22')](saveUpdates(_0x2c36b2['body'],null))['then'](respondWithResult(_0x54c55b,null))[_0x72e2('0x3f')](handleError(_0x54c55b,null));};exports[_0x72e2('0x47')]=function(_0x3809b5,_0x58fcac){return db[_0x72e2('0x28')][_0x72e2('0x44')]({'where':{'id':_0x3809b5['params']['id']}})[_0x72e2('0x22')](handleEntityNotFound(_0x58fcac,null))['then'](removeEntity(_0x58fcac,null))[_0x72e2('0x3f')](handleError(_0x58fcac,null));};exports['describe']=function(_0x2c36c9,_0x23052a){return db[_0x72e2('0x28')][_0x72e2('0x48')]()[_0x72e2('0x22')](respondWithResult(_0x23052a,null))[_0x72e2('0x3f')](handleError(_0x23052a,null));}; \ No newline at end of file +var _0xabdc=['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','status','json','limit','undefined','count','offset','set','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','filter','options','includeAll','include','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xabdc,0xd4));var _0xcabd=function(_0x323529,_0x3d685a){_0x323529=_0x323529-0x0;var _0x4a71dd=_0xabdc[_0x323529];return _0x4a71dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcabd('0x0'));var zipdir=require(_0xcabd('0x1'));var jsonpatch=require(_0xcabd('0x2'));var rp=require(_0xcabd('0x3'));var moment=require(_0xcabd('0x4'));var BPromise=require(_0xcabd('0x5'));var Mustache=require(_0xcabd('0x6'));var util=require(_0xcabd('0x7'));var path=require(_0xcabd('0x8'));var sox=require(_0xcabd('0x9'));var csv=require(_0xcabd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcabd('0xb'));var _=require(_0xcabd('0xc'));var squel=require(_0xcabd('0xd'));var crypto=require(_0xcabd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcabd('0xf'));var toCsv=require(_0xcabd('0xa'));var querystring=require(_0xcabd('0x10'));var Papa=require(_0xcabd('0x11'));var Redis=require(_0xcabd('0x12'));var authService=require(_0xcabd('0x13'));var qs=require(_0xcabd('0x14'));var as=require(_0xcabd('0x15'));var hardwareService=require(_0xcabd('0x16'));var logger=require(_0xcabd('0x17'))(_0xcabd('0x18'));var utils=require(_0xcabd('0x19'));var config=require(_0xcabd('0x1a'));var licenseUtil=require(_0xcabd('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d500,_0x455c73){_0x455c73=_0x455c73||0xcc;return function(_0x3eed1a){if(_0x3eed1a){return _0x27d500['sendStatus'](_0x455c73);}return _0x27d500['status'](_0x455c73)['end']();};}function respondWithResult(_0x51ec2a,_0x5b2176){_0x5b2176=_0x5b2176||0xc8;return function(_0x1f8d3f){if(_0x1f8d3f){return _0x51ec2a[_0xcabd('0x1c')](_0x5b2176)[_0xcabd('0x1d')](_0x1f8d3f);}};}function respondWithFilteredResult(_0x22a8c2,_0x5510ee){return function(_0x8f7ce8){if(_0x8f7ce8){var _0x272dfd=typeof _0x5510ee['offset']==='undefined'&&typeof _0x5510ee[_0xcabd('0x1e')]===_0xcabd('0x1f');var _0x5f2b03=_0x8f7ce8[_0xcabd('0x20')];var _0x25b45e=_0x272dfd?0x0:_0x5510ee[_0xcabd('0x21')];var _0x18d217=_0x272dfd?_0x8f7ce8[_0xcabd('0x20')]:_0x5510ee[_0xcabd('0x21')]+_0x5510ee[_0xcabd('0x1e')];var _0x418d2b;if(_0x18d217>=_0x5f2b03){_0x18d217=_0x5f2b03;_0x418d2b=0xc8;}else{_0x418d2b=0xce;}_0x22a8c2[_0xcabd('0x1c')](_0x418d2b);return _0x22a8c2[_0xcabd('0x22')]('Content-Range',_0x25b45e+'-'+_0x18d217+'/'+_0x5f2b03)[_0xcabd('0x1d')](_0x8f7ce8);}return null;};}function patchUpdates(_0x525795){return function(_0x586b82){try{jsonpatch[_0xcabd('0x23')](_0x586b82,_0x525795,!![]);}catch(_0x3dacb1){return BPromise['reject'](_0x3dacb1);}return _0x586b82[_0xcabd('0x24')]();};}function saveUpdates(_0x59395f,_0x228bc6){return function(_0x383265){if(_0x383265){return _0x383265[_0xcabd('0x25')](_0x59395f)['then'](function(_0x14779e){return _0x14779e;});}return null;};}function removeEntity(_0x264358,_0x1e2c51){return function(_0x48385f){if(_0x48385f){return _0x48385f[_0xcabd('0x26')]()[_0xcabd('0x27')](function(){_0x264358[_0xcabd('0x1c')](0xcc)[_0xcabd('0x28')]();});}};}function handleEntityNotFound(_0x5b8727,_0x121e47){return function(_0x4eedd9){if(!_0x4eedd9){_0x5b8727[_0xcabd('0x29')](0x194);}return _0x4eedd9;};}function handleError(_0x53b216,_0x109cd6){_0x109cd6=_0x109cd6||0x1f4;return function(_0x19b899){logger[_0xcabd('0x2a')](_0x19b899[_0xcabd('0x2b')]);if(_0x19b899[_0xcabd('0x2c')]){delete _0x19b899['name'];}_0x53b216['status'](_0x109cd6)[_0xcabd('0x2d')](_0x19b899);};}exports[_0xcabd('0x2e')]=function(_0x3e6234,_0x41fc25){var _0x14c787={},_0x4c1342={},_0x55ced2={'count':0x0,'rows':[]};var _0x552bc8=_[_0xcabd('0x2f')](db[_0xcabd('0x30')][_0xcabd('0x31')],function(_0x10e328){return{'name':_0x10e328[_0xcabd('0x32')],'type':_0x10e328[_0xcabd('0x33')]['key']};});_0x4c1342[_0xcabd('0x34')]=_[_0xcabd('0x2f')](_0x552bc8,_0xcabd('0x2c'));_0x4c1342['query']=_[_0xcabd('0x35')](_0x3e6234[_0xcabd('0x36')]);_0x4c1342[_0xcabd('0x37')]=_[_0xcabd('0x38')](_0x4c1342[_0xcabd('0x34')],_0x4c1342['query']);_0x14c787[_0xcabd('0x39')]=_[_0xcabd('0x38')](_0x4c1342[_0xcabd('0x34')],qs[_0xcabd('0x3a')](_0x3e6234['query'][_0xcabd('0x3a')]));_0x14c787[_0xcabd('0x39')]=_0x14c787[_0xcabd('0x39')][_0xcabd('0x3b')]?_0x14c787[_0xcabd('0x39')]:_0x4c1342[_0xcabd('0x34')];if(!_0x3e6234[_0xcabd('0x36')][_0xcabd('0x3c')]('nolimit')){_0x14c787[_0xcabd('0x1e')]=qs['limit'](_0x3e6234[_0xcabd('0x36')]['limit']);_0x14c787[_0xcabd('0x21')]=qs[_0xcabd('0x21')](_0x3e6234[_0xcabd('0x36')][_0xcabd('0x21')]);}_0x14c787['order']=qs[_0xcabd('0x3d')](_0x3e6234['query'][_0xcabd('0x3d')]);_0x14c787['where']=qs[_0xcabd('0x37')](_['pick'](_0x3e6234['query'],_0x4c1342['filters']),_0x552bc8);if(_0x3e6234[_0xcabd('0x36')]['filter']){_0x14c787[_0xcabd('0x3e')]=_[_0xcabd('0x3f')](_0x14c787[_0xcabd('0x3e')],{'$or':_[_0xcabd('0x2f')](_0x552bc8,function(_0x4360a1){if(_0x4360a1[_0xcabd('0x33')]!=='VIRTUAL'){var _0x4bf117={};_0x4bf117[_0x4360a1[_0xcabd('0x2c')]]={'$like':'%'+_0x3e6234[_0xcabd('0x36')][_0xcabd('0x40')]+'%'};return _0x4bf117;}})});}_0x14c787=_[_0xcabd('0x3f')]({},_0x14c787,_0x3e6234[_0xcabd('0x41')]);var _0x5cad31={'where':_0x14c787[_0xcabd('0x3e')]};return db[_0xcabd('0x30')][_0xcabd('0x20')](_0x5cad31)[_0xcabd('0x27')](function(_0x2c9d75){_0x55ced2[_0xcabd('0x20')]=_0x2c9d75;if(_0x3e6234[_0xcabd('0x36')][_0xcabd('0x42')]){_0x14c787[_0xcabd('0x43')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x14c787);})[_0xcabd('0x27')](function(_0x50dc98){_0x55ced2['rows']=_0x50dc98;return _0x55ced2;})[_0xcabd('0x27')](respondWithFilteredResult(_0x41fc25,_0x14c787))[_0xcabd('0x44')](handleError(_0x41fc25,null));};exports[_0xcabd('0x45')]=function(_0x4e5ac2,_0x311342){var _0x2589f8={'raw':!![],'where':{'id':_0x4e5ac2['params']['id']}},_0x2f6ab8={};_0x2f6ab8[_0xcabd('0x34')]=_[_0xcabd('0x35')](db[_0xcabd('0x30')]['rawAttributes']);_0x2f6ab8[_0xcabd('0x36')]=_[_0xcabd('0x35')](_0x4e5ac2[_0xcabd('0x36')]);_0x2f6ab8['filters']=_[_0xcabd('0x38')](_0x2f6ab8[_0xcabd('0x34')],_0x2f6ab8[_0xcabd('0x36')]);_0x2589f8[_0xcabd('0x39')]=_[_0xcabd('0x38')](_0x2f6ab8[_0xcabd('0x34')],qs['fields'](_0x4e5ac2[_0xcabd('0x36')]['fields']));_0x2589f8[_0xcabd('0x39')]=_0x2589f8[_0xcabd('0x39')]['length']?_0x2589f8['attributes']:_0x2f6ab8[_0xcabd('0x34')];if(_0x4e5ac2['query'][_0xcabd('0x42')]){_0x2589f8[_0xcabd('0x43')]=[{'all':!![]}];}_0x2589f8=_[_0xcabd('0x3f')]({},_0x2589f8,_0x4e5ac2[_0xcabd('0x41')]);return db[_0xcabd('0x30')][_0xcabd('0x46')](_0x2589f8)['then'](handleEntityNotFound(_0x311342,null))[_0xcabd('0x27')](respondWithResult(_0x311342,null))[_0xcabd('0x44')](handleError(_0x311342,null));};exports[_0xcabd('0x47')]=function(_0x1c26db,_0x466a1d){return db[_0xcabd('0x30')][_0xcabd('0x47')](_0x1c26db[_0xcabd('0x48')],{})[_0xcabd('0x27')](respondWithResult(_0x466a1d,0xc9))[_0xcabd('0x44')](handleError(_0x466a1d,null));};exports[_0xcabd('0x25')]=function(_0x37440f,_0x3dc17a){if(_0x37440f['body']['id']){delete _0x37440f[_0xcabd('0x48')]['id'];}return db[_0xcabd('0x30')]['find']({'where':{'id':_0x37440f[_0xcabd('0x49')]['id']}})[_0xcabd('0x27')](handleEntityNotFound(_0x3dc17a,null))[_0xcabd('0x27')](saveUpdates(_0x37440f[_0xcabd('0x48')],null))[_0xcabd('0x27')](respondWithResult(_0x3dc17a,null))[_0xcabd('0x44')](handleError(_0x3dc17a,null));};exports['destroy']=function(_0x467c98,_0xb91f63){return db[_0xcabd('0x30')][_0xcabd('0x46')]({'where':{'id':_0x467c98['params']['id']}})[_0xcabd('0x27')](handleEntityNotFound(_0xb91f63,null))[_0xcabd('0x27')](removeEntity(_0xb91f63,null))['catch'](handleError(_0xb91f63,null));};exports[_0xcabd('0x4a')]=function(_0x1aa5d0,_0x263de0){return db[_0xcabd('0x30')][_0xcabd('0x4a')]()[_0xcabd('0x27')](respondWithResult(_0x263de0,null))[_0xcabd('0x44')](handleError(_0x263de0,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index aad0ecf..d0c32aa 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 _0x2707=['report_square','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','./squareReport.attributes','exports','define','SquareReport'];(function(_0x4823a3,_0x207732){var _0x2ac4e5=function(_0x3ef95c){while(--_0x3ef95c){_0x4823a3['push'](_0x4823a3['shift']());}};_0x2ac4e5(++_0x207732);}(_0x2707,0x1d7));var _0x7270=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2707[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7270('0x0'));var util=require(_0x7270('0x1'));var logger=require(_0x7270('0x2'))(_0x7270('0x3'));var moment=require(_0x7270('0x4'));var BPromise=require('bluebird');var rp=require(_0x7270('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7270('0x6'));module[_0x7270('0x7')]=function(_0x2c8a25,_0xc6bfab){return _0x2c8a25[_0x7270('0x8')](_0x7270('0x9'),attributes,{'tableName':_0x7270('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x7270('0xb')]},{'name':_0x7270('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xee69=['define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2f0e5f,_0x2a88c3){var _0x1c210e=function(_0x126415){while(--_0x126415){_0x2f0e5f['push'](_0x2f0e5f['shift']());}};_0x1c210e(++_0x2a88c3);}(_0xee69,0x196));var _0x9ee6=function(_0x20ac0f,_0x34b7e3){_0x20ac0f=_0x20ac0f-0x0;var _0x332fb9=_0xee69[_0x20ac0f];return _0x332fb9;};'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(_0x9ee6('0x4'));var rp=require(_0x9ee6('0x5'));var fs=require('fs');var path=require(_0x9ee6('0x6'));var rimraf=require(_0x9ee6('0x7'));var config=require(_0x9ee6('0x8'));var attributes=require('./squareReport.attributes');module[_0x9ee6('0x9')]=function(_0x13c1e7,_0x434134){return _0x13c1e7[_0x9ee6('0xa')](_0x9ee6('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x9ee6('0xc'),'fields':[_0x9ee6('0xd'),_0x9ee6('0xe')]},{'name':_0x9ee6('0xf'),'fields':[_0x9ee6('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 cf59f69..c81b357 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 _0xc16d=['error','code','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','request\x20sent','debug','stringify'];(function(_0x3a4fcf,_0x3c0568){var _0x39d40d=function(_0x27760b){while(--_0x27760b){_0x3a4fcf['push'](_0x3a4fcf['shift']());}};_0x39d40d(++_0x3c0568);}(_0xc16d,0x71));var _0xdc16=function(_0x4b1d19,_0x16f585){_0x4b1d19=_0x4b1d19-0x0;var _0x256a3c=_0xc16d[_0x4b1d19];return _0x256a3c;};'use strict';var _=require(_0xdc16('0x0'));var util=require(_0xdc16('0x1'));var moment=require(_0xdc16('0x2'));var BPromise=require(_0xdc16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc16('0x4'));var db=require(_0xdc16('0x5'))['db'];var utils=require(_0xdc16('0x6'));var logger=require(_0xdc16('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdc16('0x8')][_0xdc16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb2c2,_0x5200fe,_0x31f5be){return new BPromise(function(_0x5c5e13,_0x470fce){return client['request'](_0x2cb2c2,_0x31f5be)[_0xdc16('0xa')](function(_0x4f7380){logger[_0xdc16('0xb')]('SquareReport,\x20%s,\x20%s',_0x5200fe,_0xdc16('0xc'));logger[_0xdc16('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5200fe,_0xdc16('0xc'),JSON[_0xdc16('0xe')](_0x4f7380));if(_0x4f7380[_0xdc16('0xf')]){if(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x10')]===0x1f4){logger[_0xdc16('0xf')](_0xdc16('0x11'),_0x5200fe,_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);return _0x470fce(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x5200fe,_0x4f7380['error'][_0xdc16('0x12')]);return _0x5c5e13(_0x4f7380[_0xdc16('0xf')][_0xdc16('0x12')]);}else{logger[_0xdc16('0xb')](_0xdc16('0x11'),_0x5200fe,'request\x20sent');_0x5c5e13(_0x4f7380[_0xdc16('0x13')][_0xdc16('0x12')]);}})['catch'](function(_0x22f79d){logger[_0xdc16('0xf')](_0xdc16('0x11'),_0x5200fe,_0x22f79d);_0x470fce(_0x22f79d);});});}exports[_0xdc16('0x14')]=function(_0x39fc56){var _0x45f0fe=this;return new Promise(function(_0x30df1e,_0x32336a){return db[_0xdc16('0x15')][_0xdc16('0x16')](_0x39fc56[_0xdc16('0x17')],{'raw':_0x39fc56[_0xdc16('0x18')]?_0x39fc56[_0xdc16('0x18')][_0xdc16('0x19')]===undefined?!![]:![]:!![]})[_0xdc16('0xa')](function(_0x568a63){logger[_0xdc16('0xb')]('CreateSquareReport',_0x39fc56);logger[_0xdc16('0xd')]('CreateSquareReport',_0x39fc56,JSON[_0xdc16('0xe')](_0x568a63));_0x30df1e(_0x568a63);})[_0xdc16('0x1a')](function(_0x5bcecc){logger['error']('CreateSquareReport',_0x5bcecc[_0xdc16('0x12')],_0x39fc56);_0x32336a(_0x45f0fe[_0xdc16('0xf')](0x1f4,_0x5bcecc[_0xdc16('0x12')]));});});};exports[_0xdc16('0x1b')]=function(_0x10dbd7){var _0xfbf45e=this;return new Promise(function(_0x1b15bc,_0x4c8aaa){return db['SquareReport'][_0xdc16('0x1c')](_0x10dbd7[_0xdc16('0x17')],{'raw':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1d')]||null:null,'attributes':_0x10dbd7[_0xdc16('0x18')]?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1e')]||null:null,'limit':_0x10dbd7['options']?_0x10dbd7[_0xdc16('0x18')][_0xdc16('0x1f')]||null:null})['then'](function(_0x4280e2){logger[_0xdc16('0xb')]('UpdateSquareReport',_0x10dbd7);logger[_0xdc16('0xd')]('UpdateSquareReport',_0x10dbd7,JSON['stringify'](_0x4280e2));_0x1b15bc(_0x4280e2);})[_0xdc16('0x1a')](function(_0x40c7a7){logger[_0xdc16('0xf')](_0xdc16('0x1b'),_0x40c7a7['message'],_0x10dbd7);_0x4c8aaa(_0xfbf45e[_0xdc16('0xf')](0x1f4,_0x40c7a7[_0xdc16('0x12')]));});});}; \ No newline at end of file +var _0x69ba=['error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x496844,_0x426253){var _0x480e98=function(_0x460874){while(--_0x460874){_0x496844['push'](_0x496844['shift']());}};_0x480e98(++_0x426253);}(_0x69ba,0x72));var _0xa69b=function(_0x37ac1d,_0x37b220){_0x37ac1d=_0x37ac1d-0x0;var _0x2abd53=_0x69ba[_0x37ac1d];return _0x2abd53;};'use strict';var _=require(_0xa69b('0x0'));var util=require(_0xa69b('0x1'));var moment=require(_0xa69b('0x2'));var BPromise=require(_0xa69b('0x3'));var rs=require(_0xa69b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa69b('0x5'));var logger=require(_0xa69b('0x6'))(_0xa69b('0x7'));var config=require(_0xa69b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa69b('0x9')][_0xa69b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b101,_0x2e7741,_0x420349){return new BPromise(function(_0x52b4a6,_0x20d3f7){return client[_0xa69b('0xb')](_0x25b101,_0x420349)[_0xa69b('0xc')](function(_0x109e8f){logger[_0xa69b('0xd')](_0xa69b('0xe'),_0x2e7741,_0xa69b('0xf'));logger[_0xa69b('0x10')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x2e7741,'request\x20sent',JSON[_0xa69b('0x11')](_0x109e8f));if(_0x109e8f['error']){if(_0x109e8f[_0xa69b('0x12')][_0xa69b('0x13')]===0x1f4){logger['error'](_0xa69b('0xe'),_0x2e7741,_0x109e8f['error'][_0xa69b('0x14')]);return _0x20d3f7(_0x109e8f['error']['message']);}logger[_0xa69b('0x12')]('SquareReport,\x20%s,\x20%s',_0x2e7741,_0x109e8f[_0xa69b('0x12')][_0xa69b('0x14')]);return _0x52b4a6(_0x109e8f[_0xa69b('0x12')][_0xa69b('0x14')]);}else{logger['info'](_0xa69b('0xe'),_0x2e7741,_0xa69b('0xf'));_0x52b4a6(_0x109e8f[_0xa69b('0x15')][_0xa69b('0x14')]);}})[_0xa69b('0x16')](function(_0x3770b3){logger[_0xa69b('0x12')](_0xa69b('0xe'),_0x2e7741,_0x3770b3);_0x20d3f7(_0x3770b3);});});}exports[_0xa69b('0x17')]=function(_0x1200a3){var _0x1e576b=this;return new Promise(function(_0x2f2ec5,_0x6da949){return db[_0xa69b('0x18')]['create'](_0x1200a3[_0xa69b('0x19')],{'raw':_0x1200a3[_0xa69b('0x1a')]?_0x1200a3[_0xa69b('0x1a')][_0xa69b('0x1b')]===undefined?!![]:![]:!![]})[_0xa69b('0xc')](function(_0x3e505a){logger[_0xa69b('0xd')]('CreateSquareReport',_0x1200a3);logger[_0xa69b('0x10')](_0xa69b('0x17'),_0x1200a3,JSON[_0xa69b('0x11')](_0x3e505a));_0x2f2ec5(_0x3e505a);})[_0xa69b('0x16')](function(_0xd9997e){logger[_0xa69b('0x12')]('CreateSquareReport',_0xd9997e[_0xa69b('0x14')],_0x1200a3);_0x6da949(_0x1e576b[_0xa69b('0x12')](0x1f4,_0xd9997e['message']));});});};exports[_0xa69b('0x1c')]=function(_0x31fbc6){var _0x39638e=this;return new Promise(function(_0x332f37,_0xfb064){return db[_0xa69b('0x18')][_0xa69b('0x1d')](_0x31fbc6[_0xa69b('0x19')],{'raw':_0x31fbc6[_0xa69b('0x1a')]?_0x31fbc6['options'][_0xa69b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31fbc6[_0xa69b('0x1a')]?_0x31fbc6[_0xa69b('0x1a')][_0xa69b('0x1e')]||null:null,'attributes':_0x31fbc6[_0xa69b('0x1a')]?_0x31fbc6['options'][_0xa69b('0x1f')]||null:null,'limit':_0x31fbc6['options']?_0x31fbc6['options'][_0xa69b('0x20')]||null:null})[_0xa69b('0xc')](function(_0x510dc1){logger[_0xa69b('0xd')](_0xa69b('0x1c'),_0x31fbc6);logger[_0xa69b('0x10')](_0xa69b('0x1c'),_0x31fbc6,JSON[_0xa69b('0x11')](_0x510dc1));_0x332f37(_0x510dc1);})['catch'](function(_0x55feb1){logger[_0xa69b('0x12')]('UpdateSquareReport',_0x55feb1[_0xa69b('0x14')],_0x31fbc6);_0xfb064(_0x39638e['error'](0x1f4,_0x55feb1[_0xa69b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 495d7fe..a4d3ef1 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 _0x5b30=['get','isAuthenticated','index','/describe','describe','post','create','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','./squareReportDetail.controller'];(function(_0x564742,_0x3e34c7){var _0x7839d4=function(_0x366159){while(--_0x366159){_0x564742['push'](_0x564742['shift']());}};_0x7839d4(++_0x3e34c7);}(_0x5b30,0x181));var _0x05b3=function(_0x27dfe7,_0x3acd6f){_0x27dfe7=_0x27dfe7-0x0;var _0x9d647c=_0x5b30[_0x27dfe7];return _0x9d647c;};'use strict';var multer=require(_0x05b3('0x0'));var util=require(_0x05b3('0x1'));var path=require(_0x05b3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x05b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05b3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x05b3('0x5'));router[_0x05b3('0x6')]('/',auth[_0x05b3('0x7')](),controller[_0x05b3('0x8')]);router[_0x05b3('0x6')](_0x05b3('0x9'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xa')]);router['get']('/:id',auth[_0x05b3('0x7')](),controller['show']);router[_0x05b3('0xb')]('/',auth[_0x05b3('0x7')](),controller[_0x05b3('0xc')]);router['put'](_0x05b3('0xd'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xe')]);router['delete'](_0x05b3('0xd'),auth[_0x05b3('0x7')](),controller[_0x05b3('0xf')]);module[_0x05b3('0x10')]=router; \ No newline at end of file +var _0x0e58=['show','post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0e58,0x134));var _0x80e5=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x0e58[_0x28b0a4];return _0x105ce6;};'use strict';var multer=require(_0x80e5('0x0'));var util=require(_0x80e5('0x1'));var path=require('path');var timeout=require(_0x80e5('0x2'));var express=require('express');var router=express[_0x80e5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x80e5('0x4'));var interaction=require(_0x80e5('0x5'));var config=require('../../config/environment');var controller=require(_0x80e5('0x6'));router[_0x80e5('0x7')]('/',auth[_0x80e5('0x8')](),controller[_0x80e5('0x9')]);router[_0x80e5('0x7')](_0x80e5('0xa'),auth[_0x80e5('0x8')](),controller[_0x80e5('0xb')]);router[_0x80e5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x80e5('0xc')]);router[_0x80e5('0xd')]('/',auth['isAuthenticated'](),controller[_0x80e5('0xe')]);router['put'](_0x80e5('0xf'),auth[_0x80e5('0x8')](),controller[_0x80e5('0x10')]);router[_0x80e5('0x11')](_0x80e5('0xf'),auth['isAuthenticated'](),controller[_0x80e5('0x12')]);module[_0x80e5('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index bc934b5..06f33ba 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 _0xfd09=['TEXT','sequelize','STRING'];(function(_0x2a2917,_0x5a6f95){var _0x1462cb=function(_0x3f245b){while(--_0x3f245b){_0x2a2917['push'](_0x2a2917['shift']());}};_0x1462cb(++_0x5a6f95);}(_0xfd09,0x1d8));var _0x9fd0=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0xfd09[_0x54b458];return _0x18d704;};'use strict';var Sequelize=require(_0x9fd0('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x9fd0('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x9fd0('0x2')]},'project_name':{'type':Sequelize[_0x9fd0('0x1')]},'callerid':{'type':Sequelize[_0x9fd0('0x1')]}}; \ No newline at end of file +var _0xc2f9=['TEXT','sequelize','exports','STRING'];(function(_0x47a25c,_0x47e175){var _0x24d187=function(_0x2d1699){while(--_0x2d1699){_0x47a25c['push'](_0x47a25c['shift']());}};_0x24d187(++_0x47e175);}(_0xc2f9,0x1c1));var _0x9c2f=function(_0x39970f,_0x13bbcd){_0x39970f=_0x39970f-0x0;var _0x5ac60b=_0xc2f9[_0x39970f];return _0x5ac60b;};'use strict';var Sequelize=require(_0x9c2f('0x0'));module[_0x9c2f('0x1')]={'uniqueid':{'type':Sequelize[_0x9c2f('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x9c2f('0x2')]},'data':{'type':Sequelize[_0x9c2f('0x3')]},'project_name':{'type':Sequelize[_0x9c2f('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c02cb62..75cd677 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 _0x4ef3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','keys','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x3df249,_0x2f5acc){var _0x1dae1b=function(_0x28043f){while(--_0x28043f){_0x3df249['push'](_0x3df249['shift']());}};_0x1dae1b(++_0x2f5acc);}(_0x4ef3,0x1c9));var _0x34ef=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4ef3[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x34ef('0x0'));var rimraf=require(_0x34ef('0x1'));var zipdir=require(_0x34ef('0x2'));var jsonpatch=require(_0x34ef('0x3'));var rp=require(_0x34ef('0x4'));var moment=require(_0x34ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ef('0x6'));var util=require(_0x34ef('0x7'));var path=require(_0x34ef('0x8'));var sox=require(_0x34ef('0x9'));var csv=require(_0x34ef('0xa'));var ejs=require(_0x34ef('0xb'));var fs=require('fs');var fs_extra=require(_0x34ef('0xc'));var _=require(_0x34ef('0xd'));var squel=require(_0x34ef('0xe'));var crypto=require(_0x34ef('0xf'));var jsforce=require(_0x34ef('0x10'));var deskjs=require(_0x34ef('0x11'));var toCsv=require(_0x34ef('0xa'));var querystring=require('querystring');var Papa=require(_0x34ef('0x12'));var Redis=require('ioredis');var authService=require(_0x34ef('0x13'));var qs=require(_0x34ef('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34ef('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x34ef('0x16'));var config=require(_0x34ef('0x17'));var licenseUtil=require(_0x34ef('0x18'));var db=require(_0x34ef('0x19'))['db'];function respondWithStatusCode(_0x7f1e02,_0x114214){_0x114214=_0x114214||0xcc;return function(_0x415958){if(_0x415958){return _0x7f1e02[_0x34ef('0x1a')](_0x114214);}return _0x7f1e02[_0x34ef('0x1b')](_0x114214)[_0x34ef('0x1c')]();};}function respondWithResult(_0x5ce6d7,_0x10fa30){_0x10fa30=_0x10fa30||0xc8;return function(_0x1fbe0a){if(_0x1fbe0a){return _0x5ce6d7[_0x34ef('0x1b')](_0x10fa30)[_0x34ef('0x1d')](_0x1fbe0a);}};}function respondWithFilteredResult(_0x3f511e,_0x13394c){return function(_0x10534c){if(_0x10534c){var _0x461e94=typeof _0x13394c[_0x34ef('0x1e')]===_0x34ef('0x1f')&&typeof _0x13394c[_0x34ef('0x20')]===_0x34ef('0x1f');var _0xdcc71f=_0x10534c['count'];var _0x2225be=_0x461e94?0x0:_0x13394c['offset'];var _0x2036c7=_0x461e94?_0x10534c[_0x34ef('0x21')]:_0x13394c[_0x34ef('0x1e')]+_0x13394c[_0x34ef('0x20')];var _0x3f8302;if(_0x2036c7>=_0xdcc71f){_0x2036c7=_0xdcc71f;_0x3f8302=0xc8;}else{_0x3f8302=0xce;}_0x3f511e[_0x34ef('0x1b')](_0x3f8302);return _0x3f511e[_0x34ef('0x22')](_0x34ef('0x23'),_0x2225be+'-'+_0x2036c7+'/'+_0xdcc71f)[_0x34ef('0x1d')](_0x10534c);}return null;};}function patchUpdates(_0x4541fa){return function(_0x29dd02){try{jsonpatch[_0x34ef('0x24')](_0x29dd02,_0x4541fa,!![]);}catch(_0x4fc940){return BPromise[_0x34ef('0x25')](_0x4fc940);}return _0x29dd02['save']();};}function saveUpdates(_0x52d983,_0x38d0bd){return function(_0x3fc328){if(_0x3fc328){return _0x3fc328[_0x34ef('0x26')](_0x52d983)[_0x34ef('0x27')](function(_0x52a15c){return _0x52a15c;});}return null;};}function removeEntity(_0x4a4356,_0x3525db){return function(_0x13b309){if(_0x13b309){return _0x13b309[_0x34ef('0x28')]()['then'](function(){_0x4a4356[_0x34ef('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8145,_0x347b6c){return function(_0x37622c){if(!_0x37622c){_0x2d8145[_0x34ef('0x1a')](0x194);}return _0x37622c;};}function handleError(_0x8dcafc,_0x1d9c01){_0x1d9c01=_0x1d9c01||0x1f4;return function(_0x4fcaff){logger[_0x34ef('0x29')](_0x4fcaff[_0x34ef('0x2a')]);if(_0x4fcaff[_0x34ef('0x2b')]){delete _0x4fcaff['name'];}_0x8dcafc['status'](_0x1d9c01)[_0x34ef('0x2c')](_0x4fcaff);};}exports[_0x34ef('0x2d')]=function(_0x400875,_0x4e3531){var _0xc8aa3a={},_0x7f0e3e={},_0x41fc31={'count':0x0,'rows':[]};var _0x37d4bb=_[_0x34ef('0x2e')](db[_0x34ef('0x2f')][_0x34ef('0x30')],function(_0x90e9cf){return{'name':_0x90e9cf[_0x34ef('0x31')],'type':_0x90e9cf[_0x34ef('0x32')][_0x34ef('0x33')]};});_0x7f0e3e[_0x34ef('0x34')]=_[_0x34ef('0x2e')](_0x37d4bb,_0x34ef('0x2b'));_0x7f0e3e[_0x34ef('0x35')]=_['keys'](_0x400875['query']);_0x7f0e3e['filters']=_[_0x34ef('0x36')](_0x7f0e3e['model'],_0x7f0e3e[_0x34ef('0x35')]);_0xc8aa3a['attributes']=_[_0x34ef('0x36')](_0x7f0e3e[_0x34ef('0x34')],qs[_0x34ef('0x37')](_0x400875[_0x34ef('0x35')][_0x34ef('0x37')]));_0xc8aa3a['attributes']=_0xc8aa3a[_0x34ef('0x38')][_0x34ef('0x39')]?_0xc8aa3a[_0x34ef('0x38')]:_0x7f0e3e[_0x34ef('0x34')];if(!_0x400875[_0x34ef('0x35')][_0x34ef('0x3a')](_0x34ef('0x3b'))){_0xc8aa3a[_0x34ef('0x20')]=qs[_0x34ef('0x20')](_0x400875[_0x34ef('0x35')][_0x34ef('0x20')]);_0xc8aa3a[_0x34ef('0x1e')]=qs[_0x34ef('0x1e')](_0x400875[_0x34ef('0x35')][_0x34ef('0x1e')]);}_0xc8aa3a[_0x34ef('0x3c')]=qs[_0x34ef('0x3d')](_0x400875['query'][_0x34ef('0x3d')]);_0xc8aa3a['where']=qs[_0x34ef('0x3e')](_[_0x34ef('0x3f')](_0x400875[_0x34ef('0x35')],_0x7f0e3e[_0x34ef('0x3e')]),_0x37d4bb);if(_0x400875[_0x34ef('0x35')][_0x34ef('0x40')]){_0xc8aa3a[_0x34ef('0x41')]=_[_0x34ef('0x42')](_0xc8aa3a[_0x34ef('0x41')],{'$or':_[_0x34ef('0x2e')](_0x37d4bb,function(_0x4e5b87){if(_0x4e5b87[_0x34ef('0x32')]!=='VIRTUAL'){var _0x253e85={};_0x253e85[_0x4e5b87[_0x34ef('0x2b')]]={'$like':'%'+_0x400875[_0x34ef('0x35')][_0x34ef('0x40')]+'%'};return _0x253e85;}})});}_0xc8aa3a=_[_0x34ef('0x42')]({},_0xc8aa3a,_0x400875[_0x34ef('0x43')]);var _0x5873e9={'where':_0xc8aa3a['where']};return db[_0x34ef('0x2f')][_0x34ef('0x21')](_0x5873e9)['then'](function(_0x3cc3be){_0x41fc31[_0x34ef('0x21')]=_0x3cc3be;if(_0x400875[_0x34ef('0x35')]['includeAll']){_0xc8aa3a[_0x34ef('0x44')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x34ef('0x45')](_0xc8aa3a);})[_0x34ef('0x27')](function(_0x3dba81){_0x41fc31[_0x34ef('0x46')]=_0x3dba81;return _0x41fc31;})['then'](respondWithFilteredResult(_0x4e3531,_0xc8aa3a))['catch'](handleError(_0x4e3531,null));};exports['show']=function(_0x5c31fa,_0x2f98ee){var _0x5ec9e2={'raw':!![],'where':{'id':_0x5c31fa['params']['id']}},_0x31632b={};_0x31632b['model']=_[_0x34ef('0x47')](db[_0x34ef('0x2f')][_0x34ef('0x30')]);_0x31632b[_0x34ef('0x35')]=_[_0x34ef('0x47')](_0x5c31fa[_0x34ef('0x35')]);_0x31632b[_0x34ef('0x3e')]=_['intersection'](_0x31632b[_0x34ef('0x34')],_0x31632b[_0x34ef('0x35')]);_0x5ec9e2[_0x34ef('0x38')]=_[_0x34ef('0x36')](_0x31632b[_0x34ef('0x34')],qs[_0x34ef('0x37')](_0x5c31fa[_0x34ef('0x35')]['fields']));_0x5ec9e2[_0x34ef('0x38')]=_0x5ec9e2[_0x34ef('0x38')][_0x34ef('0x39')]?_0x5ec9e2[_0x34ef('0x38')]:_0x31632b[_0x34ef('0x34')];if(_0x5c31fa['query'][_0x34ef('0x48')]){_0x5ec9e2[_0x34ef('0x44')]=[{'all':!![]}];}_0x5ec9e2=_[_0x34ef('0x42')]({},_0x5ec9e2,_0x5c31fa[_0x34ef('0x43')]);return db[_0x34ef('0x2f')][_0x34ef('0x49')](_0x5ec9e2)[_0x34ef('0x27')](handleEntityNotFound(_0x2f98ee,null))[_0x34ef('0x27')](respondWithResult(_0x2f98ee,null))[_0x34ef('0x4a')](handleError(_0x2f98ee,null));};exports[_0x34ef('0x4b')]=function(_0x5180e5,_0x2385ae){return db[_0x34ef('0x2f')]['create'](_0x5180e5[_0x34ef('0x4c')],{})[_0x34ef('0x27')](respondWithResult(_0x2385ae,0xc9))[_0x34ef('0x4a')](handleError(_0x2385ae,null));};exports[_0x34ef('0x26')]=function(_0x43e101,_0x311af4){if(_0x43e101[_0x34ef('0x4c')]['id']){delete _0x43e101[_0x34ef('0x4c')]['id'];}return db[_0x34ef('0x2f')]['find']({'where':{'id':_0x43e101[_0x34ef('0x4d')]['id']}})[_0x34ef('0x27')](handleEntityNotFound(_0x311af4,null))[_0x34ef('0x27')](saveUpdates(_0x43e101[_0x34ef('0x4c')],null))[_0x34ef('0x27')](respondWithResult(_0x311af4,null))['catch'](handleError(_0x311af4,null));};exports[_0x34ef('0x28')]=function(_0x11d5b8,_0x3c4d7c){return db[_0x34ef('0x2f')][_0x34ef('0x49')]({'where':{'id':_0x11d5b8[_0x34ef('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3c4d7c,null))[_0x34ef('0x27')](removeEntity(_0x3c4d7c,null))[_0x34ef('0x4a')](handleError(_0x3c4d7c,null));};exports['describe']=function(_0xd86962,_0x3e3d9e){return db[_0x34ef('0x2f')]['describe']()['then'](respondWithResult(_0x3e3d9e,null))['catch'](handleError(_0x3e3d9e,null));}; \ No newline at end of file +var _0x907c=['undefined','limit','count','set','apply','reject','then','error','stack','name','status','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','fields','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x5761bd,_0x15ae9a){var _0x2bae67=function(_0x22e70a){while(--_0x22e70a){_0x5761bd['push'](_0x5761bd['shift']());}};_0x2bae67(++_0x15ae9a);}(_0x907c,0x1dd));var _0xc907=function(_0x7bfd20,_0x540786){_0x7bfd20=_0x7bfd20-0x0;var _0x185a3f=_0x907c[_0x7bfd20];return _0x185a3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc907('0x0'));var zipdir=require(_0xc907('0x1'));var jsonpatch=require(_0xc907('0x2'));var rp=require('request-promise');var moment=require(_0xc907('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc907('0x4'));var util=require(_0xc907('0x5'));var path=require(_0xc907('0x6'));var sox=require('sox');var csv=require(_0xc907('0x7'));var ejs=require(_0xc907('0x8'));var fs=require('fs');var fs_extra=require(_0xc907('0x9'));var _=require(_0xc907('0xa'));var squel=require(_0xc907('0xb'));var crypto=require(_0xc907('0xc'));var jsforce=require(_0xc907('0xd'));var deskjs=require(_0xc907('0xe'));var toCsv=require(_0xc907('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc907('0xf'));var qs=require(_0xc907('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc907('0x11'));var logger=require(_0xc907('0x12'))(_0xc907('0x13'));var utils=require(_0xc907('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc907('0x15'));var db=require(_0xc907('0x16'))['db'];function respondWithStatusCode(_0x500b66,_0x95224f){_0x95224f=_0x95224f||0xcc;return function(_0x9401af){if(_0x9401af){return _0x500b66[_0xc907('0x17')](_0x95224f);}return _0x500b66['status'](_0x95224f)[_0xc907('0x18')]();};}function respondWithResult(_0x552c00,_0x4bcb3e){_0x4bcb3e=_0x4bcb3e||0xc8;return function(_0x3a1b44){if(_0x3a1b44){return _0x552c00['status'](_0x4bcb3e)[_0xc907('0x19')](_0x3a1b44);}};}function respondWithFilteredResult(_0x5105d2,_0x1d9c16){return function(_0x4df59e){if(_0x4df59e){var _0x1375e6=typeof _0x1d9c16[_0xc907('0x1a')]===_0xc907('0x1b')&&typeof _0x1d9c16[_0xc907('0x1c')]===_0xc907('0x1b');var _0x24c70c=_0x4df59e['count'];var _0x5f4fb2=_0x1375e6?0x0:_0x1d9c16['offset'];var _0x4b7a89=_0x1375e6?_0x4df59e[_0xc907('0x1d')]:_0x1d9c16[_0xc907('0x1a')]+_0x1d9c16[_0xc907('0x1c')];var _0x1ef1a3;if(_0x4b7a89>=_0x24c70c){_0x4b7a89=_0x24c70c;_0x1ef1a3=0xc8;}else{_0x1ef1a3=0xce;}_0x5105d2['status'](_0x1ef1a3);return _0x5105d2[_0xc907('0x1e')]('Content-Range',_0x5f4fb2+'-'+_0x4b7a89+'/'+_0x24c70c)[_0xc907('0x19')](_0x4df59e);}return null;};}function patchUpdates(_0x38c45b){return function(_0x4726b3){try{jsonpatch[_0xc907('0x1f')](_0x4726b3,_0x38c45b,!![]);}catch(_0x9e17d4){return BPromise[_0xc907('0x20')](_0x9e17d4);}return _0x4726b3['save']();};}function saveUpdates(_0x4b9504,_0x2f5f75){return function(_0xa73fc4){if(_0xa73fc4){return _0xa73fc4['update'](_0x4b9504)[_0xc907('0x21')](function(_0x445c7d){return _0x445c7d;});}return null;};}function removeEntity(_0x351af5,_0x4a2070){return function(_0x4e4859){if(_0x4e4859){return _0x4e4859['destroy']()[_0xc907('0x21')](function(){_0x351af5['status'](0xcc)[_0xc907('0x18')]();});}};}function handleEntityNotFound(_0x50fb5e,_0x18a3bb){return function(_0xae0ec){if(!_0xae0ec){_0x50fb5e[_0xc907('0x17')](0x194);}return _0xae0ec;};}function handleError(_0x44cf87,_0x4741fe){_0x4741fe=_0x4741fe||0x1f4;return function(_0x1bb7b6){logger[_0xc907('0x22')](_0x1bb7b6[_0xc907('0x23')]);if(_0x1bb7b6['name']){delete _0x1bb7b6[_0xc907('0x24')];}_0x44cf87[_0xc907('0x25')](_0x4741fe)[_0xc907('0x26')](_0x1bb7b6);};}exports[_0xc907('0x27')]=function(_0x1bbdd9,_0x26b02a){var _0x2470e7={},_0x4b1b73={},_0xff6fce={'count':0x0,'rows':[]};var _0x4051bf=_[_0xc907('0x28')](db[_0xc907('0x29')][_0xc907('0x2a')],function(_0x219d36){return{'name':_0x219d36[_0xc907('0x2b')],'type':_0x219d36[_0xc907('0x2c')]['key']};});_0x4b1b73[_0xc907('0x2d')]=_[_0xc907('0x28')](_0x4051bf,_0xc907('0x24'));_0x4b1b73[_0xc907('0x2e')]=_[_0xc907('0x2f')](_0x1bbdd9[_0xc907('0x2e')]);_0x4b1b73[_0xc907('0x30')]=_[_0xc907('0x31')](_0x4b1b73[_0xc907('0x2d')],_0x4b1b73['query']);_0x2470e7[_0xc907('0x32')]=_['intersection'](_0x4b1b73[_0xc907('0x2d')],qs['fields'](_0x1bbdd9[_0xc907('0x2e')]['fields']));_0x2470e7['attributes']=_0x2470e7[_0xc907('0x32')][_0xc907('0x33')]?_0x2470e7[_0xc907('0x32')]:_0x4b1b73[_0xc907('0x2d')];if(!_0x1bbdd9[_0xc907('0x2e')][_0xc907('0x34')](_0xc907('0x35'))){_0x2470e7[_0xc907('0x1c')]=qs[_0xc907('0x1c')](_0x1bbdd9['query'][_0xc907('0x1c')]);_0x2470e7[_0xc907('0x1a')]=qs[_0xc907('0x1a')](_0x1bbdd9[_0xc907('0x2e')][_0xc907('0x1a')]);}_0x2470e7['order']=qs['sort'](_0x1bbdd9[_0xc907('0x2e')]['sort']);_0x2470e7[_0xc907('0x36')]=qs[_0xc907('0x30')](_[_0xc907('0x37')](_0x1bbdd9[_0xc907('0x2e')],_0x4b1b73[_0xc907('0x30')]),_0x4051bf);if(_0x1bbdd9[_0xc907('0x2e')][_0xc907('0x38')]){_0x2470e7[_0xc907('0x36')]=_['merge'](_0x2470e7[_0xc907('0x36')],{'$or':_[_0xc907('0x28')](_0x4051bf,function(_0x56f430){if(_0x56f430[_0xc907('0x2c')]!==_0xc907('0x39')){var _0x4f6f9e={};_0x4f6f9e[_0x56f430[_0xc907('0x24')]]={'$like':'%'+_0x1bbdd9[_0xc907('0x2e')][_0xc907('0x38')]+'%'};return _0x4f6f9e;}})});}_0x2470e7=_[_0xc907('0x3a')]({},_0x2470e7,_0x1bbdd9[_0xc907('0x3b')]);var _0x2ae91b={'where':_0x2470e7[_0xc907('0x36')]};return db[_0xc907('0x29')][_0xc907('0x1d')](_0x2ae91b)[_0xc907('0x21')](function(_0x376ba8){_0xff6fce[_0xc907('0x1d')]=_0x376ba8;if(_0x1bbdd9[_0xc907('0x2e')][_0xc907('0x3c')]){_0x2470e7['include']=[{'all':!![]}];}return db[_0xc907('0x29')][_0xc907('0x3d')](_0x2470e7);})[_0xc907('0x21')](function(_0x59091b){_0xff6fce[_0xc907('0x3e')]=_0x59091b;return _0xff6fce;})[_0xc907('0x21')](respondWithFilteredResult(_0x26b02a,_0x2470e7))['catch'](handleError(_0x26b02a,null));};exports[_0xc907('0x3f')]=function(_0x972587,_0x38ce7b){var _0x1e2855={'raw':!![],'where':{'id':_0x972587[_0xc907('0x40')]['id']}},_0x14bd8b={};_0x14bd8b[_0xc907('0x2d')]=_['keys'](db[_0xc907('0x29')]['rawAttributes']);_0x14bd8b[_0xc907('0x2e')]=_[_0xc907('0x2f')](_0x972587[_0xc907('0x2e')]);_0x14bd8b[_0xc907('0x30')]=_[_0xc907('0x31')](_0x14bd8b[_0xc907('0x2d')],_0x14bd8b['query']);_0x1e2855[_0xc907('0x32')]=_[_0xc907('0x31')](_0x14bd8b[_0xc907('0x2d')],qs[_0xc907('0x41')](_0x972587[_0xc907('0x2e')][_0xc907('0x41')]));_0x1e2855[_0xc907('0x32')]=_0x1e2855['attributes']['length']?_0x1e2855[_0xc907('0x32')]:_0x14bd8b['model'];if(_0x972587[_0xc907('0x2e')][_0xc907('0x3c')]){_0x1e2855[_0xc907('0x42')]=[{'all':!![]}];}_0x1e2855=_['merge']({},_0x1e2855,_0x972587['options']);return db['SquareDetailsReport'][_0xc907('0x43')](_0x1e2855)[_0xc907('0x21')](handleEntityNotFound(_0x38ce7b,null))[_0xc907('0x21')](respondWithResult(_0x38ce7b,null))[_0xc907('0x44')](handleError(_0x38ce7b,null));};exports[_0xc907('0x45')]=function(_0x5774ef,_0x143aad){return db[_0xc907('0x29')]['create'](_0x5774ef[_0xc907('0x46')],{})[_0xc907('0x21')](respondWithResult(_0x143aad,0xc9))[_0xc907('0x44')](handleError(_0x143aad,null));};exports['update']=function(_0x1853b8,_0x20a45b){if(_0x1853b8[_0xc907('0x46')]['id']){delete _0x1853b8[_0xc907('0x46')]['id'];}return db['SquareDetailsReport'][_0xc907('0x43')]({'where':{'id':_0x1853b8['params']['id']}})['then'](handleEntityNotFound(_0x20a45b,null))[_0xc907('0x21')](saveUpdates(_0x1853b8[_0xc907('0x46')],null))[_0xc907('0x21')](respondWithResult(_0x20a45b,null))[_0xc907('0x44')](handleError(_0x20a45b,null));};exports['destroy']=function(_0x2d4803,_0x394f1c){return db[_0xc907('0x29')][_0xc907('0x43')]({'where':{'id':_0x2d4803[_0xc907('0x40')]['id']}})['then'](handleEntityNotFound(_0x394f1c,null))[_0xc907('0x21')](removeEntity(_0x394f1c,null))[_0xc907('0x44')](handleError(_0x394f1c,null));};exports[_0xc907('0x47')]=function(_0x23933d,_0x377110){return db[_0xc907('0x29')][_0xc907('0x47')]()[_0xc907('0x21')](respondWithResult(_0x377110,null))[_0xc907('0x44')](handleError(_0x377110,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8f78ec9..9dccbb0 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 _0x90a3=['request-promise','path','rimraf','./squareReportDetail.attributes','SquareDetailsReport','util','../../config/logger','api','moment','bluebird'];(function(_0x5a6c4f,_0x41bb92){var _0x3f9aea=function(_0x5f0fc1){while(--_0x5f0fc1){_0x5a6c4f['push'](_0x5a6c4f['shift']());}};_0x3f9aea(++_0x41bb92);}(_0x90a3,0x1db));var _0x390a=function(_0x584525,_0x1fb3d8){_0x584525=_0x584525-0x0;var _0x4b73f9=_0x90a3[_0x584525];return _0x4b73f9;};'use strict';var _=require('lodash');var util=require(_0x390a('0x0'));var logger=require(_0x390a('0x1'))(_0x390a('0x2'));var moment=require(_0x390a('0x3'));var BPromise=require(_0x390a('0x4'));var rp=require(_0x390a('0x5'));var fs=require('fs');var path=require(_0x390a('0x6'));var rimraf=require(_0x390a('0x7'));var config=require('../../config/environment');var attributes=require(_0x390a('0x8'));module['exports']=function(_0x408ddf,_0x110ad8){return _0x408ddf['define'](_0x390a('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd6=['moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','report_square_details','lodash','../../config/logger','api'];(function(_0x3130b5,_0x23faf7){var _0xa6d8a3=function(_0x175be7){while(--_0x175be7){_0x3130b5['push'](_0x3130b5['shift']());}};_0xa6d8a3(++_0x23faf7);}(_0x3cd6,0x1a1));var _0x63cd=function(_0x42e441,_0x4c996f){_0x42e441=_0x42e441-0x0;var _0xb5f519=_0x3cd6[_0x42e441];return _0xb5f519;};'use strict';var _=require(_0x63cd('0x0'));var util=require('util');var logger=require(_0x63cd('0x1'))(_0x63cd('0x2'));var moment=require(_0x63cd('0x3'));var BPromise=require(_0x63cd('0x4'));var rp=require(_0x63cd('0x5'));var fs=require('fs');var path=require(_0x63cd('0x6'));var rimraf=require(_0x63cd('0x7'));var config=require('../../config/environment');var attributes=require(_0x63cd('0x8'));module[_0x63cd('0x9')]=function(_0xe948cb,_0x47a318){return _0xe948cb[_0x63cd('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x63cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index e6ae289..3f7ea51 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 _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x227eea,_0x548ae8){var _0x3d9bc8=function(_0x1b984b){while(--_0x1b984b){_0x227eea['push'](_0x227eea['shift']());}};_0x3d9bc8(++_0x548ae8);}(_0x5b12,0xa3));var _0x25b1=function(_0x231395,_0x54d412){_0x231395=_0x231395-0x0;var _0x152097=_0x5b12[_0x231395];return _0x152097;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});}; \ No newline at end of file +var _0xb688=['body','options','raw','CreateSquareDetailsReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareDetailsReport','create'];(function(_0x1bde59,_0x4fb6e3){var _0xe06e60=function(_0x19f2e2){while(--_0x19f2e2){_0x1bde59['push'](_0x1bde59['shift']());}};_0xe06e60(++_0x4fb6e3);}(_0xb688,0xcf));var _0x8b68=function(_0x2d49e1,_0x7752c5){_0x2d49e1=_0x2d49e1-0x0;var _0x46ffba=_0xb688[_0x2d49e1];return _0x46ffba;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['CreateSquareDetailsReport']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')](_0xd17693[_0x8b68('0x19')],{'raw':_0xd17693[_0x8b68('0x1a')]?_0xd17693['options'][_0x8b68('0x1b')]===undefined?!![]:![]:!![]})[_0x8b68('0xc')](function(_0x59e9b1){logger[_0x8b68('0xd')](_0x8b68('0x1c'),_0xd17693);logger[_0x8b68('0x10')]('CreateSquareDetailsReport',_0xd17693,JSON['stringify'](_0x59e9b1));_0x4a68c7(_0x59e9b1);})[_0x8b68('0x16')](function(_0x59cb26){logger[_0x8b68('0x12')](_0x8b68('0x1c'),_0x59cb26[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x59cb26[_0x8b68('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 667db69..040cdad 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 _0x7d97=['/process/:pid/kill','killProcess','exports','express','get','isAuthenticated','index'];(function(_0x374d66,_0x1856c6){var _0x16f12a=function(_0x5d7b13){while(--_0x5d7b13){_0x374d66['push'](_0x374d66['shift']());}};_0x16f12a(++_0x1856c6);}(_0x7d97,0x1e6));var _0x77d9=function(_0x18ea9b,_0x2e88e2){_0x18ea9b=_0x18ea9b-0x0;var _0x41bc76=_0x7d97[_0x18ea9b];return _0x41bc76;};'use strict';var express=require(_0x77d9('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x77d9('0x1')]('/',auth[_0x77d9('0x2')](),controller[_0x77d9('0x3')]);router[_0x77d9('0x1')](_0x77d9('0x4'),auth['isAuthenticated'](),controller[_0x77d9('0x5')]);module[_0x77d9('0x6')]=router; \ No newline at end of file +var _0x0218=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','Router'];(function(_0x569af2,_0x38cf83){var _0x28558a=function(_0x5323cc){while(--_0x5323cc){_0x569af2['push'](_0x569af2['shift']());}};_0x28558a(++_0x38cf83);}(_0x0218,0x11f));var _0x8021=function(_0x1a9d6a,_0x5219eb){_0x1a9d6a=_0x1a9d6a-0x0;var _0x4915c2=_0x0218[_0x1a9d6a];return _0x4915c2;};'use strict';var express=require('express');var router=express[_0x8021('0x0')]();var auth=require(_0x8021('0x1'));var controller=require(_0x8021('0x2'));router[_0x8021('0x3')]('/',auth[_0x8021('0x4')](),controller[_0x8021('0x5')]);router[_0x8021('0x3')](_0x8021('0x6'),auth['isAuthenticated'](),controller[_0x8021('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5cc5fa7..3f2953b 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 _0x38cd=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','catch','killProcess','components/import/cm'];(function(_0x3d0c11,_0x2e9da0){var _0x5cd8a7=function(_0xca39c4){while(--_0xca39c4){_0x3d0c11['push'](_0x3d0c11['shift']());}};_0x5cd8a7(++_0x2e9da0);}(_0x38cd,0xf2));var _0xd38c=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x38cd[_0x59162a];return _0x35e50d;};'use strict';var info=require(_0xd38c('0x0'));var exec=require(_0xd38c('0x1'))[_0xd38c('0x2')];var logger=require(_0xd38c('0x3'))(_0xd38c('0x4'));var util=require(_0xd38c('0x5'));var BPromise=require(_0xd38c('0x6'));var _=require(_0xd38c('0x7'));function handleError(_0x1d19e6,_0x2abf21,_0x8600d){_0x2abf21=_0x2abf21||0x1f4;return function(_0x250b0e){logger[_0xd38c('0x8')](_0xd38c('0x9'),_0x8600d,_0x2abf21,util[_0xd38c('0xa')](_0x250b0e,{'showHidden':![],'depth':null}));delete _0x250b0e[_0xd38c('0xb')];_0x1d19e6[_0xd38c('0xc')](_0x2abf21)['send'](_0x250b0e);};}exports[_0xd38c('0xd')]=function(_0x2a5472,_0x23b020){return info['getAllData']()[_0xd38c('0xe')](function(_0x44251d){return _0x23b020[_0xd38c('0xc')](0xc8)[_0xd38c('0xf')](_0x44251d);})[_0xd38c('0x10')](function(_0x337be3){return _0x23b020['status'](0x1f4)[_0xd38c('0xf')](_0x337be3);});};exports[_0xd38c('0x11')]=function(_0x16d6f4,_0x299557){var _0x448545=[_0xd38c('0x12')];return new BPromise(function(_0x1dbb7c,_0x308c6e){return exec(util['format'](_0xd38c('0x13'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')]),function(_0x55428f,_0x5781bf,_0x416cab){if(_0x55428f){return _0x308c6e(_0x55428f);}return _0x1dbb7c(_0x5781bf);});})['then'](function(_0x228a71){var _0x236f33=![];var _0x52b735=_0x228a71[_0xd38c('0x16')](/\n/);for(var _0x37d949=0x0,_0x2145b9=_0x448545[_0xd38c('0x17')];_0x37d949<_0x2145b9,_0x236f33===![];_0x37d949+=0x1){if(_0x228a71['indexOf'](_0x448545[_0x37d949])>=0x0){_0x236f33=!![];}}if(!_0x236f33){throw new Error(util[_0xd38c('0x18')](_0xd38c('0x19'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')]));}process[_0xd38c('0x1a')](_0x16d6f4[_0xd38c('0x14')]['pid'],_0xd38c('0x1b'));return _0x299557['status'](0xc8)['json']({'message':util[_0xd38c('0x18')](_0xd38c('0x1c'),_0x16d6f4[_0xd38c('0x14')][_0xd38c('0x15')])});})['catch'](handleError(_0x299557,null,_0xd38c('0x11')));}; \ No newline at end of file +var _0x3737=['child_process','exec','api','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x24bc1e,_0x14de05){var _0x4fcbe9=function(_0x2ed7d3){while(--_0x2ed7d3){_0x24bc1e['push'](_0x24bc1e['shift']());}};_0x4fcbe9(++_0x14de05);}(_0x3737,0x11d));var _0x7373=function(_0x5913c6,_0x1239f0){_0x5913c6=_0x5913c6-0x0;var _0x22ed1c=_0x3737[_0x5913c6];return _0x22ed1c;};'use strict';var info=require(_0x7373('0x0'));var exec=require(_0x7373('0x1'))[_0x7373('0x2')];var logger=require('../../config/logger')(_0x7373('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x1f72b3,_0x5e78a0,_0xba6dcb){_0x5e78a0=_0x5e78a0||0x1f4;return function(_0x442af7){logger[_0x7373('0x4')](_0x7373('0x5'),_0xba6dcb,_0x5e78a0,util['inspect'](_0x442af7,{'showHidden':![],'depth':null}));delete _0x442af7[_0x7373('0x6')];_0x1f72b3[_0x7373('0x7')](_0x5e78a0)[_0x7373('0x8')](_0x442af7);};}exports[_0x7373('0x9')]=function(_0x10e8f9,_0x2aeedf){return info[_0x7373('0xa')]()[_0x7373('0xb')](function(_0x150cc6){return _0x2aeedf[_0x7373('0x7')](0xc8)['json'](_0x150cc6);})[_0x7373('0xc')](function(_0x4fa275){return _0x2aeedf['status'](0x1f4)[_0x7373('0xd')](_0x4fa275);});};exports[_0x7373('0xe')]=function(_0x4a4e21,_0x51b941){var _0x1daf8e=[_0x7373('0xf')];return new BPromise(function(_0x30e516,_0x395b48){return exec(util['format'](_0x7373('0x10'),_0x4a4e21['params']['pid']),function(_0x293f17,_0x182f09,_0x574266){if(_0x293f17){return _0x395b48(_0x293f17);}return _0x30e516(_0x182f09);});})[_0x7373('0xb')](function(_0x4b1032){var _0x57381c=![];var _0xeb416e=_0x4b1032['split'](/\n/);for(var _0x4673f1=0x0,_0x2675ac=_0x1daf8e[_0x7373('0x11')];_0x4673f1<_0x2675ac,_0x57381c===![];_0x4673f1+=0x1){if(_0x4b1032[_0x7373('0x12')](_0x1daf8e[_0x4673f1])>=0x0){_0x57381c=!![];}}if(!_0x57381c){throw new Error(util['format'](_0x7373('0x13'),_0x4a4e21[_0x7373('0x14')][_0x7373('0x15')]));}process[_0x7373('0x16')](_0x4a4e21[_0x7373('0x14')][_0x7373('0x15')],_0x7373('0x17'));return _0x51b941['status'](0xc8)[_0x7373('0xd')]({'message':util[_0x7373('0x18')](_0x7373('0x19'),_0x4a4e21[_0x7373('0x14')][_0x7373('0x15')])});})[_0x7373('0xc')](handleError(_0x51b941,null,_0x7373('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e60b52b..0128ec9 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 _0xaaae=['util','path','express','Router','fs-extra','../../components/interaction/service','./tag.controller','isAuthenticated','index','show','post','create','/:id','update','exports','multer'];(function(_0x190f48,_0x1e4c8c){var _0x4b0c45=function(_0x1bfd7e){while(--_0x1bfd7e){_0x190f48['push'](_0x190f48['shift']());}};_0x4b0c45(++_0x1e4c8c);}(_0xaaae,0x7f));var _0xeaaa=function(_0x81541b,_0x211950){_0x81541b=_0x81541b-0x0;var _0x5d6fcb=_0xaaae[_0x81541b];return _0x5d6fcb;};'use strict';var multer=require(_0xeaaa('0x0'));var util=require(_0xeaaa('0x1'));var path=require(_0xeaaa('0x2'));var timeout=require('connect-timeout');var express=require(_0xeaaa('0x3'));var router=express[_0xeaaa('0x4')]();var fs_extra=require(_0xeaaa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeaaa('0x6'));var config=require('../../config/environment');var controller=require(_0xeaaa('0x7'));router['get']('/',auth[_0xeaaa('0x8')](),controller[_0xeaaa('0x9')]);router['get']('/:id',auth[_0xeaaa('0x8')](),controller[_0xeaaa('0xa')]);router[_0xeaaa('0xb')]('/',auth['isAuthenticated'](),controller[_0xeaaa('0xc')]);router['put'](_0xeaaa('0xd'),auth[_0xeaaa('0x8')](),controller[_0xeaaa('0xe')]);router['delete'](_0xeaaa('0xd'),auth[_0xeaaa('0x8')](),controller['destroy']);module[_0xeaaa('0xf')]=router; \ No newline at end of file +var _0x4972=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4972,0x130));var _0x2497=function(_0x3b8a17,_0x5df740){_0x3b8a17=_0x3b8a17-0x0;var _0xee423c=_0x4972[_0x3b8a17];return _0xee423c;};'use strict';var multer=require('multer');var util=require(_0x2497('0x0'));var path=require(_0x2497('0x1'));var timeout=require('connect-timeout');var express=require(_0x2497('0x2'));var router=express[_0x2497('0x3')]();var fs_extra=require(_0x2497('0x4'));var auth=require(_0x2497('0x5'));var interaction=require(_0x2497('0x6'));var config=require(_0x2497('0x7'));var controller=require(_0x2497('0x8'));router['get']('/',auth[_0x2497('0x9')](),controller[_0x2497('0xa')]);router['get'](_0x2497('0xb'),auth[_0x2497('0x9')](),controller[_0x2497('0xc')]);router[_0x2497('0xd')]('/',auth[_0x2497('0x9')](),controller[_0x2497('0xe')]);router[_0x2497('0xf')](_0x2497('0xb'),auth['isAuthenticated'](),controller[_0x2497('0x10')]);router[_0x2497('0x11')](_0x2497('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2497('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 ee9ff03..099f703 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 _0x7a52=['#0091EA','sequelize','STRING','name'];(function(_0x2a51b4,_0x4fe9f6){var _0x4ee0b8=function(_0x4e1a1c){while(--_0x4e1a1c){_0x2a51b4['push'](_0x2a51b4['shift']());}};_0x4ee0b8(++_0x4fe9f6);}(_0x7a52,0x1bd));var _0x27a5=function(_0x5039dd,_0x52f7e5){_0x5039dd=_0x5039dd-0x0;var _0x3b701b=_0x7a52[_0x5039dd];return _0x3b701b;};'use strict';var Sequelize=require(_0x27a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x27a5('0x1')],'unique':_0x27a5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x27a5('0x1')],'defaultValue':_0x27a5('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34b7=['#0091EA','STRING','name'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0x34b7,0x196));var _0x734b=function(_0x1dae31,_0xb467ef){_0x1dae31=_0x1dae31-0x0;var _0x3827f4=_0x34b7[_0x1dae31];return _0x3827f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'unique':_0x734b('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x734b('0x0')],'defaultValue':_0x734b('0x2')},'description':{'type':Sequelize[_0x734b('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 5352087..4d7e8fc 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 _0xcb91=['json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0xcb91[_0x48f7cf];return _0xc201c0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){var _0x10a419=_0x55b232[_0x1cb9('0x24')]({'plain':!![]});var _0x69b4c8=_0x1cb9('0x25');return db[_0x1cb9('0x26')]['destroy']({'where':{'type':_0x69b4c8,'resourceId':_0x10a419['id']}})[_0x1cb9('0x22')](function(){return _0x55b232;});})[_0x1cb9('0x22')](function(){_0x27db16['status'](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x21effa,_0x41a9a0){return function(_0x1804fd){if(!_0x1804fd){_0x21effa[_0x1cb9('0x16')](0x194);}return _0x1804fd;};}function handleError(_0x21d6f5,_0x2e28fe){_0x2e28fe=_0x2e28fe||0x1f4;return function(_0xb644b3){logger[_0x1cb9('0x27')](_0xb644b3[_0x1cb9('0x28')]);if(_0xb644b3['name']){delete _0xb644b3[_0x1cb9('0x29')];}_0x21d6f5['status'](_0x2e28fe)[_0x1cb9('0x2a')](_0xb644b3);};}exports['index']=function(_0x278327,_0x41011c){var _0x3cd7f5={},_0x2038aa={},_0x561d89={'count':0x0,'rows':[]};var _0x1c701f=_['map'](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')],function(_0x4220d7){return{'name':_0x4220d7['fieldName'],'type':_0x4220d7[_0x1cb9('0x2d')]['key']};});_0x2038aa[_0x1cb9('0x2e')]=_['map'](_0x1c701f,_0x1cb9('0x29'));_0x2038aa[_0x1cb9('0x2f')]=_[_0x1cb9('0x30')](_0x278327[_0x1cb9('0x2f')]);_0x2038aa['filters']=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],_0x2038aa[_0x1cb9('0x2f')]);_0x3cd7f5[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x2038aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x3cd7f5[_0x1cb9('0x32')]=_0x3cd7f5[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x3cd7f5[_0x1cb9('0x32')]:_0x2038aa['model'];if(!_0x278327['query'][_0x1cb9('0x35')](_0x1cb9('0x36'))){_0x3cd7f5[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x1c')]);_0x3cd7f5[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x278327['query'][_0x1cb9('0x1a')]);}_0x3cd7f5[_0x1cb9('0x37')]=qs[_0x1cb9('0x38')](_0x278327['query'][_0x1cb9('0x38')]);_0x3cd7f5['where']=qs[_0x1cb9('0x39')](_['pick'](_0x278327[_0x1cb9('0x2f')],_0x2038aa[_0x1cb9('0x39')]),_0x1c701f);if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]){_0x3cd7f5[_0x1cb9('0x3b')]=_[_0x1cb9('0x3c')](_0x3cd7f5[_0x1cb9('0x3b')],{'$or':_['map'](_0x1c701f,function(_0x4ca19e){if(_0x4ca19e[_0x1cb9('0x2d')]!==_0x1cb9('0x3d')){var _0x7a0d8b={};_0x7a0d8b[_0x4ca19e[_0x1cb9('0x29')]]={'$like':'%'+_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3a')]+'%'};return _0x7a0d8b;}})});}_0x3cd7f5=_[_0x1cb9('0x3c')]({},_0x3cd7f5,_0x278327['options']);var _0xbcaa32={'where':_0x3cd7f5['where']};return db['Tag']['count'](_0xbcaa32)[_0x1cb9('0x22')](function(_0x397ff9){_0x561d89[_0x1cb9('0x1d')]=_0x397ff9;if(_0x278327[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x3cd7f5['include']=[{'all':!![]}];}return db[_0x1cb9('0x2b')]['findAll'](_0x3cd7f5);})[_0x1cb9('0x22')](function(_0x71db9d){_0x561d89[_0x1cb9('0x3f')]=_0x71db9d;return _0x561d89;})['then'](respondWithFilteredResult(_0x41011c,_0x3cd7f5))[_0x1cb9('0x40')](handleError(_0x41011c,null));};exports['show']=function(_0xda1a44,_0xbc36fc){var _0x51a898={'raw':!![],'where':{'id':_0xda1a44[_0x1cb9('0x41')]['id']}},_0x5839aa={};_0x5839aa[_0x1cb9('0x2e')]=_[_0x1cb9('0x30')](db[_0x1cb9('0x2b')][_0x1cb9('0x2c')]);_0x5839aa['query']=_[_0x1cb9('0x30')](_0xda1a44['query']);_0x5839aa['filters']=_['intersection'](_0x5839aa[_0x1cb9('0x2e')],_0x5839aa[_0x1cb9('0x2f')]);_0x51a898[_0x1cb9('0x32')]=_[_0x1cb9('0x31')](_0x5839aa[_0x1cb9('0x2e')],qs[_0x1cb9('0x33')](_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x51a898[_0x1cb9('0x32')]=_0x51a898[_0x1cb9('0x32')][_0x1cb9('0x34')]?_0x51a898['attributes']:_0x5839aa[_0x1cb9('0x2e')];if(_0xda1a44[_0x1cb9('0x2f')][_0x1cb9('0x3e')]){_0x51a898['include']=[{'all':!![]}];}_0x51a898=_[_0x1cb9('0x3c')]({},_0x51a898,_0xda1a44[_0x1cb9('0x42')]);return db[_0x1cb9('0x2b')][_0x1cb9('0x43')](_0x51a898)[_0x1cb9('0x22')](handleEntityNotFound(_0xbc36fc,null))['then'](respondWithResult(_0xbc36fc,null))[_0x1cb9('0x40')](handleError(_0xbc36fc,null));};exports['create']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x2b')][_0x1cb9('0x44')](_0x2eaa11[_0x1cb9('0x45')],{})[_0x1cb9('0x22')](function(_0x56d0c5){var _0x298475=_0x2eaa11[_0x1cb9('0x46')][_0x1cb9('0x24')]({'plain':!![]});if(!_0x298475)throw new Error(_0x1cb9('0x47'));if(_0x298475[_0x1cb9('0x48')]===_0x1cb9('0x46')){var _0x17b92a=_0x56d0c5[_0x1cb9('0x24')]({'plain':!![]});var _0xbb500e=_0x1cb9('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xbb500e,'userProfileId':_0x298475[_0x1cb9('0x49')]},'raw':!![]})[_0x1cb9('0x22')](function(_0x19e83a){if(_0x19e83a&&_0x19e83a[_0x1cb9('0x4a')]===0x0){return db[_0x1cb9('0x26')][_0x1cb9('0x44')]({'name':_0x17b92a[_0x1cb9('0x29')],'resourceId':_0x17b92a['id'],'type':_0x19e83a[_0x1cb9('0x29')],'sectionId':_0x19e83a['id']},{})[_0x1cb9('0x22')](function(){return _0x56d0c5;});}else{return _0x56d0c5;}})[_0x1cb9('0x40')](function(_0x4a4b87){logger[_0x1cb9('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a4b87);throw _0x4a4b87;});}return _0x56d0c5;})[_0x1cb9('0x22')](respondWithResult(_0x4ac483,0xc9))['catch'](handleError(_0x4ac483,null));};exports[_0x1cb9('0x21')]=function(_0x53c002,_0x5e5174){if(_0x53c002[_0x1cb9('0x45')]['id']){delete _0x53c002[_0x1cb9('0x45')]['id'];}return db[_0x1cb9('0x2b')]['find']({'where':{'id':_0x53c002[_0x1cb9('0x41')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x5e5174,null))['then'](saveUpdates(_0x53c002['body'],null))[_0x1cb9('0x22')](respondWithResult(_0x5e5174,null))[_0x1cb9('0x40')](handleError(_0x5e5174,null));};exports[_0x1cb9('0x23')]=function(_0x2b3f2a,_0x3de325){return db[_0x1cb9('0x2b')][_0x1cb9('0x43')]({'where':{'id':_0x2b3f2a['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x3de325,null))[_0x1cb9('0x22')](removeEntity(_0x3de325,null))[_0x1cb9('0x40')](handleError(_0x3de325,null));}; \ No newline at end of file +var _0xedd9=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','get','Tags','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x5b20ac,_0x386127){var _0x4c1624=function(_0x2ab68b){while(--_0x2ab68b){_0x5b20ac['push'](_0x5b20ac['shift']());}};_0x4c1624(++_0x386127);}(_0xedd9,0xfc));var _0x9edd=function(_0x1addaf,_0x2c6054){_0x1addaf=_0x1addaf-0x0;var _0x432c9e=_0xedd9[_0x1addaf];return _0x432c9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){var _0xeaf55a=_0x339a0d[_0x9edd('0x22')]({'plain':!![]});var _0x2f9f86=_0x9edd('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f9f86,'resourceId':_0xeaf55a['id']}})[_0x9edd('0x21')](function(){return _0x339a0d;});})[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x3c2227,_0x4fe471){return function(_0x57a2cc){if(!_0x57a2cc){_0x3c2227[_0x9edd('0x18')](0x194);}return _0x57a2cc;};}function handleError(_0x257a26,_0x1c762c){_0x1c762c=_0x1c762c||0x1f4;return function(_0x52746a){logger[_0x9edd('0x25')](_0x52746a[_0x9edd('0x26')]);if(_0x52746a[_0x9edd('0x27')]){delete _0x52746a[_0x9edd('0x27')];}_0x257a26['status'](_0x1c762c)[_0x9edd('0x28')](_0x52746a);};}exports[_0x9edd('0x29')]=function(_0xbe87e1,_0x12c1bc){var _0xbbf08f={},_0x42e664={},_0x209aba={'count':0x0,'rows':[]};var _0x1fba7b=_[_0x9edd('0x2a')](db[_0x9edd('0x2b')][_0x9edd('0x2c')],function(_0x138002){return{'name':_0x138002[_0x9edd('0x2d')],'type':_0x138002[_0x9edd('0x2e')][_0x9edd('0x2f')]};});_0x42e664['model']=_[_0x9edd('0x2a')](_0x1fba7b,_0x9edd('0x27'));_0x42e664[_0x9edd('0x30')]=_['keys'](_0xbe87e1[_0x9edd('0x30')]);_0x42e664[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],_0x42e664[_0x9edd('0x30')]);_0xbbf08f[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],qs[_0x9edd('0x35')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x35')]));_0xbbf08f[_0x9edd('0x34')]=_0xbbf08f[_0x9edd('0x34')][_0x9edd('0x36')]?_0xbbf08f['attributes']:_0x42e664[_0x9edd('0x33')];if(!_0xbe87e1['query'][_0x9edd('0x37')](_0x9edd('0x38'))){_0xbbf08f[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0xbe87e1[_0x9edd('0x30')]['limit']);_0xbbf08f[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x1b')]);}_0xbbf08f[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3a')]);_0xbbf08f[_0x9edd('0x3b')]=qs[_0x9edd('0x31')](_['pick'](_0xbe87e1[_0x9edd('0x30')],_0x42e664['filters']),_0x1fba7b);if(_0xbe87e1[_0x9edd('0x30')]['filter']){_0xbbf08f[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0xbbf08f[_0x9edd('0x3b')],{'$or':_['map'](_0x1fba7b,function(_0x2e85aa){if(_0x2e85aa[_0x9edd('0x2e')]!==_0x9edd('0x3d')){var _0x48958a={};_0x48958a[_0x2e85aa[_0x9edd('0x27')]]={'$like':'%'+_0xbe87e1['query'][_0x9edd('0x3e')]+'%'};return _0x48958a;}})});}_0xbbf08f=_[_0x9edd('0x3c')]({},_0xbbf08f,_0xbe87e1['options']);var _0x315f52={'where':_0xbbf08f[_0x9edd('0x3b')]};return db[_0x9edd('0x2b')][_0x9edd('0x1e')](_0x315f52)['then'](function(_0x449f01){_0x209aba['count']=_0x449f01;if(_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3f')]){_0xbbf08f['include']=[{'all':!![]}];}return db[_0x9edd('0x2b')]['findAll'](_0xbbf08f);})['then'](function(_0x369b69){_0x209aba[_0x9edd('0x40')]=_0x369b69;return _0x209aba;})[_0x9edd('0x21')](respondWithFilteredResult(_0x12c1bc,_0xbbf08f))[_0x9edd('0x41')](handleError(_0x12c1bc,null));};exports[_0x9edd('0x42')]=function(_0x4737ae,_0x3ff512){var _0x75efbe={'raw':!![],'where':{'id':_0x4737ae[_0x9edd('0x43')]['id']}},_0x18c149={};_0x18c149[_0x9edd('0x33')]=_[_0x9edd('0x44')](db[_0x9edd('0x2b')][_0x9edd('0x2c')]);_0x18c149[_0x9edd('0x30')]=_['keys'](_0x4737ae[_0x9edd('0x30')]);_0x18c149[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x18c149[_0x9edd('0x33')],_0x18c149[_0x9edd('0x30')]);_0x75efbe[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x18c149['model'],qs['fields'](_0x4737ae['query'][_0x9edd('0x35')]));_0x75efbe['attributes']=_0x75efbe[_0x9edd('0x34')][_0x9edd('0x36')]?_0x75efbe[_0x9edd('0x34')]:_0x18c149[_0x9edd('0x33')];if(_0x4737ae[_0x9edd('0x30')]['includeAll']){_0x75efbe[_0x9edd('0x45')]=[{'all':!![]}];}_0x75efbe=_[_0x9edd('0x3c')]({},_0x75efbe,_0x4737ae[_0x9edd('0x46')]);return db['Tag'][_0x9edd('0x47')](_0x75efbe)[_0x9edd('0x21')](handleEntityNotFound(_0x3ff512,null))[_0x9edd('0x21')](respondWithResult(_0x3ff512,null))[_0x9edd('0x41')](handleError(_0x3ff512,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){return db[_0x9edd('0x2b')][_0x9edd('0x48')](_0x35bdec['body'],{})[_0x9edd('0x21')](function(_0x8d8701){var _0x4bb324=_0x35bdec[_0x9edd('0x49')][_0x9edd('0x22')]({'plain':!![]});if(!_0x4bb324)throw new Error(_0x9edd('0x4a'));if(_0x4bb324['role']===_0x9edd('0x49')){var _0x151157=_0x8d8701[_0x9edd('0x22')]({'plain':!![]});var _0x28c7bd='Tags';return db[_0x9edd('0x4b')][_0x9edd('0x47')]({'where':{'name':_0x28c7bd,'userProfileId':_0x4bb324[_0x9edd('0x4c')]},'raw':!![]})['then'](function(_0x16951a){if(_0x16951a&&_0x16951a[_0x9edd('0x4d')]===0x0){return db['UserProfileResource'][_0x9edd('0x48')]({'name':_0x151157['name'],'resourceId':_0x151157['id'],'type':_0x16951a[_0x9edd('0x27')],'sectionId':_0x16951a['id']},{})[_0x9edd('0x21')](function(){return _0x8d8701;});}else{return _0x8d8701;}})[_0x9edd('0x41')](function(_0x3fcdf5){logger[_0x9edd('0x25')](_0x9edd('0x4e'),_0x3fcdf5);throw _0x3fcdf5;});}return _0x8d8701;})[_0x9edd('0x21')](respondWithResult(_0x4d4f33,0xc9))[_0x9edd('0x41')](handleError(_0x4d4f33,null));};exports[_0x9edd('0x4f')]=function(_0x25d9cc,_0x31272d){if(_0x25d9cc['body']['id']){delete _0x25d9cc[_0x9edd('0x50')]['id'];}return db[_0x9edd('0x2b')][_0x9edd('0x47')]({'where':{'id':_0x25d9cc['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x31272d,null))['then'](saveUpdates(_0x25d9cc['body'],null))['then'](respondWithResult(_0x31272d,null))[_0x9edd('0x41')](handleError(_0x31272d,null));};exports[_0x9edd('0x51')]=function(_0x366316,_0x35ddb3){return db['Tag']['find']({'where':{'id':_0x366316['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x35ddb3,null))[_0x9edd('0x21')](removeEntity(_0x35ddb3,null))[_0x9edd('0x41')](handleError(_0x35ddb3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 75d45a0..5d6967c 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 _0x1545=['define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./tag.attributes','exports'];(function(_0x200d1a,_0x33a0f3){var _0x35a57e=function(_0x2adaa5){while(--_0x2adaa5){_0x200d1a['push'](_0x200d1a['shift']());}};_0x35a57e(++_0x33a0f3);}(_0x1545,0x1b3));var _0x5154=function(_0x1631a0,_0xb2411b){_0x1631a0=_0x1631a0-0x0;var _0x814543=_0x1545[_0x1631a0];return _0x814543;};'use strict';var _=require(_0x5154('0x0'));var util=require(_0x5154('0x1'));var logger=require(_0x5154('0x2'))(_0x5154('0x3'));var moment=require(_0x5154('0x4'));var BPromise=require('bluebird');var rp=require(_0x5154('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5154('0x6'));var attributes=require(_0x5154('0x7'));module[_0x5154('0x8')]=function(_0x329b1e,_0x2d17d8){return _0x329b1e[_0x5154('0x9')](_0x5154('0xa'),attributes,{'tableName':_0x5154('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca2b=['./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4cedc6,_0x45bc8b){var _0x4a5d0a=function(_0x11da46){while(--_0x11da46){_0x4cedc6['push'](_0x4cedc6['shift']());}};_0x4a5d0a(++_0x45bc8b);}(_0xca2b,0x156));var _0xbca2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca2b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbca2('0x0'));var util=require(_0xbca2('0x1'));var logger=require(_0xbca2('0x2'))(_0xbca2('0x3'));var moment=require(_0xbca2('0x4'));var BPromise=require(_0xbca2('0x5'));var rp=require(_0xbca2('0x6'));var fs=require('fs');var path=require(_0xbca2('0x7'));var rimraf=require('rimraf');var config=require(_0xbca2('0x8'));var attributes=require(_0xbca2('0x9'));module['exports']=function(_0x17439f,_0x56d486){return _0x17439f[_0xbca2('0xa')](_0xbca2('0xb'),attributes,{'tableName':_0xbca2('0xc'),'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 516da57..92cb96a 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 _0xf2cb=['util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5804ae,_0x5240b6){var _0x1b2882=function(_0x42d9f3){while(--_0x42d9f3){_0x5804ae['push'](_0x5804ae['shift']());}};_0x1b2882(++_0x5240b6);}(_0xf2cb,0x130));var _0xbf2c=function(_0x227060,_0x3afa81){_0x227060=_0x227060-0x0;var _0x6cf9d8=_0xf2cb[_0x227060];return _0x6cf9d8;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Tag,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Tag,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});} \ No newline at end of file +var _0xf873=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0xf873,0xb2));var _0x3f87=function(_0x2545d5,_0x17d513){_0x2545d5=_0x2545d5-0x0;var _0x19cda0=_0xf873[_0x2545d5];return _0x19cda0;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require(_0x3f87('0x7'))(_0x3f87('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f87('0x9'));var client=jayson[_0x3f87('0xa')][_0x3f87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5e37,_0x8bf89b,_0x2c7ccc){return new BPromise(function(_0x3b8e92,_0x41faf2){return client[_0x3f87('0xc')](_0x5a5e37,_0x2c7ccc)[_0x3f87('0xd')](function(_0x4c3ed4){logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));logger[_0x3f87('0x11')](_0x3f87('0x12'),_0x8bf89b,_0x3f87('0x10'),JSON[_0x3f87('0x13')](_0x4c3ed4));if(_0x4c3ed4[_0x3f87('0x14')]){if(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x15')]===0x1f4){logger[_0x3f87('0x14')](_0x3f87('0xf'),_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x41faf2(_0x4c3ed4['error'][_0x3f87('0x16')]);}logger[_0x3f87('0x14')]('Tag,\x20%s,\x20%s',_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x3b8e92(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);}else{logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));_0x3b8e92(_0x4c3ed4[_0x3f87('0x17')]['message']);}})[_0x3f87('0x18')](function(_0x3ac7a7){logger[_0x3f87('0x14')]('Tag,\x20%s,\x20%s',_0x8bf89b,_0x3ac7a7);_0x41faf2(_0x3ac7a7);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c018607..78386a7 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 e54aa01..0964b79 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 _0x2032=['name','exports','STRING'];(function(_0x5b7b81,_0x47d77a){var _0x3addbe=function(_0x1f793a){while(--_0x1f793a){_0x5b7b81['push'](_0x5b7b81['shift']());}};_0x3addbe(++_0x47d77a);}(_0x2032,0xd9));var _0x2203=function(_0x4a9b28,_0x5ddb76){_0x4a9b28=_0x4a9b28-0x0;var _0x1bc7be=_0x2032[_0x4a9b28];return _0x1bc7be;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 22a1f74..f161930 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 _0xb7ca=['SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','channel','isValidChannel','capitalize','toLowerCase','Queue','order','Queues','ValidationError','Unknown\x20channel','add','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','spread','removeAgents','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','Team','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xb7ca,0x178));var _0xab7c=function(_0x1c0d07,_0x38fe0d){_0x1c0d07=_0x1c0d07-0x0;var _0x2bd3ad=_0xb7ca[_0x1c0d07];return _0x2bd3ad;};'use strict';var emlformat=require(_0xab7c('0x0'));var rimraf=require(_0xab7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab7c('0x2'));var rp=require(_0xab7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab7c('0x4'));var path=require(_0xab7c('0x5'));var sox=require(_0xab7c('0x6'));var csv=require(_0xab7c('0x7'));var ejs=require(_0xab7c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab7c('0x9'));var deskjs=require(_0xab7c('0xa'));var toCsv=require(_0xab7c('0x7'));var querystring=require(_0xab7c('0xb'));var Papa=require('papaparse');var Redis=require(_0xab7c('0xc'));var authService=require(_0xab7c('0xd'));var qs=require(_0xab7c('0xe'));var as=require(_0xab7c('0xf'));var hardwareService=require(_0xab7c('0x10'));var logger=require(_0xab7c('0x11'))(_0xab7c('0x12'));var utils=require(_0xab7c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab7c('0x14'));var db=require(_0xab7c('0x15'))['db'];config[_0xab7c('0x16')]=_[_0xab7c('0x17')](config['redis'],{'host':_0xab7c('0x18'),'port':0x18eb});var socket=require(_0xab7c('0x19'))(new Redis(config['redis']));require(_0xab7c('0x1a'))[_0xab7c('0x1b')](socket);function respondWithStatusCode(_0x28e4d9,_0x14dede){_0x14dede=_0x14dede||0xcc;return function(_0x674c09){if(_0x674c09){return _0x28e4d9['sendStatus'](_0x14dede);}return _0x28e4d9['status'](_0x14dede)['end']();};}function respondWithResult(_0xbf2d5f,_0x3cf844){_0x3cf844=_0x3cf844||0xc8;return function(_0x1f6289){if(_0x1f6289){return _0xbf2d5f[_0xab7c('0x1c')](_0x3cf844)[_0xab7c('0x1d')](_0x1f6289);}};}function respondWithFilteredResult(_0x548541,_0x21993c){return function(_0x14a812){if(_0x14a812){var _0x221a4c=typeof _0x21993c[_0xab7c('0x1e')]==='undefined'&&typeof _0x21993c[_0xab7c('0x1f')]===_0xab7c('0x20');var _0x1abc6a=_0x14a812[_0xab7c('0x21')];var _0x2fb8bd=_0x221a4c?0x0:_0x21993c[_0xab7c('0x1e')];var _0xc1a6c5=_0x221a4c?_0x14a812[_0xab7c('0x21')]:_0x21993c['offset']+_0x21993c[_0xab7c('0x1f')];var _0x13da1a;if(_0xc1a6c5>=_0x1abc6a){_0xc1a6c5=_0x1abc6a;_0x13da1a=0xc8;}else{_0x13da1a=0xce;}_0x548541[_0xab7c('0x1c')](_0x13da1a);return _0x548541[_0xab7c('0x22')](_0xab7c('0x23'),_0x2fb8bd+'-'+_0xc1a6c5+'/'+_0x1abc6a)[_0xab7c('0x1d')](_0x14a812);}return null;};}function patchUpdates(_0x146a03){return function(_0x239399){try{jsonpatch[_0xab7c('0x24')](_0x239399,_0x146a03,!![]);}catch(_0x59e6de){return BPromise[_0xab7c('0x25')](_0x59e6de);}return _0x239399[_0xab7c('0x26')]();};}function saveUpdates(_0x4d4aa1,_0x3c9e7a){return function(_0x443b3f){if(_0x443b3f){return _0x443b3f['update'](_0x4d4aa1)[_0xab7c('0x27')](function(_0x5b74f){return _0x5b74f;});}return null;};}function handleEntityNotFound(_0x351743,_0x1c6504){return function(_0x1d6321){if(!_0x1d6321){_0x351743[_0xab7c('0x28')](0x194);}return _0x1d6321;};}function handleError(_0x56ca83,_0x107cc0){_0x107cc0=_0x107cc0||0x1f4;return function(_0x2193c5){logger[_0xab7c('0x29')](_0x2193c5[_0xab7c('0x2a')]);if(_0x2193c5[_0xab7c('0x2b')]){delete _0x2193c5['name'];}_0x56ca83[_0xab7c('0x1c')](_0x107cc0)[_0xab7c('0x2c')](_0x2193c5);};}exports[_0xab7c('0x2d')]=function(_0x580875,_0x13aeb9){var _0x7f5a73={},_0x29e37c={},_0x5c33ed={'count':0x0,'rows':[]};var _0x193650=_[_0xab7c('0x2e')](db[_0xab7c('0x2f')]['rawAttributes'],function(_0x53d12b){return{'name':_0x53d12b[_0xab7c('0x30')],'type':_0x53d12b[_0xab7c('0x31')]['key']};});_0x29e37c[_0xab7c('0x32')]=_[_0xab7c('0x2e')](_0x193650,_0xab7c('0x2b'));_0x29e37c[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x580875['query']);_0x29e37c[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x29e37c[_0xab7c('0x32')],_0x29e37c[_0xab7c('0x33')]);_0x7f5a73[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x29e37c[_0xab7c('0x32')],qs[_0xab7c('0x38')](_0x580875[_0xab7c('0x33')][_0xab7c('0x38')]));_0x7f5a73[_0xab7c('0x37')]=_0x7f5a73[_0xab7c('0x37')]['length']?_0x7f5a73['attributes']:_0x29e37c[_0xab7c('0x32')];if(!_0x580875[_0xab7c('0x33')]['hasOwnProperty'](_0xab7c('0x39'))){_0x7f5a73[_0xab7c('0x1f')]=qs['limit'](_0x580875[_0xab7c('0x33')]['limit']);_0x7f5a73['offset']=qs['offset'](_0x580875['query'][_0xab7c('0x1e')]);}_0x7f5a73['order']=qs[_0xab7c('0x3a')](_0x580875['query'][_0xab7c('0x3a')]);_0x7f5a73['where']=qs[_0xab7c('0x35')](_[_0xab7c('0x3b')](_0x580875['query'],_0x29e37c[_0xab7c('0x35')]),_0x193650);if(_0x580875['query'][_0xab7c('0x3c')]){_0x7f5a73['where']=_['merge'](_0x7f5a73[_0xab7c('0x3d')],{'$or':_[_0xab7c('0x2e')](_0x193650,function(_0x27f0de){if(_0x27f0de[_0xab7c('0x31')]!==_0xab7c('0x3e')){var _0x48a57d={};_0x48a57d[_0x27f0de[_0xab7c('0x2b')]]={'$like':'%'+_0x580875[_0xab7c('0x33')][_0xab7c('0x3c')]+'%'};return _0x48a57d;}})});}_0x7f5a73=_['merge']({},_0x7f5a73,_0x580875['options']);var _0x33772e={'where':_0x7f5a73[_0xab7c('0x3d')]};return db[_0xab7c('0x2f')][_0xab7c('0x21')](_0x33772e)[_0xab7c('0x27')](function(_0x3f5521){_0x5c33ed[_0xab7c('0x21')]=_0x3f5521;if(_0x580875[_0xab7c('0x33')][_0xab7c('0x3f')]){_0x7f5a73['include']=[{'all':!![]}];}return db[_0xab7c('0x2f')][_0xab7c('0x40')](_0x7f5a73);})['then'](function(_0x3f48cc){_0x5c33ed[_0xab7c('0x41')]=_0x3f48cc;return _0x5c33ed;})[_0xab7c('0x27')](respondWithFilteredResult(_0x13aeb9,_0x7f5a73))[_0xab7c('0x42')](handleError(_0x13aeb9,null));};exports[_0xab7c('0x43')]=function(_0x277b80,_0x487ef9){var _0x37d4ca={'raw':![],'where':{'id':_0x277b80[_0xab7c('0x44')]['id']}},_0x37fe28={};_0x37fe28[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_0xab7c('0x2f')][_0xab7c('0x45')]);_0x37fe28[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x277b80[_0xab7c('0x33')]);_0x37fe28[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x37fe28[_0xab7c('0x32')],_0x37fe28[_0xab7c('0x33')]);_0x37d4ca[_0xab7c('0x37')]=_['intersection'](_0x37fe28[_0xab7c('0x32')],qs[_0xab7c('0x38')](_0x277b80[_0xab7c('0x33')][_0xab7c('0x38')]));_0x37d4ca[_0xab7c('0x37')]=_0x37d4ca['attributes'][_0xab7c('0x46')]?_0x37d4ca[_0xab7c('0x37')]:_0x37fe28[_0xab7c('0x32')];if(_0x277b80[_0xab7c('0x33')][_0xab7c('0x3f')]){_0x37d4ca[_0xab7c('0x47')]=[{'all':!![]}];}_0x37d4ca=_[_0xab7c('0x48')]({},_0x37d4ca,_0x277b80[_0xab7c('0x49')]);return db[_0xab7c('0x2f')][_0xab7c('0x4a')](_0x37d4ca)[_0xab7c('0x27')](handleEntityNotFound(_0x487ef9,null))[_0xab7c('0x27')](respondWithResult(_0x487ef9,null))[_0xab7c('0x42')](handleError(_0x487ef9,null));};exports[_0xab7c('0x4b')]=function(_0x105117,_0x5bddf7){return db[_0xab7c('0x2f')][_0xab7c('0x4b')](_0x105117['body'],{})[_0xab7c('0x27')](function(_0x1ad567){var _0x2453ee=_0x105117['user']['get']({'plain':!![]});if(!_0x2453ee)throw new Error(_0xab7c('0x4c'));if(_0x2453ee[_0xab7c('0x4d')]===_0xab7c('0x4e')){var _0x23f9dc=_0x1ad567[_0xab7c('0x4f')]({'plain':!![]});var _0x3fbf79=_0xab7c('0x50');return db[_0xab7c('0x51')][_0xab7c('0x4a')]({'where':{'name':_0x3fbf79,'userProfileId':_0x2453ee[_0xab7c('0x52')]},'raw':!![]})['then'](function(_0x3672c5){if(_0x3672c5&&_0x3672c5[_0xab7c('0x53')]===0x0){return db[_0xab7c('0x54')][_0xab7c('0x4b')]({'name':_0x23f9dc[_0xab7c('0x2b')],'resourceId':_0x23f9dc['id'],'type':_0x3672c5[_0xab7c('0x2b')],'sectionId':_0x3672c5['id']},{})[_0xab7c('0x27')](function(){return _0x1ad567;});}else{return _0x1ad567;}})['catch'](function(_0x8cb51f){logger['error'](_0xab7c('0x55'),_0x8cb51f);throw _0x8cb51f;});}return _0x1ad567;})['then'](respondWithResult(_0x5bddf7,0xc9))['catch'](handleError(_0x5bddf7,null));};exports[_0xab7c('0x56')]=function(_0x3ae43c,_0xbf229a){if(_0x3ae43c['body']['id']){delete _0x3ae43c[_0xab7c('0x57')]['id'];}return db[_0xab7c('0x2f')][_0xab7c('0x4a')]({'where':{'id':_0x3ae43c[_0xab7c('0x44')]['id']}})['then'](handleEntityNotFound(_0xbf229a,null))[_0xab7c('0x27')](saveUpdates(_0x3ae43c['body'],null))[_0xab7c('0x27')](respondWithResult(_0xbf229a,null))[_0xab7c('0x42')](handleError(_0xbf229a,null));};exports['destroy']=function(_0xa4f0fb,_0x4dd10b){var _0xfd05b6=_0xa4f0fb[_0xab7c('0x44')]['id'];var _0x15f2a9=[];return db[_0xab7c('0x58')]['transaction'](function(_0x3ad57f){var _0x40d246=_0xab7c('0x59')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x40d246,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f})[_0xab7c('0x27')](function(_0x1b11c9){_0x15f2a9=_['map'](_0x1b11c9,function(_0x5b8657){return Number(_0x5b8657[_0xab7c('0x5d')]);});})[_0xab7c('0x27')](function(){var _0x565411=_0xab7c('0x5e')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x565411,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x114686){var _0x39434e=_['map'](_0x114686,function(_0x237ea4){return Number(_0x237ea4[_0xab7c('0x5f')]);});return db['UserVoiceQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'VoiceQueueId':{'$in':_0x39434e}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x35c2b0=_0xab7c('0x61')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x35c2b0,{'type':db['Sequelize'][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0xbcd8a6){var _0xdc8292=_['map'](_0xbcd8a6,function(_0x347c8a){return Number(_0x347c8a[_0xab7c('0x62')]);});return db[_0xab7c('0x63')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'MailQueueId':{'$in':_0xdc8292}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x17b46f=_0xab7c('0x64')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x17b46f,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')]['SELECT'],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x1010c4){var _0x388603=_[_0xab7c('0x2e')](_0x1010c4,function(_0x505cc2){return Number(_0x505cc2[_0xab7c('0x65')]);});return db[_0xab7c('0x66')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'SmsQueueId':{'$in':_0x388603}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x2e64a2=_0xab7c('0x67')+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x2e64a2,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x53a921){var _0x4e350a=_[_0xab7c('0x2e')](_0x53a921,function(_0x5efdc4){return Number(_0x5efdc4[_0xab7c('0x68')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x15f2a9},'ChatQueueId':{'$in':_0x4e350a}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x56e5dd=_0xab7c('0x69')+_0xfd05b6;return db[_0xab7c('0x58')]['query'](_0x56e5dd,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})['then'](function(_0x41d46a){var _0x270988=_[_0xab7c('0x2e')](_0x41d46a,function(_0x239b6b){return Number(_0x239b6b[_0xab7c('0x6a')]);});return db['UserFaxQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'FaxQueueId':{'$in':_0x270988}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x286630='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xfd05b6;return db[_0xab7c('0x58')][_0xab7c('0x33')](_0x286630,{'type':db[_0xab7c('0x5a')][_0xab7c('0x5b')][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})['then'](function(_0x1182ca){var _0x5b7720=_[_0xab7c('0x2e')](_0x1182ca,function(_0x33be3b){return Number(_0x33be3b[_0xab7c('0x6b')]);});return db['UserOpenchannelQueue'][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'OpenchannelQueueId':{'$in':_0x5b7720}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){var _0x341603=_0xab7c('0x6c')+_0xfd05b6;return db[_0xab7c('0x58')]['query'](_0x341603,{'type':db[_0xab7c('0x5a')]['QueryTypes'][_0xab7c('0x5c')],'raw':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x514e84){var _0x686a54=_[_0xab7c('0x2e')](_0x514e84,function(_0x1e37e0){return Number(_0x1e37e0[_0xab7c('0x6d')]);});return db[_0xab7c('0x6e')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'WhatsappQueueId':{'$in':_0x686a54}},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){return db[_0xab7c('0x6f')][_0xab7c('0x4a')]({'where':{'TeamId':_0xfd05b6}});})[_0xab7c('0x27')](function(_0xc5d1b){if(_0xc5d1b===null){return;}return db[_0xab7c('0x70')][_0xab7c('0x60')]({'where':{'UserId':{'$in':_0x15f2a9},'VoicePrefixId':_0xc5d1b[_0xab7c('0x71')]},'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(){return db[_0xab7c('0x2f')]['destroy']({'where':{'id':_0xfd05b6},'cascade':!![],'transaction':_0x3ad57f});})[_0xab7c('0x27')](function(_0x2cb30e){if(_0x2cb30e===0x0){_0x4dd10b[_0xab7c('0x28')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0xab7c('0x50'),'resourceId':_0xfd05b6},'cascade':!![],'transaction':_0x3ad57f})['then'](function(){_0x4dd10b[_0xab7c('0x1c')](0xcc)[_0xab7c('0x72')]();});}})[_0xab7c('0x42')](function(_0x510fc1){_0x4dd10b[_0xab7c('0x1c')](0x1f4)[_0xab7c('0x2c')](_0x510fc1);});});};exports[_0xab7c('0x73')]=function(_0x57e074,_0x8d9574,_0x5152d2){return db[_0xab7c('0x2f')]['findOne']({'where':{'id':_0x57e074[_0xab7c('0x44')]['id']}})['then'](handleEntityNotFound(_0x8d9574,null))[_0xab7c('0x27')](function(_0x4df834){if(!_0x57e074[_0xab7c('0x33')][_0xab7c('0x74')]||!utils[_0xab7c('0x75')](_0x57e074['query'][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))]['ValidationError']('Unknown\x20channel');}var _0x3caef7={};var _0x481c07={};_0x481c07[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_[_0xab7c('0x76')](_0x57e074['query'][_0xab7c('0x74')][_0xab7c('0x77')]())+_0xab7c('0x78')][_0xab7c('0x45')]);_0x481c07[_0xab7c('0x33')]=_['keys'](_0x57e074[_0xab7c('0x33')]);_0x481c07[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x481c07[_0xab7c('0x32')],_0x481c07[_0xab7c('0x33')]);_0x3caef7[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x481c07[_0xab7c('0x32')],qs['fields'](_0x57e074[_0xab7c('0x33')][_0xab7c('0x38')]));_0x3caef7[_0xab7c('0x37')]=_0x3caef7[_0xab7c('0x37')][_0xab7c('0x46')]?_0x3caef7['attributes']:_0x481c07[_0xab7c('0x32')];_0x3caef7[_0xab7c('0x1f')]=qs[_0xab7c('0x1f')](_0x57e074[_0xab7c('0x33')][_0xab7c('0x1f')]);_0x3caef7['offset']=qs['offset'](_0x57e074[_0xab7c('0x33')]['offset']);_0x3caef7[_0xab7c('0x79')]=qs[_0xab7c('0x3a')](_0x57e074[_0xab7c('0x33')][_0xab7c('0x3a')]);_0x3caef7[_0xab7c('0x3d')]=qs['filters'](_[_0xab7c('0x3b')](_0x57e074[_0xab7c('0x33')],_0x481c07[_0xab7c('0x35')]));_0x3caef7=_[_0xab7c('0x48')]({},_0x3caef7,_0x57e074[_0xab7c('0x49')]);return _0x4df834['get'+_[_0xab7c('0x76')](_0x57e074['query']['channel'][_0xab7c('0x77')]())+_0xab7c('0x7a')](_0x3caef7);})[_0xab7c('0x27')](respondWithResult(_0x8d9574,null))[_0xab7c('0x42')](handleError(_0x8d9574,null));};exports['addQueues']=function(_0x2906dd,_0x53b851,_0x3c1d33){return db[_0xab7c('0x2f')]['findOne']({'where':{'id':_0x2906dd[_0xab7c('0x44')]['id']}})['then'](function(_0x30fd29){if(_0x30fd29){if(!_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')]||!utils[_0xab7c('0x75')](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))][(_0xab7c('0x7b'))](_0xab7c('0x7c'));}return _0x30fd29[_0xab7c('0x7d')+_['capitalize'](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x74')][_0xab7c('0x77')]())+_0xab7c('0x7a')](_0x2906dd[_0xab7c('0x57')][_0xab7c('0x7e')]);}return null;})[_0xab7c('0x27')](handleEntityNotFound(_0x53b851,null))['then'](respondWithStatusCode(_0x53b851,null))[_0xab7c('0x42')](handleError(_0x53b851,null));};exports[_0xab7c('0x7f')]=function(_0x11fd0f,_0x197fa6,_0x3c50a2){return db['Team'][_0xab7c('0x80')]({'where':{'id':_0x11fd0f[_0xab7c('0x44')]['id']}})[_0xab7c('0x27')](function(_0x5604cf){if(_0x5604cf){if(!_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x74')]||!utils['isValidChannel'](_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x74')])){throw new db[(_0xab7c('0x5a'))][(_0xab7c('0x7b'))](_0xab7c('0x7c'));}return _0x5604cf[_0xab7c('0x81')+_['capitalize'](_0x11fd0f['query']['channel']['toLowerCase']())+_0xab7c('0x7a')](_0x11fd0f[_0xab7c('0x33')][_0xab7c('0x7e')]);}return null;})[_0xab7c('0x27')](handleEntityNotFound(_0x197fa6,null))[_0xab7c('0x27')](respondWithStatusCode(_0x197fa6,null))[_0xab7c('0x42')](handleError(_0x197fa6,null));};exports[_0xab7c('0x82')]=function(_0xdd9753,_0xaceca7){var _0x52bf26=_[_0xab7c('0x83')](_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')])?_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')]:[_0xdd9753[_0xab7c('0x57')][_0xab7c('0x7e')]];var _0x393f9e=_0xdd9753[_0xab7c('0x44')]['id'];return db[_0xab7c('0x2f')]['find']({'where':{'id':_0x393f9e}})['then'](handleEntityNotFound(_0xaceca7,null))[_0xab7c('0x27')](function(_0x455a07){if(_0x455a07){var _0x642d13=[_0xab7c('0x84'),_0xab7c('0x85'),_0xab7c('0x86'),'Sms','Fax',_0xab7c('0x87'),_0xab7c('0x88')];return db[_0xab7c('0x58')][_0xab7c('0x89')](function(_0x269983){var _0x17a630=_[_0xab7c('0x2e')](_0x642d13,function(_0x1e1421){var _0x5c585c={'attributes':['id',_0xab7c('0x2b')]};if(_0x1e1421===_0xab7c('0x84')){_0x5c585c[_0xab7c('0x8a')]={'attributes':['penalty']};}return _0x455a07[_0xab7c('0x4f')+_0x1e1421+'Queues'](_0x5c585c)[_0xab7c('0x27')](function(_0x3aad87){var _0x415181=_[_0xab7c('0x2e')](_0x3aad87,function(_0x4884c6){var _0x3f0ba7=_['map'](_0x52bf26,function(_0x51a4ed){var _0xf4e8f8={'where':{'UserId':_0x51a4ed,[_0x1e1421+_0xab7c('0x8b')]:_0x4884c6['id']},'transaction':_0x269983};if(_0x1e1421===_0xab7c('0x84')){_0xf4e8f8[_0xab7c('0x17')]={'penalty':_0x4884c6[_0xab7c('0x8c')][_0xab7c('0x8d')]};}return db[_0xab7c('0x8e')+_0x1e1421+'Queue'][_0xab7c('0x8f')](_0xf4e8f8)[_0xab7c('0x27')](function(){socket[_0xab7c('0x90')](_0xab7c('0x4e')+_0x1e1421+'Queue:save',{'UserId':_0x51a4ed,[_0x1e1421+'QueueId']:_0x4884c6['id']});if(_0x1e1421!==_0xab7c('0x84')){return;}return db['User'][_0xab7c('0x40')]({'where':{'id':_0x52bf26,'online':0x1},'attributes':['id','name','online','voicePause',_0xab7c('0x91')],'raw':!![]})[_0xab7c('0x27')](function(_0x5e6e19){var _0x26d5dd=_[_0xab7c('0x2e')](_0x5e6e19,function(_0x36b1d9){return db[_0xab7c('0x92')][_0xab7c('0x93')]({'membername':_0x36b1d9[_0xab7c('0x2b')],'UserId':_0x36b1d9['id'],'queue_name':_0x4884c6[_0xab7c('0x2b')],'VoiceQueueId':_0x4884c6['id'],'interface':_['isNil'](_0x36b1d9[_0xab7c('0x91')])?util[_0xab7c('0x94')](_0xab7c('0x95'),_0x36b1d9['name']):_0x36b1d9[_0xab7c('0x91')],'paused':_0x36b1d9[_0xab7c('0x96')]||![],'penalty':_0x4884c6[_0xab7c('0x8c')][_0xab7c('0x8d')]},{'transaction':_0x269983});});return Promise['all'](_0x26d5dd);});});});return Promise[_0xab7c('0x97')](_0x3f0ba7);});return Promise[_0xab7c('0x97')](_0x415181);})[_0xab7c('0x27')](function(){return db[_0xab7c('0x6f')][_0xab7c('0x80')]({'where':{'teamId':_0x393f9e}})[_0xab7c('0x27')](function(_0x7686f0){if(_0x7686f0){var _0x134d99=_[_0xab7c('0x2e')](_0x52bf26,function(_0x1048f9){db[_0xab7c('0x70')][_0xab7c('0x93')]({'UserId':_0x1048f9,'VoicePrefixId':_0x7686f0['VoicePrefixId']});});return Promise[_0xab7c('0x97')](_0x134d99);}});});});return Promise[_0xab7c('0x97')](_0x17a630)['then'](function(){return _0x455a07[_0xab7c('0x82')](_0x52bf26,{'transaction':_0x269983})[_0xab7c('0x98')](function(_0x2eea42){return _0x2eea42;});});});}})[_0xab7c('0x27')](respondWithResult(_0xaceca7,null))['catch'](handleError(_0xaceca7,null));};exports[_0xab7c('0x99')]=function(_0x55747b,_0x4030f1){var _0xb6d6a=_['isArray'](_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')])?_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')]:[_0x55747b[_0xab7c('0x33')][_0xab7c('0x7e')]];var _0x57582b=_0x55747b[_0xab7c('0x44')]['id'];return db[_0xab7c('0x2f')]['find']({'where':{'id':_0x57582b}})[_0xab7c('0x27')](handleEntityNotFound(_0x4030f1,null))[_0xab7c('0x27')](function(_0x1da924){if(_0x1da924){var _0x459f77=['Voice',_0xab7c('0x85'),'Mail','Sms','Fax',_0xab7c('0x87'),_0xab7c('0x88')];return db['sequelize']['transaction'](function(_0x2bc23b){var _0x45fd24=_[_0xab7c('0x2e')](_0x459f77,function(_0x697c1b){var _0x51d08b={'attributes':['id',_0xab7c('0x2b')]};return _0x1da924[_0xab7c('0x4f')+_0x697c1b+_0xab7c('0x7a')](_0x51d08b)[_0xab7c('0x27')](function(_0x4ea577){var _0x48e14c=_[_0xab7c('0x2e')](_0x4ea577,function(_0x353db0){return _0x353db0[_0xab7c('0x99')](_0xb6d6a,{'transaction':_0x2bc23b})['then'](function(){var _0x860cc7=_[_0xab7c('0x2e')](_0xb6d6a,function(_0x17c33e){socket[_0xab7c('0x90')](_0xab7c('0x4e')+_0x697c1b+'Queue:remove',{'UserId':Number(_0x17c33e),[_0x697c1b+_0xab7c('0x8b')]:_0x353db0['id']});if(_0x697c1b!==_0xab7c('0x84')){return;}return db[_0xab7c('0x92')][_0xab7c('0x60')]({'where':{'VoiceQueueId':_0x353db0['id'],'UserId':_0x17c33e},'transaction':_0x2bc23b});});return Promise[_0xab7c('0x97')](_0x860cc7);});});return Promise[_0xab7c('0x97')](_0x48e14c);});});return Promise['all'](_0x45fd24)[_0xab7c('0x27')](function(){return _0x1da924[_0xab7c('0x99')](_0xb6d6a,{'transaction':_0x2bc23b});})[_0xab7c('0x27')](function(){return db['TeamVoicePrefix'][_0xab7c('0x80')]({'where':{'teamId':_0x57582b}})[_0xab7c('0x27')](function(_0x3bce51){if(_0x3bce51){var _0xb97f7b=_[_0xab7c('0x2e')](_0xb6d6a,function(_0x347923){db[_0xab7c('0x70')]['destroy']({'where':{'UserId':_0x347923,'VoicePrefixId':_0x3bce51[_0xab7c('0x71')]}});});return Promise['all'](_0xb97f7b);}});});});}})['then'](respondWithStatusCode(_0x4030f1,null))[_0xab7c('0x42')](handleError(_0x4030f1,null));};exports[_0xab7c('0x9a')]=function(_0x1f5acf,_0x40c745,_0x233a08){var _0x150565={};var _0x3a0c4a={};var _0x42382c;var _0x1843ea;return db[_0xab7c('0x2f')][_0xab7c('0x80')]({'where':{'id':_0x1f5acf[_0xab7c('0x44')]['id']}})[_0xab7c('0x27')](handleEntityNotFound(_0x40c745,null))[_0xab7c('0x27')](function(_0x15666c){if(_0x15666c){_0x42382c=_0x15666c;_0x3a0c4a[_0xab7c('0x32')]=_[_0xab7c('0x34')](db[_0xab7c('0x8e')][_0xab7c('0x45')]);_0x3a0c4a[_0xab7c('0x33')]=_[_0xab7c('0x34')](_0x1f5acf['query']);_0x3a0c4a[_0xab7c('0x35')]=_[_0xab7c('0x36')](_0x3a0c4a[_0xab7c('0x32')],_0x3a0c4a['query']);_0x150565[_0xab7c('0x37')]=_[_0xab7c('0x36')](_0x3a0c4a[_0xab7c('0x32')],qs['fields'](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x38')]));_0x150565[_0xab7c('0x37')]=_0x150565[_0xab7c('0x37')][_0xab7c('0x46')]?_0x150565[_0xab7c('0x37')]:_0x3a0c4a[_0xab7c('0x32')];_0x150565[_0xab7c('0x79')]=qs[_0xab7c('0x3a')](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x3a')]);_0x150565[_0xab7c('0x3d')]=qs[_0xab7c('0x35')](_[_0xab7c('0x3b')](_0x1f5acf['query'],_0x3a0c4a[_0xab7c('0x35')]));if(_0x1f5acf['query']['filter']){_0x150565['where']=_[_0xab7c('0x48')](_0x150565['where'],{'$or':_[_0xab7c('0x2e')](_0x150565[_0xab7c('0x37')],function(_0x268c61){var _0x297ebe={};_0x297ebe[_0x268c61]={'$like':'%'+_0x1f5acf[_0xab7c('0x33')]['filter']+'%'};return _0x297ebe;})});}_0x150565=_[_0xab7c('0x48')]({},_0x150565,_0x1f5acf[_0xab7c('0x49')]);return _0x42382c[_0xab7c('0x9a')](_0x150565);}})['then'](function(_0x582b66){if(_0x582b66){_0x1843ea=_0x582b66['length'];if(!_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x9b')](_0xab7c('0x39'))){_0x150565['limit']=qs[_0xab7c('0x1f')](_0x1f5acf['query'][_0xab7c('0x1f')]);_0x150565['offset']=qs['offset'](_0x1f5acf[_0xab7c('0x33')][_0xab7c('0x1e')]);}return _0x42382c[_0xab7c('0x9a')](_0x150565);}})[_0xab7c('0x27')](function(_0x11ecf6){if(_0x11ecf6){return _0x11ecf6?{'count':_0x1843ea,'rows':_0x11ecf6}:null;}})[_0xab7c('0x27')](respondWithResult(_0x40c745,null))[_0xab7c('0x42')](handleError(_0x40c745,null));}; \ No newline at end of file +var _0xb2a0=['destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','add','capitalize','ids','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','user','Queue:save','online','voicePause','interface','UserVoiceQueueRt','format','all','upsert','spread','removeAgents','Fax','Openchannel','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./team.socket','register','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','Team','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x21e44d,_0x1c78ee){var _0x5e7480=function(_0x42d781){while(--_0x42d781){_0x21e44d['push'](_0x21e44d['shift']());}};_0x5e7480(++_0x1c78ee);}(_0xb2a0,0x179));var _0x0b2a=function(_0x1db5b2,_0x3963e3){_0x1db5b2=_0x1db5b2-0x0;var _0x2d8091=_0xb2a0[_0x1db5b2];return _0x2d8091;};'use strict';var emlformat=require(_0x0b2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b2a('0x1'));var jsonpatch=require(_0x0b2a('0x2'));var rp=require(_0x0b2a('0x3'));var moment=require(_0x0b2a('0x4'));var BPromise=require(_0x0b2a('0x5'));var Mustache=require(_0x0b2a('0x6'));var util=require('util');var path=require(_0x0b2a('0x7'));var sox=require('sox');var csv=require(_0x0b2a('0x8'));var ejs=require(_0x0b2a('0x9'));var fs=require('fs');var fs_extra=require(_0x0b2a('0xa'));var _=require(_0x0b2a('0xb'));var squel=require(_0x0b2a('0xc'));var crypto=require(_0x0b2a('0xd'));var jsforce=require(_0x0b2a('0xe'));var deskjs=require(_0x0b2a('0xf'));var toCsv=require(_0x0b2a('0x8'));var querystring=require(_0x0b2a('0x10'));var Papa=require(_0x0b2a('0x11'));var Redis=require(_0x0b2a('0x12'));var authService=require(_0x0b2a('0x13'));var qs=require(_0x0b2a('0x14'));var as=require(_0x0b2a('0x15'));var hardwareService=require(_0x0b2a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0b2a('0x17'));var config=require(_0x0b2a('0x18'));var licenseUtil=require(_0x0b2a('0x19'));var db=require(_0x0b2a('0x1a'))['db'];config['redis']=_[_0x0b2a('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b2a('0x1c')]));require(_0x0b2a('0x1d'))[_0x0b2a('0x1e')](socket);function respondWithStatusCode(_0x40dd23,_0x143896){_0x143896=_0x143896||0xcc;return function(_0x2ae38a){if(_0x2ae38a){return _0x40dd23[_0x0b2a('0x1f')](_0x143896);}return _0x40dd23[_0x0b2a('0x20')](_0x143896)[_0x0b2a('0x21')]();};}function respondWithResult(_0x5b67dd,_0x5efcf9){_0x5efcf9=_0x5efcf9||0xc8;return function(_0x13e8b7){if(_0x13e8b7){return _0x5b67dd[_0x0b2a('0x20')](_0x5efcf9)['json'](_0x13e8b7);}};}function respondWithFilteredResult(_0x316337,_0x3cba37){return function(_0x26c161){if(_0x26c161){var _0x5d967f=typeof _0x3cba37[_0x0b2a('0x22')]==='undefined'&&typeof _0x3cba37['limit']==='undefined';var _0x4324de=_0x26c161[_0x0b2a('0x23')];var _0x10a56=_0x5d967f?0x0:_0x3cba37[_0x0b2a('0x22')];var _0x2c2cab=_0x5d967f?_0x26c161['count']:_0x3cba37['offset']+_0x3cba37[_0x0b2a('0x24')];var _0x37b294;if(_0x2c2cab>=_0x4324de){_0x2c2cab=_0x4324de;_0x37b294=0xc8;}else{_0x37b294=0xce;}_0x316337[_0x0b2a('0x20')](_0x37b294);return _0x316337[_0x0b2a('0x25')](_0x0b2a('0x26'),_0x10a56+'-'+_0x2c2cab+'/'+_0x4324de)[_0x0b2a('0x27')](_0x26c161);}return null;};}function patchUpdates(_0x2a321d){return function(_0x4a4240){try{jsonpatch[_0x0b2a('0x28')](_0x4a4240,_0x2a321d,!![]);}catch(_0x2748a8){return BPromise[_0x0b2a('0x29')](_0x2748a8);}return _0x4a4240[_0x0b2a('0x2a')]();};}function saveUpdates(_0x1f23af,_0x3a47dd){return function(_0x42a65c){if(_0x42a65c){return _0x42a65c[_0x0b2a('0x2b')](_0x1f23af)[_0x0b2a('0x2c')](function(_0xd883ad){return _0xd883ad;});}return null;};}function handleEntityNotFound(_0xb7cf6,_0x553381){return function(_0x1862f5){if(!_0x1862f5){_0xb7cf6[_0x0b2a('0x1f')](0x194);}return _0x1862f5;};}function handleError(_0x1195be,_0x22e0a5){_0x22e0a5=_0x22e0a5||0x1f4;return function(_0x5e47fd){logger['error'](_0x5e47fd[_0x0b2a('0x2d')]);if(_0x5e47fd[_0x0b2a('0x2e')]){delete _0x5e47fd['name'];}_0x1195be['status'](_0x22e0a5)[_0x0b2a('0x2f')](_0x5e47fd);};}exports['index']=function(_0x3f71f9,_0x6672e7){var _0xc702ec={},_0x484a5b={},_0x3790a7={'count':0x0,'rows':[]};var _0x48b600=_[_0x0b2a('0x30')](db[_0x0b2a('0x31')][_0x0b2a('0x32')],function(_0x557dcd){return{'name':_0x557dcd['fieldName'],'type':_0x557dcd['type'][_0x0b2a('0x33')]};});_0x484a5b[_0x0b2a('0x34')]=_[_0x0b2a('0x30')](_0x48b600,_0x0b2a('0x2e'));_0x484a5b[_0x0b2a('0x35')]=_[_0x0b2a('0x36')](_0x3f71f9[_0x0b2a('0x35')]);_0x484a5b[_0x0b2a('0x37')]=_[_0x0b2a('0x38')](_0x484a5b['model'],_0x484a5b[_0x0b2a('0x35')]);_0xc702ec['attributes']=_['intersection'](_0x484a5b[_0x0b2a('0x34')],qs[_0x0b2a('0x39')](_0x3f71f9[_0x0b2a('0x35')][_0x0b2a('0x39')]));_0xc702ec['attributes']=_0xc702ec[_0x0b2a('0x3a')][_0x0b2a('0x3b')]?_0xc702ec[_0x0b2a('0x3a')]:_0x484a5b[_0x0b2a('0x34')];if(!_0x3f71f9[_0x0b2a('0x35')][_0x0b2a('0x3c')](_0x0b2a('0x3d'))){_0xc702ec[_0x0b2a('0x24')]=qs[_0x0b2a('0x24')](_0x3f71f9['query']['limit']);_0xc702ec[_0x0b2a('0x22')]=qs[_0x0b2a('0x22')](_0x3f71f9[_0x0b2a('0x35')]['offset']);}_0xc702ec[_0x0b2a('0x3e')]=qs[_0x0b2a('0x3f')](_0x3f71f9[_0x0b2a('0x35')][_0x0b2a('0x3f')]);_0xc702ec[_0x0b2a('0x40')]=qs[_0x0b2a('0x37')](_[_0x0b2a('0x41')](_0x3f71f9[_0x0b2a('0x35')],_0x484a5b['filters']),_0x48b600);if(_0x3f71f9['query'][_0x0b2a('0x42')]){_0xc702ec[_0x0b2a('0x40')]=_['merge'](_0xc702ec['where'],{'$or':_['map'](_0x48b600,function(_0x2c8d2e){if(_0x2c8d2e[_0x0b2a('0x43')]!==_0x0b2a('0x44')){var _0x5b3140={};_0x5b3140[_0x2c8d2e[_0x0b2a('0x2e')]]={'$like':'%'+_0x3f71f9[_0x0b2a('0x35')][_0x0b2a('0x42')]+'%'};return _0x5b3140;}})});}_0xc702ec=_[_0x0b2a('0x45')]({},_0xc702ec,_0x3f71f9[_0x0b2a('0x46')]);var _0x2574ac={'where':_0xc702ec['where']};return db[_0x0b2a('0x31')][_0x0b2a('0x23')](_0x2574ac)[_0x0b2a('0x2c')](function(_0x5c5809){_0x3790a7[_0x0b2a('0x23')]=_0x5c5809;if(_0x3f71f9[_0x0b2a('0x35')][_0x0b2a('0x47')]){_0xc702ec[_0x0b2a('0x48')]=[{'all':!![]}];}return db[_0x0b2a('0x31')][_0x0b2a('0x49')](_0xc702ec);})[_0x0b2a('0x2c')](function(_0x32fe5e){_0x3790a7['rows']=_0x32fe5e;return _0x3790a7;})[_0x0b2a('0x2c')](respondWithFilteredResult(_0x6672e7,_0xc702ec))[_0x0b2a('0x4a')](handleError(_0x6672e7,null));};exports[_0x0b2a('0x4b')]=function(_0x351eb4,_0xd0b28){var _0x2e9716={'raw':![],'where':{'id':_0x351eb4[_0x0b2a('0x4c')]['id']}},_0x543db8={};_0x543db8[_0x0b2a('0x34')]=_[_0x0b2a('0x36')](db[_0x0b2a('0x31')][_0x0b2a('0x32')]);_0x543db8[_0x0b2a('0x35')]=_[_0x0b2a('0x36')](_0x351eb4['query']);_0x543db8[_0x0b2a('0x37')]=_[_0x0b2a('0x38')](_0x543db8[_0x0b2a('0x34')],_0x543db8[_0x0b2a('0x35')]);_0x2e9716[_0x0b2a('0x3a')]=_[_0x0b2a('0x38')](_0x543db8['model'],qs[_0x0b2a('0x39')](_0x351eb4['query'][_0x0b2a('0x39')]));_0x2e9716['attributes']=_0x2e9716[_0x0b2a('0x3a')][_0x0b2a('0x3b')]?_0x2e9716[_0x0b2a('0x3a')]:_0x543db8[_0x0b2a('0x34')];if(_0x351eb4['query'][_0x0b2a('0x47')]){_0x2e9716['include']=[{'all':!![]}];}_0x2e9716=_[_0x0b2a('0x45')]({},_0x2e9716,_0x351eb4[_0x0b2a('0x46')]);return db[_0x0b2a('0x31')]['find'](_0x2e9716)[_0x0b2a('0x2c')](handleEntityNotFound(_0xd0b28,null))['then'](respondWithResult(_0xd0b28,null))[_0x0b2a('0x4a')](handleError(_0xd0b28,null));};exports[_0x0b2a('0x4d')]=function(_0x4d04ed,_0x777412){return db[_0x0b2a('0x31')][_0x0b2a('0x4d')](_0x4d04ed['body'],{})['then'](function(_0x4744d3){var _0x4abf63=_0x4d04ed['user'][_0x0b2a('0x4e')]({'plain':!![]});if(!_0x4abf63)throw new Error(_0x0b2a('0x4f'));if(_0x4abf63[_0x0b2a('0x50')]==='user'){var _0x2f1065=_0x4744d3[_0x0b2a('0x4e')]({'plain':!![]});var _0x46f8c8=_0x0b2a('0x51');return db['UserProfileSection'][_0x0b2a('0x52')]({'where':{'name':_0x46f8c8,'userProfileId':_0x4abf63[_0x0b2a('0x53')]},'raw':!![]})[_0x0b2a('0x2c')](function(_0x11753c){if(_0x11753c&&_0x11753c['autoAssociation']===0x0){return db[_0x0b2a('0x54')][_0x0b2a('0x4d')]({'name':_0x2f1065[_0x0b2a('0x2e')],'resourceId':_0x2f1065['id'],'type':_0x11753c['name'],'sectionId':_0x11753c['id']},{})[_0x0b2a('0x2c')](function(){return _0x4744d3;});}else{return _0x4744d3;}})[_0x0b2a('0x4a')](function(_0x5d0719){logger[_0x0b2a('0x55')](_0x0b2a('0x56'),_0x5d0719);throw _0x5d0719;});}return _0x4744d3;})[_0x0b2a('0x2c')](respondWithResult(_0x777412,0xc9))[_0x0b2a('0x4a')](handleError(_0x777412,null));};exports[_0x0b2a('0x2b')]=function(_0x2ad82a,_0x528b81){if(_0x2ad82a[_0x0b2a('0x57')]['id']){delete _0x2ad82a[_0x0b2a('0x57')]['id'];}return db[_0x0b2a('0x31')][_0x0b2a('0x52')]({'where':{'id':_0x2ad82a[_0x0b2a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x528b81,null))[_0x0b2a('0x2c')](saveUpdates(_0x2ad82a['body'],null))['then'](respondWithResult(_0x528b81,null))[_0x0b2a('0x4a')](handleError(_0x528b81,null));};exports[_0x0b2a('0x58')]=function(_0xb8844,_0x48904e){var _0x3a2873=_0xb8844[_0x0b2a('0x4c')]['id'];var _0xaf595a=[];return db['sequelize'][_0x0b2a('0x59')](function(_0x21e852){var _0x1df355=_0x0b2a('0x5a')+_0x3a2873;return db['sequelize']['query'](_0x1df355,{'type':db[_0x0b2a('0x5b')]['QueryTypes'][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852})['then'](function(_0x976c6d){_0xaf595a=_[_0x0b2a('0x30')](_0x976c6d,function(_0x369399){return Number(_0x369399[_0x0b2a('0x5d')]);});})[_0x0b2a('0x2c')](function(){var _0x5c2583=_0x0b2a('0x5e')+_0x3a2873;return db[_0x0b2a('0x5f')][_0x0b2a('0x35')](_0x5c2583,{'type':db[_0x0b2a('0x5b')][_0x0b2a('0x60')]['SELECT'],'raw':!![],'transaction':_0x21e852});})['then'](function(_0x438965){var _0x37db71=_['map'](_0x438965,function(_0x56b169){return Number(_0x56b169[_0x0b2a('0x61')]);});return db['UserVoiceQueue'][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'VoiceQueueId':{'$in':_0x37db71}},'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(){var _0x2e6f8b=_0x0b2a('0x62')+_0x3a2873;return db['sequelize'][_0x0b2a('0x35')](_0x2e6f8b,{'type':db[_0x0b2a('0x5b')][_0x0b2a('0x60')][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x2870ba){var _0x34e135=_[_0x0b2a('0x30')](_0x2870ba,function(_0x1dc703){return Number(_0x1dc703['MailQueueId']);});return db['UserMailQueue'][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'MailQueueId':{'$in':_0x34e135}},'transaction':_0x21e852});})['then'](function(){var _0x1ed03b=_0x0b2a('0x63')+_0x3a2873;return db[_0x0b2a('0x5f')][_0x0b2a('0x35')](_0x1ed03b,{'type':db[_0x0b2a('0x5b')]['QueryTypes'][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x4d7318){var _0x1a945b=_[_0x0b2a('0x30')](_0x4d7318,function(_0x104c4b){return Number(_0x104c4b[_0x0b2a('0x64')]);});return db[_0x0b2a('0x65')]['destroy']({'where':{'UserId':{'$in':_0xaf595a},'SmsQueueId':{'$in':_0x1a945b}},'transaction':_0x21e852});})['then'](function(){var _0x3083d1=_0x0b2a('0x66')+_0x3a2873;return db[_0x0b2a('0x5f')]['query'](_0x3083d1,{'type':db['Sequelize'][_0x0b2a('0x60')][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x479373){var _0xdb8831=_[_0x0b2a('0x30')](_0x479373,function(_0x229b6e){return Number(_0x229b6e[_0x0b2a('0x67')]);});return db[_0x0b2a('0x68')][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'ChatQueueId':{'$in':_0xdb8831}},'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(){var _0x502355=_0x0b2a('0x69')+_0x3a2873;return db['sequelize'][_0x0b2a('0x35')](_0x502355,{'type':db[_0x0b2a('0x5b')]['QueryTypes'][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x58e6d7){var _0x43dedb=_[_0x0b2a('0x30')](_0x58e6d7,function(_0x358466){return Number(_0x358466['FaxQueueId']);});return db[_0x0b2a('0x6a')][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'FaxQueueId':{'$in':_0x43dedb}},'transaction':_0x21e852});})['then'](function(){var _0x41475c=_0x0b2a('0x6b')+_0x3a2873;return db['sequelize'][_0x0b2a('0x35')](_0x41475c,{'type':db[_0x0b2a('0x5b')][_0x0b2a('0x60')][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x40fcb8){var _0x44a053=_[_0x0b2a('0x30')](_0x40fcb8,function(_0x41913b){return Number(_0x41913b[_0x0b2a('0x6c')]);});return db['UserOpenchannelQueue'][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'OpenchannelQueueId':{'$in':_0x44a053}},'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(){var _0x36e8ee='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3a2873;return db['sequelize'][_0x0b2a('0x35')](_0x36e8ee,{'type':db[_0x0b2a('0x5b')][_0x0b2a('0x60')][_0x0b2a('0x5c')],'raw':!![],'transaction':_0x21e852});})['then'](function(_0x1c0dc4){var _0x91c648=_[_0x0b2a('0x30')](_0x1c0dc4,function(_0x887114){return Number(_0x887114[_0x0b2a('0x6d')]);});return db[_0x0b2a('0x6e')][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'WhatsappQueueId':{'$in':_0x91c648}},'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(){return db[_0x0b2a('0x6f')][_0x0b2a('0x52')]({'where':{'TeamId':_0x3a2873}});})[_0x0b2a('0x2c')](function(_0x1fd94a){if(_0x1fd94a===null){return;}return db[_0x0b2a('0x70')][_0x0b2a('0x58')]({'where':{'UserId':{'$in':_0xaf595a},'VoicePrefixId':_0x1fd94a[_0x0b2a('0x71')]},'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(){return db[_0x0b2a('0x31')][_0x0b2a('0x58')]({'where':{'id':_0x3a2873},'cascade':!![],'transaction':_0x21e852});})[_0x0b2a('0x2c')](function(_0x57894d){if(_0x57894d===0x0){_0x48904e[_0x0b2a('0x1f')](0x194);}else{return db[_0x0b2a('0x54')][_0x0b2a('0x58')]({'where':{'type':'Teams','resourceId':_0x3a2873},'cascade':!![],'transaction':_0x21e852})[_0x0b2a('0x2c')](function(){_0x48904e[_0x0b2a('0x20')](0xcc)[_0x0b2a('0x21')]();});}})['catch'](function(_0xf1b51c){_0x48904e[_0x0b2a('0x20')](0x1f4)[_0x0b2a('0x2f')](_0xf1b51c);});});};exports['getQueues']=function(_0x4f0829,_0x4fc6f0,_0x18b46a){return db['Team'][_0x0b2a('0x72')]({'where':{'id':_0x4f0829[_0x0b2a('0x4c')]['id']}})[_0x0b2a('0x2c')](handleEntityNotFound(_0x4fc6f0,null))[_0x0b2a('0x2c')](function(_0x21c6ee){if(!_0x4f0829[_0x0b2a('0x35')]['channel']||!utils[_0x0b2a('0x73')](_0x4f0829[_0x0b2a('0x35')][_0x0b2a('0x74')])){throw new db[(_0x0b2a('0x5b'))][(_0x0b2a('0x75'))](_0x0b2a('0x76'));}var _0x397e5c={};var _0x444f25={};_0x444f25[_0x0b2a('0x34')]=_[_0x0b2a('0x36')](db[_['capitalize'](_0x4f0829[_0x0b2a('0x35')][_0x0b2a('0x74')][_0x0b2a('0x77')]())+_0x0b2a('0x78')]['rawAttributes']);_0x444f25[_0x0b2a('0x35')]=_[_0x0b2a('0x36')](_0x4f0829['query']);_0x444f25['filters']=_[_0x0b2a('0x38')](_0x444f25[_0x0b2a('0x34')],_0x444f25['query']);_0x397e5c[_0x0b2a('0x3a')]=_[_0x0b2a('0x38')](_0x444f25[_0x0b2a('0x34')],qs[_0x0b2a('0x39')](_0x4f0829[_0x0b2a('0x35')]['fields']));_0x397e5c[_0x0b2a('0x3a')]=_0x397e5c[_0x0b2a('0x3a')][_0x0b2a('0x3b')]?_0x397e5c[_0x0b2a('0x3a')]:_0x444f25[_0x0b2a('0x34')];_0x397e5c[_0x0b2a('0x24')]=qs['limit'](_0x4f0829[_0x0b2a('0x35')]['limit']);_0x397e5c[_0x0b2a('0x22')]=qs['offset'](_0x4f0829[_0x0b2a('0x35')]['offset']);_0x397e5c['order']=qs[_0x0b2a('0x3f')](_0x4f0829[_0x0b2a('0x35')][_0x0b2a('0x3f')]);_0x397e5c['where']=qs[_0x0b2a('0x37')](_[_0x0b2a('0x41')](_0x4f0829[_0x0b2a('0x35')],_0x444f25[_0x0b2a('0x37')]));_0x397e5c=_[_0x0b2a('0x45')]({},_0x397e5c,_0x4f0829[_0x0b2a('0x46')]);return _0x21c6ee['get'+_['capitalize'](_0x4f0829['query'][_0x0b2a('0x74')][_0x0b2a('0x77')]())+_0x0b2a('0x79')](_0x397e5c);})[_0x0b2a('0x2c')](respondWithResult(_0x4fc6f0,null))[_0x0b2a('0x4a')](handleError(_0x4fc6f0,null));};exports[_0x0b2a('0x7a')]=function(_0xcd2aa0,_0x53bc17,_0x260f18){return db['Team']['findOne']({'where':{'id':_0xcd2aa0['params']['id']}})[_0x0b2a('0x2c')](function(_0x17f26b){if(_0x17f26b){if(!_0xcd2aa0['body'][_0x0b2a('0x74')]||!utils[_0x0b2a('0x73')](_0xcd2aa0['body'][_0x0b2a('0x74')])){throw new db[(_0x0b2a('0x5b'))][(_0x0b2a('0x75'))]('Unknown\x20channel');}return _0x17f26b[_0x0b2a('0x7b')+_[_0x0b2a('0x7c')](_0xcd2aa0['body']['channel'][_0x0b2a('0x77')]())+_0x0b2a('0x79')](_0xcd2aa0[_0x0b2a('0x57')][_0x0b2a('0x7d')]);}return null;})[_0x0b2a('0x2c')](handleEntityNotFound(_0x53bc17,null))[_0x0b2a('0x2c')](respondWithStatusCode(_0x53bc17,null))[_0x0b2a('0x4a')](handleError(_0x53bc17,null));};exports['removeQueues']=function(_0x38cff9,_0x1011bc,_0x37b634){return db[_0x0b2a('0x31')][_0x0b2a('0x72')]({'where':{'id':_0x38cff9[_0x0b2a('0x4c')]['id']}})[_0x0b2a('0x2c')](function(_0x1f8d02){if(_0x1f8d02){if(!_0x38cff9[_0x0b2a('0x35')][_0x0b2a('0x74')]||!utils[_0x0b2a('0x73')](_0x38cff9[_0x0b2a('0x35')][_0x0b2a('0x74')])){throw new db['Sequelize'][(_0x0b2a('0x75'))](_0x0b2a('0x76'));}return _0x1f8d02[_0x0b2a('0x7e')+_[_0x0b2a('0x7c')](_0x38cff9[_0x0b2a('0x35')][_0x0b2a('0x74')][_0x0b2a('0x77')]())+_0x0b2a('0x79')](_0x38cff9[_0x0b2a('0x35')]['ids']);}return null;})[_0x0b2a('0x2c')](handleEntityNotFound(_0x1011bc,null))[_0x0b2a('0x2c')](respondWithStatusCode(_0x1011bc,null))[_0x0b2a('0x4a')](handleError(_0x1011bc,null));};exports[_0x0b2a('0x7f')]=function(_0x3c2e1c,_0x543bae){var _0x4f0b70=_[_0x0b2a('0x80')](_0x3c2e1c[_0x0b2a('0x57')][_0x0b2a('0x7d')])?_0x3c2e1c[_0x0b2a('0x57')][_0x0b2a('0x7d')]:[_0x3c2e1c[_0x0b2a('0x57')]['ids']];var _0x379378=_0x3c2e1c[_0x0b2a('0x4c')]['id'];return db['Team'][_0x0b2a('0x52')]({'where':{'id':_0x379378}})['then'](handleEntityNotFound(_0x543bae,null))[_0x0b2a('0x2c')](function(_0xfcc5ad){if(_0xfcc5ad){var _0x1b2b23=[_0x0b2a('0x81'),_0x0b2a('0x82'),_0x0b2a('0x83'),_0x0b2a('0x84'),'Fax','Openchannel',_0x0b2a('0x85')];return db[_0x0b2a('0x5f')][_0x0b2a('0x59')](function(_0x5a56bb){var _0x1c8b2e=_[_0x0b2a('0x30')](_0x1b2b23,function(_0x51d083){var _0x23f633={'attributes':['id','name']};if(_0x51d083==='Voice'){_0x23f633['through']={'attributes':[_0x0b2a('0x86')]};}return _0xfcc5ad['get'+_0x51d083+'Queues'](_0x23f633)[_0x0b2a('0x2c')](function(_0x4e4b34){var _0x14d92a=_[_0x0b2a('0x30')](_0x4e4b34,function(_0x1c1330){var _0x327ef1=_['map'](_0x4f0b70,function(_0x4ded90){var _0x445e80={'where':{'UserId':_0x4ded90,[_0x51d083+_0x0b2a('0x87')]:_0x1c1330['id']},'transaction':_0x5a56bb};if(_0x51d083===_0x0b2a('0x81')){_0x445e80[_0x0b2a('0x1b')]={'penalty':_0x1c1330[_0x0b2a('0x88')][_0x0b2a('0x86')]};}return db[_0x0b2a('0x89')+_0x51d083+'Queue'][_0x0b2a('0x8a')](_0x445e80)[_0x0b2a('0x2c')](function(){socket[_0x0b2a('0x8b')](_0x0b2a('0x8c')+_0x51d083+_0x0b2a('0x8d'),{'UserId':_0x4ded90,[_0x51d083+'QueueId']:_0x1c1330['id']});if(_0x51d083!==_0x0b2a('0x81')){return;}return db['User'][_0x0b2a('0x49')]({'where':{'id':_0x4f0b70,'online':0x1},'attributes':['id',_0x0b2a('0x2e'),_0x0b2a('0x8e'),_0x0b2a('0x8f'),_0x0b2a('0x90')],'raw':!![]})['then'](function(_0x3d1d22){var _0xd97665=_[_0x0b2a('0x30')](_0x3d1d22,function(_0x5cee0e){return db[_0x0b2a('0x91')]['upsert']({'membername':_0x5cee0e[_0x0b2a('0x2e')],'UserId':_0x5cee0e['id'],'queue_name':_0x1c1330[_0x0b2a('0x2e')],'VoiceQueueId':_0x1c1330['id'],'interface':_['isNil'](_0x5cee0e[_0x0b2a('0x90')])?util[_0x0b2a('0x92')]('SIP/%s',_0x5cee0e['name']):_0x5cee0e[_0x0b2a('0x90')],'paused':_0x5cee0e[_0x0b2a('0x8f')]||![],'penalty':_0x1c1330[_0x0b2a('0x88')]['penalty']},{'transaction':_0x5a56bb});});return Promise['all'](_0xd97665);});});});return Promise[_0x0b2a('0x93')](_0x327ef1);});return Promise[_0x0b2a('0x93')](_0x14d92a);})[_0x0b2a('0x2c')](function(){return db[_0x0b2a('0x6f')][_0x0b2a('0x72')]({'where':{'teamId':_0x379378}})[_0x0b2a('0x2c')](function(_0x3e4587){if(_0x3e4587){var _0x35a925=_['map'](_0x4f0b70,function(_0xd74e95){db[_0x0b2a('0x70')][_0x0b2a('0x94')]({'UserId':_0xd74e95,'VoicePrefixId':_0x3e4587[_0x0b2a('0x71')]});});return Promise[_0x0b2a('0x93')](_0x35a925);}});});});return Promise[_0x0b2a('0x93')](_0x1c8b2e)['then'](function(){return _0xfcc5ad[_0x0b2a('0x7f')](_0x4f0b70,{'transaction':_0x5a56bb})[_0x0b2a('0x95')](function(_0x4b97fd){return _0x4b97fd;});});});}})[_0x0b2a('0x2c')](respondWithResult(_0x543bae,null))[_0x0b2a('0x4a')](handleError(_0x543bae,null));};exports[_0x0b2a('0x96')]=function(_0x559547,_0x651791){var _0x5f3094=_[_0x0b2a('0x80')](_0x559547['query'][_0x0b2a('0x7d')])?_0x559547[_0x0b2a('0x35')][_0x0b2a('0x7d')]:[_0x559547[_0x0b2a('0x35')][_0x0b2a('0x7d')]];var _0x51e445=_0x559547[_0x0b2a('0x4c')]['id'];return db[_0x0b2a('0x31')]['find']({'where':{'id':_0x51e445}})[_0x0b2a('0x2c')](handleEntityNotFound(_0x651791,null))['then'](function(_0x2f0c45){if(_0x2f0c45){var _0x1efaf0=[_0x0b2a('0x81'),_0x0b2a('0x82'),'Mail',_0x0b2a('0x84'),_0x0b2a('0x97'),_0x0b2a('0x98'),_0x0b2a('0x85')];return db[_0x0b2a('0x5f')][_0x0b2a('0x59')](function(_0x5cec2d){var _0x3c3fc3=_[_0x0b2a('0x30')](_0x1efaf0,function(_0x50a34a){var _0x22fb73={'attributes':['id',_0x0b2a('0x2e')]};return _0x2f0c45[_0x0b2a('0x4e')+_0x50a34a+_0x0b2a('0x79')](_0x22fb73)['then'](function(_0x327e9a){var _0x1cb73f=_[_0x0b2a('0x30')](_0x327e9a,function(_0x55bbcd){return _0x55bbcd[_0x0b2a('0x96')](_0x5f3094,{'transaction':_0x5cec2d})['then'](function(){var _0x3256ea=_[_0x0b2a('0x30')](_0x5f3094,function(_0x5537f7){socket[_0x0b2a('0x8b')]('user'+_0x50a34a+_0x0b2a('0x99'),{'UserId':Number(_0x5537f7),[_0x50a34a+_0x0b2a('0x87')]:_0x55bbcd['id']});if(_0x50a34a!==_0x0b2a('0x81')){return;}return db['UserVoiceQueueRt'][_0x0b2a('0x58')]({'where':{'VoiceQueueId':_0x55bbcd['id'],'UserId':_0x5537f7},'transaction':_0x5cec2d});});return Promise['all'](_0x3256ea);});});return Promise['all'](_0x1cb73f);});});return Promise[_0x0b2a('0x93')](_0x3c3fc3)['then'](function(){return _0x2f0c45[_0x0b2a('0x96')](_0x5f3094,{'transaction':_0x5cec2d});})['then'](function(){return db[_0x0b2a('0x6f')][_0x0b2a('0x72')]({'where':{'teamId':_0x51e445}})[_0x0b2a('0x2c')](function(_0xda18e0){if(_0xda18e0){var _0x1e858e=_['map'](_0x5f3094,function(_0x332a1d){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x332a1d,'VoicePrefixId':_0xda18e0[_0x0b2a('0x71')]}});});return Promise[_0x0b2a('0x93')](_0x1e858e);}});});});}})[_0x0b2a('0x2c')](respondWithStatusCode(_0x651791,null))[_0x0b2a('0x4a')](handleError(_0x651791,null));};exports[_0x0b2a('0x9a')]=function(_0x1ba71c,_0x4dd40e,_0x2b1054){var _0x2a33e4={};var _0x192ed7={};var _0x5d7dc7;var _0x2781d2;return db[_0x0b2a('0x31')]['findOne']({'where':{'id':_0x1ba71c[_0x0b2a('0x4c')]['id']}})[_0x0b2a('0x2c')](handleEntityNotFound(_0x4dd40e,null))[_0x0b2a('0x2c')](function(_0x1e3f26){if(_0x1e3f26){_0x5d7dc7=_0x1e3f26;_0x192ed7[_0x0b2a('0x34')]=_[_0x0b2a('0x36')](db[_0x0b2a('0x89')]['rawAttributes']);_0x192ed7[_0x0b2a('0x35')]=_[_0x0b2a('0x36')](_0x1ba71c['query']);_0x192ed7['filters']=_[_0x0b2a('0x38')](_0x192ed7[_0x0b2a('0x34')],_0x192ed7['query']);_0x2a33e4[_0x0b2a('0x3a')]=_['intersection'](_0x192ed7[_0x0b2a('0x34')],qs['fields'](_0x1ba71c['query'][_0x0b2a('0x39')]));_0x2a33e4[_0x0b2a('0x3a')]=_0x2a33e4[_0x0b2a('0x3a')]['length']?_0x2a33e4[_0x0b2a('0x3a')]:_0x192ed7[_0x0b2a('0x34')];_0x2a33e4['order']=qs[_0x0b2a('0x3f')](_0x1ba71c['query']['sort']);_0x2a33e4[_0x0b2a('0x40')]=qs[_0x0b2a('0x37')](_[_0x0b2a('0x41')](_0x1ba71c['query'],_0x192ed7['filters']));if(_0x1ba71c['query'][_0x0b2a('0x42')]){_0x2a33e4['where']=_['merge'](_0x2a33e4[_0x0b2a('0x40')],{'$or':_['map'](_0x2a33e4[_0x0b2a('0x3a')],function(_0x15ecf2){var _0xb3a5f1={};_0xb3a5f1[_0x15ecf2]={'$like':'%'+_0x1ba71c[_0x0b2a('0x35')][_0x0b2a('0x42')]+'%'};return _0xb3a5f1;})});}_0x2a33e4=_['merge']({},_0x2a33e4,_0x1ba71c[_0x0b2a('0x46')]);return _0x5d7dc7[_0x0b2a('0x9a')](_0x2a33e4);}})[_0x0b2a('0x2c')](function(_0x3641ab){if(_0x3641ab){_0x2781d2=_0x3641ab['length'];if(!_0x1ba71c['query']['hasOwnProperty']('nolimit')){_0x2a33e4[_0x0b2a('0x24')]=qs[_0x0b2a('0x24')](_0x1ba71c[_0x0b2a('0x35')][_0x0b2a('0x24')]);_0x2a33e4[_0x0b2a('0x22')]=qs[_0x0b2a('0x22')](_0x1ba71c[_0x0b2a('0x35')][_0x0b2a('0x22')]);}return _0x5d7dc7['getAgents'](_0x2a33e4);}})[_0x0b2a('0x2c')](function(_0x574d21){if(_0x574d21){return _0x574d21?{'count':_0x2781d2,'rows':_0x574d21}:null;}})[_0x0b2a('0x2c')](respondWithResult(_0x4dd40e,null))[_0x0b2a('0x4a')](handleError(_0x4dd40e,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 61dd20b..1ad3804 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 _0x638d=['emit','hook','events','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x371ce1,_0xca105a){var _0x8cedbc=function(_0x383edf){while(--_0x383edf){_0x371ce1['push'](_0x371ce1['shift']());}};_0x8cedbc(++_0xca105a);}(_0x638d,0x1e2));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd638('0x0'));var Team=require(_0xd638('0x1'))['db'][_0xd638('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd638('0x3')](0x0);var events={'afterCreate':_0xd638('0x4'),'afterUpdate':'update','afterDestroy':_0xd638('0x5')};function emitEvent(_0x3f966d){return function(_0x120d12,_0x3e718e,_0x2957d7){TeamEvents[_0xd638('0x6')](_0x3f966d+':'+_0x120d12['id'],_0x120d12);TeamEvents[_0xd638('0x6')](_0x3f966d,_0x120d12);_0x2957d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd638('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc0a7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xc0a7,0x166));var _0x7c0a=function(_0x208f5e,_0xbbb5f9){_0x208f5e=_0x208f5e-0x0;var _0x556997=_0xc0a7[_0x208f5e];return _0x556997;};'use strict';var EventEmitter=require(_0x7c0a('0x0'));var Team=require(_0x7c0a('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x7c0a('0x2')](0x0);var events={'afterCreate':_0x7c0a('0x3'),'afterUpdate':_0x7c0a('0x4'),'afterDestroy':_0x7c0a('0x5')};function emitEvent(_0x57fb65){return function(_0x124eb9,_0x4227de,_0x14580c){TeamEvents[_0x7c0a('0x6')](_0x57fb65+':'+_0x124eb9['id'],_0x124eb9);TeamEvents[_0x7c0a('0x6')](_0x57fb65,_0x124eb9);_0x14580c(null);};}for(var e in events){if(events[_0x7c0a('0x7')](e)){var event=events[e];Team[_0x7c0a('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index e5dc6b9..05058f6 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 _0x04bd=['api','moment','path','rimraf','../../config/environment','./team.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x3e18c3,_0x2212de){var _0x39f28f=function(_0x4832df){while(--_0x4832df){_0x3e18c3['push'](_0x3e18c3['shift']());}};_0x39f28f(++_0x2212de);}(_0x04bd,0x19f));var _0xd04b=function(_0x277e5b,_0xbc5c4a){_0x277e5b=_0x277e5b-0x0;var _0x2d8d8e=_0x04bd[_0x277e5b];return _0x2d8d8e;};'use strict';var _=require(_0xd04b('0x0'));var util=require(_0xd04b('0x1'));var logger=require(_0xd04b('0x2'))(_0xd04b('0x3'));var moment=require(_0xd04b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd04b('0x5'));var rimraf=require(_0xd04b('0x6'));var config=require(_0xd04b('0x7'));var attributes=require(_0xd04b('0x8'));module[_0xd04b('0x9')]=function(_0x2c41f7,_0x3bb6e5){return _0x2c41f7[_0xd04b('0xa')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1208=['../../config/environment','./team.attributes','exports','define','Team','teams','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x38550,_0x1e36a6){var _0x556e2c=function(_0x20777a){while(--_0x20777a){_0x38550['push'](_0x38550['shift']());}};_0x556e2c(++_0x1e36a6);}(_0x1208,0xd7));var _0x8120=function(_0xa24cab,_0x4eff6d){_0xa24cab=_0xa24cab-0x0;var _0x53c562=_0x1208[_0xa24cab];return _0x53c562;};'use strict';var _=require(_0x8120('0x0'));var util=require('util');var logger=require(_0x8120('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8120('0x2'));var rp=require(_0x8120('0x3'));var fs=require('fs');var path=require(_0x8120('0x4'));var rimraf=require('rimraf');var config=require(_0x8120('0x5'));var attributes=require(_0x8120('0x6'));module[_0x8120('0x7')]=function(_0x5d74bf,_0x2448a6){return _0x5d74bf[_0x8120('0x8')](_0x8120('0x9'),attributes,{'tableName':_0x8120('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1a01e36..84ddf42 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 _0x445a=['Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x215754,_0x1eb2c9){var _0x385dad=function(_0x179d07){while(--_0x179d07){_0x215754['push'](_0x215754['shift']());}};_0x385dad(++_0x1eb2c9);}(_0x445a,0x1e4));var _0xa445=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x445a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa445('0x0'));var util=require(_0xa445('0x1'));var moment=require(_0xa445('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa445('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa445('0x4'))(_0xa445('0x5'));var config=require(_0xa445('0x6'));var jayson=require(_0xa445('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa445('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa445('0x9'))(new Redis(config[_0xa445('0x8')]));require(_0xa445('0xa'))[_0xa445('0xb')](socket);function respondWithRpcPromise(_0x737589,_0xd405f,_0x472f9d){return new BPromise(function(_0x286bc9,_0x263faa){return client[_0xa445('0xc')](_0x737589,_0x472f9d)[_0xa445('0xd')](function(_0x42be8a){logger[_0xa445('0xe')]('Team,\x20%s,\x20%s',_0xd405f,_0xa445('0xf'));logger['debug'](_0xa445('0x10'),_0xd405f,_0xa445('0xf'),JSON[_0xa445('0x11')](_0x42be8a));if(_0x42be8a[_0xa445('0x12')]){if(_0x42be8a[_0xa445('0x12')][_0xa445('0x13')]===0x1f4){logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);return _0x263faa(_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);}logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x42be8a[_0xa445('0x12')][_0xa445('0x15')]);return _0x286bc9(_0x42be8a['error'][_0xa445('0x15')]);}else{logger['info'](_0xa445('0x14'),_0xd405f,_0xa445('0xf'));_0x286bc9(_0x42be8a[_0xa445('0x16')]['message']);}})[_0xa445('0x17')](function(_0x1a6509){logger[_0xa445('0x12')](_0xa445('0x14'),_0xd405f,_0x1a6509);_0x263faa(_0x1a6509);});});} \ No newline at end of file +var _0xa45e=['then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x871ef5,_0x58880b){var _0x1f62ea=function(_0x13934c){while(--_0x13934c){_0x871ef5['push'](_0x871ef5['shift']());}};_0x1f62ea(++_0x58880b);}(_0xa45e,0xfb));var _0xea45=function(_0x1fbb0d,_0x24b648){_0x1fbb0d=_0x1fbb0d-0x0;var _0x2f690a=_0xa45e[_0x1fbb0d];return _0x2f690a;};'use strict';var _=require('lodash');var util=require(_0xea45('0x0'));var moment=require(_0xea45('0x1'));var BPromise=require(_0xea45('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('../../config/logger')(_0xea45('0x3'));var config=require('../../config/environment');var jayson=require(_0xea45('0x4'));var client=jayson[_0xea45('0x5')][_0xea45('0x6')]({'port':0x232a});config[_0xea45('0x7')]=_['defaults'](config[_0xea45('0x7')],{'host':_0xea45('0x8'),'port':0x18eb});var socket=require(_0xea45('0x9'))(new Redis(config[_0xea45('0x7')]));require(_0xea45('0xa'))[_0xea45('0xb')](socket);function respondWithRpcPromise(_0x5ee9fe,_0x5da44d,_0x35f211){return new BPromise(function(_0x2d7fb0,_0x4c3106){return client[_0xea45('0xc')](_0x5ee9fe,_0x35f211)[_0xea45('0xd')](function(_0x8558f7){logger['info'](_0xea45('0xe'),_0x5da44d,_0xea45('0xf'));logger[_0xea45('0x10')](_0xea45('0x11'),_0x5da44d,_0xea45('0xf'),JSON[_0xea45('0x12')](_0x8558f7));if(_0x8558f7['error']){if(_0x8558f7[_0xea45('0x13')][_0xea45('0x14')]===0x1f4){logger['error'](_0xea45('0xe'),_0x5da44d,_0x8558f7[_0xea45('0x13')][_0xea45('0x15')]);return _0x4c3106(_0x8558f7[_0xea45('0x13')][_0xea45('0x15')]);}logger[_0xea45('0x13')](_0xea45('0xe'),_0x5da44d,_0x8558f7[_0xea45('0x13')][_0xea45('0x15')]);return _0x2d7fb0(_0x8558f7['error'][_0xea45('0x15')]);}else{logger[_0xea45('0x16')](_0xea45('0xe'),_0x5da44d,'request\x20sent');_0x2d7fb0(_0x8558f7['result'][_0xea45('0x15')]);}})[_0xea45('0x17')](function(_0x39234f){logger[_0xea45('0x13')]('Team,\x20%s,\x20%s',_0x5da44d,_0x39234f);_0x4c3106(_0x39234f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4771dd5..04a3648 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 _0x4760=['removeListener','register','length','team:','./team.events','remove','update','emit'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x4760,0x1b4));var _0x0476=function(_0x1af354,_0x16b63d){_0x1af354=_0x1af354-0x0;var _0x6e9b04=_0x4760[_0x1af354];return _0x6e9b04;};'use strict';var TeamEvents=require(_0x0476('0x0'));var events=['save',_0x0476('0x1'),_0x0476('0x2')];function createListener(_0x34020c,_0x43de94){return function(_0x211149){_0x43de94[_0x0476('0x3')](_0x34020c,_0x211149);};}function removeListener(_0x4b6894,_0x2b50c8){return function(){TeamEvents[_0x0476('0x4')](_0x4b6894,_0x2b50c8);};}exports[_0x0476('0x5')]=function(_0x4ac5bb){for(var _0x188140=0x0,_0x30a8bf=events[_0x0476('0x6')];_0x188140<_0x30a8bf;_0x188140++){var _0x231929=events[_0x188140];var _0x367230=createListener(_0x0476('0x7')+_0x231929,_0x4ac5bb);TeamEvents['on'](_0x231929,_0x367230);}}; \ No newline at end of file +var _0x8130=['emit','removeListener','length','team:','./team.events','save','update'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x8130,0x146));var _0x0813=function(_0x5b1b96,_0x4ffa76){_0x5b1b96=_0x5b1b96-0x0;var _0x1fe428=_0x8130[_0x5b1b96];return _0x1fe428;};'use strict';var TeamEvents=require(_0x0813('0x0'));var events=[_0x0813('0x1'),'remove',_0x0813('0x2')];function createListener(_0x3168b8,_0xd86b46){return function(_0x20cc2e){_0xd86b46[_0x0813('0x3')](_0x3168b8,_0x20cc2e);};}function removeListener(_0x25d6c6,_0x4e66f4){return function(){TeamEvents[_0x0813('0x4')](_0x25d6c6,_0x4e66f4);};}exports['register']=function(_0x563ee2){for(var _0x306454=0x0,_0x2df45a=events[_0x0813('0x5')];_0x306454<_0x2df45a;_0x306454++){var _0x19a508=events[_0x306454];var _0x2ab8f0=createListener(_0x0813('0x6')+_0x19a508,_0x563ee2);TeamEvents['on'](_0x19a508,_0x2ab8f0);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index dd69381..e6e19a1 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 _0x4fdc=['exports','INTEGER'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0x4fdc,0x84));var _0xc4fd=function(_0x32fdb4,_0xcbb10e){_0x32fdb4=_0x32fdb4-0x0;var _0x4a9f8d=_0x4fdc[_0x32fdb4];return _0x4a9f8d;};'use strict';var Sequelize=require('sequelize');module[_0xc4fd('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc4fd('0x1')]}}; \ No newline at end of file +var _0xfaf3=['INTEGER','sequelize'];(function(_0x3cfd92,_0x203fa0){var _0x23e8a0=function(_0x5bd30e){while(--_0x5bd30e){_0x3cfd92['push'](_0x3cfd92['shift']());}};_0x23e8a0(++_0x203fa0);}(_0xfaf3,0x93));var _0x3faf=function(_0x1bc68d,_0xdf173c){_0x1bc68d=_0x1bc68d-0x0;var _0xaed061=_0xfaf3[_0x1bc68d];return _0xaed061;};'use strict';var Sequelize=require(_0x3faf('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x3faf('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x3faf('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index f4f90af..01dde18 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 _0x263f=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x263f,0x182));var _0xf263=function(_0x27b0da,_0x8ffb2b){_0x27b0da=_0x27b0da-0x0;var _0x8eb88e=_0x263f[_0x27b0da];return _0x8eb88e;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var logger=require(_0xf263('0x2'))(_0xf263('0x3'));var moment=require(_0xf263('0x4'));var BPromise=require(_0xf263('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf263('0x6'));var rimraf=require(_0xf263('0x7'));var config=require(_0xf263('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xf263('0x9')]=function(_0xdb2fc1,_0x4c7ab2){return _0xdb2fc1['define'](_0xf263('0xa'),attributes,{'tableName':_0xf263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bc5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x7d1540,_0x254971){var _0x2edba1=function(_0x5665ee){while(--_0x5665ee){_0x7d1540['push'](_0x7d1540['shift']());}};_0x2edba1(++_0x254971);}(_0x5bc5,0xb2));var _0x55bc=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x5bc5[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var logger=require(_0x55bc('0x2'))(_0x55bc('0x3'));var moment=require(_0x55bc('0x4'));var BPromise=require(_0x55bc('0x5'));var rp=require(_0x55bc('0x6'));var fs=require('fs');var path=require(_0x55bc('0x7'));var rimraf=require(_0x55bc('0x8'));var config=require(_0x55bc('0x9'));var attributes=require(_0x55bc('0xa'));module[_0x55bc('0xb')]=function(_0x188eb6,_0x5d5f1d){return _0x188eb6[_0x55bc('0xc')](_0x55bc('0xd'),attributes,{'tableName':_0x55bc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 2f7f682..8772124 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x32aa22,_0x107371){var _0x2ecaae=function(_0x3d6a66){while(--_0x3d6a66){_0x32aa22['push'](_0x32aa22['shift']());}};_0x2ecaae(++_0x107371);}(_0xe706,0xa3));var _0x6e70=function(_0x16d2c7,_0x5bf3c0){_0x16d2c7=_0x16d2c7-0x0;var _0x1c9a0a=_0xe706[_0x16d2c7];return _0x1c9a0a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x14674d,_0x88c7ff){var _0x556c64=function(_0x1fa01a){while(--_0x1fa01a){_0x14674d['push'](_0x14674d['shift']());}};_0x556c64(++_0x88c7ff);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d108379..0d2be31 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 _0x799b=['exports','INTEGER','sequelize'];(function(_0x45911a,_0x10f08a){var _0x23b7d7=function(_0x35a62){while(--_0x35a62){_0x45911a['push'](_0x45911a['shift']());}};_0x23b7d7(++_0x10f08a);}(_0x799b,0xcb));var _0xb799=function(_0x4b7c13,_0x2c5239){_0x4b7c13=_0x4b7c13-0x0;var _0x37e4ec=_0x799b[_0x4b7c13];return _0x37e4ec;};'use strict';var Sequelize=require(_0xb799('0x0'));module[_0xb799('0x1')]={'penalty':{'type':Sequelize[_0xb799('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5cfb=['exports','sequelize'];(function(_0x35a779,_0x27f8fb){var _0xca723b=function(_0x298df7){while(--_0x298df7){_0x35a779['push'](_0x35a779['shift']());}};_0xca723b(++_0x27f8fb);}(_0x5cfb,0x9d));var _0xb5cf=function(_0x431bc9,_0x736158){_0x431bc9=_0x431bc9-0x0;var _0x1bf59c=_0x5cfb[_0x431bc9];return _0x1bf59c;};'use strict';var Sequelize=require(_0xb5cf('0x0'));module[_0xb5cf('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 8a7537a..d017d39 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 _0xf041=['path','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x179c7b,_0x4b61bc){var _0xaf10cb=function(_0x1df885){while(--_0x1df885){_0x179c7b['push'](_0x179c7b['shift']());}};_0xaf10cb(++_0x4b61bc);}(_0xf041,0x15b));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7764=['moment','bluebird','request-promise','path','rimraf','../../config/environment','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x7764,0xa4));var _0x4776=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x7764[_0x1f9f5f];return _0x51d649;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var logger=require(_0x4776('0x2'))(_0x4776('0x3'));var moment=require(_0x4776('0x4'));var BPromise=require(_0x4776('0x5'));var rp=require(_0x4776('0x6'));var fs=require('fs');var path=require(_0x4776('0x7'));var rimraf=require(_0x4776('0x8'));var config=require(_0x4776('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0xc431bf,_0x3eff9c){return _0xc431bf['define'](_0x4776('0xa'),attributes,{'tableName':_0x4776('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 0e1b586..b7f1d42 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 _0x0eaa=['http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xea32f,_0x1ca14d){var _0x4618a2=function(_0x158d7e){while(--_0x158d7e){_0xea32f['push'](_0xea32f['shift']());}};_0x4618a2(++_0x1ca14d);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x204668,_0x46227d){_0x204668=_0x204668-0x0;var _0x59fc6f=_0x0eaa[_0x204668];return _0x59fc6f;};'use strict';var _=require(_0xa0ea('0x0'));var util=require(_0xa0ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0ea('0x2'));var fs=require('fs');var Redis=require(_0xa0ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ea('0x4'));var logger=require(_0xa0ea('0x5'))(_0xa0ea('0x6'));var config=require(_0xa0ea('0x7'));var jayson=require(_0xa0ea('0x8'));var client=jayson['client'][_0xa0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521881,_0x4b8856,_0x361178){return new BPromise(function(_0x8632a1,_0x5b2adc){return client['request'](_0x521881,_0x361178)[_0xa0ea('0xa')](function(_0x2746f2){logger[_0xa0ea('0xb')](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));logger['debug'](_0xa0ea('0xe'),_0x4b8856,_0xa0ea('0xd'),JSON[_0xa0ea('0xf')](_0x2746f2));if(_0x2746f2[_0xa0ea('0x10')]){if(_0x2746f2['error'][_0xa0ea('0x11')]===0x1f4){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x5b2adc(_0x2746f2['error'][_0xa0ea('0x12')]);}logger[_0xa0ea('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x8632a1(_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);}else{logger['info'](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));_0x8632a1(_0x2746f2[_0xa0ea('0x13')][_0xa0ea('0x12')]);}})[_0xa0ea('0x14')](function(_0x34b94c){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x34b94c);_0x5b2adc(_0x34b94c);});});} \ No newline at end of file +var _0x4784=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x5ece50,_0x567081){var _0xb37607=function(_0x2f5aa9){while(--_0x2f5aa9){_0x5ece50['push'](_0x5ece50['shift']());}};_0xb37607(++_0x567081);}(_0x4784,0xe4));var _0x4478=function(_0x3e006e,_0xee4cd3){_0x3e006e=_0x3e006e-0x0;var _0x213f60=_0x4784[_0x3e006e];return _0x213f60;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var BPromise=require(_0x4478('0x3'));var rs=require(_0x4478('0x4'));var fs=require('fs');var Redis=require(_0x4478('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4478('0x6'));var logger=require(_0x4478('0x7'))(_0x4478('0x8'));var config=require('../../config/environment');var jayson=require(_0x4478('0x9'));var client=jayson['client'][_0x4478('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4858da,_0x3fe5ea,_0xe013ab){return new BPromise(function(_0x3cd15f,_0x418626){return client[_0x4478('0xb')](_0x4858da,_0xe013ab)['then'](function(_0x856b5d){logger[_0x4478('0xc')](_0x4478('0xd'),_0x3fe5ea,_0x4478('0xe'));logger[_0x4478('0xf')](_0x4478('0x10'),_0x3fe5ea,_0x4478('0xe'),JSON['stringify'](_0x856b5d));if(_0x856b5d[_0x4478('0x11')]){if(_0x856b5d[_0x4478('0x11')][_0x4478('0x12')]===0x1f4){logger[_0x4478('0x11')](_0x4478('0xd'),_0x3fe5ea,_0x856b5d[_0x4478('0x11')]['message']);return _0x418626(_0x856b5d[_0x4478('0x11')][_0x4478('0x13')]);}logger[_0x4478('0x11')](_0x4478('0xd'),_0x3fe5ea,_0x856b5d[_0x4478('0x11')]['message']);return _0x3cd15f(_0x856b5d['error'][_0x4478('0x13')]);}else{logger[_0x4478('0xc')](_0x4478('0xd'),_0x3fe5ea,_0x4478('0xe'));_0x3cd15f(_0x856b5d[_0x4478('0x14')][_0x4478('0x13')]);}})[_0x4478('0x15')](function(_0x591960){logger[_0x4478('0x11')](_0x4478('0xd'),_0x3fe5ea,_0x591960);_0x418626(_0x591960);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2c7b8b8..7b13858 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 _0xa413=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x5b55a7,_0x36a996){var _0x3ce6ba=function(_0x523421){while(--_0x523421){_0x5b55a7['push'](_0x5b55a7['shift']());}};_0x3ce6ba(++_0x36a996);}(_0xa413,0x1e5));var _0x3a41=function(_0x365e7f,_0x3f33cc){_0x365e7f=_0x365e7f-0x0;var _0x54a681=_0xa413[_0x365e7f];return _0x54a681;};'use strict';var multer=require(_0x3a41('0x0'));var util=require('util');var path=require(_0x3a41('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a41('0x2'));var router=express[_0x3a41('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a41('0x4'));var config=require(_0x3a41('0x5'));var controller=require(_0x3a41('0x6'));router[_0x3a41('0x7')]('/',auth[_0x3a41('0x8')](),controller[_0x3a41('0x9')]);router[_0x3a41('0x7')](_0x3a41('0xa'),auth[_0x3a41('0x8')](),controller[_0x3a41('0xb')]);router[_0x3a41('0xc')]('/',auth['isAuthenticated'](),controller[_0x3a41('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3a41('0xe')]);router['delete'](_0x3a41('0xa'),auth['isAuthenticated'](),controller[_0x3a41('0xf')]);module[_0x3a41('0x10')]=router; \ No newline at end of file +var _0x4c50=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c50,0x10f));var _0x04c5=function(_0x25c670,_0x2c7256){_0x25c670=_0x25c670-0x0;var _0x78e0f6=_0x4c50[_0x25c670];return _0x78e0f6;};'use strict';var multer=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var path=require(_0x04c5('0x2'));var timeout=require(_0x04c5('0x3'));var express=require(_0x04c5('0x4'));var router=express[_0x04c5('0x5')]();var fs_extra=require(_0x04c5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x04c5('0x7'));var controller=require(_0x04c5('0x8'));router['get']('/',auth[_0x04c5('0x9')](),controller[_0x04c5('0xa')]);router[_0x04c5('0xb')](_0x04c5('0xc'),auth[_0x04c5('0x9')](),controller[_0x04c5('0xd')]);router[_0x04c5('0xe')]('/',auth[_0x04c5('0x9')](),controller['create']);router['put']('/:id',auth[_0x04c5('0x9')](),controller[_0x04c5('0xf')]);router[_0x04c5('0x10')](_0x04c5('0xc'),auth[_0x04c5('0x9')](),controller[_0x04c5('0x11')]);module[_0x04c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b009914..97d28ac 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 _0xcc63=['sequelize','exports','STRING'];(function(_0x21bf0d,_0x91bf98){var _0x561491=function(_0x2e6102){while(--_0x2e6102){_0x21bf0d['push'](_0x21bf0d['shift']());}};_0x561491(++_0x91bf98);}(_0xcc63,0xc6));var _0x3cc6=function(_0x2a059a,_0xfa0685){_0x2a059a=_0x2a059a-0x0;var _0x181ef9=_0xcc63[_0x2a059a];return _0x181ef9;};'use strict';var Sequelize=require(_0x3cc6('0x0'));module[_0x3cc6('0x1')]={'name':{'type':Sequelize[_0x3cc6('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x209d=['exports','TEXT','sequelize'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x209d,0xc8));var _0xd209=function(_0xf64f2c,_0x1c444c){_0xf64f2c=_0xf64f2c-0x0;var _0x584dfc=_0x209d[_0xf64f2c];return _0x584dfc;};'use strict';var Sequelize=require(_0xd209('0x0'));module[_0xd209('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xd209('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3edfa86..cfb1864 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 _0x9cbd=['update','Templates','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','Template','includeAll','findAll','catch','show','params','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x271987,_0x535d49){var _0x1123a9=function(_0xb5d351){while(--_0xb5d351){_0x271987['push'](_0x271987['shift']());}};_0x1123a9(++_0x535d49);}(_0x9cbd,0x181));var _0xd9cb=function(_0x1052a7,_0x248022){_0x1052a7=_0x1052a7-0x0;var _0x32141d=_0x9cbd[_0x1052a7];return _0x32141d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9cb('0x0'));var zipdir=require(_0xd9cb('0x1'));var jsonpatch=require(_0xd9cb('0x2'));var rp=require(_0xd9cb('0x3'));var moment=require(_0xd9cb('0x4'));var BPromise=require(_0xd9cb('0x5'));var Mustache=require(_0xd9cb('0x6'));var util=require(_0xd9cb('0x7'));var path=require(_0xd9cb('0x8'));var sox=require(_0xd9cb('0x9'));var csv=require(_0xd9cb('0xa'));var ejs=require(_0xd9cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9cb('0xc'));var crypto=require(_0xd9cb('0xd'));var jsforce=require(_0xd9cb('0xe'));var deskjs=require(_0xd9cb('0xf'));var toCsv=require(_0xd9cb('0xa'));var querystring=require('querystring');var Papa=require(_0xd9cb('0x10'));var Redis=require(_0xd9cb('0x11'));var authService=require(_0xd9cb('0x12'));var qs=require(_0xd9cb('0x13'));var as=require(_0xd9cb('0x14'));var hardwareService=require(_0xd9cb('0x15'));var logger=require(_0xd9cb('0x16'))(_0xd9cb('0x17'));var utils=require(_0xd9cb('0x18'));var config=require(_0xd9cb('0x19'));var licenseUtil=require(_0xd9cb('0x1a'));var db=require(_0xd9cb('0x1b'))['db'];function respondWithStatusCode(_0x48fa4b,_0x3d8d19){_0x3d8d19=_0x3d8d19||0xcc;return function(_0x2be1ea){if(_0x2be1ea){return _0x48fa4b[_0xd9cb('0x1c')](_0x3d8d19);}return _0x48fa4b['status'](_0x3d8d19)['end']();};}function respondWithResult(_0x327683,_0x17af4b){_0x17af4b=_0x17af4b||0xc8;return function(_0x4b7706){if(_0x4b7706){return _0x327683[_0xd9cb('0x1d')](_0x17af4b)[_0xd9cb('0x1e')](_0x4b7706);}};}function respondWithFilteredResult(_0x4bffbc,_0x424d6e){return function(_0x441e99){if(_0x441e99){var _0x53aa90=typeof _0x424d6e[_0xd9cb('0x1f')]===_0xd9cb('0x20')&&typeof _0x424d6e[_0xd9cb('0x21')]===_0xd9cb('0x20');var _0x29c286=_0x441e99[_0xd9cb('0x22')];var _0x4ee063=_0x53aa90?0x0:_0x424d6e['offset'];var _0x54773c=_0x53aa90?_0x441e99[_0xd9cb('0x22')]:_0x424d6e['offset']+_0x424d6e[_0xd9cb('0x21')];var _0x29591a;if(_0x54773c>=_0x29c286){_0x54773c=_0x29c286;_0x29591a=0xc8;}else{_0x29591a=0xce;}_0x4bffbc[_0xd9cb('0x1d')](_0x29591a);return _0x4bffbc[_0xd9cb('0x23')](_0xd9cb('0x24'),_0x4ee063+'-'+_0x54773c+'/'+_0x29c286)[_0xd9cb('0x1e')](_0x441e99);}return null;};}function patchUpdates(_0x229a87){return function(_0x11a2af){try{jsonpatch[_0xd9cb('0x25')](_0x11a2af,_0x229a87,!![]);}catch(_0xb6dabb){return BPromise[_0xd9cb('0x26')](_0xb6dabb);}return _0x11a2af[_0xd9cb('0x27')]();};}function saveUpdates(_0x5abaee,_0x2bd809){return function(_0x5376dc){if(_0x5376dc){return _0x5376dc[_0xd9cb('0x28')](_0x5abaee)['then'](function(_0x9e9f78){return _0x9e9f78;});}return null;};}function removeEntity(_0x4d6142,_0x2b0bd6){return function(_0x329918){if(_0x329918){return _0x329918['destroy']()['then'](function(){var _0xbae49e=_0x329918['get']({'plain':!![]});var _0x19dfd3=_0xd9cb('0x29');return db['UserProfileResource'][_0xd9cb('0x2a')]({'where':{'type':_0x19dfd3,'resourceId':_0xbae49e['id']}})[_0xd9cb('0x2b')](function(){return _0x329918;});})[_0xd9cb('0x2b')](function(){_0x4d6142[_0xd9cb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4146e,_0x5b65ab){return function(_0x4c1cc5){if(!_0x4c1cc5){_0x4146e[_0xd9cb('0x1c')](0x194);}return _0x4c1cc5;};}function handleError(_0x4fc12e,_0x1076ab){_0x1076ab=_0x1076ab||0x1f4;return function(_0x54ac2b){logger['error'](_0x54ac2b[_0xd9cb('0x2c')]);if(_0x54ac2b['name']){delete _0x54ac2b[_0xd9cb('0x2d')];}_0x4fc12e['status'](_0x1076ab)['send'](_0x54ac2b);};}exports[_0xd9cb('0x2e')]=function(_0x19dacd,_0x2bf000){var _0x3db84a={},_0x5eb4e2={},_0x5b478c={'count':0x0,'rows':[]};var _0x2c4296=_[_0xd9cb('0x2f')](db['Template'][_0xd9cb('0x30')],function(_0x325a43){return{'name':_0x325a43[_0xd9cb('0x31')],'type':_0x325a43[_0xd9cb('0x32')][_0xd9cb('0x33')]};});_0x5eb4e2['model']=_[_0xd9cb('0x2f')](_0x2c4296,_0xd9cb('0x2d'));_0x5eb4e2[_0xd9cb('0x34')]=_[_0xd9cb('0x35')](_0x19dacd[_0xd9cb('0x34')]);_0x5eb4e2[_0xd9cb('0x36')]=_['intersection'](_0x5eb4e2[_0xd9cb('0x37')],_0x5eb4e2[_0xd9cb('0x34')]);_0x3db84a[_0xd9cb('0x38')]=_['intersection'](_0x5eb4e2['model'],qs[_0xd9cb('0x39')](_0x19dacd[_0xd9cb('0x34')]['fields']));_0x3db84a[_0xd9cb('0x38')]=_0x3db84a[_0xd9cb('0x38')][_0xd9cb('0x3a')]?_0x3db84a[_0xd9cb('0x38')]:_0x5eb4e2[_0xd9cb('0x37')];if(!_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x3b')](_0xd9cb('0x3c'))){_0x3db84a[_0xd9cb('0x21')]=qs['limit'](_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x21')]);_0x3db84a[_0xd9cb('0x1f')]=qs[_0xd9cb('0x1f')](_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x1f')]);}_0x3db84a[_0xd9cb('0x3d')]=qs[_0xd9cb('0x3e')](_0x19dacd['query'][_0xd9cb('0x3e')]);_0x3db84a[_0xd9cb('0x3f')]=qs['filters'](_['pick'](_0x19dacd[_0xd9cb('0x34')],_0x5eb4e2['filters']),_0x2c4296);if(_0x19dacd[_0xd9cb('0x34')]['filter']){_0x3db84a[_0xd9cb('0x3f')]=_[_0xd9cb('0x40')](_0x3db84a[_0xd9cb('0x3f')],{'$or':_['map'](_0x2c4296,function(_0x43ee30){if(_0x43ee30[_0xd9cb('0x32')]!==_0xd9cb('0x41')){var _0x4a815f={};_0x4a815f[_0x43ee30[_0xd9cb('0x2d')]]={'$like':'%'+_0x19dacd[_0xd9cb('0x34')]['filter']+'%'};return _0x4a815f;}})});}_0x3db84a=_[_0xd9cb('0x40')]({},_0x3db84a,_0x19dacd['options']);var _0x356c2f={'where':_0x3db84a[_0xd9cb('0x3f')]};return db[_0xd9cb('0x42')]['count'](_0x356c2f)['then'](function(_0x371b15){_0x5b478c['count']=_0x371b15;if(_0x19dacd[_0xd9cb('0x34')][_0xd9cb('0x43')]){_0x3db84a['include']=[{'all':!![]}];}return db[_0xd9cb('0x42')][_0xd9cb('0x44')](_0x3db84a);})['then'](function(_0x5757ad){_0x5b478c['rows']=_0x5757ad;return _0x5b478c;})['then'](respondWithFilteredResult(_0x2bf000,_0x3db84a))[_0xd9cb('0x45')](handleError(_0x2bf000,null));};exports[_0xd9cb('0x46')]=function(_0xe0ffda,_0xd94340){var _0x2ba650={'raw':!![],'where':{'id':_0xe0ffda[_0xd9cb('0x47')]['id']}},_0x38937d={};_0x38937d[_0xd9cb('0x37')]=_[_0xd9cb('0x35')](db[_0xd9cb('0x42')][_0xd9cb('0x30')]);_0x38937d[_0xd9cb('0x34')]=_[_0xd9cb('0x35')](_0xe0ffda[_0xd9cb('0x34')]);_0x38937d[_0xd9cb('0x36')]=_[_0xd9cb('0x48')](_0x38937d['model'],_0x38937d['query']);_0x2ba650[_0xd9cb('0x38')]=_[_0xd9cb('0x48')](_0x38937d[_0xd9cb('0x37')],qs[_0xd9cb('0x39')](_0xe0ffda[_0xd9cb('0x34')][_0xd9cb('0x39')]));_0x2ba650[_0xd9cb('0x38')]=_0x2ba650['attributes']['length']?_0x2ba650[_0xd9cb('0x38')]:_0x38937d[_0xd9cb('0x37')];if(_0xe0ffda[_0xd9cb('0x34')][_0xd9cb('0x43')]){_0x2ba650[_0xd9cb('0x49')]=[{'all':!![]}];}_0x2ba650=_[_0xd9cb('0x40')]({},_0x2ba650,_0xe0ffda[_0xd9cb('0x4a')]);return db[_0xd9cb('0x42')][_0xd9cb('0x4b')](_0x2ba650)[_0xd9cb('0x2b')](handleEntityNotFound(_0xd94340,null))[_0xd9cb('0x2b')](respondWithResult(_0xd94340,null))[_0xd9cb('0x45')](handleError(_0xd94340,null));};exports[_0xd9cb('0x4c')]=function(_0x4e7e42,_0x130d65){return db[_0xd9cb('0x42')]['create'](_0x4e7e42[_0xd9cb('0x4d')],{})['then'](function(_0x513302){var _0x1ed6d7=_0x4e7e42[_0xd9cb('0x4e')]['get']({'plain':!![]});if(!_0x1ed6d7)throw new Error(_0xd9cb('0x4f'));if(_0x1ed6d7[_0xd9cb('0x50')]===_0xd9cb('0x4e')){var _0x105f00=_0x513302[_0xd9cb('0x51')]({'plain':!![]});var _0x6ce5bb=_0xd9cb('0x29');return db[_0xd9cb('0x52')][_0xd9cb('0x4b')]({'where':{'name':_0x6ce5bb,'userProfileId':_0x1ed6d7[_0xd9cb('0x53')]},'raw':!![]})['then'](function(_0x4aade7){if(_0x4aade7&&_0x4aade7['autoAssociation']===0x0){return db[_0xd9cb('0x54')]['create']({'name':_0x105f00[_0xd9cb('0x2d')],'resourceId':_0x105f00['id'],'type':_0x4aade7['name'],'sectionId':_0x4aade7['id']},{})[_0xd9cb('0x2b')](function(){return _0x513302;});}else{return _0x513302;}})[_0xd9cb('0x45')](function(_0x2bdbf7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bdbf7);throw _0x2bdbf7;});}return _0x513302;})['then'](respondWithResult(_0x130d65,0xc9))['catch'](handleError(_0x130d65,null));};exports[_0xd9cb('0x28')]=function(_0xd7852d,_0x33e83d){if(_0xd7852d['body']['id']){delete _0xd7852d[_0xd9cb('0x4d')]['id'];}return db[_0xd9cb('0x42')][_0xd9cb('0x4b')]({'where':{'id':_0xd7852d[_0xd9cb('0x47')]['id']}})[_0xd9cb('0x2b')](handleEntityNotFound(_0x33e83d,null))[_0xd9cb('0x2b')](saveUpdates(_0xd7852d[_0xd9cb('0x4d')],null))[_0xd9cb('0x2b')](respondWithResult(_0x33e83d,null))[_0xd9cb('0x45')](handleError(_0x33e83d,null));};exports[_0xd9cb('0x2a')]=function(_0xa2b88,_0x4b8fd8){return db[_0xd9cb('0x42')][_0xd9cb('0x4b')]({'where':{'id':_0xa2b88[_0xd9cb('0x47')]['id']}})[_0xd9cb('0x2b')](handleEntityNotFound(_0x4b8fd8,null))[_0xd9cb('0x2b')](removeEntity(_0x4b8fd8,null))[_0xd9cb('0x45')](handleError(_0x4b8fd8,null));}; \ No newline at end of file +var _0x68f9=['stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','crypto','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','apply','save','update','destroy','then','get','Templates','UserProfileResource','error'];(function(_0x37e0d6,_0x5db050){var _0x25a74c=function(_0x2e76a6){while(--_0x2e76a6){_0x37e0d6['push'](_0x37e0d6['shift']());}};_0x25a74c(++_0x5db050);}(_0x68f9,0x16f));var _0x968f=function(_0x5e2692,_0x246a40){_0x5e2692=_0x5e2692-0x0;var _0x14f0a5=_0x68f9[_0x5e2692];return _0x14f0a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x968f('0x0'));var zipdir=require(_0x968f('0x1'));var jsonpatch=require(_0x968f('0x2'));var rp=require(_0x968f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x968f('0x4'));var util=require(_0x968f('0x5'));var path=require(_0x968f('0x6'));var sox=require(_0x968f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x968f('0x8'));var _=require(_0x968f('0x9'));var squel=require(_0x968f('0xa'));var crypto=require(_0x968f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x968f('0xc'));var toCsv=require(_0x968f('0xd'));var querystring=require(_0x968f('0xe'));var Papa=require('papaparse');var Redis=require(_0x968f('0xf'));var authService=require(_0x968f('0x10'));var qs=require(_0x968f('0x11'));var as=require(_0x968f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x968f('0x13'))(_0x968f('0x14'));var utils=require(_0x968f('0x15'));var config=require(_0x968f('0x16'));var licenseUtil=require(_0x968f('0x17'));var db=require(_0x968f('0x18'))['db'];function respondWithStatusCode(_0x16d6b7,_0x1b0d3c){_0x1b0d3c=_0x1b0d3c||0xcc;return function(_0x50ebbb){if(_0x50ebbb){return _0x16d6b7[_0x968f('0x19')](_0x1b0d3c);}return _0x16d6b7[_0x968f('0x1a')](_0x1b0d3c)[_0x968f('0x1b')]();};}function respondWithResult(_0x1a370e,_0x419ee3){_0x419ee3=_0x419ee3||0xc8;return function(_0x1ee6be){if(_0x1ee6be){return _0x1a370e['status'](_0x419ee3)[_0x968f('0x1c')](_0x1ee6be);}};}function respondWithFilteredResult(_0xa68baf,_0x178c4a){return function(_0x7e3454){if(_0x7e3454){var _0x53bd0b=typeof _0x178c4a[_0x968f('0x1d')]===_0x968f('0x1e')&&typeof _0x178c4a[_0x968f('0x1f')]==='undefined';var _0x59b447=_0x7e3454['count'];var _0x496720=_0x53bd0b?0x0:_0x178c4a[_0x968f('0x1d')];var _0x5d194a=_0x53bd0b?_0x7e3454[_0x968f('0x20')]:_0x178c4a[_0x968f('0x1d')]+_0x178c4a[_0x968f('0x1f')];var _0x52b66b;if(_0x5d194a>=_0x59b447){_0x5d194a=_0x59b447;_0x52b66b=0xc8;}else{_0x52b66b=0xce;}_0xa68baf['status'](_0x52b66b);return _0xa68baf[_0x968f('0x21')]('Content-Range',_0x496720+'-'+_0x5d194a+'/'+_0x59b447)[_0x968f('0x1c')](_0x7e3454);}return null;};}function patchUpdates(_0x485860){return function(_0x25c79e){try{jsonpatch[_0x968f('0x22')](_0x25c79e,_0x485860,!![]);}catch(_0x2eadfd){return BPromise['reject'](_0x2eadfd);}return _0x25c79e[_0x968f('0x23')]();};}function saveUpdates(_0x28e4b9,_0x2ffc6){return function(_0x520957){if(_0x520957){return _0x520957[_0x968f('0x24')](_0x28e4b9)['then'](function(_0x5284bf){return _0x5284bf;});}return null;};}function removeEntity(_0x907b02,_0x3ffdd4){return function(_0x5ec43b){if(_0x5ec43b){return _0x5ec43b[_0x968f('0x25')]()[_0x968f('0x26')](function(){var _0x9fe96a=_0x5ec43b[_0x968f('0x27')]({'plain':!![]});var _0x5db19b=_0x968f('0x28');return db[_0x968f('0x29')][_0x968f('0x25')]({'where':{'type':_0x5db19b,'resourceId':_0x9fe96a['id']}})[_0x968f('0x26')](function(){return _0x5ec43b;});})[_0x968f('0x26')](function(){_0x907b02[_0x968f('0x1a')](0xcc)[_0x968f('0x1b')]();});}};}function handleEntityNotFound(_0x53a1c7,_0x1e7da9){return function(_0x427ace){if(!_0x427ace){_0x53a1c7[_0x968f('0x19')](0x194);}return _0x427ace;};}function handleError(_0x52ef89,_0x3d16d5){_0x3d16d5=_0x3d16d5||0x1f4;return function(_0x527f25){logger[_0x968f('0x2a')](_0x527f25[_0x968f('0x2b')]);if(_0x527f25[_0x968f('0x2c')]){delete _0x527f25['name'];}_0x52ef89[_0x968f('0x1a')](_0x3d16d5)['send'](_0x527f25);};}exports[_0x968f('0x2d')]=function(_0x6db423,_0x5b80c4){var _0x33e31b={},_0xb8e6ba={},_0x58ff31={'count':0x0,'rows':[]};var _0x11be45=_[_0x968f('0x2e')](db[_0x968f('0x2f')][_0x968f('0x30')],function(_0x55d914){return{'name':_0x55d914[_0x968f('0x31')],'type':_0x55d914[_0x968f('0x32')][_0x968f('0x33')]};});_0xb8e6ba['model']=_[_0x968f('0x2e')](_0x11be45,'name');_0xb8e6ba[_0x968f('0x34')]=_['keys'](_0x6db423['query']);_0xb8e6ba[_0x968f('0x35')]=_[_0x968f('0x36')](_0xb8e6ba[_0x968f('0x37')],_0xb8e6ba[_0x968f('0x34')]);_0x33e31b[_0x968f('0x38')]=_[_0x968f('0x36')](_0xb8e6ba['model'],qs[_0x968f('0x39')](_0x6db423[_0x968f('0x34')]['fields']));_0x33e31b[_0x968f('0x38')]=_0x33e31b[_0x968f('0x38')][_0x968f('0x3a')]?_0x33e31b[_0x968f('0x38')]:_0xb8e6ba[_0x968f('0x37')];if(!_0x6db423['query'][_0x968f('0x3b')](_0x968f('0x3c'))){_0x33e31b['limit']=qs[_0x968f('0x1f')](_0x6db423[_0x968f('0x34')][_0x968f('0x1f')]);_0x33e31b[_0x968f('0x1d')]=qs[_0x968f('0x1d')](_0x6db423[_0x968f('0x34')][_0x968f('0x1d')]);}_0x33e31b[_0x968f('0x3d')]=qs[_0x968f('0x3e')](_0x6db423[_0x968f('0x34')][_0x968f('0x3e')]);_0x33e31b[_0x968f('0x3f')]=qs[_0x968f('0x35')](_['pick'](_0x6db423[_0x968f('0x34')],_0xb8e6ba[_0x968f('0x35')]),_0x11be45);if(_0x6db423['query'][_0x968f('0x40')]){_0x33e31b[_0x968f('0x3f')]=_[_0x968f('0x41')](_0x33e31b[_0x968f('0x3f')],{'$or':_[_0x968f('0x2e')](_0x11be45,function(_0x2365c4){if(_0x2365c4['type']!==_0x968f('0x42')){var _0x405ebf={};_0x405ebf[_0x2365c4[_0x968f('0x2c')]]={'$like':'%'+_0x6db423[_0x968f('0x34')][_0x968f('0x40')]+'%'};return _0x405ebf;}})});}_0x33e31b=_[_0x968f('0x41')]({},_0x33e31b,_0x6db423['options']);var _0x1660bf={'where':_0x33e31b[_0x968f('0x3f')]};return db['Template'][_0x968f('0x20')](_0x1660bf)[_0x968f('0x26')](function(_0x21a552){_0x58ff31[_0x968f('0x20')]=_0x21a552;if(_0x6db423['query'][_0x968f('0x43')]){_0x33e31b[_0x968f('0x44')]=[{'all':!![]}];}return db['Template'][_0x968f('0x45')](_0x33e31b);})[_0x968f('0x26')](function(_0x4c1acd){_0x58ff31['rows']=_0x4c1acd;return _0x58ff31;})[_0x968f('0x26')](respondWithFilteredResult(_0x5b80c4,_0x33e31b))[_0x968f('0x46')](handleError(_0x5b80c4,null));};exports[_0x968f('0x47')]=function(_0x517a86,_0x1b25f2){var _0x33ccf0={'raw':!![],'where':{'id':_0x517a86[_0x968f('0x48')]['id']}},_0x344652={};_0x344652[_0x968f('0x37')]=_['keys'](db[_0x968f('0x2f')][_0x968f('0x30')]);_0x344652[_0x968f('0x34')]=_['keys'](_0x517a86['query']);_0x344652[_0x968f('0x35')]=_['intersection'](_0x344652['model'],_0x344652[_0x968f('0x34')]);_0x33ccf0[_0x968f('0x38')]=_[_0x968f('0x36')](_0x344652[_0x968f('0x37')],qs[_0x968f('0x39')](_0x517a86['query']['fields']));_0x33ccf0[_0x968f('0x38')]=_0x33ccf0[_0x968f('0x38')][_0x968f('0x3a')]?_0x33ccf0[_0x968f('0x38')]:_0x344652['model'];if(_0x517a86[_0x968f('0x34')]['includeAll']){_0x33ccf0[_0x968f('0x44')]=[{'all':!![]}];}_0x33ccf0=_['merge']({},_0x33ccf0,_0x517a86[_0x968f('0x49')]);return db[_0x968f('0x2f')][_0x968f('0x4a')](_0x33ccf0)[_0x968f('0x26')](handleEntityNotFound(_0x1b25f2,null))[_0x968f('0x26')](respondWithResult(_0x1b25f2,null))[_0x968f('0x46')](handleError(_0x1b25f2,null));};exports['create']=function(_0x418d5b,_0x6ad8fd){return db[_0x968f('0x2f')]['create'](_0x418d5b[_0x968f('0x4b')],{})[_0x968f('0x26')](function(_0x2ac656){var _0x374e77=_0x418d5b[_0x968f('0x4c')][_0x968f('0x27')]({'plain':!![]});if(!_0x374e77)throw new Error(_0x968f('0x4d'));if(_0x374e77['role']===_0x968f('0x4c')){var _0x8be279=_0x2ac656['get']({'plain':!![]});var _0x5390a0=_0x968f('0x28');return db[_0x968f('0x4e')]['find']({'where':{'name':_0x5390a0,'userProfileId':_0x374e77['userProfileId']},'raw':!![]})[_0x968f('0x26')](function(_0x2e2123){if(_0x2e2123&&_0x2e2123[_0x968f('0x4f')]===0x0){return db[_0x968f('0x29')][_0x968f('0x50')]({'name':_0x8be279[_0x968f('0x2c')],'resourceId':_0x8be279['id'],'type':_0x2e2123[_0x968f('0x2c')],'sectionId':_0x2e2123['id']},{})[_0x968f('0x26')](function(){return _0x2ac656;});}else{return _0x2ac656;}})['catch'](function(_0x384c6a){logger[_0x968f('0x2a')](_0x968f('0x51'),_0x384c6a);throw _0x384c6a;});}return _0x2ac656;})[_0x968f('0x26')](respondWithResult(_0x6ad8fd,0xc9))[_0x968f('0x46')](handleError(_0x6ad8fd,null));};exports[_0x968f('0x24')]=function(_0x4de252,_0x3954d3){if(_0x4de252[_0x968f('0x4b')]['id']){delete _0x4de252[_0x968f('0x4b')]['id'];}return db[_0x968f('0x2f')]['find']({'where':{'id':_0x4de252[_0x968f('0x48')]['id']}})[_0x968f('0x26')](handleEntityNotFound(_0x3954d3,null))[_0x968f('0x26')](saveUpdates(_0x4de252[_0x968f('0x4b')],null))[_0x968f('0x26')](respondWithResult(_0x3954d3,null))['catch'](handleError(_0x3954d3,null));};exports[_0x968f('0x25')]=function(_0x1dac37,_0x9c0aff){return db['Template'][_0x968f('0x4a')]({'where':{'id':_0x1dac37[_0x968f('0x48')]['id']}})[_0x968f('0x26')](handleEntityNotFound(_0x9c0aff,null))['then'](removeEntity(_0x9c0aff,null))[_0x968f('0x46')](handleError(_0x9c0aff,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b0ea65a..493aa0a 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 _0x6f87=['rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xd485f,_0x1379a6){var _0x5aaf2d=function(_0x5a1ee5){while(--_0x5a1ee5){_0xd485f['push'](_0xd485f['shift']());}};_0x5aaf2d(++_0x1379a6);}(_0x6f87,0x131));var _0x76f8=function(_0x293e2a,_0x2ecf0a){_0x293e2a=_0x293e2a-0x0;var _0xbfaf5a=_0x6f87[_0x293e2a];return _0xbfaf5a;};'use strict';var _=require(_0x76f8('0x0'));var util=require(_0x76f8('0x1'));var logger=require(_0x76f8('0x2'))(_0x76f8('0x3'));var moment=require(_0x76f8('0x4'));var BPromise=require('bluebird');var rp=require(_0x76f8('0x5'));var fs=require('fs');var path=require(_0x76f8('0x6'));var rimraf=require(_0x76f8('0x7'));var config=require(_0x76f8('0x8'));var attributes=require(_0x76f8('0x9'));module['exports']=function(_0x564d79,_0x54fbc5){return _0x564d79[_0x76f8('0xa')](_0x76f8('0xb'),attributes,{'tableName':_0x76f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf87a=['moment','bluebird','../../config/environment','define','util','api'];(function(_0x525308,_0x5898c9){var _0x5a6e40=function(_0x113c37){while(--_0x113c37){_0x525308['push'](_0x525308['shift']());}};_0x5a6e40(++_0x5898c9);}(_0xf87a,0x94));var _0xaf87=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf87a[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xaf87('0x0'));var logger=require('../../config/logger')(_0xaf87('0x1'));var moment=require(_0xaf87('0x2'));var BPromise=require(_0xaf87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf87('0x4'));var attributes=require('./template.attributes');module['exports']=function(_0x2f919a,_0x2eb5e2){return _0x2f919a[_0xaf87('0x5')]('Template',attributes,{'tableName':'tools_templates','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 e97426a..79f129b 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 _0x1d28=['rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template','findAll','options','where','attributes','limit','include','map','model','GetTemplate','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5dbfaa,_0x4b9ca3){var _0x20449e=function(_0x45b18a){while(--_0x45b18a){_0x5dbfaa['push'](_0x5dbfaa['shift']());}};_0x20449e(++_0x4b9ca3);}(_0x1d28,0x164));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x81d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x81d2('0x1'));var rs=require(_0x81d2('0x2'));var fs=require('fs');var Redis=require(_0x81d2('0x3'));var db=require(_0x81d2('0x4'))['db'];var utils=require(_0x81d2('0x5'));var logger=require(_0x81d2('0x6'))(_0x81d2('0x7'));var config=require(_0x81d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81d2('0x9')][_0x81d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cce9e,_0x30162b,_0xf1aa3){return new BPromise(function(_0x3add66,_0x5cdcd8){return client[_0x81d2('0xb')](_0x3cce9e,_0xf1aa3)[_0x81d2('0xc')](function(_0x2914e2){logger[_0x81d2('0xd')](_0x81d2('0xe'),_0x30162b,_0x81d2('0xf'));logger[_0x81d2('0x10')](_0x81d2('0x11'),_0x30162b,_0x81d2('0xf'),JSON[_0x81d2('0x12')](_0x2914e2));if(_0x2914e2[_0x81d2('0x13')]){if(_0x2914e2[_0x81d2('0x13')][_0x81d2('0x14')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x30162b,_0x2914e2[_0x81d2('0x13')][_0x81d2('0x15')]);return _0x5cdcd8(_0x2914e2['error'][_0x81d2('0x15')]);}logger[_0x81d2('0x13')](_0x81d2('0xe'),_0x30162b,_0x2914e2['error'][_0x81d2('0x15')]);return _0x3add66(_0x2914e2[_0x81d2('0x13')][_0x81d2('0x15')]);}else{logger[_0x81d2('0xd')](_0x81d2('0xe'),_0x30162b,_0x81d2('0xf'));_0x3add66(_0x2914e2['result'][_0x81d2('0x15')]);}})[_0x81d2('0x16')](function(_0x1ba358){logger['error']('Template,\x20%s,\x20%s',_0x30162b,_0x1ba358);_0x5cdcd8(_0x1ba358);});});}exports['GetTemplate']=function(_0x40b23f){var _0x4263c7=this;return new Promise(function(_0x376ae2,_0x4ed502){return db[_0x81d2('0x17')][_0x81d2('0x18')]({'raw':_0x40b23f[_0x81d2('0x19')]?_0x40b23f['options']['raw']===undefined?!![]:![]:!![],'where':_0x40b23f[_0x81d2('0x19')]?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1a')]||null:null,'attributes':_0x40b23f['options']?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1b')]||null:null,'limit':_0x40b23f[_0x81d2('0x19')]?_0x40b23f['options'][_0x81d2('0x1c')]||null:null,'include':_0x40b23f[_0x81d2('0x19')]?_0x40b23f[_0x81d2('0x19')][_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x40b23f['options'][_0x81d2('0x1d')],function(_0x18cf0c){return{'model':db[_0x18cf0c['model']],'as':_0x18cf0c['as'],'attributes':_0x18cf0c[_0x81d2('0x1b')],'include':_0x18cf0c[_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x18cf0c[_0x81d2('0x1d')],function(_0x110d24){return{'model':db[_0x110d24[_0x81d2('0x1f')]],'as':_0x110d24['as'],'attributes':_0x110d24[_0x81d2('0x1b')],'include':_0x110d24[_0x81d2('0x1d')]?_[_0x81d2('0x1e')](_0x110d24[_0x81d2('0x1d')],function(_0x2e4928){return{'model':db[_0x2e4928[_0x81d2('0x1f')]],'as':_0x2e4928['as'],'attributes':_0x2e4928[_0x81d2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x81d2('0xc')](function(_0x45a614){logger[_0x81d2('0xd')](_0x81d2('0x20'),_0x40b23f);logger[_0x81d2('0x10')](_0x81d2('0x20'),_0x40b23f,JSON[_0x81d2('0x12')](_0x45a614));_0x376ae2(_0x45a614);})[_0x81d2('0x16')](function(_0x391865){logger['error'](_0x81d2('0x20'),_0x391865[_0x81d2('0x15')],_0x40b23f);_0x4ed502(_0x4263c7[_0x81d2('0x13')](0x1f4,_0x391865[_0x81d2('0x15')]));});});}; \ No newline at end of file +var _0xb310=['Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','map','include','model','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2db63a,_0x52ee8e){var _0x556b91=function(_0x4ad3aa){while(--_0x4ad3aa){_0x2db63a['push'](_0x2db63a['shift']());}};_0x556b91(++_0x52ee8e);}(_0xb310,0x115));var _0x0b31=function(_0x168728,_0x3fefb9){_0x168728=_0x168728-0x0;var _0x471317=_0xb310[_0x168728];return _0x471317;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b31('0x0'));var BPromise=require(_0x0b31('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b31('0x2'));var db=require(_0x0b31('0x3'))['db'];var utils=require(_0x0b31('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0b31('0x5'));var jayson=require(_0x0b31('0x6'));var client=jayson[_0x0b31('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x131f5c,_0x169a0a,_0x4aad86){return new BPromise(function(_0x496307,_0x561c1a){return client[_0x0b31('0x8')](_0x131f5c,_0x4aad86)['then'](function(_0xe97544){logger[_0x0b31('0x9')](_0x0b31('0xa'),_0x169a0a,_0x0b31('0xb'));logger[_0x0b31('0xc')](_0x0b31('0xd'),_0x169a0a,_0x0b31('0xb'),JSON[_0x0b31('0xe')](_0xe97544));if(_0xe97544[_0x0b31('0xf')]){if(_0xe97544[_0x0b31('0xf')][_0x0b31('0x10')]===0x1f4){logger['error'](_0x0b31('0xa'),_0x169a0a,_0xe97544[_0x0b31('0xf')]['message']);return _0x561c1a(_0xe97544['error']['message']);}logger['error'](_0x0b31('0xa'),_0x169a0a,_0xe97544[_0x0b31('0xf')][_0x0b31('0x11')]);return _0x496307(_0xe97544[_0x0b31('0xf')]['message']);}else{logger[_0x0b31('0x9')](_0x0b31('0xa'),_0x169a0a,'request\x20sent');_0x496307(_0xe97544[_0x0b31('0x12')]['message']);}})[_0x0b31('0x13')](function(_0x17b4fd){logger[_0x0b31('0xf')]('Template,\x20%s,\x20%s',_0x169a0a,_0x17b4fd);_0x561c1a(_0x17b4fd);});});}exports[_0x0b31('0x14')]=function(_0x132223){var _0xf33f97=this;return new Promise(function(_0x19312b,_0x20862f){return db[_0x0b31('0x15')][_0x0b31('0x16')]({'raw':_0x132223['options']?_0x132223[_0x0b31('0x17')][_0x0b31('0x18')]===undefined?!![]:![]:!![],'where':_0x132223[_0x0b31('0x17')]?_0x132223[_0x0b31('0x17')]['where']||null:null,'attributes':_0x132223[_0x0b31('0x17')]?_0x132223[_0x0b31('0x17')][_0x0b31('0x19')]||null:null,'limit':_0x132223[_0x0b31('0x17')]?_0x132223[_0x0b31('0x17')]['limit']||null:null,'include':_0x132223[_0x0b31('0x17')]?_0x132223[_0x0b31('0x17')]['include']?_[_0x0b31('0x1a')](_0x132223[_0x0b31('0x17')][_0x0b31('0x1b')],function(_0x185415){return{'model':db[_0x185415[_0x0b31('0x1c')]],'as':_0x185415['as'],'attributes':_0x185415[_0x0b31('0x19')],'include':_0x185415['include']?_[_0x0b31('0x1a')](_0x185415[_0x0b31('0x1b')],function(_0x6e1a5f){return{'model':db[_0x6e1a5f[_0x0b31('0x1c')]],'as':_0x6e1a5f['as'],'attributes':_0x6e1a5f['attributes'],'include':_0x6e1a5f['include']?_['map'](_0x6e1a5f[_0x0b31('0x1b')],function(_0x5915ad){return{'model':db[_0x5915ad[_0x0b31('0x1c')]],'as':_0x5915ad['as'],'attributes':_0x5915ad[_0x0b31('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3013c9){logger[_0x0b31('0x9')](_0x0b31('0x14'),_0x132223);logger[_0x0b31('0xc')](_0x0b31('0x14'),_0x132223,JSON[_0x0b31('0xe')](_0x3013c9));_0x19312b(_0x3013c9);})[_0x0b31('0x13')](function(_0x48172a){logger[_0x0b31('0xf')](_0x0b31('0x14'),_0x48172a[_0x0b31('0x11')],_0x132223);_0x20862f(_0xf33f97[_0x0b31('0xf')](0x1f4,_0x48172a[_0x0b31('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8f2ca25..471e58c 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 _0x5d20=['getAllConditions','getAnyConditions','/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAction','update','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x5d20,0xcb));var _0x05d2=function(_0x42c58f,_0x5cfb7e){_0x42c58f=_0x42c58f-0x0;var _0x296295=_0x5d20[_0x42c58f];return _0x296295;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x05d2('0x0'));var express=require('express');var router=express[_0x05d2('0x1')]();var fs_extra=require(_0x05d2('0x2'));var auth=require(_0x05d2('0x3'));var interaction=require(_0x05d2('0x4'));var config=require(_0x05d2('0x5'));var controller=require(_0x05d2('0x6'));router[_0x05d2('0x7')]('/',auth[_0x05d2('0x8')](),controller[_0x05d2('0x9')]);router['get'](_0x05d2('0xa'),auth[_0x05d2('0x8')](),controller[_0x05d2('0xb')]);router['get'](_0x05d2('0xc'),auth[_0x05d2('0x8')](),controller[_0x05d2('0xd')]);router[_0x05d2('0x7')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x05d2('0xe')]);router['get'](_0x05d2('0xf'),auth[_0x05d2('0x8')](),controller['getActions']);router[_0x05d2('0x10')]('/',auth['isAuthenticated'](),controller[_0x05d2('0x11')]);router[_0x05d2('0x10')](_0x05d2('0xc'),auth[_0x05d2('0x8')](),controller[_0x05d2('0x12')]);router['post'](_0x05d2('0x13'),auth[_0x05d2('0x8')](),controller['addAnyCondition']);router[_0x05d2('0x10')]('/:id/actions',auth[_0x05d2('0x8')](),controller[_0x05d2('0x14')]);router['put'](_0x05d2('0xa'),auth[_0x05d2('0x8')](),controller[_0x05d2('0x15')]);router[_0x05d2('0x16')]('/:id',auth[_0x05d2('0x8')](),controller['destroy']);module[_0x05d2('0x17')]=router; \ No newline at end of file +var _0x98dc=['../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98dc,0x18a));var _0xc98d=function(_0x19dd9d,_0x29e8d8){_0x19dd9d=_0x19dd9d-0x0;var _0x57ce88=_0x98dc[_0x19dd9d];return _0x57ce88;};'use strict';var multer=require(_0xc98d('0x0'));var util=require(_0xc98d('0x1'));var path=require(_0xc98d('0x2'));var timeout=require(_0xc98d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc98d('0x4'));var auth=require(_0xc98d('0x5'));var interaction=require(_0xc98d('0x6'));var config=require(_0xc98d('0x7'));var controller=require(_0xc98d('0x8'));router[_0xc98d('0x9')]('/',auth['isAuthenticated'](),controller[_0xc98d('0xa')]);router[_0xc98d('0x9')]('/:id',auth[_0xc98d('0xb')](),controller[_0xc98d('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xc98d('0xd')]);router[_0xc98d('0x9')](_0xc98d('0xe'),auth[_0xc98d('0xb')](),controller[_0xc98d('0xf')]);router[_0xc98d('0x9')](_0xc98d('0x10'),auth[_0xc98d('0xb')](),controller[_0xc98d('0x11')]);router[_0xc98d('0x12')]('/',auth[_0xc98d('0xb')](),controller[_0xc98d('0x13')]);router['post']('/:id/all_conditions',auth[_0xc98d('0xb')](),controller['addAllCondition']);router['post'](_0xc98d('0xe'),auth[_0xc98d('0xb')](),controller[_0xc98d('0x14')]);router[_0xc98d('0x12')](_0xc98d('0x10'),auth['isAuthenticated'](),controller[_0xc98d('0x15')]);router['put'](_0xc98d('0x16'),auth[_0xc98d('0xb')](),controller[_0xc98d('0x17')]);router['delete'](_0xc98d('0x16'),auth[_0xc98d('0xb')](),controller[_0xc98d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 42fc918..6be057f 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 _0x6576=['sequelize','exports','STRING','BOOLEAN'];(function(_0x9b08a4,_0x5f58b7){var _0x54b037=function(_0x117855){while(--_0x117855){_0x9b08a4['push'](_0x9b08a4['shift']());}};_0x54b037(++_0x5f58b7);}(_0x6576,0xb8));var _0x6657=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x6576[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x6657('0x0'));module[_0x6657('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6657('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6657('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x96a3=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1ef7aa,_0xed2016){var _0xc179e9=function(_0x5e931b){while(--_0x5e931b){_0x1ef7aa['push'](_0x1ef7aa['shift']());}};_0xc179e9(++_0xed2016);}(_0x96a3,0xb7));var _0x396a=function(_0x4e7c5a,_0x3cd83e){_0x4e7c5a=_0x4e7c5a-0x0;var _0x3e9e67=_0x96a3[_0x4e7c5a];return _0x3e9e67;};'use strict';var Sequelize=require(_0x396a('0x0'));module[_0x396a('0x1')]={'name':{'type':Sequelize[_0x396a('0x2')]},'channel':{'type':Sequelize[_0x396a('0x2')]},'description':{'type':Sequelize[_0x396a('0x2')]},'status':{'type':Sequelize[_0x396a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 796ed95..6f6588e 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 _0x71e3=['sort','pick','where','merge','VIRTUAL','filter','options','Trigger','includeAll','include','catch','keys','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','status','set','apply','reject','update','then','get','Triggers','destroy','error','name','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','order'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x71e3,0xd4));var _0x371e=function(_0x56de14,_0x1c64f5){_0x56de14=_0x56de14-0x0;var _0xf5f389=_0x71e3[_0x56de14];return _0xf5f389;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x371e('0x0'));var zipdir=require(_0x371e('0x1'));var jsonpatch=require(_0x371e('0x2'));var rp=require('request-promise');var moment=require(_0x371e('0x3'));var BPromise=require(_0x371e('0x4'));var Mustache=require(_0x371e('0x5'));var util=require(_0x371e('0x6'));var path=require(_0x371e('0x7'));var sox=require('sox');var csv=require(_0x371e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x371e('0x9'));var crypto=require('crypto');var jsforce=require(_0x371e('0xa'));var deskjs=require(_0x371e('0xb'));var toCsv=require(_0x371e('0x8'));var querystring=require(_0x371e('0xc'));var Papa=require(_0x371e('0xd'));var Redis=require(_0x371e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x371e('0xf'));var as=require(_0x371e('0x10'));var hardwareService=require(_0x371e('0x11'));var logger=require('../../config/logger')(_0x371e('0x12'));var utils=require(_0x371e('0x13'));var config=require(_0x371e('0x14'));var licenseUtil=require(_0x371e('0x15'));var db=require(_0x371e('0x16'))['db'];function respondWithStatusCode(_0x379e47,_0x36239d){_0x36239d=_0x36239d||0xcc;return function(_0x317ee7){if(_0x317ee7){return _0x379e47[_0x371e('0x17')](_0x36239d);}return _0x379e47['status'](_0x36239d)['end']();};}function respondWithResult(_0x104cd0,_0x1017c2){_0x1017c2=_0x1017c2||0xc8;return function(_0xd653ec){if(_0xd653ec){return _0x104cd0['status'](_0x1017c2)[_0x371e('0x18')](_0xd653ec);}};}function respondWithFilteredResult(_0x5c164a,_0x465a3e){return function(_0x2b9587){if(_0x2b9587){var _0x2f14f9=typeof _0x465a3e['offset']===_0x371e('0x19')&&typeof _0x465a3e['limit']===_0x371e('0x19');var _0x467faf=_0x2b9587[_0x371e('0x1a')];var _0x3cdb2a=_0x2f14f9?0x0:_0x465a3e[_0x371e('0x1b')];var _0x3b1961=_0x2f14f9?_0x2b9587[_0x371e('0x1a')]:_0x465a3e[_0x371e('0x1b')]+_0x465a3e['limit'];var _0x5942ba;if(_0x3b1961>=_0x467faf){_0x3b1961=_0x467faf;_0x5942ba=0xc8;}else{_0x5942ba=0xce;}_0x5c164a[_0x371e('0x1c')](_0x5942ba);return _0x5c164a[_0x371e('0x1d')]('Content-Range',_0x3cdb2a+'-'+_0x3b1961+'/'+_0x467faf)[_0x371e('0x18')](_0x2b9587);}return null;};}function patchUpdates(_0x2ab56c){return function(_0x3e9728){try{jsonpatch[_0x371e('0x1e')](_0x3e9728,_0x2ab56c,!![]);}catch(_0x247be8){return BPromise[_0x371e('0x1f')](_0x247be8);}return _0x3e9728['save']();};}function saveUpdates(_0x5e4b97,_0x1cc280){return function(_0x5f52ab){if(_0x5f52ab){return _0x5f52ab[_0x371e('0x20')](_0x5e4b97)[_0x371e('0x21')](function(_0x515e18){return _0x515e18;});}return null;};}function removeEntity(_0x2e5f87,_0x4f97e8){return function(_0x49fd76){if(_0x49fd76){return _0x49fd76['destroy']()[_0x371e('0x21')](function(){var _0xa80d7b=_0x49fd76[_0x371e('0x22')]({'plain':!![]});var _0xccd374=_0x371e('0x23');return db['UserProfileResource'][_0x371e('0x24')]({'where':{'type':_0xccd374,'resourceId':_0xa80d7b['id']}})['then'](function(){return _0x49fd76;});})[_0x371e('0x21')](function(){_0x2e5f87[_0x371e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de164,_0x29a49b){return function(_0x3716a4){if(!_0x3716a4){_0x3de164[_0x371e('0x17')](0x194);}return _0x3716a4;};}function handleError(_0xdaee23,_0x40b0ad){_0x40b0ad=_0x40b0ad||0x1f4;return function(_0x43bd27){logger[_0x371e('0x25')](_0x43bd27['stack']);if(_0x43bd27[_0x371e('0x26')]){delete _0x43bd27[_0x371e('0x26')];}_0xdaee23['status'](_0x40b0ad)['send'](_0x43bd27);};}exports['index']=function(_0x4909f5,_0x2ae3b7){var _0x32fd80={},_0x13a4c8={},_0x2aca12={'count':0x0,'rows':[]};var _0x6dba67=_[_0x371e('0x27')](db['Trigger']['rawAttributes'],function(_0x57fdab){return{'name':_0x57fdab[_0x371e('0x28')],'type':_0x57fdab[_0x371e('0x29')][_0x371e('0x2a')]};});_0x13a4c8[_0x371e('0x2b')]=_[_0x371e('0x27')](_0x6dba67,_0x371e('0x26'));_0x13a4c8[_0x371e('0x2c')]=_['keys'](_0x4909f5[_0x371e('0x2c')]);_0x13a4c8[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x13a4c8[_0x371e('0x2b')],_0x13a4c8[_0x371e('0x2c')]);_0x32fd80[_0x371e('0x2f')]=_['intersection'](_0x13a4c8[_0x371e('0x2b')],qs['fields'](_0x4909f5[_0x371e('0x2c')][_0x371e('0x30')]));_0x32fd80['attributes']=_0x32fd80[_0x371e('0x2f')][_0x371e('0x31')]?_0x32fd80['attributes']:_0x13a4c8[_0x371e('0x2b')];if(!_0x4909f5[_0x371e('0x2c')]['hasOwnProperty']('nolimit')){_0x32fd80[_0x371e('0x32')]=qs['limit'](_0x4909f5[_0x371e('0x2c')]['limit']);_0x32fd80[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x4909f5[_0x371e('0x2c')][_0x371e('0x1b')]);}_0x32fd80[_0x371e('0x33')]=qs[_0x371e('0x34')](_0x4909f5[_0x371e('0x2c')][_0x371e('0x34')]);_0x32fd80['where']=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x4909f5[_0x371e('0x2c')],_0x13a4c8[_0x371e('0x2d')]),_0x6dba67);if(_0x4909f5[_0x371e('0x2c')]['filter']){_0x32fd80[_0x371e('0x36')]=_[_0x371e('0x37')](_0x32fd80['where'],{'$or':_[_0x371e('0x27')](_0x6dba67,function(_0x3f7a30){if(_0x3f7a30['type']!==_0x371e('0x38')){var _0x4fdac9={};_0x4fdac9[_0x3f7a30['name']]={'$like':'%'+_0x4909f5['query'][_0x371e('0x39')]+'%'};return _0x4fdac9;}})});}_0x32fd80=_['merge']({},_0x32fd80,_0x4909f5[_0x371e('0x3a')]);var _0x1d46f7={'where':_0x32fd80[_0x371e('0x36')]};return db[_0x371e('0x3b')]['count'](_0x1d46f7)[_0x371e('0x21')](function(_0x5f19bb){_0x2aca12[_0x371e('0x1a')]=_0x5f19bb;if(_0x4909f5[_0x371e('0x2c')][_0x371e('0x3c')]){_0x32fd80[_0x371e('0x3d')]=[{'all':!![]}];}return db[_0x371e('0x3b')]['findAll'](_0x32fd80);})[_0x371e('0x21')](function(_0x79e837){_0x2aca12['rows']=_0x79e837;return _0x2aca12;})[_0x371e('0x21')](respondWithFilteredResult(_0x2ae3b7,_0x32fd80))[_0x371e('0x3e')](handleError(_0x2ae3b7,null));};exports['show']=function(_0x30fca1,_0x236a04){var _0x286455={'raw':![],'where':{'id':_0x30fca1['params']['id']}},_0x543a51={};_0x543a51[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x3b')][_0x371e('0x40')]);_0x543a51['query']=_[_0x371e('0x3f')](_0x30fca1[_0x371e('0x2c')]);_0x543a51[_0x371e('0x2d')]=_['intersection'](_0x543a51['model'],_0x543a51['query']);_0x286455[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x543a51['model'],qs[_0x371e('0x30')](_0x30fca1['query']['fields']));_0x286455[_0x371e('0x2f')]=_0x286455[_0x371e('0x2f')][_0x371e('0x31')]?_0x286455[_0x371e('0x2f')]:_0x543a51[_0x371e('0x2b')];if(_0x30fca1['query'][_0x371e('0x3c')]){_0x286455[_0x371e('0x3d')]=[{'all':!![]}];}_0x286455=_[_0x371e('0x37')]({},_0x286455,_0x30fca1[_0x371e('0x3a')]);return db[_0x371e('0x3b')][_0x371e('0x41')](_0x286455)['then'](handleEntityNotFound(_0x236a04,null))['then'](respondWithResult(_0x236a04,null))[_0x371e('0x3e')](handleError(_0x236a04,null));};exports[_0x371e('0x42')]=function(_0x714300,_0x391bba){return db[_0x371e('0x3b')][_0x371e('0x42')](_0x714300[_0x371e('0x43')],{})['then'](function(_0x22c37c){var _0x28fbb3=_0x714300[_0x371e('0x44')][_0x371e('0x22')]({'plain':!![]});if(!_0x28fbb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28fbb3[_0x371e('0x45')]===_0x371e('0x44')){var _0x5571eb=_0x22c37c[_0x371e('0x22')]({'plain':!![]});var _0x4c6733=_0x371e('0x23');return db[_0x371e('0x46')][_0x371e('0x41')]({'where':{'name':_0x4c6733,'userProfileId':_0x28fbb3['userProfileId']},'raw':!![]})[_0x371e('0x21')](function(_0x44a79a){if(_0x44a79a&&_0x44a79a[_0x371e('0x47')]===0x0){return db[_0x371e('0x48')]['create']({'name':_0x5571eb[_0x371e('0x26')],'resourceId':_0x5571eb['id'],'type':_0x44a79a[_0x371e('0x26')],'sectionId':_0x44a79a['id']},{})['then'](function(){return _0x22c37c;});}else{return _0x22c37c;}})['catch'](function(_0x17c4fa){logger[_0x371e('0x25')](_0x371e('0x49'),_0x17c4fa);throw _0x17c4fa;});}return _0x22c37c;})[_0x371e('0x21')](respondWithResult(_0x391bba,0xc9))[_0x371e('0x3e')](handleError(_0x391bba,null));};exports['update']=function(_0x495fcb,_0x4227d2){if(_0x495fcb[_0x371e('0x43')]['id']){delete _0x495fcb['body']['id'];}return db[_0x371e('0x3b')][_0x371e('0x41')]({'where':{'id':_0x495fcb[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x4227d2,null))[_0x371e('0x21')](saveUpdates(_0x495fcb[_0x371e('0x43')],null))[_0x371e('0x21')](respondWithResult(_0x4227d2,null))[_0x371e('0x3e')](handleError(_0x4227d2,null));};exports[_0x371e('0x24')]=function(_0x7eddcc,_0x215f66){return db[_0x371e('0x3b')]['find']({'where':{'id':_0x7eddcc[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x215f66,null))[_0x371e('0x21')](removeEntity(_0x215f66,null))[_0x371e('0x3e')](handleError(_0x215f66,null));};exports[_0x371e('0x4b')]=function(_0x420ab0,_0x1d4e2d,_0x3f3921){if(_0x420ab0[_0x371e('0x43')]['id']){delete _0x420ab0['body']['id'];}return db['Trigger'][_0x371e('0x41')]({'where':{'id':_0x420ab0['params']['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x1d4e2d,null))[_0x371e('0x21')](function(_0x232f5c){if(_0x232f5c){_0x420ab0[_0x371e('0x43')][_0x371e('0x4c')]=_0x232f5c['id'];return db[_0x371e('0x4d')]['create'](_0x420ab0['body']);}})['then'](respondWithResult(_0x1d4e2d,null))[_0x371e('0x3e')](handleError(_0x1d4e2d,null));};exports[_0x371e('0x4e')]=function(_0x108750,_0x5d4251,_0x403c34){if(_0x108750[_0x371e('0x43')]['id']){delete _0x108750[_0x371e('0x43')]['id'];}return db[_0x371e('0x3b')][_0x371e('0x41')]({'where':{'id':_0x108750[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x5d4251,null))[_0x371e('0x21')](function(_0x5ae0ea){if(_0x5ae0ea){_0x108750['body'][_0x371e('0x4f')]=_0x5ae0ea['id'];return db[_0x371e('0x4d')]['create'](_0x108750[_0x371e('0x43')]);}})[_0x371e('0x21')](respondWithResult(_0x5d4251,null))[_0x371e('0x3e')](handleError(_0x5d4251,null));};exports['getAllConditions']=function(_0x4fa71b,_0x134b28,_0x5a974a){var _0x3cf294={};var _0x1088cc={};var _0x3fb914;var _0x1d643d;return db['Trigger']['findOne']({'where':{'id':_0x4fa71b[_0x371e('0x4a')]['id']}})[_0x371e('0x21')](handleEntityNotFound(_0x134b28,null))[_0x371e('0x21')](function(_0x277a0b){if(_0x277a0b){_0x3fb914=_0x277a0b;_0x1088cc[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x4d')][_0x371e('0x40')]);_0x1088cc['query']=_[_0x371e('0x3f')](_0x4fa71b['query']);_0x1088cc['filters']=_[_0x371e('0x2e')](_0x1088cc[_0x371e('0x2b')],_0x1088cc['query']);_0x3cf294[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x1088cc[_0x371e('0x2b')],qs['fields'](_0x4fa71b[_0x371e('0x2c')][_0x371e('0x30')]));_0x3cf294[_0x371e('0x2f')]=_0x3cf294[_0x371e('0x2f')][_0x371e('0x31')]?_0x3cf294['attributes']:_0x1088cc[_0x371e('0x2b')];_0x3cf294['order']=qs[_0x371e('0x34')](_0x4fa71b[_0x371e('0x2c')]['sort']);_0x3cf294[_0x371e('0x36')]=qs[_0x371e('0x2d')](_['pick'](_0x4fa71b['query'],_0x1088cc[_0x371e('0x2d')]));if(_0x4fa71b['query'][_0x371e('0x39')]){_0x3cf294[_0x371e('0x36')]=_[_0x371e('0x37')](_0x3cf294[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x3cf294['attributes'],function(_0x4eb893){var _0x4f3377={};_0x4f3377[_0x4eb893]={'$like':'%'+_0x4fa71b[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x4f3377;})});}_0x3cf294=_[_0x371e('0x37')]({},_0x3cf294,_0x4fa71b[_0x371e('0x3a')]);return _0x3fb914[_0x371e('0x50')](_0x3cf294);}})[_0x371e('0x21')](function(_0x18b434){if(_0x18b434){_0x1d643d=_0x18b434[_0x371e('0x31')];if(!_0x4fa71b[_0x371e('0x2c')]['hasOwnProperty'](_0x371e('0x51'))){_0x3cf294[_0x371e('0x32')]=qs[_0x371e('0x32')](_0x4fa71b[_0x371e('0x2c')]['limit']);_0x3cf294[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x4fa71b['query'][_0x371e('0x1b')]);}return _0x3fb914[_0x371e('0x50')](_0x3cf294);}})[_0x371e('0x21')](function(_0x2e3f46){if(_0x2e3f46){return _0x2e3f46?{'count':_0x1d643d,'rows':_0x2e3f46}:null;}})[_0x371e('0x21')](respondWithResult(_0x134b28,null))[_0x371e('0x3e')](handleError(_0x134b28,null));};exports[_0x371e('0x52')]=function(_0x54e8e0,_0x252c84,_0x2a48b6){var _0x1aa6eb={};var _0x14c75e={};var _0x4a5755;var _0x5de311;return db[_0x371e('0x3b')][_0x371e('0x53')]({'where':{'id':_0x54e8e0[_0x371e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x252c84,null))['then'](function(_0x1ce166){if(_0x1ce166){_0x4a5755=_0x1ce166;_0x14c75e[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x4d')][_0x371e('0x40')]);_0x14c75e['query']=_[_0x371e('0x3f')](_0x54e8e0[_0x371e('0x2c')]);_0x14c75e[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x14c75e[_0x371e('0x2b')],_0x14c75e['query']);_0x1aa6eb[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x14c75e[_0x371e('0x2b')],qs[_0x371e('0x30')](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x30')]));_0x1aa6eb[_0x371e('0x2f')]=_0x1aa6eb['attributes'][_0x371e('0x31')]?_0x1aa6eb[_0x371e('0x2f')]:_0x14c75e[_0x371e('0x2b')];_0x1aa6eb[_0x371e('0x33')]=qs[_0x371e('0x34')](_0x54e8e0[_0x371e('0x2c')]['sort']);_0x1aa6eb[_0x371e('0x36')]=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x54e8e0[_0x371e('0x2c')],_0x14c75e['filters']));if(_0x54e8e0[_0x371e('0x2c')][_0x371e('0x39')]){_0x1aa6eb['where']=_[_0x371e('0x37')](_0x1aa6eb[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x1aa6eb[_0x371e('0x2f')],function(_0x3f6433){var _0x6795ab={};_0x6795ab[_0x3f6433]={'$like':'%'+_0x54e8e0[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x6795ab;})});}_0x1aa6eb=_[_0x371e('0x37')]({},_0x1aa6eb,_0x54e8e0[_0x371e('0x3a')]);return _0x4a5755['getAnyConditions'](_0x1aa6eb);}})[_0x371e('0x21')](function(_0xf7f422){if(_0xf7f422){_0x5de311=_0xf7f422['length'];if(!_0x54e8e0['query']['hasOwnProperty']('nolimit')){_0x1aa6eb['limit']=qs['limit'](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x32')]);_0x1aa6eb[_0x371e('0x1b')]=qs[_0x371e('0x1b')](_0x54e8e0[_0x371e('0x2c')][_0x371e('0x1b')]);}return _0x4a5755['getAnyConditions'](_0x1aa6eb);}})[_0x371e('0x21')](function(_0x5185e0){if(_0x5185e0){return _0x5185e0?{'count':_0x5de311,'rows':_0x5185e0}:null;}})[_0x371e('0x21')](respondWithResult(_0x252c84,null))['catch'](handleError(_0x252c84,null));};exports[_0x371e('0x54')]=function(_0x37be2a,_0x35b2b0,_0x173b52){if(_0x37be2a[_0x371e('0x43')]['id']){delete _0x37be2a[_0x371e('0x43')]['id'];}return db['Trigger'][_0x371e('0x41')]({'where':{'id':_0x37be2a[_0x371e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35b2b0,null))['then'](function(_0x4a3c06){if(_0x4a3c06){_0x37be2a[_0x371e('0x43')][_0x371e('0x55')]=_0x4a3c06['id'];return db[_0x371e('0x56')][_0x371e('0x42')](_0x37be2a[_0x371e('0x43')]);}})['then'](respondWithResult(_0x35b2b0,null))['catch'](handleError(_0x35b2b0,null));};exports[_0x371e('0x57')]=function(_0x32939a,_0x29e5d4,_0x22bc6f){var _0x49ce70={};var _0x18bc97={};var _0x326532;var _0x53f50b;return db[_0x371e('0x3b')]['findOne']({'where':{'id':_0x32939a['params']['id']}})['then'](handleEntityNotFound(_0x29e5d4,null))[_0x371e('0x21')](function(_0x152926){if(_0x152926){_0x326532=_0x152926;_0x18bc97[_0x371e('0x2b')]=_[_0x371e('0x3f')](db[_0x371e('0x56')][_0x371e('0x40')]);_0x18bc97[_0x371e('0x2c')]=_[_0x371e('0x3f')](_0x32939a['query']);_0x18bc97[_0x371e('0x2d')]=_[_0x371e('0x2e')](_0x18bc97['model'],_0x18bc97[_0x371e('0x2c')]);_0x49ce70[_0x371e('0x2f')]=_[_0x371e('0x2e')](_0x18bc97[_0x371e('0x2b')],qs['fields'](_0x32939a[_0x371e('0x2c')][_0x371e('0x30')]));_0x49ce70[_0x371e('0x2f')]=_0x49ce70['attributes'][_0x371e('0x31')]?_0x49ce70[_0x371e('0x2f')]:_0x18bc97[_0x371e('0x2b')];_0x49ce70[_0x371e('0x33')]=qs['sort'](_0x32939a[_0x371e('0x2c')][_0x371e('0x34')]);_0x49ce70[_0x371e('0x36')]=qs[_0x371e('0x2d')](_[_0x371e('0x35')](_0x32939a[_0x371e('0x2c')],_0x18bc97[_0x371e('0x2d')]));if(_0x32939a[_0x371e('0x2c')][_0x371e('0x39')]){_0x49ce70[_0x371e('0x36')]=_['merge'](_0x49ce70[_0x371e('0x36')],{'$or':_[_0x371e('0x27')](_0x49ce70[_0x371e('0x2f')],function(_0x12921c){var _0x562d3c={};_0x562d3c[_0x12921c]={'$like':'%'+_0x32939a[_0x371e('0x2c')][_0x371e('0x39')]+'%'};return _0x562d3c;})});}_0x49ce70=_[_0x371e('0x37')]({},_0x49ce70,_0x32939a['options']);return _0x326532[_0x371e('0x57')](_0x49ce70);}})[_0x371e('0x21')](function(_0x427bdf){if(_0x427bdf){_0x53f50b=_0x427bdf[_0x371e('0x31')];if(!_0x32939a[_0x371e('0x2c')]['hasOwnProperty'](_0x371e('0x51'))){_0x49ce70[_0x371e('0x32')]=qs['limit'](_0x32939a[_0x371e('0x2c')]['limit']);_0x49ce70['offset']=qs['offset'](_0x32939a['query'][_0x371e('0x1b')]);}return _0x326532['getActions'](_0x49ce70);}})['then'](function(_0x1cb71a){if(_0x1cb71a){return _0x1cb71a?{'count':_0x53f50b,'rows':_0x1cb71a}:null;}})['then'](respondWithResult(_0x29e5d4,null))['catch'](handleError(_0x29e5d4,null));}; \ No newline at end of file +var _0xeadc=['lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Trigger','include','findAll','rows','catch','show','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x471b98,_0x215d50){var _0x9492c0=function(_0x4212ca){while(--_0x4212ca){_0x471b98['push'](_0x471b98['shift']());}};_0x9492c0(++_0x215d50);}(_0xeadc,0x171));var _0xcead=function(_0x15146b,_0x5c6786){_0x15146b=_0x15146b-0x0;var _0xc0427a=_0xeadc[_0x15146b];return _0xc0427a;};'use strict';var emlformat=require(_0xcead('0x0'));var rimraf=require(_0xcead('0x1'));var zipdir=require(_0xcead('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcead('0x3'));var moment=require(_0xcead('0x4'));var BPromise=require(_0xcead('0x5'));var Mustache=require('mustache');var util=require(_0xcead('0x6'));var path=require(_0xcead('0x7'));var sox=require(_0xcead('0x8'));var csv=require(_0xcead('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcead('0xa'));var _=require(_0xcead('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcead('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcead('0x9'));var querystring=require(_0xcead('0xd'));var Papa=require(_0xcead('0xe'));var Redis=require(_0xcead('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcead('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcead('0x11'));var utils=require(_0xcead('0x12'));var config=require(_0xcead('0x13'));var licenseUtil=require(_0xcead('0x14'));var db=require(_0xcead('0x15'))['db'];function respondWithStatusCode(_0x2a20b2,_0xe2c41b){_0xe2c41b=_0xe2c41b||0xcc;return function(_0x50b307){if(_0x50b307){return _0x2a20b2['sendStatus'](_0xe2c41b);}return _0x2a20b2[_0xcead('0x16')](_0xe2c41b)['end']();};}function respondWithResult(_0x438875,_0x79b055){_0x79b055=_0x79b055||0xc8;return function(_0x51e21d){if(_0x51e21d){return _0x438875[_0xcead('0x16')](_0x79b055)[_0xcead('0x17')](_0x51e21d);}};}function respondWithFilteredResult(_0x5a0028,_0x36934e){return function(_0x788d8a){if(_0x788d8a){var _0x512014=typeof _0x36934e[_0xcead('0x18')]===_0xcead('0x19')&&typeof _0x36934e[_0xcead('0x1a')]===_0xcead('0x19');var _0xb1d37f=_0x788d8a[_0xcead('0x1b')];var _0x2c0719=_0x512014?0x0:_0x36934e[_0xcead('0x18')];var _0x161cd7=_0x512014?_0x788d8a[_0xcead('0x1b')]:_0x36934e[_0xcead('0x18')]+_0x36934e[_0xcead('0x1a')];var _0x2419ce;if(_0x161cd7>=_0xb1d37f){_0x161cd7=_0xb1d37f;_0x2419ce=0xc8;}else{_0x2419ce=0xce;}_0x5a0028['status'](_0x2419ce);return _0x5a0028[_0xcead('0x1c')](_0xcead('0x1d'),_0x2c0719+'-'+_0x161cd7+'/'+_0xb1d37f)[_0xcead('0x17')](_0x788d8a);}return null;};}function patchUpdates(_0x40b457){return function(_0x38b492){try{jsonpatch[_0xcead('0x1e')](_0x38b492,_0x40b457,!![]);}catch(_0x56081f){return BPromise['reject'](_0x56081f);}return _0x38b492[_0xcead('0x1f')]();};}function saveUpdates(_0x1a49c4,_0x452d5a){return function(_0x498983){if(_0x498983){return _0x498983['update'](_0x1a49c4)[_0xcead('0x20')](function(_0x527c9a){return _0x527c9a;});}return null;};}function removeEntity(_0x340a39,_0x483b7c){return function(_0x5b52cc){if(_0x5b52cc){return _0x5b52cc[_0xcead('0x21')]()[_0xcead('0x20')](function(){var _0x30e7c4=_0x5b52cc[_0xcead('0x22')]({'plain':!![]});var _0x5ec95f='Triggers';return db[_0xcead('0x23')]['destroy']({'where':{'type':_0x5ec95f,'resourceId':_0x30e7c4['id']}})[_0xcead('0x20')](function(){return _0x5b52cc;});})[_0xcead('0x20')](function(){_0x340a39[_0xcead('0x16')](0xcc)[_0xcead('0x24')]();});}};}function handleEntityNotFound(_0x35798b,_0x5179d8){return function(_0x343b33){if(!_0x343b33){_0x35798b[_0xcead('0x25')](0x194);}return _0x343b33;};}function handleError(_0x46cf5c,_0xe8eeeb){_0xe8eeeb=_0xe8eeeb||0x1f4;return function(_0x2b599f){logger['error'](_0x2b599f[_0xcead('0x26')]);if(_0x2b599f['name']){delete _0x2b599f[_0xcead('0x27')];}_0x46cf5c[_0xcead('0x16')](_0xe8eeeb)['send'](_0x2b599f);};}exports[_0xcead('0x28')]=function(_0x3f2a5d,_0x4e72d9){var _0x134b6e={},_0x534615={},_0x47ea09={'count':0x0,'rows':[]};var _0x4916b6=_[_0xcead('0x29')](db['Trigger'][_0xcead('0x2a')],function(_0x2d50f2){return{'name':_0x2d50f2[_0xcead('0x2b')],'type':_0x2d50f2[_0xcead('0x2c')][_0xcead('0x2d')]};});_0x534615[_0xcead('0x2e')]=_['map'](_0x4916b6,_0xcead('0x27'));_0x534615['query']=_[_0xcead('0x2f')](_0x3f2a5d['query']);_0x534615['filters']=_['intersection'](_0x534615[_0xcead('0x2e')],_0x534615['query']);_0x134b6e[_0xcead('0x30')]=_['intersection'](_0x534615[_0xcead('0x2e')],qs[_0xcead('0x31')](_0x3f2a5d[_0xcead('0x32')][_0xcead('0x31')]));_0x134b6e[_0xcead('0x30')]=_0x134b6e[_0xcead('0x30')][_0xcead('0x33')]?_0x134b6e[_0xcead('0x30')]:_0x534615['model'];if(!_0x3f2a5d['query'][_0xcead('0x34')](_0xcead('0x35'))){_0x134b6e[_0xcead('0x1a')]=qs[_0xcead('0x1a')](_0x3f2a5d['query'][_0xcead('0x1a')]);_0x134b6e[_0xcead('0x18')]=qs[_0xcead('0x18')](_0x3f2a5d[_0xcead('0x32')][_0xcead('0x18')]);}_0x134b6e[_0xcead('0x36')]=qs['sort'](_0x3f2a5d[_0xcead('0x32')][_0xcead('0x37')]);_0x134b6e[_0xcead('0x38')]=qs[_0xcead('0x39')](_[_0xcead('0x3a')](_0x3f2a5d[_0xcead('0x32')],_0x534615[_0xcead('0x39')]),_0x4916b6);if(_0x3f2a5d[_0xcead('0x32')]['filter']){_0x134b6e[_0xcead('0x38')]=_[_0xcead('0x3b')](_0x134b6e[_0xcead('0x38')],{'$or':_['map'](_0x4916b6,function(_0x14e625){if(_0x14e625[_0xcead('0x2c')]!==_0xcead('0x3c')){var _0x2d1d3f={};_0x2d1d3f[_0x14e625['name']]={'$like':'%'+_0x3f2a5d[_0xcead('0x32')][_0xcead('0x3d')]+'%'};return _0x2d1d3f;}})});}_0x134b6e=_['merge']({},_0x134b6e,_0x3f2a5d[_0xcead('0x3e')]);var _0x47988d={'where':_0x134b6e[_0xcead('0x38')]};return db[_0xcead('0x3f')][_0xcead('0x1b')](_0x47988d)[_0xcead('0x20')](function(_0x2ea06e){_0x47ea09['count']=_0x2ea06e;if(_0x3f2a5d[_0xcead('0x32')]['includeAll']){_0x134b6e[_0xcead('0x40')]=[{'all':!![]}];}return db[_0xcead('0x3f')][_0xcead('0x41')](_0x134b6e);})[_0xcead('0x20')](function(_0x12c7f0){_0x47ea09[_0xcead('0x42')]=_0x12c7f0;return _0x47ea09;})['then'](respondWithFilteredResult(_0x4e72d9,_0x134b6e))[_0xcead('0x43')](handleError(_0x4e72d9,null));};exports[_0xcead('0x44')]=function(_0x497a0d,_0x5bfba2){var _0x2bbdc9={'raw':![],'where':{'id':_0x497a0d['params']['id']}},_0x2959c3={};_0x2959c3['model']=_[_0xcead('0x2f')](db[_0xcead('0x3f')][_0xcead('0x2a')]);_0x2959c3['query']=_[_0xcead('0x2f')](_0x497a0d[_0xcead('0x32')]);_0x2959c3[_0xcead('0x39')]=_['intersection'](_0x2959c3[_0xcead('0x2e')],_0x2959c3[_0xcead('0x32')]);_0x2bbdc9[_0xcead('0x30')]=_[_0xcead('0x45')](_0x2959c3[_0xcead('0x2e')],qs[_0xcead('0x31')](_0x497a0d[_0xcead('0x32')][_0xcead('0x31')]));_0x2bbdc9['attributes']=_0x2bbdc9['attributes']['length']?_0x2bbdc9[_0xcead('0x30')]:_0x2959c3[_0xcead('0x2e')];if(_0x497a0d[_0xcead('0x32')][_0xcead('0x46')]){_0x2bbdc9[_0xcead('0x40')]=[{'all':!![]}];}_0x2bbdc9=_[_0xcead('0x3b')]({},_0x2bbdc9,_0x497a0d['options']);return db[_0xcead('0x3f')][_0xcead('0x47')](_0x2bbdc9)[_0xcead('0x20')](handleEntityNotFound(_0x5bfba2,null))[_0xcead('0x20')](respondWithResult(_0x5bfba2,null))[_0xcead('0x43')](handleError(_0x5bfba2,null));};exports['create']=function(_0x1c3b5f,_0x281ac9){return db['Trigger'][_0xcead('0x48')](_0x1c3b5f[_0xcead('0x49')],{})[_0xcead('0x20')](function(_0x4e6918){var _0x48bb81=_0x1c3b5f[_0xcead('0x4a')][_0xcead('0x22')]({'plain':!![]});if(!_0x48bb81)throw new Error(_0xcead('0x4b'));if(_0x48bb81[_0xcead('0x4c')]===_0xcead('0x4a')){var _0x4ceb5e=_0x4e6918[_0xcead('0x22')]({'plain':!![]});var _0x2faa28='Triggers';return db[_0xcead('0x4d')][_0xcead('0x47')]({'where':{'name':_0x2faa28,'userProfileId':_0x48bb81[_0xcead('0x4e')]},'raw':!![]})['then'](function(_0x3b3d18){if(_0x3b3d18&&_0x3b3d18[_0xcead('0x4f')]===0x0){return db['UserProfileResource'][_0xcead('0x48')]({'name':_0x4ceb5e['name'],'resourceId':_0x4ceb5e['id'],'type':_0x3b3d18[_0xcead('0x27')],'sectionId':_0x3b3d18['id']},{})[_0xcead('0x20')](function(){return _0x4e6918;});}else{return _0x4e6918;}})['catch'](function(_0x5f3d2c){logger[_0xcead('0x50')](_0xcead('0x51'),_0x5f3d2c);throw _0x5f3d2c;});}return _0x4e6918;})[_0xcead('0x20')](respondWithResult(_0x281ac9,0xc9))[_0xcead('0x43')](handleError(_0x281ac9,null));};exports[_0xcead('0x52')]=function(_0x46171b,_0x3d2fd4){if(_0x46171b['body']['id']){delete _0x46171b[_0xcead('0x49')]['id'];}return db[_0xcead('0x3f')][_0xcead('0x47')]({'where':{'id':_0x46171b[_0xcead('0x53')]['id']}})['then'](handleEntityNotFound(_0x3d2fd4,null))[_0xcead('0x20')](saveUpdates(_0x46171b[_0xcead('0x49')],null))[_0xcead('0x20')](respondWithResult(_0x3d2fd4,null))['catch'](handleError(_0x3d2fd4,null));};exports['destroy']=function(_0x1f126a,_0x42ae1b){return db[_0xcead('0x3f')][_0xcead('0x47')]({'where':{'id':_0x1f126a[_0xcead('0x53')]['id']}})['then'](handleEntityNotFound(_0x42ae1b,null))[_0xcead('0x20')](removeEntity(_0x42ae1b,null))[_0xcead('0x43')](handleError(_0x42ae1b,null));};exports[_0xcead('0x54')]=function(_0x1b7106,_0x29950a,_0x2c1d10){if(_0x1b7106['body']['id']){delete _0x1b7106['body']['id'];}return db[_0xcead('0x3f')][_0xcead('0x47')]({'where':{'id':_0x1b7106[_0xcead('0x53')]['id']}})[_0xcead('0x20')](handleEntityNotFound(_0x29950a,null))[_0xcead('0x20')](function(_0x57753b){if(_0x57753b){_0x1b7106[_0xcead('0x49')][_0xcead('0x55')]=_0x57753b['id'];return db[_0xcead('0x56')]['create'](_0x1b7106[_0xcead('0x49')]);}})[_0xcead('0x20')](respondWithResult(_0x29950a,null))[_0xcead('0x43')](handleError(_0x29950a,null));};exports['addAnyCondition']=function(_0x49524e,_0x575d62,_0x1ad70c){if(_0x49524e[_0xcead('0x49')]['id']){delete _0x49524e[_0xcead('0x49')]['id'];}return db['Trigger'][_0xcead('0x47')]({'where':{'id':_0x49524e['params']['id']}})['then'](handleEntityNotFound(_0x575d62,null))[_0xcead('0x20')](function(_0x495c49){if(_0x495c49){_0x49524e['body'][_0xcead('0x57')]=_0x495c49['id'];return db[_0xcead('0x56')][_0xcead('0x48')](_0x49524e[_0xcead('0x49')]);}})[_0xcead('0x20')](respondWithResult(_0x575d62,null))['catch'](handleError(_0x575d62,null));};exports[_0xcead('0x58')]=function(_0x2c12aa,_0x532f45,_0x2e0ded){var _0x341999={};var _0x49252b={};var _0x4dd62a;var _0x265703;return db[_0xcead('0x3f')][_0xcead('0x59')]({'where':{'id':_0x2c12aa[_0xcead('0x53')]['id']}})[_0xcead('0x20')](handleEntityNotFound(_0x532f45,null))[_0xcead('0x20')](function(_0x2b51db){if(_0x2b51db){_0x4dd62a=_0x2b51db;_0x49252b['model']=_[_0xcead('0x2f')](db[_0xcead('0x56')][_0xcead('0x2a')]);_0x49252b[_0xcead('0x32')]=_[_0xcead('0x2f')](_0x2c12aa['query']);_0x49252b[_0xcead('0x39')]=_[_0xcead('0x45')](_0x49252b['model'],_0x49252b[_0xcead('0x32')]);_0x341999[_0xcead('0x30')]=_[_0xcead('0x45')](_0x49252b['model'],qs[_0xcead('0x31')](_0x2c12aa[_0xcead('0x32')][_0xcead('0x31')]));_0x341999[_0xcead('0x30')]=_0x341999[_0xcead('0x30')][_0xcead('0x33')]?_0x341999[_0xcead('0x30')]:_0x49252b[_0xcead('0x2e')];_0x341999[_0xcead('0x36')]=qs[_0xcead('0x37')](_0x2c12aa['query'][_0xcead('0x37')]);_0x341999[_0xcead('0x38')]=qs[_0xcead('0x39')](_[_0xcead('0x3a')](_0x2c12aa[_0xcead('0x32')],_0x49252b[_0xcead('0x39')]));if(_0x2c12aa['query'][_0xcead('0x3d')]){_0x341999[_0xcead('0x38')]=_[_0xcead('0x3b')](_0x341999[_0xcead('0x38')],{'$or':_[_0xcead('0x29')](_0x341999[_0xcead('0x30')],function(_0xa8a607){var _0x8dc3b8={};_0x8dc3b8[_0xa8a607]={'$like':'%'+_0x2c12aa[_0xcead('0x32')][_0xcead('0x3d')]+'%'};return _0x8dc3b8;})});}_0x341999=_[_0xcead('0x3b')]({},_0x341999,_0x2c12aa[_0xcead('0x3e')]);return _0x4dd62a['getAllConditions'](_0x341999);}})[_0xcead('0x20')](function(_0x56888f){if(_0x56888f){_0x265703=_0x56888f[_0xcead('0x33')];if(!_0x2c12aa[_0xcead('0x32')][_0xcead('0x34')](_0xcead('0x35'))){_0x341999['limit']=qs[_0xcead('0x1a')](_0x2c12aa['query'][_0xcead('0x1a')]);_0x341999[_0xcead('0x18')]=qs[_0xcead('0x18')](_0x2c12aa[_0xcead('0x32')][_0xcead('0x18')]);}return _0x4dd62a[_0xcead('0x58')](_0x341999);}})[_0xcead('0x20')](function(_0x4014fe){if(_0x4014fe){return _0x4014fe?{'count':_0x265703,'rows':_0x4014fe}:null;}})[_0xcead('0x20')](respondWithResult(_0x532f45,null))[_0xcead('0x43')](handleError(_0x532f45,null));};exports[_0xcead('0x5a')]=function(_0x1e5aa9,_0x59ecfa,_0x511db3){var _0x3243c5={};var _0xd24fc9={};var _0x45a1c8;var _0x31118f;return db[_0xcead('0x3f')][_0xcead('0x59')]({'where':{'id':_0x1e5aa9['params']['id']}})['then'](handleEntityNotFound(_0x59ecfa,null))['then'](function(_0x56d188){if(_0x56d188){_0x45a1c8=_0x56d188;_0xd24fc9['model']=_[_0xcead('0x2f')](db['Condition'][_0xcead('0x2a')]);_0xd24fc9['query']=_['keys'](_0x1e5aa9[_0xcead('0x32')]);_0xd24fc9[_0xcead('0x39')]=_[_0xcead('0x45')](_0xd24fc9['model'],_0xd24fc9[_0xcead('0x32')]);_0x3243c5[_0xcead('0x30')]=_[_0xcead('0x45')](_0xd24fc9[_0xcead('0x2e')],qs['fields'](_0x1e5aa9[_0xcead('0x32')][_0xcead('0x31')]));_0x3243c5[_0xcead('0x30')]=_0x3243c5[_0xcead('0x30')][_0xcead('0x33')]?_0x3243c5[_0xcead('0x30')]:_0xd24fc9[_0xcead('0x2e')];_0x3243c5[_0xcead('0x36')]=qs['sort'](_0x1e5aa9[_0xcead('0x32')]['sort']);_0x3243c5[_0xcead('0x38')]=qs['filters'](_[_0xcead('0x3a')](_0x1e5aa9['query'],_0xd24fc9[_0xcead('0x39')]));if(_0x1e5aa9[_0xcead('0x32')][_0xcead('0x3d')]){_0x3243c5[_0xcead('0x38')]=_['merge'](_0x3243c5[_0xcead('0x38')],{'$or':_[_0xcead('0x29')](_0x3243c5[_0xcead('0x30')],function(_0x2149e5){var _0x32c661={};_0x32c661[_0x2149e5]={'$like':'%'+_0x1e5aa9['query'][_0xcead('0x3d')]+'%'};return _0x32c661;})});}_0x3243c5=_[_0xcead('0x3b')]({},_0x3243c5,_0x1e5aa9[_0xcead('0x3e')]);return _0x45a1c8['getAnyConditions'](_0x3243c5);}})[_0xcead('0x20')](function(_0x24ee18){if(_0x24ee18){_0x31118f=_0x24ee18[_0xcead('0x33')];if(!_0x1e5aa9[_0xcead('0x32')][_0xcead('0x34')]('nolimit')){_0x3243c5[_0xcead('0x1a')]=qs['limit'](_0x1e5aa9[_0xcead('0x32')][_0xcead('0x1a')]);_0x3243c5[_0xcead('0x18')]=qs[_0xcead('0x18')](_0x1e5aa9['query'][_0xcead('0x18')]);}return _0x45a1c8[_0xcead('0x5a')](_0x3243c5);}})[_0xcead('0x20')](function(_0x31125a){if(_0x31125a){return _0x31125a?{'count':_0x31118f,'rows':_0x31125a}:null;}})[_0xcead('0x20')](respondWithResult(_0x59ecfa,null))[_0xcead('0x43')](handleError(_0x59ecfa,null));};exports[_0xcead('0x5b')]=function(_0x27ec8d,_0x2421bf,_0x5b6490){if(_0x27ec8d[_0xcead('0x49')]['id']){delete _0x27ec8d[_0xcead('0x49')]['id'];}return db[_0xcead('0x3f')][_0xcead('0x47')]({'where':{'id':_0x27ec8d[_0xcead('0x53')]['id']}})[_0xcead('0x20')](handleEntityNotFound(_0x2421bf,null))[_0xcead('0x20')](function(_0x2f4318){if(_0x2f4318){_0x27ec8d[_0xcead('0x49')][_0xcead('0x5c')]=_0x2f4318['id'];return db[_0xcead('0x5d')][_0xcead('0x48')](_0x27ec8d['body']);}})[_0xcead('0x20')](respondWithResult(_0x2421bf,null))[_0xcead('0x43')](handleError(_0x2421bf,null));};exports['getActions']=function(_0x1629f9,_0x3650a5,_0x5cc61f){var _0x390673={};var _0x4a17e5={};var _0x5eeda5;var _0x44a299;return db['Trigger']['findOne']({'where':{'id':_0x1629f9[_0xcead('0x53')]['id']}})[_0xcead('0x20')](handleEntityNotFound(_0x3650a5,null))[_0xcead('0x20')](function(_0x4c3b5c){if(_0x4c3b5c){_0x5eeda5=_0x4c3b5c;_0x4a17e5[_0xcead('0x2e')]=_[_0xcead('0x2f')](db[_0xcead('0x5d')]['rawAttributes']);_0x4a17e5[_0xcead('0x32')]=_['keys'](_0x1629f9[_0xcead('0x32')]);_0x4a17e5['filters']=_[_0xcead('0x45')](_0x4a17e5['model'],_0x4a17e5['query']);_0x390673[_0xcead('0x30')]=_[_0xcead('0x45')](_0x4a17e5[_0xcead('0x2e')],qs[_0xcead('0x31')](_0x1629f9[_0xcead('0x32')]['fields']));_0x390673['attributes']=_0x390673[_0xcead('0x30')][_0xcead('0x33')]?_0x390673[_0xcead('0x30')]:_0x4a17e5[_0xcead('0x2e')];_0x390673[_0xcead('0x36')]=qs['sort'](_0x1629f9['query']['sort']);_0x390673[_0xcead('0x38')]=qs[_0xcead('0x39')](_['pick'](_0x1629f9[_0xcead('0x32')],_0x4a17e5['filters']));if(_0x1629f9['query'][_0xcead('0x3d')]){_0x390673['where']=_[_0xcead('0x3b')](_0x390673[_0xcead('0x38')],{'$or':_[_0xcead('0x29')](_0x390673[_0xcead('0x30')],function(_0x1a1f82){var _0x474027={};_0x474027[_0x1a1f82]={'$like':'%'+_0x1629f9[_0xcead('0x32')][_0xcead('0x3d')]+'%'};return _0x474027;})});}_0x390673=_[_0xcead('0x3b')]({},_0x390673,_0x1629f9[_0xcead('0x3e')]);return _0x5eeda5[_0xcead('0x5e')](_0x390673);}})[_0xcead('0x20')](function(_0x30f4cd){if(_0x30f4cd){_0x44a299=_0x30f4cd[_0xcead('0x33')];if(!_0x1629f9['query'][_0xcead('0x34')]('nolimit')){_0x390673['limit']=qs[_0xcead('0x1a')](_0x1629f9[_0xcead('0x32')][_0xcead('0x1a')]);_0x390673[_0xcead('0x18')]=qs[_0xcead('0x18')](_0x1629f9[_0xcead('0x32')][_0xcead('0x18')]);}return _0x5eeda5['getActions'](_0x390673);}})[_0xcead('0x20')](function(_0x65ca7e){if(_0x65ca7e){return _0x65ca7e?{'count':_0x44a299,'rows':_0x65ca7e}:null;}})['then'](respondWithResult(_0x3650a5,null))[_0xcead('0x43')](handleError(_0x3650a5,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d00d546..2f1cee7 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 _0x3fec=['tools_triggers','lodash','api','moment','request-promise','../../config/environment','exports','define','Trigger'];(function(_0x43cd5e,_0x305574){var _0x23b24b=function(_0x2d7a68){while(--_0x2d7a68){_0x43cd5e['push'](_0x43cd5e['shift']());}};_0x23b24b(++_0x305574);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3fe('0x1'));var moment=require(_0xc3fe('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3fe('0x4'));var attributes=require('./trigger.attributes');module[_0xc3fe('0x5')]=function(_0x327d2f,_0x22dd19){return _0x327d2f[_0xc3fe('0x6')](_0xc3fe('0x7'),attributes,{'tableName':_0xc3fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x142c=['./trigger.attributes','define','Trigger','tools_triggers','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4a88ef,_0x47b00b){var _0x223767=function(_0x2d1f2b){while(--_0x2d1f2b){_0x4a88ef['push'](_0x4a88ef['shift']());}};_0x223767(++_0x47b00b);}(_0x142c,0x86));var _0xc142=function(_0x486ea0,_0x454bcd){_0x486ea0=_0x486ea0-0x0;var _0x3a8f6c=_0x142c[_0x486ea0];return _0x3a8f6c;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var logger=require(_0xc142('0x1'))(_0xc142('0x2'));var moment=require(_0xc142('0x3'));var BPromise=require('bluebird');var rp=require(_0xc142('0x4'));var fs=require('fs');var path=require(_0xc142('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc142('0x6'));module['exports']=function(_0x4033e9,_0x53b32f){return _0x4033e9[_0xc142('0x7')](_0xc142('0x8'),attributes,{'tableName':_0xc142('0x9'),'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 e8667ae..4620c19 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 _0xb079=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','raw','options','where','attributes','limit','include','model','map','debug','catch','ShowTrigger','find','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb079,0x126));var _0x9b07=function(_0x5654ed,_0x4514fa){_0x5654ed=_0x5654ed-0x0;var _0x2331c1=_0xb079[_0x5654ed];return _0x2331c1;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var moment=require(_0x9b07('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b07('0x2'));var fs=require('fs');var Redis=require(_0x9b07('0x3'));var db=require(_0x9b07('0x4'))['db'];var utils=require(_0x9b07('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b07('0x6'));var jayson=require(_0x9b07('0x7'));var client=jayson[_0x9b07('0x8')][_0x9b07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c0b98,_0x19833b,_0x118e97){return new BPromise(function(_0x4afa44,_0x276bec){return client['request'](_0x5c0b98,_0x118e97)['then'](function(_0x3e9ee3){logger[_0x9b07('0xa')]('Trigger,\x20%s,\x20%s',_0x19833b,_0x9b07('0xb'));logger['debug'](_0x9b07('0xc'),_0x19833b,_0x9b07('0xb'),JSON[_0x9b07('0xd')](_0x3e9ee3));if(_0x3e9ee3[_0x9b07('0xe')]){if(_0x3e9ee3['error']['code']===0x1f4){logger[_0x9b07('0xe')](_0x9b07('0xf'),_0x19833b,_0x3e9ee3['error'][_0x9b07('0x10')]);return _0x276bec(_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);}logger[_0x9b07('0xe')]('Trigger,\x20%s,\x20%s',_0x19833b,_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);return _0x4afa44(_0x3e9ee3[_0x9b07('0xe')][_0x9b07('0x10')]);}else{logger[_0x9b07('0xa')](_0x9b07('0xf'),_0x19833b,_0x9b07('0xb'));_0x4afa44(_0x3e9ee3[_0x9b07('0x11')][_0x9b07('0x10')]);}})['catch'](function(_0x33a1e9){logger[_0x9b07('0xe')](_0x9b07('0xf'),_0x19833b,_0x33a1e9);_0x276bec(_0x33a1e9);});});}exports[_0x9b07('0x12')]=function(_0x329e01){var _0x48c338=this;return new Promise(function(_0x4d876e,_0x40f26b){return db[_0x9b07('0x13')][_0x9b07('0x14')]({'raw':_0x329e01['options']?_0x329e01['options'][_0x9b07('0x15')]===undefined?!![]:![]:!![],'where':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x17')]||null:null,'attributes':_0x329e01[_0x9b07('0x16')]?_0x329e01['options'][_0x9b07('0x18')]||null:null,'limit':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x19')]||null:null,'include':_0x329e01[_0x9b07('0x16')]?_0x329e01[_0x9b07('0x16')][_0x9b07('0x1a')]?_['map'](_0x329e01[_0x9b07('0x16')][_0x9b07('0x1a')],function(_0x2260ec){return{'model':db[_0x2260ec[_0x9b07('0x1b')]],'as':_0x2260ec['as'],'attributes':_0x2260ec['attributes'],'include':_0x2260ec[_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x2260ec[_0x9b07('0x1a')],function(_0x1d1d14){return{'model':db[_0x1d1d14[_0x9b07('0x1b')]],'as':_0x1d1d14['as'],'attributes':_0x1d1d14[_0x9b07('0x18')],'include':_0x1d1d14[_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x1d1d14[_0x9b07('0x1a')],function(_0x4f28f0){return{'model':db[_0x4f28f0[_0x9b07('0x1b')]],'as':_0x4f28f0['as'],'attributes':_0x4f28f0[_0x9b07('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x520354){logger[_0x9b07('0xa')]('GetTrigger',_0x329e01);logger[_0x9b07('0x1d')](_0x9b07('0x12'),_0x329e01,JSON[_0x9b07('0xd')](_0x520354));_0x4d876e(_0x520354);})[_0x9b07('0x1e')](function(_0x4e4f22){logger[_0x9b07('0xe')](_0x9b07('0x12'),_0x4e4f22[_0x9b07('0x10')],_0x329e01);_0x40f26b(_0x48c338[_0x9b07('0xe')](0x1f4,_0x4e4f22[_0x9b07('0x10')]));});});};exports[_0x9b07('0x1f')]=function(_0x4ffca7){var _0x279576=this;return new Promise(function(_0x44fff4,_0x2bfe57){return db[_0x9b07('0x13')][_0x9b07('0x20')]({'raw':_0x4ffca7[_0x9b07('0x16')]?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x15')]===undefined?!![]:![]:!![],'where':_0x4ffca7['options']?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x17')]||null:null,'attributes':_0x4ffca7['options']?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x18')]||null:null,'include':_0x4ffca7[_0x9b07('0x16')]?_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x1a')]?_[_0x9b07('0x1c')](_0x4ffca7[_0x9b07('0x16')][_0x9b07('0x1a')],function(_0x2f36ed){return{'model':db[_0x2f36ed[_0x9b07('0x1b')]],'as':_0x2f36ed['as'],'attributes':_0x2f36ed['attributes'],'include':_0x2f36ed[_0x9b07('0x1a')]?_['map'](_0x2f36ed['include'],function(_0x74aff4){return{'model':db[_0x74aff4[_0x9b07('0x1b')]],'as':_0x74aff4['as'],'attributes':_0x74aff4['attributes'],'include':_0x74aff4['include']?_[_0x9b07('0x1c')](_0x74aff4[_0x9b07('0x1a')],function(_0x5cb70b){return{'model':db[_0x5cb70b[_0x9b07('0x1b')]],'as':_0x5cb70b['as'],'attributes':_0x5cb70b[_0x9b07('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9b07('0x21')](function(_0x2e6e6e){logger[_0x9b07('0xa')](_0x9b07('0x1f'),_0x4ffca7);logger['debug'](_0x9b07('0x1f'),_0x4ffca7,JSON[_0x9b07('0xd')](_0x2e6e6e));_0x44fff4(_0x2e6e6e);})['catch'](function(_0x40a3d2){logger['error'](_0x9b07('0x1f'),_0x40a3d2['message'],_0x4ffca7);_0x2bfe57(_0x279576['error'](0x1f4,_0x40a3d2[_0x9b07('0x10')]));});});}; \ No newline at end of file +var _0x9571=['Trigger','options','raw','where','attributes','limit','map','include','model','ShowTrigger','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','GetTrigger'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x9571,0x11b));var _0x1957=function(_0x33b9ac,_0x1cd671){_0x33b9ac=_0x33b9ac-0x0;var _0x4da2a0=_0x9571[_0x33b9ac];return _0x4da2a0;};'use strict';var _=require('lodash');var util=require(_0x1957('0x0'));var moment=require(_0x1957('0x1'));var BPromise=require(_0x1957('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1957('0x3'));var db=require(_0x1957('0x4'))['db'];var utils=require(_0x1957('0x5'));var logger=require(_0x1957('0x6'))(_0x1957('0x7'));var config=require(_0x1957('0x8'));var jayson=require(_0x1957('0x9'));var client=jayson['client'][_0x1957('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7f83,_0x38ae1d,_0x53305b){return new BPromise(function(_0x1e9b78,_0x5c5297){return client['request'](_0x1b7f83,_0x53305b)[_0x1957('0xb')](function(_0x245a65){logger[_0x1957('0xc')]('Trigger,\x20%s,\x20%s',_0x38ae1d,'request\x20sent');logger[_0x1957('0xd')](_0x1957('0xe'),_0x38ae1d,_0x1957('0xf'),JSON[_0x1957('0x10')](_0x245a65));if(_0x245a65[_0x1957('0x11')]){if(_0x245a65[_0x1957('0x11')][_0x1957('0x12')]===0x1f4){logger['error'](_0x1957('0x13'),_0x38ae1d,_0x245a65[_0x1957('0x11')]['message']);return _0x5c5297(_0x245a65[_0x1957('0x11')][_0x1957('0x14')]);}logger[_0x1957('0x11')](_0x1957('0x13'),_0x38ae1d,_0x245a65[_0x1957('0x11')][_0x1957('0x14')]);return _0x1e9b78(_0x245a65[_0x1957('0x11')]['message']);}else{logger[_0x1957('0xc')]('Trigger,\x20%s,\x20%s',_0x38ae1d,_0x1957('0xf'));_0x1e9b78(_0x245a65['result'][_0x1957('0x14')]);}})[_0x1957('0x15')](function(_0x1d04fa){logger['error'](_0x1957('0x13'),_0x38ae1d,_0x1d04fa);_0x5c5297(_0x1d04fa);});});}exports[_0x1957('0x16')]=function(_0x2929ba){var _0x242474=this;return new Promise(function(_0xcfb9cc,_0x22cf26){return db[_0x1957('0x17')]['findAll']({'raw':_0x2929ba[_0x1957('0x18')]?_0x2929ba['options'][_0x1957('0x19')]===undefined?!![]:![]:!![],'where':_0x2929ba[_0x1957('0x18')]?_0x2929ba[_0x1957('0x18')][_0x1957('0x1a')]||null:null,'attributes':_0x2929ba[_0x1957('0x18')]?_0x2929ba[_0x1957('0x18')][_0x1957('0x1b')]||null:null,'limit':_0x2929ba[_0x1957('0x18')]?_0x2929ba['options'][_0x1957('0x1c')]||null:null,'include':_0x2929ba[_0x1957('0x18')]?_0x2929ba[_0x1957('0x18')]['include']?_[_0x1957('0x1d')](_0x2929ba[_0x1957('0x18')][_0x1957('0x1e')],function(_0x102887){return{'model':db[_0x102887[_0x1957('0x1f')]],'as':_0x102887['as'],'attributes':_0x102887[_0x1957('0x1b')],'include':_0x102887[_0x1957('0x1e')]?_[_0x1957('0x1d')](_0x102887[_0x1957('0x1e')],function(_0x1a1c13){return{'model':db[_0x1a1c13[_0x1957('0x1f')]],'as':_0x1a1c13['as'],'attributes':_0x1a1c13['attributes'],'include':_0x1a1c13[_0x1957('0x1e')]?_[_0x1957('0x1d')](_0x1a1c13[_0x1957('0x1e')],function(_0x26f67b){return{'model':db[_0x26f67b['model']],'as':_0x26f67b['as'],'attributes':_0x26f67b[_0x1957('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb93eba){logger[_0x1957('0xc')](_0x1957('0x16'),_0x2929ba);logger[_0x1957('0xd')](_0x1957('0x16'),_0x2929ba,JSON['stringify'](_0xb93eba));_0xcfb9cc(_0xb93eba);})['catch'](function(_0x3e0d97){logger[_0x1957('0x11')]('GetTrigger',_0x3e0d97[_0x1957('0x14')],_0x2929ba);_0x22cf26(_0x242474[_0x1957('0x11')](0x1f4,_0x3e0d97[_0x1957('0x14')]));});});};exports[_0x1957('0x20')]=function(_0xdd5325){var _0x3ea679=this;return new Promise(function(_0x54ef64,_0x1bade5){return db['Trigger'][_0x1957('0x21')]({'raw':_0xdd5325[_0x1957('0x18')]?_0xdd5325[_0x1957('0x18')][_0x1957('0x19')]===undefined?!![]:![]:!![],'where':_0xdd5325[_0x1957('0x18')]?_0xdd5325[_0x1957('0x18')][_0x1957('0x1a')]||null:null,'attributes':_0xdd5325[_0x1957('0x18')]?_0xdd5325[_0x1957('0x18')][_0x1957('0x1b')]||null:null,'include':_0xdd5325[_0x1957('0x18')]?_0xdd5325[_0x1957('0x18')][_0x1957('0x1e')]?_[_0x1957('0x1d')](_0xdd5325[_0x1957('0x18')]['include'],function(_0x85e7dd){return{'model':db[_0x85e7dd[_0x1957('0x1f')]],'as':_0x85e7dd['as'],'attributes':_0x85e7dd['attributes'],'include':_0x85e7dd['include']?_[_0x1957('0x1d')](_0x85e7dd[_0x1957('0x1e')],function(_0x35d4ad){return{'model':db[_0x35d4ad[_0x1957('0x1f')]],'as':_0x35d4ad['as'],'attributes':_0x35d4ad[_0x1957('0x1b')],'include':_0x35d4ad[_0x1957('0x1e')]?_['map'](_0x35d4ad['include'],function(_0x44c23b){return{'model':db[_0x44c23b[_0x1957('0x1f')]],'as':_0x44c23b['as'],'attributes':_0x44c23b[_0x1957('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1957('0xb')](function(_0x3e690c){logger['info'](_0x1957('0x20'),_0xdd5325);logger[_0x1957('0xd')]('ShowTrigger',_0xdd5325,JSON['stringify'](_0x3e690c));_0x54ef64(_0x3e690c);})[_0x1957('0x15')](function(_0x595933){logger[_0x1957('0x11')](_0x1957('0x20'),_0x595933[_0x1957('0x14')],_0xdd5325);_0x1bade5(_0x3ea679[_0x1957('0x11')](0x1f4,_0x595933[_0x1957('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 74653b7..a2969e2 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 _0x9b02=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','/:id','show','clone','post','put','update','delete','destroy'];(function(_0x24cf01,_0x584693){var _0x16f7b6=function(_0x43e097){while(--_0x43e097){_0x24cf01['push'](_0x24cf01['shift']());}};_0x16f7b6(++_0x584693);}(_0x9b02,0x1cf));var _0x29b0=function(_0x1e4748,_0x424633){_0x1e4748=_0x1e4748-0x0;var _0x241eab=_0x9b02[_0x1e4748];return _0x241eab;};'use strict';var multer=require(_0x29b0('0x0'));var util=require(_0x29b0('0x1'));var path=require(_0x29b0('0x2'));var timeout=require(_0x29b0('0x3'));var express=require(_0x29b0('0x4'));var router=express[_0x29b0('0x5')]();var fs_extra=require(_0x29b0('0x6'));var auth=require(_0x29b0('0x7'));var interaction=require(_0x29b0('0x8'));var config=require(_0x29b0('0x9'));var controller=require(_0x29b0('0xa'));router['get']('/',auth[_0x29b0('0xb')](),controller[_0x29b0('0xc')]);router['get'](_0x29b0('0xd'),auth[_0x29b0('0xb')](),controller[_0x29b0('0xe')]);router['post']('/:id/clone',auth[_0x29b0('0xb')](),controller[_0x29b0('0xf')]);router[_0x29b0('0x10')]('/',auth[_0x29b0('0xb')](),controller['create']);router[_0x29b0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x29b0('0x12')]);router[_0x29b0('0x13')](_0x29b0('0xd'),auth[_0x29b0('0xb')](),controller[_0x29b0('0x14')]);module[_0x29b0('0x15')]=router; \ No newline at end of file +var _0xa02a=['show','post','/:id/clone','isAuthenticated','clone','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','/:id'];(function(_0x3ddb70,_0x30661f){var _0x4adda5=function(_0x1c3e34){while(--_0x1c3e34){_0x3ddb70['push'](_0x3ddb70['shift']());}};_0x4adda5(++_0x30661f);}(_0xa02a,0x95));var _0xaa02=function(_0x214377,_0x5d8d2a){_0x214377=_0x214377-0x0;var _0x275dbd=_0xa02a[_0x214377];return _0x275dbd;};'use strict';var multer=require(_0xaa02('0x0'));var util=require(_0xaa02('0x1'));var path=require('path');var timeout=require(_0xaa02('0x2'));var express=require(_0xaa02('0x3'));var router=express['Router']();var fs_extra=require(_0xaa02('0x4'));var auth=require(_0xaa02('0x5'));var interaction=require(_0xaa02('0x6'));var config=require(_0xaa02('0x7'));var controller=require(_0xaa02('0x8'));router[_0xaa02('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaa02('0x9')](_0xaa02('0xa'),auth['isAuthenticated'](),controller[_0xaa02('0xb')]);router[_0xaa02('0xc')](_0xaa02('0xd'),auth[_0xaa02('0xe')](),controller[_0xaa02('0xf')]);router['post']('/',auth[_0xaa02('0xe')](),controller['create']);router[_0xaa02('0x10')](_0xaa02('0xa'),auth[_0xaa02('0xe')](),controller[_0xaa02('0x11')]);router['delete'](_0xaa02('0xa'),auth['isAuthenticated'](),controller[_0xaa02('0x12')]);module[_0xaa02('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 5f77d41..800f035 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 _0x096b=['user','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x200f30,_0x1c8cb1){var _0x1d4dc7=function(_0x55669e){while(--_0x55669e){_0x200f30['push'](_0x200f30['shift']());}};_0x1d4dc7(++_0x1c8cb1);}(_0x096b,0x139));var _0xb096=function(_0x1cfa55,_0x20eeb5){_0x1cfa55=_0x1cfa55-0x0;var _0x3a8424=_0x096b[_0x1cfa55];return _0x3a8424;};'use strict';var Sequelize=require(_0xb096('0x0'));module[_0xb096('0x1')]={'name':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'unique':_0xb096('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb096('0x4')]('friend',_0xb096('0x5'),'peer'),'allowNull':![],'defaultValue':_0xb096('0x6')},'context':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xb096('0x7'),'ALLOWED_PASSED_SCREEN',_0xb096('0x8'),_0xb096('0x9'),_0xb096('0xa'),'PROHIB_PASSED_SCREEN',_0xb096('0xb'),_0xb096('0xc'))},'deny':{'type':Sequelize[_0xb096('0x2')]},'permit':{'type':Sequelize[_0xb096('0x2')]},'secret':{'type':Sequelize[_0xb096('0x2')]},'md5secret':{'type':Sequelize[_0xb096('0x2')]},'remotesecret':{'type':Sequelize[_0xb096('0x2')]},'transport':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0xd'),'set':function(_0x55a2ff){this['setDataValue'](_0xb096('0xe'),_0x55a2ff?_0x55a2ff[_0xb096('0xf')](','):null);},'get':function(){return this[_0xb096('0x10')](_0xb096('0xe'))?this[_0xb096('0x10')](_0xb096('0xe'))[_0xb096('0x11')](','):null;},'comment':_0xb096('0x12')},'dtmfmode':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x13'),_0xb096('0x14'),_0xb096('0x15'),_0xb096('0x16'),'auto'),'defaultValue':_0xb096('0x13')},'directmedia':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no',_0xb096('0x18'),'update',_0xb096('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb096('0x2')]},'directmediadeny':{'type':Sequelize[_0xb096('0x2')]},'nat':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x1a'),'set':function(_0x5d2c77){this[_0xb096('0x1b')]('nat',_0x5d2c77?_0x5d2c77[_0xb096('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xb096('0x1c'))?this[_0xb096('0x10')]('nat')['split'](','):null;},'comment':_0xb096('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xb096('0x2')]},'pickupgroup':{'type':Sequelize[_0xb096('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xb096('0x2')]},'language':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb096('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x1e')},'allow':{'type':Sequelize[_0xb096('0x2')],'allowNull':![],'defaultValue':_0xb096('0x1f'),'set':function(_0x17f91e){this[_0xb096('0x1b')](_0xb096('0x20'),_0x17f91e?_0x17f91e[_0xb096('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xb096('0x10')](_0xb096('0x20'))?this[_0xb096('0x10')](_0xb096('0x20'))['split'](';'):null;},'comment':_0xb096('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xb096('0x22'),'set':function(_0x1ee508){this[_0xb096('0x1b')]('insecure',_0x1ee508?_0x1ee508[_0xb096('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xb096('0x23'))?this[_0xb096('0x10')]('insecure')[_0xb096('0x11')](','):null;},'comment':_0xb096('0x24')},'trustrpid':{'type':Sequelize[_0xb096('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x25'))},'promiscredir':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xb096('0x26')](0xb)},'setvar':{'type':Sequelize[_0xb096('0x2')]},'callerid':{'type':Sequelize[_0xb096('0x2')],'defaultValue':_0xb096('0x27')},'amaflags':{'type':Sequelize[_0xb096('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xb096('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xb096('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xb096('0x2')]},'template':{'type':Sequelize[_0xb096('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb096('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no')},'mailbox':{'type':Sequelize[_0xb096('0x2')]},'session_timers':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x29'),_0xb096('0x2a'),_0xb096('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb096('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x2c'),_0xb096('0x2d')),'defaultValue':_0xb096('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xb096('0x2')]},'regexten':{'type':Sequelize[_0xb096('0x2')]},'fromdomain':{'type':Sequelize[_0xb096('0x2')]},'fromuser':{'type':Sequelize[_0xb096('0x2')]},'port':{'type':Sequelize[_0xb096('0x26')](0x5)},'qualify':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':_0xb096('0x17')},'keepalive':{'type':Sequelize[_0xb096('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xb096('0x2')]},'rtptimeout':{'type':Sequelize[_0xb096('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb096('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no',_0xb096('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xb096('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xb096('0x2')]},'contactacl':{'type':Sequelize[_0xb096('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xb096('0x26')](0xb)},'encryption':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xb096('0x4')]('yes','no',_0xb096('0x2f'),_0xb096('0x30'))},'dtlsrekey':{'type':Sequelize[_0xb096('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb096('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xb096('0x2')]},'dtlscipher':{'type':Sequelize[_0xb096('0x2')]},'dtlscafile':{'type':Sequelize[_0xb096('0x2')]},'dtlscapath':{'type':Sequelize[_0xb096('0x2')]},'dtlssetup':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x31'),_0xb096('0x32'),_0xb096('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb096('0x2')]},'usereqphone':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xb096('0x2')]},'call_limit':{'type':Sequelize[_0xb096('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xb096('0x4')](_0xb096('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xb096('0x2')]},'mohsuggest':{'type':Sequelize[_0xb096('0x2')]},'parkinglot':{'type':Sequelize[_0xb096('0x2')]},'description':{'type':Sequelize[_0xb096('0x2')]},'host':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xb096('0x17'),'no',_0xb096('0x18'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb096('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb096('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb096('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x981c=['split','rfc2833','info','inband','auto','yes','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','update,nonat','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue'];(function(_0x52b245,_0x46c8ef){var _0x465a82=function(_0x37a99e){while(--_0x37a99e){_0x52b245['push'](_0x52b245['shift']());}};_0x465a82(++_0x46c8ef);}(_0x981c,0xfe));var _0xc981=function(_0x4051ab,_0x192ff6){_0x4051ab=_0x4051ab-0x0;var _0x5d11a9=_0x981c[_0x4051ab];return _0x5d11a9;};'use strict';var Sequelize=require(_0xc981('0x0'));module[_0xc981('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc981('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x4'),_0xc981('0x5'),_0xc981('0x6')),'allowNull':![],'defaultValue':_0xc981('0x4')},'context':{'type':Sequelize[_0xc981('0x7')],'allowNull':![],'defaultValue':_0xc981('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xc981('0x9'),_0xc981('0xa'),_0xc981('0xb'),_0xc981('0xc'),_0xc981('0xd'),_0xc981('0xe'),_0xc981('0xf'),_0xc981('0x10'))},'deny':{'type':Sequelize[_0xc981('0x7')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xc981('0x7')]},'md5secret':{'type':Sequelize[_0xc981('0x7')]},'remotesecret':{'type':Sequelize[_0xc981('0x7')]},'transport':{'type':Sequelize[_0xc981('0x7')],'defaultValue':_0xc981('0x11'),'set':function(_0xee8908){this['setDataValue'](_0xc981('0x12'),_0xee8908?_0xee8908[_0xc981('0x13')](','):null);},'get':function(){return this[_0xc981('0x14')](_0xc981('0x12'))?this[_0xc981('0x14')](_0xc981('0x12'))[_0xc981('0x15')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x16'),_0xc981('0x17'),'shortinfo',_0xc981('0x18'),_0xc981('0x19')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no','nonat','update',_0xc981('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc981('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc981('0x7')]},'directmediadeny':{'type':Sequelize[_0xc981('0x7')]},'nat':{'type':Sequelize[_0xc981('0x7')],'defaultValue':_0xc981('0x1c'),'set':function(_0x97fc14){this[_0xc981('0x1d')]('nat',_0x97fc14?_0x97fc14['join'](','):null);},'get':function(){return this['getDataValue'](_0xc981('0x1e'))?this['getDataValue'](_0xc981('0x1e'))['split'](','):null;},'comment':_0xc981('0x1f')},'callgroup':{'type':Sequelize[_0xc981('0x7')]},'namedcallgroup':{'type':Sequelize[_0xc981('0x7')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xc981('0x7')]},'language':{'type':Sequelize[_0xc981('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc981('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc981('0x7')],'defaultValue':_0xc981('0x20')},'allow':{'type':Sequelize[_0xc981('0x7')],'allowNull':![],'defaultValue':_0xc981('0x21'),'set':function(_0x256aa3){this[_0xc981('0x1d')](_0xc981('0x22'),_0x256aa3?_0x256aa3[_0xc981('0x13')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xc981('0x14')](_0xc981('0x22'))?this[_0xc981('0x14')]('allow')[_0xc981('0x15')](';'):null;},'comment':_0xc981('0x23')},'autoframing':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x5a2c48){this[_0xc981('0x1d')]('insecure',_0x5a2c48?_0x5a2c48[_0xc981('0x13')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xc981('0x14')](_0xc981('0x24'))[_0xc981('0x15')](','):null;},'comment':_0xc981('0x25')},'trustrpid':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no',_0xc981('0x26'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xc981('0x7')]},'callerid':{'type':Sequelize[_0xc981('0x7')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc981('0x7')]},'callcounter':{'type':Sequelize[_0xc981('0x3')]('yes','no'),'defaultValue':_0xc981('0x1a')},'busylevel':{'type':Sequelize[_0xc981('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xc981('0x7')]},'template':{'type':Sequelize[_0xc981('0x7')]},'videosupport':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no',_0xc981('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc981('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xc981('0x7')]},'session_timers':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x29'),_0xc981('0x2a'),_0xc981('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xc981('0x2c'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xc981('0x7')]},'fromdomain':{'type':Sequelize[_0xc981('0x7')]},'fromuser':{'type':Sequelize[_0xc981('0x7')]},'port':{'type':Sequelize[_0xc981('0x27')](0x5)},'qualify':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no'),'defaultValue':_0xc981('0x1a')},'keepalive':{'type':Sequelize[_0xc981('0x27')](0xb)},'defaultip':{'type':Sequelize[_0xc981('0x7')]},'defaultuser':{'type':Sequelize[_0xc981('0x7')]},'rtptimeout':{'type':Sequelize[_0xc981('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc981('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc981('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no',_0xc981('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc981('0x7')]},'callbackextension':{'type':Sequelize[_0xc981('0x7')]},'timert1':{'type':Sequelize[_0xc981('0x27')](0xb)},'timerb':{'type':Sequelize[_0xc981('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc981('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xc981('0x7')]},'contactdeny':{'type':Sequelize[_0xc981('0x7')]},'contactacl':{'type':Sequelize[_0xc981('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xc981('0x7')]},'use_q850_reason':{'type':Sequelize[_0xc981('0x7')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no',_0xc981('0x2e'),_0xc981('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xc981('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc981('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0xc981('0x7')]},'dtlscipher':{'type':Sequelize[_0xc981('0x7')]},'dtlscafile':{'type':Sequelize[_0xc981('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x30'),_0xc981('0x31'),_0xc981('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc981('0x7')]},'usereqphone':{'type':Sequelize[_0xc981('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc981('0x7')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xc981('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xc981('0x7')]},'parkinglot':{'type':Sequelize[_0xc981('0x7')]},'description':{'type':Sequelize[_0xc981('0x7')]},'host':{'type':Sequelize[_0xc981('0x7')],'defaultValue':_0xc981('0x33')},'canreinvite':{'type':Sequelize[_0xc981('0x3')](_0xc981('0x1a'),'no',_0xc981('0x34'),_0xc981('0x35'),_0xc981('0x36')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc981('0x7')]},'otherFields':{'type':Sequelize[_0xc981('0x7')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc981('0x7')],'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 b2a0422..0b5ace3 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 _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','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','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','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','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x4cf88d,_0x5de590){var _0x1f49c0=function(_0x3aba91){while(--_0x3aba91){_0x4cf88d['push'](_0x4cf88d['shift']());}};_0x1f49c0(++_0x5de590);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file +var _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x24dc31,_0x268d9e){var _0x17ecd5=function(_0x14b9bc){while(--_0x14b9bc){_0x24dc31['push'](_0x24dc31['shift']());}};_0x17ecd5(++_0x268d9e);}(_0x84ab,0x12f));var _0xb84a=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x84ab[_0x3b632f];return _0x10e788;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index f6a5a27..cb07512 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 _0x8fa8=['./trunk.attributes','exports','define','Trunk','lodash','util','api','bluebird','request-promise'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x8fa8,0x136));var _0x88fa=function(_0x304645,_0x17e126){_0x304645=_0x304645-0x0;var _0x375434=_0x8fa8[_0x304645];return _0x375434;};'use strict';var _=require(_0x88fa('0x0'));var util=require(_0x88fa('0x1'));var logger=require('../../config/logger')(_0x88fa('0x2'));var moment=require('moment');var BPromise=require(_0x88fa('0x3'));var rp=require(_0x88fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x88fa('0x5'));module[_0x88fa('0x6')]=function(_0x983bcb,_0x4f6f1c){return _0x983bcb[_0x88fa('0x7')](_0x88fa('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6251=['rimraf','./trunk.attributes','exports','Trunk','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6251,0x162));var _0x1625=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x6251[_0x216008];return _0x4d384f;};'use strict';var _=require('lodash');var util=require(_0x1625('0x0'));var logger=require(_0x1625('0x1'))('api');var moment=require(_0x1625('0x2'));var BPromise=require(_0x1625('0x3'));var rp=require(_0x1625('0x4'));var fs=require('fs');var path=require(_0x1625('0x5'));var rimraf=require(_0x1625('0x6'));var config=require('../../config/environment');var attributes=require(_0x1625('0x7'));module[_0x1625('0x8')]=function(_0x4cb110,_0x55696d){return _0x4cb110['define'](_0x1625('0x9'),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 3d207f7..9de2cf6 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 _0xdfea=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','options','raw','where','include','map','attributes','model','ShowTrunk','Trunk','find','lodash'];(function(_0x411867,_0x51844d){var _0x5a3daf=function(_0x45a0f7){while(--_0x45a0f7){_0x411867['push'](_0x411867['shift']());}};_0x5a3daf(++_0x51844d);}(_0xdfea,0x1cd));var _0xadfe=function(_0xdea3f8,_0x571b85){_0xdea3f8=_0xdea3f8-0x0;var _0x268fb5=_0xdfea[_0xdea3f8];return _0x268fb5;};'use strict';var _=require(_0xadfe('0x0'));var util=require(_0xadfe('0x1'));var moment=require('moment');var BPromise=require(_0xadfe('0x2'));var rs=require(_0xadfe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadfe('0x4'))['db'];var utils=require(_0xadfe('0x5'));var logger=require(_0xadfe('0x6'))(_0xadfe('0x7'));var config=require('../../config/environment');var jayson=require(_0xadfe('0x8'));var client=jayson['client'][_0xadfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d3b1,_0x253e70,_0x238db5){return new BPromise(function(_0x4ba44f,_0x2bdbf0){return client['request'](_0x15d3b1,_0x238db5)[_0xadfe('0xa')](function(_0x1863e1){logger[_0xadfe('0xb')](_0xadfe('0xc'),_0x253e70,'request\x20sent');logger[_0xadfe('0xd')](_0xadfe('0xe'),_0x253e70,_0xadfe('0xf'),JSON[_0xadfe('0x10')](_0x1863e1));if(_0x1863e1[_0xadfe('0x11')]){if(_0x1863e1['error'][_0xadfe('0x12')]===0x1f4){logger['error'](_0xadfe('0xc'),_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x2bdbf0(_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);}logger[_0xadfe('0x11')]('Trunk,\x20%s,\x20%s',_0x253e70,_0x1863e1[_0xadfe('0x11')][_0xadfe('0x13')]);return _0x4ba44f(_0x1863e1['error'][_0xadfe('0x13')]);}else{logger[_0xadfe('0xb')]('Trunk,\x20%s,\x20%s',_0x253e70,'request\x20sent');_0x4ba44f(_0x1863e1[_0xadfe('0x14')][_0xadfe('0x13')]);}})[_0xadfe('0x15')](function(_0x1fa58f){logger[_0xadfe('0x11')](_0xadfe('0xc'),_0x253e70,_0x1fa58f);_0x2bdbf0(_0x1fa58f);});});}exports[_0xadfe('0x16')]=function(_0x3f09c2){var _0x272814=this;return new Promise(function(_0x14219e,_0x338c6f){return db['Trunk']['findAll']({'raw':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x18')]===undefined?!![]:![]:!![],'where':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x19')]||null:null,'attributes':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2['options']['attributes']||null:null,'limit':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')]['limit']||null:null,'include':_0x3f09c2[_0xadfe('0x17')]?_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x3f09c2[_0xadfe('0x17')][_0xadfe('0x1a')],function(_0x176a04){return{'model':db[_0x176a04['model']],'as':_0x176a04['as'],'attributes':_0x176a04[_0xadfe('0x1c')],'include':_0x176a04['include']?_[_0xadfe('0x1b')](_0x176a04[_0xadfe('0x1a')],function(_0x1c747b){return{'model':db[_0x1c747b['model']],'as':_0x1c747b['as'],'attributes':_0x1c747b[_0xadfe('0x1c')],'include':_0x1c747b[_0xadfe('0x1a')]?_['map'](_0x1c747b['include'],function(_0x382a22){return{'model':db[_0x382a22[_0xadfe('0x1d')]],'as':_0x382a22['as'],'attributes':_0x382a22[_0xadfe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xadfe('0xa')](function(_0x41f181){logger[_0xadfe('0xb')](_0xadfe('0x16'),_0x3f09c2);logger[_0xadfe('0xd')]('GetTrunk',_0x3f09c2,JSON[_0xadfe('0x10')](_0x41f181));_0x14219e(_0x41f181);})[_0xadfe('0x15')](function(_0x52f5ed){logger['error'](_0xadfe('0x16'),_0x52f5ed[_0xadfe('0x13')],_0x3f09c2);_0x338c6f(_0x272814['error'](0x1f4,_0x52f5ed[_0xadfe('0x13')]));});});};exports[_0xadfe('0x1e')]=function(_0x51bc69){var _0x43f900=this;return new Promise(function(_0x180987,_0x2a1c49){return db[_0xadfe('0x1f')][_0xadfe('0x20')]({'raw':_0x51bc69[_0xadfe('0x17')]?_0x51bc69['options'][_0xadfe('0x18')]===undefined?!![]:![]:!![],'where':_0x51bc69[_0xadfe('0x17')]?_0x51bc69[_0xadfe('0x17')][_0xadfe('0x19')]||null:null,'attributes':_0x51bc69[_0xadfe('0x17')]?_0x51bc69[_0xadfe('0x17')]['attributes']||null:null,'include':_0x51bc69[_0xadfe('0x17')]?_0x51bc69['options'][_0xadfe('0x1a')]?_['map'](_0x51bc69[_0xadfe('0x17')]['include'],function(_0x4b4c65){return{'model':db[_0x4b4c65['model']],'as':_0x4b4c65['as'],'attributes':_0x4b4c65[_0xadfe('0x1c')],'include':_0x4b4c65[_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x4b4c65['include'],function(_0x58645b){return{'model':db[_0x58645b[_0xadfe('0x1d')]],'as':_0x58645b['as'],'attributes':_0x58645b[_0xadfe('0x1c')],'include':_0x58645b[_0xadfe('0x1a')]?_[_0xadfe('0x1b')](_0x58645b[_0xadfe('0x1a')],function(_0x535f2f){return{'model':db[_0x535f2f['model']],'as':_0x535f2f['as'],'attributes':_0x535f2f[_0xadfe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xadfe('0xa')](function(_0x300c74){logger['info'](_0xadfe('0x1e'),_0x51bc69);logger[_0xadfe('0xd')](_0xadfe('0x1e'),_0x51bc69,JSON[_0xadfe('0x10')](_0x300c74));_0x180987(_0x300c74);})[_0xadfe('0x15')](function(_0x5ca023){logger['error'](_0xadfe('0x1e'),_0x5ca023[_0xadfe('0x13')],_0x51bc69);_0x2a1c49(_0x43f900[_0xadfe('0x11')](0x1f4,_0x5ca023['message']));});});}; \ No newline at end of file +var _0x389e=['model','attributes','GetTrunk','catch','ShowTrunk','find','raw','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Trunk','findAll','options','where','limit','map','include'];(function(_0x5b7c90,_0x1d1950){var _0x5b5046=function(_0x22052c){while(--_0x22052c){_0x5b7c90['push'](_0x5b7c90['shift']());}};_0x5b5046(++_0x1d1950);}(_0x389e,0x188));var _0xe389=function(_0x14459e,_0x14bc5b){_0x14459e=_0x14459e-0x0;var _0x4fcb0e=_0x389e[_0x14459e];return _0x4fcb0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe389('0x0'));var rs=require(_0xe389('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe389('0x2'))['db'];var utils=require(_0xe389('0x3'));var logger=require(_0xe389('0x4'))(_0xe389('0x5'));var config=require(_0xe389('0x6'));var jayson=require(_0xe389('0x7'));var client=jayson[_0xe389('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c1c93,_0x43b473,_0x11c6e1){return new BPromise(function(_0x142089,_0x57e2b7){return client[_0xe389('0x9')](_0x1c1c93,_0x11c6e1)[_0xe389('0xa')](function(_0x4d7896){logger['info'](_0xe389('0xb'),_0x43b473,_0xe389('0xc'));logger[_0xe389('0xd')](_0xe389('0xe'),_0x43b473,_0xe389('0xc'),JSON[_0xe389('0xf')](_0x4d7896));if(_0x4d7896[_0xe389('0x10')]){if(_0x4d7896[_0xe389('0x10')][_0xe389('0x11')]===0x1f4){logger[_0xe389('0x10')]('Trunk,\x20%s,\x20%s',_0x43b473,_0x4d7896[_0xe389('0x10')][_0xe389('0x12')]);return _0x57e2b7(_0x4d7896[_0xe389('0x10')]['message']);}logger[_0xe389('0x10')](_0xe389('0xb'),_0x43b473,_0x4d7896[_0xe389('0x10')]['message']);return _0x142089(_0x4d7896['error'][_0xe389('0x12')]);}else{logger[_0xe389('0x13')](_0xe389('0xb'),_0x43b473,_0xe389('0xc'));_0x142089(_0x4d7896[_0xe389('0x14')][_0xe389('0x12')]);}})['catch'](function(_0x53562c){logger[_0xe389('0x10')]('Trunk,\x20%s,\x20%s',_0x43b473,_0x53562c);_0x57e2b7(_0x53562c);});});}exports['GetTrunk']=function(_0x55a1f5){var _0x245a0a=this;return new Promise(function(_0x5555c5,_0x861e38){return db[_0xe389('0x15')][_0xe389('0x16')]({'raw':_0x55a1f5[_0xe389('0x17')]?_0x55a1f5[_0xe389('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x55a1f5[_0xe389('0x17')]?_0x55a1f5['options'][_0xe389('0x18')]||null:null,'attributes':_0x55a1f5['options']?_0x55a1f5[_0xe389('0x17')]['attributes']||null:null,'limit':_0x55a1f5[_0xe389('0x17')]?_0x55a1f5[_0xe389('0x17')][_0xe389('0x19')]||null:null,'include':_0x55a1f5[_0xe389('0x17')]?_0x55a1f5[_0xe389('0x17')]['include']?_[_0xe389('0x1a')](_0x55a1f5['options'][_0xe389('0x1b')],function(_0x462a71){return{'model':db[_0x462a71[_0xe389('0x1c')]],'as':_0x462a71['as'],'attributes':_0x462a71[_0xe389('0x1d')],'include':_0x462a71[_0xe389('0x1b')]?_[_0xe389('0x1a')](_0x462a71[_0xe389('0x1b')],function(_0xe2465f){return{'model':db[_0xe2465f['model']],'as':_0xe2465f['as'],'attributes':_0xe2465f[_0xe389('0x1d')],'include':_0xe2465f[_0xe389('0x1b')]?_[_0xe389('0x1a')](_0xe2465f[_0xe389('0x1b')],function(_0x5a9ce1){return{'model':db[_0x5a9ce1[_0xe389('0x1c')]],'as':_0x5a9ce1['as'],'attributes':_0x5a9ce1['attributes']};}):[]};}):[]};}):[]:[]})[_0xe389('0xa')](function(_0x4ff6b8){logger['info'](_0xe389('0x1e'),_0x55a1f5);logger[_0xe389('0xd')]('GetTrunk',_0x55a1f5,JSON['stringify'](_0x4ff6b8));_0x5555c5(_0x4ff6b8);})[_0xe389('0x1f')](function(_0x35741e){logger[_0xe389('0x10')]('GetTrunk',_0x35741e['message'],_0x55a1f5);_0x861e38(_0x245a0a['error'](0x1f4,_0x35741e['message']));});});};exports[_0xe389('0x20')]=function(_0x5b35de){var _0x2906a0=this;return new Promise(function(_0x47e669,_0x2c12c8){return db[_0xe389('0x15')][_0xe389('0x21')]({'raw':_0x5b35de[_0xe389('0x17')]?_0x5b35de[_0xe389('0x17')][_0xe389('0x22')]===undefined?!![]:![]:!![],'where':_0x5b35de[_0xe389('0x17')]?_0x5b35de[_0xe389('0x17')]['where']||null:null,'attributes':_0x5b35de[_0xe389('0x17')]?_0x5b35de[_0xe389('0x17')][_0xe389('0x1d')]||null:null,'include':_0x5b35de['options']?_0x5b35de['options'][_0xe389('0x1b')]?_[_0xe389('0x1a')](_0x5b35de[_0xe389('0x17')][_0xe389('0x1b')],function(_0x26d920){return{'model':db[_0x26d920[_0xe389('0x1c')]],'as':_0x26d920['as'],'attributes':_0x26d920['attributes'],'include':_0x26d920[_0xe389('0x1b')]?_[_0xe389('0x1a')](_0x26d920[_0xe389('0x1b')],function(_0xf21f0c){return{'model':db[_0xf21f0c[_0xe389('0x1c')]],'as':_0xf21f0c['as'],'attributes':_0xf21f0c[_0xe389('0x1d')],'include':_0xf21f0c[_0xe389('0x1b')]?_[_0xe389('0x1a')](_0xf21f0c[_0xe389('0x1b')],function(_0x130649){return{'model':db[_0x130649[_0xe389('0x1c')]],'as':_0x130649['as'],'attributes':_0x130649[_0xe389('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe389('0xa')](function(_0x13a496){logger[_0xe389('0x13')](_0xe389('0x20'),_0x5b35de);logger[_0xe389('0xd')]('ShowTrunk',_0x5b35de,JSON[_0xe389('0xf')](_0x13a496));_0x47e669(_0x13a496);})[_0xe389('0x1f')](function(_0x4e3c18){logger['error'](_0xe389('0x20'),_0x4e3c18[_0xe389('0x12')],_0x5b35de);_0x2c12c8(_0x2906a0[_0xe389('0x10')](0x1f4,_0x4e3c18[_0xe389('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0b478b9..f736910 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 _0x7774=['logout','/:id/pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','/:id/fax_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','addContacts','post','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','addAvatar','/:id/login','login'];(function(_0x87ce2e,_0x444182){var _0x4a6659=function(_0x9180cf){while(--_0x9180cf){_0x87ce2e['push'](_0x87ce2e['shift']());}};_0x4a6659(++_0x444182);}(_0x7774,0x104));var _0x4777=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7774[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x4777('0x0'));var util=require(_0x4777('0x1'));var path=require(_0x4777('0x2'));var timeout=require('connect-timeout');var express=require(_0x4777('0x3'));var router=express['Router']();var fs_extra=require(_0x4777('0x4'));var auth=require(_0x4777('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4777('0x6'));var controller=require(_0x4777('0x7'));router[_0x4777('0x8')]('/',auth[_0x4777('0x9')](),controller[_0x4777('0xa')]);router[_0x4777('0x8')](_0x4777('0xb'),auth['isAuthenticated'](),controller[_0x4777('0xc')]);router[_0x4777('0x8')]('/whoami',auth[_0x4777('0x9')](),controller[_0x4777('0xd')]);router['get'](_0x4777('0xe'),auth[_0x4777('0x9')](),controller[_0x4777('0xf')]);router[_0x4777('0x8')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x11')]);router['get']('/:id/avatar',controller[_0x4777('0x12')]);router['get'](_0x4777('0x13'),auth[_0x4777('0x9')](),controller['getOpenTabs']);router[_0x4777('0x8')]('/:id/contacts',auth[_0x4777('0x9')](),controller[_0x4777('0x14')]);router[_0x4777('0x8')]('/:id/queues',auth[_0x4777('0x9')](),controller[_0x4777('0x15')]);router[_0x4777('0x8')](_0x4777('0x16'),auth[_0x4777('0x9')](),controller[_0x4777('0x17')]);router[_0x4777('0x8')](_0x4777('0x18'),auth[_0x4777('0x9')](),controller['getGroups']);router[_0x4777('0x8')]('/:id/recordings',auth[_0x4777('0x9')](),controller['getRecordings']);router['get'](_0x4777('0x19'),auth[_0x4777('0x9')](),controller[_0x4777('0x1a')]);router[_0x4777('0x8')](_0x4777('0x1b'),auth[_0x4777('0x9')](),controller[_0x4777('0x1c')]);router[_0x4777('0x8')](_0x4777('0x1d'),auth[_0x4777('0x9')](),controller[_0x4777('0x1e')]);router[_0x4777('0x8')]('/:id/mail/interactions',auth[_0x4777('0x9')](),controller['getMailInteractions']);router[_0x4777('0x8')]('/:id/sms/interactions',auth[_0x4777('0x9')](),controller['getSmsInteractions']);router[_0x4777('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x4777('0x1f')]);router[_0x4777('0x8')](_0x4777('0x20'),auth[_0x4777('0x9')](),controller[_0x4777('0x21')]);router[_0x4777('0x8')](_0x4777('0x22'),auth[_0x4777('0x9')](),controller['getTeams']);router[_0x4777('0x8')](_0x4777('0x23'),auth['isAuthenticated'](),controller[_0x4777('0x24')]);router['get'](_0x4777('0x25'),auth[_0x4777('0x9')](),controller[_0x4777('0x26')]);router['get'](_0x4777('0x27'),auth[_0x4777('0x9')](),controller[_0x4777('0x28')]);router[_0x4777('0x8')](_0x4777('0x29'),auth[_0x4777('0x9')](),controller[_0x4777('0x2a')]);router[_0x4777('0x8')](_0x4777('0x2b'),auth[_0x4777('0x9')](),controller[_0x4777('0x2c')]);router[_0x4777('0x8')](_0x4777('0x2d'),auth[_0x4777('0x9')](),controller[_0x4777('0x2e')]);router['get'](_0x4777('0x2f'),auth[_0x4777('0x9')](),controller[_0x4777('0x30')]);router[_0x4777('0x8')](_0x4777('0x31'),auth['isAuthenticated'](),controller[_0x4777('0x32')]);router[_0x4777('0x8')](_0x4777('0x33'),auth[_0x4777('0x9')](),controller[_0x4777('0x34')]);router['get'](_0x4777('0x35'),auth[_0x4777('0x9')](),controller[_0x4777('0x36')]);router[_0x4777('0x8')](_0x4777('0x37'),auth[_0x4777('0x9')](),controller[_0x4777('0x38')]);router[_0x4777('0x8')](_0x4777('0x39'),auth[_0x4777('0x9')](),controller[_0x4777('0x3a')]);router['post'](_0x4777('0x3b'),auth['isAuthenticated'](),controller[_0x4777('0x3c')]);router[_0x4777('0x3d')]('/',auth[_0x4777('0x9')](),controller['create']);router[_0x4777('0x3d')]('/create_many',auth[_0x4777('0x9')](),controller[_0x4777('0x3e')]);router[_0x4777('0x3d')](_0x4777('0x3f'),auth[_0x4777('0x9')](),controller[_0x4777('0x40')]);var upload=multer({'storage':multer[_0x4777('0x41')]({'destination':function(_0x19f968,_0x347e82,_0x2ac581){_0x2ac581(null,path['join'](config[_0x4777('0x42')],_0x4777('0x43')));},'filename':function(_0x9fb5e2,_0x478190,_0x236083){_0x236083(null,util[_0x4777('0x44')](_0x4777('0x45'),Date['now'](),_0x478190[_0x4777('0x46')]));}})});router[_0x4777('0x3d')](_0x4777('0x47'),upload[_0x4777('0x48')]('file'),controller[_0x4777('0x49')]);router[_0x4777('0x3d')](_0x4777('0x4a'),auth[_0x4777('0x9')](),controller[_0x4777('0x4b')]);router[_0x4777('0x3d')]('/:id/logout',auth[_0x4777('0x9')](),controller[_0x4777('0x4c')]);router[_0x4777('0x3d')](_0x4777('0x4d'),auth[_0x4777('0x9')](),controller['pause']);router[_0x4777('0x3d')](_0x4777('0x4e'),auth[_0x4777('0x9')](),controller[_0x4777('0x4f')]);router[_0x4777('0x3d')](_0x4777('0x22'),auth[_0x4777('0x9')](),controller['addTeams']);router[_0x4777('0x3d')]('/:id/chat_interactions',auth[_0x4777('0x9')](),controller[_0x4777('0x50')]);router['post'](_0x4777('0x51'),auth[_0x4777('0x9')](),controller['addMailInteractions']);router[_0x4777('0x3d')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x4777('0x52')]);router['post'](_0x4777('0x53'),auth[_0x4777('0x9')](),controller['addSmsInteractions']);router[_0x4777('0x3d')](_0x4777('0x54'),auth[_0x4777('0x9')](),controller[_0x4777('0x55')]);router[_0x4777('0x3d')](_0x4777('0x56'),auth[_0x4777('0x9')](),controller[_0x4777('0x57')]);router[_0x4777('0x3d')](_0x4777('0x29'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x4777('0x2b'),auth[_0x4777('0x9')](),controller[_0x4777('0x58')]);router[_0x4777('0x3d')](_0x4777('0x2d'),auth[_0x4777('0x9')](),controller[_0x4777('0x59')]);router[_0x4777('0x3d')](_0x4777('0x2f'),auth[_0x4777('0x9')](),controller[_0x4777('0x5a')]);router[_0x4777('0x3d')](_0x4777('0x31'),auth[_0x4777('0x9')](),controller[_0x4777('0x5b')]);router[_0x4777('0x3d')](_0x4777('0x33'),auth['isAuthenticated'](),controller[_0x4777('0x5c')]);router['post'](_0x4777('0x35'),auth['isAuthenticated'](),controller[_0x4777('0x5d')]);router[_0x4777('0x3d')](_0x4777('0x39'),auth[_0x4777('0x9')](),controller[_0x4777('0x5e')]);router[_0x4777('0x5f')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x60')]);router[_0x4777('0x5f')]('/:id/password',auth[_0x4777('0x9')](),controller[_0x4777('0x61')]);router[_0x4777('0x62')](_0x4777('0x3f'),auth['isAuthenticated'](),controller[_0x4777('0x63')]);router[_0x4777('0x62')]('/:id/teams',auth[_0x4777('0x9')](),controller['removeTeams']);router[_0x4777('0x62')](_0x4777('0x10'),auth[_0x4777('0x9')](),controller[_0x4777('0x64')]);router[_0x4777('0x62')](_0x4777('0x65'),auth[_0x4777('0x9')](),controller['removeChatInteractions']);router['delete'](_0x4777('0x51'),auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete'](_0x4777('0x66'),auth[_0x4777('0x9')](),controller['removeFaxInteractions']);router[_0x4777('0x62')](_0x4777('0x53'),auth[_0x4777('0x9')](),controller['removeSmsInteractions']);router[_0x4777('0x62')](_0x4777('0x54'),auth['isAuthenticated'](),controller[_0x4777('0x67')]);router['delete']('/:id/whatsapp_interactions',auth[_0x4777('0x9')](),controller['removeWhatsappInteractions']);router[_0x4777('0x62')](_0x4777('0x29'),auth['isAuthenticated'](),controller[_0x4777('0x68')]);router[_0x4777('0x62')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x4777('0x69')]);router[_0x4777('0x62')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x4777('0x6a')]);router[_0x4777('0x62')](_0x4777('0x2f'),auth['isAuthenticated'](),controller[_0x4777('0x6b')]);router[_0x4777('0x62')](_0x4777('0x31'),auth['isAuthenticated'](),controller[_0x4777('0x6c')]);router[_0x4777('0x62')](_0x4777('0x33'),auth[_0x4777('0x9')](),controller[_0x4777('0x6d')]);router['delete'](_0x4777('0x35'),auth[_0x4777('0x9')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller[_0x4777('0x6e')]);module[_0x4777('0x6f')]=router; \ No newline at end of file +var _0x94a0=['logout','/:id/pause','pause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','changePassword','delete','removeQueues','destroy','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','create','/create_many','bulkCreate','post','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','/:id/login','login','/:id/logout'];(function(_0x4c5613,_0x2a18f2){var _0x2689da=function(_0x52a5b9){while(--_0x52a5b9){_0x4c5613['push'](_0x4c5613['shift']());}};_0x2689da(++_0x2a18f2);}(_0x94a0,0x170));var _0x094a=function(_0x1dc130,_0x1f8090){_0x1dc130=_0x1dc130-0x0;var _0x48e316=_0x94a0[_0x1dc130];return _0x48e316;};'use strict';var multer=require(_0x094a('0x0'));var util=require(_0x094a('0x1'));var path=require(_0x094a('0x2'));var timeout=require(_0x094a('0x3'));var express=require('express');var router=express[_0x094a('0x4')]();var fs_extra=require(_0x094a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x094a('0x6'));var config=require(_0x094a('0x7'));var controller=require(_0x094a('0x8'));router[_0x094a('0x9')]('/',auth[_0x094a('0xa')](),controller[_0x094a('0xb')]);router[_0x094a('0x9')](_0x094a('0xc'),auth[_0x094a('0xa')](),controller[_0x094a('0xd')]);router[_0x094a('0x9')](_0x094a('0xe'),auth[_0x094a('0xa')](),controller['whoami']);router[_0x094a('0x9')](_0x094a('0xf'),auth['isAuthenticated'](),controller['getPresence']);router[_0x094a('0x9')](_0x094a('0x10'),auth[_0x094a('0xa')](),controller[_0x094a('0x11')]);router[_0x094a('0x9')](_0x094a('0x12'),controller['getAvatar']);router[_0x094a('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x094a('0x9')](_0x094a('0x13'),auth[_0x094a('0xa')](),controller[_0x094a('0x14')]);router[_0x094a('0x9')](_0x094a('0x15'),auth[_0x094a('0xa')](),controller['getQueues']);router[_0x094a('0x9')](_0x094a('0x16'),auth[_0x094a('0xa')](),controller[_0x094a('0x17')]);router[_0x094a('0x9')](_0x094a('0x18'),auth['isAuthenticated'](),controller[_0x094a('0x19')]);router[_0x094a('0x9')]('/:id/recordings',auth[_0x094a('0xa')](),controller['getRecordings']);router['get'](_0x094a('0x1a'),auth[_0x094a('0xa')](),controller[_0x094a('0x1b')]);router[_0x094a('0x9')](_0x094a('0x1c'),auth[_0x094a('0xa')](),controller['getChatInteractions']);router[_0x094a('0x9')](_0x094a('0x1d'),auth[_0x094a('0xa')](),controller['getOpenchannelInteractions']);router[_0x094a('0x9')](_0x094a('0x1e'),auth['isAuthenticated'](),controller[_0x094a('0x1f')]);router['get'](_0x094a('0x20'),auth['isAuthenticated'](),controller[_0x094a('0x21')]);router['get'](_0x094a('0x22'),auth[_0x094a('0xa')](),controller['getFaxInteractions']);router[_0x094a('0x9')](_0x094a('0x23'),auth[_0x094a('0xa')](),controller['getWhatsappInteractions']);router[_0x094a('0x9')]('/:id/teams',auth[_0x094a('0xa')](),controller[_0x094a('0x24')]);router[_0x094a('0x9')](_0x094a('0x25'),auth[_0x094a('0xa')](),controller[_0x094a('0x26')]);router[_0x094a('0x9')](_0x094a('0x27'),auth[_0x094a('0xa')](),controller[_0x094a('0x28')]);router[_0x094a('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x094a('0x29')]);router[_0x094a('0x9')](_0x094a('0x2a'),auth[_0x094a('0xa')](),controller['getFaxAccounts']);router[_0x094a('0x9')](_0x094a('0x2b'),auth[_0x094a('0xa')](),controller['getMailAccounts']);router[_0x094a('0x9')](_0x094a('0x2c'),auth[_0x094a('0xa')](),controller[_0x094a('0x2d')]);router['get'](_0x094a('0x2e'),auth['isAuthenticated'](),controller[_0x094a('0x2f')]);router['get'](_0x094a('0x30'),auth[_0x094a('0xa')](),controller[_0x094a('0x31')]);router[_0x094a('0x9')](_0x094a('0x32'),auth[_0x094a('0xa')](),controller['getWhatsappAccounts']);router[_0x094a('0x9')](_0x094a('0x33'),auth[_0x094a('0xa')](),controller[_0x094a('0x34')]);router[_0x094a('0x9')](_0x094a('0x35'),auth[_0x094a('0xa')](),controller[_0x094a('0x36')]);router[_0x094a('0x9')]('/:id/api_key',auth[_0x094a('0xa')](),controller['getApiKey']);router['post'](_0x094a('0x13'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0x094a('0x37')]);router['post'](_0x094a('0x38'),auth[_0x094a('0xa')](),controller[_0x094a('0x39')]);router[_0x094a('0x3a')](_0x094a('0x15'),auth[_0x094a('0xa')](),controller[_0x094a('0x3b')]);var upload=multer({'storage':multer[_0x094a('0x3c')]({'destination':function(_0x25803f,_0x4be18e,_0x4d1a7e){_0x4d1a7e(null,path[_0x094a('0x3d')](config['root'],_0x094a('0x3e')));},'filename':function(_0x57baf0,_0x3b1c0f,_0x5c3ce8){_0x5c3ce8(null,util[_0x094a('0x3f')](_0x094a('0x40'),Date[_0x094a('0x41')](),_0x3b1c0f[_0x094a('0x42')]));}})});router[_0x094a('0x3a')]('/:id/avatar',upload[_0x094a('0x43')]('file'),controller[_0x094a('0x44')]);router[_0x094a('0x3a')](_0x094a('0x45'),auth[_0x094a('0xa')](),controller[_0x094a('0x46')]);router['post'](_0x094a('0x47'),auth[_0x094a('0xa')](),controller[_0x094a('0x48')]);router[_0x094a('0x3a')](_0x094a('0x49'),auth[_0x094a('0xa')](),controller[_0x094a('0x4a')]);router[_0x094a('0x3a')]('/:id/unpause',auth[_0x094a('0xa')](),controller['unpause']);router['post'](_0x094a('0x4b'),auth[_0x094a('0xa')](),controller[_0x094a('0x4c')]);router[_0x094a('0x3a')](_0x094a('0x4d'),auth['isAuthenticated'](),controller[_0x094a('0x4e')]);router[_0x094a('0x3a')](_0x094a('0x4f'),auth[_0x094a('0xa')](),controller[_0x094a('0x50')]);router[_0x094a('0x3a')](_0x094a('0x51'),auth[_0x094a('0xa')](),controller[_0x094a('0x52')]);router[_0x094a('0x3a')](_0x094a('0x53'),auth[_0x094a('0xa')](),controller['addSmsInteractions']);router[_0x094a('0x3a')](_0x094a('0x54'),auth[_0x094a('0xa')](),controller[_0x094a('0x55')]);router[_0x094a('0x3a')](_0x094a('0x56'),auth[_0x094a('0xa')](),controller[_0x094a('0x57')]);router[_0x094a('0x3a')](_0x094a('0x2a'),auth['isAuthenticated'](),controller[_0x094a('0x58')]);router[_0x094a('0x3a')](_0x094a('0x2b'),auth[_0x094a('0xa')](),controller[_0x094a('0x59')]);router[_0x094a('0x3a')](_0x094a('0x2c'),auth[_0x094a('0xa')](),controller[_0x094a('0x5a')]);router[_0x094a('0x3a')](_0x094a('0x2e'),auth[_0x094a('0xa')](),controller[_0x094a('0x5b')]);router[_0x094a('0x3a')](_0x094a('0x30'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x094a('0x3a')](_0x094a('0x32'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x094a('0x3a')](_0x094a('0x33'),auth['isAuthenticated'](),controller[_0x094a('0x5c')]);router['post'](_0x094a('0x5d'),auth[_0x094a('0xa')](),controller[_0x094a('0x5e')]);router[_0x094a('0x5f')](_0x094a('0x10'),auth[_0x094a('0xa')](),controller[_0x094a('0x60')]);router[_0x094a('0x5f')]('/:id/password',auth['isAuthenticated'](),controller[_0x094a('0x61')]);router[_0x094a('0x62')]('/:id/queues',auth[_0x094a('0xa')](),controller[_0x094a('0x63')]);router[_0x094a('0x62')](_0x094a('0x4b'),auth[_0x094a('0xa')](),controller['removeTeams']);router[_0x094a('0x62')](_0x094a('0x10'),auth['isAuthenticated'](),controller[_0x094a('0x64')]);router[_0x094a('0x62')]('/:id/chat_interactions',auth[_0x094a('0xa')](),controller['removeChatInteractions']);router[_0x094a('0x62')](_0x094a('0x4f'),auth[_0x094a('0xa')](),controller['removeMailInteractions']);router[_0x094a('0x62')](_0x094a('0x51'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x094a('0x62')](_0x094a('0x53'),auth[_0x094a('0xa')](),controller['removeSmsInteractions']);router[_0x094a('0x62')](_0x094a('0x54'),auth[_0x094a('0xa')](),controller[_0x094a('0x65')]);router[_0x094a('0x62')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x094a('0x66')]);router[_0x094a('0x62')](_0x094a('0x2a'),auth['isAuthenticated'](),controller[_0x094a('0x67')]);router[_0x094a('0x62')](_0x094a('0x2b'),auth[_0x094a('0xa')](),controller[_0x094a('0x68')]);router[_0x094a('0x62')](_0x094a('0x2c'),auth['isAuthenticated'](),controller[_0x094a('0x69')]);router['delete']('/:id/sms_accounts',auth[_0x094a('0xa')](),controller['removeSmsAccounts']);router['delete'](_0x094a('0x30'),auth[_0x094a('0xa')](),controller['removeChatWebsites']);router[_0x094a('0x62')](_0x094a('0x32'),auth[_0x094a('0xa')](),controller[_0x094a('0x6a')]);router[_0x094a('0x62')](_0x094a('0x33'),auth[_0x094a('0xa')](),controller[_0x094a('0x6b')]);router[_0x094a('0x62')](_0x094a('0x5d'),auth[_0x094a('0xa')](),controller[_0x094a('0x6c')]);module[_0x094a('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index b35d355..db22fa1 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 _0x96fd=['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','refuse','originate','uas','fingerprint','active','passive','actpass','update','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','icesupport','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow'];(function(_0x5cfab2,_0x2b6fdd){var _0x2abcec=function(_0x563665){while(--_0x563665){_0x5cfab2['push'](_0x5cfab2['shift']());}};_0x2abcec(++_0x2b6fdd);}(_0x96fd,0x1e9));var _0xd96f=function(_0x9fe3ce,_0x24796e){_0x9fe3ce=_0x9fe3ce-0x0;var _0x7aa9a0=_0x96fd[_0x9fe3ce];return _0x7aa9a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd96f('0x0'));var util=require('util');var _=require(_0xd96f('0x1'));module[_0xd96f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd96f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x110958){this[_0xd96f('0x4')](_0xd96f('0x3'),_0x110958);this['setDataValue'](_0xd96f('0x5'),_0x110958);},'comment':_0xd96f('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xe6000a){this[_0xd96f('0x4')](_0xd96f('0x7'),_0xe6000a);this[_0xd96f('0x4')](_0xd96f('0x8'),util[_0xd96f('0x9')](_0xd96f('0xa'),_0xe6000a,this[_0xd96f('0xb')](_0xd96f('0xc'))));}},'alias':{'type':Sequelize[_0xd96f('0xd')]},'email':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'unique':_0xd96f('0xe'),'validate':{'isEmail':!![]},'set':function(_0x37ac24){if(_0x37ac24){this[_0xd96f('0x4')](_0xd96f('0xe'),_0x37ac24[_0xd96f('0xf')]());}}},'role':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x11'),'user','agent',_0xd96f('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':![],'unique':_0xd96f('0xc'),'set':function(_0xbbff79){this[_0xd96f('0x4')](_0xd96f('0xc'),_0xbbff79);this[_0xd96f('0x4')](_0xd96f('0x14'),_0xbbff79);this[_0xd96f('0x4')](_0xd96f('0x8'),util[_0xd96f('0x9')]('\x22%s\x22\x20<%s>',this[_0xd96f('0xb')](_0xd96f('0x7')),_0xbbff79));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd96f('0xd')]},'mobile':{'type':Sequelize[_0xd96f('0xd')]},'address':{'type':Sequelize[_0xd96f('0xd')]},'zipcode':{'type':Sequelize[_0xd96f('0xd')]},'userpic':{'type':Sequelize[_0xd96f('0xd')]},'city':{'type':Sequelize[_0xd96f('0xd')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd96f('0x16')]},'voicePause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':_0xd96f('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd96f('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'host':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'port':{'type':Sequelize[_0xd96f('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x18'),_0xd96f('0x19'),_0xd96f('0x1a')),'allowNull':!![],'defaultValue':_0xd96f('0x18')},'context':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':_0xd96f('0x1b')},'callingpres':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x1c'),_0xd96f('0x1d'),_0xd96f('0x1e'),_0xd96f('0x1f'),_0xd96f('0x20'),'PROHIB_PASSED_SCREEN',_0xd96f('0x21'),_0xd96f('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd96f('0x23'),'set':function(_0x5cea25){this[_0xd96f('0x4')]('transport',_0x5cea25?_0x5cea25[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x25'))?this[_0xd96f('0xb')](_0xd96f('0x25'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x27')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xd96f('0x28'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':_0xd96f('0x29')},'directmedia':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x2b'),'update',_0xd96f('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':_0xd96f('0x2d'),'set':function(_0x301bdb){this[_0xd96f('0x4')](_0xd96f('0x2e'),_0x301bdb?_0x301bdb[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')]('nat')?this[_0xd96f('0xb')](_0xd96f('0x2e'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd96f('0xd')]},'pickupgroup':{'type':Sequelize[_0xd96f('0xd')]},'namedpickupgroup':{'type':Sequelize[_0xd96f('0xd')]},'language':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd96f('0x30')},'allow':{'type':Sequelize[_0xd96f('0xd')],'allowNull':![],'defaultValue':_0xd96f('0x31'),'set':function(_0x4621e1){this['setDataValue'](_0xd96f('0x32'),_0x4621e1?_0x4621e1[_0xd96f('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x32'))?this[_0xd96f('0xb')](_0xd96f('0x32'))['split'](';'):null;},'comment':_0xd96f('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'set':function(_0x3ced69){this[_0xd96f('0x4')]('insecure',_0x3ced69?_0x3ced69[_0xd96f('0x24')](','):null);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x34'))?this[_0xd96f('0xb')](_0xd96f('0x34'))[_0xd96f('0x26')](','):null;},'comment':_0xd96f('0x35')},'trustrpid':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0xd96f('0x2a')},'busylevel':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'template':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no',_0xd96f('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd96f('0x10')]('accept',_0xd96f('0x38'),_0xd96f('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd96f('0x10')]('uac',_0xd96f('0x3a')),'allowNull':!![],'defaultValue':_0xd96f('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xd96f('0x2a')},'keepalive':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd96f('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd96f('0x10')]('yes','no',_0xd96f('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x3c'),_0xd96f('0x3d'),_0xd96f('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd96f('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd96f('0x10')](_0xd96f('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd96f('0x10')]('yes','no',_0xd96f('0x2b'),_0xd96f('0x3f'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd96f('0xd')]},'resetPasswordExpires':{'type':Sequelize[_0xd96f('0x16')]},'passwordResetAt':{'type':Sequelize[_0xd96f('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd96f('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3896de){this['setDataValue'](_0xd96f('0x41'),_0x3896de);var _0x2f1f67=this[_0xd96f('0x42')]({'plain':!![]});switch(_0x3896de){case 0x0:case 0x1:var _0x53c62b=_0x2f1f67[_0xd96f('0x25')]?_[_0xd96f('0x43')](_0x2f1f67[_0xd96f('0x25')])?_0x2f1f67[_0xd96f('0x25')][_0xd96f('0x24')]():_0x2f1f67[_0xd96f('0x25')]:_0xd96f('0x23');if(_0x53c62b===_0xd96f('0x44')){_0x53c62b=_0xd96f('0x23');}this[_0xd96f('0x4')](_0xd96f('0x25'),_0x53c62b);this[_0xd96f('0x4')](_0xd96f('0x45'),'no');this[_0xd96f('0x4')](_0xd96f('0x46'),null);this[_0xd96f('0x4')](_0xd96f('0x47'),null);this['setDataValue']('icesupport',null);this[_0xd96f('0x4')](_0xd96f('0x48'),null);this[_0xd96f('0x4')](_0xd96f('0x49'),null);this[_0xd96f('0x4')]('dtlssetup',null);this[_0xd96f('0x4')]('dtlscertfile',null);this['setDataValue'](_0xd96f('0x4a'),null);this[_0xd96f('0x4')](_0xd96f('0x4b'),'no');break;case 0x2:this[_0xd96f('0x4')]('transport',_0xd96f('0x44'));this['setDataValue']('encryption',_0xd96f('0x2a'));this['setDataValue']('avpf','yes');this[_0xd96f('0x4')](_0xd96f('0x47'),'yes');this[_0xd96f('0x4')](_0xd96f('0x4c'),_0xd96f('0x2a'));this[_0xd96f('0x4')](_0xd96f('0x48'),_0xd96f('0x2a'));this[_0xd96f('0x4')](_0xd96f('0x49'),'no');this[_0xd96f('0x4')]('dtlssetup','actpass');this[_0xd96f('0x4')](_0xd96f('0x4d'),_0x2f1f67[_0xd96f('0x4d')]||_0xd96f('0x4e'));this[_0xd96f('0x4')](_0xd96f('0x4a'),_0x2f1f67[_0xd96f('0x4a')]||_0xd96f('0x4f'));this[_0xd96f('0x4')](_0xd96f('0x4b'),_0xd96f('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xd96f('0x40')],'set':function(_0x36852f){this[_0xd96f('0x4')]('permissions',_0x36852f?_0x36852f[_0xd96f('0x24')](','):[]);},'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x50'))?_[_0xd96f('0x51')](this[_0xd96f('0xb')](_0xd96f('0x50'))['split'](','),function(_0x19e272){return parseInt(_0x19e272,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarUnconditional':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xd96f('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd96f('0xd')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd96f('0x52')],'get':function(){return this[_0xd96f('0xb')](_0xd96f('0x53'))?this[_0xd96f('0xb')](_0xd96f('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd96f('0xd')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd96f('0xd')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x398c07){if(typeof _0x398c07==='string'){var _0x1ef7fb=_0x398c07==='1'?!![]:_0x398c07==='0'?![]:_0x398c07==='true'?!![]:_0x398c07===_0xd96f('0x54')?![]:![];this[_0xd96f('0x4')](_0xd96f('0x55'),_0x1ef7fb);}else{this[_0xd96f('0x4')](_0xd96f('0x55'),_0x398c07);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3798fe){this[_0xd96f('0x4')](_0xd96f('0x56'),_0x3798fe);if(_0x3798fe===!![]){this[_0xd96f('0x4')](_0xd96f('0x57'),moment());this[_0xd96f('0x4')](_0xd96f('0x58'),0x0);}else{this[_0xd96f('0x4')](_0xd96f('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xd96f('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd96f('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd96f('0x13')](0x5)[_0xd96f('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd96f('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc7b3=['avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','format','BOOLEAN','DATE','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','rfc2833','yes','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','split','insecure','never','\x22\x22\x20<>','accept','originate','uac','uas','fingerprint','active','actpass','nonat','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux'];(function(_0x5261b4,_0x4018ee){var _0xabae71=function(_0xd74a1c){while(--_0xd74a1c){_0x5261b4['push'](_0x5261b4['shift']());}};_0xabae71(++_0x4018ee);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc7b3[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0x3c7b('0x0'));var moment=require(_0x3c7b('0x1'));var util=require('util');var _=require(_0x3c7b('0x2'));module[_0x3c7b('0x3')]={'name':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':![],'unique':_0x3c7b('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x194271){this[_0x3c7b('0x6')]('name',_0x194271);this[_0x3c7b('0x6')](_0x3c7b('0x7'),_0x194271);},'comment':_0x3c7b('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x314af1){this[_0x3c7b('0x6')]('fullname',_0x314af1);this[_0x3c7b('0x6')](_0x3c7b('0x9'),util['format'](_0x3c7b('0xa'),_0x314af1,this[_0x3c7b('0xb')](_0x3c7b('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x86188c){if(_0x86188c){this[_0x3c7b('0x6')]('email',_0x86188c[_0x3c7b('0xd')]());}}},'role':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0xf'),_0x3c7b('0x10'),_0x3c7b('0x11'),_0x3c7b('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':![],'unique':_0x3c7b('0xc'),'set':function(_0x187049){this[_0x3c7b('0x6')](_0x3c7b('0xc'),_0x187049);this[_0x3c7b('0x6')](_0x3c7b('0x14'),_0x187049);this[_0x3c7b('0x6')](_0x3c7b('0x9'),util[_0x3c7b('0x15')](_0x3c7b('0xa'),this[_0x3c7b('0xb')]('fullname'),_0x187049));}},'salt':{'type':Sequelize[_0x3c7b('0x4')]},'phone':{'type':Sequelize[_0x3c7b('0x4')]},'mobile':{'type':Sequelize[_0x3c7b('0x4')]},'address':{'type':Sequelize[_0x3c7b('0x4')]},'zipcode':{'type':Sequelize[_0x3c7b('0x4')]},'userpic':{'type':Sequelize[_0x3c7b('0x4')]},'city':{'type':Sequelize[_0x3c7b('0x4')]},'country':{'type':Sequelize[_0x3c7b('0x4')]},'online':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3c7b('0x17')]},'voicePause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x3c7b('0x17')]},'chatCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3c7b('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x3c7b('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x3c7b('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x18'),'user','peer'),'allowNull':!![],'defaultValue':_0x3c7b('0x18')},'context':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'defaultValue':_0x3c7b('0x19')},'callingpres':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x1a'),_0x3c7b('0x1b'),_0x3c7b('0x1c'),_0x3c7b('0x1d'),'PROHIB_NOT_SCREENED',_0x3c7b('0x1e'),_0x3c7b('0x1f'),_0x3c7b('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'defaultValue':_0x3c7b('0x21'),'set':function(_0x27021d){this['setDataValue'](_0x3c7b('0x22'),_0x27021d?_0x27021d[_0x3c7b('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x3c7b('0x22'))?this[_0x3c7b('0xb')](_0x3c7b('0x22'))['split'](','):null;},'comment':_0x3c7b('0x24')},'dtmfmode':{'type':Sequelize[_0x3c7b('0xe')]('rfc2833','info',_0x3c7b('0x25'),_0x3c7b('0x26'),'auto'),'allowNull':!![],'defaultValue':_0x3c7b('0x27')},'directmedia':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no','nonat',_0x3c7b('0x29'),_0x3c7b('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'defaultValue':_0x3c7b('0x2b'),'set':function(_0x18f250){this[_0x3c7b('0x6')](_0x3c7b('0x2c'),_0x18f250?_0x18f250['join'](','):null);},'get':function(){return this[_0x3c7b('0xb')](_0x3c7b('0x2c'))?this[_0x3c7b('0xb')](_0x3c7b('0x2c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3c7b('0x4')]},'namedcallgroup':{'type':Sequelize[_0x3c7b('0x4')]},'pickupgroup':{'type':Sequelize[_0x3c7b('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x3c7b('0x4')]},'language':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3c7b('0x4')]},'disallow':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':![],'defaultValue':_0x3c7b('0x2d')},'allow':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':![],'defaultValue':_0x3c7b('0x2e'),'set':function(_0x324898){this['setDataValue'](_0x3c7b('0x2f'),_0x324898?_0x324898[_0x3c7b('0x23')](';'):_0x3c7b('0x2e'));},'get':function(){return this['getDataValue'](_0x3c7b('0x2f'))?this[_0x3c7b('0xb')](_0x3c7b('0x2f'))[_0x3c7b('0x30')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'set':function(_0x4697bf){this[_0x3c7b('0x6')](_0x3c7b('0x31'),_0x4697bf?_0x4697bf['join'](','):null);},'get':function(){return this[_0x3c7b('0xb')](_0x3c7b('0x31'))?this[_0x3c7b('0xb')](_0x3c7b('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3c7b('0xe')]('yes','no',_0x3c7b('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x3c7b('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![],'defaultValue':_0x3c7b('0x33')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x3c7b('0x28')},'busylevel':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x3c7b('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x34'),'refuse',_0x3c7b('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x36'),_0x3c7b('0x37')),'allowNull':!![],'defaultValue':_0x3c7b('0x37')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x3c7b('0x28')},'keepalive':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x3c7b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no',_0x3c7b('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x39'),'passive',_0x3c7b('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x3c7b('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3c7b('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no',_0x3c7b('0x3b'),_0x3c7b('0x29'),_0x3c7b('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3c7b('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x3c7b('0x17')]},'passwordResetAt':{'type':Sequelize[_0x3c7b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x3c7b('0x3d')]},'showWebBar':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0,'set':function(_0x106bad){this[_0x3c7b('0x6')](_0x3c7b('0x3e'),_0x106bad);var _0x92b8b8=this[_0x3c7b('0x3f')]({'plain':!![]});switch(_0x106bad){case 0x0:case 0x1:var _0x2ec70b=_0x92b8b8[_0x3c7b('0x22')]?_[_0x3c7b('0x40')](_0x92b8b8[_0x3c7b('0x22')])?_0x92b8b8[_0x3c7b('0x22')][_0x3c7b('0x23')]():_0x92b8b8[_0x3c7b('0x22')]:_0x3c7b('0x21');if(_0x2ec70b===_0x3c7b('0x41')){_0x2ec70b=_0x3c7b('0x21');}this['setDataValue'](_0x3c7b('0x22'),_0x2ec70b);this[_0x3c7b('0x6')](_0x3c7b('0x42'),'no');this[_0x3c7b('0x6')]('avpf',null);this[_0x3c7b('0x6')](_0x3c7b('0x43'),null);this[_0x3c7b('0x6')](_0x3c7b('0x44'),null);this['setDataValue'](_0x3c7b('0x45'),null);this[_0x3c7b('0x6')](_0x3c7b('0x46'),null);this['setDataValue'](_0x3c7b('0x47'),null);this[_0x3c7b('0x6')](_0x3c7b('0x48'),null);this[_0x3c7b('0x6')]('dtlsprivatekey',null);this[_0x3c7b('0x6')](_0x3c7b('0x49'),'no');break;case 0x2:this[_0x3c7b('0x6')](_0x3c7b('0x22'),'wss');this['setDataValue'](_0x3c7b('0x42'),_0x3c7b('0x28'));this[_0x3c7b('0x6')](_0x3c7b('0x4a'),_0x3c7b('0x28'));this[_0x3c7b('0x6')]('force_avp',_0x3c7b('0x28'));this['setDataValue'](_0x3c7b('0x44'),_0x3c7b('0x28'));this['setDataValue'](_0x3c7b('0x45'),'yes');this[_0x3c7b('0x6')](_0x3c7b('0x46'),'no');this[_0x3c7b('0x6')]('dtlssetup',_0x3c7b('0x3a'));this['setDataValue'](_0x3c7b('0x48'),_0x92b8b8[_0x3c7b('0x48')]||_0x3c7b('0x4b'));this[_0x3c7b('0x6')](_0x3c7b('0x4c'),_0x92b8b8[_0x3c7b('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0x3c7b('0x6')](_0x3c7b('0x49'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x3c7b('0x3d')],'set':function(_0x2d6400){this[_0x3c7b('0x6')](_0x3c7b('0x4d'),_0x2d6400?_0x2d6400[_0x3c7b('0x23')](','):[]);},'get':function(){return this[_0x3c7b('0xb')](_0x3c7b('0x4d'))?_[_0x3c7b('0x4e')](this[_0x3c7b('0xb')](_0x3c7b('0x4d'))[_0x3c7b('0x30')](','),function(_0x49e506){return parseInt(_0x49e506,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3c7b('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3c7b('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x3c7b('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3c7b('0xe')](_0x3c7b('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3c7b('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3c7b('0x4f')],'get':function(){return this['getDataValue'](_0x3c7b('0x50'))?this[_0x3c7b('0xb')](_0x3c7b('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3c7b('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![],'set':function(_0x5abde5){if(typeof _0x5abde5===_0x3c7b('0x51')){var _0x49a4ee=_0x5abde5==='1'?!![]:_0x5abde5==='0'?![]:_0x5abde5===_0x3c7b('0x52')?!![]:_0x5abde5===_0x3c7b('0x53')?![]:![];this['setDataValue'](_0x3c7b('0x54'),_0x49a4ee);}else{this['setDataValue'](_0x3c7b('0x54'),_0x5abde5);}}},'blocked':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![],'set':function(_0x25d056){this['setDataValue'](_0x3c7b('0x55'),_0x25d056);if(_0x25d056===!![]){this[_0x3c7b('0x6')](_0x3c7b('0x56'),moment());this[_0x3c7b('0x6')]('loginAttempts',0x0);}else{this[_0x3c7b('0x6')](_0x3c7b('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x3c7b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x3c7b('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3c7b('0x13')](0x5)[_0x3c7b('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3c7b('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 569267e..2c1be18 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 _0x4137=['add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','SIP/%s','voicePause','Unknown\x20channel','remove','isArray','Queue:remove','emit','addAvatar','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','where','pick','merge','options','CmList','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','sort','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','format','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','UserVoiceQueueRt','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','pauseType','manual','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Voice','Whatsapp','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','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','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$or','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','CmHopper','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','getPresence','queues','teams','inbound','lower','col','asc','desc','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','voiceStatus','slice','charAt','toUpperCase','SELECT','select','ui.','InteractionId','field','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','defaults','redis','client','http','request','then','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','role','admin','Users','user','Agents','Telephones','telephone','filter','ignore','value','includes','name','UserProfileResource','end','stack','send','User','rawAttributes','map','fieldName','type','key','getOptions','query','includeAll','include','attributes','push','findAll','rows','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','differenceBy','password','salt','keys','filters','intersection','model','fields','find','update','body','params','describe','addContacts','ids','omit','catch','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','VoiceMail','fullname','agent','permissions','101','102','103','113','110','104','105','106','107','109','100','111','114','115','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','each','isEmpty','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','isValidChannel'];(function(_0x44bccb,_0x36c19e){var _0x401284=function(_0x2581d8){while(--_0x2581d8){_0x44bccb['push'](_0x44bccb['shift']());}};_0x401284(++_0x36c19e);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x7413('0x0'));var BPromise=require(_0x7413('0x1'));var util=require(_0x7413('0x2'));var path=require(_0x7413('0x3'));var fs=require('fs');var _=require(_0x7413('0x4'));var squel=require(_0x7413('0x5'));var jayson=require(_0x7413('0x6'));var Redis=require(_0x7413('0x7'));var authService=require(_0x7413('0x8'));var qs=require(_0x7413('0x9'));var logger=require(_0x7413('0xa'))(_0x7413('0xb'));var utils=require('../../config/utils');var config=require(_0x7413('0xc'));var licenseUtil=require(_0x7413('0xd'));var db=require(_0x7413('0xe'))['db'];var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);config['redis']=_[_0x7413('0x12')](config[_0x7413('0x13')],{'host':'localhost','port':0x18eb});var client=jayson[_0x7413('0x14')][_0x7413('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x737ab4,_0x3e026b,_0x14212d,_0x5a1e62){return new BPromise(function(_0xa25d72,_0x32034c){var _0x4bf07d=_0x5a1e62||client;return _0x4bf07d[_0x7413('0x16')](_0x737ab4,_0x14212d)[_0x7413('0x17')](function(_0x13e6bd){logger['info']('User,\x20%s,\x20%s',_0x3e026b,'request\x20sent');logger[_0x7413('0x18')](_0x7413('0x19'),_0x3e026b,'request\x20sent',JSON[_0x7413('0x1a')](_0x13e6bd));if(_0x13e6bd[_0x7413('0x1b')]){if(_0x13e6bd['error'][_0x7413('0x1c')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x3e026b,_0x13e6bd[_0x7413('0x1b')]['message']);return _0x32034c(_0x13e6bd[_0x7413('0x1b')]['message']);}logger[_0x7413('0x1b')](_0x7413('0x1d'),_0x3e026b,_0x13e6bd[_0x7413('0x1b')][_0x7413('0x1e')]);return _0xa25d72(_0x13e6bd[_0x7413('0x1b')][_0x7413('0x1e')]);}else{logger['info'](_0x7413('0x1d'),_0x3e026b,_0x7413('0x1f'));_0xa25d72(_0x13e6bd[_0x7413('0x20')][_0x7413('0x1e')]);}})['catch'](function(_0x239d0e){logger[_0x7413('0x1b')](_0x7413('0x1d'),_0x3e026b,_0x239d0e);_0x32034c(_0x239d0e);});});}function respondWithStatusCode(_0x20d3d2,_0x409392){_0x409392=_0x409392||0xcc;return function(_0x2d220f){if(_0x2d220f){return _0x20d3d2[_0x7413('0x21')](_0x409392);}return _0x20d3d2[_0x7413('0x22')](_0x409392)['end']();};}function respondWithResult(_0x5f12a2,_0x138508){_0x138508=_0x138508||0xc8;return function(_0x599654){if(_0x599654){return _0x5f12a2[_0x7413('0x22')](_0x138508)[_0x7413('0x23')](_0x599654);}};}function respondWithFilteredResult(_0x3b0c81,_0x2fc0f4){return function(_0x1d46e9){if(_0x1d46e9){var _0x346ce8=typeof _0x2fc0f4[_0x7413('0x24')]===_0x7413('0x25')&&typeof _0x2fc0f4[_0x7413('0x26')]==='undefined';var _0x5cb15f=_0x1d46e9[_0x7413('0x27')];var _0x48c2dc=_0x346ce8?0x0:_0x2fc0f4[_0x7413('0x24')];var _0x71cbb4=_0x346ce8?_0x1d46e9[_0x7413('0x27')]:_0x2fc0f4['offset']+_0x2fc0f4[_0x7413('0x26')];var _0x896552;if(_0x71cbb4>=_0x5cb15f){_0x71cbb4=_0x5cb15f;_0x896552=0xc8;}else{_0x896552=0xce;}_0x3b0c81[_0x7413('0x22')](_0x896552);return _0x3b0c81[_0x7413('0x28')](_0x7413('0x29'),_0x48c2dc+'-'+_0x71cbb4+'/'+_0x5cb15f)[_0x7413('0x23')](_0x1d46e9);}return null;};}function saveUpdates(_0x5eb4d9){return function(_0x24dce7){if(_0x24dce7){return _0x24dce7['update'](_0x5eb4d9)[_0x7413('0x17')](function(_0x23e682){return _0x23e682;});}return null;};}function removeEntity(_0xae2969){return function(_0x13a836){if(_0x13a836){return _0x13a836[_0x7413('0x2a')]()[_0x7413('0x17')](function(){var _0x5bb3ea=_0x13a836[_0x7413('0x2b')]({'plain':!![]});if(_0x5bb3ea[_0x7413('0x2c')]===_0x7413('0x2d'))return;var _0x31ae6a=[{'name':_0x7413('0x2e'),'value':_0x7413('0x2f'),'ignore':!![]},{'name':_0x7413('0x30'),'value':'agent','ignore':![]},{'name':_0x7413('0x31'),'value':_0x7413('0x32'),'ignore':![]}];var _0x41c7db=_(_0x31ae6a)[_0x7413('0x33')](_0x7413('0x34'))['map'](_0x7413('0x35'))['value']();if(_[_0x7413('0x36')](_0x41c7db,_0x5bb3ea[_0x7413('0x2c')])){return;}var _0x1cc4d8=_['find'](_0x31ae6a,[_0x7413('0x35'),_0x5bb3ea['role']])[_0x7413('0x37')];return db[_0x7413('0x38')]['destroy']({'where':{'type':_0x1cc4d8,'resourceId':_0x5bb3ea['id']}})['then'](function(){return _0x13a836;});})[_0x7413('0x17')](function(){_0xae2969[_0x7413('0x22')](0xcc)[_0x7413('0x39')]();});}};}function handleEntityNotFound(_0x513334){return function(_0x4dd1ce){if(!_0x4dd1ce){_0x513334[_0x7413('0x21')](0x194);}return _0x4dd1ce;};}function handleError(_0x5a92ab,_0x50aa24){_0x50aa24=_0x50aa24||0x1f4;return function(_0xda3035){logger['error'](_0xda3035[_0x7413('0x3a')]);if(_0xda3035[_0x7413('0x37')]){delete _0xda3035[_0x7413('0x37')];}_0x5a92ab[_0x7413('0x22')](_0x50aa24)[_0x7413('0x3b')](_0xda3035);};}exports['index']=function(_0xa58bd2,_0x8dc047){var _0x44e8b5={},_0xfa34ef={'count':0x0,'rows':[]};var _0x245777=_(db[_0x7413('0x3c')][_0x7413('0x3d')])[_0x7413('0x3e')](function(_0x5993d){return{'name':_0x5993d[_0x7413('0x3f')],'type':_0x5993d[_0x7413('0x40')][_0x7413('0x41')]};})['filter'](function(_0x31f8){return!_['includes'](['password','salt'],_0x31f8['name']);})['value']();_0x44e8b5=qs[_0x7413('0x42')](_0x245777,_0xa58bd2);var _0x4c1770={'where':_0x44e8b5['where']};return db[_0x7413('0x3c')]['count'](_0x4c1770)['then'](function(_0x3d92ec){_0xfa34ef[_0x7413('0x27')]=_0x3d92ec;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x44')]){_0x44e8b5[_0x7413('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x44e8b5[_0x7413('0x46')],'id')){_0x44e8b5['attributes'][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x48')](_0x44e8b5);})[_0x7413('0x17')](function(_0x3f7da2){_0xfa34ef[_0x7413('0x49')]=_0x3f7da2;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x4a')]===_0x7413('0x4b')){var _0x1dd908=[];for(var _0x38cd61=0x0;_0x38cd61<_0xfa34ef[_0x7413('0x49')][_0x7413('0x4c')];_0x38cd61++){_0x1dd908['push'](get_open_tabs(_0x7413('0x4d'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908['push'](get_open_tabs(_0x7413('0x51'),_0xfa34ef['rows'][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x53'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));}return BPromise[_0x7413('0x54')](_0x1dd908)['then'](function(_0x513657){return _0xfa34ef;});}else{return _0xfa34ef;}})[_0x7413('0x17')](respondWithFilteredResult(_0x8dc047,_0x44e8b5))['catch'](handleError(_0x8dc047,null));};exports['show']=function(_0x27d2b6,_0x208338){var _0x5cb3bb={'raw':![],'where':{'id':_0x27d2b6['params']['id']}},_0x2aa12c={};_0x2aa12c['model']=_[_0x7413('0x55')](_['keys'](db[_0x7413('0x3c')][_0x7413('0x3d')]),[_0x7413('0x56'),_0x7413('0x57')]);_0x2aa12c[_0x7413('0x43')]=_[_0x7413('0x58')](_0x27d2b6[_0x7413('0x43')]);_0x2aa12c[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x2aa12c[_0x7413('0x5b')],_0x2aa12c['query']);_0x5cb3bb[_0x7413('0x46')]=_['intersection'](_0x2aa12c['model'],qs['fields'](_0x27d2b6[_0x7413('0x43')][_0x7413('0x5c')]));_0x5cb3bb[_0x7413('0x46')]=_0x5cb3bb[_0x7413('0x46')]['length']?_0x5cb3bb['attributes']:_0x2aa12c[_0x7413('0x5b')];if(_0x27d2b6['query'][_0x7413('0x44')]){_0x5cb3bb['include']=[{'all':!![]}];}_0x5cb3bb=_['merge']({},_0x5cb3bb,_0x27d2b6['options']);if(!_['includes'](_0x5cb3bb['attributes'],'id')){_0x5cb3bb[_0x7413('0x46')][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x5d')](_0x5cb3bb)[_0x7413('0x17')](handleEntityNotFound(_0x208338,null))['then'](function(_0x33017d){var _0x1762b0=[];values=_0x33017d;if(_0x27d2b6[_0x7413('0x43')]['openTabs']===_0x7413('0x4b')){_0x1762b0['push'](get_open_tabs('chat',_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs('whatsapp',_0x33017d[_0x7413('0x4e')]));_0x1762b0['push'](get_open_tabs(_0x7413('0x50'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x51'),_0x33017d['dataValues']));return BPromise[_0x7413('0x54')](_0x1762b0);}else{return values;}})['then'](function(_0xf01452){return values;})[_0x7413('0x17')](respondWithResult(_0x208338,null))['catch'](handleError(_0x208338,null));};exports[_0x7413('0x5e')]=function(_0x12048c,_0x59d639){if(_0x12048c[_0x7413('0x5f')]['id']){delete _0x12048c[_0x7413('0x5f')]['id'];}delete _0x12048c['body'][_0x7413('0x2c')];return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12048c[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x59d639,null))[_0x7413('0x17')](saveUpdates(_0x12048c[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x59d639,null))['catch'](handleError(_0x59d639,null));};exports[_0x7413('0x61')]=function(_0x4ca888,_0x3808d3){return db[_0x7413('0x3c')][_0x7413('0x61')]()[_0x7413('0x17')](respondWithResult(_0x3808d3,null))['catch'](handleError(_0x3808d3,null));};exports['addContacts']=function(_0x559ce3,_0x56b090){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x559ce3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x56b090,null))['then'](function(_0x3c20db){if(_0x3c20db){return _0x3c20db[_0x7413('0x62')](_0x559ce3[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x559ce3[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x56b090,null))[_0x7413('0x65')](handleError(_0x56b090,null));};function validateUser(_0x47512d){return new BPromise(function(_0x3f9cfd,_0x1264f3){if(_0x47512d[_0x7413('0x66')])return _0x3f9cfd(_0x47512d);return db['Setting'][_0x7413('0x67')](0x1)[_0x7413('0x17')](function(_0x4cab22){if(_0x4cab22[_0x7413('0x68')])authService[_0x7413('0x69')](_0x47512d[_0x7413('0x56')]);db[_0x7413('0x3c')][_0x7413('0x6a')](_0x7413('0x66'))['then'](function(_0x61e533){if(_[_0x7413('0x6b')](_0x61e533)){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')]||0x1;return;}if(_['isNil'](_0x4cab22['min_internal'])||_0x4cab22[_0x7413('0x6c')]===_0x61e533){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;return;}if(_0x4cab22[_0x7413('0x6c')]>_0x61e533){_0x47512d[_0x7413('0x66')]=_0x4cab22[_0x7413('0x6c')];return;}return db[_0x7413('0x6d')][_0x7413('0x43')](_0x7413('0x6e'),{'type':db['sequelize'][_0x7413('0x6f')]['SELECT']})[_0x7413('0x17')](function(_0x3deb37){if(_0x3deb37&&_0x3deb37[_0x7413('0x4c')]){for(var _0x3054f5=0x0,_0x2c4664=_0x3deb37[_0x7413('0x4c')];_0x3054f5<_0x2c4664&&_[_0x7413('0x6b')](_0x47512d[_0x7413('0x66')]);_0x3054f5++){if(_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['from']){_0x47512d[_0x7413('0x66')]=_0x3deb37[_0x3054f5][_0x7413('0x70')];}else if(_0x4cab22['min_internal']>_0x3deb37[_0x3054f5][_0x7413('0x70')]&&_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['to']){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')];}}}if(_['isNil'](_0x47512d[_0x7413('0x66')])){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;}return _0x3f9cfd(_0x47512d);});});})['catch'](function(_0x51f2c3){_0x1264f3(_0x51f2c3);});});}function updateUser(_0x227a66){return new BPromise(function(_0x19fe72,_0x34ec9a){try{if(_0x227a66['voicemail']){_0x227a66[_0x7413('0x71')]=_0x227a66[_0x7413('0x66')];_0x227a66[_0x7413('0x72')]={'mailbox':_0x227a66[_0x7413('0x66')],'password':_0x227a66[_0x7413('0x56')],'fullname':_0x227a66[_0x7413('0x73')],'email':_0x227a66['email']};}if(_0x227a66[_0x7413('0x2c')]===_0x7413('0x74')){if(!_0x227a66[_0x7413('0x75')])_0x227a66['permissions']=[_0x7413('0x76'),_0x7413('0x77'),_0x7413('0x78'),_0x7413('0x79'),_0x7413('0x7a'),_0x7413('0x7b'),_0x7413('0x7c'),_0x7413('0x7d'),_0x7413('0x7e'),'108',_0x7413('0x7f'),_0x7413('0x80'),_0x7413('0x81'),_0x7413('0x82'),_0x7413('0x83')];}_0x19fe72(_0x227a66);}catch(_0x3b7d16){_0x34ec9a(_0x3b7d16);}});}exports['create']=function(_0x3e6393,_0x56d20e){if(_0x3e6393['user'][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error('Unauthorized');if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f')&&_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_0x3e6393[_0x7413('0x5f')]['role']===_0x7413('0x2d')&&_0x3e6393['user'][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x7413('0x85')]([_0x3e6393[_0x7413('0x5f')]])[_0x7413('0x17')](function(){return validateUser(_0x3e6393[_0x7413('0x5f')]);})[_0x7413('0x17')](function(_0x3920b5){return updateUser(_0x3920b5)[_0x7413('0x17')](function(_0x12fbb2){if(_0x12fbb2[_0x7413('0x2c')]===_0x7413('0x2d')){_0x12fbb2['settingsEnabled']=_0x3e6393[_0x7413('0x2f')][_0x7413('0x86')];delete _0x12fbb2['userProfileId'];}return _0x12fbb2;});})['then'](function(_0x544fa2){return db[_0x7413('0x3c')]['create'](_0x544fa2,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]});})[_0x7413('0x17')](function(_0x36cd29){if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x36cd29;if(_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!=='user')return _0x36cd29;return db[_0x7413('0x87')][_0x7413('0x5d')]({'where':{'name':_0x36cd29[_0x7413('0x2c')]==='agent'?_0x7413('0x30'):_0x7413('0x31'),'userProfileId':_0x3e6393[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x19a777){if(!_0x19a777||_0x19a777[_0x7413('0x89')]!=0x0)return _0x36cd29;return db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x36cd29[_0x7413('0x37')],'resourceId':_0x36cd29['id'],'type':_0x19a777['name'],'sectionId':_0x19a777['id']},{})[_0x7413('0x17')](function(){return _0x36cd29;});})[_0x7413('0x65')](function(_0x4d2aed){logger[_0x7413('0x1b')](_0x7413('0x8b'),_0x4d2aed);throw _0x4d2aed;});})['then'](respondWithResult(_0x56d20e,0xc9))[_0x7413('0x65')](handleError(_0x56d20e,null));};exports[_0x7413('0x8c')]=function(_0x230191,_0x47fbf0){var _0x36d8cf=_0x230191['body'];var _0x466ec8=[];if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error(_0x7413('0x8d'));if(_[_0x7413('0x8e')](_0x36d8cf,['role',_0x7413('0x2f')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_['some'](_0x36d8cf,[_0x7413('0x2c'),_0x7413('0x2d')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x36d8cf)[_0x7413('0x17')](function(){return validateUser(_0x36d8cf[0x0]);})[_0x7413('0x17')](function(){for(var _0x389ce1=0x1;_0x389ce1<_0x36d8cf[_0x7413('0x4c')];_0x389ce1++){var _0x4ec202=_0x36d8cf[_0x389ce1-0x1]['internal'];if(!_0x36d8cf[_0x389ce1][_0x7413('0x66')])_0x36d8cf[_0x389ce1][_0x7413('0x66')]=_0x4ec202+0x1;_0x466ec8[_0x7413('0x47')](validateUser(_0x36d8cf[_0x389ce1]));}return BPromise['all'](_0x466ec8);})['then'](function(){_0x466ec8=[];for(var _0x2d71c8=0x0;_0x2d71c8<_0x36d8cf[_0x7413('0x4c')];_0x2d71c8++){_0x466ec8[_0x7413('0x47')](updateUser(_0x36d8cf[_0x2d71c8]));}return BPromise[_0x7413('0x54')](_0x466ec8);})[_0x7413('0x17')](function(){return BPromise[_0x7413('0x8f')](_0x36d8cf,function(_0x5fd045){return db['User']['create'](_0x5fd045,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]})['then'](function(_0x2016de){_0x5fd045['id']=_0x2016de['id'];return _0x5fd045;});});})[_0x7413('0x17')](function(_0x35389e){if(_0x230191[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x35389e;if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2f'))return _0x35389e;var _0x5802e0=_[_0x7413('0x8e')](_0x35389e,function(_0x3baf5c){return _0x3baf5c[_0x7413('0x2c')]===_0x7413('0x74')||_0x3baf5c[_0x7413('0x2c')]===_0x7413('0x32');});if(!_0x5802e0)return _0x35389e;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':['Agents',_0x7413('0x31')]},'userProfileId':_0x230191[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x29c329){if(_[_0x7413('0x90')](_0x29c329)||!_[_0x7413('0x8e')](_0x29c329,[_0x7413('0x89'),0x0]))return _0x35389e;_0x466ec8=[];var _0x4e872e=_(_0x29c329)[_0x7413('0x3e')](function(_0x4ef245){if(_0x4ef245[_0x7413('0x89')]===0x1)return;return _0x4ef245[_0x7413('0x37')]===_0x7413('0x30')?_0x7413('0x74'):_0x7413('0x32');})['compact']()[_0x7413('0x35')]();for(var _0xdbb32=0x0;_0xdbb32<_0x35389e[_0x7413('0x4c')];_0xdbb32++){if(!_[_0x7413('0x36')](_0x4e872e,_0x35389e[_0xdbb32][_0x7413('0x2c')]))return;var _0x38f6cc=_0x35389e[_0xdbb32][_0x7413('0x2c')]===_0x7413('0x74')?_0x7413('0x30'):_0x7413('0x31');_0x466ec8[_0x7413('0x47')](db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x35389e[_0xdbb32][_0x7413('0x37')],'resourceId':_0x35389e[_0xdbb32]['id'],'type':_0x38f6cc,'sectionId':_[_0x7413('0x5d')](_0x29c329,['name',_0x38f6cc])['id']},{}));}return BPromise['all'](_0x466ec8);});})[_0x7413('0x17')](respondWithResult(_0x47fbf0,0xc9))[_0x7413('0x65')](handleError(_0x47fbf0,null));};exports['changePassword']=function(_0x2144b3,_0x571a6c){if(_0x2144b3[_0x7413('0x5f')]['id']){delete _0x2144b3[_0x7413('0x5f')]['id'];}return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2144b3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](function(_0x10024a){if(!_0x10024a)return null;if(_0x10024a['id']===_0x2144b3[_0x7413('0x2f')]['id']){if(!_0x2144b3['body'][_0x7413('0x91')]||!_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize'][(_0x7413('0x93'))](_0x7413('0x94'));}if(!_0x10024a[_0x7413('0x95')](_0x2144b3['body'][_0x7413('0x91')])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x97'));}if(_0x2144b3[_0x7413('0x5f')][_0x7413('0x91')]===_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize']['ValidationError'](_0x7413('0x98'));}}else if(_0x2144b3[_0x7413('0x2f')][_0x7413('0x2c')]==='admin'){if(!_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x99'));}}else if(_0x2144b3[_0x7413('0x2f')]['role']==='user'){if(!_0x2144b3['body'][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x99'));}if(_0x10024a[_0x7413('0x2c')]!==_0x7413('0x74')){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}}else{throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}return _0x10024a;})[_0x7413('0x17')](handleEntityNotFound(_0x571a6c,null))[_0x7413('0x17')](function(_0x3819d3){return db['Setting'][_0x7413('0x9a')]({'attributes':['id',_0x7413('0x68'),'enforcePasswordHistory',_0x7413('0x9b')]})[_0x7413('0x17')](function(_0x570989){if(_0x570989[_0x7413('0x68')])authService['validatePasswordPattern'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]);if(!_0x570989[_0x7413('0x9c')]||!_0x3819d3[_0x7413('0x9d')])return _0x3819d3;authService[_0x7413('0x9e')](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')],_0x570989['passwordHistoryLimit']);return _0x3819d3;})[_0x7413('0x17')](saveUpdates({'password':_0x2144b3['body']['newPassword'],'passwordResetAt':_0x2144b3[_0x7413('0x2f')]['id']==_0x2144b3[_0x7413('0x60')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')])},null));})[_0x7413('0x17')](respondWithResult(_0x571a6c,null))[_0x7413('0x65')](handleError(_0x571a6c,null));};exports[_0x7413('0x9f')]=function(_0x5ca6c3,_0x2c1a90){var _0x337540=_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa0')];return db['User'][_0x7413('0x5d')]({'where':{'id':_0x5ca6c3[_0x7413('0x60')]['id']},'attributes':['id','name',_0x7413('0x2c'),_0x7413('0xa1'),_0x7413('0xa2'),'voicePause',_0x7413('0xa3')]})[_0x7413('0x17')](handleEntityNotFound(_0x2c1a90,null))[_0x7413('0x17')](function(_0x1aa397){if(_0x1aa397){if(!utils[_0x7413('0xa4')](_0x337540)){throw new db[(_0x7413('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x1aa397[_0x7413('0xa5')+_[_0x7413('0xa6')](_0x337540[_0x7413('0xa7')]())+_0x7413('0xa8')](_0x5ca6c3['body'][_0x7413('0x63')],{'penalty':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa9')]||0x0})[_0x7413('0xaa')](function(_0x57b209){for(var _0x56422f=0x0;_0x56422f<_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]['length'];_0x56422f+=0x1){var _0x1eeb5c={'UserId':Number(_0x5ca6c3[_0x7413('0x60')]['id'])};_0x1eeb5c[_['capitalize'](_0x337540[_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')][_0x56422f]);socket['emit']('user'+_['capitalize'](_0x337540['toLowerCase']())+_0x7413('0xac'),_0x1eeb5c);}return _0x57b209;})[_0x7413('0x17')](function(){if(_0x337540===_0x7413('0xad')){return db[_0x7413('0xae')][_0x7413('0x48')]({'where':{'id':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]||[]},'raw':!![],'attributes':['id',_0x7413('0x37')]});}})[_0x7413('0x17')](function(_0x321ce){var _0x19a1f6=_0x1aa397['get']({'plain':!![]});var _0x5d6c8b=[];if(_0x337540==='voice'&&_0x19a1f6[_0x7413('0x2c')]===_0x7413('0x74')&&_0x19a1f6[_0x7413('0xa1')]){for(var _0x4c6236=0x0;_0x4c6236<_0x321ce['length'];_0x4c6236+=0x1){_0x5d6c8b[_0x7413('0x47')]({'membername':_0x19a1f6[_0x7413('0x37')],'UserId':_0x19a1f6['id'],'queue_name':_0x321ce[_0x4c6236][_0x7413('0x37')],'VoiceQueueId':_0x321ce[_0x4c6236]['id'],'interface':_['isNil'](_0x19a1f6[_0x7413('0xa3')])?util['format'](_0x7413('0xaf'),_0x19a1f6[_0x7413('0x37')]):_0x19a1f6[_0x7413('0xa3')],'paused':_0x19a1f6[_0x7413('0xb0')]||![],'penalty':_0x5ca6c3['body']['penalty']||0x0});}return BPromise['each'](_0x5d6c8b,function(_0x48a547){return db['UserVoiceQueueRt']['upsert'](_0x48a547);});}return _0x1aa397;});}})[_0x7413('0x17')](respondWithStatusCode(_0x2c1a90,null))[_0x7413('0x65')](handleError(_0x2c1a90,null));};exports['removeQueues']=function(_0x2304bc,_0x34b2e2){var _0x545c7e;return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2304bc[_0x7413('0x60')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x34b2e2,null))[_0x7413('0x17')](function(_0xb1d14b){if(_0xb1d14b){_0x545c7e=_0xb1d14b;if(!_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]||!utils[_0x7413('0xa4')](_0x2304bc['query']['channel'])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xb1'));}return _0xb1d14b[_0x7413('0xb2')+_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xa8')](_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](function(_0x2ee4f8){if(_[_0x7413('0xb3')](_0x2304bc[_0x7413('0x43')]['ids'])){for(var _0xb42506=0x0;_0xb42506<_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0x7413('0x4c')];_0xb42506+=0x1){var _0x1b03f8={'UserId':Number(_0x2304bc[_0x7413('0x60')]['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0xb42506]);socket['emit']('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xb4'),_0x1b03f8);}}else{var _0x1b03f8={'UserId':Number(_0x2304bc['params']['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc['query'][_0x7413('0x63')]);socket[_0x7413('0xb5')]('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+'Queue:remove',_0x1b03f8);}return _0x2ee4f8;})[_0x7413('0x17')](function(){if(_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]===_0x7413('0xad')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2304bc[_0x7413('0x60')]['id'],'VoiceQueueId':_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]},'individualHooks':!![]})[_0x7413('0x17')](function(){return _0x545c7e;});}return _0x545c7e;})[_0x7413('0x17')](respondWithStatusCode(_0x34b2e2,null))[_0x7413('0x65')](handleError(_0x34b2e2,null));};exports[_0x7413('0xb6')]=function(_0x56a565,_0x2ec725){_0x56a565[_0x7413('0x5f')]['userpic']=_0x56a565['file'][_0x7413('0xb7')];return db['User']['find']({'where':{'id':_0x56a565[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x2ec725,null))[_0x7413('0x17')](saveUpdates(_0x56a565[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x2ec725,null))[_0x7413('0x65')](handleError(_0x2ec725,null));};exports[_0x7413('0xb8')]=function(_0x12fcf7,_0x4f01ef){var _0x3d0eee=path[_0x7413('0xb9')](config['root'],_0x7413('0xba'));return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12fcf7[_0x7413('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7413('0x17')](handleEntityNotFound(_0x4f01ef,null))[_0x7413('0x17')](function(_0x714cde){if(_0x714cde){if(_['isNil'](_0x714cde[_0x7413('0xbb')])){return _0x4f01ef[_0x7413('0xbc')](_0x3d0eee);}else{if(!fs[_0x7413('0xbd')](path['join'](config[_0x7413('0xbe')],'server/files/images/',_0x714cde[_0x7413('0xbb')]))){return _0x4f01ef['download'](_0x3d0eee);}return _0x4f01ef['download'](path[_0x7413('0xb9')](config[_0x7413('0xbe')],_0x7413('0xbf'),_0x714cde[_0x7413('0xbb')]));}}})['catch'](handleError(_0x4f01ef,null));};exports[_0x7413('0xc0')]=function(_0x5477e9,_0x237b80){return db[_0x7413('0x3c')]['find']({'where':{'id':_0x5477e9[_0x7413('0x60')]['id']},'attributes':['id']})[_0x7413('0x17')](handleEntityNotFound(_0x237b80,null))[_0x7413('0x17')](function(_0x11e565){var _0xf04ba3=[];values=_0x11e565[_0x7413('0x4e')];_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4d'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs('whatsapp',_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs('mail',_0x11e565['dataValues']));return BPromise[_0x7413('0x54')](_0xf04ba3);})['then'](function(_0x39dc56){var _0xb939e=[];if(_0x39dc56){for(var _0x52b81a=0x0;_0x52b81a=_0x53078a){_0x5b6c4e=_0x53078a;_0x1dac65=0xc8;}else{_0x1dac65=0xce;}_0x385687[_0x47a5('0x25')](_0x1dac65);return _0x385687[_0x47a5('0x26')](_0x47a5('0x27'),_0x5686db+'-'+_0x5b6c4e+'/'+_0x53078a)[_0x47a5('0x20')](_0x28747d);}return null;};}function saveUpdates(_0x16631f){return function(_0x361bfa){if(_0x361bfa){return _0x361bfa[_0x47a5('0x28')](_0x16631f)[_0x47a5('0x12')](function(_0x3ad507){return _0x3ad507;});}return null;};}function removeEntity(_0x528582){return function(_0x243210){if(_0x243210){return _0x243210['destroy']()[_0x47a5('0x12')](function(){var _0x9ac908=_0x243210[_0x47a5('0x29')]({'plain':!![]});if(_0x9ac908['role']===_0x47a5('0x2a'))return;var _0x625952=[{'name':_0x47a5('0x2b'),'value':_0x47a5('0x2c'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x47a5('0x2d'),'value':_0x47a5('0x2e'),'ignore':![]}];var _0x5bd7eb=_(_0x625952)['filter'](_0x47a5('0x2f'))[_0x47a5('0x30')]('value')[_0x47a5('0x31')]();if(_['includes'](_0x5bd7eb,_0x9ac908[_0x47a5('0x32')])){return;}var _0xd972c=_['find'](_0x625952,['value',_0x9ac908[_0x47a5('0x32')]])['name'];return db[_0x47a5('0x33')][_0x47a5('0x34')]({'where':{'type':_0xd972c,'resourceId':_0x9ac908['id']}})[_0x47a5('0x12')](function(){return _0x243210;});})['then'](function(){_0x528582[_0x47a5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c754){return function(_0x65542e){if(!_0x65542e){_0x53c754['sendStatus'](0x194);}return _0x65542e;};}function handleError(_0x25cce0,_0x5ef577){_0x5ef577=_0x5ef577||0x1f4;return function(_0x21ad34){logger[_0x47a5('0x19')](_0x21ad34[_0x47a5('0x35')]);if(_0x21ad34[_0x47a5('0x36')]){delete _0x21ad34[_0x47a5('0x36')];}_0x25cce0[_0x47a5('0x25')](_0x5ef577)[_0x47a5('0x37')](_0x21ad34);};}exports[_0x47a5('0x38')]=function(_0x1a0d23,_0x4caed5){var _0x396a9a={},_0x10f136={'count':0x0,'rows':[]};var _0x511c06=_(db[_0x47a5('0x39')][_0x47a5('0x3a')])[_0x47a5('0x30')](function(_0x49c4b5){return{'name':_0x49c4b5[_0x47a5('0x3b')],'type':_0x49c4b5[_0x47a5('0x3c')]['key']};})[_0x47a5('0x3d')](function(_0x19218a){return!_['includes'](['password','salt'],_0x19218a[_0x47a5('0x36')]);})['value']();_0x396a9a=qs[_0x47a5('0x3e')](_0x511c06,_0x1a0d23);var _0x1f9631={'where':_0x396a9a[_0x47a5('0x3f')]};return db[_0x47a5('0x39')][_0x47a5('0x24')](_0x1f9631)[_0x47a5('0x12')](function(_0x2003b0){_0x10f136[_0x47a5('0x24')]=_0x2003b0;if(_0x1a0d23[_0x47a5('0x40')][_0x47a5('0x41')]){_0x396a9a[_0x47a5('0x42')]=[{'all':!![]}];}if(!_[_0x47a5('0x43')](_0x396a9a[_0x47a5('0x44')],'id')){_0x396a9a['attributes'][_0x47a5('0x45')]('id');}return db[_0x47a5('0x39')][_0x47a5('0x46')](_0x396a9a);})[_0x47a5('0x12')](function(_0x586f4f){_0x10f136[_0x47a5('0x47')]=_0x586f4f;if(_0x1a0d23['query']['openTabs']==='true'){var _0x50d116=[];for(var _0x27dd5d=0x0;_0x27dd5d<_0x10f136['rows'][_0x47a5('0x48')];_0x27dd5d++){_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x10f136['rows'][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs('sms',_0x10f136['rows'][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116['push'](get_open_tabs(_0x47a5('0x4b'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4c'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4d'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4e'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));}return BPromise[_0x47a5('0x4f')](_0x50d116)['then'](function(_0x2d38de){return _0x10f136;});}else{return _0x10f136;}})[_0x47a5('0x12')](respondWithFilteredResult(_0x4caed5,_0x396a9a))['catch'](handleError(_0x4caed5,null));};exports['show']=function(_0x3d0a88,_0x560e4e){var _0x13750d={'raw':![],'where':{'id':_0x3d0a88['params']['id']}},_0xd93e37={};_0xd93e37['model']=_[_0x47a5('0x50')](_['keys'](db[_0x47a5('0x39')][_0x47a5('0x3a')]),[_0x47a5('0x51'),_0x47a5('0x52')]);_0xd93e37[_0x47a5('0x40')]=_[_0x47a5('0x53')](_0x3d0a88[_0x47a5('0x40')]);_0xd93e37['filters']=_['intersection'](_0xd93e37[_0x47a5('0x54')],_0xd93e37[_0x47a5('0x40')]);_0x13750d[_0x47a5('0x44')]=_[_0x47a5('0x55')](_0xd93e37[_0x47a5('0x54')],qs[_0x47a5('0x56')](_0x3d0a88[_0x47a5('0x40')]['fields']));_0x13750d[_0x47a5('0x44')]=_0x13750d[_0x47a5('0x44')][_0x47a5('0x48')]?_0x13750d['attributes']:_0xd93e37[_0x47a5('0x54')];if(_0x3d0a88['query'][_0x47a5('0x41')]){_0x13750d[_0x47a5('0x42')]=[{'all':!![]}];}_0x13750d=_[_0x47a5('0x57')]({},_0x13750d,_0x3d0a88[_0x47a5('0x58')]);if(!_['includes'](_0x13750d[_0x47a5('0x44')],'id')){_0x13750d[_0x47a5('0x44')][_0x47a5('0x45')]('id');}return db[_0x47a5('0x39')][_0x47a5('0x59')](_0x13750d)[_0x47a5('0x12')](handleEntityNotFound(_0x560e4e,null))[_0x47a5('0x12')](function(_0x481089){var _0x2a0aa2=[];values=_0x481089;if(_0x3d0a88[_0x47a5('0x40')][_0x47a5('0x5a')]===_0x47a5('0x5b')){_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x481089['dataValues']));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x5c'),_0x481089[_0x47a5('0x4a')]));_0x2a0aa2['push'](get_open_tabs(_0x47a5('0x4d'),_0x481089[_0x47a5('0x4a')]));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs('whatsapp',_0x481089['dataValues']));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4b'),_0x481089['dataValues']));_0x2a0aa2['push'](get_open_tabs(_0x47a5('0x4c'),_0x481089['dataValues']));return BPromise[_0x47a5('0x4f')](_0x2a0aa2);}else{return values;}})['then'](function(_0x482de6){return values;})[_0x47a5('0x12')](respondWithResult(_0x560e4e,null))[_0x47a5('0x1d')](handleError(_0x560e4e,null));};exports['update']=function(_0x1b958b,_0x72fe){if(_0x1b958b['body']['id']){delete _0x1b958b['body']['id'];}delete _0x1b958b[_0x47a5('0x5d')][_0x47a5('0x32')];return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1b958b['params']['id']}})[_0x47a5('0x12')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x12')](saveUpdates(_0x1b958b[_0x47a5('0x5d')],null))['then'](respondWithResult(_0x72fe,null))[_0x47a5('0x1d')](handleError(_0x72fe,null));};exports['describe']=function(_0x485e3c,_0x470da6){return db[_0x47a5('0x39')][_0x47a5('0x5e')]()[_0x47a5('0x12')](respondWithResult(_0x470da6,null))['catch'](handleError(_0x470da6,null));};exports[_0x47a5('0x5f')]=function(_0x5d1550,_0x5cbe97){return db['User']['find']({'where':{'id':_0x5d1550[_0x47a5('0x60')]['id']}})[_0x47a5('0x12')](handleEntityNotFound(_0x5cbe97,null))[_0x47a5('0x12')](function(_0x52e3ee){if(_0x52e3ee){return _0x52e3ee['addContacts'](_0x5d1550[_0x47a5('0x5d')][_0x47a5('0x61')],_[_0x47a5('0x62')](_0x5d1550[_0x47a5('0x5d')],[_0x47a5('0x61'),'id'])||{});}})['then'](respondWithResult(_0x5cbe97,null))[_0x47a5('0x1d')](handleError(_0x5cbe97,null));};function validateUser(_0x519e9e){return new BPromise(function(_0x22c886,_0x274d31){if(_0x519e9e['internal'])return _0x22c886(_0x519e9e);return db[_0x47a5('0x63')][_0x47a5('0x64')](0x1)[_0x47a5('0x12')](function(_0x3e8274){if(_0x3e8274[_0x47a5('0x65')])authService[_0x47a5('0x66')](_0x519e9e[_0x47a5('0x51')]);db[_0x47a5('0x39')]['max'](_0x47a5('0x67'))[_0x47a5('0x12')](function(_0x3c75c6){if(_[_0x47a5('0x68')](_0x3c75c6)){_0x519e9e[_0x47a5('0x67')]=_0x3e8274['min_internal']||0x1;return;}if(_[_0x47a5('0x68')](_0x3e8274[_0x47a5('0x69')])||_0x3e8274[_0x47a5('0x69')]===_0x3c75c6){_0x519e9e[_0x47a5('0x67')]=_0x3c75c6+0x1;return;}if(_0x3e8274[_0x47a5('0x69')]>_0x3c75c6){_0x519e9e[_0x47a5('0x67')]=_0x3e8274[_0x47a5('0x69')];return;}return db[_0x47a5('0x6a')][_0x47a5('0x40')](_0x47a5('0x6b'),{'type':db[_0x47a5('0x6a')][_0x47a5('0x6c')][_0x47a5('0x6d')]})[_0x47a5('0x12')](function(_0x3edd17){if(_0x3edd17&&_0x3edd17['length']){for(var _0x42dd7d=0x0,_0x284fb8=_0x3edd17[_0x47a5('0x48')];_0x42dd7d<_0x284fb8&&_['isNil'](_0x519e9e[_0x47a5('0x67')]);_0x42dd7d++){if(_0x3e8274[_0x47a5('0x69')]<=_0x3edd17[_0x42dd7d][_0x47a5('0x6e')]){_0x519e9e[_0x47a5('0x67')]=_0x3edd17[_0x42dd7d]['from'];}else if(_0x3e8274[_0x47a5('0x69')]>_0x3edd17[_0x42dd7d]['from']&&_0x3e8274[_0x47a5('0x69')]<=_0x3edd17[_0x42dd7d]['to']){_0x519e9e['internal']=_0x3e8274[_0x47a5('0x69')];}}}if(_['isNil'](_0x519e9e[_0x47a5('0x67')])){_0x519e9e[_0x47a5('0x67')]=_0x3c75c6+0x1;}return _0x22c886(_0x519e9e);});});})[_0x47a5('0x1d')](function(_0x58473b){_0x274d31(_0x58473b);});});}function updateUser(_0x4af557){return new BPromise(function(_0x4b8084,_0x4164a3){try{if(_0x4af557[_0x47a5('0x6f')]){_0x4af557[_0x47a5('0x70')]=_0x4af557[_0x47a5('0x67')];_0x4af557['VoiceMail']={'mailbox':_0x4af557[_0x47a5('0x67')],'password':_0x4af557[_0x47a5('0x51')],'fullname':_0x4af557[_0x47a5('0x71')],'email':_0x4af557[_0x47a5('0x72')]};}if(_0x4af557[_0x47a5('0x32')]===_0x47a5('0x73')){if(!_0x4af557[_0x47a5('0x74')])_0x4af557[_0x47a5('0x74')]=[_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'110',_0x47a5('0x79'),'105',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x80'),_0x47a5('0x81')];}_0x4b8084(_0x4af557);}catch(_0x11c1db){_0x4164a3(_0x11c1db);}});}exports[_0x47a5('0x82')]=function(_0x1cfb37,_0x1f07ac){if(_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]===_0x47a5('0x73'))throw new Error('Unauthorized');if(_0x1cfb37['body']['role']==='user'&&_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!=='admin'){throw new Error(_0x47a5('0x83'));}if(_0x1cfb37[_0x47a5('0x5d')][_0x47a5('0x32')]===_0x47a5('0x2a')&&_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!==_0x47a5('0x2a')){throw new Error(_0x47a5('0x84'));}return licenseUtil[_0x47a5('0x85')]([_0x1cfb37[_0x47a5('0x5d')]])[_0x47a5('0x12')](function(){return validateUser(_0x1cfb37['body']);})[_0x47a5('0x12')](function(_0x1fbd42){return updateUser(_0x1fbd42)[_0x47a5('0x12')](function(_0x4f35ff){if(_0x4f35ff[_0x47a5('0x32')]===_0x47a5('0x2a')){_0x4f35ff[_0x47a5('0x86')]=_0x1cfb37['user'][_0x47a5('0x86')];delete _0x4f35ff['userProfileId'];}return _0x4f35ff;});})['then'](function(_0x356e16){return db[_0x47a5('0x39')][_0x47a5('0x82')](_0x356e16,{'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x87')}]});})[_0x47a5('0x12')](function(_0x479a82){if(_0x1cfb37['body'][_0x47a5('0x32')]==='user')return _0x479a82;if(_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!==_0x47a5('0x2c'))return _0x479a82;return db[_0x47a5('0x88')]['find']({'where':{'name':_0x479a82[_0x47a5('0x32')]==='agent'?'Agents':_0x47a5('0x2d'),'userProfileId':_0x1cfb37[_0x47a5('0x2c')]['userProfileId']},'raw':!![]})[_0x47a5('0x12')](function(_0x21828e){if(!_0x21828e||_0x21828e[_0x47a5('0x89')]!=0x0)return _0x479a82;return db['UserProfileResource'][_0x47a5('0x82')]({'name':_0x479a82['name'],'resourceId':_0x479a82['id'],'type':_0x21828e[_0x47a5('0x36')],'sectionId':_0x21828e['id']},{})[_0x47a5('0x12')](function(){return _0x479a82;});})[_0x47a5('0x1d')](function(_0x4a5ca1){logger[_0x47a5('0x19')](_0x47a5('0x8a'),_0x4a5ca1);throw _0x4a5ca1;});})[_0x47a5('0x12')](respondWithResult(_0x1f07ac,0xc9))['catch'](handleError(_0x1f07ac,null));};exports[_0x47a5('0x8b')]=function(_0x4f2fbb,_0x3c012b){var _0x491bb4=_0x4f2fbb[_0x47a5('0x5d')];var _0x20d8bd=[];if(_0x4f2fbb[_0x47a5('0x2c')][_0x47a5('0x32')]==='agent')throw new Error(_0x47a5('0x8c'));if(_[_0x47a5('0x8d')](_0x491bb4,[_0x47a5('0x32'),_0x47a5('0x2c')])&&_0x4f2fbb[_0x47a5('0x2c')]['role']!=='admin'){throw new Error(_0x47a5('0x83'));}if(_['some'](_0x491bb4,[_0x47a5('0x32'),_0x47a5('0x2a')])&&_0x4f2fbb[_0x47a5('0x2c')]['role']!==_0x47a5('0x2a')){throw new Error(_0x47a5('0x8e'));}return licenseUtil['checkUserLimits'](_0x491bb4)[_0x47a5('0x12')](function(){return validateUser(_0x491bb4[0x0]);})[_0x47a5('0x12')](function(){for(var _0x19acfa=0x1;_0x19acfa<_0x491bb4[_0x47a5('0x48')];_0x19acfa++){var _0x58dacd=_0x491bb4[_0x19acfa-0x1]['internal'];if(!_0x491bb4[_0x19acfa][_0x47a5('0x67')])_0x491bb4[_0x19acfa][_0x47a5('0x67')]=_0x58dacd+0x1;_0x20d8bd['push'](validateUser(_0x491bb4[_0x19acfa]));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);})[_0x47a5('0x12')](function(){_0x20d8bd=[];for(var _0x5a0901=0x0;_0x5a0901<_0x491bb4[_0x47a5('0x48')];_0x5a0901++){_0x20d8bd[_0x47a5('0x45')](updateUser(_0x491bb4[_0x5a0901]));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);})['then'](function(){return BPromise[_0x47a5('0x8f')](_0x491bb4,function(_0x59b4a5){return db[_0x47a5('0x39')]['create'](_0x59b4a5,{'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x87')}]})['then'](function(_0x35d9f0){_0x59b4a5['id']=_0x35d9f0['id'];return _0x59b4a5;});});})['then'](function(_0x1eabef){if(_0x4f2fbb[_0x47a5('0x5d')][_0x47a5('0x32')]===_0x47a5('0x2c'))return _0x1eabef;if(_0x4f2fbb['user'][_0x47a5('0x32')]!=='user')return _0x1eabef;var _0x52be82=_[_0x47a5('0x8d')](_0x1eabef,function(_0x46bdb1){return _0x46bdb1[_0x47a5('0x32')]===_0x47a5('0x73')||_0x46bdb1[_0x47a5('0x32')]==='telephone';});if(!_0x52be82)return _0x1eabef;return db[_0x47a5('0x88')][_0x47a5('0x46')]({'where':{'name':{'$or':[_0x47a5('0x90'),_0x47a5('0x2d')]},'userProfileId':_0x4f2fbb['user'][_0x47a5('0x91')]},'raw':!![]})['then'](function(_0x12891d){if(_[_0x47a5('0x92')](_0x12891d)||!_[_0x47a5('0x8d')](_0x12891d,[_0x47a5('0x89'),0x0]))return _0x1eabef;_0x20d8bd=[];var _0x29a1cf=_(_0x12891d)[_0x47a5('0x30')](function(_0x92bfd7){if(_0x92bfd7[_0x47a5('0x89')]===0x1)return;return _0x92bfd7[_0x47a5('0x36')]==='Agents'?_0x47a5('0x73'):_0x47a5('0x2e');})['compact']()[_0x47a5('0x31')]();for(var _0x32035e=0x0;_0x32035e<_0x1eabef[_0x47a5('0x48')];_0x32035e++){if(!_['includes'](_0x29a1cf,_0x1eabef[_0x32035e]['role']))return;var _0x126bb1=_0x1eabef[_0x32035e][_0x47a5('0x32')]==='agent'?'Agents':_0x47a5('0x2d');_0x20d8bd[_0x47a5('0x45')](db['UserProfileResource'][_0x47a5('0x82')]({'name':_0x1eabef[_0x32035e][_0x47a5('0x36')],'resourceId':_0x1eabef[_0x32035e]['id'],'type':_0x126bb1,'sectionId':_['find'](_0x12891d,[_0x47a5('0x36'),_0x126bb1])['id']},{}));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);});})[_0x47a5('0x12')](respondWithResult(_0x3c012b,0xc9))[_0x47a5('0x1d')](handleError(_0x3c012b,null));};exports[_0x47a5('0x93')]=function(_0x1371e4,_0x5d89a1){if(_0x1371e4['body']['id']){delete _0x1371e4['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1371e4['params']['id']}})[_0x47a5('0x12')](function(_0x241f2a){if(!_0x241f2a)return null;if(_0x241f2a['id']===_0x1371e4[_0x47a5('0x2c')]['id']){if(!_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x94')]||!_0x1371e4['body'][_0x47a5('0x95')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x241f2a[_0x47a5('0x96')](_0x1371e4['body'][_0x47a5('0x94')])){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))]('Wrong\x20credentials');}if(_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x94')]===_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))]['ValidationError'](_0x47a5('0x99'));}}else if(_0x1371e4[_0x47a5('0x2c')]['role']===_0x47a5('0x2a')){if(!_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x9a'));}}else if(_0x1371e4['user'][_0x47a5('0x32')]===_0x47a5('0x2c')){if(!_0x1371e4['body'][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x9a'));}if(_0x241f2a['role']!=='agent'){throw new db['Sequelize']['ValidationError'](_0x47a5('0x8c'));}}else{throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x8c'));}return _0x241f2a;})[_0x47a5('0x12')](handleEntityNotFound(_0x5d89a1,null))[_0x47a5('0x12')](function(_0xac1f9e){return db[_0x47a5('0x63')]['findOne']({'attributes':['id',_0x47a5('0x65'),_0x47a5('0x9b'),_0x47a5('0x9c')]})[_0x47a5('0x12')](function(_0x47be87){if(_0x47be87['securePassword'])authService[_0x47a5('0x66')](_0x1371e4['body']['newPassword']);if(!_0x47be87[_0x47a5('0x9b')]||!_0xac1f9e[_0x47a5('0x9d')])return _0xac1f9e;authService['validatePasswordHistory'](_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')],_0xac1f9e[_0x47a5('0x9d')],_0x47be87['passwordHistoryLimit']);return _0xac1f9e;})[_0x47a5('0x12')](saveUpdates({'password':_0x1371e4[_0x47a5('0x5d')]['newPassword'],'passwordResetAt':_0x1371e4[_0x47a5('0x2c')]['id']==_0x1371e4[_0x47a5('0x60')]['id']?moment():null,'previousPasswords':authService[_0x47a5('0x9e')](_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')],_0xac1f9e[_0x47a5('0x9d')])},null));})['then'](respondWithResult(_0x5d89a1,null))[_0x47a5('0x1d')](handleError(_0x5d89a1,null));};exports['addQueues']=function(_0x2a3f32,_0x3ab7ac){var _0xe3f69f=_0x2a3f32[_0x47a5('0x5d')]['channel'];return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x2a3f32[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0x36'),_0x47a5('0x32'),_0x47a5('0x9f'),_0x47a5('0xa0'),_0x47a5('0xa1'),_0x47a5('0xa2')]})[_0x47a5('0x12')](handleEntityNotFound(_0x3ab7ac,null))[_0x47a5('0x12')](function(_0x301031){if(_0x301031){if(!utils['isValidChannel'](_0xe3f69f)){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))]('Unknown\x20channel');}return _0x301031[_0x47a5('0xa3')+_[_0x47a5('0xa4')](_0xe3f69f[_0x47a5('0xa5')]())+_0x47a5('0xa6')](_0x2a3f32[_0x47a5('0x5d')]['ids'],{'penalty':_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0xa7')]||0x0})[_0x47a5('0xa8')](function(_0x266a2f){for(var _0x343214=0x0;_0x343214<_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')]['length'];_0x343214+=0x1){var _0x596562={'UserId':Number(_0x2a3f32[_0x47a5('0x60')]['id'])};_0x596562[_['capitalize'](_0xe3f69f[_0x47a5('0xa5')]())+'QueueId']=Number(_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')][_0x343214]);socket[_0x47a5('0xa9')](_0x47a5('0x2c')+_['capitalize'](_0xe3f69f[_0x47a5('0xa5')]())+_0x47a5('0xaa'),_0x596562);}return _0x266a2f;})[_0x47a5('0x12')](function(){if(_0xe3f69f==='voice'){return db['VoiceQueue'][_0x47a5('0x46')]({'where':{'id':_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')]||[]},'raw':!![],'attributes':['id',_0x47a5('0x36')]});}})[_0x47a5('0x12')](function(_0x402bba){var _0x1c0323=_0x301031[_0x47a5('0x29')]({'plain':!![]});var _0x566630=[];if(_0xe3f69f===_0x47a5('0xab')&&_0x1c0323['role']===_0x47a5('0x73')&&_0x1c0323[_0x47a5('0x9f')]){for(var _0x5b0b0b=0x0;_0x5b0b0b<_0x402bba['length'];_0x5b0b0b+=0x1){_0x566630[_0x47a5('0x45')]({'membername':_0x1c0323[_0x47a5('0x36')],'UserId':_0x1c0323['id'],'queue_name':_0x402bba[_0x5b0b0b]['name'],'VoiceQueueId':_0x402bba[_0x5b0b0b]['id'],'interface':_[_0x47a5('0x68')](_0x1c0323[_0x47a5('0xa2')])?util[_0x47a5('0xac')](_0x47a5('0xad'),_0x1c0323['name']):_0x1c0323[_0x47a5('0xa2')],'paused':_0x1c0323['voicePause']||![],'penalty':_0x2a3f32['body']['penalty']||0x0});}return BPromise[_0x47a5('0x8f')](_0x566630,function(_0x5a975d){return db[_0x47a5('0xae')][_0x47a5('0xaf')](_0x5a975d);});}return _0x301031;});}})[_0x47a5('0x12')](respondWithStatusCode(_0x3ab7ac,null))[_0x47a5('0x1d')](handleError(_0x3ab7ac,null));};exports[_0x47a5('0xb0')]=function(_0x1dae08,_0x6cd737){var _0x62d3a4;return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1dae08[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0x36'),_0x47a5('0x32')]})[_0x47a5('0x12')](handleEntityNotFound(_0x6cd737,null))[_0x47a5('0x12')](function(_0x5e17cb){if(_0x5e17cb){_0x62d3a4=_0x5e17cb;if(!_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]||!utils[_0x47a5('0xb2')](_0x1dae08[_0x47a5('0x40')]['channel'])){throw new db[(_0x47a5('0x97'))]['ValidationError'](_0x47a5('0xb3'));}return _0x5e17cb['remove'+_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]['toLowerCase']())+_0x47a5('0xa6')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')]);}})['then'](function(_0x52798d){if(_[_0x47a5('0xb4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')])){for(var _0x4594df=0x0;_0x4594df<_0x1dae08[_0x47a5('0x40')]['ids'][_0x47a5('0x48')];_0x4594df+=0x1){var _0x481bc3={'UserId':Number(_0x1dae08[_0x47a5('0x60')]['id'])};_0x481bc3[_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]['toLowerCase']())+'QueueId']=Number(_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')][_0x4594df]);socket[_0x47a5('0xa9')](_0x47a5('0x2c')+_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb5'),_0x481bc3);}}else{var _0x481bc3={'UserId':Number(_0x1dae08['params']['id'])};_0x481bc3[_[_0x47a5('0xa4')](_0x1dae08['query'][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb6')]=Number(_0x1dae08['query'][_0x47a5('0x61')]);socket[_0x47a5('0xa9')]('user'+_[_0x47a5('0xa4')](_0x1dae08['query'][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb5'),_0x481bc3);}return _0x52798d;})['then'](function(){if(_0x1dae08['query']['channel']==='voice'){return db['UserVoiceQueueRt'][_0x47a5('0x34')]({'where':{'UserId':_0x1dae08['params']['id'],'VoiceQueueId':_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')]},'individualHooks':!![]})['then'](function(){return _0x62d3a4;});}return _0x62d3a4;})['then'](respondWithStatusCode(_0x6cd737,null))['catch'](handleError(_0x6cd737,null));};exports[_0x47a5('0xb7')]=function(_0x4e0dfa,_0x4ec4a8){_0x4e0dfa['body'][_0x47a5('0xb8')]=_0x4e0dfa[_0x47a5('0xb9')][_0x47a5('0xba')];return db[_0x47a5('0x39')]['find']({'where':{'id':_0x4e0dfa[_0x47a5('0x60')]['id']}})['then'](handleEntityNotFound(_0x4ec4a8,null))[_0x47a5('0x12')](saveUpdates(_0x4e0dfa['body'],null))[_0x47a5('0x12')](respondWithResult(_0x4ec4a8,null))[_0x47a5('0x1d')](handleError(_0x4ec4a8,null));};exports[_0x47a5('0xbb')]=function(_0x4f8171,_0x106bbe){var _0x427c02=path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],'server/files/images/logos/default_profile.png');return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x4f8171[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0xb8')],'raw':!![]})[_0x47a5('0x12')](handleEntityNotFound(_0x106bbe,null))[_0x47a5('0x12')](function(_0x598825){if(_0x598825){if(_[_0x47a5('0x68')](_0x598825[_0x47a5('0xb8')])){return _0x106bbe[_0x47a5('0xbe')](_0x427c02);}else{if(!fs[_0x47a5('0xbf')](path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],_0x47a5('0xc0'),_0x598825[_0x47a5('0xb8')]))){return _0x106bbe[_0x47a5('0xbe')](_0x427c02);}return _0x106bbe[_0x47a5('0xbe')](path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],_0x47a5('0xc0'),_0x598825[_0x47a5('0xb8')]));}}})[_0x47a5('0x1d')](handleError(_0x106bbe,null));};exports[_0x47a5('0xc1')]=function(_0x40505e,_0x4c181e){return db[_0x47a5('0x39')]['find']({'where':{'id':_0x40505e['params']['id']},'attributes':['id']})[_0x47a5('0x12')](handleEntityNotFound(_0x4c181e,null))[_0x47a5('0x12')](function(_0x36f910){var _0x4d4039=[];values=_0x36f910[_0x47a5('0x4a')];_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x5c'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4d'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4e'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039['push'](get_open_tabs('fax',_0x36f910[_0x47a5('0x4a')]));_0x4d4039['push'](get_open_tabs(_0x47a5('0x4c'),_0x36f910[_0x47a5('0x4a')]));return BPromise[_0x47a5('0x4f')](_0x4d4039);})[_0x47a5('0x12')](function(_0x2bdd28){var _0x3708ea=[];if(_0x2bdd28){for(var _0x258b96=0x0;_0x258b96=_0x436edb[_0x85a6('0x53')]){throw new Error(_0x85a6('0x54'));}})[_0x85a6('0x22')](function(){if(_0x5fe651){return db['UserVoiceQueueRt'][_0x85a6('0x55')]({'where':{'membername':_0x5fe651[_0x85a6('0x2a')]},'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x5fe651){return _0x5fe651[_0x85a6('0x56')]({'raw':!![]});}})[_0x85a6('0x22')](function(_0x97f10){if(_0x5fe651){if(_0x97f10){var _0x37db18=[];_0x3e6acb=_0x97f10;if(_0x3e6acb[_0x85a6('0x2b')]){for(var _0x8fdd0e=0x0;_0x8fdd0e<_0x3e6acb['length'];_0x8fdd0e++){_0x37db18[_0x85a6('0x4b')](db[_0x85a6('0x40')][_0x85a6('0x57')]({'membername':_0x5fe651['name'],'UserId':_0x5fe651['id'],'queue_name':_0x3e6acb[_0x8fdd0e][_0x85a6('0x2a')],'VoiceQueueId':_0x3e6acb[_0x8fdd0e]['id'],'interface':_0x1a32f1,'paused':_0x5fe651[_0x85a6('0x58')]||![],'penalty':_0x3e6acb[_0x8fdd0e]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x37db18);}}}})[_0x85a6('0x22')](function(){if(_0x5fe651){return db['MemberReport']['findAll']({'where':{'membername':_0x5fe651[_0x85a6('0x2a')],'exitAt':null}});}})[_0x85a6('0x22')](function(_0x378cc3){if(_0x5fe651){if(_0x378cc3&&_0x378cc3[_0x85a6('0x2b')]){var _0x17d528=[];_0x378cc3[_0x85a6('0x4a')](function(_0x282fd9){_0x17d528['push'](_0x282fd9[_0x85a6('0x39')]({'exitAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d'))}));});return BPromise['all'](_0x17d528);}}})[_0x85a6('0x22')](function(_0xa54c0d){if(_0x5fe651){var _0x45ee49=[];var _0x2c7143=[];var _0x234e54=utils[_0x85a6('0x2f')]();var _0x5169e9={'membername':_0x5fe651['name'],'interface':_0x1a32f1,'enterAt':moment()[_0x85a6('0x2c')](_0x85a6('0x2d')),'role':_0x5fe651[_0x85a6('0x27')],'internal':_0x5fe651['internal']};_0x234e54[_0x85a6('0x4a')](function(_0x46d922){_0x45ee49[_0x85a6('0x4b')](_['merge']({'channel':_0x46d922,'type':'LOGIN','data1':_0x85a6('0x59'),'data2':_0x1a32f1},_0x5169e9));if(_0x5fe651[_0x85a6('0x58')]){_0x2c7143['push'](_[_0x85a6('0x5a')]({'channel':_0x46d922,'type':_0x85a6('0x32'),'data1':_0x85a6('0x5b')},_0x5169e9));}});return db[_0x85a6('0x29')][_0x85a6('0x38')](_0x45ee49[_0x85a6('0x5c')](_0x2c7143),{'individualHooks':!![]});}})[_0x85a6('0x22')](function(){if(_0x5fe651){return _0x5fe651[_0x85a6('0x39')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5fe651[_0x85a6('0x58')]||![],'mailPause':_0x5fe651[_0x85a6('0x58')]||![],'chatPause':_0x5fe651[_0x85a6('0x58')]||![],'faxPause':_0x5fe651[_0x85a6('0x58')]||![],'smsPause':_0x5fe651['loginInPause']||![],'openchannelPause':_0x5fe651[_0x85a6('0x58')]||![],'pauseType':_0x5fe651[_0x85a6('0x58')]?_0x85a6('0x5b'):null,'lastPauseAt':moment()['format'](_0x85a6('0x2d')),'interface':_0x1a32f1});}})[_0x85a6('0x22')](function(_0x18f372){_0xa5d81b(_0x18f372);})['catch'](function(_0x51c182){_0x2cc4a9(_0x3e1410[_0x85a6('0x15')](0x1f4,_0x51c182[_0x85a6('0x17')]));});});}; \ No newline at end of file +var _0x083f=['mobile','phone','loginInPause','count','agent','../../config/license/util','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','defaults','localhost','socket.io-emitter','redis','register','request','request\x20sent','debug','error','code','User,\x20%s,\x20%s','message','info','result','catch','GetUser','User','findAll','raw','options','where','include','map','model','attributes','stringify','ShowUser','find','name','role','internal','interface','then','UserVoiceQueueRt','update','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','LogoutUser','destroy','LoginUser'];(function(_0x444192,_0x2d462b){var _0x2f38ab=function(_0x38d594){while(--_0x38d594){_0x444192['push'](_0x444192['shift']());}};_0x2f38ab(++_0x2d462b);}(_0x083f,0xd0));var _0xf083=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x083f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf083('0x0'));var util=require(_0xf083('0x1'));var moment=require(_0xf083('0x2'));var BPromise=require(_0xf083('0x3'));var rs=require(_0xf083('0x4'));var fs=require('fs');var Redis=require(_0xf083('0x5'));var db=require(_0xf083('0x6'))['db'];var utils=require(_0xf083('0x7'));var logger=require(_0xf083('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf083('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf083('0xa')](config['redis'],{'host':_0xf083('0xb'),'port':0x18eb});var socket=require(_0xf083('0xc'))(new Redis(config[_0xf083('0xd')]));require('./user.socket')[_0xf083('0xe')](socket);function respondWithRpcPromise(_0x1e3cfb,_0x5a7be5,_0xa6153c){return new BPromise(function(_0x1cf157,_0x37d98c){return client[_0xf083('0xf')](_0x1e3cfb,_0xa6153c)['then'](function(_0x1cd0ff){logger['info']('User,\x20%s,\x20%s',_0x5a7be5,_0xf083('0x10'));logger[_0xf083('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x5a7be5,'request\x20sent',JSON['stringify'](_0x1cd0ff));if(_0x1cd0ff['error']){if(_0x1cd0ff[_0xf083('0x12')][_0xf083('0x13')]===0x1f4){logger[_0xf083('0x12')](_0xf083('0x14'),_0x5a7be5,_0x1cd0ff[_0xf083('0x12')]['message']);return _0x37d98c(_0x1cd0ff[_0xf083('0x12')]['message']);}logger[_0xf083('0x12')](_0xf083('0x14'),_0x5a7be5,_0x1cd0ff[_0xf083('0x12')][_0xf083('0x15')]);return _0x1cf157(_0x1cd0ff[_0xf083('0x12')][_0xf083('0x15')]);}else{logger[_0xf083('0x16')]('User,\x20%s,\x20%s',_0x5a7be5,_0xf083('0x10'));_0x1cf157(_0x1cd0ff[_0xf083('0x17')][_0xf083('0x15')]);}})[_0xf083('0x18')](function(_0x153d1c){logger['error'](_0xf083('0x14'),_0x5a7be5,_0x153d1c);_0x37d98c(_0x153d1c);});});}exports[_0xf083('0x19')]=function(_0xad2cac){var _0x9acdc2=this;return new Promise(function(_0x65258,_0x507889){return db[_0xf083('0x1a')][_0xf083('0x1b')]({'raw':_0xad2cac['options']?_0xad2cac['options'][_0xf083('0x1c')]===undefined?!![]:![]:!![],'where':_0xad2cac[_0xf083('0x1d')]?_0xad2cac['options'][_0xf083('0x1e')]||null:null,'attributes':_0xad2cac[_0xf083('0x1d')]?_0xad2cac[_0xf083('0x1d')]['attributes']||null:null,'limit':_0xad2cac[_0xf083('0x1d')]?_0xad2cac[_0xf083('0x1d')]['limit']||null:null,'include':_0xad2cac[_0xf083('0x1d')]?_0xad2cac[_0xf083('0x1d')][_0xf083('0x1f')]?_[_0xf083('0x20')](_0xad2cac[_0xf083('0x1d')][_0xf083('0x1f')],function(_0x27665c){return{'model':db[_0x27665c[_0xf083('0x21')]],'as':_0x27665c['as'],'attributes':_0x27665c[_0xf083('0x22')],'include':_0x27665c[_0xf083('0x1f')]?_[_0xf083('0x20')](_0x27665c[_0xf083('0x1f')],function(_0x320639){return{'model':db[_0x320639[_0xf083('0x21')]],'as':_0x320639['as'],'attributes':_0x320639[_0xf083('0x22')],'include':_0x320639[_0xf083('0x1f')]?_[_0xf083('0x20')](_0x320639[_0xf083('0x1f')],function(_0x3bd9a7){return{'model':db[_0x3bd9a7['model']],'as':_0x3bd9a7['as'],'attributes':_0x3bd9a7[_0xf083('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26722b){logger[_0xf083('0x16')]('GetUser',_0xad2cac);logger[_0xf083('0x11')](_0xf083('0x19'),_0xad2cac,JSON[_0xf083('0x23')](_0x26722b));_0x65258(_0x26722b);})[_0xf083('0x18')](function(_0x3d84f6){logger[_0xf083('0x12')]('GetUser',_0x3d84f6[_0xf083('0x15')],_0xad2cac);_0x507889(_0x9acdc2[_0xf083('0x12')](0x1f4,_0x3d84f6[_0xf083('0x15')]));});});};exports[_0xf083('0x24')]=function(_0x5394ed){var _0xfdafa3=this;return new Promise(function(_0x2169a2,_0x340606){return db[_0xf083('0x1a')][_0xf083('0x25')]({'raw':_0x5394ed['options']?_0x5394ed[_0xf083('0x1d')][_0xf083('0x1c')]===undefined?!![]:![]:!![],'where':_0x5394ed[_0xf083('0x1d')]?_0x5394ed[_0xf083('0x1d')][_0xf083('0x1e')]||null:null,'attributes':_0x5394ed[_0xf083('0x1d')]?_0x5394ed[_0xf083('0x1d')][_0xf083('0x22')]||null:null,'include':_0x5394ed['options']?_0x5394ed[_0xf083('0x1d')][_0xf083('0x1f')]?_[_0xf083('0x20')](_0x5394ed[_0xf083('0x1d')][_0xf083('0x1f')],function(_0x38fa59){return{'model':db[_0x38fa59[_0xf083('0x21')]],'as':_0x38fa59['as'],'attributes':_0x38fa59[_0xf083('0x22')],'include':_0x38fa59['include']?_[_0xf083('0x20')](_0x38fa59[_0xf083('0x1f')],function(_0x132829){return{'model':db[_0x132829[_0xf083('0x21')]],'as':_0x132829['as'],'attributes':_0x132829[_0xf083('0x22')],'include':_0x132829[_0xf083('0x1f')]?_[_0xf083('0x20')](_0x132829[_0xf083('0x1f')],function(_0x4dead7){return{'model':db[_0x4dead7[_0xf083('0x21')]],'as':_0x4dead7['as'],'attributes':_0x4dead7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cb290){logger[_0xf083('0x16')](_0xf083('0x24'),_0x5394ed);logger[_0xf083('0x11')]('ShowUser',_0x5394ed,JSON[_0xf083('0x23')](_0x5cb290));_0x2169a2(_0x5cb290);})['catch'](function(_0x4d08cf){logger[_0xf083('0x12')](_0xf083('0x24'),_0x4d08cf['message'],_0x5394ed);_0x340606(_0xfdafa3[_0xf083('0x12')](0x1f4,_0x4d08cf[_0xf083('0x15')]));});});};exports['PauseUser']=function(_0x406613){var _0x6bf0d6=this;return new Promise(function(_0x5cde4a,_0x472619){var _0x475afa;return db[_0xf083('0x1a')][_0xf083('0x25')]({'where':_0x406613[_0xf083('0x1d')][_0xf083('0x1e')]||{},'attributes':['id',_0xf083('0x26'),_0xf083('0x27'),_0xf083('0x28'),_0xf083('0x29')]})[_0xf083('0x2a')](function(_0x492a4f){if(_0x492a4f){_0x475afa=_0x492a4f;return db[_0xf083('0x2b')][_0xf083('0x2c')]({'paused':0x1},{'where':{'UserId':_0x475afa['id']},'individualHooks':!![]});}})[_0xf083('0x2a')](function(){if(_0x475afa){return db['MemberReport'][_0xf083('0x1b')]({'where':{'membername':_0x475afa[_0xf083('0x26')],'type':_0xf083('0x2d'),'exitAt':null}});}})[_0xf083('0x2a')](function(_0x261682){if(_0x475afa){if(_0x261682&&_0x261682['length']){var _0x59e047=moment()[_0xf083('0x2e')](_0xf083('0x2f'));for(var _0x428387=0x0,_0x37489b=_0x261682[_0xf083('0x30')];_0x428387<_0x37489b;_0x428387++){_0x261682[_0x428387][_0xf083('0x31')]({'exitAt':_0x59e047});}}}})[_0xf083('0x2a')](function(){if(_0x475afa){var _0x7d5480=[];var _0x4bdde1=utils[_0xf083('0x32')]();_0x4bdde1[_0xf083('0x33')](function(_0x26e490){_0x7d5480[_0xf083('0x34')]({'channel':_0x26e490,'membername':_0x475afa[_0xf083('0x26')],'interface':_[_0xf083('0x35')](_0x475afa[_0xf083('0x29')])?util['format'](_0xf083('0x36'),_0x475afa['name']):_0x475afa['interface'],'type':'PAUSE','enterAt':moment()['format'](_0xf083('0x2f')),'data1':_0x406613[_0xf083('0x37')][_0xf083('0x38')]||_0xf083('0x39'),'role':_0x475afa['role'],'internal':_0x475afa['internal'],'uniqueid':_0x406613['body'][_0xf083('0x3a')]||null});});return db[_0xf083('0x3b')][_0xf083('0x3c')](_0x7d5480,{'individualHooks':!![]});}})[_0xf083('0x2a')](function(){if(_0x475afa){return _0x475afa[_0xf083('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x406613[_0xf083('0x37')][_0xf083('0x38')]||_0xf083('0x39'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x141f5e){_0x5cde4a(_0x141f5e);})[_0xf083('0x18')](function(_0x45f237){_0x472619(_0x6bf0d6['error'](0x1f4,_0x45f237[_0xf083('0x15')]));});});};exports[_0xf083('0x3d')]=function(_0x15d3bf){var _0x47407c=this;return new Promise(function(_0x449d46,_0x5690cb){var _0x298d0b;return db[_0xf083('0x1a')][_0xf083('0x3e')]({'where':_0x15d3bf['options'][_0xf083('0x1e')]||{},'attributes':['id',_0xf083('0x26')]})[_0xf083('0x2a')](function(_0x19e08a){if(_0x19e08a){_0x298d0b=_0x19e08a;if(_0x15d3bf['body']['channel']&&!utils[_0xf083('0x3f')](_0x15d3bf[_0xf083('0x37')][_0xf083('0x40')])){throw new Error(_0xf083('0x41'));}switch(_0x15d3bf[_0xf083('0x37')][_0xf083('0x40')]){case _0xf083('0x42'):return db[_0xf083('0x2b')][_0xf083('0x2c')]({'paused':0x0},{'where':{'UserId':_0x298d0b['id']}})['then'](function(){return db[_0xf083('0x3b')][_0xf083('0x25')]({'where':{'channel':_0x15d3bf[_0xf083('0x37')][_0xf083('0x40')],'membername':_0x298d0b[_0xf083('0x26')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x27bf0c){if(_0x27bf0c){return _0x27bf0c['update']({'exitAt':moment()[_0xf083('0x2e')](_0xf083('0x2f')),'data2':_0xf083('0x43')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x298d0b['update']({'voicePause':![]});});case _0xf083('0x44'):case _0xf083('0x45'):case _0xf083('0x46'):case _0xf083('0x47'):case _0xf083('0x48'):case _0xf083('0x49'):return db[_0xf083('0x3b')]['find']({'where':{'channel':_0x15d3bf[_0xf083('0x37')][_0xf083('0x40')],'membername':_0x298d0b[_0xf083('0x26')],'type':_0xf083('0x2d'),'exitAt':null}})['then'](function(_0x8633df){return _0x8633df['update']({'exitAt':moment()[_0xf083('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xf083('0x2a')](function(){var _0x45539c={};_[_0xf083('0x4a')](_0x45539c,util[_0xf083('0x2e')](_0xf083('0x4b'),_0x15d3bf[_0xf083('0x37')][_0xf083('0x40')],_0xf083('0x4c')),![]);return _0x298d0b[_0xf083('0x2c')](_0x45539c);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x298d0b['id']}})[_0xf083('0x2a')](function(){return db[_0xf083('0x3b')][_0xf083('0x1b')]({'where':{'membername':_0x298d0b['name'],'type':_0xf083('0x2d'),'exitAt':null}});})[_0xf083('0x2a')](function(_0x118620){var _0x3d3125=[];_0x118620[_0xf083('0x33')](function(_0xc54e59){_0x3d3125[_0xf083('0x34')](_0xc54e59['update']({'exitAt':moment()['format'](_0xf083('0x2f')),'data2':_0xf083('0x43')}));});return BPromise['all'](_0x3d3125);})[_0xf083('0x2a')](function(){return _0x298d0b['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x27469f){_0x449d46(_0x27469f);})[_0xf083('0x18')](function(_0x14431c){_0x5690cb(_0x47407c[_0xf083('0x12')](0x1f4,_0x14431c[_0xf083('0x15')]));});});};exports[_0xf083('0x4d')]=function(_0x1ffb9d){var _0x291de2=this;return new Promise(function(_0x462123,_0x1235ed){var _0x1dbbcf;return db[_0xf083('0x1a')][_0xf083('0x3e')]({'where':_0x1ffb9d[_0xf083('0x1d')][_0xf083('0x1e')]||{},'attributes':['id',_0xf083('0x26')]})[_0xf083('0x2a')](function(_0x4ef988){if(_0x4ef988){_0x1dbbcf=_0x4ef988;return db[_0xf083('0x2b')][_0xf083('0x4e')]({'where':{'membername':_0x1dbbcf['name']},'individualHooks':!![]});}})[_0xf083('0x2a')](function(){if(_0x1dbbcf){return db[_0xf083('0x3b')][_0xf083('0x1b')]({'where':{'membername':_0x1dbbcf[_0xf083('0x26')],'exitAt':null}});}})[_0xf083('0x2a')](function(_0x55ef32){if(_0x1dbbcf){if(_0x55ef32&&_0x55ef32[_0xf083('0x30')]){var _0x279959=[];_0x55ef32[_0xf083('0x33')](function(_0x1418d7){_0x279959['push'](_0x1418d7[_0xf083('0x2c')]({'exitAt':moment()[_0xf083('0x2e')](_0xf083('0x2f'))}));});return BPromise['all'](_0x279959);}}})[_0xf083('0x2a')](function(){if(_0x1dbbcf){return _0x1dbbcf[_0xf083('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf083('0x2a')](function(_0x4989a5){_0x462123(_0x4989a5);})[_0xf083('0x18')](function(_0x53577e){_0x1235ed(_0x291de2[_0xf083('0x12')](0x1f4,_0x53577e[_0xf083('0x15')]));});});};exports[_0xf083('0x4f')]=function(_0x3afcbb){var _0x3986db=this;return new Promise(function(_0x382831,_0x3265fc){var _0x2f2111;var _0x133790;var _0x4454ea;var _0x116ea8;return db[_0xf083('0x1a')][_0xf083('0x3e')]({'where':_0x3afcbb[_0xf083('0x1d')][_0xf083('0x1e')]||{},'attributes':['id','name',_0xf083('0x27'),_0xf083('0x50'),_0xf083('0x51'),_0xf083('0x28'),_0xf083('0x52'),_0xf083('0x29')]})[_0xf083('0x2a')](function(_0x116412){if(_0x116412){_0x2f2111=_0x116412;_0x116ea8=_0x3afcbb['body'][_0xf083('0x29')]?_0x3afcbb[_0xf083('0x37')][_0xf083('0x29')]:util[_0xf083('0x2e')]('SIP/%s',_0x2f2111[_0xf083('0x26')]);return db[_0xf083('0x1a')][_0xf083('0x53')]({'where':{'role':_0xf083('0x54'),'online':!![],'id':{'$ne':_0x2f2111['id']}}});}})[_0xf083('0x2a')](function(_0x273b8a){if(_0x273b8a){_0x4454ea=_0x273b8a;return require(_0xf083('0x55'))['getLicense']();}})[_0xf083('0x2a')](function(_0x3740ff){if(_0x3740ff&&_0x3740ff['agents']&&_0x4454ea>=_0x3740ff['agents']){throw new Error(_0xf083('0x56'));}})[_0xf083('0x2a')](function(){if(_0x2f2111){return db[_0xf083('0x2b')][_0xf083('0x4e')]({'where':{'membername':_0x2f2111['name']},'individualHooks':!![]});}})[_0xf083('0x2a')](function(){if(_0x2f2111){return _0x2f2111[_0xf083('0x57')]({'raw':!![]});}})['then'](function(_0x1c726e){if(_0x2f2111){if(_0x1c726e){var _0x2eb04c=[];_0x133790=_0x1c726e;if(_0x133790[_0xf083('0x30')]){for(var _0x293926=0x0;_0x293926<_0x133790[_0xf083('0x30')];_0x293926++){_0x2eb04c['push'](db['UserVoiceQueueRt'][_0xf083('0x58')]({'membername':_0x2f2111['name'],'UserId':_0x2f2111['id'],'queue_name':_0x133790[_0x293926][_0xf083('0x26')],'VoiceQueueId':_0x133790[_0x293926]['id'],'interface':_0x116ea8,'paused':_0x2f2111[_0xf083('0x52')]||![],'penalty':_0x133790[_0x293926][_0xf083('0x59')]||0x0}));}return BPromise[_0xf083('0x5a')](_0x2eb04c);}}}})['then'](function(){if(_0x2f2111){return db['MemberReport'][_0xf083('0x1b')]({'where':{'membername':_0x2f2111[_0xf083('0x26')],'exitAt':null}});}})[_0xf083('0x2a')](function(_0x4b8ea3){if(_0x2f2111){if(_0x4b8ea3&&_0x4b8ea3[_0xf083('0x30')]){var _0x4a5790=[];_0x4b8ea3[_0xf083('0x33')](function(_0x268d0d){_0x4a5790[_0xf083('0x34')](_0x268d0d[_0xf083('0x2c')]({'exitAt':moment()[_0xf083('0x2e')](_0xf083('0x2f'))}));});return BPromise[_0xf083('0x5a')](_0x4a5790);}}})[_0xf083('0x2a')](function(_0x3a2053){if(_0x2f2111){var _0x1fcc4e=[];var _0x4e08c6=[];var _0x5c6d75=utils[_0xf083('0x32')]();var _0x44aacf={'membername':_0x2f2111['name'],'interface':_0x116ea8,'enterAt':moment()[_0xf083('0x2e')](_0xf083('0x2f')),'role':_0x2f2111[_0xf083('0x27')],'internal':_0x2f2111[_0xf083('0x28')]};_0x5c6d75['forEach'](function(_0xa642b2){_0x1fcc4e[_0xf083('0x34')](_[_0xf083('0x5b')]({'channel':_0xa642b2,'type':_0xf083('0x5c'),'data1':_0xf083('0x5d'),'data2':_0x116ea8},_0x44aacf));if(_0x2f2111['loginInPause']){_0x4e08c6[_0xf083('0x34')](_[_0xf083('0x5b')]({'channel':_0xa642b2,'type':_0xf083('0x2d'),'data1':_0xf083('0x5e')},_0x44aacf));}});return db[_0xf083('0x3b')][_0xf083('0x3c')](_0x1fcc4e[_0xf083('0x5f')](_0x4e08c6),{'individualHooks':!![]});}})[_0xf083('0x2a')](function(){if(_0x2f2111){return _0x2f2111[_0xf083('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xf083('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2f2111['loginInPause']||![],'mailPause':_0x2f2111['loginInPause']||![],'chatPause':_0x2f2111[_0xf083('0x52')]||![],'faxPause':_0x2f2111[_0xf083('0x52')]||![],'smsPause':_0x2f2111[_0xf083('0x52')]||![],'openchannelPause':_0x2f2111['loginInPause']||![],'pauseType':_0x2f2111[_0xf083('0x52')]?_0xf083('0x5e'):null,'lastPauseAt':moment()[_0xf083('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x116ea8});}})['then'](function(_0x811a05){_0x382831(_0x811a05);})['catch'](function(_0x7b8c88){_0x3265fc(_0x3986db[_0xf083('0x12')](0x1f4,_0x7b8c88['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 8337718..360edf0 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 _0xeb9f=['length','./user.events','remove','update','removeListener','register'];(function(_0x318fbe,_0x1fa59a){var _0x567981=function(_0x2e21c9){while(--_0x2e21c9){_0x318fbe['push'](_0x318fbe['shift']());}};_0x567981(++_0x1fa59a);}(_0xeb9f,0xcd));var _0xfeb9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xeb9f[_0x4fbfd9];return _0x31dc94;};'use strict';var UserEvents=require(_0xfeb9('0x0'));var events=['save',_0xfeb9('0x1'),_0xfeb9('0x2')];function createListener(_0x4c08fa,_0x154535){return function(_0x214c18){_0x154535['emit'](_0x4c08fa,_0x214c18);};}function removeListener(_0x4ec4af,_0x48a752){return function(){UserEvents[_0xfeb9('0x3')](_0x4ec4af,_0x48a752);};}exports[_0xfeb9('0x4')]=function(_0xc565d3){for(var _0x28a20f=0x0,_0x29a40f=events[_0xfeb9('0x5')];_0x28a20f<_0x29a40f;_0x28a20f++){var _0x2f394d=events[_0x28a20f];var _0x402f79=createListener('user:'+_0x2f394d,_0xc565d3);UserEvents['on'](_0x2f394d,_0x402f79);}}; \ No newline at end of file +var _0xf608=['update','emit','removeListener','register','length','save'];(function(_0x29db14,_0x4fcd9f){var _0x5cfc55=function(_0x144719){while(--_0x144719){_0x29db14['push'](_0x29db14['shift']());}};_0x5cfc55(++_0x4fcd9f);}(_0xf608,0x119));var _0x8f60=function(_0x43f8cc,_0x592b95){_0x43f8cc=_0x43f8cc-0x0;var _0x1c8808=_0xf608[_0x43f8cc];return _0x1c8808;};'use strict';var UserEvents=require('./user.events');var events=[_0x8f60('0x0'),'remove',_0x8f60('0x1')];function createListener(_0x314b95,_0x12cf14){return function(_0x234b8d){_0x12cf14[_0x8f60('0x2')](_0x314b95,_0x234b8d);};}function removeListener(_0x1f33c0,_0x21fbac){return function(){UserEvents[_0x8f60('0x3')](_0x1f33c0,_0x21fbac);};}exports[_0x8f60('0x4')]=function(_0x4e066c){for(var _0x2f74b1=0x0,_0x404ea6=events[_0x8f60('0x5')];_0x2f74b1<_0x404ea6;_0x2f74b1++){var _0x382160=events[_0x2f74b1];var _0x258ae4=createListener('user:'+_0x382160,_0x4e066c);UserEvents['on'](_0x382160,_0x258ae4);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4673c41..3b47e97 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x37c4af,_0x30622f){var _0x554849=function(_0x365001){while(--_0x365001){_0x37c4af['push'](_0x37c4af['shift']());}};_0x554849(++_0x30622f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54d767,_0xf9dc22){var _0x32342c=function(_0x2d8b3e){while(--_0x2d8b3e){_0x54d767['push'](_0x54d767['shift']());}};_0x32342c(++_0xf9dc22);}(_0xe706,0xa3));var _0x6e70=function(_0x2d04a6,_0x5bbf0a){_0x2d04a6=_0x2d04a6-0x0;var _0x3cd00e=_0xe706[_0x2d04a6];return _0x3cd00e;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8bde1a7..4d51e99 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 _0x53c8=['sequelize','exports','INTEGER'];(function(_0x1bd751,_0x1e3ca3){var _0x48c93c=function(_0x1e6b91){while(--_0x1e6b91){_0x1bd751['push'](_0x1bd751['shift']());}};_0x48c93c(++_0x1e3ca3);}(_0x53c8,0xdb));var _0x853c=function(_0x4f84c3,_0x6d094d){_0x4f84c3=_0x4f84c3-0x0;var _0x460f9f=_0x53c8[_0x4f84c3];return _0x460f9f;};'use strict';var Sequelize=require(_0x853c('0x0'));module[_0x853c('0x1')]={'penalty':{'type':Sequelize[_0x853c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe9d5=['exports','INTEGER','sequelize'];(function(_0x5eac76,_0x159472){var _0x5a151e=function(_0x3e39e8){while(--_0x3e39e8){_0x5eac76['push'](_0x5eac76['shift']());}};_0x5a151e(++_0x159472);}(_0xe9d5,0x191));var _0x5e9d=function(_0x479774,_0x393894){_0x479774=_0x479774-0x0;var _0x5f4e5c=_0xe9d5[_0x479774];return _0x5f4e5c;};'use strict';var Sequelize=require(_0x5e9d('0x0'));module[_0x5e9d('0x1')]={'penalty':{'type':Sequelize[_0x5e9d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 095ce6f..8d7e0b4 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 _0x4aba=['define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4aba,0x183));var _0xa4ab=function(_0x5724dc,_0x2465af){_0x5724dc=_0x5724dc-0x0;var _0x294b7f=_0x4aba[_0x5724dc];return _0x294b7f;};'use strict';var _=require(_0xa4ab('0x0'));var util=require(_0xa4ab('0x1'));var logger=require('../../config/logger')(_0xa4ab('0x2'));var moment=require(_0xa4ab('0x3'));var BPromise=require(_0xa4ab('0x4'));var rp=require(_0xa4ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa4ab('0x6'));var attributes=require(_0xa4ab('0x7'));module[_0xa4ab('0x8')]=function(_0x15aaa7,_0x1b2d1d){return _0x15aaa7[_0xa4ab('0x9')](_0xa4ab('0xa'),attributes,{'tableName':_0xa4ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1348=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes'];(function(_0x1c69d1,_0x4d0b4e){var _0x503c45=function(_0x1e5430){while(--_0x1e5430){_0x1c69d1['push'](_0x1c69d1['shift']());}};_0x503c45(++_0x4d0b4e);}(_0x1348,0x1e5));var _0x8134=function(_0x24cc4b,_0x3b594a){_0x24cc4b=_0x24cc4b-0x0;var _0x27a4e3=_0x1348[_0x24cc4b];return _0x27a4e3;};'use strict';var _=require(_0x8134('0x0'));var util=require(_0x8134('0x1'));var logger=require('../../config/logger')(_0x8134('0x2'));var moment=require(_0x8134('0x3'));var BPromise=require(_0x8134('0x4'));var rp=require(_0x8134('0x5'));var fs=require('fs');var path=require(_0x8134('0x6'));var rimraf=require('rimraf');var config=require(_0x8134('0x7'));var attributes=require(_0x8134('0x8'));module[_0x8134('0x9')]=function(_0x17ce67,_0x43ddef){return _0x17ce67[_0x8134('0xa')](_0x8134('0xb'),attributes,{'tableName':_0x8134('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 01fc002..2091a74 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 _0x7b4e=['error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f88e3,_0x5d313e){var _0x4e0159=function(_0x556e04){while(--_0x556e04){_0x3f88e3['push'](_0x3f88e3['shift']());}};_0x4e0159(++_0x5d313e);}(_0x7b4e,0x143));var _0xe7b4=function(_0x3f0a2b,_0x13d5f8){_0x3f0a2b=_0x3f0a2b-0x0;var _0x496dee=_0x7b4e[_0x3f0a2b];return _0x496dee;};'use strict';var _=require(_0xe7b4('0x0'));var util=require('util');var moment=require(_0xe7b4('0x1'));var BPromise=require(_0xe7b4('0x2'));var rs=require(_0xe7b4('0x3'));var fs=require('fs');var Redis=require(_0xe7b4('0x4'));var db=require(_0xe7b4('0x5'))['db'];var utils=require(_0xe7b4('0x6'));var logger=require('../../config/logger')(_0xe7b4('0x7'));var config=require(_0xe7b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7b4('0x9')][_0xe7b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438ce9,_0x16fc9b,_0x21bb8a){return new BPromise(function(_0xde3730,_0x24717a){return client[_0xe7b4('0xb')](_0x438ce9,_0x21bb8a)[_0xe7b4('0xc')](function(_0x18519f){logger[_0xe7b4('0xd')](_0xe7b4('0xe'),_0x16fc9b,_0xe7b4('0xf'));logger[_0xe7b4('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x16fc9b,_0xe7b4('0xf'),JSON['stringify'](_0x18519f));if(_0x18519f[_0xe7b4('0x11')]){if(_0x18519f[_0xe7b4('0x11')]['code']===0x1f4){logger['error'](_0xe7b4('0xe'),_0x16fc9b,_0x18519f[_0xe7b4('0x11')]['message']);return _0x24717a(_0x18519f['error'][_0xe7b4('0x12')]);}logger[_0xe7b4('0x11')](_0xe7b4('0xe'),_0x16fc9b,_0x18519f['error'][_0xe7b4('0x12')]);return _0xde3730(_0x18519f[_0xe7b4('0x11')][_0xe7b4('0x12')]);}else{logger[_0xe7b4('0xd')](_0xe7b4('0xe'),_0x16fc9b,_0xe7b4('0xf'));_0xde3730(_0x18519f['result'][_0xe7b4('0x12')]);}})[_0xe7b4('0x13')](function(_0x17359f){logger['error'](_0xe7b4('0xe'),_0x16fc9b,_0x17359f);_0x24717a(_0x17359f);});});} \ No newline at end of file +var _0xda0a=['message','result','catch','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0xda0a,0x11b));var _0xada0=function(_0x249a31,_0x177f72){_0x249a31=_0x249a31-0x0;var _0x562b07=_0xda0a[_0x249a31];return _0x562b07;};'use strict';var _=require('lodash');var util=require(_0xada0('0x0'));var moment=require('moment');var BPromise=require(_0xada0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xada0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xada0('0x3'));var logger=require('../../config/logger')(_0xada0('0x4'));var config=require(_0xada0('0x5'));var jayson=require(_0xada0('0x6'));var client=jayson[_0xada0('0x7')][_0xada0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9780b4,_0x1ecfd9,_0x1b3d3a){return new BPromise(function(_0x51a21a,_0x1912e3){return client[_0xada0('0x9')](_0x9780b4,_0x1b3d3a)['then'](function(_0x23e045){logger[_0xada0('0xa')](_0xada0('0xb'),_0x1ecfd9,_0xada0('0xc'));logger['debug'](_0xada0('0xd'),_0x1ecfd9,_0xada0('0xc'),JSON[_0xada0('0xe')](_0x23e045));if(_0x23e045[_0xada0('0xf')]){if(_0x23e045[_0xada0('0xf')][_0xada0('0x10')]===0x1f4){logger['error'](_0xada0('0xb'),_0x1ecfd9,_0x23e045[_0xada0('0xf')][_0xada0('0x11')]);return _0x1912e3(_0x23e045[_0xada0('0xf')]['message']);}logger[_0xada0('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1ecfd9,_0x23e045[_0xada0('0xf')][_0xada0('0x11')]);return _0x51a21a(_0x23e045[_0xada0('0xf')][_0xada0('0x11')]);}else{logger[_0xada0('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x1ecfd9,_0xada0('0xc'));_0x51a21a(_0x23e045[_0xada0('0x12')][_0xada0('0x11')]);}})[_0xada0('0x13')](function(_0x2561ee){logger[_0xada0('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1ecfd9,_0x2561ee);_0x1912e3(_0x2561ee);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 03a418e..dd6677c 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x45b3b7,_0x2b645e){var _0x2849dd=function(_0x2e79bd){while(--_0x2e79bd){_0x45b3b7['push'](_0x45b3b7['shift']());}};_0x2849dd(++_0x2b645e);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x361ddd,_0x503739){var _0x3a92da=function(_0x439b0e){while(--_0x439b0e){_0x361ddd['push'](_0x361ddd['shift']());}};_0x3a92da(++_0x503739);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 4dd7f5d..37bbaed 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 _0x6e3c=['INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6e3c,0xd5));var _0xc6e3=function(_0x9884e3,_0x34a043){_0x9884e3=_0x9884e3-0x0;var _0x6e3ec=_0x6e3c[_0x9884e3];return _0x6e3ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc6e3('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc6e3('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ca4=['STRING','INTEGER'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7ca4,0x9f));var _0x47ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ca4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x47ca('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x47ca('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x47ca('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2929477..b7ed00b 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 _0x3599=['../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','moment','rimraf'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x3599,0xf8));var _0x9359=function(_0x4cd91b,_0x4fe507){_0x4cd91b=_0x4cd91b-0x0;var _0x2a0054=_0x3599[_0x4cd91b];return _0x2a0054;};'use strict';var _=require('lodash');var util=require(_0x9359('0x0'));var logger=require(_0x9359('0x1'))('api');var moment=require(_0x9359('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9359('0x3'));var config=require(_0x9359('0x4'));var attributes=require(_0x9359('0x5'));module[_0x9359('0x6')]=function(_0x3bc797,_0x161c26){return _0x3bc797['define'](_0x9359('0x7'),attributes,{'tableName':_0x9359('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c2f=['./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c2f,0x66));var _0xf7c2=function(_0x384121,_0x12703c){_0x384121=_0x384121-0x0;var _0x101fdb=_0x7c2f[_0x384121];return _0x101fdb;};'use strict';var _=require(_0xf7c2('0x0'));var util=require(_0xf7c2('0x1'));var logger=require(_0xf7c2('0x2'))(_0xf7c2('0x3'));var moment=require(_0xf7c2('0x4'));var BPromise=require(_0xf7c2('0x5'));var rp=require(_0xf7c2('0x6'));var fs=require('fs');var path=require(_0xf7c2('0x7'));var rimraf=require(_0xf7c2('0x8'));var config=require(_0xf7c2('0x9'));var attributes=require(_0xf7c2('0xa'));module[_0xf7c2('0xb')]=function(_0x143c25,_0x3767d1){return _0x143c25['define'](_0xf7c2('0xc'),attributes,{'tableName':_0xf7c2('0xd'),'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 bf0cafb..33d7377 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 _0xc2dc=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc2dc,0x1ed));var _0xcc2d=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xc2dc[_0x4178af];return _0x20f4b1;};'use strict';var _=require('lodash');var util=require(_0xcc2d('0x0'));var moment=require('moment');var BPromise=require(_0xcc2d('0x1'));var rs=require(_0xcc2d('0x2'));var fs=require('fs');var Redis=require(_0xcc2d('0x3'));var db=require(_0xcc2d('0x4'))['db'];var utils=require(_0xcc2d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc2d('0x6'));var jayson=require(_0xcc2d('0x7'));var client=jayson[_0xcc2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe4d6c6,_0x300c03,_0x71ad2f){return new BPromise(function(_0x563f0a,_0x4fe44f){return client[_0xcc2d('0x9')](_0xe4d6c6,_0x71ad2f)[_0xcc2d('0xa')](function(_0x3fc08b){logger[_0xcc2d('0xb')](_0xcc2d('0xc'),_0x300c03,_0xcc2d('0xd'));logger['debug'](_0xcc2d('0xe'),_0x300c03,_0xcc2d('0xd'),JSON[_0xcc2d('0xf')](_0x3fc08b));if(_0x3fc08b['error']){if(_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x11')]===0x1f4){logger['error'](_0xcc2d('0xc'),_0x300c03,_0x3fc08b['error'][_0xcc2d('0x12')]);return _0x4fe44f(_0x3fc08b[_0xcc2d('0x10')]['message']);}logger[_0xcc2d('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x300c03,_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x12')]);return _0x563f0a(_0x3fc08b[_0xcc2d('0x10')][_0xcc2d('0x12')]);}else{logger['info'](_0xcc2d('0xc'),_0x300c03,_0xcc2d('0xd'));_0x563f0a(_0x3fc08b[_0xcc2d('0x13')][_0xcc2d('0x12')]);}})[_0xcc2d('0x14')](function(_0x50d3d1){logger[_0xcc2d('0x10')](_0xcc2d('0xc'),_0x300c03,_0x50d3d1);_0x4fe44f(_0x50d3d1);});});} \ No newline at end of file +var _0x737f=['jayson/promise','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x766002,_0x417019){var _0x2d26be=function(_0x1f425a){while(--_0x1f425a){_0x766002['push'](_0x766002['shift']());}};_0x2d26be(++_0x417019);}(_0x737f,0xbe));var _0xf737=function(_0x284dd7,_0x5ac822){_0x284dd7=_0x284dd7-0x0;var _0x68eb0f=_0x737f[_0x284dd7];return _0x68eb0f;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var moment=require(_0xf737('0x2'));var BPromise=require(_0xf737('0x3'));var rs=require(_0xf737('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf737('0x5'));var logger=require(_0xf737('0x6'))('rpc');var config=require(_0xf737('0x7'));var jayson=require(_0xf737('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15c8f2,_0x136596,_0x5e6faf){return new BPromise(function(_0x15bab0,_0x4d95c2){return client[_0xf737('0x9')](_0x15c8f2,_0x5e6faf)[_0xf737('0xa')](function(_0x249406){logger[_0xf737('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x136596,_0xf737('0xc'));logger[_0xf737('0xd')](_0xf737('0xe'),_0x136596,_0xf737('0xc'),JSON[_0xf737('0xf')](_0x249406));if(_0x249406[_0xf737('0x10')]){if(_0x249406[_0xf737('0x10')][_0xf737('0x11')]===0x1f4){logger['error'](_0xf737('0x12'),_0x136596,_0x249406[_0xf737('0x10')][_0xf737('0x13')]);return _0x4d95c2(_0x249406['error'][_0xf737('0x13')]);}logger[_0xf737('0x10')](_0xf737('0x12'),_0x136596,_0x249406['error']['message']);return _0x15bab0(_0x249406[_0xf737('0x10')][_0xf737('0x13')]);}else{logger[_0xf737('0xb')](_0xf737('0x12'),_0x136596,_0xf737('0xc'));_0x15bab0(_0x249406[_0xf737('0x14')][_0xf737('0x13')]);}})[_0xf737('0x15')](function(_0x59b2f6){logger['error'](_0xf737('0x12'),_0x136596,_0x59b2f6);_0x4d95c2(_0x59b2f6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e32a319..6902095 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xd7b331,_0x23f99d){var _0x225ef9=function(_0x3ac16a){while(--_0x3ac16a){_0xd7b331['push'](_0xd7b331['shift']());}};_0x225ef9(++_0x23f99d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x438115,_0x3ce808){var _0x497494=function(_0x435e81){while(--_0x435e81){_0x438115['push'](_0x438115['shift']());}};_0x497494(++_0x3ce808);}(_0xedd9,0xfc));var _0x9edd=function(_0x216d45,_0x2c077f){_0x216d45=_0x216d45-0x0;var _0x4140ab=_0xedd9[_0x216d45];return _0x4140ab;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 35b3112..9eb2ccd 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 _0x89d4=['INTEGER','sequelize','exports'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x89d4,0xc1));var _0x489d=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x89d4[_0x35c5a8];return _0x34782c;};'use strict';var Sequelize=require(_0x489d('0x0'));module[_0x489d('0x1')]={'penalty':{'type':Sequelize[_0x489d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc058=['INTEGER','sequelize'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc058,0xc7));var _0x8c05=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc058[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x8c05('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8c05('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 3d0cb6f..21fe25e 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 _0xb084=['api','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','../../config/logger'];(function(_0x239c5c,_0x1327c5){var _0x4672a8=function(_0x1cec43){while(--_0x1cec43){_0x239c5c['push'](_0x239c5c['shift']());}};_0x4672a8(++_0x1327c5);}(_0xb084,0x1c0));var _0x4b08=function(_0x3a1fd0,_0x2328f0){_0x3a1fd0=_0x3a1fd0-0x0;var _0x2fab36=_0xb084[_0x3a1fd0];return _0x2fab36;};'use strict';var _=require(_0x4b08('0x0'));var util=require('util');var logger=require(_0x4b08('0x1'))(_0x4b08('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b08('0x3'));var fs=require('fs');var path=require(_0x4b08('0x4'));var rimraf=require(_0x4b08('0x5'));var config=require(_0x4b08('0x6'));var attributes=require(_0x4b08('0x7'));module['exports']=function(_0x271cab,_0x40363f){return _0x271cab[_0x4b08('0x8')](_0x4b08('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0d4=['define','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x18bede,_0x5258f2){var _0xc64b0c=function(_0x22d8f5){while(--_0x22d8f5){_0x18bede['push'](_0x18bede['shift']());}};_0xc64b0c(++_0x5258f2);}(_0xe0d4,0x100));var _0x4e0d=function(_0x3e4b22,_0x4b1c0f){_0x3e4b22=_0x3e4b22-0x0;var _0x1bb163=_0xe0d4[_0x3e4b22];return _0x1bb163;};'use strict';var _=require('lodash');var util=require(_0x4e0d('0x0'));var logger=require(_0x4e0d('0x1'))(_0x4e0d('0x2'));var moment=require(_0x4e0d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e0d('0x4'));var rimraf=require(_0x4e0d('0x5'));var config=require(_0x4e0d('0x6'));var attributes=require('./userMailQueue.attributes');module[_0x4e0d('0x7')]=function(_0x96816,_0x23a4ca){return _0x96816[_0x4e0d('0x8')](_0x4e0d('0x9'),attributes,{'tableName':_0x4e0d('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 235fdaa..693b033 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(_0x493623,_0x39d028){var _0x5cf00d=function(_0x36c1fa){while(--_0x36c1fa){_0x493623['push'](_0x493623['shift']());}};_0x5cf00d(++_0x39d028);}(_0xa41a,0x6b));var _0xaa41=function(_0x28cfad,_0x431c7e){_0x28cfad=_0x28cfad-0x0;var _0x1ddea3=_0xa41a[_0x28cfad];return _0x1ddea3;};'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(_0x5287a5,_0x544059){var _0x2a3a77=function(_0x38e55e){while(--_0x38e55e){_0x5287a5['push'](_0x5287a5['shift']());}};_0x2a3a77(++_0x544059);}(_0x6aa7,0x178));var _0x76aa=function(_0x4278e2,_0x32bc3d){_0x4278e2=_0x4278e2-0x0;var _0x509f33=_0x6aa7[_0x4278e2];return _0x509f33;};'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 848b01a..eb03bbe 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 _0x793f=['../../components/auth/service','../../components/interaction/service','post','isAuthenticated','exports','connect-timeout','express','Router','fs-extra'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x793f,0x12e));var _0xf793=function(_0x348295,_0x3daf50){_0x348295=_0x348295-0x0;var _0x32b929=_0x793f[_0x348295];return _0x32b929;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf793('0x0'));var express=require(_0xf793('0x1'));var router=express[_0xf793('0x2')]();var fs_extra=require(_0xf793('0x3'));var auth=require(_0xf793('0x4'));var interaction=require(_0xf793('0x5'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xf793('0x6')]('/',auth[_0xf793('0x7')](),controller['sendUserNotification']);module[_0xf793('0x8')]=router; \ No newline at end of file +var _0x6f4f=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x400ff5,_0x2d82c9){var _0x4b40af=function(_0x2d83b0){while(--_0x2d83b0){_0x400ff5['push'](_0x400ff5['shift']());}};_0x4b40af(++_0x2d82c9);}(_0x6f4f,0xf7));var _0xf6f4=function(_0x1d7c3c,_0x121e43){_0x1d7c3c=_0x1d7c3c-0x0;var _0x119afc=_0x6f4f[_0x1d7c3c];return _0x119afc;};'use strict';var multer=require(_0xf6f4('0x0'));var util=require(_0xf6f4('0x1'));var path=require(_0xf6f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6f4('0x3'));var router=express[_0xf6f4('0x4')]();var fs_extra=require(_0xf6f4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf6f4('0x6'));var config=require(_0xf6f4('0x7'));var controller=require(_0xf6f4('0x8'));router[_0xf6f4('0x9')]('/',auth[_0xf6f4('0xa')](),controller[_0xf6f4('0xb')]);module[_0xf6f4('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 66bb66b..70e37fd 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 _0x4e8a=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1cdc10,_0x4c2794){var _0x2ed8f8=function(_0x58e1d5){while(--_0x58e1d5){_0x1cdc10['push'](_0x1cdc10['shift']());}};_0x2ed8f8(++_0x4c2794);}(_0x4e8a,0x6c));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa4e8('0x0')]={'body':{'type':Sequelize[_0xa4e8('0x1')]},'senderName':{'type':Sequelize[_0xa4e8('0x2')]},'recipientsId':{'type':Sequelize[_0xa4e8('0x1')]},'recipientsDescription':{'type':Sequelize[_0xa4e8('0x2')]},'beep':{'type':Sequelize[_0xa4e8('0x3')]}}; \ No newline at end of file +var _0xb452=['BOOLEAN','exports','TEXT','STRING'];(function(_0x44e5b8,_0x2a9b10){var _0x2460f6=function(_0x4c1622){while(--_0x4c1622){_0x44e5b8['push'](_0x44e5b8['shift']());}};_0x2460f6(++_0x2a9b10);}(_0xb452,0x191));var _0x2b45=function(_0x5bac50,_0x540d00){_0x5bac50=_0x5bac50-0x0;var _0x28afd5=_0xb452[_0x5bac50];return _0x28afd5;};'use strict';var Sequelize=require('sequelize');module[_0x2b45('0x0')]={'body':{'type':Sequelize[_0x2b45('0x1')]},'senderName':{'type':Sequelize[_0x2b45('0x2')]},'recipientsId':{'type':Sequelize[_0x2b45('0x1')]},'recipientsDescription':{'type':Sequelize[_0x2b45('0x2')]},'beep':{'type':Sequelize[_0x2b45('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8daa6cb..09987e4 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 _0x39ba=['text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','union','ids','queue','Queue','forEach','push','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Sequelize','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','transaction','UserNotification','recipient','emit','userNotification:send','catch'];(function(_0x1d349c,_0x17bfef){var _0x2668dc=function(_0x21694d){while(--_0x21694d){_0x1d349c['push'](_0x1d349c['shift']());}};_0x2668dc(++_0x17bfef);}(_0x39ba,0x6c));var _0xa39b=function(_0x2a1962,_0x4c8d1d){_0x2a1962=_0x2a1962-0x0;var _0x3b0f51=_0x39ba[_0x2a1962];return _0x3b0f51;};'use strict';var emlformat=require(_0xa39b('0x0'));var rimraf=require(_0xa39b('0x1'));var zipdir=require(_0xa39b('0x2'));var jsonpatch=require(_0xa39b('0x3'));var rp=require(_0xa39b('0x4'));var moment=require(_0xa39b('0x5'));var BPromise=require(_0xa39b('0x6'));var Mustache=require(_0xa39b('0x7'));var util=require(_0xa39b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa39b('0x9'));var ejs=require(_0xa39b('0xa'));var fs=require('fs');var fs_extra=require(_0xa39b('0xb'));var _=require(_0xa39b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa39b('0xd'));var toCsv=require(_0xa39b('0x9'));var querystring=require(_0xa39b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa39b('0xf'));var authService=require(_0xa39b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa39b('0x11'));var hardwareService=require(_0xa39b('0x12'));var logger=require(_0xa39b('0x13'))(_0xa39b('0x14'));var utils=require('../../config/utils');var config=require(_0xa39b('0x15'));var licenseUtil=require(_0xa39b('0x16'));var db=require(_0xa39b('0x17'))['db'];config['redis']=_[_0xa39b('0x18')](config[_0xa39b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa39b('0x1a'))(new Redis(config[_0xa39b('0x19')]));require(_0xa39b('0x1b'))[_0xa39b('0x1c')](socket);function respondWithStatusCode(_0x18c14d,_0x17cb4a){_0x17cb4a=_0x17cb4a||0xcc;return function(_0x45173b){if(_0x45173b){return _0x18c14d[_0xa39b('0x1d')](_0x17cb4a);}return _0x18c14d[_0xa39b('0x1e')](_0x17cb4a)[_0xa39b('0x1f')]();};}function respondWithResult(_0x26da94,_0x7f855a){_0x7f855a=_0x7f855a||0xc8;return function(_0x59e0e3){if(_0x59e0e3){return _0x26da94[_0xa39b('0x1e')](_0x7f855a)[_0xa39b('0x20')](_0x59e0e3);}};}function respondWithFilteredResult(_0xfad3e,_0x479f06){return function(_0x39f357){if(_0x39f357){var _0x3b6c5a=typeof _0x479f06[_0xa39b('0x21')]===_0xa39b('0x22')&&typeof _0x479f06[_0xa39b('0x23')]===_0xa39b('0x22');var _0x1dc035=_0x39f357[_0xa39b('0x24')];var _0x4b2f0a=_0x3b6c5a?0x0:_0x479f06['offset'];var _0x598e98=_0x3b6c5a?_0x39f357[_0xa39b('0x24')]:_0x479f06[_0xa39b('0x21')]+_0x479f06['limit'];var _0x7ab644;if(_0x598e98>=_0x1dc035){_0x598e98=_0x1dc035;_0x7ab644=0xc8;}else{_0x7ab644=0xce;}_0xfad3e[_0xa39b('0x1e')](_0x7ab644);return _0xfad3e[_0xa39b('0x25')]('Content-Range',_0x4b2f0a+'-'+_0x598e98+'/'+_0x1dc035)[_0xa39b('0x20')](_0x39f357);}return null;};}function patchUpdates(_0x4daf7d){return function(_0x22637e){try{jsonpatch[_0xa39b('0x26')](_0x22637e,_0x4daf7d,!![]);}catch(_0x1421ea){return BPromise[_0xa39b('0x27')](_0x1421ea);}return _0x22637e[_0xa39b('0x28')]();};}function saveUpdates(_0x24f0f4,_0x6c7233){return function(_0x595738){if(_0x595738){return _0x595738[_0xa39b('0x29')](_0x24f0f4)[_0xa39b('0x2a')](function(_0x4d3e75){return _0x4d3e75;});}return null;};}function removeEntity(_0x5f345c,_0x325fd2){return function(_0xb2e1d0){if(_0xb2e1d0){return _0xb2e1d0['destroy']()[_0xa39b('0x2a')](function(){_0x5f345c[_0xa39b('0x1e')](0xcc)[_0xa39b('0x1f')]();});}};}function handleEntityNotFound(_0x27bbf2,_0x2b9fc8){return function(_0x3d0360){if(!_0x3d0360){_0x27bbf2[_0xa39b('0x1d')](0x194);}return _0x3d0360;};}function handleError(_0x43b218,_0x1b5fec){_0x1b5fec=_0x1b5fec||0x1f4;return function(_0x18e314){logger[_0xa39b('0x2b')](_0x18e314[_0xa39b('0x2c')]);if(_0x18e314[_0xa39b('0x2d')]){delete _0x18e314[_0xa39b('0x2d')];}_0x43b218[_0xa39b('0x1e')](_0x1b5fec)[_0xa39b('0x2e')](_0x18e314);};}exports[_0xa39b('0x2f')]=function(_0x38f52b,_0x43c7a2,_0xe92bb5){if(!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('text')&&!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')](_0xa39b('0x32'))){throw new db['Sequelize'][(_0xa39b('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x38f52b[_0xa39b('0x30')]['hasOwnProperty']('TemplateId')&&!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('view')){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x35'));}if(!_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('recipients')){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x36'));}else{try{var _0x4f27ac=JSON[_0xa39b('0x37')](_0x38f52b[_0xa39b('0x30')][_0xa39b('0x38')]);}catch(_0x2dd7e5){logger[_0xa39b('0x2b')](_0x2dd7e5);throw new db['Sequelize'][(_0xa39b('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x57bb09=['chatqueue','faxqueue',_0xa39b('0x39'),_0xa39b('0x3a'),_0xa39b('0x3b'),'voicequeue',_0xa39b('0x3c'),'team',_0xa39b('0x3d')];if(_[_0xa39b('0x3e')](_0x4f27ac,function(_0x54e61d){return!_[_0xa39b('0x3f')](_0x57bb09,_0x54e61d[_0xa39b('0x40')][_0xa39b('0x41')]());})){throw new db[(_0xa39b('0x34'))]['ValidationError'](_0xa39b('0x42'));}}}var _0x2d20bc={};_0x2d20bc[_0xa39b('0x43')]=_0x38f52b[_0xa39b('0x30')][_0xa39b('0x31')]('senderName')?_0x38f52b[_0xa39b('0x30')][_0xa39b('0x43')]:_0x38f52b[_0xa39b('0x3d')][_0xa39b('0x44')];_0x2d20bc[_0xa39b('0x45')]=_['isEmpty'](_0x38f52b['body'][_0xa39b('0x45')])?null:_0x38f52b['body'][_0xa39b('0x45')];_0x2d20bc['beep']=_0x38f52b[_0xa39b('0x30')][_0xa39b('0x46')]||![];_0x2d20bc[_0xa39b('0x47')]=_0x38f52b['user']['id'];return getContent(_0x38f52b['body'])['then'](function(_0x5b06f1){_0x2d20bc['body']=_0x5b06f1;return getRecipients(_0x4f27ac);})['then'](function(_0x65a043){_0x2d20bc['recipientsId']=_[_0xa39b('0x48')](_0x65a043)[_0xa39b('0x49')](',');return db['sequelize'][_0xa39b('0x4a')](function(_0x4cc3d4){return db[_0xa39b('0x4b')]['create'](_0x2d20bc,{'raw':!![],'transaction':_0x4cc3d4})[_0xa39b('0x2a')](function(_0x5baa30){var _0x3aea97={'sender':_0x2d20bc['senderName'],'description':_0x2d20bc[_0xa39b('0x45')],'content':_0x2d20bc[_0xa39b('0x30')],'beep':_0x2d20bc[_0xa39b('0x46')]};_0x65a043['forEach'](function(_0xea5814){_0x3aea97[_0xa39b('0x4c')]=_0xea5814;socket[_0xa39b('0x4d')](_0xa39b('0x4e'),_0x3aea97);});return _0x5baa30;});});})[_0xa39b('0x2a')](respondWithResult(_0x43c7a2,0xc9))[_0xa39b('0x4f')](handleError(_0x43c7a2,null));};function getContent(_0x63ee3){return new BPromise(function(_0x5af5b2,_0x1616fe){if(_0x63ee3[_0xa39b('0x50')]){_0x5af5b2(_0x63ee3[_0xa39b('0x50')]);return;}return db[_0xa39b('0x51')][_0xa39b('0x52')]({'attributes':[_0xa39b('0x53')],'where':{'id':_0x63ee3[_0xa39b('0x32')]},'raw':!![]})['then'](function(_0x7a588){if(!_0x7a588)throw new db[(_0xa39b('0x34'))][(_0xa39b('0x33'))](_0xa39b('0x54'));var _0x48a93e=Mustache['render'](_0x7a588['html'],_0x63ee3[_0xa39b('0x55')]);_0x5af5b2(_0x48a93e);})[_0xa39b('0x4f')](function(_0x18fa18){_0x1616fe(_0x18fa18);});});}function getRecipients(_0x4cb9da){return new BPromise(function(_0x50a352,_0xc4c26d){var _0x5449ff=[];var _0x181219=[];_0x4cb9da['forEach'](function(_0xf6de3e){var _0x5e650e=_['startCase'](_0xf6de3e['model'][_0xa39b('0x41')]());if(_0x5e650e==='User'){_0x5449ff=_[_0xa39b('0x56')](_0x5449ff,_0xf6de3e[_0xa39b('0x57')]);}else{if(_[_0xa39b('0x3f')](_0x5e650e,_0xa39b('0x58')))_0x5e650e=_0x5e650e['replace'](_0xa39b('0x58'),_0xa39b('0x59'));_0xf6de3e[_0xa39b('0x57')][_0xa39b('0x5a')](function(_0x2a4985){_0x181219[_0xa39b('0x5b')](getAgents(_0x5e650e,_0x2a4985));});}});return BPromise['all'](_0x181219)['then'](function(_0x1bc4b1){_0x5449ff=_[_0xa39b('0x56')](_0x5449ff,_[_0xa39b('0x5c')](_0x1bc4b1));_0x50a352(_0x5449ff);})[_0xa39b('0x4f')](function(_0x41f910){_0xc4c26d(_0x41f910);});});}function getAgents(_0x48df87,_0x970c8b){return new BPromise(function(_0x15b469,_0x4c23ac){return db[_0x48df87][_0xa39b('0x52')]({'where':{'id':_0x970c8b}})[_0xa39b('0x2a')](function(_0x4dee6b){return _0x4dee6b[_0xa39b('0x5d')]({'attributes':['id'],'raw':!![]})[_0xa39b('0x2a')](function(_0x291dfc){var _0x161ed=_['map'](_0x291dfc,'id');_0x15b469(_0x161ed);});})[_0xa39b('0x4f')](function(_0x3a8633){_0x4c23ac(_0x3a8633);});});} \ No newline at end of file +var _0x523d=['destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','view','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','toLowerCase','User','union','ids','queue','replace','flatten','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then'];(function(_0xd70515,_0x50cfb3){var _0x1e9a3a=function(_0xbb7d0c){while(--_0xbb7d0c){_0xd70515['push'](_0xd70515['shift']());}};_0x1e9a3a(++_0x50cfb3);}(_0x523d,0x1ac));var _0xd523=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x523d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd523('0x0'));var rimraf=require(_0xd523('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd523('0x2'));var rp=require('request-promise');var moment=require(_0xd523('0x3'));var BPromise=require(_0xd523('0x4'));var Mustache=require(_0xd523('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd523('0x6'));var csv=require(_0xd523('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd523('0x8'));var _=require(_0xd523('0x9'));var squel=require('squel');var crypto=require(_0xd523('0xa'));var jsforce=require(_0xd523('0xb'));var deskjs=require(_0xd523('0xc'));var toCsv=require(_0xd523('0x7'));var querystring=require(_0xd523('0xd'));var Papa=require('papaparse');var Redis=require(_0xd523('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd523('0xf'));var as=require(_0xd523('0x10'));var hardwareService=require(_0xd523('0x11'));var logger=require(_0xd523('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd523('0x13'));var licenseUtil=require(_0xd523('0x14'));var db=require('../../mysqldb')['db'];config[_0xd523('0x15')]=_[_0xd523('0x16')](config[_0xd523('0x15')],{'host':_0xd523('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd523('0x15')]));require(_0xd523('0x18'))['register'](socket);function respondWithStatusCode(_0x1c5023,_0x3bb8ce){_0x3bb8ce=_0x3bb8ce||0xcc;return function(_0xccd70){if(_0xccd70){return _0x1c5023[_0xd523('0x19')](_0x3bb8ce);}return _0x1c5023[_0xd523('0x1a')](_0x3bb8ce)['end']();};}function respondWithResult(_0x56c8a9,_0x307225){_0x307225=_0x307225||0xc8;return function(_0x1e65d8){if(_0x1e65d8){return _0x56c8a9[_0xd523('0x1a')](_0x307225)[_0xd523('0x1b')](_0x1e65d8);}};}function respondWithFilteredResult(_0x3ded1b,_0x526ea6){return function(_0x40205f){if(_0x40205f){var _0x1f234d=typeof _0x526ea6[_0xd523('0x1c')]==='undefined'&&typeof _0x526ea6[_0xd523('0x1d')]===_0xd523('0x1e');var _0x6bfa2c=_0x40205f['count'];var _0x340fc=_0x1f234d?0x0:_0x526ea6[_0xd523('0x1c')];var _0x595122=_0x1f234d?_0x40205f[_0xd523('0x1f')]:_0x526ea6['offset']+_0x526ea6[_0xd523('0x1d')];var _0x1d33db;if(_0x595122>=_0x6bfa2c){_0x595122=_0x6bfa2c;_0x1d33db=0xc8;}else{_0x1d33db=0xce;}_0x3ded1b[_0xd523('0x1a')](_0x1d33db);return _0x3ded1b[_0xd523('0x20')](_0xd523('0x21'),_0x340fc+'-'+_0x595122+'/'+_0x6bfa2c)[_0xd523('0x1b')](_0x40205f);}return null;};}function patchUpdates(_0x6f48fc){return function(_0x10c2a2){try{jsonpatch[_0xd523('0x22')](_0x10c2a2,_0x6f48fc,!![]);}catch(_0x42589b){return BPromise['reject'](_0x42589b);}return _0x10c2a2[_0xd523('0x23')]();};}function saveUpdates(_0x48bce5,_0x52d7b3){return function(_0x1257f1){if(_0x1257f1){return _0x1257f1['update'](_0x48bce5)[_0xd523('0x24')](function(_0x549cf3){return _0x549cf3;});}return null;};}function removeEntity(_0x4c7e86,_0x4ef451){return function(_0x218f10){if(_0x218f10){return _0x218f10[_0xd523('0x25')]()[_0xd523('0x24')](function(){_0x4c7e86[_0xd523('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4df9ef,_0x40dc4a){return function(_0x3bed38){if(!_0x3bed38){_0x4df9ef[_0xd523('0x19')](0x194);}return _0x3bed38;};}function handleError(_0x38d6a2,_0x48f60c){_0x48f60c=_0x48f60c||0x1f4;return function(_0x56c611){logger['error'](_0x56c611[_0xd523('0x26')]);if(_0x56c611['name']){delete _0x56c611[_0xd523('0x27')];}_0x38d6a2[_0xd523('0x1a')](_0x48f60c)[_0xd523('0x28')](_0x56c611);};}exports[_0xd523('0x29')]=function(_0x119b4e,_0x22d506,_0x39c734){if(!_0x119b4e[_0xd523('0x2a')][_0xd523('0x2b')](_0xd523('0x2c'))&&!_0x119b4e[_0xd523('0x2a')]['hasOwnProperty'](_0xd523('0x2d'))){throw new db['Sequelize'][(_0xd523('0x2e'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x119b4e['body']['hasOwnProperty'](_0xd523('0x2d'))&&!_0x119b4e['body']['hasOwnProperty'](_0xd523('0x2f'))){throw new db['Sequelize'][(_0xd523('0x2e'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x119b4e[_0xd523('0x2a')]['hasOwnProperty']('recipients')){throw new db[(_0xd523('0x30'))][(_0xd523('0x2e'))](_0xd523('0x31'));}else{try{var _0x674e6c=JSON[_0xd523('0x32')](_0x119b4e[_0xd523('0x2a')][_0xd523('0x33')]);}catch(_0x1c81aa){logger['error'](_0x1c81aa);throw new db[(_0xd523('0x30'))][(_0xd523('0x2e'))](_0xd523('0x34'));}var _0x57faf7=[_0xd523('0x35'),_0xd523('0x36'),'mailqueue',_0xd523('0x37'),_0xd523('0x38'),'voicequeue',_0xd523('0x39'),_0xd523('0x3a'),'user'];if(_['some'](_0x674e6c,function(_0x39ff88){return!_[_0xd523('0x3b')](_0x57faf7,_0x39ff88['model']['toLowerCase']());})){throw new db[(_0xd523('0x30'))][(_0xd523('0x2e'))](_0xd523('0x3c'));}}}var _0x15e498={};_0x15e498[_0xd523('0x3d')]=_0x119b4e[_0xd523('0x2a')][_0xd523('0x2b')](_0xd523('0x3d'))?_0x119b4e[_0xd523('0x2a')][_0xd523('0x3d')]:_0x119b4e[_0xd523('0x3e')][_0xd523('0x3f')];_0x15e498[_0xd523('0x40')]=_[_0xd523('0x41')](_0x119b4e['body'][_0xd523('0x40')])?null:_0x119b4e['body'][_0xd523('0x40')];_0x15e498[_0xd523('0x42')]=_0x119b4e[_0xd523('0x2a')]['beep']||![];_0x15e498['SenderId']=_0x119b4e[_0xd523('0x3e')]['id'];return getContent(_0x119b4e[_0xd523('0x2a')])[_0xd523('0x24')](function(_0x108941){_0x15e498[_0xd523('0x2a')]=_0x108941;return getRecipients(_0x674e6c);})[_0xd523('0x24')](function(_0x5b3efe){_0x15e498[_0xd523('0x43')]=_[_0xd523('0x44')](_0x5b3efe)['join'](',');return db[_0xd523('0x45')][_0xd523('0x46')](function(_0x1b24b5){return db[_0xd523('0x47')][_0xd523('0x48')](_0x15e498,{'raw':!![],'transaction':_0x1b24b5})['then'](function(_0x2eeec2){var _0x5f199d={'sender':_0x15e498[_0xd523('0x3d')],'description':_0x15e498[_0xd523('0x40')],'content':_0x15e498[_0xd523('0x2a')],'beep':_0x15e498[_0xd523('0x42')]};_0x5b3efe[_0xd523('0x49')](function(_0x497c0f){_0x5f199d[_0xd523('0x4a')]=_0x497c0f;socket[_0xd523('0x4b')](_0xd523('0x4c'),_0x5f199d);});return _0x2eeec2;});});})[_0xd523('0x24')](respondWithResult(_0x22d506,0xc9))[_0xd523('0x4d')](handleError(_0x22d506,null));};function getContent(_0x4a40b8){return new BPromise(function(_0x1e7c0b,_0x8b53fb){if(_0x4a40b8[_0xd523('0x2c')]){_0x1e7c0b(_0x4a40b8['text']);return;}return db[_0xd523('0x4e')][_0xd523('0x4f')]({'attributes':[_0xd523('0x50')],'where':{'id':_0x4a40b8[_0xd523('0x2d')]},'raw':!![]})[_0xd523('0x24')](function(_0x1a1390){if(!_0x1a1390)throw new db[(_0xd523('0x30'))][(_0xd523('0x2e'))](_0xd523('0x51'));var _0x5c40fd=Mustache[_0xd523('0x52')](_0x1a1390[_0xd523('0x50')],_0x4a40b8[_0xd523('0x2f')]);_0x1e7c0b(_0x5c40fd);})['catch'](function(_0x598b88){_0x8b53fb(_0x598b88);});});}function getRecipients(_0x5baa45){return new BPromise(function(_0x43039b,_0x5674e2){var _0xed21e9=[];var _0x3a2b08=[];_0x5baa45[_0xd523('0x49')](function(_0x37373a){var _0x4440a3=_[_0xd523('0x53')](_0x37373a[_0xd523('0x54')][_0xd523('0x55')]());if(_0x4440a3===_0xd523('0x56')){_0xed21e9=_[_0xd523('0x57')](_0xed21e9,_0x37373a[_0xd523('0x58')]);}else{if(_[_0xd523('0x3b')](_0x4440a3,_0xd523('0x59')))_0x4440a3=_0x4440a3[_0xd523('0x5a')](_0xd523('0x59'),'Queue');_0x37373a[_0xd523('0x58')][_0xd523('0x49')](function(_0x4a32d1){_0x3a2b08['push'](getAgents(_0x4440a3,_0x4a32d1));});}});return BPromise['all'](_0x3a2b08)[_0xd523('0x24')](function(_0x13eae7){_0xed21e9=_[_0xd523('0x57')](_0xed21e9,_[_0xd523('0x5b')](_0x13eae7));_0x43039b(_0xed21e9);})[_0xd523('0x4d')](function(_0x4c55dd){_0x5674e2(_0x4c55dd);});});}function getAgents(_0x5a04cf,_0x38fdb7){return new BPromise(function(_0x30d83d,_0x41931f){return db[_0x5a04cf]['findOne']({'where':{'id':_0x38fdb7}})[_0xd523('0x24')](function(_0x4baa05){return _0x4baa05[_0xd523('0x5c')]({'attributes':['id'],'raw':!![]})[_0xd523('0x24')](function(_0x20deaa){var _0x295ac1=_['map'](_0x20deaa,'id');_0x30d83d(_0x295ac1);});})[_0xd523('0x4d')](function(_0x1c50d0){_0x41931f(_0x1c50d0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 37cd763..ceabbf2 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 _0x212e=['hook','exports','events','save','update','remove','emit','hasOwnProperty'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x212e,0x13a));var _0xe212=function(_0x5404f6,_0x5900a7){_0x5404f6=_0x5404f6-0x0;var _0x13230b=_0x212e[_0x5404f6];return _0x13230b;};'use strict';var EventEmitter=require(_0xe212('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe212('0x1'),'afterUpdate':_0xe212('0x2'),'afterDestroy':_0xe212('0x3')};function emitEvent(_0x46127e){return function(_0x5d550a,_0x42533d,_0x49836e){UserNotificationEvents[_0xe212('0x4')](_0x46127e+':'+_0x5d550a['id'],_0x5d550a);UserNotificationEvents[_0xe212('0x4')](_0x46127e,_0x5d550a);_0x49836e(null);};}for(var e in events){if(events[_0xe212('0x5')](e)){var event=events[e];UserNotification[_0xe212('0x6')](e,emitEvent(event));}}module[_0xe212('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x440c=['hook','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x440c,0x18d));var _0xc440=function(_0x29b552,_0x3631bd){_0x29b552=_0x29b552-0x0;var _0x1131e9=_0x440c[_0x29b552];return _0x1131e9;};'use strict';var EventEmitter=require(_0xc440('0x0'));var UserNotification=require(_0xc440('0x1'))['db'][_0xc440('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc440('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc440('0x4'),'afterDestroy':_0xc440('0x5')};function emitEvent(_0x2691f8){return function(_0x159da2,_0x19346e,_0x1f7785){UserNotificationEvents['emit'](_0x2691f8+':'+_0x159da2['id'],_0x159da2);UserNotificationEvents[_0xc440('0x6')](_0x2691f8,_0x159da2);_0x1f7785(null);};}for(var e in events){if(events[_0xc440('0x7')](e)){var event=events[e];UserNotification[_0xc440('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 3828965..3ca9a66 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 _0xbb8c=['path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3bac2b,_0x2de937){var _0xc43b6a=function(_0x1e4726){while(--_0x1e4726){_0x3bac2b['push'](_0x3bac2b['shift']());}};_0xc43b6a(++_0x2de937);}(_0xbb8c,0x14b));var _0xcbb8=function(_0x33ff99,_0x3150b7){_0x33ff99=_0x33ff99-0x0;var _0x539da6=_0xbb8c[_0x33ff99];return _0x539da6;};'use strict';var _=require(_0xcbb8('0x0'));var util=require(_0xcbb8('0x1'));var logger=require(_0xcbb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcbb8('0x3'));var rp=require(_0xcbb8('0x4'));var fs=require('fs');var path=require(_0xcbb8('0x5'));var rimraf=require('rimraf');var config=require(_0xcbb8('0x6'));var attributes=require(_0xcbb8('0x7'));module[_0xcbb8('0x8')]=function(_0x46d7e2,_0x4e575a){return _0x46d7e2[_0xcbb8('0x9')](_0xcbb8('0xa'),attributes,{'tableName':_0xcbb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbb8('0xc'),'collate':_0xcbb8('0xd')});}; \ No newline at end of file +var _0x8f58=['../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','lodash','api','moment','bluebird','path'];(function(_0x430fef,_0x575f8c){var _0x143b62=function(_0x773fd0){while(--_0x773fd0){_0x430fef['push'](_0x430fef['shift']());}};_0x143b62(++_0x575f8c);}(_0x8f58,0xeb));var _0x88f5=function(_0x52e359,_0x3bcc54){_0x52e359=_0x52e359-0x0;var _0x30dd4c=_0x8f58[_0x52e359];return _0x30dd4c;};'use strict';var _=require(_0x88f5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x88f5('0x1'));var moment=require(_0x88f5('0x2'));var BPromise=require(_0x88f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88f5('0x4'));var rimraf=require('rimraf');var config=require(_0x88f5('0x5'));var attributes=require(_0x88f5('0x6'));module[_0x88f5('0x7')]=function(_0x56c6df,_0x1a823e){return _0x56c6df[_0x88f5('0x8')](_0x88f5('0x9'),attributes,{'tableName':_0x88f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88f5('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 128d44f..34c653d 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 _0xcad6=['util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash'];(function(_0x461fec,_0x204c56){var _0x2dece8=function(_0xd10069){while(--_0xd10069){_0x461fec['push'](_0x461fec['shift']());}};_0x2dece8(++_0x204c56);}(_0xcad6,0x83));var _0x6cad=function(_0x41d134,_0x2b2c81){_0x41d134=_0x41d134-0x0;var _0x8f5b28=_0xcad6[_0x41d134];return _0x8f5b28;};'use strict';var _=require(_0x6cad('0x0'));var util=require(_0x6cad('0x1'));var moment=require('moment');var BPromise=require(_0x6cad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6cad('0x3'));var logger=require(_0x6cad('0x4'))(_0x6cad('0x5'));var config=require(_0x6cad('0x6'));var jayson=require(_0x6cad('0x7'));var client=jayson[_0x6cad('0x8')][_0x6cad('0x9')]({'port':0x232a});config[_0x6cad('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cad('0xa')]));require(_0x6cad('0xb'))[_0x6cad('0xc')](socket);function respondWithRpcPromise(_0x2bca6b,_0x37fef6,_0x5f532b){return new BPromise(function(_0x3ce926,_0x38ce85){return client['request'](_0x2bca6b,_0x5f532b)[_0x6cad('0xd')](function(_0x5ac734){logger[_0x6cad('0xe')](_0x6cad('0xf'),_0x37fef6,_0x6cad('0x10'));logger[_0x6cad('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x37fef6,_0x6cad('0x10'),JSON['stringify'](_0x5ac734));if(_0x5ac734['error']){if(_0x5ac734['error'][_0x6cad('0x12')]===0x1f4){logger['error'](_0x6cad('0xf'),_0x37fef6,_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);return _0x38ce85(_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);}logger[_0x6cad('0x13')]('UserNotification,\x20%s,\x20%s',_0x37fef6,_0x5ac734['error'][_0x6cad('0x14')]);return _0x3ce926(_0x5ac734[_0x6cad('0x13')][_0x6cad('0x14')]);}else{logger[_0x6cad('0xe')](_0x6cad('0xf'),_0x37fef6,_0x6cad('0x10'));_0x3ce926(_0x5ac734[_0x6cad('0x15')][_0x6cad('0x14')]);}})['catch'](function(_0x345515){logger[_0x6cad('0x13')](_0x6cad('0xf'),_0x37fef6,_0x345515);_0x38ce85(_0x345515);});});} \ No newline at end of file +var _0x9a49=['localhost','socket.io-emitter','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3610dd,_0x53ac86){var _0x1a511e=function(_0x195a3a){while(--_0x195a3a){_0x3610dd['push'](_0x3610dd['shift']());}};_0x1a511e(++_0x53ac86);}(_0x9a49,0x1e1));var _0x99a4=function(_0x51acc9,_0x522a04){_0x51acc9=_0x51acc9-0x0;var _0x52e97a=_0x9a49[_0x51acc9];return _0x52e97a;};'use strict';var _=require(_0x99a4('0x0'));var util=require('util');var moment=require(_0x99a4('0x1'));var BPromise=require('bluebird');var rs=require(_0x99a4('0x2'));var fs=require('fs');var Redis=require(_0x99a4('0x3'));var db=require(_0x99a4('0x4'))['db'];var utils=require(_0x99a4('0x5'));var logger=require(_0x99a4('0x6'))(_0x99a4('0x7'));var config=require(_0x99a4('0x8'));var jayson=require(_0x99a4('0x9'));var client=jayson[_0x99a4('0xa')][_0x99a4('0xb')]({'port':0x232a});config[_0x99a4('0xc')]=_['defaults'](config[_0x99a4('0xc')],{'host':_0x99a4('0xd'),'port':0x18eb});var socket=require(_0x99a4('0xe'))(new Redis(config[_0x99a4('0xc')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x57fd2a,_0x17e078,_0x1ed079){return new BPromise(function(_0x40b956,_0x1e2c81){return client[_0x99a4('0xf')](_0x57fd2a,_0x1ed079)['then'](function(_0x1650a6){logger['info'](_0x99a4('0x10'),_0x17e078,_0x99a4('0x11'));logger[_0x99a4('0x12')](_0x99a4('0x13'),_0x17e078,_0x99a4('0x11'),JSON[_0x99a4('0x14')](_0x1650a6));if(_0x1650a6['error']){if(_0x1650a6[_0x99a4('0x15')][_0x99a4('0x16')]===0x1f4){logger['error'](_0x99a4('0x10'),_0x17e078,_0x1650a6['error'][_0x99a4('0x17')]);return _0x1e2c81(_0x1650a6[_0x99a4('0x15')][_0x99a4('0x17')]);}logger[_0x99a4('0x15')](_0x99a4('0x10'),_0x17e078,_0x1650a6[_0x99a4('0x15')]['message']);return _0x40b956(_0x1650a6[_0x99a4('0x15')][_0x99a4('0x17')]);}else{logger[_0x99a4('0x18')]('UserNotification,\x20%s,\x20%s',_0x17e078,_0x99a4('0x11'));_0x40b956(_0x1650a6['result']['message']);}})[_0x99a4('0x19')](function(_0x39547d){logger[_0x99a4('0x15')](_0x99a4('0x10'),_0x17e078,_0x39547d);_0x1e2c81(_0x39547d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 73d125d..8fd49aa 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 _0xe5a3=['removeListener','register','length','userNotification:','save','remove'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe5a3,0x1d2));var _0x3e5a=function(_0x149002,_0x5dd1a1){_0x149002=_0x149002-0x0;var _0x34a418=_0xe5a3[_0x149002];return _0x34a418;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x3e5a('0x0'),_0x3e5a('0x1'),'update'];function createListener(_0x368e7f,_0x4115ee){return function(_0x2cb45d){_0x4115ee['emit'](_0x368e7f,_0x2cb45d);};}function removeListener(_0x5c3fb6,_0x1bba21){return function(){UserNotificationEvents[_0x3e5a('0x2')](_0x5c3fb6,_0x1bba21);};}exports[_0x3e5a('0x3')]=function(_0x4db4ae){for(var _0x2c7c18=0x0,_0x5b9eec=events[_0x3e5a('0x4')];_0x2c7c18<_0x5b9eec;_0x2c7c18++){var _0x3e5181=events[_0x2c7c18];var _0x11b5be=createListener(_0x3e5a('0x5')+_0x3e5181,_0x4db4ae);UserNotificationEvents['on'](_0x3e5181,_0x11b5be);}}; \ No newline at end of file +var _0x46b2=['userNotification:','remove','emit','removeListener','register','length'];(function(_0x9074fa,_0x44e503){var _0x294789=function(_0x50fbf6){while(--_0x50fbf6){_0x9074fa['push'](_0x9074fa['shift']());}};_0x294789(++_0x44e503);}(_0x46b2,0x1b7));var _0x246b=function(_0x1f79b0,_0x1c4156){_0x1f79b0=_0x1f79b0-0x0;var _0x95e102=_0x46b2[_0x1f79b0];return _0x95e102;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x246b('0x0'),'update'];function createListener(_0x1453ad,_0x1e3d73){return function(_0x5eb49a){_0x1e3d73[_0x246b('0x1')](_0x1453ad,_0x5eb49a);};}function removeListener(_0x1c15d2,_0x580806){return function(){UserNotificationEvents[_0x246b('0x2')](_0x1c15d2,_0x580806);};}exports[_0x246b('0x3')]=function(_0x391bf7){for(var _0x327ed4=0x0,_0x2e3eb1=events[_0x246b('0x4')];_0x327ed4<_0x2e3eb1;_0x327ed4++){var _0x40f6f1=events[_0x327ed4];var _0x3f7e87=createListener(_0x246b('0x5')+_0x40f6f1,_0x391bf7);UserNotificationEvents['on'](_0x40f6f1,_0x3f7e87);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e5b2bef..aeb7d55 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x56fcf6,_0x401b3c){var _0x2078a7=function(_0x4f2790){while(--_0x4f2790){_0x56fcf6['push'](_0x56fcf6['shift']());}};_0x2078a7(++_0x401b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9dc1487..3fff344 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 _0x60ed=['exports','INTEGER'];(function(_0x188b61,_0x3f0ed4){var _0x5517ec=function(_0x4f83e0){while(--_0x4f83e0){_0x188b61['push'](_0x188b61['shift']());}};_0x5517ec(++_0x3f0ed4);}(_0x60ed,0x118));var _0xd60e=function(_0x32ae65,_0x3e867c){_0x32ae65=_0x32ae65-0x0;var _0x3af0de=_0x60ed[_0x32ae65];return _0x3af0de;};'use strict';var Sequelize=require('sequelize');module[_0xd60e('0x0')]={'penalty':{'type':Sequelize[_0xd60e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa97b=['exports','sequelize'];(function(_0x3ee422,_0x320ab8){var _0x1a0d69=function(_0x2573ab){while(--_0x2573ab){_0x3ee422['push'](_0x3ee422['shift']());}};_0x1a0d69(++_0x320ab8);}(_0xa97b,0x135));var _0xba97=function(_0x18b46b,_0x59a578){_0x18b46b=_0x18b46b-0x0;var _0x4d17fb=_0xa97b[_0x18b46b];return _0x4d17fb;};'use strict';var Sequelize=require(_0xba97('0x0'));module[_0xba97('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 65a6e23..c7ffe47 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 _0xf32d=['define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x1d230d,_0x312764){var _0x284ee9=function(_0x4ffde8){while(--_0x4ffde8){_0x1d230d['push'](_0x1d230d['shift']());}};_0x284ee9(++_0x312764);}(_0xf32d,0x189));var _0xdf32=function(_0x30d8a5,_0x213cc3){_0x30d8a5=_0x30d8a5-0x0;var _0x476221=_0xf32d[_0x30d8a5];return _0x476221;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf32('0x0'))(_0xdf32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf32('0x2'));var fs=require('fs');var path=require(_0xdf32('0x3'));var rimraf=require('rimraf');var config=require(_0xdf32('0x4'));var attributes=require(_0xdf32('0x5'));module[_0xdf32('0x6')]=function(_0x4db9e9,_0x5a7a90){return _0x4db9e9[_0xdf32('0x7')](_0xdf32('0x8'),attributes,{'tableName':_0xdf32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2902=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports'];(function(_0x42e874,_0x3bcf86){var _0x3809e0=function(_0x1b28be){while(--_0x1b28be){_0x42e874['push'](_0x42e874['shift']());}};_0x3809e0(++_0x3bcf86);}(_0x2902,0x116));var _0x2290=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x2902[_0x56daff];return _0x132c82;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var logger=require(_0x2290('0x2'))(_0x2290('0x3'));var moment=require(_0x2290('0x4'));var BPromise=require(_0x2290('0x5'));var rp=require(_0x2290('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2290('0x7'));var config=require('../../config/environment');var attributes=require(_0x2290('0x8'));module[_0x2290('0x9')]=function(_0x11739a,_0x3e2399){return _0x11739a['define'](_0x2290('0xa'),attributes,{'tableName':_0x2290('0xb'),'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 c7aa3a5..34ffe85 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 _0x973c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f9a83,_0x304e0f){var _0x2b0e33=function(_0x3d8941){while(--_0x3d8941){_0x1f9a83['push'](_0x1f9a83['shift']());}};_0x2b0e33(++_0x304e0f);}(_0x973c,0x105));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var util=require(_0xc973('0x1'));var moment=require(_0xc973('0x2'));var BPromise=require(_0xc973('0x3'));var rs=require(_0xc973('0x4'));var fs=require('fs');var Redis=require(_0xc973('0x5'));var db=require(_0xc973('0x6'))['db'];var utils=require(_0xc973('0x7'));var logger=require(_0xc973('0x8'))(_0xc973('0x9'));var config=require(_0xc973('0xa'));var jayson=require(_0xc973('0xb'));var client=jayson[_0xc973('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc515,_0x4f3be4,_0x58a1e2){return new BPromise(function(_0x2a94ae,_0x1eccf5){return client[_0xc973('0xd')](_0x4bc515,_0x58a1e2)[_0xc973('0xe')](function(_0x1f5297){logger[_0xc973('0xf')](_0xc973('0x10'),_0x4f3be4,_0xc973('0x11'));logger[_0xc973('0x12')](_0xc973('0x13'),_0x4f3be4,_0xc973('0x11'),JSON[_0xc973('0x14')](_0x1f5297));if(_0x1f5297[_0xc973('0x15')]){if(_0x1f5297['error'][_0xc973('0x16')]===0x1f4){logger[_0xc973('0x15')](_0xc973('0x10'),_0x4f3be4,_0x1f5297[_0xc973('0x15')]['message']);return _0x1eccf5(_0x1f5297[_0xc973('0x15')][_0xc973('0x17')]);}logger[_0xc973('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4f3be4,_0x1f5297[_0xc973('0x15')][_0xc973('0x17')]);return _0x2a94ae(_0x1f5297[_0xc973('0x15')]['message']);}else{logger[_0xc973('0xf')](_0xc973('0x10'),_0x4f3be4,_0xc973('0x11'));_0x2a94ae(_0x1f5297[_0xc973('0x18')][_0xc973('0x17')]);}})[_0xc973('0x19')](function(_0x3f23a4){logger[_0xc973('0x15')](_0xc973('0x10'),_0x4f3be4,_0x3f23a4);_0x1eccf5(_0x3f23a4);});});} \ No newline at end of file +var _0xd0e1=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5b2985,_0x42aef5){var _0x40afff=function(_0x3bdd56){while(--_0x3bdd56){_0x5b2985['push'](_0x5b2985['shift']());}};_0x40afff(++_0x42aef5);}(_0xd0e1,0xd5));var _0x1d0e=function(_0x351599,_0xc82a0e){_0x351599=_0x351599-0x0;var _0x184bce=_0xd0e1[_0x351599];return _0x184bce;};'use strict';var _=require(_0x1d0e('0x0'));var util=require(_0x1d0e('0x1'));var moment=require(_0x1d0e('0x2'));var BPromise=require(_0x1d0e('0x3'));var rs=require(_0x1d0e('0x4'));var fs=require('fs');var Redis=require(_0x1d0e('0x5'));var db=require(_0x1d0e('0x6'))['db'];var utils=require(_0x1d0e('0x7'));var logger=require(_0x1d0e('0x8'))(_0x1d0e('0x9'));var config=require(_0x1d0e('0xa'));var jayson=require(_0x1d0e('0xb'));var client=jayson[_0x1d0e('0xc')][_0x1d0e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x307817,_0x49a1ef,_0x10ca0d){return new BPromise(function(_0x12a388,_0x517430){return client['request'](_0x307817,_0x10ca0d)['then'](function(_0x221db0){logger['info'](_0x1d0e('0xe'),_0x49a1ef,_0x1d0e('0xf'));logger[_0x1d0e('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x49a1ef,'request\x20sent',JSON[_0x1d0e('0x11')](_0x221db0));if(_0x221db0[_0x1d0e('0x12')]){if(_0x221db0[_0x1d0e('0x12')][_0x1d0e('0x13')]===0x1f4){logger[_0x1d0e('0x12')](_0x1d0e('0xe'),_0x49a1ef,_0x221db0[_0x1d0e('0x12')][_0x1d0e('0x14')]);return _0x517430(_0x221db0[_0x1d0e('0x12')][_0x1d0e('0x14')]);}logger[_0x1d0e('0x12')](_0x1d0e('0xe'),_0x49a1ef,_0x221db0['error'][_0x1d0e('0x14')]);return _0x12a388(_0x221db0[_0x1d0e('0x12')][_0x1d0e('0x14')]);}else{logger[_0x1d0e('0x15')](_0x1d0e('0xe'),_0x49a1ef,_0x1d0e('0xf'));_0x12a388(_0x221db0['result']['message']);}})[_0x1d0e('0x16')](function(_0x30c27d){logger[_0x1d0e('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x49a1ef,_0x30c27d);_0x517430(_0x30c27d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index fac20f4..08993c1 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 _0xcc9f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','get','/:id','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','put','update','delete','removeSections','removeResources','exports'];(function(_0x417b8b,_0x3b8353){var _0x36f0e8=function(_0x131439){while(--_0x131439){_0x417b8b['push'](_0x417b8b['shift']());}};_0x36f0e8(++_0x3b8353);}(_0xcc9f,0x1a4));var _0xfcc9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc9f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfcc9('0x0'));var util=require(_0xfcc9('0x1'));var path=require('path');var timeout=require(_0xfcc9('0x2'));var express=require(_0xfcc9('0x3'));var router=express[_0xfcc9('0x4')]();var fs_extra=require(_0xfcc9('0x5'));var auth=require(_0xfcc9('0x6'));var interaction=require(_0xfcc9('0x7'));var config=require(_0xfcc9('0x8'));var controller=require(_0xfcc9('0x9'));router['get']('/',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0xb')]);router['get'](_0xfcc9('0xc'),auth[_0xfcc9('0xa')](),controller['describe']);router[_0xfcc9('0xd')](_0xfcc9('0xe'),auth[_0xfcc9('0xa')](),controller['show']);router['get'](_0xfcc9('0xf'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x10')]);router[_0xfcc9('0xd')](_0xfcc9('0x11'),auth['isAuthenticated'](),controller[_0xfcc9('0x12')]);router[_0xfcc9('0x13')]('/',auth[_0xfcc9('0xa')](),controller['create']);router[_0xfcc9('0x13')]('/:id/clone',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x14')]);router[_0xfcc9('0x13')]('/:id/sections',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x15')]);router['post'](_0xfcc9('0x11'),auth['isAuthenticated'](),controller['addResources']);router[_0xfcc9('0x16')]('/:id',auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x17')]);router[_0xfcc9('0x18')](_0xfcc9('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xfcc9('0x18')](_0xfcc9('0xf'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x19')]);router[_0xfcc9('0x18')](_0xfcc9('0x11'),auth[_0xfcc9('0xa')](),controller[_0xfcc9('0x1a')]);module[_0xfcc9('0x1b')]=router; \ No newline at end of file +var _0x25e8=['create','/:id/clone','clone','addSections','addResources','put','update','destroy','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post'];(function(_0x5e32cd,_0x2ec70f){var _0x52aa9d=function(_0x125626){while(--_0x125626){_0x5e32cd['push'](_0x5e32cd['shift']());}};_0x52aa9d(++_0x2ec70f);}(_0x25e8,0x121));var _0x825e=function(_0x1c44ef,_0x1db588){_0x1c44ef=_0x1c44ef-0x0;var _0x2bb980=_0x25e8[_0x1c44ef];return _0x2bb980;};'use strict';var multer=require(_0x825e('0x0'));var util=require(_0x825e('0x1'));var path=require(_0x825e('0x2'));var timeout=require(_0x825e('0x3'));var express=require(_0x825e('0x4'));var router=express[_0x825e('0x5')]();var fs_extra=require(_0x825e('0x6'));var auth=require(_0x825e('0x7'));var interaction=require(_0x825e('0x8'));var config=require(_0x825e('0x9'));var controller=require(_0x825e('0xa'));router[_0x825e('0xb')]('/',auth[_0x825e('0xc')](),controller['index']);router[_0x825e('0xb')](_0x825e('0xd'),auth[_0x825e('0xc')](),controller['describe']);router[_0x825e('0xb')](_0x825e('0xe'),auth[_0x825e('0xc')](),controller[_0x825e('0xf')]);router[_0x825e('0xb')](_0x825e('0x10'),auth[_0x825e('0xc')](),controller[_0x825e('0x11')]);router[_0x825e('0xb')](_0x825e('0x12'),auth[_0x825e('0xc')](),controller[_0x825e('0x13')]);router[_0x825e('0x14')]('/',auth[_0x825e('0xc')](),controller[_0x825e('0x15')]);router[_0x825e('0x14')](_0x825e('0x16'),auth['isAuthenticated'](),controller[_0x825e('0x17')]);router['post']('/:id/sections',auth[_0x825e('0xc')](),controller[_0x825e('0x18')]);router[_0x825e('0x14')](_0x825e('0x12'),auth['isAuthenticated'](),controller[_0x825e('0x19')]);router[_0x825e('0x1a')](_0x825e('0xe'),auth['isAuthenticated'](),controller[_0x825e('0x1b')]);router['delete'](_0x825e('0xe'),auth[_0x825e('0xc')](),controller[_0x825e('0x1c')]);router['delete']('/:id/sections',auth[_0x825e('0xc')](),controller[_0x825e('0x1d')]);router['delete']('/:id/resources',auth[_0x825e('0xc')](),controller['removeResources']);module[_0x825e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3e82200..c0dc2b0 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 _0x78e9=['crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x2e0528,_0x358957){var _0x564fd4=function(_0x47b201){while(--_0x47b201){_0x2e0528['push'](_0x2e0528['shift']());}};_0x564fd4(++_0x358957);}(_0x78e9,0x11b));var _0x978e=function(_0x36efb6,_0x3d50ba){_0x36efb6=_0x36efb6-0x0;var _0x470de1=_0x78e9[_0x36efb6];return _0x470de1;};'use strict';var Sequelize=require(_0x978e('0x0'));module[_0x978e('0x1')]={'name':{'type':Sequelize[_0x978e('0x2')],'allowNull':![],'unique':_0x978e('0x3')},'crudPermissions':{'type':Sequelize[_0x978e('0x2')],'set':function(_0x52daac){this[_0x978e('0x4')]('crudPermissions',_0x52daac?_0x52daac[_0x978e('0x5')](''):[]);},'get':function(){return this[_0x978e('0x6')](_0x978e('0x7'))?this[_0x978e('0x6')](_0x978e('0x7'))[_0x978e('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x978e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x978e('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x978e('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9d61=['sequelize','exports','STRING','setDataValue','crudPermissions','getDataValue','split','BOOLEAN'];(function(_0x43ba7b,_0x113cbf){var _0x169a0b=function(_0x4f0cab){while(--_0x4f0cab){_0x43ba7b['push'](_0x43ba7b['shift']());}};_0x169a0b(++_0x113cbf);}(_0x9d61,0x1b0));var _0x19d6=function(_0x139d84,_0x52a56b){_0x139d84=_0x139d84-0x0;var _0xa57098=_0x9d61[_0x139d84];return _0xa57098;};'use strict';var Sequelize=require(_0x19d6('0x0'));module[_0x19d6('0x1')]={'name':{'type':Sequelize[_0x19d6('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x19d6('0x2')],'set':function(_0x423a1e){this[_0x19d6('0x3')](_0x19d6('0x4'),_0x423a1e?_0x423a1e['join'](''):[]);},'get':function(){return this[_0x19d6('0x5')](_0x19d6('0x4'))?this[_0x19d6('0x5')](_0x19d6('0x4'))[_0x19d6('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x19d6('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x19d6('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x19d6('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x19d6('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x19d6('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 727ba4d..9a7aed3 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 _0x337f=['nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','clone','rawAttributes','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','Resources','destroy','describe','addSections','each','push','removeSections','ids','getSections','enabled','includes','sectionId','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','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','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','update','then','error','stack','name','index','map','UserProfile','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x337f,0x11c));var _0xf337=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0x337f[_0x42b02c];return _0x105518;};'use strict';var emlformat=require(_0xf337('0x0'));var rimraf=require(_0xf337('0x1'));var zipdir=require(_0xf337('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf337('0x3'));var moment=require(_0xf337('0x4'));var BPromise=require(_0xf337('0x5'));var Mustache=require('mustache');var util=require(_0xf337('0x6'));var path=require(_0xf337('0x7'));var sox=require('sox');var csv=require(_0xf337('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf337('0x9'));var _=require('lodash');var squel=require(_0xf337('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf337('0xb'));var toCsv=require(_0xf337('0x8'));var querystring=require(_0xf337('0xc'));var Papa=require(_0xf337('0xd'));var Redis=require(_0xf337('0xe'));var authService=require(_0xf337('0xf'));var qs=require(_0xf337('0x10'));var as=require(_0xf337('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf337('0x12'))(_0xf337('0x13'));var utils=require(_0xf337('0x14'));var config=require(_0xf337('0x15'));var licenseUtil=require(_0xf337('0x16'));var db=require(_0xf337('0x17'))['db'];config[_0xf337('0x18')]=_[_0xf337('0x19')](config[_0xf337('0x18')],{'host':_0xf337('0x1a'),'port':0x18eb});var socket=require(_0xf337('0x1b'))(new Redis(config[_0xf337('0x18')]));require('./userProfile.socket')[_0xf337('0x1c')](socket);function respondWithStatusCode(_0x3873ea,_0x40931b){_0x40931b=_0x40931b||0xcc;return function(_0x4f8c79){if(_0x4f8c79){return _0x3873ea[_0xf337('0x1d')](_0x40931b);}return _0x3873ea[_0xf337('0x1e')](_0x40931b)['end']();};}function respondWithResult(_0x1147e4,_0x39146c){_0x39146c=_0x39146c||0xc8;return function(_0x100cb0){if(_0x100cb0){return _0x1147e4['status'](_0x39146c)[_0xf337('0x1f')](_0x100cb0);}};}function respondWithFilteredResult(_0x4d7237,_0x2e9954){return function(_0x3269af){if(_0x3269af){var _0x383327=typeof _0x2e9954['offset']==='undefined'&&typeof _0x2e9954[_0xf337('0x20')]===_0xf337('0x21');var _0x193607=_0x3269af[_0xf337('0x22')];var _0x8858fe=_0x383327?0x0:_0x2e9954[_0xf337('0x23')];var _0x1621d7=_0x383327?_0x3269af[_0xf337('0x22')]:_0x2e9954[_0xf337('0x23')]+_0x2e9954[_0xf337('0x20')];var _0x3ae507;if(_0x1621d7>=_0x193607){_0x1621d7=_0x193607;_0x3ae507=0xc8;}else{_0x3ae507=0xce;}_0x4d7237[_0xf337('0x1e')](_0x3ae507);return _0x4d7237[_0xf337('0x24')]('Content-Range',_0x8858fe+'-'+_0x1621d7+'/'+_0x193607)[_0xf337('0x1f')](_0x3269af);}return null;};}function patchUpdates(_0x4e4191){return function(_0x50e7c8){try{jsonpatch[_0xf337('0x25')](_0x50e7c8,_0x4e4191,!![]);}catch(_0xcfabf2){return BPromise['reject'](_0xcfabf2);}return _0x50e7c8[_0xf337('0x26')]();};}function saveUpdates(_0x3880b4,_0x48f81e){return function(_0x5648de){if(_0x5648de){return _0x5648de[_0xf337('0x27')](_0x3880b4)['then'](function(_0x4e906a){return _0x4e906a;});}return null;};}function removeEntity(_0x5c047b,_0x2fec03){return function(_0x578fbd){if(_0x578fbd){return _0x578fbd['destroy']()[_0xf337('0x28')](function(){_0x5c047b[_0xf337('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b357,_0x1f28ff){return function(_0x1d76c1){if(!_0x1d76c1){_0x57b357[_0xf337('0x1d')](0x194);}return _0x1d76c1;};}function handleError(_0x311eb2,_0x4d1242){_0x4d1242=_0x4d1242||0x1f4;return function(_0x208892){logger[_0xf337('0x29')](_0x208892[_0xf337('0x2a')]);if(_0x208892[_0xf337('0x2b')]){delete _0x208892[_0xf337('0x2b')];}_0x311eb2[_0xf337('0x1e')](_0x4d1242)['send'](_0x208892);};}exports[_0xf337('0x2c')]=function(_0x4464c1,_0x1f9966){var _0x16cc27={},_0x2c87f9={},_0x59f7da={'count':0x0,'rows':[]};var _0x27f0f7=_[_0xf337('0x2d')](db[_0xf337('0x2e')]['rawAttributes'],function(_0x326b2d){return{'name':_0x326b2d[_0xf337('0x2f')],'type':_0x326b2d[_0xf337('0x30')][_0xf337('0x31')]};});_0x2c87f9[_0xf337('0x32')]=_['map'](_0x27f0f7,'name');_0x2c87f9['query']=_[_0xf337('0x33')](_0x4464c1[_0xf337('0x34')]);_0x2c87f9[_0xf337('0x35')]=_[_0xf337('0x36')](_0x2c87f9['model'],_0x2c87f9[_0xf337('0x34')]);_0x16cc27['attributes']=_[_0xf337('0x36')](_0x2c87f9[_0xf337('0x32')],qs[_0xf337('0x37')](_0x4464c1[_0xf337('0x34')][_0xf337('0x37')]));_0x16cc27[_0xf337('0x38')]=_0x16cc27[_0xf337('0x38')]['length']?_0x16cc27[_0xf337('0x38')]:_0x2c87f9[_0xf337('0x32')];if(!_0x4464c1[_0xf337('0x34')][_0xf337('0x39')](_0xf337('0x3a'))){_0x16cc27['limit']=qs[_0xf337('0x20')](_0x4464c1[_0xf337('0x34')]['limit']);_0x16cc27[_0xf337('0x23')]=qs[_0xf337('0x23')](_0x4464c1[_0xf337('0x34')]['offset']);}_0x16cc27[_0xf337('0x3b')]=qs[_0xf337('0x3c')](_0x4464c1['query'][_0xf337('0x3c')]);_0x16cc27['where']=qs[_0xf337('0x35')](_['pick'](_0x4464c1[_0xf337('0x34')],_0x2c87f9[_0xf337('0x35')]),_0x27f0f7);if(_0x4464c1[_0xf337('0x34')][_0xf337('0x3d')]){_0x16cc27[_0xf337('0x3e')]=_[_0xf337('0x3f')](_0x16cc27['where'],{'$or':_['map'](_0x27f0f7,function(_0x1ff5b3){if(_0x1ff5b3[_0xf337('0x30')]!==_0xf337('0x40')){var _0x44390b={};_0x44390b[_0x1ff5b3[_0xf337('0x2b')]]={'$like':'%'+_0x4464c1[_0xf337('0x34')][_0xf337('0x3d')]+'%'};return _0x44390b;}})});}_0x16cc27=_[_0xf337('0x3f')]({},_0x16cc27,_0x4464c1['options']);var _0x38cbb5={'where':_0x16cc27[_0xf337('0x3e')]};return db[_0xf337('0x2e')][_0xf337('0x22')](_0x38cbb5)['then'](function(_0x57fcb0){_0x59f7da[_0xf337('0x22')]=_0x57fcb0;if(_0x4464c1[_0xf337('0x34')]['includeAll']){_0x16cc27[_0xf337('0x41')]=[{'all':!![]}];}return db[_0xf337('0x2e')][_0xf337('0x42')](_0x16cc27);})[_0xf337('0x28')](function(_0x5b626c){_0x59f7da[_0xf337('0x43')]=_0x5b626c;return _0x59f7da;})[_0xf337('0x28')](respondWithFilteredResult(_0x1f9966,_0x16cc27))[_0xf337('0x44')](handleError(_0x1f9966,null));};exports[_0xf337('0x45')]=function(_0x37a046,_0x46a89f){var _0x12b503={'raw':![],'where':{'id':_0x37a046[_0xf337('0x46')]['id']}},_0x3809d2={};_0x3809d2['model']=_['keys'](db[_0xf337('0x2e')]['rawAttributes']);_0x3809d2[_0xf337('0x34')]=_[_0xf337('0x33')](_0x37a046[_0xf337('0x34')]);_0x3809d2[_0xf337('0x35')]=_['intersection'](_0x3809d2['model'],_0x3809d2[_0xf337('0x34')]);_0x12b503[_0xf337('0x38')]=_['intersection'](_0x3809d2['model'],qs[_0xf337('0x37')](_0x37a046[_0xf337('0x34')][_0xf337('0x37')]));_0x12b503[_0xf337('0x38')]=_0x12b503[_0xf337('0x38')][_0xf337('0x47')]?_0x12b503[_0xf337('0x38')]:_0x3809d2['model'];if(_0x37a046['query'][_0xf337('0x48')]){_0x12b503[_0xf337('0x41')]=[{'all':!![]}];}_0x12b503=_[_0xf337('0x3f')]({},_0x12b503,_0x37a046[_0xf337('0x49')]);return db[_0xf337('0x2e')][_0xf337('0x4a')](_0x12b503)['then'](handleEntityNotFound(_0x46a89f,null))[_0xf337('0x28')](respondWithResult(_0x46a89f,null))[_0xf337('0x44')](handleError(_0x46a89f,null));};exports[_0xf337('0x4b')]=function(_0x54e944,_0x1ebf58){return db[_0xf337('0x2e')]['create'](_0x54e944[_0xf337('0x4c')],{})[_0xf337('0x28')](respondWithResult(_0x1ebf58,0xc9))[_0xf337('0x44')](handleError(_0x1ebf58,null));};exports[_0xf337('0x4d')]=function(_0x1a6233,_0x443c3a){var _0xc77813={'where':{'id':_0x1a6233['params']['id']}},_0x4c6b0e={};_0x4c6b0e[_0xf337('0x32')]=_[_0xf337('0x33')](db[_0xf337('0x2e')][_0xf337('0x4e')]);_0xc77813[_0xf337('0x38')]=_[_0xf337('0x36')](_0x4c6b0e[_0xf337('0x32')],qs[_0xf337('0x37')](_0x1a6233['query'][_0xf337('0x37')]));_0xc77813[_0xf337('0x38')]=_0xc77813[_0xf337('0x38')][_0xf337('0x47')]?_0xc77813[_0xf337('0x38')]:_0x4c6b0e[_0xf337('0x32')];if(_0x1a6233['query'][_0xf337('0x48')]){_0xc77813[_0xf337('0x41')]=[{'all':!![]}];}_0xc77813=_[_0xf337('0x3f')]({},_0xc77813,_0x1a6233['options']);return db[_0xf337('0x2e')]['find'](_0xc77813)[_0xf337('0x28')](handleEntityNotFound(_0x443c3a,null))[_0xf337('0x28')](function(_0x395441){if(_0x395441){var _0x199fc9=_0x395441[_0xf337('0x4f')]({'plain':!![]});_0x199fc9=qs[_0xf337('0x50')](_0x199fc9,['id','createdAt',_0xf337('0x51'),_0xf337('0x52')]);_0x1a6233['body']=_[_0xf337('0x50')](_0x1a6233[_0xf337('0x4c')],['id',_0xf337('0x53'),_0xf337('0x51')]);return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x230370){return db['UserProfile'][_0xf337('0x4b')](_[_0xf337('0x3f')](_0x199fc9,_0x1a6233['body']),{'include':_0x1a6233[_0xf337('0x34')][_0xf337('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x230370})[_0xf337('0x28')](function(_0xe8faba){var _0x2c2821=_0xe8faba[_0xf337('0x4f')]({'plain':!![]});return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x1a6233[_0xf337('0x46')]['id']},'raw':!![]})[_0xf337('0x28')](function(_0x556e7c){if(_0x556e7c){return BPromise['each'](_0x556e7c,function(_0x12b5e0){return new BPromise(function(_0x35f15a,_0x397b93){if(_0x12b5e0['autoAssociation']===null||_0x12b5e0[_0xf337('0x57')]===0x1)_0x35f15a(null);return db[_0xf337('0x58')][_0xf337('0x42')]({'where':{'sectionId':_0x12b5e0['id']},'raw':!![]})[_0xf337('0x28')](function(_0x1feb22){var _0x2e8897=_[_0xf337('0x2d')](_0x1feb22,function(_0x8ff31b){return qs[_0xf337('0x50')](_0x8ff31b,['id',_0xf337('0x53'),_0xf337('0x51'),'sectionId']);});_0x35f15a(_0x2e8897);})[_0xf337('0x44')](function(_0x2e0a67){_0x397b93(_0x2e0a67);});})['then'](function(_0x5bb2cc){var _0x3ff9d1=qs['omit'](_0x12b5e0,['id',_0xf337('0x53'),_0xf337('0x51')]);_0x3ff9d1['userProfileId']=_0x2c2821['id'];if(_0x5bb2cc)_0x3ff9d1[_0xf337('0x59')]=_0x5bb2cc;return _0x3ff9d1;})[_0xf337('0x28')](function(_0x5bade3){return db[_0xf337('0x56')][_0xf337('0x4b')](_0x5bade3,{'include':[{'model':db[_0xf337('0x58')],'as':_0xf337('0x59')}],'raw':!![],'transaction':_0x230370});});})[_0xf337('0x28')](function(){return _0x2c2821;});}});});});}})[_0xf337('0x28')](respondWithResult(_0x443c3a,0xc9))[_0xf337('0x44')](handleError(_0x443c3a,null));};exports[_0xf337('0x27')]=function(_0x3bb5fe,_0x3a71ab){if(_0x3bb5fe[_0xf337('0x4c')]['id']){delete _0x3bb5fe[_0xf337('0x4c')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x3bb5fe[_0xf337('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a71ab,null))['then'](saveUpdates(_0x3bb5fe['body'],null))[_0xf337('0x28')](respondWithResult(_0x3a71ab,null))[_0xf337('0x44')](handleError(_0x3a71ab,null));};exports[_0xf337('0x5a')]=function(_0x11b171,_0x392323){return db['UserProfile']['find']({'where':{'id':_0x11b171['params']['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x392323,null))[_0xf337('0x28')](removeEntity(_0x392323,null))[_0xf337('0x44')](handleError(_0x392323,null));};exports[_0xf337('0x5b')]=function(_0x3180f5,_0x410cc6){return db['UserProfile'][_0xf337('0x5b')]()['then'](respondWithResult(_0x410cc6,null))[_0xf337('0x44')](handleError(_0x410cc6,null));};exports[_0xf337('0x5c')]=function(_0x4189ac,_0x880027){var _0x426da1=_0x4189ac[_0xf337('0x4c')];return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x4189ac[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x880027,null))[_0xf337('0x28')](function(_0x1afcf7){if(_0x1afcf7){return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x12c934){return db[_0xf337('0x56')][_0xf337('0x5a')]({'where':{'userProfileId':_0x4189ac['params']['id'],'sectionId':_[_0xf337('0x2d')](_0x426da1,function(_0x50af6c){return _0x50af6c['sectionId'];})},'transaction':_0x12c934})[_0xf337('0x28')](function(){var _0x1a80f9=_[_0xf337('0x2d')](_0x426da1,function(_0x385ed3){_0x385ed3['userProfileId']=_0x4189ac[_0xf337('0x46')]['id'];return _0x385ed3;});var _0x59461c=[];return BPromise[_0xf337('0x5d')](_0x1a80f9,function(_0x5b4016){return db[_0xf337('0x56')][_0xf337('0x4b')](_0x5b4016,{'include':[{'model':db[_0xf337('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x12c934})[_0xf337('0x28')](function(_0x447a68){_0x59461c[_0xf337('0x5e')](_0x447a68[_0xf337('0x4f')]({'plain':!![]}));});})[_0xf337('0x28')](function(){return _0x59461c;});});});}})[_0xf337('0x28')](function(_0xfdf2b3){return _0xfdf2b3;})[_0xf337('0x28')](respondWithResult(_0x880027,null))['catch'](handleError(_0x880027,null));};exports[_0xf337('0x5f')]=function(_0x1dc30c,_0x536934){var _0x1d61ec;return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x1dc30c[_0xf337('0x46')]['id']},'attributes':['id',_0xf337('0x2b')]})[_0xf337('0x28')](handleEntityNotFound(_0x536934,null))[_0xf337('0x28')](function(_0x3d01bf){if(_0x3d01bf){_0x1d61ec=_0x3d01bf;return db[_0xf337('0x56')][_0xf337('0x5a')]({'where':{'userProfileId':_0x1dc30c[_0xf337('0x46')]['id'],'sectionId':_0x1dc30c['query'][_0xf337('0x60')]}});}})[_0xf337('0x28')](function(){return _0x1d61ec;})[_0xf337('0x28')](respondWithStatusCode(_0x536934,null))[_0xf337('0x44')](handleError(_0x536934,null));};exports[_0xf337('0x61')]=function(_0x4473c3,_0x17f9ac){var _0x2a02cb=[];var _0x2994fe=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4473c3[_0xf337('0x46')]['id']},'raw':!![]})[_0xf337('0x28')](function(_0x4d3c08){_0x2a02cb=_[_0xf337('0x3d')](_0x4d3c08,function(_0x5e1c5b){return _0x5e1c5b[_0xf337('0x62')]===0x1||_[_0xf337('0x63')]([0x3eb,0x709],_0x5e1c5b[_0xf337('0x64')]);});if(!_['isEmpty'](_0x2a02cb)){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x1bb73a){return _0x1bb73a[_0xf337('0x64')];});}else{return;}})[_0xf337('0x28')](function(_0x2e7587){if(_0x2e7587)_0x2994fe=_0x2e7587;if(_[_0xf337('0x63')](_0x2994fe,0x64)){var _0x3b7b19=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x64});return hasDefaultDashboard(_0x3b7b19)[_0xf337('0x28')](function(_0x35e569){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x1339c8){if(_0x1339c8[_0xf337('0x64')]===0x64){_0x1339c8[_0xf337('0x65')]=_0x35e569;}return _0x1339c8;});});}else{return;}})[_0xf337('0x28')](function(_0x4c40b7){if(_0x4c40b7)_0x2a02cb=_0x4c40b7;if(_['includes'](_0x2994fe,0x3eb)){var _0x24fc53=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x3eb});return getCustomDashboards(_0x24fc53)['then'](function(_0x52964b){return _['map'](_0x2a02cb,function(_0x570ce5){if(_0x24fc53[_0xf337('0x62')]){if(_0x570ce5[_0xf337('0x64')]===0x3eb){_0x570ce5[_0xf337('0x65')]=_0x52964b;}}else{if(_0x570ce5['sectionId']===0x64){_0x570ce5['subsections']=_0x52964b;}}return _0x570ce5;});});}else{return;}})['then'](function(_0x335756){if(_0x335756)_0x2a02cb=_0x335756;if(_[_0xf337('0x63')](_0x2994fe,0x709)){var _0x1711a4=_[_0xf337('0x4a')](_0x2a02cb,{'sectionId':0x709});return getPlugins(_0x1711a4)[_0xf337('0x28')](function(_0x262e55){if(_0x1711a4[_0xf337('0x62')]){return _[_0xf337('0x2d')](_0x2a02cb,function(_0x329c45){if(_0x329c45[_0xf337('0x64')]===0x709){_0x329c45[_0xf337('0x65')]=_0x262e55;}return _0x329c45;});}else{var _0x464d22={'sectionId':0x76c,'enabled':0x1,'subsections':_0x262e55};var _0x1cb92c=_[_0xf337('0x2d')](_0x2a02cb);_0x1cb92c[_0xf337('0x5e')](_0x464d22);return _0x1cb92c;}});}else{return;}})[_0xf337('0x28')](function(_0x5ee9b5){if(_0x5ee9b5)_0x2a02cb=_0x5ee9b5;return _[_0xf337('0x3d')](_0x2a02cb,[_0xf337('0x62'),0x1]);})['then'](respondWithResult(_0x17f9ac,null))[_0xf337('0x44')](handleError(_0x17f9ac,null));};function hasDefaultDashboard(_0x4ac82e){var _0x19480c=[0x65];return new BPromise(function(_0x480c82,_0x1d9319){try{if(_0x4ac82e[_0xf337('0x57')]){_0x480c82(_0x19480c);}else{return db[_0xf337('0x58')][_0xf337('0x66')]({'where':{'sectionId':_0x4ac82e['id']},'raw':!![]})['then'](function(_0x4a8bd6){_0x4a8bd6?_0x480c82(_0x19480c):_0x480c82();});}}catch(_0xad9378){_0x1d9319(_0xad9378);}});}function getCustomDashboards(_0x3aa0cd){var _0x4dc955=[];return new BPromise(function(_0x444db8,_0x3d79e2){try{if(_0x3aa0cd[_0xf337('0x57')]){return db[_0xf337('0x67')][_0xf337('0x42')]({'raw':!![]})[_0xf337('0x28')](function(_0x3d75b8){_0x3d75b8[_0xf337('0x68')](function(_0x4b91a9){_0x4dc955[_0xf337('0x5e')](_0x4b91a9['id']+0x1869f);});_0x444db8(_0x4dc955);});}else{return db[_0xf337('0x58')][_0xf337('0x42')]({'where':{'sectionId':_0x3aa0cd['id']},'raw':!![]})[_0xf337('0x28')](function(_0x515c0c){_0x515c0c[_0xf337('0x68')](function(_0x3862c5){_0x4dc955[_0xf337('0x5e')](_0x3862c5[_0xf337('0x69')]+0x1869f);});_0x444db8(_0x4dc955);});}}catch(_0x608080){_0x3d79e2(_0x608080);}});}function getPlugins(_0x54be21){var _0x495eae=[];return new BPromise(function(_0x5224d1,_0xb13a97){try{if(_0x54be21['autoAssociation']){return db[_0xf337('0x6a')][_0xf337('0x42')]({'raw':!![]})[_0xf337('0x28')](function(_0x493b06){_0x493b06['forEach'](function(_0x55213d){_0x495eae[_0xf337('0x5e')](_0x55213d['id']+0x15b38);});_0x5224d1(_0x495eae);});}else{return db[_0xf337('0x58')]['findAll']({'where':{'sectionId':_0x54be21['id']},'raw':!![]})[_0xf337('0x28')](function(_0x35570a){_0x35570a[_0xf337('0x68')](function(_0x3841b3){_0x495eae[_0xf337('0x5e')](_0x3841b3['resourceId']+0x15b38);});_0x5224d1(_0x495eae);});}}catch(_0x3ac4fb){_0xb13a97(_0x3ac4fb);}});}exports[_0xf337('0x6b')]=function(_0x186afd,_0x10b1dd){return db['UserProfile'][_0xf337('0x4a')]({'where':{'id':_0x186afd[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x10b1dd,null))[_0xf337('0x28')](function(_0x17abd6){if(_0x17abd6){return db[_0xf337('0x54')][_0xf337('0x55')](function(_0x219212){return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x580be4){if(_0x580be4){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id'],'id':_[_0xf337('0x2d')](_0x580be4,function(_0x28a77f){return _0x28a77f['id'];})},'transaction':_0x219212});}})['then'](function(_0x2d4c1e){var _0x2b54e5=_['map'](_0x186afd[_0xf337('0x4c')],function(_0x3c4876){_0x3c4876[_0xf337('0x6c')]=_0x186afd['params']['id'];return _0x3c4876;});return db['UserProfileSection'][_0xf337('0x6d')](_0x2b54e5,{'raw':!![],'transaction':_0x219212});})['then'](function(_0x5b33d4){var _0x37bca1=_[_0xf337('0x3d')](_['map'](_0x5b33d4,function(_0x262932){return _0x262932[_0xf337('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x37bca1){return db[_0xf337('0x56')][_0xf337('0x42')]({'where':{'userProfileId':_0x186afd[_0xf337('0x46')]['id'],'sectionId':_[_0xf337('0x2d')](_0x37bca1,function(_0x2e8d6d){return _0x2e8d6d[_0xf337('0x64')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xf337('0x28')](function(_0x417aca){var _0x2207b1=_['map'](_0x186afd[_0xf337('0x4c')],function(_0x19ccff){_0x19ccff[_0xf337('0x6c')]=_0x186afd['params']['id'];return _0x19ccff;});return db[_0xf337('0x58')]['bulkCreate'](_0x2207b1,{'raw':!![],'transaction':_0x219212});});}})[_0xf337('0x44')](handleError(_0x10b1dd,null));});}})[_0xf337('0x28')](function(_0x353859){var _0x41f78e=_[_0xf337('0x2d')](_0x353859,function(_0x3bb9e1){return _0x3bb9e1[_0xf337('0x4f')]({'plain':!![]});});})[_0xf337('0x28')](respondWithResult(_0x10b1dd,null))[_0xf337('0x44')](handleError(_0x10b1dd,null));};exports[_0xf337('0x6e')]=function(_0x12189a,_0x511879,_0x1f2e7c){return db[_0xf337('0x2e')][_0xf337('0x4a')]({'where':{'id':_0x12189a[_0xf337('0x46')]['id']}})[_0xf337('0x28')](handleEntityNotFound(_0x511879,null))[_0xf337('0x28')](function(_0x4f6843){if(_0x4f6843){return _0x4f6843[_0xf337('0x6e')](_0x12189a['query']['ids']);}})[_0xf337('0x28')](respondWithStatusCode(_0x511879,null))[_0xf337('0x44')](handleError(_0x511879,null));};exports['getResources']=function(_0x18d0a8,_0x1fac8c){var _0x28462c={};if(!_0x18d0a8[_0xf337('0x34')][_0xf337('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x18d0a8[_0xf337('0x34')][_0xf337('0x39')](_0xf337('0x3a'))){_0x28462c[_0xf337('0x20')]=qs[_0xf337('0x20')](_0x18d0a8['query'][_0xf337('0x20')]);_0x28462c['offset']=qs[_0xf337('0x23')](_0x18d0a8['query'][_0xf337('0x23')]);}return db[_0xf337('0x2e')]['find']({'where':{'id':_0x18d0a8['params']['id']}})[_0xf337('0x28')](function(_0x5e2b57){if(!_0x5e2b57)throw new Error(_0xf337('0x70')+_0x18d0a8[_0xf337('0x46')]['id']);return db['UserProfile'][_0xf337('0x71')](_0x18d0a8);})['then'](respondWithFilteredResult(_0x1fac8c,_0x28462c))[_0xf337('0x44')](handleError(_0x1fac8c,null));}; \ No newline at end of file +var _0x68b3=['addSections','transaction','sectionId','push','removeSections','ids','enabled','includes','subsections','forEach','resourceId','addResources','bulkCreate','removeResources','section','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','rawAttributes','fieldName','type','name','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','includeAll','findAll','rows','show','params','length','include','find','catch','create','clone','crudPermissions','omit','body','sequelize','get','UserProfileSection','each','autoAssociation','createdAt','updatedAt','userProfileId','UserProfileResource','describe'];(function(_0x533381,_0x8a69fa){var _0x2877ed=function(_0x45cb54){while(--_0x45cb54){_0x533381['push'](_0x533381['shift']());}};_0x2877ed(++_0x8a69fa);}(_0x68b3,0x1d8));var _0x368b=function(_0x3e1882,_0x202cb2){_0x3e1882=_0x3e1882-0x0;var _0x2d0826=_0x68b3[_0x3e1882];return _0x2d0826;};'use strict';var emlformat=require(_0x368b('0x0'));var rimraf=require(_0x368b('0x1'));var zipdir=require(_0x368b('0x2'));var jsonpatch=require(_0x368b('0x3'));var rp=require(_0x368b('0x4'));var moment=require('moment');var BPromise=require(_0x368b('0x5'));var Mustache=require(_0x368b('0x6'));var util=require(_0x368b('0x7'));var path=require(_0x368b('0x8'));var sox=require('sox');var csv=require(_0x368b('0x9'));var ejs=require(_0x368b('0xa'));var fs=require('fs');var fs_extra=require(_0x368b('0xb'));var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0x9'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x368b('0x19'));var db=require(_0x368b('0x1a'))['db'];config['redis']=_[_0x368b('0x1b')](config[_0x368b('0x1c')],{'host':_0x368b('0x1d'),'port':0x18eb});var socket=require(_0x368b('0x1e'))(new Redis(config[_0x368b('0x1c')]));require('./userProfile.socket')[_0x368b('0x1f')](socket);function respondWithStatusCode(_0x40faa0,_0x4ce41b){_0x4ce41b=_0x4ce41b||0xcc;return function(_0x1c5e5b){if(_0x1c5e5b){return _0x40faa0[_0x368b('0x20')](_0x4ce41b);}return _0x40faa0[_0x368b('0x21')](_0x4ce41b)['end']();};}function respondWithResult(_0x220cd5,_0x392376){_0x392376=_0x392376||0xc8;return function(_0x1f1029){if(_0x1f1029){return _0x220cd5['status'](_0x392376)[_0x368b('0x22')](_0x1f1029);}};}function respondWithFilteredResult(_0x1b9e65,_0x1c2956){return function(_0x540f57){if(_0x540f57){var _0x5d543e=typeof _0x1c2956[_0x368b('0x23')]===_0x368b('0x24')&&typeof _0x1c2956[_0x368b('0x25')]===_0x368b('0x24');var _0x1a4f20=_0x540f57['count'];var _0x26447c=_0x5d543e?0x0:_0x1c2956[_0x368b('0x23')];var _0x2e74ca=_0x5d543e?_0x540f57[_0x368b('0x26')]:_0x1c2956[_0x368b('0x23')]+_0x1c2956[_0x368b('0x25')];var _0x397185;if(_0x2e74ca>=_0x1a4f20){_0x2e74ca=_0x1a4f20;_0x397185=0xc8;}else{_0x397185=0xce;}_0x1b9e65[_0x368b('0x21')](_0x397185);return _0x1b9e65['set'](_0x368b('0x27'),_0x26447c+'-'+_0x2e74ca+'/'+_0x1a4f20)[_0x368b('0x22')](_0x540f57);}return null;};}function patchUpdates(_0x18869a){return function(_0xc0f7af){try{jsonpatch[_0x368b('0x28')](_0xc0f7af,_0x18869a,!![]);}catch(_0x4c2fca){return BPromise[_0x368b('0x29')](_0x4c2fca);}return _0xc0f7af[_0x368b('0x2a')]();};}function saveUpdates(_0x3a22bd,_0xafa856){return function(_0x77a269){if(_0x77a269){return _0x77a269[_0x368b('0x2b')](_0x3a22bd)[_0x368b('0x2c')](function(_0x11ea2d){return _0x11ea2d;});}return null;};}function removeEntity(_0x3123c1,_0x3f7f89){return function(_0x133c1b){if(_0x133c1b){return _0x133c1b[_0x368b('0x2d')]()[_0x368b('0x2c')](function(){_0x3123c1[_0x368b('0x21')](0xcc)[_0x368b('0x2e')]();});}};}function handleEntityNotFound(_0x23a83a,_0x5dc5fa){return function(_0x9f192e){if(!_0x9f192e){_0x23a83a[_0x368b('0x20')](0x194);}return _0x9f192e;};}function handleError(_0x1e0e46,_0x2b036e){_0x2b036e=_0x2b036e||0x1f4;return function(_0xc12627){logger[_0x368b('0x2f')](_0xc12627[_0x368b('0x30')]);if(_0xc12627['name']){delete _0xc12627['name'];}_0x1e0e46[_0x368b('0x21')](_0x2b036e)[_0x368b('0x31')](_0xc12627);};}exports[_0x368b('0x32')]=function(_0x152048,_0x5d6ebf){var _0x12ae59={},_0x1f3ed3={},_0x3699fe={'count':0x0,'rows':[]};var _0x1c68ca=_[_0x368b('0x33')](db['UserProfile'][_0x368b('0x34')],function(_0x424fab){return{'name':_0x424fab[_0x368b('0x35')],'type':_0x424fab[_0x368b('0x36')]['key']};});_0x1f3ed3['model']=_['map'](_0x1c68ca,_0x368b('0x37'));_0x1f3ed3[_0x368b('0x38')]=_[_0x368b('0x39')](_0x152048[_0x368b('0x38')]);_0x1f3ed3[_0x368b('0x3a')]=_['intersection'](_0x1f3ed3[_0x368b('0x3b')],_0x1f3ed3[_0x368b('0x38')]);_0x12ae59['attributes']=_[_0x368b('0x3c')](_0x1f3ed3[_0x368b('0x3b')],qs['fields'](_0x152048[_0x368b('0x38')][_0x368b('0x3d')]));_0x12ae59['attributes']=_0x12ae59[_0x368b('0x3e')]['length']?_0x12ae59['attributes']:_0x1f3ed3['model'];if(!_0x152048[_0x368b('0x38')][_0x368b('0x3f')](_0x368b('0x40'))){_0x12ae59[_0x368b('0x25')]=qs[_0x368b('0x25')](_0x152048[_0x368b('0x38')][_0x368b('0x25')]);_0x12ae59[_0x368b('0x23')]=qs[_0x368b('0x23')](_0x152048[_0x368b('0x38')]['offset']);}_0x12ae59[_0x368b('0x41')]=qs[_0x368b('0x42')](_0x152048['query'][_0x368b('0x42')]);_0x12ae59[_0x368b('0x43')]=qs[_0x368b('0x3a')](_[_0x368b('0x44')](_0x152048[_0x368b('0x38')],_0x1f3ed3['filters']),_0x1c68ca);if(_0x152048[_0x368b('0x38')][_0x368b('0x45')]){_0x12ae59[_0x368b('0x43')]=_[_0x368b('0x46')](_0x12ae59['where'],{'$or':_['map'](_0x1c68ca,function(_0x7ba60d){if(_0x7ba60d[_0x368b('0x36')]!==_0x368b('0x47')){var _0x1e271d={};_0x1e271d[_0x7ba60d[_0x368b('0x37')]]={'$like':'%'+_0x152048[_0x368b('0x38')][_0x368b('0x45')]+'%'};return _0x1e271d;}})});}_0x12ae59=_[_0x368b('0x46')]({},_0x12ae59,_0x152048[_0x368b('0x48')]);var _0x1c30ff={'where':_0x12ae59['where']};return db[_0x368b('0x49')][_0x368b('0x26')](_0x1c30ff)['then'](function(_0x25e713){_0x3699fe[_0x368b('0x26')]=_0x25e713;if(_0x152048[_0x368b('0x38')][_0x368b('0x4a')]){_0x12ae59['include']=[{'all':!![]}];}return db[_0x368b('0x49')][_0x368b('0x4b')](_0x12ae59);})['then'](function(_0x91bb0b){_0x3699fe[_0x368b('0x4c')]=_0x91bb0b;return _0x3699fe;})[_0x368b('0x2c')](respondWithFilteredResult(_0x5d6ebf,_0x12ae59))['catch'](handleError(_0x5d6ebf,null));};exports[_0x368b('0x4d')]=function(_0x9427e6,_0x39005c){var _0x47ce0b={'raw':![],'where':{'id':_0x9427e6[_0x368b('0x4e')]['id']}},_0x4c9373={};_0x4c9373[_0x368b('0x3b')]=_['keys'](db[_0x368b('0x49')][_0x368b('0x34')]);_0x4c9373[_0x368b('0x38')]=_[_0x368b('0x39')](_0x9427e6[_0x368b('0x38')]);_0x4c9373[_0x368b('0x3a')]=_[_0x368b('0x3c')](_0x4c9373[_0x368b('0x3b')],_0x4c9373[_0x368b('0x38')]);_0x47ce0b[_0x368b('0x3e')]=_[_0x368b('0x3c')](_0x4c9373[_0x368b('0x3b')],qs[_0x368b('0x3d')](_0x9427e6['query'][_0x368b('0x3d')]));_0x47ce0b[_0x368b('0x3e')]=_0x47ce0b[_0x368b('0x3e')][_0x368b('0x4f')]?_0x47ce0b[_0x368b('0x3e')]:_0x4c9373['model'];if(_0x9427e6['query'][_0x368b('0x4a')]){_0x47ce0b[_0x368b('0x50')]=[{'all':!![]}];}_0x47ce0b=_[_0x368b('0x46')]({},_0x47ce0b,_0x9427e6['options']);return db[_0x368b('0x49')][_0x368b('0x51')](_0x47ce0b)[_0x368b('0x2c')](handleEntityNotFound(_0x39005c,null))[_0x368b('0x2c')](respondWithResult(_0x39005c,null))[_0x368b('0x52')](handleError(_0x39005c,null));};exports[_0x368b('0x53')]=function(_0x8f35b,_0x1174fa){return db[_0x368b('0x49')][_0x368b('0x53')](_0x8f35b['body'],{})[_0x368b('0x2c')](respondWithResult(_0x1174fa,0xc9))['catch'](handleError(_0x1174fa,null));};exports[_0x368b('0x54')]=function(_0x544337,_0x221d59){var _0x4b2d5f={'where':{'id':_0x544337[_0x368b('0x4e')]['id']}},_0x456f19={};_0x456f19[_0x368b('0x3b')]=_[_0x368b('0x39')](db['UserProfile'][_0x368b('0x34')]);_0x4b2d5f[_0x368b('0x3e')]=_[_0x368b('0x3c')](_0x456f19[_0x368b('0x3b')],qs[_0x368b('0x3d')](_0x544337[_0x368b('0x38')][_0x368b('0x3d')]));_0x4b2d5f[_0x368b('0x3e')]=_0x4b2d5f[_0x368b('0x3e')]['length']?_0x4b2d5f[_0x368b('0x3e')]:_0x456f19[_0x368b('0x3b')];if(_0x544337[_0x368b('0x38')][_0x368b('0x4a')]){_0x4b2d5f[_0x368b('0x50')]=[{'all':!![]}];}_0x4b2d5f=_['merge']({},_0x4b2d5f,_0x544337[_0x368b('0x48')]);return db[_0x368b('0x49')][_0x368b('0x51')](_0x4b2d5f)[_0x368b('0x2c')](handleEntityNotFound(_0x221d59,null))[_0x368b('0x2c')](function(_0x521316){if(_0x521316){var _0x31db04=_0x521316['get']({'plain':!![]});_0x31db04=qs['omit'](_0x31db04,['id','createdAt','updatedAt',_0x368b('0x55')]);_0x544337['body']=_[_0x368b('0x56')](_0x544337[_0x368b('0x57')],['id','createdAt','updatedAt']);return db[_0x368b('0x58')]['transaction'](function(_0x23b80b){return db[_0x368b('0x49')]['create'](_[_0x368b('0x46')](_0x31db04,_0x544337[_0x368b('0x57')]),{'include':_0x544337['query'][_0x368b('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x23b80b})['then'](function(_0xace120){var _0x359bc6=_0xace120[_0x368b('0x59')]({'plain':!![]});return db[_0x368b('0x5a')]['findAll']({'where':{'userProfileId':_0x544337[_0x368b('0x4e')]['id']},'raw':!![]})[_0x368b('0x2c')](function(_0x670789){if(_0x670789){return BPromise[_0x368b('0x5b')](_0x670789,function(_0x49a634){return new BPromise(function(_0x163ed4,_0x47b3c9){if(_0x49a634[_0x368b('0x5c')]===null||_0x49a634[_0x368b('0x5c')]===0x1)_0x163ed4(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x49a634['id']},'raw':!![]})[_0x368b('0x2c')](function(_0xeea586){var _0x2449ec=_[_0x368b('0x33')](_0xeea586,function(_0x229fac){return qs['omit'](_0x229fac,['id',_0x368b('0x5d'),_0x368b('0x5e'),'sectionId']);});_0x163ed4(_0x2449ec);})[_0x368b('0x52')](function(_0x19d5cc){_0x47b3c9(_0x19d5cc);});})[_0x368b('0x2c')](function(_0x302b06){var _0x5ef40c=qs[_0x368b('0x56')](_0x49a634,['id',_0x368b('0x5d'),_0x368b('0x5e')]);_0x5ef40c[_0x368b('0x5f')]=_0x359bc6['id'];if(_0x302b06)_0x5ef40c['Resources']=_0x302b06;return _0x5ef40c;})['then'](function(_0x5c8438){return db['UserProfileSection'][_0x368b('0x53')](_0x5c8438,{'include':[{'model':db[_0x368b('0x60')],'as':'Resources'}],'raw':!![],'transaction':_0x23b80b});});})['then'](function(){return _0x359bc6;});}});});});}})['then'](respondWithResult(_0x221d59,0xc9))['catch'](handleError(_0x221d59,null));};exports['update']=function(_0x33c3a6,_0x184175){if(_0x33c3a6[_0x368b('0x57')]['id']){delete _0x33c3a6['body']['id'];}return db[_0x368b('0x49')]['find']({'where':{'id':_0x33c3a6['params']['id']}})[_0x368b('0x2c')](handleEntityNotFound(_0x184175,null))[_0x368b('0x2c')](saveUpdates(_0x33c3a6[_0x368b('0x57')],null))[_0x368b('0x2c')](respondWithResult(_0x184175,null))['catch'](handleError(_0x184175,null));};exports[_0x368b('0x2d')]=function(_0x3ef3f9,_0x20feff){return db['UserProfile'][_0x368b('0x51')]({'where':{'id':_0x3ef3f9[_0x368b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20feff,null))[_0x368b('0x2c')](removeEntity(_0x20feff,null))[_0x368b('0x52')](handleError(_0x20feff,null));};exports['describe']=function(_0x46984d,_0x4bcb2b){return db[_0x368b('0x49')][_0x368b('0x61')]()['then'](respondWithResult(_0x4bcb2b,null))[_0x368b('0x52')](handleError(_0x4bcb2b,null));};exports[_0x368b('0x62')]=function(_0x3785af,_0x46d394){var _0x281023=_0x3785af['body'];return db[_0x368b('0x49')][_0x368b('0x51')]({'where':{'id':_0x3785af[_0x368b('0x4e')]['id']}})[_0x368b('0x2c')](handleEntityNotFound(_0x46d394,null))[_0x368b('0x2c')](function(_0x1c9cce){if(_0x1c9cce){return db[_0x368b('0x58')][_0x368b('0x63')](function(_0x4f9018){return db[_0x368b('0x5a')][_0x368b('0x2d')]({'where':{'userProfileId':_0x3785af['params']['id'],'sectionId':_[_0x368b('0x33')](_0x281023,function(_0x18b97b){return _0x18b97b[_0x368b('0x64')];})},'transaction':_0x4f9018})['then'](function(){var _0x49ba44=_[_0x368b('0x33')](_0x281023,function(_0x4121d8){_0x4121d8[_0x368b('0x5f')]=_0x3785af[_0x368b('0x4e')]['id'];return _0x4121d8;});var _0x5aa9a7=[];return BPromise[_0x368b('0x5b')](_0x49ba44,function(_0x5d7ed8){return db[_0x368b('0x5a')][_0x368b('0x53')](_0x5d7ed8,{'include':[{'model':db[_0x368b('0x60')],'as':'Resources'}],'raw':!![],'transaction':_0x4f9018})[_0x368b('0x2c')](function(_0x2e9cbe){_0x5aa9a7[_0x368b('0x65')](_0x2e9cbe['get']({'plain':!![]}));});})['then'](function(){return _0x5aa9a7;});});});}})['then'](function(_0x7bca21){return _0x7bca21;})[_0x368b('0x2c')](respondWithResult(_0x46d394,null))[_0x368b('0x52')](handleError(_0x46d394,null));};exports[_0x368b('0x66')]=function(_0x321112,_0x5c338d){var _0x8710f7;return db[_0x368b('0x49')]['find']({'where':{'id':_0x321112[_0x368b('0x4e')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x5c338d,null))[_0x368b('0x2c')](function(_0x1fd720){if(_0x1fd720){_0x8710f7=_0x1fd720;return db[_0x368b('0x5a')][_0x368b('0x2d')]({'where':{'userProfileId':_0x321112[_0x368b('0x4e')]['id'],'sectionId':_0x321112[_0x368b('0x38')][_0x368b('0x67')]}});}})[_0x368b('0x2c')](function(){return _0x8710f7;})[_0x368b('0x2c')](respondWithStatusCode(_0x5c338d,null))[_0x368b('0x52')](handleError(_0x5c338d,null));};exports['getSections']=function(_0x5ed540,_0x5e8bf3){var _0x54dd31=[];var _0xc97215=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5ed540[_0x368b('0x4e')]['id']},'raw':!![]})[_0x368b('0x2c')](function(_0x12443c){_0x54dd31=_[_0x368b('0x45')](_0x12443c,function(_0x4242ba){return _0x4242ba[_0x368b('0x68')]===0x1||_[_0x368b('0x69')]([0x3eb,0x709],_0x4242ba[_0x368b('0x64')]);});if(!_['isEmpty'](_0x54dd31)){return _[_0x368b('0x33')](_0x54dd31,function(_0x99599c){return _0x99599c['sectionId'];});}else{return;}})[_0x368b('0x2c')](function(_0x1bc733){if(_0x1bc733)_0xc97215=_0x1bc733;if(_[_0x368b('0x69')](_0xc97215,0x64)){var _0xb49743=_[_0x368b('0x51')](_0x54dd31,{'sectionId':0x64});return hasDefaultDashboard(_0xb49743)[_0x368b('0x2c')](function(_0x1ac79c){return _[_0x368b('0x33')](_0x54dd31,function(_0x26013b){if(_0x26013b[_0x368b('0x64')]===0x64){_0x26013b[_0x368b('0x6a')]=_0x1ac79c;}return _0x26013b;});});}else{return;}})[_0x368b('0x2c')](function(_0x26b234){if(_0x26b234)_0x54dd31=_0x26b234;if(_[_0x368b('0x69')](_0xc97215,0x3eb)){var _0x5c0584=_['find'](_0x54dd31,{'sectionId':0x3eb});return getCustomDashboards(_0x5c0584)[_0x368b('0x2c')](function(_0x2ba4d0){return _[_0x368b('0x33')](_0x54dd31,function(_0x53be5c){if(_0x5c0584[_0x368b('0x68')]){if(_0x53be5c[_0x368b('0x64')]===0x3eb){_0x53be5c[_0x368b('0x6a')]=_0x2ba4d0;}}else{if(_0x53be5c['sectionId']===0x64){_0x53be5c[_0x368b('0x6a')]=_0x2ba4d0;}}return _0x53be5c;});});}else{return;}})[_0x368b('0x2c')](function(_0x5053b3){if(_0x5053b3)_0x54dd31=_0x5053b3;if(_[_0x368b('0x69')](_0xc97215,0x709)){var _0x318be2=_[_0x368b('0x51')](_0x54dd31,{'sectionId':0x709});return getPlugins(_0x318be2)['then'](function(_0x4ac7f3){if(_0x318be2[_0x368b('0x68')]){return _['map'](_0x54dd31,function(_0x2c6f57){if(_0x2c6f57[_0x368b('0x64')]===0x709){_0x2c6f57[_0x368b('0x6a')]=_0x4ac7f3;}return _0x2c6f57;});}else{var _0x4675d3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4ac7f3};var _0x5d552c=_[_0x368b('0x33')](_0x54dd31);_0x5d552c[_0x368b('0x65')](_0x4675d3);return _0x5d552c;}});}else{return;}})[_0x368b('0x2c')](function(_0x54c95a){if(_0x54c95a)_0x54dd31=_0x54c95a;return _[_0x368b('0x45')](_0x54dd31,[_0x368b('0x68'),0x1]);})[_0x368b('0x2c')](respondWithResult(_0x5e8bf3,null))[_0x368b('0x52')](handleError(_0x5e8bf3,null));};function hasDefaultDashboard(_0x568f4e){var _0x407ab1=[0x65];return new BPromise(function(_0x4844fe,_0x1740a6){try{if(_0x568f4e[_0x368b('0x5c')]){_0x4844fe(_0x407ab1);}else{return db[_0x368b('0x60')]['findOne']({'where':{'sectionId':_0x568f4e['id']},'raw':!![]})['then'](function(_0x4bb209){_0x4bb209?_0x4844fe(_0x407ab1):_0x4844fe();});}}catch(_0x57435b){_0x1740a6(_0x57435b);}});}function getCustomDashboards(_0x221d92){var _0x3146a9=[];return new BPromise(function(_0x4b2ca7,_0x4c14a3){try{if(_0x221d92[_0x368b('0x5c')]){return db['Dashboard'][_0x368b('0x4b')]({'raw':!![]})[_0x368b('0x2c')](function(_0x570efe){_0x570efe[_0x368b('0x6b')](function(_0x488fda){_0x3146a9[_0x368b('0x65')](_0x488fda['id']+0x1869f);});_0x4b2ca7(_0x3146a9);});}else{return db['UserProfileResource'][_0x368b('0x4b')]({'where':{'sectionId':_0x221d92['id']},'raw':!![]})[_0x368b('0x2c')](function(_0x59bd08){_0x59bd08[_0x368b('0x6b')](function(_0x50e5d3){_0x3146a9[_0x368b('0x65')](_0x50e5d3[_0x368b('0x6c')]+0x1869f);});_0x4b2ca7(_0x3146a9);});}}catch(_0x51c695){_0x4c14a3(_0x51c695);}});}function getPlugins(_0x5be9f4){var _0x34e436=[];return new BPromise(function(_0x4ee51f,_0x5aede6){try{if(_0x5be9f4[_0x368b('0x5c')]){return db['Plugin']['findAll']({'raw':!![]})['then'](function(_0x4f5958){_0x4f5958[_0x368b('0x6b')](function(_0x4a91da){_0x34e436[_0x368b('0x65')](_0x4a91da['id']+0x15b38);});_0x4ee51f(_0x34e436);});}else{return db[_0x368b('0x60')]['findAll']({'where':{'sectionId':_0x5be9f4['id']},'raw':!![]})[_0x368b('0x2c')](function(_0x3f5e7b){_0x3f5e7b['forEach'](function(_0xe4bbd0){_0x34e436['push'](_0xe4bbd0['resourceId']+0x15b38);});_0x4ee51f(_0x34e436);});}}catch(_0x1f4043){_0x5aede6(_0x1f4043);}});}exports[_0x368b('0x6d')]=function(_0x553ca9,_0x2dfaf0){return db['UserProfile']['find']({'where':{'id':_0x553ca9[_0x368b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dfaf0,null))[_0x368b('0x2c')](function(_0x4944d3){if(_0x4944d3){return db['sequelize'][_0x368b('0x63')](function(_0x5b02ca){return db[_0x368b('0x5a')][_0x368b('0x4b')]({'where':{'userProfileId':_0x553ca9[_0x368b('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x368b('0x2c')](function(_0x18aebc){if(_0x18aebc){return db[_0x368b('0x5a')]['destroy']({'where':{'userProfileId':_0x553ca9[_0x368b('0x4e')]['id'],'id':_[_0x368b('0x33')](_0x18aebc,function(_0x152108){return _0x152108['id'];})},'transaction':_0x5b02ca});}})[_0x368b('0x2c')](function(_0x134e28){var _0x498a81=_[_0x368b('0x33')](_0x553ca9[_0x368b('0x57')],function(_0x3672e6){_0x3672e6[_0x368b('0x5f')]=_0x553ca9[_0x368b('0x4e')]['id'];return _0x3672e6;});return db[_0x368b('0x5a')][_0x368b('0x6e')](_0x498a81,{'raw':!![],'transaction':_0x5b02ca});})[_0x368b('0x2c')](function(_0xf27a3f){var _0x26669e=_[_0x368b('0x45')](_[_0x368b('0x33')](_0xf27a3f,function(_0x14f666){return _0x14f666['get']({'plain':!![]});}),{'includeAll':![]});if(_0x26669e){return db[_0x368b('0x5a')][_0x368b('0x4b')]({'where':{'userProfileId':_0x553ca9[_0x368b('0x4e')]['id'],'sectionId':_[_0x368b('0x33')](_0x26669e,function(_0x3e82ca){return _0x3e82ca[_0x368b('0x64')];})},'attributes':['id',_0x368b('0x64')],'raw':!![]})[_0x368b('0x2c')](function(_0x13c734){var _0x30e6c3=_[_0x368b('0x33')](_0x553ca9[_0x368b('0x57')],function(_0x184e46){_0x184e46['userProfileId']=_0x553ca9[_0x368b('0x4e')]['id'];return _0x184e46;});return db[_0x368b('0x60')]['bulkCreate'](_0x30e6c3,{'raw':!![],'transaction':_0x5b02ca});});}})['catch'](handleError(_0x2dfaf0,null));});}})['then'](function(_0x221844){var _0x5168a4=_['map'](_0x221844,function(_0x177737){return _0x177737[_0x368b('0x59')]({'plain':!![]});});})[_0x368b('0x2c')](respondWithResult(_0x2dfaf0,null))[_0x368b('0x52')](handleError(_0x2dfaf0,null));};exports['removeResources']=function(_0x132f32,_0x28cf98,_0x1c405c){return db[_0x368b('0x49')][_0x368b('0x51')]({'where':{'id':_0x132f32[_0x368b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28cf98,null))[_0x368b('0x2c')](function(_0x319de3){if(_0x319de3){return _0x319de3[_0x368b('0x6f')](_0x132f32[_0x368b('0x38')][_0x368b('0x67')]);}})['then'](respondWithStatusCode(_0x28cf98,null))[_0x368b('0x52')](handleError(_0x28cf98,null));};exports['getResources']=function(_0x3b0faf,_0x5e770f){var _0x25b5da={};if(!_0x3b0faf['query'][_0x368b('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x3b0faf[_0x368b('0x38')][_0x368b('0x3f')]('nolimit')){_0x25b5da[_0x368b('0x25')]=qs[_0x368b('0x25')](_0x3b0faf[_0x368b('0x38')][_0x368b('0x25')]);_0x25b5da[_0x368b('0x23')]=qs[_0x368b('0x23')](_0x3b0faf[_0x368b('0x38')][_0x368b('0x23')]);}return db[_0x368b('0x49')][_0x368b('0x51')]({'where':{'id':_0x3b0faf[_0x368b('0x4e')]['id']}})[_0x368b('0x2c')](function(_0x34d744){if(!_0x34d744)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3b0faf[_0x368b('0x4e')]['id']);return db['UserProfile'][_0x368b('0x71')](_0x3b0faf);})['then'](respondWithFilteredResult(_0x5e770f,_0x25b5da))[_0x368b('0x52')](handleError(_0x5e770f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index fd7e7ef..fd7c9f5 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 _0xc6a2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5e2c0f,_0x5f1654){var _0x723dfa=function(_0x17c063){while(--_0x17c063){_0x5e2c0f['push'](_0x5e2c0f['shift']());}};_0x723dfa(++_0x5f1654);}(_0xc6a2,0x69));var _0x2c6a=function(_0x4a5193,_0x2a7bf8){_0x4a5193=_0x4a5193-0x0;var _0x33a1b9=_0xc6a2[_0x4a5193];return _0x33a1b9;};'use strict';var EventEmitter=require(_0x2c6a('0x0'));var UserProfile=require(_0x2c6a('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2c6a('0x2')](0x0);var events={'afterCreate':_0x2c6a('0x3'),'afterUpdate':_0x2c6a('0x4'),'afterDestroy':_0x2c6a('0x5')};function emitEvent(_0x121b96){return function(_0xc93e9a,_0x3b1269,_0x1d2cfd){UserProfileEvents[_0x2c6a('0x6')](_0x121b96+':'+_0xc93e9a['id'],_0xc93e9a);UserProfileEvents[_0x2c6a('0x6')](_0x121b96,_0xc93e9a);_0x1d2cfd(null);};}for(var e in events){if(events[_0x2c6a('0x7')](e)){var event=events[e];UserProfile[_0x2c6a('0x8')](e,emitEvent(event));}}module[_0x2c6a('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x171fa7,_0x587eca){var _0xc894e1=function(_0x43d7c7){while(--_0x43d7c7){_0x171fa7['push'](_0x171fa7['shift']());}};_0xc894e1(++_0x587eca);}(_0x583c,0x12b));var _0xc583=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x583c[_0x36d25e];return _0x4b95b8;};'use strict';var EventEmitter=require(_0xc583('0x0'));var UserProfile=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc583('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc583('0x4'),'afterDestroy':_0xc583('0x5')};function emitEvent(_0x4f7814){return function(_0x4ca8e3,_0x13b8a7,_0xf03852){UserProfileEvents['emit'](_0x4f7814+':'+_0x4ca8e3['id'],_0x4ca8e3);UserProfileEvents[_0xc583('0x6')](_0x4f7814,_0x4ca8e3);_0xf03852(null);};}for(var e in events){if(events[_0xc583('0x7')](e)){var event=events[e];UserProfile[_0xc583('0x8')](e,emitEvent(event));}}module[_0xc583('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 667b4e0..48fb248 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 _0xb016=['SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Interval','pauses','Sound','Tag','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','field','filter','then','associatedResources','map','catch','value','model','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc'];(function(_0x5655ab,_0x32197a){var _0x587792=function(_0x3b97c7){while(--_0x3b97c7){_0x5655ab['push'](_0x5655ab['shift']());}};_0x587792(++_0x32197a);}(_0xb016,0x159));var _0x6b01=function(_0x124a29,_0x3f92ca){_0x124a29=_0x124a29-0x0;var _0x473691=_0xb016[_0x124a29];return _0x473691;};'use strict';var _=require(_0x6b01('0x0'));var attributes=require(_0x6b01('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6b01('0x2')]=function(_0x531b6a){var _0x160a7d=_0x531b6a[_0x6b01('0x3')];function _0x161b59(_0x3b9de1,_0x5964ca){return new Promise(function(_0x1b7dd6,_0x65407a){if(!_0x5964ca)return _0x1b7dd6(null);var _0x192b2d=_0x5964ca['filter']?{[_0x5964ca['filter'][_0x6b01('0x4')]]:_0x5964ca[_0x6b01('0x5')]['value']}:undefined;return _0x160a7d[_0x3b9de1]['findAll']({'where':_0x192b2d,'raw':!![]})[_0x6b01('0x6')](function(_0x1cb3a6){_0x5964ca[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x1cb3a6,'id');_0x1b7dd6(_0x5964ca);})[_0x6b01('0x9')](function(_0x5bed15){_0x65407a(_0x5bed15);});});}function _0x4b4a4d(_0x4627ef,_0x24049f){return new Promise(function(_0x2660c7,_0x5a8817){var _0x200614=_0x4627ef['filter']?{[_0x4627ef['filter'][_0x6b01('0x4')]]:_0x4627ef['filter'][_0x6b01('0xa')]}:undefined;return _0x160a7d[_0x4627ef[_0x6b01('0xb')]]['findAll']({'where':_0x200614,'raw':!![]})[_0x6b01('0x6')](function(_0x4ea5fa){_0x24049f['associatedResources']=_['map'](_0x4ea5fa,function(_0x3d4666){return _0x3d4666['name'];});_0x2660c7(_0x24049f);})['catch'](function(_0x3a259f){_0x5a8817(_0x3a259f);});});}function _0x327e86(_0x20dd83,_0x41efa3,_0x3d7045){if(!_0x41efa3)return Promise[_0x6b01('0xc')](null);return new Promise(function(_0x122769,_0x33ffe8){return _0x160a7d[_0x6b01('0xd')][_0x6b01('0xe')]({'where':{'sectionId':_0x41efa3['id']},'raw':!![]})[_0x6b01('0x6')](function(_0x4f2d08){if(_0x20dd83[_0x6b01('0x4')]&&_0x20dd83[_0x6b01('0x4')]!=='id'){_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x5a7d75){return _0x5a7d75[_0x20dd83[_0x6b01('0x4')]];});}else{if(_0x3d7045===_0x6b01('0xf')){_0x41efa3[_0x6b01('0x7')]=_['map'](_0x4f2d08,function(_0x3029e2){return{'id':_0x3029e2[_0x6b01('0x10')],'type':_0x3029e2[_0x6b01('0x11')]};});}else{_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x181b09){return _0x181b09[_0x6b01('0x10')];});}}_0x122769(_0x41efa3);})['catch'](function(_0x7caa07){_0x33ffe8(_0x7caa07);});});}function _0xcf9200(_0x42c990,_0x51243c){var _0x399808={'parentSections':[]};switch(_0x42c990[_0x6b01('0x12')]()){case _0x6b01('0x13'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x15');break;case _0x6b01('0x16'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x17');break;case _0x6b01('0x18'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x19');_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x1b'),'field':'name','foreignKey':_0x6b01('0x1c')}];break;case _0x6b01('0x1d'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x1e');break;case _0x6b01('0x1f'):_0x399808['childModel']='CmContact';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x20'),'field':'id','foreignKey':_0x6b01('0x21')}];break;case _0x6b01('0x22'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x23');break;case'companies':_0x399808[_0x6b01('0x14')]='CmCompany';break;case _0x6b01('0x24'):_0x399808['childModel']=_0x6b01('0x25');break;case _0x6b01('0x26'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x27');break;case _0x6b01('0x28'):_0x399808['childModel']=_0x6b01('0x29');break;case _0x6b01('0x2a'):_0x399808[_0x6b01('0x14')]='FaxQueue';break;case'faxaccounts':_0x399808[_0x6b01('0x14')]='FaxAccount';break;case _0x6b01('0x2b'):case _0x6b01('0x2c'):case _0x6b01('0x2d'):_0x399808['childModel']=_0x6b01('0x2e');break;case _0x6b01('0x2f'):_0x399808[_0x6b01('0x14')]='VoiceContext';break;case _0x6b01('0x30'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x31');break;case _0x6b01('0x32'):_0x399808[_0x6b01('0x14')]='VoiceRecording';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x33'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x35'),'model':_0x6b01('0x36'),'filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x38')]}},{'name':_0x6b01('0x39'),'field':'name','foreignKey':_0x6b01('0x35'),'model':'User','filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x3a')]}},{'name':_0x6b01('0x3b'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':['inbound']}},{'name':_0x6b01('0x3e'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':[_0x6b01('0x3f')]}}];break;case _0x6b01('0x40'):_0x399808[_0x6b01('0x14')]='VoiceMusicOnHold';break;case _0x6b01('0x41'):_0x399808['childModel']=_0x6b01('0x42');break;case _0x6b01('0x43'):_0x399808['childModel']=_0x6b01('0x44');break;case _0x6b01('0x45'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x46');break;case _0x6b01('0x47'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x48');break;case _0x6b01('0x49'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x4a');break;case'mailsubstatuses':_0x399808[_0x6b01('0x14')]=_0x6b01('0x4b');break;case'openchannelqueues':_0x399808['childModel']=_0x6b01('0x4c');break;case _0x6b01('0x4d'):_0x399808['childModel']=_0x6b01('0x4e');break;case _0x6b01('0x4f'):_0x399808['childModel']=_0x6b01('0x50');break;case'smsaccounts':_0x399808[_0x6b01('0x14')]=_0x6b01('0x51');break;case _0x6b01('0x52'):_0x399808['childModel']=_0x6b01('0x53');break;case _0x6b01('0x54'):_0x399808['childModel']='WhatsappAccount';break;case'teams':_0x399808[_0x6b01('0x14')]=_0x6b01('0x55');break;case _0x6b01('0x56'):case _0x6b01('0x57'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x3d');if(_0x51243c){_0x399808['parentSections']=[{'name':_0x6b01('0x3b')},{'name':_0x6b01('0x3e')}];}break;case _0x6b01('0x58'):case _0x6b01('0x59'):case _0x6b01('0x5a'):_0x399808[_0x6b01('0x14')]='User';if(_0x51243c){_0x399808[_0x6b01('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0x6b01('0x5b'),_0x6b01('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6b01('0x39')}];}break;case _0x6b01('0x5d'):_0x399808[_0x6b01('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x399808['childModel']=_0x6b01('0x5e');break;case _0x6b01('0x5f'):_0x399808['childModel']=_0x6b01('0x60');break;case'sugarcrmaccounts':_0x399808['childModel']='SugarcrmAccount';break;case _0x6b01('0x61'):_0x399808[_0x6b01('0x14')]='DeskAccount';break;case'zohoaccounts':_0x399808[_0x6b01('0x14')]='ZohoAccount';break;case _0x6b01('0x62'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x36');break;case _0x6b01('0x63'):_0x399808[_0x6b01('0x14')]='CannedAnswer';break;case _0x6b01('0x64'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x65');break;case'customdashboards':_0x399808[_0x6b01('0x14')]=_0x6b01('0x66');break;case'intervals':_0x399808[_0x6b01('0x14')]=_0x6b01('0x67');break;case _0x6b01('0x68'):_0x399808[_0x6b01('0x14')]='Pause';break;case'scheduler':_0x399808[_0x6b01('0x14')]='Schedule';break;case'sounds':_0x399808[_0x6b01('0x14')]=_0x6b01('0x69');break;case'tags':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6a');break;case'templates':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6b');break;case _0x6b01('0x6c'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6d');break;case'trunks':_0x399808[_0x6b01('0x14')]='Trunk';break;case _0x6b01('0x6e'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6f');break;case'plugins':_0x399808[_0x6b01('0x14')]=_0x6b01('0x70');break;case _0x6b01('0x71'):_0x399808[_0x6b01('0x14')]='AnalyticExtractedReport';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x72'),'field':'id','foreignKey':_0x6b01('0x73')}];break;case'metrics':_0x399808['childModel']=_0x6b01('0x74');break;}return _0x399808;}function _0x1aefc2(_0x11cbcc,_0x4e1702){var _0x21b99f=_0x11cbcc[_0x6b01('0x75')](0x0)[_0x6b01('0x76')]()+_0x11cbcc['slice'](0x1);var _0x54b3ae={'type':_0x160a7d[_0x6b01('0x77')][_0x6b01('0x78')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e16e8,_0x3faa54){var _0xe6d027=squel[_0x6b01('0x79')]()[_0x6b01('0x4')](_0x6b01('0x7a')+_0x21b99f+_0x6b01('0x7b'),'id')[_0x6b01('0x4')](_0x6b01('0x7c'))['from'](_0x6b01('0x7d')+_0x11cbcc+_0x6b01('0x7e'),'ui')[_0x6b01('0x7f')](_0x6b01('0x80'),_0x4e1702['id']);return _0x160a7d[_0x6b01('0x81')][_0x6b01('0x82')](_0xe6d027[_0x6b01('0x83')](),_0x54b3ae)[_0x6b01('0x6')](function(_0x281e55){_0x4e1702[_0x21b99f+'OpenTabs']=_0x281e55;_0x3e16e8(_0x281e55);})[_0x6b01('0x9')](function(_0x25b39b){_0x3faa54(_0x25b39b);});});}return _0x531b6a[_0x6b01('0x84')](_0x6b01('0x85'),attributes,{'tableName':_0x6b01('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1dda2f){var _0x4c84cc={'raw':![],'where':{}};var _0x523102={};var _0x38ae38={'count':0x0,'rows':[]};var _0x270128=_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x87')];var _0x728ae2=_0x1dda2f[_0x6b01('0x82')]['mergeResources']||![];var _0x2bd87d=_0xcf9200(_0x270128,_0x728ae2);if(!_0x2bd87d[_0x6b01('0x14')])throw new Error(_0x6b01('0x88')+_0x270128+'\x27');var _0x44c3d1=[{'name':_0x270128}];if(!_[_0x6b01('0x89')](_0x2bd87d[_0x6b01('0x1a')]))_0x44c3d1=_0x2bd87d[_0x6b01('0x1a')];var _0x582bff=[];for(var _0x3ea965=0x0;_0x3ea965<_0x44c3d1['length'];_0x3ea965++){_0x582bff[_0x6b01('0x8a')](_0x160a7d[_0x6b01('0x8b')][_0x6b01('0x8c')]({'where':{'userProfileId':_0x1dda2f['params']['id'],'name':_0x44c3d1[_0x3ea965][_0x6b01('0x34')]},'raw':!![]}));}return Promise[_0x6b01('0x8d')](_0x582bff)[_0x6b01('0x6')](function(_0x14742e){var _0xa29570=_[_0x6b01('0x5')](_0x14742e,function(_0xdb2660){return _0xdb2660?_0xdb2660:undefined;});var _0x17481f=_[_0x6b01('0x5')](_0x44c3d1,[_0x6b01('0x8e'),!![]]);var _0x350e68=_[_0x6b01('0x89')](_0xa29570)&&_[_0x6b01('0x89')](_0x17481f)?null:_[_0x6b01('0x8f')](_0x17481f,_0xa29570);if(!_0x350e68)return null;var _0x207e0a=[];for(var _0x13ceac=0x0;_0x13ceac<_0x350e68[_0x6b01('0x90')];_0x13ceac++){var _0x3f077f=_[_0x6b01('0x8c')](_0x44c3d1,function(_0x4a8fcb){return _0x350e68[_0x13ceac]?_0x4a8fcb[_0x6b01('0x34')]===_0x350e68[_0x13ceac][_0x6b01('0x34')]:null;});if(_0x3f077f){if(_0x350e68[_0x13ceac][_0x6b01('0x8e')]){_0x207e0a[_0x6b01('0x8a')](_0x161b59(_0x2bd87d[_0x6b01('0x14')],_0x350e68[_0x13ceac]));}else{if(!_0x350e68[_0x13ceac][_0x6b01('0x91')]){_0x207e0a[_0x6b01('0x8a')](_0x327e86(_0x3f077f,_0x350e68[_0x13ceac],_0x2bd87d[_0x6b01('0x14')]));}else{if(_0x3f077f[_0x6b01('0xb')]){_0x207e0a[_0x6b01('0x8a')](_0x4b4a4d(_0x3f077f,_0x350e68[_0x13ceac]));}}}}}return Promise[_0x6b01('0x8d')](_0x207e0a);})[_0x6b01('0x6')](function(_0x468a0b){var _0x30171f=_0x468a0b;var _0x1a0bb7=null;if(_0x30171f){_0x1a0bb7=_0x30171f['length']===0x1?_0x30171f[0x0]:null;}if(!_0x1a0bb7&&!_0x30171f)return _0x38ae38;var _0xbcba19=_0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0x92')];_0x523102[_0x6b01('0xb')]=_[_0x6b01('0x93')](_0xbcba19);_0x523102[_0x6b01('0x82')]=_[_0x6b01('0x93')](_0x1dda2f[_0x6b01('0x82')]);_0x523102[_0x6b01('0x94')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],_0x523102[_0x6b01('0x82')]);_0x4c84cc[_0x6b01('0x96')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],qs[_0x6b01('0x97')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x97')]));_0x4c84cc[_0x6b01('0x96')]=_0x4c84cc[_0x6b01('0x96')]['length']?_0x4c84cc['attributes']:_0x523102['model'];if(!_0x1dda2f['query'][_0x6b01('0x98')]('nolimit')){_0x4c84cc['limit']=qs['limit'](_0x1dda2f[_0x6b01('0x82')]['limit']);_0x4c84cc[_0x6b01('0x99')]=qs[_0x6b01('0x99')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x99')]);}_0x4c84cc[_0x6b01('0x9a')]=qs['sort'](_0x1dda2f['query'][_0x6b01('0x9b')]);_0x4c84cc[_0x6b01('0x7f')]=qs[_0x6b01('0x94')](_['pick'](_0x1dda2f[_0x6b01('0x82')],_0x523102[_0x6b01('0x94')]));if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$or':_['map'](_0xbcba19,function(_0x1a03e4){if(_0x1a03e4[_0x6b01('0x11')][_0x6b01('0x9c')]!==_0x6b01('0x9d')){var _0x16a427={};_0x16a427[_0x1a03e4['field']]={'$like':'%'+_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]+'%'};return _0x16a427;}})});}var _0xb133fc=[];var _0x8b2514=null;var _0x4dbd69={};if(_0x1a0bb7){_0x8b2514=_[_0x6b01('0x8c')](_0x44c3d1,[_0x6b01('0x34'),_0x1a0bb7[_0x6b01('0x34')]]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){_0x4dbd69[_0x8b2514['foreignKey']]=_['map'](_0x1a0bb7['associatedResources'],'id');}else{_0x4dbd69[_0x8b2514[_0x6b01('0x9e')]]=_0x1a0bb7[_0x6b01('0x7')];}_0xb133fc['push'](_0x4dbd69);}else{_0x4c84cc[_0x6b01('0x7f')]['id']=_0x1a0bb7[_0x6b01('0x7')];}}else{for(var _0x34c971=0x0;_0x34c971<_0x30171f[_0x6b01('0x90')];_0x34c971++){_0x8b2514=_['find'](_0x44c3d1,[_0x6b01('0x34'),_0x30171f[_0x34c971]['name']]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};_0x4dbd69[_0x8b2514['foreignKey']]=_0x30171f[_0x34c971][_0x6b01('0x7')];_0xb133fc['push'](_0x4dbd69);}else{if(!_0x4c84cc[_0x6b01('0x7f')]['id'])_0x4c84cc[_0x6b01('0x7f')]['id']=[];_0x30171f[_0x34c971][_0x6b01('0x7')][_0x6b01('0x9f')](function(_0x12b0d8){_0x4c84cc[_0x6b01('0x7f')]['id'][_0x6b01('0x8a')](_0x12b0d8);});}}}if(!_['isEmpty'](_0xb133fc)){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$and':{'$or':_0xb133fc}});}_0x4c84cc=_[_0x6b01('0xa0')]({},_0x4c84cc,_0x1dda2f[_0x6b01('0xa1')]);if(_0x1a0bb7&&!_0x1a0bb7[_0x6b01('0x91')]&&_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xa2')]){_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xe')](_0x4c84cc)['then'](function(_0x1e9300){var _0x4091a8=[];_0x1e9300[_0x6b01('0x9f')](function(_0x41c2a9){var _0x5ac0b6;switch(_0x41c2a9[_0x6b01('0xa4')]){case _0x6b01('0xa5'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x3c4424){return _0x3c4424['id']===_0x41c2a9['reportId']&&_0x3c4424[_0x6b01('0x11')]==='DefaultReports';});break;case _0x6b01('0xa6'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x7b8545){return _0x7b8545['id']===_0x41c2a9[_0x6b01('0x73')]&&_0x7b8545[_0x6b01('0x11')]===_0x6b01('0xa7');});break;}if(_0x5ac0b6)_0x4091a8[_0x6b01('0x8a')](_0x41c2a9);});_0x38ae38[_0x6b01('0xa8')]=_0x4091a8[_0x6b01('0x90')];_0x38ae38[_0x6b01('0xa9')]=_0x4091a8;return _0x38ae38;});}else{return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xa8')]({'where':_0x4c84cc[_0x6b01('0x7f')]})['then'](function(_0x2f180){_0x38ae38['count']=_0x2f180;if(_0x1dda2f['query'][_0x6b01('0xa2')]){if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xaa')){_0x4c84cc[_0x6b01('0xa3')]=[{'model':_0x160a7d['Tag'],'as':_0x6b01('0xab'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'required':_0x1dda2f['query'][_0x6b01('0xad')]?!![]:![]},{'model':_0x160a7d[_0x6b01('0x6a')],'as':_0x6b01('0xae'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'through':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?{'attributes':[],'where':{'TagId':_0x1dda2f[_0x6b01('0x82')]['tag']||undefined}}:{},'required':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?!![]:![]}];}else{_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]]['findAll'](_0x4c84cc);})['then'](function(_0x33fa1d){_0x38ae38[_0x6b01('0xa9')]=_0x33fa1d;if(_0x270128===_0x6b01('0x33')&&_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xaf')]===_0x6b01('0xb0')){var _0x1343af=[];for(var _0x29c507=0x0;_0x29c507<_0x38ae38['rows'][_0x6b01('0x90')];_0x29c507++){_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb1'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb3'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb4'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb5'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb6'),_0x38ae38[_0x6b01('0xa9')][_0x29c507]['dataValues']));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb7'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));}return Promise[_0x6b01('0x8d')](_0x1343af)['then'](function(){return _0x38ae38;});}return _0x38ae38;});}});}}});}; \ No newline at end of file +var _0xf2e3=['projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','extractedreports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','filters','pick','merge','foreignKey','forEach','options','includeAll','include','reportType','DefaultReports','custom','count','rows','CmContact','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','SquareProject','odbc','SquareOdbc','childModel','parentSections','SquareProjects','name','projectName'];(function(_0x22ccc0,_0x914457){var _0xe2af6a=function(_0x55aa01){while(--_0x55aa01){_0x22ccc0['push'](_0x22ccc0['shift']());}};_0xe2af6a(++_0x914457);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xf2e3[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x3f2e('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x3f2e('0x1'));var squel=require(_0x3f2e('0x2'));module[_0x3f2e('0x3')]=function(_0x30f1bb){var _0x27d28c=_0x30f1bb[_0x3f2e('0x4')];function _0x3938e2(_0xabcf5c,_0x216b26){return new Promise(function(_0x5f254a,_0x33a3b7){if(!_0x216b26)return _0x5f254a(null);var _0xdd6b3e=_0x216b26[_0x3f2e('0x5')]?{[_0x216b26[_0x3f2e('0x5')][_0x3f2e('0x6')]]:_0x216b26[_0x3f2e('0x5')][_0x3f2e('0x7')]}:undefined;return _0x27d28c[_0xabcf5c][_0x3f2e('0x8')]({'where':_0xdd6b3e,'raw':!![]})[_0x3f2e('0x9')](function(_0x29a6cc){_0x216b26[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x29a6cc,'id');_0x5f254a(_0x216b26);})[_0x3f2e('0xc')](function(_0x10a392){_0x33a3b7(_0x10a392);});});}function _0x1bb1dd(_0x305861,_0x824ee8){return new Promise(function(_0x475cd2,_0x39b819){var _0x5a4da3=_0x305861[_0x3f2e('0x5')]?{[_0x305861[_0x3f2e('0x5')]['field']]:_0x305861[_0x3f2e('0x5')][_0x3f2e('0x7')]}:undefined;return _0x27d28c[_0x305861[_0x3f2e('0xd')]][_0x3f2e('0x8')]({'where':_0x5a4da3,'raw':!![]})[_0x3f2e('0x9')](function(_0x57cba7){_0x824ee8[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x57cba7,function(_0x2d2fac){return _0x2d2fac['name'];});_0x475cd2(_0x824ee8);})[_0x3f2e('0xc')](function(_0x218b44){_0x39b819(_0x218b44);});});}function _0x17ef58(_0x2c4feb,_0x1dc5d0,_0x2fef73){if(!_0x1dc5d0)return Promise[_0x3f2e('0xe')](null);return new Promise(function(_0x155411,_0x178283){return _0x27d28c[_0x3f2e('0xf')][_0x3f2e('0x8')]({'where':{'sectionId':_0x1dc5d0['id']},'raw':!![]})['then'](function(_0x40e28f){if(_0x2c4feb[_0x3f2e('0x6')]&&_0x2c4feb[_0x3f2e('0x6')]!=='id'){_0x1dc5d0[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x40e28f,function(_0x4eb1e7){return _0x4eb1e7[_0x2c4feb['field']];});}else{if(_0x2fef73===_0x3f2e('0x10')){_0x1dc5d0[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x40e28f,function(_0x2ac500){return{'id':_0x2ac500[_0x3f2e('0x11')],'type':_0x2ac500[_0x3f2e('0x12')]};});}else{_0x1dc5d0['associatedResources']=_['map'](_0x40e28f,function(_0xf81165){return _0xf81165[_0x3f2e('0x11')];});}}_0x155411(_0x1dc5d0);})['catch'](function(_0x541292){_0x178283(_0x541292);});});}function _0x46bb1c(_0x5646f5,_0x1b8c67){var _0x401ed9={'parentSections':[]};switch(_0x5646f5['toLowerCase']()){case'squareprojects':_0x401ed9['childModel']=_0x3f2e('0x13');break;case _0x3f2e('0x14'):_0x401ed9['childModel']=_0x3f2e('0x15');break;case'squarerecordings':_0x401ed9[_0x3f2e('0x16')]='SquareRecording';_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x18'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x1a')}];break;case _0x3f2e('0x1b'):_0x401ed9['childModel']=_0x3f2e('0x1c');break;case _0x3f2e('0x1d'):_0x401ed9['childModel']='CmContact';_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x1e'),'field':'id','foreignKey':_0x3f2e('0x1f')}];break;case _0x3f2e('0x20'):_0x401ed9['childModel']=_0x3f2e('0x21');break;case _0x3f2e('0x22'):_0x401ed9[_0x3f2e('0x16')]='CmCompany';break;case _0x3f2e('0x23'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x24');break;case'chatqueues':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x25');break;case _0x3f2e('0x26'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x27');break;case _0x3f2e('0x28'):_0x401ed9['childModel']=_0x3f2e('0x29');break;case _0x3f2e('0x2a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x2b');break;case _0x3f2e('0x2c'):case _0x3f2e('0x2d'):case _0x3f2e('0x2e'):_0x401ed9['childModel']=_0x3f2e('0x2f');break;case _0x3f2e('0x30'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x31');break;case'voicemails':_0x401ed9['childModel']=_0x3f2e('0x32');break;case _0x3f2e('0x33'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x34');_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x35'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x36'),'model':_0x3f2e('0x37'),'filter':{'field':_0x3f2e('0x38'),'value':['agent']}},{'name':_0x3f2e('0x39'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x36'),'model':_0x3f2e('0x37'),'filter':{'field':'role','value':[_0x3f2e('0x3a')]}},{'name':_0x3f2e('0x3b'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x3c'),'model':_0x3f2e('0x3d'),'filter':{'field':_0x3f2e('0x12'),'value':[_0x3f2e('0x3e')]}},{'name':_0x3f2e('0x3f'),'field':'name','foreignKey':_0x3f2e('0x3c'),'model':_0x3f2e('0x3d'),'filter':{'field':_0x3f2e('0x12'),'value':[_0x3f2e('0x40')]}}];break;case'musiconholds':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x41');break;case'chanspies':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x42');break;case'voiceprefixes':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x43');break;case _0x3f2e('0x44'):_0x401ed9[_0x3f2e('0x16')]='Campaign';break;case _0x3f2e('0x45'):_0x401ed9[_0x3f2e('0x16')]='MailQueue';break;case'mailaccounts':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x46');break;case _0x3f2e('0x47'):_0x401ed9['childModel']=_0x3f2e('0x48');break;case _0x3f2e('0x49'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4a');break;case _0x3f2e('0x4b'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4c');break;case _0x3f2e('0x4d'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4e');break;case'smsaccounts':_0x401ed9['childModel']=_0x3f2e('0x4f');break;case _0x3f2e('0x50'):_0x401ed9['childModel']='WhatsappQueue';break;case _0x3f2e('0x51'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x52');break;case'teams':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x53');break;case _0x3f2e('0x54'):case'queuecampaigns':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x3d');if(_0x1b8c67){_0x401ed9[_0x3f2e('0x17')]=[{'name':'VoiceQueues'},{'name':_0x3f2e('0x3f')}];}break;case _0x3f2e('0x55'):case _0x3f2e('0x56'):case'telephones':_0x401ed9[_0x3f2e('0x16')]='User';if(_0x1b8c67){_0x401ed9[_0x3f2e('0x17')]=[{'name':'Users','filter':{'field':'role','value':[_0x3f2e('0x57'),_0x3f2e('0x58')]},'ignore':!![]},{'name':_0x3f2e('0x35')},{'name':_0x3f2e('0x39')}];}break;case _0x3f2e('0x59'):_0x401ed9['childModel']='ZendeskAccount';break;case _0x3f2e('0x5a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5b');break;case _0x3f2e('0x5c'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5d');break;case _0x3f2e('0x5e'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5f');break;case'deskaccounts':_0x401ed9['childModel']=_0x3f2e('0x60');break;case'zohoaccounts':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x61');break;case _0x3f2e('0x62'):_0x401ed9[_0x3f2e('0x16')]='User';break;case _0x3f2e('0x63'):_0x401ed9['childModel']=_0x3f2e('0x64');break;case _0x3f2e('0x65'):_0x401ed9['childModel']=_0x3f2e('0x66');break;case'customdashboards':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x67');break;case _0x3f2e('0x68'):_0x401ed9['childModel']=_0x3f2e('0x69');break;case _0x3f2e('0x6a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6b');break;case _0x3f2e('0x6c'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6d');break;case _0x3f2e('0x6e'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6f');break;case'tags':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x70');break;case _0x3f2e('0x71'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x72');break;case _0x3f2e('0x73'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x74');break;case'trunks':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x75');break;case _0x3f2e('0x76'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x77');break;case'plugins':_0x401ed9['childModel']=_0x3f2e('0x78');break;case _0x3f2e('0x79'):_0x401ed9[_0x3f2e('0x16')]='AnalyticExtractedReport';_0x401ed9['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x3f2e('0x7a')}];break;case _0x3f2e('0x7b'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x7c');break;}return _0x401ed9;}function _0x359197(_0x5689d6,_0x18cc5d){var _0xc3c853=_0x5689d6['charAt'](0x0)[_0x3f2e('0x7d')]()+_0x5689d6[_0x3f2e('0x7e')](0x1);var _0x3d05fe={'type':_0x27d28c[_0x3f2e('0x7f')]['QueryTypes'][_0x3f2e('0x80')],'raw':!![]};return new Promise(function(_0x5da1f3,_0x4dc239){var _0x793fbb=squel['select']()['field'](_0x3f2e('0x81')+_0xc3c853+'InteractionId','id')[_0x3f2e('0x6')](_0x3f2e('0x82'))[_0x3f2e('0x83')](_0x3f2e('0x84')+_0x5689d6+'_interactions','ui')[_0x3f2e('0x85')](_0x3f2e('0x86'),_0x18cc5d['id']);return _0x27d28c[_0x3f2e('0x87')][_0x3f2e('0x88')](_0x793fbb['toString'](),_0x3d05fe)[_0x3f2e('0x9')](function(_0x4858ee){_0x18cc5d[_0xc3c853+'OpenTabs']=_0x4858ee;_0x5da1f3(_0x4858ee);})[_0x3f2e('0xc')](function(_0x1d9f99){_0x4dc239(_0x1d9f99);});});}return _0x30f1bb['define']('UserProfile',attributes,{'tableName':_0x3f2e('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x27e810){var _0x32cd8e={'raw':![],'where':{}};var _0x487daf={};var _0x22b00a={'count':0x0,'rows':[]};var _0x311c62=_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x8a')];var _0x515895=_0x27e810[_0x3f2e('0x88')]['mergeResources']||![];var _0x457492=_0x46bb1c(_0x311c62,_0x515895);if(!_0x457492[_0x3f2e('0x16')])throw new Error(_0x3f2e('0x8b')+_0x311c62+'\x27');var _0x3c87ce=[{'name':_0x311c62}];if(!_[_0x3f2e('0x8c')](_0x457492[_0x3f2e('0x17')]))_0x3c87ce=_0x457492[_0x3f2e('0x17')];var _0x266f60=[];for(var _0x4f42be=0x0;_0x4f42be<_0x3c87ce[_0x3f2e('0x8d')];_0x4f42be++){_0x266f60['push'](_0x27d28c['UserProfileSection'][_0x3f2e('0x8e')]({'where':{'userProfileId':_0x27e810[_0x3f2e('0x8f')]['id'],'name':_0x3c87ce[_0x4f42be]['name']},'raw':!![]}));}return Promise[_0x3f2e('0x90')](_0x266f60)[_0x3f2e('0x9')](function(_0x58c6f2){var _0x4768f5=_['filter'](_0x58c6f2,function(_0x5577c0){return _0x5577c0?_0x5577c0:undefined;});var _0x2d26c3=_[_0x3f2e('0x5')](_0x3c87ce,[_0x3f2e('0x91'),!![]]);var _0x5d3db7=_['isEmpty'](_0x4768f5)&&_[_0x3f2e('0x8c')](_0x2d26c3)?null:_[_0x3f2e('0x92')](_0x2d26c3,_0x4768f5);if(!_0x5d3db7)return null;var _0x1ac6a3=[];for(var _0x2cf3b9=0x0;_0x2cf3b9<_0x5d3db7[_0x3f2e('0x8d')];_0x2cf3b9++){var _0x3a8983=_[_0x3f2e('0x8e')](_0x3c87ce,function(_0x224e1e){return _0x5d3db7[_0x2cf3b9]?_0x224e1e[_0x3f2e('0x19')]===_0x5d3db7[_0x2cf3b9][_0x3f2e('0x19')]:null;});if(_0x3a8983){if(_0x5d3db7[_0x2cf3b9][_0x3f2e('0x91')]){_0x1ac6a3[_0x3f2e('0x93')](_0x3938e2(_0x457492[_0x3f2e('0x16')],_0x5d3db7[_0x2cf3b9]));}else{if(!_0x5d3db7[_0x2cf3b9][_0x3f2e('0x94')]){_0x1ac6a3[_0x3f2e('0x93')](_0x17ef58(_0x3a8983,_0x5d3db7[_0x2cf3b9],_0x457492[_0x3f2e('0x16')]));}else{if(_0x3a8983[_0x3f2e('0xd')]){_0x1ac6a3[_0x3f2e('0x93')](_0x1bb1dd(_0x3a8983,_0x5d3db7[_0x2cf3b9]));}}}}}return Promise[_0x3f2e('0x90')](_0x1ac6a3);})[_0x3f2e('0x9')](function(_0x50b853){var _0xbef922=_0x50b853;var _0x1850b6=null;if(_0xbef922){_0x1850b6=_0xbef922[_0x3f2e('0x8d')]===0x1?_0xbef922[0x0]:null;}if(!_0x1850b6&&!_0xbef922)return _0x22b00a;var _0xd9ea7b=_0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x95')];_0x487daf[_0x3f2e('0xd')]=_[_0x3f2e('0x96')](_0xd9ea7b);_0x487daf[_0x3f2e('0x88')]=_['keys'](_0x27e810[_0x3f2e('0x88')]);_0x487daf['filters']=_[_0x3f2e('0x97')](_0x487daf[_0x3f2e('0xd')],_0x487daf['query']);_0x32cd8e[_0x3f2e('0x98')]=_[_0x3f2e('0x97')](_0x487daf['model'],qs[_0x3f2e('0x99')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x99')]));_0x32cd8e[_0x3f2e('0x98')]=_0x32cd8e[_0x3f2e('0x98')][_0x3f2e('0x8d')]?_0x32cd8e[_0x3f2e('0x98')]:_0x487daf[_0x3f2e('0xd')];if(!_0x27e810['query'][_0x3f2e('0x9a')]('nolimit')){_0x32cd8e[_0x3f2e('0x9b')]=qs[_0x3f2e('0x9b')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9b')]);_0x32cd8e[_0x3f2e('0x9c')]=qs[_0x3f2e('0x9c')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9c')]);}_0x32cd8e[_0x3f2e('0x9d')]=qs[_0x3f2e('0x9e')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9e')]);_0x32cd8e['where']=qs[_0x3f2e('0x9f')](_[_0x3f2e('0xa0')](_0x27e810[_0x3f2e('0x88')],_0x487daf[_0x3f2e('0x9f')]));if(_0x27e810[_0x3f2e('0x88')]['filter']){_0x32cd8e[_0x3f2e('0x85')]=_[_0x3f2e('0xa1')](_0x32cd8e['where'],{'$or':_[_0x3f2e('0xb')](_0xd9ea7b,function(_0x10ddb6){if(_0x10ddb6['type']['key']!=='VIRTUAL'){var _0x3dc17c={};_0x3dc17c[_0x10ddb6[_0x3f2e('0x6')]]={'$like':'%'+_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x5')]+'%'};return _0x3dc17c;}})});}var _0x236dcf=[];var _0x38d0cb=null;var _0x27c3af={};if(_0x1850b6){_0x38d0cb=_[_0x3f2e('0x8e')](_0x3c87ce,[_0x3f2e('0x19'),_0x1850b6['name']]);if(_0x38d0cb[_0x3f2e('0x6')]){_0x27c3af={};if(_0x457492['childModel']===_0x3f2e('0x10')){_0x27c3af[_0x38d0cb['foreignKey']]=_[_0x3f2e('0xb')](_0x1850b6[_0x3f2e('0xa')],'id');}else{_0x27c3af[_0x38d0cb['foreignKey']]=_0x1850b6[_0x3f2e('0xa')];}_0x236dcf[_0x3f2e('0x93')](_0x27c3af);}else{_0x32cd8e[_0x3f2e('0x85')]['id']=_0x1850b6[_0x3f2e('0xa')];}}else{for(var _0x50d5ca=0x0;_0x50d5ca<_0xbef922[_0x3f2e('0x8d')];_0x50d5ca++){_0x38d0cb=_['find'](_0x3c87ce,[_0x3f2e('0x19'),_0xbef922[_0x50d5ca][_0x3f2e('0x19')]]);if(_0x38d0cb[_0x3f2e('0x6')]){_0x27c3af={};_0x27c3af[_0x38d0cb[_0x3f2e('0xa2')]]=_0xbef922[_0x50d5ca][_0x3f2e('0xa')];_0x236dcf[_0x3f2e('0x93')](_0x27c3af);}else{if(!_0x32cd8e['where']['id'])_0x32cd8e[_0x3f2e('0x85')]['id']=[];_0xbef922[_0x50d5ca][_0x3f2e('0xa')][_0x3f2e('0xa3')](function(_0x13e5c3){_0x32cd8e[_0x3f2e('0x85')]['id'][_0x3f2e('0x93')](_0x13e5c3);});}}}if(!_[_0x3f2e('0x8c')](_0x236dcf)){_0x32cd8e['where']=_['merge'](_0x32cd8e['where'],{'$and':{'$or':_0x236dcf}});}_0x32cd8e=_['merge']({},_0x32cd8e,_0x27e810[_0x3f2e('0xa4')]);if(_0x1850b6&&!_0x1850b6['autoAssociation']&&_0x457492[_0x3f2e('0x16')]==='AnalyticExtractedReport'){if(_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xa5')]){_0x32cd8e[_0x3f2e('0xa6')]=[{'all':!![]}];}return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x8')](_0x32cd8e)[_0x3f2e('0x9')](function(_0x263160){var _0x5bd1cb=[];_0x263160[_0x3f2e('0xa3')](function(_0x850a9c){var _0x604478;switch(_0x850a9c[_0x3f2e('0xa7')]){case'default':_0x604478=_['find'](_0x1850b6[_0x3f2e('0xa')],function(_0x344afb){return _0x344afb['id']===_0x850a9c[_0x3f2e('0x7a')]&&_0x344afb['type']===_0x3f2e('0xa8');});break;case _0x3f2e('0xa9'):_0x604478=_['find'](_0x1850b6[_0x3f2e('0xa')],function(_0x14a919){return _0x14a919['id']===_0x850a9c[_0x3f2e('0x7a')]&&_0x14a919[_0x3f2e('0x12')]==='CustomReports';});break;}if(_0x604478)_0x5bd1cb[_0x3f2e('0x93')](_0x850a9c);});_0x22b00a[_0x3f2e('0xaa')]=_0x5bd1cb[_0x3f2e('0x8d')];_0x22b00a[_0x3f2e('0xab')]=_0x5bd1cb;return _0x22b00a;});}else{return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0xaa')]({'where':_0x32cd8e[_0x3f2e('0x85')]})[_0x3f2e('0x9')](function(_0x380407){_0x22b00a['count']=_0x380407;if(_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xa5')]){if(_0x457492[_0x3f2e('0x16')]===_0x3f2e('0xac')){_0x32cd8e[_0x3f2e('0xa6')]=[{'model':_0x27d28c[_0x3f2e('0x70')],'as':'Tags','attributes':['id',_0x3f2e('0x19'),_0x3f2e('0xad')],'required':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]?!![]:![]},{'model':_0x27d28c['Tag'],'as':_0x3f2e('0xaf'),'attributes':['id',_0x3f2e('0x19'),_0x3f2e('0xad')],'through':_0x27e810[_0x3f2e('0x88')]['tag']?{'attributes':[],'where':{'TagId':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]||undefined}}:{},'required':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]?!![]:![]}];}else{_0x32cd8e[_0x3f2e('0xa6')]=[{'all':!![]}];}}return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x8')](_0x32cd8e);})[_0x3f2e('0x9')](function(_0x5cb1f8){_0x22b00a['rows']=_0x5cb1f8;if(_0x311c62===_0x3f2e('0x35')&&_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xb0')]==='true'){var _0x511c6c=[];for(var _0x1d3945=0x0;_0x1d3945<_0x22b00a[_0x3f2e('0xab')][_0x3f2e('0x8d')];_0x1d3945++){_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb1'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c['push'](_0x359197(_0x3f2e('0xb3'),_0x22b00a['rows'][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb4'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));_0x511c6c['push'](_0x359197('mail',_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));_0x511c6c[_0x3f2e('0x93')](_0x359197('openchannel',_0x22b00a[_0x3f2e('0xab')][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb5'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));}return Promise[_0x3f2e('0x90')](_0x511c6c)[_0x3f2e('0x9')](function(){return _0x22b00a;});}return _0x22b00a;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 43387df..afb0452 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 _0x97ce=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x1eefef,_0x406aad){var _0x1df25d=function(_0x4a3b84){while(--_0x4a3b84){_0x1eefef['push'](_0x1eefef['shift']());}};_0x1df25d(++_0x406aad);}(_0x97ce,0x151));var _0xe97c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x97ce[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});config[_0xe97c('0xb')]=_['defaults'](config[_0xe97c('0xb')],{'host':_0xe97c('0xc'),'port':0x18eb});var socket=require(_0xe97c('0xd'))(new Redis(config['redis']));require(_0xe97c('0xe'))['register'](socket);function respondWithRpcPromise(_0x40ef69,_0x2e732d,_0xbe3b8a){return new BPromise(function(_0x23e6a2,_0x43e557){return client[_0xe97c('0xf')](_0x40ef69,_0xbe3b8a)[_0xe97c('0x10')](function(_0x5bb134){logger[_0xe97c('0x11')](_0xe97c('0x12'),_0x2e732d,_0xe97c('0x13'));logger[_0xe97c('0x14')](_0xe97c('0x15'),_0x2e732d,_0xe97c('0x13'),JSON[_0xe97c('0x16')](_0x5bb134));if(_0x5bb134[_0xe97c('0x17')]){if(_0x5bb134[_0xe97c('0x17')]['code']===0x1f4){logger['error'](_0xe97c('0x12'),_0x2e732d,_0x5bb134['error'][_0xe97c('0x18')]);return _0x43e557(_0x5bb134[_0xe97c('0x17')]['message']);}logger['error'](_0xe97c('0x12'),_0x2e732d,_0x5bb134[_0xe97c('0x17')][_0xe97c('0x18')]);return _0x23e6a2(_0x5bb134[_0xe97c('0x17')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x2e732d,_0xe97c('0x13'));_0x23e6a2(_0x5bb134[_0xe97c('0x19')][_0xe97c('0x18')]);}})['catch'](function(_0x3bdf2e){logger[_0xe97c('0x17')](_0xe97c('0x12'),_0x2e732d,_0x3bdf2e);_0x43e557(_0x3bdf2e);});});} \ No newline at end of file +var _0xea4e=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug'];(function(_0x1e8cf4,_0x28b06e){var _0x482715=function(_0x5d4fc8){while(--_0x5d4fc8){_0x1e8cf4['push'](_0x1e8cf4['shift']());}};_0x482715(++_0x28b06e);}(_0xea4e,0x10c));var _0xeea4=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0xea4e[_0xbc1a4b];return _0x108b87;};'use strict';var _=require(_0xeea4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeea4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeea4('0x2'))['db'];var utils=require(_0xeea4('0x3'));var logger=require('../../config/logger')(_0xeea4('0x4'));var config=require(_0xeea4('0x5'));var jayson=require(_0xeea4('0x6'));var client=jayson[_0xeea4('0x7')][_0xeea4('0x8')]({'port':0x232a});config[_0xeea4('0x9')]=_[_0xeea4('0xa')](config[_0xeea4('0x9')],{'host':_0xeea4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeea4('0x9')]));require('./userProfile.socket')[_0xeea4('0xc')](socket);function respondWithRpcPromise(_0x114d6e,_0x279b9,_0x367d41){return new BPromise(function(_0x16a077,_0x3f9846){return client[_0xeea4('0xd')](_0x114d6e,_0x367d41)[_0xeea4('0xe')](function(_0x48a0db){logger[_0xeea4('0xf')]('UserProfile,\x20%s,\x20%s',_0x279b9,_0xeea4('0x10'));logger[_0xeea4('0x11')](_0xeea4('0x12'),_0x279b9,_0xeea4('0x10'),JSON[_0xeea4('0x13')](_0x48a0db));if(_0x48a0db[_0xeea4('0x14')]){if(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x15')]===0x1f4){logger['error'](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')]['message']);return _0x3f9846(_0x48a0db[_0xeea4('0x14')]['message']);}logger[_0xeea4('0x14')](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);return _0x16a077(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);}else{logger[_0xeea4('0xf')](_0xeea4('0x16'),_0x279b9,_0xeea4('0x10'));_0x16a077(_0x48a0db[_0xeea4('0x18')]['message']);}})[_0xeea4('0x19')](function(_0x8e29fb){logger['error'](_0xeea4('0x16'),_0x279b9,_0x8e29fb);_0x3f9846(_0x8e29fb);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5622019..c442218 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 _0xbaba=['remove','emit','register','length','userProfile:','save'];(function(_0x55d9b2,_0x1c4d7e){var _0x18c0cb=function(_0xfbba85){while(--_0xfbba85){_0x55d9b2['push'](_0x55d9b2['shift']());}};_0x18c0cb(++_0x1c4d7e);}(_0xbaba,0xb9));var _0xabab=function(_0x3101b8,_0x599336){_0x3101b8=_0x3101b8-0x0;var _0x4f2aa3=_0xbaba[_0x3101b8];return _0x4f2aa3;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xabab('0x0'),_0xabab('0x1'),'update'];function createListener(_0x472ad2,_0x4bd800){return function(_0x27f67b){_0x4bd800[_0xabab('0x2')](_0x472ad2,_0x27f67b);};}function removeListener(_0x377804,_0x501353){return function(){UserProfileEvents['removeListener'](_0x377804,_0x501353);};}exports[_0xabab('0x3')]=function(_0x135c13){for(var _0x26664e=0x0,_0x11326c=events[_0xabab('0x4')];_0x26664e<_0x11326c;_0x26664e++){var _0xd1299b=events[_0x26664e];var _0x10084c=createListener(_0xabab('0x5')+_0xd1299b,_0x135c13);UserProfileEvents['on'](_0xd1299b,_0x10084c);}}; \ No newline at end of file +var _0x905c=['emit','removeListener','length','save','remove','update'];(function(_0x5291de,_0xff5375){var _0x1a4cf2=function(_0x4901f1){while(--_0x4901f1){_0x5291de['push'](_0x5291de['shift']());}};_0x1a4cf2(++_0xff5375);}(_0x905c,0x10b));var _0xc905=function(_0x26b216,_0x15aa59){_0x26b216=_0x26b216-0x0;var _0x1169db=_0x905c[_0x26b216];return _0x1169db;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc905('0x0'),_0xc905('0x1'),_0xc905('0x2')];function createListener(_0x23fa39,_0x47b820){return function(_0x5ce6f1){_0x47b820[_0xc905('0x3')](_0x23fa39,_0x5ce6f1);};}function removeListener(_0x50663f,_0x1ac47d){return function(){UserProfileEvents[_0xc905('0x4')](_0x50663f,_0x1ac47d);};}exports['register']=function(_0x197f6c){for(var _0x18ed90=0x0,_0x8a9dc0=events[_0xc905('0x5')];_0x18ed90<_0x8a9dc0;_0x18ed90++){var _0x1402c9=events[_0x18ed90];var _0x3dffbc=createListener('userProfile:'+_0x1402c9,_0x197f6c);UserProfileEvents['on'](_0x1402c9,_0x3dffbc);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index dcf2075..1bdb976 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 _0xd877=['express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3520ab,_0x2c3d27){var _0x3ce66e=function(_0x5936e7){while(--_0x5936e7){_0x3520ab['push'](_0x3520ab['shift']());}};_0x3ce66e(++_0x2c3d27);}(_0xd877,0x1d7));var _0x7d87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd877[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x7d87('0x0'));var util=require(_0x7d87('0x1'));var path=require(_0x7d87('0x2'));var timeout=require(_0x7d87('0x3'));var express=require(_0x7d87('0x4'));var router=express[_0x7d87('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d87('0x6'));var controller=require('./userProfileResource.controller');router[_0x7d87('0x7')]('/',auth[_0x7d87('0x8')](),controller[_0x7d87('0x9')]);router['get'](_0x7d87('0xa'),auth[_0x7d87('0x8')](),controller['describe']);router['get'](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller['show']);router[_0x7d87('0xc')]('/',auth[_0x7d87('0x8')](),controller[_0x7d87('0xd')]);router[_0x7d87('0xe')](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller[_0x7d87('0xf')]);router[_0x7d87('0x10')](_0x7d87('0xb'),auth[_0x7d87('0x8')](),controller[_0x7d87('0x11')]);module[_0x7d87('0x12')]=router; \ No newline at end of file +var _0x8f7c=['destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete'];(function(_0x32fbee,_0x73466b){var _0x9dc2ae=function(_0x3897eb){while(--_0x3897eb){_0x32fbee['push'](_0x32fbee['shift']());}};_0x9dc2ae(++_0x73466b);}(_0x8f7c,0x133));var _0xc8f7=function(_0x54845b,_0x268e19){_0x54845b=_0x54845b-0x0;var _0x4713a2=_0x8f7c[_0x54845b];return _0x4713a2;};'use strict';var multer=require(_0xc8f7('0x0'));var util=require(_0xc8f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc8f7('0x2'));var router=express['Router']();var fs_extra=require(_0xc8f7('0x3'));var auth=require(_0xc8f7('0x4'));var interaction=require(_0xc8f7('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xc8f7('0x6')]('/',auth['isAuthenticated'](),controller[_0xc8f7('0x7')]);router[_0xc8f7('0x6')](_0xc8f7('0x8'),auth[_0xc8f7('0x9')](),controller[_0xc8f7('0xa')]);router[_0xc8f7('0x6')](_0xc8f7('0xb'),auth['isAuthenticated'](),controller[_0xc8f7('0xc')]);router[_0xc8f7('0xd')]('/',auth[_0xc8f7('0x9')](),controller[_0xc8f7('0xe')]);router['put']('/:id',auth[_0xc8f7('0x9')](),controller[_0xc8f7('0xf')]);router[_0xc8f7('0x10')](_0xc8f7('0xb'),auth[_0xc8f7('0x9')](),controller[_0xc8f7('0x11')]);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 1049365..e96ae55 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 _0x2795=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2795,0x181));var _0x5279=function(_0x33af41,_0x1b3a30){_0x33af41=_0x33af41-0x0;var _0x5dcc8d=_0x2795[_0x33af41];return _0x5dcc8d;};'use strict';var Sequelize=require('sequelize');module[_0x5279('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x5279('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xacec=['exports','INTEGER','STRING','sequelize'];(function(_0x37df62,_0x4eaa4c){var _0x5a74cf=function(_0x563d55){while(--_0x563d55){_0x37df62['push'](_0x37df62['shift']());}};_0x5a74cf(++_0x4eaa4c);}(_0xacec,0x1eb));var _0xcace=function(_0x50ce0c,_0x541b68){_0x50ce0c=_0x50ce0c-0x0;var _0x3c988c=_0xacec[_0x50ce0c];return _0x3c988c;};'use strict';var Sequelize=require(_0xcace('0x0'));module[_0xcace('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcace('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcace('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c6525b4..f9e9f0d 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 _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x4dadd0,_0xd02549){var _0x3daaac=function(_0x58347d){while(--_0x58347d){_0x4dadd0['push'](_0x4dadd0['shift']());}};_0x3daaac(++_0xd02549);}(_0x7880,0x1f4));var _0x0788=function(_0x5758c9,_0x3e7929){_0x5758c9=_0x5758c9-0x0;var _0x46892f=_0x7880[_0x5758c9];return _0x46892f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file +var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9536,0x179));var _0x6953=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x9536[_0x5bd426];return _0x23a7eb;};'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['UserProfileResource'][_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['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index bcd8e04..45d31bc 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 _0x497d=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x441bbb,_0x1e4865){var _0x28b70c=function(_0x1c45ab){while(--_0x1c45ab){_0x441bbb['push'](_0x441bbb['shift']());}};_0x28b70c(++_0x1e4865);}(_0x497d,0x1e0));var _0xd497=function(_0x5beca8,_0xb41c0){_0x5beca8=_0x5beca8-0x0;var _0x125989=_0x497d[_0x5beca8];return _0x125989;};'use strict';var _=require(_0xd497('0x0'));var util=require('util');var logger=require(_0xd497('0x1'))(_0xd497('0x2'));var moment=require('moment');var BPromise=require(_0xd497('0x3'));var rp=require(_0xd497('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd497('0x5'));var config=require('../../config/environment');var attributes=require(_0xd497('0x6'));module['exports']=function(_0x1f3151,_0x256652){return _0x1f3151[_0xd497('0x7')]('UserProfileResource',attributes,{'tableName':_0xd497('0x8'),'paranoid':![],'indexes':[{'name':_0xd497('0x9'),'fields':[_0xd497('0xa'),_0xd497('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x96b6=['./userProfileResource.attributes','UserProfileResource','resourceId','lodash','../../config/logger','api','moment','request-promise'];(function(_0x452ebb,_0x35ef27){var _0x5125c0=function(_0x388d07){while(--_0x388d07){_0x452ebb['push'](_0x452ebb['shift']());}};_0x5125c0(++_0x35ef27);}(_0x96b6,0x1cb));var _0x696b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x96b6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x696b('0x0'));var util=require('util');var logger=require(_0x696b('0x1'))(_0x696b('0x2'));var moment=require(_0x696b('0x3'));var BPromise=require('bluebird');var rp=require(_0x696b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x696b('0x5'));module['exports']=function(_0x2d425e,_0x4698b4){return _0x2d425e['define'](_0x696b('0x6'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x696b('0x7'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e636844..c9ef8e7 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 _0x14d0=['catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x14d0,0x127));var _0x014d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x14d0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x014d('0x0'));var util=require(_0x014d('0x1'));var moment=require(_0x014d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x014d('0x3'))['db'];var utils=require(_0x014d('0x4'));var logger=require(_0x014d('0x5'))('rpc');var config=require(_0x014d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x014d('0x7')][_0x014d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19fc90,_0x5ddde7,_0x5aecf7){return new BPromise(function(_0x3df439,_0x948a6d){return client[_0x014d('0x9')](_0x19fc90,_0x5aecf7)[_0x014d('0xa')](function(_0x5a9b6c){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x014d('0xb'));logger[_0x014d('0xc')](_0x014d('0xd'),_0x5ddde7,_0x014d('0xb'),JSON[_0x014d('0xe')](_0x5a9b6c));if(_0x5a9b6c[_0x014d('0xf')]){if(_0x5a9b6c[_0x014d('0xf')][_0x014d('0x10')]===0x1f4){logger[_0x014d('0xf')](_0x014d('0x11'),_0x5ddde7,_0x5a9b6c[_0x014d('0xf')][_0x014d('0x12')]);return _0x948a6d(_0x5a9b6c[_0x014d('0xf')][_0x014d('0x12')]);}logger[_0x014d('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x5a9b6c[_0x014d('0xf')]['message']);return _0x3df439(_0x5a9b6c['error'][_0x014d('0x12')]);}else{logger['info'](_0x014d('0x11'),_0x5ddde7,_0x014d('0xb'));_0x3df439(_0x5a9b6c[_0x014d('0x13')][_0x014d('0x12')]);}})[_0x014d('0x14')](function(_0x42a664){logger[_0x014d('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5ddde7,_0x42a664);_0x948a6d(_0x42a664);});});} \ No newline at end of file +var _0xa4fd=['jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1aa19f,_0x33d195){var _0x32fb0c=function(_0x4762a8){while(--_0x4762a8){_0x1aa19f['push'](_0x1aa19f['shift']());}};_0x32fb0c(++_0x33d195);}(_0xa4fd,0x142));var _0xda4f=function(_0x25eb38,_0x33e24b){_0x25eb38=_0x25eb38-0x0;var _0x5744ad=_0xa4fd[_0x25eb38];return _0x5744ad;};'use strict';var _=require(_0xda4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda4f('0x1'));var rs=require(_0xda4f('0x2'));var fs=require('fs');var Redis=require(_0xda4f('0x3'));var db=require(_0xda4f('0x4'))['db'];var utils=require(_0xda4f('0x5'));var logger=require(_0xda4f('0x6'))(_0xda4f('0x7'));var config=require('../../config/environment');var jayson=require(_0xda4f('0x8'));var client=jayson['client'][_0xda4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d1d4c,_0x3110de,_0x4cad26){return new BPromise(function(_0x1f83a9,_0xe4f59b){return client[_0xda4f('0xa')](_0x5d1d4c,_0x4cad26)[_0xda4f('0xb')](function(_0x37189c){logger[_0xda4f('0xc')](_0xda4f('0xd'),_0x3110de,_0xda4f('0xe'));logger[_0xda4f('0xf')](_0xda4f('0x10'),_0x3110de,_0xda4f('0xe'),JSON['stringify'](_0x37189c));if(_0x37189c[_0xda4f('0x11')]){if(_0x37189c[_0xda4f('0x11')][_0xda4f('0x12')]===0x1f4){logger[_0xda4f('0x11')](_0xda4f('0xd'),_0x3110de,_0x37189c[_0xda4f('0x11')][_0xda4f('0x13')]);return _0xe4f59b(_0x37189c['error'][_0xda4f('0x13')]);}logger['error'](_0xda4f('0xd'),_0x3110de,_0x37189c[_0xda4f('0x11')][_0xda4f('0x13')]);return _0x1f83a9(_0x37189c['error']['message']);}else{logger[_0xda4f('0xc')](_0xda4f('0xd'),_0x3110de,_0xda4f('0xe'));_0x1f83a9(_0x37189c[_0xda4f('0x14')][_0xda4f('0x13')]);}})[_0xda4f('0x15')](function(_0x4369d3){logger[_0xda4f('0x11')](_0xda4f('0xd'),_0x3110de,_0x4369d3);_0xe4f59b(_0x4369d3);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 46c4581..7f0c1f0 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 _0x06f9=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x4997f8,_0x4a999e){var _0x229f51=function(_0x2a6085){while(--_0x2a6085){_0x4997f8['push'](_0x4997f8['shift']());}};_0x229f51(++_0x4a999e);}(_0x06f9,0x176));var _0x906f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x06f9[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require(_0x906f('0x0'));var path=require(_0x906f('0x1'));var timeout=require(_0x906f('0x2'));var express=require(_0x906f('0x3'));var router=express[_0x906f('0x4')]();var fs_extra=require(_0x906f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x906f('0x6'));var config=require(_0x906f('0x7'));var controller=require('./userProfileSection.controller');router[_0x906f('0x8')]('/',auth[_0x906f('0x9')](),controller[_0x906f('0xa')]);router[_0x906f('0x8')](_0x906f('0xb'),auth[_0x906f('0x9')](),controller[_0x906f('0xc')]);router[_0x906f('0x8')](_0x906f('0xd'),auth['isAuthenticated'](),controller[_0x906f('0xe')]);router[_0x906f('0xf')]('/',auth[_0x906f('0x9')](),controller[_0x906f('0x10')]);router[_0x906f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x906f('0x12')]);router['delete'](_0x906f('0xd'),auth['isAuthenticated'](),controller[_0x906f('0x13')]);module[_0x906f('0x14')]=router; \ No newline at end of file +var _0xf454=['./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x5da7da,_0x4eb2ee){var _0x4d06dd=function(_0x14bab0){while(--_0x14bab0){_0x5da7da['push'](_0x5da7da['shift']());}};_0x4d06dd(++_0x4eb2ee);}(_0xf454,0x176));var _0x4f45=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf454[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4f45('0x0'));var util=require(_0x4f45('0x1'));var path=require(_0x4f45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f45('0x3')]();var fs_extra=require(_0x4f45('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4f45('0x5'));var config=require('../../config/environment');var controller=require(_0x4f45('0x6'));router['get']('/',auth[_0x4f45('0x7')](),controller[_0x4f45('0x8')]);router[_0x4f45('0x9')](_0x4f45('0xa'),auth['isAuthenticated'](),controller[_0x4f45('0xb')]);router[_0x4f45('0x9')](_0x4f45('0xc'),auth[_0x4f45('0x7')](),controller['show']);router[_0x4f45('0xd')]('/',auth[_0x4f45('0x7')](),controller[_0x4f45('0xe')]);router[_0x4f45('0xf')](_0x4f45('0xc'),auth['isAuthenticated'](),controller[_0x4f45('0x10')]);router[_0x4f45('0x11')]('/:id',auth[_0x4f45('0x7')](),controller[_0x4f45('0x12')]);module[_0x4f45('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f2e2069..4ee7bbb 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 _0x84a0=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x84a0,0x66));var _0x084a=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0x84a0[_0x1cd65a];return _0xf93849;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x58a814){this[_0x084a('0x4')](_0x084a('0x5'),_0x58a814?_0x58a814['join'](''):[]);},'get':function(){return this[_0x084a('0x6')](_0x084a('0x5'))?this[_0x084a('0x6')](_0x084a('0x5'))[_0x084a('0x7')](''):[];}}}; \ No newline at end of file +var _0xc900=['join','getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xc900,0xb3));var _0x0c90=function(_0x567778,_0x4bc0f9){_0x567778=_0x567778-0x0;var _0xc67b11=_0xc900[_0x567778];return _0xc67b11;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0c90('0x1')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0c90('0x0')],'set':function(_0x492f22){this[_0x0c90('0x3')](_0x0c90('0x4'),_0x492f22?_0x492f22[_0x0c90('0x5')](''):[]);},'get':function(){return this[_0x0c90('0x6')](_0x0c90('0x4'))?this[_0x0c90('0x6')]('crudPermissions')[_0x0c90('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 745f155..62c27bc 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 _0x6136=['UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index'];(function(_0x55c16d,_0x5dca6a){var _0x58f6c2=function(_0x25616e){while(--_0x25616e){_0x55c16d['push'](_0x55c16d['shift']());}};_0x58f6c2(++_0x5dca6a);}(_0x6136,0x131));var _0x6613=function(_0x26c3e3,_0x345e3d){_0x26c3e3=_0x26c3e3-0x0;var _0x4b5782=_0x6136[_0x26c3e3];return _0x4b5782;};'use strict';var emlformat=require(_0x6613('0x0'));var rimraf=require(_0x6613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6613('0x2'));var rp=require('request-promise');var moment=require(_0x6613('0x3'));var BPromise=require(_0x6613('0x4'));var Mustache=require(_0x6613('0x5'));var util=require('util');var path=require(_0x6613('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6613('0x7'));var _=require(_0x6613('0x8'));var squel=require(_0x6613('0x9'));var crypto=require('crypto');var jsforce=require(_0x6613('0xa'));var deskjs=require(_0x6613('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6613('0xc'));var Papa=require(_0x6613('0xd'));var Redis=require(_0x6613('0xe'));var authService=require(_0x6613('0xf'));var qs=require(_0x6613('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6613('0x11'))('api');var utils=require(_0x6613('0x12'));var config=require(_0x6613('0x13'));var licenseUtil=require(_0x6613('0x14'));var db=require(_0x6613('0x15'))['db'];function respondWithStatusCode(_0x5e1aa7,_0x5302bd){_0x5302bd=_0x5302bd||0xcc;return function(_0x2d98f3){if(_0x2d98f3){return _0x5e1aa7[_0x6613('0x16')](_0x5302bd);}return _0x5e1aa7[_0x6613('0x17')](_0x5302bd)['end']();};}function respondWithResult(_0xf3eb50,_0x1f8626){_0x1f8626=_0x1f8626||0xc8;return function(_0x4fefca){if(_0x4fefca){return _0xf3eb50[_0x6613('0x17')](_0x1f8626)['json'](_0x4fefca);}};}function respondWithFilteredResult(_0x357c03,_0x283e48){return function(_0x597186){if(_0x597186){var _0x5a9149=typeof _0x283e48[_0x6613('0x18')]==='undefined'&&typeof _0x283e48[_0x6613('0x19')]===_0x6613('0x1a');var _0x329eb4=_0x597186[_0x6613('0x1b')];var _0x5ee220=_0x5a9149?0x0:_0x283e48[_0x6613('0x18')];var _0x16b251=_0x5a9149?_0x597186['count']:_0x283e48[_0x6613('0x18')]+_0x283e48[_0x6613('0x19')];var _0x4cca44;if(_0x16b251>=_0x329eb4){_0x16b251=_0x329eb4;_0x4cca44=0xc8;}else{_0x4cca44=0xce;}_0x357c03[_0x6613('0x17')](_0x4cca44);return _0x357c03['set'](_0x6613('0x1c'),_0x5ee220+'-'+_0x16b251+'/'+_0x329eb4)['json'](_0x597186);}return null;};}function patchUpdates(_0x33b0cd){return function(_0x343cab){try{jsonpatch[_0x6613('0x1d')](_0x343cab,_0x33b0cd,!![]);}catch(_0x3d8d04){return BPromise[_0x6613('0x1e')](_0x3d8d04);}return _0x343cab['save']();};}function saveUpdates(_0x51de8c,_0x241668){return function(_0x2db5c1){if(_0x2db5c1){return _0x2db5c1[_0x6613('0x1f')](_0x51de8c)['then'](function(_0x1ceac4){return _0x1ceac4;});}return null;};}function removeEntity(_0x17e03e,_0x5bade6){return function(_0x181147){if(_0x181147){return _0x181147[_0x6613('0x20')]()[_0x6613('0x21')](function(){_0x17e03e['status'](0xcc)[_0x6613('0x22')]();});}};}function handleEntityNotFound(_0xad243e,_0x5d3e22){return function(_0x5cb6be){if(!_0x5cb6be){_0xad243e['sendStatus'](0x194);}return _0x5cb6be;};}function handleError(_0x51d8e2,_0x4c5e10){_0x4c5e10=_0x4c5e10||0x1f4;return function(_0x40f5de){logger[_0x6613('0x23')](_0x40f5de[_0x6613('0x24')]);if(_0x40f5de[_0x6613('0x25')]){delete _0x40f5de['name'];}_0x51d8e2[_0x6613('0x17')](_0x4c5e10)[_0x6613('0x26')](_0x40f5de);};}exports[_0x6613('0x27')]=function(_0x355c85,_0xe2b32c){var _0x12e192={},_0x5ed440={},_0x348293={'count':0x0,'rows':[]};var _0x986292=_['map'](db[_0x6613('0x28')]['rawAttributes'],function(_0x213405){return{'name':_0x213405[_0x6613('0x29')],'type':_0x213405[_0x6613('0x2a')][_0x6613('0x2b')]};});_0x5ed440[_0x6613('0x2c')]=_['map'](_0x986292,'name');_0x5ed440[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x355c85[_0x6613('0x2d')]);_0x5ed440[_0x6613('0x2f')]=_['intersection'](_0x5ed440[_0x6613('0x2c')],_0x5ed440[_0x6613('0x2d')]);_0x12e192[_0x6613('0x30')]=_[_0x6613('0x31')](_0x5ed440[_0x6613('0x2c')],qs[_0x6613('0x32')](_0x355c85[_0x6613('0x2d')]['fields']));_0x12e192[_0x6613('0x30')]=_0x12e192[_0x6613('0x30')][_0x6613('0x33')]?_0x12e192[_0x6613('0x30')]:_0x5ed440[_0x6613('0x2c')];if(!_0x355c85[_0x6613('0x2d')]['hasOwnProperty'](_0x6613('0x34'))){_0x12e192['limit']=qs[_0x6613('0x19')](_0x355c85['query'][_0x6613('0x19')]);_0x12e192[_0x6613('0x18')]=qs[_0x6613('0x18')](_0x355c85[_0x6613('0x2d')][_0x6613('0x18')]);}_0x12e192['order']=qs['sort'](_0x355c85[_0x6613('0x2d')][_0x6613('0x35')]);_0x12e192['where']=qs[_0x6613('0x2f')](_[_0x6613('0x36')](_0x355c85[_0x6613('0x2d')],_0x5ed440[_0x6613('0x2f')]),_0x986292);if(_0x355c85[_0x6613('0x2d')]['filter']){_0x12e192[_0x6613('0x37')]=_[_0x6613('0x38')](_0x12e192[_0x6613('0x37')],{'$or':_['map'](_0x986292,function(_0x100169){if(_0x100169[_0x6613('0x2a')]!=='VIRTUAL'){var _0x569a0e={};_0x569a0e[_0x100169[_0x6613('0x25')]]={'$like':'%'+_0x355c85[_0x6613('0x2d')]['filter']+'%'};return _0x569a0e;}})});}_0x12e192=_[_0x6613('0x38')]({},_0x12e192,_0x355c85[_0x6613('0x39')]);var _0xf4d246={'where':_0x12e192[_0x6613('0x37')]};return db[_0x6613('0x28')][_0x6613('0x1b')](_0xf4d246)[_0x6613('0x21')](function(_0x1b548a){_0x348293[_0x6613('0x1b')]=_0x1b548a;if(_0x355c85[_0x6613('0x2d')][_0x6613('0x3a')]){_0x12e192[_0x6613('0x3b')]=[{'all':!![]}];}return db['UserProfileSection'][_0x6613('0x3c')](_0x12e192);})['then'](function(_0x4c0550){_0x348293[_0x6613('0x3d')]=_0x4c0550;return _0x348293;})[_0x6613('0x21')](respondWithFilteredResult(_0xe2b32c,_0x12e192))[_0x6613('0x3e')](handleError(_0xe2b32c,null));};exports[_0x6613('0x3f')]=function(_0x17cdf0,_0x3fa9dd){var _0x42c5bd={'raw':![],'where':{'id':_0x17cdf0[_0x6613('0x40')]['id']}},_0x32f811={};_0x32f811[_0x6613('0x2c')]=_[_0x6613('0x2e')](db[_0x6613('0x28')]['rawAttributes']);_0x32f811[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x17cdf0[_0x6613('0x2d')]);_0x32f811[_0x6613('0x2f')]=_[_0x6613('0x31')](_0x32f811[_0x6613('0x2c')],_0x32f811['query']);_0x42c5bd[_0x6613('0x30')]=_[_0x6613('0x31')](_0x32f811[_0x6613('0x2c')],qs[_0x6613('0x32')](_0x17cdf0[_0x6613('0x2d')][_0x6613('0x32')]));_0x42c5bd[_0x6613('0x30')]=_0x42c5bd['attributes'][_0x6613('0x33')]?_0x42c5bd[_0x6613('0x30')]:_0x32f811[_0x6613('0x2c')];if(_0x17cdf0['query'][_0x6613('0x3a')]){_0x42c5bd[_0x6613('0x3b')]=[{'all':!![]}];}_0x42c5bd=_[_0x6613('0x38')]({},_0x42c5bd,_0x17cdf0[_0x6613('0x39')]);return db[_0x6613('0x28')]['find'](_0x42c5bd)[_0x6613('0x21')](handleEntityNotFound(_0x3fa9dd,null))[_0x6613('0x21')](respondWithResult(_0x3fa9dd,null))[_0x6613('0x3e')](handleError(_0x3fa9dd,null));};exports[_0x6613('0x41')]=function(_0x285f7f,_0x4a5742){return db[_0x6613('0x28')]['create'](_0x285f7f['body'],{})['then'](respondWithResult(_0x4a5742,0xc9))['catch'](handleError(_0x4a5742,null));};exports[_0x6613('0x1f')]=function(_0x2b5d3f,_0x32fa4b){if(_0x2b5d3f[_0x6613('0x42')]['id']){delete _0x2b5d3f[_0x6613('0x42')]['id'];}return db[_0x6613('0x28')][_0x6613('0x43')]({'where':{'id':_0x2b5d3f[_0x6613('0x40')]['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x32fa4b,null))[_0x6613('0x21')](saveUpdates(_0x2b5d3f[_0x6613('0x42')],null))[_0x6613('0x21')](respondWithResult(_0x32fa4b,null))[_0x6613('0x3e')](handleError(_0x32fa4b,null));};exports[_0x6613('0x20')]=function(_0x1e9536,_0x21b25f){return db[_0x6613('0x28')][_0x6613('0x43')]({'where':{'id':_0x1e9536[_0x6613('0x40')]['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x21b25f,null))[_0x6613('0x21')](removeEntity(_0x21b25f,null))[_0x6613('0x3e')](handleError(_0x21b25f,null));};exports[_0x6613('0x44')]=function(_0x1f93d2,_0x56a507){return db[_0x6613('0x28')]['describe']()['then'](respondWithResult(_0x56a507,null))[_0x6613('0x3e')](handleError(_0x56a507,null));}; \ No newline at end of file +var _0xeae8=['type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','stack','name','index','map','UserProfileSection','fieldName'];(function(_0x593b08,_0x54fba7){var _0x13cdc1=function(_0x4aa8a4){while(--_0x4aa8a4){_0x593b08['push'](_0x593b08['shift']());}};_0x13cdc1(++_0x54fba7);}(_0xeae8,0x1c4));var _0x8eae=function(_0x24f649,_0x407bbc){_0x24f649=_0x24f649-0x0;var _0x3cf4f6=_0xeae8[_0x24f649];return _0x3cf4f6;};'use strict';var emlformat=require(_0x8eae('0x0'));var rimraf=require(_0x8eae('0x1'));var zipdir=require(_0x8eae('0x2'));var jsonpatch=require(_0x8eae('0x3'));var rp=require('request-promise');var moment=require(_0x8eae('0x4'));var BPromise=require(_0x8eae('0x5'));var Mustache=require(_0x8eae('0x6'));var util=require(_0x8eae('0x7'));var path=require(_0x8eae('0x8'));var sox=require('sox');var csv=require(_0x8eae('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8eae('0xa'));var crypto=require('crypto');var jsforce=require(_0x8eae('0xb'));var deskjs=require(_0x8eae('0xc'));var toCsv=require(_0x8eae('0x9'));var querystring=require(_0x8eae('0xd'));var Papa=require(_0x8eae('0xe'));var Redis=require(_0x8eae('0xf'));var authService=require(_0x8eae('0x10'));var qs=require(_0x8eae('0x11'));var as=require(_0x8eae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eae('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8eae('0x14'));var licenseUtil=require(_0x8eae('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x173bd7,_0x2245d7){_0x2245d7=_0x2245d7||0xcc;return function(_0x3f0884){if(_0x3f0884){return _0x173bd7[_0x8eae('0x16')](_0x2245d7);}return _0x173bd7[_0x8eae('0x17')](_0x2245d7)[_0x8eae('0x18')]();};}function respondWithResult(_0x44a801,_0x5c3258){_0x5c3258=_0x5c3258||0xc8;return function(_0x28b4d9){if(_0x28b4d9){return _0x44a801[_0x8eae('0x17')](_0x5c3258)[_0x8eae('0x19')](_0x28b4d9);}};}function respondWithFilteredResult(_0x3bbf6a,_0x4ff6e6){return function(_0x31c014){if(_0x31c014){var _0x171ba3=typeof _0x4ff6e6[_0x8eae('0x1a')]==='undefined'&&typeof _0x4ff6e6['limit']===_0x8eae('0x1b');var _0x3d78e9=_0x31c014[_0x8eae('0x1c')];var _0x577b8e=_0x171ba3?0x0:_0x4ff6e6[_0x8eae('0x1a')];var _0x1fb039=_0x171ba3?_0x31c014[_0x8eae('0x1c')]:_0x4ff6e6[_0x8eae('0x1a')]+_0x4ff6e6['limit'];var _0x5c2e86;if(_0x1fb039>=_0x3d78e9){_0x1fb039=_0x3d78e9;_0x5c2e86=0xc8;}else{_0x5c2e86=0xce;}_0x3bbf6a[_0x8eae('0x17')](_0x5c2e86);return _0x3bbf6a['set'](_0x8eae('0x1d'),_0x577b8e+'-'+_0x1fb039+'/'+_0x3d78e9)[_0x8eae('0x19')](_0x31c014);}return null;};}function patchUpdates(_0x3fe0d4){return function(_0x5793d7){try{jsonpatch[_0x8eae('0x1e')](_0x5793d7,_0x3fe0d4,!![]);}catch(_0x6188d7){return BPromise['reject'](_0x6188d7);}return _0x5793d7[_0x8eae('0x1f')]();};}function saveUpdates(_0x22b0a3,_0x5549e6){return function(_0x2ba88a){if(_0x2ba88a){return _0x2ba88a['update'](_0x22b0a3)['then'](function(_0xb0c198){return _0xb0c198;});}return null;};}function removeEntity(_0x157eb1,_0x207818){return function(_0x1cb575){if(_0x1cb575){return _0x1cb575['destroy']()['then'](function(){_0x157eb1[_0x8eae('0x17')](0xcc)[_0x8eae('0x18')]();});}};}function handleEntityNotFound(_0x169274,_0x44ccc7){return function(_0xb461a5){if(!_0xb461a5){_0x169274[_0x8eae('0x16')](0x194);}return _0xb461a5;};}function handleError(_0x40a9de,_0x4f5adf){_0x4f5adf=_0x4f5adf||0x1f4;return function(_0x4204a4){logger['error'](_0x4204a4[_0x8eae('0x20')]);if(_0x4204a4[_0x8eae('0x21')]){delete _0x4204a4[_0x8eae('0x21')];}_0x40a9de[_0x8eae('0x17')](_0x4f5adf)['send'](_0x4204a4);};}exports[_0x8eae('0x22')]=function(_0x537aa7,_0x3b5cbc){var _0x4f508={},_0x17a028={},_0x59b0eb={'count':0x0,'rows':[]};var _0x4da6e8=_[_0x8eae('0x23')](db[_0x8eae('0x24')]['rawAttributes'],function(_0x2ad734){return{'name':_0x2ad734[_0x8eae('0x25')],'type':_0x2ad734[_0x8eae('0x26')][_0x8eae('0x27')]};});_0x17a028[_0x8eae('0x28')]=_[_0x8eae('0x23')](_0x4da6e8,_0x8eae('0x21'));_0x17a028[_0x8eae('0x29')]=_['keys'](_0x537aa7['query']);_0x17a028[_0x8eae('0x2a')]=_[_0x8eae('0x2b')](_0x17a028['model'],_0x17a028[_0x8eae('0x29')]);_0x4f508[_0x8eae('0x2c')]=_[_0x8eae('0x2b')](_0x17a028[_0x8eae('0x28')],qs[_0x8eae('0x2d')](_0x537aa7['query']['fields']));_0x4f508[_0x8eae('0x2c')]=_0x4f508[_0x8eae('0x2c')]['length']?_0x4f508['attributes']:_0x17a028[_0x8eae('0x28')];if(!_0x537aa7[_0x8eae('0x29')]['hasOwnProperty'](_0x8eae('0x2e'))){_0x4f508['limit']=qs[_0x8eae('0x2f')](_0x537aa7[_0x8eae('0x29')][_0x8eae('0x2f')]);_0x4f508[_0x8eae('0x1a')]=qs[_0x8eae('0x1a')](_0x537aa7[_0x8eae('0x29')][_0x8eae('0x1a')]);}_0x4f508['order']=qs[_0x8eae('0x30')](_0x537aa7[_0x8eae('0x29')]['sort']);_0x4f508[_0x8eae('0x31')]=qs['filters'](_[_0x8eae('0x32')](_0x537aa7[_0x8eae('0x29')],_0x17a028['filters']),_0x4da6e8);if(_0x537aa7[_0x8eae('0x29')][_0x8eae('0x33')]){_0x4f508[_0x8eae('0x31')]=_[_0x8eae('0x34')](_0x4f508[_0x8eae('0x31')],{'$or':_[_0x8eae('0x23')](_0x4da6e8,function(_0x2c5dfb){if(_0x2c5dfb[_0x8eae('0x26')]!==_0x8eae('0x35')){var _0x454de9={};_0x454de9[_0x2c5dfb['name']]={'$like':'%'+_0x537aa7['query'][_0x8eae('0x33')]+'%'};return _0x454de9;}})});}_0x4f508=_['merge']({},_0x4f508,_0x537aa7[_0x8eae('0x36')]);var _0x2c8b35={'where':_0x4f508[_0x8eae('0x31')]};return db[_0x8eae('0x24')][_0x8eae('0x1c')](_0x2c8b35)[_0x8eae('0x37')](function(_0x7da9fe){_0x59b0eb['count']=_0x7da9fe;if(_0x537aa7['query'][_0x8eae('0x38')]){_0x4f508[_0x8eae('0x39')]=[{'all':!![]}];}return db[_0x8eae('0x24')][_0x8eae('0x3a')](_0x4f508);})[_0x8eae('0x37')](function(_0x4f97f5){_0x59b0eb[_0x8eae('0x3b')]=_0x4f97f5;return _0x59b0eb;})['then'](respondWithFilteredResult(_0x3b5cbc,_0x4f508))[_0x8eae('0x3c')](handleError(_0x3b5cbc,null));};exports[_0x8eae('0x3d')]=function(_0x422a9a,_0x58b092){var _0x510e29={'raw':![],'where':{'id':_0x422a9a['params']['id']}},_0x5590c5={};_0x5590c5[_0x8eae('0x28')]=_[_0x8eae('0x3e')](db['UserProfileSection'][_0x8eae('0x3f')]);_0x5590c5[_0x8eae('0x29')]=_[_0x8eae('0x3e')](_0x422a9a[_0x8eae('0x29')]);_0x5590c5[_0x8eae('0x2a')]=_[_0x8eae('0x2b')](_0x5590c5[_0x8eae('0x28')],_0x5590c5[_0x8eae('0x29')]);_0x510e29[_0x8eae('0x2c')]=_[_0x8eae('0x2b')](_0x5590c5[_0x8eae('0x28')],qs[_0x8eae('0x2d')](_0x422a9a[_0x8eae('0x29')][_0x8eae('0x2d')]));_0x510e29[_0x8eae('0x2c')]=_0x510e29[_0x8eae('0x2c')][_0x8eae('0x40')]?_0x510e29[_0x8eae('0x2c')]:_0x5590c5[_0x8eae('0x28')];if(_0x422a9a[_0x8eae('0x29')]['includeAll']){_0x510e29['include']=[{'all':!![]}];}_0x510e29=_['merge']({},_0x510e29,_0x422a9a[_0x8eae('0x36')]);return db[_0x8eae('0x24')][_0x8eae('0x41')](_0x510e29)[_0x8eae('0x37')](handleEntityNotFound(_0x58b092,null))[_0x8eae('0x37')](respondWithResult(_0x58b092,null))[_0x8eae('0x3c')](handleError(_0x58b092,null));};exports[_0x8eae('0x42')]=function(_0x458c66,_0xfb9ece){return db[_0x8eae('0x24')][_0x8eae('0x42')](_0x458c66['body'],{})[_0x8eae('0x37')](respondWithResult(_0xfb9ece,0xc9))[_0x8eae('0x3c')](handleError(_0xfb9ece,null));};exports['update']=function(_0x2346d3,_0x264f51){if(_0x2346d3['body']['id']){delete _0x2346d3[_0x8eae('0x43')]['id'];}return db[_0x8eae('0x24')]['find']({'where':{'id':_0x2346d3['params']['id']}})[_0x8eae('0x37')](handleEntityNotFound(_0x264f51,null))[_0x8eae('0x37')](saveUpdates(_0x2346d3['body'],null))[_0x8eae('0x37')](respondWithResult(_0x264f51,null))['catch'](handleError(_0x264f51,null));};exports['destroy']=function(_0x4aa04a,_0x3773fe){return db[_0x8eae('0x24')]['find']({'where':{'id':_0x4aa04a[_0x8eae('0x44')]['id']}})[_0x8eae('0x37')](handleEntityNotFound(_0x3773fe,null))[_0x8eae('0x37')](removeEntity(_0x3773fe,null))[_0x8eae('0x3c')](handleError(_0x3773fe,null));};exports[_0x8eae('0x45')]=function(_0xd44585,_0x5b6de4){return db[_0x8eae('0x24')][_0x8eae('0x45')]()[_0x8eae('0x37')](respondWithResult(_0x5b6de4,null))[_0x8eae('0x3c')](handleError(_0x5b6de4,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 8c5c027..24f21e7 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 _0x33db=['sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x329e44,_0x2bec9b){var _0xe0eaac=function(_0x2fe957){while(--_0x2fe957){_0x329e44['push'](_0x329e44['shift']());}};_0xe0eaac(++_0x2bec9b);}(_0x33db,0x17c));var _0xb33d=function(_0x1ef4ee,_0xd87a11){_0x1ef4ee=_0x1ef4ee-0x0;var _0xabf86f=_0x33db[_0x1ef4ee];return _0xabf86f;};'use strict';var _=require(_0xb33d('0x0'));var util=require(_0xb33d('0x1'));var logger=require(_0xb33d('0x2'))('api');var moment=require(_0xb33d('0x3'));var BPromise=require(_0xb33d('0x4'));var rp=require(_0xb33d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb33d('0x6'));var config=require(_0xb33d('0x7'));var attributes=require(_0xb33d('0x8'));module[_0xb33d('0x9')]=function(_0x5377b3,_0x433632){return _0x5377b3['define'](_0xb33d('0xa'),attributes,{'tableName':_0xb33d('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb33d('0xc'),_0xb33d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a7d=['request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8a7d,0x14e));var _0xd8a7=function(_0x42d3d2,_0x8f329f){_0x42d3d2=_0x42d3d2-0x0;var _0x1dd749=_0x8a7d[_0x42d3d2];return _0x1dd749;};'use strict';var _=require(_0xd8a7('0x0'));var util=require(_0xd8a7('0x1'));var logger=require(_0xd8a7('0x2'))(_0xd8a7('0x3'));var moment=require(_0xd8a7('0x4'));var BPromise=require(_0xd8a7('0x5'));var rp=require(_0xd8a7('0x6'));var fs=require('fs');var path=require(_0xd8a7('0x7'));var rimraf=require(_0xd8a7('0x8'));var config=require(_0xd8a7('0x9'));var attributes=require('./userProfileSection.attributes');module[_0xd8a7('0xa')]=function(_0x576559,_0x1cbe51){return _0x576559[_0xd8a7('0xb')](_0xd8a7('0xc'),attributes,{'tableName':_0xd8a7('0xd'),'paranoid':![],'indexes':[{'name':_0xd8a7('0xe'),'fields':[_0xd8a7('0xf'),_0xd8a7('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 9784efa..c467673 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 _0xe9a2=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xe9a2,0x71));var _0x2e9a=function(_0x46f02b,_0x4e0f71){_0x46f02b=_0x46f02b-0x0;var _0x124c6f=_0xe9a2[_0x46f02b];return _0x124c6f;};'use strict';var _=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var moment=require(_0x2e9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e9a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e9a('0x4'));var logger=require('../../config/logger')(_0x2e9a('0x5'));var config=require(_0x2e9a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e9a('0x7')][_0x2e9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf65,_0x39aa91,_0x2a9275){return new BPromise(function(_0x2e7c1f,_0x2f1fa3){return client[_0x2e9a('0x9')](_0x4bdf65,_0x2a9275)[_0x2e9a('0xa')](function(_0x4b6906){logger[_0x2e9a('0xb')](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));logger[_0x2e9a('0xe')](_0x2e9a('0xf'),_0x39aa91,'request\x20sent',JSON[_0x2e9a('0x10')](_0x4b6906));if(_0x4b6906['error']){if(_0x4b6906[_0x2e9a('0x11')]['code']===0x1f4){logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2f1fa3(_0x4b6906['error'][_0x2e9a('0x12')]);}logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2e7c1f(_0x4b6906[_0x2e9a('0x11')][_0x2e9a('0x12')]);}else{logger['info'](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));_0x2e7c1f(_0x4b6906[_0x2e9a('0x13')][_0x2e9a('0x12')]);}})[_0x2e9a('0x14')](function(_0x35fe81){logger[_0x2e9a('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x39aa91,_0x35fe81);_0x2f1fa3(_0x35fe81);});});} \ No newline at end of file +var _0xfb44=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xfb44,0xb8));var _0x4fb4=function(_0x3d4b8f,_0x3623af){_0x3d4b8f=_0x3d4b8f-0x0;var _0x2c7186=_0xfb44[_0x3d4b8f];return _0x2c7186;};'use strict';var _=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var moment=require(_0x4fb4('0x2'));var BPromise=require(_0x4fb4('0x3'));var rs=require(_0x4fb4('0x4'));var fs=require('fs');var Redis=require(_0x4fb4('0x5'));var db=require(_0x4fb4('0x6'))['db'];var utils=require(_0x4fb4('0x7'));var logger=require(_0x4fb4('0x8'))(_0x4fb4('0x9'));var config=require(_0x4fb4('0xa'));var jayson=require(_0x4fb4('0xb'));var client=jayson['client'][_0x4fb4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1332b3,_0x48a416,_0x5c75ba){return new BPromise(function(_0x1a573a,_0x35d452){return client[_0x4fb4('0xd')](_0x1332b3,_0x5c75ba)[_0x4fb4('0xe')](function(_0xc4d97d){logger[_0x4fb4('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x48a416,_0x4fb4('0x10'));logger[_0x4fb4('0x11')](_0x4fb4('0x12'),_0x48a416,_0x4fb4('0x10'),JSON[_0x4fb4('0x13')](_0xc4d97d));if(_0xc4d97d[_0x4fb4('0x14')]){if(_0xc4d97d[_0x4fb4('0x14')][_0x4fb4('0x15')]===0x1f4){logger[_0x4fb4('0x14')](_0x4fb4('0x16'),_0x48a416,_0xc4d97d[_0x4fb4('0x14')][_0x4fb4('0x17')]);return _0x35d452(_0xc4d97d['error'][_0x4fb4('0x17')]);}logger['error'](_0x4fb4('0x16'),_0x48a416,_0xc4d97d[_0x4fb4('0x14')][_0x4fb4('0x17')]);return _0x1a573a(_0xc4d97d[_0x4fb4('0x14')][_0x4fb4('0x17')]);}else{logger[_0x4fb4('0xf')](_0x4fb4('0x16'),_0x48a416,_0x4fb4('0x10'));_0x1a573a(_0xc4d97d['result'][_0x4fb4('0x17')]);}})[_0x4fb4('0x18')](function(_0x79d84d){logger[_0x4fb4('0x14')](_0x4fb4('0x16'),_0x48a416,_0x79d84d);_0x35d452(_0x79d84d);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index abf3cc9..7e3ba30 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5db2e5,_0x5ade38){var _0x40953f=function(_0x9b8c5a){while(--_0x9b8c5a){_0x5db2e5['push'](_0x5db2e5['shift']());}};_0x40953f(++_0x5ade38);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2bfaf3,_0x21f89c){var _0x3f3dc2=function(_0x11c76a){while(--_0x11c76a){_0x2bfaf3['push'](_0x2bfaf3['shift']());}};_0x3f3dc2(++_0x21f89c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xcb91[_0x3fe042];return _0x7d4a1f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index cd3eb16..82cab14 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 _0x4e45=['INTEGER','sequelize','exports'];(function(_0x45aa72,_0x8af642){var _0x75adaa=function(_0x1f6809){while(--_0x1f6809){_0x45aa72['push'](_0x45aa72['shift']());}};_0x75adaa(++_0x8af642);}(_0x4e45,0x124));var _0x54e4=function(_0x5ca7ee,_0x4c4c48){_0x5ca7ee=_0x5ca7ee-0x0;var _0x47123f=_0x4e45[_0x5ca7ee];return _0x47123f;};'use strict';var Sequelize=require(_0x54e4('0x0'));module[_0x54e4('0x1')]={'penalty':{'type':Sequelize[_0x54e4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2ab5=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ab5,0x95));var _0x52ab=function(_0x25912d,_0x35e195){_0x25912d=_0x25912d-0x0;var _0x3f3c2f=_0x2ab5[_0x25912d];return _0x3f3c2f;};'use strict';var Sequelize=require(_0x52ab('0x0'));module[_0x52ab('0x1')]={'penalty':{'type':Sequelize[_0x52ab('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 09cf263..939b552 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 _0x9fe7=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','bluebird','request-promise'];(function(_0x3f7b32,_0x541303){var _0x512f77=function(_0x56b8bf){while(--_0x56b8bf){_0x3f7b32['push'](_0x3f7b32['shift']());}};_0x512f77(++_0x541303);}(_0x9fe7,0x1df));var _0x79fe=function(_0x52dd16,_0x158c3e){_0x52dd16=_0x52dd16-0x0;var _0x56f6ba=_0x9fe7[_0x52dd16];return _0x56f6ba;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var logger=require('../../config/logger')(_0x79fe('0x2'));var moment=require('moment');var BPromise=require(_0x79fe('0x3'));var rp=require(_0x79fe('0x4'));var fs=require('fs');var path=require(_0x79fe('0x5'));var rimraf=require('rimraf');var config=require(_0x79fe('0x6'));var attributes=require(_0x79fe('0x7'));module[_0x79fe('0x8')]=function(_0x4af9f6,_0x3cec9c){return _0x4af9f6[_0x79fe('0x9')](_0x79fe('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['user_has_sms_queues','lodash','api','moment','bluebird','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0x21dce8,_0x14adba){var _0x34a5c9=function(_0x2cb147){while(--_0x2cb147){_0x21dce8['push'](_0x21dce8['shift']());}};_0x34a5c9(++_0x14adba);}(_0x430c,0x1a1));var _0xc430=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0x430c[_0x4ea6af];return _0x4cb1e6;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 358f0ed..83e3c2e 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 _0x681a=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','result','lodash'];(function(_0x1415f7,_0x31626a){var _0x2c14ac=function(_0x22572c){while(--_0x22572c){_0x1415f7['push'](_0x1415f7['shift']());}};_0x2c14ac(++_0x31626a);}(_0x681a,0x103));var _0xa681=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0x681a[_0x3bc3b4];return _0x4c546b;};'use strict';var _=require(_0xa681('0x0'));var util=require(_0xa681('0x1'));var moment=require(_0xa681('0x2'));var BPromise=require(_0xa681('0x3'));var rs=require(_0xa681('0x4'));var fs=require('fs');var Redis=require(_0xa681('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa681('0x6'))(_0xa681('0x7'));var config=require('../../config/environment');var jayson=require(_0xa681('0x8'));var client=jayson[_0xa681('0x9')][_0xa681('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59fc27,_0x580946,_0x30d5a0){return new BPromise(function(_0x40b183,_0x1c6f38){return client[_0xa681('0xb')](_0x59fc27,_0x30d5a0)['then'](function(_0x4f56e4){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x580946,_0xa681('0xc'));logger[_0xa681('0xd')](_0xa681('0xe'),_0x580946,_0xa681('0xc'),JSON[_0xa681('0xf')](_0x4f56e4));if(_0x4f56e4[_0xa681('0x10')]){if(_0x4f56e4['error']['code']===0x1f4){logger[_0xa681('0x10')](_0xa681('0x11'),_0x580946,_0x4f56e4['error']['message']);return _0x1c6f38(_0x4f56e4['error'][_0xa681('0x12')]);}logger[_0xa681('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x580946,_0x4f56e4[_0xa681('0x10')][_0xa681('0x12')]);return _0x40b183(_0x4f56e4[_0xa681('0x10')]['message']);}else{logger['info'](_0xa681('0x11'),_0x580946,_0xa681('0xc'));_0x40b183(_0x4f56e4[_0xa681('0x13')][_0xa681('0x12')]);}})['catch'](function(_0x5b954c){logger[_0xa681('0x10')](_0xa681('0x11'),_0x580946,_0x5b954c);_0x1c6f38(_0x5b954c);});});} \ No newline at end of file +var _0x2f08=['info','request\x20sent','stringify','error','message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x16f6d2,_0x592ba5){var _0x3432e9=function(_0x3341b8){while(--_0x3341b8){_0x16f6d2['push'](_0x16f6d2['shift']());}};_0x3432e9(++_0x592ba5);}(_0x2f08,0x6c));var _0x82f0=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x2f08[_0xe09d0];return _0x44ad05;};'use strict';var _=require(_0x82f0('0x0'));var util=require(_0x82f0('0x1'));var moment=require(_0x82f0('0x2'));var BPromise=require(_0x82f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f0('0x4'))['db'];var utils=require(_0x82f0('0x5'));var logger=require(_0x82f0('0x6'))(_0x82f0('0x7'));var config=require('../../config/environment');var jayson=require(_0x82f0('0x8'));var client=jayson['client'][_0x82f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40cc53,_0x33fc53,_0x4c7df0){return new BPromise(function(_0x275583,_0x2ed0ed){return client[_0x82f0('0xa')](_0x40cc53,_0x4c7df0)[_0x82f0('0xb')](function(_0x56fb46){logger[_0x82f0('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x33fc53,_0x82f0('0xd'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x33fc53,'request\x20sent',JSON[_0x82f0('0xe')](_0x56fb46));if(_0x56fb46[_0x82f0('0xf')]){if(_0x56fb46[_0x82f0('0xf')]['code']===0x1f4){logger[_0x82f0('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x33fc53,_0x56fb46[_0x82f0('0xf')][_0x82f0('0x10')]);return _0x2ed0ed(_0x56fb46[_0x82f0('0xf')][_0x82f0('0x10')]);}logger[_0x82f0('0xf')](_0x82f0('0x11'),_0x33fc53,_0x56fb46[_0x82f0('0xf')][_0x82f0('0x10')]);return _0x275583(_0x56fb46[_0x82f0('0xf')][_0x82f0('0x10')]);}else{logger['info'](_0x82f0('0x11'),_0x33fc53,_0x82f0('0xd'));_0x275583(_0x56fb46[_0x82f0('0x12')][_0x82f0('0x10')]);}})[_0x82f0('0x13')](function(_0x28f0ce){logger['error'](_0x82f0('0x11'),_0x33fc53,_0x28f0ce);_0x2ed0ed(_0x28f0ce);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 095d3d9..27686c4 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 _0xcfc0=['INTEGER','sequelize','exports'];(function(_0x2adb27,_0xb9de11){var _0x1e5a0c=function(_0x2a4d9b){while(--_0x2a4d9b){_0x2adb27['push'](_0x2adb27['shift']());}};_0x1e5a0c(++_0xb9de11);}(_0xcfc0,0x88));var _0x0cfc=function(_0x4cb684,_0x37e236){_0x4cb684=_0x4cb684-0x0;var _0x17b482=_0xcfc0[_0x4cb684];return _0x17b482;};'use strict';var Sequelize=require(_0x0cfc('0x0'));module[_0x0cfc('0x1')]={'UserId':{'type':Sequelize[_0x0cfc('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0cfc('0x2')]}}; \ No newline at end of file +var _0xb15a=['INTEGER','sequelize','exports'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xb15a,0x1de));var _0xab15=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xb15a[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0xab15('0x0'));module[_0xab15('0x1')]={'UserId':{'type':Sequelize[_0xab15('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xab15('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b111e7f..da9d3ec 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(_0x4a65e4,_0x374b0e){var _0x4bfd48=function(_0x2ab567){while(--_0x2ab567){_0x4a65e4['push'](_0x4a65e4['shift']());}};_0x4bfd48(++_0x374b0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x4cdc91,_0x5065c2){var _0x23c9d9=function(_0x3c76f8){while(--_0x3c76f8){_0x4cdc91['push'](_0x4cdc91['shift']());}};_0x23c9d9(++_0x5065c2);}(_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 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 578bf4b..b4f7b37 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x22e3d1,_0x28f853){var _0x320471=function(_0x469a78){while(--_0x469a78){_0x22e3d1['push'](_0x22e3d1['shift']());}};_0x320471(++_0x28f853);}(_0x70e0,0x17b));var _0x070e=function(_0x583c56,_0x5cc77c){_0x583c56=_0x583c56-0x0;var _0x4794ce=_0x70e0[_0x583c56];return _0x4794ce;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xe4194b,_0x4b7ab1){var _0xaae39f=function(_0x4d9cd3){while(--_0x4d9cd3){_0xe4194b['push'](_0xe4194b['shift']());}};_0xaae39f(++_0x4b7ab1);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c8b1213..72fb96d 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 _0x8303=['sequelize','exports'];(function(_0x52a103,_0x18b19e){var _0x5d606c=function(_0x420222){while(--_0x420222){_0x52a103['push'](_0x52a103['shift']());}};_0x5d606c(++_0x18b19e);}(_0x8303,0x176));var _0x3830=function(_0x431127,_0x4661af){_0x431127=_0x431127-0x0;var _0x17488d=_0x8303[_0x431127];return _0x17488d;};'use strict';var Sequelize=require(_0x3830('0x0'));module[_0x3830('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc1f1=['exports','INTEGER'];(function(_0x375748,_0x547e38){var _0x20aca1=function(_0x1fde3a){while(--_0x1fde3a){_0x375748['push'](_0x375748['shift']());}};_0x20aca1(++_0x547e38);}(_0xc1f1,0x122));var _0x1c1f=function(_0x4bd76e,_0x260c31){_0x4bd76e=_0x4bd76e-0x0;var _0x96a285=_0xc1f1[_0x4bd76e];return _0x96a285;};'use strict';var Sequelize=require('sequelize');module[_0x1c1f('0x0')]={'penalty':{'type':Sequelize[_0x1c1f('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 5a2217e..691d6cd 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 _0x7d16=['UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x4d2c1b,_0x5ef6a1){var _0x3487be=function(_0x4522ba){while(--_0x4522ba){_0x4d2c1b['push'](_0x4d2c1b['shift']());}};_0x3487be(++_0x5ef6a1);}(_0x7d16,0x19a));var _0x67d1=function(_0x2f33f7,_0x158200){_0x2f33f7=_0x2f33f7-0x0;var _0x185c5f=_0x7d16[_0x2f33f7];return _0x185c5f;};'use strict';var _=require(_0x67d1('0x0'));var util=require('util');var logger=require(_0x67d1('0x1'))(_0x67d1('0x2'));var moment=require('moment');var BPromise=require(_0x67d1('0x3'));var rp=require(_0x67d1('0x4'));var fs=require('fs');var path=require(_0x67d1('0x5'));var rimraf=require('rimraf');var config=require(_0x67d1('0x6'));var attributes=require(_0x67d1('0x7'));module[_0x67d1('0x8')]=function(_0x484f85,_0x37d8b8){return _0x484f85[_0x67d1('0x9')](_0x67d1('0xa'),attributes,{'tableName':_0x67d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bfd=['rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x39d690,_0x495449){var _0x525439=function(_0x1bbd04){while(--_0x1bbd04){_0x39d690['push'](_0x39d690['shift']());}};_0x525439(++_0x495449);}(_0x7bfd,0x170));var _0xd7bf=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7bfd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xd7bf('0x0'));var util=require(_0xd7bf('0x1'));var logger=require(_0xd7bf('0x2'))('api');var moment=require(_0xd7bf('0x3'));var BPromise=require(_0xd7bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7bf('0x5'));var rimraf=require(_0xd7bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7bf('0x7'));module['exports']=function(_0x85ed39,_0x535041){return _0x85ed39[_0xd7bf('0x8')](_0xd7bf('0x9'),attributes,{'tableName':_0xd7bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 204657d..4e10a5f 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 _0x21c2=['http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x21c2,0x75));var _0x221c=function(_0x4ce6ea,_0x140fb0){_0x4ce6ea=_0x4ce6ea-0x0;var _0xf8d28=_0x21c2[_0x4ce6ea];return _0xf8d28;};'use strict';var _=require(_0x221c('0x0'));var util=require('util');var moment=require(_0x221c('0x1'));var BPromise=require(_0x221c('0x2'));var rs=require(_0x221c('0x3'));var fs=require('fs');var Redis=require(_0x221c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x221c('0x5'))(_0x221c('0x6'));var config=require(_0x221c('0x7'));var jayson=require(_0x221c('0x8'));var client=jayson['client'][_0x221c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6d40,_0x3c3958,_0x1f0d83){return new BPromise(function(_0x582049,_0x46e8cf){return client[_0x221c('0xa')](_0x4b6d40,_0x1f0d83)[_0x221c('0xb')](function(_0xe11649){logger['info'](_0x221c('0xc'),_0x3c3958,_0x221c('0xd'));logger[_0x221c('0xe')](_0x221c('0xf'),_0x3c3958,'request\x20sent',JSON[_0x221c('0x10')](_0xe11649));if(_0xe11649['error']){if(_0xe11649['error'][_0x221c('0x11')]===0x1f4){logger[_0x221c('0x12')](_0x221c('0xc'),_0x3c3958,_0xe11649[_0x221c('0x12')]['message']);return _0x46e8cf(_0xe11649[_0x221c('0x12')][_0x221c('0x13')]);}logger[_0x221c('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3c3958,_0xe11649[_0x221c('0x12')][_0x221c('0x13')]);return _0x582049(_0xe11649['error']['message']);}else{logger[_0x221c('0x14')](_0x221c('0xc'),_0x3c3958,_0x221c('0xd'));_0x582049(_0xe11649['result'][_0x221c('0x13')]);}})['catch'](function(_0x4616b5){logger[_0x221c('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3c3958,_0x4616b5);_0x46e8cf(_0x4616b5);});});} \ No newline at end of file +var _0x805b=['stringify','error','code','message','request\x20sent','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x30db5d,_0xa7b720){var _0x3c3729=function(_0x516dcc){while(--_0x516dcc){_0x30db5d['push'](_0x30db5d['shift']());}};_0x3c3729(++_0xa7b720);}(_0x805b,0x146));var _0xb805=function(_0x56febd,_0x53e7b1){_0x56febd=_0x56febd-0x0;var _0x1935c4=_0x805b[_0x56febd];return _0x1935c4;};'use strict';var _=require('lodash');var util=require(_0xb805('0x0'));var moment=require('moment');var BPromise=require(_0xb805('0x1'));var rs=require(_0xb805('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb805('0x3'))['db'];var utils=require(_0xb805('0x4'));var logger=require(_0xb805('0x5'))('rpc');var config=require(_0xb805('0x6'));var jayson=require(_0xb805('0x7'));var client=jayson[_0xb805('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fdf07,_0x2a6e41,_0x26e005){return new BPromise(function(_0x4b05b7,_0x39b044){return client[_0xb805('0x9')](_0x2fdf07,_0x26e005)[_0xb805('0xa')](function(_0x5634d2){logger[_0xb805('0xb')](_0xb805('0xc'),_0x2a6e41,'request\x20sent');logger[_0xb805('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2a6e41,'request\x20sent',JSON[_0xb805('0xe')](_0x5634d2));if(_0x5634d2['error']){if(_0x5634d2[_0xb805('0xf')][_0xb805('0x10')]===0x1f4){logger[_0xb805('0xf')](_0xb805('0xc'),_0x2a6e41,_0x5634d2[_0xb805('0xf')]['message']);return _0x39b044(_0x5634d2['error'][_0xb805('0x11')]);}logger[_0xb805('0xf')](_0xb805('0xc'),_0x2a6e41,_0x5634d2[_0xb805('0xf')][_0xb805('0x11')]);return _0x4b05b7(_0x5634d2[_0xb805('0xf')]['message']);}else{logger['info'](_0xb805('0xc'),_0x2a6e41,_0xb805('0x12'));_0x4b05b7(_0x5634d2[_0xb805('0x13')][_0xb805('0x11')]);}})['catch'](function(_0xdeaf3){logger[_0xb805('0xf')](_0xb805('0xc'),_0x2a6e41,_0xdeaf3);_0x39b044(_0xdeaf3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 693ce84..d494785 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4fafa9,_0x24152d){var _0xb86f34=function(_0x399d5b){while(--_0x399d5b){_0x4fafa9['push'](_0x4fafa9['shift']());}};_0xb86f34(++_0x24152d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xcb91[_0x2ac4af];return _0x3a36df;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e0c16,_0x247098){var _0x18099d=function(_0x72e699){while(--_0x72e699){_0x5e0c16['push'](_0x5e0c16['shift']());}};_0x18099d(++_0x247098);}(_0xe706,0xa3));var _0x6e70=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0xe706[_0x23e5ce];return _0x2ce19b;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index a73ad46..4c50d21 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 _0x816f=['Required\x20by\x20Asterisk','INTEGER','queue_interface','exports','STRING'];(function(_0x5ae733,_0xbd346a){var _0x4f5ce8=function(_0x103415){while(--_0x103415){_0x5ae733['push'](_0x5ae733['shift']());}};_0x4f5ce8(++_0xbd346a);}(_0x816f,0x116));var _0xf816=function(_0x3289ed,_0x29c15){_0x3289ed=_0x3289ed-0x0;var _0x4ebeff=_0x816f[_0x3289ed];return _0x4ebeff;};'use strict';var Sequelize=require('sequelize');module[_0xf816('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xf816('0x1')],'allowNull':![],'comment':_0xf816('0x2')},'UserId':{'type':Sequelize[_0xf816('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf816('0x4'),'comment':_0xf816('0x2')},'VoiceQueueId':{'type':Sequelize[_0xf816('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xf816('0x1')],'allowNull':![],'unique':_0xf816('0x4'),'comment':_0xf816('0x2')},'penalty':{'type':Sequelize[_0xf816('0x3')](0xb),'defaultValue':0x0,'comment':_0xf816('0x2')},'paused':{'type':Sequelize[_0xf816('0x3')](0xb),'defaultValue':0x0,'comment':_0xf816('0x2')}}; \ No newline at end of file +var _0xae14=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x4ca6ab,_0x29bc6c){var _0x516678=function(_0x108d0e){while(--_0x108d0e){_0x4ca6ab['push'](_0x4ca6ab['shift']());}};_0x516678(++_0x29bc6c);}(_0xae14,0xd6));var _0x4ae1=function(_0x24ce1b,_0x885966){_0x24ce1b=_0x24ce1b-0x0;var _0x106cd6=_0xae14[_0x24ce1b];return _0x106cd6;};'use strict';var Sequelize=require(_0x4ae1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae1('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4ae1('0x2')},'membername':{'type':Sequelize[_0x4ae1('0x3')],'allowNull':![],'comment':_0x4ae1('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4ae1('0x3')],'allowNull':![],'unique':_0x4ae1('0x4'),'comment':_0x4ae1('0x2')},'VoiceQueueId':{'type':Sequelize[_0x4ae1('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x4ae1('0x3')],'allowNull':![],'unique':_0x4ae1('0x4'),'comment':_0x4ae1('0x2')},'penalty':{'type':Sequelize[_0x4ae1('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4ae1('0x1')](0xb),'defaultValue':0x0,'comment':_0x4ae1('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1c62f61..4e8b918 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 _0xe703=['hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','save','update','remove','emit'];(function(_0x219781,_0x5971ec){var _0x243a6a=function(_0xdc0495){while(--_0xdc0495){_0x219781['push'](_0x219781['shift']());}};_0x243a6a(++_0x5971ec);}(_0xe703,0x1bb));var _0x3e70=function(_0x5a559c,_0xb34e0b){_0x5a559c=_0x5a559c-0x0;var _0x1a4bd9=_0xe703[_0x5a559c];return _0x1a4bd9;};'use strict';var EventEmitter=require(_0x3e70('0x0'));var UserVoiceQueueRt=require(_0x3e70('0x1'))['db'][_0x3e70('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e70('0x3'),'afterUpdate':_0x3e70('0x4'),'afterDestroy':_0x3e70('0x5')};function emitEvent(_0x562d95){return function(_0x5346c7,_0x21c012,_0x80ae1f){UserVoiceQueueRtEvents[_0x3e70('0x6')](_0x562d95+':'+_0x5346c7['id'],_0x5346c7);UserVoiceQueueRtEvents[_0x3e70('0x6')](_0x562d95,_0x5346c7);_0x80ae1f(null);};}for(var e in events){if(events[_0x3e70('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x3e70('0x8')](e,emitEvent(event));}}module[_0x3e70('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xe4d7=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ef857,_0x48ab83){var _0x3d2996=function(_0x2330ba){while(--_0x2330ba){_0x4ef857['push'](_0x4ef857['shift']());}};_0x3d2996(++_0x48ab83);}(_0xe4d7,0x186));var _0x7e4d=function(_0x1b24e8,_0x3dfeaa){_0x1b24e8=_0x1b24e8-0x0;var _0x45f47e=_0xe4d7[_0x1b24e8];return _0x45f47e;};'use strict';var EventEmitter=require(_0x7e4d('0x0'));var UserVoiceQueueRt=require(_0x7e4d('0x1'))['db'][_0x7e4d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7e4d('0x3')](0x0);var events={'afterCreate':_0x7e4d('0x4'),'afterUpdate':_0x7e4d('0x5'),'afterDestroy':_0x7e4d('0x6')};function emitEvent(_0x504e1d){return function(_0x21dbd5,_0x105ed9,_0x27b5b1){UserVoiceQueueRtEvents[_0x7e4d('0x7')](_0x504e1d+':'+_0x21dbd5['id'],_0x21dbd5);UserVoiceQueueRtEvents[_0x7e4d('0x7')](_0x504e1d,_0x21dbd5);_0x27b5b1(null);};}for(var e in events){if(events[_0x7e4d('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x7e4d('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index acdec7d..12708fa 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 _0x974a=['util','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x1d882b,_0xee1c34){var _0x43110d=function(_0x201e55){while(--_0x201e55){_0x1d882b['push'](_0x1d882b['shift']());}};_0x43110d(++_0xee1c34);}(_0x974a,0x129));var _0xa974=function(_0x482b65,_0x4f7234){_0x482b65=_0x482b65-0x0;var _0x374375=_0x974a[_0x482b65];return _0x374375;};'use strict';var _=require('lodash');var util=require(_0xa974('0x0'));var logger=require('../../config/logger')(_0xa974('0x1'));var moment=require('moment');var BPromise=require(_0xa974('0x2'));var rp=require(_0xa974('0x3'));var fs=require('fs');var path=require(_0xa974('0x4'));var rimraf=require('rimraf');var config=require(_0xa974('0x5'));var attributes=require(_0xa974('0x6'));module[_0xa974('0x7')]=function(_0xdd46eb,_0x554c4f){return _0xdd46eb[_0xa974('0x8')](_0xa974('0x9'),attributes,{'tableName':_0xa974('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0634=['exports','user_has_voice_queues_rt','lodash','util','../../config/logger','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x4d854e,_0x5b6571){var _0x49a28a=function(_0x150e60){while(--_0x150e60){_0x4d854e['push'](_0x4d854e['shift']());}};_0x49a28a(++_0x5b6571);}(_0x0634,0x167));var _0x4063=function(_0x2d6507,_0x220e8f){_0x2d6507=_0x2d6507-0x0;var _0x8904c8=_0x0634[_0x2d6507];return _0x8904c8;};'use strict';var _=require(_0x4063('0x0'));var util=require(_0x4063('0x1'));var logger=require(_0x4063('0x2'))('api');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(_0x4063('0x3'));var attributes=require(_0x4063('0x4'));module[_0x4063('0x5')]=function(_0x8c48be,_0x158c6c){return _0x8c48be['define']('UserVoiceQueueRt',attributes,{'tableName':_0x4063('0x6'),'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 2b7b7e1..b30adb4 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 _0x8913=['findAll','options','where','sequelize','COUNT','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8913,0x153));var _0x3891=function(_0x23e086,_0x591cbd){_0x23e086=_0x23e086-0x0;var _0x40033c=_0x8913[_0x23e086];return _0x40033c;};'use strict';var _=require(_0x3891('0x0'));var util=require(_0x3891('0x1'));var moment=require(_0x3891('0x2'));var BPromise=require(_0x3891('0x3'));var rs=require(_0x3891('0x4'));var fs=require('fs');var Redis=require(_0x3891('0x5'));var db=require(_0x3891('0x6'))['db'];var utils=require(_0x3891('0x7'));var logger=require('../../config/logger')(_0x3891('0x8'));var config=require(_0x3891('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3891('0xa')][_0x3891('0xb')]({'port':0x232a});config[_0x3891('0xc')]=_[_0x3891('0xd')](config['redis'],{'host':_0x3891('0xe'),'port':0x18eb});var socket=require(_0x3891('0xf'))(new Redis(config[_0x3891('0xc')]));require('./userVoiceQueueRt.socket')[_0x3891('0x10')](socket);function respondWithRpcPromise(_0x438342,_0x591c63,_0x358f31){return new BPromise(function(_0x5553bd,_0x31f959){return client[_0x3891('0x11')](_0x438342,_0x358f31)[_0x3891('0x12')](function(_0x2c9389){logger[_0x3891('0x13')](_0x3891('0x14'),_0x591c63,_0x3891('0x15'));logger[_0x3891('0x16')](_0x3891('0x17'),_0x591c63,'request\x20sent',JSON[_0x3891('0x18')](_0x2c9389));if(_0x2c9389[_0x3891('0x19')]){if(_0x2c9389['error'][_0x3891('0x1a')]===0x1f4){logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x2c9389[_0x3891('0x19')]['message']);return _0x31f959(_0x2c9389[_0x3891('0x19')][_0x3891('0x1b')]);}logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x2c9389['error'][_0x3891('0x1b')]);return _0x5553bd(_0x2c9389[_0x3891('0x19')][_0x3891('0x1b')]);}else{logger[_0x3891('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x591c63,_0x3891('0x15'));_0x5553bd(_0x2c9389['result'][_0x3891('0x1b')]);}})[_0x3891('0x1c')](function(_0x384b7d){logger[_0x3891('0x19')](_0x3891('0x14'),_0x591c63,_0x384b7d);_0x31f959(_0x384b7d);});});}exports[_0x3891('0x1d')]=function(_0x3ebf19){var _0x5e417b=this;return new Promise(function(_0x58443a,_0x85673c){return db[_0x3891('0x1e')][_0x3891('0x1f')]({'raw':_0x3ebf19[_0x3891('0x20')]?_0x3ebf19[_0x3891('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebf19[_0x3891('0x20')]?_0x3ebf19[_0x3891('0x20')][_0x3891('0x21')]||null:null,'attributes':[[db[_0x3891('0x22')]['fn'](_0x3891('0x23'),db[_0x3891('0x22')]['fn']('IF',db[_0x3891('0x22')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x3891('0x24')]]})[_0x3891('0x12')](function(_0x3b130d){logger[_0x3891('0x13')](_0x3891('0x1d'),_0x3ebf19);logger[_0x3891('0x16')](_0x3891('0x1d'),_0x3ebf19,JSON[_0x3891('0x18')](_0x3b130d));_0x58443a(_0x3b130d);})[_0x3891('0x1c')](function(_0x2fff65){logger[_0x3891('0x19')](_0x3891('0x1d'),_0x2fff65[_0x3891('0x1b')],_0x3ebf19);_0x85673c(_0x5e417b[_0x3891('0x19')](0x1f4,_0x2fff65['message']));});});}; \ No newline at end of file +var _0x0a30=['message','result','catch','GetVoiceQueueRtPauses','findAll','options','COUNT','sequelize','literal','outboundQueuePauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0a30,0xef));var _0x00a3=function(_0xa39d23,_0x175d2d){_0xa39d23=_0xa39d23-0x0;var _0x2566b6=_0x0a30[_0xa39d23];return _0x2566b6;};'use strict';var _=require(_0x00a3('0x0'));var util=require(_0x00a3('0x1'));var moment=require(_0x00a3('0x2'));var BPromise=require(_0x00a3('0x3'));var rs=require(_0x00a3('0x4'));var fs=require('fs');var Redis=require(_0x00a3('0x5'));var db=require(_0x00a3('0x6'))['db'];var utils=require(_0x00a3('0x7'));var logger=require(_0x00a3('0x8'))(_0x00a3('0x9'));var config=require(_0x00a3('0xa'));var jayson=require(_0x00a3('0xb'));var client=jayson['client'][_0x00a3('0xc')]({'port':0x232a});config[_0x00a3('0xd')]=_[_0x00a3('0xe')](config['redis'],{'host':_0x00a3('0xf'),'port':0x18eb});var socket=require(_0x00a3('0x10'))(new Redis(config[_0x00a3('0xd')]));require(_0x00a3('0x11'))[_0x00a3('0x12')](socket);function respondWithRpcPromise(_0x5f56ca,_0x2e0674,_0x25da8b){return new BPromise(function(_0x1086ca,_0x3af2b8){return client[_0x00a3('0x13')](_0x5f56ca,_0x25da8b)[_0x00a3('0x14')](function(_0x5b3bc6){logger[_0x00a3('0x15')](_0x00a3('0x16'),_0x2e0674,_0x00a3('0x17'));logger[_0x00a3('0x18')](_0x00a3('0x19'),_0x2e0674,_0x00a3('0x17'),JSON['stringify'](_0x5b3bc6));if(_0x5b3bc6['error']){if(_0x5b3bc6[_0x00a3('0x1a')]['code']===0x1f4){logger[_0x00a3('0x1a')](_0x00a3('0x16'),_0x2e0674,_0x5b3bc6[_0x00a3('0x1a')]['message']);return _0x3af2b8(_0x5b3bc6[_0x00a3('0x1a')][_0x00a3('0x1b')]);}logger[_0x00a3('0x1a')](_0x00a3('0x16'),_0x2e0674,_0x5b3bc6[_0x00a3('0x1a')][_0x00a3('0x1b')]);return _0x1086ca(_0x5b3bc6['error'][_0x00a3('0x1b')]);}else{logger[_0x00a3('0x15')](_0x00a3('0x16'),_0x2e0674,_0x00a3('0x17'));_0x1086ca(_0x5b3bc6[_0x00a3('0x1c')]['message']);}})[_0x00a3('0x1d')](function(_0x1a77b9){logger[_0x00a3('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2e0674,_0x1a77b9);_0x3af2b8(_0x1a77b9);});});}exports[_0x00a3('0x1e')]=function(_0x2cd0bb){var _0xf7c4ee=this;return new Promise(function(_0x46b4be,_0x4ff25a){return db['UserVoiceQueueRt'][_0x00a3('0x1f')]({'raw':_0x2cd0bb['options']?_0x2cd0bb[_0x00a3('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2cd0bb[_0x00a3('0x20')]?_0x2cd0bb[_0x00a3('0x20')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x00a3('0x21'),db[_0x00a3('0x22')]['fn']('IF',db[_0x00a3('0x22')][_0x00a3('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0x00a3('0x24')]]})[_0x00a3('0x14')](function(_0x3d848f){logger[_0x00a3('0x15')](_0x00a3('0x1e'),_0x2cd0bb);logger['debug'](_0x00a3('0x1e'),_0x2cd0bb,JSON[_0x00a3('0x25')](_0x3d848f));_0x46b4be(_0x3d848f);})[_0x00a3('0x1d')](function(_0x564989){logger[_0x00a3('0x1a')](_0x00a3('0x1e'),_0x564989[_0x00a3('0x1b')],_0x2cd0bb);_0x4ff25a(_0xf7c4ee[_0x00a3('0x1a')](0x1f4,_0x564989['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 113a479..f6efd7f 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 _0x02ca=['emit','removeListener','register','length','./userVoiceQueueRt.events','remove','update'];(function(_0x3c9df8,_0x387a5d){var _0x3c8cd3=function(_0x4a0541){while(--_0x4a0541){_0x3c9df8['push'](_0x3c9df8['shift']());}};_0x3c8cd3(++_0x387a5d);}(_0x02ca,0x97));var _0xa02c=function(_0x426443,_0x3fa1ad){_0x426443=_0x426443-0x0;var _0x489c8f=_0x02ca[_0x426443];return _0x489c8f;};'use strict';var UserVoiceQueueRtEvents=require(_0xa02c('0x0'));var events=['save',_0xa02c('0x1'),_0xa02c('0x2')];function createListener(_0x306f43,_0x182120){return function(_0x573a2b){_0x182120[_0xa02c('0x3')](_0x306f43,_0x573a2b);};}function removeListener(_0x18c88a,_0x31c03a){return function(){UserVoiceQueueRtEvents[_0xa02c('0x4')](_0x18c88a,_0x31c03a);};}exports[_0xa02c('0x5')]=function(_0x46533c){for(var _0xa0f1fe=0x0,_0x29c64a=events[_0xa02c('0x6')];_0xa0f1fe<_0x29c64a;_0xa0f1fe++){var _0x2b96c5=events[_0xa0f1fe];var _0x4033b9=createListener('userVoiceQueueRt:'+_0x2b96c5,_0x46533c);UserVoiceQueueRtEvents['on'](_0x2b96c5,_0x4033b9);}}; \ No newline at end of file +var _0x1623=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x5703f9,_0x4d1126){_0x5703f9=_0x5703f9-0x0;var _0x52a5ba=_0x1623[_0x5703f9];return _0x52a5ba;};'use strict';var UserVoiceQueueRtEvents=require(_0x3162('0x0'));var events=['save','remove',_0x3162('0x1')];function createListener(_0x27ee21,_0x36ccc3){return function(_0x2cc4d7){_0x36ccc3[_0x3162('0x2')](_0x27ee21,_0x2cc4d7);};}function removeListener(_0x4ce2bd,_0x5d49d0){return function(){UserVoiceQueueRtEvents[_0x3162('0x3')](_0x4ce2bd,_0x5d49d0);};}exports['register']=function(_0x1b55f2){for(var _0x428de6=0x0,_0x53260d=events[_0x3162('0x4')];_0x428de6<_0x53260d;_0x428de6++){var _0x2dc07e=events[_0x428de6];var _0x26ee32=createListener(_0x3162('0x5')+_0x2dc07e,_0x1b55f2);UserVoiceQueueRtEvents['on'](_0x2dc07e,_0x26ee32);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 19c7001..28767c7 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2ec2ae,_0x4c92d3){var _0x45122b=function(_0x56f448){while(--_0x56f448){_0x2ec2ae['push'](_0x2ec2ae['shift']());}};_0x45122b(++_0x4c92d3);}(_0xedd9,0xfc));var _0x9edd=function(_0x56e363,_0x146efe){_0x56e363=_0x56e363-0x0;var _0x11e555=_0xedd9[_0x56e363];return _0x11e555;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x317561,_0x1ad68c){var _0x40820f=function(_0x49b04b){while(--_0x49b04b){_0x317561['push'](_0x317561['shift']());}};_0x40820f(++_0x1ad68c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xcb91[_0x382e89];return _0x3a1318;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index d083fb3..9a1139a 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 _0xd4d4=['INTEGER','exports'];(function(_0x3da9cb,_0x196122){var _0x43cea1=function(_0x4b1ded){while(--_0x4b1ded){_0x3da9cb['push'](_0x3da9cb['shift']());}};_0x43cea1(++_0x196122);}(_0xd4d4,0x1db));var _0x4d4d=function(_0x59f2e8,_0x1c9b66){_0x59f2e8=_0x59f2e8-0x0;var _0x26b2cc=_0xd4d4[_0x59f2e8];return _0x26b2cc;};'use strict';var Sequelize=require('sequelize');module[_0x4d4d('0x0')]={'penalty':{'type':Sequelize[_0x4d4d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x32b6=['exports','INTEGER','sequelize'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x32b6,0x18b));var _0x632b=function(_0x26db64,_0x575ff5){_0x26db64=_0x26db64-0x0;var _0x4f2ec3=_0x32b6[_0x26db64];return _0x4f2ec3;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'penalty':{'type':Sequelize[_0x632b('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 61ea870..105d359 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 _0x1626=['api','moment','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x42378f,_0x4b6eaa){var _0x2d531a=function(_0x22ebd0){while(--_0x22ebd0){_0x42378f['push'](_0x42378f['shift']());}};_0x2d531a(++_0x4b6eaa);}(_0x1626,0x1c1));var _0x6162=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x1626[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require(_0x6162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6162('0x1'));var moment=require(_0x6162('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6162('0x3'));var rimraf=require(_0x6162('0x4'));var config=require('../../config/environment');var attributes=require(_0x6162('0x5'));module[_0x6162('0x6')]=function(_0x27f59c,_0x270312){return _0x27f59c[_0x6162('0x7')](_0x6162('0x8'),attributes,{'tableName':_0x6162('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaedb=['./userWhatsappQueue.attributes','exports','define','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2b896a,_0x380fad){var _0x481712=function(_0x348a71){while(--_0x348a71){_0x2b896a['push'](_0x2b896a['shift']());}};_0x481712(++_0x380fad);}(_0xaedb,0xc0));var _0xbaed=function(_0x3297de,_0x17066f){_0x3297de=_0x3297de-0x0;var _0x21d2fa=_0xaedb[_0x3297de];return _0x21d2fa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbaed('0x0'));var moment=require(_0xbaed('0x1'));var BPromise=require(_0xbaed('0x2'));var rp=require(_0xbaed('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbaed('0x4'));var config=require(_0xbaed('0x5'));var attributes=require(_0xbaed('0x6'));module[_0xbaed('0x7')]=function(_0x39cf6b,_0x291806){return _0x39cf6b[_0xbaed('0x8')]('UserWhatsappQueue',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 1f86ee4..72d2c0f 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 _0x7989=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c31a9,_0x35c105){var _0x14187a=function(_0x481c81){while(--_0x481c81){_0x1c31a9['push'](_0x1c31a9['shift']());}};_0x14187a(++_0x35c105);}(_0x7989,0x19b));var _0x9798=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0x7989[_0x19921b];return _0x273545;};'use strict';var _=require(_0x9798('0x0'));var util=require(_0x9798('0x1'));var moment=require(_0x9798('0x2'));var BPromise=require('bluebird');var rs=require(_0x9798('0x3'));var fs=require('fs');var Redis=require(_0x9798('0x4'));var db=require(_0x9798('0x5'))['db'];var utils=require(_0x9798('0x6'));var logger=require(_0x9798('0x7'))('rpc');var config=require(_0x9798('0x8'));var jayson=require(_0x9798('0x9'));var client=jayson[_0x9798('0xa')][_0x9798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2560aa,_0x4bbd7d,_0x51cec0){return new BPromise(function(_0x1e406c,_0xe1d8d1){return client[_0x9798('0xc')](_0x2560aa,_0x51cec0)['then'](function(_0x5accc4){logger[_0x9798('0xd')](_0x9798('0xe'),_0x4bbd7d,'request\x20sent');logger['debug'](_0x9798('0xf'),_0x4bbd7d,'request\x20sent',JSON[_0x9798('0x10')](_0x5accc4));if(_0x5accc4[_0x9798('0x11')]){if(_0x5accc4['error'][_0x9798('0x12')]===0x1f4){logger[_0x9798('0x11')](_0x9798('0xe'),_0x4bbd7d,_0x5accc4[_0x9798('0x11')]['message']);return _0xe1d8d1(_0x5accc4['error']['message']);}logger['error'](_0x9798('0xe'),_0x4bbd7d,_0x5accc4[_0x9798('0x11')]['message']);return _0x1e406c(_0x5accc4[_0x9798('0x11')]['message']);}else{logger[_0x9798('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4bbd7d,'request\x20sent');_0x1e406c(_0x5accc4[_0x9798('0x13')][_0x9798('0x14')]);}})[_0x9798('0x15')](function(_0x268339){logger[_0x9798('0x11')](_0x9798('0xe'),_0x4bbd7d,_0x268339);_0xe1d8d1(_0x268339);});});} \ No newline at end of file +var _0xf456=['request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xf456,0x8d));var _0x6f45=function(_0x172577,_0x57b277){_0x172577=_0x172577-0x0;var _0x3a9fbc=_0xf456[_0x172577];return _0x3a9fbc;};'use strict';var _=require(_0x6f45('0x0'));var util=require(_0x6f45('0x1'));var moment=require(_0x6f45('0x2'));var BPromise=require(_0x6f45('0x3'));var rs=require(_0x6f45('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f45('0x5'))['db'];var utils=require(_0x6f45('0x6'));var logger=require(_0x6f45('0x7'))('rpc');var config=require(_0x6f45('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f45('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dcdb,_0x5a76af,_0x1da94e){return new BPromise(function(_0x945c21,_0x4d7f97){return client[_0x6f45('0xa')](_0x32dcdb,_0x1da94e)[_0x6f45('0xb')](function(_0x2c80ed){logger['info'](_0x6f45('0xc'),_0x5a76af,_0x6f45('0xd'));logger[_0x6f45('0xe')](_0x6f45('0xf'),_0x5a76af,_0x6f45('0xd'),JSON[_0x6f45('0x10')](_0x2c80ed));if(_0x2c80ed['error']){if(_0x2c80ed['error'][_0x6f45('0x11')]===0x1f4){logger[_0x6f45('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5a76af,_0x2c80ed[_0x6f45('0x12')][_0x6f45('0x13')]);return _0x4d7f97(_0x2c80ed[_0x6f45('0x12')]['message']);}logger[_0x6f45('0x12')](_0x6f45('0xc'),_0x5a76af,_0x2c80ed[_0x6f45('0x12')][_0x6f45('0x13')]);return _0x945c21(_0x2c80ed[_0x6f45('0x12')][_0x6f45('0x13')]);}else{logger['info'](_0x6f45('0xc'),_0x5a76af,_0x6f45('0xd'));_0x945c21(_0x2c80ed[_0x6f45('0x14')][_0x6f45('0x13')]);}})[_0x6f45('0x15')](function(_0x1f1183){logger[_0x6f45('0x12')](_0x6f45('0xc'),_0x5a76af,_0x1f1183);_0x4d7f97(_0x1f1183);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index aee5445..e68aa1a 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 _0x79d3=['../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10bbb8,_0x19e2eb){var _0x2026a0=function(_0x36420e){while(--_0x36420e){_0x10bbb8['push'](_0x10bbb8['shift']());}};_0x2026a0(++_0x19e2eb);}(_0x79d3,0x15f));var _0x379d=function(_0x5df59f,_0xf11a72){_0x5df59f=_0x5df59f-0x0;var _0x190e3b=_0x79d3[_0x5df59f];return _0x190e3b;};'use strict';var multer=require(_0x379d('0x0'));var util=require('util');var path=require(_0x379d('0x1'));var timeout=require('connect-timeout');var express=require(_0x379d('0x2'));var router=express[_0x379d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x379d('0x4'));var interaction=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var controller=require(_0x379d('0x7'));router[_0x379d('0x8')]('/',auth[_0x379d('0x9')](),controller[_0x379d('0xa')]);router['get'](_0x379d('0xb'),auth['isAuthenticated'](),controller[_0x379d('0xc')]);router[_0x379d('0xd')]('/',auth[_0x379d('0x9')](),controller['create']);router[_0x379d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x379d('0xf')](_0x379d('0xb'),auth[_0x379d('0x9')](),controller['destroy']);module[_0x379d('0x10')]=router; \ No newline at end of file +var _0x1782=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5a4413,_0x2d2e45){var _0x525a6e=function(_0x4e007f){while(--_0x4e007f){_0x5a4413['push'](_0x5a4413['shift']());}};_0x525a6e(++_0x2d2e45);}(_0x1782,0x13e));var _0x2178=function(_0x1b7fff,_0x5ae168){_0x1b7fff=_0x1b7fff-0x0;var _0x2fa00a=_0x1782[_0x1b7fff];return _0x2fa00a;};'use strict';var multer=require(_0x2178('0x0'));var util=require('util');var path=require(_0x2178('0x1'));var timeout=require(_0x2178('0x2'));var express=require(_0x2178('0x3'));var router=express[_0x2178('0x4')]();var fs_extra=require(_0x2178('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2178('0x6'));var config=require(_0x2178('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0x2178('0x8')](),controller[_0x2178('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2178('0xa')]);router[_0x2178('0xb')]('/',auth[_0x2178('0x8')](),controller[_0x2178('0xc')]);router[_0x2178('0xd')](_0x2178('0xe'),auth['isAuthenticated'](),controller[_0x2178('0xf')]);router[_0x2178('0x10')](_0x2178('0xe'),auth[_0x2178('0x8')](),controller[_0x2178('0x11')]);module[_0x2178('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 2e5cfb8..46b2f5d 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 _0xa215=['name','sequelize','STRING'];(function(_0x4b77a4,_0x238eef){var _0x434550=function(_0x24ae69){while(--_0x24ae69){_0x4b77a4['push'](_0x4b77a4['shift']());}};_0x434550(++_0x238eef);}(_0xa215,0x142));var _0x5a21=function(_0x304fbd,_0x401f58){_0x304fbd=_0x304fbd-0x0;var _0x3a4448=_0xa215[_0x304fbd];return _0x3a4448;};'use strict';var Sequelize=require(_0x5a21('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a21('0x1')],'unique':_0x5a21('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x76ed=['sequelize','exports','name','STRING'];(function(_0x4b2739,_0x252f05){var _0x5d9939=function(_0x46f7f2){while(--_0x46f7f2){_0x4b2739['push'](_0x4b2739['shift']());}};_0x5d9939(++_0x252f05);}(_0x76ed,0x1d0));var _0xd76e=function(_0xc5d219,_0x13aa31){_0xc5d219=_0xc5d219-0x0;var _0x3e5e9a=_0x76ed[_0xc5d219];return _0x3e5e9a;};'use strict';var Sequelize=require(_0xd76e('0x0'));module[_0xd76e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd76e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd76e('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d55be2f..246de03 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 _0x4adc=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Variables','UserProfileResource','destroy','error','name','send','index','map','Variable','rawAttributes','type','model','query'];(function(_0x2e807d,_0x169e7a){var _0x271ff7=function(_0xdf1cf7){while(--_0xdf1cf7){_0x2e807d['push'](_0x2e807d['shift']());}};_0x271ff7(++_0x169e7a);}(_0x4adc,0x1f2));var _0xc4ad=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4adc[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xc4ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4ad('0x1'));var moment=require(_0xc4ad('0x2'));var BPromise=require(_0xc4ad('0x3'));var Mustache=require(_0xc4ad('0x4'));var util=require(_0xc4ad('0x5'));var path=require('path');var sox=require(_0xc4ad('0x6'));var csv=require(_0xc4ad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4ad('0x8'));var _=require(_0xc4ad('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc4ad('0xa'));var toCsv=require(_0xc4ad('0x7'));var querystring=require(_0xc4ad('0xb'));var Papa=require(_0xc4ad('0xc'));var Redis=require('ioredis');var authService=require(_0xc4ad('0xd'));var qs=require(_0xc4ad('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4ad('0xf'));var logger=require('../../config/logger')(_0xc4ad('0x10'));var utils=require(_0xc4ad('0x11'));var config=require(_0xc4ad('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4ad('0x13'))['db'];function respondWithStatusCode(_0x1a9829,_0x4b0463){_0x4b0463=_0x4b0463||0xcc;return function(_0x350801){if(_0x350801){return _0x1a9829[_0xc4ad('0x14')](_0x4b0463);}return _0x1a9829[_0xc4ad('0x15')](_0x4b0463)[_0xc4ad('0x16')]();};}function respondWithResult(_0xf9eb8b,_0xd7d748){_0xd7d748=_0xd7d748||0xc8;return function(_0x3d923f){if(_0x3d923f){return _0xf9eb8b[_0xc4ad('0x15')](_0xd7d748)['json'](_0x3d923f);}};}function respondWithFilteredResult(_0x2cfd93,_0x5b799f){return function(_0x1fe885){if(_0x1fe885){var _0x320e7d=typeof _0x5b799f[_0xc4ad('0x17')]===_0xc4ad('0x18')&&typeof _0x5b799f[_0xc4ad('0x19')]===_0xc4ad('0x18');var _0x44582b=_0x1fe885[_0xc4ad('0x1a')];var _0x2650f4=_0x320e7d?0x0:_0x5b799f[_0xc4ad('0x17')];var _0x38db0f=_0x320e7d?_0x1fe885[_0xc4ad('0x1a')]:_0x5b799f['offset']+_0x5b799f[_0xc4ad('0x19')];var _0x2a2c91;if(_0x38db0f>=_0x44582b){_0x38db0f=_0x44582b;_0x2a2c91=0xc8;}else{_0x2a2c91=0xce;}_0x2cfd93['status'](_0x2a2c91);return _0x2cfd93[_0xc4ad('0x1b')](_0xc4ad('0x1c'),_0x2650f4+'-'+_0x38db0f+'/'+_0x44582b)[_0xc4ad('0x1d')](_0x1fe885);}return null;};}function patchUpdates(_0x7187b9){return function(_0x1dd00a){try{jsonpatch[_0xc4ad('0x1e')](_0x1dd00a,_0x7187b9,!![]);}catch(_0x21894f){return BPromise[_0xc4ad('0x1f')](_0x21894f);}return _0x1dd00a['save']();};}function saveUpdates(_0x2b9278,_0x4ad7ee){return function(_0x455d87){if(_0x455d87){return _0x455d87[_0xc4ad('0x20')](_0x2b9278)[_0xc4ad('0x21')](function(_0x15e432){return _0x15e432;});}return null;};}function removeEntity(_0x5c090f,_0x293b61){return function(_0x5d84b8){if(_0x5d84b8){return _0x5d84b8['destroy']()[_0xc4ad('0x21')](function(){var _0x184990=_0x5d84b8[_0xc4ad('0x22')]({'plain':!![]});var _0x80caa8=_0xc4ad('0x23');return db[_0xc4ad('0x24')][_0xc4ad('0x25')]({'where':{'type':_0x80caa8,'resourceId':_0x184990['id']}})[_0xc4ad('0x21')](function(){return _0x5d84b8;});})[_0xc4ad('0x21')](function(){_0x5c090f[_0xc4ad('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38b1a6,_0x50ff35){return function(_0x3ebada){if(!_0x3ebada){_0x38b1a6[_0xc4ad('0x14')](0x194);}return _0x3ebada;};}function handleError(_0x2d6c05,_0x272965){_0x272965=_0x272965||0x1f4;return function(_0x5ace5e){logger[_0xc4ad('0x26')](_0x5ace5e['stack']);if(_0x5ace5e[_0xc4ad('0x27')]){delete _0x5ace5e[_0xc4ad('0x27')];}_0x2d6c05['status'](_0x272965)[_0xc4ad('0x28')](_0x5ace5e);};}exports[_0xc4ad('0x29')]=function(_0x3d67c5,_0x7200fa){var _0x5427a4={},_0x369d70={},_0x120023={'count':0x0,'rows':[]};var _0x53c892=_[_0xc4ad('0x2a')](db[_0xc4ad('0x2b')][_0xc4ad('0x2c')],function(_0x37b3db){return{'name':_0x37b3db['fieldName'],'type':_0x37b3db[_0xc4ad('0x2d')]['key']};});_0x369d70[_0xc4ad('0x2e')]=_[_0xc4ad('0x2a')](_0x53c892,_0xc4ad('0x27'));_0x369d70[_0xc4ad('0x2f')]=_['keys'](_0x3d67c5[_0xc4ad('0x2f')]);_0x369d70['filters']=_['intersection'](_0x369d70[_0xc4ad('0x2e')],_0x369d70[_0xc4ad('0x2f')]);_0x5427a4['attributes']=_[_0xc4ad('0x30')](_0x369d70[_0xc4ad('0x2e')],qs[_0xc4ad('0x31')](_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x31')]));_0x5427a4[_0xc4ad('0x32')]=_0x5427a4[_0xc4ad('0x32')][_0xc4ad('0x33')]?_0x5427a4['attributes']:_0x369d70[_0xc4ad('0x2e')];if(!_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x34')](_0xc4ad('0x35'))){_0x5427a4[_0xc4ad('0x19')]=qs[_0xc4ad('0x19')](_0x3d67c5['query'][_0xc4ad('0x19')]);_0x5427a4['offset']=qs[_0xc4ad('0x17')](_0x3d67c5['query']['offset']);}_0x5427a4[_0xc4ad('0x36')]=qs['sort'](_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x37')]);_0x5427a4[_0xc4ad('0x38')]=qs[_0xc4ad('0x39')](_[_0xc4ad('0x3a')](_0x3d67c5['query'],_0x369d70[_0xc4ad('0x39')]),_0x53c892);if(_0x3d67c5['query'][_0xc4ad('0x3b')]){_0x5427a4[_0xc4ad('0x38')]=_['merge'](_0x5427a4[_0xc4ad('0x38')],{'$or':_[_0xc4ad('0x2a')](_0x53c892,function(_0x697e83){if(_0x697e83[_0xc4ad('0x2d')]!==_0xc4ad('0x3c')){var _0x57385c={};_0x57385c[_0x697e83['name']]={'$like':'%'+_0x3d67c5[_0xc4ad('0x2f')]['filter']+'%'};return _0x57385c;}})});}_0x5427a4=_[_0xc4ad('0x3d')]({},_0x5427a4,_0x3d67c5[_0xc4ad('0x3e')]);var _0x3d5e3e={'where':_0x5427a4[_0xc4ad('0x38')]};return db['Variable'][_0xc4ad('0x1a')](_0x3d5e3e)[_0xc4ad('0x21')](function(_0x39ae4b){_0x120023[_0xc4ad('0x1a')]=_0x39ae4b;if(_0x3d67c5[_0xc4ad('0x2f')][_0xc4ad('0x3f')]){_0x5427a4[_0xc4ad('0x40')]=[{'all':!![]}];}return db[_0xc4ad('0x2b')][_0xc4ad('0x41')](_0x5427a4);})[_0xc4ad('0x21')](function(_0x36989d){_0x120023['rows']=_0x36989d;return _0x120023;})[_0xc4ad('0x21')](respondWithFilteredResult(_0x7200fa,_0x5427a4))[_0xc4ad('0x42')](handleError(_0x7200fa,null));};exports['show']=function(_0x1ec76f,_0x375d5d){var _0x3f8b69={'raw':!![],'where':{'id':_0x1ec76f[_0xc4ad('0x43')]['id']}},_0x2c31bd={};_0x2c31bd[_0xc4ad('0x2e')]=_[_0xc4ad('0x44')](db[_0xc4ad('0x2b')][_0xc4ad('0x2c')]);_0x2c31bd[_0xc4ad('0x2f')]=_[_0xc4ad('0x44')](_0x1ec76f[_0xc4ad('0x2f')]);_0x2c31bd[_0xc4ad('0x39')]=_[_0xc4ad('0x30')](_0x2c31bd['model'],_0x2c31bd['query']);_0x3f8b69[_0xc4ad('0x32')]=_[_0xc4ad('0x30')](_0x2c31bd[_0xc4ad('0x2e')],qs[_0xc4ad('0x31')](_0x1ec76f[_0xc4ad('0x2f')][_0xc4ad('0x31')]));_0x3f8b69[_0xc4ad('0x32')]=_0x3f8b69[_0xc4ad('0x32')][_0xc4ad('0x33')]?_0x3f8b69[_0xc4ad('0x32')]:_0x2c31bd[_0xc4ad('0x2e')];if(_0x1ec76f[_0xc4ad('0x2f')][_0xc4ad('0x3f')]){_0x3f8b69[_0xc4ad('0x40')]=[{'all':!![]}];}_0x3f8b69=_[_0xc4ad('0x3d')]({},_0x3f8b69,_0x1ec76f[_0xc4ad('0x3e')]);return db[_0xc4ad('0x2b')][_0xc4ad('0x45')](_0x3f8b69)['then'](handleEntityNotFound(_0x375d5d,null))[_0xc4ad('0x21')](respondWithResult(_0x375d5d,null))[_0xc4ad('0x42')](handleError(_0x375d5d,null));};exports['create']=function(_0x178933,_0x5d0ef4){return db[_0xc4ad('0x2b')][_0xc4ad('0x46')](_0x178933[_0xc4ad('0x47')],{})[_0xc4ad('0x21')](function(_0x2b8cfa){var _0x452d4d=_0x178933[_0xc4ad('0x48')][_0xc4ad('0x22')]({'plain':!![]});if(!_0x452d4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x452d4d[_0xc4ad('0x49')]===_0xc4ad('0x48')){var _0x2d90a7=_0x2b8cfa[_0xc4ad('0x22')]({'plain':!![]});var _0x19c83f=_0xc4ad('0x23');return db[_0xc4ad('0x4a')]['find']({'where':{'name':_0x19c83f,'userProfileId':_0x452d4d[_0xc4ad('0x4b')]},'raw':!![]})[_0xc4ad('0x21')](function(_0x560bb8){if(_0x560bb8&&_0x560bb8[_0xc4ad('0x4c')]===0x0){return db[_0xc4ad('0x24')]['create']({'name':_0x2d90a7[_0xc4ad('0x27')],'resourceId':_0x2d90a7['id'],'type':_0x560bb8['name'],'sectionId':_0x560bb8['id']},{})[_0xc4ad('0x21')](function(){return _0x2b8cfa;});}else{return _0x2b8cfa;}})[_0xc4ad('0x42')](function(_0x3f9fc5){logger['error'](_0xc4ad('0x4d'),_0x3f9fc5);throw _0x3f9fc5;});}return _0x2b8cfa;})['then'](respondWithResult(_0x5d0ef4,0xc9))[_0xc4ad('0x42')](handleError(_0x5d0ef4,null));};exports[_0xc4ad('0x20')]=function(_0x93b8e9,_0x4afcef){if(_0x93b8e9[_0xc4ad('0x47')]['id']){delete _0x93b8e9[_0xc4ad('0x47')]['id'];}return db['Variable'][_0xc4ad('0x45')]({'where':{'id':_0x93b8e9[_0xc4ad('0x43')]['id']}})[_0xc4ad('0x21')](handleEntityNotFound(_0x4afcef,null))[_0xc4ad('0x21')](saveUpdates(_0x93b8e9[_0xc4ad('0x47')],null))[_0xc4ad('0x21')](respondWithResult(_0x4afcef,null))[_0xc4ad('0x42')](handleError(_0x4afcef,null));};exports['destroy']=function(_0x106d5,_0x460109){return db[_0xc4ad('0x2b')]['find']({'where':{'id':_0x106d5[_0xc4ad('0x43')]['id']}})[_0xc4ad('0x21')](handleEntityNotFound(_0x460109,null))[_0xc4ad('0x21')](removeEntity(_0x460109,null))[_0xc4ad('0x42')](handleError(_0x460109,null));}; \ No newline at end of file +var _0x4f17=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','VIRTUAL','merge','options','rows','show','params','includeAll','include','catch','create','body','role','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Variables','error','stack','name','map','Variable','rawAttributes'];(function(_0x1a4835,_0x547503){var _0x4f237d=function(_0x3bda0c){while(--_0x3bda0c){_0x1a4835['push'](_0x1a4835['shift']());}};_0x4f237d(++_0x547503);}(_0x4f17,0x1a7));var _0x74f1=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x4f17[_0x22377a];return _0x36f105;};'use strict';var emlformat=require(_0x74f1('0x0'));var rimraf=require(_0x74f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74f1('0x2'));var rp=require(_0x74f1('0x3'));var moment=require(_0x74f1('0x4'));var BPromise=require(_0x74f1('0x5'));var Mustache=require('mustache');var util=require(_0x74f1('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74f1('0x7'));var fs=require('fs');var fs_extra=require(_0x74f1('0x8'));var _=require('lodash');var squel=require(_0x74f1('0x9'));var crypto=require(_0x74f1('0xa'));var jsforce=require(_0x74f1('0xb'));var deskjs=require(_0x74f1('0xc'));var toCsv=require(_0x74f1('0xd'));var querystring=require('querystring');var Papa=require(_0x74f1('0xe'));var Redis=require(_0x74f1('0xf'));var authService=require(_0x74f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x74f1('0x11'));var hardwareService=require(_0x74f1('0x12'));var logger=require('../../config/logger')(_0x74f1('0x13'));var utils=require(_0x74f1('0x14'));var config=require(_0x74f1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53646c,_0x3a345f){_0x3a345f=_0x3a345f||0xcc;return function(_0x2eba5e){if(_0x2eba5e){return _0x53646c[_0x74f1('0x16')](_0x3a345f);}return _0x53646c[_0x74f1('0x17')](_0x3a345f)[_0x74f1('0x18')]();};}function respondWithResult(_0x18e50f,_0x5d82e1){_0x5d82e1=_0x5d82e1||0xc8;return function(_0x5c81fb){if(_0x5c81fb){return _0x18e50f[_0x74f1('0x17')](_0x5d82e1)[_0x74f1('0x19')](_0x5c81fb);}};}function respondWithFilteredResult(_0x496dba,_0x371875){return function(_0x48a2d3){if(_0x48a2d3){var _0x16f0de=typeof _0x371875[_0x74f1('0x1a')]===_0x74f1('0x1b')&&typeof _0x371875[_0x74f1('0x1c')]===_0x74f1('0x1b');var _0x3b113c=_0x48a2d3[_0x74f1('0x1d')];var _0xe4b68a=_0x16f0de?0x0:_0x371875[_0x74f1('0x1a')];var _0x53105b=_0x16f0de?_0x48a2d3[_0x74f1('0x1d')]:_0x371875[_0x74f1('0x1a')]+_0x371875[_0x74f1('0x1c')];var _0x3a814e;if(_0x53105b>=_0x3b113c){_0x53105b=_0x3b113c;_0x3a814e=0xc8;}else{_0x3a814e=0xce;}_0x496dba['status'](_0x3a814e);return _0x496dba[_0x74f1('0x1e')](_0x74f1('0x1f'),_0xe4b68a+'-'+_0x53105b+'/'+_0x3b113c)[_0x74f1('0x19')](_0x48a2d3);}return null;};}function patchUpdates(_0x35c5a4){return function(_0x23ff51){try{jsonpatch[_0x74f1('0x20')](_0x23ff51,_0x35c5a4,!![]);}catch(_0x33ead0){return BPromise[_0x74f1('0x21')](_0x33ead0);}return _0x23ff51['save']();};}function saveUpdates(_0x4d7a7a,_0x20c644){return function(_0x31c458){if(_0x31c458){return _0x31c458[_0x74f1('0x22')](_0x4d7a7a)[_0x74f1('0x23')](function(_0x947202){return _0x947202;});}return null;};}function removeEntity(_0x47a16b,_0x4ab9fa){return function(_0x1e9fa2){if(_0x1e9fa2){return _0x1e9fa2[_0x74f1('0x24')]()[_0x74f1('0x23')](function(){var _0x24961c=_0x1e9fa2[_0x74f1('0x25')]({'plain':!![]});var _0x1e0ad2=_0x74f1('0x26');return db['UserProfileResource'][_0x74f1('0x24')]({'where':{'type':_0x1e0ad2,'resourceId':_0x24961c['id']}})[_0x74f1('0x23')](function(){return _0x1e9fa2;});})[_0x74f1('0x23')](function(){_0x47a16b[_0x74f1('0x17')](0xcc)[_0x74f1('0x18')]();});}};}function handleEntityNotFound(_0x36c95a,_0x393ae1){return function(_0x407b6c){if(!_0x407b6c){_0x36c95a[_0x74f1('0x16')](0x194);}return _0x407b6c;};}function handleError(_0x1db020,_0x53117b){_0x53117b=_0x53117b||0x1f4;return function(_0x5cc97a){logger[_0x74f1('0x27')](_0x5cc97a[_0x74f1('0x28')]);if(_0x5cc97a[_0x74f1('0x29')]){delete _0x5cc97a[_0x74f1('0x29')];}_0x1db020[_0x74f1('0x17')](_0x53117b)['send'](_0x5cc97a);};}exports['index']=function(_0x342581,_0x38b9a2){var _0x524ddd={},_0x2b2659={},_0xe54793={'count':0x0,'rows':[]};var _0x499d07=_[_0x74f1('0x2a')](db[_0x74f1('0x2b')][_0x74f1('0x2c')],function(_0x4ae015){return{'name':_0x4ae015[_0x74f1('0x2d')],'type':_0x4ae015[_0x74f1('0x2e')]['key']};});_0x2b2659[_0x74f1('0x2f')]=_[_0x74f1('0x2a')](_0x499d07,_0x74f1('0x29'));_0x2b2659[_0x74f1('0x30')]=_[_0x74f1('0x31')](_0x342581[_0x74f1('0x30')]);_0x2b2659[_0x74f1('0x32')]=_[_0x74f1('0x33')](_0x2b2659[_0x74f1('0x2f')],_0x2b2659[_0x74f1('0x30')]);_0x524ddd['attributes']=_[_0x74f1('0x33')](_0x2b2659[_0x74f1('0x2f')],qs[_0x74f1('0x34')](_0x342581['query'][_0x74f1('0x34')]));_0x524ddd[_0x74f1('0x35')]=_0x524ddd['attributes'][_0x74f1('0x36')]?_0x524ddd[_0x74f1('0x35')]:_0x2b2659['model'];if(!_0x342581[_0x74f1('0x30')]['hasOwnProperty'](_0x74f1('0x37'))){_0x524ddd[_0x74f1('0x1c')]=qs[_0x74f1('0x1c')](_0x342581[_0x74f1('0x30')][_0x74f1('0x1c')]);_0x524ddd[_0x74f1('0x1a')]=qs['offset'](_0x342581[_0x74f1('0x30')][_0x74f1('0x1a')]);}_0x524ddd[_0x74f1('0x38')]=qs[_0x74f1('0x39')](_0x342581['query'][_0x74f1('0x39')]);_0x524ddd['where']=qs[_0x74f1('0x32')](_[_0x74f1('0x3a')](_0x342581[_0x74f1('0x30')],_0x2b2659[_0x74f1('0x32')]),_0x499d07);if(_0x342581[_0x74f1('0x30')]['filter']){_0x524ddd[_0x74f1('0x3b')]=_['merge'](_0x524ddd[_0x74f1('0x3b')],{'$or':_['map'](_0x499d07,function(_0x168e35){if(_0x168e35['type']!==_0x74f1('0x3c')){var _0x2e2cb8={};_0x2e2cb8[_0x168e35[_0x74f1('0x29')]]={'$like':'%'+_0x342581[_0x74f1('0x30')]['filter']+'%'};return _0x2e2cb8;}})});}_0x524ddd=_[_0x74f1('0x3d')]({},_0x524ddd,_0x342581[_0x74f1('0x3e')]);var _0x46300f={'where':_0x524ddd[_0x74f1('0x3b')]};return db[_0x74f1('0x2b')]['count'](_0x46300f)[_0x74f1('0x23')](function(_0x4d125c){_0xe54793['count']=_0x4d125c;if(_0x342581[_0x74f1('0x30')]['includeAll']){_0x524ddd['include']=[{'all':!![]}];}return db[_0x74f1('0x2b')]['findAll'](_0x524ddd);})['then'](function(_0x7b79d2){_0xe54793[_0x74f1('0x3f')]=_0x7b79d2;return _0xe54793;})[_0x74f1('0x23')](respondWithFilteredResult(_0x38b9a2,_0x524ddd))['catch'](handleError(_0x38b9a2,null));};exports[_0x74f1('0x40')]=function(_0x5ef200,_0x2a4d03){var _0x153986={'raw':!![],'where':{'id':_0x5ef200[_0x74f1('0x41')]['id']}},_0x139789={};_0x139789[_0x74f1('0x2f')]=_[_0x74f1('0x31')](db[_0x74f1('0x2b')][_0x74f1('0x2c')]);_0x139789[_0x74f1('0x30')]=_[_0x74f1('0x31')](_0x5ef200[_0x74f1('0x30')]);_0x139789[_0x74f1('0x32')]=_[_0x74f1('0x33')](_0x139789[_0x74f1('0x2f')],_0x139789[_0x74f1('0x30')]);_0x153986[_0x74f1('0x35')]=_[_0x74f1('0x33')](_0x139789[_0x74f1('0x2f')],qs[_0x74f1('0x34')](_0x5ef200['query'][_0x74f1('0x34')]));_0x153986[_0x74f1('0x35')]=_0x153986[_0x74f1('0x35')][_0x74f1('0x36')]?_0x153986[_0x74f1('0x35')]:_0x139789[_0x74f1('0x2f')];if(_0x5ef200[_0x74f1('0x30')][_0x74f1('0x42')]){_0x153986[_0x74f1('0x43')]=[{'all':!![]}];}_0x153986=_[_0x74f1('0x3d')]({},_0x153986,_0x5ef200[_0x74f1('0x3e')]);return db[_0x74f1('0x2b')]['find'](_0x153986)[_0x74f1('0x23')](handleEntityNotFound(_0x2a4d03,null))[_0x74f1('0x23')](respondWithResult(_0x2a4d03,null))[_0x74f1('0x44')](handleError(_0x2a4d03,null));};exports['create']=function(_0x1dfd4f,_0x585fdc){return db['Variable'][_0x74f1('0x45')](_0x1dfd4f[_0x74f1('0x46')],{})[_0x74f1('0x23')](function(_0x3b2b90){var _0x6d7d43=_0x1dfd4f['user'][_0x74f1('0x25')]({'plain':!![]});if(!_0x6d7d43)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6d7d43[_0x74f1('0x47')]===_0x74f1('0x48')){var _0x3f8791=_0x3b2b90['get']({'plain':!![]});var _0x447415=_0x74f1('0x26');return db['UserProfileSection'][_0x74f1('0x49')]({'where':{'name':_0x447415,'userProfileId':_0x6d7d43[_0x74f1('0x4a')]},'raw':!![]})[_0x74f1('0x23')](function(_0x53333b){if(_0x53333b&&_0x53333b[_0x74f1('0x4b')]===0x0){return db[_0x74f1('0x4c')][_0x74f1('0x45')]({'name':_0x3f8791['name'],'resourceId':_0x3f8791['id'],'type':_0x53333b['name'],'sectionId':_0x53333b['id']},{})['then'](function(){return _0x3b2b90;});}else{return _0x3b2b90;}})['catch'](function(_0x24723c){logger[_0x74f1('0x27')](_0x74f1('0x4d'),_0x24723c);throw _0x24723c;});}return _0x3b2b90;})[_0x74f1('0x23')](respondWithResult(_0x585fdc,0xc9))['catch'](handleError(_0x585fdc,null));};exports[_0x74f1('0x22')]=function(_0xa8e669,_0x4f0cf3){if(_0xa8e669['body']['id']){delete _0xa8e669[_0x74f1('0x46')]['id'];}return db['Variable'][_0x74f1('0x49')]({'where':{'id':_0xa8e669[_0x74f1('0x41')]['id']}})[_0x74f1('0x23')](handleEntityNotFound(_0x4f0cf3,null))[_0x74f1('0x23')](saveUpdates(_0xa8e669[_0x74f1('0x46')],null))[_0x74f1('0x23')](respondWithResult(_0x4f0cf3,null))['catch'](handleError(_0x4f0cf3,null));};exports[_0x74f1('0x24')]=function(_0x568065,_0x476b67){return db[_0x74f1('0x2b')]['find']({'where':{'id':_0x568065[_0x74f1('0x41')]['id']}})[_0x74f1('0x23')](handleEntityNotFound(_0x476b67,null))['then'](removeEntity(_0x476b67,null))[_0x74f1('0x44')](handleError(_0x476b67,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5b6ff81..505d5fa 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 _0x7d75=['../../config/environment','./variable.attributes','exports','define','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d75,0x1bc));var _0x57d7=function(_0x3649c8,_0xccd9ce){_0x3649c8=_0x3649c8-0x0;var _0xafbe3b=_0x7d75[_0x3649c8];return _0xafbe3b;};'use strict';var _=require(_0x57d7('0x0'));var util=require(_0x57d7('0x1'));var logger=require(_0x57d7('0x2'))('api');var moment=require(_0x57d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x57d7('0x4'));var rimraf=require(_0x57d7('0x5'));var config=require(_0x57d7('0x6'));var attributes=require(_0x57d7('0x7'));module[_0x57d7('0x8')]=function(_0x2341a7,_0x33e61a){return _0x2341a7[_0x57d7('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb654=['moment','bluebird','path','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x448772,_0x598ae0){var _0x216e95=function(_0x45a49f){while(--_0x45a49f){_0x448772['push'](_0x448772['shift']());}};_0x216e95(++_0x598ae0);}(_0xb654,0x76));var _0x4b65=function(_0x165146,_0x4d1e16){_0x165146=_0x165146-0x0;var _0x4cbf3d=_0xb654[_0x165146];return _0x4cbf3d;};'use strict';var _=require(_0x4b65('0x0'));var util=require('util');var logger=require(_0x4b65('0x1'))(_0x4b65('0x2'));var moment=require(_0x4b65('0x3'));var BPromise=require(_0x4b65('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b65('0x5'));var rimraf=require('rimraf');var config=require(_0x4b65('0x6'));var attributes=require(_0x4b65('0x7'));module['exports']=function(_0x36bcfb,_0x4c96d3){return _0x36bcfb[_0x4b65('0x8')](_0x4b65('0x9'),attributes,{'tableName':_0x4b65('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 75430d6..f8274d5 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa41a,0x6b));var _0xaa41=function(_0x52363f,_0x33c7e4){_0x52363f=_0x52363f-0x0;var _0x519d77=_0xa41a[_0x52363f];return _0x519d77;};'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);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x3dc307,_0x1e0595){var _0x4f1924=function(_0x31b58c){while(--_0x31b58c){_0x3dc307['push'](_0x3dc307['shift']());}};_0x4f1924(++_0x1e0595);}(_0xf494,0x1c6));var _0x4f49=function(_0x290dc1,_0x27decd){_0x290dc1=_0x290dc1-0x0;var _0x13d597=_0xf494[_0x290dc1];return _0x13d597;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 71944ac..6c29485 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 _0xfac1=['/reset','reset','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x2062bf,_0xef8bc4){var _0x328ee6=function(_0x568ed1){while(--_0x568ed1){_0x2062bf['push'](_0x2062bf['shift']());}};_0x328ee6(++_0xef8bc4);}(_0xfac1,0x1e5));var _0x1fac=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0xfac1[_0x1fc82b];return _0x4c6679;};'use strict';var express=require(_0x1fac('0x0'));var router=express[_0x1fac('0x1')]();var auth=require(_0x1fac('0x2'));var controller=require(_0x1fac('0x3'));router[_0x1fac('0x4')]('/',controller[_0x1fac('0x5')]);router[_0x1fac('0x4')](_0x1fac('0x6'),auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller[_0x1fac('0x9')]);router[_0x1fac('0x4')](_0x1fac('0xa'),auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller[_0x1fac('0xb')]);router[_0x1fac('0x4')]('/pull',auth[_0x1fac('0x7')](),auth[_0x1fac('0x8')](),controller['pull']);router['get']('/restart',auth[_0x1fac('0x7')](),controller[_0x1fac('0xc')]);router[_0x1fac('0x4')](_0x1fac('0xd'),controller['migrations']);module[_0x1fac('0xe')]=router; \ No newline at end of file +var _0x29ea=['Router','../../components/auth/service','./version.controller','index','/fetch','isAuthenticated','canUpdate','fetch','get','reset','pull','/restart','restart','/migrations','exports'];(function(_0x1b8f6f,_0x3dacc0){var _0x15410d=function(_0x1071d1){while(--_0x1071d1){_0x1b8f6f['push'](_0x1b8f6f['shift']());}};_0x15410d(++_0x3dacc0);}(_0x29ea,0x78));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0xa29e('0x0')]();var auth=require(_0xa29e('0x1'));var controller=require(_0xa29e('0x2'));router['get']('/',controller[_0xa29e('0x3')]);router['get'](_0xa29e('0x4'),auth[_0xa29e('0x5')](),auth[_0xa29e('0x6')](),controller[_0xa29e('0x7')]);router[_0xa29e('0x8')]('/reset',auth[_0xa29e('0x5')](),auth[_0xa29e('0x6')](),controller[_0xa29e('0x9')]);router[_0xa29e('0x8')]('/pull',auth[_0xa29e('0x5')](),auth[_0xa29e('0x6')](),controller[_0xa29e('0xa')]);router[_0xa29e('0x8')](_0xa29e('0xb'),auth[_0xa29e('0x5')](),controller[_0xa29e('0xc')]);router[_0xa29e('0x8')](_0xa29e('0xd'),controller['migrations']);module[_0xa29e('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 26d66f9..8b02aea 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 _0xb8e9=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','query','latest','fetch','2.0.0','json','origin','error','status','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','info','pull','restart','motion2'];(function(_0x4aabc1,_0x15e9b0){var _0x302c36=function(_0x5d2280){while(--_0x5d2280){_0x4aabc1['push'](_0x4aabc1['shift']());}};_0x302c36(++_0x15e9b0);}(_0xb8e9,0x133));var _0x9b8e=function(_0x4bdfc6,_0x4c2991){_0x4bdfc6=_0x4bdfc6-0x0;var _0x5091d0=_0xb8e9[_0x4bdfc6];return _0x5091d0;};'use strict';var Umzug=require(_0x9b8e('0x0'));var path=require(_0x9b8e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9b8e('0x2'))(module,_0x9b8e('0x3'));var compareVersions=require(_0x9b8e('0x4'));var exec=require(_0x9b8e('0x5'))['exec'];var db=require(_0x9b8e('0x6'))['db'];var config=require(_0x9b8e('0x7'));var pm2=require(_0x9b8e('0x8'));var logger=require(_0x9b8e('0x9'))('update');var git=require('simple-git')(config[_0x9b8e('0xa')]);exports[_0x9b8e('0xb')]=function(_0x288d85,_0x1975e1){var _0x521068={'current':module[_0x9b8e('0xc')][_0x9b8e('0x3')],'phonebar':0x2};if(_0x288d85[_0x9b8e('0xd')]&&_0x288d85[_0x9b8e('0xd')][_0x9b8e('0xe')]){return git[_0x9b8e('0xf')]()['tags'](function(_0x19db98,_0x530a1c){_0x521068[_0x9b8e('0xe')]=(_0x19db98?module[_0x9b8e('0xc')][_0x9b8e('0x3')]:_0x530a1c[_0x9b8e('0xe')])||_0x9b8e('0x10');return _0x1975e1['status'](0xc8)[_0x9b8e('0x11')](_0x521068);});}else{return _0x1975e1['status'](0xc8)[_0x9b8e('0x11')](_0x521068);}};exports[_0x9b8e('0xf')]=function(_0x39fea8,_0x1d341d){return git[_0x9b8e('0xf')]([_0x9b8e('0x12'),'master'],function(_0x285566){if(_0x285566){logger[_0x9b8e('0x13')](_0x285566);return _0x1d341d[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x285566);}logger['info'](_0x9b8e('0x15'));return _0x1d341d[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':_0x9b8e('0x16')});});};exports['reset']=function(_0x383006,_0x2cbcfe){return git['reset']([_0x9b8e('0x17'),_0x9b8e('0x18')],function(_0x563c20){if(_0x563c20){logger[_0x9b8e('0x13')](_0x563c20);return _0x2cbcfe['status'](0x1f4)[_0x9b8e('0x11')](_0x563c20);}logger[_0x9b8e('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2cbcfe[_0x9b8e('0x14')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x9b8e('0x1a')]=function(_0x29dd30,_0xc83a00){exec('npm\x20install\x20--production',function(_0x1af4d0,_0x560c8e,_0x1bdd1e){logger[_0x9b8e('0x19')](_0x560c8e);logger['info'](_0x1bdd1e);if(_0x1af4d0){logger[_0x9b8e('0x13')](_0x1af4d0);return _0xc83a00[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x1af4d0);}return _0xc83a00['status'](0xc8)[_0x9b8e('0x11')]({'output':_0x560c8e});});};exports[_0x9b8e('0x1b')]=function(_0x11d4fe,_0x460d7f){return pm2[_0x9b8e('0x1b')](_0x9b8e('0x1c'))['then'](function(_0x592bfb){logger[_0x9b8e('0x19')](_0x9b8e('0x1d'),_0x592bfb);return _0x460d7f[_0x9b8e('0x14')](0xc8)['json']({'output':_0x9b8e('0x1e')});})[_0x9b8e('0x1f')](function(_0x5cfcaf){logger[_0x9b8e('0x13')](_0x5cfcaf);return _0x460d7f[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x5cfcaf);});};exports[_0x9b8e('0x20')]=function(_0x56390f,_0x292ddf){var _0x3bdb60=fs['readdirSync'](path[_0x9b8e('0x21')](config[_0x9b8e('0xa')],_0x9b8e('0x22'),_0x9b8e('0x20')));var _0x284f0d=[];for(var _0x2d00e0=0x0;_0x2d00e0<_0x3bdb60[_0x9b8e('0x23')];_0x2d00e0++){var _0x4b8bbc=_0x3bdb60[_0x2d00e0][_0x9b8e('0x24')](_0x9b8e('0x25'),'');if(compareVersions(module[_0x9b8e('0xc')]['version'],_0x4b8bbc)===-0x1){_0x284f0d[_0x9b8e('0x26')](_0x4b8bbc);}}if(_0x284f0d['length']){var _0x21052f=_0x284f0d['sort'](compareVersions);var _0x54c5f0=new Umzug({'storage':_0x9b8e('0x27'),'storageOptions':{'model':db['Migration'],'modelName':_0x9b8e('0x28'),'columnName':_0x9b8e('0x3')},'migrations':{'params':[db[_0x9b8e('0x27')][_0x9b8e('0x29')](),db[_0x9b8e('0x27')][_0x9b8e('0x2a')],function(){throw new Error(_0x9b8e('0x2b'));}],'path':path['join'](config['root'],_0x9b8e('0x22'),_0x9b8e('0x20')),'pattern':/\.js$/}});_0x54c5f0['up']({'migrations':_[_0x9b8e('0x2c')](_0x21052f,function(_0x74bd63){return _0x74bd63+_0x9b8e('0x25');})})['then'](function(){return _0x292ddf[_0x9b8e('0x14')](0xc8)['json']({'output':_0x9b8e('0x2d')+module[_0x9b8e('0xc')][_0x9b8e('0x3')]+_0x9b8e('0x2e')+_['last'](_0x21052f),'migrations':_[_0x9b8e('0x21')](_0x21052f)});})[_0x9b8e('0x1f')](function(_0x375d22){if(_0x375d22 instanceof db['sequelize']['UniqueConstraintError']){return _0x292ddf[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x292ddf[_0x9b8e('0x14')](0x1f4)[_0x9b8e('0x11')](_0x375d22);}});}else{return _0x292ddf[_0x9b8e('0x14')](0xc8)[_0x9b8e('0x11')]({'output':_0x9b8e('0x2f')});}}; \ No newline at end of file +var _0x44a9=['child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','version','query','latest','2.0.0','status','json','fetch','master','error','info','reset','FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','.js','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','compare-versions'];(function(_0x504bbd,_0xfdad3b){var _0x94dc33=function(_0x257544){while(--_0x257544){_0x504bbd['push'](_0x504bbd['shift']());}};_0x94dc33(++_0xfdad3b);}(_0x44a9,0x1ad));var _0x944a=function(_0x211a31,_0x6cb9d2){_0x211a31=_0x211a31-0x0;var _0xf7774d=_0x44a9[_0x211a31];return _0xf7774d;};'use strict';var Umzug=require(_0x944a('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x944a('0x1'))(module,'version');var compareVersions=require(_0x944a('0x2'));var exec=require(_0x944a('0x3'))[_0x944a('0x4')];var db=require(_0x944a('0x5'))['db'];var config=require(_0x944a('0x6'));var pm2=require(_0x944a('0x7'));var logger=require('../../config/logger')(_0x944a('0x8'));var git=require(_0x944a('0x9'))(config[_0x944a('0xa')]);exports[_0x944a('0xb')]=function(_0x3da8fd,_0x3238f5){var _0x10e49b={'current':module[_0x944a('0xc')][_0x944a('0xd')],'phonebar':0x2};if(_0x3da8fd[_0x944a('0xe')]&&_0x3da8fd[_0x944a('0xe')]['latest']){return git['fetch']()['tags'](function(_0xd0857d,_0x35ddd3){_0x10e49b['latest']=(_0xd0857d?module['exports']['version']:_0x35ddd3[_0x944a('0xf')])||_0x944a('0x10');return _0x3238f5[_0x944a('0x11')](0xc8)[_0x944a('0x12')](_0x10e49b);});}else{return _0x3238f5['status'](0xc8)[_0x944a('0x12')](_0x10e49b);}};exports[_0x944a('0x13')]=function(_0x3ef0e4,_0x50b801){return git['fetch'](['origin',_0x944a('0x14')],function(_0xa1445){if(_0xa1445){logger[_0x944a('0x15')](_0xa1445);return _0x50b801['status'](0x1f4)[_0x944a('0x12')](_0xa1445);}logger[_0x944a('0x16')]('git\x20fetch');return _0x50b801[_0x944a('0x11')](0xc8)[_0x944a('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x944a('0x17')]=function(_0x1bd80b,_0x45ad4f){return git['reset'](['--hard',_0x944a('0x18')],function(_0x4f5106){if(_0x4f5106){logger[_0x944a('0x15')](_0x4f5106);return _0x45ad4f[_0x944a('0x11')](0x1f4)['json'](_0x4f5106);}logger[_0x944a('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x45ad4f[_0x944a('0x11')](0xc8)[_0x944a('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x944a('0x19')]=function(_0x454561,_0x1dc21d){exec(_0x944a('0x1a'),function(_0x48759e,_0x5c0f12,_0xbf0bc9){logger[_0x944a('0x16')](_0x5c0f12);logger['info'](_0xbf0bc9);if(_0x48759e){logger[_0x944a('0x15')](_0x48759e);return _0x1dc21d[_0x944a('0x11')](0x1f4)[_0x944a('0x12')](_0x48759e);}return _0x1dc21d[_0x944a('0x11')](0xc8)['json']({'output':_0x5c0f12});});};exports[_0x944a('0x1b')]=function(_0x12f8dc,_0x1d4885){return pm2[_0x944a('0x1b')](_0x944a('0x1c'))[_0x944a('0x1d')](function(_0x4e05ce){logger['info']('pm2\x20restart\x20motion\x20%s',_0x4e05ce);return _0x1d4885['status'](0xc8)[_0x944a('0x12')]({'output':_0x944a('0x1e')});})[_0x944a('0x1f')](function(_0x2bf139){logger[_0x944a('0x15')](_0x2bf139);return _0x1d4885[_0x944a('0x11')](0x1f4)[_0x944a('0x12')](_0x2bf139);});};exports[_0x944a('0x20')]=function(_0x410f95,_0xb2b793){var _0x47944e=fs[_0x944a('0x21')](path[_0x944a('0x22')](config[_0x944a('0xa')],_0x944a('0x23'),_0x944a('0x20')));var _0x4e9be9=[];for(var _0x3427b9=0x0;_0x3427b9<_0x47944e['length'];_0x3427b9++){var _0x508c59=_0x47944e[_0x3427b9]['replace'](_0x944a('0x24'),'');if(compareVersions(module['exports'][_0x944a('0xd')],_0x508c59)===-0x1){_0x4e9be9['push'](_0x508c59);}}if(_0x4e9be9['length']){var _0xdf9d3d=_0x4e9be9[_0x944a('0x25')](compareVersions);var _0x4bc72b=new Umzug({'storage':_0x944a('0x26'),'storageOptions':{'model':db[_0x944a('0x27')],'modelName':_0x944a('0x27'),'columnName':_0x944a('0xd')},'migrations':{'params':[db[_0x944a('0x26')][_0x944a('0x28')](),db[_0x944a('0x26')]['constructor'],function(){throw new Error(_0x944a('0x29'));}],'path':path['join'](config[_0x944a('0xa')],_0x944a('0x23'),_0x944a('0x20')),'pattern':/\.js$/}});_0x4bc72b['up']({'migrations':_[_0x944a('0x2a')](_0xdf9d3d,function(_0x146d04){return _0x146d04+'.js';})})[_0x944a('0x1d')](function(){return _0xb2b793[_0x944a('0x11')](0xc8)['json']({'output':_0x944a('0x2b')+module['exports']['version']+_0x944a('0x2c')+_[_0x944a('0x2d')](_0xdf9d3d),'migrations':_[_0x944a('0x22')](_0xdf9d3d)});})[_0x944a('0x1f')](function(_0x84eae9){if(_0x84eae9 instanceof db[_0x944a('0x26')][_0x944a('0x2e')]){return _0xb2b793[_0x944a('0x11')](0xc8)[_0x944a('0x12')]({'output':_0x944a('0x2f')});}else{return _0xb2b793[_0x944a('0x11')](0x1f4)[_0x944a('0x12')](_0x84eae9);}});}else{return _0xb2b793[_0x944a('0x11')](0xc8)['json']({'output':_0x944a('0x2f')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b6665c1..3cef068 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 _0x89c1=['/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','isAuthenticated','describe'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x89c1,0xef));var _0x189c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x89c1[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x189c('0x0'));var path=require(_0x189c('0x1'));var timeout=require(_0x189c('0x2'));var express=require(_0x189c('0x3'));var router=express[_0x189c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x189c('0x5'));var interaction=require(_0x189c('0x6'));var config=require(_0x189c('0x7'));var controller=require(_0x189c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x189c('0x9')]);router[_0x189c('0xa')]('/describe',auth[_0x189c('0xb')](),controller[_0x189c('0xc')]);router[_0x189c('0xa')](_0x189c('0xd'),auth[_0x189c('0xb')](),controller[_0x189c('0xe')]);router[_0x189c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x189c('0x10')](_0x189c('0xd'),auth['isAuthenticated'](),controller[_0x189c('0x11')]);router[_0x189c('0x12')](_0x189c('0xd'),auth[_0x189c('0xb')](),controller[_0x189c('0x13')]);module[_0x189c('0x14')]=router; \ No newline at end of file +var _0xaa16=['post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x119ae3,_0x287e16){var _0x1d1964=function(_0x52262b){while(--_0x52262b){_0x119ae3['push'](_0x119ae3['shift']());}};_0x1d1964(++_0x287e16);}(_0xaa16,0x85));var _0x6aa1=function(_0x23847d,_0x3be044){_0x23847d=_0x23847d-0x0;var _0x871a33=_0xaa16[_0x23847d];return _0x871a33;};'use strict';var multer=require(_0x6aa1('0x0'));var util=require(_0x6aa1('0x1'));var path=require('path');var timeout=require(_0x6aa1('0x2'));var express=require(_0x6aa1('0x3'));var router=express['Router']();var fs_extra=require(_0x6aa1('0x4'));var auth=require(_0x6aa1('0x5'));var interaction=require(_0x6aa1('0x6'));var config=require('../../config/environment');var controller=require(_0x6aa1('0x7'));router[_0x6aa1('0x8')]('/',auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xa')]);router[_0x6aa1('0x8')](_0x6aa1('0xb'),auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xc')]);router[_0x6aa1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6aa1('0xd')]);router[_0x6aa1('0xe')]('/',auth[_0x6aa1('0x9')](),controller[_0x6aa1('0xf')]);router[_0x6aa1('0x10')](_0x6aa1('0x11'),auth[_0x6aa1('0x9')](),controller['update']);router[_0x6aa1('0x12')](_0x6aa1('0x11'),auth[_0x6aa1('0x9')](),controller[_0x6aa1('0x13')]);module[_0x6aa1('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index f547aa6..639d142 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 _0xac35=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xac35,0x141));var _0x5ac3=function(_0x2e8f23,_0x44090d){_0x2e8f23=_0x2e8f23-0x0;var _0x1f2e52=_0xac35[_0x2e8f23];return _0x1f2e52;};'use strict';var Sequelize=require(_0x5ac3('0x0'));module[_0x5ac3('0x1')]={'type':{'type':Sequelize[_0x5ac3('0x2')]},'uniqueid':{'type':Sequelize[_0x5ac3('0x2')]},'calleridnum':{'type':Sequelize[_0x5ac3('0x2')]},'calleridname':{'type':Sequelize[_0x5ac3('0x2')]},'queue':{'type':Sequelize[_0x5ac3('0x2')]},'interface':{'type':Sequelize[_0x5ac3('0x2')]},'membername':{'type':Sequelize[_0x5ac3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x5ac3('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5ac3('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5ac3('0x5')]},'agentacw':{'type':Sequelize[_0x5ac3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5ac3('0x5')]},'reason':{'type':Sequelize[_0x5ac3('0x2')]},'lastevent':{'type':Sequelize[_0x5ac3('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5ac3('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5ac3('0x2')]},'connectedlinename':{'type':Sequelize[_0x5ac3('0x2')]},'language':{'type':Sequelize[_0x5ac3('0x2')]},'accountcode':{'type':Sequelize[_0x5ac3('0x2')]},'context':{'type':Sequelize[_0x5ac3('0x2')]},'exten':{'type':Sequelize[_0x5ac3('0x2')]},'priority':{'type':Sequelize[_0x5ac3('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5ac3('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5ac3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5ac3('0x2')]},'destcalleridname':{'type':Sequelize[_0x5ac3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5ac3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5ac3('0x2')]},'destlanguage':{'type':Sequelize[_0x5ac3('0x2')]},'destaccountcode':{'type':Sequelize[_0x5ac3('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5ac3('0x2')]},'destuniqueid':{'type':Sequelize[_0x5ac3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5ac3('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5ac3('0x2')],'comment':_0x5ac3('0x6')},'transferexten':{'type':Sequelize[_0x5ac3('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x5ac3('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeaab=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0xeaab,0xd9));var _0xbeaa=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xeaab[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xbeaa('0x0'));module['exports']={'type':{'type':Sequelize[_0xbeaa('0x1')]},'uniqueid':{'type':Sequelize[_0xbeaa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbeaa('0x1')]},'interface':{'type':Sequelize[_0xbeaa('0x1')]},'membername':{'type':Sequelize[_0xbeaa('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbeaa('0x2')]},'agentconnectAt':{'type':Sequelize[_0xbeaa('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xbeaa('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xbeaa('0x2')]},'agentdumpAt':{'type':Sequelize[_0xbeaa('0x2')]},'holdtime':{'type':Sequelize[_0xbeaa('0x3')]},'agentcomplete':{'type':Sequelize[_0xbeaa('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbeaa('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbeaa('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbeaa('0x3')]},'agentacw':{'type':Sequelize[_0xbeaa('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xbeaa('0x1')]},'lastevent':{'type':Sequelize[_0xbeaa('0x1')]},'channel':{'type':Sequelize[_0xbeaa('0x1')]},'channelstate':{'type':Sequelize[_0xbeaa('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbeaa('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbeaa('0x1')]},'connectedlinename':{'type':Sequelize[_0xbeaa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbeaa('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbeaa('0x1')]},'priority':{'type':Sequelize[_0xbeaa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xbeaa('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xbeaa('0x1')]},'destcalleridname':{'type':Sequelize[_0xbeaa('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xbeaa('0x1')]},'destlanguage':{'type':Sequelize[_0xbeaa('0x1')]},'destaccountcode':{'type':Sequelize[_0xbeaa('0x1')]},'destcontext':{'type':Sequelize[_0xbeaa('0x1')]},'destexten':{'type':Sequelize[_0xbeaa('0x1')]},'destpriority':{'type':Sequelize[_0xbeaa('0x1')]},'destuniqueid':{'type':Sequelize[_0xbeaa('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbeaa('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xbeaa('0x1')]},'transfer':{'type':Sequelize[_0xbeaa('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbeaa('0x1')],'comment':_0xbeaa('0x5')},'transferexten':{'type':Sequelize[_0xbeaa('0x1')]},'transferuniqueid':{'type':Sequelize[_0xbeaa('0x1')]},'agententerreason':{'type':Sequelize[_0xbeaa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 1938848..05f85a1 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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 a3e0bb6..ba5b0ff 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 _0xf3cc=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0xf3cc[_0x1314d4];return _0x584ba5;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var logger=require(_0xcf3c('0x2'))(_0xcf3c('0x3'));var moment=require('moment');var BPromise=require(_0xcf3c('0x4'));var rp=require(_0xcf3c('0x5'));var fs=require('fs');var path=require(_0xcf3c('0x6'));var rimraf=require('rimraf');var config=require(_0xcf3c('0x7'));var attributes=require(_0xcf3c('0x8'));module['exports']=function(_0x41f804,_0x2b5cae){return _0x41f804[_0xcf3c('0x9')](_0xcf3c('0xa'),attributes,{'tableName':_0xcf3c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcf3c('0xc'),_0xcf3c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf041=['bluebird','path','../../config/environment','define','VoiceAgentReport','report_agent','uniqueid','../../config/logger','api','moment'];(function(_0x154cbb,_0x43c57f){var _0x494584=function(_0x971bd9){while(--_0x971bd9){_0x154cbb['push'](_0x154cbb['shift']());}};_0x494584(++_0x43c57f);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'paranoid':![],'indexes':[{'fields':[_0x1f04('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index aa13e2c..ada7dc5 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 _0x1d4c=['debug','catch','UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','VoiceAgentReport','create','body','options','CreateVoiceAgentReport'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x1d4c,0x13a));var _0xc1d4=function(_0x139de8,_0x53f05c){_0x139de8=_0x139de8-0x0;var _0x3a0dc4=_0x1d4c[_0x139de8];return _0x3a0dc4;};'use strict';var _=require(_0xc1d4('0x0'));var util=require(_0xc1d4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1d4('0x2'));var db=require(_0xc1d4('0x3'))['db'];var utils=require(_0xc1d4('0x4'));var logger=require(_0xc1d4('0x5'))(_0xc1d4('0x6'));var config=require(_0xc1d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc1d4('0x8')][_0xc1d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31cc00,_0x46dcba,_0x1401f1){return new BPromise(function(_0x671af2,_0x4daf1b){return client[_0xc1d4('0xa')](_0x31cc00,_0x1401f1)[_0xc1d4('0xb')](function(_0x2ad679){logger[_0xc1d4('0xc')](_0xc1d4('0xd'),_0x46dcba,'request\x20sent');logger['debug'](_0xc1d4('0xe'),_0x46dcba,'request\x20sent',JSON[_0xc1d4('0xf')](_0x2ad679));if(_0x2ad679[_0xc1d4('0x10')]){if(_0x2ad679[_0xc1d4('0x10')][_0xc1d4('0x11')]===0x1f4){logger[_0xc1d4('0x10')](_0xc1d4('0xd'),_0x46dcba,_0x2ad679['error'][_0xc1d4('0x12')]);return _0x4daf1b(_0x2ad679['error']['message']);}logger['error'](_0xc1d4('0xd'),_0x46dcba,_0x2ad679['error'][_0xc1d4('0x12')]);return _0x671af2(_0x2ad679[_0xc1d4('0x10')]['message']);}else{logger[_0xc1d4('0xc')](_0xc1d4('0xd'),_0x46dcba,_0xc1d4('0x13'));_0x671af2(_0x2ad679[_0xc1d4('0x14')][_0xc1d4('0x12')]);}})['catch'](function(_0x872d6e){logger[_0xc1d4('0x10')](_0xc1d4('0xd'),_0x46dcba,_0x872d6e);_0x4daf1b(_0x872d6e);});});}exports['CreateVoiceAgentReport']=function(_0x4b3477){var _0x314d6d=this;return new Promise(function(_0x5a413d,_0x30be6e){return db[_0xc1d4('0x15')][_0xc1d4('0x16')](_0x4b3477[_0xc1d4('0x17')],{'raw':_0x4b3477[_0xc1d4('0x18')]?_0x4b3477[_0xc1d4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc1d4('0xb')](function(_0x1aec20){logger['info'](_0xc1d4('0x19'),_0x4b3477);logger[_0xc1d4('0x1a')](_0xc1d4('0x19'),_0x4b3477,JSON[_0xc1d4('0xf')](_0x1aec20));_0x5a413d(_0x1aec20);})[_0xc1d4('0x1b')](function(_0x4802f8){logger[_0xc1d4('0x10')]('CreateVoiceAgentReport',_0x4802f8[_0xc1d4('0x12')],_0x4b3477);_0x30be6e(_0x314d6d[_0xc1d4('0x10')](0x1f4,_0x4802f8[_0xc1d4('0x12')]));});});};exports[_0xc1d4('0x1c')]=function(_0x41dd82){var _0x8bffe4=this;return new Promise(function(_0x5a9251,_0x49fa5e){return db[_0xc1d4('0x15')][_0xc1d4('0x1d')](_0x41dd82[_0xc1d4('0x17')],{'raw':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x1f')]||null:null,'attributes':_0x41dd82['options']?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x20')]||null:null,'limit':_0x41dd82[_0xc1d4('0x18')]?_0x41dd82[_0xc1d4('0x18')][_0xc1d4('0x21')]||null:null})[_0xc1d4('0xb')](function(_0x4f7f7e){logger[_0xc1d4('0xc')](_0xc1d4('0x1c'),_0x41dd82);logger[_0xc1d4('0x1a')](_0xc1d4('0x1c'),_0x41dd82,JSON[_0xc1d4('0xf')](_0x4f7f7e));_0x5a9251(_0x4f7f7e);})[_0xc1d4('0x1b')](function(_0x2aa6f5){logger[_0xc1d4('0x10')](_0xc1d4('0x1c'),_0x2aa6f5[_0xc1d4('0x12')],_0x41dd82);_0x49fa5e(_0x8bffe4[_0xc1d4('0x10')](0x1f4,_0x2aa6f5[_0xc1d4('0x12')]));});});}; \ No newline at end of file +var _0xa46a=['create','body','options','raw','UpdateVoiceAgentReport','update','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x561178,_0x1424f0){var _0x4f3a2e=function(_0x2c5138){while(--_0x2c5138){_0x561178['push'](_0x561178['shift']());}};_0x4f3a2e(++_0x1424f0);}(_0xa46a,0x10c));var _0xaa46=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xa46a[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var util=require(_0xaa46('0x0'));var moment=require('moment');var BPromise=require(_0xaa46('0x1'));var rs=require(_0xaa46('0x2'));var fs=require('fs');var Redis=require(_0xaa46('0x3'));var db=require(_0xaa46('0x4'))['db'];var utils=require(_0xaa46('0x5'));var logger=require(_0xaa46('0x6'))('rpc');var config=require(_0xaa46('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaa46('0x8')][_0xaa46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59ce53,_0x34d2f1,_0x9c7222){return new BPromise(function(_0x34cd07,_0x493e70){return client['request'](_0x59ce53,_0x9c7222)[_0xaa46('0xa')](function(_0x4737e5){logger[_0xaa46('0xb')](_0xaa46('0xc'),_0x34d2f1,'request\x20sent');logger[_0xaa46('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x34d2f1,_0xaa46('0xe'),JSON[_0xaa46('0xf')](_0x4737e5));if(_0x4737e5[_0xaa46('0x10')]){if(_0x4737e5['error']['code']===0x1f4){logger[_0xaa46('0x10')](_0xaa46('0xc'),_0x34d2f1,_0x4737e5[_0xaa46('0x10')][_0xaa46('0x11')]);return _0x493e70(_0x4737e5[_0xaa46('0x10')][_0xaa46('0x11')]);}logger[_0xaa46('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x34d2f1,_0x4737e5['error'][_0xaa46('0x11')]);return _0x34cd07(_0x4737e5['error'][_0xaa46('0x11')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x34d2f1,'request\x20sent');_0x34cd07(_0x4737e5[_0xaa46('0x12')][_0xaa46('0x11')]);}})[_0xaa46('0x13')](function(_0x56fc85){logger[_0xaa46('0x10')](_0xaa46('0xc'),_0x34d2f1,_0x56fc85);_0x493e70(_0x56fc85);});});}exports[_0xaa46('0x14')]=function(_0x44fb8d){var _0x2f3c3a=this;return new Promise(function(_0x6f4ab3,_0x9732e0){return db[_0xaa46('0x15')][_0xaa46('0x16')](_0x44fb8d[_0xaa46('0x17')],{'raw':_0x44fb8d[_0xaa46('0x18')]?_0x44fb8d['options'][_0xaa46('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5d26aa){logger[_0xaa46('0xb')]('CreateVoiceAgentReport',_0x44fb8d);logger[_0xaa46('0xd')](_0xaa46('0x14'),_0x44fb8d,JSON[_0xaa46('0xf')](_0x5d26aa));_0x6f4ab3(_0x5d26aa);})['catch'](function(_0x25d6cd){logger[_0xaa46('0x10')](_0xaa46('0x14'),_0x25d6cd[_0xaa46('0x11')],_0x44fb8d);_0x9732e0(_0x2f3c3a['error'](0x1f4,_0x25d6cd[_0xaa46('0x11')]));});});};exports[_0xaa46('0x1a')]=function(_0x5d1d5a){var _0x374744=this;return new Promise(function(_0x29113b,_0xcbd90e){return db[_0xaa46('0x15')][_0xaa46('0x1b')](_0x5d1d5a['body'],{'raw':_0x5d1d5a[_0xaa46('0x18')]?_0x5d1d5a[_0xaa46('0x18')][_0xaa46('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d1d5a['options']?_0x5d1d5a[_0xaa46('0x18')]['where']||null:null,'attributes':_0x5d1d5a[_0xaa46('0x18')]?_0x5d1d5a[_0xaa46('0x18')][_0xaa46('0x1c')]||null:null,'limit':_0x5d1d5a[_0xaa46('0x18')]?_0x5d1d5a[_0xaa46('0x18')]['limit']||null:null})[_0xaa46('0xa')](function(_0x5067ec){logger[_0xaa46('0xb')](_0xaa46('0x1a'),_0x5d1d5a);logger['debug'](_0xaa46('0x1a'),_0x5d1d5a,JSON[_0xaa46('0xf')](_0x5067ec));_0x29113b(_0x5067ec);})[_0xaa46('0x13')](function(_0x5dd6b6){logger[_0xaa46('0x10')](_0xaa46('0x1a'),_0x5dd6b6[_0xaa46('0x11')],_0x5d1d5a);_0xcbd90e(_0x374744['error'](0x1f4,_0x5dd6b6['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index efe30c3..08d1533 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 _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x339ee7,_0x16f0b8){var _0x4e28b0=function(_0x32b62e){while(--_0x32b62e){_0x339ee7['push'](_0x339ee7['shift']());}};_0x4e28b0(++_0x16f0b8);}(_0x8ef6,0xf2));var _0x68ef=function(_0x30ff41,_0x5116f2){_0x30ff41=_0x30ff41-0x0;var _0x243701=_0x8ef6[_0x30ff41];return _0x243701;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/:id',auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router; \ No newline at end of file +var _0xe107=['/describe','isAuthenticated','describe','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./voiceCallReport.controller','get'];(function(_0x3ff4b5,_0x3d0c5b){var _0x5e1055=function(_0x89bb46){while(--_0x89bb46){_0x3ff4b5['push'](_0x3ff4b5['shift']());}};_0x5e1055(++_0x3d0c5b);}(_0xe107,0xb3));var _0x7e10=function(_0xe32658,_0x1f5740){_0xe32658=_0xe32658-0x0;var _0x1411d6=_0xe107[_0xe32658];return _0x1411d6;};'use strict';var multer=require(_0x7e10('0x0'));var util=require('util');var path=require(_0x7e10('0x1'));var timeout=require(_0x7e10('0x2'));var express=require(_0x7e10('0x3'));var router=express['Router']();var fs_extra=require(_0x7e10('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e10('0x5'));var controller=require(_0x7e10('0x6'));router[_0x7e10('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e10('0x7')](_0x7e10('0x8'),auth[_0x7e10('0x9')](),controller[_0x7e10('0xa')]);router['get']('/:id',auth[_0x7e10('0x9')](),controller['show']);router['post']('/',auth[_0x7e10('0x9')](),controller[_0x7e10('0xb')]);router[_0x7e10('0xc')](_0x7e10('0xd'),auth[_0x7e10('0x9')](),controller['update']);router[_0x7e10('0xe')]('/:id',auth[_0x7e10('0x9')](),controller[_0x7e10('0xf')]);module[_0x7e10('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 60ba154..12188c4 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 _0x4f81=['outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','STRING','inbound','internal'];(function(_0x5137dd,_0x55c6cb){var _0x11dea6=function(_0x290bce){while(--_0x290bce){_0x5137dd['push'](_0x5137dd['shift']());}};_0x11dea6(++_0x55c6cb);}(_0x4f81,0x1e3));var _0x14f8=function(_0x5392a7,_0x3dd841){_0x5392a7=_0x5392a7-0x0;var _0xba6fc4=_0x4f81[_0x5392a7];return _0xba6fc4;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x14f8('0x0')]},'type':{'type':Sequelize['ENUM'](_0x14f8('0x1'),_0x14f8('0x2'),_0x14f8('0x3'),_0x14f8('0x4'),_0x14f8('0x5'),_0x14f8('0x6'))},'tag':{'type':Sequelize[_0x14f8('0x0')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x14f8('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x14f8('0x0')]},'callerid':{'type':Sequelize[_0x14f8('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x14f8('0x0')]},'lastapplication':{'type':Sequelize[_0x14f8('0x0')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x14f8('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x14f8('0x7')]},'duration':{'type':Sequelize[_0x14f8('0x8')]},'billableseconds':{'type':Sequelize[_0x14f8('0x8')]},'mohtime':{'type':Sequelize[_0x14f8('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x14f8('0x0')]},'amaflags':{'type':Sequelize[_0x14f8('0x0')]},'userfield':{'type':Sequelize[_0x14f8('0x0')]},'userDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x14f8('0x0')]},'note':{'type':Sequelize[_0x14f8('0x0')]},'prefix':{'type':Sequelize[_0x14f8('0x0')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x14f8('0x0')]}}; \ No newline at end of file +var _0x5423=['exports','ENUM','inbound','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x17e076,_0xd3924d){_0x17e076=_0x17e076-0x0;var _0x534f58=_0x5423[_0x17e076];return _0x534f58;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3542('0x2')](_0x3542('0x3'),'internal',_0x3542('0x4'),_0x3542('0x5'),_0x3542('0x6'),_0x3542('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3542('0x8')]},'source':{'type':Sequelize[_0x3542('0x8')]},'destination':{'type':Sequelize[_0x3542('0x8')]},'destinationcontext':{'type':Sequelize[_0x3542('0x8')]},'callerid':{'type':Sequelize[_0x3542('0x8')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x3542('0x8')]},'lastdata':{'type':Sequelize[_0x3542('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x3542('0xa')]},'answertime':{'type':Sequelize[_0x3542('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x3542('0xb')]},'billableseconds':{'type':Sequelize[_0x3542('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3542('0x8')]},'amaflags':{'type':Sequelize[_0x3542('0x8')]},'userfield':{'type':Sequelize[_0x3542('0x8')]},'userDisposition':{'type':Sequelize[_0x3542('0x8')]},'userSecondDisposition':{'type':Sequelize[_0x3542('0x8')]},'userThirdDisposition':{'type':Sequelize[_0x3542('0x8')]},'note':{'type':Sequelize[_0x3542('0x8')]},'prefix':{'type':Sequelize[_0x3542('0x8')]},'routeid':{'type':Sequelize[_0x3542('0xb')]},'sipcallid':{'type':Sequelize[_0x3542('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e2a2303..87f6865 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xadb5,0xad));var _0x5adb=function(_0x2fca6d,_0x5d49fc){_0x2fca6d=_0x2fca6d-0x0;var _0x2cca06=_0xadb5[_0x2fca6d];return _0x2cca06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 0e7543f..1d1e81a 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 _0xd60b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0xd60b,0x6f));var _0xbd60=function(_0x126a6a,_0x2b30a4){_0x126a6a=_0x126a6a-0x0;var _0x35f89c=_0xd60b[_0x126a6a];return _0x35f89c;};'use strict';var _=require(_0xbd60('0x0'));var util=require(_0xbd60('0x1'));var logger=require(_0xbd60('0x2'))(_0xbd60('0x3'));var moment=require(_0xbd60('0x4'));var BPromise=require(_0xbd60('0x5'));var rp=require(_0xbd60('0x6'));var fs=require('fs');var path=require(_0xbd60('0x7'));var rimraf=require(_0xbd60('0x8'));var config=require(_0xbd60('0x9'));var attributes=require(_0xbd60('0xa'));module[_0xbd60('0xb')]=function(_0x1ee3f8,_0xe0a9f8){return _0x1ee3f8[_0xbd60('0xc')](_0xbd60('0xd'),attributes,{'tableName':_0xbd60('0xe'),'paranoid':![],'indexes':[{'fields':[_0xbd60('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45d0=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x27bd9b,_0x206238){var _0xbd6219=function(_0x3c1577){while(--_0x3c1577){_0x27bd9b['push'](_0x27bd9b['shift']());}};_0xbd6219(++_0x206238);}(_0x45d0,0x9d));var _0x045d=function(_0x273021,_0x17a307){_0x273021=_0x273021-0x0;var _0x42e495=_0x45d0[_0x273021];return _0x42e495;};'use strict';var _=require(_0x045d('0x0'));var util=require(_0x045d('0x1'));var logger=require(_0x045d('0x2'))(_0x045d('0x3'));var moment=require(_0x045d('0x4'));var BPromise=require(_0x045d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x045d('0x6'));var rimraf=require(_0x045d('0x7'));var config=require(_0x045d('0x8'));var attributes=require(_0x045d('0x9'));module[_0x045d('0xa')]=function(_0x17d2c9,_0x216214){return _0x17d2c9[_0x045d('0xb')](_0x045d('0xc'),attributes,{'tableName':_0x045d('0xd'),'paranoid':![],'indexes':[{'fields':[_0x045d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1b89622..37443ab 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 _0x04fc=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceCallReport','options','raw','where','attributes','include','map','model','catch','GetVoiceCallReport','CreateVoiceCallReport','body','UpdateVoiceCallReport','limit','lodash','util'];(function(_0x4958e4,_0x3119f7){var _0x14d031=function(_0x51fd79){while(--_0x51fd79){_0x4958e4['push'](_0x4958e4['shift']());}};_0x14d031(++_0x3119f7);}(_0x04fc,0x127));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc04f('0x2'));var fs=require('fs');var Redis=require(_0xc04f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc04f('0x4'))(_0xc04f('0x5'));var config=require(_0xc04f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc04f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7d51,_0x2941e1,_0x12d16a){return new BPromise(function(_0x313410,_0x7762d8){return client[_0xc04f('0x8')](_0x3a7d51,_0x12d16a)[_0xc04f('0x9')](function(_0x5ec28f){logger['info'](_0xc04f('0xa'),_0x2941e1,_0xc04f('0xb'));logger[_0xc04f('0xc')](_0xc04f('0xd'),_0x2941e1,'request\x20sent',JSON[_0xc04f('0xe')](_0x5ec28f));if(_0x5ec28f['error']){if(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x10')]===0x1f4){logger[_0xc04f('0xf')](_0xc04f('0xa'),_0x2941e1,_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);return _0x7762d8(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);}logger[_0xc04f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2941e1,_0x5ec28f[_0xc04f('0xf')]['message']);return _0x313410(_0x5ec28f[_0xc04f('0xf')][_0xc04f('0x11')]);}else{logger[_0xc04f('0x12')](_0xc04f('0xa'),_0x2941e1,_0xc04f('0xb'));_0x313410(_0x5ec28f['result'][_0xc04f('0x11')]);}})['catch'](function(_0x45e4d4){logger[_0xc04f('0xf')](_0xc04f('0xa'),_0x2941e1,_0x45e4d4);_0x7762d8(_0x45e4d4);});});}exports['GetVoiceCallReport']=function(_0x25235f){var _0x280548=this;return new Promise(function(_0x3d1c4a,_0x259c1b){return db[_0xc04f('0x13')]['findAll']({'raw':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![],'where':_0x25235f['options']?_0x25235f[_0xc04f('0x14')][_0xc04f('0x16')]||null:null,'attributes':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x17')]||null:null,'limit':_0x25235f[_0xc04f('0x14')]?_0x25235f['options']['limit']||null:null,'include':_0x25235f[_0xc04f('0x14')]?_0x25235f[_0xc04f('0x14')][_0xc04f('0x18')]?_[_0xc04f('0x19')](_0x25235f[_0xc04f('0x14')]['include'],function(_0x3d8ba4){return{'model':db[_0x3d8ba4[_0xc04f('0x1a')]],'as':_0x3d8ba4['as'],'attributes':_0x3d8ba4[_0xc04f('0x17')],'include':_0x3d8ba4[_0xc04f('0x18')]?_['map'](_0x3d8ba4['include'],function(_0x3f4214){return{'model':db[_0x3f4214['model']],'as':_0x3f4214['as'],'attributes':_0x3f4214[_0xc04f('0x17')],'include':_0x3f4214[_0xc04f('0x18')]?_[_0xc04f('0x19')](_0x3f4214[_0xc04f('0x18')],function(_0x1ac70d){return{'model':db[_0x1ac70d['model']],'as':_0x1ac70d['as'],'attributes':_0x1ac70d[_0xc04f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc04f('0x9')](function(_0x337fc7){logger[_0xc04f('0x12')]('GetVoiceCallReport',_0x25235f);logger[_0xc04f('0xc')]('GetVoiceCallReport',_0x25235f,JSON[_0xc04f('0xe')](_0x337fc7));_0x3d1c4a(_0x337fc7);})[_0xc04f('0x1b')](function(_0x51354f){logger[_0xc04f('0xf')](_0xc04f('0x1c'),_0x51354f[_0xc04f('0x11')],_0x25235f);_0x259c1b(_0x280548[_0xc04f('0xf')](0x1f4,_0x51354f[_0xc04f('0x11')]));});});};exports[_0xc04f('0x1d')]=function(_0x34c585){var _0x3f2460=this;return new Promise(function(_0x53da7e,_0x3ccbaa){return db[_0xc04f('0x13')]['create'](_0x34c585[_0xc04f('0x1e')],{'raw':_0x34c585[_0xc04f('0x14')]?_0x34c585[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![]})[_0xc04f('0x9')](function(_0x1afb27){logger[_0xc04f('0x12')](_0xc04f('0x1d'),_0x34c585);logger[_0xc04f('0xc')](_0xc04f('0x1d'),_0x34c585,JSON[_0xc04f('0xe')](_0x1afb27));_0x53da7e(_0x1afb27);})[_0xc04f('0x1b')](function(_0x42ab06){logger['error'](_0xc04f('0x1d'),_0x42ab06[_0xc04f('0x11')],_0x34c585);_0x3ccbaa(_0x3f2460['error'](0x1f4,_0x42ab06[_0xc04f('0x11')]));});});};exports[_0xc04f('0x1f')]=function(_0xbd14d4){var _0x1c6cf6=this;return new Promise(function(_0x29642b,_0x3a3ff3){return db[_0xc04f('0x13')]['update'](_0xbd14d4[_0xc04f('0x1e')],{'raw':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x16')]||null:null,'attributes':_0xbd14d4['options']?_0xbd14d4['options'][_0xc04f('0x17')]||null:null,'limit':_0xbd14d4[_0xc04f('0x14')]?_0xbd14d4[_0xc04f('0x14')][_0xc04f('0x20')]||null:null})[_0xc04f('0x9')](function(_0x4f612a){logger[_0xc04f('0x12')](_0xc04f('0x1f'),_0xbd14d4);logger['debug'](_0xc04f('0x1f'),_0xbd14d4,JSON['stringify'](_0x4f612a));_0x29642b(_0x4f612a);})[_0xc04f('0x1b')](function(_0x22c25c){logger[_0xc04f('0xf')](_0xc04f('0x1f'),_0x22c25c[_0xc04f('0x11')],_0xbd14d4);_0x3a3ff3(_0x1c6cf6[_0xc04f('0xf')](0x1f4,_0x22c25c[_0xc04f('0x11')]));});});}; \ No newline at end of file +var _0xe613=['include','map','model','stringify','VoiceCallReport','create','body','CreateVoiceCallReport','debug','UpdateVoiceCallReport','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit'];(function(_0x2cc32f,_0x3ac293){var _0x1d9ece=function(_0x204d88){while(--_0x204d88){_0x2cc32f['push'](_0x2cc32f['shift']());}};_0x1d9ece(++_0x3ac293);}(_0xe613,0x7d));var _0x3e61=function(_0x5c0f2e,_0x3b57be){_0x5c0f2e=_0x5c0f2e-0x0;var _0x2027e6=_0xe613[_0x5c0f2e];return _0x2027e6;};'use strict';var _=require('lodash');var util=require(_0x3e61('0x0'));var moment=require(_0x3e61('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e61('0x2'));var fs=require('fs');var Redis=require(_0x3e61('0x3'));var db=require(_0x3e61('0x4'))['db'];var utils=require(_0x3e61('0x5'));var logger=require(_0x3e61('0x6'))(_0x3e61('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e61('0x8'));var client=jayson['client'][_0x3e61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x406a29,_0x16a596,_0x57b04e){return new BPromise(function(_0x2c555e,_0x19151f){return client[_0x3e61('0xa')](_0x406a29,_0x57b04e)[_0x3e61('0xb')](function(_0x49088d){logger[_0x3e61('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x16a596,_0x3e61('0xd'));logger['debug'](_0x3e61('0xe'),_0x16a596,_0x3e61('0xd'),JSON['stringify'](_0x49088d));if(_0x49088d[_0x3e61('0xf')]){if(_0x49088d[_0x3e61('0xf')][_0x3e61('0x10')]===0x1f4){logger[_0x3e61('0xf')](_0x3e61('0x11'),_0x16a596,_0x49088d[_0x3e61('0xf')][_0x3e61('0x12')]);return _0x19151f(_0x49088d[_0x3e61('0xf')][_0x3e61('0x12')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x16a596,_0x49088d[_0x3e61('0xf')]['message']);return _0x2c555e(_0x49088d[_0x3e61('0xf')]['message']);}else{logger['info'](_0x3e61('0x11'),_0x16a596,'request\x20sent');_0x2c555e(_0x49088d[_0x3e61('0x13')]['message']);}})[_0x3e61('0x14')](function(_0x1bee90){logger[_0x3e61('0xf')](_0x3e61('0x11'),_0x16a596,_0x1bee90);_0x19151f(_0x1bee90);});});}exports[_0x3e61('0x15')]=function(_0x154a03){var _0xe9a8ff=this;return new Promise(function(_0x4709f9,_0x4002d0){return db['VoiceCallReport'][_0x3e61('0x16')]({'raw':_0x154a03['options']?_0x154a03[_0x3e61('0x17')][_0x3e61('0x18')]===undefined?!![]:![]:!![],'where':_0x154a03[_0x3e61('0x17')]?_0x154a03[_0x3e61('0x17')]['where']||null:null,'attributes':_0x154a03[_0x3e61('0x17')]?_0x154a03[_0x3e61('0x17')][_0x3e61('0x19')]||null:null,'limit':_0x154a03[_0x3e61('0x17')]?_0x154a03[_0x3e61('0x17')][_0x3e61('0x1a')]||null:null,'include':_0x154a03[_0x3e61('0x17')]?_0x154a03[_0x3e61('0x17')][_0x3e61('0x1b')]?_[_0x3e61('0x1c')](_0x154a03['options'][_0x3e61('0x1b')],function(_0x294a5d){return{'model':db[_0x294a5d[_0x3e61('0x1d')]],'as':_0x294a5d['as'],'attributes':_0x294a5d[_0x3e61('0x19')],'include':_0x294a5d[_0x3e61('0x1b')]?_[_0x3e61('0x1c')](_0x294a5d[_0x3e61('0x1b')],function(_0x4c6317){return{'model':db[_0x4c6317[_0x3e61('0x1d')]],'as':_0x4c6317['as'],'attributes':_0x4c6317['attributes'],'include':_0x4c6317[_0x3e61('0x1b')]?_[_0x3e61('0x1c')](_0x4c6317[_0x3e61('0x1b')],function(_0x2f6209){return{'model':db[_0x2f6209['model']],'as':_0x2f6209['as'],'attributes':_0x2f6209[_0x3e61('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3e61('0xb')](function(_0x58b2a3){logger[_0x3e61('0xc')](_0x3e61('0x15'),_0x154a03);logger['debug'](_0x3e61('0x15'),_0x154a03,JSON[_0x3e61('0x1e')](_0x58b2a3));_0x4709f9(_0x58b2a3);})['catch'](function(_0x500953){logger['error']('GetVoiceCallReport',_0x500953[_0x3e61('0x12')],_0x154a03);_0x4002d0(_0xe9a8ff[_0x3e61('0xf')](0x1f4,_0x500953[_0x3e61('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x3b12a9){var _0x5c9760=this;return new Promise(function(_0x1fd5fe,_0x2c8085){return db[_0x3e61('0x1f')][_0x3e61('0x20')](_0x3b12a9[_0x3e61('0x21')],{'raw':_0x3b12a9['options']?_0x3b12a9[_0x3e61('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3e61('0xb')](function(_0x1d76dd){logger['info'](_0x3e61('0x22'),_0x3b12a9);logger[_0x3e61('0x23')](_0x3e61('0x22'),_0x3b12a9,JSON[_0x3e61('0x1e')](_0x1d76dd));_0x1fd5fe(_0x1d76dd);})[_0x3e61('0x14')](function(_0x1dd722){logger[_0x3e61('0xf')]('CreateVoiceCallReport',_0x1dd722[_0x3e61('0x12')],_0x3b12a9);_0x2c8085(_0x5c9760[_0x3e61('0xf')](0x1f4,_0x1dd722['message']));});});};exports[_0x3e61('0x24')]=function(_0x51543e){var _0x247dbd=this;return new Promise(function(_0xc36fc1,_0x1fb2b3){return db[_0x3e61('0x1f')]['update'](_0x51543e[_0x3e61('0x21')],{'raw':_0x51543e[_0x3e61('0x17')]?_0x51543e[_0x3e61('0x17')][_0x3e61('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51543e[_0x3e61('0x17')]?_0x51543e[_0x3e61('0x17')][_0x3e61('0x25')]||null:null,'attributes':_0x51543e[_0x3e61('0x17')]?_0x51543e[_0x3e61('0x17')][_0x3e61('0x19')]||null:null,'limit':_0x51543e[_0x3e61('0x17')]?_0x51543e[_0x3e61('0x17')][_0x3e61('0x1a')]||null:null})[_0x3e61('0xb')](function(_0x1fbe18){logger[_0x3e61('0xc')](_0x3e61('0x24'),_0x51543e);logger[_0x3e61('0x23')]('UpdateVoiceCallReport',_0x51543e,JSON[_0x3e61('0x1e')](_0x1fbe18));_0xc36fc1(_0x1fbe18);})[_0x3e61('0x14')](function(_0x1889e5){logger[_0x3e61('0xf')](_0x3e61('0x24'),_0x1889e5['message'],_0x51543e);_0x1fb2b3(_0x247dbd[_0x3e61('0xf')](0x1f4,_0x1889e5[_0x3e61('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 590d8d6..daae19d 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 _0x2098=['create','put','/:id','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','show','post','isAuthenticated'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x2098,0x1be));var _0x8209=function(_0x130aa0,_0x33e55e){_0x130aa0=_0x130aa0-0x0;var _0x282a25=_0x2098[_0x130aa0];return _0x282a25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8209('0x0'));var timeout=require(_0x8209('0x1'));var express=require(_0x8209('0x2'));var router=express[_0x8209('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8209('0x4'));var interaction=require(_0x8209('0x5'));var config=require(_0x8209('0x6'));var controller=require(_0x8209('0x7'));router[_0x8209('0x8')]('/',auth['isAuthenticated'](),controller[_0x8209('0x9')]);router[_0x8209('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8209('0xa')]);router[_0x8209('0xb')]('/',auth[_0x8209('0xc')](),controller[_0x8209('0xd')]);router[_0x8209('0xe')](_0x8209('0xf'),auth[_0x8209('0xc')](),controller['update']);router['delete'](_0x8209('0xf'),auth['isAuthenticated'](),controller[_0x8209('0x10')]);module['exports']=router; \ No newline at end of file +var _0xee0b=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','post','create','put','update','/:id','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0xd12233,_0x19c37e){var _0x89aefd=function(_0x34c978){while(--_0x34c978){_0xd12233['push'](_0xd12233['shift']());}};_0x89aefd(++_0x19c37e);}(_0xee0b,0x12c));var _0xbee0=function(_0x34b5f8,_0x3a91c0){_0x34b5f8=_0x34b5f8-0x0;var _0xc84b04=_0xee0b[_0x34b5f8];return _0xc84b04;};'use strict';var multer=require(_0xbee0('0x0'));var util=require(_0xbee0('0x1'));var path=require('path');var timeout=require(_0xbee0('0x2'));var express=require('express');var router=express[_0xbee0('0x3')]();var fs_extra=require(_0xbee0('0x4'));var auth=require(_0xbee0('0x5'));var interaction=require(_0xbee0('0x6'));var config=require(_0xbee0('0x7'));var controller=require(_0xbee0('0x8'));router[_0xbee0('0x9')]('/',auth[_0xbee0('0xa')](),controller[_0xbee0('0xb')]);router[_0xbee0('0x9')]('/:id',auth[_0xbee0('0xa')](),controller['show']);router[_0xbee0('0xc')]('/',auth[_0xbee0('0xa')](),controller[_0xbee0('0xd')]);router[_0xbee0('0xe')]('/:id',auth[_0xbee0('0xa')](),controller[_0xbee0('0xf')]);router['delete'](_0xbee0('0x10'),auth[_0xbee0('0xa')](),controller[_0xbee0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ea42250..11752dd 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 _0x9a99=['options','join','getDataValue','split','BOOLEAN','exports','STRING','setDataValue'];(function(_0x253d11,_0x48c682){var _0x1cf554=function(_0x5f2b42){while(--_0x5f2b42){_0x253d11['push'](_0x253d11['shift']());}};_0x1cf554(++_0x48c682);}(_0x9a99,0xf5));var _0x99a9=function(_0x20e9e7,_0x2cbc13){_0x20e9e7=_0x20e9e7-0x0;var _0x183679=_0x9a99[_0x20e9e7];return _0x183679;};'use strict';var Sequelize=require('sequelize');module[_0x99a9('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x99a9('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x10e00c){this[_0x99a9('0x2')](_0x99a9('0x3'),_0x10e00c?_0x10e00c[_0x99a9('0x4')](''):[]);},'get':function(){return this[_0x99a9('0x5')](_0x99a9('0x3'))?this[_0x99a9('0x5')](_0x99a9('0x3'))[_0x99a9('0x6')](''):[];}},'auth':{'type':Sequelize[_0x99a9('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x99a9('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x99a9('0x1')]},'description':{'type':Sequelize[_0x99a9('0x1')]}}; \ No newline at end of file +var _0x9daa=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x5c56d7,_0x584001){var _0x4a6616=function(_0x598b33){while(--_0x598b33){_0x5c56d7['push'](_0x5c56d7['shift']());}};_0x4a6616(++_0x584001);}(_0x9daa,0x16d));var _0xa9da=function(_0x1d981c,_0x5a68ac){_0x1d981c=_0x1d981c-0x0;var _0x3cc0fb=_0x9daa[_0x1d981c];return _0x3cc0fb;};'use strict';var Sequelize=require(_0xa9da('0x0'));module[_0xa9da('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa9da('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xa9da('0x2')],'set':function(_0x41e611){this[_0xa9da('0x3')](_0xa9da('0x4'),_0x41e611?_0x41e611['join'](''):[]);},'get':function(){return this[_0xa9da('0x5')](_0xa9da('0x4'))?this[_0xa9da('0x5')](_0xa9da('0x4'))[_0xa9da('0x6')](''):[];}},'auth':{'type':Sequelize[_0xa9da('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xa9da('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa9da('0x2')]},'description':{'type':Sequelize[_0xa9da('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index bb50624..902dc22 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 _0x4ded=['name','index','map','VoiceChanSpy','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0x4ded,0x116));var _0xd4de=function(_0x456588,_0x49cfef){_0x456588=_0x456588-0x0;var _0x587056=_0x4ded[_0x456588];return _0x587056;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['VoiceChanSpy'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));}; \ No newline at end of file +var _0x03ce=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','VIRTUAL','count','include','rows','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x03ce,0x1a1));var _0xe03c=function(_0x6df2,_0x79c807){_0x6df2=_0x6df2-0x0;var _0x16d6b7=_0x03ce[_0x6df2];return _0x16d6b7;};'use strict';var emlformat=require(_0xe03c('0x0'));var rimraf=require(_0xe03c('0x1'));var zipdir=require(_0xe03c('0x2'));var jsonpatch=require(_0xe03c('0x3'));var rp=require('request-promise');var moment=require(_0xe03c('0x4'));var BPromise=require(_0xe03c('0x5'));var Mustache=require(_0xe03c('0x6'));var util=require('util');var path=require(_0xe03c('0x7'));var sox=require(_0xe03c('0x8'));var csv=require(_0xe03c('0x9'));var ejs=require(_0xe03c('0xa'));var fs=require('fs');var fs_extra=require(_0xe03c('0xb'));var _=require(_0xe03c('0xc'));var squel=require(_0xe03c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe03c('0xe'));var toCsv=require(_0xe03c('0x9'));var querystring=require(_0xe03c('0xf'));var Papa=require(_0xe03c('0x10'));var Redis=require(_0xe03c('0x11'));var authService=require(_0xe03c('0x12'));var qs=require(_0xe03c('0x13'));var as=require(_0xe03c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe03c('0x15'))(_0xe03c('0x16'));var utils=require(_0xe03c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe03c('0x18'));var db=require(_0xe03c('0x19'))['db'];function respondWithStatusCode(_0x4d8249,_0x27838b){_0x27838b=_0x27838b||0xcc;return function(_0x476349){if(_0x476349){return _0x4d8249['sendStatus'](_0x27838b);}return _0x4d8249[_0xe03c('0x1a')](_0x27838b)[_0xe03c('0x1b')]();};}function respondWithResult(_0x25a5e9,_0x4f7139){_0x4f7139=_0x4f7139||0xc8;return function(_0x2ffd1f){if(_0x2ffd1f){return _0x25a5e9[_0xe03c('0x1a')](_0x4f7139)[_0xe03c('0x1c')](_0x2ffd1f);}};}function respondWithFilteredResult(_0x408a8f,_0x417a9e){return function(_0x54b705){if(_0x54b705){var _0x3d6287=typeof _0x417a9e[_0xe03c('0x1d')]==='undefined'&&typeof _0x417a9e[_0xe03c('0x1e')]===_0xe03c('0x1f');var _0x3b3ecc=_0x54b705['count'];var _0x56ec58=_0x3d6287?0x0:_0x417a9e[_0xe03c('0x1d')];var _0x386cb7=_0x3d6287?_0x54b705['count']:_0x417a9e[_0xe03c('0x1d')]+_0x417a9e[_0xe03c('0x1e')];var _0x157882;if(_0x386cb7>=_0x3b3ecc){_0x386cb7=_0x3b3ecc;_0x157882=0xc8;}else{_0x157882=0xce;}_0x408a8f['status'](_0x157882);return _0x408a8f['set'](_0xe03c('0x20'),_0x56ec58+'-'+_0x386cb7+'/'+_0x3b3ecc)[_0xe03c('0x1c')](_0x54b705);}return null;};}function patchUpdates(_0x3bf505){return function(_0x4741ed){try{jsonpatch[_0xe03c('0x21')](_0x4741ed,_0x3bf505,!![]);}catch(_0x3f8564){return BPromise[_0xe03c('0x22')](_0x3f8564);}return _0x4741ed[_0xe03c('0x23')]();};}function saveUpdates(_0x4c9597,_0x1cbf9f){return function(_0x4d5c40){if(_0x4d5c40){return _0x4d5c40[_0xe03c('0x24')](_0x4c9597)[_0xe03c('0x25')](function(_0x3ae889){return _0x3ae889;});}return null;};}function removeEntity(_0x28ac91,_0x3afdea){return function(_0x95a4b3){if(_0x95a4b3){return _0x95a4b3[_0xe03c('0x26')]()['then'](function(){var _0x37c3cb=_0x95a4b3[_0xe03c('0x27')]({'plain':!![]});var _0x353def=_0xe03c('0x28');return db[_0xe03c('0x29')][_0xe03c('0x26')]({'where':{'type':_0x353def,'resourceId':_0x37c3cb['id']}})[_0xe03c('0x25')](function(){return _0x95a4b3;});})[_0xe03c('0x25')](function(){_0x28ac91[_0xe03c('0x1a')](0xcc)[_0xe03c('0x1b')]();});}};}function handleEntityNotFound(_0xc8aecb,_0x234d64){return function(_0x208e0e){if(!_0x208e0e){_0xc8aecb[_0xe03c('0x2a')](0x194);}return _0x208e0e;};}function handleError(_0xbfb6bb,_0x23ad8e){_0x23ad8e=_0x23ad8e||0x1f4;return function(_0x4f475b){logger[_0xe03c('0x2b')](_0x4f475b['stack']);if(_0x4f475b[_0xe03c('0x2c')]){delete _0x4f475b[_0xe03c('0x2c')];}_0xbfb6bb[_0xe03c('0x1a')](_0x23ad8e)[_0xe03c('0x2d')](_0x4f475b);};}exports[_0xe03c('0x2e')]=function(_0x46fb63,_0x136f23){var _0x1a4700={},_0x4d678c={},_0x318197={'count':0x0,'rows':[]};var _0x27e3c8=_[_0xe03c('0x2f')](db[_0xe03c('0x30')][_0xe03c('0x31')],function(_0x4fbabc){return{'name':_0x4fbabc[_0xe03c('0x32')],'type':_0x4fbabc[_0xe03c('0x33')][_0xe03c('0x34')]};});_0x4d678c[_0xe03c('0x35')]=_[_0xe03c('0x2f')](_0x27e3c8,_0xe03c('0x2c'));_0x4d678c[_0xe03c('0x36')]=_[_0xe03c('0x37')](_0x46fb63[_0xe03c('0x36')]);_0x4d678c[_0xe03c('0x38')]=_[_0xe03c('0x39')](_0x4d678c[_0xe03c('0x35')],_0x4d678c[_0xe03c('0x36')]);_0x1a4700[_0xe03c('0x3a')]=_[_0xe03c('0x39')](_0x4d678c[_0xe03c('0x35')],qs[_0xe03c('0x3b')](_0x46fb63['query'][_0xe03c('0x3b')]));_0x1a4700[_0xe03c('0x3a')]=_0x1a4700[_0xe03c('0x3a')][_0xe03c('0x3c')]?_0x1a4700['attributes']:_0x4d678c[_0xe03c('0x35')];if(!_0x46fb63['query']['hasOwnProperty'](_0xe03c('0x3d'))){_0x1a4700[_0xe03c('0x1e')]=qs[_0xe03c('0x1e')](_0x46fb63[_0xe03c('0x36')]['limit']);_0x1a4700[_0xe03c('0x1d')]=qs[_0xe03c('0x1d')](_0x46fb63['query']['offset']);}_0x1a4700['order']=qs['sort'](_0x46fb63[_0xe03c('0x36')]['sort']);_0x1a4700[_0xe03c('0x3e')]=qs['filters'](_['pick'](_0x46fb63[_0xe03c('0x36')],_0x4d678c[_0xe03c('0x38')]),_0x27e3c8);if(_0x46fb63[_0xe03c('0x36')][_0xe03c('0x3f')]){_0x1a4700['where']=_[_0xe03c('0x40')](_0x1a4700['where'],{'$or':_[_0xe03c('0x2f')](_0x27e3c8,function(_0x1d86d7){if(_0x1d86d7[_0xe03c('0x33')]!==_0xe03c('0x41')){var _0x458747={};_0x458747[_0x1d86d7[_0xe03c('0x2c')]]={'$like':'%'+_0x46fb63[_0xe03c('0x36')]['filter']+'%'};return _0x458747;}})});}_0x1a4700=_[_0xe03c('0x40')]({},_0x1a4700,_0x46fb63['options']);var _0x3e8def={'where':_0x1a4700[_0xe03c('0x3e')]};return db[_0xe03c('0x30')][_0xe03c('0x42')](_0x3e8def)[_0xe03c('0x25')](function(_0x1fa14d){_0x318197['count']=_0x1fa14d;if(_0x46fb63['query']['includeAll']){_0x1a4700[_0xe03c('0x43')]=[{'all':!![]}];}return db[_0xe03c('0x30')]['findAll'](_0x1a4700);})[_0xe03c('0x25')](function(_0x43dc4f){_0x318197[_0xe03c('0x44')]=_0x43dc4f;return _0x318197;})[_0xe03c('0x25')](respondWithFilteredResult(_0x136f23,_0x1a4700))['catch'](handleError(_0x136f23,null));};exports[_0xe03c('0x45')]=function(_0x14ed57,_0x34f672){var _0x1a860e={'raw':![],'where':{'id':_0x14ed57[_0xe03c('0x46')]['id']}},_0x40c726={};_0x40c726['model']=_[_0xe03c('0x37')](db[_0xe03c('0x30')][_0xe03c('0x31')]);_0x40c726['query']=_['keys'](_0x14ed57[_0xe03c('0x36')]);_0x40c726['filters']=_['intersection'](_0x40c726[_0xe03c('0x35')],_0x40c726[_0xe03c('0x36')]);_0x1a860e['attributes']=_[_0xe03c('0x39')](_0x40c726[_0xe03c('0x35')],qs[_0xe03c('0x3b')](_0x14ed57[_0xe03c('0x36')]['fields']));_0x1a860e[_0xe03c('0x3a')]=_0x1a860e['attributes'][_0xe03c('0x3c')]?_0x1a860e[_0xe03c('0x3a')]:_0x40c726[_0xe03c('0x35')];if(_0x14ed57[_0xe03c('0x36')]['includeAll']){_0x1a860e[_0xe03c('0x43')]=[{'all':!![]}];}_0x1a860e=_['merge']({},_0x1a860e,_0x14ed57[_0xe03c('0x47')]);return db[_0xe03c('0x30')]['find'](_0x1a860e)[_0xe03c('0x25')](handleEntityNotFound(_0x34f672,null))[_0xe03c('0x25')](respondWithResult(_0x34f672,null))[_0xe03c('0x48')](handleError(_0x34f672,null));};exports[_0xe03c('0x49')]=function(_0x1a5e16,_0x2dfa79){return db[_0xe03c('0x30')][_0xe03c('0x49')](_0x1a5e16[_0xe03c('0x4a')],{})[_0xe03c('0x25')](function(_0x14fa31){var _0x246ae4=_0x1a5e16[_0xe03c('0x4b')][_0xe03c('0x27')]({'plain':!![]});if(!_0x246ae4)throw new Error(_0xe03c('0x4c'));if(_0x246ae4[_0xe03c('0x4d')]==='user'){var _0x14a025=_0x14fa31[_0xe03c('0x27')]({'plain':!![]});var _0x3d73b0=_0xe03c('0x28');return db[_0xe03c('0x4e')][_0xe03c('0x4f')]({'where':{'name':_0x3d73b0,'userProfileId':_0x246ae4[_0xe03c('0x50')]},'raw':!![]})[_0xe03c('0x25')](function(_0x5182ef){if(_0x5182ef&&_0x5182ef[_0xe03c('0x51')]===0x0){return db[_0xe03c('0x29')][_0xe03c('0x49')]({'name':_0x14a025[_0xe03c('0x2c')],'resourceId':_0x14a025['id'],'type':_0x5182ef['name'],'sectionId':_0x5182ef['id']},{})['then'](function(){return _0x14fa31;});}else{return _0x14fa31;}})[_0xe03c('0x48')](function(_0x11c739){logger[_0xe03c('0x2b')](_0xe03c('0x52'),_0x11c739);throw _0x11c739;});}return _0x14fa31;})[_0xe03c('0x25')](respondWithResult(_0x2dfa79,0xc9))[_0xe03c('0x48')](handleError(_0x2dfa79,null));};exports[_0xe03c('0x24')]=function(_0x14fa77,_0x49449c){if(_0x14fa77[_0xe03c('0x4a')]['id']){delete _0x14fa77[_0xe03c('0x4a')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x14fa77[_0xe03c('0x46')]['id']}})[_0xe03c('0x25')](handleEntityNotFound(_0x49449c,null))['then'](saveUpdates(_0x14fa77['body'],null))[_0xe03c('0x25')](respondWithResult(_0x49449c,null))[_0xe03c('0x48')](handleError(_0x49449c,null));};exports['destroy']=function(_0x50bd51,_0xfc70b1){return db[_0xe03c('0x30')]['find']({'where':{'id':_0x50bd51['params']['id']}})['then'](handleEntityNotFound(_0xfc70b1,null))[_0xe03c('0x25')](removeEntity(_0xfc70b1,null))[_0xe03c('0x48')](handleError(_0xfc70b1,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 63d9667..ababd84 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 _0x5e15=['lodash','util','bluebird','./voiceChanSpy.attributes','context','prefix','system','push','merge','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','findAll','agent','then','catch','exports','define','voice_chanspy','length','VoiceExtension','bulkCreate','destroy'];(function(_0x5957f2,_0x193f34){var _0x1ea23a=function(_0x522709){while(--_0x522709){_0x5957f2['push'](_0x5957f2['shift']());}};_0x1ea23a(++_0x193f34);}(_0x5e15,0x103));var _0x55e1=function(_0x3f17b7,_0x1e5b9a){_0x3f17b7=_0x3f17b7-0x0;var _0x31dded=_0x5e15[_0x3f17b7];return _0x31dded;};'use strict';var _=require(_0x55e1('0x0'));var util=require(_0x55e1('0x1'));var BPromise=require(_0x55e1('0x2'));var attributes=require(_0x55e1('0x3'));var getUserApplications=function(_0x3d2b3b,_0x4d9839,_0x53cdcc){var _0x548a79=0x1;var _0x38dd0c=[];var _0x109113={'context':_0x4d9839[_0x55e1('0x4')]||'from-sip','exten':util['format']('%s%s',_0x3d2b3b[_0x55e1('0x5')],_0x53cdcc),'type':_0x55e1('0x6'),'isApp':![],'ChanSpyId':_0x3d2b3b['id'],'UserId':_0x4d9839['id']};_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':'Set','appdata':util[_0x55e1('0x9')](_0x55e1('0xa'),_0x55e1('0xb')),'priority':_0x548a79++},_0x109113));if(_0x3d2b3b[_0x55e1('0xc')]){_0x38dd0c['push'](_[_0x55e1('0x8')]({'app':'MixMonitor','appdata':util[_0x55e1('0x9')](_0x55e1('0xd'),_0x3d2b3b[_0x55e1('0xe')]),'priority':_0x548a79++},_0x109113));}if(_0x3d2b3b[_0x55e1('0xf')]){_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':_0x55e1('0x10'),'appdata':_0x3d2b3b[_0x55e1('0x11')],'priority':_0x548a79++},_0x109113));}_0x38dd0c['push'](_['merge']({'app':_0x55e1('0x12'),'appdata':util[_0x55e1('0x9')](_0x55e1('0x13'),_0x4d9839[_0x55e1('0x14')],_0x3d2b3b[_0x55e1('0x15')]?_0x3d2b3b['options'][_0x55e1('0x16')](''):''),'priority':_0x548a79++},_0x109113));if(_0x3d2b3b['record']){_0x38dd0c[_0x55e1('0x7')](_[_0x55e1('0x8')]({'app':_0x55e1('0x17'),'priority':_0x548a79++},_0x109113));}return _0x38dd0c;};var getChanSpyApplications=function(_0xc679d5,_0x1fd248){var _0x567761=[];for(var _0x180cdf=0x0,_0x4411f4=0x1;_0x180cdf<_0x1fd248['length'];_0x180cdf++,_0x4411f4=0x1){_0x567761=_0x567761[_0x55e1('0x18')](getUserApplications(_0xc679d5,_0x1fd248[_0x180cdf],_0x1fd248[_0x180cdf][_0x55e1('0x19')]));if(_0x1fd248[_0x180cdf][_0x55e1('0x19')]!=_0x1fd248[_0x180cdf][_0x55e1('0x14')]){_0x567761=_0x567761[_0x55e1('0x18')](getUserApplications(_0xc679d5,_0x1fd248[_0x180cdf],_0x1fd248[_0x180cdf]['name']));}}return _0x567761;};var getChanSpyPromise=function(_0x45e288,_0x55709a){return new BPromise(function(_0x20ef2c,_0x4103b3){return _0x45e288['User'][_0x55e1('0x1a')]({'attributes':['id',_0x55e1('0x14'),_0x55e1('0x19')],'where':{'role':_0x55e1('0x1b'),'chanspy':!![]},'raw':!![]})[_0x55e1('0x1c')](function(_0x5f498c){if(_0x5f498c){return _0x20ef2c(getChanSpyApplications(_0x55709a,_0x5f498c));}return _0x20ef2c([]);})[_0x55e1('0x1d')](function(_0x57398f){_0x4103b3(_0x57398f);});});};module[_0x55e1('0x1e')]=function(_0xc66d01,_0x59bb9f){var _0x83d49e=_0xc66d01['models'];return _0xc66d01[_0x55e1('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x55e1('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x50d190,_0x393bd0,_0x815c77){return getChanSpyPromise(_0x83d49e,_0x50d190)[_0x55e1('0x1c')](function(_0x222460){if(_0x222460&&_0x222460[_0x55e1('0x21')]){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x23')](_0x222460);}})[_0x55e1('0x1c')](function(){_0x815c77();})[_0x55e1('0x1d')](function(_0x85c284){_0x815c77(_0x85c284);});},'afterUpdate':function(_0x586f25,_0x2fe7f1,_0x2c4881){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x24')]({'where':{'ChanSpyId':_0x586f25['id']}})[_0x55e1('0x1c')](function(){return getChanSpyPromise(_0x83d49e,_0x586f25);})['then'](function(_0x52d3c8){if(_0x52d3c8&&_0x52d3c8[_0x55e1('0x21')]){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x23')](_0x52d3c8);}})[_0x55e1('0x1c')](function(){_0x2c4881();})['catch'](function(_0x5d3787){_0x2c4881(_0x5d3787);});},'afterDestroy':function(_0x32a7b7,_0x5e13d0,_0x372e41){return _0x83d49e[_0x55e1('0x22')][_0x55e1('0x24')]({'where':{'ChanSpyId':_0x32a7b7['id']}})['then'](function(){_0x372e41();})['catch'](function(_0x2c9cec){_0x372e41(_0x2c9cec);});}}});}; \ No newline at end of file +var _0x4131=['models','VoiceChanSpy','then','bulkCreate','VoiceExtension','destroy','catch','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','name','options','join','StopMixMonitor','length','internal','concat','findAll','agent','exports'];(function(_0x2f634a,_0x3c080a){var _0x3ab3a0=function(_0x14ad7c){while(--_0x14ad7c){_0x2f634a['push'](_0x2f634a['shift']());}};_0x3ab3a0(++_0x3c080a);}(_0x4131,0x73));var _0x1413=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x4131[_0x2abaae];return _0x5b5745;};'use strict';var _=require('lodash');var util=require(_0x1413('0x0'));var BPromise=require(_0x1413('0x1'));var attributes=require(_0x1413('0x2'));var getUserApplications=function(_0x172d1a,_0x54531e,_0x310b2d){var _0x41d046=0x1;var _0x637867=[];var _0x4476bf={'context':_0x54531e[_0x1413('0x3')]||_0x1413('0x4'),'exten':util[_0x1413('0x5')](_0x1413('0x6'),_0x172d1a[_0x1413('0x7')],_0x310b2d),'type':_0x1413('0x8'),'isApp':![],'ChanSpyId':_0x172d1a['id'],'UserId':_0x54531e['id']};_0x637867[_0x1413('0x9')](_[_0x1413('0xa')]({'app':'Set','appdata':util[_0x1413('0x5')](_0x1413('0xb'),_0x1413('0xc')),'priority':_0x41d046++},_0x4476bf));if(_0x172d1a[_0x1413('0xd')]){_0x637867[_0x1413('0x9')](_[_0x1413('0xa')]({'app':'MixMonitor','appdata':util[_0x1413('0x5')](_0x1413('0xe'),_0x172d1a[_0x1413('0xf')]),'priority':_0x41d046++},_0x4476bf));}if(_0x172d1a[_0x1413('0x10')]){_0x637867[_0x1413('0x9')](_[_0x1413('0xa')]({'app':_0x1413('0x11'),'appdata':_0x172d1a[_0x1413('0x12')],'priority':_0x41d046++},_0x4476bf));}_0x637867[_0x1413('0x9')](_[_0x1413('0xa')]({'app':'ChanSpy','appdata':util[_0x1413('0x5')]('SIP/%s,%s',_0x54531e[_0x1413('0x13')],_0x172d1a[_0x1413('0x14')]?_0x172d1a[_0x1413('0x14')][_0x1413('0x15')](''):''),'priority':_0x41d046++},_0x4476bf));if(_0x172d1a[_0x1413('0xd')]){_0x637867[_0x1413('0x9')](_[_0x1413('0xa')]({'app':_0x1413('0x16'),'priority':_0x41d046++},_0x4476bf));}return _0x637867;};var getChanSpyApplications=function(_0x38f2e3,_0x41245d){var _0x3e6f6a=[];for(var _0x324746=0x0,_0x506cbb=0x1;_0x324746<_0x41245d[_0x1413('0x17')];_0x324746++,_0x506cbb=0x1){_0x3e6f6a=_0x3e6f6a['concat'](getUserApplications(_0x38f2e3,_0x41245d[_0x324746],_0x41245d[_0x324746][_0x1413('0x18')]));if(_0x41245d[_0x324746]['internal']!=_0x41245d[_0x324746][_0x1413('0x13')]){_0x3e6f6a=_0x3e6f6a[_0x1413('0x19')](getUserApplications(_0x38f2e3,_0x41245d[_0x324746],_0x41245d[_0x324746][_0x1413('0x13')]));}}return _0x3e6f6a;};var getChanSpyPromise=function(_0xd147c8,_0x415ffb){return new BPromise(function(_0x354d2f,_0x38bba){return _0xd147c8['User'][_0x1413('0x1a')]({'attributes':['id',_0x1413('0x13'),_0x1413('0x18')],'where':{'role':_0x1413('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3e7af0){if(_0x3e7af0){return _0x354d2f(getChanSpyApplications(_0x415ffb,_0x3e7af0));}return _0x354d2f([]);})['catch'](function(_0x14149e){_0x38bba(_0x14149e);});});};module[_0x1413('0x1c')]=function(_0x1ce1d6,_0x1a1c1a){var _0x409555=_0x1ce1d6[_0x1413('0x1d')];return _0x1ce1d6['define'](_0x1413('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x358bef,_0x5d110b,_0x4ed6cf){return getChanSpyPromise(_0x409555,_0x358bef)[_0x1413('0x1f')](function(_0x13075b){if(_0x13075b&&_0x13075b['length']){return _0x409555['VoiceExtension'][_0x1413('0x20')](_0x13075b);}})[_0x1413('0x1f')](function(){_0x4ed6cf();})['catch'](function(_0xd3ad3d){_0x4ed6cf(_0xd3ad3d);});},'afterUpdate':function(_0x37f21e,_0x40bf0b,_0x527651){return _0x409555[_0x1413('0x21')][_0x1413('0x22')]({'where':{'ChanSpyId':_0x37f21e['id']}})[_0x1413('0x1f')](function(){return getChanSpyPromise(_0x409555,_0x37f21e);})['then'](function(_0x116675){if(_0x116675&&_0x116675['length']){return _0x409555[_0x1413('0x21')]['bulkCreate'](_0x116675);}})[_0x1413('0x1f')](function(){_0x527651();})[_0x1413('0x23')](function(_0x4d7843){_0x527651(_0x4d7843);});},'afterDestroy':function(_0x3635e0,_0xd9307a,_0x4c1f9b){return _0x409555[_0x1413('0x21')][_0x1413('0x22')]({'where':{'ChanSpyId':_0x3635e0['id']}})['then'](function(){_0x4c1f9b();})[_0x1413('0x23')](function(_0x5836ff){_0x4c1f9b(_0x5836ff);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 64fd4a5..a2e8213 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 _0x6b20=['request','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f8e30,_0x2c65b5){var _0x33381c=function(_0x3e0db2){while(--_0x3e0db2){_0x3f8e30['push'](_0x3f8e30['shift']());}};_0x33381c(++_0x2c65b5);}(_0x6b20,0xd1));var _0x06b2=function(_0x3e3ba1,_0x28e378){_0x3e3ba1=_0x3e3ba1-0x0;var _0x5eab6e=_0x6b20[_0x3e3ba1];return _0x5eab6e;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});} \ No newline at end of file +var _0x9e0d=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x2c644e,_0x310a75){_0x2c644e=_0x2c644e-0x0;var _0x7a1a9d=_0x9e0d[_0x2c644e];return _0x7a1a9d;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index d2179c2..0fd6e77 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 _0xed2a=['fs-extra','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','util','path','Router'];(function(_0x127518,_0x1871cb){var _0x255ef6=function(_0x3d36a3){while(--_0x3d36a3){_0x127518['push'](_0x127518['shift']());}};_0x255ef6(++_0x1871cb);}(_0xed2a,0x1cd));var _0xaed2=function(_0x4fd752,_0x136358){_0x4fd752=_0x4fd752-0x0;var _0x2fb574=_0xed2a[_0x4fd752];return _0x2fb574;};'use strict';var multer=require('multer');var util=require(_0xaed2('0x0'));var path=require(_0xaed2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaed2('0x2')]();var fs_extra=require(_0xaed2('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaed2('0x4'));var controller=require(_0xaed2('0x5'));router[_0xaed2('0x6')]('/',auth[_0xaed2('0x7')](),controller[_0xaed2('0x8')]);router['get']('/:id',auth[_0xaed2('0x7')](),controller[_0xaed2('0x9')]);router[_0xaed2('0xa')]('/',auth[_0xaed2('0x7')](),controller['create']);router[_0xaed2('0xb')](_0xaed2('0xc'),auth[_0xaed2('0x7')](),controller[_0xaed2('0xd')]);router[_0xaed2('0xe')](_0xaed2('0xc'),auth[_0xaed2('0x7')](),controller['destroy']);module[_0xaed2('0xf')]=router; \ No newline at end of file +var _0x7adb=['Router','fs-extra','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7adb,0xdf));var _0xb7ad=function(_0x9bf256,_0x453370){_0x9bf256=_0x9bf256-0x0;var _0x23b80b=_0x7adb[_0x9bf256];return _0x23b80b;};'use strict';var multer=require(_0xb7ad('0x0'));var util=require(_0xb7ad('0x1'));var path=require(_0xb7ad('0x2'));var timeout=require(_0xb7ad('0x3'));var express=require(_0xb7ad('0x4'));var router=express[_0xb7ad('0x5')]();var fs_extra=require(_0xb7ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb7ad('0x7'));var config=require('../../config/environment');var controller=require(_0xb7ad('0x8'));router[_0xb7ad('0x9')]('/',auth[_0xb7ad('0xa')](),controller['index']);router['get']('/:id',auth[_0xb7ad('0xa')](),controller[_0xb7ad('0xb')]);router[_0xb7ad('0xc')]('/',auth[_0xb7ad('0xa')](),controller[_0xb7ad('0xd')]);router['put'](_0xb7ad('0xe'),auth[_0xb7ad('0xa')](),controller[_0xb7ad('0xf')]);router[_0xb7ad('0x10')](_0xb7ad('0xe'),auth[_0xb7ad('0xa')](),controller[_0xb7ad('0x11')]);module[_0xb7ad('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 5c11cd7..e0592d7 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 _0x4d88=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x1ee1d4,_0x425984){var _0x128ccc=function(_0x2e1efb){while(--_0x2e1efb){_0x1ee1d4['push'](_0x1ee1d4['shift']());}};_0x128ccc(++_0x425984);}(_0x4d88,0x195));var _0x84d8=function(_0x1474bb,_0x486735){_0x1474bb=_0x1474bb-0x0;var _0x1cea7c=_0x4d88[_0x1474bb];return _0x1cea7c;};'use strict';var Sequelize=require(_0x84d8('0x0'));module[_0x84d8('0x1')]={'name':{'type':Sequelize[_0x84d8('0x2')],'unique':_0x84d8('0x3')},'description':{'type':Sequelize[_0x84d8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x84d8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a74=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x4c49c0,_0x4adb76){var _0x596b70=function(_0x292c6b){while(--_0x292c6b){_0x4c49c0['push'](_0x4c49c0['shift']());}};_0x596b70(++_0x4adb76);}(_0x8a74,0xe3));var _0x48a7=function(_0x3787e0,_0x21518f){_0x3787e0=_0x3787e0-0x0;var _0x17acdb=_0x8a74[_0x3787e0];return _0x17acdb;};'use strict';var Sequelize=require(_0x48a7('0x0'));module[_0x48a7('0x1')]={'name':{'type':Sequelize[_0x48a7('0x2')],'unique':_0x48a7('0x3')},'description':{'type':Sequelize[_0x48a7('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x48a7('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 9f2d000..fa15de9 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 _0x89a4=['filters','pick','merge','VIRTUAL','filter','include','findAll','rows','show','options','find','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','chan_sip.so','eml-format','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where'];(function(_0x214ffc,_0x430a6d){var _0x366bbf=function(_0x243368){while(--_0x243368){_0x214ffc['push'](_0x214ffc['shift']());}};_0x366bbf(++_0x430a6d);}(_0x89a4,0xe6));var _0x489a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89a4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x489a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x489a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x489a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x489a('0x3'));var util=require(_0x489a('0x4'));var path=require(_0x489a('0x5'));var sox=require('sox');var csv=require(_0x489a('0x6'));var ejs=require(_0x489a('0x7'));var fs=require('fs');var fs_extra=require(_0x489a('0x8'));var _=require(_0x489a('0x9'));var squel=require('squel');var crypto=require(_0x489a('0xa'));var jsforce=require(_0x489a('0xb'));var deskjs=require(_0x489a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x489a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x489a('0xe'));var as=require(_0x489a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x489a('0x10'))(_0x489a('0x11'));var utils=require(_0x489a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x489a('0x13'));var db=require(_0x489a('0x14'))['db'];var jayson=require(_0x489a('0x15'));var client=jayson[_0x489a('0x16')][_0x489a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x114af2,_0x550c8b,_0x226aa3,_0x55e287){return new BPromise(function(_0x2a0202,_0x5f00ff){var _0x12da41=_0x55e287||client;return _0x12da41[_0x489a('0x18')](_0x114af2,_0x226aa3)[_0x489a('0x19')](function(_0xdf5325){logger[_0x489a('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x550c8b,_0x489a('0x1b'));logger[_0x489a('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x550c8b,'request\x20sent',JSON['stringify'](_0xdf5325));if(_0xdf5325[_0x489a('0x1d')]){if(_0xdf5325[_0x489a('0x1d')][_0x489a('0x1e')]===0x1f4){logger[_0x489a('0x1d')](_0x489a('0x1f'),_0x550c8b,_0xdf5325[_0x489a('0x1d')]['message']);return _0x5f00ff(_0xdf5325[_0x489a('0x1d')]['message']);}logger[_0x489a('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x550c8b,_0xdf5325['error'][_0x489a('0x20')]);return _0x2a0202(_0xdf5325[_0x489a('0x1d')][_0x489a('0x20')]);}else{logger[_0x489a('0x1a')](_0x489a('0x1f'),_0x550c8b,_0x489a('0x1b'));_0x2a0202(_0xdf5325[_0x489a('0x21')][_0x489a('0x20')]);}})[_0x489a('0x22')](function(_0x217e41){logger[_0x489a('0x1d')](_0x489a('0x1f'),_0x550c8b,_0x217e41);_0x5f00ff(_0x217e41);});});}function respondWithStatusCode(_0x571a71,_0x5dfbd9){_0x5dfbd9=_0x5dfbd9||0xcc;return function(_0x2b5357){if(_0x2b5357){return _0x571a71[_0x489a('0x23')](_0x5dfbd9);}return _0x571a71[_0x489a('0x24')](_0x5dfbd9)['end']();};}function respondWithResult(_0x2f1621,_0x362dab){_0x362dab=_0x362dab||0xc8;return function(_0x49aebe){if(_0x49aebe){return _0x2f1621['status'](_0x362dab)['json'](_0x49aebe);}};}function respondWithFilteredResult(_0x345d01,_0x18340c){return function(_0xab23a2){if(_0xab23a2){var _0x310713=typeof _0x18340c[_0x489a('0x25')]===_0x489a('0x26')&&typeof _0x18340c['limit']==='undefined';var _0x6955ca=_0xab23a2[_0x489a('0x27')];var _0xb9b770=_0x310713?0x0:_0x18340c['offset'];var _0x34689e=_0x310713?_0xab23a2[_0x489a('0x27')]:_0x18340c[_0x489a('0x25')]+_0x18340c[_0x489a('0x28')];var _0x181820;if(_0x34689e>=_0x6955ca){_0x34689e=_0x6955ca;_0x181820=0xc8;}else{_0x181820=0xce;}_0x345d01[_0x489a('0x24')](_0x181820);return _0x345d01[_0x489a('0x29')](_0x489a('0x2a'),_0xb9b770+'-'+_0x34689e+'/'+_0x6955ca)[_0x489a('0x2b')](_0xab23a2);}return null;};}function patchUpdates(_0x195583){return function(_0x475326){try{jsonpatch['apply'](_0x475326,_0x195583,!![]);}catch(_0x5c8e88){return BPromise[_0x489a('0x2c')](_0x5c8e88);}return _0x475326[_0x489a('0x2d')]();};}function saveUpdates(_0x3fbbd6,_0x55fb19){return function(_0x7b50f1){if(_0x7b50f1){return _0x7b50f1[_0x489a('0x2e')](_0x3fbbd6)['then'](function(_0x4286ad){return _0x4286ad;});}return null;};}function removeEntity(_0x38cba6,_0x8027f7){return function(_0x4d4ae9){if(_0x4d4ae9){return _0x4d4ae9[_0x489a('0x2f')]()[_0x489a('0x19')](function(){var _0x4ccf90=_0x4d4ae9[_0x489a('0x30')]({'plain':!![]});var _0x39532a=_0x489a('0x31');return db[_0x489a('0x32')]['destroy']({'where':{'type':_0x39532a,'resourceId':_0x4ccf90['id']}})[_0x489a('0x19')](function(){return _0x4d4ae9;});})[_0x489a('0x19')](function(){_0x38cba6['status'](0xcc)[_0x489a('0x33')]();});}};}function handleEntityNotFound(_0x588ba6,_0x1d625c){return function(_0x1bc431){if(!_0x1bc431){_0x588ba6[_0x489a('0x23')](0x194);}return _0x1bc431;};}function handleError(_0x354643,_0x33e64b){_0x33e64b=_0x33e64b||0x1f4;return function(_0x5af286){logger[_0x489a('0x1d')](_0x5af286[_0x489a('0x34')]);if(_0x5af286[_0x489a('0x35')]){delete _0x5af286[_0x489a('0x35')];}_0x354643[_0x489a('0x24')](_0x33e64b)['send'](_0x5af286);};}exports[_0x489a('0x36')]=function(_0x1348fb,_0x68b2f9){var _0x12beac={},_0x54c766={},_0x6d3e77={'count':0x0,'rows':[]};var _0x2db35e=_[_0x489a('0x37')](db[_0x489a('0x38')][_0x489a('0x39')],function(_0x2ea41f){return{'name':_0x2ea41f[_0x489a('0x3a')],'type':_0x2ea41f[_0x489a('0x3b')]['key']};});_0x54c766[_0x489a('0x3c')]=_[_0x489a('0x37')](_0x2db35e,'name');_0x54c766[_0x489a('0x3d')]=_[_0x489a('0x3e')](_0x1348fb[_0x489a('0x3d')]);_0x54c766['filters']=_[_0x489a('0x3f')](_0x54c766[_0x489a('0x3c')],_0x54c766[_0x489a('0x3d')]);_0x12beac['attributes']=_[_0x489a('0x3f')](_0x54c766[_0x489a('0x3c')],qs[_0x489a('0x40')](_0x1348fb['query']['fields']));_0x12beac[_0x489a('0x41')]=_0x12beac['attributes'][_0x489a('0x42')]?_0x12beac[_0x489a('0x41')]:_0x54c766['model'];if(!_0x1348fb['query']['hasOwnProperty'](_0x489a('0x43'))){_0x12beac[_0x489a('0x28')]=qs[_0x489a('0x28')](_0x1348fb['query'][_0x489a('0x28')]);_0x12beac[_0x489a('0x25')]=qs[_0x489a('0x25')](_0x1348fb[_0x489a('0x3d')]['offset']);}_0x12beac['order']=qs[_0x489a('0x44')](_0x1348fb[_0x489a('0x3d')][_0x489a('0x44')]);_0x12beac[_0x489a('0x45')]=qs[_0x489a('0x46')](_[_0x489a('0x47')](_0x1348fb[_0x489a('0x3d')],_0x54c766['filters']),_0x2db35e);if(_0x1348fb['query']['filter']){_0x12beac[_0x489a('0x45')]=_[_0x489a('0x48')](_0x12beac[_0x489a('0x45')],{'$or':_[_0x489a('0x37')](_0x2db35e,function(_0x5e4746){if(_0x5e4746['type']!==_0x489a('0x49')){var _0x37c8a9={};_0x37c8a9[_0x5e4746['name']]={'$like':'%'+_0x1348fb[_0x489a('0x3d')][_0x489a('0x4a')]+'%'};return _0x37c8a9;}})});}_0x12beac=_[_0x489a('0x48')]({},_0x12beac,_0x1348fb['options']);var _0x1e4bf2={'where':_0x12beac[_0x489a('0x45')]};return db[_0x489a('0x38')][_0x489a('0x27')](_0x1e4bf2)['then'](function(_0x158ead){_0x6d3e77[_0x489a('0x27')]=_0x158ead;if(_0x1348fb[_0x489a('0x3d')]['includeAll']){_0x12beac[_0x489a('0x4b')]=[{'all':!![]}];}return db[_0x489a('0x38')][_0x489a('0x4c')](_0x12beac);})[_0x489a('0x19')](function(_0x22cb8d){_0x6d3e77[_0x489a('0x4d')]=_0x22cb8d;return _0x6d3e77;})[_0x489a('0x19')](respondWithFilteredResult(_0x68b2f9,_0x12beac))[_0x489a('0x22')](handleError(_0x68b2f9,null));};exports[_0x489a('0x4e')]=function(_0x2e2213,_0x5572c9){var _0x28f135={'raw':![],'where':{'id':_0x2e2213['params']['id']}},_0x5b8c95={};_0x5b8c95[_0x489a('0x3c')]=_[_0x489a('0x3e')](db[_0x489a('0x38')]['rawAttributes']);_0x5b8c95['query']=_[_0x489a('0x3e')](_0x2e2213[_0x489a('0x3d')]);_0x5b8c95['filters']=_[_0x489a('0x3f')](_0x5b8c95[_0x489a('0x3c')],_0x5b8c95[_0x489a('0x3d')]);_0x28f135[_0x489a('0x41')]=_['intersection'](_0x5b8c95[_0x489a('0x3c')],qs[_0x489a('0x40')](_0x2e2213[_0x489a('0x3d')]['fields']));_0x28f135['attributes']=_0x28f135[_0x489a('0x41')][_0x489a('0x42')]?_0x28f135[_0x489a('0x41')]:_0x5b8c95['model'];if(_0x2e2213[_0x489a('0x3d')]['includeAll']){_0x28f135[_0x489a('0x4b')]=[{'all':!![]}];}_0x28f135=_[_0x489a('0x48')]({},_0x28f135,_0x2e2213[_0x489a('0x4f')]);return db[_0x489a('0x38')][_0x489a('0x50')](_0x28f135)[_0x489a('0x19')](handleEntityNotFound(_0x5572c9,null))['then'](respondWithResult(_0x5572c9,null))[_0x489a('0x22')](handleError(_0x5572c9,null));};exports['create']=function(_0xa99ea4,_0x356f5d,_0x4236e4){var _0x15a538;return db[_0x489a('0x38')]['create'](_0xa99ea4[_0x489a('0x51')],{'raw':!![]})[_0x489a('0x19')](function(_0x25093f){_0x15a538=_0x25093f;return db[_0x489a('0x38')][_0x489a('0x4c')]({'raw':!![]});})[_0x489a('0x19')](function(_0xde1237){var _0xee7910=fs[_0x489a('0x52')](path[_0x489a('0x53')](config[_0x489a('0x54')],_0x489a('0x55')),'utf8');var _0x3aea71=ejs[_0x489a('0x56')](_0xee7910,{'contexts':_0xde1237||[]});fs[_0x489a('0x57')](_0x489a('0x58'),_0x3aea71);})[_0x489a('0x19')](function(){return respondWithRpcPromise(_0x489a('0x59'),'create',{'module':'chan_sip.so'});})[_0x489a('0x19')](function(){var _0x25dc5d=_0xa99ea4[_0x489a('0x5a')]['get']({'plain':!![]});if(!_0x25dc5d)throw new Error(_0x489a('0x5b'));if(_0x25dc5d[_0x489a('0x5c')]===_0x489a('0x5a')){var _0x3f6cc7=_0x15a538[_0x489a('0x30')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x489a('0x31'),'userProfileId':_0x25dc5d[_0x489a('0x5d')]},'raw':!![]})[_0x489a('0x19')](function(_0x105a64){if(_0x105a64&&_0x105a64[_0x489a('0x5e')]===0x0){return db['UserProfileResource'][_0x489a('0x5f')]({'name':_0x3f6cc7[_0x489a('0x35')],'resourceId':_0x3f6cc7['id'],'type':_0x105a64[_0x489a('0x35')],'sectionId':_0x105a64['id']},{})[_0x489a('0x19')](function(){return _0x15a538;});}else{return _0x15a538;}})[_0x489a('0x22')](function(_0x2c999d){logger['error'](_0x489a('0x60'),_0x2c999d);throw _0x2c999d;});}return _0x15a538;})[_0x489a('0x19')](respondWithResult(_0x356f5d,0xc9))[_0x489a('0x22')](handleError(_0x356f5d,null));};exports[_0x489a('0x2e')]=function(_0x4240bb,_0x45f2db,_0x8695f6){var _0x3fa1ff;return db[_0x489a('0x38')]['find']({'where':{'id':_0x4240bb[_0x489a('0x61')]['id']}})[_0x489a('0x19')](handleEntityNotFound(_0x45f2db,null))[_0x489a('0x19')](saveUpdates(_0x4240bb['body'],null))[_0x489a('0x19')](function(_0x32b163){if(_0x32b163){_0x3fa1ff=_0x32b163;return db[_0x489a('0x38')][_0x489a('0x4c')]({'raw':!![]});}})[_0x489a('0x19')](function(_0x47c68f){var _0x1ed7da=fs[_0x489a('0x52')](path[_0x489a('0x53')](config['root'],_0x489a('0x55')),_0x489a('0x62'));var _0x5c91fe=ejs[_0x489a('0x56')](_0x1ed7da,{'contexts':_0x47c68f||[]});fs['writeFileSync'](_0x489a('0x58'),_0x5c91fe);})[_0x489a('0x19')](function(){return respondWithRpcPromise(_0x489a('0x59'),_0x489a('0x2e'),{'module':_0x489a('0x63')});})[_0x489a('0x19')](function(){return _0x3fa1ff;})[_0x489a('0x19')](respondWithResult(_0x45f2db,null))[_0x489a('0x22')](handleError(_0x45f2db,null));};exports[_0x489a('0x2f')]=function(_0x18b8a3,_0x24dd1a,_0x34d12c){var _0x513b36;return db[_0x489a('0x38')][_0x489a('0x50')]({'where':{'id':_0x18b8a3[_0x489a('0x61')]['id']}})[_0x489a('0x19')](handleEntityNotFound(_0x24dd1a,null))[_0x489a('0x19')](removeEntity(_0x24dd1a,null))[_0x489a('0x19')](function(){return db['VoiceContext'][_0x489a('0x4c')]({'raw':!![]});})[_0x489a('0x19')](function(_0x359656){var _0x3ee5ce=fs['readFileSync'](path[_0x489a('0x53')](config[_0x489a('0x54')],_0x489a('0x55')),_0x489a('0x62'));var _0x3138d3=ejs[_0x489a('0x56')](_0x3ee5ce,{'contexts':_0x359656});fs[_0x489a('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3138d3);return respondWithRpcPromise(_0x489a('0x59'),'destroy',{'module':_0x489a('0x63')});})[_0x489a('0x22')](handleError(_0x24dd1a,null));}; \ No newline at end of file +var _0xbfaa=['root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','Contexts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','sendStatus','stack','send','map','VoiceContext','rawAttributes','type','model','name','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','params','keys','intersection','includeAll','create','body','readFileSync','join'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0xbfaa,0x197));var _0xabfa=function(_0x14271b,_0x303f86){_0x14271b=_0x14271b-0x0;var _0x2d8f24=_0xbfaa[_0x14271b];return _0x2d8f24;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabfa('0x0'));var jsonpatch=require(_0xabfa('0x1'));var rp=require(_0xabfa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xabfa('0x3'));var util=require(_0xabfa('0x4'));var path=require('path');var sox=require(_0xabfa('0x5'));var csv=require(_0xabfa('0x6'));var ejs=require(_0xabfa('0x7'));var fs=require('fs');var fs_extra=require(_0xabfa('0x8'));var _=require(_0xabfa('0x9'));var squel=require(_0xabfa('0xa'));var crypto=require(_0xabfa('0xb'));var jsforce=require(_0xabfa('0xc'));var deskjs=require(_0xabfa('0xd'));var toCsv=require(_0xabfa('0x6'));var querystring=require('querystring');var Papa=require(_0xabfa('0xe'));var Redis=require(_0xabfa('0xf'));var authService=require(_0xabfa('0x10'));var qs=require(_0xabfa('0x11'));var as=require(_0xabfa('0x12'));var hardwareService=require(_0xabfa('0x13'));var logger=require(_0xabfa('0x14'))(_0xabfa('0x15'));var utils=require('../../config/utils');var config=require(_0xabfa('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabfa('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xabfa('0x18')][_0xabfa('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x44b065,_0x3071d5,_0x4ad7a9,_0x5c45ce){return new BPromise(function(_0x243a63,_0x258930){var _0x5afd50=_0x5c45ce||client;return _0x5afd50['request'](_0x44b065,_0x4ad7a9)['then'](function(_0x2f9c69){logger[_0xabfa('0x1a')](_0xabfa('0x1b'),_0x3071d5,'request\x20sent');logger['debug'](_0xabfa('0x1c'),_0x3071d5,'request\x20sent',JSON[_0xabfa('0x1d')](_0x2f9c69));if(_0x2f9c69['error']){if(_0x2f9c69['error']['code']===0x1f4){logger[_0xabfa('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3071d5,_0x2f9c69[_0xabfa('0x1e')][_0xabfa('0x1f')]);return _0x258930(_0x2f9c69[_0xabfa('0x1e')][_0xabfa('0x1f')]);}logger[_0xabfa('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3071d5,_0x2f9c69[_0xabfa('0x1e')][_0xabfa('0x1f')]);return _0x243a63(_0x2f9c69['error'][_0xabfa('0x1f')]);}else{logger[_0xabfa('0x1a')](_0xabfa('0x1b'),_0x3071d5,_0xabfa('0x20'));_0x243a63(_0x2f9c69['result'][_0xabfa('0x1f')]);}})[_0xabfa('0x21')](function(_0xda5a48){logger[_0xabfa('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3071d5,_0xda5a48);_0x258930(_0xda5a48);});});}function respondWithStatusCode(_0x898365,_0x29b13f){_0x29b13f=_0x29b13f||0xcc;return function(_0x39410b){if(_0x39410b){return _0x898365['sendStatus'](_0x29b13f);}return _0x898365['status'](_0x29b13f)[_0xabfa('0x22')]();};}function respondWithResult(_0x11f82d,_0x417735){_0x417735=_0x417735||0xc8;return function(_0x4cca7e){if(_0x4cca7e){return _0x11f82d[_0xabfa('0x23')](_0x417735)[_0xabfa('0x24')](_0x4cca7e);}};}function respondWithFilteredResult(_0x22a870,_0xe11207){return function(_0x563c04){if(_0x563c04){var _0x68a6e6=typeof _0xe11207[_0xabfa('0x25')]===_0xabfa('0x26')&&typeof _0xe11207[_0xabfa('0x27')]===_0xabfa('0x26');var _0x15ca70=_0x563c04[_0xabfa('0x28')];var _0x2fc25a=_0x68a6e6?0x0:_0xe11207[_0xabfa('0x25')];var _0x1bc153=_0x68a6e6?_0x563c04[_0xabfa('0x28')]:_0xe11207['offset']+_0xe11207['limit'];var _0x25fc67;if(_0x1bc153>=_0x15ca70){_0x1bc153=_0x15ca70;_0x25fc67=0xc8;}else{_0x25fc67=0xce;}_0x22a870[_0xabfa('0x23')](_0x25fc67);return _0x22a870[_0xabfa('0x29')](_0xabfa('0x2a'),_0x2fc25a+'-'+_0x1bc153+'/'+_0x15ca70)['json'](_0x563c04);}return null;};}function patchUpdates(_0x19e00d){return function(_0x1cedff){try{jsonpatch[_0xabfa('0x2b')](_0x1cedff,_0x19e00d,!![]);}catch(_0x117bdd){return BPromise[_0xabfa('0x2c')](_0x117bdd);}return _0x1cedff['save']();};}function saveUpdates(_0x20285c,_0x424bde){return function(_0x1311c6){if(_0x1311c6){return _0x1311c6[_0xabfa('0x2d')](_0x20285c)[_0xabfa('0x2e')](function(_0x3fd96a){return _0x3fd96a;});}return null;};}function removeEntity(_0x2d8eec,_0x2503cd){return function(_0x11c2b7){if(_0x11c2b7){return _0x11c2b7['destroy']()[_0xabfa('0x2e')](function(){var _0x3c6954=_0x11c2b7[_0xabfa('0x2f')]({'plain':!![]});var _0x2b03d4='Contexts';return db[_0xabfa('0x30')][_0xabfa('0x31')]({'where':{'type':_0x2b03d4,'resourceId':_0x3c6954['id']}})['then'](function(){return _0x11c2b7;});})['then'](function(){_0x2d8eec[_0xabfa('0x23')](0xcc)[_0xabfa('0x22')]();});}};}function handleEntityNotFound(_0x4a910d,_0x2e9646){return function(_0x4364ab){if(!_0x4364ab){_0x4a910d[_0xabfa('0x32')](0x194);}return _0x4364ab;};}function handleError(_0x4c39db,_0x1356b7){_0x1356b7=_0x1356b7||0x1f4;return function(_0x495674){logger[_0xabfa('0x1e')](_0x495674[_0xabfa('0x33')]);if(_0x495674['name']){delete _0x495674['name'];}_0x4c39db[_0xabfa('0x23')](_0x1356b7)[_0xabfa('0x34')](_0x495674);};}exports['index']=function(_0xeedc0b,_0x10196b){var _0x11cf07={},_0x1cc1e5={},_0x4d2d61={'count':0x0,'rows':[]};var _0x524649=_[_0xabfa('0x35')](db[_0xabfa('0x36')][_0xabfa('0x37')],function(_0x3f5b9c){return{'name':_0x3f5b9c['fieldName'],'type':_0x3f5b9c[_0xabfa('0x38')]['key']};});_0x1cc1e5[_0xabfa('0x39')]=_['map'](_0x524649,_0xabfa('0x3a'));_0x1cc1e5[_0xabfa('0x3b')]=_['keys'](_0xeedc0b[_0xabfa('0x3b')]);_0x1cc1e5[_0xabfa('0x3c')]=_['intersection'](_0x1cc1e5[_0xabfa('0x39')],_0x1cc1e5[_0xabfa('0x3b')]);_0x11cf07['attributes']=_['intersection'](_0x1cc1e5[_0xabfa('0x39')],qs[_0xabfa('0x3d')](_0xeedc0b[_0xabfa('0x3b')][_0xabfa('0x3d')]));_0x11cf07['attributes']=_0x11cf07[_0xabfa('0x3e')][_0xabfa('0x3f')]?_0x11cf07['attributes']:_0x1cc1e5[_0xabfa('0x39')];if(!_0xeedc0b[_0xabfa('0x3b')][_0xabfa('0x40')](_0xabfa('0x41'))){_0x11cf07[_0xabfa('0x27')]=qs['limit'](_0xeedc0b['query'][_0xabfa('0x27')]);_0x11cf07['offset']=qs[_0xabfa('0x25')](_0xeedc0b[_0xabfa('0x3b')]['offset']);}_0x11cf07[_0xabfa('0x42')]=qs['sort'](_0xeedc0b['query'][_0xabfa('0x43')]);_0x11cf07[_0xabfa('0x44')]=qs[_0xabfa('0x3c')](_['pick'](_0xeedc0b['query'],_0x1cc1e5[_0xabfa('0x3c')]),_0x524649);if(_0xeedc0b['query'][_0xabfa('0x45')]){_0x11cf07[_0xabfa('0x44')]=_[_0xabfa('0x46')](_0x11cf07[_0xabfa('0x44')],{'$or':_['map'](_0x524649,function(_0x1ce7f8){if(_0x1ce7f8['type']!==_0xabfa('0x47')){var _0x3a37d3={};_0x3a37d3[_0x1ce7f8[_0xabfa('0x3a')]]={'$like':'%'+_0xeedc0b[_0xabfa('0x3b')][_0xabfa('0x45')]+'%'};return _0x3a37d3;}})});}_0x11cf07=_['merge']({},_0x11cf07,_0xeedc0b[_0xabfa('0x48')]);var _0x2955fb={'where':_0x11cf07[_0xabfa('0x44')]};return db[_0xabfa('0x36')][_0xabfa('0x28')](_0x2955fb)['then'](function(_0x13928d){_0x4d2d61[_0xabfa('0x28')]=_0x13928d;if(_0xeedc0b[_0xabfa('0x3b')]['includeAll']){_0x11cf07['include']=[{'all':!![]}];}return db[_0xabfa('0x36')][_0xabfa('0x49')](_0x11cf07);})[_0xabfa('0x2e')](function(_0x2c7caf){_0x4d2d61[_0xabfa('0x4a')]=_0x2c7caf;return _0x4d2d61;})[_0xabfa('0x2e')](respondWithFilteredResult(_0x10196b,_0x11cf07))['catch'](handleError(_0x10196b,null));};exports['show']=function(_0x1a9a00,_0xa694b6){var _0xaf709a={'raw':![],'where':{'id':_0x1a9a00[_0xabfa('0x4b')]['id']}},_0x5aa9ce={};_0x5aa9ce['model']=_[_0xabfa('0x4c')](db[_0xabfa('0x36')][_0xabfa('0x37')]);_0x5aa9ce[_0xabfa('0x3b')]=_[_0xabfa('0x4c')](_0x1a9a00['query']);_0x5aa9ce[_0xabfa('0x3c')]=_[_0xabfa('0x4d')](_0x5aa9ce['model'],_0x5aa9ce[_0xabfa('0x3b')]);_0xaf709a['attributes']=_[_0xabfa('0x4d')](_0x5aa9ce[_0xabfa('0x39')],qs[_0xabfa('0x3d')](_0x1a9a00[_0xabfa('0x3b')][_0xabfa('0x3d')]));_0xaf709a[_0xabfa('0x3e')]=_0xaf709a['attributes'][_0xabfa('0x3f')]?_0xaf709a['attributes']:_0x5aa9ce[_0xabfa('0x39')];if(_0x1a9a00[_0xabfa('0x3b')][_0xabfa('0x4e')]){_0xaf709a['include']=[{'all':!![]}];}_0xaf709a=_[_0xabfa('0x46')]({},_0xaf709a,_0x1a9a00['options']);return db[_0xabfa('0x36')]['find'](_0xaf709a)['then'](handleEntityNotFound(_0xa694b6,null))[_0xabfa('0x2e')](respondWithResult(_0xa694b6,null))[_0xabfa('0x21')](handleError(_0xa694b6,null));};exports[_0xabfa('0x4f')]=function(_0x491879,_0x29fc1d,_0xc5a00f){var _0x3efb0f;return db[_0xabfa('0x36')]['create'](_0x491879[_0xabfa('0x50')],{'raw':!![]})[_0xabfa('0x2e')](function(_0x4a7e9f){_0x3efb0f=_0x4a7e9f;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x584222){var _0x54f020=fs[_0xabfa('0x51')](path[_0xabfa('0x52')](config[_0xabfa('0x53')],_0xabfa('0x54')),_0xabfa('0x55'));var _0x5d3d6e=ejs[_0xabfa('0x56')](_0x54f020,{'contexts':_0x584222||[]});fs[_0xabfa('0x57')](_0xabfa('0x58'),_0x5d3d6e);})[_0xabfa('0x2e')](function(){return respondWithRpcPromise(_0xabfa('0x59'),_0xabfa('0x4f'),{'module':_0xabfa('0x5a')});})[_0xabfa('0x2e')](function(){var _0xa423ac=_0x491879[_0xabfa('0x5b')]['get']({'plain':!![]});if(!_0xa423ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa423ac[_0xabfa('0x5c')]===_0xabfa('0x5b')){var _0xff678f=_0x3efb0f[_0xabfa('0x2f')]({'plain':!![]});return db[_0xabfa('0x5d')][_0xabfa('0x5e')]({'where':{'name':_0xabfa('0x5f'),'userProfileId':_0xa423ac['userProfileId']},'raw':!![]})[_0xabfa('0x2e')](function(_0x4598f1){if(_0x4598f1&&_0x4598f1[_0xabfa('0x60')]===0x0){return db['UserProfileResource'][_0xabfa('0x4f')]({'name':_0xff678f[_0xabfa('0x3a')],'resourceId':_0xff678f['id'],'type':_0x4598f1[_0xabfa('0x3a')],'sectionId':_0x4598f1['id']},{})[_0xabfa('0x2e')](function(){return _0x3efb0f;});}else{return _0x3efb0f;}})[_0xabfa('0x21')](function(_0xbc7f25){logger['error'](_0xabfa('0x61'),_0xbc7f25);throw _0xbc7f25;});}return _0x3efb0f;})['then'](respondWithResult(_0x29fc1d,0xc9))['catch'](handleError(_0x29fc1d,null));};exports[_0xabfa('0x2d')]=function(_0x4dff0b,_0x402b32,_0x24925b){var _0x79ea29;return db['VoiceContext'][_0xabfa('0x5e')]({'where':{'id':_0x4dff0b[_0xabfa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x402b32,null))[_0xabfa('0x2e')](saveUpdates(_0x4dff0b['body'],null))[_0xabfa('0x2e')](function(_0x4404a9){if(_0x4404a9){_0x79ea29=_0x4404a9;return db[_0xabfa('0x36')][_0xabfa('0x49')]({'raw':!![]});}})[_0xabfa('0x2e')](function(_0x5c7e5d){var _0x3f0957=fs[_0xabfa('0x51')](path[_0xabfa('0x52')](config[_0xabfa('0x53')],_0xabfa('0x54')),_0xabfa('0x55'));var _0x4c9841=ejs[_0xabfa('0x56')](_0x3f0957,{'contexts':_0x5c7e5d||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x4c9841);})['then'](function(){return respondWithRpcPromise(_0xabfa('0x59'),_0xabfa('0x2d'),{'module':_0xabfa('0x5a')});})['then'](function(){return _0x79ea29;})[_0xabfa('0x2e')](respondWithResult(_0x402b32,null))[_0xabfa('0x21')](handleError(_0x402b32,null));};exports[_0xabfa('0x31')]=function(_0x7cdda,_0x352af8,_0x45532f){var _0x182a02;return db[_0xabfa('0x36')][_0xabfa('0x5e')]({'where':{'id':_0x7cdda[_0xabfa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x352af8,null))[_0xabfa('0x2e')](removeEntity(_0x352af8,null))['then'](function(){return db[_0xabfa('0x36')][_0xabfa('0x49')]({'raw':!![]});})['then'](function(_0x56d371){var _0x263a9f=fs[_0xabfa('0x51')](path[_0xabfa('0x52')](config[_0xabfa('0x53')],_0xabfa('0x54')),_0xabfa('0x55'));var _0x346e01=ejs['render'](_0x263a9f,{'contexts':_0x56d371});fs[_0xabfa('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x346e01);return respondWithRpcPromise(_0xabfa('0x59'),_0xabfa('0x31'),{'module':'chan_sip.so'});})[_0xabfa('0x21')](handleError(_0x352af8,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c41ea19..7ea7f79 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 _0xb4c3=['VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x9df20b,_0x444cfb){var _0x553c95=function(_0x4fc621){while(--_0x4fc621){_0x9df20b['push'](_0x9df20b['shift']());}};_0x553c95(++_0x444cfb);}(_0xb4c3,0x115));var _0x3b4c=function(_0x1bc9e4,_0x2f200e){_0x1bc9e4=_0x1bc9e4-0x0;var _0x1815d3=_0xb4c3[_0x1bc9e4];return _0x1815d3;};'use strict';var _=require(_0x3b4c('0x0'));var util=require('util');var logger=require(_0x3b4c('0x1'))(_0x3b4c('0x2'));var moment=require(_0x3b4c('0x3'));var BPromise=require(_0x3b4c('0x4'));var rp=require(_0x3b4c('0x5'));var fs=require('fs');var path=require(_0x3b4c('0x6'));var rimraf=require(_0x3b4c('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b4c('0x8'));module['exports']=function(_0x27922e,_0x714b84){return _0x27922e['define'](_0x3b4c('0x9'),attributes,{'tableName':_0x3b4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c93=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x56ef93,_0x59ed9f){var _0x17a7fa=function(_0x69af58){while(--_0x69af58){_0x56ef93['push'](_0x56ef93['shift']());}};_0x17a7fa(++_0x59ed9f);}(_0x7c93,0x16e));var _0x37c9=function(_0x2d308b,_0x117ad9){_0x2d308b=_0x2d308b-0x0;var _0x11f16f=_0x7c93[_0x2d308b];return _0x11f16f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x37c9('0x0'))(_0x37c9('0x1'));var moment=require(_0x37c9('0x2'));var BPromise=require('bluebird');var rp=require(_0x37c9('0x3'));var fs=require('fs');var path=require(_0x37c9('0x4'));var rimraf=require(_0x37c9('0x5'));var config=require(_0x37c9('0x6'));var attributes=require(_0x37c9('0x7'));module[_0x37c9('0x8')]=function(_0x56a9ca,_0x1d6d79){return _0x56a9ca[_0x37c9('0x9')](_0x37c9('0xa'),attributes,{'tableName':_0x37c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 722850f..e716116 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 _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8603,0x190));var _0x3860=function(_0x27e357,_0x596b3c){_0x27e357=_0x27e357-0x0;var _0x1451bf=_0x8603[_0x27e357];return _0x1451bf;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});} \ No newline at end of file +var _0x536f=['http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf536('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf536('0x1'));var db=require(_0xf536('0x2'))['db'];var utils=require(_0xf536('0x3'));var logger=require(_0xf536('0x4'))('rpc');var config=require(_0xf536('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf536('0x6')][_0xf536('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fc517,_0x486ee3,_0x5952b7){return new BPromise(function(_0x3b5191,_0x422541){return client[_0xf536('0x8')](_0x2fc517,_0x5952b7)[_0xf536('0x9')](function(_0x4f2eaf){logger['info'](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x486ee3,_0xf536('0xb'),JSON[_0xf536('0xc')](_0x4f2eaf));if(_0x4f2eaf[_0xf536('0xd')]){if(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xe')]===0x1f4){logger['error'](_0xf536('0xa'),_0x486ee3,_0x4f2eaf['error'][_0xf536('0xf')]);return _0x422541(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}logger[_0xf536('0xd')](_0xf536('0xa'),_0x486ee3,_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);return _0x3b5191(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}else{logger[_0xf536('0x10')](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));_0x3b5191(_0x4f2eaf['result'][_0xf536('0xf')]);}})['catch'](function(_0x238b9d){logger['error'](_0xf536('0xa'),_0x486ee3,_0x238b9d);_0x422541(_0x238b9d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4d1e4de..9600b55 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 _0x51d3=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x51cc2b,_0x56ff6a){var _0x44c96e=function(_0xbc4b6a){while(--_0xbc4b6a){_0x51cc2b['push'](_0x51cc2b['shift']());}};_0x44c96e(++_0x56ff6a);}(_0x51d3,0xa9));var _0x351d=function(_0xc47ea3,_0x122452){_0xc47ea3=_0xc47ea3-0x0;var _0x99b6a4=_0x51d3[_0xc47ea3];return _0x99b6a4;};'use strict';var multer=require(_0x351d('0x0'));var util=require(_0x351d('0x1'));var path=require(_0x351d('0x2'));var timeout=require(_0x351d('0x3'));var express=require(_0x351d('0x4'));var router=express['Router']();var fs_extra=require(_0x351d('0x5'));var auth=require(_0x351d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x351d('0x7'));var controller=require(_0x351d('0x8'));router['get']('/',auth[_0x351d('0x9')](),controller['index']);router[_0x351d('0xa')](_0x351d('0xb'),auth[_0x351d('0x9')](),controller[_0x351d('0xc')]);router[_0x351d('0xa')](_0x351d('0xd'),auth['isAuthenticated'](),controller[_0x351d('0xe')]);router[_0x351d('0xf')]('/',auth[_0x351d('0x9')](),controller['create']);router[_0x351d('0x10')](_0x351d('0xd'),auth['isAuthenticated'](),controller[_0x351d('0x11')]);router[_0x351d('0x12')](_0x351d('0xd'),auth[_0x351d('0x9')](),controller[_0x351d('0x13')]);module[_0x351d('0x14')]=router; \ No newline at end of file +var _0x67c8=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x67c8,0x1c7));var _0x867c=function(_0x1e6846,_0x259346){_0x1e6846=_0x1e6846-0x0;var _0x456b6f=_0x67c8[_0x1e6846];return _0x456b6f;};'use strict';var multer=require(_0x867c('0x0'));var util=require(_0x867c('0x1'));var path=require(_0x867c('0x2'));var timeout=require('connect-timeout');var express=require(_0x867c('0x3'));var router=express[_0x867c('0x4')]();var fs_extra=require(_0x867c('0x5'));var auth=require(_0x867c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x867c('0x7'));var controller=require(_0x867c('0x8'));router[_0x867c('0x9')]('/',auth[_0x867c('0xa')](),controller[_0x867c('0xb')]);router[_0x867c('0x9')](_0x867c('0xc'),auth[_0x867c('0xa')](),controller[_0x867c('0xd')]);router[_0x867c('0x9')](_0x867c('0xe'),auth[_0x867c('0xa')](),controller['show']);router[_0x867c('0xf')]('/',auth[_0x867c('0xa')](),controller[_0x867c('0x10')]);router[_0x867c('0x11')](_0x867c('0xe'),auth['isAuthenticated'](),controller[_0x867c('0x12')]);router[_0x867c('0x13')]('/:id',auth[_0x867c('0xa')](),controller['destroy']);module[_0x867c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0a27904..5e3b2ca 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(_0x3a2eca,_0x13da32){var _0x3fa02d=function(_0x2c01ae){while(--_0x2c01ae){_0x3a2eca['push'](_0x3a2eca['shift']());}};_0x3fa02d(++_0x13da32);}(_0xa41a,0x6b));var _0xaa41=function(_0x3849f3,_0x3cd530){_0x3849f3=_0x3849f3-0x0;var _0x5c1993=_0xa41a[_0x3849f3];return _0x5c1993;};'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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3e74,0x175));var _0x43e7=function(_0x30eada,_0x15db21){_0x30eada=_0x30eada-0x0;var _0x1e2c8e=_0x3e74[_0x30eada];return _0x1e2c8e;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8ed8c15..7308cbb 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 _0xeb43=['stack','name','index','map','VoiceDialReport','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error'];(function(_0x457f92,_0x36c466){var _0x41ff6b=function(_0x13fbfd){while(--_0x13fbfd){_0x457f92['push'](_0x457f92['shift']());}};_0x41ff6b(++_0x36c466);}(_0xeb43,0x1f0));var _0x3eb4=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xeb43[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3eb4('0x0'));var zipdir=require(_0x3eb4('0x1'));var jsonpatch=require(_0x3eb4('0x2'));var rp=require(_0x3eb4('0x3'));var moment=require('moment');var BPromise=require(_0x3eb4('0x4'));var Mustache=require(_0x3eb4('0x5'));var util=require('util');var path=require(_0x3eb4('0x6'));var sox=require(_0x3eb4('0x7'));var csv=require(_0x3eb4('0x8'));var ejs=require(_0x3eb4('0x9'));var fs=require('fs');var fs_extra=require(_0x3eb4('0xa'));var _=require('lodash');var squel=require(_0x3eb4('0xb'));var crypto=require(_0x3eb4('0xc'));var jsforce=require(_0x3eb4('0xd'));var deskjs=require(_0x3eb4('0xe'));var toCsv=require(_0x3eb4('0x8'));var querystring=require(_0x3eb4('0xf'));var Papa=require(_0x3eb4('0x10'));var Redis=require(_0x3eb4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3eb4('0x12'));var as=require(_0x3eb4('0x13'));var hardwareService=require(_0x3eb4('0x14'));var logger=require(_0x3eb4('0x15'))(_0x3eb4('0x16'));var utils=require(_0x3eb4('0x17'));var config=require(_0x3eb4('0x18'));var licenseUtil=require(_0x3eb4('0x19'));var db=require(_0x3eb4('0x1a'))['db'];function respondWithStatusCode(_0x1cbcca,_0xd2ea){_0xd2ea=_0xd2ea||0xcc;return function(_0x2f48a5){if(_0x2f48a5){return _0x1cbcca[_0x3eb4('0x1b')](_0xd2ea);}return _0x1cbcca[_0x3eb4('0x1c')](_0xd2ea)[_0x3eb4('0x1d')]();};}function respondWithResult(_0x1b4dfe,_0x4e1060){_0x4e1060=_0x4e1060||0xc8;return function(_0x78d748){if(_0x78d748){return _0x1b4dfe[_0x3eb4('0x1c')](_0x4e1060)[_0x3eb4('0x1e')](_0x78d748);}};}function respondWithFilteredResult(_0x1b6a35,_0x32d00d){return function(_0x282976){if(_0x282976){var _0x4ef043=typeof _0x32d00d['offset']===_0x3eb4('0x1f')&&typeof _0x32d00d[_0x3eb4('0x20')]===_0x3eb4('0x1f');var _0x5e721f=_0x282976[_0x3eb4('0x21')];var _0x667acd=_0x4ef043?0x0:_0x32d00d[_0x3eb4('0x22')];var _0x3f75f5=_0x4ef043?_0x282976[_0x3eb4('0x21')]:_0x32d00d[_0x3eb4('0x22')]+_0x32d00d[_0x3eb4('0x20')];var _0x238389;if(_0x3f75f5>=_0x5e721f){_0x3f75f5=_0x5e721f;_0x238389=0xc8;}else{_0x238389=0xce;}_0x1b6a35[_0x3eb4('0x1c')](_0x238389);return _0x1b6a35[_0x3eb4('0x23')](_0x3eb4('0x24'),_0x667acd+'-'+_0x3f75f5+'/'+_0x5e721f)[_0x3eb4('0x1e')](_0x282976);}return null;};}function patchUpdates(_0x384530){return function(_0xe24014){try{jsonpatch['apply'](_0xe24014,_0x384530,!![]);}catch(_0x5ac9cd){return BPromise[_0x3eb4('0x25')](_0x5ac9cd);}return _0xe24014[_0x3eb4('0x26')]();};}function saveUpdates(_0x25774a,_0x506fd9){return function(_0xad8217){if(_0xad8217){return _0xad8217[_0x3eb4('0x27')](_0x25774a)[_0x3eb4('0x28')](function(_0x5195b2){return _0x5195b2;});}return null;};}function removeEntity(_0x45e080,_0x4a6337){return function(_0x804feb){if(_0x804feb){return _0x804feb[_0x3eb4('0x29')]()[_0x3eb4('0x28')](function(){_0x45e080['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3411d7,_0x3aa52f){return function(_0x5c34bb){if(!_0x5c34bb){_0x3411d7['sendStatus'](0x194);}return _0x5c34bb;};}function handleError(_0x596e09,_0x4a4ebf){_0x4a4ebf=_0x4a4ebf||0x1f4;return function(_0x1db8f3){logger[_0x3eb4('0x2a')](_0x1db8f3[_0x3eb4('0x2b')]);if(_0x1db8f3[_0x3eb4('0x2c')]){delete _0x1db8f3[_0x3eb4('0x2c')];}_0x596e09[_0x3eb4('0x1c')](_0x4a4ebf)['send'](_0x1db8f3);};}exports[_0x3eb4('0x2d')]=function(_0x325658,_0x5d54f6){var _0x24baa7={},_0x204f32={},_0x169736={'count':0x0,'rows':[]};var _0x396d4b=_[_0x3eb4('0x2e')](db[_0x3eb4('0x2f')][_0x3eb4('0x30')],function(_0x311cab){return{'name':_0x311cab['fieldName'],'type':_0x311cab['type'][_0x3eb4('0x31')]};});_0x204f32[_0x3eb4('0x32')]=_[_0x3eb4('0x2e')](_0x396d4b,_0x3eb4('0x2c'));_0x204f32['query']=_[_0x3eb4('0x33')](_0x325658[_0x3eb4('0x34')]);_0x204f32['filters']=_[_0x3eb4('0x35')](_0x204f32[_0x3eb4('0x32')],_0x204f32['query']);_0x24baa7['attributes']=_['intersection'](_0x204f32['model'],qs[_0x3eb4('0x36')](_0x325658[_0x3eb4('0x34')]['fields']));_0x24baa7[_0x3eb4('0x37')]=_0x24baa7[_0x3eb4('0x37')][_0x3eb4('0x38')]?_0x24baa7[_0x3eb4('0x37')]:_0x204f32[_0x3eb4('0x32')];if(!_0x325658[_0x3eb4('0x34')][_0x3eb4('0x39')](_0x3eb4('0x3a'))){_0x24baa7['limit']=qs[_0x3eb4('0x20')](_0x325658['query']['limit']);_0x24baa7['offset']=qs[_0x3eb4('0x22')](_0x325658['query']['offset']);}_0x24baa7[_0x3eb4('0x3b')]=qs['sort'](_0x325658[_0x3eb4('0x34')]['sort']);_0x24baa7[_0x3eb4('0x3c')]=qs[_0x3eb4('0x3d')](_[_0x3eb4('0x3e')](_0x325658[_0x3eb4('0x34')],_0x204f32[_0x3eb4('0x3d')]),_0x396d4b);if(_0x325658[_0x3eb4('0x34')][_0x3eb4('0x3f')]){_0x24baa7['where']=_[_0x3eb4('0x40')](_0x24baa7[_0x3eb4('0x3c')],{'$or':_['map'](_0x396d4b,function(_0x10ae87){if(_0x10ae87[_0x3eb4('0x41')]!==_0x3eb4('0x42')){var _0x172524={};_0x172524[_0x10ae87[_0x3eb4('0x2c')]]={'$like':'%'+_0x325658[_0x3eb4('0x34')]['filter']+'%'};return _0x172524;}})});}_0x24baa7=_['merge']({},_0x24baa7,_0x325658['options']);var _0x29fe9e={'where':_0x24baa7[_0x3eb4('0x3c')]};return db[_0x3eb4('0x2f')][_0x3eb4('0x21')](_0x29fe9e)['then'](function(_0x175584){_0x169736[_0x3eb4('0x21')]=_0x175584;if(_0x325658[_0x3eb4('0x34')][_0x3eb4('0x43')]){_0x24baa7['include']=[{'all':!![]}];}return db[_0x3eb4('0x2f')][_0x3eb4('0x44')](_0x24baa7);})[_0x3eb4('0x28')](function(_0x2ed52b){_0x169736['rows']=_0x2ed52b;return _0x169736;})[_0x3eb4('0x28')](respondWithFilteredResult(_0x5d54f6,_0x24baa7))[_0x3eb4('0x45')](handleError(_0x5d54f6,null));};exports[_0x3eb4('0x46')]=function(_0x2b190d,_0x52064c){var _0x4369e4={'raw':!![],'where':{'id':_0x2b190d[_0x3eb4('0x47')]['id']}},_0x5ba75={};_0x5ba75[_0x3eb4('0x32')]=_[_0x3eb4('0x33')](db[_0x3eb4('0x2f')][_0x3eb4('0x30')]);_0x5ba75['query']=_[_0x3eb4('0x33')](_0x2b190d[_0x3eb4('0x34')]);_0x5ba75[_0x3eb4('0x3d')]=_['intersection'](_0x5ba75[_0x3eb4('0x32')],_0x5ba75['query']);_0x4369e4[_0x3eb4('0x37')]=_[_0x3eb4('0x35')](_0x5ba75[_0x3eb4('0x32')],qs[_0x3eb4('0x36')](_0x2b190d[_0x3eb4('0x34')]['fields']));_0x4369e4[_0x3eb4('0x37')]=_0x4369e4['attributes'][_0x3eb4('0x38')]?_0x4369e4[_0x3eb4('0x37')]:_0x5ba75['model'];if(_0x2b190d[_0x3eb4('0x34')][_0x3eb4('0x43')]){_0x4369e4['include']=[{'all':!![]}];}_0x4369e4=_[_0x3eb4('0x40')]({},_0x4369e4,_0x2b190d[_0x3eb4('0x48')]);return db[_0x3eb4('0x2f')][_0x3eb4('0x49')](_0x4369e4)[_0x3eb4('0x28')](handleEntityNotFound(_0x52064c,null))[_0x3eb4('0x28')](respondWithResult(_0x52064c,null))[_0x3eb4('0x45')](handleError(_0x52064c,null));};exports[_0x3eb4('0x4a')]=function(_0x3d7b01,_0x594d0d){return db['VoiceDialReport'][_0x3eb4('0x4a')](_0x3d7b01[_0x3eb4('0x4b')],{})[_0x3eb4('0x28')](respondWithResult(_0x594d0d,0xc9))[_0x3eb4('0x45')](handleError(_0x594d0d,null));};exports[_0x3eb4('0x27')]=function(_0x5603ee,_0x7b1a8a){if(_0x5603ee['body']['id']){delete _0x5603ee[_0x3eb4('0x4b')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x5603ee[_0x3eb4('0x47')]['id']}})['then'](handleEntityNotFound(_0x7b1a8a,null))[_0x3eb4('0x28')](saveUpdates(_0x5603ee[_0x3eb4('0x4b')],null))['then'](respondWithResult(_0x7b1a8a,null))['catch'](handleError(_0x7b1a8a,null));};exports[_0x3eb4('0x29')]=function(_0x29cbf7,_0x434cf3){return db[_0x3eb4('0x2f')][_0x3eb4('0x49')]({'where':{'id':_0x29cbf7['params']['id']}})['then'](handleEntityNotFound(_0x434cf3,null))[_0x3eb4('0x28')](removeEntity(_0x434cf3,null))[_0x3eb4('0x45')](handleError(_0x434cf3,null));};exports[_0x3eb4('0x4c')]=function(_0x150564,_0x311fa1){return db[_0x3eb4('0x2f')][_0x3eb4('0x4c')]()[_0x3eb4('0x28')](respondWithResult(_0x311fa1,null))[_0x3eb4('0x45')](handleError(_0x311fa1,null));}; \ No newline at end of file +var _0x39ec=['findAll','rows','params','rawAttributes','options','create','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','error','stack','name','index','map','VoiceDialReport','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x39ec,0xa4));var _0xc39e=function(_0x1d0ef5,_0x11ecaf){_0x1d0ef5=_0x1d0ef5-0x0;var _0xab1b=_0x39ec[_0x1d0ef5];return _0xab1b;};'use strict';var emlformat=require(_0xc39e('0x0'));var rimraf=require(_0xc39e('0x1'));var zipdir=require(_0xc39e('0x2'));var jsonpatch=require(_0xc39e('0x3'));var rp=require('request-promise');var moment=require(_0xc39e('0x4'));var BPromise=require(_0xc39e('0x5'));var Mustache=require(_0xc39e('0x6'));var util=require(_0xc39e('0x7'));var path=require(_0xc39e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc39e('0x9'));var fs=require('fs');var fs_extra=require(_0xc39e('0xa'));var _=require(_0xc39e('0xb'));var squel=require(_0xc39e('0xc'));var crypto=require(_0xc39e('0xd'));var jsforce=require(_0xc39e('0xe'));var deskjs=require(_0xc39e('0xf'));var toCsv=require(_0xc39e('0x10'));var querystring=require('querystring');var Papa=require(_0xc39e('0x11'));var Redis=require(_0xc39e('0x12'));var authService=require(_0xc39e('0x13'));var qs=require(_0xc39e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc39e('0x15'));var logger=require(_0xc39e('0x16'))(_0xc39e('0x17'));var utils=require('../../config/utils');var config=require(_0xc39e('0x18'));var licenseUtil=require(_0xc39e('0x19'));var db=require(_0xc39e('0x1a'))['db'];function respondWithStatusCode(_0x443c25,_0x4bbf63){_0x4bbf63=_0x4bbf63||0xcc;return function(_0x4bf1a6){if(_0x4bf1a6){return _0x443c25[_0xc39e('0x1b')](_0x4bbf63);}return _0x443c25[_0xc39e('0x1c')](_0x4bbf63)[_0xc39e('0x1d')]();};}function respondWithResult(_0x5aba12,_0xdd2239){_0xdd2239=_0xdd2239||0xc8;return function(_0x31943a){if(_0x31943a){return _0x5aba12[_0xc39e('0x1c')](_0xdd2239)['json'](_0x31943a);}};}function respondWithFilteredResult(_0x217be2,_0x2b9da5){return function(_0x59f2db){if(_0x59f2db){var _0x5834cf=typeof _0x2b9da5['offset']===_0xc39e('0x1e')&&typeof _0x2b9da5[_0xc39e('0x1f')]==='undefined';var _0x5443ec=_0x59f2db[_0xc39e('0x20')];var _0xf2c96a=_0x5834cf?0x0:_0x2b9da5[_0xc39e('0x21')];var _0x309faf=_0x5834cf?_0x59f2db['count']:_0x2b9da5[_0xc39e('0x21')]+_0x2b9da5['limit'];var _0x2bc3e2;if(_0x309faf>=_0x5443ec){_0x309faf=_0x5443ec;_0x2bc3e2=0xc8;}else{_0x2bc3e2=0xce;}_0x217be2['status'](_0x2bc3e2);return _0x217be2['set'](_0xc39e('0x22'),_0xf2c96a+'-'+_0x309faf+'/'+_0x5443ec)[_0xc39e('0x23')](_0x59f2db);}return null;};}function patchUpdates(_0x1bea5f){return function(_0x540617){try{jsonpatch[_0xc39e('0x24')](_0x540617,_0x1bea5f,!![]);}catch(_0x51bfdb){return BPromise['reject'](_0x51bfdb);}return _0x540617[_0xc39e('0x25')]();};}function saveUpdates(_0x3aa717,_0x649749){return function(_0x1d1024){if(_0x1d1024){return _0x1d1024[_0xc39e('0x26')](_0x3aa717)['then'](function(_0xa29c22){return _0xa29c22;});}return null;};}function removeEntity(_0xdb94bc,_0x25defc){return function(_0x358504){if(_0x358504){return _0x358504[_0xc39e('0x27')]()['then'](function(){_0xdb94bc[_0xc39e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bac4f,_0x10b9eb){return function(_0x224a2a){if(!_0x224a2a){_0x5bac4f[_0xc39e('0x1b')](0x194);}return _0x224a2a;};}function handleError(_0x158155,_0x16b865){_0x16b865=_0x16b865||0x1f4;return function(_0x264ecc){logger[_0xc39e('0x28')](_0x264ecc[_0xc39e('0x29')]);if(_0x264ecc[_0xc39e('0x2a')]){delete _0x264ecc[_0xc39e('0x2a')];}_0x158155['status'](_0x16b865)['send'](_0x264ecc);};}exports[_0xc39e('0x2b')]=function(_0x40f629,_0x3caa7c){var _0x51d9c2={},_0x2b9055={},_0x4a7117={'count':0x0,'rows':[]};var _0x5d8bc4=_[_0xc39e('0x2c')](db[_0xc39e('0x2d')]['rawAttributes'],function(_0x36a67c){return{'name':_0x36a67c[_0xc39e('0x2e')],'type':_0x36a67c[_0xc39e('0x2f')]['key']};});_0x2b9055['model']=_[_0xc39e('0x2c')](_0x5d8bc4,'name');_0x2b9055['query']=_[_0xc39e('0x30')](_0x40f629[_0xc39e('0x31')]);_0x2b9055[_0xc39e('0x32')]=_[_0xc39e('0x33')](_0x2b9055[_0xc39e('0x34')],_0x2b9055['query']);_0x51d9c2[_0xc39e('0x35')]=_[_0xc39e('0x33')](_0x2b9055['model'],qs[_0xc39e('0x36')](_0x40f629[_0xc39e('0x31')]['fields']));_0x51d9c2[_0xc39e('0x35')]=_0x51d9c2[_0xc39e('0x35')][_0xc39e('0x37')]?_0x51d9c2['attributes']:_0x2b9055[_0xc39e('0x34')];if(!_0x40f629[_0xc39e('0x31')][_0xc39e('0x38')](_0xc39e('0x39'))){_0x51d9c2[_0xc39e('0x1f')]=qs['limit'](_0x40f629[_0xc39e('0x31')][_0xc39e('0x1f')]);_0x51d9c2[_0xc39e('0x21')]=qs[_0xc39e('0x21')](_0x40f629[_0xc39e('0x31')][_0xc39e('0x21')]);}_0x51d9c2[_0xc39e('0x3a')]=qs[_0xc39e('0x3b')](_0x40f629[_0xc39e('0x31')][_0xc39e('0x3b')]);_0x51d9c2[_0xc39e('0x3c')]=qs['filters'](_[_0xc39e('0x3d')](_0x40f629[_0xc39e('0x31')],_0x2b9055[_0xc39e('0x32')]),_0x5d8bc4);if(_0x40f629[_0xc39e('0x31')]['filter']){_0x51d9c2[_0xc39e('0x3c')]=_[_0xc39e('0x3e')](_0x51d9c2[_0xc39e('0x3c')],{'$or':_['map'](_0x5d8bc4,function(_0x5d8947){if(_0x5d8947[_0xc39e('0x2f')]!==_0xc39e('0x3f')){var _0x50345b={};_0x50345b[_0x5d8947[_0xc39e('0x2a')]]={'$like':'%'+_0x40f629['query'][_0xc39e('0x40')]+'%'};return _0x50345b;}})});}_0x51d9c2=_[_0xc39e('0x3e')]({},_0x51d9c2,_0x40f629['options']);var _0x189580={'where':_0x51d9c2['where']};return db[_0xc39e('0x2d')]['count'](_0x189580)[_0xc39e('0x41')](function(_0xd94dc9){_0x4a7117[_0xc39e('0x20')]=_0xd94dc9;if(_0x40f629[_0xc39e('0x31')][_0xc39e('0x42')]){_0x51d9c2['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xc39e('0x43')](_0x51d9c2);})[_0xc39e('0x41')](function(_0xc9e93){_0x4a7117[_0xc39e('0x44')]=_0xc9e93;return _0x4a7117;})[_0xc39e('0x41')](respondWithFilteredResult(_0x3caa7c,_0x51d9c2))['catch'](handleError(_0x3caa7c,null));};exports['show']=function(_0x443fe0,_0x4c8a5c){var _0x25f783={'raw':!![],'where':{'id':_0x443fe0[_0xc39e('0x45')]['id']}},_0x43ae8c={};_0x43ae8c['model']=_['keys'](db['VoiceDialReport'][_0xc39e('0x46')]);_0x43ae8c[_0xc39e('0x31')]=_[_0xc39e('0x30')](_0x443fe0[_0xc39e('0x31')]);_0x43ae8c[_0xc39e('0x32')]=_[_0xc39e('0x33')](_0x43ae8c[_0xc39e('0x34')],_0x43ae8c[_0xc39e('0x31')]);_0x25f783[_0xc39e('0x35')]=_[_0xc39e('0x33')](_0x43ae8c[_0xc39e('0x34')],qs[_0xc39e('0x36')](_0x443fe0['query'][_0xc39e('0x36')]));_0x25f783[_0xc39e('0x35')]=_0x25f783[_0xc39e('0x35')]['length']?_0x25f783[_0xc39e('0x35')]:_0x43ae8c['model'];if(_0x443fe0['query'][_0xc39e('0x42')]){_0x25f783['include']=[{'all':!![]}];}_0x25f783=_[_0xc39e('0x3e')]({},_0x25f783,_0x443fe0[_0xc39e('0x47')]);return db[_0xc39e('0x2d')]['find'](_0x25f783)[_0xc39e('0x41')](handleEntityNotFound(_0x4c8a5c,null))['then'](respondWithResult(_0x4c8a5c,null))['catch'](handleError(_0x4c8a5c,null));};exports[_0xc39e('0x48')]=function(_0x2a70dd,_0x10693d){return db[_0xc39e('0x2d')]['create'](_0x2a70dd['body'],{})[_0xc39e('0x41')](respondWithResult(_0x10693d,0xc9))[_0xc39e('0x49')](handleError(_0x10693d,null));};exports[_0xc39e('0x26')]=function(_0x316ca9,_0x455ac0){if(_0x316ca9[_0xc39e('0x4a')]['id']){delete _0x316ca9[_0xc39e('0x4a')]['id'];}return db[_0xc39e('0x2d')][_0xc39e('0x4b')]({'where':{'id':_0x316ca9[_0xc39e('0x45')]['id']}})[_0xc39e('0x41')](handleEntityNotFound(_0x455ac0,null))[_0xc39e('0x41')](saveUpdates(_0x316ca9['body'],null))[_0xc39e('0x41')](respondWithResult(_0x455ac0,null))[_0xc39e('0x49')](handleError(_0x455ac0,null));};exports['destroy']=function(_0x4312a8,_0x5ea0c8){return db[_0xc39e('0x2d')][_0xc39e('0x4b')]({'where':{'id':_0x4312a8[_0xc39e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ea0c8,null))['then'](removeEntity(_0x5ea0c8,null))['catch'](handleError(_0x5ea0c8,null));};exports['describe']=function(_0x37af38,_0x252260){return db['VoiceDialReport'][_0xc39e('0x4c')]()[_0xc39e('0x41')](respondWithResult(_0x252260,null))[_0xc39e('0x49')](handleError(_0x252260,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0dfdff2..7b350e2 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 _0x61d7=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','util','../../config/logger','api','moment'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x61d7,0x1dd));var _0x761d=function(_0x36672f,_0x524068){_0x36672f=_0x36672f-0x0;var _0x30acfa=_0x61d7[_0x36672f];return _0x30acfa;};'use strict';var _=require('lodash');var util=require(_0x761d('0x0'));var logger=require(_0x761d('0x1'))(_0x761d('0x2'));var moment=require(_0x761d('0x3'));var BPromise=require(_0x761d('0x4'));var rp=require(_0x761d('0x5'));var fs=require('fs');var path=require(_0x761d('0x6'));var rimraf=require(_0x761d('0x7'));var config=require(_0x761d('0x8'));var attributes=require(_0x761d('0x9'));module[_0x761d('0xa')]=function(_0x1aec9d,_0xc06ff9){return _0x1aec9d['define'](_0x761d('0xb'),attributes,{'tableName':_0x761d('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2af3=['api','moment','bluebird','path','exports','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger'];(function(_0x5dd147,_0x44f71f){var _0x51fd57=function(_0x50d375){while(--_0x50d375){_0x5dd147['push'](_0x5dd147['shift']());}};_0x51fd57(++_0x44f71f);}(_0x2af3,0xbc));var _0x32af=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0x2af3[_0x46e3ff];return _0x4bf847;};'use strict';var _=require(_0x32af('0x0'));var util=require('util');var logger=require(_0x32af('0x1'))(_0x32af('0x2'));var moment=require(_0x32af('0x3'));var BPromise=require(_0x32af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32af('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x32af('0x6')]=function(_0x346938,_0x4ac619){return _0x346938['define'](_0x32af('0x7'),attributes,{'tableName':_0x32af('0x8'),'paranoid':![],'indexes':[{'fields':[_0x32af('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 971a035..d3caa33 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 _0x986e=['request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x2d056d,_0x53f6c3){var _0x430fca=function(_0x38e4ee){while(--_0x38e4ee){_0x2d056d['push'](_0x2d056d['shift']());}};_0x430fca(++_0x53f6c3);}(_0x986e,0x9b));var _0xe986=function(_0x5e4cd6,_0xfb732a){_0x5e4cd6=_0x5e4cd6-0x0;var _0xd7c226=_0x986e[_0x5e4cd6];return _0xd7c226;};'use strict';var _=require(_0xe986('0x0'));var util=require(_0xe986('0x1'));var moment=require(_0xe986('0x2'));var BPromise=require('bluebird');var rs=require(_0xe986('0x3'));var fs=require('fs');var Redis=require(_0xe986('0x4'));var db=require(_0xe986('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe986('0x6'))(_0xe986('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe986('0x8')][_0xe986('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x139290,_0x7d3aba,_0x402125){return new BPromise(function(_0x1b9547,_0x4e30c0){return client[_0xe986('0xa')](_0x139290,_0x402125)[_0xe986('0xb')](function(_0x2287a5){logger['info'](_0xe986('0xc'),_0x7d3aba,_0xe986('0xd'));logger[_0xe986('0xe')](_0xe986('0xf'),_0x7d3aba,_0xe986('0xd'),JSON[_0xe986('0x10')](_0x2287a5));if(_0x2287a5['error']){if(_0x2287a5['error'][_0xe986('0x11')]===0x1f4){logger[_0xe986('0x12')](_0xe986('0xc'),_0x7d3aba,_0x2287a5[_0xe986('0x12')][_0xe986('0x13')]);return _0x4e30c0(_0x2287a5[_0xe986('0x12')][_0xe986('0x13')]);}logger['error'](_0xe986('0xc'),_0x7d3aba,_0x2287a5[_0xe986('0x12')]['message']);return _0x1b9547(_0x2287a5[_0xe986('0x12')]['message']);}else{logger[_0xe986('0x14')](_0xe986('0xc'),_0x7d3aba,'request\x20sent');_0x1b9547(_0x2287a5[_0xe986('0x15')][_0xe986('0x13')]);}})[_0xe986('0x16')](function(_0x5c8a7a){logger['error'](_0xe986('0xc'),_0x7d3aba,_0x5c8a7a);_0x4e30c0(_0x5c8a7a);});});}exports[_0xe986('0x17')]=function(_0xcada64){var _0x29d2c4=this;return new Promise(function(_0x214fe4,_0x14f29b){return db[_0xe986('0x18')][_0xe986('0x19')](_0xcada64[_0xe986('0x1a')],{'raw':_0xcada64[_0xe986('0x1b')]?_0xcada64[_0xe986('0x1b')][_0xe986('0x1c')]===undefined?!![]:![]:!![]})[_0xe986('0xb')](function(_0x5d1f77){logger[_0xe986('0x14')](_0xe986('0x17'),_0xcada64);logger[_0xe986('0xe')](_0xe986('0x17'),_0xcada64,JSON[_0xe986('0x10')](_0x5d1f77));_0x214fe4(_0x5d1f77);})[_0xe986('0x16')](function(_0x29317d){logger[_0xe986('0x12')](_0xe986('0x17'),_0x29317d[_0xe986('0x13')],_0xcada64);_0x14f29b(_0x29d2c4['error'](0x1f4,_0x29317d['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4f394c){var _0x30d0a9=this;return new Promise(function(_0x19dec9,_0x51362b){return db[_0xe986('0x18')]['update'](_0x4f394c[_0xe986('0x1a')],{'raw':_0x4f394c[_0xe986('0x1b')]?_0x4f394c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f394c['options']?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1d')]||null:null,'attributes':_0x4f394c['options']?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1e')]||null:null,'limit':_0x4f394c[_0xe986('0x1b')]?_0x4f394c[_0xe986('0x1b')][_0xe986('0x1f')]||null:null})[_0xe986('0xb')](function(_0x5b8924){logger['info'](_0xe986('0x20'),_0x4f394c);logger[_0xe986('0xe')](_0xe986('0x20'),_0x4f394c,JSON['stringify'](_0x5b8924));_0x19dec9(_0x5b8924);})[_0xe986('0x16')](function(_0x228859){logger[_0xe986('0x12')](_0xe986('0x20'),_0x228859[_0xe986('0x13')],_0x4f394c);_0x51362b(_0x30d0a9[_0xe986('0x12')](0x1f4,_0x228859[_0xe986('0x13')]));});});}; \ No newline at end of file +var _0xf0ce=['options','raw','catch','UpdateVoiceDialReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf0ce,0x67));var _0xef0c=function(_0x6c6934,_0x4df5cb){_0x6c6934=_0x6c6934-0x0;var _0x576eda=_0xf0ce[_0x6c6934];return _0x576eda;};'use strict';var _=require(_0xef0c('0x0'));var util=require(_0xef0c('0x1'));var moment=require(_0xef0c('0x2'));var BPromise=require(_0xef0c('0x3'));var rs=require(_0xef0c('0x4'));var fs=require('fs');var Redis=require(_0xef0c('0x5'));var db=require(_0xef0c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xef0c('0x7'))('rpc');var config=require(_0xef0c('0x8'));var jayson=require(_0xef0c('0x9'));var client=jayson['client'][_0xef0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x887414,_0x2eb50a,_0x420ffd){return new BPromise(function(_0x21c841,_0x1d6c2f){return client['request'](_0x887414,_0x420ffd)[_0xef0c('0xb')](function(_0x4c6ab5){logger[_0xef0c('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x2eb50a,_0xef0c('0xd'));logger[_0xef0c('0xe')](_0xef0c('0xf'),_0x2eb50a,'request\x20sent',JSON[_0xef0c('0x10')](_0x4c6ab5));if(_0x4c6ab5[_0xef0c('0x11')]){if(_0x4c6ab5['error'][_0xef0c('0x12')]===0x1f4){logger[_0xef0c('0x11')](_0xef0c('0x13'),_0x2eb50a,_0x4c6ab5[_0xef0c('0x11')][_0xef0c('0x14')]);return _0x1d6c2f(_0x4c6ab5['error'][_0xef0c('0x14')]);}logger[_0xef0c('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2eb50a,_0x4c6ab5[_0xef0c('0x11')][_0xef0c('0x14')]);return _0x21c841(_0x4c6ab5['error'][_0xef0c('0x14')]);}else{logger[_0xef0c('0xc')](_0xef0c('0x13'),_0x2eb50a,_0xef0c('0xd'));_0x21c841(_0x4c6ab5[_0xef0c('0x15')][_0xef0c('0x14')]);}})['catch'](function(_0x12c7d8){logger[_0xef0c('0x11')](_0xef0c('0x13'),_0x2eb50a,_0x12c7d8);_0x1d6c2f(_0x12c7d8);});});}exports[_0xef0c('0x16')]=function(_0x5a208d){var _0x5453b3=this;return new Promise(function(_0x4a61cc,_0x182410){return db[_0xef0c('0x17')][_0xef0c('0x18')](_0x5a208d['body'],{'raw':_0x5a208d['options']?_0x5a208d[_0xef0c('0x19')][_0xef0c('0x1a')]===undefined?!![]:![]:!![]})[_0xef0c('0xb')](function(_0x15725f){logger[_0xef0c('0xc')](_0xef0c('0x16'),_0x5a208d);logger[_0xef0c('0xe')](_0xef0c('0x16'),_0x5a208d,JSON['stringify'](_0x15725f));_0x4a61cc(_0x15725f);})[_0xef0c('0x1b')](function(_0x1e7484){logger[_0xef0c('0x11')]('CreateVoiceDialReport',_0x1e7484[_0xef0c('0x14')],_0x5a208d);_0x182410(_0x5453b3[_0xef0c('0x11')](0x1f4,_0x1e7484[_0xef0c('0x14')]));});});};exports[_0xef0c('0x1c')]=function(_0x34e98a){var _0x48da07=this;return new Promise(function(_0x1570ff,_0x328ede){return db[_0xef0c('0x17')][_0xef0c('0x1d')](_0x34e98a[_0xef0c('0x1e')],{'raw':_0x34e98a['options']?_0x34e98a[_0xef0c('0x19')][_0xef0c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34e98a[_0xef0c('0x19')]?_0x34e98a[_0xef0c('0x19')][_0xef0c('0x1f')]||null:null,'attributes':_0x34e98a[_0xef0c('0x19')]?_0x34e98a[_0xef0c('0x19')]['attributes']||null:null,'limit':_0x34e98a['options']?_0x34e98a[_0xef0c('0x19')]['limit']||null:null})[_0xef0c('0xb')](function(_0x2dc43b){logger[_0xef0c('0xc')]('UpdateVoiceDialReport',_0x34e98a);logger[_0xef0c('0xe')](_0xef0c('0x1c'),_0x34e98a,JSON['stringify'](_0x2dc43b));_0x1570ff(_0x2dc43b);})[_0xef0c('0x1b')](function(_0x8f5449){logger['error'](_0xef0c('0x1c'),_0x8f5449[_0xef0c('0x14')],_0x34e98a);_0x328ede(_0x48da07[_0xef0c('0x11')](0x1f4,_0x8f5449[_0xef0c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 5f2866f..c0a5ed3 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 _0xf90d=['fs-extra','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xf90d,0x1e9));var _0xdf90=function(_0x41155b,_0x93f27a){_0x41155b=_0x41155b-0x0;var _0x5acfe9=_0xf90d[_0x41155b];return _0x5acfe9;};'use strict';var multer=require(_0xdf90('0x0'));var util=require(_0xdf90('0x1'));var path=require(_0xdf90('0x2'));var timeout=require(_0xdf90('0x3'));var express=require(_0xdf90('0x4'));var router=express['Router']();var fs_extra=require(_0xdf90('0x5'));var auth=require(_0xdf90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf90('0x7'));router[_0xdf90('0x8')]('/',auth[_0xdf90('0x9')](),controller[_0xdf90('0xa')]);router['get'](_0xdf90('0xb'),auth[_0xdf90('0x9')](),controller[_0xdf90('0xc')]);router[_0xdf90('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdf90('0xd')](_0xdf90('0xe'),auth['isAuthenticated'](),controller[_0xdf90('0xf')]);router[_0xdf90('0x10')](_0xdf90('0xb'),auth[_0xdf90('0x9')](),controller[_0xdf90('0x11')]);router['delete']('/:id',auth[_0xdf90('0x9')](),controller['destroy']);module[_0xdf90('0x12')]=router; \ No newline at end of file +var _0x840e=['/:id/applications','addApplications','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','post','create'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x840e,0x162));var _0xe840=function(_0x2ea9fd,_0x45d80b){_0x2ea9fd=_0x2ea9fd-0x0;var _0x27d18e=_0x840e[_0x2ea9fd];return _0x27d18e;};'use strict';var multer=require(_0xe840('0x0'));var util=require(_0xe840('0x1'));var path=require('path');var timeout=require(_0xe840('0x2'));var express=require(_0xe840('0x3'));var router=express['Router']();var fs_extra=require(_0xe840('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe840('0x5'));var config=require(_0xe840('0x6'));var controller=require(_0xe840('0x7'));router[_0xe840('0x8')]('/',auth['isAuthenticated'](),controller[_0xe840('0x9')]);router[_0xe840('0x8')](_0xe840('0xa'),auth[_0xe840('0xb')](),controller['show']);router[_0xe840('0xc')]('/',auth[_0xe840('0xb')](),controller[_0xe840('0xd')]);router[_0xe840('0xc')](_0xe840('0xe'),auth['isAuthenticated'](),controller[_0xe840('0xf')]);router['put'](_0xe840('0xa'),auth[_0xe840('0xb')](),controller['update']);router['delete'](_0xe840('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d34c465..51796e4 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 _0xe91d=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','outbound','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x4446c,_0x23e340){var _0x5a82f0=function(_0x1a6824){while(--_0x1a6824){_0x4446c['push'](_0x4446c['shift']());}};_0x5a82f0(++_0x23e340);}(_0xe91d,0xd2));var _0xde91=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xe91d[_0x1f7996];return _0x584609;};'use strict';var Sequelize=require(_0xde91('0x0'));module[_0xde91('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde91('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xde91('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':_0xde91('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xde91('0x5')]('inbound',_0xde91('0x6'),'internal',_0xde91('0x7'),_0xde91('0x8'),_0xde91('0x9'),_0xde91('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xde91('0x3')]},'interval':{'type':Sequelize[_0xde91('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xde91('0xb')]},'isApp':{'type':Sequelize[_0xde91('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xde91('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xde91('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xde91('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xde91('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xde91('0xd')},'answer':{'type':Sequelize[_0xde91('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xde91('0xe')],'get':function(_0x320b1a){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xde91('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x9bd0=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','NoOp','ENUM','inbound','outbound','outbound-fax','system'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x9bd0,0x129));var _0x09bd=function(_0x4a7b8a,_0x3833f1){_0x4a7b8a=_0x4a7b8a-0x0;var _0x362b7a=_0x9bd0[_0x4a7b8a];return _0x362b7a;};'use strict';var Sequelize=require(_0x09bd('0x0'));module[_0x09bd('0x1')]={'context':{'type':Sequelize[_0x09bd('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x09bd('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x09bd('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x09bd('0x2')],'allowNull':![],'defaultValue':_0x09bd('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x09bd('0x4')](_0x09bd('0x5'),_0x09bd('0x6'),'internal','inbound-fax',_0x09bd('0x7'),_0x09bd('0x8'),_0x09bd('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x09bd('0x2')]},'interval':{'type':Sequelize[_0x09bd('0x2')],'allowNull':![],'defaultValue':_0x09bd('0xa')},'IntervalId':{'type':Sequelize[_0x09bd('0xb')]},'isApp':{'type':Sequelize[_0x09bd('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x09bd('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x09bd('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x09bd('0xb')]},'recordingFormat':{'type':Sequelize[_0x09bd('0x2')],'defaultValue':_0x09bd('0xd')},'answer':{'type':Sequelize[_0x09bd('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x09bd('0xe')],'get':function(_0x1625a8){return this[_0x09bd('0xf')](_0x09bd('0x10'));}},'alias':{'type':Sequelize[_0x09bd('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 9c8df89..689d113 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 _0xbca8=['catch','params','keys','rawAttributes','destroy','create','startsWith','exten','body','concat','user','InboundRoutes','OutboundRoutes','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','VoiceExtensionId','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','get','outbound','InternalRoutes','value','includes','type','find','name','UserProfileResource','error','index','VoiceExtension','fieldName','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','includeAll','include','findAll'];(function(_0x2c8bf6,_0x56eab8){var _0x11efa8=function(_0x3f43f0){while(--_0x3f43f0){_0x2c8bf6['push'](_0x2c8bf6['shift']());}};_0x11efa8(++_0x56eab8);}(_0xbca8,0xcc));var _0x8bca=function(_0x28ce9c,_0x1c5669){_0x28ce9c=_0x28ce9c-0x0;var _0x9b7417=_0xbca8[_0x28ce9c];return _0x9b7417;};'use strict';var _=require(_0x8bca('0x0'));var Redis=require(_0x8bca('0x1'));var qs=require(_0x8bca('0x2'));var logger=require(_0x8bca('0x3'))(_0x8bca('0x4'));var config=require('../../config/environment');var db=require(_0x8bca('0x5'))['db'];config[_0x8bca('0x6')]=_[_0x8bca('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8bca('0x8'))(new Redis(config[_0x8bca('0x6')]));require(_0x8bca('0x9'))[_0x8bca('0xa')](socket);function respondWithStatusCode(_0x4b3267,_0x3fdccf){_0x3fdccf=_0x3fdccf||0xcc;return function(_0x38e241){if(_0x38e241){return _0x4b3267[_0x8bca('0xb')](_0x3fdccf);}return _0x4b3267[_0x8bca('0xc')](_0x3fdccf)[_0x8bca('0xd')]();};}function respondWithResult(_0xe266ca,_0x229cc4){_0x229cc4=_0x229cc4||0xc8;return function(_0x4ee4a0){if(_0x4ee4a0){return _0xe266ca['status'](_0x229cc4)[_0x8bca('0xe')](_0x4ee4a0);}};}function respondWithFilteredResult(_0x38c607,_0x4ece4f){return function(_0x493890){if(_0x493890){var _0x31afa0=typeof _0x4ece4f['offset']===_0x8bca('0xf')&&typeof _0x4ece4f[_0x8bca('0x10')]==='undefined';var _0x62c6d1=_0x493890[_0x8bca('0x11')];var _0xc65875=_0x31afa0?0x0:_0x4ece4f[_0x8bca('0x12')];var _0x5d32dc=_0x31afa0?_0x493890['count']:_0x4ece4f[_0x8bca('0x12')]+_0x4ece4f['limit'];var _0x25691b;if(_0x5d32dc>=_0x62c6d1){_0x5d32dc=_0x62c6d1;_0x25691b=0xc8;}else{_0x25691b=0xce;}_0x38c607[_0x8bca('0xc')](_0x25691b);return _0x38c607[_0x8bca('0x13')](_0x8bca('0x14'),_0xc65875+'-'+_0x5d32dc+'/'+_0x62c6d1)[_0x8bca('0xe')](_0x493890);}return null;};}function removeEntity(_0x1c78d5){return function(_0x487305){if(_0x487305){return _0x487305['destroy']()[_0x8bca('0x15')](function(){var _0x4d3cc3=_0x487305[_0x8bca('0x16')]({'plain':!![]});var _0x25c5c1=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x8bca('0x17'),'ignore':![]},{'name':_0x8bca('0x18'),'value':'internal','ignore':![]}];var _0x1a834c=_(_0x25c5c1)['filter']('ignore')['map'](_0x8bca('0x19'))[_0x8bca('0x19')]();if(_[_0x8bca('0x1a')](_0x1a834c,_0x4d3cc3[_0x8bca('0x1b')])){return;}var _0x2d64cd=_[_0x8bca('0x1c')](_0x25c5c1,['value',_0x4d3cc3[_0x8bca('0x1b')]])[_0x8bca('0x1d')];return db[_0x8bca('0x1e')]['destroy']({'where':{'type':_0x2d64cd,'resourceId':_0x4d3cc3['id']}})[_0x8bca('0x15')](function(){return _0x487305;});})['then'](function(){_0x1c78d5[_0x8bca('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3522){return function(_0x3be409){if(!_0x3be409){_0x2e3522[_0x8bca('0xb')](0x194);}return _0x3be409;};}function handleError(_0x8620e2,_0x5d0b07){_0x5d0b07=_0x5d0b07||0x1f4;return function(_0x3a7498){logger[_0x8bca('0x1f')](_0x3a7498['stack']);if(_0x3a7498['name']){delete _0x3a7498[_0x8bca('0x1d')];}_0x8620e2[_0x8bca('0xc')](_0x5d0b07)['send'](_0x3a7498);};}exports[_0x8bca('0x20')]=function(_0x706106,_0x103b53){var _0x344eae={},_0x3cf3e5={},_0x54ccae={'count':0x0,'rows':[]};var _0x4767b5=_['map'](db[_0x8bca('0x21')]['rawAttributes'],function(_0x18ff94){return{'name':_0x18ff94[_0x8bca('0x22')],'type':_0x18ff94[_0x8bca('0x1b')][_0x8bca('0x23')]};});_0x3cf3e5['model']=_[_0x8bca('0x24')](_0x4767b5,_0x8bca('0x1d'));_0x3cf3e5[_0x8bca('0x25')]=_['keys'](_0x706106['query']);_0x3cf3e5['filters']=_[_0x8bca('0x26')](_0x3cf3e5[_0x8bca('0x27')],_0x3cf3e5[_0x8bca('0x25')]);_0x344eae['attributes']=_[_0x8bca('0x26')](_0x3cf3e5[_0x8bca('0x27')],qs['fields'](_0x706106[_0x8bca('0x25')][_0x8bca('0x28')]));_0x344eae[_0x8bca('0x29')]=_0x344eae[_0x8bca('0x29')][_0x8bca('0x2a')]?_0x344eae['attributes']:_0x3cf3e5[_0x8bca('0x27')];if(!_0x706106[_0x8bca('0x25')][_0x8bca('0x2b')](_0x8bca('0x2c'))){_0x344eae[_0x8bca('0x10')]=qs['limit'](_0x706106[_0x8bca('0x25')]['limit']);_0x344eae['offset']=qs[_0x8bca('0x12')](_0x706106[_0x8bca('0x25')]['offset']);}_0x344eae['order']=qs[_0x8bca('0x2d')](_0x706106[_0x8bca('0x25')][_0x8bca('0x2d')]);_0x344eae['where']=qs[_0x8bca('0x2e')](_['pick'](_0x706106[_0x8bca('0x25')],_0x3cf3e5[_0x8bca('0x2e')]),_0x4767b5);if(_0x706106['query'][_0x8bca('0x2f')]){_0x344eae[_0x8bca('0x30')]=_[_0x8bca('0x31')](_0x344eae['where'],{'$or':_[_0x8bca('0x24')](_0x4767b5,function(_0x2bbc9a){if(_0x2bbc9a['type']!=='VIRTUAL'){var _0x1e5cdf={};_0x1e5cdf[_0x2bbc9a[_0x8bca('0x1d')]]={'$like':'%'+_0x706106['query']['filter']+'%'};return _0x1e5cdf;}})});}_0x344eae=_[_0x8bca('0x31')]({},_0x344eae,_0x706106[_0x8bca('0x32')]);var _0x38bf1d={'where':_0x344eae[_0x8bca('0x30')]};return db[_0x8bca('0x21')][_0x8bca('0x11')](_0x38bf1d)['then'](function(_0x150b0d){_0x54ccae[_0x8bca('0x11')]=_0x150b0d;if(_0x706106[_0x8bca('0x25')][_0x8bca('0x33')]){_0x344eae[_0x8bca('0x34')]=[{'all':!![]}];}return db[_0x8bca('0x21')][_0x8bca('0x35')](_0x344eae);})[_0x8bca('0x15')](function(_0x508d16){_0x54ccae['rows']=_0x508d16;return _0x54ccae;})[_0x8bca('0x15')](respondWithFilteredResult(_0x103b53,_0x344eae))[_0x8bca('0x36')](handleError(_0x103b53,null));};exports['show']=function(_0x31314c,_0x2bc3ff){var _0x1e1c64={'raw':![],'where':{'id':_0x31314c[_0x8bca('0x37')]['id']}},_0x342561={};_0x342561[_0x8bca('0x27')]=_[_0x8bca('0x38')](db[_0x8bca('0x21')][_0x8bca('0x39')]);_0x342561['query']=_[_0x8bca('0x38')](_0x31314c['query']);_0x342561[_0x8bca('0x2e')]=_[_0x8bca('0x26')](_0x342561[_0x8bca('0x27')],_0x342561[_0x8bca('0x25')]);_0x1e1c64[_0x8bca('0x29')]=_[_0x8bca('0x26')](_0x342561['model'],qs[_0x8bca('0x28')](_0x31314c[_0x8bca('0x25')]['fields']));_0x1e1c64[_0x8bca('0x29')]=_0x1e1c64['attributes']['length']?_0x1e1c64['attributes']:_0x342561['model'];if(_0x31314c[_0x8bca('0x25')][_0x8bca('0x33')]){_0x1e1c64[_0x8bca('0x34')]=[{'all':!![]}];}_0x1e1c64=_[_0x8bca('0x31')]({},_0x1e1c64,_0x31314c['options']);return db[_0x8bca('0x21')][_0x8bca('0x1c')](_0x1e1c64)[_0x8bca('0x15')](handleEntityNotFound(_0x2bc3ff,null))[_0x8bca('0x15')](respondWithResult(_0x2bc3ff,null))['catch'](handleError(_0x2bc3ff,null));};exports[_0x8bca('0x3a')]=function(_0x3b279e,_0x39835e){return db[_0x8bca('0x21')][_0x8bca('0x1c')]({'where':{'id':_0x3b279e[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](handleEntityNotFound(_0x39835e,null))[_0x8bca('0x15')](removeEntity(_0x39835e,null))['catch'](handleError(_0x39835e,null));};exports[_0x8bca('0x3b')]=function(_0x154270,_0x504e67){if(_0x154270['body'][_0x8bca('0x1b')]===_0x8bca('0x17')&&!_[_0x8bca('0x3c')](_0x154270['body'][_0x8bca('0x3d')],'_')){_0x154270[_0x8bca('0x3e')]['exten']='_'[_0x8bca('0x3f')](_0x154270[_0x8bca('0x3e')][_0x8bca('0x3d')]);}return db[_0x8bca('0x21')]['create'](_0x154270[_0x8bca('0x3e')],{'raw':![]})[_0x8bca('0x15')](function(_0x4a1380){var _0x3174b0=_0x154270[_0x8bca('0x40')][_0x8bca('0x16')]({'plain':!![]});if(!_0x3174b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3174b0['role']==='user'){var _0xcd371e=_0x4a1380['get']({'plain':!![]});var _0x3547bd=[{'name':_0x8bca('0x41'),'value':'inbound'},{'name':_0x8bca('0x42'),'value':_0x8bca('0x17')},{'name':'InternalRoutes','value':_0x8bca('0x43')}];var _0x31e871=_['find'](_0x3547bd,['value',_0xcd371e['type']])[_0x8bca('0x1d')];return db[_0x8bca('0x44')][_0x8bca('0x1c')]({'where':{'name':_0x31e871,'userProfileId':_0x3174b0[_0x8bca('0x45')]},'raw':!![]})['then'](function(_0xc2ec12){if(_0xc2ec12&&_0xc2ec12[_0x8bca('0x46')]===0x0){return db[_0x8bca('0x1e')][_0x8bca('0x3b')]({'name':_0xcd371e[_0x8bca('0x1d')],'resourceId':_0xcd371e['id'],'type':_0xc2ec12[_0x8bca('0x1d')],'sectionId':_0xc2ec12['id']},{})[_0x8bca('0x15')](function(){return _0x4a1380;});}else{return _0x4a1380;}})[_0x8bca('0x36')](function(_0x47427f){logger[_0x8bca('0x1f')](_0x8bca('0x47'),_0x47427f);throw _0x47427f;});}return _0x4a1380;})[_0x8bca('0x15')](respondWithResult(_0x504e67,0xc9))[_0x8bca('0x36')](handleError(_0x504e67,null));};exports[_0x8bca('0x48')]=function(_0x3e1227,_0x5647b3){if(_0x3e1227[_0x8bca('0x3e')]['id']){delete _0x3e1227[_0x8bca('0x3e')]['id'];}return db['VoiceExtension'][_0x8bca('0x1c')]({'where':{'id':_0x3e1227[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](handleEntityNotFound(_0x5647b3,null))[_0x8bca('0x15')](function(_0xc2825d){if(_0xc2825d){return db[_0x8bca('0x21')][_0x8bca('0x48')](_[_0x8bca('0x49')](_0x3e1227[_0x8bca('0x3e')],[_0x8bca('0x3d'),_0x8bca('0x4a'),'description',_0x8bca('0x4b'),_0x8bca('0x4c'),_0x8bca('0x4d'),_0x8bca('0x4e')]),{'where':{'context':_0xc2825d['context'],'exten':_0xc2825d[_0x8bca('0x3d')]},'individualHooks':!![]})[_0x8bca('0x15')](function(_0x4171bf){return _0x4171bf;});}return null;})[_0x8bca('0x15')](respondWithStatusCode(_0x5647b3,null))['catch'](handleError(_0x5647b3,null));};exports[_0x8bca('0x4f')]=function(_0x29f017,_0x3d9693){return db[_0x8bca('0x21')][_0x8bca('0x50')]({'where':{'id':_0x29f017[_0x8bca('0x37')]['id']}})[_0x8bca('0x15')](function(_0x1284a5){if(_0x1284a5){return db['sequelize']['transaction'](function(_0x3a1ba7){return db[_0x8bca('0x21')][_0x8bca('0x3a')]({'where':{'VoiceExtensionId':_0x29f017[_0x8bca('0x37')]['id']},'transaction':_0x3a1ba7})[_0x8bca('0x15')](function(){var _0x2a1a7a=_['map'](_0x29f017[_0x8bca('0x3e')],function(_0x53e01e){_0x53e01e[_0x8bca('0x51')]=_0x29f017['params']['id'];_0x53e01e['isApp']=!![];return _0x53e01e;});return _0x1284a5['createRouting'](_0x2a1a7a);})[_0x8bca('0x15')](function(_0x381003){console[_0x8bca('0x52')](_0x8bca('0x53'),_0x381003);return db[_0x8bca('0x21')]['bulkCreate'](_0x381003,{'transaction':_0x3a1ba7});});})[_0x8bca('0x15')](function(){return db[_0x8bca('0x21')][_0x8bca('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x29f017[_0x8bca('0x37')]['id']},'order':_0x8bca('0x55')});});}})[_0x8bca('0x15')](respondWithResult(_0x3d9693,null))['catch'](handleError(_0x3d9693,null));}; \ No newline at end of file +var _0xb3cd=['../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','get','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','find','type','name','send','index','fieldName','key','model','map','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','findAll','catch','show','params','rawAttributes','length','include','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','value','UserProfileResource','error','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','VoiceExtensionId','createRouting','log','bulkCreate','cast(priority\x20as\x20unsigned)','ioredis','../../components/parsers/qs'];(function(_0x230daa,_0x2d4dd0){var _0x210dc5=function(_0x455859){while(--_0x455859){_0x230daa['push'](_0x230daa['shift']());}};_0x210dc5(++_0x2d4dd0);}(_0xb3cd,0xae));var _0xdb3c=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xb3cd[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var Redis=require(_0xdb3c('0x0'));var qs=require(_0xdb3c('0x1'));var logger=require(_0xdb3c('0x2'))(_0xdb3c('0x3'));var config=require(_0xdb3c('0x4'));var db=require(_0xdb3c('0x5'))['db'];config['redis']=_[_0xdb3c('0x6')](config[_0xdb3c('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb3c('0x7')]));require(_0xdb3c('0x8'))[_0xdb3c('0x9')](socket);function respondWithStatusCode(_0xaf6862,_0x5490aa){_0x5490aa=_0x5490aa||0xcc;return function(_0x17ed6e){if(_0x17ed6e){return _0xaf6862[_0xdb3c('0xa')](_0x5490aa);}return _0xaf6862[_0xdb3c('0xb')](_0x5490aa)[_0xdb3c('0xc')]();};}function respondWithResult(_0x31e824,_0x42c644){_0x42c644=_0x42c644||0xc8;return function(_0x133f03){if(_0x133f03){return _0x31e824[_0xdb3c('0xb')](_0x42c644)[_0xdb3c('0xd')](_0x133f03);}};}function respondWithFilteredResult(_0x44f24c,_0x13f082){return function(_0x1d4730){if(_0x1d4730){var _0x234055=typeof _0x13f082[_0xdb3c('0xe')]===_0xdb3c('0xf')&&typeof _0x13f082[_0xdb3c('0x10')]===_0xdb3c('0xf');var _0x2efbd8=_0x1d4730[_0xdb3c('0x11')];var _0x294c3d=_0x234055?0x0:_0x13f082[_0xdb3c('0xe')];var _0x478f69=_0x234055?_0x1d4730[_0xdb3c('0x11')]:_0x13f082[_0xdb3c('0xe')]+_0x13f082['limit'];var _0x1c1695;if(_0x478f69>=_0x2efbd8){_0x478f69=_0x2efbd8;_0x1c1695=0xc8;}else{_0x1c1695=0xce;}_0x44f24c[_0xdb3c('0xb')](_0x1c1695);return _0x44f24c[_0xdb3c('0x12')]('Content-Range',_0x294c3d+'-'+_0x478f69+'/'+_0x2efbd8)[_0xdb3c('0xd')](_0x1d4730);}return null;};}function removeEntity(_0x27c992){return function(_0xc27e53){if(_0xc27e53){return _0xc27e53[_0xdb3c('0x13')]()[_0xdb3c('0x14')](function(){var _0x3056a5=_0xc27e53[_0xdb3c('0x15')]({'plain':!![]});var _0x3c3f9d=[{'name':'InboundRoutes','value':_0xdb3c('0x16'),'ignore':![]},{'name':_0xdb3c('0x17'),'value':'outbound','ignore':![]},{'name':_0xdb3c('0x18'),'value':_0xdb3c('0x19'),'ignore':![]}];var _0x383246=_(_0x3c3f9d)[_0xdb3c('0x1a')](_0xdb3c('0x1b'))['map']('value')['value']();if(_['includes'](_0x383246,_0x3056a5['type'])){return;}var _0x53d556=_[_0xdb3c('0x1c')](_0x3c3f9d,['value',_0x3056a5[_0xdb3c('0x1d')]])[_0xdb3c('0x1e')];return db['UserProfileResource'][_0xdb3c('0x13')]({'where':{'type':_0x53d556,'resourceId':_0x3056a5['id']}})[_0xdb3c('0x14')](function(){return _0xc27e53;});})[_0xdb3c('0x14')](function(){_0x27c992[_0xdb3c('0xb')](0xcc)[_0xdb3c('0xc')]();});}};}function handleEntityNotFound(_0x166935){return function(_0x2dad32){if(!_0x2dad32){_0x166935[_0xdb3c('0xa')](0x194);}return _0x2dad32;};}function handleError(_0x2b3981,_0x21dbf7){_0x21dbf7=_0x21dbf7||0x1f4;return function(_0x48041a){logger['error'](_0x48041a['stack']);if(_0x48041a[_0xdb3c('0x1e')]){delete _0x48041a['name'];}_0x2b3981[_0xdb3c('0xb')](_0x21dbf7)[_0xdb3c('0x1f')](_0x48041a);};}exports[_0xdb3c('0x20')]=function(_0x207a07,_0x40bbbe){var _0x383a8f={},_0x4e7eb5={},_0x2a4389={'count':0x0,'rows':[]};var _0x1a8d80=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x274a32){return{'name':_0x274a32[_0xdb3c('0x21')],'type':_0x274a32['type'][_0xdb3c('0x22')]};});_0x4e7eb5[_0xdb3c('0x23')]=_[_0xdb3c('0x24')](_0x1a8d80,_0xdb3c('0x1e'));_0x4e7eb5['query']=_[_0xdb3c('0x25')](_0x207a07['query']);_0x4e7eb5[_0xdb3c('0x26')]=_[_0xdb3c('0x27')](_0x4e7eb5[_0xdb3c('0x23')],_0x4e7eb5['query']);_0x383a8f[_0xdb3c('0x28')]=_[_0xdb3c('0x27')](_0x4e7eb5['model'],qs[_0xdb3c('0x29')](_0x207a07['query'][_0xdb3c('0x29')]));_0x383a8f['attributes']=_0x383a8f['attributes']['length']?_0x383a8f[_0xdb3c('0x28')]:_0x4e7eb5[_0xdb3c('0x23')];if(!_0x207a07[_0xdb3c('0x2a')][_0xdb3c('0x2b')](_0xdb3c('0x2c'))){_0x383a8f[_0xdb3c('0x10')]=qs[_0xdb3c('0x10')](_0x207a07[_0xdb3c('0x2a')][_0xdb3c('0x10')]);_0x383a8f['offset']=qs[_0xdb3c('0xe')](_0x207a07[_0xdb3c('0x2a')][_0xdb3c('0xe')]);}_0x383a8f[_0xdb3c('0x2d')]=qs[_0xdb3c('0x2e')](_0x207a07[_0xdb3c('0x2a')][_0xdb3c('0x2e')]);_0x383a8f[_0xdb3c('0x2f')]=qs[_0xdb3c('0x26')](_[_0xdb3c('0x30')](_0x207a07[_0xdb3c('0x2a')],_0x4e7eb5[_0xdb3c('0x26')]),_0x1a8d80);if(_0x207a07[_0xdb3c('0x2a')][_0xdb3c('0x1a')]){_0x383a8f[_0xdb3c('0x2f')]=_[_0xdb3c('0x31')](_0x383a8f['where'],{'$or':_[_0xdb3c('0x24')](_0x1a8d80,function(_0x20a5d7){if(_0x20a5d7[_0xdb3c('0x1d')]!==_0xdb3c('0x32')){var _0x5b1927={};_0x5b1927[_0x20a5d7['name']]={'$like':'%'+_0x207a07['query'][_0xdb3c('0x1a')]+'%'};return _0x5b1927;}})});}_0x383a8f=_[_0xdb3c('0x31')]({},_0x383a8f,_0x207a07[_0xdb3c('0x33')]);var _0x2431ea={'where':_0x383a8f[_0xdb3c('0x2f')]};return db[_0xdb3c('0x34')][_0xdb3c('0x11')](_0x2431ea)[_0xdb3c('0x14')](function(_0x185d2f){_0x2a4389[_0xdb3c('0x11')]=_0x185d2f;if(_0x207a07['query']['includeAll']){_0x383a8f['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xdb3c('0x35')](_0x383a8f);})['then'](function(_0x3be1cc){_0x2a4389['rows']=_0x3be1cc;return _0x2a4389;})[_0xdb3c('0x14')](respondWithFilteredResult(_0x40bbbe,_0x383a8f))[_0xdb3c('0x36')](handleError(_0x40bbbe,null));};exports[_0xdb3c('0x37')]=function(_0x8bf1e,_0x5bbe55){var _0x354913={'raw':![],'where':{'id':_0x8bf1e[_0xdb3c('0x38')]['id']}},_0x26b0c1={};_0x26b0c1[_0xdb3c('0x23')]=_[_0xdb3c('0x25')](db[_0xdb3c('0x34')][_0xdb3c('0x39')]);_0x26b0c1[_0xdb3c('0x2a')]=_[_0xdb3c('0x25')](_0x8bf1e['query']);_0x26b0c1[_0xdb3c('0x26')]=_[_0xdb3c('0x27')](_0x26b0c1[_0xdb3c('0x23')],_0x26b0c1[_0xdb3c('0x2a')]);_0x354913['attributes']=_[_0xdb3c('0x27')](_0x26b0c1[_0xdb3c('0x23')],qs[_0xdb3c('0x29')](_0x8bf1e['query'][_0xdb3c('0x29')]));_0x354913['attributes']=_0x354913[_0xdb3c('0x28')][_0xdb3c('0x3a')]?_0x354913[_0xdb3c('0x28')]:_0x26b0c1['model'];if(_0x8bf1e['query']['includeAll']){_0x354913[_0xdb3c('0x3b')]=[{'all':!![]}];}_0x354913=_[_0xdb3c('0x31')]({},_0x354913,_0x8bf1e[_0xdb3c('0x33')]);return db[_0xdb3c('0x34')][_0xdb3c('0x1c')](_0x354913)[_0xdb3c('0x14')](handleEntityNotFound(_0x5bbe55,null))[_0xdb3c('0x14')](respondWithResult(_0x5bbe55,null))[_0xdb3c('0x36')](handleError(_0x5bbe55,null));};exports[_0xdb3c('0x13')]=function(_0x43924d,_0x40fa49){return db[_0xdb3c('0x34')][_0xdb3c('0x1c')]({'where':{'id':_0x43924d[_0xdb3c('0x38')]['id']}})[_0xdb3c('0x14')](handleEntityNotFound(_0x40fa49,null))[_0xdb3c('0x14')](removeEntity(_0x40fa49,null))['catch'](handleError(_0x40fa49,null));};exports[_0xdb3c('0x3c')]=function(_0x128dbe,_0x33e5b9){if(_0x128dbe[_0xdb3c('0x3d')][_0xdb3c('0x1d')]===_0xdb3c('0x3e')&&!_[_0xdb3c('0x3f')](_0x128dbe[_0xdb3c('0x3d')][_0xdb3c('0x40')],'_')){_0x128dbe[_0xdb3c('0x3d')][_0xdb3c('0x40')]='_'[_0xdb3c('0x41')](_0x128dbe[_0xdb3c('0x3d')][_0xdb3c('0x40')]);}return db[_0xdb3c('0x34')][_0xdb3c('0x3c')](_0x128dbe[_0xdb3c('0x3d')],{'raw':![]})[_0xdb3c('0x14')](function(_0xb14105){var _0x1959d1=_0x128dbe[_0xdb3c('0x42')]['get']({'plain':!![]});if(!_0x1959d1)throw new Error(_0xdb3c('0x43'));if(_0x1959d1[_0xdb3c('0x44')]===_0xdb3c('0x42')){var _0x231298=_0xb14105['get']({'plain':!![]});var _0x5f4758=[{'name':_0xdb3c('0x45'),'value':_0xdb3c('0x16')},{'name':_0xdb3c('0x17'),'value':'outbound'},{'name':'InternalRoutes','value':_0xdb3c('0x19')}];var _0x301ba9=_[_0xdb3c('0x1c')](_0x5f4758,[_0xdb3c('0x46'),_0x231298[_0xdb3c('0x1d')]])[_0xdb3c('0x1e')];return db['UserProfileSection'][_0xdb3c('0x1c')]({'where':{'name':_0x301ba9,'userProfileId':_0x1959d1['userProfileId']},'raw':!![]})[_0xdb3c('0x14')](function(_0x478807){if(_0x478807&&_0x478807['autoAssociation']===0x0){return db[_0xdb3c('0x47')][_0xdb3c('0x3c')]({'name':_0x231298[_0xdb3c('0x1e')],'resourceId':_0x231298['id'],'type':_0x478807['name'],'sectionId':_0x478807['id']},{})[_0xdb3c('0x14')](function(){return _0xb14105;});}else{return _0xb14105;}})[_0xdb3c('0x36')](function(_0x92eedb){logger[_0xdb3c('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x92eedb);throw _0x92eedb;});}return _0xb14105;})['then'](respondWithResult(_0x33e5b9,0xc9))[_0xdb3c('0x36')](handleError(_0x33e5b9,null));};exports[_0xdb3c('0x49')]=function(_0x1558d9,_0x2ab45b){if(_0x1558d9[_0xdb3c('0x3d')]['id']){delete _0x1558d9['body']['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x1558d9[_0xdb3c('0x38')]['id']}})['then'](handleEntityNotFound(_0x2ab45b,null))['then'](function(_0x3d49c2){if(_0x3d49c2){return db[_0xdb3c('0x34')][_0xdb3c('0x49')](_[_0xdb3c('0x30')](_0x1558d9['body'],['exten',_0xdb3c('0x4a'),_0xdb3c('0x4b'),_0xdb3c('0x4c'),_0xdb3c('0x4d'),_0xdb3c('0x4e'),_0xdb3c('0x4f')]),{'where':{'context':_0x3d49c2['context'],'exten':_0x3d49c2[_0xdb3c('0x40')]},'individualHooks':!![]})[_0xdb3c('0x14')](function(_0x5465df){return _0x5465df;});}return null;})[_0xdb3c('0x14')](respondWithStatusCode(_0x2ab45b,null))[_0xdb3c('0x36')](handleError(_0x2ab45b,null));};exports[_0xdb3c('0x50')]=function(_0x100180,_0x591a65){return db['VoiceExtension'][_0xdb3c('0x51')]({'where':{'id':_0x100180[_0xdb3c('0x38')]['id']}})[_0xdb3c('0x14')](function(_0x4925aa){if(_0x4925aa){return db[_0xdb3c('0x52')]['transaction'](function(_0x398fb3){return db[_0xdb3c('0x34')][_0xdb3c('0x13')]({'where':{'VoiceExtensionId':_0x100180[_0xdb3c('0x38')]['id']},'transaction':_0x398fb3})[_0xdb3c('0x14')](function(){var _0x4bb214=_[_0xdb3c('0x24')](_0x100180[_0xdb3c('0x3d')],function(_0x505643){_0x505643[_0xdb3c('0x53')]=_0x100180[_0xdb3c('0x38')]['id'];_0x505643['isApp']=!![];return _0x505643;});return _0x4925aa[_0xdb3c('0x54')](_0x4bb214);})[_0xdb3c('0x14')](function(_0x1b9b89){console[_0xdb3c('0x55')]('LOG\x20~\x20.then\x20~\x20routing',_0x1b9b89);return db['VoiceExtension'][_0xdb3c('0x56')](_0x1b9b89,{'transaction':_0x398fb3});});})[_0xdb3c('0x14')](function(){return db[_0xdb3c('0x34')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x100180['params']['id']},'order':_0xdb3c('0x57')});});}})['then'](respondWithResult(_0x591a65,null))['catch'](handleError(_0x591a65,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5932e92..d2133fd 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 _0xb0db=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb0db,0x8a));var _0xbb0d=function(_0xe946d4,_0x2f9bee){_0xe946d4=_0xe946d4-0x0;var _0x2eb263=_0xb0db[_0xe946d4];return _0x2eb263;};'use strict';var EventEmitter=require(_0xbb0d('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xbb0d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbb0d('0x2')](0x0);var events={'afterCreate':_0xbb0d('0x3'),'afterUpdate':_0xbb0d('0x4'),'afterDestroy':_0xbb0d('0x5')};function emitEvent(_0xa034fa){return function(_0x1bc1cd,_0x4c824d,_0x5dcd63){VoiceExtensionEvents[_0xbb0d('0x6')](_0xa034fa+':'+_0x1bc1cd['id'],_0x1bc1cd);VoiceExtensionEvents[_0xbb0d('0x6')](_0xa034fa,_0x1bc1cd);_0x5dcd63(null);};}for(var e in events){if(events[_0xbb0d('0x7')](e)){var event=events[e];VoiceExtension[_0xbb0d('0x8')](e,emitEvent(event));}}module[_0xbb0d('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc762=['exports','events','save','update','remove','emit','hasOwnProperty'];(function(_0x363b9d,_0x2acfa6){var _0x8d2ed6=function(_0x5eb29e){while(--_0x5eb29e){_0x363b9d['push'](_0x363b9d['shift']());}};_0x8d2ed6(++_0x2acfa6);}(_0xc762,0x16d));var _0x2c76=function(_0xd8768,_0x3fedcb){_0xd8768=_0xd8768-0x0;var _0x46228f=_0xc762[_0xd8768];return _0x46228f;};'use strict';var EventEmitter=require(_0x2c76('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c76('0x1'),'afterUpdate':_0x2c76('0x2'),'afterDestroy':_0x2c76('0x3')};function emitEvent(_0x310222){return function(_0x3d226e,_0x15d68b,_0x5b38c6){VoiceExtensionEvents[_0x2c76('0x4')](_0x310222+':'+_0x3d226e['id'],_0x3d226e);VoiceExtensionEvents[_0x2c76('0x4')](_0x310222,_0x3d226e);_0x5b38c6(null);};}for(var e in events){if(events[_0x2c76('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2c76('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index b0a79c4..7f5703f 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 _0xecd0=['IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','appType','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','get','then','concat','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','length','name','param','split','prefix','phone','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','findAll','interval'];(function(_0x588e6d,_0x4f39f7){var _0x383e74=function(_0x3694fc){while(--_0x3694fc){_0x588e6d['push'](_0x588e6d['shift']());}};_0x383e74(++_0x4f39f7);}(_0xecd0,0x162));var _0x0ecd=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0xecd0[_0x39e2d7];return _0x413d0d;};'use strict';var _=require(_0x0ecd('0x0'));var attributes=require(_0x0ecd('0x1'));module[_0x0ecd('0x2')]=function(_0x1e2773){var _0x41cf87=_0x1e2773['models'];function _0x4068f0(_0xe490c){var _0x18c51d=0x2;var _0x8df9d1=[{'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x4')+_0xe490c[_0x0ecd('0x5')],'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c[_0x0ecd('0x5')],'app':_0xe490c[_0x0ecd('0x8')]?_0x0ecd('0x3'):_0x0ecd('0x9'),'appdata':_0xe490c[_0x0ecd('0x8')]?_0x0ecd('0xa')+_0xe490c[_0x0ecd('0x8')]:_0x0ecd('0xb'),'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']}];if(_0xe490c['type']===_0x0ecd('0xc')){_0x8df9d1[_0x0ecd('0xd')]({'type':_0x0ecd('0xc'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xe')+_0xe490c['id'],'context':_0xe490c['context'],'exten':_0xe490c[_0x0ecd('0x7')],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']});}_0x8df9d1['push']({'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xf'),'context':_0xe490c['context'],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c[_0x0ecd('0x5')],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x10'),'context':_0xe490c[_0x0ecd('0x6')],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']},{'type':_0xe490c['type'],'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x11'),'context':_0xe490c['context'],'exten':_0xe490c['exten'],'priority':_0x18c51d++,'VoiceExtensionId':_0xe490c['id']});return _0x8df9d1;}function _0x3088dc(_0x1e337a){var _0x13e519=0x2;var _0x4dbf65=[{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x13'),'context':_0x1e337a['context'],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x1e337a[_0x0ecd('0x8')]?_0x0ecd('0x3'):_0x0ecd('0x9'),'appdata':_0x1e337a[_0x0ecd('0x8')]?'CDR(routeAlias)='+_0x1e337a[_0x0ecd('0x8')]:_0x0ecd('0xb'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':'outbound','app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x14')+(_0x1e337a[_0x0ecd('0x15')]?_0x0ecd('0x16')+_0x1e337a[_0x0ecd('0x15')]+'}':_0x0ecd('0x17')),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0xe')+_0x1e337a['id'],'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x18'),'appdata':_0x0ecd('0x19')+(_0x13e519+0x2)+_0x0ecd('0x1a')+(_0x13e519+0x1)+')','context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x1e337a['cutdigits']?_0x0ecd('0x1b')+_0x1e337a[_0x0ecd('0x15')]+'}':_0x0ecd('0x1c'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':'Set','appdata':_0x0ecd('0xf'),'context':_0x1e337a['context'],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x10'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':'Set','appdata':_0x0ecd('0x11'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x1d')+_0x1e337a['id'],'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']}];if(_0x1e337a[_0x0ecd('0x1e')](_0x0ecd('0x1f'))&&_0x1e337a[_0x0ecd('0x1f')]!=='none'){_0x4dbf65[_0x0ecd('0xd')]({'type':_0x0ecd('0x12'),'app':_0x0ecd('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1e337a['context'],'exten':_0x1e337a[_0x0ecd('0x7')],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']},{'type':'outbound','app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x20')+_0x1e337a[_0x0ecd('0x1f')]||_0x0ecd('0x21'),'context':_0x1e337a[_0x0ecd('0x6')],'exten':_0x1e337a['exten'],'priority':_0x13e519++,'VoiceExtensionId':_0x1e337a['id']});}return _0x4dbf65;}function _0x3d7fa9(_0x57e739,_0x5c75ba){var _0x47d6b1=[{'name':_0x0ecd('0x22'),'param':0x0},{'name':_0x0ecd('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x0ecd('0x24'),'param':0x3}];var _0x215c39={};var _0x5b9eaf=_0x5c75ba['split'](',');var _0xad6bba=[];for(var _0x5eb941=0x0;_0x5eb941<_0x47d6b1[_0x0ecd('0x25')];_0x5eb941++){switch(_0x47d6b1[_0x5eb941][_0x0ecd('0x26')]){case _0x0ecd('0x22'):_0x215c39[_0x0ecd('0x22')]=_0x5b9eaf[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]][_0x0ecd('0x28')]('/')[0x1];_0x215c39['phone']=_0x5b9eaf[_0x47d6b1[_0x5eb941]['param']]['split']('/')[0x2];_0x215c39[_0x0ecd('0x29')]=_0x215c39[_0x0ecd('0x2a')]?_0x215c39[_0x0ecd('0x2a')][_0x0ecd('0x28')]('$')[0x0]:undefined;_0x215c39[_0x0ecd('0x2a')]=_0x57e739[_0x0ecd('0x15')]?(_0x215c39[_0x0ecd('0x29')]||'')+_0x0ecd('0x16')+_0x57e739[_0x0ecd('0x15')]+'}':(_0x215c39['prefix']||'')+_0x0ecd('0x17');_0xad6bba[_0x47d6b1[_0x5eb941]['param']]=['SIP',_0x215c39[_0x0ecd('0x22')],_0x215c39[_0x0ecd('0x2a')]][_0x0ecd('0x2b')]('/');break;case _0x0ecd('0x2c'):_0x215c39[_0x0ecd('0x2c')]=_0x5b9eaf[_0x47d6b1[_0x5eb941]['param']];if(_0x57e739[_0x0ecd('0x1f')]!==_0x0ecd('0x2d')){if(_0x215c39[_0x0ecd('0x2c')][_0x0ecd('0x2e')](_0x0ecd('0x2f'))<0x0){_0x215c39['options']+=_0x0ecd('0x2f');}}else{_0x215c39[_0x0ecd('0x2c')]=_0x215c39[_0x0ecd('0x2c')][_0x0ecd('0x30')](_0x0ecd('0x2f'),'');}_0xad6bba[_0x47d6b1[_0x5eb941]['param']]=_0x215c39[_0x0ecd('0x2c')];break;default:_0xad6bba[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]]=_0x5b9eaf[_0x47d6b1[_0x5eb941][_0x0ecd('0x27')]];}}return _0xad6bba[_0x0ecd('0x2b')](',');}function _0x5b12ba(_0x25bb2d,_0x2dcb37,_0x203354){return new Promise(function(_0x2dbb3c,_0x348131){var _0x59c9ee=[];if(_['isEmpty'](_0x2dcb37))return _0x2dbb3c(_0x59c9ee);_0x41cf87['Interval'][_0x0ecd('0x31')]({'attributes':['id',_0x0ecd('0x32'),_0x0ecd('0x33')],'raw':!![]})['then'](function(_0x3bdbeb){for(var _0x1710d9=0x0,_0x20c03a=0x0;_0x1710d9<_0x2dcb37[_0x0ecd('0x25')];_0x1710d9++,_0x20c03a=0x0){var _0x425b63=_0x2dcb37[_0x1710d9];var _0x289533=[];var _0x31460a=[];delete _0x425b63['id'];if(_0x425b63[_0x0ecd('0x32')]!==_0x0ecd('0x34')){_0x425b63[_0x0ecd('0x35')]=[_0x425b63[_0x0ecd('0x32')]];}else{_0x425b63[_0x0ecd('0x35')]=_0x425b63[_0x0ecd('0x33')]?_['map'](_[_0x0ecd('0x36')](_0x3bdbeb,{'IntervalId':_0x425b63[_0x0ecd('0x33')]}),'interval'):[];}_0x425b63['context']=_0x25bb2d[_0x0ecd('0x6')];_0x425b63[_0x0ecd('0x7')]=_0x25bb2d[_0x0ecd('0x7')];if(_0x425b63[_0x0ecd('0x5')])_0x425b63[_0x0ecd('0x5')]=_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')]();if(_0x25bb2d['type']===_0x0ecd('0x12')){if(_0x425b63[_0x0ecd('0x1e')]('tag')&&_0x425b63[_0x0ecd('0x38')]&&_0x425b63[_0x0ecd('0x38')]!=='--'){_0x289533['push']({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':'Set','appdata':'CDR(tag)='+_0x425b63[_0x0ecd('0x38')],'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')]['toLowerCase'](),'app':_0x0ecd('0x18'),'appdata':_0x0ecd('0x39')+(_0x425b63[_0x0ecd('0x3a')]?_0x0ecd('0x3b')+_0x425b63[_0x0ecd('0x3a')]+')':_0x0ecd('0x3c')),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63['intervals'][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}else{if(_0x425b63[_0x0ecd('0x1e')](_0x0ecd('0x3d'))){if([_0x0ecd('0x3e'),'playback']['includes'](_0x425b63[_0x0ecd('0x3f')][_0x0ecd('0x37')]())&&_0x425b63[_0x0ecd('0x40')]!=='custom'){if(_0x425b63[_0x0ecd('0x3d')]){_0x289533[_0x0ecd('0xd')]({'type':_0x425b63['type']['toLowerCase'](),'app':_0x0ecd('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x25bb2d['context'],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x41'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d['exten'],'priority':_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}else{_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':_0x0ecd('0x42'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63[_0x0ecd('0x35')]['length']+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});_0x289533[_0x0ecd('0xd')]({'type':_0x425b63[_0x0ecd('0x5')][_0x0ecd('0x37')](),'app':_0x0ecd('0x3'),'appdata':_0x0ecd('0x43'),'context':_0x25bb2d[_0x0ecd('0x6')],'exten':_0x25bb2d[_0x0ecd('0x7')],'priority':_0x425b63['intervals'][_0x0ecd('0x25')]+_0x203354+_0x20c03a++,'VoiceExtensionId':_0x25bb2d['id']});}}}}for(var _0x477d1b=0x0;_0x477d1b<_0x425b63[_0x0ecd('0x35')][_0x0ecd('0x25')];_0x477d1b++){var _0x2582f6=_0x203354+_0x425b63['intervals'][_0x0ecd('0x25')];var _0x47d4fb=_0x477d1b===_0x425b63['intervals']['length']-0x1?_0x203354+_0x289533['length']+_0x31460a[_0x0ecd('0x25')]+0x2:_0x203354+_0x477d1b+0x1;_0x289533['splice'](_0x477d1b,0x0,{'type':_0x25bb2d[_0x0ecd('0x5')],'app':_0x0ecd('0x44'),'appdata':_0x425b63['intervals'][_0x477d1b]+'?'+_0x25bb2d[_0x0ecd('0x6')]+_0x0ecd('0x45')+_0x2582f6+':'+_0x25bb2d[_0x0ecd('0x6')]+_0x0ecd('0x45')+_0x47d4fb,'exten':_0x25bb2d[_0x0ecd('0x7')],'context':_0x25bb2d[_0x0ecd('0x6')],'priority':_0x203354+_0x477d1b,'VoiceExtensionId':_0x25bb2d['id']});}if(_0x425b63[_0x0ecd('0x40')]===_0x0ecd('0x46'))_0x425b63['appdata']=_0x3d7fa9(_0x25bb2d,_0x425b63[_0x0ecd('0x47')]);_0x425b63[_0x0ecd('0x48')]=_0x289533['length']?_[_0x0ecd('0x49')](_0x289533)[_0x0ecd('0x48')]+0x1:_0x203354;_0x59c9ee=_['concat'](_0x59c9ee,_0x289533,[_0x425b63],_0x31460a);_0x203354=_[_0x0ecd('0x49')](_0x59c9ee)[_0x0ecd('0x48')]+0x1;}return _0x2dbb3c(_0x59c9ee);})[_0x0ecd('0x4a')](function(_0x2e9471){_0x348131(_0x2e9471);});});}return _0x1e2773['define'](_0x0ecd('0x4b'),attributes,{'tableName':_0x0ecd('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37289b){var _0xdb3a34=this[_0x0ecd('0x4d')]({'plain':!![]});var _0x4016fc=_0xdb3a34[_0x0ecd('0x5')]==='outbound'?_0x3088dc(_0xdb3a34):_0x4068f0(_0xdb3a34);return _0x5b12ba(_0xdb3a34,_0x37289b,_[_0x0ecd('0x49')](_0x4016fc)[_0x0ecd('0x48')]+0x1)[_0x0ecd('0x4e')](function(_0x3fa7a5){var _0x23ded0=_[_0x0ecd('0x4f')](_0x4016fc,_0x3fa7a5);_0x23ded0[_0x0ecd('0xd')]({'type':_0xdb3a34[_0x0ecd('0x5')],'app':_0x0ecd('0x50'),'exten':_0xdb3a34[_0x0ecd('0x7')],'context':_0xdb3a34['context'],'priority':_[_0x0ecd('0x49')](_0x23ded0)[_0x0ecd('0x48')]+0x1,'VoiceExtensionId':_0xdb3a34['id']});return _0x23ded0;});}}});}; \ No newline at end of file +var _0xbb36=['${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits'];(function(_0x2decce,_0x18c401){var _0x287bd7=function(_0x1e0b3c){while(--_0x1e0b3c){_0x2decce['push'](_0x2decce['shift']());}};_0x287bd7(++_0x18c401);}(_0xbb36,0x92));var _0x6bb3=function(_0x4324e6,_0x963b38){_0x4324e6=_0x4324e6-0x0;var _0x3ad5c5=_0xbb36[_0x4324e6];return _0x3ad5c5;};'use strict';var _=require('lodash');var attributes=require(_0x6bb3('0x0'));module[_0x6bb3('0x1')]=function(_0x19159c){var _0x27fc02=_0x19159c[_0x6bb3('0x2')];function _0x32933c(_0x40ca78){var _0x49c3ab=0x2;var _0x4b95ff=[{'type':_0x40ca78[_0x6bb3('0x3')],'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x5')+_0x40ca78[_0x6bb3('0x3')],'context':_0x40ca78[_0x6bb3('0x6')],'exten':_0x40ca78[_0x6bb3('0x7')],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']},{'type':_0x40ca78['type'],'app':_0x40ca78[_0x6bb3('0x8')]?_0x6bb3('0x4'):_0x6bb3('0x9'),'appdata':_0x40ca78['alias']?_0x6bb3('0xa')+_0x40ca78['alias']:_0x6bb3('0xb'),'context':_0x40ca78[_0x6bb3('0x6')],'exten':_0x40ca78[_0x6bb3('0x7')],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']}];if(_0x40ca78[_0x6bb3('0x3')]==='inbound'){_0x4b95ff['push']({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x40ca78['id'],'context':_0x40ca78['context'],'exten':_0x40ca78[_0x6bb3('0x7')],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']});}_0x4b95ff[_0x6bb3('0xc')]({'type':_0x40ca78[_0x6bb3('0x3')],'app':_0x6bb3('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x40ca78['context'],'exten':_0x40ca78['exten'],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']},{'type':_0x40ca78[_0x6bb3('0x3')],'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0xd'),'context':_0x40ca78[_0x6bb3('0x6')],'exten':_0x40ca78[_0x6bb3('0x7')],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']},{'type':_0x40ca78['type'],'app':'Set','appdata':_0x6bb3('0xe'),'context':_0x40ca78[_0x6bb3('0x6')],'exten':_0x40ca78[_0x6bb3('0x7')],'priority':_0x49c3ab++,'VoiceExtensionId':_0x40ca78['id']});return _0x4b95ff;}function _0x331f60(_0x59ec3f){var _0x57c675=0x2;var _0x53dd50=[{'type':_0x6bb3('0xf'),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x10'),'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':'outbound','app':_0x59ec3f[_0x6bb3('0x8')]?_0x6bb3('0x4'):'NoOp','appdata':_0x59ec3f[_0x6bb3('0x8')]?_0x6bb3('0xa')+_0x59ec3f[_0x6bb3('0x8')]:_0x6bb3('0xb'),'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x11')+(_0x59ec3f['cutdigits']?_0x6bb3('0x12')+_0x59ec3f[_0x6bb3('0x13')]+'}':_0x6bb3('0x14')),'context':_0x59ec3f['context'],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':'outbound','app':_0x6bb3('0x4'),'appdata':'CDR(routeid)='+_0x59ec3f['id'],'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':'ExecIf','appdata':_0x6bb3('0x15')+(_0x57c675+0x2)+_0x6bb3('0x16')+(_0x57c675+0x1)+')','context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':_0x6bb3('0x4'),'appdata':_0x59ec3f[_0x6bb3('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x59ec3f[_0x6bb3('0x13')]+'}':_0x6bb3('0x17'),'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f['exten'],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':'Set','appdata':_0x6bb3('0x18'),'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':'Set','appdata':_0x6bb3('0xd'),'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x19')+_0x59ec3f['id'],'context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']}];if(_0x59ec3f[_0x6bb3('0x1a')](_0x6bb3('0x1b'))&&_0x59ec3f[_0x6bb3('0x1b')]!==_0x6bb3('0x1c')){_0x53dd50['push']({'type':'outbound','app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x1d'),'context':_0x59ec3f['context'],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']},{'type':_0x6bb3('0xf'),'app':'Set','appdata':_0x6bb3('0x1e')+_0x59ec3f[_0x6bb3('0x1b')]||'wav','context':_0x59ec3f[_0x6bb3('0x6')],'exten':_0x59ec3f[_0x6bb3('0x7')],'priority':_0x57c675++,'VoiceExtensionId':_0x59ec3f['id']});}return _0x53dd50;}function _0x4c4d1f(_0x4a12b5,_0x233935){var _0x473ac2=[{'name':_0x6bb3('0x1f'),'param':0x0},{'name':_0x6bb3('0x20'),'param':0x1},{'name':_0x6bb3('0x21'),'param':0x2},{'name':_0x6bb3('0x22'),'param':0x3}];var _0x53d2f4={};var _0x207e2c=_0x233935[_0x6bb3('0x23')](',');var _0x3a4cdd=[];for(var _0x43d9ae=0x0;_0x43d9ae<_0x473ac2[_0x6bb3('0x24')];_0x43d9ae++){switch(_0x473ac2[_0x43d9ae][_0x6bb3('0x25')]){case _0x6bb3('0x1f'):_0x53d2f4[_0x6bb3('0x1f')]=_0x207e2c[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]]['split']('/')[0x1];_0x53d2f4['phone']=_0x207e2c[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]][_0x6bb3('0x23')]('/')[0x2];_0x53d2f4['prefix']=_0x53d2f4[_0x6bb3('0x27')]?_0x53d2f4[_0x6bb3('0x27')][_0x6bb3('0x23')]('$')[0x0]:undefined;_0x53d2f4['phone']=_0x4a12b5[_0x6bb3('0x13')]?(_0x53d2f4[_0x6bb3('0x28')]||'')+_0x6bb3('0x12')+_0x4a12b5[_0x6bb3('0x13')]+'}':(_0x53d2f4[_0x6bb3('0x28')]||'')+'${EXTEN}';_0x3a4cdd[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]]=[_0x6bb3('0x29'),_0x53d2f4[_0x6bb3('0x1f')],_0x53d2f4['phone']][_0x6bb3('0x2a')]('/');break;case _0x6bb3('0x21'):_0x53d2f4['options']=_0x207e2c[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]];if(_0x4a12b5[_0x6bb3('0x1b')]!=='none'){if(_0x53d2f4['options'][_0x6bb3('0x2b')](_0x6bb3('0x2c'))<0x0){_0x53d2f4[_0x6bb3('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x53d2f4[_0x6bb3('0x21')]=_0x53d2f4[_0x6bb3('0x21')][_0x6bb3('0x2d')]('U(xcally-mixmonitor-context)','');}_0x3a4cdd[_0x473ac2[_0x43d9ae]['param']]=_0x53d2f4['options'];break;default:_0x3a4cdd[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]]=_0x207e2c[_0x473ac2[_0x43d9ae][_0x6bb3('0x26')]];}}return _0x3a4cdd['join'](',');}function _0x44675d(_0x45eb45,_0x2659dc,_0x373fdb){return new Promise(function(_0x163efc,_0x73f936){var _0xe30913=[];if(_[_0x6bb3('0x2e')](_0x2659dc))return _0x163efc(_0xe30913);_0x27fc02[_0x6bb3('0x2f')][_0x6bb3('0x30')]({'attributes':['id',_0x6bb3('0x31'),_0x6bb3('0x32')],'raw':!![]})[_0x6bb3('0x33')](function(_0x17111f){for(var _0x4aa759=0x0,_0x3b1a8e=0x0;_0x4aa759<_0x2659dc['length'];_0x4aa759++,_0x3b1a8e=0x0){var _0xe67c7d=_0x2659dc[_0x4aa759];var _0x35df5b=[];var _0x25542b=[];delete _0xe67c7d['id'];if(_0xe67c7d['interval']!==_0x6bb3('0x34')){_0xe67c7d[_0x6bb3('0x35')]=[_0xe67c7d[_0x6bb3('0x31')]];}else{_0xe67c7d[_0x6bb3('0x35')]=_0xe67c7d[_0x6bb3('0x32')]?_[_0x6bb3('0x36')](_[_0x6bb3('0x37')](_0x17111f,{'IntervalId':_0xe67c7d['IntervalId']}),_0x6bb3('0x31')):[];}_0xe67c7d['context']=_0x45eb45[_0x6bb3('0x6')];_0xe67c7d['exten']=_0x45eb45[_0x6bb3('0x7')];if(_0xe67c7d[_0x6bb3('0x3')])_0xe67c7d[_0x6bb3('0x3')]=_0xe67c7d['type'][_0x6bb3('0x38')]();if(_0x45eb45[_0x6bb3('0x3')]===_0x6bb3('0xf')){if(_0xe67c7d['hasOwnProperty'](_0x6bb3('0x39'))&&_0xe67c7d[_0x6bb3('0x39')]&&_0xe67c7d[_0x6bb3('0x39')]!=='--'){_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d[_0x6bb3('0x3')][_0x6bb3('0x38')](),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x3a')+_0xe67c7d[_0x6bb3('0x39')],'context':_0x45eb45[_0x6bb3('0x6')],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d[_0x6bb3('0x35')][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});}_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d[_0x6bb3('0x3')][_0x6bb3('0x38')](),'app':_0x6bb3('0x3b'),'appdata':_0x6bb3('0x3c')+(_0xe67c7d[_0x6bb3('0x3d')]?'Set(CALLERID(all)='+_0xe67c7d[_0x6bb3('0x3d')]+')':'NoOp(No\x20number\x20available)'),'context':_0x45eb45[_0x6bb3('0x6')],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d['intervals'][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});}else{if(_0xe67c7d[_0x6bb3('0x1a')](_0x6bb3('0x3e'))){if(['queue','playback'][_0x6bb3('0x3f')](_0xe67c7d[_0x6bb3('0x40')][_0x6bb3('0x38')]())&&_0xe67c7d[_0x6bb3('0x41')]!==_0x6bb3('0x42')){if(_0xe67c7d[_0x6bb3('0x3e')]){_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d['type'][_0x6bb3('0x38')](),'app':_0x6bb3('0x3b'),'appdata':_0x6bb3('0x43'),'context':_0x45eb45[_0x6bb3('0x6')],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d[_0x6bb3('0x35')][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d[_0x6bb3('0x3')]['toLowerCase'](),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x44'),'context':_0x45eb45['context'],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d[_0x6bb3('0x35')][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});}else{_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d[_0x6bb3('0x3')][_0x6bb3('0x38')](),'app':_0x6bb3('0x3b'),'appdata':_0x6bb3('0x45'),'context':_0x45eb45[_0x6bb3('0x6')],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d['intervals'][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});_0x35df5b[_0x6bb3('0xc')]({'type':_0xe67c7d[_0x6bb3('0x3')][_0x6bb3('0x38')](),'app':_0x6bb3('0x4'),'appdata':_0x6bb3('0x46'),'context':_0x45eb45[_0x6bb3('0x6')],'exten':_0x45eb45[_0x6bb3('0x7')],'priority':_0xe67c7d[_0x6bb3('0x35')][_0x6bb3('0x24')]+_0x373fdb+_0x3b1a8e++,'VoiceExtensionId':_0x45eb45['id']});}}}}for(var _0x392cd4=0x0;_0x392cd4<_0xe67c7d['intervals']['length'];_0x392cd4++){var _0x63664c=_0x373fdb+_0xe67c7d[_0x6bb3('0x35')]['length'];var _0xe434c5=_0x392cd4===_0xe67c7d[_0x6bb3('0x35')][_0x6bb3('0x24')]-0x1?_0x373fdb+_0x35df5b[_0x6bb3('0x24')]+_0x25542b[_0x6bb3('0x24')]+0x2:_0x373fdb+_0x392cd4+0x1;_0x35df5b[_0x6bb3('0x47')](_0x392cd4,0x0,{'type':_0x45eb45[_0x6bb3('0x3')],'app':_0x6bb3('0x48'),'appdata':_0xe67c7d['intervals'][_0x392cd4]+'?'+_0x45eb45[_0x6bb3('0x6')]+_0x6bb3('0x49')+_0x63664c+':'+_0x45eb45[_0x6bb3('0x6')]+_0x6bb3('0x49')+_0xe434c5,'exten':_0x45eb45[_0x6bb3('0x7')],'context':_0x45eb45['context'],'priority':_0x373fdb+_0x392cd4,'VoiceExtensionId':_0x45eb45['id']});}if(_0xe67c7d['appType']==='outboundDial')_0xe67c7d[_0x6bb3('0x4a')]=_0x4c4d1f(_0x45eb45,_0xe67c7d[_0x6bb3('0x4a')]);_0xe67c7d[_0x6bb3('0x4b')]=_0x35df5b[_0x6bb3('0x24')]?_[_0x6bb3('0x4c')](_0x35df5b)[_0x6bb3('0x4b')]+0x1:_0x373fdb;_0xe30913=_[_0x6bb3('0x4d')](_0xe30913,_0x35df5b,[_0xe67c7d],_0x25542b);_0x373fdb=_[_0x6bb3('0x4c')](_0xe30913)['priority']+0x1;}return _0x163efc(_0xe30913);})[_0x6bb3('0x4e')](function(_0x28ea7e){_0x73f936(_0x28ea7e);});});}return _0x19159c['define'](_0x6bb3('0x4f'),attributes,{'tableName':_0x6bb3('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3b1579){var _0x328c0c=this[_0x6bb3('0x51')]({'plain':!![]});var _0x3a2fda=_0x328c0c[_0x6bb3('0x3')]===_0x6bb3('0xf')?_0x331f60(_0x328c0c):_0x32933c(_0x328c0c);return _0x44675d(_0x328c0c,_0x3b1579,_['last'](_0x3a2fda)[_0x6bb3('0x4b')]+0x1)['then'](function(_0xc8b8f){var _0x129361=_[_0x6bb3('0x4d')](_0x3a2fda,_0xc8b8f);_0x129361['push']({'type':_0x328c0c[_0x6bb3('0x3')],'app':_0x6bb3('0x52'),'exten':_0x328c0c[_0x6bb3('0x7')],'context':_0x328c0c[_0x6bb3('0x6')],'priority':_['last'](_0x129361)['priority']+0x1,'VoiceExtensionId':_0x328c0c['id']});return _0x129361;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c45b23a..209822b 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 _0x9b69=['socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetVoiceExtension','options','raw','where','attributes','limit','include','map','model','debug','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x2b9ac4,_0x11eba5){var _0x4ba700=function(_0x34071e){while(--_0x34071e){_0x2b9ac4['push'](_0x2b9ac4['shift']());}};_0x4ba700(++_0x11eba5);}(_0x9b69,0xa3));var _0x99b6=function(_0x31907a,_0x3fa1cd){_0x31907a=_0x31907a-0x0;var _0x451db4=_0x9b69[_0x31907a];return _0x451db4;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var moment=require(_0x99b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x4'));var logger=require(_0x99b6('0x5'))(_0x99b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x99b6('0x7'));var client=jayson['client'][_0x99b6('0x8')]({'port':0x232a});config[_0x99b6('0x9')]=_[_0x99b6('0xa')](config[_0x99b6('0x9')],{'host':_0x99b6('0xb'),'port':0x18eb});var socket=require(_0x99b6('0xc'))(new Redis(config[_0x99b6('0x9')]));require(_0x99b6('0xd'))[_0x99b6('0xe')](socket);function respondWithRpcPromise(_0x400c81,_0x3081f5,_0x3f2d8e){return new BPromise(function(_0x3af521,_0x6b24b1){return client[_0x99b6('0xf')](_0x400c81,_0x3f2d8e)[_0x99b6('0x10')](function(_0x409539){logger[_0x99b6('0x11')](_0x99b6('0x12'),_0x3081f5,_0x99b6('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3081f5,'request\x20sent',JSON['stringify'](_0x409539));if(_0x409539['error']){if(_0x409539['error']['code']===0x1f4){logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x409539[_0x99b6('0x14')]['message']);return _0x6b24b1(_0x409539[_0x99b6('0x14')][_0x99b6('0x15')]);}logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x409539['error'][_0x99b6('0x15')]);return _0x3af521(_0x409539[_0x99b6('0x14')][_0x99b6('0x15')]);}else{logger[_0x99b6('0x11')](_0x99b6('0x12'),_0x3081f5,_0x99b6('0x13'));_0x3af521(_0x409539[_0x99b6('0x16')][_0x99b6('0x15')]);}})[_0x99b6('0x17')](function(_0x547488){logger[_0x99b6('0x14')](_0x99b6('0x12'),_0x3081f5,_0x547488);_0x6b24b1(_0x547488);});});}exports[_0x99b6('0x18')]=function(_0x2036bb){var _0x34476d=this;return new Promise(function(_0xc65470,_0x35b47a){return db['VoiceExtension']['findAll']({'raw':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x2036bb[_0x99b6('0x19')]?_0x2036bb['options'][_0x99b6('0x1b')]||null:null,'attributes':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1c')]||null:null,'limit':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1d')]||null:null,'include':_0x2036bb[_0x99b6('0x19')]?_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1e')]?_[_0x99b6('0x1f')](_0x2036bb[_0x99b6('0x19')][_0x99b6('0x1e')],function(_0x58176f){return{'model':db[_0x58176f[_0x99b6('0x20')]],'as':_0x58176f['as'],'attributes':_0x58176f['attributes'],'include':_0x58176f[_0x99b6('0x1e')]?_['map'](_0x58176f[_0x99b6('0x1e')],function(_0x246b17){return{'model':db[_0x246b17['model']],'as':_0x246b17['as'],'attributes':_0x246b17['attributes'],'include':_0x246b17[_0x99b6('0x1e')]?_[_0x99b6('0x1f')](_0x246b17[_0x99b6('0x1e')],function(_0x48f796){return{'model':db[_0x48f796['model']],'as':_0x48f796['as'],'attributes':_0x48f796['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b1901){logger[_0x99b6('0x11')]('GetVoiceExtension',_0x2036bb);logger[_0x99b6('0x21')](_0x99b6('0x18'),_0x2036bb,JSON[_0x99b6('0x22')](_0x9b1901));_0xc65470(_0x9b1901);})[_0x99b6('0x17')](function(_0x200caf){logger['error'](_0x99b6('0x18'),_0x200caf[_0x99b6('0x15')],_0x2036bb);_0x35b47a(_0x34476d[_0x99b6('0x14')](0x1f4,_0x200caf[_0x99b6('0x15')]));});});}; \ No newline at end of file +var _0x9b8e=['include','map','model','GetVoiceExtension','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceExtension','findAll','options','raw','attributes'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x9b8e,0x158));var _0xe9b8=function(_0x332599,_0x2ff7c4){_0x332599=_0x332599-0x0;var _0x31007c=_0x9b8e[_0x332599];return _0x31007c;};'use strict';var _=require(_0xe9b8('0x0'));var util=require('util');var moment=require(_0xe9b8('0x1'));var BPromise=require(_0xe9b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b8('0x4'))(_0xe9b8('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9b8('0x6'));var client=jayson[_0xe9b8('0x7')][_0xe9b8('0x8')]({'port':0x232a});config[_0xe9b8('0x9')]=_[_0xe9b8('0xa')](config[_0xe9b8('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9b8('0x9')]));require(_0xe9b8('0xb'))[_0xe9b8('0xc')](socket);function respondWithRpcPromise(_0xfc57d9,_0x4aab24,_0x5ead88){return new BPromise(function(_0x4cb688,_0x23244f){return client[_0xe9b8('0xd')](_0xfc57d9,_0x5ead88)[_0xe9b8('0xe')](function(_0x38a640){logger[_0xe9b8('0xf')](_0xe9b8('0x10'),_0x4aab24,_0xe9b8('0x11'));logger[_0xe9b8('0x12')](_0xe9b8('0x13'),_0x4aab24,_0xe9b8('0x11'),JSON[_0xe9b8('0x14')](_0x38a640));if(_0x38a640[_0xe9b8('0x15')]){if(_0x38a640[_0xe9b8('0x15')]['code']===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x4aab24,_0x38a640['error'][_0xe9b8('0x16')]);return _0x23244f(_0x38a640['error']['message']);}logger[_0xe9b8('0x15')](_0xe9b8('0x10'),_0x4aab24,_0x38a640[_0xe9b8('0x15')][_0xe9b8('0x16')]);return _0x4cb688(_0x38a640[_0xe9b8('0x15')][_0xe9b8('0x16')]);}else{logger['info'](_0xe9b8('0x10'),_0x4aab24,_0xe9b8('0x11'));_0x4cb688(_0x38a640[_0xe9b8('0x17')][_0xe9b8('0x16')]);}})[_0xe9b8('0x18')](function(_0xef83d8){logger['error'](_0xe9b8('0x10'),_0x4aab24,_0xef83d8);_0x23244f(_0xef83d8);});});}exports['GetVoiceExtension']=function(_0x13501c){var _0x10def2=this;return new Promise(function(_0x3062fd,_0x5cb0b0){return db[_0xe9b8('0x19')][_0xe9b8('0x1a')]({'raw':_0x13501c[_0xe9b8('0x1b')]?_0x13501c[_0xe9b8('0x1b')][_0xe9b8('0x1c')]===undefined?!![]:![]:!![],'where':_0x13501c['options']?_0x13501c[_0xe9b8('0x1b')]['where']||null:null,'attributes':_0x13501c[_0xe9b8('0x1b')]?_0x13501c[_0xe9b8('0x1b')][_0xe9b8('0x1d')]||null:null,'limit':_0x13501c[_0xe9b8('0x1b')]?_0x13501c[_0xe9b8('0x1b')]['limit']||null:null,'include':_0x13501c['options']?_0x13501c[_0xe9b8('0x1b')][_0xe9b8('0x1e')]?_[_0xe9b8('0x1f')](_0x13501c['options']['include'],function(_0x277f5a){return{'model':db[_0x277f5a['model']],'as':_0x277f5a['as'],'attributes':_0x277f5a[_0xe9b8('0x1d')],'include':_0x277f5a['include']?_[_0xe9b8('0x1f')](_0x277f5a[_0xe9b8('0x1e')],function(_0x1cefe9){return{'model':db[_0x1cefe9['model']],'as':_0x1cefe9['as'],'attributes':_0x1cefe9[_0xe9b8('0x1d')],'include':_0x1cefe9['include']?_[_0xe9b8('0x1f')](_0x1cefe9['include'],function(_0x403512){return{'model':db[_0x403512[_0xe9b8('0x20')]],'as':_0x403512['as'],'attributes':_0x403512[_0xe9b8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe9b8('0xe')](function(_0x179c25){logger[_0xe9b8('0xf')](_0xe9b8('0x21'),_0x13501c);logger[_0xe9b8('0x12')]('GetVoiceExtension',_0x13501c,JSON[_0xe9b8('0x14')](_0x179c25));_0x3062fd(_0x179c25);})[_0xe9b8('0x18')](function(_0x2b8fe5){logger[_0xe9b8('0x15')](_0xe9b8('0x21'),_0x2b8fe5['message'],_0x13501c);_0x5cb0b0(_0x10def2[_0xe9b8('0x15')](0x1f4,_0x2b8fe5[_0xe9b8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e9ea633..6b8ce2f 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x442c23,_0x2d8c52){var _0x165b59=function(_0x4608b4){while(--_0x4608b4){_0x442c23['push'](_0x442c23['shift']());}};_0x165b59(++_0x2d8c52);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x5fc3[_0x1d7300];return _0x46ee98;};'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 +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1af379,_0x17f217){_0x1af379=_0x1af379-0x0;var _0x472241=_0x1cb9[_0x1af379];return _0x472241;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 569c041..983c696 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 _0x741c=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMail.controller'];(function(_0x519d64,_0x57faff){var _0x21c409=function(_0x144656){while(--_0x144656){_0x519d64['push'](_0x519d64['shift']());}};_0x21c409(++_0x57faff);}(_0x741c,0x196));var _0xc741=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x741c[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['show']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);router[_0xc741('0x11')](_0xc741('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4af4b0,_0x161148){_0x4af4b0=_0x4af4b0-0x0;var _0x3e2a13=_0x5f2f[_0x4af4b0];return _0x3e2a13;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a5f4f95..df1f061 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 _0x4ae2=['yes','TINYINT(4)','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM'];(function(_0x4f8434,_0x562ed5){var _0x5bd5e4=function(_0x3adab6){while(--_0x3adab6){_0x4f8434['push'](_0x4f8434['shift']());}};_0x5bd5e4(++_0x562ed5);}(_0x4ae2,0x157));var _0x24ae=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0x4ae2[_0x343dfb];return _0x297fe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x24ae('0x0')]},'context':{'type':Sequelize[_0x24ae('0x0')],'defaultValue':_0x24ae('0x1'),'unique':_0x24ae('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x24ae('0x2')},'password':{'type':Sequelize[_0x24ae('0x0')]},'fullname':{'type':Sequelize[_0x24ae('0x0')]},'email':{'type':Sequelize[_0x24ae('0x0')],'validate':{'isEmail':!![]},'set':function(_0x576a70){this['setDataValue'](_0x24ae('0x3'),typeof _0x576a70==='string'&&_0x576a70[_0x24ae('0x4')]()?_0x576a70['trim']():null);}},'pager':{'type':Sequelize[_0x24ae('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x24ae('0x5')},'attach':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x24ae('0x0')]},'callback':{'type':Sequelize[_0x24ae('0x0')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x24ae('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x24ae('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x24ae('0x6')](_0x24ae('0x7'),'no'),'defaultValue':_0x24ae('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x24ae('0x0')]},'emailbody':{'type':Sequelize[_0x24ae('0x0')]},'maxsecs':{'type':Sequelize[_0x24ae('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x24ae('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x24ae('0xa')](_0x24ae('0xb'))+_0x24ae('0xc')+this[_0x24ae('0xa')](_0x24ae('0xd'));}}}; \ No newline at end of file +var _0x8aa4=['email','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue'];(function(_0x22ec80,_0x304732){var _0x3018b4=function(_0x236c95){while(--_0x236c95){_0x22ec80['push'](_0x22ec80['shift']());}};_0x3018b4(++_0x304732);}(_0x8aa4,0x1cb));var _0x48aa=function(_0x5d58ff,_0x893d00){_0x5d58ff=_0x5d58ff-0x0;var _0x22c12e=_0x8aa4[_0x5d58ff];return _0x22c12e;};'use strict';var Sequelize=require(_0x48aa('0x0'));module[_0x48aa('0x1')]={'customer_id':{'type':Sequelize[_0x48aa('0x2')]},'context':{'type':Sequelize[_0x48aa('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x48aa('0x3')},'password':{'type':Sequelize[_0x48aa('0x2')]},'fullname':{'type':Sequelize[_0x48aa('0x2')]},'email':{'type':Sequelize[_0x48aa('0x2')],'validate':{'isEmail':!![]},'set':function(_0xe93849){this[_0x48aa('0x4')](_0x48aa('0x5'),typeof _0xe93849==='string'&&_0xe93849['trim']()?_0xe93849[_0x48aa('0x6')]():null);}},'pager':{'type':Sequelize[_0x48aa('0x2')]},'tz':{'type':Sequelize[_0x48aa('0x2')],'defaultValue':_0x48aa('0x7')},'attach':{'type':Sequelize['ENUM'](_0x48aa('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x48aa('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x48aa('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x48aa('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x48aa('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x48aa('0x9')](_0x48aa('0x8'),'no'),'defaultValue':_0x48aa('0x8'),'allowNull':![]},'stamp':{'type':_0x48aa('0xb')},'emailsubject':{'type':Sequelize[_0x48aa('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x48aa('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x48aa('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x48aa('0xd')],'get':function(){return this[_0x48aa('0xe')]('fullname')+'\x20-\x20'+this['getDataValue'](_0x48aa('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7b1ccec..2367367 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 _0xa74f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','destroy','then','Voicemails','UserProfileResource','error','stack','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','show','params','keys','include','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','options','findAndCountAll','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2995da,_0x4d1339){var _0x2019bd=function(_0x130412){while(--_0x130412){_0x2995da['push'](_0x2995da['shift']());}};_0x2019bd(++_0x4d1339);}(_0xa74f,0x9a));var _0xfa74=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xa74f[_0x163742];return _0x1152ac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23591a,_0x998585){_0x998585=_0x998585||0xcc;return function(_0x78173f){if(_0x78173f){return _0x23591a[_0xfa74('0x16')](_0x998585);}return _0x23591a['status'](_0x998585)[_0xfa74('0x17')]();};}function respondWithResult(_0x33cda3,_0x3eb49b){_0x3eb49b=_0x3eb49b||0xc8;return function(_0x3947ca){if(_0x3947ca){return _0x33cda3[_0xfa74('0x18')](_0x3eb49b)['json'](_0x3947ca);}};}function respondWithFilteredResult(_0x199d20,_0x13d911){return function(_0x947da6){if(_0x947da6){var _0x1f1de0=typeof _0x13d911[_0xfa74('0x19')]===_0xfa74('0x1a')&&typeof _0x13d911[_0xfa74('0x1b')]==='undefined';var _0x58a67a=_0x947da6[_0xfa74('0x1c')];var _0x51dda1=_0x1f1de0?0x0:_0x13d911['offset'];var _0x31d3c1=_0x1f1de0?_0x947da6[_0xfa74('0x1c')]:_0x13d911[_0xfa74('0x19')]+_0x13d911['limit'];var _0x3bede6;if(_0x31d3c1>=_0x58a67a){_0x31d3c1=_0x58a67a;_0x3bede6=0xc8;}else{_0x3bede6=0xce;}_0x199d20[_0xfa74('0x18')](_0x3bede6);return _0x199d20[_0xfa74('0x1d')]('Content-Range',_0x51dda1+'-'+_0x31d3c1+'/'+_0x58a67a)[_0xfa74('0x1e')](_0x947da6);}return null;};}function patchUpdates(_0x302eb4){return function(_0x2e6c33){try{jsonpatch['apply'](_0x2e6c33,_0x302eb4,!![]);}catch(_0x5466ca){return BPromise[_0xfa74('0x1f')](_0x5466ca);}return _0x2e6c33[_0xfa74('0x20')]();};}function saveUpdates(_0x9932db,_0xeaaa19){return function(_0x1a453d){if(_0x1a453d){return _0x1a453d['update'](_0x9932db)['then'](function(_0x3721bf){return _0x3721bf;});}return null;};}function removeEntity(_0x5aa8a7,_0x48cbd3){return function(_0x529810){if(_0x529810){return _0x529810[_0xfa74('0x21')]()[_0xfa74('0x22')](function(){var _0x42d9bf=_0x529810['get']({'plain':!![]});var _0x530f99=_0xfa74('0x23');return db[_0xfa74('0x24')]['destroy']({'where':{'type':_0x530f99,'resourceId':_0x42d9bf['id']}})[_0xfa74('0x22')](function(){return _0x529810;});})['then'](function(){_0x5aa8a7[_0xfa74('0x18')](0xcc)[_0xfa74('0x17')]();});}};}function handleEntityNotFound(_0x55d8e4,_0x298388){return function(_0x1130de){if(!_0x1130de){_0x55d8e4[_0xfa74('0x16')](0x194);}return _0x1130de;};}function handleError(_0x218c86,_0x4f7337){_0x4f7337=_0x4f7337||0x1f4;return function(_0xd9c55d){logger[_0xfa74('0x25')](_0xd9c55d[_0xfa74('0x26')]);if(_0xd9c55d['name']){delete _0xd9c55d['name'];}_0x218c86[_0xfa74('0x18')](_0x4f7337)[_0xfa74('0x27')](_0xd9c55d);};}exports['index']=function(_0x4b38fc,_0x343466){var _0x564060={},_0x2238d4={},_0x4d6d0a={'count':0x0,'rows':[]};var _0x363173=_[_0xfa74('0x28')](db[_0xfa74('0x29')][_0xfa74('0x2a')],function(_0x4c506f){return{'name':_0x4c506f[_0xfa74('0x2b')],'type':_0x4c506f[_0xfa74('0x2c')][_0xfa74('0x2d')]};});_0x2238d4[_0xfa74('0x2e')]=_[_0xfa74('0x28')](_0x363173,_0xfa74('0x2f'));_0x2238d4[_0xfa74('0x30')]=_['keys'](_0x4b38fc[_0xfa74('0x30')]);_0x2238d4['filters']=_[_0xfa74('0x31')](_0x2238d4[_0xfa74('0x2e')],_0x2238d4[_0xfa74('0x30')]);_0x564060[_0xfa74('0x32')]=_['intersection'](_0x2238d4['model'],qs[_0xfa74('0x33')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x33')]));_0x564060[_0xfa74('0x32')]=_0x564060['attributes'][_0xfa74('0x34')]?_0x564060[_0xfa74('0x32')]:_0x2238d4['model'];if(!_0x4b38fc['query']['hasOwnProperty']('nolimit')){_0x564060['limit']=qs[_0xfa74('0x1b')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x564060[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x19')]);}_0x564060[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x4b38fc['query'][_0xfa74('0x36')]);_0x564060[_0xfa74('0x37')]=qs[_0xfa74('0x38')](_[_0xfa74('0x39')](_0x4b38fc[_0xfa74('0x30')],_0x2238d4[_0xfa74('0x38')]),_0x363173);if(_0x4b38fc['query'][_0xfa74('0x3a')]){_0x564060[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x564060[_0xfa74('0x37')],{'$or':_['map'](_0x363173,function(_0x207566){if(_0x207566[_0xfa74('0x2c')]!==_0xfa74('0x3c')){var _0x35f252={};_0x35f252[_0x207566['name']]={'$like':'%'+_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x35f252;}})});}_0x564060=_[_0xfa74('0x3b')]({},_0x564060,_0x4b38fc['options']);var _0x5d32bc={'where':_0x564060[_0xfa74('0x37')]};return db[_0xfa74('0x29')][_0xfa74('0x1c')](_0x5d32bc)[_0xfa74('0x22')](function(_0x55f4e3){_0x4d6d0a[_0xfa74('0x1c')]=_0x55f4e3;if(_0x4b38fc[_0xfa74('0x30')]['includeAll']){_0x564060['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x564060);})[_0xfa74('0x22')](function(_0x3098ca){_0x4d6d0a[_0xfa74('0x3d')]=_0x3098ca;return _0x4d6d0a;})[_0xfa74('0x22')](respondWithFilteredResult(_0x343466,_0x564060))[_0xfa74('0x3e')](handleError(_0x343466,null));};exports[_0xfa74('0x3f')]=function(_0x7735c5,_0x5aac45){var _0x274062={'raw':!![],'where':{'id':_0x7735c5[_0xfa74('0x40')]['id']}},_0x3938c1={};_0x3938c1[_0xfa74('0x2e')]=_[_0xfa74('0x41')](db['VoiceMail'][_0xfa74('0x2a')]);_0x3938c1[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x7735c5[_0xfa74('0x30')]);_0x3938c1[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x3938c1[_0xfa74('0x2e')],_0x3938c1[_0xfa74('0x30')]);_0x274062[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x3938c1['model'],qs[_0xfa74('0x33')](_0x7735c5['query'][_0xfa74('0x33')]));_0x274062[_0xfa74('0x32')]=_0x274062[_0xfa74('0x32')][_0xfa74('0x34')]?_0x274062['attributes']:_0x3938c1[_0xfa74('0x2e')];if(_0x7735c5[_0xfa74('0x30')]['includeAll']){_0x274062[_0xfa74('0x42')]=[{'all':!![]}];}_0x274062=_[_0xfa74('0x3b')]({},_0x274062,_0x7735c5['options']);return db[_0xfa74('0x29')][_0xfa74('0x43')](_0x274062)[_0xfa74('0x22')](handleEntityNotFound(_0x5aac45,null))[_0xfa74('0x22')](respondWithResult(_0x5aac45,null))[_0xfa74('0x3e')](handleError(_0x5aac45,null));};exports['create']=function(_0x54e06c,_0x36f6ca){return db[_0xfa74('0x29')]['create'](_0x54e06c[_0xfa74('0x44')],{})[_0xfa74('0x22')](function(_0x3100f2){var _0x4ca49e=_0x54e06c['user'][_0xfa74('0x45')]({'plain':!![]});if(!_0x4ca49e)throw new Error(_0xfa74('0x46'));if(_0x4ca49e[_0xfa74('0x47')]===_0xfa74('0x48')){var _0x36508a=_0x3100f2[_0xfa74('0x45')]({'plain':!![]});var _0x2d217d=_0xfa74('0x23');return db['UserProfileSection'][_0xfa74('0x43')]({'where':{'name':_0x2d217d,'userProfileId':_0x4ca49e[_0xfa74('0x49')]},'raw':!![]})[_0xfa74('0x22')](function(_0x2654b5){if(_0x2654b5&&_0x2654b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa74('0x4a')]({'name':_0x36508a['name'],'resourceId':_0x36508a['id'],'type':_0x2654b5[_0xfa74('0x2f')],'sectionId':_0x2654b5['id']},{})[_0xfa74('0x22')](function(){return _0x3100f2;});}else{return _0x3100f2;}})[_0xfa74('0x3e')](function(_0x33e31e){logger[_0xfa74('0x25')](_0xfa74('0x4b'),_0x33e31e);throw _0x33e31e;});}return _0x3100f2;})[_0xfa74('0x22')](respondWithResult(_0x36f6ca,0xc9))['catch'](handleError(_0x36f6ca,null));};exports[_0xfa74('0x4c')]=function(_0x4bcee3,_0x21d7c5){if(_0x4bcee3['body']['id']){delete _0x4bcee3['body']['id'];}return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0x4bcee3['params']['id']}})['then'](handleEntityNotFound(_0x21d7c5,null))[_0xfa74('0x22')](saveUpdates(_0x4bcee3[_0xfa74('0x44')],null))[_0xfa74('0x22')](respondWithResult(_0x21d7c5,null))[_0xfa74('0x3e')](handleError(_0x21d7c5,null));};exports[_0xfa74('0x21')]=function(_0xfc3547,_0x1198f3){return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0xfc3547[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x1198f3,null))[_0xfa74('0x22')](removeEntity(_0x1198f3,null))[_0xfa74('0x3e')](handleError(_0x1198f3,null));};exports['getMessages']=function(_0x550974,_0x3d88dc,_0x2e7262){return db[_0xfa74('0x29')][_0xfa74('0x4d')]({'where':{'id':_0x550974[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d88dc,null))[_0xfa74('0x22')](function(_0x4d6235){var _0x26b398;var _0x2fff37={},_0x375bf7={};_0x375bf7['model']=_['keys'](db[_0xfa74('0x4e')][_0xfa74('0x2a')]);_0x375bf7[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x550974['query']);_0x375bf7[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x375bf7['model'],_0x375bf7[_0xfa74('0x30')]);_0x2fff37[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x375bf7[_0xfa74('0x2e')],qs['fields'](_0x550974[_0xfa74('0x30')]['fields']));_0x2fff37[_0xfa74('0x32')]=_0x2fff37[_0xfa74('0x32')][_0xfa74('0x34')]?_0x2fff37[_0xfa74('0x32')]:_0x375bf7[_0xfa74('0x2e')];if(!_0x550974[_0xfa74('0x30')][_0xfa74('0x4f')](_0xfa74('0x50'))){_0x2fff37[_0xfa74('0x1b')]=qs[_0xfa74('0x1b')](_0x550974[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x2fff37[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x550974[_0xfa74('0x30')]['offset']);}_0x2fff37[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x550974['query']['sort']);_0x2fff37[_0xfa74('0x37')]=qs['filters'](_[_0xfa74('0x39')](_0x550974[_0xfa74('0x30')],_0x375bf7[_0xfa74('0x38')]));if(_0x550974['query'][_0xfa74('0x3a')]){_0x2fff37['where']=_['merge'](_0x2fff37[_0xfa74('0x37')],{'$or':_[_0xfa74('0x28')](_0x2fff37[_0xfa74('0x32')],function(_0x414e31){var _0x474c7d={};_0x474c7d[_0x414e31]={'$like':'%'+_0x550974[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x474c7d;})});}_0x2fff37[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x2fff37[_0xfa74('0x37')],{'mailboxuser':_0x4d6235[_0xfa74('0x51')]});_0x2fff37=_['merge']({},_0x2fff37,_0x550974[_0xfa74('0x52')]);return db['VoiceMailMessage'][_0xfa74('0x53')](_0x2fff37)[_0xfa74('0x22')](respondWithFilteredResult(_0x3d88dc,_0x2fff37));})[_0xfa74('0x3e')](handleError(_0x3d88dc,null));}; \ No newline at end of file +var _0x0fd9=['ejs','squel','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv'];(function(_0x293af0,_0x2187fb){var _0x198dac=function(_0x5bec9d){while(--_0x5bec9d){_0x293af0['push'](_0x293af0['shift']());}};_0x198dac(++_0x2187fb);}(_0x0fd9,0xa3));var _0x90fd=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0x0fd9[_0x232ec0];return _0x356705;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){var _0x52b066=_0x300262[_0x90fd('0x26')]({'plain':!![]});var _0x18d5b3=_0x90fd('0x27');return db[_0x90fd('0x28')][_0x90fd('0x29')]({'where':{'type':_0x18d5b3,'resourceId':_0x52b066['id']}})['then'](function(){return _0x300262;});})[_0x90fd('0x25')](function(){_0x3ad6c6[_0x90fd('0x19')](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x1cdc38,_0x1c3805){return function(_0x428bc2){if(!_0x428bc2){_0x1cdc38['sendStatus'](0x194);}return _0x428bc2;};}function handleError(_0x5671fc,_0xbf1c9b){_0xbf1c9b=_0xbf1c9b||0x1f4;return function(_0x170cfb){logger[_0x90fd('0x2a')](_0x170cfb[_0x90fd('0x2b')]);if(_0x170cfb[_0x90fd('0x2c')]){delete _0x170cfb['name'];}_0x5671fc['status'](_0xbf1c9b)[_0x90fd('0x2d')](_0x170cfb);};}exports[_0x90fd('0x2e')]=function(_0x228fbc,_0x3a0102){var _0x4a3ae4={},_0x59aede={},_0x12dea4={'count':0x0,'rows':[]};var _0x21a9cf=_[_0x90fd('0x2f')](db[_0x90fd('0x30')]['rawAttributes'],function(_0x2c5204){return{'name':_0x2c5204[_0x90fd('0x31')],'type':_0x2c5204[_0x90fd('0x32')][_0x90fd('0x33')]};});_0x59aede[_0x90fd('0x34')]=_[_0x90fd('0x2f')](_0x21a9cf,_0x90fd('0x2c'));_0x59aede[_0x90fd('0x35')]=_[_0x90fd('0x36')](_0x228fbc[_0x90fd('0x35')]);_0x59aede[_0x90fd('0x37')]=_[_0x90fd('0x38')](_0x59aede[_0x90fd('0x34')],_0x59aede[_0x90fd('0x35')]);_0x4a3ae4[_0x90fd('0x39')]=_[_0x90fd('0x38')](_0x59aede['model'],qs[_0x90fd('0x3a')](_0x228fbc[_0x90fd('0x35')][_0x90fd('0x3a')]));_0x4a3ae4[_0x90fd('0x39')]=_0x4a3ae4[_0x90fd('0x39')][_0x90fd('0x3b')]?_0x4a3ae4[_0x90fd('0x39')]:_0x59aede[_0x90fd('0x34')];if(!_0x228fbc[_0x90fd('0x35')][_0x90fd('0x3c')](_0x90fd('0x3d'))){_0x4a3ae4[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x228fbc['query'][_0x90fd('0x1c')]);_0x4a3ae4[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x228fbc[_0x90fd('0x35')]['offset']);}_0x4a3ae4[_0x90fd('0x3e')]=qs[_0x90fd('0x3f')](_0x228fbc[_0x90fd('0x35')]['sort']);_0x4a3ae4['where']=qs[_0x90fd('0x37')](_[_0x90fd('0x40')](_0x228fbc[_0x90fd('0x35')],_0x59aede[_0x90fd('0x37')]),_0x21a9cf);if(_0x228fbc[_0x90fd('0x35')][_0x90fd('0x41')]){_0x4a3ae4[_0x90fd('0x42')]=_[_0x90fd('0x43')](_0x4a3ae4[_0x90fd('0x42')],{'$or':_[_0x90fd('0x2f')](_0x21a9cf,function(_0x3265c6){if(_0x3265c6[_0x90fd('0x32')]!==_0x90fd('0x44')){var _0x47856d={};_0x47856d[_0x3265c6[_0x90fd('0x2c')]]={'$like':'%'+_0x228fbc[_0x90fd('0x35')][_0x90fd('0x41')]+'%'};return _0x47856d;}})});}_0x4a3ae4=_[_0x90fd('0x43')]({},_0x4a3ae4,_0x228fbc['options']);var _0xa5f17={'where':_0x4a3ae4[_0x90fd('0x42')]};return db[_0x90fd('0x30')]['count'](_0xa5f17)['then'](function(_0x47b8c8){_0x12dea4[_0x90fd('0x1d')]=_0x47b8c8;if(_0x228fbc[_0x90fd('0x35')][_0x90fd('0x45')]){_0x4a3ae4[_0x90fd('0x46')]=[{'all':!![]}];}return db[_0x90fd('0x30')][_0x90fd('0x47')](_0x4a3ae4);})[_0x90fd('0x25')](function(_0x733d4d){_0x12dea4[_0x90fd('0x48')]=_0x733d4d;return _0x12dea4;})[_0x90fd('0x25')](respondWithFilteredResult(_0x3a0102,_0x4a3ae4))[_0x90fd('0x49')](handleError(_0x3a0102,null));};exports[_0x90fd('0x4a')]=function(_0x4cb682,_0x386a0e){var _0x311cbf={'raw':!![],'where':{'id':_0x4cb682['params']['id']}},_0x50b722={};_0x50b722[_0x90fd('0x34')]=_[_0x90fd('0x36')](db[_0x90fd('0x30')]['rawAttributes']);_0x50b722['query']=_[_0x90fd('0x36')](_0x4cb682[_0x90fd('0x35')]);_0x50b722['filters']=_['intersection'](_0x50b722[_0x90fd('0x34')],_0x50b722[_0x90fd('0x35')]);_0x311cbf['attributes']=_['intersection'](_0x50b722[_0x90fd('0x34')],qs[_0x90fd('0x3a')](_0x4cb682[_0x90fd('0x35')]['fields']));_0x311cbf[_0x90fd('0x39')]=_0x311cbf[_0x90fd('0x39')]['length']?_0x311cbf['attributes']:_0x50b722['model'];if(_0x4cb682[_0x90fd('0x35')][_0x90fd('0x45')]){_0x311cbf['include']=[{'all':!![]}];}_0x311cbf=_[_0x90fd('0x43')]({},_0x311cbf,_0x4cb682[_0x90fd('0x4b')]);return db[_0x90fd('0x30')][_0x90fd('0x4c')](_0x311cbf)[_0x90fd('0x25')](handleEntityNotFound(_0x386a0e,null))['then'](respondWithResult(_0x386a0e,null))['catch'](handleError(_0x386a0e,null));};exports[_0x90fd('0x4d')]=function(_0x326e4d,_0x125874){return db[_0x90fd('0x30')][_0x90fd('0x4d')](_0x326e4d[_0x90fd('0x4e')],{})[_0x90fd('0x25')](function(_0x277751){var _0x31b284=_0x326e4d[_0x90fd('0x4f')]['get']({'plain':!![]});if(!_0x31b284)throw new Error(_0x90fd('0x50'));if(_0x31b284[_0x90fd('0x51')]===_0x90fd('0x4f')){var _0x38021b=_0x277751['get']({'plain':!![]});var _0x4cf061=_0x90fd('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4cf061,'userProfileId':_0x31b284[_0x90fd('0x52')]},'raw':!![]})[_0x90fd('0x25')](function(_0x41f029){if(_0x41f029&&_0x41f029[_0x90fd('0x53')]===0x0){return db[_0x90fd('0x28')][_0x90fd('0x4d')]({'name':_0x38021b[_0x90fd('0x2c')],'resourceId':_0x38021b['id'],'type':_0x41f029['name'],'sectionId':_0x41f029['id']},{})['then'](function(){return _0x277751;});}else{return _0x277751;}})[_0x90fd('0x49')](function(_0x43d076){logger[_0x90fd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43d076);throw _0x43d076;});}return _0x277751;})[_0x90fd('0x25')](respondWithResult(_0x125874,0xc9))[_0x90fd('0x49')](handleError(_0x125874,null));};exports[_0x90fd('0x24')]=function(_0x3494f7,_0x437abd){if(_0x3494f7[_0x90fd('0x4e')]['id']){delete _0x3494f7[_0x90fd('0x4e')]['id'];}return db[_0x90fd('0x30')]['find']({'where':{'id':_0x3494f7['params']['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x437abd,null))[_0x90fd('0x25')](saveUpdates(_0x3494f7[_0x90fd('0x4e')],null))['then'](respondWithResult(_0x437abd,null))[_0x90fd('0x49')](handleError(_0x437abd,null));};exports[_0x90fd('0x29')]=function(_0x29b880,_0x24229f){return db[_0x90fd('0x30')][_0x90fd('0x4c')]({'where':{'id':_0x29b880['params']['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x24229f,null))['then'](removeEntity(_0x24229f,null))[_0x90fd('0x49')](handleError(_0x24229f,null));};exports['getMessages']=function(_0x29b7ea,_0x461509,_0x2fb220){return db[_0x90fd('0x30')]['findOne']({'where':{'id':_0x29b7ea[_0x90fd('0x54')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x461509,null))[_0x90fd('0x25')](function(_0x40fea3){var _0x4586e9;var _0x15bca2={},_0x57acf6={};_0x57acf6['model']=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x57acf6[_0x90fd('0x35')]=_[_0x90fd('0x36')](_0x29b7ea[_0x90fd('0x35')]);_0x57acf6[_0x90fd('0x37')]=_[_0x90fd('0x38')](_0x57acf6['model'],_0x57acf6['query']);_0x15bca2['attributes']=_[_0x90fd('0x38')](_0x57acf6[_0x90fd('0x34')],qs['fields'](_0x29b7ea[_0x90fd('0x35')][_0x90fd('0x3a')]));_0x15bca2[_0x90fd('0x39')]=_0x15bca2[_0x90fd('0x39')][_0x90fd('0x3b')]?_0x15bca2[_0x90fd('0x39')]:_0x57acf6[_0x90fd('0x34')];if(!_0x29b7ea[_0x90fd('0x35')][_0x90fd('0x3c')]('nolimit')){_0x15bca2[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x29b7ea[_0x90fd('0x35')]['limit']);_0x15bca2['offset']=qs[_0x90fd('0x1e')](_0x29b7ea[_0x90fd('0x35')]['offset']);}_0x15bca2[_0x90fd('0x3e')]=qs['sort'](_0x29b7ea['query'][_0x90fd('0x3f')]);_0x15bca2[_0x90fd('0x42')]=qs[_0x90fd('0x37')](_[_0x90fd('0x40')](_0x29b7ea[_0x90fd('0x35')],_0x57acf6[_0x90fd('0x37')]));if(_0x29b7ea[_0x90fd('0x35')][_0x90fd('0x41')]){_0x15bca2['where']=_[_0x90fd('0x43')](_0x15bca2[_0x90fd('0x42')],{'$or':_[_0x90fd('0x2f')](_0x15bca2['attributes'],function(_0x2d0f4b){var _0x4636d5={};_0x4636d5[_0x2d0f4b]={'$like':'%'+_0x29b7ea['query']['filter']+'%'};return _0x4636d5;})});}_0x15bca2[_0x90fd('0x42')]=_[_0x90fd('0x43')](_0x15bca2[_0x90fd('0x42')],{'mailboxuser':_0x40fea3['mailbox']});_0x15bca2=_[_0x90fd('0x43')]({},_0x15bca2,_0x29b7ea['options']);return db['VoiceMailMessage'][_0x90fd('0x55')](_0x15bca2)['then'](respondWithFilteredResult(_0x461509,_0x15bca2));})[_0x90fd('0x49')](handleError(_0x461509,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fbf3ea7..255748f 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 _0x4b10=['mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x12f3be,_0x32796a){var _0x551fa4=function(_0x5622ec){while(--_0x5622ec){_0x12f3be['push'](_0x12f3be['shift']());}};_0x551fa4(++_0x32796a);}(_0x4b10,0x132));var _0x04b1=function(_0x14aa83,_0x41aa42){_0x14aa83=_0x14aa83-0x0;var _0x14ddbd=_0x4b10[_0x14aa83];return _0x14ddbd;};'use strict';var _=require(_0x04b1('0x0'));var util=require(_0x04b1('0x1'));var logger=require(_0x04b1('0x2'))(_0x04b1('0x3'));var moment=require(_0x04b1('0x4'));var BPromise=require(_0x04b1('0x5'));var rp=require(_0x04b1('0x6'));var fs=require('fs');var path=require(_0x04b1('0x7'));var rimraf=require(_0x04b1('0x8'));var config=require(_0x04b1('0x9'));var attributes=require(_0x04b1('0xa'));module['exports']=function(_0x22b5cf,_0x33e7c7){return _0x22b5cf['define'](_0x04b1('0xb'),attributes,{'tableName':_0x04b1('0xc'),'paranoid':![],'indexes':[{'name':_0x04b1('0xd'),'fields':[_0x04b1('0xe'),_0x04b1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a01=['request-promise','path','rimraf','../../config/environment','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x730b1e,_0x1cb23e){var _0xb0ac7=function(_0x1bc287){while(--_0x1bc287){_0x730b1e['push'](_0x730b1e['shift']());}};_0xb0ac7(++_0x1cb23e);}(_0x5a01,0x14a));var _0x15a0=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0x5a01[_0x50c492];return _0x3505a8;};'use strict';var _=require(_0x15a0('0x0'));var util=require(_0x15a0('0x1'));var logger=require(_0x15a0('0x2'))(_0x15a0('0x3'));var moment=require(_0x15a0('0x4'));var BPromise=require(_0x15a0('0x5'));var rp=require(_0x15a0('0x6'));var fs=require('fs');var path=require(_0x15a0('0x7'));var rimraf=require(_0x15a0('0x8'));var config=require(_0x15a0('0x9'));var attributes=require('./voiceMail.attributes');module[_0x15a0('0xa')]=function(_0xb28c1b,_0x4044f5){return _0xb28c1b[_0x15a0('0xb')]('VoiceMail',attributes,{'tableName':_0x15a0('0xc'),'paranoid':![],'indexes':[{'name':_0x15a0('0xd'),'fields':[_0x15a0('0xe'),_0x15a0('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index eca403d..d563672 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 _0xa8a0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x2849d3,_0x558165){var _0x39ace3=function(_0x33c311){while(--_0x33c311){_0x2849d3['push'](_0x2849d3['shift']());}};_0x39ace3(++_0x558165);}(_0xa8a0,0x166));var _0x0a8a=function(_0x182fc4,_0x22cdae){_0x182fc4=_0x182fc4-0x0;var _0x2c0726=_0xa8a0[_0x182fc4];return _0x2c0726;};'use strict';var _=require(_0x0a8a('0x0'));var util=require(_0x0a8a('0x1'));var moment=require(_0x0a8a('0x2'));var BPromise=require(_0x0a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a8a('0x4'))['db'];var utils=require(_0x0a8a('0x5'));var logger=require(_0x0a8a('0x6'))(_0x0a8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xba56cd,_0x4c352c,_0x1645f4){return new BPromise(function(_0x53db0e,_0x3e9214){return client['request'](_0xba56cd,_0x1645f4)[_0x0a8a('0x9')](function(_0x54fe60){logger[_0x0a8a('0xa')](_0x0a8a('0xb'),_0x4c352c,_0x0a8a('0xc'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4c352c,_0x0a8a('0xc'),JSON[_0x0a8a('0xd')](_0x54fe60));if(_0x54fe60[_0x0a8a('0xe')]){if(_0x54fe60['error'][_0x0a8a('0xf')]===0x1f4){logger[_0x0a8a('0xe')](_0x0a8a('0xb'),_0x4c352c,_0x54fe60[_0x0a8a('0xe')][_0x0a8a('0x10')]);return _0x3e9214(_0x54fe60[_0x0a8a('0xe')]['message']);}logger[_0x0a8a('0xe')]('VoiceMail,\x20%s,\x20%s',_0x4c352c,_0x54fe60['error'][_0x0a8a('0x10')]);return _0x53db0e(_0x54fe60[_0x0a8a('0xe')][_0x0a8a('0x10')]);}else{logger[_0x0a8a('0xa')](_0x0a8a('0xb'),_0x4c352c,_0x0a8a('0xc'));_0x53db0e(_0x54fe60['result'][_0x0a8a('0x10')]);}})[_0x0a8a('0x11')](function(_0x88bd84){logger[_0x0a8a('0xe')](_0x0a8a('0xb'),_0x4c352c,_0x88bd84);_0x3e9214(_0x88bd84);});});} \ No newline at end of file +var _0xe5e9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0xe5e9,0xf8));var _0x9e5e=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xe5e9[_0x1a4748];return _0x28ca99;};'use strict';var _=require('lodash');var util=require(_0x9e5e('0x0'));var moment=require(_0x9e5e('0x1'));var BPromise=require(_0x9e5e('0x2'));var rs=require(_0x9e5e('0x3'));var fs=require('fs');var Redis=require(_0x9e5e('0x4'));var db=require(_0x9e5e('0x5'))['db'];var utils=require(_0x9e5e('0x6'));var logger=require(_0x9e5e('0x7'))(_0x9e5e('0x8'));var config=require(_0x9e5e('0x9'));var jayson=require(_0x9e5e('0xa'));var client=jayson[_0x9e5e('0xb')][_0x9e5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85475a,_0xbf51ca,_0x5bc050){return new BPromise(function(_0x3ff4e6,_0x4486c9){return client[_0x9e5e('0xd')](_0x85475a,_0x5bc050)[_0x9e5e('0xe')](function(_0x5d0a7b){logger[_0x9e5e('0xf')](_0x9e5e('0x10'),_0xbf51ca,_0x9e5e('0x11'));logger[_0x9e5e('0x12')](_0x9e5e('0x13'),_0xbf51ca,_0x9e5e('0x11'),JSON['stringify'](_0x5d0a7b));if(_0x5d0a7b[_0x9e5e('0x14')]){if(_0x5d0a7b[_0x9e5e('0x14')][_0x9e5e('0x15')]===0x1f4){logger[_0x9e5e('0x14')](_0x9e5e('0x10'),_0xbf51ca,_0x5d0a7b[_0x9e5e('0x14')]['message']);return _0x4486c9(_0x5d0a7b[_0x9e5e('0x14')][_0x9e5e('0x16')]);}logger[_0x9e5e('0x14')](_0x9e5e('0x10'),_0xbf51ca,_0x5d0a7b[_0x9e5e('0x14')][_0x9e5e('0x16')]);return _0x3ff4e6(_0x5d0a7b[_0x9e5e('0x14')][_0x9e5e('0x16')]);}else{logger[_0x9e5e('0xf')](_0x9e5e('0x10'),_0xbf51ca,_0x9e5e('0x11'));_0x3ff4e6(_0x5d0a7b[_0x9e5e('0x17')][_0x9e5e('0x16')]);}})[_0x9e5e('0x18')](function(_0x5c381f){logger[_0x9e5e('0x14')](_0x9e5e('0x10'),_0xbf51ca,_0x5c381f);_0x4486c9(_0x5c381f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 1328964..27f2cad 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 _0x46c6=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','/:id'];(function(_0x243649,_0x570f7a){var _0x422791=function(_0x238526){while(--_0x238526){_0x243649['push'](_0x243649['shift']());}};_0x422791(++_0x570f7a);}(_0x46c6,0x100));var _0x646c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46c6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x646c('0x0'));var path=require(_0x646c('0x1'));var timeout=require(_0x646c('0x2'));var express=require(_0x646c('0x3'));var router=express[_0x646c('0x4')]();var fs_extra=require(_0x646c('0x5'));var auth=require(_0x646c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x646c('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x646c('0x8')]('/',auth[_0x646c('0x9')](),controller[_0x646c('0xa')]);router['get']('/:id',auth[_0x646c('0x9')](),controller['show']);router[_0x646c('0x8')]('/:id/download',auth[_0x646c('0x9')](),controller['download']);router[_0x646c('0xb')]('/',auth[_0x646c('0x9')](),controller[_0x646c('0xc')]);router[_0x646c('0xd')]('/:id',auth[_0x646c('0x9')](),controller[_0x646c('0xe')]);router['delete'](_0x646c('0xf'),auth['isAuthenticated'](),controller[_0x646c('0x10')]);module['exports']=router; \ No newline at end of file +var _0x45d5=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','create'];(function(_0x202216,_0x161946){var _0x5584e7=function(_0x259184){while(--_0x259184){_0x202216['push'](_0x202216['shift']());}};_0x5584e7(++_0x161946);}(_0x45d5,0xf5));var _0x545d=function(_0x18bb6d,_0x450e13){_0x18bb6d=_0x18bb6d-0x0;var _0x587868=_0x45d5[_0x18bb6d];return _0x587868;};'use strict';var multer=require(_0x545d('0x0'));var util=require(_0x545d('0x1'));var path=require(_0x545d('0x2'));var timeout=require(_0x545d('0x3'));var express=require('express');var router=express[_0x545d('0x4')]();var fs_extra=require(_0x545d('0x5'));var auth=require(_0x545d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x545d('0x7'));var controller=require(_0x545d('0x8'));router[_0x545d('0x9')]('/',auth[_0x545d('0xa')](),controller[_0x545d('0xb')]);router[_0x545d('0x9')]('/:id',auth[_0x545d('0xa')](),controller[_0x545d('0xc')]);router[_0x545d('0x9')](_0x545d('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x545d('0xe')]);router[_0x545d('0xf')](_0x545d('0x10'),auth[_0x545d('0xa')](),controller['update']);router[_0x545d('0x11')]('/:id',auth[_0x545d('0xa')](),controller[_0x545d('0x12')]);module[_0x545d('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 3097a0d..57df7e5 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 _0x72dd=['STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x5ccc89,_0x82a7f){var _0x5c53ca=function(_0x3a7619){while(--_0x3a7619){_0x5ccc89['push'](_0x5ccc89['shift']());}};_0x5c53ca(++_0x82a7f);}(_0x72dd,0xe6));var _0xd72d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x72dd[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xd72d('0x0'));module['exports']={'name':{'type':Sequelize[_0xd72d('0x1')],'get':function(_0x2d18df){return this[_0xd72d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd72d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xd72d('0x5')](_0xd72d('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd72d('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xd72d('0x7')](_0xd72d('0x8'))}}; \ No newline at end of file +var _0x096d=['INTEGER','STRING','long','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x1403d1,_0x223517){var _0x3def31=function(_0x1b94d5){while(--_0x1b94d5){_0x1403d1['push'](_0x1403d1['shift']());}};_0x3def31(++_0x223517);}(_0x096d,0x7c));var _0xd096=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0x096d[_0xbaf094];return _0x3974fd;};'use strict';var Sequelize=require(_0xd096('0x0'));module[_0xd096('0x1')]={'name':{'type':Sequelize[_0xd096('0x2')],'get':function(_0x35e3fb){return this[_0xd096('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xd096('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd096('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd096('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd096('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd096('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd096('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0xd096('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 7def748..21d35fb 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 _0xf9b5=['fields','options','find','create','body','download','msg_id','recording','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','differenceBy','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','filter','merge','type','VIRTUAL','where','includeAll','include','findAll','rows','catch','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf9b5,0xa6));var _0x5f9b=function(_0x12ab9c,_0x1ad557){_0x12ab9c=_0x12ab9c-0x0;var _0x2a3e39=_0xf9b5[_0x12ab9c];return _0x2a3e39;};'use strict';var emlformat=require(_0x5f9b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f9b('0x1'));var rp=require(_0x5f9b('0x2'));var moment=require('moment');var BPromise=require(_0x5f9b('0x3'));var Mustache=require(_0x5f9b('0x4'));var util=require(_0x5f9b('0x5'));var path=require(_0x5f9b('0x6'));var sox=require('sox');var csv=require(_0x5f9b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f9b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f9b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5f9b('0xa'));var toCsv=require(_0x5f9b('0x7'));var querystring=require(_0x5f9b('0xb'));var Papa=require(_0x5f9b('0xc'));var Redis=require('ioredis');var authService=require(_0x5f9b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f9b('0xe'));var logger=require(_0x5f9b('0xf'))('api');var utils=require(_0x5f9b('0x10'));var config=require(_0x5f9b('0x11'));var licenseUtil=require(_0x5f9b('0x12'));var db=require(_0x5f9b('0x13'))['db'];function respondWithStatusCode(_0x734f05,_0x452965){_0x452965=_0x452965||0xcc;return function(_0x17b15d){if(_0x17b15d){return _0x734f05[_0x5f9b('0x14')](_0x452965);}return _0x734f05[_0x5f9b('0x15')](_0x452965)[_0x5f9b('0x16')]();};}function respondWithResult(_0x533789,_0x113613){_0x113613=_0x113613||0xc8;return function(_0x2fd5c8){if(_0x2fd5c8){return _0x533789['status'](_0x113613)[_0x5f9b('0x17')](_0x2fd5c8);}};}function respondWithFilteredResult(_0x1f1871,_0x5a58ae){return function(_0x52e805){if(_0x52e805){var _0x44c2c4=typeof _0x5a58ae['offset']==='undefined'&&typeof _0x5a58ae[_0x5f9b('0x18')]===_0x5f9b('0x19');var _0x4e6fda=_0x52e805[_0x5f9b('0x1a')];var _0x4fbf4d=_0x44c2c4?0x0:_0x5a58ae[_0x5f9b('0x1b')];var _0x30a2ea=_0x44c2c4?_0x52e805[_0x5f9b('0x1a')]:_0x5a58ae[_0x5f9b('0x1b')]+_0x5a58ae[_0x5f9b('0x18')];var _0x1393c6;if(_0x30a2ea>=_0x4e6fda){_0x30a2ea=_0x4e6fda;_0x1393c6=0xc8;}else{_0x1393c6=0xce;}_0x1f1871[_0x5f9b('0x15')](_0x1393c6);return _0x1f1871[_0x5f9b('0x1c')]('Content-Range',_0x4fbf4d+'-'+_0x30a2ea+'/'+_0x4e6fda)['json'](_0x52e805);}return null;};}function patchUpdates(_0x708bc0){return function(_0x58674a){try{jsonpatch[_0x5f9b('0x1d')](_0x58674a,_0x708bc0,!![]);}catch(_0x5e5ce2){return BPromise[_0x5f9b('0x1e')](_0x5e5ce2);}return _0x58674a[_0x5f9b('0x1f')]();};}function saveUpdates(_0x2ef04b,_0x293a0b){return function(_0x15087a){if(_0x15087a){return _0x15087a['update'](_0x2ef04b)[_0x5f9b('0x20')](function(_0x1db538){return _0x1db538;});}return null;};}function removeEntity(_0x305b23,_0x51fc3f){return function(_0x1be85c){if(_0x1be85c){return _0x1be85c[_0x5f9b('0x21')]()[_0x5f9b('0x20')](function(){_0x305b23[_0x5f9b('0x15')](0xcc)[_0x5f9b('0x16')]();});}};}function handleEntityNotFound(_0x4072e2,_0x8c27c7){return function(_0x365df4){if(!_0x365df4){_0x4072e2['sendStatus'](0x194);}return _0x365df4;};}function handleError(_0x95ce7a,_0x4fbeab){_0x4fbeab=_0x4fbeab||0x1f4;return function(_0x3b0654){logger[_0x5f9b('0x22')](_0x3b0654['stack']);if(_0x3b0654[_0x5f9b('0x23')]){delete _0x3b0654['name'];}_0x95ce7a[_0x5f9b('0x15')](_0x4fbeab)[_0x5f9b('0x24')](_0x3b0654);};}exports[_0x5f9b('0x25')]=function(_0x329043,_0xe50f2c){var _0x43a028={},_0x533cf4={},_0xa6d4ef={'count':0x0,'rows':[]};var _0x49f1ab=_[_0x5f9b('0x26')](db[_0x5f9b('0x27')][_0x5f9b('0x28')],function(_0x51cc46){return{'name':_0x51cc46[_0x5f9b('0x29')],'type':_0x51cc46['type'][_0x5f9b('0x2a')]};});_0x533cf4['model']=_[_0x5f9b('0x2b')](_[_0x5f9b('0x26')](_0x49f1ab,_0x5f9b('0x23')),[_0x5f9b('0x23')]);_0x533cf4[_0x5f9b('0x2c')]=_[_0x5f9b('0x2d')](_0x329043[_0x5f9b('0x2c')]);_0x533cf4[_0x5f9b('0x2e')]=_['intersection'](_0x533cf4[_0x5f9b('0x2f')],_0x533cf4[_0x5f9b('0x2c')]);_0x43a028[_0x5f9b('0x30')]=_[_0x5f9b('0x31')](_0x533cf4[_0x5f9b('0x2f')],qs['fields'](_0x329043[_0x5f9b('0x2c')]['fields']));_0x43a028[_0x5f9b('0x30')]=_0x43a028[_0x5f9b('0x30')][_0x5f9b('0x32')]?_0x43a028[_0x5f9b('0x30')]:_0x533cf4[_0x5f9b('0x2f')];if(!_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x33')]('nolimit')){_0x43a028[_0x5f9b('0x18')]=qs[_0x5f9b('0x18')](_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x18')]);_0x43a028[_0x5f9b('0x1b')]=qs[_0x5f9b('0x1b')](_0x329043['query'][_0x5f9b('0x1b')]);}_0x43a028[_0x5f9b('0x34')]=qs[_0x5f9b('0x35')](_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x35')]);_0x43a028['where']=qs[_0x5f9b('0x2e')](_['pick'](_0x329043[_0x5f9b('0x2c')],_0x533cf4[_0x5f9b('0x2e')]),_0x49f1ab);if(_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x36')]){_0x43a028['where']=_[_0x5f9b('0x37')](_0x43a028['where'],{'$or':_[_0x5f9b('0x26')](_0x49f1ab,function(_0x177467){if(_0x177467[_0x5f9b('0x38')]!==_0x5f9b('0x39')){var _0x304026={};_0x304026[_0x177467['name']]={'$like':'%'+_0x329043['query'][_0x5f9b('0x36')]+'%'};return _0x304026;}})});}_0x43a028=_[_0x5f9b('0x37')]({},_0x43a028,_0x329043['options']);var _0x1270e6={'where':_0x43a028[_0x5f9b('0x3a')]};return db['VoiceMailMessage']['count'](_0x1270e6)[_0x5f9b('0x20')](function(_0x34817a){_0xa6d4ef['count']=_0x34817a;if(_0x329043[_0x5f9b('0x2c')][_0x5f9b('0x3b')]){_0x43a028[_0x5f9b('0x3c')]=[{'all':!![]}];}return db[_0x5f9b('0x27')][_0x5f9b('0x3d')](_0x43a028);})[_0x5f9b('0x20')](function(_0x5f54d4){_0xa6d4ef[_0x5f9b('0x3e')]=_0x5f54d4;return _0xa6d4ef;})['then'](respondWithFilteredResult(_0xe50f2c,_0x43a028))[_0x5f9b('0x3f')](handleError(_0xe50f2c,null));};exports['show']=function(_0x56b877,_0x2f11be){var _0x2d6e5d={'raw':!![],'where':{'id':_0x56b877[_0x5f9b('0x40')]['id']}},_0x498061={};_0x498061[_0x5f9b('0x2f')]=_[_0x5f9b('0x2d')](db[_0x5f9b('0x27')][_0x5f9b('0x28')]);_0x498061[_0x5f9b('0x2c')]=_['keys'](_0x56b877['query']);_0x498061['filters']=_[_0x5f9b('0x31')](_0x498061[_0x5f9b('0x2f')],_0x498061['query']);_0x2d6e5d[_0x5f9b('0x30')]=_[_0x5f9b('0x31')](_0x498061[_0x5f9b('0x2f')],qs[_0x5f9b('0x41')](_0x56b877[_0x5f9b('0x2c')][_0x5f9b('0x41')]));_0x2d6e5d[_0x5f9b('0x30')]=_0x2d6e5d[_0x5f9b('0x30')][_0x5f9b('0x32')]?_0x2d6e5d['attributes']:_0x498061[_0x5f9b('0x2f')];if(_0x56b877[_0x5f9b('0x2c')][_0x5f9b('0x3b')]){_0x2d6e5d['include']=[{'all':!![]}];}_0x2d6e5d=_['merge']({},_0x2d6e5d,_0x56b877[_0x5f9b('0x42')]);return db[_0x5f9b('0x27')][_0x5f9b('0x43')](_0x2d6e5d)[_0x5f9b('0x20')](handleEntityNotFound(_0x2f11be,null))[_0x5f9b('0x20')](respondWithResult(_0x2f11be,null))[_0x5f9b('0x3f')](handleError(_0x2f11be,null));};exports[_0x5f9b('0x44')]=function(_0x164760,_0x20fc16){return db[_0x5f9b('0x27')]['create'](_0x164760[_0x5f9b('0x45')],{})[_0x5f9b('0x20')](respondWithResult(_0x20fc16,0xc9))[_0x5f9b('0x3f')](handleError(_0x20fc16,null));};exports['update']=function(_0x3af502,_0x4c7fda){if(_0x3af502[_0x5f9b('0x45')]['id']){delete _0x3af502[_0x5f9b('0x45')]['id'];}return db[_0x5f9b('0x27')][_0x5f9b('0x43')]({'where':{'id':_0x3af502['params']['id']}})[_0x5f9b('0x20')](handleEntityNotFound(_0x4c7fda,null))[_0x5f9b('0x20')](saveUpdates(_0x3af502['body'],null))[_0x5f9b('0x20')](respondWithResult(_0x4c7fda,null))[_0x5f9b('0x3f')](handleError(_0x4c7fda,null));};exports['destroy']=function(_0x5acfa9,_0x2baefb){return db['VoiceMailMessage'][_0x5f9b('0x43')]({'where':{'id':_0x5acfa9['params']['id']}})[_0x5f9b('0x20')](handleEntityNotFound(_0x2baefb,null))['then'](removeEntity(_0x2baefb,null))[_0x5f9b('0x3f')](handleError(_0x2baefb,null));};exports[_0x5f9b('0x46')]=function(_0x12895b,_0x1e2bf2,_0x16859a){return db[_0x5f9b('0x27')][_0x5f9b('0x43')]({'where':{'id':_0x12895b['params']['id']},'attributes':['id','recording',_0x5f9b('0x47')]})[_0x5f9b('0x20')](handleEntityNotFound(_0x1e2bf2,null))[_0x5f9b('0x20')](function(_0x4519b6){if(_0x4519b6){if(!_0x4519b6[_0x5f9b('0x48')]){throw new db['Sequelize'][(_0x5f9b('0x49'))]('VoiceMailMessage\x20not\x20found');}var _0x61b250={'Content-Type':_0x5f9b('0x4a'),'Content-Disposition':_0x5f9b('0x4b')};if(_0x4519b6[_0x5f9b('0x47')]){_0x61b250['Content-Disposition']=_0x5f9b('0x4c')+_0x4519b6[_0x5f9b('0x47')]+'.wav\x22';}_0x1e2bf2[_0x5f9b('0x1c')](_0x61b250);return _0x1e2bf2[_0x5f9b('0x24')](new Buffer(_0x4519b6[_0x5f9b('0x48')]));}})['catch'](handleError(_0x1e2bf2,null));}; \ No newline at end of file +var _0x680e=['type','key','differenceBy','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','name','status','send','VoiceMailMessage'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x680e,0x7a));var _0xe680=function(_0xa270aa,_0x541b92){_0xa270aa=_0xa270aa-0x0;var _0x47ce02=_0x680e[_0xa270aa];return _0x47ce02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe680('0x0'));var zipdir=require(_0xe680('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe680('0x2'));var BPromise=require(_0xe680('0x3'));var Mustache=require(_0xe680('0x4'));var util=require(_0xe680('0x5'));var path=require('path');var sox=require(_0xe680('0x6'));var csv=require(_0xe680('0x7'));var ejs=require(_0xe680('0x8'));var fs=require('fs');var fs_extra=require(_0xe680('0x9'));var _=require(_0xe680('0xa'));var squel=require(_0xe680('0xb'));var crypto=require(_0xe680('0xc'));var jsforce=require(_0xe680('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe680('0x7'));var querystring=require(_0xe680('0xe'));var Papa=require(_0xe680('0xf'));var Redis=require(_0xe680('0x10'));var authService=require(_0xe680('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe680('0x12'));var hardwareService=require(_0xe680('0x13'));var logger=require(_0xe680('0x14'))('api');var utils=require(_0xe680('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe680('0x16'))['db'];function respondWithStatusCode(_0x3bff6c,_0x26a9e9){_0x26a9e9=_0x26a9e9||0xcc;return function(_0xba4fa5){if(_0xba4fa5){return _0x3bff6c[_0xe680('0x17')](_0x26a9e9);}return _0x3bff6c['status'](_0x26a9e9)[_0xe680('0x18')]();};}function respondWithResult(_0x1c7500,_0x5e3aba){_0x5e3aba=_0x5e3aba||0xc8;return function(_0x1fd089){if(_0x1fd089){return _0x1c7500['status'](_0x5e3aba)['json'](_0x1fd089);}};}function respondWithFilteredResult(_0x22b29d,_0x1da238){return function(_0x44518d){if(_0x44518d){var _0x468873=typeof _0x1da238[_0xe680('0x19')]===_0xe680('0x1a')&&typeof _0x1da238[_0xe680('0x1b')]===_0xe680('0x1a');var _0x1f9abf=_0x44518d[_0xe680('0x1c')];var _0x16f171=_0x468873?0x0:_0x1da238[_0xe680('0x19')];var _0x10b6c1=_0x468873?_0x44518d['count']:_0x1da238['offset']+_0x1da238[_0xe680('0x1b')];var _0x5ab037;if(_0x10b6c1>=_0x1f9abf){_0x10b6c1=_0x1f9abf;_0x5ab037=0xc8;}else{_0x5ab037=0xce;}_0x22b29d['status'](_0x5ab037);return _0x22b29d[_0xe680('0x1d')](_0xe680('0x1e'),_0x16f171+'-'+_0x10b6c1+'/'+_0x1f9abf)[_0xe680('0x1f')](_0x44518d);}return null;};}function patchUpdates(_0x16fd77){return function(_0x30e4ee){try{jsonpatch['apply'](_0x30e4ee,_0x16fd77,!![]);}catch(_0x127214){return BPromise[_0xe680('0x20')](_0x127214);}return _0x30e4ee[_0xe680('0x21')]();};}function saveUpdates(_0x4af546,_0x4f67d4){return function(_0x1d6825){if(_0x1d6825){return _0x1d6825[_0xe680('0x22')](_0x4af546)['then'](function(_0x23c059){return _0x23c059;});}return null;};}function removeEntity(_0x5d8f0f,_0x488720){return function(_0x7ad0c1){if(_0x7ad0c1){return _0x7ad0c1[_0xe680('0x23')]()[_0xe680('0x24')](function(){_0x5d8f0f['status'](0xcc)[_0xe680('0x18')]();});}};}function handleEntityNotFound(_0x228f13,_0x502393){return function(_0x37c732){if(!_0x37c732){_0x228f13[_0xe680('0x17')](0x194);}return _0x37c732;};}function handleError(_0x434c08,_0x3589da){_0x3589da=_0x3589da||0x1f4;return function(_0x3ae741){logger[_0xe680('0x25')](_0x3ae741['stack']);if(_0x3ae741['name']){delete _0x3ae741[_0xe680('0x26')];}_0x434c08[_0xe680('0x27')](_0x3589da)[_0xe680('0x28')](_0x3ae741);};}exports['index']=function(_0x982b1a,_0x30458b){var _0x504782={},_0x1ed88b={},_0x13a6a1={'count':0x0,'rows':[]};var _0x8ebdab=_['map'](db[_0xe680('0x29')]['rawAttributes'],function(_0x3b71cf){return{'name':_0x3b71cf['fieldName'],'type':_0x3b71cf[_0xe680('0x2a')][_0xe680('0x2b')]};});_0x1ed88b['model']=_[_0xe680('0x2c')](_[_0xe680('0x2d')](_0x8ebdab,_0xe680('0x26')),[_0xe680('0x26')]);_0x1ed88b[_0xe680('0x2e')]=_[_0xe680('0x2f')](_0x982b1a['query']);_0x1ed88b[_0xe680('0x30')]=_[_0xe680('0x31')](_0x1ed88b[_0xe680('0x32')],_0x1ed88b[_0xe680('0x2e')]);_0x504782['attributes']=_[_0xe680('0x31')](_0x1ed88b['model'],qs['fields'](_0x982b1a['query'][_0xe680('0x33')]));_0x504782[_0xe680('0x34')]=_0x504782[_0xe680('0x34')][_0xe680('0x35')]?_0x504782['attributes']:_0x1ed88b[_0xe680('0x32')];if(!_0x982b1a['query'][_0xe680('0x36')]('nolimit')){_0x504782[_0xe680('0x1b')]=qs[_0xe680('0x1b')](_0x982b1a['query'][_0xe680('0x1b')]);_0x504782[_0xe680('0x19')]=qs['offset'](_0x982b1a[_0xe680('0x2e')][_0xe680('0x19')]);}_0x504782[_0xe680('0x37')]=qs['sort'](_0x982b1a[_0xe680('0x2e')][_0xe680('0x38')]);_0x504782[_0xe680('0x39')]=qs[_0xe680('0x30')](_['pick'](_0x982b1a['query'],_0x1ed88b[_0xe680('0x30')]),_0x8ebdab);if(_0x982b1a['query'][_0xe680('0x3a')]){_0x504782[_0xe680('0x39')]=_[_0xe680('0x3b')](_0x504782[_0xe680('0x39')],{'$or':_[_0xe680('0x2d')](_0x8ebdab,function(_0x25ec85){if(_0x25ec85['type']!==_0xe680('0x3c')){var _0x3403fd={};_0x3403fd[_0x25ec85[_0xe680('0x26')]]={'$like':'%'+_0x982b1a['query'][_0xe680('0x3a')]+'%'};return _0x3403fd;}})});}_0x504782=_[_0xe680('0x3b')]({},_0x504782,_0x982b1a[_0xe680('0x3d')]);var _0x16591e={'where':_0x504782[_0xe680('0x39')]};return db[_0xe680('0x29')][_0xe680('0x1c')](_0x16591e)['then'](function(_0x2c5f12){_0x13a6a1[_0xe680('0x1c')]=_0x2c5f12;if(_0x982b1a['query']['includeAll']){_0x504782['include']=[{'all':!![]}];}return db[_0xe680('0x29')][_0xe680('0x3e')](_0x504782);})[_0xe680('0x24')](function(_0x4ea279){_0x13a6a1[_0xe680('0x3f')]=_0x4ea279;return _0x13a6a1;})[_0xe680('0x24')](respondWithFilteredResult(_0x30458b,_0x504782))[_0xe680('0x40')](handleError(_0x30458b,null));};exports[_0xe680('0x41')]=function(_0x37c0c4,_0x2415b3){var _0x35e8d4={'raw':!![],'where':{'id':_0x37c0c4[_0xe680('0x42')]['id']}},_0x59f45f={};_0x59f45f[_0xe680('0x32')]=_[_0xe680('0x2f')](db[_0xe680('0x29')]['rawAttributes']);_0x59f45f[_0xe680('0x2e')]=_[_0xe680('0x2f')](_0x37c0c4[_0xe680('0x2e')]);_0x59f45f['filters']=_[_0xe680('0x31')](_0x59f45f[_0xe680('0x32')],_0x59f45f[_0xe680('0x2e')]);_0x35e8d4[_0xe680('0x34')]=_[_0xe680('0x31')](_0x59f45f[_0xe680('0x32')],qs['fields'](_0x37c0c4[_0xe680('0x2e')][_0xe680('0x33')]));_0x35e8d4['attributes']=_0x35e8d4[_0xe680('0x34')][_0xe680('0x35')]?_0x35e8d4['attributes']:_0x59f45f['model'];if(_0x37c0c4[_0xe680('0x2e')][_0xe680('0x43')]){_0x35e8d4[_0xe680('0x44')]=[{'all':!![]}];}_0x35e8d4=_[_0xe680('0x3b')]({},_0x35e8d4,_0x37c0c4[_0xe680('0x3d')]);return db[_0xe680('0x29')][_0xe680('0x45')](_0x35e8d4)[_0xe680('0x24')](handleEntityNotFound(_0x2415b3,null))['then'](respondWithResult(_0x2415b3,null))[_0xe680('0x40')](handleError(_0x2415b3,null));};exports[_0xe680('0x46')]=function(_0x4ad3fd,_0x10a1e8){return db[_0xe680('0x29')][_0xe680('0x46')](_0x4ad3fd[_0xe680('0x47')],{})[_0xe680('0x24')](respondWithResult(_0x10a1e8,0xc9))[_0xe680('0x40')](handleError(_0x10a1e8,null));};exports[_0xe680('0x22')]=function(_0xc1f93d,_0x15c98c){if(_0xc1f93d[_0xe680('0x47')]['id']){delete _0xc1f93d['body']['id'];}return db[_0xe680('0x29')][_0xe680('0x45')]({'where':{'id':_0xc1f93d[_0xe680('0x42')]['id']}})[_0xe680('0x24')](handleEntityNotFound(_0x15c98c,null))[_0xe680('0x24')](saveUpdates(_0xc1f93d[_0xe680('0x47')],null))[_0xe680('0x24')](respondWithResult(_0x15c98c,null))[_0xe680('0x40')](handleError(_0x15c98c,null));};exports[_0xe680('0x23')]=function(_0x2f97d5,_0x450a6b){return db['VoiceMailMessage']['find']({'where':{'id':_0x2f97d5[_0xe680('0x42')]['id']}})[_0xe680('0x24')](handleEntityNotFound(_0x450a6b,null))[_0xe680('0x24')](removeEntity(_0x450a6b,null))[_0xe680('0x40')](handleError(_0x450a6b,null));};exports[_0xe680('0x48')]=function(_0x3261e6,_0x4f36d5,_0x55d81a){return db[_0xe680('0x29')][_0xe680('0x45')]({'where':{'id':_0x3261e6['params']['id']},'attributes':['id',_0xe680('0x49'),_0xe680('0x4a')]})[_0xe680('0x24')](handleEntityNotFound(_0x4f36d5,null))['then'](function(_0x574713){if(_0x574713){if(!_0x574713[_0xe680('0x49')]){throw new db['Sequelize'][(_0xe680('0x4b'))](_0xe680('0x4c'));}var _0x5bd006={'Content-Type':_0xe680('0x4d'),'Content-Disposition':_0xe680('0x4e')};if(_0x574713[_0xe680('0x4a')]){_0x5bd006[_0xe680('0x4f')]=_0xe680('0x50')+_0x574713[_0xe680('0x4a')]+_0xe680('0x51');}_0x4f36d5[_0xe680('0x1d')](_0x5bd006);return _0x4f36d5[_0xe680('0x28')](new Buffer(_0x574713[_0xe680('0x49')]));}})[_0xe680('0x40')](handleError(_0x4f36d5,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a8ba555..58a4144 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 _0xc86b=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x3f0486,_0xe58b52){var _0xb70e91=function(_0x4882ed){while(--_0x4882ed){_0x3f0486['push'](_0x3f0486['shift']());}};_0xb70e91(++_0xe58b52);}(_0xc86b,0x89));var _0xbc86=function(_0x424ef4,_0x330fa0){_0x424ef4=_0x424ef4-0x0;var _0x40cb6f=_0xc86b[_0x424ef4];return _0x40cb6f;};'use strict';var _=require(_0xbc86('0x0'));var util=require(_0xbc86('0x1'));var logger=require(_0xbc86('0x2'))(_0xbc86('0x3'));var moment=require(_0xbc86('0x4'));var BPromise=require(_0xbc86('0x5'));var rp=require(_0xbc86('0x6'));var fs=require('fs');var path=require(_0xbc86('0x7'));var rimraf=require(_0xbc86('0x8'));var config=require(_0xbc86('0x9'));var attributes=require(_0xbc86('0xa'));module['exports']=function(_0x4929af,_0x5091bd){return _0x4929af[_0xbc86('0xb')](_0xbc86('0xc'),attributes,{'tableName':_0xbc86('0xd'),'paranoid':![],'indexes':[{'name':_0xbc86('0xe'),'fields':[_0xbc86('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd8eb=['moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x4330b2,_0x3bd688){var _0x302fff=function(_0x553ab4){while(--_0x553ab4){_0x4330b2['push'](_0x4330b2['shift']());}};_0x302fff(++_0x3bd688);}(_0xd8eb,0x74));var _0xbd8e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var logger=require(_0xbd8e('0x2'))(_0xbd8e('0x3'));var moment=require(_0xbd8e('0x4'));var BPromise=require(_0xbd8e('0x5'));var rp=require(_0xbd8e('0x6'));var fs=require('fs');var path=require(_0xbd8e('0x7'));var rimraf=require(_0xbd8e('0x8'));var config=require('../../config/environment');var attributes=require(_0xbd8e('0x9'));module[_0xbd8e('0xa')]=function(_0x580cd0,_0xfccb19){return _0x580cd0[_0xbd8e('0xb')](_0xbd8e('0xc'),attributes,{'tableName':_0xbd8e('0xd'),'paranoid':![],'indexes':[{'name':_0xbd8e('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 817ef3f..09a9ecc 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 _0xb672=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb672,0xb3));var _0x2b67=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb672[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var moment=require(_0x2b67('0x2'));var BPromise=require(_0x2b67('0x3'));var rs=require(_0x2b67('0x4'));var fs=require('fs');var Redis=require(_0x2b67('0x5'));var db=require(_0x2b67('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b67('0x7'));var config=require('../../config/environment');var jayson=require(_0x2b67('0x8'));var client=jayson[_0x2b67('0x9')][_0x2b67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8d10,_0x4c14db,_0x18a7bb){return new BPromise(function(_0x23f7d5,_0x2d5f6e){return client[_0x2b67('0xb')](_0x2c8d10,_0x18a7bb)[_0x2b67('0xc')](function(_0x188095){logger[_0x2b67('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c14db,_0x2b67('0xe'));logger[_0x2b67('0xf')](_0x2b67('0x10'),_0x4c14db,_0x2b67('0xe'),JSON[_0x2b67('0x11')](_0x188095));if(_0x188095['error']){if(_0x188095[_0x2b67('0x12')][_0x2b67('0x13')]===0x1f4){logger[_0x2b67('0x12')](_0x2b67('0x14'),_0x4c14db,_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);return _0x2d5f6e(_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4c14db,_0x188095['error'][_0x2b67('0x15')]);return _0x23f7d5(_0x188095[_0x2b67('0x12')][_0x2b67('0x15')]);}else{logger[_0x2b67('0xd')](_0x2b67('0x14'),_0x4c14db,'request\x20sent');_0x23f7d5(_0x188095['result'][_0x2b67('0x15')]);}})[_0x2b67('0x16')](function(_0x2332cf){logger[_0x2b67('0x12')](_0x2b67('0x14'),_0x4c14db,_0x2332cf);_0x2d5f6e(_0x2332cf);});});} \ No newline at end of file +var _0x2064=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5071da,_0x23e5e1){var _0x4b88df=function(_0x318695){while(--_0x318695){_0x5071da['push'](_0x5071da['shift']());}};_0x4b88df(++_0x23e5e1);}(_0x2064,0x135));var _0x4206=function(_0x4d1324,_0x3f7b0d){_0x4d1324=_0x4d1324-0x0;var _0x5e6bf0=_0x2064[_0x4d1324];return _0x5e6bf0;};'use strict';var _=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var moment=require(_0x4206('0x2'));var BPromise=require(_0x4206('0x3'));var rs=require(_0x4206('0x4'));var fs=require('fs');var Redis=require(_0x4206('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4206('0x6'));var logger=require(_0x4206('0x7'))(_0x4206('0x8'));var config=require(_0x4206('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4206('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f241e,_0x2b0c24,_0xe0fd45){return new BPromise(function(_0x4a73b8,_0x401440){return client[_0x4206('0xb')](_0x2f241e,_0xe0fd45)[_0x4206('0xc')](function(_0x51a5e1){logger[_0x4206('0xd')](_0x4206('0xe'),_0x2b0c24,'request\x20sent');logger['debug'](_0x4206('0xf'),_0x2b0c24,_0x4206('0x10'),JSON['stringify'](_0x51a5e1));if(_0x51a5e1[_0x4206('0x11')]){if(_0x51a5e1[_0x4206('0x11')][_0x4206('0x12')]===0x1f4){logger['error'](_0x4206('0xe'),_0x2b0c24,_0x51a5e1['error']['message']);return _0x401440(_0x51a5e1['error']['message']);}logger[_0x4206('0x11')](_0x4206('0xe'),_0x2b0c24,_0x51a5e1[_0x4206('0x11')][_0x4206('0x13')]);return _0x4a73b8(_0x51a5e1[_0x4206('0x11')][_0x4206('0x13')]);}else{logger[_0x4206('0xd')](_0x4206('0xe'),_0x2b0c24,'request\x20sent');_0x4a73b8(_0x51a5e1['result'][_0x4206('0x13')]);}})[_0x4206('0x14')](function(_0x5713af){logger[_0x4206('0x11')](_0x4206('0xe'),_0x2b0c24,_0x5713af);_0x401440(_0x5713af);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 31f6b08..e90cf35 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 _0x1b4d=['addSound','put','update','delete','/:id/sounds/:id2','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create'];(function(_0x39f5bf,_0x565f0f){var _0x4c964f=function(_0x19446b){while(--_0x19446b){_0x39f5bf['push'](_0x39f5bf['shift']());}};_0x4c964f(++_0x565f0f);}(_0x1b4d,0x10d));var _0xd1b4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1b4d[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xd1b4('0x0'));var util=require('util');var path=require(_0xd1b4('0x1'));var timeout=require(_0xd1b4('0x2'));var express=require(_0xd1b4('0x3'));var router=express[_0xd1b4('0x4')]();var fs_extra=require(_0xd1b4('0x5'));var auth=require(_0xd1b4('0x6'));var interaction=require(_0xd1b4('0x7'));var config=require(_0xd1b4('0x8'));var controller=require(_0xd1b4('0x9'));router[_0xd1b4('0xa')]('/',auth[_0xd1b4('0xb')](),controller['index']);router[_0xd1b4('0xa')](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller['show']);router[_0xd1b4('0xa')](_0xd1b4('0xd'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0xe')]);router[_0xd1b4('0xf')]('/',auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x10')]);router[_0xd1b4('0xf')](_0xd1b4('0xd'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x11')]);router[_0xd1b4('0x12')](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller[_0xd1b4('0x13')]);router['delete'](_0xd1b4('0xc'),auth[_0xd1b4('0xb')](),controller['destroy']);router[_0xd1b4('0x14')](_0xd1b4('0x15'),auth[_0xd1b4('0xb')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x482e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sounds','post','create','addSound','put','/:id','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x353643,_0x568495){var _0x394b32=function(_0x3924ae){while(--_0x3924ae){_0x353643['push'](_0x353643['shift']());}};_0x394b32(++_0x568495);}(_0x482e,0x1d5));var _0xe482=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x482e[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0xe482('0x0'));var util=require(_0xe482('0x1'));var path=require(_0xe482('0x2'));var timeout=require(_0xe482('0x3'));var express=require(_0xe482('0x4'));var router=express[_0xe482('0x5')]();var fs_extra=require(_0xe482('0x6'));var auth=require(_0xe482('0x7'));var interaction=require(_0xe482('0x8'));var config=require(_0xe482('0x9'));var controller=require('./voiceMusicOnHold.controller');router[_0xe482('0xa')]('/',auth[_0xe482('0xb')](),controller[_0xe482('0xc')]);router['get']('/:id',auth[_0xe482('0xb')](),controller[_0xe482('0xd')]);router[_0xe482('0xa')](_0xe482('0xe'),auth[_0xe482('0xb')](),controller['getSounds']);router[_0xe482('0xf')]('/',auth['isAuthenticated'](),controller[_0xe482('0x10')]);router['post'](_0xe482('0xe'),auth[_0xe482('0xb')](),controller[_0xe482('0x11')]);router[_0xe482('0x12')](_0xe482('0x13'),auth[_0xe482('0xb')](),controller['update']);router['delete'](_0xe482('0x13'),auth['isAuthenticated'](),controller[_0xe482('0x14')]);router[_0xe482('0x15')](_0xe482('0x16'),auth[_0xe482('0xb')](),controller[_0xe482('0x17')]);module[_0xe482('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index af05b7c..1724b5b 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 _0x166c=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','name'];(function(_0x25cf1e,_0x4067f3){var _0x584129=function(_0x3cf8d4){while(--_0x3cf8d4){_0x25cf1e['push'](_0x25cf1e['shift']());}};_0x584129(++_0x4067f3);}(_0x166c,0x17d));var _0xc166=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x166c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc166('0x0'));module[_0xc166('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc166('0x2')},'mode':{'type':Sequelize['ENUM'](_0xc166('0x3'),_0xc166('0x4'),_0xc166('0x5'),_0xc166('0x6'),_0xc166('0x7'),_0xc166('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc166('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xc166('0xa')},'defaultEntry':{'type':Sequelize[_0xc166('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f36=['files','quietmp3nb','quietmp3','mp3','STRING','alpha','BOOLEAN','exports','name','ENUM','custom'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9f36,0xe3));var _0x69f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9f36[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x69f3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x69f3('0x1')},'mode':{'type':Sequelize[_0x69f3('0x2')](_0x69f3('0x3'),_0x69f3('0x4'),'mp3nb',_0x69f3('0x5'),_0x69f3('0x6'),_0x69f3('0x7')),'allowNull':!![],'defaultValue':_0x69f3('0x4')},'directory':{'type':Sequelize[_0x69f3('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x69f3('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x69f3('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x69f3('0x8')],'allowNull':!![],'defaultValue':_0x69f3('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x69f3('0xa')],'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 90f2da2..6780758 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 _0xa621=['show','include','find','update','body','params','create','sequelize','transaction','mode','directory','join','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','destroy','unlinkSync','rmdirSync','ValidationError','message','addSound','findOne','save_name','converted_format','root','%s.%s','basename','extname','symlinkSync','Sequelize','removeSound','id2','createdAt','format','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','get','MusicOnHolds','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch'];(function(_0x5db1ae,_0x4dc6cd){var _0x11ad60=function(_0x372ced){while(--_0x372ced){_0x5db1ae['push'](_0x5db1ae['shift']());}};_0x11ad60(++_0x4dc6cd);}(_0xa621,0x1cb));var _0x1a62=function(_0x1b354e,_0x562b4b){_0x1b354e=_0x1b354e-0x0;var _0x4b99db=_0xa621[_0x1b354e];return _0x4b99db;};'use strict';var emlformat=require(_0x1a62('0x0'));var rimraf=require(_0x1a62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a62('0x2'));var rp=require(_0x1a62('0x3'));var moment=require(_0x1a62('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a62('0x5'));var util=require(_0x1a62('0x6'));var path=require(_0x1a62('0x7'));var sox=require('sox');var csv=require(_0x1a62('0x8'));var ejs=require(_0x1a62('0x9'));var fs=require('fs');var fs_extra=require(_0x1a62('0xa'));var _=require(_0x1a62('0xb'));var squel=require(_0x1a62('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a62('0xd'));var deskjs=require(_0x1a62('0xe'));var toCsv=require(_0x1a62('0x8'));var querystring=require(_0x1a62('0xf'));var Papa=require(_0x1a62('0x10'));var Redis=require(_0x1a62('0x11'));var authService=require(_0x1a62('0x12'));var qs=require(_0x1a62('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1a62('0x14'));var utils=require('../../config/utils');var config=require(_0x1a62('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e244a,_0x4eef12){_0x4eef12=_0x4eef12||0xcc;return function(_0x8030af){if(_0x8030af){return _0x2e244a[_0x1a62('0x16')](_0x4eef12);}return _0x2e244a[_0x1a62('0x17')](_0x4eef12)[_0x1a62('0x18')]();};}function respondWithResult(_0x353e93,_0xfc239b){_0xfc239b=_0xfc239b||0xc8;return function(_0x39a3f9){if(_0x39a3f9){return _0x353e93[_0x1a62('0x17')](_0xfc239b)[_0x1a62('0x19')](_0x39a3f9);}};}function respondWithFilteredResult(_0xce1555,_0xb89126){return function(_0x3b3dab){if(_0x3b3dab){var _0x545b9a=typeof _0xb89126[_0x1a62('0x1a')]==='undefined'&&typeof _0xb89126[_0x1a62('0x1b')]==='undefined';var _0xeafecc=_0x3b3dab[_0x1a62('0x1c')];var _0x52cd44=_0x545b9a?0x0:_0xb89126[_0x1a62('0x1a')];var _0x3d66bb=_0x545b9a?_0x3b3dab[_0x1a62('0x1c')]:_0xb89126['offset']+_0xb89126[_0x1a62('0x1b')];var _0x4042e6;if(_0x3d66bb>=_0xeafecc){_0x3d66bb=_0xeafecc;_0x4042e6=0xc8;}else{_0x4042e6=0xce;}_0xce1555[_0x1a62('0x17')](_0x4042e6);return _0xce1555[_0x1a62('0x1d')](_0x1a62('0x1e'),_0x52cd44+'-'+_0x3d66bb+'/'+_0xeafecc)[_0x1a62('0x19')](_0x3b3dab);}return null;};}function patchUpdates(_0x4c1a41){return function(_0x398457){try{jsonpatch[_0x1a62('0x1f')](_0x398457,_0x4c1a41,!![]);}catch(_0x1297de){return BPromise['reject'](_0x1297de);}return _0x398457[_0x1a62('0x20')]();};}function saveUpdates(_0xd9484f,_0x3a9eee){return function(_0x1aeedb){if(_0x1aeedb){return _0x1aeedb['update'](_0xd9484f)['then'](function(_0x1dab5b){return _0x1dab5b;});}return null;};}function removeEntity(_0x15ff36,_0x32507d){return function(_0x192f10){if(_0x192f10){return _0x192f10['destroy']()[_0x1a62('0x21')](function(){var _0x20c87c=_0x192f10[_0x1a62('0x22')]({'plain':!![]});var _0x4f83ce=_0x1a62('0x23');return db[_0x1a62('0x24')]['destroy']({'where':{'type':_0x4f83ce,'resourceId':_0x20c87c['id']}})[_0x1a62('0x21')](function(){return _0x192f10;});})[_0x1a62('0x21')](function(){_0x15ff36[_0x1a62('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cab12,_0x5ca2d1){return function(_0x42b3eb){if(!_0x42b3eb){_0x1cab12['sendStatus'](0x194);}return _0x42b3eb;};}function handleError(_0x21eae4,_0x418bff){_0x418bff=_0x418bff||0x1f4;return function(_0x4a2643){logger[_0x1a62('0x25')](_0x4a2643[_0x1a62('0x26')]);if(_0x4a2643['name']){delete _0x4a2643[_0x1a62('0x27')];}_0x21eae4[_0x1a62('0x17')](_0x418bff)['send'](_0x4a2643);};}exports[_0x1a62('0x28')]=function(_0x12a2ca,_0x3f3ee4){var _0x2806f9={},_0xffbc1d={},_0x407f4d={'count':0x0,'rows':[]};var _0x35fb35=_[_0x1a62('0x29')](db[_0x1a62('0x2a')][_0x1a62('0x2b')],function(_0xc5f6ec){return{'name':_0xc5f6ec[_0x1a62('0x2c')],'type':_0xc5f6ec[_0x1a62('0x2d')][_0x1a62('0x2e')]};});_0xffbc1d[_0x1a62('0x2f')]=_['map'](_0x35fb35,_0x1a62('0x27'));_0xffbc1d[_0x1a62('0x30')]=_[_0x1a62('0x31')](_0x12a2ca[_0x1a62('0x30')]);_0xffbc1d[_0x1a62('0x32')]=_[_0x1a62('0x33')](_0xffbc1d[_0x1a62('0x2f')],_0xffbc1d[_0x1a62('0x30')]);_0x2806f9[_0x1a62('0x34')]=_[_0x1a62('0x33')](_0xffbc1d[_0x1a62('0x2f')],qs['fields'](_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x35')]));_0x2806f9['attributes']=_0x2806f9[_0x1a62('0x34')][_0x1a62('0x36')]?_0x2806f9[_0x1a62('0x34')]:_0xffbc1d['model'];if(!_0x12a2ca[_0x1a62('0x30')]['hasOwnProperty'](_0x1a62('0x37'))){_0x2806f9[_0x1a62('0x1b')]=qs[_0x1a62('0x1b')](_0x12a2ca[_0x1a62('0x30')]['limit']);_0x2806f9[_0x1a62('0x1a')]=qs[_0x1a62('0x1a')](_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x1a')]);}_0x2806f9[_0x1a62('0x38')]=qs['sort'](_0x12a2ca['query'][_0x1a62('0x39')]);delete _0x12a2ca[_0x1a62('0x30')]['sort'];_0x2806f9[_0x1a62('0x3a')]=qs[_0x1a62('0x32')](_[_0x1a62('0x3b')](_0x12a2ca[_0x1a62('0x30')],_0xffbc1d[_0x1a62('0x32')]),_0x35fb35);if(_0x12a2ca[_0x1a62('0x30')]['filter']){_0x2806f9[_0x1a62('0x3a')]=_['merge'](_0x2806f9['where'],{'$or':_[_0x1a62('0x29')](_0x35fb35,function(_0x235368){if(_0x235368['type']!=='VIRTUAL'){var _0x4152c6={};_0x4152c6[_0x235368[_0x1a62('0x27')]]={'$like':'%'+_0x12a2ca['query'][_0x1a62('0x3c')]+'%'};return _0x4152c6;}})});}_0x2806f9=_[_0x1a62('0x3d')]({},_0x2806f9,_0x12a2ca[_0x1a62('0x3e')]);var _0x32854e={'where':_0x2806f9[_0x1a62('0x3a')]};return db[_0x1a62('0x2a')][_0x1a62('0x1c')](_0x32854e)['then'](function(_0x444a1a){_0x407f4d['count']=_0x444a1a;if(_0x12a2ca[_0x1a62('0x30')][_0x1a62('0x3f')]){_0x2806f9['include']=[{'all':!![]}];}return db[_0x1a62('0x2a')]['findAll'](_0x2806f9);})[_0x1a62('0x21')](function(_0xff9e9){_0x407f4d[_0x1a62('0x40')]=_0xff9e9;return _0x407f4d;})[_0x1a62('0x21')](respondWithFilteredResult(_0x3f3ee4,_0x2806f9))[_0x1a62('0x41')](handleError(_0x3f3ee4,null));};exports[_0x1a62('0x42')]=function(_0x4bcbed,_0x3bc330){var _0x4bdcec={'raw':![],'where':{'id':_0x4bcbed['params']['id']}},_0x350949={};_0x350949[_0x1a62('0x2f')]=_[_0x1a62('0x31')](db['VoiceMusicOnHold'][_0x1a62('0x2b')]);_0x350949['query']=_[_0x1a62('0x31')](_0x4bcbed[_0x1a62('0x30')]);_0x350949[_0x1a62('0x32')]=_[_0x1a62('0x33')](_0x350949[_0x1a62('0x2f')],_0x350949[_0x1a62('0x30')]);_0x4bdcec['attributes']=_['intersection'](_0x350949[_0x1a62('0x2f')],qs[_0x1a62('0x35')](_0x4bcbed[_0x1a62('0x30')][_0x1a62('0x35')]));_0x4bdcec[_0x1a62('0x34')]=_0x4bdcec[_0x1a62('0x34')][_0x1a62('0x36')]?_0x4bdcec[_0x1a62('0x34')]:_0x350949[_0x1a62('0x2f')];if(_0x4bcbed[_0x1a62('0x30')][_0x1a62('0x3f')]){_0x4bdcec[_0x1a62('0x43')]=[{'all':!![]}];}_0x4bdcec=_[_0x1a62('0x3d')]({},_0x4bdcec,_0x4bcbed[_0x1a62('0x3e')]);return db[_0x1a62('0x2a')][_0x1a62('0x44')](_0x4bdcec)['then'](handleEntityNotFound(_0x3bc330,null))[_0x1a62('0x21')](respondWithResult(_0x3bc330,null))[_0x1a62('0x41')](handleError(_0x3bc330,null));};exports[_0x1a62('0x45')]=function(_0x782a27,_0x2da2ea){if(_0x782a27[_0x1a62('0x46')]['id']){delete _0x782a27[_0x1a62('0x46')]['id'];}return db['VoiceMusicOnHold'][_0x1a62('0x44')]({'where':{'id':_0x782a27[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x2da2ea,null))['then'](saveUpdates(_0x782a27['body'],null))[_0x1a62('0x21')](respondWithResult(_0x2da2ea,null))[_0x1a62('0x41')](handleError(_0x2da2ea,null));};exports[_0x1a62('0x48')]=function(_0x179652,_0x16038a,_0x596ba5){return db[_0x1a62('0x49')][_0x1a62('0x4a')](function(_0x60b10b){if(_0x179652[_0x1a62('0x46')][_0x1a62('0x4b')]==='files'){_0x179652['body'][_0x1a62('0x4c')]=path[_0x1a62('0x4d')](config['root'],_0x1a62('0x4e'),_0x179652[_0x1a62('0x46')][_0x1a62('0x27')]);}return db[_0x1a62('0x2a')]['create'](_0x179652[_0x1a62('0x46')],{'transaction':_0x60b10b})['then'](function(_0xd8c079){if(_0x179652[_0x1a62('0x46')][_0x1a62('0x4b')]==='files'){fs['mkdirSync'](_0xd8c079[_0x1a62('0x4c')],parseInt(_0x1a62('0x4f'),0x8));}var _0x45ef0d=_0x179652[_0x1a62('0x50')][_0x1a62('0x22')]({'plain':!![]});if(!_0x45ef0d)throw new Error(_0x1a62('0x51'));if(_0x45ef0d['role']==='user'){var _0x55e396=_0xd8c079[_0x1a62('0x22')]({'plain':!![]});return db[_0x1a62('0x52')][_0x1a62('0x44')]({'where':{'name':'MusicOnHolds','userProfileId':_0x45ef0d[_0x1a62('0x53')]},'raw':!![]})[_0x1a62('0x21')](function(_0x8de542){if(_0x8de542&&_0x8de542[_0x1a62('0x54')]===0x0){return db[_0x1a62('0x24')][_0x1a62('0x48')]({'name':_0x55e396['name'],'resourceId':_0x55e396['id'],'type':_0x8de542[_0x1a62('0x27')],'sectionId':_0x8de542['id']},{})['then'](function(){return _0xd8c079;});}else{return _0xd8c079;}})[_0x1a62('0x41')](function(_0x2ef527){logger[_0x1a62('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ef527);});}return _0xd8c079;});})[_0x1a62('0x21')](respondWithResult(_0x16038a,0xc9))[_0x1a62('0x41')](handleError(_0x16038a,null));};exports['destroy']=function(_0x55862e,_0x2b558d,_0x5a38c7){var _0x4f079b;return db[_0x1a62('0x2a')][_0x1a62('0x44')]({'where':{'id':_0x55862e[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](function(_0x1aebf0){if(_0x1aebf0){return db['sequelize']['transaction'](function(_0x3f8b2a){return _0x1aebf0[_0x1a62('0x55')]({'transaction':_0x3f8b2a,'raw':!![]})[_0x1a62('0x21')](function(_0x24034d){if(_0x24034d[_0x1a62('0x4c')]){fs['readdirSync'](_0x24034d[_0x1a62('0x4c')])['forEach'](function(_0x1fc2fc){fs[_0x1a62('0x56')](path[_0x1a62('0x4d')](_0x24034d['directory'],_0x1fc2fc));});fs[_0x1a62('0x57')](_0x24034d[_0x1a62('0x4c')]);}return _0x24034d;});})['catch'](function(_0x3319bf){throw new db['Sequelize'][(_0x1a62('0x58'))](_0x3319bf[_0x1a62('0x59')]);});}})[_0x1a62('0x21')](handleEntityNotFound(_0x2b558d,null))[_0x1a62('0x21')](removeEntity(_0x2b558d,null))['catch'](handleError(_0x2b558d,null));};exports[_0x1a62('0x5a')]=function(_0x5a3539,_0xbdadff,_0x35dfb9){return db[_0x1a62('0x49')][_0x1a62('0x4a')](function(_0x5137fa){var _0x55460e;return db[_0x1a62('0x2a')][_0x1a62('0x44')]({'where':{'id':_0x5a3539[_0x1a62('0x47')]['id']}})['then'](function(_0x440304){if(_0x440304){_0x55460e=_0x440304;return _0x440304['addSound'](_0x5a3539[_0x1a62('0x46')]['id'],{'transaction':_0x5137fa});}})[_0x1a62('0x21')](function(_0x539f7f){if(_0x539f7f){return db['Sound'][_0x1a62('0x5b')]({'where':{'id':_0x5a3539[_0x1a62('0x46')]['id']},'attributes':['id','name',_0x1a62('0x5c'),_0x1a62('0x5d'),'createdAt'],'raw':!![]});}})[_0x1a62('0x21')](function(_0x8f0db5){if(_0x8f0db5){var _0x110d17=path[_0x1a62('0x4d')](config[_0x1a62('0x5e')],'server/files/sounds/converted',util['format'](_0x1a62('0x5f'),path[_0x1a62('0x60')](_0x8f0db5['save_name'],path[_0x1a62('0x61')](_0x8f0db5['save_name'])),_0x8f0db5['converted_format']));var _0x46d6b6=path[_0x1a62('0x4d')](config[_0x1a62('0x5e')],_0x1a62('0x4e'),_0x55460e[_0x1a62('0x27')],util['format'](_0x1a62('0x5f'),_0x8f0db5[_0x1a62('0x27')],_0x8f0db5[_0x1a62('0x5d')]));fs[_0x1a62('0x62')](_0x110d17,_0x46d6b6);return _0x8f0db5;}})[_0x1a62('0x41')](function(_0x53010a){throw new db[(_0x1a62('0x63'))]['ValidationError'](_0x53010a[_0x1a62('0x59')]);});})[_0x1a62('0x21')](handleEntityNotFound(_0xbdadff,null))[_0x1a62('0x21')](respondWithResult(_0xbdadff,0xc9))[_0x1a62('0x41')](handleError(_0xbdadff,null));};exports[_0x1a62('0x64')]=function(_0x415c48,_0x996f7c,_0x5f3d42){return db[_0x1a62('0x49')]['transaction'](function(_0x517eef){var _0x1d21e1;return db[_0x1a62('0x2a')][_0x1a62('0x5b')]({'where':{'id':_0x415c48['params']['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x996f7c,null))[_0x1a62('0x21')](function(_0x5842d7){if(_0x5842d7){_0x1d21e1=_0x5842d7;return _0x5842d7['removeSound'](_0x415c48[_0x1a62('0x47')][_0x1a62('0x65')]);}})['then'](function(_0x28ab10){if(_0x28ab10){return db['Sound'][_0x1a62('0x5b')]({'where':{'id':_0x415c48['params'][_0x1a62('0x65')]},'attributes':['id',_0x1a62('0x27'),'save_name','converted_format',_0x1a62('0x66')],'raw':!![]});}})[_0x1a62('0x21')](function(_0x29b75d){if(_0x29b75d){fs[_0x1a62('0x56')](path[_0x1a62('0x4d')](_0x1d21e1[_0x1a62('0x4c')],util[_0x1a62('0x67')](_0x1a62('0x5f'),_0x29b75d[_0x1a62('0x27')],_0x29b75d[_0x1a62('0x5d')])));return _0x29b75d;}})[_0x1a62('0x41')](function(_0x33c295){throw new db[(_0x1a62('0x63'))][(_0x1a62('0x58'))](_0x33c295[_0x1a62('0x59')]);});})[_0x1a62('0x21')](handleEntityNotFound(_0x996f7c,null))[_0x1a62('0x21')](respondWithStatusCode(_0x996f7c,0xcc))['catch'](handleError(_0x996f7c,null));};exports[_0x1a62('0x68')]=function(_0x2db10a,_0x28a3ba,_0x203766){var _0x1d7d0a={};var _0x305571={};var _0x2b31e5;var _0x4f529e;return db[_0x1a62('0x2a')][_0x1a62('0x5b')]({'where':{'id':_0x2db10a[_0x1a62('0x47')]['id']}})[_0x1a62('0x21')](handleEntityNotFound(_0x28a3ba,null))['then'](function(_0x3500ce){if(_0x3500ce){_0x2b31e5=_0x3500ce;_0x305571['model']=_['keys'](db['Sound'][_0x1a62('0x2b')]);_0x305571[_0x1a62('0x30')]=_['keys'](_0x2db10a[_0x1a62('0x30')]);_0x305571['filters']=_[_0x1a62('0x33')](_0x305571[_0x1a62('0x2f')],_0x305571['query']);_0x1d7d0a['attributes']=_[_0x1a62('0x33')](_0x305571[_0x1a62('0x2f')],qs[_0x1a62('0x35')](_0x2db10a[_0x1a62('0x30')][_0x1a62('0x35')]));_0x1d7d0a[_0x1a62('0x34')]=_0x1d7d0a[_0x1a62('0x34')][_0x1a62('0x36')]?_0x1d7d0a[_0x1a62('0x34')]:_0x305571['model'];_0x1d7d0a['order']=qs[_0x1a62('0x39')](_0x2db10a['query']['sort']);_0x1d7d0a[_0x1a62('0x3a')]=qs['filters'](_['pick'](_0x2db10a['query'],_0x305571[_0x1a62('0x32')]));if(_0x2db10a['query'][_0x1a62('0x3c')]){_0x1d7d0a[_0x1a62('0x3a')]=_[_0x1a62('0x3d')](_0x1d7d0a[_0x1a62('0x3a')],{'$or':_[_0x1a62('0x29')](_0x1d7d0a[_0x1a62('0x34')],function(_0x1777d3){var _0x545222={};_0x545222[_0x1777d3]={'$like':'%'+_0x2db10a[_0x1a62('0x30')][_0x1a62('0x3c')]+'%'};return _0x545222;})});}_0x1d7d0a=_[_0x1a62('0x3d')]({},_0x1d7d0a,_0x2db10a[_0x1a62('0x3e')]);return _0x2b31e5[_0x1a62('0x68')](_0x1d7d0a);}})[_0x1a62('0x21')](function(_0x5a4fd9){if(_0x5a4fd9){_0x4f529e=_0x5a4fd9[_0x1a62('0x36')];if(!_0x2db10a[_0x1a62('0x30')]['hasOwnProperty'](_0x1a62('0x37'))){_0x1d7d0a[_0x1a62('0x1b')]=qs[_0x1a62('0x1b')](_0x2db10a[_0x1a62('0x30')]['limit']);_0x1d7d0a[_0x1a62('0x1a')]=qs[_0x1a62('0x1a')](_0x2db10a['query'][_0x1a62('0x1a')]);}return _0x2b31e5['getSounds'](_0x1d7d0a);}})[_0x1a62('0x21')](function(_0x1a0283){if(_0x1a0283){return _0x1a0283?{'count':_0x4f529e,'rows':_0x1a0283}:null;}})[_0x1a62('0x21')](respondWithResult(_0x28a3ba,null))['catch'](handleError(_0x28a3ba,null));}; \ No newline at end of file +var _0xed14=['addSound','Sound','findOne','save_name','createdAt','join','server/files/sounds/converted','basename','converted_format','format','%s.%s','symlinkSync','message','removeSound','id2','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','update','destroy','get','MusicOnHolds','UserProfileResource','then','end','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','merge','catch','body','find','sequelize','transaction','mode','files','directory','root','server/files/moh','create','0777','user','role','UserProfileSection','error','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError'];(function(_0x4dc679,_0x4671b4){var _0x20f04a=function(_0x278fa8){while(--_0x278fa8){_0x4dc679['push'](_0x4dc679['shift']());}};_0x20f04a(++_0x4671b4);}(_0xed14,0xed));var _0x4ed1=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xed14[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x4ed1('0x0'));var rimraf=require(_0x4ed1('0x1'));var zipdir=require(_0x4ed1('0x2'));var jsonpatch=require(_0x4ed1('0x3'));var rp=require(_0x4ed1('0x4'));var moment=require(_0x4ed1('0x5'));var BPromise=require(_0x4ed1('0x6'));var Mustache=require(_0x4ed1('0x7'));var util=require('util');var path=require(_0x4ed1('0x8'));var sox=require(_0x4ed1('0x9'));var csv=require('to-csv');var ejs=require(_0x4ed1('0xa'));var fs=require('fs');var fs_extra=require(_0x4ed1('0xb'));var _=require(_0x4ed1('0xc'));var squel=require(_0x4ed1('0xd'));var crypto=require(_0x4ed1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4ed1('0xf'));var toCsv=require(_0x4ed1('0x10'));var querystring=require(_0x4ed1('0x11'));var Papa=require('papaparse');var Redis=require(_0x4ed1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ed1('0x13'));var logger=require(_0x4ed1('0x14'))(_0x4ed1('0x15'));var utils=require(_0x4ed1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4ed1('0x17'));var db=require(_0x4ed1('0x18'))['db'];function respondWithStatusCode(_0x318ee8,_0x2d5c46){_0x2d5c46=_0x2d5c46||0xcc;return function(_0x2ec92e){if(_0x2ec92e){return _0x318ee8[_0x4ed1('0x19')](_0x2d5c46);}return _0x318ee8['status'](_0x2d5c46)['end']();};}function respondWithResult(_0x19b0ba,_0x54b307){_0x54b307=_0x54b307||0xc8;return function(_0x5821ff){if(_0x5821ff){return _0x19b0ba[_0x4ed1('0x1a')](_0x54b307)[_0x4ed1('0x1b')](_0x5821ff);}};}function respondWithFilteredResult(_0x1aafda,_0x5e140a){return function(_0x289546){if(_0x289546){var _0x5ac12a=typeof _0x5e140a['offset']===_0x4ed1('0x1c')&&typeof _0x5e140a['limit']==='undefined';var _0x4ab9c4=_0x289546[_0x4ed1('0x1d')];var _0x4b2031=_0x5ac12a?0x0:_0x5e140a[_0x4ed1('0x1e')];var _0x297928=_0x5ac12a?_0x289546[_0x4ed1('0x1d')]:_0x5e140a[_0x4ed1('0x1e')]+_0x5e140a[_0x4ed1('0x1f')];var _0x55d1df;if(_0x297928>=_0x4ab9c4){_0x297928=_0x4ab9c4;_0x55d1df=0xc8;}else{_0x55d1df=0xce;}_0x1aafda[_0x4ed1('0x1a')](_0x55d1df);return _0x1aafda[_0x4ed1('0x20')](_0x4ed1('0x21'),_0x4b2031+'-'+_0x297928+'/'+_0x4ab9c4)[_0x4ed1('0x1b')](_0x289546);}return null;};}function patchUpdates(_0xfcd77){return function(_0xf9ff5a){try{jsonpatch['apply'](_0xf9ff5a,_0xfcd77,!![]);}catch(_0x438aae){return BPromise[_0x4ed1('0x22')](_0x438aae);}return _0xf9ff5a['save']();};}function saveUpdates(_0x13392c,_0x231241){return function(_0x3c6eaf){if(_0x3c6eaf){return _0x3c6eaf[_0x4ed1('0x23')](_0x13392c)['then'](function(_0x26bb2d){return _0x26bb2d;});}return null;};}function removeEntity(_0xe0771b,_0x2a4c44){return function(_0x1fad5a){if(_0x1fad5a){return _0x1fad5a[_0x4ed1('0x24')]()['then'](function(){var _0x2f42a3=_0x1fad5a[_0x4ed1('0x25')]({'plain':!![]});var _0x3220a4=_0x4ed1('0x26');return db[_0x4ed1('0x27')]['destroy']({'where':{'type':_0x3220a4,'resourceId':_0x2f42a3['id']}})[_0x4ed1('0x28')](function(){return _0x1fad5a;});})[_0x4ed1('0x28')](function(){_0xe0771b[_0x4ed1('0x1a')](0xcc)[_0x4ed1('0x29')]();});}};}function handleEntityNotFound(_0x1b7cc6,_0x80c0eb){return function(_0x424c1d){if(!_0x424c1d){_0x1b7cc6['sendStatus'](0x194);}return _0x424c1d;};}function handleError(_0x531132,_0x164f60){_0x164f60=_0x164f60||0x1f4;return function(_0x4a745a){logger['error'](_0x4a745a[_0x4ed1('0x2a')]);if(_0x4a745a[_0x4ed1('0x2b')]){delete _0x4a745a[_0x4ed1('0x2b')];}_0x531132[_0x4ed1('0x1a')](_0x164f60)[_0x4ed1('0x2c')](_0x4a745a);};}exports['index']=function(_0x4f2140,_0x249bc6){var _0x159307={},_0x4ccff1={},_0x3c69b2={'count':0x0,'rows':[]};var _0x50bf28=_[_0x4ed1('0x2d')](db[_0x4ed1('0x2e')][_0x4ed1('0x2f')],function(_0x35a3c4){return{'name':_0x35a3c4['fieldName'],'type':_0x35a3c4[_0x4ed1('0x30')][_0x4ed1('0x31')]};});_0x4ccff1[_0x4ed1('0x32')]=_['map'](_0x50bf28,_0x4ed1('0x2b'));_0x4ccff1[_0x4ed1('0x33')]=_[_0x4ed1('0x34')](_0x4f2140[_0x4ed1('0x33')]);_0x4ccff1[_0x4ed1('0x35')]=_[_0x4ed1('0x36')](_0x4ccff1[_0x4ed1('0x32')],_0x4ccff1[_0x4ed1('0x33')]);_0x159307[_0x4ed1('0x37')]=_['intersection'](_0x4ccff1[_0x4ed1('0x32')],qs[_0x4ed1('0x38')](_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x38')]));_0x159307[_0x4ed1('0x37')]=_0x159307[_0x4ed1('0x37')]['length']?_0x159307['attributes']:_0x4ccff1['model'];if(!_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x39')](_0x4ed1('0x3a'))){_0x159307[_0x4ed1('0x1f')]=qs['limit'](_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x1f')]);_0x159307['offset']=qs[_0x4ed1('0x1e')](_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x1e')]);}_0x159307['order']=qs['sort'](_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x3b')]);delete _0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x3b')];_0x159307['where']=qs[_0x4ed1('0x35')](_[_0x4ed1('0x3c')](_0x4f2140[_0x4ed1('0x33')],_0x4ccff1[_0x4ed1('0x35')]),_0x50bf28);if(_0x4f2140['query']['filter']){_0x159307[_0x4ed1('0x3d')]=_['merge'](_0x159307[_0x4ed1('0x3d')],{'$or':_[_0x4ed1('0x2d')](_0x50bf28,function(_0x2f7d3f){if(_0x2f7d3f['type']!==_0x4ed1('0x3e')){var _0x1908f6={};_0x1908f6[_0x2f7d3f[_0x4ed1('0x2b')]]={'$like':'%'+_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x3f')]+'%'};return _0x1908f6;}})});}_0x159307=_['merge']({},_0x159307,_0x4f2140[_0x4ed1('0x40')]);var _0x386edc={'where':_0x159307['where']};return db[_0x4ed1('0x2e')][_0x4ed1('0x1d')](_0x386edc)[_0x4ed1('0x28')](function(_0x21970d){_0x3c69b2[_0x4ed1('0x1d')]=_0x21970d;if(_0x4f2140[_0x4ed1('0x33')][_0x4ed1('0x41')]){_0x159307[_0x4ed1('0x42')]=[{'all':!![]}];}return db[_0x4ed1('0x2e')][_0x4ed1('0x43')](_0x159307);})[_0x4ed1('0x28')](function(_0x3cacab){_0x3c69b2[_0x4ed1('0x44')]=_0x3cacab;return _0x3c69b2;})[_0x4ed1('0x28')](respondWithFilteredResult(_0x249bc6,_0x159307))['catch'](handleError(_0x249bc6,null));};exports[_0x4ed1('0x45')]=function(_0x308c5f,_0x2f14cc){var _0x30c564={'raw':![],'where':{'id':_0x308c5f[_0x4ed1('0x46')]['id']}},_0x209c87={};_0x209c87[_0x4ed1('0x32')]=_[_0x4ed1('0x34')](db[_0x4ed1('0x2e')][_0x4ed1('0x2f')]);_0x209c87[_0x4ed1('0x33')]=_[_0x4ed1('0x34')](_0x308c5f[_0x4ed1('0x33')]);_0x209c87[_0x4ed1('0x35')]=_[_0x4ed1('0x36')](_0x209c87[_0x4ed1('0x32')],_0x209c87[_0x4ed1('0x33')]);_0x30c564['attributes']=_['intersection'](_0x209c87[_0x4ed1('0x32')],qs[_0x4ed1('0x38')](_0x308c5f[_0x4ed1('0x33')]['fields']));_0x30c564[_0x4ed1('0x37')]=_0x30c564[_0x4ed1('0x37')]['length']?_0x30c564['attributes']:_0x209c87[_0x4ed1('0x32')];if(_0x308c5f[_0x4ed1('0x33')]['includeAll']){_0x30c564['include']=[{'all':!![]}];}_0x30c564=_[_0x4ed1('0x47')]({},_0x30c564,_0x308c5f[_0x4ed1('0x40')]);return db[_0x4ed1('0x2e')]['find'](_0x30c564)[_0x4ed1('0x28')](handleEntityNotFound(_0x2f14cc,null))[_0x4ed1('0x28')](respondWithResult(_0x2f14cc,null))[_0x4ed1('0x48')](handleError(_0x2f14cc,null));};exports[_0x4ed1('0x23')]=function(_0x4ca64f,_0x2d97f0){if(_0x4ca64f[_0x4ed1('0x49')]['id']){delete _0x4ca64f[_0x4ed1('0x49')]['id'];}return db['VoiceMusicOnHold'][_0x4ed1('0x4a')]({'where':{'id':_0x4ca64f[_0x4ed1('0x46')]['id']}})[_0x4ed1('0x28')](handleEntityNotFound(_0x2d97f0,null))[_0x4ed1('0x28')](saveUpdates(_0x4ca64f[_0x4ed1('0x49')],null))['then'](respondWithResult(_0x2d97f0,null))[_0x4ed1('0x48')](handleError(_0x2d97f0,null));};exports['create']=function(_0x43b556,_0x235c80,_0x2dfe9a){return db[_0x4ed1('0x4b')][_0x4ed1('0x4c')](function(_0x21cf55){if(_0x43b556[_0x4ed1('0x49')][_0x4ed1('0x4d')]===_0x4ed1('0x4e')){_0x43b556['body'][_0x4ed1('0x4f')]=path['join'](config[_0x4ed1('0x50')],_0x4ed1('0x51'),_0x43b556[_0x4ed1('0x49')][_0x4ed1('0x2b')]);}return db['VoiceMusicOnHold'][_0x4ed1('0x52')](_0x43b556[_0x4ed1('0x49')],{'transaction':_0x21cf55})[_0x4ed1('0x28')](function(_0x38d577){if(_0x43b556[_0x4ed1('0x49')][_0x4ed1('0x4d')]===_0x4ed1('0x4e')){fs['mkdirSync'](_0x38d577[_0x4ed1('0x4f')],parseInt(_0x4ed1('0x53'),0x8));}var _0x5bb6e5=_0x43b556[_0x4ed1('0x54')][_0x4ed1('0x25')]({'plain':!![]});if(!_0x5bb6e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bb6e5[_0x4ed1('0x55')]==='user'){var _0x50a4a3=_0x38d577[_0x4ed1('0x25')]({'plain':!![]});return db[_0x4ed1('0x56')][_0x4ed1('0x4a')]({'where':{'name':_0x4ed1('0x26'),'userProfileId':_0x5bb6e5['userProfileId']},'raw':!![]})[_0x4ed1('0x28')](function(_0x127daa){if(_0x127daa&&_0x127daa['autoAssociation']===0x0){return db[_0x4ed1('0x27')][_0x4ed1('0x52')]({'name':_0x50a4a3[_0x4ed1('0x2b')],'resourceId':_0x50a4a3['id'],'type':_0x127daa[_0x4ed1('0x2b')],'sectionId':_0x127daa['id']},{})[_0x4ed1('0x28')](function(){return _0x38d577;});}else{return _0x38d577;}})['catch'](function(_0x39ea33){logger[_0x4ed1('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39ea33);});}return _0x38d577;});})['then'](respondWithResult(_0x235c80,0xc9))[_0x4ed1('0x48')](handleError(_0x235c80,null));};exports[_0x4ed1('0x24')]=function(_0x33355a,_0x2470c9,_0x3b9261){var _0x32152d;return db[_0x4ed1('0x2e')][_0x4ed1('0x4a')]({'where':{'id':_0x33355a['params']['id']}})['then'](function(_0x281638){if(_0x281638){return db[_0x4ed1('0x4b')][_0x4ed1('0x4c')](function(_0xf6c869){return _0x281638[_0x4ed1('0x24')]({'transaction':_0xf6c869,'raw':!![]})[_0x4ed1('0x28')](function(_0x42b34c){if(_0x42b34c[_0x4ed1('0x4f')]){fs['readdirSync'](_0x42b34c[_0x4ed1('0x4f')])[_0x4ed1('0x58')](function(_0x2767cf){fs[_0x4ed1('0x59')](path['join'](_0x42b34c['directory'],_0x2767cf));});fs[_0x4ed1('0x5a')](_0x42b34c[_0x4ed1('0x4f')]);}return _0x42b34c;});})[_0x4ed1('0x48')](function(_0x3418e){throw new db[(_0x4ed1('0x5b'))][(_0x4ed1('0x5c'))](_0x3418e['message']);});}})[_0x4ed1('0x28')](handleEntityNotFound(_0x2470c9,null))[_0x4ed1('0x28')](removeEntity(_0x2470c9,null))['catch'](handleError(_0x2470c9,null));};exports[_0x4ed1('0x5d')]=function(_0x2a4989,_0x25c3c7,_0x14b131){return db[_0x4ed1('0x4b')][_0x4ed1('0x4c')](function(_0x49ca94){var _0x519218;return db[_0x4ed1('0x2e')][_0x4ed1('0x4a')]({'where':{'id':_0x2a4989[_0x4ed1('0x46')]['id']}})[_0x4ed1('0x28')](function(_0x3fbb9d){if(_0x3fbb9d){_0x519218=_0x3fbb9d;return _0x3fbb9d[_0x4ed1('0x5d')](_0x2a4989[_0x4ed1('0x49')]['id'],{'transaction':_0x49ca94});}})[_0x4ed1('0x28')](function(_0x354329){if(_0x354329){return db[_0x4ed1('0x5e')][_0x4ed1('0x5f')]({'where':{'id':_0x2a4989[_0x4ed1('0x49')]['id']},'attributes':['id',_0x4ed1('0x2b'),_0x4ed1('0x60'),'converted_format',_0x4ed1('0x61')],'raw':!![]});}})[_0x4ed1('0x28')](function(_0x900215){if(_0x900215){var _0x155f24=path[_0x4ed1('0x62')](config[_0x4ed1('0x50')],_0x4ed1('0x63'),util['format']('%s.%s',path[_0x4ed1('0x64')](_0x900215[_0x4ed1('0x60')],path['extname'](_0x900215[_0x4ed1('0x60')])),_0x900215[_0x4ed1('0x65')]));var _0x22caf1=path['join'](config[_0x4ed1('0x50')],_0x4ed1('0x51'),_0x519218[_0x4ed1('0x2b')],util[_0x4ed1('0x66')](_0x4ed1('0x67'),_0x900215[_0x4ed1('0x2b')],_0x900215['converted_format']));fs[_0x4ed1('0x68')](_0x155f24,_0x22caf1);return _0x900215;}})[_0x4ed1('0x48')](function(_0x1ab5c6){throw new db[(_0x4ed1('0x5b'))][(_0x4ed1('0x5c'))](_0x1ab5c6[_0x4ed1('0x69')]);});})[_0x4ed1('0x28')](handleEntityNotFound(_0x25c3c7,null))[_0x4ed1('0x28')](respondWithResult(_0x25c3c7,0xc9))[_0x4ed1('0x48')](handleError(_0x25c3c7,null));};exports['removeSound']=function(_0x376e59,_0x22e503,_0x4c8f3a){return db['sequelize']['transaction'](function(_0x5d0128){var _0x56a941;return db[_0x4ed1('0x2e')][_0x4ed1('0x5f')]({'where':{'id':_0x376e59['params']['id']}})['then'](handleEntityNotFound(_0x22e503,null))[_0x4ed1('0x28')](function(_0x200cd7){if(_0x200cd7){_0x56a941=_0x200cd7;return _0x200cd7[_0x4ed1('0x6a')](_0x376e59['params'][_0x4ed1('0x6b')]);}})[_0x4ed1('0x28')](function(_0x30359c){if(_0x30359c){return db[_0x4ed1('0x5e')][_0x4ed1('0x5f')]({'where':{'id':_0x376e59[_0x4ed1('0x46')][_0x4ed1('0x6b')]},'attributes':['id','name',_0x4ed1('0x60'),_0x4ed1('0x65'),_0x4ed1('0x61')],'raw':!![]});}})['then'](function(_0x372feb){if(_0x372feb){fs[_0x4ed1('0x59')](path[_0x4ed1('0x62')](_0x56a941['directory'],util[_0x4ed1('0x66')](_0x4ed1('0x67'),_0x372feb[_0x4ed1('0x2b')],_0x372feb['converted_format'])));return _0x372feb;}})[_0x4ed1('0x48')](function(_0x354b34){throw new db[(_0x4ed1('0x5b'))]['ValidationError'](_0x354b34[_0x4ed1('0x69')]);});})[_0x4ed1('0x28')](handleEntityNotFound(_0x22e503,null))[_0x4ed1('0x28')](respondWithStatusCode(_0x22e503,0xcc))[_0x4ed1('0x48')](handleError(_0x22e503,null));};exports[_0x4ed1('0x6c')]=function(_0x20e4a6,_0xe5448b,_0x193ab7){var _0xb721ef={};var _0x5994b1={};var _0x455296;var _0x384dc9;return db['VoiceMusicOnHold'][_0x4ed1('0x5f')]({'where':{'id':_0x20e4a6['params']['id']}})[_0x4ed1('0x28')](handleEntityNotFound(_0xe5448b,null))[_0x4ed1('0x28')](function(_0x36bf01){if(_0x36bf01){_0x455296=_0x36bf01;_0x5994b1[_0x4ed1('0x32')]=_[_0x4ed1('0x34')](db['Sound'][_0x4ed1('0x2f')]);_0x5994b1['query']=_['keys'](_0x20e4a6[_0x4ed1('0x33')]);_0x5994b1['filters']=_[_0x4ed1('0x36')](_0x5994b1['model'],_0x5994b1[_0x4ed1('0x33')]);_0xb721ef[_0x4ed1('0x37')]=_['intersection'](_0x5994b1[_0x4ed1('0x32')],qs[_0x4ed1('0x38')](_0x20e4a6[_0x4ed1('0x33')][_0x4ed1('0x38')]));_0xb721ef[_0x4ed1('0x37')]=_0xb721ef['attributes']['length']?_0xb721ef['attributes']:_0x5994b1[_0x4ed1('0x32')];_0xb721ef[_0x4ed1('0x6d')]=qs['sort'](_0x20e4a6[_0x4ed1('0x33')][_0x4ed1('0x3b')]);_0xb721ef['where']=qs[_0x4ed1('0x35')](_[_0x4ed1('0x3c')](_0x20e4a6['query'],_0x5994b1[_0x4ed1('0x35')]));if(_0x20e4a6['query']['filter']){_0xb721ef[_0x4ed1('0x3d')]=_[_0x4ed1('0x47')](_0xb721ef[_0x4ed1('0x3d')],{'$or':_[_0x4ed1('0x2d')](_0xb721ef[_0x4ed1('0x37')],function(_0x3cf147){var _0x1fd602={};_0x1fd602[_0x3cf147]={'$like':'%'+_0x20e4a6[_0x4ed1('0x33')]['filter']+'%'};return _0x1fd602;})});}_0xb721ef=_[_0x4ed1('0x47')]({},_0xb721ef,_0x20e4a6[_0x4ed1('0x40')]);return _0x455296['getSounds'](_0xb721ef);}})[_0x4ed1('0x28')](function(_0x4b0f7a){if(_0x4b0f7a){_0x384dc9=_0x4b0f7a['length'];if(!_0x20e4a6[_0x4ed1('0x33')]['hasOwnProperty'](_0x4ed1('0x3a'))){_0xb721ef[_0x4ed1('0x1f')]=qs[_0x4ed1('0x1f')](_0x20e4a6[_0x4ed1('0x33')][_0x4ed1('0x1f')]);_0xb721ef['offset']=qs[_0x4ed1('0x1e')](_0x20e4a6['query']['offset']);}return _0x455296[_0x4ed1('0x6c')](_0xb721ef);}})[_0x4ed1('0x28')](function(_0x3c3407){if(_0x3c3407){return _0x3c3407?{'count':_0x384dc9,'rows':_0x3c3407}:null;}})['then'](respondWithResult(_0xe5448b,null))[_0x4ed1('0x48')](handleError(_0xe5448b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 78e75f7..d7e82a7 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 _0x8940=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x4af98c,_0x145289){var _0x2fe6fc=function(_0x53e398){while(--_0x53e398){_0x4af98c['push'](_0x4af98c['shift']());}};_0x2fe6fc(++_0x145289);}(_0x8940,0xa1));var _0x0894=function(_0x97f5de,_0x1d0828){_0x97f5de=_0x97f5de-0x0;var _0x3df004=_0x8940[_0x97f5de];return _0x3df004;};'use strict';var _=require(_0x0894('0x0'));var util=require(_0x0894('0x1'));var logger=require('../../config/logger')(_0x0894('0x2'));var moment=require(_0x0894('0x3'));var BPromise=require('bluebird');var rp=require(_0x0894('0x4'));var fs=require('fs');var path=require(_0x0894('0x5'));var rimraf=require(_0x0894('0x6'));var config=require(_0x0894('0x7'));var attributes=require(_0x0894('0x8'));module[_0x0894('0x9')]=function(_0x1ae04a,_0x4eba8e){return _0x1ae04a[_0x0894('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x0894('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc94b=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1764c3,_0x45b0a6){var _0x43afd7=function(_0x26510a){while(--_0x26510a){_0x1764c3['push'](_0x1764c3['shift']());}};_0x43afd7(++_0x45b0a6);}(_0xc94b,0xe9));var _0xbc94=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xc94b[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xbc94('0x0'));var util=require(_0xbc94('0x1'));var logger=require('../../config/logger')(_0xbc94('0x2'));var moment=require(_0xbc94('0x3'));var BPromise=require(_0xbc94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc94('0x5'));var config=require(_0xbc94('0x6'));var attributes=require(_0xbc94('0x7'));module[_0xbc94('0x8')]=function(_0x1790f5,_0x4d77ab){return _0x1790f5[_0xbc94('0x9')](_0xbc94('0xa'),attributes,{'tableName':_0xbc94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 70da460..543f78a 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2c394a,_0x4a27a8){var _0x42c0a9=function(_0x396d5c){while(--_0x396d5c){_0x2c394a['push'](_0x2c394a['shift']());}};_0x42c0a9(++_0x4a27a8);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4c6d6b,_0x230526){var _0x3608a2=function(_0x21b9a6){while(--_0x21b9a6){_0x4c6d6b['push'](_0x4c6d6b['shift']());}};_0x3608a2(++_0x230526);}(_0x70e0,0x17b));var _0x070e=function(_0x2e40e6,_0x2b2970){_0x2e40e6=_0x2e40e6-0x0;var _0xeb6ce7=_0x70e0[_0x2e40e6];return _0xeb6ce7;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 39d84f9..d02fb8c 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 _0x1cc7=['isAuthenticated','get','/describe','describe','show','/:id/teams','getTeams','post','addTeams','put','update','delete','/:id','destroy','removeAgents','removeTeams','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14deb0,_0x1daddf){var _0x3c1435=function(_0x709f25){while(--_0x709f25){_0x14deb0['push'](_0x14deb0['shift']());}};_0x3c1435(++_0x1daddf);}(_0x1cc7,0x15a));var _0x71cc=function(_0xf8a524,_0x5032fd){_0xf8a524=_0xf8a524-0x0;var _0x4c6c97=_0x1cc7[_0xf8a524];return _0x4c6c97;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')]('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0xa')]);router[_0x71cc('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xc')]);router['post']('/',auth[_0x71cc('0x6')](),controller['create']);router[_0x71cc('0xd')]('/:id/users',auth[_0x71cc('0x6')](),controller['addAgents']);router[_0x71cc('0xd')](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xe')]);router[_0x71cc('0xf')]('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0x10')]);router[_0x71cc('0x11')](_0x71cc('0x12'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x13')]);router[_0x71cc('0x11')]('/:id/users',auth[_0x71cc('0x6')](),controller[_0x71cc('0x14')]);router[_0x71cc('0x11')](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x15')]);module['exports']=router; \ No newline at end of file +var _0x689c=['create','addAgents','addTeams','put','update','delete','removeTeams','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x442e3d,_0x16e1de){var _0x51a807=function(_0x55882){while(--_0x55882){_0x442e3d['push'](_0x442e3d['shift']());}};_0x51a807(++_0x16e1de);}(_0x689c,0x9e));var _0xc689=function(_0x1a90e0,_0x549831){_0x1a90e0=_0x1a90e0-0x0;var _0x1fe09e=_0x689c[_0x1a90e0];return _0x1fe09e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc689('0x0'));var timeout=require(_0xc689('0x1'));var express=require(_0xc689('0x2'));var router=express[_0xc689('0x3')]();var fs_extra=require(_0xc689('0x4'));var auth=require(_0xc689('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc689('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xc689('0x7')](),controller[_0xc689('0x8')]);router[_0xc689('0x9')](_0xc689('0xa'),auth[_0xc689('0x7')](),controller['describe']);router[_0xc689('0x9')](_0xc689('0xb'),auth[_0xc689('0x7')](),controller['show']);router[_0xc689('0x9')](_0xc689('0xc'),auth[_0xc689('0x7')](),controller[_0xc689('0xd')]);router[_0xc689('0x9')](_0xc689('0xe'),auth[_0xc689('0x7')](),controller[_0xc689('0xf')]);router[_0xc689('0x10')]('/',auth[_0xc689('0x7')](),controller[_0xc689('0x11')]);router['post'](_0xc689('0xc'),auth['isAuthenticated'](),controller[_0xc689('0x12')]);router[_0xc689('0x10')](_0xc689('0xe'),auth['isAuthenticated'](),controller[_0xc689('0x13')]);router[_0xc689('0x14')]('/:id',auth[_0xc689('0x7')](),controller[_0xc689('0x15')]);router[_0xc689('0x16')](_0xc689('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xc689('0x16')](_0xc689('0xc'),auth[_0xc689('0x7')](),controller['removeAgents']);router['delete'](_0xc689('0xe'),auth[_0xc689('0x7')](),controller[_0xc689('0x17')]);module[_0xc689('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 c2c461b..c6ab269 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 _0x9e94=['name','system-','getDataValue','INTEGER','sequelize','STRING'];(function(_0x5f2de3,_0x2587e3){var _0xed8641=function(_0x7ee7e1){while(--_0x7ee7e1){_0x5f2de3['push'](_0x5f2de3['shift']());}};_0xed8641(++_0x2587e3);}(_0x9e94,0x1f0));var _0x49e9=function(_0x5a8cbb,_0x2c7319){_0x5a8cbb=_0x5a8cbb-0x0;var _0x5bc059=_0x9e94[_0x5a8cbb];return _0x5bc059;};'use strict';var Sequelize=require(_0x49e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x49e9('0x1')],'allowNull':![],'unique':_0x49e9('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x594880){return _0x49e9('0x3')+this[_0x49e9('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x49e9('0x1')]},'callerIdAll':{'type':Sequelize[_0x49e9('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x49e9('0x5')]}}; \ No newline at end of file +var _0xdf53=['VIRTUAL','getDataValue','name','INTEGER','sequelize','exports','STRING'];(function(_0x51380e,_0x55b897){var _0x2ed390=function(_0x217cfe){while(--_0x217cfe){_0x51380e['push'](_0x51380e['shift']());}};_0x2ed390(++_0x55b897);}(_0xdf53,0x138));var _0x3df5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdf53[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x3df5('0x0'));module[_0x3df5('0x1')]={'name':{'type':Sequelize[_0x3df5('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3df5('0x3')],'get':function(_0x37b41f){return'system-'+this[_0x3df5('0x4')](_0x3df5('0x5'))+'-';}},'description':{'type':Sequelize[_0x3df5('0x2')]},'callerIdAll':{'type':Sequelize[_0x3df5('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x3df5('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 8834d0b..0a30ee1 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 _0x087b=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','catch','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','charAt','body','system-','findById','addAgents','params','omit','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','getTeams','Team','addTeams','findAll','interface','flatMap','Agents','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','union','compact','value','removeTeams','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus'];(function(_0x37f31f,_0x3138af){var _0x35c6ce=function(_0x4ea057){while(--_0x4ea057){_0x37f31f['push'](_0x37f31f['shift']());}};_0x35c6ce(++_0x3138af);}(_0x087b,0x11a));var _0xb087=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x087b[_0x26f702];return _0x11417d;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];config[_0xb087('0x1b')]=_[_0xb087('0x1c')](config['redis'],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1b')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);function respondWithStatusCode(_0x12d0db,_0x5e9757){_0x5e9757=_0x5e9757||0xcc;return function(_0x5147e3){if(_0x5147e3){return _0x12d0db[_0xb087('0x21')](_0x5e9757);}return _0x12d0db[_0xb087('0x22')](_0x5e9757)['end']();};}function respondWithResult(_0x43e576,_0x412b48){_0x412b48=_0x412b48||0xc8;return function(_0x597478){if(_0x597478){return _0x43e576[_0xb087('0x22')](_0x412b48)[_0xb087('0x23')](_0x597478);}};}function respondWithFilteredResult(_0x2e9e74,_0x5bb80b){return function(_0x330005){if(_0x330005){var _0x3c680f=typeof _0x5bb80b[_0xb087('0x24')]===_0xb087('0x25')&&typeof _0x5bb80b['limit']===_0xb087('0x25');var _0x28428e=_0x330005[_0xb087('0x26')];var _0x23c1b6=_0x3c680f?0x0:_0x5bb80b['offset'];var _0x5aeab1=_0x3c680f?_0x330005['count']:_0x5bb80b['offset']+_0x5bb80b[_0xb087('0x27')];var _0x17be8e;if(_0x5aeab1>=_0x28428e){_0x5aeab1=_0x28428e;_0x17be8e=0xc8;}else{_0x17be8e=0xce;}_0x2e9e74[_0xb087('0x22')](_0x17be8e);return _0x2e9e74[_0xb087('0x28')](_0xb087('0x29'),_0x23c1b6+'-'+_0x5aeab1+'/'+_0x28428e)[_0xb087('0x23')](_0x330005);}return null;};}function patchUpdates(_0x31ae01){return function(_0x5587f7){try{jsonpatch[_0xb087('0x2a')](_0x5587f7,_0x31ae01,!![]);}catch(_0x466397){return BPromise[_0xb087('0x2b')](_0x466397);}return _0x5587f7[_0xb087('0x2c')]();};}function saveUpdates(_0x3ad74e,_0x4d9028){return function(_0x183eab){if(_0x183eab){return _0x183eab[_0xb087('0x2d')](_0x3ad74e)['then'](function(_0x5a2dc6){return _0x5a2dc6;});}return null;};}function removeEntity(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(_0x5a4ee0){return _0x5a4ee0[_0xb087('0x2e')]()[_0xb087('0x2f')](function(){var _0x1d124f=_0x5a4ee0[_0xb087('0x30')]({'plain':!![]});var _0xd9ec66=_0xb087('0x31');return db[_0xb087('0x32')][_0xb087('0x2e')]({'where':{'type':_0xd9ec66,'resourceId':_0x1d124f['id']}})[_0xb087('0x2f')](function(){return _0x5a4ee0;});})[_0xb087('0x2f')](function(){_0x50745a[_0xb087('0x22')](0xcc)[_0xb087('0x33')]();});}};}function handleEntityNotFound(_0xb0baf6,_0x263259){return function(_0x593b78){if(!_0x593b78){_0xb0baf6[_0xb087('0x21')](0x194);}return _0x593b78;};}function handleError(_0x1335d9,_0x20183f){_0x20183f=_0x20183f||0x1f4;return function(_0x15c9ac){logger[_0xb087('0x34')](_0x15c9ac[_0xb087('0x35')]);if(_0x15c9ac[_0xb087('0x36')]){delete _0x15c9ac[_0xb087('0x36')];}_0x1335d9['status'](_0x20183f)['send'](_0x15c9ac);};}exports[_0xb087('0x37')]=function(_0xedd164,_0x4cb5a8){var _0x60bfe2={},_0x7d3776={},_0x2a48d3={'count':0x0,'rows':[]};var _0x32b20d=_[_0xb087('0x38')](db[_0xb087('0x39')][_0xb087('0x3a')],function(_0x3b7ace){return{'name':_0x3b7ace[_0xb087('0x3b')],'type':_0x3b7ace[_0xb087('0x3c')][_0xb087('0x3d')]};});_0x7d3776[_0xb087('0x3e')]=_['map'](_0x32b20d,_0xb087('0x36'));_0x7d3776['query']=_[_0xb087('0x3f')](_0xedd164[_0xb087('0x40')]);_0x7d3776[_0xb087('0x41')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],_0x7d3776[_0xb087('0x40')]);_0x60bfe2[_0xb087('0x43')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],qs['fields'](_0xedd164['query'][_0xb087('0x44')]));_0x60bfe2[_0xb087('0x43')]=_0x60bfe2[_0xb087('0x43')][_0xb087('0x45')]?_0x60bfe2[_0xb087('0x43')]:_0x7d3776['model'];if(!_0xedd164[_0xb087('0x40')][_0xb087('0x46')]('nolimit')){_0x60bfe2['limit']=qs[_0xb087('0x27')](_0xedd164[_0xb087('0x40')][_0xb087('0x27')]);_0x60bfe2['offset']=qs[_0xb087('0x24')](_0xedd164[_0xb087('0x40')][_0xb087('0x24')]);}_0x60bfe2[_0xb087('0x47')]=qs[_0xb087('0x48')](_0xedd164['query'][_0xb087('0x48')]);_0x60bfe2['where']=qs[_0xb087('0x41')](_['pick'](_0xedd164[_0xb087('0x40')],_0x7d3776[_0xb087('0x41')]),_0x32b20d);if(_0xedd164['query'][_0xb087('0x49')]){_0x60bfe2['where']=_[_0xb087('0x4a')](_0x60bfe2['where'],{'$or':_[_0xb087('0x38')](_0x32b20d,function(_0x326934){if(_0x326934[_0xb087('0x3c')]!==_0xb087('0x4b')){var _0x1785e0={};_0x1785e0[_0x326934[_0xb087('0x36')]]={'$like':'%'+_0xedd164[_0xb087('0x40')]['filter']+'%'};return _0x1785e0;}})});}_0x60bfe2=_[_0xb087('0x4a')]({},_0x60bfe2,_0xedd164['options']);var _0x2a2b9c={'where':_0x60bfe2[_0xb087('0x4c')]};return db['VoicePrefix'][_0xb087('0x26')](_0x2a2b9c)[_0xb087('0x2f')](function(_0x7650c5){_0x2a48d3['count']=_0x7650c5;if(_0xedd164[_0xb087('0x40')]['includeAll']){_0x60bfe2[_0xb087('0x4d')]=[{'all':!![]}];}return db[_0xb087('0x39')]['findAll'](_0x60bfe2);})[_0xb087('0x2f')](function(_0x302ce7){_0x2a48d3['rows']=_0x302ce7;return _0x2a48d3;})[_0xb087('0x2f')](respondWithFilteredResult(_0x4cb5a8,_0x60bfe2))[_0xb087('0x4e')](handleError(_0x4cb5a8,null));};exports['show']=function(_0x93ada7,_0x46c713){var _0x1d7f80={'raw':![],'where':{'id':_0x93ada7['params']['id']}},_0x174c10={};_0x174c10['model']=_[_0xb087('0x3f')](db[_0xb087('0x39')][_0xb087('0x3a')]);_0x174c10[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x93ada7[_0xb087('0x40')]);_0x174c10['filters']=_['intersection'](_0x174c10[_0xb087('0x3e')],_0x174c10['query']);_0x1d7f80[_0xb087('0x43')]=_[_0xb087('0x42')](_0x174c10[_0xb087('0x3e')],qs[_0xb087('0x44')](_0x93ada7['query'][_0xb087('0x44')]));_0x1d7f80['attributes']=_0x1d7f80[_0xb087('0x43')][_0xb087('0x45')]?_0x1d7f80[_0xb087('0x43')]:_0x174c10[_0xb087('0x3e')];if(_0x93ada7[_0xb087('0x40')]['includeAll']){_0x1d7f80[_0xb087('0x4d')]=[{'all':!![]}];}_0x1d7f80=_[_0xb087('0x4a')]({},_0x1d7f80,_0x93ada7[_0xb087('0x4f')]);return db['VoicePrefix'][_0xb087('0x50')](_0x1d7f80)['then'](handleEntityNotFound(_0x46c713,null))['then'](respondWithResult(_0x46c713,null))[_0xb087('0x4e')](handleError(_0x46c713,null));};exports[_0xb087('0x2e')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x5eacf3['params']['id']}})['then'](handleEntityNotFound(_0x4362d4,null))[_0xb087('0x2f')](removeEntity(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));};exports['describe']=function(_0x1e52e4,_0x3bafca){return db[_0xb087('0x39')][_0xb087('0x51')]()[_0xb087('0x2f')](respondWithResult(_0x3bafca,null))[_0xb087('0x4e')](handleError(_0x3bafca,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){var _0x18d93b;return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x55e653){return db[_0xb087('0x39')][_0xb087('0x52')](_0xfb8827['body'],{'transaction':_0x55e653})[_0xb087('0x2f')](function(_0x458301){_0x18d93b=_0x458301[_0xb087('0x30')]({'plain':!![]});return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x18d93b[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x298169){return createVoicePrefixExtensions(_0x18d93b,_0x298169,_0x55e653);});});})[_0xb087('0x2f')](function(){var _0x357616=_0xfb8827[_0xb087('0x57')]['get']({'plain':!![]});if(!_0x357616)throw new Error(_0xb087('0x58'));if(_0x357616['role']===_0xb087('0x57')){var _0x575cc4=_0x18d93b;return db[_0xb087('0x59')][_0xb087('0x50')]({'where':{'name':_0xb087('0x31'),'userProfileId':_0x357616[_0xb087('0x5a')]},'raw':!![]})[_0xb087('0x2f')](function(_0x465ef6){if(_0x465ef6&&_0x465ef6[_0xb087('0x5b')]===0x0){return db[_0xb087('0x32')][_0xb087('0x52')]({'name':_0x575cc4[_0xb087('0x36')],'resourceId':_0x575cc4['id'],'type':_0x465ef6[_0xb087('0x36')],'sectionId':_0x465ef6['id']},{})[_0xb087('0x2f')](function(){return _0x18d93b;});}else{return _0x18d93b;}})[_0xb087('0x4e')](function(_0x22be05){logger[_0xb087('0x34')](_0xb087('0x5c'),_0x22be05);throw _0x22be05;});}return _0x18d93b;})[_0xb087('0x2f')](respondWithResult(_0x1fe178,null))[_0xb087('0x4e')](handleError(_0x1fe178,null));};function Extension(_0x40ff74,_0xe3cb2,_0x4053c8,_0x459c5b){this['context']=_0xb087('0x5d');this[_0xb087('0x5e')]=_0x40ff74;this[_0xb087('0x5f')]=_0x4053c8;this['type']=_0xb087('0x60');this[_0xb087('0x61')]='Voice\x20Prefix\x20Extension';this[_0xb087('0x62')]=_0xe3cb2;this[_0xb087('0x63')]=_0x459c5b;}function createVoicePrefixExtensions(_0x2e3a14,_0x596264,_0x133c58){return new BPromise(function(_0x257894,_0x3d7f74){var _0x43ef22=new Extension(formatPrefixName(_0x2e3a14[_0xb087('0x64')]),0x1,_0xb087('0x65'),_0xb087('0x66'));_0x43ef22[_0xb087('0x67')]=_0x2e3a14['id'];return db['VoiceExtension'][_0xb087('0x52')](_0x43ef22,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x44548f){var _0x47b2c7=_0x44548f[_0xb087('0x30')]({'plain':!![]});var _0x4a26d0=_['map'](addVoicePrefixExtensions(_0x2e3a14,_0x596264),function(_0x3516d4){_0x3516d4[_0xb087('0x56')]=_0x47b2c7['id'];_0x3516d4['VoicePrefixId']=_0x2e3a14['id'];return _0x3516d4;});return db[_0xb087('0x55')]['bulkCreate'](_0x4a26d0,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x1a8237){if(!_0x1a8237){return _0x3d7f74('Extensions\x20creation\x20failed');}else{return _0x257894(_0x1a8237);}})['catch'](function(_0x22219d){return _0x3d7f74(_0x22219d);});});;});};function addVoicePrefixExtensions(_0x5c43c8,_0x5ede2e){var _0x3c97ab=[];var _0x52d72a=formatPrefixName(_0x5c43c8[_0xb087('0x64')]);_0x3c97ab['push'](new Extension(_0x52d72a,0x2,_0xb087('0x68'),_0xb087('0x69')+_0x5c43c8[_0xb087('0x36')]));if(_0x5c43c8[_0xb087('0x6a')]){_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x3,_0xb087('0x68'),'PREFIX-CALLERIDALL='+_0x5c43c8[_0xb087('0x6a')]));}else{_0x3c97ab['push'](new Extension(_0x52d72a,0x3,_0xb087('0x65'),_0xb087('0x6c')));}_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x4,'goto',_0x5ede2e[_0xb087('0x6d')]+','+'${EXTEN:'+(0x8+_0x5c43c8[_0xb087('0x36')][_0xb087('0x45')])+'}'+','+0x1));return _0x3c97ab;}function formatPrefixName(_0x66f15b){var _0x2ee63f='_';for(var _0x16cb87=0x0;_0x16cb87<_0x66f15b[_0xb087('0x45')];_0x16cb87++){if(_0x66f15b['charAt'](_0x16cb87)=='-'){_0x2ee63f+=_0x66f15b[_0xb087('0x6e')](_0x16cb87);}else{_0x2ee63f+='['+_0x66f15b[_0xb087('0x6e')](_0x16cb87)+']';}}_0x2ee63f+='.';return _0x2ee63f;}exports['update']=function(_0x25a45f,_0x58de88,_0x19238d){var _0x38f5d2=_0x25a45f[_0xb087('0x6f')];_0x38f5d2[_0xb087('0x64')]=_0xb087('0x70')+_0x38f5d2[_0xb087('0x36')]+'-';return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x509ee7){return db['VoicePrefix']['update'](_0x38f5d2,{'where':{'id':_0x38f5d2['id']},'transaction':_0x509ee7})[_0xb087('0x2f')](function(){return db['VoiceExtension'][_0xb087('0x2e')]({'where':{'VoicePrefixId':_0x38f5d2['id']},'transaction':_0x509ee7})['then'](function(){return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x38f5d2[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x49d0d3){return createVoicePrefixExtensions(_0x38f5d2,_0x49d0d3,_0x509ee7);});});});})[_0xb087('0x2f')](function(){return db['VoicePrefix'][_0xb087('0x71')](_0x38f5d2['id']);})[_0xb087('0x2f')](respondWithResult(_0x58de88,null))[_0xb087('0x4e')](handleError(_0x58de88,null));};exports[_0xb087('0x72')]=function(_0x5b5ad3,_0x49d26a,_0x38f296){return db['VoicePrefix'][_0xb087('0x50')]({'where':{'id':_0x5b5ad3[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x49d26a,null))[_0xb087('0x2f')](function(_0x4a9193){if(_0x4a9193){return _0x4a9193['addAgents'](_0x5b5ad3[_0xb087('0x6f')]['ids'],_[_0xb087('0x74')](_0x5b5ad3[_0xb087('0x6f')],[_0xb087('0x75'),'id'])||{})[_0xb087('0x76')](function(_0x142b0f){for(var _0x581ad4=0x0;_0x581ad4<_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')]['length'];_0x581ad4+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')][_0x581ad4]),'VoicePrefixId':Number(_0x5b5ad3[_0xb087('0x73')]['id'])});}return _0x142b0f;});}})[_0xb087('0x2f')](respondWithResult(_0x49d26a,null))[_0xb087('0x4e')](handleError(_0x49d26a,null));};exports[_0xb087('0x77')]=function(_0x47ea48,_0xd1f58a,_0x25e097){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x47ea48[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0xd1f58a,null))[_0xb087('0x2f')](function(_0x50454b){if(_0x50454b){return _0x50454b[_0xb087('0x77')](_0x47ea48[_0xb087('0x40')][_0xb087('0x75')])['then'](function(){if(_[_0xb087('0x78')](_0x47ea48['query'][_0xb087('0x75')])){for(var _0x5fb869=0x0;_0x5fb869<_0x47ea48[_0xb087('0x40')][_0xb087('0x75')][_0xb087('0x45')];_0x5fb869+=0x1){socket[_0xb087('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x47ea48['query'][_0xb087('0x75')][_0x5fb869]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}}else{socket['emit'](_0xb087('0x7a'),{'UserId':Number(_0x47ea48[_0xb087('0x40')][_0xb087('0x75')]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}});}})[_0xb087('0x2f')](respondWithStatusCode(_0xd1f58a,null))[_0xb087('0x4e')](handleError(_0xd1f58a,null));};exports['getAgents']=function(_0x15ff29,_0x141859,_0x2c92f6){var _0x3114ce={};var _0x416e05={};var _0x3d6d1a;var _0xf286de;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x15ff29['params']['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x141859,null))['then'](function(_0x2a32d0){if(_0x2a32d0){_0x3d6d1a=_0x2a32d0;_0x416e05[_0xb087('0x3e')]=_['keys'](db[_0xb087('0x7c')][_0xb087('0x3a')]);_0x416e05[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x15ff29[_0xb087('0x40')]);_0x416e05[_0xb087('0x41')]=_['intersection'](_0x416e05[_0xb087('0x3e')],_0x416e05[_0xb087('0x40')]);_0x3114ce[_0xb087('0x43')]=_[_0xb087('0x42')](_0x416e05[_0xb087('0x3e')],qs['fields'](_0x15ff29[_0xb087('0x40')][_0xb087('0x44')]));_0x3114ce[_0xb087('0x43')]=_0x3114ce[_0xb087('0x43')][_0xb087('0x45')]?_0x3114ce[_0xb087('0x43')]:_0x416e05[_0xb087('0x3e')];_0x3114ce[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x15ff29[_0xb087('0x40')][_0xb087('0x48')]);_0x3114ce['where']=qs['filters'](_[_0xb087('0x7d')](_0x15ff29[_0xb087('0x40')],_0x416e05[_0xb087('0x41')]));if(_0x15ff29[_0xb087('0x40')][_0xb087('0x49')]){_0x3114ce['where']=_[_0xb087('0x4a')](_0x3114ce[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x3114ce[_0xb087('0x43')],function(_0x3e58be){var _0xbe2a4c={};_0xbe2a4c[_0x3e58be]={'$like':'%'+_0x15ff29['query'][_0xb087('0x49')]+'%'};return _0xbe2a4c;})});}_0x3114ce=_['merge']({},_0x3114ce,_0x15ff29['options']);return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})[_0xb087('0x2f')](function(_0x3a446d){if(_0x3a446d){_0xf286de=_0x3a446d[_0xb087('0x45')];if(!_0x15ff29['query'][_0xb087('0x46')](_0xb087('0x7f'))){_0x3114ce['limit']=qs[_0xb087('0x27')](_0x15ff29['query']['limit']);_0x3114ce[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x15ff29[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})['then'](function(_0x3cf818){if(_0x3cf818){return _0x3cf818?{'count':_0xf286de,'rows':_0x3cf818}:null;}})[_0xb087('0x2f')](respondWithResult(_0x141859,null))[_0xb087('0x4e')](handleError(_0x141859,null));};exports[_0xb087('0x80')]=function(_0x48e2c6,_0x489b1f,_0x544a68){var _0x5ebb4f={};var _0x17f0af={};var _0x3296c9;var _0x10e4b6;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x48e2c6[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x489b1f,null))['then'](function(_0x5d45e7){if(_0x5d45e7){_0x3296c9=_0x5d45e7;_0x17f0af[_0xb087('0x3e')]=_[_0xb087('0x3f')](db[_0xb087('0x81')][_0xb087('0x3a')]);_0x17f0af['query']=_[_0xb087('0x3f')](_0x48e2c6['query']);_0x17f0af[_0xb087('0x41')]=_['intersection'](_0x17f0af[_0xb087('0x3e')],_0x17f0af[_0xb087('0x40')]);_0x5ebb4f[_0xb087('0x43')]=_[_0xb087('0x42')](_0x17f0af['model'],qs[_0xb087('0x44')](_0x48e2c6['query']['fields']));_0x5ebb4f['attributes']=_0x5ebb4f[_0xb087('0x43')]['length']?_0x5ebb4f[_0xb087('0x43')]:_0x17f0af[_0xb087('0x3e')];_0x5ebb4f[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x48')]);_0x5ebb4f[_0xb087('0x4c')]=qs[_0xb087('0x41')](_[_0xb087('0x7d')](_0x48e2c6[_0xb087('0x40')],_0x17f0af[_0xb087('0x41')]));if(_0x48e2c6[_0xb087('0x40')][_0xb087('0x49')]){_0x5ebb4f[_0xb087('0x4c')]=_[_0xb087('0x4a')](_0x5ebb4f[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x5ebb4f[_0xb087('0x43')],function(_0x4e42eb){var _0x15e2f9={};_0x15e2f9[_0x4e42eb]={'$like':'%'+_0x48e2c6['query'][_0xb087('0x49')]+'%'};return _0x15e2f9;})});}_0x5ebb4f=_[_0xb087('0x4a')]({},_0x5ebb4f,_0x48e2c6[_0xb087('0x4f')]);return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})[_0xb087('0x2f')](function(_0x2e4d22){if(_0x2e4d22){_0x10e4b6=_0x2e4d22[_0xb087('0x45')];if(!_0x48e2c6['query']['hasOwnProperty']('nolimit')){_0x5ebb4f[_0xb087('0x27')]=qs[_0xb087('0x27')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x27')]);_0x5ebb4f[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})['then'](function(_0x2de517){if(_0x2de517){return _0x2de517?{'count':_0x10e4b6,'rows':_0x2de517}:null;}})['then'](respondWithResult(_0x489b1f,null))[_0xb087('0x4e')](handleError(_0x489b1f,null));};exports[_0xb087('0x82')]=function(_0x597d80,_0x4c3aef,_0x2f2597){var _0x2ae274=_0x597d80[_0xb087('0x6f')][_0xb087('0x75')];var _0x5069f2;return db[_0xb087('0x81')][_0xb087('0x83')]({'where':{'id':_0x2ae274},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb087('0x36'),'online','voicePause',_0xb087('0x84')],'raw':!![]}]})['then'](function(_0x4059ac){if(_0x4059ac){_0x5069f2=_0x4059ac;var _0x12976c=_[_0xb087('0x85')](_0x4059ac,function(_0x1e48cc){var _0x2de831=_0x1e48cc[_0xb087('0x30')]({'plain':!![]});return _0x2de831[_0xb087('0x86')];});return db[_0xb087('0x39')]['find']({'where':{'id':_0x597d80[_0xb087('0x73')]['id']}})['then'](function(_0x5acf13){return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x1fdb0f){return _0x5acf13['addTeams'](_0x2ae274,{'transaction':_0x1fdb0f})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x5069f2,function(_0x313d4b){return db[_0xb087('0x88')]['upsert']({'TeamId':_0x313d4b['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},{'transaction':_0x1fdb0f});});})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x12976c,function(_0x46f5e6){return db[_0xb087('0x89')][_0xb087('0x8a')]({'where':{'UserId':_0x46f5e6['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},'transaction':_0x1fdb0f});});})['then'](function(){_0x12976c[_0xb087('0x8b')](function(_0xfc3490){socket[_0xb087('0x79')](_0xb087('0x8c'),{'UserId':_0xfc3490['id'],'VoicePrefixId':_0x5acf13['id']});});});});});}})[_0xb087('0x2f')](respondWithStatusCode(_0x4c3aef,null))[_0xb087('0x4e')](handleError(_0x4c3aef,null));};exports['removeTeams']=function(_0x44c8cb,_0x15bbda,_0x149020){return db['Team']['findAll']({'where':{'id':_0x44c8cb[_0xb087('0x40')][_0xb087('0x75')]},'attributes':['id'],'include':[{'model':db[_0xb087('0x7c')],'as':_0xb087('0x86'),'attributes':['id'],'raw':!![]}]})[_0xb087('0x2f')](handleEntityNotFound(_0x15bbda,null))[_0xb087('0x2f')](function(_0x42528a){var _0x2795e9=_[_0xb087('0x38')](_0x42528a,'id');var _0xa58050=[];var _0x5ef263=[];var _0x1a7486=squel[_0xb087('0x8d')]();_0x1a7486[_0xb087('0x8e')](_0xb087('0x8f'))[_0xb087('0x90')]('team_has_voice_prefixes','tq')[_0xb087('0x91')](_0xb087('0x92'),'ut',_0xb087('0x93'))[_0xb087('0x4c')]('VoicePrefixId\x20=\x20?',_0x44c8cb[_0xb087('0x73')]['id']);for(var _0x547968=0x0;_0x547968<_0x42528a[_0xb087('0x45')];_0x547968+=0x1){let _0x532682=_0x42528a[_0x547968];for(var _0x5f4312=0x0;_0x5f4312<_0x532682[_0xb087('0x86')][_0xb087('0x45')];_0x5f4312+=0x1){let _0x1cb959=_0x532682['Agents'][_0x5f4312];var _0x595faa=_0x1a7486[_0xb087('0x94')]();_0x595faa[_0xb087('0x4c')](_0xb087('0x95'),_0x1cb959['id']);_0x5ef263[_0xb087('0x6b')](db[_0xb087('0x53')]['query'](_0x595faa[_0xb087('0x96')](),{'type':db[_0xb087('0x53')][_0xb087('0x97')][_0xb087('0x98')]})[_0xb087('0x2f')](function(_0x14737){if(_0x14737['length']===0x1){return _0x1cb959['id'];}else{var _0x5777d0=_[_0xb087('0x99')](_[_0xb087('0x38')](_0x14737,'TeamId'),function(_0x1f28dd){return _['includes'](_0x2795e9,_0x1f28dd);});if(_0x5777d0){return _0x1cb959['id'];}}}));}}return BPromise['all'](_0x5ef263)[_0xb087('0x2f')](function(_0x3193c8){_0xa58050=_(_0xa58050)[_0xb087('0x9a')](_0x3193c8)[_0xb087('0x9b')]()[_0xb087('0x9c')]();return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x44c8cb[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](function(_0xff9c0c){return db['sequelize']['transaction'](function(_0x5e704a){return _0xff9c0c[_0xb087('0x9d')](_0x44c8cb['query'][_0xb087('0x75')],{'transaction':_0x5e704a})['then'](function(){if(!_['isEmpty'](_0xa58050)){return _0xff9c0c[_0xb087('0x77')](_0xa58050,{'transaction':_0x5e704a});}})[_0xb087('0x2f')](function(){_0xa58050[_0xb087('0x8b')](function(_0x170d9e){socket[_0xb087('0x79')](_0xb087('0x7a'),{'UserId':_0x170d9e,'VoicePrefixId':_0xff9c0c['id']});});});});});});})[_0xb087('0x2f')](respondWithStatusCode(_0x15bbda,null))[_0xb087('0x4e')](handleError(_0x15bbda,null));}; \ No newline at end of file +var _0xd943=['isArray','userVoicePrefix:remove','getAgents','User','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','index','map','VoicePrefix','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rawAttributes','merge','options','find','catch','params','describe','create','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','emit'];(function(_0xf7cc63,_0x4eeaf4){var _0x5dea06=function(_0x28108d){while(--_0x28108d){_0xf7cc63['push'](_0xf7cc63['shift']());}};_0x5dea06(++_0x4eeaf4);}(_0xd943,0x15d));var _0x3d94=function(_0x2f0d30,_0x5a3103){_0x2f0d30=_0x2f0d30-0x0;var _0x98981f=_0xd943[_0x2f0d30];return _0x98981f;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];config[_0x3d94('0x16')]=_['defaults'](config[_0x3d94('0x16')],{'host':_0x3d94('0x17'),'port':0x18eb});var socket=require(_0x3d94('0x18'))(new Redis(config['redis']));require(_0x3d94('0x19'))[_0x3d94('0x1a')](socket);function respondWithStatusCode(_0x7d6969,_0x5d9366){_0x5d9366=_0x5d9366||0xcc;return function(_0x14ea5f){if(_0x14ea5f){return _0x7d6969[_0x3d94('0x1b')](_0x5d9366);}return _0x7d6969[_0x3d94('0x1c')](_0x5d9366)[_0x3d94('0x1d')]();};}function respondWithResult(_0xaf939a,_0xd8efaa){_0xd8efaa=_0xd8efaa||0xc8;return function(_0x31c6e8){if(_0x31c6e8){return _0xaf939a[_0x3d94('0x1c')](_0xd8efaa)['json'](_0x31c6e8);}};}function respondWithFilteredResult(_0x22676a,_0x1a9315){return function(_0x2acee3){if(_0x2acee3){var _0x1c35a8=typeof _0x1a9315[_0x3d94('0x1e')]===_0x3d94('0x1f')&&typeof _0x1a9315[_0x3d94('0x20')]==='undefined';var _0x9bca24=_0x2acee3['count'];var _0x28bead=_0x1c35a8?0x0:_0x1a9315[_0x3d94('0x1e')];var _0x16a6d0=_0x1c35a8?_0x2acee3[_0x3d94('0x21')]:_0x1a9315[_0x3d94('0x1e')]+_0x1a9315['limit'];var _0x578002;if(_0x16a6d0>=_0x9bca24){_0x16a6d0=_0x9bca24;_0x578002=0xc8;}else{_0x578002=0xce;}_0x22676a[_0x3d94('0x1c')](_0x578002);return _0x22676a[_0x3d94('0x22')](_0x3d94('0x23'),_0x28bead+'-'+_0x16a6d0+'/'+_0x9bca24)['json'](_0x2acee3);}return null;};}function patchUpdates(_0x30af25){return function(_0x2e8c91){try{jsonpatch[_0x3d94('0x24')](_0x2e8c91,_0x30af25,!![]);}catch(_0x384f76){return BPromise[_0x3d94('0x25')](_0x384f76);}return _0x2e8c91[_0x3d94('0x26')]();};}function saveUpdates(_0x295493,_0x27f978){return function(_0xee7b8d){if(_0xee7b8d){return _0xee7b8d[_0x3d94('0x27')](_0x295493)[_0x3d94('0x28')](function(_0x192839){return _0x192839;});}return null;};}function removeEntity(_0x292976,_0x3496c3){return function(_0x2945d2){if(_0x2945d2){return _0x2945d2['destroy']()[_0x3d94('0x28')](function(){var _0x558fd2=_0x2945d2[_0x3d94('0x29')]({'plain':!![]});var _0x1d0a7a=_0x3d94('0x2a');return db[_0x3d94('0x2b')][_0x3d94('0x2c')]({'where':{'type':_0x1d0a7a,'resourceId':_0x558fd2['id']}})[_0x3d94('0x28')](function(){return _0x2945d2;});})[_0x3d94('0x28')](function(){_0x292976['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362642,_0x4813e1){return function(_0x4dd410){if(!_0x4dd410){_0x362642[_0x3d94('0x1b')](0x194);}return _0x4dd410;};}function handleError(_0x58c0d0,_0x19bfd4){_0x19bfd4=_0x19bfd4||0x1f4;return function(_0xef9644){logger[_0x3d94('0x2d')](_0xef9644['stack']);if(_0xef9644[_0x3d94('0x2e')]){delete _0xef9644['name'];}_0x58c0d0[_0x3d94('0x1c')](_0x19bfd4)['send'](_0xef9644);};}exports[_0x3d94('0x2f')]=function(_0x215ad7,_0x29b1ff){var _0x246f88={},_0x50560c={},_0x18f854={'count':0x0,'rows':[]};var _0x51f634=_[_0x3d94('0x30')](db[_0x3d94('0x31')]['rawAttributes'],function(_0x5288da){return{'name':_0x5288da[_0x3d94('0x32')],'type':_0x5288da[_0x3d94('0x33')][_0x3d94('0x34')]};});_0x50560c['model']=_[_0x3d94('0x30')](_0x51f634,_0x3d94('0x2e'));_0x50560c['query']=_[_0x3d94('0x35')](_0x215ad7[_0x3d94('0x36')]);_0x50560c[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0x50560c[_0x3d94('0x39')],_0x50560c['query']);_0x246f88[_0x3d94('0x3a')]=_[_0x3d94('0x38')](_0x50560c[_0x3d94('0x39')],qs[_0x3d94('0x3b')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x3b')]));_0x246f88['attributes']=_0x246f88['attributes'][_0x3d94('0x3c')]?_0x246f88[_0x3d94('0x3a')]:_0x50560c[_0x3d94('0x39')];if(!_0x215ad7[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0x246f88[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x20')]);_0x246f88['offset']=qs[_0x3d94('0x1e')](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x1e')]);}_0x246f88[_0x3d94('0x3f')]=qs['sort'](_0x215ad7[_0x3d94('0x36')][_0x3d94('0x40')]);_0x246f88[_0x3d94('0x41')]=qs[_0x3d94('0x37')](_[_0x3d94('0x42')](_0x215ad7['query'],_0x50560c[_0x3d94('0x37')]),_0x51f634);if(_0x215ad7[_0x3d94('0x36')][_0x3d94('0x43')]){_0x246f88['where']=_['merge'](_0x246f88['where'],{'$or':_['map'](_0x51f634,function(_0x3b3550){if(_0x3b3550[_0x3d94('0x33')]!==_0x3d94('0x44')){var _0x146ccb={};_0x146ccb[_0x3b3550[_0x3d94('0x2e')]]={'$like':'%'+_0x215ad7[_0x3d94('0x36')][_0x3d94('0x43')]+'%'};return _0x146ccb;}})});}_0x246f88=_['merge']({},_0x246f88,_0x215ad7['options']);var _0x118fda={'where':_0x246f88[_0x3d94('0x41')]};return db['VoicePrefix'][_0x3d94('0x21')](_0x118fda)['then'](function(_0x1361fb){_0x18f854[_0x3d94('0x21')]=_0x1361fb;if(_0x215ad7[_0x3d94('0x36')][_0x3d94('0x45')]){_0x246f88[_0x3d94('0x46')]=[{'all':!![]}];}return db['VoicePrefix'][_0x3d94('0x47')](_0x246f88);})[_0x3d94('0x28')](function(_0x18a70c){_0x18f854['rows']=_0x18a70c;return _0x18f854;})[_0x3d94('0x28')](respondWithFilteredResult(_0x29b1ff,_0x246f88))['catch'](handleError(_0x29b1ff,null));};exports['show']=function(_0x3f4b32,_0x402132){var _0x6190cc={'raw':![],'where':{'id':_0x3f4b32['params']['id']}},_0xfeae3a={};_0xfeae3a[_0x3d94('0x39')]=_['keys'](db[_0x3d94('0x31')][_0x3d94('0x48')]);_0xfeae3a[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x3f4b32[_0x3d94('0x36')]);_0xfeae3a[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0xfeae3a['model'],_0xfeae3a[_0x3d94('0x36')]);_0x6190cc[_0x3d94('0x3a')]=_['intersection'](_0xfeae3a['model'],qs[_0x3d94('0x3b')](_0x3f4b32[_0x3d94('0x36')]['fields']));_0x6190cc[_0x3d94('0x3a')]=_0x6190cc[_0x3d94('0x3a')][_0x3d94('0x3c')]?_0x6190cc[_0x3d94('0x3a')]:_0xfeae3a[_0x3d94('0x39')];if(_0x3f4b32[_0x3d94('0x36')][_0x3d94('0x45')]){_0x6190cc[_0x3d94('0x46')]=[{'all':!![]}];}_0x6190cc=_[_0x3d94('0x49')]({},_0x6190cc,_0x3f4b32[_0x3d94('0x4a')]);return db[_0x3d94('0x31')][_0x3d94('0x4b')](_0x6190cc)[_0x3d94('0x28')](handleEntityNotFound(_0x402132,null))[_0x3d94('0x28')](respondWithResult(_0x402132,null))[_0x3d94('0x4c')](handleError(_0x402132,null));};exports['destroy']=function(_0x44df82,_0x22e2b8){return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x44df82[_0x3d94('0x4d')]['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x22e2b8,null))[_0x3d94('0x28')](removeEntity(_0x22e2b8,null))[_0x3d94('0x4c')](handleError(_0x22e2b8,null));};exports[_0x3d94('0x4e')]=function(_0x5465a5,_0x88ec05){return db['VoicePrefix'][_0x3d94('0x4e')]()[_0x3d94('0x28')](respondWithResult(_0x88ec05,null))['catch'](handleError(_0x88ec05,null));};exports[_0x3d94('0x4f')]=function(_0x49f544,_0x567751){var _0x335247;return db['sequelize'][_0x3d94('0x50')](function(_0x132e0b){return db['VoicePrefix'][_0x3d94('0x4f')](_0x49f544['body'],{'transaction':_0x132e0b})['then'](function(_0x1a91d9){_0x335247=_0x1a91d9[_0x3d94('0x29')]({'plain':!![]});return db[_0x3d94('0x51')][_0x3d94('0x4b')]({'where':{'id':_0x335247[_0x3d94('0x52')]},'raw':!![]})[_0x3d94('0x28')](function(_0x137052){return createVoicePrefixExtensions(_0x335247,_0x137052,_0x132e0b);});});})[_0x3d94('0x28')](function(){var _0xae892=_0x49f544['user'][_0x3d94('0x29')]({'plain':!![]});if(!_0xae892)throw new Error(_0x3d94('0x53'));if(_0xae892[_0x3d94('0x54')]===_0x3d94('0x55')){var _0xe7d1dc=_0x335247;return db[_0x3d94('0x56')][_0x3d94('0x4b')]({'where':{'name':_0x3d94('0x2a'),'userProfileId':_0xae892[_0x3d94('0x57')]},'raw':!![]})[_0x3d94('0x28')](function(_0x1fd806){if(_0x1fd806&&_0x1fd806['autoAssociation']===0x0){return db[_0x3d94('0x2b')]['create']({'name':_0xe7d1dc[_0x3d94('0x2e')],'resourceId':_0xe7d1dc['id'],'type':_0x1fd806[_0x3d94('0x2e')],'sectionId':_0x1fd806['id']},{})[_0x3d94('0x28')](function(){return _0x335247;});}else{return _0x335247;}})[_0x3d94('0x4c')](function(_0x3a837b){logger[_0x3d94('0x2d')](_0x3d94('0x58'),_0x3a837b);throw _0x3a837b;});}return _0x335247;})[_0x3d94('0x28')](respondWithResult(_0x567751,null))[_0x3d94('0x4c')](handleError(_0x567751,null));};function Extension(_0x5da38c,_0x519ada,_0x46bff3,_0x4bd97c){this[_0x3d94('0x59')]=_0x3d94('0x5a');this['exten']=_0x5da38c;this[_0x3d94('0x5b')]=_0x46bff3;this[_0x3d94('0x33')]=_0x3d94('0x5c');this[_0x3d94('0x5d')]=_0x3d94('0x5e');this[_0x3d94('0x5f')]=_0x519ada;this[_0x3d94('0x60')]=_0x4bd97c;}function createVoicePrefixExtensions(_0x4b023e,_0x22dbf9,_0x351ea6){return new BPromise(function(_0x368581,_0x4b23b5){var _0x2d8b49=new Extension(formatPrefixName(_0x4b023e[_0x3d94('0x61')]),0x1,_0x3d94('0x62'),_0x3d94('0x63'));_0x2d8b49['VoicePrefixId']=_0x4b023e['id'];return db['VoiceExtension'][_0x3d94('0x4f')](_0x2d8b49,{'transaction':_0x351ea6})[_0x3d94('0x28')](function(_0x4190ef){var _0x3eaecc=_0x4190ef['get']({'plain':!![]});var _0x1c12da=_[_0x3d94('0x30')](addVoicePrefixExtensions(_0x4b023e,_0x22dbf9),function(_0x49bfb0){_0x49bfb0[_0x3d94('0x52')]=_0x3eaecc['id'];_0x49bfb0[_0x3d94('0x64')]=_0x4b023e['id'];return _0x49bfb0;});return db[_0x3d94('0x51')]['bulkCreate'](_0x1c12da,{'transaction':_0x351ea6})[_0x3d94('0x28')](function(_0x227372){if(!_0x227372){return _0x4b23b5(_0x3d94('0x65'));}else{return _0x368581(_0x227372);}})['catch'](function(_0x11eeaa){return _0x4b23b5(_0x11eeaa);});});;});};function addVoicePrefixExtensions(_0x68c033,_0x5c7aac){var _0x4d291e=[];var _0x4e1932=formatPrefixName(_0x68c033[_0x3d94('0x61')]);_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x2,_0x3d94('0x67'),_0x3d94('0x68')+_0x68c033[_0x3d94('0x2e')]));if(_0x68c033['callerIdAll']){_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x3,_0x3d94('0x67'),_0x3d94('0x69')+_0x68c033[_0x3d94('0x6a')]));}else{_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x3,_0x3d94('0x62'),'No\x20callerid\x20available'));}_0x4d291e[_0x3d94('0x66')](new Extension(_0x4e1932,0x4,'goto',_0x5c7aac[_0x3d94('0x59')]+','+_0x3d94('0x6b')+(0x8+_0x68c033[_0x3d94('0x2e')][_0x3d94('0x3c')])+'}'+','+0x1));return _0x4d291e;}function formatPrefixName(_0x128fdc){var _0x350ad3='_';for(var _0x48b108=0x0;_0x48b108<_0x128fdc['length'];_0x48b108++){if(_0x128fdc[_0x3d94('0x6c')](_0x48b108)=='-'){_0x350ad3+=_0x128fdc['charAt'](_0x48b108);}else{_0x350ad3+='['+_0x128fdc['charAt'](_0x48b108)+']';}}_0x350ad3+='.';return _0x350ad3;}exports['update']=function(_0x3c7dc4,_0x262a6a,_0x222963){var _0x396146=_0x3c7dc4[_0x3d94('0x6d')];_0x396146[_0x3d94('0x61')]=_0x3d94('0x6e')+_0x396146[_0x3d94('0x2e')]+'-';return db['sequelize'][_0x3d94('0x50')](function(_0x5e55a4){return db[_0x3d94('0x31')][_0x3d94('0x27')](_0x396146,{'where':{'id':_0x396146['id']},'transaction':_0x5e55a4})[_0x3d94('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x396146['id']},'transaction':_0x5e55a4})['then'](function(){return db[_0x3d94('0x51')][_0x3d94('0x4b')]({'where':{'id':_0x396146[_0x3d94('0x52')]},'raw':!![]})[_0x3d94('0x28')](function(_0x2382df){return createVoicePrefixExtensions(_0x396146,_0x2382df,_0x5e55a4);});});});})['then'](function(){return db['VoicePrefix'][_0x3d94('0x6f')](_0x396146['id']);})[_0x3d94('0x28')](respondWithResult(_0x262a6a,null))[_0x3d94('0x4c')](handleError(_0x262a6a,null));};exports['addAgents']=function(_0x46a9af,_0x53d471,_0x255d56){return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x46a9af[_0x3d94('0x4d')]['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x53d471,null))[_0x3d94('0x28')](function(_0x234bce){if(_0x234bce){return _0x234bce[_0x3d94('0x70')](_0x46a9af[_0x3d94('0x6d')][_0x3d94('0x71')],_[_0x3d94('0x72')](_0x46a9af[_0x3d94('0x6d')],[_0x3d94('0x71'),'id'])||{})['spread'](function(_0x2a6df3){for(var _0x2819e2=0x0;_0x2819e2<_0x46a9af[_0x3d94('0x6d')][_0x3d94('0x71')]['length'];_0x2819e2+=0x1){socket[_0x3d94('0x73')]('userVoicePrefix:save',{'UserId':Number(_0x46a9af['body'][_0x3d94('0x71')][_0x2819e2]),'VoicePrefixId':Number(_0x46a9af['params']['id'])});}return _0x2a6df3;});}})[_0x3d94('0x28')](respondWithResult(_0x53d471,null))[_0x3d94('0x4c')](handleError(_0x53d471,null));};exports['removeAgents']=function(_0x4558ff,_0x4acb44,_0x3b612f){return db[_0x3d94('0x31')]['find']({'where':{'id':_0x4558ff['params']['id']}})['then'](handleEntityNotFound(_0x4acb44,null))[_0x3d94('0x28')](function(_0x5b2dd6){if(_0x5b2dd6){return _0x5b2dd6['removeAgents'](_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')])[_0x3d94('0x28')](function(){if(_[_0x3d94('0x74')](_0x4558ff['query'][_0x3d94('0x71')])){for(var _0x3fc0e7=0x0;_0x3fc0e7<_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')][_0x3d94('0x3c')];_0x3fc0e7+=0x1){socket[_0x3d94('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')][_0x3fc0e7]),'VoicePrefixId':Number(_0x4558ff[_0x3d94('0x4d')]['id'])});}}else{socket[_0x3d94('0x73')](_0x3d94('0x75'),{'UserId':Number(_0x4558ff[_0x3d94('0x36')][_0x3d94('0x71')]),'VoicePrefixId':Number(_0x4558ff[_0x3d94('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x4acb44,null))['catch'](handleError(_0x4acb44,null));};exports[_0x3d94('0x76')]=function(_0x23b1a6,_0x970b44,_0x561e65){var _0x43a00e={};var _0xa193a1={};var _0x43192c;var _0xdb96c0;return db[_0x3d94('0x31')]['findOne']({'where':{'id':_0x23b1a6['params']['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x970b44,null))[_0x3d94('0x28')](function(_0x274a82){if(_0x274a82){_0x43192c=_0x274a82;_0xa193a1[_0x3d94('0x39')]=_[_0x3d94('0x35')](db[_0x3d94('0x77')][_0x3d94('0x48')]);_0xa193a1[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x23b1a6[_0x3d94('0x36')]);_0xa193a1[_0x3d94('0x37')]=_[_0x3d94('0x38')](_0xa193a1[_0x3d94('0x39')],_0xa193a1['query']);_0x43a00e[_0x3d94('0x3a')]=_[_0x3d94('0x38')](_0xa193a1['model'],qs['fields'](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x3b')]));_0x43a00e[_0x3d94('0x3a')]=_0x43a00e[_0x3d94('0x3a')]['length']?_0x43a00e['attributes']:_0xa193a1[_0x3d94('0x39')];_0x43a00e[_0x3d94('0x3f')]=qs[_0x3d94('0x40')](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x40')]);_0x43a00e['where']=qs[_0x3d94('0x37')](_['pick'](_0x23b1a6[_0x3d94('0x36')],_0xa193a1[_0x3d94('0x37')]));if(_0x23b1a6[_0x3d94('0x36')]['filter']){_0x43a00e[_0x3d94('0x41')]=_[_0x3d94('0x49')](_0x43a00e['where'],{'$or':_[_0x3d94('0x30')](_0x43a00e['attributes'],function(_0x3c62ec){var _0x401772={};_0x401772[_0x3c62ec]={'$like':'%'+_0x23b1a6[_0x3d94('0x36')]['filter']+'%'};return _0x401772;})});}_0x43a00e=_[_0x3d94('0x49')]({},_0x43a00e,_0x23b1a6[_0x3d94('0x4a')]);return _0x43192c[_0x3d94('0x76')](_0x43a00e);}})['then'](function(_0x3e091a){if(_0x3e091a){_0xdb96c0=_0x3e091a[_0x3d94('0x3c')];if(!_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0x43a00e[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x23b1a6[_0x3d94('0x36')]['limit']);_0x43a00e[_0x3d94('0x1e')]=qs[_0x3d94('0x1e')](_0x23b1a6[_0x3d94('0x36')][_0x3d94('0x1e')]);}return _0x43192c[_0x3d94('0x76')](_0x43a00e);}})[_0x3d94('0x28')](function(_0x5716fd){if(_0x5716fd){return _0x5716fd?{'count':_0xdb96c0,'rows':_0x5716fd}:null;}})[_0x3d94('0x28')](respondWithResult(_0x970b44,null))[_0x3d94('0x4c')](handleError(_0x970b44,null));};exports[_0x3d94('0x78')]=function(_0x59b62b,_0x3fc2f2,_0x4c6c49){var _0xe85875={};var _0x3ed74f={};var _0x490d77;var _0x73b09c;return db[_0x3d94('0x31')]['findOne']({'where':{'id':_0x59b62b['params']['id']}})[_0x3d94('0x28')](handleEntityNotFound(_0x3fc2f2,null))[_0x3d94('0x28')](function(_0x48a22f){if(_0x48a22f){_0x490d77=_0x48a22f;_0x3ed74f['model']=_['keys'](db[_0x3d94('0x79')][_0x3d94('0x48')]);_0x3ed74f[_0x3d94('0x36')]=_[_0x3d94('0x35')](_0x59b62b[_0x3d94('0x36')]);_0x3ed74f['filters']=_[_0x3d94('0x38')](_0x3ed74f[_0x3d94('0x39')],_0x3ed74f[_0x3d94('0x36')]);_0xe85875['attributes']=_[_0x3d94('0x38')](_0x3ed74f['model'],qs[_0x3d94('0x3b')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x3b')]));_0xe85875[_0x3d94('0x3a')]=_0xe85875[_0x3d94('0x3a')]['length']?_0xe85875['attributes']:_0x3ed74f[_0x3d94('0x39')];_0xe85875[_0x3d94('0x3f')]=qs['sort'](_0x59b62b[_0x3d94('0x36')]['sort']);_0xe85875[_0x3d94('0x41')]=qs[_0x3d94('0x37')](_[_0x3d94('0x42')](_0x59b62b['query'],_0x3ed74f[_0x3d94('0x37')]));if(_0x59b62b['query'][_0x3d94('0x43')]){_0xe85875[_0x3d94('0x41')]=_[_0x3d94('0x49')](_0xe85875[_0x3d94('0x41')],{'$or':_['map'](_0xe85875['attributes'],function(_0x11ff83){var _0x26e454={};_0x26e454[_0x11ff83]={'$like':'%'+_0x59b62b[_0x3d94('0x36')][_0x3d94('0x43')]+'%'};return _0x26e454;})});}_0xe85875=_['merge']({},_0xe85875,_0x59b62b[_0x3d94('0x4a')]);return _0x490d77['getTeams'](_0xe85875);}})['then'](function(_0x543b1a){if(_0x543b1a){_0x73b09c=_0x543b1a[_0x3d94('0x3c')];if(!_0x59b62b[_0x3d94('0x36')][_0x3d94('0x3d')](_0x3d94('0x3e'))){_0xe85875[_0x3d94('0x20')]=qs[_0x3d94('0x20')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x20')]);_0xe85875[_0x3d94('0x1e')]=qs[_0x3d94('0x1e')](_0x59b62b[_0x3d94('0x36')][_0x3d94('0x1e')]);}return _0x490d77[_0x3d94('0x78')](_0xe85875);}})[_0x3d94('0x28')](function(_0x140ad1){if(_0x140ad1){return _0x140ad1?{'count':_0x73b09c,'rows':_0x140ad1}:null;}})['then'](respondWithResult(_0x3fc2f2,null))['catch'](handleError(_0x3fc2f2,null));};exports[_0x3d94('0x7a')]=function(_0x3ff668,_0x1837c9,_0x41251d){var _0x876bcc=_0x3ff668[_0x3d94('0x6d')][_0x3d94('0x71')];var _0x47ab6a;return db[_0x3d94('0x79')][_0x3d94('0x47')]({'where':{'id':_0x876bcc},'attributes':['id'],'include':[{'model':db[_0x3d94('0x77')],'as':_0x3d94('0x7b'),'attributes':['id',_0x3d94('0x2e'),_0x3d94('0x7c'),'voicePause','interface'],'raw':!![]}]})[_0x3d94('0x28')](function(_0x50e8ba){if(_0x50e8ba){_0x47ab6a=_0x50e8ba;var _0x248fbe=_[_0x3d94('0x7d')](_0x50e8ba,function(_0x350751){var _0x16853d=_0x350751[_0x3d94('0x29')]({'plain':!![]});return _0x16853d[_0x3d94('0x7b')];});return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x3ff668['params']['id']}})[_0x3d94('0x28')](function(_0x2c8a2f){return db[_0x3d94('0x7e')][_0x3d94('0x50')](function(_0x22e7ff){return _0x2c8a2f[_0x3d94('0x7a')](_0x876bcc,{'transaction':_0x22e7ff})[_0x3d94('0x28')](function(){return BPromise[_0x3d94('0x7f')](_0x47ab6a,function(_0x1c7315){return db[_0x3d94('0x80')][_0x3d94('0x81')]({'TeamId':_0x1c7315['id'],'VoicePrefixId':_0x3ff668[_0x3d94('0x4d')]['id']},{'transaction':_0x22e7ff});});})[_0x3d94('0x28')](function(){return BPromise[_0x3d94('0x7f')](_0x248fbe,function(_0x2d02db){return db[_0x3d94('0x82')][_0x3d94('0x83')]({'where':{'UserId':_0x2d02db['id'],'VoicePrefixId':_0x3ff668[_0x3d94('0x4d')]['id']},'transaction':_0x22e7ff});});})[_0x3d94('0x28')](function(){_0x248fbe[_0x3d94('0x84')](function(_0xb55889){socket['emit'](_0x3d94('0x85'),{'UserId':_0xb55889['id'],'VoicePrefixId':_0x2c8a2f['id']});});});});});}})[_0x3d94('0x28')](respondWithStatusCode(_0x1837c9,null))[_0x3d94('0x4c')](handleError(_0x1837c9,null));};exports[_0x3d94('0x86')]=function(_0x434b19,_0x185592,_0x594800){return db[_0x3d94('0x79')][_0x3d94('0x47')]({'where':{'id':_0x434b19[_0x3d94('0x36')][_0x3d94('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3d94('0x77')],'as':_0x3d94('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x185592,null))[_0x3d94('0x28')](function(_0x4ff1a0){var _0x577fd0=_['map'](_0x4ff1a0,'id');var _0x4a1faa=[];var _0x3e1139=[];var _0x77b79d=squel[_0x3d94('0x87')]();_0x77b79d[_0x3d94('0x88')](_0x3d94('0x89'))['from'](_0x3d94('0x8a'),'tq')[_0x3d94('0x8b')](_0x3d94('0x8c'),'ut',_0x3d94('0x8d'))[_0x3d94('0x41')](_0x3d94('0x8e'),_0x434b19['params']['id']);for(var _0x167d4c=0x0;_0x167d4c<_0x4ff1a0['length'];_0x167d4c+=0x1){let _0x219757=_0x4ff1a0[_0x167d4c];for(var _0xb970e1=0x0;_0xb970e1<_0x219757[_0x3d94('0x7b')][_0x3d94('0x3c')];_0xb970e1+=0x1){let _0x5df8b4=_0x219757[_0x3d94('0x7b')][_0xb970e1];var _0x2e409b=_0x77b79d[_0x3d94('0x8f')]();_0x2e409b[_0x3d94('0x41')]('ut.UserId\x20=\x20?',_0x5df8b4['id']);_0x3e1139['push'](db[_0x3d94('0x7e')][_0x3d94('0x36')](_0x2e409b[_0x3d94('0x90')](),{'type':db['sequelize'][_0x3d94('0x91')]['SELECT']})['then'](function(_0x560fdf){if(_0x560fdf[_0x3d94('0x3c')]===0x1){return _0x5df8b4['id'];}else{var _0x4ae177=_[_0x3d94('0x92')](_[_0x3d94('0x30')](_0x560fdf,_0x3d94('0x93')),function(_0x5ed8e8){return _[_0x3d94('0x94')](_0x577fd0,_0x5ed8e8);});if(_0x4ae177){return _0x5df8b4['id'];}}}));}}return BPromise[_0x3d94('0x95')](_0x3e1139)['then'](function(_0x551002){_0x4a1faa=_(_0x4a1faa)[_0x3d94('0x96')](_0x551002)[_0x3d94('0x97')]()[_0x3d94('0x98')]();return db[_0x3d94('0x31')][_0x3d94('0x4b')]({'where':{'id':_0x434b19[_0x3d94('0x4d')]['id']}})['then'](function(_0x54651a){return db['sequelize']['transaction'](function(_0x3c736a){return _0x54651a[_0x3d94('0x86')](_0x434b19[_0x3d94('0x36')][_0x3d94('0x71')],{'transaction':_0x3c736a})[_0x3d94('0x28')](function(){if(!_[_0x3d94('0x99')](_0x4a1faa)){return _0x54651a[_0x3d94('0x9a')](_0x4a1faa,{'transaction':_0x3c736a});}})[_0x3d94('0x28')](function(){_0x4a1faa[_0x3d94('0x84')](function(_0x414b82){socket[_0x3d94('0x73')]('userVoicePrefix:remove',{'UserId':_0x414b82,'VoicePrefixId':_0x54651a['id']});});});});});});})[_0x3d94('0x28')](respondWithStatusCode(_0x185592,null))['catch'](handleError(_0x185592,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 07bb58c..7581188 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 _0x4aa0=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2842c6,_0x407235){var _0x406000=function(_0x101ac9){while(--_0x101ac9){_0x2842c6['push'](_0x2842c6['shift']());}};_0x406000(++_0x407235);}(_0x4aa0,0x1c2));var _0x04aa=function(_0xf188ce,_0x142e1e){_0xf188ce=_0xf188ce-0x0;var _0x550f88=_0x4aa0[_0xf188ce];return _0x550f88;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x04aa('0x0'))['db'][_0x04aa('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x04aa('0x2')](0x0);var events={'afterCreate':_0x04aa('0x3'),'afterUpdate':_0x04aa('0x4'),'afterDestroy':_0x04aa('0x5')};function emitEvent(_0x48707f){return function(_0xcf71e7,_0x29875d,_0x376ab){VoicePrefixEvents[_0x04aa('0x6')](_0x48707f+':'+_0xcf71e7['id'],_0xcf71e7);VoicePrefixEvents[_0x04aa('0x6')](_0x48707f,_0xcf71e7);_0x376ab(null);};}for(var e in events){if(events[_0x04aa('0x7')](e)){var event=events[e];VoicePrefix[_0x04aa('0x8')](e,emitEvent(event));}}module[_0x04aa('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x174d=['emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','save','update','remove'];(function(_0x6f3151,_0x406745){var _0x305fb8=function(_0x24e5a8){while(--_0x24e5a8){_0x6f3151['push'](_0x6f3151['shift']());}};_0x305fb8(++_0x406745);}(_0x174d,0x1e0));var _0xd174=function(_0x21f457,_0x236b16){_0x21f457=_0x21f457-0x0;var _0x179f47=_0x174d[_0x21f457];return _0x179f47;};'use strict';var EventEmitter=require(_0xd174('0x0'));var VoicePrefix=require(_0xd174('0x1'))['db'][_0xd174('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd174('0x3'),'afterUpdate':_0xd174('0x4'),'afterDestroy':_0xd174('0x5')};function emitEvent(_0x2b85a9){return function(_0x3c3267,_0xb92049,_0x5036e0){VoicePrefixEvents[_0xd174('0x6')](_0x2b85a9+':'+_0x3c3267['id'],_0x3c3267);VoicePrefixEvents[_0xd174('0x6')](_0x2b85a9,_0x3c3267);_0x5036e0(null);};}for(var e in events){if(events[_0xd174('0x7')](e)){var event=events[e];VoicePrefix[_0xd174('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 5c4b4ce..a449b85 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 _0x1940=['request-promise','path','rimraf','./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x47b5c3,_0x51619d){var _0x51c28d=function(_0x4329de){while(--_0x4329de){_0x47b5c3['push'](_0x47b5c3['shift']());}};_0x51c28d(++_0x51619d);}(_0x1940,0x10b));var _0x0194=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x1940[_0x4ec520];return _0xed49d7;};'use strict';var _=require(_0x0194('0x0'));var util=require(_0x0194('0x1'));var logger=require(_0x0194('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0194('0x3'));var fs=require('fs');var path=require(_0x0194('0x4'));var rimraf=require(_0x0194('0x5'));var config=require('../../config/environment');var attributes=require(_0x0194('0x6'));module['exports']=function(_0x4cef56,_0x22475d){return _0x4cef56[_0x0194('0x7')]('VoicePrefix',attributes,{'tableName':_0x0194('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1da2=['util','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x55422c,_0x2dc114){var _0x4c1e5a=function(_0x169e4d){while(--_0x169e4d){_0x55422c['push'](_0x55422c['shift']());}};_0x4c1e5a(++_0x2dc114);}(_0x1da2,0x1ee));var _0x21da=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1da2[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x21da('0x0'));var util=require(_0x21da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x21da('0x2'));var BPromise=require('bluebird');var rp=require(_0x21da('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21da('0x4'));var config=require(_0x21da('0x5'));var attributes=require(_0x21da('0x6'));module[_0x21da('0x7')]=function(_0x5818cc,_0x6f0e3){return _0x5818cc[_0x21da('0x8')](_0x21da('0x9'),attributes,{'tableName':_0x21da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6f03266..5e02f89 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 _0xf470=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x42b428,_0x4346d9){var _0x3128df=function(_0x4fa6b4){while(--_0x4fa6b4){_0x42b428['push'](_0x42b428['shift']());}};_0x3128df(++_0x4346d9);}(_0xf470,0xfd));var _0x0f47=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf470[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f47('0x6'));var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});config[_0x0f47('0xc')]=_[_0x0f47('0xd')](config[_0x0f47('0xc')],{'host':_0x0f47('0xe'),'port':0x18eb});var socket=require(_0x0f47('0xf'))(new Redis(config[_0x0f47('0xc')]));require(_0x0f47('0x10'))[_0x0f47('0x11')](socket);function respondWithRpcPromise(_0x6900a,_0x2256e5,_0x440449){return new BPromise(function(_0x2196d2,_0x3a78c8){return client[_0x0f47('0x12')](_0x6900a,_0x440449)[_0x0f47('0x13')](function(_0x4bfa8f){logger[_0x0f47('0x14')](_0x0f47('0x15'),_0x2256e5,_0x0f47('0x16'));logger[_0x0f47('0x17')](_0x0f47('0x18'),_0x2256e5,'request\x20sent',JSON['stringify'](_0x4bfa8f));if(_0x4bfa8f[_0x0f47('0x19')]){if(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1a')]===0x1f4){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f['error'][_0x0f47('0x1b')]);return _0x3a78c8(_0x4bfa8f['error']['message']);}logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);return _0x2196d2(_0x4bfa8f[_0x0f47('0x19')][_0x0f47('0x1b')]);}else{logger[_0x0f47('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x2256e5,_0x0f47('0x16'));_0x2196d2(_0x4bfa8f[_0x0f47('0x1c')]['message']);}})[_0x0f47('0x1d')](function(_0x2e2f35){logger[_0x0f47('0x19')](_0x0f47('0x15'),_0x2256e5,_0x2e2f35);_0x3a78c8(_0x2e2f35);});});} \ No newline at end of file +var _0x3e94=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x35ebbb,_0xe862ef){var _0x29d9b=function(_0x4fee98){while(--_0x4fee98){_0x35ebbb['push'](_0x35ebbb['shift']());}};_0x29d9b(++_0xe862ef);}(_0x3e94,0x67));var _0x43e9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3e94[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});config['redis']=_[_0x43e9('0xa')](config[_0x43e9('0xb')],{'host':_0x43e9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43e9('0xb')]));require(_0x43e9('0xd'))[_0x43e9('0xe')](socket);function respondWithRpcPromise(_0x208244,_0x3d2694,_0x169e98){return new BPromise(function(_0x437e1d,_0x3c3ee3){return client[_0x43e9('0xf')](_0x208244,_0x169e98)['then'](function(_0x367956){logger[_0x43e9('0x10')](_0x43e9('0x11'),_0x3d2694,'request\x20sent');logger[_0x43e9('0x12')](_0x43e9('0x13'),_0x3d2694,_0x43e9('0x14'),JSON[_0x43e9('0x15')](_0x367956));if(_0x367956[_0x43e9('0x16')]){if(_0x367956['error']['code']===0x1f4){logger[_0x43e9('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3d2694,_0x367956[_0x43e9('0x16')][_0x43e9('0x17')]);return _0x3c3ee3(_0x367956[_0x43e9('0x16')][_0x43e9('0x17')]);}logger[_0x43e9('0x16')](_0x43e9('0x11'),_0x3d2694,_0x367956[_0x43e9('0x16')][_0x43e9('0x17')]);return _0x437e1d(_0x367956[_0x43e9('0x16')][_0x43e9('0x17')]);}else{logger[_0x43e9('0x10')](_0x43e9('0x11'),_0x3d2694,_0x43e9('0x14'));_0x437e1d(_0x367956[_0x43e9('0x18')]['message']);}})['catch'](function(_0x38b426){logger[_0x43e9('0x16')](_0x43e9('0x11'),_0x3d2694,_0x38b426);_0x3c3ee3(_0x38b426);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index eda7f6f..012b0db 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 _0x949d=['./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x949d,0x162));var _0xd949=function(_0x1716dc,_0x2d61ab){_0x1716dc=_0x1716dc-0x0;var _0x1694cb=_0x949d[_0x1716dc];return _0x1694cb;};'use strict';var VoicePrefixEvents=require(_0xd949('0x0'));var events=[_0xd949('0x1'),_0xd949('0x2'),_0xd949('0x3')];function createListener(_0x59c4ae,_0x5c5854){return function(_0x2024d0){_0x5c5854[_0xd949('0x4')](_0x59c4ae,_0x2024d0);};}function removeListener(_0x596628,_0x2768a3){return function(){VoicePrefixEvents[_0xd949('0x5')](_0x596628,_0x2768a3);};}exports['register']=function(_0x3d2be5){for(var _0x416d5e=0x0,_0x6e8175=events['length'];_0x416d5e<_0x6e8175;_0x416d5e++){var _0x208942=events[_0x416d5e];var _0x158cc2=createListener('voicePrefix:'+_0x208942,_0x3d2be5);VoicePrefixEvents['on'](_0x208942,_0x158cc2);}}; \ No newline at end of file +var _0xee11=['length','./voicePrefix.events','update','emit','removeListener'];(function(_0x5481d2,_0x12ecb2){var _0x419f55=function(_0xd864b8){while(--_0xd864b8){_0x5481d2['push'](_0x5481d2['shift']());}};_0x419f55(++_0x12ecb2);}(_0xee11,0x146));var _0x1ee1=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xee11[_0x3f94f9];return _0x46f84f;};'use strict';var VoicePrefixEvents=require(_0x1ee1('0x0'));var events=['save','remove',_0x1ee1('0x1')];function createListener(_0x1a6844,_0x3a1711){return function(_0x1eb386){_0x3a1711[_0x1ee1('0x2')](_0x1a6844,_0x1eb386);};}function removeListener(_0x14d420,_0x3eb96f){return function(){VoicePrefixEvents[_0x1ee1('0x3')](_0x14d420,_0x3eb96f);};}exports['register']=function(_0x1322a7){for(var _0x6be72f=0x0,_0x3fdb3b=events[_0x1ee1('0x4')];_0x6be72f<_0x3fdb3b;_0x6be72f++){var _0x356919=events[_0x6be72f];var _0x47f984=createListener('voicePrefix:'+_0x356919,_0x1322a7);VoicePrefixEvents['on'](_0x356919,_0x47f984);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 53fb950..e790f87 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 _0xd301=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/lists','/:id/blacklists','post','create','/:id/users','addAgents','addBlackLists','put','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists'];(function(_0x19d24e,_0x48638d){var _0x28c4f2=function(_0x48972d){while(--_0x48972d){_0x19d24e['push'](_0x19d24e['shift']());}};_0x28c4f2(++_0x48638d);}(_0xd301,0x104));var _0x1d30=function(_0x120bc0,_0x40e780){_0x120bc0=_0x120bc0-0x0;var _0x49d52a=_0xd301[_0x120bc0];return _0x49d52a;};'use strict';var multer=require(_0x1d30('0x0'));var util=require('util');var path=require(_0x1d30('0x1'));var timeout=require(_0x1d30('0x2'));var express=require('express');var router=express[_0x1d30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1d30('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1d30('0x5'));var controller=require(_0x1d30('0x6'));router[_0x1d30('0x7')]('/',auth[_0x1d30('0x8')](),controller[_0x1d30('0x9')]);router['get'](_0x1d30('0xa'),auth[_0x1d30('0x8')](),controller[_0x1d30('0xb')]);router[_0x1d30('0x7')](_0x1d30('0xc'),auth['isAuthenticated'](),controller[_0x1d30('0xd')]);router[_0x1d30('0x7')](_0x1d30('0xe'),auth[_0x1d30('0x8')](),controller[_0x1d30('0xf')]);router[_0x1d30('0x7')](_0x1d30('0x10'),auth[_0x1d30('0x8')](),controller['getHopperFinals']);router['get'](_0x1d30('0x11'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x12')]);router[_0x1d30('0x7')](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x14')]);router['get']('/:id/users',auth[_0x1d30('0x8')](),controller[_0x1d30('0x15')]);router[_0x1d30('0x7')]('/:id/members',auth[_0x1d30('0x8')](),controller['getMembers']);router[_0x1d30('0x7')](_0x1d30('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0x1d30('0x7')](_0x1d30('0x17'),auth[_0x1d30('0x8')](),controller['getBlackLists']);router[_0x1d30('0x18')]('/',auth[_0x1d30('0x8')](),controller[_0x1d30('0x19')]);router[_0x1d30('0x18')]('/:id/clone',auth[_0x1d30('0x8')](),controller['clone']);router[_0x1d30('0x18')](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller['addTeams']);router[_0x1d30('0x18')](_0x1d30('0x1a'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x1b')]);router[_0x1d30('0x18')](_0x1d30('0x16'),auth[_0x1d30('0x8')](),controller['addLists']);router[_0x1d30('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x1d30('0x1c')]);router[_0x1d30('0x1d')]('/:id',auth[_0x1d30('0x8')](),controller[_0x1d30('0x1e')]);router[_0x1d30('0x1f')](_0x1d30('0xa'),auth[_0x1d30('0x8')](),controller['destroy']);router['delete'](_0x1d30('0x13'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x20')]);router[_0x1d30('0x1f')](_0x1d30('0x1a'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x21')]);router[_0x1d30('0x1f')](_0x1d30('0x16'),auth['isAuthenticated'](),controller[_0x1d30('0x22')]);router[_0x1d30('0x1f')](_0x1d30('0x17'),auth[_0x1d30('0x8')](),controller[_0x1d30('0x23')]);module[_0x1d30('0x24')]=router; \ No newline at end of file +var _0xaa08=['addAgents','/:id/lists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','/:id/blacklists','removeBlackLists','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getBlackLists','post','create','/:id/clone','clone'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xaa08,0x15b));var _0x8aa0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa08[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8aa0('0x0'));var path=require(_0x8aa0('0x1'));var timeout=require(_0x8aa0('0x2'));var express=require(_0x8aa0('0x3'));var router=express[_0x8aa0('0x4')]();var fs_extra=require(_0x8aa0('0x5'));var auth=require(_0x8aa0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8aa0('0x7'));var controller=require(_0x8aa0('0x8'));router[_0x8aa0('0x9')]('/',auth[_0x8aa0('0xa')](),controller[_0x8aa0('0xb')]);router[_0x8aa0('0x9')](_0x8aa0('0xc'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0xd')]);router[_0x8aa0('0x9')](_0x8aa0('0xe'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0xf')]);router['get'](_0x8aa0('0x10'),auth['isAuthenticated'](),controller[_0x8aa0('0x11')]);router[_0x8aa0('0x9')](_0x8aa0('0x12'),auth[_0x8aa0('0xa')](),controller['getHopperFinals']);router[_0x8aa0('0x9')](_0x8aa0('0x13'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x14')]);router['get'](_0x8aa0('0x15'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x16')]);router[_0x8aa0('0x9')](_0x8aa0('0x17'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x18')]);router[_0x8aa0('0x9')](_0x8aa0('0x19'),auth[_0x8aa0('0xa')](),controller['getMembers']);router[_0x8aa0('0x9')]('/:id/lists',auth[_0x8aa0('0xa')](),controller['getLists']);router[_0x8aa0('0x9')]('/:id/blacklists',auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x1a')]);router[_0x8aa0('0x1b')]('/',auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x1c')]);router['post'](_0x8aa0('0x1d'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x1e')]);router[_0x8aa0('0x1b')](_0x8aa0('0x15'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x8aa0('0x17'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x1f')]);router[_0x8aa0('0x1b')](_0x8aa0('0x20'),auth['isAuthenticated'](),controller['addLists']);router[_0x8aa0('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8aa0('0x21')]);router[_0x8aa0('0x22')](_0x8aa0('0xc'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x23')]);router[_0x8aa0('0x24')]('/:id',auth['isAuthenticated'](),controller[_0x8aa0('0x25')]);router[_0x8aa0('0x24')](_0x8aa0('0x15'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x26')]);router['delete'](_0x8aa0('0x17'),auth['isAuthenticated'](),controller[_0x8aa0('0x27')]);router[_0x8aa0('0x24')](_0x8aa0('0x20'),auth[_0x8aa0('0xa')](),controller['removeLists']);router[_0x8aa0('0x24')](_0x8aa0('0x28'),auth[_0x8aa0('0xa')](),controller[_0x8aa0('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 403f56a..5d4cfa3 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 _0xa1a5=['Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','INTEGER','yes','all','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime'];(function(_0x41b44b,_0x708978){var _0x39b73e=function(_0x130485){while(--_0x130485){_0x41b44b['push'](_0x41b44b['shift']());}};_0x39b73e(++_0x708978);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x4073be,_0x373d69){_0x4073be=_0x4073be-0x0;var _0x538318=_0xa1a5[_0x4073be];return _0x538318;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':![],'unique':_0x5a1a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x4'),_0x5a1a('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':_0x5a1a('0x6')},'announce':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5a1a('0x3')]('rr',_0x5a1a('0x7'),_0x5a1a('0x8'),_0x5a1a('0x9'),'random',_0x5a1a('0xa'),_0x5a1a('0xb'),_0x5a1a('0xc'),_0x5a1a('0xd')),'allowNull':![],'defaultValue':_0x5a1a('0x7'),'set':function(_0x1c9374){this[_0x5a1a('0xe')](_0x5a1a('0xf'),_0x1c9374?_0x1c9374:_0x5a1a('0xa'));},'get':function(){var _0x57c5ca=this[_0x5a1a('0x10')](_0x5a1a('0x11'));var _0x1474c2=this['getDataValue'](_0x5a1a('0x12'));var _0x4b6e4c=this['getDataValue']('strategy');if(_0x57c5ca===_0x5a1a('0x4')){return _0x4b6e4c;}if(_0x1474c2===_0x5a1a('0x13')&&_0x4b6e4c===_0x5a1a('0xa')||_0x1474c2===_0x5a1a('0x13')&&_0x4b6e4c==='roundrobin'){return _0x4b6e4c;}if(_0x1474c2===_0x5a1a('0x14')||_0x1474c2===_0x5a1a('0x15')||_0x1474c2==='power'){return _0x4b6e4c;}return null;}},'servicelevel':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5a1a('0x1')]},'weight':{'type':Sequelize[_0x5a1a('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':_0x5a1a('0x17')},'autopause':{'type':Sequelize[_0x5a1a('0x3')]('yes','no',_0x5a1a('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x5a1a('0x17'),'no'),'defaultValue':_0x5a1a('0x17')},'announce_holdtime':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x5a1a('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5a1a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5a1a('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5a1a('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5a1a('0x1')]},'periodic_announce':{'type':Sequelize[_0x5a1a('0x19')],'set':function(_0x1af6d4){this[_0x5a1a('0xe')]('periodic_announce',_0x1af6d4?_0x1af6d4[_0x5a1a('0x1a')](','):[]);},'get':function(){return this[_0x5a1a('0x10')]('periodic_announce')?this['getDataValue'](_0x5a1a('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5a1a('0x17'),'set':function(_0x18cfd6){this['setDataValue']('joinempty',_0x18cfd6?_0x18cfd6['join'](','):undefined);},'get':function(){return this[_0x5a1a('0x10')](_0x5a1a('0x1c'))?this['getDataValue']('joinempty')[_0x5a1a('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xd836a8){this[_0x5a1a('0xe')]('leavewhenempty',_0xd836a8?_0xd836a8[_0x5a1a('0x1a')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x5a1a('0x10')](_0x5a1a('0x1e'))[_0x5a1a('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5a1a('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5a1a('0x1')]},'description':{'type':Sequelize[_0x5a1a('0x1')]},'acw':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'set':function(_0x541e20){this['setDataValue'](_0x5a1a('0x20'),_0x541e20);if(_0x541e20){if(this[_0x5a1a('0x10')](_0x5a1a('0x21'))<0x2){this[_0x5a1a('0xe')](_0x5a1a('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5a1a('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x22')},'dialMethod':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x23'),_0x5a1a('0x14'),_0x5a1a('0x24'),_0x5a1a('0x15'),'booked'),'defaultValue':'progressive','comment':_0x5a1a('0x25')},'dialLimitChannel':{'type':Sequelize[_0x5a1a('0x16')](0x4)[_0x5a1a('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a1a('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5a1a('0x28')},'dialPowerLevel':{'type':Sequelize[_0x5a1a('0x29')](0x2)[_0x5a1a('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x5a1a('0x3')](_0x5a1a('0x2a'),_0x5a1a('0x2b')),'defaultValue':_0x5a1a('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5a1a('0x29')](0x2)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5a1a('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5a1a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':_0x5a1a('0x2d'),'comment':_0x5a1a('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x2f')},'dialQueueProject':{'type':Sequelize[_0x5a1a('0x1')],'comment':_0x5a1a('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'comment':_0x5a1a('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5a1a('0x37')},'dialTimezone':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5a1a('0x38'),_0x5a1a('0x39'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5a1a('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5a1a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5a1a('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5a1a('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5a1a('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5a1a('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5a1a('0x16')](0x9)[_0x5a1a('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5a1a('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':0x0,'comment':_0x5a1a('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5a1a('0x40'),_0x5a1a('0x41')),'defaultValue':_0x5a1a('0x40')},'dialQueueProject2':{'type':Sequelize[_0x5a1a('0x1')],'comment':_0x5a1a('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5a1a('0x42')},'dialCutDigit':{'type':Sequelize[_0x5a1a('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x5a1a('0x16')](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5a1a('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5a1a('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5a1a('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a1a('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5a1a('0x1f')],'defaultValue':![],'comment':_0x5a1a('0x4c'),'set':function(_0x5e4288){if(!_0x5e4288)this[_0x5a1a('0xe')](_0x5a1a('0x4d'),null);this['setDataValue'](_0x5a1a('0x4e'),_0x5e4288);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x3)[_0x5a1a('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5a1a('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xecd9=['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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','booked','roundrobin','progressive','power','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xecd9,0x13f));var _0x9ecd=function(_0x1794ea,_0x2a5b0d){_0x1794ea=_0x1794ea-0x0;var _0x4ae858=_0xecd9[_0x1794ea];return _0x4ae858;};'use strict';var Sequelize=require(_0x9ecd('0x0'));module[_0x9ecd('0x1')]={'name':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![],'unique':_0x9ecd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x5'),_0x9ecd('0x6')),'allowNull':![],'defaultValue':_0x9ecd('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x9ecd('0x7')},'announce':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9ecd('0x4')]('rr',_0x9ecd('0x8'),_0x9ecd('0x9'),'fewestcalls',_0x9ecd('0xa'),_0x9ecd('0xb'),_0x9ecd('0xc'),_0x9ecd('0xd'),_0x9ecd('0xe')),'allowNull':![],'defaultValue':_0x9ecd('0x8'),'set':function(_0x1e3084){this[_0x9ecd('0xf')](_0x9ecd('0x10'),_0x1e3084?_0x1e3084:_0x9ecd('0xb'));},'get':function(){var _0x1c642a=this[_0x9ecd('0x11')]('type');var _0x59c417=this[_0x9ecd('0x11')]('dialMethod');var _0x2684b8=this[_0x9ecd('0x11')](_0x9ecd('0x10'));if(_0x1c642a===_0x9ecd('0x5')){return _0x2684b8;}if(_0x59c417==='booked'&&_0x2684b8===_0x9ecd('0xb')||_0x59c417===_0x9ecd('0x12')&&_0x2684b8===_0x9ecd('0x13')){return _0x2684b8;}if(_0x59c417===_0x9ecd('0x14')||_0x59c417==='predictive'||_0x59c417===_0x9ecd('0x15')){return _0x2684b8;}return null;}},'servicelevel':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9ecd('0x2')]},'weight':{'type':Sequelize[_0x9ecd('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x9ecd('0x17'),'no'),'defaultValue':_0x9ecd('0x17')},'autopause':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no',_0x9ecd('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9ecd('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9ecd('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x9ecd('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9ecd('0x2')]},'queue_quantity1':{'type':Sequelize[_0x9ecd('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x9ecd('0x2')]},'queue_less_than':{'type':Sequelize[_0x9ecd('0x2')]},'periodic_announce':{'type':Sequelize[_0x9ecd('0x19')],'set':function(_0x4c6401){this[_0x9ecd('0xf')](_0x9ecd('0x1a'),_0x4c6401?_0x4c6401[_0x9ecd('0x1b')](','):[]);},'get':function(){return this[_0x9ecd('0x11')]('periodic_announce')?this['getDataValue'](_0x9ecd('0x1a'))[_0x9ecd('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':'yes','set':function(_0x35e9b6){this['setDataValue'](_0x9ecd('0x1d'),_0x35e9b6?_0x35e9b6['join'](','):undefined);},'get':function(){return this[_0x9ecd('0x11')](_0x9ecd('0x1d'))?this['getDataValue']('joinempty')[_0x9ecd('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1b5383){this[_0x9ecd('0xf')]('leavewhenempty',_0x1b5383?_0x1b5383['join'](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x9ecd('0x11')](_0x9ecd('0x1e'))[_0x9ecd('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9ecd('0x2')]},'description':{'type':Sequelize[_0x9ecd('0x2')]},'acw':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':0x0,'set':function(_0x50aafb){this['setDataValue'](_0x9ecd('0x20'),_0x50aafb);if(_0x50aafb){if(this['getDataValue'](_0x9ecd('0x21'))<0x2){this[_0x9ecd('0xf')](_0x9ecd('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9ecd('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x22'),_0x9ecd('0x14'),_0x9ecd('0x15'),_0x9ecd('0x23'),_0x9ecd('0x12')),'defaultValue':_0x9ecd('0x14'),'comment':_0x9ecd('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9ecd('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9ecd('0x25')},'dialLimitQueue':{'type':Sequelize[_0x9ecd('0x16')](0x4)[_0x9ecd('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x9ecd('0x27')](0x2)[_0x9ecd('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9ecd('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x9ecd('0x4')]('agentBusyFactor',_0x9ecd('0x29')),'defaultValue':_0x9ecd('0x29'),'comment':_0x9ecd('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9ecd('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9ecd('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x9ecd('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x9ecd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9ecd('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':'tTxX','comment':_0x9ecd('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x2e')},'dialQueueProject':{'type':Sequelize[_0x9ecd('0x2')],'comment':_0x9ecd('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x9ecd('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9ecd('0x35')},'dialPrefix':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9ecd('0x36'),_0x9ecd('0x37'),'onlyIfOpen'),'defaultValue':_0x9ecd('0x36')},'dialAMDActive':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9ecd('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9ecd('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9ecd('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9ecd('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9ecd('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9ecd('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9ecd('0x3a')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9ecd('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9ecd('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9ecd('0x16')](0x9)[_0x9ecd('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9ecd('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9ecd('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9ecd('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9ecd('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9ecd('0x16')](0x9)[_0x9ecd('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9ecd('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9ecd('0x4')](_0x9ecd('0x3f'),_0x9ecd('0x40')),'defaultValue':_0x9ecd('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x9ecd('0x2')],'comment':_0x9ecd('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9ecd('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9ecd('0x41')},'dialCutDigit':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9ecd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ecd('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9ecd('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ecd('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9ecd('0x16')](0x5)[_0x9ecd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x9ecd('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9ecd('0x4c'),'set':function(_0x394aaa){if(!_0x394aaa)this[_0x9ecd('0xf')](_0x9ecd('0x4d'),null);this[_0x9ecd('0xf')]('mandatoryDisposition',_0x394aaa);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9ecd('0x16')](0x3)[_0x9ecd('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 10036d3..d916bb5 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 _0x23e3=['isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','UserVoiceQueueRt','all','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','field','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','inbound','outbound','ignore','value','includes','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','index','map','VoiceQueue','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','order','where','filters','filter','merge','options','include','show','keys','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','params','omit','createdAt','updatedAt','VoiceQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','hasOwnProperty','sort','pick','VoiceQueueId','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','removeTeams','ids','select','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact'];(function(_0x2fa355,_0x2345ec){var _0x1b7887=function(_0x144383){while(--_0x144383){_0x2fa355['push'](_0x2fa355['shift']());}};_0x1b7887(++_0x2345ec);}(_0x23e3,0x19b));var _0x323e=function(_0x2e0d08,_0x4fb8a8){_0x2e0d08=_0x2e0d08-0x0;var _0x556593=_0x23e3[_0x2e0d08];return _0x556593;};'use strict';var emlformat=require(_0x323e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323e('0x1'));var rp=require(_0x323e('0x2'));var moment=require(_0x323e('0x3'));var BPromise=require(_0x323e('0x4'));var Mustache=require(_0x323e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x323e('0x6'));var csv=require(_0x323e('0x7'));var ejs=require(_0x323e('0x8'));var fs=require('fs');var fs_extra=require(_0x323e('0x9'));var _=require(_0x323e('0xa'));var squel=require(_0x323e('0xb'));var crypto=require(_0x323e('0xc'));var jsforce=require(_0x323e('0xd'));var deskjs=require(_0x323e('0xe'));var toCsv=require(_0x323e('0x7'));var querystring=require(_0x323e('0xf'));var Papa=require(_0x323e('0x10'));var Redis=require(_0x323e('0x11'));var authService=require(_0x323e('0x12'));var qs=require(_0x323e('0x13'));var as=require(_0x323e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x323e('0x15'))('api');var utils=require(_0x323e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x323e('0x17'));var db=require(_0x323e('0x18'))['db'];config[_0x323e('0x19')]=_[_0x323e('0x1a')](config[_0x323e('0x19')],{'host':_0x323e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x323e('0x19')]));require(_0x323e('0x1c'))[_0x323e('0x1d')](socket);function respondWithStatusCode(_0x4a4ecd,_0x175721){_0x175721=_0x175721||0xcc;return function(_0x203763){if(_0x203763){return _0x4a4ecd['sendStatus'](_0x175721);}return _0x4a4ecd[_0x323e('0x1e')](_0x175721)[_0x323e('0x1f')]();};}function respondWithResult(_0x350707,_0x43638f){_0x43638f=_0x43638f||0xc8;return function(_0x3f45da){if(_0x3f45da){return _0x350707[_0x323e('0x1e')](_0x43638f)[_0x323e('0x20')](_0x3f45da);}};}function respondWithFilteredResult(_0x92da10,_0x1aaf29){return function(_0x57fbf5){if(_0x57fbf5){var _0x1bfa55=typeof _0x1aaf29[_0x323e('0x21')]===_0x323e('0x22')&&typeof _0x1aaf29[_0x323e('0x23')]===_0x323e('0x22');var _0x5c4bc7=_0x57fbf5[_0x323e('0x24')];var _0x1271b7=_0x1bfa55?0x0:_0x1aaf29[_0x323e('0x21')];var _0x545e25=_0x1bfa55?_0x57fbf5[_0x323e('0x24')]:_0x1aaf29[_0x323e('0x21')]+_0x1aaf29['limit'];var _0x23333d;if(_0x545e25>=_0x5c4bc7){_0x545e25=_0x5c4bc7;_0x23333d=0xc8;}else{_0x23333d=0xce;}_0x92da10[_0x323e('0x1e')](_0x23333d);return _0x92da10[_0x323e('0x25')](_0x323e('0x26'),_0x1271b7+'-'+_0x545e25+'/'+_0x5c4bc7)['json'](_0x57fbf5);}return null;};}function patchUpdates(_0x1e675c){return function(_0x275d23){try{jsonpatch[_0x323e('0x27')](_0x275d23,_0x1e675c,!![]);}catch(_0x55e765){return BPromise['reject'](_0x55e765);}return _0x275d23['save']();};}function saveUpdates(_0x2d6cc9,_0x348a74){return function(_0x5499f9){if(_0x5499f9){return _0x5499f9[_0x323e('0x28')](_0x2d6cc9)[_0x323e('0x29')](function(_0x4b45dd){return _0x4b45dd;});}return null;};}function removeEntity(_0xc9c327,_0x3726f9){return function(_0x33616b){if(_0x33616b){return _0x33616b['destroy']()[_0x323e('0x29')](function(){var _0x2f9b24=_0x33616b['get']({'plain':!![]});var _0x1bf0af=[{'name':'VoiceQueues','value':_0x323e('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x323e('0x2b'),'ignore':![]}];var _0x1610af=_(_0x1bf0af)['filter'](_0x323e('0x2c'))['map'](_0x323e('0x2d'))[_0x323e('0x2d')]();if(_[_0x323e('0x2e')](_0x1610af,_0x2f9b24[_0x323e('0x2f')])){return;}var _0x3c9e65=_[_0x323e('0x30')](_0x1bf0af,[_0x323e('0x2d'),_0x2f9b24[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x32')][_0x323e('0x33')]({'where':{'type':_0x3c9e65,'resourceId':_0x2f9b24['id']}})[_0x323e('0x29')](function(){return _0x33616b;});})[_0x323e('0x29')](function(){_0xc9c327[_0x323e('0x1e')](0xcc)[_0x323e('0x1f')]();});}};}function handleEntityNotFound(_0x489b5d,_0x25a0ee){return function(_0x151c32){if(!_0x151c32){_0x489b5d[_0x323e('0x34')](0x194);}return _0x151c32;};}function handleError(_0xd1c1fa,_0x2fc49e){_0x2fc49e=_0x2fc49e||0x1f4;return function(_0x45fe06){logger[_0x323e('0x35')](_0x45fe06[_0x323e('0x36')]);if(_0x45fe06[_0x323e('0x31')]){delete _0x45fe06[_0x323e('0x31')];}_0xd1c1fa['status'](_0x2fc49e)[_0x323e('0x37')](_0x45fe06);};}exports[_0x323e('0x38')]=function(_0x553f0b,_0x1a094b){var _0x8402c2={},_0x569fd6={},_0x4f1eea={'count':0x0,'rows':[]};var _0x513d5c=_[_0x323e('0x39')](db[_0x323e('0x3a')][_0x323e('0x3b')],function(_0x36eaaa){return{'name':_0x36eaaa['fieldName'],'type':_0x36eaaa['type'][_0x323e('0x3c')]};});_0x569fd6[_0x323e('0x3d')]=_[_0x323e('0x39')](_0x513d5c,_0x323e('0x31'));_0x569fd6[_0x323e('0x3e')]=_['keys'](_0x553f0b[_0x323e('0x3e')]);_0x569fd6['filters']=_[_0x323e('0x3f')](_0x569fd6['model'],_0x569fd6[_0x323e('0x3e')]);_0x8402c2[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x569fd6['model'],qs[_0x323e('0x41')](_0x553f0b[_0x323e('0x3e')][_0x323e('0x41')]));_0x8402c2['attributes']=_0x8402c2[_0x323e('0x40')][_0x323e('0x42')]?_0x8402c2[_0x323e('0x40')]:_0x569fd6[_0x323e('0x3d')];if(!_0x553f0b['query']['hasOwnProperty'](_0x323e('0x43'))){_0x8402c2['limit']=qs['limit'](_0x553f0b[_0x323e('0x3e')][_0x323e('0x23')]);_0x8402c2[_0x323e('0x21')]=qs['offset'](_0x553f0b[_0x323e('0x3e')]['offset']);}_0x8402c2[_0x323e('0x44')]=qs['sort'](_0x553f0b[_0x323e('0x3e')]['sort']);_0x8402c2[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x553f0b[_0x323e('0x3e')],_0x569fd6[_0x323e('0x46')]),_0x513d5c);if(_0x553f0b[_0x323e('0x3e')][_0x323e('0x47')]){_0x8402c2[_0x323e('0x45')]=_[_0x323e('0x48')](_0x8402c2[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x513d5c,function(_0x289bab){if(_0x289bab['type']!=='VIRTUAL'){var _0x2cb9cd={};_0x2cb9cd[_0x289bab[_0x323e('0x31')]]={'$like':'%'+_0x553f0b[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x2cb9cd;}})});}_0x8402c2=_[_0x323e('0x48')]({},_0x8402c2,_0x553f0b[_0x323e('0x49')]);var _0x39a214={'where':_0x8402c2[_0x323e('0x45')]};return db['VoiceQueue'][_0x323e('0x24')](_0x39a214)[_0x323e('0x29')](function(_0x31743f){_0x4f1eea[_0x323e('0x24')]=_0x31743f;if(_0x553f0b[_0x323e('0x3e')]['includeAll']){_0x8402c2[_0x323e('0x4a')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x8402c2);})[_0x323e('0x29')](function(_0x5f2313){_0x4f1eea['rows']=_0x5f2313;return _0x4f1eea;})[_0x323e('0x29')](respondWithFilteredResult(_0x1a094b,_0x8402c2))['catch'](handleError(_0x1a094b,null));};exports[_0x323e('0x4b')]=function(_0x3391ef,_0x34a7a3){var _0x37d7b0={'raw':![],'where':{'id':_0x3391ef['params']['id']}},_0x21f41c={};_0x21f41c[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x3a')][_0x323e('0x3b')]);_0x21f41c[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3391ef[_0x323e('0x3e')]);_0x21f41c[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x21f41c[_0x323e('0x3d')],_0x21f41c[_0x323e('0x3e')]);_0x37d7b0[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x21f41c[_0x323e('0x3d')],qs['fields'](_0x3391ef['query'][_0x323e('0x41')]));_0x37d7b0[_0x323e('0x40')]=_0x37d7b0[_0x323e('0x40')][_0x323e('0x42')]?_0x37d7b0[_0x323e('0x40')]:_0x21f41c[_0x323e('0x3d')];if(_0x3391ef['query'][_0x323e('0x4d')]){_0x37d7b0[_0x323e('0x4a')]=[{'all':!![]}];}_0x37d7b0=_[_0x323e('0x48')]({},_0x37d7b0,_0x3391ef[_0x323e('0x49')]);return db[_0x323e('0x3a')][_0x323e('0x30')](_0x37d7b0)[_0x323e('0x29')](handleEntityNotFound(_0x34a7a3,null))[_0x323e('0x29')](respondWithResult(_0x34a7a3,null))[_0x323e('0x4e')](handleError(_0x34a7a3,null));};exports[_0x323e('0x4f')]=function(_0x37dd53,_0x5099ae){return db[_0x323e('0x3a')]['create'](_0x37dd53[_0x323e('0x50')],{})[_0x323e('0x29')](function(_0x6246de){var _0x2930bb=_0x37dd53[_0x323e('0x51')][_0x323e('0x52')]({'plain':!![]});if(!_0x2930bb)throw new Error(_0x323e('0x53'));if(_0x2930bb[_0x323e('0x54')]===_0x323e('0x51')){var _0x3c69b2=_0x6246de[_0x323e('0x52')]({'plain':!![]});var _0x70c24f=[{'name':'VoiceQueues','value':_0x323e('0x2a')},{'name':_0x323e('0x55'),'value':_0x323e('0x2b')}];var _0x20e4b5=_[_0x323e('0x30')](_0x70c24f,[_0x323e('0x2d'),_0x3c69b2[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x56')]['find']({'where':{'name':_0x20e4b5,'userProfileId':_0x2930bb[_0x323e('0x57')]},'raw':!![]})[_0x323e('0x29')](function(_0x5e2dbb){if(_0x5e2dbb&&_0x5e2dbb[_0x323e('0x58')]===0x0){return db[_0x323e('0x32')][_0x323e('0x4f')]({'name':_0x3c69b2[_0x323e('0x31')],'resourceId':_0x3c69b2['id'],'type':_0x5e2dbb['name'],'sectionId':_0x5e2dbb['id']},{})[_0x323e('0x29')](function(){return _0x6246de;});}else{return _0x6246de;}})[_0x323e('0x4e')](function(_0x161d57){logger[_0x323e('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x161d57);throw _0x161d57;});}return _0x6246de;})[_0x323e('0x29')](respondWithResult(_0x5099ae,0xc9))[_0x323e('0x4e')](handleError(_0x5099ae,null));};exports[_0x323e('0x59')]=function(_0xd5552c,_0x5cee60){var _0x3e9d2e={'where':{'id':_0xd5552c[_0x323e('0x5a')]['id']}},_0x58fe90={};_0x58fe90['model']=_['keys'](db[_0x323e('0x3a')][_0x323e('0x3b')]);_0x3e9d2e[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x58fe90[_0x323e('0x3d')],qs[_0x323e('0x41')](_0xd5552c['query']['fields']));_0x3e9d2e['attributes']=_0x3e9d2e[_0x323e('0x40')]['length']?_0x3e9d2e[_0x323e('0x40')]:_0x58fe90[_0x323e('0x3d')];if(_0xd5552c[_0x323e('0x3e')][_0x323e('0x4d')]){_0x3e9d2e[_0x323e('0x4a')]=[{'all':!![]}];}_0x3e9d2e=_[_0x323e('0x48')]({},_0x3e9d2e,_0xd5552c['options']);return db[_0x323e('0x3a')]['find'](_0x3e9d2e)[_0x323e('0x29')](handleEntityNotFound(_0x5cee60,null))[_0x323e('0x29')](function(_0x548f63){if(_0x548f63){var _0x2e4ef6=_0x548f63[_0x323e('0x52')]({'plain':!![]});_0x2e4ef6=qs[_0x323e('0x5b')](_0x2e4ef6,['id',_0x323e('0x5c'),'updatedAt']);_0xd5552c['body']=_[_0x323e('0x5b')](_0xd5552c[_0x323e('0x50')],['id','createdAt',_0x323e('0x5d')]);return db[_0x323e('0x3a')]['create'](_['merge'](_0x2e4ef6,_0xd5552c[_0x323e('0x50')]),{'include':_0xd5552c[_0x323e('0x3e')][_0x323e('0x4d')]?[{'all':!![]}]:undefined})[_0x323e('0x29')](function(_0x3deae9){var _0x2c2628=_0xd5552c[_0x323e('0x51')][_0x323e('0x52')]({'plain':!![]});if(!_0x2c2628)throw new Error(_0x323e('0x53'));if(_0x2c2628[_0x323e('0x54')]==='user'){var _0x2c8f49=_0x3deae9['get']({'plain':!![]});var _0x5f2f12=[{'name':_0x323e('0x5e'),'value':_0x323e('0x2a')},{'name':_0x323e('0x55'),'value':_0x323e('0x2b')}];var _0x421942=_[_0x323e('0x30')](_0x5f2f12,[_0x323e('0x2d'),_0x2c8f49[_0x323e('0x2f')]])[_0x323e('0x31')];return db[_0x323e('0x56')][_0x323e('0x30')]({'where':{'name':_0x421942,'userProfileId':_0x2c2628[_0x323e('0x57')]},'raw':!![]})[_0x323e('0x29')](function(_0x2b9317){if(_0x2b9317&&_0x2b9317[_0x323e('0x58')]===0x0){return db[_0x323e('0x32')][_0x323e('0x4f')]({'name':_0x2c8f49['name'],'resourceId':_0x2c8f49['id'],'type':_0x2b9317[_0x323e('0x31')],'sectionId':_0x2b9317['id']},{})[_0x323e('0x29')](function(){return _0x3deae9;});}else{return _0x3deae9;}})[_0x323e('0x4e')](function(_0x5836c3){logger[_0x323e('0x35')](_0x323e('0x5f'),_0x5836c3);throw _0x5836c3;});}return _0x3deae9;});}})['then'](respondWithResult(_0x5cee60,0xc9))[_0x323e('0x4e')](handleError(_0x5cee60,null));};exports[_0x323e('0x28')]=function(_0x85add2,_0x244748){if(_0x85add2[_0x323e('0x50')]['id']){delete _0x85add2[_0x323e('0x50')]['id'];}return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x85add2['params']['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x244748,null))[_0x323e('0x29')](saveUpdates(_0x85add2['body'],null))[_0x323e('0x29')](respondWithResult(_0x244748,null))[_0x323e('0x4e')](handleError(_0x244748,null));};exports['destroy']=function(_0x1a5144,_0x4958c5){return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x1a5144[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4958c5,null))[_0x323e('0x29')](removeEntity(_0x4958c5,null))[_0x323e('0x4e')](handleError(_0x4958c5,null));};exports['getHoppers']=function(_0x2a3b5f,_0x31dbe7,_0x574a0d){var _0x4b68dd={'raw':![],'where':{}};var _0x3c7d55={};var _0xdb85d5={'count':0x0,'rows':[]};return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x2a3b5f[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x31dbe7,null))[_0x323e('0x29')](function(_0x151feb){if(_0x151feb){_0x3c7d55[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x61')]['rawAttributes']);_0x3c7d55[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x2a3b5f[_0x323e('0x3e')]);_0x3c7d55['filters']=_[_0x323e('0x3f')](_0x3c7d55[_0x323e('0x3d')],_0x3c7d55['query']);_0x4b68dd[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x3c7d55[_0x323e('0x3d')],qs['fields'](_0x2a3b5f[_0x323e('0x3e')][_0x323e('0x41')]));_0x4b68dd[_0x323e('0x40')]=_0x4b68dd['attributes'][_0x323e('0x42')]?_0x4b68dd[_0x323e('0x40')]:_0x3c7d55[_0x323e('0x3d')];if(!_0x2a3b5f['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x4b68dd[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x2a3b5f[_0x323e('0x3e')]['limit']);_0x4b68dd[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x2a3b5f['query'][_0x323e('0x21')]);}_0x4b68dd[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x2a3b5f['query']['sort']);_0x4b68dd['where']=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x2a3b5f[_0x323e('0x3e')],_0x3c7d55['filters']));_0x4b68dd[_0x323e('0x45')][_0x323e('0x65')]=_0x151feb['id'];if(_0x2a3b5f['query'][_0x323e('0x47')]){_0x4b68dd[_0x323e('0x45')]=_[_0x323e('0x48')](_0x4b68dd['where'],{'$or':_[_0x323e('0x39')](_0x4b68dd[_0x323e('0x40')],function(_0x16d01d){var _0x4b2106={};_0x4b2106[_0x16d01d]={'$like':'%'+_0x2a3b5f[_0x323e('0x3e')]['filter']+'%'};return _0x4b2106;})});}_0x4b68dd=_['merge']({},_0x4b68dd,_0x2a3b5f[_0x323e('0x49')]);return db['CmHopper'][_0x323e('0x24')]({'where':_0x4b68dd[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x16f729){_0xdb85d5[_0x323e('0x24')]=_0x16f729;if(_0x2a3b5f['query'][_0x323e('0x4d')]){_0x4b68dd[_0x323e('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x323e('0x66')](_0x4b68dd);})[_0x323e('0x29')](function(_0x3c7a64){_0xdb85d5[_0x323e('0x67')]=_0x3c7a64;return _0xdb85d5;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x31dbe7,_0x4b68dd))[_0x323e('0x4e')](handleError(_0x31dbe7,null));};exports['getHopperHistories']=function(_0x1d1a49,_0x4f5900,_0x20725d){var _0x256620={'raw':!![],'where':{}};var _0x221a96={};var _0x2e093d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x1d1a49[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4f5900,null))['then'](function(_0x23765c){if(_0x23765c){_0x221a96[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmHopperHistory'][_0x323e('0x3b')]);_0x221a96['query']=_[_0x323e('0x4c')](_0x1d1a49[_0x323e('0x3e')]);_0x221a96['filters']=_[_0x323e('0x3f')](_0x221a96[_0x323e('0x3d')],_0x221a96[_0x323e('0x3e')]);_0x256620[_0x323e('0x40')]=_['intersection'](_0x221a96[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x1d1a49[_0x323e('0x3e')][_0x323e('0x41')]));_0x256620[_0x323e('0x40')]=_0x256620['attributes'][_0x323e('0x42')]?_0x256620['attributes']:_0x221a96[_0x323e('0x3d')];if(!_0x1d1a49[_0x323e('0x3e')]['hasOwnProperty']('nolimit')){_0x256620[_0x323e('0x23')]=qs['limit'](_0x1d1a49[_0x323e('0x3e')]['limit']);_0x256620[_0x323e('0x21')]=qs['offset'](_0x1d1a49['query'][_0x323e('0x21')]);}_0x256620[_0x323e('0x44')]=qs['sort'](_0x1d1a49[_0x323e('0x3e')][_0x323e('0x63')]);_0x256620[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x1d1a49[_0x323e('0x3e')],_0x221a96[_0x323e('0x46')]));_0x256620[_0x323e('0x45')][_0x323e('0x65')]=_0x23765c['id'];if(_0x1d1a49[_0x323e('0x3e')]['filter']){_0x256620[_0x323e('0x45')]=_['merge'](_0x256620[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x256620[_0x323e('0x40')],function(_0x411d8e){var _0x5f2777={};_0x5f2777[_0x411d8e]={'$like':'%'+_0x1d1a49[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x5f2777;})});}_0x256620=_['merge']({},_0x256620,_0x1d1a49[_0x323e('0x49')]);return db[_0x323e('0x68')][_0x323e('0x24')]({'where':_0x256620[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x1b92ab){_0x2e093d['count']=_0x1b92ab;if(_0x1d1a49[_0x323e('0x3e')]['includeAll']){_0x256620[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x68')][_0x323e('0x66')](_0x256620);})[_0x323e('0x29')](function(_0x3ff866){_0x2e093d[_0x323e('0x67')]=_0x3ff866;return _0x2e093d;});}})['then'](respondWithFilteredResult(_0x4f5900,_0x256620))['catch'](handleError(_0x4f5900,null));};exports[_0x323e('0x69')]=function(_0x14075d,_0x8b3957,_0x3127b1){var _0x41a5fe={'raw':!![],'where':{}};var _0x3a13e5={};var _0x2ab1ee={'count':0x0,'rows':[]};return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x14075d[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x8b3957,null))['then'](function(_0x2a63eb){if(_0x2a63eb){_0x3a13e5[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmHopperFinal'][_0x323e('0x3b')]);_0x3a13e5[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x14075d[_0x323e('0x3e')]);_0x3a13e5['filters']=_[_0x323e('0x3f')](_0x3a13e5['model'],_0x3a13e5[_0x323e('0x3e')]);_0x41a5fe[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x3a13e5[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x14075d['query'][_0x323e('0x41')]));_0x41a5fe[_0x323e('0x40')]=_0x41a5fe['attributes']['length']?_0x41a5fe['attributes']:_0x3a13e5[_0x323e('0x3d')];if(!_0x14075d[_0x323e('0x3e')][_0x323e('0x62')](_0x323e('0x43'))){_0x41a5fe['limit']=qs[_0x323e('0x23')](_0x14075d[_0x323e('0x3e')][_0x323e('0x23')]);_0x41a5fe[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x14075d[_0x323e('0x3e')][_0x323e('0x21')]);}_0x41a5fe[_0x323e('0x44')]=qs['sort'](_0x14075d['query'][_0x323e('0x63')]);_0x41a5fe[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x14075d[_0x323e('0x3e')],_0x3a13e5[_0x323e('0x46')]));_0x41a5fe[_0x323e('0x45')][_0x323e('0x65')]=_0x2a63eb['id'];if(_0x14075d['query'][_0x323e('0x47')]){_0x41a5fe[_0x323e('0x45')]=_[_0x323e('0x48')](_0x41a5fe[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x41a5fe['attributes'],function(_0x3fcb72){var _0xff923c={};_0xff923c[_0x3fcb72]={'$like':'%'+_0x14075d[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0xff923c;})});}_0x41a5fe=_[_0x323e('0x48')]({},_0x41a5fe,_0x14075d[_0x323e('0x49')]);return db[_0x323e('0x6a')][_0x323e('0x24')]({'where':_0x41a5fe[_0x323e('0x45')]})['then'](function(_0xb38c46){_0x2ab1ee[_0x323e('0x24')]=_0xb38c46;if(_0x14075d['query'][_0x323e('0x4d')]){_0x41a5fe[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x6a')]['findAll'](_0x41a5fe);})[_0x323e('0x29')](function(_0x1f56ed){_0x2ab1ee[_0x323e('0x67')]=_0x1f56ed;return _0x2ab1ee;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x8b3957,_0x41a5fe))[_0x323e('0x4e')](handleError(_0x8b3957,null));};exports[_0x323e('0x6b')]=function(_0x1980c0,_0x49b0b6,_0x3f1b7b){var _0x2ab95e={'raw':!![],'where':{}};var _0x5dc98f={};var _0x1152e0={'count':0x0,'rows':[]};return db[_0x323e('0x3a')]['findOne']({'where':{'id':_0x1980c0[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x49b0b6,null))[_0x323e('0x29')](function(_0x5ee4d3){if(_0x5ee4d3){_0x5dc98f['model']=_[_0x323e('0x4c')](db['CmHopperBlack'][_0x323e('0x3b')]);_0x5dc98f[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x1980c0[_0x323e('0x3e')]);_0x5dc98f[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x5dc98f[_0x323e('0x3d')],_0x5dc98f[_0x323e('0x3e')]);_0x2ab95e[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x5dc98f[_0x323e('0x3d')],qs['fields'](_0x1980c0[_0x323e('0x3e')][_0x323e('0x41')]));_0x2ab95e[_0x323e('0x40')]=_0x2ab95e[_0x323e('0x40')]['length']?_0x2ab95e[_0x323e('0x40')]:_0x5dc98f[_0x323e('0x3d')];if(!_0x1980c0[_0x323e('0x3e')][_0x323e('0x62')](_0x323e('0x43'))){_0x2ab95e[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x1980c0['query'][_0x323e('0x23')]);_0x2ab95e[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x1980c0[_0x323e('0x3e')][_0x323e('0x21')]);}_0x2ab95e[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x1980c0[_0x323e('0x3e')][_0x323e('0x63')]);_0x2ab95e[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x1980c0[_0x323e('0x3e')],_0x5dc98f['filters']));_0x2ab95e['where'][_0x323e('0x65')]=_0x5ee4d3['id'];if(_0x1980c0[_0x323e('0x3e')][_0x323e('0x47')]){_0x2ab95e[_0x323e('0x45')]=_[_0x323e('0x48')](_0x2ab95e[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x2ab95e[_0x323e('0x40')],function(_0x5307ff){var _0x54a0d0={};_0x54a0d0[_0x5307ff]={'$like':'%'+_0x1980c0['query']['filter']+'%'};return _0x54a0d0;})});}_0x2ab95e=_['merge']({},_0x2ab95e,_0x1980c0['options']);return db['CmHopperBlack'][_0x323e('0x24')]({'where':_0x2ab95e[_0x323e('0x45')]})[_0x323e('0x29')](function(_0x3fcdda){_0x1152e0['count']=_0x3fcdda;if(_0x1980c0['query'][_0x323e('0x4d')]){_0x2ab95e[_0x323e('0x4a')]=[{'all':!![]}];}return db[_0x323e('0x6c')][_0x323e('0x66')](_0x2ab95e);})['then'](function(_0x35e889){_0x1152e0[_0x323e('0x67')]=_0x35e889;return _0x1152e0;});}})[_0x323e('0x29')](respondWithFilteredResult(_0x49b0b6,_0x2ab95e))['catch'](handleError(_0x49b0b6,null));};exports[_0x323e('0x6d')]=function(_0x214ab1,_0x53d94a,_0x3bdab5){var _0x50efdd={};var _0x435fcb={};var _0x45a43f;var _0x154bd6;return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x214ab1[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x53d94a,null))[_0x323e('0x29')](function(_0x4324a2){if(_0x4324a2){_0x45a43f=_0x4324a2;_0x435fcb['model']=_[_0x323e('0x4c')](db[_0x323e('0x6e')][_0x323e('0x3b')]);_0x435fcb[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x214ab1[_0x323e('0x3e')]);_0x435fcb[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x435fcb['model'],_0x435fcb['query']);_0x50efdd['attributes']=_[_0x323e('0x3f')](_0x435fcb[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x214ab1[_0x323e('0x3e')]['fields']));_0x50efdd['attributes']=_0x50efdd[_0x323e('0x40')][_0x323e('0x42')]?_0x50efdd['attributes']:_0x435fcb[_0x323e('0x3d')];_0x50efdd['order']=qs[_0x323e('0x63')](_0x214ab1['query'][_0x323e('0x63')]);_0x50efdd[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x214ab1[_0x323e('0x3e')],_0x435fcb[_0x323e('0x46')]));if(_0x214ab1[_0x323e('0x3e')][_0x323e('0x47')]){_0x50efdd['where']=_[_0x323e('0x48')](_0x50efdd[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x50efdd['attributes'],function(_0x3dad5a){var _0x6e85f1={};_0x6e85f1[_0x3dad5a]={'$like':'%'+_0x214ab1['query']['filter']+'%'};return _0x6e85f1;})});}_0x50efdd=_['merge']({},_0x50efdd,_0x214ab1['options']);return _0x45a43f[_0x323e('0x6d')](_0x50efdd);}})['then'](function(_0x35d966){if(_0x35d966){_0x154bd6=_0x35d966['length'];if(!_0x214ab1['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x50efdd['limit']=qs[_0x323e('0x23')](_0x214ab1[_0x323e('0x3e')][_0x323e('0x23')]);_0x50efdd['offset']=qs['offset'](_0x214ab1[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x45a43f['getTeams'](_0x50efdd);}})[_0x323e('0x29')](function(_0x500c29){if(_0x500c29){return _0x500c29?{'count':_0x154bd6,'rows':_0x500c29}:null;}})['then'](respondWithResult(_0x53d94a,null))['catch'](handleError(_0x53d94a,null));};exports['addTeams']=function(_0x40f833,_0x20b6b0,_0xc8a6eb){var _0x7e9c4=_0x40f833['body']['teams'];var _0x4e45e6=_[_0x323e('0x39')](_0x7e9c4,'id');return db['Team']['findAll']({'where':{'id':_0x4e45e6},'attributes':['id'],'include':[{'model':db[_0x323e('0x6f')],'as':'Agents','attributes':['id','name',_0x323e('0x70'),_0x323e('0x71'),_0x323e('0x72')],'raw':!![]}]})['then'](function(_0x1e1547){if(_0x1e1547){var _0x107d76=_['flatMap'](_0x1e1547,function(_0x2473a2){var _0x11b4fb=_0x2473a2[_0x323e('0x52')]({'plain':!![]});_0x11b4fb[_0x323e('0x73')][_0x323e('0x74')](function(_0x1c40a2){_0x1c40a2[_0x323e('0x75')]=_[_0x323e('0x30')](_0x7e9c4,{'id':_0x11b4fb['id']})[_0x323e('0x75')];});return _0x11b4fb[_0x323e('0x73')];});return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x40f833[_0x323e('0x5a')]['id']}})['then'](function(_0x34543a){return db[_0x323e('0x76')][_0x323e('0x77')](function(_0x31d74d){return _0x34543a['addTeams'](_0x4e45e6,{'transaction':_0x31d74d})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_0x7e9c4,function(_0x421170){return db['TeamVoiceQueue'][_0x323e('0x79')]({'TeamId':_0x421170['id'],'VoiceQueueId':_0x40f833[_0x323e('0x5a')]['id'],'penalty':_0x421170['penalty']},{'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_0x107d76,function(_0x1d9ecf){return db[_0x323e('0x7a')][_0x323e('0x7b')]({'where':{'UserId':_0x1d9ecf['id'],'VoiceQueueId':_0x40f833[_0x323e('0x5a')]['id']},'defaults':{'penalty':_0x1d9ecf[_0x323e('0x75')]},'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){return BPromise[_0x323e('0x78')](_[_0x323e('0x47')](_0x107d76,{'online':!![]}),function(_0x5e1bc9){return db['UserVoiceQueueRt'][_0x323e('0x79')]({'membername':_0x5e1bc9['name'],'UserId':_0x5e1bc9['id'],'queue_name':_0x34543a[_0x323e('0x31')],'VoiceQueueId':_0x34543a['id'],'interface':_[_0x323e('0x7c')](_0x5e1bc9['interface'])?util[_0x323e('0x7d')](_0x323e('0x7e'),_0x5e1bc9['name']):_0x5e1bc9[_0x323e('0x72')],'paused':_0x5e1bc9[_0x323e('0x71')]||![],'penalty':_0x5e1bc9[_0x323e('0x75')]},{'transaction':_0x31d74d});});})[_0x323e('0x29')](function(){_0x107d76[_0x323e('0x74')](function(_0x196b50){socket['emit']('userVoiceQueue:save',{'UserId':_0x196b50['id'],'VoiceQueueId':_0x34543a['id']});});});});});}})[_0x323e('0x29')](respondWithStatusCode(_0x20b6b0,null))['catch'](handleError(_0x20b6b0,null));};exports[_0x323e('0x7f')]=function(_0x504d6b,_0x5225ca,_0x35c4e0){return db[_0x323e('0x6e')]['findAll']({'where':{'id':_0x504d6b[_0x323e('0x3e')][_0x323e('0x80')]},'attributes':['id'],'include':[{'model':db[_0x323e('0x6f')],'as':_0x323e('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5225ca,null))[_0x323e('0x29')](function(_0x590723){var _0x4a2dd7=_[_0x323e('0x39')](_0x590723,'id');var _0xe380ab=[];var _0xcb9558=[];var _0x57b304=squel[_0x323e('0x81')]();_0x57b304['field']('tq.TeamId')[_0x323e('0x82')](_0x323e('0x83'),'tq')[_0x323e('0x84')](_0x323e('0x85'),'ut',_0x323e('0x86'))[_0x323e('0x45')](_0x323e('0x87'),_0x504d6b[_0x323e('0x5a')]['id']);for(var _0xb17532=0x0;_0xb17532<_0x590723['length'];_0xb17532+=0x1){let _0xe60e53=_0x590723[_0xb17532];for(var _0x4036a8=0x0;_0x4036a8<_0xe60e53['Agents'][_0x323e('0x42')];_0x4036a8+=0x1){let _0x102f93=_0xe60e53[_0x323e('0x73')][_0x4036a8];var _0x3dbf61=_0x57b304['clone']();_0x3dbf61[_0x323e('0x45')]('ut.UserId\x20=\x20?',_0x102f93['id']);_0xcb9558[_0x323e('0x88')](db[_0x323e('0x76')]['query'](_0x3dbf61[_0x323e('0x89')](),{'type':db[_0x323e('0x76')][_0x323e('0x8a')][_0x323e('0x8b')]})[_0x323e('0x29')](function(_0x459ef6){if(_0x459ef6[_0x323e('0x42')]===0x1){return _0x102f93['id'];}else{var _0x33b262=_[_0x323e('0x8c')](_[_0x323e('0x39')](_0x459ef6,_0x323e('0x8d')),function(_0x33c889){return _['includes'](_0x4a2dd7,_0x33c889);});if(_0x33b262){return _0x102f93['id'];}}}));}}return BPromise['all'](_0xcb9558)[_0x323e('0x29')](function(_0x2ffec0){_0xe380ab=_(_0xe380ab)[_0x323e('0x8e')](_0x2ffec0)[_0x323e('0x8f')]()[_0x323e('0x2d')]();return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x504d6b[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(_0xb13357){return db[_0x323e('0x76')]['transaction'](function(_0x1095f2){return _0xb13357[_0x323e('0x7f')](_0x504d6b[_0x323e('0x3e')][_0x323e('0x80')],{'transaction':_0x1095f2})[_0x323e('0x29')](function(){if(!_[_0x323e('0x90')](_0xe380ab)){return _0xb13357[_0x323e('0x91')](_0xe380ab,{'transaction':_0x1095f2})[_0x323e('0x29')](function(){return db['UserVoiceQueueRt'][_0x323e('0x33')]({'where':{'VoiceQueueId':_0x504d6b[_0x323e('0x5a')]['id'],'UserId':_0xe380ab},'transaction':_0x1095f2});});}})[_0x323e('0x29')](function(){_0xe380ab[_0x323e('0x74')](function(_0x5dbffc){socket[_0x323e('0x92')](_0x323e('0x93'),{'UserId':_0x5dbffc,'VoiceQueueId':_0xb13357['id']});});});});});});})[_0x323e('0x29')](respondWithStatusCode(_0x5225ca,null))[_0x323e('0x4e')](handleError(_0x5225ca,null));};exports[_0x323e('0x94')]=function(_0x534e9b,_0x2daf53,_0x640a51){var _0x45be91,_0x568ed8;return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x534e9b[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x2daf53,null))[_0x323e('0x29')](function(_0x517149){if(_0x517149){_0x568ed8=_0x517149;return _0x517149[_0x323e('0x94')](_0x534e9b[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x534e9b[_0x323e('0x50')],[_0x323e('0x80'),'id'])||{})[_0x323e('0x95')](function(_0x5c0bb1){for(var _0x338e47=0x0;_0x338e47<_0x534e9b[_0x323e('0x50')][_0x323e('0x80')]['length'];_0x338e47+=0x1){socket[_0x323e('0x92')](_0x323e('0x96'),{'UserId':Number(_0x534e9b[_0x323e('0x50')][_0x323e('0x80')][_0x338e47]),'VoiceQueueId':Number(_0x534e9b['params']['id'])});}return _0x5c0bb1;});}})[_0x323e('0x29')](function(_0x17074f){_0x45be91=_0x17074f||[];if(_0x568ed8){return db['User']['findAll']({'where':{'id':_0x534e9b[_0x323e('0x50')]['ids']},'attributes':['id',_0x323e('0x31'),_0x323e('0x70'),_0x323e('0x71'),'interface'],'raw':!![]});}})[_0x323e('0x29')](function(_0x34bbfc){if(!_['isEmpty'](_0x34bbfc)){var _0x4f9f99=[];for(var _0x5dd761=0x0;_0x5dd761<_0x34bbfc['length'];_0x5dd761++){if(_0x34bbfc[_0x5dd761][_0x323e('0x70')]){_0x4f9f99[_0x323e('0x88')](db[_0x323e('0x97')][_0x323e('0x79')]({'membername':_0x34bbfc[_0x5dd761][_0x323e('0x31')],'UserId':_0x34bbfc[_0x5dd761]['id'],'queue_name':_0x568ed8[_0x323e('0x31')],'VoiceQueueId':_0x568ed8['id'],'interface':_[_0x323e('0x7c')](_0x34bbfc[_0x5dd761]['interface'])?util[_0x323e('0x7d')](_0x323e('0x7e'),_0x34bbfc[_0x5dd761][_0x323e('0x31')]):_0x34bbfc[_0x5dd761][_0x323e('0x72')],'paused':_0x34bbfc[_0x5dd761][_0x323e('0x71')]||![],'penalty':_0x534e9b[_0x323e('0x50')][_0x323e('0x75')]||0x0}));}}return BPromise[_0x323e('0x98')](_0x4f9f99);}})['then'](function(){return _0x45be91;})[_0x323e('0x29')](respondWithResult(_0x2daf53,null))['catch'](handleError(_0x2daf53,null));};exports[_0x323e('0x91')]=function(_0x2e7b30,_0xaca419,_0xe13081){return db[_0x323e('0x3a')]['find']({'where':{'id':_0x2e7b30[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0xaca419,null))[_0x323e('0x29')](function(_0x450aa6){if(_0x450aa6){return _0x450aa6[_0x323e('0x91')](_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')])[_0x323e('0x29')](function(){if(_[_0x323e('0x99')](_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')])){for(var _0x4f953b=0x0;_0x4f953b<_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')][_0x323e('0x42')];_0x4f953b+=0x1){socket[_0x323e('0x92')](_0x323e('0x93'),{'UserId':Number(_0x2e7b30['query'][_0x323e('0x80')][_0x4f953b]),'VoiceQueueId':Number(_0x2e7b30[_0x323e('0x5a')]['id'])});}}else{socket[_0x323e('0x92')]('userVoiceQueue:remove',{'UserId':Number(_0x2e7b30['query'][_0x323e('0x80')]),'VoiceQueueId':Number(_0x2e7b30[_0x323e('0x5a')]['id'])});}});}})[_0x323e('0x29')](function(_0x25f0f4){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2e7b30[_0x323e('0x5a')]['id'],'UserId':_0x2e7b30[_0x323e('0x3e')][_0x323e('0x80')]}})[_0x323e('0x29')](function(){return _0x25f0f4;});})[_0x323e('0x29')](respondWithStatusCode(_0xaca419,null))[_0x323e('0x4e')](handleError(_0xaca419,null));};exports[_0x323e('0x9a')]=function(_0x3cc685,_0x4efb66,_0x2b4986){var _0x25dd5b={};var _0x146ccf={};var _0x1353f7;var _0xfcb262;return db['VoiceQueue']['findOne']({'where':{'id':_0x3cc685[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x4efb66,null))[_0x323e('0x29')](function(_0xca9a2b){if(_0xca9a2b){_0x1353f7=_0xca9a2b;_0x146ccf[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0x6f')][_0x323e('0x3b')]);_0x146ccf[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3cc685[_0x323e('0x3e')]);_0x146ccf[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x146ccf[_0x323e('0x3d')],_0x146ccf[_0x323e('0x3e')]);_0x25dd5b['attributes']=_[_0x323e('0x3f')](_0x146ccf[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x41')]));_0x25dd5b['attributes']=_0x25dd5b[_0x323e('0x40')][_0x323e('0x42')]?_0x25dd5b['attributes']:_0x146ccf[_0x323e('0x3d')];_0x25dd5b[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x63')]);_0x25dd5b[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x3cc685[_0x323e('0x3e')],_0x146ccf['filters']));if(_0x3cc685[_0x323e('0x3e')][_0x323e('0x47')]){_0x25dd5b[_0x323e('0x45')]=_[_0x323e('0x48')](_0x25dd5b['where'],{'$or':_[_0x323e('0x39')](_0x25dd5b[_0x323e('0x40')],function(_0x2c9c81){var _0x293e9b={};_0x293e9b[_0x2c9c81]={'$like':'%'+_0x3cc685[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x293e9b;})});}_0x25dd5b=_['merge']({},_0x25dd5b,_0x3cc685[_0x323e('0x49')]);return _0x1353f7[_0x323e('0x9a')](_0x25dd5b);}})[_0x323e('0x29')](function(_0x1a05e6){if(_0x1a05e6){_0xfcb262=_0x1a05e6[_0x323e('0x42')];if(!_0x3cc685['query'][_0x323e('0x62')](_0x323e('0x43'))){_0x25dd5b[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x23')]);_0x25dd5b[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x3cc685[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x1353f7[_0x323e('0x9a')](_0x25dd5b);}})[_0x323e('0x29')](function(_0x5e141c){if(_0x5e141c){return _0x5e141c?{'count':_0xfcb262,'rows':_0x5e141c}:null;}})[_0x323e('0x29')](respondWithResult(_0x4efb66,null))[_0x323e('0x4e')](handleError(_0x4efb66,null));};exports[_0x323e('0x9b')]=function(_0x3e98a9,_0x26df8e,_0x54d27d){var _0x580d56={};var _0x1840b3={};var _0x578104;var _0x3dc5c7;return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x3e98a9[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x26df8e,null))[_0x323e('0x29')](function(_0x582284){if(_0x582284){_0x578104=_0x582284;_0x1840b3[_0x323e('0x3d')]=_['keys'](db[_0x323e('0x97')][_0x323e('0x3b')]);_0x1840b3[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x3e98a9[_0x323e('0x3e')]);_0x1840b3[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x1840b3['model'],_0x1840b3[_0x323e('0x3e')]);_0x580d56['attributes']=_[_0x323e('0x3f')](_0x1840b3[_0x323e('0x3d')],qs['fields'](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x41')]));_0x580d56[_0x323e('0x40')]=_0x580d56[_0x323e('0x40')][_0x323e('0x42')]?_0x580d56[_0x323e('0x40')]:_0x1840b3['model'];_0x580d56[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x63')]);_0x580d56[_0x323e('0x45')]=qs[_0x323e('0x46')](_[_0x323e('0x64')](_0x3e98a9[_0x323e('0x3e')],_0x1840b3[_0x323e('0x46')]));if(_0x3e98a9['query'][_0x323e('0x47')]){_0x580d56['where']=_[_0x323e('0x48')](_0x580d56[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x580d56[_0x323e('0x40')],function(_0x687a8a){var _0x4c25df={};_0x4c25df[_0x687a8a]={'$like':'%'+_0x3e98a9[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x4c25df;})});}_0x580d56=_['merge']({},_0x580d56,_0x3e98a9[_0x323e('0x49')]);return _0x578104[_0x323e('0x9b')](_0x580d56);}})[_0x323e('0x29')](function(_0x5c5d19){if(_0x5c5d19){_0x3dc5c7=_0x5c5d19[_0x323e('0x42')];if(!_0x3e98a9[_0x323e('0x3e')][_0x323e('0x62')]('nolimit')){_0x580d56[_0x323e('0x23')]=qs['limit'](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x23')]);_0x580d56[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x3e98a9[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x578104[_0x323e('0x9b')](_0x580d56);}})[_0x323e('0x29')](function(_0x1fe4bf){return _0x1fe4bf?{'count':_0x3dc5c7,'rows':_0x1fe4bf}:null;})[_0x323e('0x29')](respondWithResult(_0x26df8e,null))['catch'](handleError(_0x26df8e,null));};exports['getLists']=function(_0x286831,_0xd59b96,_0x30f041){var _0x3bb0ae={};var _0x1ead42={};var _0x2d88a8;var _0x3cdf21;return db['VoiceQueue'][_0x323e('0x60')]({'where':{'id':_0x286831['params']['id']}})['then'](handleEntityNotFound(_0xd59b96,null))['then'](function(_0x23570b){if(_0x23570b){_0x2d88a8=_0x23570b;_0x1ead42[_0x323e('0x3d')]=_[_0x323e('0x4c')](db['CmList'][_0x323e('0x3b')]);_0x1ead42[_0x323e('0x3e')]=_[_0x323e('0x4c')](_0x286831[_0x323e('0x3e')]);_0x1ead42[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x1ead42[_0x323e('0x3d')],_0x1ead42[_0x323e('0x3e')]);_0x3bb0ae[_0x323e('0x40')]=_[_0x323e('0x3f')](_0x1ead42[_0x323e('0x3d')],qs[_0x323e('0x41')](_0x286831[_0x323e('0x3e')][_0x323e('0x41')]));_0x3bb0ae[_0x323e('0x40')]=_0x3bb0ae[_0x323e('0x40')]['length']?_0x3bb0ae[_0x323e('0x40')]:_0x1ead42[_0x323e('0x3d')];_0x3bb0ae['order']=qs[_0x323e('0x63')](_0x286831[_0x323e('0x3e')]['sort']);_0x3bb0ae[_0x323e('0x45')]=qs['filters'](_[_0x323e('0x64')](_0x286831[_0x323e('0x3e')],_0x1ead42[_0x323e('0x46')]));if(_0x286831[_0x323e('0x3e')][_0x323e('0x47')]){_0x3bb0ae[_0x323e('0x45')]=_[_0x323e('0x48')](_0x3bb0ae[_0x323e('0x45')],{'$or':_[_0x323e('0x39')](_0x3bb0ae[_0x323e('0x40')],function(_0x3a060d){var _0x361ffb={};_0x361ffb[_0x3a060d]={'$like':'%'+_0x286831[_0x323e('0x3e')][_0x323e('0x47')]+'%'};return _0x361ffb;})});}_0x3bb0ae=_['merge']({},_0x3bb0ae,_0x286831[_0x323e('0x49')]);return _0x2d88a8[_0x323e('0x9c')](_0x3bb0ae);}})[_0x323e('0x29')](function(_0x5b5bd2){if(_0x5b5bd2){_0x3cdf21=_0x5b5bd2[_0x323e('0x42')];if(!_0x286831[_0x323e('0x3e')]['hasOwnProperty'](_0x323e('0x43'))){_0x3bb0ae[_0x323e('0x23')]=qs[_0x323e('0x23')](_0x286831['query'][_0x323e('0x23')]);_0x3bb0ae[_0x323e('0x21')]=qs[_0x323e('0x21')](_0x286831[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x2d88a8[_0x323e('0x9c')](_0x3bb0ae);}})['then'](function(_0x2df562){if(_0x2df562){return _0x2df562?{'count':_0x3cdf21,'rows':_0x2df562}:null;}})[_0x323e('0x29')](respondWithResult(_0xd59b96,null))[_0x323e('0x4e')](handleError(_0xd59b96,null));};exports[_0x323e('0x9d')]=function(_0x71d006,_0x4463ea,_0xdc810b){var _0x5db545,_0x41ef4c;return db[_0x323e('0x3a')][_0x323e('0x30')]({'where':{'id':_0x71d006[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x4463ea,null))[_0x323e('0x29')](function(_0x578567){if(_0x578567){_0x41ef4c=_0x578567;return _0x578567[_0x323e('0x9d')](_0x71d006[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x71d006['body'],['ids','id'])||{});}return null;})[_0x323e('0x95')](function(_0x42e715){var _0x5f2903;_0x5db545=_0x42e715||[];var _0x552807=[];if(_0x42e715){for(var _0x51c0f2=0x0;_0x51c0f2<_0x42e715[_0x323e('0x42')];_0x51c0f2+=0x1){var _0x215b62=_0x42e715[_0x51c0f2][_0x323e('0x52')]({'plain':!![]});_0x41ef4c[_0x323e('0x9e')]=_0x71d006[_0x323e('0x50')]['dialCheckDuplicateType']?_0x71d006[_0x323e('0x50')][_0x323e('0x9e')]:_0x41ef4c[_0x323e('0x9e')];switch(_0x41ef4c[_0x323e('0x9e')]){case _0x323e('0x9f'):_0x5f2903=squel['insert']()[_0x323e('0xa0')]('cm_hopper')[_0x323e('0xa1')]([_0x323e('0xa2'),_0x323e('0xa3'),_0x323e('0xa4'),'ListId',_0x323e('0x65'),_0x323e('0x5c'),'updatedAt'],squel[_0x323e('0x81')]()[_0x323e('0xa5')]('phone',_0x323e('0xa2'))[_0x323e('0xa5')]('NOW()',_0x323e('0xa3'))[_0x323e('0xa5')]('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62[_0x323e('0xa6')][_0x323e('0x89')](),'ListId')['field'](_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))['where'](_0x323e('0xa9'))['where'](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')]['toString']())[_0x323e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x323e('0x45')](_0x323e('0xab'),squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xac'))['from']('cm_hopper_final')[_0x323e('0x45')](_0x323e('0x87'),_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')]()))[_0x323e('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x323e('0xa5')](_0x323e('0xad'))[_0x323e('0x82')](_0x323e('0xae'))[_0x323e('0x45')](_0x323e('0x87'),_0x71d006['params']['id'][_0x323e('0x89')]())))[_0x323e('0x89')]();break;case _0x323e('0xaf'):_0x5f2903=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xae'))['fromQuery']([_0x323e('0xa2'),_0x323e('0xa3'),_0x323e('0xa4'),'ListId',_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()['field'](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')](_0x323e('0xa7'),'scheduledAt')[_0x323e('0xa5')]('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62['CmListId'][_0x323e('0x89')](),'ListId')[_0x323e('0xa5')](_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')](),'VoiceQueueId')['field'](_0x323e('0xa7'),'createdAt')[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))[_0x323e('0x45')](_0x323e('0xa9'))[_0x323e('0x45')](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')][_0x323e('0x89')]())[_0x323e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x323e('0x45')](_0x323e('0xab'),squel['select']()['field'](_0x323e('0xad'))[_0x323e('0x82')](_0x323e('0xae'))[_0x323e('0x45')](_0x323e('0x87'),_0x71d006[_0x323e('0x5a')]['id'][_0x323e('0x89')]())))[_0x323e('0x89')]();break;default:_0x5f2903=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xae'))[_0x323e('0xa1')]([_0x323e('0xa2'),'scheduledAt',_0x323e('0xa4'),_0x323e('0xb1'),_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0xa3'))['field']('id',_0x323e('0xa4'))[_0x323e('0xa5')](_0x215b62['CmListId'][_0x323e('0x89')](),_0x323e('0xb1'))[_0x323e('0xa5')](_0x71d006['params']['id']['toString'](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))[_0x323e('0xa5')](_0x323e('0xa7'),'updatedAt')[_0x323e('0x82')](_0x323e('0xa8'))['where'](_0x323e('0xa9'))[_0x323e('0x45')](_0x323e('0xaa'),_0x215b62[_0x323e('0xa6')][_0x323e('0x89')]())['where'](_0x323e('0xb2')))[_0x323e('0x89')]();}_0x552807[_0x323e('0x88')](db[_0x323e('0x76')][_0x323e('0x3e')](_0x5f2903));}return BPromise[_0x323e('0x98')](_0x552807);}})[_0x323e('0x29')](function(){return _0x5db545;})[_0x323e('0x29')](respondWithResult(_0x4463ea,null))['catch'](handleError(_0x4463ea,null));};exports[_0x323e('0xb3')]=function(_0x35fcf6,_0x14534a,_0x23842f){return db['VoiceQueue'][_0x323e('0x30')]({'where':{'id':_0x35fcf6[_0x323e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x14534a,null))['then'](function(_0x2a600e){if(_0x2a600e){return _0x2a600e[_0x323e('0xb3')](_0x35fcf6[_0x323e('0x3e')]['ids']);}})[_0x323e('0x29')](function(_0x7d2d66){if(_0x7d2d66){return db[_0x323e('0x61')][_0x323e('0x33')]({'where':{'ListId':_0x35fcf6['query'][_0x323e('0x80')],'VoiceQueueId':_0x35fcf6[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(){return _0x7d2d66;});}})[_0x323e('0x29')](respondWithStatusCode(_0x14534a,null))[_0x323e('0x4e')](handleError(_0x14534a,null));};exports[_0x323e('0xb4')]=function(_0x57c229,_0x41fc4c,_0x1eee16){var _0x40bf10={};var _0x428078={};var _0x2c9b5a;var _0x41eb6b;return db[_0x323e('0x3a')][_0x323e('0x60')]({'where':{'id':_0x57c229[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x41fc4c,null))[_0x323e('0x29')](function(_0x5134c7){if(_0x5134c7){_0x2c9b5a=_0x5134c7;_0x428078[_0x323e('0x3d')]=_[_0x323e('0x4c')](db[_0x323e('0xb5')][_0x323e('0x3b')]);_0x428078['query']=_[_0x323e('0x4c')](_0x57c229[_0x323e('0x3e')]);_0x428078[_0x323e('0x46')]=_[_0x323e('0x3f')](_0x428078['model'],_0x428078[_0x323e('0x3e')]);_0x40bf10[_0x323e('0x40')]=_['intersection'](_0x428078[_0x323e('0x3d')],qs['fields'](_0x57c229[_0x323e('0x3e')]['fields']));_0x40bf10['attributes']=_0x40bf10[_0x323e('0x40')][_0x323e('0x42')]?_0x40bf10['attributes']:_0x428078[_0x323e('0x3d')];_0x40bf10[_0x323e('0x44')]=qs[_0x323e('0x63')](_0x57c229[_0x323e('0x3e')][_0x323e('0x63')]);_0x40bf10[_0x323e('0x45')]=qs[_0x323e('0x46')](_['pick'](_0x57c229['query'],_0x428078[_0x323e('0x46')]));if(_0x57c229['query']['filter']){_0x40bf10['where']=_[_0x323e('0x48')](_0x40bf10['where'],{'$or':_[_0x323e('0x39')](_0x40bf10[_0x323e('0x40')],function(_0x1e7c4d){var _0x25d8e5={};_0x25d8e5[_0x1e7c4d]={'$like':'%'+_0x57c229['query'][_0x323e('0x47')]+'%'};return _0x25d8e5;})});}_0x40bf10=_['merge']({},_0x40bf10,_0x57c229[_0x323e('0x49')]);return _0x2c9b5a[_0x323e('0xb4')](_0x40bf10);}})[_0x323e('0x29')](function(_0x2b804d){if(_0x2b804d){_0x41eb6b=_0x2b804d[_0x323e('0x42')];if(!_0x57c229[_0x323e('0x3e')]['hasOwnProperty']('nolimit')){_0x40bf10['limit']=qs[_0x323e('0x23')](_0x57c229['query'][_0x323e('0x23')]);_0x40bf10[_0x323e('0x21')]=qs['offset'](_0x57c229[_0x323e('0x3e')][_0x323e('0x21')]);}return _0x2c9b5a[_0x323e('0xb4')](_0x40bf10);}})['then'](function(_0x367c0f){if(_0x367c0f){return _0x367c0f?{'count':_0x41eb6b,'rows':_0x367c0f}:null;}})['then'](respondWithResult(_0x41fc4c,null))[_0x323e('0x4e')](handleError(_0x41fc4c,null));};exports[_0x323e('0xb6')]=function(_0x1d6473,_0x1ccc9e,_0x41909f){var _0x5ab07e,_0x5afbca;return db[_0x323e('0x3a')]['find']({'where':{'id':_0x1d6473['params']['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x1ccc9e,null))['then'](function(_0x3b81a4){if(_0x3b81a4){_0x5afbca=_0x3b81a4;return _0x3b81a4[_0x323e('0xb6')](_0x1d6473[_0x323e('0x50')][_0x323e('0x80')],_[_0x323e('0x5b')](_0x1d6473['body'],[_0x323e('0x80'),'id'])||{});}return null;})[_0x323e('0x95')](function(_0x5053bb){var _0x23c0f9;_0x5ab07e=_0x5053bb||[];var _0x1e358d=[];if(_0x5053bb){for(var _0x1746b6=0x0;_0x1746b6<_0x5053bb[_0x323e('0x42')];_0x1746b6+=0x1){var _0x3c8846=_0x5053bb[_0x1746b6][_0x323e('0x52')]({'plain':!![]});_0x23c0f9=squel[_0x323e('0xb0')]()[_0x323e('0xa0')](_0x323e('0xb7'))[_0x323e('0xa1')]([_0x323e('0xa2'),'ContactId','ListId',_0x323e('0x65'),_0x323e('0x5c'),_0x323e('0x5d')],squel[_0x323e('0x81')]()[_0x323e('0xa5')](_0x323e('0xa2'),_0x323e('0xa2'))[_0x323e('0xa5')]('id',_0x323e('0xa4'))['field'](_0x3c8846[_0x323e('0xa6')][_0x323e('0x89')](),_0x323e('0xb1'))['field'](_0x1d6473[_0x323e('0x5a')]['id']['toString'](),_0x323e('0x65'))[_0x323e('0xa5')](_0x323e('0xa7'),_0x323e('0x5c'))['field']('NOW()',_0x323e('0x5d'))[_0x323e('0x82')](_0x323e('0xa8'))[_0x323e('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x323e('0xaa'),_0x3c8846['CmListId'][_0x323e('0x89')]())[_0x323e('0x45')](_0x323e('0xb2')))['toString']();_0x1e358d['push'](db[_0x323e('0x76')][_0x323e('0x3e')](_0x23c0f9));}return BPromise['all'](_0x1e358d);}})['then'](function(){return _0x5ab07e;})['then'](respondWithResult(_0x1ccc9e,null))[_0x323e('0x4e')](handleError(_0x1ccc9e,null));};exports[_0x323e('0xb8')]=function(_0x5c65fa,_0x189dd4,_0x1eb5ac){return db[_0x323e('0x3a')]['find']({'where':{'id':_0x5c65fa[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](handleEntityNotFound(_0x189dd4,null))['then'](function(_0x398f25){if(_0x398f25){return _0x398f25[_0x323e('0xb8')](_0x5c65fa[_0x323e('0x3e')]['ids']);}})[_0x323e('0x29')](function(_0x243e1a){if(_0x243e1a){return db[_0x323e('0x6c')][_0x323e('0x33')]({'where':{'ListId':_0x5c65fa[_0x323e('0x3e')][_0x323e('0x80')],'VoiceQueueId':_0x5c65fa[_0x323e('0x5a')]['id']}})[_0x323e('0x29')](function(){return _0x243e1a;});}})[_0x323e('0x29')](respondWithStatusCode(_0x189dd4,null))[_0x323e('0x4e')](handleError(_0x189dd4,null));}; \ No newline at end of file +var _0x6157=['key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','filters','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','VoiceQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','role','UserProfileSection','getHoppers','findOne','CmHopper','order','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','hasOwnProperty','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','voicePause','isArray','destroy','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','insert','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','update','then','get','QueueCampaigns','outbound','map','value','includes','type','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName'];(function(_0x1ef863,_0x3d7b1f){var _0x3a18ab=function(_0x2ebe5a){while(--_0x2ebe5a){_0x1ef863['push'](_0x1ef863['shift']());}};_0x3a18ab(++_0x3d7b1f);}(_0x6157,0x13a));var _0x7615=function(_0xfa47d7,_0x10347b){_0xfa47d7=_0xfa47d7-0x0;var _0x5a4114=_0x6157[_0xfa47d7];return _0x5a4114;};'use strict';var emlformat=require(_0x7615('0x0'));var rimraf=require(_0x7615('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7615('0x2'));var rp=require('request-promise');var moment=require(_0x7615('0x3'));var BPromise=require(_0x7615('0x4'));var Mustache=require(_0x7615('0x5'));var util=require('util');var path=require(_0x7615('0x6'));var sox=require(_0x7615('0x7'));var csv=require('to-csv');var ejs=require(_0x7615('0x8'));var fs=require('fs');var fs_extra=require(_0x7615('0x9'));var _=require(_0x7615('0xa'));var squel=require('squel');var crypto=require(_0x7615('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7615('0xc'));var toCsv=require(_0x7615('0xd'));var querystring=require(_0x7615('0xe'));var Papa=require('papaparse');var Redis=require(_0x7615('0xf'));var authService=require(_0x7615('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7615('0x11'));var hardwareService=require(_0x7615('0x12'));var logger=require('../../config/logger')(_0x7615('0x13'));var utils=require(_0x7615('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7615('0x15'));var db=require('../../mysqldb')['db'];config[_0x7615('0x16')]=_[_0x7615('0x17')](config[_0x7615('0x16')],{'host':_0x7615('0x18'),'port':0x18eb});var socket=require(_0x7615('0x19'))(new Redis(config[_0x7615('0x16')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x234cfe,_0x677041){_0x677041=_0x677041||0xcc;return function(_0x1c5245){if(_0x1c5245){return _0x234cfe[_0x7615('0x1a')](_0x677041);}return _0x234cfe['status'](_0x677041)[_0x7615('0x1b')]();};}function respondWithResult(_0x11e12d,_0x595495){_0x595495=_0x595495||0xc8;return function(_0x1f244f){if(_0x1f244f){return _0x11e12d[_0x7615('0x1c')](_0x595495)[_0x7615('0x1d')](_0x1f244f);}};}function respondWithFilteredResult(_0x56daea,_0xcfb17f){return function(_0x22dbcf){if(_0x22dbcf){var _0x27a5f6=typeof _0xcfb17f['offset']==='undefined'&&typeof _0xcfb17f['limit']===_0x7615('0x1e');var _0x5a58d8=_0x22dbcf['count'];var _0x6d36d1=_0x27a5f6?0x0:_0xcfb17f[_0x7615('0x1f')];var _0x208b65=_0x27a5f6?_0x22dbcf['count']:_0xcfb17f[_0x7615('0x1f')]+_0xcfb17f[_0x7615('0x20')];var _0x4b3bab;if(_0x208b65>=_0x5a58d8){_0x208b65=_0x5a58d8;_0x4b3bab=0xc8;}else{_0x4b3bab=0xce;}_0x56daea[_0x7615('0x1c')](_0x4b3bab);return _0x56daea[_0x7615('0x21')](_0x7615('0x22'),_0x6d36d1+'-'+_0x208b65+'/'+_0x5a58d8)[_0x7615('0x1d')](_0x22dbcf);}return null;};}function patchUpdates(_0x1a0952){return function(_0x1010a8){try{jsonpatch[_0x7615('0x23')](_0x1010a8,_0x1a0952,!![]);}catch(_0xe2126e){return BPromise['reject'](_0xe2126e);}return _0x1010a8['save']();};}function saveUpdates(_0x3288b6,_0x67c1b8){return function(_0x40ac91){if(_0x40ac91){return _0x40ac91[_0x7615('0x24')](_0x3288b6)[_0x7615('0x25')](function(_0x51d6d1){return _0x51d6d1;});}return null;};}function removeEntity(_0x257082,_0x5417bb){return function(_0x4fa675){if(_0x4fa675){return _0x4fa675['destroy']()['then'](function(){var _0x5a6f7d=_0x4fa675[_0x7615('0x26')]({'plain':!![]});var _0xc75df9=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x7615('0x27'),'value':_0x7615('0x28'),'ignore':![]}];var _0x1ef76d=_(_0xc75df9)['filter']('ignore')[_0x7615('0x29')](_0x7615('0x2a'))[_0x7615('0x2a')]();if(_[_0x7615('0x2b')](_0x1ef76d,_0x5a6f7d[_0x7615('0x2c')])){return;}var _0x47a8cc=_[_0x7615('0x2d')](_0xc75df9,[_0x7615('0x2a'),_0x5a6f7d[_0x7615('0x2c')]])[_0x7615('0x2e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x47a8cc,'resourceId':_0x5a6f7d['id']}})['then'](function(){return _0x4fa675;});})[_0x7615('0x25')](function(){_0x257082['status'](0xcc)[_0x7615('0x1b')]();});}};}function handleEntityNotFound(_0x3085bc,_0x213aff){return function(_0x26fb4a){if(!_0x26fb4a){_0x3085bc['sendStatus'](0x194);}return _0x26fb4a;};}function handleError(_0x27dff4,_0x460258){_0x460258=_0x460258||0x1f4;return function(_0x31f06d){logger[_0x7615('0x2f')](_0x31f06d[_0x7615('0x30')]);if(_0x31f06d[_0x7615('0x2e')]){delete _0x31f06d[_0x7615('0x2e')];}_0x27dff4[_0x7615('0x1c')](_0x460258)[_0x7615('0x31')](_0x31f06d);};}exports[_0x7615('0x32')]=function(_0x2169cd,_0xcfdfc7){var _0x5c4cf8={},_0x221aa9={},_0x18b913={'count':0x0,'rows':[]};var _0x4ce7c4=_[_0x7615('0x29')](db[_0x7615('0x33')][_0x7615('0x34')],function(_0x230542){return{'name':_0x230542[_0x7615('0x35')],'type':_0x230542[_0x7615('0x2c')][_0x7615('0x36')]};});_0x221aa9['model']=_[_0x7615('0x29')](_0x4ce7c4,_0x7615('0x2e'));_0x221aa9[_0x7615('0x37')]=_[_0x7615('0x38')](_0x2169cd[_0x7615('0x37')]);_0x221aa9['filters']=_[_0x7615('0x39')](_0x221aa9[_0x7615('0x3a')],_0x221aa9[_0x7615('0x37')]);_0x5c4cf8[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x221aa9[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x2169cd[_0x7615('0x37')][_0x7615('0x3c')]));_0x5c4cf8['attributes']=_0x5c4cf8[_0x7615('0x3b')][_0x7615('0x3d')]?_0x5c4cf8['attributes']:_0x221aa9[_0x7615('0x3a')];if(!_0x2169cd[_0x7615('0x37')]['hasOwnProperty'](_0x7615('0x3e'))){_0x5c4cf8[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x2169cd[_0x7615('0x37')][_0x7615('0x20')]);_0x5c4cf8['offset']=qs[_0x7615('0x1f')](_0x2169cd[_0x7615('0x37')][_0x7615('0x1f')]);}_0x5c4cf8['order']=qs[_0x7615('0x3f')](_0x2169cd[_0x7615('0x37')][_0x7615('0x3f')]);_0x5c4cf8[_0x7615('0x40')]=qs['filters'](_[_0x7615('0x41')](_0x2169cd[_0x7615('0x37')],_0x221aa9['filters']),_0x4ce7c4);if(_0x2169cd[_0x7615('0x37')][_0x7615('0x42')]){_0x5c4cf8['where']=_[_0x7615('0x43')](_0x5c4cf8['where'],{'$or':_['map'](_0x4ce7c4,function(_0x5555cb){if(_0x5555cb[_0x7615('0x2c')]!==_0x7615('0x44')){var _0x309bcf={};_0x309bcf[_0x5555cb['name']]={'$like':'%'+_0x2169cd[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0x309bcf;}})});}_0x5c4cf8=_['merge']({},_0x5c4cf8,_0x2169cd[_0x7615('0x45')]);var _0x186869={'where':_0x5c4cf8[_0x7615('0x40')]};return db[_0x7615('0x33')][_0x7615('0x46')](_0x186869)['then'](function(_0x289be9){_0x18b913[_0x7615('0x46')]=_0x289be9;if(_0x2169cd[_0x7615('0x37')][_0x7615('0x47')]){_0x5c4cf8[_0x7615('0x48')]=[{'all':!![]}];}return db[_0x7615('0x33')][_0x7615('0x49')](_0x5c4cf8);})[_0x7615('0x25')](function(_0x401d25){_0x18b913[_0x7615('0x4a')]=_0x401d25;return _0x18b913;})[_0x7615('0x25')](respondWithFilteredResult(_0xcfdfc7,_0x5c4cf8))[_0x7615('0x4b')](handleError(_0xcfdfc7,null));};exports[_0x7615('0x4c')]=function(_0x244982,_0x577398){var _0x24a035={'raw':![],'where':{'id':_0x244982[_0x7615('0x4d')]['id']}},_0x40d2a5={};_0x40d2a5[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x33')]['rawAttributes']);_0x40d2a5['query']=_[_0x7615('0x38')](_0x244982[_0x7615('0x37')]);_0x40d2a5[_0x7615('0x4e')]=_['intersection'](_0x40d2a5[_0x7615('0x3a')],_0x40d2a5[_0x7615('0x37')]);_0x24a035[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x40d2a5[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x244982['query'][_0x7615('0x3c')]));_0x24a035['attributes']=_0x24a035['attributes'][_0x7615('0x3d')]?_0x24a035['attributes']:_0x40d2a5[_0x7615('0x3a')];if(_0x244982[_0x7615('0x37')][_0x7615('0x47')]){_0x24a035[_0x7615('0x48')]=[{'all':!![]}];}_0x24a035=_['merge']({},_0x24a035,_0x244982[_0x7615('0x45')]);return db[_0x7615('0x33')][_0x7615('0x2d')](_0x24a035)['then'](handleEntityNotFound(_0x577398,null))[_0x7615('0x25')](respondWithResult(_0x577398,null))[_0x7615('0x4b')](handleError(_0x577398,null));};exports[_0x7615('0x4f')]=function(_0xcc368d,_0x2aeee9){return db[_0x7615('0x33')]['create'](_0xcc368d['body'],{})[_0x7615('0x25')](function(_0x8bc1e8){var _0x57f826=_0xcc368d['user']['get']({'plain':!![]});if(!_0x57f826)throw new Error(_0x7615('0x50'));if(_0x57f826['role']===_0x7615('0x51')){var _0x232261=_0x8bc1e8['get']({'plain':!![]});var _0x229aea=[{'name':_0x7615('0x52'),'value':'inbound'},{'name':_0x7615('0x27'),'value':_0x7615('0x28')}];var _0x25132b=_[_0x7615('0x2d')](_0x229aea,[_0x7615('0x2a'),_0x232261[_0x7615('0x2c')]])[_0x7615('0x2e')];return db['UserProfileSection'][_0x7615('0x2d')]({'where':{'name':_0x25132b,'userProfileId':_0x57f826[_0x7615('0x53')]},'raw':!![]})['then'](function(_0x2c47d7){if(_0x2c47d7&&_0x2c47d7[_0x7615('0x54')]===0x0){return db['UserProfileResource'][_0x7615('0x4f')]({'name':_0x232261['name'],'resourceId':_0x232261['id'],'type':_0x2c47d7['name'],'sectionId':_0x2c47d7['id']},{})[_0x7615('0x25')](function(){return _0x8bc1e8;});}else{return _0x8bc1e8;}})['catch'](function(_0x53d0d2){logger[_0x7615('0x2f')](_0x7615('0x55'),_0x53d0d2);throw _0x53d0d2;});}return _0x8bc1e8;})[_0x7615('0x25')](respondWithResult(_0x2aeee9,0xc9))['catch'](handleError(_0x2aeee9,null));};exports[_0x7615('0x56')]=function(_0x129ee9,_0x5ad205){var _0x578148={'where':{'id':_0x129ee9[_0x7615('0x4d')]['id']}},_0x551631={};_0x551631[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x33')]['rawAttributes']);_0x578148[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x551631[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x129ee9[_0x7615('0x37')][_0x7615('0x3c')]));_0x578148[_0x7615('0x3b')]=_0x578148[_0x7615('0x3b')][_0x7615('0x3d')]?_0x578148[_0x7615('0x3b')]:_0x551631[_0x7615('0x3a')];if(_0x129ee9['query'][_0x7615('0x47')]){_0x578148[_0x7615('0x48')]=[{'all':!![]}];}_0x578148=_['merge']({},_0x578148,_0x129ee9[_0x7615('0x45')]);return db[_0x7615('0x33')][_0x7615('0x2d')](_0x578148)[_0x7615('0x25')](handleEntityNotFound(_0x5ad205,null))['then'](function(_0x44a15b){if(_0x44a15b){var _0xa45a1=_0x44a15b['get']({'plain':!![]});_0xa45a1=qs[_0x7615('0x57')](_0xa45a1,['id',_0x7615('0x58'),_0x7615('0x59')]);_0x129ee9['body']=_[_0x7615('0x57')](_0x129ee9['body'],['id',_0x7615('0x58'),_0x7615('0x59')]);return db[_0x7615('0x33')][_0x7615('0x4f')](_[_0x7615('0x43')](_0xa45a1,_0x129ee9[_0x7615('0x5a')]),{'include':_0x129ee9[_0x7615('0x37')][_0x7615('0x47')]?[{'all':!![]}]:undefined})[_0x7615('0x25')](function(_0x5d0880){var _0x2bc284=_0x129ee9[_0x7615('0x51')][_0x7615('0x26')]({'plain':!![]});if(!_0x2bc284)throw new Error(_0x7615('0x50'));if(_0x2bc284[_0x7615('0x5b')]===_0x7615('0x51')){var _0x40f1aa=_0x5d0880[_0x7615('0x26')]({'plain':!![]});var _0x1c58a8=[{'name':_0x7615('0x52'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x7615('0x28')}];var _0x45ca0a=_[_0x7615('0x2d')](_0x1c58a8,[_0x7615('0x2a'),_0x40f1aa[_0x7615('0x2c')]])['name'];return db[_0x7615('0x5c')][_0x7615('0x2d')]({'where':{'name':_0x45ca0a,'userProfileId':_0x2bc284[_0x7615('0x53')]},'raw':!![]})[_0x7615('0x25')](function(_0x101e0e){if(_0x101e0e&&_0x101e0e[_0x7615('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x40f1aa[_0x7615('0x2e')],'resourceId':_0x40f1aa['id'],'type':_0x101e0e[_0x7615('0x2e')],'sectionId':_0x101e0e['id']},{})[_0x7615('0x25')](function(){return _0x5d0880;});}else{return _0x5d0880;}})[_0x7615('0x4b')](function(_0x558e5){logger[_0x7615('0x2f')](_0x7615('0x55'),_0x558e5);throw _0x558e5;});}return _0x5d0880;});}})[_0x7615('0x25')](respondWithResult(_0x5ad205,0xc9))['catch'](handleError(_0x5ad205,null));};exports[_0x7615('0x24')]=function(_0x1d2e3a,_0x40ab11){if(_0x1d2e3a[_0x7615('0x5a')]['id']){delete _0x1d2e3a['body']['id'];}return db[_0x7615('0x33')][_0x7615('0x2d')]({'where':{'id':_0x1d2e3a[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x40ab11,null))[_0x7615('0x25')](saveUpdates(_0x1d2e3a[_0x7615('0x5a')],null))['then'](respondWithResult(_0x40ab11,null))[_0x7615('0x4b')](handleError(_0x40ab11,null));};exports['destroy']=function(_0x260be3,_0x4838ee){return db[_0x7615('0x33')][_0x7615('0x2d')]({'where':{'id':_0x260be3[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x4838ee,null))['then'](removeEntity(_0x4838ee,null))['catch'](handleError(_0x4838ee,null));};exports[_0x7615('0x5d')]=function(_0x47b727,_0x5b095d,_0x3c3e30){var _0x27cfee={'raw':![],'where':{}};var _0x204d02={};var _0x122e1a={'count':0x0,'rows':[]};return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x47b727[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x5b095d,null))[_0x7615('0x25')](function(_0x2c7c49){if(_0x2c7c49){_0x204d02['model']=_[_0x7615('0x38')](db[_0x7615('0x5f')][_0x7615('0x34')]);_0x204d02['query']=_[_0x7615('0x38')](_0x47b727[_0x7615('0x37')]);_0x204d02[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x204d02[_0x7615('0x3a')],_0x204d02[_0x7615('0x37')]);_0x27cfee['attributes']=_[_0x7615('0x39')](_0x204d02[_0x7615('0x3a')],qs['fields'](_0x47b727[_0x7615('0x37')]['fields']));_0x27cfee[_0x7615('0x3b')]=_0x27cfee['attributes'][_0x7615('0x3d')]?_0x27cfee[_0x7615('0x3b')]:_0x204d02[_0x7615('0x3a')];if(!_0x47b727[_0x7615('0x37')]['hasOwnProperty'](_0x7615('0x3e'))){_0x27cfee[_0x7615('0x20')]=qs['limit'](_0x47b727['query'][_0x7615('0x20')]);_0x27cfee['offset']=qs[_0x7615('0x1f')](_0x47b727['query']['offset']);}_0x27cfee[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x47b727[_0x7615('0x37')][_0x7615('0x3f')]);_0x27cfee['where']=qs['filters'](_['pick'](_0x47b727[_0x7615('0x37')],_0x204d02[_0x7615('0x4e')]));_0x27cfee[_0x7615('0x40')][_0x7615('0x61')]=_0x2c7c49['id'];if(_0x47b727[_0x7615('0x37')][_0x7615('0x42')]){_0x27cfee['where']=_['merge'](_0x27cfee[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x27cfee[_0x7615('0x3b')],function(_0x3bb1fd){var _0xe77057={};_0xe77057[_0x3bb1fd]={'$like':'%'+_0x47b727[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0xe77057;})});}_0x27cfee=_['merge']({},_0x27cfee,_0x47b727[_0x7615('0x45')]);return db[_0x7615('0x5f')][_0x7615('0x46')]({'where':_0x27cfee[_0x7615('0x40')]})[_0x7615('0x25')](function(_0x26e094){_0x122e1a[_0x7615('0x46')]=_0x26e094;if(_0x47b727[_0x7615('0x37')][_0x7615('0x47')]){_0x27cfee[_0x7615('0x48')]=[{'all':!![]}];}return db[_0x7615('0x5f')]['findAll'](_0x27cfee);})['then'](function(_0x4d1830){_0x122e1a['rows']=_0x4d1830;return _0x122e1a;});}})[_0x7615('0x25')](respondWithFilteredResult(_0x5b095d,_0x27cfee))[_0x7615('0x4b')](handleError(_0x5b095d,null));};exports[_0x7615('0x62')]=function(_0x523c98,_0x4b47c3,_0x48c199){var _0x344b58={'raw':!![],'where':{}};var _0x1fca0c={};var _0x351a39={'count':0x0,'rows':[]};return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x523c98[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x4b47c3,null))[_0x7615('0x25')](function(_0x56e8bd){if(_0x56e8bd){_0x1fca0c['model']=_['keys'](db[_0x7615('0x63')][_0x7615('0x34')]);_0x1fca0c[_0x7615('0x37')]=_['keys'](_0x523c98[_0x7615('0x37')]);_0x1fca0c[_0x7615('0x4e')]=_['intersection'](_0x1fca0c[_0x7615('0x3a')],_0x1fca0c['query']);_0x344b58[_0x7615('0x3b')]=_['intersection'](_0x1fca0c[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x523c98[_0x7615('0x37')][_0x7615('0x3c')]));_0x344b58[_0x7615('0x3b')]=_0x344b58['attributes']['length']?_0x344b58[_0x7615('0x3b')]:_0x1fca0c[_0x7615('0x3a')];if(!_0x523c98[_0x7615('0x37')]['hasOwnProperty']('nolimit')){_0x344b58[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x523c98[_0x7615('0x37')][_0x7615('0x20')]);_0x344b58['offset']=qs[_0x7615('0x1f')](_0x523c98[_0x7615('0x37')][_0x7615('0x1f')]);}_0x344b58[_0x7615('0x60')]=qs['sort'](_0x523c98[_0x7615('0x37')][_0x7615('0x3f')]);_0x344b58[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x523c98['query'],_0x1fca0c[_0x7615('0x4e')]));_0x344b58[_0x7615('0x40')][_0x7615('0x61')]=_0x56e8bd['id'];if(_0x523c98[_0x7615('0x37')][_0x7615('0x42')]){_0x344b58['where']=_[_0x7615('0x43')](_0x344b58['where'],{'$or':_['map'](_0x344b58['attributes'],function(_0x5cff7d){var _0x356417={};_0x356417[_0x5cff7d]={'$like':'%'+_0x523c98[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0x356417;})});}_0x344b58=_['merge']({},_0x344b58,_0x523c98[_0x7615('0x45')]);return db[_0x7615('0x63')][_0x7615('0x46')]({'where':_0x344b58[_0x7615('0x40')]})[_0x7615('0x25')](function(_0x3ea7c7){_0x351a39[_0x7615('0x46')]=_0x3ea7c7;if(_0x523c98['query'][_0x7615('0x47')]){_0x344b58['include']=[{'all':!![]}];}return db[_0x7615('0x63')][_0x7615('0x49')](_0x344b58);})[_0x7615('0x25')](function(_0x58c2da){_0x351a39['rows']=_0x58c2da;return _0x351a39;});}})[_0x7615('0x25')](respondWithFilteredResult(_0x4b47c3,_0x344b58))[_0x7615('0x4b')](handleError(_0x4b47c3,null));};exports[_0x7615('0x64')]=function(_0x3eea45,_0x47069a,_0x15d077){var _0x2f5f3d={'raw':!![],'where':{}};var _0x7a5706={};var _0x4cb23d={'count':0x0,'rows':[]};return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x3eea45[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x47069a,null))[_0x7615('0x25')](function(_0x3cec2a){if(_0x3cec2a){_0x7a5706[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x65')][_0x7615('0x34')]);_0x7a5706[_0x7615('0x37')]=_['keys'](_0x3eea45[_0x7615('0x37')]);_0x7a5706[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x7a5706[_0x7615('0x3a')],_0x7a5706[_0x7615('0x37')]);_0x2f5f3d[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x7a5706[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x3eea45[_0x7615('0x37')][_0x7615('0x3c')]));_0x2f5f3d['attributes']=_0x2f5f3d[_0x7615('0x3b')][_0x7615('0x3d')]?_0x2f5f3d[_0x7615('0x3b')]:_0x7a5706['model'];if(!_0x3eea45['query']['hasOwnProperty'](_0x7615('0x3e'))){_0x2f5f3d['limit']=qs[_0x7615('0x20')](_0x3eea45[_0x7615('0x37')][_0x7615('0x20')]);_0x2f5f3d[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x3eea45[_0x7615('0x37')]['offset']);}_0x2f5f3d[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x3eea45['query'][_0x7615('0x3f')]);_0x2f5f3d[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x3eea45[_0x7615('0x37')],_0x7a5706[_0x7615('0x4e')]));_0x2f5f3d[_0x7615('0x40')][_0x7615('0x61')]=_0x3cec2a['id'];if(_0x3eea45['query'][_0x7615('0x42')]){_0x2f5f3d[_0x7615('0x40')]=_[_0x7615('0x43')](_0x2f5f3d[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x2f5f3d['attributes'],function(_0x10b7db){var _0x34dcaa={};_0x34dcaa[_0x10b7db]={'$like':'%'+_0x3eea45[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0x34dcaa;})});}_0x2f5f3d=_['merge']({},_0x2f5f3d,_0x3eea45[_0x7615('0x45')]);return db[_0x7615('0x65')][_0x7615('0x46')]({'where':_0x2f5f3d[_0x7615('0x40')]})[_0x7615('0x25')](function(_0x52ec7f){_0x4cb23d[_0x7615('0x46')]=_0x52ec7f;if(_0x3eea45[_0x7615('0x37')]['includeAll']){_0x2f5f3d[_0x7615('0x48')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2f5f3d);})['then'](function(_0x528373){_0x4cb23d[_0x7615('0x4a')]=_0x528373;return _0x4cb23d;});}})['then'](respondWithFilteredResult(_0x47069a,_0x2f5f3d))[_0x7615('0x4b')](handleError(_0x47069a,null));};exports['getHopperBlacks']=function(_0x3d1221,_0x44a8fe,_0x2e8c32){var _0x42a62e={'raw':!![],'where':{}};var _0x590d02={};var _0x424e49={'count':0x0,'rows':[]};return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x3d1221[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x44a8fe,null))[_0x7615('0x25')](function(_0x5e522b){if(_0x5e522b){_0x590d02[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x66')][_0x7615('0x34')]);_0x590d02['query']=_[_0x7615('0x38')](_0x3d1221[_0x7615('0x37')]);_0x590d02[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x590d02['model'],_0x590d02['query']);_0x42a62e[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x590d02[_0x7615('0x3a')],qs['fields'](_0x3d1221[_0x7615('0x37')][_0x7615('0x3c')]));_0x42a62e[_0x7615('0x3b')]=_0x42a62e[_0x7615('0x3b')]['length']?_0x42a62e[_0x7615('0x3b')]:_0x590d02['model'];if(!_0x3d1221[_0x7615('0x37')][_0x7615('0x67')](_0x7615('0x3e'))){_0x42a62e['limit']=qs['limit'](_0x3d1221[_0x7615('0x37')]['limit']);_0x42a62e[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x3d1221[_0x7615('0x37')][_0x7615('0x1f')]);}_0x42a62e[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x3d1221[_0x7615('0x37')]['sort']);_0x42a62e[_0x7615('0x40')]=qs[_0x7615('0x4e')](_['pick'](_0x3d1221[_0x7615('0x37')],_0x590d02[_0x7615('0x4e')]));_0x42a62e[_0x7615('0x40')][_0x7615('0x61')]=_0x5e522b['id'];if(_0x3d1221[_0x7615('0x37')]['filter']){_0x42a62e[_0x7615('0x40')]=_[_0x7615('0x43')](_0x42a62e[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x42a62e[_0x7615('0x3b')],function(_0x215c32){var _0x515212={};_0x515212[_0x215c32]={'$like':'%'+_0x3d1221[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0x515212;})});}_0x42a62e=_[_0x7615('0x43')]({},_0x42a62e,_0x3d1221['options']);return db[_0x7615('0x66')]['count']({'where':_0x42a62e[_0x7615('0x40')]})[_0x7615('0x25')](function(_0x561635){_0x424e49['count']=_0x561635;if(_0x3d1221[_0x7615('0x37')]['includeAll']){_0x42a62e[_0x7615('0x48')]=[{'all':!![]}];}return db[_0x7615('0x66')]['findAll'](_0x42a62e);})['then'](function(_0x2d51b6){_0x424e49[_0x7615('0x4a')]=_0x2d51b6;return _0x424e49;});}})[_0x7615('0x25')](respondWithFilteredResult(_0x44a8fe,_0x42a62e))[_0x7615('0x4b')](handleError(_0x44a8fe,null));};exports[_0x7615('0x68')]=function(_0x5d55f2,_0x478e1e,_0x2c37a9){var _0x53192f={};var _0x40f0e4={};var _0x262d3f;var _0x347f18;return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x5d55f2[_0x7615('0x4d')]['id']}})['then'](handleEntityNotFound(_0x478e1e,null))[_0x7615('0x25')](function(_0x1d5be){if(_0x1d5be){_0x262d3f=_0x1d5be;_0x40f0e4[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x69')][_0x7615('0x34')]);_0x40f0e4[_0x7615('0x37')]=_[_0x7615('0x38')](_0x5d55f2[_0x7615('0x37')]);_0x40f0e4[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x40f0e4[_0x7615('0x3a')],_0x40f0e4[_0x7615('0x37')]);_0x53192f[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x40f0e4[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x5d55f2[_0x7615('0x37')][_0x7615('0x3c')]));_0x53192f[_0x7615('0x3b')]=_0x53192f[_0x7615('0x3b')][_0x7615('0x3d')]?_0x53192f[_0x7615('0x3b')]:_0x40f0e4['model'];_0x53192f['order']=qs['sort'](_0x5d55f2['query'][_0x7615('0x3f')]);_0x53192f[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x5d55f2[_0x7615('0x37')],_0x40f0e4['filters']));if(_0x5d55f2[_0x7615('0x37')][_0x7615('0x42')]){_0x53192f[_0x7615('0x40')]=_[_0x7615('0x43')](_0x53192f[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x53192f[_0x7615('0x3b')],function(_0x5d495e){var _0x444a98={};_0x444a98[_0x5d495e]={'$like':'%'+_0x5d55f2[_0x7615('0x37')][_0x7615('0x42')]+'%'};return _0x444a98;})});}_0x53192f=_['merge']({},_0x53192f,_0x5d55f2['options']);return _0x262d3f['getTeams'](_0x53192f);}})[_0x7615('0x25')](function(_0x5aa8b3){if(_0x5aa8b3){_0x347f18=_0x5aa8b3[_0x7615('0x3d')];if(!_0x5d55f2[_0x7615('0x37')][_0x7615('0x67')](_0x7615('0x3e'))){_0x53192f[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x5d55f2[_0x7615('0x37')][_0x7615('0x20')]);_0x53192f['offset']=qs[_0x7615('0x1f')](_0x5d55f2['query'][_0x7615('0x1f')]);}return _0x262d3f[_0x7615('0x68')](_0x53192f);}})[_0x7615('0x25')](function(_0x571a80){if(_0x571a80){return _0x571a80?{'count':_0x347f18,'rows':_0x571a80}:null;}})[_0x7615('0x25')](respondWithResult(_0x478e1e,null))[_0x7615('0x4b')](handleError(_0x478e1e,null));};exports[_0x7615('0x6a')]=function(_0x1fe1c7,_0x414d49,_0x2b15e3){var _0xfefcd4=_0x1fe1c7[_0x7615('0x5a')][_0x7615('0x6b')];var _0x12bada=_[_0x7615('0x29')](_0xfefcd4,'id');return db['Team'][_0x7615('0x49')]({'where':{'id':_0x12bada},'attributes':['id'],'include':[{'model':db[_0x7615('0x6c')],'as':_0x7615('0x6d'),'attributes':['id',_0x7615('0x2e'),_0x7615('0x6e'),'voicePause',_0x7615('0x6f')],'raw':!![]}]})[_0x7615('0x25')](function(_0x2eee18){if(_0x2eee18){var _0x3e49ed=_[_0x7615('0x70')](_0x2eee18,function(_0x56759b){var _0x59b86d=_0x56759b[_0x7615('0x26')]({'plain':!![]});_0x59b86d[_0x7615('0x6d')]['forEach'](function(_0x2a3b51){_0x2a3b51[_0x7615('0x71')]=_[_0x7615('0x2d')](_0xfefcd4,{'id':_0x59b86d['id']})[_0x7615('0x71')];});return _0x59b86d[_0x7615('0x6d')];});return db['VoiceQueue']['find']({'where':{'id':_0x1fe1c7[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](function(_0x492126){return db[_0x7615('0x72')][_0x7615('0x73')](function(_0xe70d73){return _0x492126[_0x7615('0x6a')](_0x12bada,{'transaction':_0xe70d73})[_0x7615('0x25')](function(){return BPromise[_0x7615('0x74')](_0xfefcd4,function(_0x748f71){return db['TeamVoiceQueue'][_0x7615('0x75')]({'TeamId':_0x748f71['id'],'VoiceQueueId':_0x1fe1c7[_0x7615('0x4d')]['id'],'penalty':_0x748f71[_0x7615('0x71')]},{'transaction':_0xe70d73});});})[_0x7615('0x25')](function(){return BPromise['each'](_0x3e49ed,function(_0x13089b){return db[_0x7615('0x76')][_0x7615('0x77')]({'where':{'UserId':_0x13089b['id'],'VoiceQueueId':_0x1fe1c7[_0x7615('0x4d')]['id']},'defaults':{'penalty':_0x13089b[_0x7615('0x71')]},'transaction':_0xe70d73});});})['then'](function(){return BPromise['each'](_[_0x7615('0x42')](_0x3e49ed,{'online':!![]}),function(_0x5da182){return db[_0x7615('0x78')][_0x7615('0x75')]({'membername':_0x5da182[_0x7615('0x2e')],'UserId':_0x5da182['id'],'queue_name':_0x492126[_0x7615('0x2e')],'VoiceQueueId':_0x492126['id'],'interface':_[_0x7615('0x79')](_0x5da182[_0x7615('0x6f')])?util[_0x7615('0x7a')](_0x7615('0x7b'),_0x5da182[_0x7615('0x2e')]):_0x5da182[_0x7615('0x6f')],'paused':_0x5da182['voicePause']||![],'penalty':_0x5da182[_0x7615('0x71')]},{'transaction':_0xe70d73});});})['then'](function(){_0x3e49ed[_0x7615('0x7c')](function(_0x5d8952){socket[_0x7615('0x7d')](_0x7615('0x7e'),{'UserId':_0x5d8952['id'],'VoiceQueueId':_0x492126['id']});});});});});}})[_0x7615('0x25')](respondWithStatusCode(_0x414d49,null))['catch'](handleError(_0x414d49,null));};exports[_0x7615('0x7f')]=function(_0x4af0f0,_0x25e959,_0xbab857){return db[_0x7615('0x69')]['findAll']({'where':{'id':_0x4af0f0[_0x7615('0x37')][_0x7615('0x80')]},'attributes':['id'],'include':[{'model':db[_0x7615('0x6c')],'as':_0x7615('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7615('0x25')](handleEntityNotFound(_0x25e959,null))[_0x7615('0x25')](function(_0x2261cc){var _0x3c2b53=_[_0x7615('0x29')](_0x2261cc,'id');var _0x514446=[];var _0x5cb676=[];var _0x27b762=squel[_0x7615('0x81')]();_0x27b762[_0x7615('0x82')](_0x7615('0x83'))[_0x7615('0x84')](_0x7615('0x85'),'tq')[_0x7615('0x86')]('user_has_teams','ut',_0x7615('0x87'))[_0x7615('0x40')](_0x7615('0x88'),_0x4af0f0[_0x7615('0x4d')]['id']);for(var _0x5950c7=0x0;_0x5950c7<_0x2261cc[_0x7615('0x3d')];_0x5950c7+=0x1){let _0x5ef1d4=_0x2261cc[_0x5950c7];for(var _0x36c8de=0x0;_0x36c8de<_0x5ef1d4['Agents'][_0x7615('0x3d')];_0x36c8de+=0x1){let _0x4ae3e3=_0x5ef1d4[_0x7615('0x6d')][_0x36c8de];var _0x4b1e9f=_0x27b762[_0x7615('0x56')]();_0x4b1e9f['where']('ut.UserId\x20=\x20?',_0x4ae3e3['id']);_0x5cb676[_0x7615('0x89')](db[_0x7615('0x72')][_0x7615('0x37')](_0x4b1e9f[_0x7615('0x8a')](),{'type':db['sequelize'][_0x7615('0x8b')][_0x7615('0x8c')]})[_0x7615('0x25')](function(_0x510a9e){if(_0x510a9e[_0x7615('0x3d')]===0x1){return _0x4ae3e3['id'];}else{var _0x346339=_[_0x7615('0x8d')](_['map'](_0x510a9e,_0x7615('0x8e')),function(_0x1ef582){return _[_0x7615('0x2b')](_0x3c2b53,_0x1ef582);});if(_0x346339){return _0x4ae3e3['id'];}}}));}}return BPromise[_0x7615('0x8f')](_0x5cb676)[_0x7615('0x25')](function(_0x4adc3b){_0x514446=_(_0x514446)[_0x7615('0x90')](_0x4adc3b)['compact']()[_0x7615('0x2a')]();return db[_0x7615('0x33')]['find']({'where':{'id':_0x4af0f0[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](function(_0x3fa14c){return db['sequelize'][_0x7615('0x73')](function(_0x290168){return _0x3fa14c[_0x7615('0x7f')](_0x4af0f0[_0x7615('0x37')][_0x7615('0x80')],{'transaction':_0x290168})[_0x7615('0x25')](function(){if(!_[_0x7615('0x91')](_0x514446)){return _0x3fa14c[_0x7615('0x92')](_0x514446,{'transaction':_0x290168})['then'](function(){return db[_0x7615('0x78')]['destroy']({'where':{'VoiceQueueId':_0x4af0f0[_0x7615('0x4d')]['id'],'UserId':_0x514446},'transaction':_0x290168});});}})[_0x7615('0x25')](function(){_0x514446[_0x7615('0x7c')](function(_0xa6580e){socket[_0x7615('0x7d')](_0x7615('0x93'),{'UserId':_0xa6580e,'VoiceQueueId':_0x3fa14c['id']});});});});});});})['then'](respondWithStatusCode(_0x25e959,null))[_0x7615('0x4b')](handleError(_0x25e959,null));};exports['addAgents']=function(_0x82ea26,_0x1e11ca,_0x4537fb){var _0xb8eff4,_0x343bba;return db[_0x7615('0x33')]['find']({'where':{'id':_0x82ea26[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x1e11ca,null))[_0x7615('0x25')](function(_0x33ca71){if(_0x33ca71){_0x343bba=_0x33ca71;return _0x33ca71[_0x7615('0x94')](_0x82ea26[_0x7615('0x5a')][_0x7615('0x80')],_['omit'](_0x82ea26[_0x7615('0x5a')],[_0x7615('0x80'),'id'])||{})['spread'](function(_0x2ffc51){for(var _0x381160=0x0;_0x381160<_0x82ea26[_0x7615('0x5a')]['ids'][_0x7615('0x3d')];_0x381160+=0x1){socket['emit'](_0x7615('0x7e'),{'UserId':Number(_0x82ea26[_0x7615('0x5a')][_0x7615('0x80')][_0x381160]),'VoiceQueueId':Number(_0x82ea26['params']['id'])});}return _0x2ffc51;});}})[_0x7615('0x25')](function(_0x54adda){_0xb8eff4=_0x54adda||[];if(_0x343bba){return db[_0x7615('0x6c')][_0x7615('0x49')]({'where':{'id':_0x82ea26[_0x7615('0x5a')]['ids']},'attributes':['id',_0x7615('0x2e'),_0x7615('0x6e'),_0x7615('0x95'),'interface'],'raw':!![]});}})['then'](function(_0x2aa7c9){if(!_[_0x7615('0x91')](_0x2aa7c9)){var _0x557554=[];for(var _0x357d1e=0x0;_0x357d1e<_0x2aa7c9[_0x7615('0x3d')];_0x357d1e++){if(_0x2aa7c9[_0x357d1e][_0x7615('0x6e')]){_0x557554[_0x7615('0x89')](db[_0x7615('0x78')][_0x7615('0x75')]({'membername':_0x2aa7c9[_0x357d1e][_0x7615('0x2e')],'UserId':_0x2aa7c9[_0x357d1e]['id'],'queue_name':_0x343bba['name'],'VoiceQueueId':_0x343bba['id'],'interface':_[_0x7615('0x79')](_0x2aa7c9[_0x357d1e][_0x7615('0x6f')])?util[_0x7615('0x7a')](_0x7615('0x7b'),_0x2aa7c9[_0x357d1e][_0x7615('0x2e')]):_0x2aa7c9[_0x357d1e][_0x7615('0x6f')],'paused':_0x2aa7c9[_0x357d1e][_0x7615('0x95')]||![],'penalty':_0x82ea26['body'][_0x7615('0x71')]||0x0}));}}return BPromise[_0x7615('0x8f')](_0x557554);}})['then'](function(){return _0xb8eff4;})['then'](respondWithResult(_0x1e11ca,null))['catch'](handleError(_0x1e11ca,null));};exports[_0x7615('0x92')]=function(_0x9e7730,_0xedd4f2,_0x7fdfa7){return db[_0x7615('0x33')][_0x7615('0x2d')]({'where':{'id':_0x9e7730[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0xedd4f2,null))[_0x7615('0x25')](function(_0x55fd39){if(_0x55fd39){return _0x55fd39[_0x7615('0x92')](_0x9e7730[_0x7615('0x37')][_0x7615('0x80')])['then'](function(){if(_[_0x7615('0x96')](_0x9e7730['query']['ids'])){for(var _0x133196=0x0;_0x133196<_0x9e7730[_0x7615('0x37')][_0x7615('0x80')][_0x7615('0x3d')];_0x133196+=0x1){socket['emit'](_0x7615('0x93'),{'UserId':Number(_0x9e7730[_0x7615('0x37')][_0x7615('0x80')][_0x133196]),'VoiceQueueId':Number(_0x9e7730[_0x7615('0x4d')]['id'])});}}else{socket[_0x7615('0x7d')](_0x7615('0x93'),{'UserId':Number(_0x9e7730['query']['ids']),'VoiceQueueId':Number(_0x9e7730[_0x7615('0x4d')]['id'])});}});}})[_0x7615('0x25')](function(_0x28c6b1){return db[_0x7615('0x78')][_0x7615('0x97')]({'where':{'VoiceQueueId':_0x9e7730[_0x7615('0x4d')]['id'],'UserId':_0x9e7730['query']['ids']}})[_0x7615('0x25')](function(){return _0x28c6b1;});})[_0x7615('0x25')](respondWithStatusCode(_0xedd4f2,null))[_0x7615('0x4b')](handleError(_0xedd4f2,null));};exports[_0x7615('0x98')]=function(_0x37a660,_0x5e6b9d,_0x136227){var _0x27631c={};var _0x3c41bc={};var _0x340b7b;var _0x203497;return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x37a660[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x5e6b9d,null))[_0x7615('0x25')](function(_0x110078){if(_0x110078){_0x340b7b=_0x110078;_0x3c41bc[_0x7615('0x3a')]=_['keys'](db[_0x7615('0x6c')][_0x7615('0x34')]);_0x3c41bc['query']=_[_0x7615('0x38')](_0x37a660['query']);_0x3c41bc[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x3c41bc[_0x7615('0x3a')],_0x3c41bc[_0x7615('0x37')]);_0x27631c['attributes']=_['intersection'](_0x3c41bc[_0x7615('0x3a')],qs['fields'](_0x37a660[_0x7615('0x37')][_0x7615('0x3c')]));_0x27631c['attributes']=_0x27631c[_0x7615('0x3b')][_0x7615('0x3d')]?_0x27631c[_0x7615('0x3b')]:_0x3c41bc[_0x7615('0x3a')];_0x27631c[_0x7615('0x60')]=qs['sort'](_0x37a660[_0x7615('0x37')][_0x7615('0x3f')]);_0x27631c[_0x7615('0x40')]=qs['filters'](_[_0x7615('0x41')](_0x37a660[_0x7615('0x37')],_0x3c41bc[_0x7615('0x4e')]));if(_0x37a660[_0x7615('0x37')][_0x7615('0x42')]){_0x27631c[_0x7615('0x40')]=_[_0x7615('0x43')](_0x27631c[_0x7615('0x40')],{'$or':_['map'](_0x27631c[_0x7615('0x3b')],function(_0x37d94f){var _0x5176e6={};_0x5176e6[_0x37d94f]={'$like':'%'+_0x37a660['query'][_0x7615('0x42')]+'%'};return _0x5176e6;})});}_0x27631c=_[_0x7615('0x43')]({},_0x27631c,_0x37a660['options']);return _0x340b7b[_0x7615('0x98')](_0x27631c);}})[_0x7615('0x25')](function(_0xff197){if(_0xff197){_0x203497=_0xff197['length'];if(!_0x37a660[_0x7615('0x37')][_0x7615('0x67')](_0x7615('0x3e'))){_0x27631c[_0x7615('0x20')]=qs['limit'](_0x37a660[_0x7615('0x37')]['limit']);_0x27631c[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x37a660[_0x7615('0x37')][_0x7615('0x1f')]);}return _0x340b7b['getAgents'](_0x27631c);}})[_0x7615('0x25')](function(_0x2af7ac){if(_0x2af7ac){return _0x2af7ac?{'count':_0x203497,'rows':_0x2af7ac}:null;}})[_0x7615('0x25')](respondWithResult(_0x5e6b9d,null))[_0x7615('0x4b')](handleError(_0x5e6b9d,null));};exports['getMembers']=function(_0x56c55c,_0x53d1dc,_0x870f39){var _0x2b7498={};var _0x32e3ea={};var _0x4ce1f4;var _0x1beb48;return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x56c55c[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x53d1dc,null))[_0x7615('0x25')](function(_0x596db2){if(_0x596db2){_0x4ce1f4=_0x596db2;_0x32e3ea['model']=_[_0x7615('0x38')](db['UserVoiceQueueRt'][_0x7615('0x34')]);_0x32e3ea[_0x7615('0x37')]=_[_0x7615('0x38')](_0x56c55c[_0x7615('0x37')]);_0x32e3ea[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x32e3ea['model'],_0x32e3ea[_0x7615('0x37')]);_0x2b7498['attributes']=_[_0x7615('0x39')](_0x32e3ea[_0x7615('0x3a')],qs['fields'](_0x56c55c[_0x7615('0x37')][_0x7615('0x3c')]));_0x2b7498[_0x7615('0x3b')]=_0x2b7498['attributes'][_0x7615('0x3d')]?_0x2b7498[_0x7615('0x3b')]:_0x32e3ea[_0x7615('0x3a')];_0x2b7498[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x56c55c[_0x7615('0x37')][_0x7615('0x3f')]);_0x2b7498[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x56c55c[_0x7615('0x37')],_0x32e3ea[_0x7615('0x4e')]));if(_0x56c55c[_0x7615('0x37')][_0x7615('0x42')]){_0x2b7498['where']=_['merge'](_0x2b7498[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x2b7498[_0x7615('0x3b')],function(_0x58e674){var _0x12ca36={};_0x12ca36[_0x58e674]={'$like':'%'+_0x56c55c['query'][_0x7615('0x42')]+'%'};return _0x12ca36;})});}_0x2b7498=_[_0x7615('0x43')]({},_0x2b7498,_0x56c55c[_0x7615('0x45')]);return _0x4ce1f4['getMembers'](_0x2b7498);}})[_0x7615('0x25')](function(_0x572a90){if(_0x572a90){_0x1beb48=_0x572a90[_0x7615('0x3d')];if(!_0x56c55c[_0x7615('0x37')]['hasOwnProperty'](_0x7615('0x3e'))){_0x2b7498[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x56c55c['query'][_0x7615('0x20')]);_0x2b7498[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x56c55c['query'][_0x7615('0x1f')]);}return _0x4ce1f4[_0x7615('0x99')](_0x2b7498);}})[_0x7615('0x25')](function(_0x435a74){return _0x435a74?{'count':_0x1beb48,'rows':_0x435a74}:null;})[_0x7615('0x25')](respondWithResult(_0x53d1dc,null))[_0x7615('0x4b')](handleError(_0x53d1dc,null));};exports[_0x7615('0x9a')]=function(_0x1c12fd,_0x15a858,_0x1dc42f){var _0x7390f5={};var _0x3e1500={};var _0x5b43d0;var _0x2f0fa9;return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x1c12fd[_0x7615('0x4d')]['id']}})['then'](handleEntityNotFound(_0x15a858,null))[_0x7615('0x25')](function(_0x599736){if(_0x599736){_0x5b43d0=_0x599736;_0x3e1500[_0x7615('0x3a')]=_[_0x7615('0x38')](db[_0x7615('0x9b')]['rawAttributes']);_0x3e1500[_0x7615('0x37')]=_[_0x7615('0x38')](_0x1c12fd[_0x7615('0x37')]);_0x3e1500[_0x7615('0x4e')]=_['intersection'](_0x3e1500['model'],_0x3e1500['query']);_0x7390f5[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x3e1500[_0x7615('0x3a')],qs[_0x7615('0x3c')](_0x1c12fd[_0x7615('0x37')][_0x7615('0x3c')]));_0x7390f5[_0x7615('0x3b')]=_0x7390f5[_0x7615('0x3b')][_0x7615('0x3d')]?_0x7390f5[_0x7615('0x3b')]:_0x3e1500[_0x7615('0x3a')];_0x7390f5[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x1c12fd[_0x7615('0x37')]['sort']);_0x7390f5[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x1c12fd[_0x7615('0x37')],_0x3e1500[_0x7615('0x4e')]));if(_0x1c12fd[_0x7615('0x37')][_0x7615('0x42')]){_0x7390f5['where']=_[_0x7615('0x43')](_0x7390f5[_0x7615('0x40')],{'$or':_[_0x7615('0x29')](_0x7390f5['attributes'],function(_0x410d58){var _0x43819a={};_0x43819a[_0x410d58]={'$like':'%'+_0x1c12fd['query'][_0x7615('0x42')]+'%'};return _0x43819a;})});}_0x7390f5=_[_0x7615('0x43')]({},_0x7390f5,_0x1c12fd[_0x7615('0x45')]);return _0x5b43d0[_0x7615('0x9a')](_0x7390f5);}})[_0x7615('0x25')](function(_0x23110e){if(_0x23110e){_0x2f0fa9=_0x23110e[_0x7615('0x3d')];if(!_0x1c12fd[_0x7615('0x37')][_0x7615('0x67')](_0x7615('0x3e'))){_0x7390f5[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x1c12fd['query'][_0x7615('0x20')]);_0x7390f5[_0x7615('0x1f')]=qs['offset'](_0x1c12fd[_0x7615('0x37')]['offset']);}return _0x5b43d0[_0x7615('0x9a')](_0x7390f5);}})[_0x7615('0x25')](function(_0x3b8068){if(_0x3b8068){return _0x3b8068?{'count':_0x2f0fa9,'rows':_0x3b8068}:null;}})[_0x7615('0x25')](respondWithResult(_0x15a858,null))[_0x7615('0x4b')](handleError(_0x15a858,null));};exports[_0x7615('0x9c')]=function(_0x5ecaef,_0x4fc7d8,_0x47ae6f){var _0x5f4817,_0x130f47;return db['VoiceQueue'][_0x7615('0x2d')]({'where':{'id':_0x5ecaef['params']['id']}})['then'](handleEntityNotFound(_0x4fc7d8,null))[_0x7615('0x25')](function(_0x2c35ed){if(_0x2c35ed){_0x130f47=_0x2c35ed;return _0x2c35ed[_0x7615('0x9c')](_0x5ecaef[_0x7615('0x5a')]['ids'],_[_0x7615('0x57')](_0x5ecaef[_0x7615('0x5a')],['ids','id'])||{});}return null;})[_0x7615('0x9d')](function(_0x385046){var _0x1b3029;_0x5f4817=_0x385046||[];var _0x2ca5e9=[];if(_0x385046){for(var _0x4362cb=0x0;_0x4362cb<_0x385046['length'];_0x4362cb+=0x1){var _0x4a7d9a=_0x385046[_0x4362cb][_0x7615('0x26')]({'plain':!![]});_0x130f47[_0x7615('0x9e')]=_0x5ecaef[_0x7615('0x5a')][_0x7615('0x9e')]?_0x5ecaef['body'][_0x7615('0x9e')]:_0x130f47[_0x7615('0x9e')];switch(_0x130f47['dialCheckDuplicateType']){case _0x7615('0x9f'):_0x1b3029=squel['insert']()[_0x7615('0xa0')](_0x7615('0xa1'))[_0x7615('0xa2')]([_0x7615('0xa3'),_0x7615('0xa4'),_0x7615('0xa5'),_0x7615('0xa6'),_0x7615('0x61'),_0x7615('0x58'),'updatedAt'],squel['select']()[_0x7615('0x82')]('phone',_0x7615('0xa3'))[_0x7615('0x82')](_0x7615('0xa7'),_0x7615('0xa4'))[_0x7615('0x82')]('id',_0x7615('0xa5'))[_0x7615('0x82')](_0x4a7d9a[_0x7615('0xa8')]['toString'](),_0x7615('0xa6'))[_0x7615('0x82')](_0x5ecaef['params']['id'][_0x7615('0x8a')](),_0x7615('0x61'))[_0x7615('0x82')](_0x7615('0xa7'),_0x7615('0x58'))[_0x7615('0x82')](_0x7615('0xa7'),'updatedAt')['from'](_0x7615('0xa9'))[_0x7615('0x40')](_0x7615('0xaa'))['where']('ListId\x20=\x20?',_0x4a7d9a[_0x7615('0xa8')][_0x7615('0x8a')]())[_0x7615('0x40')](_0x7615('0xab'))[_0x7615('0x40')](_0x7615('0xac'),squel[_0x7615('0x81')]()['field'](_0x7615('0xad'))[_0x7615('0x84')](_0x7615('0xae'))['where'](_0x7615('0x88'),_0x5ecaef[_0x7615('0x4d')]['id'][_0x7615('0x8a')]()))[_0x7615('0x40')](_0x7615('0xac'),squel['select']()[_0x7615('0x82')](_0x7615('0xaf'))[_0x7615('0x84')]('cm_hopper')['where'](_0x7615('0x88'),_0x5ecaef[_0x7615('0x4d')]['id'][_0x7615('0x8a')]())))[_0x7615('0x8a')]();break;case _0x7615('0xb0'):_0x1b3029=squel['insert']()[_0x7615('0xa0')]('cm_hopper')[_0x7615('0xa2')]([_0x7615('0xa3'),'scheduledAt',_0x7615('0xa5'),'ListId',_0x7615('0x61'),_0x7615('0x58'),'updatedAt'],squel[_0x7615('0x81')]()[_0x7615('0x82')](_0x7615('0xa3'),_0x7615('0xa3'))[_0x7615('0x82')](_0x7615('0xa7'),_0x7615('0xa4'))['field']('id',_0x7615('0xa5'))['field'](_0x4a7d9a[_0x7615('0xa8')][_0x7615('0x8a')](),'ListId')['field'](_0x5ecaef[_0x7615('0x4d')]['id'][_0x7615('0x8a')](),_0x7615('0x61'))['field'](_0x7615('0xa7'),_0x7615('0x58'))[_0x7615('0x82')]('NOW()','updatedAt')[_0x7615('0x84')](_0x7615('0xa9'))[_0x7615('0x40')]('deletedAt\x20IS\x20NULL')[_0x7615('0x40')](_0x7615('0xb1'),_0x4a7d9a[_0x7615('0xa8')]['toString']())[_0x7615('0x40')](_0x7615('0xab'))[_0x7615('0x40')](_0x7615('0xac'),squel[_0x7615('0x81')]()[_0x7615('0x82')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x7615('0x40')](_0x7615('0x88'),_0x5ecaef[_0x7615('0x4d')]['id'][_0x7615('0x8a')]())))[_0x7615('0x8a')]();break;default:_0x1b3029=squel[_0x7615('0xb2')]()[_0x7615('0xa0')](_0x7615('0xa1'))['fromQuery']([_0x7615('0xa3'),_0x7615('0xa4'),_0x7615('0xa5'),_0x7615('0xa6'),'VoiceQueueId','createdAt','updatedAt'],squel['select']()['field'](_0x7615('0xa3'),_0x7615('0xa3'))[_0x7615('0x82')](_0x7615('0xa7'),_0x7615('0xa4'))[_0x7615('0x82')]('id',_0x7615('0xa5'))[_0x7615('0x82')](_0x4a7d9a[_0x7615('0xa8')][_0x7615('0x8a')](),_0x7615('0xa6'))[_0x7615('0x82')](_0x5ecaef[_0x7615('0x4d')]['id'][_0x7615('0x8a')](),_0x7615('0x61'))[_0x7615('0x82')](_0x7615('0xa7'),_0x7615('0x58'))[_0x7615('0x82')](_0x7615('0xa7'),'updatedAt')[_0x7615('0x84')](_0x7615('0xa9'))[_0x7615('0x40')](_0x7615('0xaa'))[_0x7615('0x40')](_0x7615('0xb1'),_0x4a7d9a[_0x7615('0xa8')][_0x7615('0x8a')]())[_0x7615('0x40')](_0x7615('0xab')))[_0x7615('0x8a')]();}_0x2ca5e9[_0x7615('0x89')](db[_0x7615('0x72')]['query'](_0x1b3029));}return BPromise[_0x7615('0x8f')](_0x2ca5e9);}})['then'](function(){return _0x5f4817;})['then'](respondWithResult(_0x4fc7d8,null))[_0x7615('0x4b')](handleError(_0x4fc7d8,null));};exports['removeLists']=function(_0x9af505,_0x3df0f2,_0x12bc31){return db[_0x7615('0x33')][_0x7615('0x2d')]({'where':{'id':_0x9af505[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x3df0f2,null))[_0x7615('0x25')](function(_0x554391){if(_0x554391){return _0x554391[_0x7615('0xb3')](_0x9af505['query'][_0x7615('0x80')]);}})[_0x7615('0x25')](function(_0x5aa30c){if(_0x5aa30c){return db[_0x7615('0x5f')]['destroy']({'where':{'ListId':_0x9af505[_0x7615('0x37')][_0x7615('0x80')],'VoiceQueueId':_0x9af505[_0x7615('0x4d')]['id']}})['then'](function(){return _0x5aa30c;});}})['then'](respondWithStatusCode(_0x3df0f2,null))['catch'](handleError(_0x3df0f2,null));};exports['getBlackLists']=function(_0x532220,_0x10c0cd,_0x473e66){var _0x4a2e54={};var _0x4bdfd1={};var _0x5362c1;var _0x5bea76;return db[_0x7615('0x33')][_0x7615('0x5e')]({'where':{'id':_0x532220[_0x7615('0x4d')]['id']}})['then'](handleEntityNotFound(_0x10c0cd,null))[_0x7615('0x25')](function(_0xf2805f){if(_0xf2805f){_0x5362c1=_0xf2805f;_0x4bdfd1[_0x7615('0x3a')]=_[_0x7615('0x38')](db['CmList'][_0x7615('0x34')]);_0x4bdfd1[_0x7615('0x37')]=_['keys'](_0x532220[_0x7615('0x37')]);_0x4bdfd1[_0x7615('0x4e')]=_[_0x7615('0x39')](_0x4bdfd1[_0x7615('0x3a')],_0x4bdfd1[_0x7615('0x37')]);_0x4a2e54[_0x7615('0x3b')]=_[_0x7615('0x39')](_0x4bdfd1['model'],qs['fields'](_0x532220['query'][_0x7615('0x3c')]));_0x4a2e54[_0x7615('0x3b')]=_0x4a2e54[_0x7615('0x3b')][_0x7615('0x3d')]?_0x4a2e54['attributes']:_0x4bdfd1[_0x7615('0x3a')];_0x4a2e54[_0x7615('0x60')]=qs[_0x7615('0x3f')](_0x532220['query'][_0x7615('0x3f')]);_0x4a2e54[_0x7615('0x40')]=qs[_0x7615('0x4e')](_[_0x7615('0x41')](_0x532220[_0x7615('0x37')],_0x4bdfd1[_0x7615('0x4e')]));if(_0x532220[_0x7615('0x37')][_0x7615('0x42')]){_0x4a2e54[_0x7615('0x40')]=_[_0x7615('0x43')](_0x4a2e54[_0x7615('0x40')],{'$or':_['map'](_0x4a2e54[_0x7615('0x3b')],function(_0x3122f0){var _0x250789={};_0x250789[_0x3122f0]={'$like':'%'+_0x532220['query']['filter']+'%'};return _0x250789;})});}_0x4a2e54=_[_0x7615('0x43')]({},_0x4a2e54,_0x532220['options']);return _0x5362c1[_0x7615('0xb4')](_0x4a2e54);}})['then'](function(_0x484070){if(_0x484070){_0x5bea76=_0x484070[_0x7615('0x3d')];if(!_0x532220[_0x7615('0x37')]['hasOwnProperty']('nolimit')){_0x4a2e54[_0x7615('0x20')]=qs[_0x7615('0x20')](_0x532220[_0x7615('0x37')][_0x7615('0x20')]);_0x4a2e54[_0x7615('0x1f')]=qs[_0x7615('0x1f')](_0x532220[_0x7615('0x37')][_0x7615('0x1f')]);}return _0x5362c1[_0x7615('0xb4')](_0x4a2e54);}})['then'](function(_0x5c7d8d){if(_0x5c7d8d){return _0x5c7d8d?{'count':_0x5bea76,'rows':_0x5c7d8d}:null;}})['then'](respondWithResult(_0x10c0cd,null))[_0x7615('0x4b')](handleError(_0x10c0cd,null));};exports[_0x7615('0xb5')]=function(_0x8fcb52,_0x27b90b,_0x450dce){var _0x48dff8,_0x5c48b5;return db[_0x7615('0x33')][_0x7615('0x2d')]({'where':{'id':_0x8fcb52[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](handleEntityNotFound(_0x27b90b,null))[_0x7615('0x25')](function(_0x36baf6){if(_0x36baf6){_0x5c48b5=_0x36baf6;return _0x36baf6[_0x7615('0xb5')](_0x8fcb52['body']['ids'],_[_0x7615('0x57')](_0x8fcb52['body'],[_0x7615('0x80'),'id'])||{});}return null;})['spread'](function(_0x1a151e){var _0x3f0eb0;_0x48dff8=_0x1a151e||[];var _0x2ed849=[];if(_0x1a151e){for(var _0x4319c9=0x0;_0x4319c9<_0x1a151e[_0x7615('0x3d')];_0x4319c9+=0x1){var _0x19d5c3=_0x1a151e[_0x4319c9]['get']({'plain':!![]});_0x3f0eb0=squel[_0x7615('0xb2')]()[_0x7615('0xa0')](_0x7615('0xb6'))[_0x7615('0xa2')](['phone',_0x7615('0xa5'),_0x7615('0xa6'),_0x7615('0x61'),'createdAt',_0x7615('0x59')],squel[_0x7615('0x81')]()[_0x7615('0x82')]('phone',_0x7615('0xa3'))['field']('id',_0x7615('0xa5'))[_0x7615('0x82')](_0x19d5c3[_0x7615('0xa8')]['toString'](),'ListId')[_0x7615('0x82')](_0x8fcb52[_0x7615('0x4d')]['id'][_0x7615('0x8a')](),_0x7615('0x61'))['field']('NOW()',_0x7615('0x58'))[_0x7615('0x82')](_0x7615('0xa7'),'updatedAt')['from'](_0x7615('0xa9'))[_0x7615('0x40')](_0x7615('0xaa'))[_0x7615('0x40')]('ListId\x20=\x20?',_0x19d5c3['CmListId'][_0x7615('0x8a')]())[_0x7615('0x40')](_0x7615('0xab')))[_0x7615('0x8a')]();_0x2ed849['push'](db[_0x7615('0x72')][_0x7615('0x37')](_0x3f0eb0));}return BPromise[_0x7615('0x8f')](_0x2ed849);}})[_0x7615('0x25')](function(){return _0x48dff8;})[_0x7615('0x25')](respondWithResult(_0x27b90b,null))['catch'](handleError(_0x27b90b,null));};exports[_0x7615('0xb7')]=function(_0x6bb16,_0x568ac9,_0x1fd16c){return db['VoiceQueue'][_0x7615('0x2d')]({'where':{'id':_0x6bb16[_0x7615('0x4d')]['id']}})['then'](handleEntityNotFound(_0x568ac9,null))['then'](function(_0x3201f5){if(_0x3201f5){return _0x3201f5[_0x7615('0xb7')](_0x6bb16['query'][_0x7615('0x80')]);}})[_0x7615('0x25')](function(_0x4ebdd1){if(_0x4ebdd1){return db[_0x7615('0x66')][_0x7615('0x97')]({'where':{'ListId':_0x6bb16[_0x7615('0x37')]['ids'],'VoiceQueueId':_0x6bb16[_0x7615('0x4d')]['id']}})[_0x7615('0x25')](function(){return _0x4ebdd1;});}})[_0x7615('0x25')](respondWithStatusCode(_0x568ac9,null))[_0x7615('0x4b')](handleError(_0x568ac9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f62bca3..e4c62da 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 _0x8ee3=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x2d1e4d,_0x307ff6){var _0x6272e7=function(_0x2df480){while(--_0x2df480){_0x2d1e4d['push'](_0x2d1e4d['shift']());}};_0x6272e7(++_0x307ff6);}(_0x8ee3,0x11a));var _0x38ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ee3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x38ee('0x0'));var VoiceQueue=require(_0x38ee('0x1'))['db'][_0x38ee('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x38ee('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38ee('0x4'),'afterDestroy':_0x38ee('0x5')};function emitEvent(_0x229819){return function(_0xd3c3,_0x32715f,_0x2fbf99){VoiceQueueEvents['emit'](_0x229819+':'+_0xd3c3['id'],_0xd3c3);VoiceQueueEvents['emit'](_0x229819,_0xd3c3);_0x2fbf99(null);};}for(var e in events){if(events[_0x38ee('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x38ee('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xce8a=['VoiceQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2542df,_0x383353){var _0x4654b4=function(_0x51159d){while(--_0x51159d){_0x2542df['push'](_0x2542df['shift']());}};_0x4654b4(++_0x383353);}(_0xce8a,0xee));var _0xace8=function(_0x203881,_0xa8b59b){_0x203881=_0x203881-0x0;var _0x36ad36=_0xce8a[_0x203881];return _0x36ad36;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xace8('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xace8('0x1')](0x0);var events={'afterCreate':_0xace8('0x2'),'afterUpdate':_0xace8('0x3'),'afterDestroy':_0xace8('0x4')};function emitEvent(_0x2a4a5b){return function(_0x14fa92,_0x4a4e49,_0x1d59f3){VoiceQueueEvents[_0xace8('0x5')](_0x2a4a5b+':'+_0x14fa92['id'],_0x14fa92);VoiceQueueEvents['emit'](_0x2a4a5b,_0x14fa92);_0x1d59f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xace8('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index c44aa7e..8f51216 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x008c,0x188));var _0xc008=function(_0x4a4d88,_0x2be95a){_0x4a4d88=_0x4a4d88-0x0;var _0x479329=_0x008c[_0x4a4d88];return _0x479329;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2b70e7,_0x16fe77){var _0x10ac5d=function(_0x5dcdb8){while(--_0x5dcdb8){_0x2b70e7['push'](_0x2b70e7['shift']());}};_0x10ac5d(++_0x16fe77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 4cf6cae..d7bee97 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 _0xedde=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetVoiceQueue','ShowVoiceQueue','find','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x16b906,_0x12b7d4){var _0x300a0b=function(_0x38f3db){while(--_0x38f3db){_0x16b906['push'](_0x16b906['shift']());}};_0x300a0b(++_0x12b7d4);}(_0xedde,0x1cf));var _0xeedd=function(_0x2e8d36,_0x18b852){_0x2e8d36=_0x2e8d36-0x0;var _0x2e7551=_0xedde[_0x2e8d36];return _0x2e7551;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeedd('0x0'));var BPromise=require('bluebird');var rs=require(_0xeedd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeedd('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xeedd('0x3'))(_0xeedd('0x4'));var config=require(_0xeedd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xeedd('0x6')]['http']({'port':0x232a});config[_0xeedd('0x7')]=_[_0xeedd('0x8')](config[_0xeedd('0x7')],{'host':_0xeedd('0x9'),'port':0x18eb});var socket=require(_0xeedd('0xa'))(new Redis(config[_0xeedd('0x7')]));require(_0xeedd('0xb'))[_0xeedd('0xc')](socket);function respondWithRpcPromise(_0x6dc3bd,_0x4b6a7e,_0x1cc859){return new BPromise(function(_0x4538e1,_0xf5a492){return client[_0xeedd('0xd')](_0x6dc3bd,_0x1cc859)[_0xeedd('0xe')](function(_0x2662a5){logger[_0xeedd('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x4b6a7e,'request\x20sent');logger['debug'](_0xeedd('0x10'),_0x4b6a7e,_0xeedd('0x11'),JSON[_0xeedd('0x12')](_0x2662a5));if(_0x2662a5[_0xeedd('0x13')]){if(_0x2662a5[_0xeedd('0x13')][_0xeedd('0x14')]===0x1f4){logger['error'](_0xeedd('0x15'),_0x4b6a7e,_0x2662a5[_0xeedd('0x13')]['message']);return _0xf5a492(_0x2662a5['error'][_0xeedd('0x16')]);}logger[_0xeedd('0x13')](_0xeedd('0x15'),_0x4b6a7e,_0x2662a5[_0xeedd('0x13')][_0xeedd('0x16')]);return _0x4538e1(_0x2662a5['error'][_0xeedd('0x16')]);}else{logger[_0xeedd('0xf')](_0xeedd('0x15'),_0x4b6a7e,_0xeedd('0x11'));_0x4538e1(_0x2662a5[_0xeedd('0x17')][_0xeedd('0x16')]);}})[_0xeedd('0x18')](function(_0x1d6a82){logger[_0xeedd('0x13')](_0xeedd('0x15'),_0x4b6a7e,_0x1d6a82);_0xf5a492(_0x1d6a82);});});}exports['GetVoiceQueue']=function(_0x526cd3){var _0x2e5f26=this;return new Promise(function(_0x1e0e1c,_0x3efc7c){return db[_0xeedd('0x19')][_0xeedd('0x1a')]({'raw':_0x526cd3[_0xeedd('0x1b')]?_0x526cd3['options'][_0xeedd('0x1c')]===undefined?!![]:![]:!![],'where':_0x526cd3['options']?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x1d')]||null:null,'attributes':_0x526cd3['options']?_0x526cd3['options'][_0xeedd('0x1e')]||null:null,'limit':_0x526cd3[_0xeedd('0x1b')]?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x1f')]||null:null,'include':_0x526cd3['options']?_0x526cd3[_0xeedd('0x1b')][_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x526cd3[_0xeedd('0x1b')]['include'],function(_0x3468b0){return{'model':db[_0x3468b0[_0xeedd('0x22')]],'as':_0x3468b0['as'],'attributes':_0x3468b0['attributes'],'include':_0x3468b0[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x3468b0['include'],function(_0x1c1020){return{'model':db[_0x1c1020[_0xeedd('0x22')]],'as':_0x1c1020['as'],'attributes':_0x1c1020[_0xeedd('0x1e')],'include':_0x1c1020[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x1c1020[_0xeedd('0x20')],function(_0xed87b4){return{'model':db[_0xed87b4[_0xeedd('0x22')]],'as':_0xed87b4['as'],'attributes':_0xed87b4[_0xeedd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeedd('0xe')](function(_0x39fea4){logger[_0xeedd('0xf')]('GetVoiceQueue',_0x526cd3);logger[_0xeedd('0x23')](_0xeedd('0x24'),_0x526cd3,JSON['stringify'](_0x39fea4));_0x1e0e1c(_0x39fea4);})[_0xeedd('0x18')](function(_0x4e99be){logger[_0xeedd('0x13')](_0xeedd('0x24'),_0x4e99be[_0xeedd('0x16')],_0x526cd3);_0x3efc7c(_0x2e5f26[_0xeedd('0x13')](0x1f4,_0x4e99be[_0xeedd('0x16')]));});});};exports[_0xeedd('0x25')]=function(_0x4e8210){var _0xc55c02=this;return new Promise(function(_0x5b1a09,_0x426c7e){return db[_0xeedd('0x19')][_0xeedd('0x26')]({'raw':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options'][_0xeedd('0x1d')]||null:null,'attributes':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210[_0xeedd('0x1b')][_0xeedd('0x1e')]||null:null,'include':_0x4e8210[_0xeedd('0x1b')]?_0x4e8210['options'][_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x4e8210[_0xeedd('0x1b')][_0xeedd('0x20')],function(_0x4190a9){return{'model':db[_0x4190a9['model']],'as':_0x4190a9['as'],'attributes':_0x4190a9[_0xeedd('0x1e')],'include':_0x4190a9[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x4190a9[_0xeedd('0x20')],function(_0x3108fa){return{'model':db[_0x3108fa[_0xeedd('0x22')]],'as':_0x3108fa['as'],'attributes':_0x3108fa[_0xeedd('0x1e')],'include':_0x3108fa[_0xeedd('0x20')]?_[_0xeedd('0x21')](_0x3108fa[_0xeedd('0x20')],function(_0x41938c){return{'model':db[_0x41938c['model']],'as':_0x41938c['as'],'attributes':_0x41938c[_0xeedd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeedd('0xe')](function(_0x186bd0){logger['info'](_0xeedd('0x25'),_0x4e8210);logger[_0xeedd('0x23')](_0xeedd('0x25'),_0x4e8210,JSON[_0xeedd('0x12')](_0x186bd0));_0x5b1a09(_0x186bd0);})[_0xeedd('0x18')](function(_0x747b96){logger['error']('ShowVoiceQueue',_0x747b96[_0xeedd('0x16')],_0x4e8210);_0x426c7e(_0xc55c02[_0xeedd('0x13')](0x1f4,_0x747b96['message']));});});}; \ No newline at end of file +var _0xae21=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','map','include','model','attributes','then','info','find','raw','ShowVoiceQueue','catch','lodash'];(function(_0x580cea,_0x41fab5){var _0x5311c8=function(_0x3c654f){while(--_0x3c654f){_0x580cea['push'](_0x580cea['shift']());}};_0x5311c8(++_0x41fab5);}(_0xae21,0x102));var _0x1ae2=function(_0x3dcbca,_0x5c8d89){_0x3dcbca=_0x3dcbca-0x0;var _0x1ee320=_0xae21[_0x3dcbca];return _0x1ee320;};'use strict';var _=require(_0x1ae2('0x0'));var util=require('util');var moment=require(_0x1ae2('0x1'));var BPromise=require(_0x1ae2('0x2'));var rs=require(_0x1ae2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ae2('0x4'))['db'];var utils=require(_0x1ae2('0x5'));var logger=require('../../config/logger')(_0x1ae2('0x6'));var config=require(_0x1ae2('0x7'));var jayson=require(_0x1ae2('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1ae2('0x9')]=_[_0x1ae2('0xa')](config[_0x1ae2('0x9')],{'host':_0x1ae2('0xb'),'port':0x18eb});var socket=require(_0x1ae2('0xc'))(new Redis(config[_0x1ae2('0x9')]));require(_0x1ae2('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e8e3f,_0x4ad5e4,_0x51d458){return new BPromise(function(_0x51c5b9,_0x4759f){return client[_0x1ae2('0xe')](_0x2e8e3f,_0x51d458)['then'](function(_0x521208){logger['info'](_0x1ae2('0xf'),_0x4ad5e4,_0x1ae2('0x10'));logger[_0x1ae2('0x11')](_0x1ae2('0x12'),_0x4ad5e4,'request\x20sent',JSON['stringify'](_0x521208));if(_0x521208['error']){if(_0x521208[_0x1ae2('0x13')]['code']===0x1f4){logger[_0x1ae2('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x4ad5e4,_0x521208[_0x1ae2('0x13')][_0x1ae2('0x14')]);return _0x4759f(_0x521208[_0x1ae2('0x13')]['message']);}logger[_0x1ae2('0x13')](_0x1ae2('0xf'),_0x4ad5e4,_0x521208['error'][_0x1ae2('0x14')]);return _0x51c5b9(_0x521208[_0x1ae2('0x13')][_0x1ae2('0x14')]);}else{logger['info'](_0x1ae2('0xf'),_0x4ad5e4,_0x1ae2('0x10'));_0x51c5b9(_0x521208['result'][_0x1ae2('0x14')]);}})['catch'](function(_0xa1135b){logger[_0x1ae2('0x13')](_0x1ae2('0xf'),_0x4ad5e4,_0xa1135b);_0x4759f(_0xa1135b);});});}exports[_0x1ae2('0x15')]=function(_0x42e33d){var _0x460c63=this;return new Promise(function(_0x371459,_0x1a9441){return db[_0x1ae2('0x16')][_0x1ae2('0x17')]({'raw':_0x42e33d[_0x1ae2('0x18')]?_0x42e33d[_0x1ae2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42e33d[_0x1ae2('0x18')]?_0x42e33d[_0x1ae2('0x18')][_0x1ae2('0x19')]||null:null,'attributes':_0x42e33d[_0x1ae2('0x18')]?_0x42e33d['options']['attributes']||null:null,'limit':_0x42e33d['options']?_0x42e33d['options'][_0x1ae2('0x1a')]||null:null,'include':_0x42e33d[_0x1ae2('0x18')]?_0x42e33d[_0x1ae2('0x18')]['include']?_[_0x1ae2('0x1b')](_0x42e33d[_0x1ae2('0x18')][_0x1ae2('0x1c')],function(_0x210f58){return{'model':db[_0x210f58[_0x1ae2('0x1d')]],'as':_0x210f58['as'],'attributes':_0x210f58[_0x1ae2('0x1e')],'include':_0x210f58['include']?_[_0x1ae2('0x1b')](_0x210f58[_0x1ae2('0x1c')],function(_0x1ee91d){return{'model':db[_0x1ee91d[_0x1ae2('0x1d')]],'as':_0x1ee91d['as'],'attributes':_0x1ee91d[_0x1ae2('0x1e')],'include':_0x1ee91d[_0x1ae2('0x1c')]?_[_0x1ae2('0x1b')](_0x1ee91d[_0x1ae2('0x1c')],function(_0x47a35d){return{'model':db[_0x47a35d['model']],'as':_0x47a35d['as'],'attributes':_0x47a35d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ae2('0x1f')](function(_0x8829a3){logger[_0x1ae2('0x20')](_0x1ae2('0x15'),_0x42e33d);logger[_0x1ae2('0x11')](_0x1ae2('0x15'),_0x42e33d,JSON['stringify'](_0x8829a3));_0x371459(_0x8829a3);})['catch'](function(_0x208258){logger[_0x1ae2('0x13')]('GetVoiceQueue',_0x208258['message'],_0x42e33d);_0x1a9441(_0x460c63['error'](0x1f4,_0x208258[_0x1ae2('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x40bb8d){var _0x22692f=this;return new Promise(function(_0x176ea6,_0x15f175){return db[_0x1ae2('0x16')][_0x1ae2('0x21')]({'raw':_0x40bb8d[_0x1ae2('0x18')]?_0x40bb8d[_0x1ae2('0x18')][_0x1ae2('0x22')]===undefined?!![]:![]:!![],'where':_0x40bb8d[_0x1ae2('0x18')]?_0x40bb8d['options']['where']||null:null,'attributes':_0x40bb8d[_0x1ae2('0x18')]?_0x40bb8d['options']['attributes']||null:null,'include':_0x40bb8d[_0x1ae2('0x18')]?_0x40bb8d['options']['include']?_[_0x1ae2('0x1b')](_0x40bb8d[_0x1ae2('0x18')][_0x1ae2('0x1c')],function(_0x3fa2c0){return{'model':db[_0x3fa2c0[_0x1ae2('0x1d')]],'as':_0x3fa2c0['as'],'attributes':_0x3fa2c0[_0x1ae2('0x1e')],'include':_0x3fa2c0[_0x1ae2('0x1c')]?_['map'](_0x3fa2c0[_0x1ae2('0x1c')],function(_0x3c32a7){return{'model':db[_0x3c32a7[_0x1ae2('0x1d')]],'as':_0x3c32a7['as'],'attributes':_0x3c32a7['attributes'],'include':_0x3c32a7[_0x1ae2('0x1c')]?_[_0x1ae2('0x1b')](_0x3c32a7[_0x1ae2('0x1c')],function(_0x33e8eb){return{'model':db[_0x33e8eb[_0x1ae2('0x1d')]],'as':_0x33e8eb['as'],'attributes':_0x33e8eb[_0x1ae2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1ae2('0x1f')](function(_0x467b16){logger[_0x1ae2('0x20')](_0x1ae2('0x23'),_0x40bb8d);logger[_0x1ae2('0x11')](_0x1ae2('0x23'),_0x40bb8d,JSON['stringify'](_0x467b16));_0x176ea6(_0x467b16);})[_0x1ae2('0x24')](function(_0x402357){logger[_0x1ae2('0x13')](_0x1ae2('0x23'),_0x402357['message'],_0x40bb8d);_0x15f175(_0x22692f[_0x1ae2('0x13')](0x1f4,_0x402357[_0x1ae2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0f7525c..c2713c1 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 _0xb5ef=['voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener','register'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xb5ef,0x174));var _0xfb5e=function(_0x34a51c,_0x1d33b1){_0x34a51c=_0x34a51c-0x0;var _0x42a951=_0xb5ef[_0x34a51c];return _0x42a951;};'use strict';var VoiceQueueEvents=require(_0xfb5e('0x0'));var events=[_0xfb5e('0x1'),_0xfb5e('0x2'),'update'];function createListener(_0x4ac88e,_0x4a925b){return function(_0x2370cc){_0x4a925b[_0xfb5e('0x3')](_0x4ac88e,_0x2370cc);};}function removeListener(_0x20cad2,_0x5b5e49){return function(){VoiceQueueEvents[_0xfb5e('0x4')](_0x20cad2,_0x5b5e49);};}exports[_0xfb5e('0x5')]=function(_0x247032){for(var _0x294a9e=0x0,_0x53fec1=events['length'];_0x294a9e<_0x53fec1;_0x294a9e++){var _0x13f2d0=events[_0x294a9e];var _0x4909c3=createListener(_0xfb5e('0x6')+_0x13f2d0,_0x247032);VoiceQueueEvents['on'](_0x13f2d0,_0x4909c3);}}; \ No newline at end of file +var _0x1b32=['./voiceQueue.events','save','update','removeListener','register','length','voiceQueue:'];(function(_0xd90649,_0x5499d2){var _0x4a6767=function(_0x2b4b64){while(--_0x2b4b64){_0xd90649['push'](_0xd90649['shift']());}};_0x4a6767(++_0x5499d2);}(_0x1b32,0x10a));var _0x21b3=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x1b32[_0x26462c];return _0x509a42;};'use strict';var VoiceQueueEvents=require(_0x21b3('0x0'));var events=[_0x21b3('0x1'),'remove',_0x21b3('0x2')];function createListener(_0x40f294,_0xbedd95){return function(_0x5f39a7){_0xbedd95['emit'](_0x40f294,_0x5f39a7);};}function removeListener(_0x202724,_0x49285a){return function(){VoiceQueueEvents[_0x21b3('0x3')](_0x202724,_0x49285a);};}exports[_0x21b3('0x4')]=function(_0xb0b01f){for(var _0x302c96=0x0,_0x545b43=events[_0x21b3('0x5')];_0x302c96<_0x545b43;_0x302c96++){var _0x8b971f=events[_0x302c96];var _0x12e8da=createListener(_0x21b3('0x6')+_0x8b971f,_0xb0b01f);VoiceQueueEvents['on'](_0x8b971f,_0x12e8da);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index fe2f139..58018e1 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 _0x378b=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x5a82b1,_0x187a2f){var _0x563732=function(_0x82f21d){while(--_0x82f21d){_0x5a82b1['push'](_0x5a82b1['shift']());}};_0x563732(++_0x187a2f);}(_0x378b,0xc7));var _0xb378=function(_0x50be52,_0x525a70){_0x50be52=_0x50be52-0x0;var _0x2bf2e0=_0x378b[_0x50be52];return _0x2bf2e0;};'use strict';var multer=require(_0xb378('0x0'));var util=require(_0xb378('0x1'));var path=require(_0xb378('0x2'));var timeout=require(_0xb378('0x3'));var express=require('express');var router=express[_0xb378('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb378('0x5'));var interaction=require(_0xb378('0x6'));var config=require(_0xb378('0x7'));var controller=require(_0xb378('0x8'));router[_0xb378('0x9')]('/',auth[_0xb378('0xa')](),controller[_0xb378('0xb')]);router[_0xb378('0x9')](_0xb378('0xc'),auth['isAuthenticated'](),controller[_0xb378('0xd')]);router[_0xb378('0x9')](_0xb378('0xe'),auth[_0xb378('0xa')](),controller[_0xb378('0xf')]);router[_0xb378('0x9')](_0xb378('0x10'),auth['isAuthenticated'](),controller[_0xb378('0x11')]);router['post']('/',auth[_0xb378('0xa')](),controller[_0xb378('0x12')]);router[_0xb378('0x13')](_0xb378('0x10'),auth['isAuthenticated'](),controller[_0xb378('0x14')]);router[_0xb378('0x15')](_0xb378('0x10'),auth[_0xb378('0xa')](),controller[_0xb378('0x16')]);module[_0xb378('0x17')]=router; \ No newline at end of file +var _0x0574=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post','create','put'];(function(_0x39e4a1,_0x4edcc5){var _0x55b30e=function(_0x5efd8e){while(--_0x5efd8e){_0x39e4a1['push'](_0x39e4a1['shift']());}};_0x55b30e(++_0x4edcc5);}(_0x0574,0x71));var _0x4057=function(_0x151787,_0x77ec0f){_0x151787=_0x151787-0x0;var _0x35f544=_0x0574[_0x151787];return _0x35f544;};'use strict';var multer=require(_0x4057('0x0'));var util=require(_0x4057('0x1'));var path=require(_0x4057('0x2'));var timeout=require(_0x4057('0x3'));var express=require('express');var router=express[_0x4057('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4057('0x5'));var interaction=require(_0x4057('0x6'));var config=require(_0x4057('0x7'));var controller=require(_0x4057('0x8'));router[_0x4057('0x9')]('/',auth['isAuthenticated'](),controller[_0x4057('0xa')]);router[_0x4057('0x9')]('/describe',auth[_0x4057('0xb')](),controller['describe']);router[_0x4057('0x9')](_0x4057('0xc'),auth[_0x4057('0xb')](),controller[_0x4057('0xd')]);router[_0x4057('0x9')](_0x4057('0xe'),auth['isAuthenticated'](),controller[_0x4057('0xf')]);router[_0x4057('0x10')]('/',auth[_0x4057('0xb')](),controller[_0x4057('0x11')]);router[_0x4057('0x12')](_0x4057('0xe'),auth[_0x4057('0xb')](),controller[_0x4057('0x13')]);router['delete'](_0x4057('0xe'),auth[_0x4057('0xb')](),controller[_0x4057('0x14')]);module[_0x4057('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ec8d56a..c78900f 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 _0x263e=['format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x263e,0x19e));var _0xe263=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0x263e[_0x52a6e3];return _0x8910d0;};'use strict';var Sequelize=require(_0xe263('0x0'));var moment=require(_0xe263('0x1'));module[_0xe263('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe263('0x3')]},'calleridname':{'type':Sequelize[_0xe263('0x3')]},'queue':{'type':Sequelize[_0xe263('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xe263('0x4')],'set':function(_0x16a8a3){var _0x4a8190=moment(_0x16a8a3);var _0x326e5e=moment(this[_0xe263('0x5')]('queuecallerjoinAt'))[_0xe263('0x6')](_0xe263('0x7'));var _0xb59d1=_0x4a8190['diff'](_0x326e5e,'seconds');this[_0xe263('0x8')](_0xe263('0x9'),_0x16a8a3);this[_0xe263('0x8')](_0xe263('0xa'),_0xb59d1||null);}},'position':{'type':Sequelize[_0xe263('0xb')]},'count':{'type':Sequelize[_0xe263('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerexit':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe263('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xe263('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xe263('0x3')]},'connectedlinenum':{'type':Sequelize[_0xe263('0x3')]},'connectedlinename':{'type':Sequelize[_0xe263('0x3')]},'accountcode':{'type':Sequelize[_0xe263('0x3')]},'context':{'type':Sequelize[_0xe263('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe263('0x3')]},'holdtime':{'type':Sequelize[_0xe263('0xb')]},'mohtime':{'type':Sequelize[_0xe263('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe263('0x3')]},'transfer':{'type':Sequelize[_0xe263('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe263('0x3')],'comment':_0xe263('0xd')},'transferexten':{'type':Sequelize[_0xe263('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe263('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd79a=['moment','exports','STRING','DATE','getDataValue','format','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd79a,0x180));var _0xad79=function(_0x391055,_0xf0541e){_0x391055=_0x391055-0x0;var _0x131664=_0xd79a[_0x391055];return _0x131664;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xad79('0x0'));module[_0xad79('0x1')]={'type':{'type':Sequelize[_0xad79('0x2')]},'uniqueid':{'type':Sequelize[_0xad79('0x2')]},'calleridnum':{'type':Sequelize[_0xad79('0x2')]},'calleridname':{'type':Sequelize[_0xad79('0x2')]},'queue':{'type':Sequelize[_0xad79('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xad79('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xad79('0x3')],'set':function(_0x22839b){var _0x3e7c5f=moment(_0x22839b);var _0x67c18b=moment(this[_0xad79('0x4')]('queuecallerjoinAt'))[_0xad79('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x42cdc7=_0x3e7c5f[_0xad79('0x6')](_0x67c18b,'seconds');this[_0xad79('0x7')](_0xad79('0x8'),_0x22839b);this[_0xad79('0x7')]('holdtime',_0x42cdc7||null);}},'position':{'type':Sequelize[_0xad79('0x9')]},'count':{'type':Sequelize[_0xad79('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xad79('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xad79('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xad79('0x3')]},'queuecallerexit':{'type':Sequelize[_0xad79('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xad79('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xad79('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xad79('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xad79('0x2')]},'accountcode':{'type':Sequelize[_0xad79('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xad79('0x2')]},'priority':{'type':Sequelize[_0xad79('0x2')]},'holdtime':{'type':Sequelize[_0xad79('0x9')]},'mohtime':{'type':Sequelize[_0xad79('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xad79('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xad79('0x2')],'comment':_0xad79('0xb')},'transferexten':{'type':Sequelize[_0xad79('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xad79('0x2')]},'thirdDisposition':{'type':Sequelize[_0xad79('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xad79('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d3511e6..2e8fd5a 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 _0xcc26=['stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','catch','body','params','destroy','describe','getVoiceQueuesReport','order','findAll','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then'];(function(_0x1bd227,_0x1519e9){var _0x3f3dcf=function(_0x182b0b){while(--_0x182b0b){_0x1bd227['push'](_0x1bd227['shift']());}};_0x3f3dcf(++_0x1519e9);}(_0xcc26,0x7e));var _0x6cc2=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0xcc26[_0x324012];return _0x435cf2;};'use strict';var emlformat=require(_0x6cc2('0x0'));var rimraf=require(_0x6cc2('0x1'));var zipdir=require(_0x6cc2('0x2'));var jsonpatch=require(_0x6cc2('0x3'));var rp=require(_0x6cc2('0x4'));var moment=require('moment');var BPromise=require(_0x6cc2('0x5'));var Mustache=require(_0x6cc2('0x6'));var util=require(_0x6cc2('0x7'));var path=require('path');var sox=require(_0x6cc2('0x8'));var csv=require(_0x6cc2('0x9'));var ejs=require(_0x6cc2('0xa'));var fs=require('fs');var fs_extra=require(_0x6cc2('0xb'));var _=require(_0x6cc2('0xc'));var squel=require('squel');var crypto=require(_0x6cc2('0xd'));var jsforce=require(_0x6cc2('0xe'));var deskjs=require(_0x6cc2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6cc2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6cc2('0x11'));var qs=require(_0x6cc2('0x12'));var as=require(_0x6cc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc2('0x14'))(_0x6cc2('0x15'));var utils=require(_0x6cc2('0x16'));var config=require(_0x6cc2('0x17'));var licenseUtil=require(_0x6cc2('0x18'));var db=require(_0x6cc2('0x19'))['db'];config['redis']=_[_0x6cc2('0x1a')](config['redis'],{'host':_0x6cc2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cc2('0x1c')]));require(_0x6cc2('0x1d'))[_0x6cc2('0x1e')](socket);function respondWithStatusCode(_0x2b0b70,_0x37da4d){_0x37da4d=_0x37da4d||0xcc;return function(_0x19460d){if(_0x19460d){return _0x2b0b70[_0x6cc2('0x1f')](_0x37da4d);}return _0x2b0b70[_0x6cc2('0x20')](_0x37da4d)[_0x6cc2('0x21')]();};}function respondWithResult(_0x4d4bcc,_0x1f0b0f){_0x1f0b0f=_0x1f0b0f||0xc8;return function(_0x370fc0){if(_0x370fc0){return _0x4d4bcc[_0x6cc2('0x20')](_0x1f0b0f)[_0x6cc2('0x22')](_0x370fc0);}};}function respondWithFilteredResult(_0x493cfd,_0x244260){return function(_0xf9bd11){if(_0xf9bd11){var _0x4f1748=typeof _0x244260[_0x6cc2('0x23')]===_0x6cc2('0x24')&&typeof _0x244260['limit']==='undefined';var _0x35e449=_0xf9bd11['count'];var _0x120e77=_0x4f1748?0x0:_0x244260[_0x6cc2('0x23')];var _0x4106d7=_0x4f1748?_0xf9bd11[_0x6cc2('0x25')]:_0x244260['offset']+_0x244260[_0x6cc2('0x26')];var _0x179a11;if(_0x4106d7>=_0x35e449){_0x4106d7=_0x35e449;_0x179a11=0xc8;}else{_0x179a11=0xce;}_0x493cfd[_0x6cc2('0x20')](_0x179a11);return _0x493cfd['set'](_0x6cc2('0x27'),_0x120e77+'-'+_0x4106d7+'/'+_0x35e449)['json'](_0xf9bd11);}return null;};}function patchUpdates(_0x237f42){return function(_0x1e5b85){try{jsonpatch[_0x6cc2('0x28')](_0x1e5b85,_0x237f42,!![]);}catch(_0x5454e6){return BPromise[_0x6cc2('0x29')](_0x5454e6);}return _0x1e5b85['save']();};}function saveUpdates(_0x56dcef,_0x573400){return function(_0x3d30a2){if(_0x3d30a2){return _0x3d30a2[_0x6cc2('0x2a')](_0x56dcef)['then'](function(_0x14e88f){return _0x14e88f;});}return null;};}function removeEntity(_0x3a94f5,_0x3844fc){return function(_0xd95bfe){if(_0xd95bfe){return _0xd95bfe['destroy']()[_0x6cc2('0x2b')](function(){_0x3a94f5[_0x6cc2('0x20')](0xcc)[_0x6cc2('0x21')]();});}};}function handleEntityNotFound(_0x16240d,_0x52ed01){return function(_0x56e6c5){if(!_0x56e6c5){_0x16240d[_0x6cc2('0x1f')](0x194);}return _0x56e6c5;};}function handleError(_0x416294,_0x2a4765){_0x2a4765=_0x2a4765||0x1f4;return function(_0x31022f){logger['error'](_0x31022f[_0x6cc2('0x2c')]);if(_0x31022f[_0x6cc2('0x2d')]){delete _0x31022f['name'];}_0x416294[_0x6cc2('0x20')](_0x2a4765)[_0x6cc2('0x2e')](_0x31022f);};}exports[_0x6cc2('0x2f')]=function(_0x1ab368,_0x215e63){var _0xc731f8={},_0x5da62a={},_0x2f0ea8={'count':0x0,'rows':[]};var _0x30dc50=_[_0x6cc2('0x30')](db[_0x6cc2('0x31')][_0x6cc2('0x32')],function(_0xdb3c2e){return{'name':_0xdb3c2e[_0x6cc2('0x33')],'type':_0xdb3c2e[_0x6cc2('0x34')][_0x6cc2('0x35')]};});_0x5da62a[_0x6cc2('0x36')]=_['map'](_0x30dc50,_0x6cc2('0x2d'));_0x5da62a[_0x6cc2('0x37')]=_[_0x6cc2('0x38')](_0x1ab368[_0x6cc2('0x37')]);_0x5da62a[_0x6cc2('0x39')]=_[_0x6cc2('0x3a')](_0x5da62a[_0x6cc2('0x36')],_0x5da62a['query']);_0xc731f8['attributes']=_[_0x6cc2('0x3a')](_0x5da62a['model'],qs[_0x6cc2('0x3b')](_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x3b')]));_0xc731f8[_0x6cc2('0x3c')]=_0xc731f8[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0xc731f8[_0x6cc2('0x3c')]:_0x5da62a[_0x6cc2('0x36')];if(!_0x1ab368['query'][_0x6cc2('0x3e')](_0x6cc2('0x3f'))){_0xc731f8[_0x6cc2('0x26')]=qs[_0x6cc2('0x26')](_0x1ab368['query'][_0x6cc2('0x26')]);_0xc731f8[_0x6cc2('0x23')]=qs[_0x6cc2('0x23')](_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x23')]);}_0xc731f8['order']=qs[_0x6cc2('0x40')](_0x1ab368[_0x6cc2('0x37')]['sort']);_0xc731f8[_0x6cc2('0x41')]=qs['filters'](_[_0x6cc2('0x42')](_0x1ab368[_0x6cc2('0x37')],_0x5da62a[_0x6cc2('0x39')]),_0x30dc50);if(_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x43')]){_0xc731f8[_0x6cc2('0x41')]=_[_0x6cc2('0x44')](_0xc731f8['where'],{'$or':_[_0x6cc2('0x30')](_0x30dc50,function(_0x3dbbb8){if(_0x3dbbb8[_0x6cc2('0x34')]!==_0x6cc2('0x45')){var _0x6f08b6={};_0x6f08b6[_0x3dbbb8[_0x6cc2('0x2d')]]={'$like':'%'+_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x43')]+'%'};return _0x6f08b6;}})});}_0xc731f8=_['merge']({},_0xc731f8,_0x1ab368[_0x6cc2('0x46')]);var _0xb44eda={'where':_0xc731f8['where']};return db[_0x6cc2('0x31')]['count'](_0xb44eda)['then'](function(_0x5295f0){_0x2f0ea8[_0x6cc2('0x25')]=_0x5295f0;if(_0x1ab368[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0xc731f8[_0x6cc2('0x48')]=[{'all':!![]}];}return db[_0x6cc2('0x31')]['findAll'](_0xc731f8);})[_0x6cc2('0x2b')](function(_0x2d6681){_0x2f0ea8[_0x6cc2('0x49')]=_0x2d6681;return _0x2f0ea8;})[_0x6cc2('0x2b')](respondWithFilteredResult(_0x215e63,_0xc731f8))['catch'](handleError(_0x215e63,null));};exports[_0x6cc2('0x4a')]=function(_0x4816bc,_0x517f6c){var _0x23b72f={'raw':![],'where':{'id':_0x4816bc['params']['id']}},_0x49f0ec={};_0x49f0ec['model']=_['keys'](db[_0x6cc2('0x31')][_0x6cc2('0x32')]);_0x49f0ec['query']=_[_0x6cc2('0x38')](_0x4816bc[_0x6cc2('0x37')]);_0x49f0ec[_0x6cc2('0x39')]=_['intersection'](_0x49f0ec['model'],_0x49f0ec[_0x6cc2('0x37')]);_0x23b72f[_0x6cc2('0x3c')]=_[_0x6cc2('0x3a')](_0x49f0ec[_0x6cc2('0x36')],qs['fields'](_0x4816bc[_0x6cc2('0x37')][_0x6cc2('0x3b')]));_0x23b72f['attributes']=_0x23b72f[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0x23b72f[_0x6cc2('0x3c')]:_0x49f0ec[_0x6cc2('0x36')];if(_0x4816bc[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0x23b72f[_0x6cc2('0x48')]=[{'all':!![]}];}_0x23b72f=_['merge']({},_0x23b72f,_0x4816bc[_0x6cc2('0x46')]);return db[_0x6cc2('0x31')][_0x6cc2('0x4b')](_0x23b72f)[_0x6cc2('0x2b')](handleEntityNotFound(_0x517f6c,null))[_0x6cc2('0x2b')](respondWithResult(_0x517f6c,null))['catch'](handleError(_0x517f6c,null));};exports[_0x6cc2('0x4c')]=function(_0x295cf3,_0x332a2b){return db['VoiceQueueReport'][_0x6cc2('0x4c')](_0x295cf3['body'],{})[_0x6cc2('0x2b')](respondWithResult(_0x332a2b,0xc9))[_0x6cc2('0x4d')](handleError(_0x332a2b,null));};exports[_0x6cc2('0x2a')]=function(_0x154964,_0x558d2){if(_0x154964['body']['id']){delete _0x154964[_0x6cc2('0x4e')]['id'];}return db[_0x6cc2('0x31')]['find']({'where':{'id':_0x154964[_0x6cc2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x558d2,null))[_0x6cc2('0x2b')](saveUpdates(_0x154964['body'],null))[_0x6cc2('0x2b')](respondWithResult(_0x558d2,null))['catch'](handleError(_0x558d2,null));};exports[_0x6cc2('0x50')]=function(_0x401481,_0x2d3541){return db[_0x6cc2('0x31')][_0x6cc2('0x4b')]({'where':{'id':_0x401481[_0x6cc2('0x4f')]['id']}})[_0x6cc2('0x2b')](handleEntityNotFound(_0x2d3541,null))[_0x6cc2('0x2b')](removeEntity(_0x2d3541,null))[_0x6cc2('0x4d')](handleError(_0x2d3541,null));};exports[_0x6cc2('0x51')]=function(_0x5c887a,_0x52e15b){return db['VoiceQueueReport'][_0x6cc2('0x51')]()[_0x6cc2('0x2b')](respondWithResult(_0x52e15b,null))[_0x6cc2('0x4d')](handleError(_0x52e15b,null));};exports[_0x6cc2('0x52')]=function(_0x1485f7,_0x5e2907){var _0x3a1fca={},_0x20dae9={},_0x5d6bcf={'count':0x0,'rows':[]};_0x20dae9[_0x6cc2('0x36')]=_[_0x6cc2('0x38')](db[_0x6cc2('0x31')][_0x6cc2('0x32')]);_0x20dae9[_0x6cc2('0x37')]=_[_0x6cc2('0x38')](_0x1485f7[_0x6cc2('0x37')]);_0x20dae9['filters']=_[_0x6cc2('0x3a')](_0x20dae9[_0x6cc2('0x36')],_0x20dae9[_0x6cc2('0x37')]);_0x3a1fca['attributes']=_[_0x6cc2('0x3a')](_0x20dae9['model'],qs[_0x6cc2('0x3b')](_0x1485f7['query']['fields']));_0x3a1fca['attributes']=_0x3a1fca[_0x6cc2('0x3c')][_0x6cc2('0x3d')]?_0x3a1fca['attributes']:_0x20dae9['model'];if(!_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x3e')]('nolimit')){_0x3a1fca[_0x6cc2('0x26')]=qs[_0x6cc2('0x26')](_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x26')]);_0x3a1fca[_0x6cc2('0x23')]=qs['offset'](_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x23')]);}_0x3a1fca[_0x6cc2('0x53')]=qs[_0x6cc2('0x40')](_0x1485f7['query'][_0x6cc2('0x40')]);_0x3a1fca[_0x6cc2('0x41')]=qs[_0x6cc2('0x39')](_[_0x6cc2('0x42')](_0x1485f7[_0x6cc2('0x37')],_0x20dae9[_0x6cc2('0x39')]));if(_0x1485f7[_0x6cc2('0x37')]['filter']){_0x3a1fca[_0x6cc2('0x41')]=_[_0x6cc2('0x44')](_0x3a1fca['where'],{'$or':_[_0x6cc2('0x30')](_0x3a1fca['attributes'],function(_0x36348f){var _0x4573c4={};_0x4573c4[_0x36348f]={'$like':'%'+_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x43')]+'%'};return _0x4573c4;})});}_0x3a1fca=_[_0x6cc2('0x44')]({},_0x3a1fca,_0x1485f7[_0x6cc2('0x46')]);var _0x5bc825={'where':_0x3a1fca[_0x6cc2('0x41')]};return db[_0x6cc2('0x31')]['count'](_0x5bc825)[_0x6cc2('0x2b')](function(_0x142867){_0x5d6bcf[_0x6cc2('0x25')]=_0x142867;if(_0x1485f7[_0x6cc2('0x37')][_0x6cc2('0x47')]){_0x3a1fca['include']=[{'all':!![]}];}return db[_0x6cc2('0x31')][_0x6cc2('0x54')](_0x3a1fca);})['then'](function(_0x5cb06b){_0x5d6bcf[_0x6cc2('0x49')]=_0x5cb06b;return _0x5d6bcf;})['then'](respondWithFilteredResult(_0x5e2907,_0x3a1fca,_0x6cc2('0x52')))[_0x6cc2('0x4d')](handleError(_0x5e2907,null,_0x6cc2('0x52')));}; \ No newline at end of file +var _0x11b6=['mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','getVoiceQueuesReport','pick','rows','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x11b6,0x1da));var _0x611b=function(_0xe4a3e,_0x4f43b9){_0xe4a3e=_0xe4a3e-0x0;var _0x16e287=_0x11b6[_0xe4a3e];return _0x16e287;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x611b('0x0'));var zipdir=require(_0x611b('0x1'));var jsonpatch=require(_0x611b('0x2'));var rp=require(_0x611b('0x3'));var moment=require(_0x611b('0x4'));var BPromise=require(_0x611b('0x5'));var Mustache=require(_0x611b('0x6'));var util=require(_0x611b('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x611b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x611b('0x9'));var squel=require(_0x611b('0xa'));var crypto=require(_0x611b('0xb'));var jsforce=require(_0x611b('0xc'));var deskjs=require(_0x611b('0xd'));var toCsv=require(_0x611b('0xe'));var querystring=require(_0x611b('0xf'));var Papa=require(_0x611b('0x10'));var Redis=require(_0x611b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x611b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x611b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x611b('0x14'));var config=require(_0x611b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x611b('0x16'))['db'];config[_0x611b('0x17')]=_[_0x611b('0x18')](config[_0x611b('0x17')],{'host':_0x611b('0x19'),'port':0x18eb});var socket=require(_0x611b('0x1a'))(new Redis(config[_0x611b('0x17')]));require(_0x611b('0x1b'))[_0x611b('0x1c')](socket);function respondWithStatusCode(_0x3b2a2e,_0x3d9c6e){_0x3d9c6e=_0x3d9c6e||0xcc;return function(_0x25d572){if(_0x25d572){return _0x3b2a2e['sendStatus'](_0x3d9c6e);}return _0x3b2a2e['status'](_0x3d9c6e)[_0x611b('0x1d')]();};}function respondWithResult(_0x97faff,_0x374339){_0x374339=_0x374339||0xc8;return function(_0x399ccd){if(_0x399ccd){return _0x97faff[_0x611b('0x1e')](_0x374339)[_0x611b('0x1f')](_0x399ccd);}};}function respondWithFilteredResult(_0xe7d61f,_0x24d60d){return function(_0x3d7b3f){if(_0x3d7b3f){var _0x41a001=typeof _0x24d60d[_0x611b('0x20')]===_0x611b('0x21')&&typeof _0x24d60d[_0x611b('0x22')]===_0x611b('0x21');var _0x5921c7=_0x3d7b3f[_0x611b('0x23')];var _0x4be68a=_0x41a001?0x0:_0x24d60d[_0x611b('0x20')];var _0x35c373=_0x41a001?_0x3d7b3f[_0x611b('0x23')]:_0x24d60d[_0x611b('0x20')]+_0x24d60d['limit'];var _0x477b7d;if(_0x35c373>=_0x5921c7){_0x35c373=_0x5921c7;_0x477b7d=0xc8;}else{_0x477b7d=0xce;}_0xe7d61f[_0x611b('0x1e')](_0x477b7d);return _0xe7d61f['set']('Content-Range',_0x4be68a+'-'+_0x35c373+'/'+_0x5921c7)[_0x611b('0x1f')](_0x3d7b3f);}return null;};}function patchUpdates(_0x3e166f){return function(_0x3e3bf3){try{jsonpatch['apply'](_0x3e3bf3,_0x3e166f,!![]);}catch(_0x2817cd){return BPromise[_0x611b('0x24')](_0x2817cd);}return _0x3e3bf3[_0x611b('0x25')]();};}function saveUpdates(_0x295ee8,_0x1ab942){return function(_0x29c604){if(_0x29c604){return _0x29c604[_0x611b('0x26')](_0x295ee8)[_0x611b('0x27')](function(_0x4497f4){return _0x4497f4;});}return null;};}function removeEntity(_0x176d37,_0xca0f12){return function(_0x43e6f0){if(_0x43e6f0){return _0x43e6f0[_0x611b('0x28')]()[_0x611b('0x27')](function(){_0x176d37[_0x611b('0x1e')](0xcc)[_0x611b('0x1d')]();});}};}function handleEntityNotFound(_0x442acb,_0x102db7){return function(_0x3ce614){if(!_0x3ce614){_0x442acb[_0x611b('0x29')](0x194);}return _0x3ce614;};}function handleError(_0x8f5244,_0x20a993){_0x20a993=_0x20a993||0x1f4;return function(_0x36cb37){logger[_0x611b('0x2a')](_0x36cb37[_0x611b('0x2b')]);if(_0x36cb37['name']){delete _0x36cb37[_0x611b('0x2c')];}_0x8f5244[_0x611b('0x1e')](_0x20a993)['send'](_0x36cb37);};}exports[_0x611b('0x2d')]=function(_0x2543d3,_0x49d5dd){var _0x2cccdf={},_0x424da6={},_0xc58442={'count':0x0,'rows':[]};var _0x956fe7=_[_0x611b('0x2e')](db[_0x611b('0x2f')][_0x611b('0x30')],function(_0x4bb47f){return{'name':_0x4bb47f['fieldName'],'type':_0x4bb47f[_0x611b('0x31')][_0x611b('0x32')]};});_0x424da6[_0x611b('0x33')]=_[_0x611b('0x2e')](_0x956fe7,_0x611b('0x2c'));_0x424da6[_0x611b('0x34')]=_[_0x611b('0x35')](_0x2543d3[_0x611b('0x34')]);_0x424da6[_0x611b('0x36')]=_[_0x611b('0x37')](_0x424da6[_0x611b('0x33')],_0x424da6[_0x611b('0x34')]);_0x2cccdf[_0x611b('0x38')]=_[_0x611b('0x37')](_0x424da6[_0x611b('0x33')],qs[_0x611b('0x39')](_0x2543d3[_0x611b('0x34')][_0x611b('0x39')]));_0x2cccdf[_0x611b('0x38')]=_0x2cccdf[_0x611b('0x38')]['length']?_0x2cccdf[_0x611b('0x38')]:_0x424da6[_0x611b('0x33')];if(!_0x2543d3[_0x611b('0x34')][_0x611b('0x3a')](_0x611b('0x3b'))){_0x2cccdf[_0x611b('0x22')]=qs[_0x611b('0x22')](_0x2543d3[_0x611b('0x34')][_0x611b('0x22')]);_0x2cccdf['offset']=qs[_0x611b('0x20')](_0x2543d3['query'][_0x611b('0x20')]);}_0x2cccdf[_0x611b('0x3c')]=qs[_0x611b('0x3d')](_0x2543d3[_0x611b('0x34')]['sort']);_0x2cccdf[_0x611b('0x3e')]=qs[_0x611b('0x36')](_['pick'](_0x2543d3[_0x611b('0x34')],_0x424da6[_0x611b('0x36')]),_0x956fe7);if(_0x2543d3['query'][_0x611b('0x3f')]){_0x2cccdf['where']=_[_0x611b('0x40')](_0x2cccdf[_0x611b('0x3e')],{'$or':_[_0x611b('0x2e')](_0x956fe7,function(_0xc644e7){if(_0xc644e7[_0x611b('0x31')]!==_0x611b('0x41')){var _0x33c110={};_0x33c110[_0xc644e7[_0x611b('0x2c')]]={'$like':'%'+_0x2543d3[_0x611b('0x34')][_0x611b('0x3f')]+'%'};return _0x33c110;}})});}_0x2cccdf=_[_0x611b('0x40')]({},_0x2cccdf,_0x2543d3[_0x611b('0x42')]);var _0x3a2aac={'where':_0x2cccdf['where']};return db['VoiceQueueReport'][_0x611b('0x23')](_0x3a2aac)[_0x611b('0x27')](function(_0x11652f){_0xc58442[_0x611b('0x23')]=_0x11652f;if(_0x2543d3[_0x611b('0x34')][_0x611b('0x43')]){_0x2cccdf['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x611b('0x44')](_0x2cccdf);})['then'](function(_0x8840db){_0xc58442['rows']=_0x8840db;return _0xc58442;})[_0x611b('0x27')](respondWithFilteredResult(_0x49d5dd,_0x2cccdf))[_0x611b('0x45')](handleError(_0x49d5dd,null));};exports[_0x611b('0x46')]=function(_0x425099,_0x1e5785){var _0x720c30={'raw':![],'where':{'id':_0x425099[_0x611b('0x47')]['id']}},_0x4d8c3f={};_0x4d8c3f[_0x611b('0x33')]=_[_0x611b('0x35')](db[_0x611b('0x2f')][_0x611b('0x30')]);_0x4d8c3f['query']=_['keys'](_0x425099['query']);_0x4d8c3f[_0x611b('0x36')]=_[_0x611b('0x37')](_0x4d8c3f[_0x611b('0x33')],_0x4d8c3f['query']);_0x720c30['attributes']=_[_0x611b('0x37')](_0x4d8c3f[_0x611b('0x33')],qs['fields'](_0x425099[_0x611b('0x34')][_0x611b('0x39')]));_0x720c30[_0x611b('0x38')]=_0x720c30[_0x611b('0x38')]['length']?_0x720c30[_0x611b('0x38')]:_0x4d8c3f[_0x611b('0x33')];if(_0x425099[_0x611b('0x34')][_0x611b('0x43')]){_0x720c30[_0x611b('0x48')]=[{'all':!![]}];}_0x720c30=_[_0x611b('0x40')]({},_0x720c30,_0x425099[_0x611b('0x42')]);return db[_0x611b('0x2f')][_0x611b('0x49')](_0x720c30)[_0x611b('0x27')](handleEntityNotFound(_0x1e5785,null))[_0x611b('0x27')](respondWithResult(_0x1e5785,null))[_0x611b('0x45')](handleError(_0x1e5785,null));};exports[_0x611b('0x4a')]=function(_0x582db3,_0x15c103){return db[_0x611b('0x2f')][_0x611b('0x4a')](_0x582db3[_0x611b('0x4b')],{})[_0x611b('0x27')](respondWithResult(_0x15c103,0xc9))['catch'](handleError(_0x15c103,null));};exports[_0x611b('0x26')]=function(_0x314533,_0x275204){if(_0x314533[_0x611b('0x4b')]['id']){delete _0x314533[_0x611b('0x4b')]['id'];}return db[_0x611b('0x2f')][_0x611b('0x49')]({'where':{'id':_0x314533[_0x611b('0x47')]['id']}})['then'](handleEntityNotFound(_0x275204,null))['then'](saveUpdates(_0x314533['body'],null))[_0x611b('0x27')](respondWithResult(_0x275204,null))[_0x611b('0x45')](handleError(_0x275204,null));};exports[_0x611b('0x28')]=function(_0xb74017,_0x27f77f){return db[_0x611b('0x2f')][_0x611b('0x49')]({'where':{'id':_0xb74017[_0x611b('0x47')]['id']}})[_0x611b('0x27')](handleEntityNotFound(_0x27f77f,null))['then'](removeEntity(_0x27f77f,null))['catch'](handleError(_0x27f77f,null));};exports[_0x611b('0x4c')]=function(_0x5b03b5,_0x1421f0){return db[_0x611b('0x2f')][_0x611b('0x4c')]()[_0x611b('0x27')](respondWithResult(_0x1421f0,null))[_0x611b('0x45')](handleError(_0x1421f0,null));};exports[_0x611b('0x4d')]=function(_0x338726,_0x4b82d3){var _0x4a5e40={},_0x5133c2={},_0x463c9f={'count':0x0,'rows':[]};_0x5133c2[_0x611b('0x33')]=_[_0x611b('0x35')](db[_0x611b('0x2f')][_0x611b('0x30')]);_0x5133c2[_0x611b('0x34')]=_['keys'](_0x338726['query']);_0x5133c2[_0x611b('0x36')]=_[_0x611b('0x37')](_0x5133c2['model'],_0x5133c2[_0x611b('0x34')]);_0x4a5e40[_0x611b('0x38')]=_['intersection'](_0x5133c2[_0x611b('0x33')],qs[_0x611b('0x39')](_0x338726[_0x611b('0x34')][_0x611b('0x39')]));_0x4a5e40['attributes']=_0x4a5e40[_0x611b('0x38')]['length']?_0x4a5e40[_0x611b('0x38')]:_0x5133c2[_0x611b('0x33')];if(!_0x338726[_0x611b('0x34')][_0x611b('0x3a')](_0x611b('0x3b'))){_0x4a5e40[_0x611b('0x22')]=qs[_0x611b('0x22')](_0x338726[_0x611b('0x34')][_0x611b('0x22')]);_0x4a5e40['offset']=qs[_0x611b('0x20')](_0x338726[_0x611b('0x34')][_0x611b('0x20')]);}_0x4a5e40['order']=qs[_0x611b('0x3d')](_0x338726[_0x611b('0x34')][_0x611b('0x3d')]);_0x4a5e40[_0x611b('0x3e')]=qs[_0x611b('0x36')](_[_0x611b('0x4e')](_0x338726[_0x611b('0x34')],_0x5133c2['filters']));if(_0x338726[_0x611b('0x34')]['filter']){_0x4a5e40['where']=_[_0x611b('0x40')](_0x4a5e40[_0x611b('0x3e')],{'$or':_[_0x611b('0x2e')](_0x4a5e40['attributes'],function(_0x4595c7){var _0x49df90={};_0x49df90[_0x4595c7]={'$like':'%'+_0x338726[_0x611b('0x34')][_0x611b('0x3f')]+'%'};return _0x49df90;})});}_0x4a5e40=_['merge']({},_0x4a5e40,_0x338726[_0x611b('0x42')]);var _0x5b4da3={'where':_0x4a5e40[_0x611b('0x3e')]};return db[_0x611b('0x2f')][_0x611b('0x23')](_0x5b4da3)[_0x611b('0x27')](function(_0x59afa4){_0x463c9f[_0x611b('0x23')]=_0x59afa4;if(_0x338726[_0x611b('0x34')][_0x611b('0x43')]){_0x4a5e40['include']=[{'all':!![]}];}return db[_0x611b('0x2f')][_0x611b('0x44')](_0x4a5e40);})[_0x611b('0x27')](function(_0x597feb){_0x463c9f[_0x611b('0x4f')]=_0x597feb;return _0x463c9f;})[_0x611b('0x27')](respondWithFilteredResult(_0x4b82d3,_0x4a5e40,_0x611b('0x4d')))[_0x611b('0x45')](handleError(_0x4b82d3,null,_0x611b('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0df593c..b390ebd 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 _0xcdb0=['VoiceQueueReport','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdb0,0x16e));var _0x0cdb=function(_0x37f64f,_0x2a476a){_0x37f64f=_0x37f64f-0x0;var _0x11f3ad=_0xcdb0[_0x37f64f];return _0x11f3ad;};'use strict';var EventEmitter=require(_0x0cdb('0x0'));var VoiceQueueReport=require(_0x0cdb('0x1'))['db'][_0x0cdb('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0cdb('0x3'),'afterUpdate':_0x0cdb('0x4'),'afterDestroy':_0x0cdb('0x5')};function emitEvent(_0x1afec0){return function(_0x331923,_0x27d610,_0x439139){VoiceQueueReportEvents[_0x0cdb('0x6')](_0x1afec0+':'+_0x331923['id'],_0x331923);VoiceQueueReportEvents[_0x0cdb('0x6')](_0x1afec0,_0x331923);_0x439139(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x0cdb('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x1936=['emit','../../mysqldb','setMaxListeners','remove'];(function(_0x2cdb97,_0x19572c){var _0x490b57=function(_0x21923e){while(--_0x21923e){_0x2cdb97['push'](_0x2cdb97['shift']());}};_0x490b57(++_0x19572c);}(_0x1936,0x1e1));var _0x6193=function(_0x9664b9,_0x51d10e){_0x9664b9=_0x9664b9-0x0;var _0x420c36=_0x1936[_0x9664b9];return _0x420c36;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x6193('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6193('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6193('0x2')};function emitEvent(_0x5d80b7){return function(_0x9602ba,_0x40cf20,_0x344a50){VoiceQueueReportEvents['emit'](_0x5d80b7+':'+_0x9602ba['id'],_0x9602ba);VoiceQueueReportEvents[_0x6193('0x3')](_0x5d80b7,_0x9602ba);_0x344a50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 8eff718..a30cedb 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 _0xa33e=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x14c461,_0x2ef497){var _0x1af1b7=function(_0x377489){while(--_0x377489){_0x14c461['push'](_0x14c461['shift']());}};_0x1af1b7(++_0x2ef497);}(_0xa33e,0x1b2));var _0xea33=function(_0x1ef2a7,_0x2fe558){_0x1ef2a7=_0x1ef2a7-0x0;var _0x32e0ce=_0xa33e[_0x1ef2a7];return _0x32e0ce;};'use strict';var _=require(_0xea33('0x0'));var util=require('util');var logger=require(_0xea33('0x1'))(_0xea33('0x2'));var moment=require(_0xea33('0x3'));var BPromise=require(_0xea33('0x4'));var rp=require(_0xea33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea33('0x6'));var attributes=require(_0xea33('0x7'));module[_0xea33('0x8')]=function(_0xae1294,_0x2d8c7c){return _0xae1294[_0xea33('0x9')](_0xea33('0xa'),attributes,{'tableName':_0xea33('0xb'),'paranoid':![],'indexes':[{'fields':[_0xea33('0xc')]},{'fields':[_0xea33('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd253=['request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x476bcd,_0x2f6582){var _0x47b60f=function(_0x406a6e){while(--_0x406a6e){_0x476bcd['push'](_0x476bcd['shift']());}};_0x47b60f(++_0x2f6582);}(_0xd253,0xfa));var _0x3d25=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xd253[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x3d25('0x0'));var util=require(_0x3d25('0x1'));var logger=require(_0x3d25('0x2'))(_0x3d25('0x3'));var moment=require(_0x3d25('0x4'));var BPromise=require(_0x3d25('0x5'));var rp=require(_0x3d25('0x6'));var fs=require('fs');var path=require(_0x3d25('0x7'));var rimraf=require('rimraf');var config=require(_0x3d25('0x8'));var attributes=require(_0x3d25('0x9'));module[_0x3d25('0xa')]=function(_0x14aa6e,_0x4a2713){return _0x14aa6e[_0x3d25('0xb')](_0x3d25('0xc'),attributes,{'tableName':_0x3d25('0xd'),'paranoid':![],'indexes':[{'fields':[_0x3d25('0xe')]},{'fields':[_0x3d25('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index dbecbcf..304e4d1 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 _0xf99e=['code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x1135e4,_0x92b3){var _0x6d4b08=function(_0x495510){while(--_0x495510){_0x1135e4['push'](_0x1135e4['shift']());}};_0x6d4b08(++_0x92b3);}(_0xf99e,0x15d));var _0xef99=function(_0x4af2c3,_0xf4d1f4){_0x4af2c3=_0x4af2c3-0x0;var _0x74088=_0xf99e[_0x4af2c3];return _0x74088;};'use strict';var _=require(_0xef99('0x0'));var util=require(_0xef99('0x1'));var moment=require(_0xef99('0x2'));var BPromise=require(_0xef99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef99('0x4'))['db'];var utils=require(_0xef99('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xef99('0x6'));var jayson=require(_0xef99('0x7'));var client=jayson['client'][_0xef99('0x8')]({'port':0x232a});config[_0xef99('0x9')]=_[_0xef99('0xa')](config[_0xef99('0x9')],{'host':_0xef99('0xb'),'port':0x18eb});var socket=require(_0xef99('0xc'))(new Redis(config[_0xef99('0x9')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x5bf34d,_0x3094eb,_0x589c0c){return new BPromise(function(_0x374e53,_0x3f9170){return client[_0xef99('0xd')](_0x5bf34d,_0x589c0c)[_0xef99('0xe')](function(_0x34663c){logger[_0xef99('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'));logger[_0xef99('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'),JSON[_0xef99('0x12')](_0x34663c));if(_0x34663c['error']){if(_0x34663c[_0xef99('0x13')][_0xef99('0x14')]===0x1f4){logger[_0xef99('0x13')](_0xef99('0x15'),_0x3094eb,_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);return _0x3f9170(_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0x34663c[_0xef99('0x13')][_0xef99('0x16')]);return _0x374e53(_0x34663c['error'][_0xef99('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x3094eb,_0xef99('0x10'));_0x374e53(_0x34663c[_0xef99('0x17')]['message']);}})[_0xef99('0x18')](function(_0x208288){logger[_0xef99('0x13')](_0xef99('0x15'),_0x3094eb,_0x208288);_0x3f9170(_0x208288);});});}exports[_0xef99('0x19')]=function(_0x2bd418){var _0x38c0ec=this;return new Promise(function(_0x292f25,_0x41eff2){return db['VoiceQueueReport'][_0xef99('0x1a')]({'raw':_0x2bd418['options']?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1c')]===undefined?!![]:![]:!![],'where':_0x2bd418[_0xef99('0x1b')]?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1d')]||null:null,'attributes':_0x2bd418['options']?_0x2bd418[_0xef99('0x1b')][_0xef99('0x1e')]||null:null,'limit':_0x2bd418[_0xef99('0x1b')]?_0x2bd418['options'][_0xef99('0x1f')]||null:null,'include':_0x2bd418[_0xef99('0x1b')]?_0x2bd418['options'][_0xef99('0x20')]?_[_0xef99('0x21')](_0x2bd418[_0xef99('0x1b')][_0xef99('0x20')],function(_0x5c5ad3){return{'model':db[_0x5c5ad3[_0xef99('0x22')]],'as':_0x5c5ad3['as'],'attributes':_0x5c5ad3[_0xef99('0x1e')],'include':_0x5c5ad3[_0xef99('0x20')]?_[_0xef99('0x21')](_0x5c5ad3[_0xef99('0x20')],function(_0x36415c){return{'model':db[_0x36415c[_0xef99('0x22')]],'as':_0x36415c['as'],'attributes':_0x36415c[_0xef99('0x1e')],'include':_0x36415c[_0xef99('0x20')]?_[_0xef99('0x21')](_0x36415c[_0xef99('0x20')],function(_0xe8fbcc){return{'model':db[_0xe8fbcc[_0xef99('0x22')]],'as':_0xe8fbcc['as'],'attributes':_0xe8fbcc[_0xef99('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xef99('0xe')](function(_0x25b0da){logger['info'](_0xef99('0x19'),_0x2bd418);logger[_0xef99('0x11')](_0xef99('0x19'),_0x2bd418,JSON[_0xef99('0x12')](_0x25b0da));_0x292f25(_0x25b0da);})['catch'](function(_0x73c400){logger['error'](_0xef99('0x19'),_0x73c400[_0xef99('0x16')],_0x2bd418);_0x41eff2(_0x38c0ec[_0xef99('0x13')](0x1f4,_0x73c400[_0xef99('0x16')]));});});};exports[_0xef99('0x23')]=function(_0x204bf9){var _0x36c13b=this;return new Promise(function(_0x63ab5c,_0x34aebc){return db[_0xef99('0x24')][_0xef99('0x25')](_0x204bf9[_0xef99('0x26')],{'raw':_0x204bf9[_0xef99('0x1b')]?_0x204bf9['options']['raw']===undefined?!![]:![]:!![]})[_0xef99('0xe')](function(_0x21cb2f){logger[_0xef99('0xf')]('CreateVoiceQueueReport',_0x204bf9);logger[_0xef99('0x11')]('CreateVoiceQueueReport',_0x204bf9,JSON[_0xef99('0x12')](_0x21cb2f));_0x63ab5c(_0x21cb2f);})[_0xef99('0x18')](function(_0x574c8e){logger[_0xef99('0x13')]('CreateVoiceQueueReport',_0x574c8e[_0xef99('0x16')],_0x204bf9);_0x34aebc(_0x36c13b[_0xef99('0x13')](0x1f4,_0x574c8e[_0xef99('0x16')]));});});};exports[_0xef99('0x27')]=function(_0x5e03f1){var _0x56b5f6=this;return new Promise(function(_0x37e5c1,_0x176c49){return db[_0xef99('0x24')][_0xef99('0x28')](_0x5e03f1[_0xef99('0x26')],{'raw':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1[_0xef99('0x1b')][_0xef99('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1[_0xef99('0x1b')][_0xef99('0x1d')]||null:null,'attributes':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1['options'][_0xef99('0x1e')]||null:null,'limit':_0x5e03f1[_0xef99('0x1b')]?_0x5e03f1['options'][_0xef99('0x1f')]||null:null})[_0xef99('0xe')](function(_0x3e81c4){logger[_0xef99('0xf')](_0xef99('0x27'),_0x5e03f1);logger['debug'](_0xef99('0x27'),_0x5e03f1,JSON[_0xef99('0x12')](_0x3e81c4));_0x37e5c1(_0x3e81c4);})[_0xef99('0x18')](function(_0x37f291){logger['error'](_0xef99('0x27'),_0x37f291[_0xef99('0x16')],_0x5e03f1);_0x176c49(_0x56b5f6[_0xef99('0x13')](0x1f4,_0x37f291[_0xef99('0x16')]));});});}; \ No newline at end of file +var _0x1d1d=['request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetVoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','VoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0xec2cd8,_0x5203ca){var _0x97b2ee=function(_0x5bf5ae){while(--_0x5bf5ae){_0xec2cd8['push'](_0xec2cd8['shift']());}};_0x97b2ee(++_0x5203ca);}(_0x1d1d,0x95));var _0xd1d1=function(_0x5d1ec9,_0x3c4f41){_0x5d1ec9=_0x5d1ec9-0x0;var _0x25a94a=_0x1d1d[_0x5d1ec9];return _0x25a94a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd1d1('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1d1('0x1'));var db=require(_0xd1d1('0x2'))['db'];var utils=require(_0xd1d1('0x3'));var logger=require(_0xd1d1('0x4'))(_0xd1d1('0x5'));var config=require(_0xd1d1('0x6'));var jayson=require(_0xd1d1('0x7'));var client=jayson[_0xd1d1('0x8')]['http']({'port':0x232a});config[_0xd1d1('0x9')]=_[_0xd1d1('0xa')](config[_0xd1d1('0x9')],{'host':_0xd1d1('0xb'),'port':0x18eb});var socket=require(_0xd1d1('0xc'))(new Redis(config['redis']));require(_0xd1d1('0xd'))[_0xd1d1('0xe')](socket);function respondWithRpcPromise(_0x3a5d92,_0x43e56f,_0x4fadda){return new BPromise(function(_0x2e5c67,_0x1cd694){return client[_0xd1d1('0xf')](_0x3a5d92,_0x4fadda)[_0xd1d1('0x10')](function(_0x3913c5){logger['info'](_0xd1d1('0x11'),_0x43e56f,_0xd1d1('0x12'));logger[_0xd1d1('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x43e56f,'request\x20sent',JSON[_0xd1d1('0x14')](_0x3913c5));if(_0x3913c5[_0xd1d1('0x15')]){if(_0x3913c5[_0xd1d1('0x15')][_0xd1d1('0x16')]===0x1f4){logger[_0xd1d1('0x15')](_0xd1d1('0x11'),_0x43e56f,_0x3913c5[_0xd1d1('0x15')]['message']);return _0x1cd694(_0x3913c5[_0xd1d1('0x15')][_0xd1d1('0x17')]);}logger['error'](_0xd1d1('0x11'),_0x43e56f,_0x3913c5[_0xd1d1('0x15')][_0xd1d1('0x17')]);return _0x2e5c67(_0x3913c5['error']['message']);}else{logger[_0xd1d1('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x43e56f,_0xd1d1('0x12'));_0x2e5c67(_0x3913c5['result'][_0xd1d1('0x17')]);}})[_0xd1d1('0x19')](function(_0x4a42f3){logger[_0xd1d1('0x15')](_0xd1d1('0x11'),_0x43e56f,_0x4a42f3);_0x1cd694(_0x4a42f3);});});}exports[_0xd1d1('0x1a')]=function(_0x489930){var _0x189b71=this;return new Promise(function(_0x168fa5,_0x193536){return db['VoiceQueueReport'][_0xd1d1('0x1b')]({'raw':_0x489930['options']?_0x489930['options'][_0xd1d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x489930[_0xd1d1('0x1d')]?_0x489930['options'][_0xd1d1('0x1e')]||null:null,'attributes':_0x489930['options']?_0x489930['options'][_0xd1d1('0x1f')]||null:null,'limit':_0x489930[_0xd1d1('0x1d')]?_0x489930['options'][_0xd1d1('0x20')]||null:null,'include':_0x489930['options']?_0x489930[_0xd1d1('0x1d')][_0xd1d1('0x21')]?_[_0xd1d1('0x22')](_0x489930[_0xd1d1('0x1d')][_0xd1d1('0x21')],function(_0x5cfab3){return{'model':db[_0x5cfab3[_0xd1d1('0x23')]],'as':_0x5cfab3['as'],'attributes':_0x5cfab3[_0xd1d1('0x1f')],'include':_0x5cfab3[_0xd1d1('0x21')]?_[_0xd1d1('0x22')](_0x5cfab3[_0xd1d1('0x21')],function(_0x5e37f4){return{'model':db[_0x5e37f4[_0xd1d1('0x23')]],'as':_0x5e37f4['as'],'attributes':_0x5e37f4[_0xd1d1('0x1f')],'include':_0x5e37f4['include']?_['map'](_0x5e37f4[_0xd1d1('0x21')],function(_0x5b363a){return{'model':db[_0x5b363a['model']],'as':_0x5b363a['as'],'attributes':_0x5b363a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xaa76bd){logger[_0xd1d1('0x18')](_0xd1d1('0x1a'),_0x489930);logger[_0xd1d1('0x13')](_0xd1d1('0x1a'),_0x489930,JSON['stringify'](_0xaa76bd));_0x168fa5(_0xaa76bd);})[_0xd1d1('0x19')](function(_0x37b4df){logger[_0xd1d1('0x15')](_0xd1d1('0x1a'),_0x37b4df[_0xd1d1('0x17')],_0x489930);_0x193536(_0x189b71[_0xd1d1('0x15')](0x1f4,_0x37b4df[_0xd1d1('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x3fbad2){var _0x4e8a80=this;return new Promise(function(_0x317869,_0x11cbf9){return db[_0xd1d1('0x24')][_0xd1d1('0x25')](_0x3fbad2[_0xd1d1('0x26')],{'raw':_0x3fbad2[_0xd1d1('0x1d')]?_0x3fbad2[_0xd1d1('0x1d')][_0xd1d1('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x42761e){logger[_0xd1d1('0x18')](_0xd1d1('0x27'),_0x3fbad2);logger[_0xd1d1('0x13')](_0xd1d1('0x27'),_0x3fbad2,JSON[_0xd1d1('0x14')](_0x42761e));_0x317869(_0x42761e);})[_0xd1d1('0x19')](function(_0x631a5f){logger[_0xd1d1('0x15')](_0xd1d1('0x27'),_0x631a5f[_0xd1d1('0x17')],_0x3fbad2);_0x11cbf9(_0x4e8a80['error'](0x1f4,_0x631a5f[_0xd1d1('0x17')]));});});};exports[_0xd1d1('0x28')]=function(_0x5c18a6){var _0x5549a3=this;return new Promise(function(_0xfa6f5d,_0x114659){return db['VoiceQueueReport']['update'](_0x5c18a6[_0xd1d1('0x26')],{'raw':_0x5c18a6['options']?_0x5c18a6[_0xd1d1('0x1d')][_0xd1d1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c18a6[_0xd1d1('0x1d')]?_0x5c18a6[_0xd1d1('0x1d')][_0xd1d1('0x1e')]||null:null,'attributes':_0x5c18a6['options']?_0x5c18a6[_0xd1d1('0x1d')][_0xd1d1('0x1f')]||null:null,'limit':_0x5c18a6[_0xd1d1('0x1d')]?_0x5c18a6[_0xd1d1('0x1d')][_0xd1d1('0x20')]||null:null})[_0xd1d1('0x10')](function(_0x3dba24){logger[_0xd1d1('0x18')](_0xd1d1('0x28'),_0x5c18a6);logger[_0xd1d1('0x13')](_0xd1d1('0x28'),_0x5c18a6,JSON[_0xd1d1('0x14')](_0x3dba24));_0xfa6f5d(_0x3dba24);})[_0xd1d1('0x19')](function(_0x37ac19){logger[_0xd1d1('0x15')]('UpdateVoiceQueueReport',_0x37ac19[_0xd1d1('0x17')],_0x5c18a6);_0x114659(_0x5549a3[_0xd1d1('0x15')](0x1f4,_0x37ac19[_0xd1d1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 46ad4e2..bf3559f 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 _0xaab2=['remove','update','emit','register','length','voiceQueueReport:','save'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xaab2,0xca));var _0x2aab=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xaab2[_0x3bf83f];return _0x22c4a9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2aab('0x0'),_0x2aab('0x1'),_0x2aab('0x2')];function createListener(_0x564a5a,_0x149bb7){return function(_0xc770d0){_0x149bb7[_0x2aab('0x3')](_0x564a5a,_0xc770d0);};}function removeListener(_0x342fe5,_0x3d6ee0){return function(){VoiceQueueReportEvents['removeListener'](_0x342fe5,_0x3d6ee0);};}exports[_0x2aab('0x4')]=function(_0x5b35ec){for(var _0x3af395=0x0,_0x276906=events[_0x2aab('0x5')];_0x3af395<_0x276906;_0x3af395++){var _0x2970cb=events[_0x3af395];var _0x494216=createListener(_0x2aab('0x6')+_0x2970cb,_0x5b35ec);VoiceQueueReportEvents['on'](_0x2970cb,_0x494216);}}; \ No newline at end of file +var _0xfdcb=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x51a7fd,_0x1c908b){var _0x21cc99=function(_0x10ae21){while(--_0x10ae21){_0x51a7fd['push'](_0x51a7fd['shift']());}};_0x21cc99(++_0x1c908b);}(_0xfdcb,0x134));var _0xbfdc=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xfdcb[_0x4d613c];return _0x301fe3;};'use strict';var VoiceQueueReportEvents=require(_0xbfdc('0x0'));var events=[_0xbfdc('0x1'),_0xbfdc('0x2'),_0xbfdc('0x3')];function createListener(_0x298b70,_0xd38498){return function(_0x2daf5b){_0xd38498['emit'](_0x298b70,_0x2daf5b);};}function removeListener(_0x489c4d,_0x9d5126){return function(){VoiceQueueReportEvents[_0xbfdc('0x4')](_0x489c4d,_0x9d5126);};}exports[_0xbfdc('0x5')]=function(_0x499dc1){for(var _0x29b7f2=0x0,_0x875b31=events[_0xbfdc('0x6')];_0x29b7f2<_0x875b31;_0x29b7f2++){var _0x23778a=events[_0x29b7f2];var _0x165e00=createListener(_0xbfdc('0x7')+_0x23778a,_0x499dc1);VoiceQueueReportEvents['on'](_0x23778a,_0x165e00);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d50305f..09ba534 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 _0xd6b2=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0xd6b2,0x18f));var _0x2d6b=function(_0x2b7b83,_0x31b9ac){_0x2b7b83=_0x2b7b83-0x0;var _0x4320eb=_0xd6b2[_0x2b7b83];return _0x4320eb;};'use strict';var multer=require(_0x2d6b('0x0'));var util=require(_0x2d6b('0x1'));var path=require('path');var timeout=require(_0x2d6b('0x2'));var express=require('express');var router=express[_0x2d6b('0x3')]();var fs_extra=require(_0x2d6b('0x4'));var auth=require(_0x2d6b('0x5'));var interaction=require(_0x2d6b('0x6'));var config=require(_0x2d6b('0x7'));var controller=require(_0x2d6b('0x8'));router[_0x2d6b('0x9')]('/',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xb')]);router['get'](_0x2d6b('0xc'),auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xd')]);router[_0x2d6b('0xe')]('/',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0xf')]);router[_0x2d6b('0x10')](_0x2d6b('0xc'),auth[_0x2d6b('0xa')](),controller[_0x2d6b('0x11')]);router[_0x2d6b('0x12')]('/:id',auth[_0x2d6b('0xa')](),controller[_0x2d6b('0x13')]);module[_0x2d6b('0x14')]=router; \ No newline at end of file +var _0x2821=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','update'];(function(_0x2384bb,_0x39682f){var _0x299201=function(_0x22c20d){while(--_0x22c20d){_0x2384bb['push'](_0x2384bb['shift']());}};_0x299201(++_0x39682f);}(_0x2821,0xc3));var _0x1282=function(_0x539b8a,_0x5079a4){_0x539b8a=_0x539b8a-0x0;var _0x1e751e=_0x2821[_0x539b8a];return _0x1e751e;};'use strict';var multer=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var path=require(_0x1282('0x2'));var timeout=require(_0x1282('0x3'));var express=require(_0x1282('0x4'));var router=express[_0x1282('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1282('0x6'));var interaction=require(_0x1282('0x7'));var config=require('../../config/environment');var controller=require(_0x1282('0x8'));router[_0x1282('0x9')]('/',auth[_0x1282('0xa')](),controller[_0x1282('0xb')]);router[_0x1282('0x9')](_0x1282('0xc'),auth[_0x1282('0xa')](),controller['show']);router[_0x1282('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1282('0xc'),auth[_0x1282('0xa')](),controller[_0x1282('0xe')]);router['delete'](_0x1282('0xc'),auth[_0x1282('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index dba0b60..872a995 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 _0xa7be=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xa7be,0xfd));var _0xea7b=function(_0xce17c2,_0x533a30){_0xce17c2=_0xce17c2-0x0;var _0x38fb31=_0xa7be[_0xce17c2];return _0x38fb31;};'use strict';var Sequelize=require(_0xea7b('0x0'));var moment=require(_0xea7b('0x1'));module[_0xea7b('0x2')]={'time':{'type':Sequelize[_0xea7b('0x3')]},'callid':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xea7b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xea7b('0x4')],'allowNull':![],'defaultValue':moment()[_0xea7b('0x5')](_0xea7b('0x6'))}}; \ No newline at end of file +var _0x9e8a=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x9e8a,0x112));var _0xa9e8=function(_0x4c30d2,_0x1705cb){_0x4c30d2=_0x4c30d2-0x0;var _0x3764f1=_0x9e8a[_0x4c30d2];return _0x3764f1;};'use strict';var Sequelize=require(_0xa9e8('0x0'));var moment=require(_0xa9e8('0x1'));module[_0xa9e8('0x2')]={'time':{'type':Sequelize[_0xa9e8('0x3')]},'callid':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa9e8('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa9e8('0x4')],'allowNull':![],'defaultValue':moment()[_0xa9e8('0x5')](_0xa9e8('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 6c590a6..671a778 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 _0xc4f2=['create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x5e9f15,_0x268414){var _0x375a34=function(_0x141b0a){while(--_0x141b0a){_0x5e9f15['push'](_0x5e9f15['shift']());}};_0x375a34(++_0x268414);}(_0xc4f2,0x1ca));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2c4f('0x0'));var rimraf=require(_0x2c4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c4f('0x2'));var BPromise=require(_0x2c4f('0x3'));var Mustache=require(_0x2c4f('0x4'));var util=require(_0x2c4f('0x5'));var path=require(_0x2c4f('0x6'));var sox=require(_0x2c4f('0x7'));var csv=require(_0x2c4f('0x8'));var ejs=require(_0x2c4f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c4f('0xa'));var _=require(_0x2c4f('0xb'));var squel=require(_0x2c4f('0xc'));var crypto=require(_0x2c4f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2c4f('0xe'));var toCsv=require(_0x2c4f('0x8'));var querystring=require(_0x2c4f('0xf'));var Papa=require(_0x2c4f('0x10'));var Redis=require(_0x2c4f('0x11'));var authService=require(_0x2c4f('0x12'));var qs=require(_0x2c4f('0x13'));var as=require(_0x2c4f('0x14'));var hardwareService=require(_0x2c4f('0x15'));var logger=require(_0x2c4f('0x16'))(_0x2c4f('0x17'));var utils=require(_0x2c4f('0x18'));var config=require(_0x2c4f('0x19'));var licenseUtil=require(_0x2c4f('0x1a'));var db=require(_0x2c4f('0x1b'))['db'];function respondWithStatusCode(_0x1196a3,_0x124b70){_0x124b70=_0x124b70||0xcc;return function(_0x1f522e){if(_0x1f522e){return _0x1196a3['sendStatus'](_0x124b70);}return _0x1196a3[_0x2c4f('0x1c')](_0x124b70)[_0x2c4f('0x1d')]();};}function respondWithResult(_0x5c4eda,_0x55b66b){_0x55b66b=_0x55b66b||0xc8;return function(_0x1ed417){if(_0x1ed417){return _0x5c4eda[_0x2c4f('0x1c')](_0x55b66b)[_0x2c4f('0x1e')](_0x1ed417);}};}function respondWithFilteredResult(_0x551174,_0xb0216b){return function(_0x5a2012){if(_0x5a2012){var _0x5845c9=typeof _0xb0216b['offset']===_0x2c4f('0x1f')&&typeof _0xb0216b[_0x2c4f('0x20')]===_0x2c4f('0x1f');var _0x43dcb0=_0x5a2012['count'];var _0x5781d8=_0x5845c9?0x0:_0xb0216b['offset'];var _0x3f0dcc=_0x5845c9?_0x5a2012['count']:_0xb0216b['offset']+_0xb0216b[_0x2c4f('0x20')];var _0x58cc89;if(_0x3f0dcc>=_0x43dcb0){_0x3f0dcc=_0x43dcb0;_0x58cc89=0xc8;}else{_0x58cc89=0xce;}_0x551174[_0x2c4f('0x1c')](_0x58cc89);return _0x551174[_0x2c4f('0x21')](_0x2c4f('0x22'),_0x5781d8+'-'+_0x3f0dcc+'/'+_0x43dcb0)[_0x2c4f('0x1e')](_0x5a2012);}return null;};}function patchUpdates(_0x1136e2){return function(_0x35342f){try{jsonpatch[_0x2c4f('0x23')](_0x35342f,_0x1136e2,!![]);}catch(_0x3d75e7){return BPromise[_0x2c4f('0x24')](_0x3d75e7);}return _0x35342f['save']();};}function saveUpdates(_0xbfc6d7,_0x14a28c){return function(_0x392651){if(_0x392651){return _0x392651[_0x2c4f('0x25')](_0xbfc6d7)[_0x2c4f('0x26')](function(_0x48a87d){return _0x48a87d;});}return null;};}function removeEntity(_0x1ff48b,_0x913a33){return function(_0x1f4466){if(_0x1f4466){return _0x1f4466[_0x2c4f('0x27')]()[_0x2c4f('0x26')](function(){_0x1ff48b['status'](0xcc)[_0x2c4f('0x1d')]();});}};}function handleEntityNotFound(_0x5ec5bd,_0x2eb690){return function(_0x199245){if(!_0x199245){_0x5ec5bd[_0x2c4f('0x28')](0x194);}return _0x199245;};}function handleError(_0x151c49,_0x56fc37){_0x56fc37=_0x56fc37||0x1f4;return function(_0x20d084){logger[_0x2c4f('0x29')](_0x20d084['stack']);if(_0x20d084[_0x2c4f('0x2a')]){delete _0x20d084[_0x2c4f('0x2a')];}_0x151c49[_0x2c4f('0x1c')](_0x56fc37)[_0x2c4f('0x2b')](_0x20d084);};}exports['index']=function(_0x245f14,_0x47b426){var _0x4ae099={},_0x19bd72={},_0x50c54c={'count':0x0,'rows':[]};var _0x68a77e=_[_0x2c4f('0x2c')](db[_0x2c4f('0x2d')]['rawAttributes'],function(_0x455ebc){return{'name':_0x455ebc[_0x2c4f('0x2e')],'type':_0x455ebc[_0x2c4f('0x2f')][_0x2c4f('0x30')]};});_0x19bd72[_0x2c4f('0x31')]=_[_0x2c4f('0x2c')](_0x68a77e,_0x2c4f('0x2a'));_0x19bd72[_0x2c4f('0x32')]=_[_0x2c4f('0x33')](_0x245f14[_0x2c4f('0x32')]);_0x19bd72['filters']=_['intersection'](_0x19bd72[_0x2c4f('0x31')],_0x19bd72['query']);_0x4ae099[_0x2c4f('0x34')]=_[_0x2c4f('0x35')](_0x19bd72[_0x2c4f('0x31')],qs[_0x2c4f('0x36')](_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x36')]));_0x4ae099[_0x2c4f('0x34')]=_0x4ae099[_0x2c4f('0x34')][_0x2c4f('0x37')]?_0x4ae099[_0x2c4f('0x34')]:_0x19bd72[_0x2c4f('0x31')];if(!_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x38')]('nolimit')){_0x4ae099[_0x2c4f('0x20')]=qs[_0x2c4f('0x20')](_0x245f14[_0x2c4f('0x32')]['limit']);_0x4ae099['offset']=qs['offset'](_0x245f14['query']['offset']);}_0x4ae099[_0x2c4f('0x39')]=qs[_0x2c4f('0x3a')](_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3a')]);_0x4ae099['where']=qs['filters'](_[_0x2c4f('0x3b')](_0x245f14[_0x2c4f('0x32')],_0x19bd72['filters']),_0x68a77e);if(_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3c')]){_0x4ae099[_0x2c4f('0x3d')]=_['merge'](_0x4ae099[_0x2c4f('0x3d')],{'$or':_['map'](_0x68a77e,function(_0x2339d1){if(_0x2339d1[_0x2c4f('0x2f')]!==_0x2c4f('0x3e')){var _0x1810ed={};_0x1810ed[_0x2339d1['name']]={'$like':'%'+_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x3c')]+'%'};return _0x1810ed;}})});}_0x4ae099=_[_0x2c4f('0x3f')]({},_0x4ae099,_0x245f14[_0x2c4f('0x40')]);var _0xaec449={'where':_0x4ae099['where']};return db['VoiceQueuesLog'][_0x2c4f('0x41')](_0xaec449)[_0x2c4f('0x26')](function(_0x431dba){_0x50c54c[_0x2c4f('0x41')]=_0x431dba;if(_0x245f14[_0x2c4f('0x32')][_0x2c4f('0x42')]){_0x4ae099['include']=[{'all':!![]}];}return db[_0x2c4f('0x2d')][_0x2c4f('0x43')](_0x4ae099);})[_0x2c4f('0x26')](function(_0x305f31){_0x50c54c[_0x2c4f('0x44')]=_0x305f31;return _0x50c54c;})[_0x2c4f('0x26')](respondWithFilteredResult(_0x47b426,_0x4ae099))[_0x2c4f('0x45')](handleError(_0x47b426,null));};exports[_0x2c4f('0x46')]=function(_0x3c66bb,_0x180c39){var _0x2ff6f0={'raw':!![],'where':{'id':_0x3c66bb[_0x2c4f('0x47')]['id']}},_0x23b9f2={};_0x23b9f2['model']=_[_0x2c4f('0x33')](db['VoiceQueuesLog'][_0x2c4f('0x48')]);_0x23b9f2[_0x2c4f('0x32')]=_['keys'](_0x3c66bb[_0x2c4f('0x32')]);_0x23b9f2['filters']=_['intersection'](_0x23b9f2['model'],_0x23b9f2[_0x2c4f('0x32')]);_0x2ff6f0[_0x2c4f('0x34')]=_[_0x2c4f('0x35')](_0x23b9f2[_0x2c4f('0x31')],qs[_0x2c4f('0x36')](_0x3c66bb[_0x2c4f('0x32')][_0x2c4f('0x36')]));_0x2ff6f0[_0x2c4f('0x34')]=_0x2ff6f0[_0x2c4f('0x34')]['length']?_0x2ff6f0['attributes']:_0x23b9f2[_0x2c4f('0x31')];if(_0x3c66bb[_0x2c4f('0x32')][_0x2c4f('0x42')]){_0x2ff6f0['include']=[{'all':!![]}];}_0x2ff6f0=_[_0x2c4f('0x3f')]({},_0x2ff6f0,_0x3c66bb[_0x2c4f('0x40')]);return db[_0x2c4f('0x2d')][_0x2c4f('0x49')](_0x2ff6f0)[_0x2c4f('0x26')](handleEntityNotFound(_0x180c39,null))['then'](respondWithResult(_0x180c39,null))[_0x2c4f('0x45')](handleError(_0x180c39,null));};exports[_0x2c4f('0x4a')]=function(_0x4938c5,_0x34e6ca){return db['VoiceQueuesLog'][_0x2c4f('0x4a')](_0x4938c5['body'],{})[_0x2c4f('0x26')](respondWithResult(_0x34e6ca,0xc9))[_0x2c4f('0x45')](handleError(_0x34e6ca,null));};exports[_0x2c4f('0x25')]=function(_0x8641d5,_0x3bea93){if(_0x8641d5[_0x2c4f('0x4b')]['id']){delete _0x8641d5['body']['id'];}return db[_0x2c4f('0x2d')]['find']({'where':{'id':_0x8641d5['params']['id']}})['then'](handleEntityNotFound(_0x3bea93,null))[_0x2c4f('0x26')](saveUpdates(_0x8641d5['body'],null))[_0x2c4f('0x26')](respondWithResult(_0x3bea93,null))[_0x2c4f('0x45')](handleError(_0x3bea93,null));};exports[_0x2c4f('0x27')]=function(_0x4d0f66,_0x42ef3f){return db['VoiceQueuesLog'][_0x2c4f('0x49')]({'where':{'id':_0x4d0f66[_0x2c4f('0x47')]['id']}})['then'](handleEntityNotFound(_0x42ef3f,null))['then'](removeEntity(_0x42ef3f,null))[_0x2c4f('0x45')](handleError(_0x42ef3f,null));}; \ No newline at end of file +var _0xed93=['sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','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'];(function(_0xddcf63,_0x29cb69){var _0x35ea39=function(_0x53693b){while(--_0x53693b){_0xddcf63['push'](_0xddcf63['shift']());}};_0x35ea39(++_0x29cb69);}(_0xed93,0x7a));var _0x3ed9=function(_0x19185b,_0x4dfcbb){_0x19185b=_0x19185b-0x0;var _0x1ca2ab=_0xed93[_0x19185b];return _0x1ca2ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ed9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ed9('0x1'));var rp=require(_0x3ed9('0x2'));var moment=require(_0x3ed9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3ed9('0x4'));var util=require(_0x3ed9('0x5'));var path=require(_0x3ed9('0x6'));var sox=require(_0x3ed9('0x7'));var csv=require(_0x3ed9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ed9('0x9'));var _=require(_0x3ed9('0xa'));var squel=require('squel');var crypto=require(_0x3ed9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3ed9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3ed9('0xd'));var Papa=require(_0x3ed9('0xe'));var Redis=require(_0x3ed9('0xf'));var authService=require(_0x3ed9('0x10'));var qs=require(_0x3ed9('0x11'));var as=require(_0x3ed9('0x12'));var hardwareService=require(_0x3ed9('0x13'));var logger=require(_0x3ed9('0x14'))(_0x3ed9('0x15'));var utils=require(_0x3ed9('0x16'));var config=require(_0x3ed9('0x17'));var licenseUtil=require(_0x3ed9('0x18'));var db=require(_0x3ed9('0x19'))['db'];function respondWithStatusCode(_0x215934,_0x2a2cdb){_0x2a2cdb=_0x2a2cdb||0xcc;return function(_0x141cf4){if(_0x141cf4){return _0x215934[_0x3ed9('0x1a')](_0x2a2cdb);}return _0x215934[_0x3ed9('0x1b')](_0x2a2cdb)[_0x3ed9('0x1c')]();};}function respondWithResult(_0x383c14,_0x23a700){_0x23a700=_0x23a700||0xc8;return function(_0x49aaf0){if(_0x49aaf0){return _0x383c14['status'](_0x23a700)[_0x3ed9('0x1d')](_0x49aaf0);}};}function respondWithFilteredResult(_0x3935df,_0x3a2609){return function(_0x4e81a4){if(_0x4e81a4){var _0x31b351=typeof _0x3a2609['offset']===_0x3ed9('0x1e')&&typeof _0x3a2609[_0x3ed9('0x1f')]===_0x3ed9('0x1e');var _0x377694=_0x4e81a4[_0x3ed9('0x20')];var _0x3f1099=_0x31b351?0x0:_0x3a2609[_0x3ed9('0x21')];var _0x25532a=_0x31b351?_0x4e81a4[_0x3ed9('0x20')]:_0x3a2609[_0x3ed9('0x21')]+_0x3a2609['limit'];var _0x480dac;if(_0x25532a>=_0x377694){_0x25532a=_0x377694;_0x480dac=0xc8;}else{_0x480dac=0xce;}_0x3935df[_0x3ed9('0x1b')](_0x480dac);return _0x3935df['set'](_0x3ed9('0x22'),_0x3f1099+'-'+_0x25532a+'/'+_0x377694)['json'](_0x4e81a4);}return null;};}function patchUpdates(_0x122b1f){return function(_0x25161e){try{jsonpatch['apply'](_0x25161e,_0x122b1f,!![]);}catch(_0x7bcd80){return BPromise['reject'](_0x7bcd80);}return _0x25161e[_0x3ed9('0x23')]();};}function saveUpdates(_0x435b97,_0x44485d){return function(_0x2fe308){if(_0x2fe308){return _0x2fe308['update'](_0x435b97)['then'](function(_0xe59807){return _0xe59807;});}return null;};}function removeEntity(_0x3d7932,_0x49f04c){return function(_0x1f36d){if(_0x1f36d){return _0x1f36d['destroy']()[_0x3ed9('0x24')](function(){_0x3d7932[_0x3ed9('0x1b')](0xcc)[_0x3ed9('0x1c')]();});}};}function handleEntityNotFound(_0x4c34ba,_0xaca990){return function(_0x238b84){if(!_0x238b84){_0x4c34ba[_0x3ed9('0x1a')](0x194);}return _0x238b84;};}function handleError(_0x23fc38,_0x58a11c){_0x58a11c=_0x58a11c||0x1f4;return function(_0x5403aa){logger[_0x3ed9('0x25')](_0x5403aa[_0x3ed9('0x26')]);if(_0x5403aa[_0x3ed9('0x27')]){delete _0x5403aa[_0x3ed9('0x27')];}_0x23fc38[_0x3ed9('0x1b')](_0x58a11c)[_0x3ed9('0x28')](_0x5403aa);};}exports[_0x3ed9('0x29')]=function(_0xf242b5,_0xef4742){var _0x4392a4={},_0x3d623b={},_0x383c36={'count':0x0,'rows':[]};var _0x122045=_[_0x3ed9('0x2a')](db[_0x3ed9('0x2b')][_0x3ed9('0x2c')],function(_0x317607){return{'name':_0x317607[_0x3ed9('0x2d')],'type':_0x317607[_0x3ed9('0x2e')]['key']};});_0x3d623b[_0x3ed9('0x2f')]=_['map'](_0x122045,_0x3ed9('0x27'));_0x3d623b[_0x3ed9('0x30')]=_[_0x3ed9('0x31')](_0xf242b5['query']);_0x3d623b[_0x3ed9('0x32')]=_[_0x3ed9('0x33')](_0x3d623b[_0x3ed9('0x2f')],_0x3d623b['query']);_0x4392a4[_0x3ed9('0x34')]=_[_0x3ed9('0x33')](_0x3d623b[_0x3ed9('0x2f')],qs[_0x3ed9('0x35')](_0xf242b5[_0x3ed9('0x30')][_0x3ed9('0x35')]));_0x4392a4[_0x3ed9('0x34')]=_0x4392a4[_0x3ed9('0x34')][_0x3ed9('0x36')]?_0x4392a4[_0x3ed9('0x34')]:_0x3d623b['model'];if(!_0xf242b5['query']['hasOwnProperty']('nolimit')){_0x4392a4[_0x3ed9('0x1f')]=qs['limit'](_0xf242b5[_0x3ed9('0x30')][_0x3ed9('0x1f')]);_0x4392a4[_0x3ed9('0x21')]=qs[_0x3ed9('0x21')](_0xf242b5[_0x3ed9('0x30')][_0x3ed9('0x21')]);}_0x4392a4['order']=qs[_0x3ed9('0x37')](_0xf242b5[_0x3ed9('0x30')][_0x3ed9('0x37')]);_0x4392a4[_0x3ed9('0x38')]=qs[_0x3ed9('0x32')](_[_0x3ed9('0x39')](_0xf242b5[_0x3ed9('0x30')],_0x3d623b['filters']),_0x122045);if(_0xf242b5['query'][_0x3ed9('0x3a')]){_0x4392a4[_0x3ed9('0x38')]=_[_0x3ed9('0x3b')](_0x4392a4[_0x3ed9('0x38')],{'$or':_[_0x3ed9('0x2a')](_0x122045,function(_0xa89212){if(_0xa89212[_0x3ed9('0x2e')]!==_0x3ed9('0x3c')){var _0x3d00da={};_0x3d00da[_0xa89212[_0x3ed9('0x27')]]={'$like':'%'+_0xf242b5['query'][_0x3ed9('0x3a')]+'%'};return _0x3d00da;}})});}_0x4392a4=_[_0x3ed9('0x3b')]({},_0x4392a4,_0xf242b5[_0x3ed9('0x3d')]);var _0x1192f0={'where':_0x4392a4[_0x3ed9('0x38')]};return db[_0x3ed9('0x2b')][_0x3ed9('0x20')](_0x1192f0)[_0x3ed9('0x24')](function(_0x50d595){_0x383c36[_0x3ed9('0x20')]=_0x50d595;if(_0xf242b5[_0x3ed9('0x30')][_0x3ed9('0x3e')]){_0x4392a4[_0x3ed9('0x3f')]=[{'all':!![]}];}return db[_0x3ed9('0x2b')][_0x3ed9('0x40')](_0x4392a4);})[_0x3ed9('0x24')](function(_0x343016){_0x383c36[_0x3ed9('0x41')]=_0x343016;return _0x383c36;})[_0x3ed9('0x24')](respondWithFilteredResult(_0xef4742,_0x4392a4))[_0x3ed9('0x42')](handleError(_0xef4742,null));};exports[_0x3ed9('0x43')]=function(_0x3e3e01,_0x68801c){var _0x4406c5={'raw':!![],'where':{'id':_0x3e3e01[_0x3ed9('0x44')]['id']}},_0x3abfdd={};_0x3abfdd[_0x3ed9('0x2f')]=_[_0x3ed9('0x31')](db[_0x3ed9('0x2b')][_0x3ed9('0x2c')]);_0x3abfdd['query']=_[_0x3ed9('0x31')](_0x3e3e01['query']);_0x3abfdd[_0x3ed9('0x32')]=_[_0x3ed9('0x33')](_0x3abfdd[_0x3ed9('0x2f')],_0x3abfdd[_0x3ed9('0x30')]);_0x4406c5[_0x3ed9('0x34')]=_[_0x3ed9('0x33')](_0x3abfdd[_0x3ed9('0x2f')],qs[_0x3ed9('0x35')](_0x3e3e01[_0x3ed9('0x30')][_0x3ed9('0x35')]));_0x4406c5[_0x3ed9('0x34')]=_0x4406c5['attributes'][_0x3ed9('0x36')]?_0x4406c5[_0x3ed9('0x34')]:_0x3abfdd[_0x3ed9('0x2f')];if(_0x3e3e01[_0x3ed9('0x30')]['includeAll']){_0x4406c5[_0x3ed9('0x3f')]=[{'all':!![]}];}_0x4406c5=_[_0x3ed9('0x3b')]({},_0x4406c5,_0x3e3e01[_0x3ed9('0x3d')]);return db[_0x3ed9('0x2b')][_0x3ed9('0x45')](_0x4406c5)[_0x3ed9('0x24')](handleEntityNotFound(_0x68801c,null))[_0x3ed9('0x24')](respondWithResult(_0x68801c,null))[_0x3ed9('0x42')](handleError(_0x68801c,null));};exports['create']=function(_0x1237a9,_0x366682){return db[_0x3ed9('0x2b')][_0x3ed9('0x46')](_0x1237a9[_0x3ed9('0x47')],{})[_0x3ed9('0x24')](respondWithResult(_0x366682,0xc9))[_0x3ed9('0x42')](handleError(_0x366682,null));};exports[_0x3ed9('0x48')]=function(_0x425dd2,_0x29ed7b){if(_0x425dd2[_0x3ed9('0x47')]['id']){delete _0x425dd2[_0x3ed9('0x47')]['id'];}return db[_0x3ed9('0x2b')]['find']({'where':{'id':_0x425dd2[_0x3ed9('0x44')]['id']}})[_0x3ed9('0x24')](handleEntityNotFound(_0x29ed7b,null))['then'](saveUpdates(_0x425dd2[_0x3ed9('0x47')],null))[_0x3ed9('0x24')](respondWithResult(_0x29ed7b,null))['catch'](handleError(_0x29ed7b,null));};exports[_0x3ed9('0x49')]=function(_0x3efb72,_0x4f8739){return db['VoiceQueuesLog'][_0x3ed9('0x45')]({'where':{'id':_0x3efb72[_0x3ed9('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f8739,null))[_0x3ed9('0x24')](removeEntity(_0x4f8739,null))['catch'](handleError(_0x4f8739,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4e2f102..daa998b 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 _0x8bfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','dtm','util','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8bfc,0x9a));var _0xc8bf=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x8bfc[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require('lodash');var util=require(_0xc8bf('0x0'));var logger=require(_0xc8bf('0x1'))('api');var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rp=require(_0xc8bf('0x4'));var fs=require('fs');var path=require(_0xc8bf('0x5'));var rimraf=require(_0xc8bf('0x6'));var config=require(_0xc8bf('0x7'));var attributes=require(_0xc8bf('0x8'));module[_0xc8bf('0x9')]=function(_0x464070,_0x4066a6){return _0x464070['define'](_0xc8bf('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc8bf('0xb'),'fields':['event',_0xc8bf('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8d4c=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','event','dtm','lodash'];(function(_0x2f354a,_0x56d981){var _0x4cc3e9=function(_0x16e72a){while(--_0x16e72a){_0x2f354a['push'](_0x2f354a['shift']());}};_0x4cc3e9(++_0x56d981);}(_0x8d4c,0x133));var _0xc8d4=function(_0x27c7b2,_0x3c8adc){_0x27c7b2=_0x27c7b2-0x0;var _0x33829e=_0x8d4c[_0x27c7b2];return _0x33829e;};'use strict';var _=require(_0xc8d4('0x0'));var util=require(_0xc8d4('0x1'));var logger=require(_0xc8d4('0x2'))(_0xc8d4('0x3'));var moment=require('moment');var BPromise=require(_0xc8d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8d4('0x5'));var rimraf=require(_0xc8d4('0x6'));var config=require(_0xc8d4('0x7'));var attributes=require(_0xc8d4('0x8'));module[_0xc8d4('0x9')]=function(_0x46e961,_0x3f9ee2){return _0x46e961['define'](_0xc8d4('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc8d4('0xb'),'fields':[_0xc8d4('0xc'),_0xc8d4('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 3633caa..bd9a7e4 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 _0xbc47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x50413a,_0x4c941e){var _0x2aa877=function(_0x486c64){while(--_0x486c64){_0x50413a['push'](_0x50413a['shift']());}};_0x2aa877(++_0x4c941e);}(_0xbc47,0x7a));var _0x7bc4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7bc4('0x0'));var util=require(_0x7bc4('0x1'));var moment=require(_0x7bc4('0x2'));var BPromise=require(_0x7bc4('0x3'));var rs=require(_0x7bc4('0x4'));var fs=require('fs');var Redis=require(_0x7bc4('0x5'));var db=require(_0x7bc4('0x6'))['db'];var utils=require(_0x7bc4('0x7'));var logger=require(_0x7bc4('0x8'))(_0x7bc4('0x9'));var config=require(_0x7bc4('0xa'));var jayson=require(_0x7bc4('0xb'));var client=jayson[_0x7bc4('0xc')][_0x7bc4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44b112,_0xef6235,_0x2245e6){return new BPromise(function(_0x591cd8,_0x32e819){return client[_0x7bc4('0xe')](_0x44b112,_0x2245e6)[_0x7bc4('0xf')](function(_0x5bfcf6){logger[_0x7bc4('0x10')](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));logger[_0x7bc4('0x13')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xef6235,_0x7bc4('0x12'),JSON[_0x7bc4('0x14')](_0x5bfcf6));if(_0x5bfcf6[_0x7bc4('0x15')]){if(_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x16')]===0x1f4){logger[_0x7bc4('0x15')](_0x7bc4('0x11'),_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x32e819(_0x5bfcf6[_0x7bc4('0x15')]['message']);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xef6235,_0x5bfcf6[_0x7bc4('0x15')][_0x7bc4('0x17')]);return _0x591cd8(_0x5bfcf6['error'][_0x7bc4('0x17')]);}else{logger['info'](_0x7bc4('0x11'),_0xef6235,_0x7bc4('0x12'));_0x591cd8(_0x5bfcf6['result'][_0x7bc4('0x17')]);}})[_0x7bc4('0x18')](function(_0x8b66c6){logger[_0x7bc4('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0xef6235,_0x8b66c6);_0x32e819(_0x8b66c6);});});} \ No newline at end of file +var _0x5d6c=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x593980,_0x3a3d3a){var _0x1872ad=function(_0x5c1ce3){while(--_0x5c1ce3){_0x593980['push'](_0x593980['shift']());}};_0x1872ad(++_0x3a3d3a);}(_0x5d6c,0x100));var _0xc5d6=function(_0x18536f,_0x2e0eda){_0x18536f=_0x18536f-0x0;var _0x352024=_0x5d6c[_0x18536f];return _0x352024;};'use strict';var _=require(_0xc5d6('0x0'));var util=require('util');var moment=require(_0xc5d6('0x1'));var BPromise=require(_0xc5d6('0x2'));var rs=require(_0xc5d6('0x3'));var fs=require('fs');var Redis=require(_0xc5d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5d6('0x5'));var logger=require(_0xc5d6('0x6'))(_0xc5d6('0x7'));var config=require(_0xc5d6('0x8'));var jayson=require(_0xc5d6('0x9'));var client=jayson[_0xc5d6('0xa')][_0xc5d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41bf4c,_0x3a742e,_0x254372){return new BPromise(function(_0x56d086,_0x3f6c3f){return client[_0xc5d6('0xc')](_0x41bf4c,_0x254372)[_0xc5d6('0xd')](function(_0x5e6e42){logger[_0xc5d6('0xe')](_0xc5d6('0xf'),_0x3a742e,_0xc5d6('0x10'));logger[_0xc5d6('0x11')](_0xc5d6('0x12'),_0x3a742e,'request\x20sent',JSON[_0xc5d6('0x13')](_0x5e6e42));if(_0x5e6e42[_0xc5d6('0x14')]){if(_0x5e6e42[_0xc5d6('0x14')][_0xc5d6('0x15')]===0x1f4){logger[_0xc5d6('0x14')](_0xc5d6('0xf'),_0x3a742e,_0x5e6e42[_0xc5d6('0x14')]['message']);return _0x3f6c3f(_0x5e6e42[_0xc5d6('0x14')]['message']);}logger['error'](_0xc5d6('0xf'),_0x3a742e,_0x5e6e42[_0xc5d6('0x14')][_0xc5d6('0x16')]);return _0x56d086(_0x5e6e42['error'][_0xc5d6('0x16')]);}else{logger[_0xc5d6('0xe')](_0xc5d6('0xf'),_0x3a742e,_0xc5d6('0x10'));_0x56d086(_0x5e6e42[_0xc5d6('0x17')][_0xc5d6('0x16')]);}})[_0xc5d6('0x18')](function(_0x40b2a1){logger[_0xc5d6('0x14')](_0xc5d6('0xf'),_0x3a742e,_0x40b2a1);_0x3f6c3f(_0x40b2a1);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c75cd56..a422871 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 _0x6c9a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','delete','exports','multer','path'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x6c9a,0x8f));var _0xa6c9=function(_0x38471f,_0x31fa53){_0x38471f=_0x38471f-0x0;var _0x396ea4=_0x6c9a[_0x38471f];return _0x396ea4;};'use strict';var multer=require(_0xa6c9('0x0'));var util=require('util');var path=require(_0xa6c9('0x1'));var timeout=require(_0xa6c9('0x2'));var express=require(_0xa6c9('0x3'));var router=express[_0xa6c9('0x4')]();var fs_extra=require(_0xa6c9('0x5'));var auth=require(_0xa6c9('0x6'));var interaction=require(_0xa6c9('0x7'));var config=require(_0xa6c9('0x8'));var controller=require(_0xa6c9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa6c9('0xa')]);router[_0xa6c9('0xb')](_0xa6c9('0xc'),auth['isAuthenticated'](),controller[_0xa6c9('0xd')]);router[_0xa6c9('0xb')](_0xa6c9('0xe'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x10')]);router[_0xa6c9('0xb')](_0xa6c9('0x11'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x12')]);router[_0xa6c9('0xb')](_0xa6c9('0x13'),controller[_0xa6c9('0x14')]);router['get'](_0xa6c9('0x15'),auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x16')]);router[_0xa6c9('0x17')]('/',auth[_0xa6c9('0xf')](),controller[_0xa6c9('0x18')]);router['post'](_0xa6c9('0x15'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xa6c9('0x19')](_0xa6c9('0xe'),auth['isAuthenticated'](),controller[_0xa6c9('0x1a')]);router[_0xa6c9('0x1b')]('/:id',auth[_0xa6c9('0xf')](),controller['destroy']);module[_0xa6c9('0x1c')]=router; \ No newline at end of file +var _0x0424=['update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','create','post','runTranscribe','put'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x0424,0x16f));var _0x4042=function(_0x995f33,_0x17fdce){_0x995f33=_0x995f33-0x0;var _0x587aec=_0x0424[_0x995f33];return _0x587aec;};'use strict';var multer=require(_0x4042('0x0'));var util=require(_0x4042('0x1'));var path=require(_0x4042('0x2'));var timeout=require('connect-timeout');var express=require(_0x4042('0x3'));var router=express['Router']();var fs_extra=require(_0x4042('0x4'));var auth=require(_0x4042('0x5'));var interaction=require(_0x4042('0x6'));var config=require(_0x4042('0x7'));var controller=require(_0x4042('0x8'));router[_0x4042('0x9')]('/',auth[_0x4042('0xa')](),controller[_0x4042('0xb')]);router[_0x4042('0x9')]('/describe',auth[_0x4042('0xa')](),controller[_0x4042('0xc')]);router[_0x4042('0x9')](_0x4042('0xd'),auth[_0x4042('0xa')](),controller[_0x4042('0xe')]);router[_0x4042('0x9')](_0x4042('0xf'),auth[_0x4042('0xa')](),controller[_0x4042('0x10')]);router[_0x4042('0x9')]('/:id/downloads',controller[_0x4042('0x11')]);router[_0x4042('0x9')](_0x4042('0x12'),auth[_0x4042('0xa')](),controller['downloadTranscribe']);router['post']('/',auth[_0x4042('0xa')](),controller[_0x4042('0x13')]);router[_0x4042('0x14')]('/:id/transcribe',auth[_0x4042('0xa')](),controller[_0x4042('0x15')]);router[_0x4042('0x16')](_0x4042('0xd'),auth[_0x4042('0xa')](),controller[_0x4042('0x17')]);router[_0x4042('0x18')](_0x4042('0xd'),auth[_0x4042('0xa')](),controller[_0x4042('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 51c9195..d1136bb 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(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 ae7946f..2926303 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 _0x3227=['sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','eml-format','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','update','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','VoiceRecording\x20not\x20found','download','filename','extname','unlink','send','MD5','sequelize','col','token','$and','push','decryptFile','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3227,0xaa));var _0x7322=function(_0x8ede90,_0x76300c){_0x8ede90=_0x8ede90-0x0;var _0x367160=_0x3227[_0x8ede90];return _0x367160;};'use strict';var emlformat=require(_0x7322('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7322('0x1'));var rp=require('request-promise');var moment=require(_0x7322('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7322('0x3'));var path=require(_0x7322('0x4'));var sox=require('sox');var csv=require(_0x7322('0x5'));var ejs=require(_0x7322('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7322('0x7'));var squel=require(_0x7322('0x8'));var crypto=require(_0x7322('0x9'));var jsforce=require(_0x7322('0xa'));var deskjs=require(_0x7322('0xb'));var toCsv=require(_0x7322('0x5'));var querystring=require(_0x7322('0xc'));var Papa=require(_0x7322('0xd'));var AWS=require(_0x7322('0xe'));var uuidv4=require(_0x7322('0xf'));var Redis=require('ioredis');var authService=require(_0x7322('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7322('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7322('0x12'));var utils=require(_0x7322('0x13'));var config=require(_0x7322('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7322('0x15'))['db'];function respondWithStatusCode(_0x8ee44e,_0x704621){_0x704621=_0x704621||0xcc;return function(_0x58f828){if(_0x58f828){return _0x8ee44e[_0x7322('0x16')](_0x704621);}return _0x8ee44e[_0x7322('0x17')](_0x704621)[_0x7322('0x18')]();};}function respondWithResult(_0x27669f,_0x1810f2){_0x1810f2=_0x1810f2||0xc8;return function(_0x14498f){if(_0x14498f){return _0x27669f[_0x7322('0x17')](_0x1810f2)[_0x7322('0x19')](_0x14498f);}};}function respondWithFilteredResult(_0x3bbf30,_0x49084e){return function(_0x9db9c9){if(_0x9db9c9){var _0xefae28=typeof _0x49084e[_0x7322('0x1a')]===_0x7322('0x1b')&&typeof _0x49084e['limit']===_0x7322('0x1b');var _0x2a190d=_0x9db9c9[_0x7322('0x1c')];var _0x2b5fb7=_0xefae28?0x0:_0x49084e[_0x7322('0x1a')];var _0x5af4c1=_0xefae28?_0x9db9c9[_0x7322('0x1c')]:_0x49084e[_0x7322('0x1a')]+_0x49084e[_0x7322('0x1d')];var _0xad204d;if(_0x5af4c1>=_0x2a190d){_0x5af4c1=_0x2a190d;_0xad204d=0xc8;}else{_0xad204d=0xce;}_0x3bbf30[_0x7322('0x17')](_0xad204d);return _0x3bbf30[_0x7322('0x1e')](_0x7322('0x1f'),_0x2b5fb7+'-'+_0x5af4c1+'/'+_0x2a190d)[_0x7322('0x19')](_0x9db9c9);}return null;};}function patchUpdates(_0x260d84){return function(_0x3f2d40){try{jsonpatch[_0x7322('0x20')](_0x3f2d40,_0x260d84,!![]);}catch(_0x5c0aa8){return BPromise[_0x7322('0x21')](_0x5c0aa8);}return _0x3f2d40[_0x7322('0x22')]();};}function saveUpdates(_0x32151f,_0x423157){return function(_0x15c058){if(_0x15c058){return _0x15c058['update'](_0x32151f)[_0x7322('0x23')](function(_0xc781c7){return _0xc781c7;});}return null;};}function removeEntity(_0x11b387,_0x513481){return function(_0x49542c){if(_0x49542c){return _0x49542c['destroy']()['then'](function(){_0x11b387[_0x7322('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6d309f,_0x1eb0e5){return function(_0x164eb5){if(!_0x164eb5){_0x6d309f[_0x7322('0x16')](0x194);}return _0x164eb5;};}function handleError(_0x28baed,_0x12298b){_0x12298b=_0x12298b||0x1f4;return function(_0x2ff3be){logger[_0x7322('0x24')](_0x2ff3be[_0x7322('0x25')]);if(_0x2ff3be[_0x7322('0x26')]){delete _0x2ff3be[_0x7322('0x26')];}_0x28baed['status'](_0x12298b)['send'](_0x2ff3be);};}exports[_0x7322('0x27')]=function(_0x4d47ba,_0x2ef271){var _0x545eb4={},_0xfa2421={},_0x2412d1={'count':0x0,'rows':[]};var _0xb4d3c2=_[_0x7322('0x28')](db[_0x7322('0x29')]['rawAttributes'],function(_0x580b58){return{'name':_0x580b58[_0x7322('0x2a')],'type':_0x580b58[_0x7322('0x2b')][_0x7322('0x2c')]};});_0xfa2421[_0x7322('0x2d')]=_[_0x7322('0x2e')](_[_0x7322('0x28')](_0xb4d3c2,_0x7322('0x26')),[_0x7322('0x2f')]);_0xfa2421[_0x7322('0x30')]=_['keys'](_0x4d47ba[_0x7322('0x30')]);_0xfa2421[_0x7322('0x31')]=_[_0x7322('0x32')](_0xfa2421[_0x7322('0x2d')],_0xfa2421[_0x7322('0x30')]);_0x545eb4[_0x7322('0x33')]=_[_0x7322('0x32')](_0xfa2421[_0x7322('0x2d')],qs['fields'](_0x4d47ba[_0x7322('0x30')][_0x7322('0x34')]));_0x545eb4['attributes']=_0x545eb4['attributes'][_0x7322('0x35')]?_0x545eb4['attributes']:_0xfa2421[_0x7322('0x2d')];if(!_0x4d47ba[_0x7322('0x30')]['hasOwnProperty'](_0x7322('0x36'))){_0x545eb4[_0x7322('0x1d')]=qs[_0x7322('0x1d')](_0x4d47ba[_0x7322('0x30')][_0x7322('0x1d')]);_0x545eb4['offset']=qs[_0x7322('0x1a')](_0x4d47ba['query'][_0x7322('0x1a')]);}_0x545eb4['order']=qs['sort'](_0x4d47ba[_0x7322('0x30')][_0x7322('0x37')]);_0x545eb4['where']=qs[_0x7322('0x31')](_[_0x7322('0x38')](_0x4d47ba[_0x7322('0x30')],_0xfa2421[_0x7322('0x31')]),_0xb4d3c2);if(_0x4d47ba[_0x7322('0x30')][_0x7322('0x39')]){_0x545eb4[_0x7322('0x3a')]=_[_0x7322('0x3b')](_0x545eb4[_0x7322('0x3a')],{'$or':_[_0x7322('0x28')](_0xb4d3c2,function(_0x1533db){if(_0x1533db['type']!==_0x7322('0x3c')){var _0x5cb3d8={};_0x5cb3d8[_0x1533db['name']]={'$like':'%'+_0x4d47ba[_0x7322('0x30')][_0x7322('0x39')]+'%'};return _0x5cb3d8;}})});}_0x545eb4=_[_0x7322('0x3b')]({},_0x545eb4,_0x4d47ba[_0x7322('0x3d')]);var _0x360435={'where':_0x545eb4[_0x7322('0x3a')]};return db['VoiceRecording'][_0x7322('0x1c')](_0x360435)[_0x7322('0x23')](function(_0xcba07){_0x2412d1['count']=_0xcba07;if(_0x4d47ba[_0x7322('0x30')][_0x7322('0x3e')]){_0x545eb4[_0x7322('0x3f')]=[{'all':!![]}];}return db[_0x7322('0x29')][_0x7322('0x40')](_0x545eb4);})[_0x7322('0x23')](function(_0x592465){_0x2412d1[_0x7322('0x41')]=_0x592465;return _0x2412d1;})[_0x7322('0x23')](respondWithFilteredResult(_0x2ef271,_0x545eb4))[_0x7322('0x42')](handleError(_0x2ef271,null));};exports['show']=function(_0x579c34,_0x11bc29){var _0x3948a3={'raw':![],'where':{'id':_0x579c34[_0x7322('0x43')]['id']}},_0x569248={};_0x569248[_0x7322('0x2d')]=_[_0x7322('0x44')](db[_0x7322('0x29')]['rawAttributes']);_0x569248[_0x7322('0x30')]=_[_0x7322('0x44')](_0x579c34[_0x7322('0x30')]);_0x569248[_0x7322('0x31')]=_[_0x7322('0x32')](_0x569248[_0x7322('0x2d')],_0x569248[_0x7322('0x30')]);_0x3948a3[_0x7322('0x33')]=_[_0x7322('0x32')](_0x569248[_0x7322('0x2d')],qs[_0x7322('0x34')](_0x579c34['query'][_0x7322('0x34')]));_0x3948a3['attributes']=_0x3948a3[_0x7322('0x33')][_0x7322('0x35')]?_0x3948a3[_0x7322('0x33')]:_0x569248[_0x7322('0x2d')];if(_0x579c34[_0x7322('0x30')][_0x7322('0x3e')]){_0x3948a3[_0x7322('0x3f')]=[{'all':!![]}];}_0x3948a3=_[_0x7322('0x3b')]({},_0x3948a3,_0x579c34[_0x7322('0x3d')]);return db['VoiceRecording']['find'](_0x3948a3)[_0x7322('0x23')](handleEntityNotFound(_0x11bc29,null))['then'](respondWithResult(_0x11bc29,null))[_0x7322('0x42')](handleError(_0x11bc29,null));};exports['create']=function(_0xc2aac,_0x41e2f2){return db['VoiceRecording'][_0x7322('0x45')](_0xc2aac[_0x7322('0x46')],{})['then'](respondWithResult(_0x41e2f2,0xc9))[_0x7322('0x42')](handleError(_0x41e2f2,null));};exports[_0x7322('0x47')]=function(_0x5751f3,_0x24e7dd){if(_0x5751f3['body']['id']){delete _0x5751f3[_0x7322('0x46')]['id'];}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':{'id':_0x5751f3[_0x7322('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e7dd,null))[_0x7322('0x23')](saveUpdates(_0x5751f3[_0x7322('0x46')],null))[_0x7322('0x23')](respondWithResult(_0x24e7dd,null))[_0x7322('0x42')](handleError(_0x24e7dd,null));};exports[_0x7322('0x49')]=function(_0x164444,_0x5a1a5a){return db[_0x7322('0x29')][_0x7322('0x49')]()[_0x7322('0x23')](respondWithResult(_0x5a1a5a,null))['catch'](handleError(_0x5a1a5a,null));};exports['download']=function(_0x16b75c,_0x1df730,_0x4de2f3){var _0x33c993=require(_0x7322('0x4a'));var _0x46903d=![];var _0x35639d={};if(_0x16b75c[_0x7322('0x30')]['type']&&_0x16b75c[_0x7322('0x30')][_0x7322('0x2b')]===_0x7322('0x4b')){_0x35639d[_0x7322('0x4b')]=_0x16b75c[_0x7322('0x43')]['id'];}else{_0x35639d['id']=_0x16b75c[_0x7322('0x43')]['id'];}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':_0x35639d,'attributes':['id',_0x7322('0x4c')],'raw':!![]})[_0x7322('0x23')](handleEntityNotFound(_0x1df730,null))[_0x7322('0x23')](function(_0x4b7385){if(_0x4b7385){var _0x3ce5a9=_0x4b7385[_0x7322('0x4c')];var _0x4d9713=util[_0x7322('0x2f')](_0x7322('0x4d'),_0x3ce5a9);if(fs[_0x7322('0x4e')](_0x4d9713)){_0x46903d=!![];return _0x33c993['decryptFile'](_0x4d9713,_0x3ce5a9,config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0x4b7385;});}return _0x4b7385;}})[_0x7322('0x23')](function(_0x4e9a8d){if(_0x4e9a8d){var _0x355160=_0x4e9a8d[_0x7322('0x4c')];if(!fs[_0x7322('0x4e')](_0x355160)){throw new db[(_0x7322('0x50'))]['ValidationError'](_0x7322('0x51'));}if(_0x4e9a8d['filename']){return _0x1df730[_0x7322('0x52')](_0x355160,_0x4e9a8d[_0x7322('0x53')]+path[_0x7322('0x54')](_0x355160),function(){if(_0x46903d){fs[_0x7322('0x55')](_0x355160);}});}else{return _0x1df730['download'](_0x355160,function(_0x12336a){if(_0x46903d){fs[_0x7322('0x55')](_0x355160);}});}}})[_0x7322('0x42')](function(_0x5233d0){if(_0x5233d0['message']===_0x7322('0x51')){_0x1df730[_0x7322('0x17')](0x194)[_0x7322('0x56')]('Not\x20found');}else{return handleError(_0x1df730,null);}});};exports['downloads']=function(_0x3e0c62,_0x5289c5,_0x2131f8){var _0x23d129=require(_0x7322('0x4a'));var _0x385e64=![];var _0x250e0c={'$and':[db['sequelize']['where'](db['sequelize']['fn'](_0x7322('0x57'),db[_0x7322('0x58')][_0x7322('0x59')]('uniqueid')),_0x3e0c62[_0x7322('0x30')][_0x7322('0x5a')])]};if(_0x3e0c62[_0x7322('0x30')][_0x7322('0x2b')]&&_0x3e0c62[_0x7322('0x30')]['type']===_0x7322('0x4b')){_0x250e0c[_0x7322('0x5b')][_0x7322('0x5c')]({'uniqueid':_0x3e0c62[_0x7322('0x43')]['id']});}else{_0x250e0c[_0x7322('0x5b')][_0x7322('0x5c')]({'id':_0x3e0c62[_0x7322('0x43')]['id']});}return db[_0x7322('0x29')][_0x7322('0x48')]({'where':_0x250e0c,'attributes':['id',_0x7322('0x4c')],'raw':!![]})[_0x7322('0x23')](handleEntityNotFound(_0x5289c5,null))[_0x7322('0x23')](function(_0x378229){if(_0x378229){var _0x4ed786=util[_0x7322('0x2f')](_0x7322('0x4d'),_0x378229[_0x7322('0x4c')]);if(fs['existsSync'](_0x4ed786)){_0x385e64=!![];return _0x23d129[_0x7322('0x5d')](_0x4ed786,_0x378229['value'],config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0x378229;});}return _0x378229;}})[_0x7322('0x23')](function(_0x1a3394){if(_0x1a3394){if(!fs[_0x7322('0x4e')](_0x1a3394[_0x7322('0x4c')])){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))](_0x7322('0x51'));}if(_0x1a3394[_0x7322('0x53')]){return _0x5289c5[_0x7322('0x52')](_0x1a3394[_0x7322('0x4c')],_0x1a3394['filename']+path[_0x7322('0x54')](_0x1a3394[_0x7322('0x4c')]),function(){if(_0x385e64){fs[_0x7322('0x55')](_0x1a3394[_0x7322('0x4c')]);}});}else{return _0x5289c5[_0x7322('0x52')](_0x1a3394[_0x7322('0x4c')],function(_0x26d51a){if(_0x385e64){fs[_0x7322('0x55')](_0x1a3394[_0x7322('0x4c')]);}});}}})[_0x7322('0x42')](handleError(_0x5289c5,null));};exports['destroy']=function(_0x5526aa,_0x59ecbe){return db[_0x7322('0x29')][_0x7322('0x48')]({'where':{'id':_0x5526aa[_0x7322('0x43')]['id']}})[_0x7322('0x23')](function(_0x5abdc8){if(_[_0x7322('0x5f')](_0x5abdc8)){throw new ReferenceError(_0x7322('0x60'));}return _0x5abdc8;})['then'](function(_0x6b0df){var _0x1862df=_0x6b0df[_0x7322('0x4c')];logger[_0x7322('0x61')](_0x7322('0x62'),_0x1862df);if(!_[_0x7322('0x5f')](_0x6b0df['value'])&&fs[_0x7322('0x4e')](_0x1862df)){logger[_0x7322('0x61')]('File:\x20\x22'+_0x1862df+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7322('0x63')](_0x1862df);}_0x1862df=_0x1862df+_0x7322('0x64');if(!_['isNil'](_0x6b0df[_0x7322('0x4c')])&&fs['existsSync'](_0x1862df)){logger[_0x7322('0x61')](_0x7322('0x65')+_0x1862df+_0x7322('0x66'));fs['unlinkSync'](_0x1862df);}return _0x6b0df;})[_0x7322('0x23')](function(_0x14a1cc){if(!_0x14a1cc)throw new InternalError();return _0x14a1cc[_0x7322('0x67')]();})[_0x7322('0x23')](function(){_0x59ecbe[_0x7322('0x17')](0xcc)[_0x7322('0x18')]();})[_0x7322('0x42')](handleError(_0x59ecbe,null));};function getBucketslist(_0x2a1dde,_0x4842a5,_0x5757f6){return new Promise(function(_0x2b6448,_0x145a9f){var _0x414ac4=new AWS['S3']({'accessKeyId':_0x4842a5,'secretAccessKey':_0x2a1dde,'region':_0x5757f6});_0x414ac4[_0x7322('0x68')]({},function(_0x4644f2,_0x30fdd0){if(_0x4644f2){return _0x145a9f(_0x4644f2);}else{return _0x2b6448(_0x30fdd0);}});});}function createBucket(_0x404a3e,_0xd038ef,_0x8b017e,_0x5dc2ed){return new Promise(function(_0x457b94,_0xa7a6a){var _0x58115d=new AWS['S3']({'accessKeyId':_0xd038ef,'secretAccessKey':_0x404a3e,'region':_0x8b017e});_0x58115d['createBucket']({'Bucket':_0x5dc2ed},function(_0x29ce32,_0xf085b2){if(_0x29ce32){return _0xa7a6a(_0x29ce32);}else{return _0x457b94(_0xf085b2);}});});}function uploadFile(_0x5591c4,_0x2936cd,_0xc1dcde,_0x351ee8,_0x4e7ddd,_0x386625){return new Promise(function(_0x4582b3,_0x2e644a){var _0x3eee64=new AWS['S3']({'accessKeyId':_0x2936cd,'secretAccessKey':_0x5591c4,'region':_0xc1dcde});_0x3eee64[_0x7322('0x69')]({'Bucket':_0x351ee8,'Key':_0x4e7ddd,'Body':_0x386625},function(_0x5c5280,_0x27e1d2){if(_0x5c5280){return _0x2e644a(_0x5c5280);}else{return _0x4582b3(_0x27e1d2);}});});}function startTranscribe(_0x2917d7,_0x120d83,_0x3b55ef,_0x2fe103,_0x1253d6,_0x420486){return new Promise(function(_0x35fedd,_0x55d192){var _0x5c0fbe=new AWS[(_0x7322('0x6a'))]({'accessKeyId':_0x120d83,'secretAccessKey':_0x2917d7,'region':_0x3b55ef});_0x5c0fbe[_0x7322('0x6b')]({'TranscriptionJobName':_0x2fe103,'LanguageCode':_0x1253d6,'Media':{'MediaFileUri':_0x420486}},function(_0xb6eb97,_0x51d8c5){if(_0xb6eb97){return _0x55d192(_0xb6eb97);}else{return _0x35fedd(_0x51d8c5);}});});}function transcribe(_0x25646e,_0x438db9,_0x2ff5b1,_0x299573,_0x32a35a,_0x154d0a,_0x1d6931){return new Promise(function(_0x59bfe9,_0x4b4d7d){var _0x33c870={};logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x6c'),_0x25646e,_0x32a35a));return uploadFile(_0x438db9,_0x2ff5b1,_0x299573,_0x32a35a,path[_0x7322('0x6d')](_0x154d0a),fs[_0x7322('0x6e')](_0x154d0a))['then'](function(_0x3a7afb){logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x6f'),_0x25646e,_0x32a35a,_0x3a7afb[_0x7322('0x70')]));_0x33c870[_0x7322('0x71')]=_0x3a7afb['Bucket'];_0x33c870[_0x7322('0x72')]=_0x3a7afb[_0x7322('0x70')];logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x73'),_0x25646e));return startTranscribe(_0x438db9,_0x2ff5b1,_0x299573,uuidv4(),_0x1d6931,_0x3a7afb[_0x7322('0x70')]);})[_0x7322('0x23')](function(_0x1a1f76){logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x74'),_0x25646e,_0x1a1f76[_0x7322('0x75')][_0x7322('0x76')]));_0x33c870[_0x7322('0x77')]=_0x1a1f76[_0x7322('0x75')]['TranscriptionJobName'];_0x33c870[_0x7322('0x78')]=_0x1a1f76[_0x7322('0x75')]['TranscriptionJobStatus'];return _0x59bfe9(_0x33c870);})[_0x7322('0x42')](function(_0x404014){return _0x4b4d7d(_0x404014);});});}exports[_0x7322('0x79')]=function(_0x505f82,_0x14487d,_0x43bf93){var _0x2914e4;var _0xf8b2a8;var _0xe46b35;var _0x26a0d4=require('../../components/encryptor');return db[_0x7322('0x29')][_0x7322('0x7a')]({'where':{'id':_0x505f82['params']['id']}})['then'](function(_0xdfc615){if(_0xdfc615){var _0x121dd1=util['format']('%s.cypher',_0xdfc615['value']);if(fs[_0x7322('0x4e')](_0x121dd1)){cypher=!![];return _0x26a0d4['decryptFile'](_0x121dd1,_0xdfc615['value'],config['secrets'][_0x7322('0x4f')])[_0x7322('0x23')](function(){return _0xdfc615;});}return _0xdfc615;}})[_0x7322('0x23')](function(_0x2716fc){if(!_0x2716fc){throw new db['Sequelize'][(_0x7322('0x5e'))](_0x7322('0x7b'));}_0xf8b2a8=_0x2716fc;return db[_0x7322('0x7c')]['findOne']({'where':{'id':0x1}});})[_0x7322('0x23')](handleEntityNotFound(_0x14487d,null))['then'](function(_0x4b33ff){if(_0x4b33ff){_0x2914e4=_0x4b33ff;if(!_0x2914e4[_0x7322('0x7d')]||!_0x2914e4[_0x7322('0x7e')]||!_0x2914e4['transcribeRegion']||!_0x2914e4[_0x7322('0x7f')]||!_0x2914e4[_0x7322('0x71')]){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x505f82[_0x7322('0x46')]['runSentiment']&&(!_0x2914e4[_0x7322('0x80')]||!_0x2914e4[_0x7322('0x81')]||!_0x2914e4[_0x7322('0x82')]||!_0x2914e4[_0x7322('0x7f')]||!_0x2914e4[_0x7322('0x71')])){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x7322('0x83')][_0x7322('0x7a')]({'where':{'id':_0x2914e4[_0x7322('0x7e')]}});}})['then'](function(_0x307237){if(!_0x307237){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x307237[_0x7322('0x84')]||!_0x307237[_0x7322('0x85')]){throw new db[(_0x7322('0x50'))][(_0x7322('0x5e'))](_0x7322('0x86'));}_0xe46b35=_0x307237;return getBucketslist(_0xe46b35[_0x7322('0x84')],_0xe46b35[_0x7322('0x85')],_0x2914e4[_0x7322('0x87')]);})[_0x7322('0x23')](function(_0x5d0273){if(_0x5d0273&&_0x5d0273[_0x7322('0x88')]){var _0x22c876=_[_0x7322('0x48')](_0x5d0273['Buckets'],function(_0x52f739){return _0x52f739['Name']===_0x2914e4[_0x7322('0x71')];});if(!_0x22c876){logger[_0x7322('0x61')](util['format'](_0x7322('0x89'),_0x505f82[_0x7322('0x43')]['id'],_0x2914e4['bucket']));return createBucket(_0xe46b35[_0x7322('0x84')],_0xe46b35['data2'],_0x2914e4[_0x7322('0x87')],_0x2914e4['bucket']);}logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x8a'),_0x505f82[_0x7322('0x43')]['id'],_0x2914e4['bucket']));return;}})[_0x7322('0x23')](function(_0x43620f){if(_0xf8b2a8['transcribeStatus']==='NEW'){return transcribe(_0x505f82[_0x7322('0x43')]['id'],_0xe46b35[_0x7322('0x84')],_0xe46b35[_0x7322('0x85')],_0x2914e4[_0x7322('0x87')],_0x2914e4[_0x7322('0x71')],_0xf8b2a8[_0x7322('0x4c')],_0x2914e4[_0x7322('0x7f')]);}else{logger[_0x7322('0x61')](util[_0x7322('0x2f')](_0x7322('0x8b'),_0x505f82[_0x7322('0x43')]['id']));return{'transcribeStatus':_0x7322('0x8c')};}})['then'](function(_0x2d2b8d){if(_0x2d2b8d){_0x2d2b8d[_0x7322('0x8d')]=_0x505f82[_0x7322('0x46')][_0x7322('0x8e')];return _0xf8b2a8[_0x7322('0x8f')](_0x2d2b8d);}})[_0x7322('0x23')](respondWithResult(_0x14487d,null))[_0x7322('0x42')](handleError(_0x14487d,null));};function writeFile(_0x2b1e22,_0x101420){return new Promise(function(_0x57acc3,_0x180048){fs[_0x7322('0x90')](_0x101420,_0x2b1e22,function(_0xb83f72,_0x3ff6be){if(_0xb83f72){return _0x180048(_0xb83f72);}else{return _0x57acc3(_0x3ff6be);}});});}exports[_0x7322('0x91')]=function(_0x3d7cc1,_0x5aca22,_0x18e658){return db['VoiceRecording'][_0x7322('0x7a')]({'where':{'id':_0x3d7cc1[_0x7322('0x43')]['id']}})[_0x7322('0x23')](handleEntityNotFound(_0x5aca22))[_0x7322('0x23')](function(_0x48d3e6){if(_0x48d3e6&&_0x48d3e6[_0x7322('0x92')]){var _0x2c834e=_0x48d3e6[_0x7322('0x92')];var _0x37bcd6=config[_0x7322('0x93')]+_0x7322('0x94')+_0x48d3e6['id']+'.txt';if(fs[_0x7322('0x4e')](_0x37bcd6)){return _0x37bcd6;}return writeFile(_0x2c834e,_0x37bcd6)['then'](function(){return _0x37bcd6;});}else{throw new db['Sequelize'][(_0x7322('0x5e'))]('Transcript\x20not\x20available');}})[_0x7322('0x23')](function(_0x5c7de1){return _0x5aca22[_0x7322('0x52')](_0x5c7de1);})[_0x7322('0x42')](handleError(_0x5aca22));}; \ No newline at end of file +var _0x0148=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','Transcript\x20not\x20available','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','uuid/v4','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','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceRecording','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','secrets','Sequelize','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name'];(function(_0x3921cb,_0x4063f5){var _0x513583=function(_0x35b731){while(--_0x35b731){_0x3921cb['push'](_0x3921cb['shift']());}};_0x513583(++_0x4063f5);}(_0x0148,0x12c));var _0x8014=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0148[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8014('0x0'));var jsonpatch=require(_0x8014('0x1'));var rp=require(_0x8014('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8014('0x3'));var path=require('path');var sox=require(_0x8014('0x4'));var csv=require(_0x8014('0x5'));var ejs=require(_0x8014('0x6'));var fs=require('fs');var fs_extra=require(_0x8014('0x7'));var _=require(_0x8014('0x8'));var squel=require(_0x8014('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8014('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8014('0xb'));var Papa=require(_0x8014('0xc'));var AWS=require('aws-sdk');var uuidv4=require(_0x8014('0xd'));var Redis=require(_0x8014('0xe'));var authService=require(_0x8014('0xf'));var qs=require(_0x8014('0x10'));var as=require(_0x8014('0x11'));var hardwareService=require(_0x8014('0x12'));var logger=require(_0x8014('0x13'))('api');var utils=require(_0x8014('0x14'));var config=require(_0x8014('0x15'));var licenseUtil=require(_0x8014('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x407d2b,_0x2cc66c){_0x2cc66c=_0x2cc66c||0xcc;return function(_0x487ab6){if(_0x487ab6){return _0x407d2b[_0x8014('0x17')](_0x2cc66c);}return _0x407d2b[_0x8014('0x18')](_0x2cc66c)[_0x8014('0x19')]();};}function respondWithResult(_0xa49ec6,_0x346105){_0x346105=_0x346105||0xc8;return function(_0x36a393){if(_0x36a393){return _0xa49ec6['status'](_0x346105)[_0x8014('0x1a')](_0x36a393);}};}function respondWithFilteredResult(_0x580329,_0x1936ba){return function(_0xe4d906){if(_0xe4d906){var _0x1a871f=typeof _0x1936ba['offset']==='undefined'&&typeof _0x1936ba[_0x8014('0x1b')]===_0x8014('0x1c');var _0x2454f8=_0xe4d906['count'];var _0x223d8e=_0x1a871f?0x0:_0x1936ba[_0x8014('0x1d')];var _0x525262=_0x1a871f?_0xe4d906[_0x8014('0x1e')]:_0x1936ba[_0x8014('0x1d')]+_0x1936ba[_0x8014('0x1b')];var _0x458dd4;if(_0x525262>=_0x2454f8){_0x525262=_0x2454f8;_0x458dd4=0xc8;}else{_0x458dd4=0xce;}_0x580329[_0x8014('0x18')](_0x458dd4);return _0x580329[_0x8014('0x1f')](_0x8014('0x20'),_0x223d8e+'-'+_0x525262+'/'+_0x2454f8)[_0x8014('0x1a')](_0xe4d906);}return null;};}function patchUpdates(_0x46366e){return function(_0x5cc671){try{jsonpatch[_0x8014('0x21')](_0x5cc671,_0x46366e,!![]);}catch(_0x4362d2){return BPromise['reject'](_0x4362d2);}return _0x5cc671[_0x8014('0x22')]();};}function saveUpdates(_0x4b5ec1,_0x2ce03d){return function(_0x32971f){if(_0x32971f){return _0x32971f[_0x8014('0x23')](_0x4b5ec1)[_0x8014('0x24')](function(_0x2d182a){return _0x2d182a;});}return null;};}function removeEntity(_0x3e7aa9,_0x35a43b){return function(_0x47c39b){if(_0x47c39b){return _0x47c39b[_0x8014('0x25')]()[_0x8014('0x24')](function(){_0x3e7aa9[_0x8014('0x18')](0xcc)[_0x8014('0x19')]();});}};}function handleEntityNotFound(_0x1c597b,_0x492c74){return function(_0x2e2b82){if(!_0x2e2b82){_0x1c597b['sendStatus'](0x194);}return _0x2e2b82;};}function handleError(_0x309d7a,_0x5acdd8){_0x5acdd8=_0x5acdd8||0x1f4;return function(_0x527d56){logger[_0x8014('0x26')](_0x527d56[_0x8014('0x27')]);if(_0x527d56['name']){delete _0x527d56[_0x8014('0x28')];}_0x309d7a[_0x8014('0x18')](_0x5acdd8)[_0x8014('0x29')](_0x527d56);};}exports[_0x8014('0x2a')]=function(_0x4bc264,_0x2c36b4){var _0xd643a1={},_0xcd4422={},_0x955e98={'count':0x0,'rows':[]};var _0x895f55=_['map'](db[_0x8014('0x2b')]['rawAttributes'],function(_0xf14db7){return{'name':_0xf14db7['fieldName'],'type':_0xf14db7['type'][_0x8014('0x2c')]};});_0xcd4422[_0x8014('0x2d')]=_[_0x8014('0x2e')](_['map'](_0x895f55,_0x8014('0x28')),[_0x8014('0x2f')]);_0xcd4422[_0x8014('0x30')]=_[_0x8014('0x31')](_0x4bc264[_0x8014('0x30')]);_0xcd4422[_0x8014('0x32')]=_['intersection'](_0xcd4422[_0x8014('0x2d')],_0xcd4422['query']);_0xd643a1[_0x8014('0x33')]=_[_0x8014('0x34')](_0xcd4422[_0x8014('0x2d')],qs[_0x8014('0x35')](_0x4bc264['query']['fields']));_0xd643a1[_0x8014('0x33')]=_0xd643a1[_0x8014('0x33')][_0x8014('0x36')]?_0xd643a1[_0x8014('0x33')]:_0xcd4422['model'];if(!_0x4bc264[_0x8014('0x30')][_0x8014('0x37')](_0x8014('0x38'))){_0xd643a1[_0x8014('0x1b')]=qs['limit'](_0x4bc264[_0x8014('0x30')][_0x8014('0x1b')]);_0xd643a1['offset']=qs[_0x8014('0x1d')](_0x4bc264[_0x8014('0x30')][_0x8014('0x1d')]);}_0xd643a1['order']=qs[_0x8014('0x39')](_0x4bc264['query'][_0x8014('0x39')]);_0xd643a1[_0x8014('0x3a')]=qs[_0x8014('0x32')](_['pick'](_0x4bc264['query'],_0xcd4422['filters']),_0x895f55);if(_0x4bc264[_0x8014('0x30')][_0x8014('0x3b')]){_0xd643a1[_0x8014('0x3a')]=_[_0x8014('0x3c')](_0xd643a1[_0x8014('0x3a')],{'$or':_[_0x8014('0x3d')](_0x895f55,function(_0x4a04e6){if(_0x4a04e6[_0x8014('0x3e')]!==_0x8014('0x3f')){var _0x627255={};_0x627255[_0x4a04e6[_0x8014('0x28')]]={'$like':'%'+_0x4bc264[_0x8014('0x30')][_0x8014('0x3b')]+'%'};return _0x627255;}})});}_0xd643a1=_[_0x8014('0x3c')]({},_0xd643a1,_0x4bc264[_0x8014('0x40')]);var _0x1ef7fd={'where':_0xd643a1[_0x8014('0x3a')]};return db[_0x8014('0x2b')][_0x8014('0x1e')](_0x1ef7fd)[_0x8014('0x24')](function(_0x410506){_0x955e98[_0x8014('0x1e')]=_0x410506;if(_0x4bc264[_0x8014('0x30')]['includeAll']){_0xd643a1[_0x8014('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8014('0x42')](_0xd643a1);})[_0x8014('0x24')](function(_0x498e6c){_0x955e98['rows']=_0x498e6c;return _0x955e98;})[_0x8014('0x24')](respondWithFilteredResult(_0x2c36b4,_0xd643a1))[_0x8014('0x43')](handleError(_0x2c36b4,null));};exports[_0x8014('0x44')]=function(_0x2c9a54,_0x5886c6){var _0x3a9d1a={'raw':![],'where':{'id':_0x2c9a54[_0x8014('0x45')]['id']}},_0x1ba28f={};_0x1ba28f[_0x8014('0x2d')]=_[_0x8014('0x31')](db[_0x8014('0x2b')][_0x8014('0x46')]);_0x1ba28f[_0x8014('0x30')]=_['keys'](_0x2c9a54[_0x8014('0x30')]);_0x1ba28f[_0x8014('0x32')]=_[_0x8014('0x34')](_0x1ba28f['model'],_0x1ba28f[_0x8014('0x30')]);_0x3a9d1a[_0x8014('0x33')]=_[_0x8014('0x34')](_0x1ba28f['model'],qs['fields'](_0x2c9a54[_0x8014('0x30')][_0x8014('0x35')]));_0x3a9d1a[_0x8014('0x33')]=_0x3a9d1a[_0x8014('0x33')]['length']?_0x3a9d1a['attributes']:_0x1ba28f[_0x8014('0x2d')];if(_0x2c9a54[_0x8014('0x30')]['includeAll']){_0x3a9d1a[_0x8014('0x41')]=[{'all':!![]}];}_0x3a9d1a=_[_0x8014('0x3c')]({},_0x3a9d1a,_0x2c9a54[_0x8014('0x40')]);return db[_0x8014('0x2b')][_0x8014('0x47')](_0x3a9d1a)[_0x8014('0x24')](handleEntityNotFound(_0x5886c6,null))[_0x8014('0x24')](respondWithResult(_0x5886c6,null))['catch'](handleError(_0x5886c6,null));};exports[_0x8014('0x48')]=function(_0x286669,_0x16cb9a){return db[_0x8014('0x2b')][_0x8014('0x48')](_0x286669[_0x8014('0x49')],{})['then'](respondWithResult(_0x16cb9a,0xc9))['catch'](handleError(_0x16cb9a,null));};exports[_0x8014('0x23')]=function(_0x2774c6,_0x5dffd1){if(_0x2774c6['body']['id']){delete _0x2774c6[_0x8014('0x49')]['id'];}return db[_0x8014('0x2b')][_0x8014('0x47')]({'where':{'id':_0x2774c6[_0x8014('0x45')]['id']}})[_0x8014('0x24')](handleEntityNotFound(_0x5dffd1,null))['then'](saveUpdates(_0x2774c6[_0x8014('0x49')],null))['then'](respondWithResult(_0x5dffd1,null))[_0x8014('0x43')](handleError(_0x5dffd1,null));};exports[_0x8014('0x4a')]=function(_0x10b9df,_0x593f3e){return db[_0x8014('0x2b')][_0x8014('0x4a')]()[_0x8014('0x24')](respondWithResult(_0x593f3e,null))[_0x8014('0x43')](handleError(_0x593f3e,null));};exports[_0x8014('0x4b')]=function(_0x5f110c,_0x1bd6fd,_0x14bb0b){var _0x3bf9e5=require(_0x8014('0x4c'));var _0x5a8303=![];var _0x4f88e7={};if(_0x5f110c[_0x8014('0x30')]['type']&&_0x5f110c[_0x8014('0x30')]['type']===_0x8014('0x4d')){_0x4f88e7[_0x8014('0x4d')]=_0x5f110c[_0x8014('0x45')]['id'];}else{_0x4f88e7['id']=_0x5f110c['params']['id'];}return db['VoiceRecording'][_0x8014('0x47')]({'where':_0x4f88e7,'attributes':['id',_0x8014('0x4e')],'raw':!![]})[_0x8014('0x24')](handleEntityNotFound(_0x1bd6fd,null))[_0x8014('0x24')](function(_0x4e8371){if(_0x4e8371){var _0x40b293=_0x4e8371['value'];var _0x20af68=util[_0x8014('0x2f')](_0x8014('0x4f'),_0x40b293);if(fs[_0x8014('0x50')](_0x20af68)){_0x5a8303=!![];return _0x3bf9e5[_0x8014('0x51')](_0x20af68,_0x40b293,config['secrets'][_0x8014('0x52')])[_0x8014('0x24')](function(){return _0x4e8371;});}return _0x4e8371;}})[_0x8014('0x24')](function(_0x177962){if(_0x177962){var _0x192548=_0x177962[_0x8014('0x4e')];if(!fs[_0x8014('0x50')](_0x192548)){throw new db['Sequelize'][(_0x8014('0x53'))](_0x8014('0x54'));}if(_0x177962[_0x8014('0x55')]){return _0x1bd6fd['download'](_0x192548,_0x177962[_0x8014('0x55')]+path['extname'](_0x192548),function(){if(_0x5a8303){fs[_0x8014('0x56')](_0x192548);}});}else{return _0x1bd6fd[_0x8014('0x4b')](_0x192548,function(_0x31f684){if(_0x5a8303){fs['unlink'](_0x192548);}});}}})['catch'](function(_0x484403){if(_0x484403[_0x8014('0x57')]===_0x8014('0x54')){_0x1bd6fd[_0x8014('0x18')](0x194)[_0x8014('0x29')](_0x8014('0x58'));}else{return handleError(_0x1bd6fd,null);}});};exports[_0x8014('0x59')]=function(_0x1655d8,_0x314fde,_0x7b3fd7){var _0x41f8ea=require(_0x8014('0x4c'));var _0x14504f=![];var _0x16bc1a={'$and':[db[_0x8014('0x5a')][_0x8014('0x3a')](db[_0x8014('0x5a')]['fn']('MD5',db[_0x8014('0x5a')][_0x8014('0x5b')](_0x8014('0x4d'))),_0x1655d8[_0x8014('0x30')][_0x8014('0x5c')])]};if(_0x1655d8['query']['type']&&_0x1655d8[_0x8014('0x30')][_0x8014('0x3e')]===_0x8014('0x4d')){_0x16bc1a[_0x8014('0x5d')][_0x8014('0x5e')]({'uniqueid':_0x1655d8[_0x8014('0x45')]['id']});}else{_0x16bc1a['$and']['push']({'id':_0x1655d8[_0x8014('0x45')]['id']});}return db[_0x8014('0x2b')]['find']({'where':_0x16bc1a,'attributes':['id','value'],'raw':!![]})[_0x8014('0x24')](handleEntityNotFound(_0x314fde,null))[_0x8014('0x24')](function(_0x194f01){if(_0x194f01){var _0x53ad28=util[_0x8014('0x2f')](_0x8014('0x4f'),_0x194f01['value']);if(fs[_0x8014('0x50')](_0x53ad28)){_0x14504f=!![];return _0x41f8ea['decryptFile'](_0x53ad28,_0x194f01[_0x8014('0x4e')],config[_0x8014('0x5f')][_0x8014('0x52')])[_0x8014('0x24')](function(){return _0x194f01;});}return _0x194f01;}})[_0x8014('0x24')](function(_0x460c1){if(_0x460c1){if(!fs[_0x8014('0x50')](_0x460c1[_0x8014('0x4e')])){throw new db[(_0x8014('0x60'))][(_0x8014('0x53'))](_0x8014('0x54'));}if(_0x460c1['filename']){return _0x314fde['download'](_0x460c1[_0x8014('0x4e')],_0x460c1[_0x8014('0x55')]+path['extname'](_0x460c1[_0x8014('0x4e')]),function(){if(_0x14504f){fs[_0x8014('0x56')](_0x460c1[_0x8014('0x4e')]);}});}else{return _0x314fde[_0x8014('0x4b')](_0x460c1[_0x8014('0x4e')],function(_0x27dfca){if(_0x14504f){fs[_0x8014('0x56')](_0x460c1['value']);}});}}})[_0x8014('0x43')](handleError(_0x314fde,null));};exports[_0x8014('0x25')]=function(_0x1eee08,_0x44486c){return db[_0x8014('0x2b')][_0x8014('0x47')]({'where':{'id':_0x1eee08[_0x8014('0x45')]['id']}})[_0x8014('0x24')](function(_0x5d679d){if(_[_0x8014('0x61')](_0x5d679d)){throw new ReferenceError(_0x8014('0x62'));}return _0x5d679d;})[_0x8014('0x24')](function(_0x2db2d5){var _0x4e7897=_0x2db2d5[_0x8014('0x4e')];logger[_0x8014('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x4e7897);if(!_[_0x8014('0x61')](_0x2db2d5[_0x8014('0x4e')])&&fs['existsSync'](_0x4e7897)){logger[_0x8014('0x63')](_0x8014('0x64')+_0x4e7897+_0x8014('0x65'));fs['unlinkSync'](_0x4e7897);}_0x4e7897=_0x4e7897+_0x8014('0x66');if(!_[_0x8014('0x61')](_0x2db2d5['value'])&&fs[_0x8014('0x50')](_0x4e7897)){logger[_0x8014('0x63')](_0x8014('0x64')+_0x4e7897+_0x8014('0x65'));fs['unlinkSync'](_0x4e7897);}return _0x2db2d5;})[_0x8014('0x24')](function(_0x1af4ec){if(!_0x1af4ec)throw new InternalError();return _0x1af4ec[_0x8014('0x25')]();})[_0x8014('0x24')](function(){_0x44486c[_0x8014('0x18')](0xcc)[_0x8014('0x19')]();})['catch'](handleError(_0x44486c,null));};function getBucketslist(_0x53f102,_0x51118e,_0x194603){return new Promise(function(_0x31d0ba,_0x239c27){var _0x34139a=new AWS['S3']({'accessKeyId':_0x51118e,'secretAccessKey':_0x53f102,'region':_0x194603});_0x34139a[_0x8014('0x67')]({},function(_0x167828,_0x185b8b){if(_0x167828){return _0x239c27(_0x167828);}else{return _0x31d0ba(_0x185b8b);}});});}function createBucket(_0x192891,_0x548908,_0x51847c,_0x2eec3f){return new Promise(function(_0x870f00,_0x494263){var _0xce775d=new AWS['S3']({'accessKeyId':_0x548908,'secretAccessKey':_0x192891,'region':_0x51847c});_0xce775d[_0x8014('0x68')]({'Bucket':_0x2eec3f},function(_0x4f9b12,_0x484c4e){if(_0x4f9b12){return _0x494263(_0x4f9b12);}else{return _0x870f00(_0x484c4e);}});});}function uploadFile(_0x3c7690,_0x27283a,_0x5b4d2c,_0xed8369,_0x25e34f,_0x4f13c5){return new Promise(function(_0x4f1fd7,_0x274566){var _0x356bad=new AWS['S3']({'accessKeyId':_0x27283a,'secretAccessKey':_0x3c7690,'region':_0x5b4d2c});_0x356bad[_0x8014('0x69')]({'Bucket':_0xed8369,'Key':_0x25e34f,'Body':_0x4f13c5},function(_0x3cc624,_0x565338){if(_0x3cc624){return _0x274566(_0x3cc624);}else{return _0x4f1fd7(_0x565338);}});});}function startTranscribe(_0xce09fe,_0x3982d7,_0x180a87,_0x335965,_0x3a5ad5,_0x2f8c46){return new Promise(function(_0x1bbcdb,_0x58466f){var _0x521d16=new AWS['TranscribeService']({'accessKeyId':_0x3982d7,'secretAccessKey':_0xce09fe,'region':_0x180a87});_0x521d16['startTranscriptionJob']({'TranscriptionJobName':_0x335965,'LanguageCode':_0x3a5ad5,'Media':{'MediaFileUri':_0x2f8c46}},function(_0xa553fa,_0x2c2e7d){if(_0xa553fa){return _0x58466f(_0xa553fa);}else{return _0x1bbcdb(_0x2c2e7d);}});});}function transcribe(_0x560e39,_0x3428e9,_0x4b5c0c,_0x393160,_0x183bb1,_0x6d24c2,_0x384c43){return new Promise(function(_0x31333c,_0x9a003){var _0x184e98={};logger[_0x8014('0x63')](util[_0x8014('0x2f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x560e39,_0x183bb1));return uploadFile(_0x3428e9,_0x4b5c0c,_0x393160,_0x183bb1,path[_0x8014('0x6a')](_0x6d24c2),fs[_0x8014('0x6b')](_0x6d24c2))[_0x8014('0x24')](function(_0x51361a){logger[_0x8014('0x63')](util[_0x8014('0x2f')](_0x8014('0x6c'),_0x560e39,_0x183bb1,_0x51361a[_0x8014('0x6d')]));_0x184e98[_0x8014('0x6e')]=_0x51361a[_0x8014('0x6f')];_0x184e98[_0x8014('0x70')]=_0x51361a[_0x8014('0x6d')];logger[_0x8014('0x63')](util['format'](_0x8014('0x71'),_0x560e39));return startTranscribe(_0x3428e9,_0x4b5c0c,_0x393160,uuidv4(),_0x384c43,_0x51361a[_0x8014('0x6d')]);})['then'](function(_0x358928){logger['info'](util['format'](_0x8014('0x72'),_0x560e39,_0x358928[_0x8014('0x73')]['TranscriptionJobName']));_0x184e98[_0x8014('0x74')]=_0x358928['TranscriptionJob']['TranscriptionJobName'];_0x184e98['transcribeStatus']=_0x358928['TranscriptionJob']['TranscriptionJobStatus'];return _0x31333c(_0x184e98);})[_0x8014('0x43')](function(_0x47319e){return _0x9a003(_0x47319e);});});}exports[_0x8014('0x75')]=function(_0x2bd333,_0x3596cd,_0xd132f6){var _0x16b88f;var _0x29fc95;var _0x5a7063;var _0x5a5e87=require('../../components/encryptor');return db[_0x8014('0x2b')][_0x8014('0x76')]({'where':{'id':_0x2bd333[_0x8014('0x45')]['id']}})['then'](function(_0x19cb82){if(_0x19cb82){var _0x3bc8bc=util[_0x8014('0x2f')]('%s.cypher',_0x19cb82[_0x8014('0x4e')]);if(fs[_0x8014('0x50')](_0x3bc8bc)){cypher=!![];return _0x5a5e87[_0x8014('0x51')](_0x3bc8bc,_0x19cb82['value'],config['secrets'][_0x8014('0x52')])[_0x8014('0x24')](function(){return _0x19cb82;});}return _0x19cb82;}})[_0x8014('0x24')](function(_0x34e64b){if(!_0x34e64b){throw new db['Sequelize']['ValidationError'](_0x8014('0x77'));}_0x29fc95=_0x34e64b;return db['Setting'][_0x8014('0x76')]({'where':{'id':0x1}});})[_0x8014('0x24')](handleEntityNotFound(_0x3596cd,null))['then'](function(_0x11f774){if(_0x11f774){_0x16b88f=_0x11f774;if(!_0x16b88f['transcribe']||!_0x16b88f[_0x8014('0x78')]||!_0x16b88f[_0x8014('0x79')]||!_0x16b88f[_0x8014('0x7a')]||!_0x16b88f[_0x8014('0x6e')]){throw new db[(_0x8014('0x60'))]['ValidationError'](_0x8014('0x7b'));}if(_0x2bd333['body']['runSentiment']&&(!_0x16b88f[_0x8014('0x7c')]||!_0x16b88f['sentimentAccountId']||!_0x16b88f[_0x8014('0x7d')]||!_0x16b88f[_0x8014('0x7a')]||!_0x16b88f[_0x8014('0x6e')])){throw new db[(_0x8014('0x60'))]['ValidationError'](_0x8014('0x7e'));}return db[_0x8014('0x7f')][_0x8014('0x76')]({'where':{'id':_0x16b88f[_0x8014('0x78')]}});}})[_0x8014('0x24')](function(_0x55531b){if(!_0x55531b){throw new db[(_0x8014('0x60'))][(_0x8014('0x53'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x55531b[_0x8014('0x80')]||!_0x55531b[_0x8014('0x81')]){throw new db['Sequelize'][(_0x8014('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x5a7063=_0x55531b;return getBucketslist(_0x5a7063[_0x8014('0x80')],_0x5a7063[_0x8014('0x81')],_0x16b88f[_0x8014('0x79')]);})[_0x8014('0x24')](function(_0x1fec2d){if(_0x1fec2d&&_0x1fec2d[_0x8014('0x82')]){var _0xfd2c79=_[_0x8014('0x47')](_0x1fec2d[_0x8014('0x82')],function(_0x5098d2){return _0x5098d2[_0x8014('0x83')]===_0x16b88f[_0x8014('0x6e')];});if(!_0xfd2c79){logger[_0x8014('0x63')](util[_0x8014('0x2f')](_0x8014('0x84'),_0x2bd333[_0x8014('0x45')]['id'],_0x16b88f[_0x8014('0x6e')]));return createBucket(_0x5a7063['data1'],_0x5a7063[_0x8014('0x81')],_0x16b88f['transcribeRegion'],_0x16b88f[_0x8014('0x6e')]);}logger['info'](util[_0x8014('0x2f')](_0x8014('0x85'),_0x2bd333[_0x8014('0x45')]['id'],_0x16b88f[_0x8014('0x6e')]));return;}})[_0x8014('0x24')](function(_0x271c0f){if(_0x29fc95['transcribeStatus']===_0x8014('0x86')){return transcribe(_0x2bd333[_0x8014('0x45')]['id'],_0x5a7063[_0x8014('0x80')],_0x5a7063[_0x8014('0x81')],_0x16b88f['transcribeRegion'],_0x16b88f[_0x8014('0x6e')],_0x29fc95[_0x8014('0x4e')],_0x16b88f[_0x8014('0x7a')]);}else{logger['info'](util[_0x8014('0x2f')](_0x8014('0x87'),_0x2bd333[_0x8014('0x45')]['id']));return{'transcribeStatus':_0x8014('0x88')};}})[_0x8014('0x24')](function(_0x5eb416){if(_0x5eb416){_0x5eb416[_0x8014('0x89')]=_0x2bd333[_0x8014('0x49')][_0x8014('0x8a')];return _0x29fc95[_0x8014('0x8b')](_0x5eb416);}})[_0x8014('0x24')](respondWithResult(_0x3596cd,null))[_0x8014('0x43')](handleError(_0x3596cd,null));};function writeFile(_0x454e42,_0x2e73fe){return new Promise(function(_0x25c8d0,_0xa49b9d){fs[_0x8014('0x8c')](_0x2e73fe,_0x454e42,function(_0x3cf4df,_0x26687a){if(_0x3cf4df){return _0xa49b9d(_0x3cf4df);}else{return _0x25c8d0(_0x26687a);}});});}exports[_0x8014('0x8d')]=function(_0x48e684,_0x5549f4,_0x48225a){return db['VoiceRecording'][_0x8014('0x76')]({'where':{'id':_0x48e684[_0x8014('0x45')]['id']}})[_0x8014('0x24')](handleEntityNotFound(_0x5549f4))[_0x8014('0x24')](function(_0x1fd8b4){if(_0x1fd8b4&&_0x1fd8b4[_0x8014('0x8e')]){var _0x43d729=_0x1fd8b4['fileText'];var _0x5d809e=config['root']+'/server/files/transcribes/transcribe_'+_0x1fd8b4['id']+'.txt';if(fs[_0x8014('0x50')](_0x5d809e)){return _0x5d809e;}return writeFile(_0x43d729,_0x5d809e)[_0x8014('0x24')](function(){return _0x5d809e;});}else{throw new db[(_0x8014('0x60'))]['ValidationError'](_0x8014('0x8f'));}})[_0x8014('0x24')](function(_0x3f97c0){return _0x5549f4[_0x8014('0x4b')](_0x3f97c0);})['catch'](handleError(_0x5549f4));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c783270..e5cbf9f 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 _0x1505=['request-promise','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','api','bluebird'];(function(_0x5dc641,_0x185e8d){var _0x15bbc7=function(_0x1752d1){while(--_0x1752d1){_0x5dc641['push'](_0x5dc641['shift']());}};_0x15bbc7(++_0x185e8d);}(_0x1505,0x1cb));var _0x5150=function(_0x4ba018,_0x111f07){_0x4ba018=_0x4ba018-0x0;var _0x1b8148=_0x1505[_0x4ba018];return _0x1b8148;};'use strict';var _=require(_0x5150('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5150('0x1'));var moment=require('moment');var BPromise=require(_0x5150('0x2'));var rp=require(_0x5150('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5150('0x4'));var config=require(_0x5150('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x5150('0x6')]=function(_0x43b8e7,_0x505db0){return _0x43b8e7[_0x5150('0x7')](_0x5150('0x8'),attributes,{'tableName':_0x5150('0x9'),'paranoid':![],'indexes':[{'name':_0x5150('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb519=['util','api','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash'];(function(_0x5d8c75,_0x1ef929){var _0x26632f=function(_0xb72f26){while(--_0xb72f26){_0x5d8c75['push'](_0x5d8c75['shift']());}};_0x26632f(++_0x1ef929);}(_0xb519,0x1df));var _0x9b51=function(_0x416e83,_0x1c802a){_0x416e83=_0x416e83-0x0;var _0x32776a=_0xb519[_0x416e83];return _0x32776a;};'use strict';var _=require(_0x9b51('0x0'));var util=require(_0x9b51('0x1'));var logger=require('../../config/logger')(_0x9b51('0x2'));var moment=require('moment');var BPromise=require(_0x9b51('0x3'));var rp=require(_0x9b51('0x4'));var fs=require('fs');var path=require(_0x9b51('0x5'));var rimraf=require(_0x9b51('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b51('0x7'));module[_0x9b51('0x8')]=function(_0xf193fa,_0x380bcc){return _0xf193fa[_0x9b51('0x9')]('VoiceRecording',attributes,{'tableName':_0x9b51('0xa'),'paranoid':![],'indexes':[{'name':_0x9b51('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index cd1469d..9a5b9b8 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 _0xcf2f=['request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','then','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b51fe,_0x119a93){var _0x3ee131=function(_0x14fb60){while(--_0x14fb60){_0x5b51fe['push'](_0x5b51fe['shift']());}};_0x3ee131(++_0x119a93);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x448b3d,_0x36d81e){_0x448b3d=_0x448b3d-0x0;var _0x3685e3=_0xcf2f[_0x448b3d];return _0x3685e3;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}exports[_0xfcf2('0x17')]=function(_0x581d78){var _0xd87472=this;return new Promise(function(_0x1b3c89,_0x33eaa7){return db[_0xfcf2('0x18')][_0xfcf2('0x19')](_0x581d78['body'],{'raw':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1b')]||null:null,'attributes':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1c')]||null:null,'limit':_0x581d78[_0xfcf2('0x1a')]?_0x581d78[_0xfcf2('0x1a')][_0xfcf2('0x1d')]||null:null})['then'](function(_0x3790ed){logger[_0xfcf2('0x14')](_0xfcf2('0x17'),_0x581d78);logger['debug'](_0xfcf2('0x17'),_0x581d78,JSON[_0xfcf2('0x11')](_0x3790ed));_0x1b3c89(_0x3790ed);})['catch'](function(_0x3c3774){logger[_0xfcf2('0x12')]('UpdateVoiceRecording',_0x3c3774[_0xfcf2('0x13')],_0x581d78);_0x33eaa7(_0xd87472[_0xfcf2('0x12')](0x1f4,_0x3c3774[_0xfcf2('0x13')]));});});};exports[_0xfcf2('0x1e')]=function(_0x5bb384){var _0x1deca3=this;return new Promise(function(_0x448222,_0x2a9d64){var _0x3779ee=require(_0xfcf2('0x1f'));var _0x2b1d60;return db[_0xfcf2('0x20')][_0xfcf2('0x21')]({'attributes':['id',_0xfcf2('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4c2935){_0x2b1d60=_0x4c2935;return db[_0xfcf2('0x18')][_0xfcf2('0x23')](_0x5bb384[_0xfcf2('0x24')]);})['then'](function(_0x560898){if(_0x2b1d60['callRecordingEncryption']&&fs[_0xfcf2('0x25')](_0x560898[_0xfcf2('0x26')])){var _0x40c1ae=util[_0xfcf2('0x27')](_0xfcf2('0x28'),_0x560898[_0xfcf2('0x26')]);return _0x3779ee[_0xfcf2('0x29')](_0x560898['value'],_0x40c1ae,config['secrets'][_0xfcf2('0x2a')])[_0xfcf2('0x2b')](function(){fs[_0xfcf2('0x2c')](_0x560898[_0xfcf2('0x26')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x560898;});}return _0x560898;})[_0xfcf2('0x2b')](function(_0x5310e6){logger[_0xfcf2('0x14')](_0xfcf2('0x1e'),_0x5bb384);logger['debug'](_0xfcf2('0x1e'),_0x5bb384,JSON[_0xfcf2('0x11')](_0x5310e6));_0x448222(_0x5310e6);})[_0xfcf2('0x16')](function(_0x4046c6){logger[_0xfcf2('0x12')](_0xfcf2('0x1e'),_0x4046c6[_0xfcf2('0x13')],_0x5bb384);_0x2a9d64(_0x1deca3['error'](0x1f4,_0x4046c6[_0xfcf2('0x13')]));});});}; \ No newline at end of file +var _0xc1c6=['format','%s.cypher','value','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','update','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','existsSync'];(function(_0x447a21,_0x28abdf){var _0x288b55=function(_0x292cb0){while(--_0x292cb0){_0x447a21['push'](_0x447a21['shift']());}};_0x288b55(++_0x28abdf);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1fb119,_0x13f62f){_0x1fb119=_0x1fb119-0x0;var _0x5d85d9=_0xc1c6[_0x1fb119];return _0x5d85d9;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['UpdateVoiceRecording']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['VoiceRecording'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null})[_0x6c1c('0x9')](function(_0x9c6c55){logger[_0x6c1c('0x11')](_0x6c1c('0x19'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x19'),_0x137770,JSON[_0x6c1c('0xe')](_0x9c6c55));_0x338dc2(_0x9c6c55);})[_0x6c1c('0x12')](function(_0x96046a){logger[_0x6c1c('0xf')](_0x6c1c('0x19'),_0x96046a[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x96046a[_0x6c1c('0x10')]));});});};exports[_0x6c1c('0x1a')]=function(_0x1b9d7d){var _0x2feaf4=this;return new Promise(function(_0x5f4568,_0x2595c3){var _0x4d73aa=require(_0x6c1c('0x1b'));var _0x4c23f8;return db[_0x6c1c('0x1c')]['findOne']({'attributes':['id',_0x6c1c('0x1d')],'where':{'id':0x1},'raw':!![]})[_0x6c1c('0x9')](function(_0x504348){_0x4c23f8=_0x504348;return db[_0x6c1c('0x1e')][_0x6c1c('0x1f')](_0x1b9d7d['body']);})[_0x6c1c('0x9')](function(_0x19a8f1){if(_0x4c23f8[_0x6c1c('0x1d')]&&fs[_0x6c1c('0x20')](_0x19a8f1['value'])){var _0x52c036=util[_0x6c1c('0x21')](_0x6c1c('0x22'),_0x19a8f1[_0x6c1c('0x23')]);return _0x4d73aa[_0x6c1c('0x24')](_0x19a8f1[_0x6c1c('0x23')],_0x52c036,config[_0x6c1c('0x25')]['recording'])[_0x6c1c('0x9')](function(){fs[_0x6c1c('0x26')](_0x19a8f1['value']);logger[_0x6c1c('0x11')](_0x6c1c('0x27'));return _0x19a8f1;});}return _0x19a8f1;})[_0x6c1c('0x9')](function(_0x15b6d2){logger['info'](_0x6c1c('0x1a'),_0x1b9d7d);logger[_0x6c1c('0xc')](_0x6c1c('0x1a'),_0x1b9d7d,JSON['stringify'](_0x15b6d2));_0x5f4568(_0x15b6d2);})[_0x6c1c('0x12')](function(_0x4e5767){logger[_0x6c1c('0xf')]('CreateVoiceRecording',_0x4e5767[_0x6c1c('0x10')],_0x1b9d7d);_0x2595c3(_0x2feaf4[_0x6c1c('0xf')](0x1f4,_0x4e5767[_0x6c1c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 65945c1..e42a91a 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 _0x7a67=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a67,0x133));var _0x77a6=function(_0x33ede9,_0x24ea2c){_0x33ede9=_0x33ede9-0x0;var _0x4ae572=_0x7a67[_0x33ede9];return _0x4ae572;};'use strict';var multer=require(_0x77a6('0x0'));var util=require(_0x77a6('0x1'));var path=require(_0x77a6('0x2'));var timeout=require(_0x77a6('0x3'));var express=require(_0x77a6('0x4'));var router=express[_0x77a6('0x5')]();var fs_extra=require(_0x77a6('0x6'));var auth=require(_0x77a6('0x7'));var interaction=require(_0x77a6('0x8'));var config=require(_0x77a6('0x9'));var controller=require(_0x77a6('0xa'));router[_0x77a6('0xb')]('/',auth[_0x77a6('0xc')](),controller[_0x77a6('0xd')]);router['get'](_0x77a6('0xe'),auth[_0x77a6('0xc')](),controller['describe']);router[_0x77a6('0xb')](_0x77a6('0xf'),auth[_0x77a6('0xc')](),controller[_0x77a6('0x10')]);router['post']('/',auth[_0x77a6('0xc')](),controller[_0x77a6('0x11')]);router[_0x77a6('0x12')]('/:id',auth[_0x77a6('0xc')](),controller[_0x77a6('0x13')]);router[_0x77a6('0x14')]('/:id',auth[_0x77a6('0xc')](),controller[_0x77a6('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5546=['put','/:id','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','describe','create'];(function(_0x838592,_0x318b56){var _0x9cf9d0=function(_0x3ccb27){while(--_0x3ccb27){_0x838592['push'](_0x838592['shift']());}};_0x9cf9d0(++_0x318b56);}(_0x5546,0x190));var _0x6554=function(_0x2791d0,_0x56f332){_0x2791d0=_0x2791d0-0x0;var _0x3344e0=_0x5546[_0x2791d0];return _0x3344e0;};'use strict';var multer=require('multer');var util=require(_0x6554('0x0'));var path=require(_0x6554('0x1'));var timeout=require('connect-timeout');var express=require(_0x6554('0x2'));var router=express[_0x6554('0x3')]();var fs_extra=require(_0x6554('0x4'));var auth=require(_0x6554('0x5'));var interaction=require(_0x6554('0x6'));var config=require(_0x6554('0x7'));var controller=require(_0x6554('0x8'));router['get']('/',auth[_0x6554('0x9')](),controller[_0x6554('0xa')]);router[_0x6554('0xb')]('/describe',auth[_0x6554('0x9')](),controller[_0x6554('0xc')]);router[_0x6554('0xb')]('/:id',auth[_0x6554('0x9')](),controller['show']);router['post']('/',auth[_0x6554('0x9')](),controller[_0x6554('0xd')]);router[_0x6554('0xe')](_0x6554('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6554('0x10')](_0x6554('0xf'),auth['isAuthenticated'](),controller[_0x6554('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 174d9c3..66db3b5 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 _0x4f7e=['moment','exports','ENUM','STRING','Yes'];(function(_0x5f250d,_0x43b12e){var _0x5ec51b=function(_0x52dc2e){while(--_0x52dc2e){_0x5f250d['push'](_0x5f250d['shift']());}};_0x5ec51b(++_0x43b12e);}(_0x4f7e,0x1a4));var _0xe4f7=function(_0x17519e,_0x4f3958){_0x17519e=_0x17519e-0x0;var _0x43bf69=_0x4f7e[_0x17519e];return _0x43bf69;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe4f7('0x0'));module[_0xe4f7('0x1')]={'type':{'type':Sequelize[_0xe4f7('0x2')]('blind','attended')},'result':{'type':Sequelize[_0xe4f7('0x3')]},'transfererchannel':{'type':Sequelize[_0xe4f7('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xe4f7('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xe4f7('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xe4f7('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe4f7('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xe4f7('0x3')]},'transfereecontext':{'type':Sequelize[_0xe4f7('0x3')]},'transfereeexten':{'type':Sequelize[_0xe4f7('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xe4f7('0x2')](_0xe4f7('0x4'),'No')},'context':{'type':Sequelize[_0xe4f7('0x3')]},'extension':{'type':Sequelize[_0xe4f7('0x3')]}}; \ No newline at end of file +var _0x3755=['ENUM','blind','STRING','Yes','sequelize','moment','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x3755,0x13f));var _0x5375=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3755[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x5375('0x0'));var moment=require(_0x5375('0x1'));module[_0x5375('0x2')]={'type':{'type':Sequelize[_0x5375('0x3')](_0x5375('0x4'),'attended')},'result':{'type':Sequelize[_0x5375('0x5')]},'transfererchannel':{'type':Sequelize[_0x5375('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x5375('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5375('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x5375('0x5')]},'transferercontext':{'type':Sequelize[_0x5375('0x5')]},'transfererexten':{'type':Sequelize[_0x5375('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x5375('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x5375('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5375('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5375('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x5375('0x5')]},'transfereecontext':{'type':Sequelize[_0x5375('0x5')]},'transfereeexten':{'type':Sequelize[_0x5375('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x5375('0x5')]},'isexternal':{'type':Sequelize[_0x5375('0x3')](_0x5375('0x6'),'No')},'context':{'type':Sequelize[_0x5375('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4b3ae65..08240bd 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 _0xce28=['../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','catch','show','params','filters','include','options','find','create','body','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xce28,0x1e9));var _0x8ce2=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xce28[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8ce2('0x0'));var jsonpatch=require(_0x8ce2('0x1'));var rp=require('request-promise');var moment=require(_0x8ce2('0x2'));var BPromise=require(_0x8ce2('0x3'));var Mustache=require('mustache');var util=require(_0x8ce2('0x4'));var path=require(_0x8ce2('0x5'));var sox=require('sox');var csv=require(_0x8ce2('0x6'));var ejs=require(_0x8ce2('0x7'));var fs=require('fs');var fs_extra=require(_0x8ce2('0x8'));var _=require(_0x8ce2('0x9'));var squel=require(_0x8ce2('0xa'));var crypto=require(_0x8ce2('0xb'));var jsforce=require(_0x8ce2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8ce2('0x6'));var querystring=require(_0x8ce2('0xd'));var Papa=require(_0x8ce2('0xe'));var Redis=require(_0x8ce2('0xf'));var authService=require(_0x8ce2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ce2('0x11'))(_0x8ce2('0x12'));var utils=require(_0x8ce2('0x13'));var config=require(_0x8ce2('0x14'));var licenseUtil=require(_0x8ce2('0x15'));var db=require(_0x8ce2('0x16'))['db'];function respondWithStatusCode(_0x50f22e,_0x26f040){_0x26f040=_0x26f040||0xcc;return function(_0x219a1b){if(_0x219a1b){return _0x50f22e[_0x8ce2('0x17')](_0x26f040);}return _0x50f22e['status'](_0x26f040)[_0x8ce2('0x18')]();};}function respondWithResult(_0x57a149,_0x406b6d){_0x406b6d=_0x406b6d||0xc8;return function(_0x5bb1d5){if(_0x5bb1d5){return _0x57a149['status'](_0x406b6d)['json'](_0x5bb1d5);}};}function respondWithFilteredResult(_0x33ab7,_0x2a98f3){return function(_0x27e9e4){if(_0x27e9e4){var _0x38515e=typeof _0x2a98f3[_0x8ce2('0x19')]==='undefined'&&typeof _0x2a98f3[_0x8ce2('0x1a')]===_0x8ce2('0x1b');var _0xe7b24f=_0x27e9e4['count'];var _0x1123e7=_0x38515e?0x0:_0x2a98f3[_0x8ce2('0x19')];var _0x56eca1=_0x38515e?_0x27e9e4[_0x8ce2('0x1c')]:_0x2a98f3['offset']+_0x2a98f3[_0x8ce2('0x1a')];var _0x5d7b3a;if(_0x56eca1>=_0xe7b24f){_0x56eca1=_0xe7b24f;_0x5d7b3a=0xc8;}else{_0x5d7b3a=0xce;}_0x33ab7[_0x8ce2('0x1d')](_0x5d7b3a);return _0x33ab7[_0x8ce2('0x1e')](_0x8ce2('0x1f'),_0x1123e7+'-'+_0x56eca1+'/'+_0xe7b24f)['json'](_0x27e9e4);}return null;};}function patchUpdates(_0x11aa7f){return function(_0x4b1338){try{jsonpatch[_0x8ce2('0x20')](_0x4b1338,_0x11aa7f,!![]);}catch(_0x58055d){return BPromise[_0x8ce2('0x21')](_0x58055d);}return _0x4b1338['save']();};}function saveUpdates(_0x31b3f2,_0x598bf1){return function(_0x984122){if(_0x984122){return _0x984122[_0x8ce2('0x22')](_0x31b3f2)[_0x8ce2('0x23')](function(_0x548086){return _0x548086;});}return null;};}function removeEntity(_0x10883a,_0x4860bf){return function(_0x342c58){if(_0x342c58){return _0x342c58[_0x8ce2('0x24')]()[_0x8ce2('0x23')](function(){_0x10883a[_0x8ce2('0x1d')](0xcc)[_0x8ce2('0x18')]();});}};}function handleEntityNotFound(_0x4eb4bb,_0x4b592f){return function(_0x1c3a41){if(!_0x1c3a41){_0x4eb4bb[_0x8ce2('0x17')](0x194);}return _0x1c3a41;};}function handleError(_0x39e1be,_0x463488){_0x463488=_0x463488||0x1f4;return function(_0x581445){logger[_0x8ce2('0x25')](_0x581445['stack']);if(_0x581445[_0x8ce2('0x26')]){delete _0x581445['name'];}_0x39e1be[_0x8ce2('0x1d')](_0x463488)[_0x8ce2('0x27')](_0x581445);};}exports[_0x8ce2('0x28')]=function(_0x57ed5c,_0x3331f3){var _0x5858c0={},_0x4b5bcc={},_0x3aa5a9={'count':0x0,'rows':[]};var _0x1b8d28=_['map'](db[_0x8ce2('0x29')][_0x8ce2('0x2a')],function(_0x31a82a){return{'name':_0x31a82a[_0x8ce2('0x2b')],'type':_0x31a82a[_0x8ce2('0x2c')][_0x8ce2('0x2d')]};});_0x4b5bcc['model']=_[_0x8ce2('0x2e')](_0x1b8d28,_0x8ce2('0x26'));_0x4b5bcc[_0x8ce2('0x2f')]=_[_0x8ce2('0x30')](_0x57ed5c[_0x8ce2('0x2f')]);_0x4b5bcc['filters']=_[_0x8ce2('0x31')](_0x4b5bcc['model'],_0x4b5bcc[_0x8ce2('0x2f')]);_0x5858c0[_0x8ce2('0x32')]=_[_0x8ce2('0x31')](_0x4b5bcc[_0x8ce2('0x33')],qs[_0x8ce2('0x34')](_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x34')]));_0x5858c0[_0x8ce2('0x32')]=_0x5858c0[_0x8ce2('0x32')][_0x8ce2('0x35')]?_0x5858c0[_0x8ce2('0x32')]:_0x4b5bcc['model'];if(!_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x36')](_0x8ce2('0x37'))){_0x5858c0[_0x8ce2('0x1a')]=qs[_0x8ce2('0x1a')](_0x57ed5c['query'][_0x8ce2('0x1a')]);_0x5858c0[_0x8ce2('0x19')]=qs['offset'](_0x57ed5c[_0x8ce2('0x2f')]['offset']);}_0x5858c0[_0x8ce2('0x38')]=qs[_0x8ce2('0x39')](_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x39')]);_0x5858c0[_0x8ce2('0x3a')]=qs['filters'](_['pick'](_0x57ed5c[_0x8ce2('0x2f')],_0x4b5bcc['filters']),_0x1b8d28);if(_0x57ed5c[_0x8ce2('0x2f')]['filter']){_0x5858c0[_0x8ce2('0x3a')]=_[_0x8ce2('0x3b')](_0x5858c0[_0x8ce2('0x3a')],{'$or':_[_0x8ce2('0x2e')](_0x1b8d28,function(_0x140b81){if(_0x140b81[_0x8ce2('0x2c')]!==_0x8ce2('0x3c')){var _0xb8ec3e={};_0xb8ec3e[_0x140b81[_0x8ce2('0x26')]]={'$like':'%'+_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x3d')]+'%'};return _0xb8ec3e;}})});}_0x5858c0=_['merge']({},_0x5858c0,_0x57ed5c['options']);var _0x439845={'where':_0x5858c0[_0x8ce2('0x3a')]};return db[_0x8ce2('0x29')][_0x8ce2('0x1c')](_0x439845)[_0x8ce2('0x23')](function(_0x166b1a){_0x3aa5a9['count']=_0x166b1a;if(_0x57ed5c[_0x8ce2('0x2f')][_0x8ce2('0x3e')]){_0x5858c0['include']=[{'all':!![]}];}return db[_0x8ce2('0x29')][_0x8ce2('0x3f')](_0x5858c0);})[_0x8ce2('0x23')](function(_0x55d58f){_0x3aa5a9['rows']=_0x55d58f;return _0x3aa5a9;})[_0x8ce2('0x23')](respondWithFilteredResult(_0x3331f3,_0x5858c0))[_0x8ce2('0x40')](handleError(_0x3331f3,null));};exports[_0x8ce2('0x41')]=function(_0x51a0aa,_0x39df57){var _0x241784={'raw':!![],'where':{'id':_0x51a0aa[_0x8ce2('0x42')]['id']}},_0x166de3={};_0x166de3[_0x8ce2('0x33')]=_[_0x8ce2('0x30')](db['VoiceTransferReport'][_0x8ce2('0x2a')]);_0x166de3[_0x8ce2('0x2f')]=_[_0x8ce2('0x30')](_0x51a0aa[_0x8ce2('0x2f')]);_0x166de3[_0x8ce2('0x43')]=_[_0x8ce2('0x31')](_0x166de3['model'],_0x166de3[_0x8ce2('0x2f')]);_0x241784['attributes']=_[_0x8ce2('0x31')](_0x166de3['model'],qs[_0x8ce2('0x34')](_0x51a0aa[_0x8ce2('0x2f')]['fields']));_0x241784[_0x8ce2('0x32')]=_0x241784[_0x8ce2('0x32')][_0x8ce2('0x35')]?_0x241784[_0x8ce2('0x32')]:_0x166de3[_0x8ce2('0x33')];if(_0x51a0aa[_0x8ce2('0x2f')][_0x8ce2('0x3e')]){_0x241784[_0x8ce2('0x44')]=[{'all':!![]}];}_0x241784=_['merge']({},_0x241784,_0x51a0aa[_0x8ce2('0x45')]);return db['VoiceTransferReport'][_0x8ce2('0x46')](_0x241784)['then'](handleEntityNotFound(_0x39df57,null))[_0x8ce2('0x23')](respondWithResult(_0x39df57,null))[_0x8ce2('0x40')](handleError(_0x39df57,null));};exports['create']=function(_0x242c39,_0x2831e9){return db[_0x8ce2('0x29')][_0x8ce2('0x47')](_0x242c39[_0x8ce2('0x48')],{})[_0x8ce2('0x23')](respondWithResult(_0x2831e9,0xc9))['catch'](handleError(_0x2831e9,null));};exports[_0x8ce2('0x22')]=function(_0x428714,_0xe155b3){if(_0x428714[_0x8ce2('0x48')]['id']){delete _0x428714[_0x8ce2('0x48')]['id'];}return db[_0x8ce2('0x29')][_0x8ce2('0x46')]({'where':{'id':_0x428714[_0x8ce2('0x42')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0xe155b3,null))['then'](saveUpdates(_0x428714[_0x8ce2('0x48')],null))[_0x8ce2('0x23')](respondWithResult(_0xe155b3,null))['catch'](handleError(_0xe155b3,null));};exports[_0x8ce2('0x24')]=function(_0x2d1f9d,_0x15c8a3){return db[_0x8ce2('0x29')][_0x8ce2('0x46')]({'where':{'id':_0x2d1f9d[_0x8ce2('0x42')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x15c8a3,null))[_0x8ce2('0x23')](removeEntity(_0x15c8a3,null))[_0x8ce2('0x40')](handleError(_0x15c8a3,null));};exports['describe']=function(_0x5e9911,_0x21b324){return db[_0x8ce2('0x29')]['describe']()[_0x8ce2('0x23')](respondWithResult(_0x21b324,null))[_0x8ce2('0x40')](handleError(_0x21b324,null));}; \ No newline at end of file +var _0x1c12=['set','Content-Range','apply','destroy','then','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count'];(function(_0x44e9b0,_0x3a2756){var _0xbc822f=function(_0xb098f9){while(--_0xb098f9){_0x44e9b0['push'](_0x44e9b0['shift']());}};_0xbc822f(++_0x3a2756);}(_0x1c12,0x7c));var _0x21c1=function(_0x5807cc,_0x2e9f79){_0x5807cc=_0x5807cc-0x0;var _0x132a22=_0x1c12[_0x5807cc];return _0x132a22;};'use strict';var emlformat=require(_0x21c1('0x0'));var rimraf=require(_0x21c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21c1('0x2'));var rp=require(_0x21c1('0x3'));var moment=require('moment');var BPromise=require(_0x21c1('0x4'));var Mustache=require(_0x21c1('0x5'));var util=require(_0x21c1('0x6'));var path=require(_0x21c1('0x7'));var sox=require('sox');var csv=require(_0x21c1('0x8'));var ejs=require(_0x21c1('0x9'));var fs=require('fs');var fs_extra=require(_0x21c1('0xa'));var _=require(_0x21c1('0xb'));var squel=require(_0x21c1('0xc'));var crypto=require(_0x21c1('0xd'));var jsforce=require(_0x21c1('0xe'));var deskjs=require(_0x21c1('0xf'));var toCsv=require(_0x21c1('0x8'));var querystring=require(_0x21c1('0x10'));var Papa=require(_0x21c1('0x11'));var Redis=require(_0x21c1('0x12'));var authService=require(_0x21c1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21c1('0x14'));var logger=require(_0x21c1('0x15'))(_0x21c1('0x16'));var utils=require(_0x21c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x21c1('0x18'));var db=require(_0x21c1('0x19'))['db'];function respondWithStatusCode(_0xda2578,_0x3826d0){_0x3826d0=_0x3826d0||0xcc;return function(_0x11398c){if(_0x11398c){return _0xda2578['sendStatus'](_0x3826d0);}return _0xda2578['status'](_0x3826d0)[_0x21c1('0x1a')]();};}function respondWithResult(_0x2d24b8,_0x4b6d17){_0x4b6d17=_0x4b6d17||0xc8;return function(_0x3a027f){if(_0x3a027f){return _0x2d24b8[_0x21c1('0x1b')](_0x4b6d17)[_0x21c1('0x1c')](_0x3a027f);}};}function respondWithFilteredResult(_0x7cf76e,_0x3dd87d){return function(_0x1778d8){if(_0x1778d8){var _0x42f0d1=typeof _0x3dd87d[_0x21c1('0x1d')]==='undefined'&&typeof _0x3dd87d[_0x21c1('0x1e')]==='undefined';var _0x3c42ab=_0x1778d8[_0x21c1('0x1f')];var _0x42c390=_0x42f0d1?0x0:_0x3dd87d[_0x21c1('0x1d')];var _0x2fbf24=_0x42f0d1?_0x1778d8[_0x21c1('0x1f')]:_0x3dd87d['offset']+_0x3dd87d['limit'];var _0x48c4a4;if(_0x2fbf24>=_0x3c42ab){_0x2fbf24=_0x3c42ab;_0x48c4a4=0xc8;}else{_0x48c4a4=0xce;}_0x7cf76e[_0x21c1('0x1b')](_0x48c4a4);return _0x7cf76e[_0x21c1('0x20')](_0x21c1('0x21'),_0x42c390+'-'+_0x2fbf24+'/'+_0x3c42ab)[_0x21c1('0x1c')](_0x1778d8);}return null;};}function patchUpdates(_0x11c152){return function(_0x420830){try{jsonpatch[_0x21c1('0x22')](_0x420830,_0x11c152,!![]);}catch(_0x16b00d){return BPromise['reject'](_0x16b00d);}return _0x420830['save']();};}function saveUpdates(_0x1dee96,_0x28747e){return function(_0x13ed61){if(_0x13ed61){return _0x13ed61['update'](_0x1dee96)['then'](function(_0x3477e0){return _0x3477e0;});}return null;};}function removeEntity(_0x527711,_0x110202){return function(_0x10cee6){if(_0x10cee6){return _0x10cee6[_0x21c1('0x23')]()[_0x21c1('0x24')](function(){_0x527711['status'](0xcc)[_0x21c1('0x1a')]();});}};}function handleEntityNotFound(_0x2ea3d5,_0xcf1b3e){return function(_0x2c6846){if(!_0x2c6846){_0x2ea3d5[_0x21c1('0x25')](0x194);}return _0x2c6846;};}function handleError(_0x483909,_0x42b3b4){_0x42b3b4=_0x42b3b4||0x1f4;return function(_0x3967aa){logger[_0x21c1('0x26')](_0x3967aa[_0x21c1('0x27')]);if(_0x3967aa[_0x21c1('0x28')]){delete _0x3967aa[_0x21c1('0x28')];}_0x483909[_0x21c1('0x1b')](_0x42b3b4)[_0x21c1('0x29')](_0x3967aa);};}exports[_0x21c1('0x2a')]=function(_0x53a0be,_0x3bec20){var _0x2e3b5f={},_0x395d91={},_0x1a132e={'count':0x0,'rows':[]};var _0x12cf52=_[_0x21c1('0x2b')](db[_0x21c1('0x2c')][_0x21c1('0x2d')],function(_0xbc2b14){return{'name':_0xbc2b14[_0x21c1('0x2e')],'type':_0xbc2b14[_0x21c1('0x2f')][_0x21c1('0x30')]};});_0x395d91[_0x21c1('0x31')]=_[_0x21c1('0x2b')](_0x12cf52,_0x21c1('0x28'));_0x395d91[_0x21c1('0x32')]=_['keys'](_0x53a0be['query']);_0x395d91[_0x21c1('0x33')]=_[_0x21c1('0x34')](_0x395d91[_0x21c1('0x31')],_0x395d91[_0x21c1('0x32')]);_0x2e3b5f['attributes']=_[_0x21c1('0x34')](_0x395d91[_0x21c1('0x31')],qs[_0x21c1('0x35')](_0x53a0be['query'][_0x21c1('0x35')]));_0x2e3b5f[_0x21c1('0x36')]=_0x2e3b5f[_0x21c1('0x36')]['length']?_0x2e3b5f[_0x21c1('0x36')]:_0x395d91[_0x21c1('0x31')];if(!_0x53a0be[_0x21c1('0x32')][_0x21c1('0x37')](_0x21c1('0x38'))){_0x2e3b5f[_0x21c1('0x1e')]=qs['limit'](_0x53a0be['query'][_0x21c1('0x1e')]);_0x2e3b5f[_0x21c1('0x1d')]=qs[_0x21c1('0x1d')](_0x53a0be[_0x21c1('0x32')][_0x21c1('0x1d')]);}_0x2e3b5f[_0x21c1('0x39')]=qs[_0x21c1('0x3a')](_0x53a0be[_0x21c1('0x32')][_0x21c1('0x3a')]);_0x2e3b5f[_0x21c1('0x3b')]=qs[_0x21c1('0x33')](_[_0x21c1('0x3c')](_0x53a0be[_0x21c1('0x32')],_0x395d91[_0x21c1('0x33')]),_0x12cf52);if(_0x53a0be[_0x21c1('0x32')][_0x21c1('0x3d')]){_0x2e3b5f[_0x21c1('0x3b')]=_[_0x21c1('0x3e')](_0x2e3b5f[_0x21c1('0x3b')],{'$or':_[_0x21c1('0x2b')](_0x12cf52,function(_0x4b3d11){if(_0x4b3d11[_0x21c1('0x2f')]!==_0x21c1('0x3f')){var _0x3756e9={};_0x3756e9[_0x4b3d11[_0x21c1('0x28')]]={'$like':'%'+_0x53a0be[_0x21c1('0x32')][_0x21c1('0x3d')]+'%'};return _0x3756e9;}})});}_0x2e3b5f=_[_0x21c1('0x3e')]({},_0x2e3b5f,_0x53a0be['options']);var _0x556847={'where':_0x2e3b5f[_0x21c1('0x3b')]};return db[_0x21c1('0x2c')][_0x21c1('0x1f')](_0x556847)[_0x21c1('0x24')](function(_0x16e89a){_0x1a132e['count']=_0x16e89a;if(_0x53a0be['query'][_0x21c1('0x40')]){_0x2e3b5f['include']=[{'all':!![]}];}return db[_0x21c1('0x2c')][_0x21c1('0x41')](_0x2e3b5f);})[_0x21c1('0x24')](function(_0x2a9d91){_0x1a132e[_0x21c1('0x42')]=_0x2a9d91;return _0x1a132e;})[_0x21c1('0x24')](respondWithFilteredResult(_0x3bec20,_0x2e3b5f))[_0x21c1('0x43')](handleError(_0x3bec20,null));};exports[_0x21c1('0x44')]=function(_0x38e931,_0x2563bf){var _0x5246b7={'raw':!![],'where':{'id':_0x38e931[_0x21c1('0x45')]['id']}},_0x3bb5a8={};_0x3bb5a8[_0x21c1('0x31')]=_['keys'](db[_0x21c1('0x2c')][_0x21c1('0x2d')]);_0x3bb5a8[_0x21c1('0x32')]=_['keys'](_0x38e931[_0x21c1('0x32')]);_0x3bb5a8[_0x21c1('0x33')]=_[_0x21c1('0x34')](_0x3bb5a8[_0x21c1('0x31')],_0x3bb5a8[_0x21c1('0x32')]);_0x5246b7['attributes']=_[_0x21c1('0x34')](_0x3bb5a8[_0x21c1('0x31')],qs['fields'](_0x38e931[_0x21c1('0x32')][_0x21c1('0x35')]));_0x5246b7[_0x21c1('0x36')]=_0x5246b7[_0x21c1('0x36')][_0x21c1('0x46')]?_0x5246b7[_0x21c1('0x36')]:_0x3bb5a8[_0x21c1('0x31')];if(_0x38e931[_0x21c1('0x32')][_0x21c1('0x40')]){_0x5246b7[_0x21c1('0x47')]=[{'all':!![]}];}_0x5246b7=_[_0x21c1('0x3e')]({},_0x5246b7,_0x38e931[_0x21c1('0x48')]);return db['VoiceTransferReport'][_0x21c1('0x49')](_0x5246b7)['then'](handleEntityNotFound(_0x2563bf,null))[_0x21c1('0x24')](respondWithResult(_0x2563bf,null))[_0x21c1('0x43')](handleError(_0x2563bf,null));};exports[_0x21c1('0x4a')]=function(_0xb14f83,_0x1feb16){return db[_0x21c1('0x2c')][_0x21c1('0x4a')](_0xb14f83[_0x21c1('0x4b')],{})['then'](respondWithResult(_0x1feb16,0xc9))[_0x21c1('0x43')](handleError(_0x1feb16,null));};exports[_0x21c1('0x4c')]=function(_0xaacf68,_0x13a109){if(_0xaacf68[_0x21c1('0x4b')]['id']){delete _0xaacf68[_0x21c1('0x4b')]['id'];}return db[_0x21c1('0x2c')][_0x21c1('0x49')]({'where':{'id':_0xaacf68['params']['id']}})['then'](handleEntityNotFound(_0x13a109,null))[_0x21c1('0x24')](saveUpdates(_0xaacf68[_0x21c1('0x4b')],null))[_0x21c1('0x24')](respondWithResult(_0x13a109,null))['catch'](handleError(_0x13a109,null));};exports[_0x21c1('0x23')]=function(_0x4a25c3,_0x3cdba4){return db['VoiceTransferReport']['find']({'where':{'id':_0x4a25c3[_0x21c1('0x45')]['id']}})[_0x21c1('0x24')](handleEntityNotFound(_0x3cdba4,null))[_0x21c1('0x24')](removeEntity(_0x3cdba4,null))[_0x21c1('0x43')](handleError(_0x3cdba4,null));};exports[_0x21c1('0x4d')]=function(_0x5a64c7,_0x43c4b2){return db[_0x21c1('0x2c')]['describe']()[_0x21c1('0x24')](respondWithResult(_0x43c4b2,null))[_0x21c1('0x43')](handleError(_0x43c4b2,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 81fdb88..7f0d56a 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 _0xb340=['moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x40d548,_0x233d52){var _0x1791f8=function(_0x526c95){while(--_0x526c95){_0x40d548['push'](_0x40d548['shift']());}};_0x1791f8(++_0x233d52);}(_0xb340,0xc0));var _0x0b34=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb340[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x0b34('0x0'));var util=require(_0x0b34('0x1'));var logger=require(_0x0b34('0x2'))(_0x0b34('0x3'));var moment=require(_0x0b34('0x4'));var BPromise=require(_0x0b34('0x5'));var rp=require(_0x0b34('0x6'));var fs=require('fs');var path=require(_0x0b34('0x7'));var rimraf=require('rimraf');var config=require(_0x0b34('0x8'));var attributes=require(_0x0b34('0x9'));module[_0x0b34('0xa')]=function(_0x186061,_0x3e744f){return _0x186061[_0x0b34('0xb')](_0x0b34('0xc'),attributes,{'tableName':_0x0b34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2a=['rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','request-promise','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5f2a,0x66));var _0xa5f2=function(_0x3e3c1b,_0x385068){_0x3e3c1b=_0x3e3c1b-0x0;var _0x553a59=_0x5f2a[_0x3e3c1b];return _0x553a59;};'use strict';var _=require('lodash');var util=require(_0xa5f2('0x0'));var logger=require(_0xa5f2('0x1'))(_0xa5f2('0x2'));var moment=require(_0xa5f2('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5f2('0x4'));var fs=require('fs');var path=require(_0xa5f2('0x5'));var rimraf=require(_0xa5f2('0x6'));var config=require('../../config/environment');var attributes=require(_0xa5f2('0x7'));module[_0xa5f2('0x8')]=function(_0x116f26,_0x4e5b1c){return _0x116f26[_0xa5f2('0x9')](_0xa5f2('0xa'),attributes,{'tableName':_0xa5f2('0xb'),'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 73fb877..f474ad5 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 _0xaffb=['code','message','result','CreateVoiceTransferReport','create','body','options','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xa0419b,_0x5945d7){var _0x206ec1=function(_0x35ca2d){while(--_0x35ca2d){_0xa0419b['push'](_0xa0419b['shift']());}};_0x206ec1(++_0x5945d7);}(_0xaffb,0x1c3));var _0xbaff=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xaffb[_0x39c734];return _0xb2a2f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbaff('0x0'));var BPromise=require(_0xbaff('0x1'));var rs=require(_0xbaff('0x2'));var fs=require('fs');var Redis=require(_0xbaff('0x3'));var db=require(_0xbaff('0x4'))['db'];var utils=require(_0xbaff('0x5'));var logger=require('../../config/logger')(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var jayson=require(_0xbaff('0x8'));var client=jayson[_0xbaff('0x9')][_0xbaff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26edd7,_0x1f84a7,_0x386c5c){return new BPromise(function(_0x57afce,_0x50f975){return client['request'](_0x26edd7,_0x386c5c)['then'](function(_0x4d7e1e){logger[_0xbaff('0xb')](_0xbaff('0xc'),_0x1f84a7,_0xbaff('0xd'));logger[_0xbaff('0xe')](_0xbaff('0xf'),_0x1f84a7,_0xbaff('0xd'),JSON['stringify'](_0x4d7e1e));if(_0x4d7e1e[_0xbaff('0x10')]){if(_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x11')]===0x1f4){logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x4d7e1e['error'][_0xbaff('0x12')]);return _0x50f975(_0x4d7e1e[_0xbaff('0x10')]['message']);}logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x12')]);return _0x57afce(_0x4d7e1e[_0xbaff('0x10')][_0xbaff('0x12')]);}else{logger[_0xbaff('0xb')](_0xbaff('0xc'),_0x1f84a7,_0xbaff('0xd'));_0x57afce(_0x4d7e1e[_0xbaff('0x13')][_0xbaff('0x12')]);}})['catch'](function(_0x104468){logger[_0xbaff('0x10')](_0xbaff('0xc'),_0x1f84a7,_0x104468);_0x50f975(_0x104468);});});}exports[_0xbaff('0x14')]=function(_0x335935){var _0x4de641=this;return new Promise(function(_0x9120f2,_0x31e8c7){return db['VoiceTransferReport'][_0xbaff('0x15')](_0x335935[_0xbaff('0x16')],{'raw':_0x335935[_0xbaff('0x17')]?_0x335935[_0xbaff('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbaff('0x18')](function(_0x53dd60){logger['info'](_0xbaff('0x14'),_0x335935);logger[_0xbaff('0xe')](_0xbaff('0x14'),_0x335935,JSON['stringify'](_0x53dd60));_0x9120f2(_0x53dd60);})[_0xbaff('0x19')](function(_0x2ce774){logger[_0xbaff('0x10')](_0xbaff('0x14'),_0x2ce774[_0xbaff('0x12')],_0x335935);_0x31e8c7(_0x4de641[_0xbaff('0x10')](0x1f4,_0x2ce774['message']));});});}; \ No newline at end of file +var _0x68ec=['http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x68ec,0x199));var _0xc68e=function(_0x7880d2,_0x32e7d6){_0x7880d2=_0x7880d2-0x0;var _0x35ebbe=_0x68ec[_0x7880d2];return _0x35ebbe;};'use strict';var _=require('lodash');var util=require(_0xc68e('0x0'));var moment=require(_0xc68e('0x1'));var BPromise=require(_0xc68e('0x2'));var rs=require(_0xc68e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc68e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc68e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc68e('0x6')][_0xc68e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58bc89,_0x4b60cb,_0x45ee9a){return new BPromise(function(_0x22ffa5,_0x2d4403){return client[_0xc68e('0x8')](_0x58bc89,_0x45ee9a)['then'](function(_0x1a5189){logger['info'](_0xc68e('0x9'),_0x4b60cb,_0xc68e('0xa'));logger['debug'](_0xc68e('0xb'),_0x4b60cb,_0xc68e('0xa'),JSON[_0xc68e('0xc')](_0x1a5189));if(_0x1a5189[_0xc68e('0xd')]){if(_0x1a5189[_0xc68e('0xd')][_0xc68e('0xe')]===0x1f4){logger[_0xc68e('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b60cb,_0x1a5189[_0xc68e('0xd')]['message']);return _0x2d4403(_0x1a5189[_0xc68e('0xd')]['message']);}logger[_0xc68e('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b60cb,_0x1a5189[_0xc68e('0xd')]['message']);return _0x22ffa5(_0x1a5189[_0xc68e('0xd')][_0xc68e('0xf')]);}else{logger[_0xc68e('0x10')](_0xc68e('0x9'),_0x4b60cb,_0xc68e('0xa'));_0x22ffa5(_0x1a5189[_0xc68e('0x11')]['message']);}})[_0xc68e('0x12')](function(_0x14a770){logger[_0xc68e('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b60cb,_0x14a770);_0x2d4403(_0x14a770);});});}exports[_0xc68e('0x13')]=function(_0x38de54){var _0x4312c2=this;return new Promise(function(_0x45015d,_0x28cdfe){return db[_0xc68e('0x14')][_0xc68e('0x15')](_0x38de54[_0xc68e('0x16')],{'raw':_0x38de54[_0xc68e('0x17')]?_0x38de54[_0xc68e('0x17')][_0xc68e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x59b045){logger[_0xc68e('0x10')](_0xc68e('0x13'),_0x38de54);logger[_0xc68e('0x19')]('CreateVoiceTransferReport',_0x38de54,JSON[_0xc68e('0xc')](_0x59b045));_0x45015d(_0x59b045);})[_0xc68e('0x12')](function(_0x201db5){logger[_0xc68e('0xd')](_0xc68e('0x13'),_0x201db5[_0xc68e('0xf')],_0x38de54);_0x28cdfe(_0x4312c2[_0xc68e('0xd')](0x1f4,_0x201db5['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 04247b7..2a880b3 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 _0x5d29=['answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup'];(function(_0x4750a4,_0x2af3a2){var _0x2be305=function(_0x27815d){while(--_0x27815d){_0x4750a4['push'](_0x4750a4['shift']());}};_0x2be305(++_0x2af3a2);}(_0x5d29,0x15e));var _0x95d2=function(_0x595b48,_0x1195c3){_0x595b48=_0x595b48-0x0;var _0x5a982c=_0x5d29[_0x595b48];return _0x5a982c;};'use strict';var express=require('express');var router=express[_0x95d2('0x0')]();var auth=require(_0x95d2('0x1'));var controller=require(_0x95d2('0x2'));router[_0x95d2('0x3')](_0x95d2('0x4'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x7')]);router[_0x95d2('0x3')](_0x95d2('0x8'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x9')]);router[_0x95d2('0x3')]('/answer',auth[_0x95d2('0x5')](),auth['canUpdate'](),controller[_0x95d2('0xa')]);router[_0x95d2('0x3')](_0x95d2('0xb'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0xc')]);router[_0x95d2('0x3')](_0x95d2('0xd'),auth['isAuthenticated'](),auth[_0x95d2('0x6')](),controller[_0x95d2('0xe')]);router['post'](_0x95d2('0xf'),auth[_0x95d2('0x5')](),auth[_0x95d2('0x6')](),controller[_0x95d2('0x10')]);router[_0x95d2('0x3')](_0x95d2('0x11'),auth[_0x95d2('0x5')](),auth['canUpdate'](),controller[_0x95d2('0x12')]);module[_0x95d2('0x13')]=router; \ No newline at end of file +var _0x5fce=['unhold','/calls','calls','transfer','exports','express','./webbar.controller','post','/originate','canUpdate','/hangup','isAuthenticated','/answer','answer','/hold','hold'];(function(_0x3c9626,_0x2bf37e){var _0x5c001f=function(_0x3f0691){while(--_0x3f0691){_0x3c9626['push'](_0x3c9626['shift']());}};_0x5c001f(++_0x2bf37e);}(_0x5fce,0xd5));var _0xe5fc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5fce[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xe5fc('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe5fc('0x1'));router[_0xe5fc('0x2')](_0xe5fc('0x3'),auth['isAuthenticated'](),auth[_0xe5fc('0x4')](),controller['originate']);router['post'](_0xe5fc('0x5'),auth[_0xe5fc('0x6')](),auth[_0xe5fc('0x4')](),controller['hangup']);router[_0xe5fc('0x2')](_0xe5fc('0x7'),auth[_0xe5fc('0x6')](),auth[_0xe5fc('0x4')](),controller[_0xe5fc('0x8')]);router['post'](_0xe5fc('0x9'),auth[_0xe5fc('0x6')](),auth['canUpdate'](),controller[_0xe5fc('0xa')]);router['post']('/unhold',auth[_0xe5fc('0x6')](),auth[_0xe5fc('0x4')](),controller[_0xe5fc('0xb')]);router[_0xe5fc('0x2')](_0xe5fc('0xc'),auth[_0xe5fc('0x6')](),auth[_0xe5fc('0x4')](),controller[_0xe5fc('0xd')]);router['post']('/transfer',auth['isAuthenticated'](),auth[_0xe5fc('0x4')](),controller[_0xe5fc('0xe')]);module[_0xe5fc('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 36aafdf..67215cb 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd382=['stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','all','filter','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','defaults','redis','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:'];(function(_0x40dc14,_0x391bdd){var _0x32ff3d=function(_0x375b2e){while(--_0x375b2e){_0x40dc14['push'](_0x40dc14['shift']());}};_0x32ff3d(++_0x391bdd);}(_0xd382,0x1b6));var _0x2d38=function(_0x2b8388,_0x525486){_0x2b8388=_0x2b8388-0x0;var _0x5a1c07=_0xd382[_0x2b8388];return _0x5a1c07;};'use strict';var path=require(_0x2d38('0x0'));var fs=require('fs');var _=require(_0x2d38('0x1'));var db=require(_0x2d38('0x2'))['db'];var config=require(_0x2d38('0x3'));var util=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var jayson=require(_0x2d38('0x6'));var amiClient=jayson[_0x2d38('0x7')][_0x2d38('0x8')]({'port':0x232a});var logger=require(_0x2d38('0x9'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0x2d38('0xa')](config[_0x2d38('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x2d38('0xc'))(new Redis(config[_0x2d38('0xb')]));var Schema=require(_0x2d38('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0xf')]},'callerId':{'type':_0x2d38('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2d38('0xe'),'required':[!![],_0x2d38('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2d38('0x11')]},'sessionId':{'type':_0x2d38('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2d38('0x10'),'required':[!![],_0x2d38('0x11')]}});function emit(_0xc6de5a,_0x2d3cb1,_0xc17f9e){logger[_0x2d38('0x13')](_0xc6de5a,_0x2d3cb1,JSON[_0x2d38('0x14')](_0xc17f9e));io['to'](_0xc6de5a)[_0x2d38('0x15')](_0x2d3cb1,_0xc17f9e);}function handleError(_0x31a29e){return function(_0x1e3028){console[_0x2d38('0x16')](_0x2d38('0x17'),_0x1e3028,_0x1e3028 instanceof RangeError);logger['error'](_0x1e3028[_0x2d38('0x18')]);if(_0x1e3028 instanceof RangeError){if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x194)[_0x2d38('0x1b')](_0x1e3028);}else{if(_0x1e3028[_0x2d38('0x19')]){delete _0x1e3028['name'];}_0x31a29e[_0x2d38('0x1a')](0x1f4)['send'](_0x1e3028);}};}function checkError(){return function(_0x4bdac6){if(!_0x4bdac6){throw new RangeError(_0x2d38('0x1c'));}return _0x4bdac6;};}function respondWithRpcPromise(_0x2e0b73,_0x3713ea){return new BPromise(function(_0x3892a5,_0x19e658){var _0x3138bc=amiClient;return _0x3138bc[_0x2d38('0x1d')](_0x2e0b73,_0x3713ea)[_0x2d38('0x1e')](function(_0x24e2cb){if(_0x24e2cb[_0x2d38('0x1f')]){if(_0x24e2cb['error'][_0x2d38('0x20')]===0x1f4){return _0x19e658(_0x24e2cb['error'][_0x2d38('0x21')]);}return _0x3892a5(_0x24e2cb['error'][_0x2d38('0x21')]);}else{_0x3892a5(_0x24e2cb[_0x2d38('0x22')]);}})[_0x2d38('0x23')](function(_0x10e283){_0x19e658(_0x10e283);});});}function getAgent(_0xffa3ce){return db[_0x2d38('0x24')][_0x2d38('0x25')]({'where':{'id':_0xffa3ce,'role':'agent'}})[_0x2d38('0x1e')](checkError());}function getAgentCheckSession(_0x3f0f7a,_0x34599a){return new BPromise(function(_0x3d18cd,_0x346934){var _0xe73710=respondWithRpcPromise(_0x2d38('0x26'));var _0x3a6437=getAgent(_0x3f0f7a);Promise['all']([_0xe73710,_0x3a6437])['then'](function(_0x5570c2){var _0x31d427=_0x5570c2[0x0];var _0xbd364b=_0x5570c2[0x1];var _0xd333fe=_['filter'](_0x31d427[_0x2d38('0x27')],function(_0x4b5891){return _0x4b5891[_0x2d38('0x28')]==_0xbd364b['id']&&_0x4b5891[_0x2d38('0x29')]==_0x34599a;});if(_0xd333fe[_0x2d38('0x2a')]==0x1){_0x3d18cd(_0xbd364b);}else{_0x346934(new RangeError('sessionId\x20'+_0x34599a+_0x2d38('0x2b')));}});});}exports[_0x2d38('0x2c')]=function(_0x389e74,_0x52a3ce){logger[_0x2d38('0x13')](_0x2d38('0x2d'),_0x389e74[_0x2d38('0x2e')]);var _0x1b48a9=originateValidation[_0x2d38('0xd')](_0x389e74[_0x2d38('0x2e')]);if(_0x1b48a9['length']>0x0){return _0x52a3ce[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x1b48a9);}var _0xa9bf8c=_0x389e74[_0x2d38('0x2e')]['userId'];var _0x21c943=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x30')];var _0x46c154=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x31')];var _0x2f2549=_0x389e74[_0x2d38('0x2e')][_0x2d38('0x32')];return getAgent(_0xa9bf8c)[_0x2d38('0x1e')](function(_0x5b8ae7){logger['info'](_0x2d38('0x33'),_0x5b8ae7[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x5b8ae7[_0x2d38('0x19')]),_0x2d38('0x36'),{'callNumber':_0x21c943,'callerId':_0x46c154,'callbackUrl':_0x2f2549});return _0x52a3ce[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x37')});})[_0x2d38('0x23')](handleError(_0x52a3ce));};exports[_0x2d38('0x38')]=function(_0x29dda7,_0x11f5b8){logger['info'](_0x2d38('0x39'),_0x29dda7[_0x2d38('0x2e')]);var _0x30b318=hangupValidation[_0x2d38('0xd')](_0x29dda7['body']);if(_0x30b318[_0x2d38('0x2a')]>0x0){return _0x11f5b8[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x30b318);}var _0x11e58c=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x971848=_0x29dda7[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x11e58c)[_0x2d38('0x1e')](function(_0x3cd072){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x3cd072[_0x2d38('0x19')]);emit(util['format'](_0x2d38('0x35'),_0x3cd072[_0x2d38('0x19')]),'webbar:hangup',{'sessionId':_0x971848});return _0x11f5b8['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3b')});})[_0x2d38('0x23')](handleError(_0x11f5b8));};exports['answer']=function(_0x6108f1,_0x17cc8d){logger[_0x2d38('0x13')]('answer\x20fired:',_0x6108f1['body']);var _0x2eeca7=answerValidation['validate'](_0x6108f1[_0x2d38('0x2e')]);if(_0x2eeca7[_0x2d38('0x2a')]>0x0){return _0x17cc8d[_0x2d38('0x1a')](0x190)['json'](_0x2eeca7);}var _0x50cb25=_0x6108f1[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x306d6d=_0x6108f1['body'][_0x2d38('0x29')];return getAgent(_0x50cb25)[_0x2d38('0x1e')](function(_0x94f76b){logger['info'](_0x2d38('0x33'),_0x94f76b[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x94f76b['name']),_0x2d38('0x3c'),{'sessionId':_0x306d6d});return _0x17cc8d[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x3d')});})['catch'](handleError(_0x17cc8d));};exports[_0x2d38('0x3e')]=function(_0x26d0b0,_0xd2df89){logger['info'](_0x2d38('0x3f'),_0x26d0b0['body']);var _0x580d04=holdValidation[_0x2d38('0xd')](_0x26d0b0[_0x2d38('0x2e')]);if(_0x580d04[_0x2d38('0x2a')]>0x0){return _0xd2df89[_0x2d38('0x1a')](0x190)['json'](_0x580d04);}var _0x4c4c95=_0x26d0b0[_0x2d38('0x2e')]['userId'];var _0x9c67cb=_0x26d0b0[_0x2d38('0x2e')][_0x2d38('0x29')];return getAgent(_0x4c4c95)[_0x2d38('0x1e')](function(_0x35a2ae){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x35a2ae[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')]('user:%s',_0x35a2ae[_0x2d38('0x19')]),'webbar:hold',{'sessionId':_0x9c67cb});return _0xd2df89[_0x2d38('0x1a')](0xc8)[_0x2d38('0x2f')]({'error':![],'message':'hold\x20executed!'});})[_0x2d38('0x23')](handleError(_0xd2df89));};exports[_0x2d38('0x40')]=function(_0x187ba3,_0x3c2756){logger[_0x2d38('0x13')](_0x2d38('0x41'),_0x187ba3[_0x2d38('0x2e')]);var _0x360804=unholdValidation['validate'](_0x187ba3[_0x2d38('0x2e')]);if(_0x360804[_0x2d38('0x2a')]>0x0){return _0x3c2756[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x360804);}var _0x389982=_0x187ba3[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x358e2b=_0x187ba3[_0x2d38('0x2e')]['sessionId'];return getAgent(_0x389982)[_0x2d38('0x1e')](function(_0x1f92c2){logger['info']('entityFound:',_0x1f92c2[_0x2d38('0x19')]);emit(util[_0x2d38('0x34')](_0x2d38('0x35'),_0x1f92c2[_0x2d38('0x19')]),'webbar:unhold',{'sessionId':_0x358e2b});return _0x3c2756['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x42')});})[_0x2d38('0x23')](handleError(_0x3c2756));};exports[_0x2d38('0x43')]=function(_0x3f1f12,_0x457a82){logger[_0x2d38('0x13')](_0x2d38('0x44'),_0x457a82[_0x2d38('0x2e')]);var _0x24c107=callsValidation[_0x2d38('0xd')](_0x3f1f12['body']);if(_0x24c107[_0x2d38('0x2a')]>0x0){return _0x457a82['status'](0x190)['json'](_0x24c107);}var _0x175981=_0x3f1f12[_0x2d38('0x2e')][_0x2d38('0x3a')];var _0x4d310b=respondWithRpcPromise('VoiceChannels');var _0x3ca706=getAgent(_0x175981);return Promise[_0x2d38('0x45')]([_0x4d310b,_0x3ca706])['then'](function(_0x720bd9){var _0x245e6a=_0x720bd9[0x0];var _0x2e978c=_0x720bd9[0x1];var _0x456dc4=_[_0x2d38('0x46')](_0x245e6a['rows'],function(_0x519913){return _0x519913[_0x2d38('0x28')]==_0x2e978c['id'];});return _0x457a82['status'](0xc8)[_0x2d38('0x2f')]({'count':_0x456dc4[_0x2d38('0x2a')],'rows':_0x456dc4});})[_0x2d38('0x23')](handleError(_0x457a82));};exports[_0x2d38('0x47')]=function(_0x4fa858,_0x415817){logger[_0x2d38('0x13')]('conference\x20fired:',_0x4fa858[_0x2d38('0x2e')]);var _0x2fa092=conferenceValidation['validate'](_0x4fa858[_0x2d38('0x2e')]);if(_0x2fa092['length']>0x0){return _0x415817['status'](0x190)[_0x2d38('0x2f')](_0x2fa092);}var _0xfb9270=_0x4fa858['body']['userId'];return getAgent(_0xfb9270)[_0x2d38('0x1e')](function(_0x4deb3c){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x4deb3c[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x4deb3c[_0x2d38('0x19')]),_0x2d38('0x48'));return _0x415817['status'](0xc8)[_0x2d38('0x2f')]({'error':![],'message':_0x2d38('0x49')});})[_0x2d38('0x23')](handleError(_0x415817));};exports[_0x2d38('0x4a')]=function(_0x16e148,_0x498fc2){logger[_0x2d38('0x13')]('transfer\x20fired:',_0x16e148[_0x2d38('0x2e')]);var _0x333792=transferValidation['validate'](_0x16e148['body']);if(_0x333792[_0x2d38('0x2a')]>0x0){return _0x498fc2[_0x2d38('0x1a')](0x190)[_0x2d38('0x2f')](_0x333792);}var _0x163ad5=_0x16e148['body'][_0x2d38('0x3a')];var _0x5de6ba=_0x16e148['body'][_0x2d38('0x29')];var _0x11f13e=_0x16e148[_0x2d38('0x2e')][_0x2d38('0x4b')];return getAgent(_0x163ad5)['then'](function(_0x453fff){logger[_0x2d38('0x13')](_0x2d38('0x33'),_0x453fff[_0x2d38('0x19')]);emit(util['format']('user:%s',_0x453fff['name']),'webbar:transfer',{'sessionId':_0x5de6ba,'transferNumber':_0x11f13e});return _0x498fc2['status'](0xc8)['json']({'error':![],'message':_0x2d38('0x4c')});})[_0x2d38('0x23')](handleError(_0x498fc2));}; \ No newline at end of file +var _0x4c6d=['webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','webbarapi','ioredis','defaults','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','send','status','request','then','error','code','message','result','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer\x20fired:','webbar:answer','hold','hold\x20fired:'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xb14376,_0x5b0bf2){_0xb14376=_0xb14376-0x0;var _0x232f52=_0x4c6d[_0xb14376];return _0x232f52;};'use strict';var path=require(_0xd4c6('0x0'));var fs=require('fs');var _=require(_0xd4c6('0x1'));var db=require(_0xd4c6('0x2'))['db'];var config=require(_0xd4c6('0x3'));var util=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var jayson=require(_0xd4c6('0x5'));var amiClient=jayson[_0xd4c6('0x6')][_0xd4c6('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xd4c6('0x8'));var Redis=require(_0xd4c6('0x9'));config['redis']=_[_0xd4c6('0xa')](config[_0xd4c6('0xb')],{'host':_0xd4c6('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd4c6('0xb')]));var Schema=require(_0xd4c6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xd4c6('0xf'),'required':[!![],_0xd4c6('0x10')]},'callerId':{'type':_0xd4c6('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xd4c6('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xd4c6('0xf'),'required':[!![],_0xd4c6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':_0xd4c6('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd4c6('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xd4c6('0xe'),'required':[!![],_0xd4c6('0x11')]}});function emit(_0x25204d,_0x3cb95c,_0x3da1f4){logger[_0xd4c6('0x13')](_0x25204d,_0x3cb95c,JSON['stringify'](_0x3da1f4));io['to'](_0x25204d)[_0xd4c6('0x14')](_0x3cb95c,_0x3da1f4);}function handleError(_0x44126c){return function(_0x23a16f){console[_0xd4c6('0x15')](_0xd4c6('0x16'),_0x23a16f,_0x23a16f instanceof RangeError);logger['error'](_0x23a16f[_0xd4c6('0x17')]);if(_0x23a16f instanceof RangeError){if(_0x23a16f[_0xd4c6('0x18')]){delete _0x23a16f[_0xd4c6('0x18')];}_0x44126c['status'](0x194)[_0xd4c6('0x19')](_0x23a16f);}else{if(_0x23a16f[_0xd4c6('0x18')]){delete _0x23a16f[_0xd4c6('0x18')];}_0x44126c[_0xd4c6('0x1a')](0x1f4)['send'](_0x23a16f);}};}function checkError(){return function(_0x1c8427){if(!_0x1c8427){throw new RangeError('NotFound');}return _0x1c8427;};}function respondWithRpcPromise(_0x37f552,_0x150e28){return new BPromise(function(_0x2750c9,_0x222813){var _0xf536e0=amiClient;return _0xf536e0[_0xd4c6('0x1b')](_0x37f552,_0x150e28)[_0xd4c6('0x1c')](function(_0x3f99e8){if(_0x3f99e8[_0xd4c6('0x1d')]){if(_0x3f99e8[_0xd4c6('0x1d')][_0xd4c6('0x1e')]===0x1f4){return _0x222813(_0x3f99e8[_0xd4c6('0x1d')]['message']);}return _0x2750c9(_0x3f99e8['error'][_0xd4c6('0x1f')]);}else{_0x2750c9(_0x3f99e8[_0xd4c6('0x20')]);}})['catch'](function(_0x1dee19){_0x222813(_0x1dee19);});});}function getAgent(_0x3a2c50){return db[_0xd4c6('0x21')]['findOne']({'where':{'id':_0x3a2c50,'role':_0xd4c6('0x22')}})[_0xd4c6('0x1c')](checkError());}function getAgentCheckSession(_0x5614f3,_0x406ed0){return new BPromise(function(_0x8ce066,_0x25ea15){var _0x488e7e=respondWithRpcPromise(_0xd4c6('0x23'));var _0x3b656d=getAgent(_0x5614f3);Promise[_0xd4c6('0x24')]([_0x488e7e,_0x3b656d])[_0xd4c6('0x1c')](function(_0x2e8c34){var _0x160330=_0x2e8c34[0x0];var _0x41a8d2=_0x2e8c34[0x1];var _0x1f32d8=_[_0xd4c6('0x25')](_0x160330[_0xd4c6('0x26')],function(_0x441119){return _0x441119[_0xd4c6('0x27')]==_0x41a8d2['id']&&_0x441119[_0xd4c6('0x28')]==_0x406ed0;});if(_0x1f32d8[_0xd4c6('0x29')]==0x1){_0x8ce066(_0x41a8d2);}else{_0x25ea15(new RangeError('sessionId\x20'+_0x406ed0+_0xd4c6('0x2a')));}});});}exports[_0xd4c6('0x2b')]=function(_0x32deb7,_0x38d423){logger['info']('originate\x20fired:',_0x32deb7['body']);var _0x103ac3=originateValidation[_0xd4c6('0xd')](_0x32deb7[_0xd4c6('0x2c')]);if(_0x103ac3[_0xd4c6('0x29')]>0x0){return _0x38d423[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x103ac3);}var _0x1615ff=_0x32deb7['body'][_0xd4c6('0x2e')];var _0x3ae596=_0x32deb7[_0xd4c6('0x2c')]['callNumber'];var _0x24a716=_0x32deb7[_0xd4c6('0x2c')][_0xd4c6('0x2f')];var _0x4c69af=_0x32deb7[_0xd4c6('0x2c')][_0xd4c6('0x30')];return getAgent(_0x1615ff)[_0xd4c6('0x1c')](function(_0xe5aa2d){logger['info'](_0xd4c6('0x31'),_0xe5aa2d[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')](_0xd4c6('0x33'),_0xe5aa2d[_0xd4c6('0x18')]),'webbar:originate',{'callNumber':_0x3ae596,'callerId':_0x24a716,'callbackUrl':_0x4c69af});return _0x38d423[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x34')});})[_0xd4c6('0x35')](handleError(_0x38d423));};exports[_0xd4c6('0x36')]=function(_0x2cdb9d,_0x554666){logger[_0xd4c6('0x13')](_0xd4c6('0x37'),_0x2cdb9d[_0xd4c6('0x2c')]);var _0x5f4060=hangupValidation[_0xd4c6('0xd')](_0x2cdb9d[_0xd4c6('0x2c')]);if(_0x5f4060[_0xd4c6('0x29')]>0x0){return _0x554666[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5f4060);}var _0x20a4e8=_0x2cdb9d[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x2e1768=_0x2cdb9d['body'][_0xd4c6('0x28')];return getAgent(_0x20a4e8)['then'](function(_0x55063c){logger[_0xd4c6('0x13')](_0xd4c6('0x31'),_0x55063c[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')](_0xd4c6('0x33'),_0x55063c['name']),'webbar:hangup',{'sessionId':_0x2e1768});return _0x554666[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x38')});})[_0xd4c6('0x35')](handleError(_0x554666));};exports['answer']=function(_0x211d47,_0x494811){logger[_0xd4c6('0x13')](_0xd4c6('0x39'),_0x211d47[_0xd4c6('0x2c')]);var _0x51585c=answerValidation[_0xd4c6('0xd')](_0x211d47[_0xd4c6('0x2c')]);if(_0x51585c[_0xd4c6('0x29')]>0x0){return _0x494811[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x51585c);}var _0x3ef1b0=_0x211d47[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x343d94=_0x211d47['body'][_0xd4c6('0x28')];return getAgent(_0x3ef1b0)[_0xd4c6('0x1c')](function(_0xefcd5){logger['info'](_0xd4c6('0x31'),_0xefcd5[_0xd4c6('0x18')]);emit(util[_0xd4c6('0x32')]('user:%s',_0xefcd5['name']),_0xd4c6('0x3a'),{'sessionId':_0x343d94});return _0x494811[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':'answer\x20executed!'});})[_0xd4c6('0x35')](handleError(_0x494811));};exports[_0xd4c6('0x3b')]=function(_0x1a53e9,_0x258a95){logger[_0xd4c6('0x13')](_0xd4c6('0x3c'),_0x1a53e9['body']);var _0x22298a=holdValidation[_0xd4c6('0xd')](_0x1a53e9[_0xd4c6('0x2c')]);if(_0x22298a[_0xd4c6('0x29')]>0x0){return _0x258a95[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x22298a);}var _0x34fb42=_0x1a53e9[_0xd4c6('0x2c')]['userId'];var _0x4f26fc=_0x1a53e9[_0xd4c6('0x2c')][_0xd4c6('0x28')];return getAgent(_0x34fb42)[_0xd4c6('0x1c')](function(_0x5bb875){logger[_0xd4c6('0x13')](_0xd4c6('0x31'),_0x5bb875[_0xd4c6('0x18')]);emit(util['format'](_0xd4c6('0x33'),_0x5bb875[_0xd4c6('0x18')]),_0xd4c6('0x3d'),{'sessionId':_0x4f26fc});return _0x258a95[_0xd4c6('0x1a')](0xc8)['json']({'error':![],'message':_0xd4c6('0x3e')});})[_0xd4c6('0x35')](handleError(_0x258a95));};exports[_0xd4c6('0x3f')]=function(_0x14279d,_0x291837){logger[_0xd4c6('0x13')](_0xd4c6('0x40'),_0x14279d['body']);var _0x304f96=unholdValidation[_0xd4c6('0xd')](_0x14279d[_0xd4c6('0x2c')]);if(_0x304f96['length']>0x0){return _0x291837[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x304f96);}var _0x46bf10=_0x14279d[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x3e6df8=_0x14279d[_0xd4c6('0x2c')]['sessionId'];return getAgent(_0x46bf10)[_0xd4c6('0x1c')](function(_0x4a3092){logger['info'](_0xd4c6('0x31'),_0x4a3092['name']);emit(util[_0xd4c6('0x32')]('user:%s',_0x4a3092[_0xd4c6('0x18')]),'webbar:unhold',{'sessionId':_0x3e6df8});return _0x291837['status'](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x41')});})[_0xd4c6('0x35')](handleError(_0x291837));};exports[_0xd4c6('0x42')]=function(_0x5639b6,_0x241e6c){logger[_0xd4c6('0x13')](_0xd4c6('0x43'),_0x241e6c[_0xd4c6('0x2c')]);var _0x5e52db=callsValidation[_0xd4c6('0xd')](_0x5639b6[_0xd4c6('0x2c')]);if(_0x5e52db[_0xd4c6('0x29')]>0x0){return _0x241e6c[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5e52db);}var _0x1525a4=_0x5639b6[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x106710=respondWithRpcPromise(_0xd4c6('0x23'));var _0xe07a2d=getAgent(_0x1525a4);return Promise['all']([_0x106710,_0xe07a2d])['then'](function(_0x2dab4a){var _0x11c37d=_0x2dab4a[0x0];var _0x558ce2=_0x2dab4a[0x1];var _0x5179af=_['filter'](_0x11c37d[_0xd4c6('0x26')],function(_0x218250){return _0x218250['UserId']==_0x558ce2['id'];});return _0x241e6c['status'](0xc8)[_0xd4c6('0x2d')]({'count':_0x5179af[_0xd4c6('0x29')],'rows':_0x5179af});})[_0xd4c6('0x35')](handleError(_0x241e6c));};exports[_0xd4c6('0x44')]=function(_0x226549,_0x516e12){logger[_0xd4c6('0x13')](_0xd4c6('0x45'),_0x226549[_0xd4c6('0x2c')]);var _0x26cff1=conferenceValidation[_0xd4c6('0xd')](_0x226549[_0xd4c6('0x2c')]);if(_0x26cff1[_0xd4c6('0x29')]>0x0){return _0x516e12[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x26cff1);}var _0x20b5b9=_0x226549[_0xd4c6('0x2c')][_0xd4c6('0x2e')];return getAgent(_0x20b5b9)[_0xd4c6('0x1c')](function(_0x5a0400){logger['info'](_0xd4c6('0x31'),_0x5a0400['name']);emit(util['format']('user:%s',_0x5a0400[_0xd4c6('0x18')]),_0xd4c6('0x46'));return _0x516e12[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0xd4c6('0x35')](handleError(_0x516e12));};exports[_0xd4c6('0x47')]=function(_0x53dcea,_0x705041){logger[_0xd4c6('0x13')](_0xd4c6('0x48'),_0x53dcea[_0xd4c6('0x2c')]);var _0x5cf823=transferValidation[_0xd4c6('0xd')](_0x53dcea[_0xd4c6('0x2c')]);if(_0x5cf823['length']>0x0){return _0x705041[_0xd4c6('0x1a')](0x190)[_0xd4c6('0x2d')](_0x5cf823);}var _0x5ae295=_0x53dcea[_0xd4c6('0x2c')][_0xd4c6('0x2e')];var _0x4cdf5f=_0x53dcea[_0xd4c6('0x2c')]['sessionId'];var _0x7aef4=_0x53dcea[_0xd4c6('0x2c')][_0xd4c6('0x49')];return getAgent(_0x5ae295)[_0xd4c6('0x1c')](function(_0x2a8448){logger[_0xd4c6('0x13')]('entityFound:',_0x2a8448[_0xd4c6('0x18')]);emit(util['format'](_0xd4c6('0x33'),_0x2a8448[_0xd4c6('0x18')]),'webbar:transfer',{'sessionId':_0x4cdf5f,'transferNumber':_0x7aef4});return _0x705041[_0xd4c6('0x1a')](0xc8)[_0xd4c6('0x2d')]({'error':![],'message':_0xd4c6('0x4a')});})['catch'](handleError(_0x705041));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 14f1a48..f9bce5f 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 _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x27ab9f,_0x2457dd){var _0xb49d91=function(_0x56c229){while(--_0x56c229){_0x27ab9f['push'](_0x27ab9f['shift']());}};_0xb49d91(++_0x2457dd);}(_0x66fa,0x117));var _0xa66f=function(_0x33ced2,_0x4d6a34){_0x33ced2=_0x33ced2-0x0;var _0x2e3f53=_0x66fa[_0x33ced2];return _0x2e3f53;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('0x21')]=router; \ No newline at end of file +var _0xacf4=['./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x51a347,_0x5c1307){var _0xd67c9c=function(_0x5dda4d){while(--_0x5dda4d){_0x51a347['push'](_0x51a347['shift']());}};_0xd67c9c(++_0x5c1307);}(_0xacf4,0xe7));var _0x4acf=function(_0x10b52e,_0x3d4f90){_0x10b52e=_0x10b52e-0x0;var _0x12b21a=_0xacf4[_0x10b52e];return _0x12b21a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var fs_extra=require(_0x4acf('0x4'));var auth=require(_0x4acf('0x5'));var interaction=require(_0x4acf('0x6'));var config=require('../../config/environment');var controller=require(_0x4acf('0x7'));router[_0x4acf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4acf('0x9')]);router[_0x4acf('0x8')](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller[_0x4acf('0xc')]);router['get']('/:id',auth[_0x4acf('0xb')](),controller['show']);router[_0x4acf('0x8')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['getDispositions']);router[_0x4acf('0x8')](_0x4acf('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4acf('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0xf')]);router[_0x4acf('0x8')](_0x4acf('0x10'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x11')]);router[_0x4acf('0x12')]('/',auth[_0x4acf('0xb')](),controller[_0x4acf('0x13')]);router[_0x4acf('0x12')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['addDisposition']);router[_0x4acf('0x12')]('/:id/canned_answers',auth[_0x4acf('0xb')](),controller[_0x4acf('0x14')]);router[_0x4acf('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0x15')]);router[_0x4acf('0x12')](_0x4acf('0x10'),auth['isAuthenticated'](),controller[_0x4acf('0x16')]);router[_0x4acf('0x12')](_0x4acf('0x17'),controller[_0x4acf('0x18')]);router[_0x4acf('0x12')](_0x4acf('0x19'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x1a')]);router[_0x4acf('0x1b')](_0x4acf('0x1c'),auth[_0x4acf('0xb')](),controller['update']);router[_0x4acf('0x1d')](_0x4acf('0x1c'),auth['isAuthenticated'](),controller[_0x4acf('0x1e')]);router[_0x4acf('0x1d')]('/:id/dispositions',auth[_0x4acf('0xb')](),controller[_0x4acf('0x1f')]);router[_0x4acf('0x1d')](_0x4acf('0xe'),auth['isAuthenticated'](),controller[_0x4acf('0x20')]);router[_0x4acf('0x1d')]('/:id/users',auth[_0x4acf('0xb')](),controller[_0x4acf('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f3832fc..cbd44df 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 _0xaf07=['name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0xaf07,0xed));var _0x7af0=function(_0xb2b6b1,_0x39a277){_0xb2b6b1=_0xb2b6b1-0x0;var _0x37d7ad=_0xaf07[_0xb2b6b1];return _0x37d7ad;};'use strict';var Sequelize=require(_0x7af0('0x0'));var rs=require(_0x7af0('0x1'));module['exports']={'name':{'type':Sequelize[_0x7af0('0x2')],'unique':_0x7af0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x7af0('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7af0('0x2')],'defaultValue':function(){return rs[_0x7af0('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x7af0('0x5'),_0x7af0('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7af0('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7af0('0x7')],'defaultValue':function(){return _0x7af0('0x8');}},'notificationSound':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7af0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7af0('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x7af0('0x9')],'defaultValue':![],'comment':_0x7af0('0xc'),'set':function(_0x763162){if(!_0x763162){this['setDataValue'](_0x7af0('0xd'),null);}this[_0x7af0('0xe')]('mandatoryDisposition',_0x763162);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4ac8=['ENUM','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate'];(function(_0x1eb4a4,_0x567c2d){var _0x4bff4d=function(_0x4e6281){while(--_0x4e6281){_0x1eb4a4['push'](_0x1eb4a4['shift']());}};_0x4bff4d(++_0x567c2d);}(_0x4ac8,0x175));var _0x84ac=function(_0x4cb6e3,_0x4f0fd9){_0x4cb6e3=_0x4cb6e3-0x0;var _0x138229=_0x4ac8[_0x4cb6e3];return _0x138229;};'use strict';var Sequelize=require(_0x84ac('0x0'));var rs=require(_0x84ac('0x1'));module[_0x84ac('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x84ac('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x84ac('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x84ac('0x5')](_0x84ac('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x84ac('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x84ac('0x3')]},'notificationTemplate':{'type':Sequelize[_0x84ac('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x84ac('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x84ac('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x84ac('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x84ac('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x84ac('0x9')],'comment':_0x84ac('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x84ac('0x8')],'defaultValue':![],'comment':_0x84ac('0xb'),'set':function(_0xbc7062){if(!_0xbc7062){this['setDataValue'](_0x84ac('0xc'),null);}this['setDataValue'](_0x84ac('0xd'),_0xbc7062);}},'description':{'type':Sequelize[_0x84ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 59266f9..d7d59e7 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 _0x46d1=['request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','WhatsappAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','rows','show','params','includeAll','include','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Disposition','getDispositions','order','WhatsappAccountId','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','AC\x20WhatsappAccount\x20req.body:%s','Applications','account','orderBy','priority','describe','Sequelize','ValidationError','no\x20available\x20attributes','stringify','AC\x20sinch\x20req.body:%s','difference','updatedAt','createdAt','CompanyId','ListId','mobile','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactFields:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','AC\x20sinch\x20req.body\x202:%s','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','defaults','contact','WhatsappInteraction','interaction','created','applications','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','DESC','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x248400,_0x231fa4){var _0x2473ea=function(_0x545dad){while(--_0x545dad){_0x248400['push'](_0x248400['shift']());}};_0x2473ea(++_0x231fa4);}(_0x46d1,0xbe));var _0x146d=function(_0x20adce,_0x4f8575){_0x20adce=_0x20adce-0x0;var _0x252f1b=_0x46d1[_0x20adce];return _0x252f1b;};'use strict';var emlformat=require(_0x146d('0x0'));var rimraf=require(_0x146d('0x1'));var zipdir=require(_0x146d('0x2'));var jsonpatch=require(_0x146d('0x3'));var rp=require(_0x146d('0x4'));var moment=require(_0x146d('0x5'));var BPromise=require(_0x146d('0x6'));var Mustache=require('mustache');var util=require(_0x146d('0x7'));var path=require(_0x146d('0x8'));var sox=require(_0x146d('0x9'));var csv=require('to-csv');var ejs=require(_0x146d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x146d('0xb'));var squel=require(_0x146d('0xc'));var crypto=require(_0x146d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x146d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x146d('0xf'));var Papa=require(_0x146d('0x10'));var Redis=require(_0x146d('0x11'));var authService=require(_0x146d('0x12'));var qs=require(_0x146d('0x13'));var as=require(_0x146d('0x14'));var hardwareService=require(_0x146d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x146d('0x16'));var config=require(_0x146d('0x17'));var licenseUtil=require(_0x146d('0x18'));var db=require(_0x146d('0x19'))['db'];config[_0x146d('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x146d('0x1a')]));require(_0x146d('0x1b'))['register'](socket);var jayson=require(_0x146d('0x1c'));var client=jayson[_0x146d('0x1d')][_0x146d('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2046bd,_0x4594c8,_0x1f62c4,_0x388492){return new BPromise(function(_0x264136,_0x2befa6){var _0x18307d=_0x388492||client;return _0x18307d[_0x146d('0x1f')](_0x2046bd,_0x1f62c4)['then'](function(_0x453823){logger[_0x146d('0x20')](_0x146d('0x21'),_0x4594c8,'request\x20sent');logger[_0x146d('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4594c8,_0x146d('0x23'),JSON['stringify'](_0x453823));if(_0x453823[_0x146d('0x24')]){if(_0x453823[_0x146d('0x24')][_0x146d('0x25')]===0x1f4){logger[_0x146d('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x4594c8,_0x453823[_0x146d('0x24')][_0x146d('0x26')]);return _0x2befa6(_0x453823[_0x146d('0x24')][_0x146d('0x26')]);}logger[_0x146d('0x24')](_0x146d('0x21'),_0x4594c8,_0x453823[_0x146d('0x24')][_0x146d('0x26')]);return _0x264136(_0x453823[_0x146d('0x24')][_0x146d('0x26')]);}else{logger[_0x146d('0x20')](_0x146d('0x21'),_0x4594c8,_0x146d('0x23'));_0x264136(_0x453823['result'][_0x146d('0x26')]);}})[_0x146d('0x27')](function(_0x7e8d9d){logger['error'](_0x146d('0x21'),_0x4594c8,_0x7e8d9d);_0x2befa6(_0x7e8d9d);});});}function respondWithStatusCode(_0x359865,_0x3c4fe2){_0x3c4fe2=_0x3c4fe2||0xcc;return function(_0x2aa118){if(_0x2aa118){return _0x359865[_0x146d('0x28')](_0x3c4fe2);}return _0x359865[_0x146d('0x29')](_0x3c4fe2)[_0x146d('0x2a')]();};}function respondWithResult(_0x481746,_0x27d1ac){_0x27d1ac=_0x27d1ac||0xc8;return function(_0x59c002){if(_0x59c002){return _0x481746['status'](_0x27d1ac)[_0x146d('0x2b')](_0x59c002);}};}function respondWithFilteredResult(_0x46a0c7,_0x2e0450){return function(_0x3e2fc8){if(_0x3e2fc8){var _0x2d8931=typeof _0x2e0450['offset']==='undefined'&&typeof _0x2e0450['limit']===_0x146d('0x2c');var _0x4be220=_0x3e2fc8[_0x146d('0x2d')];var _0x465660=_0x2d8931?0x0:_0x2e0450[_0x146d('0x2e')];var _0x4b0a4b=_0x2d8931?_0x3e2fc8[_0x146d('0x2d')]:_0x2e0450[_0x146d('0x2e')]+_0x2e0450[_0x146d('0x2f')];var _0x1c8c6f;if(_0x4b0a4b>=_0x4be220){_0x4b0a4b=_0x4be220;_0x1c8c6f=0xc8;}else{_0x1c8c6f=0xce;}_0x46a0c7[_0x146d('0x29')](_0x1c8c6f);return _0x46a0c7['set'](_0x146d('0x30'),_0x465660+'-'+_0x4b0a4b+'/'+_0x4be220)[_0x146d('0x2b')](_0x3e2fc8);}return null;};}function patchUpdates(_0x5496ff){return function(_0x5a513f){try{jsonpatch[_0x146d('0x31')](_0x5a513f,_0x5496ff,!![]);}catch(_0x63c09b){return BPromise[_0x146d('0x32')](_0x63c09b);}return _0x5a513f[_0x146d('0x33')]();};}function saveUpdates(_0x51608d,_0x3efd5d){return function(_0x1dfa16){if(_0x1dfa16){return _0x1dfa16[_0x146d('0x34')](_0x51608d)[_0x146d('0x35')](function(_0x10c973){return _0x10c973;});}return null;};}function removeEntity(_0x5a8e46,_0x373a58){return function(_0xc81c27){if(_0xc81c27){return _0xc81c27[_0x146d('0x36')]()[_0x146d('0x35')](function(){var _0x832ce5=_0xc81c27['get']({'plain':!![]});var _0x352b98=_0x146d('0x37');return db[_0x146d('0x38')][_0x146d('0x36')]({'where':{'type':_0x352b98,'resourceId':_0x832ce5['id']}})['then'](function(){return _0xc81c27;});})[_0x146d('0x35')](function(){_0x5a8e46[_0x146d('0x29')](0xcc)[_0x146d('0x2a')]();});}};}function handleEntityNotFound(_0x493a0c,_0x2cec52){return function(_0x3a3817){if(!_0x3a3817){_0x493a0c[_0x146d('0x28')](0x194);}return _0x3a3817;};}function handleError(_0xfc1380,_0x3a6c6e){_0x3a6c6e=_0x3a6c6e||0x1f4;return function(_0x10a872){logger['error'](_0x10a872['stack']);if(_0x10a872[_0x146d('0x39')]){delete _0x10a872[_0x146d('0x39')];}_0xfc1380[_0x146d('0x29')](_0x3a6c6e)[_0x146d('0x3a')](_0x10a872);};}exports['index']=function(_0x116e1a,_0x3aa9ad){var _0x4ce3c6={'include':[{'model':db[_0x146d('0x3b')],'as':_0x146d('0x3c')}]},_0x241587={},_0xb9408f={'count':0x0,'rows':[]};var _0x3d114a=_[_0x146d('0x3d')](db[_0x146d('0x3e')][_0x146d('0x3f')],function(_0x21400c){return{'name':_0x21400c['fieldName'],'type':_0x21400c[_0x146d('0x40')][_0x146d('0x41')]};});_0x241587['model']=_['map'](_0x3d114a,_0x146d('0x39'));_0x241587['query']=_[_0x146d('0x42')](_0x116e1a[_0x146d('0x43')]);_0x241587[_0x146d('0x44')]=_[_0x146d('0x45')](_0x241587['model'],_0x241587[_0x146d('0x43')]);_0x4ce3c6[_0x146d('0x46')]=_[_0x146d('0x45')](_0x241587[_0x146d('0x47')],qs[_0x146d('0x48')](_0x116e1a[_0x146d('0x43')][_0x146d('0x48')]));_0x4ce3c6[_0x146d('0x46')]=_0x4ce3c6['attributes'][_0x146d('0x49')]?_0x4ce3c6[_0x146d('0x46')]:_0x241587[_0x146d('0x47')];if(!_0x116e1a[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x4ce3c6[_0x146d('0x2f')]=qs['limit'](_0x116e1a[_0x146d('0x43')]['limit']);_0x4ce3c6[_0x146d('0x2e')]=qs['offset'](_0x116e1a[_0x146d('0x43')][_0x146d('0x2e')]);}_0x4ce3c6['order']=qs[_0x146d('0x4c')](_0x116e1a[_0x146d('0x43')]['sort']);_0x4ce3c6[_0x146d('0x4d')]=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x116e1a[_0x146d('0x43')],_0x241587[_0x146d('0x44')]),_0x3d114a);if(_0x116e1a[_0x146d('0x43')]['filter']){_0x4ce3c6[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x4ce3c6[_0x146d('0x4d')],{'$or':_[_0x146d('0x3d')](_0x3d114a,function(_0x4fc68e){if(_0x4fc68e[_0x146d('0x40')]!==_0x146d('0x50')){var _0x20aa55={};_0x20aa55[_0x4fc68e['name']]={'$like':'%'+_0x116e1a['query'][_0x146d('0x51')]+'%'};return _0x20aa55;}})});}_0x4ce3c6=_[_0x146d('0x4f')]({},_0x4ce3c6,_0x116e1a[_0x146d('0x52')]);var _0xeaf5a7={'where':_0x4ce3c6['where']};return db[_0x146d('0x3e')][_0x146d('0x2d')](_0xeaf5a7)[_0x146d('0x35')](function(_0x5cc944){_0xb9408f[_0x146d('0x2d')]=_0x5cc944;if(_0x116e1a[_0x146d('0x43')]['includeAll']){_0x4ce3c6['include']=[{'all':!![]}];}return db[_0x146d('0x3e')]['findAll'](_0x4ce3c6);})[_0x146d('0x35')](function(_0xb72d16){_0xb9408f[_0x146d('0x53')]=_0xb72d16;return _0xb9408f;})[_0x146d('0x35')](respondWithFilteredResult(_0x3aa9ad,_0x4ce3c6))['catch'](handleError(_0x3aa9ad,null));};exports[_0x146d('0x54')]=function(_0x41ced2,_0xdfc351){var _0x187a27={'raw':![],'where':{'id':_0x41ced2[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0x3b')],'as':_0x146d('0x3c')}]},_0x204a0e={};_0x204a0e[_0x146d('0x47')]=_[_0x146d('0x42')](db[_0x146d('0x3e')]['rawAttributes']);_0x204a0e['query']=_[_0x146d('0x42')](_0x41ced2[_0x146d('0x43')]);_0x204a0e[_0x146d('0x44')]=_['intersection'](_0x204a0e[_0x146d('0x47')],_0x204a0e[_0x146d('0x43')]);_0x187a27[_0x146d('0x46')]=_[_0x146d('0x45')](_0x204a0e[_0x146d('0x47')],qs[_0x146d('0x48')](_0x41ced2[_0x146d('0x43')][_0x146d('0x48')]));_0x187a27[_0x146d('0x46')]=_0x187a27[_0x146d('0x46')][_0x146d('0x49')]?_0x187a27['attributes']:_0x204a0e[_0x146d('0x47')];if(_0x41ced2[_0x146d('0x43')][_0x146d('0x56')]){_0x187a27[_0x146d('0x57')]=[{'all':!![]}];}_0x187a27=_[_0x146d('0x4f')]({},_0x187a27,_0x41ced2[_0x146d('0x52')]);return db[_0x146d('0x3e')][_0x146d('0x58')](_0x187a27)[_0x146d('0x35')](handleEntityNotFound(_0xdfc351,null))[_0x146d('0x35')](respondWithResult(_0xdfc351,null))[_0x146d('0x27')](handleError(_0xdfc351,null));};exports[_0x146d('0x59')]=function(_0x1fe487,_0x53fc0e){return db[_0x146d('0x3e')][_0x146d('0x59')](_0x1fe487[_0x146d('0x5a')],{})[_0x146d('0x35')](function(_0x869294){var _0x1943d7=_0x1fe487[_0x146d('0x5b')][_0x146d('0x5c')]({'plain':!![]});if(!_0x1943d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1943d7['role']===_0x146d('0x5b')){var _0x22f7e0=_0x869294['get']({'plain':!![]});var _0x496732=_0x146d('0x37');return db[_0x146d('0x5d')]['find']({'where':{'name':_0x496732,'userProfileId':_0x1943d7['userProfileId']},'raw':!![]})[_0x146d('0x35')](function(_0x43829f){if(_0x43829f&&_0x43829f[_0x146d('0x5e')]===0x0){return db[_0x146d('0x38')]['create']({'name':_0x22f7e0[_0x146d('0x39')],'resourceId':_0x22f7e0['id'],'type':_0x43829f['name'],'sectionId':_0x43829f['id']},{})['then'](function(){return _0x869294;});}else{return _0x869294;}})[_0x146d('0x27')](function(_0x39bf7b){logger['error'](_0x146d('0x5f'),_0x39bf7b);throw _0x39bf7b;});}return _0x869294;})['then'](respondWithResult(_0x53fc0e,0xc9))[_0x146d('0x27')](handleError(_0x53fc0e,null));};exports['update']=function(_0xdf6d93,_0x5847df){if(_0xdf6d93[_0x146d('0x5a')]['id']){delete _0xdf6d93[_0x146d('0x5a')]['id'];}return db[_0x146d('0x3e')]['find']({'where':{'id':_0xdf6d93[_0x146d('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x146d('0x35')](handleEntityNotFound(_0x5847df,null))[_0x146d('0x35')](saveUpdates(_0xdf6d93[_0x146d('0x5a')],null))[_0x146d('0x35')](respondWithResult(_0x5847df,null))[_0x146d('0x27')](handleError(_0x5847df,null));};exports[_0x146d('0x36')]=function(_0x29315e,_0x1ec8b9){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x29315e[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x1ec8b9,null))[_0x146d('0x35')](removeEntity(_0x1ec8b9,null))[_0x146d('0x27')](handleError(_0x1ec8b9,null));};exports['describe']=function(_0xa00d73,_0x4d5ac6){return db['WhatsappAccount']['describe']()[_0x146d('0x35')](respondWithResult(_0x4d5ac6,null))[_0x146d('0x27')](handleError(_0x4d5ac6,null));};exports['addDisposition']=function(_0x376a0a,_0x216616,_0x313976){if(_0x376a0a[_0x146d('0x5a')]['id']){delete _0x376a0a['body']['id'];}return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x376a0a['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x216616,null))[_0x146d('0x35')](function(_0x5cfb55){if(_0x5cfb55){_0x376a0a[_0x146d('0x5a')]['WhatsappAccountId']=_0x5cfb55['id'];return db[_0x146d('0x60')][_0x146d('0x59')](_0x376a0a[_0x146d('0x5a')]);}})['then'](respondWithResult(_0x216616,null))['catch'](handleError(_0x216616,null));};exports[_0x146d('0x61')]=function(_0x49cd30,_0x5c522a,_0x5443f1){var _0x24be3d={'raw':![],'where':{}};var _0x89fece={};var _0x494cee={'count':0x0,'rows':[]};return db[_0x146d('0x3e')]['findOne']({'where':{'id':_0x49cd30[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x5c522a,null))[_0x146d('0x35')](function(_0x37dda1){if(_0x37dda1){_0x89fece[_0x146d('0x47')]=_['keys'](db[_0x146d('0x60')]['rawAttributes']);_0x89fece[_0x146d('0x43')]=_[_0x146d('0x42')](_0x49cd30[_0x146d('0x43')]);_0x89fece[_0x146d('0x44')]=_[_0x146d('0x45')](_0x89fece[_0x146d('0x47')],_0x89fece[_0x146d('0x43')]);_0x24be3d[_0x146d('0x46')]=_[_0x146d('0x45')](_0x89fece[_0x146d('0x47')],qs['fields'](_0x49cd30['query'][_0x146d('0x48')]));_0x24be3d[_0x146d('0x46')]=_0x24be3d['attributes']['length']?_0x24be3d['attributes']:_0x89fece['model'];if(!_0x49cd30[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x24be3d[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x49cd30[_0x146d('0x43')][_0x146d('0x2f')]);_0x24be3d[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x49cd30['query'][_0x146d('0x2e')]);}_0x24be3d[_0x146d('0x62')]=qs[_0x146d('0x4c')](_0x49cd30['query'][_0x146d('0x4c')]);_0x24be3d['where']=qs['filters'](_[_0x146d('0x4e')](_0x49cd30[_0x146d('0x43')],_0x89fece[_0x146d('0x44')]));_0x24be3d['where'][_0x146d('0x63')]=_0x37dda1['id'];if(_0x49cd30['query'][_0x146d('0x51')]){_0x24be3d[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x24be3d['where'],{'$or':_['map'](_0x24be3d[_0x146d('0x46')],function(_0x1e6bd3){var _0x495a04={};_0x495a04[_0x1e6bd3]={'$like':'%'+_0x49cd30[_0x146d('0x43')]['filter']+'%'};return _0x495a04;})});}_0x24be3d=_[_0x146d('0x4f')]({},_0x24be3d,_0x49cd30[_0x146d('0x52')]);return db[_0x146d('0x60')][_0x146d('0x2d')]({'where':_0x24be3d[_0x146d('0x4d')]})[_0x146d('0x35')](function(_0x2091e7){_0x494cee[_0x146d('0x2d')]=_0x2091e7;if(_0x49cd30['query'][_0x146d('0x56')]){_0x24be3d[_0x146d('0x57')]=[{'all':!![]}];}return db[_0x146d('0x60')][_0x146d('0x64')](_0x24be3d);})[_0x146d('0x35')](function(_0x1cb1db){_0x494cee[_0x146d('0x53')]=_0x1cb1db;return _0x494cee;});}})[_0x146d('0x35')](respondWithFilteredResult(_0x5c522a,_0x24be3d))[_0x146d('0x27')](handleError(_0x5c522a,null));};exports[_0x146d('0x65')]=function(_0x3c7d73,_0x29f33f,_0x427077){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x3c7d73[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x29f33f,null))['then'](function(_0xb53605){if(_0xb53605){return _0xb53605[_0x146d('0x65')](_0x3c7d73['query'][_0x146d('0x66')]);}})['then'](respondWithStatusCode(_0x29f33f,null))[_0x146d('0x27')](handleError(_0x29f33f,null));};exports['addAnswer']=function(_0x1c3013,_0x27f0cc,_0x534bde){if(_0x1c3013[_0x146d('0x5a')]['id']){delete _0x1c3013[_0x146d('0x5a')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x1c3013['params']['id']}})['then'](handleEntityNotFound(_0x27f0cc,null))['then'](function(_0x1a84a1){if(_0x1a84a1){_0x1c3013['body'][_0x146d('0x63')]=_0x1a84a1['id'];return db[_0x146d('0x67')][_0x146d('0x59')](_0x1c3013[_0x146d('0x5a')]);}})[_0x146d('0x35')](respondWithResult(_0x27f0cc,null))[_0x146d('0x27')](handleError(_0x27f0cc,null));};exports[_0x146d('0x68')]=function(_0x3a39cc,_0x8eba52,_0x382ebf){var _0x29ad30={'raw':![],'where':{}};var _0x4953d0={};var _0xba047={'count':0x0,'rows':[]};return db[_0x146d('0x3e')][_0x146d('0x69')]({'where':{'id':_0x3a39cc['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x8eba52,null))[_0x146d('0x35')](function(_0x1f326a){if(_0x1f326a){_0x4953d0[_0x146d('0x47')]=_['keys'](db[_0x146d('0x67')][_0x146d('0x3f')]);_0x4953d0[_0x146d('0x43')]=_[_0x146d('0x42')](_0x3a39cc['query']);_0x4953d0[_0x146d('0x44')]=_['intersection'](_0x4953d0[_0x146d('0x47')],_0x4953d0[_0x146d('0x43')]);_0x29ad30[_0x146d('0x46')]=_['intersection'](_0x4953d0[_0x146d('0x47')],qs[_0x146d('0x48')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x48')]));_0x29ad30[_0x146d('0x46')]=_0x29ad30['attributes'][_0x146d('0x49')]?_0x29ad30['attributes']:_0x4953d0[_0x146d('0x47')];if(!_0x3a39cc[_0x146d('0x43')]['hasOwnProperty'](_0x146d('0x4b'))){_0x29ad30[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x2f')]);_0x29ad30[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x3a39cc[_0x146d('0x43')][_0x146d('0x2e')]);}_0x29ad30['order']=qs['sort'](_0x3a39cc[_0x146d('0x43')][_0x146d('0x4c')]);_0x29ad30['where']=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x3a39cc[_0x146d('0x43')],_0x4953d0[_0x146d('0x44')]));_0x29ad30['where'][_0x146d('0x63')]=_0x1f326a['id'];if(_0x3a39cc['query']['filter']){_0x29ad30[_0x146d('0x4d')]=_[_0x146d('0x4f')](_0x29ad30[_0x146d('0x4d')],{'$or':_['map'](_0x29ad30[_0x146d('0x46')],function(_0x683d41){var _0x2b72ba={};_0x2b72ba[_0x683d41]={'$like':'%'+_0x3a39cc['query'][_0x146d('0x51')]+'%'};return _0x2b72ba;})});}_0x29ad30=_[_0x146d('0x4f')]({},_0x29ad30,_0x3a39cc[_0x146d('0x52')]);return db['CannedAnswer'][_0x146d('0x2d')]({'where':_0x29ad30['where']})[_0x146d('0x35')](function(_0x12e294){_0xba047[_0x146d('0x2d')]=_0x12e294;if(_0x3a39cc[_0x146d('0x43')][_0x146d('0x56')]){_0x29ad30[_0x146d('0x57')]=[{'all':!![]}];}return db[_0x146d('0x67')][_0x146d('0x64')](_0x29ad30);})[_0x146d('0x35')](function(_0x14b156){_0xba047['rows']=_0x14b156;return _0xba047;});}})[_0x146d('0x35')](respondWithFilteredResult(_0x8eba52,_0x29ad30))['catch'](handleError(_0x8eba52,null));};exports[_0x146d('0x6a')]=function(_0x390cf5,_0x5a3970,_0xa84634){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x390cf5['params']['id']}})['then'](handleEntityNotFound(_0x5a3970,null))['then'](function(_0x1d97f7){if(_0x1d97f7){return _0x1d97f7[_0x146d('0x6a')](_0x390cf5[_0x146d('0x43')][_0x146d('0x66')]);}})[_0x146d('0x35')](respondWithStatusCode(_0x5a3970,null))[_0x146d('0x27')](handleError(_0x5a3970,null));};exports[_0x146d('0x6b')]=function(_0x37c116,_0x3b309d,_0x9b625e){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x37c116[_0x146d('0x55')]['id']}})['then'](handleEntityNotFound(_0x3b309d,null))[_0x146d('0x35')](function(_0x487bd6){if(_0x487bd6){return _0x487bd6[_0x146d('0x6b')](_0x37c116[_0x146d('0x5a')][_0x146d('0x66')],_[_0x146d('0x6c')](_0x37c116[_0x146d('0x5a')],['ids','id'])||{})[_0x146d('0x6d')](function(_0xa17087){for(var _0x48c8f9=0x0;_0x48c8f9<_0x37c116[_0x146d('0x5a')]['ids'][_0x146d('0x49')];_0x48c8f9+=0x1){socket[_0x146d('0x6e')](_0x146d('0x6f'),{'UserId':Number(_0x37c116[_0x146d('0x5a')]['ids'][_0x48c8f9]),'WhatsappAccountId':Number(_0x37c116['params']['id'])});}return _0xa17087;});}})[_0x146d('0x35')](respondWithResult(_0x3b309d,null))[_0x146d('0x27')](handleError(_0x3b309d,null));};exports[_0x146d('0x70')]=function(_0x54f4d2,_0x50fa2a,_0x1f11b0){return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0x54f4d2[_0x146d('0x55')]['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x50fa2a,null))['then'](function(_0x4579fe){if(_0x4579fe){return _0x4579fe[_0x146d('0x70')](_0x54f4d2[_0x146d('0x43')]['ids'])[_0x146d('0x35')](function(){if(_[_0x146d('0x71')](_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')])){for(var _0x42b363=0x0;_0x42b363<_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')][_0x146d('0x49')];_0x42b363+=0x1){socket['emit'](_0x146d('0x72'),{'UserId':Number(_0x54f4d2[_0x146d('0x43')][_0x146d('0x66')][_0x42b363]),'WhatsappAccountId':Number(_0x54f4d2[_0x146d('0x55')]['id'])});}}else{socket[_0x146d('0x6e')](_0x146d('0x72'),{'UserId':Number(_0x54f4d2[_0x146d('0x43')]['ids']),'WhatsappAccountId':Number(_0x54f4d2['params']['id'])});}});}})[_0x146d('0x35')](respondWithStatusCode(_0x50fa2a,null))[_0x146d('0x27')](handleError(_0x50fa2a,null));};exports[_0x146d('0x73')]=function(_0x475dcb,_0x3306ac,_0x59d07d){var _0x27fcf0={};var _0x2bb826={};var _0x8a0f45;var _0x1a6524;return db[_0x146d('0x3e')]['findOne']({'where':{'id':_0x475dcb['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x3306ac,null))[_0x146d('0x35')](function(_0x4d1ba8){if(_0x4d1ba8){_0x8a0f45=_0x4d1ba8;_0x2bb826[_0x146d('0x47')]=_[_0x146d('0x42')](db[_0x146d('0x74')][_0x146d('0x3f')]);_0x2bb826[_0x146d('0x43')]=_[_0x146d('0x42')](_0x475dcb[_0x146d('0x43')]);_0x2bb826[_0x146d('0x44')]=_[_0x146d('0x45')](_0x2bb826[_0x146d('0x47')],_0x2bb826[_0x146d('0x43')]);_0x27fcf0[_0x146d('0x46')]=_[_0x146d('0x45')](_0x2bb826[_0x146d('0x47')],qs[_0x146d('0x48')](_0x475dcb[_0x146d('0x43')][_0x146d('0x48')]));_0x27fcf0[_0x146d('0x46')]=_0x27fcf0['attributes'][_0x146d('0x49')]?_0x27fcf0[_0x146d('0x46')]:_0x2bb826[_0x146d('0x47')];_0x27fcf0[_0x146d('0x62')]=qs[_0x146d('0x4c')](_0x475dcb[_0x146d('0x43')]['sort']);_0x27fcf0['where']=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x475dcb['query'],_0x2bb826['filters']));if(_0x475dcb[_0x146d('0x43')][_0x146d('0x51')]){_0x27fcf0[_0x146d('0x4d')]=_['merge'](_0x27fcf0[_0x146d('0x4d')],{'$or':_['map'](_0x27fcf0[_0x146d('0x46')],function(_0x132ec2){var _0x22558f={};_0x22558f[_0x132ec2]={'$like':'%'+_0x475dcb[_0x146d('0x43')][_0x146d('0x51')]+'%'};return _0x22558f;})});}_0x27fcf0=_['merge']({},_0x27fcf0,_0x475dcb[_0x146d('0x52')]);return _0x8a0f45['getAgents'](_0x27fcf0);}})[_0x146d('0x35')](function(_0x48353e){if(_0x48353e){_0x1a6524=_0x48353e['length'];if(!_0x475dcb[_0x146d('0x43')]['hasOwnProperty'](_0x146d('0x4b'))){_0x27fcf0[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x475dcb[_0x146d('0x43')][_0x146d('0x2f')]);_0x27fcf0[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x475dcb[_0x146d('0x43')][_0x146d('0x2e')]);}return _0x8a0f45[_0x146d('0x73')](_0x27fcf0);}})['then'](function(_0x586db6){if(_0x586db6){return _0x586db6?{'count':_0x1a6524,'rows':_0x586db6}:null;}})[_0x146d('0x35')](respondWithResult(_0x3306ac,null))['catch'](handleError(_0x3306ac,null));};exports[_0x146d('0x75')]=function(_0x113233,_0x3241b6,_0x4cadf5){return db['WhatsappAccount'][_0x146d('0x69')]({'where':{'id':_0x113233['params']['id']}})[_0x146d('0x35')](handleEntityNotFound(_0x3241b6,null))['then'](function(_0x2c51a3){if(_0x2c51a3){return db['sequelize'][_0x146d('0x76')](function(_0x18c611){return db[_0x146d('0x77')][_0x146d('0x36')]({'where':{'WhatsappAccountId':_0x113233[_0x146d('0x55')]['id']},'transaction':_0x18c611})[_0x146d('0x35')](function(_0x13a319){var _0x13e6de=_[_0x146d('0x3d')](_0x113233[_0x146d('0x5a')],function(_0x5965d9){_0x5965d9[_0x146d('0x63')]=_0x113233[_0x146d('0x55')]['id'];return _0x5965d9;});return db[_0x146d('0x77')][_0x146d('0x78')](_0x13e6de,{'transaction':_0x18c611});});})[_0x146d('0x35')](function(){return db[_0x146d('0x77')][_0x146d('0x79')]({'where':{'WhatsappAccountId':_0x113233[_0x146d('0x55')]['id']},'order':'priority'});});}})[_0x146d('0x35')](respondWithResult(_0x3241b6,null))[_0x146d('0x27')](handleError(_0x3241b6,null));};exports['getApplications']=function(_0x520a0e,_0x191dbc,_0x4712d5){var _0x3bb4ca={};var _0x5a0195={};var _0x31df50;var _0x13c662;return db[_0x146d('0x3e')][_0x146d('0x69')]({'where':{'id':_0x520a0e['params']['id']}})['then'](handleEntityNotFound(_0x191dbc,null))[_0x146d('0x35')](function(_0x4c9a9f){if(_0x4c9a9f){_0x31df50=_0x4c9a9f;_0x5a0195[_0x146d('0x47')]=_['keys'](db[_0x146d('0x77')][_0x146d('0x3f')]);_0x5a0195[_0x146d('0x43')]=_[_0x146d('0x42')](_0x520a0e[_0x146d('0x43')]);_0x5a0195[_0x146d('0x44')]=_[_0x146d('0x45')](_0x5a0195['model'],_0x5a0195[_0x146d('0x43')]);_0x3bb4ca[_0x146d('0x46')]=_[_0x146d('0x45')](_0x5a0195['model'],qs[_0x146d('0x48')](_0x520a0e[_0x146d('0x43')][_0x146d('0x48')]));_0x3bb4ca['attributes']=_0x3bb4ca[_0x146d('0x46')]['length']?_0x3bb4ca['attributes']:_0x5a0195[_0x146d('0x47')];_0x3bb4ca['order']=qs['sort'](_0x520a0e[_0x146d('0x43')][_0x146d('0x4c')]);_0x3bb4ca[_0x146d('0x4d')]=qs[_0x146d('0x44')](_[_0x146d('0x4e')](_0x520a0e[_0x146d('0x43')],_0x5a0195[_0x146d('0x44')]));if(_0x520a0e[_0x146d('0x43')][_0x146d('0x51')]){_0x3bb4ca['where']=_[_0x146d('0x4f')](_0x3bb4ca[_0x146d('0x4d')],{'$or':_[_0x146d('0x3d')](_0x3bb4ca['attributes'],function(_0x5a811c){var _0x4a6905={};_0x4a6905[_0x5a811c]={'$like':'%'+_0x520a0e[_0x146d('0x43')][_0x146d('0x51')]+'%'};return _0x4a6905;})});}_0x3bb4ca=_[_0x146d('0x4f')]({},_0x3bb4ca,_0x520a0e[_0x146d('0x52')]);return _0x31df50[_0x146d('0x7a')](_0x3bb4ca);}})[_0x146d('0x35')](function(_0x59803c){if(_0x59803c){_0x13c662=_0x59803c[_0x146d('0x49')];if(!_0x520a0e[_0x146d('0x43')][_0x146d('0x4a')](_0x146d('0x4b'))){_0x3bb4ca[_0x146d('0x2f')]=qs[_0x146d('0x2f')](_0x520a0e[_0x146d('0x43')][_0x146d('0x2f')]);_0x3bb4ca[_0x146d('0x2e')]=qs[_0x146d('0x2e')](_0x520a0e[_0x146d('0x43')]['offset']);}return _0x31df50[_0x146d('0x7a')](_0x3bb4ca);}})[_0x146d('0x35')](function(_0x566eff){if(_0x566eff){return _0x566eff?{'count':_0x13c662,'rows':_0x566eff}:null;}})[_0x146d('0x35')](respondWithResult(_0x191dbc,null))['catch'](handleError(_0x191dbc,null));};exports[_0x146d('0x7b')]=function(_0x347f46,_0x1df0d3,_0x26fddf){logger[_0x146d('0x20')]('AC\x20WhatsappAccount\x20notify');logger[_0x146d('0x20')](_0x146d('0x7c'),JSON['stringify'](_0x347f46['body']));var _0x586d18={'channel':'whatsapp'};var _0x34d9bc=[];var _0x48c94e=[];var _0x299e1={};return db[_0x146d('0x3e')]['find']({'where':{'id':_0x347f46[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0x77')],'as':_0x146d('0x7d')}]})['then'](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0x4e1d87){_0x586d18[_0x146d('0x7e')]=_0x4e1d87;_0x586d18['applications']=_[_0x146d('0x7f')](_0x4e1d87[_0x146d('0x7d')],[_0x146d('0x80')],['asc']);if(_0x586d18[_0x146d('0x7e')][_0x146d('0x7d')]){delete _0x586d18[_0x146d('0x7e')][_0x146d('0x7d')];}return db['CmContact'][_0x146d('0x81')]();})['then'](function(_0x32b9ef){if(!_0x32b9ef){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x84'));}logger[_0x146d('0x20')]('AC\x20sinch\x20attributes:%s',JSON[_0x146d('0x85')](_0x32b9ef));logger[_0x146d('0x20')](_0x146d('0x86'),JSON[_0x146d('0x85')](_0x347f46[_0x146d('0x5a')]));_0x34d9bc=_[_0x146d('0x87')](_['keys'](_0x32b9ef),['createdAt',_0x146d('0x88')]);_0x48c94e=_[_0x146d('0x87')](_['keys'](_0x32b9ef),[_0x146d('0x89'),_0x146d('0x88'),_0x146d('0x8a'),_0x146d('0x8b')]);_0x586d18[_0x146d('0x5a')]={'mapKey':_0x146d('0x8c')};logger['info']('AC\x20sinch\x20routing.account.type:%s',JSON[_0x146d('0x85')](_0x586d18['account']['type']));logger[_0x146d('0x20')](_0x146d('0x8d'),JSON['stringify'](_0x586d18[_0x146d('0x5a')]));logger['info'](_0x146d('0x8e'),_0x34d9bc);logger[_0x146d('0x20')](_0x146d('0x8f'),_0x48c94e);if(_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]&&_0x586d18['account'][_0x146d('0x40')]===_0x146d('0x90')){_0x586d18[_0x146d('0x5a')][_0x146d('0x91')]=_0x347f46['body'][_0x146d('0x92')][_0x146d('0x93')](_0x146d('0x94'),'');_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x95')];_0x586d18['body'][_0x146d('0x96')]=_0x347f46['body'][_0x146d('0x97')];}if(_0x586d18[_0x146d('0x7e')]['type']&&_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]===_0x146d('0x98')){logger[_0x146d('0x20')](_0x146d('0x99'),JSON[_0x146d('0x85')](_0x347f46[_0x146d('0x5a')]));_0x586d18[_0x146d('0x5a')][_0x146d('0x91')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x9a')][0x0][_0x146d('0x91')];_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]=_0x347f46[_0x146d('0x5a')][_0x146d('0x9a')][0x0][_0x146d('0x26')]['body'];_0x586d18['body'][_0x146d('0x96')]=_0x347f46['body'][_0x146d('0x9a')][0x0][_0x146d('0x9b')];}if(_0x586d18['body']['id']){delete _0x586d18['body']['id'];}if(_[_0x146d('0x9c')](_0x586d18[_0x146d('0x5a')][_0x146d('0x91')])){throw new db[(_0x146d('0x82'))]['ValidationError'](_0x146d('0x9d'));}if(_[_0x146d('0x9c')](_0x586d18['body'][_0x146d('0x5a')])||_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')]===''){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x9e'));}if(_['isNil'](_0x586d18['body'][_0x146d('0x9f')])){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48c94e);}if(!_[_0x146d('0xa0')](_0x48c94e,_0x586d18[_0x146d('0x5a')][_0x146d('0x9f')])){throw new db[(_0x146d('0x82'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48c94e);}_0x299e1[_0x586d18['body'][_0x146d('0x9f')]]=_0x586d18['body'][_0x146d('0x91')];return db[_0x146d('0xa1')]['find']({'where':{'id':_0x586d18[_0x146d('0x7e')][_0x146d('0x8b')]},'include':[{'model':db[_0x146d('0xa2')],'as':_0x146d('0xa3'),'where':_0x299e1,'limit':0x1,'order':[[_0x146d('0x88'),'DESC']]}]});})[_0x146d('0x35')](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0x236553){if(_0x236553){_0x586d18[_0x146d('0xa4')]=_['omit'](_0x236553,[_0x146d('0xa3')]);if(_0x236553[_0x146d('0xa3')][_0x146d('0x49')]){return _0x236553[_0x146d('0xa3')][0x0];}var _0x3ac716=_[_0x146d('0xa5')](_0x586d18['body'],{'firstName':_0x586d18[_0x146d('0x5a')]['from'],'ListId':_0x236553['id']});_0x3ac716[_0x586d18['body'][_0x146d('0x9f')]]=_0x586d18[_0x146d('0x5a')]['from'];return db[_0x146d('0xa2')][_0x146d('0x59')](_0x3ac716,{'fields':_0x34d9bc,'raw':!![]});}})[_0x146d('0x35')](handleEntityNotFound(_0x1df0d3,null))[_0x146d('0x35')](function(_0xcdae21){if(_0xcdae21){_0x586d18[_0x146d('0xa6')]=_0xcdae21;var _0x57402b={'ContactId':_0xcdae21['id'],'phone':_0x586d18[_0x146d('0x5a')][_0x146d('0x91')],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id']};var _0x4abf87={'ContactId':_0xcdae21['id'],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id'],'closed':![]};return db[_0x146d('0xa7')][_0x146d('0x58')]({'where':_0x4abf87})['then'](function(_0x3da5f3){if(_0x3da5f3){return[_0x3da5f3,![]];}return db[_0x146d('0xa7')][_0x146d('0x59')](_0x57402b)[_0x146d('0x35')](function(_0x162b2e){return[_0x162b2e,!![]];});});}})[_0x146d('0x6d')](function(_0x515200,_0x2db40c){_0x586d18[_0x146d('0xa8')]=_0x515200[_0x146d('0x5c')]({'plain':!![]});_0x586d18[_0x146d('0xa8')][_0x146d('0xa9')]=![];if(_0x2db40c){if(_0x586d18['account']['autoclose']){_0x586d18[_0x146d('0xaa')][_0x146d('0xab')]({'id':0x0,'priority':_0x586d18[_0x146d('0xaa')][_0x146d('0x49')]+0x1,'app':_0x146d('0xac'),'appdata':_0x146d('0xad'),'interval':_0x146d('0xae')});}_0x586d18[_0x146d('0xa8')][_0x146d('0xa9')]=!![];}return db[_0x146d('0xaf')]['create']({'phone':_0x586d18[_0x146d('0x5a')][_0x146d('0x91')],'messageId':_0x586d18[_0x146d('0x5a')]['messageId'],'body':_0x586d18[_0x146d('0x5a')][_0x146d('0x5a')],'WhatsappAccountId':_0x347f46[_0x146d('0x55')]['id'],'WhatsappInteractionId':_0x515200['id'],'direction':'in','ContactId':_0x515200[_0x146d('0xb0')],'AttachmentId':_0x586d18[_0x146d('0x5a')][_0x146d('0xb1')]});})[_0x146d('0x35')](function(_0x1d7bc8){_0x586d18[_0x146d('0x26')]=_0x1d7bc8;if(_0x586d18[_0x146d('0xa8')]['UserId']){return db[_0x146d('0x74')]['find']({'attributes':['id',_0x146d('0x39')],'where':{'id':_0x586d18['interaction'][_0x146d('0xb2')]}})[_0x146d('0x35')](function(_0x46131b){if(_0x46131b){_0x586d18['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x46131b['name']+','+(_0x586d18[_0x146d('0x7e')][_0x146d('0xb3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x146d('0xb4'),_0x146d('0xb5'),_0x586d18);});}return respondWithRpcPromise('Start',_0x146d('0xb5'),_0x586d18);})['then'](function(_0x5a8960){if(_0x5a8960){var _0xf9b078=0xc8;var _0x5983d7=_0x146d('0xb6');logger[_0x146d('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5983d7,_0xf9b078,_0x146d('0xb7'));logger[_0x146d('0x22')](_0x146d('0xb8'),_0x5983d7,_0xf9b078,'entity\x20found',JSON[_0x146d('0x85')](_0x5a8960));if(_0x586d18[_0x146d('0x7e')][_0x146d('0x40')]===_0x146d('0x90')){return _0x1df0d3[_0x146d('0x29')](_0xf9b078)[_0x146d('0xb9')](_0x146d('0xba'),_0x146d('0xbb'))[_0x146d('0x3a')](_0x146d('0xbc'));}else{return _0x1df0d3['status'](_0xf9b078)[_0x146d('0x2b')](_0x5a8960);}}})[_0x146d('0x27')](handleError(_0x1df0d3,null));};exports[_0x146d('0x3a')]=function(_0xf65f56,_0x260535,_0x26f79f){var _0x3cf248,_0x3286c0,_0x31d8c7;if(_[_0x146d('0x9c')](_0xf65f56[_0x146d('0x5a')]['body'])||_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')]===''){throw new db[(_0x146d('0x82'))][(_0x146d('0x83'))](_0x146d('0x9e'));}if(_[_0x146d('0x9c')](_0xf65f56[_0x146d('0x5a')]['to'])){throw new db['Sequelize'][(_0x146d('0x83'))](_0x146d('0xbd'));}_0x3cf248=_0xf65f56[_0x146d('0x5a')]['to'];return db[_0x146d('0x3e')][_0x146d('0x58')]({'where':{'id':_0xf65f56[_0x146d('0x55')]['id']},'include':[{'model':db[_0x146d('0xa1')],'as':'List','include':[{'model':db[_0x146d('0xa2')],'as':_0x146d('0xa3'),'where':{'mobile':_0x3cf248},'limit':0x1,'order':[[_0x146d('0x88'),_0x146d('0xbe')]]}]}]})[_0x146d('0x35')](handleEntityNotFound(_0x260535,null))[_0x146d('0x35')](function(_0x37267e){if(_0x37267e&&_0x37267e[_0x146d('0xbf')]){_0x3286c0=_0x37267e[_0x146d('0x5c')]({'plain':!![]});if(_0x3286c0[_0x146d('0xbf')]&&_0x3286c0[_0x146d('0xbf')][_0x146d('0xa3')][_0x146d('0x49')]){return _0x3286c0[_0x146d('0xbf')]['Contacts'][0x0];}return db['CmContact'][_0x146d('0x59')](_[_0x146d('0xa5')](_0xf65f56['body'],{'firstName':_0x3cf248,'mobile':_0x3cf248,'phone':_0x3cf248,'ListId':_0x3286c0[_0x146d('0x8b')]}));}})['then'](handleEntityNotFound(_0x260535,null))['then'](function(_0x49a259){if(_0x49a259){_0x31d8c7=_0x49a259;return db['WhatsappInteraction'][_0x146d('0x58')]({'where':{'ContactId':_0x31d8c7['id'],'closed':![],'WhatsappAccountId':_0x3286c0['id']}})[_0x146d('0x35')](function(_0x246d55){if(_0x246d55){return[_0x246d55,![]];}return db[_0x146d('0xa7')][_0x146d('0x59')]({'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id'],'WhatsappAccountId':_0x3286c0['id'],'phone':_0x3cf248,'firstMsgDirection':'out','Messages':[_[_0x146d('0x4f')](_0xf65f56[_0x146d('0x5a')],{'read':![],'body':_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')],'phone':_0x3cf248,'WhatsappAccountId':_0x3286c0['id'],'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x146d('0xc0')}]})[_0x146d('0x35')](function(_0x55ed78){return[_0x55ed78,!![]];});});}})[_0x146d('0x6d')](function(_0x2b1e2a,_0x419773){if(_0x419773){return _0x2b1e2a;}return db[_0x146d('0xaf')][_0x146d('0x59')](_['merge'](_0xf65f56['body'],{'read':![],'body':_0xf65f56[_0x146d('0x5a')][_0x146d('0x5a')],'phone':_0x3cf248,'WhatsappAccountId':_0x3286c0['id'],'WhatsappInteractionId':_0x2b1e2a['id'],'UserId':_0xf65f56[_0x146d('0x5b')]['id'],'ContactId':_0x31d8c7['id']}))[_0x146d('0x35')](function(_0x451e32){_0x2b1e2a[_0x146d('0xc1')]['Messages']=[];_0x2b1e2a['dataValues'][_0x146d('0xc0')]['push'](_0x451e32[_0x146d('0xc1')]);return _0x2b1e2a;});})[_0x146d('0x35')](respondWithResult(_0x260535,null))['catch'](handleError(_0x260535,null));}; \ No newline at end of file +var _0x0102=['../../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','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','AC\x20WhatsappAccount\x20notify','AC\x20WhatsappAccount\x20req.body:%s','whatsapp','Applications','account','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','AC\x20sinch\x20req.body:%s','difference','updatedAt','createdAt','CompanyId','AC\x20sinch\x20routing.account.type:%s','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','whatsapp:','Body','messageId','MessageSid','sinch','AC\x20sinch\x20req.body\x202:%s','notifications','message_id','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','user','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x526c53,_0x7f7778){var _0x1f7fbc=function(_0x59870f){while(--_0x59870f){_0x526c53['push'](_0x526c53['shift']());}};_0x1f7fbc(++_0x7f7778);}(_0x0102,0x186));var _0x2010=function(_0x5ae9c7,_0x28c6e1){_0x5ae9c7=_0x5ae9c7-0x0;var _0x2490ab=_0x0102[_0x5ae9c7];return _0x2490ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];config[_0x2010('0x18')]=_[_0x2010('0x19')](config[_0x2010('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2010('0x18')]));require(_0x2010('0x1a'))[_0x2010('0x1b')](socket);var jayson=require(_0x2010('0x1c'));var client=jayson[_0x2010('0x1d')][_0x2010('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x517ff4,_0x3195fa,_0x136418,_0x5ad412){return new BPromise(function(_0x41e267,_0x11c94b){var _0x410889=_0x5ad412||client;return _0x410889[_0x2010('0x1f')](_0x517ff4,_0x136418)[_0x2010('0x20')](function(_0x11bd28){logger[_0x2010('0x21')](_0x2010('0x22'),_0x3195fa,_0x2010('0x23'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3195fa,_0x2010('0x23'),JSON[_0x2010('0x24')](_0x11bd28));if(_0x11bd28[_0x2010('0x25')]){if(_0x11bd28[_0x2010('0x25')]['code']===0x1f4){logger['error'](_0x2010('0x22'),_0x3195fa,_0x11bd28[_0x2010('0x25')][_0x2010('0x26')]);return _0x11c94b(_0x11bd28[_0x2010('0x25')][_0x2010('0x26')]);}logger[_0x2010('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x3195fa,_0x11bd28[_0x2010('0x25')][_0x2010('0x26')]);return _0x41e267(_0x11bd28['error']['message']);}else{logger['info'](_0x2010('0x22'),_0x3195fa,'request\x20sent');_0x41e267(_0x11bd28[_0x2010('0x27')]['message']);}})['catch'](function(_0xdb57be){logger[_0x2010('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x3195fa,_0xdb57be);_0x11c94b(_0xdb57be);});});}function respondWithStatusCode(_0x99ebe0,_0x4cff59){_0x4cff59=_0x4cff59||0xcc;return function(_0x2a12ee){if(_0x2a12ee){return _0x99ebe0[_0x2010('0x28')](_0x4cff59);}return _0x99ebe0[_0x2010('0x29')](_0x4cff59)[_0x2010('0x2a')]();};}function respondWithResult(_0x3c5862,_0x2f63bb){_0x2f63bb=_0x2f63bb||0xc8;return function(_0x981b65){if(_0x981b65){return _0x3c5862[_0x2010('0x29')](_0x2f63bb)[_0x2010('0x2b')](_0x981b65);}};}function respondWithFilteredResult(_0x103460,_0x122ee3){return function(_0x2ebdbb){if(_0x2ebdbb){var _0x499cbe=typeof _0x122ee3[_0x2010('0x2c')]==='undefined'&&typeof _0x122ee3[_0x2010('0x2d')]===_0x2010('0x2e');var _0xd16c04=_0x2ebdbb[_0x2010('0x2f')];var _0x564a64=_0x499cbe?0x0:_0x122ee3['offset'];var _0x136d5f=_0x499cbe?_0x2ebdbb['count']:_0x122ee3[_0x2010('0x2c')]+_0x122ee3[_0x2010('0x2d')];var _0x5a7544;if(_0x136d5f>=_0xd16c04){_0x136d5f=_0xd16c04;_0x5a7544=0xc8;}else{_0x5a7544=0xce;}_0x103460[_0x2010('0x29')](_0x5a7544);return _0x103460[_0x2010('0x30')](_0x2010('0x31'),_0x564a64+'-'+_0x136d5f+'/'+_0xd16c04)[_0x2010('0x2b')](_0x2ebdbb);}return null;};}function patchUpdates(_0x692ddc){return function(_0x4e4379){try{jsonpatch[_0x2010('0x32')](_0x4e4379,_0x692ddc,!![]);}catch(_0x2da2a1){return BPromise[_0x2010('0x33')](_0x2da2a1);}return _0x4e4379['save']();};}function saveUpdates(_0x4b1884,_0x113bc0){return function(_0x21e215){if(_0x21e215){return _0x21e215[_0x2010('0x34')](_0x4b1884)['then'](function(_0x590a8b){return _0x590a8b;});}return null;};}function removeEntity(_0xac64e1,_0xaf5aed){return function(_0x32ddfa){if(_0x32ddfa){return _0x32ddfa[_0x2010('0x35')]()[_0x2010('0x20')](function(){var _0x4af737=_0x32ddfa['get']({'plain':!![]});var _0x554c5e=_0x2010('0x36');return db[_0x2010('0x37')][_0x2010('0x35')]({'where':{'type':_0x554c5e,'resourceId':_0x4af737['id']}})['then'](function(){return _0x32ddfa;});})[_0x2010('0x20')](function(){_0xac64e1[_0x2010('0x29')](0xcc)[_0x2010('0x2a')]();});}};}function handleEntityNotFound(_0x243017,_0x4f5106){return function(_0x2b7649){if(!_0x2b7649){_0x243017[_0x2010('0x28')](0x194);}return _0x2b7649;};}function handleError(_0x35a72b,_0x56bba9){_0x56bba9=_0x56bba9||0x1f4;return function(_0x232d86){logger['error'](_0x232d86[_0x2010('0x38')]);if(_0x232d86[_0x2010('0x39')]){delete _0x232d86[_0x2010('0x39')];}_0x35a72b[_0x2010('0x29')](_0x56bba9)[_0x2010('0x3a')](_0x232d86);};}exports[_0x2010('0x3b')]=function(_0x53c09e,_0x1e4460){var _0x4ff805={'include':[{'model':db[_0x2010('0x3c')],'as':_0x2010('0x3d')}]},_0x3e5422={},_0x157c73={'count':0x0,'rows':[]};var _0x3f9338=_[_0x2010('0x3e')](db[_0x2010('0x3f')][_0x2010('0x40')],function(_0x2fcaef){return{'name':_0x2fcaef[_0x2010('0x41')],'type':_0x2fcaef[_0x2010('0x42')][_0x2010('0x43')]};});_0x3e5422[_0x2010('0x44')]=_[_0x2010('0x3e')](_0x3f9338,'name');_0x3e5422['query']=_[_0x2010('0x45')](_0x53c09e[_0x2010('0x46')]);_0x3e5422[_0x2010('0x47')]=_[_0x2010('0x48')](_0x3e5422[_0x2010('0x44')],_0x3e5422[_0x2010('0x46')]);_0x4ff805[_0x2010('0x49')]=_['intersection'](_0x3e5422[_0x2010('0x44')],qs['fields'](_0x53c09e[_0x2010('0x46')][_0x2010('0x4a')]));_0x4ff805[_0x2010('0x49')]=_0x4ff805[_0x2010('0x49')][_0x2010('0x4b')]?_0x4ff805['attributes']:_0x3e5422[_0x2010('0x44')];if(!_0x53c09e[_0x2010('0x46')][_0x2010('0x4c')](_0x2010('0x4d'))){_0x4ff805['limit']=qs[_0x2010('0x2d')](_0x53c09e['query']['limit']);_0x4ff805['offset']=qs[_0x2010('0x2c')](_0x53c09e[_0x2010('0x46')][_0x2010('0x2c')]);}_0x4ff805[_0x2010('0x4e')]=qs[_0x2010('0x4f')](_0x53c09e[_0x2010('0x46')]['sort']);_0x4ff805[_0x2010('0x50')]=qs[_0x2010('0x47')](_[_0x2010('0x51')](_0x53c09e['query'],_0x3e5422['filters']),_0x3f9338);if(_0x53c09e[_0x2010('0x46')]['filter']){_0x4ff805[_0x2010('0x50')]=_[_0x2010('0x52')](_0x4ff805[_0x2010('0x50')],{'$or':_[_0x2010('0x3e')](_0x3f9338,function(_0x53498c){if(_0x53498c[_0x2010('0x42')]!==_0x2010('0x53')){var _0x2e2703={};_0x2e2703[_0x53498c[_0x2010('0x39')]]={'$like':'%'+_0x53c09e[_0x2010('0x46')][_0x2010('0x54')]+'%'};return _0x2e2703;}})});}_0x4ff805=_['merge']({},_0x4ff805,_0x53c09e[_0x2010('0x55')]);var _0x6eee92={'where':_0x4ff805[_0x2010('0x50')]};return db['WhatsappAccount'][_0x2010('0x2f')](_0x6eee92)[_0x2010('0x20')](function(_0x54f23a){_0x157c73[_0x2010('0x2f')]=_0x54f23a;if(_0x53c09e[_0x2010('0x46')][_0x2010('0x56')]){_0x4ff805[_0x2010('0x57')]=[{'all':!![]}];}return db[_0x2010('0x3f')][_0x2010('0x58')](_0x4ff805);})[_0x2010('0x20')](function(_0x2133a6){_0x157c73['rows']=_0x2133a6;return _0x157c73;})['then'](respondWithFilteredResult(_0x1e4460,_0x4ff805))[_0x2010('0x59')](handleError(_0x1e4460,null));};exports[_0x2010('0x5a')]=function(_0x5397f4,_0x422b3c){var _0x46776b={'raw':![],'where':{'id':_0x5397f4[_0x2010('0x5b')]['id']},'include':[{'model':db[_0x2010('0x3c')],'as':'mandatoryDispositionPause'}]},_0xcf8c5b={};_0xcf8c5b['model']=_[_0x2010('0x45')](db[_0x2010('0x3f')][_0x2010('0x40')]);_0xcf8c5b[_0x2010('0x46')]=_[_0x2010('0x45')](_0x5397f4[_0x2010('0x46')]);_0xcf8c5b[_0x2010('0x47')]=_[_0x2010('0x48')](_0xcf8c5b[_0x2010('0x44')],_0xcf8c5b[_0x2010('0x46')]);_0x46776b[_0x2010('0x49')]=_['intersection'](_0xcf8c5b[_0x2010('0x44')],qs[_0x2010('0x4a')](_0x5397f4['query'][_0x2010('0x4a')]));_0x46776b[_0x2010('0x49')]=_0x46776b[_0x2010('0x49')][_0x2010('0x4b')]?_0x46776b[_0x2010('0x49')]:_0xcf8c5b[_0x2010('0x44')];if(_0x5397f4[_0x2010('0x46')][_0x2010('0x56')]){_0x46776b[_0x2010('0x57')]=[{'all':!![]}];}_0x46776b=_[_0x2010('0x52')]({},_0x46776b,_0x5397f4[_0x2010('0x55')]);return db[_0x2010('0x3f')][_0x2010('0x5c')](_0x46776b)[_0x2010('0x20')](handleEntityNotFound(_0x422b3c,null))[_0x2010('0x20')](respondWithResult(_0x422b3c,null))[_0x2010('0x59')](handleError(_0x422b3c,null));};exports[_0x2010('0x5d')]=function(_0x27e8c0,_0x2d7765){return db[_0x2010('0x3f')][_0x2010('0x5d')](_0x27e8c0[_0x2010('0x5e')],{})[_0x2010('0x20')](function(_0x5a31f7){var _0x1a9ed0=_0x27e8c0['user']['get']({'plain':!![]});if(!_0x1a9ed0)throw new Error(_0x2010('0x5f'));if(_0x1a9ed0[_0x2010('0x60')]==='user'){var _0x4d124e=_0x5a31f7[_0x2010('0x61')]({'plain':!![]});var _0xf0cfce=_0x2010('0x36');return db['UserProfileSection'][_0x2010('0x5c')]({'where':{'name':_0xf0cfce,'userProfileId':_0x1a9ed0[_0x2010('0x62')]},'raw':!![]})[_0x2010('0x20')](function(_0x137fb9){if(_0x137fb9&&_0x137fb9['autoAssociation']===0x0){return db[_0x2010('0x37')]['create']({'name':_0x4d124e[_0x2010('0x39')],'resourceId':_0x4d124e['id'],'type':_0x137fb9[_0x2010('0x39')],'sectionId':_0x137fb9['id']},{})[_0x2010('0x20')](function(){return _0x5a31f7;});}else{return _0x5a31f7;}})[_0x2010('0x59')](function(_0x49a20d){logger['error'](_0x2010('0x63'),_0x49a20d);throw _0x49a20d;});}return _0x5a31f7;})[_0x2010('0x20')](respondWithResult(_0x2d7765,0xc9))['catch'](handleError(_0x2d7765,null));};exports['update']=function(_0x458849,_0x1b7387){if(_0x458849[_0x2010('0x5e')]['id']){delete _0x458849[_0x2010('0x5e')]['id'];}return db['WhatsappAccount'][_0x2010('0x5c')]({'where':{'id':_0x458849['params']['id']},'include':[{'model':db[_0x2010('0x3c')],'as':_0x2010('0x3d')}]})[_0x2010('0x20')](handleEntityNotFound(_0x1b7387,null))[_0x2010('0x20')](saveUpdates(_0x458849['body'],null))[_0x2010('0x20')](respondWithResult(_0x1b7387,null))[_0x2010('0x59')](handleError(_0x1b7387,null));};exports['destroy']=function(_0x3841fa,_0x3a608e){return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x3841fa[_0x2010('0x5b')]['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x3a608e,null))[_0x2010('0x20')](removeEntity(_0x3a608e,null))[_0x2010('0x59')](handleError(_0x3a608e,null));};exports[_0x2010('0x64')]=function(_0x14b196,_0x3a8cfb){return db[_0x2010('0x3f')]['describe']()[_0x2010('0x20')](respondWithResult(_0x3a8cfb,null))[_0x2010('0x59')](handleError(_0x3a8cfb,null));};exports[_0x2010('0x65')]=function(_0x5f5230,_0x5ca75a,_0x24466f){if(_0x5f5230[_0x2010('0x5e')]['id']){delete _0x5f5230[_0x2010('0x5e')]['id'];}return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x5f5230[_0x2010('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ca75a,null))[_0x2010('0x20')](function(_0xd6a734){if(_0xd6a734){_0x5f5230[_0x2010('0x5e')]['WhatsappAccountId']=_0xd6a734['id'];return db[_0x2010('0x66')][_0x2010('0x5d')](_0x5f5230[_0x2010('0x5e')]);}})['then'](respondWithResult(_0x5ca75a,null))[_0x2010('0x59')](handleError(_0x5ca75a,null));};exports[_0x2010('0x67')]=function(_0x4adc1c,_0x493c89,_0x30b13d){var _0x487d55={'raw':![],'where':{}};var _0x4c55be={};var _0x166143={'count':0x0,'rows':[]};return db[_0x2010('0x3f')][_0x2010('0x68')]({'where':{'id':_0x4adc1c[_0x2010('0x5b')]['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x493c89,null))[_0x2010('0x20')](function(_0xdf6767){if(_0xdf6767){_0x4c55be[_0x2010('0x44')]=_[_0x2010('0x45')](db[_0x2010('0x66')]['rawAttributes']);_0x4c55be[_0x2010('0x46')]=_[_0x2010('0x45')](_0x4adc1c['query']);_0x4c55be[_0x2010('0x47')]=_[_0x2010('0x48')](_0x4c55be[_0x2010('0x44')],_0x4c55be[_0x2010('0x46')]);_0x487d55['attributes']=_[_0x2010('0x48')](_0x4c55be[_0x2010('0x44')],qs['fields'](_0x4adc1c['query'][_0x2010('0x4a')]));_0x487d55['attributes']=_0x487d55[_0x2010('0x49')][_0x2010('0x4b')]?_0x487d55[_0x2010('0x49')]:_0x4c55be[_0x2010('0x44')];if(!_0x4adc1c[_0x2010('0x46')][_0x2010('0x4c')](_0x2010('0x4d'))){_0x487d55['limit']=qs[_0x2010('0x2d')](_0x4adc1c[_0x2010('0x46')][_0x2010('0x2d')]);_0x487d55['offset']=qs[_0x2010('0x2c')](_0x4adc1c[_0x2010('0x46')][_0x2010('0x2c')]);}_0x487d55[_0x2010('0x4e')]=qs[_0x2010('0x4f')](_0x4adc1c[_0x2010('0x46')][_0x2010('0x4f')]);_0x487d55[_0x2010('0x50')]=qs['filters'](_[_0x2010('0x51')](_0x4adc1c[_0x2010('0x46')],_0x4c55be[_0x2010('0x47')]));_0x487d55['where'][_0x2010('0x69')]=_0xdf6767['id'];if(_0x4adc1c[_0x2010('0x46')]['filter']){_0x487d55[_0x2010('0x50')]=_[_0x2010('0x52')](_0x487d55[_0x2010('0x50')],{'$or':_[_0x2010('0x3e')](_0x487d55[_0x2010('0x49')],function(_0x543db2){var _0xe2c487={};_0xe2c487[_0x543db2]={'$like':'%'+_0x4adc1c[_0x2010('0x46')]['filter']+'%'};return _0xe2c487;})});}_0x487d55=_[_0x2010('0x52')]({},_0x487d55,_0x4adc1c[_0x2010('0x55')]);return db['Disposition'][_0x2010('0x2f')]({'where':_0x487d55['where']})['then'](function(_0x44e47e){_0x166143[_0x2010('0x2f')]=_0x44e47e;if(_0x4adc1c[_0x2010('0x46')][_0x2010('0x56')]){_0x487d55[_0x2010('0x57')]=[{'all':!![]}];}return db[_0x2010('0x66')]['findAll'](_0x487d55);})[_0x2010('0x20')](function(_0x881954){_0x166143[_0x2010('0x6a')]=_0x881954;return _0x166143;});}})[_0x2010('0x20')](respondWithFilteredResult(_0x493c89,_0x487d55))['catch'](handleError(_0x493c89,null));};exports[_0x2010('0x6b')]=function(_0x48b45b,_0x364d51,_0x30b541){return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x48b45b['params']['id']}})['then'](handleEntityNotFound(_0x364d51,null))['then'](function(_0x86082e){if(_0x86082e){return _0x86082e['removeDispositions'](_0x48b45b[_0x2010('0x46')][_0x2010('0x6c')]);}})['then'](respondWithStatusCode(_0x364d51,null))[_0x2010('0x59')](handleError(_0x364d51,null));};exports['addAnswer']=function(_0x41792f,_0x160751,_0x3506c7){if(_0x41792f[_0x2010('0x5e')]['id']){delete _0x41792f['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x41792f[_0x2010('0x5b')]['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x160751,null))['then'](function(_0x2d0530){if(_0x2d0530){_0x41792f['body'][_0x2010('0x69')]=_0x2d0530['id'];return db[_0x2010('0x6d')][_0x2010('0x5d')](_0x41792f[_0x2010('0x5e')]);}})[_0x2010('0x20')](respondWithResult(_0x160751,null))[_0x2010('0x59')](handleError(_0x160751,null));};exports[_0x2010('0x6e')]=function(_0x570454,_0x2ea2eb,_0x41c530){var _0x521f51={'raw':![],'where':{}};var _0x3301e9={};var _0x6a0c69={'count':0x0,'rows':[]};return db[_0x2010('0x3f')][_0x2010('0x68')]({'where':{'id':_0x570454[_0x2010('0x5b')]['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x2ea2eb,null))[_0x2010('0x20')](function(_0x22d3b1){if(_0x22d3b1){_0x3301e9[_0x2010('0x44')]=_['keys'](db[_0x2010('0x6d')][_0x2010('0x40')]);_0x3301e9[_0x2010('0x46')]=_['keys'](_0x570454['query']);_0x3301e9[_0x2010('0x47')]=_[_0x2010('0x48')](_0x3301e9[_0x2010('0x44')],_0x3301e9[_0x2010('0x46')]);_0x521f51[_0x2010('0x49')]=_[_0x2010('0x48')](_0x3301e9[_0x2010('0x44')],qs[_0x2010('0x4a')](_0x570454[_0x2010('0x46')]['fields']));_0x521f51[_0x2010('0x49')]=_0x521f51[_0x2010('0x49')][_0x2010('0x4b')]?_0x521f51[_0x2010('0x49')]:_0x3301e9[_0x2010('0x44')];if(!_0x570454[_0x2010('0x46')]['hasOwnProperty']('nolimit')){_0x521f51[_0x2010('0x2d')]=qs[_0x2010('0x2d')](_0x570454[_0x2010('0x46')]['limit']);_0x521f51['offset']=qs['offset'](_0x570454[_0x2010('0x46')]['offset']);}_0x521f51[_0x2010('0x4e')]=qs[_0x2010('0x4f')](_0x570454[_0x2010('0x46')][_0x2010('0x4f')]);_0x521f51[_0x2010('0x50')]=qs[_0x2010('0x47')](_['pick'](_0x570454[_0x2010('0x46')],_0x3301e9[_0x2010('0x47')]));_0x521f51[_0x2010('0x50')][_0x2010('0x69')]=_0x22d3b1['id'];if(_0x570454['query'][_0x2010('0x54')]){_0x521f51[_0x2010('0x50')]=_[_0x2010('0x52')](_0x521f51[_0x2010('0x50')],{'$or':_[_0x2010('0x3e')](_0x521f51[_0x2010('0x49')],function(_0xb05e65){var _0x3e6d10={};_0x3e6d10[_0xb05e65]={'$like':'%'+_0x570454[_0x2010('0x46')][_0x2010('0x54')]+'%'};return _0x3e6d10;})});}_0x521f51=_[_0x2010('0x52')]({},_0x521f51,_0x570454[_0x2010('0x55')]);return db[_0x2010('0x6d')][_0x2010('0x2f')]({'where':_0x521f51['where']})[_0x2010('0x20')](function(_0x2b8689){_0x6a0c69[_0x2010('0x2f')]=_0x2b8689;if(_0x570454[_0x2010('0x46')]['includeAll']){_0x521f51[_0x2010('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2010('0x58')](_0x521f51);})[_0x2010('0x20')](function(_0x2d10a8){_0x6a0c69[_0x2010('0x6a')]=_0x2d10a8;return _0x6a0c69;});}})[_0x2010('0x20')](respondWithFilteredResult(_0x2ea2eb,_0x521f51))[_0x2010('0x59')](handleError(_0x2ea2eb,null));};exports['removeAnswers']=function(_0x400a67,_0x59f548,_0x10fa60){return db['WhatsappAccount']['find']({'where':{'id':_0x400a67[_0x2010('0x5b')]['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x59f548,null))['then'](function(_0x4b2942){if(_0x4b2942){return _0x4b2942[_0x2010('0x6f')](_0x400a67['query'][_0x2010('0x6c')]);}})[_0x2010('0x20')](respondWithStatusCode(_0x59f548,null))['catch'](handleError(_0x59f548,null));};exports[_0x2010('0x70')]=function(_0x1654a9,_0x165828,_0x4c8041){return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x1654a9['params']['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x165828,null))['then'](function(_0x3fb342){if(_0x3fb342){return _0x3fb342[_0x2010('0x70')](_0x1654a9[_0x2010('0x5e')][_0x2010('0x6c')],_[_0x2010('0x71')](_0x1654a9[_0x2010('0x5e')],['ids','id'])||{})['spread'](function(_0x17caab){for(var _0x229cb7=0x0;_0x229cb7<_0x1654a9['body'][_0x2010('0x6c')][_0x2010('0x4b')];_0x229cb7+=0x1){socket[_0x2010('0x72')](_0x2010('0x73'),{'UserId':Number(_0x1654a9[_0x2010('0x5e')]['ids'][_0x229cb7]),'WhatsappAccountId':Number(_0x1654a9[_0x2010('0x5b')]['id'])});}return _0x17caab;});}})[_0x2010('0x20')](respondWithResult(_0x165828,null))['catch'](handleError(_0x165828,null));};exports[_0x2010('0x74')]=function(_0x18e972,_0x997a63,_0x3a6d97){return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x18e972['params']['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x997a63,null))[_0x2010('0x20')](function(_0x5e4912){if(_0x5e4912){return _0x5e4912[_0x2010('0x74')](_0x18e972[_0x2010('0x46')][_0x2010('0x6c')])[_0x2010('0x20')](function(){if(_[_0x2010('0x75')](_0x18e972[_0x2010('0x46')]['ids'])){for(var _0x5ac5f5=0x0;_0x5ac5f5<_0x18e972[_0x2010('0x46')][_0x2010('0x6c')][_0x2010('0x4b')];_0x5ac5f5+=0x1){socket[_0x2010('0x72')](_0x2010('0x76'),{'UserId':Number(_0x18e972['query']['ids'][_0x5ac5f5]),'WhatsappAccountId':Number(_0x18e972['params']['id'])});}}else{socket[_0x2010('0x72')](_0x2010('0x76'),{'UserId':Number(_0x18e972['query'][_0x2010('0x6c')]),'WhatsappAccountId':Number(_0x18e972['params']['id'])});}});}})[_0x2010('0x20')](respondWithStatusCode(_0x997a63,null))['catch'](handleError(_0x997a63,null));};exports[_0x2010('0x77')]=function(_0x37d200,_0x2c2873,_0x272a7c){var _0x2a8de6={};var _0xba3d39={};var _0x5a7723;var _0x523281;return db[_0x2010('0x3f')][_0x2010('0x68')]({'where':{'id':_0x37d200['params']['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x2c2873,null))['then'](function(_0x14e3eb){if(_0x14e3eb){_0x5a7723=_0x14e3eb;_0xba3d39[_0x2010('0x44')]=_['keys'](db[_0x2010('0x78')][_0x2010('0x40')]);_0xba3d39[_0x2010('0x46')]=_[_0x2010('0x45')](_0x37d200[_0x2010('0x46')]);_0xba3d39[_0x2010('0x47')]=_[_0x2010('0x48')](_0xba3d39[_0x2010('0x44')],_0xba3d39['query']);_0x2a8de6[_0x2010('0x49')]=_[_0x2010('0x48')](_0xba3d39[_0x2010('0x44')],qs[_0x2010('0x4a')](_0x37d200['query'][_0x2010('0x4a')]));_0x2a8de6[_0x2010('0x49')]=_0x2a8de6[_0x2010('0x49')][_0x2010('0x4b')]?_0x2a8de6[_0x2010('0x49')]:_0xba3d39['model'];_0x2a8de6['order']=qs['sort'](_0x37d200[_0x2010('0x46')][_0x2010('0x4f')]);_0x2a8de6['where']=qs['filters'](_[_0x2010('0x51')](_0x37d200[_0x2010('0x46')],_0xba3d39[_0x2010('0x47')]));if(_0x37d200[_0x2010('0x46')][_0x2010('0x54')]){_0x2a8de6['where']=_[_0x2010('0x52')](_0x2a8de6['where'],{'$or':_[_0x2010('0x3e')](_0x2a8de6[_0x2010('0x49')],function(_0x4f7427){var _0x4108d8={};_0x4108d8[_0x4f7427]={'$like':'%'+_0x37d200[_0x2010('0x46')][_0x2010('0x54')]+'%'};return _0x4108d8;})});}_0x2a8de6=_[_0x2010('0x52')]({},_0x2a8de6,_0x37d200[_0x2010('0x55')]);return _0x5a7723['getAgents'](_0x2a8de6);}})[_0x2010('0x20')](function(_0xa46bcd){if(_0xa46bcd){_0x523281=_0xa46bcd[_0x2010('0x4b')];if(!_0x37d200[_0x2010('0x46')][_0x2010('0x4c')](_0x2010('0x4d'))){_0x2a8de6[_0x2010('0x2d')]=qs['limit'](_0x37d200['query'][_0x2010('0x2d')]);_0x2a8de6[_0x2010('0x2c')]=qs[_0x2010('0x2c')](_0x37d200['query'][_0x2010('0x2c')]);}return _0x5a7723[_0x2010('0x77')](_0x2a8de6);}})['then'](function(_0x3a23a7){if(_0x3a23a7){return _0x3a23a7?{'count':_0x523281,'rows':_0x3a23a7}:null;}})[_0x2010('0x20')](respondWithResult(_0x2c2873,null))[_0x2010('0x59')](handleError(_0x2c2873,null));};exports[_0x2010('0x79')]=function(_0x40e8b1,_0x14a229,_0x5d248c){return db[_0x2010('0x3f')][_0x2010('0x68')]({'where':{'id':_0x40e8b1['params']['id']}})[_0x2010('0x20')](handleEntityNotFound(_0x14a229,null))[_0x2010('0x20')](function(_0x4ed4ec){if(_0x4ed4ec){return db[_0x2010('0x7a')][_0x2010('0x7b')](function(_0x131226){return db[_0x2010('0x7c')][_0x2010('0x35')]({'where':{'WhatsappAccountId':_0x40e8b1[_0x2010('0x5b')]['id']},'transaction':_0x131226})['then'](function(_0x3d6c82){var _0xeb364b=_[_0x2010('0x3e')](_0x40e8b1[_0x2010('0x5e')],function(_0x4fdc52){_0x4fdc52[_0x2010('0x69')]=_0x40e8b1[_0x2010('0x5b')]['id'];return _0x4fdc52;});return db[_0x2010('0x7c')][_0x2010('0x7d')](_0xeb364b,{'transaction':_0x131226});});})[_0x2010('0x20')](function(){return db[_0x2010('0x7c')][_0x2010('0x7e')]({'where':{'WhatsappAccountId':_0x40e8b1[_0x2010('0x5b')]['id']},'order':_0x2010('0x7f')});});}})[_0x2010('0x20')](respondWithResult(_0x14a229,null))[_0x2010('0x59')](handleError(_0x14a229,null));};exports['getApplications']=function(_0x4ae46e,_0x3b3892,_0x59ed22){var _0x5aff8d={};var _0x55dbf5={};var _0x2af5c3;var _0x48e068;return db[_0x2010('0x3f')][_0x2010('0x68')]({'where':{'id':_0x4ae46e[_0x2010('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b3892,null))['then'](function(_0x197e34){if(_0x197e34){_0x2af5c3=_0x197e34;_0x55dbf5[_0x2010('0x44')]=_[_0x2010('0x45')](db['WhatsappApplication'][_0x2010('0x40')]);_0x55dbf5[_0x2010('0x46')]=_[_0x2010('0x45')](_0x4ae46e[_0x2010('0x46')]);_0x55dbf5[_0x2010('0x47')]=_['intersection'](_0x55dbf5[_0x2010('0x44')],_0x55dbf5[_0x2010('0x46')]);_0x5aff8d[_0x2010('0x49')]=_[_0x2010('0x48')](_0x55dbf5[_0x2010('0x44')],qs[_0x2010('0x4a')](_0x4ae46e[_0x2010('0x46')][_0x2010('0x4a')]));_0x5aff8d[_0x2010('0x49')]=_0x5aff8d['attributes'][_0x2010('0x4b')]?_0x5aff8d['attributes']:_0x55dbf5[_0x2010('0x44')];_0x5aff8d[_0x2010('0x4e')]=qs[_0x2010('0x4f')](_0x4ae46e[_0x2010('0x46')][_0x2010('0x4f')]);_0x5aff8d[_0x2010('0x50')]=qs[_0x2010('0x47')](_['pick'](_0x4ae46e[_0x2010('0x46')],_0x55dbf5[_0x2010('0x47')]));if(_0x4ae46e[_0x2010('0x46')][_0x2010('0x54')]){_0x5aff8d['where']=_[_0x2010('0x52')](_0x5aff8d[_0x2010('0x50')],{'$or':_[_0x2010('0x3e')](_0x5aff8d[_0x2010('0x49')],function(_0x5cc0de){var _0x87373b={};_0x87373b[_0x5cc0de]={'$like':'%'+_0x4ae46e['query'][_0x2010('0x54')]+'%'};return _0x87373b;})});}_0x5aff8d=_['merge']({},_0x5aff8d,_0x4ae46e['options']);return _0x2af5c3[_0x2010('0x80')](_0x5aff8d);}})['then'](function(_0xe3876d){if(_0xe3876d){_0x48e068=_0xe3876d[_0x2010('0x4b')];if(!_0x4ae46e[_0x2010('0x46')][_0x2010('0x4c')]('nolimit')){_0x5aff8d[_0x2010('0x2d')]=qs['limit'](_0x4ae46e[_0x2010('0x46')][_0x2010('0x2d')]);_0x5aff8d[_0x2010('0x2c')]=qs[_0x2010('0x2c')](_0x4ae46e[_0x2010('0x46')]['offset']);}return _0x2af5c3[_0x2010('0x80')](_0x5aff8d);}})[_0x2010('0x20')](function(_0x97813d){if(_0x97813d){return _0x97813d?{'count':_0x48e068,'rows':_0x97813d}:null;}})[_0x2010('0x20')](respondWithResult(_0x3b3892,null))['catch'](handleError(_0x3b3892,null));};exports['notify']=function(_0x343666,_0x5b268a,_0x25d7a7){logger[_0x2010('0x21')](_0x2010('0x81'));logger['info'](_0x2010('0x82'),JSON['stringify'](_0x343666[_0x2010('0x5e')]));var _0x17cec7={'channel':_0x2010('0x83')};var _0x5a2c85=[];var _0x4720b6=[];var _0x3e1578={};return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x343666['params']['id']},'include':[{'model':db[_0x2010('0x7c')],'as':_0x2010('0x84')}]})[_0x2010('0x20')](handleEntityNotFound(_0x5b268a,null))[_0x2010('0x20')](function(_0x120147){_0x17cec7[_0x2010('0x85')]=_0x120147;_0x17cec7[_0x2010('0x86')]=_[_0x2010('0x87')](_0x120147['Applications'],[_0x2010('0x7f')],[_0x2010('0x88')]);if(_0x17cec7[_0x2010('0x85')][_0x2010('0x84')]){delete _0x17cec7[_0x2010('0x85')][_0x2010('0x84')];}return db[_0x2010('0x89')][_0x2010('0x64')]();})[_0x2010('0x20')](function(_0x4bc334){if(!_0x4bc334){throw new db[(_0x2010('0x8a'))]['ValidationError'](_0x2010('0x8b'));}logger[_0x2010('0x21')]('AC\x20sinch\x20attributes:%s',JSON[_0x2010('0x24')](_0x4bc334));logger[_0x2010('0x21')](_0x2010('0x8c'),JSON[_0x2010('0x24')](_0x343666['body']));_0x5a2c85=_[_0x2010('0x8d')](_['keys'](_0x4bc334),['createdAt',_0x2010('0x8e')]);_0x4720b6=_[_0x2010('0x8d')](_[_0x2010('0x45')](_0x4bc334),[_0x2010('0x8f'),_0x2010('0x8e'),_0x2010('0x90'),'ListId']);_0x17cec7[_0x2010('0x5e')]={'mapKey':'mobile'};logger[_0x2010('0x21')](_0x2010('0x91'),JSON[_0x2010('0x24')](_0x17cec7[_0x2010('0x85')]['type']));logger[_0x2010('0x21')](_0x2010('0x92'),JSON['stringify'](_0x17cec7[_0x2010('0x5e')]));logger['info']('AC\x20sinch\x20contactFields:%s',_0x5a2c85);logger[_0x2010('0x21')](_0x2010('0x93'),_0x4720b6);if(_0x17cec7[_0x2010('0x85')][_0x2010('0x42')]&&_0x17cec7[_0x2010('0x85')]['type']===_0x2010('0x94')){_0x17cec7[_0x2010('0x5e')][_0x2010('0x95')]=_0x343666[_0x2010('0x5e')]['From']['replace'](_0x2010('0x96'),'');_0x17cec7[_0x2010('0x5e')][_0x2010('0x5e')]=_0x343666['body'][_0x2010('0x97')];_0x17cec7[_0x2010('0x5e')][_0x2010('0x98')]=_0x343666[_0x2010('0x5e')][_0x2010('0x99')];}if(_0x17cec7['account']['type']&&_0x17cec7[_0x2010('0x85')]['type']===_0x2010('0x9a')){logger['info'](_0x2010('0x9b'),JSON[_0x2010('0x24')](_0x343666['body']));_0x17cec7[_0x2010('0x5e')]['from']=_0x343666[_0x2010('0x5e')][_0x2010('0x9c')][0x0][_0x2010('0x95')];_0x17cec7[_0x2010('0x5e')][_0x2010('0x5e')]=_0x343666[_0x2010('0x5e')]['notifications'][0x0][_0x2010('0x26')][_0x2010('0x5e')];_0x17cec7[_0x2010('0x5e')][_0x2010('0x98')]=_0x343666['body']['notifications'][0x0][_0x2010('0x9d')];}if(_0x17cec7[_0x2010('0x5e')]['id']){delete _0x17cec7[_0x2010('0x5e')]['id'];}if(_[_0x2010('0x9e')](_0x17cec7['body'][_0x2010('0x95')])){throw new db[(_0x2010('0x8a'))][(_0x2010('0x9f'))](_0x2010('0xa0'));}if(_['isNil'](_0x17cec7[_0x2010('0x5e')][_0x2010('0x5e')])||_0x17cec7[_0x2010('0x5e')][_0x2010('0x5e')]===''){throw new db['Sequelize'][(_0x2010('0x9f'))](_0x2010('0xa1'));}if(_[_0x2010('0x9e')](_0x17cec7['body'][_0x2010('0xa2')])){throw new db['Sequelize'][(_0x2010('0x9f'))](_0x2010('0xa3')+_0x4720b6);}if(!_[_0x2010('0xa4')](_0x4720b6,_0x17cec7[_0x2010('0x5e')][_0x2010('0xa2')])){throw new db[(_0x2010('0x8a'))]['ValidationError'](_0x2010('0xa5')+_0x4720b6);}_0x3e1578[_0x17cec7[_0x2010('0x5e')][_0x2010('0xa2')]]=_0x17cec7[_0x2010('0x5e')][_0x2010('0x95')];return db[_0x2010('0xa6')][_0x2010('0x5c')]({'where':{'id':_0x17cec7['account'][_0x2010('0xa7')]},'include':[{'model':db[_0x2010('0x89')],'as':_0x2010('0xa8'),'where':_0x3e1578,'limit':0x1,'order':[[_0x2010('0x8e'),_0x2010('0xa9')]]}]});})['then'](handleEntityNotFound(_0x5b268a,null))[_0x2010('0x20')](function(_0x516acd){if(_0x516acd){_0x17cec7[_0x2010('0xaa')]=_[_0x2010('0x71')](_0x516acd,[_0x2010('0xa8')]);if(_0x516acd['Contacts'][_0x2010('0x4b')]){return _0x516acd['Contacts'][0x0];}var _0x17f730=_[_0x2010('0x19')](_0x17cec7['body'],{'firstName':_0x17cec7[_0x2010('0x5e')][_0x2010('0x95')],'ListId':_0x516acd['id']});_0x17f730[_0x17cec7['body'][_0x2010('0xa2')]]=_0x17cec7[_0x2010('0x5e')]['from'];return db[_0x2010('0x89')][_0x2010('0x5d')](_0x17f730,{'fields':_0x5a2c85,'raw':!![]});}})[_0x2010('0x20')](handleEntityNotFound(_0x5b268a,null))[_0x2010('0x20')](function(_0x121206){if(_0x121206){_0x17cec7[_0x2010('0xab')]=_0x121206;var _0x487228={'ContactId':_0x121206['id'],'phone':_0x17cec7['body']['from'],'WhatsappAccountId':_0x343666[_0x2010('0x5b')]['id']};var _0x172702={'ContactId':_0x121206['id'],'WhatsappAccountId':_0x343666[_0x2010('0x5b')]['id'],'closed':![]};return db[_0x2010('0xac')][_0x2010('0x5c')]({'where':_0x172702})[_0x2010('0x20')](function(_0x4b82e0){if(_0x4b82e0){return[_0x4b82e0,![]];}return db[_0x2010('0xac')][_0x2010('0x5d')](_0x487228)[_0x2010('0x20')](function(_0x131c14){return[_0x131c14,!![]];});});}})[_0x2010('0xad')](function(_0x1c6fe9,_0x5d3967){_0x17cec7[_0x2010('0xae')]=_0x1c6fe9[_0x2010('0x61')]({'plain':!![]});_0x17cec7[_0x2010('0xae')][_0x2010('0xaf')]=![];if(_0x5d3967){if(_0x17cec7[_0x2010('0x85')][_0x2010('0xb0')]){_0x17cec7[_0x2010('0x86')][_0x2010('0xb1')]({'id':0x0,'priority':_0x17cec7[_0x2010('0x86')]['length']+0x1,'app':_0x2010('0xb2'),'appdata':_0x2010('0xb3'),'interval':_0x2010('0xb4')});}_0x17cec7[_0x2010('0xae')][_0x2010('0xaf')]=!![];}return db[_0x2010('0xb5')][_0x2010('0x5d')]({'phone':_0x17cec7['body'][_0x2010('0x95')],'messageId':_0x17cec7[_0x2010('0x5e')]['messageId'],'body':_0x17cec7[_0x2010('0x5e')][_0x2010('0x5e')],'WhatsappAccountId':_0x343666[_0x2010('0x5b')]['id'],'WhatsappInteractionId':_0x1c6fe9['id'],'direction':'in','ContactId':_0x1c6fe9[_0x2010('0xb6')],'AttachmentId':_0x17cec7[_0x2010('0x5e')][_0x2010('0xb7')]});})[_0x2010('0x20')](function(_0x4d1f6c){_0x17cec7[_0x2010('0x26')]=_0x4d1f6c;if(_0x17cec7[_0x2010('0xae')][_0x2010('0xb8')]){return db[_0x2010('0x78')][_0x2010('0x5c')]({'attributes':['id',_0x2010('0x39')],'where':{'id':_0x17cec7['interaction']['UserId']}})[_0x2010('0x20')](function(_0x16f9a1){if(_0x16f9a1){_0x17cec7[_0x2010('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2010('0xb9'),'appdata':_0x16f9a1[_0x2010('0x39')]+','+(_0x17cec7[_0x2010('0x85')][_0x2010('0xba')]||0xa),'interval':_0x2010('0xb4')});}return respondWithRpcPromise(_0x2010('0xbb'),_0x2010('0xbc'),_0x17cec7);});}return respondWithRpcPromise(_0x2010('0xbb'),'startRouting',_0x17cec7);})[_0x2010('0x20')](function(_0x1a64ae){if(_0x1a64ae){var _0x5acfbd=0xc8;var _0x2385cf=_0x2010('0xbd');logger[_0x2010('0x21')](_0x2010('0xbe'),_0x2385cf,_0x5acfbd,_0x2010('0xbf'));logger[_0x2010('0xc0')](_0x2010('0xc1'),_0x2385cf,_0x5acfbd,_0x2010('0xbf'),JSON[_0x2010('0x24')](_0x1a64ae));if(_0x17cec7[_0x2010('0x85')][_0x2010('0x42')]===_0x2010('0x94')){return _0x5b268a[_0x2010('0x29')](_0x5acfbd)[_0x2010('0x30')](_0x2010('0xc2'),_0x2010('0xc3'))[_0x2010('0x3a')](_0x2010('0xc4'));}else{return _0x5b268a[_0x2010('0x29')](_0x5acfbd)['json'](_0x1a64ae);}}})[_0x2010('0x59')](handleError(_0x5b268a,null));};exports[_0x2010('0x3a')]=function(_0x4bf82b,_0x45d04e,_0x2928bf){var _0x3e7a9b,_0x23ee9f,_0x4286d2;if(_[_0x2010('0x9e')](_0x4bf82b[_0x2010('0x5e')]['body'])||_0x4bf82b[_0x2010('0x5e')][_0x2010('0x5e')]===''){throw new db[(_0x2010('0x8a'))][(_0x2010('0x9f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2010('0x9e')](_0x4bf82b[_0x2010('0x5e')]['to'])){throw new db[(_0x2010('0x8a'))][(_0x2010('0x9f'))](_0x2010('0xc5'));}_0x3e7a9b=_0x4bf82b[_0x2010('0x5e')]['to'];return db[_0x2010('0x3f')][_0x2010('0x5c')]({'where':{'id':_0x4bf82b['params']['id']},'include':[{'model':db[_0x2010('0xa6')],'as':_0x2010('0xc6'),'include':[{'model':db['CmContact'],'as':_0x2010('0xa8'),'where':{'mobile':_0x3e7a9b},'limit':0x1,'order':[['updatedAt',_0x2010('0xa9')]]}]}]})[_0x2010('0x20')](handleEntityNotFound(_0x45d04e,null))[_0x2010('0x20')](function(_0x90b657){if(_0x90b657&&_0x90b657[_0x2010('0xc6')]){_0x23ee9f=_0x90b657['get']({'plain':!![]});if(_0x23ee9f['List']&&_0x23ee9f[_0x2010('0xc6')][_0x2010('0xa8')][_0x2010('0x4b')]){return _0x23ee9f[_0x2010('0xc6')][_0x2010('0xa8')][0x0];}return db['CmContact'][_0x2010('0x5d')](_['defaults'](_0x4bf82b[_0x2010('0x5e')],{'firstName':_0x3e7a9b,'mobile':_0x3e7a9b,'phone':_0x3e7a9b,'ListId':_0x23ee9f[_0x2010('0xa7')]}));}})[_0x2010('0x20')](handleEntityNotFound(_0x45d04e,null))['then'](function(_0x3ceec1){if(_0x3ceec1){_0x4286d2=_0x3ceec1;return db[_0x2010('0xac')][_0x2010('0x5c')]({'where':{'ContactId':_0x4286d2['id'],'closed':![],'WhatsappAccountId':_0x23ee9f['id']}})[_0x2010('0x20')](function(_0x21f6f2){if(_0x21f6f2){return[_0x21f6f2,![]];}return db['WhatsappInteraction'][_0x2010('0x5d')]({'UserId':_0x4bf82b[_0x2010('0xc7')]['id'],'ContactId':_0x4286d2['id'],'WhatsappAccountId':_0x23ee9f['id'],'phone':_0x3e7a9b,'firstMsgDirection':'out','Messages':[_[_0x2010('0x52')](_0x4bf82b[_0x2010('0x5e')],{'read':![],'body':_0x4bf82b[_0x2010('0x5e')]['body'],'phone':_0x3e7a9b,'WhatsappAccountId':_0x23ee9f['id'],'UserId':_0x4bf82b[_0x2010('0xc7')]['id'],'ContactId':_0x4286d2['id']})]},{'include':[{'model':db[_0x2010('0xb5')],'as':_0x2010('0xc8')}]})[_0x2010('0x20')](function(_0x43d264){return[_0x43d264,!![]];});});}})[_0x2010('0xad')](function(_0x577127,_0x455bb3){if(_0x455bb3){return _0x577127;}return db[_0x2010('0xb5')][_0x2010('0x5d')](_[_0x2010('0x52')](_0x4bf82b['body'],{'read':![],'body':_0x4bf82b[_0x2010('0x5e')][_0x2010('0x5e')],'phone':_0x3e7a9b,'WhatsappAccountId':_0x23ee9f['id'],'WhatsappInteractionId':_0x577127['id'],'UserId':_0x4bf82b['user']['id'],'ContactId':_0x4286d2['id']}))['then'](function(_0x3a6594){_0x577127[_0x2010('0xc9')][_0x2010('0xc8')]=[];_0x577127[_0x2010('0xc9')][_0x2010('0xc8')][_0x2010('0xb1')](_0x3a6594[_0x2010('0xc9')]);return _0x577127;});})[_0x2010('0x20')](respondWithResult(_0x45d04e,null))[_0x2010('0x59')](handleError(_0x45d04e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index bc393a5..fb89c32 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 _0xb988=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x39599d,_0x22c633){var _0x4f9718=function(_0x5e5baa){while(--_0x5e5baa){_0x39599d['push'](_0x39599d['shift']());}};_0x4f9718(++_0x22c633);}(_0xb988,0x122));var _0x8b98=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xb988[_0x47a7d0];return _0xb9bd08;};'use strict';var EventEmitter=require(_0x8b98('0x0'));var WhatsappAccount=require(_0x8b98('0x1'))['db'][_0x8b98('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8b98('0x3')](0x0);var events={'afterCreate':_0x8b98('0x4'),'afterUpdate':'update','afterDestroy':_0x8b98('0x5')};function emitEvent(_0x1230c4){return function(_0x2fcfd9,_0x58de06,_0x315c5a){WhatsappAccountEvents['emit'](_0x1230c4+':'+_0x2fcfd9['id'],_0x2fcfd9);WhatsappAccountEvents['emit'](_0x1230c4,_0x2fcfd9);_0x315c5a(null);};}for(var e in events){if(events[_0x8b98('0x6')](e)){var event=events[e];WhatsappAccount[_0x8b98('0x7')](e,emitEvent(event));}}module[_0x8b98('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xe231=['hasOwnProperty','exports','events','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xe231,0x1cd));var _0x1e23=function(_0x4c3267,_0xf2b77){_0x4c3267=_0x4c3267-0x0;var _0xfa5c9=_0xe231[_0x4c3267];return _0xfa5c9;};'use strict';var EventEmitter=require(_0x1e23('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1e23('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1e23('0x2')](0x0);var events={'afterCreate':_0x1e23('0x3'),'afterUpdate':_0x1e23('0x4'),'afterDestroy':_0x1e23('0x5')};function emitEvent(_0x265bdb){return function(_0x346944,_0x581014,_0x325b79){WhatsappAccountEvents[_0x1e23('0x6')](_0x265bdb+':'+_0x346944['id'],_0x346944);WhatsappAccountEvents['emit'](_0x265bdb,_0x346944);_0x325b79(null);};}for(var e in events){if(events[_0x1e23('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x1e23('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 29644bb..9393636 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 _0xb1f1=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xac1397,_0x18f04c){var _0x50a478=function(_0x436649){while(--_0x436649){_0xac1397['push'](_0xac1397['shift']());}};_0x50a478(++_0x18f04c);}(_0xb1f1,0x116));var _0x1b1f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb1f1[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1b1f('0x0'));var util=require('util');var logger=require(_0x1b1f('0x1'))(_0x1b1f('0x2'));var moment=require(_0x1b1f('0x3'));var BPromise=require(_0x1b1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b1f('0x5'));var rimraf=require(_0x1b1f('0x6'));var config=require(_0x1b1f('0x7'));var attributes=require(_0x1b1f('0x8'));module[_0x1b1f('0x9')]=function(_0x304c82,_0x52e5d2){return _0x304c82[_0x1b1f('0xa')](_0x1b1f('0xb'),attributes,{'tableName':_0x1b1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ce3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x493d1e,_0x4bac82){var _0x46d9e4=function(_0x2c1cd0){while(--_0x2c1cd0){_0x493d1e['push'](_0x493d1e['shift']());}};_0x46d9e4(++_0x4bac82);}(_0x7ce3,0x14f));var _0x37ce=function(_0x38a779,_0x57916e){_0x38a779=_0x38a779-0x0;var _0x1d8dff=_0x7ce3[_0x38a779];return _0x1d8dff;};'use strict';var _=require(_0x37ce('0x0'));var util=require(_0x37ce('0x1'));var logger=require(_0x37ce('0x2'))(_0x37ce('0x3'));var moment=require(_0x37ce('0x4'));var BPromise=require(_0x37ce('0x5'));var rp=require(_0x37ce('0x6'));var fs=require('fs');var path=require(_0x37ce('0x7'));var rimraf=require('rimraf');var config=require(_0x37ce('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x37ce('0x9')]=function(_0xa40438,_0x4eac33){return _0xa40438['define'](_0x37ce('0xa'),attributes,{'tableName':_0x37ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 35e4a69..06746e4 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 _0xfd46=['info','result','ShowWhatsappAccount','find','options','where','include','model','attributes','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','socket.io-emitter','./whatsappAccount.socket','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x567a1b,_0x980681){var _0x2d4e28=function(_0x2f7d4c){while(--_0x2f7d4c){_0x567a1b['push'](_0x567a1b['shift']());}};_0x2d4e28(++_0x980681);}(_0xfd46,0x176));var _0x6fd4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xfd46[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var moment=require(_0x6fd4('0x1'));var BPromise=require(_0x6fd4('0x2'));var rs=require(_0x6fd4('0x3'));var fs=require('fs');var Redis=require(_0x6fd4('0x4'));var db=require(_0x6fd4('0x5'))['db'];var utils=require(_0x6fd4('0x6'));var logger=require(_0x6fd4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fd4('0x8')][_0x6fd4('0x9')]({'port':0x232a});config[_0x6fd4('0xa')]=_['defaults'](config[_0x6fd4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fd4('0xb'))(new Redis(config[_0x6fd4('0xa')]));require(_0x6fd4('0xc'))['register'](socket);function respondWithRpcPromise(_0x74a488,_0x6e9869,_0xe19865){return new BPromise(function(_0x1986f6,_0x3fd131){return client['request'](_0x74a488,_0xe19865)[_0x6fd4('0xd')](function(_0x31d5bb){logger['info'](_0x6fd4('0xe'),_0x6e9869,_0x6fd4('0xf'));logger[_0x6fd4('0x10')](_0x6fd4('0x11'),_0x6e9869,_0x6fd4('0xf'),JSON[_0x6fd4('0x12')](_0x31d5bb));if(_0x31d5bb[_0x6fd4('0x13')]){if(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x14')]===0x1f4){logger[_0x6fd4('0x13')](_0x6fd4('0xe'),_0x6e9869,_0x31d5bb['error']['message']);return _0x3fd131(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);}logger[_0x6fd4('0x13')](_0x6fd4('0xe'),_0x6e9869,_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);return _0x1986f6(_0x31d5bb[_0x6fd4('0x13')][_0x6fd4('0x15')]);}else{logger[_0x6fd4('0x16')](_0x6fd4('0xe'),_0x6e9869,'request\x20sent');_0x1986f6(_0x31d5bb[_0x6fd4('0x17')][_0x6fd4('0x15')]);}})['catch'](function(_0x5ada7c){logger['error'](_0x6fd4('0xe'),_0x6e9869,_0x5ada7c);_0x3fd131(_0x5ada7c);});});}exports[_0x6fd4('0x18')]=function(_0x3437cb){var _0x5d2945=this;return new Promise(function(_0x51982e,_0x3d2afc){return db['WhatsappAccount'][_0x6fd4('0x19')]({'raw':_0x3437cb['options']?_0x3437cb[_0x6fd4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3437cb[_0x6fd4('0x1a')]?_0x3437cb[_0x6fd4('0x1a')][_0x6fd4('0x1b')]||null:null,'attributes':_0x3437cb[_0x6fd4('0x1a')]?_0x3437cb[_0x6fd4('0x1a')]['attributes']||null:null,'include':_0x3437cb['options']?_0x3437cb[_0x6fd4('0x1a')]['include']?_['map'](_0x3437cb['options'][_0x6fd4('0x1c')],function(_0x5d8875){return{'model':db[_0x5d8875[_0x6fd4('0x1d')]],'as':_0x5d8875['as'],'attributes':_0x5d8875[_0x6fd4('0x1e')],'include':_0x5d8875[_0x6fd4('0x1c')]?_[_0x6fd4('0x1f')](_0x5d8875[_0x6fd4('0x1c')],function(_0x2edfc1){return{'model':db[_0x2edfc1[_0x6fd4('0x1d')]],'as':_0x2edfc1['as'],'attributes':_0x2edfc1[_0x6fd4('0x1e')],'include':_0x2edfc1[_0x6fd4('0x1c')]?_[_0x6fd4('0x1f')](_0x2edfc1[_0x6fd4('0x1c')],function(_0x39762f){return{'model':db[_0x39762f['model']],'as':_0x39762f['as'],'attributes':_0x39762f[_0x6fd4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26fb48){logger[_0x6fd4('0x16')]('ShowWhatsappAccount',_0x3437cb);logger[_0x6fd4('0x10')](_0x6fd4('0x18'),_0x3437cb,JSON[_0x6fd4('0x12')](_0x26fb48));_0x51982e(_0x26fb48);})[_0x6fd4('0x20')](function(_0x3cf724){logger['error'](_0x6fd4('0x18'),_0x3cf724['message'],_0x3437cb);_0x3d2afc(_0x5d2945['error'](0x1f4,_0x3cf724[_0x6fd4('0x15')]));});});}; \ No newline at end of file +var _0xafd9=['model','map','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappAccount','options','raw','where','attributes','include'];(function(_0x4fd319,_0x237d4c){var _0x5f0702=function(_0x47a5be){while(--_0x47a5be){_0x4fd319['push'](_0x4fd319['shift']());}};_0x5f0702(++_0x237d4c);}(_0xafd9,0x162));var _0x9afd=function(_0x2ad4ce,_0x5472a0){_0x2ad4ce=_0x2ad4ce-0x0;var _0x44c297=_0xafd9[_0x2ad4ce];return _0x44c297;};'use strict';var _=require(_0x9afd('0x0'));var util=require('util');var moment=require(_0x9afd('0x1'));var BPromise=require(_0x9afd('0x2'));var rs=require(_0x9afd('0x3'));var fs=require('fs');var Redis=require(_0x9afd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9afd('0x5'));var logger=require(_0x9afd('0x6'))(_0x9afd('0x7'));var config=require(_0x9afd('0x8'));var jayson=require(_0x9afd('0x9'));var client=jayson[_0x9afd('0xa')][_0x9afd('0xb')]({'port':0x232a});config[_0x9afd('0xc')]=_[_0x9afd('0xd')](config[_0x9afd('0xc')],{'host':_0x9afd('0xe'),'port':0x18eb});var socket=require(_0x9afd('0xf'))(new Redis(config[_0x9afd('0xc')]));require(_0x9afd('0x10'))[_0x9afd('0x11')](socket);function respondWithRpcPromise(_0x16b449,_0x4d9d70,_0x5f5867){return new BPromise(function(_0x99e8da,_0x16e9b2){return client[_0x9afd('0x12')](_0x16b449,_0x5f5867)[_0x9afd('0x13')](function(_0x2740a1){logger[_0x9afd('0x14')](_0x9afd('0x15'),_0x4d9d70,_0x9afd('0x16'));logger[_0x9afd('0x17')](_0x9afd('0x18'),_0x4d9d70,'request\x20sent',JSON[_0x9afd('0x19')](_0x2740a1));if(_0x2740a1[_0x9afd('0x1a')]){if(_0x2740a1['error'][_0x9afd('0x1b')]===0x1f4){logger[_0x9afd('0x1a')](_0x9afd('0x15'),_0x4d9d70,_0x2740a1[_0x9afd('0x1a')][_0x9afd('0x1c')]);return _0x16e9b2(_0x2740a1[_0x9afd('0x1a')][_0x9afd('0x1c')]);}logger['error'](_0x9afd('0x15'),_0x4d9d70,_0x2740a1['error']['message']);return _0x99e8da(_0x2740a1['error']['message']);}else{logger['info'](_0x9afd('0x15'),_0x4d9d70,_0x9afd('0x16'));_0x99e8da(_0x2740a1['result'][_0x9afd('0x1c')]);}})[_0x9afd('0x1d')](function(_0x5d5b24){logger['error'](_0x9afd('0x15'),_0x4d9d70,_0x5d5b24);_0x16e9b2(_0x5d5b24);});});}exports['ShowWhatsappAccount']=function(_0x17e053){var _0xb29233=this;return new Promise(function(_0x1a06cf,_0x13874a){return db[_0x9afd('0x1e')]['find']({'raw':_0x17e053['options']?_0x17e053[_0x9afd('0x1f')][_0x9afd('0x20')]===undefined?!![]:![]:!![],'where':_0x17e053[_0x9afd('0x1f')]?_0x17e053[_0x9afd('0x1f')][_0x9afd('0x21')]||null:null,'attributes':_0x17e053['options']?_0x17e053['options'][_0x9afd('0x22')]||null:null,'include':_0x17e053[_0x9afd('0x1f')]?_0x17e053[_0x9afd('0x1f')][_0x9afd('0x23')]?_['map'](_0x17e053[_0x9afd('0x1f')][_0x9afd('0x23')],function(_0x391bf2){return{'model':db[_0x391bf2[_0x9afd('0x24')]],'as':_0x391bf2['as'],'attributes':_0x391bf2['attributes'],'include':_0x391bf2[_0x9afd('0x23')]?_[_0x9afd('0x25')](_0x391bf2[_0x9afd('0x23')],function(_0xd65bac){return{'model':db[_0xd65bac['model']],'as':_0xd65bac['as'],'attributes':_0xd65bac[_0x9afd('0x22')],'include':_0xd65bac['include']?_['map'](_0xd65bac[_0x9afd('0x23')],function(_0x93c592){return{'model':db[_0x93c592[_0x9afd('0x24')]],'as':_0x93c592['as'],'attributes':_0x93c592[_0x9afd('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9afd('0x13')](function(_0x2ebe41){logger[_0x9afd('0x14')](_0x9afd('0x26'),_0x17e053);logger[_0x9afd('0x17')](_0x9afd('0x26'),_0x17e053,JSON[_0x9afd('0x19')](_0x2ebe41));_0x1a06cf(_0x2ebe41);})['catch'](function(_0x11d229){logger['error'](_0x9afd('0x26'),_0x11d229[_0x9afd('0x1c')],_0x17e053);_0x13874a(_0xb29233['error'](0x1f4,_0x11d229[_0x9afd('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 8ffd68b..60ff7ba 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 _0xaac7=['save','remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5c9f27,_0x5aad7f){var _0x25a77c=function(_0x37cd96){while(--_0x37cd96){_0x5c9f27['push'](_0x5c9f27['shift']());}};_0x25a77c(++_0x5aad7f);}(_0xaac7,0xb3));var _0x7aac=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xaac7[_0x16771d];return _0x386f11;};'use strict';var WhatsappAccountEvents=require(_0x7aac('0x0'));var events=[_0x7aac('0x1'),_0x7aac('0x2'),_0x7aac('0x3')];function createListener(_0x5c0d0d,_0x90b4b1){return function(_0x285a45){_0x90b4b1[_0x7aac('0x4')](_0x5c0d0d,_0x285a45);};}function removeListener(_0xb1ae9f,_0xf6950f){return function(){WhatsappAccountEvents[_0x7aac('0x5')](_0xb1ae9f,_0xf6950f);};}exports[_0x7aac('0x6')]=function(_0x5ccd52){for(var _0x5ef84f=0x0,_0x21d016=events[_0x7aac('0x7')];_0x5ef84f<_0x21d016;_0x5ef84f++){var _0xf88585=events[_0x5ef84f];var _0x109823=createListener(_0x7aac('0x8')+_0xf88585,_0x5ccd52);WhatsappAccountEvents['on'](_0xf88585,_0x109823);}}; \ No newline at end of file +var _0x1cb0=['removeListener','register','length','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb0,0xff));var _0x01cb=function(_0x1915e5,_0xe53420){_0x1915e5=_0x1915e5-0x0;var _0x148dd0=_0x1cb0[_0x1915e5];return _0x148dd0;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x01cb('0x0'),_0x01cb('0x1'),'update'];function createListener(_0x22242a,_0x481020){return function(_0x395cd5){_0x481020[_0x01cb('0x2')](_0x22242a,_0x395cd5);};}function removeListener(_0x4ee47e,_0x2d0370){return function(){WhatsappAccountEvents[_0x01cb('0x3')](_0x4ee47e,_0x2d0370);};}exports[_0x01cb('0x4')]=function(_0x7004ea){for(var _0x401256=0x0,_0x2f4c47=events[_0x01cb('0x5')];_0x401256<_0x2f4c47;_0x401256++){var _0x29cce7=events[_0x401256];var _0x3c6e90=createListener('whatsappAccount:'+_0x29cce7,_0x7004ea);WhatsappAccountEvents['on'](_0x29cce7,_0x3c6e90);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 98663ca..a60fbfb 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 _0xb87d=['path','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util'];(function(_0x276d28,_0x299e2a){var _0x547829=function(_0x5f1569){while(--_0x5f1569){_0x276d28['push'](_0x276d28['shift']());}};_0x547829(++_0x299e2a);}(_0xb87d,0x1ae));var _0xdb87=function(_0xc2103,_0x2d4743){_0xc2103=_0xc2103-0x0;var _0x37357b=_0xb87d[_0xc2103];return _0x37357b;};'use strict';var multer=require(_0xdb87('0x0'));var util=require(_0xdb87('0x1'));var path=require(_0xdb87('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb87('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb87('0x4'));var config=require(_0xdb87('0x5'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xdb87('0x6')](),controller[_0xdb87('0x7')]);router[_0xdb87('0x8')](_0xdb87('0x9'),auth[_0xdb87('0x6')](),controller['show']);router['post']('/',auth[_0xdb87('0x6')](),controller[_0xdb87('0xa')]);router[_0xdb87('0xb')]('/:id',auth[_0xdb87('0x6')](),controller[_0xdb87('0xc')]);router[_0xdb87('0xd')](_0xdb87('0x9'),auth[_0xdb87('0x6')](),controller[_0xdb87('0xe')]);module[_0xdb87('0xf')]=router; \ No newline at end of file +var _0x2df2=['index','/:id','show','post','create','put','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x1ad869,_0x35ddbd){var _0x48022e=function(_0x39f7ef){while(--_0x39f7ef){_0x1ad869['push'](_0x1ad869['shift']());}};_0x48022e(++_0x35ddbd);}(_0x2df2,0x127));var _0x22df=function(_0x208a01,_0x5eb04c){_0x208a01=_0x208a01-0x0;var _0x6b696b=_0x2df2[_0x208a01];return _0x6b696b;};'use strict';var multer=require(_0x22df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x22df('0x1'));var express=require(_0x22df('0x2'));var router=express[_0x22df('0x3')]();var fs_extra=require(_0x22df('0x4'));var auth=require(_0x22df('0x5'));var interaction=require(_0x22df('0x6'));var config=require(_0x22df('0x7'));var controller=require(_0x22df('0x8'));router[_0x22df('0x9')]('/',auth[_0x22df('0xa')](),controller[_0x22df('0xb')]);router[_0x22df('0x9')](_0x22df('0xc'),auth['isAuthenticated'](),controller[_0x22df('0xd')]);router[_0x22df('0xe')]('/',auth['isAuthenticated'](),controller[_0x22df('0xf')]);router[_0x22df('0x10')](_0x22df('0xc'),auth[_0x22df('0xa')](),controller['update']);router['delete']('/:id',auth[_0x22df('0xa')](),controller[_0x22df('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index fe50a26..e554e3e 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 _0xa248=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x9678e2,_0x391d32){var _0x43687c=function(_0x42c139){while(--_0x42c139){_0x9678e2['push'](_0x9678e2['shift']());}};_0x43687c(++_0x391d32);}(_0xa248,0x1c7));var _0x8a24=function(_0x203b5a,_0x6f6896){_0x203b5a=_0x203b5a-0x0;var _0x4f8caa=_0xa248[_0x203b5a];return _0x4f8caa;};'use strict';var Sequelize=require(_0x8a24('0x0'));module[_0x8a24('0x1')]={'priority':{'type':Sequelize[_0x8a24('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8a24('0x3')],'allowNull':![],'defaultValue':_0x8a24('0x4')},'appdata':{'type':Sequelize[_0x8a24('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8a24('0x3')],'defaultValue':_0x8a24('0x6')}}; \ No newline at end of file +var _0x7915=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x41a39b,_0x2314ad){var _0x531800=function(_0x3eb0fe){while(--_0x3eb0fe){_0x41a39b['push'](_0x41a39b['shift']());}};_0x531800(++_0x2314ad);}(_0x7915,0x1a9));var _0x5791=function(_0xb31878,_0x503508){_0xb31878=_0xb31878-0x0;var _0x269b0f=_0x7915[_0xb31878];return _0x269b0f;};'use strict';var Sequelize=require(_0x5791('0x0'));module[_0x5791('0x1')]={'priority':{'type':Sequelize[_0x5791('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5791('0x3')],'allowNull':![],'defaultValue':_0x5791('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5791('0x3')],'defaultValue':_0x5791('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fa65c7f..7afdc9a 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 _0x3f2e=['rows','catch','show','params','keys','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','WhatsappApplication','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x1cab41,_0x4bfa57){_0x1cab41=_0x1cab41-0x0;var _0x511deb=_0x3f2e[_0x1cab41];return _0x511deb;};'use strict';var emlformat=require(_0xe3f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3f2('0x1'));var jsonpatch=require(_0xe3f2('0x2'));var rp=require(_0xe3f2('0x3'));var moment=require(_0xe3f2('0x4'));var BPromise=require(_0xe3f2('0x5'));var Mustache=require(_0xe3f2('0x6'));var util=require(_0xe3f2('0x7'));var path=require('path');var sox=require(_0xe3f2('0x8'));var csv=require('to-csv');var ejs=require(_0xe3f2('0x9'));var fs=require('fs');var fs_extra=require(_0xe3f2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe3f2('0xb'));var deskjs=require(_0xe3f2('0xc'));var toCsv=require(_0xe3f2('0xd'));var querystring=require(_0xe3f2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe3f2('0xf'));var qs=require(_0xe3f2('0x10'));var as=require(_0xe3f2('0x11'));var hardwareService=require(_0xe3f2('0x12'));var logger=require(_0xe3f2('0x13'))(_0xe3f2('0x14'));var utils=require(_0xe3f2('0x15'));var config=require(_0xe3f2('0x16'));var licenseUtil=require(_0xe3f2('0x17'));var db=require(_0xe3f2('0x18'))['db'];function respondWithStatusCode(_0x18a7c0,_0x154ab4){_0x154ab4=_0x154ab4||0xcc;return function(_0x17e274){if(_0x17e274){return _0x18a7c0['sendStatus'](_0x154ab4);}return _0x18a7c0[_0xe3f2('0x19')](_0x154ab4)[_0xe3f2('0x1a')]();};}function respondWithResult(_0x1cf1d9,_0x4fc6a2){_0x4fc6a2=_0x4fc6a2||0xc8;return function(_0x5492e7){if(_0x5492e7){return _0x1cf1d9['status'](_0x4fc6a2)[_0xe3f2('0x1b')](_0x5492e7);}};}function respondWithFilteredResult(_0x4d52e8,_0x22b073){return function(_0x45c84f){if(_0x45c84f){var _0x2eaee4=typeof _0x22b073['offset']===_0xe3f2('0x1c')&&typeof _0x22b073[_0xe3f2('0x1d')]===_0xe3f2('0x1c');var _0x2d7c99=_0x45c84f[_0xe3f2('0x1e')];var _0x335e87=_0x2eaee4?0x0:_0x22b073['offset'];var _0x1ba0f2=_0x2eaee4?_0x45c84f[_0xe3f2('0x1e')]:_0x22b073[_0xe3f2('0x1f')]+_0x22b073[_0xe3f2('0x1d')];var _0x1a5c21;if(_0x1ba0f2>=_0x2d7c99){_0x1ba0f2=_0x2d7c99;_0x1a5c21=0xc8;}else{_0x1a5c21=0xce;}_0x4d52e8[_0xe3f2('0x19')](_0x1a5c21);return _0x4d52e8[_0xe3f2('0x20')](_0xe3f2('0x21'),_0x335e87+'-'+_0x1ba0f2+'/'+_0x2d7c99)[_0xe3f2('0x1b')](_0x45c84f);}return null;};}function patchUpdates(_0x5c0d1e){return function(_0x4d39a3){try{jsonpatch['apply'](_0x4d39a3,_0x5c0d1e,!![]);}catch(_0xeadeb3){return BPromise[_0xe3f2('0x22')](_0xeadeb3);}return _0x4d39a3[_0xe3f2('0x23')]();};}function saveUpdates(_0x458057,_0x7f832a){return function(_0x6bd0c9){if(_0x6bd0c9){return _0x6bd0c9[_0xe3f2('0x24')](_0x458057)[_0xe3f2('0x25')](function(_0x4ac647){return _0x4ac647;});}return null;};}function removeEntity(_0x1f711b,_0x4d50f4){return function(_0x55d0df){if(_0x55d0df){return _0x55d0df['destroy']()[_0xe3f2('0x25')](function(){_0x1f711b[_0xe3f2('0x19')](0xcc)[_0xe3f2('0x1a')]();});}};}function handleEntityNotFound(_0x707e52,_0x501563){return function(_0x2a185e){if(!_0x2a185e){_0x707e52['sendStatus'](0x194);}return _0x2a185e;};}function handleError(_0x1e2865,_0x3f8f92){_0x3f8f92=_0x3f8f92||0x1f4;return function(_0x3ae9d7){logger[_0xe3f2('0x26')](_0x3ae9d7['stack']);if(_0x3ae9d7[_0xe3f2('0x27')]){delete _0x3ae9d7[_0xe3f2('0x27')];}_0x1e2865[_0xe3f2('0x19')](_0x3f8f92)[_0xe3f2('0x28')](_0x3ae9d7);};}exports[_0xe3f2('0x29')]=function(_0x3735ca,_0x4d9ee7){var _0x1ebe8c={},_0x4f5483={},_0x26b671={'count':0x0,'rows':[]};var _0x17026c=_['map'](db['WhatsappApplication'][_0xe3f2('0x2a')],function(_0x533649){return{'name':_0x533649[_0xe3f2('0x2b')],'type':_0x533649['type']['key']};});_0x4f5483[_0xe3f2('0x2c')]=_['map'](_0x17026c,_0xe3f2('0x27'));_0x4f5483[_0xe3f2('0x2d')]=_['keys'](_0x3735ca['query']);_0x4f5483[_0xe3f2('0x2e')]=_[_0xe3f2('0x2f')](_0x4f5483[_0xe3f2('0x2c')],_0x4f5483[_0xe3f2('0x2d')]);_0x1ebe8c[_0xe3f2('0x30')]=_[_0xe3f2('0x2f')](_0x4f5483[_0xe3f2('0x2c')],qs[_0xe3f2('0x31')](_0x3735ca['query'][_0xe3f2('0x31')]));_0x1ebe8c['attributes']=_0x1ebe8c['attributes'][_0xe3f2('0x32')]?_0x1ebe8c[_0xe3f2('0x30')]:_0x4f5483[_0xe3f2('0x2c')];if(!_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x33')](_0xe3f2('0x34'))){_0x1ebe8c[_0xe3f2('0x1d')]=qs[_0xe3f2('0x1d')](_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x1d')]);_0x1ebe8c[_0xe3f2('0x1f')]=qs[_0xe3f2('0x1f')](_0x3735ca[_0xe3f2('0x2d')]['offset']);}_0x1ebe8c[_0xe3f2('0x35')]=qs[_0xe3f2('0x36')](_0x3735ca[_0xe3f2('0x2d')]['sort']);_0x1ebe8c[_0xe3f2('0x37')]=qs[_0xe3f2('0x2e')](_[_0xe3f2('0x38')](_0x3735ca[_0xe3f2('0x2d')],_0x4f5483[_0xe3f2('0x2e')]),_0x17026c);if(_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x39')]){_0x1ebe8c[_0xe3f2('0x37')]=_[_0xe3f2('0x3a')](_0x1ebe8c[_0xe3f2('0x37')],{'$or':_[_0xe3f2('0x3b')](_0x17026c,function(_0x24f01f){if(_0x24f01f['type']!=='VIRTUAL'){var _0x22008a={};_0x22008a[_0x24f01f[_0xe3f2('0x27')]]={'$like':'%'+_0x3735ca['query'][_0xe3f2('0x39')]+'%'};return _0x22008a;}})});}_0x1ebe8c=_['merge']({},_0x1ebe8c,_0x3735ca[_0xe3f2('0x3c')]);var _0x1bcdb5={'where':_0x1ebe8c[_0xe3f2('0x37')]};return db['WhatsappApplication'][_0xe3f2('0x1e')](_0x1bcdb5)[_0xe3f2('0x25')](function(_0x46b2a5){_0x26b671[_0xe3f2('0x1e')]=_0x46b2a5;if(_0x3735ca[_0xe3f2('0x2d')][_0xe3f2('0x3d')]){_0x1ebe8c[_0xe3f2('0x3e')]=[{'all':!![]}];}return db[_0xe3f2('0x3f')][_0xe3f2('0x40')](_0x1ebe8c);})['then'](function(_0x467066){_0x26b671[_0xe3f2('0x41')]=_0x467066;return _0x26b671;})[_0xe3f2('0x25')](respondWithFilteredResult(_0x4d9ee7,_0x1ebe8c))[_0xe3f2('0x42')](handleError(_0x4d9ee7,null));};exports[_0xe3f2('0x43')]=function(_0x45762d,_0x14acc7){var _0x434604={'raw':!![],'where':{'id':_0x45762d[_0xe3f2('0x44')]['id']}},_0x2f7925={};_0x2f7925[_0xe3f2('0x2c')]=_[_0xe3f2('0x45')](db[_0xe3f2('0x3f')]['rawAttributes']);_0x2f7925[_0xe3f2('0x2d')]=_['keys'](_0x45762d[_0xe3f2('0x2d')]);_0x2f7925['filters']=_[_0xe3f2('0x2f')](_0x2f7925[_0xe3f2('0x2c')],_0x2f7925[_0xe3f2('0x2d')]);_0x434604[_0xe3f2('0x30')]=_['intersection'](_0x2f7925[_0xe3f2('0x2c')],qs['fields'](_0x45762d['query'][_0xe3f2('0x31')]));_0x434604[_0xe3f2('0x30')]=_0x434604['attributes'][_0xe3f2('0x32')]?_0x434604['attributes']:_0x2f7925[_0xe3f2('0x2c')];if(_0x45762d['query'][_0xe3f2('0x3d')]){_0x434604[_0xe3f2('0x3e')]=[{'all':!![]}];}_0x434604=_[_0xe3f2('0x3a')]({},_0x434604,_0x45762d[_0xe3f2('0x3c')]);return db[_0xe3f2('0x3f')][_0xe3f2('0x46')](_0x434604)[_0xe3f2('0x25')](handleEntityNotFound(_0x14acc7,null))[_0xe3f2('0x25')](respondWithResult(_0x14acc7,null))[_0xe3f2('0x42')](handleError(_0x14acc7,null));};exports[_0xe3f2('0x47')]=function(_0x25086f,_0x289467){return db[_0xe3f2('0x3f')]['create'](_0x25086f['body'],{})[_0xe3f2('0x25')](respondWithResult(_0x289467,0xc9))['catch'](handleError(_0x289467,null));};exports[_0xe3f2('0x24')]=function(_0x23923e,_0x5b1a67){if(_0x23923e[_0xe3f2('0x48')]['id']){delete _0x23923e[_0xe3f2('0x48')]['id'];}return db[_0xe3f2('0x3f')]['find']({'where':{'id':_0x23923e['params']['id']}})['then'](handleEntityNotFound(_0x5b1a67,null))[_0xe3f2('0x25')](saveUpdates(_0x23923e[_0xe3f2('0x48')],null))[_0xe3f2('0x25')](respondWithResult(_0x5b1a67,null))[_0xe3f2('0x42')](handleError(_0x5b1a67,null));};exports[_0xe3f2('0x49')]=function(_0x38adf1,_0x182dd3){return db[_0xe3f2('0x3f')][_0xe3f2('0x46')]({'where':{'id':_0x38adf1[_0xe3f2('0x44')]['id']}})[_0xe3f2('0x25')](handleEntityNotFound(_0x182dd3,null))[_0xe3f2('0x25')](removeEntity(_0x182dd3,null))[_0xe3f2('0x42')](handleError(_0x182dd3,null));}; \ No newline at end of file +var _0xf4ce=['then','error','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','WhatsappApplication','rawAttributes','includeAll','include','find','create','body','params','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xf4ce,0xf2));var _0xef4c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf4ce[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xef4c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef4c('0x1'));var rp=require(_0xef4c('0x2'));var moment=require(_0xef4c('0x3'));var BPromise=require(_0xef4c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef4c('0x5'));var fs=require('fs');var fs_extra=require(_0xef4c('0x6'));var _=require(_0xef4c('0x7'));var squel=require(_0xef4c('0x8'));var crypto=require(_0xef4c('0x9'));var jsforce=require(_0xef4c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef4c('0xb'));var querystring=require(_0xef4c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xef4c('0xd'));var as=require(_0xef4c('0xe'));var hardwareService=require(_0xef4c('0xf'));var logger=require(_0xef4c('0x10'))('api');var utils=require(_0xef4c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef4c('0x12'))['db'];function respondWithStatusCode(_0x3bda49,_0x2bfe28){_0x2bfe28=_0x2bfe28||0xcc;return function(_0x6a1290){if(_0x6a1290){return _0x3bda49['sendStatus'](_0x2bfe28);}return _0x3bda49[_0xef4c('0x13')](_0x2bfe28)[_0xef4c('0x14')]();};}function respondWithResult(_0x12d7a6,_0x417f67){_0x417f67=_0x417f67||0xc8;return function(_0x2a2631){if(_0x2a2631){return _0x12d7a6[_0xef4c('0x13')](_0x417f67)[_0xef4c('0x15')](_0x2a2631);}};}function respondWithFilteredResult(_0x1c7633,_0x5dc6a3){return function(_0x55a7aa){if(_0x55a7aa){var _0x3637ce=typeof _0x5dc6a3[_0xef4c('0x16')]===_0xef4c('0x17')&&typeof _0x5dc6a3[_0xef4c('0x18')]===_0xef4c('0x17');var _0x371f2a=_0x55a7aa[_0xef4c('0x19')];var _0x446847=_0x3637ce?0x0:_0x5dc6a3[_0xef4c('0x16')];var _0x2bcc97=_0x3637ce?_0x55a7aa[_0xef4c('0x19')]:_0x5dc6a3[_0xef4c('0x16')]+_0x5dc6a3[_0xef4c('0x18')];var _0x560486;if(_0x2bcc97>=_0x371f2a){_0x2bcc97=_0x371f2a;_0x560486=0xc8;}else{_0x560486=0xce;}_0x1c7633[_0xef4c('0x13')](_0x560486);return _0x1c7633['set'](_0xef4c('0x1a'),_0x446847+'-'+_0x2bcc97+'/'+_0x371f2a)[_0xef4c('0x15')](_0x55a7aa);}return null;};}function patchUpdates(_0x46f556){return function(_0xd4e0a){try{jsonpatch[_0xef4c('0x1b')](_0xd4e0a,_0x46f556,!![]);}catch(_0x3bf901){return BPromise['reject'](_0x3bf901);}return _0xd4e0a[_0xef4c('0x1c')]();};}function saveUpdates(_0x460860,_0x500bd3){return function(_0x251e29){if(_0x251e29){return _0x251e29[_0xef4c('0x1d')](_0x460860)[_0xef4c('0x1e')](function(_0x4f4a3a){return _0x4f4a3a;});}return null;};}function removeEntity(_0x1f98a1,_0x17c816){return function(_0x2aca1e){if(_0x2aca1e){return _0x2aca1e['destroy']()[_0xef4c('0x1e')](function(){_0x1f98a1[_0xef4c('0x13')](0xcc)[_0xef4c('0x14')]();});}};}function handleEntityNotFound(_0xfd0013,_0x3f4015){return function(_0x26f523){if(!_0x26f523){_0xfd0013['sendStatus'](0x194);}return _0x26f523;};}function handleError(_0x7e3dd8,_0x286ad3){_0x286ad3=_0x286ad3||0x1f4;return function(_0x35f404){logger[_0xef4c('0x1f')](_0x35f404['stack']);if(_0x35f404[_0xef4c('0x20')]){delete _0x35f404['name'];}_0x7e3dd8[_0xef4c('0x13')](_0x286ad3)['send'](_0x35f404);};}exports[_0xef4c('0x21')]=function(_0x15dfba,_0x39fb17){var _0x13eb57={},_0x8fe191={},_0xb10f30={'count':0x0,'rows':[]};var _0x539486=_['map'](db['WhatsappApplication']['rawAttributes'],function(_0x1d587a){return{'name':_0x1d587a[_0xef4c('0x22')],'type':_0x1d587a[_0xef4c('0x23')][_0xef4c('0x24')]};});_0x8fe191[_0xef4c('0x25')]=_[_0xef4c('0x26')](_0x539486,_0xef4c('0x20'));_0x8fe191[_0xef4c('0x27')]=_[_0xef4c('0x28')](_0x15dfba[_0xef4c('0x27')]);_0x8fe191[_0xef4c('0x29')]=_[_0xef4c('0x2a')](_0x8fe191['model'],_0x8fe191['query']);_0x13eb57[_0xef4c('0x2b')]=_[_0xef4c('0x2a')](_0x8fe191['model'],qs[_0xef4c('0x2c')](_0x15dfba[_0xef4c('0x27')]['fields']));_0x13eb57[_0xef4c('0x2b')]=_0x13eb57[_0xef4c('0x2b')][_0xef4c('0x2d')]?_0x13eb57[_0xef4c('0x2b')]:_0x8fe191['model'];if(!_0x15dfba[_0xef4c('0x27')][_0xef4c('0x2e')](_0xef4c('0x2f'))){_0x13eb57[_0xef4c('0x18')]=qs[_0xef4c('0x18')](_0x15dfba[_0xef4c('0x27')][_0xef4c('0x18')]);_0x13eb57['offset']=qs[_0xef4c('0x16')](_0x15dfba[_0xef4c('0x27')][_0xef4c('0x16')]);}_0x13eb57[_0xef4c('0x30')]=qs[_0xef4c('0x31')](_0x15dfba['query']['sort']);_0x13eb57[_0xef4c('0x32')]=qs[_0xef4c('0x29')](_[_0xef4c('0x33')](_0x15dfba[_0xef4c('0x27')],_0x8fe191[_0xef4c('0x29')]),_0x539486);if(_0x15dfba[_0xef4c('0x27')][_0xef4c('0x34')]){_0x13eb57[_0xef4c('0x32')]=_[_0xef4c('0x35')](_0x13eb57['where'],{'$or':_['map'](_0x539486,function(_0x7f3c9b){if(_0x7f3c9b[_0xef4c('0x23')]!==_0xef4c('0x36')){var _0x14d621={};_0x14d621[_0x7f3c9b[_0xef4c('0x20')]]={'$like':'%'+_0x15dfba[_0xef4c('0x27')][_0xef4c('0x34')]+'%'};return _0x14d621;}})});}_0x13eb57=_[_0xef4c('0x35')]({},_0x13eb57,_0x15dfba[_0xef4c('0x37')]);var _0x19524a={'where':_0x13eb57['where']};return db['WhatsappApplication']['count'](_0x19524a)[_0xef4c('0x1e')](function(_0x519a17){_0xb10f30['count']=_0x519a17;if(_0x15dfba['query']['includeAll']){_0x13eb57['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xef4c('0x38')](_0x13eb57);})[_0xef4c('0x1e')](function(_0x46edf0){_0xb10f30[_0xef4c('0x39')]=_0x46edf0;return _0xb10f30;})[_0xef4c('0x1e')](respondWithFilteredResult(_0x39fb17,_0x13eb57))[_0xef4c('0x3a')](handleError(_0x39fb17,null));};exports['show']=function(_0x2afdec,_0x35d30e){var _0x1ec099={'raw':!![],'where':{'id':_0x2afdec['params']['id']}},_0x1f7a13={};_0x1f7a13['model']=_[_0xef4c('0x28')](db[_0xef4c('0x3b')][_0xef4c('0x3c')]);_0x1f7a13[_0xef4c('0x27')]=_[_0xef4c('0x28')](_0x2afdec[_0xef4c('0x27')]);_0x1f7a13[_0xef4c('0x29')]=_[_0xef4c('0x2a')](_0x1f7a13['model'],_0x1f7a13['query']);_0x1ec099[_0xef4c('0x2b')]=_['intersection'](_0x1f7a13[_0xef4c('0x25')],qs[_0xef4c('0x2c')](_0x2afdec[_0xef4c('0x27')][_0xef4c('0x2c')]));_0x1ec099[_0xef4c('0x2b')]=_0x1ec099[_0xef4c('0x2b')][_0xef4c('0x2d')]?_0x1ec099[_0xef4c('0x2b')]:_0x1f7a13[_0xef4c('0x25')];if(_0x2afdec[_0xef4c('0x27')][_0xef4c('0x3d')]){_0x1ec099[_0xef4c('0x3e')]=[{'all':!![]}];}_0x1ec099=_['merge']({},_0x1ec099,_0x2afdec[_0xef4c('0x37')]);return db[_0xef4c('0x3b')][_0xef4c('0x3f')](_0x1ec099)[_0xef4c('0x1e')](handleEntityNotFound(_0x35d30e,null))[_0xef4c('0x1e')](respondWithResult(_0x35d30e,null))[_0xef4c('0x3a')](handleError(_0x35d30e,null));};exports['create']=function(_0x2710fc,_0x20a30b){return db[_0xef4c('0x3b')][_0xef4c('0x40')](_0x2710fc['body'],{})[_0xef4c('0x1e')](respondWithResult(_0x20a30b,0xc9))['catch'](handleError(_0x20a30b,null));};exports[_0xef4c('0x1d')]=function(_0x2eb3ad,_0x5e89de){if(_0x2eb3ad[_0xef4c('0x41')]['id']){delete _0x2eb3ad[_0xef4c('0x41')]['id'];}return db['WhatsappApplication'][_0xef4c('0x3f')]({'where':{'id':_0x2eb3ad[_0xef4c('0x42')]['id']}})[_0xef4c('0x1e')](handleEntityNotFound(_0x5e89de,null))['then'](saveUpdates(_0x2eb3ad[_0xef4c('0x41')],null))[_0xef4c('0x1e')](respondWithResult(_0x5e89de,null))[_0xef4c('0x3a')](handleError(_0x5e89de,null));};exports[_0xef4c('0x43')]=function(_0x2d5e1a,_0x27056c){return db[_0xef4c('0x3b')]['find']({'where':{'id':_0x2d5e1a[_0xef4c('0x42')]['id']}})[_0xef4c('0x1e')](handleEntityNotFound(_0x27056c,null))[_0xef4c('0x1e')](removeEntity(_0x27056c,null))[_0xef4c('0x3a')](handleError(_0x27056c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 789ce46..bcc2ae3 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 _0x1501=['path','rimraf','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1501,0x126));var _0x1150=function(_0x30e8a1,_0x55fa82){_0x30e8a1=_0x30e8a1-0x0;var _0x37c6f1=_0x1501[_0x30e8a1];return _0x37c6f1;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1150('0xb'),'collate':_0x1150('0xc')});}; \ No newline at end of file +var _0x4d9e=['lodash','api','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x22d560,_0x23354f){var _0x4dcfd0=function(_0x390461){while(--_0x390461){_0x22d560['push'](_0x22d560['shift']());}};_0x4dcfd0(++_0x23354f);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x58de94,_0x226589){_0x58de94=_0x58de94-0x0;var _0x2b18c0=_0x4d9e[_0x58de94];return _0x2b18c0;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4d9('0x9'),'collate':_0xe4d9('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 9dd02a7..eab12b1 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 _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7bae[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0xcebd47,_0x40c036){var _0x4acabb=function(_0x51a333){while(--_0x51a333){_0xcebd47['push'](_0xcebd47['shift']());}};_0x4acabb(++_0x40c036);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x00bb[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index d22e86b..7d7c896 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 _0x6455=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6455,0x97));var _0x5645=function(_0x240459,_0x511d47){_0x240459=_0x240459-0x0;var _0x3d281a=_0x6455[_0x240459];return _0x3d281a;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0x9')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller['getMessages']);router[_0x5645('0x9')](_0x5645('0x10'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router['post']('/',auth[_0x5645('0xa')](),controller['create']);router[_0x5645('0x12')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller[_0x5645('0x13')]);router[_0x5645('0x12')](_0x5645('0x14'),auth[_0x5645('0xa')](),interaction[_0x5645('0x15')]('whatsapp',_0x5645('0x16')),controller[_0x5645('0x17')]);router[_0x5645('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),'whatsappinteraction:update'),controller[_0x5645('0x1a')]);router[_0x5645('0x1b')](_0x5645('0xd'),auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),_0x5645('0x1c')),controller[_0x5645('0x1d')]);router['delete'](_0x5645('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5645('0x1e')]=router; \ No newline at end of file +var _0x9a5a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x9a5a,0x194));var _0xa9a5=function(_0x9d18e5,_0x5c372f){_0x9d18e5=_0x9d18e5-0x0;var _0x596cea=_0x9a5a[_0x9d18e5];return _0x596cea;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);router[_0xa9a5('0x14')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller['addMessage']);router[_0xa9a5('0x14')](_0xa9a5('0x15'),auth[_0xa9a5('0xd')](),interaction[_0xa9a5('0x16')](_0xa9a5('0x17'),_0xa9a5('0x18')),controller['addTags']);router[_0xa9a5('0x19')](_0xa9a5('0x1a'),auth[_0xa9a5('0xd')](),interaction[_0xa9a5('0x16')]('whatsapp',_0xa9a5('0x1b')),controller[_0xa9a5('0x1c')]);router[_0xa9a5('0x1d')]('/:id',auth[_0xa9a5('0xd')](),interaction['tracked']('whatsapp',_0xa9a5('0x1e')),controller[_0xa9a5('0x1f')]);router['delete'](_0xa9a5('0x15'),auth['isAuthenticated'](),controller[_0xa9a5('0x20')]);module[_0xa9a5('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index dccfaa6..e102638 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 _0xff22=['STRING','ENUM','out','sequelize','moment','BOOLEAN','DATE'];(function(_0x3aae3b,_0x3af36d){var _0xbfa4d0=function(_0x5bea40){while(--_0x5bea40){_0x3aae3b['push'](_0x3aae3b['shift']());}};_0xbfa4d0(++_0x3af36d);}(_0xff22,0x1a0));var _0x2ff2=function(_0x1530ec,_0x2e6a0f){_0x1530ec=_0x1530ec-0x0;var _0x504931=_0xff22[_0x1530ec];return _0x504931;};'use strict';var Sequelize=require(_0x2ff2('0x0'));var moment=require(_0x2ff2('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2ff2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2ff2('0x3')]},'disposition':{'type':Sequelize[_0x2ff2('0x4')]},'secondDisposition':{'type':Sequelize[_0x2ff2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2ff2('0x4')]},'note':{'type':Sequelize[_0x2ff2('0x4')]},'phone':{'type':Sequelize[_0x2ff2('0x4')]},'read1stAt':{'type':Sequelize[_0x2ff2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2ff2('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2ff2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2ff2('0x5')]('in',_0x2ff2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2ff2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc1fa=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0xc1fa,0x83));var _0xac1f=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xc1fa[_0x38ce4c];return _0x5d4544;};'use strict';var Sequelize=require(_0xac1f('0x0'));var moment=require(_0xac1f('0x1'));module[_0xac1f('0x2')]={'closed':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xac1f('0x4')]},'disposition':{'type':Sequelize[_0xac1f('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xac1f('0x5')]},'note':{'type':Sequelize[_0xac1f('0x5')]},'phone':{'type':Sequelize[_0xac1f('0x5')]},'read1stAt':{'type':Sequelize[_0xac1f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xac1f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index dec301a..3e0fb5c 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 _0xf6c6=['i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','System','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','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','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','UserId','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve'];(function(_0x156022,_0x1e0a87){var _0x4eb4c2=function(_0x1aca63){while(--_0x1aca63){_0x156022['push'](_0x156022['shift']());}};_0x4eb4c2(++_0x1e0a87);}(_0xf6c6,0x154));var _0x6f6c=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xf6c6[_0x2adbeb];return _0x5e18a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f6c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f6c('0x1'));var rp=require(_0x6f6c('0x2'));var moment=require(_0x6f6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f6c('0x4'));var util=require(_0x6f6c('0x5'));var path=require(_0x6f6c('0x6'));var sox=require('sox');var csv=require(_0x6f6c('0x7'));var ejs=require(_0x6f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x6f6c('0x9'));var _=require(_0x6f6c('0xa'));var squel=require(_0x6f6c('0xb'));var crypto=require(_0x6f6c('0xc'));var jsforce=require(_0x6f6c('0xd'));var deskjs=require(_0x6f6c('0xe'));var toCsv=require(_0x6f6c('0x7'));var querystring=require(_0x6f6c('0xf'));var Papa=require(_0x6f6c('0x10'));var Redis=require(_0x6f6c('0x11'));var authService=require(_0x6f6c('0x12'));var qs=require(_0x6f6c('0x13'));var as=require(_0x6f6c('0x14'));var pdf=require(_0x6f6c('0x15'));var hardwareService=require(_0x6f6c('0x16'));var logger=require(_0x6f6c('0x17'))('api');var utils=require(_0x6f6c('0x18'));var config=require(_0x6f6c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f6c('0x1a'))['db'];config[_0x6f6c('0x1b')]=_['defaults'](config['redis'],{'host':_0x6f6c('0x1c'),'port':0x18eb});var socket=require(_0x6f6c('0x1d'))(new Redis(config[_0x6f6c('0x1b')]));require(_0x6f6c('0x1e'))['register'](socket);function respondWithStatusCode(_0x56e278,_0x16f49e){_0x16f49e=_0x16f49e||0xcc;return function(_0x357dbd){if(_0x357dbd){return _0x56e278[_0x6f6c('0x1f')](_0x16f49e);}return _0x56e278[_0x6f6c('0x20')](_0x16f49e)[_0x6f6c('0x21')]();};}function respondWithResult(_0x105525,_0x2fb74d){_0x2fb74d=_0x2fb74d||0xc8;return function(_0x282b7f){if(_0x282b7f){return _0x105525[_0x6f6c('0x20')](_0x2fb74d)[_0x6f6c('0x22')](_0x282b7f);}};}function respondWithFilteredResult(_0xca6404,_0x57da4e){return function(_0x2d7a4b){if(_0x2d7a4b){var _0x427db3=typeof _0x57da4e['offset']===_0x6f6c('0x23')&&typeof _0x57da4e[_0x6f6c('0x24')]===_0x6f6c('0x23');var _0x251b93=_0x2d7a4b[_0x6f6c('0x25')];var _0x3d98cc=_0x427db3?0x0:_0x57da4e['offset'];var _0x56f536=_0x427db3?_0x2d7a4b[_0x6f6c('0x25')]:_0x57da4e[_0x6f6c('0x26')]+_0x57da4e[_0x6f6c('0x24')];var _0x306f9c;if(_0x56f536>=_0x251b93){_0x56f536=_0x251b93;_0x306f9c=0xc8;}else{_0x306f9c=0xce;}_0xca6404[_0x6f6c('0x20')](_0x306f9c);return _0xca6404[_0x6f6c('0x27')](_0x6f6c('0x28'),_0x3d98cc+'-'+_0x56f536+'/'+_0x251b93)['json'](_0x2d7a4b);}return null;};}function patchUpdates(_0x277821){return function(_0x2f7f14){try{jsonpatch[_0x6f6c('0x29')](_0x2f7f14,_0x277821,!![]);}catch(_0x4e8ce5){return BPromise[_0x6f6c('0x2a')](_0x4e8ce5);}return _0x2f7f14['save']();};}function saveUpdates(_0x4e9258,_0x3828d3){return function(_0x2a1ebe){if(_0x2a1ebe){return _0x2a1ebe[_0x6f6c('0x2b')](_0x4e9258)[_0x6f6c('0x2c')](function(_0x25863f){return _0x25863f;});}return null;};}function removeEntity(_0x5c0adf,_0x4bbf82){return function(_0x3aefbf){if(_0x3aefbf){return _0x3aefbf[_0x6f6c('0x2d')]()[_0x6f6c('0x2c')](function(){_0x5c0adf[_0x6f6c('0x20')](0xcc)[_0x6f6c('0x21')]();});}};}function handleEntityNotFound(_0x348328,_0x2c344f){return function(_0x22ef30){if(!_0x22ef30){_0x348328['sendStatus'](0x194);}return _0x22ef30;};}function handleError(_0x117955,_0x26c6a1){_0x26c6a1=_0x26c6a1||0x1f4;return function(_0x81501d){logger[_0x6f6c('0x2e')](_0x81501d['stack']);if(_0x81501d[_0x6f6c('0x2f')]){delete _0x81501d[_0x6f6c('0x2f')];}_0x117955[_0x6f6c('0x20')](_0x26c6a1)[_0x6f6c('0x30')](_0x81501d);};}function getInteractionUsers(_0x1b34e8,_0xca0504){return new BPromise(function(_0x61795c,_0x490548){try{if(_0xca0504[_0x1b34e8['id']]){_0x1b34e8['Users']=_[_0x6f6c('0x31')](_0xca0504[_0x1b34e8['id']],function(_0x4abfa0){return{'id':_0x4abfa0['id'],'fullname':_0x4abfa0[_0x6f6c('0x32')]};});}}catch(_0x1cc3bd){_0x490548(_0x1cc3bd);}_0x61795c(_0x1b34e8);});}function getInteractionTags(_0x52733a,_0x3e0da6){return new BPromise(function(_0x3c2b41,_0x46e6b4){try{if(_0x52733a['TagIds']){_0x52733a['Tags']=[];_0x52733a[_0x6f6c('0x33')][_0x6f6c('0x34')](',')[_0x6f6c('0x35')](function(_0xf48611){_0x52733a['Tags'][_0x6f6c('0x36')](_0x3e0da6[_0xf48611]);});}delete _0x52733a[_0x6f6c('0x33')];}catch(_0x3e032b){_0x46e6b4(_0x3e032b);}_0x3c2b41(_0x52733a);});}function updateWhatsappInteraction(_0x1ba993,_0x45aebf,_0x239de9){return new BPromise(function(_0x26e51b,_0x30b262){return getInteractionUsers(_0x1ba993,_0x239de9)[_0x6f6c('0x2c')](function(_0x58bb6c){return getInteractionTags(_0x58bb6c,_0x45aebf);})[_0x6f6c('0x2c')](function(_0x5ecea1){_0x26e51b(_0x5ecea1);})[_0x6f6c('0x37')](function(_0x461b18){_0x30b262(_0x461b18);});});}exports[_0x6f6c('0x38')]=function(_0x575ed3,_0x293702){var _0x2453eb={},_0x2b71e7={},_0x3e1424={'count':0x0,'rows':[]};var _0x4a4265=_[_0x6f6c('0x31')](db[_0x6f6c('0x39')]['rawAttributes'],function(_0x25e1f8){return{'name':_0x25e1f8[_0x6f6c('0x3a')],'type':_0x25e1f8[_0x6f6c('0x3b')]['key']};});_0x2b71e7['model']=_[_0x6f6c('0x31')](_0x4a4265,_0x6f6c('0x2f'));_0x2b71e7['query']=_[_0x6f6c('0x3c')](_0x575ed3['query']);_0x2b71e7[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],_0x2b71e7['query']);_0x2453eb[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2b71e7[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x2453eb[_0x6f6c('0x40')]=_0x2453eb[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x2453eb[_0x6f6c('0x40')]:_0x2b71e7['model'];if(!_0x575ed3[_0x6f6c('0x42')]['hasOwnProperty']('nolimit')){_0x2453eb[_0x6f6c('0x24')]=qs[_0x6f6c('0x24')](_0x575ed3['query'][_0x6f6c('0x24')]);_0x2453eb[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x575ed3[_0x6f6c('0x42')]['offset']);}_0x2453eb[_0x6f6c('0x44')]=qs['sort'](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x2453eb['where']=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x575ed3[_0x6f6c('0x42')],_0x2b71e7['filters']),_0x4a4265);var _0x5e3c3a=[];var _0x55f56d=squel[_0x6f6c('0x47')]()[_0x6f6c('0x48')]('id')[_0x6f6c('0x48')](_0x6f6c('0x2f'))[_0x6f6c('0x48')](_0x6f6c('0x49'))['from'](_0x6f6c('0x4a'));var _0x483593=squel['select']()[_0x6f6c('0x48')](_0x6f6c('0x4b'))['field'](_0x6f6c('0x4c'))[_0x6f6c('0x48')]('ui.WhatsappInteractionId')[_0x6f6c('0x4d')](_0x6f6c('0x4e'),'ui')[_0x6f6c('0x4f')](_0x6f6c('0x50'),'u',_0x6f6c('0x51'));var _0x1414f7=squel[_0x6f6c('0x47')]()[_0x6f6c('0x4d')](_0x6f6c('0x52'),'i')[_0x6f6c('0x4f')](_0x6f6c('0x53'),'c',_0x6f6c('0x54'))[_0x6f6c('0x4f')](_0x6f6c('0x50'),'o',_0x6f6c('0x55'))[_0x6f6c('0x4f')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x6f6c('0x4f')](_0x6f6c('0x56'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x6f6c('0x4f')](_0x6f6c('0x57'),'it',_0x6f6c('0x58'))['left_join'](_0x6f6c('0x4a'),'t',_0x6f6c('0x59'));var _0x131b2c=squel[_0x6f6c('0x5a')]();var _0x4b682a=[];var _0x4dee76=squel['expr']();var _0x1cea8d;if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]){_0x1cea8d=as[_0x6f6c('0x5c')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x5b')]);var _0x3223fe=_0x1cea8d[_0x6f6c('0x5d')];for(var _0x119fba=0x0;_0x119fba<_0x1cea8d[_0x6f6c('0x5e')][_0x6f6c('0x43')];_0x119fba++){var _0x36782a=_0x1cea8d[_0x6f6c('0x5e')][_0x119fba];var _0x1e5395='i';var _0xa73889=_['find'](_0x4a4265,[_0x6f6c('0x2f'),_0x36782a[_0x6f6c('0x48')]]);if(!_0xa73889){switch(_0x36782a[_0x6f6c('0x48')]){case _0x6f6c('0x5f'):if(_0x36782a[_0x6f6c('0x60')]==0x1){_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a['field']+_0x6f6c('0x62'));}else{_0x1414f7[_0x6f6c('0x61')]('`'+_0x36782a[_0x6f6c('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){if(_0x36782a[_0x6f6c('0x60')]['split']('\x20')[_0x6f6c('0x43')]>0x1){_0x131b2c[_0x3223fe](_0x6f6c('0x65'),qs['getFullTextValue'](_0x36782a[_0x6f6c('0x60')]),null);}else{var _0x34c0b4='%'+_0x36782a[_0x6f6c('0x60')]+'%';_0x131b2c[_0x3223fe](_0x6f6c('0x66'),_0x34c0b4,_0x34c0b4,_0x34c0b4);}}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,[_0x6f6c('0x2f'),_0x6f6c('0x68')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x68');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239['value'][_0x6f6c('0x6b')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}break;case _0x6f6c('0x6c'):var _0x3f4c1f=_0x36782a[_0x6f6c('0x60')][_0x6f6c('0x34')](',')['map'](function(_0x359a57){return Number(_0x359a57);});_0x3f4c1f[_0x6f6c('0x35')](function(_0x3cfd4d){_0x4dee76['or'](_0x6f6c('0x6d'),'%,'+_0x3cfd4d+',%');});_0x4b682a=_['union'](_0x4b682a,_0x3f4c1f);break;case'User':if(_0x36782a[_0x6f6c('0x63')]===_0x6f6c('0x64')){_0x131b2c[_0x3223fe]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36782a['value']+'%',null);}else{_0xa73889=_[_0x6f6c('0x67')](_0x4a4265,['name',_0x6f6c('0x6e')]);_0x36782a[_0x6f6c('0x48')]=_0x6f6c('0x6e');_0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889['type'],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x6b')],_0x322239['value']['end']);}break;case'body':_0x322239=as[_0x6f6c('0x69')]('me',null,_0x36782a);_0x131b2c[_0x3223fe](_0x322239['text'],_0x322239['value']['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);break;}}else{var _0x322239=as[_0x6f6c('0x69')](_0x1e5395,_0xa73889[_0x6f6c('0x3b')],_0x36782a);_0x131b2c[_0x3223fe](_0x322239[_0x6f6c('0x6a')],_0x322239[_0x6f6c('0x60')]['start'],_0x322239[_0x6f6c('0x60')][_0x6f6c('0x21')]);}}}else{var _0x35847c=_(_0x575ed3['query'])[_0x6f6c('0x3c')]()[_0x6f6c('0x31')](function(_0x2a845a){return _[_0x6f6c('0x6f')](_0x4a4265,[_0x6f6c('0x2f'),_0x2a845a])?_0x2a845a:undefined;})[_0x6f6c('0x70')]()[_0x6f6c('0x60')]();if(!_[_0x6f6c('0x71')](_0x35847c)){_0x35847c[_0x6f6c('0x35')](function(_0x429b29){if(_0x429b29===_0x6f6c('0x72')){_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x74'),[][_0x6f6c('0x75')](_0x575ed3['query'][_0x429b29]));}else if(_0x429b29===_0x6f6c('0x76')){var _0x570dc8=JSON[_0x6f6c('0x77')](_0x575ed3['query'][_0x429b29])['$gte'];var _0x3c57f4=JSON[_0x6f6c('0x77')](_0x575ed3[_0x6f6c('0x42')][_0x429b29])['$lte'];_0x1414f7['where'](_0x6f6c('0x78'),_0x570dc8,_0x3c57f4);}else{if(_0x575ed3[_0x6f6c('0x42')][_0x429b29]===_0x6f6c('0x79')){_0x1414f7[_0x6f6c('0x73')]('i.'+_0x429b29+_0x6f6c('0x7a'));}else{_0x1414f7['where']('i.'+_0x429b29+_0x6f6c('0x7b'),_0x575ed3[_0x6f6c('0x42')][_0x429b29]);}}});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7c')]){if(_0x575ed3['query']['read']==0x1){_0x1414f7[_0x6f6c('0x61')]('`unreadMessages`\x20=\x200');}else{_0x1414f7[_0x6f6c('0x61')](_0x6f6c('0x7d'));}}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]){_0x4b682a=_[_0x6f6c('0x7f')](_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')])?_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]:new Array(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x7e')]);_0x4b682a['forEach'](function(_0xfc735d){_0x4dee76['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfc735d+',%');});}if(_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')]){var _0x11b270=_0x575ed3[_0x6f6c('0x42')][_0x6f6c('0x80')][_0x6f6c('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x11b270)){_0x131b2c['or'](_0x6f6c('0x82'),_0x11b270+'%')['or'](_0x6f6c('0x83'),_0x11b270+'%');}else{_0x131b2c['or'](_0x6f6c('0x84'),qs[_0x6f6c('0x85')](_0x11b270))['or'](_0x6f6c('0x86'),_0x11b270+'%');}}}_0x1414f7[_0x6f6c('0x73')](_0x131b2c);_0x1414f7[_0x6f6c('0x87')](_0x6f6c('0x88'));var _0x54a321={'type':db[_0x6f6c('0x89')][_0x6f6c('0x8a')][_0x6f6c('0x8b')],'raw':!![]};var _0x36d245=_0x1414f7[_0x6f6c('0x8c')]();_0x36d245[_0x6f6c('0x48')]('i.id');_0x36d245[_0x6f6c('0x48')](_0x6f6c('0x8d'),_0x6f6c('0x5f'));if(_0x2453eb[_0x6f6c('0x44')]){_0x2453eb[_0x6f6c('0x44')][_0x6f6c('0x35')](function(_0x239068){var _0x3a85e9=_0x239068[0x0]===_0x6f6c('0x8e')?_0x239068[0x0]:'i.'+_0x239068[0x0];_0x1414f7['order'](_0x3a85e9,_0x239068[0x1]===_0x6f6c('0x8f')?![]:!![]);});}if(!_[_0x6f6c('0x71')](_0x4b682a)){_0x1414f7[_0x6f6c('0x61')](_0x4dee76);_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x90'),_0x4b682a);}BPromise[_0x6f6c('0x91')]()[_0x6f6c('0x2c')](function(){if(!_0x1cea8d){if(_0x575ed3[_0x6f6c('0x42')]['WhatsappAccountId'])return;_0x36d245[_0x6f6c('0x73')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x92'));return;}if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]!==_0x6f6c('0x95'))return;return _0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5eb824){if(_[_0x6f6c('0x71')](_0x5eb824)){_0x36d245[_0x6f6c('0x73')](_0x6f6c('0x97'));_0x1414f7[_0x6f6c('0x73')](_0x6f6c('0x97'));}else{_0x36d245['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));_0x1414f7['where'](_0x6f6c('0x74'),_[_0x6f6c('0x31')](_0x5eb824,'id'));}});})['then'](function(){if(_0x575ed3[_0x6f6c('0x93')][_0x6f6c('0x94')]==='agent'&&!_0x1cea8d&&!_0x575ed3['query']['WhatsappAccountId'])return[];return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x36d245['toString'](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x22bf19){_0x3e1424[_0x6f6c('0x25')]=_0x22bf19[_0x6f6c('0x43')];if(_0x3e1424[_0x6f6c('0x25')]===0x0)return[];return db['sequelize'][_0x6f6c('0x42')](_0x55f56d[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x512e25){_0x5e3c3a=_[_0x6f6c('0x9a')](_0x512e25,'id');_0x54a321=_['merge'](_0x54a321,{'model':db[_0x6f6c('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x575ed3['query']['fields']){_0x2453eb['attributes']['forEach'](function(_0x3e23e5){_0x1414f7[_0x6f6c('0x48')]('i.'+_0x3e23e5);});}else{_0x1414f7[_0x6f6c('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6f6c('0x5f'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9b'),_0x6f6c('0x9c'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9d'),_0x6f6c('0x9e'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0x9f'),'contactName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa0'));_0x1414f7['field'](_0x6f6c('0xa1'),'Contact.firstName');_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa2'),'Contact.lastName');_0x1414f7['field'](_0x6f6c('0xa3'),_0x6f6c('0xa4'));_0x1414f7['field'](_0x6f6c('0xa5'),_0x6f6c('0xa6'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa7'),_0x6f6c('0xa8'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xa9'),_0x6f6c('0xaa'));_0x1414f7[_0x6f6c('0x48')]('o.fullname',_0x6f6c('0xab'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xac'),_0x6f6c('0xad'));_0x1414f7[_0x6f6c('0x48')](_0x6f6c('0xae'),_0x6f6c('0x33'));}if(_0x2453eb[_0x6f6c('0x24')])_0x1414f7[_0x6f6c('0x24')](_0x2453eb[_0x6f6c('0x24')]);if(_0x2453eb[_0x6f6c('0x26')])_0x1414f7['offset'](_0x2453eb['offset']);return db['sequelize'][_0x6f6c('0x42')](_0x1414f7[_0x6f6c('0x99')](),_0x54a321);})[_0x6f6c('0x2c')](function(_0x1cfdc2){if(_0x1cfdc2[_0x6f6c('0x43')]>0x0)_0x483593[_0x6f6c('0x73')](_0x6f6c('0xaf'),_[_0x6f6c('0x31')](_0x1cfdc2,'id'));return db[_0x6f6c('0x98')][_0x6f6c('0x42')](_0x483593[_0x6f6c('0x99')](),_0x54a321)[_0x6f6c('0x2c')](function(_0x1c7644){var _0x1c7f06=_[_0x6f6c('0xb0')](_0x1c7644,_0x6f6c('0xb1'));var _0x3a4fe6=[];_0x1cfdc2[_0x6f6c('0x35')](function(_0x53007b){_0x3a4fe6[_0x6f6c('0x36')](updateWhatsappInteraction(_0x53007b,_0x5e3c3a,_0x1c7f06));});return BPromise[_0x6f6c('0xb2')](_0x3a4fe6);});});})['then'](function(_0x406af6){_0x3e1424[_0x6f6c('0xb3')]=_0x406af6;return _0x3e1424;})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x293702,_0x2453eb))[_0x6f6c('0x37')](handleError(_0x293702,null));};exports[_0x6f6c('0xb4')]=function(_0x3b4706,_0xc691c4){var _0x1ae4ad={'raw':![],'where':{'id':_0x3b4706[_0x6f6c('0xb5')]['id']}},_0x2fd4e3={};_0x2fd4e3[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db[_0x6f6c('0x39')][_0x6f6c('0xb6')]);_0x2fd4e3['query']=_['keys'](_0x3b4706[_0x6f6c('0x42')]);_0x2fd4e3[_0x6f6c('0x3d')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],_0x2fd4e3[_0x6f6c('0x42')]);_0x1ae4ad[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x2fd4e3[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x1ae4ad[_0x6f6c('0x40')]=_0x1ae4ad[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x1ae4ad[_0x6f6c('0x40')]:_0x2fd4e3['model'];if(_0x3b4706[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x1ae4ad[_0x6f6c('0xb8')]=[{'all':!![]}];}_0x1ae4ad=_[_0x6f6c('0xb9')]({},_0x1ae4ad,_0x3b4706[_0x6f6c('0xba')]);return db[_0x6f6c('0x39')][_0x6f6c('0x67')](_0x1ae4ad)[_0x6f6c('0x2c')](handleEntityNotFound(_0xc691c4,null))['then'](respondWithResult(_0xc691c4,null))['catch'](handleError(_0xc691c4,null));};exports[_0x6f6c('0xbb')]=function(_0x5da23c,_0x8fc481){return db['WhatsappInteraction']['create'](_0x5da23c['body'],{})['then'](respondWithResult(_0x8fc481,0xc9))[_0x6f6c('0x37')](handleError(_0x8fc481,null));};exports[_0x6f6c('0x2b')]=function(_0x41e580,_0x5c7621){if(_0x41e580[_0x6f6c('0xbc')]['id']){delete _0x41e580['body']['id'];}return db['WhatsappInteraction'][_0x6f6c('0x67')]({'where':{'id':_0x41e580['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x5c7621,null))[_0x6f6c('0x2c')](saveUpdates(_0x41e580['body'],null))[_0x6f6c('0x2c')](respondWithResult(_0x5c7621,null))['catch'](handleError(_0x5c7621,null));};exports[_0x6f6c('0x2d')]=function(_0x5c99f4,_0x2a462c){return db[_0x6f6c('0x39')]['find']({'where':{'id':_0x5c99f4['params']['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x2a462c,null))[_0x6f6c('0x2c')](removeEntity(_0x2a462c,null))[_0x6f6c('0x37')](handleError(_0x2a462c,null));};exports['describe']=function(_0x77bcc5,_0x351154){return db['WhatsappInteraction'][_0x6f6c('0xbd')]()[_0x6f6c('0x2c')](respondWithResult(_0x351154,null))[_0x6f6c('0x37')](handleError(_0x351154,null));};exports[_0x6f6c('0xbe')]=function(_0x22f3fe,_0x4a3e54,_0x29e58d){return db[_0x6f6c('0xbf')][_0x6f6c('0x67')]({'where':{'id':_0x22f3fe[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x4a3e54,null))[_0x6f6c('0x2c')](function(_0x519695){if(_0x519695){return _0x519695[_0x6f6c('0xbe')](_0x22f3fe[_0x6f6c('0xbc')][_0x6f6c('0xc0')],_[_0x6f6c('0xc1')](_0x22f3fe['body'],[_0x6f6c('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x4a3e54,null))['catch'](handleError(_0x4a3e54,null));};exports['getMessages']=function(_0x554d97,_0x131193,_0x3081f4){var _0x419c99={'raw':![],'where':{}};var _0x201cbc={};var _0x2f5295={'count':0x0,'rows':[]};return db[_0x6f6c('0x39')]['findOne']({'where':{'id':_0x554d97[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x131193,null))[_0x6f6c('0x2c')](function(_0x3b9737){if(_0x3b9737){_0x201cbc[_0x6f6c('0x3f')]=_[_0x6f6c('0x3c')](db['WhatsappMessage'][_0x6f6c('0xb6')]);_0x201cbc[_0x6f6c('0x42')]=_[_0x6f6c('0x3c')](_0x554d97[_0x6f6c('0x42')]);_0x201cbc[_0x6f6c('0x3d')]=_['intersection'](_0x201cbc[_0x6f6c('0x3f')],_0x201cbc[_0x6f6c('0x42')]);_0x419c99[_0x6f6c('0x40')]=_[_0x6f6c('0x3e')](_0x201cbc[_0x6f6c('0x3f')],qs[_0x6f6c('0x41')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x41')]));_0x419c99[_0x6f6c('0x40')]=_0x419c99[_0x6f6c('0x40')][_0x6f6c('0x43')]?_0x419c99[_0x6f6c('0x40')]:_0x201cbc['model'];if(!_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc2')](_0x6f6c('0xc3'))){_0x419c99['limit']=qs[_0x6f6c('0x24')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x24')]);_0x419c99[_0x6f6c('0x26')]=qs[_0x6f6c('0x26')](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x26')]);}_0x419c99[_0x6f6c('0x44')]=qs['sort'](_0x554d97[_0x6f6c('0x42')][_0x6f6c('0x45')]);_0x419c99[_0x6f6c('0x73')]=qs[_0x6f6c('0x3d')](_[_0x6f6c('0x46')](_0x554d97[_0x6f6c('0x42')],_0x201cbc['filters']));_0x419c99[_0x6f6c('0x73')][_0x6f6c('0xb1')]=_0x3b9737['id'];if(_0x554d97[_0x6f6c('0x42')]['filter']){_0x419c99[_0x6f6c('0x73')]=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],{'$or':_[_0x6f6c('0x31')](_0x419c99[_0x6f6c('0x40')],function(_0x186df6){var _0x2234c3={};_0x2234c3[_0x186df6]={'$like':'%'+_0x554d97[_0x6f6c('0x42')]['filter']+'%'};return _0x2234c3;})});}if(_0x554d97['query'][_0x6f6c('0xc4')]){var _0x3fc079=_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xc4')][_0x6f6c('0x34')](',');var _0x416e6b={};_0x416e6b[_0x3fc079[0x0]]={'$gte':moment(_0x3fc079[0x1])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))};_0x419c99['where']=_[_0x6f6c('0xb9')](_0x419c99[_0x6f6c('0x73')],_0x416e6b);}_0x419c99=_[_0x6f6c('0xb9')]({},_0x419c99,_0x554d97[_0x6f6c('0xba')]);return db[_0x6f6c('0xbf')]['count']({'where':_0x419c99[_0x6f6c('0x73')]})['then'](function(_0x13dd6a){_0x2f5295['count']=_0x13dd6a;if(_0x554d97[_0x6f6c('0x42')][_0x6f6c('0xb7')]){_0x419c99['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x419c99);})['then'](function(_0x50533d){_0x2f5295[_0x6f6c('0xb3')]=_0x50533d;return _0x2f5295;});}})[_0x6f6c('0x2c')](respondWithFilteredResult(_0x131193,_0x419c99))[_0x6f6c('0x37')](handleError(_0x131193,null));};exports[_0x6f6c('0xc7')]=function(_0x4fcbe4,_0xcd4755,_0x1da394){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x4fcbe4[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0xcd4755,null))[_0x6f6c('0x2c')](function(_0x320910){if(_0x320910){return _0x320910[_0x6f6c('0xc8')](_0x4fcbe4[_0x6f6c('0xbc')]['ids'],_[_0x6f6c('0xc1')](_0x4fcbe4[_0x6f6c('0xbc')],[_0x6f6c('0xc0'),'id'])||{})[_0x6f6c('0xc9')](function(){return db[_0x6f6c('0x6c')]['findAll']({'attributes':['id',_0x6f6c('0x2f'),_0x6f6c('0x49')],'where':{'id':_0x4fcbe4[_0x6f6c('0xbc')][_0x6f6c('0xc0')]}});})[_0x6f6c('0x2c')](function(_0xf295c6){socket[_0x6f6c('0xca')](_0x6f6c('0xcb'),{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]});return{'id':Number(_0x4fcbe4[_0x6f6c('0xb5')]['id']),'tags':_0xf295c6||[]};});}})[_0x6f6c('0x2c')](respondWithResult(_0xcd4755,null))[_0x6f6c('0x37')](handleError(_0xcd4755,null));};exports[_0x6f6c('0xcc')]=function(_0x542037,_0x58a342,_0x18a07a){return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x542037[_0x6f6c('0xb5')]['id']}})[_0x6f6c('0x2c')](handleEntityNotFound(_0x58a342,null))[_0x6f6c('0x2c')](function(_0x45e483){if(_0x45e483){return _0x45e483['removeTags'](_0x542037[_0x6f6c('0x42')]['ids']);}})[_0x6f6c('0x2c')](respondWithStatusCode(_0x58a342,null))['catch'](handleError(_0x58a342,null));};exports[_0x6f6c('0xcd')]=function(_0x564032,_0x9c80b8){var _0x592093=moment()[_0x6f6c('0xce')]()[_0x6f6c('0x99')]();var _0x33b11d=path[_0x6f6c('0xcf')](config[_0x6f6c('0xd0')],'server',_0x6f6c('0xd1'),'tmp');var _0x1f0cdd=path[_0x6f6c('0xcf')](config['root'],_0x6f6c('0xd2'),_0x6f6c('0xd1'),_0x6f6c('0xd3'));var _0x4b70f9=path['join'](_0x33b11d,_0x592093);var _0x2fa7ba=util[_0x6f6c('0xc5')](_0x6f6c('0xd4'),_0x564032[_0x6f6c('0xb5')]['id'],_0x592093);var _0xf4b669=path[_0x6f6c('0xcf')](_0x33b11d,_0x2fa7ba);var _0x1dd405=[];_0x1dd405['push']({'model':db[_0x6f6c('0xd5')],'as':_0x6f6c('0xd5'),'attributes':['id',_0x6f6c('0x32')],'raw':!![]});_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xd6')],'as':_0x6f6c('0xd7'),'attributes':['id',_0x6f6c('0xd8'),_0x6f6c('0xd9')],'raw':!![]});if(_0x564032[_0x6f6c('0x42')][_0x6f6c('0xd3')]){_0x1dd405[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xda')],'as':_0x6f6c('0xda'),'raw':!![]});}var _0x4263a8=[{'model':db[_0x6f6c('0xbf')],'as':_0x6f6c('0xdb'),'attributes':['id','body',_0x6f6c('0x76'),_0x6f6c('0xdc'),_0x6f6c('0xdd'),_0x6f6c('0x7c')],'include':_0x1dd405}];_0x4263a8[_0x6f6c('0x36')]({'model':db[_0x6f6c('0xde')],'as':'Account','attributes':['id',_0x6f6c('0x2f')]});_0x4263a8[_0x6f6c('0x36')]({'model':db['User'],'as':_0x6f6c('0xdf'),'attributes':['id',_0x6f6c('0x32')]});return db[_0x6f6c('0x39')][_0x6f6c('0x67')]({'where':{'id':_0x564032[_0x6f6c('0xb5')]['id']},'include':_0x4263a8})[_0x6f6c('0x2c')](handleEntityNotFound(_0x9c80b8,null))['then'](function(_0x56f154){if(_0x56f154){var _0x299cba=_0x56f154[_0x6f6c('0xe0')]({'plain':!![]});fs[_0x6f6c('0xe1')](_0x4b70f9);var _0xdfbb66={'channel':_0x6f6c('0xe2'),'account':_0x299cba[_0x6f6c('0xe3')]['name'],'agent':_0x299cba[_0x6f6c('0xdf')]?_0x299cba[_0x6f6c('0xdf')][_0x6f6c('0x32')]:_0x6f6c('0xe4'),'createdAt':moment(_0x299cba[_0x6f6c('0x76')])[_0x6f6c('0xc5')](_0x6f6c('0xc6'))[_0x6f6c('0x99')](),'closedAt':_0x299cba[_0x6f6c('0xe5')]?moment(_0x299cba[_0x6f6c('0xe6')])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')]():'','disposition':_0x299cba[_0x6f6c('0xe7')],'messages':_(_0x299cba[_0x6f6c('0xdb')])[_0x6f6c('0x80')]({'secret':![]})['map'](function(_0x30c391){if(_0x30c391[_0x6f6c('0xda')]){var _0x504107=path[_0x6f6c('0xcf')](_0x1f0cdd,_0x30c391['Attachment'][_0x6f6c('0xe8')]);if(fs['existsSync'](_0x504107)){fs[_0x6f6c('0xe9')](_0x504107)[_0x6f6c('0xea')](fs[_0x6f6c('0xeb')](path[_0x6f6c('0xcf')](_0x4b70f9,_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')])));}}return{'date':moment(_0x30c391['createdAt'])[_0x6f6c('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f6c('0x99')](),'sender':_0x30c391['direction']==='out'?_0x30c391[_0x6f6c('0xd5')]?_0x30c391[_0x6f6c('0xd5')][_0x6f6c('0x32')]:_0x6f6c('0xec'):_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd8')]+(_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]?'\x20'+_0x30c391[_0x6f6c('0xd7')][_0x6f6c('0xd9')]:''),'body':_0x30c391[_0x6f6c('0xda')]?_0x30c391[_0x6f6c('0xda')][_0x6f6c('0xe8')]:_0x30c391[_0x6f6c('0xbc')],'direction':_0x30c391[_0x6f6c('0xdc')]==='out'?'A':'C','secret':_0x30c391['secret'],'read':_0x30c391['read'],'attachment':_0x30c391[_0x6f6c('0xda')]};})[_0x6f6c('0x60')]()};return ejs[_0x6f6c('0xed')](path['join'](config['root'],_0x6f6c('0xd2'),'views','downloadInteraction.ejs'),{'interaction':_0xdfbb66})[_0x6f6c('0x2c')](function(_0xbf23d9){var _0x5bdf5b=path[_0x6f6c('0xcf')](_0x4b70f9,_0x6f6c('0xee')+_0x299cba['id']+'-'+_0x592093+_0x6f6c('0xef'));var _0x2036f5={'path':_0x5bdf5b,'channel':_0x6f6c('0xe2'),'interactionId':_0x299cba['id']};return pdf[_0x6f6c('0xf0')](_0xbf23d9,_0x2036f5);})['then'](function(){return new BPromise(function(_0x31d00c,_0x4afa35){zipdir(_0x4b70f9,{'saveTo':_0xf4b669},function(_0x13c4fc,_0x9eac45){if(_0x13c4fc)return _0x4afa35(_0x13c4fc);return _0x31d00c(_0x9eac45);});})['then'](function(){return new BPromise(function(_0x3c77b0,_0xbc6856){rimraf(_0x4b70f9,function(_0x3873fd){if(_0x3873fd)_0xbc6856(_0x3873fd);return _0x3c77b0();});});})[_0x6f6c('0x2c')](function(){return _0x9c80b8[_0x6f6c('0xcd')](_0xf4b669,_0x2fa7ba,function(_0x19174a){if(_0x19174a){console['log'](_0x6f6c('0xf1'),_0x19174a);}else{fs[_0x6f6c('0xf2')](_0xf4b669);}});});});}else{return _0x9c80b8[_0x6f6c('0x1f')](0xc8);}})['catch'](handleError(_0x9c80b8,null));}; \ No newline at end of file +var _0xd6fd=['some','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','show','params','intersection','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','removeTags','unix','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','root','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','register','sendStatus','end','json','offset','undefined','count','limit','status','set','reject','update','destroy','error','name','send','fullname','Tags','TagIds','split','forEach','push','then','catch','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','find','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','buildExpression'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xd6fd,0x7d));var _0xdd6f=function(_0xb5646e,_0x327fd7){_0xb5646e=_0xb5646e-0x0;var _0x55fe64=_0xd6fd[_0xb5646e];return _0x55fe64;};'use strict';var emlformat=require(_0xdd6f('0x0'));var rimraf=require(_0xdd6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd6f('0x2'));var BPromise=require(_0xdd6f('0x3'));var Mustache=require(_0xdd6f('0x4'));var util=require(_0xdd6f('0x5'));var path=require(_0xdd6f('0x6'));var sox=require(_0xdd6f('0x7'));var csv=require(_0xdd6f('0x8'));var ejs=require(_0xdd6f('0x9'));var fs=require('fs');var fs_extra=require(_0xdd6f('0xa'));var _=require(_0xdd6f('0xb'));var squel=require(_0xdd6f('0xc'));var crypto=require(_0xdd6f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd6f('0x8'));var querystring=require('querystring');var Papa=require(_0xdd6f('0xe'));var Redis=require(_0xdd6f('0xf'));var authService=require(_0xdd6f('0x10'));var qs=require(_0xdd6f('0x11'));var as=require(_0xdd6f('0x12'));var pdf=require(_0xdd6f('0x13'));var hardwareService=require(_0xdd6f('0x14'));var logger=require(_0xdd6f('0x15'))(_0xdd6f('0x16'));var utils=require(_0xdd6f('0x17'));var config=require(_0xdd6f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdd6f('0x19')],{'host':_0xdd6f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xdd6f('0x1b')](socket);function respondWithStatusCode(_0x2bfd22,_0x9c141e){_0x9c141e=_0x9c141e||0xcc;return function(_0xd63d26){if(_0xd63d26){return _0x2bfd22[_0xdd6f('0x1c')](_0x9c141e);}return _0x2bfd22['status'](_0x9c141e)[_0xdd6f('0x1d')]();};}function respondWithResult(_0x427fb6,_0x1aeae3){_0x1aeae3=_0x1aeae3||0xc8;return function(_0x5e72a6){if(_0x5e72a6){return _0x427fb6['status'](_0x1aeae3)[_0xdd6f('0x1e')](_0x5e72a6);}};}function respondWithFilteredResult(_0x572c15,_0x1ef38f){return function(_0x4286ae){if(_0x4286ae){var _0x4b5215=typeof _0x1ef38f[_0xdd6f('0x1f')]===_0xdd6f('0x20')&&typeof _0x1ef38f['limit']==='undefined';var _0x581ac8=_0x4286ae[_0xdd6f('0x21')];var _0x211dd3=_0x4b5215?0x0:_0x1ef38f['offset'];var _0x49bcb9=_0x4b5215?_0x4286ae[_0xdd6f('0x21')]:_0x1ef38f['offset']+_0x1ef38f[_0xdd6f('0x22')];var _0x515016;if(_0x49bcb9>=_0x581ac8){_0x49bcb9=_0x581ac8;_0x515016=0xc8;}else{_0x515016=0xce;}_0x572c15[_0xdd6f('0x23')](_0x515016);return _0x572c15[_0xdd6f('0x24')]('Content-Range',_0x211dd3+'-'+_0x49bcb9+'/'+_0x581ac8)[_0xdd6f('0x1e')](_0x4286ae);}return null;};}function patchUpdates(_0x4155b2){return function(_0x23abb6){try{jsonpatch['apply'](_0x23abb6,_0x4155b2,!![]);}catch(_0x3f03f9){return BPromise[_0xdd6f('0x25')](_0x3f03f9);}return _0x23abb6['save']();};}function saveUpdates(_0x3de039,_0x9a1021){return function(_0x5b419d){if(_0x5b419d){return _0x5b419d[_0xdd6f('0x26')](_0x3de039)['then'](function(_0x10f1f3){return _0x10f1f3;});}return null;};}function removeEntity(_0x25219a,_0x3b8378){return function(_0x161d29){if(_0x161d29){return _0x161d29[_0xdd6f('0x27')]()['then'](function(){_0x25219a[_0xdd6f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a601d,_0x59c825){return function(_0x59e863){if(!_0x59e863){_0x2a601d[_0xdd6f('0x1c')](0x194);}return _0x59e863;};}function handleError(_0x2c951b,_0x20a235){_0x20a235=_0x20a235||0x1f4;return function(_0x276ff4){logger[_0xdd6f('0x28')](_0x276ff4['stack']);if(_0x276ff4['name']){delete _0x276ff4[_0xdd6f('0x29')];}_0x2c951b[_0xdd6f('0x23')](_0x20a235)[_0xdd6f('0x2a')](_0x276ff4);};}function getInteractionUsers(_0x48f43a,_0x34119b){return new BPromise(function(_0x3b7598,_0x32d3bb){try{if(_0x34119b[_0x48f43a['id']]){_0x48f43a['Users']=_['map'](_0x34119b[_0x48f43a['id']],function(_0xfb8929){return{'id':_0xfb8929['id'],'fullname':_0xfb8929[_0xdd6f('0x2b')]};});}}catch(_0x10ee43){_0x32d3bb(_0x10ee43);}_0x3b7598(_0x48f43a);});}function getInteractionTags(_0x453e40,_0x71a1d2){return new BPromise(function(_0x2cb00e,_0x5dfb32){try{if(_0x453e40['TagIds']){_0x453e40[_0xdd6f('0x2c')]=[];_0x453e40[_0xdd6f('0x2d')][_0xdd6f('0x2e')](',')[_0xdd6f('0x2f')](function(_0x542d3b){_0x453e40[_0xdd6f('0x2c')][_0xdd6f('0x30')](_0x71a1d2[_0x542d3b]);});}delete _0x453e40['TagIds'];}catch(_0x47a3db){_0x5dfb32(_0x47a3db);}_0x2cb00e(_0x453e40);});}function updateWhatsappInteraction(_0x23f144,_0x5ba68e,_0x1ea1a4){return new BPromise(function(_0x44e58b,_0x5fdc64){return getInteractionUsers(_0x23f144,_0x1ea1a4)[_0xdd6f('0x31')](function(_0x132280){return getInteractionTags(_0x132280,_0x5ba68e);})[_0xdd6f('0x31')](function(_0x171a96){_0x44e58b(_0x171a96);})[_0xdd6f('0x32')](function(_0x4cb7c8){_0x5fdc64(_0x4cb7c8);});});}exports[_0xdd6f('0x33')]=function(_0x1f8c94,_0x116684){var _0x88803={},_0x54afbd={},_0x2bbf24={'count':0x0,'rows':[]};var _0x1598ee=_[_0xdd6f('0x34')](db[_0xdd6f('0x35')][_0xdd6f('0x36')],function(_0x50d10e){return{'name':_0x50d10e[_0xdd6f('0x37')],'type':_0x50d10e[_0xdd6f('0x38')][_0xdd6f('0x39')]};});_0x54afbd['model']=_[_0xdd6f('0x34')](_0x1598ee,_0xdd6f('0x29'));_0x54afbd[_0xdd6f('0x3a')]=_[_0xdd6f('0x3b')](_0x1f8c94[_0xdd6f('0x3a')]);_0x54afbd[_0xdd6f('0x3c')]=_['intersection'](_0x54afbd[_0xdd6f('0x3d')],_0x54afbd[_0xdd6f('0x3a')]);_0x88803[_0xdd6f('0x3e')]=_['intersection'](_0x54afbd[_0xdd6f('0x3d')],qs[_0xdd6f('0x3f')](_0x1f8c94['query']['fields']));_0x88803['attributes']=_0x88803[_0xdd6f('0x3e')][_0xdd6f('0x40')]?_0x88803['attributes']:_0x54afbd['model'];if(!_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x41')](_0xdd6f('0x42'))){_0x88803['limit']=qs[_0xdd6f('0x22')](_0x1f8c94[_0xdd6f('0x3a')]['limit']);_0x88803[_0xdd6f('0x1f')]=qs['offset'](_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x1f')]);}_0x88803[_0xdd6f('0x43')]=qs[_0xdd6f('0x44')](_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x44')]);_0x88803[_0xdd6f('0x45')]=qs[_0xdd6f('0x3c')](_['pick'](_0x1f8c94[_0xdd6f('0x3a')],_0x54afbd[_0xdd6f('0x3c')]),_0x1598ee);var _0x50253a=[];var _0x72a27f=squel['select']()[_0xdd6f('0x46')]('id')[_0xdd6f('0x46')](_0xdd6f('0x29'))['field'](_0xdd6f('0x47'))[_0xdd6f('0x48')](_0xdd6f('0x49'));var _0x4fb5a4=squel[_0xdd6f('0x4a')]()[_0xdd6f('0x46')](_0xdd6f('0x4b'))['field'](_0xdd6f('0x4c'))[_0xdd6f('0x46')](_0xdd6f('0x4d'))[_0xdd6f('0x48')]('user_has_whatsapp_interactions','ui')['left_join'](_0xdd6f('0x4e'),'u',_0xdd6f('0x4f'));var _0x365868=squel[_0xdd6f('0x4a')]()[_0xdd6f('0x48')](_0xdd6f('0x50'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xdd6f('0x4e'),'o','o.id\x20=\x20i.UserId')[_0xdd6f('0x51')](_0xdd6f('0x52'),'a',_0xdd6f('0x53'))[_0xdd6f('0x51')]('whatsapp_messages','me',_0xdd6f('0x54'))[_0xdd6f('0x51')](_0xdd6f('0x55'),'it',_0xdd6f('0x56'))['left_join'](_0xdd6f('0x49'),'t',_0xdd6f('0x57'));var _0x2a026d=squel['expr']();var _0x4e2147=[];var _0x562111=squel[_0xdd6f('0x58')]();var _0x5445d6;if(_0x1f8c94[_0xdd6f('0x3a')]['search']){_0x5445d6=as[_0xdd6f('0x59')](_0x1f8c94[_0xdd6f('0x3a')]['search']);var _0x70fee6=_0x5445d6[_0xdd6f('0x5a')];for(var _0x2a6085=0x0;_0x2a6085<_0x5445d6['conditions'][_0xdd6f('0x40')];_0x2a6085++){var _0x2d2477=_0x5445d6['conditions'][_0x2a6085];var _0x44780e='i';var _0x1ba741=_[_0xdd6f('0x5b')](_0x1598ee,[_0xdd6f('0x29'),_0x2d2477['field']]);if(!_0x1ba741){switch(_0x2d2477['field']){case _0xdd6f('0x5c'):if(_0x2d2477[_0xdd6f('0x5d')]==0x1){_0x365868[_0xdd6f('0x5e')]('`'+_0x2d2477[_0xdd6f('0x46')]+'`\x20=\x200');}else{_0x365868[_0xdd6f('0x5e')]('`'+_0x2d2477[_0xdd6f('0x46')]+'`\x20>\x200');}break;case _0xdd6f('0x5f'):if(_0x2d2477[_0xdd6f('0x60')]===_0xdd6f('0x61')){if(_0x2d2477['value'][_0xdd6f('0x2e')]('\x20')['length']>0x1){_0x2a026d[_0x70fee6](_0xdd6f('0x62'),qs[_0xdd6f('0x63')](_0x2d2477[_0xdd6f('0x5d')]),null);}else{var _0x5c0604='%'+_0x2d2477[_0xdd6f('0x5d')]+'%';_0x2a026d[_0x70fee6](_0xdd6f('0x64'),_0x5c0604,_0x5c0604,_0x5c0604);}}else{_0x1ba741=_[_0xdd6f('0x5b')](_0x1598ee,[_0xdd6f('0x29'),_0xdd6f('0x65')]);_0x2d2477['field']=_0xdd6f('0x65');_0x5cd3f3=as['buildExpression'](_0x44780e,_0x1ba741[_0xdd6f('0x38')],_0x2d2477);_0x2a026d[_0x70fee6](_0x5cd3f3[_0xdd6f('0x66')],_0x5cd3f3[_0xdd6f('0x5d')]['start'],_0x5cd3f3[_0xdd6f('0x5d')][_0xdd6f('0x1d')]);}break;case _0xdd6f('0x67'):var _0x1a1b19=_0x2d2477[_0xdd6f('0x5d')][_0xdd6f('0x2e')](',')[_0xdd6f('0x34')](function(_0x1f1940){return Number(_0x1f1940);});_0x1a1b19[_0xdd6f('0x2f')](function(_0x130942){_0x562111['or'](_0xdd6f('0x68'),'%,'+_0x130942+',%');});_0x4e2147=_['union'](_0x4e2147,_0x1a1b19);break;case _0xdd6f('0x69'):if(_0x2d2477[_0xdd6f('0x60')]===_0xdd6f('0x61')){_0x2a026d[_0x70fee6](_0xdd6f('0x6a'),'%'+_0x2d2477[_0xdd6f('0x5d')]+'%',null);}else{_0x1ba741=_[_0xdd6f('0x5b')](_0x1598ee,[_0xdd6f('0x29'),'UserId']);_0x2d2477[_0xdd6f('0x46')]='UserId';_0x5cd3f3=as['buildExpression'](_0x44780e,_0x1ba741[_0xdd6f('0x38')],_0x2d2477);_0x2a026d[_0x70fee6](_0x5cd3f3[_0xdd6f('0x66')],_0x5cd3f3[_0xdd6f('0x5d')][_0xdd6f('0x6b')],_0x5cd3f3['value'][_0xdd6f('0x1d')]);}break;case _0xdd6f('0x6c'):_0x5cd3f3=as[_0xdd6f('0x6d')]('me',null,_0x2d2477);_0x2a026d[_0x70fee6](_0x5cd3f3[_0xdd6f('0x66')],_0x5cd3f3['value']['start'],_0x5cd3f3[_0xdd6f('0x5d')]['end']);break;}}else{var _0x5cd3f3=as[_0xdd6f('0x6d')](_0x44780e,_0x1ba741[_0xdd6f('0x38')],_0x2d2477);_0x2a026d[_0x70fee6](_0x5cd3f3[_0xdd6f('0x66')],_0x5cd3f3['value'][_0xdd6f('0x6b')],_0x5cd3f3[_0xdd6f('0x5d')][_0xdd6f('0x1d')]);}}}else{var _0x153c2b=_(_0x1f8c94[_0xdd6f('0x3a')])['keys']()[_0xdd6f('0x34')](function(_0x3996ff){return _[_0xdd6f('0x6e')](_0x1598ee,[_0xdd6f('0x29'),_0x3996ff])?_0x3996ff:undefined;})['compact']()[_0xdd6f('0x5d')]();if(!_[_0xdd6f('0x6f')](_0x153c2b)){_0x153c2b[_0xdd6f('0x2f')](function(_0x4124aa){if(_0x4124aa==='WhatsappAccountId'){_0x365868['where'](_0xdd6f('0x70'),[][_0xdd6f('0x71')](_0x1f8c94['query'][_0x4124aa]));}else if(_0x4124aa==='createdAt'){var _0x585b44=JSON['parse'](_0x1f8c94[_0xdd6f('0x3a')][_0x4124aa])['$gte'];var _0x1319f0=JSON['parse'](_0x1f8c94[_0xdd6f('0x3a')][_0x4124aa])[_0xdd6f('0x72')];_0x365868[_0xdd6f('0x45')](_0xdd6f('0x73'),_0x585b44,_0x1319f0);}else{if(_0x1f8c94[_0xdd6f('0x3a')][_0x4124aa]===_0xdd6f('0x74')){_0x365868[_0xdd6f('0x45')]('i.'+_0x4124aa+_0xdd6f('0x75'));}else{_0x365868[_0xdd6f('0x45')]('i.'+_0x4124aa+_0xdd6f('0x76'),_0x1f8c94[_0xdd6f('0x3a')][_0x4124aa]);}}});}if(_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x77')]){if(_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x77')]==0x1){_0x365868[_0xdd6f('0x5e')](_0xdd6f('0x78'));}else{_0x365868[_0xdd6f('0x5e')](_0xdd6f('0x79'));}}if(_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x7a')]){_0x4e2147=_['isArray'](_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x7a')])?_0x1f8c94[_0xdd6f('0x3a')]['tag']:new Array(_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x7a')]);_0x4e2147[_0xdd6f('0x2f')](function(_0x5ac020){_0x562111['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ac020+',%');});}if(_0x1f8c94['query'][_0xdd6f('0x7b')]){var _0x4fd6a1=_0x1f8c94['query'][_0xdd6f('0x7b')]['replace']('\x5c','\x5c\x5c')[_0xdd6f('0x7c')](/'/g,'\x27\x27');if(qs[_0xdd6f('0x7d')](_0x4fd6a1)){_0x2a026d['or'](_0xdd6f('0x7e'),_0x4fd6a1+'%')['or'](_0xdd6f('0x7f'),_0x4fd6a1+'%');}else{_0x2a026d['or'](_0xdd6f('0x80'),qs[_0xdd6f('0x63')](_0x4fd6a1))['or'](_0xdd6f('0x81'),_0x4fd6a1+'%');}}}_0x365868[_0xdd6f('0x45')](_0x2a026d);_0x365868[_0xdd6f('0x82')](_0xdd6f('0x83'));var _0x44e14b={'type':db[_0xdd6f('0x84')][_0xdd6f('0x85')][_0xdd6f('0x86')],'raw':!![]};var _0x5c9c96=_0x365868['clone']();_0x5c9c96[_0xdd6f('0x46')](_0xdd6f('0x83'));_0x5c9c96[_0xdd6f('0x46')](_0xdd6f('0x87'),_0xdd6f('0x5c'));if(_0x88803[_0xdd6f('0x43')]){_0x88803['order'][_0xdd6f('0x2f')](function(_0x35613b){var _0x54b59d=_0x35613b[0x0]===_0xdd6f('0x88')?_0x35613b[0x0]:'i.'+_0x35613b[0x0];_0x365868[_0xdd6f('0x43')](_0x54b59d,_0x35613b[0x1]===_0xdd6f('0x89')?![]:!![]);});}if(!_[_0xdd6f('0x6f')](_0x4e2147)){_0x365868['having'](_0x562111);_0x5c9c96[_0xdd6f('0x45')](_0xdd6f('0x8a'),_0x4e2147);}BPromise[_0xdd6f('0x8b')]()[_0xdd6f('0x31')](function(){if(!_0x5445d6){if(_0x1f8c94['query']['WhatsappAccountId'])return;_0x5c9c96[_0xdd6f('0x45')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x365868[_0xdd6f('0x45')](_0xdd6f('0x8c'));return;}if(_0x1f8c94[_0xdd6f('0x8d')][_0xdd6f('0x8e')]!==_0xdd6f('0x8f'))return;return _0x1f8c94[_0xdd6f('0x8d')][_0xdd6f('0x90')]({'attributes':['id'],'raw':!![]})[_0xdd6f('0x31')](function(_0x2aad60){if(_[_0xdd6f('0x6f')](_0x2aad60)){_0x5c9c96['where'](_0xdd6f('0x91'));_0x365868[_0xdd6f('0x45')](_0xdd6f('0x91'));}else{_0x5c9c96[_0xdd6f('0x45')](_0xdd6f('0x70'),_['map'](_0x2aad60,'id'));_0x365868[_0xdd6f('0x45')](_0xdd6f('0x70'),_[_0xdd6f('0x34')](_0x2aad60,'id'));}});})['then'](function(){if(_0x1f8c94['user']['role']==='agent'&&!_0x5445d6&&!_0x1f8c94[_0xdd6f('0x3a')][_0xdd6f('0x92')])return[];return db['sequelize'][_0xdd6f('0x3a')](_0x5c9c96[_0xdd6f('0x93')](),_0x44e14b);})[_0xdd6f('0x31')](function(_0x46768e){_0x2bbf24[_0xdd6f('0x21')]=_0x46768e[_0xdd6f('0x40')];if(_0x2bbf24[_0xdd6f('0x21')]===0x0)return[];return db[_0xdd6f('0x94')][_0xdd6f('0x3a')](_0x72a27f['toString'](),_0x44e14b)[_0xdd6f('0x31')](function(_0xddfef){_0x50253a=_[_0xdd6f('0x95')](_0xddfef,'id');_0x44e14b=_[_0xdd6f('0x96')](_0x44e14b,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1f8c94['query'][_0xdd6f('0x3f')]){_0x88803[_0xdd6f('0x3e')][_0xdd6f('0x2f')](function(_0x6c7c2c){_0x365868['field']('i.'+_0x6c7c2c);});}else{_0x365868[_0xdd6f('0x46')](_0xdd6f('0x87'),_0xdd6f('0x5c'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0x97'),_0xdd6f('0x98'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0x99'),_0xdd6f('0x9a'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0x9b'),_0xdd6f('0x88'));_0x365868[_0xdd6f('0x46')]('i.*');_0x365868[_0xdd6f('0x46')](_0xdd6f('0x9c'),_0xdd6f('0x9d'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0x9e'),_0xdd6f('0x9f'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0xa0'),_0xdd6f('0xa1'));_0x365868['field'](_0xdd6f('0xa2'),_0xdd6f('0xa3'));_0x365868['field'](_0xdd6f('0xa4'),'Contact.mobile');_0x365868['field'](_0xdd6f('0xa5'),_0xdd6f('0xa6'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0xa7'),_0xdd6f('0xa8'));_0x365868[_0xdd6f('0x46')]('o.internal',_0xdd6f('0xa9'));_0x365868[_0xdd6f('0x46')](_0xdd6f('0xaa'),_0xdd6f('0x2d'));}if(_0x88803[_0xdd6f('0x22')])_0x365868[_0xdd6f('0x22')](_0x88803['limit']);if(_0x88803[_0xdd6f('0x1f')])_0x365868[_0xdd6f('0x1f')](_0x88803['offset']);return db[_0xdd6f('0x94')][_0xdd6f('0x3a')](_0x365868['toString'](),_0x44e14b);})[_0xdd6f('0x31')](function(_0x53b398){if(_0x53b398['length']>0x0)_0x4fb5a4[_0xdd6f('0x45')](_0xdd6f('0xab'),_[_0xdd6f('0x34')](_0x53b398,'id'));return db[_0xdd6f('0x94')][_0xdd6f('0x3a')](_0x4fb5a4['toString'](),_0x44e14b)[_0xdd6f('0x31')](function(_0x53bed6){var _0x50b3cb=_[_0xdd6f('0xac')](_0x53bed6,_0xdd6f('0xad'));var _0x4ac97b=[];_0x53b398[_0xdd6f('0x2f')](function(_0x3cd214){_0x4ac97b[_0xdd6f('0x30')](updateWhatsappInteraction(_0x3cd214,_0x50253a,_0x50b3cb));});return BPromise['all'](_0x4ac97b);});});})[_0xdd6f('0x31')](function(_0x1a8683){_0x2bbf24['rows']=_0x1a8683;return _0x2bbf24;})[_0xdd6f('0x31')](respondWithFilteredResult(_0x116684,_0x88803))[_0xdd6f('0x32')](handleError(_0x116684,null));};exports[_0xdd6f('0xae')]=function(_0x5ee90a,_0x1630d5){var _0x4db6f9={'raw':![],'where':{'id':_0x5ee90a[_0xdd6f('0xaf')]['id']}},_0x59165b={};_0x59165b[_0xdd6f('0x3d')]=_['keys'](db[_0xdd6f('0x35')][_0xdd6f('0x36')]);_0x59165b[_0xdd6f('0x3a')]=_[_0xdd6f('0x3b')](_0x5ee90a[_0xdd6f('0x3a')]);_0x59165b[_0xdd6f('0x3c')]=_['intersection'](_0x59165b[_0xdd6f('0x3d')],_0x59165b['query']);_0x4db6f9[_0xdd6f('0x3e')]=_[_0xdd6f('0xb0')](_0x59165b['model'],qs[_0xdd6f('0x3f')](_0x5ee90a[_0xdd6f('0x3a')][_0xdd6f('0x3f')]));_0x4db6f9[_0xdd6f('0x3e')]=_0x4db6f9[_0xdd6f('0x3e')][_0xdd6f('0x40')]?_0x4db6f9[_0xdd6f('0x3e')]:_0x59165b[_0xdd6f('0x3d')];if(_0x5ee90a['query']['includeAll']){_0x4db6f9[_0xdd6f('0xb1')]=[{'all':!![]}];}_0x4db6f9=_[_0xdd6f('0x96')]({},_0x4db6f9,_0x5ee90a[_0xdd6f('0xb2')]);return db['WhatsappInteraction']['find'](_0x4db6f9)[_0xdd6f('0x31')](handleEntityNotFound(_0x1630d5,null))[_0xdd6f('0x31')](respondWithResult(_0x1630d5,null))['catch'](handleError(_0x1630d5,null));};exports['create']=function(_0x24198b,_0x206ca0){return db[_0xdd6f('0x35')][_0xdd6f('0xb3')](_0x24198b[_0xdd6f('0x6c')],{})[_0xdd6f('0x31')](respondWithResult(_0x206ca0,0xc9))['catch'](handleError(_0x206ca0,null));};exports[_0xdd6f('0x26')]=function(_0x55e350,_0x571241){if(_0x55e350[_0xdd6f('0x6c')]['id']){delete _0x55e350[_0xdd6f('0x6c')]['id'];}return db[_0xdd6f('0x35')][_0xdd6f('0x5b')]({'where':{'id':_0x55e350[_0xdd6f('0xaf')]['id']}})[_0xdd6f('0x31')](handleEntityNotFound(_0x571241,null))[_0xdd6f('0x31')](saveUpdates(_0x55e350[_0xdd6f('0x6c')],null))[_0xdd6f('0x31')](respondWithResult(_0x571241,null))[_0xdd6f('0x32')](handleError(_0x571241,null));};exports['destroy']=function(_0x211f42,_0x26b137){return db[_0xdd6f('0x35')][_0xdd6f('0x5b')]({'where':{'id':_0x211f42[_0xdd6f('0xaf')]['id']}})['then'](handleEntityNotFound(_0x26b137,null))[_0xdd6f('0x31')](removeEntity(_0x26b137,null))[_0xdd6f('0x32')](handleError(_0x26b137,null));};exports[_0xdd6f('0xb4')]=function(_0x41914e,_0x531f28){return db[_0xdd6f('0x35')][_0xdd6f('0xb4')]()[_0xdd6f('0x31')](respondWithResult(_0x531f28,null))[_0xdd6f('0x32')](handleError(_0x531f28,null));};exports[_0xdd6f('0xb5')]=function(_0x435a38,_0x34029d,_0x317801){return db['WhatsappMessage']['find']({'where':{'id':_0x435a38[_0xdd6f('0xaf')]['id']}})[_0xdd6f('0x31')](handleEntityNotFound(_0x34029d,null))[_0xdd6f('0x31')](function(_0x33e5ef){if(_0x33e5ef){return _0x33e5ef[_0xdd6f('0xb5')](_0x435a38['body'][_0xdd6f('0xb6')],_[_0xdd6f('0xb7')](_0x435a38[_0xdd6f('0x6c')],[_0xdd6f('0xb6'),'id'])||{});}})[_0xdd6f('0x31')](respondWithResult(_0x34029d,null))[_0xdd6f('0x32')](handleError(_0x34029d,null));};exports[_0xdd6f('0xb8')]=function(_0x2a3add,_0x1b31bf,_0x1b0f11){var _0x3576a7={'raw':![],'where':{}};var _0x195d25={};var _0x302469={'count':0x0,'rows':[]};return db[_0xdd6f('0x35')][_0xdd6f('0xb9')]({'where':{'id':_0x2a3add['params']['id']}})[_0xdd6f('0x31')](handleEntityNotFound(_0x1b31bf,null))[_0xdd6f('0x31')](function(_0x2a8889){if(_0x2a8889){_0x195d25['model']=_[_0xdd6f('0x3b')](db[_0xdd6f('0xba')][_0xdd6f('0x36')]);_0x195d25['query']=_[_0xdd6f('0x3b')](_0x2a3add['query']);_0x195d25[_0xdd6f('0x3c')]=_[_0xdd6f('0xb0')](_0x195d25[_0xdd6f('0x3d')],_0x195d25[_0xdd6f('0x3a')]);_0x3576a7[_0xdd6f('0x3e')]=_[_0xdd6f('0xb0')](_0x195d25[_0xdd6f('0x3d')],qs[_0xdd6f('0x3f')](_0x2a3add['query'][_0xdd6f('0x3f')]));_0x3576a7[_0xdd6f('0x3e')]=_0x3576a7['attributes'][_0xdd6f('0x40')]?_0x3576a7[_0xdd6f('0x3e')]:_0x195d25[_0xdd6f('0x3d')];if(!_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0x41')](_0xdd6f('0x42'))){_0x3576a7[_0xdd6f('0x22')]=qs[_0xdd6f('0x22')](_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0x22')]);_0x3576a7[_0xdd6f('0x1f')]=qs[_0xdd6f('0x1f')](_0x2a3add[_0xdd6f('0x3a')]['offset']);}_0x3576a7['order']=qs[_0xdd6f('0x44')](_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0x44')]);_0x3576a7[_0xdd6f('0x45')]=qs[_0xdd6f('0x3c')](_[_0xdd6f('0xbb')](_0x2a3add[_0xdd6f('0x3a')],_0x195d25[_0xdd6f('0x3c')]));_0x3576a7[_0xdd6f('0x45')][_0xdd6f('0xad')]=_0x2a8889['id'];if(_0x2a3add['query'][_0xdd6f('0x7b')]){_0x3576a7[_0xdd6f('0x45')]=_[_0xdd6f('0x96')](_0x3576a7[_0xdd6f('0x45')],{'$or':_[_0xdd6f('0x34')](_0x3576a7[_0xdd6f('0x3e')],function(_0x18a478){var _0x4aa533={};_0x4aa533[_0x18a478]={'$like':'%'+_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0x7b')]+'%'};return _0x4aa533;})});}if(_0x2a3add['query'][_0xdd6f('0xbc')]){var _0x1df812=_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0xbc')][_0xdd6f('0x2e')](',');var _0x2a9834={};_0x2a9834[_0x1df812[0x0]]={'$gte':moment(_0x1df812[0x1])[_0xdd6f('0xbd')](_0xdd6f('0xbe'))};_0x3576a7[_0xdd6f('0x45')]=_[_0xdd6f('0x96')](_0x3576a7['where'],_0x2a9834);}_0x3576a7=_[_0xdd6f('0x96')]({},_0x3576a7,_0x2a3add[_0xdd6f('0xb2')]);return db[_0xdd6f('0xba')][_0xdd6f('0x21')]({'where':_0x3576a7[_0xdd6f('0x45')]})[_0xdd6f('0x31')](function(_0xe29940){_0x302469[_0xdd6f('0x21')]=_0xe29940;if(_0x2a3add[_0xdd6f('0x3a')][_0xdd6f('0xbf')]){_0x3576a7['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xdd6f('0xc0')](_0x3576a7);})[_0xdd6f('0x31')](function(_0x54da34){_0x302469['rows']=_0x54da34;return _0x302469;});}})['then'](respondWithFilteredResult(_0x1b31bf,_0x3576a7))[_0xdd6f('0x32')](handleError(_0x1b31bf,null));};exports[_0xdd6f('0xc1')]=function(_0x4f86c9,_0x1be588,_0x498e07){return db[_0xdd6f('0x35')][_0xdd6f('0x5b')]({'where':{'id':_0x4f86c9[_0xdd6f('0xaf')]['id']}})[_0xdd6f('0x31')](handleEntityNotFound(_0x1be588,null))[_0xdd6f('0x31')](function(_0x59652c){if(_0x59652c){return _0x59652c[_0xdd6f('0xc2')](_0x4f86c9[_0xdd6f('0x6c')][_0xdd6f('0xb6')],_['omit'](_0x4f86c9[_0xdd6f('0x6c')],[_0xdd6f('0xb6'),'id'])||{})[_0xdd6f('0xc3')](function(){return db[_0xdd6f('0x67')]['findAll']({'attributes':['id',_0xdd6f('0x29'),_0xdd6f('0x47')],'where':{'id':_0x4f86c9[_0xdd6f('0x6c')][_0xdd6f('0xb6')]}});})[_0xdd6f('0x31')](function(_0x4ace17){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x4f86c9[_0xdd6f('0xaf')]['id']),'tags':_0x4ace17||[]});return{'id':Number(_0x4f86c9['params']['id']),'tags':_0x4ace17||[]};});}})['then'](respondWithResult(_0x1be588,null))[_0xdd6f('0x32')](handleError(_0x1be588,null));};exports[_0xdd6f('0xc4')]=function(_0x383d77,_0x170022,_0x3bf1cf){return db[_0xdd6f('0x35')][_0xdd6f('0x5b')]({'where':{'id':_0x383d77[_0xdd6f('0xaf')]['id']}})[_0xdd6f('0x31')](handleEntityNotFound(_0x170022,null))[_0xdd6f('0x31')](function(_0x5e9119){if(_0x5e9119){return _0x5e9119[_0xdd6f('0xc4')](_0x383d77['query']['ids']);}})[_0xdd6f('0x31')](respondWithStatusCode(_0x170022,null))['catch'](handleError(_0x170022,null));};exports['download']=function(_0x2c2555,_0x2ecf10){var _0x381a05=moment()[_0xdd6f('0xc5')]()['toString']();var _0x5c62c4=path['join'](config['root'],_0xdd6f('0xc6'),_0xdd6f('0xc7'),_0xdd6f('0xc8'));var _0x19282b=path[_0xdd6f('0xc9')](config['root'],_0xdd6f('0xc6'),_0xdd6f('0xc7'),_0xdd6f('0xca'));var _0x366174=path[_0xdd6f('0xc9')](_0x5c62c4,_0x381a05);var _0x5d7d6b=util[_0xdd6f('0xbd')](_0xdd6f('0xcb'),_0x2c2555[_0xdd6f('0xaf')]['id'],_0x381a05);var _0x712270=path[_0xdd6f('0xc9')](_0x5c62c4,_0x5d7d6b);var _0x3dc3df=[];_0x3dc3df['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x3dc3df[_0xdd6f('0x30')]({'model':db[_0xdd6f('0xcc')],'as':'Contact','attributes':['id',_0xdd6f('0xcd'),_0xdd6f('0xce')],'raw':!![]});if(_0x2c2555[_0xdd6f('0x3a')][_0xdd6f('0xca')]){_0x3dc3df[_0xdd6f('0x30')]({'model':db[_0xdd6f('0xcf')],'as':'Attachment','raw':!![]});}var _0x235744=[{'model':db[_0xdd6f('0xba')],'as':_0xdd6f('0xd0'),'attributes':['id',_0xdd6f('0x6c'),_0xdd6f('0xd1'),_0xdd6f('0xd2'),_0xdd6f('0xd3'),_0xdd6f('0x77')],'include':_0x3dc3df}];_0x235744[_0xdd6f('0x30')]({'model':db['WhatsappAccount'],'as':_0xdd6f('0xd4'),'attributes':['id',_0xdd6f('0x29')]});_0x235744[_0xdd6f('0x30')]({'model':db[_0xdd6f('0x69')],'as':'Owner','attributes':['id',_0xdd6f('0x2b')]});return db[_0xdd6f('0x35')]['find']({'where':{'id':_0x2c2555['params']['id']},'include':_0x235744})['then'](handleEntityNotFound(_0x2ecf10,null))[_0xdd6f('0x31')](function(_0x3cd656){if(_0x3cd656){var _0x3528eb=_0x3cd656[_0xdd6f('0xd5')]({'plain':!![]});fs[_0xdd6f('0xd6')](_0x366174);var _0x5c091f={'channel':_0xdd6f('0xd7'),'account':_0x3528eb[_0xdd6f('0xd4')][_0xdd6f('0x29')],'agent':_0x3528eb[_0xdd6f('0xd8')]?_0x3528eb[_0xdd6f('0xd8')][_0xdd6f('0x2b')]:_0xdd6f('0xd9'),'createdAt':moment(_0x3528eb[_0xdd6f('0xd1')])[_0xdd6f('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdd6f('0x93')](),'closedAt':_0x3528eb[_0xdd6f('0xda')]?moment(_0x3528eb[_0xdd6f('0xdb')])[_0xdd6f('0xbd')](_0xdd6f('0xbe'))[_0xdd6f('0x93')]():'','disposition':_0x3528eb[_0xdd6f('0xdc')],'messages':_(_0x3528eb[_0xdd6f('0xd0')])[_0xdd6f('0x7b')]({'secret':![]})['map'](function(_0x126e3c){if(_0x126e3c[_0xdd6f('0xcf')]){var _0x5085f7=path[_0xdd6f('0xc9')](_0x19282b,_0x126e3c[_0xdd6f('0xcf')][_0xdd6f('0xdd')]);if(fs[_0xdd6f('0xde')](_0x5085f7)){fs[_0xdd6f('0xdf')](_0x5085f7)[_0xdd6f('0xe0')](fs[_0xdd6f('0xe1')](path['join'](_0x366174,_0x126e3c[_0xdd6f('0xcf')][_0xdd6f('0xdd')])));}}return{'date':moment(_0x126e3c[_0xdd6f('0xd1')])[_0xdd6f('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x126e3c[_0xdd6f('0xd2')]===_0xdd6f('0xe2')?_0x126e3c[_0xdd6f('0x69')]?_0x126e3c[_0xdd6f('0x69')][_0xdd6f('0x2b')]:_0xdd6f('0xe3'):_0x126e3c[_0xdd6f('0x5f')][_0xdd6f('0xcd')]+(_0x126e3c['Contact']['lastName']?'\x20'+_0x126e3c[_0xdd6f('0x5f')][_0xdd6f('0xce')]:''),'body':_0x126e3c[_0xdd6f('0xcf')]?_0x126e3c[_0xdd6f('0xcf')][_0xdd6f('0xdd')]:_0x126e3c['body'],'direction':_0x126e3c[_0xdd6f('0xd2')]===_0xdd6f('0xe2')?'A':'C','secret':_0x126e3c[_0xdd6f('0xd3')],'read':_0x126e3c[_0xdd6f('0x77')],'attachment':_0x126e3c[_0xdd6f('0xcf')]};})[_0xdd6f('0x5d')]()};return ejs[_0xdd6f('0xe4')](path[_0xdd6f('0xc9')](config[_0xdd6f('0xe5')],'server',_0xdd6f('0xe6'),_0xdd6f('0xe7')),{'interaction':_0x5c091f})[_0xdd6f('0x31')](function(_0xe37423){var _0x4fca8b=path[_0xdd6f('0xc9')](_0x366174,_0xdd6f('0xe8')+_0x3528eb['id']+'-'+_0x381a05+'.pdf');var _0x3f4a1a={'path':_0x4fca8b,'channel':_0xdd6f('0xd7'),'interactionId':_0x3528eb['id']};return pdf['createPdfFromHTML'](_0xe37423,_0x3f4a1a);})['then'](function(){return new BPromise(function(_0x2990c2,_0x2b372f){zipdir(_0x366174,{'saveTo':_0x712270},function(_0x2759c1,_0xab0ee0){if(_0x2759c1)return _0x2b372f(_0x2759c1);return _0x2990c2(_0xab0ee0);});})[_0xdd6f('0x31')](function(){return new BPromise(function(_0x3ee0fc,_0x252d5e){rimraf(_0x366174,function(_0x115cc1){if(_0x115cc1)_0x252d5e(_0x115cc1);return _0x3ee0fc();});});})[_0xdd6f('0x31')](function(){return _0x2ecf10['download'](_0x712270,_0x5d7d6b,function(_0x35e41e){if(_0x35e41e){console[_0xdd6f('0xe9')]('err',_0x35e41e);}else{fs[_0xdd6f('0xea')](_0x712270);}});});});}else{return _0x2ecf10['sendStatus'](0xc8);}})[_0xdd6f('0x32')](handleError(_0x2ecf10,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 81dbb42..95724ab 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 _0x1ca7=['setDataValue','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','getUsers','then'];(function(_0x29288f,_0x3b08a1){var _0x456fe0=function(_0x3bd6e9){while(--_0x3bd6e9){_0x29288f['push'](_0x29288f['shift']());}};_0x456fe0(++_0x3b08a1);}(_0x1ca7,0x157));var _0x71ca=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1ca7[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x71ca('0x0'));var WhatsappInteraction=require(_0x71ca('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x71ca('0x2')](0x0);var events={'afterCreate':_0x71ca('0x3'),'afterUpdate':_0x71ca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2501cd){return function(_0x3b6cbf,_0x58f288,_0x58c4a5){_0x3b6cbf[_0x71ca('0x5')]({'attributes':['id'],'raw':!![]})[_0x71ca('0x6')](function(_0x31444d){_0x3b6cbf[_0x71ca('0x7')]('Users',_0x31444d[_0x71ca('0x8')](function(_0x41ca0a){return{'id':_0x41ca0a['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x3b6cbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x71ca('0x6')](function(_0x2aff62){_0x3b6cbf[_0x71ca('0x7')]('unreadMessages',_0x2aff62[_0x71ca('0x9')]);WhatsappInteractionEvents[_0x71ca('0xa')](_0x2501cd+':'+_0x3b6cbf['id'],_0x3b6cbf);WhatsappInteractionEvents[_0x71ca('0xa')](_0x2501cd,_0x3b6cbf);_0x58c4a5(null);})[_0x71ca('0xb')](_0x58c4a5(null));};}for(var e in events){if(events[_0x71ca('0xc')](e)){var event=events[e];WhatsappInteraction[_0x71ca('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xb6b1=['emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xb6b1[_0x4843f9];return _0x193c6a;};'use strict';var EventEmitter=require(_0x1b6b('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x1b6b('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x1b6b('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1b6b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b6b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a2c45){return function(_0xb1a61e,_0x2c4040,_0xdbbe22){_0xb1a61e['getUsers']({'attributes':['id'],'raw':!![]})[_0x1b6b('0x5')](function(_0x51cfed){_0xb1a61e[_0x1b6b('0x6')]('Users',_0x51cfed[_0x1b6b('0x7')](function(_0x3496b5){return{'id':_0x3496b5['id']};}));return WhatsappMessage[_0x1b6b('0x8')]({'where':{'WhatsappInteractionId':_0xb1a61e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1b6b('0x5')](function(_0x5249cd){_0xb1a61e['setDataValue'](_0x1b6b('0x9'),_0x5249cd[_0x1b6b('0xa')]);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45+':'+_0xb1a61e['id'],_0xb1a61e);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45,_0xb1a61e);_0xdbbe22(null);})[_0x1b6b('0xc')](_0xdbbe22(null));};}for(var e in events){if(events[_0x1b6b('0xd')](e)){var event=events[e];WhatsappInteraction[_0x1b6b('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 3ef6944..0d7e319 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 _0xba32=['WhatsappInteraction','whatsapp_interactions','changed','closed','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x47d9f1,_0x45b4f6){var _0x230a1e=function(_0x4d25fe){while(--_0x4d25fe){_0x47d9f1['push'](_0x47d9f1['shift']());}};_0x230a1e(++_0x45b4f6);}(_0xba32,0x12f));var _0x2ba3=function(_0x3832f9,_0x59c443){_0x3832f9=_0x3832f9-0x0;var _0x37418c=_0xba32[_0x3832f9];return _0x37418c;};'use strict';var _=require('lodash');var util=require(_0x2ba3('0x0'));var logger=require(_0x2ba3('0x1'))('api');var moment=require(_0x2ba3('0x2'));var BPromise=require(_0x2ba3('0x3'));var rp=require(_0x2ba3('0x4'));var fs=require('fs');var path=require(_0x2ba3('0x5'));var rimraf=require('rimraf');var config=require(_0x2ba3('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0x2ba3('0x7')]=function(_0x2d55ae,_0x431d3e){return _0x2d55ae[_0x2ba3('0x8')](_0x2ba3('0x9'),attributes,{'tableName':_0x2ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5abd0c,_0x48ba00,_0x5822f2){if(_0x5abd0c[_0x2ba3('0xb')](_0x2ba3('0xc'))){_0x5abd0c['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5822f2(null,_0x5abd0c);}}});}; \ No newline at end of file +var _0x4d7c=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed'];(function(_0xcc16ae,_0x575216){var _0x5e4a00=function(_0x5c245c){while(--_0x5c245c){_0xcc16ae['push'](_0xcc16ae['shift']());}};_0x5e4a00(++_0x575216);}(_0x4d7c,0xc5));var _0xc4d7=function(_0x623997,_0x91d4f2){_0x623997=_0x623997-0x0;var _0xdfe797=_0x4d7c[_0x623997];return _0xdfe797;};'use strict';var _=require(_0xc4d7('0x0'));var util=require('util');var logger=require(_0xc4d7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc4d7('0x2'));var rp=require(_0xc4d7('0x3'));var fs=require('fs');var path=require(_0xc4d7('0x4'));var rimraf=require(_0xc4d7('0x5'));var config=require(_0xc4d7('0x6'));var attributes=require(_0xc4d7('0x7'));module[_0xc4d7('0x8')]=function(_0x4c4b3b,_0x27b0df){return _0x4c4b3b[_0xc4d7('0x9')](_0xc4d7('0xa'),attributes,{'tableName':_0xc4d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4951d5,_0x5c8781,_0x23a9ef){if(_0x4951d5['changed'](_0xc4d7('0xc'))){_0x4951d5['closedAt']=moment()[_0xc4d7('0xd')](_0xc4d7('0xe'));}_0x23a9ef(null,_0x4951d5);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index edfe870..a74abd0 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 _0x112e=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','register','request','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','limit','where','addTags','omit','ids','spread','AddTags','util','randomstring','ioredis'];(function(_0x19c7d4,_0x328304){var _0x3acf9f=function(_0x5d85a8){while(--_0x5d85a8){_0x19c7d4['push'](_0x19c7d4['shift']());}};_0x3acf9f(++_0x328304);}(_0x112e,0x14a));var _0xe112=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x112e[_0x258fb0];return _0x4d1afe;};'use strict';var _=require('lodash');var util=require(_0xe112('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe112('0x1'));var fs=require('fs');var Redis=require(_0xe112('0x2'));var db=require(_0xe112('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe112('0x4'))(_0xe112('0x5'));var config=require(_0xe112('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe112('0x7')][_0xe112('0x8')]({'port':0x232a});config[_0xe112('0x9')]=_['defaults'](config[_0xe112('0x9')],{'host':_0xe112('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xe112('0xb')](socket);function respondWithRpcPromise(_0x40835e,_0xe9887,_0x5cb8b1){return new BPromise(function(_0x5592a5,_0x1793e5){return client[_0xe112('0xc')](_0x40835e,_0x5cb8b1)[_0xe112('0xd')](function(_0x996188){logger[_0xe112('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0xe9887,'request\x20sent');logger[_0xe112('0xf')](_0xe112('0x10'),_0xe9887,_0xe112('0x11'),JSON[_0xe112('0x12')](_0x996188));if(_0x996188[_0xe112('0x13')]){if(_0x996188['error'][_0xe112('0x14')]===0x1f4){logger[_0xe112('0x13')](_0xe112('0x15'),_0xe9887,_0x996188[_0xe112('0x13')][_0xe112('0x16')]);return _0x1793e5(_0x996188[_0xe112('0x13')][_0xe112('0x16')]);}logger[_0xe112('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0xe9887,_0x996188[_0xe112('0x13')]['message']);return _0x5592a5(_0x996188[_0xe112('0x13')]['message']);}else{logger['info'](_0xe112('0x15'),_0xe9887,'request\x20sent');_0x5592a5(_0x996188['result'][_0xe112('0x16')]);}})[_0xe112('0x17')](function(_0x23576f){logger[_0xe112('0x13')](_0xe112('0x15'),_0xe9887,_0x23576f);_0x1793e5(_0x23576f);});});}exports[_0xe112('0x18')]=function(_0x399303){var _0x5bd344=this;return new Promise(function(_0x272e4d,_0x10369c){return db[_0xe112('0x19')][_0xe112('0x1a')](_0x399303[_0xe112('0x1b')],{'raw':_0x399303[_0xe112('0x1c')]?_0x399303['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x399303[_0xe112('0x1c')]?_0x399303['options']['where']||null:null,'attributes':_0x399303['options']?_0x399303[_0xe112('0x1c')][_0xe112('0x1d')]||null:null,'limit':_0x399303[_0xe112('0x1c')]?_0x399303[_0xe112('0x1c')][_0xe112('0x1e')]||null:null})[_0xe112('0xd')](function(_0x86b07){logger[_0xe112('0xe')](_0xe112('0x18'),_0x399303);logger[_0xe112('0xf')]('UpdateWhatsappInteraction',_0x399303,JSON[_0xe112('0x12')](_0x86b07));_0x272e4d(_0x86b07);})[_0xe112('0x17')](function(_0x54f5dc){logger['error'](_0xe112('0x18'),_0x54f5dc[_0xe112('0x16')],_0x399303);_0x10369c(_0x5bd344[_0xe112('0x13')](0x1f4,_0x54f5dc[_0xe112('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x415167){return new Promise(function(_0x34c788,_0x52275e){return db[_0xe112('0x19')]['find']({'where':_0x415167['options']?_0x415167[_0xe112('0x1c')][_0xe112('0x1f')]||null:null})[_0xe112('0xd')](function(_0x2a4262){if(_0x2a4262){return _0x2a4262[_0xe112('0x20')](_0x415167[_0xe112('0x1b')]['ids'],_[_0xe112('0x21')](_0x415167[_0xe112('0x1b')],[_0xe112('0x22'),'id'])||{});}})[_0xe112('0x23')](function(_0x4134f3){logger[_0xe112('0xe')](_0xe112('0x24'),_0x415167);logger[_0xe112('0xf')]('AddTags',_0x415167,JSON[_0xe112('0x12')](_0x4134f3));_0x34c788(_0x4134f3);})['catch'](function(_0x274920){logger['error'](_0xe112('0x24'),_0x274920[_0xe112('0x16')],_0x415167);_0x52275e(_this[_0xe112('0x13')](0x1f4,_0x274920['message']));});});}; \ No newline at end of file +var _0xca73=['attributes','stringify','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','update','body','options','raw','where'];(function(_0x43ceaa,_0x9fb63e){var _0x2a3ae=function(_0x31c333){while(--_0x31c333){_0x43ceaa['push'](_0x43ceaa['shift']());}};_0x2a3ae(++_0x9fb63e);}(_0xca73,0x15a));var _0x3ca7=function(_0x3bfbef,_0x453133){_0x3bfbef=_0x3bfbef-0x0;var _0x1156ae=_0xca73[_0x3bfbef];return _0x1156ae;};'use strict';var _=require('lodash');var util=require(_0x3ca7('0x0'));var moment=require(_0x3ca7('0x1'));var BPromise=require(_0x3ca7('0x2'));var rs=require(_0x3ca7('0x3'));var fs=require('fs');var Redis=require(_0x3ca7('0x4'));var db=require(_0x3ca7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ca7('0x6'))(_0x3ca7('0x7'));var config=require(_0x3ca7('0x8'));var jayson=require(_0x3ca7('0x9'));var client=jayson[_0x3ca7('0xa')][_0x3ca7('0xb')]({'port':0x232a});config[_0x3ca7('0xc')]=_[_0x3ca7('0xd')](config[_0x3ca7('0xc')],{'host':_0x3ca7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ca7('0xc')]));require('./whatsappInteraction.socket')[_0x3ca7('0xf')](socket);function respondWithRpcPromise(_0x1bd421,_0xa5ac7c,_0x20aa4b){return new BPromise(function(_0x49e9c0,_0x290cbb){return client[_0x3ca7('0x10')](_0x1bd421,_0x20aa4b)[_0x3ca7('0x11')](function(_0x4680df){logger[_0x3ca7('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0xa5ac7c,_0x3ca7('0x13'));logger[_0x3ca7('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xa5ac7c,_0x3ca7('0x13'),JSON['stringify'](_0x4680df));if(_0x4680df[_0x3ca7('0x15')]){if(_0x4680df[_0x3ca7('0x15')][_0x3ca7('0x16')]===0x1f4){logger[_0x3ca7('0x15')](_0x3ca7('0x17'),_0xa5ac7c,_0x4680df['error'][_0x3ca7('0x18')]);return _0x290cbb(_0x4680df[_0x3ca7('0x15')][_0x3ca7('0x18')]);}logger[_0x3ca7('0x15')](_0x3ca7('0x17'),_0xa5ac7c,_0x4680df[_0x3ca7('0x15')]['message']);return _0x49e9c0(_0x4680df[_0x3ca7('0x15')][_0x3ca7('0x18')]);}else{logger[_0x3ca7('0x12')](_0x3ca7('0x17'),_0xa5ac7c,'request\x20sent');_0x49e9c0(_0x4680df[_0x3ca7('0x19')][_0x3ca7('0x18')]);}})['catch'](function(_0x22717b){logger[_0x3ca7('0x15')](_0x3ca7('0x17'),_0xa5ac7c,_0x22717b);_0x290cbb(_0x22717b);});});}exports[_0x3ca7('0x1a')]=function(_0x2cfb92){var _0x5b6df1=this;return new Promise(function(_0x235a1e,_0x553d96){return db['WhatsappInteraction'][_0x3ca7('0x1b')](_0x2cfb92[_0x3ca7('0x1c')],{'raw':_0x2cfb92[_0x3ca7('0x1d')]?_0x2cfb92[_0x3ca7('0x1d')][_0x3ca7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cfb92['options']?_0x2cfb92[_0x3ca7('0x1d')][_0x3ca7('0x1f')]||null:null,'attributes':_0x2cfb92['options']?_0x2cfb92['options'][_0x3ca7('0x20')]||null:null,'limit':_0x2cfb92[_0x3ca7('0x1d')]?_0x2cfb92[_0x3ca7('0x1d')]['limit']||null:null})[_0x3ca7('0x11')](function(_0x11bb08){logger['info'](_0x3ca7('0x1a'),_0x2cfb92);logger[_0x3ca7('0x14')]('UpdateWhatsappInteraction',_0x2cfb92,JSON[_0x3ca7('0x21')](_0x11bb08));_0x235a1e(_0x11bb08);})[_0x3ca7('0x22')](function(_0x145f72){logger['error'](_0x3ca7('0x1a'),_0x145f72[_0x3ca7('0x18')],_0x2cfb92);_0x553d96(_0x5b6df1[_0x3ca7('0x15')](0x1f4,_0x145f72[_0x3ca7('0x18')]));});});};exports[_0x3ca7('0x23')]=function(_0x1d07cb){return new Promise(function(_0x1dd492,_0x2a65e5){return db[_0x3ca7('0x24')][_0x3ca7('0x25')]({'where':_0x1d07cb[_0x3ca7('0x1d')]?_0x1d07cb[_0x3ca7('0x1d')][_0x3ca7('0x1f')]||null:null})[_0x3ca7('0x11')](function(_0x7b0b08){if(_0x7b0b08){return _0x7b0b08[_0x3ca7('0x26')](_0x1d07cb['body']['ids'],_[_0x3ca7('0x27')](_0x1d07cb[_0x3ca7('0x1c')],['ids','id'])||{});}})[_0x3ca7('0x28')](function(_0x254afd){logger[_0x3ca7('0x12')](_0x3ca7('0x29'),_0x1d07cb);logger['debug'](_0x3ca7('0x29'),_0x1d07cb,JSON[_0x3ca7('0x21')](_0x254afd));_0x1dd492(_0x254afd);})[_0x3ca7('0x22')](function(_0x467b01){logger[_0x3ca7('0x15')](_0x3ca7('0x29'),_0x467b01[_0x3ca7('0x18')],_0x1d07cb);_0x2a65e5(_this[_0x3ca7('0x15')](0x1f4,_0x467b01['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 70dac28..74fd6f5 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 _0x72e5=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x72e5,0xf4));var _0x572e=function(_0x19abac,_0x2e5ad0){_0x19abac=_0x19abac-0x0;var _0x332186=_0x72e5[_0x19abac];return _0x332186;};'use strict';var WhatsappInteractionEvents=require(_0x572e('0x0'));var events=['save',_0x572e('0x1'),_0x572e('0x2')];function createListener(_0x431704,_0x36e3cb){return function(_0x376587){_0x36e3cb[_0x572e('0x3')](_0x431704,_0x376587);};}function removeListener(_0x1ae8fa,_0xd772bc){return function(){WhatsappInteractionEvents[_0x572e('0x4')](_0x1ae8fa,_0xd772bc);};}exports[_0x572e('0x5')]=function(_0x29ab8b){for(var _0x3b8e80=0x0,_0x21ca28=events[_0x572e('0x6')];_0x3b8e80<_0x21ca28;_0x3b8e80++){var _0xefadf7=events[_0x3b8e80];var _0x5de44e=createListener(_0x572e('0x7')+_0xefadf7,_0x29ab8b);WhatsappInteractionEvents['on'](_0xefadf7,_0x5de44e);}}; \ No newline at end of file +var _0xfd07=['register','length','whatsappInteraction:','remove','update','emit','removeListener'];(function(_0x236122,_0x42d983){var _0x1d12b8=function(_0x157239){while(--_0x157239){_0x236122['push'](_0x236122['shift']());}};_0x1d12b8(++_0x42d983);}(_0xfd07,0x1ae));var _0x7fd0=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0xfd07[_0x1d930e];return _0x5bbd66;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x7fd0('0x0'),_0x7fd0('0x1')];function createListener(_0x166684,_0xe8cb70){return function(_0x12f2b6){_0xe8cb70[_0x7fd0('0x2')](_0x166684,_0x12f2b6);};}function removeListener(_0x2a62cc,_0x24108e){return function(){WhatsappInteractionEvents[_0x7fd0('0x3')](_0x2a62cc,_0x24108e);};}exports[_0x7fd0('0x4')]=function(_0x202e26){for(var _0x2ea59c=0x0,_0xf6b616=events[_0x7fd0('0x5')];_0x2ea59c<_0xf6b616;_0x2ea59c++){var _0x1b8f89=events[_0x2ea59c];var _0x3fba60=createListener(_0x7fd0('0x6')+_0x1b8f89,_0x202e26);WhatsappInteractionEvents['on'](_0x1b8f89,_0x3fba60);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 6a86115..5f3103c 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 _0x5bce=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','put','update','/:id/accept','accept','reject','multer'];(function(_0x54ab05,_0x3beb49){var _0xabc961=function(_0x1242bf){while(--_0x1242bf){_0x54ab05['push'](_0x54ab05['shift']());}};_0xabc961(++_0x3beb49);}(_0x5bce,0x8f));var _0xe5bc=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x5bce[_0x2442b9];return _0x31b571;};'use strict';var multer=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var path=require(_0xe5bc('0x2'));var timeout=require(_0xe5bc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe5bc('0x4'));var auth=require(_0xe5bc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe5bc('0x6'));var controller=require(_0xe5bc('0x7'));router[_0xe5bc('0x8')]('/',auth['isAuthenticated'](),controller[_0xe5bc('0x9')]);router['get'](_0xe5bc('0xa'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0xc')]);router['get'](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0xe')]);router[_0xe5bc('0xf')]('/',auth['isAuthenticated'](),interaction[_0xe5bc('0x10')](_0xe5bc('0x11'),_0xe5bc('0x12')),controller['create']);router[_0xe5bc('0xf')]('/:id/status',controller['status']);router[_0xe5bc('0x13')](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller[_0xe5bc('0x14')]);router[_0xe5bc('0x13')](_0xe5bc('0x15'),auth['isAuthenticated'](),controller[_0xe5bc('0x16')]);router[_0xe5bc('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe5bc('0x17')]);router['delete'](_0xe5bc('0xd'),auth[_0xe5bc('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x37cc=['../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','whatsapp','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x37cc,0x70));var _0xc37c=function(_0x27f3e7,_0x263967){_0x27f3e7=_0x27f3e7-0x0;var _0x302ca6=_0x37cc[_0x27f3e7];return _0x302ca6;};'use strict';var multer=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var path=require(_0xc37c('0x2'));var timeout=require(_0xc37c('0x3'));var express=require(_0xc37c('0x4'));var router=express[_0xc37c('0x5')]();var fs_extra=require(_0xc37c('0x6'));var auth=require(_0xc37c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc37c('0x8'));var controller=require(_0xc37c('0x9'));router[_0xc37c('0xa')]('/',auth['isAuthenticated'](),controller[_0xc37c('0xb')]);router[_0xc37c('0xa')](_0xc37c('0xc'),auth[_0xc37c('0xd')](),controller[_0xc37c('0xe')]);router['get'](_0xc37c('0xf'),auth[_0xc37c('0xd')](),controller[_0xc37c('0x10')]);router['post']('/',auth[_0xc37c('0xd')](),interaction[_0xc37c('0x11')](_0xc37c('0x12'),'whatsappmessage:create'),controller[_0xc37c('0x13')]);router[_0xc37c('0x14')](_0xc37c('0x15'),controller[_0xc37c('0x16')]);router[_0xc37c('0x17')](_0xc37c('0xf'),auth['isAuthenticated'](),controller[_0xc37c('0x18')]);router['put'](_0xc37c('0x19'),auth[_0xc37c('0xd')](),controller[_0xc37c('0x1a')]);router['put'](_0xc37c('0x1b'),auth[_0xc37c('0xd')](),controller['reject']);router['delete']('/:id',auth[_0xc37c('0xd')](),controller[_0xc37c('0x1c')]);module[_0xc37c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 65b7211..ecfbf22 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 _0x2707=['ENUM','out','STRING','BOOLEAN','TEXT','sequelize','exports','medium'];(function(_0x23d59c,_0x205384){var _0x2121b7=function(_0x37fea1){while(--_0x37fea1){_0x23d59c['push'](_0x23d59c['shift']());}};_0x2121b7(++_0x205384);}(_0x2707,0x65));var _0x7270=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x2707[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require(_0x7270('0x0'));module[_0x7270('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7270('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7270('0x3')]('in',_0x7270('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7270('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x7270('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7270('0x7')]}}; \ No newline at end of file +var _0xfd4c=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x6a1c38,_0x2fea7b){var _0x1f54d0=function(_0x532e4b){while(--_0x532e4b){_0x6a1c38['push'](_0x6a1c38['shift']());}};_0x1f54d0(++_0x2fea7b);}(_0xfd4c,0x17b));var _0xcfd4=function(_0x422f23,_0xe972fd){_0x422f23=_0x422f23-0x0;var _0x3ff656=_0xfd4c[_0x422f23];return _0x3ff656;};'use strict';var Sequelize=require(_0xcfd4('0x0'));module[_0xcfd4('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcfd4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcfd4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcfd4('0x4')]('in',_0xcfd4('0x5')),'defaultValue':_0xcfd4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcfd4('0x6')]},'readAt':{'type':Sequelize[_0xcfd4('0x7')]},'secret':{'type':Sequelize[_0xcfd4('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcfd4('0x6')]},'providerResponse':{'type':Sequelize[_0xcfd4('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 3263cf9..022f728 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 _0x908b=['User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','get','RejectMessage','rejectMessage','SELECT','email','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','WhatsappMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','find','create','body','destroy','describe','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact'];(function(_0xabfe59,_0x301527){var _0x50f3d9=function(_0x279cd8){while(--_0x279cd8){_0xabfe59['push'](_0xabfe59['shift']());}};_0x50f3d9(++_0x301527);}(_0x908b,0x137));var _0xb908=function(_0x495257,_0x524707){_0x495257=_0x495257-0x0;var _0x3b49b3=_0x908b[_0x495257];return _0x3b49b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb908('0x0'));var zipdir=require(_0xb908('0x1'));var jsonpatch=require(_0xb908('0x2'));var rp=require(_0xb908('0x3'));var moment=require(_0xb908('0x4'));var BPromise=require(_0xb908('0x5'));var Mustache=require('mustache');var util=require(_0xb908('0x6'));var path=require(_0xb908('0x7'));var sox=require(_0xb908('0x8'));var csv=require('to-csv');var ejs=require(_0xb908('0x9'));var fs=require('fs');var fs_extra=require(_0xb908('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb908('0xb'));var jsforce=require(_0xb908('0xc'));var deskjs=require(_0xb908('0xd'));var toCsv=require(_0xb908('0xe'));var querystring=require('querystring');var Papa=require(_0xb908('0xf'));var Redis=require('ioredis');var authService=require(_0xb908('0x10'));var qs=require(_0xb908('0x11'));var as=require(_0xb908('0x12'));var hardwareService=require(_0xb908('0x13'));var logger=require(_0xb908('0x14'))(_0xb908('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb908('0x16'));var db=require(_0xb908('0x17'))['db'];config[_0xb908('0x18')]=_[_0xb908('0x19')](config[_0xb908('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb908('0x1a'))(new Redis(config['redis']));require(_0xb908('0x1b'))[_0xb908('0x1c')](socket);var jayson=require(_0xb908('0x1d'));var client=jayson[_0xb908('0x1e')][_0xb908('0x1f')]({'port':0x232c});var client9002=jayson[_0xb908('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x303ffa,_0x4b7ba8,_0xc1ace3,_0x1827f5){return new BPromise(function(_0x43f0fb,_0x382771){var _0x169c55=_0x1827f5||client;return _0x169c55[_0xb908('0x20')](_0x303ffa,_0xc1ace3)[_0xb908('0x21')](function(_0x16040a){logger['info'](_0xb908('0x22'),_0x4b7ba8,_0xb908('0x23'));logger[_0xb908('0x24')](_0xb908('0x25'),_0x4b7ba8,_0xb908('0x23'),JSON[_0xb908('0x26')](_0x16040a));if(_0x16040a['error']){if(_0x16040a[_0xb908('0x27')][_0xb908('0x28')]===0x1f4){logger[_0xb908('0x27')](_0xb908('0x22'),_0x4b7ba8,_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);return _0x382771(_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);}logger[_0xb908('0x27')](_0xb908('0x22'),_0x4b7ba8,_0x16040a[_0xb908('0x27')]['message']);return _0x43f0fb(_0x16040a[_0xb908('0x27')][_0xb908('0x29')]);}else{logger[_0xb908('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7ba8,_0xb908('0x23'));_0x43f0fb(_0x16040a[_0xb908('0x2b')]['message']);}})[_0xb908('0x2c')](function(_0x273344){logger[_0xb908('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7ba8,_0x273344);_0x382771(_0x273344);});});}function respondWithStatusCode(_0x18ea26,_0x55b8d6){_0x55b8d6=_0x55b8d6||0xcc;return function(_0x6c39fa){if(_0x6c39fa){return _0x18ea26['sendStatus'](_0x55b8d6);}return _0x18ea26[_0xb908('0x2d')](_0x55b8d6)['end']();};}function respondWithResult(_0x52eb57,_0x384fcb){_0x384fcb=_0x384fcb||0xc8;return function(_0x2eb1cd){if(_0x2eb1cd){return _0x52eb57['status'](_0x384fcb)[_0xb908('0x2e')](_0x2eb1cd);}};}function respondWithFilteredResult(_0x37cd26,_0xc21027){return function(_0x3d7d3){if(_0x3d7d3){var _0x4ca3bf=typeof _0xc21027[_0xb908('0x2f')]==='undefined'&&typeof _0xc21027[_0xb908('0x30')]===_0xb908('0x31');var _0x419c29=_0x3d7d3[_0xb908('0x32')];var _0x524e05=_0x4ca3bf?0x0:_0xc21027[_0xb908('0x2f')];var _0x5453b9=_0x4ca3bf?_0x3d7d3[_0xb908('0x32')]:_0xc21027['offset']+_0xc21027[_0xb908('0x30')];var _0x315b2a;if(_0x5453b9>=_0x419c29){_0x5453b9=_0x419c29;_0x315b2a=0xc8;}else{_0x315b2a=0xce;}_0x37cd26[_0xb908('0x2d')](_0x315b2a);return _0x37cd26[_0xb908('0x33')](_0xb908('0x34'),_0x524e05+'-'+_0x5453b9+'/'+_0x419c29)['json'](_0x3d7d3);}return null;};}function patchUpdates(_0x3e53a4){return function(_0x21c54e){try{jsonpatch[_0xb908('0x35')](_0x21c54e,_0x3e53a4,!![]);}catch(_0x11a53c){return BPromise[_0xb908('0x36')](_0x11a53c);}return _0x21c54e[_0xb908('0x37')]();};}function saveUpdates(_0xd3be60,_0x1e465d){return function(_0x15aa4b){if(_0x15aa4b){return _0x15aa4b[_0xb908('0x38')](_0xd3be60)['then'](function(_0x5e7eac){return _0x5e7eac;});}return null;};}function removeEntity(_0x2ca2a3,_0x305188){return function(_0x1dc29f){if(_0x1dc29f){return _0x1dc29f['destroy']()[_0xb908('0x21')](function(){_0x2ca2a3[_0xb908('0x2d')](0xcc)[_0xb908('0x39')]();});}};}function handleEntityNotFound(_0x49a811,_0x4907fa){return function(_0xe4dbd5){if(!_0xe4dbd5){_0x49a811['sendStatus'](0x194);}return _0xe4dbd5;};}function handleError(_0x535b22,_0x57894b){_0x57894b=_0x57894b||0x1f4;return function(_0x40872a){logger[_0xb908('0x27')](_0x40872a[_0xb908('0x3a')]);if(_0x40872a[_0xb908('0x3b')]){delete _0x40872a[_0xb908('0x3b')];}_0x535b22['status'](_0x57894b)[_0xb908('0x3c')](_0x40872a);};}exports[_0xb908('0x3d')]=function(_0xaee53e,_0x140a6e){var _0x157d3e={},_0x4521fc={},_0x460d25={'count':0x0,'rows':[]};var _0x5eb0ee=_['map'](db[_0xb908('0x3e')][_0xb908('0x3f')],function(_0x414a35){return{'name':_0x414a35['fieldName'],'type':_0x414a35[_0xb908('0x40')][_0xb908('0x41')]};});_0x4521fc[_0xb908('0x42')]=_[_0xb908('0x43')](_0x5eb0ee,'name');_0x4521fc['query']=_[_0xb908('0x44')](_0xaee53e[_0xb908('0x45')]);_0x4521fc[_0xb908('0x46')]=_[_0xb908('0x47')](_0x4521fc['model'],_0x4521fc[_0xb908('0x45')]);_0x157d3e['attributes']=_['intersection'](_0x4521fc['model'],qs['fields'](_0xaee53e['query'][_0xb908('0x48')]));_0x157d3e[_0xb908('0x49')]=_0x157d3e[_0xb908('0x49')][_0xb908('0x4a')]?_0x157d3e[_0xb908('0x49')]:_0x4521fc[_0xb908('0x42')];if(!_0xaee53e[_0xb908('0x45')][_0xb908('0x4b')](_0xb908('0x4c'))){_0x157d3e[_0xb908('0x30')]=qs[_0xb908('0x30')](_0xaee53e[_0xb908('0x45')][_0xb908('0x30')]);_0x157d3e[_0xb908('0x2f')]=qs[_0xb908('0x2f')](_0xaee53e[_0xb908('0x45')][_0xb908('0x2f')]);}_0x157d3e[_0xb908('0x4d')]=qs[_0xb908('0x4e')](_0xaee53e[_0xb908('0x45')]['sort']);_0x157d3e[_0xb908('0x4f')]=qs[_0xb908('0x46')](_[_0xb908('0x50')](_0xaee53e[_0xb908('0x45')],_0x4521fc['filters']),_0x5eb0ee);if(_0xaee53e[_0xb908('0x45')]['filter']){_0x157d3e[_0xb908('0x4f')]=_[_0xb908('0x51')](_0x157d3e[_0xb908('0x4f')],{'$or':_[_0xb908('0x43')](_0x5eb0ee,function(_0x1c6bcc){if(_0x1c6bcc[_0xb908('0x40')]!==_0xb908('0x52')){var _0x371d13={};_0x371d13[_0x1c6bcc['name']]={'$like':'%'+_0xaee53e['query'][_0xb908('0x53')]+'%'};return _0x371d13;}})});}_0x157d3e=_['merge']({},_0x157d3e,_0xaee53e[_0xb908('0x54')]);var _0x4c9d40={'where':_0x157d3e['where']};return db[_0xb908('0x3e')][_0xb908('0x32')](_0x4c9d40)[_0xb908('0x21')](function(_0xac5e39){_0x460d25['count']=_0xac5e39;if(_0xaee53e[_0xb908('0x45')]['includeAll']){_0x157d3e[_0xb908('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb908('0x56')](_0x157d3e);})[_0xb908('0x21')](function(_0xbc3f09){_0x460d25[_0xb908('0x57')]=_0xbc3f09;return _0x460d25;})[_0xb908('0x21')](respondWithFilteredResult(_0x140a6e,_0x157d3e))[_0xb908('0x2c')](handleError(_0x140a6e,null));};exports['show']=function(_0xf7cc8a,_0x518c64){var _0x2177d9={'raw':!![],'where':{'id':_0xf7cc8a[_0xb908('0x58')]['id']}},_0x147495={};_0x147495[_0xb908('0x42')]=_[_0xb908('0x44')](db[_0xb908('0x3e')][_0xb908('0x3f')]);_0x147495[_0xb908('0x45')]=_[_0xb908('0x44')](_0xf7cc8a[_0xb908('0x45')]);_0x147495[_0xb908('0x46')]=_[_0xb908('0x47')](_0x147495['model'],_0x147495[_0xb908('0x45')]);_0x2177d9['attributes']=_[_0xb908('0x47')](_0x147495['model'],qs[_0xb908('0x48')](_0xf7cc8a[_0xb908('0x45')][_0xb908('0x48')]));_0x2177d9[_0xb908('0x49')]=_0x2177d9['attributes']['length']?_0x2177d9[_0xb908('0x49')]:_0x147495[_0xb908('0x42')];if(_0xf7cc8a[_0xb908('0x45')][_0xb908('0x59')]){_0x2177d9[_0xb908('0x55')]=[{'all':!![]}];}_0x2177d9=_[_0xb908('0x51')]({},_0x2177d9,_0xf7cc8a[_0xb908('0x54')]);return db[_0xb908('0x3e')][_0xb908('0x5a')](_0x2177d9)[_0xb908('0x21')](handleEntityNotFound(_0x518c64,null))[_0xb908('0x21')](respondWithResult(_0x518c64,null))[_0xb908('0x2c')](handleError(_0x518c64,null));};exports[_0xb908('0x5b')]=function(_0x19abe6,_0xfc9b18){return db[_0xb908('0x3e')][_0xb908('0x5b')](_0x19abe6[_0xb908('0x5c')],{})[_0xb908('0x21')](respondWithResult(_0xfc9b18,0xc9))[_0xb908('0x2c')](handleError(_0xfc9b18,null));};exports[_0xb908('0x38')]=function(_0x420133,_0x350d25){if(_0x420133[_0xb908('0x5c')]['id']){delete _0x420133['body']['id'];}return db['WhatsappMessage'][_0xb908('0x5a')]({'where':{'id':_0x420133[_0xb908('0x58')]['id']}})[_0xb908('0x21')](handleEntityNotFound(_0x350d25,null))[_0xb908('0x21')](saveUpdates(_0x420133['body'],null))[_0xb908('0x21')](respondWithResult(_0x350d25,null))[_0xb908('0x2c')](handleError(_0x350d25,null));};exports[_0xb908('0x5d')]=function(_0x312dc4,_0x38a1f9){return db['WhatsappMessage']['find']({'where':{'id':_0x312dc4[_0xb908('0x58')]['id']}})[_0xb908('0x21')](handleEntityNotFound(_0x38a1f9,null))[_0xb908('0x21')](removeEntity(_0x38a1f9,null))[_0xb908('0x2c')](handleError(_0x38a1f9,null));};exports[_0xb908('0x5e')]=function(_0x298954,_0xe67279){return db[_0xb908('0x3e')][_0xb908('0x5e')]()[_0xb908('0x21')](respondWithResult(_0xe67279,null))[_0xb908('0x2c')](handleError(_0xe67279,null));};var interaction_log=require(_0xb908('0x14'))('whatsapp-interactions');exports[_0xb908('0x5f')]=function(_0x25c861,_0x2ff9bd,_0x272983){var _0x449438={'agent':{},'channel':_0xb908('0x60')};if(_0x25c861['body']['id']){delete _0x25c861[_0xb908('0x5c')]['id'];}_0x25c861['body']['read']=!![];_0x25c861[_0xb908('0x5c')][_0xb908('0x61')]=moment()[_0xb908('0x62')](_0xb908('0x63'));_0x25c861[_0xb908('0x5c')][_0xb908('0x64')]=_0x25c861[_0xb908('0x5c')][_0xb908('0x64')]||_0x25c861['user']['id'];_0x449438[_0xb908('0x65')]['id']=_0x25c861[_0xb908('0x5c')][_0xb908('0x64')];return db[_0xb908('0x3e')][_0xb908('0x5a')]({'where':{'id':_0x25c861[_0xb908('0x58')]['id'],'UserId':null}})[_0xb908('0x21')](handleEntityNotFound(_0x2ff9bd,null))['then'](saveUpdates(_0x25c861['body'],null))['then'](function(_0x5b3ca2){if(_0x5b3ca2){_0x449438[_0xb908('0x29')]=_0x5b3ca2['get']({'plain':!![]});return db[_0xb908('0x66')][_0xb908('0x5a')]({'where':{'id':_0x5b3ca2[_0xb908('0x67')]}});}return null;})[_0xb908('0x21')](handleEntityNotFound(_0x2ff9bd,null))[_0xb908('0x21')](function(_0x1372a3){if(_0x1372a3){return _0x1372a3[_0xb908('0x38')]({'UserId':_0x25c861[_0xb908('0x5c')][_0xb908('0x64')],'read1stAt':_[_0xb908('0x68')](_0x1372a3['read1stAt'])?moment()['format'](_0xb908('0x63')):undefined});}return null;})['then'](function(_0x525c33){if(_0x525c33){_0x449438[_0xb908('0x69')]=_0x525c33['get']({'plain':!![]});interaction_log[_0xb908('0x2a')](_0xb908('0x6a'),_0x25c861[_0xb908('0x6b')]['id'],_0x25c861[_0xb908('0x6b')][_0xb908('0x3b')],_0x25c861[_0xb908('0x6b')][_0xb908('0x6c')],_0x449438[_0xb908('0x69')]['id'],_0x25c861[_0xb908('0x5c')]?JSON['stringify'](_0x25c861[_0xb908('0x5c')]):_0xb908('0x6d'));return respondWithRpcPromise(_0xb908('0x6e'),_0xb908('0x6f'),_0x449438);}return null;})[_0xb908('0x21')](function(_0x2e392c){var _0x31a285=_0xb908('0x70')+_0x2e392c['message'][_0xb908('0x71')];return db[_0xb908('0x72')]['query'](_0x31a285,{'type':db[_0xb908('0x73')][_0xb908('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x20876c){return _0x20876c;});})[_0xb908('0x21')](function(_0x474c2b){if(_0x474c2b){_0x449438[_0xb908('0x29')][_0xb908('0x75')]=_0x474c2b[0x0];if(!_0x25c861['body'][_0xb908('0x64')])return;return db[_0xb908('0x76')]['find']({'where':{'id':_0x25c861['body'][_0xb908('0x64')],'role':_0xb908('0x65')},'attributes':['id',_0xb908('0x3b'),_0xb908('0x77'),'email',_0xb908('0x78')],'raw':!![]});}return null;})['then'](function(_0x337fb4){if(!_0x337fb4)return null;_0x449438[_0xb908('0x29')][_0xb908('0x65')]=_0x337fb4;return _0x449438;})[_0xb908('0x21')](function(_0x5ed229){if(_0x5ed229){if(_0x25c861['body'][_0xb908('0x79')]){_0x449438[_0xb908('0x29')]['interface']=util['format'](_0xb908('0x7a'),_0x25c861[_0xb908('0x6b')]['name']);_0x449438[_0xb908('0x29')][_0xb908('0x7b')]=_0x449438[_0xb908('0x7b')];_0x449438[_0xb908('0x29')][_0xb908('0x7c')]=_0x449438[_0xb908('0x7b')];_0x449438[_0xb908('0x29')][_0xb908('0x7d')]=_0xb908('0x5f');return respondWithRpcPromise(_0xb908('0x7e'),'EventManager',{'event':'acceptmessage','message':_0x449438[_0xb908('0x29')]},client9002)[_0xb908('0x21')](function(){return _0x449438;});}return _0x449438;}return null;})[_0xb908('0x21')](respondWithResult(_0x2ff9bd,null))[_0xb908('0x2c')](handleError(_0x2ff9bd,null));};var interaction_log=require(_0xb908('0x14'))(_0xb908('0x7f'));exports[_0xb908('0x36')]=function(_0x21e654,_0x40250d,_0x5357e3){var _0xfd3da0={'agent':{},'channel':_0xb908('0x60')};if(_0x21e654['body']['id']){delete _0x21e654[_0xb908('0x5c')]['id'];}_0x21e654['body'][_0xb908('0x64')]=_0x21e654[_0xb908('0x5c')]['UserId']||_0x21e654['user']['id'];_0xfd3da0[_0xb908('0x65')]['id']=_0x21e654[_0xb908('0x5c')]['UserId'];return db[_0xb908('0x3e')][_0xb908('0x5a')]({'where':{'id':_0x21e654[_0xb908('0x58')]['id'],'UserId':null}})[_0xb908('0x21')](handleEntityNotFound(_0x40250d,null))[_0xb908('0x21')](function(_0x41ba46){if(_0x41ba46){_0xfd3da0['message']=_0x41ba46[_0xb908('0x80')]({'plain':!![]});return db[_0xb908('0x66')]['find']({'where':{'id':_0x41ba46[_0xb908('0x67')]}});}return null;})[_0xb908('0x21')](handleEntityNotFound(_0x40250d,null))[_0xb908('0x21')](function(_0x159740){if(_0x159740){_0xfd3da0['interaction']=_0x159740[_0xb908('0x80')]({'plain':!![]});interaction_log[_0xb908('0x2a')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21e654[_0xb908('0x6b')]['id'],_0x21e654[_0xb908('0x6b')][_0xb908('0x3b')],_0x21e654[_0xb908('0x6b')]['role'],_0xfd3da0['interaction']['id'],_0x21e654['body']?JSON[_0xb908('0x26')](_0x21e654[_0xb908('0x5c')]):'null');return respondWithRpcPromise(_0xb908('0x81'),_0xb908('0x82'),_0xfd3da0);}return null;})['then'](function(_0x581e7a){var _0x4beae2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x581e7a['message'][_0xb908('0x71')];return db['sequelize']['query'](_0x4beae2,{'type':db['Sequelize'][_0xb908('0x74')][_0xb908('0x83')],'raw':!![]})['then'](function(_0xa7b819){return _0xa7b819;});})['then'](function(_0x401088){if(_0x401088){_0xfd3da0[_0xb908('0x29')][_0xb908('0x75')]=_0x401088[0x0];if(!_0x21e654[_0xb908('0x5c')][_0xb908('0x64')])return;return db[_0xb908('0x76')][_0xb908('0x5a')]({'where':{'id':_0x21e654[_0xb908('0x5c')]['UserId'],'role':_0xb908('0x65')},'attributes':['id','name',_0xb908('0x77'),_0xb908('0x84'),_0xb908('0x78')],'raw':!![]});}return null;})[_0xb908('0x21')](function(_0x26add7){if(!_0x26add7)return null;_0xfd3da0[_0xb908('0x29')]['agent']=_0x26add7;return _0xfd3da0;})[_0xb908('0x21')](function(_0x42ea5d){if(_0x42ea5d){_0x42ea5d[_0xb908('0x29')]['interface']=util[_0xb908('0x62')](_0xb908('0x7a'),_0x21e654['user'][_0xb908('0x3b')]);_0x42ea5d[_0xb908('0x29')]['channel']=_0xfd3da0[_0xb908('0x7b')];_0x42ea5d[_0xb908('0x29')]['motionChannel']=_0xfd3da0[_0xb908('0x7b')];_0x42ea5d[_0xb908('0x29')]['event']=_0xb908('0x36');respondWithRpcPromise(_0xb908('0x7e'),'EventManager',{'event':'rejectmessage','message':_0x42ea5d[_0xb908('0x29')]},client9002);return _0xfd3da0;}return null;})[_0xb908('0x21')](respondWithResult(_0x40250d,null))[_0xb908('0x2c')](handleError(_0x40250d,null));};exports['status']=function(_0x5813f6,_0x4bb91f,_0x2b48e2){if(_0x5813f6[_0xb908('0x5c')]['id']){delete _0x5813f6[_0xb908('0x5c')]['id'];}var _0x240393;return db['WhatsappMessage'][_0xb908('0x5a')]({'where':{'id':_0x5813f6[_0xb908('0x58')]['id']}})['then'](handleEntityNotFound(_0x4bb91f,null))[_0xb908('0x21')](function(_0x42aba7){if(_0x42aba7){_0x240393=_0x42aba7;return db[_0xb908('0x85')][_0xb908('0x5a')]({'where':{'id':_0x42aba7[_0xb908('0x86')]}});}})['then'](handleEntityNotFound(_0x4bb91f,null))[_0xb908('0x21')](function(_0x2c3d33){if(_0x2c3d33){logger[_0xb908('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xb908('0x2d'),_0xb908('0x87'),_0x2c3d33[_0xb908('0x40')],util['inspect'](_0x5813f6[_0xb908('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2c3d33[_0xb908('0x40')]){case'twilio':if(_0x5813f6[_0xb908('0x5c')]['MessageSid']&&_0x5813f6['body'][_0xb908('0x88')]===_0x240393[_0xb908('0x89')]&&_0x5813f6[_0xb908('0x5c')]['MessageStatus']&&_0x5813f6[_0xb908('0x5c')][_0xb908('0x8a')]===_0xb908('0x8b')){return _0x240393[_0xb908('0x38')]({'read':!![]});}else{logger[_0xb908('0x27')](_0xb908('0x8c'),_0xb908('0x2d'),_0xb908('0x8d'),util[_0xb908('0x8e')](_0x5813f6['body'],{'showHidden':![],'depth':null}));}break;}return _0x240393;}})[_0xb908('0x21')](respondWithResult(_0x4bb91f,null))[_0xb908('0x2c')](handleError(_0x4bb91f,null));}; \ No newline at end of file +var _0x49bb=['options','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','rejectmessage','WhatsappAccount','WhatsappAccountId','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','offset','limit','set','json','reject','save','update','destroy','stack','index','map','WhatsappMessage','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x49bb,0xc6));var _0xb49b=function(_0x3fdb3b,_0x44633b){_0x3fdb3b=_0x3fdb3b-0x0;var _0x24d7d0=_0x49bb[_0x3fdb3b];return _0x24d7d0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb49b('0x0'));var jsonpatch=require(_0xb49b('0x1'));var rp=require(_0xb49b('0x2'));var moment=require(_0xb49b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb49b('0x4'));var sox=require(_0xb49b('0x5'));var csv=require(_0xb49b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb49b('0x7'));var jsforce=require(_0xb49b('0x8'));var deskjs=require(_0xb49b('0x9'));var toCsv=require(_0xb49b('0x6'));var querystring=require(_0xb49b('0xa'));var Papa=require(_0xb49b('0xb'));var Redis=require(_0xb49b('0xc'));var authService=require(_0xb49b('0xd'));var qs=require(_0xb49b('0xe'));var as=require(_0xb49b('0xf'));var hardwareService=require(_0xb49b('0x10'));var logger=require(_0xb49b('0x11'))(_0xb49b('0x12'));var utils=require('../../config/utils');var config=require(_0xb49b('0x13'));var licenseUtil=require(_0xb49b('0x14'));var db=require(_0xb49b('0x15'))['db'];config[_0xb49b('0x16')]=_[_0xb49b('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb49b('0x18'))(new Redis(config[_0xb49b('0x16')]));require(_0xb49b('0x19'))[_0xb49b('0x1a')](socket);var jayson=require(_0xb49b('0x1b'));var client=jayson[_0xb49b('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xb49b('0x1c')][_0xb49b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4df11e,_0x2e3013,_0x9985b5,_0x2ecabc){return new BPromise(function(_0x2622b8,_0x42cbc0){var _0x4d98f7=_0x2ecabc||client;return _0x4d98f7[_0xb49b('0x1e')](_0x4df11e,_0x9985b5)[_0xb49b('0x1f')](function(_0x5ea851){logger[_0xb49b('0x20')](_0xb49b('0x21'),_0x2e3013,'request\x20sent');logger[_0xb49b('0x22')](_0xb49b('0x23'),_0x2e3013,_0xb49b('0x24'),JSON['stringify'](_0x5ea851));if(_0x5ea851[_0xb49b('0x25')]){if(_0x5ea851[_0xb49b('0x25')][_0xb49b('0x26')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2e3013,_0x5ea851[_0xb49b('0x25')]['message']);return _0x42cbc0(_0x5ea851['error'][_0xb49b('0x27')]);}logger['error'](_0xb49b('0x21'),_0x2e3013,_0x5ea851[_0xb49b('0x25')][_0xb49b('0x27')]);return _0x2622b8(_0x5ea851[_0xb49b('0x25')][_0xb49b('0x27')]);}else{logger[_0xb49b('0x20')](_0xb49b('0x21'),_0x2e3013,_0xb49b('0x24'));_0x2622b8(_0x5ea851['result']['message']);}})['catch'](function(_0x142eb4){logger[_0xb49b('0x25')](_0xb49b('0x21'),_0x2e3013,_0x142eb4);_0x42cbc0(_0x142eb4);});});}function respondWithStatusCode(_0x3da894,_0x45405b){_0x45405b=_0x45405b||0xcc;return function(_0x4ad287){if(_0x4ad287){return _0x3da894[_0xb49b('0x28')](_0x45405b);}return _0x3da894[_0xb49b('0x29')](_0x45405b)[_0xb49b('0x2a')]();};}function respondWithResult(_0x50853f,_0x390a91){_0x390a91=_0x390a91||0xc8;return function(_0x53ebb4){if(_0x53ebb4){return _0x50853f[_0xb49b('0x29')](_0x390a91)['json'](_0x53ebb4);}};}function respondWithFilteredResult(_0x82ade6,_0x4b97b1){return function(_0x16f155){if(_0x16f155){var _0x2a4d6e=typeof _0x4b97b1['offset']==='undefined'&&typeof _0x4b97b1['limit']==='undefined';var _0x5aef79=_0x16f155['count'];var _0x536da2=_0x2a4d6e?0x0:_0x4b97b1[_0xb49b('0x2b')];var _0x288f46=_0x2a4d6e?_0x16f155['count']:_0x4b97b1['offset']+_0x4b97b1[_0xb49b('0x2c')];var _0xa2e45;if(_0x288f46>=_0x5aef79){_0x288f46=_0x5aef79;_0xa2e45=0xc8;}else{_0xa2e45=0xce;}_0x82ade6[_0xb49b('0x29')](_0xa2e45);return _0x82ade6[_0xb49b('0x2d')]('Content-Range',_0x536da2+'-'+_0x288f46+'/'+_0x5aef79)[_0xb49b('0x2e')](_0x16f155);}return null;};}function patchUpdates(_0xb5a928){return function(_0x5eb0c3){try{jsonpatch['apply'](_0x5eb0c3,_0xb5a928,!![]);}catch(_0x2d26ee){return BPromise[_0xb49b('0x2f')](_0x2d26ee);}return _0x5eb0c3[_0xb49b('0x30')]();};}function saveUpdates(_0x24432d,_0x5668c6){return function(_0x4915fc){if(_0x4915fc){return _0x4915fc[_0xb49b('0x31')](_0x24432d)[_0xb49b('0x1f')](function(_0x472ee5){return _0x472ee5;});}return null;};}function removeEntity(_0x353395,_0x33c46f){return function(_0x115a8b){if(_0x115a8b){return _0x115a8b[_0xb49b('0x32')]()['then'](function(){_0x353395['status'](0xcc)[_0xb49b('0x2a')]();});}};}function handleEntityNotFound(_0xe51b96,_0x586882){return function(_0x105f06){if(!_0x105f06){_0xe51b96[_0xb49b('0x28')](0x194);}return _0x105f06;};}function handleError(_0x2ef823,_0x28616c){_0x28616c=_0x28616c||0x1f4;return function(_0x89438a){logger[_0xb49b('0x25')](_0x89438a[_0xb49b('0x33')]);if(_0x89438a['name']){delete _0x89438a['name'];}_0x2ef823['status'](_0x28616c)['send'](_0x89438a);};}exports[_0xb49b('0x34')]=function(_0x512b64,_0x5b91d5){var _0xa8b0cb={},_0x2a985b={},_0x2125f0={'count':0x0,'rows':[]};var _0xd7e289=_[_0xb49b('0x35')](db[_0xb49b('0x36')]['rawAttributes'],function(_0x4f38b9){return{'name':_0x4f38b9[_0xb49b('0x37')],'type':_0x4f38b9[_0xb49b('0x38')][_0xb49b('0x39')]};});_0x2a985b[_0xb49b('0x3a')]=_['map'](_0xd7e289,_0xb49b('0x3b'));_0x2a985b['query']=_[_0xb49b('0x3c')](_0x512b64[_0xb49b('0x3d')]);_0x2a985b[_0xb49b('0x3e')]=_[_0xb49b('0x3f')](_0x2a985b[_0xb49b('0x3a')],_0x2a985b['query']);_0xa8b0cb['attributes']=_[_0xb49b('0x3f')](_0x2a985b['model'],qs[_0xb49b('0x40')](_0x512b64['query'][_0xb49b('0x40')]));_0xa8b0cb[_0xb49b('0x41')]=_0xa8b0cb[_0xb49b('0x41')][_0xb49b('0x42')]?_0xa8b0cb[_0xb49b('0x41')]:_0x2a985b[_0xb49b('0x3a')];if(!_0x512b64[_0xb49b('0x3d')]['hasOwnProperty'](_0xb49b('0x43'))){_0xa8b0cb[_0xb49b('0x2c')]=qs[_0xb49b('0x2c')](_0x512b64['query']['limit']);_0xa8b0cb[_0xb49b('0x2b')]=qs[_0xb49b('0x2b')](_0x512b64['query'][_0xb49b('0x2b')]);}_0xa8b0cb[_0xb49b('0x44')]=qs['sort'](_0x512b64[_0xb49b('0x3d')][_0xb49b('0x45')]);_0xa8b0cb[_0xb49b('0x46')]=qs[_0xb49b('0x3e')](_['pick'](_0x512b64['query'],_0x2a985b['filters']),_0xd7e289);if(_0x512b64[_0xb49b('0x3d')][_0xb49b('0x47')]){_0xa8b0cb['where']=_[_0xb49b('0x48')](_0xa8b0cb[_0xb49b('0x46')],{'$or':_[_0xb49b('0x35')](_0xd7e289,function(_0x1fe971){if(_0x1fe971[_0xb49b('0x38')]!==_0xb49b('0x49')){var _0x31d75c={};_0x31d75c[_0x1fe971['name']]={'$like':'%'+_0x512b64[_0xb49b('0x3d')][_0xb49b('0x47')]+'%'};return _0x31d75c;}})});}_0xa8b0cb=_['merge']({},_0xa8b0cb,_0x512b64[_0xb49b('0x4a')]);var _0x1e678b={'where':_0xa8b0cb[_0xb49b('0x46')]};return db['WhatsappMessage'][_0xb49b('0x4b')](_0x1e678b)[_0xb49b('0x1f')](function(_0x3fe2f5){_0x2125f0[_0xb49b('0x4b')]=_0x3fe2f5;if(_0x512b64[_0xb49b('0x3d')]['includeAll']){_0xa8b0cb[_0xb49b('0x4c')]=[{'all':!![]}];}return db[_0xb49b('0x36')][_0xb49b('0x4d')](_0xa8b0cb);})[_0xb49b('0x1f')](function(_0x4205f9){_0x2125f0[_0xb49b('0x4e')]=_0x4205f9;return _0x2125f0;})[_0xb49b('0x1f')](respondWithFilteredResult(_0x5b91d5,_0xa8b0cb))[_0xb49b('0x4f')](handleError(_0x5b91d5,null));};exports[_0xb49b('0x50')]=function(_0x57c55c,_0x696137){var _0x258248={'raw':!![],'where':{'id':_0x57c55c[_0xb49b('0x51')]['id']}},_0x412640={};_0x412640[_0xb49b('0x3a')]=_[_0xb49b('0x3c')](db['WhatsappMessage'][_0xb49b('0x52')]);_0x412640[_0xb49b('0x3d')]=_[_0xb49b('0x3c')](_0x57c55c['query']);_0x412640[_0xb49b('0x3e')]=_[_0xb49b('0x3f')](_0x412640['model'],_0x412640[_0xb49b('0x3d')]);_0x258248[_0xb49b('0x41')]=_[_0xb49b('0x3f')](_0x412640['model'],qs[_0xb49b('0x40')](_0x57c55c[_0xb49b('0x3d')][_0xb49b('0x40')]));_0x258248[_0xb49b('0x41')]=_0x258248['attributes'][_0xb49b('0x42')]?_0x258248[_0xb49b('0x41')]:_0x412640[_0xb49b('0x3a')];if(_0x57c55c[_0xb49b('0x3d')][_0xb49b('0x53')]){_0x258248[_0xb49b('0x4c')]=[{'all':!![]}];}_0x258248=_[_0xb49b('0x48')]({},_0x258248,_0x57c55c[_0xb49b('0x4a')]);return db['WhatsappMessage'][_0xb49b('0x54')](_0x258248)['then'](handleEntityNotFound(_0x696137,null))[_0xb49b('0x1f')](respondWithResult(_0x696137,null))[_0xb49b('0x4f')](handleError(_0x696137,null));};exports[_0xb49b('0x55')]=function(_0x23af99,_0x44803b){return db[_0xb49b('0x36')][_0xb49b('0x55')](_0x23af99[_0xb49b('0x56')],{})[_0xb49b('0x1f')](respondWithResult(_0x44803b,0xc9))[_0xb49b('0x4f')](handleError(_0x44803b,null));};exports[_0xb49b('0x31')]=function(_0xa3f1f1,_0x150d46){if(_0xa3f1f1[_0xb49b('0x56')]['id']){delete _0xa3f1f1[_0xb49b('0x56')]['id'];}return db[_0xb49b('0x36')][_0xb49b('0x54')]({'where':{'id':_0xa3f1f1['params']['id']}})[_0xb49b('0x1f')](handleEntityNotFound(_0x150d46,null))[_0xb49b('0x1f')](saveUpdates(_0xa3f1f1[_0xb49b('0x56')],null))[_0xb49b('0x1f')](respondWithResult(_0x150d46,null))[_0xb49b('0x4f')](handleError(_0x150d46,null));};exports[_0xb49b('0x32')]=function(_0x14839e,_0x210a07){return db['WhatsappMessage'][_0xb49b('0x54')]({'where':{'id':_0x14839e[_0xb49b('0x51')]['id']}})[_0xb49b('0x1f')](handleEntityNotFound(_0x210a07,null))[_0xb49b('0x1f')](removeEntity(_0x210a07,null))[_0xb49b('0x4f')](handleError(_0x210a07,null));};exports[_0xb49b('0x57')]=function(_0x149631,_0x1a6dae){return db['WhatsappMessage'][_0xb49b('0x57')]()[_0xb49b('0x1f')](respondWithResult(_0x1a6dae,null))[_0xb49b('0x4f')](handleError(_0x1a6dae,null));};var interaction_log=require(_0xb49b('0x11'))(_0xb49b('0x58'));exports[_0xb49b('0x59')]=function(_0x34c0ae,_0x3cc283,_0x1e26b8){var _0x21e4a5={'agent':{},'channel':_0xb49b('0x5a')};if(_0x34c0ae[_0xb49b('0x56')]['id']){delete _0x34c0ae[_0xb49b('0x56')]['id'];}_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x5b')]=!![];_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x5c')]=moment()[_0xb49b('0x5d')](_0xb49b('0x5e'));_0x34c0ae[_0xb49b('0x56')]['UserId']=_0x34c0ae['body'][_0xb49b('0x5f')]||_0x34c0ae[_0xb49b('0x60')]['id'];_0x21e4a5[_0xb49b('0x61')]['id']=_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x5f')];return db[_0xb49b('0x36')][_0xb49b('0x54')]({'where':{'id':_0x34c0ae[_0xb49b('0x51')]['id'],'UserId':null}})[_0xb49b('0x1f')](handleEntityNotFound(_0x3cc283,null))[_0xb49b('0x1f')](saveUpdates(_0x34c0ae[_0xb49b('0x56')],null))[_0xb49b('0x1f')](function(_0x57478e){if(_0x57478e){_0x21e4a5[_0xb49b('0x27')]=_0x57478e[_0xb49b('0x62')]({'plain':!![]});return db[_0xb49b('0x63')][_0xb49b('0x54')]({'where':{'id':_0x57478e[_0xb49b('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3cc283,null))[_0xb49b('0x1f')](function(_0x36423a){if(_0x36423a){return _0x36423a[_0xb49b('0x31')]({'UserId':_0x34c0ae['body']['UserId'],'read1stAt':_['isNil'](_0x36423a[_0xb49b('0x65')])?moment()[_0xb49b('0x5d')](_0xb49b('0x5e')):undefined});}return null;})[_0xb49b('0x1f')](function(_0x26430f){if(_0x26430f){_0x21e4a5[_0xb49b('0x66')]=_0x26430f[_0xb49b('0x62')]({'plain':!![]});interaction_log[_0xb49b('0x20')](_0xb49b('0x67'),_0x34c0ae[_0xb49b('0x60')]['id'],_0x34c0ae['user'][_0xb49b('0x3b')],_0x34c0ae['user'][_0xb49b('0x68')],_0x21e4a5['interaction']['id'],_0x34c0ae['body']?JSON[_0xb49b('0x69')](_0x34c0ae['body']):_0xb49b('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x21e4a5);}return null;})[_0xb49b('0x1f')](function(_0x1130c8){var _0x1bd79b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1130c8['message'][_0xb49b('0x6b')];return db[_0xb49b('0x6c')][_0xb49b('0x3d')](_0x1bd79b,{'type':db['Sequelize'][_0xb49b('0x6d')][_0xb49b('0x6e')],'raw':!![]})[_0xb49b('0x1f')](function(_0x178f72){return _0x178f72;});})[_0xb49b('0x1f')](function(_0x457856){if(_0x457856){_0x21e4a5['message']['contact']=_0x457856[0x0];if(!_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x5f')])return;return db['User'][_0xb49b('0x54')]({'where':{'id':_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x5f')],'role':_0xb49b('0x61')},'attributes':['id',_0xb49b('0x3b'),_0xb49b('0x6f'),_0xb49b('0x70'),_0xb49b('0x71')],'raw':!![]});}return null;})['then'](function(_0x297b2a){if(!_0x297b2a)return null;_0x21e4a5[_0xb49b('0x27')][_0xb49b('0x61')]=_0x297b2a;return _0x21e4a5;})[_0xb49b('0x1f')](function(_0x295213){if(_0x295213){if(_0x34c0ae[_0xb49b('0x56')][_0xb49b('0x72')]){_0x21e4a5[_0xb49b('0x27')][_0xb49b('0x73')]=util[_0xb49b('0x5d')](_0xb49b('0x74'),_0x34c0ae[_0xb49b('0x60')]['name']);_0x21e4a5[_0xb49b('0x27')][_0xb49b('0x75')]=_0x21e4a5[_0xb49b('0x75')];_0x21e4a5[_0xb49b('0x27')][_0xb49b('0x76')]=_0x21e4a5[_0xb49b('0x75')];_0x21e4a5[_0xb49b('0x27')][_0xb49b('0x77')]='accept';return respondWithRpcPromise(_0xb49b('0x78'),_0xb49b('0x78'),{'event':_0xb49b('0x79'),'message':_0x21e4a5[_0xb49b('0x27')]},client9002)[_0xb49b('0x1f')](function(){return _0x21e4a5;});}return _0x21e4a5;}return null;})[_0xb49b('0x1f')](respondWithResult(_0x3cc283,null))[_0xb49b('0x4f')](handleError(_0x3cc283,null));};var interaction_log=require('../../config/logger')(_0xb49b('0x58'));exports['reject']=function(_0x434de8,_0x37e5dd,_0x36f652){var _0x370d61={'agent':{},'channel':_0xb49b('0x5a')};if(_0x434de8[_0xb49b('0x56')]['id']){delete _0x434de8[_0xb49b('0x56')]['id'];}_0x434de8[_0xb49b('0x56')][_0xb49b('0x5f')]=_0x434de8[_0xb49b('0x56')][_0xb49b('0x5f')]||_0x434de8['user']['id'];_0x370d61['agent']['id']=_0x434de8['body'][_0xb49b('0x5f')];return db['WhatsappMessage'][_0xb49b('0x54')]({'where':{'id':_0x434de8['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37e5dd,null))[_0xb49b('0x1f')](function(_0x519104){if(_0x519104){_0x370d61[_0xb49b('0x27')]=_0x519104[_0xb49b('0x62')]({'plain':!![]});return db[_0xb49b('0x63')]['find']({'where':{'id':_0x519104[_0xb49b('0x64')]}});}return null;})[_0xb49b('0x1f')](handleEntityNotFound(_0x37e5dd,null))['then'](function(_0x22feae){if(_0x22feae){_0x370d61[_0xb49b('0x66')]=_0x22feae['get']({'plain':!![]});interaction_log[_0xb49b('0x20')](_0xb49b('0x7a'),_0x434de8[_0xb49b('0x60')]['id'],_0x434de8[_0xb49b('0x60')][_0xb49b('0x3b')],_0x434de8[_0xb49b('0x60')][_0xb49b('0x68')],_0x370d61[_0xb49b('0x66')]['id'],_0x434de8[_0xb49b('0x56')]?JSON[_0xb49b('0x69')](_0x434de8['body']):_0xb49b('0x6a'));return respondWithRpcPromise(_0xb49b('0x7b'),_0xb49b('0x7c'),_0x370d61);}return null;})[_0xb49b('0x1f')](function(_0x3bf19c){var _0x31ca9c=_0xb49b('0x7d')+_0x3bf19c[_0xb49b('0x27')][_0xb49b('0x6b')];return db[_0xb49b('0x6c')][_0xb49b('0x3d')](_0x31ca9c,{'type':db['Sequelize'][_0xb49b('0x6d')][_0xb49b('0x6e')],'raw':!![]})[_0xb49b('0x1f')](function(_0x10045f){return _0x10045f;});})['then'](function(_0x3f28be){if(_0x3f28be){_0x370d61[_0xb49b('0x27')]['contact']=_0x3f28be[0x0];if(!_0x434de8['body']['UserId'])return;return db[_0xb49b('0x7e')][_0xb49b('0x54')]({'where':{'id':_0x434de8[_0xb49b('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xb49b('0x3b'),'fullname',_0xb49b('0x70'),_0xb49b('0x71')],'raw':!![]});}return null;})[_0xb49b('0x1f')](function(_0x3b6bc9){if(!_0x3b6bc9)return null;_0x370d61[_0xb49b('0x27')]['agent']=_0x3b6bc9;return _0x370d61;})[_0xb49b('0x1f')](function(_0x183347){if(_0x183347){_0x183347[_0xb49b('0x27')]['interface']=util[_0xb49b('0x5d')](_0xb49b('0x74'),_0x434de8['user'][_0xb49b('0x3b')]);_0x183347[_0xb49b('0x27')]['channel']=_0x370d61[_0xb49b('0x75')];_0x183347[_0xb49b('0x27')][_0xb49b('0x76')]=_0x370d61[_0xb49b('0x75')];_0x183347[_0xb49b('0x27')][_0xb49b('0x77')]=_0xb49b('0x2f');respondWithRpcPromise(_0xb49b('0x78'),_0xb49b('0x78'),{'event':_0xb49b('0x7f'),'message':_0x183347[_0xb49b('0x27')]},client9002);return _0x370d61;}return null;})[_0xb49b('0x1f')](respondWithResult(_0x37e5dd,null))['catch'](handleError(_0x37e5dd,null));};exports[_0xb49b('0x29')]=function(_0x2130f5,_0xb6ce48,_0x4dc9b4){if(_0x2130f5['body']['id']){delete _0x2130f5[_0xb49b('0x56')]['id'];}var _0xe6a2c8;return db[_0xb49b('0x36')][_0xb49b('0x54')]({'where':{'id':_0x2130f5['params']['id']}})[_0xb49b('0x1f')](handleEntityNotFound(_0xb6ce48,null))['then'](function(_0x5293df){if(_0x5293df){_0xe6a2c8=_0x5293df;return db[_0xb49b('0x80')][_0xb49b('0x54')]({'where':{'id':_0x5293df[_0xb49b('0x81')]}});}})[_0xb49b('0x1f')](handleEntityNotFound(_0xb6ce48,null))[_0xb49b('0x1f')](function(_0x6e44d){if(_0x6e44d){logger[_0xb49b('0x22')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xb49b('0x29'),'received\x20delivery\x20report\x20from',_0x6e44d['type'],util['inspect'](_0x2130f5[_0xb49b('0x56')],{'showHidden':![],'depth':null}));switch(_0x6e44d[_0xb49b('0x38')]){case _0xb49b('0x82'):if(_0x2130f5[_0xb49b('0x56')][_0xb49b('0x83')]&&_0x2130f5[_0xb49b('0x56')][_0xb49b('0x83')]===_0xe6a2c8[_0xb49b('0x84')]&&_0x2130f5[_0xb49b('0x56')][_0xb49b('0x85')]&&_0x2130f5[_0xb49b('0x56')]['MessageStatus']===_0xb49b('0x5b')){return _0xe6a2c8[_0xb49b('0x31')]({'read':!![]});}else{logger[_0xb49b('0x25')](_0xb49b('0x86'),_0xb49b('0x29'),_0xb49b('0x82'),util[_0xb49b('0x87')](_0x2130f5[_0xb49b('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xe6a2c8;}})[_0xb49b('0x1f')](respondWithResult(_0xb6ce48,null))[_0xb49b('0x4f')](handleError(_0xb6ce48,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index e58b3ee..db35a16 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 _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x53fb43,_0x223a27){var _0x35ca6e=function(_0x3a0828){while(--_0x3a0828){_0x53fb43['push'](_0x53fb43['shift']());}};_0x35ca6e(++_0x223a27);}(_0xaaa2,0xac));var _0x2aaa=function(_0x2a2096,_0x2f4bd2){_0x2a2096=_0x2a2096-0x0;var _0x5586ce=_0xaaa2[_0x2a2096];return _0x5586ce;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x6215=['events','../../mysqldb','WhatsappMessage','save','update','remove','hook','exports'];(function(_0x229502,_0x57e0d6){var _0x971753=function(_0x51167b){while(--_0x51167b){_0x229502['push'](_0x229502['shift']());}};_0x971753(++_0x57e0d6);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5621('0x0'));var WhatsappMessage=require(_0x5621('0x1'))['db'][_0x5621('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5621('0x3'),'afterUpdate':_0x5621('0x4'),'afterDestroy':_0x5621('0x5')};function emitEvent(_0x173213){return function(_0x204284,_0x13397a,_0x492c6d){WhatsappMessageEvents['emit'](_0x173213+':'+_0x204284['id'],_0x204284);WhatsappMessageEvents['emit'](_0x173213,_0x204284);_0x492c6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x5621('0x6')](e,emitEvent(event));}}module[_0x5621('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 8e85977..ecbe9b2 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 _0xf781=['WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','info','AC\x20send\x20botId:%s','AC\x20send\x20phoneNbr:%s','baseUrl','Bearer\x20','application/json','AC\x20send\x20data:%s','stringify','AC\x20send\x20postReq:%s','statuses','message_id','log','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','toLowerCase','error','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','phone','whatsapp:','remote','token','update','sid','catch'];(function(_0x19e21e,_0x1e00ca){var _0x145d05=function(_0x158606){while(--_0x158606){_0x19e21e['push'](_0x19e21e['shift']());}};_0x145d05(++_0x1e00ca);}(_0xf781,0xd2));var _0x1f78=function(_0x5be227,_0x42d411){_0x5be227=_0x5be227-0x0;var _0xd9e0e=_0xf781[_0x5be227];return _0xd9e0e;};'use strict';var _=require(_0x1f78('0x0'));var util=require('util');var logger=require(_0x1f78('0x1'))(_0x1f78('0x2'));var moment=require(_0x1f78('0x3'));var BPromise=require(_0x1f78('0x4'));var rp=require(_0x1f78('0x5'));var fs=require('fs');var path=require(_0x1f78('0x6'));var rimraf=require(_0x1f78('0x7'));var config=require(_0x1f78('0x8'));var attributes=require(_0x1f78('0x9'));module[_0x1f78('0xa')]=function(_0x36d7c1,_0x38cfca){return _0x36d7c1[_0x1f78('0xb')](_0x1f78('0xc'),attributes,{'tableName':_0x1f78('0xd'),'paranoid':![],'indexes':[{'name':_0x1f78('0xe'),'fields':[_0x1f78('0xe')]},{'name':_0x1f78('0xf'),'fields':[_0x1f78('0x10')],'type':_0x1f78('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16213b,_0x297a6e,_0x509aa1){var _0x30346b=_0x36d7c1[_0x1f78('0x12')];var _0x476276=_0x16213b['get']({'plain':!![]});if(_0x476276[_0x1f78('0x13')]['toLowerCase']()==='in'||_0x476276[_0x1f78('0x13')]['toLowerCase']()===_0x1f78('0x14')&&!_0x476276[_0x1f78('0x15')]&&!_[_0x1f78('0x16')](_0x476276[_0x1f78('0x17')])){_0x30346b[_0x1f78('0x18')][_0x1f78('0x19')]({'where':{'id':_0x476276[_0x1f78('0x1a')]}})[_0x1f78('0x1b')](function(_0x1bc2da){if(_0x1bc2da){_0x1bc2da['update']({'lastMsgAt':_0x476276['createdAt'],'lastMsgDirection':_0x476276[_0x1f78('0x13')][_0x1f78('0x1c')]()});}})['catch'](function(_0x5beb70){console[_0x1f78('0x1d')](_0x5beb70);});}if(_0x476276['direction']===_0x1f78('0x14')&&!_0x476276[_0x1f78('0x15')]){var _0x51c3ea;_0x30346b[_0x1f78('0x1e')]['find']({'where':{'id':_0x476276[_0x1f78('0x1f')]},'raw':!![]})[_0x1f78('0x1b')](function(_0x4f3c14){_0x51c3ea=_0x4f3c14;if(_0x51c3ea&&_0x51c3ea[_0x1f78('0x20')]){switch(_0x51c3ea['type']){case _0x1f78('0x21'):var _0x4d4826=require(_0x1f78('0x21'));if(_0x51c3ea['accountSid']&&_0x51c3ea[_0x1f78('0x22')]&&_0x51c3ea[_0x1f78('0x23')]){var _0x50c595=new _0x4d4826(_0x51c3ea['accountSid'],_0x51c3ea[_0x1f78('0x22')]);_0x50c595['messages']['create']({'body':_0x476276['body'],'to':_0x1f78('0x24')+_0x476276['phone'],'from':_0x1f78('0x24')+_0x51c3ea[_0x1f78('0x23')],'statusCallback':_0x51c3ea[_0x1f78('0x25')]+'/api/whatsapp/messages/'+_0x476276['id']+'/status?token='+_0x51c3ea[_0x1f78('0x26')]})['then'](function(_0x116da8){if(_0x116da8['sid']){return _0x16213b[_0x1f78('0x27')]({'messageId':_0x116da8[_0x1f78('0x28')]});}})[_0x1f78('0x29')](function(_0x110788){logger[_0x1f78('0x1d')](_0x1f78('0x2a'),'afterCreate','twilio',util[_0x1f78('0x2b')](_0x110788,{'showHidden':![],'depth':null}));});}else{logger[_0x1f78('0x1d')](_0x1f78('0x2a'),_0x1f78('0x2c'),_0x1f78('0x21'),_0x1f78('0x2d'));}break;case _0x1f78('0x2e'):var _0x53225b=_0x51c3ea[_0x1f78('0x2f')];var _0x148d0f=_0x51c3ea[_0x1f78('0x23')];var _0x1be105=_0x51c3ea['authToken'];logger[_0x1f78('0x30')](_0x1f78('0x31'),_0x53225b);logger[_0x1f78('0x30')](_0x1f78('0x32'),_0x148d0f);logger[_0x1f78('0x30')]('AC\x20send\x20bearerToken:%s',_0x1be105);var _0x1aa8d3=_0x51c3ea[_0x1f78('0x33')]+'/whatsapp/v1/'+_0x53225b+'/messages/';var _0x57e212={'to':[_0x148d0f],'message':{'type':'text','text':_0x476276[_0x1f78('0x10')]}};var _0x3607a3={'method':'POST','uri':_0x1aa8d3,'headers':{'Authorization':_0x1f78('0x34')+_0x1be105,'Content-Type':_0x1f78('0x35')},'body':JSON['stringify'](_0x57e212),'json':!![]};logger[_0x1f78('0x30')](_0x1f78('0x36'),JSON[_0x1f78('0x37')](_0x57e212));logger[_0x1f78('0x30')](_0x1f78('0x38'),JSON[_0x1f78('0x37')](_0x3607a3));rp(_0x3607a3)['then'](function(_0x354588){if(_0x354588[_0x1f78('0x39')][0x0][_0x1f78('0x3a')]){return _0x16213b[_0x1f78('0x27')]({'messageId':_0x354588[_0x1f78('0x39')][0x0][_0x1f78('0x3a')]});}})['then'](function(_0xf8dab6){console[_0x1f78('0x3b')](_0xf8dab6);})[_0x1f78('0x29')](function(_0x2de82b){console[_0x1f78('0x3b')](_0x2de82b);});break;}}})[_0x1f78('0x3c')](function(){_0x509aa1();});}else{_0x509aa1();}}},'charset':_0x1f78('0x3d'),'collate':_0x1f78('0x3e')});}; \ No newline at end of file +var _0xc492=['update','createdAt','catch','error','WhatsappAccount','find','type','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','info','AC\x20send\x20botId:%s','AC\x20send\x20phoneNbr:%s','AC\x20send\x20bearerToken:%s','/whatsapp/v1/','text','AC\x20send\x20data\x20json:%s','stringify','POST','Bearer\x20','application/json','AC\x20send\x20data:%s','statuses','message_id','log','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then'];(function(_0x324c63,_0x5db0d4){var _0xeb9f50=function(_0x44a435){while(--_0x44a435){_0x324c63['push'](_0x324c63['shift']());}};_0xeb9f50(++_0x5db0d4);}(_0xc492,0xd7));var _0x2c49=function(_0x590d74,_0x19966a){_0x590d74=_0x590d74-0x0;var _0x23814d=_0xc492[_0x590d74];return _0x23814d;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var logger=require(_0x2c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var attributes=require('./whatsappMessage.attributes');module[_0x2c49('0x6')]=function(_0x499c4e,_0x3ad911){return _0x499c4e[_0x2c49('0x7')]('WhatsappMessage',attributes,{'tableName':_0x2c49('0x8'),'paranoid':![],'indexes':[{'name':_0x2c49('0x9'),'fields':[_0x2c49('0x9')]},{'name':_0x2c49('0xa'),'fields':[_0x2c49('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d3e2a,_0x4f64f2,_0x493cd2){var _0x4a6340=_0x499c4e['models'];var _0x39cc64=_0x3d3e2a['get']({'plain':!![]});if(_0x39cc64[_0x2c49('0xc')][_0x2c49('0xd')]()==='in'||_0x39cc64['direction'][_0x2c49('0xd')]()===_0x2c49('0xe')&&!_0x39cc64[_0x2c49('0xf')]&&!_[_0x2c49('0x10')](_0x39cc64[_0x2c49('0x11')])){_0x4a6340[_0x2c49('0x12')]['findOne']({'where':{'id':_0x39cc64[_0x2c49('0x13')]}})[_0x2c49('0x14')](function(_0x2eeb10){if(_0x2eeb10){_0x2eeb10[_0x2c49('0x15')]({'lastMsgAt':_0x39cc64[_0x2c49('0x16')],'lastMsgDirection':_0x39cc64['direction'][_0x2c49('0xd')]()});}})[_0x2c49('0x17')](function(_0x30da01){console[_0x2c49('0x18')](_0x30da01);});}if(_0x39cc64[_0x2c49('0xc')]===_0x2c49('0xe')&&!_0x39cc64[_0x2c49('0xf')]){var _0x2e2e07;_0x4a6340[_0x2c49('0x19')][_0x2c49('0x1a')]({'where':{'id':_0x39cc64['WhatsappAccountId']},'raw':!![]})[_0x2c49('0x14')](function(_0x3fe920){_0x2e2e07=_0x3fe920;if(_0x2e2e07&&_0x2e2e07[_0x2c49('0x1b')]){switch(_0x2e2e07[_0x2c49('0x1b')]){case'twilio':var _0x1392dc=require('twilio');if(_0x2e2e07[_0x2c49('0x1c')]&&_0x2e2e07[_0x2c49('0x1d')]&&_0x2e2e07['phone']){var _0x4b8f61=new _0x1392dc(_0x2e2e07[_0x2c49('0x1c')],_0x2e2e07[_0x2c49('0x1d')]);_0x4b8f61[_0x2c49('0x1e')][_0x2c49('0x1f')]({'body':_0x39cc64[_0x2c49('0xb')],'to':_0x2c49('0x20')+_0x39cc64[_0x2c49('0x21')],'from':_0x2c49('0x20')+_0x2e2e07[_0x2c49('0x21')],'statusCallback':_0x2e2e07['remote']+_0x2c49('0x22')+_0x39cc64['id']+_0x2c49('0x23')+_0x2e2e07[_0x2c49('0x24')]})[_0x2c49('0x14')](function(_0x4a913c){if(_0x4a913c[_0x2c49('0x25')]){return _0x3d3e2a[_0x2c49('0x15')]({'messageId':_0x4a913c[_0x2c49('0x25')]});}})[_0x2c49('0x17')](function(_0x59c061){logger[_0x2c49('0x18')](_0x2c49('0x26'),_0x2c49('0x27'),'twilio',util[_0x2c49('0x28')](_0x59c061,{'showHidden':![],'depth':null}));});}else{logger[_0x2c49('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2c49('0x27'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2c49('0x29'):var _0x4d2564=_0x2e2e07[_0x2c49('0x1c')];var _0x4d9334=_0x2e2e07[_0x2c49('0x21')];var _0x7b8d75=_0x2e2e07[_0x2c49('0x1d')];logger[_0x2c49('0x2a')](_0x2c49('0x2b'),_0x4d2564);logger[_0x2c49('0x2a')](_0x2c49('0x2c'),_0x4d9334);logger[_0x2c49('0x2a')](_0x2c49('0x2d'),_0x7b8d75);var _0x42c4fb=_0x2e2e07['baseUrl']+_0x2c49('0x2e')+_0x4d2564+'/messages/';var _0x20ebca={'to':[_0x4d9334],'message':{'type':_0x2c49('0x2f'),'text':_0x39cc64[_0x2c49('0xb')]}};logger[_0x2c49('0x2a')](_0x2c49('0x30'),JSON[_0x2c49('0x31')](_0x20ebca));var _0x397ce9={'method':_0x2c49('0x32'),'uri':_0x42c4fb,'headers':{'Authorization':_0x2c49('0x33')+_0x7b8d75,'Content-Type':_0x2c49('0x34')},'body':JSON[_0x2c49('0x31')](_0x20ebca),'json':!![]};logger[_0x2c49('0x2a')](_0x2c49('0x35'),JSON[_0x2c49('0x31')](_0x20ebca));logger['info']('AC\x20send\x20postReq:%s',JSON[_0x2c49('0x31')](_0x397ce9));rp(_0x397ce9)[_0x2c49('0x14')](function(_0x50d457){if(_0x50d457[_0x2c49('0x36')][0x0][_0x2c49('0x37')]){return _0x3d3e2a[_0x2c49('0x15')]({'messageId':_0x50d457[_0x2c49('0x36')][0x0][_0x2c49('0x37')]});}})[_0x2c49('0x14')](function(_0xd5ca54){console[_0x2c49('0x38')](_0xd5ca54);})['catch'](function(_0x2cbddb){console[_0x2c49('0x38')](_0x2cbddb);});break;}}})['finally'](function(){_0x493cd2();});}else{_0x493cd2();}}},'charset':_0x2c49('0x39'),'collate':_0x2c49('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1eb40aa..310268c 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 _0x9bab=['debug','stringify','error','message','result','catch','body','options','raw','then','moment','randomstring','../../config/utils','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2e0584,_0x264d0f){var _0x4a1435=function(_0x92e7c4){while(--_0x92e7c4){_0x2e0584['push'](_0x2e0584['shift']());}};_0x4a1435(++_0x264d0f);}(_0x9bab,0x6a));var _0xb9ba=function(_0x58640f,_0x3b5b9c){_0x58640f=_0x58640f-0x0;var _0x2cc0f5=_0x9bab[_0x58640f];return _0x2cc0f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb9ba('0x0'));var BPromise=require('bluebird');var rs=require(_0xb9ba('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb9ba('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xb9ba('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xb9ba('0x4')][_0xb9ba('0x5')]({'port':0x232a});config['redis']=_[_0xb9ba('0x6')](config[_0xb9ba('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9ba('0x8'))(new Redis(config[_0xb9ba('0x7')]));require('./whatsappMessage.socket')[_0xb9ba('0x9')](socket);function respondWithRpcPromise(_0xfe7c49,_0x1faf87,_0xa71d95){return new BPromise(function(_0xf1fec4,_0x24bc6d){return client[_0xb9ba('0xa')](_0xfe7c49,_0xa71d95)['then'](function(_0x113160){logger[_0xb9ba('0xb')](_0xb9ba('0xc'),_0x1faf87,_0xb9ba('0xd'));logger[_0xb9ba('0xe')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1faf87,_0xb9ba('0xd'),JSON[_0xb9ba('0xf')](_0x113160));if(_0x113160[_0xb9ba('0x10')]){if(_0x113160[_0xb9ba('0x10')]['code']===0x1f4){logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);return _0x24bc6d(_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);}logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);return _0xf1fec4(_0x113160[_0xb9ba('0x10')][_0xb9ba('0x11')]);}else{logger[_0xb9ba('0xb')](_0xb9ba('0xc'),_0x1faf87,_0xb9ba('0xd'));_0xf1fec4(_0x113160[_0xb9ba('0x12')]['message']);}})[_0xb9ba('0x13')](function(_0x51db0c){logger[_0xb9ba('0x10')](_0xb9ba('0xc'),_0x1faf87,_0x51db0c);_0x24bc6d(_0x51db0c);});});}exports['CreateWhatsappMessage']=function(_0x5adc55){var _0x17e56e=this;return new Promise(function(_0x11098f,_0x39c8e8){return db['WhatsappMessage']['create'](_0x5adc55[_0xb9ba('0x14')],{'raw':_0x5adc55[_0xb9ba('0x15')]?_0x5adc55[_0xb9ba('0x15')][_0xb9ba('0x16')]===undefined?!![]:![]:!![]})[_0xb9ba('0x17')](function(_0x5b3f55){logger[_0xb9ba('0xb')]('CreateWhatsappMessage',_0x5adc55);logger[_0xb9ba('0xe')]('CreateWhatsappMessage',_0x5adc55,JSON[_0xb9ba('0xf')](_0x5b3f55));_0x11098f(_0x5b3f55);})[_0xb9ba('0x13')](function(_0x1b5616){logger[_0xb9ba('0x10')]('CreateWhatsappMessage',_0x1b5616[_0xb9ba('0x11')],_0x5adc55);_0x39c8e8(_0x17e56e[_0xb9ba('0x10')](0x1f4,_0x1b5616[_0xb9ba('0x11')]));});});}; \ No newline at end of file +var _0x4392=['message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2fe6e5,_0x10062e){var _0x5292bc=function(_0x48cbfd){while(--_0x48cbfd){_0x2fe6e5['push'](_0x2fe6e5['shift']());}};_0x5292bc(++_0x10062e);}(_0x4392,0x133));var _0x2439=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x4392[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x2439('0x0'));var util=require(_0x2439('0x1'));var moment=require(_0x2439('0x2'));var BPromise=require(_0x2439('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2439('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2439('0x5'));var logger=require(_0x2439('0x6'))('rpc');var config=require(_0x2439('0x7'));var jayson=require(_0x2439('0x8'));var client=jayson['client'][_0x2439('0x9')]({'port':0x232a});config[_0x2439('0xa')]=_[_0x2439('0xb')](config[_0x2439('0xa')],{'host':_0x2439('0xc'),'port':0x18eb});var socket=require(_0x2439('0xd'))(new Redis(config[_0x2439('0xa')]));require(_0x2439('0xe'))[_0x2439('0xf')](socket);function respondWithRpcPromise(_0x5dfccc,_0x184fea,_0x55767f){return new BPromise(function(_0x26dab3,_0x2b820d){return client['request'](_0x5dfccc,_0x55767f)[_0x2439('0x10')](function(_0x4f3fc7){logger['info'](_0x2439('0x11'),_0x184fea,_0x2439('0x12'));logger[_0x2439('0x13')](_0x2439('0x14'),_0x184fea,_0x2439('0x12'),JSON['stringify'](_0x4f3fc7));if(_0x4f3fc7[_0x2439('0x15')]){if(_0x4f3fc7['error'][_0x2439('0x16')]===0x1f4){logger[_0x2439('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x184fea,_0x4f3fc7['error'][_0x2439('0x17')]);return _0x2b820d(_0x4f3fc7[_0x2439('0x15')][_0x2439('0x17')]);}logger[_0x2439('0x15')](_0x2439('0x11'),_0x184fea,_0x4f3fc7[_0x2439('0x15')][_0x2439('0x17')]);return _0x26dab3(_0x4f3fc7[_0x2439('0x15')][_0x2439('0x17')]);}else{logger[_0x2439('0x18')](_0x2439('0x11'),_0x184fea,'request\x20sent');_0x26dab3(_0x4f3fc7['result']['message']);}})[_0x2439('0x19')](function(_0x712639){logger['error'](_0x2439('0x11'),_0x184fea,_0x712639);_0x2b820d(_0x712639);});});}exports[_0x2439('0x1a')]=function(_0x338468){var _0x1d76cf=this;return new Promise(function(_0xebf299,_0x1d9a52){return db[_0x2439('0x1b')][_0x2439('0x1c')](_0x338468[_0x2439('0x1d')],{'raw':_0x338468['options']?_0x338468[_0x2439('0x1e')][_0x2439('0x1f')]===undefined?!![]:![]:!![]})[_0x2439('0x10')](function(_0x58eeba){logger[_0x2439('0x18')](_0x2439('0x1a'),_0x338468);logger['debug'](_0x2439('0x1a'),_0x338468,JSON[_0x2439('0x20')](_0x58eeba));_0xebf299(_0x58eeba);})[_0x2439('0x19')](function(_0x16dcd8){logger[_0x2439('0x15')]('CreateWhatsappMessage',_0x16dcd8[_0x2439('0x17')],_0x338468);_0x1d9a52(_0x1d76cf[_0x2439('0x15')](0x1f4,_0x16dcd8[_0x2439('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d447eef..f474bf2 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 _0xf41c=['register','length','whatsappMessage:','remove','update','emit','removeListener'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0xf41c,0x1d8));var _0xcf41=function(_0xf9111a,_0x2f9391){_0xf9111a=_0xf9111a-0x0;var _0x175a0c=_0xf41c[_0xf9111a];return _0x175a0c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xcf41('0x0'),_0xcf41('0x1')];function createListener(_0x15af0e,_0xaf7a77){return function(_0x2da7aa){_0xaf7a77[_0xcf41('0x2')](_0x15af0e,_0x2da7aa);};}function removeListener(_0x216d50,_0x333f1e){return function(){WhatsappMessageEvents[_0xcf41('0x3')](_0x216d50,_0x333f1e);};}exports[_0xcf41('0x4')]=function(_0x24730e){for(var _0x3d40c7=0x0,_0x50692b=events[_0xcf41('0x5')];_0x3d40c7<_0x50692b;_0x3d40c7++){var _0x5b58d5=events[_0x3d40c7];var _0x5c2211=createListener(_0xcf41('0x6')+_0x5b58d5,_0x24730e);WhatsappMessageEvents['on'](_0x5b58d5,_0x5c2211);}}; \ No newline at end of file +var _0xc676=['register','length','./whatsappMessage.events','remove','emit'];(function(_0x9c3b6b,_0x2594d2){var _0x3f00ac=function(_0x2973f6){while(--_0x2973f6){_0x9c3b6b['push'](_0x9c3b6b['shift']());}};_0x3f00ac(++_0x2594d2);}(_0xc676,0x75));var _0x6c67=function(_0x4d55e8,_0x428769){_0x4d55e8=_0x4d55e8-0x0;var _0x29c0e6=_0xc676[_0x4d55e8];return _0x29c0e6;};'use strict';var WhatsappMessageEvents=require(_0x6c67('0x0'));var events=['save',_0x6c67('0x1'),'update'];function createListener(_0x3b3124,_0x1744c0){return function(_0x2b4b3c){_0x1744c0[_0x6c67('0x2')](_0x3b3124,_0x2b4b3c);};}function removeListener(_0x2e745a,_0x5a94a8){return function(){WhatsappMessageEvents['removeListener'](_0x2e745a,_0x5a94a8);};}exports[_0x6c67('0x3')]=function(_0xc6417){for(var _0x5d0d29=0x0,_0x1c8fb9=events[_0x6c67('0x4')];_0x5d0d29<_0x1c8fb9;_0x5d0d29++){var _0x3f37e=events[_0x5d0d29];var _0x519393=createListener('whatsappMessage:'+_0x3f37e,_0xc6417);WhatsappMessageEvents['on'](_0x3f37e,_0x519393);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 181ab99..b810670 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 _0x3ac6=['index','describe','/:id','show','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','put','update','destroy','removeTeams','delete','/:id/users','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3979e1,_0x584112){var _0x25d794=function(_0x4cc875){while(--_0x4cc875){_0x3979e1['push'](_0x3979e1['shift']());}};_0x25d794(++_0x584112);}(_0x3ac6,0x11f));var _0x63ac=function(_0x440bd6,_0x26bfd0){_0x440bd6=_0x440bd6-0x0;var _0x2f004a=_0x3ac6[_0x440bd6];return _0x2f004a;};'use strict';var multer=require(_0x63ac('0x0'));var util=require('util');var path=require(_0x63ac('0x1'));var timeout=require(_0x63ac('0x2'));var express=require(_0x63ac('0x3'));var router=express[_0x63ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x63ac('0x5'));var interaction=require(_0x63ac('0x6'));var config=require(_0x63ac('0x7'));var controller=require('./whatsappQueue.controller');router[_0x63ac('0x8')]('/',auth[_0x63ac('0x9')](),controller[_0x63ac('0xa')]);router[_0x63ac('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x63ac('0xb')]);router[_0x63ac('0x8')](_0x63ac('0xc'),auth[_0x63ac('0x9')](),controller[_0x63ac('0xd')]);router[_0x63ac('0x8')]('/:id/members',auth[_0x63ac('0x9')](),controller[_0x63ac('0xe')]);router[_0x63ac('0x8')]('/:id/teams',auth[_0x63ac('0x9')](),controller[_0x63ac('0xf')]);router['get']('/:id/users',auth[_0x63ac('0x9')](),controller[_0x63ac('0x10')]);router[_0x63ac('0x11')]('/',auth[_0x63ac('0x9')](),controller['create']);router[_0x63ac('0x11')](_0x63ac('0x12'),auth[_0x63ac('0x9')](),controller[_0x63ac('0x13')]);router[_0x63ac('0x11')]('/:id/users',auth[_0x63ac('0x9')](),controller['addAgents']);router[_0x63ac('0x14')]('/:id',auth[_0x63ac('0x9')](),controller[_0x63ac('0x15')]);router['delete'](_0x63ac('0xc'),auth['isAuthenticated'](),controller[_0x63ac('0x16')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x63ac('0x17')]);router[_0x63ac('0x18')](_0x63ac('0x19'),auth[_0x63ac('0x9')](),controller[_0x63ac('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb6ef=['addAgents','delete','destroy','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6ef,0x65));var _0xfb6e=function(_0x24b911,_0x5cc69c){_0x24b911=_0x24b911-0x0;var _0xe7e9e2=_0xb6ef[_0x24b911];return _0xe7e9e2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfb6e('0x0'));var express=require(_0xfb6e('0x1'));var router=express[_0xfb6e('0x2')]();var fs_extra=require(_0xfb6e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb6e('0x4'));var controller=require(_0xfb6e('0x5'));router['get']('/',auth[_0xfb6e('0x6')](),controller['index']);router[_0xfb6e('0x7')](_0xfb6e('0x8'),auth[_0xfb6e('0x6')](),controller['describe']);router[_0xfb6e('0x7')](_0xfb6e('0x9'),auth['isAuthenticated'](),controller[_0xfb6e('0xa')]);router['get'](_0xfb6e('0xb'),auth[_0xfb6e('0x6')](),controller[_0xfb6e('0xc')]);router[_0xfb6e('0x7')](_0xfb6e('0xd'),auth[_0xfb6e('0x6')](),controller[_0xfb6e('0xe')]);router[_0xfb6e('0x7')](_0xfb6e('0xf'),auth[_0xfb6e('0x6')](),controller['getAgents']);router['post']('/',auth[_0xfb6e('0x6')](),controller[_0xfb6e('0x10')]);router[_0xfb6e('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0xfb6e('0x12')]);router[_0xfb6e('0x11')]('/:id/users',auth[_0xfb6e('0x6')](),controller[_0xfb6e('0x13')]);router['put'](_0xfb6e('0x9'),auth[_0xfb6e('0x6')](),controller['update']);router[_0xfb6e('0x14')](_0xfb6e('0x9'),auth[_0xfb6e('0x6')](),controller[_0xfb6e('0x15')]);router['delete'](_0xfb6e('0xd'),auth[_0xfb6e('0x6')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xfb6e('0x6')](),controller[_0xfb6e('0x16')]);module[_0xfb6e('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 21960da..0d23df4 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 _0x3189=['sequelize','exports','name','INTEGER','ENUM','beepall'];(function(_0x41f4a0,_0x59e659){var _0x395b4c=function(_0x29cbcf){while(--_0x29cbcf){_0x41f4a0['push'](_0x41f4a0['shift']());}};_0x395b4c(++_0x59e659);}(_0x3189,0xae));var _0x9318=function(_0x5649a3,_0x15e286){_0x5649a3=_0x5649a3-0x0;var _0x2b3f10=_0x3189[_0x5649a3];return _0x2b3f10;};'use strict';var Sequelize=require(_0x9318('0x0'));module[_0x9318('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9318('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9318('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9318('0x4')]('rrmemory',_0x9318('0x5'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8696=['STRING','sequelize','exports','name','ENUM','rrmemory','beepall'];(function(_0x456093,_0x1e5380){var _0x297e7b=function(_0x451ee0){while(--_0x451ee0){_0x456093['push'](_0x456093['shift']());}};_0x297e7b(++_0x1e5380);}(_0x8696,0x143));var _0x6869=function(_0x4064c3,_0x564d09){_0x4064c3=_0x4064c3-0x0;var _0x317cfa=_0x8696[_0x4064c3];return _0x317cfa;};'use strict';var Sequelize=require(_0x6869('0x0'));module[_0x6869('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6869('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6869('0x3')](_0x6869('0x4'),_0x6869('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x6869('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index fb2922f..e0a8881 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 _0xea7e=['request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappQueue.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','UserId','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','findOne','getTeams','ids','Team','User','Agents','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','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','toString','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir'];(function(_0x3644ef,_0x40ea00){var _0x223ed4=function(_0x274cc3){while(--_0x274cc3){_0x3644ef['push'](_0x3644ef['shift']());}};_0x223ed4(++_0x40ea00);}(_0xea7e,0x119));var _0xeea7=function(_0x58b342,_0x4977f2){_0x58b342=_0x58b342-0x0;var _0x12573a=_0xea7e[_0x58b342];return _0x12573a;};'use strict';var emlformat=require(_0xeea7('0x0'));var rimraf=require(_0xeea7('0x1'));var zipdir=require(_0xeea7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeea7('0x3'));var moment=require(_0xeea7('0x4'));var BPromise=require(_0xeea7('0x5'));var Mustache=require(_0xeea7('0x6'));var util=require(_0xeea7('0x7'));var path=require(_0xeea7('0x8'));var sox=require(_0xeea7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeea7('0xa'));var squel=require(_0xeea7('0xb'));var crypto=require('crypto');var jsforce=require(_0xeea7('0xc'));var deskjs=require(_0xeea7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeea7('0xe'));var Papa=require(_0xeea7('0xf'));var Redis=require(_0xeea7('0x10'));var authService=require(_0xeea7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeea7('0x12'));var logger=require(_0xeea7('0x13'))(_0xeea7('0x14'));var utils=require(_0xeea7('0x15'));var config=require(_0xeea7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xeea7('0x17'))['db'];config[_0xeea7('0x18')]=_['defaults'](config[_0xeea7('0x18')],{'host':_0xeea7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeea7('0x18')]));require(_0xeea7('0x1a'))['register'](socket);function respondWithStatusCode(_0x370d13,_0x63db97){_0x63db97=_0x63db97||0xcc;return function(_0x44d167){if(_0x44d167){return _0x370d13['sendStatus'](_0x63db97);}return _0x370d13[_0xeea7('0x1b')](_0x63db97)[_0xeea7('0x1c')]();};}function respondWithResult(_0x433df8,_0x101feb){_0x101feb=_0x101feb||0xc8;return function(_0x73a994){if(_0x73a994){return _0x433df8[_0xeea7('0x1b')](_0x101feb)['json'](_0x73a994);}};}function respondWithFilteredResult(_0x386380,_0x2f9b1a){return function(_0x2fa1ca){if(_0x2fa1ca){var _0x1522cc=typeof _0x2f9b1a['offset']===_0xeea7('0x1d')&&typeof _0x2f9b1a[_0xeea7('0x1e')]===_0xeea7('0x1d');var _0x487fb2=_0x2fa1ca[_0xeea7('0x1f')];var _0x5c8671=_0x1522cc?0x0:_0x2f9b1a[_0xeea7('0x20')];var _0x316130=_0x1522cc?_0x2fa1ca[_0xeea7('0x1f')]:_0x2f9b1a[_0xeea7('0x20')]+_0x2f9b1a[_0xeea7('0x1e')];var _0x5574e2;if(_0x316130>=_0x487fb2){_0x316130=_0x487fb2;_0x5574e2=0xc8;}else{_0x5574e2=0xce;}_0x386380[_0xeea7('0x1b')](_0x5574e2);return _0x386380[_0xeea7('0x21')](_0xeea7('0x22'),_0x5c8671+'-'+_0x316130+'/'+_0x487fb2)[_0xeea7('0x23')](_0x2fa1ca);}return null;};}function patchUpdates(_0x1e825d){return function(_0xf104a5){try{jsonpatch[_0xeea7('0x24')](_0xf104a5,_0x1e825d,!![]);}catch(_0xf872e2){return BPromise[_0xeea7('0x25')](_0xf872e2);}return _0xf104a5[_0xeea7('0x26')]();};}function saveUpdates(_0x2c5f93,_0x31a248){return function(_0x12a0e5){if(_0x12a0e5){return _0x12a0e5[_0xeea7('0x27')](_0x2c5f93)[_0xeea7('0x28')](function(_0x2f55e2){return _0x2f55e2;});}return null;};}function removeEntity(_0x47a258,_0x40eb61){return function(_0x3e8f50){if(_0x3e8f50){return _0x3e8f50[_0xeea7('0x29')]()[_0xeea7('0x28')](function(){var _0x4a196b=_0x3e8f50[_0xeea7('0x2a')]({'plain':!![]});var _0x1bd101=_0xeea7('0x2b');return db[_0xeea7('0x2c')][_0xeea7('0x29')]({'where':{'type':_0x1bd101,'resourceId':_0x4a196b['id']}})[_0xeea7('0x28')](function(){return _0x3e8f50;});})[_0xeea7('0x28')](function(){_0x47a258['status'](0xcc)[_0xeea7('0x1c')]();});}};}function handleEntityNotFound(_0x371ee9,_0xaf2077){return function(_0x27f538){if(!_0x27f538){_0x371ee9[_0xeea7('0x2d')](0x194);}return _0x27f538;};}function handleError(_0x2a5064,_0x29048c){_0x29048c=_0x29048c||0x1f4;return function(_0x1df00c){logger[_0xeea7('0x2e')](_0x1df00c[_0xeea7('0x2f')]);if(_0x1df00c[_0xeea7('0x30')]){delete _0x1df00c['name'];}_0x2a5064[_0xeea7('0x1b')](_0x29048c)[_0xeea7('0x31')](_0x1df00c);};}exports[_0xeea7('0x32')]=function(_0x1cc8ce,_0x2af5eb){var _0x541f55={},_0x25a7f7={},_0x224c16={'count':0x0,'rows':[]};var _0x4d8757=_[_0xeea7('0x33')](db[_0xeea7('0x34')][_0xeea7('0x35')],function(_0x4f06ef){return{'name':_0x4f06ef[_0xeea7('0x36')],'type':_0x4f06ef[_0xeea7('0x37')]['key']};});_0x25a7f7[_0xeea7('0x38')]=_['map'](_0x4d8757,_0xeea7('0x30'));_0x25a7f7['query']=_['keys'](_0x1cc8ce['query']);_0x25a7f7[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x25a7f7[_0xeea7('0x38')],_0x25a7f7[_0xeea7('0x3b')]);_0x541f55[_0xeea7('0x3c')]=_['intersection'](_0x25a7f7[_0xeea7('0x38')],qs[_0xeea7('0x3d')](_0x1cc8ce[_0xeea7('0x3b')]['fields']));_0x541f55[_0xeea7('0x3c')]=_0x541f55[_0xeea7('0x3c')]['length']?_0x541f55[_0xeea7('0x3c')]:_0x25a7f7[_0xeea7('0x38')];if(!_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x541f55[_0xeea7('0x1e')]=qs[_0xeea7('0x1e')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x541f55['offset']=qs[_0xeea7('0x20')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x20')]);}_0x541f55[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x541f55[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_[_0xeea7('0x43')](_0x1cc8ce[_0xeea7('0x3b')],_0x25a7f7[_0xeea7('0x39')]),_0x4d8757);if(_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x44')]){_0x541f55[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x541f55[_0xeea7('0x42')],{'$or':_[_0xeea7('0x33')](_0x4d8757,function(_0x4ca18e){if(_0x4ca18e[_0xeea7('0x37')]!=='VIRTUAL'){var _0x32ccd2={};_0x32ccd2[_0x4ca18e[_0xeea7('0x30')]]={'$like':'%'+_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x32ccd2;}})});}_0x541f55=_[_0xeea7('0x45')]({},_0x541f55,_0x1cc8ce[_0xeea7('0x46')]);var _0x2cb38b={'where':_0x541f55[_0xeea7('0x42')]};return db['WhatsappQueue'][_0xeea7('0x1f')](_0x2cb38b)['then'](function(_0x599037){_0x224c16[_0xeea7('0x1f')]=_0x599037;if(_0x1cc8ce[_0xeea7('0x3b')][_0xeea7('0x47')]){_0x541f55[_0xeea7('0x48')]=[{'all':!![]}];}return db[_0xeea7('0x34')][_0xeea7('0x49')](_0x541f55);})[_0xeea7('0x28')](function(_0x231d08){_0x224c16[_0xeea7('0x4a')]=_0x231d08;return _0x224c16;})['then'](respondWithFilteredResult(_0x2af5eb,_0x541f55))[_0xeea7('0x4b')](handleError(_0x2af5eb,null));};exports[_0xeea7('0x4c')]=function(_0x1feb2c,_0x2b1b27){var _0x45b864={'raw':!![],'where':{'id':_0x1feb2c[_0xeea7('0x4d')]['id']}},_0x290310={};_0x290310['model']=_[_0xeea7('0x4e')](db['WhatsappQueue'][_0xeea7('0x35')]);_0x290310['query']=_[_0xeea7('0x4e')](_0x1feb2c[_0xeea7('0x3b')]);_0x290310[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x290310[_0xeea7('0x38')],_0x290310[_0xeea7('0x3b')]);_0x45b864[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x290310[_0xeea7('0x38')],qs['fields'](_0x1feb2c[_0xeea7('0x3b')][_0xeea7('0x3d')]));_0x45b864[_0xeea7('0x3c')]=_0x45b864[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x45b864[_0xeea7('0x3c')]:_0x290310[_0xeea7('0x38')];if(_0x1feb2c[_0xeea7('0x3b')][_0xeea7('0x47')]){_0x45b864[_0xeea7('0x48')]=[{'all':!![]}];}_0x45b864=_['merge']({},_0x45b864,_0x1feb2c[_0xeea7('0x46')]);return db[_0xeea7('0x34')][_0xeea7('0x50')](_0x45b864)['then'](handleEntityNotFound(_0x2b1b27,null))[_0xeea7('0x28')](respondWithResult(_0x2b1b27,null))[_0xeea7('0x4b')](handleError(_0x2b1b27,null));};exports[_0xeea7('0x51')]=function(_0x3ebbaf,_0x4f43c4){return db[_0xeea7('0x34')][_0xeea7('0x51')](_0x3ebbaf[_0xeea7('0x52')],{})[_0xeea7('0x28')](function(_0x4949b7){var _0x1aaa21=_0x3ebbaf[_0xeea7('0x53')][_0xeea7('0x2a')]({'plain':!![]});if(!_0x1aaa21)throw new Error(_0xeea7('0x54'));if(_0x1aaa21['role']===_0xeea7('0x53')){var _0x23d3bc=_0x4949b7[_0xeea7('0x2a')]({'plain':!![]});var _0x2f530d=_0xeea7('0x2b');return db[_0xeea7('0x55')][_0xeea7('0x50')]({'where':{'name':_0x2f530d,'userProfileId':_0x1aaa21[_0xeea7('0x56')]},'raw':!![]})['then'](function(_0x5239a1){if(_0x5239a1&&_0x5239a1['autoAssociation']===0x0){return db[_0xeea7('0x2c')][_0xeea7('0x51')]({'name':_0x23d3bc[_0xeea7('0x30')],'resourceId':_0x23d3bc['id'],'type':_0x5239a1[_0xeea7('0x30')],'sectionId':_0x5239a1['id']},{})[_0xeea7('0x28')](function(){return _0x4949b7;});}else{return _0x4949b7;}})[_0xeea7('0x4b')](function(_0x30807e){logger[_0xeea7('0x2e')](_0xeea7('0x57'),_0x30807e);throw _0x30807e;});}return _0x4949b7;})['then'](respondWithResult(_0x4f43c4,0xc9))[_0xeea7('0x4b')](handleError(_0x4f43c4,null));};exports[_0xeea7('0x27')]=function(_0x34c0d4,_0x62e400){if(_0x34c0d4[_0xeea7('0x52')]['id']){delete _0x34c0d4[_0xeea7('0x52')]['id'];}return db['WhatsappQueue'][_0xeea7('0x50')]({'where':{'id':_0x34c0d4[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x62e400,null))[_0xeea7('0x28')](saveUpdates(_0x34c0d4['body'],null))[_0xeea7('0x28')](respondWithResult(_0x62e400,null))[_0xeea7('0x4b')](handleError(_0x62e400,null));};exports[_0xeea7('0x29')]=function(_0x2c9bbe,_0x2d71d3){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x2c9bbe['params']['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x2d71d3,null))[_0xeea7('0x28')](removeEntity(_0x2d71d3,null))[_0xeea7('0x4b')](handleError(_0x2d71d3,null));};exports['describe']=function(_0x1fb4b6,_0x2e8c25){return db[_0xeea7('0x34')][_0xeea7('0x58')]()[_0xeea7('0x28')](respondWithResult(_0x2e8c25,null))[_0xeea7('0x4b')](handleError(_0x2e8c25,null));};exports[_0xeea7('0x59')]=function(_0x11db8c,_0x1eb422,_0x47029c){var _0x1aeaf8={'raw':!![],'where':{}},_0x3ea6f4={},_0x5046f6;return db[_0xeea7('0x34')]['findOne']({'where':{'id':_0x11db8c[_0xeea7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1eb422,null))[_0xeea7('0x28')](function(_0x408061){if(_0x408061){_0x5046f6=_0x408061[_0xeea7('0x2a')]({'plain':!![]});_0x3ea6f4['model']=_[_0xeea7('0x4e')](db[_0xeea7('0x5a')][_0xeea7('0x35')]);_0x3ea6f4[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x11db8c[_0xeea7('0x3b')]);_0x3ea6f4[_0xeea7('0x39')]=_['intersection'](_0x3ea6f4[_0xeea7('0x38')],_0x3ea6f4[_0xeea7('0x3b')]);_0x1aeaf8[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x3ea6f4['model'],qs[_0xeea7('0x3d')](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x3d')]));_0x1aeaf8[_0xeea7('0x3c')]=_0x1aeaf8[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x1aeaf8[_0xeea7('0x3c')]:_0x3ea6f4[_0xeea7('0x38')];if(!_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x1aeaf8['limit']=qs['limit'](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x1aeaf8[_0xeea7('0x20')]=qs[_0xeea7('0x20')](_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x20')]);}_0x1aeaf8[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x11db8c['query'][_0xeea7('0x41')]);_0x1aeaf8[_0xeea7('0x42')]=qs['filters'](_[_0xeea7('0x43')](_0x11db8c['query'],_0x3ea6f4[_0xeea7('0x39')]));_0x1aeaf8[_0xeea7('0x42')][_0xeea7('0x5b')]=_0x408061['id'];if(_0x11db8c[_0xeea7('0x3b')]['filter']){_0x1aeaf8[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x1aeaf8[_0xeea7('0x42')],{'$or':_[_0xeea7('0x33')](_0x1aeaf8['attributes'],function(_0x12144b){var _0x45c91b={};_0x45c91b[_0x12144b]={'$like':'%'+_0x11db8c[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x45c91b;})});}_0x1aeaf8=_[_0xeea7('0x45')]({},_0x1aeaf8,_0x11db8c[_0xeea7('0x46')]);return db[_0xeea7('0x5a')][_0xeea7('0x49')](_0x1aeaf8);}})[_0xeea7('0x28')](function(_0x1e9cae){if(_0x1e9cae){return db['User']['findAndCountAll']({'where':{'id':_[_0xeea7('0x33')](_0x1e9cae,_0xeea7('0x5c')),'role':'agent'},'attributes':['id',_0xeea7('0x30'),'whatsappPause',_0xeea7('0x5d'),_0xeea7('0x5e')]});}})[_0xeea7('0x28')](function(_0x23db5f){if(_0x23db5f){return{'count':_0x23db5f[_0xeea7('0x1f')],'rows':_[_0xeea7('0x33')](_0x23db5f[_0xeea7('0x4a')],function(_0x46bda8){return{'membername':_0x46bda8[_0xeea7('0x30')],'UserId':_0x46bda8['id'],'queue_name':_0x5046f6[_0xeea7('0x30')],'WhatsappQueueId':_0x5046f6['id'],'interface':util[_0xeea7('0x5f')](_0xeea7('0x60'),_0xeea7('0x61'),_0x46bda8['name']),'penalty':0x0,'paused':_0x46bda8[_0xeea7('0x62')],'createdAt':_0x46bda8[_0xeea7('0x5e')],'updatedAt':_0x46bda8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeea7('0x28')](respondWithFilteredResult(_0x1eb422,_0x1aeaf8))[_0xeea7('0x4b')](handleError(_0x1eb422,null));};exports['getTeams']=function(_0x11c87e,_0x55e08d,_0x4f0652){var _0x1ee37e={};var _0x512b88={};var _0x5806e2;var _0x21d6c8;return db[_0xeea7('0x34')][_0xeea7('0x63')]({'where':{'id':_0x11c87e[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x55e08d,null))['then'](function(_0x204959){if(_0x204959){_0x5806e2=_0x204959;_0x512b88[_0xeea7('0x38')]=_['keys'](db['Team'][_0xeea7('0x35')]);_0x512b88[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x11c87e[_0xeea7('0x3b')]);_0x512b88['filters']=_[_0xeea7('0x3a')](_0x512b88[_0xeea7('0x38')],_0x512b88['query']);_0x1ee37e['attributes']=_[_0xeea7('0x3a')](_0x512b88[_0xeea7('0x38')],qs[_0xeea7('0x3d')](_0x11c87e['query'][_0xeea7('0x3d')]));_0x1ee37e[_0xeea7('0x3c')]=_0x1ee37e[_0xeea7('0x3c')][_0xeea7('0x4f')]?_0x1ee37e[_0xeea7('0x3c')]:_0x512b88['model'];_0x1ee37e[_0xeea7('0x40')]=qs['sort'](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x1ee37e[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_['pick'](_0x11c87e['query'],_0x512b88[_0xeea7('0x39')]));if(_0x11c87e[_0xeea7('0x3b')]['filter']){_0x1ee37e[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x1ee37e['where'],{'$or':_['map'](_0x1ee37e['attributes'],function(_0x1ae94d){var _0x5b5343={};_0x5b5343[_0x1ae94d]={'$like':'%'+_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x44')]+'%'};return _0x5b5343;})});}_0x1ee37e=_[_0xeea7('0x45')]({},_0x1ee37e,_0x11c87e[_0xeea7('0x46')]);return _0x5806e2[_0xeea7('0x64')](_0x1ee37e);}})['then'](function(_0x1a499b){if(_0x1a499b){_0x21d6c8=_0x1a499b[_0xeea7('0x4f')];if(!_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x3e')](_0xeea7('0x3f'))){_0x1ee37e['limit']=qs[_0xeea7('0x1e')](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x1ee37e['offset']=qs[_0xeea7('0x20')](_0x11c87e[_0xeea7('0x3b')][_0xeea7('0x20')]);}return _0x5806e2['getTeams'](_0x1ee37e);}})[_0xeea7('0x28')](function(_0x24094d){if(_0x24094d){return _0x24094d?{'count':_0x21d6c8,'rows':_0x24094d}:null;}})[_0xeea7('0x28')](respondWithResult(_0x55e08d,null))['catch'](handleError(_0x55e08d,null));};exports['addTeams']=function(_0x495af3,_0x5ec974,_0x363aa8){var _0x218389=_0x495af3[_0xeea7('0x52')][_0xeea7('0x65')];return db[_0xeea7('0x66')][_0xeea7('0x49')]({'where':{'id':_0x218389},'attributes':['id'],'include':[{'model':db[_0xeea7('0x67')],'as':_0xeea7('0x68'),'attributes':['id','name','online','voicePause',_0xeea7('0x69')],'raw':!![]}]})[_0xeea7('0x28')](function(_0x159248){if(_0x159248){var _0x23b81f=_['flatMap'](_0x159248,function(_0x36d1bb){var _0x455de9=_0x36d1bb[_0xeea7('0x2a')]({'plain':!![]});return _0x455de9[_0xeea7('0x68')];});return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x495af3[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](function(_0x251074){return db[_0xeea7('0x6a')][_0xeea7('0x6b')](function(_0x6f247){return _0x251074[_0xeea7('0x6c')](_0x218389,{'transaction':_0x6f247})[_0xeea7('0x28')](function(){return BPromise[_0xeea7('0x6d')](_0x23b81f,function(_0x2cbc6b){return db[_0xeea7('0x5a')][_0xeea7('0x6e')]({'where':{'UserId':_0x2cbc6b['id'],'WhatsappQueueId':_0x495af3['params']['id']},'transaction':_0x6f247});});})[_0xeea7('0x28')](function(){_0x23b81f[_0xeea7('0x6f')](function(_0x239025){socket['emit'](_0xeea7('0x70'),{'UserId':_0x239025['id'],'WhatsappQueueId':_0x251074['id']});});});});});}})[_0xeea7('0x28')](respondWithStatusCode(_0x5ec974,null))[_0xeea7('0x4b')](handleError(_0x5ec974,null));};exports[_0xeea7('0x71')]=function(_0x354dbe,_0x594ded,_0x1c4065){return db[_0xeea7('0x66')][_0xeea7('0x49')]({'where':{'id':_0x354dbe[_0xeea7('0x3b')][_0xeea7('0x65')]},'attributes':['id'],'include':[{'model':db[_0xeea7('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeea7('0x28')](handleEntityNotFound(_0x594ded,null))['then'](function(_0x3849c2){var _0x118916=_[_0xeea7('0x33')](_0x3849c2,'id');var _0x4611b5=[];var _0x4561ed=[];var _0x1f832a=squel['select']();_0x1f832a[_0xeea7('0x72')](_0xeea7('0x73'))[_0xeea7('0x74')](_0xeea7('0x75'),'tq')[_0xeea7('0x76')](_0xeea7('0x77'),'ut',_0xeea7('0x78'))[_0xeea7('0x42')](_0xeea7('0x79'),_0x354dbe[_0xeea7('0x4d')]['id']);for(var _0x5e4859=0x0;_0x5e4859<_0x3849c2[_0xeea7('0x4f')];_0x5e4859+=0x1){let _0x44cbe8=_0x3849c2[_0x5e4859];for(var _0x4ff0e6=0x0;_0x4ff0e6<_0x44cbe8[_0xeea7('0x68')][_0xeea7('0x4f')];_0x4ff0e6+=0x1){let _0x78b606=_0x44cbe8['Agents'][_0x4ff0e6];var _0x58c785=_0x1f832a[_0xeea7('0x7a')]();_0x58c785[_0xeea7('0x42')](_0xeea7('0x7b'),_0x78b606['id']);_0x4561ed[_0xeea7('0x7c')](db[_0xeea7('0x6a')]['query'](_0x58c785[_0xeea7('0x7d')](),{'type':db[_0xeea7('0x6a')][_0xeea7('0x7e')][_0xeea7('0x7f')]})['then'](function(_0x4172b9){if(_0x4172b9['length']===0x1){return _0x78b606['id'];}else{var _0x322b8f=_[_0xeea7('0x80')](_[_0xeea7('0x33')](_0x4172b9,_0xeea7('0x81')),function(_0x4d5a11){return _['includes'](_0x118916,_0x4d5a11);});if(_0x322b8f){return _0x78b606['id'];}}}));}}return BPromise[_0xeea7('0x82')](_0x4561ed)[_0xeea7('0x28')](function(_0x94d344){_0x4611b5=_(_0x4611b5)[_0xeea7('0x83')](_0x94d344)['compact']()[_0xeea7('0x84')]();return db[_0xeea7('0x34')]['find']({'where':{'id':_0x354dbe[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](function(_0x3077e3){return db[_0xeea7('0x6a')][_0xeea7('0x6b')](function(_0x1f4f96){return _0x3077e3[_0xeea7('0x71')](_0x354dbe[_0xeea7('0x3b')][_0xeea7('0x65')],{'transaction':_0x1f4f96})[_0xeea7('0x28')](function(){if(!_[_0xeea7('0x85')](_0x4611b5)){return _0x3077e3['removeAgents'](_0x4611b5,{'transaction':_0x1f4f96});}})[_0xeea7('0x28')](function(){_0x4611b5['forEach'](function(_0x2a871d){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x2a871d,'WhatsappQueueId':_0x3077e3['id']});});});});});});})['then'](respondWithStatusCode(_0x594ded,null))[_0xeea7('0x4b')](handleError(_0x594ded,null));};exports['addAgents']=function(_0x568225,_0x5d76b6,_0x4bf266){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x568225[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x5d76b6,null))[_0xeea7('0x28')](function(_0x35a5da){if(_0x35a5da){return _0x35a5da[_0xeea7('0x86')](_0x568225[_0xeea7('0x52')][_0xeea7('0x65')],_[_0xeea7('0x87')](_0x568225['body'],[_0xeea7('0x65'),'id'])||{})[_0xeea7('0x88')](function(_0x55ab38){for(var _0x55be7f=0x0;_0x55be7f<_0x568225['body'][_0xeea7('0x65')][_0xeea7('0x4f')];_0x55be7f+=0x1){socket[_0xeea7('0x89')]('userWhatsappQueue:save',{'UserId':Number(_0x568225[_0xeea7('0x52')]['ids'][_0x55be7f]),'WhatsappQueueId':Number(_0x568225[_0xeea7('0x4d')]['id'])});}return _0x55ab38;});}})[_0xeea7('0x28')](respondWithResult(_0x5d76b6,null))[_0xeea7('0x4b')](handleError(_0x5d76b6,null));};exports[_0xeea7('0x8a')]=function(_0x38f601,_0x4ee2a8,_0x4a0a35){return db[_0xeea7('0x34')][_0xeea7('0x50')]({'where':{'id':_0x38f601[_0xeea7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee2a8,null))['then'](function(_0x19314a){if(_0x19314a){return _0x19314a[_0xeea7('0x8a')](_0x38f601[_0xeea7('0x3b')]['ids'])[_0xeea7('0x28')](function(){if(_[_0xeea7('0x8b')](_0x38f601[_0xeea7('0x3b')][_0xeea7('0x65')])){for(var _0x43612d=0x0;_0x43612d<_0x38f601[_0xeea7('0x3b')]['ids'][_0xeea7('0x4f')];_0x43612d+=0x1){socket[_0xeea7('0x89')](_0xeea7('0x8c'),{'UserId':Number(_0x38f601['query']['ids'][_0x43612d]),'WhatsappQueueId':Number(_0x38f601[_0xeea7('0x4d')]['id'])});}}else{socket['emit'](_0xeea7('0x8c'),{'UserId':Number(_0x38f601[_0xeea7('0x3b')][_0xeea7('0x65')]),'WhatsappQueueId':Number(_0x38f601[_0xeea7('0x4d')]['id'])});}});}})[_0xeea7('0x28')](respondWithStatusCode(_0x4ee2a8,null))[_0xeea7('0x4b')](handleError(_0x4ee2a8,null));};exports['getAgents']=function(_0x1082cb,_0x11fd59,_0x4dba3e){var _0x58b2de={};var _0x5bc80e={};var _0x1e2665;var _0x33f8b8;return db['WhatsappQueue'][_0xeea7('0x63')]({'where':{'id':_0x1082cb[_0xeea7('0x4d')]['id']}})[_0xeea7('0x28')](handleEntityNotFound(_0x11fd59,null))['then'](function(_0x7af5d3){if(_0x7af5d3){_0x1e2665=_0x7af5d3;_0x5bc80e[_0xeea7('0x38')]=_[_0xeea7('0x4e')](db['User'][_0xeea7('0x35')]);_0x5bc80e[_0xeea7('0x3b')]=_[_0xeea7('0x4e')](_0x1082cb[_0xeea7('0x3b')]);_0x5bc80e[_0xeea7('0x39')]=_[_0xeea7('0x3a')](_0x5bc80e[_0xeea7('0x38')],_0x5bc80e[_0xeea7('0x3b')]);_0x58b2de[_0xeea7('0x3c')]=_[_0xeea7('0x3a')](_0x5bc80e['model'],qs[_0xeea7('0x3d')](_0x1082cb['query']['fields']));_0x58b2de[_0xeea7('0x3c')]=_0x58b2de['attributes']['length']?_0x58b2de[_0xeea7('0x3c')]:_0x5bc80e[_0xeea7('0x38')];_0x58b2de[_0xeea7('0x40')]=qs[_0xeea7('0x41')](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x41')]);_0x58b2de[_0xeea7('0x42')]=qs[_0xeea7('0x39')](_[_0xeea7('0x43')](_0x1082cb[_0xeea7('0x3b')],_0x5bc80e[_0xeea7('0x39')]));if(_0x1082cb['query']['filter']){_0x58b2de[_0xeea7('0x42')]=_[_0xeea7('0x45')](_0x58b2de['where'],{'$or':_['map'](_0x58b2de[_0xeea7('0x3c')],function(_0x5092fb){var _0x3af514={};_0x3af514[_0x5092fb]={'$like':'%'+_0x1082cb['query']['filter']+'%'};return _0x3af514;})});}_0x58b2de=_['merge']({},_0x58b2de,_0x1082cb[_0xeea7('0x46')]);return _0x1e2665[_0xeea7('0x8d')](_0x58b2de);}})[_0xeea7('0x28')](function(_0x7ee553){if(_0x7ee553){_0x33f8b8=_0x7ee553[_0xeea7('0x4f')];if(!_0x1082cb[_0xeea7('0x3b')]['hasOwnProperty'](_0xeea7('0x3f'))){_0x58b2de[_0xeea7('0x1e')]=qs['limit'](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x1e')]);_0x58b2de['offset']=qs['offset'](_0x1082cb[_0xeea7('0x3b')][_0xeea7('0x20')]);}return _0x1e2665['getAgents'](_0x58b2de);}})['then'](function(_0x270ef0){if(_0x270ef0){return _0x270ef0?{'count':_0x33f8b8,'rows':_0x270ef0}:null;}})[_0xeea7('0x28')](respondWithResult(_0x11fd59,null))[_0xeea7('0x4b')](handleError(_0x11fd59,null));}; \ No newline at end of file +var _0x2c02=['get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappQueue','findAll','rows','catch','show','params','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','Agents','online','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','Team','ids','select','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy'];(function(_0x1c869d,_0x415ead){var _0x213152=function(_0x1fabf7){while(--_0x1fabf7){_0x1c869d['push'](_0x1c869d['shift']());}};_0x213152(++_0x415ead);}(_0x2c02,0x16e));var _0x22c0=function(_0x413bee,_0x205727){_0x413bee=_0x413bee-0x0;var _0x86ca4c=_0x2c02[_0x413bee];return _0x86ca4c;};'use strict';var emlformat=require(_0x22c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22c0('0x2'));var moment=require('moment');var BPromise=require(_0x22c0('0x3'));var Mustache=require(_0x22c0('0x4'));var util=require(_0x22c0('0x5'));var path=require(_0x22c0('0x6'));var sox=require(_0x22c0('0x7'));var csv=require(_0x22c0('0x8'));var ejs=require(_0x22c0('0x9'));var fs=require('fs');var fs_extra=require(_0x22c0('0xa'));var _=require(_0x22c0('0xb'));var squel=require('squel');var crypto=require(_0x22c0('0xc'));var jsforce=require(_0x22c0('0xd'));var deskjs=require(_0x22c0('0xe'));var toCsv=require(_0x22c0('0x8'));var querystring=require(_0x22c0('0xf'));var Papa=require(_0x22c0('0x10'));var Redis=require(_0x22c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22c0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22c0('0x13'))(_0x22c0('0x14'));var utils=require(_0x22c0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x22c0('0x16'));var db=require(_0x22c0('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x22c0('0x18'),'port':0x18eb});var socket=require(_0x22c0('0x19'))(new Redis(config[_0x22c0('0x1a')]));require('./whatsappQueue.socket')[_0x22c0('0x1b')](socket);function respondWithStatusCode(_0x11985f,_0x49d940){_0x49d940=_0x49d940||0xcc;return function(_0x8d4842){if(_0x8d4842){return _0x11985f['sendStatus'](_0x49d940);}return _0x11985f[_0x22c0('0x1c')](_0x49d940)[_0x22c0('0x1d')]();};}function respondWithResult(_0xc69186,_0x9415c3){_0x9415c3=_0x9415c3||0xc8;return function(_0x29129a){if(_0x29129a){return _0xc69186[_0x22c0('0x1c')](_0x9415c3)['json'](_0x29129a);}};}function respondWithFilteredResult(_0x1ec391,_0x5eedb2){return function(_0x1e9848){if(_0x1e9848){var _0x5e3e7e=typeof _0x5eedb2[_0x22c0('0x1e')]==='undefined'&&typeof _0x5eedb2[_0x22c0('0x1f')]===_0x22c0('0x20');var _0x2f3308=_0x1e9848[_0x22c0('0x21')];var _0x59c56b=_0x5e3e7e?0x0:_0x5eedb2['offset'];var _0x49b829=_0x5e3e7e?_0x1e9848[_0x22c0('0x21')]:_0x5eedb2[_0x22c0('0x1e')]+_0x5eedb2[_0x22c0('0x1f')];var _0x97c1f4;if(_0x49b829>=_0x2f3308){_0x49b829=_0x2f3308;_0x97c1f4=0xc8;}else{_0x97c1f4=0xce;}_0x1ec391[_0x22c0('0x1c')](_0x97c1f4);return _0x1ec391[_0x22c0('0x22')](_0x22c0('0x23'),_0x59c56b+'-'+_0x49b829+'/'+_0x2f3308)[_0x22c0('0x24')](_0x1e9848);}return null;};}function patchUpdates(_0x2becb4){return function(_0x4d1703){try{jsonpatch['apply'](_0x4d1703,_0x2becb4,!![]);}catch(_0x254a86){return BPromise[_0x22c0('0x25')](_0x254a86);}return _0x4d1703[_0x22c0('0x26')]();};}function saveUpdates(_0x23ccc8,_0x4ae430){return function(_0x3b9b65){if(_0x3b9b65){return _0x3b9b65[_0x22c0('0x27')](_0x23ccc8)[_0x22c0('0x28')](function(_0x4a5f5a){return _0x4a5f5a;});}return null;};}function removeEntity(_0x4ff1d4,_0x12f900){return function(_0x175072){if(_0x175072){return _0x175072[_0x22c0('0x29')]()[_0x22c0('0x28')](function(){var _0x3e6b1f=_0x175072[_0x22c0('0x2a')]({'plain':!![]});var _0x1fc00a='WhatsappQueues';return db[_0x22c0('0x2b')][_0x22c0('0x29')]({'where':{'type':_0x1fc00a,'resourceId':_0x3e6b1f['id']}})[_0x22c0('0x28')](function(){return _0x175072;});})[_0x22c0('0x28')](function(){_0x4ff1d4[_0x22c0('0x1c')](0xcc)[_0x22c0('0x1d')]();});}};}function handleEntityNotFound(_0x1a8cb0,_0x4828bd){return function(_0x4227a9){if(!_0x4227a9){_0x1a8cb0[_0x22c0('0x2c')](0x194);}return _0x4227a9;};}function handleError(_0x2097f9,_0x227eae){_0x227eae=_0x227eae||0x1f4;return function(_0x1b360b){logger[_0x22c0('0x2d')](_0x1b360b['stack']);if(_0x1b360b[_0x22c0('0x2e')]){delete _0x1b360b[_0x22c0('0x2e')];}_0x2097f9[_0x22c0('0x1c')](_0x227eae)[_0x22c0('0x2f')](_0x1b360b);};}exports[_0x22c0('0x30')]=function(_0x145ec1,_0x31a984){var _0x4342aa={},_0x3beb4e={},_0x2eae32={'count':0x0,'rows':[]};var _0x275abb=_['map'](db['WhatsappQueue'][_0x22c0('0x31')],function(_0x203c9e){return{'name':_0x203c9e[_0x22c0('0x32')],'type':_0x203c9e[_0x22c0('0x33')][_0x22c0('0x34')]};});_0x3beb4e[_0x22c0('0x35')]=_[_0x22c0('0x36')](_0x275abb,_0x22c0('0x2e'));_0x3beb4e[_0x22c0('0x37')]=_[_0x22c0('0x38')](_0x145ec1[_0x22c0('0x37')]);_0x3beb4e[_0x22c0('0x39')]=_[_0x22c0('0x3a')](_0x3beb4e['model'],_0x3beb4e[_0x22c0('0x37')]);_0x4342aa[_0x22c0('0x3b')]=_[_0x22c0('0x3a')](_0x3beb4e[_0x22c0('0x35')],qs[_0x22c0('0x3c')](_0x145ec1[_0x22c0('0x37')][_0x22c0('0x3c')]));_0x4342aa[_0x22c0('0x3b')]=_0x4342aa[_0x22c0('0x3b')][_0x22c0('0x3d')]?_0x4342aa[_0x22c0('0x3b')]:_0x3beb4e['model'];if(!_0x145ec1[_0x22c0('0x37')][_0x22c0('0x3e')](_0x22c0('0x3f'))){_0x4342aa['limit']=qs[_0x22c0('0x1f')](_0x145ec1[_0x22c0('0x37')][_0x22c0('0x1f')]);_0x4342aa[_0x22c0('0x1e')]=qs[_0x22c0('0x1e')](_0x145ec1[_0x22c0('0x37')][_0x22c0('0x1e')]);}_0x4342aa[_0x22c0('0x40')]=qs[_0x22c0('0x41')](_0x145ec1[_0x22c0('0x37')][_0x22c0('0x41')]);_0x4342aa[_0x22c0('0x42')]=qs[_0x22c0('0x39')](_[_0x22c0('0x43')](_0x145ec1[_0x22c0('0x37')],_0x3beb4e[_0x22c0('0x39')]),_0x275abb);if(_0x145ec1[_0x22c0('0x37')][_0x22c0('0x44')]){_0x4342aa['where']=_['merge'](_0x4342aa[_0x22c0('0x42')],{'$or':_[_0x22c0('0x36')](_0x275abb,function(_0x475fc5){if(_0x475fc5[_0x22c0('0x33')]!=='VIRTUAL'){var _0x5b9514={};_0x5b9514[_0x475fc5[_0x22c0('0x2e')]]={'$like':'%'+_0x145ec1[_0x22c0('0x37')][_0x22c0('0x44')]+'%'};return _0x5b9514;}})});}_0x4342aa=_[_0x22c0('0x45')]({},_0x4342aa,_0x145ec1[_0x22c0('0x46')]);var _0x5cba91={'where':_0x4342aa[_0x22c0('0x42')]};return db[_0x22c0('0x47')][_0x22c0('0x21')](_0x5cba91)['then'](function(_0x291b9a){_0x2eae32[_0x22c0('0x21')]=_0x291b9a;if(_0x145ec1[_0x22c0('0x37')]['includeAll']){_0x4342aa['include']=[{'all':!![]}];}return db[_0x22c0('0x47')][_0x22c0('0x48')](_0x4342aa);})[_0x22c0('0x28')](function(_0x5d0e7c){_0x2eae32[_0x22c0('0x49')]=_0x5d0e7c;return _0x2eae32;})['then'](respondWithFilteredResult(_0x31a984,_0x4342aa))[_0x22c0('0x4a')](handleError(_0x31a984,null));};exports[_0x22c0('0x4b')]=function(_0xd9c95c,_0x7c31b4){var _0x132fb8={'raw':!![],'where':{'id':_0xd9c95c[_0x22c0('0x4c')]['id']}},_0x134586={};_0x134586['model']=_[_0x22c0('0x38')](db['WhatsappQueue'][_0x22c0('0x31')]);_0x134586['query']=_[_0x22c0('0x38')](_0xd9c95c['query']);_0x134586[_0x22c0('0x39')]=_[_0x22c0('0x3a')](_0x134586['model'],_0x134586['query']);_0x132fb8[_0x22c0('0x3b')]=_[_0x22c0('0x3a')](_0x134586['model'],qs['fields'](_0xd9c95c[_0x22c0('0x37')][_0x22c0('0x3c')]));_0x132fb8[_0x22c0('0x3b')]=_0x132fb8[_0x22c0('0x3b')][_0x22c0('0x3d')]?_0x132fb8['attributes']:_0x134586[_0x22c0('0x35')];if(_0xd9c95c[_0x22c0('0x37')][_0x22c0('0x4d')]){_0x132fb8[_0x22c0('0x4e')]=[{'all':!![]}];}_0x132fb8=_[_0x22c0('0x45')]({},_0x132fb8,_0xd9c95c[_0x22c0('0x46')]);return db[_0x22c0('0x47')][_0x22c0('0x4f')](_0x132fb8)[_0x22c0('0x28')](handleEntityNotFound(_0x7c31b4,null))['then'](respondWithResult(_0x7c31b4,null))[_0x22c0('0x4a')](handleError(_0x7c31b4,null));};exports[_0x22c0('0x50')]=function(_0x3893c8,_0x28845d){return db['WhatsappQueue'][_0x22c0('0x50')](_0x3893c8['body'],{})[_0x22c0('0x28')](function(_0x33b643){var _0x1c80d0=_0x3893c8['user'][_0x22c0('0x2a')]({'plain':!![]});if(!_0x1c80d0)throw new Error(_0x22c0('0x51'));if(_0x1c80d0[_0x22c0('0x52')]===_0x22c0('0x53')){var _0x35a977=_0x33b643['get']({'plain':!![]});var _0x11ccff=_0x22c0('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x11ccff,'userProfileId':_0x1c80d0[_0x22c0('0x55')]},'raw':!![]})['then'](function(_0x4472f6){if(_0x4472f6&&_0x4472f6[_0x22c0('0x56')]===0x0){return db[_0x22c0('0x2b')][_0x22c0('0x50')]({'name':_0x35a977[_0x22c0('0x2e')],'resourceId':_0x35a977['id'],'type':_0x4472f6[_0x22c0('0x2e')],'sectionId':_0x4472f6['id']},{})[_0x22c0('0x28')](function(){return _0x33b643;});}else{return _0x33b643;}})[_0x22c0('0x4a')](function(_0x46987a){logger[_0x22c0('0x2d')](_0x22c0('0x57'),_0x46987a);throw _0x46987a;});}return _0x33b643;})[_0x22c0('0x28')](respondWithResult(_0x28845d,0xc9))['catch'](handleError(_0x28845d,null));};exports['update']=function(_0xf01c74,_0x5c25c5){if(_0xf01c74['body']['id']){delete _0xf01c74[_0x22c0('0x58')]['id'];}return db[_0x22c0('0x47')][_0x22c0('0x4f')]({'where':{'id':_0xf01c74[_0x22c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c25c5,null))[_0x22c0('0x28')](saveUpdates(_0xf01c74[_0x22c0('0x58')],null))[_0x22c0('0x28')](respondWithResult(_0x5c25c5,null))[_0x22c0('0x4a')](handleError(_0x5c25c5,null));};exports[_0x22c0('0x29')]=function(_0x2c7a4e,_0x2e2985){return db[_0x22c0('0x47')]['find']({'where':{'id':_0x2c7a4e['params']['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x2e2985,null))[_0x22c0('0x28')](removeEntity(_0x2e2985,null))['catch'](handleError(_0x2e2985,null));};exports['describe']=function(_0x582d50,_0x554737){return db[_0x22c0('0x47')][_0x22c0('0x59')]()[_0x22c0('0x28')](respondWithResult(_0x554737,null))[_0x22c0('0x4a')](handleError(_0x554737,null));};exports[_0x22c0('0x5a')]=function(_0x447286,_0x29646c,_0x1a01b8){var _0x15a574={'raw':!![],'where':{}},_0x261a32={},_0x1c068e;return db[_0x22c0('0x47')][_0x22c0('0x5b')]({'where':{'id':_0x447286[_0x22c0('0x4c')]['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x29646c,null))[_0x22c0('0x28')](function(_0xfece7){if(_0xfece7){_0x1c068e=_0xfece7['get']({'plain':!![]});_0x261a32['model']=_[_0x22c0('0x38')](db[_0x22c0('0x5c')][_0x22c0('0x31')]);_0x261a32[_0x22c0('0x37')]=_[_0x22c0('0x38')](_0x447286['query']);_0x261a32[_0x22c0('0x39')]=_[_0x22c0('0x3a')](_0x261a32['model'],_0x261a32[_0x22c0('0x37')]);_0x15a574[_0x22c0('0x3b')]=_[_0x22c0('0x3a')](_0x261a32[_0x22c0('0x35')],qs[_0x22c0('0x3c')](_0x447286[_0x22c0('0x37')][_0x22c0('0x3c')]));_0x15a574[_0x22c0('0x3b')]=_0x15a574[_0x22c0('0x3b')][_0x22c0('0x3d')]?_0x15a574[_0x22c0('0x3b')]:_0x261a32[_0x22c0('0x35')];if(!_0x447286[_0x22c0('0x37')][_0x22c0('0x3e')](_0x22c0('0x3f'))){_0x15a574[_0x22c0('0x1f')]=qs[_0x22c0('0x1f')](_0x447286['query'][_0x22c0('0x1f')]);_0x15a574[_0x22c0('0x1e')]=qs[_0x22c0('0x1e')](_0x447286[_0x22c0('0x37')][_0x22c0('0x1e')]);}_0x15a574[_0x22c0('0x40')]=qs[_0x22c0('0x41')](_0x447286[_0x22c0('0x37')][_0x22c0('0x41')]);_0x15a574[_0x22c0('0x42')]=qs[_0x22c0('0x39')](_['pick'](_0x447286[_0x22c0('0x37')],_0x261a32[_0x22c0('0x39')]));_0x15a574[_0x22c0('0x42')]['WhatsappQueueId']=_0xfece7['id'];if(_0x447286[_0x22c0('0x37')][_0x22c0('0x44')]){_0x15a574[_0x22c0('0x42')]=_[_0x22c0('0x45')](_0x15a574[_0x22c0('0x42')],{'$or':_['map'](_0x15a574[_0x22c0('0x3b')],function(_0x301e5d){var _0x5f53f9={};_0x5f53f9[_0x301e5d]={'$like':'%'+_0x447286[_0x22c0('0x37')][_0x22c0('0x44')]+'%'};return _0x5f53f9;})});}_0x15a574=_[_0x22c0('0x45')]({},_0x15a574,_0x447286['options']);return db[_0x22c0('0x5c')][_0x22c0('0x48')](_0x15a574);}})[_0x22c0('0x28')](function(_0x12d1d0){if(_0x12d1d0){return db[_0x22c0('0x5d')][_0x22c0('0x5e')]({'where':{'id':_['map'](_0x12d1d0,_0x22c0('0x5f')),'role':_0x22c0('0x60')},'attributes':['id',_0x22c0('0x2e'),_0x22c0('0x61'),_0x22c0('0x62'),_0x22c0('0x63')]});}})[_0x22c0('0x28')](function(_0x25595b){if(_0x25595b){return{'count':_0x25595b[_0x22c0('0x21')],'rows':_[_0x22c0('0x36')](_0x25595b['rows'],function(_0x1c5251){return{'membername':_0x1c5251[_0x22c0('0x2e')],'UserId':_0x1c5251['id'],'queue_name':_0x1c068e[_0x22c0('0x2e')],'WhatsappQueueId':_0x1c068e['id'],'interface':util[_0x22c0('0x64')](_0x22c0('0x65'),'SIP',_0x1c5251[_0x22c0('0x2e')]),'penalty':0x0,'paused':_0x1c5251[_0x22c0('0x61')],'createdAt':_0x1c5251[_0x22c0('0x63')],'updatedAt':_0x1c5251[_0x22c0('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x22c0('0x28')](respondWithFilteredResult(_0x29646c,_0x15a574))[_0x22c0('0x4a')](handleError(_0x29646c,null));};exports[_0x22c0('0x66')]=function(_0x3a5c0,_0x2f7030,_0x3d0971){var _0x5b8d72={};var _0x3dfa0f={};var _0x2dce7b;var _0x1967c1;return db[_0x22c0('0x47')]['findOne']({'where':{'id':_0x3a5c0[_0x22c0('0x4c')]['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x2f7030,null))[_0x22c0('0x28')](function(_0x38ca77){if(_0x38ca77){_0x2dce7b=_0x38ca77;_0x3dfa0f[_0x22c0('0x35')]=_[_0x22c0('0x38')](db['Team']['rawAttributes']);_0x3dfa0f['query']=_[_0x22c0('0x38')](_0x3a5c0[_0x22c0('0x37')]);_0x3dfa0f['filters']=_[_0x22c0('0x3a')](_0x3dfa0f[_0x22c0('0x35')],_0x3dfa0f['query']);_0x5b8d72['attributes']=_[_0x22c0('0x3a')](_0x3dfa0f[_0x22c0('0x35')],qs[_0x22c0('0x3c')](_0x3a5c0[_0x22c0('0x37')][_0x22c0('0x3c')]));_0x5b8d72[_0x22c0('0x3b')]=_0x5b8d72[_0x22c0('0x3b')][_0x22c0('0x3d')]?_0x5b8d72[_0x22c0('0x3b')]:_0x3dfa0f[_0x22c0('0x35')];_0x5b8d72[_0x22c0('0x40')]=qs[_0x22c0('0x41')](_0x3a5c0[_0x22c0('0x37')][_0x22c0('0x41')]);_0x5b8d72[_0x22c0('0x42')]=qs['filters'](_[_0x22c0('0x43')](_0x3a5c0['query'],_0x3dfa0f['filters']));if(_0x3a5c0[_0x22c0('0x37')][_0x22c0('0x44')]){_0x5b8d72[_0x22c0('0x42')]=_[_0x22c0('0x45')](_0x5b8d72[_0x22c0('0x42')],{'$or':_['map'](_0x5b8d72[_0x22c0('0x3b')],function(_0x35b817){var _0x589ebe={};_0x589ebe[_0x35b817]={'$like':'%'+_0x3a5c0[_0x22c0('0x37')]['filter']+'%'};return _0x589ebe;})});}_0x5b8d72=_[_0x22c0('0x45')]({},_0x5b8d72,_0x3a5c0[_0x22c0('0x46')]);return _0x2dce7b[_0x22c0('0x66')](_0x5b8d72);}})[_0x22c0('0x28')](function(_0x45621d){if(_0x45621d){_0x1967c1=_0x45621d[_0x22c0('0x3d')];if(!_0x3a5c0[_0x22c0('0x37')][_0x22c0('0x3e')](_0x22c0('0x3f'))){_0x5b8d72['limit']=qs[_0x22c0('0x1f')](_0x3a5c0[_0x22c0('0x37')]['limit']);_0x5b8d72['offset']=qs[_0x22c0('0x1e')](_0x3a5c0[_0x22c0('0x37')]['offset']);}return _0x2dce7b[_0x22c0('0x66')](_0x5b8d72);}})[_0x22c0('0x28')](function(_0x533dbd){if(_0x533dbd){return _0x533dbd?{'count':_0x1967c1,'rows':_0x533dbd}:null;}})['then'](respondWithResult(_0x2f7030,null))[_0x22c0('0x4a')](handleError(_0x2f7030,null));};exports[_0x22c0('0x67')]=function(_0x1f7f6f,_0x249aec,_0x3d0b9d){var _0x2c45ad=_0x1f7f6f['body']['ids'];return db['Team'][_0x22c0('0x48')]({'where':{'id':_0x2c45ad},'attributes':['id'],'include':[{'model':db[_0x22c0('0x5d')],'as':_0x22c0('0x68'),'attributes':['id',_0x22c0('0x2e'),_0x22c0('0x69'),'voicePause','interface'],'raw':!![]}]})[_0x22c0('0x28')](function(_0x450586){if(_0x450586){var _0x1282a9=_['flatMap'](_0x450586,function(_0x3e7e69){var _0x572a4c=_0x3e7e69['get']({'plain':!![]});return _0x572a4c[_0x22c0('0x68')];});return db[_0x22c0('0x47')][_0x22c0('0x4f')]({'where':{'id':_0x1f7f6f[_0x22c0('0x4c')]['id']}})[_0x22c0('0x28')](function(_0x3f0892){return db['sequelize']['transaction'](function(_0x271816){return _0x3f0892[_0x22c0('0x67')](_0x2c45ad,{'transaction':_0x271816})[_0x22c0('0x28')](function(){return BPromise[_0x22c0('0x6a')](_0x1282a9,function(_0x1a5376){return db[_0x22c0('0x5c')][_0x22c0('0x6b')]({'where':{'UserId':_0x1a5376['id'],'WhatsappQueueId':_0x1f7f6f[_0x22c0('0x4c')]['id']},'transaction':_0x271816});});})[_0x22c0('0x28')](function(){_0x1282a9['forEach'](function(_0x111ba1){socket[_0x22c0('0x6c')](_0x22c0('0x6d'),{'UserId':_0x111ba1['id'],'WhatsappQueueId':_0x3f0892['id']});});});});});}})[_0x22c0('0x28')](respondWithStatusCode(_0x249aec,null))[_0x22c0('0x4a')](handleError(_0x249aec,null));};exports[_0x22c0('0x6e')]=function(_0x41ab1a,_0x5649dd,_0x5e59dc){return db[_0x22c0('0x6f')]['findAll']({'where':{'id':_0x41ab1a[_0x22c0('0x37')][_0x22c0('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x22c0('0x68'),'attributes':['id'],'raw':!![]}]})[_0x22c0('0x28')](handleEntityNotFound(_0x5649dd,null))[_0x22c0('0x28')](function(_0x92677){var _0x4ddb74=_[_0x22c0('0x36')](_0x92677,'id');var _0x7e0a29=[];var _0x454bb7=[];var _0x1df263=squel[_0x22c0('0x71')]();_0x1df263['field']('tq.TeamId')['from'](_0x22c0('0x72'),'tq')['join']('user_has_teams','ut',_0x22c0('0x73'))[_0x22c0('0x42')](_0x22c0('0x74'),_0x41ab1a[_0x22c0('0x4c')]['id']);for(var _0x3bdcdf=0x0;_0x3bdcdf<_0x92677['length'];_0x3bdcdf+=0x1){let _0x48894b=_0x92677[_0x3bdcdf];for(var _0x250521=0x0;_0x250521<_0x48894b['Agents'][_0x22c0('0x3d')];_0x250521+=0x1){let _0x486615=_0x48894b[_0x22c0('0x68')][_0x250521];var _0x3130d0=_0x1df263[_0x22c0('0x75')]();_0x3130d0[_0x22c0('0x42')](_0x22c0('0x76'),_0x486615['id']);_0x454bb7[_0x22c0('0x77')](db[_0x22c0('0x78')][_0x22c0('0x37')](_0x3130d0['toString'](),{'type':db[_0x22c0('0x78')][_0x22c0('0x79')][_0x22c0('0x7a')]})['then'](function(_0x37578d){if(_0x37578d[_0x22c0('0x3d')]===0x1){return _0x486615['id'];}else{var _0x49e6b3=_[_0x22c0('0x7b')](_[_0x22c0('0x36')](_0x37578d,_0x22c0('0x7c')),function(_0x3f39a7){return _[_0x22c0('0x7d')](_0x4ddb74,_0x3f39a7);});if(_0x49e6b3){return _0x486615['id'];}}}));}}return BPromise[_0x22c0('0x7e')](_0x454bb7)['then'](function(_0x3af21b){_0x7e0a29=_(_0x7e0a29)[_0x22c0('0x7f')](_0x3af21b)['compact']()[_0x22c0('0x80')]();return db[_0x22c0('0x47')][_0x22c0('0x4f')]({'where':{'id':_0x41ab1a['params']['id']}})['then'](function(_0x224532){return db[_0x22c0('0x78')][_0x22c0('0x81')](function(_0x3605e0){return _0x224532[_0x22c0('0x6e')](_0x41ab1a[_0x22c0('0x37')][_0x22c0('0x70')],{'transaction':_0x3605e0})[_0x22c0('0x28')](function(){if(!_[_0x22c0('0x82')](_0x7e0a29)){return _0x224532[_0x22c0('0x83')](_0x7e0a29,{'transaction':_0x3605e0});}})[_0x22c0('0x28')](function(){_0x7e0a29['forEach'](function(_0x489337){socket[_0x22c0('0x6c')](_0x22c0('0x84'),{'UserId':_0x489337,'WhatsappQueueId':_0x224532['id']});});});});});});})[_0x22c0('0x28')](respondWithStatusCode(_0x5649dd,null))[_0x22c0('0x4a')](handleError(_0x5649dd,null));};exports[_0x22c0('0x85')]=function(_0x5b91e0,_0x3728b4,_0x36e1ca){return db['WhatsappQueue']['find']({'where':{'id':_0x5b91e0[_0x22c0('0x4c')]['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x3728b4,null))[_0x22c0('0x28')](function(_0x509a73){if(_0x509a73){return _0x509a73[_0x22c0('0x85')](_0x5b91e0['body']['ids'],_['omit'](_0x5b91e0[_0x22c0('0x58')],['ids','id'])||{})['spread'](function(_0x256c6a){for(var _0x16764e=0x0;_0x16764e<_0x5b91e0['body'][_0x22c0('0x70')]['length'];_0x16764e+=0x1){socket[_0x22c0('0x6c')](_0x22c0('0x6d'),{'UserId':Number(_0x5b91e0[_0x22c0('0x58')][_0x22c0('0x70')][_0x16764e]),'WhatsappQueueId':Number(_0x5b91e0[_0x22c0('0x4c')]['id'])});}return _0x256c6a;});}})[_0x22c0('0x28')](respondWithResult(_0x3728b4,null))['catch'](handleError(_0x3728b4,null));};exports[_0x22c0('0x83')]=function(_0x2cf5a6,_0x39c710,_0x249718){return db['WhatsappQueue'][_0x22c0('0x4f')]({'where':{'id':_0x2cf5a6[_0x22c0('0x4c')]['id']}})[_0x22c0('0x28')](handleEntityNotFound(_0x39c710,null))[_0x22c0('0x28')](function(_0x18f45b){if(_0x18f45b){return _0x18f45b['removeAgents'](_0x2cf5a6[_0x22c0('0x37')][_0x22c0('0x70')])[_0x22c0('0x28')](function(){if(_[_0x22c0('0x86')](_0x2cf5a6['query']['ids'])){for(var _0x10b259=0x0;_0x10b259<_0x2cf5a6['query'][_0x22c0('0x70')][_0x22c0('0x3d')];_0x10b259+=0x1){socket['emit'](_0x22c0('0x84'),{'UserId':Number(_0x2cf5a6[_0x22c0('0x37')][_0x22c0('0x70')][_0x10b259]),'WhatsappQueueId':Number(_0x2cf5a6['params']['id'])});}}else{socket[_0x22c0('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x2cf5a6[_0x22c0('0x37')][_0x22c0('0x70')]),'WhatsappQueueId':Number(_0x2cf5a6[_0x22c0('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x39c710,null))[_0x22c0('0x4a')](handleError(_0x39c710,null));};exports['getAgents']=function(_0x3b4f6d,_0x44978f,_0x36dd07){var _0x642bd8={};var _0x492739={};var _0x4c0cbc;var _0x1efd86;return db[_0x22c0('0x47')][_0x22c0('0x5b')]({'where':{'id':_0x3b4f6d['params']['id']}})['then'](handleEntityNotFound(_0x44978f,null))[_0x22c0('0x28')](function(_0x34304f){if(_0x34304f){_0x4c0cbc=_0x34304f;_0x492739[_0x22c0('0x35')]=_[_0x22c0('0x38')](db['User'][_0x22c0('0x31')]);_0x492739[_0x22c0('0x37')]=_[_0x22c0('0x38')](_0x3b4f6d['query']);_0x492739['filters']=_[_0x22c0('0x3a')](_0x492739[_0x22c0('0x35')],_0x492739[_0x22c0('0x37')]);_0x642bd8['attributes']=_[_0x22c0('0x3a')](_0x492739['model'],qs[_0x22c0('0x3c')](_0x3b4f6d[_0x22c0('0x37')][_0x22c0('0x3c')]));_0x642bd8['attributes']=_0x642bd8['attributes'][_0x22c0('0x3d')]?_0x642bd8[_0x22c0('0x3b')]:_0x492739[_0x22c0('0x35')];_0x642bd8['order']=qs[_0x22c0('0x41')](_0x3b4f6d[_0x22c0('0x37')][_0x22c0('0x41')]);_0x642bd8[_0x22c0('0x42')]=qs[_0x22c0('0x39')](_[_0x22c0('0x43')](_0x3b4f6d[_0x22c0('0x37')],_0x492739['filters']));if(_0x3b4f6d[_0x22c0('0x37')][_0x22c0('0x44')]){_0x642bd8[_0x22c0('0x42')]=_[_0x22c0('0x45')](_0x642bd8[_0x22c0('0x42')],{'$or':_['map'](_0x642bd8[_0x22c0('0x3b')],function(_0x4bec2e){var _0x25b369={};_0x25b369[_0x4bec2e]={'$like':'%'+_0x3b4f6d[_0x22c0('0x37')]['filter']+'%'};return _0x25b369;})});}_0x642bd8=_[_0x22c0('0x45')]({},_0x642bd8,_0x3b4f6d[_0x22c0('0x46')]);return _0x4c0cbc[_0x22c0('0x87')](_0x642bd8);}})['then'](function(_0x3fb9d6){if(_0x3fb9d6){_0x1efd86=_0x3fb9d6[_0x22c0('0x3d')];if(!_0x3b4f6d['query']['hasOwnProperty'](_0x22c0('0x3f'))){_0x642bd8[_0x22c0('0x1f')]=qs[_0x22c0('0x1f')](_0x3b4f6d[_0x22c0('0x37')][_0x22c0('0x1f')]);_0x642bd8[_0x22c0('0x1e')]=qs[_0x22c0('0x1e')](_0x3b4f6d['query']['offset']);}return _0x4c0cbc[_0x22c0('0x87')](_0x642bd8);}})['then'](function(_0x5a7cd9){if(_0x5a7cd9){return _0x5a7cd9?{'count':_0x1efd86,'rows':_0x5a7cd9}:null;}})[_0x22c0('0x28')](respondWithResult(_0x44978f,null))[_0x22c0('0x4a')](handleError(_0x44978f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 9bc2912..3cb9be5 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 _0x40a1=['events','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40a1,0x19e));var _0x140a=function(_0x1bff8e,_0x2838d8){_0x1bff8e=_0x1bff8e-0x0;var _0x3e8f49=_0x40a1[_0x1bff8e];return _0x3e8f49;};'use strict';var EventEmitter=require(_0x140a('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x140a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x140a('0x2')](0x0);var events={'afterCreate':_0x140a('0x3'),'afterUpdate':_0x140a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x541f74){return function(_0x3f6633,_0x1958b9,_0x110618){WhatsappQueueEvents[_0x140a('0x5')](_0x541f74+':'+_0x3f6633['id'],_0x3f6633);WhatsappQueueEvents[_0x140a('0x5')](_0x541f74,_0x3f6633);_0x110618(null);};}for(var e in events){if(events[_0x140a('0x6')](e)){var event=events[e];WhatsappQueue[_0x140a('0x7')](e,emitEvent(event));}}module[_0x140a('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x018b=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x018b,0x121));var _0xb018=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x018b[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0xb018('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb018('0x1')](0x0);var events={'afterCreate':_0xb018('0x2'),'afterUpdate':_0xb018('0x3'),'afterDestroy':_0xb018('0x4')};function emitEvent(_0x2411f6){return function(_0x2a8c04,_0x1e7167,_0x3c0280){WhatsappQueueEvents['emit'](_0x2411f6+':'+_0x2a8c04['id'],_0x2a8c04);WhatsappQueueEvents[_0xb018('0x5')](_0x2411f6,_0x2a8c04);_0x3c0280(null);};}for(var e in events){if(events[_0xb018('0x6')](e)){var event=events[e];WhatsappQueue[_0xb018('0x7')](e,emitEvent(event));}}module[_0xb018('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d9149a5..b55dbd9 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 _0x4111=['moment','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x4948e8,_0x1f4aea){var _0x1b52ab=function(_0x105a98){while(--_0x105a98){_0x4948e8['push'](_0x4948e8['shift']());}};_0x1b52ab(++_0x1f4aea);}(_0x4111,0x1e7));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var logger=require(_0x1411('0x2'))('api');var moment=require(_0x1411('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1411('0x4'));var rimraf=require(_0x1411('0x5'));var config=require(_0x1411('0x6'));var attributes=require(_0x1411('0x7'));module[_0x1411('0x8')]=function(_0x3e2f46,_0x2e36ff){return _0x3e2f46['define']('WhatsappQueue',attributes,{'tableName':_0x1411('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8a6=['rimraf','./whatsappQueue.attributes','define','WhatsappQueue','lodash','api','moment','request-promise','path'];(function(_0x300a73,_0x1694a7){var _0x3fd72c=function(_0x31767c){while(--_0x31767c){_0x300a73['push'](_0x300a73['shift']());}};_0x3fd72c(++_0x1694a7);}(_0xc8a6,0x8b));var _0x6c8a=function(_0x208790,_0x5b82db){_0x208790=_0x208790-0x0;var _0x2597c7=_0xc8a6[_0x208790];return _0x2597c7;};'use strict';var _=require(_0x6c8a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c8a('0x1'));var moment=require(_0x6c8a('0x2'));var BPromise=require('bluebird');var rp=require(_0x6c8a('0x3'));var fs=require('fs');var path=require(_0x6c8a('0x4'));var rimraf=require(_0x6c8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x6c8a('0x6'));module['exports']=function(_0x3bef9e,_0xb216e){return _0x3bef9e[_0x6c8a('0x7')](_0x6c8a('0x8'),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 94e8cf2..fb40ccc 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 _0x2f82=['request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowWhatsappQueue','WhatsappQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s'];(function(_0x1443ad,_0x353e8e){var _0x4ab7e6=function(_0x139525){while(--_0x139525){_0x1443ad['push'](_0x1443ad['shift']());}};_0x4ab7e6(++_0x353e8e);}(_0x2f82,0xad));var _0x22f8=function(_0xa4f529,_0x36add4){_0xa4f529=_0xa4f529-0x0;var _0x3ce0df=_0x2f82[_0xa4f529];return _0x3ce0df;};'use strict';var _=require(_0x22f8('0x0'));var util=require('util');var moment=require(_0x22f8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22f8('0x2'));var db=require(_0x22f8('0x3'))['db'];var utils=require(_0x22f8('0x4'));var logger=require(_0x22f8('0x5'))(_0x22f8('0x6'));var config=require(_0x22f8('0x7'));var jayson=require(_0x22f8('0x8'));var client=jayson[_0x22f8('0x9')][_0x22f8('0xa')]({'port':0x232a});config[_0x22f8('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22f8('0xb')]));require(_0x22f8('0xc'))['register'](socket);function respondWithRpcPromise(_0x308f0e,_0x34cd1a,_0x1ac3a4){return new BPromise(function(_0x545240,_0x4482f3){return client[_0x22f8('0xd')](_0x308f0e,_0x1ac3a4)[_0x22f8('0xe')](function(_0x4bec97){logger[_0x22f8('0xf')](_0x22f8('0x10'),_0x34cd1a,_0x22f8('0x11'));logger[_0x22f8('0x12')](_0x22f8('0x13'),_0x34cd1a,_0x22f8('0x11'),JSON[_0x22f8('0x14')](_0x4bec97));if(_0x4bec97[_0x22f8('0x15')]){if(_0x4bec97['error'][_0x22f8('0x16')]===0x1f4){logger[_0x22f8('0x15')](_0x22f8('0x10'),_0x34cd1a,_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);return _0x4482f3(_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);}logger[_0x22f8('0x15')](_0x22f8('0x10'),_0x34cd1a,_0x4bec97['error'][_0x22f8('0x17')]);return _0x545240(_0x4bec97[_0x22f8('0x15')][_0x22f8('0x17')]);}else{logger[_0x22f8('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x34cd1a,_0x22f8('0x11'));_0x545240(_0x4bec97[_0x22f8('0x18')][_0x22f8('0x17')]);}})[_0x22f8('0x19')](function(_0x33301f){logger[_0x22f8('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x34cd1a,_0x33301f);_0x4482f3(_0x33301f);});});}exports[_0x22f8('0x1a')]=function(_0x39e3a4){var _0x9370a9=this;return new Promise(function(_0x48c506,_0x590664){return db['WhatsappQueue'][_0x22f8('0x1b')]({'raw':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x1d')]===undefined?!![]:![]:!![],'where':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4['options'][_0x22f8('0x1e')]||null:null,'attributes':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')]['attributes']||null:null,'limit':_0x39e3a4[_0x22f8('0x1c')]?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x1f')]||null:null,'include':_0x39e3a4['options']?_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x20')]?_['map'](_0x39e3a4[_0x22f8('0x1c')][_0x22f8('0x20')],function(_0x547a0b){return{'model':db[_0x547a0b[_0x22f8('0x21')]],'as':_0x547a0b['as'],'attributes':_0x547a0b[_0x22f8('0x22')],'include':_0x547a0b[_0x22f8('0x20')]?_['map'](_0x547a0b[_0x22f8('0x20')],function(_0x2029e4){return{'model':db[_0x2029e4[_0x22f8('0x21')]],'as':_0x2029e4['as'],'attributes':_0x2029e4['attributes'],'include':_0x2029e4[_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x2029e4['include'],function(_0x5ee0ca){return{'model':db[_0x5ee0ca[_0x22f8('0x21')]],'as':_0x5ee0ca['as'],'attributes':_0x5ee0ca[_0x22f8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x22f8('0xe')](function(_0x3dfd25){logger[_0x22f8('0xf')](_0x22f8('0x1a'),_0x39e3a4);logger[_0x22f8('0x12')]('GetWhatsappQueue',_0x39e3a4,JSON[_0x22f8('0x14')](_0x3dfd25));_0x48c506(_0x3dfd25);})[_0x22f8('0x19')](function(_0x3c9d49){logger[_0x22f8('0x15')](_0x22f8('0x1a'),_0x3c9d49[_0x22f8('0x17')],_0x39e3a4);_0x590664(_0x9370a9[_0x22f8('0x15')](0x1f4,_0x3c9d49[_0x22f8('0x17')]));});});};exports[_0x22f8('0x24')]=function(_0x2296b4){var _0x4530cd=this;return new Promise(function(_0x2aa606,_0x38cb22){return db[_0x22f8('0x25')]['find']({'raw':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4['options'][_0x22f8('0x1e')]||null:null,'attributes':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')][_0x22f8('0x22')]||null:null,'include':_0x2296b4[_0x22f8('0x1c')]?_0x2296b4[_0x22f8('0x1c')][_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x2296b4['options']['include'],function(_0x531953){return{'model':db[_0x531953[_0x22f8('0x21')]],'as':_0x531953['as'],'attributes':_0x531953[_0x22f8('0x22')],'include':_0x531953[_0x22f8('0x20')]?_[_0x22f8('0x23')](_0x531953[_0x22f8('0x20')],function(_0x13a5b0){return{'model':db[_0x13a5b0['model']],'as':_0x13a5b0['as'],'attributes':_0x13a5b0['attributes'],'include':_0x13a5b0[_0x22f8('0x20')]?_['map'](_0x13a5b0[_0x22f8('0x20')],function(_0x3399bd){return{'model':db[_0x3399bd[_0x22f8('0x21')]],'as':_0x3399bd['as'],'attributes':_0x3399bd[_0x22f8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x418bb1){logger[_0x22f8('0xf')](_0x22f8('0x24'),_0x2296b4);logger[_0x22f8('0x12')](_0x22f8('0x24'),_0x2296b4,JSON[_0x22f8('0x14')](_0x418bb1));_0x2aa606(_0x418bb1);})['catch'](function(_0x2f5b98){logger[_0x22f8('0x15')](_0x22f8('0x24'),_0x2f5b98[_0x22f8('0x17')],_0x2296b4);_0x38cb22(_0x4530cd[_0x22f8('0x15')](0x1f4,_0x2f5b98[_0x22f8('0x17')]));});});}; \ No newline at end of file +var _0xac55=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','then','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','WhatsappQueue,\x20%s,\x20%s','info','result','GetWhatsappQueue','findAll','options','where','limit','include','model','attributes','map','stringify','catch','ShowWhatsappQueue','raw'];(function(_0x160071,_0xfdccc1){var _0x1985f5=function(_0x268b67){while(--_0x268b67){_0x160071['push'](_0x160071['shift']());}};_0x1985f5(++_0xfdccc1);}(_0xac55,0x11f));var _0x5ac5=function(_0x5bdead,_0x307219){_0x5bdead=_0x5bdead-0x0;var _0x38e715=_0xac55[_0x5bdead];return _0x38e715;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require(_0x5ac5('0x2'));var BPromise=require(_0x5ac5('0x3'));var rs=require(_0x5ac5('0x4'));var fs=require('fs');var Redis=require(_0x5ac5('0x5'));var db=require(_0x5ac5('0x6'))['db'];var utils=require(_0x5ac5('0x7'));var logger=require(_0x5ac5('0x8'))(_0x5ac5('0x9'));var config=require(_0x5ac5('0xa'));var jayson=require(_0x5ac5('0xb'));var client=jayson[_0x5ac5('0xc')][_0x5ac5('0xd')]({'port':0x232a});config['redis']=_[_0x5ac5('0xe')](config['redis'],{'host':_0x5ac5('0xf'),'port':0x18eb});var socket=require(_0x5ac5('0x10'))(new Redis(config[_0x5ac5('0x11')]));require('./whatsappQueue.socket')[_0x5ac5('0x12')](socket);function respondWithRpcPromise(_0x3aa65c,_0x2cc694,_0x10a33d){return new BPromise(function(_0x2b4265,_0x118d4e){return client['request'](_0x3aa65c,_0x10a33d)[_0x5ac5('0x13')](function(_0x594b25){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x2cc694,_0x5ac5('0x14'));logger[_0x5ac5('0x15')](_0x5ac5('0x16'),_0x2cc694,_0x5ac5('0x14'),JSON['stringify'](_0x594b25));if(_0x594b25['error']){if(_0x594b25[_0x5ac5('0x17')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2cc694,_0x594b25[_0x5ac5('0x17')][_0x5ac5('0x18')]);return _0x118d4e(_0x594b25[_0x5ac5('0x17')][_0x5ac5('0x18')]);}logger['error'](_0x5ac5('0x19'),_0x2cc694,_0x594b25['error'][_0x5ac5('0x18')]);return _0x2b4265(_0x594b25[_0x5ac5('0x17')]['message']);}else{logger[_0x5ac5('0x1a')](_0x5ac5('0x19'),_0x2cc694,_0x5ac5('0x14'));_0x2b4265(_0x594b25[_0x5ac5('0x1b')][_0x5ac5('0x18')]);}})['catch'](function(_0x4f0f45){logger[_0x5ac5('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x2cc694,_0x4f0f45);_0x118d4e(_0x4f0f45);});});}exports[_0x5ac5('0x1c')]=function(_0x597953){var _0x54059d=this;return new Promise(function(_0x41047b,_0x50a4b2){return db['WhatsappQueue'][_0x5ac5('0x1d')]({'raw':_0x597953[_0x5ac5('0x1e')]?_0x597953[_0x5ac5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x597953[_0x5ac5('0x1e')]?_0x597953[_0x5ac5('0x1e')][_0x5ac5('0x1f')]||null:null,'attributes':_0x597953['options']?_0x597953[_0x5ac5('0x1e')]['attributes']||null:null,'limit':_0x597953[_0x5ac5('0x1e')]?_0x597953[_0x5ac5('0x1e')][_0x5ac5('0x20')]||null:null,'include':_0x597953[_0x5ac5('0x1e')]?_0x597953[_0x5ac5('0x1e')][_0x5ac5('0x21')]?_['map'](_0x597953[_0x5ac5('0x1e')][_0x5ac5('0x21')],function(_0xac877c){return{'model':db[_0xac877c[_0x5ac5('0x22')]],'as':_0xac877c['as'],'attributes':_0xac877c['attributes'],'include':_0xac877c['include']?_['map'](_0xac877c[_0x5ac5('0x21')],function(_0x44968e){return{'model':db[_0x44968e[_0x5ac5('0x22')]],'as':_0x44968e['as'],'attributes':_0x44968e[_0x5ac5('0x23')],'include':_0x44968e['include']?_[_0x5ac5('0x24')](_0x44968e[_0x5ac5('0x21')],function(_0x51a809){return{'model':db[_0x51a809[_0x5ac5('0x22')]],'as':_0x51a809['as'],'attributes':_0x51a809[_0x5ac5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5ac5('0x13')](function(_0x3ce567){logger['info'](_0x5ac5('0x1c'),_0x597953);logger['debug'](_0x5ac5('0x1c'),_0x597953,JSON[_0x5ac5('0x25')](_0x3ce567));_0x41047b(_0x3ce567);})[_0x5ac5('0x26')](function(_0x45ea62){logger[_0x5ac5('0x17')](_0x5ac5('0x1c'),_0x45ea62[_0x5ac5('0x18')],_0x597953);_0x50a4b2(_0x54059d[_0x5ac5('0x17')](0x1f4,_0x45ea62[_0x5ac5('0x18')]));});});};exports[_0x5ac5('0x27')]=function(_0x30467e){var _0x146055=this;return new Promise(function(_0xf3bb56,_0xa127e5){return db['WhatsappQueue']['find']({'raw':_0x30467e['options']?_0x30467e[_0x5ac5('0x1e')][_0x5ac5('0x28')]===undefined?!![]:![]:!![],'where':_0x30467e[_0x5ac5('0x1e')]?_0x30467e[_0x5ac5('0x1e')][_0x5ac5('0x1f')]||null:null,'attributes':_0x30467e[_0x5ac5('0x1e')]?_0x30467e[_0x5ac5('0x1e')][_0x5ac5('0x23')]||null:null,'include':_0x30467e[_0x5ac5('0x1e')]?_0x30467e['options'][_0x5ac5('0x21')]?_[_0x5ac5('0x24')](_0x30467e[_0x5ac5('0x1e')][_0x5ac5('0x21')],function(_0x322b92){return{'model':db[_0x322b92[_0x5ac5('0x22')]],'as':_0x322b92['as'],'attributes':_0x322b92[_0x5ac5('0x23')],'include':_0x322b92[_0x5ac5('0x21')]?_[_0x5ac5('0x24')](_0x322b92[_0x5ac5('0x21')],function(_0x2b2f1f){return{'model':db[_0x2b2f1f[_0x5ac5('0x22')]],'as':_0x2b2f1f['as'],'attributes':_0x2b2f1f[_0x5ac5('0x23')],'include':_0x2b2f1f['include']?_[_0x5ac5('0x24')](_0x2b2f1f[_0x5ac5('0x21')],function(_0x1956e3){return{'model':db[_0x1956e3[_0x5ac5('0x22')]],'as':_0x1956e3['as'],'attributes':_0x1956e3[_0x5ac5('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140c5d){logger['info']('ShowWhatsappQueue',_0x30467e);logger[_0x5ac5('0x15')](_0x5ac5('0x27'),_0x30467e,JSON['stringify'](_0x140c5d));_0xf3bb56(_0x140c5d);})[_0x5ac5('0x26')](function(_0x570260){logger[_0x5ac5('0x17')](_0x5ac5('0x27'),_0x570260['message'],_0x30467e);_0xa127e5(_0x146055[_0x5ac5('0x17')](0x1f4,_0x570260[_0x5ac5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 60a251d..726a5f2 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 _0xb98a=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener','length'];(function(_0xe813c6,_0x36fe00){var _0x46a109=function(_0x324c2c){while(--_0x324c2c){_0xe813c6['push'](_0xe813c6['shift']());}};_0x46a109(++_0x36fe00);}(_0xb98a,0xe8));var _0xab98=function(_0x5edd05,_0x8ac1d3){_0x5edd05=_0x5edd05-0x0;var _0x19b62e=_0xb98a[_0x5edd05];return _0x19b62e;};'use strict';var WhatsappQueueEvents=require(_0xab98('0x0'));var events=[_0xab98('0x1'),_0xab98('0x2'),_0xab98('0x3')];function createListener(_0xd9df3e,_0x2106a5){return function(_0x2f7eb6){_0x2106a5['emit'](_0xd9df3e,_0x2f7eb6);};}function removeListener(_0x3adacd,_0x33cc7b){return function(){WhatsappQueueEvents[_0xab98('0x4')](_0x3adacd,_0x33cc7b);};}exports['register']=function(_0x39e4a6){for(var _0x88493a=0x0,_0x577d02=events[_0xab98('0x5')];_0x88493a<_0x577d02;_0x88493a++){var _0x195909=events[_0x88493a];var _0x3165f4=createListener(_0xab98('0x6')+_0x195909,_0x39e4a6);WhatsappQueueEvents['on'](_0x195909,_0x3165f4);}}; \ No newline at end of file +var _0x58a1=['removeListener','register','length','whatsappQueue:','remove','update','emit'];(function(_0x2a8936,_0x243cdd){var _0x855b36=function(_0x395a7f){while(--_0x395a7f){_0x2a8936['push'](_0x2a8936['shift']());}};_0x855b36(++_0x243cdd);}(_0x58a1,0x90));var _0x158a=function(_0x5becd6,_0x13e651){_0x5becd6=_0x5becd6-0x0;var _0x3b7b78=_0x58a1[_0x5becd6];return _0x3b7b78;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x158a('0x0'),_0x158a('0x1')];function createListener(_0x4438cb,_0x5ceff4){return function(_0x1772db){_0x5ceff4[_0x158a('0x2')](_0x4438cb,_0x1772db);};}function removeListener(_0x33a95d,_0x3583d6){return function(){WhatsappQueueEvents[_0x158a('0x3')](_0x33a95d,_0x3583d6);};}exports[_0x158a('0x4')]=function(_0x4b4c0e){for(var _0xf0409=0x0,_0x2386f1=events[_0x158a('0x5')];_0xf0409<_0x2386f1;_0xf0409++){var _0xaf9388=events[_0xf0409];var _0xe4897e=createListener(_0x158a('0x6')+_0xaf9388,_0x4b4c0e);WhatsappQueueEvents['on'](_0xaf9388,_0xe4897e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 9f486e1..54d816a 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 _0x7b6c=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service'];(function(_0x1f48e5,_0x451e6e){var _0x342f42=function(_0x520482){while(--_0x520482){_0x1f48e5['push'](_0x1f48e5['shift']());}};_0x342f42(++_0x451e6e);}(_0x7b6c,0x81));var _0xc7b6=function(_0x2decf0,_0x57c3b2){_0x2decf0=_0x2decf0-0x0;var _0x4874d3=_0x7b6c[_0x2decf0];return _0x4874d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc7b6('0x0'));var timeout=require(_0xc7b6('0x1'));var express=require('express');var router=express[_0xc7b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc7b6('0x3'));var interaction=require(_0xc7b6('0x4'));var config=require(_0xc7b6('0x5'));var controller=require(_0xc7b6('0x6'));router[_0xc7b6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc7b6('0x8')]);router[_0xc7b6('0x7')](_0xc7b6('0x9'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0xb')]);router[_0xc7b6('0x7')](_0xc7b6('0xc'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0xd')]);router[_0xc7b6('0xe')]('/',auth[_0xc7b6('0xa')](),controller['create']);router[_0xc7b6('0xf')](_0xc7b6('0xc'),auth[_0xc7b6('0xa')](),controller[_0xc7b6('0x10')]);router[_0xc7b6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc7b6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2d12=['get','isAuthenticated','/describe','describe','/:id','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x29c8a7,_0x28ca46){var _0x441081=function(_0x38f10a){while(--_0x38f10a){_0x29c8a7['push'](_0x29c8a7['shift']());}};_0x441081(++_0x28ca46);}(_0x2d12,0x9a));var _0x22d1=function(_0x28ffb5,_0x2deba8){_0x28ffb5=_0x28ffb5-0x0;var _0x15b509=_0x2d12[_0x28ffb5];return _0x15b509;};'use strict';var multer=require(_0x22d1('0x0'));var util=require(_0x22d1('0x1'));var path=require(_0x22d1('0x2'));var timeout=require(_0x22d1('0x3'));var express=require(_0x22d1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x22d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22d1('0x6'));var controller=require(_0x22d1('0x7'));router[_0x22d1('0x8')]('/',auth[_0x22d1('0x9')](),controller['index']);router['get'](_0x22d1('0xa'),auth[_0x22d1('0x9')](),controller[_0x22d1('0xb')]);router['get'](_0x22d1('0xc'),auth[_0x22d1('0x9')](),controller['show']);router[_0x22d1('0xd')]('/',auth[_0x22d1('0x9')](),controller[_0x22d1('0xe')]);router['put']('/:id',auth[_0x22d1('0x9')](),controller[_0x22d1('0xf')]);router['delete']('/:id',auth[_0x22d1('0x9')](),controller[_0x22d1('0x10')]);module[_0x22d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 547ee08..854feae 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(_0x394f41,_0x3f3717){var _0xc18e7b=function(_0x16142d){while(--_0x16142d){_0x394f41['push'](_0x394f41['shift']());}};_0xc18e7b(++_0x3f3717);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x89c6d4,_0xbe3511){var _0x55732d=function(_0x2207bb){while(--_0x2207bb){_0x89c6d4['push'](_0x89c6d4['shift']());}};_0x55732d(++_0xbe3511);}(_0x7a54,0x106));var _0x47a5=function(_0x3654c8,_0x1eb56e){_0x3654c8=_0x3654c8-0x0;var _0x44e373=_0x7a54[_0x3654c8];return _0x44e373;};'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 073ed8d..8b0f6ef 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 _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x17db5d,_0x513d0e){var _0x3581d9=function(_0x16ab68){while(--_0x16ab68){_0x17db5d['push'](_0x17db5d['shift']());}};_0x3581d9(++_0x513d0e);}(_0x02ce,0x1ac));var _0xe02c=function(_0x25aef2,_0x56c90a){_0x25aef2=_0x25aef2-0x0;var _0x366b32=_0x02ce[_0x25aef2];return _0x366b32;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));}; \ No newline at end of file +var _0xa571=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','end','error','name','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x2e9a56,_0x16fb93){var _0x10c96b=function(_0x24ab54){while(--_0x24ab54){_0x2e9a56['push'](_0x2e9a56['shift']());}};_0x10c96b(++_0x16fb93);}(_0xa571,0x107));var _0x1a57=function(_0x216a61,_0x476d43){_0x216a61=_0x216a61-0x0;var _0x5a5cd4=_0xa571[_0x216a61];return _0x5a5cd4;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x2f9454,_0x182649){return function(_0x25c1e9){if(!_0x25c1e9){_0x2f9454[_0x1a57('0x18')](0x194);}return _0x25c1e9;};}function handleError(_0x27cfe1,_0xf6ffef){_0xf6ffef=_0xf6ffef||0x1f4;return function(_0x26584b){logger[_0x1a57('0x24')](_0x26584b['stack']);if(_0x26584b['name']){delete _0x26584b[_0x1a57('0x25')];}_0x27cfe1[_0x1a57('0x19')](_0xf6ffef)['send'](_0x26584b);};}exports[_0x1a57('0x26')]=function(_0x54f6a5,_0x2d8738){var _0x4a2901={},_0x53bf6e={},_0x8179a4={'count':0x0,'rows':[]};var _0x274fe6=_[_0x1a57('0x27')](db[_0x1a57('0x28')]['rawAttributes'],function(_0x366d5f){return{'name':_0x366d5f[_0x1a57('0x29')],'type':_0x366d5f[_0x1a57('0x2a')][_0x1a57('0x2b')]};});_0x53bf6e['model']=_[_0x1a57('0x27')](_0x274fe6,_0x1a57('0x25'));_0x53bf6e[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x54f6a5[_0x1a57('0x2c')]);_0x53bf6e[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],_0x53bf6e[_0x1a57('0x2c')]);_0x4a2901['attributes']=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],qs['fields'](_0x54f6a5['query'][_0x1a57('0x31')]));_0x4a2901[_0x1a57('0x32')]=_0x4a2901[_0x1a57('0x32')][_0x1a57('0x33')]?_0x4a2901[_0x1a57('0x32')]:_0x53bf6e[_0x1a57('0x30')];if(!_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x34')](_0x1a57('0x35'))){_0x4a2901[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x4a2901[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1e')]);}_0x4a2901[_0x1a57('0x36')]=qs['sort'](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x37')]);_0x4a2901[_0x1a57('0x38')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x39')](_0x54f6a5[_0x1a57('0x2c')],_0x53bf6e[_0x1a57('0x2e')]),_0x274fe6);if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]){_0x4a2901['where']=_['merge'](_0x4a2901['where'],{'$or':_['map'](_0x274fe6,function(_0x333b32){if(_0x333b32[_0x1a57('0x2a')]!==_0x1a57('0x3b')){var _0x4d6e1e={};_0x4d6e1e[_0x333b32[_0x1a57('0x25')]]={'$like':'%'+_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]+'%'};return _0x4d6e1e;}})});}_0x4a2901=_[_0x1a57('0x3c')]({},_0x4a2901,_0x54f6a5['options']);var _0x1be254={'where':_0x4a2901['where']};return db[_0x1a57('0x28')][_0x1a57('0x1d')](_0x1be254)[_0x1a57('0x21')](function(_0x534a9a){_0x8179a4[_0x1a57('0x1d')]=_0x534a9a;if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x4a2901[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x28')]['findAll'](_0x4a2901);})[_0x1a57('0x21')](function(_0x47e998){_0x8179a4['rows']=_0x47e998;return _0x8179a4;})[_0x1a57('0x21')](respondWithFilteredResult(_0x2d8738,_0x4a2901))['catch'](handleError(_0x2d8738,null));};exports[_0x1a57('0x3f')]=function(_0x398c59,_0x3fbae1){var _0x59abb1={'raw':!![],'where':{'id':_0x398c59[_0x1a57('0x40')]['id']}},_0x188a50={};_0x188a50[_0x1a57('0x30')]=_[_0x1a57('0x2d')](db['WhatsappQueueReport'][_0x1a57('0x41')]);_0x188a50[_0x1a57('0x2c')]=_['keys'](_0x398c59[_0x1a57('0x2c')]);_0x188a50['filters']=_['intersection'](_0x188a50[_0x1a57('0x30')],_0x188a50[_0x1a57('0x2c')]);_0x59abb1[_0x1a57('0x32')]=_[_0x1a57('0x2f')](_0x188a50['model'],qs[_0x1a57('0x31')](_0x398c59[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x59abb1[_0x1a57('0x32')]=_0x59abb1[_0x1a57('0x32')]['length']?_0x59abb1[_0x1a57('0x32')]:_0x188a50[_0x1a57('0x30')];if(_0x398c59[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x59abb1['include']=[{'all':!![]}];}_0x59abb1=_[_0x1a57('0x3c')]({},_0x59abb1,_0x398c59['options']);return db[_0x1a57('0x28')][_0x1a57('0x42')](_0x59abb1)[_0x1a57('0x21')](handleEntityNotFound(_0x3fbae1,null))[_0x1a57('0x21')](respondWithResult(_0x3fbae1,null))[_0x1a57('0x43')](handleError(_0x3fbae1,null));};exports[_0x1a57('0x44')]=function(_0x28f629,_0x401285){return db[_0x1a57('0x28')][_0x1a57('0x44')](_0x28f629[_0x1a57('0x45')],{})[_0x1a57('0x21')](respondWithResult(_0x401285,0xc9))[_0x1a57('0x43')](handleError(_0x401285,null));};exports['update']=function(_0xf4d056,_0x480aff){if(_0xf4d056[_0x1a57('0x45')]['id']){delete _0xf4d056[_0x1a57('0x45')]['id'];}return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0xf4d056[_0x1a57('0x40')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x480aff,null))[_0x1a57('0x21')](saveUpdates(_0xf4d056[_0x1a57('0x45')],null))[_0x1a57('0x21')](respondWithResult(_0x480aff,null))['catch'](handleError(_0x480aff,null));};exports[_0x1a57('0x22')]=function(_0x439a42,_0x51651d){return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0x439a42['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x51651d,null))[_0x1a57('0x21')](removeEntity(_0x51651d,null))['catch'](handleError(_0x51651d,null));};exports['describe']=function(_0x5b0563,_0x2c1bac){return db[_0x1a57('0x28')]['describe']()[_0x1a57('0x21')](respondWithResult(_0x2c1bac,null))[_0x1a57('0x43')](handleError(_0x2c1bac,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 1e9d288..b5b7d24 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 _0x5f9a=['uniqueid','util','api','moment','bluebird','rimraf','define','WhatsappQueueReport'];(function(_0x2bfd54,_0x50ab56){var _0x711287=function(_0xed54a6){while(--_0xed54a6){_0x2bfd54['push'](_0x2bfd54['shift']());}};_0x711287(++_0x50ab56);}(_0x5f9a,0x171));var _0xa5f9=function(_0x482825,_0x2f0616){_0x482825=_0x482825-0x0;var _0x3b7a70=_0x5f9a[_0x482825];return _0x3b7a70;};'use strict';var _=require('lodash');var util=require(_0xa5f9('0x0'));var logger=require('../../config/logger')(_0xa5f9('0x1'));var moment=require(_0xa5f9('0x2'));var BPromise=require(_0xa5f9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa5f9('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x1ab0ba,_0x1946ef){return _0x1ab0ba[_0xa5f9('0x5')](_0xa5f9('0x6'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xa5f9('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9363=['moment','bluebird','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0x3706d1,_0x447b88){var _0x1d672d=function(_0xd63bd7){while(--_0xd63bd7){_0x3706d1['push'](_0x3706d1['shift']());}};_0x1d672d(++_0x447b88);}(_0x9363,0x76));var _0x3936=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x9363[_0x32f26d];return _0x5d9ddc;};'use strict';var _=require('lodash');var util=require(_0x3936('0x0'));var logger=require(_0x3936('0x1'))(_0x3936('0x2'));var moment=require(_0x3936('0x3'));var BPromise=require(_0x3936('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3936('0x5'));var config=require('../../config/environment');var attributes=require(_0x3936('0x6'));module['exports']=function(_0x468e56,_0x41c6b3){return _0x468e56[_0x3936('0x7')](_0x3936('0x8'),attributes,{'tableName':_0x3936('0x9'),'paranoid':![],'indexes':[{'name':_0x3936('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 051949b..92ea65a 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 _0x0476=['http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','WhatsappQueueReport,\x20%s,\x20%s','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0x0476,0x177));var _0x6047=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x0476[_0x845505];return _0x2513b9;};'use strict';var _=require(_0x6047('0x0'));var util=require('util');var moment=require(_0x6047('0x1'));var BPromise=require(_0x6047('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6047('0x3'));var db=require(_0x6047('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6047('0x5'))('rpc');var config=require(_0x6047('0x6'));var jayson=require(_0x6047('0x7'));var client=jayson[_0x6047('0x8')][_0x6047('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f03fb,_0x22377e,_0x589036){return new BPromise(function(_0x95df4,_0x2b7271){return client[_0x6047('0xa')](_0x5f03fb,_0x589036)[_0x6047('0xb')](function(_0x453cf1){logger[_0x6047('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x6047('0xd'));logger[_0x6047('0xe')](_0x6047('0xf'),_0x22377e,_0x6047('0xd'),JSON[_0x6047('0x10')](_0x453cf1));if(_0x453cf1['error']){if(_0x453cf1['error'][_0x6047('0x11')]===0x1f4){logger[_0x6047('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x453cf1[_0x6047('0x12')][_0x6047('0x13')]);return _0x2b7271(_0x453cf1[_0x6047('0x12')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,_0x453cf1[_0x6047('0x12')][_0x6047('0x13')]);return _0x95df4(_0x453cf1['error']['message']);}else{logger[_0x6047('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22377e,'request\x20sent');_0x95df4(_0x453cf1[_0x6047('0x14')]['message']);}})[_0x6047('0x15')](function(_0x44bc54){logger[_0x6047('0x12')](_0x6047('0x16'),_0x22377e,_0x44bc54);_0x2b7271(_0x44bc54);});});}exports[_0x6047('0x17')]=function(_0x30d23b){var _0x59dec5=this;return new Promise(function(_0x5900f5,_0x164757){return db[_0x6047('0x18')][_0x6047('0x19')](_0x30d23b[_0x6047('0x1a')],{'raw':_0x30d23b[_0x6047('0x1b')]?_0x30d23b['options']['raw']===undefined?!![]:![]:!![]})[_0x6047('0xb')](function(_0x185926){logger['info'](_0x6047('0x17'),_0x30d23b);logger[_0x6047('0xe')](_0x6047('0x17'),_0x30d23b,JSON[_0x6047('0x10')](_0x185926));_0x5900f5(_0x185926);})['catch'](function(_0x7e62c9){logger['error'](_0x6047('0x17'),_0x7e62c9['message'],_0x30d23b);_0x164757(_0x59dec5[_0x6047('0x12')](0x1f4,_0x7e62c9[_0x6047('0x13')]));});});};exports[_0x6047('0x1c')]=function(_0x4f1dae){var _0x5d4860=this;return new Promise(function(_0x49145c,_0x1fd72a){return db[_0x6047('0x18')][_0x6047('0x1d')](_0x4f1dae[_0x6047('0x1a')],{'raw':_0x4f1dae['options']?_0x4f1dae[_0x6047('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1dae['options']?_0x4f1dae[_0x6047('0x1b')]['where']||null:null,'attributes':_0x4f1dae[_0x6047('0x1b')]?_0x4f1dae['options'][_0x6047('0x1e')]||null:null,'limit':_0x4f1dae[_0x6047('0x1b')]?_0x4f1dae[_0x6047('0x1b')][_0x6047('0x1f')]||null:null})[_0x6047('0xb')](function(_0x4d8c95){logger[_0x6047('0xc')]('UpdateWhatsappQueueReport',_0x4f1dae);logger[_0x6047('0xe')]('UpdateWhatsappQueueReport',_0x4f1dae,JSON[_0x6047('0x10')](_0x4d8c95));_0x49145c(_0x4d8c95);})[_0x6047('0x15')](function(_0x4f76de){logger[_0x6047('0x12')](_0x6047('0x1c'),_0x4f76de[_0x6047('0x13')],_0x4f1dae);_0x1fd72a(_0x5d4860['error'](0x1f4,_0x4f76de[_0x6047('0x13')]));});});}; \ No newline at end of file +var _0x72da=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72da,0x14d));var _0xa72d=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x72da[_0x3474ac];return _0x5345ec;};'use strict';var _=require(_0xa72d('0x0'));var util=require(_0xa72d('0x1'));var moment=require(_0xa72d('0x2'));var BPromise=require(_0xa72d('0x3'));var rs=require(_0xa72d('0x4'));var fs=require('fs');var Redis=require(_0xa72d('0x5'));var db=require(_0xa72d('0x6'))['db'];var utils=require(_0xa72d('0x7'));var logger=require(_0xa72d('0x8'))('rpc');var config=require(_0xa72d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa72d('0xa')][_0xa72d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5b95,_0x2fa225,_0x3bcdcb){return new BPromise(function(_0x3db818,_0xe1bb1e){return client[_0xa72d('0xc')](_0x3a5b95,_0x3bcdcb)[_0xa72d('0xd')](function(_0x313627){logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x2fa225,_0xa72d('0x10'));logger['debug'](_0xa72d('0x11'),_0x2fa225,'request\x20sent',JSON[_0xa72d('0x12')](_0x313627));if(_0x313627[_0xa72d('0x13')]){if(_0x313627[_0xa72d('0x13')][_0xa72d('0x14')]===0x1f4){logger['error'](_0xa72d('0xf'),_0x2fa225,_0x313627[_0xa72d('0x13')][_0xa72d('0x15')]);return _0xe1bb1e(_0x313627[_0xa72d('0x13')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x2fa225,_0x313627[_0xa72d('0x13')][_0xa72d('0x15')]);return _0x3db818(_0x313627['error'][_0xa72d('0x15')]);}else{logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x2fa225,_0xa72d('0x10'));_0x3db818(_0x313627[_0xa72d('0x16')]['message']);}})[_0xa72d('0x17')](function(_0x20c366){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x2fa225,_0x20c366);_0xe1bb1e(_0x20c366);});});}exports[_0xa72d('0x18')]=function(_0x57594){var _0x5f3fc7=this;return new Promise(function(_0x132f11,_0x2fdf4a){return db['WhatsappQueueReport'][_0xa72d('0x19')](_0x57594[_0xa72d('0x1a')],{'raw':_0x57594[_0xa72d('0x1b')]?_0x57594[_0xa72d('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x478d3c){logger['info'](_0xa72d('0x18'),_0x57594);logger['debug']('CreateWhatsappQueueReport',_0x57594,JSON[_0xa72d('0x12')](_0x478d3c));_0x132f11(_0x478d3c);})['catch'](function(_0x3b10ab){logger[_0xa72d('0x13')](_0xa72d('0x18'),_0x3b10ab['message'],_0x57594);_0x2fdf4a(_0x5f3fc7[_0xa72d('0x13')](0x1f4,_0x3b10ab['message']));});});};exports[_0xa72d('0x1c')]=function(_0xe57a30){var _0x3b16e3=this;return new Promise(function(_0x1599a8,_0x432850){return db[_0xa72d('0x1d')][_0xa72d('0x1e')](_0xe57a30['body'],{'raw':_0xe57a30[_0xa72d('0x1b')]?_0xe57a30[_0xa72d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe57a30[_0xa72d('0x1b')]?_0xe57a30[_0xa72d('0x1b')]['where']||null:null,'attributes':_0xe57a30[_0xa72d('0x1b')]?_0xe57a30[_0xa72d('0x1b')][_0xa72d('0x1f')]||null:null,'limit':_0xe57a30['options']?_0xe57a30[_0xa72d('0x1b')][_0xa72d('0x20')]||null:null})[_0xa72d('0xd')](function(_0x4d3784){logger[_0xa72d('0xe')](_0xa72d('0x1c'),_0xe57a30);logger[_0xa72d('0x21')]('UpdateWhatsappQueueReport',_0xe57a30,JSON['stringify'](_0x4d3784));_0x1599a8(_0x4d3784);})['catch'](function(_0x3cff4a){logger[_0xa72d('0x13')](_0xa72d('0x1c'),_0x3cff4a[_0xa72d('0x15')],_0xe57a30);_0x432850(_0x3b16e3[_0xa72d('0x13')](0x1f4,_0x3cff4a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index fbcbe50..47487b4 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 _0x2a9e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','path'];(function(_0x42760b,_0x4a93f3){var _0x1ca039=function(_0x4418e7){while(--_0x4418e7){_0x42760b['push'](_0x42760b['shift']());}};_0x1ca039(++_0x4a93f3);}(_0x2a9e,0xa1));var _0xe2a9=function(_0x12ca82,_0x3b3684){_0x12ca82=_0x12ca82-0x0;var _0x348a89=_0x2a9e[_0x12ca82];return _0x348a89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2a9('0x0'));var timeout=require(_0xe2a9('0x1'));var express=require(_0xe2a9('0x2'));var router=express['Router']();var fs_extra=require(_0xe2a9('0x3'));var auth=require(_0xe2a9('0x4'));var interaction=require(_0xe2a9('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xe2a9('0x6')]('/',auth[_0xe2a9('0x7')](),controller[_0xe2a9('0x8')]);router[_0xe2a9('0x6')](_0xe2a9('0x9'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xa')]);router[_0xe2a9('0x6')](_0xe2a9('0xb'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xc')]);router[_0xe2a9('0xd')]('/',auth[_0xe2a9('0x7')](),controller[_0xe2a9('0xe')]);router['put'](_0xe2a9('0xb'),auth['isAuthenticated'](),controller[_0xe2a9('0xf')]);router['delete'](_0xe2a9('0xb'),auth[_0xe2a9('0x7')](),controller[_0xe2a9('0x10')]);module[_0xe2a9('0x11')]=router; \ No newline at end of file +var _0x7a10=['Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','exports','multer','util','express'];(function(_0x2e451c,_0xe2d1c4){var _0x3d7088=function(_0x4937ea){while(--_0x4937ea){_0x2e451c['push'](_0x2e451c['shift']());}};_0x3d7088(++_0xe2d1c4);}(_0x7a10,0xe7));var _0x07a1=function(_0x59b182,_0x62b2d3){_0x59b182=_0x59b182-0x0;var _0x283751=_0x7a10[_0x59b182];return _0x283751;};'use strict';var multer=require(_0x07a1('0x0'));var util=require(_0x07a1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x07a1('0x2'));var router=express[_0x07a1('0x3')]();var fs_extra=require(_0x07a1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x07a1('0x5'));var config=require(_0x07a1('0x6'));var controller=require(_0x07a1('0x7'));router['get']('/',auth[_0x07a1('0x8')](),controller[_0x07a1('0x9')]);router['get'](_0x07a1('0xa'),auth[_0x07a1('0x8')](),controller[_0x07a1('0xb')]);router['get']('/:id',auth[_0x07a1('0x8')](),controller[_0x07a1('0xc')]);router[_0x07a1('0xd')]('/',auth['isAuthenticated'](),controller[_0x07a1('0xe')]);router[_0x07a1('0xf')](_0x07a1('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x07a1('0x10'),auth[_0x07a1('0x8')](),controller['destroy']);module[_0x07a1('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 2bcc8c4..eb11adb 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 _0x68b7=['queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x4c1c1b,_0x2414aa){var _0x5c4e2d=function(_0x483447){while(--_0x483447){_0x4c1c1b['push'](_0x4c1c1b['shift']());}};_0x5c4e2d(++_0x2414aa);}(_0x68b7,0x8c));var _0x768b=function(_0x4b54a7,_0x55f457){_0x4b54a7=_0x4b54a7-0x0;var _0xc8ba72=_0x68b7[_0x4b54a7];return _0xc8ba72;};'use strict';var Sequelize=require(_0x768b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x768b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x768b('0x2')](_0x768b('0x3'),'agent',_0x768b('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x768b('0x5')]}}; \ No newline at end of file +var _0x2deb=['ENUM','queue','DATE','sequelize','exports','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb2de('0x0'));module[_0xb2de('0x1')]={'uniqueid':{'type':Sequelize[_0xb2de('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb2de('0x3')]('account','agent',_0xb2de('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb2de('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 0e7eadd..005bdb5 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 _0xd367=['nolimit','order','sort','pick','filter','merge','where','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0xd367,0x1dc));var _0x7d36=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd367[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d36('0x0'));var zipdir=require(_0x7d36('0x1'));var jsonpatch=require(_0x7d36('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d36('0x3'));var Mustache=require(_0x7d36('0x4'));var util=require(_0x7d36('0x5'));var path=require(_0x7d36('0x6'));var sox=require(_0x7d36('0x7'));var csv=require(_0x7d36('0x8'));var ejs=require(_0x7d36('0x9'));var fs=require('fs');var fs_extra=require(_0x7d36('0xa'));var _=require(_0x7d36('0xb'));var squel=require(_0x7d36('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d36('0xd'));var deskjs=require(_0x7d36('0xe'));var toCsv=require(_0x7d36('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7d36('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d36('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d36('0x11'));var logger=require(_0x7d36('0x12'))(_0x7d36('0x13'));var utils=require(_0x7d36('0x14'));var config=require(_0x7d36('0x15'));var licenseUtil=require(_0x7d36('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f460b,_0x239ad5){_0x239ad5=_0x239ad5||0xcc;return function(_0x146b28){if(_0x146b28){return _0x4f460b[_0x7d36('0x17')](_0x239ad5);}return _0x4f460b[_0x7d36('0x18')](_0x239ad5)[_0x7d36('0x19')]();};}function respondWithResult(_0x463f47,_0x4087ac){_0x4087ac=_0x4087ac||0xc8;return function(_0x39e355){if(_0x39e355){return _0x463f47[_0x7d36('0x18')](_0x4087ac)[_0x7d36('0x1a')](_0x39e355);}};}function respondWithFilteredResult(_0x326b72,_0x5ea8b5){return function(_0x451155){if(_0x451155){var _0x81620a=typeof _0x5ea8b5['offset']===_0x7d36('0x1b')&&typeof _0x5ea8b5[_0x7d36('0x1c')]===_0x7d36('0x1b');var _0x2588d3=_0x451155[_0x7d36('0x1d')];var _0x981e0e=_0x81620a?0x0:_0x5ea8b5['offset'];var _0x4248a4=_0x81620a?_0x451155[_0x7d36('0x1d')]:_0x5ea8b5[_0x7d36('0x1e')]+_0x5ea8b5['limit'];var _0x1f27b6;if(_0x4248a4>=_0x2588d3){_0x4248a4=_0x2588d3;_0x1f27b6=0xc8;}else{_0x1f27b6=0xce;}_0x326b72['status'](_0x1f27b6);return _0x326b72[_0x7d36('0x1f')](_0x7d36('0x20'),_0x981e0e+'-'+_0x4248a4+'/'+_0x2588d3)[_0x7d36('0x1a')](_0x451155);}return null;};}function patchUpdates(_0x41da93){return function(_0x8b9465){try{jsonpatch[_0x7d36('0x21')](_0x8b9465,_0x41da93,!![]);}catch(_0x5a8983){return BPromise[_0x7d36('0x22')](_0x5a8983);}return _0x8b9465[_0x7d36('0x23')]();};}function saveUpdates(_0x2dee52,_0x1857fe){return function(_0x3b7225){if(_0x3b7225){return _0x3b7225[_0x7d36('0x24')](_0x2dee52)['then'](function(_0x432f73){return _0x432f73;});}return null;};}function removeEntity(_0x453a0f,_0x217bf6){return function(_0x3a12a2){if(_0x3a12a2){return _0x3a12a2[_0x7d36('0x25')]()[_0x7d36('0x26')](function(){_0x453a0f[_0x7d36('0x18')](0xcc)[_0x7d36('0x19')]();});}};}function handleEntityNotFound(_0xf0a4a8,_0x12afac){return function(_0x140760){if(!_0x140760){_0xf0a4a8[_0x7d36('0x17')](0x194);}return _0x140760;};}function handleError(_0x5c00bb,_0x2e3b3b){_0x2e3b3b=_0x2e3b3b||0x1f4;return function(_0x23e118){logger[_0x7d36('0x27')](_0x23e118['stack']);if(_0x23e118[_0x7d36('0x28')]){delete _0x23e118[_0x7d36('0x28')];}_0x5c00bb['status'](_0x2e3b3b)[_0x7d36('0x29')](_0x23e118);};}exports[_0x7d36('0x2a')]=function(_0x4f3db2,_0x14800f){var _0x19b148={},_0x51abcc={},_0x183367={'count':0x0,'rows':[]};var _0x50ba23=_[_0x7d36('0x2b')](db['WhatsappTransferReport'][_0x7d36('0x2c')],function(_0x3fc101){return{'name':_0x3fc101[_0x7d36('0x2d')],'type':_0x3fc101[_0x7d36('0x2e')][_0x7d36('0x2f')]};});_0x51abcc[_0x7d36('0x30')]=_[_0x7d36('0x2b')](_0x50ba23,_0x7d36('0x28'));_0x51abcc['query']=_[_0x7d36('0x31')](_0x4f3db2['query']);_0x51abcc[_0x7d36('0x32')]=_['intersection'](_0x51abcc[_0x7d36('0x30')],_0x51abcc[_0x7d36('0x33')]);_0x19b148[_0x7d36('0x34')]=_[_0x7d36('0x35')](_0x51abcc[_0x7d36('0x30')],qs['fields'](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x36')]));_0x19b148[_0x7d36('0x34')]=_0x19b148['attributes'][_0x7d36('0x37')]?_0x19b148['attributes']:_0x51abcc['model'];if(!_0x4f3db2['query']['hasOwnProperty'](_0x7d36('0x38'))){_0x19b148[_0x7d36('0x1c')]=qs[_0x7d36('0x1c')](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x1c')]);_0x19b148[_0x7d36('0x1e')]=qs['offset'](_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x1e')]);}_0x19b148[_0x7d36('0x39')]=qs[_0x7d36('0x3a')](_0x4f3db2['query']['sort']);_0x19b148['where']=qs[_0x7d36('0x32')](_[_0x7d36('0x3b')](_0x4f3db2['query'],_0x51abcc[_0x7d36('0x32')]),_0x50ba23);if(_0x4f3db2['query'][_0x7d36('0x3c')]){_0x19b148['where']=_[_0x7d36('0x3d')](_0x19b148[_0x7d36('0x3e')],{'$or':_[_0x7d36('0x2b')](_0x50ba23,function(_0x1456ad){if(_0x1456ad['type']!=='VIRTUAL'){var _0x2b56e2={};_0x2b56e2[_0x1456ad['name']]={'$like':'%'+_0x4f3db2['query']['filter']+'%'};return _0x2b56e2;}})});}_0x19b148=_['merge']({},_0x19b148,_0x4f3db2['options']);var _0x1af717={'where':_0x19b148[_0x7d36('0x3e')]};return db[_0x7d36('0x3f')]['count'](_0x1af717)[_0x7d36('0x26')](function(_0x1c75b1){_0x183367[_0x7d36('0x1d')]=_0x1c75b1;if(_0x4f3db2[_0x7d36('0x33')][_0x7d36('0x40')]){_0x19b148[_0x7d36('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x7d36('0x42')](_0x19b148);})[_0x7d36('0x26')](function(_0x9af18f){_0x183367[_0x7d36('0x43')]=_0x9af18f;return _0x183367;})[_0x7d36('0x26')](respondWithFilteredResult(_0x14800f,_0x19b148))[_0x7d36('0x44')](handleError(_0x14800f,null));};exports[_0x7d36('0x45')]=function(_0x1b246e,_0x5a6a94){var _0x1266f9={'raw':!![],'where':{'id':_0x1b246e[_0x7d36('0x46')]['id']}},_0xe3ae7b={};_0xe3ae7b[_0x7d36('0x30')]=_[_0x7d36('0x31')](db['WhatsappTransferReport'][_0x7d36('0x2c')]);_0xe3ae7b[_0x7d36('0x33')]=_['keys'](_0x1b246e[_0x7d36('0x33')]);_0xe3ae7b[_0x7d36('0x32')]=_[_0x7d36('0x35')](_0xe3ae7b[_0x7d36('0x30')],_0xe3ae7b[_0x7d36('0x33')]);_0x1266f9[_0x7d36('0x34')]=_[_0x7d36('0x35')](_0xe3ae7b['model'],qs[_0x7d36('0x36')](_0x1b246e[_0x7d36('0x33')][_0x7d36('0x36')]));_0x1266f9[_0x7d36('0x34')]=_0x1266f9[_0x7d36('0x34')][_0x7d36('0x37')]?_0x1266f9[_0x7d36('0x34')]:_0xe3ae7b[_0x7d36('0x30')];if(_0x1b246e[_0x7d36('0x33')][_0x7d36('0x40')]){_0x1266f9[_0x7d36('0x41')]=[{'all':!![]}];}_0x1266f9=_['merge']({},_0x1266f9,_0x1b246e[_0x7d36('0x47')]);return db[_0x7d36('0x3f')][_0x7d36('0x48')](_0x1266f9)[_0x7d36('0x26')](handleEntityNotFound(_0x5a6a94,null))[_0x7d36('0x26')](respondWithResult(_0x5a6a94,null))[_0x7d36('0x44')](handleError(_0x5a6a94,null));};exports['create']=function(_0x4e8a85,_0x3491aa){return db[_0x7d36('0x3f')][_0x7d36('0x49')](_0x4e8a85['body'],{})['then'](respondWithResult(_0x3491aa,0xc9))[_0x7d36('0x44')](handleError(_0x3491aa,null));};exports[_0x7d36('0x24')]=function(_0x1beef3,_0x719cf9){if(_0x1beef3[_0x7d36('0x4a')]['id']){delete _0x1beef3[_0x7d36('0x4a')]['id'];}return db[_0x7d36('0x3f')][_0x7d36('0x48')]({'where':{'id':_0x1beef3[_0x7d36('0x46')]['id']}})[_0x7d36('0x26')](handleEntityNotFound(_0x719cf9,null))[_0x7d36('0x26')](saveUpdates(_0x1beef3[_0x7d36('0x4a')],null))[_0x7d36('0x26')](respondWithResult(_0x719cf9,null))[_0x7d36('0x44')](handleError(_0x719cf9,null));};exports[_0x7d36('0x25')]=function(_0x50a704,_0x175500){return db[_0x7d36('0x3f')][_0x7d36('0x48')]({'where':{'id':_0x50a704[_0x7d36('0x46')]['id']}})[_0x7d36('0x26')](handleEntityNotFound(_0x175500,null))[_0x7d36('0x26')](removeEntity(_0x175500,null))[_0x7d36('0x44')](handleError(_0x175500,null));};exports[_0x7d36('0x4b')]=function(_0x3026fc,_0x4c9f2d){return db[_0x7d36('0x3f')]['describe']()[_0x7d36('0x26')](respondWithResult(_0x4c9f2d,null))['catch'](handleError(_0x4c9f2d,null));}; \ No newline at end of file +var _0x75ab=['jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','update','then','destroy','error','name','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x225d42,_0x43de3b){var _0x516ed1=function(_0x29e04c){while(--_0x29e04c){_0x225d42['push'](_0x225d42['shift']());}};_0x516ed1(++_0x43de3b);}(_0x75ab,0x1eb));var _0xb75a=function(_0x92b6f3,_0x3c6e42){_0x92b6f3=_0x92b6f3-0x0;var _0x2a550d=_0x75ab[_0x92b6f3];return _0x2a550d;};'use strict';var emlformat=require(_0xb75a('0x0'));var rimraf=require(_0xb75a('0x1'));var zipdir=require(_0xb75a('0x2'));var jsonpatch=require(_0xb75a('0x3'));var rp=require(_0xb75a('0x4'));var moment=require('moment');var BPromise=require(_0xb75a('0x5'));var Mustache=require('mustache');var util=require(_0xb75a('0x6'));var path=require(_0xb75a('0x7'));var sox=require(_0xb75a('0x8'));var csv=require(_0xb75a('0x9'));var ejs=require(_0xb75a('0xa'));var fs=require('fs');var fs_extra=require(_0xb75a('0xb'));var _=require(_0xb75a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb75a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb75a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb75a('0xe'));var authService=require(_0xb75a('0xf'));var qs=require(_0xb75a('0x10'));var as=require(_0xb75a('0x11'));var hardwareService=require(_0xb75a('0x12'));var logger=require(_0xb75a('0x13'))(_0xb75a('0x14'));var utils=require(_0xb75a('0x15'));var config=require(_0xb75a('0x16'));var licenseUtil=require(_0xb75a('0x17'));var db=require(_0xb75a('0x18'))['db'];function respondWithStatusCode(_0x3d0ea2,_0x908740){_0x908740=_0x908740||0xcc;return function(_0x1516fb){if(_0x1516fb){return _0x3d0ea2[_0xb75a('0x19')](_0x908740);}return _0x3d0ea2['status'](_0x908740)[_0xb75a('0x1a')]();};}function respondWithResult(_0x15193e,_0x932897){_0x932897=_0x932897||0xc8;return function(_0x45d036){if(_0x45d036){return _0x15193e[_0xb75a('0x1b')](_0x932897)[_0xb75a('0x1c')](_0x45d036);}};}function respondWithFilteredResult(_0x52f946,_0x403547){return function(_0x2efdbb){if(_0x2efdbb){var _0x41ff08=typeof _0x403547['offset']===_0xb75a('0x1d')&&typeof _0x403547['limit']==='undefined';var _0x5e563a=_0x2efdbb[_0xb75a('0x1e')];var _0x2c6b6f=_0x41ff08?0x0:_0x403547[_0xb75a('0x1f')];var _0x335492=_0x41ff08?_0x2efdbb['count']:_0x403547[_0xb75a('0x1f')]+_0x403547[_0xb75a('0x20')];var _0x40b0de;if(_0x335492>=_0x5e563a){_0x335492=_0x5e563a;_0x40b0de=0xc8;}else{_0x40b0de=0xce;}_0x52f946['status'](_0x40b0de);return _0x52f946[_0xb75a('0x21')]('Content-Range',_0x2c6b6f+'-'+_0x335492+'/'+_0x5e563a)[_0xb75a('0x1c')](_0x2efdbb);}return null;};}function patchUpdates(_0x1d54d0){return function(_0x5c939f){try{jsonpatch['apply'](_0x5c939f,_0x1d54d0,!![]);}catch(_0x326f64){return BPromise['reject'](_0x326f64);}return _0x5c939f['save']();};}function saveUpdates(_0x315958,_0x5bd9a8){return function(_0x3f6a6b){if(_0x3f6a6b){return _0x3f6a6b[_0xb75a('0x22')](_0x315958)[_0xb75a('0x23')](function(_0x302627){return _0x302627;});}return null;};}function removeEntity(_0x569778,_0x2fc7d1){return function(_0x3baddf){if(_0x3baddf){return _0x3baddf[_0xb75a('0x24')]()[_0xb75a('0x23')](function(){_0x569778['status'](0xcc)[_0xb75a('0x1a')]();});}};}function handleEntityNotFound(_0x394d64,_0x56529f){return function(_0x4cb478){if(!_0x4cb478){_0x394d64[_0xb75a('0x19')](0x194);}return _0x4cb478;};}function handleError(_0x426a,_0x588b66){_0x588b66=_0x588b66||0x1f4;return function(_0x212e1e){logger[_0xb75a('0x25')](_0x212e1e['stack']);if(_0x212e1e[_0xb75a('0x26')]){delete _0x212e1e[_0xb75a('0x26')];}_0x426a['status'](_0x588b66)['send'](_0x212e1e);};}exports[_0xb75a('0x27')]=function(_0x34efce,_0x262d7d){var _0x13363f={},_0x35e8cd={},_0x23e509={'count':0x0,'rows':[]};var _0x29407a=_['map'](db[_0xb75a('0x28')][_0xb75a('0x29')],function(_0x42c750){return{'name':_0x42c750[_0xb75a('0x2a')],'type':_0x42c750[_0xb75a('0x2b')][_0xb75a('0x2c')]};});_0x35e8cd[_0xb75a('0x2d')]=_[_0xb75a('0x2e')](_0x29407a,_0xb75a('0x26'));_0x35e8cd[_0xb75a('0x2f')]=_[_0xb75a('0x30')](_0x34efce['query']);_0x35e8cd[_0xb75a('0x31')]=_[_0xb75a('0x32')](_0x35e8cd[_0xb75a('0x2d')],_0x35e8cd[_0xb75a('0x2f')]);_0x13363f[_0xb75a('0x33')]=_[_0xb75a('0x32')](_0x35e8cd[_0xb75a('0x2d')],qs['fields'](_0x34efce[_0xb75a('0x2f')][_0xb75a('0x34')]));_0x13363f[_0xb75a('0x33')]=_0x13363f[_0xb75a('0x33')][_0xb75a('0x35')]?_0x13363f[_0xb75a('0x33')]:_0x35e8cd[_0xb75a('0x2d')];if(!_0x34efce[_0xb75a('0x2f')]['hasOwnProperty'](_0xb75a('0x36'))){_0x13363f[_0xb75a('0x20')]=qs[_0xb75a('0x20')](_0x34efce['query'][_0xb75a('0x20')]);_0x13363f[_0xb75a('0x1f')]=qs['offset'](_0x34efce[_0xb75a('0x2f')][_0xb75a('0x1f')]);}_0x13363f[_0xb75a('0x37')]=qs[_0xb75a('0x38')](_0x34efce[_0xb75a('0x2f')][_0xb75a('0x38')]);_0x13363f[_0xb75a('0x39')]=qs[_0xb75a('0x31')](_['pick'](_0x34efce[_0xb75a('0x2f')],_0x35e8cd[_0xb75a('0x31')]),_0x29407a);if(_0x34efce[_0xb75a('0x2f')]['filter']){_0x13363f[_0xb75a('0x39')]=_['merge'](_0x13363f[_0xb75a('0x39')],{'$or':_['map'](_0x29407a,function(_0x3b1d38){if(_0x3b1d38[_0xb75a('0x2b')]!==_0xb75a('0x3a')){var _0xe0c6f5={};_0xe0c6f5[_0x3b1d38[_0xb75a('0x26')]]={'$like':'%'+_0x34efce['query'][_0xb75a('0x3b')]+'%'};return _0xe0c6f5;}})});}_0x13363f=_[_0xb75a('0x3c')]({},_0x13363f,_0x34efce['options']);var _0x41c27d={'where':_0x13363f[_0xb75a('0x39')]};return db[_0xb75a('0x28')][_0xb75a('0x1e')](_0x41c27d)[_0xb75a('0x23')](function(_0x5a4c30){_0x23e509[_0xb75a('0x1e')]=_0x5a4c30;if(_0x34efce['query'][_0xb75a('0x3d')]){_0x13363f[_0xb75a('0x3e')]=[{'all':!![]}];}return db[_0xb75a('0x28')][_0xb75a('0x3f')](_0x13363f);})[_0xb75a('0x23')](function(_0x1c2a52){_0x23e509[_0xb75a('0x40')]=_0x1c2a52;return _0x23e509;})[_0xb75a('0x23')](respondWithFilteredResult(_0x262d7d,_0x13363f))[_0xb75a('0x41')](handleError(_0x262d7d,null));};exports['show']=function(_0x3b6909,_0x1a81fe){var _0x13aa1c={'raw':!![],'where':{'id':_0x3b6909[_0xb75a('0x42')]['id']}},_0x47d59a={};_0x47d59a['model']=_[_0xb75a('0x30')](db['WhatsappTransferReport'][_0xb75a('0x29')]);_0x47d59a[_0xb75a('0x2f')]=_[_0xb75a('0x30')](_0x3b6909['query']);_0x47d59a[_0xb75a('0x31')]=_[_0xb75a('0x32')](_0x47d59a[_0xb75a('0x2d')],_0x47d59a[_0xb75a('0x2f')]);_0x13aa1c[_0xb75a('0x33')]=_['intersection'](_0x47d59a[_0xb75a('0x2d')],qs['fields'](_0x3b6909[_0xb75a('0x2f')][_0xb75a('0x34')]));_0x13aa1c['attributes']=_0x13aa1c[_0xb75a('0x33')][_0xb75a('0x35')]?_0x13aa1c['attributes']:_0x47d59a[_0xb75a('0x2d')];if(_0x3b6909[_0xb75a('0x2f')][_0xb75a('0x3d')]){_0x13aa1c[_0xb75a('0x3e')]=[{'all':!![]}];}_0x13aa1c=_[_0xb75a('0x3c')]({},_0x13aa1c,_0x3b6909[_0xb75a('0x43')]);return db['WhatsappTransferReport'][_0xb75a('0x44')](_0x13aa1c)[_0xb75a('0x23')](handleEntityNotFound(_0x1a81fe,null))['then'](respondWithResult(_0x1a81fe,null))[_0xb75a('0x41')](handleError(_0x1a81fe,null));};exports['create']=function(_0x2e372e,_0x379aec){return db[_0xb75a('0x28')][_0xb75a('0x45')](_0x2e372e['body'],{})[_0xb75a('0x23')](respondWithResult(_0x379aec,0xc9))['catch'](handleError(_0x379aec,null));};exports[_0xb75a('0x22')]=function(_0x485de0,_0x55b913){if(_0x485de0[_0xb75a('0x46')]['id']){delete _0x485de0[_0xb75a('0x46')]['id'];}return db[_0xb75a('0x28')][_0xb75a('0x44')]({'where':{'id':_0x485de0['params']['id']}})[_0xb75a('0x23')](handleEntityNotFound(_0x55b913,null))['then'](saveUpdates(_0x485de0[_0xb75a('0x46')],null))[_0xb75a('0x23')](respondWithResult(_0x55b913,null))['catch'](handleError(_0x55b913,null));};exports['destroy']=function(_0x44ac97,_0x932eac){return db[_0xb75a('0x28')][_0xb75a('0x44')]({'where':{'id':_0x44ac97[_0xb75a('0x42')]['id']}})[_0xb75a('0x23')](handleEntityNotFound(_0x932eac,null))['then'](removeEntity(_0x932eac,null))[_0xb75a('0x41')](handleError(_0x932eac,null));};exports[_0xb75a('0x47')]=function(_0x52a683,_0x5b2c71){return db['WhatsappTransferReport'][_0xb75a('0x47')]()[_0xb75a('0x23')](respondWithResult(_0x5b2c71,null))['catch'](handleError(_0x5b2c71,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2bb7280..b72e24b 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 _0x0fd3=['moment','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd3,0x130));var _0x30fd=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x0fd3[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x30fd('0x0'));var util=require(_0x30fd('0x1'));var logger=require(_0x30fd('0x2'))(_0x30fd('0x3'));var moment=require(_0x30fd('0x4'));var BPromise=require('bluebird');var rp=require(_0x30fd('0x5'));var fs=require('fs');var path=require(_0x30fd('0x6'));var rimraf=require(_0x30fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x30fd('0x8'));module[_0x30fd('0x9')]=function(_0x3c823f,_0x5e1e75){return _0x3c823f[_0x30fd('0xa')](_0x30fd('0xb'),attributes,{'tableName':_0x30fd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x30fd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4c7=['define','WhatsappTransferReport','report_whatsapp_transfer','util','api','moment','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xa4c7,0x1a5));var _0x7a4c=function(_0x1b162a,_0x2a709f){_0x1b162a=_0x1b162a-0x0;var _0x747a1a=_0xa4c7[_0x1b162a];return _0x747a1a;};'use strict';var _=require('lodash');var util=require(_0x7a4c('0x0'));var logger=require('../../config/logger')(_0x7a4c('0x1'));var moment=require(_0x7a4c('0x2'));var BPromise=require('bluebird');var rp=require(_0x7a4c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a4c('0x4'));var config=require(_0x7a4c('0x5'));var attributes=require(_0x7a4c('0x6'));module[_0x7a4c('0x7')]=function(_0x46a15f,_0x4644c1){return _0x46a15f[_0x7a4c('0x8')](_0x7a4c('0x9'),attributes,{'tableName':_0x7a4c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 3243aff..52e32e2 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 _0xff8d=['code','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x516050,_0x3558d8){var _0x3589fb=function(_0x38f36d){while(--_0x38f36d){_0x516050['push'](_0x516050['shift']());}};_0x3589fb(++_0x3558d8);}(_0xff8d,0xf5));var _0xdff8=function(_0x54ae30,_0x4f5782){_0x54ae30=_0x54ae30-0x0;var _0x56489c=_0xff8d[_0x54ae30];return _0x56489c;};'use strict';var _=require('lodash');var util=require(_0xdff8('0x0'));var moment=require('moment');var BPromise=require(_0xdff8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdff8('0x2'));var db=require(_0xdff8('0x3'))['db'];var utils=require(_0xdff8('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdff8('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdff8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1f4986,_0x56ca7b,_0x5c7c0a){return new BPromise(function(_0x13d080,_0x4e4892){return client[_0xdff8('0x7')](_0x1f4986,_0x5c7c0a)[_0xdff8('0x8')](function(_0xc61ba6){logger[_0xdff8('0x9')](_0xdff8('0xa'),_0x56ca7b,_0xdff8('0xb'));logger[_0xdff8('0xc')](_0xdff8('0xd'),_0x56ca7b,_0xdff8('0xb'),JSON[_0xdff8('0xe')](_0xc61ba6));if(_0xc61ba6['error']){if(_0xc61ba6['error'][_0xdff8('0xf')]===0x1f4){logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0xc61ba6[_0xdff8('0x10')][_0xdff8('0x11')]);return _0x4e4892(_0xc61ba6[_0xdff8('0x10')][_0xdff8('0x11')]);}logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0xc61ba6['error'][_0xdff8('0x11')]);return _0x13d080(_0xc61ba6[_0xdff8('0x10')]['message']);}else{logger[_0xdff8('0x9')](_0xdff8('0xa'),_0x56ca7b,_0xdff8('0xb'));_0x13d080(_0xc61ba6[_0xdff8('0x12')][_0xdff8('0x11')]);}})[_0xdff8('0x13')](function(_0x2c0e33){logger[_0xdff8('0x10')](_0xdff8('0xa'),_0x56ca7b,_0x2c0e33);_0x4e4892(_0x2c0e33);});});} \ No newline at end of file +var _0xe91c=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','request\x20sent'];(function(_0x3155d0,_0x2ffa38){var _0x405d04=function(_0x4248c5){while(--_0x4248c5){_0x3155d0['push'](_0x3155d0['shift']());}};_0x405d04(++_0x2ffa38);}(_0xe91c,0x198));var _0xce91=function(_0x422a38,_0x44d3be){_0x422a38=_0x422a38-0x0;var _0x22fcc5=_0xe91c[_0x422a38];return _0x22fcc5;};'use strict';var _=require('lodash');var util=require(_0xce91('0x0'));var moment=require(_0xce91('0x1'));var BPromise=require('bluebird');var rs=require(_0xce91('0x2'));var fs=require('fs');var Redis=require(_0xce91('0x3'));var db=require(_0xce91('0x4'))['db'];var utils=require(_0xce91('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xce91('0x6'));var jayson=require(_0xce91('0x7'));var client=jayson[_0xce91('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23cbbb,_0x325585,_0x333bf8){return new BPromise(function(_0x328a75,_0x2dd069){return client[_0xce91('0x9')](_0x23cbbb,_0x333bf8)['then'](function(_0x223dfd){logger[_0xce91('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x325585,_0xce91('0xb'));logger[_0xce91('0xc')](_0xce91('0xd'),_0x325585,_0xce91('0xb'),JSON[_0xce91('0xe')](_0x223dfd));if(_0x223dfd[_0xce91('0xf')]){if(_0x223dfd[_0xce91('0xf')]['code']===0x1f4){logger[_0xce91('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x325585,_0x223dfd[_0xce91('0xf')][_0xce91('0x10')]);return _0x2dd069(_0x223dfd['error']['message']);}logger[_0xce91('0xf')](_0xce91('0x11'),_0x325585,_0x223dfd[_0xce91('0xf')]['message']);return _0x328a75(_0x223dfd[_0xce91('0xf')][_0xce91('0x10')]);}else{logger[_0xce91('0xa')](_0xce91('0x11'),_0x325585,_0xce91('0xb'));_0x328a75(_0x223dfd[_0xce91('0x12')][_0xce91('0x10')]);}})[_0xce91('0x13')](function(_0x1fe96e){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x325585,_0x1fe96e);_0x2dd069(_0x1fe96e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 84eced4..0edd2bb 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9637=['./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB','./config/seedDB','default'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9637,0xc9));var _0x7963=function(_0x3a0885,_0x23d8c6){_0x3a0885=_0x3a0885-0x0;var _0x5d6aa4=_0x9637[_0x3a0885];return _0x5d6aa4;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x7963('0x0'));var config=require('./config/environment');var logger=require(_0x7963('0x1'))('app');var pm2=require(_0x7963('0x2'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7963('0x3'));var chat=require(_0x7963('0x4'));var whatsapp=require(_0x7963('0x5'));var transcribe=require(_0x7963('0x6'));function main(){return mysqldb['db']['sequelize'][_0x7963('0x7')]()[_0x7963('0x8')](function(){return rpc['listen']();})['then'](function(_0xa15078){logger[_0x7963('0x9')](_0xa15078);return chat['start']();})['then'](function(){return whatsapp[_0x7963('0xa')]();})[_0x7963('0x8')](function(){return schedule['start']();})[_0x7963('0x8')](function(){return transcribe[_0x7963('0xa')]();})[_0x7963('0x8')](function(_0x288340){logger[_0x7963('0x9')](_0x288340);return pm2['start'](pm2Config);})[_0x7963('0x8')](function(_0x533887){logger['info'](_0x7963('0xb'),_[_0x7963('0xc')](_[_0x7963('0xd')](_0x533887,{'status':_0x7963('0xe')}),'name')[_0x7963('0xf')]());logger[_0x7963('0x9')](_0x7963('0x10'),_[_0x7963('0xc')](_['filter'](_0x533887,function(_0x2978aa){return _0x2978aa[_0x7963('0x11')]!==_0x7963('0xe');}),_0x7963('0x12'))[_0x7963('0xf')]()||_0x7963('0x13'));config[_0x7963('0x14')]&&require(_0x7963('0x15'))[_0x7963('0x16')]();require(_0x7963('0x17'))[_0x7963('0x16')]();})[_0x7963('0x18')](function(_0x1f5540){logger[_0x7963('0x19')](_0x7963('0x1a'),_0x1f5540);process[_0x7963('0x1b')](0x1);});}main(); \ No newline at end of file +var _0xf8c8=['then','info','start','Online\x20apps:','map','filter','online','join','None','./config/license','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize'];(function(_0x93113,_0x3a7eae){var _0x574624=function(_0x448293){while(--_0x448293){_0x93113['push'](_0x93113['shift']());}};_0x574624(++_0x3a7eae);}(_0xf8c8,0x176));var _0x8f8c=function(_0x1aa335,_0x13a0c0){_0x1aa335=_0x1aa335-0x0;var _0x2c63f9=_0xf8c8[_0x1aa335];return _0x2c63f9;};'use strict';var _=require(_0x8f8c('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x8f8c('0x1'));var config=require(_0x8f8c('0x2'));var logger=require(_0x8f8c('0x3'))(_0x8f8c('0x4'));var pm2=require(_0x8f8c('0x5'));var pm2Config=require(_0x8f8c('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x8f8c('0x7'));var transcribe=require(_0x8f8c('0x8'));function main(){return mysqldb['db'][_0x8f8c('0x9')]['sync']()[_0x8f8c('0xa')](function(){return rpc['listen']();})[_0x8f8c('0xa')](function(_0x1037c7){logger[_0x8f8c('0xb')](_0x1037c7);return chat[_0x8f8c('0xc')]();})[_0x8f8c('0xa')](function(){return whatsapp[_0x8f8c('0xc')]();})[_0x8f8c('0xa')](function(){return schedule['start']();})[_0x8f8c('0xa')](function(){return transcribe[_0x8f8c('0xc')]();})[_0x8f8c('0xa')](function(_0x1947ae){logger[_0x8f8c('0xb')](_0x1947ae);return pm2[_0x8f8c('0xc')](pm2Config);})[_0x8f8c('0xa')](function(_0x31027f){logger['info'](_0x8f8c('0xd'),_[_0x8f8c('0xe')](_[_0x8f8c('0xf')](_0x31027f,{'status':_0x8f8c('0x10')}),'name')[_0x8f8c('0x11')]());logger[_0x8f8c('0xb')]('Offline\x20apps:',_[_0x8f8c('0xe')](_[_0x8f8c('0xf')](_0x31027f,function(_0x429c33){return _0x429c33['status']!==_0x8f8c('0x10');}),'name')['join']()||_0x8f8c('0x12'));config['seedDB']&&require('./config/seedDB')['default']();require(_0x8f8c('0x13'))[_0x8f8c('0x14')]();})['catch'](function(_0x3433a0){logger[_0x8f8c('0x15')](_0x8f8c('0x16'),_0x3433a0);process[_0x8f8c('0x17')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6a76eae..b527d52 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 _0xd2de=['phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','params','closed','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','Basic','User','find','then','pass','status','user','startsWith','Unknown\x20authorization\x20format','getUuid','apikey','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','canUpdate','getLicense','update','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','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.','ValidationError','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','moment','secrets','role','fullname','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias'];(function(_0x21383b,_0x5158af){var _0x1e55ed=function(_0x3bbc5d){while(--_0x3bbc5d){_0x21383b['push'](_0x21383b['shift']());}};_0x1e55ed(++_0x5158af);}(_0xd2de,0x65));var _0xed2d=function(_0x3b92a4,_0x5be1f8){_0x3b92a4=_0x3b92a4-0x0;var _0x427b2c=_0xd2de[_0x3b92a4];return _0x427b2c;};'use strict';var db=require(_0xed2d('0x0'))['db'];var config=require(_0xed2d('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xed2d('0x2'));var _=require('lodash');var jwt=require(_0xed2d('0x3'));var expressJwt=require(_0xed2d('0x4'));var compose=require(_0xed2d('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xed2d('0x6'));var BPromise=require(_0xed2d('0x7'));var util=require('util');var moment=require(_0xed2d('0x8'));var validateJwt=expressJwt({'secret':config[_0xed2d('0x9')]['session']});var userAttributes=['id',_0xed2d('0xa'),_0xed2d('0xb'),'name','internal',_0xed2d('0xc'),_0xed2d('0xd'),_0xed2d('0xe'),_0xed2d('0xf'),_0xed2d('0x10'),_0xed2d('0x11'),_0xed2d('0x12'),_0xed2d('0x13'),'smsPause',_0xed2d('0x14'),_0xed2d('0x15'),_0xed2d('0x16'),_0xed2d('0x17'),_0xed2d('0x18'),_0xed2d('0x19'),_0xed2d('0x1a'),_0xed2d('0x1b'),_0xed2d('0x1c'),'phoneBarAutoAnswer',_0xed2d('0x1d'),_0xed2d('0x1e'),_0xed2d('0x1f'),_0xed2d('0x20'),_0xed2d('0x21'),_0xed2d('0x22'),_0xed2d('0x23'),_0xed2d('0x24'),_0xed2d('0x25'),_0xed2d('0x26'),_0xed2d('0x27'),_0xed2d('0x28'),_0xed2d('0x29'),_0xed2d('0x2a'),'wssPort',_0xed2d('0x2b'),_0xed2d('0x2c'),_0xed2d('0x2d')];exports[_0xed2d('0x2e')]=function(){return this[_0xed2d('0x2f')](!![])[_0xed2d('0x30')](function(_0x2d0d5b,_0x30deca,_0x2f321f){if(_0x2d0d5b['user']){_0x2f321f();}else{return db[_0xed2d('0x31')]['findOne']({'where':{'id':_0x2d0d5b[_0xed2d('0x32')]['id']},'attributes':['id',_0xed2d('0x33'),_0xed2d('0x34')],'raw':!![]})['then'](function(_0x4459b5){if(_0x4459b5&&_0x4459b5[_0xed2d('0x33')]){return _0x30deca['status'](_0x4459b5['disposition']===_0xed2d('0x35')?0x195:0x193)[_0xed2d('0x36')]({'message':_0x4459b5['disposition']===_0xed2d('0x35')?'Unmanaged.':_0xed2d('0x37')});}else{_0x2f321f();}})[_0xed2d('0x38')](function(_0x318410){_0x2f321f(_0x318410);});}});};exports[_0xed2d('0x2f')]=function isAuthenticated(_0x15b878){return compose()[_0xed2d('0x30')](function(_0x460f99,_0xdb84d0,_0x14dbc1){var _0x50d5f7;if(_0x460f99[_0xed2d('0x39')][_0xed2d('0x3a')]){if(_['startsWith'](_0x460f99[_0xed2d('0x39')][_0xed2d('0x3a')],_0xed2d('0x3b'))){var _0x5b19d2=basicAuth(_0x460f99);db[_0xed2d('0x3c')][_0xed2d('0x3d')]({'where':{'name':_0x5b19d2['name']}})[_0xed2d('0x3e')](function(_0x2c1034){if(!_0x2c1034||!_0x2c1034['authenticate'](_0x5b19d2[_0xed2d('0x3f')])){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':'Wrong\x20credentials.'});}_0x460f99[_0xed2d('0x41')]={'id':_0x2c1034['id']};_0x14dbc1();})[_0xed2d('0x38')](function(_0x22afee){_0x14dbc1(_0x22afee);});}else if(_[_0xed2d('0x42')](_0x460f99[_0xed2d('0x39')]['authorization'],'Bearer')){validateJwt(_0x460f99,_0xdb84d0,_0x14dbc1);}else{if(_0x15b878){_0x14dbc1();}else{return _0xdb84d0['status'](0x193)['json']({'message':_0xed2d('0x43')});}}}else if(_0x460f99['query']['apikey']){try{var _0x5b0e0b={'audience':hardwareConf[_0xed2d('0x44')](),'issuer':hardwareConf[_0xed2d('0x44')]()};verifyJwt(_0x460f99['query'][_0xed2d('0x45')],_0x5b0e0b)[_0xed2d('0x3e')](function(_0x65406c){return db[_0xed2d('0x3c')][_0xed2d('0x3d')]({'where':{'id':_0x65406c[_0xed2d('0x46')]}})[_0xed2d('0x3e')](function(_0x26dcd9){_0x50d5f7=_0x26dcd9;return db[_0xed2d('0x47')][_0xed2d('0x48')]({'where':{'id':0x1},'attributes':[_0xed2d('0x49'),_0xed2d('0x4a')],'raw':!![]});})[_0xed2d('0x3e')](function(_0x4176c6){if(!_0x50d5f7||!_[_0xed2d('0x4b')](_0x50d5f7[_0xed2d('0x4c')],_0x65406c[_0xed2d('0x4d')])){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x4e')});}if(_0x50d5f7[_0xed2d('0x4f')]){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});}if(_0x50d5f7[_0xed2d('0x51')]){if(_0x4176c6[_0xed2d('0x4a')]>0x0){if(moment(_0x50d5f7[_0xed2d('0x52')])[_0xed2d('0x53')](_0x4176c6[_0xed2d('0x4a')],'minutes')>moment()){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});}}else{return _0xdb84d0[_0xed2d('0x40')](0x191)['json']({'message':_0xed2d('0x50')});}}_0x460f99[_0xed2d('0x41')]={'id':_0x50d5f7['id']};_0x14dbc1();});})['catch'](function(){return _0xdb84d0[_0xed2d('0x40')](0x191)[_0xed2d('0x36')]({'message':_0xed2d('0x50')});});}catch(_0x364e29){_0x14dbc1(_0x364e29);}}else if(_0x15b878){_0x14dbc1();}else{return _0xdb84d0[_0xed2d('0x40')](0x193)[_0xed2d('0x36')]({'message':_0xed2d('0x43')});}})[_0xed2d('0x30')](function(_0x350758,_0xe542bc,_0x5b66fa){if(_0x350758['user']){db['User'][_0xed2d('0x3d')]({'where':{'id':_0x350758[_0xed2d('0x41')]['id']},'attributes':userAttributes})[_0xed2d('0x3e')](function(_0x69b0a8){if(!_0x69b0a8){return _0xe542bc['status'](0x194)['json']({'message':'User\x20not\x20found.'});}_0x350758[_0xed2d('0x41')]=_0x69b0a8;_0x5b66fa();})[_0xed2d('0x38')](function(_0x356da5){_0x5b66fa(_0x356da5);});}else if(_0x15b878){_0x5b66fa();}else{return _0xe542bc[_0xed2d('0x40')](0x194)[_0xed2d('0x36')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xed2d('0x54')]=function canUpdate(){return compose()[_0xed2d('0x30')](function(_0x5ed954,_0xa40e1c,_0x217c12){return licenseUtil[_0xed2d('0x55')]()['then'](function(_0x4c42e9){if(_0x4c42e9[_0xed2d('0x56')]){_0x217c12();}else{return _0xa40e1c['status'](0x193)[_0xed2d('0x36')]({'message':'Forbidden'});}})[_0xed2d('0x38')](function(_0x9900d5){_0x217c12(_0x9900d5);});});};exports[_0xed2d('0x57')]=function(_0x77843e,_0x55e7e8,_0x37ff6b){_0x77843e[_0xed2d('0x57')]=!![];return _0x37ff6b();};exports[_0xed2d('0x58')]=function signToken(_0x679253){return signJwt(_0x679253);};exports['setTokenCookie']=function(_0x543451,_0x438a65){if(!_0x543451['user']){return _0x438a65[_0xed2d('0x40')](0x194)[_0xed2d('0x36')]({'message':_0xed2d('0x59')});}var _0x2497b6={'payload':{'id':_0x543451['user']['id'],'role':_0x543451[_0xed2d('0x41')][_0xed2d('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2497b6)[_0xed2d('0x3e')](function(_0xb5aca2){_0x438a65[_0xed2d('0x5a')](_0xed2d('0x5b'),_0xb5aca2);_0x438a65['redirect'](_0xed2d('0x5c'));})[_0xed2d('0x38')](function(_0x146d52){return _0x438a65['status'](0x1f4)[_0xed2d('0x5d')](_0x146d52);});};exports[_0xed2d('0x5e')]=function(_0x232049){if(_[_0xed2d('0x5f')](_0x232049[_0xed2d('0x4c')])||_[_0xed2d('0x5f')](_0x232049[_0xed2d('0x60')])){return null;}else{return createJwt(_0x232049);}};exports[_0xed2d('0x61')]=function(_0x554f7c){_0x554f7c[_0xed2d('0x4c')]=generateNonce();_0x554f7c[_0xed2d('0x60')]=generateIssuedAt();return createJwt(_0x554f7c);};exports[_0xed2d('0x62')]=function(_0x40684a,_0x45a79b){var _0x12a7a1=_0x40684a[_0xed2d('0x63')][_0xed2d('0x45')];if(_0x12a7a1){var _0x22272f={'nonce':_0x45a79b['apiKeyNonce'],'iat':_0x45a79b[_0xed2d('0x60')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xed2d('0x44')]()};return verifyJwt(_0x12a7a1,_0x22272f)[_0xed2d('0x3e')](function(){return generateApiKey(_0x45a79b);});}else{throw{'message':_0xed2d('0x64')};}};exports[_0xed2d('0x65')]=function(_0x47e7d7){var _0x597541=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x597541['test'](_0x47e7d7))throw new db[(_0xed2d('0x66'))]['ValidationError'](_0xed2d('0x67'));return;};exports[_0xed2d('0x68')]=function(_0x989ac5,_0xb501e,_0x5e3530){var _0x243bf7=encryptor['decryptString'](_0xb501e)[_0xed2d('0x69')](',');for(var _0x3c2183=0x0;_0x3c2183<_0x5e3530;_0x3c2183++){if(!_0x243bf7[_0x3c2183])break;if(_0x989ac5[_0xed2d('0x6a')]()===_0x243bf7[_0x3c2183][_0xed2d('0x6a')]()){var _0x1c7edb=util['format'](_0xed2d('0x6b'),_0x5e3530);if(_0x5e3530===0x1){_0x1c7edb=_0xed2d('0x6c');}throw new db['Sequelize'][(_0xed2d('0x6d'))](_0x1c7edb);}}return;};exports[_0xed2d('0x6e')]=function(_0x1453b4,_0x3d4a7f){var _0x4ead9b=_0x3d4a7f?encryptor[_0xed2d('0x6f')](_0x3d4a7f)[_0xed2d('0x69')](','):[];if(_0x4ead9b[_0xed2d('0x70')]===0x5){_0x4ead9b[_0xed2d('0x71')](-0x1,0x1);}_0x4ead9b[_0xed2d('0x72')](_0x1453b4);return encryptor[_0xed2d('0x73')](_0x4ead9b[_0xed2d('0x74')](','));};function signJwt(_0x1d697a){var _0x5d0cd2=BPromise[_0xed2d('0x75')](jwt[_0xed2d('0x76')],{'context':jwt});var _0x31d6d0=_0x1d697a[_0xed2d('0x77')]||config['secrets'][_0xed2d('0x78')];return new BPromise(function(_0x9a472f,_0x2d9c47){_0x5d0cd2(_0x1d697a[_0xed2d('0x79')],_0x31d6d0,_0x1d697a[_0xed2d('0x7a')])['then'](function(_0x5b22ea){_0x9a472f(_0x5b22ea);})[_0xed2d('0x38')](function(_0x4f0641){_0x2d9c47(_0x4f0641);});});}function verifyJwt(_0x35f082,_0x122fe1,_0x5a3946){var _0x1abe0c=BPromise[_0xed2d('0x75')](jwt[_0xed2d('0x7b')],{'context':jwt});var _0x57cdda=_0x5a3946||config['secrets']['session'];return new BPromise(function(_0x419bf0,_0x4b1bbf){_0x1abe0c(_0x35f082,_0x57cdda,_0x122fe1)[_0xed2d('0x3e')](function(_0x450ae5){_0x419bf0(_0x450ae5);})[_0xed2d('0x38')](function(_0x4d27b3){_0x4b1bbf(_0x4d27b3);});});}function generateNonce(){return crypto[_0xed2d('0x7c')](0x10)[_0xed2d('0x7d')](_0xed2d('0x7e'));}function generateIssuedAt(){return Math[_0xed2d('0x7f')](Date[_0xed2d('0x80')]()/0x3e8)[_0xed2d('0x7d')]();}function createJwt(_0x128cf2){var _0x3d242a={'payload':{'iat':_0x128cf2[_0xed2d('0x60')],'nonce':_0x128cf2[_0xed2d('0x4c')]},'options':{'algorithm':_0xed2d('0x81'),'subject':_0x128cf2['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xed2d('0x44')]()}};return signJwt(_0x3d242a)[_0xed2d('0x3e')](function(_0x2527fb){return{'iat':_0x128cf2[_0xed2d('0x60')],'nonce':_0x128cf2['apiKeyNonce'],'token':_0x2527fb};});} \ No newline at end of file +var _0x856e=['phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','use','user','ChatInteraction','findOne','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','authorization','startsWith','headers','Basic','User','find','authenticate','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','blockDuration','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','redirect','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','secrets','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings'];(function(_0x4441cf,_0x4509a6){var _0x3b8877=function(_0x3f3a17){while(--_0x3f3a17){_0x4441cf['push'](_0x4441cf['shift']());}};_0x3b8877(++_0x4509a6);}(_0x856e,0xd2));var _0xe856=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0x856e[_0x39d39d];return _0x577ac3;};'use strict';var db=require(_0xe856('0x0'))['db'];var config=require(_0xe856('0x1'));var hardwareConf=require(_0xe856('0x2'));var licenseUtil=require(_0xe856('0x3'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0xe856('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xe856('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xe856('0x6'));var BPromise=require(_0xe856('0x7'));var util=require(_0xe856('0x8'));var moment=require(_0xe856('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xe856('0xa')]});var userAttributes=['id','role',_0xe856('0xb'),_0xe856('0xc'),_0xe856('0xd'),_0xe856('0xe'),'userpic',_0xe856('0xf'),'md5secret',_0xe856('0x10'),_0xe856('0x11'),_0xe856('0x12'),_0xe856('0x13'),_0xe856('0x14'),_0xe856('0x15'),_0xe856('0x16'),_0xe856('0x17'),'lastLoginAt',_0xe856('0x18'),_0xe856('0x19'),'allowmessenger',_0xe856('0x1a'),_0xe856('0x1b'),_0xe856('0x1c'),_0xe856('0x1d'),_0xe856('0x1e'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0xe856('0x1f'),'phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl',_0xe856('0x20'),_0xe856('0x21'),_0xe856('0x22'),_0xe856('0x23'),_0xe856('0x24'),_0xe856('0x25'),_0xe856('0x26'),'downloadVoiceRecordings',_0xe856('0x27'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xe856('0x28')](function(_0xa2ba57,_0x72d74d,_0x37dc77){if(_0xa2ba57[_0xe856('0x29')]){_0x37dc77();}else{return db[_0xe856('0x2a')][_0xe856('0x2b')]({'where':{'id':_0xa2ba57['params']['id']},'attributes':['id',_0xe856('0x2c'),_0xe856('0x2d')],'raw':!![]})[_0xe856('0x2e')](function(_0x22edf8){if(_0x22edf8&&_0x22edf8[_0xe856('0x2c')]){return _0x72d74d[_0xe856('0x2f')](_0x22edf8[_0xe856('0x2d')]==='unmanaged'?0x195:0x193)[_0xe856('0x30')]({'message':_0x22edf8[_0xe856('0x2d')]===_0xe856('0x31')?_0xe856('0x32'):_0xe856('0x33')});}else{_0x37dc77();}})[_0xe856('0x34')](function(_0xce4afb){_0x37dc77(_0xce4afb);});}});};exports[_0xe856('0x35')]=function isAuthenticated(_0x3f61ad){return compose()['use'](function(_0xd3bb91,_0x35f107,_0x5e5a66){var _0x36aeae;if(_0xd3bb91['headers'][_0xe856('0x36')]){if(_[_0xe856('0x37')](_0xd3bb91[_0xe856('0x38')][_0xe856('0x36')],_0xe856('0x39'))){var _0x58e3d4=basicAuth(_0xd3bb91);db[_0xe856('0x3a')][_0xe856('0x3b')]({'where':{'name':_0x58e3d4[_0xe856('0xc')]}})[_0xe856('0x2e')](function(_0x45efde){if(!_0x45efde||!_0x45efde[_0xe856('0x3c')](_0x58e3d4['pass'])){return _0x35f107[_0xe856('0x2f')](0x191)[_0xe856('0x30')]({'message':'Wrong\x20credentials.'});}_0xd3bb91[_0xe856('0x29')]={'id':_0x45efde['id']};_0x5e5a66();})[_0xe856('0x34')](function(_0x3c5d67){_0x5e5a66(_0x3c5d67);});}else if(_[_0xe856('0x37')](_0xd3bb91['headers']['authorization'],'Bearer')){validateJwt(_0xd3bb91,_0x35f107,_0x5e5a66);}else{if(_0x3f61ad){_0x5e5a66();}else{return _0x35f107[_0xe856('0x2f')](0x193)[_0xe856('0x30')]({'message':_0xe856('0x3d')});}}}else if(_0xd3bb91[_0xe856('0x3e')][_0xe856('0x3f')]){try{var _0x49e9bd={'audience':hardwareConf[_0xe856('0x40')](),'issuer':hardwareConf[_0xe856('0x40')]()};verifyJwt(_0xd3bb91[_0xe856('0x3e')][_0xe856('0x3f')],_0x49e9bd)[_0xe856('0x2e')](function(_0x8f4f00){return db[_0xe856('0x3a')][_0xe856('0x3b')]({'where':{'id':_0x8f4f00[_0xe856('0x41')]}})[_0xe856('0x2e')](function(_0x3b8231){_0x36aeae=_0x3b8231;return db[_0xe856('0x42')]['findOne']({'where':{'id':0x1},'attributes':[_0xe856('0x43'),'blockDuration'],'raw':!![]});})[_0xe856('0x2e')](function(_0x319ae2){if(!_0x36aeae||!_[_0xe856('0x44')](_0x36aeae[_0xe856('0x45')],_0x8f4f00[_0xe856('0x46')])){return _0x35f107[_0xe856('0x2f')](0x191)[_0xe856('0x30')]({'message':_0xe856('0x47')});}if(_0x36aeae[_0xe856('0x48')]){return _0x35f107[_0xe856('0x2f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x36aeae['blocked']){if(_0x319ae2['blockDuration']>0x0){if(moment(_0x36aeae[_0xe856('0x49')])[_0xe856('0x4a')](_0x319ae2[_0xe856('0x4b')],'minutes')>moment()){return _0x35f107['status'](0x191)[_0xe856('0x30')]({'message':_0xe856('0x4c')});}}else{return _0x35f107[_0xe856('0x2f')](0x191)[_0xe856('0x30')]({'message':_0xe856('0x4c')});}}_0xd3bb91['user']={'id':_0x36aeae['id']};_0x5e5a66();});})['catch'](function(){return _0x35f107[_0xe856('0x2f')](0x191)[_0xe856('0x30')]({'message':_0xe856('0x4c')});});}catch(_0x420ab7){_0x5e5a66(_0x420ab7);}}else if(_0x3f61ad){_0x5e5a66();}else{return _0x35f107[_0xe856('0x2f')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x476b10,_0x58a017,_0x22d4b0){if(_0x476b10[_0xe856('0x29')]){db[_0xe856('0x3a')][_0xe856('0x3b')]({'where':{'id':_0x476b10[_0xe856('0x29')]['id']},'attributes':userAttributes})['then'](function(_0x444d2a){if(!_0x444d2a){return _0x58a017[_0xe856('0x2f')](0x194)[_0xe856('0x30')]({'message':_0xe856('0x4d')});}_0x476b10[_0xe856('0x29')]=_0x444d2a;_0x22d4b0();})[_0xe856('0x34')](function(_0x440b73){_0x22d4b0(_0x440b73);});}else if(_0x3f61ad){_0x22d4b0();}else{return _0x58a017[_0xe856('0x2f')](0x194)[_0xe856('0x30')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xe856('0x4e')]=function canUpdate(){return compose()[_0xe856('0x28')](function(_0x4c0687,_0x58d43f,_0x5377da){return licenseUtil[_0xe856('0x4f')]()[_0xe856('0x2e')](function(_0x1a63aa){if(_0x1a63aa[_0xe856('0x50')]){_0x5377da();}else{return _0x58d43f[_0xe856('0x2f')](0x193)[_0xe856('0x30')]({'message':_0xe856('0x51')});}})[_0xe856('0x34')](function(_0x1d267d){_0x5377da(_0x1d267d);});});};exports['isMiddleware']=function(_0x544d4a,_0x4c3f65,_0x19b1d2){_0x544d4a['isMiddleware']=!![];return _0x19b1d2();};exports[_0xe856('0x52')]=function signToken(_0x1b3810){return signJwt(_0x1b3810);};exports[_0xe856('0x53')]=function(_0x3337b1,_0x5607e0){if(!_0x3337b1[_0xe856('0x29')]){return _0x5607e0[_0xe856('0x2f')](0x194)[_0xe856('0x30')]({'message':_0xe856('0x54')});}var _0x48324d={'payload':{'id':_0x3337b1[_0xe856('0x29')]['id'],'role':_0x3337b1['user'][_0xe856('0x55')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48324d)[_0xe856('0x2e')](function(_0x39eedb){_0x5607e0['cookie'](_0xe856('0x56'),_0x39eedb);_0x5607e0[_0xe856('0x57')]('/dashboards/general');})[_0xe856('0x34')](function(_0x18846e){return _0x5607e0['status'](0x1f4)['send'](_0x18846e);});};exports[_0xe856('0x58')]=function(_0x505586){if(_[_0xe856('0x59')](_0x505586[_0xe856('0x45')])||_['isNil'](_0x505586[_0xe856('0x5a')])){return null;}else{return createJwt(_0x505586);}};exports[_0xe856('0x5b')]=function(_0x8efa83){_0x8efa83[_0xe856('0x45')]=generateNonce();_0x8efa83['apiKeyIat']=generateIssuedAt();return createJwt(_0x8efa83);};exports['regenerateApiKey']=function(_0x3ea49f,_0x582cd8){var _0x6d5d4f=_0x3ea49f[_0xe856('0x3e')]['apikey'];if(_0x6d5d4f){var _0x3b3083={'nonce':_0x582cd8[_0xe856('0x45')],'iat':_0x582cd8[_0xe856('0x5a')],'audience':hardwareConf[_0xe856('0x40')](),'issuer':hardwareConf[_0xe856('0x40')]()};return verifyJwt(_0x6d5d4f,_0x3b3083)[_0xe856('0x2e')](function(){return generateApiKey(_0x582cd8);});}else{throw{'message':_0xe856('0x5c')};}};exports['validatePasswordPattern']=function(_0x11df66){var _0x376eef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x376eef[_0xe856('0x5d')](_0x11df66))throw new db['Sequelize'][(_0xe856('0x5e'))](_0xe856('0x5f'));return;};exports[_0xe856('0x60')]=function(_0x2506fd,_0x78f00,_0x3b66bd){var _0x4868c2=encryptor[_0xe856('0x61')](_0x78f00)[_0xe856('0x62')](',');for(var _0x290f16=0x0;_0x290f16<_0x3b66bd;_0x290f16++){if(!_0x4868c2[_0x290f16])break;if(_0x2506fd[_0xe856('0x63')]()===_0x4868c2[_0x290f16]['toLowerCase']()){var _0x5badb8=util[_0xe856('0x64')](_0xe856('0x65'),_0x3b66bd);if(_0x3b66bd===0x1){_0x5badb8=_0xe856('0x66');}throw new db[(_0xe856('0x67'))][(_0xe856('0x5e'))](_0x5badb8);}}return;};exports[_0xe856('0x68')]=function(_0x57f86c,_0xabeeab){var _0x2ca242=_0xabeeab?encryptor[_0xe856('0x61')](_0xabeeab)[_0xe856('0x62')](','):[];if(_0x2ca242[_0xe856('0x69')]===0x5){_0x2ca242[_0xe856('0x6a')](-0x1,0x1);}_0x2ca242[_0xe856('0x6b')](_0x57f86c);return encryptor[_0xe856('0x6c')](_0x2ca242[_0xe856('0x6d')](','));};function signJwt(_0x181407){var _0x3550fc=BPromise[_0xe856('0x6e')](jwt[_0xe856('0x6f')],{'context':jwt});var _0x1b7b11=_0x181407[_0xe856('0x70')]||config['secrets'][_0xe856('0xa')];return new BPromise(function(_0x2ca556,_0x4b0e0a){_0x3550fc(_0x181407[_0xe856('0x71')],_0x1b7b11,_0x181407[_0xe856('0x72')])['then'](function(_0x414dc0){_0x2ca556(_0x414dc0);})[_0xe856('0x34')](function(_0x214148){_0x4b0e0a(_0x214148);});});}function verifyJwt(_0x573656,_0x18f54c,_0x4056d3){var _0xba52c4=BPromise[_0xe856('0x6e')](jwt['verify'],{'context':jwt});var _0x1bb34b=_0x4056d3||config[_0xe856('0x73')][_0xe856('0xa')];return new BPromise(function(_0x162ce7,_0x3fb96f){_0xba52c4(_0x573656,_0x1bb34b,_0x18f54c)[_0xe856('0x2e')](function(_0x2410b5){_0x162ce7(_0x2410b5);})[_0xe856('0x34')](function(_0xd3a2ad){_0x3fb96f(_0xd3a2ad);});});}function generateNonce(){return crypto[_0xe856('0x74')](0x10)[_0xe856('0x75')](_0xe856('0x76'));}function generateIssuedAt(){return Math[_0xe856('0x77')](Date['now']()/0x3e8)['toString']();}function createJwt(_0xfca3cc){var _0x344a74={'payload':{'iat':_0xfca3cc[_0xe856('0x5a')],'nonce':_0xfca3cc[_0xe856('0x45')]},'options':{'algorithm':_0xe856('0x78'),'subject':_0xfca3cc['id'][_0xe856('0x75')](),'issuer':hardwareConf[_0xe856('0x40')](),'audience':hardwareConf[_0xe856('0x40')]()}};return signJwt(_0x344a74)[_0xe856('0x2e')](function(_0x28ae07){return{'iat':_0xfca3cc[_0xe856('0x5a')],'nonce':_0xfca3cc[_0xe856('0x45')],'token':_0x28ae07};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 2dbcb18..31c44de 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 _0x97cc=['secret','base64','decryptString','utf8','bluebird','../../config/environment','../../config/logger','app','session','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','unlink','decryptFile','createDecipher','close','encryptString'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x97cc,0x14e));var _0xc97c=function(_0x16520c,_0x138df9){_0x16520c=_0x16520c-0x0;var _0x2489cd=_0x97cc[_0x16520c];return _0x2489cd;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xc97c('0x0'));var _=require('lodash');var config=require(_0xc97c('0x1'));var logger=require(_0xc97c('0x2'))(_0xc97c('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xc97c('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc97c('0x5')};if(config[_0xc97c('0x6')]&&config[_0xc97c('0x6')][_0xc97c('0x7')]){var isSupported=isAlgorithmSupported(config[_0xc97c('0x6')][_0xc97c('0x7')]);if(isSupported){fileOptions[_0xc97c('0x7')]=config[_0xc97c('0x6')][_0xc97c('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xc97c('0x6')]['algorithm'],_0xc97c('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x1a4bf6){return AES_SUPPORTED_RX[_0xc97c('0x9')](_0x1a4bf6);}function getSupportedCiphers(){return crypto[_0xc97c('0xa')]()[_0xc97c('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x19c137){return getSupportedCiphers()[_0xc97c('0xc')](_0x19c137)>-0x1;}function combineOptions(_0x4dee43){var _0x59ee09={};for(var _0x473c61 in fileOptions){if(fileOptions[_0xc97c('0xd')](_0x473c61)){_0x59ee09[_0x473c61]=fileOptions[_0x473c61];}}if(_0x4dee43){for(var _0x5dfe75 in _0x4dee43){if(_0x4dee43[_0xc97c('0xd')](_0x5dfe75)){_0x59ee09[_0x5dfe75]=_0x4dee43[_0x5dfe75];}}}return _0x59ee09;}exports[_0xc97c('0xe')]=function(_0x9841e1,_0x2a322b,_0x249930,_0x14da37){return new BPromise(function(_0x4f41b9,_0x373e40){_0x14da37=combineOptions(_0x14da37);var _0x55490e=new Buffer(_0x249930);var _0x3f44aa=fs[_0xc97c('0xf')](_0x9841e1);var _0x2b203b=fs[_0xc97c('0x10')](_0x2a322b);var _0xbe34f0=crypto[_0xc97c('0x11')](_0x14da37[_0xc97c('0x7')],_0x55490e);_0x3f44aa['on'](_0xc97c('0x12'),function(_0x19682){var _0x24be24=new Buffer(_0xbe34f0[_0xc97c('0x13')](_0x19682),_0xc97c('0x14'));_0x2b203b[_0xc97c('0x15')](_0x24be24);});_0x3f44aa['on'](_0xc97c('0x16'),function(){try{var _0x4a6d76=new Buffer(_0xbe34f0[_0xc97c('0x17')]('binary'),_0xc97c('0x14'));_0x2b203b[_0xc97c('0x15')](_0x4a6d76);_0x2b203b[_0xc97c('0x16')]();_0x2b203b['on']('close',function(){return _0x4f41b9(_0x2a322b);});}catch(_0x244f30){fs[_0xc97c('0x18')](_0x2a322b);return _0x373e40(_0x244f30);}});});};exports[_0xc97c('0x19')]=function(_0x3dcee5,_0x69fb95,_0x16fba7,_0x2dcce0){return new BPromise(function(_0x30e8a5,_0x536b72){_0x2dcce0=combineOptions(_0x2dcce0);var _0xc4da31=new Buffer(_0x16fba7);var _0x198c2d=fs['createReadStream'](_0x3dcee5);var _0x5ff95=fs[_0xc97c('0x10')](_0x69fb95);var _0x281f10=crypto[_0xc97c('0x1a')](_0x2dcce0[_0xc97c('0x7')],_0xc4da31);_0x198c2d['on'](_0xc97c('0x12'),function(_0x13b305){var _0x53792f=new Buffer(_0x281f10['update'](_0x13b305),_0xc97c('0x14'));_0x5ff95[_0xc97c('0x15')](_0x53792f);});_0x198c2d['on'](_0xc97c('0x16'),function(){try{var _0x13b923=new Buffer(_0x281f10['final'](_0xc97c('0x14')),_0xc97c('0x14'));_0x5ff95['write'](_0x13b923);_0x5ff95['end']();_0x5ff95['on'](_0xc97c('0x1b'),function(){return _0x30e8a5(_0x69fb95);});}catch(_0x25beb5){fs[_0xc97c('0x18')](_0x69fb95);return _0x536b72(_0x25beb5);}});});};exports[_0xc97c('0x1c')]=function(_0x45554f,_0xac5b30,_0x1d4aab){var _0x1e9098=_0x1d4aab||stringOptions[_0xc97c('0x7')];var _0x9ee3b5=_0xac5b30||stringOptions[_0xc97c('0x1d')];var _0xe6cd82=crypto[_0xc97c('0x11')](_0x1e9098,_0x9ee3b5);var _0x29bf7b=_0xe6cd82[_0xc97c('0x13')](_0x45554f,'utf8',_0xc97c('0x1e'));_0x29bf7b+=_0xe6cd82['final']('base64');return _0x29bf7b;};exports[_0xc97c('0x1f')]=function(_0x14d324,_0x2beeed,_0x27a382){var _0xbcf9a1=_0x27a382||stringOptions[_0xc97c('0x7')];var _0x620446=_0x2beeed||stringOptions[_0xc97c('0x1d')];var _0x4e7ac4=crypto[_0xc97c('0x1a')](_0xbcf9a1,_0x620446);var _0x205e98=_0x4e7ac4['update'](_0x14d324,_0xc97c('0x1e'),_0xc97c('0x20'));_0x205e98+=_0x4e7ac4[_0xc97c('0x17')]('utf8');return _0x205e98;}; \ No newline at end of file +var _0x46e6=['getCiphers','filter','indexOf','hasOwnProperty','createCipher','data','end','binary','write','close','unlink','decryptFile','createReadStream','createDecipher','final','encryptString','secret','update','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x46e6,0xba));var _0x646e=function(_0x46f0da,_0x6262d5){_0x46f0da=_0x46f0da-0x0;var _0x5244a5=_0x46e6[_0x46f0da];return _0x5244a5;};'use strict';var crypto=require(_0x646e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x646e('0x1'));var config=require(_0x646e('0x2'));var logger=require(_0x646e('0x3'))(_0x646e('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x646e('0x5')]['session'],'algorithm':_0x646e('0x6')};const fileOptions={'algorithm':_0x646e('0x7')};if(config[_0x646e('0x8')]&&config[_0x646e('0x8')][_0x646e('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x646e('0x9')]);if(isSupported){fileOptions[_0x646e('0x9')]=config[_0x646e('0x8')][_0x646e('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x646e('0xa')](',\x20');logger['error'](config['encrypt'][_0x646e('0x9')],_0x646e('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x31081a){return AES_SUPPORTED_RX['test'](_0x31081a);}function getSupportedCiphers(){return crypto[_0x646e('0xc')]()[_0x646e('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x1b4823){return getSupportedCiphers()[_0x646e('0xe')](_0x1b4823)>-0x1;}function combineOptions(_0x539e6b){var _0x1eb037={};for(var _0x517d74 in fileOptions){if(fileOptions['hasOwnProperty'](_0x517d74)){_0x1eb037[_0x517d74]=fileOptions[_0x517d74];}}if(_0x539e6b){for(var _0x46a0cb in _0x539e6b){if(_0x539e6b[_0x646e('0xf')](_0x46a0cb)){_0x1eb037[_0x46a0cb]=_0x539e6b[_0x46a0cb];}}}return _0x1eb037;}exports['encryptFile']=function(_0x5dbb82,_0x36be6d,_0x5f02bf,_0x3a67d0){return new BPromise(function(_0x3074d8,_0x19a231){_0x3a67d0=combineOptions(_0x3a67d0);var _0x41c371=new Buffer(_0x5f02bf);var _0x5b57a1=fs['createReadStream'](_0x5dbb82);var _0x89b66c=fs['createWriteStream'](_0x36be6d);var _0x2810a3=crypto[_0x646e('0x10')](_0x3a67d0['algorithm'],_0x41c371);_0x5b57a1['on'](_0x646e('0x11'),function(_0x565a67){var _0x3a87a1=new Buffer(_0x2810a3['update'](_0x565a67),'binary');_0x89b66c['write'](_0x3a87a1);});_0x5b57a1['on'](_0x646e('0x12'),function(){try{var _0x169731=new Buffer(_0x2810a3['final'](_0x646e('0x13')),_0x646e('0x13'));_0x89b66c[_0x646e('0x14')](_0x169731);_0x89b66c[_0x646e('0x12')]();_0x89b66c['on'](_0x646e('0x15'),function(){return _0x3074d8(_0x36be6d);});}catch(_0x4425d5){fs[_0x646e('0x16')](_0x36be6d);return _0x19a231(_0x4425d5);}});});};exports[_0x646e('0x17')]=function(_0x2d98fc,_0x5e21c3,_0x563f05,_0x54d1ea){return new BPromise(function(_0x5e0aa4,_0x380ba7){_0x54d1ea=combineOptions(_0x54d1ea);var _0x4bcd34=new Buffer(_0x563f05);var _0x138cc1=fs[_0x646e('0x18')](_0x2d98fc);var _0x1f7722=fs['createWriteStream'](_0x5e21c3);var _0x599a66=crypto[_0x646e('0x19')](_0x54d1ea['algorithm'],_0x4bcd34);_0x138cc1['on']('data',function(_0x2456ef){var _0x3ec236=new Buffer(_0x599a66['update'](_0x2456ef),'binary');_0x1f7722[_0x646e('0x14')](_0x3ec236);});_0x138cc1['on']('end',function(){try{var _0x4ccc21=new Buffer(_0x599a66[_0x646e('0x1a')](_0x646e('0x13')),_0x646e('0x13'));_0x1f7722[_0x646e('0x14')](_0x4ccc21);_0x1f7722['end']();_0x1f7722['on'](_0x646e('0x15'),function(){return _0x5e0aa4(_0x5e21c3);});}catch(_0x242282){fs[_0x646e('0x16')](_0x5e21c3);return _0x380ba7(_0x242282);}});});};exports[_0x646e('0x1b')]=function(_0x4563e3,_0x101365,_0x4e256d){var _0x3149f4=_0x4e256d||stringOptions[_0x646e('0x9')];var _0x5eb401=_0x101365||stringOptions[_0x646e('0x1c')];var _0x474feb=crypto['createCipher'](_0x3149f4,_0x5eb401);var _0x47b17a=_0x474feb[_0x646e('0x1d')](_0x4563e3,_0x646e('0x1e'),_0x646e('0x1f'));_0x47b17a+=_0x474feb['final'](_0x646e('0x1f'));return _0x47b17a;};exports[_0x646e('0x20')]=function(_0x3d307f,_0x249855,_0x33b866){var _0x196ed7=_0x33b866||stringOptions[_0x646e('0x9')];var _0x105872=_0x249855||stringOptions[_0x646e('0x1c')];var _0x83837f=crypto[_0x646e('0x19')](_0x196ed7,_0x105872);var _0x4f582c=_0x83837f['update'](_0x3d307f,_0x646e('0x1f'),_0x646e('0x1e'));_0x4f582c+=_0x83837f['final']('utf8');return _0x4f582c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 0178cbc..9b6d56f 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 _0x41da=['push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','length','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','range','isInteger','forEach'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x41da,0x175));var _0xa41d=function(_0x360484,_0x2d14e5){_0x360484=_0x360484-0x0;var _0x461a10=_0x41da[_0x360484];return _0x461a10;};'use strict';var util=require(_0xa41d('0x0'));var path=require(_0xa41d('0x1'));var _=require(_0xa41d('0x2'));var csv=require(_0xa41d('0x3'));var fs=require('fs');var BPromise=require(_0xa41d('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xa41d('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xa41d('0x6')];var logger=require(_0xa41d('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa41d('0x8')][0x3];var PATH=process[_0xa41d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b18d5,_0x52a0e6){var _0x36794b={'status':_0x1b18d5};var _0x4db495={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x52a0e6){_0x36794b[_0xa41d('0x9')]=_0x52a0e6;}return db[_0xa41d('0xa')]['update'](_0x36794b,_0x4db495);}function main(){var _0x30d0e7=0x1388;var _0x571fcd;logger[_0xa41d('0xb')](util[_0xa41d('0xc')](_0xa41d('0xd'),EXTRACTED_REPORT_ID,_0xa41d('0xe')));return db[_0xa41d('0xf')][_0xa41d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa41d('0x11'),'splitSizeCsv']})[_0xa41d('0x12')](function(_0x19187b){if(_0x19187b){_0x571fcd=_0x19187b;_0x30d0e7=_0x571fcd[_0xa41d('0x13')]||0x1388;}})[_0xa41d('0x12')](function(){return dbH[_0xa41d('0x14')]['query'](util[_0xa41d('0xc')](_0xa41d('0x15'),QUERY),{'type':dbH[_0xa41d('0x14')]['QueryTypes']['SELECT']});})['then'](function(_0x16e5c3){if(!_0x16e5c3[0x0][_0xa41d('0x16')]){return analyticExtractedReport(_0xa41d('0x17'));}var _0x21f9b9=[];var _0x3c86fd=0x0;if(_0x571fcd[_0xa41d('0x11')]){if(_0x16e5c3&&_0x16e5c3['length']){var _0x73c9c0=_[_0xa41d('0x18')](_0x16e5c3[0x0][_0xa41d('0x16')]/_0x30d0e7);var _0x2cb1fb=Number[_0xa41d('0x19')](_0x16e5c3[0x0][_0xa41d('0x16')]/_0x30d0e7)?_0x16e5c3[0x0][_0xa41d('0x16')]%_0x30d0e7:0x0;_0x73c9c0[_0xa41d('0x1a')](function(_0x2c5d09){if(_0x2c5d09>0x0){_0x3c86fd+=_0x30d0e7;}_0x21f9b9[_0xa41d('0x1b')](dbH[_0xa41d('0x14')][_0xa41d('0x1c')](util[_0xa41d('0xc')](_0xa41d('0x1d'),QUERY,_0x30d0e7,_0x3c86fd),{'type':dbH['sequelize']['QueryTypes'][_0xa41d('0x1e')]}));});if(_0x2cb1fb>0x0){_0x3c86fd+=_0x30d0e7;_0x21f9b9['push'](dbH['sequelize']['query'](util[_0xa41d('0xc')](_0xa41d('0x1d'),QUERY,_0x2cb1fb,_0x3c86fd),{'type':dbH[_0xa41d('0x14')][_0xa41d('0x1f')][_0xa41d('0x1e')]}));}}}else{_0x21f9b9[_0xa41d('0x1b')](dbH[_0xa41d('0x14')][_0xa41d('0x1c')](QUERY,{'type':dbH['sequelize'][_0xa41d('0x1f')][_0xa41d('0x1e')]}));}var _0x3fbf19=path[_0xa41d('0x20')](PATH);var _0x4fedab=path[_0xa41d('0x21')](PATH,_0xa41d('0x22'));var _0x173359=_0x571fcd[_0xa41d('0x11')]&&_0x21f9b9['length']>0x1;var _0x4629af=[];if(!fs[_0xa41d('0x23')](path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab))&&_0x173359){fs[_0xa41d('0x25')](path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab));}return BPromise[_0xa41d('0x26')](_0x21f9b9,function(_0x1d28f1){_0x4629af['push'](_0x1d28f1);})[_0xa41d('0x12')](function(){for(var _0x5cc634=0x0;_0x5cc634<_0x4629af[_0xa41d('0x27')];_0x5cc634+=0x1){var _0x1d48db;var _0x3cfbde=_0x4629af[_0x5cc634];if(_0x173359){_0x1d48db=path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab,util[_0xa41d('0xc')]('%s%d.%s',_0x4fedab,_0x5cc634,_0xa41d('0x28')));}else{_0x1d48db=path[_0xa41d('0x24')](_0x3fbf19,util[_0xa41d('0xc')](_0xa41d('0x29'),_0x4fedab,_0xa41d('0x28')));}fs[_0xa41d('0x2a')](_0x1d48db,csv(_0x3cfbde));}})['then'](function(){if(_0x173359){return new Promise(function(_0x25f625){zipdir(path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab),{'saveTo':path['join'](_0x3fbf19,util[_0xa41d('0xc')]('%s.%s',_0x4fedab,_0xa41d('0x2b')))},function(_0x4bc8be,_0x168412){rimraf(path[_0xa41d('0x24')](_0x3fbf19,_0x4fedab),function(){});_0x25f625(_0xa41d('0x2c'));});});}})[_0xa41d('0x12')](function(){logger[_0xa41d('0xb')](util['format'](_0xa41d('0x2d'),EXTRACTED_REPORT_ID,_0xa41d('0xe')));return analyticExtractedReport('Completed',_0x173359?util[_0xa41d('0xc')]('%s.%s',_0x4fedab,_0x173359?'zip':_0xa41d('0x28')):null);});})['catch'](function(_0x14b8a9){logger[_0xa41d('0xb')](util[_0xa41d('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0xa41d('0x2e')](_0x14b8a9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa41d('0x2f'));})[_0xa41d('0x30')](function(){process[_0xa41d('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x38e7=['join','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','SELECT','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','dirname','basename','.csv','mkdirSync'];(function(_0x1a2064,_0x1dafd1){var _0x434ca4=function(_0x50763c){while(--_0x50763c){_0x1a2064['push'](_0x1a2064['shift']());}};_0x434ca4(++_0x1dafd1);}(_0x38e7,0x1c1));var _0x738e=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x38e7[_0x5dbb84];return _0x1d6eae;};'use strict';var util=require(_0x738e('0x0'));var path=require(_0x738e('0x1'));var _=require('lodash');var csv=require(_0x738e('0x2'));var fs=require('fs');var BPromise=require(_0x738e('0x3'));var zipdir=require(_0x738e('0x4'));var rimraf=require(_0x738e('0x5'));var db=require(_0x738e('0x6'))['db'];var dbH=require(_0x738e('0x6'))[_0x738e('0x7')];var logger=require('../../config/logger')(_0x738e('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x738e('0x9')][0x2]);var QUERY=process[_0x738e('0x9')][0x3];var PATH=process[_0x738e('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xeaf40b,_0x343587){var _0x42787e={'status':_0xeaf40b};var _0x427f6a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x343587){_0x42787e[_0x738e('0xa')]=_0x343587;}return db['AnalyticExtractedReport'][_0x738e('0xb')](_0x42787e,_0x427f6a);}function main(){var _0xc91f29=0x1388;var _0x3bfa38;logger[_0x738e('0xc')](util[_0x738e('0xd')](_0x738e('0xe'),EXTRACTED_REPORT_ID,_0x738e('0xf')));return db[_0x738e('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x738e('0x11'),_0x738e('0x12')]})[_0x738e('0x13')](function(_0x4ba764){if(_0x4ba764){_0x3bfa38=_0x4ba764;_0xc91f29=_0x3bfa38[_0x738e('0x12')]||0x1388;}})['then'](function(){return dbH[_0x738e('0x14')]['query'](util[_0x738e('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x738e('0x14')]['QueryTypes'][_0x738e('0x15')]});})[_0x738e('0x13')](function(_0x541b4d){if(!_0x541b4d[0x0]['num']){return analyticExtractedReport('Empty');}var _0x226004=[];var _0x28203a=0x0;if(_0x3bfa38[_0x738e('0x11')]){if(_0x541b4d&&_0x541b4d[_0x738e('0x16')]){var _0x596a93=_[_0x738e('0x17')](_0x541b4d[0x0][_0x738e('0x18')]/_0xc91f29);var _0x1446b6=Number[_0x738e('0x19')](_0x541b4d[0x0][_0x738e('0x18')]/_0xc91f29)?_0x541b4d[0x0]['num']%_0xc91f29:0x0;_0x596a93[_0x738e('0x1a')](function(_0x17d8fd){if(_0x17d8fd>0x0){_0x28203a+=_0xc91f29;}_0x226004[_0x738e('0x1b')](dbH[_0x738e('0x14')]['query'](util[_0x738e('0xd')](_0x738e('0x1c'),QUERY,_0xc91f29,_0x28203a),{'type':dbH[_0x738e('0x14')][_0x738e('0x1d')][_0x738e('0x15')]}));});if(_0x1446b6>0x0){_0x28203a+=_0xc91f29;_0x226004['push'](dbH[_0x738e('0x14')][_0x738e('0x1e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1446b6,_0x28203a),{'type':dbH[_0x738e('0x14')][_0x738e('0x1d')][_0x738e('0x15')]}));}}}else{_0x226004[_0x738e('0x1b')](dbH[_0x738e('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x738e('0x1d')][_0x738e('0x15')]}));}var _0x1d9717=path[_0x738e('0x1f')](PATH);var _0x2bd476=path[_0x738e('0x20')](PATH,_0x738e('0x21'));var _0x2027e0=_0x3bfa38['split']&&_0x226004[_0x738e('0x16')]>0x1;var _0x2208e6=[];if(!fs['existsSync'](path['join'](_0x1d9717,_0x2bd476))&&_0x2027e0){fs[_0x738e('0x22')](path[_0x738e('0x23')](_0x1d9717,_0x2bd476));}return BPromise['each'](_0x226004,function(_0x2039e2){_0x2208e6[_0x738e('0x1b')](_0x2039e2);})[_0x738e('0x13')](function(){for(var _0x472b04=0x0;_0x472b04<_0x2208e6['length'];_0x472b04+=0x1){var _0xf7b755;var _0x7e6be3=_0x2208e6[_0x472b04];if(_0x2027e0){_0xf7b755=path[_0x738e('0x23')](_0x1d9717,_0x2bd476,util[_0x738e('0xd')](_0x738e('0x24'),_0x2bd476,_0x472b04,_0x738e('0x25')));}else{_0xf7b755=path[_0x738e('0x23')](_0x1d9717,util['format'](_0x738e('0x26'),_0x2bd476,_0x738e('0x25')));}fs['writeFileSync'](_0xf7b755,csv(_0x7e6be3));}})[_0x738e('0x13')](function(){if(_0x2027e0){return new Promise(function(_0x3e27bd){zipdir(path['join'](_0x1d9717,_0x2bd476),{'saveTo':path[_0x738e('0x23')](_0x1d9717,util[_0x738e('0xd')]('%s.%s',_0x2bd476,_0x738e('0x27')))},function(_0x240022,_0x95384d){rimraf(path[_0x738e('0x23')](_0x1d9717,_0x2bd476),function(){});_0x3e27bd(_0x738e('0x28'));});});}})['then'](function(){logger[_0x738e('0xc')](util[_0x738e('0xd')](_0x738e('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x2027e0?util[_0x738e('0xd')](_0x738e('0x26'),_0x2bd476,_0x2027e0?_0x738e('0x27'):_0x738e('0x25')):null);});})['catch'](function(_0x8a4ea2){logger[_0x738e('0xc')](util[_0x738e('0xd')](_0x738e('0x2a'),EXTRACTED_REPORT_ID,_0x738e('0xf')),util[_0x738e('0x2b')](_0x8a4ea2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7087e0d..08df432 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 _0x3a78=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','split','join','each','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','Setting','find','splitSizePdf','then','range','num','sequelize'];(function(_0x29ba2c,_0x3d64b3){var _0x27f8a8=function(_0x1d735c){while(--_0x1d735c){_0x29ba2c['push'](_0x29ba2c['shift']());}};_0x27f8a8(++_0x3d64b3);}(_0x3a78,0x18f));var _0x83a7=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x3a78[_0x2a5099];return _0x2802f1;};'use strict';var _=require(_0x83a7('0x0'));var fs=require('fs');var util=require(_0x83a7('0x1'));var path=require(_0x83a7('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x83a7('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x83a7('0x4'));var JSDOM=require(_0x83a7('0x5'))[_0x83a7('0x6')];var window=new JSDOM('')[_0x83a7('0x7')];var BPromise=require('bluebird');var db=require(_0x83a7('0x8'))['db'];var dbH=require(_0x83a7('0x8'))[_0x83a7('0x9')];var logger=require(_0x83a7('0xa'))(_0x83a7('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x83a7('0xc')][0x2]);var QUERY=process[_0x83a7('0xc')][0x3];var PATH=process[_0x83a7('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x83a7('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ffeac,_0x34c1c7){var _0x5e1e87={'status':_0x1ffeac};var _0x472e59={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34c1c7){_0x5e1e87[_0x83a7('0xe')]=_0x34c1c7;}return db[_0x83a7('0xf')]['update'](_0x5e1e87,_0x472e59);}function getHeaders(_0x2b288c){return _[_0x83a7('0x10')](_0x2b288c,function(_0x16efcd){return{'text':_0x16efcd,'style':_0x83a7('0x11')};});}function getRows(_0xfb08b0,_0x2e386c){return _['map'](_0x2e386c,function(_0x229b2c){return _(_0x229b2c)[_0x83a7('0x12')](_0xfb08b0)[_0x83a7('0x10')](function(_0x18a05f){return _0x18a05f?_['toString'](_0x18a05f):'';})['value']();});}function createTable(_0x5b2c32,_0x3c503d){var _0x5c473e={'widths':_['fill'](Array(_0x5b2c32['length']),0x91),'heights':function(_0x4690d0){return _0x4690d0===0x0?_0x83a7('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x208b77=getHeaders(_0x5b2c32);_0x5c473e[_0x83a7('0x14')]['push'](_0x208b77);var _0x4d20f3=getRows(_0x5b2c32,_0x3c503d);_0x5c473e[_0x83a7('0x14')]=_0x5c473e[_0x83a7('0x14')]['concat'](_0x4d20f3);return _0x5c473e;}function createTables(_0xec52b7){var _0x1c0318=[];var _0x3725ff=_['chunk'](Object[_0x83a7('0x15')](_0xec52b7[0x0]),0x5);_0x3725ff[_0x83a7('0x16')](function(_0xe9018d){_0x1c0318[_0x83a7('0x17')](createTable(_0xe9018d,_0xec52b7));});return _0x1c0318;}function getPDFDocDefinition(_0x3b1f99){var _0x2687bd=util[_0x83a7('0x18')](_0x83a7('0x19'),NAME,EXTRACTED_REPORT[_0x83a7('0x1a')],moment(EXTRACTED_REPORT[_0x83a7('0x1b')])[_0x83a7('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x83a7('0x1c')])['format'](FORMAT));var _0x5244f6=[];for(var _0x448b77=0x0;_0x448b77<_0x3b1f99[_0x83a7('0x1d')];_0x448b77++){var _0x22f490=[];if(_0x448b77===0x0){_0x22f490[_0x83a7('0x17')]({'text':_0x2687bd,'style':_0x83a7('0x1e')});}var _0x4f382f={'table':_0x3b1f99[_0x448b77]};if(_0x448b77>0x0){_0x4f382f[_0x83a7('0x1f')]='before';_0x4f382f[_0x83a7('0x20')]=[0x0,0x46,0x0,0x0];}_0x22f490['push'](_0x4f382f);_0x5244f6[_0x83a7('0x17')](_0x22f490);}return{'pageSize':'A4','pageOrientation':_0x83a7('0x21'),'content':_0x5244f6,'footer':function(_0x24d75f,_0x2c20af){return{'text':_0x24d75f['toString']()+_0x83a7('0x22')+_0x2c20af,'style':_0x83a7('0x23')};},'defaultStyle':{'font':_0x83a7('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x83a7('0x25')},'footer':{'alignment':_0x83a7('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20d52f){var _0x2bb510=0x1388;var _0x375346;if(!_0x20d52f[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x83a7('0x27')][_0x83a7('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x83a7('0x29')]})['then'](function(_0x46d613){if(_0x46d613){_0x375346=_0x46d613;_0x2bb510=_0x375346[_0x83a7('0x29')]||0x3e8;}})[_0x83a7('0x2a')](function(){var _0x56ede3=[];var _0xf9c3cd=0x0;if(_0x375346['split']){if(_0x20d52f&&_0x20d52f[_0x83a7('0x1d')]){var _0x332476=_[_0x83a7('0x2b')](_0x20d52f[0x0][_0x83a7('0x2c')]/_0x2bb510);var _0x5db89a=Number['isInteger'](_0x20d52f[0x0][_0x83a7('0x2c')]/_0x2bb510)?_0x20d52f[0x0][_0x83a7('0x2c')]%_0x2bb510:0x0;_0x332476[_0x83a7('0x16')](function(_0x14bf17){if(_0x14bf17>0x0){_0xf9c3cd+=_0x2bb510;}_0x56ede3[_0x83a7('0x17')](dbH[_0x83a7('0x2d')]['query'](util[_0x83a7('0x18')](_0x83a7('0x2e'),QUERY,_0x2bb510,_0xf9c3cd),{'type':dbH[_0x83a7('0x2d')][_0x83a7('0x2f')][_0x83a7('0x30')]}));});if(_0x5db89a>0x0){_0xf9c3cd+=_0x2bb510;_0x56ede3['push'](dbH[_0x83a7('0x2d')]['query'](util['format'](_0x83a7('0x2e'),QUERY,_0x5db89a,_0xf9c3cd),{'type':dbH['sequelize'][_0x83a7('0x2f')][_0x83a7('0x30')]}));}}}else{_0x56ede3[_0x83a7('0x17')](dbH[_0x83a7('0x2d')][_0x83a7('0x31')](QUERY,{'type':dbH[_0x83a7('0x2d')][_0x83a7('0x2f')][_0x83a7('0x30')]}));}var _0x4a2b73=path['dirname'](PATH);var _0x484792=path[_0x83a7('0x32')](PATH,_0x83a7('0x33'));var _0x2dde80=_0x375346[_0x83a7('0x34')]&&_0x56ede3[_0x83a7('0x1d')]>0x1;var _0xa7ed6a=[];if(!fs['existsSync'](path[_0x83a7('0x35')](_0x4a2b73,_0x484792))&&_0x2dde80){fs['mkdirSync'](path['join'](_0x4a2b73,_0x484792));}return BPromise[_0x83a7('0x36')](_0x56ede3,function(_0xc98b72){_0xa7ed6a[_0x83a7('0x17')](_0xc98b72);})['then'](function(){var _0x1e7c86=[];for(var _0x2701a1=0x0;_0x2701a1<_0xa7ed6a[_0x83a7('0x1d')];_0x2701a1+=0x1){var _0x449ec4=_0xa7ed6a[_0x2701a1];var _0x179062=createTables(_[_0x83a7('0x37')](_0x449ec4));var _0x287baf;var _0x45c819=getPDFDocDefinition(_0x179062);var _0x502977=getPDFPrinter();var _0xe324ad=_0x502977[_0x83a7('0x38')](_0x45c819);if(_0x2dde80){_0x287baf=path['join'](_0x4a2b73,_0x484792,util[_0x83a7('0x18')]('%s%d.%s',_0x484792,_0x2701a1,_0x83a7('0x39')));}else{_0x287baf=path[_0x83a7('0x35')](_0x4a2b73,util[_0x83a7('0x18')]('%s.%s',_0x484792,_0x83a7('0x39')));}_0x1e7c86['push'](writePDFDocument(_0xe324ad,_0x287baf));}return Promise[_0x83a7('0x3a')](_0x1e7c86);})[_0x83a7('0x2a')](function(){if(_0x2dde80){return new Promise(function(_0x46964f){zipdir(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),{'saveTo':path[_0x83a7('0x35')](_0x4a2b73,util[_0x83a7('0x18')](_0x83a7('0x3b'),_0x484792,_0x83a7('0x3c')))},function(){rimraf(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),function(){});_0x46964f(_0x83a7('0x3d'));});});}})[_0x83a7('0x2a')](function(){if(!_0x2dde80)return;rimraf(path[_0x83a7('0x35')](_0x4a2b73,_0x484792),function(){});})[_0x83a7('0x2a')](function(){logger[_0x83a7('0x3e')](util[_0x83a7('0x18')](_0x83a7('0x3f'),EXTRACTED_REPORT_ID,_0x83a7('0x40')));return analyticExtractedReport(_0x83a7('0x41'),_0x2dde80?util[_0x83a7('0x18')](_0x83a7('0x3b'),_0x484792,_0x2dde80?_0x83a7('0x3c'):_0x83a7('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x83a7('0x3e')](util[_0x83a7('0x18')](_0x83a7('0x42'),EXTRACTED_REPORT_ID,_0x83a7('0x40')));return db[_0x83a7('0xf')][_0x83a7('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5ed7d){EXTRACTED_REPORT=_0x5ed7d;return dbH[_0x83a7('0x2d')][_0x83a7('0x31')](util[_0x83a7('0x18')](_0x83a7('0x44'),QUERY),{'type':dbH[_0x83a7('0x2d')]['QueryTypes'][_0x83a7('0x30')]});})[_0x83a7('0x2a')](extractReport)[_0x83a7('0x45')](function(_0x399d42){logger[_0x83a7('0x3e')](util[_0x83a7('0x18')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x83a7('0x40')),util['inspect'](_0x399d42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x83a7('0x46')](function(){process[_0x83a7('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5caa6f=new PdfPrinter({'Arial':{'normal':__dirname+_0x83a7('0x48'),'bold':__dirname+_0x83a7('0x49'),'italics':__dirname+_0x83a7('0x4a'),'bolditalics':__dirname+_0x83a7('0x4b')}});return _0x5caa6f;}function getPDFDocDefinitionFromHTML(_0x316a0c,_0x27db91){var _0x2d7d3d=util[_0x83a7('0x18')](_0x83a7('0x4c'),_0x27db91[_0x83a7('0x4d')],_0x27db91['interactionId']);var _0x25dff7=moment()[_0x83a7('0x18')](_0x83a7('0x4e'))[_0x83a7('0x4f')]();var _0x596837=htmlToPdfmake(_0x316a0c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x596837],'defaultStyle':{'font':_0x83a7('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x83a7('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x83a7('0x50')}},'header':function(){return[{'text':_0x83a7('0x51'),'style':'header'}];},'footer':function(_0x145dd1,_0x2e462f){return[{'text':util[_0x83a7('0x18')](_0x83a7('0x52'),_0x2d7d3d,_0x145dd1,_0x2e462f,_0x25dff7),'style':_0x83a7('0x23')}];}};}function writePDFDocument(_0x36292e,_0x130ddb){return new Promise(function(_0x32f06c,_0x815e31){var _0x4a8ab6=_0x36292e[_0x83a7('0x53')](fs[_0x83a7('0x54')](_0x130ddb));_0x4a8ab6['on']('finish',function(){_0x32f06c(_0x83a7('0x55'));});_0x4a8ab6['on'](_0x83a7('0x56'),function(_0x2de25d){_0x815e31(_0x2de25d);});_0x36292e[_0x83a7('0x57')]();});}exports[_0x83a7('0x58')]=function(_0x548c72,_0x12e934){var _0x5b6bc7=getPDFPrinter();var _0x45a028=getPDFDocDefinitionFromHTML(_0x548c72,_0x12e934);var _0x2d7ac1=_0x5b6bc7[_0x83a7('0x38')](_0x45a028);return writePDFDocument(_0x2d7ac1,_0x12e934[_0x83a7('0x2')])[_0x83a7('0x45')](function(_0x490fbc){throw _0x490fbc;});}; \ No newline at end of file +var _0x8eaf=['QueryTypes','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','pick','toString','fill','auto','body','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','push','margin','landscape','\x20/\x20','Arial','black','right','Empty','Setting','find','splitSizePdf','then','split','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT'];(function(_0x4c23a1,_0x5e630c){var _0x524a39=function(_0x23c008){while(--_0x23c008){_0x4c23a1['push'](_0x4c23a1['shift']());}};_0x524a39(++_0x5e630c);}(_0x8eaf,0x127));var _0xf8ea=function(_0x1343fe,_0x1b99ab){_0x1343fe=_0x1343fe-0x0;var _0x354bc7=_0x8eaf[_0x1343fe];return _0x354bc7;};'use strict';var _=require(_0xf8ea('0x0'));var fs=require('fs');var util=require(_0xf8ea('0x1'));var path=require(_0xf8ea('0x2'));var moment=require(_0xf8ea('0x3'));var htmlToPdfmake=require(_0xf8ea('0x4'));var PdfPrinter=require(_0xf8ea('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0xf8ea('0x6'));var JSDOM=require(_0xf8ea('0x7'))[_0xf8ea('0x8')];var window=new JSDOM('')[_0xf8ea('0x9')];var BPromise=require('bluebird');var db=require(_0xf8ea('0xa'))['db'];var dbH=require(_0xf8ea('0xa'))[_0xf8ea('0xb')];var logger=require('../../config/logger')(_0xf8ea('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf8ea('0xd')][0x3];var PATH=process[_0xf8ea('0xd')][0x4];var NAME=process[_0xf8ea('0xd')][0x5];var FORMAT=_0xf8ea('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x209735,_0xa1ec4c){var _0x546a5d={'status':_0x209735};var _0x13dc6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa1ec4c){_0x546a5d['savename']=_0xa1ec4c;}return db['AnalyticExtractedReport'][_0xf8ea('0xf')](_0x546a5d,_0x13dc6c);}function getHeaders(_0x2817ca){return _[_0xf8ea('0x10')](_0x2817ca,function(_0x2206d7){return{'text':_0x2206d7,'style':_0xf8ea('0x11')};});}function getRows(_0x59bdaa,_0x116294){return _[_0xf8ea('0x10')](_0x116294,function(_0x19e70f){return _(_0x19e70f)[_0xf8ea('0x12')](_0x59bdaa)[_0xf8ea('0x10')](function(_0x35a955){return _0x35a955?_[_0xf8ea('0x13')](_0x35a955):'';})['value']();});}function createTable(_0x101ac9,_0x20b6c2){var _0x3bcc5c={'widths':_[_0xf8ea('0x14')](Array(_0x101ac9['length']),0x91),'heights':function(_0x209189){return _0x209189===0x0?_0xf8ea('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x6af832=getHeaders(_0x101ac9);_0x3bcc5c[_0xf8ea('0x16')]['push'](_0x6af832);var _0x49042f=getRows(_0x101ac9,_0x20b6c2);_0x3bcc5c[_0xf8ea('0x16')]=_0x3bcc5c[_0xf8ea('0x16')]['concat'](_0x49042f);return _0x3bcc5c;}function createTables(_0x18fc6d){var _0x2f0a7f=[];var _0x3de5a9=_[_0xf8ea('0x17')](Object[_0xf8ea('0x18')](_0x18fc6d[0x0]),0x5);_0x3de5a9['forEach'](function(_0x39693e){_0x2f0a7f['push'](createTable(_0x39693e,_0x18fc6d));});return _0x2f0a7f;}function getPDFDocDefinition(_0x34bce0){var _0x51c8c4=util[_0xf8ea('0x19')](_0xf8ea('0x1a'),NAME,EXTRACTED_REPORT[_0xf8ea('0x1b')],moment(EXTRACTED_REPORT[_0xf8ea('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xf8ea('0x1d')])[_0xf8ea('0x19')](FORMAT));var _0x3b15c4=[];for(var _0x4ed68b=0x0;_0x4ed68b<_0x34bce0[_0xf8ea('0x1e')];_0x4ed68b++){var _0x33034f=[];if(_0x4ed68b===0x0){_0x33034f[_0xf8ea('0x1f')]({'text':_0x51c8c4,'style':'header'});}var _0x36b29f={'table':_0x34bce0[_0x4ed68b]};if(_0x4ed68b>0x0){_0x36b29f['pageBreak']='before';_0x36b29f[_0xf8ea('0x20')]=[0x0,0x46,0x0,0x0];}_0x33034f[_0xf8ea('0x1f')](_0x36b29f);_0x3b15c4[_0xf8ea('0x1f')](_0x33034f);}return{'pageSize':'A4','pageOrientation':_0xf8ea('0x21'),'content':_0x3b15c4,'footer':function(_0x2c895f,_0x4bb0a8){return{'text':_0x2c895f[_0xf8ea('0x13')]()+_0xf8ea('0x22')+_0x4bb0a8,'style':'footer'};},'defaultStyle':{'font':_0xf8ea('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf8ea('0x24')},'footer':{'alignment':_0xf8ea('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x22888b){var _0x36de18=0x1388;var _0x42d371;if(!_0x22888b[0x0]['num']){return analyticExtractedReport(_0xf8ea('0x26'));}return db[_0xf8ea('0x27')][_0xf8ea('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf8ea('0x29')]})['then'](function(_0x5d52b2){if(_0x5d52b2){_0x42d371=_0x5d52b2;_0x36de18=_0x42d371[_0xf8ea('0x29')]||0x3e8;}})[_0xf8ea('0x2a')](function(){var _0x34fd1f=[];var _0x178721=0x0;if(_0x42d371[_0xf8ea('0x2b')]){if(_0x22888b&&_0x22888b[_0xf8ea('0x1e')]){var _0x489174=_['range'](_0x22888b[0x0][_0xf8ea('0x2c')]/_0x36de18);var _0x5d3f2b=Number['isInteger'](_0x22888b[0x0]['num']/_0x36de18)?_0x22888b[0x0][_0xf8ea('0x2c')]%_0x36de18:0x0;_0x489174['forEach'](function(_0x11bb31){if(_0x11bb31>0x0){_0x178721+=_0x36de18;}_0x34fd1f[_0xf8ea('0x1f')](dbH[_0xf8ea('0x2d')][_0xf8ea('0x2e')](util['format'](_0xf8ea('0x2f'),QUERY,_0x36de18,_0x178721),{'type':dbH[_0xf8ea('0x2d')]['QueryTypes'][_0xf8ea('0x30')]}));});if(_0x5d3f2b>0x0){_0x178721+=_0x36de18;_0x34fd1f[_0xf8ea('0x1f')](dbH[_0xf8ea('0x2d')][_0xf8ea('0x2e')](util[_0xf8ea('0x19')](_0xf8ea('0x2f'),QUERY,_0x5d3f2b,_0x178721),{'type':dbH[_0xf8ea('0x2d')][_0xf8ea('0x31')]['SELECT']}));}}}else{_0x34fd1f[_0xf8ea('0x1f')](dbH[_0xf8ea('0x2d')][_0xf8ea('0x2e')](QUERY,{'type':dbH['sequelize'][_0xf8ea('0x31')][_0xf8ea('0x30')]}));}var _0x5b97a5=path['dirname'](PATH);var _0x2b6955=path[_0xf8ea('0x32')](PATH,_0xf8ea('0x33'));var _0xa7205e=_0x42d371[_0xf8ea('0x2b')]&&_0x34fd1f[_0xf8ea('0x1e')]>0x1;var _0x2aeae7=[];if(!fs[_0xf8ea('0x34')](path[_0xf8ea('0x35')](_0x5b97a5,_0x2b6955))&&_0xa7205e){fs[_0xf8ea('0x36')](path[_0xf8ea('0x35')](_0x5b97a5,_0x2b6955));}return BPromise[_0xf8ea('0x37')](_0x34fd1f,function(_0x25b160){_0x2aeae7['push'](_0x25b160);})[_0xf8ea('0x2a')](function(){var _0x5c064=[];for(var _0x14b3ac=0x0;_0x14b3ac<_0x2aeae7['length'];_0x14b3ac+=0x1){var _0xd12b4=_0x2aeae7[_0x14b3ac];var _0x15c8d1=createTables(_[_0xf8ea('0x38')](_0xd12b4));var _0x5264e5;var _0x39d3b1=getPDFDocDefinition(_0x15c8d1);var _0x4c39ae=getPDFPrinter();var _0x3b9483=_0x4c39ae[_0xf8ea('0x39')](_0x39d3b1);if(_0xa7205e){_0x5264e5=path['join'](_0x5b97a5,_0x2b6955,util[_0xf8ea('0x19')]('%s%d.%s',_0x2b6955,_0x14b3ac,'pdf'));}else{_0x5264e5=path[_0xf8ea('0x35')](_0x5b97a5,util[_0xf8ea('0x19')](_0xf8ea('0x3a'),_0x2b6955,_0xf8ea('0x3b')));}_0x5c064[_0xf8ea('0x1f')](writePDFDocument(_0x3b9483,_0x5264e5));}return Promise['all'](_0x5c064);})[_0xf8ea('0x2a')](function(){if(_0xa7205e){return new Promise(function(_0x8119ff){zipdir(path['join'](_0x5b97a5,_0x2b6955),{'saveTo':path['join'](_0x5b97a5,util[_0xf8ea('0x19')](_0xf8ea('0x3a'),_0x2b6955,'zip'))},function(){rimraf(path[_0xf8ea('0x35')](_0x5b97a5,_0x2b6955),function(){});_0x8119ff('zip\x20finished');});});}})['then'](function(){if(!_0xa7205e)return;rimraf(path[_0xf8ea('0x35')](_0x5b97a5,_0x2b6955),function(){});})[_0xf8ea('0x2a')](function(){logger[_0xf8ea('0x3c')](util[_0xf8ea('0x19')](_0xf8ea('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xf8ea('0x3e'),_0xa7205e?util[_0xf8ea('0x19')]('%s.%s',_0x2b6955,_0xa7205e?'zip':_0xf8ea('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf8ea('0x3c')](util[_0xf8ea('0x19')](_0xf8ea('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xf8ea('0x40')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf8ea('0x2a')](function(_0x2236b1){EXTRACTED_REPORT=_0x2236b1;return dbH['sequelize'][_0xf8ea('0x2e')](util[_0xf8ea('0x19')](_0xf8ea('0x41'),QUERY),{'type':dbH[_0xf8ea('0x2d')][_0xf8ea('0x31')]['SELECT']});})[_0xf8ea('0x2a')](extractReport)[_0xf8ea('0x42')](function(_0x3ae455){logger[_0xf8ea('0x3c')](util[_0xf8ea('0x19')](_0xf8ea('0x43'),EXTRACTED_REPORT_ID,_0xf8ea('0x44')),util[_0xf8ea('0x45')](_0x3ae455,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf8ea('0x46'));})[_0xf8ea('0x47')](function(){process[_0xf8ea('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x402a0b=new PdfPrinter({'Arial':{'normal':__dirname+_0xf8ea('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x402a0b;}function getPDFDocDefinitionFromHTML(_0x49ba63,_0x37ba8d){var _0x31421f=util[_0xf8ea('0x19')](_0xf8ea('0x4a'),_0x37ba8d[_0xf8ea('0x4b')],_0x37ba8d[_0xf8ea('0x4c')]);var _0x3787af=moment()[_0xf8ea('0x19')](_0xf8ea('0x4d'))['toString']();var _0x420201=htmlToPdfmake(_0x49ba63,{'window':window,'tableAutoSize':!![]});return{'content':[_0x420201],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf8ea('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf8ea('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf8ea('0x4e')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x3ba6f2,_0x49aa2c){return[{'text':util['format'](_0xf8ea('0x4f'),_0x31421f,_0x3ba6f2,_0x49aa2c,_0x3787af),'style':'footer'}];}};}function writePDFDocument(_0x9d9215,_0x407b3b){return new Promise(function(_0x912f37,_0x4dd0db){var _0x128aa0=_0x9d9215[_0xf8ea('0x50')](fs[_0xf8ea('0x51')](_0x407b3b));_0x128aa0['on']('finish',function(){_0x912f37(_0xf8ea('0x52'));});_0x128aa0['on'](_0xf8ea('0x53'),function(_0x28c679){_0x4dd0db(_0x28c679);});_0x9d9215[_0xf8ea('0x54')]();});}exports[_0xf8ea('0x55')]=function(_0x316c39,_0x24f943){var _0x1a4edd=getPDFPrinter();var _0x3b3740=getPDFDocDefinitionFromHTML(_0x316c39,_0x24f943);var _0x5c6e30=_0x1a4edd[_0xf8ea('0x39')](_0x3b3740);return writePDFDocument(_0x5c6e30,_0x24f943[_0xf8ea('0x2')])[_0xf8ea('0x42')](function(_0x2f6e49){throw _0x2f6e49;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 38084d7..d548f40 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 _0x9da2=['savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9da2,0x15b));var _0x29da=function(_0x42b5ed,_0x6aafa7){_0x42b5ed=_0x42b5ed-0x0;var _0x4f24b0=_0x9da2[_0x42b5ed];return _0x4f24b0;};'use strict';var util=require(_0x29da('0x0'));var path=require(_0x29da('0x1'));var _=require(_0x29da('0x2'));var fs=require('fs');var json2xls=require(_0x29da('0x3'));var BPromise=require(_0x29da('0x4'));var zipdir=require(_0x29da('0x5'));var rimraf=require('rimraf');var db=require(_0x29da('0x6'))['db'];var dbH=require('../../mysqldb')[_0x29da('0x7')];var logger=require('../../config/logger')(_0x29da('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x29da('0x9')][0x2]);var QUERY=process[_0x29da('0x9')][0x3];var PATH=process[_0x29da('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d05bd,_0x38096c){var _0xcc113b={'status':_0x4d05bd};var _0x150cba={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38096c){_0xcc113b[_0x29da('0xa')]=_0x38096c;}return db[_0x29da('0xb')][_0x29da('0xc')](_0xcc113b,_0x150cba);}function main(){var _0x4693a2=0x1388;var _0x44ee21;logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0xf'),EXTRACTED_REPORT_ID,_0x29da('0x10')));return db[_0x29da('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x29da('0x12'),_0x29da('0x13')]})[_0x29da('0x14')](function(_0xcb13cd){if(_0xcb13cd){_0x44ee21=_0xcb13cd;_0x4693a2=_0x44ee21[_0x29da('0x13')]||0x1388;}})[_0x29da('0x14')](function(){return dbH['sequelize']['query'](util[_0x29da('0xe')](_0x29da('0x15'),QUERY),{'type':dbH[_0x29da('0x16')][_0x29da('0x17')][_0x29da('0x18')]});})[_0x29da('0x14')](function(_0x35d3a7){if(!_0x35d3a7[0x0][_0x29da('0x19')]){return analyticExtractedReport(_0x29da('0x1a'));}var _0x117d62=[];var _0x5d8f26=0x0;if(_0x44ee21[_0x29da('0x12')]){if(_0x35d3a7&&_0x35d3a7['length']){var _0x2bd432=_[_0x29da('0x1b')](_0x35d3a7[0x0][_0x29da('0x19')]/_0x4693a2);var _0x1621df=Number[_0x29da('0x1c')](_0x35d3a7[0x0]['num']/_0x4693a2)?_0x35d3a7[0x0][_0x29da('0x19')]%_0x4693a2:0x0;_0x2bd432[_0x29da('0x1d')](function(_0x5cc50f){if(_0x5cc50f>0x0){_0x5d8f26+=_0x4693a2;}_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')][_0x29da('0x1f')](util[_0x29da('0xe')](_0x29da('0x20'),QUERY,_0x4693a2,_0x5d8f26),{'type':dbH[_0x29da('0x16')]['QueryTypes'][_0x29da('0x18')]}));});if(_0x1621df>0x0){_0x5d8f26+=_0x4693a2;_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')][_0x29da('0x1f')](util[_0x29da('0xe')](_0x29da('0x20'),QUERY,_0x1621df,_0x5d8f26),{'type':dbH[_0x29da('0x16')]['QueryTypes']['SELECT']}));}}}else{_0x117d62[_0x29da('0x1e')](dbH[_0x29da('0x16')]['query'](QUERY,{'type':dbH[_0x29da('0x16')][_0x29da('0x17')][_0x29da('0x18')]}));}var _0x17e559=path[_0x29da('0x21')](PATH);var _0x135c53=path[_0x29da('0x22')](PATH,_0x29da('0x23'));var _0xd37b83=_0x44ee21['split']&&_0x117d62['length']>0x1;var _0x401322=[];if(!fs['existsSync'](path[_0x29da('0x24')](_0x17e559,_0x135c53))&&_0xd37b83){fs[_0x29da('0x25')](path[_0x29da('0x24')](_0x17e559,_0x135c53));}return BPromise[_0x29da('0x26')](_0x117d62,function(_0x1a5966){_0x401322[_0x29da('0x1e')](_0x1a5966);})[_0x29da('0x14')](function(){for(var _0x255800=0x0;_0x255800<_0x401322['length'];_0x255800+=0x1){var _0x239a1d;var _0x58d273=_0x401322[_0x255800];if(_0xd37b83){_0x239a1d=path[_0x29da('0x24')](_0x17e559,_0x135c53,util['format']('%s%d.%s',_0x135c53,_0x255800,_0x29da('0x27')));}else{_0x239a1d=path[_0x29da('0x24')](_0x17e559,util[_0x29da('0xe')](_0x29da('0x28'),_0x135c53,_0x29da('0x27')));}fs[_0x29da('0x29')](_0x239a1d,json2xls(_0x58d273),_0x29da('0x2a'));}})[_0x29da('0x14')](function(){if(_0xd37b83){return new Promise(function(_0x513835){zipdir(path['join'](_0x17e559,_0x135c53),{'saveTo':path[_0x29da('0x24')](_0x17e559,util['format']('%s.%s',_0x135c53,_0x29da('0x2b')))},function(_0x34b488,_0x127980){rimraf(path[_0x29da('0x24')](_0x17e559,_0x135c53),function(){});_0x513835(_0x29da('0x2c'));});});}})[_0x29da('0x14')](function(){logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0x2d'),EXTRACTED_REPORT_ID,_0x29da('0x10')));return analyticExtractedReport('Completed',_0xd37b83?util[_0x29da('0xe')](_0x29da('0x28'),_0x135c53,_0xd37b83?_0x29da('0x2b'):_0x29da('0x27')):null);});})[_0x29da('0x2e')](function(_0x5f3d00){logger[_0x29da('0xd')](util[_0x29da('0xe')](_0x29da('0x2f'),EXTRACTED_REPORT_ID,_0x29da('0x10')),util[_0x29da('0x30')](_0x5f3d00,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x29da('0x31'));})[_0x29da('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd94e=['split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','finally','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','XLSX','Setting','find','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num'];(function(_0xfd8ce0,_0x1904b9){var _0x1e71fd=function(_0x47bc18){while(--_0x47bc18){_0xfd8ce0['push'](_0xfd8ce0['shift']());}};_0x1e71fd(++_0x1904b9);}(_0xd94e,0x16e));var _0xed94=function(_0x53ec91,_0x7eb7bb){_0x53ec91=_0x53ec91-0x0;var _0x36d102=_0xd94e[_0x53ec91];return _0x36d102;};'use strict';var util=require('util');var path=require(_0xed94('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xed94('0x1'));var zipdir=require(_0xed94('0x2'));var rimraf=require(_0xed94('0x3'));var db=require(_0xed94('0x4'))['db'];var dbH=require(_0xed94('0x4'))[_0xed94('0x5')];var logger=require(_0xed94('0x6'))(_0xed94('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xed94('0x8')][0x2]);var QUERY=process[_0xed94('0x8')][0x3];var PATH=process[_0xed94('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x150bb0,_0x125d72){var _0x35d001={'status':_0x150bb0};var _0xccd7a9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x125d72){_0x35d001[_0xed94('0x9')]=_0x125d72;}return db[_0xed94('0xa')][_0xed94('0xb')](_0x35d001,_0xccd7a9);}function main(){var _0x58b41a=0x1388;var _0x2359b1;logger[_0xed94('0xc')](util[_0xed94('0xd')](_0xed94('0xe'),EXTRACTED_REPORT_ID,_0xed94('0xf')));return db[_0xed94('0x10')][_0xed94('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xed94('0x12')](function(_0x945d7d){if(_0x945d7d){_0x2359b1=_0x945d7d;_0x58b41a=_0x2359b1[_0xed94('0x13')]||0x1388;}})[_0xed94('0x12')](function(){return dbH['sequelize'][_0xed94('0x14')](util[_0xed94('0xd')](_0xed94('0x15'),QUERY),{'type':dbH[_0xed94('0x16')][_0xed94('0x17')][_0xed94('0x18')]});})[_0xed94('0x12')](function(_0x5212b4){if(!_0x5212b4[0x0][_0xed94('0x19')]){return analyticExtractedReport('Empty');}var _0x2346d4=[];var _0x27a91d=0x0;if(_0x2359b1[_0xed94('0x1a')]){if(_0x5212b4&&_0x5212b4[_0xed94('0x1b')]){var _0x81490e=_[_0xed94('0x1c')](_0x5212b4[0x0][_0xed94('0x19')]/_0x58b41a);var _0x54456b=Number[_0xed94('0x1d')](_0x5212b4[0x0][_0xed94('0x19')]/_0x58b41a)?_0x5212b4[0x0][_0xed94('0x19')]%_0x58b41a:0x0;_0x81490e[_0xed94('0x1e')](function(_0x289189){if(_0x289189>0x0){_0x27a91d+=_0x58b41a;}_0x2346d4[_0xed94('0x1f')](dbH[_0xed94('0x16')][_0xed94('0x14')](util[_0xed94('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x58b41a,_0x27a91d),{'type':dbH[_0xed94('0x16')]['QueryTypes'][_0xed94('0x18')]}));});if(_0x54456b>0x0){_0x27a91d+=_0x58b41a;_0x2346d4[_0xed94('0x1f')](dbH[_0xed94('0x16')][_0xed94('0x14')](util[_0xed94('0xd')](_0xed94('0x20'),QUERY,_0x54456b,_0x27a91d),{'type':dbH[_0xed94('0x16')][_0xed94('0x17')][_0xed94('0x18')]}));}}}else{_0x2346d4[_0xed94('0x1f')](dbH['sequelize'][_0xed94('0x14')](QUERY,{'type':dbH['sequelize'][_0xed94('0x17')][_0xed94('0x18')]}));}var _0x2b7c69=path['dirname'](PATH);var _0x227254=path[_0xed94('0x21')](PATH,_0xed94('0x22'));var _0x2f84fc=_0x2359b1[_0xed94('0x1a')]&&_0x2346d4[_0xed94('0x1b')]>0x1;var _0x5ae3b3=[];if(!fs[_0xed94('0x23')](path[_0xed94('0x24')](_0x2b7c69,_0x227254))&&_0x2f84fc){fs[_0xed94('0x25')](path[_0xed94('0x24')](_0x2b7c69,_0x227254));}return BPromise[_0xed94('0x26')](_0x2346d4,function(_0x2bdae5){_0x5ae3b3[_0xed94('0x1f')](_0x2bdae5);})[_0xed94('0x12')](function(){for(var _0x2cacc3=0x0;_0x2cacc3<_0x5ae3b3[_0xed94('0x1b')];_0x2cacc3+=0x1){var _0x1920f9;var _0x54e3b6=_0x5ae3b3[_0x2cacc3];if(_0x2f84fc){_0x1920f9=path[_0xed94('0x24')](_0x2b7c69,_0x227254,util[_0xed94('0xd')](_0xed94('0x27'),_0x227254,_0x2cacc3,_0xed94('0x28')));}else{_0x1920f9=path[_0xed94('0x24')](_0x2b7c69,util[_0xed94('0xd')](_0xed94('0x29'),_0x227254,_0xed94('0x28')));}fs[_0xed94('0x2a')](_0x1920f9,json2xls(_0x54e3b6),'binary');}})[_0xed94('0x12')](function(){if(_0x2f84fc){return new Promise(function(_0x358424){zipdir(path['join'](_0x2b7c69,_0x227254),{'saveTo':path[_0xed94('0x24')](_0x2b7c69,util[_0xed94('0xd')](_0xed94('0x29'),_0x227254,_0xed94('0x2b')))},function(_0x517c07,_0xb0b007){rimraf(path['join'](_0x2b7c69,_0x227254),function(){});_0x358424('zip\x20finished');});});}})[_0xed94('0x12')](function(){logger[_0xed94('0xc')](util['format'](_0xed94('0x2c'),EXTRACTED_REPORT_ID,_0xed94('0xf')));return analyticExtractedReport(_0xed94('0x2d'),_0x2f84fc?util[_0xed94('0xd')](_0xed94('0x29'),_0x227254,_0x2f84fc?_0xed94('0x2b'):_0xed94('0x28')):null);});})['catch'](function(_0x5b8af8){logger[_0xed94('0xc')](util[_0xed94('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0xed94('0x2e')](_0x5b8af8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xed94('0x2f'));})[_0xed94('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index effcf60..f44fc15 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 _0x83b3=['XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','sortBy','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b3,0x153));var _0x383b=function(_0x30681f,_0x50eee2){_0x30681f=_0x30681f-0x0;var _0x17917c=_0x83b3[_0x30681f];return _0x17917c;};'use strict';var _=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));function rewrite(_0x16da0d,_0x42b113){var _0x301e93=this;return _0x16da0d[_0x383b('0x2')][_0x383b('0x3')][_0x383b('0x4')]({'raw':!![]})['then'](function(_0x223664){_0x301e93[_0x383b('0x5')]=_0x223664;return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')][_0x383b('0x4')]({'where':{'IntervalId':_0x42b113[_0x383b('0x7')]},'raw':!![]});})[_0x383b('0x8')](function(_0x27fdfb){return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')][_0x383b('0x4')]({'where':{'exten':{'$in':_[_0x383b('0x9')](_[_0x383b('0xa')](_0x27fdfb,_0x383b('0xb')))}},'order':[{'raw':_0x383b('0xc')}],'raw':!![]});})[_0x383b('0x8')](function(_0x320244){var _0x2483aa=_[_0x383b('0xd')](_0x320244,{'priority':'1'});var _0x17a7a8=_[_0x383b('0xd')](_0x320244,{'isApp':0x1});var _0x2b2919=_['groupBy'](_0x17a7a8,_0x383b('0xb'));var _0x20f801=['queue',_0x383b('0xe')];var _0x43f169=[];var _0x4730af=[];for(var _0x140983 in _0x2b2919){if(_0x2b2919[_0x383b('0xf')](_0x140983)){_0x301e93[_0x383b('0x10')]=0x2;_0x301e93[_0x383b('0x11')]=[];_0x301e93[_0x383b('0x12')]=_[_0x383b('0x13')](_0x2483aa,{'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':util[_0x383b('0x17')]('CDR(type)=%s',_0x2b2919[_0x140983][0x0][_0x383b('0x15')]),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x2b2919[_0x140983][0x0]['type']===_0x383b('0x1a')){_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0]['type'],'app':'Set','appdata':_0x383b('0x1b')+_0x2b2919[_0x140983][0x0][_0x383b('0x19')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}else if(_0x2b2919[_0x140983][0x0]['type']===_0x383b('0x1c')){if(_0x301e93[_0x383b('0x12')]){_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x1d')+(_0x301e93['extension'][_0x383b('0x1e')]?_0x383b('0x1f')+_0x301e93['extension'][_0x383b('0x1e')]+'}':_0x383b('0x20')),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x1b')+_0x2b2919[_0x140983][0x0][_0x383b('0x19')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});var _0x4bbffd=_0x301e93[_0x383b('0x10')]++;_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4bbffd+0x2)+_0x383b('0x22')+(_0x4bbffd+0x1)+')','context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x4bbffd,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x301e93[_0x383b('0x12')]){_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':'Set','appdata':_0x301e93[_0x383b('0x12')][_0x383b('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x301e93['extension'][_0x383b('0x1e')]+'}':_0x383b('0x23'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});}_0x301e93['extensions'][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x24')+_0x2b2919[_0x140983][0x0]['VoiceExtensionId'],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});if(_0x301e93['extension']&&_0x301e93[_0x383b('0x12')][_0x383b('0xf')](_0x383b('0x25'))&&_0x301e93[_0x383b('0x12')]['recordingFormat']!=='none'){_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x26')+_0x301e93[_0x383b('0x12')][_0x383b('0x25')]||'wav','context':_0x2b2919[_0x140983][0x0]['context'],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});}}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':'Set','appdata':_0x383b('0x27'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});_0x301e93[_0x383b('0x11')]['push']({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x28'),'context':_0x2b2919[_0x140983][0x0]['context'],'exten':_0x2b2919[_0x140983][0x0]['exten'],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x29'),'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'priority':_0x301e93[_0x383b('0x10')]++,'VoiceExtensionId':_0x2b2919[_0x140983][0x0][_0x383b('0x19')]});for(var _0xc252f=0x0,_0x1fffeb=0x0;_0xc252f<_0x2b2919[_0x140983][_0x383b('0x2a')];_0xc252f+=0x1,_0x1fffeb=0x0){var _0x52ef2b=_0x2b2919[_0x140983][_0xc252f];if(_0x52ef2b[_0x383b('0x15')]){_0x52ef2b[_0x383b('0x15')]=_0x52ef2b[_0x383b('0x15')][_0x383b('0x2b')]();}var _0x513c68=[];var _0x40ac2d=[];delete _0x52ef2b['id'];delete _0x52ef2b[_0x383b('0x2c')];delete _0x52ef2b[_0x383b('0x2d')];var _0x25f526=_0x52ef2b['interval']!==_0x383b('0x2e')?[_0x52ef2b[_0x383b('0x2f')]]:_0x52ef2b[_0x383b('0x7')]?_[_0x383b('0xa')](_[_0x383b('0xd')](_0x301e93[_0x383b('0x5')],{'IntervalId':_0x52ef2b[_0x383b('0x7')]}),_0x383b('0x2f')):[];if(_0x52ef2b[_0x383b('0xf')](_0x383b('0x30'))){if(_0x52ef2b['tag']&&_0x52ef2b['tag']!=='--'){_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':'CDR(tag)='+_0x52ef2b[_0x383b('0x30')],'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93['priority']+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}}if(_0x52ef2b[_0x383b('0x15')]==='outbound'&&_0x52ef2b[_0x383b('0xf')](_0x383b('0x31'))){if(_0x52ef2b[_0x383b('0x31')]){_0x513c68['push']({'type':_0x52ef2b['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x52ef2b['callerID']+')','context':_0x52ef2b['context'],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526['length']+_0x301e93['priority']+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}else{_0x513c68['push']({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}}if(_0x52ef2b[_0x383b('0xf')]('answer')){if(_0x20f801[_0x383b('0x32')](_0x52ef2b[_0x383b('0x33')][_0x383b('0x2b')]())>=0x0&&_0x52ef2b[_0x383b('0x34')]!==_0x383b('0x35')){if(_0x52ef2b['answer']){_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x21'),'appdata':_0x383b('0x36'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526['length']+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b['type'],'app':_0x383b('0x16'),'appdata':_0x383b('0x37'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b['exten'],'priority':_0x25f526['length']+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});}else{_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b['type'],'app':'ExecIf','appdata':_0x383b('0x38'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b[_0x383b('0xb')],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b[_0x383b('0x19')]});_0x513c68[_0x383b('0x14')]({'type':_0x52ef2b[_0x383b('0x15')],'app':_0x383b('0x16'),'appdata':_0x383b('0x39'),'context':_0x52ef2b[_0x383b('0x18')],'exten':_0x52ef2b['exten'],'priority':_0x25f526[_0x383b('0x2a')]+_0x301e93[_0x383b('0x10')]+_0x1fffeb++,'VoiceExtensionId':_0x52ef2b['VoiceExtensionId']});}}}for(var _0x38799b=0x0;_0x38799b<_0x25f526[_0x383b('0x2a')];_0x38799b+=0x1){var _0x5cab96=_0x301e93['priority']+_0x25f526[_0x383b('0x2a')];var _0x313c83=_0x38799b===_0x25f526[_0x383b('0x2a')]-0x1?_0x301e93['priority']+_0x513c68[_0x383b('0x2a')]+_0x40ac2d[_0x383b('0x2a')]+0x2:_0x301e93[_0x383b('0x10')]+_0x38799b+0x1;_0x513c68[_0x383b('0x3a')](_0x38799b,0x0,{'type':_0x52ef2b[_0x383b('0x15')],'app':'GotoIfTime','appdata':_0x25f526[_0x38799b]+'?'+_0x52ef2b[_0x383b('0x18')]+_0x383b('0x3b')+_0x5cab96+':'+_0x52ef2b['context']+_0x383b('0x3b')+_0x313c83,'exten':_0x52ef2b['exten'],'context':_0x52ef2b[_0x383b('0x18')],'priority':_0x301e93[_0x383b('0x10')]+_0x38799b,'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});}_0x52ef2b[_0x383b('0x10')]=_0x513c68[_0x383b('0x2a')]?_[_0x383b('0x3c')](_0x513c68)['priority']+0x1:_0x301e93[_0x383b('0x10')];_0x301e93[_0x383b('0x10')]=(_0x40ac2d[_0x383b('0x2a')]?_[_0x383b('0x3c')](_0x40ac2d)[_0x383b('0x10')]:_0x52ef2b[_0x383b('0x10')])+0x1;_0x301e93[_0x383b('0x11')]=_[_0x383b('0x3d')](_0x301e93[_0x383b('0x11')],_0x513c68,[_0x52ef2b],_0x40ac2d);}_0x301e93[_0x383b('0x11')][_0x383b('0x14')]({'type':_0x2b2919[_0x140983][0x0][_0x383b('0x15')],'app':_0x383b('0x3e'),'exten':_0x2b2919[_0x140983][0x0][_0x383b('0xb')],'context':_0x2b2919[_0x140983][0x0][_0x383b('0x18')],'priority':_0x301e93[_0x383b('0x10')],'VoiceExtensionId':_0x2b2919[_0x140983][0x0]['VoiceExtensionId']});_0x43f169[_0x383b('0x14')](_0x2b2919[_0x140983][0x0][_0x383b('0x19')]);_0x4730af=_['concat'](_0x4730af,_0x301e93['extensions']);}}return _0x16da0d[_0x383b('0x3f')](function(_0x2a6cbf){return _0x16da0d[_0x383b('0x2')][_0x383b('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x43f169}},'transaction':_0x2a6cbf})[_0x383b('0x8')](function(_0x247e06){return _0x16da0d['models'][_0x383b('0x6')]['bulkCreate'](_[_0x383b('0x40')](_0x4730af,_0x383b('0x10')),{'transaction':_0x2a6cbf});});});})['catch'](function(_0x39e3a3){console['error'](_0x39e3a3);});}exports[_0x383b('0x41')]=rewrite; \ No newline at end of file +var _0x6528=['last','concat','bulkCreate','sortBy','catch','error','util','models','Interval','findAll','then','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','hasOwnProperty','priority','extensions','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','outbound','extension','cutdigits','${EXTEN}','CDR(routeid)=','push','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x6528,0x86));var _0x8652=function(_0x33a489,_0x3616f3){_0x33a489=_0x33a489-0x0;var _0x40d215=_0x6528[_0x33a489];return _0x40d215;};'use strict';var _=require('lodash');var util=require(_0x8652('0x0'));function rewrite(_0x5e0e7,_0x24b79a){var _0x2a015f=this;return _0x5e0e7[_0x8652('0x1')][_0x8652('0x2')][_0x8652('0x3')]({'raw':!![]})[_0x8652('0x4')](function(_0x479165){_0x2a015f['intervals']=_0x479165;return _0x5e0e7[_0x8652('0x1')][_0x8652('0x5')][_0x8652('0x3')]({'where':{'IntervalId':_0x24b79a['IntervalId']},'raw':!![]});})[_0x8652('0x4')](function(_0xc7a924){return _0x5e0e7['models'][_0x8652('0x5')][_0x8652('0x3')]({'where':{'exten':{'$in':_[_0x8652('0x6')](_[_0x8652('0x7')](_0xc7a924,'exten'))}},'order':[{'raw':_0x8652('0x8')}],'raw':!![]});})['then'](function(_0x45a130){var _0x36f46d=_[_0x8652('0x9')](_0x45a130,{'priority':'1'});var _0x1d78f2=_[_0x8652('0x9')](_0x45a130,{'isApp':0x1});var _0x4a8d78=_['groupBy'](_0x1d78f2,_0x8652('0xa'));var _0x131d59=[_0x8652('0xb'),_0x8652('0xc')];var _0x1ae64b=[];var _0x3a3d77=[];for(var _0x1762db in _0x4a8d78){if(_0x4a8d78[_0x8652('0xd')](_0x1762db)){_0x2a015f[_0x8652('0xe')]=0x2;_0x2a015f[_0x8652('0xf')]=[];_0x2a015f['extension']=_[_0x8652('0x10')](_0x36f46d,{'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')]});_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':_0x8652('0x11'),'appdata':util[_0x8652('0x12')](_0x8652('0x13'),_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')]),'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f['priority']++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});if(_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')]===_0x8652('0x17')){_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':_0x8652('0x11'),'appdata':'CDR(routeid)='+_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')],'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f['priority']++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});}else if(_0x4a8d78[_0x1762db][0x0]['type']===_0x8652('0x18')){if(_0x2a015f[_0x8652('0x19')]){_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':'CDR(destination)='+(_0x2a015f[_0x8652('0x19')][_0x8652('0x1a')]?'${EXTEN:'+_0x2a015f['extension']['cutdigits']+'}':_0x8652('0x1b')),'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0]['exten'],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});}_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':'Set','appdata':_0x8652('0x1c')+_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')],'context':_0x4a8d78[_0x1762db][0x0]['context'],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f['priority']++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});var _0x46afd0=_0x2a015f[_0x8652('0xe')]++;_0x2a015f[_0x8652('0xf')][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x46afd0+0x2)+_0x8652('0x1e')+(_0x46afd0+0x1)+')','context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x46afd0,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});if(_0x2a015f['extension']){_0x2a015f[_0x8652('0xf')][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':'Set','appdata':_0x2a015f[_0x8652('0x19')]['cutdigits']?_0x8652('0x1f')+_0x2a015f[_0x8652('0x19')][_0x8652('0x1a')]+'}':_0x8652('0x20'),'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f['priority']++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});}_0x2a015f[_0x8652('0xf')][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':_0x8652('0x21')+_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')],'context':_0x4a8d78[_0x1762db][0x0]['context'],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0]['VoiceExtensionId']});if(_0x2a015f[_0x8652('0x19')]&&_0x2a015f['extension']['hasOwnProperty'](_0x8652('0x22'))&&_0x2a015f[_0x8652('0x19')]['recordingFormat']!=='none'){_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':_0x8652('0x11'),'appdata':_0x8652('0x23')+_0x2a015f[_0x8652('0x19')]['recordingFormat']||_0x8652('0x24'),'context':_0x4a8d78[_0x1762db][0x0]['context'],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});}}_0x2a015f[_0x8652('0xf')]['push']({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':_0x8652('0x11'),'appdata':_0x8652('0x25'),'context':_0x4a8d78[_0x1762db][0x0]['context'],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f['priority']++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});_0x2a015f[_0x8652('0xf')][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':_0x8652('0x26'),'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});_0x2a015f['extensions'][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0][_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'exten':_0x4a8d78[_0x1762db][0x0][_0x8652('0xa')],'priority':_0x2a015f[_0x8652('0xe')]++,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});for(var _0x3118e6=0x0,_0x2823f4=0x0;_0x3118e6<_0x4a8d78[_0x1762db][_0x8652('0x27')];_0x3118e6+=0x1,_0x2823f4=0x0){var _0x5c9f8b=_0x4a8d78[_0x1762db][_0x3118e6];if(_0x5c9f8b[_0x8652('0x14')]){_0x5c9f8b[_0x8652('0x14')]=_0x5c9f8b[_0x8652('0x14')][_0x8652('0x28')]();}var _0x1df9dc=[];var _0x5e48a7=[];delete _0x5c9f8b['id'];delete _0x5c9f8b['createdAt'];delete _0x5c9f8b[_0x8652('0x29')];var _0x3d295c=_0x5c9f8b[_0x8652('0x2a')]!==_0x8652('0x2b')?[_0x5c9f8b[_0x8652('0x2a')]]:_0x5c9f8b['IntervalId']?_[_0x8652('0x7')](_[_0x8652('0x9')](_0x2a015f['intervals'],{'IntervalId':_0x5c9f8b[_0x8652('0x2c')]}),'interval'):[];if(_0x5c9f8b[_0x8652('0xd')]('tag')){if(_0x5c9f8b[_0x8652('0x2d')]&&_0x5c9f8b[_0x8652('0x2d')]!=='--'){_0x1df9dc[_0x8652('0x1d')]({'type':_0x5c9f8b[_0x8652('0x14')],'app':'Set','appdata':'CDR(tag)='+_0x5c9f8b[_0x8652('0x2d')],'context':_0x5c9f8b['context'],'exten':_0x5c9f8b[_0x8652('0xa')],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f[_0x8652('0xe')]+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b[_0x8652('0x16')]});}}if(_0x5c9f8b['type']===_0x8652('0x18')&&_0x5c9f8b[_0x8652('0xd')](_0x8652('0x2e'))){if(_0x5c9f8b['callerID']){_0x1df9dc[_0x8652('0x1d')]({'type':_0x5c9f8b['type'],'app':_0x8652('0x2f'),'appdata':_0x8652('0x30')+_0x5c9f8b[_0x8652('0x2e')]+')','context':_0x5c9f8b['context'],'exten':_0x5c9f8b['exten'],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f[_0x8652('0xe')]+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b[_0x8652('0x16')]});}else{_0x1df9dc[_0x8652('0x1d')]({'type':_0x5c9f8b[_0x8652('0x14')],'app':'ExecIf','appdata':_0x8652('0x31'),'context':_0x5c9f8b['context'],'exten':_0x5c9f8b['exten'],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f[_0x8652('0xe')]+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b['VoiceExtensionId']});}}if(_0x5c9f8b[_0x8652('0xd')]('answer')){if(_0x131d59['indexOf'](_0x5c9f8b[_0x8652('0x32')][_0x8652('0x28')]())>=0x0&&_0x5c9f8b[_0x8652('0x33')]!==_0x8652('0x34')){if(_0x5c9f8b[_0x8652('0x35')]){_0x1df9dc['push']({'type':_0x5c9f8b[_0x8652('0x14')],'app':_0x8652('0x2f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5c9f8b[_0x8652('0x15')],'exten':_0x5c9f8b[_0x8652('0xa')],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f['priority']+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b[_0x8652('0x16')]});_0x1df9dc[_0x8652('0x1d')]({'type':_0x5c9f8b[_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':_0x8652('0x36'),'context':_0x5c9f8b['context'],'exten':_0x5c9f8b[_0x8652('0xa')],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f['priority']+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b['VoiceExtensionId']});}else{_0x1df9dc['push']({'type':_0x5c9f8b[_0x8652('0x14')],'app':'ExecIf','appdata':_0x8652('0x37'),'context':_0x5c9f8b[_0x8652('0x15')],'exten':_0x5c9f8b[_0x8652('0xa')],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f[_0x8652('0xe')]+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b[_0x8652('0x16')]});_0x1df9dc[_0x8652('0x1d')]({'type':_0x5c9f8b[_0x8652('0x14')],'app':_0x8652('0x11'),'appdata':_0x8652('0x38'),'context':_0x5c9f8b['context'],'exten':_0x5c9f8b['exten'],'priority':_0x3d295c[_0x8652('0x27')]+_0x2a015f[_0x8652('0xe')]+_0x2823f4++,'VoiceExtensionId':_0x5c9f8b[_0x8652('0x16')]});}}}for(var _0x524a86=0x0;_0x524a86<_0x3d295c[_0x8652('0x27')];_0x524a86+=0x1){var _0x65f65e=_0x2a015f['priority']+_0x3d295c[_0x8652('0x27')];var _0x27fc6e=_0x524a86===_0x3d295c[_0x8652('0x27')]-0x1?_0x2a015f['priority']+_0x1df9dc[_0x8652('0x27')]+_0x5e48a7[_0x8652('0x27')]+0x2:_0x2a015f[_0x8652('0xe')]+_0x524a86+0x1;_0x1df9dc['splice'](_0x524a86,0x0,{'type':_0x5c9f8b[_0x8652('0x14')],'app':'GotoIfTime','appdata':_0x3d295c[_0x524a86]+'?'+_0x5c9f8b[_0x8652('0x15')]+',${EXTEN},'+_0x65f65e+':'+_0x5c9f8b[_0x8652('0x15')]+_0x8652('0x39')+_0x27fc6e,'exten':_0x5c9f8b[_0x8652('0xa')],'context':_0x5c9f8b[_0x8652('0x15')],'priority':_0x2a015f[_0x8652('0xe')]+_0x524a86,'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]});}_0x5c9f8b[_0x8652('0xe')]=_0x1df9dc[_0x8652('0x27')]?_[_0x8652('0x3a')](_0x1df9dc)['priority']+0x1:_0x2a015f[_0x8652('0xe')];_0x2a015f[_0x8652('0xe')]=(_0x5e48a7[_0x8652('0x27')]?_[_0x8652('0x3a')](_0x5e48a7)[_0x8652('0xe')]:_0x5c9f8b[_0x8652('0xe')])+0x1;_0x2a015f['extensions']=_['concat'](_0x2a015f['extensions'],_0x1df9dc,[_0x5c9f8b],_0x5e48a7);}_0x2a015f[_0x8652('0xf')][_0x8652('0x1d')]({'type':_0x4a8d78[_0x1762db][0x0]['type'],'app':'Hangup','exten':_0x4a8d78[_0x1762db][0x0]['exten'],'context':_0x4a8d78[_0x1762db][0x0][_0x8652('0x15')],'priority':_0x2a015f[_0x8652('0xe')],'VoiceExtensionId':_0x4a8d78[_0x1762db][0x0]['VoiceExtensionId']});_0x1ae64b[_0x8652('0x1d')](_0x4a8d78[_0x1762db][0x0][_0x8652('0x16')]);_0x3a3d77=_[_0x8652('0x3b')](_0x3a3d77,_0x2a015f[_0x8652('0xf')]);}}return _0x5e0e7['transaction'](function(_0x251ff7){return _0x5e0e7['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1ae64b}},'transaction':_0x251ff7})[_0x8652('0x4')](function(_0x33c379){return _0x5e0e7[_0x8652('0x1')]['VoiceExtension'][_0x8652('0x3c')](_[_0x8652('0x3d')](_0x3a3d77,'priority'),{'transaction':_0x251ff7});});});})[_0x8652('0x3e')](function(_0x2a3c8c){console[_0x8652('0x3f')](_0x2a3c8c);});}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 796624e..30bea5b 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 _0x5d69=['lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','phone','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','VoiceQueue','dialCheckDuplicateType','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','outbound','CmList','get','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resolve','unlinkSync','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util'];(function(_0x1599ae,_0x50ac2b){var _0x5c97cc=function(_0x4e0c3b){while(--_0x4e0c3b){_0x1599ae['push'](_0x1599ae['shift']());}};_0x5c97cc(++_0x50ac2b);}(_0x5d69,0x1a6));var _0x95d6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d69[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x95d6('0x0'));var util=require(_0x95d6('0x1'));var _=require(_0x95d6('0x2'));var fs=require('fs');var squel=require(_0x95d6('0x3'));var Papa=require(_0x95d6('0x4'));var Redis=require(_0x95d6('0x5'));var db=require(_0x95d6('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x95d6('0x7'))(_0x95d6('0x8'));config['redis']=_[_0x95d6('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x95d6('0xa'))(new Redis(config['redis']));require(_0x95d6('0xb'))['register'](socket);try{if(!process[_0x95d6('0xc')][0x2]||process[_0x95d6('0xc')][0x2]===_0x95d6('0xd')||process[_0x95d6('0xc')][0x2]===_0x95d6('0xe')){throw new Error(_0x95d6('0xf'));}var FILEPATH=process[_0x95d6('0xc')][0x2];if(!process[_0x95d6('0xc')][0x3]||process[_0x95d6('0xc')][0x3]==='undefined'||process[_0x95d6('0xc')][0x3]==='null'||!process[_0x95d6('0xc')][0x4]||process[_0x95d6('0xc')][0x4]==='undefined'||process[_0x95d6('0xc')][0x4]===_0x95d6('0xe')){throw new Error(_0x95d6('0x10'));}var FIELDS=_[_0x95d6('0x11')](process[_0x95d6('0xc')][0x3][_0x95d6('0x12')](','),process['argv'][0x4]['split'](','));if(!process[_0x95d6('0xc')][0x5]||process['argv'][0x5]===_0x95d6('0xd')||process['argv'][0x5]==='null'){throw new Error(_0x95d6('0x13'));}var LISTID=process[_0x95d6('0xc')][0x5];var COMPANYID=process[_0x95d6('0xc')][0x6]&&process[_0x95d6('0xc')][0x6]!==_0x95d6('0xd')&&process[_0x95d6('0xc')][0x6]!==_0x95d6('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x95d6('0xc')][0x7]&&process[_0x95d6('0xc')][0x7]!==_0x95d6('0xd')&&process['argv'][0x7]!=='null'?process[_0x95d6('0xc')][0x7]:null;if(!process[_0x95d6('0xc')][0x8]||process[_0x95d6('0xc')][0x8]==='undefined'||process['argv'][0x8]===_0x95d6('0xe')){throw new Error(_0x95d6('0x14'));}var SOCKET_TIMESTAMP=process[_0x95d6('0xc')][0x8];}catch(_0x36cb54){logger[_0x95d6('0x15')](_0x36cb54);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(_0x2cadb9,_0x210a35,_0x32d299,_0x2ceef7){var _0x4605ff={'message':_0x210a35};_0x4605ff[_0x2cadb9]=!![];if(_0x32d299){_0x4605ff[_0x95d6('0x16')]=_0x32d299;}if(_0x2ceef7){_0x4605ff[_0x95d6('0x17')]=_0x2ceef7;}return _0x4605ff;}function isEmail(_0x4f7416){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'](_0x4f7416);}function checkRow(_0x10b89d,_0x2c2297,_0x3bc650){return new BPromise(function(_0x3abe80,_0x225ce){if(_[_0x95d6('0x18')](_0x10b89d)){return _0x225ce(handleCheckRowError('error',_0x95d6('0x19'),null,_0x3bc650));}if(_0x10b89d[_0x95d6('0x1a')]&&_0x10b89d[_0x95d6('0x1a')][_0x95d6('0x1b')]){var _0x41ef68=_[_0x95d6('0x1c')](_0x10b89d['errors'],_0x95d6('0x1d'))['join'](';');return _0x225ce(handleCheckRowError('error',_0x41ef68,null,_0x3bc650));}var _0x42b18a={};for(var _0x49d980 in FIELDS){if(FIELDS['hasOwnProperty'](_0x49d980)&&FIELDS[_0x49d980]){_0x42b18a[_0x49d980]=_0x10b89d[_0x95d6('0x1e')][0x0][FIELDS[_0x49d980]]||_0x10b89d[_0x95d6('0x1e')][0x0]['\ufeff'+FIELDS[_0x49d980]];}}if(!_0x42b18a['firstName']){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),'firstName\x20not\x20specified!',null,_0x3bc650));}if(!_0x42b18a[_0x95d6('0x1f')]){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),'phone\x20not\x20specified!',null,_0x3bc650));}if(_0x42b18a[_0x95d6('0x20')]){var _0xe699e=moment(_0x42b18a[_0x95d6('0x20')],'YYYY-MM-DD');if(!_0xe699e[_0x95d6('0x21')]()){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x22'),null,_0x3bc650));}}if(_0x42b18a[_0x95d6('0x23')]){if(!isEmail(_0x42b18a[_0x95d6('0x23')])){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x24'),null,_0x3bc650));}}_0x42b18a['ListId']=LISTID;_0x42b18a[_0x95d6('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x95d6('0x1b')]&&_0x2c2297){var _0x2717bc={};for(var _0x4108f6=0x0,_0x5e9eb7=DUPLICATES['length'];_0x4108f6<_0x5e9eb7;_0x4108f6+=0x1){_0x2717bc[DUPLICATES[_0x4108f6]]=_0x42b18a[DUPLICATES[_0x4108f6]];}var _0x3f9ea2=_[_0x95d6('0x26')](_0x2c2297,_0x2717bc);if(_0x3f9ea2){return _0x225ce(handleCheckRowError(_0x95d6('0x27'),_0x95d6('0x28'),_0x3f9ea2,_0x3bc650));}}return db[_0x95d6('0x29')][_0x95d6('0x2a')](_0x42b18a,{'raw':!![],'hooks':![],'fields':_[_0x95d6('0x2b')](_0x42b18a)})[_0x95d6('0x2c')](function(_0x92ef0b){if(DUPLICATES&&DUPLICATES[_0x95d6('0x1b')]&&_0x2c2297){_0x2c2297[_0x95d6('0x2d')](_[_0x95d6('0x2e')](_0x42b18a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x92ef0b['id'];return _0x3abe80();})[_0x95d6('0x2f')](function(_0x22c0b6){return _0x225ce(handleCheckRowError(_0x95d6('0x15'),_0x95d6('0x30')+(_0x22c0b6[_0x95d6('0x1d')]||JSON[_0x95d6('0x31')](_0x22c0b6)),null,_0x3bc650));});});}function checkHopper(){function _0x5421f3(){return function(_0x51ca8b){logger[_0x95d6('0x15')](_0x95d6('0x32'),_0x95d6('0x33'),util[_0x95d6('0x34')](_0x51ca8b,{'showHidden':![],'depth':null}));};}var _0x1dc0d3=function(_0x3bbd95,_0x293fdb){var _0x27e5c8=squel[_0x95d6('0x35')]()[_0x95d6('0x36')](_0x95d6('0x37'))[_0x95d6('0x38')]([_0x95d6('0x1f'),_0x95d6('0x39'),_0x95d6('0x3a'),_0x95d6('0x3b'),_0x293fdb,_0x95d6('0x3c'),_0x95d6('0x3d')],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'),_0x95d6('0x1f'))[_0x95d6('0x3f')](_0x95d6('0x40'),'scheduledAt')[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),_0x95d6('0x3b'))[_0x95d6('0x3f')](_0x3bbd95['id'][_0x95d6('0x41')](),_0x293fdb)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3d'))['from'](_0x95d6('0x42'))[_0x95d6('0x43')](_0x95d6('0x44'))['where'](_0x95d6('0x45'),LISTID[_0x95d6('0x41')]())['where'](_0x95d6('0x46'))[_0x95d6('0x43')](_0x95d6('0x47'),squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'))[_0x95d6('0x48')](_0x95d6('0x37'))['where'](_0x293fdb+_0x95d6('0x49'),_0x3bbd95['id'][_0x95d6('0x41')]())))['toString']();return _0x27e5c8;};var _0x1626ea=function(_0x33ba3a,_0x5aba82){var _0x3b0b56=squel[_0x95d6('0x35')]()[_0x95d6('0x36')](_0x95d6('0x37'))[_0x95d6('0x38')]([_0x95d6('0x1f'),_0x95d6('0x39'),'ContactId','ListId',_0x5aba82,_0x95d6('0x3c'),_0x95d6('0x3d')],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')](_0x95d6('0x1f'),'phone')[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x39'))[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))['field'](LISTID[_0x95d6('0x41')](),_0x95d6('0x3b'))[_0x95d6('0x3f')](_0x33ba3a['id'][_0x95d6('0x41')](),_0x5aba82)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))['field']('NOW()',_0x95d6('0x3d'))[_0x95d6('0x48')]('cm_contacts')['where'](_0x95d6('0x44'))[_0x95d6('0x43')](_0x95d6('0x45'),LISTID[_0x95d6('0x41')]())[_0x95d6('0x43')](_0x95d6('0x4a'),squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')](_0x95d6('0x46'))[_0x95d6('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('calleridnum')[_0x95d6('0x48')](_0x95d6('0x4c'))[_0x95d6('0x43')](_0x5aba82+_0x95d6('0x49'),_0x33ba3a['id'][_0x95d6('0x41')]()))[_0x95d6('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x95d6('0x3e')]()['field'](_0x95d6('0x1f'))['from'](_0x95d6('0x37'))[_0x95d6('0x43')](_0x5aba82+_0x95d6('0x49'),_0x33ba3a['id'][_0x95d6('0x41')]())))[_0x95d6('0x41')]();return _0x3b0b56;};function _0xb91a5(_0x934eb2,_0x55e2c5){var _0x39028f=squel[_0x95d6('0x35')]()[_0x95d6('0x36')]('cm_hopper')['fromQuery']([_0x95d6('0x1f'),_0x95d6('0x39'),_0x95d6('0x3a'),'ListId',_0x55e2c5,_0x95d6('0x3c'),'updatedAt'],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('phone','phone')[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x39'))[_0x95d6('0x3f')]('id','ContactId')[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),'ListId')[_0x95d6('0x3f')](_0x934eb2['id'][_0x95d6('0x41')](),_0x55e2c5)[_0x95d6('0x3f')]('NOW()',_0x95d6('0x3c'))[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3d'))[_0x95d6('0x48')](_0x95d6('0x42'))[_0x95d6('0x43')](_0x95d6('0x44'))[_0x95d6('0x43')]('ListId\x20=\x20?',LISTID['toString']())[_0x95d6('0x43')]('id\x20IN\x20?',squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x39028f;}function _0x224f9e(_0x490690,_0xc8f357){var _0x5e77af=squel[_0x95d6('0x35')]()[_0x95d6('0x36')]('cm_hopper_black')[_0x95d6('0x38')](['phone','ContactId',_0x95d6('0x3b'),_0xc8f357,_0x95d6('0x3c'),'updatedAt'],squel[_0x95d6('0x3e')]()[_0x95d6('0x3f')]('phone','phone')[_0x95d6('0x3f')]('id',_0x95d6('0x3a'))[_0x95d6('0x3f')](LISTID[_0x95d6('0x41')](),'ListId')[_0x95d6('0x3f')](_0x490690['id'][_0x95d6('0x41')](),_0xc8f357)[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3c'))[_0x95d6('0x3f')](_0x95d6('0x40'),_0x95d6('0x3d'))[_0x95d6('0x48')](_0x95d6('0x42'))[_0x95d6('0x43')]('deletedAt\x20IS\x20NULL')[_0x95d6('0x43')]('ListId\x20=\x20?',LISTID[_0x95d6('0x41')]())[_0x95d6('0x43')](_0x95d6('0x4a'),squel[_0x95d6('0x4b')](hopperContacts))[_0x95d6('0x43')](_0x95d6('0x46')))[_0x95d6('0x41')]();return _0x5e77af;}return db[_0x95d6('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x95d6('0x4e')],'include':[{'model':db['CmList'],'as':_0x95d6('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x1c0d02){var _0x1fb52f=[];if(_0x1c0d02){var _0x228a56;for(var _0x10a4c5=0x0,_0x4ac468;_0x10a4c5<_0x1c0d02[_0x95d6('0x1b')];_0x10a4c5+=0x1){_0x4ac468=_0x1c0d02[_0x10a4c5]['get']({'plain':!![]});switch(_0x4ac468[_0x95d6('0x4e')]){case _0x95d6('0x50'):_0x1fb52f[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1626ea(_0x4ac468,_0x95d6('0x53')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));break;case _0x95d6('0x54'):_0x1fb52f[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1dc0d3(_0x4ac468,'VoiceQueueId'))[_0x95d6('0x2c')](function(){})['catch'](_0x5421f3()));break;default:_0x1fb52f['push'](db[_0x95d6('0x51')][_0x95d6('0x52')](_0xb91a5(_0x4ac468,_0x95d6('0x53')))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}}return _0x1fb52f;})[_0x95d6('0x55')]()[_0x95d6('0x2c')](function(){return db[_0x95d6('0x4d')][_0x95d6('0x56')]({'where':{'type':_0x95d6('0x57')},'attributes':['id'],'include':[{'model':db[_0x95d6('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0xc1c65e){var _0x33ba48=[];if(_0xc1c65e){var _0x6636d1;for(var _0x55c43a=0x0,_0x2d5e4f;_0x55c43a<_0xc1c65e[_0x95d6('0x1b')];_0x55c43a+=0x1){_0x2d5e4f=_0xc1c65e[_0x55c43a][_0x95d6('0x59')]({'plain':!![]});_0x33ba48[_0x95d6('0x2d')](db['sequelize']['query'](_0x224f9e(_0x2d5e4f,_0x95d6('0x53')))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}return _0x33ba48;})[_0x95d6('0x55')]();})['then'](function(){return db['Campaign'][_0x95d6('0x56')]({'attributes':['id',_0x95d6('0x4e')],'include':[{'model':db[_0x95d6('0x58')],'as':_0x95d6('0x4f'),'where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0x2c8e0f){var _0x21b220=[];if(_0x2c8e0f){for(var _0x5a9912=0x0,_0x26e7c9;_0x5a9912<_0x2c8e0f[_0x95d6('0x1b')];_0x5a9912+=0x1){_0x26e7c9=_0x2c8e0f[_0x5a9912][_0x95d6('0x59')]({'plain':!![]});switch(_0x26e7c9[_0x95d6('0x4e')]){case _0x95d6('0x50'):_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1626ea(_0x26e7c9,_0x95d6('0x5a')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));break;case _0x95d6('0x54'):_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')][_0x95d6('0x52')](_0x1dc0d3(_0x26e7c9,_0x95d6('0x5a')))[_0x95d6('0x2c')](function(){})['catch'](_0x5421f3()));break;default:_0x21b220[_0x95d6('0x2d')](db[_0x95d6('0x51')]['query'](_0xb91a5(_0x26e7c9,'CampaignId'))[_0x95d6('0x2c')](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}}return _0x21b220;})['all']();})['then'](function(){return db[_0x95d6('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x95d6('0x58')],'as':_0x95d6('0x5c'),'where':{'id':LISTID}}]})[_0x95d6('0x2c')](function(_0x2b21c7){var _0x59e2ed=[];if(_0x2b21c7){for(var _0x449d52=0x0,_0x28187d;_0x449d52<_0x2b21c7[_0x95d6('0x1b')];_0x449d52+=0x1){_0x28187d=_0x2b21c7[_0x449d52]['get']({'plain':!![]});_0x59e2ed[_0x95d6('0x2d')](db[_0x95d6('0x51')]['query'](_0x224f9e(_0x28187d,_0x95d6('0x5a')))['then'](function(){})[_0x95d6('0x2f')](_0x5421f3()));}}return _0x59e2ed;})['all']();})[_0x95d6('0x2f')](function(_0x384e0b){logger[_0x95d6('0x15')](_0x95d6('0x5d'),_0x95d6('0x5e'),_0x384e0b[_0x95d6('0x1d')]);});}var processPromises=function(_0xfff370){return BPromise[_0x95d6('0x55')](promises)[_0x95d6('0x2c')](function(_0x10d3ab){})[_0x95d6('0x2f')](function(_0x49e6b0){logger[_0x95d6('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0x95d6('0x31')](_0x49e6b0));})['finally'](function(){socket[_0x95d6('0x5f')](_0x95d6('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xfff370){return _0xfff370['resume']();}});};var endCsv=function(){return BPromise[_0x95d6('0x61')]()[_0x95d6('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x95d6('0x2c')](function(){socket[_0x95d6('0x5f')](_0x95d6('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x95d6('0x62')](FILEPATH);}catch(_0x2de296){logger[_0x95d6('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x95d6('0x31')](_0x2de296));}finally{process['exit'](0x0);}});};process['on'](_0x95d6('0x63'),function(){logger['info'](_0x95d6('0x64'));endCsv();});function main(){return BPromise[_0x95d6('0x61')]()[_0x95d6('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x95d6('0x12')](',');return db[_0x95d6('0x29')][_0x95d6('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x95d6('0x2c')](function(_0x519056){var _0xe8ea36=fs[_0x95d6('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0xe8ea36,{'header':!![],'skipEmptyLines':!![],'step':function(_0x52405f,_0x4f0386){total+=0x1;var _0x57ad50=total;promises['push'](checkRow(_0x52405f,_0x519056,_0x57ad50)[_0x95d6('0x2c')](function(){success+=0x1;})[_0x95d6('0x2f')](function(_0xc60379){if(_0xc60379[_0x95d6('0x15')]){errors+=0x1;delete _0xc60379['error'];}else if(_0xc60379[_0x95d6('0x27')]){duplicates+=0x1;delete _0xc60379[_0x95d6('0x27')];}rows[_0x95d6('0x2d')](_0xc60379);}));if(total%0xc8===0x0){_0x4f0386[_0x95d6('0x66')]();return processPromises(_0x4f0386);}},'complete':function(){return processPromises()[_0x95d6('0x2c')](function(){logger[_0x95d6('0x67')](_0x95d6('0x68'));endCsv();});},'error':function(_0x4780cd,_0x2aafaa){logger[_0x95d6('0x67')]('CSV\x20parse\x20error',JSON[_0x95d6('0x31')](_0x4780cd));endCsv();}});})[_0x95d6('0x2f')](function(_0x56c973){logger[_0x95d6('0x15')](_0x95d6('0x69'),JSON[_0x95d6('0x31')](_0x56c973));});}main(); \ No newline at end of file +var _0xe0e5=['cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','findAll','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','all','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','resolve','split','CmContact','parse','duplicate','pause','CSV\x20parsed\x20correctly!','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','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','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper','scheduledAt','id\x20IN\x20?','str','\x20=\x20?'];(function(_0x39d9ec,_0x4ed6e5){var _0x499ff0=function(_0x565eaf){while(--_0x565eaf){_0x39d9ec['push'](_0x39d9ec['shift']());}};_0x499ff0(++_0x4ed6e5);}(_0xe0e5,0x1d7));var _0x5e0e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe0e5[_0x4ff09b];return _0x3f5c2e;};'use strict';var BPromise=require(_0x5e0e('0x0'));var util=require(_0x5e0e('0x1'));var _=require(_0x5e0e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5e0e('0x3'));var Redis=require(_0x5e0e('0x4'));var db=require(_0x5e0e('0x5'))['db'];var config=require(_0x5e0e('0x6'));var logger=require('../../../config/logger')(_0x5e0e('0x7'));config[_0x5e0e('0x8')]=_['defaults'](config[_0x5e0e('0x8')],{'host':_0x5e0e('0x9'),'port':0x18eb});var socket=require(_0x5e0e('0xa'))(new Redis(config[_0x5e0e('0x8')]));require(_0x5e0e('0xb'))['register'](socket);try{if(!process[_0x5e0e('0xc')][0x2]||process['argv'][0x2]==='undefined'||process[_0x5e0e('0xc')][0x2]===_0x5e0e('0xd')){throw new Error(_0x5e0e('0xe'));}var FILEPATH=process[_0x5e0e('0xc')][0x2];if(!process[_0x5e0e('0xc')][0x3]||process['argv'][0x3]===_0x5e0e('0xf')||process['argv'][0x3]==='null'||!process[_0x5e0e('0xc')][0x4]||process[_0x5e0e('0xc')][0x4]===_0x5e0e('0xf')||process[_0x5e0e('0xc')][0x4]===_0x5e0e('0xd')){throw new Error(_0x5e0e('0x10'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process[_0x5e0e('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x5e0e('0xf')||process[_0x5e0e('0xc')][0x5]==='null'){throw new Error(_0x5e0e('0x11'));}var LISTID=process[_0x5e0e('0xc')][0x5];var COMPANYID=process[_0x5e0e('0xc')][0x6]&&process['argv'][0x6]!==_0x5e0e('0xf')&&process['argv'][0x6]!==_0x5e0e('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0x5e0e('0xc')][0x7]&&process[_0x5e0e('0xc')][0x7]!==_0x5e0e('0xf')&&process[_0x5e0e('0xc')][0x7]!=='null'?process[_0x5e0e('0xc')][0x7]:null;if(!process[_0x5e0e('0xc')][0x8]||process['argv'][0x8]==='undefined'||process[_0x5e0e('0xc')][0x8]===_0x5e0e('0xd')){throw new Error(_0x5e0e('0x12'));}var SOCKET_TIMESTAMP=process[_0x5e0e('0xc')][0x8];}catch(_0x24d4fb){logger[_0x5e0e('0x13')](_0x24d4fb);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(_0x5cfa93,_0x3776b7,_0x541768,_0x1285f7){var _0x3328e7={'message':_0x3776b7};_0x3328e7[_0x5cfa93]=!![];if(_0x541768){_0x3328e7[_0x5e0e('0x14')]=_0x541768;}if(_0x1285f7){_0x3328e7['index']=_0x1285f7;}return _0x3328e7;}function isEmail(_0x4a39c2){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))*$/[_0x5e0e('0x15')](_0x4a39c2);}function checkRow(_0x4b0134,_0x1f0326,_0x323b99){return new BPromise(function(_0x5ad37a,_0x5a187c){if(_[_0x5e0e('0x16')](_0x4b0134)){return _0x5a187c(handleCheckRowError('error',_0x5e0e('0x17'),null,_0x323b99));}if(_0x4b0134[_0x5e0e('0x18')]&&_0x4b0134[_0x5e0e('0x18')][_0x5e0e('0x19')]){var _0x284c30=_['map'](_0x4b0134[_0x5e0e('0x18')],'message')['join'](';');return _0x5a187c(handleCheckRowError(_0x5e0e('0x13'),_0x284c30,null,_0x323b99));}var _0x30c7d7={};for(var _0x3d26e2 in FIELDS){if(FIELDS[_0x5e0e('0x1a')](_0x3d26e2)&&FIELDS[_0x3d26e2]){_0x30c7d7[_0x3d26e2]=_0x4b0134['data'][0x0][FIELDS[_0x3d26e2]]||_0x4b0134[_0x5e0e('0x1b')][0x0]['\ufeff'+FIELDS[_0x3d26e2]];}}if(!_0x30c7d7[_0x5e0e('0x1c')]){return _0x5a187c(handleCheckRowError('error',_0x5e0e('0x1d'),null,_0x323b99));}if(!_0x30c7d7[_0x5e0e('0x1e')]){return _0x5a187c(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x323b99));}if(_0x30c7d7[_0x5e0e('0x1f')]){var _0x473e24=moment(_0x30c7d7[_0x5e0e('0x1f')],_0x5e0e('0x20'));if(!_0x473e24[_0x5e0e('0x21')]()){return _0x5a187c(handleCheckRowError(_0x5e0e('0x13'),_0x5e0e('0x22'),null,_0x323b99));}}if(_0x30c7d7[_0x5e0e('0x23')]){if(!isEmail(_0x30c7d7[_0x5e0e('0x23')])){return _0x5a187c(handleCheckRowError(_0x5e0e('0x13'),_0x5e0e('0x24'),null,_0x323b99));}}_0x30c7d7[_0x5e0e('0x25')]=LISTID;_0x30c7d7[_0x5e0e('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x1f0326){var _0x49dfdb={};for(var _0x24d7f9=0x0,_0x134d6d=DUPLICATES[_0x5e0e('0x19')];_0x24d7f9<_0x134d6d;_0x24d7f9+=0x1){_0x49dfdb[DUPLICATES[_0x24d7f9]]=_0x30c7d7[DUPLICATES[_0x24d7f9]];}var _0x2e028d=_[_0x5e0e('0x27')](_0x1f0326,_0x49dfdb);if(_0x2e028d){return _0x5a187c(handleCheckRowError('duplicate',_0x5e0e('0x28'),_0x2e028d,_0x323b99));}}return db['CmContact'][_0x5e0e('0x29')](_0x30c7d7,{'raw':!![],'hooks':![],'fields':_[_0x5e0e('0x2a')](_0x30c7d7)})[_0x5e0e('0x2b')](function(_0x471cf4){if(DUPLICATES&&DUPLICATES['length']&&_0x1f0326){_0x1f0326[_0x5e0e('0x2c')](_[_0x5e0e('0x2d')](_0x30c7d7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x471cf4['id'];return _0x5ad37a();})['catch'](function(_0x3f7789){return _0x5a187c(handleCheckRowError(_0x5e0e('0x13'),_0x5e0e('0x2e')+(_0x3f7789[_0x5e0e('0x2f')]||JSON[_0x5e0e('0x30')](_0x3f7789)),null,_0x323b99));});});}function checkHopper(){function _0x4060c0(){return function(_0x184dfa){logger[_0x5e0e('0x13')](_0x5e0e('0x31'),_0x5e0e('0x32'),util[_0x5e0e('0x33')](_0x184dfa,{'showHidden':![],'depth':null}));};}var _0x301593=function(_0x41676e,_0x2a40e8){var _0x3721f4=squel[_0x5e0e('0x34')]()[_0x5e0e('0x35')]('cm_hopper')[_0x5e0e('0x36')]([_0x5e0e('0x1e'),'scheduledAt',_0x5e0e('0x37'),_0x5e0e('0x25'),_0x2a40e8,_0x5e0e('0x38'),_0x5e0e('0x39')],squel['select']()['field'](_0x5e0e('0x1e'),_0x5e0e('0x1e'))[_0x5e0e('0x3a')](_0x5e0e('0x3b'),'scheduledAt')[_0x5e0e('0x3a')]('id',_0x5e0e('0x37'))[_0x5e0e('0x3a')](LISTID[_0x5e0e('0x3c')](),_0x5e0e('0x25'))[_0x5e0e('0x3a')](_0x41676e['id'][_0x5e0e('0x3c')](),_0x2a40e8)['field'](_0x5e0e('0x3b'),_0x5e0e('0x38'))['field'](_0x5e0e('0x3b'),'updatedAt')['from'](_0x5e0e('0x3d'))['where'](_0x5e0e('0x3e'))[_0x5e0e('0x3f')](_0x5e0e('0x40'),LISTID[_0x5e0e('0x3c')]())[_0x5e0e('0x3f')](_0x5e0e('0x41'))[_0x5e0e('0x3f')](_0x5e0e('0x42'),squel[_0x5e0e('0x43')]()[_0x5e0e('0x3a')](_0x5e0e('0x1e'))[_0x5e0e('0x44')](_0x5e0e('0x45'))[_0x5e0e('0x3f')](_0x2a40e8+'\x20=\x20?',_0x41676e['id'][_0x5e0e('0x3c')]())))[_0x5e0e('0x3c')]();return _0x3721f4;};var _0x117c8c=function(_0x869416,_0x48675b){var _0x3b70c2=squel['insert']()[_0x5e0e('0x35')](_0x5e0e('0x45'))[_0x5e0e('0x36')]([_0x5e0e('0x1e'),_0x5e0e('0x46'),'ContactId',_0x5e0e('0x25'),_0x48675b,_0x5e0e('0x38'),_0x5e0e('0x39')],squel['select']()[_0x5e0e('0x3a')](_0x5e0e('0x1e'),_0x5e0e('0x1e'))[_0x5e0e('0x3a')](_0x5e0e('0x3b'),_0x5e0e('0x46'))[_0x5e0e('0x3a')]('id',_0x5e0e('0x37'))[_0x5e0e('0x3a')](LISTID[_0x5e0e('0x3c')](),'ListId')[_0x5e0e('0x3a')](_0x869416['id'][_0x5e0e('0x3c')](),_0x48675b)[_0x5e0e('0x3a')](_0x5e0e('0x3b'),_0x5e0e('0x38'))['field'](_0x5e0e('0x3b'),_0x5e0e('0x39'))[_0x5e0e('0x44')](_0x5e0e('0x3d'))[_0x5e0e('0x3f')](_0x5e0e('0x3e'))[_0x5e0e('0x3f')](_0x5e0e('0x40'),LISTID[_0x5e0e('0x3c')]())['where'](_0x5e0e('0x47'),squel[_0x5e0e('0x48')](hopperContacts))['where'](_0x5e0e('0x41'))[_0x5e0e('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5e0e('0x43')]()['field']('calleridnum')[_0x5e0e('0x44')]('cm_hopper_final')[_0x5e0e('0x3f')](_0x48675b+_0x5e0e('0x49'),_0x869416['id'][_0x5e0e('0x3c')]()))[_0x5e0e('0x3f')](_0x5e0e('0x42'),squel[_0x5e0e('0x43')]()['field']('phone')[_0x5e0e('0x44')](_0x5e0e('0x45'))[_0x5e0e('0x3f')](_0x48675b+'\x20=\x20?',_0x869416['id'][_0x5e0e('0x3c')]())))[_0x5e0e('0x3c')]();return _0x3b70c2;};function _0x2e3eaf(_0x184aae,_0x42bea6){var _0x4da572=squel[_0x5e0e('0x34')]()[_0x5e0e('0x35')](_0x5e0e('0x45'))[_0x5e0e('0x36')](['phone',_0x5e0e('0x46'),'ContactId',_0x5e0e('0x25'),_0x42bea6,_0x5e0e('0x38'),_0x5e0e('0x39')],squel[_0x5e0e('0x43')]()[_0x5e0e('0x3a')](_0x5e0e('0x1e'),_0x5e0e('0x1e'))[_0x5e0e('0x3a')](_0x5e0e('0x3b'),_0x5e0e('0x46'))[_0x5e0e('0x3a')]('id',_0x5e0e('0x37'))[_0x5e0e('0x3a')](LISTID['toString'](),'ListId')[_0x5e0e('0x3a')](_0x184aae['id'][_0x5e0e('0x3c')](),_0x42bea6)['field'](_0x5e0e('0x3b'),_0x5e0e('0x38'))[_0x5e0e('0x3a')](_0x5e0e('0x3b'),_0x5e0e('0x39'))[_0x5e0e('0x44')](_0x5e0e('0x3d'))[_0x5e0e('0x3f')](_0x5e0e('0x3e'))[_0x5e0e('0x3f')](_0x5e0e('0x40'),LISTID[_0x5e0e('0x3c')]())['where'](_0x5e0e('0x47'),squel['str'](hopperContacts))[_0x5e0e('0x3f')](_0x5e0e('0x41')))[_0x5e0e('0x3c')]();return _0x4da572;}function _0xa34db1(_0x522b0c,_0x46d3a8){var _0x295736=squel[_0x5e0e('0x34')]()[_0x5e0e('0x35')](_0x5e0e('0x4a'))[_0x5e0e('0x36')](['phone',_0x5e0e('0x37'),_0x5e0e('0x25'),_0x46d3a8,_0x5e0e('0x38'),'updatedAt'],squel['select']()['field'](_0x5e0e('0x1e'),'phone')[_0x5e0e('0x3a')]('id',_0x5e0e('0x37'))[_0x5e0e('0x3a')](LISTID[_0x5e0e('0x3c')](),_0x5e0e('0x25'))[_0x5e0e('0x3a')](_0x522b0c['id'][_0x5e0e('0x3c')](),_0x46d3a8)[_0x5e0e('0x3a')]('NOW()',_0x5e0e('0x38'))['field']('NOW()',_0x5e0e('0x39'))[_0x5e0e('0x44')]('cm_contacts')['where'](_0x5e0e('0x3e'))[_0x5e0e('0x3f')](_0x5e0e('0x40'),LISTID[_0x5e0e('0x3c')]())[_0x5e0e('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x5e0e('0x3f')](_0x5e0e('0x41')))[_0x5e0e('0x3c')]();return _0x295736;}return db['VoiceQueue']['findAll']({'where':{'type':_0x5e0e('0x4b')},'attributes':['id',_0x5e0e('0x4c')],'include':[{'model':db[_0x5e0e('0x4d')],'as':_0x5e0e('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x5c47b8){var _0x3093f1=[];if(_0x5c47b8){var _0x4169aa;for(var _0xf95742=0x0,_0x18f75d;_0xf95742<_0x5c47b8[_0x5e0e('0x19')];_0xf95742+=0x1){_0x18f75d=_0x5c47b8[_0xf95742]['get']({'plain':!![]});switch(_0x18f75d[_0x5e0e('0x4c')]){case _0x5e0e('0x4f'):_0x3093f1['push'](db[_0x5e0e('0x50')][_0x5e0e('0x51')](_0x117c8c(_0x18f75d,_0x5e0e('0x52')))['then'](function(){})[_0x5e0e('0x53')](_0x4060c0()));break;case _0x5e0e('0x54'):_0x3093f1[_0x5e0e('0x2c')](db[_0x5e0e('0x50')][_0x5e0e('0x51')](_0x301593(_0x18f75d,'VoiceQueueId'))[_0x5e0e('0x2b')](function(){})[_0x5e0e('0x53')](_0x4060c0()));break;default:_0x3093f1[_0x5e0e('0x2c')](db[_0x5e0e('0x50')]['query'](_0x2e3eaf(_0x18f75d,_0x5e0e('0x52')))['then'](function(){})['catch'](_0x4060c0()));}}}return _0x3093f1;})['all']()[_0x5e0e('0x2b')](function(){return db['VoiceQueue'][_0x5e0e('0x55')]({'where':{'type':_0x5e0e('0x4b')},'attributes':['id'],'include':[{'model':db[_0x5e0e('0x4d')],'as':_0x5e0e('0x56'),'where':{'id':LISTID}}]})[_0x5e0e('0x2b')](function(_0xa4497c){var _0x432f16=[];if(_0xa4497c){var _0x1939b5;for(var _0x51c788=0x0,_0x518357;_0x51c788<_0xa4497c[_0x5e0e('0x19')];_0x51c788+=0x1){_0x518357=_0xa4497c[_0x51c788][_0x5e0e('0x57')]({'plain':!![]});_0x432f16['push'](db[_0x5e0e('0x50')][_0x5e0e('0x51')](_0xa34db1(_0x518357,'VoiceQueueId'))['then'](function(){})['catch'](_0x4060c0()));}}return _0x432f16;})['all']();})['then'](function(){return db[_0x5e0e('0x58')][_0x5e0e('0x55')]({'attributes':['id',_0x5e0e('0x4c')],'include':[{'model':db[_0x5e0e('0x4d')],'as':_0x5e0e('0x4e'),'where':{'id':LISTID}}]})[_0x5e0e('0x2b')](function(_0x2aaefa){var _0x2dcaf8=[];if(_0x2aaefa){for(var _0x1023fc=0x0,_0x1eeac5;_0x1023fc<_0x2aaefa[_0x5e0e('0x19')];_0x1023fc+=0x1){_0x1eeac5=_0x2aaefa[_0x1023fc]['get']({'plain':!![]});switch(_0x1eeac5[_0x5e0e('0x4c')]){case'always':_0x2dcaf8[_0x5e0e('0x2c')](db[_0x5e0e('0x50')]['query'](_0x117c8c(_0x1eeac5,_0x5e0e('0x59')))[_0x5e0e('0x2b')](function(){})[_0x5e0e('0x53')](_0x4060c0()));break;case _0x5e0e('0x54'):_0x2dcaf8[_0x5e0e('0x2c')](db[_0x5e0e('0x50')]['query'](_0x301593(_0x1eeac5,_0x5e0e('0x59')))[_0x5e0e('0x2b')](function(){})[_0x5e0e('0x53')](_0x4060c0()));break;default:_0x2dcaf8[_0x5e0e('0x2c')](db[_0x5e0e('0x50')]['query'](_0x2e3eaf(_0x1eeac5,'CampaignId'))[_0x5e0e('0x2b')](function(){})[_0x5e0e('0x53')](_0x4060c0()));}}}return _0x2dcaf8;})['all']();})[_0x5e0e('0x2b')](function(){return db[_0x5e0e('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x5e0e('0x4d')],'as':_0x5e0e('0x56'),'where':{'id':LISTID}}]})[_0x5e0e('0x2b')](function(_0x4dacf4){var _0x2b1253=[];if(_0x4dacf4){for(var _0x57ce6b=0x0,_0x498365;_0x57ce6b<_0x4dacf4[_0x5e0e('0x19')];_0x57ce6b+=0x1){_0x498365=_0x4dacf4[_0x57ce6b][_0x5e0e('0x57')]({'plain':!![]});_0x2b1253[_0x5e0e('0x2c')](db[_0x5e0e('0x50')][_0x5e0e('0x51')](_0xa34db1(_0x498365,_0x5e0e('0x59')))[_0x5e0e('0x2b')](function(){})['catch'](_0x4060c0()));}}return _0x2b1253;})['all']();})[_0x5e0e('0x53')](function(_0x13aec5){logger[_0x5e0e('0x13')](_0x5e0e('0x5a'),_0x5e0e('0x5b'),_0x13aec5[_0x5e0e('0x2f')]);});}var processPromises=function(_0x3038f4){return BPromise[_0x5e0e('0x5c')](promises)[_0x5e0e('0x2b')](function(_0x1daa1d){})[_0x5e0e('0x53')](function(_0x22460f){logger[_0x5e0e('0x13')](_0x5e0e('0x5d'),JSON[_0x5e0e('0x30')](_0x22460f));})[_0x5e0e('0x5e')](function(){socket[_0x5e0e('0x5f')](_0x5e0e('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3038f4){return _0x3038f4[_0x5e0e('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x5e0e('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x5e0e('0x2b')](function(){socket[_0x5e0e('0x5f')](_0x5e0e('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5e0e('0x62')](FILEPATH);}catch(_0x5e907a){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x5e0e('0x30')](_0x5e907a));}finally{process[_0x5e0e('0x63')](0x0);}});};process['on']('SIGINT',function(){logger[_0x5e0e('0x64')](_0x5e0e('0x65'));endCsv();});function main(){return BPromise[_0x5e0e('0x66')]()[_0x5e0e('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5e0e('0x67')](',');return db[_0x5e0e('0x68')][_0x5e0e('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5e0e('0x2b')](function(_0x223a57){var _0x158d2f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5e0e('0x69')](_0x158d2f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x360997,_0x285658){total+=0x1;var _0x506894=total;promises[_0x5e0e('0x2c')](checkRow(_0x360997,_0x223a57,_0x506894)[_0x5e0e('0x2b')](function(){success+=0x1;})[_0x5e0e('0x53')](function(_0x17b1c8){if(_0x17b1c8[_0x5e0e('0x13')]){errors+=0x1;delete _0x17b1c8[_0x5e0e('0x13')];}else if(_0x17b1c8[_0x5e0e('0x6a')]){duplicates+=0x1;delete _0x17b1c8[_0x5e0e('0x6a')];}rows[_0x5e0e('0x2c')](_0x17b1c8);}));if(total%0xc8===0x0){_0x285658[_0x5e0e('0x6b')]();return processPromises(_0x285658);}},'complete':function(){return processPromises()[_0x5e0e('0x2b')](function(){logger[_0x5e0e('0x64')](_0x5e0e('0x6c'));endCsv();});},'error':function(_0x51747a,_0x28737){logger[_0x5e0e('0x64')]('CSV\x20parse\x20error',JSON[_0x5e0e('0x30')](_0x51747a));endCsv();}});})['catch'](function(_0x549e84){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x5e0e('0x30')](_0x549e84));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fea1740..de442a9 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 _0xc319=['emit','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','finish','affectedRows','unlink','argv','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.id','insert','cm_hopper_black','phone','ContactId','fields','cm_contacts','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','writeFileSync','data','length','rows','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync'];(function(_0x13175e,_0x39df09){var _0x971c1e=function(_0x58fe54){while(--_0x58fe54){_0x13175e['push'](_0x13175e['shift']());}};_0x971c1e(++_0x39df09);}(_0xc319,0x12e));var _0x9c31=function(_0x361b52,_0x1ff7b6){_0x361b52=_0x361b52-0x0;var _0x2e9bf9=_0xc319[_0x361b52];return _0x2e9bf9;};'use strict';var fs=require('fs');var path=require(_0x9c31('0x0'));var _=require(_0x9c31('0x1'));var Papa=require(_0x9c31('0x2'));var util=require('util');var BPromise=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var squel=require('squel');var Redis=require(_0x9c31('0x5'));var db=require(_0x9c31('0x6'))['db'];var config=require(_0x9c31('0x7'));var logger=require(_0x9c31('0x8'))('import');config[_0x9c31('0x9')]=_[_0x9c31('0xa')](config[_0x9c31('0x9')],{'host':_0x9c31('0xb'),'port':0x18eb});var socket=require(_0x9c31('0xc'))(new Redis(config[_0x9c31('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9c31('0xd')](_0x9c31('0xe'));function isEmail(_0x361c32){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'](_0x361c32);}function selectNotIn(_0x57a0b3,_0x5de62b,_0x1d8b8b,_0x2c026b,_0x14a649){return squel[_0x9c31('0xf')]()[_0x9c31('0x10')]('phone')[_0x9c31('0x11')](_0x2c026b)[_0x9c31('0x12')](_0x5de62b,null,_0x5de62b+_0x9c31('0x13')+_0x2c026b+'.'+_0x1d8b8b)['where'](_0x2c026b+'.'+_0x1d8b8b+_0x9c31('0x14')+_0x57a0b3+'.'+_0x1d8b8b)[_0x9c31('0x15')](_0x5de62b+_0x9c31('0x16')+_0x14a649[_0x9c31('0x12')]()+')');}function insertCmHopper(_0x102d0b,_0x4d9601,_0x52037f,_0x513815,_0x4ef0ea){var _0x4c6645=[_0x9c31('0x17'),_0x9c31('0x18'),'cm_contacts.id',_0x9c31('0x19'),_0x4d9601+'.'+_0x513815,_0x9c31('0x1a'),_0x9c31('0x1b'),_0x9c31('0x1c'),_0x9c31('0x1d'),'\x22'+_0x4ef0ea+'\x22'];return squel['insert']()[_0x9c31('0x1e')]('cm_hopper')[_0x9c31('0x1f')](['phone',_0x9c31('0x20'),'ContactId',_0x9c31('0x21'),_0x513815,_0x9c31('0x22'),_0x9c31('0x23'),'priority',_0x9c31('0x24'),_0x9c31('0x25')],squel[_0x9c31('0xf')]()['fields'](_0x4c6645)[_0x9c31('0x11')](_0x4d9601)[_0x9c31('0x12')]('cm_contacts',null,_0x9c31('0x26')+_0x4d9601+_0x9c31('0x27'))[_0x9c31('0x12')](_0x52037f,null,_0x52037f+_0x9c31('0x13')+_0x4d9601+'.'+_0x513815)['where'](_0x4d9601+_0x9c31('0x28'),_0x102d0b)[_0x9c31('0x15')](_0x9c31('0x29'),NOW)[_0x9c31('0x15')](_0x9c31('0x2a'),selectNotIn(_0x4d9601,_0x52037f,_0x513815,_0x9c31('0x2b'),[_0x9c31('0x2c'),'\x22onlyIfOpen\x22']))[_0x9c31('0x15')](_0x9c31('0x2a'),selectNotIn(_0x4d9601,_0x52037f,_0x513815,_0x9c31('0x2b'),[_0x9c31('0x2c')])))[_0x9c31('0x2d')]();}function insertCmHopperBlack(_0x3a9b00,_0x5206c2,_0x183916,_0x4ced52){var _0x48d270=[_0x9c31('0x17'),_0x9c31('0x2e'),_0x9c31('0x19'),_0x5206c2+'.'+_0x4ced52,_0x9c31('0x1a'),'cm_contacts.updatedAt'];return squel[_0x9c31('0x2f')]()[_0x9c31('0x1e')](_0x9c31('0x30'))[_0x9c31('0x1f')]([_0x9c31('0x31'),_0x9c31('0x32'),_0x9c31('0x21'),_0x4ced52,'createdAt',_0x9c31('0x23')],squel[_0x9c31('0xf')]()[_0x9c31('0x33')](_0x48d270)[_0x9c31('0x11')](_0x5206c2)[_0x9c31('0x12')](_0x9c31('0x34'),null,_0x9c31('0x26')+_0x5206c2+_0x9c31('0x27'))[_0x9c31('0x12')](_0x183916,null,_0x183916+_0x9c31('0x13')+_0x5206c2+'.'+_0x4ced52)[_0x9c31('0x15')](_0x5206c2+_0x9c31('0x28'),_0x3a9b00)[_0x9c31('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x9c31('0x2a'),squel[_0x9c31('0xf')]()[_0x9c31('0x10')](_0x9c31('0x31'))['from'](_0x9c31('0x30'))[_0x9c31('0x15')](_0x9c31('0x35'),_0x3a9b00)[_0x9c31('0x15')](_0x4ced52+_0x9c31('0x36'),_0x5206c2+'.'+_0x4ced52)))[_0x9c31('0x2d')]();}function insertCmContact(_0x3e5263,_0x474829,_0x51992d,_0xf4aa5d){var _0x1181a0=_[_0x9c31('0x37')](_['keys'](_0xf4aa5d),[_0x9c31('0x21'),_0x9c31('0x38'),_0x9c31('0x22'),'updatedAt']);return squel[_0x9c31('0x2f')]()[_0x9c31('0x1e')]('cm_contacts')['fromQuery'](_0x1181a0,squel[_0x9c31('0xf')]()[_0x9c31('0x33')](_0x1181a0)[_0x9c31('0x11')](_0x474829)[_0x9c31('0x15')]('('+_0x51992d[_0x9c31('0x12')](',')+_0x9c31('0x39'),squel['select']()[_0x9c31('0x33')](_0x51992d)['from'](_0x9c31('0x34'))[_0x9c31('0x15')](_0x9c31('0x35'),_0x3e5263)[_0x9c31('0x15')](_0x9c31('0x3a')))[_0x9c31('0x15')]('id\x20IN\x20?',squel['select']()[_0x9c31('0x10')](_0x9c31('0x3b'),_0x9c31('0x3c'))[_0x9c31('0x11')](_0x474829)[_0x9c31('0x3d')](_0x51992d[_0x9c31('0x12')](','))))[_0x9c31('0x2d')]();}function handleStop(){logger[_0x9c31('0x3e')](_0x9c31('0x3f'));stopped=!![];}function handleUncaughtException(_0x507a34){logger[_0x9c31('0x40')](_0x507a34[_0x9c31('0x41')]);process[_0x9c31('0x42')](0x1);}function handleError(_0x5a3599,_0x1e085c){stats[_0x9c31('0x43')][_0x9c31('0x44')]({'name':_0x1e085c[_0x9c31('0x45')],'message':_0x1e085c[_0x9c31('0x41')],'row':_0x5a3599});}function handleQuery(_0x57e5d0){logger[_0x9c31('0x3e')](_0x57e5d0);return db[_0x9c31('0x46')][_0x9c31('0x47')](_0x57e5d0)['spread'](function(_0x424c2a){results[_0x9c31('0x44')](_0x424c2a);})[_0x9c31('0x48')](function(_0x1f1238){logger[_0x9c31('0x40')](_0x1f1238[_0x9c31('0x41')]);});}function main(_0x307e96,_0x47d87e,_0x5dfe58,_0x3c7f7d){logger[_0x9c31('0x3e')](_0x9c31('0x49'),_0x307e96,JSON[_0x9c31('0x4a')](_0x47d87e));process[_0x9c31('0x4b')]('start');var _0x5de419=_0x47d87e[_0x9c31('0x4c')];var _0xe8b81a=_0x47d87e[_0x9c31('0x4d')];var _0x2371f7=path[_0x9c31('0x12')](config[_0x9c31('0x4e')],_0x9c31('0x4f'),_0xe8b81a+_0x9c31('0x50'));var _0x587a8e=_[_0x9c31('0x51')](_0x5de419)['join']();logger['info'](_0x9c31('0x52'),_0x587a8e);fs[_0x9c31('0x53')](_0x2371f7,_0x587a8e+'\x0a');Papa['parse'](fs['createReadStream'](_0x307e96),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3dd0d8,_0x1e0e47){try{for(var _0x403ad4=0x0,_0x527057=[];_0x403ad4<_0x3dd0d8[_0x9c31('0x54')][_0x9c31('0x55')];_0x403ad4++){stats[_0x9c31('0x56')]+=0x1;if(_0x3dd0d8['errors'][_0x403ad4]){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],_0x3dd0d8[_0x9c31('0x43')][_0x403ad4]);}else{var _0x1a3b20=[];for(var _0x25cb3d in _0x5de419){if(_0x5de419[_0x9c31('0x57')](_0x25cb3d)){if(_0x3dd0d8['data'][_0x403ad4][_0x5de419[_0x25cb3d]]){var _0x539b68=_[_0x9c31('0x58')](_0x3dd0d8[_0x9c31('0x54')][_0x403ad4][_0x5de419[_0x25cb3d]][_0x9c31('0x59')](/"/g,'\x27'));switch(_0x25cb3d){case'scheduledat':var _0xea5b99=moment(_0x539b68,_0x9c31('0xe'),!![]);if(_0xea5b99['isValid']()){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x5a'));}break;case _0x9c31('0x5b'):var _0x526ac0=parseInt(_0x539b68);_0x539b68=_['isNaN'](_0x526ac0)||_0x526ac0<0x0||_0x526ac0>0x4?_0x3c7f7d?0x3:0x2:_0x526ac0;_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');break;case'UserId':var _0x38749c=parseInt(_0x539b68);if(_[_0x9c31('0x5c')](_0x38749c)&&_['includes'](_0x5dfe58,_0x38749c)){_0x527057[_0x9c31('0x44')]('\x22'+_0x38749c+'\x22');}else{_0x1a3b20['push']('agent\x20not\x20exists');}break;case _0x9c31('0x5d'):if(isEmail(_0x539b68)){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x5e'));}break;case _0x9c31('0x5f'):var _0x40a7df=moment(_0x539b68,_0x9c31('0x60'),!![]);if(_0x40a7df[_0x9c31('0x61')]()){_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}else{_0x1a3b20[_0x9c31('0x44')](_0x9c31('0x62'));}break;default:_0x527057[_0x9c31('0x44')]('\x22'+_0x539b68+'\x22');}}else{switch(_0x25cb3d){case _0x9c31('0x63'):case'phone':_0x1a3b20[_0x9c31('0x44')](_0x25cb3d+_0x9c31('0x64'));break;default:_0x527057[_0x9c31('0x44')]('\x22\x22');}}}}if(_0x1a3b20['length']){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],{'code':_0x9c31('0x65'),'message':_0x1a3b20['join']()});}else{fs[_0x9c31('0x66')](_0x2371f7,_0x527057['join']()+'\x0a');}_0x527057=[];}if(!(stats['rows']%0xc8)){socket[_0x9c31('0x67')]('contact:import:'+_0xe8b81a,stats);stats['errors']=[];}}if(stopped){logger[_0x9c31('0x3e')](_0x9c31('0x68'));_0x1e0e47[_0x9c31('0x69')]();}}catch(_0x283dda){handleError(_0x3dd0d8[_0x9c31('0x54')][_0x403ad4],{'code':'SystemError','message':_0x283dda[_0x9c31('0x41')]});logger[_0x9c31('0x40')](_0x9c31('0x6a'),_0x283dda[_0x9c31('0x41')]);}},'complete':function(){try{var _0x5db688=[];var _0x183ae5=_0x9c31('0x34');if(_0x47d87e[_0x9c31('0x6b')]&&_0x47d87e['duplicates'][_0x9c31('0x55')]){_0x183ae5='cm_contacts_'+_0xe8b81a;_0x5db688[_0x9c31('0x44')](_0x9c31('0x6c')+_0x183ae5+_0x9c31('0x6d'));}var _0x5998bf=util[_0x9c31('0xd')]('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',_0x2371f7,_0x183ae5,_0x587a8e,_0x47d87e[_0x9c31('0x21')],_0x47d87e[_0x9c31('0x38')]||null,NOW,NOW);if(_[_0x9c31('0x6e')](_0x5de419['scheduledat'])){_0x5998bf+=_0x9c31('0x6f');}_0x5db688['push'](_0x5998bf);if(_0x47d87e['duplicates']&&_0x47d87e[_0x9c31('0x6b')][_0x9c31('0x55')]){_0x5db688['push'](insertCmContact(_0x47d87e['ListId'],_0x183ae5,_0x47d87e[_0x9c31('0x6b')],_0x5de419));_0x5db688[_0x9c31('0x44')](_0x9c31('0x70')+_0x183ae5+';');}_0x5db688[_0x9c31('0x44')](insertCmHopper(_0x47d87e[_0x9c31('0x21')],_0x9c31('0x71'),_0x9c31('0x72'),_0x9c31('0x73'),_0x3c7f7d));_0x5db688['push'](insertCmHopperBlack(_0x47d87e[_0x9c31('0x21')],_0x9c31('0x74'),_0x9c31('0x72'),_0x9c31('0x73')));_0x5db688[_0x9c31('0x44')](insertCmHopper(_0x47d87e['ListId'],_0x9c31('0x75'),_0x9c31('0x76'),'CampaignId',_0x3c7f7d));_0x5db688[_0x9c31('0x44')](insertCmHopperBlack(_0x47d87e['ListId'],_0x9c31('0x77'),'campaigns',_0x9c31('0x78')));BPromise[_0x9c31('0x79')](_0x5db688,handleQuery)['then'](function(_0x1d2f81){stats[_0x9c31('0x7a')]=!![];stats[_0x9c31('0x7b')]=_0x47d87e[_0x9c31('0x6b')]&&_0x47d87e[_0x9c31('0x6b')][_0x9c31('0x55')]?results[0x2][_0x9c31('0x7b')]:results[0x0][_0x9c31('0x7b')];socket[_0x9c31('0x67')]('contact:import:'+_0xe8b81a,stats);fs['unlink'](_0x307e96);fs[_0x9c31('0x7c')](_0x2371f7);process[_0x9c31('0x42')](0x0);})[_0x9c31('0x48')](function(_0x17ce79){logger[_0x9c31('0x40')](_0x17ce79['message']);process[_0x9c31('0x42')](0x1);});}catch(_0x451847){logger[_0x9c31('0x40')]('complete',_0x451847[_0x9c31('0x41')]);process['exit'](0x1);}},'error':function(_0x333650,_0x2c4bb2,_0x315c64,_0x4a6065){throw new Error(_0x4a6065);}});}function validate(){if(process[_0x9c31('0x7d')]&&process['argv'][_0x9c31('0x55')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x4c7930=path[_0x9c31('0x12')](config[_0x9c31('0x4e')],_0x9c31('0x4f'),process[_0x9c31('0x7d')][0x2]);if(!fs[_0x9c31('0x7e')](_0x4c7930)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x503cab={};try{_0x503cab=JSON['parse'](process[_0x9c31('0x7d')][0x3]);if(!_0x503cab[_0x9c31('0x4c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x503cab[_0x9c31('0x4c')][_0x9c31('0x31')]){throw new Error(_0x9c31('0x7f'));}if(!_0x503cab[_0x9c31('0x4c')][_0x9c31('0x63')]){throw new Error(_0x9c31('0x80'));}var _0x1b8c58=0x0;if(_0x503cab[_0x9c31('0x4c')][_0x9c31('0x24')]){_0x1b8c58=0x1;}if(!_0x503cab[_0x9c31('0x21')]){throw new Error(_0x9c31('0x81'));}}catch(_0x5f2823){throw new Error(_0x9c31('0x82'));}var _0x132197=[];try{_0x132197=_[_0x9c31('0x83')](JSON[_0x9c31('0x84')](process[_0x9c31('0x7d')][0x4]),'id');}catch(_0x175d3e){logger[_0x9c31('0x3e')](_0x9c31('0x85'));}main(_0x4c7930,_0x503cab,_0x132197,_0x1b8c58);}validate();process['on'](_0x9c31('0x86'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xc456=['test','select','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ListId','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','into','cm_hopper_black','ContactId','createdAt','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','push','code','query','spread','start','binding','socket_timestamp','root','server/files/tmp','header','parse','rows','data','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','length','SystemRow','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','format','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','CampaignId','each','then','finish','affectedRows','unlink','catch','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b2b3e,_0x720687){var _0x2f59a6=function(_0x29548c){while(--_0x29548c){_0x4b2b3e['push'](_0x4b2b3e['shift']());}};_0x2f59a6(++_0x720687);}(_0xc456,0x161));var _0x6c45=function(_0x58de11,_0x2a31de){_0x58de11=_0x58de11-0x0;var _0x3d4338=_0xc456[_0x58de11];return _0x3d4338;};'use strict';var fs=require('fs');var path=require(_0x6c45('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x6c45('0x1'));var BPromise=require('bluebird');var moment=require(_0x6c45('0x2'));var squel=require(_0x6c45('0x3'));var Redis=require(_0x6c45('0x4'));var db=require(_0x6c45('0x5'))['db'];var config=require(_0x6c45('0x6'));var logger=require(_0x6c45('0x7'))(_0x6c45('0x8'));config[_0x6c45('0x9')]=_[_0x6c45('0xa')](config[_0x6c45('0x9')],{'host':_0x6c45('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c45('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x6c45('0xc'));function isEmail(_0x5ca2af){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))*$/[_0x6c45('0xd')](_0x5ca2af);}function selectNotIn(_0x3784de,_0x448d0a,_0x4898f8,_0x26f159,_0x93fa9c){return squel[_0x6c45('0xe')]()[_0x6c45('0xf')](_0x6c45('0x10'))[_0x6c45('0x11')](_0x26f159)['join'](_0x448d0a,null,_0x448d0a+_0x6c45('0x12')+_0x26f159+'.'+_0x4898f8)[_0x6c45('0x13')](_0x26f159+'.'+_0x4898f8+'\x20=\x20'+_0x3784de+'.'+_0x4898f8)['where'](_0x448d0a+_0x6c45('0x14')+_0x93fa9c[_0x6c45('0x15')]()+')');}function insertCmHopper(_0x4851eb,_0x387e70,_0x5b99d6,_0x2de792,_0x1f9277){var _0x2ca8dc=[_0x6c45('0x16'),_0x6c45('0x17'),_0x6c45('0x18'),'cm_contacts.ListId',_0x387e70+'.'+_0x2de792,_0x6c45('0x19'),_0x6c45('0x1a'),_0x6c45('0x1b'),_0x6c45('0x1c'),'\x22'+_0x1f9277+'\x22'];return squel['insert']()['into'](_0x6c45('0x1d'))[_0x6c45('0x1e')](['phone',_0x6c45('0x1f'),'ContactId',_0x6c45('0x20'),_0x2de792,'createdAt',_0x6c45('0x21'),_0x6c45('0x22'),_0x6c45('0x23'),'recallme'],squel['select']()[_0x6c45('0x24')](_0x2ca8dc)[_0x6c45('0x11')](_0x387e70)[_0x6c45('0x15')](_0x6c45('0x25'),null,_0x6c45('0x26')+_0x387e70+'.CmListId')[_0x6c45('0x15')](_0x5b99d6,null,_0x5b99d6+'.id\x20=\x20'+_0x387e70+'.'+_0x2de792)[_0x6c45('0x13')](_0x387e70+_0x6c45('0x27'),_0x4851eb)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6c45('0x13')](_0x6c45('0x28'),selectNotIn(_0x387e70,_0x5b99d6,_0x2de792,'cm_hopper',[_0x6c45('0x29'),_0x6c45('0x2a')]))[_0x6c45('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x387e70,_0x5b99d6,_0x2de792,_0x6c45('0x1d'),[_0x6c45('0x29')])))[_0x6c45('0x2b')]();}function insertCmHopperBlack(_0x7b93ba,_0x1c2ba5,_0xdcc32d,_0x3bdd63){var _0x5f2e2d=[_0x6c45('0x16'),'cm_contacts.id','cm_contacts.ListId',_0x1c2ba5+'.'+_0x3bdd63,_0x6c45('0x19'),'cm_contacts.updatedAt'];return squel[_0x6c45('0x2c')]()[_0x6c45('0x2d')](_0x6c45('0x2e'))[_0x6c45('0x1e')]([_0x6c45('0x10'),_0x6c45('0x2f'),'ListId',_0x3bdd63,_0x6c45('0x30'),'updatedAt'],squel['select']()[_0x6c45('0x24')](_0x5f2e2d)[_0x6c45('0x11')](_0x1c2ba5)[_0x6c45('0x15')](_0x6c45('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x1c2ba5+'.CmListId')['join'](_0xdcc32d,null,_0xdcc32d+_0x6c45('0x12')+_0x1c2ba5+'.'+_0x3bdd63)[_0x6c45('0x13')](_0x1c2ba5+_0x6c45('0x27'),_0x7b93ba)[_0x6c45('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6c45('0xf')]('phone')[_0x6c45('0x11')]('cm_hopper_black')[_0x6c45('0x13')](_0x6c45('0x31'),_0x7b93ba)['where'](_0x3bdd63+_0x6c45('0x32'),_0x1c2ba5+'.'+_0x3bdd63)))['toString']();}function insertCmContact(_0xb4902f,_0x3250e1,_0xd8142e,_0x61ef90){var _0x415c27=_['concat'](_[_0x6c45('0x33')](_0x61ef90),[_0x6c45('0x20'),_0x6c45('0x34'),_0x6c45('0x30'),_0x6c45('0x21')]);return squel['insert']()[_0x6c45('0x2d')]('cm_contacts')[_0x6c45('0x1e')](_0x415c27,squel[_0x6c45('0xe')]()[_0x6c45('0x24')](_0x415c27)[_0x6c45('0x11')](_0x3250e1)[_0x6c45('0x13')]('('+_0xd8142e['join'](',')+_0x6c45('0x35'),squel[_0x6c45('0xe')]()['fields'](_0xd8142e)[_0x6c45('0x11')](_0x6c45('0x25'))[_0x6c45('0x13')](_0x6c45('0x31'),_0xb4902f)['where'](_0x6c45('0x36')))[_0x6c45('0x13')](_0x6c45('0x37'),squel[_0x6c45('0xe')]()[_0x6c45('0xf')](_0x6c45('0x38'),_0x6c45('0x39'))[_0x6c45('0x11')](_0x3250e1)[_0x6c45('0x3a')](_0xd8142e[_0x6c45('0x15')](','))))['toString']();}function handleStop(){logger[_0x6c45('0x3b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2c2090){logger[_0x6c45('0x3c')](_0x2c2090[_0x6c45('0x3d')]);process[_0x6c45('0x3e')](0x1);}function handleError(_0x5ae576,_0x58fa95){stats[_0x6c45('0x3f')][_0x6c45('0x40')]({'name':_0x58fa95[_0x6c45('0x41')],'message':_0x58fa95[_0x6c45('0x3d')],'row':_0x5ae576});}function handleQuery(_0x2172b6){logger[_0x6c45('0x3b')](_0x2172b6);return db['sequelize'][_0x6c45('0x42')](_0x2172b6)[_0x6c45('0x43')](function(_0x5cee27){results[_0x6c45('0x40')](_0x5cee27);})['catch'](function(_0x7287a5){logger['error'](_0x7287a5['message']);});}function main(_0x304374,_0x4980e5,_0x8e4826,_0x14c6d8){logger['info']('main',_0x304374,JSON['stringify'](_0x4980e5));process['send'](_0x6c45('0x44'));var _0x1aa1e0=_0x4980e5[_0x6c45('0x45')];var _0x769e39=_0x4980e5[_0x6c45('0x46')];var _0x4cf82b=path[_0x6c45('0x15')](config[_0x6c45('0x47')],_0x6c45('0x48'),_0x769e39+'.csv');var _0x3414e5=_['keys'](_0x1aa1e0)[_0x6c45('0x15')]();logger[_0x6c45('0x3b')](_0x6c45('0x49'),_0x3414e5);fs['writeFileSync'](_0x4cf82b,_0x3414e5+'\x0a');Papa[_0x6c45('0x4a')](fs['createReadStream'](_0x304374),{'header':!![],'skipEmptyLines':!![],'step':function(_0x44bd07,_0x18ca0a){try{for(var _0x49551e=0x0,_0x386a1a=[];_0x49551e<_0x44bd07['data']['length'];_0x49551e++){stats[_0x6c45('0x4b')]+=0x1;if(_0x44bd07[_0x6c45('0x3f')][_0x49551e]){handleError(_0x44bd07['data'][_0x49551e],_0x44bd07['errors'][_0x49551e]);}else{var _0x41862a=[];for(var _0x3db806 in _0x1aa1e0){if(_0x1aa1e0['hasOwnProperty'](_0x3db806)){if(_0x44bd07[_0x6c45('0x4c')][_0x49551e][_0x1aa1e0[_0x3db806]]){var _0x241679=_[_0x6c45('0x4d')](_0x44bd07[_0x6c45('0x4c')][_0x49551e][_0x1aa1e0[_0x3db806]][_0x6c45('0x4e')](/"/g,'\x27'));switch(_0x3db806){case _0x6c45('0x1f'):var _0x5a5c32=moment(_0x241679,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5a5c32['isValid']()){_0x386a1a['push']('\x22'+_0x241679+'\x22');}else{_0x41862a['push'](_0x6c45('0x4f'));}break;case _0x6c45('0x22'):var _0x447413=parseInt(_0x241679);_0x241679=_[_0x6c45('0x50')](_0x447413)||_0x447413<0x0||_0x447413>0x4?_0x14c6d8?0x3:0x2:_0x447413;_0x386a1a[_0x6c45('0x40')]('\x22'+_0x241679+'\x22');break;case _0x6c45('0x23'):var _0x46880b=parseInt(_0x241679);if(_['isNumber'](_0x46880b)&&_[_0x6c45('0x51')](_0x8e4826,_0x46880b)){_0x386a1a[_0x6c45('0x40')]('\x22'+_0x46880b+'\x22');}else{_0x41862a[_0x6c45('0x40')](_0x6c45('0x52'));}break;case'email':if(isEmail(_0x241679)){_0x386a1a['push']('\x22'+_0x241679+'\x22');}else{_0x41862a[_0x6c45('0x40')](_0x6c45('0x53'));}break;case _0x6c45('0x54'):var _0x388e15=moment(_0x241679,_0x6c45('0x55'),!![]);if(_0x388e15[_0x6c45('0x56')]()){_0x386a1a['push']('\x22'+_0x241679+'\x22');}else{_0x41862a['push'](_0x6c45('0x57'));}break;default:_0x386a1a['push']('\x22'+_0x241679+'\x22');}}else{switch(_0x3db806){case'firstName':case _0x6c45('0x10'):_0x41862a[_0x6c45('0x40')](_0x3db806+'\x20not\x20specified');break;default:_0x386a1a[_0x6c45('0x40')]('\x22\x22');}}}}if(_0x41862a[_0x6c45('0x58')]){handleError(_0x44bd07[_0x6c45('0x4c')][_0x49551e],{'code':_0x6c45('0x59'),'message':_0x41862a[_0x6c45('0x15')]()});}else{fs['appendFileSync'](_0x4cf82b,_0x386a1a[_0x6c45('0x15')]()+'\x0a');}_0x386a1a=[];}if(!(stats[_0x6c45('0x4b')]%0xc8)){socket[_0x6c45('0x5a')](_0x6c45('0x5b')+_0x769e39,stats);stats[_0x6c45('0x3f')]=[];}}if(stopped){logger['info'](_0x6c45('0x5c'));_0x18ca0a['abort']();}}catch(_0x6120fa){handleError(_0x44bd07[_0x6c45('0x4c')][_0x49551e],{'code':'SystemError','message':_0x6120fa[_0x6c45('0x3d')]});logger[_0x6c45('0x3c')](_0x6c45('0x5d'),_0x6120fa[_0x6c45('0x3d')]);}},'complete':function(){try{var _0x49b5c5=[];var _0x3fc5b5=_0x6c45('0x25');if(_0x4980e5['duplicates']&&_0x4980e5[_0x6c45('0x5e')][_0x6c45('0x58')]){_0x3fc5b5=_0x6c45('0x5f')+_0x769e39;_0x49b5c5[_0x6c45('0x40')]('CREATE\x20TABLE\x20'+_0x3fc5b5+_0x6c45('0x60'));}var _0x3aa803=util[_0x6c45('0x61')]('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',_0x4cf82b,_0x3fc5b5,_0x3414e5,_0x4980e5['ListId'],_0x4980e5[_0x6c45('0x34')]||null,NOW,NOW);if(_[_0x6c45('0x62')](_0x1aa1e0[_0x6c45('0x1f')])){_0x3aa803+=',\x20scheduledAt\x20=\x20NOW()';}_0x49b5c5[_0x6c45('0x40')](_0x3aa803);if(_0x4980e5['duplicates']&&_0x4980e5[_0x6c45('0x5e')][_0x6c45('0x58')]){_0x49b5c5[_0x6c45('0x40')](insertCmContact(_0x4980e5[_0x6c45('0x20')],_0x3fc5b5,_0x4980e5[_0x6c45('0x5e')],_0x1aa1e0));_0x49b5c5[_0x6c45('0x40')](_0x6c45('0x63')+_0x3fc5b5+';');}_0x49b5c5['push'](insertCmHopper(_0x4980e5[_0x6c45('0x20')],_0x6c45('0x64'),_0x6c45('0x65'),_0x6c45('0x66'),_0x14c6d8));_0x49b5c5[_0x6c45('0x40')](insertCmHopperBlack(_0x4980e5[_0x6c45('0x20')],'voice_queues_has_cm_blacklists',_0x6c45('0x65'),_0x6c45('0x66')));_0x49b5c5[_0x6c45('0x40')](insertCmHopper(_0x4980e5['ListId'],'campaigns_has_cm_lists','campaigns','CampaignId',_0x14c6d8));_0x49b5c5['push'](insertCmHopperBlack(_0x4980e5[_0x6c45('0x20')],'campaigns_has_cm_blacklists','campaigns',_0x6c45('0x67')));BPromise[_0x6c45('0x68')](_0x49b5c5,handleQuery)[_0x6c45('0x69')](function(_0x139685){stats[_0x6c45('0x6a')]=!![];stats['affectedRows']=_0x4980e5['duplicates']&&_0x4980e5[_0x6c45('0x5e')][_0x6c45('0x58')]?results[0x2][_0x6c45('0x6b')]:results[0x0][_0x6c45('0x6b')];socket['emit'](_0x6c45('0x5b')+_0x769e39,stats);fs['unlink'](_0x304374);fs[_0x6c45('0x6c')](_0x4cf82b);process[_0x6c45('0x3e')](0x0);})[_0x6c45('0x6d')](function(_0x20e191){logger[_0x6c45('0x3c')](_0x20e191[_0x6c45('0x3d')]);process[_0x6c45('0x3e')](0x1);});}catch(_0x4b0896){logger['error']('complete',_0x4b0896[_0x6c45('0x3d')]);process[_0x6c45('0x3e')](0x1);}},'error':function(_0x35b4ca,_0x39c0ed,_0x527294,_0x17eb32){throw new Error(_0x17eb32);}});}function validate(){if(process['argv']&&process[_0x6c45('0x6e')][_0x6c45('0x58')]<0x4){throw new Error(_0x6c45('0x6f'));}var _0x4f8bf3=path[_0x6c45('0x15')](config[_0x6c45('0x47')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x6c45('0x70')](_0x4f8bf3)){throw new Error(_0x6c45('0x71'));}var _0x417754={};try{_0x417754=JSON['parse'](process[_0x6c45('0x6e')][0x3]);if(!_0x417754[_0x6c45('0x45')]){throw new Error(_0x6c45('0x72'));}if(!_0x417754[_0x6c45('0x45')][_0x6c45('0x10')]){throw new Error(_0x6c45('0x73'));}if(!_0x417754[_0x6c45('0x45')][_0x6c45('0x74')]){throw new Error(_0x6c45('0x75'));}var _0x39742b=0x0;if(_0x417754[_0x6c45('0x45')][_0x6c45('0x23')]){_0x39742b=0x1;}if(!_0x417754[_0x6c45('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5e621d){throw new Error(_0x6c45('0x76'));}var _0xd6514e=[];try{_0xd6514e=_[_0x6c45('0x77')](JSON[_0x6c45('0x4a')](process[_0x6c45('0x6e')][0x4]),'id');}catch(_0x494ceb){logger[_0x6c45('0x3b')](_0x6c45('0x78'));}main(_0x4f8bf3,_0x417754,_0xd6514e,_0x39742b);}validate();process['on']('SIGINT',handleStop);process['on'](_0x6c45('0x79'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index c640eca..3e05acf 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4da3=['voice','inbound','push','variable','queue','outbound','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','***\x20Call\x20Info\x20***','Called\x20Number','destcalleridnum','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase'];(function(_0x465971,_0x5a1e01){var _0x357b35=function(_0x2626a4){while(--_0x2626a4){_0x465971['push'](_0x465971['shift']());}};_0x357b35(++_0x5a1e01);}(_0x4da3,0x138));var _0x34da=function(_0x4c4ecc,_0x19b401){_0x4c4ecc=_0x4c4ecc-0x0;var _0x57aa22=_0x4da3[_0x4c4ecc];return _0x57aa22;};'use strict';exports['getSubjects']=function(_0x560767,_0x199f9f){var _0x89f465=[{'type':_0x34da('0x0'),'content':_0x34da('0x1'),'variableName':null}];switch(_0x560767[_0x34da('0x2')]()){case _0x34da('0x3'):switch(_0x199f9f['toLowerCase']()){case _0x34da('0x4'):_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':_0x34da('0x7')});_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':'calleridnum'});break;case _0x34da('0x8'):_0x89f465['push']({'type':_0x34da('0x0'),'content':'Outbound\x20Call','variableName':null});_0x89f465[_0x34da('0x5')]({'type':_0x34da('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x89f465;};exports[_0x34da('0x9')]=function(_0x4df01d,_0x19818f){var _0x209684=[];switch(_0x4df01d['toLowerCase']()){case _0x34da('0x3'):switch(_0x19818f[_0x34da('0x2')]()){case'inbound':_0x209684=[{'type':_0x34da('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x34da('0xa'),'content':'','key':'Caller\x20Number','keyType':_0x34da('0x6'),'variableName':'calleridnum'},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0xb'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0xc')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0xd'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0xe')},{'type':'keyValue','content':'','key':_0x34da('0xf'),'keyType':_0x34da('0x6'),'variableName':'queue'},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','variableName':_0x34da('0x10')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x11'),'keyType':'variable','variableName':_0x34da('0x12')},{'type':'string','content':_0x34da('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x34da('0x14'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x15')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x16'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x34da('0x0'),'content':_0x34da('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x18'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x12')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x19'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x1a')},{'type':_0x34da('0xa'),'content':'','key':'Agent\x20Complete','keyType':_0x34da('0x6'),'variableName':_0x34da('0x1b')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x1c'),'keyType':_0x34da('0x6'),'variableName':_0x34da('0x1d')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x34da('0x6'),'variableName':_0x34da('0x1e')}];break;case _0x34da('0x8'):_0x209684=[{'type':_0x34da('0x0'),'content':_0x34da('0x1f'),'variableName':null},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x20'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x21')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x22'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x23')},{'type':'keyValue','content':'','key':_0x34da('0x24'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x10')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x11'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x25')},{'type':_0x34da('0x0'),'content':_0x34da('0x17')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x26'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x27')},{'type':_0x34da('0xa'),'content':'','key':_0x34da('0x28'),'keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x29')},{'type':'keyValue','content':'','key':_0x34da('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x34da('0x2b')},{'type':_0x34da('0xa'),'content':'','key':'Billable\x20Time','keyType':_0x34da('0x6'),'keyContent':'','variableName':_0x34da('0x2c')}];break;}}return _0x209684;}; \ No newline at end of file +var _0x7f35=['endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Name','calleridname','destexten','queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Talk\x20Time','talktime','outbound','***\x20Call\x20Info\x20***','Called\x20Number','starttime','Answer\x20Time','answertime','Complete\x20Time'];(function(_0xa4f9a7,_0x2352bf){var _0x509749=function(_0x2b00bb){while(--_0x2b00bb){_0xa4f9a7['push'](_0xa4f9a7['shift']());}};_0x509749(++_0x2352bf);}(_0x7f35,0x83));var _0x57f3=function(_0x2d8f66,_0x3f0707){_0x2d8f66=_0x2d8f66-0x0;var _0x1304f9=_0x7f35[_0x2d8f66];return _0x1304f9;};'use strict';exports[_0x57f3('0x0')]=function(_0x28b2aa,_0x4c069f){var _0x40ae66=[{'type':_0x57f3('0x1'),'content':_0x57f3('0x2'),'variableName':null}];switch(_0x28b2aa['toLowerCase']()){case _0x57f3('0x3'):switch(_0x4c069f[_0x57f3('0x4')]()){case _0x57f3('0x5'):_0x40ae66[_0x57f3('0x6')]({'type':'variable','content':'','variableName':'queue'});_0x40ae66[_0x57f3('0x6')]({'type':_0x57f3('0x7'),'content':'','variableName':_0x57f3('0x8')});break;case'outbound':_0x40ae66[_0x57f3('0x6')]({'type':_0x57f3('0x1'),'content':_0x57f3('0x9'),'variableName':null});_0x40ae66[_0x57f3('0x6')]({'type':_0x57f3('0x7'),'content':'','variableName':_0x57f3('0xa')});break;}}return _0x40ae66;};exports[_0x57f3('0xb')]=function(_0x35fa8a,_0x5ba870){var _0x1f32f7=[];switch(_0x35fa8a[_0x57f3('0x4')]()){case _0x57f3('0x3'):switch(_0x5ba870[_0x57f3('0x4')]()){case _0x57f3('0x5'):_0x1f32f7=[{'type':_0x57f3('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x57f3('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x57f3('0x7'),'variableName':'calleridnum'},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0xd'),'keyType':_0x57f3('0x7'),'variableName':_0x57f3('0xe')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x57f3('0x7'),'variableName':_0x57f3('0xf')},{'type':'keyValue','content':'','key':'Queue','keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x10')},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x11'),'keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x12')},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x13'),'keyType':_0x57f3('0x7'),'variableName':'agentcalledAt'},{'type':_0x57f3('0x1'),'content':_0x57f3('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x57f3('0xc'),'content':'','key':'Agent\x20Name','keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x15')},{'type':_0x57f3('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x57f3('0x7'),'variableName':'destcalleridnum'},{'type':_0x57f3('0x1'),'content':_0x57f3('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x17'),'keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x18')},{'type':'keyValue','content':'','key':_0x57f3('0x19'),'keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x1a')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x1b')},{'type':_0x57f3('0xc'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x1c'),'keyType':_0x57f3('0x7'),'variableName':_0x57f3('0x1d')}];break;case _0x57f3('0x1e'):_0x1f32f7=[{'type':_0x57f3('0x1'),'content':_0x57f3('0x1f'),'variableName':null},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x20'),'keyType':'variable','keyContent':'','variableName':_0x57f3('0xa')},{'type':_0x57f3('0xc'),'content':'','key':'Member\x20Name','keyType':_0x57f3('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x57f3('0xc'),'content':'','key':'UniqueId','keyType':_0x57f3('0x7'),'keyContent':'','variableName':_0x57f3('0x12')},{'type':'keyValue','content':'','key':_0x57f3('0x13'),'keyType':'variable','keyContent':'','variableName':_0x57f3('0x21')},{'type':_0x57f3('0x1'),'content':_0x57f3('0x16')},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x22'),'keyType':_0x57f3('0x7'),'keyContent':'','variableName':_0x57f3('0x23')},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x24'),'keyType':_0x57f3('0x7'),'keyContent':'','variableName':_0x57f3('0x25')},{'type':'keyValue','content':'','key':_0x57f3('0x26'),'keyType':'variable','keyContent':'','variableName':_0x57f3('0x27')},{'type':_0x57f3('0xc'),'content':'','key':_0x57f3('0x28'),'keyType':_0x57f3('0x7'),'keyContent':'','variableName':_0x57f3('0x29')}];break;}}return _0x1f32f7;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index b229220..d25364a 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b40=['findOne','then','info','catch','user','query','omit','body','html','phone','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','upperFirst','InteractionId','unknown','toUpperCase','name','role','stringify','null','Interaction'];(function(_0x50513c,_0x398cfb){var _0x25054c=function(_0x5e5f2f){while(--_0x5e5f2f){_0x50513c['push'](_0x50513c['shift']());}};_0x25054c(++_0x398cfb);}(_0x9b40,0xf6));var _0x09b4=function(_0x43b334,_0x522b01){_0x43b334=_0x43b334-0x0;var _0x2cf693=_0x9b40[_0x43b334];return _0x2cf693;};'use strict';var _=require('lodash');var db=require(_0x09b4('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x09b4('0x1')),'mail':require(_0x09b4('0x2'))(_0x09b4('0x3')),'fax':require(_0x09b4('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x09b4('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x09b4('0x2'))('whatsapp-interactions')};function getInteractionId(_0x15422d,_0x4b3ae0,_0x518411){if(_0x15422d&&_0x15422d[_[_0x09b4('0x5')](_0x518411)+_0x09b4('0x6')]){return _0x15422d[_[_0x09b4('0x5')](_0x518411)+_0x09b4('0x6')];}else if(_0x15422d&&_0x15422d['id']){return _0x15422d['id'];}else if(_0x4b3ae0&&_0x4b3ae0['id']){return _0x4b3ae0['id'];}else{return _0x09b4('0x7');}}function log(_0x28ec78,_0x2763c5,_0x2924cc,_0x280bff,_0x3b4c64,_0x1ea5a4){loggers[_0x3b4c64['toLowerCase']()][_0x28ec78]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ea5a4[_0x09b4('0x8')](),_0x2763c5?_0x2763c5['id']:null,_0x2763c5?_0x2763c5[_0x09b4('0x9')]:null,_0x2763c5?_0x2763c5[_0x09b4('0xa')]:null,getInteractionId(_0x2924cc,_0x280bff,_0x3b4c64),_0x2924cc?JSON[_0x09b4('0xb')](_0x2924cc):_0x09b4('0xc'));}function updateUser(_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9){db[_[_0x09b4('0x5')](_0x39d41c)+_0x09b4('0xd')][_0x09b4('0xe')]({'where':{'id':getInteractionId(_0x2e024d,_0x17ae97,_0x39d41c)}})[_0x09b4('0xf')](function(_0xcf2aad){if(_0xcf2aad){return _0xcf2aad['update']({'UserId':_0x29961b?_0x29961b['id']:null});}})[_0x09b4('0xf')](function(_0x382f94){if(_0x382f94){log(_0x09b4('0x10'),_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9);}})[_0x09b4('0x11')](function(){log('error',_0x29961b,_0x2e024d,_0x17ae97,_0x39d41c,_0x1d73d9);});}exports['tracked']=function(_0x4ee64e,_0x22d7b1){return function(_0x5a57a9,_0x378a9f,_0x3bb0e6){var _0x433b77=_0x5a57a9[_0x09b4('0x12')];var _0x112c73={};var _0x342e16=_0x5a57a9[_0x09b4('0x13')];if(_0x112c73){_0x112c73=_['clone'](_0x5a57a9['body']);_0x112c73=_[_0x09b4('0x14')](_0x112c73,[_0x09b4('0x15'),_0x09b4('0x16'),_0x09b4('0x17'),_0x09b4('0x18'),_0x09b4('0x19')]);}updateUser(_0x433b77,_0x112c73,_0x342e16,_0x4ee64e,_0x22d7b1);_0x3bb0e6(null);};}; \ No newline at end of file +var _0xd92c=['fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','Interaction','then','update','info','catch','error','tracked','query','clone','body','omit','html','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x4531f1,_0x3c2398){var _0x1d87a1=function(_0x18dac3){while(--_0x18dac3){_0x4531f1['push'](_0x4531f1['shift']());}};_0x1d87a1(++_0x3c2398);}(_0xd92c,0x1d7));var _0xcd92=function(_0x5b3a82,_0x5619db){_0x5b3a82=_0x5b3a82-0x0;var _0x490bf0=_0xd92c[_0x5b3a82];return _0x490bf0;};'use strict';var _=require(_0xcd92('0x0'));var db=require(_0xcd92('0x1'))['db'];var loggers={'openchannel':require(_0xcd92('0x2'))(_0xcd92('0x3')),'mail':require('../../config/logger')(_0xcd92('0x4')),'fax':require(_0xcd92('0x2'))(_0xcd92('0x5')),'sms':require('../../config/logger')(_0xcd92('0x6')),'chat':require(_0xcd92('0x2'))(_0xcd92('0x7')),'whatsapp':require(_0xcd92('0x2'))(_0xcd92('0x8'))};function getInteractionId(_0x6fdf22,_0xb4b602,_0x3518e3){if(_0x6fdf22&&_0x6fdf22[_[_0xcd92('0x9')](_0x3518e3)+_0xcd92('0xa')]){return _0x6fdf22[_[_0xcd92('0x9')](_0x3518e3)+_0xcd92('0xa')];}else if(_0x6fdf22&&_0x6fdf22['id']){return _0x6fdf22['id'];}else if(_0xb4b602&&_0xb4b602['id']){return _0xb4b602['id'];}else{return'unknown';}}function log(_0x277dc5,_0x503c07,_0x2dc8de,_0x3fa3f5,_0x1fe0f5,_0xf2effa){loggers[_0x1fe0f5[_0xcd92('0xb')]()][_0x277dc5](_0xcd92('0xc'),_0xf2effa['toUpperCase'](),_0x503c07?_0x503c07['id']:null,_0x503c07?_0x503c07[_0xcd92('0xd')]:null,_0x503c07?_0x503c07['role']:null,getInteractionId(_0x2dc8de,_0x3fa3f5,_0x1fe0f5),_0x2dc8de?JSON['stringify'](_0x2dc8de):_0xcd92('0xe'));}function updateUser(_0x45ee0f,_0x127b16,_0x2f6193,_0x510fe1,_0x1ab4e7){db[_[_0xcd92('0x9')](_0x510fe1)+_0xcd92('0xf')]['findOne']({'where':{'id':getInteractionId(_0x127b16,_0x2f6193,_0x510fe1)}})[_0xcd92('0x10')](function(_0xae9fec){if(_0xae9fec){return _0xae9fec[_0xcd92('0x11')]({'UserId':_0x45ee0f?_0x45ee0f['id']:null});}})[_0xcd92('0x10')](function(_0x30221f){if(_0x30221f){log(_0xcd92('0x12'),_0x45ee0f,_0x127b16,_0x2f6193,_0x510fe1,_0x1ab4e7);}})[_0xcd92('0x13')](function(){log(_0xcd92('0x14'),_0x45ee0f,_0x127b16,_0x2f6193,_0x510fe1,_0x1ab4e7);});}exports[_0xcd92('0x15')]=function(_0x41656a,_0x6d33c){return function(_0x541a5c,_0x3ca96b,_0x10ff7a){var _0x6e9a47=_0x541a5c['user'];var _0x111cdd={};var _0x1fe00d=_0x541a5c[_0xcd92('0x16')];if(_0x111cdd){_0x111cdd=_[_0xcd92('0x17')](_0x541a5c[_0xcd92('0x18')]);_0x111cdd=_[_0xcd92('0x19')](_0x111cdd,['body',_0xcd92('0x1a'),'phone','fax',_0xcd92('0x1b')]);}updateUser(_0x6e9a47,_0x111cdd,_0x1fe00d,_0x41656a,_0x6d33c);_0x10ff7a(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 976b694..9834678 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 _0x4d50=['users','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x2519f5,_0x467564){var _0x2db425=function(_0x2350cd){while(--_0x2350cd){_0x2519f5['push'](_0x2519f5['shift']());}};_0x2db425(++_0x467564);}(_0x4d50,0x120));var _0x04d5=function(_0x1ca546,_0x5985d7){_0x1ca546=_0x1ca546-0x0;var _0x332080=_0x4d50[_0x1ca546];return _0x332080;};'use strict';var crypto=require(_0x04d5('0x0'));var util=require(_0x04d5('0x1'));var compose=require(_0x04d5('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x04d5('0x3'));function getValueFromLicense(_0x41fb50,_0x49b3f5){if(_0x41fb50&&_0x49b3f5){if(_0x49b3f5[_0x04d5('0x4')]&&_0x49b3f5[_0x04d5('0x5')]){var _0xde2303=_0x49b3f5[_0x04d5('0x4')];var _0x5e2950=_0x49b3f5['license'];var _0x37a87c=_0xde2303[_0x04d5('0x6')]('-')[0x4];var _0xcd7115=_0xde2303[_0x04d5('0x6')]('-')[0x0];var _0x33d95d=crypto[_0x04d5('0x7')]('aes-256-ctr',util[_0x04d5('0x8')](_0x04d5('0x9'),_0x37a87c,_0xde2303,_0xcd7115));var _0x98a22d=_0x33d95d[_0x04d5('0xa')](_0x5e2950,_0x04d5('0xb'),'utf8');_0x98a22d+=_0x33d95d[_0x04d5('0xc')](_0x04d5('0xd'));var _0x46f829=JSON[_0x04d5('0xe')](_0x98a22d);return _0x46f829[_0x04d5('0xf')](_0x41fb50)?_0x46f829[_0x41fb50]:null;}}return null;}function isLimit(_0x2931b3,_0x286d9d,_0x697b0a,_0x3e91a4){var _0x524f88=_0x286d9d;return compose()[_0x04d5('0x10')](function(_0x2b73a3,_0x266d0f,_0xfd86cf){return db[_0x04d5('0x11')][_0x04d5('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x04d5('0x13')](function(_0x528d14){var _0xf8f66e=getValueFromLicense(_0x2931b3,_0x528d14);return _0xf8f66e?_0xf8f66e:_0x524f88;})['then'](function(_0x23ad53){_0x524f88=_0x23ad53;return _0x697b0a[_0x04d5('0x14')](_0x3e91a4);})['then'](function(_0x234988){if(_0x234988>=_0x524f88){return _0x266d0f[_0x04d5('0x15')](0x193)[_0x04d5('0x16')]({'message':util[_0x04d5('0x8')](_0x04d5('0x17'),_0x2931b3)});}_0xfd86cf();})['catch'](function(_0x2d7690){_0xfd86cf(_0x2d7690);});});}function isUserLimit(){return isLimit(_0x04d5('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x04d5('0x19')]=isUserLimit; \ No newline at end of file +var _0x3f72=['then','count','status','users','User','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','License','findOne'];(function(_0x1ca296,_0x526c4d){var _0x2874ad=function(_0x43feee){while(--_0x43feee){_0x1ca296['push'](_0x1ca296['shift']());}};_0x2874ad(++_0x526c4d);}(_0x3f72,0xbd));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var crypto=require('crypto');var util=require(_0x23f7('0x0'));var compose=require(_0x23f7('0x1'));var db=require(_0x23f7('0x2'))['db'];var config=require(_0x23f7('0x3'));function getValueFromLicense(_0x4a299c,_0x42210a){if(_0x4a299c&&_0x42210a){if(_0x42210a[_0x23f7('0x4')]&&_0x42210a[_0x23f7('0x5')]){var _0x579f7d=_0x42210a['data1'];var _0x114068=_0x42210a[_0x23f7('0x5')];var _0x1773cd=_0x579f7d[_0x23f7('0x6')]('-')[0x4];var _0x3cee14=_0x579f7d[_0x23f7('0x6')]('-')[0x0];var _0x2dc9c9=crypto[_0x23f7('0x7')](_0x23f7('0x8'),util[_0x23f7('0x9')](_0x23f7('0xa'),_0x1773cd,_0x579f7d,_0x3cee14));var _0x3e9a1d=_0x2dc9c9[_0x23f7('0xb')](_0x114068,_0x23f7('0xc'),'utf8');_0x3e9a1d+=_0x2dc9c9[_0x23f7('0xd')](_0x23f7('0xe'));var _0x459fa1=JSON[_0x23f7('0xf')](_0x3e9a1d);return _0x459fa1[_0x23f7('0x10')](_0x4a299c)?_0x459fa1[_0x4a299c]:null;}}return null;}function isLimit(_0x2e318e,_0x585871,_0xdb2e2,_0x3c0acf){var _0x3e2a5d=_0x585871;return compose()['use'](function(_0x25f146,_0x1ae974,_0x3d1bb1){return db[_0x23f7('0x11')][_0x23f7('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x23f7('0x13')](function(_0x71d9f7){var _0x2b4284=getValueFromLicense(_0x2e318e,_0x71d9f7);return _0x2b4284?_0x2b4284:_0x3e2a5d;})['then'](function(_0x11a230){_0x3e2a5d=_0x11a230;return _0xdb2e2[_0x23f7('0x14')](_0x3c0acf);})['then'](function(_0x4d66e7){if(_0x4d66e7>=_0x3e2a5d){return _0x1ae974[_0x23f7('0x15')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2e318e)});}_0x3d1bb1();})['catch'](function(_0x1ceeec){_0x3d1bb1(_0x1ceeec);});});}function isUserLimit(){return isLimit(_0x23f7('0x16'),0x1,db[_0x23f7('0x17')],{'where':{'$or':[{'role':_0x23f7('0x18')},{'role':_0x23f7('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 87b8976..5395a1b 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 _0xad22=['>=\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','match','forEach','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte'];(function(_0x222314,_0x584095){var _0x4875cc=function(_0x2d43b1){while(--_0x2d43b1){_0x222314['push'](_0x222314['shift']());}};_0x4875cc(++_0x584095);}(_0xad22,0x151));var _0x2ad2=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0xad22[_0x5ca5bc];return _0x26ca86;};'use strict';var _=require(_0x2ad2('0x0'));var moment=require('moment');exports[_0x2ad2('0x1')]=function(_0x27c125){var _0xa8eeeb={'conditions':[]};_0xa8eeeb[_0x2ad2('0x2')]=_[_0x2ad2('0x3')](_0x27c125,_0x2ad2('0x4'))?'or':'and';var _0x440a34=_0x27c125[_0x2ad2('0x5')](_0x2ad2('0x6'),'')['replace']('[$or]','')[_0x2ad2('0x7')]('||');for(var _0x3740b7=0x0;_0x3740b7<_0x440a34[_0x2ad2('0x8')];_0x3740b7++){var _0xc82385=_0x440a34[_0x3740b7][_0x2ad2('0x7')](':=');var _0x3c39b0=_0xc82385[0x0];var _0x4a47ec=_0xc82385[_0x2ad2('0x9')](0x1);_0x4a47ec['forEach'](function(_0xd8d8f6){var _0x17e6b4=_0xd8d8f6[_0x2ad2('0x7')]('[')['shift']();var _0x52113d=_0xd8d8f6[_0x2ad2('0xa')](/\[(.*?)\]/g);_0x52113d[_0x2ad2('0xb')](function(_0x433a00){var _0x355df4=_0x433a00['split']('[')['filter'](function(_0xddda4e){return _0xddda4e[_0x2ad2('0xc')](']')>-0x1;})[_0x2ad2('0xd')](function(_0x12ea3c){return _0x12ea3c[_0x2ad2('0x7')](']')[0x0];})[0x0];_0xa8eeeb[_0x2ad2('0xe')][_0x2ad2('0xf')]({'field':_0x3c39b0,'operator':_0x17e6b4,'value':_0x355df4});});});}return _0xa8eeeb;};exports[_0x2ad2('0x10')]=function(_0x5702f2,_0x263b6f,_0x257332){var _0x142849={};if(_0x263b6f===_0x2ad2('0x11')){if(_0x257332[_0x2ad2('0x12')]==='$eq'){_0x257332[_0x2ad2('0x12')]=_0x2ad2('0x13');_0x257332[_0x2ad2('0x14')]+=','+_0x257332['value'];}else if(_['includes']([_0x2ad2('0x15'),_0x2ad2('0x16')],_0x257332[_0x2ad2('0x12')])){_0x257332['value']=moment(_0x257332[_0x2ad2('0x14')])[_0x2ad2('0x17')](0x1,_0x2ad2('0x18'))[_0x2ad2('0x19')](_0x2ad2('0x1a'));}}if(_0x257332[_0x2ad2('0x1b')]){_0x263b6f=_0x257332[_0x2ad2('0x1b')];_0x142849[_0x2ad2('0x1c')]=_0x2ad2('0x1d')+_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+_0x2ad2('0x1f')+_0x257332[_0x2ad2('0x1b')]+')\x20'+parseOperator(_0x257332['operator']);}else{_0x142849['text']=_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+'\x20'+parseOperator(_0x257332[_0x2ad2('0x12')]);}if(_['includes']([_0x2ad2('0x20'),'$notIn'],_0x257332['operator']))_0x142849[_0x2ad2('0x1c')]='('+_0x142849['text']+_0x2ad2('0x21')+_0x5702f2+'.'+_0x257332[_0x2ad2('0x1e')]+_0x2ad2('0x22');_0x142849[_0x2ad2('0x14')]=parseValue(_0x263b6f,_0x257332[_0x2ad2('0x12')],_0x257332[_0x2ad2('0x14')]);return _0x142849;};function parseOperator(_0x12cafa){var _0x365826;switch(_0x12cafa){case _0x2ad2('0x23'):_0x365826=_0x2ad2('0x24');break;case _0x2ad2('0x25'):_0x365826=_0x2ad2('0x26');break;case'$eq':_0x365826=_0x2ad2('0x27');break;case _0x2ad2('0x20'):_0x365826='<>\x20?';break;case _0x2ad2('0x28'):case _0x2ad2('0x29'):case _0x2ad2('0x2a'):_0x365826=_0x2ad2('0x2b');break;case'$lt':_0x365826=_0x2ad2('0x2c');break;case _0x2ad2('0x15'):_0x365826=_0x2ad2('0x2d');break;case _0x2ad2('0x16'):_0x365826=_0x2ad2('0x2e');break;case _0x2ad2('0x2f'):_0x365826=_0x2ad2('0x30');break;case _0x2ad2('0x13'):_0x365826='BETWEEN\x20?\x20AND\x20?';break;}return _0x365826;}function parseValue(_0x2c30cd,_0x313033,_0x48f2ed){var _0x3e2d40={'start':undefined,'end':undefined};switch(_0x313033){case _0x2ad2('0x23'):case'$notIn':_0x3e2d40[_0x2ad2('0x31')]=_0x48f2ed[_0x2ad2('0x7')](',');break;case _0x2ad2('0x28'):_0x3e2d40['start']='%'+_0x48f2ed+'%';break;case'$startsWith':_0x3e2d40['start']=_0x48f2ed+'%';break;case _0x2ad2('0x2a'):_0x3e2d40[_0x2ad2('0x31')]='%'+_0x48f2ed;break;case'$between':var _0x4549d6=_0x48f2ed[_0x2ad2('0x7')](',');var _0x48f2ed=_0x4549d6['shift']();var _0xe8708=_0x4549d6[_0x2ad2('0x32')]();if(_0x2c30cd===_0x2ad2('0x11')){_0x48f2ed=moment(_0x48f2ed)[_0x2ad2('0x33')](0x0,!![])[_0x2ad2('0x19')]();_0xe8708=moment(_0xe8708)[_0x2ad2('0x33')](0x0,!![])[_0x2ad2('0x17')](0x17,_0x2ad2('0x34'))[_0x2ad2('0x17')](0x3b,_0x2ad2('0x35'))[_0x2ad2('0x17')](0x3b,_0x2ad2('0x36'))[_0x2ad2('0x19')]();}_0x3e2d40={'start':_0x48f2ed,'end':_0xe8708};break;default:_0x3e2d40[_0x2ad2('0x31')]=_0x48f2ed;break;}return _0x3e2d40;} \ No newline at end of file +var _0x9558=['$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$endsWith','LIKE\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','DATE','utcOffset','hours','minutes','seconds','moment','sqlOperator','and','replace','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','operator','$between','value','includes','$lte','add','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x9558,0x1d6));var _0x8955=function(_0x441d65,_0x566c1f){_0x441d65=_0x441d65-0x0;var _0x2d05da=_0x9558[_0x441d65];return _0x2d05da;};'use strict';var _=require('lodash');var moment=require(_0x8955('0x0'));exports['parseSearch']=function(_0x141a8c){var _0x230fc4={'conditions':[]};_0x230fc4[_0x8955('0x1')]=_['startsWith'](_0x141a8c,'[$or]')?'or':_0x8955('0x2');var _0x25344f=_0x141a8c[_0x8955('0x3')]('[$and]','')['replace'](_0x8955('0x4'),'')[_0x8955('0x5')]('||');for(var _0x3cd1f5=0x0;_0x3cd1f5<_0x25344f[_0x8955('0x6')];_0x3cd1f5++){var _0x4dcc54=_0x25344f[_0x3cd1f5][_0x8955('0x5')](':=');var _0x428978=_0x4dcc54[0x0];var _0x508e25=_0x4dcc54[_0x8955('0x7')](0x1);_0x508e25[_0x8955('0x8')](function(_0x1db11d){var _0xa15bd6=_0x1db11d[_0x8955('0x5')]('[')[_0x8955('0x9')]();var _0x1cbf0b=_0x1db11d[_0x8955('0xa')](/\[(.*?)\]/g);_0x1cbf0b['forEach'](function(_0x5a287f){var _0x2681dc=_0x5a287f[_0x8955('0x5')]('[')[_0x8955('0xb')](function(_0x4d2a5b){return _0x4d2a5b[_0x8955('0xc')](']')>-0x1;})[_0x8955('0xd')](function(_0x5d5e52){return _0x5d5e52['split'](']')[0x0];})[0x0];_0x230fc4['conditions'][_0x8955('0xe')]({'field':_0x428978,'operator':_0xa15bd6,'value':_0x2681dc});});});}return _0x230fc4;};exports[_0x8955('0xf')]=function(_0x124a3d,_0x2af7fd,_0x4318c8){var _0x4fe44a={};if(_0x2af7fd==='DATE'){if(_0x4318c8[_0x8955('0x10')]==='$eq'){_0x4318c8[_0x8955('0x10')]=_0x8955('0x11');_0x4318c8[_0x8955('0x12')]+=','+_0x4318c8['value'];}else if(_[_0x8955('0x13')](['$gt',_0x8955('0x14')],_0x4318c8[_0x8955('0x10')])){_0x4318c8[_0x8955('0x12')]=moment(_0x4318c8['value'])[_0x8955('0x15')](0x1,'days')[_0x8955('0x16')](_0x8955('0x17'));}}if(_0x4318c8[_0x8955('0x18')]){_0x2af7fd=_0x4318c8[_0x8955('0x18')];_0x4fe44a['text']=_0x8955('0x19')+_0x124a3d+'.'+_0x4318c8[_0x8955('0x1a')]+_0x8955('0x1b')+_0x4318c8['castTo']+')\x20'+parseOperator(_0x4318c8['operator']);}else{_0x4fe44a[_0x8955('0x1c')]=_0x124a3d+'.'+_0x4318c8[_0x8955('0x1a')]+'\x20'+parseOperator(_0x4318c8[_0x8955('0x10')]);}if(_['includes']([_0x8955('0x1d'),_0x8955('0x1e')],_0x4318c8[_0x8955('0x10')]))_0x4fe44a['text']='('+_0x4fe44a[_0x8955('0x1c')]+_0x8955('0x1f')+_0x124a3d+'.'+_0x4318c8[_0x8955('0x1a')]+_0x8955('0x20');_0x4fe44a[_0x8955('0x12')]=parseValue(_0x2af7fd,_0x4318c8[_0x8955('0x10')],_0x4318c8[_0x8955('0x12')]);return _0x4fe44a;};function parseOperator(_0x1b1867){var _0x4f094a;switch(_0x1b1867){case _0x8955('0x21'):_0x4f094a=_0x8955('0x22');break;case _0x8955('0x1e'):_0x4f094a=_0x8955('0x23');break;case _0x8955('0x24'):_0x4f094a='=\x20?';break;case _0x8955('0x1d'):_0x4f094a=_0x8955('0x25');break;case _0x8955('0x26'):case'$startsWith':case _0x8955('0x27'):_0x4f094a=_0x8955('0x28');break;case'$lt':_0x4f094a='<\x20?';break;case'$gt':_0x4f094a='>\x20?';break;case _0x8955('0x14'):_0x4f094a=_0x8955('0x29');break;case _0x8955('0x2a'):_0x4f094a='>=\x20?';break;case _0x8955('0x11'):_0x4f094a=_0x8955('0x2b');break;}return _0x4f094a;}function parseValue(_0x18582d,_0x34367d,_0x6b94a8){var _0x62bc80={'start':undefined,'end':undefined};switch(_0x34367d){case _0x8955('0x21'):case _0x8955('0x1e'):_0x62bc80[_0x8955('0x2c')]=_0x6b94a8[_0x8955('0x5')](',');break;case _0x8955('0x26'):_0x62bc80[_0x8955('0x2c')]='%'+_0x6b94a8+'%';break;case'$startsWith':_0x62bc80[_0x8955('0x2c')]=_0x6b94a8+'%';break;case _0x8955('0x27'):_0x62bc80[_0x8955('0x2c')]='%'+_0x6b94a8;break;case _0x8955('0x11'):var _0x25b748=_0x6b94a8[_0x8955('0x5')](',');var _0x6b94a8=_0x25b748[_0x8955('0x9')]();var _0x1e2fa0=_0x25b748['pop']();if(_0x18582d===_0x8955('0x2d')){_0x6b94a8=moment(_0x6b94a8)[_0x8955('0x2e')](0x0,!![])[_0x8955('0x16')]();_0x1e2fa0=moment(_0x1e2fa0)[_0x8955('0x2e')](0x0,!![])[_0x8955('0x15')](0x17,_0x8955('0x2f'))[_0x8955('0x15')](0x3b,_0x8955('0x30'))[_0x8955('0x15')](0x3b,_0x8955('0x31'))['format']();}_0x62bc80={'start':_0x6b94a8,'end':_0x1e2fa0};break;default:_0x62bc80['start']=_0x6b94a8;break;}return _0x62bc80;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 53f8ce0..3198322 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 _0x274c=['YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','offset','map','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','^[+]?[0-9]*$','isEmail','match','getFullTextValue','replace','push','join','getOptions','query','$id','model','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','type','DATE','format'];(function(_0x232715,_0x4bd63e){var _0x1e6090=function(_0x1baae7){while(--_0x1baae7){_0x232715['push'](_0x232715['shift']());}};_0x1e6090(++_0x4bd63e);}(_0x274c,0x1a4));var _0xc274=function(_0x3a2269,_0x3ef598){_0x3a2269=_0x3a2269-0x0;var _0x34b10b=_0x274c[_0x3a2269];return _0x34b10b;};'use strict';var _=require(_0xc274('0x0'));var sequelize=require(_0xc274('0x1'));var moment=require(_0xc274('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2e5833){var _0x25e01=['ne'];try{var _0x163f56=JSON[_0xc274('0x3')](_0x2e5833);var _0x8e4bd5=Object[_0xc274('0x4')](_0x163f56)[0x0];return _0x25e01[_0xc274('0x5')](_0x8e4bd5);}catch(_0x29e1bf){return![];}}function getOperatorValue(_0x30bc8e){var _0x595b86=JSON[_0xc274('0x3')](_0x30bc8e);var _0x32782b=Object[_0xc274('0x4')](_0x595b86)[0x0];var _0x23682c=_0x595b86[_0x32782b];return{['$'+_0x32782b]:_0x23682c};}exports[_0xc274('0x6')]=function(_0x3a0454){var _0x41b453=null;if(_0x3a0454){_0x41b453=_0x3a0454[_0xc274('0x7')](',');}return _0x41b453;};exports['filters']=function(_0x4f9764,_0x2c4953){var _0x24cd32={};if(!_[_0xc274('0x8')](_0x4f9764)){_['forOwn'](_0x4f9764,function(_0x19a8d1,_0x52075a){try{if(_0x2c4953){var _0x42b921=_['find'](_0x2c4953,{'name':_0x52075a})||{};if(hasSequelizeOperator(_0x19a8d1)){_0x24cd32[_0x52075a]=getOperatorValue(_0x19a8d1);}else if(_0x42b921[_0xc274('0x9')]===_0xc274('0xa')&&_['isPlainObject'](_0x19a8d1)){var _0x491fcf=JSON[_0xc274('0x3')](_0x19a8d1);var _0x88e77b={'$gte':moment(moment(_0x491fcf['$gte'])[_0xc274('0xb')](_0xc274('0xc')))[_0xc274('0xd')]()[_0xc274('0xb')](),'$lte':moment(moment(_0x491fcf[_0xc274('0xe')])[_0xc274('0xb')](_0xc274('0xc')))[_0xc274('0xd')]()[_0xc274('0xf')](0x1,'s')[_0xc274('0xb')]()};_0x24cd32[_0x52075a]=_0x88e77b;}else if(_0x42b921[_0xc274('0x10')]==='uniqueid'){_0x24cd32[_0x52075a]=_0x19a8d1;}else{_0x24cd32[_0x52075a]=_[_0xc274('0x11')](_0x19a8d1)?_0x19a8d1:JSON[_0xc274('0x3')](_0x19a8d1);}}else{_0x24cd32[_0x52075a]=_[_0xc274('0x11')](_0x19a8d1)?_0x19a8d1:JSON[_0xc274('0x3')](_0x19a8d1);}}catch(_0x2a44cf){_0x24cd32[_0x52075a]=_0x19a8d1[_0xc274('0x7')](',');}});}return _0x24cd32;};exports[_0xc274('0x12')]=function(_0x4326a6){_0x4326a6=parseInt(_0x4326a6,0xa);if(!_0x4326a6||_0x4326a6<0x0){_0x4326a6=LIMIT_VALUE;}return _0x4326a6;};exports[_0xc274('0x13')]=function(_0x3dde88){_0x3dde88=parseInt(_0x3dde88,0xa);if(!_0x3dde88||_0x3dde88<0x0){_0x3dde88=0x0;}return _0x3dde88;};exports['sort']=function(_0x2c32c7){var _0x125255,_0x1c9f4c=null;if(_0x2c32c7){_0x125255=_0x2c32c7[_0xc274('0x7')](',');_0x1c9f4c=_[_0xc274('0x14')](_0x125255,function(_0x267289){if(_0x267289['indexOf']('-')===0x0){return[_0x267289==='priority'?sequelize[_0xc274('0x15')](sequelize[_0xc274('0x16')](_0xc274('0x17')),_0xc274('0x18')):_0x267289['substr'](0x1),_0xc274('0x19')];}else{return[_0x267289===_0xc274('0x17')?sequelize[_0xc274('0x15')](sequelize[_0xc274('0x16')]('priority'),_0xc274('0x18')):_0x267289,_0xc274('0x1a')];}});}return _0x1c9f4c;};exports[_0xc274('0x1b')]=function(_0x4e035a,_0x432247){if(_[_0xc274('0x8')](_0x4e035a)){return _0x4e035a;}if(_[_0xc274('0x11')](_0x4e035a)){for(var _0x734b88=0x0;_0x734b88<_0x4e035a[_0xc274('0x1c')];_0x734b88+=0x1){_0x4e035a[_0x734b88]=this[_0xc274('0x1b')](_0x4e035a[_0x734b88],_0x432247);}return _0x4e035a;}if(!_[_0xc274('0x1d')](_0x4e035a)){return _0x4e035a;}if(_[_0xc274('0x1e')](_0x432247)){_0x432247=[_0x432247];}if(!_[_0xc274('0x11')](_0x432247)){return _0x4e035a;}for(var _0x30c416=0x0;_0x30c416<_0x432247[_0xc274('0x1c')];_0x30c416+=0x1){_[_0xc274('0x1f')](_0x4e035a,_0x432247[_0x30c416]);}for(var _0x5c68e2 in _0x4e035a){if(_0x4e035a['hasOwnProperty'](_0x5c68e2)){_0x4e035a[_0x5c68e2]=this['omit'](_0x4e035a[_0x5c68e2],_0x432247);}}return _0x4e035a;};exports['isNumeric']=function(_0x32aeb3){return _0x32aeb3['match'](RegExp(_0xc274('0x20')))?!![]:![];};exports[_0xc274('0x21')]=function(_0x43db7e){return _0x43db7e[_0xc274('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xc274('0x23')]=function(_0x2106d9){var _0x3d3351=[];_0x2106d9[_0xc274('0x7')](/[ ,]+/)['forEach'](function(_0x563ec9){_0x563ec9=_0x563ec9[_0xc274('0x24')](/([^:]")"+/g,'$1');_0x563ec9='+'+_0x563ec9+'*';if(_0x563ec9[_0xc274('0x5')]('@'))_0x563ec9='\x22'+_0x563ec9+'\x22';_0x3d3351[_0xc274('0x25')](_0x563ec9);});return _0x3d3351[_0xc274('0x26')]('\x20');};exports[_0xc274('0x27')]=function(_0x29a32a,_0x15fc33,_0x4e69a5){var _0xf06b58={},_0x20d759={};if(_0x15fc33[_0xc274('0x28')]['$id']){_0x15fc33[_0xc274('0x28')]['id']=_0x15fc33['query'][_0xc274('0x29')];delete _0x15fc33[_0xc274('0x28')][_0xc274('0x29')];}_0xf06b58[_0xc274('0x2a')]=_['map'](_0x29a32a,'name');_0xf06b58[_0xc274('0x28')]=_[_0xc274('0x4')](_0x15fc33['query']);_0xf06b58[_0xc274('0x2b')]=_[_0xc274('0x2c')](_0xf06b58[_0xc274('0x2a')],_0xf06b58[_0xc274('0x28')]);_0x20d759[_0xc274('0x2d')]=_['intersection'](_0xf06b58[_0xc274('0x2a')],this['fields'](_0x15fc33[_0xc274('0x28')][_0xc274('0x6')]));_0x20d759[_0xc274('0x2d')]=_0x20d759[_0xc274('0x2d')][_0xc274('0x1c')]?_0x20d759[_0xc274('0x2d')]:_0xf06b58[_0xc274('0x2a')];if(!_0x15fc33[_0xc274('0x28')][_0xc274('0x2e')](_0xc274('0x2f'))){_0x20d759[_0xc274('0x12')]=this[_0xc274('0x12')](_0x15fc33[_0xc274('0x28')][_0xc274('0x12')]);_0x20d759['offset']=this['offset'](_0x15fc33[_0xc274('0x28')][_0xc274('0x13')]);}_0x20d759[_0xc274('0x30')]=this[_0xc274('0x31')](_0x15fc33[_0xc274('0x28')][_0xc274('0x31')]);_0x20d759[_0xc274('0x32')]=this[_0xc274('0x2b')](_['pick'](_0x15fc33[_0xc274('0x28')],_0xf06b58[_0xc274('0x2b')]),_0x29a32a);if(_0x15fc33['query'][_0xc274('0x33')]){_0x20d759[_0xc274('0x32')]=_['merge'](_0x20d759['where'],{'$or':_[_0xc274('0x14')](_0x29a32a,function(_0x53ebf8){if(_0x53ebf8[_0xc274('0x9')]!==_0xc274('0x34')){if(_0x4e69a5){return sequelize[_0xc274('0x32')](sequelize['fn'](_0xc274('0x35'),sequelize[_0xc274('0x16')](_0x53ebf8[_0xc274('0x10')])),{'$like':sequelize['fn'](_0xc274('0x35'),'%'+_0x15fc33[_0xc274('0x28')]['filter']+'%')});}else{var _0x116eec={};_0x116eec[_0x53ebf8[_0xc274('0x10')]]={'$like':'%'+_0x15fc33[_0xc274('0x28')][_0xc274('0x33')]+'%'};return _0x116eec;}}})});}_0x20d759=_['merge']({},_0x20d759,_0x15fc33['options']);return _0x20d759;}; \ No newline at end of file +var _0x04fb=['keys','includes','fields','split','filters','isEmpty','forOwn','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','length','omit','isObject','isString','unset','isNumeric','match','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','lower','moment','parse'];(function(_0x2d4432,_0x381bf2){var _0x28291c=function(_0x6dfacd){while(--_0x6dfacd){_0x2d4432['push'](_0x2d4432['shift']());}};_0x28291c(++_0x381bf2);}(_0x04fb,0xaf));var _0xb04f=function(_0x1edcc6,_0x10c13e){_0x1edcc6=_0x1edcc6-0x0;var _0x139349=_0x04fb[_0x1edcc6];return _0x139349;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xb04f('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x51790e){var _0x4b8f94=['ne'];try{var _0x27cb96=JSON[_0xb04f('0x1')](_0x51790e);var _0x4b85b7=Object[_0xb04f('0x2')](_0x27cb96)[0x0];return _0x4b8f94[_0xb04f('0x3')](_0x4b85b7);}catch(_0x5b1d76){return![];}}function getOperatorValue(_0x2937b0){var _0x40633f=JSON[_0xb04f('0x1')](_0x2937b0);var _0x1cc13b=Object[_0xb04f('0x2')](_0x40633f)[0x0];var _0x358193=_0x40633f[_0x1cc13b];return{['$'+_0x1cc13b]:_0x358193};}exports[_0xb04f('0x4')]=function(_0x550d83){var _0x31c138=null;if(_0x550d83){_0x31c138=_0x550d83[_0xb04f('0x5')](',');}return _0x31c138;};exports[_0xb04f('0x6')]=function(_0x1e5620,_0x56a765){var _0x242968={};if(!_[_0xb04f('0x7')](_0x1e5620)){_[_0xb04f('0x8')](_0x1e5620,function(_0x5b73fc,_0x55c268){try{if(_0x56a765){var _0x245097=_['find'](_0x56a765,{'name':_0x55c268})||{};if(hasSequelizeOperator(_0x5b73fc)){_0x242968[_0x55c268]=getOperatorValue(_0x5b73fc);}else if(_0x245097[_0xb04f('0x9')]==='DATE'&&_[_0xb04f('0xa')](_0x5b73fc)){var _0x29a316=JSON['parse'](_0x5b73fc);var _0x53793d={'$gte':moment(moment(_0x29a316[_0xb04f('0xb')])[_0xb04f('0xc')](_0xb04f('0xd')))[_0xb04f('0xe')]()[_0xb04f('0xc')](),'$lte':moment(moment(_0x29a316[_0xb04f('0xf')])[_0xb04f('0xc')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0xb04f('0xc')]()};_0x242968[_0x55c268]=_0x53793d;}else if(_0x245097[_0xb04f('0x10')]===_0xb04f('0x11')){_0x242968[_0x55c268]=_0x5b73fc;}else{_0x242968[_0x55c268]=_[_0xb04f('0x12')](_0x5b73fc)?_0x5b73fc:JSON[_0xb04f('0x1')](_0x5b73fc);}}else{_0x242968[_0x55c268]=_[_0xb04f('0x12')](_0x5b73fc)?_0x5b73fc:JSON[_0xb04f('0x1')](_0x5b73fc);}}catch(_0x364c6b){_0x242968[_0x55c268]=_0x5b73fc[_0xb04f('0x5')](',');}});}return _0x242968;};exports[_0xb04f('0x13')]=function(_0x434d9c){_0x434d9c=parseInt(_0x434d9c,0xa);if(!_0x434d9c||_0x434d9c<0x0){_0x434d9c=LIMIT_VALUE;}return _0x434d9c;};exports[_0xb04f('0x14')]=function(_0x3c319a){_0x3c319a=parseInt(_0x3c319a,0xa);if(!_0x3c319a||_0x3c319a<0x0){_0x3c319a=0x0;}return _0x3c319a;};exports[_0xb04f('0x15')]=function(_0x1bee5c){var _0x5d8531,_0x186baf=null;if(_0x1bee5c){_0x5d8531=_0x1bee5c[_0xb04f('0x5')](',');_0x186baf=_['map'](_0x5d8531,function(_0xa1aeb5){if(_0xa1aeb5[_0xb04f('0x16')]('-')===0x0){return[_0xa1aeb5===_0xb04f('0x17')?sequelize[_0xb04f('0x18')](sequelize[_0xb04f('0x19')](_0xb04f('0x17')),_0xb04f('0x1a')):_0xa1aeb5[_0xb04f('0x1b')](0x1),_0xb04f('0x1c')];}else{return[_0xa1aeb5==='priority'?sequelize[_0xb04f('0x18')](sequelize[_0xb04f('0x19')](_0xb04f('0x17')),_0xb04f('0x1a')):_0xa1aeb5,_0xb04f('0x1d')];}});}return _0x186baf;};exports['omit']=function(_0x5dea6f,_0x97560f){if(_[_0xb04f('0x7')](_0x5dea6f)){return _0x5dea6f;}if(_[_0xb04f('0x12')](_0x5dea6f)){for(var _0x350097=0x0;_0x350097<_0x5dea6f[_0xb04f('0x1e')];_0x350097+=0x1){_0x5dea6f[_0x350097]=this[_0xb04f('0x1f')](_0x5dea6f[_0x350097],_0x97560f);}return _0x5dea6f;}if(!_[_0xb04f('0x20')](_0x5dea6f)){return _0x5dea6f;}if(_[_0xb04f('0x21')](_0x97560f)){_0x97560f=[_0x97560f];}if(!_['isArray'](_0x97560f)){return _0x5dea6f;}for(var _0x186e81=0x0;_0x186e81<_0x97560f['length'];_0x186e81+=0x1){_[_0xb04f('0x22')](_0x5dea6f,_0x97560f[_0x186e81]);}for(var _0x2fe641 in _0x5dea6f){if(_0x5dea6f['hasOwnProperty'](_0x2fe641)){_0x5dea6f[_0x2fe641]=this['omit'](_0x5dea6f[_0x2fe641],_0x97560f);}}return _0x5dea6f;};exports[_0xb04f('0x23')]=function(_0xe75a18){return _0xe75a18[_0xb04f('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xb04f('0x25')]=function(_0x177248){return _0x177248[_0xb04f('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xb04f('0x26')]=function(_0x1b5cb9){var _0x4cfeb3=[];_0x1b5cb9[_0xb04f('0x5')](/[ ,]+/)[_0xb04f('0x27')](function(_0x1f1a13){_0x1f1a13=_0x1f1a13[_0xb04f('0x28')](/([^:]")"+/g,'$1');_0x1f1a13='+'+_0x1f1a13+'*';if(_0x1f1a13[_0xb04f('0x3')]('@'))_0x1f1a13='\x22'+_0x1f1a13+'\x22';_0x4cfeb3[_0xb04f('0x29')](_0x1f1a13);});return _0x4cfeb3[_0xb04f('0x2a')]('\x20');};exports[_0xb04f('0x2b')]=function(_0x58ecca,_0xa22935,_0x57d96f){var _0x4bffe4={},_0x259d6e={};if(_0xa22935[_0xb04f('0x2c')]['$id']){_0xa22935['query']['id']=_0xa22935[_0xb04f('0x2c')]['$id'];delete _0xa22935['query'][_0xb04f('0x2d')];}_0x4bffe4[_0xb04f('0x2e')]=_['map'](_0x58ecca,_0xb04f('0x10'));_0x4bffe4[_0xb04f('0x2c')]=_[_0xb04f('0x2')](_0xa22935['query']);_0x4bffe4['filters']=_[_0xb04f('0x2f')](_0x4bffe4['model'],_0x4bffe4[_0xb04f('0x2c')]);_0x259d6e[_0xb04f('0x30')]=_[_0xb04f('0x2f')](_0x4bffe4['model'],this['fields'](_0xa22935[_0xb04f('0x2c')][_0xb04f('0x4')]));_0x259d6e[_0xb04f('0x30')]=_0x259d6e['attributes']['length']?_0x259d6e[_0xb04f('0x30')]:_0x4bffe4['model'];if(!_0xa22935[_0xb04f('0x2c')][_0xb04f('0x31')](_0xb04f('0x32'))){_0x259d6e[_0xb04f('0x13')]=this[_0xb04f('0x13')](_0xa22935[_0xb04f('0x2c')][_0xb04f('0x13')]);_0x259d6e[_0xb04f('0x14')]=this['offset'](_0xa22935[_0xb04f('0x2c')][_0xb04f('0x14')]);}_0x259d6e[_0xb04f('0x33')]=this[_0xb04f('0x15')](_0xa22935['query'][_0xb04f('0x15')]);_0x259d6e[_0xb04f('0x34')]=this[_0xb04f('0x6')](_[_0xb04f('0x35')](_0xa22935['query'],_0x4bffe4[_0xb04f('0x6')]),_0x58ecca);if(_0xa22935[_0xb04f('0x2c')][_0xb04f('0x36')]){_0x259d6e[_0xb04f('0x34')]=_[_0xb04f('0x37')](_0x259d6e[_0xb04f('0x34')],{'$or':_[_0xb04f('0x38')](_0x58ecca,function(_0x22eb91){if(_0x22eb91[_0xb04f('0x9')]!==_0xb04f('0x39')){if(_0x57d96f){return sequelize[_0xb04f('0x34')](sequelize['fn'](_0xb04f('0x3a'),sequelize['col'](_0x22eb91[_0xb04f('0x10')])),{'$like':sequelize['fn'](_0xb04f('0x3a'),'%'+_0xa22935[_0xb04f('0x2c')][_0xb04f('0x36')]+'%')});}else{var _0x1afd5e={};_0x1afd5e[_0x22eb91[_0xb04f('0x10')]]={'$like':'%'+_0xa22935[_0xb04f('0x2c')][_0xb04f('0x36')]+'%'};return _0x1afd5e;}}})});}_0x259d6e=_[_0xb04f('0x37')]({},_0x259d6e,_0xa22935['options']);return _0x259d6e;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index ae09be9..76570fa 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b6d=['html','use','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','./environment','../mysqldb','default','get','env','production','join','root','public','test','set','appPath','client','json\x20replacer','toISOString','split','views','engine','ejs','renderFile','view\x20engine'];(function(_0x36a36c,_0xba8f9e){var _0x351ef6=function(_0x256fb8){while(--_0x256fb8){_0x36a36c['push'](_0x36a36c['shift']());}};_0x351ef6(++_0xba8f9e);}(_0x1b6d,0x1d2));var _0xd1b6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b6d[_0x2c91e9];return _0x13f0ff;};'use strict';var express=require(_0xd1b6('0x0'));var favicon=require(_0xd1b6('0x1'));var bodyParser=require(_0xd1b6('0x2'));var methodOverride=require(_0xd1b6('0x3'));var cookieParser=require(_0xd1b6('0x4'));var errorHandler=require(_0xd1b6('0x5'));var path=require(_0xd1b6('0x6'));var passport=require('passport');var cors=require(_0xd1b6('0x7'));var moment=require('moment');var config=require(_0xd1b6('0x8'));var db=require(_0xd1b6('0x9'))['db'];exports[_0xd1b6('0xa')]=function(_0x60ea17){var _0x355dbe=_0x60ea17[_0xd1b6('0xb')](_0xd1b6('0xc'));if(_0x355dbe===_0xd1b6('0xd')){_0x60ea17['set']('appPath',path[_0xd1b6('0xe')](config[_0xd1b6('0xf')],_0xd1b6('0x10')));}if(_0x355dbe==='development'||_0x355dbe===_0xd1b6('0x11')){_0x60ea17[_0xd1b6('0x12')](_0xd1b6('0x13'),path[_0xd1b6('0xe')](config[_0xd1b6('0xf')],_0xd1b6('0x14')));_0x60ea17['use'](errorHandler());}_0x60ea17['set'](_0xd1b6('0x15'),function(_0x2e1ad3,_0x6c855a){if(this[_0x2e1ad3]instanceof Date){_0x6c855a=this[_0x2e1ad3][_0xd1b6('0x16')]()[_0xd1b6('0x17')]('.')[0x0]+'Z';}return _0x6c855a;});_0x60ea17['use'](express['static'](_0x60ea17['get'](_0xd1b6('0x13'))));_0x60ea17['set'](_0xd1b6('0x18'),config[_0xd1b6('0xf')]+'/server/views');_0x60ea17[_0xd1b6('0x19')]('html',require(_0xd1b6('0x1a'))[_0xd1b6('0x1b')]);_0x60ea17[_0xd1b6('0x12')](_0xd1b6('0x1c'),_0xd1b6('0x1d'));_0x60ea17[_0xd1b6('0x1e')](bodyParser['urlencoded']({'limit':_0xd1b6('0x1f'),'extended':!![]}));_0x60ea17[_0xd1b6('0x1e')](bodyParser['json']({'limit':'50mb'}));_0x60ea17[_0xd1b6('0x1e')](cors());_0x60ea17[_0xd1b6('0x1e')](methodOverride());_0x60ea17[_0xd1b6('0x1e')](cookieParser());_0x60ea17[_0xd1b6('0x1e')](passport[_0xd1b6('0x20')]());}; \ No newline at end of file +var _0xcc52=['view\x20engine','50mb','json','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','default','env','production','set','appPath','root','development','test','join','client','use','json\x20replacer','toISOString','split','static','get','views','/server/views','engine','html','ejs','renderFile'];(function(_0x42e318,_0x26c8ab){var _0x559e05=function(_0x5621e3){while(--_0x5621e3){_0x42e318['push'](_0x42e318['shift']());}};_0x559e05(++_0x26c8ab);}(_0xcc52,0x19b));var _0x2cc5=function(_0x1ba220,_0x35e01d){_0x1ba220=_0x1ba220-0x0;var _0x4e0b55=_0xcc52[_0x1ba220];return _0x4e0b55;};'use strict';var express=require(_0x2cc5('0x0'));var favicon=require(_0x2cc5('0x1'));var bodyParser=require(_0x2cc5('0x2'));var methodOverride=require(_0x2cc5('0x3'));var cookieParser=require(_0x2cc5('0x4'));var errorHandler=require(_0x2cc5('0x5'));var path=require(_0x2cc5('0x6'));var passport=require('passport');var cors=require(_0x2cc5('0x7'));var moment=require(_0x2cc5('0x8'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0x2cc5('0x9')]=function(_0x250a3c){var _0x3fc458=_0x250a3c['get'](_0x2cc5('0xa'));if(_0x3fc458===_0x2cc5('0xb')){_0x250a3c[_0x2cc5('0xc')](_0x2cc5('0xd'),path['join'](config[_0x2cc5('0xe')],'public'));}if(_0x3fc458===_0x2cc5('0xf')||_0x3fc458===_0x2cc5('0x10')){_0x250a3c[_0x2cc5('0xc')](_0x2cc5('0xd'),path[_0x2cc5('0x11')](config[_0x2cc5('0xe')],_0x2cc5('0x12')));_0x250a3c[_0x2cc5('0x13')](errorHandler());}_0x250a3c[_0x2cc5('0xc')](_0x2cc5('0x14'),function(_0xae1e5e,_0x1eb18d){if(this[_0xae1e5e]instanceof Date){_0x1eb18d=this[_0xae1e5e][_0x2cc5('0x15')]()[_0x2cc5('0x16')]('.')[0x0]+'Z';}return _0x1eb18d;});_0x250a3c[_0x2cc5('0x13')](express[_0x2cc5('0x17')](_0x250a3c[_0x2cc5('0x18')]('appPath')));_0x250a3c['set'](_0x2cc5('0x19'),config[_0x2cc5('0xe')]+_0x2cc5('0x1a'));_0x250a3c[_0x2cc5('0x1b')](_0x2cc5('0x1c'),require(_0x2cc5('0x1d'))[_0x2cc5('0x1e')]);_0x250a3c[_0x2cc5('0xc')](_0x2cc5('0x1f'),'html');_0x250a3c[_0x2cc5('0x13')](bodyParser['urlencoded']({'limit':_0x2cc5('0x20'),'extended':!![]}));_0x250a3c[_0x2cc5('0x13')](bodyParser[_0x2cc5('0x21')]({'limit':_0x2cc5('0x20')}));_0x250a3c[_0x2cc5('0x13')](cors());_0x250a3c[_0x2cc5('0x13')](methodOverride());_0x250a3c[_0x2cc5('0x13')](cookieParser());_0x250a3c[_0x2cc5('0x13')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 2c11acc..d489c70 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 _0xf513=['getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex'];(function(_0x2c27f7,_0x1bf813){var _0x29a758=function(_0x553527){while(--_0x553527){_0x2c27f7['push'](_0x2c27f7['shift']());}};_0x29a758(++_0x1bf813);}(_0xf513,0x144));var _0x3f51=function(_0x13c027,_0x22f584){_0x13c027=_0x13c027-0x0;var _0x5336ae=_0xf513[_0x13c027];return _0x5336ae;};'use strict';var _=require(_0x3f51('0x0'));var os=require('os');var crypto=require(_0x3f51('0x1'));var machine=require(_0x3f51('0x2'));var exec=require(_0x3f51('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x518871=[];var _0x414807=os[_0x3f51('0x4')]();var _0x149516=_['orderBy'](_[_0x3f51('0x5')](_0x414807));for(var _0x7ce313=0x0;_0x7ce313<_0x149516[_0x3f51('0x6')];_0x7ce313++){var _0x3b0e87=_0x414807[_0x149516[_0x7ce313]]['filter'](function(_0x88867d){return _0x88867d[_0x3f51('0x7')]===_0x3f51('0x8')&&_0x88867d['internal']===![];});_0x518871=_0x518871[_0x3f51('0x9')](_0x3b0e87);}return _0x518871;}function getFirstInterface(){var _0x2a9183=_[_0x3f51('0xa')](getInterfaces());return{'macAddress':_0x2a9183&&_0x2a9183[_0x3f51('0xb')]?_0x2a9183[_0x3f51('0xb')]:_0x3f51('0xc'),'ipAddress':_0x2a9183&&_0x2a9183[_0x3f51('0xd')]?_0x2a9183[_0x3f51('0xd')]:_0x3f51('0xe')};}exports[_0x3f51('0xf')]=getFirstInterface;function getCPUhash(){var _0x3b5d90=_[_0x3f51('0x10')](os[_0x3f51('0x11')]()[_0x3f51('0x12')](function(_0x26f980){return _0x26f980[_0x3f51('0x13')];}))[_0x3f51('0x14')](':');return crypto[_0x3f51('0x15')](_0x3f51('0x16'))[_0x3f51('0x17')](_0x3b5d90)[_0x3f51('0x18')](_0x3f51('0x19'));}exports[_0x3f51('0x1a')]=function(){var _0x42f407=os['platform']();var _0x55ed2c=/[0-9a-f-]{36}/;if(config[_0x3f51('0x1b')]&&_0x55ed2c['test'](config[_0x3f51('0x1b')])){return config[_0x3f51('0x1b')];}else if(_0x42f407===_0x3f51('0x1c')){return exec(_0x3f51('0x1d'),{'encoding':_0x3f51('0x1e')})[_0x3f51('0x1f')]('\x0d\x0a','');}else{var _0x2fb1b7=getFirstInterface();var _0x41dc88=getCPUhash();var _0xb7ce52=_0x41dc88+'|'+os[_0x3f51('0x20')]()+'|'+_0x2fb1b7['macAddress']+'|'+_0x2fb1b7[_0x3f51('0x21')];var _0x421d0b=crypto[_0x3f51('0x15')](_0x3f51('0x16'))[_0x3f51('0x17')](_0xb7ce52)['digest']('hex');return _0x421d0b[_0x3f51('0x22')](0x0,0x8)+'-'+_0x421d0b['substring'](0x8,0xc)+'-'+_0x421d0b[_0x3f51('0x22')](0xc,0x10)+'-'+_0x421d0b[_0x3f51('0x22')](0x10,0x14)+'-'+_0x421d0b[_0x3f51('0x22')](0x14);}}; \ No newline at end of file +var _0x1227=['lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','digest','hex','getUuid','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring'];(function(_0x53be0d,_0xbb1a39){var _0x23fe66=function(_0x5643b5){while(--_0x5643b5){_0x53be0d['push'](_0x53be0d['shift']());}};_0x23fe66(++_0xbb1a39);}(_0x1227,0x1c8));var _0x7122=function(_0x537683,_0x410d59){_0x537683=_0x537683-0x0;var _0x1659b4=_0x1227[_0x537683];return _0x1659b4;};'use strict';var _=require(_0x7122('0x0'));var os=require('os');var crypto=require(_0x7122('0x1'));var machine=require(_0x7122('0x2'));var exec=require(_0x7122('0x3'))[_0x7122('0x4')];var config=require(_0x7122('0x5'));function getInterfaces(){var _0x26e5c1=[];var _0x5a771c=os[_0x7122('0x6')]();var _0x399555=_[_0x7122('0x7')](_[_0x7122('0x8')](_0x5a771c));for(var _0x2f9ef8=0x0;_0x2f9ef8<_0x399555[_0x7122('0x9')];_0x2f9ef8++){var _0x3479cb=_0x5a771c[_0x399555[_0x2f9ef8]][_0x7122('0xa')](function(_0x485673){return _0x485673[_0x7122('0xb')]===_0x7122('0xc')&&_0x485673[_0x7122('0xd')]===![];});_0x26e5c1=_0x26e5c1[_0x7122('0xe')](_0x3479cb);}return _0x26e5c1;}function getFirstInterface(){var _0x4787f8=_[_0x7122('0xf')](getInterfaces());return{'macAddress':_0x4787f8&&_0x4787f8['mac']?_0x4787f8['mac']:_0x7122('0x10'),'ipAddress':_0x4787f8&&_0x4787f8[_0x7122('0x11')]?_0x4787f8['address']:_0x7122('0x12')};}exports[_0x7122('0x13')]=getFirstInterface;function getCPUhash(){var _0x48c834=_[_0x7122('0x7')](os['cpus']()[_0x7122('0x14')](function(_0x47e0ce){return _0x47e0ce[_0x7122('0x15')];}))[_0x7122('0x16')](':');return crypto[_0x7122('0x17')](_0x7122('0x18'))[_0x7122('0x19')](_0x48c834)[_0x7122('0x1a')](_0x7122('0x1b'));}exports[_0x7122('0x1c')]=function(){var _0xc60ac3=os['platform']();var _0x31fbfd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x31fbfd[_0x7122('0x1d')](config[_0x7122('0x1e')])){return config[_0x7122('0x1e')];}else if(_0xc60ac3===_0x7122('0x1f')){return exec(_0x7122('0x20'),{'encoding':_0x7122('0x21')})[_0x7122('0x22')]('\x0d\x0a','');}else{var _0xe6c02e=getFirstInterface();var _0x5c31da=getCPUhash();var _0x3c74ac=_0x5c31da+'|'+os[_0x7122('0x23')]()+'|'+_0xe6c02e[_0x7122('0x24')]+'|'+_0xe6c02e['ipAddress'];var _0x57155d=crypto['createHash'](_0x7122('0x18'))['update'](_0x3c74ac)[_0x7122('0x1a')](_0x7122('0x1b'));return _0x57155d[_0x7122('0x25')](0x0,0x8)+'-'+_0x57155d[_0x7122('0x25')](0x8,0xc)+'-'+_0x57155d[_0x7122('0x25')](0xc,0x10)+'-'+_0x57155d[_0x7122('0x25')](0x10,0x14)+'-'+_0x57155d[_0x7122('0x25')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 88ca47c..9d067bb 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 _0xfb60=['request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data1','then','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment'];(function(_0x5f1f63,_0x740dbf){var _0x4ff682=function(_0x1b1395){while(--_0x1b1395){_0x5f1f63['push'](_0x5f1f63['shift']());}};_0x4ff682(++_0x740dbf);}(_0xfb60,0x198));var _0x0fb6=function(_0x53d1f9,_0x507162){_0x53d1f9=_0x53d1f9-0x0;var _0x45ec63=_0xfb60[_0x53d1f9];return _0x45ec63;};'use strict';var util=require(_0x0fb6('0x0'));var moment=require(_0x0fb6('0x1'));var rp=require(_0x0fb6('0x2'));var BPromise=require(_0x0fb6('0x3'));var pkginfo=require(_0x0fb6('0x4'))(module,_0x0fb6('0x5'));var db=require(_0x0fb6('0x6'))['db'];var encryptor=require(_0x0fb6('0x7'));var hardware=require(_0x0fb6('0x8'));var logger=require('../logger')('license');var HOST=_0x0fb6('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45f3d3){return new BPromise(function(_0x5e21e3,_0xcc62d7){var _0x321f48=util[_0x0fb6('0xa')](_0x0fb6('0xb'),HOST,_0x45f3d3,module[_0x0fb6('0xc')][_0x0fb6('0x5')]);if(oldToken){_0x321f48=util[_0x0fb6('0xa')](_0x0fb6('0xd'),HOST,_0x45f3d3,module[_0x0fb6('0xc')][_0x0fb6('0x5')],oldToken);}var _0x5e93d4={'uri':_0x321f48,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5e93d4)['then'](function(_0x52cb22){_0x5e21e3(_0x52cb22);})[_0x0fb6('0xe')](function(_0x18f43d){_0xcc62d7(_0x18f43d);});});}function manageLicense(_0x5c6490,_0x16be6b){var _0xe10a33=_0x16be6b['get']({'plain':!![]});if(!isOldTokenSent&&_0xe10a33[_0x0fb6('0xf')]!==_0x5c6490&&!_0xe10a33['data2']){oldToken=_0xe10a33[_0x0fb6('0xf')];}httpRequest(_0x5c6490)[_0x0fb6('0x10')](function(_0x4b45b9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4b45b9['active']){isOldTokenSent=![];if(!_0xe10a33[_0x0fb6('0x11')]&&_0xe10a33[_0x0fb6('0x11')]!=_0x4b45b9[_0x0fb6('0x11')]||_0xe10a33[_0x0fb6('0x11')]&&_0xe10a33[_0x0fb6('0x12')]){logger['info'](_0x0fb6('0x13'));}if(_0xe10a33['license']&&!_0xe10a33[_0x0fb6('0x12')]&&_0xe10a33[_0x0fb6('0x11')]!=_0x4b45b9[_0x0fb6('0x11')]){logger[_0x0fb6('0x14')](_0x0fb6('0x15'));}if(_0xe10a33[_0x0fb6('0x11')]&&!_0xe10a33['data2']&&_0xe10a33[_0x0fb6('0x11')]==_0x4b45b9['license']){return _0x16be6b;}return _0x16be6b['update']({'data1':_0x5c6490,'data2':null,'license':_0x4b45b9[_0x0fb6('0x11')]});}else{if(_0x4b45b9[_0x0fb6('0x11')]||_0xe10a33['license']){if(!_0xe10a33[_0x0fb6('0x12')]){if(_0xe10a33[_0x0fb6('0xf')]==_0x5c6490){GRAY_PERIOD_REASON=_0x0fb6('0x16');logger[_0x0fb6('0x14')](_0x0fb6('0x17'));}else{GRAY_PERIOD_REASON=_0x0fb6('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xe10a33[_0x0fb6('0xf')],_0x5c6490);}logger[_0x0fb6('0x14')](_0x0fb6('0x19'),GRAY_PERIOD_REASON[_0x0fb6('0x1a')](),moment()[_0x0fb6('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x16be6b['update']({'data2':encryptor[_0x0fb6('0x1b')](moment()[_0x0fb6('0xa')](_0x0fb6('0x1c')))});}else{if(moment()[_0x0fb6('0x1d')](encryptor[_0x0fb6('0x1e')](_0xe10a33['data2']),'days')>DAYS){logger[_0x0fb6('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0fb6('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x16be6b[_0x0fb6('0x1f')]({'data1':_0x5c6490,'data2':null,'license':null});}}}else{if(_0xe10a33[_0x0fb6('0xf')]!=_0x5c6490){logger[_0x0fb6('0x14')](_0x0fb6('0x20'),_0xe10a33[_0x0fb6('0xf')],_0x5c6490);return _0x16be6b[_0x0fb6('0x1f')]({'data1':_0x5c6490,'data2':null,'license':null});}}}return _0x16be6b;})[_0x0fb6('0x10')](function(_0x517855){_0x16be6b=_0x517855;})['catch'](function(_0x477f38){logger[_0x0fb6('0x21')](_0x477f38[_0x0fb6('0x22')]);})[_0x0fb6('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x0fb6('0x24')](),_0x16be6b);},TIME);});}function defaultLicense(){var _0x32caab=hardware[_0x0fb6('0x24')]();if(_0x32caab){return db[_0x0fb6('0x25')][_0x0fb6('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x32caab}})['spread'](function(_0x1b91c7,_0x5e6001){logger[_0x0fb6('0x14')](_0x0fb6('0x27'),_0x32caab);manageLicense(_0x32caab,_0x1b91c7);})['catch'](function(_0x20f34d){logger[_0x0fb6('0x21')](_0x20f34d[_0x0fb6('0x22')]);});}}exports[_0x0fb6('0x28')]=defaultLicense; \ No newline at end of file +var _0x47aa=['finally','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','request-promise','pkginfo','version','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','catch','get','data1','data2','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s'];(function(_0x5ae3c8,_0x62a22f){var _0x5781b7=function(_0x1377c6){while(--_0x1377c6){_0x5ae3c8['push'](_0x5ae3c8['shift']());}};_0x5781b7(++_0x62a22f);}(_0x47aa,0x71));var _0xa47a=function(_0x47be5f,_0x3099c6){_0x47be5f=_0x47be5f-0x0;var _0x1193d0=_0x47aa[_0x47be5f];return _0x1193d0;};'use strict';var util=require(_0xa47a('0x0'));var moment=require('moment');var rp=require(_0xa47a('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xa47a('0x2'))(module,_0xa47a('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xa47a('0x4'));var logger=require(_0xa47a('0x5'))(_0xa47a('0x6'));var HOST=_0xa47a('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x226a02){return new BPromise(function(_0x592ee6,_0x3eb809){var _0x2659cc=util[_0xa47a('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x226a02,module['exports'][_0xa47a('0x3')]);if(oldToken){_0x2659cc=util[_0xa47a('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x226a02,module[_0xa47a('0x9')][_0xa47a('0x3')],oldToken);}var _0x4f565f={'uri':_0x2659cc,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4f565f)['then'](function(_0x161118){_0x592ee6(_0x161118);})[_0xa47a('0xa')](function(_0x5c3541){_0x3eb809(_0x5c3541);});});}function manageLicense(_0x365833,_0x2dc7b7){var _0x252a48=_0x2dc7b7[_0xa47a('0xb')]({'plain':!![]});if(!isOldTokenSent&&_0x252a48[_0xa47a('0xc')]!==_0x365833&&!_0x252a48[_0xa47a('0xd')]){oldToken=_0x252a48[_0xa47a('0xc')];}httpRequest(_0x365833)[_0xa47a('0xe')](function(_0xc9f81f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xc9f81f['active']){isOldTokenSent=![];if(!_0x252a48[_0xa47a('0x6')]&&_0x252a48[_0xa47a('0x6')]!=_0xc9f81f[_0xa47a('0x6')]||_0x252a48[_0xa47a('0x6')]&&_0x252a48[_0xa47a('0xd')]){logger[_0xa47a('0xf')](_0xa47a('0x10'));}if(_0x252a48[_0xa47a('0x6')]&&!_0x252a48['data2']&&_0x252a48[_0xa47a('0x6')]!=_0xc9f81f[_0xa47a('0x6')]){logger[_0xa47a('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x252a48['license']&&!_0x252a48['data2']&&_0x252a48['license']==_0xc9f81f[_0xa47a('0x6')]){return _0x2dc7b7;}return _0x2dc7b7[_0xa47a('0x11')]({'data1':_0x365833,'data2':null,'license':_0xc9f81f[_0xa47a('0x6')]});}else{if(_0xc9f81f['license']||_0x252a48[_0xa47a('0x6')]){if(!_0x252a48[_0xa47a('0xd')]){if(_0x252a48['data1']==_0x365833){GRAY_PERIOD_REASON=_0xa47a('0x12');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xa47a('0x13');logger['info'](_0xa47a('0x14'),_0x252a48[_0xa47a('0xc')],_0x365833);}logger[_0xa47a('0xf')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xa47a('0x15')](),moment()['format'](_0xa47a('0x16')));return _0x2dc7b7[_0xa47a('0x11')]({'data2':encryptor[_0xa47a('0x17')](moment()[_0xa47a('0x8')](_0xa47a('0x16')))});}else{if(moment()[_0xa47a('0x18')](encryptor['decryptString'](_0x252a48[_0xa47a('0xd')]),_0xa47a('0x19'))>DAYS){logger[_0xa47a('0xf')](_0xa47a('0x1a'),moment()[_0xa47a('0x8')](_0xa47a('0x16')));isOldTokenSent=![];return _0x2dc7b7[_0xa47a('0x11')]({'data1':_0x365833,'data2':null,'license':null});}}}else{if(_0x252a48[_0xa47a('0xc')]!=_0x365833){logger[_0xa47a('0xf')](_0xa47a('0x14'),_0x252a48['data1'],_0x365833);return _0x2dc7b7['update']({'data1':_0x365833,'data2':null,'license':null});}}}return _0x2dc7b7;})[_0xa47a('0xe')](function(_0x91217){_0x2dc7b7=_0x91217;})[_0xa47a('0xa')](function(_0x123cb6){logger['error'](_0x123cb6['message']);})[_0xa47a('0x1b')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2dc7b7);},TIME);});}function defaultLicense(){var _0xf6fd72=hardware['getUuid']();if(_0xf6fd72){return db[_0xa47a('0x1c')][_0xa47a('0x1d')]({'where':{'id':0x1},'defaults':{'data1':_0xf6fd72}})[_0xa47a('0x1e')](function(_0x2663b1,_0x1e9013){logger[_0xa47a('0xf')](_0xa47a('0x1f'),_0xf6fd72);manageLicense(_0xf6fd72,_0x2663b1);})[_0xa47a('0xa')](function(_0x5e5a28){logger[_0xa47a('0x20')](_0x5e5a28[_0xa47a('0x21')]);});}}exports[_0xa47a('0x22')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5e420cd..c0c754b 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 _0x8438=['getUuid','Breaking\x20license','License','find','defaults','then','license','License\x20key\x20value\x20not\x20found','data1','split','decryptString','%s:%s:%s','parse','demo','uuid','deadline','format','grayReason','machineUuid','changed','disabled','message','User','sequelize','count','role','admin','user','telephone','users','telephones','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x64c622,_0x19f642){var _0xffc8fa=function(_0x5ba3e3){while(--_0x5ba3e3){_0x64c622['push'](_0x64c622['shift']());}};_0xffc8fa(++_0x19f642);}(_0x8438,0x19f));var _0x8843=function(_0x29896d,_0x4db4c7){_0x29896d=_0x29896d-0x0;var _0x239f25=_0x8438[_0x29896d];return _0x239f25;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8843('0x0'));var BPromise=require(_0x8843('0x1'));var hardware=require('./hardware');var encryptor=require(_0x8843('0x2'));var db=require(_0x8843('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8843('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x8843('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8843('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8843('0x6'),'machineUuid':hardware[_0x8843('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xab7479){return new BPromise(function(_0x4ced06,_0x6029d3){return db[_0x8843('0x7')][_0x8843('0x8')](_[_0x8843('0x9')](_0xab7479,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x8eb64a){return checkLicense(_0x8eb64a,null);})[_0x8843('0xa')](function(_0x131ddc){_0x4ced06(_0x131ddc);return;})['catch'](function(_0x43d1be){_0x6029d3(_0x43d1be);});});}function checkLicense(_0x2f6f5c,_0x5a645d){if(!_0x2f6f5c){demoLicense['uuid']=_0x2f6f5c['data1'];return demoLicense;}try{var _0x3841d4=_0x5a645d||_0x2f6f5c[_0x8843('0xb')];if(_['isEmpty'](_0x3841d4)){throw new Error(_0x8843('0xc'));}var _0x56c806=_0x2f6f5c[_0x8843('0xd')];var _0x5b6c31=_0x2f6f5c['data2'];var _0x565cac=_0x56c806[_0x8843('0xe')]('-')[0x4];var _0x256c26=_0x56c806[_0x8843('0xe')]('-')[0x0];var _0x521c18=encryptor[_0x8843('0xf')](_0x3841d4,util['format'](_0x8843('0x10'),_0x565cac,_0x56c806,_0x256c26));var _0x253f84=JSON[_0x8843('0x11')](_0x521c18);_0x253f84[_0x8843('0x12')]=![];_0x253f84[_0x8843('0x13')]=_0x56c806;_0x253f84['machineUuid']=hardware['getUuid']();if(_0x5b6c31){var _0x4dfc87=encryptor[_0x8843('0xf')](_0x5b6c31);_0x253f84['gray']=_0x4dfc87;_0x253f84[_0x8843('0x14')]=moment(_0x4dfc87)['add'](0x7,'days')[_0x8843('0x15')]();_0x253f84[_0x8843('0x16')]=_0x253f84['uuid']!=_0x253f84[_0x8843('0x17')]?_0x8843('0x18'):_0x8843('0x19');}return _0x253f84;}catch(_0x419667){breakingLicense[_0x8843('0x13')]=_0x2f6f5c[_0x8843('0xd')];breakingLicense[_0x8843('0x1a')]=_0x419667['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x17e7c1,_0x559a38){getLicense()['then'](function(_0x54d717){return db[_0x8843('0x1b')]['findAll']({'attributes':['role',[db['sequelize']['fn']('COUNT',db[_0x8843('0x1c')]['col']('role')),_0x8843('0x1d')]],'group':_0x8843('0x1e'),'where':{'role':{'$or':[_0x8843('0x1f'),_0x8843('0x20'),_0x8843('0x21')]}},'raw':!![]})[_0x8843('0xa')](function(_0x19e7cf){var _0x1450fd={'user':_0x54d717[_0x8843('0x22')]||0x0,'telephone':_0x54d717[_0x8843('0x23')]||0x0};_0x19e7cf['forEach'](function(_0x28294c){var _0x19509e=_0x28294c['role']===_0x8843('0x1f')?_0x8843('0x20'):_0x28294c[_0x8843('0x1e')];_0x1450fd[_0x19509e]-=_0x28294c[_0x8843('0x1d')];if(_0x1450fd[_0x19509e]<0x0)_0x1450fd[_0x19509e]=0x0;});_0x17e7c1(_0x1450fd);return;});})[_0x8843('0x24')](function(_0x524d7c){_0x559a38(_0x524d7c);});});}function checkUserLimits(_0x50e905){return new BPromise(function(_0x15c255,_0x591898){getLimits()[_0x8843('0xa')](function(_0x723bb){var _0x5539f7=_[_0x8843('0x25')](_[_0x8843('0x26')](_0x50e905,_0x8843('0x1e')),[_0x8843('0x1f'),_0x8843('0x20'),_0x8843('0x21')]);var _0x37316f=(_0x5539f7[_0x8843('0x1f')]||0x0)+(_0x5539f7[_0x8843('0x20')]||0x0);var _0x5eae1d=_0x5539f7[_0x8843('0x21')]||0x0;if(_0x37316f>_0x723bb['user'])return _0x591898(_0x8843('0x27'));if(_0x5eae1d>_0x723bb[_0x8843('0x21')])return _0x591898(_0x8843('0x28'));return _0x15c255();})[_0x8843('0x24')](function(_0x3ccac7){_0x591898(_0x3ccac7);});});}module[_0x8843('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x3623=['add','days','format','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','users','telephones','forEach','admin','catch','pick','countBy','user','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','data1','license','License\x20key\x20value\x20not\x20found','split','decryptString','parse','uuid','machineUuid','deadline'];(function(_0x8dbd01,_0x4c24f3){var _0x5874c=function(_0x4851cf){while(--_0x4851cf){_0x8dbd01['push'](_0x8dbd01['shift']());}};_0x5874c(++_0x4c24f3);}(_0x3623,0x7a));var _0x3362=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0x3623[_0x37e342];return _0x1768f9;};'use strict';var util=require(_0x3362('0x0'));var _=require(_0x3362('0x1'));var moment=require(_0x3362('0x2'));var BPromise=require(_0x3362('0x3'));var hardware=require('./hardware');var encryptor=require(_0x3362('0x4'));var db=require(_0x3362('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3362('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3362('0x7'),'machineUuid':hardware[_0x3362('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3362('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3362('0x9'),'machineUuid':hardware[_0x3362('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x34d64c){return new BPromise(function(_0x299837,_0x51655f){return db['License'][_0x3362('0xa')](_[_0x3362('0xb')](_0x34d64c,{'raw':!![],'where':{'id':0x1}}))[_0x3362('0xc')](function(_0x453c34){return checkLicense(_0x453c34,null);})[_0x3362('0xc')](function(_0xc9ea30){_0x299837(_0xc9ea30);return;})['catch'](function(_0x3fbace){_0x51655f(_0x3fbace);});});}function checkLicense(_0x39cb26,_0x2e9a6b){if(!_0x39cb26){demoLicense['uuid']=_0x39cb26[_0x3362('0xd')];return demoLicense;}try{var _0xc0a758=_0x2e9a6b||_0x39cb26[_0x3362('0xe')];if(_['isEmpty'](_0xc0a758)){throw new Error(_0x3362('0xf'));}var _0xff713a=_0x39cb26[_0x3362('0xd')];var _0x4cc064=_0x39cb26['data2'];var _0x454d78=_0xff713a[_0x3362('0x10')]('-')[0x4];var _0x4d0a64=_0xff713a[_0x3362('0x10')]('-')[0x0];var _0x115019=encryptor[_0x3362('0x11')](_0xc0a758,util['format']('%s:%s:%s',_0x454d78,_0xff713a,_0x4d0a64));var _0x2f3eb4=JSON[_0x3362('0x12')](_0x115019);_0x2f3eb4['demo']=![];_0x2f3eb4[_0x3362('0x13')]=_0xff713a;_0x2f3eb4[_0x3362('0x14')]=hardware[_0x3362('0x8')]();if(_0x4cc064){var _0x4d0ea6=encryptor[_0x3362('0x11')](_0x4cc064);_0x2f3eb4['gray']=_0x4d0ea6;_0x2f3eb4[_0x3362('0x15')]=moment(_0x4d0ea6)[_0x3362('0x16')](0x7,_0x3362('0x17'))[_0x3362('0x18')]();_0x2f3eb4[_0x3362('0x19')]=_0x2f3eb4[_0x3362('0x13')]!=_0x2f3eb4[_0x3362('0x14')]?_0x3362('0x1a'):_0x3362('0x1b');}return _0x2f3eb4;}catch(_0xfb0d0f){breakingLicense['uuid']=_0x39cb26[_0x3362('0xd')];breakingLicense[_0x3362('0x1c')]=_0xfb0d0f[_0x3362('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x10150b,_0x5c53c4){getLicense()['then'](function(_0x20da6e){return db[_0x3362('0x1d')][_0x3362('0x1e')]({'attributes':[_0x3362('0x1f'),[db[_0x3362('0x20')]['fn'](_0x3362('0x21'),db[_0x3362('0x20')][_0x3362('0x22')](_0x3362('0x1f'))),_0x3362('0x23')]],'group':_0x3362('0x1f'),'where':{'role':{'$or':['admin','user','telephone']}},'raw':!![]})[_0x3362('0xc')](function(_0x22e9cf){var _0x973673={'user':_0x20da6e[_0x3362('0x24')]||0x0,'telephone':_0x20da6e[_0x3362('0x25')]||0x0};_0x22e9cf[_0x3362('0x26')](function(_0x3d5198){var _0x262c7c=_0x3d5198[_0x3362('0x1f')]===_0x3362('0x27')?'user':_0x3d5198[_0x3362('0x1f')];_0x973673[_0x262c7c]-=_0x3d5198[_0x3362('0x23')];if(_0x973673[_0x262c7c]<0x0)_0x973673[_0x262c7c]=0x0;});_0x10150b(_0x973673);return;});})[_0x3362('0x28')](function(_0x102159){_0x5c53c4(_0x102159);});});}function checkUserLimits(_0x4489a5){return new BPromise(function(_0x3f63df,_0x1ed6e3){getLimits()[_0x3362('0xc')](function(_0x3fe837){var _0x20f578=_[_0x3362('0x29')](_[_0x3362('0x2a')](_0x4489a5,_0x3362('0x1f')),[_0x3362('0x27'),_0x3362('0x2b'),_0x3362('0x2c')]);var _0x5eaee5=(_0x20f578[_0x3362('0x27')]||0x0)+(_0x20f578[_0x3362('0x2b')]||0x0);var _0x41b4aa=_0x20f578[_0x3362('0x2c')]||0x0;if(_0x5eaee5>_0x3fe837[_0x3362('0x2b')])return _0x1ed6e3(_0x3362('0x2d'));if(_0x41b4aa>_0x3fe837[_0x3362('0x2c')])return _0x1ed6e3(_0x3362('0x2e'));return _0x3f63df();})[_0x3362('0x28')](function(_0x520403){_0x1ed6e3(_0x520403);});});}module[_0x3362('0x2f')]={'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 70808e0..906a24b 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 _0x84a0=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4a427c,_0x150f76){var _0x2b3da7=function(_0x5296ea){while(--_0x5296ea){_0x4a427c['push'](_0x4a427c['shift']());}};_0x2b3da7(++_0x150f76);}(_0x84a0,0x66));var _0x084a=function(_0x3ce433,_0x328120){_0x3ce433=_0x3ce433-0x0;var _0x474612=_0x84a0[_0x3ce433];return _0x474612;};'use strict';module[_0x084a('0x0')]={'DOMAIN':_0x084a('0x1'),'SESSION_SECRET':_0x084a('0x2'),'GOOGLE_ID':_0x084a('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5c3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x5c3c,0x132));var _0xc5c3=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x5c3c[_0x166d93];return _0xba708;};'use strict';module[_0xc5c3('0x0')]={'DOMAIN':_0xc5c3('0x1'),'SESSION_SECRET':_0xc5c3('0x2'),'GOOGLE_ID':_0xc5c3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 7697a94..e31def8 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8be5=['transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','INFO','join','/var','log','xcally','format','%s-%s.log','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8be5,0xcf));var _0x58be=function(_0x524792,_0x7af1ef){_0x524792=_0x524792-0x0;var _0x2c6aae=_0x8be5[_0x524792];return _0x2c6aae;};'use strict';var moment=require(_0x58be('0x0'));var winston=require(_0x58be('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x58be('0x2');function filename(_0x10463b,_0x4cfa2c){return path[_0x58be('0x3')](_0x58be('0x4'),_0x58be('0x5'),_0x58be('0x6'),util[_0x58be('0x7')](_0x58be('0x8'),_0x10463b,_0x4cfa2c));}function formatter(_0x52d701,_0x1cb804){_0x1cb804['message']=_0x1cb804['message'][_0x58be('0x9')](/@@{/g,_0x58be('0xa'))['replace'](/}@@/g,_0x58be('0xb'))['replace'](/@{/g,'{{')[_0x58be('0x9')](/}@/g,'}}');return util[_0x58be('0x7')](_0x58be('0xc'),moment()[_0x58be('0x7')](_0x58be('0xd')),_0x1cb804['level'][_0x58be('0xe')](),_0x52d701,_0x1cb804[_0x58be('0xf')]);}module[_0x58be('0x10')]=function(_0x1af422){return new winston[(_0x58be('0x11'))]({'transports':[new winston[(_0x58be('0x12'))][(_0x58be('0x13'))]({'name':util[_0x58be('0x7')]('%s-%s',_0x1af422,_0x58be('0x14')),'filename':filename(_0x1af422,_0x58be('0x14')),'level':_0x58be('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1173a9){return formatter(_0x1af422,_0x1173a9);}}),new winston['transports'][(_0x58be('0x13'))]({'name':util[_0x58be('0x7')](_0x58be('0x15'),_0x1af422,_0x58be('0x16')),'filename':filename(_0x1af422,_0x58be('0x16')),'level':_0x58be('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c4592){return formatter(_0x1af422,_0x1c4592);}}),new winston[(_0x58be('0x12'))][(_0x58be('0x17'))]({'level':process['env'][_0x58be('0x18')]||debugLevel,'json':![],'formatter':function(_0x45af6d){return formatter(_0x1af422,_0x45af6d);}})]});}; \ No newline at end of file +var _0x57bc=['File','%s-%s','error','transports','info','debugLevel','moment','winston','util','path','join','/var','log','xcally','format','message','replace','YYYY-MM-DD\x20HH:mm:ss','toUpperCase'];(function(_0x3474c8,_0x433a13){var _0x41b56d=function(_0x44bf3a){while(--_0x44bf3a){_0x3474c8['push'](_0x3474c8['shift']());}};_0x41b56d(++_0x433a13);}(_0x57bc,0x149));var _0xc57b=function(_0x3ca64f,_0x12c379){_0x3ca64f=_0x3ca64f-0x0;var _0x4497ab=_0x57bc[_0x3ca64f];return _0x4497ab;};'use strict';var moment=require(_0xc57b('0x0'));var winston=require(_0xc57b('0x1'));var util=require(_0xc57b('0x2'));var path=require(_0xc57b('0x3'));var debugLevel='INFO';function filename(_0x3693e1,_0x568a61){return path[_0xc57b('0x4')](_0xc57b('0x5'),_0xc57b('0x6'),_0xc57b('0x7'),util[_0xc57b('0x8')]('%s-%s.log',_0x3693e1,_0x568a61));}function formatter(_0xfca073,_0x2bd6f1){_0x2bd6f1['message']=_0x2bd6f1[_0xc57b('0x9')][_0xc57b('0xa')](/@@{/g,'{{{')[_0xc57b('0xa')](/}@@/g,'}}}')[_0xc57b('0xa')](/@{/g,'{{')[_0xc57b('0xa')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xc57b('0x8')](_0xc57b('0xb')),_0x2bd6f1['level'][_0xc57b('0xc')](),_0xfca073,_0x2bd6f1[_0xc57b('0x9')]);}module['exports']=function(_0x1e7557){return new winston['Logger']({'transports':[new winston['transports'][(_0xc57b('0xd'))]({'name':util[_0xc57b('0x8')](_0xc57b('0xe'),_0x1e7557,_0xc57b('0xf')),'filename':filename(_0x1e7557,_0xc57b('0xf')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3c935c){return formatter(_0x1e7557,_0x3c935c);}}),new winston[(_0xc57b('0x10'))][(_0xc57b('0xd'))]({'name':util[_0xc57b('0x8')](_0xc57b('0xe'),_0x1e7557,_0xc57b('0x11')),'filename':filename(_0x1e7557,_0xc57b('0x11')),'level':_0xc57b('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c00f7){return formatter(_0x1e7557,_0x5c00f7);}}),new winston[(_0xc57b('0x10'))]['Console']({'level':process['env'][_0xc57b('0x12')]||debugLevel,'json':![],'formatter':function(_0x4c5251){return formatter(_0x1e7557,_0x4c5251);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 7e837e3..0fa55a3 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 _0x7af7=['express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x18a0d3,_0x145ad8){var _0x5b7e6c=function(_0x21e1f8){while(--_0x21e1f8){_0x18a0d3['push'](_0x18a0d3['shift']());}};_0x5b7e6c(++_0x145ad8);}(_0x7af7,0x114));var _0x77af=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x7af7[_0x39bfb6];return _0x23fef9;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x77af('0x0'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x2'))},{'name':_0x77af('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x77af('0x4'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x5'))},{'name':'email','script':path[_0x77af('0x1')](__dirname,_0x77af('0x6'))},{'name':_0x77af('0x7'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0x8'))},{'name':_0x77af('0x9'),'script':path[_0x77af('0x1')](__dirname,_0x77af('0xa'))}]};module[_0x77af('0xb')]=config; \ No newline at end of file +var _0x23f2=['email','../../services/email/index.js','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','agi'];(function(_0x319fc1,_0x29179b){var _0xb768af=function(_0x3509ac){while(--_0x3509ac){_0x319fc1['push'](_0x319fc1['shift']());}};_0xb768af(++_0x29179b);}(_0x23f2,0x10d));var _0x223f=function(_0xf8105a,_0x18f7e5){_0xf8105a=_0xf8105a-0x0;var _0xc4c74f=_0x23f2[_0xf8105a];return _0xc4c74f;};'use strict';var path=require(_0x223f('0x0'));var os=require('os');var config={'apps':[{'name':_0x223f('0x1'),'script':path[_0x223f('0x2')](__dirname,_0x223f('0x3'))},{'name':_0x223f('0x4'),'script':path[_0x223f('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x223f('0x5'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x223f('0x6'),'script':path['join'](__dirname,_0x223f('0x7'))},{'name':'routing','script':path[_0x223f('0x2')](__dirname,_0x223f('0x8'))},{'name':'xdr','script':path['join'](__dirname,_0x223f('0x9'))}]};module[_0x223f('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1bfc3f4..3509d73 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 _0x539b=['list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','restart'];(function(_0x3f2275,_0x3772e4){var _0x211464=function(_0x1e583b){while(--_0x1e583b){_0x3f2275['push'](_0x3f2275['shift']());}};_0x211464(++_0x3772e4);}(_0x539b,0x17f));var _0xb539=function(_0x391445,_0x32202c){_0x391445=_0x391445-0x0;var _0x226ddf=_0x539b[_0x391445];return _0x226ddf;};'use strict';var pm2=require(_0xb539('0x0'));var BPromise=require(_0xb539('0x1'));var config=require(_0xb539('0x2'));function connect(){return new BPromise(function(_0xfe8bf7,_0x55652c){return pm2[_0xb539('0x3')](function(_0x16082d){if(_0x16082d){return _0x55652c(_0x16082d);}return _0xfe8bf7(_0xb539('0x4'));});});};exports[_0xb539('0x5')]=function(_0x421363){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x167b27,_0x303666){return pm2[_0xb539('0x5')](_0x421363,function(_0x30856a,_0xf0c62){if(_0x30856a){return _0x303666(_0x30856a);}pm2['disconnect']();return _0x167b27(_0xf0c62);});});});};exports['stop']=function(_0x116edb){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x17ac51,_0x377e63){return pm2['stop'](_0x116edb,function(_0x4f4ee9,_0x15c6a7){if(_0x4f4ee9){return _0x377e63(_0x4f4ee9);}pm2[_0xb539('0x7')]();return _0x17ac51(_0x15c6a7);});});});};exports[_0xb539('0x8')]=function(_0x16ad96){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x2ba37c,_0x45b82c){return pm2[_0xb539('0x8')](_0x16ad96,function(_0x141a1e,_0x1c745e){if(_0x141a1e){return _0x45b82c(_0x141a1e);}pm2[_0xb539('0x7')]();return _0x2ba37c(_0x1c745e);});});});};exports[_0xb539('0x9')]=function(){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x2eebc2,_0x47c53d){return pm2['list'](function(_0x5754cd,_0x17957a){if(_0x5754cd){return _0x47c53d(_0x5754cd);}pm2['disconnect']();return _0x2eebc2(_0x17957a);});});});};exports[_0xb539('0xa')]=function(_0x2d0c52){return connect()[_0xb539('0x6')](function(){return new BPromise(function(_0x389903,_0x3bf63e){return pm2[_0xb539('0xa')](_0x2d0c52,function(_0x367ac7,_0x1fd742){if(_0x367ac7){return _0x3bf63e(_0x367ac7);}pm2['disconnect']();return _0x389903(_0x1fd742);});});});};exports[_0xb539('0xb')]=function(_0x4e3542){return connect()['then'](function(){return new BPromise(function(_0xf1046a,_0x3c1426){return pm2[_0xb539('0xb')](_0x4e3542,function(_0x52a185,_0xacadad){if(_0x52a185){return _0x3c1426(_0x52a185);}pm2[_0xb539('0x7')]();return _0xf1046a(_0xacadad);});});});};exports[_0xb539('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3c84c1,_0x3d1fcf){return pm2[_0xb539('0xc')](function(_0x242492){if(_0x242492){return _0x3d1fcf(_0x242492);}return _0x3c84c1(_0xb539('0xd'));});});});}; \ No newline at end of file +var _0x49cd=['describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then','stop','disconnect','restart','list'];(function(_0x6d4142,_0xb1f471){var _0x4ee249=function(_0x38cc16){while(--_0x38cc16){_0x6d4142['push'](_0x6d4142['shift']());}};_0x4ee249(++_0xb1f471);}(_0x49cd,0xf2));var _0xd49c=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x49cd[_0x476c7];return _0x47ae56;};'use strict';var pm2=require(_0xd49c('0x0'));var BPromise=require(_0xd49c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x4c9dbd,_0x26c5e9){return pm2[_0xd49c('0x2')](function(_0x127406){if(_0x127406){return _0x26c5e9(_0x127406);}return _0x4c9dbd(_0xd49c('0x3'));});});};exports[_0xd49c('0x4')]=function(_0x1949cf){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x49c358,_0x2a0949){return pm2[_0xd49c('0x4')](_0x1949cf,function(_0x13a3e9,_0xde773f){if(_0x13a3e9){return _0x2a0949(_0x13a3e9);}pm2['disconnect']();return _0x49c358(_0xde773f);});});});};exports[_0xd49c('0x6')]=function(_0x5763d6){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x530009,_0x27526f){return pm2[_0xd49c('0x6')](_0x5763d6,function(_0x4de3e3,_0x37f780){if(_0x4de3e3){return _0x27526f(_0x4de3e3);}pm2[_0xd49c('0x7')]();return _0x530009(_0x37f780);});});});};exports['restart']=function(_0x3a0a2c){return connect()['then'](function(){return new BPromise(function(_0x37ab70,_0x36f22d){return pm2[_0xd49c('0x8')](_0x3a0a2c,function(_0x1f4ea8,_0x523bc8){if(_0x1f4ea8){return _0x36f22d(_0x1f4ea8);}pm2[_0xd49c('0x7')]();return _0x37ab70(_0x523bc8);});});});};exports[_0xd49c('0x9')]=function(){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x18c4b5,_0x115e15){return pm2[_0xd49c('0x9')](function(_0x55cc2e,_0x55988d){if(_0x55cc2e){return _0x115e15(_0x55cc2e);}pm2[_0xd49c('0x7')]();return _0x18c4b5(_0x55988d);});});});};exports[_0xd49c('0xa')]=function(_0x162341){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x275a39,_0x1b21e8){return pm2[_0xd49c('0xa')](_0x162341,function(_0x5ca28c,_0x1ddb6b){if(_0x5ca28c){return _0x1b21e8(_0x5ca28c);}pm2['disconnect']();return _0x275a39(_0x1ddb6b);});});});};exports[_0xd49c('0xb')]=function(_0x445beb){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x3f6f62,_0x1d1e6a){return pm2['delete'](_0x445beb,function(_0x580194,_0x431915){if(_0x580194){return _0x1d1e6a(_0x580194);}pm2[_0xd49c('0x7')]();return _0x3f6f62(_0x431915);});});});};exports[_0xd49c('0xc')]=function(){return connect()[_0xd49c('0x5')](function(){return new BPromise(function(_0x5043d9,_0xba9f57){return pm2[_0xd49c('0xc')](function(_0x3ea226){if(_0x3ea226){return _0xba9f57(_0x3ea226);}return _0x5043d9(_0xd49c('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 81be051..0508f64 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 _0xbdc1=['../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment'];(function(_0x2f26c0,_0x7b7536){var _0xb7b2b9=function(_0x574f0e){while(--_0x574f0e){_0x2f26c0['push'](_0x2f26c0['shift']());}};_0xb7b2b9(++_0x7b7536);}(_0xbdc1,0x147));var _0x1bdc=function(_0x553f85,_0x4878f4){_0x553f85=_0x553f85-0x0;var _0x51c0a0=_0xbdc1[_0x553f85];return _0x51c0a0;};'use strict';var _=require('lodash');var moment=require(_0x1bdc('0x0'));var Redis=require('ioredis');var util=require(_0x1bdc('0x1'));var config=require(_0x1bdc('0x2'));var db=require(_0x1bdc('0x3'))['db'];var logger=require(_0x1bdc('0x4'))(_0x1bdc('0x5'));config[_0x1bdc('0x6')]=_[_0x1bdc('0x7')](config[_0x1bdc('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1bdc('0x8'))(new Redis(config[_0x1bdc('0x6')]));function closeInteractions(){var _0x522cbb=0x0;var _0x4059eb=[];return db[_0x1bdc('0x9')][_0x1bdc('0xa')]({'raw':!![],'attributes':['id',_0x1bdc('0xb')],'where':{'id':0x1}})[_0x1bdc('0xc')](function(_0xdbcdc3){_0x522cbb=_0xdbcdc3['chatTimeout'];if(_0x522cbb){return db['ChatInteraction'][_0x1bdc('0xd')]({'raw':!![],'attributes':['id',_0x1bdc('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1bdc('0xf')](_0xdbcdc3['chatTimeout'],_0x1bdc('0x10'))}}});}else{return[];}})[_0x1bdc('0xc')](function(_0x22d659){if(_0x22d659&&_0x22d659[_0x1bdc('0x11')]){_0x4059eb=_[_0x1bdc('0x12')](_0x22d659||[],'id');logger[_0x1bdc('0x13')](_0x1bdc('0x14'),_0x4059eb[_0x1bdc('0x15')]());return db[_0x1bdc('0x16')][_0x1bdc('0x17')]({'closeReason':'system','disposition':_0x1bdc('0x18'),'closed':!![],'closedAt':moment()[_0x1bdc('0x19')](_0x1bdc('0x1a'))},{'where':{'id':_0x4059eb}});}})['then'](function(){if(_0x4059eb&&_0x4059eb[_0x1bdc('0x11')]){logger[_0x1bdc('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4059eb[_0x1bdc('0x15')]());for(var _0x586fd6=0x0;_0x586fd6<_0x4059eb[_0x1bdc('0x11')];_0x586fd6++){io[_0x1bdc('0x1b')](_0x1bdc('0x1c'),{'id':_0x4059eb[_0x586fd6],'closed':!![]});}}})[_0x1bdc('0x1d')](function(_0x184356){logger[_0x1bdc('0x1e')](_0x1bdc('0x1f'),_0x184356?util['inspect'](_0x184356,{'showHidden':![],'depth':null}):'');});}exports[_0x1bdc('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfc00=['error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','find','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch'];(function(_0x4c646a,_0x516018){var _0x5132d1=function(_0x39924c){while(--_0x39924c){_0x4c646a['push'](_0x4c646a['shift']());}};_0x5132d1(++_0x516018);}(_0xfc00,0x7f));var _0x0fc0=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xfc00[_0x22e47a];return _0x15a12a;};'use strict';var _=require(_0x0fc0('0x0'));var moment=require(_0x0fc0('0x1'));var Redis=require(_0x0fc0('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x0fc0('0x3'))['db'];var logger=require(_0x0fc0('0x4'))(_0x0fc0('0x5'));config[_0x0fc0('0x6')]=_[_0x0fc0('0x7')](config[_0x0fc0('0x6')],{'host':_0x0fc0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x9ba78b=0x0;var _0x1cf52e=[];return db['Setting'][_0x0fc0('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x76ca68){_0x9ba78b=_0x76ca68['chatTimeout'];if(_0x9ba78b){return db[_0x0fc0('0xa')][_0x0fc0('0xb')]({'raw':!![],'attributes':['id',_0x0fc0('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0fc0('0xd')](_0x76ca68['chatTimeout'],_0x0fc0('0xe'))}}});}else{return[];}})[_0x0fc0('0xf')](function(_0x19704a){if(_0x19704a&&_0x19704a[_0x0fc0('0x10')]){_0x1cf52e=_['map'](_0x19704a||[],'id');logger['info'](_0x0fc0('0x11'),_0x1cf52e[_0x0fc0('0x12')]());return db['ChatInteraction'][_0x0fc0('0x13')]({'closeReason':_0x0fc0('0x14'),'disposition':_0x0fc0('0x15'),'closed':!![],'closedAt':moment()[_0x0fc0('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1cf52e}});}})[_0x0fc0('0xf')](function(){if(_0x1cf52e&&_0x1cf52e[_0x0fc0('0x10')]){logger[_0x0fc0('0x17')](_0x0fc0('0x18'),_0x1cf52e[_0x0fc0('0x12')]());for(var _0x4979fa=0x0;_0x4979fa<_0x1cf52e['length'];_0x4979fa++){io[_0x0fc0('0x19')](_0x0fc0('0x1a'),{'id':_0x1cf52e[_0x4979fa],'closed':!![]});}}})[_0x0fc0('0x1b')](function(_0x187bed){logger[_0x0fc0('0x1c')](_0x0fc0('0x1d'),_0x187bed?util[_0x0fc0('0x1e')](_0x187bed,{'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/index.js b/server/config/schedule/index.js index 12c5dc3..5526c38 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 _0x97f4=['MailServerOut','jobs','difference','intersection','toString','exists','deleteJob','delete\x20cron','toRun','index','run\x20job','cron','active','isBetween','endAt','start','add\x20cron','stop','stop\x20cron','startAt','run','util','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','stringify','email\x20sent','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97f4,0x69));var _0x497f=function(_0x371d95,_0x125510){_0x371d95=_0x371d95-0x0;var _0x5d56b8=_0x97f4[_0x371d95];return _0x5d56b8;};'use strict';var fs=require('fs');var util=require(_0x497f('0x0'));var path=require('path');var _=require(_0x497f('0x1'));var moment=require('moment');var CronJobManager=require(_0x497f('0x2'));var jayson=require(_0x497f('0x3'));var BPromise=require('bluebird');var logger=require(_0x497f('0x4'))(_0x497f('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x497f('0x6'));var analyticDefaultReportController=require(_0x497f('0x7'));var client=jayson[_0x497f('0x8')][_0x497f('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x31cbd7,_0x16e2be){return function(){logger[_0x497f('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x31cbd7[_0x497f('0xb')]);var _0x27dd38=!![];var _0x2bd38c={'tls':{'rejectUnauthorized':![]}};if(_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0xe')]){_0x2bd38c[_0x497f('0xe')]=_0x31cbd7[_0x497f('0xc')]['Smtp'][_0x497f('0xe')];}else{_0x2bd38c['host']=_0x31cbd7[_0x497f('0xc')]['Smtp'][_0x497f('0xf')];_0x2bd38c[_0x497f('0x10')]=_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x10')];_0x2bd38c[_0x497f('0x11')]=_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x11')];}if(_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x12')]){_0x2bd38c[_0x497f('0x13')]={'user':_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')]['user'],'pass':_0x31cbd7[_0x497f('0xc')][_0x497f('0xd')][_0x497f('0x14')]};}var _0x1dc2f6={'account':_0x2bd38c,'message':{'from':util[_0x497f('0x15')](_0x497f('0x16'),_0x31cbd7['MailAccount']['name'],_0x31cbd7[_0x497f('0xc')][_0x497f('0xb')]||_0x31cbd7['MailAccount'][_0x497f('0xd')][_0x497f('0x17')]),'to':_0x31cbd7[_0x497f('0xb')],'cc':_0x31cbd7['cc'],'bcc':_0x31cbd7[_0x497f('0x18')],'subject':util[_0x497f('0x15')](_0x497f('0x19'),_0x16e2be[_0x497f('0x1a')],_0x31cbd7[_0x497f('0x1b')],_0x31cbd7[_0x497f('0x1c')])}};var _0x5ba194=path[_0x497f('0x1d')](__dirname,_0x497f('0x1e'));var _0x3f532b=_0x16e2be[_0x497f('0x1f')];var _0x114dd1=util[_0x497f('0x15')](_0x497f('0x20'),path['basename'](_0x16e2be[_0x497f('0x1f')],path[_0x497f('0x21')](_0x16e2be[_0x497f('0x1f')])),_0x497f('0x22'));var _0x57dc68=path[_0x497f('0x1d')](_0x5ba194,_0x3f532b);var _0xf9cb7e=path[_0x497f('0x1d')](_0x5ba194,_0x114dd1);if(fs[_0x497f('0x23')](_0x57dc68)){_0x16e2be[_0x497f('0x24')]='Sent';_0x1dc2f6[_0x497f('0x25')][_0x497f('0x26')]=[{'filename':_0x3f532b,'path':_0x57dc68}];_0x1dc2f6['message']['text']=util['format'](_0x497f('0x27'),JSON['stringify'](_0x16e2be,null,0x2));}else if(fs[_0x497f('0x23')](_0xf9cb7e)){_0x16e2be[_0x497f('0x24')]='Sent';_0x1dc2f6[_0x497f('0x25')][_0x497f('0x26')]=[{'filename':_0x114dd1,'path':_0xf9cb7e}];}else{_0x1dc2f6[_0x497f('0x25')]['text']=_0x497f('0x28');if(!_0x31cbd7[_0x497f('0x29')]){_0x27dd38=![];logger['info'](_0x497f('0x2a'));}}if(_0x27dd38){return client['request'](_0x497f('0x2b'),_0x1dc2f6)[_0x497f('0x2c')](function(_0x4b240a){if(_0x4b240a[_0x497f('0x2d')]){return logger[_0x497f('0x2d')]('error\x20mail',JSON[_0x497f('0x2e')](_0x4b240a));}return logger['info'](_0x497f('0x2f'));})[_0x497f('0x30')](function(_0x68b658){return logger[_0x497f('0x2d')](_0x497f('0x31'),JSON[_0x497f('0x2e')](_0x68b658));});}};}function handleError(){return function(_0x4b23a6){return logger[_0x497f('0x2d')](JSON['stringify'](_0x4b23a6));};}function handleResult(_0x5596d4){return function(_0x12502f){logger[_0x497f('0xa')](_0x497f('0x32'),JSON[_0x497f('0x2e')](_0x12502f));if(_0x5596d4[_0x497f('0xc')]&&_0x5596d4[_0x497f('0xc')][_0x497f('0xd')]&&!_[_0x497f('0x33')](_0x5596d4[_0x497f('0xb')])){setTimeout(handleSendEmail(_0x5596d4,_0x12502f),0x3c*0x3e8);}};}function handleJob(_0xaf142){return function(){try{if(_[_0x497f('0x33')](_0xaf142[_0x497f('0x1b')])){return logger[_0x497f('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0xaf142['subtractUnit'])){return logger['info'](_0x497f('0x34'));}var _0x3c5e13={'startDate':moment()[_0x497f('0x35')](_0xaf142[_0x497f('0x1b')],_0xaf142['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x497f('0x36')),'type':_0x497f('0x37'),'output':_0xaf142[_0x497f('0x38')],'name':_0xaf142['name']};if(!_[_0x497f('0x33')](_0xaf142[_0x497f('0x39')])){logger[_0x497f('0xa')]('exec\x20defaul\x20report\x20id:%s',_0xaf142[_0x497f('0x39')]);return analyticDefaultReportController[_0x497f('0x3a')]({'id':_0xaf142['DefaultReportId']},_0x3c5e13)['then'](handleResult(_0xaf142))[_0x497f('0x30')](handleError());}if(!_[_0x497f('0x33')](_0xaf142[_0x497f('0x3b')])){logger[_0x497f('0xa')]('exec\x20custom\x20report\x20id:%s',_0xaf142['CustomReportId']);return analyticCustomReportController[_0x497f('0x3a')]({'id':_0xaf142['CustomReportId']},_0x3c5e13)[_0x497f('0x2c')](handleResult(_0xaf142))['catch'](handleError());}}catch(_0x4b18e9){logger[_0x497f('0x2d')](JSON[_0x497f('0x2e')](_0x4b18e9));}return logger[_0x497f('0xa')](_0x497f('0x3c'));};}function getJobs(_0x26bb04){var _0x4931b9={};if(_0x26bb04){_0x4931b9['id']=_0x26bb04;}return db[_0x497f('0x3d')][_0x497f('0x3e')]({'where':_0x4931b9,'include':[{'model':db[_0x497f('0xc')],'attributes':['id','name',_0x497f('0xb')],'include':[{'model':db[_0x497f('0x3f')],'as':_0x497f('0xd')}]}]})[_0x497f('0x2c')](function(_0xae8e3c){var _0x59a034=_['keys'](manager[_0x497f('0x40')]);var _0x4fe108=_['map'](_0xae8e3c,function(_0x16ae50){return _0x16ae50['id']['toString']();});var _0x1d1845=_['keyBy'](_0xae8e3c,function(_0x447610){return _0x447610['id']['toString']();});var _0x24caaa=_0x26bb04?_0x4fe108:_[_0x497f('0x41')](_0x4fe108,_0x59a034);var _0x10d28e=_[_0x497f('0x42')](_0x4fe108,_0x59a034);var _0x27172f=_[_0x497f('0x41')](_0x59a034,_0x4fe108);var _0x244b94;var _0x4d69c3;for(_0x244b94=0x0;_0x244b94<_0x27172f['length']&&!_0x26bb04;_0x244b94+=0x1){_0x4d69c3=_0x27172f[_0x244b94][_0x497f('0x43')]();if(manager[_0x497f('0x44')](_0x4d69c3)){manager['stop'](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger['info'](_0x497f('0x46'),_0x4d69c3);}}logger[_0x497f('0xa')](_0x497f('0x47'),JSON[_0x497f('0x2e')](_0x24caaa));for(_0x244b94=0x0;_0x244b94<_0x24caaa['length'];_0x244b94+=0x1){_0x4d69c3=_0x24caaa[_0x244b94]['toString']();logger[_0x497f('0xa')](_0x497f('0x48'),_0x4d69c3);if(_0x26bb04){logger[_0x497f('0xa')]('my\x20id',_0x26bb04);logger[_0x497f('0xa')](JSON[_0x497f('0x2e')](_0x1d1845[_0x4d69c3]));BPromise['resolve']()[_0x497f('0x2c')](handleJob(_0x1d1845[_0x4d69c3]));logger[_0x497f('0xa')](_0x497f('0x49'),_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}else if(_0x1d1845[_0x4d69c3][_0x497f('0x4a')]&&_0x1d1845[_0x4d69c3][_0x497f('0x4b')]&&moment()[_0x497f('0x4c')](_0x1d1845[_0x4d69c3]['startAt'],_0x1d1845[_0x4d69c3][_0x497f('0x4d')])){manager['add'](_0x4d69c3,_0x1d1845[_0x4d69c3][_0x497f('0x4a')],handleJob(_0x1d1845[_0x4d69c3]));manager[_0x497f('0x4e')](_0x4d69c3);logger[_0x497f('0xa')](_0x497f('0x4f'),_0x1d1845[_0x4d69c3]['name'],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}else if(manager[_0x497f('0x44')](_0x4d69c3)){manager[_0x497f('0x50')](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger[_0x497f('0xa')](_0x497f('0x51'),_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}}for(_0x244b94=0x0,_0x4d69c3;_0x244b94<_0x10d28e['length']&&!_0x26bb04;_0x244b94+=0x1){_0x4d69c3=_0x10d28e[_0x244b94][_0x497f('0x43')]();if(manager[_0x497f('0x44')](_0x4d69c3)){if(_0x1d1845[_0x4d69c3]['cron']&&_0x1d1845[_0x4d69c3][_0x497f('0x4b')]&&moment()['isBetween'](_0x1d1845[_0x4d69c3][_0x497f('0x52')],_0x1d1845[_0x4d69c3][_0x497f('0x4d')])){manager['update'](_0x4d69c3,_0x1d1845[_0x4d69c3][_0x497f('0x4a')],handleJob(_0x1d1845[_0x4d69c3]));logger[_0x497f('0xa')]('update\x20cron',_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3]['cron']);}else{manager[_0x497f('0x50')](_0x4d69c3);manager[_0x497f('0x45')](_0x4d69c3);logger[_0x497f('0xa')]('stop\x20cron',_0x1d1845[_0x4d69c3][_0x497f('0x1a')],_0x1d1845[_0x4d69c3][_0x497f('0x4a')]);}}}})[_0x497f('0x30')](function(_0x238407){logger[_0x497f('0x2d')](JSON[_0x497f('0x2e')](_0x238407));});}exports[_0x497f('0x53')]=function(_0xe42d1a){return getJobs(_0xe42d1a);};exports[_0x497f('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xecd5=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','MailServerOut','keys','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','update\x20cron','run','util','lodash','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','%s.%s','savename','extname','zip','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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x24840e,_0x590433){var _0xae5259=function(_0x142cca){while(--_0x142cca){_0x24840e['push'](_0x24840e['shift']());}};_0xae5259(++_0x590433);}(_0xecd5,0x89));var _0x5ecd=function(_0x446970,_0x19b567){_0x446970=_0x446970-0x0;var _0x25aec7=_0xecd5[_0x446970];return _0x25aec7;};'use strict';var fs=require('fs');var util=require(_0x5ecd('0x0'));var path=require('path');var _=require(_0x5ecd('0x1'));var moment=require(_0x5ecd('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x5ecd('0x3'));var BPromise=require(_0x5ecd('0x4'));var logger=require(_0x5ecd('0x5'))('schedule');var db=require(_0x5ecd('0x6'))['db'];var analyticCustomReportController=require(_0x5ecd('0x7'));var analyticDefaultReportController=require(_0x5ecd('0x8'));var client=jayson[_0x5ecd('0x9')][_0x5ecd('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2879b6,_0xf97dbe){return function(){logger[_0x5ecd('0xb')](_0x5ecd('0xc'),_0x2879b6['email']);var _0xc1c6b2=!![];var _0x4f068b={'tls':{'rejectUnauthorized':![]}};if(_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')][_0x5ecd('0xf')]){_0x4f068b[_0x5ecd('0xf')]=_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')][_0x5ecd('0xf')];}else{_0x4f068b[_0x5ecd('0x10')]=_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')][_0x5ecd('0x10')];_0x4f068b[_0x5ecd('0x11')]=_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')]['port'];_0x4f068b[_0x5ecd('0x12')]=_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')]['secure'];}if(_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')][_0x5ecd('0x13')]){_0x4f068b[_0x5ecd('0x14')]={'user':_0x2879b6[_0x5ecd('0xd')]['Smtp']['user'],'pass':_0x2879b6['MailAccount'][_0x5ecd('0xe')][_0x5ecd('0x15')]};}var _0x16b3fd={'account':_0x4f068b,'message':{'from':util[_0x5ecd('0x16')]('\x22%s\x22\x20<%s>',_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0x17')],_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0x18')]||_0x2879b6[_0x5ecd('0xd')][_0x5ecd('0xe')]['user']),'to':_0x2879b6[_0x5ecd('0x18')],'cc':_0x2879b6['cc'],'bcc':_0x2879b6[_0x5ecd('0x19')],'subject':util[_0x5ecd('0x16')](_0x5ecd('0x1a'),_0xf97dbe['name'],_0x2879b6[_0x5ecd('0x1b')],_0x2879b6['subtractUnit'])}};var _0x3e59c9=path[_0x5ecd('0x1c')](__dirname,_0x5ecd('0x1d'));var _0x6f2dc4=_0xf97dbe['savename'];var _0x441b51=util['format'](_0x5ecd('0x1e'),path['basename'](_0xf97dbe[_0x5ecd('0x1f')],path[_0x5ecd('0x20')](_0xf97dbe[_0x5ecd('0x1f')])),_0x5ecd('0x21'));var _0x3b1a4c=path[_0x5ecd('0x1c')](_0x3e59c9,_0x6f2dc4);var _0x1baac4=path['join'](_0x3e59c9,_0x441b51);if(fs['existsSync'](_0x3b1a4c)){_0xf97dbe[_0x5ecd('0x22')]=_0x5ecd('0x23');_0x16b3fd[_0x5ecd('0x24')][_0x5ecd('0x25')]=[{'filename':_0x6f2dc4,'path':_0x3b1a4c}];_0x16b3fd[_0x5ecd('0x24')][_0x5ecd('0x26')]=util['format'](_0x5ecd('0x27'),JSON[_0x5ecd('0x28')](_0xf97dbe,null,0x2));}else if(fs[_0x5ecd('0x29')](_0x1baac4)){_0xf97dbe[_0x5ecd('0x22')]=_0x5ecd('0x23');_0x16b3fd[_0x5ecd('0x24')][_0x5ecd('0x25')]=[{'filename':_0x441b51,'path':_0x1baac4}];}else{_0x16b3fd[_0x5ecd('0x24')][_0x5ecd('0x26')]=_0x5ecd('0x2a');if(!_0x2879b6[_0x5ecd('0x2b')]){_0xc1c6b2=![];logger[_0x5ecd('0xb')](_0x5ecd('0x2c'));}}if(_0xc1c6b2){return client[_0x5ecd('0x2d')](_0x5ecd('0x2e'),_0x16b3fd)[_0x5ecd('0x2f')](function(_0x55fcbd){if(_0x55fcbd['error']){return logger[_0x5ecd('0x30')](_0x5ecd('0x31'),JSON[_0x5ecd('0x28')](_0x55fcbd));}return logger['info']('email\x20sent');})['catch'](function(_0x6c4b88){return logger['error'](_0x5ecd('0x31'),JSON['stringify'](_0x6c4b88));});}};}function handleError(){return function(_0x3a308f){return logger[_0x5ecd('0x30')](JSON[_0x5ecd('0x28')](_0x3a308f));};}function handleResult(_0x22e20c){return function(_0x3b3e13){logger['info'](_0x5ecd('0x32'),JSON[_0x5ecd('0x28')](_0x3b3e13));if(_0x22e20c[_0x5ecd('0xd')]&&_0x22e20c[_0x5ecd('0xd')][_0x5ecd('0xe')]&&!_[_0x5ecd('0x33')](_0x22e20c['email'])){setTimeout(handleSendEmail(_0x22e20c,_0x3b3e13),0x3c*0x3e8);}};}function handleJob(_0x5ed0c6){return function(){try{if(_[_0x5ecd('0x33')](_0x5ed0c6[_0x5ecd('0x1b')])){return logger[_0x5ecd('0xb')](_0x5ecd('0x34'));}if(_[_0x5ecd('0x33')](_0x5ed0c6[_0x5ecd('0x35')])){return logger[_0x5ecd('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x13683c={'startDate':moment()[_0x5ecd('0x36')](_0x5ed0c6['subtractNumber'],_0x5ed0c6['subtractUnit'])[_0x5ecd('0x16')](_0x5ecd('0x37')),'endDate':moment()['format'](_0x5ecd('0x37')),'type':_0x5ecd('0x38'),'output':_0x5ed0c6[_0x5ecd('0x39')],'name':_0x5ed0c6[_0x5ecd('0x17')]};if(!_['isNil'](_0x5ed0c6[_0x5ecd('0x3a')])){logger[_0x5ecd('0xb')](_0x5ecd('0x3b'),_0x5ed0c6[_0x5ecd('0x3a')]);return analyticDefaultReportController[_0x5ecd('0x3c')]({'id':_0x5ed0c6['DefaultReportId']},_0x13683c)[_0x5ecd('0x2f')](handleResult(_0x5ed0c6))[_0x5ecd('0x3d')](handleError());}if(!_['isNil'](_0x5ed0c6['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x5ed0c6['CustomReportId']);return analyticCustomReportController[_0x5ecd('0x3c')]({'id':_0x5ed0c6[_0x5ecd('0x3e')]},_0x13683c)[_0x5ecd('0x2f')](handleResult(_0x5ed0c6))[_0x5ecd('0x3d')](handleError());}}catch(_0x3362ea){logger[_0x5ecd('0x30')](JSON[_0x5ecd('0x28')](_0x3362ea));}return logger[_0x5ecd('0xb')](_0x5ecd('0x3f'));};}function getJobs(_0x74a2f){var _0xfd8f07={};if(_0x74a2f){_0xfd8f07['id']=_0x74a2f;}return db['Schedule']['findAll']({'where':_0xfd8f07,'include':[{'model':db[_0x5ecd('0xd')],'attributes':['id',_0x5ecd('0x17'),_0x5ecd('0x18')],'include':[{'model':db[_0x5ecd('0x40')],'as':_0x5ecd('0xe')}]}]})[_0x5ecd('0x2f')](function(_0x1352b7){var _0x403c23=_[_0x5ecd('0x41')](manager['jobs']);var _0x58ec29=_[_0x5ecd('0x42')](_0x1352b7,function(_0x1bffb8){return _0x1bffb8['id'][_0x5ecd('0x43')]();});var _0xbd58a2=_[_0x5ecd('0x44')](_0x1352b7,function(_0x141633){return _0x141633['id'][_0x5ecd('0x43')]();});var _0x3609e7=_0x74a2f?_0x58ec29:_[_0x5ecd('0x45')](_0x58ec29,_0x403c23);var _0x4423da=_[_0x5ecd('0x46')](_0x58ec29,_0x403c23);var _0x4c6d65=_[_0x5ecd('0x45')](_0x403c23,_0x58ec29);var _0x5d2e37;var _0x503804;for(_0x5d2e37=0x0;_0x5d2e37<_0x4c6d65['length']&&!_0x74a2f;_0x5d2e37+=0x1){_0x503804=_0x4c6d65[_0x5d2e37]['toString']();if(manager[_0x5ecd('0x47')](_0x503804)){manager[_0x5ecd('0x48')](_0x503804);manager[_0x5ecd('0x49')](_0x503804);logger[_0x5ecd('0xb')](_0x5ecd('0x4a'),_0x503804);}}logger[_0x5ecd('0xb')]('toRun',JSON[_0x5ecd('0x28')](_0x3609e7));for(_0x5d2e37=0x0;_0x5d2e37<_0x3609e7[_0x5ecd('0x4b')];_0x5d2e37+=0x1){_0x503804=_0x3609e7[_0x5d2e37]['toString']();logger[_0x5ecd('0xb')](_0x5ecd('0x4c'),_0x503804);if(_0x74a2f){logger[_0x5ecd('0xb')](_0x5ecd('0x4d'),_0x74a2f);logger['info'](JSON[_0x5ecd('0x28')](_0xbd58a2[_0x503804]));BPromise[_0x5ecd('0x4e')]()[_0x5ecd('0x2f')](handleJob(_0xbd58a2[_0x503804]));logger[_0x5ecd('0xb')](_0x5ecd('0x4f'),_0xbd58a2[_0x503804]['name'],_0xbd58a2[_0x503804][_0x5ecd('0x50')]);}else if(_0xbd58a2[_0x503804]['cron']&&_0xbd58a2[_0x503804][_0x5ecd('0x51')]&&moment()[_0x5ecd('0x52')](_0xbd58a2[_0x503804][_0x5ecd('0x53')],_0xbd58a2[_0x503804][_0x5ecd('0x54')])){manager[_0x5ecd('0x55')](_0x503804,_0xbd58a2[_0x503804][_0x5ecd('0x50')],handleJob(_0xbd58a2[_0x503804]));manager[_0x5ecd('0x56')](_0x503804);logger[_0x5ecd('0xb')]('add\x20cron',_0xbd58a2[_0x503804]['name'],_0xbd58a2[_0x503804][_0x5ecd('0x50')]);}else if(manager['exists'](_0x503804)){manager[_0x5ecd('0x48')](_0x503804);manager[_0x5ecd('0x49')](_0x503804);logger[_0x5ecd('0xb')](_0x5ecd('0x57'),_0xbd58a2[_0x503804][_0x5ecd('0x17')],_0xbd58a2[_0x503804][_0x5ecd('0x50')]);}}for(_0x5d2e37=0x0,_0x503804;_0x5d2e37<_0x4423da[_0x5ecd('0x4b')]&&!_0x74a2f;_0x5d2e37+=0x1){_0x503804=_0x4423da[_0x5d2e37][_0x5ecd('0x43')]();if(manager[_0x5ecd('0x47')](_0x503804)){if(_0xbd58a2[_0x503804][_0x5ecd('0x50')]&&_0xbd58a2[_0x503804][_0x5ecd('0x51')]&&moment()[_0x5ecd('0x52')](_0xbd58a2[_0x503804][_0x5ecd('0x53')],_0xbd58a2[_0x503804][_0x5ecd('0x54')])){manager['update'](_0x503804,_0xbd58a2[_0x503804][_0x5ecd('0x50')],handleJob(_0xbd58a2[_0x503804]));logger['info'](_0x5ecd('0x58'),_0xbd58a2[_0x503804]['name'],_0xbd58a2[_0x503804]['cron']);}else{manager[_0x5ecd('0x48')](_0x503804);manager[_0x5ecd('0x49')](_0x503804);logger[_0x5ecd('0xb')](_0x5ecd('0x57'),_0xbd58a2[_0x503804][_0x5ecd('0x17')],_0xbd58a2[_0x503804][_0x5ecd('0x50')]);}}}})[_0x5ecd('0x3d')](function(_0xfebecc){logger[_0x5ecd('0x30')](JSON[_0x5ecd('0x28')](_0xfebecc));});}exports[_0x5ecd('0x59')]=function(_0x1220a9){return getJobs(_0x1220a9);};exports[_0x5ecd('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 095485b..3ccc6f1 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 _0x5d86=['COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','resolve','language','Cloud\x20Provider\x20not\x20available','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','aws-sdk','bluebird','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus'];(function(_0x4bce0d,_0x44999b){var _0x40d0aa=function(_0x1be96e){while(--_0x1be96e){_0x4bce0d['push'](_0x4bce0d['shift']());}};_0x40d0aa(++_0x44999b);}(_0x5d86,0x76));var _0x65d8=function(_0x24b283,_0x510549){_0x24b283=_0x24b283-0x0;var _0x23d8a1=_0x5d86[_0x24b283];return _0x23d8a1;};var _=require(_0x65d8('0x0'));var AWS=require(_0x65d8('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x65d8('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x65d8('0x3'))(_0x65d8('0x4'));function getTranscriptionJob(_0x480244,_0x275f44,_0x5c4bb3,_0x8aeb53){return new Promise(function(_0x50c922,_0x1581a6){var _0x19ab88=new AWS['TranscribeService']({'accessKeyId':_0x275f44,'secretAccessKey':_0x480244,'region':_0x5c4bb3});_0x19ab88[_0x65d8('0x5')]({'TranscriptionJobName':_0x8aeb53},function(_0x2f6a2c,_0x2aa9eb){if(_0x2f6a2c){return _0x1581a6(_0x2f6a2c);}else{return _0x50c922(_0x2aa9eb);}});});}function sentiment(_0x254224,_0x44554f,_0x1a7e2e,_0x31894f,_0x57a45a){return new Promise(function(_0x4acdf2,_0x59cbcc){var _0x36d519=new AWS[(_0x65d8('0x6'))]({'accessKeyId':_0x44554f,'secretAccessKey':_0x254224,'region':_0x1a7e2e});_0x36d519[_0x65d8('0x7')]({'Text':_0x31894f,'LanguageCode':_0x57a45a[_0x65d8('0x8')](0x0,0x2)},function(_0x2545c3,_0x414dcc){if(_0x2545c3){return _0x59cbcc(_0x2545c3);}else{return _0x4acdf2(_0x414dcc);}});});}function checkTranscribeJob(_0xa80464,_0x32c2ee,_0x5430c9){var _0x2a7c1c;return new BPromise(function(_0x1b46ff,_0x19b7d8){logger[_0x65d8('0x9')](util['format'](_0x65d8('0xa'),_0xa80464['id'],_0xa80464[_0x65d8('0xb')]));return getTranscriptionJob(_0x5430c9[_0x65d8('0xc')],_0x5430c9[_0x65d8('0xd')],_0x32c2ee[_0x65d8('0xe')],_0xa80464[_0x65d8('0xb')])[_0x65d8('0xf')](function(_0x374e10){logger['info'](util[_0x65d8('0x10')](_0x65d8('0x11'),_0xa80464['id'],_0xa80464[_0x65d8('0xb')],_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')]));if(!_0xa80464['fileText']){switch(_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')]){case _0x65d8('0x14'):var _0x3177ed={'transcribeStatus':_0x374e10[_0x65d8('0x12')][_0x65d8('0x13')],'fileUri':_0x374e10[_0x65d8('0x12')]['Transcript'][_0x65d8('0x15')]};logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0xa80464['id']));return rp({'uri':_0x374e10[_0x65d8('0x12')][_0x65d8('0x16')][_0x65d8('0x15')],'json':!![]})[_0x65d8('0xf')](function(_0x4dbe5e){logger['info'](util[_0x65d8('0x10')](_0x65d8('0x17'),_0xa80464['id']));if(_0x4dbe5e&&_0x4dbe5e[_0x65d8('0x18')]&&_0x4dbe5e[_0x65d8('0x18')]['transcripts']&&_0x4dbe5e['results'][_0x65d8('0x19')][_0x65d8('0x1a')]){_0x3177ed['fileText']='';for(var _0x1befe4=0x0;_0x1befe4<_0x4dbe5e[_0x65d8('0x18')]['transcripts'][_0x65d8('0x1a')];_0x1befe4++){_0x3177ed[_0x65d8('0x1b')]+=_0x4dbe5e[_0x65d8('0x18')][_0x65d8('0x19')][_0x1befe4][_0x65d8('0x1c')]+'';}}return _0xa80464['update'](_0x3177ed);})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));if(!_0xa80464['tempSentiment']){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x1e'));}if(!_0x32c2ee[_0x65d8('0x1f')]||!_0x32c2ee[_0x65d8('0x20')]||!_0x32c2ee[_0x65d8('0x21')]||!_0x32c2ee['language']||!_0x32c2ee[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x24'));}if(!_0x3177ed[_0x65d8('0x1b')]){throw new Error(_0x65d8('0x25'));}if(_0x32c2ee[_0x65d8('0x20')]===_0x5430c9['id']){return _0x5430c9;}else{return db[_0x65d8('0x26')][_0x65d8('0x27')]({'where':{'id':_settings[_0x65d8('0x20')]}});}})['then'](function(_0x2da083){if(!_0x2da083){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2da083[_0x65d8('0xc')]||!_0x2da083[_0x65d8('0xd')]){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x28'));}_0x2a7c1c=_0x2da083;logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xa80464['id']));return sentiment(_0x2a7c1c['data1'],_0x2a7c1c['data2'],_0x32c2ee[_0x65d8('0x21')],_0x3177ed[_0x65d8('0x1b')],_0x32c2ee['language']);})[_0x65d8('0xf')](function(_0x2ba8da){logger[_0x65d8('0x9')](util['format'](_0x65d8('0x29'),_0xa80464['id']));return _0xa80464[_0x65d8('0x2a')]({'sentiment':_0x2ba8da[_0x65d8('0x2b')],'sPositive':_0x2ba8da[_0x65d8('0x2c')][_0x65d8('0x2d')],'sNegative':_0x2ba8da['SentimentScore'][_0x65d8('0x2e')],'sMixed':_0x2ba8da[_0x65d8('0x2c')]['Mixed'],'sNeutral':_0x2ba8da[_0x65d8('0x2c')][_0x65d8('0x2f')]});})[_0x65d8('0xf')](function(){logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));_0x1b46ff();});case'FAILED':return _0xa80464[_0x65d8('0x2a')]({'transcribeStatus':_0x65d8('0x30'),'failureReason':_0x374e10[_0x65d8('0x12')]['FailureReason']})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xa80464['id']));_0x1b46ff();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0xa80464['id']));break;}}else{return BPromise[_0x65d8('0x31')]()['then'](function(){if(!_0xa80464['tempSentiment']){throw new db[(_0x65d8('0x23'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x32c2ee[_0x65d8('0x1f')]||!_0x32c2ee[_0x65d8('0x20')]||!_0x32c2ee[_0x65d8('0x21')]||!_0x32c2ee[_0x65d8('0x32')]||!_0x32c2ee[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x24'));}if(!_0xa80464[_0x65d8('0x1b')]){throw new Error('Transcript\x20not\x20available');}if(_0x32c2ee['sentimentAccountId']===_0x5430c9['id']){return _0x5430c9;}else{return db['CloudProvider'][_0x65d8('0x27')]({'where':{'id':_settings[_0x65d8('0x20')]}});}})[_0x65d8('0xf')](function(_0x247914){if(!_0x247914){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x33'));}if(!_0x247914[_0x65d8('0xc')]||!_0x247914[_0x65d8('0xd')]){throw new db['Sequelize'][(_0x65d8('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x2a7c1c=_0x247914;logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xa80464['id']));return sentiment(_0x2a7c1c[_0x65d8('0xc')],_0x2a7c1c[_0x65d8('0xd')],_0x32c2ee[_0x65d8('0x21')],_0xa80464[_0x65d8('0x1b')],_0x32c2ee[_0x65d8('0x32')]);})[_0x65d8('0xf')](function(_0x476284){logger['info'](util[_0x65d8('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xa80464['id']));return _0xa80464[_0x65d8('0x2a')]({'sentiment':_0x476284[_0x65d8('0x2b')],'sPositive':_0x476284['SentimentScore'][_0x65d8('0x2d')],'sNegative':_0x476284[_0x65d8('0x2c')]['Negative'],'sMixed':_0x476284[_0x65d8('0x2c')][_0x65d8('0x34')],'sNeutral':_0x476284[_0x65d8('0x2c')][_0x65d8('0x2f')],'transcribeStatus':_0x65d8('0x14')});})[_0x65d8('0xf')](function(){logger[_0x65d8('0x9')](util['format'](_0x65d8('0x35'),_0xa80464['id']));_0x1b46ff();});}})[_0x65d8('0x36')](function(_0xffeff7){if(_0xffeff7){if(!_0xffeff7[_0x65d8('0x37')]||_0xffeff7['name']!==_0x65d8('0x38')){logger[_0x65d8('0x39')](util[_0x65d8('0x10')](_0x65d8('0x3a'),_0xa80464['id']),util['inspect'](_0xffeff7,{'showHidden':![],'depth':null}));}}_0x1b46ff();});});}function checkTranscribe(){var _0xc39253;var _0x2370bb;var _0x451cd3;return db[_0x65d8('0x3b')][_0x65d8('0x3c')]({'where':{'transcribeStatus':_0x65d8('0x3d')}})[_0x65d8('0xf')](function(_0x26ea31){if(!_0x26ea31||!_0x26ea31[_0x65d8('0x1a')]){throw new db['Sequelize'][(_0x65d8('0x1d'))](_0x65d8('0x3e'));}_0xc39253=_0x26ea31;return db['Setting'][_0x65d8('0x27')]({'where':{'id':0x1}});})['then'](function(_0x162d86){if(!_0x162d86){throw new db[(_0x65d8('0x23'))]['ValidationError'](_0x65d8('0x3f'));}_0x2370bb=_0x162d86;if(!_0x2370bb['transcribe']||!_0x2370bb[_0x65d8('0x40')]||!_0x2370bb[_0x65d8('0xe')]||!_0x2370bb[_0x65d8('0x32')]||!_0x2370bb[_0x65d8('0x22')]){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x41'));}return db[_0x65d8('0x26')][_0x65d8('0x27')]({'where':{'id':_0x2370bb[_0x65d8('0x40')]}});})[_0x65d8('0xf')](function(_0x3f5f27){if(!_0x3f5f27){throw new db[(_0x65d8('0x23'))][(_0x65d8('0x1d'))](_0x65d8('0x33'));}if(!_0x3f5f27[_0x65d8('0xc')]||!_0x3f5f27[_0x65d8('0xd')]){throw new db['Sequelize']['ValidationError'](_0x65d8('0x28'));}_0x451cd3=_0x3f5f27;var _0x5c2472=[];_0xc39253[_0x65d8('0x42')](function(_0x3d9c30){_0x5c2472[_0x65d8('0x43')](checkTranscribeJob(_0x3d9c30,_0x2370bb,_0x451cd3));});return BPromise['all'](_0x5c2472);})['catch'](function(_0x7c21cf){if(_0x7c21cf){if(!_0x7c21cf[_0x65d8('0x37')]||_0x7c21cf[_0x65d8('0x37')]!==_0x65d8('0x38')){logger[_0x65d8('0x39')](util['inspect'](_0x7c21cf,{'showHidden':![],'depth':null}));}}});}exports[_0x65d8('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3266=['bucket','Sentiment\x20Analysis\x20not\x20configured','fileText','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Transcript\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','format','transcribeName','data1','data2','transcribeRegion','then','info','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language'];(function(_0x48fb7a,_0x57cafe){var _0x297754=function(_0x4e3156){while(--_0x4e3156){_0x48fb7a['push'](_0x48fb7a['shift']());}};_0x297754(++_0x57cafe);}(_0x3266,0x6a));var _0x6326=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x3266[_0x1bc0ae];return _0x501104;};var _=require(_0x6326('0x0'));var AWS=require(_0x6326('0x1'));var rp=require(_0x6326('0x2'));var util=require(_0x6326('0x3'));var BPromise=require(_0x6326('0x4'));var db=require(_0x6326('0x5'))['db'];var logger=require(_0x6326('0x6'))(_0x6326('0x7'));function getTranscriptionJob(_0x265264,_0x5a6b4d,_0x30b22e,_0x5f38a3){return new Promise(function(_0x25ecd8,_0x44460c){var _0x14208e=new AWS['TranscribeService']({'accessKeyId':_0x5a6b4d,'secretAccessKey':_0x265264,'region':_0x30b22e});_0x14208e[_0x6326('0x8')]({'TranscriptionJobName':_0x5f38a3},function(_0x5730e7,_0x2af571){if(_0x5730e7){return _0x44460c(_0x5730e7);}else{return _0x25ecd8(_0x2af571);}});});}function sentiment(_0x90c0f,_0x249eca,_0x1aee60,_0x37a23d,_0x53c3e1){return new Promise(function(_0x1b45a7,_0x464a36){var _0x3590ab=new AWS[(_0x6326('0x9'))]({'accessKeyId':_0x249eca,'secretAccessKey':_0x90c0f,'region':_0x1aee60});_0x3590ab[_0x6326('0xa')]({'Text':_0x37a23d,'LanguageCode':_0x53c3e1[_0x6326('0xb')](0x0,0x2)},function(_0x1ba67d,_0x77c4e){if(_0x1ba67d){return _0x464a36(_0x1ba67d);}else{return _0x1b45a7(_0x77c4e);}});});}function checkTranscribeJob(_0x40a68a,_0x379358,_0x5c07e1){var _0x5381d0;return new BPromise(function(_0x301f34,_0x136946){logger['info'](util[_0x6326('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x40a68a['id'],_0x40a68a[_0x6326('0xd')]));return getTranscriptionJob(_0x5c07e1[_0x6326('0xe')],_0x5c07e1[_0x6326('0xf')],_0x379358[_0x6326('0x10')],_0x40a68a[_0x6326('0xd')])[_0x6326('0x11')](function(_0x55923a){logger[_0x6326('0x12')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x40a68a['id'],_0x40a68a['transcribeName'],_0x55923a['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x40a68a['fileText']){switch(_0x55923a[_0x6326('0x13')][_0x6326('0x14')]){case _0x6326('0x15'):var _0x556c4e={'transcribeStatus':_0x55923a['TranscriptionJob'][_0x6326('0x14')],'fileUri':_0x55923a[_0x6326('0x13')][_0x6326('0x16')][_0x6326('0x17')]};logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x18'),_0x40a68a['id']));return rp({'uri':_0x55923a['TranscriptionJob'][_0x6326('0x16')]['TranscriptFileUri'],'json':!![]})[_0x6326('0x11')](function(_0x3c6cfa){logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x19'),_0x40a68a['id']));if(_0x3c6cfa&&_0x3c6cfa[_0x6326('0x1a')]&&_0x3c6cfa[_0x6326('0x1a')][_0x6326('0x1b')]&&_0x3c6cfa[_0x6326('0x1a')][_0x6326('0x1b')][_0x6326('0x1c')]){_0x556c4e['fileText']='';for(var _0x72d020=0x0;_0x72d020<_0x3c6cfa[_0x6326('0x1a')]['transcripts']['length'];_0x72d020++){_0x556c4e['fileText']+=_0x3c6cfa[_0x6326('0x1a')]['transcripts'][_0x72d020][_0x6326('0x1d')]+'';}}return _0x40a68a[_0x6326('0x1e')](_0x556c4e);})['then'](function(){logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x1f'),_0x40a68a['id']));if(!_0x40a68a[_0x6326('0x20')]){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))](_0x6326('0x23'));}if(!_0x379358[_0x6326('0x24')]||!_0x379358[_0x6326('0x25')]||!_0x379358[_0x6326('0x26')]||!_0x379358[_0x6326('0x27')]||!_0x379358[_0x6326('0x28')]){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))](_0x6326('0x29'));}if(!_0x556c4e[_0x6326('0x2a')]){throw new Error('Transcript\x20not\x20available');}if(_0x379358[_0x6326('0x25')]===_0x5c07e1['id']){return _0x5c07e1;}else{return db[_0x6326('0x2b')][_0x6326('0x2c')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6326('0x11')](function(_0x4d7807){if(!_0x4d7807){throw new db['Sequelize'][(_0x6326('0x22'))](_0x6326('0x2d'));}if(!_0x4d7807[_0x6326('0xe')]||!_0x4d7807[_0x6326('0xf')]){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))](_0x6326('0x2e'));}_0x5381d0=_0x4d7807;logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x2f'),_0x40a68a['id']));return sentiment(_0x5381d0[_0x6326('0xe')],_0x5381d0[_0x6326('0xf')],_0x379358['sentimentRegion'],_0x556c4e[_0x6326('0x2a')],_0x379358[_0x6326('0x27')]);})['then'](function(_0x1933a2){logger[_0x6326('0x12')](util[_0x6326('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x40a68a['id']));return _0x40a68a[_0x6326('0x1e')]({'sentiment':_0x1933a2['Sentiment'],'sPositive':_0x1933a2['SentimentScore'][_0x6326('0x30')],'sNegative':_0x1933a2[_0x6326('0x31')][_0x6326('0x32')],'sMixed':_0x1933a2['SentimentScore'][_0x6326('0x33')],'sNeutral':_0x1933a2['SentimentScore'][_0x6326('0x34')]});})['then'](function(){logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x1f'),_0x40a68a['id']));_0x301f34();});case _0x6326('0x35'):return _0x40a68a[_0x6326('0x1e')]({'transcribeStatus':_0x6326('0x35'),'failureReason':_0x55923a['TranscriptionJob'][_0x6326('0x36')]})[_0x6326('0x11')](function(){logger['info'](util[_0x6326('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x40a68a['id']));_0x301f34();});default:logger['info'](util[_0x6326('0xc')](_0x6326('0x37'),_0x40a68a['id']));break;}}else{return BPromise[_0x6326('0x38')]()[_0x6326('0x11')](function(){if(!_0x40a68a[_0x6326('0x20')]){throw new db[(_0x6326('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x379358[_0x6326('0x24')]||!_0x379358['sentimentAccountId']||!_0x379358[_0x6326('0x26')]||!_0x379358['language']||!_0x379358[_0x6326('0x28')]){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))](_0x6326('0x29'));}if(!_0x40a68a[_0x6326('0x2a')]){throw new Error(_0x6326('0x39'));}if(_0x379358[_0x6326('0x25')]===_0x5c07e1['id']){return _0x5c07e1;}else{return db[_0x6326('0x2b')][_0x6326('0x2c')]({'where':{'id':_settings[_0x6326('0x25')]}});}})[_0x6326('0x11')](function(_0x5d36b1){if(!_0x5d36b1){throw new db[(_0x6326('0x21'))]['ValidationError'](_0x6326('0x2d'));}if(!_0x5d36b1[_0x6326('0xe')]||!_0x5d36b1[_0x6326('0xf')]){throw new db[(_0x6326('0x21'))]['ValidationError'](_0x6326('0x2e'));}_0x5381d0=_0x5d36b1;logger[_0x6326('0x12')](util['format'](_0x6326('0x2f'),_0x40a68a['id']));return sentiment(_0x5381d0[_0x6326('0xe')],_0x5381d0[_0x6326('0xf')],_0x379358[_0x6326('0x26')],_0x40a68a['fileText'],_0x379358[_0x6326('0x27')]);})[_0x6326('0x11')](function(_0x231e15){logger[_0x6326('0x12')](util[_0x6326('0xc')](_0x6326('0x3a'),_0x40a68a['id']));return _0x40a68a[_0x6326('0x1e')]({'sentiment':_0x231e15['Sentiment'],'sPositive':_0x231e15[_0x6326('0x31')][_0x6326('0x30')],'sNegative':_0x231e15[_0x6326('0x31')][_0x6326('0x32')],'sMixed':_0x231e15['SentimentScore'][_0x6326('0x33')],'sNeutral':_0x231e15['SentimentScore'][_0x6326('0x34')],'transcribeStatus':_0x6326('0x15')});})[_0x6326('0x11')](function(){logger[_0x6326('0x12')](util[_0x6326('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x40a68a['id']));_0x301f34();});}})[_0x6326('0x3b')](function(_0x51995c){if(_0x51995c){if(!_0x51995c['name']||_0x51995c[_0x6326('0x3c')]!==_0x6326('0x3d')){logger['error'](util[_0x6326('0xc')](_0x6326('0x3e'),_0x40a68a['id']),util[_0x6326('0x3f')](_0x51995c,{'showHidden':![],'depth':null}));}}_0x301f34();});});}function checkTranscribe(){var _0x27e458;var _0x3a3907;var _0x4f8dc0;return db['VoiceRecording'][_0x6326('0x40')]({'where':{'transcribeStatus':_0x6326('0x41')}})[_0x6326('0x11')](function(_0x21d034){if(!_0x21d034||!_0x21d034[_0x6326('0x1c')]){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))]('No\x20transcribe\x20job\x20to\x20check');}_0x27e458=_0x21d034;return db[_0x6326('0x42')][_0x6326('0x2c')]({'where':{'id':0x1}});})[_0x6326('0x11')](function(_0x3e7674){if(!_0x3e7674){throw new db[(_0x6326('0x21'))]['ValidationError'](_0x6326('0x43'));}_0x3a3907=_0x3e7674;if(!_0x3a3907['transcribe']||!_0x3a3907[_0x6326('0x44')]||!_0x3a3907[_0x6326('0x10')]||!_0x3a3907['language']||!_0x3a3907[_0x6326('0x28')]){throw new db['Sequelize'][(_0x6326('0x22'))](_0x6326('0x45'));}return db[_0x6326('0x2b')][_0x6326('0x2c')]({'where':{'id':_0x3a3907['transcribeAccountId']}});})[_0x6326('0x11')](function(_0xbe6b3e){if(!_0xbe6b3e){throw new db['Sequelize'][(_0x6326('0x22'))](_0x6326('0x2d'));}if(!_0xbe6b3e[_0x6326('0xe')]||!_0xbe6b3e['data2']){throw new db[(_0x6326('0x21'))][(_0x6326('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x4f8dc0=_0xbe6b3e;var _0x16e606=[];_0x27e458['forEach'](function(_0x1f1463){_0x16e606[_0x6326('0x46')](checkTranscribeJob(_0x1f1463,_0x3a3907,_0x4f8dc0));});return BPromise[_0x6326('0x47')](_0x16e606);})[_0x6326('0x3b')](function(_0x13022f){if(_0x13022f){if(!_0x13022f[_0x6326('0x3c')]||_0x13022f[_0x6326('0x3c')]!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x13022f,{'showHidden':![],'depth':null}));}}});}exports[_0x6326('0x48')]=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 c9a1f0e..f735579 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 _0x5001=['moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','findAll','lastMsgAt','hours','length','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update'];(function(_0x4130e8,_0x300f22){var _0x2c3426=function(_0x15e730){while(--_0x15e730){_0x4130e8['push'](_0x4130e8['shift']());}};_0x2c3426(++_0x300f22);}(_0x5001,0xd0));var _0x1500=function(_0x159b19,_0x34a5a2){_0x159b19=_0x159b19-0x0;var _0x1184d8=_0x5001[_0x159b19];return _0x1184d8;};'use strict';var _=require('lodash');var moment=require(_0x1500('0x0'));var Redis=require(_0x1500('0x1'));var util=require(_0x1500('0x2'));var config=require(_0x1500('0x3'));var db=require(_0x1500('0x4'))['db'];var logger=require(_0x1500('0x5'))(_0x1500('0x6'));config[_0x1500('0x7')]=_['defaults'](config[_0x1500('0x7')],{'host':_0x1500('0x8'),'port':0x18eb});var io=require(_0x1500('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x717a83=[];return db['WhatsappInteraction'][_0x1500('0xa')]({'raw':!![],'attributes':['id',_0x1500('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x1500('0xc'))}}})['then'](function(_0x5e258b){if(_0x5e258b&&_0x5e258b[_0x1500('0xd')]){_0x717a83=_['map'](_0x5e258b||[],'id');logger['info'](_0x1500('0xe'),_0x717a83['join']());return db[_0x1500('0xf')][_0x1500('0x10')]({'closeReason':_0x1500('0x11'),'disposition':_0x1500('0x12'),'closed':!![],'closedAt':moment()['format'](_0x1500('0x13'))},{'where':{'id':_0x717a83}});}})[_0x1500('0x14')](function(){if(_0x717a83&&_0x717a83[_0x1500('0xd')]){logger[_0x1500('0x15')](_0x1500('0x16'),_0x717a83[_0x1500('0x17')]());for(var _0xb65e3a=0x0;_0xb65e3a<_0x717a83[_0x1500('0xd')];_0xb65e3a++){io[_0x1500('0x18')](_0x1500('0x19'),{'id':_0x717a83[_0xb65e3a],'closed':!![]});}}})['catch'](function(_0x5ea827){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5ea827?util['inspect'](_0x5ea827,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6b1e=['whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','util','../../config/environment','../../mysqldb','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x1211ca,_0x5c51c4){var _0xe206ad=function(_0x55e619){while(--_0x55e619){_0x1211ca['push'](_0x1211ca['shift']());}};_0xe206ad(++_0x5c51c4);}(_0x6b1e,0x9a));var _0xe6b1=function(_0x4e8643,_0x11dfed){_0x4e8643=_0x4e8643-0x0;var _0x172358=_0x6b1e[_0x4e8643];return _0x172358;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xe6b1('0x0'));var config=require(_0xe6b1('0x1'));var db=require(_0xe6b1('0x2'))['db'];var logger=require('../logger')(_0xe6b1('0x3'));config[_0xe6b1('0x4')]=_['defaults'](config[_0xe6b1('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe6b1('0x5'))(new Redis(config[_0xe6b1('0x4')]));function closeInteractions(){var _0x9beb61=[];return db[_0xe6b1('0x6')][_0xe6b1('0x7')]({'raw':!![],'attributes':['id',_0xe6b1('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe6b1('0x9')](0x18,'hours')}}})[_0xe6b1('0xa')](function(_0xc74810){if(_0xc74810&&_0xc74810[_0xe6b1('0xb')]){_0x9beb61=_[_0xe6b1('0xc')](_0xc74810||[],'id');logger['info'](_0xe6b1('0xd'),_0x9beb61[_0xe6b1('0xe')]());return db['WhatsappInteraction'][_0xe6b1('0xf')]({'closeReason':_0xe6b1('0x10'),'disposition':_0xe6b1('0x11'),'closed':!![],'closedAt':moment()['format'](_0xe6b1('0x12'))},{'where':{'id':_0x9beb61}});}})[_0xe6b1('0xa')](function(){if(_0x9beb61&&_0x9beb61[_0xe6b1('0xb')]){logger['info'](_0xe6b1('0x13'),_0x9beb61[_0xe6b1('0xe')]());for(var _0x56135b=0x0;_0x56135b<_0x9beb61[_0xe6b1('0xb')];_0x56135b++){io[_0xe6b1('0x14')](_0xe6b1('0x15'),{'id':_0x9beb61[_0x56135b],'closed':!![]});}}})['catch'](function(_0x530e38){logger[_0xe6b1('0x16')](_0xe6b1('0x17'),_0x530e38?util['inspect'](_0x530e38,{'showHidden':![],'depth':null}):'');});}exports[_0xe6b1('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index ef47533..5fb69fd 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78f0=['CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x1c3057,_0x3b6e30){var _0x414e07=function(_0x24ab9d){while(--_0x24ab9d){_0x1c3057['push'](_0x1c3057['shift']());}};_0x414e07(++_0x3b6e30);}(_0x78f0,0x1d8));var _0x078f=function(_0x1e024a,_0x5cccaf){_0x1e024a=_0x1e024a-0x0;var _0x18e59a=_0x78f0[_0x1e024a];return _0x18e59a;};'use strict';var util=require(_0x078f('0x0'));var db=require(_0x078f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x078f('0x2')]({'id':i,'firstName':_0x078f('0x3')+i,'lastName':_0x078f('0x4')+i,'phone':0xf879fb460+i,'email':_0x078f('0x5')+i+_0x078f('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x078f('0x7')](),'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[_0x078f('0x2')]({'id':i,'firstName':_0x078f('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x078f('0x5')+i+_0x078f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x078f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x078f('0x7')](),'updatedAt':Date['now']()});}db[_0x078f('0x8')][_0x078f('0x9')]({'where':{}})[_0x078f('0xa')](function(){return db[_0x078f('0x8')][_0x078f('0xb')](contacts);})['then'](function(){console[_0x078f('0xc')](_0x078f('0xd'),_0x078f('0xe'));return db[_0x078f('0xf')][_0x078f('0x9')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x078f('0xa')](function(){console['log'](_0x078f('0xd'),_0x078f('0x10'));return db[_0x078f('0x8')][_0x078f('0xb')](contacts2);})[_0x078f('0xa')](function(){console['log'](_0x078f('0xd'),_0x078f('0x11'));return db['CmHopper'][_0x078f('0xb')](hopper2);})[_0x078f('0xa')](function(){console[_0x078f('0xc')]('finished\x20populating',_0x078f('0x12'));})[_0x078f('0x13')](function(_0x3c7f0b){console[_0x078f('0xc')](_0x3c7f0b);}); \ No newline at end of file +var _0xbb1c=['Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','contacts2','catch','util','push'];(function(_0x44d55b,_0x59b222){var _0x36b487=function(_0x1b6412){while(--_0x1b6412){_0x44d55b['push'](_0x44d55b['shift']());}};_0x36b487(++_0x59b222);}(_0xbb1c,0xec));var _0xcbb1=function(_0x3d8c98,_0x1ed017){_0x3d8c98=_0x3d8c98-0x0;var _0x6ad228=_0xbb1c[_0x3d8c98];return _0x6ad228;};'use strict';var util=require(_0xcbb1('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xcbb1('0x1')]({'id':i,'firstName':_0xcbb1('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xcbb1('0x3')+i+_0xcbb1('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcbb1('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xcbb1('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcbb1('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcbb1('0x1')]({'id':i,'firstName':_0xcbb1('0x2')+i,'lastName':_0xcbb1('0x6')+i,'phone':0xf879fb460+i,'email':_0xcbb1('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcbb1('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xcbb1('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcbb1('0x5')]()});}db[_0xcbb1('0x7')]['destroy']({'where':{}})[_0xcbb1('0x8')](function(){return db[_0xcbb1('0x7')][_0xcbb1('0x9')](contacts);})[_0xcbb1('0x8')](function(){console[_0xcbb1('0xa')](_0xcbb1('0xb'),_0xcbb1('0xc'));return db['CmHopper'][_0xcbb1('0xd')]({'where':{}});})[_0xcbb1('0x8')](function(){return db[_0xcbb1('0xe')][_0xcbb1('0x9')](hopper);})[_0xcbb1('0x8')](function(){console[_0xcbb1('0xa')](_0xcbb1('0xb'),'hopper1');return db[_0xcbb1('0x7')][_0xcbb1('0x9')](contacts2);})[_0xcbb1('0x8')](function(){console['log'](_0xcbb1('0xb'),_0xcbb1('0xf'));return db[_0xcbb1('0xe')][_0xcbb1('0x9')](hopper2);})['then'](function(){console[_0xcbb1('0xa')](_0xcbb1('0xb'),'hopper2');})[_0xcbb1('0x10')](function(_0x487efd){console['log'](_0x487efd);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 117382c..d722cb2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1146=['util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','bulkCreate','then','log','add\x20user','catch'];(function(_0x8691cd,_0x366928){var _0x4d9826=function(_0x4d6857){while(--_0x4d6857){_0x8691cd['push'](_0x8691cd['shift']());}};_0x4d9826(++_0x366928);}(_0x1146,0xab));var _0x6114=function(_0x3b9393,_0x10de21){_0x3b9393=_0x3b9393-0x0;var _0xfa84e1=_0x1146[_0x3b9393];return _0xfa84e1;};'use strict';var util=require(_0x6114('0x0'));var db=require(_0x6114('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6114('0x2')]({'name':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'fullname':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'email':util[_0x6114('0x3')](_0x6114('0x6'),_0x6114('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x6114('0x7'),'ws',_0x6114('0x8')],'disallow':['all'],'allow':[_0x6114('0x9')],'defaultuser':util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),'encryption':_0x6114('0xa'),'avpf':_0x6114('0xa'),'force_avp':_0x6114('0xa'),'icesupport':_0x6114('0xa'),'dtlsenable':_0x6114('0xa'),'dtlsverify':'no','dtlscertfile':_0x6114('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6114('0xc'),'callerid':util[_0x6114('0x3')]('\x22%s\x22\x20<%s>',util[_0x6114('0x3')](_0x6114('0x4'),_0x6114('0x5'),i),0xfa0+i)});}db[_0x6114('0xd')][_0x6114('0xe')](users)[_0x6114('0xf')](function(){console[_0x6114('0x10')](_0x6114('0x11'));})[_0x6114('0x12')](function(_0x1a1c9e){console['log'](_0x1a1c9e);}); \ No newline at end of file +var _0xb7a1=['bulkCreate','add\x20user','catch','log','../mysqldb','format','%s%s','agent','friend','wss','yes','/etc/pki/tls/private/motion.key','actpass','User'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xb7a1,0x66));var _0x1b7a=function(_0x1cb94b,_0x4eef96){_0x1cb94b=_0x1cb94b-0x0;var _0x3c9ab7=_0xb7a1[_0x1cb94b];return _0x3c9ab7;};'use strict';var util=require('util');var db=require(_0x1b7a('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x1b7a('0x1')](_0x1b7a('0x2'),_0x1b7a('0x3'),i),'fullname':util[_0x1b7a('0x1')](_0x1b7a('0x2'),_0x1b7a('0x3'),i),'email':util[_0x1b7a('0x1')]('%s%s@xcally.com','agent',i),'role':_0x1b7a('0x3'),'password':'password','internal':0xfa0+i,'type':_0x1b7a('0x4'),'transport':['udp','ws',_0x1b7a('0x5')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x1b7a('0x1')](_0x1b7a('0x2'),'agent',i),'encryption':_0x1b7a('0x6'),'avpf':_0x1b7a('0x6'),'force_avp':_0x1b7a('0x6'),'icesupport':_0x1b7a('0x6'),'dtlsenable':_0x1b7a('0x6'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x1b7a('0x7'),'dtlssetup':_0x1b7a('0x8'),'callerid':util[_0x1b7a('0x1')]('\x22%s\x22\x20<%s>',util['format']('%s%s',_0x1b7a('0x3'),i),0xfa0+i)});}db[_0x1b7a('0x9')][_0x1b7a('0xa')](users)['then'](function(){console['log'](_0x1b7a('0xb'));})[_0x1b7a('0xc')](function(_0x317f02){console[_0x1b7a('0xd')](_0x317f02);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index dafbb22..33529d1 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6455=['ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','SmsQueues','OpenchannelQueues','WhatsappQueue','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','type','ivr','format','query','find','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x608382,_0x102452){var _0x4f7518=function(_0x4eab9d){while(--_0x4eab9d){_0x608382['push'](_0x608382['shift']());}};_0x4f7518(++_0x102452);}(_0x6455,0x97));var _0x5645=function(_0x5973a4,_0x2a5f2e){_0x5973a4=_0x5973a4-0x0;var _0x17631d=_0x6455[_0x5973a4];return _0x17631d;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var BPromise=require(_0x5645('0x1'));var db=require(_0x5645('0x2'))['db'];var config=require(_0x5645('0x3'));var queryQueues={'attributes':['id',_0x5645('0x4')],'include':[{'as':_0x5645('0x5'),'model':db[_0x5645('0x6')],'attributes':['id','name',_0x5645('0x7')],'raw':!![],'where':{'role':_0x5645('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5645('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5645('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x20efde,_0x37c03a,_0x38c07a){return db[_0x5645('0xa')][_0x5645('0xb')]({'where':{'name':_0x20efde,'userProfileId':_0x37c03a},'raw':!![]})[_0x5645('0xc')](function(_0x587c61){if(_0x587c61){if(_0x587c61[_0x5645('0xd')]){switch(_0x20efde){case _0x5645('0xe'):case _0x5645('0xf'):case _0x5645('0x10'):case'SmsQueues':case _0x5645('0x11'):case'OpenchannelQueues':case _0x5645('0x12'):return db[_0x38c07a][_0x5645('0x13')](queryQueues);case _0x5645('0x14'):return db[_0x38c07a][_0x5645('0x13')](queryTelephones);case _0x5645('0x15'):return db[_0x38c07a][_0x5645('0x13')](queryTrunks);case _0x5645('0x16'):return db[_0x38c07a][_0x5645('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x5645('0x13')]({'attributes':[_0x5645('0x17')],'where':{'sectionId':_0x587c61['id']},'raw':!![]})[_0x5645('0xc')](function(_0x4cbd46){if(_0x4cbd46){var _0x4b3be6={'where':{'id':_[_0x5645('0x18')](_0x4cbd46,_0x5645('0x17'))},'raw':!![]};switch(_0x38c07a){case'User':_0x4b3be6[_0x5645('0x19')][_0x5645('0x7')]=_0x5645('0x9');break;case'Campaign':_0x4b3be6[_0x5645('0x19')][_0x5645('0x1a')]=_0x5645('0x1b');break;}return db[_0x38c07a][_0x5645('0x13')](_0x4b3be6);}else{return[];}});}}else{return[];}})['then'](function(_0x1853a7){return _0x1853a7;});}function joinOrLeaveQueues(_0x52ac46,_0x557ad2,_0x7c39d7,_0x1e2cba){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('%s:queue:%s',_0x7c39d7,_0x1e2cba[_0x5645('0x4')]));if(_0x1e2cba['Agents']){for(var _0x2b8cc8=0x0;_0x2b8cc8<_0x1e2cba['Agents']['length'];_0x2b8cc8+=0x1){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('user:%s',_0x1e2cba[_0x5645('0x5')][_0x2b8cc8][_0x5645('0x4')]));}}}function joinOrLeave(_0x502c2e,_0x18680f,_0x116bfc){var _0xe83ed7;if(_0x502c2e['handshake'][_0x5645('0x1d')]['id']){db[_0x5645('0x6')][_0x5645('0x1e')]({'attributes':['id',_0x5645('0x4'),'role','userProfileId'],'where':{'id':_0x502c2e['handshake']['query']['id']},'include':[{'model':db[_0x5645('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x5645('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x21')],'as':_0x5645('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x23')],'as':_0x5645('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x25')],'as':_0x5645('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x27')],'as':_0x5645('0x28'),'attributes':['id'],'raw':!![]}]})[_0x5645('0xc')](function(_0x1c0aa2){if(_0x1c0aa2){_0xe83ed7=_0x1c0aa2;_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x29'),_0x1c0aa2[_0x5645('0x4')]));var _0x52ba45=[];switch(_0x1c0aa2[_0x5645('0x7')]){case'admin':_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));if(queryQueues[_0x5645('0x2c')](_0x5645('0x2d'))){delete queryQueues[_0x5645('0x2d')];}_0x52ba45[_0x5645('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x2f')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x30')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x31')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x32')]['findAll'](queryQueues));_0x52ba45['push'](db[_0x5645('0x33')]['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db['WhatsappQueue'][_0x5645('0x13')](queryQueues));_0x52ba45['push'](db[_0x5645('0x6')][_0x5645('0x13')](queryTelephones));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x34')][_0x5645('0x13')](queryTrunks));_0x52ba45[_0x5645('0x2e')](db['Campaign'][_0x5645('0x13')](queryCampaigns));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x6')][_0x5645('0x13')](queryAgents));break;case _0x5645('0x35'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('VoiceQueues',_0x1c0aa2[_0x5645('0x36')],'VoiceQueue'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0xf'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x2f')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('FaxQueues',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x30')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x37'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x31')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x11'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x32')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x38'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x33')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x12'),_0x1c0aa2['userProfileId'],_0x5645('0x39')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('Telephones',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x6')));_0x52ba45['push'](getAssociatedResources(_0x5645('0x15'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x34')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x16'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x3a')));_0x52ba45['push'](db['User'][_0x5645('0x13')](queryAgents));break;case _0x5645('0x8'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3b')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3c')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3d')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3e')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2['getMailQueues']({'attributes':['id','name']}));_0x52ba45['push'](_0x1c0aa2['getOpenchannelQueues']({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3f')]({'attributes':['id',_0x5645('0x4')]}));break;}return BPromise[_0x5645('0x40')](_0x52ba45);}})['then'](function(_0x43eaa9){if(_0x43eaa9&&_0x43eaa9[_0x5645('0x41')]){for(var _0x41b607=0x0;_0x41b607<_0x43eaa9[_0x5645('0x41')];_0x41b607+=0x1){for(var _0x30a685=0x0;_0x30a685<_0x43eaa9[_0x41b607]['length'];_0x30a685+=0x1){switch(_0x41b607){case 0x0:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x42'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x1:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x43'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x2:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x44'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x3:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x45'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x4:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x46'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x5:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x47'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x6:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x48'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x7:if(_0xe83ed7[_0x5645('0x7')]!=='agent')_0x502c2e[_0x18680f](util['format'](_0x5645('0x49'),_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x8:if(_0xe83ed7['role']!=='agent')_0x502c2e[_0x18680f](util[_0x5645('0x1c')]('trunk:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x9:if(_0xe83ed7[_0x5645('0x7')]!==_0x5645('0x8'))_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x4a'),_0x43eaa9[_0x41b607][_0x30a685]['type'],_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0xa:_0x502c2e[_0x18680f](util['format']('user:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;}}}}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x46637f=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x4c')],'id');return _0xe83ed7[_0x5645('0x4d')](_0x46637f)[_0x5645('0xc')](function(){for(var _0x13bee1=0x0;_0x13bee1<_0x46637f[_0x5645('0x41')];_0x13bee1+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x4f'),{'ChatInteractionId':Number(_0x46637f[_0x13bee1]),'UserId':Number(_0xe83ed7['id'])});}});}})['then'](function(){if(_0x18680f==='leave'){var _0x30932d=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x20')],'id');return _0xe83ed7[_0x5645('0x50')](_0x30932d)[_0x5645('0xc')](function(){for(var _0x4cfe24=0x0;_0x4cfe24<_0x30932d[_0x5645('0x41')];_0x4cfe24+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x30932d[_0x4cfe24]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x2eea4c=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x22')],'id');return _0xe83ed7['removeFaxInteractions'](_0x2eea4c)[_0x5645('0xc')](function(){for(var _0xd1f0b=0x0;_0xd1f0b<_0x2eea4c[_0x5645('0x41')];_0xd1f0b+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2eea4c[_0xd1f0b]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0xd971f5=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x24')],'id');return _0xe83ed7[_0x5645('0x51')](_0xd971f5)[_0x5645('0xc')](function(){for(var _0x3b4f94=0x0;_0x3b4f94<_0xd971f5[_0x5645('0x41')];_0x3b4f94+=0x1){_0x116bfc['emit'](_0x5645('0x52'),{'SmsInteractionId':Number(_0xd971f5[_0x3b4f94]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x5d90a6=_[_0x5645('0x18')](_0xe83ed7['OpenchannelInteractions'],'id');return _0xe83ed7[_0x5645('0x53')](_0x5d90a6)[_0x5645('0xc')](function(){for(var _0x26431d=0x0;_0x26431d<_0x5d90a6[_0x5645('0x41')];_0x26431d+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x54'),{'OpenchannelInteractionId':Number(_0x5d90a6[_0x26431d]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x2a7a9a=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x28')],'id');return _0xe83ed7[_0x5645('0x55')](_0x2a7a9a)[_0x5645('0xc')](function(){for(var _0x302248=0x0;_0x302248<_0x2a7a9a[_0x5645('0x41')];_0x302248+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2a7a9a[_0x302248]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0x56')](function(_0x7e719a){_0x502c2e[_0x5645('0x57')](_0x7e719a);});}}function onDisconnect(_0x2e3899,_0x5e7f9e){joinOrLeave(_0x2e3899,_0x5645('0x4b'),_0x5e7f9e);}function onConnect(_0x31661a){joinOrLeave(_0x31661a,_0x5645('0x58'));}exports[_0x5645('0x59')]=function(_0x4545f8){_0x4545f8['on'](_0x5645('0x5a'),function(_0x83ec55){_0x83ec55[_0x5645('0x5b')](0x0);_0x83ec55['address']=_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5d')]+':'+_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5e')];_0x83ec55['connectedAt']=new Date();_0x83ec55[_0x5645('0x57')]=function(_0xd12828){console[_0x5645('0x57')](_0x5645('0x5f')+_0x83ec55['nsp']['name']+'['+_0x83ec55[_0x5645('0x60')]+']',_0xd12828);};_0x83ec55['on'](_0x5645('0x61'),function(){onDisconnect(_0x83ec55,_0x4545f8);_0x83ec55[_0x5645('0x57')]('DISCONNECTED');});onConnect(_0x83ec55);_0x83ec55[_0x5645('0x57')](_0x5645('0x62'));});}; \ No newline at end of file +var _0x1af1=['connection','remotePort','connectedAt','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','then','map','where','telephone','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','SmsQueue','WhatsappQueue','Telephones','Trunk','IvrCampaigns','agent','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','address','request','remoteAddress'];(function(_0x25df26,_0x3bc72b){var _0x2b2181=function(_0x5839bd){while(--_0x5839bd){_0x25df26['push'](_0x25df26['shift']());}};_0x2b2181(++_0x3bc72b);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11af('0x0'));var util=require(_0x11af('0x1'));var BPromise=require(_0x11af('0x2'));var db=require(_0x11af('0x3'))['db'];var config=require(_0x11af('0x4'));var queryQueues={'attributes':['id',_0x11af('0x5')],'include':[{'as':_0x11af('0x6'),'model':db[_0x11af('0x7')],'attributes':['id',_0x11af('0x5'),_0x11af('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x11af('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x11af('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x11af('0x5'),'type'],'where':{'type':_0x11af('0x9')}};function getAssociatedResources(_0x4c8bf1,_0x3d8d3f,_0x23b31a){return db[_0x11af('0xa')][_0x11af('0xb')]({'where':{'name':_0x4c8bf1,'userProfileId':_0x3d8d3f},'raw':!![]})['then'](function(_0x4214bd){if(_0x4214bd){if(_0x4214bd[_0x11af('0xc')]){switch(_0x4c8bf1){case _0x11af('0xd'):case _0x11af('0xe'):case _0x11af('0xf'):case _0x11af('0x10'):case _0x11af('0x11'):case _0x11af('0x12'):case _0x11af('0x13'):return db[_0x23b31a][_0x11af('0x14')](queryQueues);case'Telephones':return db[_0x23b31a][_0x11af('0x14')](queryTelephones);case _0x11af('0x15'):return db[_0x23b31a][_0x11af('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x23b31a][_0x11af('0x14')](queryCampaigns);}}else{return db[_0x11af('0x16')]['findAll']({'attributes':[_0x11af('0x17')],'where':{'sectionId':_0x4214bd['id']},'raw':!![]})[_0x11af('0x18')](function(_0x2292c8){if(_0x2292c8){var _0x23ed21={'where':{'id':_[_0x11af('0x19')](_0x2292c8,_0x11af('0x17'))},'raw':!![]};switch(_0x23b31a){case _0x11af('0x7'):_0x23ed21[_0x11af('0x1a')][_0x11af('0x8')]=_0x11af('0x1b');break;case _0x11af('0x1c'):_0x23ed21[_0x11af('0x1a')][_0x11af('0x1d')]=_0x11af('0x9');break;}return db[_0x23b31a][_0x11af('0x14')](_0x23ed21);}else{return[];}});}}else{return[];}})[_0x11af('0x18')](function(_0x66ef3f){return _0x66ef3f;});}function joinOrLeaveQueues(_0xa557f7,_0x2a1de1,_0x1ffbda,_0x55940a){_0xa557f7[_0x2a1de1](util[_0x11af('0x1e')](_0x11af('0x1f'),_0x1ffbda,_0x55940a['name']));if(_0x55940a[_0x11af('0x6')]){for(var _0x204333=0x0;_0x204333<_0x55940a[_0x11af('0x6')][_0x11af('0x20')];_0x204333+=0x1){_0xa557f7[_0x2a1de1](util['format'](_0x11af('0x21'),_0x55940a[_0x11af('0x6')][_0x204333][_0x11af('0x5')]));}}}function joinOrLeave(_0x1d56ca,_0x514ea8,_0x8eeed){var _0x61a534;if(_0x1d56ca[_0x11af('0x22')]['query']['id']){db[_0x11af('0x7')]['find']({'attributes':['id','name','role',_0x11af('0x23')],'where':{'id':_0x1d56ca[_0x11af('0x22')][_0x11af('0x24')]['id']},'include':[{'model':db[_0x11af('0x25')],'as':_0x11af('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x27')],'as':_0x11af('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x29')],'as':_0x11af('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x2b')],'as':_0x11af('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x11af('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x2e')],'as':_0x11af('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x11af('0x18')](function(_0xfc1d23){if(_0xfc1d23){_0x61a534=_0xfc1d23;_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x21'),_0xfc1d23['name']));var _0x3b047c=[];switch(_0xfc1d23[_0x11af('0x8')]){case _0x11af('0x30'):_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8](_0x11af('0x32'));if(queryQueues[_0x11af('0x33')](_0x11af('0x34'))){delete queryQueues['include'];}_0x3b047c[_0x11af('0x35')](db[_0x11af('0x36')][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x37')]['findAll'](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x38')]['findAll'](queryQueues));_0x3b047c[_0x11af('0x35')](db['SmsQueue'][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x39')][_0x11af('0x14')](queryQueues));_0x3b047c['push'](db[_0x11af('0x3a')][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db['WhatsappQueue']['findAll'](queryQueues));_0x3b047c['push'](db[_0x11af('0x7')][_0x11af('0x14')](queryTelephones));_0x3b047c['push'](db['Trunk'][_0x11af('0x14')](queryTrunks));_0x3b047c[_0x11af('0x35')](db['Campaign'][_0x11af('0x14')](queryCampaigns));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x7')][_0x11af('0x14')](queryAgents));break;case'user':_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8](_0x11af('0x32'));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xd'),_0xfc1d23['userProfileId'],_0x11af('0x36')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xe'),_0xfc1d23['userProfileId'],_0x11af('0x37')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xf'),_0xfc1d23['userProfileId'],_0x11af('0x38')));_0x3b047c[_0x11af('0x35')](getAssociatedResources('SmsQueues',_0xfc1d23['userProfileId'],_0x11af('0x3b')));_0x3b047c['push'](getAssociatedResources('MailQueues',_0xfc1d23['userProfileId'],_0x11af('0x39')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x12'),_0xfc1d23['userProfileId'],'OpenchannelQueue'));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x13'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x3c')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x3d'),_0xfc1d23['userProfileId'],_0x11af('0x7')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x15'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x3e')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x3f'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x1c')));_0x3b047c[_0x11af('0x35')](db['User']['findAll'](queryAgents));break;case _0x11af('0x40'):_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8]('voice:outbound');_0x3b047c['push'](_0xfc1d23['getVoiceQueues']({'attributes':['id','name']}));_0x3b047c['push'](_0xfc1d23[_0x11af('0x41')]({'attributes':['id',_0x11af('0x5')]}));_0x3b047c['push'](_0xfc1d23[_0x11af('0x42')]({'attributes':['id',_0x11af('0x5')]}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x43')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x44')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x45')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x46')]({'attributes':['id',_0x11af('0x5')]}));break;}return BPromise[_0x11af('0x47')](_0x3b047c);}})[_0x11af('0x18')](function(_0x2cbeb3){if(_0x2cbeb3&&_0x2cbeb3[_0x11af('0x20')]){for(var _0x11c10e=0x0;_0x11c10e<_0x2cbeb3[_0x11af('0x20')];_0x11c10e+=0x1){for(var _0x22e8d8=0x0;_0x22e8d8<_0x2cbeb3[_0x11c10e][_0x11af('0x20')];_0x22e8d8+=0x1){switch(_0x11c10e){case 0x0:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,'voice',_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x1:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x48'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x2:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x49'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x3:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4a'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x4:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4b'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x5:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,'openchannel',_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x6:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4c'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x7:if(_0x61a534[_0x11af('0x8')]!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x4d'),_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;case 0x8:if(_0x61a534['role']!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util['format']('trunk:%s',_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;case 0x9:if(_0x61a534[_0x11af('0x8')]!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x4e'),_0x2cbeb3[_0x11c10e][_0x22e8d8]['type'],_0x2cbeb3[_0x11c10e][_0x22e8d8]['name']));break;case 0xa:_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x21'),_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;}}}}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x149aa3=_[_0x11af('0x19')](_0x61a534[_0x11af('0x26')],'id');return _0x61a534[_0x11af('0x50')](_0x149aa3)[_0x11af('0x18')](function(){for(var _0x2fe470=0x0;_0x2fe470<_0x149aa3['length'];_0x2fe470+=0x1){_0x8eeed[_0x11af('0x51')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x149aa3[_0x2fe470]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x361ce4=_[_0x11af('0x19')](_0x61a534[_0x11af('0x28')],'id');return _0x61a534[_0x11af('0x52')](_0x361ce4)[_0x11af('0x18')](function(){for(var _0x512dd1=0x0;_0x512dd1<_0x361ce4[_0x11af('0x20')];_0x512dd1+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x53'),{'MailInteractionId':Number(_0x361ce4[_0x512dd1]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x41906c=_['map'](_0x61a534[_0x11af('0x2a')],'id');return _0x61a534[_0x11af('0x54')](_0x41906c)[_0x11af('0x18')](function(){for(var _0x1b0518=0x0;_0x1b0518<_0x41906c['length'];_0x1b0518+=0x1){_0x8eeed[_0x11af('0x51')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x41906c[_0x1b0518]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x5b98a6=_['map'](_0x61a534[_0x11af('0x2c')],'id');return _0x61a534[_0x11af('0x55')](_0x5b98a6)[_0x11af('0x18')](function(){for(var _0x33a236=0x0;_0x33a236<_0x5b98a6[_0x11af('0x20')];_0x33a236+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x56'),{'SmsInteractionId':Number(_0x5b98a6[_0x33a236]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x75594b=_[_0x11af('0x19')](_0x61a534['OpenchannelInteractions'],'id');return _0x61a534[_0x11af('0x57')](_0x75594b)[_0x11af('0x18')](function(){for(var _0x4ec540=0x0;_0x4ec540<_0x75594b[_0x11af('0x20')];_0x4ec540+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x58'),{'OpenchannelInteractionId':Number(_0x75594b[_0x4ec540]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x4fbf1b=_[_0x11af('0x19')](_0x61a534['WhatsappInteractions'],'id');return _0x61a534[_0x11af('0x59')](_0x4fbf1b)[_0x11af('0x18')](function(){for(var _0x12d098=0x0;_0x12d098<_0x4fbf1b[_0x11af('0x20')];_0x12d098+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x5a'),{'WhatsappInteractionId':Number(_0x4fbf1b[_0x12d098]),'UserId':Number(_0x61a534['id'])});}});}})['catch'](function(_0x29f2f7){_0x1d56ca[_0x11af('0x5b')](_0x29f2f7);});}}function onDisconnect(_0x169bb3,_0x22c3c8){joinOrLeave(_0x169bb3,_0x11af('0x4f'),_0x22c3c8);}function onConnect(_0x1174b2){joinOrLeave(_0x1174b2,_0x11af('0x5c'));}exports[_0x11af('0x5d')]=function(_0x46e4ad){_0x46e4ad['on']('connection',function(_0x1a35e1){_0x1a35e1['setMaxListeners'](0x0);_0x1a35e1[_0x11af('0x5e')]=_0x1a35e1[_0x11af('0x5f')]['connection'][_0x11af('0x60')]+':'+_0x1a35e1[_0x11af('0x5f')][_0x11af('0x61')][_0x11af('0x62')];_0x1a35e1[_0x11af('0x63')]=new Date();_0x1a35e1['log']=function(_0x3add15){console[_0x11af('0x5b')]('SocketIO\x20'+_0x1a35e1['nsp'][_0x11af('0x5')]+'['+_0x1a35e1[_0x11af('0x5e')]+']',_0x3add15);};_0x1a35e1['on']('disconnect',function(){onDisconnect(_0x1a35e1,_0x46e4ad);_0x1a35e1[_0x11af('0x5b')]('DISCONNECTED');});onConnect(_0x1a35e1);_0x1a35e1[_0x11af('0x5b')](_0x11af('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 0b0dc9e..2bb186c 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 _0x5454=['triggers','lodash','client','http','ChatInteraction','afterCreate','newinteraction','Chat','ChatMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','WhatsappInteraction','Whatsapp','afterUpdate','WhatsappMessage','newmessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','SELECT','UserId','User','find','name','fullname','internal','interface','SIP/%s','incomingmessage','outgoingmessage','motionChannel','ContactId','QueryTypes','changed','closed','substatus','sequelize','contact','email','format','agent','default','length','hasOwnProperty','model','callback','toLowerCase','condition','../../mysqldb','../logger'];(function(_0x3aa753,_0x3eac5f){var _0x5068bc=function(_0x294a35){while(--_0x294a35){_0x3aa753['push'](_0x3aa753['shift']());}};_0x5068bc(++_0x3eac5f);}(_0x5454,0x15c));var _0x4545=function(_0x579e90,_0x440eb1){_0x579e90=_0x579e90-0x0;var _0x1e7820=_0x5454[_0x579e90];return _0x1e7820;};'use strict';var util=require('util');var db=require(_0x4545('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x4545('0x1'))(_0x4545('0x2'));var _=require(_0x4545('0x3'));var client=jayson[_0x4545('0x4')][_0x4545('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4545('0x6'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x9'),'model':'ChatInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4545('0x9'),'model':_0x4545('0xa'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4545('0xb'),'model':_0x4545('0xc'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0xb'),'model':_0x4545('0xc'),'event':'afterUpdate','condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0xb'),'model':_0x4545('0xe'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x4545('0xf'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x10'),'model':'WhatsappInteraction','event':_0x4545('0x11'),'condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x4545('0x12'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage},{'channel':_0x4545('0x14'),'model':_0x4545('0x15'),'event':'afterCreate','condition':_0x4545('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x4545('0x15'),'event':'afterUpdate','condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0x14'),'model':_0x4545('0x16'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage},{'channel':_0x4545('0x17'),'model':_0x4545('0x18'),'event':_0x4545('0x7'),'condition':_0x4545('0x8'),'callback':afterCreate},{'channel':_0x4545('0x17'),'model':_0x4545('0x18'),'event':_0x4545('0x11'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4545('0x17'),'model':_0x4545('0x19'),'event':_0x4545('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4545('0x1a'),'model':'OpenchannelInteraction','event':_0x4545('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4545('0x1a'),'model':'OpenchannelInteraction','event':_0x4545('0x11'),'condition':_0x4545('0xd'),'callback':afterUpdate},{'channel':_0x4545('0x1a'),'model':_0x4545('0x1b'),'event':_0x4545('0x7'),'condition':_0x4545('0x13'),'callback':afterCreateMessage}];function request(_0x33ed1f){return client[_0x4545('0x1c')](_0x4545('0x1d'),_0x33ed1f)[_0x4545('0x1e')](function(_0x289ef7){logger['info'](_0x4545('0x1f'),_0x4545('0x1d'),_0x289ef7);if(_0x289ef7[_0x4545('0x20')]){if(_0x289ef7[_0x4545('0x20')][_0x4545('0x21')]===0x1f4){logger[_0x4545('0x20')]('Trigger,\x20%s',_0x4545('0x1d'),_0x289ef7[_0x4545('0x20')]);}}})[_0x4545('0x22')](function(_0x42c773){logger[_0x4545('0x20')](_0x4545('0x1f'),_0x4545('0x1d'),_0x42c773);});}function afterCreateMessage(_0x9e08bc,_0x1f1a41){return function(_0x175f5c,_0x4b9a59){_0x175f5c=_0x175f5c[_0x4545('0x23')]({'plain':!![]});_0x175f5c[_0x4545('0x24')]=_0x9e08bc;_0x175f5c['motionChannel']=_0x9e08bc;_0x175f5c[_0x4545('0x25')]=_0x175f5c['direction'];var _0x52fb66=_0x4545('0x26')+_0x175f5c['ContactId'];return db['sequelize'][_0x4545('0x27')](_0x52fb66,{'type':db[_0x4545('0x28')]['QueryTypes'][_0x4545('0x29')],'raw':!![]})[_0x4545('0x1e')](function(_0x4f513d){return _0x4f513d;})[_0x4545('0x1e')](function(_0x453d1a){if(_0x453d1a){_0x175f5c['contact']=_0x453d1a[0x0];}if(_0x175f5c[_0x4545('0x2a')]){return db[_0x4545('0x2b')][_0x4545('0x2c')]({'where':{'id':_0x175f5c[_0x4545('0x2a')]},'attributes':['id',_0x4545('0x2d'),_0x4545('0x2e'),'email',_0x4545('0x2f')],'raw':!![]})[_0x4545('0x1e')](function(_0x4bedf9){_0x175f5c[_0x4545('0x30')]=util['format'](_0x4545('0x31'),_0x4bedf9[_0x4545('0x2d')]);_0x175f5c[_0x4545('0x24')]=_0x9e08bc;_0x175f5c['agent']=_0x4bedf9;return request({'event':_0x4545('0x32'),'message':_0x175f5c});})[_0x4545('0x22')](function(_0x40cbea){console[_0x4545('0x20')](_0x40cbea);});}else{return request({'event':_0x4545('0x33'),'message':_0x175f5c});}});};}function afterCreate(_0x240484,_0x4e2b16){return function(_0x22972d,_0x447943){_0x22972d=_0x22972d[_0x4545('0x23')]({'plain':!![]});_0x22972d[_0x4545('0x24')]=_0x240484;_0x22972d[_0x4545('0x34')]=_0x240484;_0x22972d[_0x4545('0x25')]='opened';var _0x187ccd=_0x4545('0x26')+_0x22972d[_0x4545('0x35')];return db['sequelize'][_0x4545('0x27')](_0x187ccd,{'type':db[_0x4545('0x28')][_0x4545('0x36')][_0x4545('0x29')],'raw':!![]})['then'](function(_0x388571){return _0x388571;})[_0x4545('0x1e')](function(_0x42cfd3){if(_0x42cfd3){_0x22972d['contact']=_0x42cfd3[0x0];}return request({'event':_0x4e2b16,'message':_0x22972d});});};}function afterUpdate(_0xfd8793){return function(_0x546e75){var _0x3887c6=_0x546e75[_0x4545('0x37')](_0x4545('0x38'))&&_0x546e75['closed'];var _0x2a0423=_0x546e75['changed'](_0x4545('0x39'));if(_0x3887c6||_0x2a0423){var _0x471e5e=_0x3887c6?_0x4545('0xd'):_0x4545('0x39');var _0x45f862=_0x546e75[_0x4545('0x23')]({'plain':!![]});_0x45f862[_0x4545('0x24')]=_0xfd8793;_0x45f862[_0x4545('0x34')]=_0xfd8793;_0x45f862[_0x4545('0x25')]=_0x3887c6?'closed':'substatus';var _0x131b8f=_0x4545('0x26')+_0x45f862[_0x4545('0x35')];return db[_0x4545('0x3a')][_0x4545('0x27')](_0x131b8f,{'type':db[_0x4545('0x28')]['QueryTypes'][_0x4545('0x29')],'raw':!![]})[_0x4545('0x1e')](function(_0x1db627){if(_0x1db627){_0x45f862[_0x4545('0x3b')]=_0x1db627[0x0];}if(_0x45f862[_0x4545('0x2a')]){return db[_0x4545('0x2b')][_0x4545('0x2c')]({'where':{'id':_0x45f862[_0x4545('0x2a')]},'attributes':['id',_0x4545('0x2d'),'fullname',_0x4545('0x3c'),_0x4545('0x2f')],'raw':!![]})[_0x4545('0x1e')](function(_0x52039e){_0x45f862[_0x4545('0x30')]=util[_0x4545('0x3d')](_0x4545('0x31'),_0x52039e[_0x4545('0x2d')]);_0x45f862[_0x4545('0x3e')]=_0x52039e;return request({'event':_0x471e5e,'message':_0x45f862});})[_0x4545('0x22')](function(_0x1aa9dc){console[_0x4545('0x20')](_0x1aa9dc);});}else{return request({'event':_0x471e5e,'message':_0x45f862});}});}};}exports[_0x4545('0x3f')]=function(){for(var _0x33ece0=0x0;_0x33ece0=_0x3771f1[_0xd56e('0x16')]){throw Error(_0xd56e('0x17'));}_0x546ec4(_0x5edb98);})[_0xd56e('0x18')](function(_0x1eb7d1){_0x5a575c(_0x1eb7d1);});});}; \ No newline at end of file +var _0x6f57=['whatsapp','openchannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','role','User','count','agent','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','sms'];(function(_0x34620e,_0x582015){var _0x3d33cd=function(_0x19dc7f){while(--_0x19dc7f){_0x34620e['push'](_0x34620e['shift']());}};_0x3d33cd(++_0x582015);}(_0x6f57,0x130));var _0x76f5=function(_0x44d1f9,_0x31d988){_0x44d1f9=_0x44d1f9-0x0;var _0xa38637=_0x6f57[_0x44d1f9];return _0xa38637;};'use strict';var _=require(_0x76f5('0x0'));var BPromise=require(_0x76f5('0x1'));var db=require(_0x76f5('0x2'))['db'];var util=require(_0x76f5('0x3'));var channels=[_0x76f5('0x4'),_0x76f5('0x5'),'chat',_0x76f5('0x6'),_0x76f5('0x7'),_0x76f5('0x8'),_0x76f5('0x9')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x218ff2){_0x218ff2=_0x218ff2[_0x76f5('0xa')]();return _[_0x76f5('0xb')](channels,_0x218ff2);};exports['clearBlockUser']=function(_0x12843b,_0x43aaa8,_0x150025,_0x5b1c8b){var _0x2907db={'loginAttempts':_0x43aaa8,'blocked':_0x150025};if(!_[_0x76f5('0xc')](_0x5b1c8b)){_0x2907db[_0x76f5('0xd')]=_0x5b1c8b;}return _0x12843b[_0x76f5('0xe')](_0x2907db);};exports['getLicense']=function(_0x309168){return new BPromise(function(_0x235efb,_0x28a4ad){var _0x24e41b=0x0;if(_0x309168[_0x76f5('0xf')]!=='agent'){_0x235efb(_0x309168);}db[_0x76f5('0x10')][_0x76f5('0x11')]({'where':{'role':_0x76f5('0x12'),'online':!![],'id':{'$ne':_0x309168['id']}}})[_0x76f5('0x13')](function(_0x46840f){_0x24e41b=_0x46840f;return util[_0x76f5('0x14')]();})[_0x76f5('0x13')](function(_0xe6b4c0){if(_0xe6b4c0&&_0xe6b4c0[_0x76f5('0x15')]&&_0x24e41b>=_0xe6b4c0['agents']){throw Error(_0x76f5('0x16'));}_0x235efb(_0x309168);})[_0x76f5('0x17')](function(_0x59d030){_0x28a4ad(_0x59d030);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6ea44de..e1f8ca5 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6059=['render','json','exports','status'];(function(_0x39aaf7,_0x4433c1){var _0x208eea=function(_0x426a62){while(--_0x426a62){_0x39aaf7['push'](_0x39aaf7['shift']());}};_0x208eea(++_0x4433c1);}(_0x6059,0x1aa));var _0x9605=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x6059[_0x319a03];return _0x3b6704;};'use strict';module[_0x9605('0x0')][0x194]=function pageNotFound(_0xb0e55b,_0x199be0){var _0x2c9c2c='404';var _0x3f1f26=0x194;var _0x383771={'status':_0x3f1f26};_0x199be0[_0x9605('0x1')](_0x383771[_0x9605('0x1')]);_0x199be0[_0x9605('0x2')](_0x2c9c2c,{},function(_0x19b615,_0x230a9a){if(_0x19b615){return _0x199be0[_0x9605('0x1')](_0x383771['status'])[_0x9605('0x3')](_0x383771);}_0x199be0['send'](_0x230a9a);});}; \ No newline at end of file +var _0x00d0=['status','exports','404'];(function(_0xd8a959,_0x169203){var _0x536e01=function(_0x16fb33){while(--_0x16fb33){_0xd8a959['push'](_0xd8a959['shift']());}};_0x536e01(++_0x169203);}(_0x00d0,0x163));var _0x000d=function(_0x277e0f,_0x41a72a){_0x277e0f=_0x277e0f-0x0;var _0x127b1e=_0x00d0[_0x277e0f];return _0x127b1e;};'use strict';module[_0x000d('0x0')][0x194]=function pageNotFound(_0x43c906,_0x58d267){var _0x27b4db=_0x000d('0x1');var _0x516ff7=0x194;var _0x4f43bb={'status':_0x516ff7};_0x58d267[_0x000d('0x2')](_0x4f43bb[_0x000d('0x2')]);_0x58d267['render'](_0x27b4db,{},function(_0x1bd3fc,_0x384739){if(_0x1bd3fc){return _0x58d267[_0x000d('0x2')](_0x4f43bb[_0x000d('0x2')])['json'](_0x4f43bb);}_0x58d267['send'](_0x384739);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8844673..73cbb88 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','userProfileId','chat_group_has_users','CmContact','cm_user_has_contacts','belongsToMany','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserSmsQueue','OpenchannelQueues','user_has_chat_websites','MailAccount','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','VoiceAgentReport','uniqueid','Contact','MailServerIn','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','Applications','List','TemplateId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','FaxAccountId','FaxApplication','Exntensions','ListId','user_has_fax_accounts','FaxInteractionId','Tags','fax_interaction_has_tags','Interaction','AttachmentId','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroup','CmCompany','HopperHistories','Company','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticFieldReport','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','AccountId','Description','VariableId','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZendeskField','FreshdeskAccount','VtigerAccount','ServicenowConfiguration','FromId','ToId','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','user_has_square_projects','VoiceQueues','team_has_chat_queues','team_has_fax_queues','FaxQueues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefix','SquareProjectId','Lists','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','HopperHistory','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','mysql','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../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','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model'];(function(_0x25cbcf,_0x346a58){var _0x95307a=function(_0x5403a3){while(--_0x5403a3){_0x25cbcf['push'](_0x25cbcf['shift']());}};_0x95307a(++_0x346a58);}(_0xaa88,0x137));var _0x8aa8=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xaa88[_0x26bf51];return _0x503415;};'use strict';var config=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var jstz=require(_0x8aa8('0x3'));var timezone=jstz['determine']();config[_0x8aa8('0x1')]=_[_0x8aa8('0x4')](config[_0x8aa8('0x1')],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8aa8('0x9'),'collate':_0x8aa8('0xa')}}});config[_0x8aa8('0xb')]=_[_0x8aa8('0x4')](config['sequelizeHistory'],{'database':_0x8aa8('0x5'),'username':_0x8aa8('0x6'),'password':_0x8aa8('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8aa8('0xc'),'dialectOptions':{'charset':_0x8aa8('0x8')},'logging':![],'timezone':timezone[_0x8aa8('0xd')](),'define':{'charset':_0x8aa8('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0x1')][_0x8aa8('0xe')],config['sequelize'][_0x8aa8('0xf')],config[_0x8aa8('0x1')][_0x8aa8('0x10')],config['sequelize'][_0x8aa8('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8aa8('0xb')][_0x8aa8('0xe')],config['sequelizeHistory'][_0x8aa8('0xf')],config['sequelizeHistory']['password'],config[_0x8aa8('0xb')][_0x8aa8('0x11')])};db[_0x8aa8('0x12')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x14'));db[_0x8aa8('0x15')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x8aa8('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0x8aa8('0x16')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x17'));db[_0x8aa8('0x18')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x19'));db[_0x8aa8('0x1a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x1b'));db[_0x8aa8('0x1c')]=db['sequelize'][_0x8aa8('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x8aa8('0x1d')]=db['sequelize'][_0x8aa8('0x13')]('../api/screenRecording/screenRecording.model');db[_0x8aa8('0x1e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMail/voiceMail.model');db[_0x8aa8('0x1f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x20'));db[_0x8aa8('0x21')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x22'));db['VoiceAgentReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x23'));db['VoiceQueueReport']=db['sequelize'][_0x8aa8('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8aa8('0x24')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x25'));db[_0x8aa8('0x26')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x27'));db['VoiceTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x28'));db['UserVoiceQueueRt']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x29'));db[_0x8aa8('0x2a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2b'));db[_0x8aa8('0x2c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x2d'));db['UserMailQueue']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x2e'));db[_0x8aa8('0x2f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x30'));db['UserSmsQueue']=db['sequelize'][_0x8aa8('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x8aa8('0x31')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8aa8('0x32')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x8aa8('0x33')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x34'));db['MailAccount']=db['sequelize'][_0x8aa8('0x13')]('../api/mailAccount/mailAccount.model');db[_0x8aa8('0x35')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x36'));db['MailSubstatus']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x8aa8('0x37')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x38'));db[_0x8aa8('0x39')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3a'));db[_0x8aa8('0x3b')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3c'));db[_0x8aa8('0x3d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x3e'));db[_0x8aa8('0x3f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/dashboard/dashboard.model');db[_0x8aa8('0x40')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db[_0x8aa8('0x41')]=db['sequelize']['import'](_0x8aa8('0x42'));db['FaxApplication']=db[_0x8aa8('0x1')]['import']('../api/faxApplication/faxApplication.model');db[_0x8aa8('0x43')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x44'));db[_0x8aa8('0x45')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/faxMessage/faxMessage.model');db[_0x8aa8('0x46')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x47'));db[_0x8aa8('0x48')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x49'));db['SmsAccount']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x4a'));db['SmsApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4b'));db['SmsInteraction']=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0x8aa8('0x4c')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x4d'));db[_0x8aa8('0x4e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x4f'));db[_0x8aa8('0x50')]=db['sequelize']['import'](_0x8aa8('0x51'));db['OpenchannelApplication']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x52'));db[_0x8aa8('0x53')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x54'));db[_0x8aa8('0x55')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x56'));db[_0x8aa8('0x57')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8aa8('0x58')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db[_0x8aa8('0x59')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5a'));db[_0x8aa8('0x5b')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x5c'));db[_0x8aa8('0x5d')]=db[_0x8aa8('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x8aa8('0x5e')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x5f'));db['ChatOfflineMessage']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x60'));db[_0x8aa8('0x61')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x62'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db[_0x8aa8('0x63')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x64'));db['CmCompany']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x65'));db['CmContact']=db['sequelize']['import'](_0x8aa8('0x66'));db[_0x8aa8('0x67')]=db['sequelize']['import'](_0x8aa8('0x68'));db[_0x8aa8('0x69')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x6a'));db['CmHopperFinal']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6b'));db['CmHopperHistory']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x6c'));db[_0x8aa8('0x6d')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x6e'));db[_0x8aa8('0x6f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x8aa8('0x70')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x71'));db[_0x8aa8('0x72')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x73'));db[_0x8aa8('0x74')]=db[_0x8aa8('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x75'));db[_0x8aa8('0x76')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x77'));db[_0x8aa8('0x78')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x79'));db[_0x8aa8('0x7a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7b'));db[_0x8aa8('0x7c')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7d'));db['VoiceQueuesLog']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x7e'));db[_0x8aa8('0x7f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x80'));db[_0x8aa8('0x81')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x82'));db[_0x8aa8('0x83')]=db['sequelize'][_0x8aa8('0x13')]('../api/tag/tag.model');db[_0x8aa8('0x84')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x85'));db[_0x8aa8('0x86')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x87'));db[_0x8aa8('0x88')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x89'));db[_0x8aa8('0x8a')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8b'));db[_0x8aa8('0x8c')]=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8aa8('0x8d')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x8e'));db[_0x8aa8('0x8f')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x90'));db[_0x8aa8('0x91')]=db['sequelize'][_0x8aa8('0x13')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x92'));db['AnalyticTreeReport']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x93'));db[_0x8aa8('0x94')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x95'));db['SalesforceConfiguration']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x96'));db[_0x8aa8('0x97')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x98'));db[_0x8aa8('0x99')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0x9a'));db[_0x8aa8('0x9b')]=db['sequelize']['import'](_0x8aa8('0x9c'));db[_0x8aa8('0x9d')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x9e'));db[_0x8aa8('0x9f')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x8aa8('0xa0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa1'));db['DeskField']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa2'));db[_0x8aa8('0xa3')]=db['sequelize'][_0x8aa8('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa4'));db[_0x8aa8('0xa5')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xa6'));db[_0x8aa8('0xa7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xa8'));db[_0x8aa8('0xa9')]=db['sequelize']['import'](_0x8aa8('0xaa'));db['ZendeskField']=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xab'));db[_0x8aa8('0xac')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xad'));db[_0x8aa8('0xae')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xaf'));db[_0x8aa8('0xb0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb1'));db[_0x8aa8('0xb2')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb3'));db[_0x8aa8('0xb4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xb5'));db['ServicenowConfiguration']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xb6'));db[_0x8aa8('0xb7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xb8'));db[_0x8aa8('0xb9')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xba'));db[_0x8aa8('0xbb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbc'));db[_0x8aa8('0xbd')]=db['sequelize'][_0x8aa8('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8aa8('0xbe')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xbf'));db[_0x8aa8('0xc0')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xc1'));db[_0x8aa8('0xc2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc3'));db[_0x8aa8('0x8a')]=db['sequelize']['import'](_0x8aa8('0xc4'));db[_0x8aa8('0xc5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xc6'));db[_0x8aa8('0xc7')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x8aa8('0xc8')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xc9'));db['JscriptyAnswerReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xca'));db[_0x8aa8('0xcb')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x8aa8('0xcc')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xcd'));db[_0x8aa8('0xce')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xcf'));db[_0x8aa8('0xd0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd1'));db[_0x8aa8('0xd2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd3'));db['JscriptyProject']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xd4'));db[_0x8aa8('0xd5')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xd6'));db['SquareOdbc']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xd7'));db[_0x8aa8('0xd8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/squareProject/squareProject.model');db[_0x8aa8('0xd9')]=db[_0x8aa8('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x8aa8('0xda')]=db['sequelize']['import'](_0x8aa8('0xdb'));db[_0x8aa8('0xdc')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xdd'));db[_0x8aa8('0xde')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xdf'));db[_0x8aa8('0xe0')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe1'));db[_0x8aa8('0xe2')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xe3'));db[_0x8aa8('0xe4')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xe5'));db[_0x8aa8('0xe6')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xe7'));db[_0x8aa8('0xe8')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x8aa8('0xe9')]=db[_0x8aa8('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x8aa8('0xea')]=db['sequelize'][_0x8aa8('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xeb'));db[_0x8aa8('0xec')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xed'));db[_0x8aa8('0xee')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xef'));db['VoicePrefix']=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf0'));db[_0x8aa8('0xf1')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize']['import'](_0x8aa8('0xf2'));db[_0x8aa8('0xf3')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0xf4'));db[_0x8aa8('0xf5')]=db['sequelize']['import'](_0x8aa8('0xf6'));db[_0x8aa8('0xf7')]=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xf8'));db['WhatsappApplication']=db[_0x8aa8('0x1')][_0x8aa8('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x8aa8('0xf9')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfa'));db['WhatsappMessage']=db[_0x8aa8('0x1')]['import'](_0x8aa8('0xfb'));db[_0x8aa8('0xfc')]=db[_0x8aa8('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8aa8('0xfd')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0xfe'));db[_0x8aa8('0xff')]=db['sequelize'][_0x8aa8('0x13')](_0x8aa8('0x100'));db[_0x8aa8('0x101')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x102'));db[_0x8aa8('0x103')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x104'));db[_0x8aa8('0x105')]=db['sequelize'][_0x8aa8('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x8aa8('0x106')]=db[_0x8aa8('0x1')][_0x8aa8('0x13')](_0x8aa8('0x107'));db[_0x8aa8('0x12')][_0x8aa8('0x108')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x1c')],{'as':'Recordings','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x10b')],{'as':_0x8aa8('0x10c'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'UserId'});db['User'][_0x8aa8('0x10a')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x8aa8('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'foreignKey':_0x8aa8('0x109')});db['User'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x109')});db['User']['hasMany'](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x116'),'foreignKey':'UserId'});db[_0x8aa8('0x12')][_0x8aa8('0x10a')](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x117'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x12')]['hasMany'](db[_0x8aa8('0xf5')],{'as':_0x8aa8('0x118'),'foreignKey':'SenderId'});db[_0x8aa8('0x12')]['belongsTo'](db[_0x8aa8('0xf1')],{'as':_0x8aa8('0xf1'),'foreignKey':_0x8aa8('0x119')});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x8aa8('0x11a')});db[_0x8aa8('0x12')]['belongsToMany'](db[_0x8aa8('0x11b')],{'as':'Contacts','through':_0x8aa8('0x11c')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x11e')});db['User'][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x11f')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x37')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x112'),'through':_0x8aa8('0x120')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'as':'FaxInteractions','through':_0x8aa8('0x121')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'through':_0x8aa8('0x122')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'through':_0x8aa8('0x123')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'as':'WhatsappInteractions','through':_0x8aa8('0x124')});db[_0x8aa8('0x12')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x8aa8('0x2a'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['VoicePrefix'],{'as':_0x8aa8('0x125'),'through':_0x8aa8('0x106'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'as':_0x8aa8('0x126'),'through':_0x8aa8('0x127'),'required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x61')],{'as':_0x8aa8('0x128'),'through':_0x8aa8('0x2c'),'required':![],'hooks':!![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x46')],{'as':'FaxQueues','through':_0x8aa8('0x2f'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x4e')],{'as':'SmsQueues','through':_0x8aa8('0x129'),'required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x57')],{'as':_0x8aa8('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'through':_0x8aa8('0x11e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x58')],{'as':'ChatWebsites','through':_0x8aa8('0x12b')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x41')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12d'),'through':'user_has_mail_accounts'});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0x50')],{'as':'OpenchannelAccounts','through':_0x8aa8('0x12e')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db[_0x8aa8('0x12f')],{'as':'SmsAccounts','through':_0x8aa8('0x130')});db['User'][_0x8aa8('0x11d')](db[_0x8aa8('0xf7')],{'as':'WhatsappAccounts','through':_0x8aa8('0x131')});db[_0x8aa8('0x12')][_0x8aa8('0x11d')](db['SquareProject'],{'as':_0x8aa8('0x132'),'through':'user_has_square_projects'});db[_0x8aa8('0x15')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x133'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x134')});db['VoiceContext'][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x16')]['hasMany'](db[_0x8aa8('0x16')],{'as':'Applications','onDelete':_0x8aa8('0x10e')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x8aa8('0x81')],{'as':_0x8aa8('0x135'),'through':_0x8aa8('0x136')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db['UserVoiceQueueRt'],{'as':_0x8aa8('0x137'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0x13a')],{'as':'HopperHistories','foreignKey':_0x8aa8('0x138')});db['VoiceQueue'][_0x8aa8('0x10a')](db[_0x8aa8('0x6d')],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':_0x8aa8('0x13b'),'foreignKey':'VoiceQueueId'});db[_0x8aa8('0x1a')]['hasMany'](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x138')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db['Trunk'],{'as':_0x8aa8('0x26'),'foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0x1a')]['belongsTo'](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x13f'),'foreignKey':_0x8aa8('0x140')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x78'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1a')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x1a')]['belongsToMany'](db[_0x8aa8('0xee')],{'as':'Lists','through':_0x8aa8('0x143')});db[_0x8aa8('0x1a')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2a')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xdc')],{'as':_0x8aa8('0x145'),'through':_0x8aa8('0x103')});db['VoiceQueue']['belongsToMany'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'voice_queues_has_cm_blacklists'});db[_0x8aa8('0x1c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x1e')][_0x8aa8('0x10a')](db[_0x8aa8('0x1f')],{'as':_0x8aa8('0x147'),'onDelete':'cascade','foreignKey':_0x8aa8('0x148'),'sourceKey':'mailbox'});db[_0x8aa8('0x1f')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x8aa8('0x148'),'targetKey':'mailbox'});db[_0x8aa8('0x149')][_0x8aa8('0x10a')](db[_0x8aa8('0x14a')],{'as':_0x8aa8('0x14b'),'foreignKey':'uniqueid','constraints':![]});db[_0x8aa8('0x149')]['hasMany'](db[_0x8aa8('0x14c')],{'as':'AgentReports','foreignKey':_0x8aa8('0x14d'),'constraints':![]});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x12'),'foreignKey':'UserId'});db[_0x8aa8('0x149')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x14f')]['belongsTo'](db['MailAccount'],{'as':_0x8aa8('0x12c'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x33')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasOne'](db[_0x8aa8('0x14f')],{'as':_0x8aa8('0x151'),'onDelete':'cascade'});db[_0x8aa8('0x12c')][_0x8aa8('0x108')](db[_0x8aa8('0x33')],{'as':_0x8aa8('0x152'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x150'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x12c')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x39')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x12c')][_0x8aa8('0x10a')](db[_0x8aa8('0x37')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x12c')]['hasMany'](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x157')});db['MailAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x84')],{'as':_0x8aa8('0x84'),'foreignKey':_0x8aa8('0x159')});db['MailAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db['MailAccount'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x15b')});db[_0x8aa8('0x35')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x127')});db[_0x8aa8('0x35')]['belongsToMany'](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x145')});db[_0x8aa8('0x37')][_0x8aa8('0x10a')](db[_0x8aa8('0x39')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':'MailInteractionId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db['MailAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':'MailAccountId'});db[_0x8aa8('0x37')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailInteraction']['belongsTo'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x37')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':'Tags'});db[_0x8aa8('0x37')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x160'),'as':_0x8aa8('0x161')});db['MailInteraction'][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x8aa8('0x39')][_0x8aa8('0x10a')](db[_0x8aa8('0xe4')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x8aa8('0x12')],{'as':'User'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db['MailMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x37')],{'as':'Interaction','foreignKey':_0x8aa8('0x163')});db[_0x8aa8('0x39')]['belongsTo'](db[_0x8aa8('0x12c')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x58'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x39')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':_0x8aa8('0x165')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x8aa8('0x12c')],{'onDelete':_0x8aa8('0x166')});db['MailApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':'restrict','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x3b')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':'ListId'});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailInteraction'],{});db['MailQueueReport'][_0x8aa8('0x13d')](db['MailMessage'],{});db[_0x8aa8('0x3d')]['belongsTo'](db[_0x8aa8('0x12')],{});db[_0x8aa8('0x3d')][_0x8aa8('0x13d')](db[_0x8aa8('0x35')],{});db[_0x8aa8('0x3f')][_0x8aa8('0x10a')](db[_0x8aa8('0x40')],{'as':'Items','onDelete':'cascade'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x168'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':'Answers','foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxInteraction'],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'Applications'});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x16a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x41')][_0x8aa8('0x10a')](db['FaxMessage'],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':_0x8aa8('0x26')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x41')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0x41')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x16c')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'restrict'});db[_0x8aa8('0x169')]['belongsTo'](db[_0x8aa8('0x46')],{'onDelete':_0x8aa8('0x166')});db['FaxApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x169')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x43')]['hasMany'](db[_0x8aa8('0x45')],{'as':'Messages','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x16d')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db['FaxInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x43')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':_0x8aa8('0x109')});db['FaxInteraction']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'fax_interaction_has_tags','as':_0x8aa8('0x16e')});db[_0x8aa8('0x43')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x16f'),'as':_0x8aa8('0x161')});db['FaxInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x121'),'foreignKey':_0x8aa8('0x16d')});db['FaxMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':'cascade','as':_0x8aa8('0x12')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x43')],{'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x16d')});db[_0x8aa8('0x45')]['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x45')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x168')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x2f')});db[_0x8aa8('0x46')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_fax_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['FaxQueueReport'][_0x8aa8('0x13d')](db['FaxInteraction'],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x45')],{});db[_0x8aa8('0x48')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db['FaxQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x74')],{'as':_0x8aa8('0x155'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x172')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x156')});db['SmsAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x12f')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db['SmsAccount'][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x12f')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'onDelete':_0x8aa8('0x166')});db['SmsApplication'][_0x8aa8('0x13d')](db[_0x8aa8('0x78')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x173')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x113')]['hasMany'](db[_0x8aa8('0x4c')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SmsInteractionId'});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x113')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x113')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x174'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x113')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':'user_has_sms_interactions','foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['User'],{'as':'User'});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db['CmContact'],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x4c')]['belongsTo'](db[_0x8aa8('0x113')],{'onDelete':'cascade','as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x175')});db[_0x8aa8('0x4c')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x172')});db[_0x8aa8('0x4e')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x176'),'as':_0x8aa8('0x145')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x177'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x50')]['hasMany'](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x156'),'foreignKey':_0x8aa8('0x177')});db['OpenchannelAccount'][_0x8aa8('0x10a')](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['hasMany'](db[_0x8aa8('0x178')],{'as':_0x8aa8('0x157'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x50')]['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x50')][_0x8aa8('0x13d')](db[_0x8aa8('0x7a')],{'as':_0x8aa8('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x50')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x57')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x178')]['belongsTo'](db[_0x8aa8('0x50')],{'onDelete':_0x8aa8('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':'IntervalId'});db[_0x8aa8('0x178')][_0x8aa8('0x13d')](db[_0x8aa8('0x83')],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0x53')]['hasMany'](db[_0x8aa8('0x55')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x17a')});db['OpenchannelInteraction']['belongsTo'](db[_0x8aa8('0x50')],{'as':'Account','foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0x53')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'UserId'});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x16e')});db['OpenchannelInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x17b'),'as':_0x8aa8('0x161')});db[_0x8aa8('0x53')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x162'),'through':'user_has_openchannel_interactions','foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'as':'User'});db['OpenchannelMessage'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':'Contact'});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x17a')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x55')][_0x8aa8('0x13d')](db['OpenchannelAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x177')});db[_0x8aa8('0x57')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x31'),'foreignKey':_0x8aa8('0x179')});db[_0x8aa8('0x57')]['belongsToMany'](db['Team'],{'through':_0x8aa8('0x17c'),'as':_0x8aa8('0x145')});db['ChatWebsite']['hasMany'](db[_0x8aa8('0x153')],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x17d')});db['ChatWebsite'][_0x8aa8('0x10a')](db[_0x8aa8('0x63')],{'as':'ProactiveActions'});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5d')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0x58')][_0x8aa8('0x10a')](db[_0x8aa8('0x5b')],{'as':_0x8aa8('0x157')});db[_0x8aa8('0x58')]['hasMany'](db[_0x8aa8('0x5e')],{'as':_0x8aa8('0x147')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x58')]['belongsTo'](db[_0x8aa8('0x78')],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db['ChatWebsite'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'as':_0x8aa8('0x12c'),'foreignKey':_0x8aa8('0x150')});db[_0x8aa8('0x58')][_0x8aa8('0x13d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8aa8('0x58')]['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x12b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{});db[_0x8aa8('0x59')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db[_0x8aa8('0x53')],{});db[_0x8aa8('0x59')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x8aa8('0x59')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0x59')]['belongsTo'](db[_0x8aa8('0x57')],{});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':_0x8aa8('0x109'),'onDelete':_0x8aa8('0x166')});db['ChatApplication'][_0x8aa8('0x13d')](db['ChatQueue'],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x180'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x181'),'foreignKey':_0x8aa8('0x17d'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x5b')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db['ChatInteraction'][_0x8aa8('0x10a')](db['ChatMessage'],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x182')});db['ChatInteraction']['belongsTo'](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':'ChatWebsiteId'});db[_0x8aa8('0x5d')]['belongsTo'](db[_0x8aa8('0x11b')],{'as':'Contact','foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x5d')][_0x8aa8('0x13d')](db['User'],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':'Tags'});db[_0x8aa8('0x5d')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x183'),'as':_0x8aa8('0x161')});db['ChatInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x120'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['User'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x12')});db['ChatMessage']['belongsTo'](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db['ChatMessage'][_0x8aa8('0x13d')](db['ChatInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x170'),'foreignKey':_0x8aa8('0x182')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db[_0x8aa8('0xe4')],{'as':_0x8aa8('0xe4'),'foreignKey':_0x8aa8('0x171')});db[_0x8aa8('0x5e')][_0x8aa8('0x13d')](db['ChatWebsite'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x164')][_0x8aa8('0x10a')](db['Attachment'],{'as':_0x8aa8('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':_0x8aa8('0x10e'),'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x164')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x2c'),'hooks':!![]});db[_0x8aa8('0x61')][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':'team_has_chat_queues','as':_0x8aa8('0x145')});db[_0x8aa8('0x185')][_0x8aa8('0x10a')](db[_0x8aa8('0xc8')],{'as':_0x8aa8('0x147'),'foreignKey':'ChatGroupId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x185')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0x8aa8('0x63')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'as':'Website','foreignKey':_0x8aa8('0x17d')});db[_0x8aa8('0x186')][_0x8aa8('0x10a')](db[_0x8aa8('0x11b')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'ContactId'});db['CmContact'][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':_0x8aa8('0x15e')});db['CmContact'][_0x8aa8('0x10a')](db[_0x8aa8('0xcc')],{'as':_0x8aa8('0x13c'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x53')],{'as':_0x8aa8('0x111'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db['ChatInteraction'],{'as':_0x8aa8('0x112'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x10a')](db[_0x8aa8('0x113')],{'as':_0x8aa8('0x114'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')]['hasMany'](db['FaxInteraction'],{'as':_0x8aa8('0x115'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x166')});db['CmContact'][_0x8aa8('0x10a')](db['MailInteraction'],{'as':_0x8aa8('0x116'),'foreignKey':'ContactId','onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x11b')][_0x8aa8('0x13d')](db[_0x8aa8('0x186')],{'as':_0x8aa8('0x188'),'foreignKey':'CompanyId'});db[_0x8aa8('0x11b')]['belongsTo'](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':'ListId','onDelete':_0x8aa8('0x10e')});db['CmContact']['belongsToMany'](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x162'),'through':_0x8aa8('0x11c')});db['CmContact'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'as':'Tags','through':_0x8aa8('0x189')});db[_0x8aa8('0x11b')][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x189'),'as':_0x8aa8('0x161')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x67')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x17e'),'foreignKey':'UserId'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0x1a')],{'as':_0x8aa8('0x17f'),'foreignKey':_0x8aa8('0x138'),'onDelete':'cascade'});db[_0x8aa8('0x67')]['belongsTo'](db[_0x8aa8('0xe0')],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db['CmHopper'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x15f'),'foreignKey':'OwnerId'});db[_0x8aa8('0x69')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8aa8('0x1a')],{'as':'Queue','foreignKey':_0x8aa8('0x138'),'onDelete':_0x8aa8('0x10e')});db['CmHopperBlack'][_0x8aa8('0x13d')](db['Campaign'],{'as':_0x8aa8('0xe0'),'foreignKey':_0x8aa8('0x18a'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18b'),'singular':_0x8aa8('0x18c')},'foreignKey':_0x8aa8('0x18d'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x18e'),'singular':_0x8aa8('0x18f')},'foreignKey':'AutomationAnyId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x72')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':_0x8aa8('0x190'),'foreignKey':'AutomationId','onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x153')][_0x8aa8('0x10a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8aa8('0x191'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x78')]['hasMany'](db[_0x8aa8('0x78')],{'as':_0x8aa8('0x192'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x10e'),'hooks':!![],'required':![]});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x16')],{'as':_0x8aa8('0x10d'),'foreignKey':_0x8aa8('0x141'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x3b')],{'as':_0x8aa8('0x193'),'foreignKey':'IntervalId'});db['Interval'][_0x8aa8('0x10a')](db['ChatApplication'],{'as':_0x8aa8('0x194'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x169')],{'as':'FaxApplications','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x78')][_0x8aa8('0x10a')](db[_0x8aa8('0x173')],{'as':_0x8aa8('0x195'),'foreignKey':'IntervalId'});db['Schedule'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db['AnalyticDefaultReport'],{'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x7f')][_0x8aa8('0x13d')](db[_0x8aa8('0x8c')],{'foreignKey':_0x8aa8('0x197')});db['Sound'][_0x8aa8('0x11d')](db[_0x8aa8('0x18')],{'as':_0x8aa8('0x198'),'through':_0x8aa8('0x136'),'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x11b')],{'through':_0x8aa8('0x189')});db[_0x8aa8('0x83')]['belongsToMany'](db[_0x8aa8('0x5d')],{'through':_0x8aa8('0x183')});db['Tag']['belongsToMany'](db[_0x8aa8('0x37')],{'through':_0x8aa8('0x160')});db['Tag'][_0x8aa8('0x11d')](db[_0x8aa8('0x113')],{'through':_0x8aa8('0x174')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x43')],{'through':_0x8aa8('0x16f')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0x53')],{'through':_0x8aa8('0x17b')});db[_0x8aa8('0x83')][_0x8aa8('0x11d')](db[_0x8aa8('0xf9')],{'through':_0x8aa8('0x199')});db['Trigger'][_0x8aa8('0x10a')](db['Condition'],{'as':{'plural':_0x8aa8('0x19a'),'singular':_0x8aa8('0x19b')},'foreignKey':_0x8aa8('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x76')],{'as':{'plural':_0x8aa8('0x19d'),'singular':_0x8aa8('0x19e')},'foreignKey':_0x8aa8('0x19f'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x86')][_0x8aa8('0x10a')](db[_0x8aa8('0x70')],{'as':'Actions','foreignKey':_0x8aa8('0x1a0'),'onDelete':_0x8aa8('0x10e'),'hooks':!![]});db[_0x8aa8('0x8c')][_0x8aa8('0x10a')](db['AnalyticFieldReport'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x197'),'hooks':!![]});db[_0x8aa8('0x8d')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x196')});db[_0x8aa8('0x91')][_0x8aa8('0x10a')](db[_0x8aa8('0x1a2')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a3')});db[_0x8aa8('0x1a2')][_0x8aa8('0x13d')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x8aa8('0x94')][_0x8aa8('0x10a')](db['SalesforceConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1a5')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db['SalesforceConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1a5')][_0x8aa8('0x13d')](db[_0x8aa8('0x94')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db['SalesforceField'][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x97')][_0x8aa8('0x10a')](db[_0x8aa8('0x97')],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db['SalesforceField']['hasMany'](db[_0x8aa8('0x97')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x97')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':'VariableId'});db[_0x8aa8('0x99')][_0x8aa8('0x10a')](db[_0x8aa8('0x9b')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x9b')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9b')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['SugarcrmField'][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':_0x8aa8('0x1ab'),'foreignKey':'SubjectId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db['SugarcrmField'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x9d')][_0x8aa8('0x10a')](db[_0x8aa8('0x9d')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x9d')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x9f')][_0x8aa8('0x10a')](db[_0x8aa8('0xa0')],{'as':'Configurations','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa0')]['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa0')][_0x8aa8('0x10a')](db['DeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xa0')][_0x8aa8('0x13d')](db[_0x8aa8('0x9f')],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa0')][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x1b0')});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0x1af')][_0x8aa8('0x10a')](db[_0x8aa8('0x1af')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1af')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8aa8('0xa3')][_0x8aa8('0x10a')](db['ZohoConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0x1b2')]['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a6'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a7')});db['ZohoConfiguration']['hasMany'](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b2')][_0x8aa8('0x10a')](db['ZohoField'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b2')][_0x8aa8('0x13d')](db[_0x8aa8('0xa3')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xa5')][_0x8aa8('0x10a')](db[_0x8aa8('0xa5')],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xa5')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xa5')]['belongsTo'](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xa7')][_0x8aa8('0x10a')](db['ZendeskConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1ac')});db['ZendeskConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Descriptions','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xa9')][_0x8aa8('0x10a')](db[_0x8aa8('0x1b3')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db['ZendeskConfiguration']['belongsTo'](db[_0x8aa8('0xa7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xa9')]['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8aa8('0x10a')](db['ZendeskField'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b3')][_0x8aa8('0x10a')](db['ZendeskField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0x1b3')]['hasMany'](db[_0x8aa8('0x1b3')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0x1b3')][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b4')][_0x8aa8('0x10a')](db[_0x8aa8('0xac')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xac')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1a8'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xac')][_0x8aa8('0x10a')](db['FreshdeskField'],{'as':_0x8aa8('0x1a1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8aa8('0xac')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b4')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x8aa8('0x83')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xae')][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db['FreshdeskField'][_0x8aa8('0x10a')](db[_0x8aa8('0xae')],{'as':_0x8aa8('0x1b1'),'foreignKey':'FieldId'});db[_0x8aa8('0xae')][_0x8aa8('0x13d')](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0x1b5')]['hasMany'](db[_0x8aa8('0xb0')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a6'),'foreignKey':'SubjectId'});db[_0x8aa8('0xb0')][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['VtigerConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb2')],{'as':'Fields','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xb0')][_0x8aa8('0x13d')](db[_0x8aa8('0x1b5')],{'as':_0x8aa8('0x15d'),'foreignKey':'AccountId'});db[_0x8aa8('0xb2')]['hasMany'](db[_0x8aa8('0xb2')],{'as':'Subject','foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xb2')][_0x8aa8('0x10a')](db['VtigerField'],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb2')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8aa8('0xb2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb4')]['hasMany'](db[_0x8aa8('0x1b6')],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a6'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0x1b6')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':_0x8aa8('0x1a8'),'foreignKey':_0x8aa8('0x1a9')});db['ServicenowConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowConfiguration'][_0x8aa8('0x13d')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db['ServicenowField'],{'as':'Description','foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xb7')][_0x8aa8('0x10a')](db[_0x8aa8('0xb7')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xb9')][_0x8aa8('0x10a')](db['Dynamics365Configuration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1ac')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a6'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'SubjectId'});db[_0x8aa8('0xbb')]['hasMany'](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1a8'),'onDelete':'cascade','foreignKey':_0x8aa8('0x1a9')});db['Dynamics365Configuration'][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1a1'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'FieldId'});db[_0x8aa8('0xbb')]['belongsTo'](db['Dynamics365Account'],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db[_0x8aa8('0xbd')]['hasMany'](db['Dynamics365Field'],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db['Dynamics365Field'],{'as':_0x8aa8('0x1ad'),'foreignKey':'DescriptionId'});db[_0x8aa8('0xbd')][_0x8aa8('0x10a')](db[_0x8aa8('0xbd')],{'as':_0x8aa8('0x1b1'),'foreignKey':_0x8aa8('0x1aa')});db['Dynamics365Field'][_0x8aa8('0x13d')](db[_0x8aa8('0x88')],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xbe')][_0x8aa8('0x10a')](db['FreshsalesConfiguration'],{'as':_0x8aa8('0x1a4'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'AccountId'});db[_0x8aa8('0xc0')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':'Subjects','foreignKey':_0x8aa8('0x1a7')});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a8'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1a1'),'foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc0')][_0x8aa8('0x13d')](db[_0x8aa8('0xbe')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1ac')});db['FreshsalesField'][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ab'),'foreignKey':_0x8aa8('0x1a7')});db[_0x8aa8('0xc2')][_0x8aa8('0x10a')](db[_0x8aa8('0xc2')],{'as':_0x8aa8('0x1ad'),'foreignKey':_0x8aa8('0x1a9')});db[_0x8aa8('0xc2')]['hasMany'](db[_0x8aa8('0xc2')],{'as':'Field','foreignKey':_0x8aa8('0x1aa')});db[_0x8aa8('0xc2')]['belongsTo'](db['Variable'],{'as':_0x8aa8('0x88'),'foreignKey':_0x8aa8('0x1ae')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xc7')]['belongsTo'](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{});db[_0x8aa8('0xc7')][_0x8aa8('0x13d')](db[_0x8aa8('0x61')],{});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b7')});db[_0x8aa8('0xc8')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1b8')});db[_0x8aa8('0xcc')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1b9'),'onDelete':_0x8aa8('0x10e')});db['JscriptySessionReport'][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':'SessionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{});db[_0x8aa8('0xce')]['belongsTo'](db[_0x8aa8('0xee')],{'as':'List','foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['SmsQueueReport'][_0x8aa8('0x13d')](db['SmsInteraction'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db[_0x8aa8('0x4c')],{});db['SmsQueueReport'][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xce')][_0x8aa8('0x13d')](db['SmsQueue'],{});db[_0x8aa8('0x1bb')]['hasMany'](db[_0x8aa8('0xcc')],{'foreignKey':'ProjectId'});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0xcb')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0x1bb')][_0x8aa8('0x10a')](db[_0x8aa8('0x1ba')],{'foreignKey':_0x8aa8('0x1bc')});db[_0x8aa8('0xd8')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Users','through':_0x8aa8('0x1bd')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11f')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1a')],{'through':_0x8aa8('0x103'),'as':_0x8aa8('0x1be')});db['Team'][_0x8aa8('0x11d')](db[_0x8aa8('0x35')],{'through':_0x8aa8('0x15c'),'as':_0x8aa8('0x126')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x61')],{'through':_0x8aa8('0x1bf'),'as':_0x8aa8('0x128')});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0x46')],{'through':_0x8aa8('0x1c0'),'as':_0x8aa8('0x1c1')});db['Team']['belongsToMany'](db[_0x8aa8('0x4e')],{'through':'team_has_sms_queues','as':_0x8aa8('0x1c2')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db['OpenchannelQueue'],{'through':_0x8aa8('0x17c'),'as':'OpenchannelQueues'});db[_0x8aa8('0xdc')]['belongsToMany'](db[_0x8aa8('0xff')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x1c4')});db[_0x8aa8('0xdc')][_0x8aa8('0x11d')](db[_0x8aa8('0x1c5')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x67')],{'as':_0x8aa8('0x139'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db['CmHopperFinal'],{'as':_0x8aa8('0x110'),'foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x187'),'foreignKey':'CampaignId'});db['Campaign'][_0x8aa8('0x10a')](db[_0x8aa8('0x69')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0x26')],{'as':'Trunk','foreignKey':_0x8aa8('0x13e')});db[_0x8aa8('0xe0')]['belongsTo'](db[_0x8aa8('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x8aa8('0xe0')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0xe0')][_0x8aa8('0x13d')](db[_0x8aa8('0xd8')],{'as':_0x8aa8('0xd8'),'foreignKey':_0x8aa8('0x1c6')});db[_0x8aa8('0xe0')][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x1c7'),'through':_0x8aa8('0x1c8')});db['Campaign'][_0x8aa8('0x11d')](db[_0x8aa8('0xee')],{'as':_0x8aa8('0x146'),'through':'campaigns_has_cm_blacklists'});db[_0x8aa8('0xe4')][_0x8aa8('0x13d')](db[_0x8aa8('0x164')],{'as':_0x8aa8('0x164'),'foreignKey':'ChatOfflineMessageId'});db[_0x8aa8('0xe8')]['belongsTo'](db['MailMessage'],{});db[_0x8aa8('0xe8')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1c9'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xe8')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['User'],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db[_0x8aa8('0xe8')][_0x8aa8('0x13d')](db['MailQueue'],{'foreignKey':_0x8aa8('0x1cd'),'as':_0x8aa8('0x1ce')});db['MailTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12c')],{'foreignKey':_0x8aa8('0x1cf'),'as':_0x8aa8('0x1d0')});db['ChatTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x5e')],{});db[_0x8aa8('0xe9')]['belongsTo'](db[_0x8aa8('0x5d')],{});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d1'),'as':'FromAccount'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['User'],{'foreignKey':_0x8aa8('0x1cb'),'as':'FromAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x8aa8('0x1ce')});db[_0x8aa8('0xe9')][_0x8aa8('0x13d')](db[_0x8aa8('0x58')],{'foreignKey':_0x8aa8('0x1d2'),'as':_0x8aa8('0x1d0')});db['FaxTransferReport']['belongsTo'](db[_0x8aa8('0x45')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x43')],{});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x41')],{'foreignKey':_0x8aa8('0x1d3'),'as':'FromAccount'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xea')][_0x8aa8('0x13d')](db[_0x8aa8('0x46')],{'foreignKey':'ToFaxQueueId','as':_0x8aa8('0x1ce')});db['FaxTransferReport'][_0x8aa8('0x13d')](db['FaxAccount'],{'foreignKey':_0x8aa8('0x1d5'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x55')],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db['OpenchannelInteraction'],{});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x50')],{'foreignKey':_0x8aa8('0x1d7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1cb'),'as':_0x8aa8('0x1d8')});db[_0x8aa8('0x1d6')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'ToUserId','as':_0x8aa8('0x1cc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x8aa8('0x57')],{'foreignKey':_0x8aa8('0x1d9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0x1d6')]['belongsTo'](db[_0x8aa8('0x50')],{'foreignKey':'ToOpenchannelAccountId','as':_0x8aa8('0x1d0')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db['SmsMessage'],{});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x113')],{});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1da'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xec')]['belongsTo'](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db['SmsTransferReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x4e')],{'foreignKey':_0x8aa8('0x1db'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xec')][_0x8aa8('0x13d')](db[_0x8aa8('0x12f')],{'foreignKey':_0x8aa8('0x1dc'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x153')],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x6f')],{'as':_0x8aa8('0x1dd'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db['CmContact'],{'as':_0x8aa8('0x1de'),'onDelete':_0x8aa8('0x10e'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x10a')](db[_0x8aa8('0x10f')],{'as':_0x8aa8('0x110'),'foreignKey':_0x8aa8('0x16b')});db['CmList'][_0x8aa8('0x10a')](db[_0x8aa8('0x13a')],{'as':_0x8aa8('0x1df'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xee')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8aa8('0x6d'),'foreignKey':'ListId'});db[_0x8aa8('0xee')][_0x8aa8('0x11d')](db['VoiceQueue'],{'as':'Queues','through':_0x8aa8('0x143')});db[_0x8aa8('0xee')]['belongsToMany'](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x11e')});db[_0x8aa8('0x1c5')][_0x8aa8('0x10a')](db['VoiceExtension'],{'as':_0x8aa8('0x10d'),'onDelete':'cascade'});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':'Agents','through':_0x8aa8('0x106')});db[_0x8aa8('0x1c5')][_0x8aa8('0x11d')](db['Team'],{'through':_0x8aa8('0x105'),'as':'Teams'});db[_0x8aa8('0xf1')][_0x8aa8('0x10a')](db[_0x8aa8('0x12')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0x8aa8('0x1e0')],{'as':_0x8aa8('0x1e1'),'foreignKey':'userProfileId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0x1e0')][_0x8aa8('0x10a')](db[_0x8aa8('0xf3')],{'as':_0x8aa8('0x1e2'),'foreignKey':'sectionId','onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['Disposition'],{'as':_0x8aa8('0x154'),'foreignKey':_0x8aa8('0x1e3'),'onDelete':_0x8aa8('0x10e')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db['CannedAnswer'],{'as':_0x8aa8('0x155'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'foreignKey':_0x8aa8('0x1e3')});db['WhatsappAccount']['hasMany'](db[_0x8aa8('0xf9')],{'as':_0x8aa8('0x156')});db[_0x8aa8('0xf7')][_0x8aa8('0x10a')](db[_0x8aa8('0x1e5')],{'as':_0x8aa8('0x157')});db['WhatsappAccount'][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xf7')][_0x8aa8('0x13d')](db['Pause'],{'as':_0x8aa8('0x142'),'foreignKey':_0x8aa8('0x15a')});db[_0x8aa8('0xf7')][_0x8aa8('0x11d')](db[_0x8aa8('0x12')],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x131')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'onDelete':_0x8aa8('0x166')});db[_0x8aa8('0x1e5')]['belongsTo'](db['Interval'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x141')});db[_0x8aa8('0x1e5')][_0x8aa8('0x13d')](db['Tag'],{'onDelete':_0x8aa8('0x166'),'foreignKey':_0x8aa8('0x167')});db[_0x8aa8('0xf9')]['hasMany'](db[_0x8aa8('0x1e4')],{'as':_0x8aa8('0x147'),'onDelete':_0x8aa8('0x10e'),'foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':'Account','foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xf9')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'as':_0x8aa8('0x14e'),'foreignKey':_0x8aa8('0x15e')});db['WhatsappInteraction'][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'as':'Owner','foreignKey':_0x8aa8('0x109')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db['Tag'],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x16e')});db['WhatsappInteraction'][_0x8aa8('0x11d')](db[_0x8aa8('0x83')],{'through':_0x8aa8('0x199'),'as':_0x8aa8('0x161')});db['WhatsappInteraction']['belongsToMany'](db[_0x8aa8('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x8aa8('0x1e6')});db['WhatsappMessage'][_0x8aa8('0x13d')](db['User'],{'as':_0x8aa8('0x12')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0x11b')],{'onDelete':'cascade','as':_0x8aa8('0x14e')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db['WhatsappInteraction'],{'onDelete':_0x8aa8('0x10e'),'as':'Interaction','foreignKey':_0x8aa8('0x1e6')});db[_0x8aa8('0x1e4')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'as':_0x8aa8('0x15d'),'foreignKey':_0x8aa8('0x1e3')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmList'],{'as':_0x8aa8('0x158'),'foreignKey':_0x8aa8('0x16b')});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['CmContact'],{'as':_0x8aa8('0x14e'),'foreignKey':'ContactId'});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfc')]['belongsTo'](db[_0x8aa8('0xff')],{});db['WhatsappQueueReport'][_0x8aa8('0x13d')](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfc')][_0x8aa8('0x13d')](db['User'],{});db[_0x8aa8('0xfd')]['belongsTo'](db[_0x8aa8('0x1e4')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf9')],{});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e7'),'as':_0x8aa8('0x1ca')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xf7')],{'foreignKey':_0x8aa8('0x1e8'),'as':_0x8aa8('0x1d0')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0xff')],{'foreignKey':_0x8aa8('0x1e9'),'as':_0x8aa8('0x1ce')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':'FromUserId','as':_0x8aa8('0x1d8')});db[_0x8aa8('0xfd')][_0x8aa8('0x13d')](db[_0x8aa8('0x12')],{'foreignKey':_0x8aa8('0x1d4'),'as':_0x8aa8('0x1cc')});db[_0x8aa8('0xff')][_0x8aa8('0x11d')](db['User'],{'as':_0x8aa8('0x144'),'through':_0x8aa8('0x32'),'foreignKey':_0x8aa8('0x1ea')});db['WhatsappQueue'][_0x8aa8('0x11d')](db[_0x8aa8('0xdc')],{'through':_0x8aa8('0x1c3'),'as':_0x8aa8('0x145')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x0713=['../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','VoiceMail','cascade','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','SpiedAgents','ChanSpyId','Sounds','Members','VoiceQueueId','JscriptySessionReport','JscriptySessions','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccount','MailAccountId','Dispositions','Answers','MailMessage','Interactions','List','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','DashboardItem','FaxAccountId','Applications','Exntensions','mandatoryDispositionPauseId','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','AttachmentId','team_has_chat_queues','ChatGroupId','ChatGroup','Contacts','CompanyId','HopperHistories','CmCompany','cm_user_has_contacts','cm_contact_has_tags','Agent','OwnerId','CampaignId','All','OneAll','AutomationAllId','Any','Actions','ParentId','Intervals','MailApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','VoiceMusicOnHold','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','VariableId','Subject','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','JscriptyProject','ProjectId','JscriptyQuestionReport','user_has_square_projects','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','Hoppers','TrunkId','SquareProjectId','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromAccount','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromUserId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue'];(function(_0x2eb06c,_0x32c77f){var _0x4f25da=function(_0x42f6c4){while(--_0x42f6c4){_0x2eb06c['push'](_0x2eb06c['shift']());}};_0x4f25da(++_0x32c77f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x3071('0x0'));var jstz=require(_0x3071('0x1'));var timezone=jstz[_0x3071('0x2')]();config[_0x3071('0x3')]=_[_0x3071('0x4')](config['sequelize'],{'database':_0x3071('0x5'),'username':_0x3071('0x6'),'password':_0x3071('0x7'),'options':{'host':_0x3071('0x8'),'port':0xcea,'dialect':_0x3071('0x9'),'dialectOptions':{'charset':_0x3071('0xa')},'logging':![],'timezone':timezone[_0x3071('0xb')](),'define':{'charset':_0x3071('0xc'),'collate':_0x3071('0xd')}}});config[_0x3071('0xe')]=_[_0x3071('0x4')](config[_0x3071('0xe')],{'database':_0x3071('0x5'),'username':'xcall','password':_0x3071('0x7'),'options':{'host':_0x3071('0x8'),'port':0xcea,'dialect':_0x3071('0x9'),'dialectOptions':{'charset':_0x3071('0xa')},'logging':![],'timezone':timezone[_0x3071('0xb')](),'define':{'charset':'utf8','collate':_0x3071('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3071('0x3')][_0x3071('0xf')],config[_0x3071('0x3')][_0x3071('0x10')],config['sequelize']['password'],config[_0x3071('0x3')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3071('0xe')][_0x3071('0xf')],config['sequelizeHistory'][_0x3071('0x10')],config['sequelizeHistory'][_0x3071('0x11')],config[_0x3071('0xe')][_0x3071('0x12')])};db[_0x3071('0x13')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x15'));db[_0x3071('0x16')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x3071('0x17')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x18'));db[_0x3071('0x19')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1a'));db['VoiceMusicOnHold']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1b'));db['VoiceQueue']=db[_0x3071('0x3')]['import'](_0x3071('0x1c'));db[_0x3071('0x1d')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x1e'));db[_0x3071('0x1f')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x20'));db[_0x3071('0x21')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x22'));db[_0x3071('0x23')]=db[_0x3071('0x3')]['import'](_0x3071('0x24'));db[_0x3071('0x25')]=db[_0x3071('0x3')]['import'](_0x3071('0x26'));db[_0x3071('0x27')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x28'));db[_0x3071('0x29')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2a'));db[_0x3071('0x2b')]=db[_0x3071('0x3')]['import']('../api/memberReport/memberReport.model');db[_0x3071('0x2c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2d'));db[_0x3071('0x2e')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x2f'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0x3071('0x30'));db[_0x3071('0x31')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x32'));db[_0x3071('0x33')]=db[_0x3071('0x3')]['import'](_0x3071('0x34'));db[_0x3071('0x35')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x36'));db[_0x3071('0x37')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x3071('0x38')]=db['sequelize']['import'](_0x3071('0x39'));db[_0x3071('0x3a')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x3b'));db[_0x3071('0x3c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x3d'));db['MailServerIn']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x3071('0x3e')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x3f'));db['MailAccount']=db['sequelize'][_0x3071('0x14')](_0x3071('0x40'));db[_0x3071('0x41')]=db['sequelize'][_0x3071('0x14')]('../api/mailQueue/mailQueue.model');db[_0x3071('0x42')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x43'));db[_0x3071('0x44')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x45'));db[_0x3071('0x46')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x47'));db[_0x3071('0x48')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x49'));db['Dashboard']=db[_0x3071('0x3')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x3071('0x14')](_0x3071('0x4a'));db[_0x3071('0x4b')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x4c'));db[_0x3071('0x4d')]=db[_0x3071('0x3')]['import'](_0x3071('0x4e'));db[_0x3071('0x4f')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x50'));db['FaxMessage']=db['sequelize'][_0x3071('0x14')](_0x3071('0x51'));db[_0x3071('0x52')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/faxQueue/faxQueue.model');db[_0x3071('0x53')]=db['sequelize'][_0x3071('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x3071('0x3')]['import'](_0x3071('0x54'));db['SmsApplication']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x55'));db[_0x3071('0x56')]=db['sequelize'][_0x3071('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x3071('0x57')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x58'));db['SmsQueue']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x59'));db[_0x3071('0x5a')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x5b'));db['OpenchannelApplication']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x5c'));db[_0x3071('0x5d')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x5e'));db[_0x3071('0x5f')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x60'));db[_0x3071('0x61')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x62'));db[_0x3071('0x63')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x64'));db[_0x3071('0x65')]=db[_0x3071('0x3')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x3071('0x66')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x67'));db[_0x3071('0x68')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x69'));db['ChatMessage']=db['sequelize'][_0x3071('0x14')](_0x3071('0x6a'));db[_0x3071('0x6b')]=db[_0x3071('0x3')]['import'](_0x3071('0x6c'));db[_0x3071('0x6d')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x6e'));db['ChatGroup']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x6f'));db[_0x3071('0x70')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x71'));db['CmCompany']=db['sequelize'][_0x3071('0x14')]('../api/cmCompany/cmCompany.model');db[_0x3071('0x72')]=db[_0x3071('0x3')]['import'](_0x3071('0x73'));db[_0x3071('0x74')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x75'));db[_0x3071('0x76')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x3071('0x77')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x3071('0x78')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x79'));db[_0x3071('0x7a')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x7b'));db[_0x3071('0x7c')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x7d'));db[_0x3071('0x7e')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x7f'));db[_0x3071('0x80')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x81'));db[_0x3071('0x82')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x83'));db[_0x3071('0x84')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x85'));db[_0x3071('0x86')]=db[_0x3071('0x3')]['import'](_0x3071('0x87'));db[_0x3071('0x88')]=db['sequelize']['import'](_0x3071('0x89'));db[_0x3071('0x8a')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x3071('0x3')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db['sequelize'][_0x3071('0x14')](_0x3071('0x8b'));db[_0x3071('0x8c')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x8d'));db[_0x3071('0x8e')]=db[_0x3071('0x3')]['import'](_0x3071('0x8f'));db[_0x3071('0x90')]=db['sequelize'][_0x3071('0x14')](_0x3071('0x91'));db[_0x3071('0x92')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x93'));db[_0x3071('0x94')]=db['sequelize']['import'](_0x3071('0x95'));db[_0x3071('0x96')]=db[_0x3071('0x3')]['import']('../api/variable/variable.model');db[_0x3071('0x97')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x98'));db[_0x3071('0x99')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x9a'));db['AnalyticCustomReport']=db[_0x3071('0x3')]['import'](_0x3071('0x9b'));db[_0x3071('0x9c')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x9d'));db[_0x3071('0x9e')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3071('0x9f')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x3071('0xa0')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x3071('0x3')]['import'](_0x3071('0xa1'));db[_0x3071('0xa2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xa3'));db[_0x3071('0xa4')]=db[_0x3071('0x3')]['import'](_0x3071('0xa5'));db[_0x3071('0xa6')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xa7'));db[_0x3071('0xa8')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x3071('0xa9')]=db['sequelize'][_0x3071('0x14')](_0x3071('0xaa'));db[_0x3071('0xab')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xac'));db[_0x3071('0xad')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xae'));db['DeskConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3071('0xaf')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb0'));db[_0x3071('0xb1')]=db['sequelize']['import'](_0x3071('0xb2'));db['ZohoConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb3'));db[_0x3071('0xb4')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intZohoField/intZohoField.model');db[_0x3071('0xb5')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb6'));db['ZendeskConfiguration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3071('0xb7')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xb8'));db[_0x3071('0xb9')]=db['sequelize'][_0x3071('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x3071('0xba')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbb'));db[_0x3071('0xbc')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbd'));db['VtigerAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xbe'));db['VtigerConfiguration']=db[_0x3071('0x3')]['import'](_0x3071('0xbf'));db[_0x3071('0xc0')]=db[_0x3071('0x3')]['import'](_0x3071('0xc1'));db[_0x3071('0xc2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc3'));db[_0x3071('0xc4')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc5'));db['ServicenowField']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc6'));db['Dynamics365Account']=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x3071('0xc7')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xc8'));db[_0x3071('0xc9')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xca'));db['FreshsalesField']=db['sequelize'][_0x3071('0x14')](_0x3071('0xcb'));db[_0x3071('0x97')]=db[_0x3071('0x3')]['import'](_0x3071('0x98'));db[_0x3071('0xcc')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xcd'));db[_0x3071('0xce')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3071('0xcf')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd0'));db[_0x3071('0xd1')]=db['sequelize'][_0x3071('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd2'));db['JscriptySessionReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd3'));db[_0x3071('0xd4')]=db[_0x3071('0x3')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x3071('0xd5')]=db[_0x3071('0x3')]['import'](_0x3071('0xd6'));db[_0x3071('0xd7')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xd8'));db['JscriptyProject']=db[_0x3071('0x3')]['import'](_0x3071('0xd9'));db[_0x3071('0xda')]=db['sequelize'][_0x3071('0x14')]('../api/setting/setting.model');db[_0x3071('0xdb')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xdc'));db['SquareProject']=db[_0x3071('0x3')]['import'](_0x3071('0xdd'));db['SquareRecording']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/squareRecording/squareRecording.model');db[_0x3071('0xde')]=db[_0x3071('0x3')]['import'](_0x3071('0xdf'));db[_0x3071('0xe0')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe1'));db[_0x3071('0xe2')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe3'));db[_0x3071('0xe4')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe5'));db[_0x3071('0xe6')]=db[_0x3071('0x3')]['import'](_0x3071('0xe7'));db[_0x3071('0xe8')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xe9'));db['Plugin']=db['sequelize'][_0x3071('0x14')](_0x3071('0xea'));db['MailTransferReport']=db[_0x3071('0x3')][_0x3071('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x3071('0xeb')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xec'));db[_0x3071('0xed')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xee'));db[_0x3071('0xef')]=db[_0x3071('0x3')]['import'](_0x3071('0xf0'));db['SmsTransferReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf1'));db[_0x3071('0xf2')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x3071('0xf3')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf4'));db['UserProfile']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf5'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0x3071('0xf6')]=db[_0x3071('0x3')]['import'](_0x3071('0xf7'));db[_0x3071('0xf8')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xf9'));db['WhatsappAccount']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xfa'));db[_0x3071('0xfb')]=db['sequelize'][_0x3071('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0x3071('0xfc')]=db[_0x3071('0x3')][_0x3071('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x3071('0xfd')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xfe'));db['WhatsappQueueReport']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0xff'));db[_0x3071('0x100')]=db[_0x3071('0x3')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x3071('0x101')]=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x102'));db['CloudProvider']=db['sequelize'][_0x3071('0x14')](_0x3071('0x103'));db['TeamVoiceQueue']=db[_0x3071('0x3')][_0x3071('0x14')](_0x3071('0x104'));db['TeamVoicePrefix']=db['sequelize']['import'](_0x3071('0x105'));db[_0x3071('0x106')]=db[_0x3071('0x3')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x3071('0x13')][_0x3071('0x107')](db[_0x3071('0x108')],{'as':_0x3071('0x108'),'onDelete':_0x3071('0x109'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db[_0x3071('0x1d')],{'as':_0x3071('0x10a'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db['UserVoiceQueueRt'],{'as':_0x3071('0x10d'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'UserId'});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':_0x3071('0x110'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x111'),'foreignKey':'UserId'});db[_0x3071('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0x3071('0x112'),'foreignKey':_0x3071('0x10b')});db['User'][_0x3071('0x10c')](db['SmsInteraction'],{'as':_0x3071('0x113'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':_0x3071('0x115'),'foreignKey':'UserId'});db[_0x3071('0x13')][_0x3071('0x10c')](db[_0x3071('0xfc')],{'as':'WhatsappInteractions','foreignKey':_0x3071('0x10b')});db['User'][_0x3071('0x10c')](db[_0x3071('0xf8')],{'as':_0x3071('0x116'),'foreignKey':_0x3071('0x117')});db['User']['belongsTo'](db['UserProfile'],{'as':_0x3071('0x118'),'foreignKey':'userProfileId'});db['User'][_0x3071('0x119')](db['ChatGroup'],{'as':_0x3071('0x11a'),'through':_0x3071('0x11b')});db[_0x3071('0x13')]['belongsToMany'](db[_0x3071('0x72')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x11d')});db[_0x3071('0x13')][_0x3071('0x119')](db['Team'],{'through':_0x3071('0x11e')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x44')],{'as':_0x3071('0x115'),'through':_0x3071('0x11f')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x68')],{'as':'ChatInteractions','through':_0x3071('0x120')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'through':_0x3071('0x121')});db[_0x3071('0x13')]['belongsToMany'](db[_0x3071('0x56')],{'as':'SmsInteractions','through':_0x3071('0x122')});db[_0x3071('0x13')][_0x3071('0x119')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xfc')],{'as':'WhatsappInteractions','through':_0x3071('0x123')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x124')],{'as':_0x3071('0x125'),'through':_0x3071('0x31'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf3')],{'as':'VoicePrefixes','through':_0x3071('0x106'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db['MailQueue'],{'as':_0x3071('0x126'),'through':_0x3071('0x35'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x6d')],{'as':_0x3071('0x127'),'through':_0x3071('0x33'),'required':![],'hooks':!![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x52')],{'as':_0x3071('0x128'),'through':_0x3071('0x37'),'required':![]});db['User'][_0x3071('0x119')](db[_0x3071('0x129')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db[_0x3071('0x61')],{'as':_0x3071('0x12a'),'through':'UserOpenchannelQueue','required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x101')],{'as':_0x3071('0x12b'),'through':_0x3071('0x3c'),'required':![]});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0xf2')],{'through':_0x3071('0x11d')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x63')],{'as':_0x3071('0x12c'),'through':'user_has_chat_websites'});db[_0x3071('0x13')][_0x3071('0x119')](db['FaxAccount'],{'as':_0x3071('0x12d'),'through':_0x3071('0x12e')});db[_0x3071('0x13')][_0x3071('0x119')](db['MailAccount'],{'as':_0x3071('0x12f'),'through':_0x3071('0x130')});db[_0x3071('0x13')][_0x3071('0x119')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x3071('0x131')});db[_0x3071('0x13')][_0x3071('0x119')](db[_0x3071('0x132')],{'as':_0x3071('0x133'),'through':_0x3071('0x134')});db[_0x3071('0x13')][_0x3071('0x119')](db['WhatsappAccount'],{'as':_0x3071('0x135'),'through':'user_has_whatsapp_accounts'});db['User'][_0x3071('0x119')](db[_0x3071('0x136')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x3071('0x16')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x137'),'onDelete':'cascade','foreignKey':_0x3071('0x138')});db[_0x3071('0x17')][_0x3071('0x10c')](db[_0x3071('0x19')],{'onDelete':_0x3071('0x109')});db['VoiceExtension'][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x3071('0x119')](db[_0x3071('0x8e')],{'as':_0x3071('0x139'),'through':'moh_has_sounds'});db[_0x3071('0x124')][_0x3071('0x10c')](db['UserVoiceQueueRt'],{'as':_0x3071('0x13a'),'foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x74')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':'HopperHistories','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x10c')](db[_0x3071('0x76')],{'as':'HopperBlacks','foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')]['hasMany'](db[_0x3071('0x13c')],{'as':_0x3071('0x13d'),'foreignKey':_0x3071('0x13b')});db[_0x3071('0x124')][_0x3071('0x13e')](db['Trunk'],{'as':_0x3071('0x2c'),'foreignKey':'TrunkId'});db[_0x3071('0x124')]['belongsTo'](db[_0x3071('0x2c')],{'as':_0x3071('0x13f'),'foreignKey':_0x3071('0x140')});db[_0x3071('0x124')]['belongsTo'](db[_0x3071('0x88')],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db['VoiceQueue'][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3071('0x124')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x143')});db['VoiceQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x31')});db['VoiceQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'as':_0x3071('0x145'),'through':_0x3071('0x146')});db[_0x3071('0x124')][_0x3071('0x119')](db[_0x3071('0xf2')],{'as':_0x3071('0x147'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'User','foreignKey':_0x3071('0x10b')});db[_0x3071('0x1f')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x13'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x108')]['hasMany'](db[_0x3071('0x21')],{'as':_0x3071('0x148'),'onDelete':'cascade','foreignKey':_0x3071('0x149'),'sourceKey':_0x3071('0x14a')});db[_0x3071('0x21')]['belongsTo'](db[_0x3071('0x108')],{'foreignKey':_0x3071('0x149'),'targetKey':_0x3071('0x14a')});db[_0x3071('0x23')][_0x3071('0x10c')](db[_0x3071('0x29')],{'as':_0x3071('0x14b'),'foreignKey':_0x3071('0x14c'),'constraints':![]});db['VoiceCallReport'][_0x3071('0x10c')](db[_0x3071('0x27')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x3071('0x23')]['belongsTo'](db[_0x3071('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3071('0x23')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x14f')]['belongsTo'](db[_0x3071('0x150')],{'as':_0x3071('0x150'),'foreignKey':'MailAccountId'});db[_0x3071('0x3e')][_0x3071('0x13e')](db['MailAccount'],{'as':_0x3071('0x150'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x150')][_0x3071('0x107')](db[_0x3071('0x14f')],{'as':'Imap','onDelete':_0x3071('0x109')});db[_0x3071('0x150')][_0x3071('0x107')](db[_0x3071('0x3e')],{'as':'Smtp','onDelete':'cascade'});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x151'),'onDelete':_0x3071('0x109')});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x150')]['hasMany'](db[_0x3071('0x154')],{'as':'Messages','foreignKey':_0x3071('0x151')});db[_0x3071('0x150')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':_0x3071('0x155')});db[_0x3071('0x150')][_0x3071('0x10c')](db['MailApplication'],{'as':'Applications'});db[_0x3071('0x150')]['belongsTo'](db['CmList'],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db['MailAccount'][_0x3071('0x13e')](db['Template'],{'as':_0x3071('0x92'),'foreignKey':'TemplateId'});db[_0x3071('0x150')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x130')});db['MailQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x35')});db['MailQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x157'),'as':_0x3071('0x145')});db[_0x3071('0x44')][_0x3071('0x10c')](db[_0x3071('0x154')],{'as':'Messages','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x158')});db[_0x3071('0x44')][_0x3071('0x13e')](db[_0x3071('0x150')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x151')});db[_0x3071('0x44')]['belongsTo'](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x44')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'Owner','foreignKey':_0x3071('0x10b')});db[_0x3071('0x44')]['belongsToMany'](db[_0x3071('0x90')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x3071('0x44')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x15a'),'as':_0x3071('0x15b')});db[_0x3071('0x44')][_0x3071('0x119')](db['User'],{'as':_0x3071('0x15c'),'through':_0x3071('0x11f'),'foreignKey':'MailInteractionId'});db[_0x3071('0x154')][_0x3071('0x10c')](db[_0x3071('0xe8')],{'as':_0x3071('0x15d'),'onDelete':_0x3071('0x109')});db[_0x3071('0x154')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db[_0x3071('0x154')][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact'});db[_0x3071('0x154')]['belongsTo'](db[_0x3071('0x44')],{'as':_0x3071('0x15e'),'foreignKey':_0x3071('0x158')});db[_0x3071('0x154')][_0x3071('0x13e')](db['MailAccount'],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x151')});db['MailMessage']['belongsTo'](db[_0x3071('0x63')],{'as':'ChatWebsite','foreignKey':_0x3071('0x15f')});db['MailMessage'][_0x3071('0x13e')](db['ChatOfflineMessage'],{'as':_0x3071('0x6b'),'foreignKey':_0x3071('0x160')});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x161')});db['MailApplication'][_0x3071('0x13e')](db[_0x3071('0x41')],{'onDelete':'restrict'});db[_0x3071('0x46')]['belongsTo'](db['MailAccount'],{'onDelete':_0x3071('0x161')});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':'IntervalId'});db[_0x3071('0x46')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x150')],{});db['MailQueueReport']['belongsTo'](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x48')][_0x3071('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x44')],{});db['MailQueueReport'][_0x3071('0x13e')](db[_0x3071('0x154')],{});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x48')][_0x3071('0x13e')](db[_0x3071('0x41')],{});db['Dashboard'][_0x3071('0x10c')](db[_0x3071('0x164')],{'as':'Items','onDelete':'cascade'});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x165'),'onDelete':_0x3071('0x109')});db[_0x3071('0x4b')]['hasMany'](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':'FaxAccountId'});db[_0x3071('0x4b')]['hasMany'](db[_0x3071('0x4f')],{'as':'Interactions'});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x4d')],{'as':_0x3071('0x166')});db[_0x3071('0x4b')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x167'),'onDelete':_0x3071('0x109')});db[_0x3071('0x4b')][_0x3071('0x10c')](db['FaxMessage'],{'as':_0x3071('0x148')});db[_0x3071('0x4b')][_0x3071('0x13e')](db[_0x3071('0x2c')],{'as':'Trunk'});db['FaxAccount'][_0x3071('0x13e')](db['CmList'],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x4b')]['belongsTo'](db[_0x3071('0x8a')],{'as':'mandatoryDispositionPause','foreignKey':_0x3071('0x168')});db[_0x3071('0x4b')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':'user_has_fax_accounts'});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x161')});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x52')],{'onDelete':'restrict'});db[_0x3071('0x4d')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'onDelete':_0x3071('0x161')});db['FaxApplication'][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':'restrict','foreignKey':_0x3071('0x162')});db[_0x3071('0x4f')][_0x3071('0x10c')](db[_0x3071('0x169')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x16a')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x4b')],{'as':'Account','foreignKey':_0x3071('0x165')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':'Contact','foreignKey':_0x3071('0x14e')});db['FaxInteraction'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x4f')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction']['belongsToMany'](db[_0x3071('0x90')],{'through':_0x3071('0x16c'),'as':_0x3071('0x15b')});db[_0x3071('0x4f')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x121'),'foreignKey':_0x3071('0x16a')});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'as':'User'});db['FaxMessage'][_0x3071('0x13e')](db[_0x3071('0x4f')],{'as':_0x3071('0x15e'),'foreignKey':_0x3071('0x16a')});db[_0x3071('0x169')][_0x3071('0x13e')](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':'AttachmentId'});db[_0x3071('0x169')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x165')});db[_0x3071('0x52')]['belongsToMany'](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x37')});db['FaxQueue'][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x16d'),'as':_0x3071('0x145')});db[_0x3071('0x53')][_0x3071('0x13e')](db[_0x3071('0x4b')],{});db[_0x3071('0x53')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x53')]['belongsTo'](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x53')][_0x3071('0x13e')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x3071('0x13e')](db[_0x3071('0x169')],{});db[_0x3071('0x53')][_0x3071('0x13e')](db['User'],{});db['FaxQueueReport'][_0x3071('0x13e')](db['FaxQueue'],{});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x16e'),'onDelete':_0x3071('0x109')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x57')],{'as':'Messages','foreignKey':_0x3071('0x16e')});db[_0x3071('0x132')][_0x3071('0x10c')](db[_0x3071('0x56')],{'as':_0x3071('0x155')});db[_0x3071('0x132')]['hasMany'](db[_0x3071('0x16f')],{'as':'Applications'});db[_0x3071('0x132')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x132')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db[_0x3071('0x132')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':'Agents','through':_0x3071('0x134')});db[_0x3071('0x16f')][_0x3071('0x13e')](db['User'],{'onDelete':_0x3071('0x161')});db['SmsApplication'][_0x3071('0x13e')](db[_0x3071('0x129')],{'onDelete':_0x3071('0x161')});db['SmsApplication']['belongsTo'](db[_0x3071('0x132')],{'onDelete':_0x3071('0x161')});db[_0x3071('0x16f')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x16f')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0x3071('0x57')],{'as':_0x3071('0x148'),'onDelete':'cascade','foreignKey':_0x3071('0x170')});db[_0x3071('0x56')][_0x3071('0x13e')](db[_0x3071('0x132')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x56')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x56')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x56')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x171'),'as':_0x3071('0x172')});db[_0x3071('0x56')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x171'),'as':_0x3071('0x15b')});db[_0x3071('0x56')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':'Users','through':_0x3071('0x122'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db['SmsMessage'][_0x3071('0x13e')](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db['SmsMessage'][_0x3071('0x13e')](db[_0x3071('0x56')],{'onDelete':_0x3071('0x109'),'as':'Interaction','foreignKey':_0x3071('0x170')});db[_0x3071('0x57')][_0x3071('0x13e')](db[_0x3071('0x132')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x16e')});db[_0x3071('0x129')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':'UserSmsQueue','foreignKey':_0x3071('0x173')});db[_0x3071('0x129')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x174'),'as':_0x3071('0x145')});db[_0x3071('0x5a')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':'OpenchannelAccountId','onDelete':_0x3071('0x109')});db[_0x3071('0x5a')]['hasMany'](db['CannedAnswer'],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x155'),'foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')]['hasMany'](db[_0x3071('0x5f')],{'as':_0x3071('0x148'),'foreignKey':_0x3071('0x175')});db['OpenchannelAccount'][_0x3071('0x10c')](db[_0x3071('0x176')],{'as':'Applications','foreignKey':_0x3071('0x175')});db[_0x3071('0x5a')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x5a')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3071('0x5a')]['belongsToMany'](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x131')});db[_0x3071('0x176')][_0x3071('0x13e')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x3071('0x13e')](db[_0x3071('0x61')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x177')});db['OpenchannelApplication'][_0x3071('0x13e')](db[_0x3071('0x5a')],{'onDelete':'restrict','foreignKey':_0x3071('0x175')});db['OpenchannelApplication']['belongsTo'](db[_0x3071('0x88')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x176')][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':'restrict','foreignKey':_0x3071('0x162')});db[_0x3071('0x5d')][_0x3071('0x10c')](db[_0x3071('0x5f')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x178')});db[_0x3071('0x5d')]['belongsTo'](db[_0x3071('0x5a')],{'as':'Account','foreignKey':_0x3071('0x175')});db[_0x3071('0x5d')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x5d')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0x5d')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x179'),'as':_0x3071('0x172')});db[_0x3071('0x5d')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x179'),'as':_0x3071('0x15b')});db[_0x3071('0x5d')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':'user_has_openchannel_interactions','foreignKey':_0x3071('0x178')});db[_0x3071('0x5f')]['belongsTo'](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x13')});db[_0x3071('0x5f')][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d')});db[_0x3071('0x5f')][_0x3071('0x13e')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x3071('0x15e'),'foreignKey':_0x3071('0x178')});db['OpenchannelMessage'][_0x3071('0x13e')](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x3071('0x13e')](db[_0x3071('0x5a')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x175')});db['OpenchannelQueue'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x3a'),'foreignKey':_0x3071('0x177')});db[_0x3071('0x61')]['belongsToMany'](db['Team'],{'through':_0x3071('0x17a'),'as':_0x3071('0x145')});db[_0x3071('0x63')][_0x3071('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x3071('0x63')][_0x3071('0x10c')](db[_0x3071('0x82')],{'as':_0x3071('0x153'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x63')]['hasMany'](db[_0x3071('0x70')],{'as':_0x3071('0x17b')});db['ChatWebsite']['hasMany'](db[_0x3071('0x68')],{'as':_0x3071('0x155')});db[_0x3071('0x63')][_0x3071('0x10c')](db[_0x3071('0x66')],{'as':'Applications'});db[_0x3071('0x63')][_0x3071('0x10c')](db['ChatMessage'],{'as':_0x3071('0x148')});db[_0x3071('0x63')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163')});db[_0x3071('0x63')][_0x3071('0x13e')](db['Interval'],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db[_0x3071('0x63')][_0x3071('0x13e')](db[_0x3071('0x150')],{'as':_0x3071('0x150'),'foreignKey':'MailAccountId'});db[_0x3071('0x63')]['belongsTo'](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db[_0x3071('0x63')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x17c')});db[_0x3071('0x65')]['belongsTo'](db[_0x3071('0x5a')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x5d')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x5f')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x65')][_0x3071('0x13e')](db[_0x3071('0x61')],{});db[_0x3071('0x66')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x3071('0x161')});db[_0x3071('0x66')]['belongsTo'](db[_0x3071('0x6d')],{'as':_0x3071('0x17d'),'foreignKey':_0x3071('0x17e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x66')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x17f'),'foreignKey':_0x3071('0x15f'),'onDelete':'restrict'});db['ChatApplication'][_0x3071('0x13e')](db[_0x3071('0x90')],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0x68')][_0x3071('0x10c')](db[_0x3071('0x180')],{'as':_0x3071('0x148'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x181')});db[_0x3071('0x68')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x68')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':'ContactId'});db[_0x3071('0x68')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0x3071('0x90')],{'through':_0x3071('0x182'),'as':'Tags'});db[_0x3071('0x68')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x182'),'as':_0x3071('0x15b')});db[_0x3071('0x68')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':'user_has_chat_interactions','foreignKey':_0x3071('0x181')});db['ChatMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':'cascade','as':_0x3071('0x13')});db['ChatMessage'][_0x3071('0x13e')](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact','foreignKey':_0x3071('0x14e')});db[_0x3071('0x180')][_0x3071('0x13e')](db[_0x3071('0x68')],{'onDelete':'cascade','as':_0x3071('0x15e'),'foreignKey':_0x3071('0x181')});db['ChatMessage']['belongsTo'](db[_0x3071('0xe8')],{'as':_0x3071('0xe8'),'foreignKey':_0x3071('0x183')});db[_0x3071('0x180')][_0x3071('0x13e')](db['ChatWebsite'],{'as':_0x3071('0x159'),'foreignKey':'ChatWebsiteId'});db[_0x3071('0x6b')][_0x3071('0x10c')](db[_0x3071('0xe8')],{'as':'Attachments','foreignKey':_0x3071('0x160'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x6b')]['belongsTo'](db['CmContact'],{'onDelete':_0x3071('0x109'),'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x6b')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x15f')});db[_0x3071('0x6d')]['belongsToMany'](db[_0x3071('0x13')],{'as':'Agents','through':_0x3071('0x33'),'hooks':!![]});db[_0x3071('0x6d')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x184'),'as':_0x3071('0x145')});db['ChatGroup']['hasMany'](db[_0x3071('0xcf')],{'as':_0x3071('0x148'),'foreignKey':_0x3071('0x185'),'onDelete':'cascade'});db[_0x3071('0x186')]['belongsToMany'](db[_0x3071('0x13')],{'as':_0x3071('0x13a'),'through':_0x3071('0x11b')});db[_0x3071('0x70')][_0x3071('0x13e')](db[_0x3071('0x63')],{'as':_0x3071('0x17f'),'foreignKey':_0x3071('0x15f')});db['CmCompany'][_0x3071('0x10c')](db[_0x3071('0x72')],{'as':_0x3071('0x187'),'foreignKey':_0x3071('0x188')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x74')],{'as':'Hoppers','foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')]['hasMany'](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':_0x3071('0x14e')});db['CmContact'][_0x3071('0x10c')](db['CmHopperHistory'],{'as':_0x3071('0x189'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':'ContactId'});db[_0x3071('0x72')][_0x3071('0x10c')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x3071('0x14e')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x5d')],{'as':_0x3071('0x111'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x68')],{'as':'ChatInteractions','foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x56')],{'as':_0x3071('0x113'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x4f')],{'as':_0x3071('0x114'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')][_0x3071('0x10c')](db[_0x3071('0x44')],{'as':'MailInteractions','foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x161')});db[_0x3071('0x72')]['belongsTo'](db[_0x3071('0x18a')],{'as':'Company','foreignKey':'CompanyId'});db[_0x3071('0x72')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0x72')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x18b')});db[_0x3071('0x72')][_0x3071('0x119')](db[_0x3071('0x90')],{'as':_0x3071('0x172'),'through':_0x3071('0x18c')});db[_0x3071('0x72')][_0x3071('0x119')](db['Tag'],{'through':_0x3071('0x18c'),'as':_0x3071('0x15b')});db[_0x3071('0x74')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e'),'onDelete':'cascade'});db[_0x3071('0x74')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':'List','foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0x74')][_0x3071('0x13e')](db['User'],{'as':_0x3071('0x18d'),'foreignKey':'UserId'});db[_0x3071('0x74')][_0x3071('0x13e')](db['VoiceQueue'],{'as':_0x3071('0x17d'),'foreignKey':'VoiceQueueId','onDelete':_0x3071('0x109')});db[_0x3071('0x74')][_0x3071('0x13e')](db[_0x3071('0xe4')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x3071('0x74')][_0x3071('0x13e')](db['User'],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x18e')});db[_0x3071('0x76')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e'),'onDelete':_0x3071('0x109')});db[_0x3071('0x76')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db['CmHopperBlack'][_0x3071('0x13e')](db[_0x3071('0x124')],{'as':_0x3071('0x17d'),'foreignKey':_0x3071('0x13b'),'onDelete':_0x3071('0x109')});db['CmHopperBlack'][_0x3071('0x13e')](db['Campaign'],{'as':_0x3071('0xe4'),'foreignKey':_0x3071('0x18f'),'onDelete':'cascade'});db[_0x3071('0x80')][_0x3071('0x10c')](db[_0x3071('0x86')],{'as':{'plural':_0x3071('0x190'),'singular':_0x3071('0x191')},'foreignKey':_0x3071('0x192'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x80')][_0x3071('0x10c')](db['Condition'],{'as':{'plural':_0x3071('0x193'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation'][_0x3071('0x10c')](db[_0x3071('0x7e')],{'as':_0x3071('0x194'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x3071('0x84')][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x195'),'onDelete':_0x3071('0x109')});db[_0x3071('0x88')]['hasMany'](db[_0x3071('0x88')],{'as':_0x3071('0x196'),'foreignKey':_0x3071('0x141'),'onDelete':_0x3071('0x109'),'hooks':!![],'required':![]});db[_0x3071('0x88')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x3071('0x88')][_0x3071('0x10c')](db['MailApplication'],{'as':_0x3071('0x197'),'foreignKey':'IntervalId'});db[_0x3071('0x88')][_0x3071('0x10c')](db[_0x3071('0x66')],{'as':'ChatApplications','foreignKey':_0x3071('0x141')});db['Interval'][_0x3071('0x10c')](db[_0x3071('0x4d')],{'as':'FaxApplications','foreignKey':_0x3071('0x141')});db[_0x3071('0x88')][_0x3071('0x10c')](db['SmsApplication'],{'as':_0x3071('0x198'),'foreignKey':'IntervalId'});db[_0x3071('0x8c')]['belongsTo'](db[_0x3071('0x150')],{});db['Schedule']['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x3071('0x199')});db[_0x3071('0x8c')][_0x3071('0x13e')](db[_0x3071('0x19a')],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0x3071('0x19b')],{'as':_0x3071('0x19c'),'through':_0x3071('0x19d'),'onDelete':_0x3071('0x161')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x72')],{'through':_0x3071('0x18c')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x68')],{'through':'chat_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x44')],{'through':_0x3071('0x15a')});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x56')],{'through':'sms_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x4f')],{'through':'fax_interaction_has_tags'});db[_0x3071('0x90')][_0x3071('0x119')](db[_0x3071('0x5d')],{'through':_0x3071('0x179')});db[_0x3071('0x90')][_0x3071('0x119')](db['WhatsappInteraction'],{'through':_0x3071('0x19e')});db[_0x3071('0x94')][_0x3071('0x10c')](db['Condition'],{'as':{'plural':_0x3071('0x19f'),'singular':_0x3071('0x1a0')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x3071('0x94')]['hasMany'](db[_0x3071('0x86')],{'as':{'plural':_0x3071('0x1a1'),'singular':'AnyCondition'},'foreignKey':_0x3071('0x1a2'),'onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x94')][_0x3071('0x10c')](db['Action'],{'as':_0x3071('0x194'),'foreignKey':'TriggerId','onDelete':_0x3071('0x109'),'hooks':!![]});db[_0x3071('0x19a')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x3071('0x9c')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x3071('0x9f')][_0x3071('0x10c')](db[_0x3071('0xa0')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x3071('0x13e')](db['AnalyticMetric'],{'foreignKey':_0x3071('0x1a4')});db['SalesforceAccount'][_0x3071('0x10c')](db[_0x3071('0xa4')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xa4')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a7'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xa4')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db['SalesforceConfiguration'][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1a3'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xa4')][_0x3071('0x13e')](db[_0x3071('0xa2')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xa6')]['hasMany'](db[_0x3071('0xa6')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xa6')][_0x3071('0x10c')](db[_0x3071('0xa6')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x3071('0xa6')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xa6')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xa8')][_0x3071('0x10c')](db[_0x3071('0xa9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db['SugarcrmConfiguration']['hasMany'](db[_0x3071('0xab')],{'as':'Subjects','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db['SugarcrmConfiguration'][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xa9')][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':'FieldId'});db[_0x3071('0xa9')][_0x3071('0x13e')](db[_0x3071('0xa8')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xab')]['hasMany'](db[_0x3071('0xab')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xab')][_0x3071('0x10c')](db[_0x3071('0xab')],{'as':'Field','foreignKey':_0x3071('0x1ab')});db[_0x3071('0xab')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':'VariableId'});db[_0x3071('0xad')][_0x3071('0x10c')](db[_0x3071('0x1b0')],{'as':'Configurations','onDelete':_0x3071('0x109'),'foreignKey':'AccountId'});db[_0x3071('0x1b0')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':_0x3071('0x1a7'),'onDelete':'cascade','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b0')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b0')][_0x3071('0x10c')](db['DeskField'],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b0')][_0x3071('0x13e')](db[_0x3071('0xad')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b0')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x1b1')});db[_0x3071('0xaf')]['hasMany'](db['DeskField'],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0xaf')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xaf')][_0x3071('0x10c')](db[_0x3071('0xaf')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xaf')]['belongsTo'](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb1')][_0x3071('0x10c')](db[_0x3071('0x1b2')],{'as':_0x3071('0x1a5'),'onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b2')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':'Subjects','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db['ZohoConfiguration'][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db['ZohoConfiguration']['hasMany'](db[_0x3071('0xb4')],{'as':'Fields','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b2')]['belongsTo'](db[_0x3071('0xb1')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xb4')][_0x3071('0x10c')](db['ZohoField'],{'as':_0x3071('0x1af'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xb4')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xb4')][_0x3071('0x10c')](db[_0x3071('0xb4')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xb4')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb5')][_0x3071('0x10c')](db['ZendeskConfiguration'],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b3')][_0x3071('0x10c')](db['ZendeskField'],{'as':_0x3071('0x1a7'),'foreignKey':'SubjectId'});db[_0x3071('0x1b3')]['hasMany'](db[_0x3071('0xb7')],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b3')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':_0x3071('0x1a3'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b3')][_0x3071('0x13e')](db[_0x3071('0xb5')],{'as':'Account','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b3')]['belongsToMany'](db['Tag'],{'through':_0x3071('0x1b4')});db[_0x3071('0xb7')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xb7')][_0x3071('0x10c')](db[_0x3071('0xb7')],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xb7')][_0x3071('0x10c')](db['ZendeskField'],{'as':_0x3071('0x1ad'),'foreignKey':'FieldId'});db[_0x3071('0xb7')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0xb9')][_0x3071('0x10c')](db[_0x3071('0xba')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0xba')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1a7'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xba')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':'DescriptionId'});db[_0x3071('0xba')][_0x3071('0x10c')](db[_0x3071('0xbc')],{'as':_0x3071('0x1a3'),'onDelete':_0x3071('0x109'),'foreignKey':'FieldId'});db[_0x3071('0xba')][_0x3071('0x13e')](db['FreshdeskAccount'],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xba')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x3071('0x10c')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xbc')][_0x3071('0x10c')](db['FreshdeskField'],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xbc')][_0x3071('0x10c')](db[_0x3071('0xbc')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xbc')]['belongsTo'](db[_0x3071('0x96')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3071('0x1b5')][_0x3071('0x10c')](db[_0x3071('0x1b6')],{'as':_0x3071('0x1a5'),'onDelete':'cascade','foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':_0x3071('0x1a7'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':_0x3071('0x1a9'),'foreignKey':'DescriptionId'});db[_0x3071('0x1b6')][_0x3071('0x10c')](db[_0x3071('0xc0')],{'as':'Fields','foreignKey':_0x3071('0x1ab')});db['VtigerConfiguration'][_0x3071('0x13e')](db[_0x3071('0x1b5')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0xc0')][_0x3071('0x10c')](db['VtigerField'],{'as':_0x3071('0x1af'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc0')]['hasMany'](db[_0x3071('0xc0')],{'as':'Description','foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc0')][_0x3071('0x10c')](db['VtigerField'],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db['VtigerField'][_0x3071('0x13e')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x3071('0xc2')][_0x3071('0x10c')](db[_0x3071('0xc4')],{'as':'Configurations','onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0xc4')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':_0x3071('0x1a7'),'foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc4')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc4')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1a3'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xc4')]['belongsTo'](db[_0x3071('0xc2')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0x1b7')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':'Subject','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b7')][_0x3071('0x10c')](db['ServicenowField'],{'as':_0x3071('0x1ac'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b7')][_0x3071('0x10c')](db[_0x3071('0x1b7')],{'as':'Field','foreignKey':'FieldId'});db[_0x3071('0x1b7')]['belongsTo'](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0x1b8')]['hasMany'](db[_0x3071('0x1b9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1a6')});db[_0x3071('0x1b9')][_0x3071('0x10c')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x3071('0x1a8')});db[_0x3071('0x1b9')]['hasMany'](db[_0x3071('0xc7')],{'as':_0x3071('0x1a9'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0x1b9')]['hasMany'](db[_0x3071('0xc7')],{'as':_0x3071('0x1a3'),'onDelete':'cascade','foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1b9')][_0x3071('0x13e')](db[_0x3071('0x1b8')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0xc7')][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db[_0x3071('0xc7')][_0x3071('0x10c')](db[_0x3071('0xc7')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0xc7')][_0x3071('0x13e')](db[_0x3071('0x96')],{'as':'Variable','foreignKey':_0x3071('0x1ae')});db[_0x3071('0x1ba')]['hasMany'](db[_0x3071('0xc9')],{'as':_0x3071('0x1a5'),'onDelete':_0x3071('0x109'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x3071('0x10c')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x3071('0x1a8')});db[_0x3071('0xc9')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1a9'),'foreignKey':_0x3071('0x1aa')});db[_0x3071('0xc9')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x3071('0x13e')](db[_0x3071('0x1ba')],{'as':_0x3071('0x159'),'foreignKey':'AccountId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1af'),'foreignKey':'SubjectId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1ac'),'foreignKey':'DescriptionId'});db[_0x3071('0x1bb')][_0x3071('0x10c')](db[_0x3071('0x1bb')],{'as':_0x3071('0x1ad'),'foreignKey':_0x3071('0x1ab')});db[_0x3071('0x1bb')][_0x3071('0x13e')](db['Variable'],{'as':_0x3071('0x96'),'foreignKey':_0x3071('0x1ae')});db['ChatQueueReport']['belongsTo'](db[_0x3071('0x63')],{});db[_0x3071('0xce')]['belongsTo'](db['CmList'],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xce')]['belongsTo'](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0xce')][_0x3071('0x13e')](db['ChatInteraction'],{});db[_0x3071('0xce')][_0x3071('0x13e')](db[_0x3071('0x180')],{});db[_0x3071('0xce')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0xce')]['belongsTo'](db[_0x3071('0x6d')],{});db[_0x3071('0xcf')][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1bc')});db['ChatInternalMessage'][_0x3071('0x13e')](db[_0x3071('0x13')],{'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x1bd')});db[_0x3071('0x13c')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x3071('0x1be'),'onDelete':'cascade'});db[_0x3071('0x13c')][_0x3071('0x10c')](db[_0x3071('0xd1')],{'foreignKey':_0x3071('0x1be'),'onDelete':'cascade'});db[_0x3071('0xd4')]['belongsTo'](db['SmsAccount'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db['SmsQueueReport'][_0x3071('0x13e')](db[_0x3071('0x56')],{});db['SmsQueueReport'][_0x3071('0x13e')](db['SmsMessage'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db['User'],{});db[_0x3071('0xd4')][_0x3071('0x13e')](db[_0x3071('0x129')],{});db[_0x3071('0x1bf')][_0x3071('0x10c')](db[_0x3071('0x13c')],{'foreignKey':_0x3071('0x1c0')});db[_0x3071('0x1bf')]['hasMany'](db[_0x3071('0x1c1')],{'foreignKey':'ProjectId'});db[_0x3071('0x1bf')][_0x3071('0x10c')](db[_0x3071('0xd1')],{'foreignKey':_0x3071('0x1c0')});db[_0x3071('0x136')][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'through':_0x3071('0x1c2')});db['Team'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x11e')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x124')],{'through':_0x3071('0x146'),'as':_0x3071('0x125')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x41')],{'through':_0x3071('0x157'),'as':_0x3071('0x126')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x6d')],{'through':'team_has_chat_queues','as':_0x3071('0x127')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x52')],{'through':'team_has_fax_queues','as':_0x3071('0x128')});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x129')],{'through':_0x3071('0x174'),'as':'SmsQueues'});db[_0x3071('0xe0')][_0x3071('0x119')](db[_0x3071('0x61')],{'through':_0x3071('0x17a'),'as':_0x3071('0x12a')});db['Team'][_0x3071('0x119')](db[_0x3071('0x101')],{'through':_0x3071('0x1c3'),'as':_0x3071('0x12b')});db[_0x3071('0xe0')][_0x3071('0x119')](db['VoicePrefix'],{'through':_0x3071('0x1c4'),'as':_0x3071('0x1c5')});db['Campaign'][_0x3071('0x10c')](db['CmHopper'],{'as':_0x3071('0x1c6'),'foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':'HopperFinals','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':'HopperHistories','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')][_0x3071('0x10c')](db[_0x3071('0x76')],{'as':'HopperBlacks','foreignKey':_0x3071('0x18f')});db[_0x3071('0xe4')]['belongsTo'](db[_0x3071('0x2c')],{'as':_0x3071('0x2c'),'foreignKey':_0x3071('0x1c7')});db['Campaign'][_0x3071('0x13e')](db[_0x3071('0x2c')],{'as':_0x3071('0x13f'),'foreignKey':_0x3071('0x140')});db[_0x3071('0xe4')][_0x3071('0x13e')](db[_0x3071('0x88')],{'as':_0x3071('0x88'),'foreignKey':_0x3071('0x141')});db['Campaign']['belongsTo'](db[_0x3071('0x136')],{'as':'SquareProject','foreignKey':_0x3071('0x1c8')});db[_0x3071('0xe4')]['belongsToMany'](db[_0x3071('0xf2')],{'as':_0x3071('0x11c'),'through':_0x3071('0x1c9')});db[_0x3071('0xe4')]['belongsToMany'](db[_0x3071('0xf2')],{'as':_0x3071('0x147'),'through':'campaigns_has_cm_blacklists'});db[_0x3071('0xe8')][_0x3071('0x13e')](db[_0x3071('0x6b')],{'as':_0x3071('0x6b'),'foreignKey':_0x3071('0x160')});db[_0x3071('0x1ca')]['belongsTo'](db['MailMessage'],{});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x44')],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0x3071('0x1cb'),'as':'FromAccount'});db['MailTransferReport']['belongsTo'](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x41')],{'foreignKey':'ToMailQueueId','as':_0x3071('0x1ce')});db[_0x3071('0x1ca')][_0x3071('0x13e')](db[_0x3071('0x150')],{'foreignKey':_0x3071('0x1cf'),'as':_0x3071('0x1d0')});db[_0x3071('0xeb')][_0x3071('0x13e')](db['ChatMessage'],{});db['ChatTransferReport'][_0x3071('0x13e')](db['ChatInteraction'],{});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x63')],{'foreignKey':'FromChatWebsiteId','as':_0x3071('0x1d1')});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':_0x3071('0x1d2')});db[_0x3071('0xeb')]['belongsTo'](db[_0x3071('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3071('0xeb')][_0x3071('0x13e')](db[_0x3071('0x6d')],{'foreignKey':_0x3071('0x1d3'),'as':_0x3071('0x1ce')});db['ChatTransferReport'][_0x3071('0x13e')](db[_0x3071('0x63')],{'foreignKey':_0x3071('0x1d4'),'as':'ToAccount'});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x169')],{});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x4f')],{});db['FaxTransferReport']['belongsTo'](db[_0x3071('0x4b')],{'foreignKey':_0x3071('0x1d5'),'as':'FromAccount'});db['FaxTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'FromUserId','as':_0x3071('0x1d2')});db['FaxTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x52')],{'foreignKey':_0x3071('0x1d6'),'as':_0x3071('0x1ce')});db[_0x3071('0xed')][_0x3071('0x13e')](db[_0x3071('0x4b')],{'foreignKey':_0x3071('0x1d7'),'as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db[_0x3071('0x5f')],{});db[_0x3071('0xef')][_0x3071('0x13e')](db['OpenchannelInteraction'],{});db[_0x3071('0xef')][_0x3071('0x13e')](db[_0x3071('0x5a')],{'foreignKey':_0x3071('0x1d8'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1d9'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':'ToUserId','as':_0x3071('0x1cd')});db['OpenchannelTransferReport'][_0x3071('0x13e')](db[_0x3071('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x3071('0x1ce')});db[_0x3071('0xef')][_0x3071('0x13e')](db['OpenchannelAccount'],{'foreignKey':_0x3071('0x1da'),'as':_0x3071('0x1d0')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x57')],{});db[_0x3071('0x1db')][_0x3071('0x13e')](db['SmsInteraction'],{});db[_0x3071('0x1db')][_0x3071('0x13e')](db[_0x3071('0x132')],{'foreignKey':'FromSmsAccountId','as':_0x3071('0x1d1')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x13')],{'foreignKey':_0x3071('0x1d9'),'as':_0x3071('0x1d2')});db[_0x3071('0x1db')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db['SmsTransferReport'][_0x3071('0x13e')](db[_0x3071('0x129')],{'foreignKey':'ToSmsQueueId','as':_0x3071('0x1ce')});db[_0x3071('0x1db')]['belongsTo'](db[_0x3071('0x132')],{'foreignKey':_0x3071('0x1dc'),'as':_0x3071('0x1d0')});db['CmList'][_0x3071('0x10c')](db[_0x3071('0x84')],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x163'),'onDelete':_0x3071('0x109')});db[_0x3071('0xf2')][_0x3071('0x10c')](db['CmCustomField'],{'as':_0x3071('0x1dd'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')]['hasMany'](db['CmContact'],{'as':_0x3071('0x187'),'onDelete':_0x3071('0x109'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x77')],{'as':_0x3071('0x10f'),'foreignKey':'ListId'});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x78')],{'as':_0x3071('0x110'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')][_0x3071('0x10c')](db[_0x3071('0x7a')],{'as':_0x3071('0x7a'),'foreignKey':_0x3071('0x163')});db[_0x3071('0xf2')]['belongsToMany'](db[_0x3071('0x124')],{'as':_0x3071('0x1de'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x11d')});db[_0x3071('0xf3')][_0x3071('0x10c')](db[_0x3071('0x19')],{'as':_0x3071('0x10e'),'onDelete':_0x3071('0x109')});db['VoicePrefix'][_0x3071('0x119')](db['User'],{'as':_0x3071('0x144'),'through':_0x3071('0x106')});db[_0x3071('0xf3')][_0x3071('0x119')](db[_0x3071('0xe0')],{'through':_0x3071('0x1c4'),'as':_0x3071('0x145')});db[_0x3071('0x118')][_0x3071('0x10c')](db[_0x3071('0x13')],{'as':_0x3071('0x15c'),'foreignKey':_0x3071('0x1df')});db[_0x3071('0x118')][_0x3071('0x10c')](db[_0x3071('0x1e0')],{'as':_0x3071('0x1e1'),'foreignKey':_0x3071('0x1df'),'onDelete':'cascade'});db[_0x3071('0x1e0')][_0x3071('0x10c')](db[_0x3071('0xf6')],{'as':_0x3071('0x1e2'),'foreignKey':_0x3071('0x1e3'),'onDelete':_0x3071('0x109')});db[_0x3071('0x1e4')]['hasMany'](db['Disposition'],{'as':_0x3071('0x152'),'foreignKey':_0x3071('0x1e5'),'onDelete':'cascade'});db[_0x3071('0x1e4')][_0x3071('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db[_0x3071('0xfd')],{'as':_0x3071('0x148'),'foreignKey':'WhatsappAccountId'});db[_0x3071('0x1e4')][_0x3071('0x10c')](db[_0x3071('0xfc')],{'as':_0x3071('0x155')});db[_0x3071('0x1e4')][_0x3071('0x10c')](db[_0x3071('0xfb')],{'as':_0x3071('0x166')});db[_0x3071('0x1e4')][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x1e4')][_0x3071('0x13e')](db[_0x3071('0x8a')],{'as':_0x3071('0x142'),'foreignKey':_0x3071('0x168')});db['WhatsappAccount'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x1e6')});db[_0x3071('0xfb')]['belongsTo'](db['User'],{'onDelete':_0x3071('0x161')});db['WhatsappApplication']['belongsTo'](db[_0x3071('0x101')],{'onDelete':'restrict'});db[_0x3071('0xfb')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'onDelete':_0x3071('0x161')});db[_0x3071('0xfb')][_0x3071('0x13e')](db[_0x3071('0x88')],{'onDelete':'restrict','foreignKey':_0x3071('0x141')});db[_0x3071('0xfb')][_0x3071('0x13e')](db['Tag'],{'onDelete':_0x3071('0x161'),'foreignKey':_0x3071('0x162')});db[_0x3071('0xfc')][_0x3071('0x10c')](db[_0x3071('0xfd')],{'as':'Messages','onDelete':_0x3071('0x109'),'foreignKey':'WhatsappInteractionId'});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1e5')});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x72')],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0xfc')][_0x3071('0x13e')](db[_0x3071('0x13')],{'as':_0x3071('0x16b'),'foreignKey':_0x3071('0x10b')});db[_0x3071('0xfc')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x19e'),'as':'Tags'});db[_0x3071('0xfc')][_0x3071('0x119')](db[_0x3071('0x90')],{'through':_0x3071('0x19e'),'as':'ThroughTags'});db[_0x3071('0xfc')]['belongsToMany'](db[_0x3071('0x13')],{'as':'Users','through':_0x3071('0x123'),'foreignKey':_0x3071('0x1e7')});db[_0x3071('0xfd')]['belongsTo'](db[_0x3071('0x13')],{'as':_0x3071('0x13')});db[_0x3071('0xfd')]['belongsTo'](db[_0x3071('0x72')],{'onDelete':_0x3071('0x109'),'as':'Contact'});db[_0x3071('0xfd')][_0x3071('0x13e')](db[_0x3071('0xfc')],{'onDelete':_0x3071('0x109'),'as':'Interaction','foreignKey':_0x3071('0x1e7')});db[_0x3071('0xfd')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'as':_0x3071('0x159'),'foreignKey':_0x3071('0x1e5')});db['WhatsappQueueReport'][_0x3071('0x13e')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x3071('0x13e')](db[_0x3071('0xf2')],{'as':_0x3071('0x156'),'foreignKey':'ListId'});db[_0x3071('0x1e8')][_0x3071('0x13e')](db['CmContact'],{'as':_0x3071('0x14d'),'foreignKey':_0x3071('0x14e')});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0xfc')],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db['WhatsappQueue'],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0xfd')],{});db[_0x3071('0x1e8')][_0x3071('0x13e')](db[_0x3071('0x13')],{});db[_0x3071('0x100')]['belongsTo'](db['WhatsappMessage'],{});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0xfc')],{});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'foreignKey':_0x3071('0x1e9'),'as':_0x3071('0x1d1')});db['WhatsappTransferReport'][_0x3071('0x13e')](db[_0x3071('0x1e4')],{'foreignKey':_0x3071('0x1ea'),'as':'ToAccount'});db[_0x3071('0x100')][_0x3071('0x13e')](db[_0x3071('0x101')],{'foreignKey':_0x3071('0x1eb'),'as':_0x3071('0x1ce')});db[_0x3071('0x100')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1d9'),'as':_0x3071('0x1d2')});db[_0x3071('0x100')][_0x3071('0x13e')](db['User'],{'foreignKey':_0x3071('0x1cc'),'as':_0x3071('0x1cd')});db['WhatsappQueue'][_0x3071('0x119')](db[_0x3071('0x13')],{'as':_0x3071('0x144'),'through':_0x3071('0x3c'),'foreignKey':_0x3071('0x1ec')});db[_0x3071('0x101')][_0x3071('0x119')](db['Team'],{'through':_0x3071('0x1c3'),'as':_0x3071('0x145')});module[_0x3071('0x1ed')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 2e3095d..3afad81 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x384a=['./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','newPassword','firstName','lastName','phone','mobile','email','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','key','pass','accountSid','dsn','isArray','length','isString','replace','@@{','includes','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','auth','use','logger','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','role','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/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/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer'];(function(_0x366e88,_0x15f8b4){var _0x49abce=function(_0x25fee0){while(--_0x25fee0){_0x366e88['push'](_0x366e88['shift']());}};_0x49abce(++_0x15f8b4);}(_0x384a,0x17f));var _0xa384=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x384a[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xa384('0x0'));var path=require(_0xa384('0x1'));var express=require(_0xa384('0x2'));var ewinston=require(_0xa384('0x3'));var util=require('util');var errors=require(_0xa384('0x4'));var config=require(_0xa384('0x5'));var logger=require(_0xa384('0x6'))(_0xa384('0x7'));var authLogger=require(_0xa384('0x6'))(_0xa384('0x8'));exports['default']=function(_0x393f43){_0x393f43[_0xa384('0x9')](ewinston[_0xa384('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4bda3a,_0x428525){var _0x2d8e17='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xa384('0xb')](_0x4bda3a[_0xa384('0xc')])){_0x2d8e17+='\x20body=%s';var _0x2d90b1=_0x4bda3a['body'];maskSensitiveData(_0x2d90b1);}return util[_0xa384('0xd')](_0x2d8e17,_0x4bda3a[_0xa384('0xe')],_0x4bda3a[_0xa384('0xf')][_0xa384('0x10')]?_0x4bda3a['headers']['x-forwarded-for']:_0x4bda3a[_0xa384('0x11')][_0xa384('0x12')]||_0x4bda3a['ip'],_0x4bda3a[_0xa384('0x13')],_0x428525[_0xa384('0x14')],_0x428525['responseTime'],_0x4bda3a[_0xa384('0x15')]?_0x4bda3a['user']['id']:null,_0x4bda3a['user']?_0x4bda3a[_0xa384('0x15')][_0xa384('0x16')]:null,_0x4bda3a[_0xa384('0x15')]?_0x4bda3a[_0xa384('0x15')][_0xa384('0x17')]:null,_0x2d90b1?util['inspect'](_0x2d90b1,![],null):'');}}));_0x393f43[_0xa384('0x9')](ewinston[_0xa384('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x33eca6,_0x1b3d88){var _0x308ffd='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x33eca6[_0xa384('0xc')]&&_0x33eca6[_0xa384('0xc')]['device']&&_0x33eca6[_0xa384('0xc')][_0xa384('0x18')]){_0x308ffd=_0xa384('0x19');}return util[_0xa384('0xd')](_0x308ffd,_0x33eca6[_0xa384('0xe')],_0x33eca6[_0xa384('0xf')]['x-forwarded-for']?_0x33eca6['headers'][_0xa384('0x10')]:_0x33eca6['connection'][_0xa384('0x12')]||_0x33eca6['ip'],_0x33eca6[_0xa384('0x13')],_0x1b3d88[_0xa384('0x14')],_0x1b3d88['responseTime'],_0x33eca6[_0xa384('0x15')]?_0x33eca6['user']['id']:null,_0x33eca6[_0xa384('0x15')]?_0x33eca6[_0xa384('0x15')][_0xa384('0x16')]:null,_0x33eca6[_0xa384('0x15')]?_0x33eca6[_0xa384('0x15')][_0xa384('0x17')]:null,_0x33eca6['body']&&_0x33eca6['body'][_0xa384('0x1a')]?_0x33eca6['body'][_0xa384('0x1a')]:_0xa384('0x1b'),_0x33eca6['body']&&_0x33eca6['body'][_0xa384('0x18')]?_0x33eca6['body']['agent_id']:'',_0x33eca6[_0xa384('0xc')]&&_0x33eca6['body'][_0xa384('0x1c')]?_0x33eca6['body']['agent_name']:'');},'ignoreRoute':function(_0x558f35){var _0x1507d2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1507d2[_0xa384('0x1d')](_0x558f35['url']);}}));_0x393f43[_0xa384('0x9')](_0xa384('0x1e'),require(_0xa384('0x1f')));_0x393f43[_0xa384('0x9')](_0xa384('0x20'),require(_0xa384('0x21')));_0x393f43[_0xa384('0x9')](_0xa384('0x22'),require(_0xa384('0x23')));_0x393f43[_0xa384('0x9')](_0xa384('0x24'),require('./api/voiceExtension'));_0x393f43['use'](_0xa384('0x25'),require(_0xa384('0x26')));_0x393f43[_0xa384('0x9')](_0xa384('0x27'),require(_0xa384('0x28')));_0x393f43[_0xa384('0x9')](_0xa384('0x29'),require(_0xa384('0x2a')));_0x393f43[_0xa384('0x9')](_0xa384('0x2b'),require(_0xa384('0x2c')));_0x393f43['use'](_0xa384('0x2d'),require(_0xa384('0x2e')));_0x393f43[_0xa384('0x9')]('/api/voice/mails/messages',require(_0xa384('0x2f')));_0x393f43[_0xa384('0x9')](_0xa384('0x30'),require(_0xa384('0x31')));_0x393f43[_0xa384('0x9')](_0xa384('0x32'),require(_0xa384('0x33')));_0x393f43['use'](_0xa384('0x34'),require(_0xa384('0x35')));_0x393f43['use'](_0xa384('0x36'),require(_0xa384('0x37')));_0x393f43[_0xa384('0x9')](_0xa384('0x38'),require('./api/memberReport'));_0x393f43[_0xa384('0x9')](_0xa384('0x39'),require(_0xa384('0x3a')));_0x393f43[_0xa384('0x9')](_0xa384('0x3b'),require('./api/voiceTransferReport'));_0x393f43[_0xa384('0x9')]('/api/mail/out_servers',require(_0xa384('0x3c')));_0x393f43[_0xa384('0x9')](_0xa384('0x3d'),require(_0xa384('0x3e')));_0x393f43['use'](_0xa384('0x3f'),require(_0xa384('0x40')));_0x393f43[_0xa384('0x9')](_0xa384('0x41'),require(_0xa384('0x42')));_0x393f43[_0xa384('0x9')]('/api/mail/interactions',require(_0xa384('0x43')));_0x393f43[_0xa384('0x9')](_0xa384('0x44'),require('./api/mailMessage'));_0x393f43[_0xa384('0x9')](_0xa384('0x45'),require(_0xa384('0x46')));_0x393f43['use']('/api/mail/reports/queue',require(_0xa384('0x47')));_0x393f43[_0xa384('0x9')](_0xa384('0x48'),require(_0xa384('0x49')));_0x393f43[_0xa384('0x9')](_0xa384('0x4a'),require('./api/dashboardItem'));_0x393f43[_0xa384('0x9')]('/api/fax/accounts',require(_0xa384('0x4b')));_0x393f43['use'](_0xa384('0x4c'),require(_0xa384('0x4d')));_0x393f43[_0xa384('0x9')](_0xa384('0x4e'),require(_0xa384('0x4f')));_0x393f43[_0xa384('0x9')](_0xa384('0x50'),require('./api/faxMessage'));_0x393f43[_0xa384('0x9')]('/api/fax/queues',require(_0xa384('0x51')));_0x393f43[_0xa384('0x9')]('/api/fax/reports/queue',require(_0xa384('0x52')));_0x393f43[_0xa384('0x9')](_0xa384('0x53'),require('./api/smsAccount'));_0x393f43[_0xa384('0x9')]('/api/sms/applications',require(_0xa384('0x54')));_0x393f43['use'](_0xa384('0x55'),require(_0xa384('0x56')));_0x393f43[_0xa384('0x9')](_0xa384('0x57'),require(_0xa384('0x58')));_0x393f43[_0xa384('0x9')](_0xa384('0x59'),require(_0xa384('0x5a')));_0x393f43[_0xa384('0x9')](_0xa384('0x5b'),require(_0xa384('0x5c')));_0x393f43[_0xa384('0x9')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x393f43[_0xa384('0x9')](_0xa384('0x5d'),require(_0xa384('0x5e')));_0x393f43[_0xa384('0x9')](_0xa384('0x5f'),require(_0xa384('0x60')));_0x393f43[_0xa384('0x9')](_0xa384('0x61'),require('./api/openchannelQueue'));_0x393f43[_0xa384('0x9')]('/api/chat/websites',require(_0xa384('0x62')));_0x393f43[_0xa384('0x9')](_0xa384('0x63'),require(_0xa384('0x64')));_0x393f43['use'](_0xa384('0x65'),require(_0xa384('0x66')));_0x393f43[_0xa384('0x9')](_0xa384('0x67'),require(_0xa384('0x68')));_0x393f43[_0xa384('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x393f43['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x393f43[_0xa384('0x9')]('/api/chat/queues',require(_0xa384('0x69')));_0x393f43[_0xa384('0x9')](_0xa384('0x6a'),require(_0xa384('0x6b')));_0x393f43['use'](_0xa384('0x6c'),require(_0xa384('0x6d')));_0x393f43[_0xa384('0x9')](_0xa384('0x6e'),require('./api/cmCompany'));_0x393f43['use'](_0xa384('0x6f'),require('./api/cmContact'));_0x393f43[_0xa384('0x9')](_0xa384('0x70'),require(_0xa384('0x71')));_0x393f43[_0xa384('0x9')](_0xa384('0x72'),require(_0xa384('0x73')));_0x393f43['use'](_0xa384('0x74'),require('./api/cmHopperFinal'));_0x393f43[_0xa384('0x9')](_0xa384('0x75'),require(_0xa384('0x76')));_0x393f43[_0xa384('0x9')](_0xa384('0x77'),require(_0xa384('0x78')));_0x393f43[_0xa384('0x9')](_0xa384('0x79'),require(_0xa384('0x7a')));_0x393f43['use'](_0xa384('0x7b'),require(_0xa384('0x7c')));_0x393f43[_0xa384('0x9')](_0xa384('0x7d'),require(_0xa384('0x7e')));_0x393f43[_0xa384('0x9')]('/api/dispositions',require(_0xa384('0x7f')));_0x393f43[_0xa384('0x9')](_0xa384('0x80'),require(_0xa384('0x81')));_0x393f43['use'](_0xa384('0x82'),require(_0xa384('0x83')));_0x393f43[_0xa384('0x9')]('/api/pauses',require(_0xa384('0x84')));_0x393f43[_0xa384('0x9')](_0xa384('0x85'),require(_0xa384('0x86')));_0x393f43[_0xa384('0x9')]('/api/voiceQueuesLog',require(_0xa384('0x87')));_0x393f43[_0xa384('0x9')](_0xa384('0x88'),require(_0xa384('0x89')));_0x393f43[_0xa384('0x9')]('/api/sounds',require(_0xa384('0x8a')));_0x393f43[_0xa384('0x9')]('/api/tags',require(_0xa384('0x8b')));_0x393f43[_0xa384('0x9')]('/api/templates',require(_0xa384('0x8c')));_0x393f43['use'](_0xa384('0x8d'),require(_0xa384('0x8e')));_0x393f43[_0xa384('0x9')]('/api/variables',require(_0xa384('0x8f')));_0x393f43['use'](_0xa384('0x90'),require(_0xa384('0x91')));_0x393f43[_0xa384('0x9')]('/api/integrations/reports',require(_0xa384('0x92')));_0x393f43['use'](_0xa384('0x93'),require(_0xa384('0x94')));_0x393f43[_0xa384('0x9')](_0xa384('0x95'),require(_0xa384('0x96')));_0x393f43[_0xa384('0x9')](_0xa384('0x97'),require(_0xa384('0x98')));_0x393f43[_0xa384('0x9')]('/api/analytics/metrics',require(_0xa384('0x99')));_0x393f43['use']('/api/analytics/field_reports',require(_0xa384('0x9a')));_0x393f43[_0xa384('0x9')](_0xa384('0x9b'),require('./api/analyticTreeReport'));_0x393f43[_0xa384('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x393f43[_0xa384('0x9')](_0xa384('0x9c'),require(_0xa384('0x9d')));_0x393f43['use'](_0xa384('0x9e'),require('./api/intSalesforceField'));_0x393f43[_0xa384('0x9')](_0xa384('0x9f'),require(_0xa384('0xa0')));_0x393f43[_0xa384('0x9')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xa1'),require(_0xa384('0xa2')));_0x393f43[_0xa384('0x9')]('/api/integrations/desk/accounts',require(_0xa384('0xa3')));_0x393f43[_0xa384('0x9')](_0xa384('0xa4'),require(_0xa384('0xa5')));_0x393f43['use'](_0xa384('0xa6'),require(_0xa384('0xa7')));_0x393f43[_0xa384('0x9')](_0xa384('0xa8'),require(_0xa384('0xa9')));_0x393f43['use']('/api/integrations/zoho/configurations',require(_0xa384('0xaa')));_0x393f43[_0xa384('0x9')]('/api/integrations/zoho/fields',require(_0xa384('0xab')));_0x393f43['use'](_0xa384('0xac'),require(_0xa384('0xad')));_0x393f43[_0xa384('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xae'),require(_0xa384('0xaf')));_0x393f43[_0xa384('0x9')](_0xa384('0xb0'),require(_0xa384('0xb1')));_0x393f43[_0xa384('0x9')](_0xa384('0xb2'),require(_0xa384('0xb3')));_0x393f43[_0xa384('0x9')](_0xa384('0xb4'),require('./api/intFreshdeskField'));_0x393f43[_0xa384('0x9')]('/api/integrations/vtiger/accounts',require(_0xa384('0xb5')));_0x393f43['use'](_0xa384('0xb6'),require(_0xa384('0xb7')));_0x393f43[_0xa384('0x9')]('/api/integrations/vtiger/fields',require(_0xa384('0xb8')));_0x393f43['use']('/api/integrations/servicenow/accounts',require(_0xa384('0xb9')));_0x393f43[_0xa384('0x9')](_0xa384('0xba'),require(_0xa384('0xbb')));_0x393f43[_0xa384('0x9')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x393f43[_0xa384('0x9')](_0xa384('0xbc'),require('./api/intDynamics365Account'));_0x393f43[_0xa384('0x9')](_0xa384('0xbd'),require(_0xa384('0xbe')));_0x393f43['use'](_0xa384('0xbf'),require(_0xa384('0xc0')));_0x393f43['use'](_0xa384('0xc1'),require('./api/intFreshsalesAccount'));_0x393f43['use'](_0xa384('0xc2'),require('./api/intFreshsalesConfiguration'));_0x393f43[_0xa384('0x9')](_0xa384('0xc3'),require(_0xa384('0xc4')));_0x393f43['use'](_0xa384('0xc5'),require(_0xa384('0xc6')));_0x393f43[_0xa384('0x9')](_0xa384('0xc7'),require(_0xa384('0xc8')));_0x393f43[_0xa384('0x9')](_0xa384('0xc9'),require('./api/chatInternalMessage'));_0x393f43[_0xa384('0x9')](_0xa384('0xca'),require('./api/jscriptyAnswerReport'));_0x393f43[_0xa384('0x9')](_0xa384('0xcb'),require(_0xa384('0xcc')));_0x393f43['use'](_0xa384('0xcd'),require(_0xa384('0xce')));_0x393f43[_0xa384('0x9')](_0xa384('0xcf'),require(_0xa384('0xd0')));_0x393f43['use']('/api/square/reports',require('./api/squareReport'));_0x393f43[_0xa384('0x9')]('/api/square/details/reports',require(_0xa384('0xd1')));_0x393f43[_0xa384('0x9')](_0xa384('0xd2'),require(_0xa384('0xd3')));_0x393f43[_0xa384('0x9')](_0xa384('0xd4'),require(_0xa384('0xd5')));_0x393f43[_0xa384('0x9')](_0xa384('0xd6'),require(_0xa384('0xd7')));_0x393f43[_0xa384('0x9')](_0xa384('0xd8'),require(_0xa384('0xd9')));_0x393f43[_0xa384('0x9')](_0xa384('0xda'),require(_0xa384('0xdb')));_0x393f43[_0xa384('0x9')](_0xa384('0xdc'),require(_0xa384('0xdd')));_0x393f43['use'](_0xa384('0xde'),require(_0xa384('0xdf')));_0x393f43[_0xa384('0x9')](_0xa384('0xe0'),require(_0xa384('0xe1')));_0x393f43[_0xa384('0x9')](_0xa384('0xe2'),require('./api/campaign'));_0x393f43['use']('/api/migrations',require('./api/migration'));_0x393f43[_0xa384('0x9')](_0xa384('0xe3'),require(_0xa384('0xe4')));_0x393f43[_0xa384('0x9')](_0xa384('0xe5'),require(_0xa384('0xe6')));_0x393f43['use']('/api/mail/reports/transfer',require(_0xa384('0xe7')));_0x393f43['use']('/api/chat/reports/transfer',require(_0xa384('0xe8')));_0x393f43['use']('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x393f43[_0xa384('0x9')]('/api/openchannel/reports/transfer',require(_0xa384('0xe9')));_0x393f43['use'](_0xa384('0xea'),require(_0xa384('0xeb')));_0x393f43[_0xa384('0x9')]('/api/cm/lists',require(_0xa384('0xec')));_0x393f43[_0xa384('0x9')](_0xa384('0xed'),require(_0xa384('0xee')));_0x393f43['use']('/api/userProfiles',require(_0xa384('0xef')));_0x393f43[_0xa384('0x9')]('/api/userProfile/sections',require(_0xa384('0xf0')));_0x393f43[_0xa384('0x9')]('/api/userProfile/resources',require(_0xa384('0xf1')));_0x393f43[_0xa384('0x9')](_0xa384('0xf2'),require('./api/userNotification'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/applications',require(_0xa384('0xf3')));_0x393f43[_0xa384('0x9')](_0xa384('0xf4'),require(_0xa384('0xf5')));_0x393f43['use'](_0xa384('0xf6'),require('./api/whatsappMessage'));_0x393f43[_0xa384('0x9')]('/api/whatsapp/reports/queue',require(_0xa384('0xf7')));_0x393f43[_0xa384('0x9')](_0xa384('0xf8'),require(_0xa384('0xf9')));_0x393f43[_0xa384('0x9')](_0xa384('0xfa'),require(_0xa384('0xfb')));_0x393f43[_0xa384('0x9')](_0xa384('0xfc'),require(_0xa384('0xfd')));_0x393f43[_0xa384('0x9')](_0xa384('0xfe'),require(_0xa384('0xff')));_0x393f43[_0xa384('0x9')](_0xa384('0x100'),require(_0xa384('0x101')));_0x393f43['use'](_0xa384('0x102'),require(_0xa384('0x103')));_0x393f43['use'](_0xa384('0x104'),require(_0xa384('0x105')));_0x393f43[_0xa384('0x9')](_0xa384('0x106'),require('./api/rpc'));_0x393f43[_0xa384('0x9')](_0xa384('0x107'),require('./api/version'));_0x393f43[_0xa384('0x9')](_0xa384('0x108'),require(_0xa384('0x109')));_0x393f43[_0xa384('0x9')](_0xa384('0x10a'),require('./api/pm2'));_0x393f43[_0xa384('0x9')]('/api/webbar',require(_0xa384('0x10b')));_0x393f43['use']('/apidoc',express[_0xa384('0x10c')](path[_0xa384('0x10d')](config[_0xa384('0x10e')],_0xa384('0x10f'))));_0x393f43['use'](_0xa384('0x110'),express[_0xa384('0x10c')](path[_0xa384('0x10d')](config['root'],'/www')));_0x393f43[_0xa384('0x9')](_0xa384('0x111'),express[_0xa384('0x10c')](path[_0xa384('0x10d')](config['root'],_0xa384('0x111'))));_0x393f43[_0xa384('0x9')]('/snippet',express['static'](path[_0xa384('0x10d')](config['root'],_0xa384('0x112'),_0xa384('0x113'))));_0x393f43[_0xa384('0x9')]('/plugins',express[_0xa384('0x10c')](path[_0xa384('0x10d')](config[_0xa384('0x10e')],_0xa384('0x114'))));_0x393f43[_0xa384('0x115')](_0xa384('0x116'))[_0xa384('0x117')](errors[0x194]);_0x393f43[_0xa384('0x115')]('/*')[_0xa384('0x117')](function(_0x4c0a80,_0x13fa3b){_0x13fa3b['sendFile'](path[_0xa384('0x118')](_0x393f43[_0xa384('0x117')](_0xa384('0x119'))+_0xa384('0x11a')));});};var sensitiveFields=[_0xa384('0x11b'),'password',_0xa384('0x11c'),'apiKey',_0xa384('0x11d'),_0xa384('0x11e'),'street',_0xa384('0x11f'),_0xa384('0x120'),'fax',_0xa384('0x121'),'clientId',_0xa384('0x122'),_0xa384('0x123'),'code',_0xa384('0x124'),_0xa384('0x125'),_0xa384('0x126'),_0xa384('0x127'),_0xa384('0x128'),_0xa384('0x129'),_0xa384('0x12a'),_0xa384('0x12b'),'consumerSecret',_0xa384('0x12c'),_0xa384('0x12d'),_0xa384('0x12e'),_0xa384('0x12f'),_0xa384('0x130'),'clientEmail',_0xa384('0x131'),'accesskeyid','secretaccesskey',_0xa384('0x132'),_0xa384('0x15'),_0xa384('0x133'),_0xa384('0x134'),'localstationid',_0xa384('0x135'),'secret','registry','oldPassword'];function maskSensitiveData(_0x3911bf){var _0x30e5b7=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x3911bf))return;for(var _0x29c366 in _0x3911bf){if(_[_0xa384('0x136')](_0x3911bf[_0x29c366])){for(var _0xeb65ce=0x0;_0xeb65ce<_0x3911bf[_0x29c366][_0xa384('0x137')];_0xeb65ce++){maskSensitiveData(_0x3911bf[_0x29c366][_0xeb65ce]);}}else if(_['isPlainObject'](_0x3911bf[_0x29c366])){maskSensitiveData(_0x3911bf[_0x29c366]);}else if(_[_0xa384('0x138')](_0x3911bf[_0x29c366])){_0x3911bf[_0x29c366]=_0x3911bf[_0x29c366][_0xa384('0x139')](/{{{/g,_0xa384('0x13a'))[_0xa384('0x139')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa384('0x139')](/}}/g,'}@');if(_[_0xa384('0x13b')](sensitiveFields,_0x29c366)){_0x3911bf[_0x29c366]=_0x3911bf[_0x29c366]['replace'](_0x30e5b7,'*');}}}} \ No newline at end of file +var _0x70c2=['./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/webbar','/apidoc','static','join','/www','/demo','root','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','./errors','./config/logger','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','role','inspect','%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)','format','url','device','agent_name','test','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','./api/tag','/api/templates','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer'];(function(_0x2b29ec,_0x4adf37){var _0x4ecf27=function(_0x11ff01){while(--_0x11ff01){_0x2b29ec['push'](_0x2b29ec['shift']());}};_0x4ecf27(++_0x4adf37);}(_0x70c2,0x1a7));var _0x270c=function(_0x3a0882,_0x1aed4c){_0x3a0882=_0x3a0882-0x0;var _0x3eca1b=_0x70c2[_0x3a0882];return _0x3eca1b;};'use strict';var _=require(_0x270c('0x0'));var path=require(_0x270c('0x1'));var express=require(_0x270c('0x2'));var ewinston=require(_0x270c('0x3'));var util=require('util');var errors=require(_0x270c('0x4'));var config=require('./config/environment');var logger=require(_0x270c('0x5'))(_0x270c('0x6'));var authLogger=require(_0x270c('0x5'))(_0x270c('0x7'));exports['default']=function(_0x50b9de){_0x50b9de[_0x270c('0x8')](ewinston[_0x270c('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x15c224,_0x10b9ca){var _0x2100c9=_0x270c('0xa');if(!_[_0x270c('0xb')](_0x15c224['body'])){_0x2100c9+='\x20body=%s';var _0x149e83=_0x15c224['body'];maskSensitiveData(_0x149e83);}return util['format'](_0x2100c9,_0x15c224[_0x270c('0xc')],_0x15c224[_0x270c('0xd')][_0x270c('0xe')]?_0x15c224[_0x270c('0xd')][_0x270c('0xe')]:_0x15c224[_0x270c('0xf')][_0x270c('0x10')]||_0x15c224['ip'],_0x15c224['url'],_0x10b9ca[_0x270c('0x11')],_0x10b9ca[_0x270c('0x12')],_0x15c224[_0x270c('0x13')]?_0x15c224[_0x270c('0x13')]['id']:null,_0x15c224[_0x270c('0x13')]?_0x15c224[_0x270c('0x13')][_0x270c('0x14')]:null,_0x15c224[_0x270c('0x13')]?_0x15c224[_0x270c('0x13')][_0x270c('0x15')]:null,_0x149e83?util[_0x270c('0x16')](_0x149e83,![],null):'');}}));_0x50b9de[_0x270c('0x8')](ewinston[_0x270c('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x258d8c,_0x4830fa){var _0x1a53c9=_0x270c('0x17');if(_0x258d8c['body']&&_0x258d8c['body']['device']&&_0x258d8c[_0x270c('0x18')][_0x270c('0x19')]){_0x1a53c9=_0x270c('0x1a');}return util[_0x270c('0x1b')](_0x1a53c9,_0x258d8c[_0x270c('0xc')],_0x258d8c[_0x270c('0xd')][_0x270c('0xe')]?_0x258d8c['headers'][_0x270c('0xe')]:_0x258d8c['connection'][_0x270c('0x10')]||_0x258d8c['ip'],_0x258d8c[_0x270c('0x1c')],_0x4830fa[_0x270c('0x11')],_0x4830fa[_0x270c('0x12')],_0x258d8c[_0x270c('0x13')]?_0x258d8c['user']['id']:null,_0x258d8c[_0x270c('0x13')]?_0x258d8c[_0x270c('0x13')][_0x270c('0x14')]:null,_0x258d8c[_0x270c('0x13')]?_0x258d8c['user']['role']:null,_0x258d8c[_0x270c('0x18')]&&_0x258d8c['body'][_0x270c('0x1d')]?_0x258d8c[_0x270c('0x18')][_0x270c('0x1d')]:'other',_0x258d8c[_0x270c('0x18')]&&_0x258d8c[_0x270c('0x18')][_0x270c('0x19')]?_0x258d8c[_0x270c('0x18')]['agent_id']:'',_0x258d8c[_0x270c('0x18')]&&_0x258d8c['body'][_0x270c('0x1e')]?_0x258d8c['body']['agent_name']:'');},'ignoreRoute':function(_0x189e22){var _0x410e78=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x410e78[_0x270c('0x1f')](_0x189e22[_0x270c('0x1c')]);}}));_0x50b9de[_0x270c('0x8')]('/api/users',require(_0x270c('0x20')));_0x50b9de[_0x270c('0x8')]('/api/voice/chanspy',require(_0x270c('0x21')));_0x50b9de[_0x270c('0x8')](_0x270c('0x22'),require(_0x270c('0x23')));_0x50b9de[_0x270c('0x8')](_0x270c('0x24'),require('./api/voiceExtension'));_0x50b9de[_0x270c('0x8')](_0x270c('0x25'),require(_0x270c('0x26')));_0x50b9de[_0x270c('0x8')]('/api/voice/queues',require(_0x270c('0x27')));_0x50b9de['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x50b9de[_0x270c('0x8')](_0x270c('0x28'),require('./api/screenRecording'));_0x50b9de[_0x270c('0x8')](_0x270c('0x29'),require(_0x270c('0x2a')));_0x50b9de[_0x270c('0x8')](_0x270c('0x2b'),require('./api/voiceMailMessage'));_0x50b9de[_0x270c('0x8')](_0x270c('0x2c'),require(_0x270c('0x2d')));_0x50b9de[_0x270c('0x8')](_0x270c('0x2e'),require(_0x270c('0x2f')));_0x50b9de['use']('/api/voice/agents/reports',require(_0x270c('0x30')));_0x50b9de[_0x270c('0x8')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x50b9de[_0x270c('0x8')](_0x270c('0x31'),require(_0x270c('0x32')));_0x50b9de[_0x270c('0x8')](_0x270c('0x33'),require(_0x270c('0x34')));_0x50b9de[_0x270c('0x8')]('/api/voice/transfers/reports',require(_0x270c('0x35')));_0x50b9de[_0x270c('0x8')](_0x270c('0x36'),require(_0x270c('0x37')));_0x50b9de['use'](_0x270c('0x38'),require('./api/mailAccount'));_0x50b9de['use']('/api/mail/queues',require('./api/mailQueue'));_0x50b9de[_0x270c('0x8')](_0x270c('0x39'),require('./api/mailSubstatus'));_0x50b9de[_0x270c('0x8')](_0x270c('0x3a'),require(_0x270c('0x3b')));_0x50b9de['use'](_0x270c('0x3c'),require(_0x270c('0x3d')));_0x50b9de['use'](_0x270c('0x3e'),require(_0x270c('0x3f')));_0x50b9de['use']('/api/mail/reports/queue',require(_0x270c('0x40')));_0x50b9de['use'](_0x270c('0x41'),require(_0x270c('0x42')));_0x50b9de[_0x270c('0x8')](_0x270c('0x43'),require(_0x270c('0x44')));_0x50b9de[_0x270c('0x8')](_0x270c('0x45'),require(_0x270c('0x46')));_0x50b9de['use'](_0x270c('0x47'),require(_0x270c('0x48')));_0x50b9de[_0x270c('0x8')]('/api/fax/interactions',require('./api/faxInteraction'));_0x50b9de[_0x270c('0x8')]('/api/fax/messages',require('./api/faxMessage'));_0x50b9de['use']('/api/fax/queues',require(_0x270c('0x49')));_0x50b9de['use'](_0x270c('0x4a'),require(_0x270c('0x4b')));_0x50b9de[_0x270c('0x8')]('/api/sms/accounts',require(_0x270c('0x4c')));_0x50b9de[_0x270c('0x8')](_0x270c('0x4d'),require('./api/smsApplication'));_0x50b9de[_0x270c('0x8')](_0x270c('0x4e'),require(_0x270c('0x4f')));_0x50b9de[_0x270c('0x8')](_0x270c('0x50'),require(_0x270c('0x51')));_0x50b9de[_0x270c('0x8')](_0x270c('0x52'),require('./api/smsQueue'));_0x50b9de[_0x270c('0x8')](_0x270c('0x53'),require(_0x270c('0x54')));_0x50b9de[_0x270c('0x8')](_0x270c('0x55'),require('./api/openchannelApplication'));_0x50b9de[_0x270c('0x8')](_0x270c('0x56'),require(_0x270c('0x57')));_0x50b9de[_0x270c('0x8')](_0x270c('0x58'),require('./api/openchannelMessage'));_0x50b9de[_0x270c('0x8')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x50b9de[_0x270c('0x8')](_0x270c('0x59'),require(_0x270c('0x5a')));_0x50b9de[_0x270c('0x8')](_0x270c('0x5b'),require(_0x270c('0x5c')));_0x50b9de[_0x270c('0x8')](_0x270c('0x5d'),require('./api/chatApplication'));_0x50b9de['use'](_0x270c('0x5e'),require(_0x270c('0x5f')));_0x50b9de[_0x270c('0x8')](_0x270c('0x60'),require(_0x270c('0x61')));_0x50b9de[_0x270c('0x8')](_0x270c('0x62'),require(_0x270c('0x63')));_0x50b9de[_0x270c('0x8')](_0x270c('0x64'),require(_0x270c('0x65')));_0x50b9de[_0x270c('0x8')](_0x270c('0x66'),require(_0x270c('0x67')));_0x50b9de[_0x270c('0x8')](_0x270c('0x68'),require(_0x270c('0x69')));_0x50b9de['use'](_0x270c('0x6a'),require(_0x270c('0x6b')));_0x50b9de[_0x270c('0x8')](_0x270c('0x6c'),require(_0x270c('0x6d')));_0x50b9de[_0x270c('0x8')]('/api/cm/hopper',require(_0x270c('0x6e')));_0x50b9de[_0x270c('0x8')](_0x270c('0x6f'),require(_0x270c('0x70')));_0x50b9de['use'](_0x270c('0x71'),require(_0x270c('0x72')));_0x50b9de[_0x270c('0x8')](_0x270c('0x73'),require(_0x270c('0x74')));_0x50b9de[_0x270c('0x8')]('/api/cm/custom_fields',require(_0x270c('0x75')));_0x50b9de[_0x270c('0x8')](_0x270c('0x76'),require(_0x270c('0x77')));_0x50b9de[_0x270c('0x8')]('/api/automations',require(_0x270c('0x78')));_0x50b9de[_0x270c('0x8')](_0x270c('0x79'),require(_0x270c('0x7a')));_0x50b9de['use']('/api/dispositions',require(_0x270c('0x7b')));_0x50b9de[_0x270c('0x8')](_0x270c('0x7c'),require(_0x270c('0x7d')));_0x50b9de['use']('/api/intervals',require(_0x270c('0x7e')));_0x50b9de[_0x270c('0x8')]('/api/pauses',require(_0x270c('0x7f')));_0x50b9de['use'](_0x270c('0x80'),require(_0x270c('0x81')));_0x50b9de['use'](_0x270c('0x82'),require(_0x270c('0x83')));_0x50b9de[_0x270c('0x8')]('/api/schedules',require('./api/schedule'));_0x50b9de['use'](_0x270c('0x84'),require(_0x270c('0x85')));_0x50b9de[_0x270c('0x8')]('/api/tags',require(_0x270c('0x86')));_0x50b9de[_0x270c('0x8')](_0x270c('0x87'),require('./api/template'));_0x50b9de[_0x270c('0x8')]('/api/triggers',require(_0x270c('0x88')));_0x50b9de['use'](_0x270c('0x89'),require('./api/variable'));_0x50b9de[_0x270c('0x8')](_0x270c('0x8a'),require(_0x270c('0x8b')));_0x50b9de['use'](_0x270c('0x8c'),require(_0x270c('0x8d')));_0x50b9de[_0x270c('0x8')]('/api/analytics/custom_reports',require(_0x270c('0x8e')));_0x50b9de['use'](_0x270c('0x8f'),require(_0x270c('0x90')));_0x50b9de[_0x270c('0x8')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x50b9de['use'](_0x270c('0x91'),require(_0x270c('0x92')));_0x50b9de[_0x270c('0x8')]('/api/analytics/field_reports',require(_0x270c('0x93')));_0x50b9de[_0x270c('0x8')](_0x270c('0x94'),require('./api/analyticTreeReport'));_0x50b9de[_0x270c('0x8')](_0x270c('0x95'),require(_0x270c('0x96')));_0x50b9de[_0x270c('0x8')](_0x270c('0x97'),require(_0x270c('0x98')));_0x50b9de[_0x270c('0x8')](_0x270c('0x99'),require(_0x270c('0x9a')));_0x50b9de[_0x270c('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x270c('0x9b')));_0x50b9de[_0x270c('0x8')](_0x270c('0x9c'),require(_0x270c('0x9d')));_0x50b9de['use'](_0x270c('0x9e'),require(_0x270c('0x9f')));_0x50b9de['use']('/api/integrations/desk/accounts',require(_0x270c('0xa0')));_0x50b9de[_0x270c('0x8')](_0x270c('0xa1'),require('./api/intDeskConfiguration'));_0x50b9de['use'](_0x270c('0xa2'),require(_0x270c('0xa3')));_0x50b9de[_0x270c('0x8')](_0x270c('0xa4'),require('./api/intZohoAccount'));_0x50b9de[_0x270c('0x8')](_0x270c('0xa5'),require(_0x270c('0xa6')));_0x50b9de['use'](_0x270c('0xa7'),require(_0x270c('0xa8')));_0x50b9de[_0x270c('0x8')](_0x270c('0xa9'),require(_0x270c('0xaa')));_0x50b9de[_0x270c('0x8')](_0x270c('0xab'),require(_0x270c('0xac')));_0x50b9de[_0x270c('0x8')]('/api/integrations/zendesk/fields',require(_0x270c('0xad')));_0x50b9de['use'](_0x270c('0xae'),require(_0x270c('0xaf')));_0x50b9de[_0x270c('0x8')]('/api/integrations/freshdesk/configurations',require(_0x270c('0xb0')));_0x50b9de['use'](_0x270c('0xb1'),require(_0x270c('0xb2')));_0x50b9de[_0x270c('0x8')]('/api/integrations/vtiger/accounts',require(_0x270c('0xb3')));_0x50b9de[_0x270c('0x8')](_0x270c('0xb4'),require(_0x270c('0xb5')));_0x50b9de[_0x270c('0x8')]('/api/integrations/vtiger/fields',require(_0x270c('0xb6')));_0x50b9de[_0x270c('0x8')](_0x270c('0xb7'),require(_0x270c('0xb8')));_0x50b9de['use']('/api/integrations/servicenow/configurations',require(_0x270c('0xb9')));_0x50b9de[_0x270c('0x8')](_0x270c('0xba'),require('./api/intServicenowField'));_0x50b9de[_0x270c('0x8')]('/api/integrations/dynamics365/accounts',require(_0x270c('0xbb')));_0x50b9de['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x50b9de[_0x270c('0x8')]('/api/integrations/dynamics365/fields',require(_0x270c('0xbc')));_0x50b9de[_0x270c('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x50b9de['use'](_0x270c('0xbd'),require('./api/intFreshsalesConfiguration'));_0x50b9de[_0x270c('0x8')](_0x270c('0xbe'),require(_0x270c('0xbf')));_0x50b9de[_0x270c('0x8')](_0x270c('0xc0'),require(_0x270c('0xc1')));_0x50b9de[_0x270c('0x8')](_0x270c('0xc2'),require('./api/chatQueueReport'));_0x50b9de['use'](_0x270c('0xc3'),require(_0x270c('0xc4')));_0x50b9de['use']('/api/jscripty/answers/reports',require(_0x270c('0xc5')));_0x50b9de['use'](_0x270c('0xc6'),require('./api/jscriptyQuestionReport'));_0x50b9de[_0x270c('0x8')]('/api/jscripty/sessions/reports',require(_0x270c('0xc7')));_0x50b9de[_0x270c('0x8')](_0x270c('0xc8'),require(_0x270c('0xc9')));_0x50b9de[_0x270c('0x8')](_0x270c('0xca'),require(_0x270c('0xcb')));_0x50b9de['use'](_0x270c('0xcc'),require('./api/squareReportDetail'));_0x50b9de[_0x270c('0x8')](_0x270c('0xcd'),require(_0x270c('0xce')));_0x50b9de[_0x270c('0x8')]('/api/settings',require(_0x270c('0xcf')));_0x50b9de['use'](_0x270c('0xd0'),require(_0x270c('0xd1')));_0x50b9de['use']('/api/square/projects',require(_0x270c('0xd2')));_0x50b9de[_0x270c('0x8')]('/api/square/recordings',require(_0x270c('0xd3')));_0x50b9de[_0x270c('0x8')](_0x270c('0xd4'),require(_0x270c('0xd5')));_0x50b9de['use'](_0x270c('0xd6'),require(_0x270c('0xd7')));_0x50b9de[_0x270c('0x8')](_0x270c('0xd8'),require(_0x270c('0xd9')));_0x50b9de[_0x270c('0x8')](_0x270c('0xda'),require(_0x270c('0xdb')));_0x50b9de['use'](_0x270c('0xdc'),require(_0x270c('0xdd')));_0x50b9de[_0x270c('0x8')](_0x270c('0xde'),require(_0x270c('0xdf')));_0x50b9de[_0x270c('0x8')](_0x270c('0xe0'),require(_0x270c('0xe1')));_0x50b9de[_0x270c('0x8')](_0x270c('0xe2'),require(_0x270c('0xe3')));_0x50b9de[_0x270c('0x8')](_0x270c('0xe4'),require(_0x270c('0xe5')));_0x50b9de[_0x270c('0x8')](_0x270c('0xe6'),require(_0x270c('0xe7')));_0x50b9de[_0x270c('0x8')](_0x270c('0xe8'),require(_0x270c('0xe9')));_0x50b9de['use'](_0x270c('0xea'),require(_0x270c('0xeb')));_0x50b9de[_0x270c('0x8')](_0x270c('0xec'),require(_0x270c('0xed')));_0x50b9de[_0x270c('0x8')](_0x270c('0xee'),require('./api/voicePrefix'));_0x50b9de[_0x270c('0x8')]('/api/userProfiles',require(_0x270c('0xef')));_0x50b9de[_0x270c('0x8')](_0x270c('0xf0'),require(_0x270c('0xf1')));_0x50b9de[_0x270c('0x8')](_0x270c('0xf2'),require(_0x270c('0xf3')));_0x50b9de[_0x270c('0x8')](_0x270c('0xf4'),require(_0x270c('0xf5')));_0x50b9de[_0x270c('0x8')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x50b9de[_0x270c('0x8')]('/api/whatsapp/applications',require(_0x270c('0xf6')));_0x50b9de[_0x270c('0x8')](_0x270c('0xf7'),require(_0x270c('0xf8')));_0x50b9de[_0x270c('0x8')](_0x270c('0xf9'),require(_0x270c('0xfa')));_0x50b9de[_0x270c('0x8')](_0x270c('0xfb'),require('./api/whatsappQueueReport'));_0x50b9de[_0x270c('0x8')](_0x270c('0xfc'),require(_0x270c('0xfd')));_0x50b9de['use']('/api/whatsapp/queues',require(_0x270c('0xfe')));_0x50b9de[_0x270c('0x8')]('/api/cloudProviders',require(_0x270c('0xff')));_0x50b9de[_0x270c('0x8')](_0x270c('0x100'),require('./api/realtime'));_0x50b9de[_0x270c('0x8')]('/api/auth/local',require('./api/authLocal'));_0x50b9de[_0x270c('0x8')](_0x270c('0x101'),require(_0x270c('0x102')));_0x50b9de[_0x270c('0x8')](_0x270c('0x103'),require('./api/jira'));_0x50b9de[_0x270c('0x8')](_0x270c('0x104'),require(_0x270c('0x105')));_0x50b9de[_0x270c('0x8')](_0x270c('0x106'),require(_0x270c('0x107')));_0x50b9de[_0x270c('0x8')]('/api/system',require(_0x270c('0x108')));_0x50b9de[_0x270c('0x8')]('/api/pm2',require('./api/pm2'));_0x50b9de[_0x270c('0x8')](_0x270c('0x109'),require('./api/webbar'));_0x50b9de[_0x270c('0x8')](_0x270c('0x10a'),express[_0x270c('0x10b')](path[_0x270c('0x10c')](config['root'],'/apidoc')));_0x50b9de[_0x270c('0x8')](_0x270c('0x10d'),express['static'](path[_0x270c('0x10c')](config['root'],_0x270c('0x10d'))));_0x50b9de[_0x270c('0x8')](_0x270c('0x10e'),express['static'](path[_0x270c('0x10c')](config[_0x270c('0x10f')],_0x270c('0x10e'))));_0x50b9de['use'](_0x270c('0x110'),express[_0x270c('0x10b')](path[_0x270c('0x10c')](config[_0x270c('0x10f')],_0x270c('0x111'),_0x270c('0x112'))));_0x50b9de[_0x270c('0x8')](_0x270c('0x113'),express[_0x270c('0x10b')](path[_0x270c('0x10c')](config[_0x270c('0x10f')],_0x270c('0x114'))));_0x50b9de[_0x270c('0x115')](_0x270c('0x116'))[_0x270c('0x117')](errors[0x194]);_0x50b9de[_0x270c('0x115')]('/*')[_0x270c('0x117')](function(_0x4e30ef,_0x1f6790){_0x1f6790[_0x270c('0x118')](path[_0x270c('0x119')](_0x50b9de[_0x270c('0x117')](_0x270c('0x11a'))+_0x270c('0x11b')));});};var sensitiveFields=[_0x270c('0x11c'),_0x270c('0x11d'),_0x270c('0x11e'),_0x270c('0x11f'),_0x270c('0x120'),_0x270c('0x121'),_0x270c('0x122'),_0x270c('0x123'),_0x270c('0x124'),_0x270c('0x125'),_0x270c('0x126'),_0x270c('0x127'),_0x270c('0x128'),_0x270c('0x129'),_0x270c('0x12a'),'accessKey',_0x270c('0x12b'),_0x270c('0x12c'),_0x270c('0x12d'),_0x270c('0x12e'),'accessTokenSecret',_0x270c('0x12f'),_0x270c('0x130'),'consumerSecret',_0x270c('0x131'),_0x270c('0x132'),_0x270c('0x133'),_0x270c('0x134'),'vidaooApiKey',_0x270c('0x135'),_0x270c('0x136'),_0x270c('0x137'),_0x270c('0x138'),_0x270c('0x139'),_0x270c('0x13'),_0x270c('0x13a'),_0x270c('0x13b'),_0x270c('0x13c'),_0x270c('0x13d'),_0x270c('0x13e'),_0x270c('0x13f'),'oldPassword'];function maskSensitiveData(_0x33cd8d){var _0x5080a5=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x33cd8d))return;for(var _0x349160 in _0x33cd8d){if(_[_0x270c('0x140')](_0x33cd8d[_0x349160])){for(var _0x32a932=0x0;_0x32a932<_0x33cd8d[_0x349160][_0x270c('0x141')];_0x32a932++){maskSensitiveData(_0x33cd8d[_0x349160][_0x32a932]);}}else if(_['isPlainObject'](_0x33cd8d[_0x349160])){maskSensitiveData(_0x33cd8d[_0x349160]);}else if(_[_0x270c('0x142')](_0x33cd8d[_0x349160])){_0x33cd8d[_0x349160]=_0x33cd8d[_0x349160][_0x270c('0x143')](/{{{/g,_0x270c('0x144'))[_0x270c('0x143')](/}}}/g,_0x270c('0x145'))['replace'](/{{/g,'@{')[_0x270c('0x143')](/}}/g,'}@');if(_[_0x270c('0x146')](sensitiveFields,_0x349160)){_0x33cd8d[_0x349160]=_0x33cd8d[_0x349160][_0x270c('0x143')](_0x5080a5,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 19c3f79..cb0f68c 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8858=['../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.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/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x8858,0x182));var _0x8885=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x8858[_0x5d4607];return _0x5e4a86;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x8885('0x0'));var config=require('../config/environment');exports[_0x8885('0x1')]=function(){return new BPromise(function(_0x1cd881,_0x594ba7){var _0x2c7222={};_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3')));_0x2c7222=_['merge'](_0x2c7222,require('../api/voiceExtension/voiceExtension.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x4')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x5')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x6')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x7')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x8')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x9')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xa')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0xb')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0xc')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/mailServerIn/mailServerIn.rpc'));_0x2c7222=_['merge'](_0x2c7222,require('../api/mailAccount/mailAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xd')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xe')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0xf')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x10')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x11')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/faxAccount/faxAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x12')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x13')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/faxMessage/faxMessage.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x14')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x15')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x16')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x17')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x18')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x19')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1c')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x1d')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x1e')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x1f')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x20')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/chatQueue/chatQueue.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x21')));_0x2c7222=_['merge'](_0x2c7222,require('../api/cmHopper/cmHopper.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x22')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x23')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x24')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x25')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x26')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x27')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x28')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x29')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x2c')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2d')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x2e')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x2f')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x30')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x31')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x32')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x33')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x34')));_0x2c7222=_['merge'](_0x2c7222,require('../api/squareOdbc/squareOdbc.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x35')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x36')));_0x2c7222=_['merge'](_0x2c7222,require('../api/squareMessage/squareMessage.rpc'));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x37')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x38')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x39')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3a')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3b')));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2c7222=_[_0x8885('0x2')](_0x2c7222,require(_0x8885('0x3c')));_0x2c7222=_['merge'](_0x2c7222,require(_0x8885('0x3d')));var _0x50bd64=jayson['server'](_0x2c7222)['http']();var _0xd18e65=config['rpc'][_0x8885('0x3e')]||config[_0x8885('0x3e')]+0x1;var _0x39bf9c=config[_0x8885('0x3f')]['ip']||_0x8885('0x40');_0x50bd64['on'](_0x8885('0x41'),function(_0x29ef78){return _0x594ba7(_0x29ef78);});_0x50bd64[_0x8885('0x1')](_0xd18e65,_0x39bf9c,function(){console[_0x8885('0x42')](_0x8885('0x43'),_0x39bf9c,_0xd18e65);require('../config/triggers')[_0x8885('0x44')]();return _0x1cd881(_0x8885('0x45')+_0x39bf9c+':'+_0xd18e65);});});}; \ No newline at end of file +var _0x4501=['../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','rpc','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','lodash','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x4501,0xe8));var _0x1450=function(_0x48e75a,_0xd4a352){_0x48e75a=_0x48e75a-0x0;var _0x46be13=_0x4501[_0x48e75a];return _0x46be13;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1450('0x0'));var _=require(_0x1450('0x1'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x348595,_0x4a01e0){var _0x2b0652={};_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/user/user.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x3')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x4')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x5')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x6')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x7')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x8')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x9')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/memberReport/memberReport.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xa')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xb')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xc')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xd')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/mailAccount/mailAccount.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xe')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/mailInteraction/mailInteraction.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0xf')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x10')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x11')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x12')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x13')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/faxInteraction/faxInteraction.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x14')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x15')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x16')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x17')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x18')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/smsQueue/smsQueue.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x19')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x1a')));_0x2b0652=_['merge'](_0x2b0652,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x1b')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x1c')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x1d')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x1e')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x1f')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x20')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x21')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x22')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x23')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x24')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x25')));_0x2b0652=_['merge'](_0x2b0652,require('../api/pause/pause.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/sound/sound.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x26')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x27')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/variable/variable.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x28')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x29')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x2a')));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x2b')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x2c')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x2d')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x2e')));_0x2b0652=_['merge'](_0x2b0652,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x2f')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x30')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/setting/setting.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x31')));_0x2b0652=_['merge'](_0x2b0652,require('../api/squareProject/squareProject.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/squareRecording/squareRecording.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x32')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x33')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x34')));_0x2b0652=_['merge'](_0x2b0652,require('../api/plugin/plugin.rpc'));_0x2b0652=_['merge'](_0x2b0652,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x35')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require(_0x1450('0x36')));_0x2b0652=_[_0x1450('0x2')](_0x2b0652,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x2b0652=_['merge'](_0x2b0652,require(_0x1450('0x37')));var _0x4045b0=jayson['server'](_0x2b0652)[_0x1450('0x38')]();var _0x53d70a=config['rpc'][_0x1450('0x39')]||config[_0x1450('0x39')]+0x1;var _0x31ecc7=config[_0x1450('0x3a')]['ip']||'localhost';_0x4045b0['on'](_0x1450('0x3b'),function(_0x4ba585){return _0x4a01e0(_0x4ba585);});_0x4045b0[_0x1450('0x3c')](_0x53d70a,_0x31ecc7,function(){console[_0x1450('0x3d')](_0x1450('0x3e'),_0x31ecc7,_0x53d70a);require(_0x1450('0x3f'))['default']();return _0x348595(_0x1450('0x40')+_0x31ecc7+':'+_0x53d70a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 9c57d8b..c141486 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 _0x8a25=['sendRequest','sync','prototype','answer','ANSWER','getData','format','noop','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits'];(function(_0x44748f,_0x41e09f){var _0x5139cf=function(_0x462b07){while(--_0x462b07){_0x44748f['push'](_0x44748f['shift']());}};_0x5139cf(++_0x41e09f);}(_0x8a25,0xb7));var _0x58a2=function(_0x25a5ba,_0xfa6304){_0x25a5ba=_0x25a5ba-0x0;var _0x4fbd32=_0x8a25[_0x25a5ba];return _0x4fbd32;};'use strict';var util=require(_0x58a2('0x0'));var _=require(_0x58a2('0x1'));var EventEmitter=require(_0x58a2('0x2'))[_0x58a2('0x3')];var AGIReply=require(_0x58a2('0x4'));var AGIError=require(_0x58a2('0x5'));function AGIChannel(_0x50fb66){var _0x130516=this,_0x5abbe9=new AGIReply(),_0x49d684=![],_0x403b8e={};EventEmitter[_0x58a2('0x6')](_0x130516);_0x50fb66[_0x58a2('0x7')](_0x58a2('0x8'));_0x50fb66[_0x58a2('0x9')](0x8*0x3c*0x3c*0x3e8);_0x5abbe9[_0x58a2('0x7')](_0x58a2('0x8'));_0x5abbe9['on']('headers',function(_0x31c4c0){for(var _0x12d2b8 in _0x31c4c0){_0x130516[_0x12d2b8]=_0x31c4c0[_0x12d2b8];}_0x130516[_0x58a2('0xa')](_0x58a2('0xb'));});_0x5abbe9['on']('line',function(_0x48c230){if(_0x48c230[_0x58a2('0xc')]()=='hangup'){_0x130516['emit'](_0x58a2('0xd'));return;}if(_0x48c230[_0x58a2('0xe')](0x0,0xb)==_0x58a2('0xf')){_0x49d684=!![];}if(_0x49d684){_0x403b8e['rx']+=_0x48c230+'\x0a';if(_0x48c230[_0x58a2('0x10')](_0x58a2('0x11'))!=-0x1){_0x49d684=![];}}else{_0x403b8e['rx']=_0x48c230;}if(_0x49d684){return;}if(typeof _0x403b8e['cb']==_0x58a2('0x12')){var _0x52c57d=_0x403b8e['rx'][_0x58a2('0xe')](0x0,0x3),_0x4f2259=null,_0xedaa71=null;_0x52c57d=parseInt(_0x52c57d);if(isNaN(_0x52c57d)){_0x403b8e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x58a2('0x13')});return;}if(_0x52c57d!=0xc8){_0x403b8e['cb'](null,{'code':_0x52c57d,'result':-0x1,'extra':'KO'});return;}_0x4f2259=_0x403b8e['rx'][_0x58a2('0xe')](0x4)[_0x58a2('0x14')](_0x58a2('0x15'),'');if(_0x4f2259[_0x58a2('0x16')]('\x20')!=-0x1){_0x4f2259=_0x4f2259[_0x58a2('0x17')](0x0,_0x4f2259[_0x58a2('0x16')]('\x20'));}if(_[_0x58a2('0x18')](_0x4f2259,'-1')){_0x4f2259=parseInt(_0x4f2259);}_0xedaa71=_0x403b8e['rx'][_0x58a2('0x19')]('\x20');if(_0xedaa71[_0x58a2('0x1a')]==0x3){_0xedaa71=_0xedaa71[0x2]['substring'](0x1,_0xedaa71[0x2]['length']-0x1);}else if(_0xedaa71[_0x58a2('0x1a')]>0x3){var _0x5a138e=/\((.+)\)/;var _0x1855cc=_0x403b8e['rx'][_0x58a2('0x1b')](_0x5a138e);if(_0x1855cc){_0xedaa71=_0x1855cc[0x1];}else{_0xedaa71=null;}}else{_0xedaa71=null;}_0x403b8e['cb'](null,{'code':_0x52c57d,'result':_0x4f2259,'extra':_0xedaa71});}});_0x50fb66['on'](_0x58a2('0x1c'),function(_0x556789){_0x130516[_0x58a2('0xa')]('error',new AGIError(_0x58a2('0x1d'),_0x556789[_0x58a2('0x1e')]));});_0x50fb66['on']('close',function(){_0x130516[_0x58a2('0xa')](_0x58a2('0x1f'),new AGIError(_0x58a2('0x20')));});_0x50fb66['on'](_0x58a2('0x21'),function(){_0x130516[_0x58a2('0xa')]('timeout',new AGIError(_0x58a2('0x22')));_0x50fb66[_0x58a2('0x23')]();});_0x50fb66['pipe'](_0x5abbe9);this[_0x58a2('0x24')]=function(_0x1b5c94,_0x589c99){var _0x1b5c94=_0x1b5c94||'',_0x589c99=typeof _0x589c99==_0x58a2('0x12')?_0x589c99:new Function();_0x403b8e={'tx':_0x1b5c94,'rx':'','cb':_0x589c99};_0x50fb66[_0x58a2('0x25')](_0x1b5c94+'\x0a');},this[_0x58a2('0x1f')]=function(){_0x50fb66[_0x58a2('0x23')]();};}util[_0x58a2('0x26')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x58a2('0x27')]=function(_0x2c867b){return this[_0x58a2('0x24')][_0x58a2('0x28')](this,_0x2c867b);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2a')]=function(){return this[_0x58a2('0x27')](_0x58a2('0x2b'));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2c')]=function(_0xda514d,_0x39fe90,_0x1e3db5){_0xda514d=_0xda514d===undefined?'beep':_0xda514d;_0x39fe90=_0x39fe90===undefined?'5':_0x39fe90;_0x1e3db5=_0x1e3db5===undefined?'1':_0x1e3db5;return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0xda514d,_0x39fe90*0x3e8,_0x1e3db5));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x2e')]=function(_0x20f1ac){_0x20f1ac=_0x20f1ac||_0x58a2('0x2f');return this['sendRequest'](util[_0x58a2('0x2d')]('VERBOSE\x20\x22%s\x22',_0x20f1ac));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x30')]=function(_0x74a746,_0x5ad156){if(_['isArray'](_0x5ad156)){return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x31'),_0x74a746,_0x5ad156['join'](',')));}return this[_0x58a2('0x27')](util[_0x58a2('0x2d')](_0x58a2('0x31'),_0x74a746,_0x5ad156));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x32')]=function(_0x1a2c87){return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x33'),_0x1a2c87));};AGIChannel['prototype'][_0x58a2('0x34')]=function(_0x4f0828){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('SET\x20EXTENSION\x20%s',_0x4f0828));};AGIChannel['prototype'][_0x58a2('0x35')]=function(_0x496df9){return this['sendRequest'](util[_0x58a2('0x2d')]('SET\x20PRIORITY\x20%s',_0x496df9));};AGIChannel[_0x58a2('0x29')][_0x58a2('0xd')]=function(){return this[_0x58a2('0x27')]('HANGUP');};AGIChannel['prototype'][_0x58a2('0x36')]=function(_0x58bbac,_0x48d51b){var _0x3e0ac2=_['isBoolean'](_0x48d51b)||_[_0x58a2('0x37')](_0x48d51b)?_0x48d51b[_0x58a2('0x38')]():_0x48d51b;return this[_0x58a2('0x27')](util['format'](_0x58a2('0x39'),_0x58bbac,_0x3e0ac2?_0x3e0ac2[_0x58a2('0x38')]()[_0x58a2('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x3a')]=function(_0x11c879,_0x51a724){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')]('SAY\x20NUMBER\x20%s\x20%s',_0x11c879,_0x51a724));};AGIChannel[_0x58a2('0x29')]['sayDigits']=function(_0x3f14da,_0x5dd471){return this[_0x58a2('0x27')](util[_0x58a2('0x2d')](_0x58a2('0x3b'),_0x3f14da,_0x5dd471));};AGIChannel['prototype'][_0x58a2('0x3c')]=function(_0x4be809,_0x55d7fc){return this[_0x58a2('0x27')](util['format'](_0x58a2('0x3d'),_0x4be809,_0x55d7fc));};AGIChannel[_0x58a2('0x29')]['continueAt']=function(_0x23aa6d,_0x1d8f88,_0x55b6ce){_0x1d8f88=_0x1d8f88||this[_0x58a2('0x3e')];_0x55b6ce=_0x55b6ce||0x1;this[_0x58a2('0x32')](_0x23aa6d);this[_0x58a2('0x34')](_0x1d8f88);this['setPriority'](_0x55b6ce);return this[_0x58a2('0x2e')](util[_0x58a2('0x2d')](_0x58a2('0x3f'),_0x23aa6d,_0x1d8f88,_0x55b6ce));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x40')]=function(_0x2496b8){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2496b8));};AGIChannel['prototype'][_0x58a2('0x41')]=function(_0x44ca3e,_0xc621b4,_0x50f5b6,_0x118351,_0x162d41,_0x2198ff){_0xc621b4=_0xc621b4||'wav';_0x50f5b6=_0x50f5b6||'';_0x118351=_0x118351===undefined?-0x1:_0x118351==='-1'?-0x1:_0x118351*0x3e8;_0x162d41=_0x162d41===undefined?'':'s='+_0x162d41;_0x2198ff=_0x2198ff?_0x58a2('0x42'):'';return this['sendRequest'](util[_0x58a2('0x2d')](_0x58a2('0x43'),_0x44ca3e,_0xc621b4,_0x50f5b6,_0x118351,_0x2198ff,_0x162d41));};AGIChannel[_0x58a2('0x29')][_0x58a2('0x44')]=function(_0x36bb02,_0x30df11){_0x30df11=_0x30df11||'';return this['sendRequest'](util[_0x58a2('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x36bb02,_0x30df11));};AGIChannel[_0x58a2('0x29')]['agi']=function(_0x17b4ac){return this[_0x58a2('0x30')](_0x58a2('0x45'),_0x17b4ac);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x46')]=function(_0x35045b){return this[_0x58a2('0x30')](_0x58a2('0x47'),_0x35045b);};AGIChannel[_0x58a2('0x29')][_0x58a2('0x1c')]=function(_0x216736,_0x1a91a1){this[_0x58a2('0x2e')](util[_0x58a2('0x2d')](_0x58a2('0x48'),_0x216736['id'],_0x216736[_0x58a2('0x49')],_0x1a91a1));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xf34f=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','setEncoding','setTimeout','utf8','headers','ready','line','emit','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','result=','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','prototype','command','answer','sendRequest','ANSWER','getData'];(function(_0x382da0,_0x3a8b92){var _0x587c23=function(_0x491b57){while(--_0x491b57){_0x382da0['push'](_0x382da0['shift']());}};_0x587c23(++_0x3a8b92);}(_0xf34f,0x14d));var _0xff34=function(_0x1da2a4,_0x16f2db){_0x1da2a4=_0x1da2a4-0x0;var _0x238b4f=_0xf34f[_0x1da2a4];return _0x238b4f;};'use strict';var util=require('util');var _=require(_0xff34('0x0'));var EventEmitter=require(_0xff34('0x1'))[_0xff34('0x2')];var AGIReply=require(_0xff34('0x3'));var AGIError=require('./error');function AGIChannel(_0x3f22f6){var _0x450d67=this,_0x5a451e=new AGIReply(),_0x102211=![],_0x5b4814={};EventEmitter[_0xff34('0x4')](_0x450d67);_0x3f22f6[_0xff34('0x5')]('utf8');_0x3f22f6[_0xff34('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5a451e[_0xff34('0x5')](_0xff34('0x7'));_0x5a451e['on'](_0xff34('0x8'),function(_0x26dcf2){for(var _0x1b7cc9 in _0x26dcf2){_0x450d67[_0x1b7cc9]=_0x26dcf2[_0x1b7cc9];}_0x450d67['emit'](_0xff34('0x9'));});_0x5a451e['on'](_0xff34('0xa'),function(_0x2e6c6b){if(_0x2e6c6b['toLowerCase']()=='hangup'){_0x450d67[_0xff34('0xb')](_0xff34('0xc'));return;}if(_0x2e6c6b[_0xff34('0xd')](0x0,0xb)==_0xff34('0xe')){_0x102211=!![];}if(_0x102211){_0x5b4814['rx']+=_0x2e6c6b+'\x0a';if(_0x2e6c6b[_0xff34('0xf')](_0xff34('0x10'))!=-0x1){_0x102211=![];}}else{_0x5b4814['rx']=_0x2e6c6b;}if(_0x102211){return;}if(typeof _0x5b4814['cb']==_0xff34('0x11')){var _0x112b9e=_0x5b4814['rx'][_0xff34('0xd')](0x0,0x3),_0x571079=null,_0x29f581=null;_0x112b9e=parseInt(_0x112b9e);if(isNaN(_0x112b9e)){_0x5b4814['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x112b9e!=0xc8){_0x5b4814['cb'](null,{'code':_0x112b9e,'result':-0x1,'extra':'KO'});return;}_0x571079=_0x5b4814['rx'][_0xff34('0xd')](0x4)['replace'](_0xff34('0x12'),'');if(_0x571079[_0xff34('0x13')]('\x20')!=-0x1){_0x571079=_0x571079['substr'](0x0,_0x571079[_0xff34('0x13')]('\x20'));}if(_['startsWith'](_0x571079,'-1')){_0x571079=parseInt(_0x571079);}_0x29f581=_0x5b4814['rx']['split']('\x20');if(_0x29f581['length']==0x3){_0x29f581=_0x29f581[0x2][_0xff34('0xd')](0x1,_0x29f581[0x2][_0xff34('0x14')]-0x1);}else if(_0x29f581[_0xff34('0x14')]>0x3){var _0x5f1949=/\((.+)\)/;var _0x67342b=_0x5b4814['rx'][_0xff34('0x15')](_0x5f1949);if(_0x67342b){_0x29f581=_0x67342b[0x1];}else{_0x29f581=null;}}else{_0x29f581=null;}_0x5b4814['cb'](null,{'code':_0x112b9e,'result':_0x571079,'extra':_0x29f581});}});_0x3f22f6['on'](_0xff34('0x16'),function(_0x44c62e){_0x450d67[_0xff34('0xb')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x44c62e[_0xff34('0x17')]));});_0x3f22f6['on'](_0xff34('0x18'),function(){_0x450d67['emit']('close',new AGIError(_0xff34('0x19')));});_0x3f22f6['on'](_0xff34('0x1a'),function(){_0x450d67['emit'](_0xff34('0x1a'),new AGIError(_0xff34('0x1b')));_0x3f22f6[_0xff34('0x1c')]();});_0x3f22f6['pipe'](_0x5a451e);this['command']=function(_0x3368f7,_0x249918){var _0x3368f7=_0x3368f7||'',_0x249918=typeof _0x249918==_0xff34('0x11')?_0x249918:new Function();_0x5b4814={'tx':_0x3368f7,'rx':'','cb':_0x249918};_0x3f22f6[_0xff34('0x1d')](_0x3368f7+'\x0a');},this[_0xff34('0x18')]=function(){_0x3f22f6[_0xff34('0x1c')]();};}util[_0xff34('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0xff34('0x1f')]['sendRequest']=function(_0x1379de){return this[_0xff34('0x20')]['sync'](this,_0x1379de);};AGIChannel[_0xff34('0x1f')][_0xff34('0x21')]=function(){return this[_0xff34('0x22')](_0xff34('0x23'));};AGIChannel[_0xff34('0x1f')][_0xff34('0x24')]=function(_0x515b4b,_0x5bd851,_0x3b0dea){_0x515b4b=_0x515b4b===undefined?'beep':_0x515b4b;_0x5bd851=_0x5bd851===undefined?'5':_0x5bd851;_0x3b0dea=_0x3b0dea===undefined?'1':_0x3b0dea;return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x26'),_0x515b4b,_0x5bd851*0x3e8,_0x3b0dea));};AGIChannel['prototype'][_0xff34('0x27')]=function(_0x18ea94){_0x18ea94=_0x18ea94||_0xff34('0x28');return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x29'),_0x18ea94));};AGIChannel[_0xff34('0x1f')][_0xff34('0x2a')]=function(_0x250cc9,_0x46ae73){if(_[_0xff34('0x2b')](_0x46ae73)){return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x2c'),_0x250cc9,_0x46ae73[_0xff34('0x2d')](',')));}return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x2c'),_0x250cc9,_0x46ae73));};AGIChannel['prototype']['setContext']=function(_0x25fc86){return this[_0xff34('0x22')](util['format']('SET\x20CONTEXT\x20%s',_0x25fc86));};AGIChannel[_0xff34('0x1f')][_0xff34('0x2e')]=function(_0x18e898){return this['sendRequest'](util[_0xff34('0x25')](_0xff34('0x2f'),_0x18e898));};AGIChannel[_0xff34('0x1f')][_0xff34('0x30')]=function(_0x3d99d6){return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x31'),_0x3d99d6));};AGIChannel[_0xff34('0x1f')][_0xff34('0xc')]=function(){return this['sendRequest']('HANGUP');};AGIChannel['prototype'][_0xff34('0x32')]=function(_0x582468,_0x535d5a){var _0x21018b=_[_0xff34('0x33')](_0x535d5a)||_[_0xff34('0x34')](_0x535d5a)?_0x535d5a[_0xff34('0x35')]():_0x535d5a;return this[_0xff34('0x22')](util[_0xff34('0x25')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x582468,_0x21018b?_0x21018b[_0xff34('0x35')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xff34('0x36')]=function(_0x525177,_0x113805){return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x37'),_0x525177,_0x113805));};AGIChannel[_0xff34('0x1f')]['sayDigits']=function(_0x33c6cb,_0x4d3d69){return this['sendRequest'](util[_0xff34('0x25')](_0xff34('0x38'),_0x33c6cb,_0x4d3d69));};AGIChannel[_0xff34('0x1f')][_0xff34('0x39')]=function(_0x244c78,_0x59ae89){return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x3a'),_0x244c78,_0x59ae89));};AGIChannel[_0xff34('0x1f')][_0xff34('0x3b')]=function(_0x320cc7,_0x2295d9,_0x2c3d46){_0x2295d9=_0x2295d9||this[_0xff34('0x3c')];_0x2c3d46=_0x2c3d46||0x1;this[_0xff34('0x3d')](_0x320cc7);this['setExtension'](_0x2295d9);this[_0xff34('0x30')](_0x2c3d46);return this[_0xff34('0x27')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x320cc7,_0x2295d9,_0x2c3d46));};AGIChannel['prototype'][_0xff34('0x3e')]=function(_0xa3ad1a){return this[_0xff34('0x22')](util[_0xff34('0x25')](_0xff34('0x3f'),_0xa3ad1a));};AGIChannel[_0xff34('0x1f')][_0xff34('0x40')]=function(_0x28dc46,_0x5bc784,_0x542c3b,_0x40417b,_0x5eaecc,_0x373462){_0x5bc784=_0x5bc784||'wav';_0x542c3b=_0x542c3b||'';_0x40417b=_0x40417b===undefined?-0x1:_0x40417b==='-1'?-0x1:_0x40417b*0x3e8;_0x5eaecc=_0x5eaecc===undefined?'':'s='+_0x5eaecc;_0x373462=_0x373462?_0xff34('0x41'):'';return this['sendRequest'](util[_0xff34('0x25')](_0xff34('0x42'),_0x28dc46,_0x5bc784,_0x542c3b,_0x40417b,_0x373462,_0x5eaecc));};AGIChannel[_0xff34('0x1f')][_0xff34('0x43')]=function(_0x3a0f21,_0x489179){_0x489179=_0x489179||'';return this['sendRequest'](util[_0xff34('0x25')](_0xff34('0x44'),_0x3a0f21,_0x489179));};AGIChannel[_0xff34('0x1f')][_0xff34('0x45')]=function(_0x53d0a1){return this[_0xff34('0x2a')]('AGI',_0x53d0a1);};AGIChannel[_0xff34('0x1f')][_0xff34('0x46')]=function(_0x34285c){return this[_0xff34('0x2a')]('WAIT',_0x34285c);};AGIChannel[_0xff34('0x1f')][_0xff34('0x16')]=function(_0x4a494f,_0x29bcee){this[_0xff34('0x27')](util['format'](_0xff34('0x47'),_0x4a494f['id'],_0x4a494f[_0xff34('0x48')],_0x29bcee));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xff34('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 70572b2..713fcc6 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 _0x9198=['message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x4a23cf,_0x41cf76){var _0x53cee7=function(_0x3017a6){while(--_0x3017a6){_0x4a23cf['push'](_0x4a23cf['shift']());}};_0x53cee7(++_0x41cf76);}(_0x9198,0x13e));var _0x8919=function(_0x58cf4e,_0x58b5f4){_0x58cf4e=_0x58cf4e-0x0;var _0x2a614c=_0x9198[_0x58cf4e];return _0x2a614c;};'use strict';var util=require(_0x8919('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8919('0x1'),'E_AGI_SERVER_CLOSE':_0x8919('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8919('0x3'),'E_AGI_SOCKET_ERROR':_0x8919('0x4'),'E_AGI_SOCKET_CLOSE':_0x8919('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x8919('0x6'),'E_AGI_COMMAND_EMPTY':_0x8919('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x25f0da){var _0x25f0da=_0x25f0da||null,_0x5da611=_0x5da611||[],_0x12478d=0x1,_0x17cd40='';if(!error[_0x25f0da]){_0x25f0da=_0x8919('0x8');}_0x5da611[_0x8919('0x9')](error[_0x25f0da]);while(arguments[_0x12478d]){_0x5da611['push'](arguments[_0x12478d]);_0x12478d++;}_0x17cd40=util[_0x8919('0xa')][_0x8919('0xb')](util,_0x5da611);this[_0x8919('0xc')]=_0x17cd40;this[_0x8919('0xd')]=_0x25f0da;}module[_0x8919('0xe')]=AGIError; \ No newline at end of file +var _0xa9fb=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','name','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x584528,_0xa9e2ef){var _0x369f6f=function(_0x5175d4){while(--_0x5175d4){_0x584528['push'](_0x584528['shift']());}};_0x369f6f(++_0xa9e2ef);}(_0xa9fb,0x14c));var _0xba9f=function(_0x433ce7,_0x155d39){_0x433ce7=_0x433ce7-0x0;var _0x29bfef=_0xa9fb[_0x433ce7];return _0x29bfef;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xba9f('0x0'),'E_AGI_SERVER_ERROR':_0xba9f('0x1'),'E_AGI_SERVER_CLOSE':_0xba9f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xba9f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xba9f('0x4'),'E_AGI_SOCKET_ERROR':_0xba9f('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xba9f('0x6'),'E_AGI_COMMAND_EMPTY':_0xba9f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xba9f('0x8'),'E_AGI_IVR_ENTRY':_0xba9f('0x9')};function AGIError(_0x582ecd){var _0x582ecd=_0x582ecd||null,_0x285c4c=_0x285c4c||[],_0x319866=0x1,_0x3bf0c6='';if(!error[_0x582ecd]){_0x582ecd=_0xba9f('0xa');}_0x285c4c['push'](error[_0x582ecd]);while(arguments[_0x319866]){_0x285c4c['push'](arguments[_0x319866]);_0x319866++;}_0x3bf0c6=util[_0xba9f('0xb')][_0xba9f('0xc')](util,_0x285c4c);this[_0xba9f('0xd')]=_0x3bf0c6;this[_0xba9f('0xe')]=_0x582ecd;}module[_0xba9f('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index b1cec83..79e0fd1 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 _0x6653=['menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','size','relations','getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi'];(function(_0x1ce66a,_0x1f0111){var _0x1babbf=function(_0x2ff888){while(--_0x2ff888){_0x1ce66a['push'](_0x1ce66a['shift']());}};_0x1babbf(++_0x1f0111);}(_0x6653,0x1bd));var _0x3665=function(_0x21ac7e,_0x40bb47){_0x21ac7e=_0x21ac7e-0x0;var _0x221f22=_0x6653[_0x21ac7e];return _0x221f22;};'use strict';var _=require(_0x3665('0x0'));var logger=require(_0x3665('0x1'))(_0x3665('0x2'));var verticesWithRetry=[_0x3665('0x3'),_0x3665('0x4'),_0x3665('0x5')];var Graph=function(){this[_0x3665('0x6')]={};this[_0x3665('0x7')]={};this[_0x3665('0x8')]=0x0;};Graph[_0x3665('0x9')]['addVertex']=function(_0x31d247){this['vertices'][_0x31d247['id']]=_0x31d247;this[_0x3665('0x7')][_0x31d247['id']]=[];};Graph['prototype']['addEdge']=function(_0x2c32b8,_0x3f5a38,_0x28d061){this[_0x3665('0x7')][_0x2c32b8]['push']({'target':_0x3f5a38,'condition':_0x28d061});this[_0x3665('0x8')]+=0x1;};Graph[_0x3665('0x9')][_0x3665('0xa')]=function(){return _[_0x3665('0xa')](this['vertices']);};Graph[_0x3665('0x9')][_0x3665('0xb')]=function(){return this[_0x3665('0x8')];};Graph['prototype'][_0x3665('0xc')]=function(_0x47c6b1){return this['vertices'][_0x47c6b1];};Graph[_0x3665('0x9')]['traverseBFS']=function(_0x20f400,_0xce4dd9){if(!this[_0x3665('0x6')][_0x20f400]){return logger['info']('no\x20vertex\x20found');}var _0x1e22ea=_0xce4dd9(this[_0x3665('0x6')][_0x20f400]);if(!_0x1e22ea){return logger[_0x3665('0xd')](_0x3665('0xe'));}if(this['edges'][_0x20f400][_0x3665('0xf')]===0x0){return logger[_0x3665('0xd')](_0x3665('0x10'));}for(var _0x338185=0x0,_0x319a43=[],_0x598226=![];_0x338185\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','value','getSquareProject','then','catch','createSquareReport','agi_','inspect','debug','variables','stringify','arg_1','close','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[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'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb09a,0x10d));var _0xab09=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb09a[_0x17928f];return _0x500b63;};'use strict';var parser=require(_0xab09('0x0'));var _=require(_0xab09('0x1'));var syncho=require('syncho');var util=require(_0xab09('0x2'));var moment=require(_0xab09('0x3'));var config=require(_0xab09('0x4'));var logger=require('../../config/logger')(_0xab09('0x5'));var utilLicense=require(_0xab09('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xab09('0x7'));var Vertices=require(_0xab09('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xab09('0x5')]=_[_0xab09('0x9')](config['agi'],{'ip':_0xab09('0xa'),'port':0x11dd});function connectionHandler(_0x3140a2){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3140a2);agiHandler(_0x3140a2);}catch(_0x556191){logger[_0xab09('0xb')](_0x556191[_0xab09('0xc')]);}});});}function listeningHandler(){console['log'](_0xab09('0xd'),config['agi'][_0xab09('0xe')]);logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x11'),config[_0xab09('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x53c113){if(_0x53c113&&_0x53c113['name']&&_0x53c113[_0xab09('0x12')]){logger[_0xab09('0xb')](util[_0xab09('0x10')](_0xab09('0x13'),_0x53c113['name'],_0x53c113[_0xab09('0x12')]));}else{logger['error'](util[_0xab09('0x10')](_0xab09('0x14'),_0x53c113[_0xab09('0xc')]));}}function closeHandler(){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x15'),this['arg_1'],this[_0xab09('0x16')],this[_0xab09('0x17')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x5f6537){logger['error'](_0x5f6537[_0xab09('0xc')]);}}function timeoutHandler(){logger['info'](util[_0xab09('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0xab09('0x18')],this[_0xab09('0x19')]));}function hangupHandler(){logger['info'](util[_0xab09('0x10')](_0xab09('0x1a'),this['arg_1'],this['calleridname'],this[_0xab09('0x17')],this['dnid'],this[_0xab09('0x19')]));this[_0xab09('0x1b')]=!![];}function getRoot(_0x2b42cc){return parser['toJson'](_0x2b42cc,{'object':!![]})[_0xab09('0x1c')][_0xab09('0x1d')];}function addVertex(_0x5c5525,_0x8f553f,_0x54306b){_0x8f553f[_0xab09('0x1e')]=_0x54306b;if(_0x8f553f[_0xab09('0x1f')](_0xab09('0x20'))){_0x8f553f[_0xab09('0x21')]=parseInt(_0x8f553f[_0xab09('0x20')],0xa);}_0x5c5525[_0xab09('0x22')](_[_0xab09('0x23')](_0x8f553f,_0xab09('0x24')));}function initGraph(_0x154ef9,_0x48f8d6){var _0x9049e6=new Graph();for(var _0x2f49f2 in _0x154ef9){if(_0x154ef9[_0xab09('0x1f')](_0x2f49f2)){if(_[_0xab09('0x25')](_0x154ef9[_0x2f49f2])){for(var _0x396e49=0x0;_0x396e49<_0x154ef9[_0x2f49f2][_0xab09('0x26')];_0x396e49+=0x1){addVertex(_0x9049e6,_0x154ef9[_0x2f49f2][_0x396e49],_0x2f49f2);}}else{addVertex(_0x9049e6,_0x154ef9[_0x2f49f2],_0x2f49f2);}}}for(var _0x489e07=0x0;_0x489e07<_0x48f8d6[_0xab09('0x26')];_0x489e07+=0x1){if(_0x48f8d6[_0x489e07]['source']&&_0x48f8d6[_0x489e07]['target']){_0x9049e6['addEdge'](_0x48f8d6[_0x489e07]['source'],_0x48f8d6[_0x489e07][_0xab09('0x27')],_0x48f8d6[_0x489e07][_0xab09('0x28')]);}}return _0x9049e6;}function getSquareProject(_0x3d3f63,_0xa660ff){rpc[_0xab09('0x29')](_0x3d3f63)[_0xab09('0x2a')](function(_0x3b9619){_0xa660ff(null,_0x3b9619);})[_0xab09('0x2b')](function(_0x46944f){_0xa660ff(null,_0x46944f);});}function createSquareReport(_0x2c5bfd,_0x1b68e8){rpc[_0xab09('0x2c')](_0x2c5bfd)[_0xab09('0x2a')](function(_0x270e89){if(_0x1b68e8){_0x1b68e8(null,_0x270e89);}})[_0xab09('0x2b')](function(_0x29f91c){if(_0x1b68e8){_0x1b68e8(null,_0x29f91c);}});}function setChannelVariables(_0xda4f2c){for(var _0x2be92f in _0xda4f2c){if(_0xda4f2c[_0xab09('0x1f')](_0x2be92f)){if(_0x2be92f['indexOf'](_0xab09('0x2d'))===0x0){_0xda4f2c[_0x2be92f['substring'](0x4)]=_0xda4f2c[_0x2be92f];delete _0xda4f2c[_0x2be92f];}}}}function getLogFromObject(_0x453537){return util[_0xab09('0x2e')](_0x453537,{'showHidden':![],'depth':null});}function agiHandler(_0x2b03ef){var _0x887731,_0x2912b6,_0x24b187,_0x574637,_0x4cd4f5;logger[_0xab09('0x2f')](_0xab09('0x30'),JSON[_0xab09('0x31')](_0x2b03ef,null,0x2));logger[_0xab09('0xf')](util[_0xab09('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef['callerid'],_0x2b03ef[_0xab09('0x18')],_0x2b03ef[_0xab09('0x19')]));_0x2b03ef['on'](_0xab09('0xb'),errorHandler);_0x2b03ef['on'](_0xab09('0x33'),closeHandler);_0x2b03ef['on']('timeout',timeoutHandler);_0x2b03ef[_0xab09('0x1b')]=![];_0x2b03ef['on']('hangup',hangupHandler);var _0x2aba42=getSquareProject[_0xab09('0x34')](null,_0x2b03ef[_0xab09('0x32')]);if(_0x2aba42){if(_0x2aba42[_0xab09('0x35')]){_0x887731=getRoot(_0x2aba42[_0xab09('0x35')]);if(_0x887731&&_0x887731[_0xab09('0x36')]){logger['debug'](_0xab09('0x1d'),JSON[_0xab09('0x31')](_0x887731,null,0x2));_0x2b03ef[_0xab09('0x37')]=moment()[_0xab09('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2912b6=initGraph(_[_0xab09('0x23')](_0x887731,_0xab09('0x24')),_0x887731[_0xab09('0x24')]);_0x24b187=new Vertices(_0x2b03ef,rpc,mailRpc);logger[_0xab09('0xf')](util['format'](_0xab09('0x38'),_0x2b03ef['arg_1'],_0x2b03ef[_0xab09('0x16')],_0x2b03ef[_0xab09('0x17')],_0x2b03ef[_0xab09('0x18')],_0x2b03ef['uniqueid']));_0x2912b6[_0xab09('0x39')](_0x887731[_0xab09('0x36')]['id'],function(_0x3da9b9){try{_0x3da9b9=_0x24b187['clear'](_0x3da9b9);logger['debug'](_0xab09('0x3a'),JSON[_0xab09('0x31')](_0x3da9b9,null,0x2));if(_0x3da9b9[_0xab09('0x1e')]===_0xab09('0x3b')){logger[_0xab09('0xf')](_0xab09('0x3c'));_0x2b03ef[_0xab09('0x3d')]=_0x3da9b9[_0xab09('0x3d')]||_0x2b03ef[_0xab09('0x3d')];_0x2b03ef[_0xab09('0x3e')]=_0x3da9b9['extension'];_0x2b03ef[_0xab09('0x3f')]=_0x3da9b9[_0xab09('0x3f')]?_0x3da9b9[_0xab09('0x3f')]-0x1:0x1;return null;}else if(_0x3da9b9&&_0x24b187[_0x3da9b9[_0xab09('0x1e')]]){_0x4cd4f5=_0x24b187[_0x3da9b9[_0xab09('0x1e')]](_0x3da9b9);logger[_0xab09('0xf')](_0xab09('0x40'),JSON[_0xab09('0x31')](_0x4cd4f5,null,0x2));if(_0x4cd4f5&&_0x4cd4f5[_0xab09('0x41')]===AGI_CODE_SUCCESS&&_0x4cd4f5[_0xab09('0x42')]!==AGI_RESULT_ERROR&&!_0x2b03ef[_0xab09('0x1b')]){logger['debug'](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return _[_0xab09('0x43')](_0x4cd4f5[_0xab09('0x42')])?null:_0x4cd4f5[_0xab09('0x42')][_0xab09('0x44')]();}else{logger['error'](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return null;}}else{logger[_0xab09('0xb')](_0xab09('0x45'));return null;}}catch(_0x1cbf09){logger['error'](_0x1cbf09[_0xab09('0xc')]);return null;}});if(_0x887731[_0xab09('0x46')]){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x47'),_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef['callerid'],_0x2b03ef[_0xab09('0x18')],_0x2b03ef['uniqueid']));_0x2912b6[_0xab09('0x39')](_0x887731[_0xab09('0x46')]['id'],function(_0xaf6bac){try{_0xaf6bac=_0x24b187[_0xab09('0x48')](_0xaf6bac);logger[_0xab09('0x2f')]('vertex',JSON['stringify'](_0xaf6bac,null,0x2));if(_0xaf6bac&&_0x24b187[_0xaf6bac[_0xab09('0x1e')]]){_0x4cd4f5=_0x24b187[_0xaf6bac[_0xab09('0x1e')]](_0xaf6bac);if(_0x4cd4f5){logger[_0xab09('0x2f')](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return _[_0xab09('0x43')](_0x4cd4f5[_0xab09('0x42')])?null:_0x4cd4f5[_0xab09('0x42')]['toString']();}else{logger[_0xab09('0xb')](_0xab09('0x40'),getLogFromObject(_0x4cd4f5));return null;}}else{logger[_0xab09('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x40839a){logger[_0xab09('0xb')](_0x40839a['stack']);return null;}});}logger['info'](util[_0xab09('0x10')](_0xab09('0x49'),_0x2b03ef[_0xab09('0x32')],_0x2b03ef[_0xab09('0x16')],_0x2b03ef[_0xab09('0x17')],_0x2b03ef[_0xab09('0x18')],_0x2b03ef[_0xab09('0x19')]));logger['info'](util['format'](_0xab09('0x4a'),_0x2b03ef[_0xab09('0x3d')],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1));_0x2b03ef[_0xab09('0x4b')](_0x2b03ef[_0xab09('0x3d')],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}else{logger['error'](util[_0xab09('0x10')]('Project\x20%s\x20not\x20published',_0x2b03ef['arg_1']));_0x2b03ef[_0xab09('0x4b')](_0x2b03ef['context'],_0x2b03ef[_0xab09('0x3e')],parseInt(_0x2b03ef[_0xab09('0x3f')],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}else{logger['error'](util[_0xab09('0x10')](_0xab09('0x4c'),_0x2b03ef[_0xab09('0x32')]));_0x2b03ef['continueAt'](_0x2b03ef[_0xab09('0x3d')],_0x2b03ef['extension'],parseInt(_0x2b03ef['priority'],0xa)+0x1);_0x2b03ef[_0xab09('0x33')]();}}function main(){var _0x2cee00;return utilLicense['getLicense']()['then'](function(_0xe0d61c){if(_0xe0d61c){if(_0xe0d61c[_0xab09('0x4d')]){if(_0xe0d61c[_0xab09('0x4e')]&&_0xe0d61c[_0xab09('0x4e')]>0x0){logger[_0xab09('0xf')](util[_0xab09('0x10')](_0xab09('0x4f'),_0xe0d61c[_0xab09('0x4e')]));_0x2cee00=_0xe0d61c[_0xab09('0x4e')];}else{logger['info'](_0xab09('0x50'));}}else{logger[_0xab09('0xf')](_0xab09('0x51'));_0x2cee00=-0x1;}}})[_0xab09('0x2b')](function(_0x266a47){logger[_0xab09('0xb')](_0xab09('0x52'),_0x266a47['stack']);})[_0xab09('0x46')](function(){var _0x46638f=require(_0xab09('0x53'))(config[_0xab09('0x5')][_0xab09('0xe')],config[_0xab09('0x5')]['ip'],_0x2cee00);_0x46638f['on'](_0xab09('0xb'),errorHandler);_0x46638f['on'](_0xab09('0x54'),listeningHandler);_0x46638f['on'](_0xab09('0x55'),connectionHandler);_0x46638f['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xe86c=['[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','addEdge','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','stringify','joinAt','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','finally','agicommand\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','util','moment','../../config/environment','agi','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid'];(function(_0x5f4b36,_0x18cb34){var _0x4765ec=function(_0x2a6c85){while(--_0x2a6c85){_0x5f4b36['push'](_0x5f4b36['shift']());}};_0x4765ec(++_0x18cb34);}(_0xe86c,0x141));var _0xce86=function(_0x103978,_0x45e3e8){_0x103978=_0x103978-0x0;var _0x1508fc=_0xe86c[_0x103978];return _0x1508fc;};'use strict';var parser=require('xml2json');var _=require(_0xce86('0x0'));var syncho=require('syncho');var util=require(_0xce86('0x1'));var moment=require(_0xce86('0x2'));var config=require(_0xce86('0x3'));var logger=require('../../config/logger')(_0xce86('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0xce86('0x5'));var mailRpc=require(_0xce86('0x6'));var Graph=require(_0xce86('0x7'));var Vertices=require(_0xce86('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xce86('0x9')](config['agi'],{'ip':_0xce86('0xa'),'port':0x11dd});function connectionHandler(_0x40afb0){process[_0xce86('0xb')](function(){syncho(function(){try{setChannelVariables(_0x40afb0);agiHandler(_0x40afb0);}catch(_0xf6693c){logger[_0xce86('0xc')](_0xf6693c['stack']);}});});}function listeningHandler(){console[_0xce86('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xce86('0x4')][_0xce86('0xe')]);logger[_0xce86('0xf')](util[_0xce86('0x10')](_0xce86('0x11'),config[_0xce86('0x4')]['ip'],config[_0xce86('0x4')][_0xce86('0xe')]));}function errorHandler(_0x4cd431){if(_0x4cd431&&_0x4cd431['name']&&_0x4cd431['message']){logger['error'](util[_0xce86('0x10')](_0xce86('0x12'),_0x4cd431[_0xce86('0x13')],_0x4cd431['message']));}else{logger[_0xce86('0xc')](util[_0xce86('0x10')](_0xce86('0x14'),_0x4cd431[_0xce86('0x15')]));}}function closeHandler(){logger[_0xce86('0xf')](util['format'](_0xce86('0x16'),this[_0xce86('0x17')],this[_0xce86('0x18')],this['callerid'],this[_0xce86('0x19')],this[_0xce86('0x1a')]));try{createSquareReport(this);}catch(_0x1fb8cc){logger[_0xce86('0xc')](_0x1fb8cc[_0xce86('0x15')]);}}function timeoutHandler(){logger[_0xce86('0xf')](util['format'](_0xce86('0x1b'),this[_0xce86('0x17')],this[_0xce86('0x18')],this[_0xce86('0x1c')],this[_0xce86('0x19')],this[_0xce86('0x1a')]));}function hangupHandler(){logger['info'](util['format'](_0xce86('0x1d'),this[_0xce86('0x17')],this[_0xce86('0x18')],this[_0xce86('0x1c')],this['dnid'],this[_0xce86('0x1a')]));this[_0xce86('0x1e')]=!![];}function getRoot(_0x42e77f){return parser[_0xce86('0x1f')](_0x42e77f,{'object':!![]})[_0xce86('0x20')][_0xce86('0x21')];}function addVertex(_0x2d7630,_0x5ebeee,_0x433bfd){_0x5ebeee[_0xce86('0x22')]=_0x433bfd;if(_0x5ebeee[_0xce86('0x23')](_0xce86('0x24'))){_0x5ebeee[_0xce86('0x25')]=parseInt(_0x5ebeee[_0xce86('0x24')],0xa);}_0x2d7630[_0xce86('0x26')](_[_0xce86('0x27')](_0x5ebeee,_0xce86('0x28')));}function initGraph(_0x1be9ef,_0x15fc29){var _0x5a282a=new Graph();for(var _0x3f62a8 in _0x1be9ef){if(_0x1be9ef['hasOwnProperty'](_0x3f62a8)){if(_[_0xce86('0x29')](_0x1be9ef[_0x3f62a8])){for(var _0x324609=0x0;_0x324609<_0x1be9ef[_0x3f62a8][_0xce86('0x2a')];_0x324609+=0x1){addVertex(_0x5a282a,_0x1be9ef[_0x3f62a8][_0x324609],_0x3f62a8);}}else{addVertex(_0x5a282a,_0x1be9ef[_0x3f62a8],_0x3f62a8);}}}for(var _0x580567=0x0;_0x580567<_0x15fc29['length'];_0x580567+=0x1){if(_0x15fc29[_0x580567]['source']&&_0x15fc29[_0x580567]['target']){_0x5a282a[_0xce86('0x2b')](_0x15fc29[_0x580567][_0xce86('0x2c')],_0x15fc29[_0x580567][_0xce86('0x2d')],_0x15fc29[_0x580567][_0xce86('0x2e')]);}}return _0x5a282a;}function getSquareProject(_0x304234,_0x278228){rpc[_0xce86('0x2f')](_0x304234)[_0xce86('0x30')](function(_0x28f16a){_0x278228(null,_0x28f16a);})[_0xce86('0x31')](function(_0x2e9d8d){_0x278228(null,_0x2e9d8d);});}function createSquareReport(_0x233a53,_0x44817e){rpc[_0xce86('0x32')](_0x233a53)[_0xce86('0x30')](function(_0x2c917f){if(_0x44817e){_0x44817e(null,_0x2c917f);}})['catch'](function(_0x57d330){if(_0x44817e){_0x44817e(null,_0x57d330);}});}function setChannelVariables(_0x22c8b9){for(var _0xb6b812 in _0x22c8b9){if(_0x22c8b9[_0xce86('0x23')](_0xb6b812)){if(_0xb6b812['indexOf'](_0xce86('0x33'))===0x0){_0x22c8b9[_0xb6b812[_0xce86('0x34')](0x4)]=_0x22c8b9[_0xb6b812];delete _0x22c8b9[_0xb6b812];}}}}function getLogFromObject(_0x14a39e){return util[_0xce86('0x35')](_0x14a39e,{'showHidden':![],'depth':null});}function agiHandler(_0x30aaa6){var _0x4d8017,_0x115270,_0x2d65a9,_0x236e83,_0x2f614e;logger[_0xce86('0x36')](_0xce86('0x37'),JSON['stringify'](_0x30aaa6,null,0x2));logger[_0xce86('0xf')](util[_0xce86('0x10')](_0xce86('0x38'),_0x30aaa6['arg_1'],_0x30aaa6['calleridname'],_0x30aaa6[_0xce86('0x1c')],_0x30aaa6[_0xce86('0x19')],_0x30aaa6['uniqueid']));_0x30aaa6['on']('error',errorHandler);_0x30aaa6['on'](_0xce86('0x39'),closeHandler);_0x30aaa6['on'](_0xce86('0x3a'),timeoutHandler);_0x30aaa6['evtHangup']=![];_0x30aaa6['on'](_0xce86('0x3b'),hangupHandler);var _0x55498a=getSquareProject['sync'](null,_0x30aaa6[_0xce86('0x17')]);if(_0x55498a){if(_0x55498a[_0xce86('0x3c')]){_0x4d8017=getRoot(_0x55498a[_0xce86('0x3c')]);if(_0x4d8017&&_0x4d8017[_0xce86('0x3d')]){logger[_0xce86('0x36')]('root',JSON[_0xce86('0x3e')](_0x4d8017,null,0x2));_0x30aaa6[_0xce86('0x3f')]=moment()[_0xce86('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x115270=initGraph(_[_0xce86('0x27')](_0x4d8017,'mxCell'),_0x4d8017['mxCell']);_0x2d65a9=new Vertices(_0x30aaa6,rpc,mailRpc);logger[_0xce86('0xf')](util[_0xce86('0x10')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x30aaa6[_0xce86('0x17')],_0x30aaa6['calleridname'],_0x30aaa6[_0xce86('0x1c')],_0x30aaa6['dnid'],_0x30aaa6[_0xce86('0x1a')]));_0x115270['traverseBFS'](_0x4d8017['start']['id'],function(_0x4e7e46){try{_0x4e7e46=_0x2d65a9[_0xce86('0x40')](_0x4e7e46);logger[_0xce86('0x36')](_0xce86('0x41'),JSON[_0xce86('0x3e')](_0x4e7e46,null,0x2));if(_0x4e7e46['agicommand']===_0xce86('0x42')){logger[_0xce86('0xf')](_0xce86('0x43'));_0x30aaa6['context']=_0x4e7e46[_0xce86('0x44')]||_0x30aaa6[_0xce86('0x44')];_0x30aaa6[_0xce86('0x45')]=_0x4e7e46[_0xce86('0x45')];_0x30aaa6[_0xce86('0x46')]=_0x4e7e46['priority']?_0x4e7e46[_0xce86('0x46')]-0x1:0x1;return null;}else if(_0x4e7e46&&_0x2d65a9[_0x4e7e46[_0xce86('0x22')]]){_0x2f614e=_0x2d65a9[_0x4e7e46[_0xce86('0x22')]](_0x4e7e46);logger[_0xce86('0xf')](_0xce86('0x47'),JSON[_0xce86('0x3e')](_0x2f614e,null,0x2));if(_0x2f614e&&_0x2f614e['code']===AGI_CODE_SUCCESS&&_0x2f614e[_0xce86('0x48')]!==AGI_RESULT_ERROR&&!_0x30aaa6[_0xce86('0x1e')]){logger[_0xce86('0x36')](_0xce86('0x47'),getLogFromObject(_0x2f614e));return _[_0xce86('0x49')](_0x2f614e['result'])?null:_0x2f614e[_0xce86('0x48')][_0xce86('0x4a')]();}else{logger[_0xce86('0xc')](_0xce86('0x47'),getLogFromObject(_0x2f614e));return null;}}else{logger[_0xce86('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x2390a8){logger[_0xce86('0xc')](_0x2390a8[_0xce86('0x15')]);return null;}});if(_0x4d8017[_0xce86('0x4b')]){logger[_0xce86('0xf')](util[_0xce86('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x30aaa6[_0xce86('0x17')],_0x30aaa6['calleridname'],_0x30aaa6[_0xce86('0x1c')],_0x30aaa6[_0xce86('0x19')],_0x30aaa6['uniqueid']));_0x115270['traverseBFS'](_0x4d8017[_0xce86('0x4b')]['id'],function(_0x4f94e4){try{_0x4f94e4=_0x2d65a9[_0xce86('0x40')](_0x4f94e4);logger[_0xce86('0x36')](_0xce86('0x41'),JSON[_0xce86('0x3e')](_0x4f94e4,null,0x2));if(_0x4f94e4&&_0x2d65a9[_0x4f94e4['agicommand']]){_0x2f614e=_0x2d65a9[_0x4f94e4['agicommand']](_0x4f94e4);if(_0x2f614e){logger['debug'](_0xce86('0x47'),getLogFromObject(_0x2f614e));return _[_0xce86('0x49')](_0x2f614e[_0xce86('0x48')])?null:_0x2f614e[_0xce86('0x48')][_0xce86('0x4a')]();}else{logger[_0xce86('0xc')](_0xce86('0x47'),getLogFromObject(_0x2f614e));return null;}}else{logger[_0xce86('0xc')](_0xce86('0x4c'));return null;}}catch(_0x3f3f6a){logger[_0xce86('0xc')](_0x3f3f6a[_0xce86('0x15')]);return null;}});}logger[_0xce86('0xf')](util[_0xce86('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x30aaa6['arg_1'],_0x30aaa6[_0xce86('0x18')],_0x30aaa6[_0xce86('0x1c')],_0x30aaa6[_0xce86('0x19')],_0x30aaa6[_0xce86('0x1a')]));logger['info'](util[_0xce86('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x30aaa6[_0xce86('0x44')],_0x30aaa6[_0xce86('0x45')],parseInt(_0x30aaa6[_0xce86('0x46')],0xa)+0x1));_0x30aaa6[_0xce86('0x4d')](_0x30aaa6[_0xce86('0x44')],_0x30aaa6[_0xce86('0x45')],parseInt(_0x30aaa6[_0xce86('0x46')],0xa)+0x1);_0x30aaa6[_0xce86('0x39')]();}}else{logger[_0xce86('0xc')](util['format'](_0xce86('0x4e'),_0x30aaa6[_0xce86('0x17')]));_0x30aaa6[_0xce86('0x4d')](_0x30aaa6[_0xce86('0x44')],_0x30aaa6[_0xce86('0x45')],parseInt(_0x30aaa6['priority'],0xa)+0x1);_0x30aaa6[_0xce86('0x39')]();}}else{logger[_0xce86('0xc')](util[_0xce86('0x10')]('Project\x20%s\x20not\x20found',_0x30aaa6[_0xce86('0x17')]));_0x30aaa6[_0xce86('0x4d')](_0x30aaa6[_0xce86('0x44')],_0x30aaa6[_0xce86('0x45')],parseInt(_0x30aaa6['priority'],0xa)+0x1);_0x30aaa6[_0xce86('0x39')]();}}function main(){var _0x38e4b5;return utilLicense['getLicense']()[_0xce86('0x30')](function(_0x5d917f){if(_0x5d917f){if(_0x5d917f[_0xce86('0x4f')]){if(_0x5d917f[_0xce86('0x50')]&&_0x5d917f[_0xce86('0x50')]>0x0){logger[_0xce86('0xf')](util[_0xce86('0x10')](_0xce86('0x51'),_0x5d917f[_0xce86('0x50')]));_0x38e4b5=_0x5d917f[_0xce86('0x50')];}else{logger['info'](_0xce86('0x52'));}}else{logger['info'](_0xce86('0x53'));_0x38e4b5=-0x1;}}})[_0xce86('0x31')](function(_0x1c12e0){logger[_0xce86('0xc')](_0xce86('0x54'),_0x1c12e0[_0xce86('0x15')]);})[_0xce86('0x4b')](function(){var _0x327e90=require(_0xce86('0x55'))(config['agi'][_0xce86('0xe')],config['agi']['ip'],_0x38e4b5);_0x327e90['on']('error',errorHandler);_0x327e90['on']('listening',listeningHandler);_0x327e90['on'](_0xce86('0x56'),connectionHandler);_0x327e90['on'](_0xce86('0x39'),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 1c3f2d2..b589a60 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 _0xe57e=['client','http','request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x304976,_0x14432b){var _0xb73047=function(_0x5d4e01){while(--_0x5d4e01){_0x304976['push'](_0x304976['shift']());}};_0xb73047(++_0x14432b);}(_0xe57e,0x8a));var _0xee57=function(_0x46a8e5,_0x4474f8){_0x46a8e5=_0x46a8e5-0x0;var _0x53a4b7=_0xe57e[_0x46a8e5];return _0x53a4b7;};'use strict';var BPromise=require(_0xee57('0x0'));var jayson=require(_0xee57('0x1'));var client=jayson[_0xee57('0x2')][_0xee57('0x3')]({'port':0x232b});function request(_0x46eabc,_0x2d33d4){return new BPromise(function(_0x1e6490,_0x1413a1){return client[_0xee57('0x4')](_0x46eabc,_0x2d33d4)[_0xee57('0x5')](function(_0x3eb1a6){if(_0x3eb1a6[_0xee57('0x6')]){return _0x1413a1(_0x3eb1a6[_0xee57('0x6')]['message']);}else{return _0x1e6490(_0x3eb1a6['result']);}})[_0xee57('0x7')](function(_0x2a130c){return _0x1413a1(_0x2a130c);});});}exports[_0xee57('0x8')]=function(_0x5a6327,_0x512a2e){return request(_0xee57('0x9'),{'account':_0x5a6327,'message':_0x512a2e});}; \ No newline at end of file +var _0xf60e=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x14e21d,_0x1eece4){var _0x16e74b=function(_0x4ce222){while(--_0x4ce222){_0x14e21d['push'](_0x14e21d['shift']());}};_0x16e74b(++_0x1eece4);}(_0xf60e,0x173));var _0xef60=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xf60e[_0x1b7368];return _0x25d54c;};'use strict';var BPromise=require(_0xef60('0x0'));var jayson=require(_0xef60('0x1'));var client=jayson[_0xef60('0x2')]['http']({'port':0x232b});function request(_0x31464e,_0x1901c2){return new BPromise(function(_0x1778ef,_0x9f470b){return client[_0xef60('0x3')](_0x31464e,_0x1901c2)[_0xef60('0x4')](function(_0x37e8fe){if(_0x37e8fe[_0xef60('0x5')]){return _0x9f470b(_0x37e8fe[_0xef60('0x5')][_0xef60('0x6')]);}else{return _0x1778ef(_0x37e8fe[_0xef60('0x7')]);}})[_0xef60('0x8')](function(_0x2e8f0b){return _0x9f470b(_0x2e8f0b);});});}exports[_0xef60('0x9')]=function(_0x1605d2,_0x2c5bd1){return request(_0xef60('0xa'),{'account':_0x1605d2,'message':_0x2c5bd1});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 02a7aa0..a47153a 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 _0xa1f1=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','stream','Transform','_inBody'];(function(_0x4f9003,_0x3a0c65){var _0x491530=function(_0x324303){while(--_0x324303){_0x4f9003['push'](_0x4f9003['shift']());}};_0x491530(++_0x3a0c65);}(_0xa1f1,0x7b));var _0x1a1f=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xa1f1[_0x4f3c9b];return _0x84e58a;};'use strict';var util=require('util');var Transform=require(_0x1a1f('0x0'))[_0x1a1f('0x1')];function AGIReply(_0x281bc2){Transform['call'](this,_0x281bc2);this['_localBuffer']='';this[_0x1a1f('0x2')]=![];}util[_0x1a1f('0x3')](AGIReply,Transform);AGIReply[_0x1a1f('0x4')][_0x1a1f('0x5')]=function(_0x378ddf,_0x383c9e,_0x257bd3){var _0x22cbb3='\x0a',_0x187398=['\x0a\x0a',_0x1a1f('0x6')],_0x3ec84e=-0x1,_0x536442=-0x1,_0x1e608b='',_0x8ecdd3=0x0,_0xf6bdd0='',_0x5ec30a='';this[_0x1a1f('0x7')]+=_0x378ddf[_0x1a1f('0x8')]();_0xf6bdd0=this[_0x1a1f('0x7')];if(!this['_inBody']){_0x8ecdd3=0x0;while(_0x187398[_0x8ecdd3]){while((_0x536442=_0xf6bdd0[_0x1a1f('0x9')](_0x187398[_0x8ecdd3]))!=-0x1){_0x1e608b=_0x187398[_0x8ecdd3];_0x5ec30a=_0xf6bdd0[_0x1a1f('0xa')](0x0,_0x536442);_0xf6bdd0=_0xf6bdd0[_0x1a1f('0xa')](_0x536442+_0x1e608b[_0x1a1f('0xb')]);var _0x380c1c=_0x5ec30a[_0x1a1f('0xc')](_0x22cbb3),_0x191c3b=0x0,_0x14bdfc={},_0x51f73b='',_0x14d022='',_0x237e82=-0x1;while(_0x380c1c[_0x191c3b]){_0x237e82=_0x380c1c[_0x191c3b][_0x1a1f('0x9')](':');if(_0x237e82!=-0x1){_0x51f73b=_0x380c1c[_0x191c3b][_0x1a1f('0xd')](0x0,_0x237e82)[_0x1a1f('0xe')]();_0x14d022=_0x380c1c[_0x191c3b][_0x1a1f('0xd')](_0x237e82+0x1)[_0x1a1f('0xe')]();if(_0x51f73b[_0x1a1f('0xb')]>0x0){_0x14bdfc[_0x51f73b]=_0x14d022;}}else{}_0x191c3b++;}this[_0x1a1f('0xf')]('headers',_0x14bdfc);this[_0x1a1f('0x2')]=!![];}_0x8ecdd3++;}this[_0x1a1f('0x7')]=_0xf6bdd0;}else{while((_0x3ec84e=_0xf6bdd0[_0x1a1f('0x9')](_0x22cbb3))!=-0x1){_0x5ec30a=_0xf6bdd0[_0x1a1f('0xa')](0x0,_0x3ec84e);this[_0x1a1f('0xf')](_0x1a1f('0x10'),_0x5ec30a);_0xf6bdd0=_0xf6bdd0['substring'](_0x3ec84e+_0x22cbb3['length']);}this[_0x1a1f('0x7')]=_0xf6bdd0;}_0x257bd3();};module[_0x1a1f('0x11')]=AGIReply; \ No newline at end of file +var _0x7f48=['indexOf','substring','length','slice','trim','emit','exports','util','stream','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString'];(function(_0x353736,_0x152ce8){var _0x585b29=function(_0x270d2c){while(--_0x270d2c){_0x353736['push'](_0x353736['shift']());}};_0x585b29(++_0x152ce8);}(_0x7f48,0xac));var _0x87f4=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x7f48[_0x33bc64];return _0x3fdd34;};'use strict';var util=require(_0x87f4('0x0'));var Transform=require(_0x87f4('0x1'))['Transform'];function AGIReply(_0x3eb631){Transform['call'](this,_0x3eb631);this['_localBuffer']='';this[_0x87f4('0x2')]=![];}util[_0x87f4('0x3')](AGIReply,Transform);AGIReply['prototype'][_0x87f4('0x4')]=function(_0x346e85,_0xc1d02,_0x53850b){var _0x57c6db='\x0a',_0x21e291=['\x0a\x0a',_0x87f4('0x5')],_0x3bbcbd=-0x1,_0x5e3b13=-0x1,_0x110be3='',_0x26ee88=0x0,_0xa5c684='',_0x1cb530='';this[_0x87f4('0x6')]+=_0x346e85[_0x87f4('0x7')]();_0xa5c684=this[_0x87f4('0x6')];if(!this[_0x87f4('0x2')]){_0x26ee88=0x0;while(_0x21e291[_0x26ee88]){while((_0x5e3b13=_0xa5c684[_0x87f4('0x8')](_0x21e291[_0x26ee88]))!=-0x1){_0x110be3=_0x21e291[_0x26ee88];_0x1cb530=_0xa5c684['substring'](0x0,_0x5e3b13);_0xa5c684=_0xa5c684[_0x87f4('0x9')](_0x5e3b13+_0x110be3[_0x87f4('0xa')]);var _0x4da009=_0x1cb530['split'](_0x57c6db),_0x128b0e=0x0,_0x49f4bb={},_0x2d4e11='',_0x373bc8='',_0x374544=-0x1;while(_0x4da009[_0x128b0e]){_0x374544=_0x4da009[_0x128b0e][_0x87f4('0x8')](':');if(_0x374544!=-0x1){_0x2d4e11=_0x4da009[_0x128b0e][_0x87f4('0xb')](0x0,_0x374544)['trim']();_0x373bc8=_0x4da009[_0x128b0e]['slice'](_0x374544+0x1)[_0x87f4('0xc')]();if(_0x2d4e11[_0x87f4('0xa')]>0x0){_0x49f4bb[_0x2d4e11]=_0x373bc8;}}else{}_0x128b0e++;}this[_0x87f4('0xd')]('headers',_0x49f4bb);this[_0x87f4('0x2')]=!![];}_0x26ee88++;}this[_0x87f4('0x6')]=_0xa5c684;}else{while((_0x3bbcbd=_0xa5c684[_0x87f4('0x8')](_0x57c6db))!=-0x1){_0x1cb530=_0xa5c684['substring'](0x0,_0x3bbcbd);this['emit']('line',_0x1cb530);_0xa5c684=_0xa5c684[_0x87f4('0x9')](_0x3bbcbd+_0x57c6db[_0x87f4('0xa')]);}this['_localBuffer']=_0xa5c684;}_0x53850b();};module[_0x87f4('0xe')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f723760..e73c7cb 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 _0xd314=['createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','error','result','catch','ShowSquareProject','production','ShowMailAccount','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd314,0x199));var _0x4d31=function(_0x193672,_0x4fd9c8){_0x193672=_0x193672-0x0;var _0x16394a=_0xd314[_0x193672];return _0x16394a;};'use strict';var BPromise=require(_0x4d31('0x0'));var moment=require(_0x4d31('0x1'));var _=require(_0x4d31('0x2'));var util=require(_0x4d31('0x3'));var jayson=require(_0x4d31('0x4'));var client=jayson[_0x4d31('0x5')][_0x4d31('0x6')]({'port':0x2329});function request(_0x3e0a9b,_0x212432){return new BPromise(function(_0x55159d,_0x7a5dd7){return client['request'](_0x3e0a9b,_0x212432)['then'](function(_0x3fd272){if(_0x3fd272[_0x4d31('0x7')]){return _0x7a5dd7(_0x3fd272[_0x4d31('0x7')]['message']);}else{return _0x55159d(_0x3fd272[_0x4d31('0x8')]);}})[_0x4d31('0x9')](function(_0x519e4d){return _0x7a5dd7(_0x519e4d);});});}exports['getSquareProject']=function(_0x4153a2){return request(_0x4d31('0xa'),{'options':{'raw':![],'where':{'name':_0x4153a2},'attributes':[_0x4d31('0xb')]}});};exports['getMailAccountById']=function(_0xf2fa0f){return request(_0x4d31('0xc'),{'options':{'raw':![],'where':{'id':_0xf2fa0f},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x4d31('0xd'),_0x4d31('0xe')]}});};exports['getSquareProjectById']=function(_0x2c3d32){return request(_0x4d31('0xa'),{'options':{'where':{'id':_0x2c3d32},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0xf')]=function(_0x567e8f){return request(_0x4d31('0x10'),{'options':{'where':{'id':_0x567e8f},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x11')]=function(_0x4d5e03){return request(_0x4d31('0x12'),{'options':{'where':{'id':_0x4d5e03},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x13')]=function(_0x19c5b2){return request(_0x4d31('0x14'),{'options':{'where':{'id':_0x19c5b2},'attributes':[_0x4d31('0x15')]}});};exports[_0x4d31('0x16')]=function(_0x4d2d35){return request(_0x4d31('0x17'),{'options':{'where':{'id':_0x4d2d35},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x18')]=function(_0x466fad){return request(_0x4d31('0x19'),{'options':{'where':{'id':_0x466fad},'attributes':[_0x4d31('0xd')]}});};exports[_0x4d31('0x1a')]=function(_0x3d0f50){return request('ShowSound',{'options':{'where':{'id':_0x3d0f50},'attributes':[_0x4d31('0x1b')]}});};exports['getIntervalById']=function(_0x5c2185){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5c2185},'include':[{'model':'Interval','as':_0x4d31('0x1c')}]}});};exports[_0x4d31('0x1d')]=function(_0x4e600f){return request(_0x4d31('0x1e'),{'options':{'where':{'id':_0x4e600f},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x312d63){return request(_0x4d31('0x1f'),{'body':_0x312d63});};exports['createSquareDetailsReport']=function(_0x1dbbd2){return request(_0x4d31('0x20'),{'body':_0x1dbbd2});};exports[_0x4d31('0x21')]=function(_0x2a2c62){return request(_0x4d31('0x22'),{'body':_[_0x4d31('0x23')](_0x2a2c62,{'project_name':_0x2a2c62[_0x4d31('0x24')],'prev_project_name':_0x2a2c62[_0x4d31('0x25')]||'','is_subproject':_0x2a2c62[_0x4d31('0x25')]?!![]:![],'leaveAt':moment()[_0x4d31('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x4d31('0x27')]=function(_0x351339){return request(_0x4d31('0x28'),{'body':_0x351339});};exports[_0x4d31('0x29')]=function(_0x2b6eba){return request(_0x4d31('0x2a'),{'body':_0x2b6eba});};exports['createCmContact']=function(_0x194687){return request(_0x4d31('0x2b'),{'options':{'raw':![],'where':{'phone':_0x194687[_0x4d31('0x2c')],'ListId':_0x194687[_0x4d31('0x2d')]}}})[_0x4d31('0x2e')](function(_0x1c288b){if(_0x1c288b){return _0x1c288b;}return request(_0x4d31('0x2f'),{'body':_0x194687});});};exports[_0x4d31('0x30')]=function(_0x355310){return request(_0x4d31('0x31'),{'options':{'where':{'id':_0x355310},'attributes':['name']}});};exports['agentLogin']=function(_0x5de8da,_0xc737bd){return request(_0x4d31('0x32'),{'body':{'interface':_0xc737bd},'options':{'where':_0x5de8da}});};exports[_0x4d31('0x33')]=function(_0xab3d23,_0x3e7747,_0x4869b2){return request(_0x4d31('0x34'),{'body':{'type':_0x3e7747,'uniqueid':_0x4869b2},'options':{'where':_0xab3d23}});};exports['agentUnpause']=function(_0x512acd){return request(_0x4d31('0x35'),{'body':{},'options':{'where':_0x512acd}});};exports[_0x4d31('0x36')]=function(_0x234dd5){return request(_0x4d31('0x37'),{'body':{},'options':{'where':_0x234dd5}});}; \ No newline at end of file +var _0x9503=['ShowCmHopper','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','name','email','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x9503,0x19b));var _0x3950=function(_0x96bae2,_0x5ce8fd){_0x96bae2=_0x96bae2-0x0;var _0x44cd28=_0x9503[_0x96bae2];return _0x44cd28;};'use strict';var BPromise=require(_0x3950('0x0'));var moment=require(_0x3950('0x1'));var _=require(_0x3950('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x3950('0x3')][_0x3950('0x4')]({'port':0x2329});function request(_0x207b69,_0x41e3a4){return new BPromise(function(_0x27ab69,_0x4096a4){return client[_0x3950('0x5')](_0x207b69,_0x41e3a4)[_0x3950('0x6')](function(_0x5b5f0f){if(_0x5b5f0f['error']){return _0x4096a4(_0x5b5f0f[_0x3950('0x7')]['message']);}else{return _0x27ab69(_0x5b5f0f[_0x3950('0x8')]);}})[_0x3950('0x9')](function(_0x390c8e){return _0x4096a4(_0x390c8e);});});}exports[_0x3950('0xa')]=function(_0x5ab4da){return request(_0x3950('0xb'),{'options':{'raw':![],'where':{'name':_0x5ab4da},'attributes':[_0x3950('0xc')]}});};exports['getMailAccountById']=function(_0x4e0a6e){return request(_0x3950('0xd'),{'options':{'raw':![],'where':{'id':_0x4e0a6e},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x3950('0xe'),_0x3950('0xf')]}});};exports[_0x3950('0x10')]=function(_0x315a32){return request(_0x3950('0xb'),{'options':{'where':{'id':_0x315a32},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x3bb52f){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3bb52f},'attributes':['name']}});};exports[_0x3950('0x11')]=function(_0xcd7b1c){return request(_0x3950('0x12'),{'options':{'where':{'id':_0xcd7b1c},'attributes':[_0x3950('0xe')]}});};exports[_0x3950('0x13')]=function(_0x15b735){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x15b735},'attributes':[_0x3950('0x14')]}});};exports['getUserById']=function(_0x3224e2){return request(_0x3950('0x15'),{'options':{'where':{'id':_0x3224e2},'attributes':[_0x3950('0xe')]}});};exports[_0x3950('0x16')]=function(_0xe16f21){return request('ShowTrunk',{'options':{'where':{'id':_0xe16f21},'attributes':['name']}});};exports[_0x3950('0x17')]=function(_0x4a4fff){return request('ShowSound',{'options':{'where':{'id':_0x4a4fff},'attributes':[_0x3950('0x18')]}});};exports[_0x3950('0x19')]=function(_0xcac048){return request(_0x3950('0x1a'),{'options':{'raw':![],'where':{'id':_0xcac048},'include':[{'model':_0x3950('0x1b'),'as':'Intervals'}]}});};exports[_0x3950('0x1c')]=function(_0x2e1c56){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2e1c56},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x4db35e){return request(_0x3950('0x1d'),{'body':_0x4db35e});};exports[_0x3950('0x1e')]=function(_0x2e0f81){return request('CreateSquareDetailsReport',{'body':_0x2e0f81});};exports[_0x3950('0x1f')]=function(_0x56a000){return request(_0x3950('0x20'),{'body':_[_0x3950('0x21')](_0x56a000,{'project_name':_0x56a000['arg_1'],'prev_project_name':_0x56a000[_0x3950('0x22')]||'','is_subproject':_0x56a000['arg_2']?!![]:![],'leaveAt':moment()[_0x3950('0x23')](_0x3950('0x24'))})});};exports['createSquareRecording']=function(_0x434714){return request('CreateSquareRecording',{'body':_0x434714});};exports[_0x3950('0x25')]=function(_0x244eed){return request(_0x3950('0x26'),{'body':_0x244eed});};exports['createCmContact']=function(_0xc8c32f){return request(_0x3950('0x27'),{'options':{'raw':![],'where':{'phone':_0xc8c32f['phone'],'ListId':_0xc8c32f['ListId']}}})[_0x3950('0x6')](function(_0x38c84a){if(_0x38c84a){return _0x38c84a;}return request(_0x3950('0x28'),{'body':_0xc8c32f});});};exports[_0x3950('0x29')]=function(_0x3800f1){return request('ShowPause',{'options':{'where':{'id':_0x3800f1},'attributes':[_0x3950('0xe')]}});};exports[_0x3950('0x2a')]=function(_0x3d7f7c,_0x5eec2e){return request(_0x3950('0x2b'),{'body':{'interface':_0x5eec2e},'options':{'where':_0x3d7f7c}});};exports[_0x3950('0x2c')]=function(_0x1c7660,_0x355c2b,_0x4e5eeb){return request(_0x3950('0x2d'),{'body':{'type':_0x355c2b,'uniqueid':_0x4e5eeb},'options':{'where':_0x1c7660}});};exports[_0x3950('0x2e')]=function(_0x4ae1e6){return request(_0x3950('0x2f'),{'body':{},'options':{'where':_0x4ae1e6}});};exports[_0x3950('0x30')]=function(_0x405105){return request(_0x3950('0x31'),{'body':{},'options':{'where':_0x405105}});}; \ 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 2c88309..1fda00d 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 _0x5a9e=['exports','./lex'];(function(_0x283c87,_0x545688){var _0xde4143=function(_0x187b8d){while(--_0x187b8d){_0x283c87['push'](_0x283c87['shift']());}};_0xde4143(++_0x545688);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x5a9e[_0x4653f7];return _0x5454da;};var polly=require('./polly');var lex=require(_0xe5a9('0x0'));module[_0xe5a9('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x5353=['exports','./polly'];(function(_0x25efc3,_0x555aae){var _0x4d3891=function(_0x149c0a){while(--_0x149c0a){_0x25efc3['push'](_0x25efc3['shift']());}};_0x4d3891(++_0x555aae);}(_0x5353,0x12f));var _0x3535=function(_0x481921,_0x40878b){_0x481921=_0x481921-0x0;var _0x47f004=_0x5353[_0x481921];return _0x47f004;};var polly=require(_0x3535('0x0'));var lex=require('./lex');module[_0x3535('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 2fb521c..6fbed43 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 _0x5ff3=['exports'];(function(_0x34b5fc,_0x261ff0){var _0x536e66=function(_0x22e4a3){while(--_0x22e4a3){_0x34b5fc['push'](_0x34b5fc['shift']());}};_0x536e66(++_0x261ff0);}(_0x5ff3,0x17d));var _0x35ff=function(_0x29c231,_0x122be9){_0x29c231=_0x29c231-0x0;var _0x2d6a56=_0x5ff3[_0x29c231];return _0x2d6a56;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);}; \ No newline at end of file +var _0xec56=['./lib/api'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xec56,0x1bd));var _0x6ec5=function(_0x18de6a,_0x217126){_0x18de6a=_0x18de6a-0x0;var _0x3c313a=_0xec56[_0x18de6a];return _0x3c313a;};'use strict';var lex=require(_0x6ec5('0x0'));module['exports']=function(_0x4d6dcd,_0x10a273,_0x3b8a3f,_0x26a5af,_0x240ccf,_0x43c2cd){return lex(_0x4d6dcd,_0x10a273,_0x3b8a3f,_0x26a5af,_0x240ccf,_0x43c2cd);}; \ 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 089beeb..bb921fb 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(_0x304462,_0x4ca3fb){var _0x1ea84a=function(_0x49ef1e){while(--_0x49ef1e){_0x304462['push'](_0x304462['shift']());}};_0x1ea84a(++_0x4ca3fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x578c01,_0x4fa048){var _0x3707ac=function(_0x23b68a){while(--_0x23b68a){_0x578c01['push'](_0x578c01['shift']());}};_0x3707ac(++_0x4fa048);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 be69cc4..67e4909 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 _0x0715=['./lib/api','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0715,0x9a));var _0x5071=function(_0x12c31a,_0x27d84c){_0x12c31a=_0x12c31a-0x0;var _0x43a5fd=_0x0715[_0x12c31a];return _0x43a5fd;};'use strict';var polly=require(_0x5071('0x0'));module[_0x5071('0x1')]=function(_0x1a8a1b,_0x59f0d8,_0x86ff8b,_0x3782e5,_0x328567,_0x295afe,_0x1e7dd2){return polly(_0x1a8a1b,_0x59f0d8,_0x86ff8b,_0x3782e5,_0x328567,_0x295afe,_0x1e7dd2);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x1e73ff,_0x1612be,_0x56b621,_0x193e68,_0x320aa6,_0x11c1f2,_0x2161c3){return polly(_0x1e73ff,_0x1612be,_0x56b621,_0x193e68,_0x320aa6,_0x11c1f2,_0x2161c3);}; \ 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 33f58e3..5b3c36d 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 _0x1d0a=['text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','exports','Polly'];(function(_0x5869aa,_0xb1ca7c){var _0x4c3dd3=function(_0x27026f){while(--_0x27026f){_0x5869aa['push'](_0x5869aa['shift']());}};_0x4c3dd3(++_0xb1ca7c);}(_0x1d0a,0x106));var _0xa1d0=function(_0x1bf841,_0x3f90f8){_0x1bf841=_0x1bf841-0x0;var _0x5123ae=_0x1d0a[_0x1bf841];return _0x5123ae;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xa1d0('0x0'));var rs=require(_0xa1d0('0x1'));var AWS=require(_0xa1d0('0x2'));function pollyResult(_0x277d16,_0x38e153,_0x2fcb51){return new BPromise(function(_0x4bcdd0,_0x41e1fd){_0x277d16[_0xa1d0('0x3')](_0x38e153,function(_0x5ad999,_0x35d8be){if(_0x5ad999){_0x41e1fd(_0x5ad999);}else if(_0x35d8be){if(_0x35d8be[_0xa1d0('0x4')]instanceof Buffer){fs[_0xa1d0('0x5')](_0x2fcb51,_0x35d8be[_0xa1d0('0x4')],function(_0x385401){if(_0x385401){_0x41e1fd(_0x385401);}else{_0x4bcdd0();}});}else{_0x41e1fd(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x41e1fd(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xa1d0('0x6')]=function(_0x5da8b2,_0x413edb,_0x54088a,_0x5d3fb2,_0x4bcf1b,_0x54ca45,_0x47b943){var _0xc7fc51=new AWS[(_0xa1d0('0x7'))]({'accessKeyId':_0x5da8b2,'secretAccessKey':_0x413edb,'region':_0x54088a});var _0x49c5a1={'Text':_0x4bcf1b,'TextType':_0x54ca45||_0xa1d0('0x8'),'OutputFormat':_0xa1d0('0x9'),'VoiceId':_0x5d3fb2};return pollyResult(_0xc7fc51,_0x49c5a1,_0x47b943);}; \ No newline at end of file +var _0xb235=['synthesizeSpeech','AudioStream','writeFile','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x405319,_0xa2c0a6){var _0x1b866c=function(_0x5edd00){while(--_0x5edd00){_0x405319['push'](_0x405319['shift']());}};_0x1b866c(++_0xa2c0a6);}(_0xb235,0x153));var _0x5b23=function(_0x29cd56,_0x4cb885){_0x29cd56=_0x29cd56-0x0;var _0x1512b7=_0xb235[_0x29cd56];return _0x1512b7;};'use strict';var fs=require('fs');var path=require(_0x5b23('0x0'));var BPromise=require(_0x5b23('0x1'));var rs=require('randomstring');var AWS=require(_0x5b23('0x2'));function pollyResult(_0x52a471,_0x5c0911,_0x31f958){return new BPromise(function(_0x10c1fb,_0x22c0d9){_0x52a471[_0x5b23('0x3')](_0x5c0911,function(_0x166c05,_0x275d8a){if(_0x166c05){_0x22c0d9(_0x166c05);}else if(_0x275d8a){if(_0x275d8a[_0x5b23('0x4')]instanceof Buffer){fs[_0x5b23('0x5')](_0x31f958,_0x275d8a[_0x5b23('0x4')],function(_0xf4af10){if(_0xf4af10){_0x22c0d9(_0xf4af10);}else{_0x10c1fb();}});}else{_0x22c0d9(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x22c0d9(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x419ba6,_0x10de7e,_0x16848a,_0x2be4f5,_0x3d5522,_0x167736,_0x1a2d8c){var _0x433085=new AWS[(_0x5b23('0x6'))]({'accessKeyId':_0x419ba6,'secretAccessKey':_0x10de7e,'region':_0x16848a});var _0x56212e={'Text':_0x3d5522,'TextType':_0x167736||_0x5b23('0x7'),'OutputFormat':_0x5b23('0x8'),'VoiceId':_0x2be4f5};return pollyResult(_0x433085,_0x56212e,_0x1a2d8c);}; \ 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 0a3bd42..75e2d42 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4cf=['./lib/api','exports'];(function(_0x5bc5b6,_0x8d8bf4){var _0x57940f=function(_0x1a5691){while(--_0x1a5691){_0x5bc5b6['push'](_0x5bc5b6['shift']());}};_0x57940f(++_0x8d8bf4);}(_0xf4cf,0x17e));var _0xff4c=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xf4cf[_0x16b9ed];return _0x66b1f8;};'use strict';var asr=require(_0xff4c('0x0'));module[_0xff4c('0x1')]=function(_0x3ff905,_0xa78402,_0x326889,_0x24809d){return asr(_0x3ff905,_0xa78402,_0x326889);}; \ No newline at end of file +var _0xb60f=['exports','./lib/api'];(function(_0x3c35dd,_0x228f87){var _0x5e9721=function(_0x502b1a){while(--_0x502b1a){_0x3c35dd['push'](_0x3c35dd['shift']());}};_0x5e9721(++_0x228f87);}(_0xb60f,0x16f));var _0xfb60=function(_0x3bbe65,_0x45e9f8){_0x3bbe65=_0x3bbe65-0x0;var _0x38cf63=_0xb60f[_0x3bbe65];return _0x38cf63;};'use strict';var asr=require(_0xfb60('0x0'));module[_0xfb60('0x1')]=function(_0x3f709a,_0x59572f,_0xf45f3a,_0xe25334){return asr(_0x3f709a,_0x59572f,_0xf45f3a);}; \ 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 f230ce0..b9f3d12 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 _0x7b6b=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string'];(function(_0x1d90db,_0x3ea753){var _0x49e4b9=function(_0x4ec289){while(--_0x4ec289){_0x1d90db['push'](_0x1d90db['shift']());}};_0x49e4b9(++_0x3ea753);}(_0x7b6b,0xac));var _0xb7b6=function(_0x5374bf,_0x4a87f4){_0x5374bf=_0x5374bf-0x0;var _0x2a13f2=_0x7b6b[_0x5374bf];return _0x2a13f2;};'use strict';var url=require(_0xb7b6('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xb7b6('0x1');module[_0xb7b6('0x2')]=function(_0x3d53dd,_0x547cab,_0x27f1bd){return new BPromise(function(_0x4abdb2,_0x2b546b){var _0x7193f5;if(typeof _0x3d53dd!==_0xb7b6('0x3')||_0x3d53dd[_0xb7b6('0x4')]===0x0){return _0x2b546b(_0xb7b6('0x5'));}if(typeof _0x547cab!==_0xb7b6('0x3')||_0x547cab[_0xb7b6('0x4')]===0x0){return _0x2b546b(_0xb7b6('0x6'));}if(typeof _0x27f1bd!==_0xb7b6('0x7')&&(typeof _0x27f1bd!==_0xb7b6('0x3')||_0x27f1bd[_0xb7b6('0x4')]===0x0)){return _0x2b546b(_0xb7b6('0x8'));}try{_0x7193f5=fs[_0xb7b6('0x9')](_0x3d53dd)[_0xb7b6('0xa')](_0xb7b6('0xb'));}catch(_0x4025fe){return _0x2b546b(_0x4025fe);}return _0x4abdb2({'method':_0xb7b6('0xc'),'uri':host+_0xb7b6('0xd')+_0x547cab,'body':{'config':{'encoding':_0xb7b6('0xe'),'sampleRateHertz':_0xb7b6('0xf'),'languageCode':_0x27f1bd},'audio':{'content':_0x7193f5}},'json':!![]});});}; \ No newline at end of file +var _0xc5ba=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x4f74fc,_0x400c0a){var _0x29f130=function(_0x356cf0){while(--_0x356cf0){_0x4f74fc['push'](_0x4f74fc['shift']());}};_0x29f130(++_0x400c0a);}(_0xc5ba,0xb9));var _0xac5b=function(_0x441964,_0x3070ae){_0x441964=_0x441964-0x0;var _0x4211f0=_0xc5ba[_0x441964];return _0x4211f0;};'use strict';var url=require(_0xac5b('0x0'));var BPromise=require(_0xac5b('0x1'));var fs=require('fs');var host=_0xac5b('0x2');module[_0xac5b('0x3')]=function(_0x2faba9,_0x34fad9,_0x3158cd){return new BPromise(function(_0x1292a5,_0x3d0dc6){var _0x3c48f1;if(typeof _0x2faba9!==_0xac5b('0x4')||_0x2faba9[_0xac5b('0x5')]===0x0){return _0x3d0dc6(_0xac5b('0x6'));}if(typeof _0x34fad9!==_0xac5b('0x4')||_0x34fad9[_0xac5b('0x5')]===0x0){return _0x3d0dc6(_0xac5b('0x7'));}if(typeof _0x3158cd!==_0xac5b('0x8')&&(typeof _0x3158cd!=='string'||_0x3158cd['length']===0x0)){return _0x3d0dc6(_0xac5b('0x9'));}try{_0x3c48f1=fs['readFileSync'](_0x2faba9)[_0xac5b('0xa')](_0xac5b('0xb'));}catch(_0x221d70){return _0x3d0dc6(_0x221d70);}return _0x1292a5({'method':_0xac5b('0xc'),'uri':host+_0xac5b('0xd')+_0x34fad9,'body':{'config':{'encoding':_0xac5b('0xe'),'sampleRateHertz':_0xac5b('0xf'),'languageCode':_0x3158cd},'audio':{'content':_0x3c48f1}},'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 bb72c99..8f5cf24 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 _0x412a=['exports','./asr'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x412a,0x87));var _0xa412=function(_0xcbc908,_0x29aab9){_0xcbc908=_0xcbc908-0x0;var _0x15f8b7=_0x412a[_0xcbc908];return _0x15f8b7;};var asr=require(_0xa412('0x0'));module[_0xa412('0x1')]={'asr':asr}; \ No newline at end of file +var _0x613d=['./asr','exports'];(function(_0x21ccd3,_0x3d4831){var _0x188457=function(_0x6ca8ba){while(--_0x6ca8ba){_0x21ccd3['push'](_0x21ccd3['shift']());}};_0x188457(++_0x3d4831);}(_0x613d,0xca));var _0xd613=function(_0x5b11e0,_0x48afdf){_0x5b11e0=_0x5b11e0-0x0;var _0x40256b=_0x613d[_0x5b11e0];return _0x40256b;};var asr=require(_0xd613('0x0'));module[_0xd613('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b705067..1ec9cbd 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 _0x424a=['ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','text','channelData','CustomAction','AudioFromTts','audiofile','bluebird','dialogflow','md5','path','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','host','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','close','unlink','download\x20error','protocol','WHAT_EVER','data','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','googleCloudTTS','?key='];(function(_0x3e90ce,_0x8cccbb){var _0x2208be=function(_0x322641){while(--_0x322641){_0x3e90ce['push'](_0x3e90ce['shift']());}};_0x2208be(++_0x8cccbb);}(_0x424a,0x1d6));var _0xa424=function(_0x52ced7,_0x33f680){_0x52ced7=_0x52ced7-0x0;var _0xde7fb=_0x424a[_0x52ced7];return _0xde7fb;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa424('0x0'));var dialogflow=require(_0xa424('0x1'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xa424('0x2'));var path=require(_0xa424('0x3'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xa424('0x4'));var sox=require(_0xa424('0x5'));var tts=require(_0xa424('0x6'));var urlParse=require('url')[_0xa424('0x7')];var util=require(_0xa424('0x8'));var aws=require(_0xa424('0x9'));var google=require(_0xa424('0xa'));var sestek=require(_0xa424('0xb'));var tilde=require(_0xa424('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xa424('0xd');function downloadFile(_0x511264,_0x1a70cf){return new BPromise(function(_0x4912cf,_0x5046de){var _0x59e90c=urlParse(_0x511264);var _0x2a156f=_0x59e90c['protocol']==='https:'?https:http;var _0x4405c5={'host':_0x59e90c[_0xa424('0xe')],'path':_0x59e90c[_0xa424('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x2a156f[_0xa424('0xf')](_0x4405c5,function(_0x199a7b){if(_0x199a7b[_0xa424('0x10')]!==0xc8){logger[_0xa424('0x11')](_0xa424('0x12')+_0x511264+'\x20failed,\x20status\x20code\x20=\x20'+_0x199a7b['statusCode']+'\x20('+_0x199a7b[_0xa424('0x13')]+')');_0x5046de(new Error(_0xa424('0x12')+_0x511264+_0xa424('0x14')+_0x199a7b[_0xa424('0x10')]+'\x20('+_0x199a7b['statusMessage']+')'));return;}var _0x366dae=fs['createWriteStream'](_0x1a70cf);_0x366dae['on'](_0xa424('0x15'),function(){logger[_0xa424('0x16')]('finish\x20download\x20file');_0x366dae[_0xa424('0x17')](_0x4912cf);});_0x366dae['on'](_0xa424('0x11'),function(_0x521db4){fs[_0xa424('0x18')](_0x1a70cf);logger[_0xa424('0x11')](_0xa424('0x19'),_0x521db4);_0x5046de(_0x521db4);});_0x199a7b['pipe'](_0x366dae);})['on'](_0xa424('0x11'),function(_0x4bfb09){logger['error'](_0x4bfb09);_0x5046de(_0x4bfb09);})['end']();});}function uploadFile(_0x3588da){return new BPromise(function(_0x17092e,_0x4e5f76){var _0x4672f0=urlParse(_0x3588da);var _0x1c2025=_0x4672f0[_0xa424('0x1a')]==='https:'?https:http;var _0x35a06e={'host':_0x4672f0['host'],'path':_0x4672f0[_0xa424('0x3')],'headers':{'user-agent':_0xa424('0x1b')}};_0x1c2025[_0xa424('0xf')](_0x35a06e,function(_0x3b195d){if(_0x3b195d[_0xa424('0x10')]!==0xc8){_0x4e5f76(new Error(_0xa424('0x12')+_0x3588da+'\x20failed,\x20status\x20code\x20=\x20'+_0x3b195d[_0xa424('0x10')]+'\x20('+_0x3b195d[_0xa424('0x13')]+')'));return;}var _0x367fba='';_0x3b195d['on'](_0xa424('0x1c'),function(_0x51d9b3){_0x367fba+=_0x51d9b3;});_0x3b195d['on'](_0xa424('0x1d'),function(){_0x17092e(_0x367fba);});})['on'](_0xa424('0x11'),function(_0x508e99){_0x4e5f76(_0x508e99);})['end']();});}function convertFile(_0x416289,_0x43c1f6){return new BPromise(function(_0x46db95,_0x23945a){var _0x5db3c5=sox[_0xa424('0x1e')](_0x416289,_0x43c1f6,{'sampleRate':0x1f40,'format':_0xa424('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5db3c5['on'](_0xa424('0x11'),function(_0x18f391){logger[_0xa424('0x11')](_0xa424('0x20'),_0x18f391);_0x23945a(_0x18f391);});_0x5db3c5['on'](_0xa424('0x1d'),function(){logger[_0xa424('0x16')]('finish\x20to\x20convert');_0x46db95();});_0x5db3c5[_0xa424('0x21')]();});}function base64Decode(_0x45db1c,_0x6baf63){var _0x11d6f9=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));fs[_0xa424('0x26')](_0x11d6f9,_0x45db1c,_0xa424('0x27'));return convertFile(_0x11d6f9,_0x6baf63)[_0xa424('0x28')](function(){try{fs['unlink'](_0x11d6f9);fs[_0xa424('0x29')](_0x6baf63,_0xa424('0x2a'));}catch(_0x3b13f4){logger[_0xa424('0x11')](_0x3b13f4);}return _0x6baf63['split']('.')[0x0];});}function base64Encode(_0x5893a4){var _0x410b25=fs[_0xa424('0x2b')](_0x5893a4);return new Buffer(_0x410b25)['toString'](_0xa424('0x27'));}exports[_0xa424('0x2c')]=function(_0x429222,_0x2d0814,_0x4e9624,_0x7d2894,_0x52e7b9,_0x5b480a){var _0xee4241,_0x42bcbc;var _0x54fbd4='https://texttospeech.googleapis.com/v1/';var _0x1c6d7c=_0xa424('0x2d')+_0x429222;var _0x2bbb12={};if(_0x2d0814===_0xa424('0x2e')){_0x2bbb12[_0xa424('0x2f')]={'ssml':_0x4e9624};}else{_0x2bbb12['input']={'text':_0x4e9624};};_0x2bbb12[_0xa424('0x30')]={'languageCode':_0x7d2894,'ssmlGender':_0x52e7b9};_0x2bbb12[_0xa424('0x31')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x89d4c6={'url':_0x54fbd4+_0xa424('0x32')+_0x1c6d7c,'method':_0xa424('0x33'),'json':!![],'body':_0x2bbb12};return rp(_0x89d4c6)[_0xa424('0x28')](function(_0x5bd8eb){return new BPromise(function(_0x1f8ae0,_0x1740eb){_0xee4241=path[_0xa424('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xa424('0x34'));var _0x22dfc3=Buffer[_0xa424('0x35')](_0x5bd8eb[_0xa424('0x36')],_0xa424('0x27'));return fs[_0xa424('0x37')](_0xee4241,_0x22dfc3,function(_0x55fe6){_0x1740eb(_0x55fe6);},function(_0x193d58){fs['chmodSync'](_0xee4241,_0xa424('0x2a'));_0x1f8ae0(_0x193d58);});});})[_0xa424('0x28')](function(_0x37b278){_0x42bcbc=path['resolve'](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0xee4241,_0x42bcbc);})['then'](function(){try{fs[_0xa424('0x18')](_0xee4241);fs['chmodSync'](_0x42bcbc,_0xa424('0x2a'));}catch(_0x2ab42d){logger['error'](_0x2ab42d);}logger[_0xa424('0x16')](_0xa424('0x38'),_0x42bcbc['split']('.')[0x0]);return _0x42bcbc[_0xa424('0x39')]('.')[0x0];});};exports[_0xa424('0x3a')]=function(_0x2966bc,_0x2114d1){var _0x200430='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x49411f,_0x44759a;var _0x4fe328;var _0x530a14={'encoding':_0xa424('0x3b'),'method':_0xa424('0x33'),'timeout':0x2710,'url':_0x200430,'headers':{'Content-Type':_0xa424('0x3c')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xa424('0x3d'),JSON[_0xa424('0x3e')]([_0x2966bc,_0x2114d1||'en',![],_0xa424('0x3f')]),null,_0xa424('0x40')]]]))};return rp(_0x530a14)[_0xa424('0x28')](function(_0x5ddb1e){try{_0x4fe328=eval(_0x5ddb1e[_0xa424('0x41')](0x5))[0x0][0x2];}catch(_0x4a69ee){throw new Error(_0xa424('0x42')+_0x5ddb1e[_0xa424('0x1c')]);}if(!_0x4fe328){if(_0x2966bc[_0xa424('0x43')]>0xc8){throw new Error(_0xa424('0x44'));}else{throw new Error(_0xa424('0x45')+_0x2114d1+_0xa424('0x46'));}}try{_0x4fe328=eval(_0x4fe328)[0x0];}catch(_0x1a634e){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x2bc74e=_0x4fe328;_0x49411f=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x34'));fs['writeFileSync'](_0x49411f,_0x4fe328,{'encoding':'base64'});_0x44759a=path['resolve'](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0x49411f,_0x44759a);})['then'](function(){try{fs['unlink'](_0x49411f);fs[_0xa424('0x29')](_0x44759a,'777');}catch(_0x1c89c9){logger['error'](_0x1c89c9);}logger[_0xa424('0x16')](_0xa424('0x47'),_0x44759a[_0xa424('0x39')]('.')[0x0]);return _0x44759a[_0xa424('0x39')]('.')[0x0];});};exports['googleASR']=function(_0x590764,_0x10195e,_0x496aa2){return google['asr'](_0x590764,_0x10195e,_0x496aa2)[_0xa424('0x28')](function(_0x9fc751){logger['info'](_0x9fc751['uri']);return rp(_0x9fc751);})['then'](function(_0x18e5df){var _0x476b22='';var _0x3b1bbc=0x0;try{fs[_0xa424('0x18')](_0x590764);}catch(_0x26094c){logger[_0xa424('0x11')](_0x26094c);}if(_0x18e5df&&_0x18e5df[_0xa424('0x48')]){_0x476b22=_0x18e5df[_0xa424('0x48')][_0xa424('0x49')](function(_0x45919b){return _0x45919b&&_0x45919b[_0xa424('0x4a')][0x0]&&_0x45919b[_0xa424('0x4a')][0x0]['transcript']?_0x45919b[_0xa424('0x4a')][0x0][_0xa424('0x4b')]:'';})['join']('\x0a');_0x3b1bbc=_0x18e5df['results'][_0xa424('0x49')](function(_0x2e110e){return _0x2e110e&&_0x2e110e[_0xa424('0x4a')][0x0]&&_0x2e110e[_0xa424('0x4a')][0x0][_0xa424('0x4c')]?_0x2e110e[_0xa424('0x4a')][0x0][_0xa424('0x4c')]:0x0;})[_0xa424('0x4d')]('\x0a');}logger[_0xa424('0x16')](_0xa424('0x4e'),_0x476b22);logger['info'](_0xa424('0x4f'),_0x3b1bbc);return{'transcript':_0x476b22,'confidence':_0x3b1bbc};})[_0xa424('0x50')](function(_0x1d3fc2){logger[_0xa424('0x11')]('[%s]\x20%s:%s',_0x1d3fc2[_0xa424('0x10')],_0x1d3fc2[_0xa424('0x51')],_0x1d3fc2[_0xa424('0x52')]);});};exports[_0xa424('0x53')]=function(_0x20a25c,_0xf3199b,_0x668226,_0x2f22dd){var _0x8b169e=apiai(_0xf3199b,{'language':_0x2f22dd||'en'});return _0x8b169e[_0xa424('0x54')](_0x668226,{'sessionId':md5(_0x20a25c)})[_0xa424('0x28')](function(_0x109ea0){logger[_0xa424('0x16')](JSON['stringify'](_0x109ea0));return{'source':_0x109ea0[_0xa424('0x55')]['source'],'resolvedQuery':_0x109ea0[_0xa424('0x55')][_0xa424('0x56')],'action':_0x109ea0[_0xa424('0x55')][_0xa424('0x57')],'actionIncomplete':_0x109ea0[_0xa424('0x55')][_0xa424('0x58')],'speech':_0x109ea0[_0xa424('0x55')][_0xa424('0x59')]['speech'],'score':_0x109ea0[_0xa424('0x55')]['score'],'statusCode':_0x109ea0['status']['code'],'endConversation':_0x109ea0[_0xa424('0x55')][_0xa424('0x5a')][_0xa424('0x5b')]||![],'isFallbackIntent':_0x109ea0[_0xa424('0x55')][_0xa424('0x5a')]['isFallbackIntent']};});};exports[_0xa424('0x5c')]=function(_0x2dab5f,_0x3871d3,_0x41779f,_0x22b72f,_0x53e0f8,_0x34e16a){var _0x3dfbb5=_0x22b72f[_0xa424('0x5d')](/\\n/g,'\x0a');var _0x337108={'credentials':{'private_key':_0x3dfbb5,'client_email':_0x41779f}};var _0x53b145=new dialogflow[(_0xa424('0x5e'))](_0x337108);var _0x5a2aae=_0x53b145[_0xa424('0x5f')](_0x3871d3,md5(_0x2dab5f));var _0x241c3e={'session':_0x5a2aae,'queryInput':{'text':{'text':_0x53e0f8,'languageCode':_0x34e16a}}};return _0x53b145[_0xa424('0x60')](_0x241c3e)[_0xa424('0x28')](function(_0x18c322){if(_0x18c322&&_0x18c322[_0xa424('0x43')]){logger[_0xa424('0x16')](_0xa424('0x61'),JSON[_0xa424('0x3e')](_0x18c322));var _0x1d9397=_0x18c322[0x0];if(_0x1d9397){var _0x5f05fe={'action':_0x1d9397[_0xa424('0x62')][_0xa424('0x57')],'allRequiredParamsPresent':_0x1d9397[_0xa424('0x62')][_0xa424('0x63')],'endConversation':_0x1d9397[_0xa424('0x62')][_0xa424('0x64')]&&_0x1d9397[_0xa424('0x62')][_0xa424('0x64')][_0xa424('0x65')]?_0x1d9397[_0xa424('0x62')][_0xa424('0x64')][_0xa424('0x65')]['end_conversation'][_0xa424('0x66')]:![],'fulfillmentText':_0x1d9397['queryResult'][_0xa424('0x67')],'intentName':_0x1d9397[_0xa424('0x62')][_0xa424('0x68')][_0xa424('0x51')],'intentDisplayName':_0x1d9397[_0xa424('0x62')]['intent'][_0xa424('0x69')],'isFallbackIntent':_0x1d9397['queryResult'][_0xa424('0x68')][_0xa424('0x6a')],'languageCode':_0x1d9397[_0xa424('0x62')]['languageCode'],'queryText':_0x1d9397[_0xa424('0x62')][_0xa424('0x6b')],'responseId':_0x1d9397[_0xa424('0x6c')],'score':_0x1d9397[_0xa424('0x62')][_0xa424('0x6d')],'speech':_0x1d9397[_0xa424('0x62')]['fulfillmentText'],'providerResponse':JSON[_0xa424('0x3e')](_0x18c322)};return _0x5f05fe;}}});};exports[_0xa424('0x6e')]=function(_0x25eea2,_0x14ce2c,_0x4bd6e2,_0x48b310){return tilde['asr'](_0x25eea2,_0x14ce2c,_0x4bd6e2,_0x48b310)[_0xa424('0x28')](function(_0x516097){try{fs[_0xa424('0x18')](_0x25eea2);}catch(_0x2e964a){logger[_0xa424('0x11')](_0x2e964a);}logger[_0xa424('0x16')](_0xa424('0x6f'),_0x516097[_0xa424('0x4b')]);logger[_0xa424('0x16')](_0xa424('0x70'),_0x516097[_0xa424('0x4c')]);return _0x516097;});};exports[_0xa424('0x71')]=function(_0x2ef775,_0x38e142,_0x5d4a08,_0x1e18a1,_0x36bf68,_0x1b56ee){var _0x68e5aa=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs['generate'](0x4)+_0xa424('0x34'));var _0x57ed1;return aws[_0xa424('0x72')](_0x2ef775,_0x38e142,_0x5d4a08,_0x1e18a1,_0x36bf68,_0x1b56ee,_0x68e5aa)[_0xa424('0x28')](function(){_0x57ed1=path[_0xa424('0x22')](__dirname,'tmp',rs[_0xa424('0x24')](0x4)+_0xa424('0x25'));return convertFile(_0x68e5aa,_0x57ed1);})[_0xa424('0x28')](function(){try{fs['unlink'](_0x68e5aa);fs['chmodSync'](_0x57ed1,_0xa424('0x2a'));}catch(_0x43ba41){logger[_0xa424('0x11')](_0x43ba41);}return _0x57ed1[_0xa424('0x39')]('.')[0x0];});};exports[_0xa424('0x73')]=function(_0xb8067b,_0x5a3f6f,_0x346a7f,_0x2929ba,_0x4e3b34,_0x11ba5a){return aws[_0xa424('0x74')](_0xb8067b,_0x5a3f6f,_0x346a7f,_0x2929ba,_0x4e3b34,_0x11ba5a)[_0xa424('0x28')](function(_0xded9dd){logger[_0xa424('0x16')](JSON[_0xa424('0x3e')](_0xded9dd));return _0xded9dd;});};exports[_0xa424('0x75')]=function(_0x38d57d,_0x1c7c90,_0x2bfbce,_0x526cf3){var _0x1c8fb4=util[_0xa424('0x76')](_0xa424('0x77'),ISPEECH_API,_0x38d57d,encodeURIComponent(_0x1c7c90),_0x2bfbce,_0x526cf3);var _0xe7e334=path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs[_0xa424('0x24')](0x4)+_0xa424('0x34'));var _0x213bdc;return downloadFile(_0x1c8fb4,_0xe7e334)[_0xa424('0x28')](function(){_0x213bdc=path[_0xa424('0x22')](__dirname,'tmp',rs[_0xa424('0x24')](0x4)+'.wav');return convertFile(_0xe7e334,_0x213bdc);})[_0xa424('0x28')](function(){try{fs[_0xa424('0x18')](_0xe7e334);fs['chmodSync'](_0x213bdc,_0xa424('0x2a'));}catch(_0x38d0c6){logger[_0xa424('0x11')](_0x38d0c6);}return _0x213bdc['split']('.')[0x0];});};exports[_0xa424('0x78')]=function(_0x42862d,_0x120b8f,_0xc6d316,_0x4f7c4c){var _0xb29b60=util[_0xa424('0x76')](_0xa424('0x79'),ISPEECH_API,_0x120b8f,_0xc6d316,base64Encode(_0x42862d),_0x4f7c4c?util[_0xa424('0x76')](_0xa424('0x7a'),encodeURIComponent(_0x4f7c4c)):'freeform=3');return uploadFile(_0xb29b60)['then'](function(_0x16f53e){return querystring['parse'](_0x16f53e);});};exports['sestekNDA']=function(_0x5d4460,_0x1407bd){return sestek[_0xa424('0x7b')](_0x5d4460,_0x1407bd)['then'](function(_0x355a90){logger['info'](JSON[_0xa424('0x3e')](_0x355a90));var _0x26b4f8={'speech':_0x355a90[_0xa424('0x7c')],'action':_0x355a90[_0xa424('0x7d')]?_0x355a90[_0xa424('0x7d')][_0xa424('0x7e')]:undefined,'actiondata':_0x355a90[_0xa424('0x7d')]?_0x355a90[_0xa424('0x7d')]['CustomActionData']:undefined};if(_0x355a90['channelData']&&_0x355a90[_0xa424('0x7d')][_0xa424('0x7f')]){return base64Decode(_0x355a90[_0xa424('0x7d')][_0xa424('0x7f')]['Data'],path[_0xa424('0x22')](__dirname,_0xa424('0x23'),rs['generate'](0x4)+'.wav'))[_0xa424('0x28')](function(_0x149742){_0x26b4f8[_0xa424('0x80')]=_0x149742;return _0x26b4f8;});}return _0x26b4f8;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x50aa=['resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','dialogflow','https','path','querystring','randomstring','sox','url','parse','./google','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','close','unlink','error','pipe','end','https:','data','transcode','wav','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','base64','chmodSync','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','tmp','.mp3','from','audioContent','writeFile','777','then','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source'];(function(_0x3f07bc,_0x10c7b2){var _0xf697b5=function(_0xd40986){while(--_0xd40986){_0x3f07bc['push'](_0x3f07bc['shift']());}};_0xf697b5(++_0x10c7b2);}(_0x50aa,0xb4));var _0xa50a=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x50aa[_0x58db4e];return _0x40139a;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xa50a('0x0'));var fs=require('fs');var http=require('http');var https=require(_0xa50a('0x1'));var md5=require('md5');var path=require(_0xa50a('0x2'));var querystring=require(_0xa50a('0x3'));var rp=require('request-promise');var rs=require(_0xa50a('0x4'));var sox=require(_0xa50a('0x5'));var tts=require('google-tts-api');var urlParse=require(_0xa50a('0x6'))[_0xa50a('0x7')];var util=require('util');var aws=require('./aws');var google=require(_0xa50a('0x8'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xa50a('0x9');function downloadFile(_0x1b76f3,_0x360bd1){return new BPromise(function(_0x5bb2a8,_0xf0bf5){var _0x4670f0=urlParse(_0x1b76f3);var _0x506d73=_0x4670f0[_0xa50a('0xa')]==='https:'?https:http;var _0x4e623e={'host':_0x4670f0[_0xa50a('0xb')],'path':_0x4670f0[_0xa50a('0x2')],'headers':{'user-agent':_0xa50a('0xc')}};_0x506d73[_0xa50a('0xd')](_0x4e623e,function(_0x106470){if(_0x106470['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x1b76f3+_0xa50a('0xe')+_0x106470[_0xa50a('0xf')]+'\x20('+_0x106470[_0xa50a('0x10')]+')');_0xf0bf5(new Error('request\x20to\x20'+_0x1b76f3+'\x20failed,\x20status\x20code\x20=\x20'+_0x106470['statusCode']+'\x20('+_0x106470[_0xa50a('0x10')]+')'));return;}var _0x61096=fs[_0xa50a('0x11')](_0x360bd1);_0x61096['on'](_0xa50a('0x12'),function(){logger[_0xa50a('0x13')]('finish\x20download\x20file');_0x61096[_0xa50a('0x14')](_0x5bb2a8);});_0x61096['on']('error',function(_0x4cc4ad){fs[_0xa50a('0x15')](_0x360bd1);logger[_0xa50a('0x16')]('download\x20error',_0x4cc4ad);_0xf0bf5(_0x4cc4ad);});_0x106470[_0xa50a('0x17')](_0x61096);})['on'](_0xa50a('0x16'),function(_0x41eb80){logger[_0xa50a('0x16')](_0x41eb80);_0xf0bf5(_0x41eb80);})[_0xa50a('0x18')]();});}function uploadFile(_0x453254){return new BPromise(function(_0xf0d7f4,_0x407438){var _0x209713=urlParse(_0x453254);var _0x3236e6=_0x209713[_0xa50a('0xa')]===_0xa50a('0x19')?https:http;var _0x116401={'host':_0x209713[_0xa50a('0xb')],'path':_0x209713['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x3236e6['get'](_0x116401,function(_0x57a547){if(_0x57a547[_0xa50a('0xf')]!==0xc8){_0x407438(new Error('request\x20to\x20'+_0x453254+_0xa50a('0xe')+_0x57a547['statusCode']+'\x20('+_0x57a547[_0xa50a('0x10')]+')'));return;}var _0x579c54='';_0x57a547['on'](_0xa50a('0x1a'),function(_0x568b52){_0x579c54+=_0x568b52;});_0x57a547['on'](_0xa50a('0x18'),function(){_0xf0d7f4(_0x579c54);});})['on']('error',function(_0xbe02d4){_0x407438(_0xbe02d4);})[_0xa50a('0x18')]();});}function convertFile(_0x30955c,_0x312b4e){return new BPromise(function(_0x2fb80b,_0x3aa3b2){var _0x3459ea=sox[_0xa50a('0x1b')](_0x30955c,_0x312b4e,{'sampleRate':0x1f40,'format':_0xa50a('0x1c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3459ea['on']('error',function(_0x121401){logger['error']('error\x20convert',_0x121401);_0x3aa3b2(_0x121401);});_0x3459ea['on'](_0xa50a('0x18'),function(){logger[_0xa50a('0x13')](_0xa50a('0x1d'));_0x2fb80b();});_0x3459ea['start']();});}function base64Decode(_0x1d025f,_0x3cc5d8){var _0x946fe2=path[_0xa50a('0x1e')](__dirname,'tmp',rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x20'));fs[_0xa50a('0x21')](_0x946fe2,_0x1d025f,_0xa50a('0x22'));return convertFile(_0x946fe2,_0x3cc5d8)['then'](function(){try{fs[_0xa50a('0x15')](_0x946fe2);fs[_0xa50a('0x23')](_0x3cc5d8,'777');}catch(_0x37e57){logger[_0xa50a('0x16')](_0x37e57);}return _0x3cc5d8[_0xa50a('0x24')]('.')[0x0];});}function base64Encode(_0x33bc41){var _0x2c4f36=fs['readFileSync'](_0x33bc41);return new Buffer(_0x2c4f36)[_0xa50a('0x25')](_0xa50a('0x22'));}exports[_0xa50a('0x26')]=function(_0x366081,_0x7b58af,_0x255a5b,_0x3acf78,_0x3e41ee,_0x1e7bf3){var _0x5b3a20,_0x42e1d0;var _0x47880e=_0xa50a('0x27');var _0x1766e4=_0xa50a('0x28')+_0x366081;var _0x32e831={};if(_0x7b58af==='ssml'){_0x32e831['input']={'ssml':_0x255a5b};}else{_0x32e831[_0xa50a('0x29')]={'text':_0x255a5b};};_0x32e831['voice']={'languageCode':_0x3acf78,'ssmlGender':_0x3e41ee};_0x32e831[_0xa50a('0x2a')]={'audioEncoding':_0xa50a('0x2b'),'sampleRateHertz':0x1f40};var _0x4a8068={'url':_0x47880e+'text:synthesize'+_0x1766e4,'method':'POST','json':!![],'body':_0x32e831};return rp(_0x4a8068)['then'](function(_0x244876){return new BPromise(function(_0x2fb349,_0x3bbbe8){_0x5b3a20=path['resolve'](__dirname,_0xa50a('0x2c'),rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x2d'));var _0x45c4c6=Buffer[_0xa50a('0x2e')](_0x244876[_0xa50a('0x2f')],_0xa50a('0x22'));return fs[_0xa50a('0x30')](_0x5b3a20,_0x45c4c6,function(_0x265683){_0x3bbbe8(_0x265683);},function(_0x439c6a){fs[_0xa50a('0x23')](_0x5b3a20,_0xa50a('0x31'));_0x2fb349(_0x439c6a);});});})['then'](function(_0x57136f){_0x42e1d0=path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs[_0xa50a('0x1f')](0x4)+'.wav');return convertFile(_0x5b3a20,_0x42e1d0);})[_0xa50a('0x32')](function(){try{fs[_0xa50a('0x15')](_0x5b3a20);fs[_0xa50a('0x23')](_0x42e1d0,'777');}catch(_0x2b34ff){logger['error'](_0x2b34ff);}logger[_0xa50a('0x13')](_0xa50a('0x33'),_0x42e1d0['split']('.')[0x0]);return _0x42e1d0[_0xa50a('0x24')]('.')[0x0];});};exports[_0xa50a('0x34')]=function(_0xef6e53,_0xe3d36){var _0x33ed34=_0xa50a('0x35');var _0x2ea7a5,_0x4de091;var _0x33608a;var _0x37eea4={'encoding':_0xa50a('0x36'),'method':_0xa50a('0x37'),'timeout':0x2710,'url':_0x33ed34,'headers':{'Content-Type':_0xa50a('0x38')},'body':_0xa50a('0x39')+encodeURIComponent(JSON[_0xa50a('0x3a')]([[[_0xa50a('0x3b'),JSON[_0xa50a('0x3a')]([_0xef6e53,_0xe3d36||'en',![],_0xa50a('0x3c')]),null,_0xa50a('0x3d')]]]))};return rp(_0x37eea4)[_0xa50a('0x32')](function(_0x3e229b){try{_0x33608a=eval(_0x3e229b[_0xa50a('0x3e')](0x5))[0x0][0x2];}catch(_0x3acc53){throw new Error(_0xa50a('0x3f')+_0x3e229b[_0xa50a('0x1a')]);}if(!_0x33608a){if(_0xef6e53['length']>0xc8){throw new Error(_0xa50a('0x40'));}else{throw new Error(_0xa50a('0x41')+_0xe3d36+_0xa50a('0x42'));}}try{_0x33608a=eval(_0x33608a)[0x0];}catch(_0x124170){throw new Error(_0xa50a('0x3f')+res[_0xa50a('0x1a')]);}const _0x318a95=_0x33608a;_0x2ea7a5=path[_0xa50a('0x1e')](__dirname,'tmp',rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x2d'));fs[_0xa50a('0x21')](_0x2ea7a5,_0x33608a,{'encoding':'base64'});_0x4de091=path['resolve'](__dirname,_0xa50a('0x2c'),rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x20'));return convertFile(_0x2ea7a5,_0x4de091);})[_0xa50a('0x32')](function(){try{fs['unlink'](_0x2ea7a5);fs[_0xa50a('0x23')](_0x4de091,'777');}catch(_0x1070d9){logger['error'](_0x1070d9);}logger[_0xa50a('0x13')]('goggleTTS\x20path',_0x4de091['split']('.')[0x0]);return _0x4de091[_0xa50a('0x24')]('.')[0x0];});};exports[_0xa50a('0x43')]=function(_0x11c33b,_0x13d8d2,_0x40ff71){return google[_0xa50a('0x44')](_0x11c33b,_0x13d8d2,_0x40ff71)['then'](function(_0x2443af){logger[_0xa50a('0x13')](_0x2443af[_0xa50a('0x45')]);return rp(_0x2443af);})[_0xa50a('0x32')](function(_0x4d2085){var _0x43beb6='';var _0x20dcfa=0x0;try{fs[_0xa50a('0x15')](_0x11c33b);}catch(_0x1c5fb6){logger['error'](_0x1c5fb6);}if(_0x4d2085&&_0x4d2085[_0xa50a('0x46')]){_0x43beb6=_0x4d2085[_0xa50a('0x46')][_0xa50a('0x47')](function(_0x56f5fd){return _0x56f5fd&&_0x56f5fd[_0xa50a('0x48')][0x0]&&_0x56f5fd['alternatives'][0x0][_0xa50a('0x49')]?_0x56f5fd[_0xa50a('0x48')][0x0][_0xa50a('0x49')]:'';})[_0xa50a('0x4a')]('\x0a');_0x20dcfa=_0x4d2085['results']['map'](function(_0x1ba98c){return _0x1ba98c&&_0x1ba98c['alternatives'][0x0]&&_0x1ba98c[_0xa50a('0x48')][0x0]['confidence']?_0x1ba98c[_0xa50a('0x48')][0x0][_0xa50a('0x4b')]:0x0;})[_0xa50a('0x4a')]('\x0a');}logger['info']('googleASR\x20transcription',_0x43beb6);logger[_0xa50a('0x13')]('googleASR\x20confidence',_0x20dcfa);return{'transcript':_0x43beb6,'confidence':_0x20dcfa};})[_0xa50a('0x4c')](function(_0x5f403b){logger['error'](_0xa50a('0x4d'),_0x5f403b[_0xa50a('0xf')],_0x5f403b[_0xa50a('0x4e')],_0x5f403b[_0xa50a('0x4f')]);});};exports[_0xa50a('0x50')]=function(_0x146f5b,_0x53c09f,_0x1c4635,_0x5c8e33){var _0x2a4cc8=apiai(_0x53c09f,{'language':_0x5c8e33||'en'});return _0x2a4cc8[_0xa50a('0x51')](_0x1c4635,{'sessionId':md5(_0x146f5b)})['then'](function(_0x4dcb99){logger[_0xa50a('0x13')](JSON[_0xa50a('0x3a')](_0x4dcb99));return{'source':_0x4dcb99[_0xa50a('0x52')][_0xa50a('0x53')],'resolvedQuery':_0x4dcb99[_0xa50a('0x52')][_0xa50a('0x54')],'action':_0x4dcb99[_0xa50a('0x52')]['action'],'actionIncomplete':_0x4dcb99[_0xa50a('0x52')][_0xa50a('0x55')],'speech':_0x4dcb99[_0xa50a('0x52')][_0xa50a('0x56')][_0xa50a('0x57')],'score':_0x4dcb99[_0xa50a('0x52')][_0xa50a('0x58')],'statusCode':_0x4dcb99[_0xa50a('0x59')][_0xa50a('0x5a')],'endConversation':_0x4dcb99['result']['metadata'][_0xa50a('0x5b')]||![],'isFallbackIntent':_0x4dcb99['result']['metadata'][_0xa50a('0x5c')]};});};exports['googleDialogflowV2']=function(_0x3cafe3,_0xd0a8d8,_0x5605e0,_0x2eacb2,_0x5c9f45,_0x39bb17){var _0x50ac53=_0x2eacb2[_0xa50a('0x5d')](/\\n/g,'\x0a');var _0x16a461={'credentials':{'private_key':_0x50ac53,'client_email':_0x5605e0}};var _0x3787c6=new dialogflow[(_0xa50a('0x5e'))](_0x16a461);var _0x526fc3=_0x3787c6[_0xa50a('0x5f')](_0xd0a8d8,md5(_0x3cafe3));var _0x56ea70={'session':_0x526fc3,'queryInput':{'text':{'text':_0x5c9f45,'languageCode':_0x39bb17}}};return _0x3787c6[_0xa50a('0x60')](_0x56ea70)[_0xa50a('0x32')](function(_0x2949eb){if(_0x2949eb&&_0x2949eb[_0xa50a('0x61')]){logger[_0xa50a('0x13')](_0xa50a('0x62'),JSON[_0xa50a('0x3a')](_0x2949eb));var _0x54f51d=_0x2949eb[0x0];if(_0x54f51d){var _0x2b26e0={'action':_0x54f51d[_0xa50a('0x63')][_0xa50a('0x64')],'allRequiredParamsPresent':_0x54f51d['queryResult'][_0xa50a('0x65')],'endConversation':_0x54f51d[_0xa50a('0x63')]['diagnosticInfo']&&_0x54f51d[_0xa50a('0x63')]['diagnosticInfo'][_0xa50a('0x66')]?_0x54f51d[_0xa50a('0x63')][_0xa50a('0x67')][_0xa50a('0x66')][_0xa50a('0x68')][_0xa50a('0x69')]:![],'fulfillmentText':_0x54f51d['queryResult'][_0xa50a('0x6a')],'intentName':_0x54f51d[_0xa50a('0x63')][_0xa50a('0x6b')]['name'],'intentDisplayName':_0x54f51d[_0xa50a('0x63')]['intent'][_0xa50a('0x6c')],'isFallbackIntent':_0x54f51d[_0xa50a('0x63')][_0xa50a('0x6b')][_0xa50a('0x6d')],'languageCode':_0x54f51d[_0xa50a('0x63')][_0xa50a('0x6e')],'queryText':_0x54f51d[_0xa50a('0x63')]['queryText'],'responseId':_0x54f51d[_0xa50a('0x6f')],'score':_0x54f51d['queryResult'][_0xa50a('0x70')],'speech':_0x54f51d[_0xa50a('0x63')][_0xa50a('0x6a')],'providerResponse':JSON[_0xa50a('0x3a')](_0x2949eb)};return _0x2b26e0;}}});};exports[_0xa50a('0x71')]=function(_0x46479e,_0x4bd5f1,_0x3444c2,_0x34dde1){return tilde['asr'](_0x46479e,_0x4bd5f1,_0x3444c2,_0x34dde1)['then'](function(_0x363444){try{fs['unlink'](_0x46479e);}catch(_0x13cbd1){logger[_0xa50a('0x16')](_0x13cbd1);}logger[_0xa50a('0x13')]('Tilde\x20ASR\x20transcription',_0x363444['transcript']);logger[_0xa50a('0x13')](_0xa50a('0x72'),_0x363444[_0xa50a('0x4b')]);return _0x363444;});};exports[_0xa50a('0x73')]=function(_0x42ac66,_0x37d97e,_0x1560e8,_0x2ffb2a,_0x724f76,_0x501563){var _0x77372e=path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x2d'));var _0x22b0a0;return aws[_0xa50a('0x74')](_0x42ac66,_0x37d97e,_0x1560e8,_0x2ffb2a,_0x724f76,_0x501563,_0x77372e)['then'](function(){_0x22b0a0=path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs['generate'](0x4)+_0xa50a('0x20'));return convertFile(_0x77372e,_0x22b0a0);})[_0xa50a('0x32')](function(){try{fs[_0xa50a('0x15')](_0x77372e);fs[_0xa50a('0x23')](_0x22b0a0,_0xa50a('0x31'));}catch(_0x45faf0){logger[_0xa50a('0x16')](_0x45faf0);}return _0x22b0a0[_0xa50a('0x24')]('.')[0x0];});};exports['awsLex']=function(_0x300031,_0x4f30f2,_0x30fd38,_0x57f87c,_0x48a116,_0x2efa35){return aws[_0xa50a('0x75')](_0x300031,_0x4f30f2,_0x30fd38,_0x57f87c,_0x48a116,_0x2efa35)[_0xa50a('0x32')](function(_0x3f3692){logger[_0xa50a('0x13')](JSON[_0xa50a('0x3a')](_0x3f3692));return _0x3f3692;});};exports[_0xa50a('0x76')]=function(_0x251c24,_0x1f2671,_0x36f6e1,_0x2814de){var _0x1f0918=util[_0xa50a('0x77')](_0xa50a('0x78'),ISPEECH_API,_0x251c24,encodeURIComponent(_0x1f2671),_0x36f6e1,_0x2814de);var _0x3a8dc9=path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs[_0xa50a('0x1f')](0x4)+_0xa50a('0x2d'));var _0x31ef5d;return downloadFile(_0x1f0918,_0x3a8dc9)[_0xa50a('0x32')](function(){_0x31ef5d=path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs['generate'](0x4)+_0xa50a('0x20'));return convertFile(_0x3a8dc9,_0x31ef5d);})[_0xa50a('0x32')](function(){try{fs[_0xa50a('0x15')](_0x3a8dc9);fs[_0xa50a('0x23')](_0x31ef5d,'777');}catch(_0x56dced){logger['error'](_0x56dced);}return _0x31ef5d[_0xa50a('0x24')]('.')[0x0];});};exports[_0xa50a('0x79')]=function(_0x362f02,_0x1af882,_0x2d1ac0,_0x435955){var _0xdaf767=util[_0xa50a('0x77')](_0xa50a('0x7a'),ISPEECH_API,_0x1af882,_0x2d1ac0,base64Encode(_0x362f02),_0x435955?util['format'](_0xa50a('0x7b'),encodeURIComponent(_0x435955)):'freeform=3');return uploadFile(_0xdaf767)[_0xa50a('0x32')](function(_0x4219cc){return querystring[_0xa50a('0x7')](_0x4219cc);});};exports[_0xa50a('0x7c')]=function(_0x4c682a,_0x535b22){return sestek[_0xa50a('0x7d')](_0x4c682a,_0x535b22)[_0xa50a('0x32')](function(_0x254268){logger[_0xa50a('0x13')](JSON[_0xa50a('0x3a')](_0x254268));var _0x27266b={'speech':_0x254268['text'],'action':_0x254268[_0xa50a('0x7e')]?_0x254268[_0xa50a('0x7e')][_0xa50a('0x7f')]:undefined,'actiondata':_0x254268[_0xa50a('0x7e')]?_0x254268[_0xa50a('0x7e')][_0xa50a('0x80')]:undefined};if(_0x254268['channelData']&&_0x254268[_0xa50a('0x7e')][_0xa50a('0x81')]){return base64Decode(_0x254268[_0xa50a('0x7e')][_0xa50a('0x81')]['Data'],path[_0xa50a('0x1e')](__dirname,_0xa50a('0x2c'),rs['generate'](0x4)+_0xa50a('0x20')))[_0xa50a('0x32')](function(_0x3ce2d6){_0x27266b[_0xa50a('0x82')]=_0x3ce2d6;return _0x27266b;});}return _0x27266b;});};exports[_0xa50a('0x83')]=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 bbca8e5..6657611 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 _0xd853=['./nda'];(function(_0x318bd6,_0x50328b){var _0x74ccff=function(_0x5d65f4){while(--_0x5d65f4){_0x318bd6['push'](_0x318bd6['shift']());}};_0x74ccff(++_0x50328b);}(_0xd853,0x11b));var _0x3d85=function(_0x5742c4,_0x5d94fc){_0x5742c4=_0x5742c4-0x0;var _0x3eecc9=_0xd853[_0x5742c4];return _0x3eecc9;};var nda=require(_0x3d85('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x3963=['./nda','exports'];(function(_0x4bea51,_0x3fc1e6){var _0x4da378=function(_0x583968){while(--_0x583968){_0x4bea51['push'](_0x4bea51['shift']());}};_0x4da378(++_0x3fc1e6);}(_0x3963,0xaa));var _0x3396=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x3963[_0xe30e17];return _0x2342c9;};var nda=require(_0x3396('0x0'));module[_0x3396('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 83833d2..2b54c24 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 _0x132f=['project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','calleridname','dnid','extension','text','Bearer\x20','access_token'];(function(_0x27da41,_0x5753b4){var _0x3ba91f=function(_0x4cd2ff){while(--_0x4cd2ff){_0x27da41['push'](_0x27da41['shift']());}};_0x3ba91f(++_0x5753b4);}(_0x132f,0x182));var _0xf132=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x132f[_0x148879];return _0x4f7027;};'use strict';var rp=require(_0xf132('0x0'));var url=require(_0xf132('0x1'));var logger=require(_0xf132('0x2'))(_0xf132('0x3'));module[_0xf132('0x4')]=function(_0x424c89,_0x54a037){var _0x1405fc={'method':_0xf132('0x5'),'uri':url[_0xf132('0x6')](_0x54a037[_0xf132('0x7')],_0xf132('0x8')),'form':{'grant_type':'password','username':_0x54a037[_0xf132('0x9')],'password':_0x54a037[_0xf132('0xa')]},'json':!![]};return rp(_0x1405fc)['then'](function(_0xbbfdc7){var _0x58cdf9={'method':_0xf132('0x5'),'uri':url[_0xf132('0x6')](_0x54a037[_0xf132('0xb')],_0xf132('0xc')),'body':{'type':_0x54a037[_0xf132('0xd')]||_0xf132('0xe'),'channelId':_0xf132('0xf'),'conversation':{'id':_0x424c89['uniqueid']},'from':{'id':_0x424c89['callerid'],'name':_0x424c89[_0xf132('0x10')]},'recipient':{'id':_0x424c89[_0xf132('0x11')],'name':_0x424c89[_0xf132('0x12')]},'text':_0x54a037[_0xf132('0x13')],'channelData':{}},'headers':{'Authorization':_0xf132('0x14')+_0xbbfdc7[_0xf132('0x15')]},'json':!![]};if(_0x54a037[_0xf132('0x16')]){_0x58cdf9[_0xf132('0x17')][_0xf132('0x18')][_0xf132('0x19')]=_0x54a037[_0xf132('0x16')];}if(_0x54a037[_0xf132('0x1a')]=='1'){_0x58cdf9['body'][_0xf132('0x18')][_0xf132('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x54a037[_0xf132('0x1c')]){_0x58cdf9['body']['channelData'][_0xf132('0x1d')]=_0x54a037[_0xf132('0x1c')];if(_0x54a037[_0xf132('0x1e')]){_0x58cdf9['body']['channelData'][_0xf132('0x1f')]=_0x54a037[_0xf132('0x1e')];}}logger[_0xf132('0x20')](JSON[_0xf132('0x21')](_0x58cdf9));return rp(_0x58cdf9);});}; \ No newline at end of file +var _0xfe57=['url','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','calleridname','text','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','body','info','stringify','request-promise'];(function(_0x422d05,_0x1166fd){var _0x754ea0=function(_0x5063e0){while(--_0x5063e0){_0x422d05['push'](_0x422d05['shift']());}};_0x754ea0(++_0x1166fd);}(_0xfe57,0x195));var _0x7fe5=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xfe57[_0x133277];return _0x5b4a22;};'use strict';var rp=require(_0x7fe5('0x0'));var url=require(_0x7fe5('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x7fe5('0x2')]=function(_0x4744a9,_0xc27f79){var _0x421809={'method':_0x7fe5('0x3'),'uri':url[_0x7fe5('0x4')](_0xc27f79[_0x7fe5('0x5')],_0x7fe5('0x6')),'form':{'grant_type':_0x7fe5('0x7'),'username':_0xc27f79[_0x7fe5('0x8')],'password':_0xc27f79[_0x7fe5('0x7')]},'json':!![]};return rp(_0x421809)[_0x7fe5('0x9')](function(_0x36ff81){var _0x4ab081={'method':_0x7fe5('0x3'),'uri':url['resolve'](_0xc27f79[_0x7fe5('0xa')],_0x7fe5('0xb')),'body':{'type':_0xc27f79['ndaactivity_type']||'message','channelId':_0x7fe5('0xc'),'conversation':{'id':_0x4744a9[_0x7fe5('0xd')]},'from':{'id':_0x4744a9['callerid'],'name':_0x4744a9[_0x7fe5('0xe')]},'recipient':{'id':_0x4744a9['dnid'],'name':_0x4744a9['extension']},'text':_0xc27f79[_0x7fe5('0xf')],'channelData':{}},'headers':{'Authorization':_0x7fe5('0x10')+_0x36ff81[_0x7fe5('0x11')]},'json':!![]};if(_0xc27f79[_0x7fe5('0x12')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x14')]=_0xc27f79['project'];}if(_0xc27f79[_0x7fe5('0x15')]=='1'){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xc27f79[_0x7fe5('0x17')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x18')]=_0xc27f79[_0x7fe5('0x17')];if(_0xc27f79[_0x7fe5('0x19')]){_0x4ab081[_0x7fe5('0x1a')][_0x7fe5('0x13')]['CustomActionData']=_0xc27f79[_0x7fe5('0x19')];}}logger[_0x7fe5('0x1b')](JSON[_0x7fe5('0x1c')](_0x4ab081));return rp(_0x4ab081);});}; \ 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 0eee398..8944ab5 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 _0x03e8=['exports'];(function(_0x68df47,_0x119145){var _0x2bb185=function(_0x458459){while(--_0x458459){_0x68df47['push'](_0x68df47['shift']());}};_0x2bb185(++_0x119145);}(_0x03e8,0xcc));var _0x803e=function(_0x1e5391,_0x28d7d5){_0x1e5391=_0x1e5391-0x0;var _0x2f6ef3=_0x03e8[_0x1e5391];return _0x2f6ef3;};'use strict';var asr=require('./lib/api');module[_0x803e('0x0')]=function(_0x6e8027,_0x2ffce7,_0x7592e8,_0x219d41){return asr(_0x6e8027,_0x2ffce7,_0x7592e8,_0x219d41);}; \ No newline at end of file +var _0xfaf6=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaf6,0x175));var _0x6faf=function(_0x10ad88,_0x412354){_0x10ad88=_0x10ad88-0x0;var _0x28500f=_0xfaf6[_0x10ad88];return _0x28500f;};'use strict';var asr=require('./lib/api');module[_0x6faf('0x0')]=function(_0x43f07a,_0x4bcf87,_0x5456c6,_0x105611){return asr(_0x43f07a,_0x4bcf87,_0x5456c6,_0x105611);}; \ 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 7995bca..d7b6027 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 _0x0851=['isNil','isObject','open','message','bluebird','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x0851,0x115));var _0x1085=function(_0x401b64,_0x5cae66){_0x401b64=_0x401b64-0x0;var _0x139aa0=_0x0851[_0x401b64];return _0x139aa0;};'use strict';var BPromise=require(_0x1085('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x1085('0x1'))(_0x1085('0x2'));module[_0x1085('0x3')]=function(_0x22097b,_0x9e860f,_0x4aacc6,_0x2446f3){return new BPromise(function(_0x284926,_0x506172){logger['info'](_0x1085('0x4'),_0x2446f3||_0x1085('0x5'));var _0x8d650e=new WebSocket(_0x2446f3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0xe46d1e='';var _0x4ce6af='0';var _0x519828='1';var _0x449f0a=_0x1085('0x6');function _0x136a80(_0xa5647e){var _0xc5b2c5=crypto[_0x1085('0x7')](_0x1085('0x8'));_0xc5b2c5['update'](_0xa5647e);return _0xc5b2c5[_0x1085('0x9')](_0x1085('0xa'));}function _0xa67944(){try{logger[_0x1085('0xb')](_0x1085('0xc'));var _0x3af49c=moment()[_0x1085('0xd')]();var _0x5172ea=_0x136a80(_0x3af49c+_0x9e860f+_0x4aacc6);_0x8d650e[_0x1085('0xe')](JSON[_0x1085('0xf')]({'appID':_0x9e860f,'timestamp':_0x3af49c,'appKey':_0x5172ea}));var _0xf22b11=fs[_0x1085('0x10')](_0x22097b);_0xf22b11['on'](_0x1085('0x11'),function(_0x3d71e2){_0x8d650e[_0x1085('0xe')](_0x3d71e2);});_0xf22b11['on'](_0x1085('0x12'),function(){_0x8d650e['send'](_0x1085('0x13'));});}catch(_0x8b10de){logger[_0x1085('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x1085('0xf')](_0x8b10de));_0x8d650e[_0x1085('0x15')]();}}function _0x1aabdb(_0xd490b7){try{if(_0xd490b7){var _0x220552=JSON[_0x1085('0x16')](_0xd490b7);switch(_0x220552['status']){case 0x0:if(_0x220552[_0x1085('0x17')]){if(_0x220552[_0x1085('0x17')][_0x1085('0x18')]){logger[_0x1085('0xb')](_0x1085('0x19'),JSON['stringify'](_0x220552[_0x1085('0x17')][_0x1085('0x1a')]));_0xe46d1e=_0x220552[_0x1085('0x17')][_0x1085('0x1a')][0x0]['transcript'];_0x4ce6af=_0x220552[_0x1085('0x17')][_0x1085('0x1a')][0x0][_0x1085('0x1b')];_0x519828='0';_0x449f0a=_0x1085('0x1c');_0x8d650e['terminate']();}}break;case 0x1:logger['info'](_0x1085('0x6'));_0x519828='1';_0x449f0a=_0x1085('0x6');break;case 0x2:logger[_0x1085('0xb')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x519828='2';_0x449f0a=_0x1085('0x1d');break;case 0x9:logger[_0x1085('0xb')](_0x1085('0x1e'));_0x519828='9';_0x449f0a=_0x1085('0x1e');break;case 0xa:logger[_0x1085('0xb')]('Authentication\x20failed.');_0x519828='10';_0x449f0a=_0x1085('0x1f');break;case 0xb:logger['info'](_0x1085('0x20'));_0x519828='11';_0x449f0a=_0x1085('0x20');}}}catch(_0x25913f){logger[_0x1085('0x14')](_0x1085('0x21'),JSON[_0x1085('0xf')](_0x25913f));_0x8d650e[_0x1085('0x15')]();}}function _0x49c76c(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x284926({'transcript':_0xe46d1e,'confidence':_0x4ce6af,'status':_0x519828,'status_message':_0x449f0a});}function _0x1d3c71(_0x42afa0){logger[_0x1085('0x14')](_0x1085('0x22'));if(!_[_0x1085('0x23')](_0x42afa0)){logger[_0x1085('0x14')](_[_0x1085('0x24')](_0x42afa0)?JSON[_0x1085('0xf')](_0x42afa0):_0x42afa0);}}_0x8d650e['on'](_0x1085('0x25'),_0xa67944);_0x8d650e['on'](_0x1085('0x26'),_0x1aabdb);_0x8d650e['on'](_0x1085('0x12'),_0x49c76c);_0x8d650e['on']('error',_0x1d3c71);});}; \ No newline at end of file +var _0xaa5a=['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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x156d2e,_0x11a957){var _0x51e92d=function(_0x10aa8d){while(--_0x10aa8d){_0x156d2e['push'](_0x156d2e['shift']());}};_0x51e92d(++_0x11a957);}(_0xaa5a,0x7d));var _0xaaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5a[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xaaa5('0x0'));var _=require(_0xaaa5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xaaa5('0x2'));var crypto=require(_0xaaa5('0x3'));var logger=require(_0xaaa5('0x4'))(_0xaaa5('0x5'));module[_0xaaa5('0x6')]=function(_0xb50363,_0x4efe72,_0x5e24c7,_0x1fb811){return new BPromise(function(_0x10ea1f,_0x134fe3){logger[_0xaaa5('0x7')](_0xaaa5('0x8'),_0x1fb811||_0xaaa5('0x9'));var _0x4a5d67=new WebSocket(_0x1fb811||_0xaaa5('0x9'),{'perMessageDeflate':![]});var _0x77eea9='';var _0x44accd='0';var _0x8f65f6='1';var _0x234d65='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2bab35(_0x116e0d){var _0x2b9635=crypto[_0xaaa5('0xa')](_0xaaa5('0xb'));_0x2b9635[_0xaaa5('0xc')](_0x116e0d);return _0x2b9635[_0xaaa5('0xd')]('hex');}function _0x2ada47(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x528e5b=moment()['unix']();var _0xac89d2=_0x2bab35(_0x528e5b+_0x4efe72+_0x5e24c7);_0x4a5d67[_0xaaa5('0xe')](JSON[_0xaaa5('0xf')]({'appID':_0x4efe72,'timestamp':_0x528e5b,'appKey':_0xac89d2}));var _0x30bd5a=fs[_0xaaa5('0x10')](_0xb50363);_0x30bd5a['on'](_0xaaa5('0x11'),function(_0x15ecc1){_0x4a5d67[_0xaaa5('0xe')](_0x15ecc1);});_0x30bd5a['on'](_0xaaa5('0x12'),function(){_0x4a5d67[_0xaaa5('0xe')](_0xaaa5('0x13'));});}catch(_0x4688cc){logger[_0xaaa5('0x14')](_0xaaa5('0x15'),JSON[_0xaaa5('0xf')](_0x4688cc));_0x4a5d67[_0xaaa5('0x16')]();}}function _0x1a81ec(_0xa5c655){try{if(_0xa5c655){var _0x44a1c5=JSON[_0xaaa5('0x17')](_0xa5c655);switch(_0x44a1c5['status']){case 0x0:if(_0x44a1c5['result']){if(_0x44a1c5[_0xaaa5('0x18')][_0xaaa5('0x19')]){logger[_0xaaa5('0x7')](_0xaaa5('0x1a'),JSON[_0xaaa5('0xf')](_0x44a1c5[_0xaaa5('0x18')][_0xaaa5('0x1b')]));_0x77eea9=_0x44a1c5[_0xaaa5('0x18')][_0xaaa5('0x1b')][0x0][_0xaaa5('0x1c')];_0x44accd=_0x44a1c5[_0xaaa5('0x18')][_0xaaa5('0x1b')][0x0][_0xaaa5('0x1d')];_0x8f65f6='0';_0x234d65='Success.';_0x4a5d67[_0xaaa5('0x16')]();}}break;case 0x1:logger['info'](_0xaaa5('0x1e'));_0x8f65f6='1';_0x234d65=_0xaaa5('0x1e');break;case 0x2:logger[_0xaaa5('0x7')](_0xaaa5('0x1f'));_0x8f65f6='2';_0x234d65=_0xaaa5('0x1f');break;case 0x9:logger[_0xaaa5('0x7')](_0xaaa5('0x20'));_0x8f65f6='9';_0x234d65=_0xaaa5('0x20');break;case 0xa:logger[_0xaaa5('0x7')](_0xaaa5('0x21'));_0x8f65f6='10';_0x234d65=_0xaaa5('0x21');break;case 0xb:logger[_0xaaa5('0x7')](_0xaaa5('0x22'));_0x8f65f6='11';_0x234d65=_0xaaa5('0x22');}}}catch(_0x4570bd){logger[_0xaaa5('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x4570bd));_0x4a5d67[_0xaaa5('0x16')]();}}function _0x4d7518(){logger[_0xaaa5('0x7')](_0xaaa5('0x23'));_0x10ea1f({'transcript':_0x77eea9,'confidence':_0x44accd,'status':_0x8f65f6,'status_message':_0x234d65});}function _0x5f286f(_0x29a129){logger['error'](_0xaaa5('0x24'));if(!_[_0xaaa5('0x25')](_0x29a129)){logger['error'](_['isObject'](_0x29a129)?JSON[_0xaaa5('0xf')](_0x29a129):_0x29a129);}}_0x4a5d67['on']('open',_0x2ada47);_0x4a5d67['on'](_0xaaa5('0x26'),_0x1a81ec);_0x4a5d67['on']('close',_0x4d7518);_0x4a5d67['on'](_0xaaa5('0x14'),_0x5f286f);});}; \ 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 ceede61..98ad323 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 _0xd471=['exports','./asr'];(function(_0x15ac1b,_0x4a313e){var _0x158f91=function(_0x1e861e){while(--_0x1e861e){_0x15ac1b['push'](_0x15ac1b['shift']());}};_0x158f91(++_0x4a313e);}(_0xd471,0x12f));var _0x1d47=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd471[_0x4c12ec];return _0x3ae42c;};var asr=require(_0x1d47('0x0'));module[_0x1d47('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7e97=['./asr','exports'];(function(_0x1704d2,_0x1db9f9){var _0x3521e0=function(_0x43ebe0){while(--_0x43ebe0){_0x1704d2['push'](_0x1704d2['shift']());}};_0x3521e0(++_0x1db9f9);}(_0x7e97,0x1a2));var _0x77e9=function(_0x536678,_0x2b4f0e){_0x536678=_0x536678-0x0;var _0x4fd642=_0x7e97[_0x536678];return _0x4fd642;};var asr=require(_0x77e9('0x0'));module[_0x77e9('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a3fd3c4..1826ebd 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 _0x1a5d=['EventEmitter','./error','./channel','127.0.0.1','emit','createServer','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','error','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events'];(function(_0x20e485,_0x47d35c){var _0x3b0c99=function(_0x3523c8){while(--_0x3523c8){_0x20e485['push'](_0x20e485['shift']());}};_0x3b0c99(++_0x47d35c);}(_0x1a5d,0x148));var _0xd1a5=function(_0x569bca,_0x4dda62){_0x569bca=_0x569bca-0x0;var _0x2b0bef=_0x1a5d[_0x569bca];return _0x2b0bef;};'use strict';var util=require(_0xd1a5('0x0'));var net=require('net');var EventEmitter=require(_0xd1a5('0x1'))[_0xd1a5('0x2')];var AGIError=require(_0xd1a5('0x3'));var AGIChannel=require(_0xd1a5('0x4'));var AGIServer=function(_0x362a8d,_0x2ca2d0,_0x7dc5c7){var _0x33a9f0=this,_0x362a8d=_0x362a8d||0x11dd,_0x2ca2d0=_0x2ca2d0||_0xd1a5('0x5'),_0x4b0203=null,_0x16a384=0x0;EventEmitter['call'](_0x33a9f0);function _0x3f81ab(){if(!_0x362a8d){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4b0203=net[_0xd1a5('0x7')]();_0x4b0203['listen'](_0x362a8d,_0x2ca2d0);_0x4b0203['on'](_0xd1a5('0x8'),function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x8'));});_0x4b0203['on'](_0xd1a5('0x9'),function(_0x397f48){_0x4b0203['getConnections'](function(_0x2e71b9,_0x1bdd51){if(_0x2e71b9){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError(_0xd1a5('0xa'),_0x2e71b9));}else if(_0x7dc5c7&&_0x7dc5c7<0x0){_0x33a9f0[_0xd1a5('0x6')]('error',new AGIError(_0xd1a5('0xb')));_0x397f48[_0xd1a5('0xc')]();}else if(_0x7dc5c7&&_0x7dc5c7>0x0&&_0x7dc5c7<_0x1bdd51){_0x16a384+=0x1;_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0xd'),new AGIError(_0xd1a5('0xe'),_0x16a384));_0x397f48[_0xd1a5('0xc')]();}else{var _0x2e0695=new AGIChannel(_0x397f48);_0x2e0695['on'](_0xd1a5('0xf'),function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x9'),_0x2e0695);});}});});_0x4b0203['on']('error',function(_0x3fead4){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0xd'),new AGIError(_0xd1a5('0xa'),_0x3fead4[_0xd1a5('0x10')]));});_0x4b0203['on']('close',function(){_0x33a9f0[_0xd1a5('0x6')](_0xd1a5('0x11'),new AGIError(_0xd1a5('0x12')));});}process[_0xd1a5('0x13')](function(){_0x3f81ab();});};util[_0xd1a5('0x14')](AGIServer,EventEmitter);module[_0xd1a5('0x15')]=function(_0x4c54f2,_0x3e32b8,_0x33451c){return new AGIServer(_0x4c54f2,_0x3e32b8,_0x33451c);}; \ No newline at end of file +var _0x560c=['./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','emit','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error'];(function(_0x1faa6e,_0x423197){var _0x15fc1d=function(_0x4bd1ac){while(--_0x4bd1ac){_0x1faa6e['push'](_0x1faa6e['shift']());}};_0x15fc1d(++_0x423197);}(_0x560c,0x6e));var _0xc560=function(_0x48cc33,_0xfac244){_0x48cc33=_0x48cc33-0x0;var _0x430fe0=_0x560c[_0x48cc33];return _0x430fe0;};'use strict';var util=require(_0xc560('0x0'));var net=require(_0xc560('0x1'));var EventEmitter=require(_0xc560('0x2'))[_0xc560('0x3')];var AGIError=require(_0xc560('0x4'));var AGIChannel=require(_0xc560('0x5'));var AGIServer=function(_0x124920,_0x4dcb06,_0x4ba2a0){var _0x47c88f=this,_0x124920=_0x124920||0x11dd,_0x4dcb06=_0x4dcb06||_0xc560('0x6'),_0x1f92e1=null,_0x4235be=0x0;EventEmitter[_0xc560('0x7')](_0x47c88f);function _0x35fa4d(){if(!_0x124920){_0x47c88f['emit'](_0xc560('0x8'),new AGIError(_0xc560('0x9')));return![];}_0x1f92e1=net[_0xc560('0xa')]();_0x1f92e1[_0xc560('0xb')](_0x124920,_0x4dcb06);_0x1f92e1['on'](_0xc560('0xc'),function(){_0x47c88f['emit'](_0xc560('0xc'));});_0x1f92e1['on'](_0xc560('0xd'),function(_0x23de7b){_0x1f92e1['getConnections'](function(_0x2116da,_0x3cc2ad){if(_0x2116da){_0x47c88f[_0xc560('0xe')](_0xc560('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x2116da));}else if(_0x4ba2a0&&_0x4ba2a0<0x0){_0x47c88f[_0xc560('0xe')]('error',new AGIError(_0xc560('0xf')));_0x23de7b['destroy']();}else if(_0x4ba2a0&&_0x4ba2a0>0x0&&_0x4ba2a0<_0x3cc2ad){_0x4235be+=0x1;_0x47c88f[_0xc560('0xe')](_0xc560('0x8'),new AGIError(_0xc560('0x10'),_0x4235be));_0x23de7b['destroy']();}else{var _0x28c70e=new AGIChannel(_0x23de7b);_0x28c70e['on'](_0xc560('0x11'),function(){_0x47c88f[_0xc560('0xe')]('connection',_0x28c70e);});}});});_0x1f92e1['on']('error',function(_0x43f009){_0x47c88f[_0xc560('0xe')]('error',new AGIError(_0xc560('0x12'),_0x43f009['code']));});_0x1f92e1['on'](_0xc560('0x13'),function(){_0x47c88f[_0xc560('0xe')](_0xc560('0x13'),new AGIError(_0xc560('0x14')));});}process[_0xc560('0x15')](function(){_0x35fa4d();});};util['inherits'](AGIServer,EventEmitter);module[_0xc560('0x16')]=function(_0x47231a,_0x232814,_0x92e4cc){return new AGIServer(_0x47231a,_0x232814,_0x92e4cc);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dee5039..208be7a 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 _0x20c9=['google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','isConfigured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_INSTANCE','odbc_id','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','intKey','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue_id','no\x20queue\x20selected','XMCS-QUEUE','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','exports','path','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','getVoiceQueue','getVoiceQueueById','name','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','error','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','MALE','audioEncoding','googleTTS'];(function(_0x83a0fe,_0x3640a8){var _0x4ef020=function(_0x41fb1b){while(--_0x41fb1b){_0x83a0fe['push'](_0x83a0fe['shift']());}};_0x4ef020(++_0x3640a8);}(_0x20c9,0x163));var _0x920c=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x20c9[_0x381379];return _0x3e1063;};'use strict';var fs=require('fs');var path=require(_0x920c('0x0'));var util=require('util');var _=require(_0x920c('0x1'));var sh=require(_0x920c('0x2'));var odbc=require('odbc')();var rs=require(_0x920c('0x3'));var moment=require(_0x920c('0x4'));var Mustache=require(_0x920c('0x5'));var rp=require(_0x920c('0x6'));var logger=require(_0x920c('0x7'))(_0x920c('0x8'));var config=require('../../config/environment');var scripts=require(_0x920c('0x9'));var FILES_PATH=_0x920c('0xa');var recursiveMapAttributes=['rawHeaders',_0x920c('0xb')];var verticesWithRetry=[_0x920c('0xc'),'getdigits',_0x920c('0xd')];var AGIVertices=function(_0xf5cc61,_0x3d8629,_0x4dc4d7){this['channel']=_0xf5cc61;this[_0x920c('0xe')]=_0x3d8629;this[_0x920c('0xf')]=_0x4dc4d7;};AGIVertices[_0x920c('0x10')][_0x920c('0x11')]=function(_0x452f43,_0x4d71fb){this['rpc']['getVariableById'](_0x452f43)[_0x920c('0x12')](function(_0x54185f){_0x4d71fb(null,_0x54185f?_0x54185f['name']:![]);})['catch'](function(_0xcd93f9){_0x4d71fb(_0xcd93f9);});};AGIVertices[_0x920c('0x10')][_0x920c('0x13')]=function(_0x57de9f,_0x2f45e8){this['rpc'][_0x920c('0x14')](_0x57de9f)['then'](function(_0x466691){_0x2f45e8(null,_0x466691?_0x466691[_0x920c('0x15')]:![]);})['catch'](function(_0x5588ad){_0x2f45e8(_0x5588ad);});};AGIVertices[_0x920c('0x10')][_0x920c('0x16')]=function(_0x164082,_0x12043a){this[_0x920c('0xe')]['getSquareProjectById'](_0x164082)[_0x920c('0x12')](function(_0x29e512){_0x12043a(null,_0x29e512?_0x29e512[_0x920c('0x15')]:![]);})[_0x920c('0x17')](function(_0x46b3e0){_0x12043a(_0x46b3e0);});};AGIVertices[_0x920c('0x10')][_0x920c('0x18')]=function(_0x31d76c,_0x4ef71c){this['rpc'][_0x920c('0x19')](_0x31d76c)[_0x920c('0x12')](function(_0x45c01a){_0x4ef71c(null,_0x45c01a?_0x45c01a[_0x920c('0x1a')]:![]);})[_0x920c('0x17')](function(_0x27e9ec){_0x4ef71c(_0x27e9ec);});};AGIVertices[_0x920c('0x10')][_0x920c('0x1b')]=function(_0x563d42,_0x99fa34){this['rpc'][_0x920c('0x1c')](_0x563d42)[_0x920c('0x12')](function(_0x55f088){_0x99fa34(null,_0x55f088?_0x55f088[_0x920c('0x15')]:![]);})['catch'](function(_0xf23862){_0x99fa34(_0xf23862);});};AGIVertices['prototype'][_0x920c('0x1d')]=function(_0x282a67,_0x2e9683){this[_0x920c('0xe')]['getTrunkById'](_0x282a67)[_0x920c('0x12')](function(_0x274aac){_0x2e9683(null,_0x274aac?_0x274aac[_0x920c('0x15')]:![]);})['catch'](function(_0x57af2a){_0x2e9683(_0x57af2a);});};AGIVertices[_0x920c('0x10')]['getSound']=function(_0x25dfb9,_0x17246c){var _0x2b1e87=this;this[_0x920c('0xe')][_0x920c('0x1e')](_0x25dfb9)[_0x920c('0x12')](function(_0x12277f){_0x17246c(null,_0x12277f?_0x2b1e87[_0x920c('0x1f')](_0x12277f[_0x920c('0x20')]):![]);})[_0x920c('0x17')](function(_0x46c05b){_0x17246c(_0x46c05b);});};AGIVertices[_0x920c('0x10')]['getMailAccount']=function(_0x251794,_0x40ed64){this['rpc'][_0x920c('0x21')](_0x251794)[_0x920c('0x12')](function(_0x9e6615){_0x40ed64(null,_0x9e6615?_0x9e6615:![]);})[_0x920c('0x17')](function(_0x20dfe2){_0x40ed64(_0x20dfe2);});};AGIVertices[_0x920c('0x10')][_0x920c('0x22')]=function(_0x10d723,_0x1daf45,_0x407d13){this[_0x920c('0xf')]['sendMailMessage'](_0x10d723,_0x1daf45)['then'](function(){_0x407d13(null);})['catch'](function(_0x1c56ac){_0x407d13(_0x1c56ac);});};AGIVertices[_0x920c('0x10')][_0x920c('0x23')]=function(_0x530eb0,_0x1d871e){this['rpc']['getIntervalById'](_0x530eb0)[_0x920c('0x12')](function(_0xecdc0a){if(_0xecdc0a){if(_0xecdc0a[_0x920c('0x24')]){_0x1d871e(null,[_0xecdc0a[_0x920c('0x25')]]);}else{_0x1d871e(null,_['map'](_0xecdc0a['Intervals'],_0x920c('0x25')));}}else{_0x1d871e(null,![]);}})[_0x920c('0x17')](function(_0x49ba86){_0x1d871e(_0x49ba86);});};AGIVertices['prototype'][_0x920c('0x1f')]=function(_0x4d8a4){return util[_0x920c('0x26')](_0x920c('0x27'),FILES_PATH,_0x4d8a4);};AGIVertices[_0x920c('0x10')][_0x920c('0x28')]=function(_0x33a4c6,_0x367f0e,_0x14cf7c){odbc[_0x920c('0x29')](_0x33a4c6,function(_0x111515){if(_0x111515){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x111515);_0x14cf7c(_0x111515);}else{logger[_0x920c('0x2a')](_0x920c('0x2b'));odbc[_0x920c('0x2c')](_0x367f0e,function(_0x20089c,_0x5516ec){if(_0x20089c){logger[_0x920c('0x2a')](_0x920c('0x2d'),_0x367f0e);_0x14cf7c(_0x20089c);}else{logger[_0x920c('0x2a')]('Query\x20executed\x20correctly\x20%s',_0x367f0e);odbc[_0x920c('0x2e')](function(_0x40cc1d){if(_0x40cc1d){logger[_0x920c('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x40cc1d);}_0x14cf7c(null,_0x5516ec);});}});}});};AGIVertices['prototype'][_0x920c('0x30')]=function(_0x16a59f,_0x2cb880){this[_0x920c('0xe')][_0x920c('0x31')](_0x16a59f)['then'](function(_0x2014c8){_0x2cb880(null,_0x2014c8?_0x2014c8:![]);})['catch'](function(_0x108c51){_0x2cb880(_0x108c51);});};AGIVertices[_0x920c('0x10')][_0x920c('0x32')]=function(_0x276c82,_0x2d647c){this['rpc'][_0x920c('0x32')](_0x276c82)['then'](function(_0x308c2e){_0x2d647c(null,_0x308c2e);})[_0x920c('0x17')](function(_0x355960){_0x2d647c(_0x355960);});};AGIVertices[_0x920c('0x10')][_0x920c('0x33')]=function(_0x3d3898,_0x103431,_0x1f3f78){this[_0x920c('0xe')][_0x920c('0x33')]({'uniqueid':this[_0x920c('0x34')]['uniqueid'],'node':_0x3d3898[_0x920c('0x35')],'application':_0x3d3898[_0x920c('0x36')],'data':_0x103431||null,'project_name':this[_0x920c('0x34')][_0x920c('0x37')],'callerid':this[_0x920c('0x34')][_0x920c('0x38')]})[_0x920c('0x12')](function(_0x5a32a0){if(_0x1f3f78){_0x1f3f78(null,_0x5a32a0);}})[_0x920c('0x17')](function(_0xcaa759){if(_0x1f3f78){_0x1f3f78(_0xcaa759);}});};AGIVertices[_0x920c('0x10')][_0x920c('0x39')]=function(_0x454c48,_0x4e4809,_0x5b9fec,_0x2b9c95){this[_0x920c('0xe')]['createSquareRecording']({'uniqueid':this[_0x920c('0x34')]['uniqueid'],'callerid':this[_0x920c('0x34')][_0x920c('0x38')],'calleridname':this['channel'][_0x920c('0x3a')],'context':this['channel'][_0x920c('0x3b')],'extension':this[_0x920c('0x34')][_0x920c('0x3c')],'priority':this[_0x920c('0x34')][_0x920c('0x3d')],'accountcode':this['channel'][_0x920c('0x3e')],'dnid':this['channel'][_0x920c('0x3f')],'projectName':this[_0x920c('0x34')][_0x920c('0x37')],'saveName':_0x4e4809,'filename':_0x454c48[_0x920c('0x40')]||_0x4e4809,'savePath':_0x5b9fec})['then'](function(_0x422371){_0x2b9c95(null,_0x422371);})[_0x920c('0x17')](function(_0x4357e2){_0x2b9c95(_0x4357e2);});};AGIVertices[_0x920c('0x10')]['createSquareMessage']=function(_0x411384,_0x24fa75,_0x31809b,_0x252fb3,_0x3e7c51){this[_0x920c('0xe')][_0x920c('0x41')]({'uniqueid':this[_0x920c('0x34')][_0x920c('0x42')],'body':_0x411384,'direction':_0x24fa75,'providerName':_0x31809b,'providerResponse':_0x252fb3})[_0x920c('0x12')](function(_0x2a9dcd){if(_0x3e7c51){_0x3e7c51(null,_0x2a9dcd);}})[_0x920c('0x17')](function(_0x35f9e2){if(_0x3e7c51){_0x3e7c51(_0x35f9e2);}});};AGIVertices[_0x920c('0x10')]['createCmContact']=function(_0x45b665,_0x3257f3){this[_0x920c('0xe')][_0x920c('0x43')]({'firstName':_[_0x920c('0x44')](_0x45b665['name'])||_[_0x920c('0x45')](_0x45b665[_0x920c('0x15')])?_0x920c('0x46')+Math['random']():_0x45b665['name'],'lastName':_[_0x920c('0x44')](_0x45b665['lastName'])||_[_0x920c('0x45')](_0x45b665[_0x920c('0x47')])?null:_0x45b665[_0x920c('0x47')],'phone':_0x45b665[_0x920c('0x48')],'ListId':_0x45b665[_0x920c('0x49')],'scheduledat':_0x45b665[_0x920c('0x4a')],'callbackUniqueid':this['channel'][_0x920c('0x42')],'tags':'callback','description':_0x920c('0x4b')+_0x45b665[_0x920c('0x4a')][_0x920c('0x4c')](),'priority':_0x45b665[_0x920c('0x4d')]})[_0x920c('0x12')](function(_0x52e4de){_0x3257f3(null,_0x52e4de);})[_0x920c('0x17')](function(_0x229d29){_0x3257f3(_0x229d29);});};AGIVertices[_0x920c('0x10')][_0x920c('0x4e')]=function(_0x3df650,_0x5a0e0e){this[_0x920c('0xe')]['getPauseById'](_0x3df650)[_0x920c('0x12')](function(_0x445e4a){_0x5a0e0e(null,_0x445e4a?_0x445e4a[_0x920c('0x15')]:![]);})['catch'](function(_0x119e8c){_0x5a0e0e(_0x119e8c);});};AGIVertices[_0x920c('0x10')]['agentPause']=function(_0xcc061f,_0x5dc276,_0x584fc1){var _0x319d85={'role':_0x920c('0x4f')};_0x319d85[_0xcc061f]=this[_0x920c('0x34')][_0x920c('0x38')];this[_0x920c('0xe')][_0x920c('0x50')](_0x319d85,_0x5dc276,this[_0x920c('0x34')][_0x920c('0x42')])['then'](function(_0x13eba0){_0x584fc1(null,_[_0x920c('0x45')](_0x13eba0)?![]:!![]);})[_0x920c('0x17')](function(_0x377480){logger['error'](_0x377480);_0x584fc1(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x51')]=function(_0x5b8bf0,_0x47e9be){var _0x120de8={'role':_0x920c('0x4f')};_0x120de8[_0x5b8bf0]=this[_0x920c('0x34')]['callerid'];this[_0x920c('0xe')][_0x920c('0x51')](_0x120de8)['then'](function(_0x70ee0d){_0x47e9be(null,_[_0x920c('0x45')](_0x70ee0d)?![]:!![]);})[_0x920c('0x17')](function(_0x14b3a6){logger[_0x920c('0x2f')](_0x14b3a6);_0x47e9be(null,![]);});};AGIVertices[_0x920c('0x10')]['agentLogout']=function(_0x3a1f65,_0x5bff36){var _0x48811a={'role':_0x920c('0x4f')};_0x48811a[_0x3a1f65]=this['channel'][_0x920c('0x38')];this['rpc'][_0x920c('0x52')](_0x48811a)[_0x920c('0x12')](function(_0x1c40fc){_0x5bff36(null,_[_0x920c('0x45')](_0x1c40fc)?![]:!![]);})['catch'](function(_0x599a66){logger[_0x920c('0x2f')](_0x599a66);_0x5bff36(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x53')]=function(_0x599ba,_0x2e5bb0){var _0x43ee5e={'role':'agent'};_0x43ee5e[_0x599ba]=this[_0x920c('0x34')]['callerid'];var _0x5af4ca=_0x599ba!='internal'?util[_0x920c('0x26')](_0x920c('0x54'),_0x920c('0x55'),this[_0x920c('0x34')][_0x920c('0x38')]):undefined;this[_0x920c('0xe')]['agentLogin'](_0x43ee5e,_0x5af4ca)['then'](function(_0x4f96f2){_0x2e5bb0(null,_[_0x920c('0x45')](_0x4f96f2)?![]:!![]);})[_0x920c('0x17')](function(_0x464ac0){logger[_0x920c('0x2f')](_0x464ac0);_0x2e5bb0(null,![]);});};AGIVertices[_0x920c('0x10')][_0x920c('0x56')]=function(_0x122cb7,_0x252af4){sh[_0x920c('0x57')](_['trim'](_0x122cb7),function(_0x5061f0,_0x3a2227){var _0x444c7a=_0x3a2227['replace'](/(\r\n|\n|\r)/gm,'');_0x252af4(null,_0x444c7a);});};AGIVertices[_0x920c('0x10')]['googleCloudTTS']=function(_0x2b8984,_0x292938){scripts[_0x920c('0x58')](_0x2b8984[_0x920c('0x59')],_0x2b8984[_0x920c('0x5a')]||'text',_0x2b8984[_0x920c('0x5b')],_0x2b8984['languageCode']||'en-US',_0x2b8984['ssmlGender']||_0x920c('0x5c'),_0x2b8984[_0x920c('0x5d')]||'MP3')[_0x920c('0x12')](function(_0x35b1f1){_0x292938(null,_0x35b1f1);})[_0x920c('0x17')](function(_0x5e15e8){_0x292938(_0x5e15e8);});};AGIVertices[_0x920c('0x10')][_0x920c('0x5e')]=function(_0xd4a2c,_0x5af67d){scripts['googleTTS'](_0xd4a2c['text'],_0xd4a2c[_0x920c('0x5f')]||'en',0x1)[_0x920c('0x12')](function(_0x239fc4){_0x5af67d(null,_0x239fc4);})[_0x920c('0x17')](function(_0x4049d9){_0x5af67d(_0x4049d9);});};AGIVertices[_0x920c('0x10')][_0x920c('0x60')]=function(_0x33a94b,_0x1092e0){var _0x216985={'uri':_0x33a94b[_0x920c('0x61')],'method':_0x33a94b[_0x920c('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x33a94b['timeout'])===_0x920c('0x63')&&parseInt(_0x33a94b[_0x920c('0x64')])>=0x1?parseInt(_0x33a94b[_0x920c('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x920c('0x65')]([_0x920c('0x66'),_0x920c('0x67')],_0x216985[_0x920c('0x62')][_0x920c('0x68')]())){try{_0x216985['body']=_0x33a94b[_0x920c('0xb')]?JSON[_0x920c('0x69')](_0x33a94b[_0x920c('0xb')]):{};}catch(_0x17f03e){logger[_0x920c('0x2f')](_0x920c('0x6a'),_0x17f03e);}}try{_0x216985[_0x920c('0x6b')]=_0x33a94b['rawHeaders']?JSON[_0x920c('0x69')](_0x33a94b['rawHeaders']):{};}catch(_0x2ba1ac){logger[_0x920c('0x2f')](_0x920c('0x6c'),_0x2ba1ac);}if(_0x33a94b[_0x920c('0x6d')]){try{var _0x716180=require(_0x33a94b[_0x920c('0x6d')])[_0x920c('0x6e')](this,_0x216985);_0x216985[_0x920c('0x6f')]=Mustache[_0x920c('0x70')](_0x33a94b['url'],_0x716180,{},['$$','$$']);if(_0x216985[_0x920c('0x6b')]){_0x216985['headers']=JSON['parse'](Mustache[_0x920c('0x70')](JSON['stringify'](_0x216985['headers']),_0x716180,{},['$$','$$']));}if(_0x216985['body']){_0x216985[_0x920c('0x71')]=JSON[_0x920c('0x69')](Mustache[_0x920c('0x70')](JSON[_0x920c('0x72')](_0x216985[_0x920c('0x71')]),_0x716180,{},['$$','$$']));}}catch(_0x533711){logger[_0x920c('0x2f')](_0x920c('0x73'),_0x533711);}}rp(_0x216985)[_0x920c('0x12')](function(_0x18fa9f){var _0x4b86d2={'statusCode':_0x18fa9f[_0x920c('0x74')]||0xc8,'statusMessage':_0x18fa9f[_0x920c('0x75')]||'OK','headers':_0x18fa9f[_0x920c('0x6b')]||{},'body':_0x18fa9f[_0x920c('0x71')]||{}};_0x1092e0(null,_0x4b86d2);})[_0x920c('0x17')](function(_0x827ba2){var _0x347179={'statusCode':_0x827ba2[_0x920c('0x74')]||0x1f4,'statusMessage':_0x827ba2[_0x920c('0x76')]||_0x920c('0x77'),'headers':_0x827ba2['options'][_0x920c('0x6b')]||{},'body':_0x827ba2[_0x920c('0x78')][_0x920c('0x71')]||{}};_0x1092e0(null,_0x347179);});};AGIVertices[_0x920c('0x10')]['googleDialogflow']=function(_0x20c13e,_0x54bf55){scripts[_0x920c('0x79')](this[_0x920c('0x34')][_0x920c('0x42')],_0x20c13e[_0x920c('0x7a')],_0x20c13e[_0x920c('0x5b')],_0x20c13e[_0x920c('0x7b')]||'en')[_0x920c('0x12')](function(_0x38ff7f){_0x54bf55(null,_0x38ff7f);})[_0x920c('0x17')](function(_0x1abc3e){_0x54bf55(_0x1abc3e);});};AGIVertices['prototype'][_0x920c('0x7c')]=function(_0x56f1ea,_0x12136c){scripts['googleDialogflowV2'](this['channel'][_0x920c('0x42')],_0x56f1ea[_0x920c('0x7d')],_0x56f1ea[_0x920c('0x7e')],_0x56f1ea['private_key'],_0x56f1ea[_0x920c('0x5b')],_0x56f1ea[_0x920c('0x7f')]||'en')['then'](function(_0x5a071b){_0x12136c(null,_0x5a071b);})[_0x920c('0x17')](function(_0x2c8721){_0x12136c(_0x2c8721);});};AGIVertices['prototype'][_0x920c('0x80')]=function(_0x14c1f5,_0x54c060){scripts[_0x920c('0x80')](this['channel'],_0x14c1f5)[_0x920c('0x12')](function(_0x174a57){_0x54c060(null,_0x174a57);})[_0x920c('0x17')](function(_0x5e59f4){_0x54c060(_0x5e59f4);});};AGIVertices[_0x920c('0x10')][_0x920c('0x81')]=function(_0x5c5716,_0x1176ca){scripts[_0x920c('0x81')](_0x5c5716[_0x920c('0x7a')],_0x5c5716[_0x920c('0x5b')],_0x5c5716['ispeech_tts_language']||_0x920c('0x82'),_0x5c5716[_0x920c('0x83')])[_0x920c('0x12')](function(_0x1d16f6){_0x1176ca(null,_0x1d16f6);})['catch'](function(_0x372bae){_0x1176ca(_0x372bae);});};AGIVertices[_0x920c('0x10')][_0x920c('0x84')]=function(_0x563791,_0x40f535,_0x754e40){scripts['ispeechASR'](_0x40f535,_0x563791['key'],_0x563791[_0x920c('0x85')]||'en-US',this['isConfigured'](_0x563791[_0x920c('0x86')])?_0x563791[_0x920c('0x86')]:undefined)[_0x920c('0x12')](function(_0x5dbf92){_0x754e40(null,_0x5dbf92);})[_0x920c('0x17')](function(_0x1449a0){_0x754e40(_0x1449a0);});};AGIVertices[_0x920c('0x10')][_0x920c('0x87')]=function(_0x4c5956,_0x256431){scripts['awsPolly'](_0x4c5956[_0x920c('0x88')],_0x4c5956[_0x920c('0x89')],_0x4c5956['aws_polly_region'],_0x4c5956['aws_polly_voice']||'Amy',_0x4c5956[_0x920c('0x5b')],_0x4c5956[_0x920c('0x8a')]||_0x920c('0x5b'))[_0x920c('0x12')](function(_0x354e69){_0x256431(null,_0x354e69);})[_0x920c('0x17')](function(_0x2982dd){_0x256431(_0x2982dd);});};AGIVertices[_0x920c('0x10')][_0x920c('0x8b')]=function(_0x3fc1c6,_0x337132){scripts[_0x920c('0x8b')](this[_0x920c('0x34')][_0x920c('0x42')],_0x3fc1c6[_0x920c('0x88')],_0x3fc1c6[_0x920c('0x89')],_0x3fc1c6[_0x920c('0x8c')],_0x3fc1c6[_0x920c('0x5b')],_0x3fc1c6[_0x920c('0x8d')])[_0x920c('0x12')](function(_0x3cd797){_0x337132(null,_0x3cd797);})[_0x920c('0x17')](function(_0x299150){_0x337132(_0x299150);});};AGIVertices[_0x920c('0x10')][_0x920c('0x8e')]=function(_0x1c22ab,_0x556ab8,_0xaeb6cd){scripts[_0x920c('0x8e')](_0x556ab8,_0x1c22ab['key'],_0x1c22ab[_0x920c('0x8f')]||_0x920c('0x82'))[_0x920c('0x12')](function(_0x1417c3){_0xaeb6cd(null,_0x1417c3);})[_0x920c('0x17')](function(_0x2ae8e9){_0xaeb6cd(_0x2ae8e9);});};AGIVertices[_0x920c('0x10')]['tildeASR']=function(_0x47f167,_0x57938a,_0x43ffa7){scripts[_0x920c('0x90')](_0x57938a,_0x47f167[_0x920c('0x91')],_0x47f167[_0x920c('0x92')],_0x47f167[_0x920c('0x6f')])[_0x920c('0x12')](function(_0x5c7779){_0x43ffa7(null,_0x5c7779);})[_0x920c('0x17')](function(_0x5a68d7){_0x43ffa7(_0x5a68d7);});};AGIVertices[_0x920c('0x10')][_0x920c('0x93')]=function(_0x444f3d){var _0x41e157=_[_0x920c('0x65')](verticesWithRetry,_0x444f3d[_0x920c('0x36')])?_0x444f3d:_[_0x920c('0x94')](_0x444f3d);for(var _0x238960 in _0x41e157){if(_0x41e157['hasOwnProperty'](_0x238960)){if(_0x41e157[_0x238960]&&_[_0x920c('0x95')](_0x41e157[_0x238960])){if(_['includes'](recursiveMapAttributes,_0x238960)){_0x41e157[_0x238960]=this['replaceObjectAllVariables'](_0x41e157[_0x238960]);}else{_0x41e157[_0x238960]=this[_0x920c('0x96')](_0x41e157[_0x238960]);}}}}return _0x41e157;};AGIVertices['prototype'][_0x920c('0x97')]=function(_0x59b0a7){for(var _0x103678 in _0x59b0a7){if(_0x59b0a7[_0x920c('0x98')](_0x103678)){if(_['isPlainObject'](_0x59b0a7[_0x103678])){this[_0x920c('0x97')](_0x59b0a7[_0x103678]);}else if(_[_0x920c('0x99')](_0x59b0a7[_0x103678])){for(var _0x33b3d6=0x0;_0x33b3d6<_0x59b0a7[_0x103678]['length'];_0x33b3d6++){this[_0x920c('0x97')](_0x59b0a7[_0x103678][_0x33b3d6]);}}else if(_['isString'](_0x59b0a7[_0x103678])){_0x59b0a7[_0x103678]=this[_0x920c('0x96')](_0x59b0a7[_0x103678]);}}}};AGIVertices['prototype'][_0x920c('0x9a')]=function(_0x1db95f,_0x34824e){for(var _0x4562fd in _0x1db95f){if(_0x1db95f[_0x920c('0x98')](_0x4562fd)){if(_[_0x920c('0x9b')](_0x1db95f[_0x4562fd])){if(!_[_0x920c('0x44')](_0x1db95f[_0x4562fd])){this[_0x920c('0x9a')](_0x1db95f[_0x4562fd],util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd));}}else if(_[_0x920c('0x99')](_0x1db95f[_0x4562fd])){for(var _0x4d0cd5=0x0;_0x4d0cd5<_0x1db95f[_0x4562fd][_0x920c('0x9d')];_0x4d0cd5++){this['saveRestApiResult'](_0x1db95f[_0x4562fd][_0x4d0cd5],util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd+'['+_0x4d0cd5+']'));}}else{if(!_[_0x920c('0x45')](_0x1db95f[_0x4562fd])){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x9c'),_0x34824e,_0x4562fd),_0x1db95f[_0x4562fd]);}}}}};AGIVertices[_0x920c('0x10')][_0x920c('0x9f')]=function(_0x5ccbaa){try{var _0x21bedf=JSON[_0x920c('0x69')](_0x5ccbaa);this['recursiveNodeIndex'](_0x21bedf);return JSON[_0x920c('0x72')](_0x21bedf);}catch(_0x28f4b4){return this[_0x920c('0x96')](_0x5ccbaa);}};AGIVertices[_0x920c('0x10')][_0x920c('0x96')]=function(_0x314598){var _0x284532=_0x314598[_0x920c('0xa0')]('{');for(var _0x54f689=0x1;_0x54f689<_0x284532[_0x920c('0x9d')];_0x54f689+=0x1){var _0xd69d24=_0x284532[_0x54f689][_0x920c('0xa0')]('}');if(_0xd69d24['length']>0x1){_0x314598=_0x314598[_0x920c('0xa1')]('{'+_0xd69d24[0x0]+'}',this[_0x920c('0x34')]['getVariable'](_0xd69d24[0x0])[_0x920c('0xa2')]||_0xd69d24[0x0]);}}if(_0x284532[_0x920c('0x9d')]===0x1){return _0x314598[_0x920c('0x4c')]();}return this[_0x920c('0x96')](_0x314598);};AGIVertices[_0x920c('0x10')][_0x920c('0xa3')]=function(_0x2bea98,_0x115d55){var _0x31bb38=this[_0x920c('0x34')]['getVariable'](_0x2bea98);if(_0x31bb38[_0x920c('0xa4')]===-0x1){return _0x31bb38;}logger['info'](util[_0x920c('0x26')](_0x920c('0xa5'),_0x115d55,_0x31bb38[_0x920c('0xa2')]));return this['channel'][_0x920c('0x9e')](_0x115d55,_0x31bb38['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x197cc9){return _0x197cc9&&_0x197cc9!=='0'&&_0x197cc9!=='-1'&&_0x197cc9!=='';};AGIVertices['prototype'][_0x920c('0xa6')]=function(_0x2cc29e){this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x2cc29e,'-');_0x2cc29e[_0x920c('0xa7')]=_0x2cc29e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x920c('0xa8')]=function(_0x2380c4){logger[_0x920c('0x2a')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2380c4[_0x920c('0x35')]));if(!this['isConfigured'](_0x2380c4['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x3607d1='\x22'+_0x2380c4[_0x920c('0x5b')]+'\x22';if(this['isConfigured'](_0x2380c4['options'])){_0x3607d1+=','+_0x2380c4[_0x920c('0x78')];}var _0x269132=this[_0x920c('0x34')][_0x920c('0x57')]('MRCPSynth',_0x3607d1);if(_0x269132[_0x920c('0xa4')]===-0x1){return _0x269132;}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xab'),_0x3607d1));};AGIVertices[_0x920c('0x10')]['mrcprecog']=function(_0x13d3bd){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x13d3bd[_0x920c('0x35')]));if(!this['isConfigured'](_0x13d3bd[_0x920c('0xac')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xad'));}var _0x1a7560=_0x13d3bd['grammar'];if(this[_0x920c('0xae')](_0x13d3bd['options'])){_0x1a7560+=','+_0x13d3bd[_0x920c('0x78')];}var _0x5156e3=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xaf'),_0x1a7560);if(_0x5156e3['result']===-0x1){return _0x5156e3;}var _0x10b468=this['getAndSetVariable'](_0x920c('0xb0'),'MRCP_RECOG_CONFIDENCE');if(_0x10b468[_0x920c('0xa4')]===-0x1){return _0x10b468;}var _0x547c16=this['getAndSetVariable'](_0x920c('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x547c16[_0x920c('0xa4')]===-0x1){return _0x547c16;}var _0x336b96=this[_0x920c('0xa3')]('RECOG_INSTANCE()',_0x920c('0xb2'));if(_0x336b96[_0x920c('0xa4')]===-0x1){return _0x336b96;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x1a7560));};AGIVertices[_0x920c('0x10')][_0x920c('0x8')]=function(_0x29ffb4){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb4'),_0x29ffb4[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x8')]([_0x29ffb4[_0x920c('0xb5')],_0x29ffb4[_0x920c('0xb6')]]);};AGIVertices[_0x920c('0x10')][_0x920c('0xb7')]=function(_0x38f4a8){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb8'),_0x38f4a8[_0x920c('0x35')]));if(this['isConfigured'](_0x38f4a8[_0x920c('0x64')])){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xb9'),_0x38f4a8['timeout']));var _0x160742=this[_0x920c('0x34')]['wait'](_0x38f4a8[_0x920c('0x64')]);if(_0x160742[_0x920c('0xa4')]===-0x1){return _0x160742;}}return this[_0x920c('0x34')][_0x920c('0xb7')]();};AGIVertices[_0x920c('0x10')][_0x920c('0xba')]=function(_0x3c79a){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xbb'),_0x3c79a[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x3c79a[_0x920c('0x49')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3c79a,_0x920c('0xbc'));}_0x3c79a['scheduledAt']=moment();if(this['isConfigured'](_0x3c79a['delay'])){_0x3c79a[_0x920c('0x4a')]=moment()[_0x920c('0xbd')](_0x3c79a[_0x920c('0xbe')],'minutes');}if(!this[_0x920c('0xae')](_0x3c79a[_0x920c('0x4d')])){_0x3c79a['callback_priority']=0x2;}this[_0x920c('0x43')]['sync'](this,_0x3c79a);return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xbf'),_0x3c79a['phone'],_0x3c79a[_0x920c('0x49')],_0x3c79a[_0x920c('0x4a')]));};AGIVertices[_0x920c('0x10')]['custom_app']=function(_0xe88a25){logger[_0x920c('0x2a')](util['format'](_0x920c('0xc0'),_0xe88a25[_0x920c('0x35')]));var _0x15c1e5=this[_0x920c('0x34')][_0x920c('0x57')](_0xe88a25[_0x920c('0xc1')],_0xe88a25[_0x920c('0x78')]);if(_0x15c1e5['result']===-0x1){return _0x15c1e5;}return this[_0x920c('0x34')]['noop'](util['format'](_0x920c('0xc2'),_0xe88a25[_0x920c('0xc1')],_0xe88a25[_0x920c('0x78')]));};AGIVertices[_0x920c('0x10')][_0x920c('0xc3')]=function(_0x52f950){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xc4'),_0x52f950[_0x920c('0x35')]));if(!this['isConfigured'](_0x52f950['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x3502a9='\x22'+_0x52f950[_0x920c('0x5b')]+'\x22';if(this[_0x920c('0xae')](_0x52f950['options'])){_0x3502a9+=','+_0x52f950[_0x920c('0x78')];}var _0x480c09=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xc5'),_0x3502a9);if(_0x480c09[_0x920c('0xa4')]===-0x1){return _0x480c09;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3502a9));};AGIVertices[_0x920c('0x10')][_0x920c('0xc6')]=function(_0x4ef6be){logger['info'](util['format'](_0x920c('0xc7'),_0x4ef6be[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x4ef6be[_0x920c('0x5b')])){return this['channel'][_0x920c('0xa9')](_0x920c('0xaa'));}var _0x32ceb0='\x22'+_0x4ef6be[_0x920c('0x5b')]+'\x22';if(this[_0x920c('0xae')](_0x4ef6be[_0x920c('0x78')])){_0x32ceb0+=','+_0x4ef6be[_0x920c('0x78')];}var _0x4add32=this['channel'][_0x920c('0x57')](_0x920c('0xc5'),_0x32ceb0);if(_0x4add32[_0x920c('0xa4')]===-0x1){return _0x4add32;}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xab'),_0x32ceb0));};AGIVertices[_0x920c('0x10')]['lumenvoxasr']=function(_0x20eebc){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xc8'),_0x20eebc[_0x920c('0x35')]));if(!this['isConfigured'](_0x20eebc[_0x920c('0xac')])){return this[_0x920c('0x34')]['noop']('no\x20grammar\x20configured');}var _0x314193=_0x20eebc[_0x920c('0xac')];if(this[_0x920c('0xae')](_0x20eebc[_0x920c('0x78')])){_0x314193+=','+_0x20eebc[_0x920c('0x78')];}var _0x2ee209=this['channel'][_0x920c('0x57')](_0x920c('0xaf'),_0x314193);if(_0x2ee209[_0x920c('0xa4')]===-0x1){return _0x2ee209;}var _0xf8011a=this[_0x920c('0xa3')]('RECOG_CONFIDENCE()',_0x920c('0xc9'));if(_0xf8011a[_0x920c('0xa4')]===-0x1){return _0xf8011a;}var _0x2387de=this[_0x920c('0xa3')](_0x920c('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2387de['result']===-0x1){return _0x2387de;}var _0x5f4914=this['getAndSetVariable'](_0x920c('0xca'),_0x920c('0xcb'));if(_0x5f4914['result']===-0x1){return _0x5f4914;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x314193));};AGIVertices[_0x920c('0x10')]['sestekasr']=function(_0x57e3ee){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xcc'),_0x57e3ee['label']));if(!this[_0x920c('0xae')](_0x57e3ee['grammar'])){return this['channel'][_0x920c('0xa9')](_0x920c('0xad'));}var _0x57e2a3=_0x57e3ee['grammar'];if(this['isConfigured'](_0x57e3ee['options'])){_0x57e2a3+=','+_0x57e3ee[_0x920c('0x78')];}var _0x1d2644=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xaf'),_0x57e2a3);if(_0x1d2644[_0x920c('0xa4')]===-0x1){return _0x1d2644;}var _0xba6511=this[_0x920c('0xa3')](_0x920c('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0xba6511[_0x920c('0xa4')]===-0x1){return _0xba6511;}var _0x3030c6=this[_0x920c('0xa3')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x3030c6['result']===-0x1){return _0x3030c6;}var _0x438d69=this[_0x920c('0xa3')]('RECOG_INSTANCE()',_0x920c('0xcd'));if(_0x438d69[_0x920c('0xa4')]===-0x1){return _0x438d69;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xb3'),_0x57e2a3));};AGIVertices[_0x920c('0x10')]['database']=function(_0x3ee6e2){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3ee6e2[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0xce')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,'no\x20database\x20selected');}var _0x526ce7=this[_0x920c('0x18')][_0x920c('0x6e')](this,_0x3ee6e2[_0x920c('0xce')]);if(!_0x526ce7){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,'no\x20odbc\x20database\x20found');}if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0x2c')])){return this['channel'][_0x920c('0x2f')](_0x3ee6e2,_0x920c('0xcf'));}var _0xe101b4=_0x3ee6e2[_0x920c('0x2c')][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xd1'),_0xe101b4));var _0x369fa9=this['getQueryOdbc'][_0x920c('0x6e')](this,_0x526ce7,_0xe101b4);this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x3ee6e2,_0xe101b4);if(!this[_0x920c('0xae')](_0x3ee6e2[_0x920c('0xd2')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xd3'));}var _0x37e2ca=this['getVariable'][_0x920c('0x6e')](this,_0x3ee6e2[_0x920c('0xd2')]);if(!_0x37e2ca){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x3ee6e2,_0x920c('0xd4'));}var _0x368a36=this;_0x369fa9[_0x920c('0xd5')](function(_0x5eacde,_0x4b9f1a){Object[_0x920c('0xd6')](_0x5eacde)[_0x920c('0xd5')](function(_0x278737){_0x368a36[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0xd7'),_0x37e2ca,_0x4b9f1a,_0x278737),_0x5eacde[_0x278737]);});});this['channel']['setVariable'](util[_0x920c('0x26')]('%s_ROWS_COUNT',_0x37e2ca),_0x369fa9[_0x920c('0x9d')]);return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0xd8'),_0x37e2ca));};AGIVertices['prototype'][_0x920c('0xd9')]=function(_0x35c1d4){logger[_0x920c('0xda')](util[_0x920c('0x26')](_0x920c('0xdb'),_0x35c1d4['label']));if(!this[_0x920c('0xae')](_0x35c1d4['sip_id'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x35c1d4,_0x920c('0xdc'));}var _0x27efa2=this[_0x920c('0x1b')][_0x920c('0x6e')](this,_0x35c1d4['sip_id']);if(!_0x27efa2){return this[_0x920c('0x34')]['error'](_0x35c1d4,_0x920c('0xdd'));}var _0x4d4096=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xde'),[util[_0x920c('0x26')](_0x920c('0xdf'),_0x27efa2),_0x35c1d4[_0x920c('0x64')],_0x35c1d4['opts'],_0x35c1d4[_0x920c('0x61')]]);if(_0x4d4096[_0x920c('0xa4')]===-0x1){return _0x4d4096;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe0'),_0x920c('0xde')));};AGIVertices['prototype'][_0x920c('0xe1')]=function(_0x35ab99){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0xe2'),_0x35ab99[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x35ab99[_0x920c('0x7a')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xe3'));}if(!this['isConfigured'](_0x35ab99['text'])){return this['channel'][_0x920c('0xa9')](_0x920c('0xaa'));}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x35ab99);this['createSquareMessage'](_0x35ab99[_0x920c('0x5b')],'in','','');this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe5'),_0x35ab99['text']));var _0xefd66=this['googleDialogflow'][_0x920c('0x6e')](this,_0x35ab99);if(_0xefd66){for(var _0x39bb70 in _0xefd66){if(_0xefd66[_0x920c('0x98')](_0x39bb70)){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0xe6'),_0x39bb70['toUpperCase']()),_0xefd66[_0x39bb70]);}}this[_0x920c('0x41')](_0xefd66['speech'],'out',_0x920c('0xe1'),'');return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe7'),_0xefd66['speech']));}return this[_0x920c('0x34')]['error'](_0x35ab99,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x920c('0x10')][_0x920c('0xe8')]=function(_0x14718a){logger['info'](util[_0x920c('0x26')](_0x920c('0xe9'),_0x14718a['label']));if(!this[_0x920c('0xae')](_0x14718a[_0x920c('0x7d')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xea'));}if(!this[_0x920c('0xae')](_0x14718a['client_email'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xeb'));}if(!this['isConfigured'](_0x14718a[_0x920c('0xec')])){return this['channel'][_0x920c('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x920c('0xae')](_0x14718a[_0x920c('0x7f')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xed'));}if(!this[_0x920c('0xae')](_0x14718a['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')]('no\x20text\x20configured');}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x14718a);this['createSquareMessage'](_0x14718a[_0x920c('0x5b')],'in','','');this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0xee'),_0x14718a['text']));var _0x6fbb84=this[_0x920c('0x7c')]['sync'](this,_0x14718a);if(_0x6fbb84){for(var _0x369c34 in _0x6fbb84){if(_0x6fbb84[_0x920c('0x98')](_0x369c34)){if(_0x369c34!==_0x920c('0xef')){this[_0x920c('0x34')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x369c34[_0x920c('0x68')]()),_0x6fbb84[_0x369c34]);}}}this[_0x920c('0x41')](_0x6fbb84[_0x920c('0xf0')],_0x920c('0xf1'),_0x920c('0xe8'),_0x6fbb84[_0x920c('0xef')]);return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xf2'),_0x6fbb84[_0x920c('0xf0')]));}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x14718a,_0x920c('0xf3'));};AGIVertices['prototype'][_0x920c('0xf4')]=function(_0x46038c){logger['info'](util['format'](_0x920c('0xf5'),_0x46038c[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x46038c[_0x920c('0xf6')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xf7'));}if(!this[_0x920c('0xae')](_0x46038c[_0x920c('0xf8')])){return this[_0x920c('0x34')]['noop'](_0x920c('0xf9'));}if(!this['isConfigured'](_0x46038c[_0x920c('0xfa')])){return this['channel'][_0x920c('0xa9')](_0x920c('0xfb'));}if(!this[_0x920c('0xae')](_0x46038c['ndassistant_url'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this['channel'][_0x920c('0xe4')]=!![];this[_0x920c('0x33')](_0x46038c);this[_0x920c('0x41')](_0x46038c[_0x920c('0x5b')],'in','','');this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xfc'),_0x46038c[_0x920c('0x5b')]));var _0x30f07e=this[_0x920c('0x80')][_0x920c('0x6e')](this,_0x46038c);if(_0x30f07e){for(var _0x11d203 in _0x30f07e){if(_0x30f07e['hasOwnProperty'](_0x11d203)){this['channel']['setVariable'](util[_0x920c('0x26')](_0x920c('0xfd'),_0x11d203[_0x920c('0x68')]()),_0x30f07e[_0x11d203]);}}this[_0x920c('0x41')](_0x30f07e[_0x920c('0xf0')],_0x920c('0xf1'),_0x920c('0xf4'),'');if(_0x30f07e['audiofile']){this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xfe'),_0x30f07e[_0x920c('0xff')]));var _0x39139b=this['channel']['streamFile'](_0x30f07e[_0x920c('0xff')]);try{fs[_0x920c('0x100')](_0x30f07e['audiofile']+_0x920c('0x101'));}catch(_0x1d8575){logger['error'](_0x1d8575);}return _0x39139b;}else{return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('SestekNDA\x20Result\x20%s',_0x30f07e[_0x920c('0xf0')]));}}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x46038c,_0x920c('0x102'));};AGIVertices[_0x920c('0x10')]['end']=function(_0x4f1e8d){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x4f1e8d[_0x920c('0x35')]));return this['channel']['noop'](_0x920c('0x103'));};AGIVertices[_0x920c('0x10')][_0x920c('0x104')]=function(_0x1a8b82){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x105'),_0x1a8b82['label']));var _0x1fbd1a='';if(_0x1a8b82[_0x920c('0x106')]){if(!this[_0x920c('0xae')](_0x1a8b82['trunk_id'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1a8b82,_0x920c('0x107'));}else{var _0x39b639=parseInt(_0x1a8b82[_0x920c('0x106')],0xa);if(isNaN(_0x39b639)){_0x1fbd1a=_0x1a8b82[_0x920c('0x106')];}else{_0x1fbd1a=this[_0x920c('0x1d')][_0x920c('0x6e')](this,_0x1a8b82[_0x920c('0x106')]);if(!_0x1fbd1a){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1a8b82,_0x920c('0x108'));}}}}else if(_0x1a8b82[_0x920c('0x109')]){_0x1fbd1a=_0x1a8b82[_0x920c('0x109')];}else{return this['channel'][_0x920c('0x2f')](_0x1a8b82,'no\x20trunk\x20selected');}var _0x368865=this[_0x920c('0x34')][_0x920c('0x57')](_0x920c('0xde'),[util[_0x920c('0x26')](_0x920c('0x10a'),_0x1fbd1a,_0x1a8b82[_0x920c('0x48')]),_0x1a8b82['timeout'],_0x1a8b82['opts'],_0x1a8b82[_0x920c('0x61')]]);if(_0x368865[_0x920c('0xa4')]===-0x1){return _0x368865;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xe0'),_0x920c('0xde')));};AGIVertices[_0x920c('0x10')][_0x920c('0x10b')]=function(_0x3bd7af){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x10c'),_0x3bd7af['label']));return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x10b'));};AGIVertices['prototype'][_0x920c('0x10d')]=function(_0x2d4031){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x10e'),_0x2d4031[_0x920c('0x35')]));if(_0x2d4031[_0x920c('0xa7')]===0x0){return this[_0x920c('0xa6')](_0x2d4031);}_0x2d4031[_0x920c('0xa7')]-=0x1;if(!this[_0x920c('0xae')](_0x2d4031[_0x920c('0x10f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d4031,'no\x20file\x20audio\x20selected');}var _0x45f256=this[_0x920c('0x110')][_0x920c('0x6e')](this,_0x2d4031['file_id']);if(!_0x45f256){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d4031,_0x920c('0x111'));}if(!this[_0x920c('0xae')](_0x2d4031[_0x920c('0xd2')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x920c('0xd3'));}var _0x5c0a98=this['channel']['getData'](_0x45f256,_0x2d4031[_0x920c('0x112')],_0x2d4031['maxdigit']);var _0x5ce41c=_0x5c0a98[_0x920c('0xa4')]?_0x5c0a98[_0x920c('0xa4')]['toString']():'';logger[_0x920c('0x2a')](_0x920c('0x113'),JSON['stringify'](_0x5c0a98));if(_0x5c0a98['result']===-0x1){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,_0x5ce41c);return _0x5c0a98;}else if(_0x5c0a98[_0x920c('0xa2')]===_0x920c('0x64')){_0x5c0a98['result']=_0x5ce41c[_0x920c('0x9d')]>=parseInt(_0x2d4031[_0x920c('0x114')])?'x':'i';}else{_0x5c0a98[_0x920c('0xa4')]=_0x5ce41c[_0x920c('0x9d')]>=parseInt(_0x2d4031[_0x920c('0x114')])&&_0x5ce41c[_0x920c('0x9d')]<=parseInt(_0x2d4031['maxdigit'])?'x':'i';}var _0x17acb0=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x2d4031[_0x920c('0xd2')]);if(!_0x17acb0){return this['channel'][_0x920c('0x2f')](_0x2d4031,_0x920c('0xd4'));}this['channel'][_0x920c('0x9e')](_0x17acb0,_0x5ce41c);if(this[_0x920c('0xae')](_0x2d4031[_0x920c('0x115')])){var _0x2d33a2=parseInt(_0x2d4031['hiddendigitsnum'],0xa);var _0x59be52=rs[_0x920c('0x116')]({'charset':'*','length':_0x2d33a2});var _0x28373c=_0x5ce41c[_0x920c('0x9d')];if(_0x28373c>0x0){if(_0x28373c>_0x2d33a2){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,_0x2d4031[_0x920c('0x117')]===_0x920c('0x118')?_0x59be52+_0x5ce41c[_0x920c('0x119')](_0x2d33a2):_0x5ce41c['substr'](0x0,_0x28373c-_0x2d33a2)+_0x59be52);}else{this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2d4031,rs['generate']({'charset':'*','length':_0x28373c}));}}else{this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x2d4031,'');}}else{this[_0x920c('0x33')]['sync'](this,_0x2d4031,_0x5ce41c);}return _0x5c0a98;};AGIVertices[_0x920c('0x10')]['getsecretdigits']=function(_0x19f935){logger['info'](util[_0x920c('0x26')](_0x920c('0x11a'),_0x19f935['label']));return this[_0x920c('0x10d')](_0x19f935);};AGIVertices[_0x920c('0x10')][_0x920c('0x11b')]=function(_0x2c6096){logger['info'](util['format'](_0x920c('0x11c'),_0x2c6096['label']));this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x2c6096,_0x2c6096['goalname']);return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x11d'),_0x2c6096[_0x920c('0x11e')]));};AGIVertices[_0x920c('0x10')][_0x920c('0x11f')]=function(_0x39a858){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x120'),_0x39a858[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x39a858[_0x920c('0x88')])||!this[_0x920c('0xae')](_0x39a858[_0x920c('0x89')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x121'));}if(!this[_0x920c('0xae')](_0x39a858[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x122'),_0x39a858['text']));var _0x588a61=this['awsPolly'][_0x920c('0x6e')](this,_0x39a858);if(_0x588a61){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x123'),_0x588a61));var _0x17b0fc=this[_0x920c('0x34')]['streamFile'](_0x588a61);try{fs[_0x920c('0x100')](_0x588a61+_0x920c('0x101'));}catch(_0x9e0ba0){logger[_0x920c('0x2f')](_0x9e0ba0);}return _0x17b0fc;}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x39a858,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x145a25){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x124'),_0x145a25[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x88')])||!this[_0x920c('0xae')](_0x145a25[_0x920c('0x89')])){return this['channel'][_0x920c('0xa9')](_0x920c('0x121'));}if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x8d')])){return this['channel'][_0x920c('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x920c('0xae')](_0x145a25[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xe4')]=!![];this['createSquareDetailsReport'](_0x145a25);this['createSquareMessage'](_0x145a25[_0x920c('0x5b')],'in','','');this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0x125'),_0x145a25[_0x920c('0x5b')]));var _0x140428=this[_0x920c('0x8b')][_0x920c('0x6e')](this,_0x145a25);if(_0x140428){for(var _0x47c581 in _0x140428){if(_0x140428[_0x920c('0x98')](_0x47c581)&&_['isString'](_0x140428[_0x47c581])){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x126'),_0x47c581[_0x920c('0x68')]()),_0x140428[_0x47c581]);}}if(_[_0x920c('0x45')](_0x140428[_0x920c('0x76')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x127'));}else{this['createSquareMessage'](_0x140428[_0x920c('0x76')],'out',_0x920c('0x128'),'');return this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x129'),_0x140428[_0x920c('0x76')]));}}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x145a25,_0x920c('0x12a'));};AGIVertices[_0x920c('0x10')]['googleasr']=function(_0x34e8ec){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x12b'),_0x34e8ec[_0x920c('0x35')],_0x34e8ec['timeout']));if(!this['isConfigured'](_0x34e8ec[_0x920c('0x7a')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4827cb=_0x920c('0x12c');var _0x5eab08=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs['generate'](0x4));var _0xce6dc7=util[_0x920c('0x26')]('%s.%s',_0x5eab08,_0x4827cb);var _0x78d19e=!![];if(_0x34e8ec[_0x920c('0x12e')]===_0x920c('0x12f')){_0x78d19e=![];}var _0x1b8b4b=this['channel'][_0x920c('0x130')](_0x5eab08,_0x4827cb,_0x34e8ec['intKey'],_0x34e8ec[_0x920c('0x64')],undefined,_0x78d19e);if(_0x1b8b4b['result']!==-0x1){this[_0x920c('0x34')][_0x920c('0xa9')](util['format']('google\x20%s\x20file\x20created',_0xce6dc7));var _0x4f67a0=this[_0x920c('0x8e')][_0x920c('0x6e')](this,_0x34e8ec,_0xce6dc7);if(_0x4f67a0){for(var _0x4a6a32 in _0x4f67a0){if(_0x4f67a0[_0x920c('0x98')](_0x4a6a32)){this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')]('GOOGLE_ASR_%s',_0x4a6a32['toUpperCase']()),_0x4f67a0[_0x4a6a32]);}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x131'),JSON[_0x920c('0x72')](_0x4f67a0)));}}return _0x1b8b4b;};AGIVertices['prototype'][_0x920c('0x132')]=function(_0x562916){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x562916['label']));if(!this[_0x920c('0xae')](_0x562916[_0x920c('0x91')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x133'));}if(!this[_0x920c('0xae')](_0x562916['appsecret'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x134'));}var _0x3807f2=_0x920c('0x12c');var _0x424717=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs[_0x920c('0x116')](0x4));var _0x58302d=util[_0x920c('0x26')](_0x920c('0x9c'),_0x424717,_0x3807f2);var _0x185009=!![];if(_0x562916[_0x920c('0x12e')]==='NOBEEP'){_0x185009=![];}var _0x526a20=this[_0x920c('0x34')][_0x920c('0x130')](_0x424717,_0x3807f2,_0x562916['intKey'],_0x562916['timeout'],undefined,_0x185009);if(_0x526a20[_0x920c('0xa4')]!==-0x1){this['channel'][_0x920c('0xa9')](util['format'](_0x920c('0x135'),_0x58302d));var _0xe324c9=this[_0x920c('0x90')]['sync'](this,_0x562916,_0x58302d);if(_0xe324c9){for(var _0x15ef36 in _0xe324c9){if(_0xe324c9[_0x920c('0x98')](_0x15ef36)){this['channel']['setVariable'](util['format'](_0x920c('0x136'),_0x15ef36[_0x920c('0x68')]()),_0xe324c9[_0x15ef36]);}}return this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x137'),JSON[_0x920c('0x72')](_0xe324c9)));}}return _0x526a20;};AGIVertices[_0x920c('0x10')][_0x920c('0x138')]=function(_0x30accb){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x30accb[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x139')](_0x30accb['context'],_0x30accb[_0x920c('0x3c')],_0x30accb['priority']);};AGIVertices[_0x920c('0x10')][_0x920c('0x13a')]=function(_0x383c8e){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x383c8e[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x383c8e[_0x920c('0x13b')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x383c8e,_0x920c('0x13c'));}try{var _0x461dee=eval(_0x383c8e[_0x920c('0x13b')])?'true':'false';this['channel']['noop'](util[_0x920c('0x26')]('EVAL\x20CONDITION\x20%s\x20%s',_0x383c8e[_0x920c('0x13b')],_0x461dee));return{'code':0xc8,'result':_0x461dee};}catch(_0x44e5de){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x920c('0x10')][_0x920c('0x13d')]=function(_0xd4a4db){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x13e'),_0xd4a4db['label']));if(!this[_0x920c('0xae')](_0xd4a4db[_0x920c('0x13f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0xd4a4db,'no\x20interval\x20configured');}var _0x557544=this[_0x920c('0x23')][_0x920c('0x6e')](this,_0xd4a4db['interval_id']);if(!_0x557544){return this['channel'][_0x920c('0x2f')](_0xd4a4db,_0x920c('0x140'));}for(var _0x482808=0x0;_0x482808<_0x557544['length'];_0x482808+=0x1){var _0x2f5123=this[_0x920c('0x34')][_0x920c('0x11')](util[_0x920c('0x26')](_0x920c('0x141'),_0x557544[_0x482808]));if(_0x2f5123[_0x920c('0xa4')]===-0x1){return _0x2f5123;}logger['info'](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x2f5123[_0x920c('0xa2')]));if(_0x2f5123['extra']===_0x920c('0x143')){logger[_0x920c('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x557544[_0x482808],_0x920c('0x143')));this[_0x920c('0x34')]['noop'](util['format'](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x143')));return{'code':0xc8,'result':_0x920c('0x143')};}else{logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x144')));this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x142'),_0x557544[_0x482808],_0x920c('0x144')));}}return{'code':0xc8,'result':_0x920c('0x144')};};AGIVertices['prototype'][_0x920c('0x145')]=function(_0x393140){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x393140['label']));return this[_0x920c('0x34')]['hangup']();};AGIVertices[_0x920c('0x10')][_0x920c('0x146')]=function(_0x161255){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x147'),_0x161255[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x161255[_0x920c('0x7a')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xe3'));}var _0x47d950=_0x920c('0x12c');var _0x17c339=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,rs[_0x920c('0x116')](0x4));var _0xbf3494=util[_0x920c('0x26')](_0x920c('0x9c'),_0x17c339,_0x47d950);var _0x1e8a71=!![];if(_0x161255[_0x920c('0x12e')]==='NOBEEP'){_0x1e8a71=![];}var _0x4982e7=this[_0x920c('0x34')]['recordFile'](_0x17c339,_0x47d950,_0x161255['intKey'],_0x161255[_0x920c('0x64')],undefined,_0x1e8a71);if(_0x4982e7['result']!==-0x1){this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x148'),_0xbf3494));var _0xf18f88=this['ispeechASR'][_0x920c('0x6e')](this,_0x161255,_0xbf3494);if(_0xf18f88){for(var _0x2ed093 in _0xf18f88){if(_0xf18f88[_0x920c('0x98')](_0x2ed093)){this['channel'][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x149'),_0x2ed093[_0x920c('0x68')]()),_0xf18f88[_0x2ed093]);}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x14a'),JSON[_0x920c('0x72')](_0xf18f88)));}}return _0x4982e7;};AGIVertices[_0x920c('0x10')][_0x920c('0x14b')]=function(_0x26b932){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x14c'),_0x26b932['label']));if(!this[_0x920c('0xae')](_0x26b932[_0x920c('0x7a')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xe3'));}if(!this['isConfigured'](_0x26b932[_0x920c('0x5b')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x14d'),_0x26b932[_0x920c('0x5b')]));var _0x4321ea=this[_0x920c('0x81')]['sync'](this,_0x26b932);if(_0x4321ea){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x148'),_0x4321ea));var _0x3af45b=this[_0x920c('0x34')][_0x920c('0x14e')](_0x4321ea,_0x26b932[_0x920c('0x14f')]);try{fs[_0x920c('0x100')](_0x4321ea+_0x920c('0x101'));}catch(_0x48a1ba){logger[_0x920c('0x2f')](_0x48a1ba);}return _0x3af45b;}return this[_0x920c('0x34')]['error'](_0x26b932,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x920c('0x10')][_0x920c('0x150')]=function(_0x511888){logger[_0x920c('0x2a')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x511888[_0x920c('0x35')]));if(!this['isConfigured'](_0x511888[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x511888,'no\x20find\x20by\x20configured');}logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x152'),this[_0x920c('0x34')]['callerid'],_0x511888[_0x920c('0x151')]));var _0x5a815d=this[_0x920c('0x53')][_0x920c('0x6e')](this,_0x511888[_0x920c('0x151')]);if(_0x5a815d){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')]['callerid'],_0x511888['findBy']));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x511888[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x511888[_0x920c('0x151')]));this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')]['callerid'],_0x511888[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')]['logout']=function(_0x7d3fbd){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x155'),_0x7d3fbd[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x7d3fbd['findBy'])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x7d3fbd,'no\x20find\x20by\x20configured');}logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x152'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));var _0x360826=this[_0x920c('0x52')][_0x920c('0x6e')](this,_0x7d3fbd[_0x920c('0x151')]);if(_0x360826){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util['format'](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd['findBy']));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x7d3fbd[_0x920c('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x920c('0x10')][_0x920c('0x158')]=function(_0x43c4fc){logger['info'](util[_0x920c('0x26')](_0x920c('0x159'),_0x43c4fc[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x43c4fc[_0x920c('0x15a')])){return this['channel'][_0x920c('0x2f')](_0x43c4fc,_0x920c('0x15b'));}this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('math\x20%s',_0x43c4fc[_0x920c('0x15a')]));var _0x4b8e2c=eval(_0x43c4fc[_0x920c('0x15a')]);if(!this[_0x920c('0xae')](_0x43c4fc['variable_id'])){return this['channel']['noop'](_0x920c('0xd3'));}var _0x3aa9a4=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x43c4fc[_0x920c('0xd2')]);if(!_0x3aa9a4){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x43c4fc,_0x920c('0xd4'));}if(_[_0x920c('0x99')](_0x4b8e2c)){var _0x337a67=this;_0x4b8e2c[_0x920c('0xd5')](function(_0x783079,_0x4233f3){_0x337a67['channel'][_0x920c('0x9e')](util[_0x920c('0x26')]('%s[%s]',_0x3aa9a4,_0x4233f3),_0x783079);});return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x15c'),_0x3aa9a4));}else{return this[_0x920c('0x34')][_0x920c('0x9e')](_0x3aa9a4,_0x4b8e2c);}};AGIVertices[_0x920c('0x10')][_0x920c('0xc')]=function(_0x1ad817){logger['info'](util['format'](_0x920c('0x15d'),_0x1ad817['label']));if(_0x1ad817[_0x920c('0xa7')]===0x0){return this[_0x920c('0xa6')](_0x1ad817);}_0x1ad817[_0x920c('0xa7')]-=0x1;if(!this['isConfigured'](_0x1ad817[_0x920c('0x10f')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1ad817,'no\x20file\x20audio\x20selected');}var _0x108ffd=this[_0x920c('0x110')]['sync'](this,_0x1ad817['file_id']);if(!_0x108ffd){return this[_0x920c('0x34')]['error'](_0x1ad817,_0x920c('0x111'));}var _0x1a0ba3=this['channel']['getData'](_0x108ffd,_0x1ad817[_0x920c('0x112')],_0x1ad817[_0x920c('0x15e')]);var _0x4aace8=_0x1a0ba3[_0x920c('0xa4')];if(_0x1a0ba3[_0x920c('0xa4')]===-0x1){this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x1ad817,'-1');return _0x1a0ba3;}else if(_0x1a0ba3[_0x920c('0xa2')]===_0x920c('0x64')){_0x1a0ba3[_0x920c('0xa4')]=_0x1a0ba3[_0x920c('0xa4')]['length']>0x0?_0x1a0ba3['result']:'t';}else if(_[_0x920c('0x44')](_0x1a0ba3[_0x920c('0xa4')])){_0x1a0ba3[_0x920c('0xa4')]='#';_0x4aace8='#';}if(!this[_0x920c('0xae')](_0x1ad817[_0x920c('0xd2')])){this['channel'][_0x920c('0xa9')](_0x920c('0xd3'));}else{var _0x56c7e1=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x1ad817[_0x920c('0xd2')]);if(!_0x56c7e1){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x1ad817,_0x920c('0xd4'));}this[_0x920c('0x34')]['setVariable'](_0x56c7e1,_0x4aace8);}this['createSquareDetailsReport']['sync'](this,_0x1ad817,_0x4aace8);return _0x1a0ba3;};AGIVertices['prototype'][_0x920c('0xa9')]=function(_0x2b56a0){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x15f'),_0x2b56a0[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0xa9')](_0x2b56a0[_0x920c('0x160')]||_0x2b56a0[_0x920c('0x35')]);};AGIVertices[_0x920c('0x10')][_0x920c('0x161')]=function(_0x47cde2){logger['info'](util[_0x920c('0x26')](_0x920c('0x162'),_0x47cde2[_0x920c('0x35')]));if(!this['isConfigured'](_0x47cde2[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x47cde2,_0x920c('0x163'));}logger[_0x920c('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));var _0x1a6396=this[_0x920c('0x4e')][_0x920c('0x6e')](this,_0x47cde2[_0x920c('0x164')]);var _0x16266f=this['agentPause'][_0x920c('0x6e')](this,_0x47cde2[_0x920c('0x151')],_0x1a6396);if(_0x16266f){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger['info'](util[_0x920c('0x26')](_0x920c('0x157'),this['channel'][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x156'),this['channel'][_0x920c('0x38')],_0x47cde2[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')]['playback']=function(_0x2b10d8){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x165'),_0x2b10d8[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x2b10d8['file_id'])){return this[_0x920c('0x34')]['error'](_0x2b10d8,'no\x20file\x20audio\x20selected');}var _0x3982aa=this[_0x920c('0x110')][_0x920c('0x6e')](this,_0x2b10d8['file_id']);if(!_0x3982aa){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2b10d8,_0x920c('0x111'));}var _0x27e2ed=this[_0x920c('0x34')]['exec'](_0x920c('0x166'),[_0x3982aa,_0x2b10d8[_0x920c('0x167')]]);if(_0x27e2ed[_0x920c('0xa4')]===-0x1){return _0x27e2ed;}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xc2'),_0x920c('0x166'),_0x3982aa));};AGIVertices[_0x920c('0x10')]['queue']=function(_0x25bad9){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x25bad9[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x25bad9[_0x920c('0x168')])){return this['channel']['error'](_0x25bad9,_0x920c('0x169'));}var _0x14a60b='';var _0x6979fa=parseInt(_0x25bad9[_0x920c('0x168')],0xa);if(isNaN(_0x6979fa)){_0x14a60b=_0x25bad9['queue_id'];}else{_0x14a60b=this['getVoiceQueue'][_0x920c('0x6e')](this,_0x25bad9['queue_id']);if(!_0x14a60b){return this[_0x920c('0x34')]['error'](_0x25bad9,'no\x20queue\x20found');}}var _0x526fc3='';if(this[_0x920c('0xae')](_0x25bad9[_0x920c('0x10f')])){var _0x187fbe=this['getSound']['sync'](this,_0x25bad9[_0x920c('0x10f')]);if(_0x187fbe){_0x526fc3=_0x187fbe;}}this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x25bad9,_0x14a60b);if(_0x25bad9[_0x920c('0x167')]['indexOf']('x')<0x0){_0x25bad9[_0x920c('0x167')]+='x';}if(_0x25bad9[_0x920c('0x167')]['indexOf']('X')<0x0){_0x25bad9[_0x920c('0x167')]+='X';}this[_0x920c('0x34')][_0x920c('0x9e')](_0x920c('0x16a'),_0x14a60b?_0x14a60b['toLowerCase']():'');var _0x1bc0ac=this['channel'][_0x920c('0x57')](_0x920c('0x16b'),[_0x14a60b,_0x25bad9[_0x920c('0x167')],_0x25bad9['url'],_0x526fc3,_0x25bad9[_0x920c('0x64')],_0x25bad9[_0x920c('0x8')],_0x25bad9[_0x920c('0x16c')],_0x25bad9[_0x920c('0x16d')],'',_0x25bad9[_0x920c('0x16e')]]);if(_0x1bc0ac[_0x920c('0xa4')]===-0x1){return _0x1bc0ac;}return this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xc2'),'QUEUE',_0x14a60b));};AGIVertices['prototype'][_0x920c('0x16f')]=function(_0x17c960){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x17c960[_0x920c('0x35')]));var _0x5792bb=_0x17c960[_0x920c('0x170')]||'wav';var _0x4ffee6=util[_0x920c('0x26')](_0x920c('0x171'),this[_0x920c('0x34')]['uniqueid'],rs[_0x920c('0x116')](0x5));var _0x31ca27=util[_0x920c('0x26')]('%s/recordings/%s.%s',FILES_PATH,_0x4ffee6,_0x5792bb);var _0x15d751=util[_0x920c('0x26')](_0x920c('0x12d'),FILES_PATH,_0x4ffee6);this[_0x920c('0x39')]['sync'](this,_0x17c960,_0x4ffee6,_0x31ca27);this['channel'][_0x920c('0x9e')](_0x920c('0x172'),_0x4ffee6);logger[_0x920c('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x15d751,_0x5792bb,_0x17c960[_0x920c('0x173')],_0x17c960[_0x920c('0x64')]);return this[_0x920c('0x34')][_0x920c('0x130')](_0x15d751,_0x5792bb,_0x17c960['escape_digits'],_0x17c960['timeout'],undefined,!![]);};AGIVertices[_0x920c('0x10')][_0x920c('0x174')]=function(_0x420fe7){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x175'),_0x420fe7[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x420fe7[_0x920c('0x61')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x176'));}var _0x279da2=this[_0x920c('0x60')][_0x920c('0x6e')](this,_0x420fe7);logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x177'),util[_0x920c('0x178')](_0x279da2,{'showHidden':![],'depth':null})));if(!this[_0x920c('0xae')](_0x420fe7[_0x920c('0xd2')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x179'));}var _0x3aee75=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x420fe7['variable_id']);if(!_0x3aee75){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x420fe7,_0x920c('0xd4'));}this[_0x920c('0x34')][_0x920c('0x9e')](util['format']('%s_STATUS_CODE',_0x3aee75),_0x279da2[_0x920c('0x74')]?_0x279da2['statusCode']:_0x920c('0x17a'));this[_0x920c('0x34')][_0x920c('0x9e')](util[_0x920c('0x26')](_0x920c('0x17b'),_0x3aee75),_0x279da2[_0x920c('0x75')]?_0x279da2['statusMessage']:'OK');if(_0x279da2[_0x920c('0x71')]){try{this['saveRestApiResult'](_0x279da2['body'],_0x3aee75);}catch(_0x44bd1d){logger[_0x920c('0x2f')](util['format'](_0x920c('0x17c'),_0x3aee75));}}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xd8'),_0x3aee75));};AGIVertices[_0x920c('0x10')][_0x920c('0x17d')]=function(_0x4295b7){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x17e'),_0x4295b7[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x17f')](_0x4295b7['digits']['replace'](/\s+/g,''),_0x4295b7['escape_digits']);};AGIVertices[_0x920c('0x10')][_0x920c('0x180')]=function(_0x4658c2){logger['info'](util[_0x920c('0x26')](_0x920c('0x181'),_0x4658c2['label']));return this['channel'][_0x920c('0x182')](_0x4658c2[_0x920c('0x63')][_0x920c('0xd0')](/\s+/g,''),_0x4658c2[_0x920c('0x173')]);};AGIVertices[_0x920c('0x10')][_0x920c('0x183')]=function(_0x5d2f51){logger['info'](util[_0x920c('0x26')](_0x920c('0x184'),_0x5d2f51[_0x920c('0x35')]));return this[_0x920c('0x34')][_0x920c('0x185')](_0x5d2f51['text'],_0x5d2f51[_0x920c('0x173')]);};AGIVertices['prototype'][_0x920c('0x186')]=function(_0x575418){logger['info'](util[_0x920c('0x26')](_0x920c('0x187'),_0x575418[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x575418[_0x920c('0x188')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x189'));}var _0x4ac47b=this[_0x920c('0x18a')][_0x920c('0x6e')](this,_0x575418[_0x920c('0x188')]);if(!_0x4ac47b||!_0x4ac47b[_0x920c('0x18b')]){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x575418,_0x920c('0x18c'));}var _0xca1e5={'from':util[_0x920c('0x26')]('\x22%s\x22\x20<%s>',_0x4ac47b[_0x920c('0x15')],_0x4ac47b[_0x920c('0x18d')]||_0x4ac47b[_0x920c('0x18b')][_0x920c('0x18e')]),'to':_0x575418['to']||'','cc':_0x575418['cc']||'','bcc':_0x575418[_0x920c('0x18f')]||'','subject':_0x575418[_0x920c('0x190')],'html':_0x575418['text'],'text':_0x575418[_0x920c('0x5b')]};var _0x5c0006={'tls':{'rejectUnauthorized':![]}};if(_0x4ac47b['Smtp'][_0x920c('0x191')]){_0x5c0006[_0x920c('0x191')]=_0x4ac47b[_0x920c('0x18b')]['service'];}else{_0x5c0006[_0x920c('0x192')]=_0x4ac47b[_0x920c('0x18b')][_0x920c('0x192')];_0x5c0006['port']=_0x4ac47b[_0x920c('0x18b')][_0x920c('0x193')];_0x5c0006['secure']=_0x4ac47b['Smtp'][_0x920c('0x194')];}if(_0x4ac47b[_0x920c('0x18b')]['authentication']){_0x5c0006[_0x920c('0x195')]={'user':_0x4ac47b[_0x920c('0x18b')]['user'],'pass':_0x4ac47b['Smtp'][_0x920c('0x196')]};}if(this[_0x920c('0xae')](_0x575418[_0x920c('0x197')])){}logger['debug'](_0x920c('0x198'),JSON[_0x920c('0x72')](_0xca1e5));this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x575418,_0x575418[_0x920c('0x188')]);this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x199'),_0x4ac47b[_0x920c('0x15')]));this['sendMailMessage']['sync'](this,_0x5c0006,_0xca1e5);return this['channel'][_0x920c('0xa9')](_0x920c('0x19a'));};AGIVertices['prototype'][_0x920c('0x19b')]=function(_0x349c9c){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x349c9c[_0x920c('0x35')]));return this['channel'][_0x920c('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x920c('0x19c')]=function(_0x32bb90){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x32bb90[_0x920c('0x35')]));if(!this['isConfigured'](_0x32bb90[_0x920c('0x19d')])){return this[_0x920c('0x34')][_0x920c('0xa9')]('no\x20sms\x20account\x20configured');}var _0x3e3af7=this['getSmsAccount'][_0x920c('0x6e')](this,_0x32bb90['sms_account_id']);if(!_0x3e3af7){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x32bb90,'no\x20sms\x20account\x20found');}var _0x19f008={'body':_0x32bb90[_0x920c('0x19e')],'phone':_0x32bb90['to']||'','SmsAccountId':_0x3e3af7['id']};logger[_0x920c('0xda')](_0x920c('0x19f'),JSON[_0x920c('0x72')](_0x19f008));this['createSquareDetailsReport'][_0x920c('0x6e')](this,_0x32bb90,_0x32bb90[_0x920c('0x19d')]);this[_0x920c('0x34')]['noop'](util[_0x920c('0x26')](_0x920c('0x1a0'),_0x3e3af7[_0x920c('0x15')]));this[_0x920c('0x32')][_0x920c('0x6e')](this,_0x19f008);return this[_0x920c('0x34')]['noop'](_0x920c('0x1a1'));};AGIVertices[_0x920c('0x10')][_0x920c('0x1a2')]=function(_0xb177d3){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x1a3'),_0xb177d3['label']));if(!this[_0x920c('0xae')](_0xb177d3[_0x920c('0xd2')])){return this['channel'][_0x920c('0x2f')](_0xb177d3,_0x920c('0x1a4'));}var _0x35760f=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0xb177d3['variable_id']);if(!_0x35760f){return this[_0x920c('0x34')][_0x920c('0x2f')](_0xb177d3,_0x920c('0xd4'));}return this[_0x920c('0x34')]['setVariable'](_0x35760f,_0xb177d3['variable_value']);};AGIVertices[_0x920c('0x10')]['start']=function(_0x4f30cd){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1a5'),_0x4f30cd[_0x920c('0x35')]));this[_0x920c('0x34')][_0x920c('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x4f30cd['answer']===_0x920c('0x1a6')){this['channel']['noop'](_0x920c('0x1a7'));return this[_0x920c('0x34')][_0x920c('0xb7')]();}return this['channel'][_0x920c('0xa9')](_0x920c('0x1a8'));};AGIVertices['prototype'][_0x920c('0x1a9')]=function(_0x5431f3){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1aa'),_0x5431f3[_0x920c('0x35')]));if(!this[_0x920c('0xae')](_0x5431f3[_0x920c('0x1ab')])){return this['channel'][_0x920c('0x2f')](_0x5431f3,_0x920c('0x1ac'));}var _0x1a9a50=this['getSquareProject'][_0x920c('0x6e')](this,_0x5431f3['project_id']);if(!this[_0x920c('0xae')](_0x1a9a50)){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x5431f3,util[_0x920c('0x26')](_0x920c('0x1ad'),_0x5431f3[_0x920c('0x1ab')]));}if(_0x1a9a50===this['channel']['arg_1']){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x5431f3,_0x920c('0x1ae'));}this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x5431f3,_0x1a9a50);var _0x53ae5c=this['channel'][_0x920c('0x57')](_0x920c('0x1af'),util['format'](_0x920c('0x1b0'),config[_0x920c('0x8')][_0x920c('0x192')]||_0x920c('0x1b1'),_0x1a9a50,this[_0x920c('0x34')][_0x920c('0x37')]));if(_0x53ae5c['result']===-0x1){return _0x53ae5c;}return this['channel']['noop'](util[_0x920c('0x26')](_0x920c('0xc2'),'AGI',_0x1a9a50));};AGIVertices[_0x920c('0x10')]['system']=function(_0x280413){logger['info'](util[_0x920c('0x26')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x280413['label']));var _0x494a63=this['shellCommand'][_0x920c('0x6e')](this,_0x280413['command']);this[_0x920c('0x33')][_0x920c('0x6e')](this,_0x280413,_0x280413['command']);if(this[_0x920c('0xae')](_0x280413[_0x920c('0xd2')])){var _0x1f6b11=this[_0x920c('0x11')][_0x920c('0x6e')](this,_0x280413['variable_id']);if(_0x1f6b11){this[_0x920c('0x34')][_0x920c('0x9e')](_0x1f6b11,_0x494a63);return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b2'),_0x280413['command'],_0x1f6b11));}}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b3'),_0x280413[_0x920c('0xb5')]));};AGIVertices[_0x920c('0x10')][_0x920c('0x1b4')]=function(_0x3ac5c6){logger[_0x920c('0x2a')](util[_0x920c('0x26')](_0x920c('0x1b5'),_0x3ac5c6['label']));_0x3ac5c6[_0x920c('0x5b')]=_0x3ac5c6['text'][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3ac5c6[_0x920c('0x59')])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0x1b6'));}if(!this[_0x920c('0xae')](_0x3ac5c6['text'])){return this[_0x920c('0x34')][_0x920c('0xa9')](_0x920c('0xaa'));}this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x1b7'),_0x3ac5c6['text']));var _0xba1ff9=this['googleCloudTTS'][_0x920c('0x6e')](this,_0x3ac5c6);if(_0xba1ff9){this['channel'][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0x1b8'),_0xba1ff9));var _0x16a30e=this[_0x920c('0x34')][_0x920c('0x14e')](_0xba1ff9);try{fs[_0x920c('0x100')](_0xba1ff9+_0x920c('0x101'));}catch(_0x1c453f){logger[_0x920c('0x2f')](_0x1c453f);}return _0x16a30e;}return this[_0x920c('0x34')]['error'](_0x3ac5c6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x920c('0x1b9')]=function(_0x9f2056){logger[_0x920c('0x2a')](util['format'](_0x920c('0x1ba'),_0x9f2056[_0x920c('0x35')]));_0x9f2056[_0x920c('0x5b')]=_0x9f2056[_0x920c('0x5b')][_0x920c('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x920c('0xae')](_0x9f2056[_0x920c('0x5b')])){return this['channel'][_0x920c('0xa9')]('no\x20text\x20configured');}this[_0x920c('0x34')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x9f2056[_0x920c('0x5b')]));var _0x406e46=this[_0x920c('0x5e')]['sync'](this,_0x9f2056);if(_0x406e46){this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x406e46));var _0x1c0715=this[_0x920c('0x34')][_0x920c('0x14e')](_0x406e46);try{fs[_0x920c('0x100')](_0x406e46+'.wav');}catch(_0x4cedee){logger[_0x920c('0x2f')](_0x4cedee);}return _0x1c0715;}return this[_0x920c('0x34')][_0x920c('0x2f')](_0x9f2056,_0x920c('0x1bb'));};AGIVertices[_0x920c('0x10')]['unpause']=function(_0x2d6e71){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2d6e71['label']));if(!this[_0x920c('0xae')](_0x2d6e71[_0x920c('0x151')])){return this[_0x920c('0x34')][_0x920c('0x2f')](_0x2d6e71,_0x920c('0x163'));}logger['info'](util[_0x920c('0x26')](_0x920c('0x152'),this['channel'][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));var _0x4b9bb7=this['agentUnpause'][_0x920c('0x6e')](this,_0x2d6e71[_0x920c('0x151')]);if(_0x4b9bb7){logger['info'](util[_0x920c('0x26')](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));this[_0x920c('0x34')][_0x920c('0xa9')](util['format'](_0x920c('0x156'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x153')};}else{logger[_0x920c('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));this['channel'][_0x920c('0xa9')](util['format'](_0x920c('0x157'),this[_0x920c('0x34')][_0x920c('0x38')],_0x2d6e71[_0x920c('0x151')]));return{'code':0xc8,'result':_0x920c('0x154')};}};AGIVertices[_0x920c('0x10')][_0x920c('0x1bc')]=function(_0x336c3c){logger['info'](util[_0x920c('0x26')](_0x920c('0x1bd'),_0x336c3c[_0x920c('0x35')]));var _0x1c2ddf=this['channel'][_0x920c('0x57')](_0x920c('0x1be'),[_0x336c3c[_0x920c('0x1bf')],_0x336c3c[_0x920c('0x78')]]);if(_0x1c2ddf[_0x920c('0xa4')]===-0x1){return _0x1c2ddf;}return this[_0x920c('0x34')][_0x920c('0xa9')](util[_0x920c('0x26')](_0x920c('0xc2'),_0x920c('0x1be'),_0x336c3c['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x2f3e40){logger[_0x920c('0x2a')](util[_0x920c('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2f3e40[_0x920c('0x35')]));if(!this['isConfigured'](_0x2f3e40[_0x920c('0xd2')])){return this['channel'][_0x920c('0x2f')](_0x2f3e40,_0x920c('0x1a4'));}var _0x2d61e8=this['getVariable'][_0x920c('0x6e')](this,_0x2f3e40[_0x920c('0xd2')]);if(!_0x2d61e8){return this[_0x920c('0x34')]['error'](_0x2f3e40,_0x920c('0xd4'));}var _0x9e407d=this[_0x920c('0x34')]['getVariable'](_0x2d61e8);return{'code':0xc8,'result':_0x9e407d[_0x920c('0xa2')]?_0x9e407d['extra']:'-'};};String[_0x920c('0x10')]['replaceAll']=function(_0x41009f,_0x385b9d){return this[_0x920c('0xa0')](_0x41009f)[_0x920c('0x1c0')](_0x385b9d);};module[_0x920c('0x1c1')]=AGIVertices; \ No newline at end of file +var _0x72e3=['isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%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','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','email','user','subject','service','host','port','secure','authentication','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','command','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','path','lodash','shelljs','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueueById','catch','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','channel','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','sync','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','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','out','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation'];(function(_0x264361,_0x270e38){var _0x29f8b7=function(_0x13ad8d){while(--_0x13ad8d){_0x264361['push'](_0x264361['shift']());}};_0x29f8b7(++_0x270e38);}(_0x72e3,0x6a));var _0x372e=function(_0x4cb9d9,_0x33d790){_0x4cb9d9=_0x4cb9d9-0x0;var _0x4d8331=_0x72e3[_0x4cb9d9];return _0x4d8331;};'use strict';var fs=require('fs');var path=require(_0x372e('0x0'));var util=require('util');var _=require(_0x372e('0x1'));var sh=require(_0x372e('0x2'));var odbc=require('odbc')();var rs=require(_0x372e('0x3'));var moment=require(_0x372e('0x4'));var Mustache=require('mustache');var rp=require(_0x372e('0x5'));var logger=require(_0x372e('0x6'))(_0x372e('0x7'));var config=require(_0x372e('0x8'));var scripts=require(_0x372e('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x372e('0xa')];var verticesWithRetry=[_0x372e('0xb'),_0x372e('0xc'),'getsecretdigits'];var AGIVertices=function(_0x13d30f,_0x2e6560,_0x11ce91){this['channel']=_0x13d30f;this[_0x372e('0xd')]=_0x2e6560;this[_0x372e('0xe')]=_0x11ce91;};AGIVertices[_0x372e('0xf')][_0x372e('0x10')]=function(_0x1e479e,_0x439028){this[_0x372e('0xd')][_0x372e('0x11')](_0x1e479e)[_0x372e('0x12')](function(_0x44d2c0){_0x439028(null,_0x44d2c0?_0x44d2c0[_0x372e('0x13')]:![]);})['catch'](function(_0x4d9db3){_0x439028(_0x4d9db3);});};AGIVertices[_0x372e('0xf')]['getVoiceQueue']=function(_0x5214fc,_0x21cbbf){this[_0x372e('0xd')][_0x372e('0x14')](_0x5214fc)['then'](function(_0x22bea8){_0x21cbbf(null,_0x22bea8?_0x22bea8[_0x372e('0x13')]:![]);})[_0x372e('0x15')](function(_0x72f4ab){_0x21cbbf(_0x72f4ab);});};AGIVertices[_0x372e('0xf')]['getSquareProject']=function(_0x2df7a5,_0x433d65){this[_0x372e('0xd')][_0x372e('0x16')](_0x2df7a5)[_0x372e('0x12')](function(_0x5df3d8){_0x433d65(null,_0x5df3d8?_0x5df3d8[_0x372e('0x13')]:![]);})[_0x372e('0x15')](function(_0x1e78d9){_0x433d65(_0x1e78d9);});};AGIVertices[_0x372e('0xf')]['getSquareOdbc']=function(_0x2a7bea,_0x4028ed){this[_0x372e('0xd')][_0x372e('0x17')](_0x2a7bea)[_0x372e('0x12')](function(_0x62f78){_0x4028ed(null,_0x62f78?_0x62f78[_0x372e('0x18')]:![]);})['catch'](function(_0x4e70d7){_0x4028ed(_0x4e70d7);});};AGIVertices[_0x372e('0xf')][_0x372e('0x19')]=function(_0xb3e2c8,_0x28e5df){this[_0x372e('0xd')][_0x372e('0x1a')](_0xb3e2c8)['then'](function(_0x330be6){_0x28e5df(null,_0x330be6?_0x330be6[_0x372e('0x13')]:![]);})[_0x372e('0x15')](function(_0x630a46){_0x28e5df(_0x630a46);});};AGIVertices[_0x372e('0xf')]['getTrunk']=function(_0x56ee86,_0x49a5b9){this[_0x372e('0xd')][_0x372e('0x1b')](_0x56ee86)[_0x372e('0x12')](function(_0x10b71f){_0x49a5b9(null,_0x10b71f?_0x10b71f[_0x372e('0x13')]:![]);})['catch'](function(_0x150020){_0x49a5b9(_0x150020);});};AGIVertices[_0x372e('0xf')][_0x372e('0x1c')]=function(_0x3da5a1,_0x40abee){var _0x4411e4=this;this['rpc'][_0x372e('0x1d')](_0x3da5a1)[_0x372e('0x12')](function(_0x31ae92){_0x40abee(null,_0x31ae92?_0x4411e4['getSoundPath'](_0x31ae92[_0x372e('0x1e')]):![]);})[_0x372e('0x15')](function(_0x232895){_0x40abee(_0x232895);});};AGIVertices['prototype'][_0x372e('0x1f')]=function(_0x492918,_0x5468f7){this[_0x372e('0xd')]['getMailAccountById'](_0x492918)[_0x372e('0x12')](function(_0x39f4d4){_0x5468f7(null,_0x39f4d4?_0x39f4d4:![]);})[_0x372e('0x15')](function(_0x5a3dda){_0x5468f7(_0x5a3dda);});};AGIVertices[_0x372e('0xf')][_0x372e('0x20')]=function(_0x20a66c,_0x2512ac,_0x4edfec){this[_0x372e('0xe')][_0x372e('0x20')](_0x20a66c,_0x2512ac)[_0x372e('0x12')](function(){_0x4edfec(null);})['catch'](function(_0x2cecac){_0x4edfec(_0x2cecac);});};AGIVertices[_0x372e('0xf')][_0x372e('0x21')]=function(_0x303f1f,_0x494e42){this[_0x372e('0xd')][_0x372e('0x22')](_0x303f1f)[_0x372e('0x12')](function(_0x169866){if(_0x169866){if(_0x169866[_0x372e('0x23')]){_0x494e42(null,[_0x169866['interval']]);}else{_0x494e42(null,_['map'](_0x169866[_0x372e('0x24')],_0x372e('0x25')));}}else{_0x494e42(null,![]);}})[_0x372e('0x15')](function(_0x5d1169){_0x494e42(_0x5d1169);});};AGIVertices[_0x372e('0xf')][_0x372e('0x26')]=function(_0x44eecb){return util[_0x372e('0x27')](_0x372e('0x28'),FILES_PATH,_0x44eecb);};AGIVertices['prototype']['getQueryOdbc']=function(_0x5b4a7d,_0xec2520,_0x42e187){odbc[_0x372e('0x29')](_0x5b4a7d,function(_0x1a9890){if(_0x1a9890){logger[_0x372e('0x2a')](_0x372e('0x2b'),_0x1a9890);_0x42e187(_0x1a9890);}else{logger[_0x372e('0x2c')](_0x372e('0x2d'));odbc[_0x372e('0x2e')](_0xec2520,function(_0x361c7d,_0x3bbf92){if(_0x361c7d){logger[_0x372e('0x2c')](_0x372e('0x2f'),_0xec2520);_0x42e187(_0x361c7d);}else{logger[_0x372e('0x2c')]('Query\x20executed\x20correctly\x20%s',_0xec2520);odbc['close'](function(_0x450095){if(_0x450095){logger[_0x372e('0x2a')](_0x372e('0x30'),_0x450095);}_0x42e187(null,_0x3bbf92);});}});}});};AGIVertices[_0x372e('0xf')][_0x372e('0x31')]=function(_0x4c9b48,_0x3086e0){this[_0x372e('0xd')][_0x372e('0x32')](_0x4c9b48)['then'](function(_0x2e3ce5){_0x3086e0(null,_0x2e3ce5?_0x2e3ce5:![]);})[_0x372e('0x15')](function(_0x2a1fc2){_0x3086e0(_0x2a1fc2);});};AGIVertices[_0x372e('0xf')][_0x372e('0x33')]=function(_0x4b606b,_0x128781){this[_0x372e('0xd')]['createSmsMessage'](_0x4b606b)[_0x372e('0x12')](function(_0x3586da){_0x128781(null,_0x3586da);})[_0x372e('0x15')](function(_0x2531bb){_0x128781(_0x2531bb);});};AGIVertices[_0x372e('0xf')][_0x372e('0x34')]=function(_0x2c2ae0,_0x97361f,_0x433ff2){this[_0x372e('0xd')][_0x372e('0x34')]({'uniqueid':this['channel'][_0x372e('0x35')],'node':_0x2c2ae0[_0x372e('0x36')],'application':_0x2c2ae0['agicommand'],'data':_0x97361f||null,'project_name':this[_0x372e('0x37')][_0x372e('0x38')],'callerid':this[_0x372e('0x37')][_0x372e('0x39')]})[_0x372e('0x12')](function(_0x4ed3ae){if(_0x433ff2){_0x433ff2(null,_0x4ed3ae);}})[_0x372e('0x15')](function(_0x2a96ec){if(_0x433ff2){_0x433ff2(_0x2a96ec);}});};AGIVertices[_0x372e('0xf')][_0x372e('0x3a')]=function(_0x15f8b3,_0x41ba59,_0x467b07,_0x17f157){this[_0x372e('0xd')][_0x372e('0x3a')]({'uniqueid':this[_0x372e('0x37')][_0x372e('0x35')],'callerid':this['channel']['callerid'],'calleridname':this[_0x372e('0x37')][_0x372e('0x3b')],'context':this[_0x372e('0x37')][_0x372e('0x3c')],'extension':this['channel']['extension'],'priority':this[_0x372e('0x37')][_0x372e('0x3d')],'accountcode':this['channel'][_0x372e('0x3e')],'dnid':this[_0x372e('0x37')][_0x372e('0x3f')],'projectName':this[_0x372e('0x37')][_0x372e('0x38')],'saveName':_0x41ba59,'filename':_0x15f8b3[_0x372e('0x40')]||_0x41ba59,'savePath':_0x467b07})[_0x372e('0x12')](function(_0x554ca9){_0x17f157(null,_0x554ca9);})[_0x372e('0x15')](function(_0x2dd0f5){_0x17f157(_0x2dd0f5);});};AGIVertices['prototype'][_0x372e('0x41')]=function(_0x238d47,_0x264888,_0x112efe,_0x516822,_0x232a82){this[_0x372e('0xd')]['createSquareMessage']({'uniqueid':this[_0x372e('0x37')][_0x372e('0x35')],'body':_0x238d47,'direction':_0x264888,'providerName':_0x112efe,'providerResponse':_0x516822})[_0x372e('0x12')](function(_0x1a3748){if(_0x232a82){_0x232a82(null,_0x1a3748);}})[_0x372e('0x15')](function(_0x5cdc3d){if(_0x232a82){_0x232a82(_0x5cdc3d);}});};AGIVertices[_0x372e('0xf')][_0x372e('0x42')]=function(_0x4d52dc,_0x22f8ab){this[_0x372e('0xd')]['createCmContact']({'firstName':_[_0x372e('0x43')](_0x4d52dc[_0x372e('0x13')])||_[_0x372e('0x44')](_0x4d52dc[_0x372e('0x13')])?'callback_'+Math[_0x372e('0x45')]():_0x4d52dc[_0x372e('0x13')],'lastName':_['isEmpty'](_0x4d52dc[_0x372e('0x46')])||_['isNil'](_0x4d52dc[_0x372e('0x46')])?null:_0x4d52dc[_0x372e('0x46')],'phone':_0x4d52dc[_0x372e('0x47')],'ListId':_0x4d52dc[_0x372e('0x48')],'scheduledat':_0x4d52dc[_0x372e('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x372e('0x4a'),'description':_0x372e('0x4b')+_0x4d52dc[_0x372e('0x49')][_0x372e('0x4c')](),'priority':_0x4d52dc[_0x372e('0x4d')]})[_0x372e('0x12')](function(_0x5bafd6){_0x22f8ab(null,_0x5bafd6);})[_0x372e('0x15')](function(_0x39c0d2){_0x22f8ab(_0x39c0d2);});};AGIVertices[_0x372e('0xf')][_0x372e('0x4e')]=function(_0x1c3cc9,_0x27c358){this[_0x372e('0xd')][_0x372e('0x4f')](_0x1c3cc9)['then'](function(_0x5dfaad){_0x27c358(null,_0x5dfaad?_0x5dfaad[_0x372e('0x13')]:![]);})[_0x372e('0x15')](function(_0x58df0b){_0x27c358(_0x58df0b);});};AGIVertices[_0x372e('0xf')][_0x372e('0x50')]=function(_0x1265fd,_0x22b6d7,_0x43fb22){var _0x5c4193={'role':_0x372e('0x51')};_0x5c4193[_0x1265fd]=this['channel']['callerid'];this[_0x372e('0xd')]['agentPause'](_0x5c4193,_0x22b6d7,this[_0x372e('0x37')]['uniqueid'])['then'](function(_0x37898d){_0x43fb22(null,_['isNil'](_0x37898d)?![]:!![]);})[_0x372e('0x15')](function(_0x8e4d01){logger['error'](_0x8e4d01);_0x43fb22(null,![]);});};AGIVertices[_0x372e('0xf')][_0x372e('0x52')]=function(_0x345492,_0x8d9a92){var _0x2cc23d={'role':'agent'};_0x2cc23d[_0x345492]=this[_0x372e('0x37')]['callerid'];this[_0x372e('0xd')][_0x372e('0x52')](_0x2cc23d)[_0x372e('0x12')](function(_0x5e5ceb){_0x8d9a92(null,_['isNil'](_0x5e5ceb)?![]:!![]);})[_0x372e('0x15')](function(_0x3f5cf){logger[_0x372e('0x2a')](_0x3f5cf);_0x8d9a92(null,![]);});};AGIVertices[_0x372e('0xf')][_0x372e('0x53')]=function(_0x3bc62e,_0x540b0d){var _0x3eb064={'role':_0x372e('0x51')};_0x3eb064[_0x3bc62e]=this[_0x372e('0x37')][_0x372e('0x39')];this[_0x372e('0xd')][_0x372e('0x53')](_0x3eb064)[_0x372e('0x12')](function(_0x75674a){_0x540b0d(null,_['isNil'](_0x75674a)?![]:!![]);})[_0x372e('0x15')](function(_0x147943){logger['error'](_0x147943);_0x540b0d(null,![]);});};AGIVertices[_0x372e('0xf')]['agentLogin']=function(_0x45088c,_0x4e809a){var _0x4ec05={'role':_0x372e('0x51')};_0x4ec05[_0x45088c]=this[_0x372e('0x37')][_0x372e('0x39')];var _0x1aa8fa=_0x45088c!='internal'?util[_0x372e('0x27')](_0x372e('0x54'),_0x372e('0x55'),this['channel']['callerid']):undefined;this['rpc']['agentLogin'](_0x4ec05,_0x1aa8fa)[_0x372e('0x12')](function(_0x2dd04c){_0x4e809a(null,_[_0x372e('0x44')](_0x2dd04c)?![]:!![]);})[_0x372e('0x15')](function(_0x380bcc){logger[_0x372e('0x2a')](_0x380bcc);_0x4e809a(null,![]);});};AGIVertices[_0x372e('0xf')][_0x372e('0x56')]=function(_0x3e146a,_0x49df83){sh[_0x372e('0x57')](_[_0x372e('0x58')](_0x3e146a),function(_0x3b2ad3,_0x2fdfe7){var _0x4422ef=_0x2fdfe7[_0x372e('0x59')](/(\r\n|\n|\r)/gm,'');_0x49df83(null,_0x4422ef);});};AGIVertices[_0x372e('0xf')][_0x372e('0x5a')]=function(_0x4ceccd,_0x454244){scripts[_0x372e('0x5a')](_0x4ceccd[_0x372e('0x5b')],_0x4ceccd['google_cloud_tts_text_type']||_0x372e('0x5c'),_0x4ceccd[_0x372e('0x5c')],_0x4ceccd[_0x372e('0x5d')]||'en-US',_0x4ceccd[_0x372e('0x5e')]||_0x372e('0x5f'),_0x4ceccd[_0x372e('0x60')]||_0x372e('0x61'))[_0x372e('0x12')](function(_0x393444){_0x454244(null,_0x393444);})[_0x372e('0x15')](function(_0x4f9ad8){_0x454244(_0x4f9ad8);});};AGIVertices[_0x372e('0xf')][_0x372e('0x62')]=function(_0x3d0da8,_0x5c5141){scripts[_0x372e('0x62')](_0x3d0da8[_0x372e('0x5c')],_0x3d0da8[_0x372e('0x63')]||'en',0x1)[_0x372e('0x12')](function(_0x230981){_0x5c5141(null,_0x230981);})[_0x372e('0x15')](function(_0x2b0b7b){_0x5c5141(_0x2b0b7b);});};AGIVertices['prototype']['restAPI']=function(_0x5f20f2,_0x1ba759){var _0x1309e6={'uri':_0x5f20f2[_0x372e('0x64')],'method':_0x5f20f2[_0x372e('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5f20f2[_0x372e('0x66')])===_0x372e('0x67')&&parseInt(_0x5f20f2[_0x372e('0x66')])>=0x1?parseInt(_0x5f20f2[_0x372e('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x372e('0x68')]([_0x372e('0x69'),'PUT'],_0x1309e6['method']['toUpperCase']())){try{_0x1309e6[_0x372e('0x6a')]=_0x5f20f2['rawBody']?JSON[_0x372e('0x6b')](_0x5f20f2[_0x372e('0xa')]):{};}catch(_0x2b73ef){logger['error'](_0x372e('0x6c'),_0x2b73ef);}}try{_0x1309e6[_0x372e('0x6d')]=_0x5f20f2[_0x372e('0x6e')]?JSON[_0x372e('0x6b')](_0x5f20f2[_0x372e('0x6e')]):{};}catch(_0x22bee3){logger[_0x372e('0x2a')](_0x372e('0x6f'),_0x22bee3);}if(_0x5f20f2[_0x372e('0x70')]){try{var _0x399694=require(_0x5f20f2[_0x372e('0x70')])['sync'](this,_0x1309e6);_0x1309e6['uri']=Mustache['render'](_0x5f20f2[_0x372e('0x64')],_0x399694,{},['$$','$$']);if(_0x1309e6[_0x372e('0x6d')]){_0x1309e6['headers']=JSON[_0x372e('0x6b')](Mustache[_0x372e('0x71')](JSON[_0x372e('0x72')](_0x1309e6['headers']),_0x399694,{},['$$','$$']));}if(_0x1309e6[_0x372e('0x6a')]){_0x1309e6[_0x372e('0x6a')]=JSON[_0x372e('0x6b')](Mustache['render'](JSON['stringify'](_0x1309e6[_0x372e('0x6a')]),_0x399694,{},['$$','$$']));}}catch(_0x41c734){logger[_0x372e('0x2a')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x41c734);}}rp(_0x1309e6)[_0x372e('0x12')](function(_0x13346a){var _0x1dc5c0={'statusCode':_0x13346a['statusCode']||0xc8,'statusMessage':_0x13346a['statusMessage']||'OK','headers':_0x13346a[_0x372e('0x6d')]||{},'body':_0x13346a['body']||{}};_0x1ba759(null,_0x1dc5c0);})[_0x372e('0x15')](function(_0x304e1e){var _0x5bfde8={'statusCode':_0x304e1e[_0x372e('0x73')]||0x1f4,'statusMessage':_0x304e1e[_0x372e('0x74')]||_0x372e('0x75'),'headers':_0x304e1e['options'][_0x372e('0x6d')]||{},'body':_0x304e1e[_0x372e('0x76')]['body']||{}};_0x1ba759(null,_0x5bfde8);});};AGIVertices[_0x372e('0xf')][_0x372e('0x77')]=function(_0x56922e,_0x2ab72f){scripts[_0x372e('0x77')](this[_0x372e('0x37')][_0x372e('0x35')],_0x56922e['key'],_0x56922e[_0x372e('0x5c')],_0x56922e[_0x372e('0x78')]||'en')[_0x372e('0x12')](function(_0x2ff477){_0x2ab72f(null,_0x2ff477);})[_0x372e('0x15')](function(_0x4b0c04){_0x2ab72f(_0x4b0c04);});};AGIVertices[_0x372e('0xf')][_0x372e('0x79')]=function(_0x53d79c,_0x1ccb28){scripts['googleDialogflowV2'](this[_0x372e('0x37')][_0x372e('0x35')],_0x53d79c[_0x372e('0x7a')],_0x53d79c[_0x372e('0x7b')],_0x53d79c['private_key'],_0x53d79c[_0x372e('0x5c')],_0x53d79c[_0x372e('0x7c')]||'en')[_0x372e('0x12')](function(_0x58b63c){_0x1ccb28(null,_0x58b63c);})[_0x372e('0x15')](function(_0x259532){_0x1ccb28(_0x259532);});};AGIVertices[_0x372e('0xf')][_0x372e('0x7d')]=function(_0x1fbee5,_0x198daf){scripts['sestekNDA'](this[_0x372e('0x37')],_0x1fbee5)[_0x372e('0x12')](function(_0x306be8){_0x198daf(null,_0x306be8);})[_0x372e('0x15')](function(_0x536a82){_0x198daf(_0x536a82);});};AGIVertices[_0x372e('0xf')][_0x372e('0x7e')]=function(_0x3fb241,_0x1b3072){scripts['ispeechTTS'](_0x3fb241[_0x372e('0x7f')],_0x3fb241[_0x372e('0x5c')],_0x3fb241[_0x372e('0x80')]||_0x372e('0x81'),_0x3fb241[_0x372e('0x82')])['then'](function(_0x35f503){_0x1b3072(null,_0x35f503);})[_0x372e('0x15')](function(_0x43954e){_0x1b3072(_0x43954e);});};AGIVertices[_0x372e('0xf')][_0x372e('0x83')]=function(_0x6c8589,_0x58fc3c,_0x36c9a2){scripts['ispeechASR'](_0x58fc3c,_0x6c8589[_0x372e('0x7f')],_0x6c8589[_0x372e('0x84')]||_0x372e('0x81'),this[_0x372e('0x85')](_0x6c8589['model'])?_0x6c8589['model']:undefined)[_0x372e('0x12')](function(_0x2d89fe){_0x36c9a2(null,_0x2d89fe);})[_0x372e('0x15')](function(_0x43a3f1){_0x36c9a2(_0x43a3f1);});};AGIVertices[_0x372e('0xf')][_0x372e('0x86')]=function(_0x23a089,_0x2f5ab2){scripts[_0x372e('0x86')](_0x23a089[_0x372e('0x87')],_0x23a089[_0x372e('0x88')],_0x23a089[_0x372e('0x89')],_0x23a089['aws_polly_voice']||_0x372e('0x8a'),_0x23a089['text'],_0x23a089['aws_text_type']||_0x372e('0x5c'))[_0x372e('0x12')](function(_0x552433){_0x2f5ab2(null,_0x552433);})[_0x372e('0x15')](function(_0x32daf8){_0x2f5ab2(_0x32daf8);});};AGIVertices[_0x372e('0xf')][_0x372e('0x8b')]=function(_0x4f2fa7,_0x54286c){scripts[_0x372e('0x8b')](this[_0x372e('0x37')]['uniqueid'],_0x4f2fa7[_0x372e('0x87')],_0x4f2fa7['aws_secret_access_key'],_0x4f2fa7[_0x372e('0x8c')],_0x4f2fa7[_0x372e('0x5c')],_0x4f2fa7[_0x372e('0x8d')])[_0x372e('0x12')](function(_0x1058a7){_0x54286c(null,_0x1058a7);})[_0x372e('0x15')](function(_0x683daf){_0x54286c(_0x683daf);});};AGIVertices[_0x372e('0xf')]['googleASR']=function(_0x56ae64,_0x21751d,_0x57ab8d){scripts[_0x372e('0x8e')](_0x21751d,_0x56ae64[_0x372e('0x7f')],_0x56ae64[_0x372e('0x8f')]||_0x372e('0x81'))[_0x372e('0x12')](function(_0x4f25fd){_0x57ab8d(null,_0x4f25fd);})['catch'](function(_0x1d414e){_0x57ab8d(_0x1d414e);});};AGIVertices[_0x372e('0xf')]['tildeASR']=function(_0x39387c,_0x160739,_0x423ec8){scripts[_0x372e('0x90')](_0x160739,_0x39387c[_0x372e('0x91')],_0x39387c['appsecret'],_0x39387c['uri'])['then'](function(_0x7f54ea){_0x423ec8(null,_0x7f54ea);})[_0x372e('0x15')](function(_0x2f4d02){_0x423ec8(_0x2f4d02);});};AGIVertices['prototype'][_0x372e('0x92')]=function(_0x32e23e){var _0x53c269=_[_0x372e('0x68')](verticesWithRetry,_0x32e23e[_0x372e('0x93')])?_0x32e23e:_[_0x372e('0x94')](_0x32e23e);for(var _0x55e10e in _0x53c269){if(_0x53c269[_0x372e('0x95')](_0x55e10e)){if(_0x53c269[_0x55e10e]&&_[_0x372e('0x96')](_0x53c269[_0x55e10e])){if(_['includes'](recursiveMapAttributes,_0x55e10e)){_0x53c269[_0x55e10e]=this[_0x372e('0x97')](_0x53c269[_0x55e10e]);}else{_0x53c269[_0x55e10e]=this[_0x372e('0x98')](_0x53c269[_0x55e10e]);}}}}return _0x53c269;};AGIVertices[_0x372e('0xf')]['recursiveNodeIndex']=function(_0x1a996e){for(var _0x53a23f in _0x1a996e){if(_0x1a996e[_0x372e('0x95')](_0x53a23f)){if(_[_0x372e('0x99')](_0x1a996e[_0x53a23f])){this[_0x372e('0x9a')](_0x1a996e[_0x53a23f]);}else if(_['isArray'](_0x1a996e[_0x53a23f])){for(var _0x4786a1=0x0;_0x4786a1<_0x1a996e[_0x53a23f][_0x372e('0x9b')];_0x4786a1++){this['recursiveNodeIndex'](_0x1a996e[_0x53a23f][_0x4786a1]);}}else if(_[_0x372e('0x96')](_0x1a996e[_0x53a23f])){_0x1a996e[_0x53a23f]=this[_0x372e('0x98')](_0x1a996e[_0x53a23f]);}}}};AGIVertices[_0x372e('0xf')][_0x372e('0x9c')]=function(_0x580e64,_0x22e93c){for(var _0x3186ab in _0x580e64){if(_0x580e64[_0x372e('0x95')](_0x3186ab)){if(_[_0x372e('0x99')](_0x580e64[_0x3186ab])){if(!_[_0x372e('0x43')](_0x580e64[_0x3186ab])){this['saveRestApiResult'](_0x580e64[_0x3186ab],util[_0x372e('0x27')]('%s.%s',_0x22e93c,_0x3186ab));}}else if(_['isArray'](_0x580e64[_0x3186ab])){for(var _0x372c5b=0x0;_0x372c5b<_0x580e64[_0x3186ab][_0x372e('0x9b')];_0x372c5b++){this['saveRestApiResult'](_0x580e64[_0x3186ab][_0x372c5b],util[_0x372e('0x27')](_0x372e('0x9d'),_0x22e93c,_0x3186ab+'['+_0x372c5b+']'));}}else{if(!_['isNil'](_0x580e64[_0x3186ab])){this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0x9d'),_0x22e93c,_0x3186ab),_0x580e64[_0x3186ab]);}}}}};AGIVertices[_0x372e('0xf')][_0x372e('0x97')]=function(_0xde4c01){try{var _0x15a903=JSON[_0x372e('0x6b')](_0xde4c01);this[_0x372e('0x9a')](_0x15a903);return JSON['stringify'](_0x15a903);}catch(_0x2a0230){return this[_0x372e('0x98')](_0xde4c01);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x51c9e1){var _0x455316=_0x51c9e1[_0x372e('0x9f')]('{');for(var _0x300312=0x1;_0x300312<_0x455316['length'];_0x300312+=0x1){var _0x1d9df9=_0x455316[_0x300312][_0x372e('0x9f')]('}');if(_0x1d9df9[_0x372e('0x9b')]>0x1){_0x51c9e1=_0x51c9e1[_0x372e('0xa0')]('{'+_0x1d9df9[0x0]+'}',this[_0x372e('0x37')][_0x372e('0x10')](_0x1d9df9[0x0])[_0x372e('0xa1')]||_0x1d9df9[0x0]);}}if(_0x455316[_0x372e('0x9b')]===0x1){return _0x51c9e1['toString']();}return this['replaceAllVariables'](_0x51c9e1);};AGIVertices['prototype'][_0x372e('0xa2')]=function(_0x43a756,_0x430082){var _0x2c5b89=this[_0x372e('0x37')][_0x372e('0x10')](_0x43a756);if(_0x2c5b89[_0x372e('0xa3')]===-0x1){return _0x2c5b89;}logger['info'](util[_0x372e('0x27')](_0x372e('0xa4'),_0x430082,_0x2c5b89[_0x372e('0xa1')]));return this[_0x372e('0x37')][_0x372e('0x9e')](_0x430082,_0x2c5b89[_0x372e('0xa1')]);};AGIVertices[_0x372e('0xf')]['isConfigured']=function(_0x5282bf){return _0x5282bf&&_0x5282bf!=='0'&&_0x5282bf!=='-1'&&_0x5282bf!=='';};AGIVertices[_0x372e('0xf')][_0x372e('0xa5')]=function(_0x1e7398){this[_0x372e('0x34')]['sync'](this,_0x1e7398,'-');_0x1e7398['retry']=_0x1e7398[_0x372e('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x372e('0xf')][_0x372e('0xa6')]=function(_0x3b5792){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xa7'),_0x3b5792[_0x372e('0x36')]));if(!this['isConfigured'](_0x3b5792[_0x372e('0x5c')])){return this['channel'][_0x372e('0xa8')](_0x372e('0xa9'));}var _0x1089db='\x22'+_0x3b5792[_0x372e('0x5c')]+'\x22';if(this[_0x372e('0x85')](_0x3b5792['options'])){_0x1089db+=','+_0x3b5792['options'];}var _0x2a4512=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0xaa'),_0x1089db);if(_0x2a4512[_0x372e('0xa3')]===-0x1){return _0x2a4512;}return this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0xab'),_0x1089db));};AGIVertices['prototype'][_0x372e('0xac')]=function(_0x257395){logger[_0x372e('0x2c')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x257395[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x257395[_0x372e('0xad')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xae'));}var _0x22961b=_0x257395['grammar'];if(this[_0x372e('0x85')](_0x257395[_0x372e('0x76')])){_0x22961b+=','+_0x257395['options'];}var _0x2d1d24=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0xaf'),_0x22961b);if(_0x2d1d24[_0x372e('0xa3')]===-0x1){return _0x2d1d24;}var _0xbf77f3=this[_0x372e('0xa2')](_0x372e('0xb0'),_0x372e('0xb1'));if(_0xbf77f3['result']===-0x1){return _0xbf77f3;}var _0x1cbfde=this[_0x372e('0xa2')](_0x372e('0xb2'),_0x372e('0xb3'));if(_0x1cbfde['result']===-0x1){return _0x1cbfde;}var _0x5e7fa8=this[_0x372e('0xa2')](_0x372e('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x5e7fa8[_0x372e('0xa3')]===-0x1){return _0x5e7fa8;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x22961b));};AGIVertices['prototype'][_0x372e('0x7')]=function(_0x284ac3){logger['info'](util[_0x372e('0x27')](_0x372e('0xb5'),_0x284ac3['label']));return this[_0x372e('0x37')]['agi']([_0x284ac3['command'],_0x284ac3[_0x372e('0xb6')]]);};AGIVertices[_0x372e('0xf')][_0x372e('0xb7')]=function(_0x5e5990){logger[_0x372e('0x2c')](util['format'](_0x372e('0xb8'),_0x5e5990[_0x372e('0x36')]));if(this[_0x372e('0x85')](_0x5e5990[_0x372e('0x66')])){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xb9'),_0x5e5990[_0x372e('0x66')]));var _0x47214e=this['channel'][_0x372e('0xba')](_0x5e5990[_0x372e('0x66')]);if(_0x47214e[_0x372e('0xa3')]===-0x1){return _0x47214e;}}return this['channel'][_0x372e('0xb7')]();};AGIVertices['prototype'][_0x372e('0x4a')]=function(_0x46259d){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xbb'),_0x46259d[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x46259d[_0x372e('0x48')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x46259d,_0x372e('0xbc'));}_0x46259d[_0x372e('0x49')]=moment();if(this[_0x372e('0x85')](_0x46259d[_0x372e('0xbd')])){_0x46259d[_0x372e('0x49')]=moment()[_0x372e('0xbe')](_0x46259d[_0x372e('0xbd')],_0x372e('0xbf'));}if(!this[_0x372e('0x85')](_0x46259d['callback_priority'])){_0x46259d[_0x372e('0x4d')]=0x2;}this[_0x372e('0x42')][_0x372e('0xc0')](this,_0x46259d);return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x46259d[_0x372e('0x47')],_0x46259d[_0x372e('0x48')],_0x46259d[_0x372e('0x49')]));};AGIVertices['prototype']['custom_app']=function(_0x360c3f){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xc1'),_0x360c3f[_0x372e('0x36')]));var _0xa5fdae=this['channel'][_0x372e('0x57')](_0x360c3f[_0x372e('0xc2')],_0x360c3f[_0x372e('0x76')]);if(_0xa5fdae[_0x372e('0xa3')]===-0x1){return _0xa5fdae;}return this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0xc3'),_0x360c3f['application'],_0x360c3f[_0x372e('0x76')]));};AGIVertices[_0x372e('0xf')]['lumenvoxtts']=function(_0x5cdd68){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xc4'),_0x5cdd68[_0x372e('0x36')]));if(!this['isConfigured'](_0x5cdd68[_0x372e('0x5c')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xa9'));}var _0xf556eb='\x22'+_0x5cdd68['text']+'\x22';if(this[_0x372e('0x85')](_0x5cdd68[_0x372e('0x76')])){_0xf556eb+=','+_0x5cdd68[_0x372e('0x76')];}var _0x491793=this[_0x372e('0x37')][_0x372e('0x57')]('MRCPSynth',_0xf556eb);if(_0x491793['result']===-0x1){return _0x491793;}return this[_0x372e('0x37')]['noop'](util['format'](_0x372e('0xab'),_0xf556eb));};AGIVertices[_0x372e('0xf')][_0x372e('0xc5')]=function(_0x2e763d){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xc6'),_0x2e763d[_0x372e('0x36')]));if(!this['isConfigured'](_0x2e763d[_0x372e('0x5c')])){return this['channel'][_0x372e('0xa8')](_0x372e('0xa9'));}var _0xdf8871='\x22'+_0x2e763d['text']+'\x22';if(this[_0x372e('0x85')](_0x2e763d['options'])){_0xdf8871+=','+_0x2e763d[_0x372e('0x76')];}var _0x52c7cb=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0xaa'),_0xdf8871);if(_0x52c7cb['result']===-0x1){return _0x52c7cb;}return this[_0x372e('0x37')]['noop'](util['format'](_0x372e('0xab'),_0xdf8871));};AGIVertices[_0x372e('0xf')][_0x372e('0xc7')]=function(_0x71f4f4){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xc8'),_0x71f4f4[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x71f4f4[_0x372e('0xad')])){return this[_0x372e('0x37')]['noop'](_0x372e('0xae'));}var _0x134412=_0x71f4f4[_0x372e('0xad')];if(this[_0x372e('0x85')](_0x71f4f4[_0x372e('0x76')])){_0x134412+=','+_0x71f4f4[_0x372e('0x76')];}var _0x567cd8=this[_0x372e('0x37')][_0x372e('0x57')]('MRCPRecog',_0x134412);if(_0x567cd8['result']===-0x1){return _0x567cd8;}var _0x17ad81=this[_0x372e('0xa2')](_0x372e('0xb0'),'LUMENVOX_ASR_CONFIDENCE');if(_0x17ad81['result']===-0x1){return _0x17ad81;}var _0x3ede41=this['getAndSetVariable'](_0x372e('0xb2'),_0x372e('0xc9'));if(_0x3ede41[_0x372e('0xa3')]===-0x1){return _0x3ede41;}var _0x1e7de6=this[_0x372e('0xa2')](_0x372e('0xb4'),'LUMENVOX_ASR_INSTANCE');if(_0x1e7de6[_0x372e('0xa3')]===-0x1){return _0x1e7de6;}return this['channel']['noop'](util[_0x372e('0x27')](_0x372e('0xca'),_0x134412));};AGIVertices['prototype'][_0x372e('0xcb')]=function(_0x2af5cf){logger[_0x372e('0x2c')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2af5cf[_0x372e('0x36')]));if(!this['isConfigured'](_0x2af5cf[_0x372e('0xad')])){return this[_0x372e('0x37')]['noop']('no\x20grammar\x20configured');}var _0x2c33ef=_0x2af5cf['grammar'];if(this[_0x372e('0x85')](_0x2af5cf[_0x372e('0x76')])){_0x2c33ef+=','+_0x2af5cf[_0x372e('0x76')];}var _0x2d6e5=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0xaf'),_0x2c33ef);if(_0x2d6e5[_0x372e('0xa3')]===-0x1){return _0x2d6e5;}var _0xb0744a=this[_0x372e('0xa2')](_0x372e('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0xb0744a[_0x372e('0xa3')]===-0x1){return _0xb0744a;}var _0x193171=this['getAndSetVariable'](_0x372e('0xb2'),_0x372e('0xcc'));if(_0x193171[_0x372e('0xa3')]===-0x1){return _0x193171;}var _0x163cfb=this['getAndSetVariable'](_0x372e('0xb4'),_0x372e('0xcd'));if(_0x163cfb[_0x372e('0xa3')]===-0x1){return _0x163cfb;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0xca'),_0x2c33ef));};AGIVertices[_0x372e('0xf')][_0x372e('0xce')]=function(_0xa6f58b){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0xcf'),_0xa6f58b[_0x372e('0x36')]));if(!this['isConfigured'](_0xa6f58b[_0x372e('0xd0')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xa6f58b,_0x372e('0xd1'));}var _0x163c21=this[_0x372e('0xd2')]['sync'](this,_0xa6f58b['odbc_id']);if(!_0x163c21){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xa6f58b,_0x372e('0xd3'));}if(!this[_0x372e('0x85')](_0xa6f58b[_0x372e('0x2e')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xa6f58b,_0x372e('0xd4'));}var _0x3f789b=_0xa6f58b[_0x372e('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0xd5'),_0x3f789b));var _0x3d77c3=this[_0x372e('0xd6')][_0x372e('0xc0')](this,_0x163c21,_0x3f789b);this[_0x372e('0x34')][_0x372e('0xc0')](this,_0xa6f58b,_0x3f789b);if(!this[_0x372e('0x85')](_0xa6f58b[_0x372e('0xd7')])){return this[_0x372e('0x37')]['noop'](_0x372e('0xd8'));}var _0x3550b5=this[_0x372e('0x10')][_0x372e('0xc0')](this,_0xa6f58b[_0x372e('0xd7')]);if(!_0x3550b5){return this[_0x372e('0x37')]['error'](_0xa6f58b,_0x372e('0xd9'));}var _0x54cda5=this;_0x3d77c3[_0x372e('0xda')](function(_0xc0e990,_0x4bb7b8){Object[_0x372e('0xdb')](_0xc0e990)[_0x372e('0xda')](function(_0xa7bfdf){_0x54cda5[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0xdc'),_0x3550b5,_0x4bb7b8,_0xa7bfdf),_0xc0e990[_0xa7bfdf]);});});this['channel'][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0xdd'),_0x3550b5),_0x3d77c3['length']);return this[_0x372e('0x37')]['noop'](util['format']('variable\x20%s\x20set',_0x3550b5));};AGIVertices[_0x372e('0xf')]['dial']=function(_0x61bf6f){logger[_0x372e('0xde')](util['format'](_0x372e('0xdf'),_0x61bf6f[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x61bf6f[_0x372e('0xe0')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x61bf6f,_0x372e('0xe1'));}var _0x391cb3=this[_0x372e('0x19')][_0x372e('0xc0')](this,_0x61bf6f['sip_id']);if(!_0x391cb3){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x61bf6f,_0x372e('0xe2'));}var _0x38aa50=this[_0x372e('0x37')][_0x372e('0x57')]('DIAL',[util['format'](_0x372e('0xe3'),_0x391cb3),_0x61bf6f[_0x372e('0x66')],_0x61bf6f[_0x372e('0xe4')],_0x61bf6f[_0x372e('0x64')]]);if(_0x38aa50['result']===-0x1){return _0x38aa50;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0xe5'),_0x372e('0xe6')));};AGIVertices[_0x372e('0xf')][_0x372e('0xe7')]=function(_0x22523a){logger[_0x372e('0x2c')](util['format'](_0x372e('0xe8'),_0x22523a[_0x372e('0x36')]));if(!this['isConfigured'](_0x22523a[_0x372e('0x7f')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xe9'));}if(!this[_0x372e('0x85')](_0x22523a['text'])){return this['channel'][_0x372e('0xa8')]('no\x20text\x20configured');}this[_0x372e('0x37')][_0x372e('0xea')]=!![];this[_0x372e('0x34')](_0x22523a);this[_0x372e('0x41')](_0x22523a['text'],'in','','');this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0xeb'),_0x22523a[_0x372e('0x5c')]));var _0x32ef46=this[_0x372e('0x77')]['sync'](this,_0x22523a);if(_0x32ef46){for(var _0x21079d in _0x32ef46){if(_0x32ef46[_0x372e('0x95')](_0x21079d)){this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')]('DIALOGFLOW_%s',_0x21079d[_0x372e('0xec')]()),_0x32ef46[_0x21079d]);}}this[_0x372e('0x41')](_0x32ef46['speech'],_0x372e('0xed'),'dialogflow','');return this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')]('Dialogflow\x20Result\x20%s',_0x32ef46[_0x372e('0xee')]));}return this[_0x372e('0x37')][_0x372e('0x2a')](_0x22523a,_0x372e('0xef'));};AGIVertices[_0x372e('0xf')][_0x372e('0xf0')]=function(_0x34c9cc){logger['info'](util[_0x372e('0x27')](_0x372e('0xf1'),_0x34c9cc[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x34c9cc[_0x372e('0x7a')])){return this[_0x372e('0x37')]['noop'](_0x372e('0xf2'));}if(!this[_0x372e('0x85')](_0x34c9cc[_0x372e('0x7b')])){return this[_0x372e('0x37')]['noop']('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x34c9cc['private_key'])){return this['channel'][_0x372e('0xa8')](_0x372e('0xf3'));}if(!this[_0x372e('0x85')](_0x34c9cc['dialogflowV2_language'])){return this[_0x372e('0x37')][_0x372e('0xa8')]('no\x20anguage\x20configured');}if(!this[_0x372e('0x85')](_0x34c9cc['text'])){return this[_0x372e('0x37')]['noop']('no\x20text\x20configured');}this['channel'][_0x372e('0xea')]=!![];this[_0x372e('0x34')](_0x34c9cc);this['createSquareMessage'](_0x34c9cc['text'],'in','','');this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0xf4'),_0x34c9cc[_0x372e('0x5c')]));var _0xe9f458=this[_0x372e('0x79')]['sync'](this,_0x34c9cc);if(_0xe9f458){for(var _0x5e4fbe in _0xe9f458){if(_0xe9f458[_0x372e('0x95')](_0x5e4fbe)){if(_0x5e4fbe!==_0x372e('0xf5')){this[_0x372e('0x37')][_0x372e('0x9e')](util['format'](_0x372e('0xf6'),_0x5e4fbe[_0x372e('0xec')]()),_0xe9f458[_0x5e4fbe]);}}}this[_0x372e('0x41')](_0xe9f458[_0x372e('0xee')],'out','dialogflowV2',_0xe9f458['providerResponse']);return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('DialogflowV2\x20Result\x20%s',_0xe9f458[_0x372e('0xee')]));}return this[_0x372e('0x37')]['error'](_0x34c9cc,_0x372e('0xf7'));};AGIVertices[_0x372e('0xf')][_0x372e('0xf8')]=function(_0x2fbc37){logger[_0x372e('0x2c')](util['format'](_0x372e('0xf9'),_0x2fbc37[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x2fbc37[_0x372e('0xfa')])){return this['channel'][_0x372e('0xa8')](_0x372e('0xfb'));}if(!this[_0x372e('0x85')](_0x2fbc37[_0x372e('0xfc')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xfd'));}if(!this[_0x372e('0x85')](_0x2fbc37[_0x372e('0xfe')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xff'));}if(!this['isConfigured'](_0x2fbc37['ndassistant_url'])){return this[_0x372e('0x37')][_0x372e('0xa8')]('no\x20text\x20configured');}this[_0x372e('0x37')][_0x372e('0xea')]=!![];this['createSquareDetailsReport'](_0x2fbc37);this[_0x372e('0x41')](_0x2fbc37[_0x372e('0x5c')],'in','','');this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Trying\x20SestekNDA:\x20%s',_0x2fbc37[_0x372e('0x5c')]));var _0x51743d=this[_0x372e('0x7d')][_0x372e('0xc0')](this,_0x2fbc37);if(_0x51743d){for(var _0x8107d4 in _0x51743d){if(_0x51743d[_0x372e('0x95')](_0x8107d4)){this[_0x372e('0x37')][_0x372e('0x9e')](util['format'](_0x372e('0x100'),_0x8107d4[_0x372e('0xec')]()),_0x51743d[_0x8107d4]);}}this['createSquareMessage'](_0x51743d[_0x372e('0xee')],_0x372e('0xed'),_0x372e('0xf8'),'');if(_0x51743d[_0x372e('0x101')]){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x51743d[_0x372e('0x101')]));var _0x3db40d=this[_0x372e('0x37')][_0x372e('0x102')](_0x51743d[_0x372e('0x101')]);try{fs[_0x372e('0x103')](_0x51743d[_0x372e('0x101')]+'.wav');}catch(_0x66d11b){logger['error'](_0x66d11b);}return _0x3db40d;}else{return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x104'),_0x51743d['speech']));}}return this[_0x372e('0x37')]['error'](_0x2fbc37,_0x372e('0x105'));};AGIVertices['prototype'][_0x372e('0x106')]=function(_0x29e084){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x107'),_0x29e084[_0x372e('0x36')]));return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x106'));};AGIVertices['prototype'][_0x372e('0x108')]=function(_0x49d9ca){logger[_0x372e('0x2c')](util['format'](_0x372e('0x109'),_0x49d9ca[_0x372e('0x36')]));var _0x4f3dd8='';if(_0x49d9ca['trunk_id']){if(!this['isConfigured'](_0x49d9ca[_0x372e('0x10a')])){return this[_0x372e('0x37')]['error'](_0x49d9ca,_0x372e('0x10b'));}else{var _0x1a7a73=parseInt(_0x49d9ca[_0x372e('0x10a')],0xa);if(isNaN(_0x1a7a73)){_0x4f3dd8=_0x49d9ca[_0x372e('0x10a')];}else{_0x4f3dd8=this[_0x372e('0x10c')]['sync'](this,_0x49d9ca[_0x372e('0x10a')]);if(!_0x4f3dd8){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x49d9ca,'no\x20trunk\x20found');}}}}else if(_0x49d9ca[_0x372e('0x10d')]){_0x4f3dd8=_0x49d9ca[_0x372e('0x10d')];}else{return this[_0x372e('0x37')][_0x372e('0x2a')](_0x49d9ca,'no\x20trunk\x20selected');}var _0x4e041a=this[_0x372e('0x37')][_0x372e('0x57')]('DIAL',[util['format'](_0x372e('0x10e'),_0x4f3dd8,_0x49d9ca['phone']),_0x49d9ca['timeout'],_0x49d9ca[_0x372e('0xe4')],_0x49d9ca[_0x372e('0x64')]]);if(_0x4e041a[_0x372e('0xa3')]===-0x1){return _0x4e041a;}return this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0xe5'),'DIAL'));};AGIVertices[_0x372e('0xf')]['finally']=function(_0x1a570c){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x10f'),_0x1a570c['label']));return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x110'));};AGIVertices[_0x372e('0xf')][_0x372e('0xc')]=function(_0x1385b5){logger['info'](util[_0x372e('0x27')](_0x372e('0x111'),_0x1385b5[_0x372e('0x36')]));if(_0x1385b5['retry']===0x0){return this['maxRetry'](_0x1385b5);}_0x1385b5[_0x372e('0x112')]-=0x1;if(!this['isConfigured'](_0x1385b5[_0x372e('0x113')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1385b5,'no\x20file\x20audio\x20selected');}var _0x58e954=this[_0x372e('0x1c')][_0x372e('0xc0')](this,_0x1385b5['file_id']);if(!_0x58e954){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1385b5,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x1385b5['variable_id'])){return this[_0x372e('0x37')][_0x372e('0x2a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x60b02f=this['channel'][_0x372e('0x114')](_0x58e954,_0x1385b5[_0x372e('0x115')],_0x1385b5[_0x372e('0x116')]);var _0xfb6be3=_0x60b02f[_0x372e('0xa3')]?_0x60b02f['result'][_0x372e('0x4c')]():'';logger[_0x372e('0x2c')](_0x372e('0x117'),JSON[_0x372e('0x72')](_0x60b02f));if(_0x60b02f[_0x372e('0xa3')]===-0x1){this[_0x372e('0x34')]['sync'](this,_0x1385b5,_0xfb6be3);return _0x60b02f;}else if(_0x60b02f[_0x372e('0xa1')]===_0x372e('0x66')){_0x60b02f['result']=_0xfb6be3[_0x372e('0x9b')]>=parseInt(_0x1385b5[_0x372e('0x118')])?'x':'i';}else{_0x60b02f['result']=_0xfb6be3[_0x372e('0x9b')]>=parseInt(_0x1385b5[_0x372e('0x118')])&&_0xfb6be3[_0x372e('0x9b')]<=parseInt(_0x1385b5[_0x372e('0x116')])?'x':'i';}var _0xdc0e11=this['getVariable']['sync'](this,_0x1385b5[_0x372e('0xd7')]);if(!_0xdc0e11){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1385b5,_0x372e('0xd9'));}this[_0x372e('0x37')]['setVariable'](_0xdc0e11,_0xfb6be3);if(this[_0x372e('0x85')](_0x1385b5[_0x372e('0x119')])){var _0x456f4a=parseInt(_0x1385b5['hiddendigitsnum'],0xa);var _0x529735=rs[_0x372e('0x11a')]({'charset':'*','length':_0x456f4a});var _0x152bd0=_0xfb6be3[_0x372e('0x9b')];if(_0x152bd0>0x0){if(_0x152bd0>_0x456f4a){this[_0x372e('0x34')]['sync'](this,_0x1385b5,_0x1385b5['hiddendigitspos']===_0x372e('0x11b')?_0x529735+_0xfb6be3[_0x372e('0x11c')](_0x456f4a):_0xfb6be3[_0x372e('0x11c')](0x0,_0x152bd0-_0x456f4a)+_0x529735);}else{this['createSquareDetailsReport'][_0x372e('0xc0')](this,_0x1385b5,rs['generate']({'charset':'*','length':_0x152bd0}));}}else{this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x1385b5,'');}}else{this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x1385b5,_0xfb6be3);}return _0x60b02f;};AGIVertices[_0x372e('0xf')][_0x372e('0x11d')]=function(_0x18f32d){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x11e'),_0x18f32d[_0x372e('0x36')]));return this[_0x372e('0xc')](_0x18f32d);};AGIVertices[_0x372e('0xf')][_0x372e('0x11f')]=function(_0x884830){logger[_0x372e('0x2c')](util['format'](_0x372e('0x120'),_0x884830['label']));this['createSquareDetailsReport']['sync'](this,_0x884830,_0x884830['goalname']);return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x121'),_0x884830['goalname']));};AGIVertices[_0x372e('0xf')][_0x372e('0x122')]=function(_0x1d3a8c){logger['info'](util[_0x372e('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1d3a8c[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x1d3a8c[_0x372e('0x87')])||!this[_0x372e('0x85')](_0x1d3a8c[_0x372e('0x88')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x123'));}if(!this[_0x372e('0x85')](_0x1d3a8c['text'])){return this[_0x372e('0x37')]['noop'](_0x372e('0xa9'));}this['channel']['noop'](util[_0x372e('0x27')](_0x372e('0x124'),_0x1d3a8c[_0x372e('0x5c')]));var _0x4cfe9a=this[_0x372e('0x86')][_0x372e('0xc0')](this,_0x1d3a8c);if(_0x4cfe9a){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x125'),_0x4cfe9a));var _0xca56f=this[_0x372e('0x37')][_0x372e('0x102')](_0x4cfe9a);try{fs[_0x372e('0x103')](_0x4cfe9a+'.wav');}catch(_0x83761d){logger[_0x372e('0x2a')](_0x83761d);}return _0xca56f;}return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1d3a8c,_0x372e('0x126'));};AGIVertices[_0x372e('0xf')][_0x372e('0x127')]=function(_0xd7719d){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x128'),_0xd7719d[_0x372e('0x36')]));if(!this['isConfigured'](_0xd7719d['aws_access_key_id'])||!this[_0x372e('0x85')](_0xd7719d['aws_secret_access_key'])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x123'));}if(!this[_0x372e('0x85')](_0xd7719d[_0x372e('0x8d')])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x372e('0x85')](_0xd7719d[_0x372e('0x5c')])){return this[_0x372e('0x37')][_0x372e('0xa8')]('no\x20text\x20configured');}this[_0x372e('0x37')]['bot']=!![];this[_0x372e('0x34')](_0xd7719d);this[_0x372e('0x41')](_0xd7719d[_0x372e('0x5c')],'in','','');this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0xd7719d[_0x372e('0x5c')]));var _0x3d4474=this['awsLex']['sync'](this,_0xd7719d);if(_0x3d4474){for(var _0x2be92c in _0x3d4474){if(_0x3d4474['hasOwnProperty'](_0x2be92c)&&_['isString'](_0x3d4474[_0x2be92c])){this[_0x372e('0x37')][_0x372e('0x9e')](util['format']('AWS_LEX_%s',_0x2be92c[_0x372e('0xec')]()),_0x3d4474[_0x2be92c]);}}if(_[_0x372e('0x44')](_0x3d4474['message'])){return this[_0x372e('0x37')][_0x372e('0xa8')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x372e('0x41')](_0x3d4474['message'],_0x372e('0xed'),_0x372e('0x129'),'');return this[_0x372e('0x37')]['noop'](util['format'](_0x372e('0x12a'),_0x3d4474[_0x372e('0x74')]));}}return this[_0x372e('0x37')][_0x372e('0x2a')](_0xd7719d,_0x372e('0x12b'));};AGIVertices[_0x372e('0xf')]['googleasr']=function(_0x571797){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x12c'),_0x571797[_0x372e('0x36')],_0x571797[_0x372e('0x66')]));if(!this['isConfigured'](_0x571797[_0x372e('0x7f')])){return this['channel']['noop'](_0x372e('0xe9'));}var _0x444531=_0x372e('0x12d');var _0x44efa0=util[_0x372e('0x27')](_0x372e('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x28e563=util[_0x372e('0x27')]('%s.%s',_0x44efa0,_0x444531);var _0x5d80a7=!![];if(_0x571797['beep']===_0x372e('0x12f')){_0x5d80a7=![];}var _0x57f78a=this[_0x372e('0x37')]['recordFile'](_0x44efa0,_0x444531,_0x571797['intKey'],_0x571797[_0x372e('0x66')],undefined,_0x5d80a7);if(_0x57f78a[_0x372e('0xa3')]!==-0x1){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x130'),_0x28e563));var _0x58b5c2=this[_0x372e('0x8e')][_0x372e('0xc0')](this,_0x571797,_0x28e563);if(_0x58b5c2){for(var _0x43421a in _0x58b5c2){if(_0x58b5c2[_0x372e('0x95')](_0x43421a)){this[_0x372e('0x37')]['setVariable'](util['format'](_0x372e('0x131'),_0x43421a[_0x372e('0xec')]()),_0x58b5c2[_0x43421a]);}}return this[_0x372e('0x37')][_0x372e('0xa8')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x372e('0x72')](_0x58b5c2)));}}return _0x57f78a;};AGIVertices[_0x372e('0xf')][_0x372e('0x132')]=function(_0x4f2866){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4f2866[_0x372e('0x36')]));if(!this['isConfigured'](_0x4f2866[_0x372e('0x91')])){return this['channel'][_0x372e('0xa8')](_0x372e('0x133'));}if(!this[_0x372e('0x85')](_0x4f2866[_0x372e('0x134')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x135'));}var _0x3c66e1=_0x372e('0x12d');var _0x2bf6b3=util[_0x372e('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x372e('0x11a')](0x4));var _0x12c52b=util[_0x372e('0x27')](_0x372e('0x9d'),_0x2bf6b3,_0x3c66e1);var _0x3de43a=!![];if(_0x4f2866[_0x372e('0x136')]==='NOBEEP'){_0x3de43a=![];}var _0x987f07=this[_0x372e('0x37')][_0x372e('0x137')](_0x2bf6b3,_0x3c66e1,_0x4f2866[_0x372e('0x138')],_0x4f2866[_0x372e('0x66')],undefined,_0x3de43a);if(_0x987f07['result']!==-0x1){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x139'),_0x12c52b));var _0x46ca47=this[_0x372e('0x90')][_0x372e('0xc0')](this,_0x4f2866,_0x12c52b);if(_0x46ca47){for(var _0xc0b8ac in _0x46ca47){if(_0x46ca47['hasOwnProperty'](_0xc0b8ac)){this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0x13a'),_0xc0b8ac['toUpperCase']()),_0x46ca47[_0xc0b8ac]);}}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x13b'),JSON[_0x372e('0x72')](_0x46ca47)));}}return _0x987f07;};AGIVertices[_0x372e('0xf')]['gotoc']=function(_0x3bcf4a){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x13c'),_0x3bcf4a[_0x372e('0x36')]));return this['channel']['continueAt'](_0x3bcf4a[_0x372e('0x3c')],_0x3bcf4a[_0x372e('0x13d')],_0x3bcf4a[_0x372e('0x3d')]);};AGIVertices[_0x372e('0xf')][_0x372e('0x13e')]=function(_0x5e1b32){logger['info'](util[_0x372e('0x27')](_0x372e('0x13f'),_0x5e1b32[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x5e1b32[_0x372e('0x140')])){return this[_0x372e('0x37')]['error'](_0x5e1b32,_0x372e('0x141'));}try{var _0x1714e6=eval(_0x5e1b32[_0x372e('0x140')])?_0x372e('0x142'):_0x372e('0x143');this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x144'),_0x5e1b32['condition'],_0x1714e6));return{'code':0xc8,'result':_0x1714e6};}catch(_0x17873d){return{'code':0xc8,'result':_0x372e('0x143')};}};AGIVertices['prototype'][_0x372e('0x145')]=function(_0x903672){logger['info'](util[_0x372e('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x903672[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x903672[_0x372e('0x146')])){return this['channel']['error'](_0x903672,_0x372e('0x147'));}var _0x5ee847=this[_0x372e('0x21')]['sync'](this,_0x903672[_0x372e('0x146')]);if(!_0x5ee847){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x903672,_0x372e('0x148'));}for(var _0x624bfc=0x0;_0x624bfc<_0x5ee847[_0x372e('0x9b')];_0x624bfc+=0x1){var _0x2924f7=this[_0x372e('0x37')][_0x372e('0x10')](util[_0x372e('0x27')](_0x372e('0x149'),_0x5ee847[_0x624bfc]));if(_0x2924f7[_0x372e('0xa3')]===-0x1){return _0x2924f7;}logger['info'](util[_0x372e('0x27')](_0x372e('0x14a'),_0x5ee847[_0x624bfc],_0x2924f7[_0x372e('0xa1')]));if(_0x2924f7[_0x372e('0xa1')]===_0x372e('0x142')){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('IFTIME\x20%s\x20%s',_0x5ee847[_0x624bfc],_0x372e('0x142')));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('IFTIME\x20%s\x20%s',_0x5ee847[_0x624bfc],_0x372e('0x142')));return{'code':0xc8,'result':'true'};}else{logger[_0x372e('0x2c')](util[_0x372e('0x27')]('IFTIME\x20%s\x20%s',_0x5ee847[_0x624bfc],_0x372e('0x143')));this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0x14a'),_0x5ee847[_0x624bfc],_0x372e('0x143')));}}return{'code':0xc8,'result':_0x372e('0x143')};};AGIVertices[_0x372e('0xf')][_0x372e('0x14b')]=function(_0x549a70){logger['info'](util[_0x372e('0x27')](_0x372e('0x14c'),_0x549a70['label']));return this['channel'][_0x372e('0x14b')]();};AGIVertices[_0x372e('0xf')]['ispeechasr']=function(_0x4be201){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x14d'),_0x4be201[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x4be201[_0x372e('0x7f')])){return this['channel'][_0x372e('0xa8')](_0x372e('0xe9'));}var _0x3a9c6c='wav';var _0x34af81=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4df1dd=util[_0x372e('0x27')]('%s.%s',_0x34af81,_0x3a9c6c);var _0x3f5fc6=!![];if(_0x4be201['beep']==='NOBEEP'){_0x3f5fc6=![];}var _0x403e52=this['channel']['recordFile'](_0x34af81,_0x3a9c6c,_0x4be201[_0x372e('0x138')],_0x4be201[_0x372e('0x66')],undefined,_0x3f5fc6);if(_0x403e52[_0x372e('0xa3')]!==-0x1){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x14e'),_0x4df1dd));var _0x5c2940=this[_0x372e('0x83')]['sync'](this,_0x4be201,_0x4df1dd);if(_0x5c2940){for(var _0x5a06d1 in _0x5c2940){if(_0x5c2940['hasOwnProperty'](_0x5a06d1)){this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0x14f'),_0x5a06d1[_0x372e('0xec')]()),_0x5c2940[_0x5a06d1]);}}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x150'),JSON[_0x372e('0x72')](_0x5c2940)));}}return _0x403e52;};AGIVertices[_0x372e('0xf')][_0x372e('0x151')]=function(_0x2fb857){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x152'),_0x2fb857[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x2fb857[_0x372e('0x7f')])){return this[_0x372e('0x37')][_0x372e('0xa8')]('no\x20key\x20configured');}if(!this[_0x372e('0x85')](_0x2fb857[_0x372e('0x5c')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xa9'));}this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')](_0x372e('0x153'),_0x2fb857[_0x372e('0x5c')]));var _0x2f177f=this['ispeechTTS'][_0x372e('0xc0')](this,_0x2fb857);if(_0x2f177f){this[_0x372e('0x37')][_0x372e('0xa8')](util['format'](_0x372e('0x14e'),_0x2f177f));var _0x2553a=this['channel']['streamFile'](_0x2f177f,_0x2fb857['intKey']);try{fs['unlink'](_0x2f177f+_0x372e('0x154'));}catch(_0x2ea710){logger[_0x372e('0x2a')](_0x2ea710);}return _0x2553a;}return this['channel'][_0x372e('0x2a')](_0x2fb857,_0x372e('0x155'));};AGIVertices[_0x372e('0xf')][_0x372e('0x156')]=function(_0x1905b6){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1905b6['label']));if(!this['isConfigured'](_0x1905b6[_0x372e('0x157')])){return this['channel'][_0x372e('0x2a')](_0x1905b6,_0x372e('0x158'));}logger[_0x372e('0x2c')](util['format'](_0x372e('0x159'),this[_0x372e('0x37')]['callerid'],_0x1905b6[_0x372e('0x157')]));var _0xaa5f5c=this[_0x372e('0x15a')][_0x372e('0xc0')](this,_0x1905b6[_0x372e('0x157')]);if(_0xaa5f5c){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x15b'),this[_0x372e('0x37')]['callerid'],_0x1905b6[_0x372e('0x157')]));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x372e('0x37')][_0x372e('0x39')],_0x1905b6[_0x372e('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x372e('0x27')](_0x372e('0x15c'),this[_0x372e('0x37')][_0x372e('0x39')],_0x1905b6[_0x372e('0x157')]));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x372e('0x37')][_0x372e('0x39')],_0x1905b6[_0x372e('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x372e('0x15d')]=function(_0x2e50e2){logger[_0x372e('0x2c')](util['format'](_0x372e('0x15e'),_0x2e50e2['label']));if(!this['isConfigured'](_0x2e50e2[_0x372e('0x157')])){return this['channel'][_0x372e('0x2a')](_0x2e50e2,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x372e('0x159'),this['channel'][_0x372e('0x39')],_0x2e50e2['findBy']));var _0x567c36=this[_0x372e('0x53')][_0x372e('0xc0')](this,_0x2e50e2[_0x372e('0x157')]);if(_0x567c36){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x15b'),this[_0x372e('0x37')][_0x372e('0x39')],_0x2e50e2[_0x372e('0x157')]));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x15b'),this['channel'][_0x372e('0x39')],_0x2e50e2[_0x372e('0x157')]));return{'code':0xc8,'result':_0x372e('0x15f')};}else{logger['info'](util[_0x372e('0x27')](_0x372e('0x15c'),this[_0x372e('0x37')][_0x372e('0x39')],_0x2e50e2[_0x372e('0x157')]));this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')](_0x372e('0x15c'),this[_0x372e('0x37')][_0x372e('0x39')],_0x2e50e2[_0x372e('0x157')]));return{'code':0xc8,'result':_0x372e('0x160')};}};AGIVertices['prototype'][_0x372e('0x161')]=function(_0x4b9b8a){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x162'),_0x4b9b8a['label']));if(!this[_0x372e('0x85')](_0x4b9b8a['operation'])){return this[_0x372e('0x37')]['error'](_0x4b9b8a,_0x372e('0x163'));}this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x164'),_0x4b9b8a[_0x372e('0x165')]));var _0x2a104e=eval(_0x4b9b8a[_0x372e('0x165')]);if(!this['isConfigured'](_0x4b9b8a[_0x372e('0xd7')])){return this[_0x372e('0x37')][_0x372e('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x40e77b=this['getVariable'][_0x372e('0xc0')](this,_0x4b9b8a[_0x372e('0xd7')]);if(!_0x40e77b){return this['channel']['error'](_0x4b9b8a,_0x372e('0xd9'));}if(_[_0x372e('0x166')](_0x2a104e)){var _0x33b2e1=this;_0x2a104e[_0x372e('0xda')](function(_0xf92f55,_0xa5aa76){_0x33b2e1[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0x167'),_0x40e77b,_0xa5aa76),_0xf92f55);});return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x168'),_0x40e77b));}else{return this[_0x372e('0x37')][_0x372e('0x9e')](_0x40e77b,_0x2a104e);}};AGIVertices[_0x372e('0xf')]['menu']=function(_0xdc03bd){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x169'),_0xdc03bd[_0x372e('0x36')]));if(_0xdc03bd[_0x372e('0x112')]===0x0){return this[_0x372e('0xa5')](_0xdc03bd);}_0xdc03bd[_0x372e('0x112')]-=0x1;if(!this['isConfigured'](_0xdc03bd['file_id'])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xdc03bd,'no\x20file\x20audio\x20selected');}var _0x1a66c1=this[_0x372e('0x1c')][_0x372e('0xc0')](this,_0xdc03bd['file_id']);if(!_0x1a66c1){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xdc03bd,'no\x20file\x20audio\x20found');}var _0x1958f8=this['channel'][_0x372e('0x114')](_0x1a66c1,_0xdc03bd[_0x372e('0x115')],_0xdc03bd[_0x372e('0x16a')]);var _0x2f7244=_0x1958f8[_0x372e('0xa3')];if(_0x1958f8[_0x372e('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0xdc03bd,'-1');return _0x1958f8;}else if(_0x1958f8[_0x372e('0xa1')]===_0x372e('0x66')){_0x1958f8[_0x372e('0xa3')]=_0x1958f8[_0x372e('0xa3')][_0x372e('0x9b')]>0x0?_0x1958f8['result']:'t';}else if(_[_0x372e('0x43')](_0x1958f8[_0x372e('0xa3')])){_0x1958f8[_0x372e('0xa3')]='#';_0x2f7244='#';}if(!this[_0x372e('0x85')](_0xdc03bd[_0x372e('0xd7')])){this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xd8'));}else{var _0x31bb75=this[_0x372e('0x10')][_0x372e('0xc0')](this,_0xdc03bd['variable_id']);if(!_0x31bb75){return this[_0x372e('0x37')][_0x372e('0x2a')](_0xdc03bd,'no\x20variable\x20found');}this['channel'][_0x372e('0x9e')](_0x31bb75,_0x2f7244);}this[_0x372e('0x34')][_0x372e('0xc0')](this,_0xdc03bd,_0x2f7244);return _0x1958f8;};AGIVertices[_0x372e('0xf')]['noop']=function(_0x2927e9){logger[_0x372e('0x2c')](util['format'](_0x372e('0x16b'),_0x2927e9[_0x372e('0x36')]));return this[_0x372e('0x37')][_0x372e('0xa8')](_0x2927e9[_0x372e('0x16c')]||_0x2927e9[_0x372e('0x36')]);};AGIVertices['prototype'][_0x372e('0x16d')]=function(_0xdc1088){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x16e'),_0xdc1088[_0x372e('0x36')]));if(!this['isConfigured'](_0xdc1088[_0x372e('0x157')])){return this['channel'][_0x372e('0x2a')](_0xdc1088,_0x372e('0x158'));}logger['info'](util[_0x372e('0x27')](_0x372e('0x159'),this[_0x372e('0x37')][_0x372e('0x39')],_0xdc1088['findBy']));var _0x1ba3c7=this[_0x372e('0x4e')][_0x372e('0xc0')](this,_0xdc1088[_0x372e('0x16f')]);var _0x57913f=this[_0x372e('0x50')][_0x372e('0xc0')](this,_0xdc1088[_0x372e('0x157')],_0x1ba3c7);if(_0x57913f){logger['info'](util[_0x372e('0x27')](_0x372e('0x15b'),this[_0x372e('0x37')][_0x372e('0x39')],_0xdc1088[_0x372e('0x157')]));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x15b'),this[_0x372e('0x37')][_0x372e('0x39')],_0xdc1088['findBy']));return{'code':0xc8,'result':_0x372e('0x15f')};}else{logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x15c'),this[_0x372e('0x37')][_0x372e('0x39')],_0xdc1088[_0x372e('0x157')]));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x372e('0x37')][_0x372e('0x39')],_0xdc1088[_0x372e('0x157')]));return{'code':0xc8,'result':_0x372e('0x160')};}};AGIVertices[_0x372e('0xf')][_0x372e('0x170')]=function(_0x27ceef){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x171'),_0x27ceef[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x27ceef['file_id'])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x27ceef,'no\x20file\x20audio\x20selected');}var _0x3e8f56=this['getSound']['sync'](this,_0x27ceef[_0x372e('0x113')]);if(!_0x3e8f56){return this['channel'][_0x372e('0x2a')](_0x27ceef,_0x372e('0x172'));}var _0x48cf8e=this['channel'][_0x372e('0x57')](_0x372e('0x173'),[_0x3e8f56,_0x27ceef[_0x372e('0xe4')]]);if(_0x48cf8e[_0x372e('0xa3')]===-0x1){return _0x48cf8e;}return this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x3e8f56));};AGIVertices[_0x372e('0xf')][_0x372e('0x174')]=function(_0x342742){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x342742[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x342742['queue_id'])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x342742,_0x372e('0x175'));}var _0x4f131c='';var _0x2aecd2=parseInt(_0x342742[_0x372e('0x176')],0xa);if(isNaN(_0x2aecd2)){_0x4f131c=_0x342742[_0x372e('0x176')];}else{_0x4f131c=this[_0x372e('0x177')][_0x372e('0xc0')](this,_0x342742[_0x372e('0x176')]);if(!_0x4f131c){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x342742,_0x372e('0x178'));}}var _0x251d12='';if(this[_0x372e('0x85')](_0x342742['file_id'])){var _0x24a47a=this[_0x372e('0x1c')][_0x372e('0xc0')](this,_0x342742[_0x372e('0x113')]);if(_0x24a47a){_0x251d12=_0x24a47a;}}this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x342742,_0x4f131c);if(_0x342742[_0x372e('0xe4')]['indexOf']('x')<0x0){_0x342742[_0x372e('0xe4')]+='x';}if(_0x342742[_0x372e('0xe4')][_0x372e('0x179')]('X')<0x0){_0x342742[_0x372e('0xe4')]+='X';}this[_0x372e('0x37')]['setVariable'](_0x372e('0x17a'),_0x4f131c?_0x4f131c[_0x372e('0x17b')]():'');var _0xfcbdf0=this['channel'][_0x372e('0x57')](_0x372e('0x17c'),[_0x4f131c,_0x342742[_0x372e('0xe4')],_0x342742[_0x372e('0x64')],_0x251d12,_0x342742[_0x372e('0x66')],_0x342742[_0x372e('0x7')],_0x342742['macro'],_0x342742['gosub'],'',_0x342742[_0x372e('0x17d')]]);if(_0xfcbdf0[_0x372e('0xa3')]===-0x1){return _0xfcbdf0;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Executed\x20command\x20%s\x20%s',_0x372e('0x17c'),_0x4f131c));};AGIVertices[_0x372e('0xf')]['record']=function(_0xb86317){logger['info'](util['format'](_0x372e('0x17e'),_0xb86317['label']));var _0x86dd63=_0xb86317[_0x372e('0x17f')]||_0x372e('0x12d');var _0x272a91=util['format']('%s_%s',this['channel'][_0x372e('0x35')],rs[_0x372e('0x11a')](0x5));var _0x3fb3e5=util['format'](_0x372e('0x180'),FILES_PATH,_0x272a91,_0x86dd63);var _0x14cc7d=util[_0x372e('0x27')]('%s/recordings/%s',FILES_PATH,_0x272a91);this[_0x372e('0x3a')]['sync'](this,_0xb86317,_0x272a91,_0x3fb3e5);this[_0x372e('0x37')][_0x372e('0x9e')](_0x372e('0x181'),_0x272a91);logger[_0x372e('0x2c')](_0x372e('0x182'),_0x14cc7d,_0x86dd63,_0xb86317['escape_digits'],_0xb86317[_0x372e('0x66')]);return this[_0x372e('0x37')][_0x372e('0x137')](_0x14cc7d,_0x86dd63,_0xb86317[_0x372e('0x183')],_0xb86317['timeout'],undefined,!![]);};AGIVertices[_0x372e('0xf')]['restapi']=function(_0x5f36f4){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x184'),_0x5f36f4[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x5f36f4['url'])){return this[_0x372e('0x37')]['noop'](_0x372e('0x185'));}var _0x2bb6d7=this['restAPI'][_0x372e('0xc0')](this,_0x5f36f4);logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x186'),util[_0x372e('0x187')](_0x2bb6d7,{'showHidden':![],'depth':null})));if(!this[_0x372e('0x85')](_0x5f36f4[_0x372e('0xd7')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x188'));}var _0x41fd5b=this['getVariable'][_0x372e('0xc0')](this,_0x5f36f4[_0x372e('0xd7')]);if(!_0x41fd5b){return this[_0x372e('0x37')]['error'](_0x5f36f4,_0x372e('0xd9'));}this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')](_0x372e('0x189'),_0x41fd5b),_0x2bb6d7[_0x372e('0x73')]?_0x2bb6d7['statusCode']:_0x372e('0x18a'));this[_0x372e('0x37')][_0x372e('0x9e')](util[_0x372e('0x27')]('%s_STATUS_MESSAGE',_0x41fd5b),_0x2bb6d7[_0x372e('0x18b')]?_0x2bb6d7[_0x372e('0x18b')]:'OK');if(_0x2bb6d7[_0x372e('0x6a')]){try{this[_0x372e('0x9c')](_0x2bb6d7[_0x372e('0x6a')],_0x41fd5b);}catch(_0x90ae63){logger[_0x372e('0x2a')](util[_0x372e('0x27')](_0x372e('0x18c'),_0x41fd5b));}}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x18d'),_0x41fd5b));};AGIVertices[_0x372e('0xf')][_0x372e('0x18e')]=function(_0x5d8f77){logger[_0x372e('0x2c')](util['format'](_0x372e('0x18f'),_0x5d8f77[_0x372e('0x36')]));return this[_0x372e('0x37')]['sayDigits'](_0x5d8f77['digits']['replace'](/\s+/g,''),_0x5d8f77[_0x372e('0x183')]);};AGIVertices[_0x372e('0xf')][_0x372e('0x190')]=function(_0x245474){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x191'),_0x245474[_0x372e('0x36')]));return this[_0x372e('0x37')][_0x372e('0x192')](_0x245474[_0x372e('0x67')][_0x372e('0x59')](/\s+/g,''),_0x245474[_0x372e('0x183')]);};AGIVertices['prototype']['sayphonetic']=function(_0x1ca17b){logger['info'](util['format'](_0x372e('0x193'),_0x1ca17b[_0x372e('0x36')]));return this['channel']['sayPhonetic'](_0x1ca17b[_0x372e('0x5c')],_0x1ca17b[_0x372e('0x183')]);};AGIVertices[_0x372e('0xf')][_0x372e('0x194')]=function(_0x4ff220){logger['info'](util['format'](_0x372e('0x195'),_0x4ff220['label']));if(!this[_0x372e('0x85')](_0x4ff220['account_id'])){return this[_0x372e('0x37')]['noop'](_0x372e('0x196'));}var _0x5c1947=this[_0x372e('0x1f')][_0x372e('0xc0')](this,_0x4ff220[_0x372e('0x197')]);if(!_0x5c1947||!_0x5c1947[_0x372e('0x198')]){return this['channel']['error'](_0x4ff220,'no\x20mail\x20account\x20found');}var _0x1c889f={'from':util[_0x372e('0x27')]('\x22%s\x22\x20<%s>',_0x5c1947[_0x372e('0x13')],_0x5c1947[_0x372e('0x199')]||_0x5c1947[_0x372e('0x198')][_0x372e('0x19a')]),'to':_0x4ff220['to']||'','cc':_0x4ff220['cc']||'','bcc':_0x4ff220['bcc']||'','subject':_0x4ff220[_0x372e('0x19b')],'html':_0x4ff220[_0x372e('0x5c')],'text':_0x4ff220[_0x372e('0x5c')]};var _0x4431c0={'tls':{'rejectUnauthorized':![]}};if(_0x5c1947[_0x372e('0x198')][_0x372e('0x19c')]){_0x4431c0[_0x372e('0x19c')]=_0x5c1947[_0x372e('0x198')]['service'];}else{_0x4431c0[_0x372e('0x19d')]=_0x5c1947[_0x372e('0x198')][_0x372e('0x19d')];_0x4431c0[_0x372e('0x19e')]=_0x5c1947[_0x372e('0x198')][_0x372e('0x19e')];_0x4431c0[_0x372e('0x19f')]=_0x5c1947[_0x372e('0x198')][_0x372e('0x19f')];}if(_0x5c1947[_0x372e('0x198')][_0x372e('0x1a0')]){_0x4431c0['auth']={'user':_0x5c1947['Smtp'][_0x372e('0x19a')],'pass':_0x5c1947[_0x372e('0x198')]['pass']};}if(this[_0x372e('0x85')](_0x4ff220[_0x372e('0x1a1')])){}logger[_0x372e('0xde')](_0x372e('0x1a2'),JSON[_0x372e('0x72')](_0x1c889f));this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x4ff220,_0x4ff220[_0x372e('0x197')]);this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x5c1947[_0x372e('0x13')]));this[_0x372e('0x20')]['sync'](this,_0x4431c0,_0x1c889f);return this[_0x372e('0x37')]['noop'](_0x372e('0x1a3'));};AGIVertices[_0x372e('0xf')][_0x372e('0x1a4')]=function(_0x48d4a4){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x48d4a4['label']));return this['channel'][_0x372e('0xa8')](_0x372e('0x1a5'));};AGIVertices[_0x372e('0xf')][_0x372e('0x1a6')]=function(_0x5c8846){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1a7'),_0x5c8846[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x5c8846['sms_account_id'])){return this[_0x372e('0x37')]['noop'](_0x372e('0x1a8'));}var _0x2e069d=this[_0x372e('0x31')]['sync'](this,_0x5c8846[_0x372e('0x1a9')]);if(!_0x2e069d){return this[_0x372e('0x37')]['error'](_0x5c8846,'no\x20sms\x20account\x20found');}var _0x8f863f={'body':_0x5c8846[_0x372e('0x1aa')],'phone':_0x5c8846['to']||'','SmsAccountId':_0x2e069d['id']};logger['debug']('sendSMS\x20message',JSON[_0x372e('0x72')](_0x8f863f));this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x5c8846,_0x5c8846[_0x372e('0x1a9')]);this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')](_0x372e('0x1ab'),_0x2e069d[_0x372e('0x13')]));this['createSmsMessage'][_0x372e('0xc0')](this,_0x8f863f);return this['channel'][_0x372e('0xa8')](_0x372e('0x1ac'));};AGIVertices[_0x372e('0xf')][_0x372e('0x1ad')]=function(_0x1427f0){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1ae'),_0x1427f0[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x1427f0[_0x372e('0xd7')])){return this['channel']['error'](_0x1427f0,_0x372e('0x1af'));}var _0x53a449=this['getVariable'][_0x372e('0xc0')](this,_0x1427f0[_0x372e('0xd7')]);if(!_0x53a449){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1427f0,_0x372e('0xd9'));}return this[_0x372e('0x37')][_0x372e('0x9e')](_0x53a449,_0x1427f0[_0x372e('0x1b0')]);};AGIVertices[_0x372e('0xf')][_0x372e('0x1b1')]=function(_0x18b165){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1b2'),_0x18b165[_0x372e('0x36')]));this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x1b3'));if(_0x18b165[_0x372e('0xb7')]===_0x372e('0x1b4')){this[_0x372e('0x37')]['noop'](_0x372e('0x1b5'));return this['channel'][_0x372e('0xb7')]();}return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0x1b6'));};AGIVertices[_0x372e('0xf')]['subproject']=function(_0x418eac){logger[_0x372e('0x2c')](util['format'](_0x372e('0x1b7'),_0x418eac['label']));if(!this[_0x372e('0x85')](_0x418eac['project_id'])){return this[_0x372e('0x37')]['error'](_0x418eac,'no\x20subproject\x20selected');}var _0x5a51d6=this[_0x372e('0x1b8')][_0x372e('0xc0')](this,_0x418eac[_0x372e('0x1b9')]);if(!this[_0x372e('0x85')](_0x5a51d6)){return this['channel'][_0x372e('0x2a')](_0x418eac,util[_0x372e('0x27')](_0x372e('0x1ba'),_0x418eac[_0x372e('0x1b9')]));}if(_0x5a51d6===this[_0x372e('0x37')][_0x372e('0x38')]){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x418eac,_0x372e('0x1bb'));}this['createSquareDetailsReport']['sync'](this,_0x418eac,_0x5a51d6);var _0x8e5694=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0x1bc'),util[_0x372e('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x372e('0x7')][_0x372e('0x19d')]||_0x372e('0x1bd'),_0x5a51d6,this['channel'][_0x372e('0x38')]));if(_0x8e5694[_0x372e('0xa3')]===-0x1){return _0x8e5694;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0xc3'),_0x372e('0x1bc'),_0x5a51d6));};AGIVertices[_0x372e('0xf')][_0x372e('0x1be')]=function(_0x47fa9d){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x47fa9d[_0x372e('0x36')]));var _0x4b6377=this[_0x372e('0x56')][_0x372e('0xc0')](this,_0x47fa9d[_0x372e('0x1bf')]);this[_0x372e('0x34')][_0x372e('0xc0')](this,_0x47fa9d,_0x47fa9d[_0x372e('0x1bf')]);if(this[_0x372e('0x85')](_0x47fa9d[_0x372e('0xd7')])){var _0x35001d=this['getVariable'][_0x372e('0xc0')](this,_0x47fa9d[_0x372e('0xd7')]);if(_0x35001d){this[_0x372e('0x37')][_0x372e('0x9e')](_0x35001d,_0x4b6377);return this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x47fa9d[_0x372e('0x1bf')],_0x35001d));}}return this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')](_0x372e('0x1c0'),_0x47fa9d['command']));};AGIVertices[_0x372e('0xf')]['google_cloud_tts']=function(_0x1dd343){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1c1'),_0x1dd343[_0x372e('0x36')]));_0x1dd343[_0x372e('0x5c')]=_0x1dd343[_0x372e('0x5c')][_0x372e('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x372e('0x85')](_0x1dd343[_0x372e('0x5b')])){return this['channel'][_0x372e('0xa8')](_0x372e('0x1c2'));}if(!this[_0x372e('0x85')](_0x1dd343[_0x372e('0x5c')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xa9'));}this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x1c3'),_0x1dd343[_0x372e('0x5c')]));var _0x8184db=this[_0x372e('0x5a')]['sync'](this,_0x1dd343);if(_0x8184db){this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x1c4'),_0x8184db));var _0xc3156a=this[_0x372e('0x37')][_0x372e('0x102')](_0x8184db);try{fs[_0x372e('0x103')](_0x8184db+_0x372e('0x154'));}catch(_0x2cc2ec){logger[_0x372e('0x2a')](_0x2cc2ec);}return _0xc3156a;}return this[_0x372e('0x37')][_0x372e('0x2a')](_0x1dd343,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x372e('0xf')][_0x372e('0x1c5')]=function(_0x2c13b6){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2c13b6[_0x372e('0x36')]));_0x2c13b6['text']=_0x2c13b6['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x372e('0x85')](_0x2c13b6[_0x372e('0x5c')])){return this[_0x372e('0x37')][_0x372e('0xa8')](_0x372e('0xa9'));}this[_0x372e('0x37')]['noop'](util[_0x372e('0x27')](_0x372e('0x1c6'),_0x2c13b6['text']));var _0x3a1666=this[_0x372e('0x62')]['sync'](this,_0x2c13b6);if(_0x3a1666){this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x3a1666));var _0x538657=this[_0x372e('0x37')][_0x372e('0x102')](_0x3a1666);try{fs[_0x372e('0x103')](_0x3a1666+_0x372e('0x154'));}catch(_0xd7f022){logger[_0x372e('0x2a')](_0xd7f022);}return _0x538657;}return this[_0x372e('0x37')][_0x372e('0x2a')](_0x2c13b6,_0x372e('0x1c7'));};AGIVertices[_0x372e('0xf')]['unpause']=function(_0x316e8e){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1c8'),_0x316e8e[_0x372e('0x36')]));if(!this['isConfigured'](_0x316e8e[_0x372e('0x157')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x316e8e,_0x372e('0x158'));}logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x159'),this['channel'][_0x372e('0x39')],_0x316e8e[_0x372e('0x157')]));var _0x3d4649=this[_0x372e('0x52')][_0x372e('0xc0')](this,_0x316e8e[_0x372e('0x157')]);if(_0x3d4649){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x15b'),this[_0x372e('0x37')][_0x372e('0x39')],_0x316e8e[_0x372e('0x157')]));this['channel'][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x15b'),this['channel'][_0x372e('0x39')],_0x316e8e['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x372e('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x372e('0x37')][_0x372e('0x39')],_0x316e8e['findBy']));this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')](_0x372e('0x15c'),this['channel'][_0x372e('0x39')],_0x316e8e[_0x372e('0x157')]));return{'code':0xc8,'result':_0x372e('0x160')};}};AGIVertices[_0x372e('0xf')][_0x372e('0x1c9')]=function(_0x173d01){logger[_0x372e('0x2c')](util[_0x372e('0x27')](_0x372e('0x1ca'),_0x173d01[_0x372e('0x36')]));var _0x3ef928=this[_0x372e('0x37')][_0x372e('0x57')](_0x372e('0x1cb'),[_0x173d01[_0x372e('0x1cc')],_0x173d01['options']]);if(_0x3ef928[_0x372e('0xa3')]===-0x1){return _0x3ef928;}return this[_0x372e('0x37')][_0x372e('0xa8')](util[_0x372e('0x27')]('Executed\x20command\x20%s\x20%s',_0x372e('0x1cb'),_0x173d01[_0x372e('0x1cc')]));};AGIVertices['prototype'][_0x372e('0x1cd')]=function(_0x5db508){logger[_0x372e('0x2c')](util[_0x372e('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5db508[_0x372e('0x36')]));if(!this[_0x372e('0x85')](_0x5db508[_0x372e('0xd7')])){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x5db508,'no\x20variable\x20selected');}var _0x2d3445=this[_0x372e('0x10')][_0x372e('0xc0')](this,_0x5db508[_0x372e('0xd7')]);if(!_0x2d3445){return this[_0x372e('0x37')][_0x372e('0x2a')](_0x5db508,'no\x20variable\x20found');}var _0xc33fa8=this[_0x372e('0x37')]['getVariable'](_0x2d3445);return{'code':0xc8,'result':_0xc33fa8[_0x372e('0xa1')]?_0xc33fa8[_0x372e('0xa1')]:'-'};};String[_0x372e('0xf')]['replaceAll']=function(_0xb99326,_0x623cbd){return this[_0x372e('0x9f')](_0xb99326)[_0x372e('0x1ce')](_0x623cbd);};module[_0x372e('0x1cf')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index ee1955c..5b35c2e 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 _0xb05e=['saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','message','queue','[%s][TIMER][STOP][AGENT:%s]'];(function(_0x1f62a2,_0x5d4af9){var _0x493672=function(_0x5a0441){while(--_0x5a0441){_0x1f62a2['push'](_0x1f62a2['shift']());}};_0x493672(++_0x5d4af9);}(_0xb05e,0x71));var _0xeb05=function(_0x49df50,_0x54c2e6){_0x49df50=_0x49df50-0x0;var _0x2419b0=_0xb05e[_0x49df50];return _0x2419b0;};'use strict';var util=require(_0xeb05('0x0'));var _=require(_0xeb05('0x1'));var moment=require(_0xeb05('0x2'));var ami=require('../ami');var logger=require('../../../config/logger')(_0xeb05('0x3'));var RpcUser=require(_0xeb05('0x4'));var RpcVoiceAgentReport=require(_0xeb05('0x5'));function Acw(_0x548823){this[_0xeb05('0x6')]=_0x548823[_0xeb05('0x6')];this[_0xeb05('0x7')]=_0x548823[_0xeb05('0x7')];this[_0xeb05('0x8')]=_0x548823['timers'];this[_0xeb05('0x9')]={};ami['on'](_0xeb05('0xa'),this[_0xeb05('0xb')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0xd'),this[_0xeb05('0xe')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0xf'),this['syncHangup'][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x10'),this[_0xeb05('0x11')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x12'),this[_0xeb05('0x13')][_0xeb05('0xc')](this));ami['on']('blindtransfer',this[_0xeb05('0x14')][_0xeb05('0xc')](this));ami['on'](_0xeb05('0x15'),this[_0xeb05('0x16')][_0xeb05('0xc')](this));}function getDiff(_0x46047e){var _0x47cc6d=moment()[_0xeb05('0x17')](0x0);var _0x5d4afa=moment(_0x46047e)[_0xeb05('0x17')](0x0);return _0x47cc6d['diff'](_0x5d4afa,'seconds');}Acw[_0xeb05('0x18')][_0xeb05('0x19')]=function(_0x24b3a0){try{var _0x191b8b=this;var _0x435efb=this[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x1a')];var _0x30276d=this[_0xeb05('0x9')][_0x24b3a0]['queue'];var _0x516aa9=this[_0xeb05('0x6')][_0x30276d];var _0x5789fe=![];var _0x98f705=_0xeb05('0x1b');if(_0x516aa9[_0xeb05('0x1c')]){if(_0x516aa9[_0xeb05('0x1d')][_0xeb05('0x1e')]){_0x5789fe=!![];_0x98f705=_0x516aa9[_0xeb05('0x1d')]['name'];}}ami['Action']({'action':_0xeb05('0x1f'),'interface':_0x435efb,'paused':!![],'reason':_0x98f705})[_0xeb05('0x20')](function(_0x5d39aa){if(_0x191b8b[_0xeb05('0x7')][_0x435efb]){return RpcUser[_0xeb05('0x21')](_0x191b8b[_0xeb05('0x7')][_0x435efb]['id'])[_0xeb05('0x20')](function(_0xb5cc77){if(_0xb5cc77&&!_0xb5cc77['voicePause']){logger[_0xeb05('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x24b3a0,_0x435efb,_0x30276d);var _0x1e0590=_0x191b8b[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x23')]&&_0x191b8b[_0xeb05('0x9')][_0x24b3a0]['destlinkedid']?_0x191b8b[_0xeb05('0x9')][_0x24b3a0][_0xeb05('0x24')]:_0x24b3a0;return RpcUser[_0xeb05('0x25')](_0x191b8b['agents'][_0x435efb],_0x98f705,_0x1e0590)[_0xeb05('0x20')](function(_0x84f536){if(!_0x5789fe){_0x191b8b['timers'][_0x435efb]={};logger['info'](_0xeb05('0x26'),_0x24b3a0,_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')],_0x435efb,_0x30276d);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]=setTimeout(_0x191b8b[_0xeb05('0x29')][_0xeb05('0xc')](_0x191b8b,_0x435efb),_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')]*0x3e8);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2a')]=moment()['format'](_0xeb05('0x2b'));_0x191b8b[_0xeb05('0x8')][_0x435efb]['uniqueid']=_0x24b3a0;_0x191b8b['timers'][_0x435efb]['queue']=_0x30276d;_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2c')]=function(){var _0xce29d4=getDiff(_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x2a')]);clearTimeout(_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]);_0x191b8b[_0xeb05('0x8')][_0x435efb][_0xeb05('0x28')]=![];RpcVoiceAgentReport[_0xeb05('0x2d')]({'acwtime':_0xce29d4},_0x191b8b['timers'][_0x435efb][_0xeb05('0x2e')],_0x435efb)[_0xeb05('0x20')](function(_0x5caf94){logger[_0xeb05('0x22')](_0xeb05('0x2f'),_0x24b3a0,_0xce29d4,_0x5caf94);})[_0xeb05('0x30')](function(_0x4cb47c){logger[_0xeb05('0x31')](_0xeb05('0x32'),_0x24b3a0,_0x4cb47c);});delete _0x191b8b[_0xeb05('0x8')][_0x435efb];};}});}else{logger[_0xeb05('0x22')](_0xeb05('0x33'),_0x24b3a0,_0x435efb,_0x30276d);}});}})[_0xeb05('0x30')](function(_0x138a1e){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x24b3a0,_0x191b8b[_0xeb05('0x6')][_0x30276d][_0xeb05('0x27')],_0x435efb,_0x30276d);})['finally'](function(){delete _0x191b8b[_0xeb05('0x9')][_0x24b3a0];});}catch(_0x13a7b3){logger[_0xeb05('0x31')]('[ACW][START]\x20%s',_0x13a7b3[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x29')]=function(_0xba7feb){try{var _0x2eb604=this;if(_0x2eb604['timers'][_0xba7feb]){_0x2eb604[_0xeb05('0x8')][_0xba7feb][_0xeb05('0x28')]=![];var _0x4b59c2=_0x2eb604[_0xeb05('0x8')][_0xba7feb]['uniqueid'];var _0x3810d8=_0x2eb604['timers'][_0xba7feb][_0xeb05('0x35')];var _0x182394=_0x2eb604[_0xeb05('0x6')][_0x3810d8][_0xeb05('0x27')];logger[_0xeb05('0x22')](_0xeb05('0x36'),_0x4b59c2,_0xba7feb);RpcUser[_0xeb05('0x37')](this['agents'][_0xba7feb]);RpcVoiceAgentReport[_0xeb05('0x2d')]({'acwtime':_0x182394,'agentacw':!![]},_0x4b59c2,_0xba7feb)[_0xeb05('0x20')](function(_0x337c29){logger[_0xeb05('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x4b59c2,_0x182394,_0x337c29);})[_0xeb05('0x30')](function(_0x1f7d07){logger[_0xeb05('0x31')](_0xeb05('0x32'),_0x4b59c2,_0x1f7d07);});}else{logger[_0xeb05('0x31')](_0xeb05('0x38'),_0xba7feb);if(_0x2eb604[_0xeb05('0x8')]){logger['info'](_0xeb05('0x39'),JSON[_0xeb05('0x3a')](_0x2eb604[_0xeb05('0x8')]));}}}catch(_0x163468){logger[_0xeb05('0x31')](_0xeb05('0x3b'),_0x163468[_0xeb05('0x34')]);}};Acw['prototype']['syncAgentConnect']=function(_0x1af6ef){try{if(this['voiceQueues'][_0x1af6ef['queue']]&&(this[_0xeb05('0x6')][_0x1af6ef[_0xeb05('0x35')]][_0xeb05('0x3')]||this[_0xeb05('0x6')][_0x1af6ef[_0xeb05('0x35')]][_0xeb05('0x1c')])){if(this[_0xeb05('0x7')][_0x1af6ef[_0xeb05('0x1a')]]){this[_0xeb05('0x9')][_0x1af6ef['uniqueid']]={'queue':_0x1af6ef['queue'],'interface':_0x1af6ef[_0xeb05('0x1a')],'destlinkedid':_0x1af6ef[_0xeb05('0x24')]};}}}catch(_0x441523){logger[_0xeb05('0x31')](_0xeb05('0x3c'),_0x441523[_0xeb05('0x34')]);}};Acw['prototype'][_0xeb05('0x16')]=function(_0x4e496f){try{if(this[_0xeb05('0x6')][_0x4e496f[_0xeb05('0x35')]]&&(this['voiceQueues'][_0x4e496f[_0xeb05('0x35')]][_0xeb05('0x3')]||this[_0xeb05('0x6')][_0x4e496f[_0xeb05('0x35')]][_0xeb05('0x1c')])){if(this['agents'][_0x4e496f[_0xeb05('0x1a')]]){this['channels'][_0x4e496f[_0xeb05('0x2e')]]={'queue':_0x4e496f[_0xeb05('0x35')],'interface':_0x4e496f[_0xeb05('0x1a')]};}}}catch(_0x10e901){logger[_0xeb05('0x31')](_0xeb05('0x3d'),_0x10e901[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0xe')]=function(_0x2eba96){try{if(this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x2e')]]&&_[_0xeb05('0x3e')](this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x2e')]]['attended'])){logger[_0xeb05('0x22')](_0xeb05('0x3f'),_0x2eba96['uniqueid']);this[_0xeb05('0x19')](_0x2eba96[_0xeb05('0x2e')]);}else if(this[_0xeb05('0x9')][_0x2eba96[_0xeb05('0x40')]]&&_[_0xeb05('0x3e')](this['channels'][_0x2eba96['linkedid']][_0xeb05('0x23')])){logger[_0xeb05('0x22')](_0xeb05('0x41'),_0x2eba96['linkedid']);this['startAcw'](_0x2eba96['linkedid']);}}catch(_0x37a666){logger[_0xeb05('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x37a666[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x42')]=function(_0x49c31){try{if(this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x2e')]]&&this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x2e')]][_0xeb05('0x23')]){logger['info'](_0xeb05('0x43'),_0x49c31[_0xeb05('0x2e')]);this['startAcw'](_0x49c31['uniqueid']);}else if(this[_0xeb05('0x9')][_0x49c31[_0xeb05('0x40')]]&&this[_0xeb05('0x9')][_0x49c31['linkedid']][_0xeb05('0x23')]){logger[_0xeb05('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x49c31['linkedid']);this[_0xeb05('0x19')](_0x49c31[_0xeb05('0x40')]);}}catch(_0x1940cb){logger[_0xeb05('0x31')]('[ACW][syncHangup]\x20%s',_0x1940cb[_0xeb05('0x34')]);}};Acw['prototype'][_0xeb05('0x13')]=function(_0x4b7f24){try{if(!_[_0xeb05('0x44')](this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x45')]])){this['startAcw'](_0x4b7f24['transfereeuniqueid']);if(this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]]){this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]]['attended']=!![];this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x47')]]=this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x46')]];delete this['channels'][_0x4b7f24['secondtransfereruniqueid']];}}else if(!_[_0xeb05('0x44')](this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x47')]])){this[_0xeb05('0x19')](_0x4b7f24[_0xeb05('0x47')]);if(this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]]){this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]]['attended']=!![];this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x45')]]=this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]];delete this[_0xeb05('0x9')][_0x4b7f24[_0xeb05('0x48')]];}}}catch(_0x16f0ad){logger['error'](_0xeb05('0x49'),_0x16f0ad[_0xeb05('0x34')]);}};Acw[_0xeb05('0x18')][_0xeb05('0x14')]=function(_0x1b381e){try{if(this['channels'][_0x1b381e['transfereruniqueid']]){logger[_0xeb05('0x22')](_0xeb05('0x4a'),JSON[_0xeb05('0x3a')](_0x1b381e['transfereruniqueid']));this['startAcw'](_0x1b381e[_0xeb05('0x4b')]);}else if(this['channels'][_0x1b381e[_0xeb05('0x4c')]]){logger[_0xeb05('0x22')](_0xeb05('0x4d'),JSON[_0xeb05('0x3a')](_0x1b381e[_0xeb05('0x4c')]));this[_0xeb05('0x19')](_0x1b381e[_0xeb05('0x4c')]);}}catch(_0x2260c8){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x2260c8[_0xeb05('0x34')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x111480){try{if(this[_0xeb05('0x6')][_0x111480['queue']]&&this[_0xeb05('0x6')][_0x111480[_0xeb05('0x35')]][_0xeb05('0x4e')]===_0xeb05('0x4f')){if(this[_0xeb05('0x7')][_0x111480[_0xeb05('0x1a')]]){logger[_0xeb05('0x22')](_0xeb05('0x50'),_0x111480[_0xeb05('0x2e')],_0x111480['interface'],_0x111480[_0xeb05('0x35')]);return RpcUser[_0xeb05('0x25')](this[_0xeb05('0x7')][_0x111480[_0xeb05('0x1a')]],_0xeb05('0x51'),_0x111480['uniqueid']);}}}catch(_0x2f9e33){logger['error'](_0xeb05('0x52'),_0x2f9e33[_0xeb05('0x34')]);}};module[_0xeb05('0x53')]=Acw; \ No newline at end of file +var _0xac2e=['[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','milliseconds','seconds','prototype','startAcw','channels','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','uniqueid','updateAcw','update','catch','error'];(function(_0x5aca5d,_0x3cb8a4){var _0x2d8b86=function(_0x20287c){while(--_0x20287c){_0x5aca5d['push'](_0x5aca5d['shift']());}};_0x2d8b86(++_0x3cb8a4);}(_0xac2e,0x122));var _0xeac2=function(_0x4a4a43,_0x115ccf){_0x4a4a43=_0x4a4a43-0x0;var _0x5893a6=_0xac2e[_0x4a4a43];return _0x5893a6;};'use strict';var util=require(_0xeac2('0x0'));var _=require(_0xeac2('0x1'));var moment=require(_0xeac2('0x2'));var ami=require(_0xeac2('0x3'));var logger=require('../../../config/logger')(_0xeac2('0x4'));var RpcUser=require(_0xeac2('0x5'));var RpcVoiceAgentReport=require(_0xeac2('0x6'));function Acw(_0x123c8c){this[_0xeac2('0x7')]=_0x123c8c[_0xeac2('0x7')];this[_0xeac2('0x8')]=_0x123c8c[_0xeac2('0x8')];this[_0xeac2('0x9')]=_0x123c8c['timers'];this['channels']={};ami['on'](_0xeac2('0xa'),this['syncAgentConnect'][_0xeac2('0xb')](this));ami['on'](_0xeac2('0xc'),this[_0xeac2('0xd')]['bind'](this));ami['on'](_0xeac2('0xe'),this[_0xeac2('0xf')][_0xeac2('0xb')](this));ami['on'](_0xeac2('0x10'),this[_0xeac2('0x11')][_0xeac2('0xb')](this));ami['on'](_0xeac2('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xeac2('0x13'),this['syncBlindTransfer'][_0xeac2('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xeac2('0xb')](this));}function getDiff(_0x366ba0){var _0x2f743d=moment()['milliseconds'](0x0);var _0x426e81=moment(_0x366ba0)[_0xeac2('0x14')](0x0);return _0x2f743d['diff'](_0x426e81,_0xeac2('0x15'));}Acw[_0xeac2('0x16')][_0xeac2('0x17')]=function(_0x103f1c){try{var _0x6ffff1=this;var _0x4470d5=this[_0xeac2('0x18')][_0x103f1c][_0xeac2('0x19')];var _0x3522f5=this['channels'][_0x103f1c][_0xeac2('0x1a')];var _0xf899b8=this['voiceQueues'][_0x3522f5];var _0x80a660=![];var _0x3bd7be='ACW';if(_0xf899b8[_0xeac2('0x1b')]){if(_0xf899b8['mandatoryDispositionPause'][_0xeac2('0x1c')]){_0x80a660=!![];_0x3bd7be=_0xf899b8[_0xeac2('0x1d')][_0xeac2('0x1c')];}}ami['Action']({'action':_0xeac2('0x1e'),'interface':_0x4470d5,'paused':!![],'reason':_0x3bd7be})[_0xeac2('0x1f')](function(_0x2e835b){if(_0x6ffff1['agents'][_0x4470d5]){return RpcUser['getAgent'](_0x6ffff1[_0xeac2('0x8')][_0x4470d5]['id'])[_0xeac2('0x1f')](function(_0x5e6fc2){if(_0x5e6fc2&&!_0x5e6fc2[_0xeac2('0x20')]){logger[_0xeac2('0x21')](_0xeac2('0x22'),_0x103f1c,_0x4470d5,_0x3522f5);var _0x3139f7=_0x6ffff1['channels'][_0x103f1c][_0xeac2('0x23')]&&_0x6ffff1[_0xeac2('0x18')][_0x103f1c][_0xeac2('0x24')]?_0x6ffff1[_0xeac2('0x18')][_0x103f1c][_0xeac2('0x24')]:_0x103f1c;return RpcUser['savePause'](_0x6ffff1['agents'][_0x4470d5],_0x3bd7be,_0x3139f7)['then'](function(_0x2459ad){if(!_0x80a660){_0x6ffff1[_0xeac2('0x9')][_0x4470d5]={};logger[_0xeac2('0x21')](_0xeac2('0x25'),_0x103f1c,_0x6ffff1[_0xeac2('0x7')][_0x3522f5][_0xeac2('0x26')],_0x4470d5,_0x3522f5);_0x6ffff1[_0xeac2('0x9')][_0x4470d5][_0xeac2('0x27')]=setTimeout(_0x6ffff1['stopAcw'][_0xeac2('0xb')](_0x6ffff1,_0x4470d5),_0x6ffff1['voiceQueues'][_0x3522f5][_0xeac2('0x26')]*0x3e8);_0x6ffff1[_0xeac2('0x9')][_0x4470d5][_0xeac2('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x6ffff1[_0xeac2('0x9')][_0x4470d5][_0xeac2('0x29')]=_0x103f1c;_0x6ffff1[_0xeac2('0x9')][_0x4470d5][_0xeac2('0x1a')]=_0x3522f5;_0x6ffff1[_0xeac2('0x9')][_0x4470d5][_0xeac2('0x2a')]=function(){var _0x929581=getDiff(_0x6ffff1[_0xeac2('0x9')][_0x4470d5]['lastPauseAt']);clearTimeout(_0x6ffff1['timers'][_0x4470d5][_0xeac2('0x27')]);_0x6ffff1[_0xeac2('0x9')][_0x4470d5]['timer']=![];RpcVoiceAgentReport[_0xeac2('0x2b')]({'acwtime':_0x929581},_0x6ffff1['timers'][_0x4470d5]['uniqueid'],_0x4470d5)[_0xeac2('0x1f')](function(_0x4cb330){logger[_0xeac2('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x103f1c,_0x929581,_0x4cb330);})[_0xeac2('0x2c')](function(_0x4ea29a){logger[_0xeac2('0x2d')](_0xeac2('0x2e'),_0x103f1c,_0x4ea29a);});delete _0x6ffff1['timers'][_0x4470d5];};}});}else{logger[_0xeac2('0x21')](_0xeac2('0x2f'),_0x103f1c,_0x4470d5,_0x3522f5);}});}})[_0xeac2('0x2c')](function(_0x53c392){logger[_0xeac2('0x2d')](_0xeac2('0x25'),_0x103f1c,_0x6ffff1['voiceQueues'][_0x3522f5][_0xeac2('0x26')],_0x4470d5,_0x3522f5);})[_0xeac2('0x30')](function(){delete _0x6ffff1[_0xeac2('0x18')][_0x103f1c];});}catch(_0x7d5a11){logger['error'](_0xeac2('0x31'),_0x7d5a11[_0xeac2('0x32')]);}};Acw[_0xeac2('0x16')][_0xeac2('0x33')]=function(_0x210649){try{var _0x18965d=this;if(_0x18965d[_0xeac2('0x9')][_0x210649]){_0x18965d['timers'][_0x210649][_0xeac2('0x27')]=![];var _0x2a72e4=_0x18965d[_0xeac2('0x9')][_0x210649][_0xeac2('0x29')];var _0x22310d=_0x18965d[_0xeac2('0x9')][_0x210649][_0xeac2('0x1a')];var _0x4e7a09=_0x18965d[_0xeac2('0x7')][_0x22310d]['acwTimeout'];logger[_0xeac2('0x21')](_0xeac2('0x34'),_0x2a72e4,_0x210649);RpcUser[_0xeac2('0x35')](this[_0xeac2('0x8')][_0x210649]);RpcVoiceAgentReport['update']({'acwtime':_0x4e7a09,'agentacw':!![]},_0x2a72e4,_0x210649)[_0xeac2('0x1f')](function(_0x284ccf){logger[_0xeac2('0x21')](_0xeac2('0x36'),_0x2a72e4,_0x4e7a09,_0x284ccf);})['catch'](function(_0x544585){logger[_0xeac2('0x2d')](_0xeac2('0x2e'),_0x2a72e4,_0x544585);});}else{logger[_0xeac2('0x2d')](_0xeac2('0x37'),_0x210649);if(_0x18965d['timers']){logger['info']('[ACW][TIMERS]',JSON[_0xeac2('0x38')](_0x18965d[_0xeac2('0x9')]));}}}catch(_0x543990){logger[_0xeac2('0x2d')](_0xeac2('0x39'),_0x543990[_0xeac2('0x32')]);}};Acw[_0xeac2('0x16')][_0xeac2('0x3a')]=function(_0x37bf9d){try{if(this[_0xeac2('0x7')][_0x37bf9d['queue']]&&(this[_0xeac2('0x7')][_0x37bf9d['queue']][_0xeac2('0x4')]||this[_0xeac2('0x7')][_0x37bf9d[_0xeac2('0x1a')]][_0xeac2('0x1b')])){if(this[_0xeac2('0x8')][_0x37bf9d[_0xeac2('0x19')]]){this[_0xeac2('0x18')][_0x37bf9d['uniqueid']]={'queue':_0x37bf9d['queue'],'interface':_0x37bf9d[_0xeac2('0x19')],'destlinkedid':_0x37bf9d['destlinkedid']};}}}catch(_0x304714){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x304714['message']);}};Acw[_0xeac2('0x16')]['syncAgentConnectPreview']=function(_0xdbb93c){try{if(this[_0xeac2('0x7')][_0xdbb93c[_0xeac2('0x1a')]]&&(this[_0xeac2('0x7')][_0xdbb93c[_0xeac2('0x1a')]][_0xeac2('0x4')]||this[_0xeac2('0x7')][_0xdbb93c['queue']][_0xeac2('0x1b')])){if(this[_0xeac2('0x8')][_0xdbb93c[_0xeac2('0x19')]]){this[_0xeac2('0x18')][_0xdbb93c[_0xeac2('0x29')]]={'queue':_0xdbb93c['queue'],'interface':_0xdbb93c[_0xeac2('0x19')]};}}}catch(_0x44d9fb){logger[_0xeac2('0x2d')](_0xeac2('0x3b'),_0x44d9fb[_0xeac2('0x32')]);}};Acw[_0xeac2('0x16')]['syncHangupRequest']=function(_0x477083){try{if(this['channels'][_0x477083[_0xeac2('0x29')]]&&_[_0xeac2('0x3c')](this[_0xeac2('0x18')][_0x477083[_0xeac2('0x29')]][_0xeac2('0x23')])){logger['info'](_0xeac2('0x3d'),_0x477083['uniqueid']);this[_0xeac2('0x17')](_0x477083[_0xeac2('0x29')]);}else if(this['channels'][_0x477083[_0xeac2('0x3e')]]&&_[_0xeac2('0x3c')](this['channels'][_0x477083['linkedid']][_0xeac2('0x23')])){logger[_0xeac2('0x21')](_0xeac2('0x3f'),_0x477083[_0xeac2('0x3e')]);this['startAcw'](_0x477083['linkedid']);}}catch(_0x5aebf){logger[_0xeac2('0x2d')](_0xeac2('0x40'),_0x5aebf[_0xeac2('0x32')]);}};Acw['prototype']['syncHangup']=function(_0x157eb4){try{if(this[_0xeac2('0x18')][_0x157eb4[_0xeac2('0x29')]]&&this[_0xeac2('0x18')][_0x157eb4[_0xeac2('0x29')]][_0xeac2('0x23')]){logger['info'](_0xeac2('0x41'),_0x157eb4['uniqueid']);this[_0xeac2('0x17')](_0x157eb4['uniqueid']);}else if(this[_0xeac2('0x18')][_0x157eb4[_0xeac2('0x3e')]]&&this[_0xeac2('0x18')][_0x157eb4['linkedid']]['attended']){logger[_0xeac2('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x157eb4[_0xeac2('0x3e')]);this['startAcw'](_0x157eb4['linkedid']);}}catch(_0x2c6df6){logger['error'](_0xeac2('0x42'),_0x2c6df6['message']);}};Acw[_0xeac2('0x16')][_0xeac2('0x43')]=function(_0x20a9bb){try{if(!_[_0xeac2('0x44')](this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x45')]])){this[_0xeac2('0x17')](_0x20a9bb[_0xeac2('0x45')]);if(this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x46')]]){this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x46')]]['attended']=!![];this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x47')]]=this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x46')]];delete this[_0xeac2('0x18')][_0x20a9bb['secondtransfereruniqueid']];}}else if(!_['isNil'](this['channels'][_0x20a9bb[_0xeac2('0x47')]])){this[_0xeac2('0x17')](_0x20a9bb[_0xeac2('0x47')]);if(this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x48')]]){this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x48')]][_0xeac2('0x23')]=!![];this[_0xeac2('0x18')][_0x20a9bb['transfereeuniqueid']]=this[_0xeac2('0x18')][_0x20a9bb[_0xeac2('0x48')]];delete this['channels'][_0x20a9bb[_0xeac2('0x48')]];}}}catch(_0x310729){logger[_0xeac2('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x310729['message']);}};Acw[_0xeac2('0x16')][_0xeac2('0x49')]=function(_0x8997b0){try{if(this[_0xeac2('0x18')][_0x8997b0['transfereruniqueid']]){logger['info'](_0xeac2('0x4a'),JSON[_0xeac2('0x38')](_0x8997b0['transfereruniqueid']));this[_0xeac2('0x17')](_0x8997b0[_0xeac2('0x4b')]);}else if(this[_0xeac2('0x18')][_0x8997b0[_0xeac2('0x4c')]]){logger['info'](_0xeac2('0x4d'),JSON[_0xeac2('0x38')](_0x8997b0['transfererlinkedid']));this[_0xeac2('0x17')](_0x8997b0[_0xeac2('0x4c')]);}}catch(_0x46df86){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x46df86[_0xeac2('0x32')]);}};Acw['prototype'][_0xeac2('0x11')]=function(_0x207b95){try{if(this['voiceQueues'][_0x207b95[_0xeac2('0x1a')]]&&this[_0xeac2('0x7')][_0x207b95['queue']][_0xeac2('0x4e')]===_0xeac2('0x4f')){if(this[_0xeac2('0x8')][_0x207b95[_0xeac2('0x19')]]){logger['info'](_0xeac2('0x50'),_0x207b95['uniqueid'],_0x207b95[_0xeac2('0x19')],_0x207b95['queue']);return RpcUser[_0xeac2('0x51')](this['agents'][_0x207b95['interface']],_0xeac2('0x52'),_0x207b95['uniqueid']);}}}catch(_0x2c581){logger[_0xeac2('0x2d')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x2c581[_0xeac2('0x32')]);}};module[_0xeac2('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a628f11..94a2c2a 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 _0x5fe0=['queuesummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','fullybooted','then','actionDeviceStateList','exports','asterisk-manager','bluebird','util','lodash','../../config/environment','port','asterisk','username','password','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x5fe0,0x13f));var _0x05fe=function(_0x31a106,_0x1ff9c0){_0x31a106=_0x31a106-0x0;var _0x5ea003=_0x5fe0[_0x31a106];return _0x5ea003;};'use strict';var Manager=require(_0x05fe('0x0'));var BPromise=require(_0x05fe('0x1'));var moment=require('moment');var util=require(_0x05fe('0x2'));var _=require(_0x05fe('0x3'));var logger=require('../../config/logger')('ami');var config=require(_0x05fe('0x4'));var ami=new Manager(config['asterisk'][_0x05fe('0x5')],config[_0x05fe('0x6')]['ip'],config['asterisk'][_0x05fe('0x7')],config[_0x05fe('0x6')][_0x05fe('0x8')],!![]);ami['keepConnected']();ami[_0x05fe('0x9')]=BPromise[_0x05fe('0xa')](ami['action']);function error(_0x29ebc1){logger[_0x05fe('0xb')](util['format'](_0x05fe('0xc'),config[_0x05fe('0x6')]['username'],config['asterisk']['ip'],config[_0x05fe('0x6')]['port'],util[_0x05fe('0xd')](_0x29ebc1,![],null)));}function close(){logger[_0x05fe('0xb')](util['format'](_0x05fe('0xe'),config[_0x05fe('0x6')][_0x05fe('0x7')],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')]['port']));}ami[_0x05fe('0xf')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x05fe('0x9')]({'action':_0x05fe('0x11')});};};ami[_0x05fe('0x12')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x13')});};};ami[_0x05fe('0x14')]=function(){return function(){return ami['Action']({'action':_0x05fe('0x15')});};};ami[_0x05fe('0x16')]=function(){return function(){return ami[_0x05fe('0x9')]({'action':_0x05fe('0x17')});};};function connect(_0x391527){logger[_0x05fe('0x18')](util[_0x05fe('0x19')](_0x05fe('0x1a'),config[_0x05fe('0x6')][_0x05fe('0x7')],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')][_0x05fe('0x5')]));ami['once'](_0x05fe('0xb'),error);ami[_0x05fe('0x1b')](_0x05fe('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0x05fe('0x1d'),function(_0x2a4bad){logger[_0x05fe('0x18')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x05fe('0x6')]['username'],config[_0x05fe('0x6')]['ip'],config['asterisk'][_0x05fe('0x5')],util[_0x05fe('0xd')](_0x2a4bad,![],null)));});ami['on'](_0x05fe('0x1e'),function(_0x487b31){logger[_0x05fe('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x05fe('0x6')]['username'],config[_0x05fe('0x6')]['ip'],config[_0x05fe('0x6')]['port']));return BPromise['resolve']()[_0x05fe('0x1f')](ami[_0x05fe('0xf')]())[_0x05fe('0x1f')](ami[_0x05fe('0x20')]())[_0x05fe('0x1f')](ami[_0x05fe('0x12')]())[_0x05fe('0x1f')](ami[_0x05fe('0x14')]())[_0x05fe('0x1f')](ami[_0x05fe('0x16')]())['catch'](function(_0x30abf6){console['log'](_0x30abf6);});});ami[_0x05fe('0x1b')]('error',error);ami[_0x05fe('0x1b')](_0x05fe('0x1c'),close);module[_0x05fe('0x21')]=ami; \ No newline at end of file +var _0x064e=['bluebird','moment','util','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','exports','asterisk-manager'];(function(_0x597f51,_0x3827d1){var _0x11b1e4=function(_0x50cfba){while(--_0x50cfba){_0x597f51['push'](_0x597f51['shift']());}};_0x11b1e4(++_0x3827d1);}(_0x064e,0x13f));var _0xe064=function(_0x282e25,_0x19b7e6){_0x282e25=_0x282e25-0x0;var _0x58064d=_0x064e[_0x282e25];return _0x58064d;};'use strict';var Manager=require(_0xe064('0x0'));var BPromise=require(_0xe064('0x1'));var moment=require(_0xe064('0x2'));var util=require(_0xe064('0x3'));var _=require('lodash');var logger=require('../../config/logger')(_0xe064('0x4'));var config=require(_0xe064('0x5'));var ami=new Manager(config[_0xe064('0x6')][_0xe064('0x7')],config[_0xe064('0x6')]['ip'],config[_0xe064('0x6')][_0xe064('0x8')],config[_0xe064('0x6')]['password'],!![]);ami[_0xe064('0x9')]();ami[_0xe064('0xa')]=BPromise[_0xe064('0xb')](ami[_0xe064('0xc')]);function error(_0x43b7c1){logger[_0xe064('0xd')](util[_0xe064('0xe')](_0xe064('0xf'),config[_0xe064('0x6')][_0xe064('0x8')],config[_0xe064('0x6')]['ip'],config[_0xe064('0x6')][_0xe064('0x7')],util['inspect'](_0x43b7c1,![],null)));}function close(){logger[_0xe064('0xd')](util['format'](_0xe064('0x10'),config[_0xe064('0x6')][_0xe064('0x8')],config[_0xe064('0x6')]['ip'],config['asterisk'][_0xe064('0x7')]));}ami[_0xe064('0x11')]=function(){return function(){return ami['Action']({'action':_0xe064('0x12')});};};ami[_0xe064('0x13')]=function(){return function(){return ami[_0xe064('0xa')]({'action':_0xe064('0x14')});};};ami[_0xe064('0x15')]=function(){return function(){return ami[_0xe064('0xa')]({'action':_0xe064('0x16')});};};ami[_0xe064('0x17')]=function(){return function(){return ami[_0xe064('0xa')]({'action':_0xe064('0x18')});};};ami[_0xe064('0x19')]=function(){return function(){return ami[_0xe064('0xa')]({'action':_0xe064('0x1a')});};};function connect(_0x4a873f){logger[_0xe064('0x1b')](util[_0xe064('0xe')](_0xe064('0x1c'),config[_0xe064('0x6')][_0xe064('0x8')],config[_0xe064('0x6')]['ip'],config[_0xe064('0x6')][_0xe064('0x7')]));ami[_0xe064('0x1d')](_0xe064('0xd'),error);ami[_0xe064('0x1d')](_0xe064('0x1e'),close);}ami['on'](_0xe064('0x1f'),connect);ami['on'](_0xe064('0x20'),function(_0x60d3ca){logger[_0xe064('0x1b')](util['format'](_0xe064('0x21'),config['asterisk']['username'],config[_0xe064('0x6')]['ip'],config['asterisk']['port'],util['inspect'](_0x60d3ca,![],null)));});ami['on'](_0xe064('0x22'),function(_0x50db8b){logger['info'](util[_0xe064('0xe')](_0xe064('0x23'),config[_0xe064('0x6')]['username'],config[_0xe064('0x6')]['ip'],config['asterisk'][_0xe064('0x7')]));return BPromise[_0xe064('0x24')]()[_0xe064('0x25')](ami['actionSipShowRegistry']())[_0xe064('0x25')](ami[_0xe064('0x13')]())[_0xe064('0x25')](ami[_0xe064('0x15')]())['then'](ami[_0xe064('0x17')]())['then'](ami['actionCoreShowChannels']())['catch'](function(_0x3bd66b){console[_0xe064('0x26')](_0x3bd66b);});});ami['once'](_0xe064('0xd'),error);ami['once'](_0xe064('0x1e'),close);module[_0xe064('0x27')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 43f691a..ecfde9f 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 _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x5baed9,_0x409757){var _0x43aad3=function(_0x4e6713){while(--_0x4e6713){_0x5baed9['push'](_0x5baed9['shift']());}};_0x43aad3(++_0x409757);}(_0xac4a,0x13f));var _0xaac4=function(_0x56aa8c,_0x4eee90){_0x56aa8c=_0x56aa8c-0x0;var _0x369238=_0xac4a[_0x56aa8c];return _0x369238;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x58084e,_0x428847){var _0x50ca59=function(_0x219ef4){while(--_0x219ef4){_0x58084e['push'](_0x58084e['shift']());}};_0x50ca59(++_0x428847);}(_0xaa88,0x137));var _0x8aa8=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0xaa88[_0x1a37e3];return _0x4db78a;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 31063a7..690da1c 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa44c=['recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','callback','callbackuniqueid','callbackat'];(function(_0x1ffbf1,_0x5df1ad){var _0x1fd3e8=function(_0x546933){while(--_0x546933){_0x1ffbf1['push'](_0x1ffbf1['shift']());}};_0x1fd3e8(++_0x5df1ad);}(_0xa44c,0xe1));var _0xca44=function(_0x4b81c9,_0x4f478f){_0x4b81c9=_0x4b81c9-0x0;var _0x349019=_0xa44c[_0x4b81c9];return _0x349019;};'use strict';var util=require(_0xca44('0x0'));var _=require(_0xca44('0x1'));var moment=require(_0xca44('0x2'));function checkNameSurname(_0x1b47ba,_0x1a02a0,_0x1c9aca){var _0x4c6eda='';if(!_[_0xca44('0x3')](_0x1a02a0)&&'string'===typeof _0x1a02a0){_0x4c6eda+=_0x1a02a0;}if(!_[_0xca44('0x3')](_0x1c9aca)&&'string'===typeof _0x1c9aca){_0x4c6eda+='\x20'+_0x1c9aca;}if(_0x4c6eda!==''){return _0x4c6eda;}return _0x1b47ba;}function Action(_0x511bbd,_0x479c4e,_0x239c41){this['voiceQueue']=_0x511bbd;this['uniqueid']=_0x239c41||undefined;this[_0xca44('0x4')]=checkNameSurname(_0x479c4e['Contact'][_0xca44('0x5')],_0x479c4e[_0xca44('0x6')][_0xca44('0x7')],_0x479c4e[_0xca44('0x6')][_0xca44('0x8')]);this[_0xca44('0x9')]=_0x479c4e[_0xca44('0x6')]['phone'];this[_0xca44('0xa')]=_0x511bbd[_0xca44('0x4')];this[_0xca44('0xb')]=_0x479c4e[_0xca44('0xb')]||![];this[_0xca44('0xc')]=_0x511bbd[_0xca44('0xc')];this[_0xca44('0xd')]=_0x511bbd[_0xca44('0xd')]||0x3;this[_0xca44('0xe')]=_0x479c4e[_0xca44('0xe')];this[_0xca44('0xf')]=_0x479c4e[_0xca44('0xf')];this['countcongestionretry']=_0x479c4e[_0xca44('0x10')];this['countnoanswerretry']=_0x479c4e[_0xca44('0x11')];this['countnosuchnumberretry']=_0x479c4e[_0xca44('0x12')];this[_0xca44('0x13')]=_0x479c4e[_0xca44('0x13')];this[_0xca44('0x14')]=_0x479c4e[_0xca44('0x14')];this[_0xca44('0x15')]=_0x479c4e[_0xca44('0x15')];this[_0xca44('0x16')]=_0x479c4e[_0xca44('0x16')];this[_0xca44('0x17')]=_0x479c4e[_0xca44('0x17')];this['ListId']=_0x479c4e[_0xca44('0x18')];this[_0xca44('0x19')]=_0x479c4e['UserId'];this[_0xca44('0x1a')]=_0x479c4e['VoiceQueueId'];this[_0xca44('0x1b')]=_0x479c4e[_0xca44('0x1b')];this['idHopper']=_0x479c4e['id'];this[_0xca44('0x1c')]=_0x479c4e[_0xca44('0x6')][_0xca44('0x7')]||'';this[_0xca44('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xca44('0x1e')]=_0x479c4e[_0xca44('0x1e')];this[_0xca44('0x1f')]=_0x479c4e[_0xca44('0x1f')];this[_0xca44('0x20')]=_0x479c4e[_0xca44('0x20')];this[_0xca44('0x21')]=_0x479c4e[_0xca44('0x21')];this[_0xca44('0x22')]='';this['originatecalleridname']='';}Action[_0xca44('0x23')][_0xca44('0x24')]=function(){return util[_0xca44('0x25')](_0xca44('0x26'),this[_0xca44('0x4')],this[_0xca44('0x27')][_0xca44('0x28')]>0x0?this[_0xca44('0x9')]['substring'](this['voiceQueue'][_0xca44('0x28')]):this['number']);};Action['prototype'][_0xca44('0x29')]=function(){return this[_0xca44('0xa')];};module[_0xca44('0x2a')]=Action; \ No newline at end of file +var _0xe9b9=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','starttime','callback','callbackuniqueid','callbackat'];(function(_0x50e35d,_0x3708cd){var _0x3a7825=function(_0x4fa105){while(--_0x4fa105){_0x50e35d['push'](_0x50e35d['shift']());}};_0x3a7825(++_0x3708cd);}(_0xe9b9,0x15a));var _0x9e9b=function(_0x2e48bf,_0x4bde87){_0x2e48bf=_0x2e48bf-0x0;var _0x2b6b2d=_0xe9b9[_0x2e48bf];return _0x2b6b2d;};'use strict';var util=require(_0x9e9b('0x0'));var _=require(_0x9e9b('0x1'));var moment=require(_0x9e9b('0x2'));function checkNameSurname(_0x23b84b,_0x2f6073,_0x5032cc){var _0x2549c2='';if(!_[_0x9e9b('0x3')](_0x2f6073)&&_0x9e9b('0x4')===typeof _0x2f6073){_0x2549c2+=_0x2f6073;}if(!_[_0x9e9b('0x3')](_0x5032cc)&&_0x9e9b('0x4')===typeof _0x5032cc){_0x2549c2+='\x20'+_0x5032cc;}if(_0x2549c2!==''){return _0x2549c2;}return _0x23b84b;}function Action(_0xddf931,_0x3dd738,_0x26fa3a){this[_0x9e9b('0x5')]=_0xddf931;this['uniqueid']=_0x26fa3a||undefined;this[_0x9e9b('0x6')]=checkNameSurname(_0x3dd738[_0x9e9b('0x7')][_0x9e9b('0x8')],_0x3dd738[_0x9e9b('0x7')][_0x9e9b('0x9')],_0x3dd738[_0x9e9b('0x7')][_0x9e9b('0xa')]);this[_0x9e9b('0xb')]=_0x3dd738[_0x9e9b('0x7')][_0x9e9b('0x8')];this[_0x9e9b('0xc')]=_0xddf931[_0x9e9b('0x6')];this[_0x9e9b('0xd')]=_0x3dd738[_0x9e9b('0xd')]||![];this[_0x9e9b('0xe')]=_0xddf931[_0x9e9b('0xe')];this['dialQueueTimeout']=_0xddf931['dialQueueTimeout']||0x3;this[_0x9e9b('0xf')]=_0x3dd738[_0x9e9b('0xf')];this[_0x9e9b('0x10')]=_0x3dd738['countbusyretry'];this[_0x9e9b('0x11')]=_0x3dd738[_0x9e9b('0x11')];this[_0x9e9b('0x12')]=_0x3dd738[_0x9e9b('0x12')];this['countnosuchnumberretry']=_0x3dd738[_0x9e9b('0x13')];this['countdropretry']=_0x3dd738[_0x9e9b('0x14')];this[_0x9e9b('0x15')]=_0x3dd738[_0x9e9b('0x15')];this[_0x9e9b('0x16')]=_0x3dd738[_0x9e9b('0x16')];this[_0x9e9b('0x17')]=_0x3dd738['countagentrejectretry'];this['ContactId']=_0x3dd738[_0x9e9b('0x18')];this[_0x9e9b('0x19')]=_0x3dd738['ListId'];this[_0x9e9b('0x1a')]=_0x3dd738[_0x9e9b('0x1a')];this['VoiceQueueId']=_0x3dd738['VoiceQueueId'];this[_0x9e9b('0x1b')]=_0x3dd738[_0x9e9b('0x1b')];this['idHopper']=_0x3dd738['id'];this['ContactFirstName']=_0x3dd738['Contact'][_0x9e9b('0x9')]||'';this[_0x9e9b('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x9e9b('0x1d')]=_0x3dd738[_0x9e9b('0x1d')];this[_0x9e9b('0x1e')]=_0x3dd738[_0x9e9b('0x1e')];this['callbackat']=_0x3dd738[_0x9e9b('0x1f')];this['recallme']=_0x3dd738[_0x9e9b('0x20')];this[_0x9e9b('0x21')]='';this[_0x9e9b('0x22')]='';}Action[_0x9e9b('0x23')][_0x9e9b('0x24')]=function(){return util['format'](_0x9e9b('0x25'),this['name'],this[_0x9e9b('0x5')][_0x9e9b('0x26')]>0x0?this[_0x9e9b('0xb')][_0x9e9b('0x27')](this[_0x9e9b('0x5')][_0x9e9b('0x26')]):this[_0x9e9b('0xb')]);};Action[_0x9e9b('0x23')][_0x9e9b('0x28')]=function(){return this[_0x9e9b('0xc')];};module[_0x9e9b('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 7ff73b8..c92dceb 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc19=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xdc19,0xb4));var _0x9dc1=function(_0x4a8704,_0x1cf4f2){_0x4a8704=_0x4a8704-0x0;var _0x4d73fb=_0xdc19[_0x4a8704];return _0x4d73fb;};'use strict';var util=require(_0x9dc1('0x0'));var _=require(_0x9dc1('0x1'));var moment=require('moment');function getSeconds(_0x4a76db,_0x36b2e0){var _0x1425b0=moment(_0x4a76db)[_0x9dc1('0x2')](0x0);var _0x12be83=moment(_0x36b2e0)['milliseconds'](0x0);return _0x1425b0['diff'](_0x12be83,_0x9dc1('0x3'));}function AgentComplete(_0x326252,_0x432cb1){this[_0x9dc1('0x4')]=0x4;this[_0x9dc1('0x5')]=_0x9dc1('0x6');this[_0x9dc1('0x7')]=_0x326252[_0x9dc1('0x7')];this[_0x9dc1('0x8')]=_0x326252[_0x9dc1('0x8')];this[_0x9dc1('0x9')]=_0x326252[_0x9dc1('0x8')]===_0x9dc1('0xa')?_0x9dc1('0xb'):_0x326252[_0x9dc1('0x8')];this[_0x9dc1('0xc')]=_0x326252[_0x9dc1('0xc')];this[_0x9dc1('0xd')]=_0x326252['countcongestionretry'];this[_0x9dc1('0xe')]=_0x326252['countnoanswerretry'];this[_0x9dc1('0xf')]=_0x326252['countbusyretry']+_0x326252['countcongestionretry']+_0x326252[_0x9dc1('0xe')]+_0x326252['countnosuchnumberretry']+_0x326252[_0x9dc1('0x10')]+_0x326252[_0x9dc1('0x11')]+_0x326252[_0x9dc1('0x12')]+_0x326252[_0x9dc1('0x13')];this[_0x9dc1('0x14')]=_0x326252['countnosuchnumberretry'];this['countdropretry']=_0x326252[_0x9dc1('0x10')];this[_0x9dc1('0x11')]=_0x326252[_0x9dc1('0x11')];this[_0x9dc1('0x12')]=_0x326252[_0x9dc1('0x12')];this[_0x9dc1('0x13')]=_0x326252[_0x9dc1('0x13')];this[_0x9dc1('0x15')]=_0x432cb1[_0x9dc1('0x15')];this[_0x9dc1('0x16')]=_0x326252[_0x9dc1('0x17')];this[_0x9dc1('0x18')]=_0x326252[_0x9dc1('0x19')];this[_0x9dc1('0x1a')]=_0x326252[_0x9dc1('0x1a')];this[_0x9dc1('0x1b')]=_0x326252[_0x9dc1('0x1b')];this['answertime']=_0x326252[_0x9dc1('0x1c')];this['endtime']=moment()[_0x9dc1('0x1d')](_0x9dc1('0x1e'));this[_0x9dc1('0x1f')]=getSeconds(_0x326252['responsetime'],_0x326252[_0x9dc1('0x1a')]);this['holdtime']=getSeconds(_0x326252[_0x9dc1('0x1c')],_0x326252[_0x9dc1('0x1b')]);this[_0x9dc1('0x20')]=getSeconds(this[_0x9dc1('0x21')],_0x326252['answertime']);this[_0x9dc1('0xb')]=_0x432cb1[_0x9dc1('0xb')];this['membername']=_0x432cb1[_0x9dc1('0x22')];this[_0x9dc1('0x23')]=_0x432cb1[_0x9dc1('0x23')];this[_0x9dc1('0x24')]=_0x326252[_0x9dc1('0x24')];this[_0x9dc1('0x25')]=_0x326252[_0x9dc1('0x25')];this[_0x9dc1('0x26')]=_0x326252['callbackat'];this['recallme']=_0x326252[_0x9dc1('0x27')];this[_0x9dc1('0x28')]=_0x326252['ContactId'];this['ListId']=_0x326252[_0x9dc1('0x29')];this['UserId']=_0x326252[_0x9dc1('0x2a')];this[_0x9dc1('0x2b')]=_0x326252[_0x9dc1('0x2b')];this[_0x9dc1('0x2c')]=_0x326252[_0x9dc1('0x2c')];this[_0x9dc1('0x2d')]=_0x326252['originatecalleridnum']||'';this[_0x9dc1('0x2e')]=_0x326252[_0x9dc1('0x2e')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xa7c8=['campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','state','Answer','scheduledat'];(function(_0x138387,_0x2a16ac){var _0x45b15a=function(_0x37f412){while(--_0x37f412){_0x138387['push'](_0x138387['shift']());}};_0x45b15a(++_0x2a16ac);}(_0xa7c8,0x82));var _0x8a7c=function(_0x502fa5,_0x2a6a27){_0x502fa5=_0x502fa5-0x0;var _0x202a43=_0xa7c8[_0x502fa5];return _0x202a43;};'use strict';var util=require(_0x8a7c('0x0'));var _=require('lodash');var moment=require(_0x8a7c('0x1'));function getSeconds(_0x2c111e,_0x2a6321){var _0x563c48=moment(_0x2c111e)[_0x8a7c('0x2')](0x0);var _0x4d4eac=moment(_0x2a6321)[_0x8a7c('0x2')](0x0);return _0x563c48[_0x8a7c('0x3')](_0x4d4eac,_0x8a7c('0x4'));}function AgentComplete(_0x344a96,_0x566951){this[_0x8a7c('0x5')]=0x4;this['statedesc']=_0x8a7c('0x6');this[_0x8a7c('0x7')]=_0x344a96[_0x8a7c('0x7')];this['type']=_0x344a96['type'];this[_0x8a7c('0x8')]=_0x344a96[_0x8a7c('0x9')]===_0x8a7c('0xa')?'queue':_0x344a96['type'];this[_0x8a7c('0xb')]=_0x344a96[_0x8a7c('0xb')];this[_0x8a7c('0xc')]=_0x344a96[_0x8a7c('0xc')];this[_0x8a7c('0xd')]=_0x344a96['countnoanswerretry'];this[_0x8a7c('0xe')]=_0x344a96['countbusyretry']+_0x344a96[_0x8a7c('0xc')]+_0x344a96[_0x8a7c('0xd')]+_0x344a96[_0x8a7c('0xf')]+_0x344a96[_0x8a7c('0x10')]+_0x344a96[_0x8a7c('0x11')]+_0x344a96[_0x8a7c('0x12')]+_0x344a96[_0x8a7c('0x13')];this[_0x8a7c('0xf')]=_0x344a96[_0x8a7c('0xf')];this[_0x8a7c('0x10')]=_0x344a96[_0x8a7c('0x10')];this[_0x8a7c('0x11')]=_0x344a96[_0x8a7c('0x11')];this[_0x8a7c('0x12')]=_0x344a96['countmachineretry'];this[_0x8a7c('0x13')]=_0x344a96[_0x8a7c('0x13')];this['uniqueid']=_0x566951[_0x8a7c('0x14')];this[_0x8a7c('0x15')]=_0x344a96[_0x8a7c('0x16')];this[_0x8a7c('0x17')]=_0x344a96['number'];this[_0x8a7c('0x18')]=_0x344a96[_0x8a7c('0x18')];this['responsetime']=_0x344a96[_0x8a7c('0x19')];this[_0x8a7c('0x1a')]=_0x344a96[_0x8a7c('0x1a')];this[_0x8a7c('0x1b')]=moment()[_0x8a7c('0x1c')](_0x8a7c('0x1d'));this[_0x8a7c('0x1e')]=getSeconds(_0x344a96['responsetime'],_0x344a96[_0x8a7c('0x18')]);this[_0x8a7c('0x1f')]=getSeconds(_0x344a96['answertime'],_0x344a96['responsetime']);this[_0x8a7c('0x20')]=getSeconds(this[_0x8a7c('0x1b')],_0x344a96[_0x8a7c('0x1a')]);this[_0x8a7c('0x21')]=_0x566951[_0x8a7c('0x21')];this['membername']=_0x566951[_0x8a7c('0x22')];this[_0x8a7c('0x23')]=_0x566951[_0x8a7c('0x23')];this[_0x8a7c('0x24')]=_0x344a96['callback'];this[_0x8a7c('0x25')]=_0x344a96[_0x8a7c('0x25')];this[_0x8a7c('0x26')]=_0x344a96[_0x8a7c('0x26')];this['recallme']=_0x344a96[_0x8a7c('0x27')];this[_0x8a7c('0x28')]=_0x344a96[_0x8a7c('0x28')];this[_0x8a7c('0x29')]=_0x344a96[_0x8a7c('0x29')];this['UserId']=_0x344a96[_0x8a7c('0x2a')];this['VoiceQueueId']=_0x344a96['VoiceQueueId'];this[_0x8a7c('0x2b')]=_0x344a96[_0x8a7c('0x2b')];this[_0x8a7c('0x2c')]=_0x344a96[_0x8a7c('0x2c')]||'';this['originatecalleridname']=_0x344a96[_0x8a7c('0x2d')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index e076833..5ea8d45 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf120=['diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds'];(function(_0x56a4d,_0x289dc6){var _0x4aac8c=function(_0x464dc2){while(--_0x464dc2){_0x56a4d['push'](_0x56a4d['shift']());}};_0x4aac8c(++_0x289dc6);}(_0xf120,0x179));var _0x0f12=function(_0xf99f57,_0x3ca1e9){_0xf99f57=_0xf99f57-0x0;var _0x3963c2=_0xf120[_0xf99f57];return _0x3963c2;};'use strict';var util=require('util');var _=require(_0x0f12('0x0'));var moment=require(_0x0f12('0x1'));function getSeconds(_0x1d8274,_0x51c839){var _0x380c77=moment(_0x1d8274)[_0x0f12('0x2')](0x0);var _0x163c58=moment(_0x51c839)['milliseconds'](0x0);return _0x380c77[_0x0f12('0x3')](_0x163c58,_0x0f12('0x4'));}function Final(_0x2dbf82){this[_0x0f12('0x5')]=_0x2dbf82[_0x0f12('0x5')];this[_0x0f12('0x6')]=_0x2dbf82[_0x0f12('0x6')];this[_0x0f12('0x7')]=_0x2dbf82['type'];this[_0x0f12('0x8')]=_0x2dbf82['type']===_0x0f12('0x9')?_0x0f12('0xa'):_0x2dbf82[_0x0f12('0x7')];this['countbusyretry']=_0x2dbf82['countbusyretry'];this[_0x0f12('0xb')]=_0x2dbf82[_0x0f12('0xb')];this[_0x0f12('0xc')]=_0x2dbf82[_0x0f12('0xc')];this[_0x0f12('0xd')]=_0x2dbf82[_0x0f12('0xe')]+_0x2dbf82[_0x0f12('0xb')]+_0x2dbf82['countnoanswerretry']+_0x2dbf82[_0x0f12('0xf')]+_0x2dbf82[_0x0f12('0x10')]+_0x2dbf82[_0x0f12('0x11')]+_0x2dbf82[_0x0f12('0x12')]+_0x2dbf82[_0x0f12('0x13')];this[_0x0f12('0xf')]=_0x2dbf82[_0x0f12('0xf')];this[_0x0f12('0x10')]=_0x2dbf82[_0x0f12('0x10')];this[_0x0f12('0x11')]=_0x2dbf82[_0x0f12('0x11')];this[_0x0f12('0x12')]=_0x2dbf82[_0x0f12('0x12')];this[_0x0f12('0x13')]=_0x2dbf82[_0x0f12('0x13')];this['queue']=_0x2dbf82[_0x0f12('0xa')];this['calleridname']=_0x2dbf82[_0x0f12('0x14')];this[_0x0f12('0x15')]=_0x2dbf82[_0x0f12('0x15')];this[_0x0f12('0x16')]=_0x2dbf82[_0x0f12('0x16')];this[_0x0f12('0x17')]=_0x2dbf82['responsetime'];this[_0x0f12('0x18')]=_0x2dbf82['responsetime'];this[_0x0f12('0x19')]=_0x2dbf82['ringtime']||0x0;this['holdtime']=_0x2dbf82[_0x0f12('0x1a')]||0x0;this[_0x0f12('0x1b')]=_0x2dbf82[_0x0f12('0x1b')]||0x0;this['callback']=_0x2dbf82[_0x0f12('0x1c')];this['callbackuniqueid']=_0x2dbf82[_0x0f12('0x1d')];this['callbackat']=_0x2dbf82[_0x0f12('0x1e')];this[_0x0f12('0x1f')]=_0x2dbf82['recallme'];this[_0x0f12('0x20')]=_0x2dbf82[_0x0f12('0x20')];this[_0x0f12('0x21')]=_0x2dbf82[_0x0f12('0x21')];this[_0x0f12('0x22')]=_0x2dbf82['UserId'];this[_0x0f12('0x23')]=_0x2dbf82['VoiceQueueId'];this['CampaignId']=_0x2dbf82['CampaignId'];this[_0x0f12('0x24')]=_0x2dbf82[_0x0f12('0x24')]||'';this[_0x0f12('0x25')]=_0x2dbf82[_0x0f12('0x25')]||'';}module['exports']=Final; \ No newline at end of file +var _0xfa2b=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x1d786c,_0x20f9ff){_0x1d786c=_0x1d786c-0x0;var _0x594e40=_0xfa2b[_0x1d786c];return _0x594e40;};'use strict';var util=require(_0xbfa2('0x0'));var _=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));function getSeconds(_0x9a9b55,_0x237b3e){var _0x41d712=moment(_0x9a9b55)[_0xbfa2('0x3')](0x0);var _0x1103cf=moment(_0x237b3e)[_0xbfa2('0x3')](0x0);return _0x41d712[_0xbfa2('0x4')](_0x1103cf,_0xbfa2('0x5'));}function Final(_0x2e8f3b){this[_0xbfa2('0x6')]=_0x2e8f3b[_0xbfa2('0x6')];this[_0xbfa2('0x7')]=_0x2e8f3b[_0xbfa2('0x7')];this['type']=_0x2e8f3b[_0xbfa2('0x8')];this['campaigntype']=_0x2e8f3b[_0xbfa2('0x8')]===_0xbfa2('0x9')?_0xbfa2('0xa'):_0x2e8f3b[_0xbfa2('0x8')];this[_0xbfa2('0xb')]=_0x2e8f3b[_0xbfa2('0xb')];this[_0xbfa2('0xc')]=_0x2e8f3b[_0xbfa2('0xc')];this[_0xbfa2('0xd')]=_0x2e8f3b['countnoanswerretry'];this['countglobal']=_0x2e8f3b['countbusyretry']+_0x2e8f3b[_0xbfa2('0xc')]+_0x2e8f3b[_0xbfa2('0xd')]+_0x2e8f3b[_0xbfa2('0xe')]+_0x2e8f3b[_0xbfa2('0xf')]+_0x2e8f3b[_0xbfa2('0x10')]+_0x2e8f3b[_0xbfa2('0x11')]+_0x2e8f3b['countagentrejectretry'];this[_0xbfa2('0xe')]=_0x2e8f3b[_0xbfa2('0xe')];this[_0xbfa2('0xf')]=_0x2e8f3b[_0xbfa2('0xf')];this[_0xbfa2('0x10')]=_0x2e8f3b['countabandonedretry'];this[_0xbfa2('0x11')]=_0x2e8f3b['countmachineretry'];this['countagentrejectretry']=_0x2e8f3b[_0xbfa2('0x12')];this['queue']=_0x2e8f3b['queue'];this[_0xbfa2('0x13')]=_0x2e8f3b[_0xbfa2('0x13')];this['calleridnum']=_0x2e8f3b[_0xbfa2('0x14')];this[_0xbfa2('0x15')]=_0x2e8f3b[_0xbfa2('0x15')];this[_0xbfa2('0x16')]=_0x2e8f3b[_0xbfa2('0x16')];this[_0xbfa2('0x17')]=_0x2e8f3b[_0xbfa2('0x16')];this['ringtime']=_0x2e8f3b[_0xbfa2('0x18')]||0x0;this[_0xbfa2('0x19')]=_0x2e8f3b[_0xbfa2('0x19')]||0x0;this['talktime']=_0x2e8f3b[_0xbfa2('0x1a')]||0x0;this[_0xbfa2('0x1b')]=_0x2e8f3b['callback'];this[_0xbfa2('0x1c')]=_0x2e8f3b['callbackuniqueid'];this['callbackat']=_0x2e8f3b[_0xbfa2('0x1d')];this[_0xbfa2('0x1e')]=_0x2e8f3b[_0xbfa2('0x1e')];this[_0xbfa2('0x1f')]=_0x2e8f3b['ContactId'];this['ListId']=_0x2e8f3b[_0xbfa2('0x20')];this[_0xbfa2('0x21')]=_0x2e8f3b['UserId'];this[_0xbfa2('0x22')]=_0x2e8f3b['VoiceQueueId'];this[_0xbfa2('0x23')]=_0x2e8f3b['CampaignId'];this[_0xbfa2('0x24')]=_0x2e8f3b[_0xbfa2('0x24')]||'';this[_0xbfa2('0x25')]=_0x2e8f3b[_0xbfa2('0x25')]||'';}module[_0xbfa2('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 85805cc..5d90d49 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb3f=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','type','campaigntype','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','queue','IVR','reason'];(function(_0x41a5a0,_0x3bee12){var _0x2190f8=function(_0x3019e1){while(--_0x3019e1){_0x41a5a0['push'](_0x41a5a0['shift']());}};_0x2190f8(++_0x3bee12);}(_0xfb3f,0xb7));var _0xffb3=function(_0x40139a,_0x534505){_0x40139a=_0x40139a-0x0;var _0x26ee8b=_0xfb3f[_0x40139a];return _0x26ee8b;};'use strict';var util=require(_0xffb3('0x0'));var _=require(_0xffb3('0x1'));var moment=require(_0xffb3('0x2'));function getSeconds(_0x3a165a,_0x50b69d){var _0x1608a2=moment(_0x3a165a)[_0xffb3('0x3')](0x0);var _0x35ba96=moment(_0x50b69d)['milliseconds'](0x0);return _0x1608a2[_0xffb3('0x4')](_0x35ba96,_0xffb3('0x5'));}function Hangup(_0x2ff82a,_0x3ecbc){this['state']=0x4;this[_0xffb3('0x6')]=_0xffb3('0x7');this['scheduledat']=_0x2ff82a['scheduledat'];this[_0xffb3('0x8')]=_0x2ff82a[_0xffb3('0x8')];this[_0xffb3('0x9')]=_0x2ff82a['type']==='outbound'?'queue':_0x2ff82a[_0xffb3('0x8')];this[_0xffb3('0xa')]=_0x2ff82a[_0xffb3('0xa')];this['countcongestionretry']=_0x2ff82a['countcongestionretry'];this['countnoanswerretry']=_0x2ff82a['countnoanswerretry'];this[_0xffb3('0xb')]=_0x2ff82a[_0xffb3('0xa')]+_0x2ff82a[_0xffb3('0xc')]+_0x2ff82a[_0xffb3('0xd')]+_0x2ff82a[_0xffb3('0xe')]+_0x2ff82a['countdropretry']+_0x2ff82a[_0xffb3('0xf')]+_0x2ff82a['countmachineretry']+_0x2ff82a[_0xffb3('0x10')];this[_0xffb3('0xe')]=_0x2ff82a['countnosuchnumberretry'];this[_0xffb3('0x11')]=_0x2ff82a[_0xffb3('0x11')];this[_0xffb3('0xf')]=_0x2ff82a['countabandonedretry'];this[_0xffb3('0x12')]=_0x2ff82a[_0xffb3('0x12')];this[_0xffb3('0x10')]=_0x2ff82a[_0xffb3('0x10')];this['uniqueid']=_0x3ecbc[_0xffb3('0x13')];this[_0xffb3('0x14')]=_0x2ff82a[_0xffb3('0x15')];this['calleridnum']=_0x2ff82a[_0xffb3('0x16')];this['starttime']=_0x2ff82a[_0xffb3('0x17')];this[_0xffb3('0x18')]=_0x2ff82a[_0xffb3('0x18')];this[_0xffb3('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xffb3('0x1a')]=getSeconds(_0x2ff82a[_0xffb3('0x18')],_0x2ff82a[_0xffb3('0x17')]);this[_0xffb3('0x1b')]=0x0;this[_0xffb3('0x1c')]=getSeconds(this['endtime'],_0x2ff82a[_0xffb3('0x18')]);this[_0xffb3('0x1d')]=_0x2ff82a[_0xffb3('0x1d')];this['membername']=_0xffb3('0x1e');this[_0xffb3('0x1f')]=_0x3ecbc[_0xffb3('0x20')];this[_0xffb3('0x21')]=_0x2ff82a[_0xffb3('0x21')];this[_0xffb3('0x22')]=_0x2ff82a[_0xffb3('0x22')];this[_0xffb3('0x23')]=_0x2ff82a[_0xffb3('0x23')];this[_0xffb3('0x24')]=_0x2ff82a[_0xffb3('0x24')];this[_0xffb3('0x25')]=_0x2ff82a[_0xffb3('0x25')];this[_0xffb3('0x26')]=_0x2ff82a[_0xffb3('0x26')];this[_0xffb3('0x27')]=_0x2ff82a[_0xffb3('0x27')];this['VoiceQueueId']=_0x2ff82a[_0xffb3('0x28')];this[_0xffb3('0x29')]=_0x2ff82a[_0xffb3('0x29')];}module[_0xffb3('0x2a')]=Hangup; \ No newline at end of file +var _0x9015=['YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format'];(function(_0x5c6dd5,_0xcf44d){var _0x4d51d2=function(_0x315913){while(--_0x315913){_0x5c6dd5['push'](_0x5c6dd5['shift']());}};_0x4d51d2(++_0xcf44d);}(_0x9015,0x1be));var _0x5901=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9015[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x5901('0x0'));var _=require(_0x5901('0x1'));var moment=require('moment');function getSeconds(_0xe9acd5,_0x3172ac){var _0x4c7301=moment(_0xe9acd5)['milliseconds'](0x0);var _0x526f59=moment(_0x3172ac)[_0x5901('0x2')](0x0);return _0x4c7301[_0x5901('0x3')](_0x526f59,'seconds');}function Hangup(_0x38d7a3,_0xe9e39d){this[_0x5901('0x4')]=0x4;this[_0x5901('0x5')]=_0x5901('0x6');this[_0x5901('0x7')]=_0x38d7a3[_0x5901('0x7')];this['type']=_0x38d7a3['type'];this[_0x5901('0x8')]=_0x38d7a3[_0x5901('0x9')]===_0x5901('0xa')?'queue':_0x38d7a3['type'];this[_0x5901('0xb')]=_0x38d7a3['countbusyretry'];this[_0x5901('0xc')]=_0x38d7a3[_0x5901('0xc')];this[_0x5901('0xd')]=_0x38d7a3[_0x5901('0xd')];this[_0x5901('0xe')]=_0x38d7a3['countbusyretry']+_0x38d7a3[_0x5901('0xc')]+_0x38d7a3[_0x5901('0xd')]+_0x38d7a3[_0x5901('0xf')]+_0x38d7a3[_0x5901('0x10')]+_0x38d7a3['countabandonedretry']+_0x38d7a3[_0x5901('0x11')]+_0x38d7a3[_0x5901('0x12')];this[_0x5901('0xf')]=_0x38d7a3[_0x5901('0xf')];this['countdropretry']=_0x38d7a3['countdropretry'];this[_0x5901('0x13')]=_0x38d7a3[_0x5901('0x13')];this[_0x5901('0x11')]=_0x38d7a3[_0x5901('0x11')];this['countagentrejectretry']=_0x38d7a3[_0x5901('0x12')];this['uniqueid']=_0xe9e39d[_0x5901('0x14')];this[_0x5901('0x15')]=_0x38d7a3['name'];this['calleridnum']=_0x38d7a3[_0x5901('0x16')];this[_0x5901('0x17')]=_0x38d7a3[_0x5901('0x17')];this[_0x5901('0x18')]=_0x38d7a3[_0x5901('0x18')];this[_0x5901('0x19')]=moment()[_0x5901('0x1a')](_0x5901('0x1b'));this[_0x5901('0x1c')]=getSeconds(_0x38d7a3['responsetime'],_0x38d7a3[_0x5901('0x17')]);this[_0x5901('0x1d')]=0x0;this['talktime']=getSeconds(this[_0x5901('0x19')],_0x38d7a3[_0x5901('0x18')]);this['queue']=_0x38d7a3[_0x5901('0x1e')];this['membername']=_0x5901('0x1f');this['reason']=_0xe9e39d[_0x5901('0x20')];this[_0x5901('0x21')]=_0x38d7a3['callback'];this['callbackuniqueid']=_0x38d7a3[_0x5901('0x22')];this['callbackat']=_0x38d7a3[_0x5901('0x23')];this[_0x5901('0x24')]=_0x38d7a3[_0x5901('0x24')];this[_0x5901('0x25')]=_0x38d7a3[_0x5901('0x25')];this[_0x5901('0x26')]=_0x38d7a3[_0x5901('0x26')];this[_0x5901('0x27')]=_0x38d7a3[_0x5901('0x27')];this[_0x5901('0x28')]=_0x38d7a3[_0x5901('0x28')];this[_0x5901('0x29')]=_0x38d7a3[_0x5901('0x29')];}module[_0x5901('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 1344fc1..de994dd 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97f6=['originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x1e1b71,_0x1458a3){var _0x142f06=function(_0xc5039d){while(--_0xc5039d){_0x1e1b71['push'](_0x1e1b71['shift']());}};_0x142f06(++_0x1458a3);}(_0x97f6,0x173));var _0x697f=function(_0x4d62c0,_0x481b21){_0x4d62c0=_0x4d62c0-0x0;var _0x4014d9=_0x97f6[_0x4d62c0];return _0x4014d9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x697f('0x0'));function getSeconds(_0x1a7119,_0x14eb2a){var _0x34a748=moment(_0x1a7119)['milliseconds'](0x0);var _0x44f6df=moment(_0x14eb2a)[_0x697f('0x1')](0x0);return _0x34a748[_0x697f('0x2')](_0x44f6df,_0x697f('0x3'));}function History(_0x457558){this['uniqueid']=_0x457558[_0x697f('0x4')];this[_0x697f('0x5')]=_0x457558['scheduledat']||undefined;this[_0x697f('0x6')]=_0x457558[_0x697f('0x6')];this['campaigntype']=_0x457558[_0x697f('0x6')]===_0x697f('0x7')?'queue':_0x457558['type'];this['countbusyretry']=_0x457558[_0x697f('0x8')];this[_0x697f('0x9')]=_0x457558[_0x697f('0x9')];this['countnoanswerretry']=_0x457558[_0x697f('0xa')];this[_0x697f('0xb')]=_0x457558[_0x697f('0x8')]+_0x457558[_0x697f('0x9')]+_0x457558[_0x697f('0xa')]+_0x457558[_0x697f('0xc')]+_0x457558[_0x697f('0xd')]+_0x457558[_0x697f('0xe')]+_0x457558[_0x697f('0xf')]+_0x457558[_0x697f('0x10')];this['countnosuchnumberretry']=_0x457558[_0x697f('0xc')];this[_0x697f('0xd')]=_0x457558[_0x697f('0xd')];this['countabandonedretry']=_0x457558['countabandonedretry'];this[_0x697f('0xf')]=_0x457558[_0x697f('0xf')];this['countagentrejectretry']=_0x457558['countagentrejectretry'];this[_0x697f('0x11')]=_0x457558[_0x697f('0x11')];this[_0x697f('0x12')]=_0x457558[_0x697f('0x13')];this['calleridnum']=_0x457558[_0x697f('0x14')];this[_0x697f('0x15')]=_0x457558[_0x697f('0x15')];this[_0x697f('0x16')]=_0x457558[_0x697f('0x16')];this[_0x697f('0x17')]=_0x457558[_0x697f('0x16')];this[_0x697f('0x18')]=getSeconds(_0x457558[_0x697f('0x16')],_0x457558[_0x697f('0x15')]);this[_0x697f('0x19')]=0x0;this[_0x697f('0x1a')]=0x0;this[_0x697f('0x1b')]=_0x457558[_0x697f('0x1b')];this[_0x697f('0x1c')]=_0x457558['callbackuniqueid'];this[_0x697f('0x1d')]=_0x457558['callbackat'];this[_0x697f('0x1e')]=_0x457558[_0x697f('0x1e')];this['ContactId']=_0x457558['ContactId'];this[_0x697f('0x1f')]=_0x457558[_0x697f('0x1f')];this[_0x697f('0x20')]=_0x457558[_0x697f('0x20')];this[_0x697f('0x21')]=_0x457558[_0x697f('0x21')];this[_0x697f('0x22')]=_0x457558[_0x697f('0x22')];this[_0x697f('0x23')]=_0x457558[_0x697f('0x23')]||'';this[_0x697f('0x24')]=_0x457558[_0x697f('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0xa66d=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','starttime'];(function(_0x50a630,_0x5e5243){var _0x277aa1=function(_0xe90680){while(--_0xe90680){_0x50a630['push'](_0x50a630['shift']());}};_0x277aa1(++_0x5e5243);}(_0xa66d,0xee));var _0xda66=function(_0x81e1f5,_0x30f876){_0x81e1f5=_0x81e1f5-0x0;var _0x18a31d=_0xa66d[_0x81e1f5];return _0x18a31d;};'use strict';var util=require(_0xda66('0x0'));var _=require(_0xda66('0x1'));var moment=require(_0xda66('0x2'));function getSeconds(_0x64d780,_0x173edf){var _0x1ba563=moment(_0x64d780)[_0xda66('0x3')](0x0);var _0x33d04c=moment(_0x173edf)[_0xda66('0x3')](0x0);return _0x1ba563[_0xda66('0x4')](_0x33d04c,_0xda66('0x5'));}function History(_0xf9e822){this[_0xda66('0x6')]=_0xf9e822[_0xda66('0x6')];this[_0xda66('0x7')]=_0xf9e822[_0xda66('0x7')]||undefined;this[_0xda66('0x8')]=_0xf9e822[_0xda66('0x8')];this[_0xda66('0x9')]=_0xf9e822[_0xda66('0x8')]==='outbound'?_0xda66('0xa'):_0xf9e822[_0xda66('0x8')];this['countbusyretry']=_0xf9e822['countbusyretry'];this[_0xda66('0xb')]=_0xf9e822['countcongestionretry'];this[_0xda66('0xc')]=_0xf9e822[_0xda66('0xc')];this['countglobal']=_0xf9e822[_0xda66('0xd')]+_0xf9e822[_0xda66('0xb')]+_0xf9e822[_0xda66('0xc')]+_0xf9e822[_0xda66('0xe')]+_0xf9e822[_0xda66('0xf')]+_0xf9e822[_0xda66('0x10')]+_0xf9e822[_0xda66('0x11')]+_0xf9e822[_0xda66('0x12')];this[_0xda66('0xe')]=_0xf9e822['countnosuchnumberretry'];this[_0xda66('0xf')]=_0xf9e822['countdropretry'];this['countabandonedretry']=_0xf9e822['countabandonedretry'];this[_0xda66('0x11')]=_0xf9e822[_0xda66('0x11')];this[_0xda66('0x12')]=_0xf9e822['countagentrejectretry'];this[_0xda66('0xa')]=_0xf9e822[_0xda66('0xa')];this['calleridname']=_0xf9e822['name'];this[_0xda66('0x13')]=_0xf9e822['number'];this[_0xda66('0x14')]=_0xf9e822[_0xda66('0x14')];this[_0xda66('0x15')]=_0xf9e822[_0xda66('0x15')];this[_0xda66('0x16')]=_0xf9e822[_0xda66('0x15')];this[_0xda66('0x17')]=getSeconds(_0xf9e822['responsetime'],_0xf9e822[_0xda66('0x14')]);this[_0xda66('0x18')]=0x0;this[_0xda66('0x19')]=0x0;this[_0xda66('0x1a')]=_0xf9e822[_0xda66('0x1a')];this[_0xda66('0x1b')]=_0xf9e822[_0xda66('0x1b')];this['callbackat']=_0xf9e822['callbackat'];this['recallme']=_0xf9e822[_0xda66('0x1c')];this['ContactId']=_0xf9e822[_0xda66('0x1d')];this[_0xda66('0x1e')]=_0xf9e822['ListId'];this[_0xda66('0x1f')]=_0xf9e822[_0xda66('0x1f')];this[_0xda66('0x20')]=_0xf9e822[_0xda66('0x20')];this[_0xda66('0x21')]=_0xf9e822['CampaignId'];this[_0xda66('0x22')]=_0xf9e822[_0xda66('0x22')]||'';this[_0xda66('0x23')]=_0xf9e822[_0xda66('0x23')]||'';}module[_0xda66('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 59bc19c..a176d19 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 _0x5cd8=['isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','voice_queue:save','format','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','actions','[actions]','clearZombieChannels','enqueue','Action','channel','catch','updateOriginated','queue','countReScheduled','[countReScheduled]\x20','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','notFound','saveInDb','merge','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','calleridname','calleridnum','[syncAgentComplete][createHistory][11]','actionid','stateinterface','locked','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','dialPredictiveInterval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','checkIsBlackList','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Error','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals'];(function(_0x38dba5,_0x5d26bd){var _0x2e575d=function(_0x404331){while(--_0x404331){_0x38dba5['push'](_0x38dba5['shift']());}};_0x2e575d(++_0x5d26bd);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x2129d5,_0x1aedc5){_0x2129d5=_0x2129d5-0x0;var _0x1cebda=_0x5cd8[_0x2129d5];return _0x1cebda;};'use strict';var util=require(_0x85cd('0x0'));var _=require('lodash');var BPromise=require(_0x85cd('0x1'));var uuid=require(_0x85cd('0x2'));var moment=require(_0x85cd('0x3'));var rr=require('rr');var md5=require(_0x85cd('0x4'));var Redis=require('ioredis');var ut=require(_0x85cd('0x5'));var config=require('../../../config/environment/');var logger=require(_0x85cd('0x6'))(_0x85cd('0x7'));var loggerBooked=require(_0x85cd('0x6'))(_0x85cd('0x8'));var loggerPredictive=require(_0x85cd('0x6'))('predictive');var loggerPredictiveCalls=require(_0x85cd('0x6'))(_0x85cd('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x85cd('0xa'));var ami=require(_0x85cd('0xb'));config[_0x85cd('0xc')]=_[_0x85cd('0xd')](config[_0x85cd('0xc')],{'host':_0x85cd('0xe'),'port':0x18eb});var io=require(_0x85cd('0xf'))(new Redis(config[_0x85cd('0xc')]));var cmHopper=require(_0x85cd('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x85cd('0x11'));var Action=require(_0x85cd('0x12'));var History=require(_0x85cd('0x13'));var Final=require(_0x85cd('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x85cd('0x15'));var Hangup=require(_0x85cd('0x16'));var ipAgi=process[_0x85cd('0x17')][_0x85cd('0x18')]||_0x85cd('0x19');var strategy={'rrmemory':_0x85cd('0x1a'),'roundrobin':_0x85cd('0x1b')};var Sequence=function(){};Sequence[_0x85cd('0x1c')]['enqueue']=function(_0x20cccf){this[_0x85cd('0x1d')]=this[_0x85cd('0x1d')]?this[_0x85cd('0x1d')][_0x85cd('0x1e')](_0x20cccf):_0x20cccf();};function Dialer(_0x5219ac,_0x441505){this['sequence']=new Sequence();this[_0x85cd('0x1f')]=_0x441505;this['voiceQueues']=_0x5219ac[_0x85cd('0x20')];this['campaigns']=_0x5219ac[_0x85cd('0x21')];this[_0x85cd('0x22')]=_0x5219ac[_0x85cd('0x22')];this[_0x85cd('0x23')]=_0x5219ac[_0x85cd('0x23')];this[_0x85cd('0x24')]=config[_0x85cd('0x24')]||0x2;this[_0x85cd('0x25')]={};this['actions']={};this[_0x85cd('0x26')]={};this[_0x85cd('0x27')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0x85cd('0x28')]={};this['queueBookedRR']={};ami['on'](_0x85cd('0x29'),this[_0x85cd('0x2a')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2c'),this['syncQueueCallerAbandon'][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2d'),this[_0x85cd('0x2e')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x2f'),this[_0x85cd('0x30')]['bind'](this));ami['on'](_0x85cd('0x31'),this[_0x85cd('0xa')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x32'),this['syncHangup'][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x33'),this[_0x85cd('0x34')]['bind'](this));ami['on']('varset',this[_0x85cd('0x35')]['bind'](this));ami['on'](_0x85cd('0x36'),this[_0x85cd('0x37')][_0x85cd('0x2b')](this));ami['on'](_0x85cd('0x38'),this['syncQueueStatusComplete'][_0x85cd('0x2b')](this));this[_0x85cd('0x39')]();this[_0x85cd('0x3a')]();}function isNotNull(_0x34cb51){return _0x34cb51!==null&&!_['isUndefined'](_0x34cb51);}function checkIsLoggedIn(_0x331415,_0x1334c1){return function(){if(_0x1334c1<=0x0){_0x331415[_0x85cd('0x3b')]='AGENTS_NOT_LOGGED';throw _0x331415['name']+_0x85cd('0x3c');}};}function isActive(_0x313346){return _0x313346;}function checkIsActive(_0x45b981,_0x152a54){return function(){if(!isActive(_0x152a54)){_0x45b981[_0x85cd('0x3b')]=_0x85cd('0x3d');throw _0x45b981[_0x85cd('0x3e')]+_0x85cd('0x3f');}};}function checkInterval(_0x564ca0){return function(){if(!isNotNull(_0x564ca0[_0x85cd('0x40')])){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x564ca0[_0x85cd('0x40')][_0x85cd('0x42')])){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x85cd('0x43')](_0x564ca0[_0x85cd('0x40')]['Intervals']))){_0x564ca0[_0x85cd('0x3b')]=_0x85cd('0x41');throw _0x564ca0[_0x85cd('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x48a04e,_0x2c7b30,_0x25e998){return{'action':_0x48a04e,'response':_0x2c7b30,'message':_0x25e998,'stack':_0x25e998};}function myreject(_0x4fc244){return function(_0x562b05){return _0x4fc244(msgResponse(_0x85cd('0x44'),'Error',JSON['stringify'](_0x562b05)));};}function getSeconds(_0x10f3a3,_0x1d0585){var _0x8e683f=moment(_0x10f3a3)[_0x85cd('0x45')](0x0);var _0x662a87=moment(_0x1d0585)[_0x85cd('0x45')](0x0);return _0x8e683f[_0x85cd('0x46')](_0x662a87,_0x85cd('0x47'));}function emit(_0x3c2a47,_0x1589bb,_0x26a672){io['to'](_0x3c2a47)[_0x85cd('0x48')](_0x1589bb,_0x26a672);}function emitVoiceQueueSummary(_0x460737){if(_0x460737[_0x85cd('0x49')]===_0x85cd('0x4a')){var _0x4d16bf={'id':_0x460737['id'],'name':_0x460737[_0x85cd('0x3e')],'strategy':_0x460737[_0x85cd('0x4b')],'answered':_0x460737[_0x85cd('0x4c')],'available':_0x460737[_0x85cd('0x4d')],'loggedIn':_0x460737[_0x85cd('0x4e')],'pTalking':_0x460737[_0x85cd('0x4f')],'sumBillable':_0x460737[_0x85cd('0x50')],'sumDuration':_0x460737[_0x85cd('0x51')],'sumHoldTime':_0x460737[_0x85cd('0x52')]||0x0,'talking':_0x460737[_0x85cd('0x53')],'total':_0x460737[_0x85cd('0x54')],'type':_0x460737['type'],'unmanaged':_0x460737['unmanaged'],'abandoned':_0x460737[_0x85cd('0x55')],'waiting':_0x460737[_0x85cd('0x56')],'loggedInDb':_0x460737[_0x85cd('0x57')],'dialActive':_0x460737[_0x85cd('0x58')],'dialMethod':_0x460737['dialMethod'],'dialOriginateCallerIdName':_0x460737[_0x85cd('0x59')],'dialOriginateCallerIdNumber':_0x460737[_0x85cd('0x5a')],'dialOriginateTimeout':_0x460737[_0x85cd('0x5b')],'dialPrefix':_0x460737['dialPrefix'],'outboundAnswerAgiCallsDay':_0x460737[_0x85cd('0x5c')],'outboundAnswerCallsDay':_0x460737[_0x85cd('0x5d')],'outboundBlacklistCallsDay':_0x460737[_0x85cd('0x5e')],'outboundBusyCallsDay':_0x460737[_0x85cd('0x5f')],'outboundCongestionCallsDay':_0x460737[_0x85cd('0x60')],'outboundDropCallsDayACS':_0x460737[_0x85cd('0x61')],'outboundDropCallsDayCallersExit':_0x460737['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x460737['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x460737[_0x85cd('0x62')],'outboundNoSuchCallsDay':_0x460737[_0x85cd('0x63')],'outboundOriginateFailureCallsDay':_0x460737[_0x85cd('0x64')],'outboundReCallsDay':_0x460737['outboundReCallsDay'],'outboundRejectCallsDay':_0x460737[_0x85cd('0x65')],'outboundUnknownCallsDay':_0x460737[_0x85cd('0x66')],'predictiveIntervalAnsweredCalls':_0x460737[_0x85cd('0x67')],'predictiveIntervalAvgHoldtime':_0x460737['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x460737[_0x85cd('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x460737['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x460737['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x460737[_0x85cd('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x460737[_0x85cd('0x6a')],'predictiveIntervalHitRate':_0x460737[_0x85cd('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x460737[_0x85cd('0x6c')],'predictiveIntervalPauses':_0x460737[_0x85cd('0x6d')],'predictiveIntervalAvailable':_0x460737[_0x85cd('0x6e')],'predictiveIntervalTotalCalls':_0x460737['predictiveIntervalTotalCalls'],'message':_0x460737[_0x85cd('0x3b')],'originated':_0x460737[_0x85cd('0x6f')],'erlangCalls':_0x460737[_0x85cd('0x70')],'erlangCallToSecond':_0x460737[_0x85cd('0x71')],'erlangAbandonmentRate':_0x460737[_0x85cd('0x72')],'erlangBusyFactor':_0x460737[_0x85cd('0x73')],'startPredictive':_0x460737[_0x85cd('0x74')],'startProgressive':_0x460737[_0x85cd('0x75')]};if(_0x460737['Trunk']){_0x4d16bf['Trunk']={'id':_0x460737[_0x85cd('0x76')]['id'],'name':_0x460737[_0x85cd('0x76')][_0x85cd('0x3e')],'active':_0x460737[_0x85cd('0x76')][_0x85cd('0x77')],'callerid':_0x460737[_0x85cd('0x76')]['callerid']};}if(_0x460737[_0x85cd('0x40')]){_0x4d16bf[_0x85cd('0x40')]={'id':_0x460737[_0x85cd('0x40')]['id'],'name':_0x460737['Interval']['name']};}var _0x5a746c=md5(JSON['stringify'](_0x4d16bf));if(_0x460737['md5']!==_0x5a746c){_0x460737[_0x85cd('0x4')]=_0x5a746c;emit(util['format']('voice:queue:%s',_0x4d16bf[_0x85cd('0x3e')]),_0x85cd('0x78'),_0x4d16bf);}}}function emitCampaignSummary(_0x2573cf){if(_0x2573cf[_0x85cd('0x49')]==='ivr'){emit(util[_0x85cd('0x79')](_0x85cd('0x7a'),_0x2573cf['name']),'campaign:save',_0x2573cf);}}function checkGetDataPredictive(_0x250f50){if(isNotNull(_0x250f50)&&!_['isEmpty'](_0x250f50)){loggerPredictive[_0x85cd('0x7b')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x7c'),_0x250f50[_0x85cd('0x7d')]);loggerPredictive['info'](_0x85cd('0x7e'),_0x250f50[_0x85cd('0x67')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x7f'),_0x250f50['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x80'),_0x250f50['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x85cd('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250f50[_0x85cd('0x81')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x82'),_0x250f50[_0x85cd('0x68')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));if(_0x250f50['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x250f50[_0x85cd('0x68')])&&_0x250f50[_0x85cd('0x68')]>0x0){return!![];}loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x84'));if(!_['isUndefined'](_0x250f50[_0x85cd('0x81')])&&_0x250f50[_0x85cd('0x81')]>0x0){return!![];}loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x85'));}else{loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x86'));}}else{loggerPredictive[_0x85cd('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x49ca42){return function(_0x1d3505){loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x87'));loggerPredictive[_0x85cd('0x7b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x70')]);loggerPredictive[_0x85cd('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x71')]);loggerPredictive[_0x85cd('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d3505[_0x85cd('0x72')]);loggerPredictive['info'](_0x85cd('0x88'),_0x1d3505[_0x85cd('0x73')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x89'),_0x1d3505[_0x85cd('0x72')]);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));_['merge'](_0x49ca42,_0x1d3505);};}function getDiff(_0x52b30a){var _0x2343cf=moment()[_0x85cd('0x45')](0x0);var _0x5b1c19=moment(_0x52b30a)[_0x85cd('0x45')](0x0);return _0x2343cf[_0x85cd('0x46')](_0x5b1c19,_0x85cd('0x47'));}function ifInterval(_0x2f2bfd,_0x1f6f18){if(_['isUndefined'](_0x1f6f18)){return![];}return getDiff(_0x1f6f18)<_0x2f2bfd*0x3c;}function freeVariablesPredictive(_0x1d40ad){if(isNotNull(_0x1d40ad)){if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x75')])){_0x1d40ad[_0x85cd('0x75')]=undefined;loggerPredictive[_0x85cd('0x7b')](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8b'));}if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x74')])){_0x1d40ad['startPredictive']=undefined;loggerPredictive['info'](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8c'));}if(!_[_0x85cd('0x8a')](_0x1d40ad[_0x85cd('0x8d')])){clearInterval(_0x1d40ad[_0x85cd('0x8d')]);_0x1d40ad[_0x85cd('0x8d')]=undefined;loggerPredictive['info'](_0x1d40ad[_0x85cd('0x3e')],_0x85cd('0x8e'));}}}function erlangb(_0x87668e,_0x5eb538){if(_0x5eb538===0x0){return 0x0;}var _0x445011=0x1;for(var _0x5634bb=0x1;_0x5634bb<=_0x5eb538;_0x5634bb+=0x1){_0x445011=0x1+_0x445011*_0x5634bb/_0x87668e;}return 0x1/_0x445011;}function isVoiceQueueOutbound(_0x7f7725){return _0x7f7725===_0x85cd('0x4a');}function isNotPreview(_0x225b28){return _0x225b28!==_0x85cd('0x1f');}function isCampaignIvr(_0x151eb9){return _0x151eb9===_0x85cd('0x8f');}function getCallerId(_0x3c9d56,_0x2cb914,_0x1764ac){if(!_[_0x85cd('0x8a')](_0x1764ac)&&typeof _0x1764ac==='string'&&!_[_0x85cd('0x43')](_0x1764ac)){if(!_[_0x85cd('0x8a')](_0x2cb914)&&typeof _0x2cb914===_0x85cd('0x90')&&!_[_0x85cd('0x43')](_0x2cb914)){return util[_0x85cd('0x79')](_0x85cd('0x91'),_0x2cb914,_0x1764ac);}return util[_0x85cd('0x79')](_0x85cd('0x91'),_0x1764ac,_0x1764ac);}if(!_[_0x85cd('0x8a')](_0x3c9d56)&&typeof _0x3c9d56===_0x85cd('0x90')&&!_[_0x85cd('0x43')](_0x3c9d56)){return _0x3c9d56;}return _0x85cd('0x92');}function loggerCatchQueueSummary(_0x43ea99,_0x790f50){return function(_0x171437){freeVariablesPredictive(_0x790f50);emitVoiceQueueSummary(_0x790f50);emitCampaignSummary(_0x790f50);loggerSyncQueueSummary[_0x85cd('0x93')](_0x43ea99,util['inspect'](_0x171437,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4963c7,_0xe7a662){return function(_0x73bc88){loggerPredictive[_0x85cd('0x93')](_0xe7a662['name'],_0x4963c7);loggerPredictive['error'](_0x73bc88[_0x85cd('0x94')]);freeVariablesPredictive(_0xe7a662);};}function loggerCatch(_0x358500){return function(_0x39d712){logger[_0x85cd('0x93')](_0x358500,util[_0x85cd('0x95')](_0x39d712,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5cf24a){return _0x5cf24a&&!_[_0x85cd('0x8a')](_0x5cf24a)&&_0x5cf24a[_0x85cd('0x96')]>0x0;}function decremetOriginate(_0x45d1e9){if(!_['isUndefined'](_0x45d1e9)&&_0x45d1e9!==null){if(typeof _0x45d1e9['originated']!==_0x85cd('0x97')){if(_0x45d1e9[_0x85cd('0x6f')]>0x0){_0x45d1e9[_0x85cd('0x6f')]-=0x1;}else{logger[_0x85cd('0x93')](_0x85cd('0x98'));}}}else{logger[_0x85cd('0x93')](_0x85cd('0x99'));}}function checkContactLowerLimitOriginate(_0x34373a,_0xcb1c10,_0x156626){if(_0xcb1c10>_0x156626){for(var _0x45cda4=0x0;_0x45cda4<_0xcb1c10-_0x156626;_0x45cda4+=0x1){decremetOriginate(_0x34373a);}}}function loggerGetContactDialer(_0x23cec7,_0x3523a8,_0x49e34e){return function(_0x40f0e4){checkContactLowerLimitOriginate(_0x3523a8,_0x49e34e,0x0);logger[_0x85cd('0x93')](_0x23cec7,util['inspect'](_0x40f0e4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c9385){return function(_0xf5d519){if(isNotNull(_0xf5d519)&&isNotNull(_0xf5d519[0x0])){if(_0xf5d519[0x0][_0x85cd('0x9a')]>0x0){_0x3c9385[_0x85cd('0x3b')]=_0x85cd('0x9b');logger['info']('[getContactDialer2][ReScheduled]'+_0x3c9385[_0x85cd('0x3e')],_0xf5d519[0x0][_0x85cd('0x9a')],'contacts');}else{_0x3c9385[_0x85cd('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x85cd('0x7b')](_0x85cd('0x9c')+_0x3c9385[_0x85cd('0x3e')]);}}};}function notSendMessagesQueue(_0x2237d7){if(_0x2237d7[_0x85cd('0x9d')]){freeVariablesPredictive(_0x2237d7);if(_0x2237d7[_0x85cd('0x6f')]===0x0&&_0x2237d7[_0x85cd('0x53')]===0x0&&_0x2237d7[_0x85cd('0x56')]===0x0&&(_0x2237d7['pTalking']||0x0)===0x0){_0x2237d7[_0x85cd('0x9d')]=![];_0x2237d7[_0x85cd('0x4d')]=0x0;_0x2237d7[_0x85cd('0x3b')]=_0x85cd('0x3d');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2237d7[_0x85cd('0x3e')],_0x85cd('0x9e'));}else{_0x2237d7[_0x85cd('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x85cd('0x93')](_0x85cd('0x9f'),_0x2237d7['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x2237d7);}}function notSendMessagesCampaign(_0x4ee4ce){if(_0x4ee4ce[_0x85cd('0x9d')]){if(_0x4ee4ce[_0x85cd('0x6f')]===0x0){_0x4ee4ce[_0x85cd('0x9d')]=![];_0x4ee4ce[_0x85cd('0x3b')]=_0x85cd('0x3d');loggerSyncQueueSummary[_0x85cd('0x93')](_0x85cd('0xa0'),_0x4ee4ce[_0x85cd('0x3e')],_0x85cd('0x9e'));}else{_0x4ee4ce[_0x85cd('0x3b')]=_0x85cd('0xa1');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4ee4ce[_0x85cd('0x3e')],_0x85cd('0xa2'));}emitCampaignSummary(_0x4ee4ce);}}function createObjHistory(_0xc45d67,_0x56320b,_0x3d0498,_0x538fb9,_0x1a8f8b){_0xc45d67[_0x85cd('0x3b')]=_0x3d0498;var _0x118aab=new Action(_0xc45d67,_0x56320b);var _0x1cff92=new History(_0x118aab);_0x1cff92[_0x85cd('0xa3')]=_0x538fb9;_0x1cff92[_0x85cd('0xa4')]=_0x1a8f8b;_0x1cff92[_0x85cd('0xa5')]=_0x118aab['starttime'];return _0x1cff92;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x183a43=this;setInterval(function(){_0x183a43['clearZombieChannels'](_0x183a43[_0x85cd('0x27')],'[uniqueid]');_0x183a43['clearZombieChannels'](_0x183a43[_0x85cd('0xa6')],_0x85cd('0xa7'));},0x32c8);};Dialer[_0x85cd('0x1c')][_0x85cd('0xa8')]=function(_0x471740,_0x4dc691){var _0x5b6736=this;for(var _0x50d6da in _0x471740){if(typeof _0x471740[_0x50d6da]!==_0x85cd('0x97')){this['sequence'][_0x85cd('0xa9')](function(){if(!_['isNil'](_0x471740[_0x50d6da])){return ami[_0x85cd('0xaa')]({'action':'status','channel':_0x471740[_0x50d6da][_0x85cd('0xab')]})[_0x85cd('0xac')](function(_0xc332ff){if(_0xc332ff[_0x85cd('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x471740[_0x50d6da]&&_0x471740[_0x50d6da][_0x85cd('0x49')]!=='ivr'){_0x5b6736[_0x85cd('0xad')](_0x5b6736[_0x85cd('0x20')][_0x471740[_0x50d6da][_0x85cd('0xae')]]);logger[_0x85cd('0x93')]('[Dialer][checkChannel]',_0x4dc691,_0x50d6da,_0x471740[_0x50d6da]['queue']);delete _0x471740[_0x50d6da];}if(_0x471740[_0x50d6da]&&_0x471740[_0x50d6da][_0x85cd('0x49')]===_0x85cd('0x8f')){_0x5b6736['updateOriginated'](_0x5b6736[_0x85cd('0x21')][_0x471740[_0x50d6da][_0x85cd('0xae')]]);logger[_0x85cd('0x93')]('[Dialer][checkChannel][ivr]',_0x4dc691,_0x50d6da,_0x471740[_0x50d6da]['queue']);delete _0x471740[_0x50d6da];}},0x2328);}});}});}}};Dialer[_0x85cd('0x1c')][_0x85cd('0xaf')]=function(_0x91d6f5){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x91d6f5))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb0')));};Dialer[_0x85cd('0x1c')]['checkIsBlackList']=function(_0x382004){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperBlack['checkIsBlackList'](_0x382004))['catch'](loggerCatch(_0x85cd('0xb3')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb4')]=function(_0x3bcf77){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperBlack[_0x85cd('0xb4')](_0x3bcf77))[_0x85cd('0xac')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x85cd('0x1c')]['averageHandleTime']=function(_0x374171){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperHistory['avgHandleTime'](_0x374171))[_0x85cd('0xac')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb5')]=function(_0x570aa3){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xb5')](_0x570aa3))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb6')));};Dialer['prototype'][_0x85cd('0xb7')]=function(_0x4a1b55,_0x218c1e,_0x45cf9e){return BPromise['resolve']()['then'](cmHopper[_0x85cd('0xb7')](_0x4a1b55,_0x218c1e,_0x45cf9e))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb8')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xb9')]=function(_0x386223,_0x2a5213,_0x4a26a5,_0x63b4ab,_0xf49804){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xb9')](_0x386223,_0x2a5213,_0x4a26a5,_0x63b4ab))[_0x85cd('0xac')](function(_0x280de3){_0xf49804[_0x85cd('0xba')]-=_0x4a26a5;_0xf49804['temp']=_0xf49804[_0x85cd('0xba')]>0x0?_0xf49804['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x280de3);});};Dialer[_0x85cd('0x1c')][_0x85cd('0xbb')]=function(_0x4fcdac,_0x10e650,_0x42c6d8,_0x41be62){return BPromise['resolve']()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xbb')](_0x4fcdac,_0x10e650,_0x42c6d8))[_0x85cd('0xac')](function(_0x34f0ea){_0x41be62[_0x85cd('0xba')]-=_0x10e650;_0x41be62[_0x85cd('0xba')]=_0x41be62[_0x85cd('0xba')]>0x0?_0x41be62[_0x85cd('0xba')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x34f0ea);});};Dialer[_0x85cd('0x1c')][_0x85cd('0xbc')]=function(_0x579116){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](voiceQueueRt['getVoiceQueueRtPauses'](_0x579116))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xbd')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xbe')]=function(_0x3da1c4){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopper[_0x85cd('0xbe')](_0x3da1c4))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xbf')));};Dialer[_0x85cd('0x1c')][_0x85cd('0xc0')]=function(_0x3ce991){return BPromise[_0x85cd('0xb1')]()[_0x85cd('0xb2')](cmHopperHistory[_0x85cd('0xc0')](_0x3ce991))['catch'](loggerCatch(_0x85cd('0xc1')));};Dialer['prototype'][_0x85cd('0xad')]=function(_0x582b9c){if(!_[_0x85cd('0x8a')](_0x582b9c)&&_0x582b9c!==null){if(typeof _0x582b9c['originated']!==_0x85cd('0x97')){if(_0x582b9c[_0x85cd('0x6f')]>0x0){_0x582b9c['originated']-=0x1;}else{logger[_0x85cd('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x85cd('0x93')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x85cd('0x1c')]['loggerHandler']=function(_0x2a374b,_0x28917c){var _0x2b6065=this;return function(_0x21072c){_0x2b6065[_0x85cd('0xad')](_0x28917c);logger[_0x85cd('0x93')](_0x2a374b,util[_0x85cd('0x95')](_0x21072c,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x166397,_0x58db59,_0x356672){var _0x385bab={'state':0x19,'statedesc':_0x85cd('0xc2')};this[_0x85cd('0xad')](_0x58db59);this[_0x85cd('0xc3')](_[_0x85cd('0xc4')](_0x385bab,_[_0x85cd('0xc5')](_0x356672,[_0x85cd('0xc6'),_0x85cd('0xc7'),'UserId',_0x85cd('0xc8'),_0x85cd('0xc9')])),_0x85cd('0xca'),_0x85cd('0xcb'));logger[_0x85cd('0x93')](_0x166397);};Dialer[_0x85cd('0x1c')][_0x85cd('0xcc')]=function(_0x235175){return _0x235175==='Success';};Dialer[_0x85cd('0x1c')][_0x85cd('0xcd')]=function(_0x310887){return!_['isUndefined'](_0x310887)&&_0x310887&&!_[_0x85cd('0x8a')](_0x310887['name'])&&!_['isUndefined'](_0x310887['active'])&&_0x310887[_0x85cd('0x77')]&&(this[_0x85cd('0x23')][util[_0x85cd('0x79')](_0x85cd('0xce'),_0x310887['name'])][_0x85cd('0xcf')]===_0x85cd('0xd0')||this[_0x85cd('0x23')][util['format'](_0x85cd('0xce'),_0x310887[_0x85cd('0x3e')])][_0x85cd('0xcf')]===_0x85cd('0xd1'));};Dialer[_0x85cd('0x1c')][_0x85cd('0xc3')]=function(_0x3a63bb,_0x5f3818,_0x42c522){this[_0x85cd('0xc0')](_0x3a63bb)[_0x85cd('0xac')](loggerCatch(_0x5f3818));this[_0x85cd('0xbe')](_0x3a63bb)[_0x85cd('0xac')](loggerCatch(_0x42c522));};Dialer[_0x85cd('0x1c')][_0x85cd('0x35')]=function(_0x1e5344){var _0x68c0e0=this[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];var _0x3de344;if(!_[_0x85cd('0xd3')](_0x1e5344)&&!_[_0x85cd('0xd3')](_0x1e5344[_0x85cd('0xd4')])&&!_['isNil'](_0x1e5344[_0x85cd('0xd4')][_0x85cd('0xd5')])&&_0x1e5344[_0x85cd('0xd6')]===_0x85cd('0xd7')&&_0x68c0e0){if(_0x68c0e0[_0x85cd('0x49')]!=='ivr'&&this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]===_0x85cd('0xda')){delete this[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]);this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x68c0e0['queue']][_0x85cd('0x5c')]+=0x1;_0x3de344=new Hangup(_0x68c0e0,_0x1e5344);_0x3de344[_0x85cd('0xa3')]=0x12;_0x3de344[_0x85cd('0xa4')]=_0x85cd('0xdb');_0x3de344['membername']=_0x85cd('0xdc');ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x3de344,_0x85cd('0xdf')));this[_0x85cd('0xc3')](_0x3de344,_0x85cd('0xe0'),_0x85cd('0xe1'));}if(_0x68c0e0['type']!==_0x85cd('0x8f')&&this[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344['value']===_0x85cd('0xe2')){var _0x2492fe=this;return new BPromise(function(_0xcc7c31,_0x2ee2dc){delete _0x2492fe[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];_0x2492fe[_0x85cd('0xad')](_0x2492fe[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]]);_0x2492fe['voiceQueues'][_0x68c0e0['queue']]['outboundAnswerCallsDay']+=0x1;_0x2492fe[_0x85cd('0x20')][_0x68c0e0['queue']][_0x85cd('0x5c')]+=0x1;var _0x10bb14=_0x2492fe[_0x85cd('0x20')][_0x68c0e0[_0x85cd('0xae')]];var _0x4cb4f0=new Hangup(_0x68c0e0,_0x1e5344);_0x4cb4f0[_0x85cd('0xa3')]=0x13;_0x4cb4f0['statedesc']='Machine';_0x4cb4f0[_0x85cd('0xe3')]=_0x85cd('0xdc');_0x4cb4f0[_0x85cd('0xe4')]+=0x1;_0x4cb4f0[_0x85cd('0xe5')]+=0x1;_0x4cb4f0['amd']=!![];ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x4cb4f0,_0x85cd('0xdf')));_0x2492fe[_0x85cd('0xc0')](_0x4cb4f0)['catch'](loggerCatch(_0x85cd('0xe6')));if(_0x4cb4f0['countbusyretry']+_0x4cb4f0[_0x85cd('0xe7')]+_0x4cb4f0[_0x85cd('0xe8')]+_0x4cb4f0[_0x85cd('0xe9')]+_0x4cb4f0[_0x85cd('0xea')]+_0x4cb4f0[_0x85cd('0xeb')]+_0x4cb4f0[_0x85cd('0xe4')]+_0x4cb4f0[_0x85cd('0xec')]>=_0x10bb14[_0x85cd('0xed')]){_0x2492fe[_0x85cd('0xee')](_0x4cb4f0,_0xcc7c31,_0x2ee2dc,_0x85cd('0xef'));}else{if(_0x4cb4f0['countmachineretry']>=_0x10bb14[_0x85cd('0xf0')]){_0x2492fe[_0x85cd('0xf1')](_0x4cb4f0,_0xcc7c31,_0x2ee2dc,_0x85cd('0xf2'));}else{_0x2492fe[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x4cb4f0[_0x85cd('0xe4')],'scheduledat':moment()[_0x85cd('0xf3')](_0x10bb14[_0x85cd('0xf4')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x4cb4f0[_0x85cd('0xc6')],'ListId':_0x4cb4f0[_0x85cd('0xc7')],'VoiceQueueId':_0x4cb4f0[_0x85cd('0xc8')]||undefined,'CampaignId':_0x4cb4f0[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0xf7')));_0xcc7c31({'reschedule':0x1});}}});}if(_0x68c0e0[_0x85cd('0x49')]==='ivr'&&this[_0x85cd('0x21')][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]===_0x85cd('0xda')){delete this[_0x85cd('0x27')][_0x1e5344['uniqueid']];this[_0x85cd('0xad')](this[_0x85cd('0x21')][_0x68c0e0['queue']]);_0x3de344=new Hangup(_0x68c0e0,_0x1e5344);_0x3de344['state']=0x12;_0x3de344[_0x85cd('0xa4')]=_0x85cd('0xdb');_0x3de344[_0x85cd('0xe3')]=_0x85cd('0xdc');ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x3de344,_0x85cd('0xdf')));this[_0x85cd('0xc3')](_0x3de344,_0x85cd('0xf8'),_0x85cd('0xf9'));}if(_0x68c0e0[_0x85cd('0x49')]===_0x85cd('0x8f')&&this['campaigns'][_0x68c0e0[_0x85cd('0xae')]][_0x85cd('0xd8')]&&_0x1e5344[_0x85cd('0xd9')]==='MACHINE'){var _0x2492fe=this;return new BPromise(function(_0x5a8063,_0x4cbae4){delete _0x2492fe[_0x85cd('0x27')][_0x1e5344[_0x85cd('0xd2')]];_0x2492fe[_0x85cd('0xad')](_0x2492fe[_0x85cd('0x21')][_0x68c0e0['queue']]);_0x2492fe[_0x85cd('0x21')][_0x68c0e0['queue']]['outboundAnswerCallsDay']+=0x1;_0x2492fe[_0x85cd('0x21')][_0x68c0e0[_0x85cd('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3e1a22=_0x2492fe['campaigns'][_0x68c0e0[_0x85cd('0xae')]];var _0x41f92e=new Hangup(_0x68c0e0,_0x1e5344);_0x41f92e['state']=0x13;_0x41f92e[_0x85cd('0xa4')]='Machine';_0x41f92e[_0x85cd('0xe3')]=_0x85cd('0xdc');_0x41f92e[_0x85cd('0xe4')]+=0x1;_0x41f92e[_0x85cd('0xe5')]+=0x1;_0x41f92e['amd']=!![];ami[_0x85cd('0x48')](_0x85cd('0xdd'),ut[_0x85cd('0xde')](_0x41f92e,'amd'));_0x2492fe[_0x85cd('0xc0')](_0x41f92e)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xe6')));if(_0x41f92e['countbusyretry']+_0x41f92e['countcongestionretry']+_0x41f92e[_0x85cd('0xe8')]+_0x41f92e[_0x85cd('0xe9')]+_0x41f92e[_0x85cd('0xea')]+_0x41f92e[_0x85cd('0xeb')]+_0x41f92e[_0x85cd('0xe4')]+_0x41f92e['countagentrejectretry']>=_0x3e1a22['dialGlobalMaxRetry']){_0x2492fe[_0x85cd('0xee')](_0x41f92e,_0x5a8063,_0x4cbae4,_0x85cd('0xef'));}else{if(_0x41f92e[_0x85cd('0xe4')]>=_0x3e1a22[_0x85cd('0xf0')]){_0x2492fe['createStateFinal'](_0x41f92e,_0x5a8063,_0x4cbae4,_0x85cd('0xf2'));}else{_0x2492fe[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x41f92e[_0x85cd('0xe4')],'scheduledat':moment()['add'](_0x3e1a22[_0x85cd('0xf4')],'minutes')['format'](_0x85cd('0xf6')),'ContactId':_0x41f92e[_0x85cd('0xc6')],'ListId':_0x41f92e[_0x85cd('0xc7')],'VoiceQueueId':_0x41f92e[_0x85cd('0xc8')]||undefined,'CampaignId':_0x41f92e[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0xf7')));_0x5a8063({'reschedule':0x1});}}});}}};Dialer[_0x85cd('0x1c')]['syncHangup']=function(_0x2e166a){var _0x5a6733=this['uniqueId'][_0x2e166a[_0x85cd('0xd2')]];var _0x5136de=this;var _0x2f0568;if(_0x5a6733&&_0x5a6733[_0x85cd('0x49')]===_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x2e166a[_0x85cd('0xd2')]];this['updateOriginated'](this[_0x85cd('0x21')][_0x5a6733['queue']]);this[_0x85cd('0x21')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfa')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);this[_0x85cd('0xc0')](_0x2f0568)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xfb')));this[_0x85cd('0xbe')](_0x2f0568)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xfc')));}if(_0x5a6733&&_0x5a6733[_0x85cd('0x49')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfd')])){delete this[_0x85cd('0x27')][_0x2e166a['uniqueid']];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]]);this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x5d')]+=0x1;this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x5c')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);_0x2f0568[_0x85cd('0xa3')]=0x10;_0x2f0568['statedesc']=_0x85cd('0xfe');_0x2f0568[_0x85cd('0xe3')]=_0x85cd('0xff');this[_0x85cd('0xc0')](_0x2f0568)['catch'](loggerCatch(_0x85cd('0xfb')));this[_0x85cd('0xbe')](_0x2f0568)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5a6733&&_0x5a6733['type']!==_0x85cd('0x8f')&&!isNotNull(this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0xfd')])){delete this['uniqueId'][_0x2e166a[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x5a6733[_0x85cd('0xae')]]);this['voiceQueues'][_0x5a6733[_0x85cd('0xae')]][_0x85cd('0x66')]+=0x1;_0x2f0568=new Hangup(_0x5a6733,_0x2e166a);_0x2f0568[_0x85cd('0xa3')]=0xc;_0x2f0568[_0x85cd('0xa4')]=_0x2e166a[_0x85cd('0x100')];_0x2f0568[_0x85cd('0xe3')]=_0x85cd('0x101');this[_0x85cd('0xc0')](_0x2f0568)[_0x85cd('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x85cd('0xbe')](_0x2f0568)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x85cd('0x1c')][_0x85cd('0x30')]=function(_0x26bfe){var _0xffe419=this[_0x85cd('0x27')][_0x26bfe['uniqueid']];var _0x34968a=this;if(this['voiceQueues'][_0x26bfe[_0x85cd('0xae')]]){if(_0xffe419&&_0xffe419[_0x85cd('0x49')]!==_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x26bfe[_0x85cd('0xd2')]];this['voiceQueues'][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x5d')]+=0x1;var _0x105d51=new AgentComplete(_0xffe419,_0x26bfe);if(_0x26bfe[_0x85cd('0x102')]==='agent'){_0x105d51[_0x85cd('0x103')]=this[_0x85cd('0x20')][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x104')]&&this[_0x85cd('0x20')][_0x26bfe[_0x85cd('0xae')]][_0x85cd('0x105')]?moment()[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x85cd('0xc0')](_0x105d51)['catch'](loggerCatch(_0x85cd('0x106')));this[_0x85cd('0xbe')](_0x105d51)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x85cd('0x1c')]['syncAgentConnect']=function(_0x4dd97e){if(this[_0x85cd('0x20')][_0x4dd97e[_0x85cd('0xae')]]){if(this[_0x85cd('0x27')][_0x4dd97e[_0x85cd('0xd2')]]&&this['uniqueId'][_0x4dd97e[_0x85cd('0xd2')]][_0x85cd('0x49')]!==_0x85cd('0x8f')){this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x4dd97e[_0x85cd('0xae')]]);this['uniqueId'][_0x4dd97e['uniqueid']][_0x85cd('0x107')]=moment()[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x85cd('0x108')]=function(_0x301a52){this[_0x85cd('0xc0')](_0x301a52)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x106')));this[_0x85cd('0xbe')](_0x301a52)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x109')));};Dialer[_0x85cd('0x1c')]['syncQueueCallerAbandon']=function(_0x444328){var _0x2cc5d3=this[_0x85cd('0x27')][_0x444328[_0x85cd('0xd2')]];var _0x113bd4=this;if(this[_0x85cd('0x20')][_0x444328['queue']]){if(_0x2cc5d3&&_0x2cc5d3[_0x85cd('0x49')]!==_0x85cd('0x8f')){delete this[_0x85cd('0x27')][_0x444328[_0x85cd('0xd2')]];this[_0x85cd('0xad')](this[_0x85cd('0x20')][_0x444328['queue']]);_0x2cc5d3['droptime']=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));var _0x5363b3=new QueueCallerAbandon(_0x2cc5d3,_0x444328);if(getSeconds(_0x2cc5d3[_0x85cd('0x10a')],_0x2cc5d3[_0x85cd('0x10b')])>=_0x2cc5d3[_0x85cd('0x10c')]){this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x444328['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5363b3[_0x85cd('0xa3')]=0xa;_0x5363b3[_0x85cd('0xa4')]=_0x85cd('0x10d');_0x5363b3[_0x85cd('0x10e')]=_0x85cd('0x10f');_0x5363b3['agiafterat']=this[_0x85cd('0x20')][_0x444328['queue']]['dialQueueProject2']?moment()[_0x85cd('0x79')](_0x85cd('0xf6')):undefined;_0x5363b3[_0x85cd('0xea')]+=0x1;_0x5363b3[_0x85cd('0xe5')]+=0x1;if(_0x5363b3['countdropretry']>=this['voiceQueues'][_0x444328[_0x85cd('0xae')]][_0x85cd('0x110')]){this[_0x85cd('0x108')](_0x5363b3);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x5363b3[_0x85cd('0xea')],'scheduledat':moment()[_0x85cd('0xf3')](this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]][_0x85cd('0x111')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cc5d3[_0x85cd('0xc6')],'ListId':_0x2cc5d3[_0x85cd('0xc7')],'VoiceQueueId':_0x2cc5d3[_0x85cd('0xc8')]||undefined,'CampaignId':_0x2cc5d3['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x112')));var _0x4fc96b=new History(_0x5363b3);_0x4fc96b[_0x85cd('0xa3')]=0xa;_0x4fc96b[_0x85cd('0xa4')]=_0x85cd('0x10d');_0x4fc96b[_0x85cd('0x113')]=moment()['format'](_0x85cd('0xf6'));_0x4fc96b[_0x85cd('0xa5')]=_0x4fc96b[_0x85cd('0x113')];_0x4fc96b['calleridname']=_0x5363b3['calleridname'];_0x4fc96b['calleridnum']=_0x5363b3['calleridnum'];this[_0x85cd('0xc0')](_0x4fc96b)['catch'](loggerCatch(_0x85cd('0x114')));}}else{this[_0x85cd('0x20')][_0x444328['queue']][_0x85cd('0x115')]+=0x1;this[_0x85cd('0x20')][_0x444328['queue']][_0x85cd('0x116')]+=0x1;_0x5363b3[_0x85cd('0xa3')]=0xb;_0x5363b3[_0x85cd('0xa4')]='Abandoned';_0x5363b3[_0x85cd('0x10e')]=_0x85cd('0x117');_0x5363b3[_0x85cd('0xeb')]+=0x1;_0x5363b3[_0x85cd('0xe5')]+=0x1;if(_0x5363b3[_0x85cd('0xeb')]>=this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]]['dialAbandonedMaxRetry']){this[_0x85cd('0x108')](_0x5363b3);}else{this[_0x85cd('0xb5')]({'active':![],'countabandonedretry':_0x5363b3['countabandonedretry'],'scheduledat':moment()[_0x85cd('0xf3')](this[_0x85cd('0x20')][_0x444328[_0x85cd('0xae')]][_0x85cd('0x118')],'minutes')[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x2cc5d3['ContactId'],'ListId':_0x2cc5d3[_0x85cd('0xc7')],'VoiceQueueId':_0x2cc5d3[_0x85cd('0xc8')]||undefined,'CampaignId':_0x2cc5d3[_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x119')));var _0x4fc96b=new History(_0x5363b3);_0x4fc96b[_0x85cd('0xa3')]=0xb;_0x4fc96b['statedesc']=_0x85cd('0x11a');_0x4fc96b[_0x85cd('0x113')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));_0x4fc96b[_0x85cd('0xa5')]=_0x4fc96b[_0x85cd('0x113')];_0x4fc96b['calleridname']=_0x5363b3[_0x85cd('0x11b')];_0x4fc96b[_0x85cd('0x11c')]=_0x5363b3[_0x85cd('0x11c')];this[_0x85cd('0xc0')](_0x4fc96b)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x11d')));}}}}};Dialer[_0x85cd('0x1c')][_0x85cd('0x34')]=function(_0x44e4d4){if(this[_0x85cd('0xa6')][_0x44e4d4['uniqueid']]){this[_0x85cd('0xa6')][_0x44e4d4[_0x85cd('0xd2')]][_0x85cd('0xab')]=_0x44e4d4[_0x85cd('0xab')];}if(this['uniqueId'][_0x44e4d4[_0x85cd('0xd2')]]){this[_0x85cd('0x27')][_0x44e4d4[_0x85cd('0xd2')]][_0x85cd('0xab')]=_0x44e4d4['channel'];}};Dialer[_0x85cd('0x1c')]['syncQueueMember']=function(_0x1f2c49){if(strategy[this['voiceQueues'][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['queue']][_0x85cd('0x4b')]]===_0x85cd('0x1b')){if(this[_0x85cd('0xa6')][_0x1f2c49['actionid']]&&_[_0x85cd('0xd3')](this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['locked'])&&_0x1f2c49[_0x85cd('0xcf')]==='1'&&_0x1f2c49['paused']==='0'){if(this['agents'][_0x1f2c49[_0x85cd('0x11f')]]){if(!this[_0x85cd('0x22')][_0x1f2c49[_0x85cd('0x11f')]]['locked']){this[_0x85cd('0x22')][_0x1f2c49[_0x85cd('0x11f')]][_0x85cd('0x120')]=!![];this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0x120')]=!![];this['actions'][_0x1f2c49['actionid']][_0x85cd('0x11f')]=_0x1f2c49['stateinterface'];}}}}else if((strategy[this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x1f2c49['actionid']][_0x85cd('0xae')]]['strategy']]||_0x85cd('0x1a'))==='rrmemory'){if(this['actions'][_0x1f2c49[_0x85cd('0x11e')]]){if(this['agents'][_0x1f2c49[_0x85cd('0x11f')]]){this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]]['stateinterface']=_0x1f2c49[_0x85cd('0x11f')];if(_[_0x85cd('0xd3')](this['queueBooked'][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]])){this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]]=[];}this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x1f2c49[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x121')](_[_0x85cd('0xc4')](_['pick'](this['actions'][_0x1f2c49[_0x85cd('0x11e')]],['idHopper',_0x85cd('0x11f')]),{'status':_0x1f2c49[_0x85cd('0xcf')],'paused':_0x1f2c49[_0x85cd('0x122')]}));}}}};function unlockQueueStatus(_0x150531,_0x3dfa1d){setTimeout(function(){if(_[_0x85cd('0x8a')](_0x150531[_0x85cd('0x123')])){loggerBooked[_0x85cd('0x93')](_0x85cd('0x124'),_0x3dfa1d);}_0x150531[_0x85cd('0x123')]=!![];loggerBooked[_0x85cd('0x7b')]('[booked][unlockQueueStatus]',_0x3dfa1d,JSON[_0x85cd('0x125')](_[_0x85cd('0xc5')](_0x150531,[_0x85cd('0x3e'),_0x85cd('0x123')])));},0x1f3);}Dialer[_0x85cd('0x1c')][_0x85cd('0x126')]=function(_0x592658){var _0x53eb05=this;var _0x502ed0=_0x53eb05['voiceQueues'][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]];if(strategy[this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x4b')]]===_0x85cd('0x1b')){if(this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]&&this['actions'][_0x592658['actionid']][_0x85cd('0x11f')]){this[_0x85cd('0x1f')][_0x85cd('0x127')](this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0x128')],this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['stateinterface'])['catch'](function(_0x20bac6){logger[_0x85cd('0x93')](_0x85cd('0x129'),util['inspect'](_0x20bac6,{'showHidden':![],'depth':null}));})['finally'](function(){_0x53eb05[_0x85cd('0xad')](_0x53eb05[_0x85cd('0x20')][_0x53eb05[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]]);_0x53eb05['agents'][_0x53eb05[_0x85cd('0xa6')][_0x592658['actionid']]['stateinterface']]['locked']=![];delete _0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]];unlockQueueStatus(_0x502ed0);});}else{this[_0x85cd('0xad')](this[_0x85cd('0x20')][this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]]);this[_0x85cd('0xb5')]({'active':![],'ContactId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc6')],'ListId':this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc7')],'VoiceQueueId':this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xc8')]||undefined,'CampaignId':this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x12a')));delete this[_0x85cd('0xa6')][_0x592658['actionid']];unlockQueueStatus(_0x502ed0);}}else if((strategy[this[_0x85cd('0x20')][this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x4b')]]||_0x85cd('0x1a'))===_0x85cd('0x1a')){var _0x59904d;if(this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]&&!_[_0x85cd('0x43')](this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]])){if(this[_0x85cd('0x12b')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]){this[_0x85cd('0x12b')][_0x53eb05[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]=this[_0x85cd('0x12b')][this['actions'][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]]?this[_0x85cd('0x12b')][this['actions'][_0x592658['actionid']][_0x85cd('0xae')]]:this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]]['queue']]?this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]][_0x85cd('0x12c')]||0x0:0x0;}this[_0x85cd('0x28')][this[_0x85cd('0xa6')][_0x592658['actionid']][_0x85cd('0xae')]][_0x85cd('0x12c')]=this[_0x85cd('0x12b')][this[_0x85cd('0xa6')][_0x592658[_0x85cd('0x11e')]][_0x85cd('0xae')]];for(var _0x3dd4a2=0x0;_0x3dd4a2=0x0;})[_0x85cd('0xac')](myreject(_0x344604)));}}else{_0x5b6896['push'](ami[_0x85cd('0xaa')]({'action':_0x85cd('0x141'),'command':util[_0x85cd('0x79')]('iftime\x20%s,%s',_0x2cb224,!_['isUndefined'](config['timezones'][_0x2136da])?_0x2136da:'')})[_0x85cd('0xb2')](function(_0x3bb62e){return _0x3bb62e[_0x85cd('0x144')][_0x85cd('0x145')](_0x85cd('0x146'))>=0x0;})[_0x85cd('0xac')](myreject(_0x344604)));}BPromise[_0x85cd('0x147')](_0x5b6896)[_0x85cd('0xb2')](function(_0x478fe1){var _0x1b2e90=_[_0x85cd('0x148')](_0x478fe1);if(_0x1b2e90){return _0x3bd86f(_0x1b2e90);}else{_0x1e3506[_0x85cd('0x3b')]=_0x4a414f?_0x85cd('0x149'):_0x85cd('0x14a');return _0x344604(msgResponse('[ifTime][promiseAll]',_0x85cd('0x13a'),_0x85cd('0x14b')+_0x4a414f+'\x20'+_0x31ce48+_0x85cd('0x14c')+util[_0x85cd('0x95')](_0x2cb224,{'showHidden':![],'depth':null})+_0x85cd('0x14d')+_0x2136da));}})[_0x85cd('0xac')](function(_0x2b946d){return _0x344604(msgResponse(_0x85cd('0x139'),_0x85cd('0x13a'),JSON[_0x85cd('0x125')](_0x2b946d)));});});};Dialer[_0x85cd('0x1c')][_0x85cd('0x14e')]=function(_0x2349c7){var _0x2d22ba=this;return function(){switch(_0x2349c7[_0x85cd('0x14f')]){case _0x85cd('0x150'):freeVariablesPredictive(_0x2349c7);_0x2d22ba[_0x85cd('0x151')](_0x2349c7,0x1);break;case _0x85cd('0x152'):freeVariablesPredictive(_0x2349c7);_0x2d22ba['handlePower'](_0x2349c7,_0x2349c7[_0x85cd('0x153')]);break;case _0x85cd('0x154'):_0x2d22ba[_0x85cd('0x154')](_0x2349c7);break;case _0x85cd('0x8'):freeVariablesPredictive(_0x2349c7);_0x2d22ba[_0x85cd('0x151')](_0x2349c7,0x1);break;default:freeVariablesPredictive(_0x2349c7);logger[_0x85cd('0x93')]('Queue',_0x2349c7['name'],_0x85cd('0x155'));}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x156')]=function(_0x1c5eb0){var _0x56167f=this;return function(){_0x56167f['handleIvr'](_0x1c5eb0);};};Dialer[_0x85cd('0x1c')][_0x85cd('0xa')]=function(_0x22800f){var _0x58ce36=this;if(isNotPreview(_0x22800f[_0x85cd('0x14f')])){if(isVoiceQueueOutbound(_0x22800f[_0x85cd('0x49')])&&isActive(_0x22800f[_0x85cd('0x58')])){_0x22800f[_0x85cd('0x9d')]=!![];BPromise[_0x85cd('0xb1')]()['then'](checkIsLoggedIn(_0x22800f,_0x22800f[_0x85cd('0x4e')]))[_0x85cd('0xb2')](checkIsActive(_0x22800f,_0x22800f[_0x85cd('0x58')]))[_0x85cd('0xb2')](checkInterval(_0x22800f))[_0x85cd('0xb2')](_0x58ce36[_0x85cd('0x157')](_0x22800f))[_0x85cd('0xb2')](_0x58ce36['checkIfTime'](_0x22800f[_0x85cd('0x158')],_0x22800f[_0x85cd('0x159')],_0x22800f['name'],_0x22800f))['then'](_0x58ce36['checkIfTimeIntervals'](_0x22800f[_0x85cd('0x40')],_0x22800f[_0x85cd('0x159')],_0x22800f[_0x85cd('0x3e')],_0x22800f))[_0x85cd('0xb2')](_0x58ce36[_0x85cd('0x14e')](_0x22800f))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x22800f));}else{notSendMessagesQueue(_0x22800f);}}else{freeVariablesPredictive(_0x22800f);}};Dialer[_0x85cd('0x1c')][_0x85cd('0x15a')]=function(){var _0x4fbd37=this;var _0x57ffa9;for(var _0x5882bf in this[_0x85cd('0x21')]){if(typeof this[_0x85cd('0x21')][_0x5882bf]!==_0x85cd('0x97')){_0x57ffa9=this[_0x85cd('0x21')][_0x5882bf];if(isCampaignIvr(_0x57ffa9['type'])&&isActive(_0x57ffa9[_0x85cd('0x77')])){_0x57ffa9[_0x85cd('0x9d')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x57ffa9,_0x57ffa9[_0x85cd('0x77')]))[_0x85cd('0xb2')](checkInterval(_0x57ffa9))['then'](_0x4fbd37[_0x85cd('0x157')](_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37[_0x85cd('0x137')](_0x57ffa9['dialGlobalInterval'],_0x57ffa9[_0x85cd('0x159')],_0x57ffa9['name'],_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37['checkIfTimeIntervals'](_0x57ffa9[_0x85cd('0x40')],_0x57ffa9[_0x85cd('0x159')],_0x57ffa9[_0x85cd('0x3e')],_0x57ffa9))[_0x85cd('0xb2')](_0x4fbd37[_0x85cd('0x156')](_0x57ffa9))[_0x85cd('0xac')](loggerCatchQueueSummary(_0x85cd('0x15b'),_0x57ffa9));}else{notSendMessagesCampaign(_0x57ffa9);}}}};function getCallerIdRandom(_0x22b15d,_0x25f388){var _0x13cc11;var _0xcfb307;var _0x20a3b5;if(_0x25f388<=0x0){_0x25f388=0x1;}_0x13cc11=new RegExp(_0x85cd('0x15c')+_0x25f388+'}$');_0xcfb307=Math[_0x85cd('0x15d')](0xa,_0x25f388-0x1);_0x20a3b5=Math['pow'](0xa,_0x25f388)-0x1;return util[_0x85cd('0x79')]('%s',_[_0x85cd('0x15e')](_0x22b15d,_0x13cc11,_[_0x85cd('0x15f')](_0xcfb307,_0x20a3b5)));}function extractCalleridName(_0x2a017f){var _0x5c5aaf=_0x2a017f[_0x85cd('0x160')](/"(.*?)"/);return _0x5c5aaf?_0x5c5aaf[0x1]:_0x2a017f;}function extractCalleridNumber(_0x4de076){var _0x5b5edc=_0x4de076['match'](/<(.*?)>/);return _0x5b5edc?_0x5b5edc[0x1]:_0x4de076;}Dialer[_0x85cd('0x1c')]['actionOriginate']=function(_0x5d9f7e,_0x3bbf19){var _0x3db4c1=this;var _0xd6a30d=uuid['v4']();this['actions'][_0xd6a30d]=new Action(_0x5d9f7e,_0x3bbf19,_0xd6a30d);return new BPromise(function(_0x4493e7,_0x46fd6b){if(_[_0x85cd('0x8a')](_0x5d9f7e)&&typeof _0x5d9f7e!==_0x85cd('0x161')){return _0x46fd6b(msgResponse(_0x85cd('0x162'),_0x85cd('0x13a'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')])||_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')]===null){return _0x46fd6b(msgResponse('originate',_0x85cd('0x13a'),_0x85cd('0x165')));}var _0x7dfa97={'XMD-CALLERID':_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x166')](),'XMD-AGI':_0x5d9f7e[_0x85cd('0xfd')]?util[_0x85cd('0x79')](_0x85cd('0x167'),ipAgi,_0x5d9f7e[_0x85cd('0xfd')]):_0x85cd('0x168'),'XMD-AGIAFTER':_0x5d9f7e[_0x85cd('0x104')]?util[_0x85cd('0x79')](_0x85cd('0x167'),ipAgi,_0x5d9f7e[_0x85cd('0x104')]):_0x85cd('0x168'),'XMD-QUEUE':_0x5d9f7e[_0x85cd('0x49')]==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x5d9f7e[_0x85cd('0x3e')],_0x5d9f7e[_0x85cd('0x169')]||'',_0x5d9f7e[_0x85cd('0x105')]?'c':'',_0x5d9f7e[_0x85cd('0x10c')]||0x3):_0x85cd('0x168'),'XMD-CONTACTID':_0x3bbf19['ContactId'],'XMD-CDRTYPE':_0x85cd('0x7'),'CALLERID(all)':_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x166')](),'XMD-AMD':_0x5d9f7e[_0x85cd('0xd8')]?_0x85cd('0x16a'):_0x85cd('0x168'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x5d9f7e[_0x85cd('0xd8')]){_0x7dfa97[_0x85cd('0x16b')]=_0x5d9f7e[_0x85cd('0x16c')]||0x9c4;_0x7dfa97[_0x85cd('0x16d')]=_0x5d9f7e[_0x85cd('0x16e')]||0x5dc;_0x7dfa97[_0x85cd('0x16f')]=_0x5d9f7e[_0x85cd('0x170')]||0x320;_0x7dfa97[_0x85cd('0x171')]=_0x5d9f7e[_0x85cd('0x172')]||0x1388;_0x7dfa97['XMD-AMDMINWORDLENGTH']=_0x5d9f7e[_0x85cd('0x173')]||0x64;_0x7dfa97[_0x85cd('0x174')]=_0x5d9f7e['dialAMDBetweenWordsSilence']||0x32;_0x7dfa97['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x5d9f7e['dialAMDMaximumNumberOfWords']||0x3;_0x7dfa97[_0x85cd('0x175')]=_0x5d9f7e[_0x85cd('0x176')]||0x100;_0x7dfa97[_0x85cd('0x177')]=_0x5d9f7e['dialAMDMaximumWordLength']||0x1388;}if(_0x5d9f7e[_0x85cd('0x49')]==='outbound'){_0x7dfa97[_0x85cd('0x178')]=_0x3bbf19['VoiceQueueId'];}else{_0x7dfa97[_0x85cd('0x179')]=_0x3bbf19['CampaignId'];}for(var _0x476914 in _0x3bbf19[_0x85cd('0x163')]){if(typeof _0x3bbf19['Contact'][_0x476914]!==_0x85cd('0x97')){if(isNotNull(_0x3bbf19[_0x85cd('0x163')][_0x476914])&&_0x476914!=='id'&&_0x476914!==_0x85cd('0x17a')&&_0x476914!=='createdAt'&&_0x476914!=='updatedAt'){_0x7dfa97[util[_0x85cd('0x79')](_0x85cd('0x17b'),'XMD-',_[_0x85cd('0x17c')](_0x476914))]=_0x3bbf19[_0x85cd('0x163')][_0x476914];}}}var _0x2515de=_0x3db4c1[_0x85cd('0xcd')](_0x5d9f7e[_0x85cd('0x76')])?getCallerId(_0x5d9f7e['Trunk']['callerid'],_0x5d9f7e[_0x85cd('0x59')],_0x5d9f7e['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5d9f7e[_0x85cd('0x5a')],_0x5d9f7e[_0x85cd('0x17d')]):_0x5d9f7e[_0x85cd('0x5a')]):getCallerId(_[_0x85cd('0xd3')](_0x5d9f7e['TrunkBackup'])?_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x17e')]:_0x5d9f7e['TrunkBackup'][_0x85cd('0x17e')],_0x5d9f7e[_0x85cd('0x59')],_0x5d9f7e[_0x85cd('0x17d')]>0x0?getCallerIdRandom(_0x5d9f7e['dialOriginateCallerIdNumber'],_0x5d9f7e[_0x85cd('0x17d')]):_0x5d9f7e[_0x85cd('0x5a')]);if(_0x2515de){_0x7dfa97['XMD-ORIGINATECALLERIDNAME']=_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d]['originatecalleridname']=extractCalleridName(_0x2515de);_0x7dfa97[_0x85cd('0x17f')]=_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d][_0x85cd('0x180')]=extractCalleridNumber(_0x2515de);}return ami['Action']({'actionid':_0xd6a30d,'action':'originate','channel':_0x3db4c1[_0x85cd('0xcd')](_0x5d9f7e['Trunk'])?util[_0x85cd('0x79')]('SIP/%s/%s%s',_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x3e')],isNotNull(_0x5d9f7e[_0x85cd('0x181')])?_0x5d9f7e[_0x85cd('0x181')][_0x85cd('0x182')]()||'':'',_0x5d9f7e[_0x85cd('0x183')]>0x0?_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')][_0x85cd('0x184')](_0x5d9f7e[_0x85cd('0x183')]):_0x3bbf19[_0x85cd('0x163')][_0x85cd('0x164')]):util[_0x85cd('0x79')]('SIP/%s/%s%s',_['isNil'](_0x5d9f7e['TrunkBackup'])?_0x5d9f7e[_0x85cd('0x76')][_0x85cd('0x3e')]:_0x5d9f7e[_0x85cd('0x134')]['name'],isNotNull(_0x5d9f7e[_0x85cd('0x181')])?_0x5d9f7e['dialPrefix'][_0x85cd('0x182')]()||'':'',_0x5d9f7e['dialCutDigit']>0x0?_0x3bbf19['Contact'][_0x85cd('0x164')]['substring'](_0x5d9f7e[_0x85cd('0x183')]):_0x3bbf19[_0x85cd('0x163')]['phone']),'callerid':_0x2515de,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x7dfa97,'timeout':(_0x5d9f7e[_0x85cd('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd6a30d})[_0x85cd('0xb2')](function(_0x1f1fe2){return _0x4493e7(_0x1f1fe2);})[_0x85cd('0xac')](function(_0x92929c){_0x5d9f7e[_0x85cd('0x64')]+=0x1;var _0x1dbab4=new History(_0x3db4c1[_0x85cd('0xa6')][_0xd6a30d]);logger[_0x85cd('0x93')](util[_0x85cd('0x79')]('[originateError]:\x20%s',JSON[_0x85cd('0x125')](_0x92929c)));_0x1dbab4[_0x85cd('0xa3')]=0xe;_0x1dbab4['statedesc']=_0x85cd('0x185');_0x1dbab4['starttime']=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));_0x1dbab4['endtime']=_0x1dbab4['starttime'];_0x3db4c1[_0x85cd('0xc0')](_0x1dbab4)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x186')));_0x3db4c1[_0x85cd('0xbe')](_0x1dbab4)['catch'](loggerCatch('[originate][error]'))[_0x85cd('0x1e')](function(){delete _0x3db4c1[_0x85cd('0xa6')][_0xd6a30d];return _0x46fd6b(msgResponse('originate','Error',_0x85cd('0x187')));});});});};Dialer[_0x85cd('0x1c')]['syncOriginateResponse']=function(_0x3ef56a){var _0x387ca9=this['actions'][_0x3ef56a['actionid']];if(_0x387ca9){delete this[_0x85cd('0xa6')][_0x3ef56a[_0x85cd('0x11e')]];_0x387ca9[_0x85cd('0x10b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2e7a3c=_0x387ca9[_0x85cd('0x49')]===_0x85cd('0x8f')?this['campaigns'][_0x387ca9[_0x85cd('0xae')]]:this[_0x85cd('0x20')][_0x387ca9[_0x85cd('0x188')]()];if(!this['isSuccess'](_0x3ef56a[_0x85cd('0x189')])){this[_0x85cd('0xad')](_0x2e7a3c);return this[_0x85cd('0x18a')](_0x387ca9,_0x2e7a3c,_0x3ef56a)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x18b')));}this['uniqueId'][_0x3ef56a[_0x85cd('0xd2')]]=_0x387ca9;}};Dialer[_0x85cd('0x1c')][_0x85cd('0x18c')]=function(_0x4ba3ba,_0x5a8e5e,_0x26f17f){var _0x281409=new History(_0x5a8e5e);if(_0x281409['countbusyretry']+_0x281409[_0x85cd('0xe7')]+_0x281409[_0x85cd('0xe8')]+_0x281409['countnosuchnumberretry']+_0x281409['countdropretry']+_0x281409[_0x85cd('0xeb')]+_0x281409['countmachineretry']+_0x281409[_0x85cd('0xec')]>=_0x26f17f[_0x85cd('0xed')]-0x1){return!![];}switch(_0x4ba3ba){case 0x3:if(_0x281409[_0x85cd('0xe8')]>=_0x26f17f[_0x85cd('0x18d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x281409[_0x85cd('0xe8')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x18e')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x18f')));break;case 0x5:if(_0x281409[_0x85cd('0x190')]>=_0x26f17f[_0x85cd('0x191')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x281409[_0x85cd('0x190')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x192')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409['ContactId'],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x193')));break;case 0x8:if(_0x281409['countcongestionretry']>=_0x26f17f[_0x85cd('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x281409[_0x85cd('0xe7')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x195')],'minutes')['format'](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x196')));break;case 0x0:if(_0x281409[_0x85cd('0xe9')]>=_0x26f17f[_0x85cd('0x197')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x281409[_0x85cd('0xe9')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x198')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x199')));}break;case 0xa:if(_0x281409[_0x85cd('0xea')]>=_0x26f17f[_0x85cd('0x110')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countdropretry':_0x281409['countdropretry']+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f['dialDropRetryFrequency'],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409['ContactId'],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x112')));break;case 0xb:if(_0x281409[_0x85cd('0xeb')]>=_0x26f17f[_0x85cd('0x19a')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countabandonedretry':_0x281409['countabandonedretry']+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x118')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409[_0x85cd('0xc8')]||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x119')));break;case 0x13:if(_0x281409['countmachineretry']>=_0x26f17f[_0x85cd('0xf0')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countmachineretry':_0x281409[_0x85cd('0xe4')]+=0x1,'scheduledat':moment()['add'](_0x26f17f[_0x85cd('0xf4')],_0x85cd('0xf5'))[_0x85cd('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409['CampaignId']||undefined})['catch'](loggerCatch(_0x85cd('0xf7')));break;case 0x14:if(_0x281409[_0x85cd('0xec')]>=_0x26f17f[_0x85cd('0x19b')]-0x1){return!![];}this[_0x85cd('0xb5')]({'active':![],'countagentrejectretry':_0x281409[_0x85cd('0xec')]+=0x1,'scheduledat':moment()[_0x85cd('0xf3')](_0x26f17f[_0x85cd('0x19c')],_0x85cd('0xf5'))[_0x85cd('0x79')](_0x85cd('0xf6')),'ContactId':_0x281409[_0x85cd('0xc6')],'ListId':_0x281409[_0x85cd('0xc7')],'VoiceQueueId':_0x281409['VoiceQueueId']||undefined,'CampaignId':_0x281409[_0x85cd('0xc9')]||undefined})[_0x85cd('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x85cd('0x18a')]=function(_0xd021c3,_0x338156,_0x502da4){var _0x5bdf62=this;var _0x35bd27=new History(_0xd021c3);return new BPromise(function(_0x50e4f2,_0x3834b5){if(_[_0x85cd('0x8a')](_0x338156)&&typeof _0x338156!==_0x85cd('0x161')){return _0x3834b5(msgResponse(_0x85cd('0x19d'),_0x85cd('0x13a'),_0x85cd('0x19e')));}if(_[_0x85cd('0x8a')](_0x502da4)&&typeof _0x502da4!=='object'){return _0x3834b5(msgResponse(_0x85cd('0x19d'),_0x85cd('0x13a'),_0x85cd('0x19f')));}switch(_0x502da4[_0x85cd('0x102')]){case'0':_0x338156[_0x85cd('0x63')]+=0x1;_0x35bd27['state']=0x0;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1a0');_0x35bd27[_0x85cd('0xe9')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami['emit'](_0x85cd('0x1a1'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a2')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch(_0x85cd('0xe6')));if(_0x5bdf62[_0x85cd('0x18c')](0x0,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe9')]>=_0x338156[_0x85cd('0x197')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x200\x20no\x20such\x20number....');}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1a3'));}}break;case'3':_0x338156[_0x85cd('0x62')]+=0x1;_0x35bd27['state']=0x3;_0x35bd27[_0x85cd('0xa4')]='NoAnswer';_0x35bd27[_0x85cd('0xe8')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami[_0x85cd('0x48')](_0x85cd('0x1a4'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a5')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1a6')));if(_0x5bdf62['checkRetriveMax'](0x3,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe8')]>=_0x338156['dialNoAnswerMaxRetry']){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1a7'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x338156[_0x85cd('0x5f')]+=0x1;_0x35bd27['state']=0x5;_0x35bd27[_0x85cd('0xa4')]='Busy';_0x35bd27['countbusyretry']+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1a8')));_0x5bdf62['createHistory'](_0x35bd27)[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1a9')));if(_0x5bdf62[_0x85cd('0x18c')](0x5,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0x190')]>=_0x338156[_0x85cd('0x191')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1aa'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1aa'));}}break;case'8':_0x338156[_0x85cd('0x60')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0x8;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1ab');_0x35bd27[_0x85cd('0xe7')]+=0x1;_0x35bd27['countglobal']+=0x1;ami['emit'](_0x85cd('0x1ac'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1ad')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5bdf62[_0x85cd('0x18c')](0x8,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xe7')]>=_0x338156[_0x85cd('0x194')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x208\x20congestion');}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1ae'));}}break;case'11':_0x338156['outboundAbandonedCallsDay']+=0x1;_0x35bd27['state']=0xb;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x11a');_0x35bd27[_0x85cd('0xeb')]+=0x1;_0x35bd27['countglobal']+=0x1;_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)[_0x85cd('0xac')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5bdf62['checkRetriveMax'](0xb,_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0xeb')]>=_0x338156[_0x85cd('0x19a')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1af'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,'reason\x2011\x20abandoned');}}break;case'20':_0x338156[_0x85cd('0x65')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0x14;_0x35bd27[_0x85cd('0xa4')]=_0x85cd('0x1b0');_0x35bd27[_0x85cd('0xec')]+=0x1;_0x35bd27[_0x85cd('0xe5')]+=0x1;ami[_0x85cd('0x48')](_0x85cd('0x1b1'),ut[_0x85cd('0xde')](_0xd021c3,_0x85cd('0x1b2')));_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1b3')));if(_0x5bdf62[_0x85cd('0x18c')](0x14,_0xd021c3,_0x338156)){if(_0x35bd27['countagentrejectretry']>=_0x338156[_0x85cd('0x19b')]){_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1b4'));}else{_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x85cd('0x1b4'));}}break;default:_0x338156[_0x85cd('0x66')]+=0x1;_0x35bd27[_0x85cd('0xa3')]=0xc;_0x35bd27[_0x85cd('0xa4')]=_0x502da4[_0x85cd('0x102')];_0x5bdf62[_0x85cd('0xc0')](_0x35bd27)['catch'](loggerCatch(_0x85cd('0x1b5')));if(_0x5bdf62['checkRetriveMax'](_0x502da4['reason'],_0xd021c3,_0x338156)){if(_0x35bd27[_0x85cd('0x190')]+_0x35bd27[_0x85cd('0xe7')]+_0x35bd27[_0x85cd('0xe8')]+_0x35bd27['countnosuchnumberretry']+_0x35bd27[_0x85cd('0xea')]+_0x35bd27[_0x85cd('0xeb')]+_0x35bd27[_0x85cd('0xe4')]+_0x35bd27[_0x85cd('0xec')]>=_0x338156[_0x85cd('0xed')]){_0x5bdf62[_0x85cd('0xee')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x502da4['reason']);}else{_0x5bdf62[_0x85cd('0xf1')](_0x35bd27,_0x50e4f2,_0x3834b5,_0x502da4[_0x85cd('0x102')]);}}}});};Dialer[_0x85cd('0x1c')]['stateGlobal']=function(_0x2b7ee5,_0x425249,_0x13241c,_0x30329d){var _0x3f6280=new Final(_0x2b7ee5);_0x3f6280[_0x85cd('0xa3')]=0xf;_0x3f6280[_0x85cd('0xa4')]=_0x85cd('0x1b6');this[_0x85cd('0xf1')](_0x3f6280,_0x425249,_0x13241c,_0x30329d);};Dialer['prototype'][_0x85cd('0xf1')]=function(_0x5a94c5,_0x129d1b,_0x21589c,_0x434e29){this[_0x85cd('0xbe')](_0x5a94c5)['then'](function(){return _0x129d1b(msgResponse(_0x85cd('0x19d'),_0x85cd('0x1b7'),_0x434e29));})[_0x85cd('0xac')](function(){return _0x21589c(msgResponse(_0x85cd('0x1b8'),_0x85cd('0x13a'),_0x85cd('0x1b9')));});};Dialer[_0x85cd('0x1c')][_0x85cd('0x154')]=function(_0x15f97f){var _0x297334=_0x15f97f[_0x85cd('0x1ba')]/0x64;var _0x491c0c=_0x15f97f[_0x85cd('0x1bb')]/(_0x15f97f[_0x85cd('0x1bb')]+_0x15f97f[_0x85cd('0x5d')]);var _0x4ef1fb=Math[_0x85cd('0x1bc')](_0x15f97f[_0x85cd('0x6e')]*(_0x15f97f['predictiveIntervalMaxThreshold']/0x64));var _0x377c86=Math[_0x85cd('0x1bc')](_0x15f97f[_0x85cd('0x6e')]*(_0x15f97f['predictiveIntervalMinThreshold']/0x64));var _0xd0ff61=_0x15f97f['available']+_0x15f97f[_0x85cd('0x53')];var _0x238090=Math[_0x85cd('0x1bd')](_0x15f97f[_0x85cd('0x70')]*_0x15f97f[_0x85cd('0x72')]*_0x15f97f[_0x85cd('0x6b')]*_0x15f97f[_0x85cd('0x6c')]);if(_[_0x85cd('0x8a')](_0x15f97f['startProgressive'])){if(!_[_0x85cd('0x8a')](_0x15f97f[_0x85cd('0x74')])){_0x15f97f[_0x85cd('0x74')]=undefined;loggerPredictive[_0x85cd('0x93')]('[startMethodPredictive][StartProgressive]',_0x85cd('0x1be'));}if(!_['isUndefined'](_0x15f97f[_0x85cd('0x8d')])){loggerPredictive[_0x85cd('0x93')](_0x85cd('0x1bf'),_0x85cd('0x1c0'));clearInterval(_0x15f97f[_0x85cd('0x8d')]);_0x15f97f[_0x85cd('0x8d')]=undefined;}_0x15f97f[_0x85cd('0x75')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1c1'),_0x15f97f[_0x85cd('0x75')]);this[_0x85cd('0x151')](_0x15f97f,0x1);}else if(ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x75')])){this[_0x85cd('0x151')](_0x15f97f,0x1);loggerPredictiveCalls[_0x85cd('0x7b')](_0x85cd('0x1c2'),_0x15f97f[_0x85cd('0x75')],_0x15f97f[_0x85cd('0x3e')]);_0x15f97f[_0x85cd('0x70')]=0x0;_0x15f97f[_0x85cd('0x6a')]=0x0;}else if(_0x297334<_0x491c0c&&_0x15f97f[_0x85cd('0x1c3')]===_0x85cd('0x1c4')){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x1c5'),_0x85cd('0x1c6'),_0x491c0c,_0x85cd('0x75'),_0x15f97f[_0x85cd('0x3e')]);}else if(_0x238090<_0x15f97f['predictiveIntervalErlangCallsDroppedCalls']&&_0x15f97f[_0x85cd('0x1c3')]==='dropRate'){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x1c7'),_0x85cd('0x1c8'),_0x238090,_0x85cd('0x1c9'),_0x15f97f[_0x85cd('0x6a')],'startProgressive',_0x15f97f[_0x85cd('0x3e')]);}else if(!ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x75')])&&_['isUndefined'](_0x15f97f[_0x85cd('0x74')])&&!_[_0x85cd('0x8a')](_0x15f97f[_0x85cd('0x75')])){_0x15f97f[_0x85cd('0x74')]=moment()[_0x85cd('0x79')](_0x85cd('0xf6'));loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1ca'),_0x15f97f[_0x85cd('0x74')]);this[_0x85cd('0x1cb')](_0x15f97f['dialPredictiveInterval'])[_0x85cd('0xb2')](this[_0x85cd('0x1cc')](_0x15f97f))[_0x85cd('0xb2')](mergeDataErlangB(_0x15f97f))[_0x85cd('0xb2')](this[_0x85cd('0x1cd')](_0x15f97f))[_0x85cd('0xac')](loggerCatchPredictive(_0x85cd('0x1ce'),_0x15f97f));}else if(!ifInterval(_0x15f97f['dialPredictiveInterval'],_0x15f97f[_0x85cd('0x74')])){_0x15f97f[_0x85cd('0x6a')]=0x0;_0x15f97f[_0x85cd('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1cf'),_0x15f97f[_0x85cd('0x74')]);clearInterval(_0x15f97f[_0x85cd('0x8d')]);_0x15f97f[_0x85cd('0x8d')]=undefined;this[_0x85cd('0x1cb')](_0x15f97f[_0x85cd('0x1d0')])[_0x85cd('0xb2')](this[_0x85cd('0x1cc')](_0x15f97f))['then'](mergeDataErlangB(_0x15f97f))[_0x85cd('0xb2')](this[_0x85cd('0x1cd')](_0x15f97f))[_0x85cd('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x15f97f));}else if(_0x15f97f[_0x85cd('0x6e')]&&_0xd0ff61<_0x15f97f[_0x85cd('0x6e')]-_0x377c86){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],_0x85cd('0x1d1'),_0xd0ff61,_0x85cd('0x1d2'),_0x15f97f['predictiveIntervalAvailable'],'-',_0x377c86,'=',_0x15f97f[_0x85cd('0x6e')]-_0x377c86,')');}else if(_0x15f97f[_0x85cd('0x6e')]&&_0xd0ff61>_0x15f97f[_0x85cd('0x6e')]+_0x4ef1fb){freeVariablesPredictive(_0x15f97f);loggerPredictive[_0x85cd('0x7b')](_0x15f97f[_0x85cd('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xd0ff61,')\x20are\x20more\x20than\x20threshold\x20(',_0x15f97f[_0x85cd('0x6e')],'+',_0x4ef1fb,'=',_0x15f97f[_0x85cd('0x6e')]+_0x4ef1fb,')');}};Dialer['prototype']['getDataPredictive']=function(_0x23aa02){var _0x276660=this;return function(_0x235b4f){return new BPromise(function(_0xf7377c,_0x59b70b){_[_0x85cd('0xc4')](_0x23aa02,_0x235b4f[0x0]);if(checkGetDataPredictive(_0x235b4f[0x0])){var _0x23c897=_0x23aa02[_0x85cd('0x6e')]=_0x23aa02[_0x85cd('0x53')]+_0x23aa02['available'];var _0x47d40=_0x23aa02[_0x85cd('0x1d0')]*0x3c;var _0x559348=_0x235b4f[0x0][_0x85cd('0x68')]+_0x235b4f[0x0][_0x85cd('0x81')];var _0x5a99ff=(_0x235b4f[0x0][_0x85cd('0x67')]+_0x235b4f[0x0][_0x85cd('0x1d3')]+_0x235b4f[0x0][_0x85cd('0x115')])/_0x235b4f[0x0]['predictiveIntervalTotalCalls'];_0x23aa02[_0x85cd('0x6b')]=_0x5a99ff>0x0?_0x5a99ff:0x1;switch(_0x23aa02[_0x85cd('0x1c3')]){case _0x85cd('0x1c4'):var _0x2fcb76=_0x23aa02[_0x85cd('0x1ba')]/0x64;return _0x276660['abandonmentRate'](_0x23c897,_0x47d40,_0x559348,_0x5a99ff,_0x2fcb76)[_0x85cd('0xb2')](function(_0x14eb6d){return _0xf7377c(_0x14eb6d);});case _0x85cd('0x1d4'):var _0xdd20bb=_0x23aa02[_0x85cd('0x1ba')]/0x64;return _0x276660[_0x85cd('0x1d5')](_0x23c897,_0x47d40,_0x559348,_0x5a99ff,_0xdd20bb)['then'](function(_0x382164){return _0xf7377c(_0x382164);});default:return _0x59b70b(msgResponse(_0x85cd('0x1d6'),'Failure',_0x85cd('0x1d7')));}}else{return _0x59b70b(msgResponse(_0x85cd('0x1d6'),_0x85cd('0x13a'),'check\x20failure'));}});};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1d8')]=function(_0x1d5b75){var _0x258424=this;return function(_0x57e1c8){return new BPromise(function(_0x28cb0a,_0x6264e4){_[_0x85cd('0xc4')](_0x1d5b75,_0x57e1c8[0x0]);if(checkGetDataPredictive(_0x57e1c8[0x0])){loggerPredictive['info'](JSON['stringify'](_0x57e1c8[0x0]));if(_0x1d5b75[_0x85cd('0x1c3')]===_0x85cd('0x1c4')){return _0x258424[_0x85cd('0xbc')](_0x1d5b75['id'])[_0x85cd('0xb2')](function(_0x1faa16){var _0x22ffa1=_0x1d5b75[_0x85cd('0x4e')]-_0x1faa16[0x0][_0x85cd('0x1d9')];var _0x2de045=_0x1d5b75['dialPredictiveInterval']*0x3c;var _0x2884a2=_0x57e1c8[0x0]['predictiveIntervalAvgTalktime']+_0x57e1c8[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ccb33=(_0x57e1c8[0x0][_0x85cd('0x67')]+_0x57e1c8[0x0][_0x85cd('0x1d3')]+_0x57e1c8[0x0][_0x85cd('0x115')])/_0x57e1c8[0x0]['predictiveIntervalTotalCalls'];var _0x2628e2=_0x1d5b75[_0x85cd('0x1ba')]/0x64;_0x1d5b75[_0x85cd('0x6d')]=_0x1faa16[0x0][_0x85cd('0x1d9')]||0x0;_0x1d5b75[_0x85cd('0x6b')]=_0x3ccb33>0x0?_0x3ccb33:0x1;return _0x258424['abandonmentRate'](_0x22ffa1,_0x2de045,_0x2884a2,_0x3ccb33,_0x2628e2);})[_0x85cd('0xb2')](function(_0x4854a4){return _0x28cb0a(_0x4854a4);})[_0x85cd('0xac')](function(_0xf8f725){return _0x6264e4(msgResponse(_0x85cd('0x1da'),'Failure',JSON[_0x85cd('0x125')](_0xf8f725)));});}if(_0x1d5b75[_0x85cd('0x1c3')]===_0x85cd('0x1d4')){return _0x258424[_0x85cd('0xbc')](_0x1d5b75['id'])['then'](function(_0x176d2a){var _0x2310a1=_0x1d5b75[_0x85cd('0x4e')]-_0x176d2a[0x0][_0x85cd('0x1d9')];var _0x2620e6=_0x1d5b75[_0x85cd('0x1d0')]*0x3c;var _0x5a39a6=_0x57e1c8[0x0]['predictiveIntervalAvgTalktime']+_0x57e1c8[0x0][_0x85cd('0x81')];var _0x3507f3=(_0x57e1c8[0x0][_0x85cd('0x67')]+_0x57e1c8[0x0][_0x85cd('0x1d3')]+_0x57e1c8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57e1c8[0x0]['predictiveIntervalTotalCalls'];var _0x152d18=_0x1d5b75[_0x85cd('0x1ba')]/0x64;_0x1d5b75['predictiveIntervalPauses']=_0x176d2a[0x0][_0x85cd('0x1d9')]||0x0;_0x1d5b75[_0x85cd('0x6b')]=_0x3507f3>0x0?_0x3507f3:0x1;return _0x258424[_0x85cd('0x1d5')](_0x2310a1,_0x2620e6,_0x5a39a6,_0x3507f3,_0x152d18);})[_0x85cd('0xb2')](function(_0xacd01){return _0x28cb0a(_0xacd01);})[_0x85cd('0xac')](function(_0x933026){return _0x6264e4(msgResponse('[CatchErlangB]',_0x85cd('0x13a'),JSON[_0x85cd('0x125')](_0x933026)));});}}else{return _0x6264e4(msgResponse(_0x85cd('0x1d6'),_0x85cd('0x13a'),_0x85cd('0x1db')));}});};};Dialer[_0x85cd('0x1c')]['startMethodPredictive']=function(_0xb6fd6e){var _0x35bea8=this;return function(){var _0x26380d=0x0;var _0x5a0347=Math['floor'](_0xb6fd6e[_0x85cd('0x71')]*0x3e8);if(_0x5a0347>0x0){_0x5a0347=_0x5a0347<0x64?0x64:_0x5a0347;loggerPredictive[_0x85cd('0x7b')](_0xb6fd6e[_0x85cd('0x3e')],'one\x20call\x20every:',_0x5a0347,_0x85cd('0x45'));_0xb6fd6e[_0x85cd('0x8d')]=setInterval(function(){_0x35bea8['handlePredictive'](_0xb6fd6e);loggerPredictiveCalls['info'](_0x85cd('0x1dc'),_0x26380d+=0x1);},_0x5a0347);}else{loggerPredictive[_0x85cd('0x7b')](_0xb6fd6e[_0x85cd('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1dd')]=function(_0x877e26,_0x110ccb){var _0x2c55d8=this;return function(_0x57327b){if(_[_0x85cd('0x43')](_0x57327b)){if(_[_0x85cd('0xd3')](_0x110ccb[_0x85cd('0x1de')])||!_0x110ccb[_0x85cd('0x1df')]){if(_0x877e26[_0x85cd('0x14f')]===_0x85cd('0x8')){_0x877e26[_0x85cd('0x123')]=_['isUndefined'](_0x877e26[_0x85cd('0x123')])?!![]:_0x877e26[_0x85cd('0x123')];var _0x2f8edf=uuid['v4']();_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]=new Action(_0x877e26,_0x110ccb,_0x2f8edf);loggerBooked['info'](_0x85cd('0x1e0'),_0x2f8edf,'queueStatusComplete:\x20',JSON['stringify'](_0x877e26[_0x85cd('0x123')]),_0x85cd('0x1e1'),_0x877e26[_0x85cd('0x3e')]);if(_0x877e26[_0x85cd('0x123')]){_0x877e26[_0x85cd('0x123')]=![];_0x2c55d8[_0x85cd('0x28')][_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xae')]]=[];ami[_0x85cd('0xaa')]({'actionid':_0x2f8edf,'action':_0x85cd('0x1e2'),'queue':_0x877e26[_0x85cd('0x3e')]})[_0x85cd('0xac')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);_0x2c55d8[_0x85cd('0xb5')]({'active':![],'ContactId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc6')],'ListId':_0x2c55d8['actions'][_0x2f8edf][_0x85cd('0xc7')],'VoiceQueueId':_0x2c55d8['actions'][_0x2f8edf]['VoiceQueueId']||undefined,'CampaignId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1e3')));delete _0x2c55d8[_0x85cd('0xa6')][_0x2f8edf];});}else{loggerBooked[_0x85cd('0x7b')]('[booked][checkContactBlack][else]',JSON[_0x85cd('0x125')](_0x877e26[_0x85cd('0x123')]),_0x85cd('0x1e1'),_0x877e26['name']);_0x2c55d8[_0x85cd('0xad')](_0x877e26);_0x2c55d8[_0x85cd('0xb5')]({'active':![],'ContactId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc6')],'ListId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['ListId'],'VoiceQueueId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf]['VoiceQueueId']||undefined,'CampaignId':_0x2c55d8[_0x85cd('0xa6')][_0x2f8edf][_0x85cd('0xc9')]||undefined})['catch'](loggerCatch(_0x85cd('0x1e3')));delete _0x2c55d8[_0x85cd('0xa6')][_0x2f8edf];}}else{return _0x2c55d8['actionOriginate'](_0x877e26,_0x110ccb);}}else{if(getDiff(_0x110ccb[_0x85cd('0x1e4')])<_0x877e26[_0x85cd('0x1e5')]*0x3c){if(_0x110ccb[_0x85cd('0x1e6')]&&!_0x110ccb[_0x85cd('0x1e6')][_0x85cd('0x1e7')]){_0x2c55d8['preview'][_0x85cd('0x127')](_0x110ccb['id'])[_0x85cd('0x1e')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);});}else{_0x2c55d8[_0x85cd('0xb7')]({'active':![]},_0x110ccb['id'],0x1)[_0x85cd('0x1e')](function(){_0x2c55d8[_0x85cd('0xad')](_0x877e26);});}}else{_0x877e26[_0x85cd('0x1e8')]+=0x1;_0x2c55d8[_0x85cd('0xad')](_0x877e26);if(_0x877e26['dialRecallInQueue']){_0x2c55d8[_0x85cd('0xb5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x110ccb[_0x85cd('0xc6')],'ListId':_0x110ccb['ListId'],'VoiceQueueId':_0x110ccb['VoiceQueueId']||undefined,'CampaignId':_0x110ccb['CampaignId']||undefined})[_0x85cd('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2c55d8[_0x85cd('0xc0')](createObjHistory(_0x877e26,_0x110ccb,_0x85cd('0x1e9'),0x17,_0x85cd('0x1ea')))[_0x85cd('0xac')](loggerCatch(_0x85cd('0x1eb')));}else{_0x2c55d8['saveInDb'](createObjHistory(_0x877e26,_0x110ccb,_0x85cd('0x1ec'),0x16,'RecallFailedTimeout'),_0x85cd('0x1ed'),_0x85cd('0x1ee'));}}}}else{_0x877e26[_0x85cd('0x5e')]+=0x1;_0x2c55d8[_0x85cd('0xc3')](createObjHistory(_0x877e26,_0x110ccb,'BLACKLIST',0xd,_0x85cd('0x1ef')),'[Originate][historyBlacklist]',_0x85cd('0x1f0'));throw _0x85cd('0x1f1');}};};Dialer[_0x85cd('0x1c')][_0x85cd('0x1f2')]=function(_0x395604){var _0x5a740a=this;var _0x481825=_0x395604['limitCalls']-_0x395604['originated']-_0x395604['temp'];emitCampaignSummary(_0x395604);if(_0x481825>0x0){if(_0x481825>this[_0x85cd('0x24')]){_0x481825=this[_0x85cd('0x24')];}_0x395604[_0x85cd('0xba')]+=_0x481825;this[_0x85cd('0xbb')](_0x395604['id'],_0x481825,_0x395604[_0x85cd('0x1f3')],_0x395604)[_0x85cd('0xb2')](function(_0x41b89b){_0x395604[_0x85cd('0xba')]-=_0x481825;_0x395604['temp']=_0x395604[_0x85cd('0xba')]>0x0?_0x395604['temp']:0x0;if(!checkContactEmpty(_0x41b89b)){_0x395604[_0x85cd('0x3b')]=_0x85cd('0x1f4');logger['info'](_0x85cd('0x1f5')+_0x395604[_0x85cd('0x3e')]);}else{_0x395604[_0x85cd('0x6f')]+=_0x41b89b['length'];_0x395604[_0x85cd('0x3b')]=_0x85cd('0x1f6');for(var _0x1ca4a6=0x0;_0x1ca4a6<_0x41b89b['length'];_0x1ca4a6+=0x1){_0x395604[_0x85cd('0x1f7')]+=0x1;if(_[_0x85cd('0xd3')](_0x41b89b[_0x1ca4a6])||_[_0x85cd('0xd3')](_0x41b89b[_0x1ca4a6][_0x85cd('0x163')])||_['isNil'](_0x41b89b[_0x1ca4a6]['Contact']['phone'])){_0x5a740a[_0x85cd('0x1f8')](_0x85cd('0x1f9'),_0x395604,_0x41b89b[_0x1ca4a6]);}else{_0x5a740a[_0x85cd('0xb4')](_[_0x85cd('0xc5')](_0x41b89b[_0x1ca4a6],[_0x85cd('0xc9'),'Contact.phone']))[_0x85cd('0xb2')](_0x5a740a[_0x85cd('0x1dd')](_0x395604,_0x41b89b[_0x1ca4a6]))[_0x85cd('0xac')](_0x5a740a[_0x85cd('0x1fa')](_0x85cd('0x1fb'),_0x395604));}}}})[_0x85cd('0xac')](loggerGetContactDialer(_0x85cd('0x1fc'),_0x395604,_0x481825));}};Dialer[_0x85cd('0x1c')][_0x85cd('0x151')]=function(_0x17032a,_0x28b0a7){var _0x52881c=this;var _0x379eeb=[];var _0xb15120=_0x28b0a7>=0x1?_0x28b0a7:0x1;if(_0x17032a['dialMethod']===_0x85cd('0x8')){_0xb15120=0x1;}var _0x31bd61=Math[_0x85cd('0x1bd')](_0x17032a[_0x85cd('0x4d')]*_0xb15120)-_0x17032a[_0x85cd('0x6f')]-_0x17032a[_0x85cd('0xba')];emitVoiceQueueSummary(_0x17032a);if(_0x17032a['dialLimitQueue']>0x0){var _0xf8b322=_0x17032a[_0x85cd('0x1fd')]-_0x17032a[_0x85cd('0x6f')]-_0x17032a[_0x85cd('0x53')]-_0x17032a['temp']-_0x17032a[_0x85cd('0x4f')];if(_0x31bd61>_0xf8b322){_0x31bd61=_0xf8b322;}}if(_0x31bd61>0x0){if(_0x17032a[_0x85cd('0x14f')]===_0x85cd('0x8')){_0x31bd61=0x1;}if(_0x31bd61>this[_0x85cd('0x24')]){_0x31bd61=this['maxNumberOriginate'];}_0x17032a[_0x85cd('0xba')]+=_0x31bd61;for(var _0x28adee in this[_0x85cd('0x22')]){if(typeof this[_0x85cd('0x22')][_0x28adee]!==_0x85cd('0x97')){if(this[_0x85cd('0x22')][_0x28adee][_0x85cd('0xa3')]===_0x85cd('0x1fe')&&this[_0x85cd('0x22')][_0x28adee][_0x85cd('0xcf')]==='reachable'){_0x379eeb[_0x85cd('0x121')](this[_0x85cd('0x22')][_0x28adee]['id']);}}}this[_0x85cd('0xb9')](_0x17032a['id'],_0x379eeb,_0x31bd61,_0x17032a[_0x85cd('0x1f3')],_0x17032a)[_0x85cd('0xb2')](function(_0x607b26){_0x17032a['temp']-=_0x31bd61;_0x17032a[_0x85cd('0xba')]=_0x17032a[_0x85cd('0xba')]>0x0?_0x17032a['temp']:0x0;if(!checkContactEmpty(_0x607b26)){_0x52881c[_0x85cd('0xaf')](_0x17032a)[_0x85cd('0xb2')](sendMessageReschedule(_0x17032a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x17032a[_0x85cd('0x6f')]+=_0x607b26[_0x85cd('0x96')];_0x17032a[_0x85cd('0x3b')]=_0x17032a[_0x85cd('0x14f')]===_0x85cd('0x8')?_0x85cd('0x16a'):_0x85cd('0x1f6');for(var _0x274158=0x0;_0x274158<_0x607b26[_0x85cd('0x96')];_0x274158+=0x1){if(_[_0x85cd('0xd3')](_0x607b26[_0x274158])||_[_0x85cd('0xd3')](_0x607b26[_0x274158]['Contact'])||_[_0x85cd('0xd3')](_0x607b26[_0x274158][_0x85cd('0x163')][_0x85cd('0x164')])){_0x52881c['emptyContact'](_0x85cd('0x1f9'),_0x17032a,_0x607b26[_0x274158]);}else{_0x52881c[_0x85cd('0x1ff')](_[_0x85cd('0xc5')](_0x607b26[_0x274158],['VoiceQueueId',_0x85cd('0x200')]))[_0x85cd('0xb2')](_0x52881c[_0x85cd('0x1dd')](_0x17032a,_0x607b26[_0x274158]))['catch'](_0x52881c[_0x85cd('0x1fa')]('[actionOriginate]\x20',_0x17032a));}}}})['catch'](loggerGetContactDialer(_0x85cd('0x201'),_0x17032a,_0x31bd61));}};Dialer[_0x85cd('0x1c')]['handlePredictive']=function(_0x198b0c){if(_0x198b0c[_0x85cd('0x1fd')]>0x0){var _0x4e6d8e=_0x198b0c['dialLimitQueue']-_0x198b0c[_0x85cd('0x6f')]-_0x198b0c[_0x85cd('0x53')];if(_0x4e6d8e>0x0){this[_0x85cd('0x202')](_0x198b0c);}else{loggerPredictiveCalls[_0x85cd('0x7b')]('[handlePredictive][limitChannel]');}}else{this[_0x85cd('0x202')](_0x198b0c);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x3fab12){var _0x389e17=this;var _0x1bdccc=[];_0x3fab12[_0x85cd('0x6f')]+=0x1;for(var _0x592192 in this[_0x85cd('0x22')]){if(typeof this[_0x85cd('0x22')][_0x592192]!==_0x85cd('0x97')){if(this[_0x85cd('0x22')][_0x592192]['state']===_0x85cd('0x1fe')&&this[_0x85cd('0x22')][_0x592192]['status']===_0x85cd('0xd0')){_0x1bdccc[_0x85cd('0x121')](this['agents'][_0x592192]['id']);}}}this[_0x85cd('0xb9')](_0x3fab12['id'],_0x1bdccc,0x1,_0x3fab12[_0x85cd('0x1f3')],_0x3fab12)['then'](function(_0x13b76b){if(!checkContactEmpty(_0x13b76b)){checkContactLowerLimitOriginate(_0x3fab12,0x1,0x0);_0x389e17[_0x85cd('0xaf')](_0x3fab12)[_0x85cd('0xb2')](sendMessageReschedule(_0x3fab12))[_0x85cd('0xac')](loggerCatch(_0x85cd('0xb0')));}else{_0x3fab12[_0x85cd('0x3b')]=_0x85cd('0x1f6');if(_[_0x85cd('0xd3')](_0x13b76b[0x0])||_[_0x85cd('0xd3')](_0x13b76b[0x0][_0x85cd('0x163')])||_[_0x85cd('0xd3')](_0x13b76b[0x0]['Contact'][_0x85cd('0x164')])){_0x389e17[_0x85cd('0x1f8')](_0x85cd('0x1f9'),_0x3fab12,_0x13b76b[0x0]);}else{_0x389e17[_0x85cd('0x1ff')](_['pick'](_0x13b76b[0x0],['VoiceQueueId','Contact.phone']))[_0x85cd('0xb2')](_0x389e17[_0x85cd('0x1dd')](_0x3fab12,_0x13b76b[0x0]))[_0x85cd('0xac')](_0x389e17[_0x85cd('0x1fa')](_0x85cd('0x203'),_0x3fab12));}}})[_0x85cd('0xac')](loggerGetContactDialer(_0x85cd('0x204'),_0x3fab12,0x1));emitVoiceQueueSummary(_0x3fab12);};Dialer[_0x85cd('0x1c')][_0x85cd('0x205')]=function(_0x27c6e4,_0x44544b,_0x106501,_0x1ead0e,_0x34c84c,_0x12dd97){loggerPredictive[_0x85cd('0x7b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x206'),_0x27c6e4);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x207'),_0x44544b);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x208'),_0x106501);loggerPredictive[_0x85cd('0x7b')]('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',_0x1ead0e);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34c84c);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x83'));return new BPromise(function(_0x78fb1b,_0x48a4c8){if(_0x27c6e4<=0x0||isNaN(_0x27c6e4)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),'Error',_0x85cd('0x20a')+_0x27c6e4));}if(_0x106501<=0x0||isNaN(_0x106501)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),'Error',_0x85cd('0x20b')+_0x106501));}if(_0x1ead0e<=0x0||isNaN(_0x1ead0e)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),_0x85cd('0x20d')+_0x1ead0e));}if(_0x44544b<=0x0||isNaN(_0x44544b)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),'interval\x20=\x20'+_0x44544b));}if(_0x34c84c<=0x0||isNaN(_0x34c84c)){return _0x48a4c8(msgResponse(_0x85cd('0x209'),_0x85cd('0x20c'),_0x85cd('0x20e')+_0x34c84c));}_0x12dd97=_0x12dd97||0x0;var _0x17bb16=0x1/_0x106501;var _0x51973a=0x0;var _0x348f85=0x0;var _0x5aba4d=0x0;var _0x32c53f=0x0;for(var _0x36e038=0x0;_0x5aba4d<_0x34c84c;_0x36e038+=0x1){_0x348f85=_0x36e038/_0x44544b;_0x51973a=(_0x1ead0e*_0x348f85+_0x12dd97)/_0x17bb16;_0x5aba4d=erlangb(_0x51973a,_0x27c6e4);_0x32c53f=_0x51973a/_0x27c6e4*(0x1-erlangb(_0x51973a,_0x27c6e4));}return _0x78fb1b({'erlangCalls':_0x36e038,'erlangCallToSecond':_0x44544b/_0x36e038,'erlangAbandonmentRate':_0x5aba4d,'erlangBusyFactor':_0x32c53f});});};Dialer['prototype'][_0x85cd('0x1d5')]=function(_0x5be846,_0x2bf5a9,_0x8d2611,_0x2abcb8,_0x4b90d4,_0xe21f75){loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x20f'));loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x206'),_0x5be846);loggerPredictive[_0x85cd('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bf5a9);loggerPredictive['info'](_0x85cd('0x208'),_0x8d2611);loggerPredictive[_0x85cd('0x7b')](_0x85cd('0x210'),_0x2abcb8);loggerPredictive[_0x85cd('0x7b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b90d4);loggerPredictive['info'](_0x85cd('0x83'));return new BPromise(function(_0x2ab6cd,_0x4a134d){if(_0x5be846<=0x0||isNaN(_0x5be846)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20a')+_0x5be846));}if(_0x8d2611<=0x0||isNaN(_0x8d2611)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20b')+_0x8d2611));}if(_0x2abcb8<=0x0||isNaN(_0x2abcb8)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x20d')+_0x2abcb8));}if(_0x2bf5a9<=0x0||isNaN(_0x2bf5a9)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x212')+_0x2bf5a9));}if(_0x4b90d4<=0x0||isNaN(_0x4b90d4)){return _0x4a134d(msgResponse(_0x85cd('0x211'),_0x85cd('0x20c'),_0x85cd('0x213')+_0x4b90d4));}_0xe21f75=_0xe21f75||0x0;var _0x472ba0=0x1/_0x8d2611;var _0x4fcb56=0x0;var _0xc115da=0x0;var _0x1909c5=0x0;var _0x2193c1=0x0;for(var _0x284134=0x0;_0x2193c1<_0x4b90d4;_0x284134+=0x1){_0xc115da=_0x284134/_0x2bf5a9;_0x4fcb56=(_0x2abcb8*_0xc115da+_0xe21f75)/_0x472ba0;_0x1909c5=erlangb(_0x4fcb56,_0x5be846);_0x2193c1=_0x4fcb56/_0x5be846*(0x1-erlangb(_0x4fcb56,_0x5be846));}return _0x2ab6cd({'erlangCalls':_0x284134,'erlangCallToSecond':_0x2bf5a9/_0x284134,'erlangAbandonmentRate':_0x1909c5,'erlangBusyFactor':_0x2193c1});});};module[_0x85cd('0x214')]=Dialer; \ No newline at end of file +var _0x9e9b=['info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','undefined','sequence','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','state','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','MACHINE','Machine','countmachineretry','countglobal','emit','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','ContactId','VoiceQueueId','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','syncNewExten','actionid','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR][finaly]','Agent:\x20','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','dialCutDigit','substring','SIP/%s/%s%s','trim','xcally-motion-dialer','from-sip','outboundOriginateFailureCallsDay','[originate][error]','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','countagentrejectretry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalAvgTalktime','predictiveIntervalPauses','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','outbound','strategy','answered','available','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','-----\x20Stats\x20Predictive\x20---'];(function(_0x512891,_0x46005a){var _0x1c190c=function(_0x42b95b){while(--_0x42b95b){_0x512891['push'](_0x512891['shift']());}};_0x1c190c(++_0x46005a);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x9e9b[_0x55754e];return _0x2e9948;};'use strict';var util=require(_0xb9e9('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xb9e9('0x1'));var moment=require(_0xb9e9('0x2'));var rr=require('rr');var md5=require(_0xb9e9('0x3'));var Redis=require(_0xb9e9('0x4'));var ut=require('../preview/util/util');var config=require(_0xb9e9('0x5'));var logger=require(_0xb9e9('0x6'))('dialer');var loggerBooked=require(_0xb9e9('0x6'))(_0xb9e9('0x7'));var loggerPredictive=require(_0xb9e9('0x6'))(_0xb9e9('0x8'));var loggerPredictiveCalls=require(_0xb9e9('0x6'))(_0xb9e9('0x9'));var loggerSyncQueueSummary=require(_0xb9e9('0x6'))(_0xb9e9('0xa'));var ami=require(_0xb9e9('0xb'));config[_0xb9e9('0xc')]=_[_0xb9e9('0xd')](config[_0xb9e9('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xb9e9('0xe'))(new Redis(config[_0xb9e9('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb9e9('0xf'));var cmHopperBlack=require(_0xb9e9('0x10'));var voiceQueueRt=require(_0xb9e9('0x11'));var Action=require('./action');var History=require('./history');var Final=require(_0xb9e9('0x12'));var AgentComplete=require(_0xb9e9('0x13'));var QueueCallerAbandon=require(_0xb9e9('0x14'));var Hangup=require(_0xb9e9('0x15'));var ipAgi=process[_0xb9e9('0x16')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xb9e9('0x17'),'roundrobin':_0xb9e9('0x18')};var Sequence=function(){};Sequence['prototype'][_0xb9e9('0x19')]=function(_0x2f5555){this[_0xb9e9('0x1a')]=this[_0xb9e9('0x1a')]?this['tail'][_0xb9e9('0x1b')](_0x2f5555):_0x2f5555();};function Dialer(_0x846733,_0x124481){this['sequence']=new Sequence();this[_0xb9e9('0x1c')]=_0x124481;this[_0xb9e9('0x1d')]=_0x846733[_0xb9e9('0x1d')];this[_0xb9e9('0x1e')]=_0x846733[_0xb9e9('0x1e')];this[_0xb9e9('0x1f')]=_0x846733[_0xb9e9('0x1f')];this[_0xb9e9('0x20')]=_0x846733[_0xb9e9('0x20')];this[_0xb9e9('0x21')]=config[_0xb9e9('0x21')]||0x2;this[_0xb9e9('0x22')]={};this[_0xb9e9('0x23')]={};this[_0xb9e9('0x24')]={};this[_0xb9e9('0x25')]={};this[_0xb9e9('0x26')]={};this[_0xb9e9('0x27')]={};this[_0xb9e9('0x28')]={};this[_0xb9e9('0x29')]={};this[_0xb9e9('0x2a')]={};this['queueBookedRR']={};ami['on'](_0xb9e9('0x2b'),this['syncAgentConnect'][_0xb9e9('0x2c')](this));ami['on'](_0xb9e9('0x2d'),this[_0xb9e9('0x2e')][_0xb9e9('0x2c')](this));ami['on'](_0xb9e9('0x2f'),this[_0xb9e9('0x30')][_0xb9e9('0x2c')](this));ami['on'](_0xb9e9('0x31'),this['syncAgentComplete']['bind'](this));ami['on'](_0xb9e9('0x32'),this[_0xb9e9('0xa')][_0xb9e9('0x2c')](this));ami['on'](_0xb9e9('0x33'),this[_0xb9e9('0x34')][_0xb9e9('0x2c')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xb9e9('0x35')]['bind'](this));ami['on']('queuemember',this[_0xb9e9('0x36')]['bind'](this));ami['on'](_0xb9e9('0x37'),this[_0xb9e9('0x38')]['bind'](this));this['loopCampaigns']();this[_0xb9e9('0x39')]();}function isNotNull(_0x4a39e0){return _0x4a39e0!==null&&!_[_0xb9e9('0x3a')](_0x4a39e0);}function checkIsLoggedIn(_0x5d6102,_0x5a1992){return function(){if(_0x5a1992<=0x0){_0x5d6102[_0xb9e9('0x3b')]=_0xb9e9('0x3c');throw _0x5d6102[_0xb9e9('0x3d')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4a361c){return _0x4a361c;}function checkIsActive(_0x37208d,_0x47ab12){return function(){if(!isActive(_0x47ab12)){_0x37208d[_0xb9e9('0x3b')]='NOT_ACTIVE';throw _0x37208d['name']+_0xb9e9('0x3e');}};}function checkInterval(_0x40767a){return function(){if(!isNotNull(_0x40767a['Interval'])){_0x40767a[_0xb9e9('0x3b')]=_0xb9e9('0x3f');throw _0x40767a[_0xb9e9('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x40767a[_0xb9e9('0x40')][_0xb9e9('0x41')])){_0x40767a['message']=_0xb9e9('0x3f');throw _0x40767a[_0xb9e9('0x3d')]+_0xb9e9('0x42');}if(!isNotNull(_[_0xb9e9('0x43')](_0x40767a[_0xb9e9('0x40')][_0xb9e9('0x41')]))){_0x40767a[_0xb9e9('0x3b')]='INTERVAL_IS_NULL';throw _0x40767a[_0xb9e9('0x3d')]+_0xb9e9('0x42');}};}function msgResponse(_0x493d2a,_0x33c6e4,_0xaa6cbb){return{'action':_0x493d2a,'response':_0x33c6e4,'message':_0xaa6cbb,'stack':_0xaa6cbb};}function myreject(_0x37f778){return function(_0x26b1b0){return _0x37f778(msgResponse(_0xb9e9('0x44'),_0xb9e9('0x45'),JSON[_0xb9e9('0x46')](_0x26b1b0)));};}function getSeconds(_0x50877b,_0x1b3277){var _0x3e5a2e=moment(_0x50877b)[_0xb9e9('0x47')](0x0);var _0x1c2454=moment(_0x1b3277)[_0xb9e9('0x47')](0x0);return _0x3e5a2e[_0xb9e9('0x48')](_0x1c2454,_0xb9e9('0x49'));}function emit(_0x4a47dc,_0x2af21b,_0x402629){io['to'](_0x4a47dc)['emit'](_0x2af21b,_0x402629);}function emitVoiceQueueSummary(_0x246842){if(_0x246842['type']===_0xb9e9('0x4a')){var _0x275628={'id':_0x246842['id'],'name':_0x246842['name'],'strategy':_0x246842[_0xb9e9('0x4b')],'answered':_0x246842[_0xb9e9('0x4c')],'available':_0x246842[_0xb9e9('0x4d')],'loggedIn':_0x246842['loggedIn'],'pTalking':_0x246842['pTalking'],'sumBillable':_0x246842['sumBillable'],'sumDuration':_0x246842[_0xb9e9('0x4e')],'sumHoldTime':_0x246842[_0xb9e9('0x4f')]||0x0,'talking':_0x246842[_0xb9e9('0x50')],'total':_0x246842[_0xb9e9('0x51')],'type':_0x246842[_0xb9e9('0x52')],'unmanaged':_0x246842[_0xb9e9('0x53')],'abandoned':_0x246842[_0xb9e9('0x54')],'waiting':_0x246842[_0xb9e9('0x55')],'loggedInDb':_0x246842[_0xb9e9('0x56')],'dialActive':_0x246842['dialActive'],'dialMethod':_0x246842['dialMethod'],'dialOriginateCallerIdName':_0x246842[_0xb9e9('0x57')],'dialOriginateCallerIdNumber':_0x246842['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x246842[_0xb9e9('0x58')],'dialPrefix':_0x246842[_0xb9e9('0x59')],'outboundAnswerAgiCallsDay':_0x246842[_0xb9e9('0x5a')],'outboundAnswerCallsDay':_0x246842[_0xb9e9('0x5b')],'outboundBlacklistCallsDay':_0x246842[_0xb9e9('0x5c')],'outboundBusyCallsDay':_0x246842[_0xb9e9('0x5d')],'outboundCongestionCallsDay':_0x246842['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x246842[_0xb9e9('0x5e')],'outboundDropCallsDayCallersExit':_0x246842[_0xb9e9('0x5f')],'outboundDropCallsDayTimeout':_0x246842[_0xb9e9('0x60')],'outboundNoAnswerCallsDay':_0x246842[_0xb9e9('0x61')],'outboundNoSuchCallsDay':_0x246842[_0xb9e9('0x62')],'outboundOriginateFailureCallsDay':_0x246842['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x246842[_0xb9e9('0x63')],'outboundRejectCallsDay':_0x246842[_0xb9e9('0x64')],'outboundUnknownCallsDay':_0x246842['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x246842[_0xb9e9('0x65')],'predictiveIntervalAvgHoldtime':_0x246842[_0xb9e9('0x66')],'predictiveIntervalAvgTalktime':_0x246842['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x246842['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x246842[_0xb9e9('0x67')],'predictiveIntervalErlangCalls':_0x246842['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x246842[_0xb9e9('0x68')],'predictiveIntervalHitRate':_0x246842[_0xb9e9('0x69')],'predictiveIntervalMultiplicativeFactor':_0x246842['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x246842['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x246842['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x246842[_0xb9e9('0x6a')],'message':_0x246842['message'],'originated':_0x246842[_0xb9e9('0x6b')],'erlangCalls':_0x246842[_0xb9e9('0x6c')],'erlangCallToSecond':_0x246842['erlangCallToSecond'],'erlangAbandonmentRate':_0x246842[_0xb9e9('0x6d')],'erlangBusyFactor':_0x246842['erlangBusyFactor'],'startPredictive':_0x246842[_0xb9e9('0x27')],'startProgressive':_0x246842['startProgressive']};if(_0x246842[_0xb9e9('0x6e')]){_0x275628[_0xb9e9('0x6e')]={'id':_0x246842[_0xb9e9('0x6e')]['id'],'name':_0x246842[_0xb9e9('0x6e')][_0xb9e9('0x3d')],'active':_0x246842[_0xb9e9('0x6e')][_0xb9e9('0x6f')],'callerid':_0x246842[_0xb9e9('0x6e')]['callerid']};}if(_0x246842[_0xb9e9('0x40')]){_0x275628['Interval']={'id':_0x246842[_0xb9e9('0x40')]['id'],'name':_0x246842[_0xb9e9('0x40')][_0xb9e9('0x3d')]};}var _0x315620=md5(JSON[_0xb9e9('0x46')](_0x275628));if(_0x246842['md5']!==_0x315620){_0x246842[_0xb9e9('0x3')]=_0x315620;emit(util[_0xb9e9('0x70')](_0xb9e9('0x71'),_0x275628[_0xb9e9('0x3d')]),_0xb9e9('0x72'),_0x275628);}}}function emitCampaignSummary(_0x248eef){if(_0x248eef['type']===_0xb9e9('0x73')){emit(util[_0xb9e9('0x70')]('campaign:ivr:%s',_0x248eef['name']),'campaign:save',_0x248eef);}}function checkGetDataPredictive(_0x317d62){if(isNotNull(_0x317d62)&&!_['isEmpty'](_0x317d62)){loggerPredictive['info'](_0xb9e9('0x74'));loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x76'),_0x317d62[_0xb9e9('0x6a')]);loggerPredictive[_0xb9e9('0x75')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x317d62[_0xb9e9('0x65')]);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x77'),_0x317d62[_0xb9e9('0x67')]);loggerPredictive['info'](_0xb9e9('0x78'),_0x317d62[_0xb9e9('0x79')]);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7a'),_0x317d62[_0xb9e9('0x66')]);loggerPredictive['info'](_0xb9e9('0x7b'),_0x317d62['predictiveIntervalAvgTalktime']);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7c'));if(_0x317d62[_0xb9e9('0x6a')]>0x0){if(!_['isUndefined'](_0x317d62['predictiveIntervalAvgTalktime'])&&_0x317d62['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7d'));if(!_[_0xb9e9('0x3a')](_0x317d62[_0xb9e9('0x66')])&&_0x317d62['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7e'));}else{loggerPredictive['info'](_0xb9e9('0x7f'));}}else{loggerPredictive['info'](_0xb9e9('0x80'));}return![];}function mergeDataErlangB(_0x429e4c){return function(_0x40cddc){loggerPredictive['info'](_0xb9e9('0x81'));loggerPredictive[_0xb9e9('0x75')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40cddc['erlangCalls']);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x82'),_0x40cddc['erlangCallToSecond']);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x83'),_0x40cddc[_0xb9e9('0x6d')]);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x84'),_0x40cddc['erlangBusyFactor']);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x83'),_0x40cddc[_0xb9e9('0x6d')]);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7c'));_[_0xb9e9('0x85')](_0x429e4c,_0x40cddc);};}function getDiff(_0x58922a){var _0x5b51f5=moment()['milliseconds'](0x0);var _0xe9f4b3=moment(_0x58922a)[_0xb9e9('0x47')](0x0);return _0x5b51f5[_0xb9e9('0x48')](_0xe9f4b3,_0xb9e9('0x49'));}function ifInterval(_0x1e8235,_0x2aa2cc){if(_['isUndefined'](_0x2aa2cc)){return![];}return getDiff(_0x2aa2cc)<_0x1e8235*0x3c;}function freeVariablesPredictive(_0x1b01f5){if(isNotNull(_0x1b01f5)){if(!_[_0xb9e9('0x3a')](_0x1b01f5[_0xb9e9('0x28')])){_0x1b01f5[_0xb9e9('0x28')]=undefined;loggerPredictive['info'](_0x1b01f5['name'],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x1b01f5['startPredictive'])){_0x1b01f5[_0xb9e9('0x27')]=undefined;loggerPredictive[_0xb9e9('0x75')](_0x1b01f5[_0xb9e9('0x3d')],_0xb9e9('0x86'));}if(!_[_0xb9e9('0x3a')](_0x1b01f5[_0xb9e9('0x87')])){clearInterval(_0x1b01f5[_0xb9e9('0x87')]);_0x1b01f5[_0xb9e9('0x87')]=undefined;loggerPredictive['info'](_0x1b01f5[_0xb9e9('0x3d')],_0xb9e9('0x88'));}}}function erlangb(_0x4371f2,_0x34f5f7){if(_0x34f5f7===0x0){return 0x0;}var _0x2f061d=0x1;for(var _0x3137f9=0x1;_0x3137f9<=_0x34f5f7;_0x3137f9+=0x1){_0x2f061d=0x1+_0x2f061d*_0x3137f9/_0x4371f2;}return 0x1/_0x2f061d;}function isVoiceQueueOutbound(_0x2e78a1){return _0x2e78a1==='outbound';}function isNotPreview(_0x25fcfc){return _0x25fcfc!=='preview';}function isCampaignIvr(_0x58f432){return _0x58f432==='ivr';}function getCallerId(_0x2e7e33,_0xb664b,_0x4428a4){if(!_[_0xb9e9('0x3a')](_0x4428a4)&&typeof _0x4428a4===_0xb9e9('0x89')&&!_[_0xb9e9('0x43')](_0x4428a4)){if(!_[_0xb9e9('0x3a')](_0xb664b)&&typeof _0xb664b===_0xb9e9('0x89')&&!_[_0xb9e9('0x43')](_0xb664b)){return util[_0xb9e9('0x70')](_0xb9e9('0x8a'),_0xb664b,_0x4428a4);}return util[_0xb9e9('0x70')]('\x22%s\x22\x20<%s>',_0x4428a4,_0x4428a4);}if(!_[_0xb9e9('0x3a')](_0x2e7e33)&&typeof _0x2e7e33===_0xb9e9('0x89')&&!_[_0xb9e9('0x43')](_0x2e7e33)){return _0x2e7e33;}return _0xb9e9('0x8b');}function loggerCatchQueueSummary(_0x3a1f28,_0x5eabba){return function(_0x3d0682){freeVariablesPredictive(_0x5eabba);emitVoiceQueueSummary(_0x5eabba);emitCampaignSummary(_0x5eabba);loggerSyncQueueSummary[_0xb9e9('0x8c')](_0x3a1f28,util[_0xb9e9('0x8d')](_0x3d0682,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x303aa0,_0x4b48d6){return function(_0x58bd8d){loggerPredictive['error'](_0x4b48d6[_0xb9e9('0x3d')],_0x303aa0);loggerPredictive[_0xb9e9('0x8c')](_0x58bd8d[_0xb9e9('0x8e')]);freeVariablesPredictive(_0x4b48d6);};}function loggerCatch(_0xe9ca39){return function(_0x486c0a){logger[_0xb9e9('0x8c')](_0xe9ca39,util[_0xb9e9('0x8d')](_0x486c0a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x451bec){return _0x451bec&&!_[_0xb9e9('0x3a')](_0x451bec)&&_0x451bec[_0xb9e9('0x8f')]>0x0;}function decremetOriginate(_0x15d39e){if(!_['isUndefined'](_0x15d39e)&&_0x15d39e!==null){if(typeof _0x15d39e[_0xb9e9('0x6b')]!=='undefined'){if(_0x15d39e[_0xb9e9('0x6b')]>0x0){_0x15d39e[_0xb9e9('0x6b')]-=0x1;}else{logger['error'](_0xb9e9('0x90'));}}}else{logger[_0xb9e9('0x8c')](_0xb9e9('0x91'));}}function checkContactLowerLimitOriginate(_0x17875a,_0x592f5d,_0x39afc3){if(_0x592f5d>_0x39afc3){for(var _0x3312a6=0x0;_0x3312a6<_0x592f5d-_0x39afc3;_0x3312a6+=0x1){decremetOriginate(_0x17875a);}}}function loggerGetContactDialer(_0x145a76,_0x1bb385,_0x19d4bf){return function(_0x38bc99){checkContactLowerLimitOriginate(_0x1bb385,_0x19d4bf,0x0);logger[_0xb9e9('0x8c')](_0x145a76,util[_0xb9e9('0x8d')](_0x38bc99,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5b67b8){return function(_0x533461){if(isNotNull(_0x533461)&&isNotNull(_0x533461[0x0])){if(_0x533461[0x0][_0xb9e9('0x92')]>0x0){_0x5b67b8[_0xb9e9('0x3b')]=_0xb9e9('0x93');logger[_0xb9e9('0x75')]('[getContactDialer2][ReScheduled]'+_0x5b67b8[_0xb9e9('0x3d')],_0x533461[0x0][_0xb9e9('0x92')],_0xb9e9('0x94'));}else{_0x5b67b8['message']=_0xb9e9('0x95');logger[_0xb9e9('0x75')](_0xb9e9('0x96')+_0x5b67b8[_0xb9e9('0x3d')]);}}};}function notSendMessagesQueue(_0x502899){if(_0x502899[_0xb9e9('0x97')]){freeVariablesPredictive(_0x502899);if(_0x502899['originated']===0x0&&_0x502899[_0xb9e9('0x50')]===0x0&&_0x502899[_0xb9e9('0x55')]===0x0&&(_0x502899[_0xb9e9('0x98')]||0x0)===0x0){_0x502899['sendMessageOneNotActive']=![];_0x502899[_0xb9e9('0x4d')]=0x0;_0x502899[_0xb9e9('0x3b')]=_0xb9e9('0x99');loggerSyncQueueSummary[_0xb9e9('0x8c')](_0xb9e9('0x9a'),_0x502899[_0xb9e9('0x3d')],'is\x20not\x20active');}else{_0x502899[_0xb9e9('0x3b')]=_0xb9e9('0x9b');loggerSyncQueueSummary[_0xb9e9('0x8c')](_0xb9e9('0x9a'),_0x502899['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x502899);}}function notSendMessagesCampaign(_0x3ccf8f){if(_0x3ccf8f[_0xb9e9('0x97')]){if(_0x3ccf8f['originated']===0x0){_0x3ccf8f['sendMessageOneNotActive']=![];_0x3ccf8f[_0xb9e9('0x3b')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb9e9('0x8c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3ccf8f['name'],_0xb9e9('0x9c'));}else{_0x3ccf8f[_0xb9e9('0x3b')]=_0xb9e9('0x9b');loggerSyncQueueSummary['error'](_0xb9e9('0x9d'),_0x3ccf8f[_0xb9e9('0x3d')],'is\x20disactive');}emitCampaignSummary(_0x3ccf8f);}}function createObjHistory(_0x50b75c,_0x446792,_0x18f033,_0x27646b,_0x3ea3b0){_0x50b75c[_0xb9e9('0x3b')]=_0x18f033;var _0x1376d6=new Action(_0x50b75c,_0x446792);var _0x373139=new History(_0x1376d6);_0x373139['state']=_0x27646b;_0x373139[_0xb9e9('0x9e')]=_0x3ea3b0;_0x373139['endtime']=_0x1376d6[_0xb9e9('0x9f')];return _0x373139;}Dialer[_0xb9e9('0xa0')][_0xb9e9('0x39')]=function(){var _0x375812=this;setInterval(function(){_0x375812['clearZombieChannels'](_0x375812[_0xb9e9('0x25')],_0xb9e9('0xa1'));_0x375812[_0xb9e9('0xa2')](_0x375812['actions'],_0xb9e9('0xa3'));},0x32c8);};Dialer['prototype'][_0xb9e9('0xa2')]=function(_0x181332,_0x413945){var _0x5bedd9=this;for(var _0xb06b7b in _0x181332){if(typeof _0x181332[_0xb06b7b]!==_0xb9e9('0xa4')){this[_0xb9e9('0xa5')]['enqueue'](function(){if(!_['isNil'](_0x181332[_0xb06b7b])){return ami['Action']({'action':_0xb9e9('0xa6'),'channel':_0x181332[_0xb06b7b][_0xb9e9('0xa7')]})[_0xb9e9('0xa8')](function(_0x9aaa2f){if(_0x9aaa2f['message']===_0xb9e9('0xa9')){setTimeout(function(){if(_0x181332[_0xb06b7b]&&_0x181332[_0xb06b7b][_0xb9e9('0x52')]!==_0xb9e9('0x73')){_0x5bedd9['updateOriginated'](_0x5bedd9[_0xb9e9('0x1d')][_0x181332[_0xb06b7b][_0xb9e9('0xaa')]]);logger[_0xb9e9('0x8c')](_0xb9e9('0xab'),_0x413945,_0xb06b7b,_0x181332[_0xb06b7b][_0xb9e9('0xaa')]);delete _0x181332[_0xb06b7b];}if(_0x181332[_0xb06b7b]&&_0x181332[_0xb06b7b][_0xb9e9('0x52')]==='ivr'){_0x5bedd9['updateOriginated'](_0x5bedd9[_0xb9e9('0x1e')][_0x181332[_0xb06b7b][_0xb9e9('0xaa')]]);logger[_0xb9e9('0x8c')]('[Dialer][checkChannel][ivr]',_0x413945,_0xb06b7b,_0x181332[_0xb06b7b]['queue']);delete _0x181332[_0xb06b7b];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x187ca3){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopper[_0xb9e9('0xae')](_0x187ca3))['catch'](loggerCatch(_0xb9e9('0xaf')));};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xb0')]=function(_0x50a1c6){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopperBlack[_0xb9e9('0xb0')](_0x50a1c6))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xb1')));};Dialer[_0xb9e9('0xa0')]['checkIsBlackListIvr']=function(_0x517ec3){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopperBlack['checkIsBlackListIvr'](_0x517ec3))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xb2')));};Dialer['prototype'][_0xb9e9('0xb3')]=function(_0x1f0197){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopperHistory[_0xb9e9('0xb4')](_0x1f0197))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xb5')));};Dialer['prototype'][_0xb9e9('0xb6')]=function(_0x746175){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopper['rescheduleContact'](_0x746175))['catch'](loggerCatch(_0xb9e9('0xb7')));};Dialer['prototype'][_0xb9e9('0xb8')]=function(_0xc3c314,_0x403b7b,_0x419105){return BPromise[_0xb9e9('0xac')]()['then'](cmHopper[_0xb9e9('0xb8')](_0xc3c314,_0x403b7b,_0x419105))[_0xb9e9('0xa8')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xb9')]=function(_0x572ffb,_0x336fcd,_0x419801,_0x244d06,_0x46fe1d){return BPromise['resolve']()[_0xb9e9('0xad')](cmHopper['getContactDialer'](_0x572ffb,_0x336fcd,_0x419801,_0x244d06))[_0xb9e9('0xa8')](function(_0x551677){_0x46fe1d[_0xb9e9('0xba')]-=_0x419801;_0x46fe1d[_0xb9e9('0xba')]=_0x46fe1d[_0xb9e9('0xba')]>0x0?_0x46fe1d['temp']:0x0;loggerCatch(_0xb9e9('0xbb'))(_0x551677);});};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xbc')]=function(_0x4a684a,_0x5499f1,_0x456e00,_0x57079c){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopper[_0xb9e9('0xbc')](_0x4a684a,_0x5499f1,_0x456e00))[_0xb9e9('0xa8')](function(_0x889c9b){_0x57079c[_0xb9e9('0xba')]-=_0x5499f1;_0x57079c[_0xb9e9('0xba')]=_0x57079c[_0xb9e9('0xba')]>0x0?_0x57079c[_0xb9e9('0xba')]:0x0;loggerCatch(_0xb9e9('0xbd'))(_0x889c9b);});};Dialer['prototype'][_0xb9e9('0xbe')]=function(_0x257e2f){return BPromise['resolve']()[_0xb9e9('0xad')](voiceQueueRt['getVoiceQueueRtPauses'](_0x257e2f))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xbf')));};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xc0')]=function(_0x2090b7){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopper[_0xb9e9('0xc0')](_0x2090b7))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xc1')));};Dialer[_0xb9e9('0xa0')]['createHistory']=function(_0x51a44c){return BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](cmHopperHistory[_0xb9e9('0xc2')](_0x51a44c))['catch'](loggerCatch(_0xb9e9('0xc3')));};Dialer['prototype'][_0xb9e9('0xc4')]=function(_0x5d4f4e){if(!_[_0xb9e9('0x3a')](_0x5d4f4e)&&_0x5d4f4e!==null){if(typeof _0x5d4f4e[_0xb9e9('0x6b')]!=='undefined'){if(_0x5d4f4e['originated']>0x0){_0x5d4f4e[_0xb9e9('0x6b')]-=0x1;}else{logger[_0xb9e9('0x8c')](_0xb9e9('0xc5'));}}}else{logger[_0xb9e9('0x8c')](_0xb9e9('0xc6'));}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xc7')]=function(_0x4d245e,_0x598997){var _0xa8076f=this;return function(_0x57a92e){_0xa8076f['updateOriginated'](_0x598997);logger[_0xb9e9('0x8c')](_0x4d245e,util[_0xb9e9('0x8d')](_0x57a92e,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xb9e9('0xc8')]=function(_0x1fa448,_0x5aa098,_0x57603b){var _0x2d950b={'state':0x19,'statedesc':_0xb9e9('0xc9')};this[_0xb9e9('0xc4')](_0x5aa098);this[_0xb9e9('0xca')](_[_0xb9e9('0x85')](_0x2d950b,_[_0xb9e9('0xcb')](_0x57603b,['ContactId',_0xb9e9('0xcc'),'UserId','VoiceQueueId',_0xb9e9('0xcd')])),'[emptyContact][createHistory]',_0xb9e9('0xce'));logger[_0xb9e9('0x8c')](_0x1fa448);};Dialer['prototype'][_0xb9e9('0xcf')]=function(_0x3a197b){return _0x3a197b===_0xb9e9('0xd0');};Dialer['prototype'][_0xb9e9('0xd1')]=function(_0x5477f6){return!_['isUndefined'](_0x5477f6)&&_0x5477f6&&!_['isUndefined'](_0x5477f6[_0xb9e9('0x3d')])&&!_['isUndefined'](_0x5477f6[_0xb9e9('0x6f')])&&_0x5477f6['active']&&(this[_0xb9e9('0x20')][util[_0xb9e9('0x70')](_0xb9e9('0xd2'),_0x5477f6['name'])][_0xb9e9('0xa6')]===_0xb9e9('0xd3')||this[_0xb9e9('0x20')][util[_0xb9e9('0x70')]('SIP/%s',_0x5477f6[_0xb9e9('0x3d')])][_0xb9e9('0xa6')]===_0xb9e9('0xd4'));};Dialer['prototype'][_0xb9e9('0xca')]=function(_0x3ba81e,_0x21916a,_0x3ac402){this['createHistory'](_0x3ba81e)[_0xb9e9('0xa8')](loggerCatch(_0x21916a));this[_0xb9e9('0xc0')](_0x3ba81e)[_0xb9e9('0xa8')](loggerCatch(_0x3ac402));};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x35')]=function(_0x12decb){var _0x2fd53f=this[_0xb9e9('0x25')][_0x12decb[_0xb9e9('0xd5')]];var _0x36ad3a;if(!_[_0xb9e9('0xd6')](_0x12decb)&&!_[_0xb9e9('0xd6')](_0x12decb[_0xb9e9('0xd7')])&&!_[_0xb9e9('0xd6')](_0x12decb[_0xb9e9('0xd7')][_0xb9e9('0xd8')])&&_0x12decb[_0xb9e9('0xd9')]==='xcally-motion-dialer'&&_0x2fd53f){if(_0x2fd53f[_0xb9e9('0x52')]!==_0xb9e9('0x73')&&this['voiceQueues'][_0x2fd53f[_0xb9e9('0xaa')]]['dialAMDActive']&&_0x12decb['value']==='HANGUP'){delete this['uniqueId'][_0x12decb[_0xb9e9('0xd5')]];this['updateOriginated'](this[_0xb9e9('0x1d')][_0x2fd53f[_0xb9e9('0xaa')]]);this['voiceQueues'][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0x5b')]+=0x1;this[_0xb9e9('0x1d')][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0x5a')]+=0x1;_0x36ad3a=new Hangup(_0x2fd53f,_0x12decb);_0x36ad3a[_0xb9e9('0xda')]=0x12;_0x36ad3a[_0xb9e9('0x9e')]=_0xb9e9('0xdb');_0x36ad3a[_0xb9e9('0xdc')]=_0xb9e9('0xdd');ami['emit'](_0xb9e9('0xde'),ut[_0xb9e9('0xdf')](_0x36ad3a,'amd'));this['saveInDb'](_0x36ad3a,_0xb9e9('0xe0'),_0xb9e9('0xe1'));}if(_0x2fd53f[_0xb9e9('0x52')]!==_0xb9e9('0x73')&&this['voiceQueues'][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0xe2')]&&_0x12decb[_0xb9e9('0xe3')]===_0xb9e9('0xe4')){var _0x3c8fc6=this;return new BPromise(function(_0x26ed44,_0xdbeb90){delete _0x3c8fc6[_0xb9e9('0x25')][_0x12decb[_0xb9e9('0xd5')]];_0x3c8fc6['updateOriginated'](_0x3c8fc6['voiceQueues'][_0x2fd53f[_0xb9e9('0xaa')]]);_0x3c8fc6[_0xb9e9('0x1d')][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0x5b')]+=0x1;_0x3c8fc6[_0xb9e9('0x1d')][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0x5a')]+=0x1;var _0x225031=_0x3c8fc6[_0xb9e9('0x1d')][_0x2fd53f[_0xb9e9('0xaa')]];var _0x57489a=new Hangup(_0x2fd53f,_0x12decb);_0x57489a[_0xb9e9('0xda')]=0x13;_0x57489a[_0xb9e9('0x9e')]=_0xb9e9('0xe5');_0x57489a[_0xb9e9('0xdc')]=_0xb9e9('0xdd');_0x57489a[_0xb9e9('0xe6')]+=0x1;_0x57489a[_0xb9e9('0xe7')]+=0x1;_0x57489a['amd']=!![];ami[_0xb9e9('0xe8')](_0xb9e9('0xde'),ut[_0xb9e9('0xdf')](_0x57489a,_0xb9e9('0xe9')));_0x3c8fc6[_0xb9e9('0xc2')](_0x57489a)[_0xb9e9('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x57489a[_0xb9e9('0xea')]+_0x57489a[_0xb9e9('0xeb')]+_0x57489a[_0xb9e9('0xec')]+_0x57489a[_0xb9e9('0xed')]+_0x57489a['countdropretry']+_0x57489a['countabandonedretry']+_0x57489a[_0xb9e9('0xe6')]+_0x57489a['countagentrejectretry']>=_0x225031['dialGlobalMaxRetry']){_0x3c8fc6[_0xb9e9('0xee')](_0x57489a,_0x26ed44,_0xdbeb90,'reason19\x20machine....');}else{if(_0x57489a[_0xb9e9('0xe6')]>=_0x225031[_0xb9e9('0xef')]){_0x3c8fc6[_0xb9e9('0xf0')](_0x57489a,_0x26ed44,_0xdbeb90,_0xb9e9('0xf1'));}else{_0x3c8fc6[_0xb9e9('0xb6')]({'active':![],'countmachineretry':_0x57489a['countmachineretry'],'scheduledat':moment()[_0xb9e9('0xf2')](_0x225031[_0xb9e9('0xf3')],_0xb9e9('0xf4'))[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57489a[_0xb9e9('0xf5')],'ListId':_0x57489a[_0xb9e9('0xcc')],'VoiceQueueId':_0x57489a[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x57489a[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x26ed44({'reschedule':0x1});}}});}if(_0x2fd53f[_0xb9e9('0x52')]===_0xb9e9('0x73')&&this['campaigns'][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0xe2')]&&_0x12decb[_0xb9e9('0xe3')]===_0xb9e9('0xf7')){delete this[_0xb9e9('0x25')][_0x12decb[_0xb9e9('0xd5')]];this[_0xb9e9('0xc4')](this[_0xb9e9('0x1e')][_0x2fd53f[_0xb9e9('0xaa')]]);_0x36ad3a=new Hangup(_0x2fd53f,_0x12decb);_0x36ad3a[_0xb9e9('0xda')]=0x12;_0x36ad3a[_0xb9e9('0x9e')]=_0xb9e9('0xdb');_0x36ad3a[_0xb9e9('0xdc')]=_0xb9e9('0xdd');ami[_0xb9e9('0xe8')]('custom:amd',ut[_0xb9e9('0xdf')](_0x36ad3a,_0xb9e9('0xe9')));this['saveInDb'](_0x36ad3a,_0xb9e9('0xf8'),_0xb9e9('0xf9'));}if(_0x2fd53f[_0xb9e9('0x52')]===_0xb9e9('0x73')&&this['campaigns'][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0xe2')]&&_0x12decb[_0xb9e9('0xe3')]===_0xb9e9('0xe4')){var _0x3c8fc6=this;return new BPromise(function(_0x3c63e8,_0x1722f5){delete _0x3c8fc6['uniqueId'][_0x12decb[_0xb9e9('0xd5')]];_0x3c8fc6[_0xb9e9('0xc4')](_0x3c8fc6['campaigns'][_0x2fd53f['queue']]);_0x3c8fc6[_0xb9e9('0x1e')][_0x2fd53f[_0xb9e9('0xaa')]][_0xb9e9('0x5b')]+=0x1;_0x3c8fc6['campaigns'][_0x2fd53f[_0xb9e9('0xaa')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x67be1b=_0x3c8fc6['campaigns'][_0x2fd53f[_0xb9e9('0xaa')]];var _0x217c6c=new Hangup(_0x2fd53f,_0x12decb);_0x217c6c['state']=0x13;_0x217c6c[_0xb9e9('0x9e')]='Machine';_0x217c6c[_0xb9e9('0xdc')]=_0xb9e9('0xdd');_0x217c6c[_0xb9e9('0xe6')]+=0x1;_0x217c6c[_0xb9e9('0xe7')]+=0x1;_0x217c6c[_0xb9e9('0xe9')]=!![];ami['emit'](_0xb9e9('0xde'),ut[_0xb9e9('0xdf')](_0x217c6c,_0xb9e9('0xe9')));_0x3c8fc6[_0xb9e9('0xc2')](_0x217c6c)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xfa')));if(_0x217c6c[_0xb9e9('0xea')]+_0x217c6c[_0xb9e9('0xeb')]+_0x217c6c[_0xb9e9('0xec')]+_0x217c6c[_0xb9e9('0xed')]+_0x217c6c[_0xb9e9('0xfb')]+_0x217c6c[_0xb9e9('0xfc')]+_0x217c6c[_0xb9e9('0xe6')]+_0x217c6c['countagentrejectretry']>=_0x67be1b[_0xb9e9('0xfd')]){_0x3c8fc6[_0xb9e9('0xee')](_0x217c6c,_0x3c63e8,_0x1722f5,_0xb9e9('0xfe'));}else{if(_0x217c6c[_0xb9e9('0xe6')]>=_0x67be1b[_0xb9e9('0xef')]){_0x3c8fc6[_0xb9e9('0xf0')](_0x217c6c,_0x3c63e8,_0x1722f5,_0xb9e9('0xf1'));}else{_0x3c8fc6[_0xb9e9('0xb6')]({'active':![],'countmachineretry':_0x217c6c[_0xb9e9('0xe6')],'scheduledat':moment()[_0xb9e9('0xf2')](_0x67be1b[_0xb9e9('0xf3')],_0xb9e9('0xf4'))[_0xb9e9('0x70')](_0xb9e9('0xff')),'ContactId':_0x217c6c['ContactId'],'ListId':_0x217c6c[_0xb9e9('0xcc')],'VoiceQueueId':_0x217c6c[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x217c6c[_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch(_0xb9e9('0x100')));_0x3c63e8({'reschedule':0x1});}}});}}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x34')]=function(_0x40ac6a){var _0x552cb6=this[_0xb9e9('0x25')][_0x40ac6a[_0xb9e9('0xd5')]];var _0x4d3968=this;var _0x3cd548;if(_0x552cb6&&_0x552cb6[_0xb9e9('0x52')]===_0xb9e9('0x73')){delete this['uniqueId'][_0x40ac6a[_0xb9e9('0xd5')]];this[_0xb9e9('0xc4')](this['campaigns'][_0x552cb6[_0xb9e9('0xaa')]]);this[_0xb9e9('0x1e')][_0x552cb6[_0xb9e9('0xaa')]][_0xb9e9('0x101')]+=0x1;_0x3cd548=new Hangup(_0x552cb6,_0x40ac6a);this[_0xb9e9('0xc2')](_0x3cd548)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x102')));this['moveContactManagedDialer'](_0x3cd548)['catch'](loggerCatch(_0xb9e9('0x103')));}if(_0x552cb6&&_0x552cb6[_0xb9e9('0x52')]!==_0xb9e9('0x73')&&isNotNull(this[_0xb9e9('0x1d')][_0x552cb6['queue']][_0xb9e9('0x104')])){delete this[_0xb9e9('0x25')][_0x40ac6a[_0xb9e9('0xd5')]];this[_0xb9e9('0xc4')](this[_0xb9e9('0x1d')][_0x552cb6['queue']]);this[_0xb9e9('0x1d')][_0x552cb6[_0xb9e9('0xaa')]][_0xb9e9('0x5b')]+=0x1;this[_0xb9e9('0x1d')][_0x552cb6['queue']][_0xb9e9('0x5a')]+=0x1;_0x3cd548=new Hangup(_0x552cb6,_0x40ac6a);_0x3cd548[_0xb9e9('0xda')]=0x10;_0x3cd548[_0xb9e9('0x9e')]=_0xb9e9('0x105');_0x3cd548[_0xb9e9('0xdc')]=_0xb9e9('0x106');this[_0xb9e9('0xc2')](_0x3cd548)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x102')));this[_0xb9e9('0xc0')](_0x3cd548)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x103')));}if(_0x552cb6&&_0x552cb6[_0xb9e9('0x52')]!==_0xb9e9('0x73')&&!isNotNull(this[_0xb9e9('0x1d')][_0x552cb6[_0xb9e9('0xaa')]]['dialQueueProject'])){delete this[_0xb9e9('0x25')][_0x40ac6a[_0xb9e9('0xd5')]];this['updateOriginated'](this[_0xb9e9('0x1d')][_0x552cb6[_0xb9e9('0xaa')]]);this[_0xb9e9('0x1d')][_0x552cb6['queue']]['outboundUnknownCallsDay']+=0x1;_0x3cd548=new Hangup(_0x552cb6,_0x40ac6a);_0x3cd548['state']=0xc;_0x3cd548[_0xb9e9('0x9e')]=_0x40ac6a[_0xb9e9('0x107')];_0x3cd548[_0xb9e9('0xdc')]='Unknow';this[_0xb9e9('0xc2')](_0x3cd548)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x102')));this[_0xb9e9('0xc0')](_0x3cd548)[_0xb9e9('0xa8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x108')]=function(_0x37e98a){var _0x4455cf=this[_0xb9e9('0x25')][_0x37e98a[_0xb9e9('0xd5')]];var _0x3c02e7=this;if(this[_0xb9e9('0x1d')][_0x37e98a[_0xb9e9('0xaa')]]){if(_0x4455cf&&_0x4455cf[_0xb9e9('0x52')]!=='ivr'){delete this[_0xb9e9('0x25')][_0x37e98a[_0xb9e9('0xd5')]];this[_0xb9e9('0x1d')][_0x37e98a[_0xb9e9('0xaa')]][_0xb9e9('0x5b')]+=0x1;var _0x4413b6=new AgentComplete(_0x4455cf,_0x37e98a);if(_0x37e98a[_0xb9e9('0x109')]===_0xb9e9('0x10a')){_0x4413b6[_0xb9e9('0x10b')]=this['voiceQueues'][_0x37e98a[_0xb9e9('0xaa')]]['dialQueueProject2']&&this[_0xb9e9('0x1d')][_0x37e98a[_0xb9e9('0xaa')]][_0xb9e9('0x10c')]?moment()['format'](_0xb9e9('0xff')):undefined;}this[_0xb9e9('0xc2')](_0x4413b6)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x10d')));this[_0xb9e9('0xc0')](_0x4413b6)['catch'](loggerCatch(_0xb9e9('0x10e')));}}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x10f')]=function(_0xdf17b6){if(this[_0xb9e9('0x1d')][_0xdf17b6[_0xb9e9('0xaa')]]){if(this[_0xb9e9('0x25')][_0xdf17b6['uniqueid']]&&this[_0xb9e9('0x25')][_0xdf17b6[_0xb9e9('0xd5')]][_0xb9e9('0x52')]!==_0xb9e9('0x73')){this[_0xb9e9('0xc4')](this['voiceQueues'][_0xdf17b6[_0xb9e9('0xaa')]]);this[_0xb9e9('0x25')][_0xdf17b6[_0xb9e9('0xd5')]][_0xb9e9('0x110')]=moment()['format'](_0xb9e9('0xff'));}}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x111')]=function(_0x38c13d){this[_0xb9e9('0xc2')](_0x38c13d)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x10d')));this['moveContactManagedDialer'](_0x38c13d)['catch'](loggerCatch(_0xb9e9('0x112')));};Dialer[_0xb9e9('0xa0')]['syncQueueCallerAbandon']=function(_0x5da450){var _0x4a16ac=this[_0xb9e9('0x25')][_0x5da450[_0xb9e9('0xd5')]];var _0x1343be=this;if(this[_0xb9e9('0x1d')][_0x5da450[_0xb9e9('0xaa')]]){if(_0x4a16ac&&_0x4a16ac['type']!=='ivr'){delete this[_0xb9e9('0x25')][_0x5da450[_0xb9e9('0xd5')]];this[_0xb9e9('0xc4')](this[_0xb9e9('0x1d')][_0x5da450[_0xb9e9('0xaa')]]);_0x4a16ac['droptime']=moment()[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x54f2c3=new QueueCallerAbandon(_0x4a16ac,_0x5da450);if(getSeconds(_0x4a16ac[_0xb9e9('0x113')],_0x4a16ac[_0xb9e9('0x114')])>=_0x4a16ac[_0xb9e9('0x115')]){this['voiceQueues'][_0x5da450[_0xb9e9('0xaa')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x5da450[_0xb9e9('0xaa')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xb9e9('0x1d')][_0x5da450[_0xb9e9('0xaa')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x54f2c3['state']=0xa;_0x54f2c3[_0xb9e9('0x9e')]='Drop';_0x54f2c3['dropreason']=_0xb9e9('0x116');_0x54f2c3[_0xb9e9('0x10b')]=this['voiceQueues'][_0x5da450[_0xb9e9('0xaa')]][_0xb9e9('0x117')]?moment()['format'](_0xb9e9('0xff')):undefined;_0x54f2c3[_0xb9e9('0xfb')]+=0x1;_0x54f2c3[_0xb9e9('0xe7')]+=0x1;if(_0x54f2c3[_0xb9e9('0xfb')]>=this['voiceQueues'][_0x5da450['queue']][_0xb9e9('0x118')]){this[_0xb9e9('0x111')](_0x54f2c3);}else{this[_0xb9e9('0xb6')]({'active':![],'countdropretry':_0x54f2c3[_0xb9e9('0xfb')],'scheduledat':moment()['add'](this[_0xb9e9('0x1d')][_0x5da450['queue']][_0xb9e9('0x119')],_0xb9e9('0xf4'))['format'](_0xb9e9('0xff')),'ContactId':_0x4a16ac[_0xb9e9('0xf5')],'ListId':_0x4a16ac[_0xb9e9('0xcc')],'VoiceQueueId':_0x4a16ac['VoiceQueueId']||undefined,'CampaignId':_0x4a16ac[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x11a')));var _0x5c58e2=new History(_0x54f2c3);_0x5c58e2['state']=0xa;_0x5c58e2['statedesc']=_0xb9e9('0x11b');_0x5c58e2['starttime']=moment()[_0xb9e9('0x70')](_0xb9e9('0xff'));_0x5c58e2[_0xb9e9('0x11c')]=_0x5c58e2[_0xb9e9('0x9f')];_0x5c58e2['calleridname']=_0x54f2c3[_0xb9e9('0x11d')];_0x5c58e2['calleridnum']=_0x54f2c3[_0xb9e9('0x11e')];this[_0xb9e9('0xc2')](_0x5c58e2)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x11f')));}}else{this[_0xb9e9('0x1d')][_0x5da450[_0xb9e9('0xaa')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xb9e9('0x1d')][_0x5da450['queue']][_0xb9e9('0x5f')]+=0x1;_0x54f2c3[_0xb9e9('0xda')]=0xb;_0x54f2c3[_0xb9e9('0x9e')]=_0xb9e9('0x120');_0x54f2c3[_0xb9e9('0x121')]='CALLEREXIT';_0x54f2c3[_0xb9e9('0xfc')]+=0x1;_0x54f2c3[_0xb9e9('0xe7')]+=0x1;if(_0x54f2c3[_0xb9e9('0xfc')]>=this['voiceQueues'][_0x5da450[_0xb9e9('0xaa')]][_0xb9e9('0x122')]){this[_0xb9e9('0x111')](_0x54f2c3);}else{this[_0xb9e9('0xb6')]({'active':![],'countabandonedretry':_0x54f2c3[_0xb9e9('0xfc')],'scheduledat':moment()[_0xb9e9('0xf2')](this[_0xb9e9('0x1d')][_0x5da450[_0xb9e9('0xaa')]][_0xb9e9('0x123')],_0xb9e9('0xf4'))[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a16ac['ContactId'],'ListId':_0x4a16ac[_0xb9e9('0xcc')],'VoiceQueueId':_0x4a16ac['VoiceQueueId']||undefined,'CampaignId':_0x4a16ac[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5c58e2=new History(_0x54f2c3);_0x5c58e2['state']=0xb;_0x5c58e2[_0xb9e9('0x9e')]='Abandoned';_0x5c58e2['starttime']=moment()[_0xb9e9('0x70')](_0xb9e9('0xff'));_0x5c58e2[_0xb9e9('0x11c')]=_0x5c58e2[_0xb9e9('0x9f')];_0x5c58e2[_0xb9e9('0x11d')]=_0x54f2c3[_0xb9e9('0x11d')];_0x5c58e2[_0xb9e9('0x11e')]=_0x54f2c3[_0xb9e9('0x11e')];this[_0xb9e9('0xc2')](_0x5c58e2)[_0xb9e9('0xa8')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x124')]=function(_0x4838e1){if(this[_0xb9e9('0x23')][_0x4838e1[_0xb9e9('0xd5')]]){this['actions'][_0x4838e1['uniqueid']]['channel']=_0x4838e1[_0xb9e9('0xa7')];}if(this['uniqueId'][_0x4838e1[_0xb9e9('0xd5')]]){this[_0xb9e9('0x25')][_0x4838e1['uniqueid']][_0xb9e9('0xa7')]=_0x4838e1[_0xb9e9('0xa7')];}};Dialer['prototype'][_0xb9e9('0x36')]=function(_0x38fb6a){if(strategy[this[_0xb9e9('0x1d')][this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]['strategy']]===_0xb9e9('0x18')){if(this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]]&&_['isNil'](this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]]['locked'])&&_0x38fb6a[_0xb9e9('0xa6')]==='1'&&_0x38fb6a[_0xb9e9('0x126')]==='0'){if(this['agents'][_0x38fb6a[_0xb9e9('0x127')]]){if(!this[_0xb9e9('0x1f')][_0x38fb6a['stateinterface']][_0xb9e9('0x128')]){this[_0xb9e9('0x1f')][_0x38fb6a[_0xb9e9('0x127')]][_0xb9e9('0x128')]=!![];this[_0xb9e9('0x23')][_0x38fb6a['actionid']][_0xb9e9('0x128')]=!![];this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]][_0xb9e9('0x127')]=_0x38fb6a['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]['strategy']]||_0xb9e9('0x17'))===_0xb9e9('0x17')){if(this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]]){if(this['agents'][_0x38fb6a['stateinterface']]){this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]]['stateinterface']=_0x38fb6a[_0xb9e9('0x127')];if(_[_0xb9e9('0xd6')](this[_0xb9e9('0x2a')][this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]][_0xb9e9('0xaa')]])){this[_0xb9e9('0x2a')][this[_0xb9e9('0x23')][_0x38fb6a['actionid']][_0xb9e9('0xaa')]]=[];}this[_0xb9e9('0x2a')][this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]][_0xb9e9('0xaa')]][_0xb9e9('0x129')](_[_0xb9e9('0x85')](_[_0xb9e9('0xcb')](this[_0xb9e9('0x23')][_0x38fb6a[_0xb9e9('0x125')]],[_0xb9e9('0x12a'),_0xb9e9('0x127')]),{'status':_0x38fb6a[_0xb9e9('0xa6')],'paused':_0x38fb6a[_0xb9e9('0x126')]}));}}}};function unlockQueueStatus(_0x2407ec,_0x23fd75){setTimeout(function(){if(_[_0xb9e9('0x3a')](_0x2407ec[_0xb9e9('0x12b')])){loggerBooked['error'](_0xb9e9('0x12c'),_0x23fd75);}_0x2407ec[_0xb9e9('0x12b')]=!![];loggerBooked[_0xb9e9('0x75')](_0xb9e9('0x12d'),_0x23fd75,JSON[_0xb9e9('0x46')](_[_0xb9e9('0xcb')](_0x2407ec,[_0xb9e9('0x3d'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xb9e9('0xa0')][_0xb9e9('0x38')]=function(_0x552e7b){var _0x364796=this;var _0x5f4c3d=_0x364796['voiceQueues'][_0x364796[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]]['queue']];if(strategy[this[_0xb9e9('0x1d')][this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]][_0xb9e9('0x4b')]]===_0xb9e9('0x18')){if(this['actions'][_0x552e7b['actionid']]&&this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0x127')]){this[_0xb9e9('0x1c')]['run'](this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0x12a')],this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0x127')])[_0xb9e9('0xa8')](function(_0x1f85e2){logger['error'](_0xb9e9('0x12e'),util['inspect'](_0x1f85e2,{'showHidden':![],'depth':null}));})['finally'](function(){_0x364796['updateOriginated'](_0x364796['voiceQueues'][_0x364796[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]);_0x364796[_0xb9e9('0x1f')][_0x364796[_0xb9e9('0x23')][_0x552e7b['actionid']][_0xb9e9('0x127')]]['locked']=![];delete _0x364796[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]];unlockQueueStatus(_0x5f4c3d);});}else{this[_0xb9e9('0xc4')](this[_0xb9e9('0x1d')][this['actions'][_0x552e7b[_0xb9e9('0x125')]]['queue']]);this[_0xb9e9('0xb6')]({'active':![],'ContactId':this['actions'][_0x552e7b['actionid']][_0xb9e9('0xf5')],'ListId':this['actions'][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xcc')],'VoiceQueueId':this['actions'][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xf6')]||undefined,'CampaignId':this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x12f')));delete this['actions'][_0x552e7b[_0xb9e9('0x125')]];unlockQueueStatus(_0x5f4c3d);}}else if((strategy[this[_0xb9e9('0x1d')][this['actions'][_0x552e7b['actionid']][_0xb9e9('0xaa')]]['strategy']]||_0xb9e9('0x17'))===_0xb9e9('0x17')){var _0x4689c7;if(this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]]&&!_[_0xb9e9('0x43')](this['queueBooked'][this[_0xb9e9('0x23')][_0x552e7b['actionid']][_0xb9e9('0xaa')]])){if(this['queueBookedRR'][_0x364796['actions'][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]){this['queueBookedRR'][_0x364796['actions'][_0x552e7b[_0xb9e9('0x125')]]['queue']]=this[_0xb9e9('0x130')][this['actions'][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]?this[_0xb9e9('0x130')][this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]:this[_0xb9e9('0x2a')][this[_0xb9e9('0x23')][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]]?this['queueBooked'][this['actions'][_0x552e7b[_0xb9e9('0x125')]]['queue']][_0xb9e9('0x131')]||0x0:0x0;}this[_0xb9e9('0x2a')][this['actions'][_0x552e7b[_0xb9e9('0x125')]][_0xb9e9('0xaa')]][_0xb9e9('0x131')]=this['queueBookedRR'][this[_0xb9e9('0x23')][_0x552e7b['actionid']][_0xb9e9('0xaa')]];for(var _0x597085=0x0;_0x597085=0x0;})['catch'](myreject(_0x5eddea)));}}else{_0x12625e[_0xb9e9('0x129')](ami[_0xb9e9('0x144')]({'action':_0xb9e9('0x145'),'command':util[_0xb9e9('0x70')](_0xb9e9('0x146'),_0x3f4755,!_[_0xb9e9('0x3a')](config[_0xb9e9('0x141')][_0x30911b])?_0x30911b:'')})[_0xb9e9('0xad')](function(_0x468b79){return _0x468b79['content'][_0xb9e9('0x149')](_0xb9e9('0x14a'))>=0x0;})[_0xb9e9('0xa8')](myreject(_0x5eddea)));}BPromise[_0xb9e9('0x14b')](_0x12625e)['then'](function(_0x3ff792){var _0x143383=_[_0xb9e9('0x14c')](_0x3ff792);if(_0x143383){return _0xe6119b(_0x143383);}else{_0x5d1f6d[_0xb9e9('0x3b')]=_0x44013b?'GLOBAL_INTERVAL_IS_OVERTIME':_0xb9e9('0x14d');return _0x5eddea(msgResponse(_0xb9e9('0x14e'),_0xb9e9('0x13d'),'Global:\x20'+_0x44013b+'\x20'+_0xfc3419+_0xb9e9('0x14f')+util[_0xb9e9('0x8d')](_0x3f4755,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x30911b));}})[_0xb9e9('0xa8')](function(_0x498a7a){return _0x5eddea(msgResponse(_0xb9e9('0x13b'),_0xb9e9('0x13d'),JSON['stringify'](_0x498a7a)));});});};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x150')]=function(_0x5cb897){var _0x105b30=this;return function(){switch(_0x5cb897[_0xb9e9('0x151')]){case _0xb9e9('0x152'):freeVariablesPredictive(_0x5cb897);_0x105b30[_0xb9e9('0x153')](_0x5cb897,0x1);break;case _0xb9e9('0x154'):freeVariablesPredictive(_0x5cb897);_0x105b30[_0xb9e9('0x153')](_0x5cb897,_0x5cb897[_0xb9e9('0x155')]);break;case'predictive':_0x105b30['predictive'](_0x5cb897);break;case'booked':freeVariablesPredictive(_0x5cb897);_0x105b30[_0xb9e9('0x153')](_0x5cb897,0x1);break;default:freeVariablesPredictive(_0x5cb897);logger[_0xb9e9('0x8c')](_0xb9e9('0x156'),_0x5cb897['name'],_0xb9e9('0x157'));}};};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x158')]=function(_0x16a879){var _0x518ce8=this;return function(){_0x518ce8[_0xb9e9('0x159')](_0x16a879);};};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xa')]=function(_0xe60b77){var _0x276322=this;if(isNotPreview(_0xe60b77[_0xb9e9('0x151')])){if(isVoiceQueueOutbound(_0xe60b77['type'])&&isActive(_0xe60b77[_0xb9e9('0x15a')])){_0xe60b77[_0xb9e9('0x97')]=!![];BPromise['resolve']()[_0xb9e9('0xad')](checkIsLoggedIn(_0xe60b77,_0xe60b77['loggedIn']))[_0xb9e9('0xad')](checkIsActive(_0xe60b77,_0xe60b77[_0xb9e9('0x15a')]))[_0xb9e9('0xad')](checkInterval(_0xe60b77))[_0xb9e9('0xad')](_0x276322['checkIsTrunkReachable'](_0xe60b77))[_0xb9e9('0xad')](_0x276322[_0xb9e9('0x13a')](_0xe60b77[_0xb9e9('0x15b')],_0xe60b77['dialTimezone'],_0xe60b77[_0xb9e9('0x3d')],_0xe60b77))['then'](_0x276322[_0xb9e9('0x13c')](_0xe60b77[_0xb9e9('0x40')],_0xe60b77[_0xb9e9('0x15c')],_0xe60b77[_0xb9e9('0x3d')],_0xe60b77))[_0xb9e9('0xad')](_0x276322[_0xb9e9('0x150')](_0xe60b77))[_0xb9e9('0xa8')](loggerCatchQueueSummary(_0xb9e9('0x15d'),_0xe60b77));}else{notSendMessagesQueue(_0xe60b77);}}else{freeVariablesPredictive(_0xe60b77);}};Dialer['prototype']['syncCampaigns']=function(){var _0x75e1cf=this;var _0x1f72a6;for(var _0x329d16 in this['campaigns']){if(typeof this[_0xb9e9('0x1e')][_0x329d16]!==_0xb9e9('0xa4')){_0x1f72a6=this[_0xb9e9('0x1e')][_0x329d16];if(isCampaignIvr(_0x1f72a6[_0xb9e9('0x52')])&&isActive(_0x1f72a6[_0xb9e9('0x6f')])){_0x1f72a6['sendMessageOneNotActive']=!![];BPromise[_0xb9e9('0xac')]()[_0xb9e9('0xad')](checkIsActive(_0x1f72a6,_0x1f72a6['active']))[_0xb9e9('0xad')](checkInterval(_0x1f72a6))[_0xb9e9('0xad')](_0x75e1cf[_0xb9e9('0x15e')](_0x1f72a6))[_0xb9e9('0xad')](_0x75e1cf[_0xb9e9('0x13a')](_0x1f72a6[_0xb9e9('0x15b')],_0x1f72a6[_0xb9e9('0x15c')],_0x1f72a6['name'],_0x1f72a6))['then'](_0x75e1cf[_0xb9e9('0x13c')](_0x1f72a6['Interval'],_0x1f72a6[_0xb9e9('0x15c')],_0x1f72a6[_0xb9e9('0x3d')],_0x1f72a6))[_0xb9e9('0xad')](_0x75e1cf[_0xb9e9('0x158')](_0x1f72a6))[_0xb9e9('0xa8')](loggerCatchQueueSummary(_0xb9e9('0x15f'),_0x1f72a6));}else{notSendMessagesCampaign(_0x1f72a6);}}}};function getCallerIdRandom(_0x45cd35,_0x26e122){var _0x39cff8;var _0x41fafa;var _0x26b94f;if(_0x26e122<=0x0){_0x26e122=0x1;}_0x39cff8=new RegExp(_0xb9e9('0x160')+_0x26e122+'}$');_0x41fafa=Math['pow'](0xa,_0x26e122-0x1);_0x26b94f=Math['pow'](0xa,_0x26e122)-0x1;return util[_0xb9e9('0x70')]('%s',_[_0xb9e9('0x161')](_0x45cd35,_0x39cff8,_[_0xb9e9('0x162')](_0x41fafa,_0x26b94f)));}function extractCalleridName(_0x578dc6){var _0x2184a7=_0x578dc6[_0xb9e9('0x163')](/"(.*?)"/);return _0x2184a7?_0x2184a7[0x1]:_0x578dc6;}function extractCalleridNumber(_0x857251){var _0x58945c=_0x857251['match'](/<(.*?)>/);return _0x58945c?_0x58945c[0x1]:_0x857251;}Dialer['prototype'][_0xb9e9('0x164')]=function(_0x18daf4,_0x433788){var _0x1948b9=this;var _0x11f32b=uuid['v4']();this[_0xb9e9('0x23')][_0x11f32b]=new Action(_0x18daf4,_0x433788,_0x11f32b);return new BPromise(function(_0x4952f8,_0x4de1d6){if(_[_0xb9e9('0x3a')](_0x18daf4)&&typeof _0x18daf4!==_0xb9e9('0x165')){return _0x4de1d6(msgResponse('originate',_0xb9e9('0x13d'),_0xb9e9('0x166')));}if(_[_0xb9e9('0x3a')](_0x433788[_0xb9e9('0x167')]['phone'])||_0x433788[_0xb9e9('0x167')][_0xb9e9('0x168')]===null){return _0x4de1d6(msgResponse(_0xb9e9('0x169'),_0xb9e9('0x13d'),_0xb9e9('0x16a')));}var _0x512706={'XMD-CALLERID':_0x1948b9[_0xb9e9('0x23')][_0x11f32b][_0xb9e9('0x16b')](),'XMD-AGI':_0x18daf4[_0xb9e9('0x104')]?util['format'](_0xb9e9('0x16c'),ipAgi,_0x18daf4['dialQueueProject']):_0xb9e9('0x16d'),'XMD-AGIAFTER':_0x18daf4[_0xb9e9('0x117')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x18daf4[_0xb9e9('0x117')]):_0xb9e9('0x16d'),'XMD-QUEUE':_0x18daf4['type']===_0xb9e9('0x4a')?util[_0xb9e9('0x70')]('\x22%s,%s%s,,,%s\x22',_0x18daf4[_0xb9e9('0x3d')],_0x18daf4[_0xb9e9('0x16e')]||'',_0x18daf4[_0xb9e9('0x10c')]?'c':'',_0x18daf4[_0xb9e9('0x115')]||0x3):_0xb9e9('0x16d'),'XMD-CONTACTID':_0x433788[_0xb9e9('0xf5')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1948b9[_0xb9e9('0x23')][_0x11f32b][_0xb9e9('0x16b')](),'XMD-AMD':_0x18daf4[_0xb9e9('0xe2')]?_0xb9e9('0x16f'):_0xb9e9('0x16d'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x18daf4['dialAMDActive']){_0x512706[_0xb9e9('0x170')]=_0x18daf4[_0xb9e9('0x171')]||0x9c4;_0x512706[_0xb9e9('0x172')]=_0x18daf4['dialAMDGreeting']||0x5dc;_0x512706[_0xb9e9('0x173')]=_0x18daf4[_0xb9e9('0x174')]||0x320;_0x512706[_0xb9e9('0x175')]=_0x18daf4['dialAMDTotalAnalysisTime']||0x1388;_0x512706['XMD-AMDMINWORDLENGTH']=_0x18daf4[_0xb9e9('0x176')]||0x64;_0x512706[_0xb9e9('0x177')]=_0x18daf4[_0xb9e9('0x178')]||0x32;_0x512706[_0xb9e9('0x179')]=_0x18daf4[_0xb9e9('0x17a')]||0x3;_0x512706[_0xb9e9('0x17b')]=_0x18daf4[_0xb9e9('0x17c')]||0x100;_0x512706[_0xb9e9('0x17d')]=_0x18daf4[_0xb9e9('0x17e')]||0x1388;}if(_0x18daf4[_0xb9e9('0x52')]===_0xb9e9('0x4a')){_0x512706['XMD-VOICEQUEUEID']=_0x433788[_0xb9e9('0xf6')];}else{_0x512706[_0xb9e9('0x17f')]=_0x433788[_0xb9e9('0xcd')];}for(var _0xe06c5 in _0x433788[_0xb9e9('0x167')]){if(typeof _0x433788[_0xb9e9('0x167')][_0xe06c5]!=='undefined'){if(isNotNull(_0x433788[_0xb9e9('0x167')][_0xe06c5])&&_0xe06c5!=='id'&&_0xe06c5!==_0xb9e9('0x180')&&_0xe06c5!=='createdAt'&&_0xe06c5!==_0xb9e9('0x181')){_0x512706[util[_0xb9e9('0x70')](_0xb9e9('0x182'),_0xb9e9('0x183'),_[_0xb9e9('0x184')](_0xe06c5))]=_0x433788[_0xb9e9('0x167')][_0xe06c5];}}}var _0x1b5ea7=_0x1948b9[_0xb9e9('0xd1')](_0x18daf4[_0xb9e9('0x6e')])?getCallerId(_0x18daf4['Trunk'][_0xb9e9('0x185')],_0x18daf4[_0xb9e9('0x57')],_0x18daf4[_0xb9e9('0x186')]>0x0?getCallerIdRandom(_0x18daf4[_0xb9e9('0x187')],_0x18daf4[_0xb9e9('0x186')]):_0x18daf4[_0xb9e9('0x187')]):getCallerId(_[_0xb9e9('0xd6')](_0x18daf4[_0xb9e9('0x137')])?_0x18daf4['Trunk'][_0xb9e9('0x185')]:_0x18daf4[_0xb9e9('0x137')][_0xb9e9('0x185')],_0x18daf4['dialOriginateCallerIdName'],_0x18daf4[_0xb9e9('0x186')]>0x0?getCallerIdRandom(_0x18daf4['dialOriginateCallerIdNumber'],_0x18daf4[_0xb9e9('0x186')]):_0x18daf4[_0xb9e9('0x187')]);if(_0x1b5ea7){_0x512706[_0xb9e9('0x188')]=_0x1948b9[_0xb9e9('0x23')][_0x11f32b][_0xb9e9('0x189')]=extractCalleridName(_0x1b5ea7);_0x512706['XMD-ORIGINATECALLERIDNUM']=_0x1948b9[_0xb9e9('0x23')][_0x11f32b][_0xb9e9('0x18a')]=extractCalleridNumber(_0x1b5ea7);}return ami[_0xb9e9('0x144')]({'actionid':_0x11f32b,'action':'originate','channel':_0x1948b9['isTrunkReachable'](_0x18daf4[_0xb9e9('0x6e')])?util[_0xb9e9('0x70')]('SIP/%s/%s%s',_0x18daf4[_0xb9e9('0x6e')]['name'],isNotNull(_0x18daf4['dialPrefix'])?_0x18daf4[_0xb9e9('0x59')]['trim']()||'':'',_0x18daf4[_0xb9e9('0x18b')]>0x0?_0x433788[_0xb9e9('0x167')][_0xb9e9('0x168')][_0xb9e9('0x18c')](_0x18daf4[_0xb9e9('0x18b')]):_0x433788[_0xb9e9('0x167')][_0xb9e9('0x168')]):util[_0xb9e9('0x70')](_0xb9e9('0x18d'),_[_0xb9e9('0xd6')](_0x18daf4['TrunkBackup'])?_0x18daf4[_0xb9e9('0x6e')]['name']:_0x18daf4[_0xb9e9('0x137')][_0xb9e9('0x3d')],isNotNull(_0x18daf4['dialPrefix'])?_0x18daf4[_0xb9e9('0x59')][_0xb9e9('0x18e')]()||'':'',_0x18daf4['dialCutDigit']>0x0?_0x433788[_0xb9e9('0x167')][_0xb9e9('0x168')]['substring'](_0x18daf4['dialCutDigit']):_0x433788[_0xb9e9('0x167')][_0xb9e9('0x168')]),'callerid':_0x1b5ea7,'Exten':_0xb9e9('0x18f'),'Context':_0xb9e9('0x190'),'Priority':'1','variable':_0x512706,'timeout':(_0x18daf4[_0xb9e9('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x11f32b})['then'](function(_0x444844){return _0x4952f8(_0x444844);})['catch'](function(_0x5067a2){_0x18daf4[_0xb9e9('0x191')]+=0x1;var _0x359b36=new History(_0x1948b9[_0xb9e9('0x23')][_0x11f32b]);logger[_0xb9e9('0x8c')](util[_0xb9e9('0x70')]('[originateError]:\x20%s',JSON[_0xb9e9('0x46')](_0x5067a2)));_0x359b36['state']=0xe;_0x359b36[_0xb9e9('0x9e')]='OriginateError';_0x359b36['starttime']=moment()[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss');_0x359b36[_0xb9e9('0x11c')]=_0x359b36[_0xb9e9('0x9f')];_0x1948b9[_0xb9e9('0xc2')](_0x359b36)[_0xb9e9('0xa8')](loggerCatch('[originate][error]'));_0x1948b9[_0xb9e9('0xc0')](_0x359b36)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x192')))[_0xb9e9('0x1b')](function(){delete _0x1948b9[_0xb9e9('0x23')][_0x11f32b];return _0x4de1d6(msgResponse(_0xb9e9('0x169'),_0xb9e9('0x45'),'originate\x20action\x20Error'));});});});};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x30')]=function(_0x566680){var _0x30bc84=this[_0xb9e9('0x23')][_0x566680[_0xb9e9('0x125')]];if(_0x30bc84){delete this[_0xb9e9('0x23')][_0x566680[_0xb9e9('0x125')]];_0x30bc84[_0xb9e9('0x114')]=moment()[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x124da8=_0x30bc84[_0xb9e9('0x52')]===_0xb9e9('0x73')?this[_0xb9e9('0x1e')][_0x30bc84[_0xb9e9('0xaa')]]:this[_0xb9e9('0x1d')][_0x30bc84['getQueue']()];if(!this['isSuccess'](_0x566680[_0xb9e9('0x193')])){this[_0xb9e9('0xc4')](_0x124da8);return this[_0xb9e9('0x194')](_0x30bc84,_0x124da8,_0x566680)[_0xb9e9('0xa8')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xb9e9('0x25')][_0x566680['uniqueid']]=_0x30bc84;}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x195')]=function(_0x23fd5c,_0xdc495d,_0x24fbe1){var _0x114e15=new History(_0xdc495d);if(_0x114e15[_0xb9e9('0xea')]+_0x114e15['countcongestionretry']+_0x114e15['countnoanswerretry']+_0x114e15[_0xb9e9('0xed')]+_0x114e15[_0xb9e9('0xfb')]+_0x114e15[_0xb9e9('0xfc')]+_0x114e15[_0xb9e9('0xe6')]+_0x114e15['countagentrejectretry']>=_0x24fbe1[_0xb9e9('0xfd')]-0x1){return!![];}switch(_0x23fd5c){case 0x3:if(_0x114e15['countnoanswerretry']>=_0x24fbe1[_0xb9e9('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x114e15[_0xb9e9('0xec')]+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x197')],'minutes')['format'](_0xb9e9('0xff')),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15['CampaignId']||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x198')));break;case 0x5:if(_0x114e15['countbusyretry']>=_0x24fbe1[_0xb9e9('0x199')]-0x1){return!![];}this[_0xb9e9('0xb6')]({'active':![],'countbusyretry':_0x114e15[_0xb9e9('0xea')]+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x19a')],_0xb9e9('0xf4'))['format'](_0xb9e9('0xff')),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch(_0xb9e9('0x19b')));break;case 0x8:if(_0x114e15[_0xb9e9('0xeb')]>=_0x24fbe1['dialCongestionMaxRetry']-0x1){return!![];}this[_0xb9e9('0xb6')]({'active':![],'countcongestionretry':_0x114e15[_0xb9e9('0xeb')]+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x19c')],_0xb9e9('0xf4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x114e15[_0xb9e9('0xed')]>=_0x24fbe1[_0xb9e9('0x19d')]-0x1){return!![];}else{this[_0xb9e9('0xb6')]({'active':![],'countnosuchnumberretry':_0x114e15['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x19e')],_0xb9e9('0xf4'))[_0xb9e9('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15['ListId'],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x19f')));}break;case 0xa:if(_0x114e15['countdropretry']>=_0x24fbe1[_0xb9e9('0x118')]-0x1){return!![];}this[_0xb9e9('0xb6')]({'active':![],'countdropretry':_0x114e15[_0xb9e9('0xfb')]+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x119')],_0xb9e9('0xf4'))[_0xb9e9('0x70')](_0xb9e9('0xff')),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch(_0xb9e9('0x11a')));break;case 0xb:if(_0x114e15[_0xb9e9('0xfc')]>=_0x24fbe1[_0xb9e9('0x122')]-0x1){return!![];}this[_0xb9e9('0xb6')]({'active':![],'countabandonedretry':_0x114e15['countabandonedretry']+=0x1,'scheduledat':moment()[_0xb9e9('0xf2')](_0x24fbe1[_0xb9e9('0x123')],_0xb9e9('0xf4'))[_0xb9e9('0x70')](_0xb9e9('0xff')),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15['ListId'],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x114e15['countmachineretry']>=_0x24fbe1['dialMachineMaxRetry']-0x1){return!![];}this[_0xb9e9('0xb6')]({'active':![],'countmachineretry':_0x114e15[_0xb9e9('0xe6')]+=0x1,'scheduledat':moment()['add'](_0x24fbe1[_0xb9e9('0xf3')],_0xb9e9('0xf4'))[_0xb9e9('0x70')](_0xb9e9('0xff')),'ContactId':_0x114e15[_0xb9e9('0xf5')],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x114e15[_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch(_0xb9e9('0x100')));break;case 0x14:if(_0x114e15[_0xb9e9('0x1a0')]>=_0x24fbe1['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x114e15[_0xb9e9('0x1a0')]+=0x1,'scheduledat':moment()['add'](_0x24fbe1[_0xb9e9('0x1a1')],_0xb9e9('0xf4'))[_0xb9e9('0x70')](_0xb9e9('0xff')),'ContactId':_0x114e15['ContactId'],'ListId':_0x114e15[_0xb9e9('0xcc')],'VoiceQueueId':_0x114e15['VoiceQueueId']||undefined,'CampaignId':_0x114e15['CampaignId']||undefined})['catch'](loggerCatch(_0xb9e9('0x1a2')));break;default:return!![];}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x194')]=function(_0x53fce3,_0x3cf765,_0x1b995e){var _0x121936=this;var _0x29652a=new History(_0x53fce3);return new BPromise(function(_0x4802d3,_0x378361){if(_[_0xb9e9('0x3a')](_0x3cf765)&&typeof _0x3cf765!=='object'){return _0x378361(msgResponse(_0xb9e9('0x1a3'),_0xb9e9('0x13d'),_0xb9e9('0x1a4')));}if(_['isUndefined'](_0x1b995e)&&typeof _0x1b995e!==_0xb9e9('0x165')){return _0x378361(msgResponse(_0xb9e9('0x1a3'),'Failure','evt\x20is\x20undefine'));}switch(_0x1b995e[_0xb9e9('0x109')]){case'0':_0x3cf765[_0xb9e9('0x62')]+=0x1;_0x29652a[_0xb9e9('0xda')]=0x0;_0x29652a[_0xb9e9('0x9e')]=_0xb9e9('0x1a5');_0x29652a[_0xb9e9('0xed')]+=0x1;_0x29652a[_0xb9e9('0xe7')]+=0x1;ami[_0xb9e9('0xe8')](_0xb9e9('0x1a6'),ut[_0xb9e9('0xdf')](_0x53fce3,_0xb9e9('0x1a7')));_0x121936[_0xb9e9('0xc2')](_0x29652a)['catch'](loggerCatch(_0xb9e9('0xfa')));if(_0x121936[_0xb9e9('0x195')](0x0,_0x53fce3,_0x3cf765)){if(_0x29652a['countnosuchnumberretry']>=_0x3cf765[_0xb9e9('0x19d')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1a8'));}else{_0x121936[_0xb9e9('0xee')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1a8'));}}break;case'3':_0x3cf765['outboundNoAnswerCallsDay']+=0x1;_0x29652a[_0xb9e9('0xda')]=0x3;_0x29652a['statedesc']=_0xb9e9('0x1a9');_0x29652a[_0xb9e9('0xec')]+=0x1;_0x29652a['countglobal']+=0x1;ami[_0xb9e9('0xe8')](_0xb9e9('0x1aa'),ut['buildObj'](_0x53fce3,'noanswer'));_0x121936[_0xb9e9('0xc2')](_0x29652a)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1ab')));if(_0x121936['checkRetriveMax'](0x3,_0x53fce3,_0x3cf765)){if(_0x29652a[_0xb9e9('0xec')]>=_0x3cf765[_0xb9e9('0x196')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1ac'));}else{_0x121936[_0xb9e9('0xee')](_0x29652a,_0x4802d3,_0x378361,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3cf765[_0xb9e9('0x5d')]+=0x1;_0x29652a['state']=0x5;_0x29652a[_0xb9e9('0x9e')]=_0xb9e9('0x1ad');_0x29652a['countbusyretry']+=0x1;_0x29652a[_0xb9e9('0xe7')]+=0x1;ami['emit'](_0xb9e9('0x1ae'),ut['buildObj'](_0x53fce3,_0xb9e9('0x1af')));_0x121936[_0xb9e9('0xc2')](_0x29652a)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1b0')));if(_0x121936[_0xb9e9('0x195')](0x5,_0x53fce3,_0x3cf765)){if(_0x29652a[_0xb9e9('0xea')]>=_0x3cf765[_0xb9e9('0x199')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,'reason\x205\x20busy');}else{_0x121936[_0xb9e9('0xee')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1b1'));}}break;case'8':_0x3cf765['outboundCongestionCallsDay']+=0x1;_0x29652a[_0xb9e9('0xda')]=0x8;_0x29652a[_0xb9e9('0x9e')]=_0xb9e9('0x1b2');_0x29652a[_0xb9e9('0xeb')]+=0x1;_0x29652a[_0xb9e9('0xe7')]+=0x1;ami['emit'](_0xb9e9('0x1b3'),ut[_0xb9e9('0xdf')](_0x53fce3,_0xb9e9('0x1b4')));_0x121936[_0xb9e9('0xc2')](_0x29652a)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1b5')));if(_0x121936[_0xb9e9('0x195')](0x8,_0x53fce3,_0x3cf765)){if(_0x29652a[_0xb9e9('0xeb')]>=_0x3cf765[_0xb9e9('0x1b6')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1b7'));}else{_0x121936['stateGlobal'](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1b7'));}}break;case'11':_0x3cf765[_0xb9e9('0x1b8')]+=0x1;_0x29652a[_0xb9e9('0xda')]=0xb;_0x29652a[_0xb9e9('0x9e')]=_0xb9e9('0x120');_0x29652a[_0xb9e9('0xfc')]+=0x1;_0x29652a['countglobal']+=0x1;_0x121936[_0xb9e9('0xc2')](_0x29652a)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1b9')));if(_0x121936[_0xb9e9('0x195')](0xb,_0x53fce3,_0x3cf765)){if(_0x29652a['countabandonedretry']>=_0x3cf765[_0xb9e9('0x122')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1ba'));}else{_0x121936[_0xb9e9('0xee')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1ba'));}}break;case'20':_0x3cf765[_0xb9e9('0x64')]+=0x1;_0x29652a[_0xb9e9('0xda')]=0x14;_0x29652a[_0xb9e9('0x9e')]=_0xb9e9('0x1bb');_0x29652a[_0xb9e9('0x1a0')]+=0x1;_0x29652a[_0xb9e9('0xe7')]+=0x1;ami[_0xb9e9('0xe8')](_0xb9e9('0x1bc'),ut['buildObj'](_0x53fce3,_0xb9e9('0x1bd')));_0x121936[_0xb9e9('0xc2')](_0x29652a)['catch'](loggerCatch(_0xb9e9('0x1be')));if(_0x121936['checkRetriveMax'](0x14,_0x53fce3,_0x3cf765)){if(_0x29652a['countagentrejectretry']>=_0x3cf765[_0xb9e9('0x1bf')]){_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0xb9e9('0x1c0'));}else{_0x121936[_0xb9e9('0xee')](_0x29652a,_0x4802d3,_0x378361,'reason\x2020\x20agentreject');}}break;default:_0x3cf765['outboundUnknownCallsDay']+=0x1;_0x29652a[_0xb9e9('0xda')]=0xc;_0x29652a[_0xb9e9('0x9e')]=_0x1b995e['reason'];_0x121936['createHistory'](_0x29652a)[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1c1')));if(_0x121936[_0xb9e9('0x195')](_0x1b995e[_0xb9e9('0x109')],_0x53fce3,_0x3cf765)){if(_0x29652a['countbusyretry']+_0x29652a[_0xb9e9('0xeb')]+_0x29652a[_0xb9e9('0xec')]+_0x29652a['countnosuchnumberretry']+_0x29652a[_0xb9e9('0xfb')]+_0x29652a[_0xb9e9('0xfc')]+_0x29652a[_0xb9e9('0xe6')]+_0x29652a[_0xb9e9('0x1a0')]>=_0x3cf765[_0xb9e9('0xfd')]){_0x121936['stateGlobal'](_0x29652a,_0x4802d3,_0x378361,_0x1b995e[_0xb9e9('0x109')]);}else{_0x121936[_0xb9e9('0xf0')](_0x29652a,_0x4802d3,_0x378361,_0x1b995e[_0xb9e9('0x109')]);}}}});};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xee')]=function(_0x4d7ae7,_0x29752f,_0x542db5,_0x125558){var _0x393243=new Final(_0x4d7ae7);_0x393243[_0xb9e9('0xda')]=0xf;_0x393243[_0xb9e9('0x9e')]=_0xb9e9('0x1c2');this[_0xb9e9('0xf0')](_0x393243,_0x29752f,_0x542db5,_0x125558);};Dialer[_0xb9e9('0xa0')][_0xb9e9('0xf0')]=function(_0x27b6ac,_0x2716c6,_0x1f57db,_0x43d98e){this[_0xb9e9('0xc0')](_0x27b6ac)[_0xb9e9('0xad')](function(){return _0x2716c6(msgResponse(_0xb9e9('0x1a3'),'Success',_0x43d98e));})[_0xb9e9('0xa8')](function(){return _0x1f57db(msgResponse('[moveContactManagedDialer][0]',_0xb9e9('0x13d'),_0xb9e9('0x1c3')));});};Dialer[_0xb9e9('0xa0')]['predictive']=function(_0x2e9c56){var _0x20df42=_0x2e9c56[_0xb9e9('0x1c4')]/0x64;var _0x353068=_0x2e9c56[_0xb9e9('0x60')]/(_0x2e9c56[_0xb9e9('0x60')]+_0x2e9c56['outboundAnswerCallsDay']);var _0x18f02e=Math[_0xb9e9('0x1c5')](_0x2e9c56[_0xb9e9('0x1c6')]*(_0x2e9c56[_0xb9e9('0x1c7')]/0x64));var _0x24f2b6=Math['round'](_0x2e9c56[_0xb9e9('0x1c6')]*(_0x2e9c56[_0xb9e9('0x1c8')]/0x64));var _0x8a99f5=_0x2e9c56[_0xb9e9('0x4d')]+_0x2e9c56[_0xb9e9('0x50')];var _0x3caa5f=Math[_0xb9e9('0x1c9')](_0x2e9c56[_0xb9e9('0x6c')]*_0x2e9c56[_0xb9e9('0x6d')]*_0x2e9c56[_0xb9e9('0x69')]*_0x2e9c56[_0xb9e9('0x1ca')]);if(_['isUndefined'](_0x2e9c56[_0xb9e9('0x28')])){if(!_[_0xb9e9('0x3a')](_0x2e9c56[_0xb9e9('0x27')])){_0x2e9c56[_0xb9e9('0x27')]=undefined;loggerPredictive[_0xb9e9('0x8c')](_0xb9e9('0x1cb'),_0xb9e9('0x1cc'));}if(!_[_0xb9e9('0x3a')](_0x2e9c56[_0xb9e9('0x87')])){loggerPredictive['error'](_0xb9e9('0x1cb'),_0xb9e9('0x1cd'));clearInterval(_0x2e9c56[_0xb9e9('0x87')]);_0x2e9c56[_0xb9e9('0x87')]=undefined;}_0x2e9c56[_0xb9e9('0x28')]=moment()['format'](_0xb9e9('0xff'));loggerPredictive[_0xb9e9('0x75')](_0x2e9c56[_0xb9e9('0x3d')],'collection\x20data\x20in\x20progressive\x20at',_0x2e9c56[_0xb9e9('0x28')]);this[_0xb9e9('0x153')](_0x2e9c56,0x1);}else if(ifInterval(_0x2e9c56[_0xb9e9('0x1ce')],_0x2e9c56['startProgressive'])){this[_0xb9e9('0x153')](_0x2e9c56,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x2e9c56[_0xb9e9('0x28')],_0x2e9c56[_0xb9e9('0x3d')]);_0x2e9c56[_0xb9e9('0x6c')]=0x0;_0x2e9c56['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x20df42<_0x353068&&_0x2e9c56[_0xb9e9('0x1cf')]==='dropRate'){freeVariablesPredictive(_0x2e9c56);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x1d0'),'Dropped\x20calls\x20day',_0x353068,_0xb9e9('0x28'),_0x2e9c56[_0xb9e9('0x3d')]);}else if(_0x3caa5f<_0x2e9c56[_0xb9e9('0x68')]&&_0x2e9c56[_0xb9e9('0x1cf')]==='dropRate'){freeVariablesPredictive(_0x2e9c56);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x3caa5f,_0xb9e9('0x1d1'),_0x2e9c56[_0xb9e9('0x68')],_0xb9e9('0x28'),_0x2e9c56[_0xb9e9('0x3d')]);}else if(!ifInterval(_0x2e9c56[_0xb9e9('0x1ce')],_0x2e9c56[_0xb9e9('0x28')])&&_[_0xb9e9('0x3a')](_0x2e9c56[_0xb9e9('0x27')])&&!_[_0xb9e9('0x3a')](_0x2e9c56[_0xb9e9('0x28')])){_0x2e9c56[_0xb9e9('0x27')]=moment()['format'](_0xb9e9('0xff'));loggerPredictive[_0xb9e9('0x75')](_0x2e9c56[_0xb9e9('0x3d')],_0xb9e9('0x1d2'),_0x2e9c56[_0xb9e9('0x27')]);this[_0xb9e9('0xb3')](_0x2e9c56['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x2e9c56))['then'](mergeDataErlangB(_0x2e9c56))[_0xb9e9('0xad')](this[_0xb9e9('0x1d3')](_0x2e9c56))['catch'](loggerCatchPredictive(_0xb9e9('0x1d4'),_0x2e9c56));}else if(!ifInterval(_0x2e9c56[_0xb9e9('0x1ce')],_0x2e9c56['startPredictive'])){_0x2e9c56[_0xb9e9('0x68')]=0x0;_0x2e9c56[_0xb9e9('0x27')]=moment()[_0xb9e9('0x70')](_0xb9e9('0xff'));loggerPredictive[_0xb9e9('0x75')](_0x2e9c56[_0xb9e9('0x3d')],_0xb9e9('0x1d5'),_0x2e9c56['startPredictive']);clearInterval(_0x2e9c56[_0xb9e9('0x87')]);_0x2e9c56[_0xb9e9('0x87')]=undefined;this['averageHandleTime'](_0x2e9c56[_0xb9e9('0x1ce')])[_0xb9e9('0xad')](this[_0xb9e9('0x1d6')](_0x2e9c56))['then'](mergeDataErlangB(_0x2e9c56))[_0xb9e9('0xad')](this[_0xb9e9('0x1d3')](_0x2e9c56))[_0xb9e9('0xa8')](loggerCatchPredictive(_0xb9e9('0x1d7'),_0x2e9c56));}else if(_0x2e9c56[_0xb9e9('0x1c6')]&&_0x8a99f5<_0x2e9c56[_0xb9e9('0x1c6')]-_0x24f2b6){freeVariablesPredictive(_0x2e9c56);loggerPredictive['info'](_0x2e9c56[_0xb9e9('0x3d')],_0xb9e9('0x1d8'),_0x8a99f5,_0xb9e9('0x1d9'),_0x2e9c56[_0xb9e9('0x1c6')],'-',_0x24f2b6,'=',_0x2e9c56[_0xb9e9('0x1c6')]-_0x24f2b6,')');}else if(_0x2e9c56[_0xb9e9('0x1c6')]&&_0x8a99f5>_0x2e9c56[_0xb9e9('0x1c6')]+_0x18f02e){freeVariablesPredictive(_0x2e9c56);loggerPredictive[_0xb9e9('0x75')](_0x2e9c56[_0xb9e9('0x3d')],_0xb9e9('0x1d8'),_0x8a99f5,_0xb9e9('0x1da'),_0x2e9c56[_0xb9e9('0x1c6')],'+',_0x18f02e,'=',_0x2e9c56['predictiveIntervalAvailable']+_0x18f02e,')');}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x1d6')]=function(_0x5d8026){var _0x14f5be=this;return function(_0x45e68a){return new BPromise(function(_0x49e232,_0xe3139a){_[_0xb9e9('0x85')](_0x5d8026,_0x45e68a[0x0]);if(checkGetDataPredictive(_0x45e68a[0x0])){var _0xed905d=_0x5d8026[_0xb9e9('0x1c6')]=_0x5d8026[_0xb9e9('0x50')]+_0x5d8026[_0xb9e9('0x4d')];var _0x408881=_0x5d8026[_0xb9e9('0x1ce')]*0x3c;var _0x508f8e=_0x45e68a[0x0]['predictiveIntervalAvgTalktime']+_0x45e68a[0x0][_0xb9e9('0x66')];var _0x1665a6=(_0x45e68a[0x0]['predictiveIntervalAnsweredCalls']+_0x45e68a[0x0][_0xb9e9('0x67')]+_0x45e68a[0x0][_0xb9e9('0x79')])/_0x45e68a[0x0][_0xb9e9('0x6a')];_0x5d8026[_0xb9e9('0x69')]=_0x1665a6>0x0?_0x1665a6:0x1;switch(_0x5d8026[_0xb9e9('0x1cf')]){case'dropRate':var _0x3ab3e9=_0x5d8026[_0xb9e9('0x1c4')]/0x64;return _0x14f5be[_0xb9e9('0x1db')](_0xed905d,_0x408881,_0x508f8e,_0x1665a6,_0x3ab3e9)['then'](function(_0x484ab2){return _0x49e232(_0x484ab2);});case _0xb9e9('0x1dc'):var _0x42c5f8=_0x5d8026[_0xb9e9('0x1c4')]/0x64;return _0x14f5be[_0xb9e9('0x1dd')](_0xed905d,_0x408881,_0x508f8e,_0x1665a6,_0x42c5f8)['then'](function(_0x301a5b){return _0x49e232(_0x301a5b);});default:return _0xe3139a(msgResponse(_0xb9e9('0x1de'),_0xb9e9('0x13d'),_0xb9e9('0x1df')));}}else{return _0xe3139a(msgResponse(_0xb9e9('0x1de'),_0xb9e9('0x13d'),_0xb9e9('0x1e0')));}});};};Dialer['prototype'][_0xb9e9('0x1e1')]=function(_0x308094){var _0xdad657=this;return function(_0x134758){return new BPromise(function(_0x2d006e,_0x807def){_[_0xb9e9('0x85')](_0x308094,_0x134758[0x0]);if(checkGetDataPredictive(_0x134758[0x0])){loggerPredictive['info'](JSON[_0xb9e9('0x46')](_0x134758[0x0]));if(_0x308094[_0xb9e9('0x1cf')]==='dropRate'){return _0xdad657[_0xb9e9('0xbe')](_0x308094['id'])[_0xb9e9('0xad')](function(_0x3dce42){var _0xc609f0=_0x308094[_0xb9e9('0x1e2')]-_0x3dce42[0x0][_0xb9e9('0x1e3')];var _0xf452d3=_0x308094[_0xb9e9('0x1ce')]*0x3c;var _0x3134ed=_0x134758[0x0][_0xb9e9('0x1e4')]+_0x134758[0x0]['predictiveIntervalAvgHoldtime'];var _0x384e16=(_0x134758[0x0][_0xb9e9('0x65')]+_0x134758[0x0][_0xb9e9('0x67')]+_0x134758[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x134758[0x0][_0xb9e9('0x6a')];var _0xbf148c=_0x308094[_0xb9e9('0x1c4')]/0x64;_0x308094[_0xb9e9('0x1e5')]=_0x3dce42[0x0][_0xb9e9('0x1e3')]||0x0;_0x308094[_0xb9e9('0x69')]=_0x384e16>0x0?_0x384e16:0x1;return _0xdad657[_0xb9e9('0x1db')](_0xc609f0,_0xf452d3,_0x3134ed,_0x384e16,_0xbf148c);})[_0xb9e9('0xad')](function(_0x2fbd74){return _0x2d006e(_0x2fbd74);})[_0xb9e9('0xa8')](function(_0x4a076d){return _0x807def(msgResponse('[CatchErlangB]',_0xb9e9('0x13d'),JSON[_0xb9e9('0x46')](_0x4a076d)));});}if(_0x308094['dialPredictiveOptimization']===_0xb9e9('0x1dc')){return _0xdad657[_0xb9e9('0xbe')](_0x308094['id'])['then'](function(_0x4c4a31){var _0x1eadd5=_0x308094[_0xb9e9('0x1e2')]-_0x4c4a31[0x0][_0xb9e9('0x1e3')];var _0x1fae64=_0x308094[_0xb9e9('0x1ce')]*0x3c;var _0x270f1f=_0x134758[0x0][_0xb9e9('0x1e4')]+_0x134758[0x0][_0xb9e9('0x66')];var _0x30c1f2=(_0x134758[0x0]['predictiveIntervalAnsweredCalls']+_0x134758[0x0][_0xb9e9('0x67')]+_0x134758[0x0][_0xb9e9('0x79')])/_0x134758[0x0][_0xb9e9('0x6a')];var _0x2cb2ca=_0x308094[_0xb9e9('0x1c4')]/0x64;_0x308094[_0xb9e9('0x1e5')]=_0x4c4a31[0x0][_0xb9e9('0x1e3')]||0x0;_0x308094[_0xb9e9('0x69')]=_0x30c1f2>0x0?_0x30c1f2:0x1;return _0xdad657['busyFactor'](_0x1eadd5,_0x1fae64,_0x270f1f,_0x30c1f2,_0x2cb2ca);})[_0xb9e9('0xad')](function(_0x187bb3){return _0x2d006e(_0x187bb3);})[_0xb9e9('0xa8')](function(_0x8d15d2){return _0x807def(msgResponse('[CatchErlangB]',_0xb9e9('0x13d'),JSON[_0xb9e9('0x46')](_0x8d15d2)));});}}else{return _0x807def(msgResponse(_0xb9e9('0x1de'),_0xb9e9('0x13d'),'check\x20failure'));}});};};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x1d3')]=function(_0x5eb95a){var _0x1a780d=this;return function(){var _0x5e1e8e=0x0;var _0x53154f=Math[_0xb9e9('0x1c9')](_0x5eb95a['erlangCallToSecond']*0x3e8);if(_0x53154f>0x0){_0x53154f=_0x53154f<0x64?0x64:_0x53154f;loggerPredictive['info'](_0x5eb95a['name'],'one\x20call\x20every:',_0x53154f,_0xb9e9('0x47'));_0x5eb95a[_0xb9e9('0x87')]=setInterval(function(){_0x1a780d[_0xb9e9('0x87')](_0x5eb95a);loggerPredictiveCalls[_0xb9e9('0x75')](_0xb9e9('0x1e6'),_0x5e1e8e+=0x1);},_0x53154f);}else{loggerPredictive[_0xb9e9('0x75')](_0x5eb95a[_0xb9e9('0x3d')],_0xb9e9('0x1e7'));}};};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x1e8')]=function(_0x52a23b,_0x51a5fe){var _0x423507=this;return function(_0x2d9447){if(_[_0xb9e9('0x43')](_0x2d9447)){if(_['isNil'](_0x51a5fe[_0xb9e9('0x1e9')])||!_0x51a5fe[_0xb9e9('0x1ea')]){if(_0x52a23b['dialMethod']===_0xb9e9('0x7')){_0x52a23b['queueStatusComplete']=_[_0xb9e9('0x3a')](_0x52a23b[_0xb9e9('0x12b')])?!![]:_0x52a23b['queueStatusComplete'];var _0x1c0945=uuid['v4']();_0x423507[_0xb9e9('0x23')][_0x1c0945]=new Action(_0x52a23b,_0x51a5fe,_0x1c0945);loggerBooked[_0xb9e9('0x75')](_0xb9e9('0x1eb'),_0x1c0945,_0xb9e9('0x1ec'),JSON[_0xb9e9('0x46')](_0x52a23b['queueStatusComplete']),'Queue:\x20',_0x52a23b[_0xb9e9('0x3d')]);if(_0x52a23b['queueStatusComplete']){_0x52a23b['queueStatusComplete']=![];_0x423507['queueBooked'][_0x423507['actions'][_0x1c0945]['queue']]=[];ami[_0xb9e9('0x144')]({'actionid':_0x1c0945,'action':_0xb9e9('0x1ed'),'queue':_0x52a23b[_0xb9e9('0x3d')]})[_0xb9e9('0xa8')](function(){_0x423507[_0xb9e9('0xc4')](_0x52a23b);_0x423507[_0xb9e9('0xb6')]({'active':![],'ContactId':_0x423507['actions'][_0x1c0945][_0xb9e9('0xf5')],'ListId':_0x423507[_0xb9e9('0x23')][_0x1c0945][_0xb9e9('0xcc')],'VoiceQueueId':_0x423507[_0xb9e9('0x23')][_0x1c0945][_0xb9e9('0xf6')]||undefined,'CampaignId':_0x423507[_0xb9e9('0x23')][_0x1c0945][_0xb9e9('0xcd')]||undefined})['catch'](loggerCatch(_0xb9e9('0x1ee')));delete _0x423507[_0xb9e9('0x23')][_0x1c0945];});}else{loggerBooked[_0xb9e9('0x75')]('[booked][checkContactBlack][else]',JSON[_0xb9e9('0x46')](_0x52a23b[_0xb9e9('0x12b')]),_0xb9e9('0x1ef'),_0x52a23b[_0xb9e9('0x3d')]);_0x423507[_0xb9e9('0xc4')](_0x52a23b);_0x423507[_0xb9e9('0xb6')]({'active':![],'ContactId':_0x423507[_0xb9e9('0x23')][_0x1c0945]['ContactId'],'ListId':_0x423507[_0xb9e9('0x23')][_0x1c0945][_0xb9e9('0xcc')],'VoiceQueueId':_0x423507['actions'][_0x1c0945][_0xb9e9('0xf6')]||undefined,'CampaignId':_0x423507['actions'][_0x1c0945][_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1ee')));delete _0x423507['actions'][_0x1c0945];}}else{return _0x423507['actionOriginate'](_0x52a23b,_0x51a5fe);}}else{if(getDiff(_0x51a5fe[_0xb9e9('0x1f0')])<_0x52a23b[_0xb9e9('0x1f1')]*0x3c){if(_0x51a5fe[_0xb9e9('0x1f2')]&&!_0x51a5fe[_0xb9e9('0x1f2')][_0xb9e9('0x1f3')]){_0x423507[_0xb9e9('0x1c')][_0xb9e9('0x1f4')](_0x51a5fe['id'])[_0xb9e9('0x1b')](function(){_0x423507['updateOriginated'](_0x52a23b);});}else{_0x423507['unlockContact']({'active':![]},_0x51a5fe['id'],0x1)[_0xb9e9('0x1b')](function(){_0x423507[_0xb9e9('0xc4')](_0x52a23b);});}}else{_0x52a23b[_0xb9e9('0x63')]+=0x1;_0x423507[_0xb9e9('0xc4')](_0x52a23b);if(_0x52a23b['dialRecallInQueue']){_0x423507[_0xb9e9('0xb6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x51a5fe[_0xb9e9('0xf5')],'ListId':_0x51a5fe['ListId'],'VoiceQueueId':_0x51a5fe[_0xb9e9('0xf6')]||undefined,'CampaignId':_0x51a5fe[_0xb9e9('0xcd')]||undefined})[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1f5')));_0x423507[_0xb9e9('0xc2')](createObjHistory(_0x52a23b,_0x51a5fe,_0xb9e9('0x1f6'),0x17,'RecallInQueue'))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0x1f7')));}else{_0x423507['saveInDb'](createObjHistory(_0x52a23b,_0x51a5fe,_0xb9e9('0x1f8'),0x16,_0xb9e9('0x1f9')),_0xb9e9('0x1fa'),'[Originate][HistoryRecallClose]');}}}}else{_0x52a23b[_0xb9e9('0x5c')]+=0x1;_0x423507[_0xb9e9('0xca')](createObjHistory(_0x52a23b,_0x51a5fe,_0xb9e9('0x1fb'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0xb9e9('0x1fc'));throw _0xb9e9('0x1fd');}};};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x159')]=function(_0x1cf542){var _0x29e03d=this;var _0x522e5f=_0x1cf542[_0xb9e9('0x1fe')]-_0x1cf542['originated']-_0x1cf542['temp'];emitCampaignSummary(_0x1cf542);if(_0x522e5f>0x0){if(_0x522e5f>this[_0xb9e9('0x21')]){_0x522e5f=this[_0xb9e9('0x21')];}_0x1cf542[_0xb9e9('0xba')]+=_0x522e5f;this[_0xb9e9('0xbc')](_0x1cf542['id'],_0x522e5f,_0x1cf542[_0xb9e9('0x1ff')],_0x1cf542)[_0xb9e9('0xad')](function(_0x521a52){_0x1cf542[_0xb9e9('0xba')]-=_0x522e5f;_0x1cf542[_0xb9e9('0xba')]=_0x1cf542[_0xb9e9('0xba')]>0x0?_0x1cf542[_0xb9e9('0xba')]:0x0;if(!checkContactEmpty(_0x521a52)){_0x1cf542[_0xb9e9('0x3b')]=_0xb9e9('0x95');logger['info'](_0xb9e9('0x200')+_0x1cf542['name']);}else{_0x1cf542[_0xb9e9('0x6b')]+=_0x521a52[_0xb9e9('0x8f')];_0x1cf542['message']=_0xb9e9('0x201');for(var _0x839ccc=0x0;_0x839ccc<_0x521a52[_0xb9e9('0x8f')];_0x839ccc+=0x1){_0x1cf542[_0xb9e9('0x202')]+=0x1;if(_['isNil'](_0x521a52[_0x839ccc])||_[_0xb9e9('0xd6')](_0x521a52[_0x839ccc]['Contact'])||_[_0xb9e9('0xd6')](_0x521a52[_0x839ccc][_0xb9e9('0x167')][_0xb9e9('0x168')])){_0x29e03d[_0xb9e9('0xc8')](_0xb9e9('0x203'),_0x1cf542,_0x521a52[_0x839ccc]);}else{_0x29e03d[_0xb9e9('0x204')](_['pick'](_0x521a52[_0x839ccc],[_0xb9e9('0xcd'),_0xb9e9('0x205')]))[_0xb9e9('0xad')](_0x29e03d[_0xb9e9('0x1e8')](_0x1cf542,_0x521a52[_0x839ccc]))[_0xb9e9('0xa8')](_0x29e03d[_0xb9e9('0xc7')](_0xb9e9('0x206'),_0x1cf542));}}}})[_0xb9e9('0xa8')](loggerGetContactDialer(_0xb9e9('0x207'),_0x1cf542,_0x522e5f));}};Dialer['prototype']['handlePower']=function(_0x1f3d3a,_0x576fc9){var _0x1ae415=this;var _0x52dc7a=[];var _0xeb98a4=_0x576fc9>=0x1?_0x576fc9:0x1;if(_0x1f3d3a[_0xb9e9('0x151')]===_0xb9e9('0x7')){_0xeb98a4=0x1;}var _0x9cdb81=Math[_0xb9e9('0x1c9')](_0x1f3d3a['available']*_0xeb98a4)-_0x1f3d3a['originated']-_0x1f3d3a[_0xb9e9('0xba')];emitVoiceQueueSummary(_0x1f3d3a);if(_0x1f3d3a[_0xb9e9('0x208')]>0x0){var _0x3a56b6=_0x1f3d3a[_0xb9e9('0x208')]-_0x1f3d3a[_0xb9e9('0x6b')]-_0x1f3d3a[_0xb9e9('0x50')]-_0x1f3d3a[_0xb9e9('0xba')]-_0x1f3d3a[_0xb9e9('0x98')];if(_0x9cdb81>_0x3a56b6){_0x9cdb81=_0x3a56b6;}}if(_0x9cdb81>0x0){if(_0x1f3d3a[_0xb9e9('0x151')]==='booked'){_0x9cdb81=0x1;}if(_0x9cdb81>this[_0xb9e9('0x21')]){_0x9cdb81=this['maxNumberOriginate'];}_0x1f3d3a[_0xb9e9('0xba')]+=_0x9cdb81;for(var _0xd240e6 in this[_0xb9e9('0x1f')]){if(typeof this['agents'][_0xd240e6]!=='undefined'){if(this[_0xb9e9('0x1f')][_0xd240e6][_0xb9e9('0xda')]===_0xb9e9('0x209')&&this['agents'][_0xd240e6][_0xb9e9('0xa6')]===_0xb9e9('0xd3')){_0x52dc7a[_0xb9e9('0x129')](this[_0xb9e9('0x1f')][_0xd240e6]['id']);}}}this[_0xb9e9('0xb9')](_0x1f3d3a['id'],_0x52dc7a,_0x9cdb81,_0x1f3d3a[_0xb9e9('0x1ff')],_0x1f3d3a)[_0xb9e9('0xad')](function(_0x38c605){_0x1f3d3a[_0xb9e9('0xba')]-=_0x9cdb81;_0x1f3d3a[_0xb9e9('0xba')]=_0x1f3d3a[_0xb9e9('0xba')]>0x0?_0x1f3d3a['temp']:0x0;if(!checkContactEmpty(_0x38c605)){_0x1ae415[_0xb9e9('0xae')](_0x1f3d3a)['then'](sendMessageReschedule(_0x1f3d3a))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xaf')));}else{_0x1f3d3a[_0xb9e9('0x6b')]+=_0x38c605[_0xb9e9('0x8f')];_0x1f3d3a[_0xb9e9('0x3b')]=_0x1f3d3a['dialMethod']==='booked'?_0xb9e9('0x16f'):_0xb9e9('0x201');for(var _0x299f5a=0x0;_0x299f5a<_0x38c605[_0xb9e9('0x8f')];_0x299f5a+=0x1){if(_[_0xb9e9('0xd6')](_0x38c605[_0x299f5a])||_[_0xb9e9('0xd6')](_0x38c605[_0x299f5a][_0xb9e9('0x167')])||_[_0xb9e9('0xd6')](_0x38c605[_0x299f5a][_0xb9e9('0x167')][_0xb9e9('0x168')])){_0x1ae415[_0xb9e9('0xc8')]('[actionOriginate]\x20',_0x1f3d3a,_0x38c605[_0x299f5a]);}else{_0x1ae415[_0xb9e9('0xb0')](_[_0xb9e9('0xcb')](_0x38c605[_0x299f5a],['VoiceQueueId',_0xb9e9('0x205')]))[_0xb9e9('0xad')](_0x1ae415[_0xb9e9('0x1e8')](_0x1f3d3a,_0x38c605[_0x299f5a]))['catch'](_0x1ae415['loggerHandler'](_0xb9e9('0x203'),_0x1f3d3a));}}}})[_0xb9e9('0xa8')](loggerGetContactDialer(_0xb9e9('0x20a'),_0x1f3d3a,_0x9cdb81));}};Dialer[_0xb9e9('0xa0')]['handlePredictive']=function(_0x1c92db){if(_0x1c92db['dialLimitQueue']>0x0){var _0x359cdb=_0x1c92db[_0xb9e9('0x208')]-_0x1c92db[_0xb9e9('0x6b')]-_0x1c92db[_0xb9e9('0x50')];if(_0x359cdb>0x0){this[_0xb9e9('0x20b')](_0x1c92db);}else{loggerPredictiveCalls[_0xb9e9('0x75')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x1c92db);}};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x20b')]=function(_0x5911b8){var _0x4c3231=this;var _0x53f8d6=[];_0x5911b8['originated']+=0x1;for(var _0xb99a5e in this[_0xb9e9('0x1f')]){if(typeof this[_0xb9e9('0x1f')][_0xb99a5e]!==_0xb9e9('0xa4')){if(this[_0xb9e9('0x1f')][_0xb99a5e][_0xb9e9('0xda')]===_0xb9e9('0x209')&&this[_0xb9e9('0x1f')][_0xb99a5e][_0xb9e9('0xa6')]===_0xb9e9('0xd3')){_0x53f8d6['push'](this['agents'][_0xb99a5e]['id']);}}}this['getContactDialer'](_0x5911b8['id'],_0x53f8d6,0x1,_0x5911b8[_0xb9e9('0x1ff')],_0x5911b8)[_0xb9e9('0xad')](function(_0xa2d8bc){if(!checkContactEmpty(_0xa2d8bc)){checkContactLowerLimitOriginate(_0x5911b8,0x1,0x0);_0x4c3231['countReScheduled'](_0x5911b8)[_0xb9e9('0xad')](sendMessageReschedule(_0x5911b8))[_0xb9e9('0xa8')](loggerCatch(_0xb9e9('0xaf')));}else{_0x5911b8[_0xb9e9('0x3b')]=_0xb9e9('0x201');if(_['isNil'](_0xa2d8bc[0x0])||_['isNil'](_0xa2d8bc[0x0][_0xb9e9('0x167')])||_[_0xb9e9('0xd6')](_0xa2d8bc[0x0][_0xb9e9('0x167')][_0xb9e9('0x168')])){_0x4c3231['emptyContact'](_0xb9e9('0x203'),_0x5911b8,_0xa2d8bc[0x0]);}else{_0x4c3231[_0xb9e9('0xb0')](_[_0xb9e9('0xcb')](_0xa2d8bc[0x0],['VoiceQueueId',_0xb9e9('0x205')]))[_0xb9e9('0xad')](_0x4c3231[_0xb9e9('0x1e8')](_0x5911b8,_0xa2d8bc[0x0]))[_0xb9e9('0xa8')](_0x4c3231['loggerHandler'](_0xb9e9('0x20c'),_0x5911b8));}}})[_0xb9e9('0xa8')](loggerGetContactDialer(_0xb9e9('0x20d'),_0x5911b8,0x1));emitVoiceQueueSummary(_0x5911b8);};Dialer[_0xb9e9('0xa0')][_0xb9e9('0x1db')]=function(_0x2ce0af,_0x1f6f25,_0x3e24b8,_0x5ea7ee,_0x20524f,_0x33dc02){loggerPredictive['info'](_0xb9e9('0x20e'));loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x20f'),_0x2ce0af);loggerPredictive['info'](_0xb9e9('0x210'),_0x1f6f25);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x211'),_0x3e24b8);loggerPredictive[_0xb9e9('0x75')]('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',_0x5ea7ee);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x212'),_0x20524f);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x7c'));return new BPromise(function(_0x1254ce,_0x26fb84){if(_0x2ce0af<=0x0||isNaN(_0x2ce0af)){return _0x26fb84(msgResponse(_0xb9e9('0x213'),_0xb9e9('0x45'),_0xb9e9('0x214')+_0x2ce0af));}if(_0x3e24b8<=0x0||isNaN(_0x3e24b8)){return _0x26fb84(msgResponse('[abandonmentRate]',_0xb9e9('0x45'),_0xb9e9('0x215')+_0x3e24b8));}if(_0x5ea7ee<=0x0||isNaN(_0x5ea7ee)){return _0x26fb84(msgResponse('[abandonmentRate]',_0xb9e9('0x45'),_0xb9e9('0x216')+_0x5ea7ee));}if(_0x1f6f25<=0x0||isNaN(_0x1f6f25)){return _0x26fb84(msgResponse(_0xb9e9('0x213'),_0xb9e9('0x45'),_0xb9e9('0x217')+_0x1f6f25));}if(_0x20524f<=0x0||isNaN(_0x20524f)){return _0x26fb84(msgResponse(_0xb9e9('0x213'),_0xb9e9('0x45'),_0xb9e9('0x218')+_0x20524f));}_0x33dc02=_0x33dc02||0x0;var _0x1c0deb=0x1/_0x3e24b8;var _0x417ca7=0x0;var _0x320c57=0x0;var _0x2f807d=0x0;var _0x41f91c=0x0;for(var _0x3aaebb=0x0;_0x2f807d<_0x20524f;_0x3aaebb+=0x1){_0x320c57=_0x3aaebb/_0x1f6f25;_0x417ca7=(_0x5ea7ee*_0x320c57+_0x33dc02)/_0x1c0deb;_0x2f807d=erlangb(_0x417ca7,_0x2ce0af);_0x41f91c=_0x417ca7/_0x2ce0af*(0x1-erlangb(_0x417ca7,_0x2ce0af));}return _0x1254ce({'erlangCalls':_0x3aaebb,'erlangCallToSecond':_0x1f6f25/_0x3aaebb,'erlangAbandonmentRate':_0x2f807d,'erlangBusyFactor':_0x41f91c});});};Dialer[_0xb9e9('0xa0')]['busyFactor']=function(_0x2aab1e,_0x1d4eb9,_0x19fe06,_0xfcd40c,_0x3776bb,_0x55c963){loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x219'));loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x20f'),_0x2aab1e);loggerPredictive['info'](_0xb9e9('0x210'),_0x1d4eb9);loggerPredictive[_0xb9e9('0x75')]('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',_0x19fe06);loggerPredictive[_0xb9e9('0x75')]('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',_0xfcd40c);loggerPredictive[_0xb9e9('0x75')](_0xb9e9('0x21a'),_0x3776bb);loggerPredictive['info'](_0xb9e9('0x7c'));return new BPromise(function(_0x53be27,_0x36f8eb){if(_0x2aab1e<=0x0||isNaN(_0x2aab1e)){return _0x36f8eb(msgResponse(_0xb9e9('0x21b'),'Error','m\x20=\x20'+_0x2aab1e));}if(_0x19fe06<=0x0||isNaN(_0x19fe06)){return _0x36f8eb(msgResponse(_0xb9e9('0x21b'),_0xb9e9('0x45'),_0xb9e9('0x215')+_0x19fe06));}if(_0xfcd40c<=0x0||isNaN(_0xfcd40c)){return _0x36f8eb(msgResponse(_0xb9e9('0x21b'),_0xb9e9('0x45'),'p\x20=\x20'+_0xfcd40c));}if(_0x1d4eb9<=0x0||isNaN(_0x1d4eb9)){return _0x36f8eb(msgResponse(_0xb9e9('0x21b'),'Error',_0xb9e9('0x217')+_0x1d4eb9));}if(_0x3776bb<=0x0||isNaN(_0x3776bb)){return _0x36f8eb(msgResponse(_0xb9e9('0x21b'),_0xb9e9('0x45'),'Umin\x20=\x20'+_0x3776bb));}_0x55c963=_0x55c963||0x0;var _0x29b939=0x1/_0x19fe06;var _0x214bc5=0x0;var _0x2b7b27=0x0;var _0x2d6bba=0x0;var _0x4df74c=0x0;for(var _0x22af35=0x0;_0x4df74c<_0x3776bb;_0x22af35+=0x1){_0x2b7b27=_0x22af35/_0x1d4eb9;_0x214bc5=(_0xfcd40c*_0x2b7b27+_0x55c963)/_0x29b939;_0x2d6bba=erlangb(_0x214bc5,_0x2aab1e);_0x4df74c=_0x214bc5/_0x2aab1e*(0x1-erlangb(_0x214bc5,_0x2aab1e));}return _0x53be27({'erlangCalls':_0x22af35,'erlangCallToSecond':_0x1d4eb9/_0x22af35,'erlangAbandonmentRate':_0x2d6bba,'erlangBusyFactor':_0x4df74c});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bea6504..92caf03 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fc5=['calleridname','name','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid'];(function(_0x438627,_0x4840dd){var _0x4b6c19=function(_0x2f6995){while(--_0x2f6995){_0x438627['push'](_0x438627['shift']());}};_0x4b6c19(++_0x4840dd);}(_0x9fc5,0x8e));var _0x59fc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9fc5[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x59fc('0x0'));var _=require('lodash');var moment=require(_0x59fc('0x1'));function getSeconds(_0x8732d,_0x279ff8){var _0x32c067=moment(_0x8732d)[_0x59fc('0x2')](0x0);var _0x1de52c=moment(_0x279ff8)['milliseconds'](0x0);return _0x32c067['diff'](_0x1de52c,'seconds');}function QueueCallerAbandon(_0x55adf7,_0x45a72e){this[_0x59fc('0x3')]=_0x55adf7[_0x59fc('0x3')];this['type']=_0x55adf7['type'];this[_0x59fc('0x4')]=_0x55adf7[_0x59fc('0x5')]===_0x59fc('0x6')?_0x59fc('0x7'):_0x55adf7[_0x59fc('0x5')];this[_0x59fc('0x8')]=_0x55adf7[_0x59fc('0x8')];this[_0x59fc('0x9')]=_0x55adf7[_0x59fc('0x9')];this[_0x59fc('0xa')]=_0x55adf7[_0x59fc('0xa')];this[_0x59fc('0xb')]=_0x55adf7['countbusyretry']+_0x55adf7[_0x59fc('0x9')]+_0x55adf7['countnoanswerretry']+_0x55adf7[_0x59fc('0xc')]+_0x55adf7['countdropretry']+_0x55adf7[_0x59fc('0xd')]+_0x55adf7[_0x59fc('0xe')]+_0x55adf7[_0x59fc('0xf')];this[_0x59fc('0xc')]=_0x55adf7[_0x59fc('0xc')];this['countdropretry']=_0x55adf7[_0x59fc('0x10')];this[_0x59fc('0xd')]=_0x55adf7['countabandonedretry'];this[_0x59fc('0xe')]=_0x55adf7[_0x59fc('0xe')];this[_0x59fc('0xf')]=_0x55adf7[_0x59fc('0xf')];this[_0x59fc('0x11')]=_0x45a72e[_0x59fc('0x11')];this[_0x59fc('0x12')]=_0x55adf7[_0x59fc('0x13')];this['calleridnum']=_0x55adf7[_0x59fc('0x14')];this[_0x59fc('0x15')]=_0x55adf7[_0x59fc('0x15')];this[_0x59fc('0x16')]=_0x55adf7['responsetime'];this[_0x59fc('0x17')]=_0x55adf7[_0x59fc('0x17')];this['endtime']=this[_0x59fc('0x17')];this[_0x59fc('0x18')]=getSeconds(_0x55adf7[_0x59fc('0x16')],_0x55adf7[_0x59fc('0x15')]);this[_0x59fc('0x19')]=getSeconds(this[_0x59fc('0x17')],_0x55adf7[_0x59fc('0x16')]);this[_0x59fc('0x1a')]=0x0;this[_0x59fc('0x7')]=_0x45a72e['queue'];this[_0x59fc('0x1b')]=_0x45a72e[_0x59fc('0x1c')];this['reason']=_0x45a72e[_0x59fc('0x1d')];this['callback']=_0x55adf7['callback'];this[_0x59fc('0x1e')]=_0x55adf7['callbackuniqueid'];this[_0x59fc('0x1f')]=_0x55adf7['callbackat'];this['recallme']=_0x55adf7[_0x59fc('0x20')];this['ContactId']=_0x55adf7[_0x59fc('0x21')];this[_0x59fc('0x22')]=_0x55adf7[_0x59fc('0x22')];this[_0x59fc('0x23')]=_0x55adf7[_0x59fc('0x23')];this[_0x59fc('0x24')]=_0x55adf7[_0x59fc('0x24')];this[_0x59fc('0x25')]=_0x55adf7[_0x59fc('0x25')];this[_0x59fc('0x26')]=_0x55adf7[_0x59fc('0x26')]||'';this[_0x59fc('0x27')]=_0x55adf7[_0x59fc('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xb681=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','queue','membername','connectedlinename','reason'];(function(_0x30c4ad,_0x5877c4){var _0x31298b=function(_0x2721d9){while(--_0x2721d9){_0x30c4ad['push'](_0x30c4ad['shift']());}};_0x31298b(++_0x5877c4);}(_0xb681,0x153));var _0x1b68=function(_0x7d1f4d,_0x5f339e){_0x7d1f4d=_0x7d1f4d-0x0;var _0x7f0745=_0xb681[_0x7d1f4d];return _0x7f0745;};'use strict';var util=require(_0x1b68('0x0'));var _=require(_0x1b68('0x1'));var moment=require(_0x1b68('0x2'));function getSeconds(_0x1adca9,_0x1ab54f){var _0x459415=moment(_0x1adca9)[_0x1b68('0x3')](0x0);var _0xf7f494=moment(_0x1ab54f)[_0x1b68('0x3')](0x0);return _0x459415[_0x1b68('0x4')](_0xf7f494,'seconds');}function QueueCallerAbandon(_0x241855,_0x551c1d){this[_0x1b68('0x5')]=_0x241855[_0x1b68('0x5')];this[_0x1b68('0x6')]=_0x241855['type'];this['campaigntype']=_0x241855['type']==='outbound'?'queue':_0x241855[_0x1b68('0x6')];this[_0x1b68('0x7')]=_0x241855[_0x1b68('0x7')];this[_0x1b68('0x8')]=_0x241855[_0x1b68('0x8')];this['countnoanswerretry']=_0x241855[_0x1b68('0x9')];this['countglobal']=_0x241855[_0x1b68('0x7')]+_0x241855[_0x1b68('0x8')]+_0x241855[_0x1b68('0x9')]+_0x241855[_0x1b68('0xa')]+_0x241855[_0x1b68('0xb')]+_0x241855[_0x1b68('0xc')]+_0x241855[_0x1b68('0xd')]+_0x241855[_0x1b68('0xe')];this[_0x1b68('0xa')]=_0x241855[_0x1b68('0xa')];this[_0x1b68('0xb')]=_0x241855[_0x1b68('0xb')];this[_0x1b68('0xc')]=_0x241855[_0x1b68('0xc')];this[_0x1b68('0xd')]=_0x241855['countmachineretry'];this[_0x1b68('0xe')]=_0x241855[_0x1b68('0xe')];this[_0x1b68('0xf')]=_0x551c1d[_0x1b68('0xf')];this[_0x1b68('0x10')]=_0x241855[_0x1b68('0x11')];this[_0x1b68('0x12')]=_0x241855[_0x1b68('0x13')];this[_0x1b68('0x14')]=_0x241855[_0x1b68('0x14')];this[_0x1b68('0x15')]=_0x241855[_0x1b68('0x15')];this[_0x1b68('0x16')]=_0x241855[_0x1b68('0x16')];this[_0x1b68('0x17')]=this['droptime'];this['ringtime']=getSeconds(_0x241855['responsetime'],_0x241855[_0x1b68('0x14')]);this[_0x1b68('0x18')]=getSeconds(this['droptime'],_0x241855[_0x1b68('0x15')]);this[_0x1b68('0x19')]=0x0;this[_0x1b68('0x1a')]=_0x551c1d[_0x1b68('0x1a')];this[_0x1b68('0x1b')]=_0x551c1d[_0x1b68('0x1c')];this['reason']=_0x551c1d[_0x1b68('0x1d')];this['callback']=_0x241855['callback'];this['callbackuniqueid']=_0x241855[_0x1b68('0x1e')];this[_0x1b68('0x1f')]=_0x241855[_0x1b68('0x1f')];this[_0x1b68('0x20')]=_0x241855[_0x1b68('0x20')];this[_0x1b68('0x21')]=_0x241855[_0x1b68('0x21')];this['ListId']=_0x241855[_0x1b68('0x22')];this[_0x1b68('0x23')]=_0x241855['UserId'];this[_0x1b68('0x24')]=_0x241855[_0x1b68('0x24')];this[_0x1b68('0x25')]=_0x241855['CampaignId'];this['originatecalleridnum']=_0x241855[_0x1b68('0x26')]||'';this[_0x1b68('0x27')]=_0x241855[_0x1b68('0x27')]||'';}module[_0x1b68('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index a272e3d..3bd3b4a 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(_0x398726,_0x2699c2){var _0x106133=function(_0x1ddf86){while(--_0x1ddf86){_0x398726['push'](_0x398726['shift']());}};_0x106133(++_0x2699c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x59d133,_0x459fc6){var _0x41a10a=function(_0x3d8898){while(--_0x3d8898){_0x59d133['push'](_0x59d133['shift']());}};_0x41a10a(++_0x459fc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 8ef8c88..f6e8931 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 _0x7635=['[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','message','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]'];(function(_0x4bdafc,_0x3d804b){var _0x135b21=function(_0x7abddb){while(--_0x7abddb){_0x4bdafc['push'](_0x4bdafc['shift']());}};_0x135b21(++_0x3d804b);}(_0x7635,0x194));var _0x5763=function(_0x2463e2,_0x1a75c9){_0x2463e2=_0x2463e2-0x0;var _0x358990=_0x7635[_0x2463e2];return _0x358990;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x5763('0x0'));var uuid=require(_0x5763('0x1'));var moment=require(_0x5763('0x2'));var path=require(_0x5763('0x3'));var tiff2pdf=require(_0x5763('0x4'));var gs=require(_0x5763('0x5'));var logger=require('../../../config/logger')(_0x5763('0x6'));var ami=require(_0x5763('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x5763('0x8'));var ut=require(_0x5763('0x9'));var Action=require(_0x5763('0xa'));var faxAccount=require(_0x5763('0xb'));var attachment=require(_0x5763('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x47795c){this['channels']={};this['faxAccounts']=_0x47795c[_0x5763('0xd')];this[_0x5763('0xe')]=_0x47795c[_0x5763('0xe')];this[_0x5763('0xf')]={};ami['on'](_0x5763('0x10'),this[_0x5763('0x11')][_0x5763('0x12')](this));ami['on']('varset',this[_0x5763('0x13')]['bind'](this));ami['on'](_0x5763('0x14'),this[_0x5763('0x15')]['bind'](this));ami['on']('newexten',this[_0x5763('0x16')][_0x5763('0x12')](this));ami['on'](_0x5763('0x17'),this[_0x5763('0x18')][_0x5763('0x12')](this));ami['on'](_0x5763('0x19'),this[_0x5763('0x1a')][_0x5763('0x12')](this));ami['on'](_0x5763('0x1b'),this[_0x5763('0x1c')][_0x5763('0x12')](this));ami['on'](_0x5763('0x1d'),this[_0x5763('0x1e')][_0x5763('0x12')](this));}Fax[_0x5763('0x1f')]['syncNewchannel']=function(_0x4a8bfb){if(_0x4a8bfb[_0x5763('0x20')]==='from-voip-provider'){for(var _0x4bbf29 in this[_0x5763('0xd')]){if(this['faxAccounts'][_0x5763('0x21')](_0x4bbf29)){if(_0x4a8bfb[_0x5763('0x22')]===this[_0x5763('0xd')][_0x4bbf29]['localstationid']){this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]]={};this['channels'][_0x4a8bfb[_0x5763('0x24')]]['channel']=_0x4a8bfb[_0x5763('0x25')];this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]]['id']=this['faxAccounts'][_0x4bbf29]['id'];this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]][_0x5763('0x26')]=this[_0x5763('0xd')][_0x4bbf29][_0x5763('0x26')];logger[_0x5763('0x27')](_0x4a8bfb[_0x5763('0x24')],_0x5763('0x28'));}}}}if(this[_0x5763('0xf')][_0x4a8bfb[_0x5763('0x24')]]){this[_0x5763('0x23')][_0x4a8bfb['uniqueid']]={};this[_0x5763('0x23')][_0x4a8bfb[_0x5763('0x24')]][_0x5763('0x25')]=_0x4a8bfb[_0x5763('0x25')];logger[_0x5763('0x27')](_0x4a8bfb[_0x5763('0x24')],_0x5763('0x28'));}};Fax['prototype']['syncVarSet']=function(_0xeaa7cd){if(this[_0x5763('0x23')][_0xeaa7cd[_0x5763('0x24')]]){for(var _0x1caedb in _0xeaa7cd['variable']){if(_0xeaa7cd[_0x5763('0x29')][_0x5763('0x21')](_0x1caedb)){this['channels'][_0xeaa7cd['uniqueid']][_0x1caedb]=_0xeaa7cd[_0x5763('0x2a')];}}}};Fax['prototype'][_0x5763('0x15')]=function(_0x134ba6){if(this[_0x5763('0x23')][_0x134ba6[_0x5763('0x24')]]){this['channels'][_0x134ba6[_0x5763('0x24')]]['channelstate']=_0x134ba6[_0x5763('0x2b')];this[_0x5763('0x23')][_0x134ba6[_0x5763('0x24')]][_0x5763('0x2c')]=_0x134ba6[_0x5763('0x2c')];}};Fax[_0x5763('0x1f')]['syncNewExten']=function(_0x2f8476){if(this[_0x5763('0x23')][_0x2f8476[_0x5763('0x24')]]){for(var _0x3fdc45 in _0x2f8476[_0x5763('0x29')]){if(_0x2f8476['variable']['hasOwnProperty'](_0x3fdc45)){this[_0x5763('0x23')][_0x2f8476[_0x5763('0x24')]][_0x3fdc45]=_0x2f8476[_0x5763('0x2a')];}}}};Fax[_0x5763('0x1f')][_0x5763('0x18')]=function(_0x587055){if(this['channels'][_0x587055[_0x5763('0x24')]]){this['channels'][_0x587055[_0x5763('0x24')]][_0x5763('0x2d')]=_0x587055[_0x5763('0x2d')];this[_0x5763('0x23')][_0x587055[_0x5763('0x24')]][_0x5763('0x2e')]=_0x587055['status'];this['channels'][_0x587055[_0x5763('0x24')]]['localstationid']=_0x587055[_0x5763('0x2f')];this[_0x5763('0x23')][_0x587055[_0x5763('0x24')]][_0x5763('0x30')]=_0x587055['filename'];logger[_0x5763('0x27')](_0x587055[_0x5763('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x5763('0x1f')][_0x5763('0x1a')]=function(_0x1f7eda){var _0x3abd9e=this;if(this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]]){var _0x6b7f6c=this['channels'][_0x1f7eda[_0x5763('0x24')]]['id'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x31')]=_0x1f7eda['remotestationid'];this['channels'][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x32')]=_0x1f7eda[_0x5763('0x32')];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x2f')]=_0x1f7eda[_0x5763('0x2f')];this[_0x5763('0x23')][_0x1f7eda['uniqueid']][_0x5763('0x33')]=_0x1f7eda['resolution'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x34')]=_0x1f7eda['transferrate'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x30')]=_0x1f7eda['filename'];this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x35')]=_0x1f7eda[_0x5763('0x35')];if(this[_0x5763('0x23')][_0x1f7eda[_0x5763('0x24')]][_0x5763('0x32')]>0x0){tiff2pdf(_0x1f7eda[_0x5763('0x30')],_0x5763('0x36'),function(_0x416286){logger['info'](_0x1f7eda[_0x5763('0x24')],'\x20result\x20conversion\x20file\x20',_0x416286['message']);attachment[_0x5763('0x37')]({'name':path[_0x5763('0x38')](_0x1f7eda[_0x5763('0x30')])[_0x5763('0x26')],'basename':path['parse'](_0x1f7eda[_0x5763('0x30')])[_0x5763('0x26')]+'.pdf','type':'application/pdf'})['then'](function(_0x33f99b){faxAccount['notify'](_0x6b7f6c,{'from':_0x1f7eda['calleridnum'],'mapKey':_0x5763('0x6'),'body':path[_0x5763('0x38')](_0x1f7eda[_0x5763('0x30')])['name']+_0x5763('0x39'),'AttachmentId':_0x33f99b['id']})['catch'](function(_0x4d2588){logger[_0x5763('0x3a')](_0x1f7eda[_0x5763('0x24')],'\x20notify\x20',JSON[_0x5763('0x3b')](_0x4d2588));});})[_0x5763('0x3c')](function(_0x13f797){logger[_0x5763('0x3a')](_0x1f7eda['uniqueid'],_0x5763('0x3d'),JSON[_0x5763('0x3b')](_0x13f797));});});}logger[_0x5763('0x27')](_0x1f7eda[_0x5763('0x24')],_0x5763('0x3d'));}};Fax['prototype']['syncOriginateResponse']=function(_0x525f12){if(this[_0x5763('0xf')][_0x525f12[_0x5763('0x24')]]){_[_0x5763('0x3e')](this[_0x5763('0x23')][_0x525f12[_0x5763('0x24')]],_[_0x5763('0x3f')](_0x525f12,[_0x5763('0x40'),_0x5763('0x41')]));}};function updateStatus(_0x31a6a7){if(_0x31a6a7[_0x5763('0x42')]){faxMessage[_0x5763('0x43')](_0x31a6a7[_0x5763('0x42')],{'failMessage':_0x5763('0x44')})['then'](function(_0x1f7e39){ut[_0x5763('0x45')](_0x5763('0x46'),_0x1f7e39);})[_0x5763('0x3c')](function(_0x5c53db){ut['logger'](_0x5763('0x47'),_0x5c53db);});}else{ut[_0x5763('0x45')](_0x5763('0x48'));}}Fax[_0x5763('0x1f')][_0x5763('0x49')]=function(_0x4ca1b6,_0x2c8b94,_0x2854c1){var _0x44a586=this;var _0xd72d1a={};if(_0x2c8b94){_0xd72d1a={'read':_0x2c8b94};}else{_0xd72d1a={'failMessage':_0x2854c1};}if(this['actions'][_0x4ca1b6][_0x5763('0x42')]){faxMessage[_0x5763('0x43')](this[_0x5763('0xf')][_0x4ca1b6][_0x5763('0x42')],_0xd72d1a)[_0x5763('0x4a')](function(_0x110391){ut['logger'](_0x5763('0x4b'),_0x110391);})[_0x5763('0x3c')](function(_0x5accc3){ut[_0x5763('0x45')](_0x5763('0x4c'),_0x5accc3);})[_0x5763('0x4d')](function(){delete _0x44a586[_0x5763('0x23')][_0x4ca1b6];delete _0x44a586[_0x5763('0xf')][_0x4ca1b6];});}else{ut['logger'](_0x5763('0x4e'));delete this[_0x5763('0x23')][_0x4ca1b6];delete this[_0x5763('0xf')][_0x4ca1b6];}};Fax[_0x5763('0x1f')][_0x5763('0x1c')]=function(_0x2adfa5){var _0x20d5e0=this;if(this[_0x5763('0x23')][_0x2adfa5['uniqueid']]){if(this['actions'][_0x2adfa5[_0x5763('0x24')]]){this['channels'][_0x2adfa5['uniqueid']]['id']=this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]]['id'];this['channels'][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x26')]=this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x26')];}logger['info'](_0x2adfa5[_0x5763('0x24')],this['actions'][_0x2adfa5[_0x5763('0x24')]]?_0x5763('0x4f'):_0x5763('0x50'),JSON[_0x5763('0x3b')](this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]]));if(this[_0x5763('0xf')][_0x2adfa5[_0x5763('0x24')]]){if(this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x51')]>0x0&&this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]]['faxstatus']===_0x5763('0x52')){this[_0x5763('0x49')](_0x2adfa5['uniqueid'],!![]);}else{this[_0x5763('0x49')](_0x2adfa5[_0x5763('0x24')],![],this[_0x5763('0x23')][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2adfa5[_0x5763('0x24')]][_0x5763('0x53')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x5763('0x54')]=function(_0x4647d2){var _0x3e6e86=this;return new BPromise(function(_0x56dc2c,_0x301ce0){_0x3e6e86[_0x5763('0x55')](_0x4647d2,_0x3e6e86[_0x5763('0xd')][_0x4647d2[_0x5763('0x56')]])[_0x5763('0x4a')](function(_0x2d3318){ut[_0x5763('0x45')](_0x5763('0x57'),_0x2d3318);_0x56dc2c(ut['message'](_0x5763('0x58')));})[_0x5763('0x3c')](function(_0x49a39b){ut['logger']('[Fax][execOriginate][failure]',_0x49a39b);updateStatus(_0x4647d2);_0x301ce0(ut['message'](_0x5763('0x59')));});});};Fax[_0x5763('0x1f')][_0x5763('0x5a')]=function(_0x21dab4){var _0x1a83b1=this;return new BPromise(function(_0x544d56,_0x4e1a04){var _0x4ba262=_0x1a83b1[_0x5763('0x5b')](_0x1a83b1[_0x5763('0xd')][_0x21dab4[_0x5763('0x56')]][_0x5763('0x5c')],_0x21dab4);if(_0x4ba262[_0x5763('0x5d')]){_0x544d56(ut[_0x5763('0x5e')]('Trunk\x20Reachable'));}else{_0x4e1a04(ut[_0x5763('0x5e')](_0x4ba262[_0x5763('0x5e')]));}});};function originate(_0x2ee631,_0x5224b7,_0x388312){return new BPromise(function(_0x178e2b,_0x3e97c2){if(_0x388312){var _0x48111a=util[_0x5763('0x5f')](_0x5763('0x60'),path['parse'](_0x2ee631[_0x5763('0x3')])[_0x5763('0x26')],_0x2ee631[_0x5763('0x3')]);gs[_0x5763('0x61')](_0x48111a)['then'](function(){_0x2ee631['path']=util[_0x5763('0x5f')](_0x5763('0x62'),path[_0x5763('0x38')](_0x2ee631[_0x5763('0x3')])[_0x5763('0x63')],path[_0x5763('0x38')](_0x2ee631[_0x5763('0x3')])[_0x5763('0x26')]);_0x5224b7[_0x5763('0x64')]=_0x2ee631[_0x5763('0x3')];ut[_0x5763('0x45')](_0x5763('0x65'),'');ami[_0x5763('0x66')](ut[_0x5763('0x67')](_0x2ee631,_0x5224b7))[_0x5763('0x4a')](function(_0x107050){_0x178e2b(_0x107050);})['catch'](function(_0x1f07eb){_0x3e97c2(_0x1f07eb);});})[_0x5763('0x3c')](function(_0x26fe74){_0x3e97c2(_0x26fe74);});}else{ami[_0x5763('0x66')](ut['variablesAction'](_0x2ee631,_0x5224b7))[_0x5763('0x4a')](function(_0x19caac){_0x178e2b(_0x19caac);})[_0x5763('0x3c')](function(_0x36214e){_0x3e97c2(_0x36214e);});}});}Fax[_0x5763('0x1f')][_0x5763('0x55')]=function(_0x380595,_0x3f3d00){var _0x5d53d4=this;return new BPromise(function(_0x5869bb,_0x373382){var _0x3ed4ae=uuid['v4']();var _0x1fe0ba=ut['addVariables'](_0x380595,_0x3f3d00);_0x5d53d4[_0x5763('0xf')][_0x3ed4ae]=new Action(_0x3ed4ae,_0x3f3d00,_0x380595);var _0x3e9818=_0x5d53d4[_0x5763('0xf')][_0x3ed4ae];if(path['parse'](_0x380595[_0x5763('0x3')])['ext']===_0x5763('0x39')){originate(_0x3e9818,_0x1fe0ba,!![])[_0x5763('0x4a')](function(_0x4c1276){_0x5869bb(_0x4c1276);})['catch'](function(_0x59be1c){_0x373382(_0x59be1c);});}else{originate(_0x3e9818,_0x1fe0ba,![])[_0x5763('0x4a')](function(_0x592444){_0x5869bb(_0x592444);})[_0x5763('0x3c')](function(_0x5c55fd){_0x373382(_0x5c55fd);});}});};Fax[_0x5763('0x1f')][_0x5763('0x68')]=function(_0x4f7703){return!_[_0x5763('0x69')](_0x4f7703)&&!_['isNil'](_0x4f7703[_0x5763('0x26')])&&!_[_0x5763('0x69')](_0x4f7703[_0x5763('0x6a')])&&_0x4f7703[_0x5763('0x6a')]&&!_['isNil'](this[_0x5763('0xe')][util[_0x5763('0x5f')]('SIP/%s',_0x4f7703[_0x5763('0x26')])])&&!_[_0x5763('0x69')](this[_0x5763('0xe')][util[_0x5763('0x5f')]('SIP/%s',_0x4f7703[_0x5763('0x26')])]['status'])&&(this['trunks'][util['format'](_0x5763('0x6b'),_0x4f7703[_0x5763('0x26')])][_0x5763('0x2e')]===_0x5763('0x6c')||this['trunks'][util[_0x5763('0x5f')](_0x5763('0x6b'),_0x4f7703['name'])][_0x5763('0x2e')]===_0x5763('0x6d'));};Fax[_0x5763('0x1f')][_0x5763('0x5b')]=function(_0x5f1baf,_0x19e8b3){if(!this[_0x5763('0x68')](_0x5f1baf)){ut[_0x5763('0x45')](_0x5763('0x6e'),_[_0x5763('0x69')](_0x5f1baf)?'':_0x5f1baf[_0x5763('0x26')]+_0x5763('0x6f'));return{'isValid':![],'message':_0x5763('0x70')};}if(_[_0x5763('0x69')](_0x19e8b3[_0x5763('0x6')])){ut['logger'](_0x5763('0x71'),JSON[_0x5763('0x3b')](_0x19e8b3));return{'isValid':![],'message':_0x5763('0x72')};}if(_[_0x5763('0x69')](_0x19e8b3[_0x5763('0x3')])){ut[_0x5763('0x45')](_0x5763('0x73'),JSON['stringify'](_0x19e8b3));return{'isValid':![],'message':_0x5763('0x74')};}return{'isValid':!![],'message':_0x5763('0x75')};};module[_0x5763('0x76')]=Fax; \ No newline at end of file +var _0x88b9=['[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','SENDING\x20FAILED','send','execOriginate','checkTrunk','FaxAccountId','path','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','name','info','actions','channel','variable','value','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','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','AttachmentId'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x88b9,0x1be));var _0x988b=function(_0x6f346d,_0x2108fc){_0x6f346d=_0x6f346d-0x0;var _0x4b3919=_0x88b9[_0x6f346d];return _0x4b3919;};'use strict';var util=require('util');var _=require(_0x988b('0x0'));var BPromise=require('bluebird');var uuid=require(_0x988b('0x1'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x988b('0x2'));var gs=require(_0x988b('0x3'));var logger=require(_0x988b('0x4'))(_0x988b('0x5'));var ami=require(_0x988b('0x6'));var rpcDb=require(_0x988b('0x7'));var Channel=require('./channel');var ut=require(_0x988b('0x8'));var Action=require(_0x988b('0x9'));var faxAccount=require(_0x988b('0xa'));var attachment=require(_0x988b('0xb'));var faxMessage=require(_0x988b('0xc'));function Fax(_0x4b2cad){this[_0x988b('0xd')]={};this[_0x988b('0xe')]=_0x4b2cad['faxAccounts'];this[_0x988b('0xf')]=_0x4b2cad['trunks'];this['actions']={};ami['on']('newchannel',this[_0x988b('0x10')][_0x988b('0x11')](this));ami['on'](_0x988b('0x12'),this[_0x988b('0x13')][_0x988b('0x11')](this));ami['on']('newstate',this[_0x988b('0x14')][_0x988b('0x11')](this));ami['on']('newexten',this[_0x988b('0x15')]['bind'](this));ami['on'](_0x988b('0x16'),this[_0x988b('0x17')][_0x988b('0x11')](this));ami['on'](_0x988b('0x18'),this[_0x988b('0x19')][_0x988b('0x11')](this));ami['on'](_0x988b('0x1a'),this[_0x988b('0x1b')][_0x988b('0x11')](this));ami['on'](_0x988b('0x1c'),this[_0x988b('0x1d')][_0x988b('0x11')](this));}Fax[_0x988b('0x1e')][_0x988b('0x10')]=function(_0x48df41){if(_0x48df41[_0x988b('0x1f')]===_0x988b('0x20')){for(var _0x1513ff in this[_0x988b('0xe')]){if(this['faxAccounts'][_0x988b('0x21')](_0x1513ff)){if(_0x48df41['exten']===this[_0x988b('0xe')][_0x1513ff][_0x988b('0x22')]){this['channels'][_0x48df41[_0x988b('0x23')]]={};this[_0x988b('0xd')][_0x48df41['uniqueid']]['channel']=_0x48df41['channel'];this[_0x988b('0xd')][_0x48df41[_0x988b('0x23')]]['id']=this['faxAccounts'][_0x1513ff]['id'];this['channels'][_0x48df41['uniqueid']][_0x988b('0x24')]=this[_0x988b('0xe')][_0x1513ff][_0x988b('0x24')];logger[_0x988b('0x25')](_0x48df41[_0x988b('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0x988b('0x26')][_0x48df41[_0x988b('0x23')]]){this[_0x988b('0xd')][_0x48df41[_0x988b('0x23')]]={};this['channels'][_0x48df41[_0x988b('0x23')]][_0x988b('0x27')]=_0x48df41[_0x988b('0x27')];logger[_0x988b('0x25')](_0x48df41['uniqueid'],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x434c99){if(this[_0x988b('0xd')][_0x434c99['uniqueid']]){for(var _0x4abed6 in _0x434c99[_0x988b('0x28')]){if(_0x434c99[_0x988b('0x28')][_0x988b('0x21')](_0x4abed6)){this[_0x988b('0xd')][_0x434c99[_0x988b('0x23')]][_0x4abed6]=_0x434c99[_0x988b('0x29')];}}}};Fax[_0x988b('0x1e')]['syncNewState']=function(_0x559ca4){if(this[_0x988b('0xd')][_0x559ca4[_0x988b('0x23')]]){this[_0x988b('0xd')][_0x559ca4['uniqueid']][_0x988b('0x2a')]=_0x559ca4[_0x988b('0x2a')];this[_0x988b('0xd')][_0x559ca4[_0x988b('0x23')]][_0x988b('0x2b')]=_0x559ca4[_0x988b('0x2b')];}};Fax[_0x988b('0x1e')][_0x988b('0x15')]=function(_0x519937){if(this[_0x988b('0xd')][_0x519937[_0x988b('0x23')]]){for(var _0x390690 in _0x519937[_0x988b('0x28')]){if(_0x519937['variable'][_0x988b('0x21')](_0x390690)){this[_0x988b('0xd')][_0x519937[_0x988b('0x23')]][_0x390690]=_0x519937[_0x988b('0x29')];}}}};Fax[_0x988b('0x1e')][_0x988b('0x17')]=function(_0x3a589f){if(this[_0x988b('0xd')][_0x3a589f[_0x988b('0x23')]]){this[_0x988b('0xd')][_0x3a589f[_0x988b('0x23')]][_0x988b('0x2c')]=_0x3a589f[_0x988b('0x2c')];this[_0x988b('0xd')][_0x3a589f['uniqueid']][_0x988b('0x2d')]=_0x3a589f[_0x988b('0x2d')];this[_0x988b('0xd')][_0x3a589f['uniqueid']][_0x988b('0x22')]=_0x3a589f['localstationid'];this[_0x988b('0xd')][_0x3a589f[_0x988b('0x23')]]['filename']=_0x3a589f[_0x988b('0x2e')];logger[_0x988b('0x25')](_0x3a589f[_0x988b('0x23')],_0x988b('0x2f'));}};Fax[_0x988b('0x1e')][_0x988b('0x19')]=function(_0x1f1d13){var _0x230d65=this;if(this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]]){var _0x518bf6=this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]]['id'];this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]]['remotestationid']=_0x1f1d13[_0x988b('0x30')];this['channels'][_0x1f1d13[_0x988b('0x23')]][_0x988b('0x31')]=_0x1f1d13['pagestransferred'];this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]][_0x988b('0x22')]=_0x1f1d13[_0x988b('0x22')];this['channels'][_0x1f1d13[_0x988b('0x23')]][_0x988b('0x32')]=_0x1f1d13[_0x988b('0x32')];this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]]['transferrate']=_0x1f1d13[_0x988b('0x33')];this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]][_0x988b('0x2e')]=_0x1f1d13[_0x988b('0x2e')];this[_0x988b('0xd')][_0x1f1d13[_0x988b('0x23')]]['calleridnum']=_0x1f1d13[_0x988b('0x34')];if(this[_0x988b('0xd')][_0x1f1d13['uniqueid']][_0x988b('0x31')]>0x0){tiff2pdf(_0x1f1d13[_0x988b('0x2e')],_0x988b('0x35'),function(_0x52df5e){logger[_0x988b('0x25')](_0x1f1d13[_0x988b('0x23')],_0x988b('0x36'),_0x52df5e[_0x988b('0x37')]);attachment[_0x988b('0x38')]({'name':path[_0x988b('0x39')](_0x1f1d13[_0x988b('0x2e')])[_0x988b('0x24')],'basename':path[_0x988b('0x39')](_0x1f1d13['filename'])[_0x988b('0x24')]+_0x988b('0x3a'),'type':'application/pdf'})[_0x988b('0x3b')](function(_0x3d982d){faxAccount[_0x988b('0x3c')](_0x518bf6,{'from':_0x1f1d13['calleridnum'],'mapKey':'fax','body':path[_0x988b('0x39')](_0x1f1d13['filename'])['name']+_0x988b('0x3a'),'AttachmentId':_0x3d982d['id']})[_0x988b('0x3d')](function(_0x3ea8b6){logger['error'](_0x1f1d13[_0x988b('0x23')],_0x988b('0x3e'),JSON[_0x988b('0x3f')](_0x3ea8b6));});})[_0x988b('0x3d')](function(_0x706b97){logger[_0x988b('0x40')](_0x1f1d13[_0x988b('0x23')],_0x988b('0x41'),JSON[_0x988b('0x3f')](_0x706b97));});});}logger[_0x988b('0x25')](_0x1f1d13[_0x988b('0x23')],'\x20receiveFax\x20');}};Fax[_0x988b('0x1e')][_0x988b('0x1d')]=function(_0x1e1341){if(this[_0x988b('0x26')][_0x1e1341[_0x988b('0x23')]]){_[_0x988b('0x42')](this[_0x988b('0xd')][_0x1e1341[_0x988b('0x23')]],_['pick'](_0x1e1341,[_0x988b('0x43'),_0x988b('0x44')]));}};function updateStatus(_0x29e4a8){if(_0x29e4a8['AttachmentId']){faxMessage[_0x988b('0x45')](_0x29e4a8['AttachmentId'],{'failMessage':_0x988b('0x46')})[_0x988b('0x3b')](function(_0x5e5972){ut[_0x988b('0x47')]('[Fax][Message][Error][Updated]',_0x5e5972);})['catch'](function(_0x5c42bd){ut[_0x988b('0x47')](_0x988b('0x48'),_0x5c42bd);});}else{ut[_0x988b('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x988b('0x1e')]['updateStatus']=function(_0x123f2f,_0x5b581f,_0x56c6f4){var _0x142d53=this;var _0x5dc8eb={};if(_0x5b581f){_0x5dc8eb={'read':_0x5b581f};}else{_0x5dc8eb={'failMessage':_0x56c6f4};}if(this['actions'][_0x123f2f][_0x988b('0x49')]){faxMessage[_0x988b('0x45')](this['actions'][_0x123f2f][_0x988b('0x49')],_0x5dc8eb)['then'](function(_0x2c3640){ut['logger'](_0x988b('0x4a'),_0x2c3640);})['catch'](function(_0x4309fb){ut['logger']('[Fax][Message][NoUpdate1]',_0x4309fb);})['finally'](function(){delete _0x142d53[_0x988b('0xd')][_0x123f2f];delete _0x142d53['actions'][_0x123f2f];});}else{ut[_0x988b('0x47')](_0x988b('0x4b'));delete this['channels'][_0x123f2f];delete this['actions'][_0x123f2f];}};Fax[_0x988b('0x1e')][_0x988b('0x1b')]=function(_0x4f3bae){var _0x59e3e4=this;if(this['channels'][_0x4f3bae['uniqueid']]){if(this[_0x988b('0x26')][_0x4f3bae[_0x988b('0x23')]]){this[_0x988b('0xd')][_0x4f3bae[_0x988b('0x23')]]['id']=this[_0x988b('0x26')][_0x4f3bae['uniqueid']]['id'];this[_0x988b('0xd')][_0x4f3bae[_0x988b('0x23')]][_0x988b('0x24')]=this['actions'][_0x4f3bae[_0x988b('0x23')]][_0x988b('0x24')];}logger[_0x988b('0x25')](_0x4f3bae[_0x988b('0x23')],this[_0x988b('0x26')][_0x4f3bae['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x988b('0x4c'),JSON['stringify'](this[_0x988b('0xd')][_0x4f3bae[_0x988b('0x23')]]));if(this[_0x988b('0x26')][_0x4f3bae[_0x988b('0x23')]]){if(this['channels'][_0x4f3bae[_0x988b('0x23')]]['faxpages']>0x0&&this[_0x988b('0xd')][_0x4f3bae[_0x988b('0x23')]][_0x988b('0x16')]===_0x988b('0x4d')){this[_0x988b('0x4e')](_0x4f3bae['uniqueid'],!![]);}else{this[_0x988b('0x4e')](_0x4f3bae[_0x988b('0x23')],![],this[_0x988b('0xd')][_0x4f3bae[_0x988b('0x23')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x988b('0xd')][_0x4f3bae['uniqueid']]['faxstatusstring']:_0x988b('0x4f'));}}}};Fax[_0x988b('0x1e')][_0x988b('0x50')]=function(_0xce78da){var _0x2eb1b8=this;return new BPromise(function(_0x421c16,_0x52b16d){_0x2eb1b8[_0x988b('0x51')](_0xce78da,_0x2eb1b8[_0x988b('0xe')][_0xce78da['FaxAccountId']])['then'](function(_0x133232){ut['logger']('[Fax][execOriginate][success]',_0x133232);_0x421c16(ut[_0x988b('0x37')]('Fax\x20received'));})[_0x988b('0x3d')](function(_0x4c8a48){ut[_0x988b('0x47')]('[Fax][execOriginate][failure]',_0x4c8a48);updateStatus(_0xce78da);_0x52b16d(ut[_0x988b('0x37')]('Fax\x20failed'));});});};Fax[_0x988b('0x1e')]['checkAfterSend']=function(_0x287d36){var _0x55b2eb=this;return new BPromise(function(_0x411916,_0x2b48a1){var _0xcd0ab6=_0x55b2eb[_0x988b('0x52')](_0x55b2eb[_0x988b('0xe')][_0x287d36[_0x988b('0x53')]]['Trunk'],_0x287d36);if(_0xcd0ab6['isValid']){_0x411916(ut[_0x988b('0x37')]('Trunk\x20Reachable'));}else{_0x2b48a1(ut[_0x988b('0x37')](_0xcd0ab6[_0x988b('0x37')]));}});};function originate(_0x1f58c2,_0x200513,_0x471593){return new BPromise(function(_0x984e90,_0x413c34){if(_0x471593){var _0x2d8bf2=util['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',path[_0x988b('0x39')](_0x1f58c2[_0x988b('0x54')])[_0x988b('0x24')],_0x1f58c2[_0x988b('0x54')]);gs['execute'](_0x2d8bf2)[_0x988b('0x3b')](function(){_0x1f58c2['path']=util[_0x988b('0x55')](_0x988b('0x56'),path[_0x988b('0x39')](_0x1f58c2['path'])[_0x988b('0x57')],path[_0x988b('0x39')](_0x1f58c2[_0x988b('0x54')])[_0x988b('0x24')]);_0x200513['XMF-PATH']=_0x1f58c2[_0x988b('0x54')];ut[_0x988b('0x47')](_0x988b('0x58'),'');ami[_0x988b('0x59')](ut['variablesAction'](_0x1f58c2,_0x200513))[_0x988b('0x3b')](function(_0x3ccc2e){_0x984e90(_0x3ccc2e);})[_0x988b('0x3d')](function(_0x1d7b78){_0x413c34(_0x1d7b78);});})[_0x988b('0x3d')](function(_0x42a3e8){_0x413c34(_0x42a3e8);});}else{ami['Action'](ut[_0x988b('0x5a')](_0x1f58c2,_0x200513))[_0x988b('0x3b')](function(_0x18def0){_0x984e90(_0x18def0);})[_0x988b('0x3d')](function(_0x4fd30e){_0x413c34(_0x4fd30e);});}});}Fax['prototype']['execOriginate']=function(_0x3da5ae,_0x32de62){var _0x5aef9f=this;return new BPromise(function(_0x46ea45,_0x5cedd4){var _0x2eb646=uuid['v4']();var _0x2d6b45=ut[_0x988b('0x5b')](_0x3da5ae,_0x32de62);_0x5aef9f[_0x988b('0x26')][_0x2eb646]=new Action(_0x2eb646,_0x32de62,_0x3da5ae);var _0x2902b0=_0x5aef9f['actions'][_0x2eb646];if(path['parse'](_0x3da5ae['path'])[_0x988b('0x5c')]===_0x988b('0x3a')){originate(_0x2902b0,_0x2d6b45,!![])[_0x988b('0x3b')](function(_0x3a543b){_0x46ea45(_0x3a543b);})[_0x988b('0x3d')](function(_0x586172){_0x5cedd4(_0x586172);});}else{originate(_0x2902b0,_0x2d6b45,![])['then'](function(_0xc58dcb){_0x46ea45(_0xc58dcb);})[_0x988b('0x3d')](function(_0x5b33e4){_0x5cedd4(_0x5b33e4);});}});};Fax['prototype'][_0x988b('0x5d')]=function(_0x329d76){return!_[_0x988b('0x5e')](_0x329d76)&&!_['isNil'](_0x329d76[_0x988b('0x24')])&&!_['isNil'](_0x329d76['active'])&&_0x329d76[_0x988b('0x5f')]&&!_['isNil'](this[_0x988b('0xf')][util[_0x988b('0x55')](_0x988b('0x60'),_0x329d76['name'])])&&!_[_0x988b('0x5e')](this['trunks'][util[_0x988b('0x55')](_0x988b('0x60'),_0x329d76[_0x988b('0x24')])]['status'])&&(this[_0x988b('0xf')][util[_0x988b('0x55')]('SIP/%s',_0x329d76[_0x988b('0x24')])][_0x988b('0x2d')]==='reachable'||this[_0x988b('0xf')][util[_0x988b('0x55')](_0x988b('0x60'),_0x329d76[_0x988b('0x24')])][_0x988b('0x2d')]===_0x988b('0x61'));};Fax[_0x988b('0x1e')][_0x988b('0x52')]=function(_0x501914,_0x2f57fb){if(!this[_0x988b('0x5d')](_0x501914)){ut[_0x988b('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x988b('0x5e')](_0x501914)?'':_0x501914[_0x988b('0x24')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x988b('0x62')};}if(_[_0x988b('0x5e')](_0x2f57fb[_0x988b('0x5')])){ut['logger'](_0x988b('0x63'),JSON[_0x988b('0x3f')](_0x2f57fb));return{'isValid':![],'message':_0x988b('0x64')};}if(_['isNil'](_0x2f57fb[_0x988b('0x54')])){ut[_0x988b('0x47')](_0x988b('0x65'),JSON['stringify'](_0x2f57fb));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x988b('0x66')};};module[_0x988b('0x67')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 815feea..f3f3c25 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 _0x0a7a=['[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x5ace87,_0x1612f9){var _0x1b985b=function(_0x557e82){while(--_0x557e82){_0x5ace87['push'](_0x5ace87['shift']());}};_0x1b985b(++_0x1612f9);}(_0x0a7a,0x18d));var _0xa0a7=function(_0x9ea7f3,_0x4eab77){_0x9ea7f3=_0x9ea7f3-0x0;var _0x44bc26=_0x0a7a[_0x9ea7f3];return _0x44bc26;};'use strict';var util=require(_0xa0a7('0x0'));var BPromise=require(_0xa0a7('0x1'));var logger=require('../../../config/logger')(_0xa0a7('0x2'));var _=require(_0xa0a7('0x3'));var faxAccount=require(_0xa0a7('0x4'));function loggerCatch(_0x575760){return function(_0x42033a){logger[_0xa0a7('0x5')](_0x575760,util[_0xa0a7('0x6')](_0x42033a,{'showHidden':![],'depth':null}));};}exports[_0xa0a7('0x7')]=function(_0x52f94d,_0x367ff1){return BPromise[_0xa0a7('0x8')]()[_0xa0a7('0x9')](faxAccount[_0xa0a7('0x7')](_0x52f94d,_0x367ff1))[_0xa0a7('0xa')](loggerCatch(_0xa0a7('0xb')));}; \ No newline at end of file +var _0x12ec=['resolve','then','util','bluebird','preview','lodash','../rpc/faxAccount','inspect'];(function(_0x30c104,_0x13095a){var _0x3e5861=function(_0x4843ea){while(--_0x4843ea){_0x30c104['push'](_0x30c104['shift']());}};_0x3e5861(++_0x13095a);}(_0x12ec,0x82));var _0xc12e=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x12ec[_0x3f4891];return _0x54f2d8;};'use strict';var util=require(_0xc12e('0x0'));var BPromise=require(_0xc12e('0x1'));var logger=require('../../../config/logger')(_0xc12e('0x2'));var _=require(_0xc12e('0x3'));var faxAccount=require(_0xc12e('0x4'));function loggerCatch(_0x257d5b){return function(_0x41afd3){logger['error'](_0x257d5b,util[_0xc12e('0x5')](_0x41afd3,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x53258a,_0x2637fa){return BPromise[_0xc12e('0x6')]()[_0xc12e('0x7')](faxAccount['notify'](_0x53258a,_0x2637fa))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 98f1cde..6711b98 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 _0xca39=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs'];(function(_0xe28870,_0x252764){var _0x2cd2eb=function(_0x4c6e2a){while(--_0x4c6e2a){_0xe28870['push'](_0xe28870['shift']());}};_0x2cd2eb(++_0x252764);}(_0xca39,0x84));var _0x9ca3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xca39[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x9ca3('0x0'));var logger=require(_0x9ca3('0x1'))(_0x9ca3('0x2'));var BPromise=require(_0x9ca3('0x3'));var exec=require('child_process')[_0x9ca3('0x4')];exports[_0x9ca3('0x5')]=function(_0x221387){return new BPromise(function(_0x578c89,_0x563f6d){exec(_0x221387,function(_0x595bee,_0x2cf779,_0x266a37){logger[_0x9ca3('0x6')](_0x9ca3('0x7'),_0x2cf779);if(_0x595bee){logger[_0x9ca3('0x6')]('Exec\x20gs',_0x9ca3('0x8'),util[_0x9ca3('0x9')](_0x595bee,{'showHidden':![],'depth':null}),_0x2cf779,_0x266a37);_0x563f6d(_0x595bee);}_0x578c89(_0x2cf779);});});}; \ No newline at end of file +var _0x5733=['child_process','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird'];(function(_0x43eb89,_0x62d271){var _0x385fcb=function(_0x5c38e5){while(--_0x5c38e5){_0x43eb89['push'](_0x43eb89['shift']());}};_0x385fcb(++_0x62d271);}(_0x5733,0xbd));var _0x3573=function(_0x5c10fd,_0x12732a){_0x5c10fd=_0x5c10fd-0x0;var _0x4034fb=_0x5733[_0x5c10fd];return _0x4034fb;};'use strict';var util=require(_0x3573('0x0'));var logger=require('../../../../config/logger')(_0x3573('0x1'));var BPromise=require(_0x3573('0x2'));var exec=require(_0x3573('0x3'))['exec'];exports['execute']=function(_0x40ba8d){return new BPromise(function(_0x585f64,_0x3f28f5){exec(_0x40ba8d,function(_0x5db1b6,_0x10ffc2,_0x797ebe){logger[_0x3573('0x4')](_0x3573('0x5'),_0x10ffc2);if(_0x5db1b6){logger['info'](_0x3573('0x5'),_0x3573('0x6'),util[_0x3573('0x7')](_0x5db1b6,{'showHidden':![],'depth':null}),_0x10ffc2,_0x797ebe);_0x3f28f5(_0x5db1b6);}_0x585f64(_0x10ffc2);});});}; \ 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 a7aeb17..580132f 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 _0xdfe0=['uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xdfe0,0x85));var _0x0dfe=function(_0x40ef43,_0x4df08e){_0x40ef43=_0x40ef43-0x0;var _0x3182f4=_0xdfe0[_0x40ef43];return _0x3182f4;};'use strict';var util=require(_0x0dfe('0x0'));var _=require(_0x0dfe('0x1'));var moment=require(_0x0dfe('0x2'));var logger=require(_0x0dfe('0x3'))(_0x0dfe('0x4'));exports[_0x0dfe('0x5')]=function(_0x114f67){return{'message':_0x114f67};};exports['logger']=function(_0x513e0e,_0x30ea02){logger[_0x0dfe('0x6')](_0x513e0e,util[_0x0dfe('0x7')](_0x30ea02,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x521025,_0x237b43){var _0x25dba1={'XMF-ECM':_0x237b43[_0x0dfe('0x8')],'XMF-HEADERINFO':_0x237b43[_0x0dfe('0x9')],'XMF-MINRATE':_0x237b43[_0x0dfe('0xa')],'XMF-MAXRATE':_0x237b43['maxrate'],'XMF-MODEM':util['format'](_0x0dfe('0xb'),_0x237b43[_0x0dfe('0xc')]),'XMF-GATEWAY':_0x237b43[_0x0dfe('0xd')],'XMF-FAXDETECT':_0x237b43[_0x0dfe('0xe')],'XMF-T38TIMEOUT':_0x237b43['t38timeout'],'XMF-LOCALSTATIONID':_0x237b43[_0x0dfe('0xf')],'XMF-PATH':_0x521025[_0x0dfe('0x10')]};return _0x25dba1;};exports[_0x0dfe('0x11')]=function(_0x52c90a,_0x6a934d){return{'actionid':_0x52c90a['uniqueid'],'action':'originate','channel':_0x52c90a[_0x0dfe('0x12')],'Exten':_0x0dfe('0x13'),'Context':_0x0dfe('0x14'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x52c90a[_0x0dfe('0x9')]?_0x52c90a['headerinfo']:'',_0x52c90a['localstationid']),'variable':_0x6a934d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x52c90a[_0x0dfe('0x15')]};}; \ No newline at end of file +var _0xa486=['headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','util','moment','../../../../config/logger','logger','inspect','addVariables','ecm'];(function(_0x4d918a,_0x264afc){var _0x308ef5=function(_0x2bcb8d){while(--_0x2bcb8d){_0x4d918a['push'](_0x4d918a['shift']());}};_0x308ef5(++_0x264afc);}(_0xa486,0xd5));var _0x6a48=function(_0x289849,_0x3c564f){_0x289849=_0x289849-0x0;var _0x4ab712=_0xa486[_0x289849];return _0x4ab712;};'use strict';var util=require(_0x6a48('0x0'));var _=require('lodash');var moment=require(_0x6a48('0x1'));var logger=require(_0x6a48('0x2'))('fax');exports['message']=function(_0x42fcf0){return{'message':_0x42fcf0};};exports[_0x6a48('0x3')]=function(_0x2b9835,_0x59df1b){logger['info'](_0x2b9835,util[_0x6a48('0x4')](_0x59df1b,{'showHidden':![],'depth':null}));};exports[_0x6a48('0x5')]=function(_0x1e4059,_0x4aa8cc){var _0x26a560={'XMF-ECM':_0x4aa8cc[_0x6a48('0x6')],'XMF-HEADERINFO':_0x4aa8cc[_0x6a48('0x7')],'XMF-MINRATE':_0x4aa8cc[_0x6a48('0x8')],'XMF-MAXRATE':_0x4aa8cc['maxrate'],'XMF-MODEM':util[_0x6a48('0x9')](_0x6a48('0xa'),_0x4aa8cc[_0x6a48('0xb')]),'XMF-GATEWAY':_0x4aa8cc[_0x6a48('0xc')],'XMF-FAXDETECT':_0x4aa8cc[_0x6a48('0xd')],'XMF-T38TIMEOUT':_0x4aa8cc[_0x6a48('0xe')],'XMF-LOCALSTATIONID':_0x4aa8cc[_0x6a48('0xf')],'XMF-PATH':_0x1e4059[_0x6a48('0x10')]};return _0x26a560;};exports['variablesAction']=function(_0x3ac2b7,_0x31d57f){return{'actionid':_0x3ac2b7[_0x6a48('0x11')],'action':_0x6a48('0x12'),'channel':_0x3ac2b7[_0x6a48('0x13')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x6a48('0x9')]('\x22%s\x22\x20<%s>',_0x3ac2b7[_0x6a48('0x7')]?_0x3ac2b7[_0x6a48('0x7')]:'',_0x3ac2b7['localstationid']),'variable':_0x31d57f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3ac2b7[_0x6a48('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index de54507..692fbc3 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 _0xfe1c=['./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','listen','log','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0xc054d1,_0x327b08){var _0x3e67dd=function(_0x38da3a){while(--_0x38da3a){_0xc054d1['push'](_0xc054d1['shift']());}};_0x3e67dd(++_0x327b08);}(_0xfe1c,0x13d));var _0xcfe1=function(_0x11988d,_0x5a0605){_0x11988d=_0x11988d-0x0;var _0x5468e0=_0xfe1c[_0x11988d];return _0x5468e0;};'use strict';var BPromise=require('bluebird');var util=require(_0xcfe1('0x0'));var moment=require(_0xcfe1('0x1'));var server=require(_0xcfe1('0x2'));var Realtime=require('./realtime');var Report=require(_0xcfe1('0x3'));var Acw=require(_0xcfe1('0x4'));var Trigger=require(_0xcfe1('0x5'));var Dialer=require(_0xcfe1('0x6'));var Preview=require(_0xcfe1('0x7'));var Fax=require(_0xcfe1('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xcfe1('0x9'));var voiceQueueReport=require(_0xcfe1('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xcfe1('0xb'));var trigger=require(_0xcfe1('0xc'));var template=require(_0xcfe1('0xd'));var cmHopperHistory=require(_0xcfe1('0xe'));var campaign=require(_0xcfe1('0xf'));var voiceExtension=require(_0xcfe1('0x10'));var faxAccount=require(_0xcfe1('0x11'));var zendesk=require(_0xcfe1('0x12'));var salesforce=require(_0xcfe1('0x13'));var sugarcrm=require(_0xcfe1('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xcfe1('0x15'));var zoho=require(_0xcfe1('0x16'));var vtiger=require(_0xcfe1('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xcfe1('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xcfe1('0x19')](_0xcfe1('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xcfe1('0x19')](_0xcfe1('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xcfe1('0x1b')]()[_0xcfe1('0x1c')](user[_0xcfe1('0x1d')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x1e')]())[_0xcfe1('0x1c')](user['getTelephones']())[_0xcfe1('0x1c')](realtime['initTelephones']())[_0xcfe1('0x1c')](trunk[_0xcfe1('0x1f')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x21')]())[_0xcfe1('0x1c')](trigger[_0xcfe1('0x22')]())[_0xcfe1('0x1c')](realtime['initTriggers']())['then'](template['getTemplates']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x23')]())[_0xcfe1('0x1c')](zendesk[_0xcfe1('0x24')]())['then'](realtime[_0xcfe1('0x25')]())[_0xcfe1('0x1c')](salesforce[_0xcfe1('0x26')]())['then'](realtime['initSalesforceAccounts']())[_0xcfe1('0x1c')](sugarcrm[_0xcfe1('0x27')]())['then'](realtime[_0xcfe1('0x28')]())['then'](freshdesk[_0xcfe1('0x29')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2a')]())[_0xcfe1('0x1c')](desk[_0xcfe1('0x2b')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2c')]())[_0xcfe1('0x1c')](zoho['getZohoAccounts']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x2d')]())[_0xcfe1('0x1c')](vtiger[_0xcfe1('0x2e')]())['then'](realtime[_0xcfe1('0x2f')]())[_0xcfe1('0x1c')](freshsales['getFreshsalesAccounts']())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x30')]())[_0xcfe1('0x1c')](servicenow[_0xcfe1('0x31')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x32')]())[_0xcfe1('0x1c')](dynamics365[_0xcfe1('0x33')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x34')]())['then'](campaign[_0xcfe1('0x35')]())['then'](realtime[_0xcfe1('0x36')]())['then'](voiceExtension[_0xcfe1('0x37')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x38')]())[_0xcfe1('0x1c')](faxAccount[_0xcfe1('0x39')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3a')]())[_0xcfe1('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xcfe1('0x1b')]()[_0xcfe1('0x1c')](voiceQueueReport[_0xcfe1('0x3b')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3c')]())[_0xcfe1('0x1c')](cmHopperHistory[_0xcfe1('0x3d')]())[_0xcfe1('0x1c')](realtime[_0xcfe1('0x3e')]())[_0xcfe1('0x1c')](cmHopperHistory[_0xcfe1('0x3f')]())[_0xcfe1('0x1c')](realtime['initCampaignHopperHistory']())[_0xcfe1('0x1c')](voiceCallReport[_0xcfe1('0x40')]())[_0xcfe1('0x1c')](realtime['initVoiceCallReports']())[_0xcfe1('0x1c')](function(_0xdcdd0d){})['catch'](function(_0xfb1759){console['log'](_0xfb1759);});}function main(){return server[_0xcfe1('0x41')](realtime,preview,fax)[_0xcfe1('0x1c')](function(_0x1d58b6){return initRealtime();})['then'](function(){return initParams();})[_0xcfe1('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3038c7){console[_0xcfe1('0x42')](_0x3038c7);});}main(); \ No newline at end of file +var _0x593f=['getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','moment','./acw','./dialer','./preview','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','then','getAgents','initAgents'];(function(_0x62144e,_0x5ae502){var _0x5c5436=function(_0x5f043b){while(--_0x5f043b){_0x62144e['push'](_0x62144e['shift']());}};_0x5c5436(++_0x5ae502);}(_0x593f,0x1ca));var _0xf593=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x593f[_0x1fc84d];return _0x2658fa;};'use strict';var BPromise=require(_0xf593('0x0'));var util=require('util');var moment=require(_0xf593('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0xf593('0x2'));var Trigger=require('./trigger');var Dialer=require(_0xf593('0x3'));var Preview=require(_0xf593('0x4'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xf593('0x5'));var voiceCallReport=require(_0xf593('0x6'));var trunk=require('./rpc/trunk');var trigger=require(_0xf593('0x7'));var template=require(_0xf593('0x8'));var cmHopperHistory=require(_0xf593('0x9'));var campaign=require(_0xf593('0xa'));var voiceExtension=require(_0xf593('0xb'));var faxAccount=require(_0xf593('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xf593('0xd'));var desk=require(_0xf593('0xe'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xf593('0xf'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xf593('0x10'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf593('0x11')](_0xf593('0x12'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf593('0x11')](_0xf593('0x12'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xf593('0x13')](user[_0xf593('0x14')]())[_0xf593('0x13')](realtime[_0xf593('0x15')]())[_0xf593('0x13')](user[_0xf593('0x16')]())[_0xf593('0x13')](realtime[_0xf593('0x17')]())[_0xf593('0x13')](trunk['getTrunks']())['then'](realtime[_0xf593('0x18')]())['then'](voiceQueue[_0xf593('0x19')]())[_0xf593('0x13')](realtime[_0xf593('0x1a')]())[_0xf593('0x13')](trigger['getTriggers']())[_0xf593('0x13')](realtime['initTriggers']())[_0xf593('0x13')](template[_0xf593('0x1b')]())['then'](realtime[_0xf593('0x1c')]())['then'](zendesk['getZendeskAccounts']())[_0xf593('0x13')](realtime[_0xf593('0x1d')]())[_0xf593('0x13')](salesforce[_0xf593('0x1e')]())[_0xf593('0x13')](realtime[_0xf593('0x1f')]())[_0xf593('0x13')](sugarcrm[_0xf593('0x20')]())[_0xf593('0x13')](realtime[_0xf593('0x21')]())[_0xf593('0x13')](freshdesk[_0xf593('0x22')]())[_0xf593('0x13')](realtime[_0xf593('0x23')]())[_0xf593('0x13')](desk[_0xf593('0x24')]())[_0xf593('0x13')](realtime[_0xf593('0x25')]())[_0xf593('0x13')](zoho['getZohoAccounts']())[_0xf593('0x13')](realtime[_0xf593('0x26')]())['then'](vtiger['getVtigerAccounts']())[_0xf593('0x13')](realtime['initVtigerAccounts']())['then'](freshsales[_0xf593('0x27')]())['then'](realtime[_0xf593('0x28')]())['then'](servicenow[_0xf593('0x29')]())[_0xf593('0x13')](realtime[_0xf593('0x2a')]())['then'](dynamics365[_0xf593('0x2b')]())[_0xf593('0x13')](realtime[_0xf593('0x2c')]())['then'](campaign['getCampaigns']())[_0xf593('0x13')](realtime[_0xf593('0x2d')]())[_0xf593('0x13')](voiceExtension[_0xf593('0x2e')]())[_0xf593('0x13')](realtime[_0xf593('0x2f')]())[_0xf593('0x13')](faxAccount[_0xf593('0x30')]())[_0xf593('0x13')](realtime['initFaxAccounts']())[_0xf593('0x13')](function(){return realtime;});}function initParams(){return BPromise[_0xf593('0x31')]()[_0xf593('0x13')](voiceQueueReport[_0xf593('0x32')]())['then'](realtime[_0xf593('0x33')]())[_0xf593('0x13')](cmHopperHistory[_0xf593('0x34')]())['then'](realtime[_0xf593('0x35')]())['then'](cmHopperHistory[_0xf593('0x36')]())[_0xf593('0x13')](realtime['initCampaignHopperHistory']())[_0xf593('0x13')](voiceCallReport[_0xf593('0x37')]())[_0xf593('0x13')](realtime[_0xf593('0x38')]())['then'](function(_0x40a38d){})[_0xf593('0x39')](function(_0x5ce810){console[_0xf593('0x3a')](_0x5ce810);});}function main(){return server[_0xf593('0x3b')](realtime,preview,fax)[_0xf593('0x13')](function(_0x2a22db){return initRealtime();})['then'](function(){return initParams();})[_0xf593('0x13')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xf593('0x39')](function(_0x19a507){console[_0xf593('0x3a')](_0x19a507);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 889cd98..22af201 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1d5385,_0x17e29f){var _0x55ea1e=function(_0x781ffe){while(--_0x781ffe){_0x1d5385['push'](_0x1d5385['shift']());}};_0x55ea1e(++_0x17e29f);}(_0x70e0,0x17b));var _0x070e=function(_0x384638,_0x57f4ed){_0x384638=_0x384638-0x0;var _0x2e1a39=_0x70e0[_0x384638];return _0x2e1a39;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d55d012..85dec06 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 _0x35d9=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0xab0515,_0x4b8ab2){var _0x443d59=function(_0xfd6c59){while(--_0xfd6c59){_0xab0515['push'](_0xab0515['shift']());}};_0x443d59(++_0x4b8ab2);}(_0x35d9,0xe6));var _0x935d=function(_0x7a4c3,_0x365412){_0x7a4c3=_0x7a4c3-0x0;var _0x22ca82=_0x35d9[_0x7a4c3];return _0x22ca82;};'use strict';function Campaign(_0x497929){this['id']=_0x497929['id']||0x0;this['name']=_0x497929['name']||'';this[_0x935d('0x0')]=_0x497929[_0x935d('0x0')]||_0x935d('0x1');this['originated']=0x0;this[_0x935d('0x2')]=0x0;this[_0x935d('0x3')]=0x0;this[_0x935d('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x497929[_0x935d('0x5')];this[_0x935d('0x6')]=_0x497929[_0x935d('0x6')];this[_0x935d('0x7')]=_0x497929[_0x935d('0x7')]||null;this[_0x935d('0x8')]=_0x497929[_0x935d('0x8')]?_0x497929[_0x935d('0x8')]:null;this[_0x935d('0x9')]=_0x497929[_0x935d('0x9')];this[_0x935d('0xa')]=_0x497929[_0x935d('0xa')];this[_0x935d('0xb')]=_0x497929[_0x935d('0xb')]||0x1e;this[_0x935d('0xc')]=_0x497929[_0x935d('0xc')];this[_0x935d('0xd')]=_0x497929[_0x935d('0xd')];this[_0x935d('0xe')]=_0x497929[_0x935d('0xe')];this[_0x935d('0xf')]=_0x497929['dialBusyRetryFrequency'];this[_0x935d('0x10')]=_0x497929['dialNoAnswerMaxRetry'];this[_0x935d('0x11')]=_0x497929[_0x935d('0x11')];this[_0x935d('0x12')]=_0x497929[_0x935d('0x12')];this[_0x935d('0x13')]=_0x497929[_0x935d('0x13')]||0x3;this[_0x935d('0x14')]=_0x497929[_0x935d('0x14')]||0x96;this[_0x935d('0x15')]=_0x497929[_0x935d('0x15')]||0x3;this[_0x935d('0x16')]=_0x497929['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x497929[_0x935d('0x17')]||0x3;this[_0x935d('0x18')]=_0x497929[_0x935d('0x18')]||0x96;this[_0x935d('0x19')]=_0x497929[_0x935d('0x19')]||0x3;this[_0x935d('0x1a')]=_0x497929[_0x935d('0x1a')]||0x96;this[_0x935d('0x1b')]=_0x497929[_0x935d('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x497929[_0x935d('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x497929[_0x935d('0x1d')]||'DESC';this[_0x935d('0x1e')]=_0x497929[_0x935d('0x1e')]||undefined;this[_0x935d('0x1f')]=_0x497929[_0x935d('0x1f')]||undefined;this[_0x935d('0x20')]=_0x497929['dialCutDigit']||undefined;this[_0x935d('0x21')]=_0x497929['TrunkBackup']?_0x497929[_0x935d('0x21')]:undefined;this[_0x935d('0x22')]=_0x497929['Trunk']?_0x497929[_0x935d('0x22')]:undefined;this[_0x935d('0x23')]=_0x497929[_0x935d('0x23')]?_0x497929['Interval']:undefined;this['SquareProject']=_0x497929[_0x935d('0x24')]?_0x497929[_0x935d('0x24')]:undefined;this[_0x935d('0x25')]=_0x497929[_0x935d('0x24')]?_0x497929[_0x935d('0x24')][_0x935d('0x26')]:undefined;this[_0x935d('0x27')]=_0x497929[_0x935d('0x27')]||![];this['dialAMDInitialSilence']=_0x497929[_0x935d('0x28')];this[_0x935d('0x29')]=_0x497929[_0x935d('0x29')];this['dialAMDAfterGreetingSilence']=_0x497929[_0x935d('0x2a')];this[_0x935d('0x2b')]=_0x497929[_0x935d('0x2b')];this[_0x935d('0x2c')]=_0x497929['dialAMDMinWordLength'];this[_0x935d('0x2d')]=_0x497929[_0x935d('0x2d')];this[_0x935d('0x2e')]=_0x497929[_0x935d('0x2e')];this['dialAMDSilenceThreshold']=_0x497929[_0x935d('0x2f')];this[_0x935d('0x30')]=_0x497929[_0x935d('0x30')];}module[_0x935d('0x31')]=Campaign; \ No newline at end of file +var _0x3ce1=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ce1,0xe9));var _0x13ce=function(_0x19d90a,_0x174dd0){_0x19d90a=_0x19d90a-0x0;var _0x450331=_0x3ce1[_0x19d90a];return _0x450331;};'use strict';function Campaign(_0x14520f){this['id']=_0x14520f['id']||0x0;this[_0x13ce('0x0')]=_0x14520f['name']||'';this[_0x13ce('0x1')]=_0x14520f['type']||_0x13ce('0x2');this['originated']=0x0;this[_0x13ce('0x3')]=0x0;this[_0x13ce('0x4')]=0x0;this[_0x13ce('0x5')]=0x0;this[_0x13ce('0x6')]='';this[_0x13ce('0x7')]=!![];this['active']=_0x14520f[_0x13ce('0x8')];this[_0x13ce('0x9')]=_0x14520f[_0x13ce('0x9')];this[_0x13ce('0xa')]=_0x14520f[_0x13ce('0xa')]||null;this[_0x13ce('0xb')]=_0x14520f[_0x13ce('0xb')]?_0x14520f['dialGlobalInterval']:null;this[_0x13ce('0xc')]=_0x14520f['dialOriginateCallerIdName'];this[_0x13ce('0xd')]=_0x14520f[_0x13ce('0xd')];this['dialOriginateTimeout']=_0x14520f[_0x13ce('0xe')]||0x1e;this[_0x13ce('0xf')]=_0x14520f[_0x13ce('0xf')];this['dialCongestionRetryFrequency']=_0x14520f['dialCongestionRetryFrequency'];this[_0x13ce('0x10')]=_0x14520f[_0x13ce('0x10')];this[_0x13ce('0x11')]=_0x14520f[_0x13ce('0x11')];this[_0x13ce('0x12')]=_0x14520f['dialNoAnswerMaxRetry'];this[_0x13ce('0x13')]=_0x14520f[_0x13ce('0x13')];this['dialGlobalMaxRetry']=_0x14520f[_0x13ce('0x14')];this['dialNoSuchNumberMaxRetry']=_0x14520f[_0x13ce('0x15')]||0x3;this[_0x13ce('0x16')]=_0x14520f[_0x13ce('0x16')]||0x96;this[_0x13ce('0x17')]=_0x14520f[_0x13ce('0x17')]||0x3;this[_0x13ce('0x18')]=_0x14520f[_0x13ce('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x14520f[_0x13ce('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x14520f[_0x13ce('0x1a')]||0x96;this[_0x13ce('0x1b')]=_0x14520f[_0x13ce('0x1b')]||0x3;this[_0x13ce('0x1c')]=_0x14520f[_0x13ce('0x1c')]||0x96;this[_0x13ce('0x1d')]=_0x14520f[_0x13ce('0x1d')]||0x3;this[_0x13ce('0x1e')]=_0x14520f[_0x13ce('0x1e')]||0x96;this[_0x13ce('0x1f')]=_0x14520f[_0x13ce('0x1f')]||_0x13ce('0x20');this[_0x13ce('0x21')]=_0x14520f[_0x13ce('0x21')]||undefined;this[_0x13ce('0x22')]=_0x14520f[_0x13ce('0x22')]||undefined;this[_0x13ce('0x23')]=_0x14520f[_0x13ce('0x23')]||undefined;this[_0x13ce('0x24')]=_0x14520f['TrunkBackup']?_0x14520f[_0x13ce('0x24')]:undefined;this['Trunk']=_0x14520f['Trunk']?_0x14520f[_0x13ce('0x25')]:undefined;this[_0x13ce('0x26')]=_0x14520f[_0x13ce('0x26')]?_0x14520f['Interval']:undefined;this[_0x13ce('0x27')]=_0x14520f[_0x13ce('0x27')]?_0x14520f[_0x13ce('0x27')]:undefined;this[_0x13ce('0x28')]=_0x14520f['SquareProject']?_0x14520f[_0x13ce('0x27')]['name']:undefined;this[_0x13ce('0x29')]=_0x14520f[_0x13ce('0x29')]||![];this[_0x13ce('0x2a')]=_0x14520f[_0x13ce('0x2a')];this[_0x13ce('0x2b')]=_0x14520f[_0x13ce('0x2b')];this[_0x13ce('0x2c')]=_0x14520f[_0x13ce('0x2c')];this[_0x13ce('0x2d')]=_0x14520f[_0x13ce('0x2d')];this[_0x13ce('0x2e')]=_0x14520f[_0x13ce('0x2e')];this[_0x13ce('0x2f')]=_0x14520f['dialAMDBetweenWordsSilence'];this[_0x13ce('0x30')]=_0x14520f[_0x13ce('0x30')];this[_0x13ce('0x31')]=_0x14520f['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x14520f[_0x13ce('0x32')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 77a839e..701f44e 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 _0x782b=['mohtime','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x1ed0d3,_0x7fceb2){var _0x3a1c39=function(_0x4f51f4){while(--_0x4f51f4){_0x1ed0d3['push'](_0x1ed0d3['shift']());}};_0x3a1c39(++_0x7fceb2);}(_0x782b,0x89));var _0xb782=function(_0x58cbdc,_0x16bb11){_0x58cbdc=_0x58cbdc-0x0;var _0x5d6f3d=_0x782b[_0x58cbdc];return _0x5d6f3d;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xb782('0x0')]='';this['calleridnum']=0x0;this[_0xb782('0x1')]='';this[_0xb782('0x2')]=undefined;this[_0xb782('0x3')]=undefined;this['accountcode']=0x0;this[_0xb782('0x4')]='';this[_0xb782('0x5')]=0x0;this[_0xb782('0x6')]=0x0;this[_0xb782('0x7')]=0x0;this[_0xb782('0x8')]=![];this[_0xb782('0x9')]=null;this[_0xb782('0xa')]=null;this['unmanaged']=![];this[_0xb782('0xb')]=![];this[_0xb782('0xc')]='';this[_0xb782('0xd')]='';this[_0xb782('0xe')]=0x0;this['billableseconds']=0x0;this[_0xb782('0xf')]=0x0;this[_0xb782('0x10')]=null;this[_0xb782('0x11')]=null;this[_0xb782('0x12')]=null;this['monitor']=![];this[_0xb782('0x13')]=null;this[_0xb782('0x14')]=null;this[_0xb782('0x15')]=[];this[_0xb782('0x16')]=undefined;this[_0xb782('0x17')]=undefined;this[_0xb782('0x18')]=undefined;this[_0xb782('0x19')]=0x0;}module[_0xb782('0x1a')]=Channel; \ No newline at end of file +var _0x6372=['transferType','mohtime','exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answertime','lastapplication','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x182e5c,_0x52a5a0){var _0x4fd571=function(_0x48bca5){while(--_0x48bca5){_0x182e5c['push'](_0x182e5c['shift']());}};_0x4fd571(++_0x52a5a0);}(_0x6372,0x1b8));var _0x2637=function(_0x5b429f,_0x52b1de){_0x5b429f=_0x5b429f-0x0;var _0x4887cc=_0x6372[_0x5b429f];return _0x4887cc;};'use strict';function Channel(){this[_0x2637('0x0')]=null;this['channel']='';this[_0x2637('0x1')]='';this['calleridnum']=0x0;this[_0x2637('0x2')]='';this[_0x2637('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x2637('0x4')]=0x0;this[_0x2637('0x5')]='';this[_0x2637('0x6')]=0x0;this[_0x2637('0x7')]=0x0;this[_0x2637('0x8')]=0x0;this['answered']=![];this[_0x2637('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0x2637('0xa')]='';this['lastdata']='';this['duration']=0x0;this[_0x2637('0xb')]=0x0;this[_0x2637('0xc')]=0x0;this[_0x2637('0xd')]=null;this['tag']=null;this['disposition']=null;this[_0x2637('0xe')]=![];this[_0x2637('0xf')]=null;this[_0x2637('0x10')]=null;this[_0x2637('0x11')]=[];this[_0x2637('0x12')]=undefined;this[_0x2637('0x13')]=undefined;this[_0x2637('0x14')]=undefined;this[_0x2637('0x15')]=0x0;}module[_0x2637('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a3881ea..a5dd292 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 _0x7fa5=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x4d44e7,_0x474f27){var _0x330d51=function(_0x3bb475){while(--_0x3bb475){_0x4d44e7['push'](_0x4d44e7['shift']());}};_0x330d51(++_0x474f27);}(_0x7fa5,0xb0));var _0x57fa=function(_0x498400,_0x9aeb4a){_0x498400=_0x498400-0x0;var _0x2eaae5=_0x7fa5[_0x498400];return _0x2eaae5;};'use strict';function DeskAccount(_0x1d84b9){this['id']=_0x1d84b9['id']||0x0;this[_0x57fa('0x0')]=_0x1d84b9['name']||'';this[_0x57fa('0x1')]=_0x1d84b9[_0x57fa('0x1')]||'';this[_0x57fa('0x2')]=_0x1d84b9['remoteUri']||'';this[_0x57fa('0x3')]=_0x1d84b9['authType']||'';this['password']=_0x1d84b9[_0x57fa('0x4')]||'';this[_0x57fa('0x5')]=_0x1d84b9['consumerKey']||'';this[_0x57fa('0x6')]=_0x1d84b9[_0x57fa('0x6')]||'';this[_0x57fa('0x7')]=_0x1d84b9[_0x57fa('0x7')]||'';this[_0x57fa('0x8')]=_0x1d84b9[_0x57fa('0x8')]||'';this['type']=_0x1d84b9[_0x57fa('0x9')]||'';this[_0x57fa('0xa')]=_0x1d84b9[_0x57fa('0xa')]||'';this[_0x57fa('0xb')]=_0x1d84b9[_0x57fa('0xb')]||{};}module[_0x57fa('0xc')]=DeskAccount; \ No newline at end of file +var _0xe658=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xe658,0x9d));var _0x8e65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe658[_0x20a584];return _0x4b41a8;};'use strict';function DeskAccount(_0x131bbd){this['id']=_0x131bbd['id']||0x0;this['name']=_0x131bbd[_0x8e65('0x0')]||'';this['username']=_0x131bbd[_0x8e65('0x1')]||'';this['remoteUri']=_0x131bbd[_0x8e65('0x2')]||'';this[_0x8e65('0x3')]=_0x131bbd['authType']||'';this[_0x8e65('0x4')]=_0x131bbd['password']||'';this['consumerKey']=_0x131bbd[_0x8e65('0x5')]||'';this['consumerSecret']=_0x131bbd[_0x8e65('0x6')]||'';this[_0x8e65('0x7')]=_0x131bbd['token']||'';this[_0x8e65('0x8')]=_0x131bbd[_0x8e65('0x8')]||'';this[_0x8e65('0x9')]=_0x131bbd[_0x8e65('0x9')]||'';this[_0x8e65('0xa')]=_0x131bbd[_0x8e65('0xa')]||'';this[_0x8e65('0xb')]=_0x131bbd[_0x8e65('0xb')]||{};}module[_0x8e65('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 3d20347..59ba60a 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 _0x5ff3=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x113db1,_0x275222){var _0x894ad=function(_0x46c664){while(--_0x46c664){_0x113db1['push'](_0x113db1['shift']());}};_0x894ad(++_0x275222);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2bd570,_0xb32b5){_0x2bd570=_0x2bd570-0x0;var _0x3363a6=_0x5ff3[_0x2bd570];return _0x3363a6;};'use strict';function Dynamics365Account(_0x2fc021){this['id']=_0x2fc021['id']||0x0;this[_0x35ff('0x0')]=_0x2fc021['name']||'';this[_0x35ff('0x1')]=_0x2fc021['username']||'';this[_0x35ff('0x2')]=_0x2fc021[_0x35ff('0x2')]||'';this[_0x35ff('0x3')]=_0x2fc021[_0x35ff('0x3')]||'';this['tenantId']=_0x2fc021[_0x35ff('0x4')]||'';this[_0x35ff('0x5')]=_0x2fc021[_0x35ff('0x5')]||'';this[_0x35ff('0x6')]=_0x2fc021[_0x35ff('0x6')]||{};this['serverUrl']=_0x2fc021[_0x35ff('0x7')]||'';this['Configurations']=_0x2fc021[_0x35ff('0x8')]||{};}module[_0x35ff('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x4483=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3442c9,_0x51c85f){var _0x57c541=function(_0x5bc3f5){while(--_0x5bc3f5){_0x3442c9['push'](_0x3442c9['shift']());}};_0x57c541(++_0x51c85f);}(_0x4483,0x1a3));var _0x3448=function(_0x1ebe60,_0x4a9e58){_0x1ebe60=_0x1ebe60-0x0;var _0xc52f13=_0x4483[_0x1ebe60];return _0xc52f13;};'use strict';function Dynamics365Account(_0x43f30d){this['id']=_0x43f30d['id']||0x0;this[_0x3448('0x0')]=_0x43f30d[_0x3448('0x0')]||'';this['username']=_0x43f30d[_0x3448('0x1')]||'';this[_0x3448('0x2')]=_0x43f30d[_0x3448('0x2')]||'';this[_0x3448('0x3')]=_0x43f30d[_0x3448('0x3')]||'';this['tenantId']=_0x43f30d[_0x3448('0x4')]||'';this[_0x3448('0x5')]=_0x43f30d[_0x3448('0x5')]||'';this[_0x3448('0x6')]=_0x43f30d[_0x3448('0x6')]||{};this[_0x3448('0x7')]=_0x43f30d[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x43f30d['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2cacb1e..49cbe38 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 _0x2134=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x2134,0x12d));var _0x4213=function(_0x421716,_0x48f9f1){_0x421716=_0x421716-0x0;var _0x3c9ace=_0x2134[_0x421716];return _0x3c9ace;};'use strict';function FaxAccount(_0x5cb86d){this['id']=_0x5cb86d['id']||0x0;this[_0x4213('0x0')]=_0x5cb86d['name']||'';this[_0x4213('0x1')]=_0x5cb86d['description'];this[_0x4213('0x2')]=_0x5cb86d['ecm'];this[_0x4213('0x3')]=_0x5cb86d[_0x4213('0x3')];this[_0x4213('0x4')]=_0x5cb86d['localstationid'];this['minrate']=_0x5cb86d[_0x4213('0x5')]||0x960;this[_0x4213('0x6')]=_0x5cb86d['maxrate']||0x3840;this[_0x4213('0x7')]=_0x5cb86d['modem']||_0x4213('0x8');this[_0x4213('0x9')]=_0x5cb86d[_0x4213('0x9')]||'no';this['faxdetect']=_0x5cb86d[_0x4213('0xa')]||'no';this[_0x4213('0xb')]=_0x5cb86d[_0x4213('0xb')]||0x1388;this['tech']=_0x5cb86d['tech']||_0x4213('0xc');this[_0x4213('0xd')]=_0x5cb86d[_0x4213('0xd')]?_0x5cb86d[_0x4213('0xd')]:undefined;this[_0x4213('0xe')]=_0x5cb86d[_0x4213('0xe')];this['key']=_0x5cb86d[_0x4213('0xf')];}module[_0x4213('0x10')]=FaxAccount; \ No newline at end of file +var _0x4fea=['exports','name','description','ecm','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x44d797,_0x276017){var _0x4005c2=function(_0x3d3b5b){while(--_0x3d3b5b){_0x44d797['push'](_0x44d797['shift']());}};_0x4005c2(++_0x276017);}(_0x4fea,0x1f1));var _0xa4fe=function(_0x477895,_0x24df51){_0x477895=_0x477895-0x0;var _0x135502=_0x4fea[_0x477895];return _0x135502;};'use strict';function FaxAccount(_0x11302a){this['id']=_0x11302a['id']||0x0;this[_0xa4fe('0x0')]=_0x11302a[_0xa4fe('0x0')]||'';this[_0xa4fe('0x1')]=_0x11302a[_0xa4fe('0x1')];this[_0xa4fe('0x2')]=_0x11302a['ecm'];this['headerinfo']=_0x11302a['headerinfo'];this[_0xa4fe('0x3')]=_0x11302a[_0xa4fe('0x3')];this[_0xa4fe('0x4')]=_0x11302a[_0xa4fe('0x4')]||0x960;this[_0xa4fe('0x5')]=_0x11302a[_0xa4fe('0x5')]||0x3840;this['modem']=_0x11302a['modem']||_0xa4fe('0x6');this[_0xa4fe('0x7')]=_0x11302a[_0xa4fe('0x7')]||'no';this[_0xa4fe('0x8')]=_0x11302a[_0xa4fe('0x8')]||'no';this[_0xa4fe('0x9')]=_0x11302a['t38timeout']||0x1388;this[_0xa4fe('0xa')]=_0x11302a[_0xa4fe('0xa')]||_0xa4fe('0xb');this[_0xa4fe('0xc')]=_0x11302a[_0xa4fe('0xc')]?_0x11302a['Trunk']:undefined;this[_0xa4fe('0xd')]=_0x11302a['ListId'];this[_0xa4fe('0xe')]=_0x11302a['key'];}module[_0xa4fe('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 6239e1c..e9388bf 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 _0x6a15=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4c8185,_0x3a1b3f){var _0x438196=function(_0x565c47){while(--_0x565c47){_0x4c8185['push'](_0x4c8185['shift']());}};_0x438196(++_0x3a1b3f);}(_0x6a15,0x14f));var _0x56a1=function(_0x5696f0,_0x420779){_0x5696f0=_0x5696f0-0x0;var _0x4c78e5=_0x6a15[_0x5696f0];return _0x4c78e5;};'use strict';function FreshdeskAccount(_0x57ef23){this['id']=_0x57ef23['id']||0x0;this[_0x56a1('0x0')]=_0x57ef23['name']||'';this[_0x56a1('0x1')]=_0x57ef23[_0x56a1('0x1')]||'';this[_0x56a1('0x2')]=_0x57ef23[_0x56a1('0x3')]||'';this[_0x56a1('0x4')]=_0x57ef23[_0x56a1('0x4')]||'';this[_0x56a1('0x5')]=_0x57ef23[_0x56a1('0x5')]||'';this[_0x56a1('0x6')]=_0x57ef23['Configurations']||{};}module[_0x56a1('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xea93=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x502982,_0x58d5b5){var _0x32521f=function(_0x26b171){while(--_0x26b171){_0x502982['push'](_0x502982['shift']());}};_0x32521f(++_0x58d5b5);}(_0xea93,0x183));var _0x3ea9=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xea93[_0x342baa];return _0x1208f3;};'use strict';function FreshdeskAccount(_0x20bf46){this['id']=_0x20bf46['id']||0x0;this[_0x3ea9('0x0')]=_0x20bf46[_0x3ea9('0x0')]||'';this[_0x3ea9('0x1')]=_0x20bf46[_0x3ea9('0x1')]||'';this[_0x3ea9('0x2')]=_0x20bf46[_0x3ea9('0x3')]||'';this[_0x3ea9('0x4')]=_0x20bf46['remoteUri']||'';this['serverUrl']=_0x20bf46[_0x3ea9('0x5')]||'';this['Configurations']=_0x20bf46[_0x3ea9('0x6')]||{};}module[_0x3ea9('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 1402b75..c8f059a 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 _0x576b=['token','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x576b,0x1d9));var _0xb576=function(_0x2afcd4,_0x2d1409){_0x2afcd4=_0x2afcd4-0x0;var _0x3acbe8=_0x576b[_0x2afcd4];return _0x3acbe8;};'use strict';function FreshsalesAccount(_0x312dc9){this['id']=_0x312dc9['id']||0x0;this['name']=_0x312dc9['name']||'';this[_0xb576('0x0')]=_0x312dc9[_0xb576('0x0')]||'';this['apiKey']=_0x312dc9[_0xb576('0x1')]||'';this[_0xb576('0x2')]=_0x312dc9['remoteUri']||'';this[_0xb576('0x3')]=_0x312dc9[_0xb576('0x3')]||'';this[_0xb576('0x4')]=_0x312dc9[_0xb576('0x4')]||{};}module[_0xb576('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x1af5=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x211f07,_0x2cf0d5){var _0x474a7b=function(_0x180929){while(--_0x180929){_0x211f07['push'](_0x211f07['shift']());}};_0x474a7b(++_0x2cf0d5);}(_0x1af5,0x17d));var _0x51af=function(_0x460814,_0x35f7a8){_0x460814=_0x460814-0x0;var _0x5dcc7a=_0x1af5[_0x460814];return _0x5dcc7a;};'use strict';function FreshsalesAccount(_0x5d0000){this['id']=_0x5d0000['id']||0x0;this['name']=_0x5d0000[_0x51af('0x0')]||'';this[_0x51af('0x1')]=_0x5d0000[_0x51af('0x1')]||'';this[_0x51af('0x2')]=_0x5d0000[_0x51af('0x3')]||'';this[_0x51af('0x4')]=_0x5d0000[_0x51af('0x4')]||'';this[_0x51af('0x5')]=_0x5d0000[_0x51af('0x5')]||'';this[_0x51af('0x6')]=_0x5d0000[_0x51af('0x6')]||{};}module[_0x51af('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 066c7bd..76e6f95 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 _0x3112=['assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','accountcode','context','priority','holdtime'];(function(_0x540cfe,_0x4c2fcb){var _0x469b68=function(_0x4555be){while(--_0x4555be){_0x540cfe['push'](_0x540cfe['shift']());}};_0x469b68(++_0x4c2fcb);}(_0x3112,0x1e1));var _0x2311=function(_0x50a0a7,_0x1f845f){_0x50a0a7=_0x50a0a7-0x0;var _0x2c67e0=_0x3112[_0x50a0a7];return _0x2c67e0;};'use strict';function QueueReport(){this[_0x2311('0x0')]=_0x2311('0x1');this[_0x2311('0x2')]='';this[_0x2311('0x3')]='';this['calleridname']='';this[_0x2311('0x4')]='';this[_0x2311('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x2311('0x6')]=0x1;this[_0x2311('0x7')]=![];this[_0x2311('0x8')]=null;this[_0x2311('0x9')]=![];this[_0x2311('0xa')]=null;this[_0x2311('0xb')]=![];this[_0x2311('0xc')]=null;this[_0x2311('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0x2311('0xe')]='';this[_0x2311('0xf')]='';this[_0x2311('0x10')]='';this['exten']='';this[_0x2311('0x11')]='';this[_0x2311('0x12')]=0x0;this[_0x2311('0x13')]=![];this[_0x2311('0x14')]='';this[_0x2311('0x15')]=_0x2311('0x16');this[_0x2311('0x17')]=0x0;this[_0x2311('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x10b0=['channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','mohtime','variables','exports','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition'];(function(_0x1b453f,_0x17520b){var _0x581714=function(_0x5aff72){while(--_0x5aff72){_0x1b453f['push'](_0x1b453f['shift']());}};_0x581714(++_0x17520b);}(_0x10b0,0x150));var _0x010b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x10b0[_0x40a045];return _0x1a687c;};'use strict';function QueueReport(){this['type']='inbound';this[_0x010b('0x0')]='';this[_0x010b('0x1')]='';this[_0x010b('0x2')]='';this[_0x010b('0x3')]='';this[_0x010b('0x4')]=null;this[_0x010b('0x5')]=null;this[_0x010b('0x6')]=0x1;this[_0x010b('0x7')]=0x1;this[_0x010b('0x8')]=![];this[_0x010b('0x9')]=null;this[_0x010b('0xa')]=![];this[_0x010b('0xb')]=null;this['queuecallerexit']=![];this[_0x010b('0xc')]=null;this[_0x010b('0xd')]=0x1;this[_0x010b('0xe')]='';this[_0x010b('0xf')]='';this[_0x010b('0x10')]='';this[_0x010b('0x11')]='';this[_0x010b('0x12')]='';this['exten']='';this[_0x010b('0x13')]='';this[_0x010b('0x14')]=0x0;this[_0x010b('0x15')]=![];this['lastAssignedTo']='';this['motionChannel']='voice';this[_0x010b('0x16')]=0x0;this[_0x010b('0x17')]={};}module[_0x010b('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 369dd01..8167702 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 _0x5360=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','securityToken','type'];(function(_0x42c0e4,_0x36f07b){var _0x45175d=function(_0x13e832){while(--_0x13e832){_0x42c0e4['push'](_0x42c0e4['shift']());}};_0x45175d(++_0x36f07b);}(_0x5360,0x157));var _0x0536=function(_0x4096e0,_0x15daed){_0x4096e0=_0x4096e0-0x0;var _0x19c212=_0x5360[_0x4096e0];return _0x19c212;};'use strict';function SalesforceAccount(_0x1920b0){this['id']=_0x1920b0['id']||0x0;this[_0x0536('0x0')]=_0x1920b0[_0x0536('0x0')]||'';this[_0x0536('0x1')]=_0x1920b0['username']||'';this['remoteUri']=_0x1920b0[_0x0536('0x2')]||'';this['password']=_0x1920b0[_0x0536('0x3')]||'';this[_0x0536('0x4')]=_0x1920b0['clientId']||'';this['clientSecret']=_0x1920b0['clientSecret']||'';this[_0x0536('0x5')]=_0x1920b0[_0x0536('0x5')]||'';this[_0x0536('0x6')]=_0x1920b0[_0x0536('0x6')]||'integrationTab';this[_0x0536('0x7')]=_0x1920b0[_0x0536('0x7')]||'';this[_0x0536('0x8')]=_0x1920b0['Configurations']||{};}module[_0x0536('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x41ec=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x41ec,0xde));var _0xc41e=function(_0x297b6c,_0x4f0cfe){_0x297b6c=_0x297b6c-0x0;var _0x580e46=_0x41ec[_0x297b6c];return _0x580e46;};'use strict';function SalesforceAccount(_0x529caf){this['id']=_0x529caf['id']||0x0;this[_0xc41e('0x0')]=_0x529caf[_0xc41e('0x0')]||'';this[_0xc41e('0x1')]=_0x529caf[_0xc41e('0x1')]||'';this[_0xc41e('0x2')]=_0x529caf['remoteUri']||'';this[_0xc41e('0x3')]=_0x529caf[_0xc41e('0x3')]||'';this['clientId']=_0x529caf[_0xc41e('0x4')]||'';this['clientSecret']=_0x529caf[_0xc41e('0x5')]||'';this[_0xc41e('0x6')]=_0x529caf[_0xc41e('0x6')]||'';this[_0xc41e('0x7')]=_0x529caf[_0xc41e('0x7')]||_0xc41e('0x8');this['serverUrl']=_0x529caf['serverUrl']||'';this[_0xc41e('0x9')]=_0x529caf[_0xc41e('0x9')]||{};}module[_0xc41e('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 80c50af..6ee5251 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 _0x53da=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0xf15f81,_0x3757a1){var _0x5d5673=function(_0x46f874){while(--_0x46f874){_0xf15f81['push'](_0xf15f81['shift']());}};_0x5d5673(++_0x3757a1);}(_0x53da,0x14f));var _0xa53d=function(_0x2ef70f,_0x26e938){_0x2ef70f=_0x2ef70f-0x0;var _0x396339=_0x53da[_0x2ef70f];return _0x396339;};'use strict';function ServicenowAccount(_0x3b823c){this['id']=_0x3b823c['id']||0x0;this['name']=_0x3b823c['name']||'';this['username']=_0x3b823c[_0xa53d('0x0')]||'';this[_0xa53d('0x1')]=_0x3b823c[_0xa53d('0x1')]||'';this[_0xa53d('0x2')]=_0x3b823c['remoteUri']||'';this[_0xa53d('0x3')]=_0x3b823c[_0xa53d('0x3')]||'';this[_0xa53d('0x4')]=_0x3b823c[_0xa53d('0x4')]||{};}module[_0xa53d('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x541c=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1fa465,_0x453122){var _0x3f940c=function(_0x507d55){while(--_0x507d55){_0x1fa465['push'](_0x1fa465['shift']());}};_0x3f940c(++_0x453122);}(_0x541c,0x95));var _0xc541=function(_0x304bf7,_0x4fcafc){_0x304bf7=_0x304bf7-0x0;var _0x5036cd=_0x541c[_0x304bf7];return _0x5036cd;};'use strict';function ServicenowAccount(_0x5388fb){this['id']=_0x5388fb['id']||0x0;this['name']=_0x5388fb[_0xc541('0x0')]||'';this[_0xc541('0x1')]=_0x5388fb['username']||'';this[_0xc541('0x2')]=_0x5388fb['password']||'';this['remoteUri']=_0x5388fb[_0xc541('0x3')]||'';this[_0xc541('0x4')]=_0x5388fb['serverUrl']||'';this['Configurations']=_0x5388fb[_0xc541('0x5')]||{};}module[_0xc541('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 22bc5c4..75b22fb 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 _0xec19=['serverUrl','exports','name','password','remoteUri'];(function(_0x232117,_0x4112e6){var _0x3b47ca=function(_0x497f60){while(--_0x497f60){_0x232117['push'](_0x232117['shift']());}};_0x3b47ca(++_0x4112e6);}(_0xec19,0xc0));var _0x9ec1=function(_0x27a886,_0x58e678){_0x27a886=_0x27a886-0x0;var _0x423e00=_0xec19[_0x27a886];return _0x423e00;};'use strict';function SugarcrmAccount(_0x51dd70){this['id']=_0x51dd70['id']||0x0;this[_0x9ec1('0x0')]=_0x51dd70['name']||'';this['username']=_0x51dd70['username']||'';this[_0x9ec1('0x1')]=_0x51dd70[_0x9ec1('0x1')]||'';this['remoteUri']=_0x51dd70[_0x9ec1('0x2')]||'';this[_0x9ec1('0x3')]=_0x51dd70[_0x9ec1('0x3')]||'';this['Configurations']=_0x51dd70['Configurations']||{};}module[_0x9ec1('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0xdefc=['serverUrl','Configurations','exports','name','password','remoteUri'];(function(_0x4ae762,_0x128afd){var _0x60c31b=function(_0x39bcfc){while(--_0x39bcfc){_0x4ae762['push'](_0x4ae762['shift']());}};_0x60c31b(++_0x128afd);}(_0xdefc,0x1b3));var _0xcdef=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0xdefc[_0x573c9e];return _0x5d0714;};'use strict';function SugarcrmAccount(_0x1a2db3){this['id']=_0x1a2db3['id']||0x0;this[_0xcdef('0x0')]=_0x1a2db3[_0xcdef('0x0')]||'';this['username']=_0x1a2db3['username']||'';this[_0xcdef('0x1')]=_0x1a2db3['password']||'';this[_0xcdef('0x2')]=_0x1a2db3[_0xcdef('0x2')]||'';this[_0xcdef('0x3')]=_0x1a2db3[_0xcdef('0x3')]||'';this[_0xcdef('0x4')]=_0x1a2db3[_0xcdef('0x4')]||{};}module[_0xcdef('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 08d87b0..a929b3e 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 _0x220b=['unknown','status','address','exports','name','accountcode'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x220b,0x1a2));var _0xb220=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x220b[_0x4b174a];return _0x3cd7bf;};'use strict';function Telephone(_0x3afc00){this['id']=_0x3afc00['id']||0x0;this[_0xb220('0x0')]=_0x3afc00[_0xb220('0x0')]||'';this[_0xb220('0x1')]=_0x3afc00[_0xb220('0x1')]||'';this['state']=_0xb220('0x2');this['stateTime']=0x0;this[_0xb220('0x3')]='unknown';this[_0xb220('0x4')]='';}module[_0xb220('0x5')]=Telephone; \ No newline at end of file +var _0x22d3=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0x509289,_0x2744af){var _0x2bc87e=function(_0x56e881){while(--_0x56e881){_0x509289['push'](_0x509289['shift']());}};_0x2bc87e(++_0x2744af);}(_0x22d3,0xfe));var _0x322d=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x22d3[_0x454165];return _0x56db53;};'use strict';function Telephone(_0x150d03){this['id']=_0x150d03['id']||0x0;this['name']=_0x150d03[_0x322d('0x0')]||'';this[_0x322d('0x1')]=_0x150d03[_0x322d('0x1')]||'';this[_0x322d('0x2')]=_0x322d('0x3');this[_0x322d('0x4')]=0x0;this[_0x322d('0x5')]=_0x322d('0x3');this[_0x322d('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 1002cea..69774af 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(_0x3c4169,_0x3e1996){var _0x18e52a=function(_0x5cd02c){while(--_0x5cd02c){_0x3c4169['push'](_0x3c4169['shift']());}};_0x18e52a(++_0x3e1996);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x5ec277,_0x5fbf97){var _0x12d4ae=function(_0x48917f){while(--_0x48917f){_0x5ec277['push'](_0x5ec277['shift']());}};_0x12d4ae(++_0x5fbf97);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 4ade697..00cce1c 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x358d76,_0x5689db){var _0xce3259=function(_0x8a4c6f){while(--_0x8a4c6f){_0x358d76['push'](_0x358d76['shift']());}};_0xce3259(++_0x5689db);}(_0x14a0,0x8e));var _0x014a=function(_0x7d94f4,_0x4dad1c){_0x7d94f4=_0x7d94f4-0x0;var _0x41e687=_0x14a0[_0x7d94f4];return _0x41e687;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e52c1f2..f9a11fc 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 _0x772a=['registrationtime','address','defaultuser','exports','active','state','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x266ca4,_0x152c86){var _0x21a03a=function(_0x4e9b3e){while(--_0x4e9b3e){_0x266ca4['push'](_0x266ca4['shift']());}};_0x21a03a(++_0x152c86);}(_0x772a,0x9d));var _0xa772=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x772a[_0x243b59];return _0x3e1676;};'use strict';function Trunk(_0x427883){this['id']=_0x427883['id']||0x0;this[_0xa772('0x0')]=_0x427883[_0xa772('0x0')]||![];this['name']=_0x427883['name']||'';this[_0xa772('0x1')]=_0xa772('0x2');this[_0xa772('0x3')]=0x0;this['status']=_0xa772('0x2');this['registry']=_0x427883[_0xa772('0x4')]&&_0x427883['registry'][_0xa772('0x5')](':')?_0x427883[_0xa772('0x4')][_0xa772('0x6')](':')[0x0]:'';this[_0xa772('0x7')]='';this[_0xa772('0x8')]='';this[_0xa772('0x9')]='';this[_0xa772('0xa')]='';this[_0xa772('0xb')]='';this[_0xa772('0xc')]=_0xa772('0x2');this[_0xa772('0xd')]='';this[_0xa772('0xe')]='';this['defaultuser']=_0x427883[_0xa772('0xf')]||'';}module[_0xa772('0x10')]=Trunk; \ No newline at end of file +var _0x3594=['registrationtime','defaultuser','active','name','state','unknown','stateTime','registry','indexOf','split','host','port','domain'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3594,0x6a));var _0x4359=function(_0xa29472,_0x26cbb0){_0xa29472=_0xa29472-0x0;var _0x48f327=_0x3594[_0xa29472];return _0x48f327;};'use strict';function Trunk(_0x373096){this['id']=_0x373096['id']||0x0;this[_0x4359('0x0')]=_0x373096[_0x4359('0x0')]||![];this[_0x4359('0x1')]=_0x373096[_0x4359('0x1')]||'';this[_0x4359('0x2')]=_0x4359('0x3');this[_0x4359('0x4')]=0x0;this['status']='unknown';this['registry']=_0x373096[_0x4359('0x5')]&&_0x373096['registry'][_0x4359('0x6')](':')?_0x373096[_0x4359('0x5')][_0x4359('0x7')](':')[0x0]:'';this[_0x4359('0x8')]='';this[_0x4359('0x9')]='';this[_0x4359('0xa')]='';this['domainport']='';this['refresh']='';this['stateRegistry']=_0x4359('0x3');this[_0x4359('0xb')]='';this['address']='';this['defaultuser']=_0x373096[_0x4359('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b786291..208eb18 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 _0x98af=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x21cc45,_0x22eff2){var _0x169c76=function(_0x540230){while(--_0x540230){_0x21cc45['push'](_0x21cc45['shift']());}};_0x169c76(++_0x22eff2);}(_0x98af,0x92));var _0xf98a=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x98af[_0x3a2e49];return _0x257140;};'use strict';function voiceExtension(_0x36583e){this['id']=_0x36583e['id']||0x0;this['exten']=_0x36583e[_0xf98a('0x0')]||'';this[_0xf98a('0x1')]=_0x36583e[_0xf98a('0x1')]||'none';this[_0xf98a('0x2')]=_0x36583e[_0xf98a('0x2')]||![];}module[_0xf98a('0x3')]=voiceExtension; \ No newline at end of file +var _0x1d05=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x1d05,0xff));var _0x51d0=function(_0x18363a,_0x545c8b){_0x18363a=_0x18363a-0x0;var _0x5b1d1e=_0x1d05[_0x18363a];return _0x5b1d1e;};'use strict';function voiceExtension(_0x3743af){this['id']=_0x3743af['id']||0x0;this['exten']=_0x3743af[_0x51d0('0x0')]||'';this[_0x51d0('0x1')]=_0x3743af[_0x51d0('0x1')]||_0x51d0('0x2');this[_0x51d0('0x3')]=_0x3743af['mandatoryDisposition']||![];}module[_0x51d0('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 9002afe..f9be129 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 _0xcf98=['total','sumBillable','unmanaged','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type'];(function(_0x3f3688,_0x27cd88){var _0x5370de=function(_0xc7eaa2){while(--_0xc7eaa2){_0x3f3688['push'](_0x3f3688['shift']());}};_0x5370de(++_0x27cd88);}(_0xcf98,0xc8));var _0x8cf9=function(_0x2c79a4,_0x5c0d9f){_0x2c79a4=_0x2c79a4-0x0;var _0x11fd19=_0xcf98[_0x2c79a4];return _0x11fd19;};'use strict';var statusDesc=[_0x8cf9('0x0'),_0x8cf9('0x1'),_0x8cf9('0x2'),_0x8cf9('0x3'),'invalid',_0x8cf9('0x4'),_0x8cf9('0x5'),_0x8cf9('0x6'),_0x8cf9('0x7')];var monitorFormat={'wav':_0x8cf9('0x8'),'wav49':_0x8cf9('0x9'),'gsm':_0x8cf9('0xa')};var strategy={'rrmemory':_0x8cf9('0xb'),'roundrobin':_0x8cf9('0xc')};function VoiceQueue(_0x1a95f9){this['id']=_0x1a95f9['id']||0x0;this[_0x8cf9('0xd')]=_0x1a95f9[_0x8cf9('0xd')]||'';this['monitor_format']=_0x1a95f9[_0x8cf9('0xe')]||'';this[_0x8cf9('0xf')]=_0x1a95f9['type']||'inbound';this['waiting']=0x0;this['talking']=0x0;this[_0x8cf9('0x10')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x8cf9('0x11')]=0x0;this[_0x8cf9('0x12')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x8cf9('0x13')]=_0x1a95f9[_0x8cf9('0x13')]||![];this['acwTimeout']=_0x1a95f9['acwTimeout']||0xa;this[_0x8cf9('0x14')]=_0x1a95f9[_0x8cf9('0x14')]||'no';this[_0x8cf9('0x15')]=!![];this[_0x8cf9('0x16')]='';this[_0x8cf9('0x17')]=0x0;this[_0x8cf9('0x18')]=0x0;this[_0x8cf9('0x19')]=_0x1a95f9['dialTimezone']||null;this[_0x8cf9('0x1a')]=_0x1a95f9[_0x8cf9('0x1a')]?_0x1a95f9[_0x8cf9('0x1a')]:null;this['dialActive']=_0x1a95f9[_0x8cf9('0x1b')];this[_0x8cf9('0x1c')]=_0x1a95f9[_0x8cf9('0x1c')]||_0x8cf9('0x1d');this[_0x8cf9('0x1e')]=_0x1a95f9[_0x8cf9('0x1e')]||0x0;this[_0x8cf9('0x1f')]=_0x1a95f9[_0x8cf9('0x1f')]||0x0;this[_0x8cf9('0x20')]=_0x1a95f9[_0x8cf9('0x20')]||0x1;this[_0x8cf9('0x21')]=_0x1a95f9['dialPredictiveOptimization']||_0x8cf9('0x22');this[_0x8cf9('0x23')]=_0x1a95f9[_0x8cf9('0x23')]||0.03;this[_0x8cf9('0x24')]=_0x1a95f9[_0x8cf9('0x24')]||0x258;this['dialOriginateCallerIdName']=_0x1a95f9['dialOriginateCallerIdName']||'anonymous';this[_0x8cf9('0x25')]=_0x1a95f9[_0x8cf9('0x25')]||_0x8cf9('0x26');this[_0x8cf9('0x27')]=_0x1a95f9['dialOriginateTimeout']||0x1e;this[_0x8cf9('0x28')]=_0x1a95f9[_0x8cf9('0x28')]||_0x8cf9('0x29');this[_0x8cf9('0x2a')]=_0x1a95f9[_0x8cf9('0x2a')]||0x3;this[_0x8cf9('0x2b')]=_0x1a95f9[_0x8cf9('0x2b')]||undefined;this[_0x8cf9('0x2c')]=_0x1a95f9['dialCongestionMaxRetry']||0x3;this[_0x8cf9('0x2d')]=_0x1a95f9[_0x8cf9('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x1a95f9[_0x8cf9('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x1a95f9[_0x8cf9('0x2f')]||0x96;this[_0x8cf9('0x30')]=_0x1a95f9[_0x8cf9('0x30')]||0x3;this[_0x8cf9('0x31')]=_0x1a95f9['dialNoAnswerRetryFrequency']||0x96;this[_0x8cf9('0x32')]=_0x1a95f9[_0x8cf9('0x32')]||0x3;this[_0x8cf9('0x33')]=_0x1a95f9['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8cf9('0x34')]=_0x1a95f9['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x1a95f9['dialDropRetryFrequency']||0x96;this[_0x8cf9('0x35')]=_0x1a95f9[_0x8cf9('0x35')]||0x3;this[_0x8cf9('0x36')]=_0x1a95f9['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x1a95f9[_0x8cf9('0x37')]||0x3;this[_0x8cf9('0x38')]=_0x1a95f9['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1a95f9[_0x8cf9('0x39')]||0x3;this[_0x8cf9('0x3a')]=_0x1a95f9[_0x8cf9('0x3a')]||0x96;this[_0x8cf9('0x3b')]=_0x1a95f9[_0x8cf9('0x3b')]||0x4;this[_0x8cf9('0x3c')]=_0x1a95f9[_0x8cf9('0x3c')]?_0x1a95f9['Trunk']:undefined;this[_0x8cf9('0x3d')]=_0x1a95f9[_0x8cf9('0x3d')]?_0x1a95f9[_0x8cf9('0x3d')]:undefined;this[_0x8cf9('0x3e')]=_0x1a95f9['dialPrefix']||undefined;this[_0x8cf9('0x3f')]=_0x1a95f9['Interval']?_0x1a95f9[_0x8cf9('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x1a95f9['dialOrderByScheduledAt']||_0x8cf9('0x40');this[_0x8cf9('0x41')]=_0x1a95f9[_0x8cf9('0x41')]||undefined;this[_0x8cf9('0x42')]=_0x1a95f9[_0x8cf9('0x42')]||undefined;this['strategy']=strategy[_0x1a95f9[_0x8cf9('0x43')]]||_0x8cf9('0xb');this['queueStatusComplete']=!![];this[_0x8cf9('0x44')]=_0x1a95f9[_0x8cf9('0x44')]||![];this[_0x8cf9('0x45')]=_0x1a95f9[_0x8cf9('0x45')];this[_0x8cf9('0x46')]=_0x1a95f9[_0x8cf9('0x46')];this[_0x8cf9('0x47')]=_0x1a95f9['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1a95f9[_0x8cf9('0x48')];this['dialAMDMinWordLength']=_0x1a95f9[_0x8cf9('0x49')];this[_0x8cf9('0x4a')]=_0x1a95f9[_0x8cf9('0x4a')];this[_0x8cf9('0x4b')]=_0x1a95f9[_0x8cf9('0x4b')];this[_0x8cf9('0x4c')]=_0x1a95f9['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1a95f9['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x8cf9('0x4d')]=0x0;this[_0x8cf9('0x4e')]=_0x1a95f9[_0x8cf9('0x4e')];this[_0x8cf9('0x4f')]=0x0;this[_0x8cf9('0x50')]=0x0;this[_0x8cf9('0x51')]=0x0;this[_0x8cf9('0x52')]=0x0;this[_0x8cf9('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x8cf9('0x54')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x8cf9('0x55')]=0x0;this['outboundReCallsDay']=0x0;this[_0x8cf9('0x56')]=0x0;this[_0x8cf9('0x57')]=undefined;this[_0x8cf9('0x58')]=undefined;this['handlePredictive']=undefined;this[_0x8cf9('0x59')]=1.05;this[_0x8cf9('0x5a')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x8cf9('0x5b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x8cf9('0x5c')]=0x0;this[_0x8cf9('0x5d')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x1a95f9[_0x8cf9('0x5e')]||0x14;this[_0x8cf9('0x5f')]=_0x1a95f9[_0x8cf9('0x5e')]||0xa;this[_0x8cf9('0x60')]=0x0;this[_0x8cf9('0x61')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x8cf9('0x62')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8cf9('0x63')]=0x0;this[_0x8cf9('0x64')]=_0x1a95f9[_0x8cf9('0x64')]||0x1e;this[_0x8cf9('0x65')]=_0x1a95f9['dialRecallInQueue']||![];this[_0x8cf9('0x66')]=_0x1a95f9['dialQueueProject2']||undefined;this[_0x8cf9('0x67')]=_0x1a95f9[_0x8cf9('0x67')]||![];this[_0x8cf9('0x68')]=_0x1a95f9[_0x8cf9('0x68')]||![];this[_0x8cf9('0xe')]=monitorFormat[_0x1a95f9[_0x8cf9('0xe')]]?monitorFormat[_0x1a95f9[_0x8cf9('0xe')]]:undefined;this[_0x8cf9('0x69')]=_0x1a95f9[_0x8cf9('0x69')]||![];this[_0x8cf9('0x6a')]=_0x1a95f9[_0x8cf9('0x6a')]?_0x1a95f9[_0x8cf9('0x6a')]:undefined;}module[_0x8cf9('0x6b')]=VoiceQueue; \ No newline at end of file +var _0x6cb2=['type','waiting','talking','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','not_inuse','busy','unavailable','wav49','rrmemory','name','monitor_format'];(function(_0xe5fd55,_0x32a979){var _0xa2f614=function(_0x42ef4d){while(--_0x42ef4d){_0xe5fd55['push'](_0xe5fd55['shift']());}};_0xa2f614(++_0x32a979);}(_0x6cb2,0x6a));var _0x26cb=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6cb2[_0x4d613c];return _0x301fe3;};'use strict';var statusDesc=['unknown',_0x26cb('0x0'),'inuse',_0x26cb('0x1'),'invalid',_0x26cb('0x2'),'ringing','ringinuse','onhold'];var monitorFormat={'wav':'wav','wav49':_0x26cb('0x3'),'gsm':'gsm'};var strategy={'rrmemory':_0x26cb('0x4'),'roundrobin':'roundrobin'};function VoiceQueue(_0x54190c){this['id']=_0x54190c['id']||0x0;this[_0x26cb('0x5')]=_0x54190c[_0x26cb('0x5')]||'';this[_0x26cb('0x6')]=_0x54190c['monitor_format']||'';this[_0x26cb('0x7')]=_0x54190c[_0x26cb('0x7')]||'inbound';this[_0x26cb('0x8')]=0x0;this[_0x26cb('0x9')]=0x0;this['total']=0x0;this[_0x26cb('0xa')]=0x0;this[_0x26cb('0xb')]=0x0;this[_0x26cb('0xc')]=0x0;this['sumBillable']=0x0;this[_0x26cb('0xd')]=0x0;this[_0x26cb('0xe')]=0x0;this[_0x26cb('0xf')]=0x0;this[_0x26cb('0x10')]=0x0;this[_0x26cb('0x11')]=_0x54190c[_0x26cb('0x11')]||![];this[_0x26cb('0x12')]=_0x54190c[_0x26cb('0x12')]||0xa;this[_0x26cb('0x13')]=_0x54190c['autopause']||'no';this[_0x26cb('0x14')]=!![];this[_0x26cb('0x15')]='';this[_0x26cb('0x16')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x54190c[_0x26cb('0x17')]||null;this['dialGlobalInterval']=_0x54190c[_0x26cb('0x18')]?_0x54190c[_0x26cb('0x18')]:null;this[_0x26cb('0x19')]=_0x54190c['dialActive'];this[_0x26cb('0x1a')]=_0x54190c[_0x26cb('0x1a')]||_0x26cb('0x1b');this[_0x26cb('0x1c')]=_0x54190c[_0x26cb('0x1c')]||0x0;this['dialLimitQueue']=_0x54190c[_0x26cb('0x1d')]||0x0;this[_0x26cb('0x1e')]=_0x54190c[_0x26cb('0x1e')]||0x1;this['dialPredictiveOptimization']=_0x54190c[_0x26cb('0x1f')]||_0x26cb('0x20');this[_0x26cb('0x21')]=_0x54190c[_0x26cb('0x21')]||0.03;this['dialPredictiveInterval']=_0x54190c[_0x26cb('0x22')]||0x258;this[_0x26cb('0x23')]=_0x54190c[_0x26cb('0x23')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x54190c[_0x26cb('0x24')]||'anonymous';this[_0x26cb('0x25')]=_0x54190c[_0x26cb('0x25')]||0x1e;this[_0x26cb('0x26')]=_0x54190c[_0x26cb('0x26')]||_0x26cb('0x27');this['dialQueueTimeout']=_0x54190c[_0x26cb('0x28')]||0x3;this[_0x26cb('0x29')]=_0x54190c[_0x26cb('0x29')]||undefined;this[_0x26cb('0x2a')]=_0x54190c['dialCongestionMaxRetry']||0x3;this[_0x26cb('0x2b')]=_0x54190c[_0x26cb('0x2b')]||0x96;this[_0x26cb('0x2c')]=_0x54190c[_0x26cb('0x2c')]||0x3;this[_0x26cb('0x2d')]=_0x54190c[_0x26cb('0x2d')]||0x96;this[_0x26cb('0x2e')]=_0x54190c[_0x26cb('0x2e')]||0x3;this[_0x26cb('0x2f')]=_0x54190c[_0x26cb('0x2f')]||0x96;this[_0x26cb('0x30')]=_0x54190c[_0x26cb('0x30')]||0x3;this[_0x26cb('0x31')]=_0x54190c['dialNoSuchNumberRetryFrequency']||0x96;this[_0x26cb('0x32')]=_0x54190c[_0x26cb('0x32')]||0x3;this[_0x26cb('0x33')]=_0x54190c[_0x26cb('0x33')]||0x96;this[_0x26cb('0x34')]=_0x54190c[_0x26cb('0x34')]||0x3;this['dialAbandonedRetryFrequency']=_0x54190c[_0x26cb('0x35')]||0x96;this[_0x26cb('0x36')]=_0x54190c[_0x26cb('0x36')]||0x3;this['dialMachineRetryFrequency']=_0x54190c[_0x26cb('0x37')]||0x96;this[_0x26cb('0x38')]=_0x54190c[_0x26cb('0x38')]||0x3;this['dialAgentRejectRetryFrequency']=_0x54190c[_0x26cb('0x39')]||0x96;this[_0x26cb('0x3a')]=_0x54190c['dialGlobalMaxRetry']||0x4;this[_0x26cb('0x3b')]=_0x54190c[_0x26cb('0x3b')]?_0x54190c[_0x26cb('0x3b')]:undefined;this[_0x26cb('0x3c')]=_0x54190c[_0x26cb('0x3c')]?_0x54190c[_0x26cb('0x3c')]:undefined;this[_0x26cb('0x3d')]=_0x54190c['dialPrefix']||undefined;this[_0x26cb('0x3e')]=_0x54190c[_0x26cb('0x3e')]?_0x54190c['Interval']:undefined;this[_0x26cb('0x3f')]=_0x54190c[_0x26cb('0x3f')]||_0x26cb('0x40');this[_0x26cb('0x41')]=_0x54190c[_0x26cb('0x41')]||undefined;this[_0x26cb('0x42')]=_0x54190c[_0x26cb('0x42')]||undefined;this['strategy']=strategy[_0x54190c['strategy']]||_0x26cb('0x4');this['queueStatusComplete']=!![];this[_0x26cb('0x43')]=_0x54190c[_0x26cb('0x43')]||![];this[_0x26cb('0x44')]=_0x54190c[_0x26cb('0x44')];this[_0x26cb('0x45')]=_0x54190c[_0x26cb('0x45')];this['dialAMDAfterGreetingSilence']=_0x54190c[_0x26cb('0x46')];this[_0x26cb('0x47')]=_0x54190c['dialAMDTotalAnalysisTime'];this[_0x26cb('0x48')]=_0x54190c[_0x26cb('0x48')];this[_0x26cb('0x49')]=_0x54190c['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x54190c[_0x26cb('0x4a')];this[_0x26cb('0x4b')]=_0x54190c[_0x26cb('0x4b')];this[_0x26cb('0x4c')]=_0x54190c[_0x26cb('0x4c')];this['outboundRejectCallsDay']=0x0;this[_0x26cb('0x4d')]=0x0;this[_0x26cb('0x4e')]=_0x54190c[_0x26cb('0x4e')];this['outboundAnswerCallsDay']=0x0;this[_0x26cb('0x4f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x26cb('0x50')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x26cb('0x51')]=0x0;this[_0x26cb('0x52')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x26cb('0x53')]=0x0;this[_0x26cb('0x54')]=0x0;this[_0x26cb('0x55')]=0x0;this[_0x26cb('0x56')]=0x0;this[_0x26cb('0x57')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x26cb('0x58')]=undefined;this[_0x26cb('0x59')]=undefined;this[_0x26cb('0x5a')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x26cb('0x5b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x26cb('0x5c')]=0x0;this[_0x26cb('0x5d')]=0x0;this[_0x26cb('0x5e')]=0x0;this[_0x26cb('0x5f')]=0x0;this[_0x26cb('0x60')]=0x0;this[_0x26cb('0x61')]=0x0;this['predictiveIntervalMaxThreshold']=_0x54190c['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x54190c[_0x26cb('0x62')]||0xa;this[_0x26cb('0x63')]=0x0;this[_0x26cb('0x64')]=0x0;this[_0x26cb('0x65')]=0x1;this[_0x26cb('0x66')]=0x0;this[_0x26cb('0x67')]=0x0;this[_0x26cb('0x68')]=0x0;this[_0x26cb('0x69')]=0x0;this['dialRecallMeTimeout']=_0x54190c[_0x26cb('0x6a')]||0x1e;this[_0x26cb('0x6b')]=_0x54190c[_0x26cb('0x6b')]||![];this[_0x26cb('0x6c')]=_0x54190c[_0x26cb('0x6c')]||undefined;this[_0x26cb('0x6d')]=_0x54190c[_0x26cb('0x6d')]||![];this[_0x26cb('0x6e')]=_0x54190c['dialAgiAfterHangupAgent']||![];this[_0x26cb('0x6')]=monitorFormat[_0x54190c[_0x26cb('0x6')]]?monitorFormat[_0x54190c[_0x26cb('0x6')]]:undefined;this[_0x26cb('0x6f')]=_0x54190c[_0x26cb('0x6f')]||![];this[_0x26cb('0x70')]=_0x54190c[_0x26cb('0x70')]?_0x54190c[_0x26cb('0x70')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 18d07fc..81e0a55 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 _0x5419=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x5419,0x175));var _0x9541=function(_0x20edb2,_0x127ca7){_0x20edb2=_0x20edb2-0x0;var _0x24e94a=_0x5419[_0x20edb2];return _0x24e94a;};'use strict';function VtigerAccount(_0xf35b2e){this['id']=_0xf35b2e['id']||0x0;this[_0x9541('0x0')]=_0xf35b2e[_0x9541('0x0')]||'';this[_0x9541('0x1')]=_0xf35b2e[_0x9541('0x1')]||'';this[_0x9541('0x2')]=_0xf35b2e[_0x9541('0x2')]||'';this[_0x9541('0x3')]=_0xf35b2e[_0x9541('0x3')]||'';this[_0x9541('0x4')]=_0xf35b2e['serverUrl']||'';this[_0x9541('0x5')]=_0xf35b2e[_0x9541('0x5')]||{};}module[_0x9541('0x6')]=VtigerAccount; \ No newline at end of file +var _0x385d=['accessKey','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x27b1f9,_0x525550){var _0x316222=function(_0x1fb8ff){while(--_0x1fb8ff){_0x27b1f9['push'](_0x27b1f9['shift']());}};_0x316222(++_0x525550);}(_0x385d,0x1a3));var _0xd385=function(_0xfc09d1,_0x7462f){_0xfc09d1=_0xfc09d1-0x0;var _0x3b5183=_0x385d[_0xfc09d1];return _0x3b5183;};'use strict';function VtigerAccount(_0x2f1e42){this['id']=_0x2f1e42['id']||0x0;this['name']=_0x2f1e42['name']||'';this[_0xd385('0x0')]=_0x2f1e42[_0xd385('0x0')]||'';this[_0xd385('0x1')]=_0x2f1e42[_0xd385('0x1')]||'';this['remoteUri']=_0x2f1e42[_0xd385('0x2')]||'';this[_0xd385('0x3')]=_0x2f1e42[_0xd385('0x3')]||'';this[_0xd385('0x4')]=_0x2f1e42[_0xd385('0x4')]||{};}module[_0xd385('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 b9c479f..36ca4f5 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 _0x2de2=['password','token','remoteUri','type','integrationTab','serverUrl','name','username'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x2de2,0x15e));var _0x22de=function(_0x1dba54,_0x3a217b){_0x1dba54=_0x1dba54-0x0;var _0x217cbd=_0x2de2[_0x1dba54];return _0x217cbd;};'use strict';function ZendeskAccount(_0x2b8571){this['id']=_0x2b8571['id']||0x0;this[_0x22de('0x0')]=_0x2b8571['name']||'';this[_0x22de('0x1')]=_0x2b8571[_0x22de('0x1')]||'';this[_0x22de('0x2')]=_0x2b8571['password']||'';this[_0x22de('0x3')]=_0x2b8571['token']||'';this[_0x22de('0x4')]=_0x2b8571[_0x22de('0x4')]||'';this['authType']=_0x2b8571['authType']||'';this[_0x22de('0x5')]=_0x2b8571[_0x22de('0x5')]||_0x22de('0x6');this[_0x22de('0x7')]=_0x2b8571[_0x22de('0x7')]||'';this['Configurations']=_0x2b8571['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x2469=['username','password','token','remoteUri','authType','type','integrationTab','Configurations','exports','name'];(function(_0x4d538a,_0x8aad21){var _0x192bad=function(_0xf24be1){while(--_0xf24be1){_0x4d538a['push'](_0x4d538a['shift']());}};_0x192bad(++_0x8aad21);}(_0x2469,0x153));var _0x9246=function(_0x1f2201,_0x39639d){_0x1f2201=_0x1f2201-0x0;var _0x5aedde=_0x2469[_0x1f2201];return _0x5aedde;};'use strict';function ZendeskAccount(_0x350dea){this['id']=_0x350dea['id']||0x0;this[_0x9246('0x0')]=_0x350dea[_0x9246('0x0')]||'';this[_0x9246('0x1')]=_0x350dea[_0x9246('0x1')]||'';this[_0x9246('0x2')]=_0x350dea[_0x9246('0x2')]||'';this[_0x9246('0x3')]=_0x350dea[_0x9246('0x3')]||'';this['remoteUri']=_0x350dea[_0x9246('0x4')]||'';this[_0x9246('0x5')]=_0x350dea[_0x9246('0x5')]||'';this[_0x9246('0x6')]=_0x350dea[_0x9246('0x6')]||_0x9246('0x7');this['serverUrl']=_0x350dea['serverUrl']||'';this[_0x9246('0x8')]=_0x350dea[_0x9246('0x8')]||{};}module[_0x9246('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3631a96..2a98d8d 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 _0x5970=['serverUrl','code','Configurations','name','description','host','clientId','clientSecret'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x5970,0x123));var _0x0597=function(_0x239935,_0x1a9f04){_0x239935=_0x239935-0x0;var _0x4b3f2c=_0x5970[_0x239935];return _0x4b3f2c;};'use strict';function ZohoAccount(_0x5dd3ed){this['id']=_0x5dd3ed['id']||0x0;this[_0x0597('0x0')]=_0x5dd3ed[_0x0597('0x0')]||'';this[_0x0597('0x1')]=_0x5dd3ed[_0x0597('0x1')]||'';this[_0x0597('0x2')]=_0x5dd3ed['host']||'';this['zone']=_0x5dd3ed['zone']||'';this[_0x0597('0x3')]=_0x5dd3ed['clientId']||'';this[_0x0597('0x4')]=_0x5dd3ed['clientSecret']||'';this[_0x0597('0x5')]=_0x5dd3ed['serverUrl']||'';this[_0x0597('0x6')]=_0x5dd3ed[_0x0597('0x6')]||'';this['refreshToken']=_0x5dd3ed['refreshToken']||'';this[_0x0597('0x7')]=_0x5dd3ed[_0x0597('0x7')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x8b39=['refreshToken','Configurations','exports','name','host','zone','clientId','clientSecret','serverUrl'];(function(_0x29845b,_0x580435){var _0xa7d0a8=function(_0x18bcda){while(--_0x18bcda){_0x29845b['push'](_0x29845b['shift']());}};_0xa7d0a8(++_0x580435);}(_0x8b39,0x147));var _0x98b3=function(_0x8105b6,_0x561a6d){_0x8105b6=_0x8105b6-0x0;var _0x1cd478=_0x8b39[_0x8105b6];return _0x1cd478;};'use strict';function ZohoAccount(_0x37258a){this['id']=_0x37258a['id']||0x0;this['name']=_0x37258a[_0x98b3('0x0')]||'';this['description']=_0x37258a['description']||'';this[_0x98b3('0x1')]=_0x37258a[_0x98b3('0x1')]||'';this[_0x98b3('0x2')]=_0x37258a['zone']||'';this[_0x98b3('0x3')]=_0x37258a[_0x98b3('0x3')]||'';this[_0x98b3('0x4')]=_0x37258a[_0x98b3('0x4')]||'';this[_0x98b3('0x5')]=_0x37258a[_0x98b3('0x5')]||'';this['code']=_0x37258a['code']||'';this[_0x98b3('0x6')]=_0x37258a['refreshToken']||'';this['Configurations']=_0x37258a[_0x98b3('0x7')]||{};}module[_0x98b3('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a60df43..38536e0 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 _0xa6d6=['name','type','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','number','util','isNil','string','uniqueid','idContact','queue'];(function(_0x1d2195,_0x4b8096){var _0x4962cd=function(_0x301f5a){while(--_0x301f5a){_0x1d2195['push'](_0x1d2195['shift']());}};_0x4962cd(++_0x4b8096);}(_0xa6d6,0x122));var _0x6a6d=function(_0x41b1df,_0x135b98){_0x41b1df=_0x41b1df-0x0;var _0x29eb06=_0xa6d6[_0x41b1df];return _0x29eb06;};'use strict';var util=require(_0x6a6d('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x45c46a,_0x4a9d30,_0x34ef76){var _0x34df9c='';if(!_['isNil'](_0x4a9d30)&&'string'===typeof _0x4a9d30){_0x34df9c+=_0x4a9d30;}if(!_[_0x6a6d('0x1')](_0x34ef76)&&_0x6a6d('0x2')===typeof _0x34ef76){_0x34df9c+='\x20'+_0x34ef76;}if(_0x34df9c!==''){return _0x34df9c;}return _0x45c46a;}function Action(_0xbba19a,_0x3fc482,_0x3f8666,_0x9c4480,_0xdea8da){this[_0x6a6d('0x3')]=_0x3f8666||undefined;this[_0x6a6d('0x4')]=_0xbba19a['id'];this[_0x6a6d('0x5')]=_0x3fc482[_0x6a6d('0x6')];this['type']=_0x3fc482[_0x6a6d('0x7')];this['campaigntype']=_0x6a6d('0x5');this['dialAnswer']=![];this[_0x6a6d('0x8')]=_[_0x6a6d('0x1')](_0xbba19a[_0x6a6d('0x9')])?undefined:_0xbba19a[_0x6a6d('0x9')][_0x6a6d('0x6')];this['channelAgent']=this[_0x6a6d('0x8')]?util['format'](_0x6a6d('0xa'),this[_0x6a6d('0x8')]):_0x9c4480||undefined;this[_0x6a6d('0xb')]=checkNameSurname(_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xd')],_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xe')],_0xbba19a['Contact']['lastName']);this['active']=_0xbba19a[_0x6a6d('0xf')]||![];this[_0x6a6d('0x10')]=_0xbba19a[_0x6a6d('0xc')][_0x6a6d('0xd')];this[_0x6a6d('0x11')]=_0xbba19a[_0x6a6d('0x11')];this[_0x6a6d('0x12')]=_0xbba19a[_0x6a6d('0x12')]||0x0;this['countcongestionretry']=_0xbba19a['countcongestionretry']||0x0;this[_0x6a6d('0x13')]=_0xbba19a['countnoanswerretry']||0x0;this[_0x6a6d('0x14')]=(_0xbba19a[_0x6a6d('0x12')]||0x0)+(_0xbba19a['countcongestionretry']||0x0)+(_0xbba19a[_0x6a6d('0x13')]||0x0)+(_0xbba19a[_0x6a6d('0x15')]||0x0)+(_0xbba19a['countdropretry']||0x0)+(_0xbba19a[_0x6a6d('0x16')]||0x0)+(_0xbba19a['countmachineretry']||0x0)+(_0xbba19a[_0x6a6d('0x17')]||0x0);this[_0x6a6d('0x15')]=_0xbba19a[_0x6a6d('0x15')]||0x0;this[_0x6a6d('0x18')]=_0xbba19a['countdropretry']||0x0;this['countabandonedretry']=_0xbba19a['countabandonedretry']||0x0;this[_0x6a6d('0x19')]=_0xbba19a[_0x6a6d('0x19')]||0x0;this[_0x6a6d('0x17')]=_0xbba19a[_0x6a6d('0x17')]||0x0;this[_0x6a6d('0x1a')]=_0xbba19a[_0x6a6d('0x1a')];this['callbackuniqueid']=_0xbba19a['callbackuniqueid'];this[_0x6a6d('0x1b')]=_0xbba19a['callbackat'];this[_0x6a6d('0x1c')]=_0xbba19a[_0x6a6d('0x1c')];this[_0x6a6d('0x1d')]=_0xbba19a[_0x6a6d('0x1d')];this[_0x6a6d('0x1e')]=_0xbba19a[_0x6a6d('0x1e')];this[_0x6a6d('0x1f')]=_[_0x6a6d('0x1')](_0xbba19a['Agent'])?_0xbba19a[_0x6a6d('0x1f')]:_0xbba19a['Agent']['id'];this[_0x6a6d('0x20')]=_0xbba19a['VoiceQueueId'];this[_0x6a6d('0x21')]='';this['originatecalleridname']='';}Action['prototype'][_0x6a6d('0x22')]=function(){return util['format'](_0x6a6d('0x23'),this[_0x6a6d('0xb')],this[_0x6a6d('0x24')]);};module['exports']=Action; \ No newline at end of file +var _0xd901=['campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','membername','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','queue','name','type'];(function(_0x375d74,_0x192737){var _0xee960b=function(_0x493c47){while(--_0x493c47){_0x375d74['push'](_0x375d74['shift']());}};_0xee960b(++_0x192737);}(_0xd901,0x19d));var _0x1d90=function(_0x474e48,_0x10ff74){_0x474e48=_0x474e48-0x0;var _0x7c0fe4=_0xd901[_0x474e48];return _0x7c0fe4;};'use strict';var util=require(_0x1d90('0x0'));var _=require('lodash');var moment=require(_0x1d90('0x1'));function checkNameSurname(_0x35fe3c,_0x1c1d2b,_0x51eb1a){var _0x879b6='';if(!_[_0x1d90('0x2')](_0x1c1d2b)&&_0x1d90('0x3')===typeof _0x1c1d2b){_0x879b6+=_0x1c1d2b;}if(!_[_0x1d90('0x2')](_0x51eb1a)&&_0x1d90('0x3')===typeof _0x51eb1a){_0x879b6+='\x20'+_0x51eb1a;}if(_0x879b6!==''){return _0x879b6;}return _0x35fe3c;}function Action(_0x3788bb,_0x4d8d15,_0x4e6685,_0x212d1a,_0x1831d0){this['uniqueid']=_0x4e6685||undefined;this['idContact']=_0x3788bb['id'];this[_0x1d90('0x4')]=_0x4d8d15[_0x1d90('0x5')];this[_0x1d90('0x6')]=_0x4d8d15[_0x1d90('0x6')];this[_0x1d90('0x7')]=_0x1d90('0x4');this[_0x1d90('0x8')]=![];this['membername']=_[_0x1d90('0x2')](_0x3788bb['Agent'])?undefined:_0x3788bb[_0x1d90('0x9')][_0x1d90('0x5')];this[_0x1d90('0xa')]=this['membername']?util[_0x1d90('0xb')](_0x1d90('0xc'),this[_0x1d90('0xd')]):_0x212d1a||undefined;this[_0x1d90('0xe')]=checkNameSurname(_0x3788bb[_0x1d90('0xf')][_0x1d90('0x10')],_0x3788bb[_0x1d90('0xf')]['firstName'],_0x3788bb[_0x1d90('0xf')][_0x1d90('0x11')]);this[_0x1d90('0x12')]=_0x3788bb[_0x1d90('0x12')]||![];this[_0x1d90('0x13')]=_0x3788bb[_0x1d90('0xf')][_0x1d90('0x10')];this[_0x1d90('0x14')]=_0x3788bb[_0x1d90('0x14')];this[_0x1d90('0x15')]=_0x3788bb[_0x1d90('0x15')]||0x0;this['countcongestionretry']=_0x3788bb[_0x1d90('0x16')]||0x0;this[_0x1d90('0x17')]=_0x3788bb[_0x1d90('0x17')]||0x0;this[_0x1d90('0x18')]=(_0x3788bb[_0x1d90('0x15')]||0x0)+(_0x3788bb[_0x1d90('0x16')]||0x0)+(_0x3788bb[_0x1d90('0x17')]||0x0)+(_0x3788bb['countnosuchnumberretry']||0x0)+(_0x3788bb[_0x1d90('0x19')]||0x0)+(_0x3788bb[_0x1d90('0x1a')]||0x0)+(_0x3788bb[_0x1d90('0x1b')]||0x0)+(_0x3788bb[_0x1d90('0x1c')]||0x0);this['countnosuchnumberretry']=_0x3788bb[_0x1d90('0x1d')]||0x0;this[_0x1d90('0x19')]=_0x3788bb[_0x1d90('0x19')]||0x0;this[_0x1d90('0x1a')]=_0x3788bb[_0x1d90('0x1a')]||0x0;this[_0x1d90('0x1b')]=_0x3788bb[_0x1d90('0x1b')]||0x0;this['countagentrejectretry']=_0x3788bb['countagentrejectretry']||0x0;this[_0x1d90('0x1e')]=_0x3788bb[_0x1d90('0x1e')];this[_0x1d90('0x1f')]=_0x3788bb[_0x1d90('0x1f')];this[_0x1d90('0x20')]=_0x3788bb['callbackat'];this[_0x1d90('0x21')]=_0x3788bb[_0x1d90('0x21')];this[_0x1d90('0x22')]=_0x3788bb[_0x1d90('0x22')];this[_0x1d90('0x23')]=_0x3788bb['ListId'];this[_0x1d90('0x24')]=_[_0x1d90('0x2')](_0x3788bb[_0x1d90('0x9')])?_0x3788bb[_0x1d90('0x24')]:_0x3788bb['Agent']['id'];this['VoiceQueueId']=_0x3788bb[_0x1d90('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1d90('0x26')][_0x1d90('0x27')]=function(){return util[_0x1d90('0xb')](_0x1d90('0x28'),this[_0x1d90('0xe')],this['number']);};module[_0x1d90('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 44c7cac..6e4766f 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 _0x7602=['CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','isNil','Contact','lookAgent','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','unlockContact','pick','getContactPreview','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','starttime','variablesAction','channelAgent','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/logger','preview','actionPreview','./action','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','booked','type','clearZombieChannels','setMessage','recallMe','sequence','[clearZombieChannels][talking]','Queue','originated:\x20','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','queue','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','answered','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','activeContact'];(function(_0x3fe152,_0x1b50c8){var _0x292080=function(_0x45dfb3){while(--_0x45dfb3){_0x3fe152['push'](_0x3fe152['shift']());}};_0x292080(++_0x1b50c8);}(_0x7602,0x8e));var _0x2760=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x7602[_0xc4001c];return _0x49f7bc;};'use strict';var util=require(_0x2760('0x0'));var _=require(_0x2760('0x1'));var BPromise=require(_0x2760('0x2'));var uuid=require('uuid');var moment=require(_0x2760('0x3'));var md5=require(_0x2760('0x4'));var Redis=require(_0x2760('0x5'));var config=require('../../../config/environment');var logger=require(_0x2760('0x6'))(_0x2760('0x7'));var loggerAction=require(_0x2760('0x6'))(_0x2760('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x2760('0x9'));var ut=require(_0x2760('0xa'));config['redis']=_[_0x2760('0xb')](config[_0x2760('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x2760('0xd'))(new Redis(config[_0x2760('0xc')]));var Sequence=function(){};Sequence[_0x2760('0xe')][_0x2760('0xf')]=function(_0x2a37ca){this[_0x2760('0x10')]=this[_0x2760('0x10')]?this['tail'][_0x2760('0x11')](_0x2a37ca):_0x2a37ca();};function Preview(_0x2ff5c1){this['sequence']=new Sequence();this[_0x2760('0x12')]=_0x2ff5c1[_0x2760('0x13')];this[_0x2760('0x14')]=_0x2ff5c1['trunks'];this[_0x2760('0x15')]={};this['agents']=_0x2ff5c1[_0x2760('0x16')];this[_0x2760('0x17')]=0x0;ami['on'](_0x2760('0x18'),this['syncOriginateResponse'][_0x2760('0x19')](this));ami['on'](_0x2760('0x1a'),this[_0x2760('0x1b')][_0x2760('0x19')](this));ami['on'](_0x2760('0x1c'),this['syncHangupRequest']['bind'](this));ami['on'](_0x2760('0x1d'),this['syncDialEnd'][_0x2760('0x19')](this));ami['on'](_0x2760('0x1e'),this[_0x2760('0x1f')][_0x2760('0x19')](this));ami['on'](_0x2760('0x20'),this['syncVarSet']['bind'](this));ami['on'](_0x2760('0x21'),this[_0x2760('0x22')][_0x2760('0x19')](this));ami['on'](_0x2760('0x23'),this[_0x2760('0x24')][_0x2760('0x19')](this));this[_0x2760('0x25')](this['campaignsPreview']);}function emit(_0x9f055b,_0x457fdf,_0x4db21f){io['to'](_0x9f055b)[_0x2760('0x26')](_0x457fdf,_0x4db21f);}function emitCampaignPreview(_0x33bf65){if(_0x33bf65['type']===_0x2760('0x27')){var _0x469ae0={'id':_0x33bf65['id'],'name':_0x33bf65[_0x2760('0x28')],'strategy':_0x33bf65[_0x2760('0x29')],'answered':_0x33bf65['answered'],'available':_0x33bf65[_0x2760('0x2a')],'loggedIn':_0x33bf65['loggedIn'],'pTalking':_0x33bf65[_0x2760('0x2b')],'sumBillable':_0x33bf65[_0x2760('0x2c')],'sumDuration':_0x33bf65[_0x2760('0x2d')],'sumHoldTime':_0x33bf65[_0x2760('0x2e')]||0x0,'talking':_0x33bf65[_0x2760('0x2f')],'total':_0x33bf65[_0x2760('0x30')],'type':_0x33bf65['type'],'unmanaged':_0x33bf65['unmanaged'],'abandoned':_0x33bf65[_0x2760('0x31')],'waiting':_0x33bf65[_0x2760('0x32')],'loggedInDb':_0x33bf65[_0x2760('0x33')],'dialActive':_0x33bf65[_0x2760('0x34')],'dialMethod':_0x33bf65[_0x2760('0x35')],'dialOriginateCallerIdName':_0x33bf65['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x33bf65[_0x2760('0x36')],'dialOriginateTimeout':_0x33bf65[_0x2760('0x37')],'dialPrefix':_0x33bf65[_0x2760('0x38')],'outboundAnswerAgiCallsDay':_0x33bf65['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x33bf65[_0x2760('0x39')],'outboundBlacklistCallsDay':_0x33bf65[_0x2760('0x3a')],'outboundBusyCallsDay':_0x33bf65[_0x2760('0x3b')],'outboundCongestionCallsDay':_0x33bf65['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x33bf65['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x33bf65[_0x2760('0x3c')],'outboundDropCallsDayTimeout':_0x33bf65['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x33bf65[_0x2760('0x3d')],'outboundNoSuchCallsDay':_0x33bf65['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x33bf65[_0x2760('0x3e')],'outboundReCallsDay':_0x33bf65[_0x2760('0x3f')],'outboundRejectCallsDay':_0x33bf65['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x33bf65[_0x2760('0x40')],'outboundAbandonedCallsDay':_0x33bf65['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x33bf65[_0x2760('0x41')],'predictiveIntervalAvgHoldtime':_0x33bf65[_0x2760('0x42')],'predictiveIntervalAvgTalktime':_0x33bf65['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x33bf65['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x33bf65[_0x2760('0x43')],'predictiveIntervalErlangCalls':_0x33bf65[_0x2760('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x33bf65[_0x2760('0x45')],'predictiveIntervalHitRate':_0x33bf65[_0x2760('0x46')],'predictiveIntervalMultiplicativeFactor':_0x33bf65[_0x2760('0x47')],'predictiveIntervalPauses':_0x33bf65[_0x2760('0x48')],'predictiveIntervalAvailable':_0x33bf65[_0x2760('0x49')],'predictiveIntervalTotalCalls':_0x33bf65[_0x2760('0x4a')],'message':_0x33bf65[_0x2760('0x4b')],'originated':_0x33bf65['originated'],'erlangCalls':_0x33bf65['erlangCalls'],'erlangCallToSecond':_0x33bf65[_0x2760('0x4c')],'erlangAbandonmentRate':_0x33bf65['erlangAbandonmentRate'],'erlangBusyFactor':_0x33bf65['erlangBusyFactor'],'startPredictive':_0x33bf65[_0x2760('0x4d')],'startProgressive':_0x33bf65[_0x2760('0x4e')]};if(_0x33bf65['Trunk']){_0x469ae0[_0x2760('0x4f')]={'id':_0x33bf65['Trunk']['id'],'name':_0x33bf65[_0x2760('0x4f')][_0x2760('0x28')],'active':_0x33bf65[_0x2760('0x4f')][_0x2760('0x50')],'callerid':_0x33bf65['Trunk'][_0x2760('0x51')]};}if(_0x33bf65[_0x2760('0x52')]){_0x469ae0[_0x2760('0x52')]={'id':_0x33bf65[_0x2760('0x52')]['id'],'name':_0x33bf65['Interval'][_0x2760('0x28')]};}var _0x1db563=md5(JSON[_0x2760('0x53')](_0x469ae0));if(_0x33bf65[_0x2760('0x4')]!==_0x1db563){_0x33bf65[_0x2760('0x4')]=_0x1db563;emit(util[_0x2760('0x54')](_0x2760('0x55'),_0x469ae0[_0x2760('0x28')]),_0x2760('0x56'),_0x469ae0);}}}function emitVoiceQueueChannelRemove(_0x4e4f5a){logger[_0x2760('0x57')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x2760('0x53')](_0x4e4f5a));emit(util[_0x2760('0x54')](_0x2760('0x55'),_0x4e4f5a[_0x2760('0x28')]),_0x2760('0x58'),_0x4e4f5a);io['emit'](_0x2760('0x59'),_0x4e4f5a);}function notSendMessagesQueue(_0x4baacc){if(_0x4baacc[_0x2760('0x5a')]){if(_0x4baacc[_0x2760('0x5b')]===0x0&&_0x4baacc['pTalking']===0x0){_0x4baacc['sendMessageOneNotActive']=![];_0x4baacc[_0x2760('0x2a')]=0x0;_0x4baacc[_0x2760('0x5c')]=0x0;_0x4baacc[_0x2760('0x4b')]=_0x2760('0x5d');ut['logger'](_0x2760('0x5e'),_0x4baacc[_0x2760('0x28')]+_0x2760('0x5f'));}else{_0x4baacc[_0x2760('0x4b')]=_0x2760('0x60');ut[_0x2760('0x61')](_0x2760('0x5e'),_0x4baacc[_0x2760('0x28')]+_0x2760('0x62'));}emitCampaignPreview(_0x4baacc);}}Preview[_0x2760('0xe')]['loopCampaigns']=function(){var _0x355f50=this;setInterval(function(){_0x355f50[_0x2760('0x63')]();},0x7cf);};Preview['prototype'][_0x2760('0x63')]=function(){var _0x798430=this[_0x2760('0x12')];this[_0x2760('0x17')]+=0x1;for(var _0x3a69eb in _0x798430){if(_0x798430['hasOwnProperty'](_0x3a69eb)&&(_0x798430[_0x3a69eb][_0x2760('0x35')]==='preview'||_0x798430[_0x3a69eb]['dialMethod']===_0x2760('0x64'))&&_0x798430[_0x3a69eb][_0x2760('0x65')]===_0x2760('0x27')){if(this[_0x2760('0x17')]>0x7){this[_0x2760('0x17')]=0x0;this[_0x2760('0x66')]();}}if(_0x798430['hasOwnProperty'](_0x3a69eb)&&_0x798430[_0x3a69eb][_0x2760('0x35')]==='preview'&&_0x798430[_0x3a69eb]['type']===_0x2760('0x27')){if(_0x798430[_0x3a69eb][_0x2760('0x34')]){this[_0x2760('0x67')](_0x798430[_0x3a69eb]);this[_0x2760('0x68')](_0x798430[_0x3a69eb]);}else{notSendMessagesQueue(_0x798430[_0x3a69eb]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x20dd92){var _0x3a0e8c=this;this[_0x2760('0x69')][_0x2760('0xf')](function(){if(!_['isNil'](_0x3a0e8c[_0x2760('0x15')][_0x20dd92])){loggerAction[_0x2760('0x57')](_0x2760('0x6a'),_0x20dd92,_0x2760('0x6b'),_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue'],_0x2760('0x6c'),JSON['stringify'](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c['actions'][_0x20dd92]['queue']][_0x2760('0x5b')]),'pTalking:\x20',JSON[_0x2760('0x53')](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c['actions'][_0x20dd92]['queue']]['pTalking']),JSON[_0x2760('0x53')](_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['dialAnswer']),JSON[_0x2760('0x53')](_['pick'](_0x3a0e8c[_0x2760('0x15')][_0x20dd92],[_0x2760('0x6d'),'UserId',_0x2760('0x6e'),_0x2760('0x6f')])));return ami[_0x2760('0x70')]({'action':_0x2760('0x71'),'channel':_0x3a0e8c['actions'][_0x20dd92][_0x2760('0x72')]})[_0x2760('0x73')](function(_0x60024e){if(_0x60024e[_0x2760('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3a0e8c[_0x2760('0x15')][_0x20dd92]){ut[_0x2760('0x74')](_0x3a0e8c[_0x2760('0x12')][_0x3a0e8c[_0x2760('0x15')][_0x20dd92][_0x2760('0x75')]],_0x2760('0x76'));if(_0x3a0e8c[_0x2760('0x15')][_0x20dd92][_0x2760('0x77')]===!![]){ut[_0x2760('0x78')](_0x3a0e8c['campaignsPreview'][_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue']],_0x2760('0x76'));ut[_0x2760('0x79')](_0x2760('0x7a')+_0x20dd92,_0x3a0e8c['actions'][_0x20dd92][_0x2760('0x75')]);}ut[_0x2760('0x79')]('[Dialer][checkChannel][Preview]'+_0x20dd92,_0x3a0e8c[_0x2760('0x15')][_0x20dd92]['queue']);delete _0x3a0e8c[_0x2760('0x15')][_0x20dd92];}},0x2328);}});}});};Preview[_0x2760('0xe')][_0x2760('0x66')]=function(){var _0x4b9252=this;loggerAction[_0x2760('0x57')](_0x2760('0x7b'),_[_0x2760('0x7c')](this[_0x2760('0x15')]));for(var _0x1869bd in this[_0x2760('0x15')]){if(_0x4b9252[_0x2760('0x15')]['hasOwnProperty'](_0x1869bd)){_0x4b9252[_0x2760('0x7d')](_0x1869bd);}}};Preview[_0x2760('0xe')][_0x2760('0x68')]=function(_0x2753a2){var _0x3c0582=this;rpcDb[_0x2760('0x7e')](_0x2753a2['id'],ut[_0x2760('0x7f')](this['agents']))['then'](function(_0x5e4686){if(!_['isNil'](_0x5e4686)){for(var _0x2bfa60=0x0;_0x2bfa60<_0x5e4686[_0x2760('0x80')];_0x2bfa60+=0x1){if(ut[_0x2760('0x81')](_0x5e4686[_0x2bfa60][_0x2760('0x82')])<_0x2753a2[_0x2760('0x83')]*0x3c){if(_0x5e4686[_0x2bfa60][_0x2760('0x84')]&&!_0x5e4686[_0x2bfa60][_0x2760('0x84')][_0x2760('0x85')]){_0x3c0582[_0x2760('0x86')](_0x5e4686[_0x2bfa60]['id'])['then'](ut[_0x2760('0x87')](_0x2760('0x88')))[_0x2760('0x73')](ut[_0x2760('0x87')](_0x2760('0x88')));}else{rpcDb[_0x2760('0x89')](_0x5e4686[_0x2bfa60]['id']);}}else{var _0x16d7df=new Action(_0x5e4686[_0x2bfa60],_0x2753a2);_0x16d7df['starttime']=moment()[_0x2760('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x2753a2['outboundReCallsDay']+=0x1;ut[_0x2760('0x8a')](_0x16d7df,0x17,_0x2760('0x8b'));if(_0x2753a2[_0x2760('0x8c')]){rpcDb[_0x2760('0x8d')](ut[_0x2760('0x8e')](_0x5e4686[_0x2bfa60]));rpcDb['createCustomerHistory'](_0x16d7df,_0x2760('0x8f'));}else{ut[_0x2760('0x8a')](_0x16d7df,0x16,_0x2760('0x90'));rpcDb[_0x2760('0x91')](_0x16d7df,'[HistoryRecallClose]');rpcDb[_0x2760('0x92')](_0x16d7df,_0x2760('0x93'));}}}}})[_0x2760('0x73')](ut[_0x2760('0x87')](_0x2760('0x94')));};Preview['prototype']['setMessage']=function(_0x335852){_0x335852[_0x2760('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x335852[_0x2760('0x95')])){_0x335852['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x2760('0x96')](_0x335852['dialActive'])){_0x335852[_0x2760('0x4b')]=_0x2760('0x5d');}else if(!this[_0x2760('0x97')](_0x335852[_0x2760('0x4f')])){if(!this[_0x2760('0x97')](_0x335852[_0x2760('0x98')])){_0x335852[_0x2760('0x4b')]=_0x2760('0x99');}else{_0x335852[_0x2760('0x4b')]='ACTIVE';}}else{_0x335852[_0x2760('0x4b')]=_0x2760('0x9a');}emitCampaignPreview(_0x335852);};Preview[_0x2760('0xe')]['callProgressDetectingCustomer']=function(_0x266a3f,_0x37cdee,_0xd2445b){var _0x2380b9=this;var _0x39c3e6=this[_0x2760('0x15')][_0x37cdee];var _0x2c157b=this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]];var _0x268b60;if(_0x2c157b){switch(_0xd2445b){case'1':_0x2c157b[_0x2760('0x9b')]+=0x1;_0x39c3e6[_0x2760('0x9c')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut['totalGlobal'](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x0,_0x2760('0x9e'));ami[_0x2760('0x26')](_0x2760('0x9f'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xa1')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xa2'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x39c3e6['countnosuchnumberretry']>=_0x2c157b[_0x2760('0xa6')]){rpcDb['createCustomerFinal'](_0x39c3e6,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,'countnosuchnumberretry',_0x2c157b[_0x2760('0xa9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6['activeContact']);}}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];break;case'ANSWER':var _0x113dac=moment()[_0x2760('0x54')](_0x2760('0xac'));_0x39c3e6[_0x2760('0xad')]=_0x113dac;_0x39c3e6[_0x2760('0xae')]=_0x113dac;_0x39c3e6[_0x2760('0x77')]=!![];_0x2c157b[_0x2760('0x2b')]+=0x1;logger[_0x2760('0x57')](_0x2760('0xaf'),_0x39c3e6[_0x2760('0xb0')],'\x20Queue',_0x2c157b[_0x2760('0x28')],_0x2760('0xb1'),_0x2c157b[_0x2760('0x2b')]);ami[_0x2760('0x26')](_0x2760('0xb2'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xb3'),this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]]));if(_0x2c157b[_0x2760('0xb4')]){ami[_0x2760('0x26')]('custom:agentConnectPreview',ut[_0x2760('0xb5')](_0x39c3e6));}break;case'16':ami[_0x2760('0x26')](_0x2760('0xb6'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xb7'),this[_0x2760('0x12')][_0x39c3e6[_0x2760('0x75')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x39c3e6,_0x2760('0xb7')));_0x2c157b[_0x2760('0x39')]+=0x1;_0x2c157b[_0x2760('0x30')]+=0x1;_0x2c157b[_0x2760('0xb8')]+=0x1;ut[_0x2760('0x78')](_0x2c157b,_0x2760('0xb9'));_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x4,_0x2760('0xbb'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xbc'));rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xbd'));rpcDb[_0x2760('0xbe')](_0x39c3e6);_0x2c157b[_0x2760('0x2d')]+=_0x39c3e6[_0x2760('0xbf')];_0x2c157b[_0x2760('0x2c')]+=_0x39c3e6[_0x2760('0xbf')];logger[_0x2760('0x57')](_0x2760('0xc0'),_0x39c3e6[_0x2760('0xb0')],_0x2760('0xc1'),_0x2c157b[_0x2760('0x28')],_0x2760('0xb1'),_0x2c157b[_0x2760('0x2b')]);delete this['actions'][_0x266a3f[_0x2760('0xab')]];break;case _0x2760('0xc2'):_0x2c157b['outboundBusyCallsDay']+=0x1;_0x39c3e6[_0x2760('0xc3')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x5,'Busy');ami[_0x2760('0x26')](_0x2760('0xc4'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xc5')));rpcDb[_0x2760('0x91')](_0x39c3e6,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xc6'));}else{if(_0x39c3e6[_0x2760('0xc3')]>=_0x2c157b[_0x2760('0xc7')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xc8'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xc3'),_0x2c157b[_0x2760('0xc9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6['activeContact']);}}break;case _0x2760('0xca'):_0x2c157b[_0x2760('0x3d')]+=0x1;_0x39c3e6[_0x2760('0xcb')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut['logCustomer'](_0x39c3e6,0x3,_0x2760('0xcc'));ami['emit']('custom:agentnoanswer',ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xcd')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xce'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,'Global');rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xcf'));}else{if(_0x39c3e6['countnoanswerretry']>=_0x2c157b['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x39c3e6,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xcb'),_0x2c157b[_0x2760('0xd0')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xd2'):_0x2c157b[_0x2760('0xd3')]+=0x1;_0x39c3e6[_0x2760('0xd4')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x8,_0x2760('0xd5'));ami[_0x2760('0x26')](_0x2760('0xd6'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xd7')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xd8'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xd9'));}else{if(_0x39c3e6[_0x2760('0xd4')]>=_0x2c157b[_0x2760('0xda')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xd8'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xd4'),_0x2c157b[_0x2760('0xc9')]),_0x39c3e6[_0x2760('0xaa')],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xdb'):_0x2c157b[_0x2760('0xdc')]+=0x1;_0x39c3e6[_0x2760('0xdd')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x14,_0x2760('0xde'));ami[_0x2760('0x26')](_0x2760('0xdf'),ut[_0x2760('0xa0')](_0x39c3e6,_0x2760('0xe0')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xe1'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0x14,_0x2760('0xde'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xe2'));}else{if(_0x39c3e6[_0x2760('0xdd')]>=_0x2c157b[_0x2760('0xe3')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xe2'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xdd'),_0x2c157b['dialAgentRejectRetryFrequency']),_0x39c3e6['unlockAgent'],_0x39c3e6[_0x2760('0xd1')]);}}break;case _0x2760('0xe4'):_0x2c157b['outboundAbandonedCallsDay']+=0x1;_0x39c3e6[_0x2760('0xe5')]+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0xb,_0x2760('0xe6'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xe7'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xe7'));}else{if(_0x39c3e6[_0x2760('0xe8')]>=_0x2c157b[_0x2760('0xe9')]){rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xe7'));}else{rpcDb[_0x2760('0xa7')](ut[_0x2760('0xa8')](_0x39c3e6,_0x2760('0xe5'),_0x2c157b[_0x2760('0xea')]),_0x39c3e6['unlockAgent'],_0x39c3e6['activeContact']);}}break;case'18':_0x2c157b[_0x2760('0x40')]+=0x1;_0x39c3e6['countmachineretry']+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut['totalGlobal'](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x12,_0x266a3f[_0x2760('0xeb')]||_0x266a3f[_0x2760('0xec')]);ami[_0x2760('0x26')]('custom:amd',ut['buildObj'](_0x39c3e6,_0x2760('0xed')));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xee'));if(ut[_0x2760('0xba')](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xee'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x266a3f['linkedid']];break;case'19':_0x2c157b[_0x2760('0x40')]+=0x1;_0x39c3e6['countglobal']=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0x13,_0x266a3f[_0x2760('0xeb')]||_0x266a3f[_0x2760('0xec')]);ami['emit'](_0x2760('0xef'),ut[_0x2760('0xa0')](_0x39c3e6,'amd'));rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xf0'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,'Global');rpcDb[_0x2760('0x92')](_0x268b60,_0x2760('0xf0'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,_0x2760('0xf0'));}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];break;default:if(_0x39c3e6['dialAnswer']){ut[_0x2760('0x78')](_0x2c157b,'[default]');ut[_0x2760('0x79')](_0x2760('0xf1')+_0x2c157b[_0x2760('0x28')],_0x266a3f);}_0x2c157b['outboundUnknownCallsDay']+=0x1;_0x39c3e6[_0x2760('0x9d')]=ut[_0x2760('0xba')](_0x39c3e6);ut[_0x2760('0x8a')](_0x39c3e6,0xc,_0x266a3f['cause-txt']||_0x266a3f[_0x2760('0xec')]);rpcDb[_0x2760('0x91')](_0x39c3e6,_0x2760('0xf2'));if(ut['totalGlobal'](_0x39c3e6)>=_0x2c157b[_0x2760('0xa3')]){_0x268b60=ut[_0x2760('0xa4')](_0x39c3e6,0xf,_0x2760('0xa5'));rpcDb['createCustomerFinal'](_0x268b60,_0x2760('0xf3'));}else{rpcDb[_0x2760('0x92')](_0x39c3e6,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];}if(!(_0x39c3e6[_0x2760('0x77')]&&_0xd2445b==='16')){ut[_0x2760('0x74')](_0x2c157b,'[callProgressDetectingCustomer]');logger[_0x2760('0x57')](_0x2760('0xf4'),_0x39c3e6[_0x2760('0xb0')],_0x2760('0xc1'),_0x2c157b[_0x2760('0x28')],_0x2760('0x6c'),_0x2c157b[_0x2760('0x5b')]);}if(_0xd2445b!==_0x2760('0xf5')){delete this[_0x2760('0x15')][_0x266a3f[_0x2760('0xab')]];delete this[_0x2760('0x15')][_0x266a3f['destlinkedid']];}}};Preview[_0x2760('0xe')][_0x2760('0xf6')]=function(_0x28aa60,_0x409706,_0x363bab){if(_[_0x2760('0xf7')](_0x409706)&&_0x2760('0xf8')!==typeof _0x409706){return;}if(_['isUndefined'](_0x363bab)&&_0x2760('0xf8')!==typeof _0x363bab){return;}switch(_0x363bab[_0x2760('0xf9')]){case'0':ut[_0x2760('0xfa')](_0x28aa60,0x0,_0x2760('0x9e'));rpcDb['createAgentHistory'](_0x28aa60,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x2760('0xfa')](_0x28aa60,0x3,_0x2760('0xcc'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xfc'));break;case'5':ut[_0x2760('0xfa')](_0x28aa60,0x5,_0x2760('0xfd'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xfe'));break;case'8':ut[_0x2760('0xfa')](_0x28aa60,0x8,'Congestion');rpcDb['createAgentHistory'](_0x28aa60,_0x2760('0xff'));break;case'22':ut[_0x2760('0xfa')](_0x28aa60,0x16,_0x2760('0x100'));rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0x101'));break;default:ut[_0x2760('0xfa')](_0x28aa60,0xc,_0x363bab[_0x2760('0xf9')]);rpcDb[_0x2760('0xfb')](_0x28aa60,_0x2760('0xff'));}ut['updateOriginated'](_0x409706,'[callProgressDetectingAgent]');logger[_0x2760('0x57')]('[originated][decrement][callProgressDetectingAgent]',_0x28aa60[_0x2760('0xb0')],_0x2760('0xc1'),_0x409706['name'],'originated:\x20',_0x409706[_0x2760('0x5b')]);delete this['actions'][_0x28aa60['uniqueid']];};Preview['prototype']['checkInBlack']=function(_0x13eb7e,_0x409907,_0x248781,_0x18c24e,_0x4851bf){var _0x2bf000=this;return new BPromise(function(_0x2c0bed,_0x3a5eee){if(_['isNil'](_0x409907)||_[_0x2760('0x102')](_0x409907[_0x2760('0x103')])||_[_0x2760('0x102')](_0x409907[_0x2760('0x103')]['phone'])||_[_0x2760('0x102')](_0x409907[_0x2760('0x6e')])){_0x3a5eee(ut[_0x2760('0x4b')]('Contact\x20is\x20undefined',_0x18c24e,_0x4851bf));return;}var _0x1d7dd5=uuid['v4']();var _0x3ca313=_0x2bf000['campaignsPreview'][_0x409907[_0x2760('0x6b')][_0x2760('0x28')]];var _0x3c845b=_0x248781?_0x2bf000['agents'][_0x248781]['id']:undefined;_0x2bf000[_0x2760('0x15')][_0x1d7dd5]=new Action(_0x409907,_0x3ca313,_0x1d7dd5,_0x248781,_0x3c845b);var _0x25208b=_0x2bf000['actions'][_0x1d7dd5];_0x25208b[_0x2760('0xaa')]=_0x18c24e;_0x25208b[_0x2760('0xd1')]=_0x4851bf;_0x25208b[_0x2760('0x104')]=_0x248781;if(_[_0x2760('0x105')](_0x13eb7e)){_0x2bf000[_0x2760('0x106')](_0x25208b,_0x3ca313,_0x409907,_0x248781)[_0x2760('0x107')](function(_0xb478d2){logger['info'](_0x2760('0x108'),_0x2760('0x109')+_0x25208b[_0x2760('0x75')]+_0x2760('0x10a')+_0x25208b[_0x2760('0x10b')],JSON[_0x2760('0x53')](_0xb478d2));ami[_0x2760('0x26')](_0x2760('0x10c'),ut['buildObj'](_0x25208b,_0x2760('0x10d'),_0x2bf000['campaignsPreview'][_0x25208b[_0x2760('0x75')]]));_0x2c0bed(ut[_0x2760('0x4b')](_0x2760('0x10e')));})[_0x2760('0x73')](function(_0x919242){ut[_0x2760('0x61')](_0x2760('0x10f'),_0x919242);_0x3a5eee(ut[_0x2760('0x4b')]('Call\x20failed',_0x18c24e,_0x4851bf));});}else{_0x3ca313['outboundBlacklistCallsDay']+=0x1;ut[_0x2760('0x110')](_0x25208b);rpcDb[_0x2760('0x111')](_0x25208b,_0x2760('0x112'));delete _0x2bf000[_0x2760('0x15')][_0x1d7dd5];_0x3a5eee(ut[_0x2760('0x4b')](_0x2760('0x113'),_0x18c24e,_0x4851bf));}});};Preview[_0x2760('0xe')][_0x2760('0x97')]=function(_0x5dcfe4){return!_[_0x2760('0x102')](_0x5dcfe4)&&!_[_0x2760('0x102')](_0x5dcfe4[_0x2760('0x28')])&&!_[_0x2760('0x102')](_0x5dcfe4['active'])&&_0x5dcfe4['active']&&!_[_0x2760('0x102')](this[_0x2760('0x14')][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])])&&!_[_0x2760('0x102')](this['trunks'][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')])&&(this[_0x2760('0x14')][util['format'](_0x2760('0x114'),_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')]==='reachable'||this['trunks'][util['format']('SIP/%s',_0x5dcfe4[_0x2760('0x28')])][_0x2760('0x71')]===_0x2760('0x115'));};Preview[_0x2760('0xe')]['run']=function(_0x5f361e,_0x54c1f6){var _0x1ac461=this;return new BPromise(function(_0x42afdd,_0x40ba3e){_0x1ac461[_0x2760('0x116')](_0x5f361e,_0x54c1f6)[_0x2760('0x107')](function(_0x29079b){_0x42afdd(_['pick'](_0x29079b,[_0x2760('0x4b')]));})[_0x2760('0x73')](function(_0xe51a5f){if(_0xe51a5f[_0x2760('0x117')]){rpcDb[_0x2760('0x118')](_0x5f361e);}if(_0xe51a5f[_0x2760('0x50')]){rpcDb['disableContact'](_0x5f361e);}_0x40ba3e(_[_0x2760('0x119')](_0xe51a5f,[_0x2760('0x4b')]));});});};Preview[_0x2760('0xe')][_0x2760('0x116')]=function(_0x1c61c1,_0x1bc817){var _0x5894f8=this;return new BPromise(function(_0x24a4ed,_0x27fcfd){var _0x10e662,_0x12a31c;rpcDb[_0x2760('0x11a')](_0x1c61c1)[_0x2760('0x107')](function(_0x2cc19b){if(!_[_0x2760('0x102')](_0x2cc19b[0x0])){_0x12a31c=_0x2cc19b[0x0]['recallme']?![]:!![];_0x10e662=_0x2cc19b[0x0]['recallme']?!![]:![];_0x10e662=_0x1bc817?!![]:_0x10e662;}var _0x512122=_0x5894f8['validateContact'](_0x2cc19b);if(_0x512122['isValid']){rpcDb[_0x2760('0x11b')](_[_0x2760('0x119')](_0x2cc19b[0x0],['VoiceQueueId',_0x2760('0x11c')]))[_0x2760('0x107')](function(_0x2c7118){_0x5894f8[_0x2760('0x11d')](_0x2c7118,_0x2cc19b[0x0],_0x1bc817,_0x12a31c,_0x10e662)[_0x2760('0x107')](function(_0x179a45){_0x24a4ed(_0x179a45);})['catch'](function(_0xfc3a0d){_0x27fcfd(_0xfc3a0d);});})[_0x2760('0x73')](function(_0x5b634f){ut[_0x2760('0x61')](_0x2760('0x11e'),_0x5b634f);_0x27fcfd(ut[_0x2760('0x4b')](_0x2760('0x11f'),_0x12a31c,_0x10e662));});}else{_0x27fcfd(ut[_0x2760('0x4b')](_0x512122[_0x2760('0x4b')],_0x12a31c,_0x10e662));}})[_0x2760('0x73')](function(_0x147ac9){ut[_0x2760('0x61')](_0x2760('0x120'),_0x147ac9);_0x27fcfd(ut[_0x2760('0x4b')](_0x2760('0x11f'),![],!![]));});});};Preview['prototype'][_0x2760('0x121')]=function(_0x5b2f74){if(_[_0x2760('0x102')](_0x5b2f74)||_[_0x2760('0x105')](_0x5b2f74)||!_[_0x2760('0x102')](_0x5b2f74[0x0][_0x2760('0x84')])&&_['isNil'](_0x5b2f74[0x0][_0x2760('0x84')]['name'])){ut['logger'](_0x2760('0x122'),_0x5b2f74);return{'isValid':![],'message':_0x2760('0x123')};}var _0xd95181=this[_0x2760('0x12')][_0x5b2f74[0x0]['Queue'][_0x2760('0x28')]];_0xd95181[_0x2760('0x4b')]='ACTIVE';if(_[_0x2760('0x102')](_0xd95181)){ut[_0x2760('0x61')](_0x2760('0x124'),_0xd95181);return{'isValid':![],'message':_0x2760('0x125')};}if(!this[_0x2760('0x97')](_0xd95181[_0x2760('0x4f')])){ut[_0x2760('0x61')](_0x2760('0x126'),_0x2760('0x127')+_0xd95181[_0x2760('0x28')]+_0x2760('0x128'));if(!this[_0x2760('0x97')](_0xd95181['TrunkBackup'])){ut[_0x2760('0x61')](_0x2760('0x126'),_0xd95181[_0x2760('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x2760('0x129')};}}if(!ut['isActive'](_0xd95181[_0x2760('0x34')])){ut[_0x2760('0x61')]('[Preview][validateContact][Campaign\x20Active]',_0xd95181['name']+_0x2760('0x12a'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xd95181[_0x2760('0x28')]+_0x2760('0x12a')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x2760('0xe')][_0x2760('0x106')]=function(_0x2a3c38,_0x3e914c,_0x5746a9,_0x4f9199){var _0x269c87=this;return new BPromise(function(_0x2b590b,_0x1f811d){var _0x473668=_0x2a3c38[_0x2760('0xb0')];var _0x40ef1a=_0x269c87[_0x2760('0x97')](_0x3e914c['Trunk'])?util[_0x2760('0x54')](_0x2760('0x12b'),_0x3e914c['Trunk'][_0x2760('0x28')],_[_0x2760('0x102')](_0x3e914c[_0x2760('0x38')])?'':_0x3e914c['dialPrefix'][_0x2760('0x12c')]()||'',_0x3e914c[_0x2760('0x12d')]>0x0?_0x5746a9[_0x2760('0x103')][_0x2760('0x12e')][_0x2760('0x12f')](_0x3e914c[_0x2760('0x12d')]):_0x5746a9[_0x2760('0x103')][_0x2760('0x12e')]):util[_0x2760('0x54')]('SIP/%s/%s%s',_[_0x2760('0x102')](_0x3e914c[_0x2760('0x98')])?_0x3e914c['Trunk'][_0x2760('0x28')]:_0x3e914c[_0x2760('0x98')][_0x2760('0x28')],_[_0x2760('0x102')](_0x3e914c[_0x2760('0x38')])?'':_0x3e914c[_0x2760('0x38')][_0x2760('0x12c')]()||'',_0x3e914c[_0x2760('0x12d')]>0x0?_0x5746a9['Contact']['phone'][_0x2760('0x12f')](_0x3e914c[_0x2760('0x12d')]):_0x5746a9[_0x2760('0x103')]['phone']);var _0x48acd0=_0x269c87[_0x2760('0x97')](_0x3e914c['Trunk'])?ut[_0x2760('0x130')](_0x3e914c[_0x2760('0x4f')]['callerid'],_0x3e914c['dialOriginateCallerIdName'],_0x3e914c[_0x2760('0x131')]>0x0?ut[_0x2760('0x132')](_0x3e914c['dialOriginateCallerIdNumber'],_0x3e914c[_0x2760('0x131')]):_0x3e914c[_0x2760('0x36')]):ut[_0x2760('0x130')](_[_0x2760('0x102')](_0x3e914c[_0x2760('0x98')])?_0x3e914c[_0x2760('0x4f')][_0x2760('0x51')]:_0x3e914c[_0x2760('0x98')][_0x2760('0x51')],_0x3e914c[_0x2760('0x133')],_0x3e914c[_0x2760('0x131')]>0x0?ut[_0x2760('0x132')](_0x3e914c[_0x2760('0x36')],_0x3e914c[_0x2760('0x131')]):_0x3e914c['dialOriginateCallerIdNumber']);if(_0x48acd0){_0x2a3c38[_0x2760('0x134')]=ut[_0x2760('0x135')](_0x48acd0);_0x2a3c38['originatecalleridnum']=ut[_0x2760('0x136')](_0x48acd0);}var _0x2a147a=ut['addVariables'](_0x3e914c,_0x5746a9,_0x40ef1a,_0x48acd0,_0x473668,_0x2a3c38);_[_0x2760('0x137')](_0x2a3c38,ut['toLowerVariables'](_0x2a147a));_0x2a3c38[_0x2760('0x138')]=moment()[_0x2760('0x54')](_0x2760('0xac'));ami[_0x2760('0x70')](ut[_0x2760('0x139')](_0x2a3c38,_0x3e914c,_0x2a147a,_0x2a3c38[_0x2760('0xd1')],_0x4f9199))[_0x2760('0x107')](function(_0x266157){var _0x563444=_0x2a3c38[_0x2760('0x13a')];if(!_[_0x2760('0x102')](_0x563444)){if(!_[_0x2760('0x102')](_0x269c87['agents'][_0x563444])){_0x269c87['agents'][_0x563444]['destconnectedlinenum']=_0x2a3c38[_0x2760('0x13b')];emit(util[_0x2760('0x54')](_0x2760('0x13c'),_0x269c87[_0x2760('0x16')][_0x563444][_0x2760('0x28')]),'user:agentconnect',{'destaccountcode':_0x269c87[_0x2760('0x16')][_0x563444][_0x2760('0x13d')],'destconnectedlinenum':_0x2a3c38['calleridnum']});}}_0x3e914c['originated']+=0x1;logger[_0x2760('0x57')](_0x2760('0x13e'),_0x473668,_0x2760('0xc1'),_0x3e914c[_0x2760('0x28')],_0x2760('0x6c'),_0x3e914c[_0x2760('0x5b')]);_0x2b590b(_0x266157);})[_0x2760('0x73')](function(_0x3a486e){ut[_0x2760('0xfa')](_0x2a3c38,0xe,_0x2760('0x13f'));rpcDb[_0x2760('0xfb')](_0x2a3c38,_0x2760('0x140'));_0x1f811d(_0x3a486e);});});};Preview[_0x2760('0xe')]['syncNewExten']=function(_0x3fb864){if(this[_0x2760('0x15')][_0x3fb864[_0x2760('0xab')]]){this[_0x2760('0x15')][_0x3fb864['linkedid']][_0x2760('0x72')]=_0x3fb864['channel'];}};Preview[_0x2760('0xe')]['syncOriginateResponse']=function(_0xd6ff9e){var _0x37856d=this;var _0x364c78=this['actions'][_0xd6ff9e[_0x2760('0x141')]];if(_0x364c78){if(_0x364c78[_0x2760('0x104')]&&this[_0x2760('0x16')][_0x364c78['lookAgent']]){ut[_0x2760('0x142')](_0x364c78,this[_0x2760('0x16')][_0x364c78[_0x2760('0x104')]][_0x2760('0x28')],this[_0x2760('0x16')][_0x364c78[_0x2760('0x104')]]['id']);}var _0x3bc4bd=_[_0x2760('0x143')](_0x364c78);_0x3bc4bd[_0x2760('0xad')]=moment()[_0x2760('0x54')](_0x2760('0xac'));var _0x2be019=_0x37856d['campaignsPreview'][_0x364c78[_0x2760('0x75')]];if(ut[_0x2760('0x144')](_0xd6ff9e[_0x2760('0x145')])){if(_0x364c78[_0x2760('0xaa')]){rpcDb['unlockContact'](_0x364c78[_0x2760('0x10b')]);}if(_0x364c78['activeContact']){rpcDb[_0x2760('0x89')](_0x364c78[_0x2760('0x10b')]);}ami['emit'](_0x2760('0x146'),ut[_0x2760('0xa0')](_0x364c78,_0x2760('0x147'),this[_0x2760('0x12')][_0x364c78[_0x2760('0x75')]]));this[_0x2760('0xf6')](_0x3bc4bd,_0x2be019,_0xd6ff9e);}else{_0x364c78[_0x2760('0x138')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x3bc4bd,0x4,_0x2760('0xbb'));rpcDb['createAgentHistory'](_0x3bc4bd,_0x2760('0x148'));}}};Preview[_0x2760('0xe')][_0x2760('0x1b')]=function(_0xf40737){var _0x45d437=this;var _0x21c73a=this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]];var _0x3fe16b;if(_0x21c73a){_0x3fe16b=this[_0x2760('0x12')][_0x21c73a[_0x2760('0x75')]];logger[_0x2760('0x57')](_0x2760('0x149'),_0xf40737[_0x2760('0xab')],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);}if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]]&&_0xf40737[_0x2760('0xab')]!==_0xf40737[_0x2760('0xb0')]){if(_0xf40737[_0x2760('0x14a')]==='16'&&this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){this[_0x2760('0x14b')](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}else if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){logger[_0x2760('0x57')](_0x2760('0x14c'),_0xf40737[_0x2760('0xab')],_0xf40737['cause'],'\x20Queue',_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b['pTalking']);this[_0x2760('0x14b')](_0xf40737,_0xf40737['linkedid'],_0xf40737['cause']);}}else if(_0x21c73a&&_[_0x2760('0x102')](_0x21c73a[_0x2760('0x14d')])&&_0x3fe16b[_0x2760('0x14e')]&&_0xf40737['linkedid']===_0xf40737['uniqueid']&&_[_0x2760('0x102')](_0xf40737[_0x2760('0xf9')])&&_0xf40737[_0x2760('0x14a')]==='16'&&_0xf40737['channelstate']==='6'&&_[_0x2760('0xf7')](_0x21c73a[_0x2760('0x14f')])){if(_0x21c73a[_0x2760('0xaa')]){rpcDb[_0x2760('0x118')](_0x21c73a[_0x2760('0x10b')]);}if(_0x21c73a[_0x2760('0xd1')]){rpcDb[_0x2760('0x89')](_0x21c73a[_0x2760('0x10b')]);}_0xf40737[_0x2760('0xf9')]='22';this[_0x2760('0xf6')](_0x21c73a,_0x3fe16b,_0xf40737);}else if(_0x21c73a&&_0x21c73a[_0x2760('0x14f')]){if(_0xf40737['cause']==='16'&&this[_0x2760('0x15')][_0xf40737['linkedid']][_0x2760('0x77')]){logger['info'](_0x2760('0x150'),_0xf40737[_0x2760('0xab')],_0xf40737['cause'],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);this[_0x2760('0x14b')](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}else if(this[_0x2760('0x15')][_0xf40737[_0x2760('0xab')]][_0x2760('0x77')]){logger[_0x2760('0x57')]('[syncHangup][talking][cause]',_0xf40737['linkedid'],_0xf40737[_0x2760('0x14a')],_0x2760('0xc1'),_0x3fe16b[_0x2760('0x28')],_0x2760('0xb1'),_0x3fe16b[_0x2760('0x2b')]);this['callProgressDetectingCustomer'](_0xf40737,_0xf40737[_0x2760('0xab')],_0xf40737[_0x2760('0x14a')]);}}};Preview[_0x2760('0xe')]['syncDialEnd']=function(_0x540d3b){if(this[_0x2760('0x15')][_0x540d3b[_0x2760('0x151')]]&&_0x540d3b[_0x2760('0x151')]!==_0x540d3b[_0x2760('0x152')]){this[_0x2760('0x14b')](_0x540d3b,_0x540d3b[_0x2760('0x151')],_0x540d3b[_0x2760('0xec')]);}};Preview['prototype'][_0x2760('0x153')]=function(_0x2c83a7){if(this[_0x2760('0x15')][_0x2c83a7['linkedid']]&&_0x2c83a7[_0x2760('0xab')]!==_0x2c83a7[_0x2760('0xb0')]&&!this[_0x2760('0x15')][_0x2c83a7[_0x2760('0xab')]]['dialAnswer']){if(_0x2c83a7[_0x2760('0x14a')]==='1'){this[_0x2760('0x14b')](_0x2c83a7,_0x2c83a7[_0x2760('0xab')],_0x2c83a7[_0x2760('0x14a')]);}}};Preview[_0x2760('0xe')][_0x2760('0x154')]=function(_0x4f3486,_0x3e15b3,_0x6a66a9){if(this[_0x2760('0x15')][_0x4f3486]){if(_['isNil'](this['actions'][_0x4f3486][_0x2760('0x155')])){this[_0x2760('0x15')][_0x4f3486][_0x2760('0x155')]={};}this[_0x2760('0x15')][_0x4f3486]['variables'][_0x3e15b3]=_0x6a66a9;}};Preview[_0x2760('0xe')][_0x2760('0x156')]=function(_0x14fe6f){try{if(!_[_0x2760('0x102')](_0x14fe6f)){if(ut['filterKey'](_[_0x2760('0x157')](_0x14fe6f[_0x2760('0x158')])[0x0])){this['addVariable'](_0x14fe6f[_0x2760('0xb0')],_[_0x2760('0x157')](_0x14fe6f[_0x2760('0x158')])[0x0],_0x14fe6f[_0x2760('0x159')]);}}}catch(_0x32a29a){logger[_0x2760('0x15a')](_0x2760('0x15b'),util[_0x2760('0x15c')](_0x32a29a,{'showHidden':![],'depth':null}));}};Preview[_0x2760('0xe')]['syncAttendedTransfer']=function(_0x5eb467){if(_0x5eb467){if(this[_0x2760('0x15')][_0x5eb467[_0x2760('0x15d')]]){this[_0x2760('0x15')][_0x5eb467[_0x2760('0x15d')]][_0x2760('0x14f')]=!![];}}};Preview['prototype'][_0x2760('0x24')]=function(_0x3e9a99){if(_0x3e9a99){if(this['actions'][_0x3e9a99['transfererlinkedid']]){this[_0x2760('0x15')][_0x3e9a99[_0x2760('0x15e')]]['transfer']=!![];}}};module[_0x2760('0x15f')]=Preview; \ No newline at end of file +var _0xad67=['tail','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','dialend','newexten','syncNewExten','blindtransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','available','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','actions','originated:\x20','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','logger2','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','countnosuchnumberretry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','[syncHangup][talking][decrement]','\x20Queue','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','NOANSWER','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','pick','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','variablesAction','channelAgent','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','syncVarSet','variable','keys','value','error','inspect','syncAttendedTransfer','syncBlindTransfer','transfererlinkedid','exports','util','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype'];(function(_0x19d203,_0x4c8e2){var _0x15926a=function(_0x8f644e){while(--_0x8f644e){_0x19d203['push'](_0x19d203['shift']());}};_0x15926a(++_0x4c8e2);}(_0xad67,0x148));var _0x7ad6=function(_0x3072e2,_0x648a09){_0x3072e2=_0x3072e2-0x0;var _0x42c45b=_0xad67[_0x3072e2];return _0x42c45b;};'use strict';var util=require(_0x7ad6('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var md5=require('md5');var Redis=require(_0x7ad6('0x3'));var config=require(_0x7ad6('0x4'));var logger=require(_0x7ad6('0x5'))(_0x7ad6('0x6'));var loggerAction=require(_0x7ad6('0x5'))(_0x7ad6('0x7'));var ami=require(_0x7ad6('0x8'));var rpcDb=require(_0x7ad6('0x9'));var Action=require(_0x7ad6('0xa'));var ut=require(_0x7ad6('0xb'));config[_0x7ad6('0xc')]=_[_0x7ad6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7ad6('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x7ad6('0xf')]['enqueue']=function(_0xbc134a){this['tail']=this[_0x7ad6('0x10')]?this[_0x7ad6('0x10')]['finally'](_0xbc134a):_0xbc134a();};function Preview(_0xbbb7c1){this[_0x7ad6('0x11')]=new Sequence();this['campaignsPreview']=_0xbbb7c1[_0x7ad6('0x12')];this['trunks']=_0xbbb7c1[_0x7ad6('0x13')];this['actions']={};this[_0x7ad6('0x14')]=_0xbbb7c1[_0x7ad6('0x14')];this[_0x7ad6('0x15')]=0x0;ami['on'](_0x7ad6('0x16'),this['syncOriginateResponse'][_0x7ad6('0x17')](this));ami['on'](_0x7ad6('0x18'),this[_0x7ad6('0x19')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x7ad6('0x17')](this));ami['on'](_0x7ad6('0x1a'),this['syncDialEnd'][_0x7ad6('0x17')](this));ami['on'](_0x7ad6('0x1b'),this[_0x7ad6('0x1c')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7ad6('0x17')](this));ami['on'](_0x7ad6('0x1d'),this['syncBlindTransfer'][_0x7ad6('0x17')](this));this[_0x7ad6('0x1e')](this[_0x7ad6('0x1f')]);}function emit(_0x3bea42,_0x589c40,_0x298a5f){io['to'](_0x3bea42)[_0x7ad6('0x20')](_0x589c40,_0x298a5f);}function emitCampaignPreview(_0x2dd97b){if(_0x2dd97b[_0x7ad6('0x21')]===_0x7ad6('0x22')){var _0xc888e7={'id':_0x2dd97b['id'],'name':_0x2dd97b[_0x7ad6('0x23')],'strategy':_0x2dd97b[_0x7ad6('0x24')],'answered':_0x2dd97b['answered'],'available':_0x2dd97b[_0x7ad6('0x25')],'loggedIn':_0x2dd97b['loggedIn'],'pTalking':_0x2dd97b['pTalking'],'sumBillable':_0x2dd97b[_0x7ad6('0x26')],'sumDuration':_0x2dd97b[_0x7ad6('0x27')],'sumHoldTime':_0x2dd97b['sumHoldTime']||0x0,'talking':_0x2dd97b[_0x7ad6('0x28')],'total':_0x2dd97b[_0x7ad6('0x29')],'type':_0x2dd97b[_0x7ad6('0x21')],'unmanaged':_0x2dd97b[_0x7ad6('0x2a')],'abandoned':_0x2dd97b[_0x7ad6('0x2b')],'waiting':_0x2dd97b[_0x7ad6('0x2c')],'loggedInDb':_0x2dd97b['loggedInDb'],'dialActive':_0x2dd97b[_0x7ad6('0x2d')],'dialMethod':_0x2dd97b['dialMethod'],'dialOriginateCallerIdName':_0x2dd97b[_0x7ad6('0x2e')],'dialOriginateCallerIdNumber':_0x2dd97b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2dd97b[_0x7ad6('0x2f')],'dialPrefix':_0x2dd97b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2dd97b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2dd97b[_0x7ad6('0x30')],'outboundBlacklistCallsDay':_0x2dd97b[_0x7ad6('0x31')],'outboundBusyCallsDay':_0x2dd97b[_0x7ad6('0x32')],'outboundCongestionCallsDay':_0x2dd97b[_0x7ad6('0x33')],'outboundDropCallsDayACS':_0x2dd97b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2dd97b[_0x7ad6('0x34')],'outboundDropCallsDayTimeout':_0x2dd97b[_0x7ad6('0x35')],'outboundNoAnswerCallsDay':_0x2dd97b[_0x7ad6('0x36')],'outboundNoSuchCallsDay':_0x2dd97b[_0x7ad6('0x37')],'outboundOriginateFailureCallsDay':_0x2dd97b[_0x7ad6('0x38')],'outboundReCallsDay':_0x2dd97b[_0x7ad6('0x39')],'outboundRejectCallsDay':_0x2dd97b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2dd97b[_0x7ad6('0x3a')],'outboundAbandonedCallsDay':_0x2dd97b[_0x7ad6('0x3b')],'predictiveIntervalAnsweredCalls':_0x2dd97b[_0x7ad6('0x3c')],'predictiveIntervalAvgHoldtime':_0x2dd97b[_0x7ad6('0x3d')],'predictiveIntervalAvgTalktime':_0x2dd97b[_0x7ad6('0x3e')],'predictiveIntervalDroppedCallsCallersExit':_0x2dd97b['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2dd97b[_0x7ad6('0x3f')],'predictiveIntervalErlangCalls':_0x2dd97b[_0x7ad6('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x2dd97b[_0x7ad6('0x41')],'predictiveIntervalHitRate':_0x2dd97b[_0x7ad6('0x42')],'predictiveIntervalMultiplicativeFactor':_0x2dd97b[_0x7ad6('0x43')],'predictiveIntervalPauses':_0x2dd97b[_0x7ad6('0x44')],'predictiveIntervalAvailable':_0x2dd97b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2dd97b[_0x7ad6('0x45')],'message':_0x2dd97b[_0x7ad6('0x46')],'originated':_0x2dd97b[_0x7ad6('0x47')],'erlangCalls':_0x2dd97b['erlangCalls'],'erlangCallToSecond':_0x2dd97b[_0x7ad6('0x48')],'erlangAbandonmentRate':_0x2dd97b[_0x7ad6('0x49')],'erlangBusyFactor':_0x2dd97b[_0x7ad6('0x4a')],'startPredictive':_0x2dd97b['startPredictive'],'startProgressive':_0x2dd97b['startProgressive']};if(_0x2dd97b[_0x7ad6('0x4b')]){_0xc888e7['Trunk']={'id':_0x2dd97b[_0x7ad6('0x4b')]['id'],'name':_0x2dd97b['Trunk']['name'],'active':_0x2dd97b[_0x7ad6('0x4b')][_0x7ad6('0x4c')],'callerid':_0x2dd97b[_0x7ad6('0x4b')][_0x7ad6('0x4d')]};}if(_0x2dd97b[_0x7ad6('0x4e')]){_0xc888e7[_0x7ad6('0x4e')]={'id':_0x2dd97b[_0x7ad6('0x4e')]['id'],'name':_0x2dd97b[_0x7ad6('0x4e')][_0x7ad6('0x23')]};}var _0x3d9f0f=md5(JSON[_0x7ad6('0x4f')](_0xc888e7));if(_0x2dd97b[_0x7ad6('0x50')]!==_0x3d9f0f){_0x2dd97b['md5']=_0x3d9f0f;emit(util[_0x7ad6('0x51')](_0x7ad6('0x52'),_0xc888e7[_0x7ad6('0x23')]),_0x7ad6('0x53'),_0xc888e7);}}}function emitVoiceQueueChannelRemove(_0x20e733){logger[_0x7ad6('0x54')](_0x7ad6('0x55'),JSON[_0x7ad6('0x4f')](_0x20e733));emit(util[_0x7ad6('0x51')]('voice:queue:%s',_0x20e733[_0x7ad6('0x23')]),_0x7ad6('0x56'),_0x20e733);io[_0x7ad6('0x20')](_0x7ad6('0x57'),_0x20e733);}function notSendMessagesQueue(_0xe86718){if(_0xe86718[_0x7ad6('0x58')]){if(_0xe86718[_0x7ad6('0x47')]===0x0&&_0xe86718['pTalking']===0x0){_0xe86718[_0x7ad6('0x58')]=![];_0xe86718[_0x7ad6('0x25')]=0x0;_0xe86718[_0x7ad6('0x59')]=0x0;_0xe86718[_0x7ad6('0x46')]=_0x7ad6('0x5a');ut['logger'](_0x7ad6('0x5b'),_0xe86718[_0x7ad6('0x23')]+'\x20is\x20not\x20active');}else{_0xe86718['message']=_0x7ad6('0x5c');ut[_0x7ad6('0x5d')](_0x7ad6('0x5b'),_0xe86718[_0x7ad6('0x23')]+_0x7ad6('0x5e'));}emitCampaignPreview(_0xe86718);}}Preview[_0x7ad6('0xf')][_0x7ad6('0x1e')]=function(){var _0x3a7157=this;setInterval(function(){_0x3a7157[_0x7ad6('0x5f')]();},0x7cf);};Preview[_0x7ad6('0xf')]['syncCampaigns']=function(){var _0x18a3c2=this[_0x7ad6('0x1f')];this['clockClearZombieChannels']+=0x1;for(var _0x1703bb in _0x18a3c2){if(_0x18a3c2[_0x7ad6('0x60')](_0x1703bb)&&(_0x18a3c2[_0x1703bb][_0x7ad6('0x61')]===_0x7ad6('0x6')||_0x18a3c2[_0x1703bb][_0x7ad6('0x61')]==='booked')&&_0x18a3c2[_0x1703bb][_0x7ad6('0x21')]===_0x7ad6('0x22')){if(this[_0x7ad6('0x15')]>0x7){this[_0x7ad6('0x15')]=0x0;this[_0x7ad6('0x62')]();}}if(_0x18a3c2[_0x7ad6('0x60')](_0x1703bb)&&_0x18a3c2[_0x1703bb][_0x7ad6('0x61')]===_0x7ad6('0x6')&&_0x18a3c2[_0x1703bb][_0x7ad6('0x21')]==='outbound'){if(_0x18a3c2[_0x1703bb][_0x7ad6('0x2d')]){this[_0x7ad6('0x63')](_0x18a3c2[_0x1703bb]);this[_0x7ad6('0x64')](_0x18a3c2[_0x1703bb]);}else{notSendMessagesQueue(_0x18a3c2[_0x1703bb]);}}}};Preview[_0x7ad6('0xf')][_0x7ad6('0x65')]=function(_0x28768a){var _0x1d56cb=this;this['sequence'][_0x7ad6('0x66')](function(){if(!_[_0x7ad6('0x67')](_0x1d56cb['actions'][_0x28768a])){loggerAction[_0x7ad6('0x54')](_0x7ad6('0x68'),_0x28768a,_0x7ad6('0x69'),_0x1d56cb[_0x7ad6('0x6a')][_0x28768a]['queue'],_0x7ad6('0x6b'),JSON[_0x7ad6('0x4f')](_0x1d56cb['campaignsPreview'][_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6c')]][_0x7ad6('0x47')]),_0x7ad6('0x6d'),JSON[_0x7ad6('0x4f')](_0x1d56cb[_0x7ad6('0x1f')][_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6c')]][_0x7ad6('0x6e')]),JSON['stringify'](_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6f')]),JSON[_0x7ad6('0x4f')](_['pick'](_0x1d56cb[_0x7ad6('0x6a')][_0x28768a],[_0x7ad6('0x70'),_0x7ad6('0x71'),_0x7ad6('0x72'),_0x7ad6('0x73')])));return ami[_0x7ad6('0x74')]({'action':_0x7ad6('0x75'),'channel':_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x76')]})[_0x7ad6('0x77')](function(_0x259a95){if(_0x259a95[_0x7ad6('0x46')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1d56cb[_0x7ad6('0x6a')][_0x28768a]){ut[_0x7ad6('0x78')](_0x1d56cb[_0x7ad6('0x1f')][_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6c')]],_0x7ad6('0x79'));if(_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6f')]===!![]){ut[_0x7ad6('0x7a')](_0x1d56cb[_0x7ad6('0x1f')][_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6c')]],_0x7ad6('0x79'));ut['loggerError'](_0x7ad6('0x7b')+_0x28768a,_0x1d56cb[_0x7ad6('0x6a')][_0x28768a][_0x7ad6('0x6c')]);}ut[_0x7ad6('0x7c')](_0x7ad6('0x7d')+_0x28768a,_0x1d56cb[_0x7ad6('0x6a')][_0x28768a]['queue']);delete _0x1d56cb[_0x7ad6('0x6a')][_0x28768a];}},0x2328);}});}});};Preview[_0x7ad6('0xf')][_0x7ad6('0x62')]=function(){var _0x19330c=this;loggerAction[_0x7ad6('0x54')]('[action]',_[_0x7ad6('0x7e')](this[_0x7ad6('0x6a')]));for(var _0xb3113f in this[_0x7ad6('0x6a')]){if(_0x19330c[_0x7ad6('0x6a')][_0x7ad6('0x60')](_0xb3113f)){_0x19330c[_0x7ad6('0x65')](_0xb3113f);}}};Preview[_0x7ad6('0xf')][_0x7ad6('0x64')]=function(_0x1e37ce){var _0x1b2713=this;rpcDb[_0x7ad6('0x7f')](_0x1e37ce['id'],ut[_0x7ad6('0x80')](this[_0x7ad6('0x14')]))['then'](function(_0x517911){if(!_[_0x7ad6('0x67')](_0x517911)){for(var _0xe309c=0x0;_0xe309c<_0x517911[_0x7ad6('0x81')];_0xe309c+=0x1){if(ut[_0x7ad6('0x82')](_0x517911[_0xe309c][_0x7ad6('0x83')])<_0x1e37ce[_0x7ad6('0x84')]*0x3c){if(_0x517911[_0xe309c][_0x7ad6('0x85')]&&!_0x517911[_0xe309c]['Agent'][_0x7ad6('0x86')]){_0x1b2713[_0x7ad6('0x87')](_0x517911[_0xe309c]['id'])[_0x7ad6('0x88')](ut['logger2'](_0x7ad6('0x89')))[_0x7ad6('0x77')](ut['logger2'](_0x7ad6('0x89')));}else{rpcDb[_0x7ad6('0x8a')](_0x517911[_0xe309c]['id']);}}else{var _0x58e9ca=new Action(_0x517911[_0xe309c],_0x1e37ce);_0x58e9ca[_0x7ad6('0x8b')]=moment()[_0x7ad6('0x51')](_0x7ad6('0x8c'));_0x1e37ce[_0x7ad6('0x39')]+=0x1;ut['logCustomer'](_0x58e9ca,0x17,_0x7ad6('0x8d'));if(_0x1e37ce[_0x7ad6('0x8e')]){rpcDb[_0x7ad6('0x8f')](ut[_0x7ad6('0x90')](_0x517911[_0xe309c]));rpcDb[_0x7ad6('0x91')](_0x58e9ca,_0x7ad6('0x92'));}else{ut[_0x7ad6('0x93')](_0x58e9ca,0x16,_0x7ad6('0x94'));rpcDb[_0x7ad6('0x91')](_0x58e9ca,_0x7ad6('0x95'));rpcDb[_0x7ad6('0x96')](_0x58e9ca,_0x7ad6('0x95'));}}}}})[_0x7ad6('0x77')](ut[_0x7ad6('0x97')](_0x7ad6('0x98')));};Preview[_0x7ad6('0xf')][_0x7ad6('0x63')]=function(_0x2a2f96){_0x2a2f96[_0x7ad6('0x58')]=!![];if(ut[_0x7ad6('0x99')](_0x2a2f96[_0x7ad6('0x9a')])){_0x2a2f96[_0x7ad6('0x46')]=_0x7ad6('0x9b');}else if(!ut[_0x7ad6('0x9c')](_0x2a2f96[_0x7ad6('0x2d')])){_0x2a2f96[_0x7ad6('0x46')]=_0x7ad6('0x5a');}else if(!this[_0x7ad6('0x9d')](_0x2a2f96['Trunk'])){if(!this[_0x7ad6('0x9d')](_0x2a2f96['TrunkBackup'])){_0x2a2f96[_0x7ad6('0x46')]=_0x7ad6('0x9e');}else{_0x2a2f96[_0x7ad6('0x46')]='ACTIVE';}}else{_0x2a2f96[_0x7ad6('0x46')]='ACTIVE';}emitCampaignPreview(_0x2a2f96);};Preview[_0x7ad6('0xf')][_0x7ad6('0x9f')]=function(_0x1f8777,_0x5b66e3,_0x5a6e08){var _0x2d333f=this;var _0x5da989=this[_0x7ad6('0x6a')][_0x5b66e3];var _0x4a5893=this[_0x7ad6('0x1f')][_0x5da989[_0x7ad6('0x6c')]];var _0x2110a7;if(_0x4a5893){switch(_0x5a6e08){case'1':_0x4a5893[_0x7ad6('0x37')]+=0x1;_0x5da989['countnosuchnumberretry']+=0x1;_0x5da989[_0x7ad6('0xa0')]=ut[_0x7ad6('0xa1')](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x0,_0x7ad6('0xa2'));ami[_0x7ad6('0x20')](_0x7ad6('0xa3'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xa5')));rpcDb['createCustomerHistory'](_0x5da989,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb['createCustomerFinal'](_0x2110a7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5da989[_0x7ad6('0xa9')]>=_0x4a5893[_0x7ad6('0xaa')]){rpcDb[_0x7ad6('0x96')](_0x5da989,_0x7ad6('0xab'));}else{rpcDb[_0x7ad6('0xac')](ut[_0x7ad6('0xad')](_0x5da989,'countnosuchnumberretry',_0x4a5893[_0x7ad6('0xae')]),_0x5da989[_0x7ad6('0xaf')],_0x5da989['activeContact']);}}delete this[_0x7ad6('0x6a')][_0x1f8777[_0x7ad6('0xb0')]];break;case _0x7ad6('0xb1'):var _0x2566e3=moment()[_0x7ad6('0x51')](_0x7ad6('0x8c'));_0x5da989[_0x7ad6('0xb2')]=_0x2566e3;_0x5da989[_0x7ad6('0xb3')]=_0x2566e3;_0x5da989[_0x7ad6('0x6f')]=!![];_0x4a5893[_0x7ad6('0x6e')]+=0x1;logger[_0x7ad6('0x54')](_0x7ad6('0xb4'),_0x5da989[_0x7ad6('0xb5')],'\x20Queue',_0x4a5893['name'],_0x7ad6('0x6d'),_0x4a5893[_0x7ad6('0x6e')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x5da989,_0x7ad6('0xb6'),this[_0x7ad6('0x1f')][_0x5da989[_0x7ad6('0x6c')]]));if(_0x4a5893[_0x7ad6('0xb7')]){ami[_0x7ad6('0x20')](_0x7ad6('0xb8'),ut[_0x7ad6('0xb9')](_0x5da989));}break;case'16':ami[_0x7ad6('0x20')](_0x7ad6('0xba'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xbb'),this['campaignsPreview'][_0x5da989[_0x7ad6('0x6c')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5da989,'complete'));_0x4a5893[_0x7ad6('0x30')]+=0x1;_0x4a5893[_0x7ad6('0x29')]+=0x1;_0x4a5893[_0x7ad6('0xbc')]+=0x1;ut[_0x7ad6('0x7a')](_0x4a5893,'[16]');_0x5da989[_0x7ad6('0xa0')]=ut['totalGlobal'](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x4,'Answer');rpcDb[_0x7ad6('0x91')](_0x5da989,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x7ad6('0x96')](_0x5da989,_0x7ad6('0xbd'));rpcDb[_0x7ad6('0xbe')](_0x5da989);_0x4a5893[_0x7ad6('0x27')]+=_0x5da989['talktime'];_0x4a5893['sumBillable']+=_0x5da989['talktime'];logger['info'](_0x7ad6('0xbf'),_0x5da989['uniqueid'],_0x7ad6('0xc0'),_0x4a5893[_0x7ad6('0x23')],_0x7ad6('0x6d'),_0x4a5893[_0x7ad6('0x6e')]);delete this[_0x7ad6('0x6a')][_0x1f8777['linkedid']];break;case'BUSY':_0x4a5893[_0x7ad6('0x32')]+=0x1;_0x5da989[_0x7ad6('0xc1')]+=0x1;_0x5da989['countglobal']=ut[_0x7ad6('0xa1')](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x5,_0x7ad6('0xc2'));ami['emit'](_0x7ad6('0xc3'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xc4')));rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xc5'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893['dialGlobalMaxRetry']){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb['createCustomerFinal'](_0x2110a7,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5da989[_0x7ad6('0xc1')]>=_0x4a5893['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x5da989,_0x7ad6('0xc5'));}else{rpcDb[_0x7ad6('0xac')](ut[_0x7ad6('0xad')](_0x5da989,_0x7ad6('0xc1'),_0x4a5893[_0x7ad6('0xc6')]),_0x5da989[_0x7ad6('0xaf')],_0x5da989[_0x7ad6('0xc7')]);}}break;case _0x7ad6('0xc8'):_0x4a5893[_0x7ad6('0x36')]+=0x1;_0x5da989['countnoanswerretry']+=0x1;_0x5da989[_0x7ad6('0xa0')]=ut['totalGlobal'](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x3,'NoAnswer');ami['emit'](_0x7ad6('0xc9'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xca')));rpcDb['createCustomerHistory'](_0x5da989,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,'Global');rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xcb'));}else{if(_0x5da989[_0x7ad6('0xcc')]>=_0x4a5893[_0x7ad6('0xcd')]){rpcDb['createCustomerFinal'](_0x5da989,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x7ad6('0xad')](_0x5da989,'countnoanswerretry',_0x4a5893[_0x7ad6('0xce')]),_0x5da989[_0x7ad6('0xaf')],_0x5da989[_0x7ad6('0xc7')]);}}break;case _0x7ad6('0xcf'):_0x4a5893[_0x7ad6('0x33')]+=0x1;_0x5da989[_0x7ad6('0xd0')]+=0x1;_0x5da989[_0x7ad6('0xa0')]=ut[_0x7ad6('0xa1')](_0x5da989);ut['logCustomer'](_0x5da989,0x8,_0x7ad6('0xd1'));ami[_0x7ad6('0x20')](_0x7ad6('0xd2'),ut[_0x7ad6('0xa4')](_0x5da989,'congestion'));rpcDb[_0x7ad6('0x91')](_0x5da989,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut['cloneAction'](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xd3'));}else{if(_0x5da989[_0x7ad6('0xd0')]>=_0x4a5893['dialCongestionMaxRetry']){rpcDb[_0x7ad6('0x96')](_0x5da989,_0x7ad6('0xd4'));}else{rpcDb[_0x7ad6('0xac')](ut[_0x7ad6('0xad')](_0x5da989,'countcongestionretry',_0x4a5893[_0x7ad6('0xc6')]),_0x5da989[_0x7ad6('0xaf')],_0x5da989['activeContact']);}}break;case _0x7ad6('0xd5'):_0x4a5893[_0x7ad6('0xd6')]+=0x1;_0x5da989[_0x7ad6('0xd7')]+=0x1;_0x5da989['countglobal']=ut['totalGlobal'](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x14,_0x7ad6('0xd8'));ami[_0x7ad6('0x20')]('custom:agentreject',ut['buildObj'](_0x5da989,_0x7ad6('0xd9')));rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xda'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893['dialGlobalMaxRetry']){_0x2110a7=ut['cloneAction'](_0x5da989,0x14,_0x7ad6('0xd8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x5da989[_0x7ad6('0xd7')]>=_0x4a5893[_0x7ad6('0xdb')]){rpcDb[_0x7ad6('0x96')](_0x5da989,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7ad6('0xac')](ut[_0x7ad6('0xad')](_0x5da989,'countagentrejectretry',_0x4a5893[_0x7ad6('0xdc')]),_0x5da989[_0x7ad6('0xaf')],_0x5da989[_0x7ad6('0xc7')]);}}break;case _0x7ad6('0xdd'):_0x4a5893[_0x7ad6('0x3b')]+=0x1;_0x5da989[_0x7ad6('0xde')]+=0x1;_0x5da989[_0x7ad6('0xa0')]=ut[_0x7ad6('0xa1')](_0x5da989);ut['logCustomer'](_0x5da989,0xb,_0x7ad6('0xdf'));rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xe0'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xe0'));}else{if(_0x5da989[_0x7ad6('0xe1')]>=_0x4a5893[_0x7ad6('0xe2')]){rpcDb[_0x7ad6('0x96')](_0x5da989,_0x7ad6('0xe0'));}else{rpcDb[_0x7ad6('0xac')](ut[_0x7ad6('0xad')](_0x5da989,_0x7ad6('0xde'),_0x4a5893[_0x7ad6('0xe3')]),_0x5da989['unlockAgent'],_0x5da989[_0x7ad6('0xc7')]);}}break;case'18':_0x4a5893['outboundUnknownCallsDay']+=0x1;_0x5da989[_0x7ad6('0xe4')]+=0x1;_0x5da989['countglobal']=ut['totalGlobal'](_0x5da989);ut['logCustomer'](_0x5da989,0x12,_0x1f8777['cause-txt']||_0x1f8777[_0x7ad6('0xe5')]);ami[_0x7ad6('0x20')](_0x7ad6('0xe6'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xe7')));rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xe8'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut['cloneAction'](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xe8'));}else{rpcDb[_0x7ad6('0x96')](_0x5da989,_0x7ad6('0xe8'));}delete this[_0x7ad6('0x6a')][_0x1f8777['linkedid']];break;case'19':_0x4a5893[_0x7ad6('0x3a')]+=0x1;_0x5da989[_0x7ad6('0xa0')]=ut[_0x7ad6('0xa1')](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0x13,_0x1f8777[_0x7ad6('0xe9')]||_0x1f8777[_0x7ad6('0xe5')]);ami['emit'](_0x7ad6('0xe6'),ut[_0x7ad6('0xa4')](_0x5da989,_0x7ad6('0xe7')));rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xea'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xea'));}else{rpcDb[_0x7ad6('0x96')](_0x5da989,'[callProgressDetectingCustomer][machine]');}delete this[_0x7ad6('0x6a')][_0x1f8777[_0x7ad6('0xb0')]];break;default:if(_0x5da989[_0x7ad6('0x6f')]){ut['decrementTalkink'](_0x4a5893,_0x7ad6('0xeb'));ut[_0x7ad6('0x7c')](_0x7ad6('0xec')+_0x4a5893[_0x7ad6('0x23')],_0x1f8777);}_0x4a5893[_0x7ad6('0x3a')]+=0x1;_0x5da989['countglobal']=ut[_0x7ad6('0xa1')](_0x5da989);ut[_0x7ad6('0x93')](_0x5da989,0xc,_0x1f8777[_0x7ad6('0xe9')]||_0x1f8777[_0x7ad6('0xe5')]);rpcDb[_0x7ad6('0x91')](_0x5da989,_0x7ad6('0xed'));if(ut[_0x7ad6('0xa1')](_0x5da989)>=_0x4a5893[_0x7ad6('0xa6')]){_0x2110a7=ut[_0x7ad6('0xa7')](_0x5da989,0xf,_0x7ad6('0xa8'));rpcDb[_0x7ad6('0x96')](_0x2110a7,_0x7ad6('0xee'));}else{rpcDb[_0x7ad6('0x96')](_0x5da989,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x7ad6('0x6a')][_0x1f8777[_0x7ad6('0xb0')]];}if(!(_0x5da989[_0x7ad6('0x6f')]&&_0x5a6e08==='16')){ut[_0x7ad6('0x78')](_0x4a5893,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x5da989[_0x7ad6('0xb5')],_0x7ad6('0xc0'),_0x4a5893[_0x7ad6('0x23')],'originated:\x20',_0x4a5893[_0x7ad6('0x47')]);}if(_0x5a6e08!==_0x7ad6('0xb1')){delete this[_0x7ad6('0x6a')][_0x1f8777[_0x7ad6('0xb0')]];delete this[_0x7ad6('0x6a')][_0x1f8777[_0x7ad6('0xef')]];}}};Preview[_0x7ad6('0xf')][_0x7ad6('0xf0')]=function(_0x4d9f63,_0x2dfd2e,_0x5cf569){if(_[_0x7ad6('0xf1')](_0x2dfd2e)&&_0x7ad6('0xf2')!==typeof _0x2dfd2e){return;}if(_[_0x7ad6('0xf1')](_0x5cf569)&&_0x7ad6('0xf2')!==typeof _0x5cf569){return;}switch(_0x5cf569[_0x7ad6('0xf3')]){case'0':ut[_0x7ad6('0xf4')](_0x4d9f63,0x0,_0x7ad6('0xa2'));rpcDb['createAgentHistory'](_0x4d9f63,_0x7ad6('0xf5'));break;case'3':ut['logAgent'](_0x4d9f63,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x4d9f63,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x7ad6('0xf4')](_0x4d9f63,0x5,'Busy');rpcDb[_0x7ad6('0xf6')](_0x4d9f63,_0x7ad6('0xf7'));break;case'8':ut['logAgent'](_0x4d9f63,0x8,_0x7ad6('0xd1'));rpcDb[_0x7ad6('0xf6')](_0x4d9f63,_0x7ad6('0xf8'));break;case'22':ut[_0x7ad6('0xf4')](_0x4d9f63,0x16,'AnswerAGI');rpcDb[_0x7ad6('0xf6')](_0x4d9f63,_0x7ad6('0xf9'));break;default:ut[_0x7ad6('0xf4')](_0x4d9f63,0xc,_0x5cf569[_0x7ad6('0xf3')]);rpcDb['createAgentHistory'](_0x4d9f63,_0x7ad6('0xf8'));}ut['updateOriginated'](_0x2dfd2e,_0x7ad6('0xfa'));logger['info'](_0x7ad6('0xfb'),_0x4d9f63[_0x7ad6('0xb5')],_0x7ad6('0xc0'),_0x2dfd2e[_0x7ad6('0x23')],_0x7ad6('0x6b'),_0x2dfd2e['originated']);delete this['actions'][_0x4d9f63[_0x7ad6('0xb5')]];};Preview[_0x7ad6('0xf')]['checkInBlack']=function(_0x319273,_0x3ae740,_0x2c018b,_0x46d210,_0x287ac4){var _0x2f8b92=this;return new BPromise(function(_0xf76cb9,_0x20888c){if(_[_0x7ad6('0x67')](_0x3ae740)||_['isNil'](_0x3ae740[_0x7ad6('0xfc')])||_[_0x7ad6('0x67')](_0x3ae740['Contact'][_0x7ad6('0xfd')])||_[_0x7ad6('0x67')](_0x3ae740[_0x7ad6('0x72')])){_0x20888c(ut[_0x7ad6('0x46')]('Contact\x20is\x20undefined',_0x46d210,_0x287ac4));return;}var _0x54ee04=uuid['v4']();var _0x510b24=_0x2f8b92[_0x7ad6('0x1f')][_0x3ae740[_0x7ad6('0x69')][_0x7ad6('0x23')]];var _0x538e48=_0x2c018b?_0x2f8b92['agents'][_0x2c018b]['id']:undefined;_0x2f8b92[_0x7ad6('0x6a')][_0x54ee04]=new Action(_0x3ae740,_0x510b24,_0x54ee04,_0x2c018b,_0x538e48);var _0x386e64=_0x2f8b92['actions'][_0x54ee04];_0x386e64[_0x7ad6('0xaf')]=_0x46d210;_0x386e64[_0x7ad6('0xc7')]=_0x287ac4;_0x386e64[_0x7ad6('0xfe')]=_0x2c018b;if(_[_0x7ad6('0xff')](_0x319273)){_0x2f8b92[_0x7ad6('0x100')](_0x386e64,_0x510b24,_0x3ae740,_0x2c018b)['then'](function(_0x4a6ed2){logger[_0x7ad6('0x54')](_0x7ad6('0x101'),_0x7ad6('0x102')+_0x386e64['queue']+_0x7ad6('0x103')+_0x386e64[_0x7ad6('0x104')],JSON[_0x7ad6('0x4f')](_0x4a6ed2));ami[_0x7ad6('0x20')](_0x7ad6('0x105'),ut[_0x7ad6('0xa4')](_0x386e64,_0x7ad6('0x106'),_0x2f8b92[_0x7ad6('0x1f')][_0x386e64['queue']]));_0xf76cb9(ut['message'](_0x7ad6('0x107')));})[_0x7ad6('0x77')](function(_0x11dc9d){ut[_0x7ad6('0x5d')](_0x7ad6('0x108'),_0x11dc9d);_0x20888c(ut['message'](_0x7ad6('0x109'),_0x46d210,_0x287ac4));});}else{_0x510b24[_0x7ad6('0x31')]+=0x1;ut['logBlacklist'](_0x386e64);rpcDb['createHistory'](_0x386e64,_0x7ad6('0x10a'));delete _0x2f8b92[_0x7ad6('0x6a')][_0x54ee04];_0x20888c(ut[_0x7ad6('0x46')](_0x7ad6('0x10b'),_0x46d210,_0x287ac4));}});};Preview[_0x7ad6('0xf')][_0x7ad6('0x9d')]=function(_0x4af1c4){return!_[_0x7ad6('0x67')](_0x4af1c4)&&!_[_0x7ad6('0x67')](_0x4af1c4['name'])&&!_[_0x7ad6('0x67')](_0x4af1c4[_0x7ad6('0x4c')])&&_0x4af1c4['active']&&!_[_0x7ad6('0x67')](this[_0x7ad6('0x13')][util[_0x7ad6('0x51')](_0x7ad6('0x10c'),_0x4af1c4[_0x7ad6('0x23')])])&&!_[_0x7ad6('0x67')](this['trunks'][util['format']('SIP/%s',_0x4af1c4[_0x7ad6('0x23')])][_0x7ad6('0x75')])&&(this['trunks'][util[_0x7ad6('0x51')](_0x7ad6('0x10c'),_0x4af1c4[_0x7ad6('0x23')])][_0x7ad6('0x75')]===_0x7ad6('0x10d')||this['trunks'][util[_0x7ad6('0x51')](_0x7ad6('0x10c'),_0x4af1c4[_0x7ad6('0x23')])]['status']===_0x7ad6('0x10e'));};Preview[_0x7ad6('0xf')][_0x7ad6('0x87')]=function(_0x231fb8,_0x3c9734){var _0x3ab59c=this;return new BPromise(function(_0x2d9026,_0x2d3bd7){_0x3ab59c['execRun'](_0x231fb8,_0x3c9734)[_0x7ad6('0x88')](function(_0x3d02d6){_0x2d9026(_[_0x7ad6('0x10f')](_0x3d02d6,[_0x7ad6('0x46')]));})[_0x7ad6('0x77')](function(_0x4ea34d){if(_0x4ea34d[_0x7ad6('0x110')]){rpcDb[_0x7ad6('0x111')](_0x231fb8);}if(_0x4ea34d['active']){rpcDb[_0x7ad6('0x8a')](_0x231fb8);}_0x2d3bd7(_['pick'](_0x4ea34d,[_0x7ad6('0x46')]));});});};Preview[_0x7ad6('0xf')][_0x7ad6('0x112')]=function(_0x1188bd,_0x448f4d){var _0x49ef63=this;return new BPromise(function(_0x13347f,_0x39df34){var _0x106394,_0x3e3fd2;rpcDb[_0x7ad6('0x113')](_0x1188bd)[_0x7ad6('0x88')](function(_0x2befde){if(!_[_0x7ad6('0x67')](_0x2befde[0x0])){_0x3e3fd2=_0x2befde[0x0][_0x7ad6('0x114')]?![]:!![];_0x106394=_0x2befde[0x0][_0x7ad6('0x114')]?!![]:![];_0x106394=_0x448f4d?!![]:_0x106394;}var _0x297aba=_0x49ef63[_0x7ad6('0x115')](_0x2befde);if(_0x297aba[_0x7ad6('0x116')]){rpcDb[_0x7ad6('0x117')](_[_0x7ad6('0x10f')](_0x2befde[0x0],['VoiceQueueId','Contact.phone']))[_0x7ad6('0x88')](function(_0x418eec){_0x49ef63['checkInBlack'](_0x418eec,_0x2befde[0x0],_0x448f4d,_0x3e3fd2,_0x106394)[_0x7ad6('0x88')](function(_0x3acfee){_0x13347f(_0x3acfee);})[_0x7ad6('0x77')](function(_0x52ca2f){_0x39df34(_0x52ca2f);});})[_0x7ad6('0x77')](function(_0x26b751){ut[_0x7ad6('0x5d')](_0x7ad6('0x118'),_0x26b751);_0x39df34(ut[_0x7ad6('0x46')]('Call\x20unsuccessful',_0x3e3fd2,_0x106394));});}else{_0x39df34(ut[_0x7ad6('0x46')](_0x297aba['message'],_0x3e3fd2,_0x106394));}})[_0x7ad6('0x77')](function(_0x278cce){ut['logger'](_0x7ad6('0x119'),_0x278cce);_0x39df34(ut[_0x7ad6('0x46')](_0x7ad6('0x11a'),![],!![]));});});};Preview[_0x7ad6('0xf')]['validateContact']=function(_0x1d958c){if(_[_0x7ad6('0x67')](_0x1d958c)||_['isEmpty'](_0x1d958c)||!_[_0x7ad6('0x67')](_0x1d958c[0x0]['Agent'])&&_['isNil'](_0x1d958c[0x0]['Agent'][_0x7ad6('0x23')])){ut[_0x7ad6('0x5d')](_0x7ad6('0x11b'),_0x1d958c);return{'isValid':![],'message':_0x7ad6('0x11c')};}var _0x441e13=this[_0x7ad6('0x1f')][_0x1d958c[0x0][_0x7ad6('0x69')][_0x7ad6('0x23')]];_0x441e13[_0x7ad6('0x46')]='ACTIVE';if(_['isNil'](_0x441e13)){ut[_0x7ad6('0x5d')]('[Preview][validateContact][Empty\x20Campaign]',_0x441e13);return{'isValid':![],'message':_0x7ad6('0x11d')};}if(!this[_0x7ad6('0x9d')](_0x441e13[_0x7ad6('0x4b')])){ut[_0x7ad6('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x441e13[_0x7ad6('0x23')]+_0x7ad6('0x11e'));if(!this['isTrunkReachable'](_0x441e13[_0x7ad6('0x11f')])){ut['logger'](_0x7ad6('0x120'),_0x441e13[_0x7ad6('0x23')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7ad6('0x121')};}}if(!ut[_0x7ad6('0x9c')](_0x441e13[_0x7ad6('0x2d')])){ut[_0x7ad6('0x5d')](_0x7ad6('0x122'),_0x441e13[_0x7ad6('0x23')]+_0x7ad6('0x123'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x441e13['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x7ad6('0x124')};};Preview['prototype'][_0x7ad6('0x100')]=function(_0x194ac8,_0x5eaebf,_0x46b3f5,_0x5e19c8){var _0xc23d2b=this;return new BPromise(function(_0x3208b5,_0x28c98c){var _0x13df21=_0x194ac8[_0x7ad6('0xb5')];var _0x4da215=_0xc23d2b[_0x7ad6('0x9d')](_0x5eaebf['Trunk'])?util['format'](_0x7ad6('0x125'),_0x5eaebf[_0x7ad6('0x4b')][_0x7ad6('0x23')],_['isNil'](_0x5eaebf['dialPrefix'])?'':_0x5eaebf['dialPrefix'][_0x7ad6('0x126')]()||'',_0x5eaebf[_0x7ad6('0x127')]>0x0?_0x46b3f5[_0x7ad6('0xfc')][_0x7ad6('0xfd')][_0x7ad6('0x128')](_0x5eaebf['dialCutDigit']):_0x46b3f5[_0x7ad6('0xfc')]['phone']):util[_0x7ad6('0x51')](_0x7ad6('0x125'),_[_0x7ad6('0x67')](_0x5eaebf['TrunkBackup'])?_0x5eaebf[_0x7ad6('0x4b')][_0x7ad6('0x23')]:_0x5eaebf[_0x7ad6('0x11f')][_0x7ad6('0x23')],_['isNil'](_0x5eaebf[_0x7ad6('0x129')])?'':_0x5eaebf[_0x7ad6('0x129')]['trim']()||'',_0x5eaebf['dialCutDigit']>0x0?_0x46b3f5['Contact'][_0x7ad6('0xfd')]['substring'](_0x5eaebf['dialCutDigit']):_0x46b3f5['Contact'][_0x7ad6('0xfd')]);var _0x41ce6f=_0xc23d2b[_0x7ad6('0x9d')](_0x5eaebf[_0x7ad6('0x4b')])?ut[_0x7ad6('0x12a')](_0x5eaebf[_0x7ad6('0x4b')][_0x7ad6('0x4d')],_0x5eaebf[_0x7ad6('0x2e')],_0x5eaebf[_0x7ad6('0x12b')]>0x0?ut['getCallerIdRandom'](_0x5eaebf[_0x7ad6('0x12c')],_0x5eaebf[_0x7ad6('0x12b')]):_0x5eaebf[_0x7ad6('0x12c')]):ut[_0x7ad6('0x12a')](_[_0x7ad6('0x67')](_0x5eaebf[_0x7ad6('0x11f')])?_0x5eaebf[_0x7ad6('0x4b')][_0x7ad6('0x4d')]:_0x5eaebf[_0x7ad6('0x11f')][_0x7ad6('0x4d')],_0x5eaebf[_0x7ad6('0x2e')],_0x5eaebf[_0x7ad6('0x12b')]>0x0?ut[_0x7ad6('0x12d')](_0x5eaebf[_0x7ad6('0x12c')],_0x5eaebf['dialRandomLastDigitCallerIdNumber']):_0x5eaebf[_0x7ad6('0x12c')]);if(_0x41ce6f){_0x194ac8[_0x7ad6('0x12e')]=ut['extractCalleridName'](_0x41ce6f);_0x194ac8[_0x7ad6('0x12f')]=ut['extractCalleridNumber'](_0x41ce6f);}var _0x69723e=ut[_0x7ad6('0x130')](_0x5eaebf,_0x46b3f5,_0x4da215,_0x41ce6f,_0x13df21,_0x194ac8);_[_0x7ad6('0x131')](_0x194ac8,ut['toLowerVariables'](_0x69723e));_0x194ac8[_0x7ad6('0x8b')]=moment()[_0x7ad6('0x51')](_0x7ad6('0x8c'));ami[_0x7ad6('0x74')](ut[_0x7ad6('0x132')](_0x194ac8,_0x5eaebf,_0x69723e,_0x194ac8[_0x7ad6('0xc7')],_0x5e19c8))[_0x7ad6('0x88')](function(_0x557493){var _0x1d6b84=_0x194ac8[_0x7ad6('0x133')];if(!_[_0x7ad6('0x67')](_0x1d6b84)){if(!_[_0x7ad6('0x67')](_0xc23d2b[_0x7ad6('0x14')][_0x1d6b84])){_0xc23d2b[_0x7ad6('0x14')][_0x1d6b84]['destconnectedlinenum']=_0x194ac8[_0x7ad6('0x134')];emit(util[_0x7ad6('0x51')](_0x7ad6('0x135'),_0xc23d2b[_0x7ad6('0x14')][_0x1d6b84][_0x7ad6('0x23')]),_0x7ad6('0x136'),{'destaccountcode':_0xc23d2b[_0x7ad6('0x14')][_0x1d6b84]['accountcode'],'destconnectedlinenum':_0x194ac8['calleridnum']});}}_0x5eaebf['originated']+=0x1;logger[_0x7ad6('0x54')](_0x7ad6('0x137'),_0x13df21,_0x7ad6('0xc0'),_0x5eaebf[_0x7ad6('0x23')],_0x7ad6('0x6b'),_0x5eaebf[_0x7ad6('0x47')]);_0x3208b5(_0x557493);})[_0x7ad6('0x77')](function(_0x1a16ca){ut['logAgent'](_0x194ac8,0xe,_0x7ad6('0x138'));rpcDb['createAgentHistory'](_0x194ac8,_0x7ad6('0x139'));_0x28c98c(_0x1a16ca);});});};Preview['prototype'][_0x7ad6('0x1c')]=function(_0x119dc8){if(this['actions'][_0x119dc8[_0x7ad6('0xb0')]]){this[_0x7ad6('0x6a')][_0x119dc8['linkedid']]['channel']=_0x119dc8[_0x7ad6('0x76')];}};Preview[_0x7ad6('0xf')][_0x7ad6('0x13a')]=function(_0x3892cd){var _0x460fc9=this;var _0x3afd1a=this[_0x7ad6('0x6a')][_0x3892cd[_0x7ad6('0x13b')]];if(_0x3afd1a){if(_0x3afd1a[_0x7ad6('0xfe')]&&this[_0x7ad6('0x14')][_0x3afd1a[_0x7ad6('0xfe')]]){ut[_0x7ad6('0x13c')](_0x3afd1a,this[_0x7ad6('0x14')][_0x3afd1a[_0x7ad6('0xfe')]][_0x7ad6('0x23')],this[_0x7ad6('0x14')][_0x3afd1a[_0x7ad6('0xfe')]]['id']);}var _0x5f4fa3=_[_0x7ad6('0x13d')](_0x3afd1a);_0x5f4fa3[_0x7ad6('0xb2')]=moment()[_0x7ad6('0x51')](_0x7ad6('0x8c'));var _0x361be5=_0x460fc9[_0x7ad6('0x1f')][_0x3afd1a[_0x7ad6('0x6c')]];if(ut[_0x7ad6('0x13e')](_0x3892cd[_0x7ad6('0x13f')])){if(_0x3afd1a['unlockAgent']){rpcDb[_0x7ad6('0x111')](_0x3afd1a[_0x7ad6('0x104')]);}if(_0x3afd1a['activeContact']){rpcDb['disableContact'](_0x3afd1a['idContact']);}ami[_0x7ad6('0x20')](_0x7ad6('0x140'),ut[_0x7ad6('0xa4')](_0x3afd1a,_0x7ad6('0x141'),this[_0x7ad6('0x1f')][_0x3afd1a[_0x7ad6('0x6c')]]));this[_0x7ad6('0xf0')](_0x5f4fa3,_0x361be5,_0x3892cd);}else{_0x3afd1a['starttime']=moment()[_0x7ad6('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x7ad6('0xf4')](_0x5f4fa3,0x4,_0x7ad6('0x142'));rpcDb[_0x7ad6('0xf6')](_0x5f4fa3,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x7ad6('0xf')][_0x7ad6('0x19')]=function(_0xabaa2e){var _0xf33fce=this;var _0x4e34d8=this[_0x7ad6('0x6a')][_0xabaa2e[_0x7ad6('0xb0')]];var _0x5e7d53;if(_0x4e34d8){_0x5e7d53=this[_0x7ad6('0x1f')][_0x4e34d8[_0x7ad6('0x6c')]];logger[_0x7ad6('0x54')](_0x7ad6('0x143'),_0xabaa2e['linkedid'],_0x7ad6('0xc0'),_0x5e7d53[_0x7ad6('0x23')],'pTalking:\x20',_0x5e7d53['pTalking']);}if(this['actions'][_0xabaa2e[_0x7ad6('0xb0')]]&&_0xabaa2e[_0x7ad6('0xb0')]!==_0xabaa2e[_0x7ad6('0xb5')]){if(_0xabaa2e[_0x7ad6('0x144')]==='16'&&this[_0x7ad6('0x6a')][_0xabaa2e[_0x7ad6('0xb0')]][_0x7ad6('0x6f')]){this['callProgressDetectingCustomer'](_0xabaa2e,_0xabaa2e['linkedid'],_0xabaa2e[_0x7ad6('0x144')]);}else if(this[_0x7ad6('0x6a')][_0xabaa2e[_0x7ad6('0xb0')]]['dialAnswer']){logger[_0x7ad6('0x54')](_0x7ad6('0x145'),_0xabaa2e['linkedid'],_0xabaa2e[_0x7ad6('0x144')],_0x7ad6('0xc0'),_0x5e7d53[_0x7ad6('0x23')],_0x7ad6('0x6d'),_0x5e7d53[_0x7ad6('0x6e')]);this[_0x7ad6('0x9f')](_0xabaa2e,_0xabaa2e[_0x7ad6('0xb0')],_0xabaa2e[_0x7ad6('0x144')]);}}else if(_0x4e34d8&&_[_0x7ad6('0x67')](_0x4e34d8[_0x7ad6('0x146')])&&_0x5e7d53['dialQueueProject']&&_0xabaa2e[_0x7ad6('0xb0')]===_0xabaa2e['uniqueid']&&_['isNil'](_0xabaa2e['reason'])&&_0xabaa2e[_0x7ad6('0x144')]==='16'&&_0xabaa2e[_0x7ad6('0x147')]==='6'&&_[_0x7ad6('0xf1')](_0x4e34d8[_0x7ad6('0x148')])){if(_0x4e34d8[_0x7ad6('0xaf')]){rpcDb[_0x7ad6('0x111')](_0x4e34d8['idContact']);}if(_0x4e34d8[_0x7ad6('0xc7')]){rpcDb['disableContact'](_0x4e34d8[_0x7ad6('0x104')]);}_0xabaa2e[_0x7ad6('0xf3')]='22';this[_0x7ad6('0xf0')](_0x4e34d8,_0x5e7d53,_0xabaa2e);}else if(_0x4e34d8&&_0x4e34d8['transfer']){if(_0xabaa2e[_0x7ad6('0x144')]==='16'&&this[_0x7ad6('0x6a')][_0xabaa2e[_0x7ad6('0xb0')]][_0x7ad6('0x6f')]){logger['info'](_0x7ad6('0x149'),_0xabaa2e[_0x7ad6('0xb0')],_0xabaa2e['cause'],_0x7ad6('0xc0'),_0x5e7d53['name'],_0x7ad6('0x6d'),_0x5e7d53['pTalking']);this[_0x7ad6('0x9f')](_0xabaa2e,_0xabaa2e['linkedid'],_0xabaa2e[_0x7ad6('0x144')]);}else if(this['actions'][_0xabaa2e['linkedid']][_0x7ad6('0x6f')]){logger[_0x7ad6('0x54')](_0x7ad6('0x145'),_0xabaa2e[_0x7ad6('0xb0')],_0xabaa2e[_0x7ad6('0x144')],_0x7ad6('0xc0'),_0x5e7d53[_0x7ad6('0x23')],_0x7ad6('0x6d'),_0x5e7d53[_0x7ad6('0x6e')]);this[_0x7ad6('0x9f')](_0xabaa2e,_0xabaa2e[_0x7ad6('0xb0')],_0xabaa2e[_0x7ad6('0x144')]);}}};Preview['prototype'][_0x7ad6('0x14a')]=function(_0x411265){if(this[_0x7ad6('0x6a')][_0x411265[_0x7ad6('0xef')]]&&_0x411265[_0x7ad6('0xef')]!==_0x411265[_0x7ad6('0x14b')]){this[_0x7ad6('0x9f')](_0x411265,_0x411265[_0x7ad6('0xef')],_0x411265['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x3cce73){if(this['actions'][_0x3cce73['linkedid']]&&_0x3cce73['linkedid']!==_0x3cce73[_0x7ad6('0xb5')]&&!this[_0x7ad6('0x6a')][_0x3cce73[_0x7ad6('0xb0')]][_0x7ad6('0x6f')]){if(_0x3cce73['cause']==='1'){this[_0x7ad6('0x9f')](_0x3cce73,_0x3cce73['linkedid'],_0x3cce73[_0x7ad6('0x144')]);}}};Preview[_0x7ad6('0xf')][_0x7ad6('0x14c')]=function(_0x8c936a,_0x274ae7,_0x368163){if(this[_0x7ad6('0x6a')][_0x8c936a]){if(_[_0x7ad6('0x67')](this[_0x7ad6('0x6a')][_0x8c936a][_0x7ad6('0x14d')])){this[_0x7ad6('0x6a')][_0x8c936a][_0x7ad6('0x14d')]={};}this[_0x7ad6('0x6a')][_0x8c936a][_0x7ad6('0x14d')][_0x274ae7]=_0x368163;}};Preview[_0x7ad6('0xf')][_0x7ad6('0x14e')]=function(_0x38f500){try{if(!_[_0x7ad6('0x67')](_0x38f500)){if(ut['filterKey'](_['keys'](_0x38f500[_0x7ad6('0x14f')])[0x0])){this[_0x7ad6('0x14c')](_0x38f500[_0x7ad6('0xb5')],_[_0x7ad6('0x150')](_0x38f500[_0x7ad6('0x14f')])[0x0],_0x38f500[_0x7ad6('0x151')]);}}}catch(_0x2a7b7b){logger[_0x7ad6('0x152')]('[syncVarSet][Preview]',util[_0x7ad6('0x153')](_0x2a7b7b,{'showHidden':![],'depth':null}));}};Preview[_0x7ad6('0xf')][_0x7ad6('0x154')]=function(_0x6f9c0){if(_0x6f9c0){if(this[_0x7ad6('0x6a')][_0x6f9c0['transfertargetlinkedid']]){this[_0x7ad6('0x6a')][_0x6f9c0['transfertargetlinkedid']]['transfer']=!![];}}};Preview['prototype'][_0x7ad6('0x155')]=function(_0x1901e8){if(_0x1901e8){if(this[_0x7ad6('0x6a')][_0x1901e8[_0x7ad6('0x156')]]){this[_0x7ad6('0x6a')][_0x1901e8[_0x7ad6('0x156')]][_0x7ad6('0x148')]=!![];}}};module[_0x7ad6('0x157')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 4761602..3f4f5bc 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 _0x430d=['xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten'];(function(_0x3453c7,_0x52a272){var _0x25b73d=function(_0x2db061){while(--_0x2db061){_0x3453c7['push'](_0x3453c7['shift']());}};_0x25b73d(++_0x52a272);}(_0x430d,0x112));var _0xd430=function(_0x4ad78a,_0x1dbc74){_0x4ad78a=_0x4ad78a-0x0;var _0xec43a0=_0x430d[_0x4ad78a];return _0xec43a0;};'use strict';var util=require('util');var BPromise=require(_0xd430('0x0'));var logger=require('../../../config/logger')(_0xd430('0x1'));var _=require(_0xd430('0x2'));var cmHopper=require(_0xd430('0x3'));var cmHopperFinal=require(_0xd430('0x4'));var cmHopperHistory=require(_0xd430('0x5'));var cmHopperBlack=require(_0xd430('0x6'));var voiceQueueRt=require(_0xd430('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xd430('0x8'));function loggerCatch(_0x49ce9f){return function(_0x3fd26a){logger[_0xd430('0x9')](_0x49ce9f,util[_0xd430('0xa')](_0x3fd26a,{'showHidden':![],'depth':null}));};}function create(_0x3dc99e){return BPromise[_0xd430('0xb')]()['then'](cmHopperHistory[_0xd430('0xc')](_0x3dc99e))[_0xd430('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2c8af4){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](agentReportPreview[_0xd430('0xc')](_0x2c8af4))[_0xd430('0xd')](loggerCatch(_0xd430('0xf')));}function moveContact(_0x52a05f){return BPromise['resolve']()[_0xd430('0xe')](cmHopper['moveContactManagedDialer'](_0x52a05f,!![]))[_0xd430('0xd')](loggerCatch(_0xd430('0x10')));}exports[_0xd430('0x11')]=function(_0x239df6){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopperBlack['checkIsBlackList'](_0x239df6))[_0xd430('0xd')](loggerCatch(_0xd430('0x12')));};exports['getContactPreview']=function(_0x4cdb13){return BPromise['resolve']()[_0xd430('0xe')](cmHopper[_0xd430('0x13')](_0x4cdb13))[_0xd430('0xd')](loggerCatch(_0xd430('0x14')));};exports[_0xd430('0xc')]=function(_0x422a94,_0x24c66c){create(_0x422a94)[_0xd430('0xd')](loggerCatch(_0x24c66c));moveContact(_0x422a94)[_0xd430('0xd')](loggerCatch(_0x24c66c));};exports['createAgentHistory']=function(_0x508075,_0x4b24a4){createAgent(_0x508075)[_0xd430('0xd')](loggerCatch(_0x4b24a4));};exports[_0xd430('0x15')]=function(_0x23b327,_0x1d8abc){create(_0x23b327)['catch'](loggerCatch(_0x1d8abc));};exports[_0xd430('0x16')]=function(_0x37bc3b,_0x18faca){moveContact(_0x37bc3b)[_0xd430('0xd')](loggerCatch(_0x18faca));};exports['rescheduleContact']=function(_0x2a099d,_0x267ff4,_0x1a5215){if(_0x267ff4){_0x2a099d[_0xd430('0x17')]=null;}if(_0x1a5215){_0x2a099d[_0xd430('0x18')]=![];}return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x19')](_0x2a099d))[_0xd430('0xd')](loggerCatch(_0xd430('0x1a')));};exports[_0xd430('0x1b')]=function(_0x4c05b7){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x1b')](_0x4c05b7))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xd430('0x1c')]=function(_0x2a960d){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2a960d,0x1))[_0xd430('0xd')](loggerCatch(_0xd430('0x1d')));};exports[_0xd430('0x1e')]=function(_0x3c173f){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x1c')]({'active':![]},_0x3c173f,0x1))[_0xd430('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x38da34){var _0x5545a7={};_0x5545a7[_0xd430('0x1f')]=_0x38da34['type'];_0x5545a7[_0xd430('0x20')]=_0x38da34[_0xd430('0x20')];_0x5545a7[_0xd430('0x21')]=_0x38da34[_0xd430('0x21')];_0x5545a7[_0xd430('0x22')]=_0x38da34[_0xd430('0x22')];_0x5545a7['queue']=_0x38da34[_0xd430('0x23')];_0x5545a7[_0xd430('0x24')]=_0x38da34[_0xd430('0x25')];_0x5545a7['queuecallerleaveAt']=_0x38da34[_0xd430('0x25')];_0x5545a7['queuecallercomplete']=0x1;_0x5545a7[_0xd430('0x26')]=_0x38da34['endtime'];_0x5545a7[_0xd430('0x27')]=_0x38da34[_0xd430('0x28')];_0x5545a7[_0xd430('0x29')]=_0xd430('0x2a');_0x5545a7[_0xd430('0x2b')]=_0xd430('0x2c');_0x5545a7[_0xd430('0x2d')]=0x0;_0x5545a7['assigned']=0x1;_0x5545a7['lastAssignedTo']=_0x38da34[_0xd430('0x28')];_0x5545a7[_0xd430('0x2e')]=_0xd430('0x2f');return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](voiceQueueReport[_0xd430('0x30')](_0x5545a7))[_0xd430('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xd430('0x31')]=function(_0x19594e,_0x32d416){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper[_0xd430('0x31')](_0x19594e,_0x32d416))[_0xd430('0xd')](loggerCatch(_0xd430('0x32')));};exports[_0xd430('0x33')]=function(_0x58205a){return BPromise[_0xd430('0xb')]()[_0xd430('0xe')](cmHopper['rescheduleContact'](_0x58205a,!![],!![]))['catch'](loggerCatch(_0xd430('0x34')));}; \ No newline at end of file +var _0x380e=['../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory'];(function(_0x41cc5f,_0x488a1c){var _0x27b33a=function(_0x19350b){while(--_0x19350b){_0x41cc5f['push'](_0x41cc5f['shift']());}};_0x27b33a(++_0x488a1c);}(_0x380e,0xd2));var _0xe380=function(_0x1b0c66,_0x721990){_0x1b0c66=_0x1b0c66-0x0;var _0x185648=_0x380e[_0x1b0c66];return _0x185648;};'use strict';var util=require('util');var BPromise=require(_0xe380('0x0'));var logger=require(_0xe380('0x1'))(_0xe380('0x2'));var _=require('lodash');var cmHopper=require(_0xe380('0x3'));var cmHopperFinal=require(_0xe380('0x4'));var cmHopperHistory=require(_0xe380('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xe380('0x6'));var agentReportPreview=require(_0xe380('0x7'));var voiceQueueReport=require(_0xe380('0x8'));function loggerCatch(_0x2b90ee){return function(_0x4f0ea4){logger[_0xe380('0x9')](_0x2b90ee,util[_0xe380('0xa')](_0x4f0ea4,{'showHidden':![],'depth':null}));};}function create(_0x2da16e){return BPromise[_0xe380('0xb')]()['then'](cmHopperHistory['createHistory'](_0x2da16e))[_0xe380('0xc')](loggerCatch(_0xe380('0xd')));}function createAgent(_0xd6d6dc){return BPromise['resolve']()[_0xe380('0xe')](agentReportPreview['createHistory'](_0xd6d6dc))[_0xe380('0xc')](loggerCatch(_0xe380('0xd')));}function moveContact(_0x2534fd){return BPromise[_0xe380('0xb')]()['then'](cmHopper[_0xe380('0xf')](_0x2534fd,!![]))[_0xe380('0xc')](loggerCatch(_0xe380('0x10')));}exports[_0xe380('0x11')]=function(_0x6691c1){return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](cmHopperBlack[_0xe380('0x11')](_0x6691c1))[_0xe380('0xc')](loggerCatch(_0xe380('0x12')));};exports[_0xe380('0x13')]=function(_0x51db88){return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](cmHopper[_0xe380('0x13')](_0x51db88))[_0xe380('0xc')](loggerCatch(_0xe380('0x14')));};exports[_0xe380('0x15')]=function(_0x2e4f57,_0x261d3f){create(_0x2e4f57)[_0xe380('0xc')](loggerCatch(_0x261d3f));moveContact(_0x2e4f57)['catch'](loggerCatch(_0x261d3f));};exports[_0xe380('0x16')]=function(_0x44f92e,_0x461f02){createAgent(_0x44f92e)['catch'](loggerCatch(_0x461f02));};exports[_0xe380('0x17')]=function(_0x250d95,_0x49a6cd){create(_0x250d95)[_0xe380('0xc')](loggerCatch(_0x49a6cd));};exports['createCustomerFinal']=function(_0x4be9df,_0x30ab45){moveContact(_0x4be9df)[_0xe380('0xc')](loggerCatch(_0x30ab45));};exports[_0xe380('0x18')]=function(_0x4be835,_0xffa772,_0x4a7b8d){if(_0xffa772){_0x4be835[_0xe380('0x19')]=null;}if(_0x4a7b8d){_0x4be835[_0xe380('0x1a')]=![];}return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](cmHopper['rescheduleContact'](_0x4be835))[_0xe380('0xc')](loggerCatch(_0xe380('0x1b')));};exports[_0xe380('0x1c')]=function(_0x2e83ff){return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](cmHopper[_0xe380('0x1c')](_0x2e83ff))[_0xe380('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xe380('0x1d')]=function(_0x5a1458){return BPromise['resolve']()['then'](cmHopper[_0xe380('0x1d')]({'UserId':null},_0x5a1458,0x1))['catch'](loggerCatch(_0xe380('0x1e')));};exports[_0xe380('0x1f')]=function(_0x429cd){return BPromise['resolve']()[_0xe380('0xe')](cmHopper[_0xe380('0x1d')]({'active':![]},_0x429cd,0x1))[_0xe380('0xc')](loggerCatch(_0xe380('0x20')));};exports['crateCustomerReportQueue']=function(_0x52af5d){var _0x938080={};_0x938080[_0xe380('0x21')]=_0x52af5d['type'];_0x938080[_0xe380('0x22')]=_0x52af5d[_0xe380('0x22')];_0x938080['calleridnum']=_0x52af5d['calleridnum'];_0x938080['calleridname']=_0x52af5d['calleridname'];_0x938080[_0xe380('0x23')]=_0x52af5d[_0xe380('0x23')];_0x938080[_0xe380('0x24')]=_0x52af5d[_0xe380('0x25')];_0x938080[_0xe380('0x26')]=_0x52af5d[_0xe380('0x25')];_0x938080[_0xe380('0x27')]=0x1;_0x938080['queuecallercompleteAt']=_0x52af5d['endtime'];_0x938080[_0xe380('0x28')]=_0x52af5d[_0xe380('0x29')];_0x938080[_0xe380('0x2a')]=_0xe380('0x2b');_0x938080['exten']=_0xe380('0x2c');_0x938080[_0xe380('0x2d')]=0x0;_0x938080[_0xe380('0x2e')]=0x1;_0x938080[_0xe380('0x2f')]=_0x52af5d['membername'];_0x938080[_0xe380('0x30')]=_0xe380('0x31');return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](voiceQueueReport[_0xe380('0x32')](_0x938080))[_0xe380('0xc')](loggerCatch(_0xe380('0x33')));};exports['getContactRecallMe']=function(_0x9cebf5,_0x16cb59){return BPromise['resolve']()[_0xe380('0xe')](cmHopper['getContactRecallMe'](_0x9cebf5,_0x16cb59))[_0xe380('0xc')](loggerCatch(_0xe380('0x34')));};exports[_0xe380('0x35')]=function(_0x4c3388){return BPromise[_0xe380('0xb')]()[_0xe380('0xe')](cmHopper[_0xe380('0x18')](_0x4c3388,!![],!![]))[_0xe380('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 9844388..b0a6d81 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 _0x5291=['originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','calleridname','active','callback','callbackuniqueid','callbackat','recallme','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','pow','replace','extractCalleridName','match','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','string','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5291,0x177));var _0x1529=function(_0x2fd027,_0x4c9fba){_0x2fd027=_0x2fd027-0x0;var _0x43d4cb=_0x5291[_0x2fd027];return _0x43d4cb;};'use strict';var util=require('util');var _=require(_0x1529('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x1529('0x1'));var ipAgi=process[_0x1529('0x2')][_0x1529('0x3')]||_0x1529('0x4');function getSeconds(_0xdb0509,_0x57faa2){var _0x3462d3=moment(_0xdb0509)[_0x1529('0x5')](0x0);var _0x4e281f=moment(_0x57faa2)[_0x1529('0x5')](0x0);return _0x3462d3[_0x1529('0x6')](_0x4e281f,_0x1529('0x7'));}exports['loggerCatch']=function(_0xbd388a){return function(_0x2332cf){logger[_0x1529('0x8')](_0xbd388a,util[_0x1529('0x9')](_0x2332cf,{'showHidden':![],'depth':null}));};};exports[_0x1529('0xa')]=function(_0xd4a79e,_0x58c089){logger[_0x1529('0xb')](_0xd4a79e,util[_0x1529('0x9')](_0x58c089,{'showHidden':![],'depth':null}));};exports[_0x1529('0xc')]=function(_0x10fd7a,_0x450219){logger['error'](_0x10fd7a,util[_0x1529('0x9')](_0x450219,{'showHidden':![],'depth':null}));};exports[_0x1529('0xd')]=function(_0x2c8d19){return function(_0x3b6537){logger[_0x1529('0xb')](_0x2c8d19,util[_0x1529('0x9')](_0x3b6537,{'showHidden':![],'depth':null}));};};exports[_0x1529('0xe')]=function(_0x551477,_0x3206d4,_0x38ec28){return{'message':_0x551477,'unlock':_0x3206d4,'active':_0x38ec28};};exports[_0x1529('0xf')]=function(_0x4a57f5,_0x18ae94,_0x433be0){if(!_['isUndefined'](_0x433be0)&&'string'===typeof _0x433be0&&!_[_0x1529('0x10')](_0x433be0)){if(!_[_0x1529('0x11')](_0x18ae94)&&'string'===typeof _0x18ae94&&!_['isEmpty'](_0x18ae94)){return util['format'](_0x1529('0x12'),_0x18ae94,_0x433be0);}return util[_0x1529('0x13')](_0x1529('0x12'),_0x433be0,_0x433be0);}if(!_['isUndefined'](_0x4a57f5)&&_0x1529('0x14')===typeof _0x4a57f5&&!_[_0x1529('0x10')](_0x4a57f5)){return _0x4a57f5;}return _0x1529('0x15');};exports[_0x1529('0x16')]=function(_0xad0b12){if(_[_0x1529('0x17')](_0xad0b12)){return![];}return _0xad0b12;};exports['addVariables']=function(_0x59a7cf,_0x26387d,_0x35b1b2,_0x453f7a,_0x323237,_0x3684bb){var _0x45e622={'XMD-QUEUE':_0x26387d[_0x1529('0x18')]?_0x26387d[_0x1529('0x18')][_0x1529('0x19')]:'','XMD-CALLERID':_0x453f7a,'XMD-CALLERID-PREVIEW':_0x3684bb?util[_0x1529('0x13')](_0x1529('0x12'),_0x3684bb['calleridname'],_0x3684bb[_0x1529('0x1a')]):_0x453f7a,'XMD-DIALID':_0x323237,'XMD-CONTACTID':_0x26387d[_0x1529('0x1b')],'XMD-CDRTYPE':_0x1529('0x1c'),'CALLERID(all)':_0x453f7a,'XMD-VOICEQUEUEID':_0x26387d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x35b1b2,'XMD-DIALTIMEOUT':_0x59a7cf[_0x1529('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x1529('0x13')]('\x22rtTxX%s%s\x22',_0x59a7cf['dialQueueProject2']?'g':'',_[_0x1529('0x10')](_0x59a7cf[_0x1529('0x1e')])?'':_0x1529('0x1f')),'XMD-DIALURL':_0x59a7cf['dialPreviewUrl']||'','XMD-AGI':_0x59a7cf[_0x1529('0x20')]?util[_0x1529('0x13')](_0x1529('0x21'),ipAgi,_0x59a7cf[_0x1529('0x20')]):_0x1529('0x22'),'XMD-AGIAFTER':_0x59a7cf[_0x1529('0x23')]?util[_0x1529('0x13')](_0x1529('0x21'),ipAgi,_0x59a7cf[_0x1529('0x23')]):_0x1529('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3684bb?_0x3684bb[_0x1529('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3684bb?_0x3684bb['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x1529('0x10')](_0x59a7cf[_0x1529('0x1e')])){_0x45e622[util['format']('%s',_0x1529('0x25'))]=_0x59a7cf['monitor_format'];_0x45e622[util[_0x1529('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x323237;}if(_0x26387d&&_0x26387d[_0x1529('0x26')]){for(var _0x1220a6 in _0x26387d[_0x1529('0x26')]){if(_0x26387d[_0x1529('0x26')]['hasOwnProperty'](_0x1220a6)){if(!_[_0x1529('0x17')](_0x26387d['Contact'][_0x1220a6])&&_0x1220a6!=='id'&&_0x1220a6!==_0x1529('0x27')&&_0x1220a6!==_0x1529('0x28')&&_0x1220a6!==_0x1529('0x29')){_0x45e622[util[_0x1529('0x13')](_0x1529('0x2a'),_0x1529('0x2b'),_[_0x1529('0x2c')](_0x1220a6))]=_0x26387d[_0x1529('0x26')][_0x1220a6];}}}}return _0x45e622;};exports[_0x1529('0x2d')]=function(_0x20e4c7){var _0x190b28={};for(var _0x5ead01 in _0x20e4c7){if(_0x20e4c7[_0x1529('0x2e')](_0x5ead01)){_0x190b28[util[_0x1529('0x13')]('%s',_[_0x1529('0x2f')](_0x5ead01))]=_0x20e4c7[_0x5ead01];}}return{'variables':_0x190b28};};exports[_0x1529('0x30')]=function(_0x314e42,_0x5ae290){if(!_[_0x1529('0x17')](_0x314e42)){if(_0x314e42[_0x1529('0x2e')](_0x1529('0x31'))){if(_0x314e42['originated']>0x0){_0x314e42[_0x1529('0x31')]-=0x1;}else{logger['error'](_0x1529('0x32'),_0x5ae290);}}}else{logger[_0x1529('0x8')](_0x1529('0x33'),_0x5ae290);}};exports['logBlacklist']=function(_0x323089){var _0x416776=moment()[_0x1529('0x13')](_0x1529('0x34'));_0x323089[_0x1529('0x35')]=0xd;_0x323089['statedesc']='Blacklist';_0x323089[_0x1529('0x36')]=_0x416776;_0x323089[_0x1529('0x37')]=_0x416776;_0x323089[_0x1529('0x38')]=_0x416776;};exports[_0x1529('0x39')]=function(_0x34a72a,_0x18142d,_0x2554ca){var _0x38bc8c=moment()[_0x1529('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x34a72a['state']=_0x18142d;_0x34a72a[_0x1529('0x3a')]=_0x2554ca;_0x34a72a[_0x1529('0x37')]=_0x38bc8c;_0x34a72a[_0x1529('0x3b')]=getSeconds(_0x34a72a['responsetime'],_0x34a72a['starttime']);};exports[_0x1529('0x3c')]=function(_0x47c564,_0x535cb6,_0x5977c0){_0x47c564[_0x1529('0x3d')]=_0x535cb6;_0x47c564[_0x1529('0x3e')]=_0x5977c0;};exports[_0x1529('0x3f')]=function(_0x3541d0,_0x4fd91b,_0x432a85){var _0x34a2e7=moment()['format'](_0x1529('0x34'));_0x3541d0[_0x1529('0x35')]=_0x4fd91b;_0x3541d0[_0x1529('0x3a')]=_0x432a85;_0x3541d0['responsetime']=_0x3541d0['responsetime']?_0x3541d0[_0x1529('0x37')]:_0x34a2e7;_0x3541d0[_0x1529('0x38')]=_0x3541d0['endtime']?_0x3541d0[_0x1529('0x38')]:_0x34a2e7;_0x3541d0['ringtime']=getSeconds(_0x3541d0[_0x1529('0x37')]||0x0,_0x3541d0[_0x1529('0x36')]||0x0);_0x3541d0[_0x1529('0x40')]=_0x3541d0[_0x1529('0x41')]?getSeconds(_0x3541d0[_0x1529('0x38')],_0x3541d0['answertime']):0x0;};exports[_0x1529('0x42')]=function(_0x541060){return _0x541060==='Failure';};exports[_0x1529('0x43')]=function(_0x1b7683,_0x146265,_0x10e3ec,_0x5d2b84,_0x2c71e5){var _0x58f80a=_0x5d2b84?_0x1529('0x44'):_0x1b7683['calleridname'];_0x58f80a=_0x2c71e5?'BOOKED':_0x58f80a;return{'actionid':_0x1b7683[_0x1529('0x45')],'action':_0x1529('0x46'),'channel':_0x1b7683[_0x1529('0x47')],'callerid':util[_0x1529('0x13')](_0x1529('0x12'),_0x58f80a,_0x1b7683['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x10e3ec,'timeout':(_0x146265[_0x1529('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b7683[_0x1529('0x45')]};};exports[_0x1529('0x49')]=function(_0x11ea12){return _0x11ea12[_0x1529('0x4a')]+_0x11ea12[_0x1529('0x4b')]+_0x11ea12[_0x1529('0x4c')]+_0x11ea12[_0x1529('0x4d')]+_0x11ea12[_0x1529('0x4e')];};exports[_0x1529('0x4f')]=function(_0x561ffe){var _0x4e32ec=_[_0x1529('0x50')](_0x561ffe);_0x4e32ec[_0x1529('0x35')]=0xf;_0x4e32ec[_0x1529('0x3a')]=_0x1529('0x51');return _0x4e32ec;};exports['scheduledAt']=function(_0x14d023,_0x4504d4,_0xf446d3){var _0x3a815e={};_0x3a815e[_0x4504d4]=_0x14d023[_0x4504d4];_0x3a815e['active']=![];_0x3a815e[_0x1529('0x52')]=moment()[_0x1529('0x53')](_0xf446d3,_0x1529('0x54'))[_0x1529('0x13')](_0x1529('0x34'));_0x3a815e[_0x1529('0x1b')]=_0x14d023['ContactId'];_0x3a815e[_0x1529('0x55')]=_0x14d023[_0x1529('0x55')];_0x3a815e[_0x1529('0x56')]=_0x14d023[_0x1529('0x56')]||undefined;return _0x3a815e;};exports[_0x1529('0x57')]=function(_0x46e4e6,_0x299ef8){if(!_[_0x1529('0x17')](_0x46e4e6)){if(_0x46e4e6['pTalking']>0x0){_0x46e4e6['pTalking']-=0x1;}else{logger[_0x1529('0x8')](_0x299ef8,_0x1529('0x58'));}}else{logger[_0x1529('0x8')](_0x299ef8,_0x1529('0x59'));}};exports[_0x1529('0x5a')]=function(_0x23e076){if(_0x23e076<=0x0){return!![];}return![];};exports[_0x1529('0x5b')]=function(_0x59b66d,_0x21e6ca,_0x54e749){_0x59b66d[_0x1529('0x5c')]=_0x21e6ca;_0x59b66d[_0x1529('0x19')]=_0x59b66d['queue'];_0x59b66d[_0x1529('0x5d')]=_0x59b66d['channelAgent'];_0x59b66d[_0x1529('0x5e')]=_0x1529('0x5f');if(_0x54e749){_0x59b66d[_0x1529('0x60')]=_0x54e749[_0x1529('0x60')];}return _0x59b66d;};exports[_0x1529('0x61')]=function(_0x1c3ba9){var _0x46ea26={};_0x46ea26[_0x1529('0x62')]=_0x1c3ba9[_0x1529('0x62')];_0x46ea26[_0x1529('0x5d')]=_0x1c3ba9[_0x1529('0x47')];_0x46ea26[_0x1529('0x45')]=_0x1c3ba9[_0x1529('0x45')];return _0x46ea26;};exports[_0x1529('0x63')]=function(_0x4aebc6){var _0x20328c=[];for(var _0x4354de in _0x4aebc6){if(_0x4aebc6['hasOwnProperty'](_0x4354de)){if(!_[_0x1529('0x17')](_0x4aebc6[_0x4354de])&&_0x4aebc6[_0x4354de]['state']===_0x1529('0x64')&&_0x4aebc6[_0x4354de][_0x1529('0x65')]===_0x1529('0x66')){_0x20328c['push'](_0x4aebc6[_0x4354de]['id']);}}}return _0x20328c;};exports[_0x1529('0x67')]=function(_0x196450){var _0x37027e=moment()[_0x1529('0x5')](0x0);var _0x209234=moment(_0x196450)[_0x1529('0x5')](0x0);return _0x37027e[_0x1529('0x6')](_0x209234,'seconds');};exports['createBody']=function(_0x472db5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x472db5[_0x1529('0x1b')],'ListId':_0x472db5[_0x1529('0x55')],'VoiceQueueId':_0x472db5[_0x1529('0x56')]||undefined,'CampaignId':_0x472db5[_0x1529('0x68')]||undefined};};exports[_0x1529('0x69')]=function(_0x4c64c7){if(_0x4c64c7===_0x1529('0x45')||_0x4c64c7===_0x1529('0x6a')||_0x4c64c7===_0x1529('0x62')||_0x4c64c7===_0x1529('0x6b')||_0x4c64c7===_0x1529('0x6c')||_0x4c64c7===_0x1529('0x6d')||_0x4c64c7===_0x1529('0x3d')||_0x4c64c7===_0x1529('0x47')||_0x4c64c7===_0x1529('0x6e')||_0x4c64c7===_0x1529('0x6f')||_0x4c64c7===_0x1529('0x1a')||_0x4c64c7===_0x1529('0x52')||_0x4c64c7==='countbusyretry'||_0x4c64c7===_0x1529('0x4b')||_0x4c64c7===_0x1529('0x4c')||_0x4c64c7==='countglobal'||_0x4c64c7===_0x1529('0x70')||_0x4c64c7===_0x1529('0x71')||_0x4c64c7===_0x1529('0x72')||_0x4c64c7===_0x1529('0x73')||_0x4c64c7===_0x1529('0x1b')||_0x4c64c7===_0x1529('0x55')||_0x4c64c7==='UserId'||_0x4c64c7===_0x1529('0x56')||_0x4c64c7==='sipcallid'||_0x4c64c7==='xmd-voicequeueid'||_0x4c64c7===_0x1529('0x74')||_0x4c64c7===_0x1529('0x75')||_0x4c64c7==='xmd-listid'||_0x4c64c7===_0x1529('0x76')||_0x4c64c7===_0x1529('0x77')||_0x4c64c7==='xmd-dialoptions'||_0x4c64c7==='xmd-dialid'||_0x4c64c7===_0x1529('0x78')||_0x4c64c7==='xmd-contactid'||_0x4c64c7==='xmd-cdrtype'||_0x4c64c7==='xmd-callerid'||_0x4c64c7===_0x1529('0x79')||_0x4c64c7===_0x1529('0x7a')||_0x4c64c7===_0x1529('0x7b')||_0x4c64c7===_0x1529('0x7c')||_0x4c64c7===_0x1529('0x7d')||_0x4c64c7===_0x1529('0x7e')||_0x4c64c7==='rtpaudioqosloss'||_0x4c64c7===_0x1529('0x7f')||_0x4c64c7===_0x1529('0x80')||_0x4c64c7===_0x1529('0x81')||_0x4c64c7===_0x1529('0x7b')||_0x4c64c7==='rtpaudioqosbridged'||_0x4c64c7==='rtpaudioqosjitter'||_0x4c64c7===_0x1529('0x7e')||_0x4c64c7===_0x1529('0x82')||_0x4c64c7===_0x1529('0x7f')||_0x4c64c7===_0x1529('0x80')||_0x4c64c7===_0x1529('0x81')||_0x4c64c7===_0x1529('0x83')||_0x4c64c7===_0x1529('0x84')||_0x4c64c7===_0x1529('0x35')||_0x4c64c7==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2685d1,_0x45d955){var _0x4c35ad,_0x5bd311,_0x321bba;if(_0x45d955<=0x0){_0x45d955=0x1;}_0x4c35ad=new RegExp('\x5cw{0,'+_0x45d955+'}$');_0x5bd311=Math['pow'](0xa,_0x45d955-0x1);_0x321bba=Math[_0x1529('0x85')](0xa,_0x45d955)-0x1;return util[_0x1529('0x13')]('%s',_[_0x1529('0x86')](_0x2685d1,_0x4c35ad,_['random'](_0x5bd311,_0x321bba)));};exports[_0x1529('0x87')]=function(_0x398361){var _0x52007c=_0x398361[_0x1529('0x88')](/"(.*?)"/);return _0x52007c?_0x52007c[0x1]:_0x398361;};exports['extractCalleridNumber']=function(_0x1f7778){var _0xb25660=_0x1f7778[_0x1529('0x88')](/<(.*?)>/);return _0xb25660?_0xb25660[0x1]:_0x1f7778;}; \ No newline at end of file +var _0x5337=['membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','reachable','getDiff','createBody','filterKey','idContact','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','moment','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','loggerError','error','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','starttime','logLookAgent'];(function(_0x127a40,_0x6989e5){var _0x14118b=function(_0x2e640e){while(--_0x2e640e){_0x127a40['push'](_0x127a40['shift']());}};_0x14118b(++_0x6989e5);}(_0x5337,0xe3));var _0x7533=function(_0x1aa7b1,_0xe9e31d){_0x1aa7b1=_0x1aa7b1-0x0;var _0x5d4ff4=_0x5337[_0x1aa7b1];return _0x5d4ff4;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7533('0x0'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x7533('0x1')]['XCALLY_IP_AGI']||_0x7533('0x2');function getSeconds(_0xf00550,_0x2ca30f){var _0x4f7c9b=moment(_0xf00550)[_0x7533('0x3')](0x0);var _0x4f5933=moment(_0x2ca30f)['milliseconds'](0x0);return _0x4f7c9b[_0x7533('0x4')](_0x4f5933,_0x7533('0x5'));}exports[_0x7533('0x6')]=function(_0x350317){return function(_0x293ca6){logger['error'](_0x350317,util[_0x7533('0x7')](_0x293ca6,{'showHidden':![],'depth':null}));};};exports[_0x7533('0x8')]=function(_0x53aa85,_0xbce6c0){logger['info'](_0x53aa85,util[_0x7533('0x7')](_0xbce6c0,{'showHidden':![],'depth':null}));};exports[_0x7533('0x9')]=function(_0x382c48,_0x39e19a){logger[_0x7533('0xa')](_0x382c48,util[_0x7533('0x7')](_0x39e19a,{'showHidden':![],'depth':null}));};exports[_0x7533('0xb')]=function(_0x5a0765){return function(_0x1a6d44){logger['info'](_0x5a0765,util[_0x7533('0x7')](_0x1a6d44,{'showHidden':![],'depth':null}));};};exports[_0x7533('0xc')]=function(_0x407740,_0x1d89d2,_0x5710ab){return{'message':_0x407740,'unlock':_0x1d89d2,'active':_0x5710ab};};exports['getCallerId']=function(_0x3dde7c,_0xbfad1,_0x4c98a9){if(!_[_0x7533('0xd')](_0x4c98a9)&&_0x7533('0xe')===typeof _0x4c98a9&&!_[_0x7533('0xf')](_0x4c98a9)){if(!_[_0x7533('0xd')](_0xbfad1)&&_0x7533('0xe')===typeof _0xbfad1&&!_[_0x7533('0xf')](_0xbfad1)){return util[_0x7533('0x10')](_0x7533('0x11'),_0xbfad1,_0x4c98a9);}return util['format'](_0x7533('0x11'),_0x4c98a9,_0x4c98a9);}if(!_[_0x7533('0xd')](_0x3dde7c)&&_0x7533('0xe')===typeof _0x3dde7c&&!_[_0x7533('0xf')](_0x3dde7c)){return _0x3dde7c;}return'\x22\x22\x20<>';};exports[_0x7533('0x12')]=function(_0xc7b6af){if(_[_0x7533('0x13')](_0xc7b6af)){return![];}return _0xc7b6af;};exports[_0x7533('0x14')]=function(_0x3c48fe,_0x3f8b3c,_0x3880af,_0x2d8cea,_0xbbc04d,_0x46e5cc){var _0x27b20f={'XMD-QUEUE':_0x3f8b3c[_0x7533('0x15')]?_0x3f8b3c[_0x7533('0x15')][_0x7533('0x16')]:'','XMD-CALLERID':_0x2d8cea,'XMD-CALLERID-PREVIEW':_0x46e5cc?util[_0x7533('0x10')](_0x7533('0x11'),_0x46e5cc[_0x7533('0x17')],_0x46e5cc[_0x7533('0x18')]):_0x2d8cea,'XMD-DIALID':_0xbbc04d,'XMD-CONTACTID':_0x3f8b3c[_0x7533('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d8cea,'XMD-VOICEQUEUEID':_0x3f8b3c[_0x7533('0x1a')],'XMD-DIALCHANNEL':_0x3880af,'XMD-DIALTIMEOUT':_0x3c48fe[_0x7533('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x7533('0x10')](_0x7533('0x1c'),_0x3c48fe[_0x7533('0x1d')]?'g':'',_['isEmpty'](_0x3c48fe[_0x7533('0x1e')])?'':_0x7533('0x1f')),'XMD-DIALURL':_0x3c48fe['dialPreviewUrl']||'','XMD-AGI':_0x3c48fe[_0x7533('0x20')]?util[_0x7533('0x10')](_0x7533('0x21'),ipAgi,_0x3c48fe[_0x7533('0x20')]):_0x7533('0x22'),'XMD-AGIAFTER':_0x3c48fe[_0x7533('0x1d')]?util[_0x7533('0x10')](_0x7533('0x21'),ipAgi,_0x3c48fe[_0x7533('0x1d')]):_0x7533('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x46e5cc?_0x46e5cc[_0x7533('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x46e5cc?_0x46e5cc['originatecalleridname']:'','XMD-DESTINATION':_0x7533('0x24')};if(!_[_0x7533('0xf')](_0x3c48fe[_0x7533('0x1e')])){_0x27b20f[util[_0x7533('0x10')]('%s',_0x7533('0x25'))]=_0x3c48fe[_0x7533('0x1e')];_0x27b20f[util[_0x7533('0x10')]('%s',_0x7533('0x26'))]=_0xbbc04d;}if(_0x3f8b3c&&_0x3f8b3c[_0x7533('0x27')]){for(var _0x233e6a in _0x3f8b3c[_0x7533('0x27')]){if(_0x3f8b3c[_0x7533('0x27')][_0x7533('0x28')](_0x233e6a)){if(!_['isNil'](_0x3f8b3c[_0x7533('0x27')][_0x233e6a])&&_0x233e6a!=='id'&&_0x233e6a!==_0x7533('0x29')&&_0x233e6a!=='createdAt'&&_0x233e6a!==_0x7533('0x2a')){_0x27b20f[util[_0x7533('0x10')](_0x7533('0x2b'),_0x7533('0x2c'),_['toUpper'](_0x233e6a))]=_0x3f8b3c[_0x7533('0x27')][_0x233e6a];}}}}return _0x27b20f;};exports[_0x7533('0x2d')]=function(_0x58686c){var _0x13cbed={};for(var _0xb34651 in _0x58686c){if(_0x58686c[_0x7533('0x28')](_0xb34651)){_0x13cbed[util['format']('%s',_[_0x7533('0x2e')](_0xb34651))]=_0x58686c[_0xb34651];}}return{'variables':_0x13cbed};};exports[_0x7533('0x2f')]=function(_0x14b753,_0x490d0f){if(!_['isNil'](_0x14b753)){if(_0x14b753[_0x7533('0x28')](_0x7533('0x30'))){if(_0x14b753['originated']>0x0){_0x14b753[_0x7533('0x30')]-=0x1;}else{logger[_0x7533('0xa')](_0x7533('0x31'),_0x490d0f);}}}else{logger[_0x7533('0xa')](_0x7533('0x32'),_0x490d0f);}};exports[_0x7533('0x33')]=function(_0x3967ae){var _0x2f06ee=moment()[_0x7533('0x10')](_0x7533('0x34'));_0x3967ae[_0x7533('0x35')]=0xd;_0x3967ae[_0x7533('0x36')]=_0x7533('0x37');_0x3967ae['starttime']=_0x2f06ee;_0x3967ae[_0x7533('0x38')]=_0x2f06ee;_0x3967ae[_0x7533('0x39')]=_0x2f06ee;};exports[_0x7533('0x3a')]=function(_0x814dca,_0x25299f,_0x552bb9){var _0x3b6f26=moment()[_0x7533('0x10')](_0x7533('0x34'));_0x814dca[_0x7533('0x35')]=_0x25299f;_0x814dca['statedesc']=_0x552bb9;_0x814dca['responsetime']=_0x3b6f26;_0x814dca['ringtime']=getSeconds(_0x814dca[_0x7533('0x38')],_0x814dca[_0x7533('0x3b')]);};exports[_0x7533('0x3c')]=function(_0x48b694,_0x28f237,_0x1c79cb){_0x48b694[_0x7533('0x3d')]=_0x28f237;_0x48b694[_0x7533('0x3e')]=_0x1c79cb;};exports[_0x7533('0x3f')]=function(_0x23cdb3,_0x18fb70,_0x3bbb09){var _0x55c8dc=moment()[_0x7533('0x10')](_0x7533('0x34'));_0x23cdb3[_0x7533('0x35')]=_0x18fb70;_0x23cdb3[_0x7533('0x36')]=_0x3bbb09;_0x23cdb3['responsetime']=_0x23cdb3['responsetime']?_0x23cdb3[_0x7533('0x38')]:_0x55c8dc;_0x23cdb3['endtime']=_0x23cdb3[_0x7533('0x39')]?_0x23cdb3[_0x7533('0x39')]:_0x55c8dc;_0x23cdb3[_0x7533('0x40')]=getSeconds(_0x23cdb3[_0x7533('0x38')]||0x0,_0x23cdb3[_0x7533('0x3b')]||0x0);_0x23cdb3[_0x7533('0x41')]=_0x23cdb3[_0x7533('0x42')]?getSeconds(_0x23cdb3['endtime'],_0x23cdb3[_0x7533('0x42')]):0x0;};exports[_0x7533('0x43')]=function(_0x364050){return _0x364050==='Failure';};exports[_0x7533('0x44')]=function(_0x5c4b13,_0xebedf4,_0x6b79d1,_0x17e53c,_0x150df1){var _0x8caa2=_0x17e53c?_0x7533('0x45'):_0x5c4b13[_0x7533('0x17')];_0x8caa2=_0x150df1?_0x7533('0x46'):_0x8caa2;return{'actionid':_0x5c4b13[_0x7533('0x47')],'action':_0x7533('0x48'),'channel':_0x5c4b13[_0x7533('0x49')],'callerid':util[_0x7533('0x10')]('\x22%s\x22\x20<%s>',_0x8caa2,_0x5c4b13[_0x7533('0x18')]),'Exten':'xcally-motion-preview','Context':_0x7533('0x4a'),'Priority':'1','variable':_0x6b79d1,'timeout':(_0xebedf4[_0x7533('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5c4b13[_0x7533('0x47')]};};exports[_0x7533('0x4c')]=function(_0x5baae1){return _0x5baae1[_0x7533('0x4d')]+_0x5baae1[_0x7533('0x4e')]+_0x5baae1[_0x7533('0x4f')]+_0x5baae1[_0x7533('0x50')]+_0x5baae1[_0x7533('0x51')];};exports[_0x7533('0x52')]=function(_0xd906f5){var _0x2711e4=_[_0x7533('0x53')](_0xd906f5);_0x2711e4[_0x7533('0x35')]=0xf;_0x2711e4['statedesc']=_0x7533('0x54');return _0x2711e4;};exports[_0x7533('0x55')]=function(_0x315b1a,_0x1dbc2b,_0x25cdf8){var _0x28f334={};_0x28f334[_0x1dbc2b]=_0x315b1a[_0x1dbc2b];_0x28f334[_0x7533('0x56')]=![];_0x28f334[_0x7533('0x57')]=moment()[_0x7533('0x58')](_0x25cdf8,_0x7533('0x59'))[_0x7533('0x10')](_0x7533('0x34'));_0x28f334['ContactId']=_0x315b1a[_0x7533('0x19')];_0x28f334[_0x7533('0x5a')]=_0x315b1a[_0x7533('0x5a')];_0x28f334[_0x7533('0x1a')]=_0x315b1a[_0x7533('0x1a')]||undefined;return _0x28f334;};exports[_0x7533('0x5b')]=function(_0x564d76,_0x49784b){if(!_[_0x7533('0x13')](_0x564d76)){if(_0x564d76[_0x7533('0x5c')]>0x0){_0x564d76[_0x7533('0x5c')]-=0x1;}else{logger['error'](_0x49784b,_0x7533('0x5d'));}}else{logger[_0x7533('0xa')](_0x49784b,_0x7533('0x5e'));}};exports[_0x7533('0x5f')]=function(_0x383d4c){if(_0x383d4c<=0x0){return!![];}return![];};exports[_0x7533('0x60')]=function(_0x6d4ca7,_0x7b57a4,_0x48f4e5){_0x6d4ca7[_0x7533('0x61')]=_0x7b57a4;_0x6d4ca7[_0x7533('0x16')]=_0x6d4ca7[_0x7533('0x62')];_0x6d4ca7['interface']=_0x6d4ca7[_0x7533('0x49')];_0x6d4ca7[_0x7533('0x63')]=_0x7533('0x64');if(_0x48f4e5){_0x6d4ca7[_0x7533('0x65')]=_0x48f4e5[_0x7533('0x65')];}return _0x6d4ca7;};exports[_0x7533('0x66')]=function(_0x433d01){var _0x5ccf3f={};_0x5ccf3f[_0x7533('0x62')]=_0x433d01['queue'];_0x5ccf3f[_0x7533('0x67')]=_0x433d01[_0x7533('0x49')];_0x5ccf3f[_0x7533('0x47')]=_0x433d01[_0x7533('0x47')];return _0x5ccf3f;};exports[_0x7533('0x68')]=function(_0x287043){var _0x45549e=[];for(var _0x3f7013 in _0x287043){if(_0x287043[_0x7533('0x28')](_0x3f7013)){if(!_[_0x7533('0x13')](_0x287043[_0x3f7013])&&_0x287043[_0x3f7013][_0x7533('0x35')]==='not_inuse'&&_0x287043[_0x3f7013]['status']===_0x7533('0x69')){_0x45549e['push'](_0x287043[_0x3f7013]['id']);}}}return _0x45549e;};exports[_0x7533('0x6a')]=function(_0x3a3ebe){var _0x46a246=moment()[_0x7533('0x3')](0x0);var _0x788b63=moment(_0x3a3ebe)[_0x7533('0x3')](0x0);return _0x46a246['diff'](_0x788b63,_0x7533('0x5'));};exports[_0x7533('0x6b')]=function(_0x586730){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x586730[_0x7533('0x19')],'ListId':_0x586730['ListId'],'VoiceQueueId':_0x586730[_0x7533('0x1a')]||undefined,'CampaignId':_0x586730['CampaignId']||undefined};};exports[_0x7533('0x6c')]=function(_0x4daf7a){if(_0x4daf7a===_0x7533('0x47')||_0x4daf7a===_0x7533('0x6d')||_0x4daf7a===_0x7533('0x62')||_0x4daf7a==='type'||_0x4daf7a===_0x7533('0x6e')||_0x4daf7a===_0x7533('0x6f')||_0x4daf7a==='membername'||_0x4daf7a===_0x7533('0x49')||_0x4daf7a==='calleridname'||_0x4daf7a===_0x7533('0x56')||_0x4daf7a==='calleridnum'||_0x4daf7a===_0x7533('0x57')||_0x4daf7a===_0x7533('0x4d')||_0x4daf7a===_0x7533('0x4e')||_0x4daf7a==='countnoanswerretry'||_0x4daf7a==='countglobal'||_0x4daf7a===_0x7533('0x70')||_0x4daf7a===_0x7533('0x71')||_0x4daf7a===_0x7533('0x72')||_0x4daf7a===_0x7533('0x73')||_0x4daf7a===_0x7533('0x19')||_0x4daf7a===_0x7533('0x5a')||_0x4daf7a===_0x7533('0x3e')||_0x4daf7a==='VoiceQueueId'||_0x4daf7a===_0x7533('0x74')||_0x4daf7a===_0x7533('0x75')||_0x4daf7a===_0x7533('0x76')||_0x4daf7a==='xmd-phone'||_0x4daf7a===_0x7533('0x77')||_0x4daf7a==='xmd-dialurl'||_0x4daf7a===_0x7533('0x78')||_0x4daf7a===_0x7533('0x79')||_0x4daf7a===_0x7533('0x7a')||_0x4daf7a===_0x7533('0x7b')||_0x4daf7a===_0x7533('0x7c')||_0x4daf7a==='xmd-cdrtype'||_0x4daf7a==='xmd-callerid'||_0x4daf7a===_0x7533('0x7d')||_0x4daf7a===_0x7533('0x7e')||_0x4daf7a===_0x7533('0x7f')||_0x4daf7a===_0x7533('0x80')||_0x4daf7a===_0x7533('0x81')||_0x4daf7a===_0x7533('0x82')||_0x4daf7a===_0x7533('0x83')||_0x4daf7a==='rtpaudioqoslossbridged'||_0x4daf7a===_0x7533('0x84')||_0x4daf7a==='rtpaudioqosrttbridged'||_0x4daf7a==='rtpaudioqos'||_0x4daf7a==='rtpaudioqosbridged'||_0x4daf7a===_0x7533('0x81')||_0x4daf7a===_0x7533('0x82')||_0x4daf7a===_0x7533('0x83')||_0x4daf7a===_0x7533('0x85')||_0x4daf7a===_0x7533('0x84')||_0x4daf7a===_0x7533('0x86')||_0x4daf7a===_0x7533('0x87')||_0x4daf7a===_0x7533('0x88')||_0x4daf7a===_0x7533('0x35')||_0x4daf7a==='statedesc'){return![];}return!![];};exports[_0x7533('0x89')]=function(_0x4bd356,_0x531e02){var _0x15e1d8,_0x468b0f,_0x393425;if(_0x531e02<=0x0){_0x531e02=0x1;}_0x15e1d8=new RegExp(_0x7533('0x8a')+_0x531e02+'}$');_0x468b0f=Math[_0x7533('0x8b')](0xa,_0x531e02-0x1);_0x393425=Math[_0x7533('0x8b')](0xa,_0x531e02)-0x1;return util[_0x7533('0x10')]('%s',_['replace'](_0x4bd356,_0x15e1d8,_[_0x7533('0x8c')](_0x468b0f,_0x393425)));};exports[_0x7533('0x8d')]=function(_0x431642){var _0x5907d3=_0x431642[_0x7533('0x8e')](/"(.*?)"/);return _0x5907d3?_0x5907d3[0x1]:_0x431642;};exports[_0x7533('0x8f')]=function(_0x97b56d){var _0x3f6def=_0x97b56d['match'](/<(.*?)>/);return _0x3f6def?_0x3f6def[0x1]:_0x97b56d;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2d831f7..46966ca 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 _0x6d11=['queueadd','string','number','queuepause','boolean','reload','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x256ee7,_0x5b3f38){var _0x2b9aa2=function(_0x4bf505){while(--_0x4bf505){_0x256ee7['push'](_0x256ee7['shift']());}};_0x2b9aa2(++_0x5b3f38);}(_0x6d11,0x1e8));var _0x16d1=function(_0x5ef7cc,_0x5f4f54){_0x5ef7cc=_0x5ef7cc-0x0;var _0x4e662a=_0x6d11[_0x5ef7cc];return _0x4e662a;};'use strict';exports[_0x16d1('0x0')]={'queue':{'type':_0x16d1('0x1'),'required':!![]},'interface':{'type':_0x16d1('0x1'),'required':!![]},'membername':{'type':_0x16d1('0x1'),'required':!![]},'penalty':{'type':_0x16d1('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x16d1('0x1'),'required':!![]},'interface':{'type':_0x16d1('0x1'),'required':!![]}};exports[_0x16d1('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x16d1('0x4')},'reason':{'type':_0x16d1('0x1'),'required':![]}};exports[_0x16d1('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]},'filename':{'type':_0x16d1('0x1')},'format':{'type':_0x16d1('0x1')},'mixmonitorid':{'type':_0x16d1('0x1')}};exports[_0x16d1('0x6')]={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]}};exports[_0x16d1('0x7')]={'uniqueid':{'type':_0x16d1('0x1'),'required':!![]},'exten':{'type':_0x16d1('0x1'),'required':!![]},'context':{'type':_0x16d1('0x1')}}; \ No newline at end of file +var _0x4185=['queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','queueadd','string','number'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x4185,0x9f));var _0x5418=function(_0x49c959,_0x5c3943){_0x49c959=_0x49c959-0x0;var _0x38b0e8=_0x4185[_0x49c959];return _0x38b0e8;};'use strict';exports[_0x5418('0x0')]={'queue':{'type':_0x5418('0x1'),'required':!![]},'interface':{'type':_0x5418('0x1'),'required':!![]},'membername':{'type':_0x5418('0x1'),'required':!![]},'penalty':{'type':_0x5418('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x5418('0x3')]={'queue':{'type':_0x5418('0x1'),'required':!![]},'interface':{'type':_0x5418('0x1'),'required':!![]}};exports[_0x5418('0x4')]={'interface':{'type':_0x5418('0x1'),'required':!![]},'paused':{'type':_0x5418('0x5')},'reason':{'type':'string','required':![]}};exports[_0x5418('0x6')]={'module':{'type':_0x5418('0x1'),'required':![]}};exports[_0x5418('0x7')]={'uniqueid':{'type':_0x5418('0x1'),'required':!![]}};exports[_0x5418('0x8')]={'uniqueid':{'type':_0x5418('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x5418('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x5418('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x5418('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x5418('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index c0e3fc1..a8db8ed 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 _0x0ce0=['deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','SIP/%s','isUndefined','initTelephones','length','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerexitAt','diff','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts'];(function(_0xa1760c,_0x5ef2ae){var _0xc4f315=function(_0x33c08a){while(--_0x33c08a){_0xa1760c['push'](_0xa1760c['shift']());}};_0xc4f315(++_0x5ef2ae);}(_0x0ce0,0xbf));var _0x00ce=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x0ce0[_0xdbb6cb];return _0x476b50;};'use strict';var BPromise=require(_0x00ce('0x0'));var util=require(_0x00ce('0x1'));var _=require('lodash');var moment=require(_0x00ce('0x2'));var Agent=require(_0x00ce('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x00ce('0x4'));var Trigger=require(_0x00ce('0x5'));var Template=require(_0x00ce('0x6'));var Campaign=require(_0x00ce('0x7'));var VoiceExtension=require(_0x00ce('0x8'));var ZendeskAccount=require(_0x00ce('0x9'));var SalesforceAccount=require(_0x00ce('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x00ce('0xb'));var ZohoAccount=require(_0x00ce('0xc'));var DeskAccount=require(_0x00ce('0xd'));var VtigerAccount=require(_0x00ce('0xe'));var ServicenowAccount=require(_0x00ce('0xf'));var Dynamics365Account=require(_0x00ce('0x10'));var FreshsalesAccount=require(_0x00ce('0x11'));var FaxAccount=require(_0x00ce('0x12'));var Realtime=function(){this[_0x00ce('0x13')]={};this[_0x00ce('0x14')]={};this['trunks']={};this[_0x00ce('0x15')]={};this[_0x00ce('0x16')]={};this['campaigns']={};this[_0x00ce('0x17')]={};this[_0x00ce('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x00ce('0x19')]={};this[_0x00ce('0x1a')]={};this[_0x00ce('0x1b')]={};this[_0x00ce('0x1c')]={};this['timers']={};this[_0x00ce('0x1d')]={};this[_0x00ce('0x1e')]={};this[_0x00ce('0x1f')]={};this[_0x00ce('0x20')]={};this[_0x00ce('0x21')]={};this[_0x00ce('0x22')]={};this[_0x00ce('0x23')]={};this[_0x00ce('0x24')]={};this[_0x00ce('0x25')]={};this['dynamics365Accounts']={};this[_0x00ce('0x26')]={};this[_0x00ce('0x27')]={};};function freeIsNotKey(_0x48a22b,_0x4dd265,_0x596942){var _0x4e5bab=_[_0x00ce('0x28')](_0x48a22b,function(_0x38514c,_0x55fb04){return _0x38514c[_0x596942];});for(var _0x3dcd36 in _0x4dd265){if(_0x4dd265[_0x00ce('0x29')](_0x3dcd36)){if(!_0x4e5bab[_0x3dcd36]){delete _0x4dd265[_0x3dcd36];}}}}function freeIsNotKeySip(_0x42b36d,_0x5a1b1a){var _0xc90d56=_[_0x00ce('0x28')](_0x42b36d,function(_0x52c9d2,_0x27dfad){return util[_0x00ce('0x2a')]('SIP/%s',_0x52c9d2[_0x00ce('0x2b')]);});for(var _0x57eda9 in _0x5a1b1a){if(_0x5a1b1a[_0x00ce('0x29')](_0x57eda9)){if(!_0xc90d56[_0x57eda9]){delete _0x5a1b1a[_0x57eda9];}}}}function freeIsNotKeyAgent(_0x3be4b0,_0x181e9d){var _0x1993f8=_[_0x00ce('0x28')](_0x3be4b0,function(_0x5f3887,_0x7e0de3){var _0x323838=_[_0x00ce('0x2c')](_0x5f3887[_0x00ce('0x2d')])?util[_0x00ce('0x2a')]('SIP/%s',_0x5f3887['name']):_0x5f3887[_0x00ce('0x2d')];return _0x323838;});for(var _0x29a584 in _0x181e9d){if(_0x181e9d[_0x00ce('0x29')](_0x29a584)){if(!_0x1993f8[_0x29a584]){delete _0x181e9d[_0x29a584];}}}}function clearVoiceCallReports(_0x4a1827){_0x4a1827[_0x00ce('0x2e')]=0x0;_0x4a1827[_0x00ce('0x2f')]=0x0;_0x4a1827['sumHoldTime']=0x0;_0x4a1827[_0x00ce('0x30')]=0x0;_0x4a1827[_0x00ce('0x31')]=0x0;}function clearCampaigns(_0x2fae04){if(!_[_0x00ce('0x32')](_0x2fae04)){for(var _0x5c84a2 in _0x2fae04){if(_0x2fae04[_0x00ce('0x29')](_0x5c84a2)){_0x2fae04[_0x5c84a2]['ivrTotalCallsDays']=0x0;_0x2fae04[_0x5c84a2][_0x00ce('0x33')]=0x0;}}}}function clearVoiceQueues(_0x516859){if(!_['isEmpty'](_0x516859)){for(var _0x38bedd in _0x516859){if(_0x516859[_0x00ce('0x29')](_0x38bedd)){_0x516859[_0x38bedd][_0x00ce('0x2e')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x2f')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x34')]=0x0;_0x516859[_0x38bedd]['abandoned']=0x0;_0x516859[_0x38bedd][_0x00ce('0x35')]=0x0;_0x516859[_0x38bedd]['sumDuration']=0x0;_0x516859[_0x38bedd][_0x00ce('0x31')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x36')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x37')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x38')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x39')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3a')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3b')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3c')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3d')]=0x0;_0x516859[_0x38bedd]['outboundBlacklistCallsDay']=0x0;_0x516859[_0x38bedd][_0x00ce('0x3e')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x3f')]=0x0;_0x516859[_0x38bedd]['outboundReCallsDay']=0x0;_0x516859[_0x38bedd][_0x00ce('0x36')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x40')]=0x0;_0x516859[_0x38bedd][_0x00ce('0x41')]=!![];}}}}Realtime[_0x00ce('0x42')][_0x00ce('0x43')]=function(_0x181e56,_0x2e3189){for(var _0x4ac009 in _0x2e3189){if(_0x181e56[_0x00ce('0x29')](_0x4ac009)){_0x181e56[_0x4ac009]=_0x2e3189[_0x4ac009];}}};Realtime[_0x00ce('0x42')]['initAgents']=function(){var _0x136f28=this;return function(_0x3cefd8){if(_0x3cefd8){freeIsNotKeyAgent(_0x3cefd8,_0x136f28[_0x00ce('0x13')]);for(var _0x315265=0x0,_0x5ae5b1={},_0x356138={};_0x315265<_0x3cefd8['length'];_0x315265+=0x1){_0x5ae5b1=_0x3cefd8[_0x315265];var _0x2c9fcb=_[_0x00ce('0x2c')](_0x5ae5b1['interface'])?util['format'](_0x00ce('0x44'),_0x5ae5b1[_0x00ce('0x2b')]):_0x5ae5b1[_0x00ce('0x2d')];if(_[_0x00ce('0x45')](_0x136f28['agents'][_0x2c9fcb])){_0x136f28['agents'][_0x2c9fcb]=new Agent(_0x5ae5b1);}else{_0x136f28[_0x00ce('0x43')](_0x136f28[_0x00ce('0x13')][_0x2c9fcb],_0x5ae5b1);}}}return _0x136f28[_0x00ce('0x13')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x46')]=function(){var _0x3d7910=this;return function(_0x1d71d3){if(_0x1d71d3){freeIsNotKeySip(_0x1d71d3,_0x3d7910[_0x00ce('0x14')]);for(var _0x4ccdd9=0x0,_0xeafc9={},_0x1b3185={};_0x4ccdd9<_0x1d71d3[_0x00ce('0x47')];_0x4ccdd9+=0x1){_0xeafc9=_0x1d71d3[_0x4ccdd9];if(_[_0x00ce('0x45')](_0x3d7910['telephones'][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0xeafc9['name'])])){_0x3d7910['telephones'][util['format'](_0x00ce('0x44'),_0xeafc9['name'])]=new Telephone(_0xeafc9);}else{_0x3d7910[_0x00ce('0x43')](_0x3d7910['telephones'][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0xeafc9[_0x00ce('0x2b')])],_0xeafc9);}}}return _0x3d7910[_0x00ce('0x14')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x48')]=function(){var _0x3539ca=this;return function(_0x398e0f){if(_0x398e0f){freeIsNotKeySip(_0x398e0f,_0x3539ca['trunks']);for(var _0x2ee7c7=0x0,_0x20efef={},_0xf21557={};_0x2ee7c7<_0x398e0f[_0x00ce('0x47')];_0x2ee7c7+=0x1){_0x20efef=_0x398e0f[_0x2ee7c7];if(_[_0x00ce('0x45')](_0x3539ca[_0x00ce('0x49')][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])])){_0x3539ca[_0x00ce('0x49')][util['format'](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])]=new Trunk(_0x20efef);}else{_0x3539ca[_0x00ce('0x43')](_0x3539ca[_0x00ce('0x49')][util[_0x00ce('0x2a')](_0x00ce('0x44'),_0x20efef[_0x00ce('0x2b')])],_0x20efef);}}}return _0x3539ca['trunks'];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4a')]=function(){var _0x400b4c=this;return function(_0x19733a){if(_0x19733a){freeIsNotKey(_0x19733a,_0x400b4c[_0x00ce('0x15')],_0x00ce('0x2b'));for(var _0x1d5de2=0x0,_0x42f650={},_0x2447af={};_0x1d5de2<_0x19733a[_0x00ce('0x47')];_0x1d5de2+=0x1){_0x42f650=_0x19733a[_0x1d5de2];if(_['isUndefined'](_0x400b4c[_0x00ce('0x15')][_0x42f650[_0x00ce('0x2b')]])){_0x400b4c[_0x00ce('0x15')][_0x42f650['name']]=new VoiceQueue(_0x42f650);}else{_0x400b4c[_0x00ce('0x43')](_0x400b4c[_0x00ce('0x15')][_0x42f650[_0x00ce('0x2b')]],_0x42f650);}}}return _0x400b4c[_0x00ce('0x15')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4b')]=function(){var _0xca74b8=this;return function(_0x10fe97){if(_0x10fe97){freeIsNotKey(_0x10fe97,_0xca74b8['triggers'],'id');for(var _0x298db4=0x0,_0x5f38af={},_0x412a49={};_0x298db4<_0x10fe97[_0x00ce('0x47')];_0x298db4+=0x1){_0x5f38af=_0x10fe97[_0x298db4];if(_['isUndefined'](_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']])){_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']]=new Trigger(_0x5f38af);}else{_0xca74b8[_0x00ce('0x43')](_0xca74b8[_0x00ce('0x16')][_0x5f38af['id']],_0x5f38af);}}}return _0xca74b8[_0x00ce('0x16')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4c')]=function(){var _0x114175=this;return function(_0x44ba3c){if(_0x44ba3c){freeIsNotKey(_0x44ba3c,_0x114175['templates'],'id');for(var _0x5841e9=0x0,_0x55a862={},_0x2d8130={};_0x5841e9<_0x44ba3c[_0x00ce('0x47')];_0x5841e9+=0x1){_0x55a862=_0x44ba3c[_0x5841e9];if(_['isUndefined'](_0x114175[_0x00ce('0x17')][_0x55a862['id']])){_0x114175['templates'][_0x55a862['id']]=new Template(_0x55a862);}else{_0x114175[_0x00ce('0x43')](_0x114175[_0x00ce('0x17')][_0x55a862['id']],_0x55a862);}}}return _0x114175[_0x00ce('0x17')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4d')]=function(){var _0x283d7b=this;return function(_0x2caa0a){if(_0x2caa0a){freeIsNotKey(_0x2caa0a,_0x283d7b[_0x00ce('0x1e')],'id');for(var _0x929a75=0x0,_0x1452e4={},_0x214e7d={};_0x929a75<_0x2caa0a[_0x00ce('0x47')];_0x929a75+=0x1){_0x1452e4=_0x2caa0a[_0x929a75];if(_[_0x00ce('0x45')](_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']])){_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']]=new ZendeskAccount(_0x1452e4);}else{_0x283d7b[_0x00ce('0x43')](_0x283d7b[_0x00ce('0x1e')][_0x1452e4['id']],_0x1452e4);}}}return _0x283d7b[_0x00ce('0x1e')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x4e')]=function(){var _0x1b31a5=this;return function(_0x2d38c1){if(_0x2d38c1){freeIsNotKey(_0x2d38c1,_0x1b31a5[_0x00ce('0x1f')],'id');for(var _0x1e219a=0x0,_0x2a4b13={},_0xd3de7a={};_0x1e219a<_0x2d38c1['length'];_0x1e219a+=0x1){_0x2a4b13=_0x2d38c1[_0x1e219a];if(_['isUndefined'](_0x1b31a5['salesforceAccounts'][_0x2a4b13['id']])){_0x1b31a5[_0x00ce('0x1f')][_0x2a4b13['id']]=new SalesforceAccount(_0x2a4b13);}else{_0x1b31a5['mergeFromDatabase'](_0x1b31a5[_0x00ce('0x1f')][_0x2a4b13['id']],_0x2a4b13);}}}return _0x1b31a5['salesforceAccounts'];};};Realtime['prototype'][_0x00ce('0x4f')]=function(){var _0x1c86ef=this;return function(_0x359715){if(_0x359715){freeIsNotKey(_0x359715,_0x1c86ef['freshdeskAccounts'],'id');for(var _0x7218e2=0x0,_0x506e19={},_0xfd0e8d={};_0x7218e2<_0x359715[_0x00ce('0x47')];_0x7218e2+=0x1){_0x506e19=_0x359715[_0x7218e2];if(_[_0x00ce('0x45')](_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']])){_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']]=new FreshdeskAccount(_0x506e19);}else{_0x1c86ef['mergeFromDatabase'](_0x1c86ef[_0x00ce('0x21')][_0x506e19['id']],_0x506e19);}}}return _0x1c86ef[_0x00ce('0x21')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x50')]=function(){var _0xc871bf=this;return function(_0x472586){if(_0x472586){freeIsNotKey(_0x472586,_0xc871bf[_0x00ce('0x22')],'id');for(var _0x3c3dce=0x0,_0x12bad5={},_0xe6d122={};_0x3c3dce<_0x472586[_0x00ce('0x47')];_0x3c3dce+=0x1){_0x12bad5=_0x472586[_0x3c3dce];if(_[_0x00ce('0x45')](_0xc871bf[_0x00ce('0x22')][_0x12bad5['id']])){_0xc871bf['zohoAccounts'][_0x12bad5['id']]=new ZohoAccount(_0x12bad5);}else{_0xc871bf[_0x00ce('0x43')](_0xc871bf['zohoAccounts'][_0x12bad5['id']],_0x12bad5);}}}return _0xc871bf[_0x00ce('0x22')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x51')]=function(){var _0x75a706=this;return function(_0x2110b9){if(_0x2110b9){freeIsNotKey(_0x2110b9,_0x75a706[_0x00ce('0x23')],'id');for(var _0x4f9ced=0x0,_0x21981a={},_0x463241={};_0x4f9ced<_0x2110b9[_0x00ce('0x47')];_0x4f9ced+=0x1){_0x21981a=_0x2110b9[_0x4f9ced];if(_[_0x00ce('0x45')](_0x75a706[_0x00ce('0x23')][_0x21981a['id']])){_0x75a706[_0x00ce('0x23')][_0x21981a['id']]=new DeskAccount(_0x21981a);}else{_0x75a706[_0x00ce('0x43')](_0x75a706['deskAccounts'][_0x21981a['id']],_0x21981a);}}}return _0x75a706[_0x00ce('0x23')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x52')]=function(){var _0x57ac2d=this;return function(_0x1e43a6){if(_0x1e43a6){freeIsNotKey(_0x1e43a6,_0x57ac2d[_0x00ce('0x20')],'id');for(var _0x415fa8=0x0,_0x4a78fd={},_0x454a2d={};_0x415fa8<_0x1e43a6[_0x00ce('0x47')];_0x415fa8+=0x1){_0x4a78fd=_0x1e43a6[_0x415fa8];if(_[_0x00ce('0x45')](_0x57ac2d[_0x00ce('0x20')][_0x4a78fd['id']])){_0x57ac2d[_0x00ce('0x20')][_0x4a78fd['id']]=new SugarcrmAccount(_0x4a78fd);}else{_0x57ac2d[_0x00ce('0x43')](_0x57ac2d['sugarcrmAccounts'][_0x4a78fd['id']],_0x4a78fd);}}}return _0x57ac2d[_0x00ce('0x20')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x53')]=function(){var _0x1902e1=this;return function(_0x489131){if(_0x489131){freeIsNotKey(_0x489131,_0x1902e1['vtigerAccounts'],'id');for(var _0x448267=0x0,_0x194ccf={},_0x43bab6={};_0x448267<_0x489131['length'];_0x448267+=0x1){_0x194ccf=_0x489131[_0x448267];if(_[_0x00ce('0x45')](_0x1902e1['vtigerAccounts'][_0x194ccf['id']])){_0x1902e1['vtigerAccounts'][_0x194ccf['id']]=new VtigerAccount(_0x194ccf);}else{_0x1902e1['mergeFromDatabase'](_0x1902e1[_0x00ce('0x24')][_0x194ccf['id']],_0x194ccf);}}}return _0x1902e1[_0x00ce('0x24')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x54')]=function(){var _0x482c1f=this;return function(_0x1ec83c){if(_0x1ec83c){freeIsNotKey(_0x1ec83c,_0x482c1f[_0x00ce('0x25')],'id');for(var _0xfb0264=0x0,_0x329912={},_0xb4ed9d={};_0xfb0264<_0x1ec83c[_0x00ce('0x47')];_0xfb0264+=0x1){_0x329912=_0x1ec83c[_0xfb0264];if(_[_0x00ce('0x45')](_0x482c1f[_0x00ce('0x25')][_0x329912['id']])){_0x482c1f['servicenowAccounts'][_0x329912['id']]=new ServicenowAccount(_0x329912);}else{_0x482c1f[_0x00ce('0x43')](_0x482c1f[_0x00ce('0x25')][_0x329912['id']],_0x329912);}}}return _0x482c1f[_0x00ce('0x25')];};};Realtime['prototype'][_0x00ce('0x55')]=function(){var _0x2fd360=this;return function(_0x19dc04){if(_0x19dc04){freeIsNotKey(_0x19dc04,_0x2fd360[_0x00ce('0x56')],'id');for(var _0x10e41e=0x0,_0x55f6d4={},_0x9dcda9={};_0x10e41e<_0x19dc04[_0x00ce('0x47')];_0x10e41e+=0x1){_0x55f6d4=_0x19dc04[_0x10e41e];if(_[_0x00ce('0x45')](_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']])){_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']]=new Dynamics365Account(_0x55f6d4);}else{_0x2fd360[_0x00ce('0x43')](_0x2fd360[_0x00ce('0x56')][_0x55f6d4['id']],_0x55f6d4);}}}return _0x2fd360[_0x00ce('0x56')];};};Realtime[_0x00ce('0x42')]['initFreshsalesAccounts']=function(){var _0x7e752f=this;return function(_0x4726da){if(_0x4726da){freeIsNotKey(_0x4726da,_0x7e752f[_0x00ce('0x26')],'id');for(var _0x2b5601=0x0,_0x158c0f={},_0x1cb9ab={};_0x2b5601<_0x4726da['length'];_0x2b5601+=0x1){_0x158c0f=_0x4726da[_0x2b5601];if(_[_0x00ce('0x45')](_0x7e752f['freshsalesAccounts'][_0x158c0f['id']])){_0x7e752f[_0x00ce('0x26')][_0x158c0f['id']]=new FreshsalesAccount(_0x158c0f);}else{_0x7e752f[_0x00ce('0x43')](_0x7e752f[_0x00ce('0x26')][_0x158c0f['id']],_0x158c0f);}}}return _0x7e752f[_0x00ce('0x26')];};};Realtime[_0x00ce('0x42')]['initVoiceQueueHopperHistory']=function(){var _0x264390=this;return function(_0x22838b){for(var _0x5773b7=0x0;_0x5773b7<_0x22838b[_0x00ce('0x47')];_0x5773b7+=0x1){_[_0x00ce('0x57')](_0x264390['voiceQueues'][_0x22838b[_0x5773b7][_0x00ce('0x2b')]],_0x22838b[_0x5773b7]);}return _0x264390[_0x00ce('0x15')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x58')]=function(){var _0x2d71f4=this;return function(_0x4e2556){clearVoiceQueues(_0x2d71f4[_0x00ce('0x15')]);if(_0x4e2556){_0x4e2556=_[_0x00ce('0x59')](_0x4e2556,'uniqueid');for(var _0x46a66f in _0x4e2556){if(_0x4e2556['hasOwnProperty'](_0x46a66f)){var _0x54b839={};for(var _0x1a55f7=0x0;_0x1a55f7<_0x4e2556[_0x46a66f][_0x00ce('0x47')];_0x1a55f7+=0x1){var _0x19868a=_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5a')];if(_0x2d71f4[_0x00ce('0x15')][_0x19868a]){if(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5b')]){_0x2d71f4[_0x00ce('0x15')][_0x19868a]['unmanaged']+=0x1;}if(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5c')]){_0x2d71f4['voiceQueues'][_0x19868a][_0x00ce('0x5d')]+=0x1;}_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x35')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5e')])['diff'](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5f')]),'seconds')||0x0;if(_0x1a55f7===_0x4e2556[_0x46a66f][_0x00ce('0x47')]-0x1){_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x30')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x60')]||_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallerabandonAt']||_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x61')])[_0x00ce('0x62')](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5f')]),_0x00ce('0x63'))||0x0;_0x2d71f4['voiceQueues'][_0x19868a]['total']+=0x1;if(_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallercomplete']){_0x2d71f4[_0x00ce('0x15')][_0x19868a]['answered']+=0x1;_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x31')]+=moment(_0x4e2556[_0x46a66f][_0x1a55f7]['queuecallercompleteAt'])['diff'](moment(_0x4e2556[_0x46a66f][_0x1a55f7][_0x00ce('0x5e')]),_0x00ce('0x63'))||0x0;}}else{_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x30')]+=_0x2d71f4[_0x00ce('0x15')][_0x19868a][_0x00ce('0x35')]||0x0;}}}}}}return _0x2d71f4['voiceQueues'];};};Realtime[_0x00ce('0x42')][_0x00ce('0x64')]=function(){var _0x11b8df=this;return function(_0x4d78d5){clearVoiceCallReports(_0x11b8df[_0x00ce('0x18')]);if(_0x4d78d5){for(var _0x598979=0x0;_0x598979<_0x4d78d5[_0x00ce('0x47')];_0x598979+=0x1){_0x11b8df['outbound']['total']+=0x1;_0x11b8df[_0x00ce('0x18')][_0x00ce('0x30')]+=_0x4d78d5[_0x598979][_0x00ce('0x65')];if(_0x4d78d5[_0x598979][_0x00ce('0x66')]===_0x00ce('0x67')){_0x11b8df['outbound'][_0x00ce('0x2f')]+=0x1;_0x11b8df[_0x00ce('0x18')][_0x00ce('0x35')]+=_0x4d78d5[_0x598979][_0x00ce('0x65')]-_0x4d78d5[_0x598979][_0x00ce('0x68')]||0x0;_0x11b8df[_0x00ce('0x18')]['sumBillable']+=_0x4d78d5[_0x598979][_0x00ce('0x68')];}}}return _0x11b8df[_0x00ce('0x18')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x69')]=function(){var _0x58afcc=this;return function(_0x351b95){if(_0x351b95){freeIsNotKey(_0x351b95,_0x58afcc[_0x00ce('0x6a')],_0x00ce('0x2b'));for(var _0x54f362=0x0,_0x40cbed={};_0x54f362<_0x351b95[_0x00ce('0x47')];_0x54f362+=0x1){_0x40cbed=_0x351b95[_0x54f362];if(_[_0x00ce('0x45')](_0x58afcc[_0x00ce('0x6a')][_0x40cbed[_0x00ce('0x2b')]])){_0x58afcc['campaigns'][_0x40cbed[_0x00ce('0x2b')]]=new Campaign(_0x40cbed);}else{_0x58afcc[_0x00ce('0x43')](_0x58afcc[_0x00ce('0x6a')][_0x40cbed[_0x00ce('0x2b')]],_0x40cbed);_0x58afcc[_0x00ce('0x6a')][_0x40cbed['name']][_0x00ce('0x6b')]=_0x40cbed['SquareProject']?_0x40cbed[_0x00ce('0x6c')]['name']:undefined;}}}return _0x58afcc[_0x00ce('0x6a')];};};Realtime[_0x00ce('0x42')][_0x00ce('0x6d')]=function(){var _0x2ca888=this;return function(_0x126954){if(_0x126954){freeIsNotKey(_0x126954,_0x2ca888[_0x00ce('0x19')],'id');for(var _0x146757=0x0,_0x443453={};_0x146757<_0x126954[_0x00ce('0x47')];_0x146757+=0x1){_0x443453=_0x126954[_0x146757];if(_[_0x00ce('0x45')](_0x2ca888[_0x00ce('0x19')][_0x443453['id']])){_0x2ca888[_0x00ce('0x19')][_0x443453['id']]=new VoiceExtension(_0x443453);}else{_0x2ca888[_0x00ce('0x43')](_0x2ca888[_0x00ce('0x19')][_0x443453['id']],_0x443453);}}}return _0x2ca888[_0x00ce('0x19')];};};Realtime['prototype'][_0x00ce('0x6e')]=function(){var _0xa73729=this;return function(_0x2dcdf4){clearCampaigns(_0xa73729[_0x00ce('0x6a')]);for(var _0xeca7ed=0x0;_0xeca7ed<_0x2dcdf4[_0x00ce('0x47')];_0xeca7ed+=0x1){_[_0x00ce('0x57')](_0xa73729[_0x00ce('0x6a')][_0x2dcdf4[_0xeca7ed][_0x00ce('0x2b')]],_0x2dcdf4[_0xeca7ed]);}return _0xa73729['campaigns'];};};Realtime['prototype'][_0x00ce('0x6f')]=function(){var _0x4137e8=this;return function(_0x95eff0){if(_0x95eff0){freeIsNotKey(_0x95eff0,_0x4137e8[_0x00ce('0x27')],'id');for(var _0x1378ae=0x0,_0x4f6cfb={},_0xa095e={};_0x1378ae<_0x95eff0[_0x00ce('0x47')];_0x1378ae+=0x1){_0x4f6cfb=_0x95eff0[_0x1378ae];if(_[_0x00ce('0x45')](_0x4137e8['faxAccounts'][_0x4f6cfb['id']])){_0x4137e8[_0x00ce('0x27')][_0x4f6cfb['id']]=new FaxAccount(_0x4f6cfb);}else{_0x4137e8[_0x00ce('0x43')](_0x4137e8[_0x00ce('0x27')][_0x4f6cfb['id']],_0x4f6cfb);}}}return _0x4137e8['faxAccounts'];};};module[_0x00ce('0x70')]=Realtime; \ No newline at end of file +var _0xec53=['queuecallerexitAt','queuecallerjoinAt','initVoiceCallReports','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','sumHoldTime','sumBillable','ivrTotalCallsDays','total','answered','unmanaged','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt'];(function(_0x48dc28,_0x349a24){var _0x10d4c4=function(_0x1c5a9d){while(--_0x1c5a9d){_0x48dc28['push'](_0x48dc28['shift']());}};_0x10d4c4(++_0x349a24);}(_0xec53,0x1c7));var _0x3ec5=function(_0x2e5f21,_0x1738f9){_0x2e5f21=_0x2e5f21-0x0;var _0x30f5a8=_0xec53[_0x2e5f21];return _0x30f5a8;};'use strict';var BPromise=require(_0x3ec5('0x0'));var util=require(_0x3ec5('0x1'));var _=require('lodash');var moment=require(_0x3ec5('0x2'));var Agent=require(_0x3ec5('0x3'));var Telephone=require(_0x3ec5('0x4'));var Trunk=require(_0x3ec5('0x5'));var VoiceQueue=require(_0x3ec5('0x6'));var Trigger=require(_0x3ec5('0x7'));var Template=require(_0x3ec5('0x8'));var Campaign=require(_0x3ec5('0x9'));var VoiceExtension=require(_0x3ec5('0xa'));var ZendeskAccount=require(_0x3ec5('0xb'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x3ec5('0xc'));var SugarcrmAccount=require(_0x3ec5('0xd'));var ZohoAccount=require(_0x3ec5('0xe'));var DeskAccount=require(_0x3ec5('0xf'));var VtigerAccount=require(_0x3ec5('0x10'));var ServicenowAccount=require(_0x3ec5('0x11'));var Dynamics365Account=require(_0x3ec5('0x12'));var FreshsalesAccount=require(_0x3ec5('0x13'));var FaxAccount=require(_0x3ec5('0x14'));var Realtime=function(){this['agents']={};this[_0x3ec5('0x15')]={};this[_0x3ec5('0x16')]={};this[_0x3ec5('0x17')]={};this[_0x3ec5('0x18')]={};this[_0x3ec5('0x19')]={};this[_0x3ec5('0x1a')]={};this[_0x3ec5('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x3ec5('0x1c')]={};this[_0x3ec5('0x1d')]={};this[_0x3ec5('0x1e')]={};this[_0x3ec5('0x1f')]={};this[_0x3ec5('0x20')]={};this[_0x3ec5('0x21')]={};this[_0x3ec5('0x22')]={};this['sugarcrmAccounts']={};this[_0x3ec5('0x23')]={};this[_0x3ec5('0x24')]={};this[_0x3ec5('0x25')]={};this[_0x3ec5('0x26')]={};this[_0x3ec5('0x27')]={};this[_0x3ec5('0x28')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x433ca9,_0x38a924,_0x1426ea){var _0x3c7f02=_[_0x3ec5('0x29')](_0x433ca9,function(_0x2541f3,_0x1f7597){return _0x2541f3[_0x1426ea];});for(var _0x4c0406 in _0x38a924){if(_0x38a924[_0x3ec5('0x2a')](_0x4c0406)){if(!_0x3c7f02[_0x4c0406]){delete _0x38a924[_0x4c0406];}}}}function freeIsNotKeySip(_0x207155,_0x468e51){var _0x177bd3=_[_0x3ec5('0x29')](_0x207155,function(_0x41884c,_0x16dddd){return util['format'](_0x3ec5('0x2b'),_0x41884c[_0x3ec5('0x2c')]);});for(var _0x2e93df in _0x468e51){if(_0x468e51[_0x3ec5('0x2a')](_0x2e93df)){if(!_0x177bd3[_0x2e93df]){delete _0x468e51[_0x2e93df];}}}}function freeIsNotKeyAgent(_0x5e2b36,_0x373ad9){var _0x5ae342=_[_0x3ec5('0x29')](_0x5e2b36,function(_0x117af4,_0x236036){var _0xb23ce1=_[_0x3ec5('0x2d')](_0x117af4[_0x3ec5('0x2e')])?util[_0x3ec5('0x2f')](_0x3ec5('0x2b'),_0x117af4['name']):_0x117af4[_0x3ec5('0x2e')];return _0xb23ce1;});for(var _0x1f762f in _0x373ad9){if(_0x373ad9[_0x3ec5('0x2a')](_0x1f762f)){if(!_0x5ae342[_0x1f762f]){delete _0x373ad9[_0x1f762f];}}}}function clearVoiceCallReports(_0x26f67e){_0x26f67e['total']=0x0;_0x26f67e['answered']=0x0;_0x26f67e[_0x3ec5('0x30')]=0x0;_0x26f67e['sumDuration']=0x0;_0x26f67e[_0x3ec5('0x31')]=0x0;}function clearCampaigns(_0x4cff96){if(!_['isEmpty'](_0x4cff96)){for(var _0x334664 in _0x4cff96){if(_0x4cff96[_0x3ec5('0x2a')](_0x334664)){_0x4cff96[_0x334664][_0x3ec5('0x32')]=0x0;_0x4cff96[_0x334664]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x42b353){if(!_['isEmpty'](_0x42b353)){for(var _0x39687c in _0x42b353){if(_0x42b353[_0x3ec5('0x2a')](_0x39687c)){_0x42b353[_0x39687c][_0x3ec5('0x33')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x34')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x35')]=0x0;_0x42b353[_0x39687c]['abandoned']=0x0;_0x42b353[_0x39687c][_0x3ec5('0x30')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x36')]=0x0;_0x42b353[_0x39687c]['sumBillable']=0x0;_0x42b353[_0x39687c]['outboundAnswerAgiCallsDay']=0x0;_0x42b353[_0x39687c][_0x3ec5('0x37')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x38')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x39')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3a')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3b')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3c')]=0x0;_0x42b353[_0x39687c]['outboundDropCallsDayCallersExit']=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3d')]=0x0;_0x42b353[_0x39687c]['outboundOriginateFailureCallsDay']=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3e')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x3f')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x40')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x41')]=0x0;_0x42b353[_0x39687c][_0x3ec5('0x42')]=!![];}}}}Realtime[_0x3ec5('0x43')][_0x3ec5('0x44')]=function(_0x2db5eb,_0x2906f4){for(var _0x486008 in _0x2906f4){if(_0x2db5eb[_0x3ec5('0x2a')](_0x486008)){_0x2db5eb[_0x486008]=_0x2906f4[_0x486008];}}};Realtime['prototype'][_0x3ec5('0x45')]=function(){var _0x1e9f25=this;return function(_0x5cf396){if(_0x5cf396){freeIsNotKeyAgent(_0x5cf396,_0x1e9f25['agents']);for(var _0x1d17c8=0x0,_0x3e77ec={},_0x26877f={};_0x1d17c8<_0x5cf396[_0x3ec5('0x46')];_0x1d17c8+=0x1){_0x3e77ec=_0x5cf396[_0x1d17c8];var _0x2f3721=_[_0x3ec5('0x2d')](_0x3e77ec[_0x3ec5('0x2e')])?util[_0x3ec5('0x2f')](_0x3ec5('0x2b'),_0x3e77ec[_0x3ec5('0x2c')]):_0x3e77ec[_0x3ec5('0x2e')];if(_[_0x3ec5('0x47')](_0x1e9f25[_0x3ec5('0x48')][_0x2f3721])){_0x1e9f25[_0x3ec5('0x48')][_0x2f3721]=new Agent(_0x3e77ec);}else{_0x1e9f25[_0x3ec5('0x44')](_0x1e9f25[_0x3ec5('0x48')][_0x2f3721],_0x3e77ec);}}}return _0x1e9f25[_0x3ec5('0x48')];};};Realtime[_0x3ec5('0x43')]['initTelephones']=function(){var _0x49c4fe=this;return function(_0x5200bb){if(_0x5200bb){freeIsNotKeySip(_0x5200bb,_0x49c4fe[_0x3ec5('0x15')]);for(var _0xf9c072=0x0,_0x218568={},_0x190378={};_0xf9c072<_0x5200bb[_0x3ec5('0x46')];_0xf9c072+=0x1){_0x218568=_0x5200bb[_0xf9c072];if(_['isUndefined'](_0x49c4fe[_0x3ec5('0x15')][util[_0x3ec5('0x2f')](_0x3ec5('0x2b'),_0x218568['name'])])){_0x49c4fe[_0x3ec5('0x15')][util['format'](_0x3ec5('0x2b'),_0x218568[_0x3ec5('0x2c')])]=new Telephone(_0x218568);}else{_0x49c4fe[_0x3ec5('0x44')](_0x49c4fe[_0x3ec5('0x15')][util['format'](_0x3ec5('0x2b'),_0x218568[_0x3ec5('0x2c')])],_0x218568);}}}return _0x49c4fe['telephones'];};};Realtime[_0x3ec5('0x43')]['initTrunks']=function(){var _0x376695=this;return function(_0x105e29){if(_0x105e29){freeIsNotKeySip(_0x105e29,_0x376695['trunks']);for(var _0x166729=0x0,_0x8bba2e={},_0x207a46={};_0x166729<_0x105e29[_0x3ec5('0x46')];_0x166729+=0x1){_0x8bba2e=_0x105e29[_0x166729];if(_['isUndefined'](_0x376695['trunks'][util[_0x3ec5('0x2f')]('SIP/%s',_0x8bba2e['name'])])){_0x376695[_0x3ec5('0x16')][util[_0x3ec5('0x2f')]('SIP/%s',_0x8bba2e[_0x3ec5('0x2c')])]=new Trunk(_0x8bba2e);}else{_0x376695['mergeFromDatabase'](_0x376695['trunks'][util['format'](_0x3ec5('0x2b'),_0x8bba2e[_0x3ec5('0x2c')])],_0x8bba2e);}}}return _0x376695[_0x3ec5('0x16')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x49')]=function(){var _0x3954aa=this;return function(_0x482051){if(_0x482051){freeIsNotKey(_0x482051,_0x3954aa['voiceQueues'],_0x3ec5('0x2c'));for(var _0x52953d=0x0,_0x17956f={},_0x4ec246={};_0x52953d<_0x482051[_0x3ec5('0x46')];_0x52953d+=0x1){_0x17956f=_0x482051[_0x52953d];if(_[_0x3ec5('0x47')](_0x3954aa['voiceQueues'][_0x17956f['name']])){_0x3954aa[_0x3ec5('0x17')][_0x17956f['name']]=new VoiceQueue(_0x17956f);}else{_0x3954aa[_0x3ec5('0x44')](_0x3954aa['voiceQueues'][_0x17956f[_0x3ec5('0x2c')]],_0x17956f);}}}return _0x3954aa[_0x3ec5('0x17')];};};Realtime[_0x3ec5('0x43')]['initTriggers']=function(){var _0x357ff8=this;return function(_0xe117df){if(_0xe117df){freeIsNotKey(_0xe117df,_0x357ff8['triggers'],'id');for(var _0x522b90=0x0,_0x46f350={},_0x4ce7ae={};_0x522b90<_0xe117df[_0x3ec5('0x46')];_0x522b90+=0x1){_0x46f350=_0xe117df[_0x522b90];if(_['isUndefined'](_0x357ff8[_0x3ec5('0x18')][_0x46f350['id']])){_0x357ff8[_0x3ec5('0x18')][_0x46f350['id']]=new Trigger(_0x46f350);}else{_0x357ff8[_0x3ec5('0x44')](_0x357ff8[_0x3ec5('0x18')][_0x46f350['id']],_0x46f350);}}}return _0x357ff8[_0x3ec5('0x18')];};};Realtime['prototype'][_0x3ec5('0x4a')]=function(){var _0x182ed6=this;return function(_0x51daa7){if(_0x51daa7){freeIsNotKey(_0x51daa7,_0x182ed6[_0x3ec5('0x1a')],'id');for(var _0x48f149=0x0,_0x5611c8={},_0x24a818={};_0x48f149<_0x51daa7['length'];_0x48f149+=0x1){_0x5611c8=_0x51daa7[_0x48f149];if(_[_0x3ec5('0x47')](_0x182ed6['templates'][_0x5611c8['id']])){_0x182ed6['templates'][_0x5611c8['id']]=new Template(_0x5611c8);}else{_0x182ed6[_0x3ec5('0x44')](_0x182ed6['templates'][_0x5611c8['id']],_0x5611c8);}}}return _0x182ed6[_0x3ec5('0x1a')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x4b')]=function(){var _0x550e7b=this;return function(_0x135769){if(_0x135769){freeIsNotKey(_0x135769,_0x550e7b['zendeskAccounts'],'id');for(var _0x22cf1f=0x0,_0x13830c={},_0x2735ce={};_0x22cf1f<_0x135769[_0x3ec5('0x46')];_0x22cf1f+=0x1){_0x13830c=_0x135769[_0x22cf1f];if(_[_0x3ec5('0x47')](_0x550e7b['zendeskAccounts'][_0x13830c['id']])){_0x550e7b[_0x3ec5('0x21')][_0x13830c['id']]=new ZendeskAccount(_0x13830c);}else{_0x550e7b[_0x3ec5('0x44')](_0x550e7b['zendeskAccounts'][_0x13830c['id']],_0x13830c);}}}return _0x550e7b[_0x3ec5('0x21')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x4c')]=function(){var _0x42871a=this;return function(_0x4997f1){if(_0x4997f1){freeIsNotKey(_0x4997f1,_0x42871a['salesforceAccounts'],'id');for(var _0x4372ef=0x0,_0x57f1ac={},_0xc1f659={};_0x4372ef<_0x4997f1['length'];_0x4372ef+=0x1){_0x57f1ac=_0x4997f1[_0x4372ef];if(_[_0x3ec5('0x47')](_0x42871a[_0x3ec5('0x22')][_0x57f1ac['id']])){_0x42871a['salesforceAccounts'][_0x57f1ac['id']]=new SalesforceAccount(_0x57f1ac);}else{_0x42871a[_0x3ec5('0x44')](_0x42871a[_0x3ec5('0x22')][_0x57f1ac['id']],_0x57f1ac);}}}return _0x42871a[_0x3ec5('0x22')];};};Realtime[_0x3ec5('0x43')]['initFreshdeskAccounts']=function(){var _0x5f26e6=this;return function(_0x4d46df){if(_0x4d46df){freeIsNotKey(_0x4d46df,_0x5f26e6[_0x3ec5('0x23')],'id');for(var _0x6a51ff=0x0,_0x290f85={},_0x539858={};_0x6a51ff<_0x4d46df['length'];_0x6a51ff+=0x1){_0x290f85=_0x4d46df[_0x6a51ff];if(_['isUndefined'](_0x5f26e6[_0x3ec5('0x23')][_0x290f85['id']])){_0x5f26e6[_0x3ec5('0x23')][_0x290f85['id']]=new FreshdeskAccount(_0x290f85);}else{_0x5f26e6[_0x3ec5('0x44')](_0x5f26e6[_0x3ec5('0x23')][_0x290f85['id']],_0x290f85);}}}return _0x5f26e6[_0x3ec5('0x23')];};};Realtime[_0x3ec5('0x43')]['initZohoAccounts']=function(){var _0x6387be=this;return function(_0x20201e){if(_0x20201e){freeIsNotKey(_0x20201e,_0x6387be[_0x3ec5('0x24')],'id');for(var _0x58ee34=0x0,_0x12e7c1={},_0x6580db={};_0x58ee34<_0x20201e['length'];_0x58ee34+=0x1){_0x12e7c1=_0x20201e[_0x58ee34];if(_[_0x3ec5('0x47')](_0x6387be[_0x3ec5('0x24')][_0x12e7c1['id']])){_0x6387be[_0x3ec5('0x24')][_0x12e7c1['id']]=new ZohoAccount(_0x12e7c1);}else{_0x6387be['mergeFromDatabase'](_0x6387be['zohoAccounts'][_0x12e7c1['id']],_0x12e7c1);}}}return _0x6387be[_0x3ec5('0x24')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x4d')]=function(){var _0x42e9b1=this;return function(_0x177d59){if(_0x177d59){freeIsNotKey(_0x177d59,_0x42e9b1[_0x3ec5('0x25')],'id');for(var _0x2ac65d=0x0,_0x3b1f11={},_0x2d2997={};_0x2ac65d<_0x177d59[_0x3ec5('0x46')];_0x2ac65d+=0x1){_0x3b1f11=_0x177d59[_0x2ac65d];if(_[_0x3ec5('0x47')](_0x42e9b1['deskAccounts'][_0x3b1f11['id']])){_0x42e9b1[_0x3ec5('0x25')][_0x3b1f11['id']]=new DeskAccount(_0x3b1f11);}else{_0x42e9b1[_0x3ec5('0x44')](_0x42e9b1[_0x3ec5('0x25')][_0x3b1f11['id']],_0x3b1f11);}}}return _0x42e9b1[_0x3ec5('0x25')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x4e')]=function(){var _0x23ff3b=this;return function(_0x55895b){if(_0x55895b){freeIsNotKey(_0x55895b,_0x23ff3b[_0x3ec5('0x4f')],'id');for(var _0x6168d3=0x0,_0xc91db8={},_0x29a774={};_0x6168d3<_0x55895b[_0x3ec5('0x46')];_0x6168d3+=0x1){_0xc91db8=_0x55895b[_0x6168d3];if(_['isUndefined'](_0x23ff3b[_0x3ec5('0x4f')][_0xc91db8['id']])){_0x23ff3b[_0x3ec5('0x4f')][_0xc91db8['id']]=new SugarcrmAccount(_0xc91db8);}else{_0x23ff3b['mergeFromDatabase'](_0x23ff3b['sugarcrmAccounts'][_0xc91db8['id']],_0xc91db8);}}}return _0x23ff3b['sugarcrmAccounts'];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x50')]=function(){var _0x5c2e16=this;return function(_0xfe9c6f){if(_0xfe9c6f){freeIsNotKey(_0xfe9c6f,_0x5c2e16['vtigerAccounts'],'id');for(var _0x585d35=0x0,_0x1fa775={},_0x342334={};_0x585d35<_0xfe9c6f['length'];_0x585d35+=0x1){_0x1fa775=_0xfe9c6f[_0x585d35];if(_['isUndefined'](_0x5c2e16[_0x3ec5('0x26')][_0x1fa775['id']])){_0x5c2e16['vtigerAccounts'][_0x1fa775['id']]=new VtigerAccount(_0x1fa775);}else{_0x5c2e16[_0x3ec5('0x44')](_0x5c2e16[_0x3ec5('0x26')][_0x1fa775['id']],_0x1fa775);}}}return _0x5c2e16['vtigerAccounts'];};};Realtime['prototype'][_0x3ec5('0x51')]=function(){var _0x3a076e=this;return function(_0x4b30bf){if(_0x4b30bf){freeIsNotKey(_0x4b30bf,_0x3a076e['servicenowAccounts'],'id');for(var _0xfcee8d=0x0,_0x3ff6e0={},_0x3f404e={};_0xfcee8d<_0x4b30bf[_0x3ec5('0x46')];_0xfcee8d+=0x1){_0x3ff6e0=_0x4b30bf[_0xfcee8d];if(_['isUndefined'](_0x3a076e[_0x3ec5('0x27')][_0x3ff6e0['id']])){_0x3a076e['servicenowAccounts'][_0x3ff6e0['id']]=new ServicenowAccount(_0x3ff6e0);}else{_0x3a076e[_0x3ec5('0x44')](_0x3a076e[_0x3ec5('0x27')][_0x3ff6e0['id']],_0x3ff6e0);}}}return _0x3a076e['servicenowAccounts'];};};Realtime['prototype'][_0x3ec5('0x52')]=function(){var _0x5a3b52=this;return function(_0xf9773){if(_0xf9773){freeIsNotKey(_0xf9773,_0x5a3b52[_0x3ec5('0x28')],'id');for(var _0x12d9a6=0x0,_0x5edbf3={},_0xfdb838={};_0x12d9a6<_0xf9773[_0x3ec5('0x46')];_0x12d9a6+=0x1){_0x5edbf3=_0xf9773[_0x12d9a6];if(_[_0x3ec5('0x47')](_0x5a3b52[_0x3ec5('0x28')][_0x5edbf3['id']])){_0x5a3b52[_0x3ec5('0x28')][_0x5edbf3['id']]=new Dynamics365Account(_0x5edbf3);}else{_0x5a3b52[_0x3ec5('0x44')](_0x5a3b52[_0x3ec5('0x28')][_0x5edbf3['id']],_0x5edbf3);}}}return _0x5a3b52['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x454442=this;return function(_0x37db33){if(_0x37db33){freeIsNotKey(_0x37db33,_0x454442[_0x3ec5('0x53')],'id');for(var _0x215a49=0x0,_0xd5b841={},_0x4fca0c={};_0x215a49<_0x37db33[_0x3ec5('0x46')];_0x215a49+=0x1){_0xd5b841=_0x37db33[_0x215a49];if(_[_0x3ec5('0x47')](_0x454442['freshsalesAccounts'][_0xd5b841['id']])){_0x454442[_0x3ec5('0x53')][_0xd5b841['id']]=new FreshsalesAccount(_0xd5b841);}else{_0x454442[_0x3ec5('0x44')](_0x454442[_0x3ec5('0x53')][_0xd5b841['id']],_0xd5b841);}}}return _0x454442[_0x3ec5('0x53')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x188a07=this;return function(_0x3fc289){for(var _0x40b380=0x0;_0x40b380<_0x3fc289[_0x3ec5('0x46')];_0x40b380+=0x1){_['merge'](_0x188a07[_0x3ec5('0x17')][_0x3fc289[_0x40b380][_0x3ec5('0x2c')]],_0x3fc289[_0x40b380]);}return _0x188a07[_0x3ec5('0x17')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x54')]=function(){var _0x4c3f2c=this;return function(_0xf258a){clearVoiceQueues(_0x4c3f2c[_0x3ec5('0x17')]);if(_0xf258a){_0xf258a=_[_0x3ec5('0x55')](_0xf258a,_0x3ec5('0x56'));for(var _0x110b34 in _0xf258a){if(_0xf258a[_0x3ec5('0x2a')](_0x110b34)){var _0x270930={};for(var _0x22b1c2=0x0;_0x22b1c2<_0xf258a[_0x110b34]['length'];_0x22b1c2+=0x1){var _0x5d5190=_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x57')];if(_0x4c3f2c['voiceQueues'][_0x5d5190]){if(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x58')]){_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190][_0x3ec5('0x35')]+=0x1;}if(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x59')]){_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190][_0x3ec5('0x5a')]+=0x1;}_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190]['sumHoldTime']+=moment(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x5b')])[_0x3ec5('0x5c')](moment(_0xf258a[_0x110b34][_0x22b1c2]['queuecallerjoinAt']),_0x3ec5('0x5d'))||0x0;if(_0x22b1c2===_0xf258a[_0x110b34]['length']-0x1){_0x4c3f2c['voiceQueues'][_0x5d5190][_0x3ec5('0x36')]+=moment(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x5e')]||_0xf258a[_0x110b34][_0x22b1c2]['queuecallerabandonAt']||_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x5f')])['diff'](moment(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x60')]),_0x3ec5('0x5d'))||0x0;_0x4c3f2c['voiceQueues'][_0x5d5190][_0x3ec5('0x33')]+=0x1;if(_0xf258a[_0x110b34][_0x22b1c2]['queuecallercomplete']){_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190][_0x3ec5('0x34')]+=0x1;_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190][_0x3ec5('0x31')]+=moment(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x5e')])['diff'](moment(_0xf258a[_0x110b34][_0x22b1c2][_0x3ec5('0x5b')]),_0x3ec5('0x5d'))||0x0;}}else{_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190][_0x3ec5('0x36')]+=_0x4c3f2c[_0x3ec5('0x17')][_0x5d5190]['sumHoldTime']||0x0;}}}}}}return _0x4c3f2c[_0x3ec5('0x17')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x61')]=function(){var _0x140828=this;return function(_0x11112f){clearVoiceCallReports(_0x140828['outbound']);if(_0x11112f){for(var _0x451837=0x0;_0x451837<_0x11112f['length'];_0x451837+=0x1){_0x140828[_0x3ec5('0x1b')]['total']+=0x1;_0x140828[_0x3ec5('0x1b')][_0x3ec5('0x36')]+=_0x11112f[_0x451837]['duration'];if(_0x11112f[_0x451837][_0x3ec5('0x62')]===_0x3ec5('0x63')){_0x140828[_0x3ec5('0x1b')][_0x3ec5('0x34')]+=0x1;_0x140828['outbound'][_0x3ec5('0x30')]+=_0x11112f[_0x451837]['duration']-_0x11112f[_0x451837][_0x3ec5('0x64')]||0x0;_0x140828[_0x3ec5('0x1b')][_0x3ec5('0x31')]+=_0x11112f[_0x451837][_0x3ec5('0x64')];}}}return _0x140828[_0x3ec5('0x1b')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x65')]=function(){var _0x59cfc0=this;return function(_0x31792c){if(_0x31792c){freeIsNotKey(_0x31792c,_0x59cfc0[_0x3ec5('0x19')],_0x3ec5('0x2c'));for(var _0x5948b0=0x0,_0x4a2e7c={};_0x5948b0<_0x31792c['length'];_0x5948b0+=0x1){_0x4a2e7c=_0x31792c[_0x5948b0];if(_[_0x3ec5('0x47')](_0x59cfc0[_0x3ec5('0x19')][_0x4a2e7c[_0x3ec5('0x2c')]])){_0x59cfc0[_0x3ec5('0x19')][_0x4a2e7c[_0x3ec5('0x2c')]]=new Campaign(_0x4a2e7c);}else{_0x59cfc0['mergeFromDatabase'](_0x59cfc0[_0x3ec5('0x19')][_0x4a2e7c[_0x3ec5('0x2c')]],_0x4a2e7c);_0x59cfc0[_0x3ec5('0x19')][_0x4a2e7c[_0x3ec5('0x2c')]][_0x3ec5('0x66')]=_0x4a2e7c['SquareProject']?_0x4a2e7c[_0x3ec5('0x67')]['name']:undefined;}}}return _0x59cfc0[_0x3ec5('0x19')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x68')]=function(){var _0x678e41=this;return function(_0x3be8a7){if(_0x3be8a7){freeIsNotKey(_0x3be8a7,_0x678e41[_0x3ec5('0x69')],'id');for(var _0x125408=0x0,_0x491027={};_0x125408<_0x3be8a7['length'];_0x125408+=0x1){_0x491027=_0x3be8a7[_0x125408];if(_['isUndefined'](_0x678e41[_0x3ec5('0x69')][_0x491027['id']])){_0x678e41[_0x3ec5('0x69')][_0x491027['id']]=new VoiceExtension(_0x491027);}else{_0x678e41['mergeFromDatabase'](_0x678e41[_0x3ec5('0x69')][_0x491027['id']],_0x491027);}}}return _0x678e41['voiceExtensions'];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x6a')]=function(){var _0x3c3905=this;return function(_0x2fbf0e){clearCampaigns(_0x3c3905[_0x3ec5('0x19')]);for(var _0x1a1f34=0x0;_0x1a1f34<_0x2fbf0e[_0x3ec5('0x46')];_0x1a1f34+=0x1){_[_0x3ec5('0x6b')](_0x3c3905[_0x3ec5('0x19')][_0x2fbf0e[_0x1a1f34][_0x3ec5('0x2c')]],_0x2fbf0e[_0x1a1f34]);}return _0x3c3905[_0x3ec5('0x19')];};};Realtime[_0x3ec5('0x43')][_0x3ec5('0x6c')]=function(){var _0x130338=this;return function(_0x152337){if(_0x152337){freeIsNotKey(_0x152337,_0x130338[_0x3ec5('0x6d')],'id');for(var _0x577946=0x0,_0x40fcfc={},_0x319b85={};_0x577946<_0x152337[_0x3ec5('0x46')];_0x577946+=0x1){_0x40fcfc=_0x152337[_0x577946];if(_[_0x3ec5('0x47')](_0x130338[_0x3ec5('0x6d')][_0x40fcfc['id']])){_0x130338[_0x3ec5('0x6d')][_0x40fcfc['id']]=new FaxAccount(_0x40fcfc);}else{_0x130338[_0x3ec5('0x44')](_0x130338[_0x3ec5('0x6d')][_0x40fcfc['id']],_0x40fcfc);}}}return _0x130338[_0x3ec5('0x6d')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7d4595b..1f4b44a 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 _0xc00b=['queuecallerexitAt','create','match','voiceCallReport','exten','type','dialer','lastapplication','queue','lastdata','context','destination','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','monitor','monitors','monitorFilename','filename','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','lastIndexOf','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit'];(function(_0x4dacd0,_0x13609a){var _0xd520e6=function(_0x48118e){while(--_0x48118e){_0x4dacd0['push'](_0x4dacd0['shift']());}};_0xd520e6(++_0x13609a);}(_0xc00b,0x12a));var _0xbc00=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xc00b[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0xbc00('0x0'));var moment=require('moment');var util=require(_0xbc00('0x1'));var config=require(_0xbc00('0x2'));var ami=require(_0xbc00('0x3'));var RpcVoiceAgentReport=require(_0xbc00('0x4'));var RpcVoiceCallReport=require(_0xbc00('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xbc00('0x6'));var RpcVoiceQueueReport=require(_0xbc00('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xbc00('0x8'));var VoiceQueueReport=require(_0xbc00('0x9'));var VoiceCallReport=require(_0xbc00('0xa'));var VoiceAgentReport=require(_0xbc00('0xb'));var VoiceDialReport=require(_0xbc00('0xc'));var UserReport=require('./userReport');function Report(_0x16e60f){this[_0xbc00('0xd')]=_0x16e60f;this[_0xbc00('0xe')]=_0x16e60f[_0xbc00('0xe')];this[_0xbc00('0xf')]=_0x16e60f[_0xbc00('0xf')];}Report[_0xbc00('0x10')][_0xbc00('0x11')]=function(_0x3a24a2){var _0x2212e3=new VoiceQueueReport(this['realtime']);var _0x3988d4=new VoiceAgentReport(this[_0xbc00('0xd')]);var _0x188438=new VoiceDialReport(this['realtime']);var _0x4f5412=new VoiceCallReport(this[_0xbc00('0xd')]);var _0x5b10e1=new UserReport(this[_0xbc00('0xd')]);if(config[_0xbc00('0x12')]&&config['xdr'][_0xbc00('0x13')]){ami['on'](_0xbc00('0x14'),this[_0xbc00('0x15')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0xbc00('0x18'),this[_0xbc00('0x19')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x1a'),this[_0xbc00('0x1b')][_0xbc00('0x16')](this));ami['on'](_0xbc00('0x1c'),this[_0xbc00('0x1d')]['bind'](this));ami['on'](_0xbc00('0x1e'),this[_0xbc00('0x1f')][_0xbc00('0x16')](this));}};Report[_0xbc00('0x10')][_0xbc00('0x20')]=function(_0x102bfd){var _0x3417e7;_0x3417e7=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x140c5c){return _0x140c5c[_0xbc00('0x22')]==_0x102bfd||_0x140c5c[_0xbc00('0x23')]==_0x102bfd;});if(_[_0xbc00('0x24')](_0x3417e7)){var _0x4a182c=_[_0xbc00('0x21')](this[_0xbc00('0xf')],function(_0x381928){return _0x381928['accountcode']==_0x102bfd||_0x381928[_0xbc00('0x23')]==_0x102bfd;});if(_0x4a182c){_0x3417e7=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x41d0e8){return _0x41d0e8[_0xbc00('0x25')]==util[_0xbc00('0x26')]('SIP/%s',_0x4a182c[_0xbc00('0x23')]);});}}return _0x3417e7;};Report[_0xbc00('0x10')][_0xbc00('0x15')]=function(_0x533779){for(var _0x2449cb=0x0;_0x2449cb<_0x533779[_0xbc00('0x27')];_0x2449cb+=0x1){var _0x68fbe8=this[_0xbc00('0x20')](_0x533779[_0x2449cb][_0xbc00('0x28')]);if(_0x68fbe8){_0x533779[_0x2449cb][_0xbc00('0x22')]=_0x68fbe8[_0xbc00('0x22')];_0x533779[_0x2449cb][_0xbc00('0x29')]=!![];_0x533779[_0x2449cb]['lastAssignedTo']=_0x68fbe8[_0xbc00('0x23')];_0x533779[_0x2449cb][_0xbc00('0x25')]=_[_0xbc00('0x24')](_0x68fbe8[_0xbc00('0x25')])?util['format']('SIP/%s',_0x68fbe8['name']):_0x68fbe8[_0xbc00('0x25')];if(_0x533779[_0x2449cb][_0xbc00('0x2a')]){_0x533779[_0x2449cb][_0xbc00('0x2b')]=moment()[_0xbc00('0x26')](_0xbc00('0x2c'));}if(_0x533779[_0x2449cb][_0xbc00('0x2d')]){_0x533779[_0x2449cb][_0xbc00('0x2e')]=moment()[_0xbc00('0x26')](_0xbc00('0x2c'));}RpcMemberReport[_0xbc00('0x15')](_0x533779[_0x2449cb]);}RpcVoiceQueueReport[_0xbc00('0x2f')](_0x533779[_0x2449cb]);}};function extractCalleridNumber(_0x337fec){var _0x35b3bf=_0x337fec[_0xbc00('0x30')](/<(.*?)>/);return _0x35b3bf?_0x35b3bf[0x1]:_0x337fec;}Report[_0xbc00('0x10')][_0xbc00('0x31')]=function(_0x5f2076){_0x5f2076['destination']=_0x5f2076['destination']||_0x5f2076[_0xbc00('0x32')];if(_0x5f2076[_0xbc00('0x33')]==_0xbc00('0x34')){_0x5f2076[_0xbc00('0x35')]=_0xbc00('0x36');_0x5f2076[_0xbc00('0x37')]=_0x5f2076['queue'];if(_0x5f2076[_0xbc00('0x38')]=='from-voip-provider'){_0x5f2076[_0xbc00('0x22')]='';_0x5f2076[_0xbc00('0x39')]=extractCalleridNumber(_0x5f2076[_0xbc00('0x3a')]);}else if(_0x5f2076[_0xbc00('0x38')]=='from-sip'){if(_0x5f2076[_0xbc00('0x39')]==_0xbc00('0x3b')){_0x5f2076[_0xbc00('0x39')]=extractCalleridNumber(_0x5f2076[_0xbc00('0x3c')]);_0x5f2076[_0xbc00('0x3d')]=_0x5f2076[_0xbc00('0x3e')];_0x5f2076[_0xbc00('0x3f')]=[_0x5f2076['channel'],_0x5f2076[_0xbc00('0x40')]=_0x5f2076[_0xbc00('0x3f')]][0x0];_0x5f2076[_0xbc00('0x3a')]=_0x5f2076[_0xbc00('0x3c')];}else{_0x5f2076[_0xbc00('0x39')]=_0x5f2076[_0xbc00('0x3d')];_0x5f2076[_0xbc00('0x3d')]=_0x5f2076['originatecalleridnum'];if(_0x5f2076[_0xbc00('0x41')]==_0xbc00('0x42')){_0x5f2076[_0xbc00('0x22')]=_0x5f2076[_0xbc00('0x28')];}else{_0x5f2076['accountcode']='';}}}}else{_0x5f2076[_0xbc00('0x3a')]=util[_0xbc00('0x26')](_0xbc00('0x43'),_0x5f2076[_0xbc00('0x44')],_0x5f2076[_0xbc00('0x3d')]);}if(RpcVoiceTransferReport[_0xbc00('0x45')][_0x5f2076['linkedid']]){var _0x4e6d43=RpcVoiceTransferReport['transfers'][_0x5f2076['linkedid']];_0x4e6d43[_0xbc00('0x46')]=_0x5f2076[_0xbc00('0x47')];RpcVoiceTransferReport[_0xbc00('0x1d')](_0x4e6d43);delete RpcVoiceTransferReport[_0xbc00('0x45')][_0x5f2076[_0xbc00('0x48')]];}RpcVoiceCallReport[_0xbc00('0x2f')](_0x5f2076);if(_0x5f2076[_0xbc00('0x49')]){for(var _0x5bcadd=0x0;_0x5bcadd<_0x5f2076[_0xbc00('0x4a')][_0xbc00('0x27')];_0x5bcadd+=0x1){_0x5f2076[_0xbc00('0x4b')]=_0x5f2076[_0xbc00('0x4a')][_0x5bcadd][_0xbc00('0x4c')];_0x5f2076['createdAt']=_0x5f2076['monitors'][_0x5bcadd]['createdAt'];if(_0x5f2076['exten']=='xcally-motion-preview'){_0x5f2076['calleridnum']=_0x5f2076[_0xbc00('0x28')];_0x5f2076[_0xbc00('0x44')]=_0x5f2076[_0xbc00('0x4d')];_0x5f2076[_0xbc00('0x28')]=_0x5f2076[_0xbc00('0x22')];_0x5f2076[_0xbc00('0x4d')]=_0x5f2076[_0xbc00('0x4e')];_0x5f2076[_0xbc00('0x32')]=_0x5f2076['originatecalleridnum'];}else if(_0x5f2076[_0xbc00('0x32')]==_0xbc00('0x4f')){_0x5f2076[_0xbc00('0x3d')]=_0x5f2076['destination'];_0x5f2076['exten']=_0x5f2076['originatecalleridnum'];}RpcVoiceRecording[_0xbc00('0x2f')](_0x5f2076);}}};Report['prototype'][_0xbc00('0x19')]=function(_0x507da2){if(_['isArray'](_0x507da2)){_0x507da2[_0xbc00('0x50')](function(_0x556031){RpcVoiceAgentReport['create'](_0x556031);});}else{RpcVoiceAgentReport['create'](_0x507da2);}};Report[_0xbc00('0x10')][_0xbc00('0x1b')]=function(_0x5514b6){RpcVoiceDialReport[_0xbc00('0x2f')](_0x5514b6);var _0x2858aa;var _0x5998ab;var _0x2ea833=_0x5514b6[_0xbc00('0x40')];if(_[_0xbc00('0x51')](_0x2ea833,'Local')){_0x5998ab=_0x2ea833[_0xbc00('0x52')](_0x2ea833[_0xbc00('0x53')]('/')+0x1,_0x2ea833[_0xbc00('0x53')]('@'));_0x2858aa=_[_0xbc00('0x21')](this[_0xbc00('0xe')],function(_0x4122cc){return _0x4122cc['mobile']==_0x5998ab||_0x4122cc['phone']==_0x5998ab||_0x4122cc[_0xbc00('0x22')]==_0x5998ab;});}else{_0x5998ab=_0x2ea833[_0xbc00('0x52')](_0x2ea833['indexOf']('/')+0x1,_0x2ea833[_0xbc00('0x54')]('-'));_0x2858aa=this[_0xbc00('0x20')](_0x5998ab);}if(_0x2858aa){_0x5514b6[_0xbc00('0x25')]=_['isNil'](_0x2858aa['interface'])?util[_0xbc00('0x26')]('SIP/%s',_0x2858aa[_0xbc00('0x23')]):_0x2858aa['interface'];_0x5514b6['membername']=_0x2858aa[_0xbc00('0x23')];_0x5514b6[_0xbc00('0x22')]=_0x2858aa[_0xbc00('0x22')];RpcMemberReport['voiceDialReport'](_0x5514b6);}};Report[_0xbc00('0x10')][_0xbc00('0x1d')]=function(_0x5c65a2){RpcVoiceTransferReport[_0xbc00('0x45')][_0x5c65a2['transfererlinkedid']]=_0x5c65a2;};Report[_0xbc00('0x10')][_0xbc00('0x1f')]=function(_0x5ed360){RpcVoiceTransferReport[_0xbc00('0x1f')](_0x5ed360);};module[_0xbc00('0x55')]=Report; \ No newline at end of file +var _0x9746=['uniqueid','monitor','monitorFilename','createdAt','monitors','connectedlinename','membername','exten','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','name','find','interface','format','length','findAgent','connectedlinenum','accountcode','assigned','lastAssignedTo','isNil','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','destination','dialer','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','callerid','calleridnum','disposition','calleridname','transfers','linkedid','transfereelinkedid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9746,0xbb));var _0x6974=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9746[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var moment=require(_0x6974('0x0'));var util=require(_0x6974('0x1'));var config=require('../../../config/environment');var ami=require(_0x6974('0x2'));var RpcVoiceAgentReport=require(_0x6974('0x3'));var RpcVoiceCallReport=require(_0x6974('0x4'));var RpcVoiceDialReport=require(_0x6974('0x5'));var RpcMemberReport=require(_0x6974('0x6'));var RpcVoiceQueueReport=require(_0x6974('0x7'));var RpcVoiceRecording=require(_0x6974('0x8'));var RpcVoiceTransferReport=require(_0x6974('0x9'));var VoiceQueueReport=require(_0x6974('0xa'));var VoiceCallReport=require(_0x6974('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x6974('0xc'));var UserReport=require(_0x6974('0xd'));function Report(_0x206c7b){this[_0x6974('0xe')]=_0x206c7b;this[_0x6974('0xf')]=_0x206c7b[_0x6974('0xf')];this[_0x6974('0x10')]=_0x206c7b[_0x6974('0x10')];}Report[_0x6974('0x11')][_0x6974('0x12')]=function(_0x40db53){var _0x335d94=new VoiceQueueReport(this['realtime']);var _0x5ca27e=new VoiceAgentReport(this['realtime']);var _0x4e0fe5=new VoiceDialReport(this[_0x6974('0xe')]);var _0x5c5b1b=new VoiceCallReport(this['realtime']);var _0x4235a7=new UserReport(this[_0x6974('0xe')]);if(config[_0x6974('0x13')]&&config[_0x6974('0x13')][_0x6974('0x14')]){ami['on']('custom:voiceQueueReport',this[_0x6974('0x15')][_0x6974('0x16')](this));ami['on'](_0x6974('0x17'),this[_0x6974('0x18')]['bind'](this));ami['on'](_0x6974('0x19'),this[_0x6974('0x1a')][_0x6974('0x16')](this));ami['on'](_0x6974('0x1b'),this[_0x6974('0x1c')][_0x6974('0x16')](this));ami['on'](_0x6974('0x1d'),this[_0x6974('0x1e')][_0x6974('0x16')](this));ami['on']('attendedtransfer',this[_0x6974('0x1f')][_0x6974('0x16')](this));}};Report['prototype']['findAgent']=function(_0x25f573){var _0x20484e;_0x20484e=_['find'](this['agents'],function(_0x1edca2){return _0x1edca2['accountcode']==_0x25f573||_0x1edca2['name']==_0x25f573;});if(_['isNil'](_0x20484e)){var _0x1041b7=_['find'](this['telephones'],function(_0x4f610f){return _0x4f610f['accountcode']==_0x25f573||_0x4f610f[_0x6974('0x20')]==_0x25f573;});if(_0x1041b7){_0x20484e=_[_0x6974('0x21')](this['agents'],function(_0x582fc7){return _0x582fc7[_0x6974('0x22')]==util[_0x6974('0x23')]('SIP/%s',_0x1041b7['name']);});}}return _0x20484e;};Report[_0x6974('0x11')][_0x6974('0x15')]=function(_0x3102ea){for(var _0x12d5b4=0x0;_0x12d5b4<_0x3102ea[_0x6974('0x24')];_0x12d5b4+=0x1){var _0x59c328=this[_0x6974('0x25')](_0x3102ea[_0x12d5b4][_0x6974('0x26')]);if(_0x59c328){_0x3102ea[_0x12d5b4][_0x6974('0x27')]=_0x59c328[_0x6974('0x27')];_0x3102ea[_0x12d5b4][_0x6974('0x28')]=!![];_0x3102ea[_0x12d5b4][_0x6974('0x29')]=_0x59c328[_0x6974('0x20')];_0x3102ea[_0x12d5b4][_0x6974('0x22')]=_[_0x6974('0x2a')](_0x59c328['interface'])?util['format'](_0x6974('0x2b'),_0x59c328[_0x6974('0x20')]):_0x59c328[_0x6974('0x22')];if(_0x3102ea[_0x12d5b4][_0x6974('0x2c')]){_0x3102ea[_0x12d5b4][_0x6974('0x2d')]=moment()[_0x6974('0x23')](_0x6974('0x2e'));}if(_0x3102ea[_0x12d5b4][_0x6974('0x2f')]){_0x3102ea[_0x12d5b4]['queuecallerexitAt']=moment()[_0x6974('0x23')](_0x6974('0x2e'));}RpcMemberReport[_0x6974('0x15')](_0x3102ea[_0x12d5b4]);}RpcVoiceQueueReport[_0x6974('0x30')](_0x3102ea[_0x12d5b4]);}};function extractCalleridNumber(_0x3a96ec){var _0x5885fd=_0x3a96ec['match'](/<(.*?)>/);return _0x5885fd?_0x5885fd[0x1]:_0x3a96ec;}Report[_0x6974('0x11')][_0x6974('0x18')]=function(_0x26f037){_0x26f037[_0x6974('0x31')]=_0x26f037['destination']||_0x26f037['exten'];if(_0x26f037['type']==_0x6974('0x32')){_0x26f037[_0x6974('0x33')]='queue';_0x26f037[_0x6974('0x34')]=_0x26f037[_0x6974('0x35')];if(_0x26f037[_0x6974('0x36')]==_0x6974('0x37')){_0x26f037['accountcode']='';_0x26f037[_0x6974('0x31')]=extractCalleridNumber(_0x26f037['callerid']);}else if(_0x26f037['context']==_0x6974('0x38')){if(_0x26f037[_0x6974('0x31')]==_0x6974('0x39')){_0x26f037[_0x6974('0x31')]=extractCalleridNumber(_0x26f037['calleridpreview']);_0x26f037['calleridnum']=_0x26f037[_0x6974('0x3a')];_0x26f037[_0x6974('0x3b')]=[_0x26f037['channel'],_0x26f037[_0x6974('0x3c')]=_0x26f037[_0x6974('0x3b')]][0x0];_0x26f037[_0x6974('0x3d')]=_0x26f037['calleridpreview'];}else{_0x26f037[_0x6974('0x31')]=_0x26f037[_0x6974('0x3e')];_0x26f037[_0x6974('0x3e')]=_0x26f037[_0x6974('0x3a')];if(_0x26f037[_0x6974('0x3f')]=='ANSWERED'){_0x26f037['accountcode']=_0x26f037['connectedlinenum'];}else{_0x26f037[_0x6974('0x27')]='';}}}}else{_0x26f037[_0x6974('0x3d')]=util[_0x6974('0x23')]('\x22%s\x22\x20<%s>',_0x26f037[_0x6974('0x40')],_0x26f037['calleridnum']);}if(RpcVoiceTransferReport[_0x6974('0x41')][_0x26f037[_0x6974('0x42')]]){var _0x491828=RpcVoiceTransferReport[_0x6974('0x41')][_0x26f037['linkedid']];_0x491828[_0x6974('0x43')]=_0x26f037[_0x6974('0x44')];RpcVoiceTransferReport[_0x6974('0x1e')](_0x491828);delete RpcVoiceTransferReport[_0x6974('0x41')][_0x26f037[_0x6974('0x42')]];}RpcVoiceCallReport[_0x6974('0x30')](_0x26f037);if(_0x26f037[_0x6974('0x45')]){for(var _0x1b0ccc=0x0;_0x1b0ccc<_0x26f037['monitors']['length'];_0x1b0ccc+=0x1){_0x26f037[_0x6974('0x46')]=_0x26f037['monitors'][_0x1b0ccc]['filename'];_0x26f037[_0x6974('0x47')]=_0x26f037[_0x6974('0x48')][_0x1b0ccc][_0x6974('0x47')];if(_0x26f037['exten']=='xcally-motion-preview'){_0x26f037[_0x6974('0x3e')]=_0x26f037[_0x6974('0x26')];_0x26f037['calleridname']=_0x26f037[_0x6974('0x49')];_0x26f037[_0x6974('0x26')]=_0x26f037['accountcode'];_0x26f037[_0x6974('0x49')]=_0x26f037[_0x6974('0x4a')];_0x26f037[_0x6974('0x4b')]=_0x26f037[_0x6974('0x3a')];}else if(_0x26f037[_0x6974('0x4b')]==_0x6974('0x4c')){_0x26f037[_0x6974('0x3e')]=_0x26f037[_0x6974('0x31')];_0x26f037['exten']=_0x26f037[_0x6974('0x3a')];}RpcVoiceRecording[_0x6974('0x30')](_0x26f037);}}};Report[_0x6974('0x11')][_0x6974('0x1a')]=function(_0x349b25){if(_['isArray'](_0x349b25)){_0x349b25[_0x6974('0x4d')](function(_0x541a07){RpcVoiceAgentReport[_0x6974('0x30')](_0x541a07);});}else{RpcVoiceAgentReport[_0x6974('0x30')](_0x349b25);}};Report[_0x6974('0x11')]['voiceDialReport']=function(_0x2d1c40){RpcVoiceDialReport[_0x6974('0x30')](_0x2d1c40);var _0x130000;var _0x54187b;var _0x2c87b0=_0x2d1c40[_0x6974('0x3c')];if(_[_0x6974('0x4e')](_0x2c87b0,_0x6974('0x4f'))){_0x54187b=_0x2c87b0[_0x6974('0x50')](_0x2c87b0['indexOf']('/')+0x1,_0x2c87b0[_0x6974('0x51')]('@'));_0x130000=_[_0x6974('0x21')](this[_0x6974('0xf')],function(_0x3d7e26){return _0x3d7e26[_0x6974('0x52')]==_0x54187b||_0x3d7e26[_0x6974('0x53')]==_0x54187b||_0x3d7e26[_0x6974('0x27')]==_0x54187b;});}else{_0x54187b=_0x2c87b0[_0x6974('0x50')](_0x2c87b0[_0x6974('0x51')]('/')+0x1,_0x2c87b0[_0x6974('0x54')]('-'));_0x130000=this['findAgent'](_0x54187b);}if(_0x130000){_0x2d1c40[_0x6974('0x22')]=_[_0x6974('0x2a')](_0x130000[_0x6974('0x22')])?util[_0x6974('0x23')](_0x6974('0x2b'),_0x130000['name']):_0x130000[_0x6974('0x22')];_0x2d1c40[_0x6974('0x4a')]=_0x130000[_0x6974('0x20')];_0x2d1c40[_0x6974('0x27')]=_0x130000[_0x6974('0x27')];RpcMemberReport[_0x6974('0x1c')](_0x2d1c40);}};Report['prototype'][_0x6974('0x1e')]=function(_0x537feb){RpcVoiceTransferReport[_0x6974('0x41')][_0x537feb['transfererlinkedid']]=_0x537feb;};Report[_0x6974('0x11')][_0x6974('0x1f')]=function(_0x47e5f8){RpcVoiceTransferReport[_0x6974('0x1f')](_0x47e5f8);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 8f7ddf9..06c6a3a 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a52=['trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','resolve','actionDeviceStateList','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','username','debug','[userReport][registry]','find','state','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','[userReport][peerstatus]','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','exports','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a52,0x177));var _0x27a5=function(_0x1a8355,_0x31083b){_0x1a8355=_0x1a8355-0x0;var _0x2e1590=_0x7a52[_0x1a8355];return _0x2e1590;};'use strict';var _=require('lodash');var moment=require(_0x27a5('0x0'));var util=require(_0x27a5('0x1'));var Redis=require(_0x27a5('0x2'));var BPromise=require('bluebird');var config=require(_0x27a5('0x3'));var logger=require('../../../config/logger')(_0x27a5('0x4'));var ami=require(_0x27a5('0x5'));config[_0x27a5('0x6')]=_[_0x27a5('0x7')](config[_0x27a5('0x6')],{'host':_0x27a5('0x8'),'port':0x18eb});var io=require(_0x27a5('0x9'))(new Redis(config['redis']));function UserReport(_0x1ebba5){this[_0x27a5('0xa')]=_0x1ebba5[_0x27a5('0xa')];this[_0x27a5('0xb')]=_0x1ebba5['agents'];this[_0x27a5('0xc')]=_0x1ebba5[_0x27a5('0xc')];ami['on'](_0x27a5('0xd'),this[_0x27a5('0xe')][_0x27a5('0xf')](this));ami['on']('registry',this['syncRegistry']['bind'](this));ami['on'](_0x27a5('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0x27a5('0x11'),this['syncPeerStatus'][_0x27a5('0xf')](this));return this[_0x27a5('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0x27a5('0x13')](ami[_0x27a5('0x14')]())[_0x27a5('0x15')](function(_0x39d69c){logger[_0x27a5('0x16')]('[userReport][sipshowregistry]',util['inspect'](_0x39d69c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x27a5('0x17')]()[_0x27a5('0x13')](ami[_0x27a5('0x18')]())['catch'](function(_0x323145){logger['error']('[userReport][devicestatelist]',util[_0x27a5('0x19')](_0x323145,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x27a5('0x17')]()[_0x27a5('0x13')](ami[_0x27a5('0x1a')]())[_0x27a5('0x15')](function(_0xd74da7){logger[_0x27a5('0x16')](_0x27a5('0x1b'),util['inspect'](_0xd74da7,{'showHidden':![],'depth':null}));});}UserReport[_0x27a5('0x1c')][_0x27a5('0x12')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x27a5('0x13')](listDeviceStates())[_0x27a5('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x27a5('0x1c')]['isNotNull']=function(_0x5a7b8c){return _0x5a7b8c!==null&&!_[_0x27a5('0x1d')](_0x5a7b8c);};UserReport[_0x27a5('0x1c')][_0x27a5('0x1e')]=function(_0xd522bb,_0x5a4611,_0xcedd9c){io['to'](_0xd522bb)[_0x27a5('0x1e')](_0x5a4611,_0xcedd9c);};UserReport[_0x27a5('0x1c')][_0x27a5('0xe')]=function(_0x5675be){try{if(this[_0x27a5('0x1f')](_0x5675be)){logger[_0x27a5('0x20')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5675be[_0x27a5('0x21')],_0x5675be['state']);logger[_0x27a5('0x22')](_0x27a5('0x23'),util[_0x27a5('0x19')](_0x5675be,{'showHidden':![],'depth':null}));var _0x715f4d=_[_0x27a5('0x24')](this['trunks'],{'defaultuser':_0x5675be[_0x27a5('0x21')]});if(_0x715f4d){_0x5675be['stateRegistry']=_0x5675be[_0x27a5('0x25')];_[_0x27a5('0x26')](_0x715f4d,_[_0x27a5('0x27')](_0x5675be,[_0x27a5('0x28'),_0x27a5('0x29'),'username','state']));logger[_0x27a5('0x22')](_0x27a5('0x2a'),util[_0x27a5('0x19')](_0x715f4d,{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util[_0x27a5('0x2b')]('trunk:%s',_0x715f4d['name']),_0x27a5('0x2c'),_0x715f4d);}}}catch(_0x43a85b){logger[_0x27a5('0x16')]('[userReport][registry]',util[_0x27a5('0x19')](_0x43a85b,{'showHidden':![],'depth':null}));}};UserReport[_0x27a5('0x1c')][_0x27a5('0x2d')]=function(_0x48cefc){try{if(this[_0x27a5('0x1f')](_0x48cefc)){logger[_0x27a5('0x20')](_0x27a5('0x2e'),_0x48cefc[_0x27a5('0x2f')],_0x48cefc[_0x27a5('0x25')]);logger[_0x27a5('0x22')](_0x27a5('0x30'),util[_0x27a5('0x19')](_0x48cefc,{'showHidden':![],'depth':null}));if(this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]]){if(!this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x31')]||_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()==_0x27a5('0x33')){this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x31')]=![];if(this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')]['toLowerCase']()){this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]]['stateTime']=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}this['agents'][_0x48cefc['device']]['state']=_0x48cefc[_0x27a5('0x25')]['toLowerCase']();this[_0x27a5('0xb')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x35')](_0x48cefc);}}else if(this[_0x27a5('0xc')][_0x48cefc['device']]){if(this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()['format']('x'));}this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]]['state']=_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]();logger['debug'](_0x27a5('0x37'),util[_0x27a5('0x19')](this['telephones'][_0x48cefc[_0x27a5('0x2f')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util[_0x27a5('0x2b')]('telephone:%s',this[_0x27a5('0xc')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x38')]),_0x27a5('0x39'),this[_0x27a5('0xc')][_0x48cefc['device']]);}else if(this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]]){if(this['trunks'][_0x48cefc[_0x27a5('0x2f')]]['state']!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}this['trunks'][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x25')]=_0x48cefc['state'][_0x27a5('0x32')]();logger[_0x27a5('0x22')](_0x27a5('0x3a'),util[_0x27a5('0x19')](this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util['format'](_0x27a5('0x3b'),this[_0x27a5('0xa')][_0x48cefc[_0x27a5('0x2f')]][_0x27a5('0x38')]),'trunk:save',this[_0x27a5('0xa')][_0x48cefc['device']]);}else if(_[_0x27a5('0x3c')](_0x48cefc[_0x27a5('0x2f')],_0x27a5('0x3d'))){var _0x377973=_0x48cefc[_0x27a5('0x2f')];var _0x32468b=_0x377973[_0x27a5('0x3e')](_0x377973[_0x27a5('0x3f')]('/')+0x1,_0x377973[_0x27a5('0x3f')]('@'));var _0x55bea0=_[_0x27a5('0x24')](this['agents'],function(_0x564ded){return _0x564ded[_0x27a5('0x40')]==_0x32468b||_0x564ded[_0x27a5('0x41')]==_0x32468b||_0x564ded[_0x27a5('0x42')]==_0x32468b;});if(_0x55bea0){if(_0x55bea0[_0x27a5('0x25')]!==_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]()){_0x55bea0[_0x27a5('0x36')]=_[_0x27a5('0x34')](moment()[_0x27a5('0x2b')]('x'));}_0x55bea0[_0x27a5('0x25')]=_0x48cefc[_0x27a5('0x25')][_0x27a5('0x32')]();_0x55bea0[_0x27a5('0x31')]=!![];_0x55bea0[_0x27a5('0x35')](_0x48cefc);}}}}catch(_0x45ef04){logger['error'](_0x27a5('0x30'),util[_0x27a5('0x19')](_0x45ef04,{'showHidden':![],'depth':null}));}};UserReport[_0x27a5('0x1c')][_0x27a5('0x43')]=function(_0xcaa7bf){try{if(this[_0x27a5('0x1f')](_0xcaa7bf)&&this[_0x27a5('0x1f')](_0xcaa7bf[_0x27a5('0x11')])){logger[_0x27a5('0x20')](_0x27a5('0x44'),_0xcaa7bf['peer'],_0xcaa7bf['address'],_0xcaa7bf[_0x27a5('0x11')]);logger[_0x27a5('0x22')](_0x27a5('0x45'),util[_0x27a5('0x19')](_0xcaa7bf,{'showHidden':![],'depth':null}));if(this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]){if(!this['agents'][_0xcaa7bf[_0x27a5('0x46')]]['local']||_0xcaa7bf[_0x27a5('0x11')][_0x27a5('0x32')]()==_0x27a5('0x47')){this['agents'][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x31')]=![];this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x48')]=_0xcaa7bf['peerstatus'][_0x27a5('0x32')]();this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]['address']=_0xcaa7bf[_0x27a5('0x49')];this[_0x27a5('0xb')][_0xcaa7bf[_0x27a5('0x46')]]['updateStatusRealtime'](_0xcaa7bf);}}else if(this[_0x27a5('0xc')][_0xcaa7bf[_0x27a5('0x46')]]){this['telephones'][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x48')]=_0xcaa7bf[_0x27a5('0x11')][_0x27a5('0x32')]();this[_0x27a5('0xc')][_0xcaa7bf['peer']]['address']=_0xcaa7bf['address'];logger['debug'](_0x27a5('0x4a'),util['inspect'](this['telephones'][_0xcaa7bf[_0x27a5('0x46')]],{'showHidden':![],'depth':null}));this[_0x27a5('0x1e')](util['format'](_0x27a5('0x4b'),this[_0x27a5('0xc')][_0xcaa7bf['peer']]['name']),_0x27a5('0x39'),this[_0x27a5('0xc')][_0xcaa7bf[_0x27a5('0x46')]]);}else if(this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]){this[_0x27a5('0xa')][_0xcaa7bf['peer']][_0x27a5('0x48')]=_0xcaa7bf[_0x27a5('0x11')]['toLowerCase']();this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]['address']=_0xcaa7bf[_0x27a5('0x49')];logger[_0x27a5('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x27a5('0x19')](this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x27a5('0x2b')]('trunk:%s',this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]][_0x27a5('0x38')]),'trunk:save',this[_0x27a5('0xa')][_0xcaa7bf[_0x27a5('0x46')]]);}}}catch(_0x49613e){logger['error'](_0x27a5('0x45'),util[_0x27a5('0x19')](_0x49613e,{'showHidden':![],'depth':null}));}};module[_0x27a5('0x4c')]=UserReport; \ No newline at end of file +var _0xdf47=['registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','actionDeviceStateList','catch','actionSipPeerStatus','[userReport][sippeerstatus]','inspect','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','stateRegistry','merge','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','find','mobile','[userReport][devicestatechange]','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind'];(function(_0x4c41c4,_0x75bc8a){var _0x2bdc48=function(_0x2ea5e8){while(--_0x2ea5e8){_0x4c41c4['push'](_0x4c41c4['shift']());}};_0x2bdc48(++_0x75bc8a);}(_0xdf47,0x89));var _0x7df4=function(_0x23412b,_0x4fb821){_0x23412b=_0x23412b-0x0;var _0x806ff2=_0xdf47[_0x23412b];return _0x806ff2;};'use strict';var _=require(_0x7df4('0x0'));var moment=require(_0x7df4('0x1'));var util=require(_0x7df4('0x2'));var Redis=require('ioredis');var BPromise=require(_0x7df4('0x3'));var config=require(_0x7df4('0x4'));var logger=require(_0x7df4('0x5'))(_0x7df4('0x6'));var ami=require(_0x7df4('0x7'));config[_0x7df4('0x8')]=_[_0x7df4('0x9')](config[_0x7df4('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7df4('0xa'))(new Redis(config['redis']));function UserReport(_0x5e0e5f){this['trunks']=_0x5e0e5f[_0x7df4('0xb')];this[_0x7df4('0xc')]=_0x5e0e5f[_0x7df4('0xc')];this[_0x7df4('0xd')]=_0x5e0e5f[_0x7df4('0xd')];ami['on'](_0x7df4('0xe'),this[_0x7df4('0xf')][_0x7df4('0x10')](this));ami['on'](_0x7df4('0x11'),this[_0x7df4('0xf')][_0x7df4('0x10')](this));ami['on'](_0x7df4('0x12'),this[_0x7df4('0x13')][_0x7df4('0x10')](this));ami['on'](_0x7df4('0x14'),this[_0x7df4('0x15')][_0x7df4('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x7df4('0x16')]()[_0x7df4('0x17')](ami[_0x7df4('0x18')]())['catch'](function(_0x5cdf81){logger[_0x7df4('0x19')](_0x7df4('0x1a'),util['inspect'](_0x5cdf81,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7df4('0x16')]()[_0x7df4('0x17')](ami[_0x7df4('0x1b')]())[_0x7df4('0x1c')](function(_0x27a391){logger[_0x7df4('0x19')]('[userReport][devicestatelist]',util['inspect'](_0x27a391,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7df4('0x16')]()[_0x7df4('0x17')](ami[_0x7df4('0x1d')]())[_0x7df4('0x1c')](function(_0x479b4b){logger[_0x7df4('0x19')](_0x7df4('0x1e'),util[_0x7df4('0x1f')](_0x479b4b,{'showHidden':![],'depth':null}));});}UserReport[_0x7df4('0x20')][_0x7df4('0x21')]=function(){setInterval(function(){BPromise['resolve']()[_0x7df4('0x17')](showSipRegistrations())['then'](listDeviceStates())[_0x7df4('0x17')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x7df4('0x22')]=function(_0x3096e6){return _0x3096e6!==null&&!_[_0x7df4('0x23')](_0x3096e6);};UserReport[_0x7df4('0x20')][_0x7df4('0x24')]=function(_0x50b52d,_0x1c8e00,_0x39a460){io['to'](_0x50b52d)['emit'](_0x1c8e00,_0x39a460);};UserReport[_0x7df4('0x20')]['syncRegistry']=function(_0x277f8c){try{if(this['isNotNull'](_0x277f8c)){logger[_0x7df4('0x25')](_0x7df4('0x26'),_0x277f8c[_0x7df4('0x27')],_0x277f8c[_0x7df4('0x28')]);logger[_0x7df4('0x29')]('[userReport][registry]',util['inspect'](_0x277f8c,{'showHidden':![],'depth':null}));var _0x3b70cd=_['find'](this[_0x7df4('0xb')],{'defaultuser':_0x277f8c['username']});if(_0x3b70cd){_0x277f8c[_0x7df4('0x2a')]=_0x277f8c['state'];_[_0x7df4('0x2b')](_0x3b70cd,_['omit'](_0x277f8c,['event',_0x7df4('0x2c'),_0x7df4('0x27'),_0x7df4('0x28')]));logger[_0x7df4('0x29')](_0x7df4('0x2d'),util['inspect'](_0x3b70cd,{'showHidden':![],'depth':null}));this[_0x7df4('0x24')](util['format'](_0x7df4('0x2e'),_0x3b70cd[_0x7df4('0x2f')]),_0x7df4('0x30'),_0x3b70cd);}}}catch(_0x2ae221){logger[_0x7df4('0x19')](_0x7df4('0x31'),util['inspect'](_0x2ae221,{'showHidden':![],'depth':null}));}};UserReport[_0x7df4('0x20')][_0x7df4('0x13')]=function(_0x110dbd){try{if(this[_0x7df4('0x22')](_0x110dbd)){logger[_0x7df4('0x25')](_0x7df4('0x32'),_0x110dbd[_0x7df4('0x33')],_0x110dbd[_0x7df4('0x28')]);logger[_0x7df4('0x29')]('[userReport][devicestatechange]',util['inspect'](_0x110dbd,{'showHidden':![],'depth':null}));if(this[_0x7df4('0xc')][_0x110dbd[_0x7df4('0x33')]]){if(!this[_0x7df4('0xc')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x34')]||_0x110dbd['state'][_0x7df4('0x35')]()==_0x7df4('0x36')){this[_0x7df4('0xc')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x34')]=![];if(this['agents'][_0x110dbd['device']][_0x7df4('0x28')]!==_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]()){this[_0x7df4('0xc')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x37')]=_[_0x7df4('0x38')](moment()[_0x7df4('0x39')]('x'));}this['agents'][_0x110dbd[_0x7df4('0x33')]]['state']=_0x110dbd[_0x7df4('0x28')]['toLowerCase']();this[_0x7df4('0xc')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x3a')](_0x110dbd);}}else if(this[_0x7df4('0xd')][_0x110dbd[_0x7df4('0x33')]]){if(this[_0x7df4('0xd')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x28')]!==_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]()){this['telephones'][_0x110dbd[_0x7df4('0x33')]]['stateTime']=_[_0x7df4('0x38')](moment()['format']('x'));}this[_0x7df4('0xd')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x28')]=_0x110dbd['state'][_0x7df4('0x35')]();logger[_0x7df4('0x29')](_0x7df4('0x3b'),util[_0x7df4('0x1f')](this[_0x7df4('0xd')][_0x110dbd['device']],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this['telephones'][_0x110dbd[_0x7df4('0x33')]]['name']),_0x7df4('0x3c'),this[_0x7df4('0xd')][_0x110dbd[_0x7df4('0x33')]]);}else if(this['trunks'][_0x110dbd[_0x7df4('0x33')]]){if(this['trunks'][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x28')]!==_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]()){this['trunks'][_0x110dbd['device']][_0x7df4('0x37')]=_[_0x7df4('0x38')](moment()[_0x7df4('0x39')]('x'));}this[_0x7df4('0xb')][_0x110dbd[_0x7df4('0x33')]][_0x7df4('0x28')]=_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]();logger[_0x7df4('0x29')](_0x7df4('0x3d'),util['inspect'](this[_0x7df4('0xb')][_0x110dbd['device']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x7df4('0x2e'),this[_0x7df4('0xb')][_0x110dbd['device']]['name']),_0x7df4('0x30'),this[_0x7df4('0xb')][_0x110dbd[_0x7df4('0x33')]]);}else if(_[_0x7df4('0x3e')](_0x110dbd['device'],_0x7df4('0x3f'))){var _0x2c0015=_0x110dbd[_0x7df4('0x33')];var _0x2ef54a=_0x2c0015['substring'](_0x2c0015['indexOf']('/')+0x1,_0x2c0015[_0x7df4('0x40')]('@'));var _0x1eea3e=_[_0x7df4('0x41')](this[_0x7df4('0xc')],function(_0x222841){return _0x222841[_0x7df4('0x42')]==_0x2ef54a||_0x222841['phone']==_0x2ef54a||_0x222841['accountcode']==_0x2ef54a;});if(_0x1eea3e){if(_0x1eea3e[_0x7df4('0x28')]!==_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]()){_0x1eea3e[_0x7df4('0x37')]=_[_0x7df4('0x38')](moment()[_0x7df4('0x39')]('x'));}_0x1eea3e[_0x7df4('0x28')]=_0x110dbd[_0x7df4('0x28')][_0x7df4('0x35')]();_0x1eea3e['local']=!![];_0x1eea3e[_0x7df4('0x3a')](_0x110dbd);}}}}catch(_0x4703cf){logger[_0x7df4('0x19')](_0x7df4('0x43'),util[_0x7df4('0x1f')](_0x4703cf,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x52f2fe){try{if(this['isNotNull'](_0x52f2fe)&&this[_0x7df4('0x22')](_0x52f2fe[_0x7df4('0x14')])){logger[_0x7df4('0x25')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x52f2fe[_0x7df4('0x44')],_0x52f2fe[_0x7df4('0x45')],_0x52f2fe[_0x7df4('0x14')]);logger[_0x7df4('0x29')](_0x7df4('0x46'),util[_0x7df4('0x1f')](_0x52f2fe,{'showHidden':![],'depth':null}));if(this['agents'][_0x52f2fe[_0x7df4('0x44')]]){if(!this[_0x7df4('0xc')][_0x52f2fe['peer']][_0x7df4('0x34')]||_0x52f2fe[_0x7df4('0x14')][_0x7df4('0x35')]()==_0x7df4('0x47')){this['agents'][_0x52f2fe[_0x7df4('0x44')]]['local']=![];this[_0x7df4('0xc')][_0x52f2fe[_0x7df4('0x44')]][_0x7df4('0x48')]=_0x52f2fe[_0x7df4('0x14')][_0x7df4('0x35')]();this[_0x7df4('0xc')][_0x52f2fe['peer']][_0x7df4('0x45')]=_0x52f2fe[_0x7df4('0x45')];this['agents'][_0x52f2fe[_0x7df4('0x44')]][_0x7df4('0x3a')](_0x52f2fe);}}else if(this['telephones'][_0x52f2fe[_0x7df4('0x44')]]){this[_0x7df4('0xd')][_0x52f2fe['peer']]['status']=_0x52f2fe[_0x7df4('0x14')]['toLowerCase']();this[_0x7df4('0xd')][_0x52f2fe[_0x7df4('0x44')]][_0x7df4('0x45')]=_0x52f2fe[_0x7df4('0x45')];logger[_0x7df4('0x29')](_0x7df4('0x49'),util[_0x7df4('0x1f')](this[_0x7df4('0xd')][_0x52f2fe[_0x7df4('0x44')]],{'showHidden':![],'depth':null}));this[_0x7df4('0x24')](util['format'](_0x7df4('0x4a'),this[_0x7df4('0xd')][_0x52f2fe[_0x7df4('0x44')]]['name']),_0x7df4('0x3c'),this[_0x7df4('0xd')][_0x52f2fe['peer']]);}else if(this[_0x7df4('0xb')][_0x52f2fe[_0x7df4('0x44')]]){this['trunks'][_0x52f2fe['peer']][_0x7df4('0x48')]=_0x52f2fe['peerstatus'][_0x7df4('0x35')]();this[_0x7df4('0xb')][_0x52f2fe[_0x7df4('0x44')]][_0x7df4('0x45')]=_0x52f2fe[_0x7df4('0x45')];logger['debug'](_0x7df4('0x4b'),util[_0x7df4('0x1f')](this[_0x7df4('0xb')][_0x52f2fe['peer']],{'showHidden':![],'depth':null}));this[_0x7df4('0x24')](util[_0x7df4('0x39')](_0x7df4('0x2e'),this[_0x7df4('0xb')][_0x52f2fe[_0x7df4('0x44')]]['name']),_0x7df4('0x30'),this['trunks'][_0x52f2fe['peer']]);}}}catch(_0x2a0104){logger[_0x7df4('0x19')](_0x7df4('0x46'),util[_0x7df4('0x1f')](_0x2a0104,{'showHidden':![],'depth':null}));}};module[_0x7df4('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 3055cfa..0526fd2 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1250=['reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','value','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','info','uniqueid','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','voice','merge','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere'];(function(_0x5a4f3b,_0x344159){var _0x33e973=function(_0x2ff5b0){while(--_0x2ff5b0){_0x5a4f3b['push'](_0x5a4f3b['shift']());}};_0x33e973(++_0x344159);}(_0x1250,0xde));var _0x0125=function(_0x31654a,_0x3d7d79){_0x31654a=_0x31654a-0x0;var _0x107dfa=_0x1250[_0x31654a];return _0x107dfa;};'use strict';var _=require(_0x0125('0x0'));var moment=require('moment');var util=require(_0x0125('0x1'));var Redis=require(_0x0125('0x2'));var config=require(_0x0125('0x3'));var logger=require(_0x0125('0x4'))(_0x0125('0x5'));var ami=require('../ami');config['redis']=_[_0x0125('0x6')](config[_0x0125('0x7')],{'host':_0x0125('0x8'),'port':0x18eb});var io=require(_0x0125('0x9'))(new Redis(config[_0x0125('0x7')]));function VoiceAgentReport(_0x583d1f){this[_0x0125('0xa')]={};this[_0x0125('0xb')]=_0x583d1f[_0x0125('0xa')];this[_0x0125('0xc')]=_0x583d1f['voiceQueues'];this[_0x0125('0xd')]=_0x583d1f['agents'];this[_0x0125('0xe')]={};ami['on'](_0x0125('0xf'),this[_0x0125('0x10')][_0x0125('0x11')](this));ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x0125('0x12'),this[_0x0125('0x13')][_0x0125('0x11')](this));ami['on'](_0x0125('0x14'),this[_0x0125('0x15')][_0x0125('0x11')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0125('0x11')](this));ami['on'](_0x0125('0x16'),this[_0x0125('0x17')]['bind'](this));ami['on'](_0x0125('0x18'),this[_0x0125('0x19')][_0x0125('0x11')](this));ami['on']('musiconholdstart',this[_0x0125('0x1a')][_0x0125('0x11')](this));ami['on'](_0x0125('0x1b'),this[_0x0125('0x1c')][_0x0125('0x11')](this));ami['on'](_0x0125('0x1d'),this[_0x0125('0x1e')]['bind'](this));ami['on'](_0x0125('0x1f'),this[_0x0125('0x20')][_0x0125('0x11')](this));}VoiceAgentReport[_0x0125('0x21')]['emit']=function(_0x334491,_0x325b52,_0x79c804){io['to'](_0x334491)[_0x0125('0x22')](_0x325b52,_0x79c804);};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x23')]=function(_0x1e4b3a){return _0x1e4b3a!==null&&!_['isUndefined'](_0x1e4b3a);};VoiceAgentReport['prototype'][_0x0125('0x10')]=function(_0x4546de){try{if(this[_0x0125('0x23')](_0x4546de)){logger[_0x0125('0x24')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4546de[_0x0125('0x25')],_0x4546de['membername'],_0x4546de[_0x0125('0x26')]);logger['debug'](_0x0125('0x27'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](_0x4546de,{'showHidden':![],'depth':null}));if(_[_0x0125('0x29')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]])){this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]]={};}if(_['isUndefined'](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de[_0x0125('0x26')]])){this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']]={'agentcalledAt':moment()['format'](_0x0125('0x2a')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x4546de['queue']]?this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]]['mandatoryDisposition']||![]:![],'type':this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]]?this[_0x0125('0xc')][_0x4546de[_0x0125('0x2b')]][_0x0125('0x2c')]||'inbound':_0x0125('0x2d'),'variables':this[_0x0125('0xe')][_0x4546de['uniqueid']],'motionChannel':_0x0125('0x2e')};}_[_0x0125('0x2f')](this['channels'][_0x4546de['uniqueid']][_0x4546de[_0x0125('0x26')]],_['omit'](_0x4546de,['event',_0x0125('0x30')]));logger['debug'](_0x0125('0x31'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')]('custom:agentcalled',this['channels'][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']]);logger[_0x0125('0x32')](_0x0125('0x33'),_0x4546de['uniqueid'],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x4546de[_0x0125('0x25')]][_0x4546de['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0125('0x34')](_0x0125('0x35'),_0x4546de[_0x0125('0x36')]),_0x0125('0x37'),this[_0x0125('0xa')][_0x4546de['uniqueid']][_0x4546de[_0x0125('0x26')]]);}}catch(_0x4aa5c1){logger[_0x0125('0x38')](_0x0125('0x39'),_0x4546de[_0x0125('0x25')],util[_0x0125('0x28')](_0x4aa5c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x3a')]=function(_0x2b928f){try{if(this[_0x0125('0x23')](_0x2b928f)){if(this['channels'][_0x2b928f[_0x0125('0x25')]]){logger[_0x0125('0x32')](_0x0125('0x3b'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](_0x2b928f,{'showHidden':![],'depth':null}));for(var _0x4b062c in this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x0125('0x3c')](_0x4b062c)){if(_0x2b928f[_0x0125('0x26')]===_0x4b062c){logger[_0x0125('0x24')](_0x0125('0x3d'),_0x2b928f[_0x0125('0x25')],_0x2b928f[_0x0125('0x36')],_0x2b928f[_0x0125('0x26')]);this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x3e')]=moment()['format'](_0x0125('0x2a'));this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x3f')]=_0x2b928f[_0x0125('0x3f')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x40')]=_0x2b928f[_0x0125('0x40')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x41')]=_0x2b928f['destchannelstate'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['destchannelstatedesc']=_0x2b928f['destchannelstatedesc'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x42')]=_0x2b928f['holdtime'];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x43')]=_0x0125('0x44');if(this[_0x0125('0xb')][this[_0x0125('0xa')][_0x2b928f['uniqueid']][_0x4b062c][_0x0125('0x25')]]){var _0x5f53ae=this[_0x0125('0xb')][this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['uniqueid']][_0x0125('0x45')];this['channels'][_0x2b928f['uniqueid']][_0x4b062c][_0x0125('0x45')]=_0x5f53ae;_0x2b928f['routealias']=_0x5f53ae;}_['merge'](this[_0x0125('0xd')][_0x2b928f[_0x0125('0x46')]],_[_0x0125('0x47')](_0x2b928f,[_0x0125('0x2b'),_0x0125('0x48'),_0x0125('0x45')]));logger[_0x0125('0x32')](_0x0125('0x49'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x4a'),this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]]);logger[_0x0125('0x32')](_0x0125('0x4b'),_0x2b928f['uniqueid'],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0125('0x35'),_0x2b928f[_0x0125('0x36')]),_0x0125('0x4c'),this['channels'][_0x2b928f[_0x0125('0x25')]][_0x2b928f[_0x0125('0x26')]]);}else if(!this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['agentringnoanswer']&&!this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x4d')]){logger[_0x0125('0x24')](_0x0125('0x4e'),_0x2b928f[_0x0125('0x25')],this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x36')],_0x4b062c);this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x12')]=!![];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x4f')]=moment()[_0x0125('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x50')]=_0x2b928f[_0x0125('0x26')];this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]['answeredelsewheremembername']=_0x2b928f[_0x0125('0x36')];this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x43')]=_0x0125('0x51');this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c][_0x0125('0x52')]=_0x0125('0x51');logger['debug'](_0x0125('0x53'),_0x2b928f[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x2b928f[_0x0125('0x25')]][_0x4b062c],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x2b928f[_0x0125('0x25')]][_0x4b062c]);}}}}}}catch(_0x29053b){logger[_0x0125('0x38')](_0x0125('0x54'),_0x2b928f[_0x0125('0x25')],util['inspect'](_0x29053b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x13')]=function(_0x15dd30){try{if(this[_0x0125('0x23')](_0x15dd30)){logger[_0x0125('0x32')](_0x0125('0x55'),_0x15dd30[_0x0125('0x25')],util[_0x0125('0x28')](_0x15dd30,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]]&&this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]]){logger[_0x0125('0x24')](_0x0125('0x56'),_0x15dd30['uniqueid'],_0x15dd30[_0x0125('0x36')],_0x15dd30[_0x0125('0x26')]);this['channels'][_0x15dd30['uniqueid']][_0x15dd30['destuniqueid']][_0x0125('0x12')]=!![];this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]]['agentringnoanswerAt']=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]][_0x0125('0x43')]=_0x0125('0x57');this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]][_0x0125('0x52')]=_0x0125('0x57');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x15dd30[_0x0125('0x25')],util[_0x0125('0x28')](this['channels'][_0x15dd30[_0x0125('0x25')]][_0x15dd30[_0x0125('0x26')]],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x58'),this[_0x0125('0xa')][_0x15dd30[_0x0125('0x25')]][_0x15dd30['destuniqueid']]);}}}catch(_0x21c565){logger[_0x0125('0x38')]('[%s][voiceAgentReport][agentringnoanswer]',_0x15dd30['uniqueid'],util[_0x0125('0x28')](_0x21c565,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x15')]=function(_0x58fb65){try{if(this['isNotNull'](_0x58fb65)){logger[_0x0125('0x32')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x58fb65[_0x0125('0x25')],util['inspect'](_0x58fb65,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x58fb65['uniqueid']]){for(var _0x5b48d7 in this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]]['hasOwnProperty'](_0x5b48d7)&&!this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x12')]&&!this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7]['agentcomplete']){logger['info'](_0x0125('0x59'),_0x58fb65[_0x0125('0x25')],this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x36')],_0x5b48d7);this[_0x0125('0xa')][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x12')]=!![];this['channels'][_0x58fb65['uniqueid']][_0x5b48d7][_0x0125('0x4f')]=moment()['format'](_0x0125('0x2a'));this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x43')]=_0x0125('0x5a');this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7][_0x0125('0x52')]=_0x0125('0x5a');logger[_0x0125('0x32')](_0x0125('0x5b'),_0x58fb65[_0x0125('0x25')],util[_0x0125('0x28')](this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x5c'),this[_0x0125('0xa')][_0x58fb65[_0x0125('0x25')]][_0x5b48d7]);}}}}}catch(_0x1dd45a){logger[_0x0125('0x38')](_0x0125('0x5d'),_0x58fb65[_0x0125('0x25')],util['inspect'](_0x1dd45a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x5e')]=function(_0x5db041){try{if(this[_0x0125('0x23')](_0x5db041)){logger[_0x0125('0x32')](_0x0125('0x5f'),_0x5db041[_0x0125('0x25')],util[_0x0125('0x28')](_0x5db041,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]]){for(var _0x11b202 in this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x0125('0x3c')](_0x11b202)){if(this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x3e')]&&!this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x4d')]){logger['info'](_0x0125('0x60'),_0x5db041['uniqueid'],this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x36')],_0x11b202);this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x4d')]=!![];this['channels'][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x61')]=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x43')]='complete';this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202]['reason']=_0x5db041[_0x0125('0x52')]==_0x0125('0x62')?_0x0125('0x63'):_0x5db041['reason'];this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x64')]=_0x5db041['talktime'];if(this['voiceQueues'][_0x5db041[_0x0125('0x2b')]]&&this[_0x0125('0xc')][_0x5db041[_0x0125('0x2b')]][_0x0125('0x65')]){this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202][_0x0125('0x66')]=this[_0x0125('0xc')][_0x5db041[_0x0125('0x2b')]][_0x0125('0x67')];this[_0x0125('0xa')][_0x5db041['uniqueid']][_0x11b202][_0x0125('0x68')]=!![];}this['agents'][_0x5db041[_0x0125('0x46')]]=_[_0x0125('0x69')](this[_0x0125('0xd')][_0x5db041[_0x0125('0x46')]],[_0x0125('0x2b'),_0x0125('0x48')]);logger[_0x0125('0x32')](_0x0125('0x6a'),_0x5db041[_0x0125('0x25')],util['inspect'](this[_0x0125('0xa')][_0x5db041[_0x0125('0x25')]][_0x11b202],{'showHidden':![],'depth':null}));ami[_0x0125('0x22')](_0x0125('0x6b'),this['channels'][_0x5db041[_0x0125('0x25')]][_0x11b202]);logger[_0x0125('0x32')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5db041['uniqueid'],util['inspect'](this[_0x0125('0xa')][_0x5db041['uniqueid']][_0x11b202],{'showHidden':![],'depth':null}));this[_0x0125('0x22')](util['format'](_0x0125('0x35'),_0x5db041[_0x0125('0x36')]),_0x0125('0x6c'),this['channels'][_0x5db041['uniqueid']][_0x11b202]);}}}}}}catch(_0x31dc95){logger[_0x0125('0x38')](_0x0125('0x6d'),_0x5db041[_0x0125('0x25')],util[_0x0125('0x28')](_0x31dc95,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x17')]=function(_0x5891a4){try{if(this[_0x0125('0x23')](_0x5891a4)){logger[_0x0125('0x32')](_0x0125('0x6e'),_0x5891a4[_0x0125('0x25')],util[_0x0125('0x28')](_0x5891a4,{'showHidden':![],'depth':null}));this['addVariable'](_0x5891a4[_0x0125('0x25')],_[_0x0125('0x6f')](_0x5891a4['variable'])[0x0],_0x5891a4[_0x0125('0x70')]);if(this[_0x0125('0xa')][_0x5891a4['uniqueid']]){for(var _0x402567 in this[_0x0125('0xa')][_0x5891a4[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5891a4[_0x0125('0x25')]][_0x0125('0x3c')](_0x402567)){logger[_0x0125('0x24')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x5891a4[_0x0125('0x25')],_0x402567,_[_0x0125('0x6f')](_0x5891a4[_0x0125('0x71')])[0x0],_0x5891a4[_0x0125('0x70')]);if(_[_0x0125('0x29')](this[_0x0125('0xa')][_0x5891a4['uniqueid']][_0x402567][_0x0125('0xe')])){this['channels'][_0x5891a4[_0x0125('0x25')]][_0x402567][_0x0125('0xe')]={};}this[_0x0125('0xa')][_0x5891a4['uniqueid']][_0x402567][_0x0125('0xe')]=this[_0x0125('0xe')][_0x5891a4[_0x0125('0x25')]];}}}}}catch(_0x160263){logger[_0x0125('0x38')](_0x0125('0x72'),_0x5891a4[_0x0125('0x25')],util[_0x0125('0x28')](_0x160263,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')]['addVariable']=function(_0x49c85a,_0x3f6519,_0x57fc50){var _0x4ca00f=[_0x0125('0x73'),_0x0125('0x74'),'rtpaudioqosjitter',_0x0125('0x75'),'rtpaudioqosloss',_0x0125('0x76'),_0x0125('0x77'),_0x0125('0x78'),'sipcallid',_0x0125('0x79'),_0x0125('0x7a'),'bridgepvtcallid','membercalls',_0x0125('0x7b'),_0x0125('0x7c'),_0x0125('0x7d'),'membername',_0x0125('0x7e'),_0x0125('0x7f')];if(!_['isNil'](_0x3f6519)&&!_[_0x0125('0x80')](_0x4ca00f,_0x3f6519)){if(_['isUndefined'](this[_0x0125('0xe')][_0x49c85a])){this[_0x0125('0xe')][_0x49c85a]={};}this[_0x0125('0xe')][_0x49c85a][_0x3f6519]=_0x57fc50;}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x19')]=function(_0x5e5d20){try{if(this[_0x0125('0x23')](_0x5e5d20)){logger[_0x0125('0x32')]('[%s][voiceAgentReport][hangup]\x20event:',_0x5e5d20['uniqueid'],util[_0x0125('0x28')](_0x5e5d20,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]){for(var _0x9a1bee in this['channels'][_0x5e5d20[_0x0125('0x25')]]){if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]['hasOwnProperty'](_0x9a1bee)){if(this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x52')]=='transfer'&&this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x4d')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x5e5d20[_0x0125('0x25')],_0x9a1bee);this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]][_0x9a1bee][_0x0125('0x61')]=moment()[_0x0125('0x34')](_0x0125('0x2a'));}}}logger[_0x0125('0x32')](_0x0125('0x81'),_0x5e5d20[_0x0125('0x25')],util[_0x0125('0x28')](_[_0x0125('0x82')](this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x0125('0x22')]('custom:voiceAgentReport',_[_0x0125('0x82')](this[_0x0125('0xa')][_0x5e5d20['uniqueid']]));delete this[_0x0125('0xa')][_0x5e5d20[_0x0125('0x25')]];}if(this[_0x0125('0xe')][_0x5e5d20[_0x0125('0x25')]]){delete this[_0x0125('0xe')][_0x5e5d20['uniqueid']];}}}catch(_0x1be698){logger[_0x0125('0x38')](_0x0125('0x83'),_0x5e5d20[_0x0125('0x25')],util['inspect'](_0x1be698,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0125('0x1e')]=function(_0xa53272){try{if(this[_0x0125('0x23')](_0xa53272)){logger[_0x0125('0x32')](_0x0125('0x84'),_0xa53272[_0x0125('0x25')],util['inspect'](_0xa53272,{'showHidden':![],'depth':null}));if(this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]]){for(var _0x13a2e9 in this['channels'][_0xa53272['transfereeuniqueid']]){if(this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']][_0x0125('0x3c')](_0x13a2e9)){if(_0xa53272[_0x0125('0x86')]===_0x13a2e9){logger[_0x0125('0x24')](_0x0125('0x87'),_0xa53272[_0x0125('0x25')],this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x36')],_0x13a2e9);var _0x244177=moment();this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x4d')]=!![];this['channels'][_0xa53272['transfereeuniqueid']][_0x13a2e9]['agentcompleteAt']=moment()[_0x0125('0x34')](_0x0125('0x2a'));this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']][_0x13a2e9][_0x0125('0x43')]='complete';this[_0x0125('0xa')][_0xa53272[_0x0125('0x85')]][_0x13a2e9]['reason']=_0x0125('0x62');this['channels'][_0xa53272[_0x0125('0x85')]][_0x13a2e9]['talktime']=_0x244177['diff'](this['channels'][_0xa53272[_0x0125('0x85')]][_0x13a2e9][_0x0125('0x3e')],_0x0125('0x88'));}}}}if(this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']]){var _0x1f4a44=this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']];this[_0x0125('0xa')][_0xa53272['secondtransfereruniqueid']]=this['channels'][_0xa53272[_0x0125('0x85')]];this[_0x0125('0xa')][_0xa53272['transfereeuniqueid']]=_0x1f4a44;}}}catch(_0x21d4f9){logger[_0x0125('0x38')](_0x0125('0x89'),_0xa53272[_0x0125('0x25')],util[_0x0125('0x28')](_0x21d4f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x20')]=function(_0x2cd85a){try{if(this[_0x0125('0x23')](_0x2cd85a)){logger[_0x0125('0x32')](_0x0125('0x8a'),_0x2cd85a['uniqueid'],util[_0x0125('0x28')](_0x2cd85a,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cd85a[_0x0125('0x85')]]){for(var _0x418ecf in this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]]){if(this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x0125('0x3c')](_0x418ecf)){if(_0x2cd85a['transfereruniqueid']===_0x418ecf){logger[_0x0125('0x24')](_0x0125('0x8b'),_0x2cd85a['uniqueid'],this['channels'][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x36')],_0x418ecf);var _0x8bd46d=moment();this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['agentcomplete']=!![];this['channels'][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x61')]=_0x8bd46d;this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['lastevent']=_0x0125('0x8c');this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x52')]=_0x0125('0x62');this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf][_0x0125('0x64')]=_0x8bd46d[_0x0125('0x8d')](this[_0x0125('0xa')][_0x2cd85a[_0x0125('0x85')]][_0x418ecf]['agentconnectAt'],'seconds');}}}}}}catch(_0x15fe7d){logger[_0x0125('0x38')](_0x0125('0x8e'),_0x2cd85a[_0x0125('0x25')],util['inspect'](_0x15fe7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x1a')]=function(_0x4bebb7){var _0x1ed095='';try{if(this[_0x0125('0x23')](_0x4bebb7)){logger['debug'](_0x0125('0x8f'),_0x4bebb7[_0x0125('0x25')],util[_0x0125('0x28')](_0x4bebb7,{'showHidden':![],'depth':null}));if(_0x4bebb7[_0x0125('0x90')]){_0x1ed095=_0x4bebb7[_0x0125('0x90')][_0x0125('0x91')](0x0,_0x4bebb7[_0x0125('0x90')][_0x0125('0x92')]('-'));if(this['agents'][_0x1ed095]){logger[_0x0125('0x24')](_0x0125('0x93'),_0x4bebb7[_0x0125('0x25')],_0x1ed095);this['agents'][_0x1ed095]['onhold']=!![];}}}}catch(_0x4f46dd){logger[_0x0125('0x38')]('[%s][voiceAgentReport][musiconholdstart]',_0x4bebb7[_0x0125('0x25')],util[_0x0125('0x28')](_0x4f46dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0125('0x21')][_0x0125('0x1c')]=function(_0x5468dd){var _0x41c35a='';try{if(this['isNotNull'](_0x5468dd)){logger['debug'](_0x0125('0x94'),_0x5468dd[_0x0125('0x25')],util[_0x0125('0x28')](_0x5468dd,{'showHidden':![],'depth':null}));if(_0x5468dd[_0x0125('0x90')]){_0x41c35a=_0x5468dd[_0x0125('0x90')]['substring'](0x0,_0x5468dd['channel'][_0x0125('0x92')]('-'));if(this['agents'][_0x41c35a]){logger[_0x0125('0x24')](_0x0125('0x95'),_0x5468dd[_0x0125('0x25')],_0x41c35a);this[_0x0125('0xd')][_0x41c35a][_0x0125('0x96')]=![];}}}}catch(_0x7756f6){logger[_0x0125('0x38')]('[%s][voiceAgentReport][musiconholdstop]',_0x5468dd['uniqueid'],util[_0x0125('0x28')](_0x7756f6,{'showHidden':![],'depth':null}));}};module[_0x0125('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x8cc1=['rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','substring','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','called','queue','type','inbound','variables','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','inspect','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','format','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','agentcomplete','agentringnoanswerAt','YYYY-MM-DD\x20HH:mm:ss','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','rtpaudioqos','rtpaudioqosbridged'];(function(_0xe62aac,_0x31bdf8){var _0x5d8b98=function(_0x3fdef5){while(--_0x3fdef5){_0xe62aac['push'](_0xe62aac['shift']());}};_0x5d8b98(++_0x31bdf8);}(_0x8cc1,0x14e));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x18cc('0x0'));var util=require('util');var Redis=require(_0x18cc('0x1'));var config=require(_0x18cc('0x2'));var logger=require(_0x18cc('0x3'))(_0x18cc('0x4'));var ami=require('../ami');config[_0x18cc('0x5')]=_['defaults'](config[_0x18cc('0x5')],{'host':_0x18cc('0x6'),'port':0x18eb});var io=require(_0x18cc('0x7'))(new Redis(config[_0x18cc('0x5')]));function VoiceAgentReport(_0x32a0ca){this['channels']={};this[_0x18cc('0x8')]=_0x32a0ca[_0x18cc('0x9')];this[_0x18cc('0xa')]=_0x32a0ca[_0x18cc('0xa')];this[_0x18cc('0xb')]=_0x32a0ca[_0x18cc('0xb')];this['variables']={};ami['on'](_0x18cc('0xc'),this[_0x18cc('0xd')][_0x18cc('0xe')](this));ami['on'](_0x18cc('0xf'),this['syncAgentConnect']['bind'](this));ami['on'](_0x18cc('0x10'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x18cc('0x11'),this[_0x18cc('0x12')][_0x18cc('0xe')](this));ami['on']('agentcomplete',this[_0x18cc('0x13')][_0x18cc('0xe')](this));ami['on']('varset',this['syncVarSet'][_0x18cc('0xe')](this));ami['on']('hangup',this[_0x18cc('0x14')]['bind'](this));ami['on'](_0x18cc('0x15'),this['syncMusicOnHoldStart'][_0x18cc('0xe')](this));ami['on'](_0x18cc('0x16'),this[_0x18cc('0x17')]['bind'](this));ami['on'](_0x18cc('0x18'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x18cc('0x19'),this[_0x18cc('0x1a')][_0x18cc('0xe')](this));}VoiceAgentReport[_0x18cc('0x1b')]['emit']=function(_0x230d8c,_0x43d853,_0x201b2b){io['to'](_0x230d8c)[_0x18cc('0x1c')](_0x43d853,_0x201b2b);};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0x1d')]=function(_0x1ac742){return _0x1ac742!==null&&!_[_0x18cc('0x1e')](_0x1ac742);};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0xd')]=function(_0x1259ca){try{if(this[_0x18cc('0x1d')](_0x1259ca)){logger[_0x18cc('0x1f')](_0x18cc('0x20'),_0x1259ca[_0x18cc('0x21')],_0x1259ca[_0x18cc('0x22')],_0x1259ca[_0x18cc('0x23')]);logger[_0x18cc('0x24')](_0x18cc('0x25'),_0x1259ca['uniqueid'],util['inspect'](_0x1259ca,{'showHidden':![],'depth':null}));if(_[_0x18cc('0x1e')](this['channels'][_0x1259ca['uniqueid']])){this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]]={};}if(_[_0x18cc('0x1e')](this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]])){this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]]={'agentcalledAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x18cc('0x26'),'mandatoryDisposition':this[_0x18cc('0xa')][_0x1259ca[_0x18cc('0x27')]]?this['voiceQueues'][_0x1259ca[_0x18cc('0x27')]]['mandatoryDisposition']||![]:![],'type':this[_0x18cc('0xa')][_0x1259ca[_0x18cc('0x27')]]?this[_0x18cc('0xa')][_0x1259ca[_0x18cc('0x27')]][_0x18cc('0x28')]||_0x18cc('0x29'):_0x18cc('0x29'),'variables':this[_0x18cc('0x2a')][_0x1259ca['uniqueid']],'motionChannel':_0x18cc('0x2b')};}_[_0x18cc('0x2c')](this['channels'][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]],_[_0x18cc('0x2d')](_0x1259ca,[_0x18cc('0x2e'),_0x18cc('0x2f')]));logger[_0x18cc('0x24')](_0x18cc('0x30'),_0x1259ca['uniqueid'],util['inspect'](this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x18cc('0x31'),this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]]);logger[_0x18cc('0x24')](_0x18cc('0x32'),_0x1259ca['uniqueid'],util[_0x18cc('0x33')](this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]],{'showHidden':![],'depth':null}));this[_0x18cc('0x1c')](util['format'](_0x18cc('0x34'),_0x1259ca[_0x18cc('0x22')]),_0x18cc('0x35'),this[_0x18cc('0x9')][_0x1259ca[_0x18cc('0x21')]][_0x1259ca[_0x18cc('0x23')]]);}}catch(_0x189a99){logger['error'](_0x18cc('0x36'),_0x1259ca[_0x18cc('0x21')],util['inspect'](_0x189a99,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0x37')]=function(_0x342c12){try{if(this[_0x18cc('0x1d')](_0x342c12)){if(this[_0x18cc('0x9')][_0x342c12['uniqueid']]){logger[_0x18cc('0x24')](_0x18cc('0x38'),_0x342c12[_0x18cc('0x21')],util['inspect'](_0x342c12,{'showHidden':![],'depth':null}));for(var _0x519fb1 in this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]]){if(this['channels'][_0x342c12[_0x18cc('0x21')]][_0x18cc('0x39')](_0x519fb1)){if(_0x342c12[_0x18cc('0x23')]===_0x519fb1){logger[_0x18cc('0x1f')](_0x18cc('0x3a'),_0x342c12['uniqueid'],_0x342c12[_0x18cc('0x22')],_0x342c12[_0x18cc('0x23')]);this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x3b')]=moment()[_0x18cc('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x3d')]=_0x342c12['connectedlinename'];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x3e')]=_0x342c12[_0x18cc('0x3e')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x3f')]=_0x342c12[_0x18cc('0x3f')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x40')]=_0x342c12[_0x18cc('0x40')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x41')]=_0x342c12[_0x18cc('0x41')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x42')]='connect';if(this[_0x18cc('0x8')][this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x21')]]){var _0x1a2ed5=this[_0x18cc('0x8')][this[_0x18cc('0x9')][_0x342c12['uniqueid']][_0x519fb1][_0x18cc('0x21')]][_0x18cc('0x43')];this['channels'][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x43')]=_0x1a2ed5;_0x342c12['routealias']=_0x1a2ed5;}_['merge'](this[_0x18cc('0xb')][_0x342c12[_0x18cc('0x44')]],_[_0x18cc('0x45')](_0x342c12,[_0x18cc('0x27'),'destconnectedlinenum',_0x18cc('0x43')]));logger[_0x18cc('0x24')](_0x18cc('0x46'),_0x342c12[_0x18cc('0x21')],util[_0x18cc('0x33')](this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x342c12['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x18cc('0x1c')]('custom:agentconnect',this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x342c12[_0x18cc('0x23')]]);logger[_0x18cc('0x24')](_0x18cc('0x47'),_0x342c12[_0x18cc('0x21')],util[_0x18cc('0x33')](this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x342c12[_0x18cc('0x23')]],{'showHidden':![],'depth':null}));this[_0x18cc('0x1c')](util[_0x18cc('0x3c')](_0x18cc('0x34'),_0x342c12[_0x18cc('0x22')]),'user:agentconnect',this[_0x18cc('0x9')][_0x342c12['uniqueid']][_0x342c12['destuniqueid']]);}else if(!this['channels'][_0x342c12['uniqueid']][_0x519fb1][_0x18cc('0x10')]&&!this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x48')]){logger[_0x18cc('0x1f')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x342c12['uniqueid'],this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1]['membername'],_0x519fb1);this['channels'][_0x342c12['uniqueid']][_0x519fb1][_0x18cc('0x10')]=!![];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x49')]=moment()[_0x18cc('0x3c')](_0x18cc('0x4a'));this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x4b')]=_0x342c12[_0x18cc('0x23')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x4c')]=_0x342c12[_0x18cc('0x22')];this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x42')]=_0x18cc('0x4d');this['channels'][_0x342c12[_0x18cc('0x21')]][_0x519fb1][_0x18cc('0x4e')]=_0x18cc('0x4d');logger[_0x18cc('0x24')](_0x18cc('0x4f'),_0x342c12[_0x18cc('0x21')],util['inspect'](this['channels'][_0x342c12['uniqueid']][_0x519fb1],{'showHidden':![],'depth':null}));ami[_0x18cc('0x1c')](_0x18cc('0x50'),this[_0x18cc('0x9')][_0x342c12[_0x18cc('0x21')]][_0x519fb1]);}}}}}}catch(_0x1373ff){logger[_0x18cc('0x51')]('[%s][voiceAgentReport][agentconnect]',_0x342c12['uniqueid'],util[_0x18cc('0x33')](_0x1373ff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')]['syncAgentRingNoAnswer']=function(_0x201c4b){try{if(this[_0x18cc('0x1d')](_0x201c4b)){logger[_0x18cc('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x201c4b['uniqueid'],util[_0x18cc('0x33')](_0x201c4b,{'showHidden':![],'depth':null}));if(this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]]&&this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]][_0x201c4b[_0x18cc('0x23')]]){logger['info'](_0x18cc('0x52'),_0x201c4b['uniqueid'],_0x201c4b['membername'],_0x201c4b[_0x18cc('0x23')]);this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]][_0x201c4b['destuniqueid']][_0x18cc('0x10')]=!![];this[_0x18cc('0x9')][_0x201c4b['uniqueid']][_0x201c4b[_0x18cc('0x23')]]['agentringnoanswerAt']=moment()[_0x18cc('0x3c')](_0x18cc('0x4a'));this[_0x18cc('0x9')][_0x201c4b['uniqueid']][_0x201c4b[_0x18cc('0x23')]][_0x18cc('0x42')]='rejected';this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]][_0x201c4b[_0x18cc('0x23')]]['reason']=_0x18cc('0x53');logger['debug'](_0x18cc('0x54'),_0x201c4b[_0x18cc('0x21')],util[_0x18cc('0x33')](this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]][_0x201c4b[_0x18cc('0x23')]],{'showHidden':![],'depth':null}));ami[_0x18cc('0x1c')](_0x18cc('0x55'),this[_0x18cc('0x9')][_0x201c4b[_0x18cc('0x21')]][_0x201c4b[_0x18cc('0x23')]]);}}}catch(_0x15e55b){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x201c4b[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x15e55b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0x12')]=function(_0x3b0120){try{if(this['isNotNull'](_0x3b0120)){logger[_0x18cc('0x24')](_0x18cc('0x56'),_0x3b0120[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x3b0120,{'showHidden':![],'depth':null}));if(this[_0x18cc('0x9')][_0x3b0120['uniqueid']]){for(var _0x597536 in this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]]){if(this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x18cc('0x39')](_0x597536)&&!this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x597536][_0x18cc('0x10')]&&!this['channels'][_0x3b0120[_0x18cc('0x21')]][_0x597536][_0x18cc('0x48')]){logger[_0x18cc('0x1f')](_0x18cc('0x57'),_0x3b0120[_0x18cc('0x21')],this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x597536][_0x18cc('0x22')],_0x597536);this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x597536][_0x18cc('0x10')]=!![];this[_0x18cc('0x9')][_0x3b0120['uniqueid']][_0x597536][_0x18cc('0x49')]=moment()[_0x18cc('0x3c')](_0x18cc('0x4a'));this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x597536][_0x18cc('0x42')]=_0x18cc('0x58');this[_0x18cc('0x9')][_0x3b0120['uniqueid']][_0x597536][_0x18cc('0x4e')]=_0x18cc('0x58');logger[_0x18cc('0x24')](_0x18cc('0x59'),_0x3b0120[_0x18cc('0x21')],util[_0x18cc('0x33')](this['channels'][_0x3b0120[_0x18cc('0x21')]][_0x597536],{'showHidden':![],'depth':null}));ami[_0x18cc('0x1c')]('custom:agentqueuecallerabandon',this[_0x18cc('0x9')][_0x3b0120[_0x18cc('0x21')]][_0x597536]);}}}}}catch(_0xe6e330){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x3b0120[_0x18cc('0x21')],util['inspect'](_0xe6e330,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x18cc('0x13')]=function(_0x589c18){try{if(this['isNotNull'](_0x589c18)){logger[_0x18cc('0x24')](_0x18cc('0x5a'),_0x589c18['uniqueid'],util[_0x18cc('0x33')](_0x589c18,{'showHidden':![],'depth':null}));if(this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]]){for(var _0x4a6299 in this[_0x18cc('0x9')][_0x589c18['uniqueid']]){if(this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x18cc('0x39')](_0x4a6299)){if(this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x3b')]&&!this['channels'][_0x589c18[_0x18cc('0x21')]][_0x4a6299]['agentcomplete']){logger[_0x18cc('0x1f')](_0x18cc('0x5b'),_0x589c18[_0x18cc('0x21')],this['channels'][_0x589c18[_0x18cc('0x21')]][_0x4a6299]['membername'],_0x4a6299);this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x48')]=!![];this[_0x18cc('0x9')][_0x589c18['uniqueid']][_0x4a6299][_0x18cc('0x5c')]=moment()[_0x18cc('0x3c')](_0x18cc('0x4a'));this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299]['lastevent']='complete';this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x4e')]=_0x589c18[_0x18cc('0x4e')]==_0x18cc('0x5d')?'agent':_0x589c18[_0x18cc('0x4e')];this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x5e')]=_0x589c18[_0x18cc('0x5e')];if(this['voiceQueues'][_0x589c18[_0x18cc('0x27')]]&&this['voiceQueues'][_0x589c18[_0x18cc('0x27')]][_0x18cc('0x5f')]){this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x60')]=this[_0x18cc('0xa')][_0x589c18[_0x18cc('0x27')]][_0x18cc('0x61')];this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299][_0x18cc('0x62')]=!![];}this[_0x18cc('0xb')][_0x589c18[_0x18cc('0x44')]]=_[_0x18cc('0x2d')](this['agents'][_0x589c18[_0x18cc('0x44')]],[_0x18cc('0x27'),_0x18cc('0x63')]);logger[_0x18cc('0x24')](_0x18cc('0x64'),_0x589c18[_0x18cc('0x21')],util[_0x18cc('0x33')](this['channels'][_0x589c18['uniqueid']][_0x4a6299],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this['channels'][_0x589c18[_0x18cc('0x21')]][_0x4a6299]);logger['debug'](_0x18cc('0x65'),_0x589c18[_0x18cc('0x21')],util[_0x18cc('0x33')](this[_0x18cc('0x9')][_0x589c18[_0x18cc('0x21')]][_0x4a6299],{'showHidden':![],'depth':null}));this['emit'](util[_0x18cc('0x3c')](_0x18cc('0x34'),_0x589c18[_0x18cc('0x22')]),'user:agentcomplete',this['channels'][_0x589c18[_0x18cc('0x21')]][_0x4a6299]);}}}}}}catch(_0x2b3d9f){logger[_0x18cc('0x51')](_0x18cc('0x66'),_0x589c18[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x2b3d9f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x18cc('0x67')]=function(_0x14635d){try{if(this['isNotNull'](_0x14635d)){logger[_0x18cc('0x24')](_0x18cc('0x68'),_0x14635d[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x14635d,{'showHidden':![],'depth':null}));this[_0x18cc('0x69')](_0x14635d['uniqueid'],_[_0x18cc('0x6a')](_0x14635d['variable'])[0x0],_0x14635d[_0x18cc('0x6b')]);if(this[_0x18cc('0x9')][_0x14635d['uniqueid']]){for(var _0x55864e in this[_0x18cc('0x9')][_0x14635d['uniqueid']]){if(this[_0x18cc('0x9')][_0x14635d['uniqueid']][_0x18cc('0x39')](_0x55864e)){logger[_0x18cc('0x1f')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x14635d[_0x18cc('0x21')],_0x55864e,_[_0x18cc('0x6a')](_0x14635d['variable'])[0x0],_0x14635d[_0x18cc('0x6b')]);if(_['isUndefined'](this[_0x18cc('0x9')][_0x14635d[_0x18cc('0x21')]][_0x55864e][_0x18cc('0x2a')])){this[_0x18cc('0x9')][_0x14635d[_0x18cc('0x21')]][_0x55864e][_0x18cc('0x2a')]={};}this['channels'][_0x14635d[_0x18cc('0x21')]][_0x55864e]['variables']=this['variables'][_0x14635d[_0x18cc('0x21')]];}}}}}catch(_0x18e291){logger[_0x18cc('0x51')]('[%s][voiceAgentReport][varset]',_0x14635d[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x18e291,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')]['addVariable']=function(_0x4be7cc,_0x847aa5,_0x5cd34f){var _0x24e6aa=[_0x18cc('0x6c'),_0x18cc('0x6d'),_0x18cc('0x6e'),'rtpaudioqosjitterbridged',_0x18cc('0x6f'),_0x18cc('0x70'),_0x18cc('0x71'),_0x18cc('0x72'),_0x18cc('0x73'),_0x18cc('0x74'),_0x18cc('0x75'),_0x18cc('0x76'),_0x18cc('0x77'),_0x18cc('0x78'),'memberinterface','memberlastcall',_0x18cc('0x22'),_0x18cc('0x79'),_0x18cc('0x7a')];if(!_['isNil'](_0x847aa5)&&!_[_0x18cc('0x7b')](_0x24e6aa,_0x847aa5)){if(_[_0x18cc('0x1e')](this[_0x18cc('0x2a')][_0x4be7cc])){this[_0x18cc('0x2a')][_0x4be7cc]={};}this[_0x18cc('0x2a')][_0x4be7cc][_0x847aa5]=_0x5cd34f;}};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0x14')]=function(_0x4ed783){try{if(this[_0x18cc('0x1d')](_0x4ed783)){logger[_0x18cc('0x24')]('[%s][voiceAgentReport][hangup]\x20event:',_0x4ed783['uniqueid'],util[_0x18cc('0x33')](_0x4ed783,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ed783[_0x18cc('0x21')]]){for(var _0xe8735a in this[_0x18cc('0x9')][_0x4ed783[_0x18cc('0x21')]]){if(this[_0x18cc('0x9')][_0x4ed783[_0x18cc('0x21')]][_0x18cc('0x39')](_0xe8735a)){if(this[_0x18cc('0x9')][_0x4ed783[_0x18cc('0x21')]][_0xe8735a][_0x18cc('0x4e')]==_0x18cc('0x5d')&&this['channels'][_0x4ed783[_0x18cc('0x21')]][_0xe8735a][_0x18cc('0x48')]){logger[_0x18cc('0x1f')](_0x18cc('0x7c'),_0x4ed783['uniqueid'],_0xe8735a);this[_0x18cc('0x9')][_0x4ed783[_0x18cc('0x21')]][_0xe8735a][_0x18cc('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x18cc('0x24')](_0x18cc('0x7d'),_0x4ed783[_0x18cc('0x21')],util['inspect'](_[_0x18cc('0x7e')](this[_0x18cc('0x9')][_0x4ed783['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x18cc('0x1c')](_0x18cc('0x7f'),_[_0x18cc('0x7e')](this[_0x18cc('0x9')][_0x4ed783[_0x18cc('0x21')]]));delete this['channels'][_0x4ed783['uniqueid']];}if(this[_0x18cc('0x2a')][_0x4ed783[_0x18cc('0x21')]]){delete this[_0x18cc('0x2a')][_0x4ed783[_0x18cc('0x21')]];}}}catch(_0x40e933){logger['error'](_0x18cc('0x80'),_0x4ed783[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x40e933,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')][_0x18cc('0x81')]=function(_0x42ec95){try{if(this[_0x18cc('0x1d')](_0x42ec95)){logger['debug'](_0x18cc('0x82'),_0x42ec95['uniqueid'],util[_0x18cc('0x33')](_0x42ec95,{'showHidden':![],'depth':null}));if(this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]]){for(var _0x1abf4c in this['channels'][_0x42ec95[_0x18cc('0x83')]]){if(this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]]['hasOwnProperty'](_0x1abf4c)){if(_0x42ec95['origtransfereruniqueid']===_0x1abf4c){logger[_0x18cc('0x1f')](_0x18cc('0x84'),_0x42ec95[_0x18cc('0x21')],this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c]['membername'],_0x1abf4c);var _0x3add0c=moment();this['channels'][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c]['agentcomplete']=!![];this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c][_0x18cc('0x5c')]=moment()[_0x18cc('0x3c')](_0x18cc('0x4a'));this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c][_0x18cc('0x42')]=_0x18cc('0x85');this['channels'][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c][_0x18cc('0x4e')]=_0x18cc('0x5d');this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c][_0x18cc('0x5e')]=_0x3add0c[_0x18cc('0x86')](this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]][_0x1abf4c]['agentconnectAt'],_0x18cc('0x87'));}}}}if(this[_0x18cc('0x9')][_0x42ec95['secondtransfereruniqueid']]){var _0x30f47e=this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x88')]];this['channels'][_0x42ec95['secondtransfereruniqueid']]=this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]];this[_0x18cc('0x9')][_0x42ec95[_0x18cc('0x83')]]=_0x30f47e;}}}catch(_0x43dc85){logger[_0x18cc('0x51')]('[%s][voiceAgentReport][attendedtransfer]',_0x42ec95[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x43dc85,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x18cc('0x1a')]=function(_0x5700f2){try{if(this[_0x18cc('0x1d')](_0x5700f2)){logger['debug'](_0x18cc('0x89'),_0x5700f2[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x5700f2,{'showHidden':![],'depth':null}));if(this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]]){for(var _0x4865c2 in this['channels'][_0x5700f2['transfereeuniqueid']]){if(this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]][_0x18cc('0x39')](_0x4865c2)){if(_0x5700f2[_0x18cc('0x8a')]===_0x4865c2){logger[_0x18cc('0x1f')](_0x18cc('0x8b'),_0x5700f2[_0x18cc('0x21')],this[_0x18cc('0x9')][_0x5700f2['transfereeuniqueid']][_0x4865c2][_0x18cc('0x22')],_0x4865c2);var _0x5a8d50=moment();this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]][_0x4865c2][_0x18cc('0x48')]=!![];this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]][_0x4865c2][_0x18cc('0x5c')]=_0x5a8d50;this['channels'][_0x5700f2['transfereeuniqueid']][_0x4865c2]['lastevent']='complete';this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]][_0x4865c2][_0x18cc('0x4e')]=_0x18cc('0x5d');this[_0x18cc('0x9')][_0x5700f2[_0x18cc('0x83')]][_0x4865c2]['talktime']=_0x5a8d50[_0x18cc('0x86')](this['channels'][_0x5700f2[_0x18cc('0x83')]][_0x4865c2][_0x18cc('0x3b')],_0x18cc('0x87'));}}}}}}catch(_0x2cd90d){logger[_0x18cc('0x51')](_0x18cc('0x8c'),_0x5700f2['uniqueid'],util[_0x18cc('0x33')](_0x2cd90d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x18cc('0x1b')]['syncMusicOnHoldStart']=function(_0x2bbd22){var _0xb0f690='';try{if(this['isNotNull'](_0x2bbd22)){logger[_0x18cc('0x24')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2bbd22[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x2bbd22,{'showHidden':![],'depth':null}));if(_0x2bbd22['channel']){_0xb0f690=_0x2bbd22['channel'][_0x18cc('0x8d')](0x0,_0x2bbd22[_0x18cc('0x8e')]['lastIndexOf']('-'));if(this['agents'][_0xb0f690]){logger[_0x18cc('0x1f')](_0x18cc('0x8f'),_0x2bbd22['uniqueid'],_0xb0f690);this[_0x18cc('0xb')][_0xb0f690][_0x18cc('0x90')]=!![];}}}}catch(_0x4cdeb7){logger[_0x18cc('0x51')]('[%s][voiceAgentReport][musiconholdstart]',_0x2bbd22[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x4cdeb7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x572cfd){var _0x5722e6='';try{if(this['isNotNull'](_0x572cfd)){logger[_0x18cc('0x24')](_0x18cc('0x91'),_0x572cfd[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x572cfd,{'showHidden':![],'depth':null}));if(_0x572cfd['channel']){_0x5722e6=_0x572cfd[_0x18cc('0x8e')][_0x18cc('0x8d')](0x0,_0x572cfd[_0x18cc('0x8e')]['lastIndexOf']('-'));if(this[_0x18cc('0xb')][_0x5722e6]){logger['info'](_0x18cc('0x92'),_0x572cfd[_0x18cc('0x21')],_0x5722e6);this['agents'][_0x5722e6][_0x18cc('0x90')]=![];}}}}catch(_0x56f675){logger[_0x18cc('0x51')]('[%s][voiceAgentReport][musiconholdstop]',_0x572cfd[_0x18cc('0x21')],util[_0x18cc('0x33')](_0x56f675,{'showHidden':![],'depth':null}));}};module[_0x18cc('0x93')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index bf26628..c169a6f 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8620=['[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfererchannel','transfereruniqueid','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','localhost','socket.io-emitter','redis','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','musiconholdstop','actionCoreShowChannels','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','split','exten','destconnectedlinenum','connectedlinenum','format','user:%s','channel','name','error','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','starttime','duration','subtract','seconds','pick','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinename','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','replace','.wav49','monitorFilename','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid'];(function(_0x4ec356,_0x3763df){var _0x5b18e6=function(_0xbd7ba5){while(--_0xbd7ba5){_0x4ec356['push'](_0x4ec356['shift']());}};_0x5b18e6(++_0x3763df);}(_0x8620,0x1c7));var _0x0862=function(_0x57ecad,_0x1027e5){_0x57ecad=_0x57ecad-0x0;var _0x471d7c=_0x8620[_0x57ecad];return _0x471d7c;};'use strict';var BPromise=require('bluebird');var _=require(_0x0862('0x0'));var moment=require('moment');var util=require(_0x0862('0x1'));var path=require('path');var Redis=require(_0x0862('0x2'));var config=require(_0x0862('0x3'));var logger=require(_0x0862('0x4'))(_0x0862('0x5'));var ami=require(_0x0862('0x6'));var Channel=require(_0x0862('0x7'));var RpcSetting=require(_0x0862('0x8'));var statusDesc=[_0x0862('0x9'),_0x0862('0xa'),_0x0862('0xb'),_0x0862('0xc'),_0x0862('0xd'),'unavailable',_0x0862('0xe'),'ringinuse',_0x0862('0xf')];var applications=[_0x0862('0x10'),'queue',_0x0862('0x11'),_0x0862('0x12'),_0x0862('0x13'),_0x0862('0x14')];var dispositions=[_0x0862('0x15'),_0x0862('0x16'),'FAILED',_0x0862('0x15'),'NO\x20ANSWER',_0x0862('0x15'),'ANSWERED',_0x0862('0x17'),'FAILED',_0x0862('0x16'),_0x0862('0x16')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0x0862('0x18'),'port':0x18eb});var io=require(_0x0862('0x19'))(new Redis(config[_0x0862('0x1a')]));function VoiceCallReport(_0x5ac489){this[_0x0862('0x1b')]=_0x5ac489[_0x0862('0x1b')];this['agents']=_0x5ac489[_0x0862('0x1c')];this[_0x0862('0x1d')]={};ami['on']('coreshowchannel',this[_0x0862('0x1e')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x20'),this[_0x0862('0x1e')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x21'),this['syncNewChannel'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x22'),this[_0x0862('0x23')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x24'),this[_0x0862('0x25')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x26'),this[_0x0862('0x27')][_0x0862('0x1f')](this));ami['on']('newcallerid',this[_0x0862('0x28')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x29'),this[_0x0862('0x2a')][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2b'),this['syncBlindTransfer'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2c'),this['syncMusicOnHoldStart'][_0x0862('0x1f')](this));ami['on'](_0x0862('0x2d'),this['syncMusicOnHoldStop']['bind'](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x0862('0x2e')]();}catch(_0x3af219){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x0862('0x2f')](_0x3af219,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0862('0x30')][_0x0862('0x31')]=function(_0x45c8c2){return _0x45c8c2!==null&&!_[_0x0862('0x32')](_0x45c8c2);};VoiceCallReport['prototype']['emit']=function(_0xb3d3b9,_0x1e2142,_0x1c856c){io['to'](_0xb3d3b9)[_0x0862('0x33')](_0x1e2142,_0x1c856c);};VoiceCallReport[_0x0862('0x30')][_0x0862('0x28')]=function(_0x2112ba){try{if(this[_0x0862('0x31')](_0x2112ba)){logger[_0x0862('0x34')](_0x0862('0x35'),_0x2112ba[_0x0862('0x36')],_0x2112ba['calleridname'],_0x2112ba[_0x0862('0x37')]);logger[_0x0862('0x38')](_0x0862('0x39'),_0x2112ba[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2112ba,{'showHidden':![],'depth':null}));if(_0x2112ba['uniqueid']===_0x2112ba[_0x0862('0x3a')]){if(!_['isUndefined'](this[_0x0862('0x1b')][_0x2112ba['uniqueid']])){_[_0x0862('0x3b')](this['channels'][_0x2112ba[_0x0862('0x36')]],_['pick'](_0x2112ba,_[_0x0862('0x3c')](this['channels'][_0x2112ba['uniqueid']])));}}if(_0x2112ba[_0x0862('0x3d')]===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]]){if(_0x2112ba[_0x0862('0x40')]=='xcally-motion-preview'){this['agents'][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x41')]=_0x2112ba[_0x0862('0x42')];this[_0x0862('0x33')](util[_0x0862('0x43')](_0x0862('0x44'),this['agents'][_0x2112ba[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x46')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x2112ba['channel'][_0x0862('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2112ba[_0x0862('0x42')]});}}}}}catch(_0x4619a6){logger[_0x0862('0x47')]('[%s][voiceCallReport][newcallerid]',_0x2112ba['uniqueid'],util[_0x0862('0x2f')](_0x4619a6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x48')]=function(_0x4ac126){try{if(this[_0x0862('0x31')](_0x4ac126)){logger[_0x0862('0x38')](_0x0862('0x49'),_0x4ac126[_0x0862('0x36')],util[_0x0862('0x2f')](_0x4ac126,{'showHidden':![],'depth':null}));if(_0x4ac126[_0x0862('0x36')]===_0x4ac126[_0x0862('0x3a')]&&_0x4ac126['channel']!=_0x0862('0x4a')){if(_['isUndefined'](this['channels'][_0x4ac126['uniqueid']])){logger[_0x0862('0x34')](_0x0862('0x4b'),_0x4ac126['uniqueid'],_0x4ac126[_0x0862('0x3d')],_0x4ac126[_0x0862('0x40')]);this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]]=new Channel();this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]]['starttime']=moment()[_0x0862('0x43')](_0x0862('0x4c'));this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]][_0x0862('0x4d')]=dispositions[_['toNumber'](_0x4ac126[_0x0862('0x4e')])];_['merge'](this[_0x0862('0x1b')][_0x4ac126[_0x0862('0x36')]],_['pick'](_0x4ac126,_[_0x0862('0x3c')](this[_0x0862('0x1b')][_0x4ac126['uniqueid']])));if(_0x4ac126['context']===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x4ac126['channel']['split']('-')[0x0]]){if(_['isUndefined'](this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')]['split']('-')[0x0]][_0x0862('0x41')])){this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x41')]=_0x4ac126[_0x0862('0x40')];logger[_0x0862('0x38')](_0x0862('0x4f'),_0x4ac126[_0x0862('0x36')],util['inspect']({'destaccountcode':this['agents'][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x4ac126[_0x0862('0x40')]},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util['format'](_0x0862('0x44'),this['agents'][_0x4ac126['channel']['split']('-')[0x0]][_0x0862('0x46')]),_0x0862('0x51'),{'destaccountcode':this[_0x0862('0x1c')][_0x4ac126[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x4ac126[_0x0862('0x40')]});}}}}}}}catch(_0x36d9a1){logger[_0x0862('0x47')](_0x0862('0x52'),_0x4ac126[_0x0862('0x36')],util[_0x0862('0x2f')](_0x36d9a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')]['syncNewExten']=function(_0x447536){try{if(this[_0x0862('0x31')](_0x447536)){logger[_0x0862('0x38')](_0x0862('0x53'),_0x447536[_0x0862('0x36')],util[_0x0862('0x2f')](_0x447536,{'showHidden':![],'depth':null}));if(_0x447536[_0x0862('0x36')]===_0x447536[_0x0862('0x3a')]&&_0x447536['exten']!='h'&&_0x447536[_0x0862('0x45')]!=_0x0862('0x4a')){_0x447536[_0x0862('0x54')]=_0x447536[_0x0862('0x54')][_0x0862('0x55')]();_0x447536[_0x0862('0x56')]=_0x447536[_0x0862('0x57')]&&_0x447536[_0x0862('0x57')][_0x0862('0x58')](_0x0862('0x59'))?_0x447536['appdata']:(_0x447536[_0x0862('0x57')]||_0x447536[_0x0862('0x56')])['toLowerCase']();logger[_0x0862('0x34')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x447536[_0x0862('0x36')],_0x447536[_0x0862('0x54')],_0x447536[_0x0862('0x56')]);if(_[_0x0862('0x32')](this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]])){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]]=new Channel();this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x5a')]=_0x447536[_0x0862('0x5b')]?moment()[_0x0862('0x5c')](moment[_0x0862('0x5b')](_0x447536['duration'])[_0x0862('0x5d')](),'seconds')['format'](_0x0862('0x4c')):moment()[_0x0862('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x447536[_0x0862('0x36')]]['disposition']='NO\x20ANSWER';}_[_0x0862('0x3b')](this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]],_[_0x0862('0x5e')](_0x447536,_[_0x0862('0x3c')](this['channels'][_0x447536[_0x0862('0x36')]])));if(_[_0x0862('0x5f')](applications,_0x447536[_0x0862('0x54')])){this['channels'][_0x447536[_0x0862('0x36')]][_0x0862('0x60')]=_0x447536[_0x0862('0x54')];this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x61')]=_0x447536['applicationdata'];if(_0x447536[_0x0862('0x54')]==='set'&&_[_0x0862('0x58')](_0x447536[_0x0862('0x56')][_0x0862('0x55')](),_0x0862('0x62'))){var _0x33c8e3=_0x447536[_0x0862('0x56')][_0x0862('0x3f')]('=');var _0xd9a0a0=_0x33c8e3[0x0][_0x0862('0x55')]()[_0x0862('0x63')](/cdr\((.*)\)/);if(_0xd9a0a0){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0xd9a0a0[0x1]]=_0x33c8e3[0x1];}}else if(_0x447536[_0x0862('0x54')]===_0x0862('0x64')){this[_0x0862('0x1b')][_0x447536[_0x0862('0x36')]][_0x0862('0x64')]=_0x447536['applicationdata'][_0x0862('0x3f')](',')[0x0];}}}}}catch(_0x2bfb77){logger[_0x0862('0x47')]('[%s][voiceCallReport][newexten]',_0x447536[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2bfb77,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x23')]=function(_0x497963){try{if(this['isNotNull'](_0x497963)){logger[_0x0862('0x34')](_0x0862('0x65'),_0x497963[_0x0862('0x36')],_0x497963[_0x0862('0x3a')],_0x497963[_0x0862('0x66')],_0x497963[_0x0862('0x37')]);logger[_0x0862('0x38')](_0x0862('0x67'),_0x497963[_0x0862('0x36')],util[_0x0862('0x2f')](_0x497963,{'showHidden':![],'depth':null}));if(_0x497963[_0x0862('0x36')]!==_0x497963['linkedid']){if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]){if(_0x497963[_0x0862('0x4e')]==='6'){if(!this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['answered']){var _0x25589b=moment();this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x68')]=!![];this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x69')]=_0x25589b[_0x0862('0x43')](_0x0862('0x4c'));if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x5a')]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6a')]=_0x25589b[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x5a')],_0x0862('0x5d'));}}this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['linkedid']=_0x497963[_0x0862('0x36')];if(_0x497963[_0x0862('0x37')]!==_0x0862('0x6c')){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x42')]=_0x497963[_0x0862('0x37')];}this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6d')]=_0x497963[_0x0862('0x66')];this['channels'][_0x497963['linkedid']]['destinationchannel']=_0x497963['channel'];this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]]['disposition']=dispositions[_[_0x0862('0x6e')](_0x497963[_0x0862('0x4e')])];if(this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x6f')]=this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'];this[_0x0862('0x1b')][_0x497963['linkedid']][_0x0862('0x70')]=this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['name'];}}}}else{if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]]){if(_0x497963[_0x0862('0x4e')]==='6'){if(this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]][_0x0862('0x6f')]=this[_0x0862('0x1c')][_0x497963['channel']['split']('-')[0x0]]['id'];this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]][_0x0862('0x70')]=this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]]['name'];}}}}if(_0x497963[_0x0862('0x4e')]==='6'&&_0x497963[_0x0862('0x3d')]===_0x0862('0x3e')){if(this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')]['split']('-')[0x0]]['destconnectedlinenum']=_0x497963[_0x0862('0x40')];var _0x53779f;if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x36')]])_0x53779f=this['channels'][_0x497963[_0x0862('0x36')]][_0x0862('0x71')];else if(this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]])_0x53779f=this[_0x0862('0x1b')][_0x497963[_0x0862('0x3a')]][_0x0862('0x71')];logger[_0x0862('0x38')](_0x0862('0x72'),_0x497963['uniqueid'],util[_0x0862('0x2f')]({'destaccountcode':this[_0x0862('0x1c')][_0x497963[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x497963[_0x0862('0x40')],'routealias':_0x53779f},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util[_0x0862('0x43')]('user:%s',this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x46')]),_0x0862('0x51'),{'destaccountcode':this[_0x0862('0x1c')][_0x497963['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')],'destconnectedlinenum':_0x497963[_0x0862('0x40')],'routealias':_0x53779f});}}}}catch(_0x5aa717){logger[_0x0862('0x47')]('[%s][voiceCallReport][newstate]',_0x497963[_0x0862('0x36')],util[_0x0862('0x2f')](_0x5aa717,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x73')]=function(_0x4c3e1d,_0x3266a3){try{if(this[_0x0862('0x1b')][_0x4c3e1d]){logger[_0x0862('0x34')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4c3e1d,_0x3266a3);this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x74')]=!![];if(_['endsWith'](_0x3266a3,'.wav49')){_0x3266a3=_0x3266a3[_0x0862('0x75')](_0x0862('0x76'),'.WAV');}this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x77')]=_0x3266a3;var _0x33d5e7=_['find'](this[_0x0862('0x1b')][_0x4c3e1d]['monitors'],{'filename':_0x3266a3});if(_[_0x0862('0x78')](_0x33d5e7)){this[_0x0862('0x1b')][_0x4c3e1d][_0x0862('0x79')][_0x0862('0x7a')]({'filename':_0x3266a3,'createdAt':moment()[_0x0862('0x43')](_0x0862('0x4c')),'mixmonitorid':'','status':'rec'});}}}catch(_0xf7522b){logger[_0x0862('0x47')](_0x0862('0x7b'),_0x4c3e1d,util[_0x0862('0x2f')](_0xf7522b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x25')]=function(_0xc650e0){try{if(this[_0x0862('0x31')](_0xc650e0)){logger[_0x0862('0x38')](_0x0862('0x7c'),_0xc650e0[_0x0862('0x36')],util[_0x0862('0x2f')](_0xc650e0,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]]&&_0xc650e0[_0x0862('0x45')]!=_0x0862('0x4a')){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')])){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')]['mixmonitor_filename'])){logger[_0x0862('0x34')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x73')](_0xc650e0[_0x0862('0x36')],_0xc650e0['value']);}else if(this[_0x0862('0x31')](_0xc650e0['variable']['xmd-phone'])){logger[_0x0862('0x34')](_0x0862('0x7f'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x37')]=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x80')])){logger['info'](_0x0862('0x81'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x82')]=_0xc650e0['value'];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x83')])){logger[_0x0862('0x34')](_0x0862('0x84'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']][_0x0862('0x85')]=_0xc650e0['value'];}else if(this['isNotNull'](_0xc650e0['variable']['xmd-queue'])){logger['info'](_0x0862('0x86'),_0xc650e0['uniqueid'],_0xc650e0['value'][_0x0862('0x3f')](',')[0x0]);this['channels'][_0xc650e0['uniqueid']][_0x0862('0x64')]=_0xc650e0[_0x0862('0x7e')][_0x0862('0x3f')](',')[0x0];}else if(this[_0x0862('0x31')](_0xc650e0['variable'][_0x0862('0x87')])){logger[_0x0862('0x34')](_0x0862('0x88'),_0xc650e0[_0x0862('0x36')],_0xc650e0['value']);this['channels'][_0xc650e0[_0x0862('0x36')]][_0x0862('0x89')]=_0xc650e0[_0x0862('0x7e')];}else if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8a')])){logger[_0x0862('0x34')](_0x0862('0x8b'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']]['destination']=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8c')])){logger[_0x0862('0x34')](_0x0862('0x8d'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x36')]][_0x0862('0x8e')]=_0xc650e0['value'];}else if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x8f')])){logger[_0x0862('0x34')](_0x0862('0x90'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']][_0x0862('0x64')]=_0xc650e0[_0x0862('0x7e')];}else if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')]['sipcallid'])){logger[_0x0862('0x34')](_0x0862('0x91'),_0xc650e0[_0x0862('0x36')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['uniqueid']]['sipcalluniqueid']=_0xc650e0[_0x0862('0x7e')];}}}else if(this[_0x0862('0x31')](_0xc650e0['variable'][_0x0862('0x92')])){if(_0xc650e0[_0x0862('0x7e')]){var _0x65912a=path[_0x0862('0x93')](_0xc650e0[_0x0862('0x7e')])[_0x0862('0x46')];logger[_0x0862('0x34')](_0x0862('0x94'),_0x65912a,_0xc650e0['value']);this[_0x0862('0x73')](_0x65912a,_0xc650e0[_0x0862('0x7e')]);}}else if(this[_0x0862('0x1b')][_0xc650e0[_0x0862('0x3a')]]){if(this[_0x0862('0x31')](_0xc650e0[_0x0862('0x7d')])){if(this['isNotNull'](_0xc650e0[_0x0862('0x7d')][_0x0862('0x95')])){logger[_0x0862('0x34')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0xc650e0[_0x0862('0x3a')],_0xc650e0[_0x0862('0x7e')]);this[_0x0862('0x1b')][_0xc650e0['linkedid']][_0x0862('0x96')]=_0xc650e0[_0x0862('0x7e')];}}}}}catch(_0x439327){logger['error'](_0x0862('0x97'),_0xc650e0[_0x0862('0x36')],util['inspect'](_0x439327,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x27')]=function(_0x3451d0){try{if(this['isNotNull'](_0x3451d0)){logger[_0x0862('0x38')](_0x0862('0x98'),_0x3451d0['uniqueid'],util['inspect'](_0x3451d0,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0x3451d0['uniqueid']]){logger[_0x0862('0x34')](_0x0862('0x99'),_0x3451d0[_0x0862('0x36')],_0x3451d0['cause-txt']);var _0x3a8eee=moment();this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x9a')]=_0x3a8eee['format'](_0x0862('0x4c'));this['channels'][_0x3451d0['uniqueid']][_0x0862('0x5b')]=_0x3a8eee[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x5a')],_0x0862('0x5d'));if(this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x68')]){this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x9b')]=_0x3a8eee[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x69')],_0x0862('0x5d'));this[_0x0862('0x1b')][_0x3451d0['uniqueid']]['holdtime']=this[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x5b')]-this[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x9b')];}if(_0x3451d0['context']===_0x0862('0x3e')){if(this['agents'][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]){this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]=_['omit'](this['agents'][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]],[_0x0862('0x41')]);logger[_0x0862('0x38')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x3451d0[_0x0862('0x36')],util[_0x0862('0x2f')]({'id':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x0862('0x1c')][_0x3451d0['channel'][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')]},{'showHidden':![],'depth':null}));this[_0x0862('0x33')](util[_0x0862('0x43')]('user:%s',this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')]['split']('-')[0x0]][_0x0862('0x46')]),_0x0862('0x9c'),{'id':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x0862('0x1c')][_0x3451d0[_0x0862('0x45')][_0x0862('0x3f')]('-')[0x0]][_0x0862('0x50')]});}}var _0x11f2f3=this;Promise[_0x0862('0x9d')]()[_0x0862('0x9e')](function(){var _0x19df61=_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];if(typeof _0x19df61[_0x0862('0x9f')]==='undefined')return;if(_[_0x0862('0xa0')](_0x19df61['monitors']))return;return RpcSetting[_0x0862('0xa1')]()[_0x0862('0x9e')](function(_0x6e28d){if(!_0x6e28d[_0x0862('0xa2')])return;return Promise[_0x0862('0x9d')]()['then'](function(){return ami[_0x0862('0xa3')]({'action':_0x0862('0xa4'),'channel':_0x19df61['channel']})['catch'](function(){});})[_0x0862('0x9e')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x19df61['destinationchannel']})[_0x0862('0xa5')](function(){})[_0x0862('0xa6')](function(){var _0x12b064=_0x11f2f3[_0x0862('0x1c')][_0x19df61['destinationchannel']['split']('-')[0x0]];if(!_0x12b064)return;io['emit'](_0x0862('0xa7'),{'agentId':_0x12b064['id'],'uniqueid':_0x19df61[_0x0862('0x36')]});});});});})['then'](function(){if(_0x3451d0[_0x0862('0xa8')]==='BlindTransfer'){_0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]]=_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];}else{if(_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]][_0x0862('0x85')]===_0x0862('0xa9')&&_0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]]){_0x11f2f3['channels'][_0x3451d0[_0x0862('0x36')]][_0x0862('0x36')]=[_0x11f2f3['channels'][_0x3451d0[_0x0862('0x36')]][_0x0862('0x3a')],_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]]['linkedid']=_0x11f2f3[_0x0862('0x1b')][_0x3451d0['uniqueid']][_0x0862('0x36')]][0x0];delete _0x11f2f3[_0x0862('0x1d')][_0x3451d0[_0x0862('0x36')]];}}logger[_0x0862('0x38')](_0x0862('0xaa'),_0x3451d0[_0x0862('0x36')],util[_0x0862('0x2f')](_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]],{'showHidden':![],'depth':null}));ami[_0x0862('0x33')](_0x0862('0xab'),_0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]]);delete _0x11f2f3[_0x0862('0x1b')][_0x3451d0[_0x0862('0x36')]];});}}}catch(_0x4e2077){logger[_0x0862('0x47')](_0x0862('0xac'),_0x3451d0[_0x0862('0x36')],util['inspect'](_0x4e2077,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0x2a')]=function(_0x581141){try{if(this[_0x0862('0x31')](_0x581141)){logger[_0x0862('0x34')](_0x0862('0xad'),_0x581141[_0x0862('0x36')],_0x581141[_0x0862('0xae')],_0x581141['transfertargetcalleridnum']);logger['debug'](_0x0862('0xaf'),_0x581141['uniqueid'],util[_0x0862('0x2f')](_0x581141,{'showHidden':![],'depth':null}));if(this['channels'][_0x581141[_0x0862('0xb0')]]){this['channels'][_0x581141[_0x0862('0xb0')]][_0x0862('0xb1')]=_0x581141[_0x0862('0xae')];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]][_0x0862('0xb2')]=_0x581141[_0x0862('0xb3')];if(this[_0x0862('0x1b')][_0x581141['secondtransfereruniqueid']]){var _0x418f0c=this['channels'][_0x581141['secondtransfereruniqueid']];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]]=this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb0')]]=_0x418f0c;}}else if(this[_0x0862('0x1b')][_0x581141['transfertargetuniqueid']]){this[_0x0862('0x1b')][_0x581141['transfertargetuniqueid']][_0x0862('0xb1')]=_0x581141[_0x0862('0xae')];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]][_0x0862('0xb2')]=_0x581141['transfertargetcalleridnum'];if(this[_0x0862('0x1b')][_0x581141['origtransfereruniqueid']]){var _0x418f0c=this[_0x0862('0x1b')][_0x581141['origtransfereruniqueid']];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]]=this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]];this[_0x0862('0x1b')][_0x581141[_0x0862('0xb5')]]=_0x418f0c;}}if((this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]]||this[_0x0862('0x1b')][_0x581141['origtransfererlinkedid']])&&this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]]){var _0x3cfea9=_[_0x0862('0xb7')]([this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]],this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]],this['channels'][_0x581141[_0x0862('0xb4')]]],function(_0x419865){return _0x419865&&_0x419865[_0x0862('0x85')]==='outbound'&&_0x419865[_0x0862('0xb9')];});if(_0x3cfea9){if(this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]])this[_0x0862('0x1b')][_0x581141[_0x0862('0xb6')]][_0x0862('0x9f')]=_0x0862('0xba');if(this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]])this[_0x0862('0x1b')][_0x581141[_0x0862('0xb8')]][_0x0862('0x9f')]='ATTENDED';this[_0x0862('0x1b')][_0x581141[_0x0862('0xb4')]][_0x0862('0x9f')]=_0x0862('0xba');}}}}catch(_0x3dd38d){logger[_0x0862('0x47')]('[%s][voiceCallReport][attendedtransfer]',_0x581141[_0x0862('0x36')],util['inspect'](_0x3dd38d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0xbb')]=function(_0x5b4944){try{if(this[_0x0862('0x31')](_0x5b4944)){logger[_0x0862('0x34')](_0x0862('0xbc'),_0x5b4944[_0x0862('0x36')],_0x5b4944[_0x0862('0xbd')],_0x5b4944[_0x0862('0xbe')]);logger[_0x0862('0x38')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x5b4944['uniqueid'],util['inspect'](_0x5b4944,{'showHidden':![],'depth':null}));if(this['channels'][_0x5b4944[_0x0862('0xb0')]]){this['channels'][_0x5b4944[_0x0862('0xb0')]][_0x0862('0xb1')]=_0x5b4944['transfereecalleridnum'];this['channels'][_0x5b4944[_0x0862('0xb0')]][_0x0862('0xb2')]=_0x5b4944[_0x0862('0xbe')];this[_0x0862('0x1b')][_0x5b4944['transfereeuniqueid']][_0x0862('0x9f')]=_0x0862('0xbf');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x5b4944[_0x0862('0xb0')],'context':_0x5b4944[_0x0862('0x3d')],'channel':_0x5b4944[_0x0862('0xc0')]});}else{this[_0x0862('0x1b')][_0x5b4944[_0x0862('0xc1')]]['transferType']='BLIND';}}}catch(_0x2d9495){logger['error']('[%s][voiceCallReport][blindtransfer]',_0x5b4944[_0x0862('0x36')],util[_0x0862('0x2f')](_0x2d9495,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')][_0x0862('0xc2')]=function(_0xae14ec){try{if(this[_0x0862('0x31')](_0xae14ec)){logger[_0x0862('0x38')](_0x0862('0xc3'),_0xae14ec['uniqueid'],util[_0x0862('0x2f')](_0xae14ec,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]]){if(!_[_0x0862('0x78')](this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]]['answertime'])){this['channels'][_0xae14ec['uniqueid']]['mohstarttime']=moment()[_0x0862('0x43')](_0x0862('0x4c'));logger[_0x0862('0x34')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0xae14ec[_0x0862('0x36')],this[_0x0862('0x1b')][_0xae14ec[_0x0862('0x36')]][_0x0862('0xc4')]);}}}}catch(_0x304099){logger['error']('[%s][voiceCallReport][musiconholdstart]',_0xae14ec['uniqueid'],util[_0x0862('0x2f')](_0x304099,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0862('0x30')]['syncMusicOnHoldStop']=function(_0x1d06e3){try{if(this[_0x0862('0x31')](_0x1d06e3)){logger['debug'](_0x0862('0xc5'),_0x1d06e3[_0x0862('0x36')],util[_0x0862('0x2f')](_0x1d06e3,{'showHidden':![],'depth':null}));if(this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]){if(!_[_0x0862('0x78')](this['channels'][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc4')])){this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc6')]+=moment()[_0x0862('0xc7')](0x0)[_0x0862('0x6b')](this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]['mohstarttime'],_0x0862('0x5d'));logger[_0x0862('0x34')](_0x0862('0xc8'),_0x1d06e3['uniqueid'],this['channels'][_0x1d06e3[_0x0862('0x36')]][_0x0862('0xc6')]);delete this[_0x0862('0x1b')][_0x1d06e3[_0x0862('0x36')]]['mohstarttime'];}}}}catch(_0x24c049){logger[_0x0862('0x47')]('[%s][voiceCallReport][musiconholdstop]',_0x1d06e3['uniqueid'],util[_0x0862('0x2f')](_0x24c049,{'showHidden':![],'depth':null}));}};module[_0x0862('0xc9')]=VoiceCallReport; \ No newline at end of file +var _0xc98a=['../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','set','queue','agi','dial','playback','FAILED','NO\x20ANSWER','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','newstate','syncVarSet','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','isUndefined','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','pick','includes','lastapplication','lastdata','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfercalleridnum','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/logger','ami','../ami'];(function(_0x3f7373,_0xae85c8){var _0xd421f5=function(_0x2d1156){while(--_0x2d1156){_0x3f7373['push'](_0x3f7373['shift']());}};_0xd421f5(++_0xae85c8);}(_0xc98a,0xc4));var _0xac98=function(_0x28762c,_0x2625e7){_0x28762c=_0x28762c-0x0;var _0x441a0b=_0xc98a[_0x28762c];return _0x441a0b;};'use strict';var BPromise=require(_0xac98('0x0'));var _=require(_0xac98('0x1'));var moment=require(_0xac98('0x2'));var util=require(_0xac98('0x3'));var path=require(_0xac98('0x4'));var Redis=require(_0xac98('0x5'));var config=require('../../../config/environment');var logger=require(_0xac98('0x6'))(_0xac98('0x7'));var ami=require(_0xac98('0x8'));var Channel=require(_0xac98('0x9'));var RpcSetting=require('../rpc/setting');var statusDesc=[_0xac98('0xa'),_0xac98('0xb'),_0xac98('0xc'),_0xac98('0xd'),_0xac98('0xe'),_0xac98('0xf'),_0xac98('0x10'),'ringinuse','onhold'];var applications=[_0xac98('0x11'),_0xac98('0x12'),_0xac98('0x13'),_0xac98('0x14'),_0xac98('0x15'),'voicemail'];var dispositions=['NO\x20ANSWER',_0xac98('0x16'),_0xac98('0x16'),_0xac98('0x17'),_0xac98('0x17'),_0xac98('0x17'),'ANSWERED',_0xac98('0x18'),'FAILED','FAILED',_0xac98('0x16')];var actions={};config[_0xac98('0x19')]=_['defaults'](config['redis'],{'host':_0xac98('0x1a'),'port':0x18eb});var io=require(_0xac98('0x1b'))(new Redis(config[_0xac98('0x19')]));function VoiceCallReport(_0xaff7c9){this[_0xac98('0x1c')]=_0xaff7c9[_0xac98('0x1c')];this[_0xac98('0x1d')]=_0xaff7c9['agents'];this[_0xac98('0x1e')]={};ami['on']('coreshowchannel',this[_0xac98('0x1f')][_0xac98('0x20')](this));ami['on'](_0xac98('0x21'),this[_0xac98('0x1f')][_0xac98('0x20')](this));ami['on'](_0xac98('0x22'),this['syncNewChannel'][_0xac98('0x20')](this));ami['on'](_0xac98('0x23'),this['syncNewState'][_0xac98('0x20')](this));ami['on']('varset',this[_0xac98('0x24')][_0xac98('0x20')](this));ami['on'](_0xac98('0x25'),this['syncHangup'][_0xac98('0x20')](this));ami['on'](_0xac98('0x26'),this[_0xac98('0x27')]['bind'](this));ami['on']('attendedtransfer',this[_0xac98('0x28')][_0xac98('0x20')](this));ami['on'](_0xac98('0x29'),this[_0xac98('0x2a')][_0xac98('0x20')](this));ami['on'](_0xac98('0x2b'),this[_0xac98('0x2c')]['bind'](this));ami['on'](_0xac98('0x2d'),this[_0xac98('0x2e')][_0xac98('0x20')](this));try{logger[_0xac98('0x2f')](_0xac98('0x30'));ami[_0xac98('0x31')]();}catch(_0x423d7f){logger[_0xac98('0x32')](_0xac98('0x33'),util[_0xac98('0x34')](_0x423d7f,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xac98('0x35')]['isNotNull']=function(_0x5c9a97){return _0x5c9a97!==null&&!_['isUndefined'](_0x5c9a97);};VoiceCallReport[_0xac98('0x35')][_0xac98('0x36')]=function(_0x496e9a,_0x12350f,_0x44fb2d){io['to'](_0x496e9a)[_0xac98('0x36')](_0x12350f,_0x44fb2d);};VoiceCallReport[_0xac98('0x35')][_0xac98('0x27')]=function(_0x1519f3){try{if(this[_0xac98('0x37')](_0x1519f3)){logger[_0xac98('0x2f')](_0xac98('0x38'),_0x1519f3[_0xac98('0x39')],_0x1519f3[_0xac98('0x3a')],_0x1519f3[_0xac98('0x3b')]);logger[_0xac98('0x3c')](_0xac98('0x3d'),_0x1519f3[_0xac98('0x39')],util['inspect'](_0x1519f3,{'showHidden':![],'depth':null}));if(_0x1519f3[_0xac98('0x39')]===_0x1519f3['linkedid']){if(!_['isUndefined'](this[_0xac98('0x1c')][_0x1519f3[_0xac98('0x39')]])){_[_0xac98('0x3e')](this[_0xac98('0x1c')][_0x1519f3['uniqueid']],_['pick'](_0x1519f3,_[_0xac98('0x3f')](this[_0xac98('0x1c')][_0x1519f3[_0xac98('0x39')]])));}}if(_0x1519f3[_0xac98('0x40')]===_0xac98('0x41')){if(this[_0xac98('0x1d')][_0x1519f3[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]){if(_0x1519f3[_0xac98('0x44')]==_0xac98('0x45')){this['agents'][_0x1519f3[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x46')]=_0x1519f3[_0xac98('0x47')];this['emit'](util[_0xac98('0x48')](_0xac98('0x49'),this[_0xac98('0x1d')][_0x1519f3[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4a')]),_0xac98('0x4b'),{'destaccountcode':this[_0xac98('0x1d')][_0x1519f3['channel'][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4c')],'destconnectedlinenum':_0x1519f3[_0xac98('0x47')]});}}}}}catch(_0x3ed684){logger[_0xac98('0x32')](_0xac98('0x4d'),_0x1519f3[_0xac98('0x39')],util[_0xac98('0x34')](_0x3ed684,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xac98('0x4e')]=function(_0x483367){try{if(this[_0xac98('0x37')](_0x483367)){logger[_0xac98('0x3c')](_0xac98('0x4f'),_0x483367['uniqueid'],util[_0xac98('0x34')](_0x483367,{'showHidden':![],'depth':null}));if(_0x483367[_0xac98('0x39')]===_0x483367[_0xac98('0x50')]&&_0x483367[_0xac98('0x42')]!=_0xac98('0x51')){if(_[_0xac98('0x52')](this[_0xac98('0x1c')][_0x483367[_0xac98('0x39')]])){logger['info'](_0xac98('0x53'),_0x483367[_0xac98('0x39')],_0x483367[_0xac98('0x40')],_0x483367[_0xac98('0x44')]);this[_0xac98('0x1c')][_0x483367['uniqueid']]=new Channel();this[_0xac98('0x1c')][_0x483367[_0xac98('0x39')]][_0xac98('0x54')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x483367[_0xac98('0x39')]][_0xac98('0x55')]=dispositions[_[_0xac98('0x56')](_0x483367[_0xac98('0x57')])];_[_0xac98('0x3e')](this[_0xac98('0x1c')][_0x483367[_0xac98('0x39')]],_['pick'](_0x483367,_[_0xac98('0x3f')](this['channels'][_0x483367[_0xac98('0x39')]])));if(_0x483367[_0xac98('0x40')]==='from-sip'){if(this[_0xac98('0x1d')][_0x483367[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]){if(_['isUndefined'](this['agents'][_0x483367[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x46')])){this[_0xac98('0x1d')][_0x483367[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x46')]=_0x483367['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x483367[_0xac98('0x39')],util[_0xac98('0x34')]({'destaccountcode':this[_0xac98('0x1d')][_0x483367[_0xac98('0x42')]['split']('-')[0x0]][_0xac98('0x4c')],'destconnectedlinenum':_0x483367[_0xac98('0x44')]},{'showHidden':![],'depth':null}));this[_0xac98('0x36')](util[_0xac98('0x48')]('user:%s',this['agents'][_0x483367[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4a')]),_0xac98('0x4b'),{'destaccountcode':this[_0xac98('0x1d')][_0x483367[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4c')],'destconnectedlinenum':_0x483367[_0xac98('0x44')]});}}}}}}}catch(_0x46ac32){logger[_0xac98('0x32')](_0xac98('0x58'),_0x483367[_0xac98('0x39')],util[_0xac98('0x34')](_0x46ac32,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')][_0xac98('0x1f')]=function(_0x5bc60a){try{if(this['isNotNull'](_0x5bc60a)){logger[_0xac98('0x3c')]('[%s][voiceCallReport][newexten]\x20event:',_0x5bc60a[_0xac98('0x39')],util[_0xac98('0x34')](_0x5bc60a,{'showHidden':![],'depth':null}));if(_0x5bc60a[_0xac98('0x39')]===_0x5bc60a[_0xac98('0x50')]&&_0x5bc60a['exten']!='h'&&_0x5bc60a['channel']!=_0xac98('0x51')){_0x5bc60a[_0xac98('0x59')]=_0x5bc60a[_0xac98('0x59')][_0xac98('0x5a')]();_0x5bc60a[_0xac98('0x5b')]=_0x5bc60a[_0xac98('0x5c')]&&_0x5bc60a[_0xac98('0x5c')]['startsWith'](_0xac98('0x5d'))?_0x5bc60a['appdata']:(_0x5bc60a[_0xac98('0x5c')]||_0x5bc60a[_0xac98('0x5b')])[_0xac98('0x5a')]();logger[_0xac98('0x2f')](_0xac98('0x5e'),_0x5bc60a[_0xac98('0x39')],_0x5bc60a['application'],_0x5bc60a[_0xac98('0x5b')]);if(_[_0xac98('0x52')](this[_0xac98('0x1c')][_0x5bc60a[_0xac98('0x39')]])){this[_0xac98('0x1c')][_0x5bc60a[_0xac98('0x39')]]=new Channel();this[_0xac98('0x1c')][_0x5bc60a[_0xac98('0x39')]][_0xac98('0x54')]=_0x5bc60a[_0xac98('0x5f')]?moment()[_0xac98('0x60')](moment['duration'](_0x5bc60a[_0xac98('0x5f')])[_0xac98('0x61')](),'seconds')['format'](_0xac98('0x62')):moment()['format'](_0xac98('0x62'));this[_0xac98('0x1c')][_0x5bc60a[_0xac98('0x39')]][_0xac98('0x55')]=_0xac98('0x17');}_['merge'](this['channels'][_0x5bc60a['uniqueid']],_[_0xac98('0x63')](_0x5bc60a,_[_0xac98('0x3f')](this[_0xac98('0x1c')][_0x5bc60a[_0xac98('0x39')]])));if(_[_0xac98('0x64')](applications,_0x5bc60a['application'])){this[_0xac98('0x1c')][_0x5bc60a['uniqueid']][_0xac98('0x65')]=_0x5bc60a['application'];this['channels'][_0x5bc60a[_0xac98('0x39')]][_0xac98('0x66')]=_0x5bc60a[_0xac98('0x5b')];if(_0x5bc60a['application']===_0xac98('0x11')&&_[_0xac98('0x67')](_0x5bc60a[_0xac98('0x5b')][_0xac98('0x5a')](),_0xac98('0x68'))){var _0x3acf57=_0x5bc60a[_0xac98('0x5b')][_0xac98('0x43')]('=');var _0x1f2f9e=_0x3acf57[0x0][_0xac98('0x5a')]()[_0xac98('0x69')](/cdr\((.*)\)/);if(_0x1f2f9e){this['channels'][_0x5bc60a['uniqueid']][_0x1f2f9e[0x1]]=_0x3acf57[0x1];}}else if(_0x5bc60a[_0xac98('0x59')]==='queue'){this['channels'][_0x5bc60a[_0xac98('0x39')]][_0xac98('0x12')]=_0x5bc60a[_0xac98('0x5b')][_0xac98('0x43')](',')[0x0];}}}}}catch(_0x1cb1bc){logger[_0xac98('0x32')](_0xac98('0x6a'),_0x5bc60a[_0xac98('0x39')],util[_0xac98('0x34')](_0x1cb1bc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')]['syncNewState']=function(_0x1313af){try{if(this[_0xac98('0x37')](_0x1313af)){logger[_0xac98('0x2f')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1313af[_0xac98('0x39')],_0x1313af[_0xac98('0x50')],_0x1313af[_0xac98('0x3a')],_0x1313af['calleridnum']);logger[_0xac98('0x3c')](_0xac98('0x6b'),_0x1313af[_0xac98('0x39')],util[_0xac98('0x34')](_0x1313af,{'showHidden':![],'depth':null}));if(_0x1313af['uniqueid']!==_0x1313af[_0xac98('0x50')]){if(this[_0xac98('0x1c')][_0x1313af['linkedid']]){if(_0x1313af[_0xac98('0x57')]==='6'){if(!this[_0xac98('0x1c')][_0x1313af['linkedid']][_0xac98('0x6c')]){var _0x542ad0=moment();this['channels'][_0x1313af[_0xac98('0x50')]][_0xac98('0x6c')]=!![];this['channels'][_0x1313af['linkedid']][_0xac98('0x6d')]=_0x542ad0[_0xac98('0x48')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x54')]){this[_0xac98('0x1c')][_0x1313af['linkedid']][_0xac98('0x6e')]=_0x542ad0[_0xac98('0x6f')](this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x54')],_0xac98('0x61'));}}this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x50')]=_0x1313af['uniqueid'];if(_0x1313af[_0xac98('0x3b')]!=='xcally-motion-preview'){this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]]['connectedlinenum']=_0x1313af['calleridnum'];}this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x70')]=_0x1313af[_0xac98('0x3a')];this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x71')]=_0x1313af[_0xac98('0x42')];this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]][_0xac98('0x55')]=dispositions[_[_0xac98('0x56')](_0x1313af['channelstate'])];if(this[_0xac98('0x1d')][_0x1313af['channel'][_0xac98('0x43')]('-')[0x0]]){this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]]['UserId']=this['agents'][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]['id'];this[_0xac98('0x1c')][_0x1313af['linkedid']][_0xac98('0x72')]=this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')]['split']('-')[0x0]][_0xac98('0x4a')];}}}}else{if(this['channels'][_0x1313af[_0xac98('0x39')]]){if(_0x1313af[_0xac98('0x57')]==='6'){if(this[_0xac98('0x1d')][_0x1313af['channel'][_0xac98('0x43')]('-')[0x0]]){this[_0xac98('0x1c')][_0x1313af['uniqueid']]['UserId']=this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]['id'];this[_0xac98('0x1c')][_0x1313af[_0xac98('0x39')]][_0xac98('0x72')]=this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4a')];}}}}if(_0x1313af[_0xac98('0x57')]==='6'&&_0x1313af[_0xac98('0x40')]===_0xac98('0x41')){if(this[_0xac98('0x1d')][_0x1313af['channel'][_0xac98('0x43')]('-')[0x0]]){this['agents'][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x46')]=_0x1313af[_0xac98('0x44')];var _0x2bb945;if(this['channels'][_0x1313af[_0xac98('0x39')]])_0x2bb945=this[_0xac98('0x1c')][_0x1313af['uniqueid']][_0xac98('0x73')];else if(this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]])_0x2bb945=this[_0xac98('0x1c')][_0x1313af[_0xac98('0x50')]]['routealias'];logger[_0xac98('0x3c')](_0xac98('0x74'),_0x1313af[_0xac98('0x39')],util[_0xac98('0x34')]({'destaccountcode':this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4c')],'destconnectedlinenum':_0x1313af['exten'],'routealias':_0x2bb945},{'showHidden':![],'depth':null}));this[_0xac98('0x36')](util[_0xac98('0x48')](_0xac98('0x49'),this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')]['split']('-')[0x0]]['name']),_0xac98('0x4b'),{'destaccountcode':this[_0xac98('0x1d')][_0x1313af[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4c')],'destconnectedlinenum':_0x1313af[_0xac98('0x44')],'routealias':_0x2bb945});}}}}catch(_0x282fb5){logger[_0xac98('0x32')](_0xac98('0x75'),_0x1313af[_0xac98('0x39')],util['inspect'](_0x282fb5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')][_0xac98('0x76')]=function(_0x9c6e70,_0x20c752){try{if(this['channels'][_0x9c6e70]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x9c6e70,_0x20c752);this['channels'][_0x9c6e70]['monitor']=!![];if(_[_0xac98('0x77')](_0x20c752,_0xac98('0x78'))){_0x20c752=_0x20c752[_0xac98('0x79')](_0xac98('0x78'),_0xac98('0x7a'));}this[_0xac98('0x1c')][_0x9c6e70][_0xac98('0x7b')]=_0x20c752;var _0x5bd528=_[_0xac98('0x7c')](this[_0xac98('0x1c')][_0x9c6e70][_0xac98('0x7d')],{'filename':_0x20c752});if(_[_0xac98('0x7e')](_0x5bd528)){this[_0xac98('0x1c')][_0x9c6e70][_0xac98('0x7d')][_0xac98('0x7f')]({'filename':_0x20c752,'createdAt':moment()[_0xac98('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x3ff7e9){logger[_0xac98('0x32')](_0xac98('0x80'),_0x9c6e70,util['inspect'](_0x3ff7e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')][_0xac98('0x24')]=function(_0x3272f0){try{if(this[_0xac98('0x37')](_0x3272f0)){logger[_0xac98('0x3c')](_0xac98('0x81'),_0x3272f0[_0xac98('0x39')],util[_0xac98('0x34')](_0x3272f0,{'showHidden':![],'depth':null}));if(this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x39')]]&&_0x3272f0[_0xac98('0x42')]!='OutgoingSpoolFailed'){if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')])){if(this['isNotNull'](_0x3272f0[_0xac98('0x82')]['mixmonitor_filename'])){logger[_0xac98('0x2f')](_0xac98('0x83'),_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x76')](_0x3272f0['uniqueid'],_0x3272f0[_0xac98('0x84')]);}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')]['xmd-phone'])){logger[_0xac98('0x2f')](_0xac98('0x85'),_0x3272f0['uniqueid'],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x1c')][_0x3272f0['uniqueid']][_0xac98('0x3b')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0['variable']['xmd-callerid'])){logger[_0xac98('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x1c')][_0x3272f0['uniqueid']][_0xac98('0x86')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')][_0xac98('0x87')])){logger[_0xac98('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x39')]][_0xac98('0x88')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')][_0xac98('0x89')])){logger['info'](_0xac98('0x8a'),_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')][_0xac98('0x43')](',')[0x0]);this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x39')]][_0xac98('0x12')]=_0x3272f0[_0xac98('0x84')]['split'](',')[0x0];}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')][_0xac98('0x8b')])){logger[_0xac98('0x2f')](_0xac98('0x8c'),_0x3272f0['uniqueid'],_0x3272f0[_0xac98('0x84')]);this['channels'][_0x3272f0[_0xac98('0x39')]][_0xac98('0x8d')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0['variable'][_0xac98('0x8e')])){logger['info'](_0xac98('0x8f'),_0x3272f0[_0xac98('0x39')],_0x3272f0['value']);this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x39')]]['destination']=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')]['xmd-callerid-preview'])){logger[_0xac98('0x2f')](_0xac98('0x90'),_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x39')]][_0xac98('0x91')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')]['xmcs-queue'])){logger[_0xac98('0x2f')](_0xac98('0x92'),_0x3272f0[_0xac98('0x39')],_0x3272f0[_0xac98('0x84')]);this['channels'][_0x3272f0[_0xac98('0x39')]][_0xac98('0x12')]=_0x3272f0[_0xac98('0x84')];}else if(this[_0xac98('0x37')](_0x3272f0['variable']['sipcallid'])){logger[_0xac98('0x2f')](_0xac98('0x93'),_0x3272f0[_0xac98('0x39')],_0x3272f0['value']);this[_0xac98('0x1c')][_0x3272f0['uniqueid']][_0xac98('0x94')]=_0x3272f0[_0xac98('0x84')];}}}else if(this[_0xac98('0x37')](_0x3272f0[_0xac98('0x82')][_0xac98('0x95')])){if(_0x3272f0[_0xac98('0x84')]){var _0x3dfd8d=path[_0xac98('0x96')](_0x3272f0['value'])[_0xac98('0x4a')];logger[_0xac98('0x2f')](_0xac98('0x83'),_0x3dfd8d,_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x76')](_0x3dfd8d,_0x3272f0['value']);}}else if(this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x50')]]){if(this['isNotNull'](_0x3272f0[_0xac98('0x82')])){if(this['isNotNull'](_0x3272f0[_0xac98('0x82')][_0xac98('0x97')])){logger[_0xac98('0x2f')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x3272f0[_0xac98('0x50')],_0x3272f0[_0xac98('0x84')]);this[_0xac98('0x1c')][_0x3272f0[_0xac98('0x50')]][_0xac98('0x98')]=_0x3272f0['value'];}}}}}catch(_0xb6fa43){logger[_0xac98('0x32')](_0xac98('0x99'),_0x3272f0['uniqueid'],util[_0xac98('0x34')](_0xb6fa43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')][_0xac98('0x9a')]=function(_0x92e6be){try{if(this[_0xac98('0x37')](_0x92e6be)){logger[_0xac98('0x3c')](_0xac98('0x9b'),_0x92e6be[_0xac98('0x39')],util['inspect'](_0x92e6be,{'showHidden':![],'depth':null}));if(this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]]){logger[_0xac98('0x2f')](_0xac98('0x9c'),_0x92e6be[_0xac98('0x39')],_0x92e6be[_0xac98('0x9d')]);var _0x155523=moment();this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x9e')]=_0x155523[_0xac98('0x48')](_0xac98('0x62'));this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]]['duration']=_0x155523[_0xac98('0x6f')](this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x54')],_0xac98('0x61'));if(this[_0xac98('0x1c')][_0x92e6be['uniqueid']][_0xac98('0x6c')]){this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x9f')]=_0x155523[_0xac98('0x6f')](this['channels'][_0x92e6be['uniqueid']][_0xac98('0x6d')],'seconds');this[_0xac98('0x1c')][_0x92e6be['uniqueid']][_0xac98('0x6e')]=this['channels'][_0x92e6be['uniqueid']][_0xac98('0x5f')]-this[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x9f')];}if(_0x92e6be[_0xac98('0x40')]===_0xac98('0x41')){if(this[_0xac98('0x1d')][_0x92e6be[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]){this['agents'][_0x92e6be[_0xac98('0x42')]['split']('-')[0x0]]=_[_0xac98('0xa0')](this[_0xac98('0x1d')][_0x92e6be['channel']['split']('-')[0x0]],[_0xac98('0x46')]);logger['debug'](_0xac98('0xa1'),_0x92e6be[_0xac98('0x39')],util['inspect']({'id':this[_0xac98('0x1d')][_0x92e6be['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xac98('0x1d')][_0x92e6be[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0xac98('0x48')](_0xac98('0x49'),this[_0xac98('0x1d')][_0x92e6be['channel'][_0xac98('0x43')]('-')[0x0]][_0xac98('0x4a')]),_0xac98('0xa2'),{'id':this[_0xac98('0x1d')][_0x92e6be[_0xac98('0x42')][_0xac98('0x43')]('-')[0x0]]['id'],'destaccountcode':this[_0xac98('0x1d')][_0x92e6be[_0xac98('0x42')]['split']('-')[0x0]][_0xac98('0x4c')]});}}var _0x2bee0f=this;Promise['resolve']()[_0xac98('0xa3')](function(){var _0x5c413d=_0x2bee0f['channels'][_0x92e6be[_0xac98('0x39')]];if(typeof _0x5c413d[_0xac98('0xa4')]===_0xac98('0xa5'))return;if(_[_0xac98('0xa6')](_0x5c413d[_0xac98('0x7d')]))return;return RpcSetting[_0xac98('0xa7')]()[_0xac98('0xa3')](function(_0xb19cc2){if(!_0xb19cc2[_0xac98('0xa8')])return;return Promise['resolve']()[_0xac98('0xa3')](function(){return ami[_0xac98('0xa9')]({'action':_0xac98('0xaa'),'channel':_0x5c413d[_0xac98('0x42')]})[_0xac98('0xab')](function(){});})[_0xac98('0xa3')](function(){return ami['Action']({'action':_0xac98('0xaa'),'channel':_0x5c413d[_0xac98('0x71')]})['catch'](function(){})[_0xac98('0xac')](function(){var _0x4fd92d=_0x2bee0f[_0xac98('0x1d')][_0x5c413d[_0xac98('0x71')]['split']('-')[0x0]];if(!_0x4fd92d)return;io['emit'](_0xac98('0xad'),{'agentId':_0x4fd92d['id'],'uniqueid':_0x5c413d['uniqueid']});});});});})[_0xac98('0xa3')](function(){if(_0x92e6be[_0xac98('0xae')]===_0xac98('0xaf')){_0x2bee0f[_0xac98('0x1e')][_0x92e6be[_0xac98('0x39')]]=_0x2bee0f[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]];}else{if(_0x2bee0f[_0xac98('0x1c')][_0x92e6be['uniqueid']][_0xac98('0x88')]===_0xac98('0xb0')&&_0x2bee0f['blindTransfers'][_0x92e6be[_0xac98('0x39')]]){_0x2bee0f[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x39')]=[_0x2bee0f[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x50')],_0x2bee0f[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]][_0xac98('0x50')]=_0x2bee0f['channels'][_0x92e6be[_0xac98('0x39')]]['uniqueid']][0x0];delete _0x2bee0f['blindTransfers'][_0x92e6be[_0xac98('0x39')]];}}logger[_0xac98('0x3c')](_0xac98('0xb1'),_0x92e6be[_0xac98('0x39')],util[_0xac98('0x34')](_0x2bee0f[_0xac98('0x1c')][_0x92e6be['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xac98('0xb2'),_0x2bee0f['channels'][_0x92e6be[_0xac98('0x39')]]);delete _0x2bee0f[_0xac98('0x1c')][_0x92e6be[_0xac98('0x39')]];});}}}catch(_0x181cdf){logger[_0xac98('0x32')]('[%s][voiceCallReport][hangup]',_0x92e6be[_0xac98('0x39')],util[_0xac98('0x34')](_0x181cdf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')][_0xac98('0x28')]=function(_0x1aad21){try{if(this[_0xac98('0x37')](_0x1aad21)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1aad21[_0xac98('0x39')],_0x1aad21[_0xac98('0xb3')],_0x1aad21['transfertargetcalleridnum']);logger['debug'](_0xac98('0xb4'),_0x1aad21[_0xac98('0x39')],util[_0xac98('0x34')](_0x1aad21,{'showHidden':![],'depth':null}));if(this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb5')]]){this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb5')]]['transfercalleridnum']=_0x1aad21[_0xac98('0xb3')];this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb5')]][_0xac98('0xb6')]=_0x1aad21[_0xac98('0xb7')];if(this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb8')]]){var _0x443a96=this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb8')]];this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb8')]]=this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb5')]];this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb5')]]=_0x443a96;}}else if(this[_0xac98('0x1c')][_0x1aad21['transfertargetuniqueid']]){this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb9')]]['transfercalleridnum']=_0x1aad21[_0xac98('0xb3')];this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb9')]][_0xac98('0xb6')]=_0x1aad21[_0xac98('0xb7')];if(this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]]){var _0x443a96=this['channels'][_0x1aad21[_0xac98('0xba')]];this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]]=this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb9')]];this[_0xac98('0x1c')][_0x1aad21['transfertargetuniqueid']]=_0x443a96;}}if((this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]]||this['channels'][_0x1aad21['origtransfererlinkedid']])&&this['channels'][_0x1aad21['secondtransfereruniqueid']]){var _0x15dbfc=_['some']([this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]],this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xbb')]],this[_0xac98('0x1c')][_0x1aad21['secondtransfereruniqueid']]],function(_0x3ca460){return _0x3ca460&&_0x3ca460[_0xac98('0x88')]===_0xac98('0xb0')&&_0x3ca460[_0xac98('0xbc')];});if(_0x15dbfc){if(this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]])this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xba')]][_0xac98('0xa4')]=_0xac98('0xbd');if(this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xbb')]])this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xbb')]][_0xac98('0xa4')]=_0xac98('0xbd');this[_0xac98('0x1c')][_0x1aad21[_0xac98('0xb8')]][_0xac98('0xa4')]='ATTENDED';}}}}catch(_0xc5702){logger[_0xac98('0x32')](_0xac98('0xbe'),_0x1aad21[_0xac98('0x39')],util[_0xac98('0x34')](_0xc5702,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x4ad81c){try{if(this[_0xac98('0x37')](_0x4ad81c)){logger[_0xac98('0x2f')](_0xac98('0xbf'),_0x4ad81c[_0xac98('0x39')],_0x4ad81c[_0xac98('0xc0')],_0x4ad81c[_0xac98('0xc1')]);logger[_0xac98('0x3c')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x4ad81c[_0xac98('0x39')],util[_0xac98('0x34')](_0x4ad81c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ad81c['transfereeuniqueid']]){this['channels'][_0x4ad81c[_0xac98('0xb5')]][_0xac98('0xc2')]=_0x4ad81c[_0xac98('0xc0')];this['channels'][_0x4ad81c[_0xac98('0xb5')]][_0xac98('0xb6')]=_0x4ad81c['extension'];this[_0xac98('0x1c')][_0x4ad81c['transfereeuniqueid']][_0xac98('0xa4')]=_0xac98('0xc3');this[_0xac98('0x9a')]({'event':_0xac98('0xaf'),'uniqueid':_0x4ad81c[_0xac98('0xb5')],'context':_0x4ad81c[_0xac98('0x40')],'channel':_0x4ad81c['transfererchannel']});}else{this[_0xac98('0x1c')][_0x4ad81c[_0xac98('0xc4')]][_0xac98('0xa4')]=_0xac98('0xc3');}}}catch(_0x3487b3){logger[_0xac98('0x32')](_0xac98('0xc5'),_0x4ad81c['uniqueid'],util[_0xac98('0x34')](_0x3487b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xac98('0x35')]['syncMusicOnHoldStart']=function(_0x397e96){try{if(this[_0xac98('0x37')](_0x397e96)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x397e96[_0xac98('0x39')],util[_0xac98('0x34')](_0x397e96,{'showHidden':![],'depth':null}));if(this[_0xac98('0x1c')][_0x397e96[_0xac98('0x39')]]){if(!_[_0xac98('0x7e')](this[_0xac98('0x1c')][_0x397e96[_0xac98('0x39')]][_0xac98('0x6d')])){this[_0xac98('0x1c')][_0x397e96['uniqueid']][_0xac98('0xc6')]=moment()[_0xac98('0x48')](_0xac98('0x62'));logger[_0xac98('0x2f')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x397e96[_0xac98('0x39')],this[_0xac98('0x1c')][_0x397e96[_0xac98('0x39')]][_0xac98('0xc6')]);}}}}catch(_0x1377b0){logger[_0xac98('0x32')]('[%s][voiceCallReport][musiconholdstart]',_0x397e96['uniqueid'],util['inspect'](_0x1377b0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xac98('0x2e')]=function(_0x3329ff){try{if(this[_0xac98('0x37')](_0x3329ff)){logger['debug'](_0xac98('0xc7'),_0x3329ff[_0xac98('0x39')],util['inspect'](_0x3329ff,{'showHidden':![],'depth':null}));if(this['channels'][_0x3329ff[_0xac98('0x39')]]){if(!_[_0xac98('0x7e')](this['channels'][_0x3329ff[_0xac98('0x39')]][_0xac98('0xc6')])){this['channels'][_0x3329ff[_0xac98('0x39')]][_0xac98('0xc8')]+=moment()[_0xac98('0xc9')](0x0)[_0xac98('0x6f')](this[_0xac98('0x1c')][_0x3329ff[_0xac98('0x39')]][_0xac98('0xc6')],'seconds');logger[_0xac98('0x2f')](_0xac98('0xca'),_0x3329ff[_0xac98('0x39')],this[_0xac98('0x1c')][_0x3329ff[_0xac98('0x39')]][_0xac98('0xc8')]);delete this[_0xac98('0x1c')][_0x3329ff[_0xac98('0x39')]]['mohstarttime'];}}}}catch(_0x3afedb){logger[_0xac98('0x32')](_0xac98('0xcb'),_0x3329ff[_0xac98('0x39')],util[_0xac98('0x34')](_0x3afedb,{'showHidden':![],'depth':null}));}};module[_0xac98('0xcc')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 8ee032e..dafc2d8 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9edf=['voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','lastevent','complete','total','answertime','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','moment','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','syncDialEnd','varset','syncVarSet','bind','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','outboundrouteid','value'];(function(_0x2d457a,_0xb3f867){var _0x31a7a0=function(_0x3f474f){while(--_0x3f474f){_0x2d457a['push'](_0x2d457a['shift']());}};_0x31a7a0(++_0xb3f867);}(_0x9edf,0xae));var _0xf9ed=function(_0x55599d,_0x51a245){_0x55599d=_0x55599d-0x0;var _0x7416d4=_0x9edf[_0x55599d];return _0x7416d4;};'use strict';var _=require('lodash');var moment=require(_0xf9ed('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xf9ed('0x1'));var logger=require('../../../config/logger')(_0xf9ed('0x2'));var ami=require(_0xf9ed('0x3'));config['redis']=_[_0xf9ed('0x4')](config[_0xf9ed('0x5')],{'host':_0xf9ed('0x6'),'port':0x18eb});var io=require(_0xf9ed('0x7'))(new Redis(config[_0xf9ed('0x5')]));function VoiceDialReport(_0x2f321f){this[_0xf9ed('0x8')]=_0x2f321f[_0xf9ed('0x9')];this[_0xf9ed('0xa')]=_0x2f321f[_0xf9ed('0xa')];this[_0xf9ed('0xb')]={};this[_0xf9ed('0xc')]={};ami['on']('dialbegin',this[_0xf9ed('0xd')]['bind'](this));ami['on']('dialend',this[_0xf9ed('0xe')]['bind'](this));ami['on'](_0xf9ed('0xf'),this[_0xf9ed('0x10')][_0xf9ed('0x11')](this));ami['on']('newexten',this[_0xf9ed('0x12')]['bind'](this));ami['on']('hangup',this[_0xf9ed('0x13')]['bind'](this));}VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x15')]=function(_0x3a5e9b){return _0x3a5e9b!==null&&!_[_0xf9ed('0x16')](_0x3a5e9b);};VoiceDialReport[_0xf9ed('0x14')]['emit']=function(_0x3d9a5e,_0x58549a,_0xa99c28){io['to'](_0x3d9a5e)[_0xf9ed('0x17')](_0x58549a,_0xa99c28);};VoiceDialReport[_0xf9ed('0x14')]['syncDialBegin']=function(_0x2224b8){try{if(this[_0xf9ed('0x15')](_0x2224b8)){logger[_0xf9ed('0x18')](_0xf9ed('0x19'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x2224b8,{'showHidden':![],'depth':null}));if(this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]]){_[_0xf9ed('0x1c')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'starttime':moment()[_0xf9ed('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf9ed('0x1e'),'interface':_0x2224b8[_0xf9ed('0x1f')][_0xf9ed('0x20')](0x0,_0x2224b8[_0xf9ed('0x1f')][_0xf9ed('0x21')]('-')),'membername':_0x2224b8[_0xf9ed('0x1f')]['substring'](_0x2224b8[_0xf9ed('0x1f')]['lastIndexOf']('/')+0x1,_0x2224b8['channel'][_0xf9ed('0x21')]('-'))},_[_0xf9ed('0x22')](_0x2224b8,[_0xf9ed('0x23'),'privilege']));logger[_0xf9ed('0x24')](_0xf9ed('0x25'),_0x2224b8[_0xf9ed('0x1a')],this['channels'][_0x2224b8[_0xf9ed('0x1a')]][_0xf9ed('0x26')],this['channels'][_0x2224b8[_0xf9ed('0x1a')]]['interface']);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0xf9ed('0xb')][_0x2224b8[_0xf9ed('0x1a')]])_['merge'](this[_0xf9ed('0x8')][_0x2224b8['uniqueid']],this[_0xf9ed('0xb')][_0x2224b8[_0xf9ed('0x1a')]]);this['emit'](_0xf9ed('0x27'),_0xf9ed('0x28'),this['channels'][_0x2224b8[_0xf9ed('0x1a')]]);logger['debug'](_0xf9ed('0x29'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x2224b8[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')](_0xf9ed('0x2a'),this['channels'][_0x2224b8[_0xf9ed('0x1a')]]);}}}catch(_0x1c52d9){logger[_0xf9ed('0x2b')](_0xf9ed('0x2c'),_0x2224b8[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x1c52d9,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x285214){try{if(this[_0xf9ed('0x15')](_0x285214)){logger[_0xf9ed('0x18')]('[%s][voiceDialReport][dialend]\x20event:',_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x285214,{'showHidden':![],'depth':null}));if(this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]){this['channels'][_0x285214[_0xf9ed('0x1a')]]['dialstatus']=_0x285214[_0xf9ed('0x2d')];if(_0x285214['dialstatus']==='ANSWER'){this[_0xf9ed('0x8')][_0x285214['uniqueid']][_0xf9ed('0x2e')]=_0x285214['connectedlinenum'];this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['connectedlinename']=_0x285214[_0xf9ed('0x2f')];this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['answertime']=moment()[_0xf9ed('0x1d')](_0xf9ed('0x30'));this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]['lastevent']=_0xf9ed('0x31');logger[_0xf9ed('0x24')](_0xf9ed('0x32'),_0x285214[_0xf9ed('0x1a')],_0x285214['channel'][_0xf9ed('0x20')](_0x285214['channel'][_0xf9ed('0x21')]('/')+0x1,_0x285214['channel']['lastIndexOf']('-')));logger[_0xf9ed('0x18')](_0xf9ed('0x33'),_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')](_0xf9ed('0x34'),this[_0xf9ed('0x8')][_0x285214['uniqueid']]);}logger[_0xf9ed('0x18')](_0xf9ed('0x35'),_0x285214['uniqueid'],util[_0xf9ed('0x1b')](this['channels'][_0x285214[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),'voice_outbound_channel:save',this[_0xf9ed('0x8')][_0x285214[_0xf9ed('0x1a')]]);}}}catch(_0x4e7846){logger['error']('[%s][voiceDialReport][dialend]',_0x285214[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x4e7846,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x10')]=function(_0x547912){try{if(this['isNotNull'](_0x547912)){logger['debug'](_0xf9ed('0x36'),_0x547912['uniqueid'],util[_0xf9ed('0x1b')](_0x547912,{'showHidden':![],'depth':null}));this[_0xf9ed('0x37')](_0x547912['uniqueid'],_[_0xf9ed('0x38')](_0x547912[_0xf9ed('0x39')])[0x0],_0x547912['value']);if(this[_0xf9ed('0x15')](_0x547912[_0xf9ed('0x39')])&&this[_0xf9ed('0x15')](_0x547912[_0xf9ed('0x39')][_0xf9ed('0x3a')])){if(_[_0xf9ed('0x16')](this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]])){this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]]={'routeId':_0x547912[_0xf9ed('0x3b')],'variables':this[_0xf9ed('0xc')][_0x547912['uniqueid']],'motionChannel':_0xf9ed('0x3c')};logger[_0xf9ed('0x24')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x547912[_0xf9ed('0x1a')],_0x547912[_0xf9ed('0x39')][_0xf9ed('0x3a')],_['keys'](_0x547912[_0xf9ed('0x39')])[0x0],_0x547912['value']);logger[_0xf9ed('0x18')](_0xf9ed('0x3d'),_0x547912[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x28'),this[_0xf9ed('0x8')][_0x547912[_0xf9ed('0x1a')]]);}}}}catch(_0x30e670){logger[_0xf9ed('0x2b')]('[%s][voiceDialReport][varset]',_0x547912[_0xf9ed('0x1a')],util['inspect'](_0x30e670,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x5a9dca,_0x4f4344,_0x2cdd5a){var _0x13e940=[_0xf9ed('0x3e'),_0xf9ed('0x3f'),_0xf9ed('0x40'),_0xf9ed('0x41'),_0xf9ed('0x42'),_0xf9ed('0x43'),'rtpaudioqosrtt',_0xf9ed('0x44'),'sipcallid',_0xf9ed('0x45'),_0xf9ed('0x46'),_0xf9ed('0x47'),_0xf9ed('0x48'),_0xf9ed('0x49'),_0xf9ed('0x4a'),_0xf9ed('0x4b'),_0xf9ed('0x26'),_0xf9ed('0x4c'),_0xf9ed('0x4d')];if(!_[_0xf9ed('0x4e')](_0x4f4344)&&!_['includes'](_0x13e940,_0x4f4344)){if(_[_0xf9ed('0x16')](this[_0xf9ed('0xc')][_0x5a9dca])){this['variables'][_0x5a9dca]={};}this[_0xf9ed('0xc')][_0x5a9dca][_0x4f4344]=_0x2cdd5a;}};VoiceDialReport[_0xf9ed('0x14')]['syncHangup']=function(_0x49ab43){try{if(this[_0xf9ed('0x15')](_0x49ab43)){logger[_0xf9ed('0x18')]('[%s][voiceDialReport][hangup]\x20event:',_0x49ab43['uniqueid'],util[_0xf9ed('0x1b')](_0x49ab43,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ab43[_0xf9ed('0x1a')]]){logger[_0xf9ed('0x24')](_0xf9ed('0x4f'),_0x49ab43[_0xf9ed('0x1a')],_0x49ab43[_0xf9ed('0x50')]);this['channels'][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')]=moment()['format'](_0xf9ed('0x30'));this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x52')]=moment(this['channels'][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x54')],_0xf9ed('0x55'));this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x56')]=_0xf9ed('0x57');this[_0xf9ed('0xa')][_0xf9ed('0x58')]+=0x1;if(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')]){this[_0xf9ed('0xa')]['answered']+=0x1;this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x5a')]=moment(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x54')],_0xf9ed('0x55'));this[_0xf9ed('0x8')][_0x49ab43['uniqueid']][_0xf9ed('0x5b')]=moment(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x51')])[_0xf9ed('0x53')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x59')],_0xf9ed('0x55'));this['outbound'][_0xf9ed('0x5c')]+=this[_0xf9ed('0x8')][_0x49ab43['uniqueid']][_0xf9ed('0x5a')]||0x0;this['outbound'][_0xf9ed('0x5d')]+=this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]][_0xf9ed('0x5b')];}this[_0xf9ed('0xa')][_0xf9ed('0x5e')]+=this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]]['duration'];logger[_0xf9ed('0x18')](_0xf9ed('0x5f'),_0x49ab43[_0xf9ed('0x1a')],util['inspect'](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')]('custom:voiceDialReport',this['channels'][_0x49ab43['uniqueid']]);logger['debug'](_0xf9ed('0x60'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this['channels'][_0x49ab43['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9ed('0x17')]('custom:dialend',this[_0xf9ed('0x8')][_0x49ab43['uniqueid']]);logger[_0xf9ed('0x18')](_0xf9ed('0x61'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x62'),this[_0xf9ed('0xa')]);logger[_0xf9ed('0x24')](_0xf9ed('0x63'),JSON[_0xf9ed('0x64')](this[_0xf9ed('0x8')][_0x49ab43['uniqueid']]));logger[_0xf9ed('0x18')](_0xf9ed('0x65'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](this['channels'][_0x49ab43[_0xf9ed('0x1a')]],{'showHidden':![],'depth':null}));this[_0xf9ed('0x17')](_0xf9ed('0x27'),_0xf9ed('0x66'),this['channels'][_0x49ab43[_0xf9ed('0x1a')]]);delete this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x1a')]];}else if(this[_0xf9ed('0x8')][_0x49ab43[_0xf9ed('0x67')]]){this[_0xf9ed('0x8')][_0x49ab43['linkedid']]['uniqueid']=this['channels'][_0x49ab43[_0xf9ed('0x67')]][_0xf9ed('0x68')];}if(this['variables'][_0x49ab43[_0xf9ed('0x1a')]]){delete this[_0xf9ed('0xc')][_0x49ab43[_0xf9ed('0x1a')]];}}}catch(_0x1f9352){logger[_0xf9ed('0x2b')](_0xf9ed('0x69'),_0x49ab43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x1f9352,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9ed('0x14')][_0xf9ed('0x12')]=function(_0x4fcd43){try{if(this['isNotNull'](_0x4fcd43)){logger[_0xf9ed('0x18')](_0xf9ed('0x6a'),_0x4fcd43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x4fcd43,{'showHidden':![],'depth':null}));if(_0x4fcd43[_0xf9ed('0x6b')]['toLowerCase']()==='set'){_0x4fcd43[_0xf9ed('0x6c')]=(_0x4fcd43[_0xf9ed('0x6d')]||_0x4fcd43[_0xf9ed('0x6c')])[_0xf9ed('0x6e')]();if(_[_0xf9ed('0x6f')](_0x4fcd43['applicationdata'],_0xf9ed('0x70'))){if(_[_0xf9ed('0x16')](this['applications'][_0x4fcd43[_0xf9ed('0x1a')]]))this[_0xf9ed('0xb')][_0x4fcd43[_0xf9ed('0x1a')]]={};logger[_0xf9ed('0x24')](_0xf9ed('0x71'),_0x4fcd43[_0xf9ed('0x1a')],_0x4fcd43[_0xf9ed('0x6b')],_0x4fcd43[_0xf9ed('0x6c')]);var _0x4ab455=_0x4fcd43[_0xf9ed('0x6c')][_0xf9ed('0x72')]('=');var _0x4b0bae=_0x4ab455[0x0][_0xf9ed('0x73')](/cdr\((.*)\)/);if(_0x4b0bae)this['applications'][_0x4fcd43[_0xf9ed('0x1a')]][_0x4b0bae[0x1]]=_0x4ab455[0x1];}}}}catch(_0x3a68b0){logger[_0xf9ed('0x2b')]('[%s][voiceDialReport][newexten]',_0x4fcd43[_0xf9ed('0x1a')],util[_0xf9ed('0x1b')](_0x3a68b0,{'showHidden':![],'depth':null}));}};module[_0xf9ed('0x74')]=VoiceDialReport; \ No newline at end of file +var _0x750d=['complete','total','holdtime','billableseconds','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','merge','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','inspect','custom:dialbegin','error','isNotNull','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialend]','addVariable','keys','variable','value','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','variables','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','diff','starttime','seconds'];(function(_0x230a9b,_0x3bbee7){var _0x28dfd1=function(_0x18f00a){while(--_0x18f00a){_0x230a9b['push'](_0x230a9b['shift']());}};_0x28dfd1(++_0x3bbee7);}(_0x750d,0x112));var _0xd750=function(_0x53d785,_0x58b79f){_0x53d785=_0x53d785-0x0;var _0x2df063=_0x750d[_0x53d785];return _0x2df063;};'use strict';var _=require('lodash');var moment=require(_0xd750('0x0'));var util=require(_0xd750('0x1'));var Redis=require(_0xd750('0x2'));var config=require(_0xd750('0x3'));var logger=require(_0xd750('0x4'))(_0xd750('0x5'));var ami=require(_0xd750('0x6'));config['redis']=_[_0xd750('0x7')](config[_0xd750('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd750('0x9'))(new Redis(config[_0xd750('0x8')]));function VoiceDialReport(_0x4ab127){this[_0xd750('0xa')]=_0x4ab127[_0xd750('0xb')];this[_0xd750('0xc')]=_0x4ab127['outbound'];this[_0xd750('0xd')]={};this['variables']={};ami['on'](_0xd750('0xe'),this[_0xd750('0xf')][_0xd750('0x10')](this));ami['on'](_0xd750('0x11'),this[_0xd750('0x12')][_0xd750('0x10')](this));ami['on'](_0xd750('0x13'),this[_0xd750('0x14')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0xd750('0x10')](this));ami['on'](_0xd750('0x15'),this[_0xd750('0x16')]['bind'](this));}VoiceDialReport[_0xd750('0x17')]['isNotNull']=function(_0x59d18f){return _0x59d18f!==null&&!_['isUndefined'](_0x59d18f);};VoiceDialReport[_0xd750('0x17')][_0xd750('0x18')]=function(_0x94638b,_0x279559,_0x4e61d8){io['to'](_0x94638b)[_0xd750('0x18')](_0x279559,_0x4e61d8);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x21c463){try{if(this['isNotNull'](_0x21c463)){logger[_0xd750('0x19')](_0xd750('0x1a'),_0x21c463[_0xd750('0x1b')],util['inspect'](_0x21c463,{'showHidden':![],'depth':null}));if(this[_0xd750('0xa')][_0x21c463[_0xd750('0x1b')]]){_['merge'](this[_0xd750('0xa')][_0x21c463[_0xd750('0x1b')]],{'starttime':moment()[_0xd750('0x1c')](_0xd750('0x1d')),'lastevent':_0xd750('0x1e'),'interface':_0x21c463['channel'][_0xd750('0x1f')](0x0,_0x21c463[_0xd750('0x20')][_0xd750('0x21')]('-')),'membername':_0x21c463['channel'][_0xd750('0x1f')](_0x21c463[_0xd750('0x20')]['lastIndexOf']('/')+0x1,_0x21c463[_0xd750('0x20')][_0xd750('0x21')]('-'))},_[_0xd750('0x22')](_0x21c463,['event','privilege']));logger[_0xd750('0x23')](_0xd750('0x24'),_0x21c463[_0xd750('0x1b')],this[_0xd750('0xa')][_0x21c463['uniqueid']]['membername'],this['channels'][_0x21c463[_0xd750('0x1b')]][_0xd750('0x25')]);logger[_0xd750('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x21c463[_0xd750('0x1b')],util['inspect'](this['channels'][_0x21c463[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0xd750('0xd')][_0x21c463[_0xd750('0x1b')]])_[_0xd750('0x26')](this[_0xd750('0xa')][_0x21c463['uniqueid']],this['applications'][_0x21c463[_0xd750('0x1b')]]);this[_0xd750('0x18')]('voice:outbound',_0xd750('0x27'),this[_0xd750('0xa')][_0x21c463[_0xd750('0x1b')]]);logger[_0xd750('0x19')](_0xd750('0x28'),_0x21c463[_0xd750('0x1b')],util[_0xd750('0x29')](this[_0xd750('0xa')][_0x21c463[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xd750('0x18')](_0xd750('0x2a'),this[_0xd750('0xa')][_0x21c463[_0xd750('0x1b')]]);}}}catch(_0x3c4614){logger[_0xd750('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x21c463[_0xd750('0x1b')],util[_0xd750('0x29')](_0x3c4614,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd750('0x17')][_0xd750('0x12')]=function(_0x157f29){try{if(this[_0xd750('0x2c')](_0x157f29)){logger[_0xd750('0x19')](_0xd750('0x2d'),_0x157f29['uniqueid'],util[_0xd750('0x29')](_0x157f29,{'showHidden':![],'depth':null}));if(this[_0xd750('0xa')][_0x157f29[_0xd750('0x1b')]]){this[_0xd750('0xa')][_0x157f29['uniqueid']]['dialstatus']=_0x157f29[_0xd750('0x2e')];if(_0x157f29['dialstatus']===_0xd750('0x2f')){this['channels'][_0x157f29[_0xd750('0x1b')]][_0xd750('0x30')]=_0x157f29[_0xd750('0x30')];this[_0xd750('0xa')][_0x157f29[_0xd750('0x1b')]][_0xd750('0x31')]=_0x157f29[_0xd750('0x31')];this[_0xd750('0xa')][_0x157f29[_0xd750('0x1b')]][_0xd750('0x32')]=moment()['format'](_0xd750('0x1d'));this['channels'][_0x157f29[_0xd750('0x1b')]][_0xd750('0x33')]=_0xd750('0x34');logger['info'](_0xd750('0x35'),_0x157f29[_0xd750('0x1b')],_0x157f29[_0xd750('0x20')][_0xd750('0x1f')](_0x157f29[_0xd750('0x20')][_0xd750('0x21')]('/')+0x1,_0x157f29['channel'][_0xd750('0x21')]('-')));logger[_0xd750('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x157f29[_0xd750('0x1b')],util['inspect'](this['channels'][_0x157f29[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xd750('0x18')](_0xd750('0x36'),this[_0xd750('0xa')][_0x157f29[_0xd750('0x1b')]]);}logger[_0xd750('0x19')](_0xd750('0x37'),_0x157f29[_0xd750('0x1b')],util[_0xd750('0x29')](this['channels'][_0x157f29[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0xd750('0x38'),_0xd750('0x27'),this[_0xd750('0xa')][_0x157f29['uniqueid']]);}}}catch(_0x346ac0){logger['error'](_0xd750('0x39'),_0x157f29[_0xd750('0x1b')],util[_0xd750('0x29')](_0x346ac0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd750('0x17')]['syncVarSet']=function(_0x26eda9){try{if(this['isNotNull'](_0x26eda9)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0x26eda9[_0xd750('0x1b')],util['inspect'](_0x26eda9,{'showHidden':![],'depth':null}));this[_0xd750('0x3a')](_0x26eda9[_0xd750('0x1b')],_[_0xd750('0x3b')](_0x26eda9[_0xd750('0x3c')])[0x0],_0x26eda9[_0xd750('0x3d')]);if(this[_0xd750('0x2c')](_0x26eda9[_0xd750('0x3c')])&&this['isNotNull'](_0x26eda9[_0xd750('0x3c')][_0xd750('0x3e')])){if(_[_0xd750('0x3f')](this[_0xd750('0xa')][_0x26eda9[_0xd750('0x1b')]])){this[_0xd750('0xa')][_0x26eda9[_0xd750('0x1b')]]={'routeId':_0x26eda9['value'],'variables':this['variables'][_0x26eda9['uniqueid']],'motionChannel':_0xd750('0x40')};logger[_0xd750('0x23')](_0xd750('0x41'),_0x26eda9['uniqueid'],_0x26eda9[_0xd750('0x3c')][_0xd750('0x3e')],_['keys'](_0x26eda9[_0xd750('0x3c')])[0x0],_0x26eda9['value']);logger[_0xd750('0x19')](_0xd750('0x42'),_0x26eda9['uniqueid'],util[_0xd750('0x29')](this[_0xd750('0xa')][_0x26eda9[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));this[_0xd750('0x18')](_0xd750('0x38'),_0xd750('0x27'),this[_0xd750('0xa')][_0x26eda9[_0xd750('0x1b')]]);}}}}catch(_0x1e918c){logger[_0xd750('0x2b')](_0xd750('0x43'),_0x26eda9[_0xd750('0x1b')],util[_0xd750('0x29')](_0x1e918c,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xd750('0x3a')]=function(_0x46ff64,_0x4b6ff7,_0x25f457){var _0x457bec=[_0xd750('0x44'),'rtpaudioqosbridged',_0xd750('0x45'),'rtpaudioqosjitterbridged',_0xd750('0x46'),_0xd750('0x47'),'rtpaudioqosrtt',_0xd750('0x48'),_0xd750('0x49'),_0xd750('0x4a'),_0xd750('0x4b'),_0xd750('0x4c'),_0xd750('0x4d'),_0xd750('0x4e'),'memberinterface',_0xd750('0x4f'),'membername',_0xd750('0x50'),_0xd750('0x51')];if(!_[_0xd750('0x52')](_0x4b6ff7)&&!_[_0xd750('0x53')](_0x457bec,_0x4b6ff7)){if(_[_0xd750('0x3f')](this['variables'][_0x46ff64])){this[_0xd750('0x54')][_0x46ff64]={};}this['variables'][_0x46ff64][_0x4b6ff7]=_0x25f457;}};VoiceDialReport[_0xd750('0x17')][_0xd750('0x16')]=function(_0x35dc38){try{if(this['isNotNull'](_0x35dc38)){logger[_0xd750('0x19')](_0xd750('0x55'),_0x35dc38[_0xd750('0x1b')],util[_0xd750('0x29')](_0x35dc38,{'showHidden':![],'depth':null}));if(this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]]){logger[_0xd750('0x23')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x35dc38[_0xd750('0x1b')],_0x35dc38[_0xd750('0x56')]);this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x57')]=moment()['format'](_0xd750('0x1d'));this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x58')]=moment(this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x57')])[_0xd750('0x59')](this['channels'][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x5a')],_0xd750('0x5b'));this[_0xd750('0xa')][_0x35dc38['uniqueid']][_0xd750('0x33')]=_0xd750('0x5c');this['outbound'][_0xd750('0x5d')]+=0x1;if(this['channels'][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x32')]){this[_0xd750('0xc')]['answered']+=0x1;this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x5e')]=moment(this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x32')])[_0xd750('0x59')](this[_0xd750('0xa')][_0x35dc38['uniqueid']][_0xd750('0x5a')],_0xd750('0x5b'));this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x5f')]=moment(this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]]['endtime'])[_0xd750('0x59')](this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x32')],_0xd750('0x5b'));this[_0xd750('0xc')]['sumHoldTime']+=this[_0xd750('0xa')][_0x35dc38['uniqueid']][_0xd750('0x5e')]||0x0;this['outbound'][_0xd750('0x60')]+=this['channels'][_0x35dc38['uniqueid']][_0xd750('0x5f')];}this[_0xd750('0xc')][_0xd750('0x61')]+=this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]][_0xd750('0x58')];logger['debug'](_0xd750('0x62'),_0x35dc38[_0xd750('0x1b')],util[_0xd750('0x29')](this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xd750('0x18')]('custom:voiceDialReport',this['channels'][_0x35dc38[_0xd750('0x1b')]]);logger[_0xd750('0x19')](_0xd750('0x63'),_0x35dc38[_0xd750('0x1b')],util[_0xd750('0x29')](this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xd750('0x18')](_0xd750('0x64'),this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]]);logger[_0xd750('0x19')](_0xd750('0x65'),_0x35dc38[_0xd750('0x1b')],util[_0xd750('0x29')](this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0xd750('0x38'),_0xd750('0x66'),this[_0xd750('0xc')]);logger['info'](_0xd750('0x67'),JSON[_0xd750('0x68')](this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]]));logger[_0xd750('0x19')](_0xd750('0x69'),_0x35dc38['uniqueid'],util[_0xd750('0x29')](this['channels'][_0x35dc38[_0xd750('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0xd750('0x38'),_0xd750('0x6a'),this['channels'][_0x35dc38[_0xd750('0x1b')]]);delete this[_0xd750('0xa')][_0x35dc38[_0xd750('0x1b')]];}else if(this[_0xd750('0xa')][_0x35dc38[_0xd750('0x6b')]]){this[_0xd750('0xa')][_0x35dc38['linkedid']][_0xd750('0x1b')]=this[_0xd750('0xa')][_0x35dc38[_0xd750('0x6b')]]['destuniqueid'];}if(this[_0xd750('0x54')][_0x35dc38['uniqueid']]){delete this['variables'][_0x35dc38[_0xd750('0x1b')]];}}}catch(_0x4945d8){logger[_0xd750('0x2b')](_0xd750('0x6c'),_0x35dc38['uniqueid'],util[_0xd750('0x29')](_0x4945d8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd750('0x17')][_0xd750('0x6d')]=function(_0x37d22d){try{if(this[_0xd750('0x2c')](_0x37d22d)){logger['debug'](_0xd750('0x6e'),_0x37d22d[_0xd750('0x1b')],util[_0xd750('0x29')](_0x37d22d,{'showHidden':![],'depth':null}));if(_0x37d22d[_0xd750('0x6f')][_0xd750('0x70')]()==='set'){_0x37d22d['applicationdata']=(_0x37d22d[_0xd750('0x71')]||_0x37d22d['applicationdata'])['toLowerCase']();if(_[_0xd750('0x72')](_0x37d22d[_0xd750('0x73')],_0xd750('0x74'))){if(_['isUndefined'](this['applications'][_0x37d22d['uniqueid']]))this['applications'][_0x37d22d[_0xd750('0x1b')]]={};logger[_0xd750('0x23')](_0xd750('0x75'),_0x37d22d[_0xd750('0x1b')],_0x37d22d['application'],_0x37d22d[_0xd750('0x73')]);var _0x380bce=_0x37d22d[_0xd750('0x73')][_0xd750('0x76')]('=');var _0x4acb30=_0x380bce[0x0][_0xd750('0x77')](/cdr\((.*)\)/);if(_0x4acb30)this['applications'][_0x37d22d['uniqueid']][_0x4acb30[0x1]]=_0x380bce[0x1];}}}}catch(_0x3be9e1){logger[_0xd750('0x2b')](_0xd750('0x78'),_0x37d22d[_0xd750('0x1b')],util[_0xd750('0x29')](_0x3be9e1,{'showHidden':![],'depth':null}));}};module[_0xd750('0x79')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 50e63fa..b9245af 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8c=['[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','match','[%s][voiceQueueReport][newexten]','exports','util','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','switch','enqueue','isNil','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','variables','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','uniqueid','format','voice_queue_channel:save','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','total','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','merge','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','add','seconds','YYYY-MM-DD\x20HH:mm:ss','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','membername','includes','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer'];(function(_0x1282ab,_0x2cfddf){var _0x56cd0c=function(_0x23cc56){while(--_0x23cc56){_0x1282ab['push'](_0x1282ab['shift']());}};_0x56cd0c(++_0x2cfddf);}(_0x3f8c,0x104));var _0xc3f8=function(_0x3346be,_0x50de19){_0x3346be=_0x3346be-0x0;var _0x2437ce=_0x3f8c[_0x3346be];return _0x2437ce;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xc3f8('0x0'));var md5=require(_0xc3f8('0x1'));var Redis=require(_0xc3f8('0x2'));var config=require(_0xc3f8('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require('../model/queueReport');config['redis']=_[_0xc3f8('0x4')](config[_0xc3f8('0x5')],{'host':_0xc3f8('0x6'),'port':0x18eb});var io=require(_0xc3f8('0x7'))(new Redis(config[_0xc3f8('0x5')]));var Sequence=function(){};Sequence[_0xc3f8('0x8')]['enqueue']=function(_0x28397e){this[_0xc3f8('0x9')]=this[_0xc3f8('0x9')]?this[_0xc3f8('0x9')][_0xc3f8('0xa')](_0x28397e):_0x28397e();};function VoiceQueueReport(_0x67f688){this[_0xc3f8('0xb')]=new Sequence();this['queueReports']={};this[_0xc3f8('0xc')]=_0x67f688[_0xc3f8('0xc')];this[_0xc3f8('0xd')]=_0x67f688[_0xc3f8('0xe')];this['voiceQueues']=_0x67f688[_0xc3f8('0xf')];this[_0xc3f8('0x10')]=!![];this[_0xc3f8('0x11')]=_0x67f688[_0xc3f8('0x11')];this['variables']={};ami['on'](_0xc3f8('0x12'),this[_0xc3f8('0x13')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x15'),this[_0xc3f8('0x16')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x17'),this[_0xc3f8('0x18')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x19'),this[_0xc3f8('0x1a')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x1b'),this['syncQueueCallerLeave'][_0xc3f8('0x14')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x1c'),this[_0xc3f8('0x1d')][_0xc3f8('0x14')](this));ami['on']('varset',this[_0xc3f8('0x1e')][_0xc3f8('0x14')](this));ami['on']('hangup',this[_0xc3f8('0x1f')]['bind'](this));ami['on'](_0xc3f8('0x20'),this[_0xc3f8('0x21')][_0xc3f8('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x22'),this[_0xc3f8('0x23')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x24'),this[_0xc3f8('0x25')][_0xc3f8('0x14')](this));ami['on'](_0xc3f8('0x26'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xc3f8('0x27')]['bind'](this));this[_0xc3f8('0x28')]();this[_0xc3f8('0x29')]();}function clearChannels(_0x5c13fc){if(!_[_0xc3f8('0x2a')](_0x5c13fc)){for(var _0x327b2d in _0x5c13fc){if(_0x5c13fc[_0xc3f8('0x2b')](_0x327b2d)){delete _0x5c13fc[_0x327b2d];}}}}function clearCampaigns(_0xb883b5){if(!_[_0xc3f8('0x2a')](_0xb883b5)){for(var _0x9d43b4 in _0xb883b5){if(_0xb883b5[_0xc3f8('0x2b')](_0x9d43b4)){_0xb883b5[_0x9d43b4][_0xc3f8('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x21b002){if(!_[_0xc3f8('0x2a')](_0x21b002)){for(var _0x22c8e6 in _0x21b002){if(_0x21b002[_0xc3f8('0x2b')](_0x22c8e6)){_0x21b002[_0x22c8e6][_0xc3f8('0x2c')]=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2d')]=0x0;_0x21b002[_0x22c8e6]['pTalking']=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2e')]=0x0;_0x21b002[_0x22c8e6][_0xc3f8('0x2f')]=!![];}}}}function clearAgentBooked(_0x218029){if(!_['isEmpty'](_0x218029)){for(var _0x151bba in _0x218029){if(_0x218029['hasOwnProperty'](_0x151bba)){_0x218029[_0x151bba][_0xc3f8('0x30')]=!![];}}}}VoiceQueueReport[_0xc3f8('0x8')]['clearZombieChannels']=function(){var _0x48b32e=this;for(var _0x21a225 in this[_0xc3f8('0xd')]){if(this[_0xc3f8('0xd')][_0xc3f8('0x2b')](_0x21a225)&&!this[_0xc3f8('0xd')][_0x21a225][_0xc3f8('0x31')]){this[_0xc3f8('0xb')][_0xc3f8('0x32')](function(){if(!_[_0xc3f8('0x33')](_0x48b32e[_0xc3f8('0xd')][_0x21a225])){return ami['Action']({'action':_0xc3f8('0x34'),'channel':_0x48b32e[_0xc3f8('0xd')][_0x21a225][_0xc3f8('0x35')]})[_0xc3f8('0x36')](function(_0x31e86){if(_0x31e86['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x48b32e[_0xc3f8('0xd')][_0x21a225]){delete _0x48b32e[_0xc3f8('0xd')][_0x21a225];logger[_0xc3f8('0x37')](_0xc3f8('0x38'),_0x21a225,util[_0xc3f8('0x39')](_0x31e86,{'showHidden':![],'depth':null}));}if(_0x48b32e['queueReports'][_0x21a225]){delete _0x48b32e[_0xc3f8('0x3a')][_0x21a225];logger[_0xc3f8('0x37')](_0xc3f8('0x3b'),_0x21a225,util['inspect'](_0x31e86,{'showHidden':![],'depth':null}));}if(_0x48b32e[_0xc3f8('0x3c')][_0x21a225]){delete _0x48b32e[_0xc3f8('0x3c')][_0x21a225];logger[_0xc3f8('0x37')]('[%s][voiceQueueReport][checkVariables]',_0x21a225,util[_0xc3f8('0x39')](_0x31e86,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xc3f8('0x8')]['syncFullyBooted']=function(){logger[_0xc3f8('0x37')](_0xc3f8('0x3d'));clearChannels(this[_0xc3f8('0xd')]);this[_0xc3f8('0x3e')](this[_0xc3f8('0x3a')]);clearAgentBooked(this[_0xc3f8('0xc')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xc3f8('0x11')]);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x3e')]=function(_0x2f589d){var _0x17aff0=this;if(!_['isEmpty'](_0x2f589d)){for(var _0x3dede2 in _0x2f589d){if(_0x2f589d[_0xc3f8('0x2b')](_0x3dede2)){_0x17aff0[_0xc3f8('0x3f')](_0x2f589d[_0x3dede2],'clearqueuereport');delete _0x2f589d[_0x3dede2];}}}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x40')]=function(_0x1e48aa,_0x2d4167,_0x57e51d){io['to'](_0x1e48aa)[_0xc3f8('0x40')](_0x2d4167,_0x57e51d);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x41')]=function(_0x37b104,_0x55ae1f){logger[_0xc3f8('0x42')]('[%s][voiceQueueReport]['+_0x55ae1f+']\x20sending\x20voice_queue_channel:save\x20event:',_0x37b104[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x37b104,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')]('voice:queue:%s',_0x37b104['name']),_0xc3f8('0x45'),_0x37b104);io[_0xc3f8('0x40')](_0xc3f8('0x46'),_0x37b104);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x3f')]=function(_0x465547,_0x3113b4){logger[_0xc3f8('0x42')](_0xc3f8('0x47')+_0x3113b4+_0xc3f8('0x48'),_0x465547[_0xc3f8('0x43')],util['inspect'](_0x465547,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')]('voice:queue:%s',_0x465547[_0xc3f8('0x49')]),_0xc3f8('0x4a'),_0x465547);io['emit'](_0xc3f8('0x4b'),_0x465547);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x4c')]=function(_0x198ef2,_0x2521c2){if(_0x198ef2[_0xc3f8('0x4d')]===_0xc3f8('0x4e')){var _0x3bf513={'id':_0x198ef2['id'],'name':_0x198ef2[_0xc3f8('0x49')],'strategy':_0x198ef2[_0xc3f8('0x4f')],'answered':_0x198ef2[_0xc3f8('0x50')],'available':_0x198ef2['available'],'loggedIn':_0x198ef2[_0xc3f8('0x51')],'pTalking':_0x198ef2[_0xc3f8('0x52')],'sumBillable':_0x198ef2['sumBillable'],'sumDuration':_0x198ef2[_0xc3f8('0x53')],'sumHoldTime':_0x198ef2[_0xc3f8('0x54')]||0x0,'talking':_0x198ef2[_0xc3f8('0x2d')],'total':_0x198ef2[_0xc3f8('0x55')],'type':_0x198ef2['type'],'unmanaged':_0x198ef2['unmanaged'],'abandoned':_0x198ef2[_0xc3f8('0x56')],'waiting':_0x198ef2[_0xc3f8('0x2e')]};if(_0x198ef2[_0xc3f8('0x57')]){_0x3bf513['Trunk']={'id':_0x198ef2[_0xc3f8('0x57')]['id'],'name':_0x198ef2[_0xc3f8('0x57')][_0xc3f8('0x49')],'active':_0x198ef2[_0xc3f8('0x57')][_0xc3f8('0x58')],'callerid':_0x198ef2['Trunk'][_0xc3f8('0x59')]};}if(_0x198ef2[_0xc3f8('0x5a')]){_0x3bf513['Interval']={'id':_0x198ef2[_0xc3f8('0x5a')]['id'],'name':_0x198ef2[_0xc3f8('0x5a')][_0xc3f8('0x49')]};}var _0x2916c8=md5(JSON[_0xc3f8('0x5b')](_0x3bf513));if(_0x198ef2[_0xc3f8('0x1')]!==_0x2916c8){_0x198ef2[_0xc3f8('0x1')]=_0x2916c8;logger['debug'](_0xc3f8('0x5c')+_0x2521c2+_0xc3f8('0x5d'),util['inspect'](_0x3bf513,{'showHidden':![],'depth':null}));this[_0xc3f8('0x40')](util[_0xc3f8('0x44')](_0xc3f8('0x5e'),_0x3bf513[_0xc3f8('0x49')]),_0xc3f8('0x5f'),_0x3bf513);}}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x60')]=function(_0x4d58b2){return _0x4d58b2!==null&&!_[_0xc3f8('0x61')](_0x4d58b2);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x29')]=function(){var _0x267c95=this;setInterval(function(){_0x267c95[_0xc3f8('0x62')]();ami[_0xc3f8('0x63')]({'action':_0xc3f8('0x64')})[_0xc3f8('0x36')](function(_0x4fc02c){logger['error'](_0xc3f8('0x65'),util[_0xc3f8('0x39')](_0x4fc02c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x773d56=this;setInterval(function(){if(_0x773d56['flagQueueSummary']){return ami[_0xc3f8('0x63')]({'action':_0xc3f8('0x12')})[_0xc3f8('0x66')](function(_0x5292a0){_0x773d56[_0xc3f8('0x10')]=![];})['catch'](function(_0x4d8436){logger[_0xc3f8('0x37')]('[voiceQueueReport][queuesummary]',util[_0xc3f8('0x39')](_0x4d8436,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x13')]=function(_0x490f37){try{if(this[_0xc3f8('0x60')](_0x490f37)&&this[_0xc3f8('0x60')](_0x490f37[_0xc3f8('0x67')])){logger[_0xc3f8('0x42')](_0xc3f8('0x68'),util['inspect'](_0x490f37,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x490f37[_0xc3f8('0x67')]]){logger[_0xc3f8('0x69')](_0xc3f8('0x6a'),_0x490f37[_0xc3f8('0x67')]);var _0x1c7f08=_['countBy'](this[_0xc3f8('0xd')],'queue')[_0x490f37[_0xc3f8('0x67')]]||0x0;var _0x337029=_0x1c7f08-_0x490f37[_0xc3f8('0x6b')];if(this[_0xc3f8('0xf')][_0x490f37['queue']][_0xc3f8('0x2e')]!==_['toNumber'](_0x490f37['callers'])||this['voiceQueues'][_0x490f37['queue']][_0xc3f8('0x51')]!==_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6d')])||this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x6e')]!==_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6e')])||this['voiceQueues'][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2d')]!==_0x337029){this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2e')]=_['toNumber'](_0x490f37[_0xc3f8('0x6b')]);this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x51')]=_[_0xc3f8('0x6c')](_0x490f37['loggedin']);this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x6e')]=_[_0xc3f8('0x6c')](_0x490f37[_0xc3f8('0x6e')]);this[_0xc3f8('0xf')][_0x490f37['queue']][_0xc3f8('0x2d')]=_0x337029>0x0?_0x337029:0x0;this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]]['talking']=this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]]['talking']>_['toNumber'](_0x490f37[_0xc3f8('0x6d')])?_[_0xc3f8('0x6c')](_0x490f37['loggedin']):this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]][_0xc3f8('0x2d')];this[_0xc3f8('0x4c')](this[_0xc3f8('0xf')][_0x490f37[_0xc3f8('0x67')]],_0xc3f8('0x12'));}logger[_0xc3f8('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xc3f8('0xf')][_0x490f37['queue']],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x490f37['queue']]);}}}catch(_0x2ba4ad){logger[_0xc3f8('0x37')](_0xc3f8('0x6f'),util[_0xc3f8('0x39')](_0x2ba4ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0x16')]=function(_0x2d0b58){logger['debug'](_0xc3f8('0x70'),util[_0xc3f8('0x39')](_0x2d0b58,{'showHidden':![],'depth':null}));this[_0xc3f8('0x10')]=!![];};VoiceQueueReport['prototype'][_0xc3f8('0x18')]=function(_0x5e3125){try{if(this['isNotNull'](_0x5e3125)){logger['debug'](_0xc3f8('0x71'),_0x5e3125[_0xc3f8('0x43')],util['inspect'](_0x5e3125,{'showHidden':![],'depth':null}));if(_[_0xc3f8('0x61')](this[_0xc3f8('0x3a')][_0x5e3125['uniqueid']]))this[_0xc3f8('0x3a')][_0x5e3125[_0xc3f8('0x43')]]=[];if(_['isUndefined'](this[_0xc3f8('0xd')][_0x5e3125['uniqueid']]))this[_0xc3f8('0xd')][_0x5e3125[_0xc3f8('0x43')]]={};var _0x4cc654=new QueueReport();_0x4cc654['name']=_0x5e3125[_0xc3f8('0x67')];_0x4cc654[_0xc3f8('0x4d')]=this['voiceQueues'][_0x4cc654[_0xc3f8('0x49')]]&&this['voiceQueues'][_0x4cc654[_0xc3f8('0x49')]]['type']?this[_0xc3f8('0xf')][_0x4cc654[_0xc3f8('0x49')]][_0xc3f8('0x4d')]||_0xc3f8('0x4e'):_0xc3f8('0x4e');_0x4cc654[_0xc3f8('0x67')]=_0x5e3125[_0xc3f8('0x67')];_0x4cc654[_0xc3f8('0x72')]=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cc654[_0xc3f8('0x73')]=_0x5e3125[_0xc3f8('0x73')];_0x4cc654[_0xc3f8('0x74')]=_0x5e3125[_0xc3f8('0x74')];_0x4cc654[_0xc3f8('0x43')]=_0x5e3125['uniqueid'];_0x4cc654[_0xc3f8('0x75')]=this[_0xc3f8('0xd')][_0x5e3125[_0xc3f8('0x43')]][_0xc3f8('0x75')];logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4cc654[_0xc3f8('0x49')],_0x4cc654[_0xc3f8('0x4d')]);_[_0xc3f8('0x76')](_0x4cc654,_['pick'](_0x5e3125,_['keys'](_0x4cc654)));this[_0xc3f8('0x3a')][_0x5e3125[_0xc3f8('0x43')]][_0xc3f8('0x77')](_0x4cc654);this[_0xc3f8('0xd')][_0x5e3125['uniqueid']]=_0x4cc654;this[_0xc3f8('0x41')](_0x4cc654,_0xc3f8('0x17'));}}catch(_0x33b52c){logger['error'](_0xc3f8('0x71'),_0x5e3125[_0xc3f8('0x43')],util['inspect'](_0x33b52c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0x1a')]=function(_0xc4cd8c){try{if(this['isNotNull'](_0xc4cd8c)){logger[_0xc3f8('0x42')](_0xc3f8('0x78'),_0xc4cd8c['uniqueid'],util[_0xc3f8('0x39')](_0xc4cd8c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc4cd8c[_0xc3f8('0x43')]]){var _0x4d0d48=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0xc4cd8c[_0xc3f8('0x43')]]);_0x4d0d48[_0xc3f8('0x7a')]=![];_0x4d0d48[_0xc3f8('0x7b')]=null;_0x4d0d48[_0xc3f8('0x7c')]=_0xc4cd8c[_0xc3f8('0x7c')];_0x4d0d48[_0xc3f8('0x7d')]=_0xc4cd8c[_0xc3f8('0x7d')];_0x4d0d48['queuecallerabandon']=!![];_0x4d0d48['queuecallerabandonAt']=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d0d48[_0xc3f8('0x7e')]=_0xc3f8('0x7f');_0x4d0d48[_0xc3f8('0x80')]=null;logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4d0d48[_0xc3f8('0x49')],_0x4d0d48[_0xc3f8('0x4d')]);this[_0xc3f8('0xd')][_0xc4cd8c[_0xc3f8('0x43')]]=_0x4d0d48;this[_0xc3f8('0x3f')](_0x4d0d48,_0xc3f8('0x19'));}}}catch(_0x457c39){logger[_0xc3f8('0x37')](_0xc3f8('0x78'),_0xc4cd8c['uniqueid'],util['inspect'](_0x457c39,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x81')]=function(_0x1f2314){try{if(this['isNotNull'](_0x1f2314)){logger[_0xc3f8('0x42')]('[%s][voiceQueueReport][queuecallerleave]',_0x1f2314[_0xc3f8('0x43')],util['inspect'](_0x1f2314,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x1f2314[_0xc3f8('0x43')]]){var _0x2ac0a8=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1f2314[_0xc3f8('0x43')]]);_0x2ac0a8[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ac0a8[_0xc3f8('0x83')]=_0x1f2314[_0xc3f8('0x83')];_0x2ac0a8[_0xc3f8('0x84')]=_0x1f2314[_0xc3f8('0x84')];logger[_0xc3f8('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2ac0a8[_0xc3f8('0x49')],_0x2ac0a8[_0xc3f8('0x4d')],_0x1f2314[_0xc3f8('0x83')],_0x1f2314[_0xc3f8('0x84')]);this['channels'][_0x1f2314['uniqueid']]=_0x2ac0a8;this[_0xc3f8('0x41')](_0x2ac0a8,_0xc3f8('0x1b'));}}}catch(_0x49fdc5){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x1f2314[_0xc3f8('0x43')],util['inspect'](_0x49fdc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1d')]=function(_0x19e469){try{if(this[_0xc3f8('0x60')](_0x19e469)){logger[_0xc3f8('0x42')](_0xc3f8('0x85'),_0x19e469[_0xc3f8('0x43')],util['inspect'](_0x19e469,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x19e469['uniqueid']]){var _0x4ea284=_[_0xc3f8('0x79')](this['queueReports'][_0x19e469[_0xc3f8('0x43')]]);_0x4ea284[_0xc3f8('0x7a')]=!![];_0x4ea284[_0xc3f8('0x7e')]='COMPLETEDBYAGENT';logger[_0xc3f8('0x69')](_0xc3f8('0x86'),_0x4ea284['name'],_0x4ea284[_0xc3f8('0x4d')]);}}}catch(_0x1b746d){logger[_0xc3f8('0x37')]('[%s][voiceQueueReport][agentconnect]',_0x19e469[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1b746d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')]['syncAgentComplete']=function(_0x1704e5){try{if(this[_0xc3f8('0x60')](_0x1704e5)){logger[_0xc3f8('0x42')](_0xc3f8('0x87'),_0x1704e5[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1704e5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1704e5[_0xc3f8('0x43')]]){var _0x4fd13c=_['last'](this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x43')]]);_0x4fd13c['queuecallerabandon']=![];_0x4fd13c[_0xc3f8('0x88')]=null;_0x4fd13c[_0xc3f8('0x89')]=!![];_0x4fd13c[_0xc3f8('0x80')]=_0x1704e5['membername'];_0x4fd13c['holdtime']=_0x1704e5[_0xc3f8('0x7c')];_0x4fd13c['queuecallercomplete']=!![];_0x4fd13c[_0xc3f8('0x8a')]=![];_0x4fd13c[_0xc3f8('0x8b')]=null;if(!_0x4fd13c[_0xc3f8('0x8c')]){if(_0x1704e5['reason']==_0xc3f8('0x8c')){_0x4fd13c[_0xc3f8('0x7e')]=_0xc3f8('0x8d');logger[_0xc3f8('0x69')](_0xc3f8('0x8e'),_0x4fd13c[_0xc3f8('0x49')],_0x4fd13c['type']);}else{if(_[_0xc3f8('0x8f')](_0x1704e5[_0xc3f8('0x35')][_0xc3f8('0x90')](),_0xc3f8('0x91'))){if(this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]){var _0x1fe97d=_[_0xc3f8('0x79')](this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]);_0x1fe97d[_0xc3f8('0x7a')]=![];_0x1fe97d[_0xc3f8('0x8a')]=!![];_0x1fe97d[_0xc3f8('0x8b')]=moment(_0x4fd13c[_0xc3f8('0x72')])[_0xc3f8('0x92')](_0x1704e5['holdtime'],_0xc3f8('0x93'))[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1fe97d[_0xc3f8('0x7e')]=_0xc3f8('0x95');_0x1fe97d[_0xc3f8('0x8c')]=!![];_0x1fe97d[_0xc3f8('0x96')]=_0xc3f8('0x97');_0x1fe97d[_0xc3f8('0x98')]=_0x1704e5[_0xc3f8('0x99')];_0x1fe97d[_0xc3f8('0x9a')]=_0x1704e5['uniqueid'];logger['info'](_0xc3f8('0x9b'),_0x1fe97d['name'],_0x1fe97d['type']);var _0x29a544=this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x9c')]];this[_0xc3f8('0x3a')][_0x1704e5['linkedid']]=this[_0xc3f8('0x3a')][_0x1704e5[_0xc3f8('0x43')]];this['queueReports'][_0x1704e5[_0xc3f8('0x43')]]=_0x29a544;}}else{_0x4fd13c[_0xc3f8('0x7e')]='COMPLETEDBY'+_0x1704e5['reason']['toUpperCase']();logger[_0xc3f8('0x69')](_0xc3f8('0x9d'),_0x4fd13c[_0xc3f8('0x49')],_0x4fd13c[_0xc3f8('0x4d')],_0x4fd13c[_0xc3f8('0x7e')]);}}}this[_0xc3f8('0xd')][_0x1704e5[_0xc3f8('0x43')]]=_0x4fd13c;this[_0xc3f8('0x3f')](_0x4fd13c,_0xc3f8('0x9e'));}}}catch(_0x4c55ae){logger['error'](_0xc3f8('0x87'),_0x1704e5[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x4c55ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1e')]=function(_0x21fe09){try{if(this[_0xc3f8('0x60')](_0x21fe09)){logger[_0xc3f8('0x42')](_0xc3f8('0x9f'),_0x21fe09['uniqueid'],util[_0xc3f8('0x39')](_0x21fe09,{'showHidden':![],'depth':null}));this['addVariable'](_0x21fe09['uniqueid'],_[_0xc3f8('0xa0')](_0x21fe09[_0xc3f8('0xa1')])[0x0],_0x21fe09[_0xc3f8('0xa2')]);if(this[_0xc3f8('0x3a')][_0x21fe09[_0xc3f8('0x43')]]){var _0x1be9fe=_['last'](this[_0xc3f8('0x3a')][_0x21fe09[_0xc3f8('0x43')]]);if(_0x1be9fe){if(this[_0xc3f8('0x60')](_0x21fe09['variable'])&&this['isNotNull'](_0x21fe09[_0xc3f8('0xa1')][_0xc3f8('0xa3')])){switch(_0x21fe09['value']){case _0xc3f8('0xa4'):_0x1be9fe[_0xc3f8('0x8a')]=![];_0x1be9fe['queuecallerexitAt']=null;break;case _0xc3f8('0xa5'):_0x1be9fe[_0xc3f8('0xa6')]=_0xc3f8('0xa7');_0x1be9fe[_0xc3f8('0x8a')]=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()['format'](_0xc3f8('0x94'));_0x1be9fe['queuecallerleaveAt']=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));logger['debug'](_0xc3f8('0xa8'),_0x21fe09[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x1be9fe,{'showHidden':![],'depth':null}));ami[_0xc3f8('0x40')](_0xc3f8('0xa9'),_0x1be9fe);break;default:_0x1be9fe[_0xc3f8('0x8a')]=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1be9fe[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));}_0x1be9fe[_0xc3f8('0x19')]=![];_0x1be9fe[_0xc3f8('0x88')]=null;_0x1be9fe[_0xc3f8('0x7e')]=_0x21fe09[_0xc3f8('0xa2')];this[_0xc3f8('0xd')][_0x21fe09[_0xc3f8('0x43')]]=_0x1be9fe;this[_0xc3f8('0x3f')](_0x1be9fe,'varset');}else if(this[_0xc3f8('0x60')](_0x21fe09[_0xc3f8('0xa1')])&&this['isNotNull'](_0x21fe09[_0xc3f8('0xa1')]['queueposition'])){if(!_0x1be9fe[_0xc3f8('0x19')]){_0x1be9fe['queuecallerexit']=!![];_0x1be9fe[_0xc3f8('0x8b')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));_0x1be9fe['queuecallerexitreason']=_0xc3f8('0xaa');_0x1be9fe[_0xc3f8('0x82')]=moment()[_0xc3f8('0x44')](_0xc3f8('0x94'));this[_0xc3f8('0xd')][_0x21fe09[_0xc3f8('0x43')]]=_0x1be9fe;}}logger[_0xc3f8('0x69')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x21fe09[_0xc3f8('0x43')],_0x1be9fe[_0xc3f8('0x49')],_0x1be9fe[_0xc3f8('0x4d')],_[_0xc3f8('0xa0')](_0x21fe09[_0xc3f8('0xa1')])[0x0],_0x21fe09[_0xc3f8('0xa2')]);_0x1be9fe[_0xc3f8('0x3c')]=this[_0xc3f8('0x3c')][_0x21fe09[_0xc3f8('0x43')]];}}}}catch(_0x2e649c){logger[_0xc3f8('0x37')](_0xc3f8('0x9f'),_0x21fe09[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x2e649c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc3f8('0xab')]=function(_0x5c7c23,_0x3648b5,_0x47a3ab){var _0x59bc35=[_0xc3f8('0xac'),_0xc3f8('0xad'),_0xc3f8('0xae'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xc3f8('0xaf'),_0xc3f8('0xb0'),_0xc3f8('0xb1'),_0xc3f8('0xb2'),_0xc3f8('0xb3'),'bridgepeer',_0xc3f8('0xb4'),_0xc3f8('0xb5'),_0xc3f8('0xb6'),'memberinterface','memberlastcall',_0xc3f8('0xb7'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x3648b5)&&!_[_0xc3f8('0xb8')](_0x59bc35,_0x3648b5)){if(_[_0xc3f8('0x61')](this[_0xc3f8('0x3c')][_0x5c7c23])){this[_0xc3f8('0x3c')][_0x5c7c23]={};}this['variables'][_0x5c7c23][_0x3648b5]=_0x47a3ab;}};VoiceQueueReport[_0xc3f8('0x8')][_0xc3f8('0x1f')]=function(_0x277146){try{if(this['isNotNull'](_0x277146)){logger[_0xc3f8('0x42')](_0xc3f8('0xb9'),_0x277146[_0xc3f8('0x43')],util[_0xc3f8('0x39')](_0x277146,{'showHidden':![],'depth':null}));if(this[_0xc3f8('0x3a')][_0x277146['uniqueid']]){for(var _0x210283=0x0,_0x2fc7e2={};_0x2102830x0?_0x44b23e:0x0;this[_0x2bde('0x12')][_0x117b38['queue']][_0x2bde('0x33')]=this[_0x2bde('0x12')][_0x117b38[_0x2bde('0x64')]]['talking']>_[_0x2bde('0x6a')](_0x117b38['loggedin'])?_[_0x2bde('0x6a')](_0x117b38[_0x2bde('0x6b')]):this[_0x2bde('0x12')][_0x117b38[_0x2bde('0x64')]][_0x2bde('0x33')];this['emitVoiceQueueSummary'](this[_0x2bde('0x12')][_0x117b38[_0x2bde('0x64')]],_0x2bde('0x15'));}logger[_0x2bde('0x46')](_0x2bde('0x6c'),util[_0x2bde('0x40')](this[_0x2bde('0x12')][_0x117b38[_0x2bde('0x64')]],{'showHidden':![],'depth':null}));ami[_0x2bde('0x44')](_0x2bde('0x6d'),this['voiceQueues'][_0x117b38['queue']]);}}}catch(_0x44f48e){logger['error'](_0x2bde('0x6e'),util[_0x2bde('0x40')](_0x44f48e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x19')]=function(_0x4afdda){logger[_0x2bde('0x46')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x4afdda,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x1b')]=function(_0xd24d97){try{if(this['isNotNull'](_0xd24d97)){logger[_0x2bde('0x46')](_0x2bde('0x6f'),_0xd24d97['uniqueid'],util[_0x2bde('0x40')](_0xd24d97,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2bde('0xe')][_0xd24d97['uniqueid']]))this[_0x2bde('0xe')][_0xd24d97[_0x2bde('0x49')]]=[];if(_[_0x2bde('0x5e')](this[_0x2bde('0x10')][_0xd24d97['uniqueid']]))this[_0x2bde('0x10')][_0xd24d97['uniqueid']]={};var _0x2c68d3=new QueueReport();_0x2c68d3[_0x2bde('0x4c')]=_0xd24d97['queue'];_0x2c68d3['type']=this[_0x2bde('0x12')][_0x2c68d3['name']]&&this[_0x2bde('0x12')][_0x2c68d3['name']][_0x2bde('0x4f')]?this[_0x2bde('0x12')][_0x2c68d3[_0x2bde('0x4c')]]['type']||_0x2bde('0x50'):_0x2bde('0x50');_0x2c68d3[_0x2bde('0x64')]=_0xd24d97[_0x2bde('0x64')];_0x2c68d3[_0x2bde('0x70')]=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));_0x2c68d3[_0x2bde('0x72')]=_0xd24d97[_0x2bde('0x72')];_0x2c68d3[_0x2bde('0x73')]=_0xd24d97[_0x2bde('0x73')];_0x2c68d3['uniqueid']=_0xd24d97[_0x2bde('0x49')];_0x2c68d3['routealias']=this[_0x2bde('0x10')][_0xd24d97[_0x2bde('0x49')]]['routealias'];logger[_0x2bde('0x66')](_0x2bde('0x74'),_0x2c68d3['name'],_0x2c68d3[_0x2bde('0x4f')]);_[_0x2bde('0x75')](_0x2c68d3,_[_0x2bde('0x76')](_0xd24d97,_[_0x2bde('0x77')](_0x2c68d3)));this[_0x2bde('0xe')][_0xd24d97[_0x2bde('0x49')]][_0x2bde('0x78')](_0x2c68d3);this[_0x2bde('0x10')][_0xd24d97[_0x2bde('0x49')]]=_0x2c68d3;this['emitVoiceQueueChannelSave'](_0x2c68d3,_0x2bde('0x1a'));}}catch(_0x2dcf78){logger[_0x2bde('0x3d')](_0x2bde('0x6f'),_0xd24d97[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x2dcf78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x1d')]=function(_0x1efa95){try{if(this['isNotNull'](_0x1efa95)){logger['debug'](_0x2bde('0x79'),_0x1efa95[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x1efa95,{'showHidden':![],'depth':null}));if(this[_0x2bde('0xe')][_0x1efa95['uniqueid']]){var _0x1c1c35=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x1efa95[_0x2bde('0x49')]]);_0x1c1c35['queuecallercomplete']=![];_0x1c1c35[_0x2bde('0x7b')]=null;_0x1c1c35[_0x2bde('0x7c')]=_0x1efa95[_0x2bde('0x7c')];_0x1c1c35['originalposition']=_0x1efa95[_0x2bde('0x7d')];_0x1c1c35[_0x2bde('0x1c')]=!![];_0x1c1c35[_0x2bde('0x7e')]=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));_0x1c1c35[_0x2bde('0x7f')]='ABANDONED';_0x1c1c35[_0x2bde('0x80')]=null;logger['info'](_0x2bde('0x81'),_0x1c1c35[_0x2bde('0x4c')],_0x1c1c35[_0x2bde('0x4f')]);this[_0x2bde('0x10')][_0x1efa95['uniqueid']]=_0x1c1c35;this[_0x2bde('0x82')](_0x1c1c35,'queuecallerabandon');}}}catch(_0x591541){logger[_0x2bde('0x3d')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1efa95[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x591541,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x1f')]=function(_0x495835){try{if(this['isNotNull'](_0x495835)){logger[_0x2bde('0x46')](_0x2bde('0x83'),_0x495835['uniqueid'],util[_0x2bde('0x40')](_0x495835,{'showHidden':![],'depth':null}));if(this[_0x2bde('0xe')][_0x495835[_0x2bde('0x49')]]){var _0xab88ca=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x495835[_0x2bde('0x49')]]);_0xab88ca['queuecallerleaveAt']=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));_0xab88ca['connectedlinenum']=_0x495835[_0x2bde('0x84')];_0xab88ca[_0x2bde('0x85')]=_0x495835[_0x2bde('0x85')];logger['info'](_0x2bde('0x86'),_0xab88ca[_0x2bde('0x4c')],_0xab88ca[_0x2bde('0x4f')],_0x495835[_0x2bde('0x84')],_0x495835[_0x2bde('0x85')]);this[_0x2bde('0x10')][_0x495835[_0x2bde('0x49')]]=_0xab88ca;this[_0x2bde('0x45')](_0xab88ca,_0x2bde('0x1e'));}}}catch(_0x42ae31){logger[_0x2bde('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x495835[_0x2bde('0x49')],util['inspect'](_0x42ae31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x22')]=function(_0x2f77b2){try{if(this[_0x2bde('0x5d')](_0x2f77b2)){logger['debug'](_0x2bde('0x87'),_0x2f77b2['uniqueid'],util[_0x2bde('0x40')](_0x2f77b2,{'showHidden':![],'depth':null}));if(this[_0x2bde('0xe')][_0x2f77b2[_0x2bde('0x49')]]){var _0x3a363c=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x2f77b2['uniqueid']]);_0x3a363c['queuecallercomplete']=!![];_0x3a363c[_0x2bde('0x7f')]=_0x2bde('0x88');logger[_0x2bde('0x66')](_0x2bde('0x89'),_0x3a363c[_0x2bde('0x4c')],_0x3a363c[_0x2bde('0x4f')]);}}}catch(_0x21590a){logger[_0x2bde('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x2f77b2[_0x2bde('0x49')],util['inspect'](_0x21590a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x20')]=function(_0x178039){try{if(this['isNotNull'](_0x178039)){logger['debug'](_0x2bde('0x8a'),_0x178039[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x178039,{'showHidden':![],'depth':null}));if(this[_0x2bde('0xe')][_0x178039[_0x2bde('0x49')]]){var _0x5407d5=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x178039['uniqueid']]);_0x5407d5[_0x2bde('0x1c')]=![];_0x5407d5[_0x2bde('0x7e')]=null;_0x5407d5[_0x2bde('0x8b')]=!![];_0x5407d5['lastAssignedTo']=_0x178039[_0x2bde('0x8c')];_0x5407d5[_0x2bde('0x7c')]=_0x178039[_0x2bde('0x7c')];_0x5407d5['queuecallercomplete']=!![];_0x5407d5[_0x2bde('0x8d')]=![];_0x5407d5[_0x2bde('0x8e')]=null;if(!_0x5407d5['transfer']){if(_0x178039[_0x2bde('0x8f')]==_0x2bde('0x90')){_0x5407d5[_0x2bde('0x7f')]='COMPLETED';logger['info'](_0x2bde('0x91'),_0x5407d5[_0x2bde('0x4c')],_0x5407d5[_0x2bde('0x4f')]);}else{if(_['startsWith'](_0x178039[_0x2bde('0x92')]['toLowerCase'](),_0x2bde('0x93'))){if(this[_0x2bde('0xe')][_0x178039[_0x2bde('0x94')]]){var _0x158482=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x178039[_0x2bde('0x94')]]);_0x158482[_0x2bde('0x95')]=![];_0x158482[_0x2bde('0x8d')]=!![];_0x158482[_0x2bde('0x8e')]=moment(_0x5407d5[_0x2bde('0x70')])['add'](_0x178039[_0x2bde('0x7c')],_0x2bde('0x96'))['format'](_0x2bde('0x71'));_0x158482[_0x2bde('0x7f')]=_0x2bde('0x97');_0x158482['transfer']=!![];_0x158482[_0x2bde('0x98')]=_0x2bde('0x99');_0x158482[_0x2bde('0x9a')]=_0x178039[_0x2bde('0x9b')];_0x158482[_0x2bde('0x9c')]=_0x178039[_0x2bde('0x49')];logger[_0x2bde('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x158482[_0x2bde('0x4c')],_0x158482['type']);var _0x326e50=this[_0x2bde('0xe')][_0x178039[_0x2bde('0x94')]];this[_0x2bde('0xe')][_0x178039[_0x2bde('0x94')]]=this[_0x2bde('0xe')][_0x178039[_0x2bde('0x49')]];this[_0x2bde('0xe')][_0x178039[_0x2bde('0x49')]]=_0x326e50;}}else{_0x5407d5['queuecallerexitreason']=_0x2bde('0x9d')+_0x178039['reason']['toUpperCase']();logger[_0x2bde('0x66')](_0x2bde('0x9e'),_0x5407d5[_0x2bde('0x4c')],_0x5407d5[_0x2bde('0x4f')],_0x5407d5[_0x2bde('0x7f')]);}}}this['channels'][_0x178039[_0x2bde('0x49')]]=_0x5407d5;this[_0x2bde('0x82')](_0x5407d5,'agentcomplete');}}}catch(_0x18ff7b){logger['error'](_0x2bde('0x8a'),_0x178039['uniqueid'],util[_0x2bde('0x40')](_0x18ff7b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')]['syncVarSet']=function(_0x3bb359){try{if(this[_0x2bde('0x5d')](_0x3bb359)){logger[_0x2bde('0x46')](_0x2bde('0x9f'),_0x3bb359[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x3bb359,{'showHidden':![],'depth':null}));this['addVariable'](_0x3bb359[_0x2bde('0x49')],_[_0x2bde('0x77')](_0x3bb359[_0x2bde('0xa0')])[0x0],_0x3bb359[_0x2bde('0xa1')]);if(this[_0x2bde('0xe')][_0x3bb359[_0x2bde('0x49')]]){var _0x3bb392=_[_0x2bde('0x7a')](this[_0x2bde('0xe')][_0x3bb359['uniqueid']]);if(_0x3bb392){if(this[_0x2bde('0x5d')](_0x3bb359[_0x2bde('0xa0')])&&this[_0x2bde('0x5d')](_0x3bb359[_0x2bde('0xa0')][_0x2bde('0xa2')])){switch(_0x3bb359[_0x2bde('0xa1')]){case'CONTINUE':_0x3bb392['queuecallerexit']=![];_0x3bb392[_0x2bde('0x8e')]=null;break;case _0x2bde('0xa3'):_0x3bb392[_0x2bde('0xa4')]=_0x2bde('0xa5');_0x3bb392[_0x2bde('0x8d')]=!![];_0x3bb392[_0x2bde('0x8e')]=moment()['format'](_0x2bde('0x71'));_0x3bb392['queuecallerleaveAt']=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));logger[_0x2bde('0x46')](_0x2bde('0xa6'),_0x3bb359['uniqueid'],util[_0x2bde('0x40')](_0x3bb392,{'showHidden':![],'depth':null}));ami[_0x2bde('0x44')](_0x2bde('0xa7'),_0x3bb392);break;default:_0x3bb392[_0x2bde('0x8d')]=!![];_0x3bb392[_0x2bde('0x8e')]=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));_0x3bb392['queuecallerleaveAt']=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));}_0x3bb392[_0x2bde('0x1c')]=![];_0x3bb392[_0x2bde('0x7e')]=null;_0x3bb392[_0x2bde('0x7f')]=_0x3bb359['value'];this[_0x2bde('0x10')][_0x3bb359['uniqueid']]=_0x3bb392;this['emitVoiceQueueChannelRemove'](_0x3bb392,'varset');}else if(this[_0x2bde('0x5d')](_0x3bb359['variable'])&&this[_0x2bde('0x5d')](_0x3bb359[_0x2bde('0xa0')][_0x2bde('0xa8')])){if(!_0x3bb392['queuecallerabandon']){_0x3bb392[_0x2bde('0x8d')]=!![];_0x3bb392['queuecallerexitAt']=moment()[_0x2bde('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bb392['queuecallerexitreason']=_0x2bde('0xa9');_0x3bb392[_0x2bde('0xaa')]=moment()[_0x2bde('0x4b')](_0x2bde('0x71'));this['channels'][_0x3bb359['uniqueid']]=_0x3bb392;}}logger[_0x2bde('0x66')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3bb359[_0x2bde('0x49')],_0x3bb392[_0x2bde('0x4c')],_0x3bb392[_0x2bde('0x4f')],_[_0x2bde('0x77')](_0x3bb359[_0x2bde('0xa0')])[0x0],_0x3bb359['value']);_0x3bb392[_0x2bde('0x41')]=this[_0x2bde('0x41')][_0x3bb359['uniqueid']];}}}}catch(_0x50bd0d){logger['error'](_0x2bde('0x9f'),_0x3bb359[_0x2bde('0x49')],util[_0x2bde('0x40')](_0x50bd0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0xab')]=function(_0x15e4ba,_0x3000c1,_0x2fdc21){var _0x3327f4=['rtpaudioqos',_0x2bde('0xac'),'rtpaudioqosjitter',_0x2bde('0xad'),_0x2bde('0xae'),_0x2bde('0xaf'),_0x2bde('0xb0'),'rtpaudioqosrttbridged',_0x2bde('0xb1'),'sipuri',_0x2bde('0xb2'),_0x2bde('0xb3'),_0x2bde('0xb4'),'memberdynamic','memberinterface',_0x2bde('0xb5'),_0x2bde('0x8c'),_0x2bde('0xb6'),_0x2bde('0xb7')];if(!_[_0x2bde('0x39')](_0x3000c1)&&!_[_0x2bde('0xb8')](_0x3327f4,_0x3000c1)){if(_[_0x2bde('0x5e')](this[_0x2bde('0x41')][_0x15e4ba])){this[_0x2bde('0x41')][_0x15e4ba]={};}this[_0x2bde('0x41')][_0x15e4ba][_0x3000c1]=_0x2fdc21;}};VoiceQueueReport[_0x2bde('0xa')][_0x2bde('0x26')]=function(_0x457127){try{if(this[_0x2bde('0x5d')](_0x457127)){logger[_0x2bde('0x46')](_0x2bde('0xb9'),_0x457127['uniqueid'],util[_0x2bde('0x40')](_0x457127,{'showHidden':![],'depth':null}));if(this[_0x2bde('0xe')][_0x457127[_0x2bde('0x49')]]){for(var _0x4413a8=0x0,_0x241637={};_0x4413a8=0x0?moment(_0xf7b3ca[_0xe83d('0x1a')])[_0xe83d('0xe')](_0xf7b3ca[_0xe83d('0x19')],_0xe83d('0xf')):null,'data1':_0xe83d('0x1b'),'data2':_0xf7b3ca[_0xe83d('0x14')],'data3':_0xf7b3ca['exten'],'data4':_0xf7b3ca[_0xe83d('0x1c')]||null,'role':'agent','internal':_0xf7b3ca[_0xe83d('0x14')]?_[_0xe83d('0x1d')](_0xf7b3ca[_0xe83d('0x14')]):undefined,'uniqueid':_0xf7b3ca[_0xe83d('0x15')]},'log':_0xe83d('0x6')});}; \ No newline at end of file +var _0xeb25=['queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','CreateMemberReport','membername','TALKING','endtime','diff','starttime','seconds','outbound','moment','lodash','voiceQueueReport','queuecallercompleteAt','isNil','interface','format','SIP/%s','lastAssignedTo','queuecallerleaveAt','calleridnum','exten'];(function(_0x5d1dd6,_0xd977f9){var _0x28505f=function(_0x197799){while(--_0x197799){_0x5d1dd6['push'](_0x5d1dd6['shift']());}};_0x28505f(++_0xd977f9);}(_0xeb25,0xde));var _0x5eb2=function(_0x45cbf3,_0x55fdc1){_0x45cbf3=_0x45cbf3-0x0;var _0x73323b=_0xeb25[_0x45cbf3];return _0x73323b;};'use strict';var moment=require(_0x5eb2('0x0'));var _=require(_0x5eb2('0x1'));var util=require('util');var client=require('../client');exports[_0x5eb2('0x2')]=function(_0x46884){var _0x51e034=_0x46884[_0x5eb2('0x3')]||_0x46884['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x46884['lastAssignedTo'],'interface':_[_0x5eb2('0x4')](_0x46884[_0x5eb2('0x5')])?util[_0x5eb2('0x6')](_0x5eb2('0x7'),_0x46884[_0x5eb2('0x8')]):_0x46884[_0x5eb2('0x5')],'type':'TALKING','enterAt':_0x46884['queuecallerleaveAt'],'exitAt':_0x51e034,'duration':moment(_0x51e034)['diff'](_0x46884[_0x5eb2('0x9')],'seconds'),'data1':'inbound','data2':_0x46884[_0x5eb2('0xa')],'data3':_0x46884[_0x5eb2('0xb')],'data4':null,'data5':_0x46884[_0x5eb2('0xc')],'role':_0x5eb2('0xd'),'internal':_0x46884[_0x5eb2('0xe')]?_[_0x5eb2('0xf')](_0x46884[_0x5eb2('0xe')]):undefined,'uniqueid':_0x46884[_0x5eb2('0x10')]},'log':'CreateMemberReport'});};exports[_0x5eb2('0x11')]=function(_0x4cdde7){return client['Request'](_0x5eb2('0x12'),{'body':{'channel':'voice','membername':_0x4cdde7[_0x5eb2('0x13')],'interface':_0x4cdde7['interface'],'type':_0x5eb2('0x14'),'enterAt':_0x4cdde7['starttime'],'exitAt':_0x4cdde7[_0x5eb2('0x15')],'duration':moment(_0x4cdde7['endtime'])[_0x5eb2('0x16')](_0x4cdde7[_0x5eb2('0x17')],_0x5eb2('0x18'))>=0x0?moment(_0x4cdde7[_0x5eb2('0x15')])[_0x5eb2('0x16')](_0x4cdde7[_0x5eb2('0x17')],_0x5eb2('0x18')):null,'data1':_0x5eb2('0x19'),'data2':_0x4cdde7[_0x5eb2('0xe')],'data3':_0x4cdde7[_0x5eb2('0xb')],'data4':_0x4cdde7['dialstring']||null,'role':'agent','internal':_0x4cdde7[_0x5eb2('0xe')]?_[_0x5eb2('0xf')](_0x4cdde7['accountcode']):undefined,'uniqueid':_0x4cdde7[_0x5eb2('0x10')]},'log':_0x5eb2('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 42ffa4d..5af5d8b 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 _0xb49a=['stopRecordingOnTransfer','../client','getSettings','Request','ShowSetting'];(function(_0x228091,_0x54ab0c){var _0x3d6c8e=function(_0x123dfd){while(--_0x123dfd){_0x228091['push'](_0x228091['shift']());}};_0x3d6c8e(++_0x54ab0c);}(_0xb49a,0xfb));var _0xab49=function(_0x33ec17,_0x1fd9e9){_0x33ec17=_0x33ec17-0x0;var _0x46eceb=_0xb49a[_0x33ec17];return _0x46eceb;};'use strict';var client=require(_0xab49('0x0'));exports[_0xab49('0x1')]=function(){return client[_0xab49('0x2')](_0xab49('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xab49('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x851d=['GetSettings','../client','Request','ShowSetting'];(function(_0x39f67e,_0x6b1905){var _0x129aea=function(_0x12e8ba){while(--_0x12e8ba){_0x39f67e['push'](_0x39f67e['shift']());}};_0x129aea(++_0x6b1905);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd851('0x0'));exports['getSettings']=function(){return client[_0xd851('0x1')](_0xd851('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xd851('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 4ba90c3..3f2ee66 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 _0x3925=['GetTemplate','name','../client','getTemplates','Request'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x3925,0x1ba));var _0x5392=function(_0x513e46,_0x798ec6){_0x513e46=_0x513e46-0x0;var _0x5dc950=_0x3925[_0x513e46];return _0x5dc950;};'use strict';var client=require(_0x5392('0x0'));exports[_0x5392('0x1')]=function(_0x91191e){return function(_0x126191){return client[_0x5392('0x2')](_0x5392('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5392('0x4'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x034e=['../client','Request','GetTemplate','name','html'];(function(_0x3bdd36,_0x139fe0){var _0x4c3089=function(_0x3f6dcb){while(--_0x3f6dcb){_0x3bdd36['push'](_0x3bdd36['shift']());}};_0x4c3089(++_0x139fe0);}(_0x034e,0x118));var _0xe034=function(_0x585354,_0xba93f6){_0x585354=_0x585354-0x0;var _0x5c38df=_0x034e[_0x585354];return _0x5c38df;};'use strict';var client=require(_0xe034('0x0'));exports['getTemplates']=function(_0x98c7e2){return function(_0x4c5cba){return client[_0xe034('0x1')](_0xe034('0x2'),{'options':{'raw':!![],'attributes':['id',_0xe034('0x3'),_0xe034('0x4')]},'log':_0xe034('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e8ef6d3..dbbaecb 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 _0xc8de=['channel','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data4','data6','Request','GetTrigger','name'];(function(_0x165ade,_0x3ef17c){var _0x3e418a=function(_0x455fd9){while(--_0x455fd9){_0x165ade['push'](_0x165ade['shift']());}};_0x3e418a(++_0x3ef17c);}(_0xc8de,0x69));var _0xec8d=function(_0x1293f7,_0x4876be){_0x1293f7=_0x1293f7-0x0;var _0x2bd457=_0xc8de[_0x1293f7];return _0x2bd457;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x24036c){return function(_0xf8fc37){return client[_0xec8d('0x0')](_0xec8d('0x1'),{'options':{'raw':![],'attributes':['id',_0xec8d('0x2'),_0xec8d('0x3'),'status'],'include':[{'model':_0xec8d('0x4'),'as':_0xec8d('0x5'),'attributes':['id',_0xec8d('0x6'),_0xec8d('0x7'),'value']},{'model':_0xec8d('0x4'),'as':_0xec8d('0x8'),'attributes':['id',_0xec8d('0x6'),_0xec8d('0x7'),_0xec8d('0x9')]},{'model':_0xec8d('0xa'),'as':_0xec8d('0xb'),'attributes':['id',_0xec8d('0xc'),_0xec8d('0xd'),_0xec8d('0xe'),_0xec8d('0xf'),_0xec8d('0x10'),'data5',_0xec8d('0x11'),'data7']}]},'log':_0xec8d('0x1')});};}; \ No newline at end of file +var _0xfe24=['AnyConditions','Action','Actions','action','data2','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status','Condition','field','operator','value'];(function(_0x3aa8d5,_0x537c3d){var _0x491d65=function(_0x1ab049){while(--_0x1ab049){_0x3aa8d5['push'](_0x3aa8d5['shift']());}};_0x491d65(++_0x537c3d);}(_0xfe24,0xe1));var _0x4fe2=function(_0x3f0cef,_0x1db661){_0x3f0cef=_0x3f0cef-0x0;var _0x25e2e1=_0xfe24[_0x3f0cef];return _0x25e2e1;};'use strict';var client=require(_0x4fe2('0x0'));exports[_0x4fe2('0x1')]=function(_0x14dd0e){return function(_0x97ea7a){return client['Request'](_0x4fe2('0x2'),{'options':{'raw':![],'attributes':['id',_0x4fe2('0x3'),'channel',_0x4fe2('0x4')],'include':[{'model':_0x4fe2('0x5'),'as':'AllConditions','attributes':['id',_0x4fe2('0x6'),_0x4fe2('0x7'),_0x4fe2('0x8')]},{'model':'Condition','as':_0x4fe2('0x9'),'attributes':['id',_0x4fe2('0x6'),_0x4fe2('0x7'),_0x4fe2('0x8')]},{'model':_0x4fe2('0xa'),'as':_0x4fe2('0xb'),'attributes':['id',_0x4fe2('0xc'),'data1',_0x4fe2('0xd'),'data3',_0x4fe2('0xe'),_0x4fe2('0xf'),_0x4fe2('0x10'),_0x4fe2('0x11')]}]},'log':_0x4fe2('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ed538d6..a6c07af 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 _0x637f=['GetTrunk','name','Request'];(function(_0x25e754,_0x200eba){var _0x1d991e=function(_0x1601ba){while(--_0x1601ba){_0x25e754['push'](_0x25e754['shift']());}};_0x1d991e(++_0x200eba);}(_0x637f,0x1af));var _0xf637=function(_0x39c8f2,_0x23df6c){_0x39c8f2=_0x39c8f2-0x0;var _0x445526=_0x637f[_0x39c8f2];return _0x445526;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1c58a5){return function(_0x49f8ae){return client[_0xf637('0x0')](_0xf637('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf637('0x2'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x8250=['../client','getTrunks','GetTrunk','name','defaultuser'];(function(_0x39b43b,_0x1cbca3){var _0x13b45f=function(_0x291a86){while(--_0x291a86){_0x39b43b['push'](_0x39b43b['shift']());}};_0x13b45f(++_0x1cbca3);}(_0x8250,0xfa));var _0x0825=function(_0x2c27bf,_0x29ce0b){_0x2c27bf=_0x2c27bf-0x0;var _0x34987b=_0x8250[_0x2c27bf];return _0x34987b;};'use strict';var client=require(_0x0825('0x0'));exports[_0x0825('0x1')]=function(_0x4296a9){return function(_0x3c18ec){return client['Request'](_0x0825('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0825('0x3'),'registry',_0x0825('0x4')]},'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 b62d53b..6e3cf61 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x4cbf09,_0x5abcfc){var _0x503383=function(_0x294c6b){while(--_0x294c6b){_0x4cbf09['push'](_0x4cbf09['shift']());}};_0x503383(++_0x5abcfc);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x49e53d,_0x137ec8){var _0x1335af=function(_0x341397){while(--_0x341397){_0x49e53d['push'](_0x49e53d['shift']());}};_0x1335af(++_0x137ec8);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 10d65b8..23f5420 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 _0xa19d=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa19d,0x12b));var _0xda19=function(_0x7679ae,_0x5a55cf){_0x7679ae=_0x7679ae-0x0;var _0x28eed9=_0xa19d[_0x7679ae];return _0x28eed9;};'use strict';var client=require(_0xda19('0x0'));exports[_0xda19('0x1')]=function(_0x18a52a){return client['Request'](_0xda19('0x2'),{'body':_0x18a52a,'log':_0xda19('0x2')});};exports[_0xda19('0x3')]=function(_0x45c5bb,_0x131649,_0x3571c9){return client[_0xda19('0x4')](_0xda19('0x5'),{'body':_0x45c5bb,'options':{'where':{'uniqueid':_0x131649,'interface':_0x3571c9,'agentcomplete':!![]}},'log':_0xda19('0x5')});}; \ No newline at end of file +var _0x5901=['CreateVoiceAgentReport','Request'];(function(_0x5a4360,_0x40b002){var _0x383fc1=function(_0x47b6a7){while(--_0x47b6a7){_0x5a4360['push'](_0x5a4360['shift']());}};_0x383fc1(++_0x40b002);}(_0x5901,0xfc));var _0x1590=function(_0x4bbc10,_0x3d631c){_0x4bbc10=_0x4bbc10-0x0;var _0x3bb4c3=_0x5901[_0x4bbc10];return _0x3bb4c3;};'use strict';var client=require('../client');exports['create']=function(_0x339fb1){return client['Request'](_0x1590('0x0'),{'body':_0x339fb1,'log':_0x1590('0x0')});};exports['update']=function(_0x3fbf5b,_0x244a05,_0x59e9c9){return client[_0x1590('0x1')]('UpdateVoiceAgentReport',{'body':_0x3fbf5b,'options':{'where':{'uniqueid':_0x244a05,'interface':_0x59e9c9,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b32e607..49d98d8 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 _0x2193=['lodash','../client','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','moment'];(function(_0x5c1911,_0x5063d9){var _0x360290=function(_0x5081a7){while(--_0x5081a7){_0x5c1911['push'](_0x5c1911['shift']());}};_0x360290(++_0x5063d9);}(_0x2193,0x1ec));var _0x3219=function(_0x3901f4,_0x1c530b){_0x3901f4=_0x3901f4-0x0;var _0x23f3ac=_0x2193[_0x3901f4];return _0x23f3ac;};'use strict';var moment=require(_0x3219('0x0'));var util=require('util');var _=require(_0x3219('0x1'));var client=require(_0x3219('0x2'));exports['create']=function(_0x2cda12){return client[_0x3219('0x3')](_0x3219('0x4'),{'body':_[_0x3219('0x5')](_0x2cda12,{'source':_0x2cda12['calleridnum'],'destinationcontext':_0x2cda12[_0x3219('0x6')],'callerid':_0x2cda12[_0x3219('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x3219('0x8')]=function(){return function(){return client[_0x3219('0x3')](_0x3219('0x9'),{'options':{'where':{'type':[_0x3219('0xa')],'createdAt':{'$between':[moment()[_0x3219('0xb')](_0x3219('0xc'))[_0x3219('0xd')](_0x3219('0xe')),moment()['endOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x3219('0xf'),'disposition',_0x3219('0x10'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x2cee=['create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x368850,_0x32bb6f){var _0x417f93=function(_0x1c2216){while(--_0x1c2216){_0x368850['push'](_0x368850['shift']());}};_0x417f93(++_0x32bb6f);}(_0x2cee,0x1a0));var _0xe2ce=function(_0x28c6e0,_0x57f175){_0x28c6e0=_0x28c6e0-0x0;var _0x49cff8=_0x2cee[_0x28c6e0];return _0x49cff8;};'use strict';var moment=require(_0xe2ce('0x0'));var util=require(_0xe2ce('0x1'));var _=require(_0xe2ce('0x2'));var client=require(_0xe2ce('0x3'));exports[_0xe2ce('0x4')]=function(_0x4a7845){return client['Request'](_0xe2ce('0x5'),{'body':_[_0xe2ce('0x6')](_0x4a7845,{'source':_0x4a7845[_0xe2ce('0x7')],'destinationcontext':_0x4a7845[_0xe2ce('0x8')],'callerid':_0x4a7845[_0xe2ce('0x9')],'amaflags':_0xe2ce('0xa')}),'log':_0xe2ce('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xe2ce('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xe2ce('0xc'))[_0xe2ce('0xd')](_0xe2ce('0xe')),moment()[_0xe2ce('0xf')]('day')['format'](_0xe2ce('0xe'))]}},'attributes':[_0xe2ce('0x10'),_0xe2ce('0x11'),'duration',_0xe2ce('0x12')]},'log':_0xe2ce('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d1cdec5..966d7f3 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 _0xcd9b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xcd9b,0x1a2));var _0xbcd9=function(_0x3b71e4,_0x37cb07){_0x3b71e4=_0x3b71e4-0x0;var _0x446838=_0xcd9b[_0x3b71e4];return _0x446838;};'use strict';var client=require(_0xbcd9('0x0'));exports[_0xbcd9('0x1')]=function(_0x21e64){return client[_0xbcd9('0x2')](_0xbcd9('0x3'),{'body':_0x21e64,'log':_0xbcd9('0x3')});}; \ No newline at end of file +var _0x9332=['CreateVoiceDialReport','../client','create','Request'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x9332,0x159));var _0x2933=function(_0xf7b425,_0x4e8416){_0xf7b425=_0xf7b425-0x0;var _0x2a16ba=_0x9332[_0xf7b425];return _0x2a16ba;};'use strict';var client=require(_0x2933('0x0'));exports[_0x2933('0x1')]=function(_0x2020d3){return client[_0x2933('0x2')]('CreateVoiceDialReport',{'body':_0x2020d3,'log':_0x2933('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index eb8fe2b..045be7f 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 _0xe87e=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1fdd09,_0x188de4){var _0x52c681=function(_0x2ac787){while(--_0x2ac787){_0x1fdd09['push'](_0x1fdd09['shift']());}};_0x52c681(++_0x188de4);}(_0xe87e,0x17d));var _0xee87=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xe87e[_0x556927];return _0x5f1235;};'use strict';var client=require(_0xee87('0x0'));exports[_0xee87('0x1')]=function(){return function(){return client[_0xee87('0x2')](_0xee87('0x3'),{'options':{'raw':!![],'attributes':['id',_0xee87('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xee87('0x1')});};}; \ No newline at end of file +var _0x0e9f=['getVoiceExtensions','exten','../client'];(function(_0x576a12,_0x1797fc){var _0x25f205=function(_0x9ad86b){while(--_0x9ad86b){_0x576a12['push'](_0x576a12['shift']());}};_0x25f205(++_0x1797fc);}(_0x0e9f,0x116));var _0xf0e9=function(_0x5bb14d,_0x3f61c7){_0x5bb14d=_0x5bb14d-0x0;var _0x2486a4=_0x0e9f[_0x5bb14d];return _0x2486a4;};'use strict';var client=require(_0xf0e9('0x0'));exports[_0xf0e9('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xf0e9('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d69ee43..898a8a6 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 _0x232c=['dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout'];(function(_0x146961,_0x9b5d75){var _0x17e6d0=function(_0x33ad43){while(--_0x33ad43){_0x146961['push'](_0x146961['shift']());}};_0x17e6d0(++_0x9b5d75);}(_0x232c,0x144));var _0xc232=function(_0x48a93a,_0x175ecb){_0x48a93a=_0x48a93a-0x0;var _0x1f5c1e=_0x232c[_0x48a93a];return _0x1f5c1e;};'use strict';var client=require(_0xc232('0x0'));exports[_0xc232('0x1')]=function(){return function(){return client[_0xc232('0x2')](_0xc232('0x3'),{'options':{'raw':![],'attributes':['id',_0xc232('0x4'),_0xc232('0x5'),'acwTimeout',_0xc232('0x6'),'monitor_format',_0xc232('0x7'),'dialActive',_0xc232('0x8'),_0xc232('0x9'),'dialLimitQueue',_0xc232('0xa'),_0xc232('0xb'),_0xc232('0xc'),_0xc232('0xd'),_0xc232('0xe'),_0xc232('0xf'),_0xc232('0x10'),_0xc232('0x11'),'dialQueueTimeout',_0xc232('0x12'),_0xc232('0x13'),_0xc232('0x14'),_0xc232('0x15'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xc232('0x16'),'dialGlobalMaxRetry',_0xc232('0x17'),_0xc232('0x18'),_0xc232('0x19'),_0xc232('0x1a'),'dialAMDActive',_0xc232('0x1b'),_0xc232('0x1c'),_0xc232('0x1d'),_0xc232('0x1e'),_0xc232('0x1f'),_0xc232('0x20'),'dialAMDMaximumNumberOfWords',_0xc232('0x21'),_0xc232('0x22'),'timeout',_0xc232('0x23'),_0xc232('0x24'),'dialOrderByScheduledAt',_0xc232('0x25'),_0xc232('0x26'),_0xc232('0x27'),_0xc232('0x28'),_0xc232('0x29'),_0xc232('0x2a'),_0xc232('0x2b'),_0xc232('0x2c'),_0xc232('0x2d'),'dialDropMaxRetry',_0xc232('0x2e'),'dialAbandonedMaxRetry',_0xc232('0x2f'),_0xc232('0x30'),'dialMachineRetryFrequency',_0xc232('0x31'),_0xc232('0x32'),'mandatoryDisposition',_0xc232('0x33'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xc232('0x34'),'as':_0xc232('0x34'),'attributes':['id',_0xc232('0x4'),_0xc232('0x35'),_0xc232('0x36')]},{'model':_0xc232('0x37'),'as':_0xc232('0x38'),'attributes':['id','name']},{'model':_0xc232('0x34'),'as':_0xc232('0x39'),'attributes':['id','name',_0xc232('0x35'),'active']},{'model':_0xc232('0x3a'),'as':'Interval','attributes':['id',_0xc232('0x4')],'include':[{'model':_0xc232('0x3a'),'as':_0xc232('0x3b'),'attributes':['id',_0xc232('0x4'),'interval']}]}]},'log':_0xc232('0x1')});};}; \ No newline at end of file +var _0x7810=['dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','../client','name','acw','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout'];(function(_0x4d8790,_0x521730){var _0x5e99c4=function(_0x3c34af){while(--_0x3c34af){_0x4d8790['push'](_0x4d8790['shift']());}};_0x5e99c4(++_0x521730);}(_0x7810,0xc9));var _0x0781=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x7810[_0xdea41a];return _0x15d0d8;};'use strict';var client=require(_0x0781('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x0781('0x1'),_0x0781('0x2'),'acwTimeout',_0x0781('0x3'),_0x0781('0x4'),_0x0781('0x5'),_0x0781('0x6'),'dialMethod',_0x0781('0x7'),_0x0781('0x8'),_0x0781('0x9'),_0x0781('0xa'),_0x0781('0xb'),_0x0781('0xc'),_0x0781('0xd'),_0x0781('0xe'),_0x0781('0xf'),_0x0781('0x10'),_0x0781('0x11'),_0x0781('0x12'),_0x0781('0x13'),'dialCongestionRetryFrequency',_0x0781('0x14'),_0x0781('0x15'),_0x0781('0x16'),_0x0781('0x17'),_0x0781('0x18'),'dialTimezone',_0x0781('0x19'),'dialPrefix',_0x0781('0x1a'),'dialAMDActive','dialAMDInitialSilence',_0x0781('0x1b'),_0x0781('0x1c'),'dialAMDTotalAnalysisTime',_0x0781('0x1d'),_0x0781('0x1e'),_0x0781('0x1f'),_0x0781('0x20'),_0x0781('0x21'),'timeout',_0x0781('0x22'),_0x0781('0x23'),_0x0781('0x24'),_0x0781('0x25'),_0x0781('0x26'),_0x0781('0x27'),_0x0781('0x4'),'strategy','dialRandomLastDigitCallerIdNumber',_0x0781('0x28'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x0781('0x29'),_0x0781('0x2a'),_0x0781('0x2b'),_0x0781('0x2c'),_0x0781('0x2d'),_0x0781('0x2e'),_0x0781('0x2f'),_0x0781('0x30'),_0x0781('0x31'),_0x0781('0x32'),_0x0781('0x33')],'include':[{'model':'Trunk','as':_0x0781('0x34'),'attributes':['id',_0x0781('0x1'),'callerid','active']},{'model':_0x0781('0x35'),'as':_0x0781('0x36'),'attributes':['id',_0x0781('0x1')]},{'model':_0x0781('0x34'),'as':_0x0781('0x37'),'attributes':['id','name','callerid','active']},{'model':_0x0781('0x38'),'as':'Interval','attributes':['id',_0x0781('0x1')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x0781('0x1'),_0x0781('0x39')]}]}]},'log':_0x0781('0x3a')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 899a317..eb7f441 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(_0x481aaf,_0xec1c7a){var _0x23c8e0=function(_0x2f97d2){while(--_0x2f97d2){_0x481aaf['push'](_0x481aaf['shift']());}};_0x23c8e0(++_0xec1c7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x5ea5c4,_0x19bd85){var _0x56367a=function(_0x322de9){while(--_0x322de9){_0x5ea5c4['push'](_0x5ea5c4['shift']());}};_0x56367a(++_0x19bd85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 4750dce..9912153 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 _0xfabf=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x56fc31,_0xeb5697){var _0x3b611b=function(_0xceb96d){while(--_0xceb96d){_0x56fc31['push'](_0x56fc31['shift']());}};_0x3b611b(++_0xeb5697);}(_0xfabf,0x15d));var _0xffab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfabf[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xffab('0x0'));exports[_0xffab('0x1')]=function(_0x14240a){return function(){return client[_0xffab('0x2')](_0xffab('0x3'),{'options':{'where':{'VoiceQueueId':_0x14240a,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x35da=['../client','getVoiceQueueRtPauses'];(function(_0x25048e,_0x48d685){var _0x5dc636=function(_0x4e5171){while(--_0x4e5171){_0x25048e['push'](_0x25048e['shift']());}};_0x5dc636(++_0x48d685);}(_0x35da,0x6a));var _0xa35d=function(_0x28f3fb,_0x372649){_0x28f3fb=_0x28f3fb-0x0;var _0x1666d2=_0x35da[_0x28f3fb];return _0x1666d2;};'use strict';var client=require(_0xa35d('0x0'));exports[_0xa35d('0x1')]=function(_0x33998b){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x33998b,'paused':!![]},'raw':!![]},'log':_0xa35d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ddbc5f0..8ff6edc 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(_0x387d23,_0xe0afa2){var _0x4fc5de=function(_0x2060be){while(--_0x2060be){_0x387d23['push'](_0x387d23['shift']());}};_0x4fc5de(++_0xe0afa2);}(_0x7a54,0x106));var _0x47a5=function(_0x599847,_0x15e045){_0x599847=_0x599847-0x0;var _0x4df188=_0x7a54[_0x599847];return _0x4df188;};'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(_0x1a43df,_0x5179d4){var _0x3b0559=function(_0x451bae){while(--_0x451bae){_0x1a43df['push'](_0x1a43df['shift']());}};_0x3b0559(++_0x5179d4);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 1111bfc..9b71851 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 _0x3955=['transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum'];(function(_0x505315,_0x8b9fef){var _0x349f64=function(_0x41dd8f){while(--_0x41dd8f){_0x505315['push'](_0x505315['shift']());}};_0x349f64(++_0x8b9fef);}(_0x3955,0xfd));var _0x5395=function(_0x328cd6,_0xdd3dd6){_0x328cd6=_0x328cd6-0x0;var _0x993bb3=_0x3955[_0x328cd6];return _0x993bb3;};'use strict';var client=require('../client');exports[_0x5395('0x0')]={};exports[_0x5395('0x1')]=function(_0x46f1b2){return client[_0x5395('0x2')](_0x5395('0x3'),{'body':{'result':_0x46f1b2[_0x5395('0x4')],'transfererchannel':_0x46f1b2[_0x5395('0x5')],'transferercalleridnum':_0x46f1b2['transferercalleridnum'],'transferercalleridname':_0x46f1b2[_0x5395('0x6')],'transfererconnectedlinenum':_0x46f1b2[_0x5395('0x7')],'transfererconnectedlinename':_0x46f1b2['transfererconnectedlinename'],'transfereraccountcode':_0x46f1b2['transfereraccountcode'],'transferercontext':_0x46f1b2[_0x5395('0x8')],'transfererexten':_0x46f1b2[_0x5395('0x9')],'transfererlinkedid':_0x46f1b2[_0x5395('0xa')],'transfereechannel':_0x46f1b2[_0x5395('0xb')],'transfereecalleridnum':_0x46f1b2[_0x5395('0xc')],'transfereecalleridname':_0x46f1b2['transfereecalleridname'],'transfereeconnectedlinenum':_0x46f1b2['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x46f1b2[_0x5395('0xd')],'transfereeaccountcode':_0x46f1b2[_0x5395('0xe')],'transfereecontext':_0x46f1b2[_0x5395('0xf')],'transfereeexten':_0x46f1b2[_0x5395('0x10')],'transfereelinkedid':_0x46f1b2[_0x5395('0x11')],'isexternal':_0x46f1b2[_0x5395('0x12')],'context':_0x46f1b2[_0x5395('0x13')],'extension':_0x46f1b2[_0x5395('0x14')],'type':_0x5395('0x15')},'log':_0x5395('0x3')});};exports[_0x5395('0x16')]=function(_0xdafe48){return client[_0x5395('0x2')](_0x5395('0x3'),{'body':{'result':_0xdafe48['result'],'transfererchannel':_0xdafe48[_0x5395('0x17')],'transferercalleridnum':_0xdafe48['origtransferercalleridnum'],'transferercalleridname':_0xdafe48[_0x5395('0x18')],'transfererconnectedlinenum':_0xdafe48['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xdafe48[_0x5395('0x19')],'transfereraccountcode':_0xdafe48[_0x5395('0x1a')],'transferercontext':_0xdafe48['secondtransferercontext'],'transfererexten':_0xdafe48[_0x5395('0x1b')],'transfererlinkedid':_0xdafe48[_0x5395('0x1c')],'transfereechannel':_0xdafe48[_0x5395('0x1d')],'transfereecalleridnum':_0xdafe48[_0x5395('0x1e')],'transfereecalleridname':_0xdafe48['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xdafe48[_0x5395('0x1f')],'transfereeconnectedlinename':_0xdafe48[_0x5395('0x20')],'transfereeaccountcode':_0xdafe48['transfertargetaccountcode'],'transfereecontext':_0xdafe48[_0x5395('0x21')],'transfereeexten':_0xdafe48[_0x5395('0x22')],'transfereelinkedid':_0xdafe48[_0x5395('0x23')],'isexternal':_0xdafe48[_0x5395('0x12')],'context':_0xdafe48[_0x5395('0x24')],'extension':_0xdafe48[_0x5395('0x25')],'type':'attended'},'log':_0x5395('0x3')});}; \ No newline at end of file +var _0x0f22=['attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','context','extension','blind'];(function(_0x4b8ddf,_0x70be0c){var _0x29df16=function(_0x368ffe){while(--_0x368ffe){_0x4b8ddf['push'](_0x4b8ddf['shift']());}};_0x29df16(++_0x70be0c);}(_0x0f22,0x88));var _0x20f2=function(_0x269af8,_0x5b86fc){_0x269af8=_0x269af8-0x0;var _0x5f5d9c=_0x0f22[_0x269af8];return _0x5f5d9c;};'use strict';var client=require(_0x20f2('0x0'));exports[_0x20f2('0x1')]={};exports[_0x20f2('0x2')]=function(_0x35830f){return client['Request'](_0x20f2('0x3'),{'body':{'result':_0x35830f[_0x20f2('0x4')],'transfererchannel':_0x35830f[_0x20f2('0x5')],'transferercalleridnum':_0x35830f[_0x20f2('0x6')],'transferercalleridname':_0x35830f[_0x20f2('0x7')],'transfererconnectedlinenum':_0x35830f['transfererconnectedlinenum'],'transfererconnectedlinename':_0x35830f[_0x20f2('0x8')],'transfereraccountcode':_0x35830f[_0x20f2('0x9')],'transferercontext':_0x35830f[_0x20f2('0xa')],'transfererexten':_0x35830f[_0x20f2('0xb')],'transfererlinkedid':_0x35830f[_0x20f2('0xc')],'transfereechannel':_0x35830f[_0x20f2('0xd')],'transfereecalleridnum':_0x35830f[_0x20f2('0xe')],'transfereecalleridname':_0x35830f[_0x20f2('0xf')],'transfereeconnectedlinenum':_0x35830f[_0x20f2('0x10')],'transfereeconnectedlinename':_0x35830f[_0x20f2('0x11')],'transfereeaccountcode':_0x35830f[_0x20f2('0x12')],'transfereecontext':_0x35830f['transfereecontext'],'transfereeexten':_0x35830f['transfereeexten'],'transfereelinkedid':_0x35830f[_0x20f2('0x13')],'isexternal':_0x35830f[_0x20f2('0x14')],'context':_0x35830f[_0x20f2('0x15')],'extension':_0x35830f[_0x20f2('0x16')],'type':_0x20f2('0x17')},'log':_0x20f2('0x3')});};exports[_0x20f2('0x18')]=function(_0x2e4d25){return client['Request'](_0x20f2('0x3'),{'body':{'result':_0x2e4d25['result'],'transfererchannel':_0x2e4d25['origtransfererchannel'],'transferercalleridnum':_0x2e4d25[_0x20f2('0x19')],'transferercalleridname':_0x2e4d25[_0x20f2('0x1a')],'transfererconnectedlinenum':_0x2e4d25[_0x20f2('0x1b')],'transfererconnectedlinename':_0x2e4d25[_0x20f2('0x1c')],'transfereraccountcode':_0x2e4d25['origtransfereraccountcode'],'transferercontext':_0x2e4d25[_0x20f2('0x1d')],'transfererexten':_0x2e4d25[_0x20f2('0x1e')],'transfererlinkedid':_0x2e4d25['origtransfererlinkedid'],'transfereechannel':_0x2e4d25['transfertargetchannel'],'transfereecalleridnum':_0x2e4d25[_0x20f2('0x1f')],'transfereecalleridname':_0x2e4d25[_0x20f2('0x20')],'transfereeconnectedlinenum':_0x2e4d25[_0x20f2('0x21')],'transfereeconnectedlinename':_0x2e4d25[_0x20f2('0x22')],'transfereeaccountcode':_0x2e4d25[_0x20f2('0x23')],'transfereecontext':_0x2e4d25['transfertargetcontext'],'transfereeexten':_0x2e4d25[_0x20f2('0x24')],'transfereelinkedid':_0x2e4d25[_0x20f2('0x25')],'isexternal':_0x2e4d25[_0x20f2('0x14')],'context':_0x2e4d25[_0x20f2('0x26')],'extension':_0x2e4d25['origtransfererexten'],'type':_0x20f2('0x27')},'log':_0x20f2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f8d6669..bb102dc 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 _0x236d=['QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','callerid','Interval','push','omit','undefined','values','channels','length','voicechannel','map','find','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','then','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','uniqueid','MixMonitor\x20Success','catch','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','context','telephones','outboundChannels','campaigns','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause'];(function(_0x2744df,_0xcd7a2e){var _0x24b140=function(_0x834226){while(--_0x834226){_0x2744df['push'](_0x2744df['shift']());}};_0x24b140(++_0xcd7a2e);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var jayson=require('jayson/promise');var schema=require(_0xd236('0x2'));var BPromise=require('bluebird');var moment=require(_0xd236('0x3'));var config=require(_0xd236('0x4'));var properties=require(_0xd236('0x5'));var ami=require(_0xd236('0x6'));exports['listen']=function(_0x56bc88,_0x234912,_0x29a67c){return new BPromise(function(_0x75d84c,_0x1aedc6){var _0x58c59e={'QueuePause':function(_0x54ac9c){return new Promise(function(_0x2d9025,_0x18d969){var _0x4e0460=util[_0xd236('0x7')](_0xd236('0x8'),'SIP',_0x54ac9c[_0xd236('0x9')]);if(_0x56bc88[_0xd236('0xa')]&&_0x56bc88[_0xd236('0xa')][_0x4e0460]&&_0x56bc88['timers'][_0x4e0460][_0xd236('0xb')]){_0x56bc88[_0xd236('0xa')][_0x4e0460][_0xd236('0xc')]();}if(_0x56bc88['agents'][_0x4e0460]){_0x56bc88[_0xd236('0xd')][_0x4e0460][_0xd236('0xe')]({'statePause':_0x54ac9c[_0xd236('0xf')]?!![]:![]});}_0x2d9025({'code':0xc8,'message':_0xd236('0x10')});});},'Reload':function(_0x21f27b){var _0x224469=this;return new Promise(function(_0x206b35,_0x974c47){if(ami[_0xd236('0x11')]()==![]){return _0x974c47(_0x224469[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')][_0xd236('0x14')],_0xd236('0x15')][_0xd236('0x16')]('\x20')));}_0x21f27b=_[_0xd236('0x17')](_0x21f27b,_[_0xd236('0x18')](properties[_0xd236('0x19')]));_0x21f27b[_0xd236('0x1a')]=_0xd236('0x1b');return ami['Action'](_0x21f27b)['then'](function(_0x216a25){_0x206b35({'code':0xc8,'message':_0x216a25[_0xd236('0x1c')]});})['catch'](function(_0x11c6ec){_0x974c47(_0x224469[_0xd236('0x12')](0x1f5,_0x11c6ec[_0xd236('0x1c')]));});});},'Command':function(_0x595fd4){var _0x355b65=this;return new Promise(function(_0x1b6aaa,_0x31f0bb){if(ami['isConnected']()==![]){return _0x31f0bb(_0x355b65[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')][_0xd236('0x14')],_0xd236('0x15')]['join']('\x20')));}_0x595fd4=_[_0xd236('0x17')](_0x595fd4,_0xd236('0x1d'));_0x595fd4[_0xd236('0x1a')]=_0xd236('0x1e');return ami[_0xd236('0x1f')](_0x595fd4)['then'](function(_0x4a35d0){_0x1b6aaa({'code':0xc8,'message':_0x4a35d0[_0xd236('0x20')]});})['catch'](function(_0x22924d){_0x31f0bb(_0x355b65['error'](0x1f5,_0x22924d[_0xd236('0x1c')]));});});},'VoiceQueues':function(_0x2174f5){return new Promise(function(_0x234930,_0x49d822){var _0x41049a=[];for(var _0x339b08 in _0x56bc88[_0xd236('0x21')]){if(_0x56bc88[_0xd236('0x21')][_0xd236('0x22')](_0x339b08)){var _0x17f927=_0x56bc88[_0xd236('0x21')][_0x339b08];var _0x21eeab={'id':_0x17f927['id'],'name':_0x17f927[_0xd236('0x9')],'strategy':_0x17f927[_0xd236('0x23')],'answered':_0x17f927[_0xd236('0x24')],'available':_0x17f927[_0xd236('0x25')],'loggedIn':_0x17f927[_0xd236('0x26')],'pTalking':_0x17f927[_0xd236('0x27')],'sumBillable':_0x17f927[_0xd236('0x28')],'sumDuration':_0x17f927[_0xd236('0x29')],'sumHoldTime':_0x17f927[_0xd236('0x2a')]||0x0,'talking':_0x17f927[_0xd236('0x2b')],'total':_0x17f927[_0xd236('0x2c')],'type':_0x17f927[_0xd236('0x2d')],'unmanaged':_0x17f927[_0xd236('0x2e')],'abandoned':_0x17f927[_0xd236('0x2f')],'waiting':_0x17f927[_0xd236('0x30')],'loggedInDb':_0x17f927[_0xd236('0x31')]};if(_0x17f927[_0xd236('0x2d')]===_0xd236('0x32')){_0x21eeab[_0xd236('0x33')]=_0x17f927[_0xd236('0x33')];_0x21eeab[_0xd236('0x34')]=_0x17f927['dialMethod'];_0x21eeab[_0xd236('0x35')]=_0x17f927['dialOriginateCallerIdName'];_0x21eeab[_0xd236('0x36')]=_0x17f927[_0xd236('0x36')];_0x21eeab[_0xd236('0x37')]=_0x17f927['dialOriginateTimeout'];_0x21eeab[_0xd236('0x38')]=_0x17f927[_0xd236('0x38')];_0x21eeab[_0xd236('0x39')]=_0x17f927[_0xd236('0x39')];_0x21eeab[_0xd236('0x3a')]=_0x17f927[_0xd236('0x3a')];_0x21eeab[_0xd236('0x3b')]=_0x17f927['outboundAnswerCallsDay'];_0x21eeab[_0xd236('0x3c')]=_0x17f927['outboundBlacklistCallsDay'];_0x21eeab[_0xd236('0x3d')]=_0x17f927['outboundBusyCallsDay'];_0x21eeab[_0xd236('0x3e')]=_0x17f927[_0xd236('0x3e')];_0x21eeab[_0xd236('0x3f')]=_0x17f927[_0xd236('0x3f')];_0x21eeab[_0xd236('0x40')]=_0x17f927[_0xd236('0x40')];_0x21eeab[_0xd236('0x41')]=_0x17f927[_0xd236('0x41')];_0x21eeab[_0xd236('0x42')]=_0x17f927[_0xd236('0x42')];_0x21eeab[_0xd236('0x43')]=_0x17f927[_0xd236('0x43')];_0x21eeab[_0xd236('0x44')]=_0x17f927['outboundOriginateFailureCallsDay'];_0x21eeab[_0xd236('0x45')]=_0x17f927[_0xd236('0x45')];_0x21eeab[_0xd236('0x46')]=_0x17f927['outboundRejectCallsDay'];_0x21eeab[_0xd236('0x47')]=_0x17f927[_0xd236('0x47')];_0x21eeab[_0xd236('0x48')]=_0x17f927[_0xd236('0x48')];_0x21eeab[_0xd236('0x49')]=_0x17f927[_0xd236('0x49')];_0x21eeab['predictiveIntervalAvgTalktime']=_0x17f927[_0xd236('0x4a')];_0x21eeab[_0xd236('0x4b')]=_0x17f927[_0xd236('0x4b')];_0x21eeab[_0xd236('0x4c')]=_0x17f927[_0xd236('0x4c')];_0x21eeab[_0xd236('0x4d')]=_0x17f927['predictiveIntervalErlangCalls'];_0x21eeab[_0xd236('0x4e')]=_0x17f927[_0xd236('0x4e')];_0x21eeab[_0xd236('0x4f')]=_0x17f927['predictiveIntervalHitRate'];_0x21eeab[_0xd236('0x50')]=_0x17f927['predictiveIntervalMultiplicativeFactor'];_0x21eeab[_0xd236('0x51')]=_0x17f927['predictiveIntervalPauses'];_0x21eeab['predictiveIntervalAvailable']=_0x17f927[_0xd236('0x52')];_0x21eeab[_0xd236('0x53')]=_0x17f927[_0xd236('0x53')];_0x21eeab[_0xd236('0x1c')]=_0x17f927[_0xd236('0x1c')];_0x21eeab['originated']=_0x17f927['originated'];_0x21eeab[_0xd236('0x54')]=_0x17f927[_0xd236('0x54')];_0x21eeab['erlangCallToSecond']=_0x17f927[_0xd236('0x55')];_0x21eeab[_0xd236('0x56')]=_0x17f927[_0xd236('0x56')];_0x21eeab['erlangBusyFactor']=_0x17f927['erlangBusyFactor'];_0x21eeab['startPredictive']=_0x17f927[_0xd236('0x57')];_0x21eeab['startProgressive']=_0x17f927['startProgressive'];}if(_0x17f927[_0xd236('0x58')]){_0x21eeab[_0xd236('0x58')]={'id':_0x17f927[_0xd236('0x58')]['id'],'name':_0x17f927[_0xd236('0x58')][_0xd236('0x9')],'active':_0x17f927['Trunk']['active'],'callerid':_0x17f927[_0xd236('0x58')][_0xd236('0x59')]};}if(_0x17f927[_0xd236('0x5a')]){_0x21eeab[_0xd236('0x5a')]={'id':_0x17f927[_0xd236('0x5a')]['id'],'name':_0x17f927[_0xd236('0x5a')]['name']};}_0x41049a[_0xd236('0x5b')](_0x21eeab);}}_0x234930({'count':_0x41049a['length'],'rows':_0x41049a});});},'UpdateVoiceQueue':function(_0x2abf6f){return new Promise(function(_0x2b469f,_0x57c0cf){var _0x5efa49=_['find'](_0x56bc88['voiceQueues'],{'id':parseInt(_0x2abf6f['id'])});var _0x43ba74=_[_0xd236('0x5c')](_0x2abf6f,['id']);if(_0x5efa49){for(var _0x33394b in _0x43ba74){if(typeof _0x43ba74[_0x33394b]!==_0xd236('0x5d')&&typeof _0x5efa49[_0x33394b]!==_0xd236('0x5d')){_0x5efa49[_0x33394b]=_0x43ba74[_0x33394b];}}_0x2b469f(_0x5efa49);}else{_0x57c0cf();}});},'VoiceChannels':function(_0x50060b){return new Promise(function(_0x50a4a8,_0x2f3b1f){var _0x7c0650=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x5f')]);_0x50a4a8({'count':_0x7c0650[_0xd236('0x60')],'rows':_0x7c0650});});},'VoiceChannelMixMonitor':function(_0x10a521){var _0x5eb88c=this;return new Promise(function(_0x2be871,_0x48a1db){if(ami[_0xd236('0x11')]()==![]){return _0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xd236('0x13')][_0xd236('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x135cfc=schema(properties[_0xd236('0x61')])[_0xd236('0x2')](_0x10a521);if(_0x135cfc[_0xd236('0x60')]>0x0){return _0x48a1db(_0x5eb88c['error'](0x1f4,_[_0xd236('0x62')](_0x135cfc,_0xd236('0x1c'))[_0xd236('0x16')](',\x20')));}var _0x18d606=_[_0xd236('0x63')](_0x56bc88[_0xd236('0x5f')],{'uniqueid':_0x10a521['uniqueid']});if(_0x18d606&&_0x18d606['channel']){var _0x3e0974=util['format'](_0xd236('0x64'),_0x10a521[_0xd236('0x65')]||_0x10a521['uniqueid'],_0x10a521[_0xd236('0x7')]||_0xd236('0x66'));return ami['Action']({'action':_0xd236('0x67'),'channel':_0x18d606[_0xd236('0x68')],'file':_0x3e0974,'options':_0xd236('0x69')})[_0xd236('0x6a')](function(_0x5b9337){var _0x4bb567=_[_0xd236('0x63')](_0x18d606[_0xd236('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x3e0974[_0xd236('0x6c')]()});if(_[_0xd236('0x6d')](_0x4bb567)){_0x18d606[_0xd236('0x6b')][_0xd236('0x5b')]({'filename':_0xd236('0x6e')+_0x3e0974['toLowerCase'](),'createdAt':moment()[_0xd236('0x7')](_0xd236('0x6f')),'mixmonitorid':_0x5b9337[_0xd236('0x70')],'status':'rec'});}else{_0x4bb567[_0xd236('0x70')]=_0x5b9337['mixmonitorid'];_0x4bb567['status']=_0xd236('0x71');}_0x2be871({'code':0xc8,'message':[_0x10a521[_0xd236('0x72')],_0xd236('0x73'),_0x5b9337[_0xd236('0x70')]][_0xd236('0x16')]('\x20'),'mixmonitorid':_0x5b9337[_0xd236('0x70')]});})[_0xd236('0x74')](function(_0x5f518e){_0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f5,[_0x10a521[_0xd236('0x72')],_0x5f518e[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x48a1db(_0x5eb88c[_0xd236('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x382ef0){var _0x405514=this;return new Promise(function(_0x1cd1f2,_0x498ec5){if(ami[_0xd236('0x11')]()==![]){return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config['asterisk'][_0xd236('0x14')],_0xd236('0x15')][_0xd236('0x16')]('\x20')));}var _0x3413b0=schema(properties['voicechannel'])[_0xd236('0x2')](_0x382ef0);if(_0x3413b0['length']>0x0){return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f4,_['map'](_0x3413b0,_0xd236('0x1c'))['join'](',\x20')));}var _0x28cb18=_[_0xd236('0x63')](_0x56bc88['channels'],{'uniqueid':_0x382ef0[_0xd236('0x72')]});if(_0x28cb18){return BPromise['resolve']()[_0xd236('0x6a')](function(){if(_0x28cb18[_0xd236('0x68')]){return ami['Action']({'action':_0xd236('0x75'),'channel':_0x28cb18[_0xd236('0x68')],'mixmonitorid':_0x382ef0['mixmonitorid']})['catch'](function(_0x46766c){});}})[_0xd236('0x6a')](function(){if(_0x28cb18['destinationchannel']){return ami[_0xd236('0x1f')]({'action':'StopMixMonitor','channel':_0x28cb18[_0xd236('0x76')],'mixmonitorid':_0x382ef0[_0xd236('0x70')]})['catch'](function(_0x24f720){});}})[_0xd236('0x6a')](function(_0x275f2b){var _0x12dcb5=_['find'](_0x28cb18[_0xd236('0x6b')],{'mixmonitorid':_0x382ef0[_0xd236('0x70')]});if(_0x12dcb5){_0x12dcb5[_0xd236('0x77')]='stop';}})[_0xd236('0x6a')](function(){var _0x4db755=util[_0xd236('0x7')](_0xd236('0x64'),_0x382ef0[_0xd236('0x65')]||_0x382ef0['uniqueid'],_0x382ef0[_0xd236('0x7')]||_0xd236('0x66'));var _0x2c2046=_[_0xd236('0x63')](_0x28cb18['monitors'],{'filename':_0xd236('0x6e')+_0x4db755[_0xd236('0x6c')]()});if(_0x2c2046){_0x2c2046[_0xd236('0x77')]=_0xd236('0x78');}})['then'](function(){_0x1cd1f2({'code':0xc8,'message':[_0x382ef0[_0xd236('0x72')],_0xd236('0x79')]['join']('\x20')});})['catch'](function(_0x19a083){_0x498ec5(_0x405514[_0xd236('0x12')](0x1f5,[_0x382ef0[_0xd236('0x72')],_0x19a083[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x498ec5(_0x405514[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannels':function(_0x5e0830){return new Promise(function(_0xa816f6,_0x1c43de){var _0x5711f8=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x7b')]);_0xa816f6({'count':_0x5711f8['length'],'rows':_0x5711f8});});},'VoiceQueuesChannel':function(_0x179216){var _0x1cdc97=this;return new Promise(function(_0x48b284,_0x1cd0df){var _0x3ae9aa=schema(properties[_0xd236('0x7c')])['validate'](_0x179216);if(_0x3ae9aa['length']>0x0){return _0x1cd0df(_0x1cdc97['error'](0x1f4,_[_0xd236('0x62')](_0x3ae9aa,'message')['join'](',\x20')));}var _0x273b4e=_[_0xd236('0x63')](_0x56bc88[_0xd236('0x7b')],{'uniqueid':_0x179216[_0xd236('0x72')]});if(_0x273b4e){_0x48b284(_0x273b4e);}else{return _0x1cd0df(_0x1cdc97['error'](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannelHangup':function(_0xd52822){var _0x46ed28=this;return new Promise(function(_0x4d1ba5,_0x33e00b){if(ami[_0xd236('0x11')]()==![]){return _0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config[_0xd236('0x13')]['username'],'ami\x20disconnected'][_0xd236('0x16')]('\x20')));}var _0x4ff84b=schema(properties[_0xd236('0x7d')])[_0xd236('0x2')](_0xd52822);if(_0x4ff84b[_0xd236('0x60')]>0x0){return _0x33e00b(_0x46ed28['error'](0x1f4,_[_0xd236('0x62')](_0x4ff84b,_0xd236('0x1c'))['join'](',\x20')));}var _0x2af800=_[_0xd236('0x63')](_0x56bc88['queueChannels'],{'uniqueid':_0xd52822[_0xd236('0x72')]});if(_0x2af800&&_0x2af800[_0xd236('0x68')]){return ami['Action']({'action':'Hangup','channel':_0x2af800[_0xd236('0x68')]})[_0xd236('0x6a')](function(_0x4ae910){_0x4d1ba5({'code':0xc8,'message':[_0xd52822[_0xd236('0x72')],_0x4ae910['message'][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')});})['catch'](function(_0x26f817){_0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f5,[_0xd52822['uniqueid'],_0x26f817[_0xd236('0x1c')]['toLowerCase']()][_0xd236('0x16')]('\x20')));});}else{return _0x33e00b(_0x46ed28[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'VoiceQueuesChannelRedirect':function(_0x1f09a0){var _0x5bbb22=this;return new Promise(function(_0x53fe9a,_0x2f31aa){if(ami['isConnected']()==![]){return _0x2f31aa(_0x5bbb22[_0xd236('0x12')](0x1f4,[config[_0xd236('0x13')]['ip'],config['asterisk'][_0xd236('0x14')],_0xd236('0x15')]['join']('\x20')));}var _0x14d8cf=schema(properties[_0xd236('0x7e')])[_0xd236('0x2')](_0x1f09a0);if(_0x14d8cf['length']>0x0){return _0x2f31aa(_0x5bbb22['error'](0x1f4,_[_0xd236('0x62')](_0x14d8cf,_0xd236('0x1c'))[_0xd236('0x16')](',\x20')));}var _0x1be4dc=_['find'](_0x56bc88[_0xd236('0x7b')],{'uniqueid':_0x1f09a0['uniqueid']});if(_0x1be4dc&&_0x1be4dc['channel']){return ami[_0xd236('0x1f')]({'action':'Redirect','channel':_0x1be4dc[_0xd236('0x68')],'exten':_0x1f09a0['exten'],'context':_0x1f09a0[_0xd236('0x7f')]||_0x1be4dc[_0xd236('0x7f')],'priority':0x1})[_0xd236('0x6a')](function(_0x8a1a59){_0x53fe9a({'code':0xc8,'message':[_0x1f09a0[_0xd236('0x72')],_0x8a1a59['message'][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')});})[_0xd236('0x74')](function(_0x266aa2){_0x2f31aa(_0x5bbb22['error'](0x1f5,[_0x1f09a0[_0xd236('0x72')],_0x266aa2[_0xd236('0x1c')][_0xd236('0x6c')]()][_0xd236('0x16')]('\x20')));});}else{return _0x2f31aa(_0x5bbb22[_0xd236('0x12')](0x1f5,_0xd236('0x7a')));}});},'Agents':function(_0x410f52){return new Promise(function(_0x5d17fd,_0xb64a46){var _0x1aab34=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0xd')]);_0x5d17fd({'count':_0x1aab34['length'],'rows':_0x1aab34});});},'Telephones':function(_0x1df939){return new Promise(function(_0x2b6c30,_0x2546d2){var _0x2fcd31=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x80')]);_0x2b6c30({'count':_0x2fcd31[_0xd236('0x60')],'rows':_0x2fcd31});});},'Trunks':function(_0x4a4339){return new Promise(function(_0x4d1357,_0x49bd98){var _0x3823ca=_[_0xd236('0x5e')](_0x56bc88['trunks']);_0x4d1357({'count':_0x3823ca[_0xd236('0x60')],'rows':_0x3823ca});});},'OutboundChannels':function(_0x45d4fb){return new Promise(function(_0x6f16c6,_0x1f3eac){var _0x4a222d=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x81')]);_0x6f16c6({'count':_0x4a222d[_0xd236('0x60')],'rows':_0x4a222d});});},'Outbound':function(_0x45a3b5){return new Promise(function(_0x3d6705,_0x2d3af4){_0x3d6705(_0x56bc88[_0xd236('0x32')]);});},'Campaigns':function(_0x19289f){return new Promise(function(_0x38ec5c,_0x50d84b){var _0x4d5720=_[_0xd236('0x5e')](_0x56bc88[_0xd236('0x82')]);_0x38ec5c({'count':_0x4d5720['length'],'rows':_0x4d5720});});},'VoiceQueuesPreview':function(_0x1401eb){var _0xa2ad92=this;return new Promise(function(_0x5849ea,_0x8067){_0x234912['run'](_0x1401eb['id'])['then'](function(_0x470133){_0x5849ea({'code':0xc8,'message':_0x470133[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x51bd3d){_0x8067(_0xa2ad92[_0xd236('0x12')](0x1f4,_0x51bd3d[_0xd236('0x1c')]));});});},'EventManager':function(_0x4767e8){var _0x159d95=this;return new Promise(function(_0xe2c327,_0x30cabd){if(!_0x4767e8['event']){return _0x30cabd(_0x159d95[_0xd236('0x12')](0x1f4,_0xd236('0x83')));}ami[_0xd236('0x84')](_0xd236('0x85')+_0x4767e8['event'],_0x4767e8[_0xd236('0x1c')]);_0xe2c327({'code':0xc8,'message':_0x4767e8});});},'FaxAccounts':function(_0x1250a8){return new Promise(function(_0x3a5218,_0x4312bd){var _0x32969e=_['values'](_0x56bc88[_0xd236('0x86')]);_0x3a5218({'count':_0x32969e[_0xd236('0x60')],'rows':_0x32969e});});},'SendFax':function(_0x3f0914){var _0x55b52d=this;return new Promise(function(_0xf08595,_0x5928cc){_0x29a67c['send'](_0x3f0914)[_0xd236('0x6a')](function(_0x36a924){_0xf08595({'code':0xc8,'message':_0x36a924[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x407cd8){_0x5928cc(_0x55b52d[_0xd236('0x12')](0x1f4,_0x407cd8['message']));});});},'CheckAfterSend':function(_0x40b911){var _0x22d3b7=this;return new Promise(function(_0x5de836,_0x5a84e2){_0x29a67c[_0xd236('0x87')](_0x40b911)['then'](function(_0x3384eb){_0x5de836({'code':0xc8,'message':_0x3384eb[_0xd236('0x1c')]});})[_0xd236('0x74')](function(_0x5846ac){_0x5a84e2(_0x22d3b7[_0xd236('0x12')](0x1f4,_0x5846ac[_0xd236('0x1c')]));});});}};var _0x1795dc=jayson[_0xd236('0x88')](_0x58c59e)[_0xd236('0x89')]();_0x1795dc['on'](_0xd236('0x12'),function(_0x336a91){return _0x1aedc6(_0x336a91);});_0x1795dc[_0xd236('0x8a')](0x232a,_0xd236('0x8b'),function(){console['log'](_0xd236('0x8c'),0x232a);return _0x75d84c(_0xd236('0x8d')+0x232a);});});}; \ No newline at end of file +var _0x6596=['erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','map','channels','uniqueid','channel','filename','wav','ai(mixmonitorid)','then','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','catch','message','ami\x20disconnected','command','Command','Action','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x2e009c,_0x545a00){var _0x27bf9c=function(_0x348c59){while(--_0x348c59){_0x2e009c['push'](_0x2e009c['shift']());}};_0x27bf9c(++_0x545a00);}(_0x6596,0x1d3));var _0x6659=function(_0x5770c5,_0x5f4ee1){_0x5770c5=_0x5770c5-0x0;var _0x3cf2a9=_0x6596[_0x5770c5];return _0x3cf2a9;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var jayson=require('jayson/promise');var schema=require(_0x6659('0x2'));var BPromise=require(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var config=require(_0x6659('0x5'));var properties=require(_0x6659('0x6'));var ami=require(_0x6659('0x7'));exports['listen']=function(_0x483945,_0x7edf11,_0x3091f1){return new BPromise(function(_0xd6bf59,_0x1ed458){var _0x29292b={'QueuePause':function(_0x4a900d){return new Promise(function(_0x485ea0,_0x24bfdf){var _0x7b07d5=util[_0x6659('0x8')](_0x6659('0x9'),_0x6659('0xa'),_0x4a900d[_0x6659('0xb')]);if(_0x483945['timers']&&_0x483945[_0x6659('0xc')][_0x7b07d5]&&_0x483945['timers'][_0x7b07d5]['timer']){_0x483945[_0x6659('0xc')][_0x7b07d5]['updateAcw']();}if(_0x483945[_0x6659('0xd')][_0x7b07d5]){_0x483945[_0x6659('0xd')][_0x7b07d5][_0x6659('0xe')]({'statePause':_0x4a900d[_0x6659('0xf')]?!![]:![]});}_0x485ea0({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3d68c5){var _0x329ebc=this;return new Promise(function(_0x518769,_0x2b3118){if(ami[_0x6659('0x10')]()==![]){return _0x2b3118(_0x329ebc[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}_0x3d68c5=_[_0x6659('0x15')](_0x3d68c5,_[_0x6659('0x16')](properties[_0x6659('0x17')]));_0x3d68c5[_0x6659('0x18')]=_0x6659('0x19');return ami['Action'](_0x3d68c5)['then'](function(_0x441d6d){_0x518769({'code':0xc8,'message':_0x441d6d['message']});})[_0x6659('0x1a')](function(_0x38e4d6){_0x2b3118(_0x329ebc['error'](0x1f5,_0x38e4d6[_0x6659('0x1b')]));});});},'Command':function(_0x5253e5){var _0xa5e094=this;return new Promise(function(_0x1dc4f1,_0x522f2e){if(ami[_0x6659('0x10')]()==![]){return _0x522f2e(_0xa5e094[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}_0x5253e5=_['pick'](_0x5253e5,_0x6659('0x1d'));_0x5253e5[_0x6659('0x18')]=_0x6659('0x1e');return ami[_0x6659('0x1f')](_0x5253e5)['then'](function(_0x4ce553){_0x1dc4f1({'code':0xc8,'message':_0x4ce553['content']});})['catch'](function(_0xbad53f){_0x522f2e(_0xa5e094[_0x6659('0x11')](0x1f5,_0xbad53f[_0x6659('0x1b')]));});});},'VoiceQueues':function(_0x6fc27){return new Promise(function(_0x45effc,_0x12b218){var _0x436691=[];for(var _0x3cb0dc in _0x483945[_0x6659('0x20')]){if(_0x483945['voiceQueues'][_0x6659('0x21')](_0x3cb0dc)){var _0x373a3d=_0x483945[_0x6659('0x20')][_0x3cb0dc];var _0x4866e0={'id':_0x373a3d['id'],'name':_0x373a3d['name'],'strategy':_0x373a3d[_0x6659('0x22')],'answered':_0x373a3d[_0x6659('0x23')],'available':_0x373a3d['available'],'loggedIn':_0x373a3d[_0x6659('0x24')],'pTalking':_0x373a3d[_0x6659('0x25')],'sumBillable':_0x373a3d[_0x6659('0x26')],'sumDuration':_0x373a3d[_0x6659('0x27')],'sumHoldTime':_0x373a3d[_0x6659('0x28')]||0x0,'talking':_0x373a3d['talking'],'total':_0x373a3d[_0x6659('0x29')],'type':_0x373a3d[_0x6659('0x2a')],'unmanaged':_0x373a3d[_0x6659('0x2b')],'abandoned':_0x373a3d[_0x6659('0x2c')],'waiting':_0x373a3d[_0x6659('0x2d')],'loggedInDb':_0x373a3d['loggedInDb']};if(_0x373a3d[_0x6659('0x2a')]===_0x6659('0x2e')){_0x4866e0[_0x6659('0x2f')]=_0x373a3d[_0x6659('0x2f')];_0x4866e0[_0x6659('0x30')]=_0x373a3d[_0x6659('0x30')];_0x4866e0[_0x6659('0x31')]=_0x373a3d['dialOriginateCallerIdName'];_0x4866e0[_0x6659('0x32')]=_0x373a3d[_0x6659('0x32')];_0x4866e0['dialOriginateTimeout']=_0x373a3d[_0x6659('0x33')];_0x4866e0['dialPrefix']=_0x373a3d[_0x6659('0x34')];_0x4866e0['temp']=_0x373a3d[_0x6659('0x35')];_0x4866e0[_0x6659('0x36')]=_0x373a3d['outboundAnswerAgiCallsDay'];_0x4866e0['outboundAnswerCallsDay']=_0x373a3d[_0x6659('0x37')];_0x4866e0['outboundBlacklistCallsDay']=_0x373a3d[_0x6659('0x38')];_0x4866e0['outboundBusyCallsDay']=_0x373a3d[_0x6659('0x39')];_0x4866e0['outboundCongestionCallsDay']=_0x373a3d[_0x6659('0x3a')];_0x4866e0[_0x6659('0x3b')]=_0x373a3d['outboundDropCallsDayACS'];_0x4866e0[_0x6659('0x3c')]=_0x373a3d[_0x6659('0x3c')];_0x4866e0[_0x6659('0x3d')]=_0x373a3d[_0x6659('0x3d')];_0x4866e0[_0x6659('0x3e')]=_0x373a3d['outboundNoAnswerCallsDay'];_0x4866e0[_0x6659('0x3f')]=_0x373a3d['outboundNoSuchCallsDay'];_0x4866e0['outboundOriginateFailureCallsDay']=_0x373a3d[_0x6659('0x40')];_0x4866e0[_0x6659('0x41')]=_0x373a3d[_0x6659('0x41')];_0x4866e0['outboundRejectCallsDay']=_0x373a3d[_0x6659('0x42')];_0x4866e0['outboundUnknownCallsDay']=_0x373a3d['outboundUnknownCallsDay'];_0x4866e0[_0x6659('0x43')]=_0x373a3d[_0x6659('0x43')];_0x4866e0[_0x6659('0x44')]=_0x373a3d[_0x6659('0x44')];_0x4866e0[_0x6659('0x45')]=_0x373a3d[_0x6659('0x45')];_0x4866e0[_0x6659('0x46')]=_0x373a3d['predictiveIntervalDroppedCallsCallersExit'];_0x4866e0['predictiveIntervalDroppedCallsTimeout']=_0x373a3d[_0x6659('0x47')];_0x4866e0[_0x6659('0x48')]=_0x373a3d[_0x6659('0x48')];_0x4866e0['predictiveIntervalErlangCallsDroppedCalls']=_0x373a3d[_0x6659('0x49')];_0x4866e0[_0x6659('0x4a')]=_0x373a3d['predictiveIntervalHitRate'];_0x4866e0[_0x6659('0x4b')]=_0x373a3d[_0x6659('0x4b')];_0x4866e0[_0x6659('0x4c')]=_0x373a3d[_0x6659('0x4c')];_0x4866e0[_0x6659('0x4d')]=_0x373a3d['predictiveIntervalAvailable'];_0x4866e0['predictiveIntervalTotalCalls']=_0x373a3d['predictiveIntervalTotalCalls'];_0x4866e0['message']=_0x373a3d[_0x6659('0x1b')];_0x4866e0['originated']=_0x373a3d['originated'];_0x4866e0[_0x6659('0x4e')]=_0x373a3d[_0x6659('0x4e')];_0x4866e0['erlangCallToSecond']=_0x373a3d[_0x6659('0x4f')];_0x4866e0[_0x6659('0x50')]=_0x373a3d['erlangAbandonmentRate'];_0x4866e0[_0x6659('0x51')]=_0x373a3d[_0x6659('0x51')];_0x4866e0[_0x6659('0x52')]=_0x373a3d[_0x6659('0x52')];_0x4866e0['startProgressive']=_0x373a3d[_0x6659('0x53')];}if(_0x373a3d['Trunk']){_0x4866e0[_0x6659('0x54')]={'id':_0x373a3d[_0x6659('0x54')]['id'],'name':_0x373a3d[_0x6659('0x54')][_0x6659('0xb')],'active':_0x373a3d[_0x6659('0x54')][_0x6659('0x55')],'callerid':_0x373a3d['Trunk']['callerid']};}if(_0x373a3d[_0x6659('0x56')]){_0x4866e0[_0x6659('0x56')]={'id':_0x373a3d[_0x6659('0x56')]['id'],'name':_0x373a3d[_0x6659('0x56')][_0x6659('0xb')]};}_0x436691[_0x6659('0x57')](_0x4866e0);}}_0x45effc({'count':_0x436691[_0x6659('0x58')],'rows':_0x436691});});},'UpdateVoiceQueue':function(_0x358f15){return new Promise(function(_0x3077a8,_0x440c7c){var _0x529f35=_[_0x6659('0x59')](_0x483945['voiceQueues'],{'id':parseInt(_0x358f15['id'])});var _0x104d61=_[_0x6659('0x5a')](_0x358f15,['id']);if(_0x529f35){for(var _0x577d7f in _0x104d61){if(typeof _0x104d61[_0x577d7f]!==_0x6659('0x5b')&&typeof _0x529f35[_0x577d7f]!==_0x6659('0x5b')){_0x529f35[_0x577d7f]=_0x104d61[_0x577d7f];}}_0x3077a8(_0x529f35);}else{_0x440c7c();}});},'VoiceChannels':function(_0x5cfef5){return new Promise(function(_0x2cbd80,_0x345313){var _0x6e0e41=_[_0x6659('0x5c')](_0x483945['channels']);_0x2cbd80({'count':_0x6e0e41['length'],'rows':_0x6e0e41});});},'VoiceChannelMixMonitor':function(_0x1832cc){var _0x268e06=this;return new Promise(function(_0x2c4c0e,_0x29f7f1){if(ami[_0x6659('0x10')]()==![]){return _0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}var _0x29e7cc=schema(properties['voicechannel'])[_0x6659('0x2')](_0x1832cc);if(_0x29e7cc[_0x6659('0x58')]>0x0){return _0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f4,_[_0x6659('0x5d')](_0x29e7cc,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x4686d3=_[_0x6659('0x59')](_0x483945[_0x6659('0x5e')],{'uniqueid':_0x1832cc[_0x6659('0x5f')]});if(_0x4686d3&&_0x4686d3[_0x6659('0x60')]){var _0x499c47=util['format']('%s.%s',_0x1832cc[_0x6659('0x61')]||_0x1832cc[_0x6659('0x5f')],_0x1832cc['format']||_0x6659('0x62'));return ami[_0x6659('0x1f')]({'action':'MixMonitor','channel':_0x4686d3[_0x6659('0x60')],'file':_0x499c47,'options':_0x6659('0x63')})[_0x6659('0x64')](function(_0x4f9abf){var _0xf2348f=_['find'](_0x4686d3['monitors'],{'filename':_0x6659('0x65')+_0x499c47[_0x6659('0x66')]()});if(_[_0x6659('0x67')](_0xf2348f)){_0x4686d3[_0x6659('0x68')][_0x6659('0x57')]({'filename':_0x6659('0x65')+_0x499c47[_0x6659('0x66')](),'createdAt':moment()[_0x6659('0x8')](_0x6659('0x69')),'mixmonitorid':_0x4f9abf[_0x6659('0x6a')],'status':_0x6659('0x6b')});}else{_0xf2348f[_0x6659('0x6a')]=_0x4f9abf[_0x6659('0x6a')];_0xf2348f['status']=_0x6659('0x6b');}_0x2c4c0e({'code':0xc8,'message':[_0x1832cc[_0x6659('0x5f')],'MixMonitor\x20Success',_0x4f9abf[_0x6659('0x6a')]][_0x6659('0x14')]('\x20'),'mixmonitorid':_0x4f9abf[_0x6659('0x6a')]});})['catch'](function(_0x21a365){_0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f5,[_0x1832cc[_0x6659('0x5f')],_0x21a365[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x29f7f1(_0x268e06['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x35ac7d){var _0x316cb0=this;return new Promise(function(_0x230e61,_0x479178){if(ami[_0x6659('0x10')]()==![]){return _0x479178(_0x316cb0[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}var _0x55db3e=schema(properties['voicechannel'])['validate'](_0x35ac7d);if(_0x55db3e['length']>0x0){return _0x479178(_0x316cb0['error'](0x1f4,_['map'](_0x55db3e,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x13f31d=_['find'](_0x483945[_0x6659('0x5e')],{'uniqueid':_0x35ac7d[_0x6659('0x5f')]});if(_0x13f31d){return BPromise['resolve']()[_0x6659('0x64')](function(){if(_0x13f31d[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x6d'),'channel':_0x13f31d['channel'],'mixmonitorid':_0x35ac7d[_0x6659('0x6a')]})[_0x6659('0x1a')](function(_0x1162e8){});}})[_0x6659('0x64')](function(){if(_0x13f31d[_0x6659('0x6e')]){return ami[_0x6659('0x1f')]({'action':'StopMixMonitor','channel':_0x13f31d[_0x6659('0x6e')],'mixmonitorid':_0x35ac7d[_0x6659('0x6a')]})[_0x6659('0x1a')](function(_0x23ba92){});}})['then'](function(_0x34b12e){var _0x4a551d=_['find'](_0x13f31d[_0x6659('0x68')],{'mixmonitorid':_0x35ac7d['mixmonitorid']});if(_0x4a551d){_0x4a551d[_0x6659('0x6f')]=_0x6659('0x70');}})['then'](function(){var _0x3977be=util[_0x6659('0x8')](_0x6659('0x71'),_0x35ac7d['filename']||_0x35ac7d[_0x6659('0x5f')],_0x35ac7d[_0x6659('0x8')]||_0x6659('0x62'));var _0x4c2b65=_['find'](_0x13f31d[_0x6659('0x68')],{'filename':_0x6659('0x65')+_0x3977be[_0x6659('0x66')]()});if(_0x4c2b65){_0x4c2b65['status']=_0x6659('0x70');}})[_0x6659('0x64')](function(){_0x230e61({'code':0xc8,'message':[_0x35ac7d[_0x6659('0x5f')],_0x6659('0x72')][_0x6659('0x14')]('\x20')});})[_0x6659('0x1a')](function(_0x1fcf50){_0x479178(_0x316cb0['error'](0x1f5,[_0x35ac7d[_0x6659('0x5f')],_0x1fcf50[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x479178(_0x316cb0['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannels':function(_0x50b75e){return new Promise(function(_0x466210,_0x4cb1aa){var _0x1027b4=_[_0x6659('0x5c')](_0x483945['queueChannels']);_0x466210({'count':_0x1027b4['length'],'rows':_0x1027b4});});},'VoiceQueuesChannel':function(_0x58755b){var _0x42e469=this;return new Promise(function(_0x58220d,_0x4e7e3e){var _0x445d9b=schema(properties[_0x6659('0x73')])[_0x6659('0x2')](_0x58755b);if(_0x445d9b[_0x6659('0x58')]>0x0){return _0x4e7e3e(_0x42e469['error'](0x1f4,_[_0x6659('0x5d')](_0x445d9b,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x6d5339=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x58755b[_0x6659('0x5f')]});if(_0x6d5339){_0x58220d(_0x6d5339);}else{return _0x4e7e3e(_0x42e469['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x55a3a9){var _0x2cf584=this;return new Promise(function(_0x27fbf7,_0x5d0a46){if(ami['isConnected']()==![]){return _0x5d0a46(_0x2cf584[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')]['username'],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}var _0x2704e8=schema(properties['voicequeuechannelhangup'])[_0x6659('0x2')](_0x55a3a9);if(_0x2704e8[_0x6659('0x58')]>0x0){return _0x5d0a46(_0x2cf584['error'](0x1f4,_['map'](_0x2704e8,_0x6659('0x1b'))['join'](',\x20')));}var _0x445fa8=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x55a3a9[_0x6659('0x5f')]});if(_0x445fa8&&_0x445fa8[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x75'),'channel':_0x445fa8[_0x6659('0x60')]})[_0x6659('0x64')](function(_0x24b310){_0x27fbf7({'code':0xc8,'message':[_0x55a3a9[_0x6659('0x5f')],_0x24b310[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')});})[_0x6659('0x1a')](function(_0x472485){_0x5d0a46(_0x2cf584[_0x6659('0x11')](0x1f5,[_0x55a3a9[_0x6659('0x5f')],_0x472485[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x5d0a46(_0x2cf584['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x43a607){var _0x39bd7d=this;return new Promise(function(_0x55e3e1,_0x1c6bff){if(ami[_0x6659('0x10')]()==![]){return _0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}var _0x4f2c4f=schema(properties[_0x6659('0x76')])[_0x6659('0x2')](_0x43a607);if(_0x4f2c4f[_0x6659('0x58')]>0x0){return _0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f4,_['map'](_0x4f2c4f,'message')[_0x6659('0x14')](',\x20')));}var _0x1cf948=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x43a607[_0x6659('0x5f')]});if(_0x1cf948&&_0x1cf948[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x77'),'channel':_0x1cf948[_0x6659('0x60')],'exten':_0x43a607[_0x6659('0x78')],'context':_0x43a607[_0x6659('0x79')]||_0x1cf948['context'],'priority':0x1})[_0x6659('0x64')](function(_0x52eee1){_0x55e3e1({'code':0xc8,'message':[_0x43a607[_0x6659('0x5f')],_0x52eee1[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')});})['catch'](function(_0x373c74){_0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f5,[_0x43a607[_0x6659('0x5f')],_0x373c74['message'][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x1c6bff(_0x39bd7d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2637b2){return new Promise(function(_0x42dffc,_0x58631d){var _0x38f9d8=_[_0x6659('0x5c')](_0x483945['agents']);_0x42dffc({'count':_0x38f9d8[_0x6659('0x58')],'rows':_0x38f9d8});});},'Telephones':function(_0x10a6e5){return new Promise(function(_0x3a5530,_0x597b0a){var _0x3abac8=_[_0x6659('0x5c')](_0x483945[_0x6659('0x7a')]);_0x3a5530({'count':_0x3abac8['length'],'rows':_0x3abac8});});},'Trunks':function(_0x1aeebc){return new Promise(function(_0x4e91b6,_0x5e8a39){var _0x5b0e0d=_[_0x6659('0x5c')](_0x483945['trunks']);_0x4e91b6({'count':_0x5b0e0d[_0x6659('0x58')],'rows':_0x5b0e0d});});},'OutboundChannels':function(_0x51f147){return new Promise(function(_0x339a4b,_0x3aabe9){var _0x377f91=_[_0x6659('0x5c')](_0x483945[_0x6659('0x7b')]);_0x339a4b({'count':_0x377f91['length'],'rows':_0x377f91});});},'Outbound':function(_0x52a25e){return new Promise(function(_0x2d8ffd,_0x5589e5){_0x2d8ffd(_0x483945[_0x6659('0x2e')]);});},'Campaigns':function(_0x257235){return new Promise(function(_0x460916,_0x23fe5b){var _0x17222b=_['values'](_0x483945[_0x6659('0x7c')]);_0x460916({'count':_0x17222b['length'],'rows':_0x17222b});});},'VoiceQueuesPreview':function(_0x3653ca){var _0x3b7f51=this;return new Promise(function(_0x5cd96a,_0x5f259a){_0x7edf11[_0x6659('0x7d')](_0x3653ca['id'])[_0x6659('0x64')](function(_0x407371){_0x5cd96a({'code':0xc8,'message':_0x407371[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x140261){_0x5f259a(_0x3b7f51[_0x6659('0x11')](0x1f4,_0x140261[_0x6659('0x1b')]));});});},'EventManager':function(_0x47b382){var _0x14ee7b=this;return new Promise(function(_0xb58af9,_0x33c6d9){if(!_0x47b382[_0x6659('0x7e')]){return _0x33c6d9(_0x14ee7b[_0x6659('0x11')](0x1f4,_0x6659('0x7f')));}ami['emit'](_0x6659('0x80')+_0x47b382['event'],_0x47b382[_0x6659('0x1b')]);_0xb58af9({'code':0xc8,'message':_0x47b382});});},'FaxAccounts':function(_0x3bd970){return new Promise(function(_0x590b7c,_0x3b0534){var _0x188807=_[_0x6659('0x5c')](_0x483945[_0x6659('0x81')]);_0x590b7c({'count':_0x188807[_0x6659('0x58')],'rows':_0x188807});});},'SendFax':function(_0x3fcf16){var _0x21fd8d=this;return new Promise(function(_0x22415c,_0x3b1dcf){_0x3091f1[_0x6659('0x82')](_0x3fcf16)['then'](function(_0x2ddc13){_0x22415c({'code':0xc8,'message':_0x2ddc13[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x1265b0){_0x3b1dcf(_0x21fd8d[_0x6659('0x11')](0x1f4,_0x1265b0[_0x6659('0x1b')]));});});},'CheckAfterSend':function(_0x2c5caf){var _0xfa0367=this;return new Promise(function(_0x43bb74,_0x1642fd){_0x3091f1[_0x6659('0x83')](_0x2c5caf)[_0x6659('0x64')](function(_0x310958){_0x43bb74({'code':0xc8,'message':_0x310958[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x350e91){_0x1642fd(_0xfa0367[_0x6659('0x11')](0x1f4,_0x350e91[_0x6659('0x1b')]));});});}};var _0x4b7f92=jayson[_0x6659('0x84')](_0x29292b)[_0x6659('0x85')]();_0x4b7f92['on']('error',function(_0x46cc91){return _0x1ed458(_0x46cc91);});_0x4b7f92[_0x6659('0x86')](0x232a,_0x6659('0x87'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xd6bf59(_0x6659('0x88')+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 0836d24..e9baf95 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 _0xf3cd=['isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','getContacts','then'];(function(_0x4ff0a6,_0x6c0a3b){var _0x440b4e=function(_0x1a712b){while(--_0x1a712b){_0x4ff0a6['push'](_0x4ff0a6['shift']());}};_0x440b4e(++_0x6c0a3b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xf3cd[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xdf3c('0x0'));var BPromise=require(_0xdf3c('0x1'));var Redis=require(_0xdf3c('0x2'));var util=require(_0xdf3c('0x3'));var config=require(_0xdf3c('0x4'));var logger=require(_0xdf3c('0x5'))('trigger');var cmContactRpc=require(_0xdf3c('0x6'));config[_0xdf3c('0x7')]=_[_0xdf3c('0x8')](config['redis'],{'host':_0xdf3c('0x9'),'port':0x18eb});var io=require(_0xdf3c('0xa'))(new Redis(config[_0xdf3c('0x7')]));function emit(_0x1f0601,_0x106021,_0x28edae,_0x52c073,_0x15705d){logger['info']('[CM][%s][%s]',_0x1f0601,_0x106021['id'],_0x28edae,_0x52c073,JSON[_0xdf3c('0xb')](_0x15705d));io['to'](_0x28edae)[_0xdf3c('0xc')](_0x52c073,_0x15705d);}exports['exec']=function(_0x1dba4c,_0x205f33,_0x2d420c,_0x21a6e5){var _0x3a3154,_0x1c456b;var _0xf7da9d={};var _0x32d2db=Number(_0x2d420c['data1']);var _0x1d483c=_0x2d420c[_0xdf3c('0xd')]?Boolean(Number(_0x2d420c[_0xdf3c('0xd')])):![];var _0x17319c;var _0x59e431=![];if(!_[_0xdf3c('0xe')](_0x2d420c[_0xdf3c('0xf')])){if(_0x2d420c[_0xdf3c('0xf')]=='1')_0x59e431=!![];}if(!_0x59e431){if(_0x21a6e5['xmd-contactid']){_0xf7da9d['id']=_0x21a6e5[_0xdf3c('0x10')];}}if(!_0xf7da9d['id']){_0xf7da9d[_0xdf3c('0x11')]=_0x32d2db;_0x17319c=_0x2d420c[_0xdf3c('0x12')]&&_0x2d420c[_0xdf3c('0x12')]!=='0'?_0x2d420c[_0xdf3c('0x12')][_0xdf3c('0x13')](','):[_0xdf3c('0x14')];_0xf7da9d[_0xdf3c('0x15')]=_[_0xdf3c('0x16')](_0x17319c,function(_0x5d3991){var _0x54cdd4={};_0x54cdd4[_0x5d3991]=_0x21a6e5[_0xdf3c('0x17')]?_0x21a6e5[_0xdf3c('0x18')]:_0x21a6e5[_0xdf3c('0x19')];return _0x54cdd4;});}var _0x18d4ec=['id',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x14'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),_0xdf3c('0x11'),_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20')];var _0x5d2390=_['union'](_0x18d4ec,_0x17319c);BPromise[_0xdf3c('0x21')]()['then'](cmContactRpc[_0xdf3c('0x22')]({'attributes':_0x5d2390,'where':_0xf7da9d}))[_0xdf3c('0x23')](function(_0x36552e){_0x1c456b=_0x36552e;if(!_[_0xdf3c('0x24')](_0x1c456b)){if(_0x1c456b[_0xdf3c('0x25')]===0x1){_0x3a3154=_0x1c456b[0x0];logger[_0xdf3c('0x26')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}else{logger[_0xdf3c('0x26')](_0xdf3c('0x28'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_[_0xdf3c('0x16')](_0x1c456b,'id')[_0xdf3c('0x29')](','));}return;}else{logger[_0xdf3c('0x26')](_0xdf3c('0x2a'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id']);var _0x1adee4={'ListId':_0x32d2db};var _0x4c076c=_0x2d420c[_0xdf3c('0x2b')]&&_0x2d420c[_0xdf3c('0x2b')]!=='0'?_0x2d420c['data4']:_0xdf3c('0x14');if(_0x1d483c){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5['calleridnum']:_0x21a6e5['destcalleridnum'];if(_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5[_0xdf3c('0x2c')]&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2c')]:'Unknown';}else{_0x1adee4['firstName']=_0x21a6e5[_0xdf3c('0x2e')]&&_0x21a6e5[_0xdf3c('0x2e')]!==_0xdf3c('0x2d')?_0x21a6e5['destcalleridname']:_0xdf3c('0x2f');}return BPromise[_0xdf3c('0x21')]()[_0xdf3c('0x23')](cmContactRpc[_0xdf3c('0x30')](_0x1adee4))['then'](function(_0xda0de0){_0x3a3154=_0xda0de0;_0x1c456b[_0xdf3c('0x31')](_0xda0de0);if(_0x3a3154){logger['info'](_0xdf3c('0x32'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}return;});}else{logger[_0xdf3c('0x26')](_0xdf3c('0x33'),_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5[_0xdf3c('0x19')]:_0x21a6e5[_0xdf3c('0x18')];if(_['isNil'](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5['calleridname']&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5['calleridname']:_0xdf3c('0x2f');}else{_0x1adee4['firstName']=_0x21a6e5['destcalleridname']&&_0x21a6e5['destcalleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2e')]:_0xdf3c('0x2f');}_0x3a3154=_0x1adee4;_0x1c456b[_0xdf3c('0x31')](_0x1adee4);return;}}})['then'](function(){if(_0x1dba4c){emit(_0x21a6e5['uniqueid'],_0x205f33,util[_0xdf3c('0x34')]('user:%s',_0x1dba4c[_0xdf3c('0x35')]),util[_0xdf3c('0x34')](_0xdf3c('0x36'),_0x2d420c[_0xdf3c('0x37')][_0xdf3c('0x38')]()),{'evt':_[_0xdf3c('0x39')](_0x21a6e5,{'autoCreate':_0x1d483c}),'contact':_0x3a3154===undefined?{}:_0x3a3154,'contacts':_0x1c456b[_0xdf3c('0x25')]===0x0?undefined:_0x1c456b});}});}; \ No newline at end of file +var _0xe14d=['xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xe14d,0x1ee));var _0xde14=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xe14d[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xde14('0x0'));var BPromise=require(_0xde14('0x1'));var Redis=require(_0xde14('0x2'));var util=require(_0xde14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xde14('0x4'))(_0xde14('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xde14('0x6')]=_[_0xde14('0x7')](config[_0xde14('0x6')],{'host':_0xde14('0x8'),'port':0x18eb});var io=require(_0xde14('0x9'))(new Redis(config[_0xde14('0x6')]));function emit(_0x4b1f6b,_0x5a1344,_0x1bd49d,_0x115b7d,_0x2b0e7c){logger[_0xde14('0xa')](_0xde14('0xb'),_0x4b1f6b,_0x5a1344['id'],_0x1bd49d,_0x115b7d,JSON[_0xde14('0xc')](_0x2b0e7c));io['to'](_0x1bd49d)[_0xde14('0xd')](_0x115b7d,_0x2b0e7c);}exports[_0xde14('0xe')]=function(_0x4b2b15,_0x1a7167,_0xe785fb,_0x417269){var _0x4357c7,_0x8e0e;var _0x30a4c4={};var _0x1a1c32=Number(_0xe785fb[_0xde14('0xf')]);var _0x34e28f=_0xe785fb[_0xde14('0x10')]?Boolean(Number(_0xe785fb[_0xde14('0x10')])):![];var _0x464624;var _0x3521d4=![];if(!_[_0xde14('0x11')](_0xe785fb[_0xde14('0x12')])){if(_0xe785fb['data5']=='1')_0x3521d4=!![];}if(!_0x3521d4){if(_0x417269['xmd-contactid']){_0x30a4c4['id']=_0x417269[_0xde14('0x13')];}}if(!_0x30a4c4['id']){_0x30a4c4[_0xde14('0x14')]=_0x1a1c32;_0x464624=_0xe785fb[_0xde14('0x15')]&&_0xe785fb['data3']!=='0'?_0xe785fb[_0xde14('0x15')][_0xde14('0x16')](','):[_0xde14('0x17')];_0x30a4c4[_0xde14('0x18')]=_[_0xde14('0x19')](_0x464624,function(_0x1b9d4b){var _0x29e243={};_0x29e243[_0x1b9d4b]=_0x417269[_0xde14('0x1a')]?_0x417269[_0xde14('0x1b')]:_0x417269[_0xde14('0x1c')];return _0x29e243;});}var _0x590a8b=['id',_0xde14('0x1d'),_0xde14('0x1e'),_0xde14('0x17'),_0xde14('0x1f'),'fax',_0xde14('0x14'),'createdAt',_0xde14('0x20'),'updatedAt'];var _0xa50687=_[_0xde14('0x21')](_0x590a8b,_0x464624);BPromise[_0xde14('0x22')]()[_0xde14('0x23')](cmContactRpc[_0xde14('0x24')]({'attributes':_0xa50687,'where':_0x30a4c4}))[_0xde14('0x23')](function(_0x40b648){_0x8e0e=_0x40b648;if(!_[_0xde14('0x25')](_0x8e0e)){if(_0x8e0e[_0xde14('0x26')]===0x1){_0x4357c7=_0x8e0e[0x0];logger[_0xde14('0xa')](_0xde14('0x27'),_0x417269[_0xde14('0x28')],_0x1a7167['id'],_0x4357c7['id']);}else{logger[_0xde14('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x417269[_0xde14('0x28')],_0x1a7167['id'],_[_0xde14('0x19')](_0x8e0e,'id')[_0xde14('0x29')](','));}return;}else{logger[_0xde14('0xa')](_0xde14('0x2a'),_0x417269[_0xde14('0x28')],_0x1a7167['id']);var _0x310d75={'ListId':_0x1a1c32};var _0x23c735=_0xe785fb[_0xde14('0x2b')]&&_0xe785fb[_0xde14('0x2b')]!=='0'?_0xe785fb['data4']:_0xde14('0x17');if(_0x34e28f){logger[_0xde14('0xa')](_0xde14('0x2c'),_0x417269[_0xde14('0x28')],_0x1a7167['id']);_0x310d75[_0x23c735]=_['isNil'](_0x417269[_0xde14('0x1a')])?_0x417269[_0xde14('0x1c')]:_0x417269[_0xde14('0x1b')];if(_['isNil'](_0x417269[_0xde14('0x1a')])){_0x310d75['firstName']=_0x417269[_0xde14('0x2d')]&&_0x417269[_0xde14('0x2d')]!==_0xde14('0x2e')?_0x417269[_0xde14('0x2d')]:_0xde14('0x2f');}else{_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x30')]&&_0x417269[_0xde14('0x30')]!==''?_0x417269[_0xde14('0x30')]:_0xde14('0x2f');}return BPromise['resolve']()[_0xde14('0x23')](cmContactRpc['createContact'](_0x310d75))[_0xde14('0x23')](function(_0x44e88a){_0x4357c7=_0x44e88a;_0x8e0e[_0xde14('0x31')](_0x44e88a);if(_0x4357c7){logger[_0xde14('0xa')](_0xde14('0x32'),_0x417269['uniqueid'],_0x1a7167['id'],_0x4357c7['id']);}return;});}else{logger[_0xde14('0xa')](_0xde14('0x33'),_0x417269['uniqueid'],_0x1a7167['id']);_0x310d75[_0x23c735]=_[_0xde14('0x11')](_0x417269[_0xde14('0x1a')])?_0x417269[_0xde14('0x1c')]:_0x417269[_0xde14('0x1b')];if(_[_0xde14('0x11')](_0x417269[_0xde14('0x1a')])){_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x2d')]&&_0x417269[_0xde14('0x2d')]!==''?_0x417269['calleridname']:_0xde14('0x2f');}else{_0x310d75[_0xde14('0x1d')]=_0x417269[_0xde14('0x30')]&&_0x417269[_0xde14('0x30')]!==_0xde14('0x2e')?_0x417269[_0xde14('0x30')]:_0xde14('0x2f');}_0x4357c7=_0x310d75;_0x8e0e[_0xde14('0x31')](_0x310d75);return;}}})[_0xde14('0x23')](function(){if(_0x4b2b15){emit(_0x417269['uniqueid'],_0x1a7167,util[_0xde14('0x34')]('user:%s',_0x4b2b15['name']),util['format'](_0xde14('0x35'),_0xe785fb[_0xde14('0x36')][_0xde14('0x37')]()),{'evt':_[_0xde14('0x38')](_0x417269,{'autoCreate':_0x34e28f}),'contact':_0x4357c7===undefined?{}:_0x4357c7,'contacts':_0x8e0e[_0xde14('0x26')]===0x0?undefined:_0x8e0e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a0c9cc8..a0a67f2 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 _0xd125=['contactmanager','exec','accounts','voiceQueues','queue','routeId','script','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','checkTriggers','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','motionbar','browser','TemplateId','html','data2','uri','buildUri','isNil','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','render','format','user:%s','name','trigger:%s:%s','data1','trigger:%s'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd125,0x92));var _0x5d12=function(_0x5eb1fb,_0x158aba){_0x5eb1fb=_0x5eb1fb-0x0;var _0x479d24=_0xd125[_0x5eb1fb];return _0x479d24;};'use strict';var util=require('util');var _=require(_0x5d12('0x0'));var url=require(_0x5d12('0x1'));var Mustache=require(_0x5d12('0x2'));var Redis=require(_0x5d12('0x3'));var urlforward=require(_0x5d12('0x4'));var integration=require('./integration');var cmContact=require(_0x5d12('0x5'));var script=require(_0x5d12('0x6'));var config=require('../../../config/environment');var logger=require(_0x5d12('0x7'))('trigger');var ami=require(_0x5d12('0x8'));config[_0x5d12('0x9')]=_[_0x5d12('0xa')](config[_0x5d12('0x9')],{'host':_0x5d12('0xb'),'port':0x18eb});var io=require(_0x5d12('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x2682aa,_0x4fce25){return _0x2682aa==_0x4fce25;},'not_equals':function(_0x414f40,_0x30826c){return _0x414f40!=_0x30826c;}};var barAndWebActions=[_0x5d12('0xd'),_0x5d12('0x1'),_0x5d12('0xe')];function Trigger(_0x674838){this[_0x5d12('0xf')]=_0x674838[_0x5d12('0xf')];this[_0x5d12('0x10')]=_0x674838[_0x5d12('0x10')];this['voiceQueues']=_0x674838['voiceQueues'];this[_0x5d12('0x11')]=_0x674838[_0x5d12('0x11')];this[_0x5d12('0x12')]=_0x674838[_0x5d12('0x12')];this[_0x5d12('0x13')]=_0x674838[_0x5d12('0x13')];this[_0x5d12('0x14')]=_0x674838[_0x5d12('0x14')];this[_0x5d12('0x15')]=_0x674838[_0x5d12('0x15')];this[_0x5d12('0x16')]=_0x674838[_0x5d12('0x16')];this[_0x5d12('0x17')]=_0x674838[_0x5d12('0x17')];this['deskAccounts']=_0x674838['deskAccounts'];this['vtigerAccounts']=_0x674838[_0x5d12('0x18')];this[_0x5d12('0x19')]=_0x674838[_0x5d12('0x19')];this[_0x5d12('0x1a')]=_0x674838[_0x5d12('0x1a')];this[_0x5d12('0x1b')]=_0x674838[_0x5d12('0x1b')];this['accounts']={'zendesk':this[_0x5d12('0x13')],'salesforce':this[_0x5d12('0x15')],'freshdesk':this[_0x5d12('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x5d12('0x1c')],'vtiger':this[_0x5d12('0x18')],'dynamics365':this[_0x5d12('0x1a')],'freshsales':this[_0x5d12('0x1b')],'servicenow':this[_0x5d12('0x19')]};ami['on'](_0x5d12('0x1d'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x5d12('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x20'),this[_0x5d12('0x1e')]['bind'](this));ami['on'](_0x5d12('0x21'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x22'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x23'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:agentreject',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x24'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x25'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x26'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:dialbegin',this[_0x5d12('0x27')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x28'),this[_0x5d12('0x27')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x29'),this[_0x5d12('0x27')]['bind'](this));ami['on'](_0x5d12('0x2a'),this['syncCustomEvent']['bind'](this));ami['on']('custom:closedinteraction',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2b'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2c'),this['syncCustomEvent'][_0x5d12('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on']('custom:acceptmessage',this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));ami['on'](_0x5d12('0x2d'),this[_0x5d12('0x1e')][_0x5d12('0x1f')](this));}Trigger[_0x5d12('0x2e')][_0x5d12('0x2f')]=function(_0x1c0393,_0x15b895,_0x35a634){logger['info'](_0x1c0393,_0x15b895,JSON[_0x5d12('0x30')](_0x35a634));io['to'](_0x1c0393)['emit'](_0x15b895,_0x35a634);};Trigger[_0x5d12('0x2e')][_0x5d12('0x1e')]=function(_0x4a5cfa){var _0x307027=_[_0x5d12('0x31')](_0x4a5cfa);if(typeof _0x307027[_0x5d12('0x32')]===_0x5d12('0x33')){_0x307027[_0x5d12('0x32')]=_0x5d12('0x34');}this[_0x5d12('0x35')](_0x307027);};Trigger[_0x5d12('0x2e')][_0x5d12('0x27')]=function(_0x45d18e){if(this[_0x5d12('0x10')][_0x45d18e['interface']]){this['syncCustomEvent'](_0x45d18e);}};Trigger['prototype'][_0x5d12('0x35')]=function(_0x2d2405){var _0x67ae8f;for(var _0x1c918d in this[_0x5d12('0xf')]){if(this['triggers']['hasOwnProperty'](_0x1c918d)){if(this[_0x5d12('0xf')][_0x1c918d][_0x5d12('0x36')]){_0x67ae8f=this[_0x5d12('0x37')](this[_0x5d12('0xf')][_0x1c918d],_0x2d2405);if(_0x67ae8f){_[_0x5d12('0x38')](_0x2d2405,_0x2d2405['variables']);for(var _0x3e5ce4=0x0,_0x54a5d4,_0x528c37,_0x1debce;_0x3e5ce40x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0x5fc3[_0x1c9c24];return _0x349c69;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index f4fe696..0f0e8aa 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 _0x266c=['phonecalls','Descriptions','callDirection','queue','Fields','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','clientId','remoteUri','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','systemuserid','userId','username','length','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','substring','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','phonecall','POST'];(function(_0x2145e6,_0x1ccb9d){var _0x43a73e=function(_0x4ccb8d){while(--_0x4ccb8d){_0x2145e6['push'](_0x2145e6['shift']());}};_0x43a73e(++_0x1ccb9d);}(_0x266c,0x1b5));var _0xc266=function(_0x27d9a5,_0x50475f){_0x27d9a5=_0x27d9a5-0x0;var _0x3aa437=_0x266c[_0x27d9a5];return _0x3aa437;};'use strict';var _=require(_0xc266('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0xc266('0x1'));var intUtil=require(_0xc266('0x2'));var md5=require(_0xc266('0x3'));var Redis=require(_0xc266('0x4'));var logger=require(_0xc266('0x5'))(_0xc266('0x6'));var config=require(_0xc266('0x7'));config['redis']=_['defaults'](config[_0xc266('0x8')],{'host':_0xc266('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc266('0x8')]));function getAuthToken(_0x4ba210,_0x5e0a0e,_0x5e629b){var _0x31f1a9={'method':'POST','uri':_0x5e0a0e,'form':{'client_id':_0x4ba210[_0xc266('0xa')],'resource':_0x4ba210[_0xc266('0xb')],'username':_0x4ba210['username'],'password':_0x4ba210[_0xc266('0xc')],'grant_type':'password','client_secret':_0x4ba210[_0xc266('0xd')]},'json':!![]};return rp(_0x31f1a9)[_0xc266('0xe')](function(_0x43cb5c){return _0x43cb5c[_0xc266('0xf')];})[_0xc266('0x10')](function(_0x115ed7){logger['error']('['+[_0x5e629b[_0xc266('0x11')]()]+_0xc266('0x12'));return _0x115ed7['message'];});}function getUser(_0x3c2553,_0x1baace,_0x1194ac,_0x3e436e,_0x171979,_0x3b7600){return new BPromise(function(_0x21a9ea,_0x50c718){return getAuthToken(_0x1baace,_0x3e436e,_0x3b7600)[_0xc266('0xe')](function(_0x62a570){var _0x5ed556={'method':'GET','uri':_0x171979+_0xc266('0x13'),'headers':{'Authorization':_0xc266('0x14')+_0x62a570,'OData-Version':_0xc266('0x15')},'json':!![]};return rp(_0x5ed556);})[_0xc266('0xe')](function(_0x24372a){var _0x28e63d=_0x24372a['value'];var _0x54ee84=![];var _0x32bd41=null;if(!_[_0xc266('0x16')](_0x1194ac)){if(intUtil[_0xc266('0x17')](_0x1194ac[_0xc266('0x18')])){_0x3c2553[_0xc266('0x19')]=_0x1194ac[_0xc266('0x18')];for(_0x32bd41=0x0;_0x32bd41<_0x28e63d['length'];_0x32bd41++){if(_0x28e63d[_0x32bd41][_0xc266('0x1a')]===_0x1194ac[_0xc266('0x18')]&&!_0x28e63d[_0x32bd41][_0xc266('0x1b')]){_0x54ee84=!![];logger[_0xc266('0x1c')]('['+[_0x3b7600[_0xc266('0x11')]()]+']\x20Agent\x20found\x20'+_0x28e63d[_0x32bd41][_0xc266('0x1d')]+'!');_0x3c2553[_0xc266('0x1e')]=_0x28e63d[_0x32bd41]['systemuserid'];}}}}if(!_0x54ee84){logger[_0xc266('0x1c')]('['+[_0x3b7600[_0xc266('0x11')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3c2553[_0xc266('0x19')]=_0x1baace[_0xc266('0x1f')];for(_0x32bd41=0x0;_0x32bd41<_0x28e63d[_0xc266('0x20')];_0x32bd41++){if(_0x28e63d[_0x32bd41]['internalemailaddress']===_0x1baace[_0xc266('0x1f')]){_0x3c2553[_0xc266('0x1e')]=_0x28e63d[_0x32bd41][_0xc266('0x1d')];}}}_0x21a9ea(_0x3c2553);})['catch'](function(_0x4a3343){_0x50c718(_0x4a3343[_0xc266('0x21')]);});});}function createEndUser(_0x3be746,_0xaa49f,_0xe039f4,_0x4f2953,_0x465378,_0x38cc6a){return new BPromise(function(_0x2efd35,_0x4d5423){return getAuthToken(_0xaa49f,_0xe039f4,_0x38cc6a)[_0xc266('0xe')](function(_0x2771de){var _0x2f12f0=_0x38cc6a[_0xc266('0x22')]()===_0xc266('0x23')?_0x465378[_0xc266('0x24')]:_0x465378[_0xc266('0x25')];var _0x1f1f65={'method':'POST','uri':_0x4f2953+_0xc266('0x26'),'body':{'telephone1':_0x2f12f0,'fullname':_0x2f12f0,'firstname':_0x2f12f0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc266('0x27')+_0x3be746[_0xc266('0x1e')]+')'},'headers':{'Authorization':_0xc266('0x14')+_0x2771de,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1f1f65);})[_0xc266('0xe')](function(_0x1e683c){var _0xf45f83=_0x1e683c['headers'][_0xc266('0x28')];var _0x153caf=_0xf45f83['substring'](_0xf45f83['lastIndexOf']('(')+0x1,_0xf45f83[_0xc266('0x29')](')'));_0x3be746[_0xc266('0x2a')]=_0x153caf;_0x2efd35(_0x3be746);})[_0xc266('0x10')](function(_0x4289ae){_0x4d5423(_0x4289ae[_0xc266('0x21')]);});});}function getEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c){return new BPromise(function(_0x17b581,_0x2ff6ec){var _0x57b362=_0x1e331c[_0xc266('0x22')]()==='outbound'?_0x44d936[_0xc266('0x24')]:_0x44d936[_0xc266('0x25')];return getAuthToken(_0x5e9a4b,_0x5335d6,_0x1e331c)[_0xc266('0xe')](function(_0x3d8e5a){var _0x131d1e={'method':_0xc266('0x2b'),'uri':_0x157f8d+_0xc266('0x2c')+_0x57b362[_0xc266('0x2d')]('+','%2b')+'\x27','headers':{'Authorization':_0xc266('0x14')+_0x3d8e5a,'If-None-Match':null,'OData-Version':_0xc266('0x15')},'json':!![]};return rp(_0x131d1e);})['then'](function(_0x10a1f1){var _0x171830=null;if(_0x10a1f1){var _0x12631d=_0x10a1f1[_0xc266('0x2e')];var _0x1a1081=![];for(_0x171830=0x0;_0x171830<_0x12631d[_0xc266('0x20')];_0x171830++){if(_0x12631d[_0x171830][_0xc266('0x2f')]===_0x57b362){_0x1a1081=!![];_0x458b29[_0xc266('0x2a')]=_0x12631d[_0x171830][_0xc266('0x30')];}}if(_0x1a1081){_0x17b581(_0x458b29);}else{return createEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c)['then'](function(_0x26267c){logger[_0xc266('0x1c')]('['+[_0x1e331c[_0xc266('0x11')]()]+_0xc266('0x31'),_0x26267c['enduserId']);_0x17b581(_0x26267c);});}}else{return createEndUser(_0x458b29,_0x5e9a4b,_0x5335d6,_0x157f8d,_0x44d936,_0x1e331c)[_0xc266('0xe')](function(_0x144d4a){logger[_0xc266('0x1c')]('['+[_0x1e331c[_0xc266('0x11')]()]+_0xc266('0x32'),_0x144d4a[_0xc266('0x2a')]);_0x17b581(_0x144d4a);});}});});}function getCustomFields(_0x383ec6,_0x7ef944,_0x282957){var _0x535cba={};if(_0x383ec6[_0xc266('0x20')]>0x0){_[_0xc266('0x33')](_0x383ec6,function(_0x1eb098){if(_[_0xc266('0x34')]([_0xc266('0x35'),_0xc266('0x36')],_0x1eb098[_0xc266('0x37')])&&_0x1eb098[_0xc266('0x38')]&&!_0x1eb098['customField']){var _0x3a60df=_0x1eb098['idField'][_0xc266('0x22')]();var _0x5c736c=_0x3a60df[_0xc266('0x39')](0x0,_0x3a60df[_0xc266('0x3a')]('_'));var _0x240788=_0x3a60df[_0xc266('0x39')](_0x3a60df['indexOf']('_')+0x1);if(_0x5c736c===_0x282957){_0x535cba[_0x240788]=_0x1eb098[_0xc266('0x3b')];}}});}return _0x535cba;}function getTicket(_0x4147a3,_0x5f30f2,_0xc12da9,_0x98dcad,_0x48308b,_0x59ac4d,_0x32643c){return new BPromise(function(_0x25e421,_0x1f20b4){var _0x1030cb;return getAuthToken(_0x5f30f2,_0xc12da9,_0x32643c)[_0xc266('0xe')](function(_0x5925fe){if(_0x59ac4d[_0xc266('0x3c')]===_0xc266('0x3d')){_0x1030cb={'method':'POST','uri':_0x98dcad+'incidents','body':Object[_0xc266('0x3e')]({},{'title':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x40')],_0x48308b,'\x20'),'description':intUtil[_0xc266('0x3f')](_0x59ac4d['Descriptions'],_0x48308b,'\x0a'),'customerid_contact@odata.bind':_0xc266('0x41')+_0x4147a3[_0xc266('0x2a')]+')','ownerid@odata.bind':'/systemusers('+_0x4147a3[_0xc266('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x59ac4d['Fields'],_0x48308b,_0x59ac4d[_0xc266('0x3c')])),'headers':{'Authorization':_0xc266('0x14')+_0x5925fe,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x59ac4d[_0xc266('0x3c')]===_0xc266('0x42')){_0x1030cb={'method':_0xc266('0x43'),'uri':_0x98dcad+_0xc266('0x44'),'body':Object[_0xc266('0x3e')]({},{'subject':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x40')],_0x48308b,'\x20'),'phonenumber':String(_0x48308b['calleridnum']),'description':intUtil[_0xc266('0x3f')](_0x59ac4d[_0xc266('0x45')],_0x48308b,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x4147a3[_0xc266('0x2a')]+')','ownerid@odata.bind':_0xc266('0x27')+_0x4147a3[_0xc266('0x1e')]+')','directioncode':_0x4147a3[_0xc266('0x46')]===_0xc266('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc266('0x27')+_0x4147a3[_0xc266('0x1e')]+')','participationtypemask':_0x4147a3[_0xc266('0x46')]===_0xc266('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xc266('0x41')+_0x4147a3['enduserId']+')','participationtypemask':_0x4147a3['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x59ac4d[_0xc266('0x48')],_0x48308b,_0x59ac4d[_0xc266('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x5925fe,'OData-Version':_0xc266('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1030cb);})[_0xc266('0xe')](function(_0x8d7cb0){var _0x2ce889=_0x8d7cb0[_0xc266('0x49')][_0xc266('0x28')];var _0x454c05=_0x2ce889[_0xc266('0x39')](_0x2ce889[_0xc266('0x29')]('(')+0x1,_0x2ce889['lastIndexOf'](')'));_0x4147a3[_0xc266('0x4a')]=_0x454c05;_0x25e421(_0x4147a3);})[_0xc266('0x10')](function(_0x510a78){_0x1f20b4(_0x510a78[_0xc266('0x21')]);});});}function emit(_0x52a4a0,_0x12845e,_0x57d56b,_0x1bc492){var _0x187a8f={'uri':util[_0xc266('0x4b')](_0xc266('0x4c'),_0x52a4a0,_0x57d56b,_0x1bc492)};io['to'](util[_0xc266('0x4b')](_0xc266('0x4d'),_0x12845e))[_0xc266('0x4e')](_0xc266('0x4f'),_0x187a8f);}exports['cs']=function(_0x25c353,_0x226d33,_0x479d32,_0x3b9a81,_0x564445,_0x3ecaff,_0x31d14f,_0x33df02){var _0x13b6fb={};_0x3ecaff[_0xc266('0xb')]=intUtil[_0xc266('0x50')](_0x3ecaff[_0xc266('0xb')]);_0x3ecaff[_0xc266('0x51')]=intUtil[_0xc266('0x50')](_0x3ecaff[_0xc266('0x51')]);_0x13b6fb['callDirection']=_0x33df02==='queue'||_0x33df02==='unmanaged'?'queue':_0xc266('0x23');var _0x441bf5=util[_0xc266('0x4b')]('%s/api/data/v9.0/',_0x3ecaff['remoteUri']);var _0x220d64=util[_0xc266('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3ecaff[_0xc266('0x52')]);var _0x164fb8=util['format'](_0xc266('0x53'),_0x3ecaff['serverUrl'],_0x226d33[_0xc266('0x54')],md5(_0x226d33[_0xc266('0x54')]));if(_0x564445&&_0x564445[_0xc266('0x55')]){logger[_0xc266('0x1c')](_0xc266('0x56'),'Recording\x20is\x20enabled!');_0x226d33[_0xc266('0x57')]=_0x164fb8;}else if(_0x31d14f&&_0x31d14f[_0xc266('0x58')]&&_0x31d14f['recordingFormat']!==_0xc266('0x59')){logger['info'](_0xc266('0x5a'),_0xc266('0x5b'));_0x226d33[_0xc266('0x57')]=_0x164fb8;}else{_0x226d33['recordingURL']='';}return getUser(_0x13b6fb,_0x3ecaff,_0x3b9a81,_0x220d64,_0x441bf5,_0x33df02)[_0xc266('0xe')](function(_0x155cf6){logger[_0xc266('0x1c')]('['+_0x33df02['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x155cf6[_0xc266('0x1e')]);logger[_0xc266('0x1c')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x5c'),_0x155cf6[_0xc266('0x19')]);return getEndUser(_0x155cf6,_0x3ecaff,_0x220d64,_0x441bf5,_0x226d33,_0x33df02);})[_0xc266('0xe')](function(_0x55d2e6){logger['info']('['+_0x33df02['toUpperCase']()+_0xc266('0x5d'),_0x55d2e6[_0xc266('0x2a')]);logger[_0xc266('0x1c')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x5e'),_0x226d33[_0xc266('0x25')]);return getTicket(_0x55d2e6,_0x3ecaff,_0x220d64,_0x441bf5,_0x226d33,_0x479d32,_0x33df02);})['then'](function(_0x773120){logger[_0xc266('0x1c')](util['format']('['+_0x33df02[_0xc266('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x479d32['ticketType'],_0x773120[_0xc266('0x4a')]));logger[_0xc266('0x1c')](util['format']('['+_0x33df02['toUpperCase']()+_0xc266('0x5f'),_0x33df02));if(_0x33df02!=='unmanaged'){logger['info']('['+_0x33df02[_0xc266('0x11')]()+']',_0xc266('0x60'));emit(_0x3ecaff[_0xc266('0xb')],_0x3b9a81[_0xc266('0x61')],_0x479d32['ticketType'],_0x773120[_0xc266('0x4a')]);}})['catch'](function(_0x3cdb35){logger[_0xc266('0x62')]('['+_0x33df02[_0xc266('0x11')]()+_0xc266('0x63'),util[_0xc266('0x64')](_0x3cdb35,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3a14=['recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase','message','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','picklist','type','nameField','indexOf','content','incident','incidents','getString','Subjects','Descriptions','ticketType','phonecall','phonecalls','assign','/contacts(','queue','callDirection','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a14,0x69));var _0x43a1=function(_0x28f741,_0x11fd4b){_0x28f741=_0x28f741-0x0;var _0xc4d325=_0x3a14[_0x28f741];return _0xc4d325;};'use strict';var _=require(_0x43a1('0x0'));var BPromise=require(_0x43a1('0x1'));var rp=require(_0x43a1('0x2'));var util=require(_0x43a1('0x3'));var intUtil=require('./util');var md5=require(_0x43a1('0x4'));var Redis=require(_0x43a1('0x5'));var logger=require('../../../../config/logger')(_0x43a1('0x6'));var config=require(_0x43a1('0x7'));config['redis']=_[_0x43a1('0x8')](config[_0x43a1('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x43a1('0xa'))(new Redis(config[_0x43a1('0x9')]));function getAuthToken(_0x4fc4f1,_0x5e53a3,_0x5f3cb1){var _0x58fed1={'method':_0x43a1('0xb'),'uri':_0x5e53a3,'form':{'client_id':_0x4fc4f1['clientId'],'resource':_0x4fc4f1[_0x43a1('0xc')],'username':_0x4fc4f1[_0x43a1('0xd')],'password':_0x4fc4f1[_0x43a1('0xe')],'grant_type':'password','client_secret':_0x4fc4f1[_0x43a1('0xf')]},'json':!![]};return rp(_0x58fed1)[_0x43a1('0x10')](function(_0x368596){return _0x368596['access_token'];})[_0x43a1('0x11')](function(_0x5b2115){logger[_0x43a1('0x12')]('['+[_0x5f3cb1[_0x43a1('0x13')]()]+']\x20Wrong\x20credentials!');return _0x5b2115[_0x43a1('0x14')];});}function getUser(_0xe45836,_0x57e3a1,_0x474fb8,_0x4cb302,_0x3392ea,_0x59ff3b){return new BPromise(function(_0xd3b15c,_0x1aaf3d){return getAuthToken(_0x57e3a1,_0x4cb302,_0x59ff3b)[_0x43a1('0x10')](function(_0x5ef92d){var _0xe2b45c={'method':'GET','uri':_0x3392ea+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x43a1('0x15')+_0x5ef92d,'OData-Version':_0x43a1('0x16')},'json':!![]};return rp(_0xe2b45c);})[_0x43a1('0x10')](function(_0xe33d78){var _0x19afa2=_0xe33d78['value'];var _0x426124=![];var _0x514c38=null;if(!_[_0x43a1('0x17')](_0x474fb8)){if(intUtil[_0x43a1('0x18')](_0x474fb8[_0x43a1('0x19')])){_0xe45836[_0x43a1('0x1a')]=_0x474fb8[_0x43a1('0x19')];for(_0x514c38=0x0;_0x514c38<_0x19afa2[_0x43a1('0x1b')];_0x514c38++){if(_0x19afa2[_0x514c38][_0x43a1('0x1c')]===_0x474fb8[_0x43a1('0x19')]&&!_0x19afa2[_0x514c38]['isdisabled']){_0x426124=!![];logger[_0x43a1('0x1d')]('['+[_0x59ff3b[_0x43a1('0x13')]()]+_0x43a1('0x1e')+_0x19afa2[_0x514c38][_0x43a1('0x1f')]+'!');_0xe45836[_0x43a1('0x20')]=_0x19afa2[_0x514c38][_0x43a1('0x1f')];}}}}if(!_0x426124){logger['info']('['+[_0x59ff3b['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xe45836['userEmail']=_0x57e3a1[_0x43a1('0xd')];for(_0x514c38=0x0;_0x514c38<_0x19afa2['length'];_0x514c38++){if(_0x19afa2[_0x514c38][_0x43a1('0x1c')]===_0x57e3a1['username']){_0xe45836[_0x43a1('0x20')]=_0x19afa2[_0x514c38][_0x43a1('0x1f')];}}}_0xd3b15c(_0xe45836);})[_0x43a1('0x11')](function(_0x49996e){_0x1aaf3d(_0x49996e[_0x43a1('0x14')]);});});}function createEndUser(_0x5cd99e,_0x1dc8c2,_0x37b028,_0x47675e,_0x38bc39,_0x1af4a5){return new BPromise(function(_0x57f89c,_0x3e8e44){return getAuthToken(_0x1dc8c2,_0x37b028,_0x1af4a5)[_0x43a1('0x10')](function(_0x280a5f){var _0x591381=_0x1af4a5[_0x43a1('0x21')]()===_0x43a1('0x22')?_0x38bc39['destcalleridnum']:_0x38bc39['calleridnum'];var _0x1849c7={'method':_0x43a1('0xb'),'uri':_0x47675e+'contacts','body':{'telephone1':_0x591381,'fullname':_0x591381,'firstname':_0x591381,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x43a1('0x23')+_0x5cd99e[_0x43a1('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x280a5f,'OData-Version':_0x43a1('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1849c7);})[_0x43a1('0x10')](function(_0x268a35){var _0x179ca9=_0x268a35[_0x43a1('0x24')][_0x43a1('0x25')];var _0x59537a=_0x179ca9[_0x43a1('0x26')](_0x179ca9[_0x43a1('0x27')]('(')+0x1,_0x179ca9[_0x43a1('0x27')](')'));_0x5cd99e[_0x43a1('0x28')]=_0x59537a;_0x57f89c(_0x5cd99e);})[_0x43a1('0x11')](function(_0x579abc){_0x3e8e44(_0x579abc['message']);});});}function getEndUser(_0x572563,_0xa6352f,_0x2007ae,_0x38f137,_0x392622,_0x45eed1){return new BPromise(function(_0x36f372,_0x33e984){var _0x3a4369=_0x45eed1[_0x43a1('0x21')]()===_0x43a1('0x22')?_0x392622[_0x43a1('0x29')]:_0x392622[_0x43a1('0x2a')];return getAuthToken(_0xa6352f,_0x2007ae,_0x45eed1)[_0x43a1('0x10')](function(_0x3f80c9){var _0x2b17a7={'method':_0x43a1('0x2b'),'uri':_0x38f137+_0x43a1('0x2c')+_0x3a4369[_0x43a1('0x2d')]('+',_0x43a1('0x2e'))+'\x27','headers':{'Authorization':_0x43a1('0x15')+_0x3f80c9,'If-None-Match':null,'OData-Version':_0x43a1('0x16')},'json':!![]};return rp(_0x2b17a7);})[_0x43a1('0x10')](function(_0x496adb){var _0x4ffd1a=null;if(_0x496adb){var _0x4bfd1d=_0x496adb[_0x43a1('0x2f')];var _0x1ba786=![];for(_0x4ffd1a=0x0;_0x4ffd1a<_0x4bfd1d['length'];_0x4ffd1a++){if(_0x4bfd1d[_0x4ffd1a][_0x43a1('0x30')]===_0x3a4369){_0x1ba786=!![];_0x572563['enduserId']=_0x4bfd1d[_0x4ffd1a][_0x43a1('0x31')];}}if(_0x1ba786){_0x36f372(_0x572563);}else{return createEndUser(_0x572563,_0xa6352f,_0x2007ae,_0x38f137,_0x392622,_0x45eed1)['then'](function(_0x1ad4d9){logger['info']('['+[_0x45eed1[_0x43a1('0x13')]()]+_0x43a1('0x32'),_0x1ad4d9[_0x43a1('0x28')]);_0x36f372(_0x1ad4d9);});}}else{return createEndUser(_0x572563,_0xa6352f,_0x2007ae,_0x38f137,_0x392622,_0x45eed1)['then'](function(_0x15d89b){logger['info']('['+[_0x45eed1[_0x43a1('0x13')]()]+_0x43a1('0x33'),_0x15d89b[_0x43a1('0x28')]);_0x36f372(_0x15d89b);});}});});}function getCustomFields(_0x2ea6e0,_0x2c9157,_0x376975){var _0xd8c6d={};if(_0x2ea6e0[_0x43a1('0x1b')]>0x0){_['forEach'](_0x2ea6e0,function(_0x16f88f){if(_[_0x43a1('0x34')](['string',_0x43a1('0x35')],_0x16f88f[_0x43a1('0x36')])&&_0x16f88f[_0x43a1('0x37')]&&!_0x16f88f['customField']){var _0x29f93c=_0x16f88f['idField'][_0x43a1('0x21')]();var _0x54c6bc=_0x29f93c['substring'](0x0,_0x29f93c[_0x43a1('0x38')]('_'));var _0x53b997=_0x29f93c[_0x43a1('0x26')](_0x29f93c[_0x43a1('0x38')]('_')+0x1);if(_0x54c6bc===_0x376975){_0xd8c6d[_0x53b997]=_0x16f88f[_0x43a1('0x39')];}}});}return _0xd8c6d;}function getTicket(_0x543ea4,_0x9427ec,_0x4a2ded,_0x4ec191,_0x26db3a,_0x4a0d6f,_0x365a27){return new BPromise(function(_0x332981,_0x13b36d){var _0x186615;return getAuthToken(_0x9427ec,_0x4a2ded,_0x365a27)[_0x43a1('0x10')](function(_0xc6faf0){if(_0x4a0d6f['ticketType']===_0x43a1('0x3a')){_0x186615={'method':_0x43a1('0xb'),'uri':_0x4ec191+_0x43a1('0x3b'),'body':Object['assign']({},{'title':intUtil[_0x43a1('0x3c')](_0x4a0d6f[_0x43a1('0x3d')],_0x26db3a,'\x20'),'description':intUtil['getString'](_0x4a0d6f[_0x43a1('0x3e')],_0x26db3a,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x543ea4['enduserId']+')','ownerid@odata.bind':_0x43a1('0x23')+_0x543ea4[_0x43a1('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x4a0d6f['Fields'],_0x26db3a,_0x4a0d6f[_0x43a1('0x3f')])),'headers':{'Authorization':_0x43a1('0x15')+_0xc6faf0,'OData-Version':_0x43a1('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4a0d6f[_0x43a1('0x3f')]===_0x43a1('0x40')){_0x186615={'method':_0x43a1('0xb'),'uri':_0x4ec191+_0x43a1('0x41'),'body':Object[_0x43a1('0x42')]({},{'subject':intUtil[_0x43a1('0x3c')](_0x4a0d6f['Subjects'],_0x26db3a,'\x20'),'phonenumber':String(_0x26db3a['calleridnum']),'description':intUtil[_0x43a1('0x3c')](_0x4a0d6f[_0x43a1('0x3e')],_0x26db3a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x43a1('0x43')+_0x543ea4[_0x43a1('0x28')]+')','ownerid@odata.bind':_0x43a1('0x23')+_0x543ea4[_0x43a1('0x20')]+')','directioncode':_0x543ea4['callDirection']===_0x43a1('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x543ea4[_0x43a1('0x20')]+')','participationtypemask':_0x543ea4['callDirection']===_0x43a1('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x43a1('0x43')+_0x543ea4[_0x43a1('0x28')]+')','participationtypemask':_0x543ea4[_0x43a1('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0x4a0d6f[_0x43a1('0x46')],_0x26db3a,_0x4a0d6f[_0x43a1('0x3f')])),'headers':{'Authorization':_0x43a1('0x15')+_0xc6faf0,'OData-Version':_0x43a1('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x186615);})[_0x43a1('0x10')](function(_0xa83a15){var _0x5dc831=_0xa83a15[_0x43a1('0x24')][_0x43a1('0x25')];var _0x1a8e3e=_0x5dc831[_0x43a1('0x26')](_0x5dc831[_0x43a1('0x27')]('(')+0x1,_0x5dc831[_0x43a1('0x27')](')'));_0x543ea4[_0x43a1('0x47')]=_0x1a8e3e;_0x332981(_0x543ea4);})[_0x43a1('0x11')](function(_0x3ed2f9){_0x13b36d(_0x3ed2f9[_0x43a1('0x14')]);});});}function emit(_0x11574c,_0x839496,_0x4244eb,_0x141ca2){var _0x222f64={'uri':util[_0x43a1('0x48')](_0x43a1('0x49'),_0x11574c,_0x4244eb,_0x141ca2)};io['to'](util['format'](_0x43a1('0x4a'),_0x839496))[_0x43a1('0x4b')](_0x43a1('0x4c'),_0x222f64);}exports['cs']=function(_0x543e8,_0xd8a3f1,_0x542a97,_0x455664,_0x455f95,_0x30a364,_0x4fbfcb,_0x56ed2d){var _0x359f27={};_0x30a364[_0x43a1('0xc')]=intUtil[_0x43a1('0x4d')](_0x30a364[_0x43a1('0xc')]);_0x30a364['serverUrl']=intUtil['stripTrailingSlash'](_0x30a364['serverUrl']);_0x359f27[_0x43a1('0x45')]=_0x56ed2d===_0x43a1('0x44')||_0x56ed2d===_0x43a1('0x4e')?_0x43a1('0x44'):_0x43a1('0x22');var _0x42d12a=util['format'](_0x43a1('0x4f'),_0x30a364[_0x43a1('0xc')]);var _0x46d63e=util[_0x43a1('0x48')](_0x43a1('0x50'),_0x30a364[_0x43a1('0x51')]);var _0x34023f=util[_0x43a1('0x48')](_0x43a1('0x52'),_0x30a364[_0x43a1('0x53')],_0xd8a3f1['uniqueid'],md5(_0xd8a3f1[_0x43a1('0x54')]));if(_0x455f95&&_0x455f95[_0x43a1('0x55')]){logger[_0x43a1('0x1d')](_0x43a1('0x56'),_0x43a1('0x57'));_0xd8a3f1['recordingURL']=_0x34023f;}else if(_0x4fbfcb&&_0x4fbfcb[_0x43a1('0x58')]&&_0x4fbfcb[_0x43a1('0x58')]!==_0x43a1('0x59')){logger['info'](_0x43a1('0x5a'),_0x43a1('0x57'));_0xd8a3f1['recordingURL']=_0x34023f;}else{_0xd8a3f1[_0x43a1('0x5b')]='';}return getUser(_0x359f27,_0x30a364,_0x455664,_0x46d63e,_0x42d12a,_0x56ed2d)[_0x43a1('0x10')](function(_0x81f43e){logger[_0x43a1('0x1d')]('['+_0x56ed2d[_0x43a1('0x13')]()+_0x43a1('0x5c'),_0x81f43e[_0x43a1('0x20')]);logger[_0x43a1('0x1d')]('['+_0x56ed2d['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x81f43e[_0x43a1('0x1a')]);return getEndUser(_0x81f43e,_0x30a364,_0x46d63e,_0x42d12a,_0xd8a3f1,_0x56ed2d);})[_0x43a1('0x10')](function(_0x1412e4){logger[_0x43a1('0x1d')]('['+_0x56ed2d[_0x43a1('0x13')]()+_0x43a1('0x5d'),_0x1412e4[_0x43a1('0x28')]);logger[_0x43a1('0x1d')]('['+_0x56ed2d[_0x43a1('0x13')]()+_0x43a1('0x5e'),_0xd8a3f1['calleridnum']);return getTicket(_0x1412e4,_0x30a364,_0x46d63e,_0x42d12a,_0xd8a3f1,_0x542a97,_0x56ed2d);})[_0x43a1('0x10')](function(_0x293c57){logger[_0x43a1('0x1d')](util[_0x43a1('0x48')]('['+_0x56ed2d[_0x43a1('0x13')]()+_0x43a1('0x5f'),_0x542a97[_0x43a1('0x3f')],_0x293c57[_0x43a1('0x47')]));logger['info'](util[_0x43a1('0x48')]('['+_0x56ed2d['toUpperCase']()+_0x43a1('0x60'),_0x56ed2d));if(_0x56ed2d!=='unmanaged'){logger[_0x43a1('0x1d')]('['+_0x56ed2d[_0x43a1('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x30a364[_0x43a1('0xc')],_0x455664[_0x43a1('0x61')],_0x542a97['ticketType'],_0x293c57[_0x43a1('0x47')]);}})[_0x43a1('0x11')](function(_0xb770cf){logger[_0x43a1('0x12')]('['+_0x56ed2d['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0xb770cf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index d861bd7..0313989 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 _0xc366=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','nameField','toLowerCase','content','includes','string','picklist','type','customField','idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','trigger:browser:url','%s/helpdesk/tickets/%d','unmanaged','calleridname','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc366,0x1cc));var _0x6c36=function(_0xd056bc,_0x506c5c){_0xd056bc=_0xd056bc-0x0;var _0x5c29a8=_0xc366[_0xd056bc];return _0x5c29a8;};'use strict';var _=require(_0x6c36('0x0'));var rp=require(_0x6c36('0x1'));var md5=require(_0x6c36('0x2'));var util=require(_0x6c36('0x3'));var Redis=require(_0x6c36('0x4'));var intUtil=require(_0x6c36('0x5'));var config=require(_0x6c36('0x6'));var logger=require(_0x6c36('0x7'))(_0x6c36('0x8'));config[_0x6c36('0x9')]=_[_0x6c36('0xa')](config['redis'],{'host':_0x6c36('0xb'),'port':0x18eb});var io=require(_0x6c36('0xc'))(new Redis(config[_0x6c36('0x9')]));var headers={'Content-Type':_0x6c36('0xd'),'Accept':_0x6c36('0xd')};function emit(_0x347db2,_0x38758f,_0x361476){io['to'](_0x347db2)['emit'](_0x38758f,_0x361476);}function getTicket(_0x2ab9cf,_0x3b72b3,_0x41e723,_0x2a7270,_0x424024){logger['info'](_0x6c36('0xe'));var _0x5622c3=_[_0x6c36('0xf')]({'responder_id':_0x3b72b3['id'],'requester_id':_0x41e723['id'],'name':util[_0x6c36('0x10')](_0x6c36('0x11'),_0x424024['calleridname']),'phone':_0x424024[_0x6c36('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2a7270[_0x6c36('0x13')],_0x424024,'\x20'),'description':intUtil['getString'](_0x2a7270[_0x6c36('0x14')],_0x424024,_0x6c36('0x15')),'tags':getTags(_0x2a7270[_0x6c36('0x16')],_0x6c36('0x17'))},getCustomFields(_0x2a7270['Fields'],_0x424024));_0x5622c3[_0x6c36('0x18')]=_[_0x6c36('0x19')](_[_0x6c36('0x1a')](_0x5622c3['custom_fields'],'id'),_0x6c36('0x1b'));return request({'uri':util['format'](_0x6c36('0x1c'),_0x2ab9cf[_0x6c36('0x1d')]),'method':_0x6c36('0x1e'),'body':_0x5622c3})[_0x6c36('0x1f')](function(_0x3b18b6){logger[_0x6c36('0x20')]('Ticket\x20created!');return _0x3b18b6;});}function getUser(_0x2c14b6,_0x52f062){if(intUtil[_0x6c36('0x21')](_0x52f062)){return request({'uri':util[_0x6c36('0x10')]('%s/api/v2/agents',_0x2c14b6[_0x6c36('0x1d')]),'qs':{'email':_0x52f062}})[_0x6c36('0x1f')](function(_0x1260f5){if(_0x1260f5[_0x6c36('0x22')]){logger[_0x6c36('0x20')](_0x6c36('0x23'));return _[_0x6c36('0x24')](_0x1260f5,function(_0x1e2ecf){return _0x1e2ecf['contact'][_0x6c36('0x25')]===_0x52f062;});}else{logger[_0x6c36('0x20')](_0x6c36('0x26'));return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x27'),_0x2c14b6[_0x6c36('0x1d')])})[_0x6c36('0x1f')](function(_0x5b818d){logger[_0x6c36('0x20')](_0x6c36('0x28'));return _0x5b818d;});}});}else{logger[_0x6c36('0x20')](_0x6c36('0x29'));return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x27'),_0x2c14b6[_0x6c36('0x1d')])})['then'](function(_0x5bf4f6){logger[_0x6c36('0x20')]('Admin\x20account\x20selected.');return _0x5bf4f6;});}}function getEndUser(_0x3c1283,_0x25171c,_0x37c36c){logger['info']('Searching\x20enduser\x20with\x20phone',_0x37c36c);return request({'uri':util[_0x6c36('0x10')](_0x6c36('0x2a'),_0x3c1283[_0x6c36('0x1d')]),'qs':{'phone':_0x37c36c}})[_0x6c36('0x1f')](function(_0x52829d){if(_0x52829d['length']){logger['info'](_0x6c36('0x2b'));return _[_0x6c36('0x24')](_0x52829d,{'phone':_0x37c36c});}else{logger[_0x6c36('0x20')](_0x6c36('0x2c'));return request({'uri':util[_0x6c36('0x10')]('%s/api/v2/contacts',_0x3c1283[_0x6c36('0x1d')]),'method':'POST','body':{'name':_0x25171c,'phone':_0x37c36c}})[_0x6c36('0x1f')](function(_0x3297d3){logger['info']('Enduser\x20created.');return _0x3297d3;});}});}function getAuth(_0x9ed878){return util[_0x6c36('0x10')](_0x6c36('0x2d'),new Buffer(_0x9ed878[_0x6c36('0x2e')]+':X')[_0x6c36('0x2f')](_0x6c36('0x30')));}function request(_0x101c90){logger['debug'](_0x6c36('0x31'),JSON[_0x6c36('0x32')](_0x101c90));return rp(_[_0x6c36('0xa')](_0x101c90,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x53e975,_0x675422){var _0x5a8248=[];if(_0x53e975&&_0x53e975[_0x6c36('0x22')]>0x0){_0x5a8248=_['map'](_0x53e975,_0x675422);}return _0x5a8248;}function getCustomFields(_0x7d02ff,_0x33d1d4){var _0x509f05=[];var _0x539dee={'custom_fields':[]};if(_0x7d02ff[_0x6c36('0x22')]>0x0){_['forEach'](_0x7d02ff,function(_0x1c3b8b){if(_['includes'](['string','picklist'],_0x1c3b8b['type'])&&_0x1c3b8b[_0x6c36('0x33')]&&!_0x1c3b8b['customField']){_0x539dee[_0x1c3b8b[_0x6c36('0x33')][_0x6c36('0x34')]()]=_0x1c3b8b[_0x6c36('0x35')]['toString']();}else if(_[_0x6c36('0x36')]([_0x6c36('0x37'),_0x6c36('0x38')],_0x1c3b8b[_0x6c36('0x39')])&&_0x1c3b8b['idField']&&_0x1c3b8b[_0x6c36('0x3a')]){_0x539dee[_0x6c36('0x18')]['push']({'id':_0x1c3b8b[_0x6c36('0x3b')],'value':_0x1c3b8b[_0x6c36('0x35')]['toString']()});}else if(_0x1c3b8b[_0x6c36('0x39')]==='variable'&&_0x1c3b8b[_0x6c36('0x3c')]&&_0x1c3b8b[_0x6c36('0x3b')]&&_0x1c3b8b['customField']){_0x33d1d4[_0x1c3b8b[_0x6c36('0x3c')]]&&_0x539dee[_0x6c36('0x18')][_0x6c36('0x3d')]({'id':_0x1c3b8b['idField'],'value':_0x33d1d4[_0x1c3b8b['variableName']]['toString']()});}else if(_0x1c3b8b['type']===_0x6c36('0x3e')&&_0x1c3b8b[_0x6c36('0x3f')]&&_0x1c3b8b['Variable'][_0x6c36('0x17')]&&_0x1c3b8b[_0x6c36('0x3b')]&&_0x1c3b8b[_0x6c36('0x3a')]){_0x33d1d4[_0x1c3b8b[_0x6c36('0x3f')]['name'][_0x6c36('0x34')]()]&&_0x539dee[_0x6c36('0x18')]['push']({'id':_0x1c3b8b[_0x6c36('0x3b')],'value':_0x33d1d4[_0x1c3b8b[_0x6c36('0x3f')][_0x6c36('0x17')][_0x6c36('0x34')]()][_0x6c36('0x2f')]()});}});}return _0x539dee;}exports[_0x6c36('0x40')]=function(_0x2c0e60,_0x3dffd2,_0x2cf307,_0x341cd5,_0x10306e,_0x25517f){var _0x26811e,_0x2b0256;_0x25517f[_0x6c36('0x1d')]=intUtil[_0x6c36('0x41')](_0x25517f[_0x6c36('0x1d')]);_0x25517f[_0x6c36('0x42')]=intUtil[_0x6c36('0x41')](_0x25517f[_0x6c36('0x42')]);if(_0x10306e&&_0x10306e[_0x6c36('0x43')]){logger['info'](_0x6c36('0x44'),'Recording\x20is\x20enabled!');_0x3dffd2[_0x6c36('0x45')]=util[_0x6c36('0x10')](_0x6c36('0x46'),_0x25517f[_0x6c36('0x42')],_0x3dffd2['uniqueid'],md5(_0x3dffd2[_0x6c36('0x47')]));}else{_0x3dffd2[_0x6c36('0x45')]='';}headers[_0x6c36('0x48')]=getAuth(_0x25517f);return getUser(_0x25517f,_0x341cd5[_0x6c36('0x25')])[_0x6c36('0x1f')](function(_0x2362bb){_0x26811e=_0x2362bb;logger['info']('The\x20User\x20ID\x20is:',_0x26811e['id']);return getEndUser(_0x25517f,_0x3dffd2['calleridname'],_0x3dffd2[_0x6c36('0x12')]);})[_0x6c36('0x1f')](function(_0xff3f7c){_0x2b0256=_0xff3f7c;logger[_0x6c36('0x20')](_0x6c36('0x49'),_0x2b0256['id']);return getTicket(_0x25517f,_0x26811e,_0x2b0256,_0x2cf307,_0x3dffd2);})[_0x6c36('0x1f')](function(_0x4837fe){if(_0x4837fe&&_0x4837fe['id']){logger[_0x6c36('0x20')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4837fe['id']);logger[_0x6c36('0x20')](_0x6c36('0x44'),_0x6c36('0x4a'));emit(util[_0x6c36('0x10')](_0x6c36('0x4b'),_0x341cd5[_0x6c36('0x17')]),'trigger:browser:url',{'uri':util[_0x6c36('0x10')]('%s/helpdesk/tickets/%d',_0x25517f[_0x6c36('0x1d')],_0x4837fe['id'])});}})[_0x6c36('0x4c')](function(_0x232091){logger[_0x6c36('0x4d')](_0x6c36('0x44'),JSON[_0x6c36('0x32')](_0x232091));});};exports[_0x6c36('0x4e')]=function(_0x1ff627,_0x1708e4,_0x58bb0a,_0x6341d3,_0x5523b5,_0x21c0c7,_0x17fe2d){var _0x20b6c6,_0x5dbda0;_0x21c0c7[_0x6c36('0x1d')]=intUtil[_0x6c36('0x41')](_0x21c0c7[_0x6c36('0x1d')]);_0x21c0c7[_0x6c36('0x42')]=intUtil[_0x6c36('0x41')](_0x21c0c7['serverUrl']);if(_0x17fe2d&&_0x17fe2d[_0x6c36('0x4f')]&&_0x17fe2d[_0x6c36('0x4f')]!==_0x6c36('0x50')){logger[_0x6c36('0x20')]('[OUTBOUND]',_0x6c36('0x51'));_0x1708e4['recordingURL']=util[_0x6c36('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21c0c7[_0x6c36('0x42')],_0x1708e4[_0x6c36('0x47')],md5(_0x1708e4[_0x6c36('0x47')]));}headers['Authorization']=getAuth(_0x21c0c7);return getUser(_0x21c0c7,_0x6341d3[_0x6c36('0x25')])['then'](function(_0x293563){_0x20b6c6=_0x293563;logger[_0x6c36('0x20')](_0x6c36('0x52'),_0x20b6c6['id']);return getEndUser(_0x21c0c7,_0x1708e4[_0x6c36('0x53')],_0x1708e4[_0x6c36('0x54')]);})[_0x6c36('0x1f')](function(_0x3624f9){_0x5dbda0=_0x3624f9;logger['info'](_0x6c36('0x49'),_0x5dbda0['id']);return getTicket(_0x21c0c7,_0x20b6c6,_0x5dbda0,_0x58bb0a,_0x1708e4);})[_0x6c36('0x1f')](function(_0x7a008b){if(_0x7a008b&&_0x7a008b['id']){logger[_0x6c36('0x20')]('Ticket\x20created!');logger[_0x6c36('0x20')](_0x6c36('0x55'),_0x7a008b['id']);logger[_0x6c36('0x20')](_0x6c36('0x56'),_0x6c36('0x4a'));emit(util[_0x6c36('0x10')](_0x6c36('0x4b'),_0x6341d3[_0x6c36('0x17')]),_0x6c36('0x57'),{'uri':util[_0x6c36('0x10')](_0x6c36('0x58'),_0x21c0c7[_0x6c36('0x1d')],_0x7a008b['id'])});}})[_0x6c36('0x4c')](function(_0x579e43){logger[_0x6c36('0x4d')](_0x6c36('0x56'),JSON[_0x6c36('0x32')](_0x579e43));});};exports[_0x6c36('0x59')]=function(_0x2e3a3b,_0x5c9a22,_0x35398b,_0x573ea7,_0x3599d7,_0x3d2486){var _0x1bd9a4,_0x39b1c6;_0x3d2486[_0x6c36('0x1d')]=intUtil['stripTrailingSlash'](_0x3d2486[_0x6c36('0x1d')]);_0x3d2486[_0x6c36('0x42')]=intUtil['stripTrailingSlash'](_0x3d2486['serverUrl']);if(_0x3599d7&&_0x3599d7['monitor_format']){logger[_0x6c36('0x20')]('['+_0x5c9a22['lastevent']['toUpperCase']()+']',_0x6c36('0x51'));_0x5c9a22[_0x6c36('0x45')]=util[_0x6c36('0x10')](_0x6c36('0x46'),_0x3d2486[_0x6c36('0x42')],_0x5c9a22[_0x6c36('0x47')],md5(_0x5c9a22[_0x6c36('0x47')]));}else{_0x5c9a22[_0x6c36('0x45')]='';}headers[_0x6c36('0x48')]=getAuth(_0x3d2486);return getUser(_0x3d2486,'')[_0x6c36('0x1f')](function(_0x3453e8){_0x1bd9a4=_0x3453e8;logger[_0x6c36('0x20')](_0x6c36('0x52'),_0x1bd9a4['id']);return getEndUser(_0x3d2486,_0x5c9a22[_0x6c36('0x5a')],_0x5c9a22[_0x6c36('0x12')]);})[_0x6c36('0x1f')](function(_0x3ee19c){_0x39b1c6=_0x3ee19c;logger['info'](_0x6c36('0x49'),_0x39b1c6['id']);return getTicket(_0x3d2486,_0x1bd9a4,_0x39b1c6,_0x35398b,_0x5c9a22);})[_0x6c36('0x1f')](function(_0x118632){if(_0x118632){logger[_0x6c36('0x20')]('Ticket\x20created!');logger[_0x6c36('0x20')]('The\x20Ticket\x20ID\x20is:',_0x118632['id']);}})[_0x6c36('0x4c')](function(_0x3986be){logger['error']('['+_0x5c9a22[_0x6c36('0x5b')][_0x6c36('0x5c')]()+']',JSON[_0x6c36('0x32')](_0x3986be));});}; \ No newline at end of file +var _0xaf23=['customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','md5','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','Subjects','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','push','idField','variable','variableName'];(function(_0x268341,_0x36ac2d){var _0x23385f=function(_0x5132){while(--_0x5132){_0x268341['push'](_0x268341['shift']());}};_0x23385f(++_0x36ac2d);}(_0xaf23,0x190));var _0x3af2=function(_0x3af61c,_0x51db90){_0x3af61c=_0x3af61c-0x0;var _0x339d71=_0xaf23[_0x3af61c];return _0x339d71;};'use strict';var _=require(_0x3af2('0x0'));var rp=require('request-promise');var md5=require(_0x3af2('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x3af2('0x2'));var config=require(_0x3af2('0x3'));var logger=require(_0x3af2('0x4'))(_0x3af2('0x5'));config[_0x3af2('0x6')]=_[_0x3af2('0x7')](config[_0x3af2('0x6')],{'host':_0x3af2('0x8'),'port':0x18eb});var io=require(_0x3af2('0x9'))(new Redis(config[_0x3af2('0x6')]));var headers={'Content-Type':_0x3af2('0xa'),'Accept':_0x3af2('0xa')};function emit(_0x208ef6,_0x38f0df,_0x25a8f3){io['to'](_0x208ef6)[_0x3af2('0xb')](_0x38f0df,_0x25a8f3);}function getTicket(_0x575197,_0x234d86,_0x50757c,_0x3e83c2,_0x1d3fbf){logger[_0x3af2('0xc')]('Creating\x20new\x20ticket...');var _0x3dc8ee=_[_0x3af2('0xd')]({'responder_id':_0x234d86['id'],'requester_id':_0x50757c['id'],'name':util[_0x3af2('0xe')]('Caller\x20-\x20%s',_0x1d3fbf[_0x3af2('0xf')]),'phone':_0x1d3fbf['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3e83c2[_0x3af2('0x10')],_0x1d3fbf,'\x20'),'description':intUtil[_0x3af2('0x11')](_0x3e83c2[_0x3af2('0x12')],_0x1d3fbf,_0x3af2('0x13')),'tags':getTags(_0x3e83c2['Tags'],_0x3af2('0x14'))},getCustomFields(_0x3e83c2[_0x3af2('0x15')],_0x1d3fbf));_0x3dc8ee[_0x3af2('0x16')]=_[_0x3af2('0x17')](_[_0x3af2('0x18')](_0x3dc8ee['custom_fields'],'id'),_0x3af2('0x19'));return request({'uri':util[_0x3af2('0xe')]('%s/api/v2/tickets',_0x575197[_0x3af2('0x1a')]),'method':_0x3af2('0x1b'),'body':_0x3dc8ee})['then'](function(_0x4b575e){logger['info'](_0x3af2('0x1c'));return _0x4b575e;});}function getUser(_0x1905c6,_0x51e804){if(intUtil[_0x3af2('0x1d')](_0x51e804)){return request({'uri':util['format'](_0x3af2('0x1e'),_0x1905c6[_0x3af2('0x1a')]),'qs':{'email':_0x51e804}})[_0x3af2('0x1f')](function(_0xe2809f){if(_0xe2809f['length']){logger[_0x3af2('0xc')](_0x3af2('0x20'));return _['find'](_0xe2809f,function(_0x486635){return _0x486635[_0x3af2('0x21')][_0x3af2('0x22')]===_0x51e804;});}else{logger[_0x3af2('0xc')](_0x3af2('0x23'));return request({'uri':util[_0x3af2('0xe')](_0x3af2('0x24'),_0x1905c6['remoteUri'])})[_0x3af2('0x1f')](function(_0x256a9a){logger[_0x3af2('0xc')](_0x3af2('0x25'));return _0x256a9a;});}});}else{logger['info'](_0x3af2('0x26'));return request({'uri':util[_0x3af2('0xe')](_0x3af2('0x24'),_0x1905c6[_0x3af2('0x1a')])})[_0x3af2('0x1f')](function(_0x3b0f92){logger[_0x3af2('0xc')]('Admin\x20account\x20selected.');return _0x3b0f92;});}}function getEndUser(_0x1b0c3f,_0x22211b,_0x117fb3){logger['info'](_0x3af2('0x27'),_0x117fb3);return request({'uri':util['format'](_0x3af2('0x28'),_0x1b0c3f[_0x3af2('0x1a')]),'qs':{'phone':_0x117fb3}})['then'](function(_0x2de581){if(_0x2de581[_0x3af2('0x29')]){logger[_0x3af2('0xc')]('Enduser\x20found!');return _[_0x3af2('0x2a')](_0x2de581,{'phone':_0x117fb3});}else{logger[_0x3af2('0xc')](_0x3af2('0x2b'));return request({'uri':util['format'](_0x3af2('0x28'),_0x1b0c3f['remoteUri']),'method':_0x3af2('0x1b'),'body':{'name':_0x22211b,'phone':_0x117fb3}})[_0x3af2('0x1f')](function(_0x4e8d93){logger[_0x3af2('0xc')](_0x3af2('0x2c'));return _0x4e8d93;});}});}function getAuth(_0x4c7178){return util[_0x3af2('0xe')](_0x3af2('0x2d'),new Buffer(_0x4c7178[_0x3af2('0x2e')]+':X')[_0x3af2('0x2f')](_0x3af2('0x30')));}function request(_0x2b76e2){logger[_0x3af2('0x31')]('[HTTP]',JSON[_0x3af2('0x32')](_0x2b76e2));return rp(_[_0x3af2('0x7')](_0x2b76e2,{'method':_0x3af2('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x2bbd6b,_0x291efa){var _0x474e6a=[];if(_0x2bbd6b&&_0x2bbd6b[_0x3af2('0x29')]>0x0){_0x474e6a=_['map'](_0x2bbd6b,_0x291efa);}return _0x474e6a;}function getCustomFields(_0x3a4be5,_0x12928d){var _0x1217de=[];var _0xbaa2ea={'custom_fields':[]};if(_0x3a4be5[_0x3af2('0x29')]>0x0){_[_0x3af2('0x34')](_0x3a4be5,function(_0x552b43){if(_[_0x3af2('0x35')]([_0x3af2('0x36'),_0x3af2('0x37')],_0x552b43[_0x3af2('0x38')])&&_0x552b43[_0x3af2('0x39')]&&!_0x552b43[_0x3af2('0x3a')]){_0xbaa2ea[_0x552b43[_0x3af2('0x39')][_0x3af2('0x3b')]()]=_0x552b43[_0x3af2('0x3c')][_0x3af2('0x2f')]();}else if(_[_0x3af2('0x35')]([_0x3af2('0x36'),'picklist'],_0x552b43[_0x3af2('0x38')])&&_0x552b43['idField']&&_0x552b43['customField']){_0xbaa2ea[_0x3af2('0x16')][_0x3af2('0x3d')]({'id':_0x552b43[_0x3af2('0x3e')],'value':_0x552b43['content']['toString']()});}else if(_0x552b43[_0x3af2('0x38')]===_0x3af2('0x3f')&&_0x552b43[_0x3af2('0x40')]&&_0x552b43[_0x3af2('0x3e')]&&_0x552b43['customField']){_0x12928d[_0x552b43[_0x3af2('0x40')]]&&_0xbaa2ea[_0x3af2('0x16')][_0x3af2('0x3d')]({'id':_0x552b43[_0x3af2('0x3e')],'value':_0x12928d[_0x552b43[_0x3af2('0x40')]][_0x3af2('0x2f')]()});}else if(_0x552b43[_0x3af2('0x38')]===_0x3af2('0x41')&&_0x552b43[_0x3af2('0x42')]&&_0x552b43['Variable'][_0x3af2('0x14')]&&_0x552b43[_0x3af2('0x3e')]&&_0x552b43[_0x3af2('0x3a')]){_0x12928d[_0x552b43[_0x3af2('0x42')][_0x3af2('0x14')]['toLowerCase']()]&&_0xbaa2ea[_0x3af2('0x16')][_0x3af2('0x3d')]({'id':_0x552b43[_0x3af2('0x3e')],'value':_0x12928d[_0x552b43[_0x3af2('0x42')]['name'][_0x3af2('0x3b')]()][_0x3af2('0x2f')]()});}});}return _0xbaa2ea;}exports['queue']=function(_0x324e63,_0x218218,_0x5137da,_0x34ab6a,_0x18d46a,_0x20a058){var _0x1fc171,_0x26f9f2;_0x20a058[_0x3af2('0x1a')]=intUtil[_0x3af2('0x43')](_0x20a058[_0x3af2('0x1a')]);_0x20a058[_0x3af2('0x44')]=intUtil[_0x3af2('0x43')](_0x20a058[_0x3af2('0x44')]);if(_0x18d46a&&_0x18d46a[_0x3af2('0x45')]){logger[_0x3af2('0xc')](_0x3af2('0x46'),_0x3af2('0x47'));_0x218218[_0x3af2('0x48')]=util[_0x3af2('0xe')](_0x3af2('0x49'),_0x20a058[_0x3af2('0x44')],_0x218218[_0x3af2('0x4a')],md5(_0x218218['uniqueid']));}else{_0x218218['recordingURL']='';}headers['Authorization']=getAuth(_0x20a058);return getUser(_0x20a058,_0x34ab6a[_0x3af2('0x22')])[_0x3af2('0x1f')](function(_0x3e159){_0x1fc171=_0x3e159;logger[_0x3af2('0xc')](_0x3af2('0x4b'),_0x1fc171['id']);return getEndUser(_0x20a058,_0x218218[_0x3af2('0xf')],_0x218218[_0x3af2('0x4c')]);})[_0x3af2('0x1f')](function(_0x5ee884){_0x26f9f2=_0x5ee884;logger[_0x3af2('0xc')](_0x3af2('0x4d'),_0x26f9f2['id']);return getTicket(_0x20a058,_0x1fc171,_0x26f9f2,_0x5137da,_0x218218);})[_0x3af2('0x1f')](function(_0x2e5997){if(_0x2e5997&&_0x2e5997['id']){logger[_0x3af2('0xc')](_0x3af2('0x1c'));logger['info'](_0x3af2('0x4e'),_0x2e5997['id']);logger[_0x3af2('0xc')](_0x3af2('0x46'),_0x3af2('0x4f'));emit(util[_0x3af2('0xe')](_0x3af2('0x50'),_0x34ab6a['name']),_0x3af2('0x51'),{'uri':util[_0x3af2('0xe')]('%s/helpdesk/tickets/%d',_0x20a058[_0x3af2('0x1a')],_0x2e5997['id'])});}})[_0x3af2('0x52')](function(_0x7be1ea){logger[_0x3af2('0x53')](_0x3af2('0x46'),JSON[_0x3af2('0x32')](_0x7be1ea));});};exports['outbound']=function(_0x1d27fc,_0x328dda,_0xd52803,_0x1e9672,_0x4ac12e,_0x1d96db,_0x5a0fa1){var _0xb027d3,_0x256ada;_0x1d96db['remoteUri']=intUtil['stripTrailingSlash'](_0x1d96db[_0x3af2('0x1a')]);_0x1d96db[_0x3af2('0x44')]=intUtil[_0x3af2('0x43')](_0x1d96db[_0x3af2('0x44')]);if(_0x5a0fa1&&_0x5a0fa1['recordingFormat']&&_0x5a0fa1[_0x3af2('0x54')]!=='none'){logger[_0x3af2('0xc')](_0x3af2('0x55'),'Recording\x20is\x20enabled!');_0x328dda[_0x3af2('0x48')]=util[_0x3af2('0xe')](_0x3af2('0x49'),_0x1d96db[_0x3af2('0x44')],_0x328dda[_0x3af2('0x4a')],md5(_0x328dda[_0x3af2('0x4a')]));}headers[_0x3af2('0x56')]=getAuth(_0x1d96db);return getUser(_0x1d96db,_0x1e9672[_0x3af2('0x22')])[_0x3af2('0x1f')](function(_0xfd4ee6){_0xb027d3=_0xfd4ee6;logger[_0x3af2('0xc')](_0x3af2('0x4b'),_0xb027d3['id']);return getEndUser(_0x1d96db,_0x328dda[_0x3af2('0x57')],_0x328dda[_0x3af2('0x58')]);})['then'](function(_0x3fd4f8){_0x256ada=_0x3fd4f8;logger[_0x3af2('0xc')](_0x3af2('0x4d'),_0x256ada['id']);return getTicket(_0x1d96db,_0xb027d3,_0x256ada,_0xd52803,_0x328dda);})[_0x3af2('0x1f')](function(_0x32f162){if(_0x32f162&&_0x32f162['id']){logger['info']('Ticket\x20created!');logger['info'](_0x3af2('0x4e'),_0x32f162['id']);logger[_0x3af2('0xc')](_0x3af2('0x55'),_0x3af2('0x4f'));emit(util[_0x3af2('0xe')](_0x3af2('0x50'),_0x1e9672[_0x3af2('0x14')]),'trigger:browser:url',{'uri':util[_0x3af2('0xe')](_0x3af2('0x59'),_0x1d96db[_0x3af2('0x1a')],_0x32f162['id'])});}})['catch'](function(_0x51eb58){logger[_0x3af2('0x53')](_0x3af2('0x55'),JSON['stringify'](_0x51eb58));});};exports[_0x3af2('0x5a')]=function(_0x4868d3,_0x247684,_0x9b72bc,_0x5328ce,_0xa23491,_0x1f6107){var _0x4d9c2a,_0x2db369;_0x1f6107['remoteUri']=intUtil[_0x3af2('0x43')](_0x1f6107[_0x3af2('0x1a')]);_0x1f6107[_0x3af2('0x44')]=intUtil[_0x3af2('0x43')](_0x1f6107[_0x3af2('0x44')]);if(_0xa23491&&_0xa23491[_0x3af2('0x45')]){logger['info']('['+_0x247684['lastevent']['toUpperCase']()+']',_0x3af2('0x47'));_0x247684['recordingURL']=util[_0x3af2('0xe')](_0x3af2('0x49'),_0x1f6107[_0x3af2('0x44')],_0x247684[_0x3af2('0x4a')],md5(_0x247684[_0x3af2('0x4a')]));}else{_0x247684['recordingURL']='';}headers['Authorization']=getAuth(_0x1f6107);return getUser(_0x1f6107,'')['then'](function(_0xd9704c){_0x4d9c2a=_0xd9704c;logger[_0x3af2('0xc')](_0x3af2('0x4b'),_0x4d9c2a['id']);return getEndUser(_0x1f6107,_0x247684['calleridname'],_0x247684[_0x3af2('0x4c')]);})[_0x3af2('0x1f')](function(_0x5d8fc3){_0x2db369=_0x5d8fc3;logger[_0x3af2('0xc')](_0x3af2('0x4d'),_0x2db369['id']);return getTicket(_0x1f6107,_0x4d9c2a,_0x2db369,_0x9b72bc,_0x247684);})[_0x3af2('0x1f')](function(_0x2bf509){if(_0x2bf509){logger['info'](_0x3af2('0x1c'));logger['info'](_0x3af2('0x4e'),_0x2bf509['id']);}})['catch'](function(_0x1ef5e4){logger[_0x3af2('0x53')]('['+_0x247684[_0x3af2('0x5b')][_0x3af2('0x5c')]()+']',JSON['stringify'](_0x1ef5e4));});}; \ 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 cd5bfbf..93b0d96 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 _0x63ef=['format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','stripTrailingSlash','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','catch','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts'];(function(_0x53cc73,_0x23e1fd){var _0x13e91d=function(_0x551a1a){while(--_0x551a1a){_0x53cc73['push'](_0x53cc73['shift']());}};_0x13e91d(++_0x23e1fd);}(_0x63ef,0x80));var _0xf63e=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x63ef[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0xf63e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf63e('0x1'));var moment=require(_0xf63e('0x2'));var Promise=require(_0xf63e('0x3'));var Redis=require(_0xf63e('0x4'));var intUtil=require(_0xf63e('0x5'));var config=require(_0xf63e('0x6'));var logger=require('../../../../config/logger')(_0xf63e('0x7'));config[_0xf63e('0x8')]=_[_0xf63e('0x9')](config[_0xf63e('0x8')],{'host':_0xf63e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x1c1001,_0xacde63,_0x5ebdfc,_0x37bdd6){return new Promise(function(_0x1a8413,_0x2af192){var _0x2fdf04=![];var _0x492367={'method':_0xf63e('0xb'),'uri':_0x37bdd6+_0xf63e('0xc'),'json':!![]};_0x492367['headers']=_0x5ebdfc;logger[_0xf63e('0xd')](_0xf63e('0xe'));return rp(_0x492367)[_0xf63e('0xf')](function(_0x46c3fe){if(_0x46c3fe){var _0x5b54c2=_0x46c3fe[_0xf63e('0x10')];var _0x1f45ce=null;for(_0x1f45ce=0x0;_0x1f45ce<_0x5b54c2[_0xf63e('0x11')];_0x1f45ce++){if(_0x5b54c2[_0x1f45ce]['email']===_0x1c1001[_0xf63e('0x12')]){_0x1c1001[_0xf63e('0x13')]=_0x5b54c2[_0x1f45ce]['id'];_0x2fdf04=!![];}}if(_0x2fdf04){logger[_0xf63e('0xd')](_0xf63e('0x14'),_0x1c1001[_0xf63e('0x13')]);_0x1a8413(_0x1c1001);}else{_0x2af192({'statusCode':0x194,'message':_0xf63e('0x15')});}}else{_0x2af192({'statusCode':0x194,'message':_0xf63e('0x15')});}})['catch'](function(_0x52b3d9){logger[_0xf63e('0x16')]('['+[_0xacde63['toUpperCase']()]+']',_0x52b3d9[_0xf63e('0x17')]);_0x2af192(_0x52b3d9);});});}function getUser(_0x16b74e,_0x365f0b,_0x41bfbf){return function(_0x24d349){return new Promise(function(_0x4b634f,_0x2b4c4f){var _0x864e89={'method':_0xf63e('0xb'),'uri':_0x41bfbf+_0xf63e('0xc'),'json':!![]};_0x864e89['headers']=_0x365f0b;logger[_0xf63e('0xd')](_0xf63e('0x18'));return rp(_0x864e89)[_0xf63e('0xf')](function(_0x5fc339){if(_0x5fc339){var _0x32f8ab=_0x5fc339['users'];var _0x32b3f3=![];var _0x4e720d=null;if(_0x24d349[_0xf63e('0x19')]!==null){logger[_0xf63e('0xd')](_0xf63e('0x1a'),_0x24d349[_0xf63e('0x19')]);_0x24d349[_0xf63e('0x1b')]=_0x24d349['agentEmail'];for(_0x4e720d=0x0;_0x4e720d<_0x32f8ab[_0xf63e('0x11')];_0x4e720d++){if(_0x32f8ab[_0x4e720d]['email']===_0x24d349[_0xf63e('0x19')]){_0x32b3f3=!![];_0x24d349['userId']=_0x32f8ab[_0x4e720d]['id'];logger[_0xf63e('0xd')](_0xf63e('0x1c'),_0x24d349[_0xf63e('0x1d')]);}}}if(!_0x32b3f3){logger['info'](_0xf63e('0x1e'));_0x24d349[_0xf63e('0x1b')]=_0x24d349['adminEmail'];_0x24d349[_0xf63e('0x1d')]=_0x24d349[_0xf63e('0x13')];_0x32b3f3=!![];}if(_0x32b3f3){_0x4b634f(_0x24d349);}else{_0x2b4c4f({'statusCode':0x194,'message':_0xf63e('0x15')});}}else{_0x2b4c4f({'statusCode':0x194,'message':_0xf63e('0x15')});}})[_0xf63e('0x1f')](function(_0x5a8655){logger[_0xf63e('0x16')]('['+[_0x16b74e[_0xf63e('0x20')]()]+']',_0x5a8655[_0xf63e('0x17')]);_0x2b4c4f(_0x5a8655);});});};}function searchContact(_0x1872f9,_0x529425,_0x4af9ea,_0x4b36bc){return new Promise(function(_0x288a5c,_0x56336e){var _0x38b12f={'method':'GET','headers':_0x529425,'uri':_0x1872f9+_0xf63e('0x21')+_0x4b36bc+_0xf63e('0x22')+_0x4af9ea+_0xf63e('0x23'),'json':!![]};rp(_0x38b12f)[_0xf63e('0xf')](function(_0x171edb){var _0x3ea237=_[_0xf63e('0x24')](_0x171edb[_0xf63e('0x25')][_0xf63e('0x25')],[_0x4af9ea,_0x4b36bc]);_0x288a5c(_0x3ea237);})[_0xf63e('0x1f')](function(_0x2a28fe){_0x56336e(_0x2a28fe);});});}function getEndUser(_0x23ef7b,_0x2dddc5,_0x384d33){return function(_0x23d551){return new Promise(function(_0x2d1947,_0x5edf65){logger['info'](util[_0xf63e('0x26')](_0xf63e('0x27'),_0x23d551[_0xf63e('0x28')]));searchContact(_0x384d33,_0x2dddc5,_0xf63e('0x29'),_0x23d551['contactNumber'])[_0xf63e('0xf')](function(_0x237884){if(_0x237884){_0x23d551[_0xf63e('0x2a')]=_0x237884['id'];logger['info'](_0xf63e('0x2b'),_0x23d551[_0xf63e('0x2a')]);return _0x2d1947(_0x23d551);}searchContact(_0x384d33,_0x2dddc5,_0xf63e('0x2c'),_0x23d551[_0xf63e('0x28')])['then'](function(_0x49b1ed){if(_0x49b1ed){_0x23d551[_0xf63e('0x2a')]=_0x49b1ed['id'];logger[_0xf63e('0xd')]('Contact\x20found\x20work_number:',_0x23d551['endUserId']);return _0x2d1947(_0x23d551);}createEndUser(_0x23d551,_0x23ef7b,_0x2dddc5,_0x384d33)[_0xf63e('0xf')](function(_0x247463){logger[_0xf63e('0xd')]('Contact\x20created:',_0x247463[_0xf63e('0x2a')]);return _0x2d1947(_0x247463);});});})[_0xf63e('0x1f')](function(_0x393e47){_0x5edf65(_0x393e47);});});};}function createEndUser(_0x540b00,_0x47b58f,_0x55b562,_0x1e65d9){return new Promise(function(_0x4409ad,_0x1a9549){var _0x1a0f23=moment();var _0x10af65={'method':_0xf63e('0x2d'),'uri':_0x1e65d9+_0xf63e('0x2e'),'body':{'contact':{'last_name':_0x540b00['contactNumber'],'work_number':_0x540b00[_0xf63e('0x28')],'mobile_number':_0x540b00[_0xf63e('0x28')],'owner_id':_0x540b00[_0xf63e('0x1d')],'created_at':_0x1a0f23['format'](_0xf63e('0x2f'))}},'json':!![]};_0x10af65[_0xf63e('0x30')]=_0x55b562;logger['info'](_0xf63e('0x31'));return rp(_0x10af65)[_0xf63e('0xf')](function(_0x1ce190){_0x540b00[_0xf63e('0x2a')]=_0x1ce190[_0xf63e('0x32')]['id'];_0x4409ad(_0x540b00);})[_0xf63e('0x1f')](function(_0x43eb0b){logger[_0xf63e('0x16')]('['+[_0x47b58f['toUpperCase']()]+']',_0x43eb0b[_0xf63e('0x17')]);_0x1a9549(_0x43eb0b[_0xf63e('0x17')]);});});}function getTicket(_0x143b70,_0x3939b6,_0x206f4f,_0x311a45,_0x553080){return function(_0x278913){logger[_0xf63e('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x57181a,_0xe519e5){var _0x274466=moment();var _0x5bcc3b={'method':_0xf63e('0x2d'),'uri':_0x206f4f+_0xf63e('0x33'),'body':{'title':intUtil['getString'](_0x311a45['Subjects'],_0x553080,'\x20'),'description':intUtil[_0xf63e('0x34')](_0x311a45['Descriptions'],_0x553080,'\x0a'),'owner_id':_0x278913[_0xf63e('0x1d')],'creater_id':_0x278913['adminId'],'targetable_id':_0x278913[_0xf63e('0x2a')],'targetable_type':_0xf63e('0x35'),'created_at':_0x274466[_0xf63e('0x26')](_0xf63e('0x2f')),'due_date':_0x274466[_0xf63e('0x36')](0x1e,'m')[_0xf63e('0x26')](_0xf63e('0x2f'))},'json':!![]};_0x5bcc3b[_0xf63e('0x30')]=_0x3939b6;return rp(_0x5bcc3b)[_0xf63e('0xf')](function(_0x59838c){_0x278913[_0xf63e('0x37')]=_0x59838c['task']['id'];logger[_0xf63e('0xd')](_0xf63e('0x38'),_0x278913[_0xf63e('0x37')]);_0x57181a(_0x278913);})[_0xf63e('0x1f')](function(_0x5b29da){logger[_0xf63e('0x16')]('['+[_0x143b70['toUpperCase']()]+']',_0x5b29da[_0xf63e('0x17')]);_0xe519e5(_0x5b29da['message']);});});};}function emit(_0x486baa,_0x451c56,_0xa16397){var _0x51cbfd={'uri':_0x486baa+_0xf63e('0x39')+_0xa16397};io['to'](util['format'](_0xf63e('0x3a'),_0x451c56))[_0xf63e('0x3b')]('trigger:browser:url',_0x51cbfd);}exports['cs']=function(_0x5e92f9,_0x2ea247,_0xc4d25f,_0xfcbd66,_0x2fca68,_0x4116f1,_0x1298ea,_0x35f9bd){var _0x178799={};var _0x5dde46={'Authorization':_0xf63e('0x3c')+_0x4116f1['apiKey']};_0x4116f1['remoteUri']=intUtil[_0xf63e('0x3d')](_0x4116f1[_0xf63e('0x3e')]);_0x4116f1['serverUrl']=intUtil[_0xf63e('0x3d')](_0x4116f1['serverUrl']);var _0x28c811=_0x4116f1['remoteUri'];_0x178799['adminEmail']=_0x4116f1[_0xf63e('0x3f')];_0x178799[_0xf63e('0x28')]=_0x35f9bd[_0xf63e('0x40')]()===_0xf63e('0x41')?_0x2ea247[_0xf63e('0x42')]:_0x2ea247[_0xf63e('0x43')];_0x178799[_0xf63e('0x44')]=_0x35f9bd===_0xf63e('0x45')||_0x35f9bd===_0xf63e('0x46')?'queue':_0xf63e('0x41');if(_0xfcbd66){_0x178799[_0xf63e('0x19')]=_0xfcbd66['email'];}var _0x3bf8d1=util[_0xf63e('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4116f1[_0xf63e('0x47')],_0x2ea247[_0xf63e('0x48')],md5(_0x2ea247['uniqueid']));if(_0x2fca68&&_0x2fca68[_0xf63e('0x49')]){logger['info'](_0xf63e('0x4a'),_0xf63e('0x4b'));_0x2ea247[_0xf63e('0x4c')]=_0x3bf8d1;}else if(_0x1298ea&&_0x1298ea[_0xf63e('0x4d')]&&_0x1298ea['recordingFormat']!==_0xf63e('0x4e')){logger[_0xf63e('0xd')](_0xf63e('0x4f'),_0xf63e('0x4b'));_0x2ea247['recordingURL']=_0x3bf8d1;}else{_0x2ea247[_0xf63e('0x4c')]='';}return getAdminId(_0x178799,_0x35f9bd,_0x5dde46,_0x28c811)[_0xf63e('0xf')](getUser(_0x35f9bd,_0x5dde46,_0x28c811))[_0xf63e('0xf')](getEndUser(_0x35f9bd,_0x5dde46,_0x28c811))[_0xf63e('0xf')](getTicket(_0x35f9bd,_0x5dde46,_0x28c811,_0xc4d25f,_0x2ea247))[_0xf63e('0xf')](function(_0x3f2da5){logger[_0xf63e('0xd')](util[_0xf63e('0x26')](_0xf63e('0x50'),_0x3f2da5[_0xf63e('0x37')]));if(_0x35f9bd!==_0xf63e('0x46')){logger[_0xf63e('0xd')]('['+[_0x35f9bd[_0xf63e('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x28c811,_0xfcbd66['name'],_0x3f2da5[_0xf63e('0x2a')]);}})[_0xf63e('0x1f')](function(_0x5acd43){logger[_0xf63e('0x16')]('['+[_0x35f9bd[_0xf63e('0x20')]()]+_0xf63e('0x51'),util[_0xf63e('0x52')](_0x5acd43,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9952=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','Admin\x20selected','userEmail','userId','toUpperCase','/api/lookup?q=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum'];(function(_0x1c18b9,_0x22bcea){var _0x552b43=function(_0x276446){while(--_0x276446){_0x1c18b9['push'](_0x1c18b9['shift']());}};_0x552b43(++_0x22bcea);}(_0x9952,0x11f));var _0x2995=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x9952[_0x3f5dca];return _0x5b833a;};'use strict';var _=require(_0x2995('0x0'));var rp=require(_0x2995('0x1'));var md5=require(_0x2995('0x2'));var util=require(_0x2995('0x3'));var moment=require(_0x2995('0x4'));var Promise=require(_0x2995('0x5'));var Redis=require(_0x2995('0x6'));var intUtil=require(_0x2995('0x7'));var config=require('../../../../config/environment');var logger=require(_0x2995('0x8'))(_0x2995('0x9'));config[_0x2995('0xa')]=_[_0x2995('0xb')](config['redis'],{'host':_0x2995('0xc'),'port':0x18eb});var io=require(_0x2995('0xd'))(new Redis(config[_0x2995('0xa')]));function getAdminId(_0x156805,_0x4f4de3,_0x94ed26,_0x1bb678){return new Promise(function(_0xeb3aa8,_0x58ad02){var _0x4325be=![];var _0x2dae76={'method':_0x2995('0xe'),'uri':_0x1bb678+_0x2995('0xf'),'json':!![]};_0x2dae76[_0x2995('0x10')]=_0x94ed26;logger[_0x2995('0x11')](_0x2995('0x12'));return rp(_0x2dae76)[_0x2995('0x13')](function(_0x5a023e){if(_0x5a023e){var _0x1011af=_0x5a023e['users'];var _0x4bf74=null;for(_0x4bf74=0x0;_0x4bf74<_0x1011af['length'];_0x4bf74++){if(_0x1011af[_0x4bf74][_0x2995('0x14')]===_0x156805[_0x2995('0x15')]){_0x156805[_0x2995('0x16')]=_0x1011af[_0x4bf74]['id'];_0x4325be=!![];}}if(_0x4325be){logger[_0x2995('0x11')]('Admin\x20found:',_0x156805[_0x2995('0x16')]);_0xeb3aa8(_0x156805);}else{_0x58ad02({'statusCode':0x194,'message':_0x2995('0x17')});}}else{_0x58ad02({'statusCode':0x194,'message':_0x2995('0x17')});}})[_0x2995('0x18')](function(_0xcf04c){logger[_0x2995('0x19')]('['+[_0x4f4de3['toUpperCase']()]+']',_0xcf04c[_0x2995('0x1a')]);_0x58ad02(_0xcf04c);});});}function getUser(_0x30c894,_0x17f960,_0x36bcdf){return function(_0x28cfae){return new Promise(function(_0x460394,_0x5bfa6c){var _0x4e7db9={'method':_0x2995('0xe'),'uri':_0x36bcdf+'/api/selector/owners','json':!![]};_0x4e7db9[_0x2995('0x10')]=_0x17f960;logger[_0x2995('0x11')](_0x2995('0x1b'));return rp(_0x4e7db9)['then'](function(_0x3208fb){if(_0x3208fb){var _0x2596d8=_0x3208fb[_0x2995('0x1c')];var _0x148ff9=![];var _0x4b2db4=null;if(_0x28cfae[_0x2995('0x1d')]!==null){logger[_0x2995('0x11')](_0x2995('0x1e'),_0x28cfae['agentEmail']);_0x28cfae['userEmail']=_0x28cfae[_0x2995('0x1d')];for(_0x4b2db4=0x0;_0x4b2db4<_0x2596d8['length'];_0x4b2db4++){if(_0x2596d8[_0x4b2db4][_0x2995('0x14')]===_0x28cfae[_0x2995('0x1d')]){_0x148ff9=!![];_0x28cfae['userId']=_0x2596d8[_0x4b2db4]['id'];logger[_0x2995('0x11')](_0x2995('0x1f'),_0x28cfae['userId']);}}}if(!_0x148ff9){logger[_0x2995('0x11')](_0x2995('0x20'));_0x28cfae[_0x2995('0x21')]=_0x28cfae[_0x2995('0x15')];_0x28cfae[_0x2995('0x22')]=_0x28cfae[_0x2995('0x16')];_0x148ff9=!![];}if(_0x148ff9){_0x460394(_0x28cfae);}else{_0x5bfa6c({'statusCode':0x194,'message':_0x2995('0x17')});}}else{_0x5bfa6c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x2995('0x18')](function(_0x31f9a9){logger[_0x2995('0x19')]('['+[_0x30c894[_0x2995('0x23')]()]+']',_0x31f9a9[_0x2995('0x1a')]);_0x5bfa6c(_0x31f9a9);});});};}function searchContact(_0x153335,_0xa024e,_0x76f366,_0x49043c){return new Promise(function(_0x3a9ff5,_0x5ed9bc){var _0x10de3a={'method':_0x2995('0xe'),'headers':_0xa024e,'uri':_0x153335+_0x2995('0x24')+_0x49043c+'&f='+_0x76f366+_0x2995('0x25'),'json':!![]};rp(_0x10de3a)[_0x2995('0x13')](function(_0x3471e8){var _0xde370c=_[_0x2995('0x26')](_0x3471e8[_0x2995('0x27')][_0x2995('0x27')],[_0x76f366,_0x49043c]);_0x3a9ff5(_0xde370c);})[_0x2995('0x18')](function(_0x28e76b){_0x5ed9bc(_0x28e76b);});});}function getEndUser(_0x333031,_0x6e013b,_0x2beec8){return function(_0x7bffd3){return new Promise(function(_0x94fe98,_0x3b7d0b){logger[_0x2995('0x11')](util['format'](_0x2995('0x28'),_0x7bffd3[_0x2995('0x29')]));searchContact(_0x2beec8,_0x6e013b,'mobile_number',_0x7bffd3['contactNumber'])['then'](function(_0x1ec6e2){if(_0x1ec6e2){_0x7bffd3[_0x2995('0x2a')]=_0x1ec6e2['id'];logger[_0x2995('0x11')](_0x2995('0x2b'),_0x7bffd3['endUserId']);return _0x94fe98(_0x7bffd3);}searchContact(_0x2beec8,_0x6e013b,_0x2995('0x2c'),_0x7bffd3[_0x2995('0x29')])[_0x2995('0x13')](function(_0x1e8fc4){if(_0x1e8fc4){_0x7bffd3[_0x2995('0x2a')]=_0x1e8fc4['id'];logger[_0x2995('0x11')](_0x2995('0x2d'),_0x7bffd3[_0x2995('0x2a')]);return _0x94fe98(_0x7bffd3);}createEndUser(_0x7bffd3,_0x333031,_0x6e013b,_0x2beec8)['then'](function(_0x1ada47){logger[_0x2995('0x11')](_0x2995('0x2e'),_0x1ada47['endUserId']);return _0x94fe98(_0x1ada47);});});})['catch'](function(_0x2e8fd2){_0x3b7d0b(_0x2e8fd2);});});};}function createEndUser(_0x153aba,_0x362ba8,_0x28d111,_0x57309e){return new Promise(function(_0xeb7226,_0xc21c51){var _0x993ea5=moment();var _0x53ec81={'method':_0x2995('0x2f'),'uri':_0x57309e+_0x2995('0x30'),'body':{'contact':{'last_name':_0x153aba[_0x2995('0x29')],'work_number':_0x153aba[_0x2995('0x29')],'mobile_number':_0x153aba[_0x2995('0x29')],'owner_id':_0x153aba['userId'],'created_at':_0x993ea5[_0x2995('0x31')](_0x2995('0x32'))}},'json':!![]};_0x53ec81[_0x2995('0x10')]=_0x28d111;logger[_0x2995('0x11')](_0x2995('0x33'));return rp(_0x53ec81)[_0x2995('0x13')](function(_0x15027c){_0x153aba[_0x2995('0x2a')]=_0x15027c[_0x2995('0x34')]['id'];_0xeb7226(_0x153aba);})['catch'](function(_0x55b79f){logger[_0x2995('0x19')]('['+[_0x362ba8[_0x2995('0x23')]()]+']',_0x55b79f[_0x2995('0x1a')]);_0xc21c51(_0x55b79f[_0x2995('0x1a')]);});});}function getTicket(_0x3f5cfe,_0x153328,_0x3b7334,_0x27bad7,_0x101fdc){return function(_0x86db63){logger[_0x2995('0x11')]('Creating\x20new\x20task');return new Promise(function(_0xcf844a,_0x535d07){var _0x5595e7=moment();var _0x35764b={'method':_0x2995('0x2f'),'uri':_0x3b7334+_0x2995('0x35'),'body':{'title':intUtil[_0x2995('0x36')](_0x27bad7[_0x2995('0x37')],_0x101fdc,'\x20'),'description':intUtil[_0x2995('0x36')](_0x27bad7[_0x2995('0x38')],_0x101fdc,'\x0a'),'owner_id':_0x86db63[_0x2995('0x22')],'creater_id':_0x86db63['adminId'],'targetable_id':_0x86db63[_0x2995('0x2a')],'targetable_type':_0x2995('0x39'),'created_at':_0x5595e7[_0x2995('0x31')](_0x2995('0x32')),'due_date':_0x5595e7[_0x2995('0x3a')](0x1e,'m')[_0x2995('0x31')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x35764b[_0x2995('0x10')]=_0x153328;return rp(_0x35764b)[_0x2995('0x13')](function(_0x57f090){_0x86db63['ticketId']=_0x57f090['task']['id'];logger[_0x2995('0x11')](_0x2995('0x3b'),_0x86db63[_0x2995('0x3c')]);_0xcf844a(_0x86db63);})[_0x2995('0x18')](function(_0x283247){logger['error']('['+[_0x3f5cfe['toUpperCase']()]+']',_0x283247[_0x2995('0x1a')]);_0x535d07(_0x283247[_0x2995('0x1a')]);});});};}function emit(_0x134e47,_0x21dbda,_0x417c0e){var _0x236937={'uri':_0x134e47+_0x2995('0x3d')+_0x417c0e};io['to'](util[_0x2995('0x31')]('user:%s',_0x21dbda))[_0x2995('0x3e')](_0x2995('0x3f'),_0x236937);}exports['cs']=function(_0x552e44,_0x31170a,_0x5ec855,_0x2bc8d9,_0x1d966c,_0x4cbc02,_0x4e2d46,_0x76bef9){var _0x1a8eeb={};var _0x1041b4={'Authorization':_0x2995('0x40')+_0x4cbc02[_0x2995('0x41')]};_0x4cbc02['remoteUri']=intUtil['stripTrailingSlash'](_0x4cbc02[_0x2995('0x42')]);_0x4cbc02[_0x2995('0x43')]=intUtil[_0x2995('0x44')](_0x4cbc02['serverUrl']);var _0x41d77c=_0x4cbc02[_0x2995('0x42')];_0x1a8eeb['adminEmail']=_0x4cbc02[_0x2995('0x45')];_0x1a8eeb[_0x2995('0x29')]=_0x76bef9[_0x2995('0x46')]()===_0x2995('0x47')?_0x31170a[_0x2995('0x48')]:_0x31170a[_0x2995('0x49')];_0x1a8eeb[_0x2995('0x4a')]=_0x76bef9===_0x2995('0x4b')||_0x76bef9===_0x2995('0x4c')?_0x2995('0x4b'):_0x2995('0x47');if(_0x2bc8d9){_0x1a8eeb[_0x2995('0x1d')]=_0x2bc8d9[_0x2995('0x14')];}var _0x5a88df=util[_0x2995('0x31')](_0x2995('0x4d'),_0x4cbc02[_0x2995('0x43')],_0x31170a[_0x2995('0x4e')],md5(_0x31170a[_0x2995('0x4e')]));if(_0x1d966c&&_0x1d966c[_0x2995('0x4f')]){logger['info'](_0x2995('0x50'),_0x2995('0x51'));_0x31170a['recordingURL']=_0x5a88df;}else if(_0x4e2d46&&_0x4e2d46[_0x2995('0x52')]&&_0x4e2d46[_0x2995('0x52')]!=='none'){logger['info'](_0x2995('0x53'),'Recording\x20is\x20enabled!');_0x31170a['recordingURL']=_0x5a88df;}else{_0x31170a[_0x2995('0x54')]='';}return getAdminId(_0x1a8eeb,_0x76bef9,_0x1041b4,_0x41d77c)[_0x2995('0x13')](getUser(_0x76bef9,_0x1041b4,_0x41d77c))['then'](getEndUser(_0x76bef9,_0x1041b4,_0x41d77c))['then'](getTicket(_0x76bef9,_0x1041b4,_0x41d77c,_0x5ec855,_0x31170a))[_0x2995('0x13')](function(_0x38c3f9){logger[_0x2995('0x11')](util['format'](_0x2995('0x55'),_0x38c3f9[_0x2995('0x3c')]));if(_0x76bef9!=='unmanaged'){logger[_0x2995('0x11')]('['+[_0x76bef9['toUpperCase']()]+']',_0x2995('0x56'));emit(_0x41d77c,_0x2bc8d9[_0x2995('0x57')],_0x38c3f9['endUserId']);}})[_0x2995('0x18')](function(_0x331b9c){logger[_0x2995('0x19')]('['+[_0x76bef9[_0x2995('0x23')]()]+_0x2995('0x58'),util[_0x2995('0x59')](_0x331b9c,{'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 864d8be..c5ac3b7 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 _0x70ff=['outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','queue','routeId'];(function(_0x5b48fa,_0xef0e9b){var _0xc52987=function(_0xcb5ef0){while(--_0xcb5ef0){_0x5b48fa['push'](_0x5b48fa['shift']());}};_0xc52987(++_0xef0e9b);}(_0x70ff,0x1a2));var _0xf70f=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x70ff[_0x502eb0];return _0x4f78e4;};'use strict';var _=require(_0xf70f('0x0'));var util=require(_0xf70f('0x1'));var zendesk=require(_0xf70f('0x2'));var salesforce=require(_0xf70f('0x3'));var sugarcrm=require(_0xf70f('0x4'));var freshdesk=require(_0xf70f('0x5'));var zoho=require('./zoho');var desk=require(_0xf70f('0x6'));var vtiger=require(_0xf70f('0x7'));var servicenow=require(_0xf70f('0x8'));var dynamics365=require(_0xf70f('0x9'));var freshsales=require(_0xf70f('0xa'));var integrations=[_0xf70f('0xb'),_0xf70f('0xc'),'sugarcrm',_0xf70f('0xd'),_0xf70f('0xe'),_0xf70f('0xf'),_0xf70f('0x10'),'dynamics365',_0xf70f('0x11'),_0xf70f('0x12')];exports['exec']=function(_0x182016,_0x4b1ebf,_0x22f1f9,_0x3ddc20,_0x24a923,_0x4af47e){if(_0x22f1f9){if(_[_0xf70f('0x13')](integrations,_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]())){try{var _0x458ae6=null;var _0x5aaa33='';var _0x5a5f8f=_0x22f1f9[_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]()];if(_0x5a5f8f){var _0x329ffc=_0x5a5f8f[_0x182016[_0xf70f('0x16')]];if(_0x329ffc){var _0x56986a=_[_0xf70f('0x17')](_0x329ffc['Configurations'],{'id':parseInt(_0x182016['data3'],0xa)});if(_0x56986a){if(_0x3ddc20){if(_0x24a923&&_0x4b1ebf[_0xf70f('0x18')]){_0x5aaa33=_0xf70f('0x18');}else if(_0x4b1ebf[_0xf70f('0x19')]){_0x5aaa33=_0xf70f('0x1a');}else{console[_0xf70f('0x1b')](_0xf70f('0x1c'),_0x4b1ebf);}}else{_0x5aaa33=_0xf70f('0x1d');}switch(_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]()){case _0xf70f('0xb'):zendesk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0xc'):salesforce[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'sugarcrm':sugarcrm[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0xd'):freshdesk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'zoho':zoho[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'desk':desk[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case _0xf70f('0x10'):vtiger[_0x5aaa33](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e);break;case'freshsales':freshsales['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;case _0xf70f('0x12'):servicenow['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;case'dynamics365':dynamics365['cs'](_0x182016,_0x4b1ebf,_0x56986a,_0x3ddc20,_0x24a923,_0x329ffc,_0x4af47e,_0x5aaa33);break;default:console[_0xf70f('0x1b')](_0xf70f('0x1e'));}}else{_0x458ae6=require('../../../../config/logger')(_0x182016['data1']['toLowerCase']());_0x458ae6[_0xf70f('0x1f')]('[EXEC]',util[_0xf70f('0x20')](_0xf70f('0x21'),_0x182016[_0xf70f('0x14')][_0xf70f('0x15')](),_0x182016[_0xf70f('0x22')]));}}else{_0x458ae6=require(_0xf70f('0x23'))(_0x182016[_0xf70f('0x14')][_0xf70f('0x15')]());_0x458ae6[_0xf70f('0x1f')]('[EXEC]',util[_0xf70f('0x20')](_0xf70f('0x24'),_0x182016[_0xf70f('0x14')]['toLowerCase'](),_0x182016[_0xf70f('0x16')]));}}else{}}catch(_0x1d4b54){console[_0xf70f('0x1f')](_0x1d4b54);}}}}; \ No newline at end of file +var _0xef9e=['%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','zendesk','zoho','vtiger','unknown\x20integration','../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','format'];(function(_0x32047f,_0x5b2085){var _0xd27b05=function(_0x2c03b2){while(--_0x2c03b2){_0x32047f['push'](_0x32047f['shift']());}};_0xd27b05(++_0x5b2085);}(_0xef9e,0x1ef));var _0xeef9=function(_0x5a1b58,_0x40287f){_0x5a1b58=_0x5a1b58-0x0;var _0x1b5032=_0xef9e[_0x5a1b58];return _0x1b5032;};'use strict';var _=require(_0xeef9('0x0'));var util=require('util');var zendesk=require(_0xeef9('0x1'));var salesforce=require(_0xeef9('0x2'));var sugarcrm=require(_0xeef9('0x3'));var freshdesk=require(_0xeef9('0x4'));var zoho=require(_0xeef9('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0xeef9('0x6'));var dynamics365=require(_0xeef9('0x7'));var freshsales=require('./freshsales');var integrations=['zendesk',_0xeef9('0x8'),_0xeef9('0x9'),_0xeef9('0xa'),'zoho',_0xeef9('0xb'),'vtiger',_0xeef9('0xc'),_0xeef9('0xd'),_0xeef9('0xe')];exports[_0xeef9('0xf')]=function(_0x3d630b,_0x5c4878,_0x354153,_0x339cf4,_0x64365f,_0x2e2ac7){if(_0x354153){if(_[_0xeef9('0x10')](integrations,_0x3d630b[_0xeef9('0x11')][_0xeef9('0x12')]())){try{var _0x46c186=null;var _0x5aceb1='';var _0x4a2e48=_0x354153[_0x3d630b[_0xeef9('0x11')][_0xeef9('0x12')]()];if(_0x4a2e48){var _0x3464e5=_0x4a2e48[_0x3d630b[_0xeef9('0x13')]];if(_0x3464e5){var _0x511899=_[_0xeef9('0x14')](_0x3464e5[_0xeef9('0x15')],{'id':parseInt(_0x3d630b[_0xeef9('0x16')],0xa)});if(_0x511899){if(_0x339cf4){if(_0x64365f&&_0x5c4878[_0xeef9('0x17')]){_0x5aceb1=_0xeef9('0x17');}else if(_0x5c4878[_0xeef9('0x18')]){_0x5aceb1='outbound';}else{console[_0xeef9('0x19')](_0xeef9('0x1a'),_0x5c4878);}}else{_0x5aceb1=_0xeef9('0x1b');}switch(_0x3d630b[_0xeef9('0x11')]['toLowerCase']()){case _0xeef9('0x1c'):zendesk[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case _0xeef9('0x8'):salesforce[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case'sugarcrm':sugarcrm[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case'freshdesk':freshdesk[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case _0xeef9('0x1d'):zoho[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case _0xeef9('0xb'):desk[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case _0xeef9('0x1e'):vtiger[_0x5aceb1](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7);break;case'freshsales':freshsales['cs'](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7,_0x5aceb1);break;case _0xeef9('0xe'):servicenow['cs'](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7,_0x5aceb1);break;case'dynamics365':dynamics365['cs'](_0x3d630b,_0x5c4878,_0x511899,_0x339cf4,_0x64365f,_0x3464e5,_0x2e2ac7,_0x5aceb1);break;default:console[_0xeef9('0x19')](_0xeef9('0x1f'));}}else{_0x46c186=require(_0xeef9('0x20'))(_0x3d630b['data1']['toLowerCase']());_0x46c186['error']('[EXEC]',util['format'](_0xeef9('0x21'),_0x3d630b[_0xeef9('0x11')][_0xeef9('0x12')](),_0x3d630b[_0xeef9('0x16')]));}}else{_0x46c186=require('../../../../config/logger')(_0x3d630b[_0xeef9('0x11')][_0xeef9('0x12')]());_0x46c186[_0xeef9('0x22')](_0xeef9('0x23'),util[_0xeef9('0x24')](_0xeef9('0x25'),_0x3d630b[_0xeef9('0x11')]['toLowerCase'](),_0x3d630b['data2']));}}else{}}catch(_0x59cbc0){console[_0xeef9('0x22')](_0x59cbc0);}}}}; \ 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 6263798..8432e10 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 _0x858b=['trigger:salesforce:display','newTab','user:%s','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','recordingURL','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','utc','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','find','then','length','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','Account','first','Name','Phone','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','Caller\x20-\x20%s','','format','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','concat','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','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab'];(function(_0x3c03cc,_0x25723f){var _0xf7e817=function(_0x307054){while(--_0x307054){_0x3c03cc['push'](_0x3c03cc['shift']());}};_0xf7e817(++_0x25723f);}(_0x858b,0x114));var _0xb858=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x858b[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0xb858('0x0'));var rp=require('request-promise');var moment=require(_0xb858('0x1'));var BPromise=require('bluebird');var md5=require(_0xb858('0x2'));var jsforce=require(_0xb858('0x3'));var util=require(_0xb858('0x4'));var Redis=require('ioredis');var intUtil=require(_0xb858('0x5'));var config=require(_0xb858('0x6'));var logger=require(_0xb858('0x7'))(_0xb858('0x8'));config['redis']=_[_0xb858('0x9')](config[_0xb858('0xa')],{'host':_0xb858('0xb'),'port':0x18eb});var io=require(_0xb858('0xc'))(new Redis(config[_0xb858('0xa')]));function emit(_0x3c5ea5,_0x1e37ed,_0x5e7451){io['to'](_0x3c5ea5)[_0xb858('0xd')](_0x1e37ed,_0x5e7451);}function getTicket(_0x15d483,_0x2b57bc,_0x369806,_0x4f8af4,_0x3e91b3,_0x1820ce,_0x232fb2,_0x44bee3){var _0x1115d0=Object['assign']({},{'OwnerId':_0x2b57bc['id'],'Subject':intUtil[_0xb858('0xe')](_0x4f8af4['Subjects'],_0x3e91b3,'\x20'),'Description':intUtil[_0xb858('0xe')](_0x4f8af4[_0xb858('0xf')],_0x3e91b3,'\x0a')},getCustomFields(_0x1820ce,_0x3e91b3));if(_0x369806){if(_0x4f8af4[_0xb858('0x10')]===_0xb858('0x11')){_0x1115d0['ActivityDate']=moment[_0xb858('0x12')]();_0x1115d0['IsReminderSet']=![];_0x1115d0['IsRecurrence']=![];if(_0x369806[_0xb858('0x13')]===_0xb858('0x14')||_0x369806[_0xb858('0x13')]===_0xb858('0x15')){_0x1115d0[_0xb858('0x16')]=_0x369806['id'];}else if(_0x369806[_0xb858('0x13')]==='account'){_0x1115d0[_0xb858('0x17')]=_0x369806['id'];}}else if(_0x4f8af4['ticketType']===_0xb858('0x18')){if(_0x369806[_0xb858('0x13')]==='contact'){_0x1115d0[_0xb858('0x19')]=_0x369806['id'];}else if(_0x369806['endUserType']===_0xb858('0x1a')){_0x1115d0[_0xb858('0x1b')]=_0x369806['id'];}else if(_0x369806[_0xb858('0x13')]===_0xb858('0x15')&&_0x4f8af4['leadId']){_0x1115d0[_0x4f8af4[_0xb858('0x1c')]]=_0x369806['id'];}else{logger[_0xb858('0x1d')](_0xb858('0x1e'));}}}return _0x232fb2[_0xb858('0x1f')](_0x4f8af4[_0xb858('0x10')])[_0xb858('0x20')](_0x1115d0);}function getUser(_0x144ad6,_0x480ff0,_0x45b019){if(!_['isNil'](_0x480ff0)&&intUtil[_0xb858('0x21')](_0x480ff0)){var _0x356b56={'Email':_0x480ff0};var _0x5d0069={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x45b019[_0xb858('0x1f')]('User')[_0xb858('0x22')](_0x356b56,_0x5d0069)['execute']()[_0xb858('0x23')](function(_0x54824f){if(_0x54824f[_0xb858('0x24')]){var _0x436554=_['find'](_0x54824f,function(_0x17c5ae){return _0x17c5ae['Email']===_0x480ff0;});if(_0x436554){logger[_0xb858('0x1d')]('Agent\x20%s\x20found.',_0x480ff0);return BPromise['resolve']({'id':_0x436554['Id'],'name':_0x436554['Name']});}}else{logger[_0xb858('0x1d')](_0xb858('0x25'),_0x480ff0);return _0x45b019['identity']()[_0xb858('0x23')](function(_0xda1af7){return BPromise[_0xb858('0x26')]({'id':_0xda1af7['user_id'],'name':_0xda1af7[_0xb858('0x27')]});});}});}else{logger[_0xb858('0x1d')](_0xb858('0x25'),_0x480ff0);return _0x45b019[_0xb858('0x28')]()['then'](function(_0x1dcc52){return BPromise['resolve']({'id':_0x1dcc52[_0xb858('0x29')],'name':_0x1dcc52[_0xb858('0x27')]});});}}function getEndUser(_0x4f8c08,_0x5136db,_0x3b364a,_0x7021f6,_0xf8e934){var _0x39577e={'$or':{'Phone':_0x7021f6}};var _0xf174c2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb858('0x26')]()['then'](function(){logger[_0xb858('0x1d')](_0xb858('0x2a'),_0x7021f6,_0x5136db[_0xb858('0x2b')]);switch(_0x5136db[_0xb858('0x2b')]){case _0xb858('0x2c'):var _0x30d1d4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db[_0xb858('0x2e')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x30d1d4['$or'],_0x5ccc2d);}return _0xf8e934['sobject']('Contact')['find'](_0x30d1d4,_0xf174c2)[_0xb858('0x30')]()[_0xb858('0x23')](function(_0x37393c){if(_0x37393c&&_0x37393c['length']){return _0x37393c;}else{var _0x5abac9=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchLead']){var _0x12ed80={};_0x12ed80[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_['merge'](_0x5abac9[_0xb858('0x32')],_0x12ed80);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x33'))[_0xb858('0x22')](_0x5abac9,_0xf174c2);}});case _0xb858('0x34'):var _0x111ee4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchAccount']){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x35')]]=_0x7021f6;_[_0xb858('0x2f')](_0x111ee4['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Account')['find'](_0x111ee4,_0xf174c2)[_0xb858('0x30')]()[_0xb858('0x23')](function(_0x1574e8){if(_0x1574e8&&_0x1574e8[_0xb858('0x24')]){return _0x1574e8;}else{var _0x151033=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db['additionalSearchContact']){var _0x333ead={};_0x333ead[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x151033[_0xb858('0x32')],_0x333ead);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x36'))[_0xb858('0x22')](_0x151033,_0xf174c2)[_0xb858('0x23')](function(_0x11c5a1){if(_0x11c5a1&&_0x11c5a1[_0xb858('0x24')]){return _0x11c5a1;}else{var _0x3dc26a=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x31')]){var _0x3b487d={};_0x3b487d[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_[_0xb858('0x2f')](_0x3dc26a[_0xb858('0x32')],_0x3b487d);}return _0xf8e934[_0xb858('0x1f')](_0xb858('0x33'))[_0xb858('0x22')](_0x3dc26a,_0xf174c2);}});}});case'contact':var _0x30d1d4=_[_0xb858('0x2d')](_0x39577e);if(_0x5136db[_0xb858('0x2e')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x2e')]]=_0x7021f6;_[_0xb858('0x2f')](_0x30d1d4['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Contact')[_0xb858('0x22')](_0x30d1d4,_0xf174c2)[_0xb858('0x30')]();case _0xb858('0x15'):var _0x573c8b=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x31')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x31')]]=_0x7021f6;_[_0xb858('0x2f')](_0x573c8b['$or'],_0x5ccc2d);}return _0xf8e934[_0xb858('0x1f')]('Lead')[_0xb858('0x22')](_0x573c8b,_0xf174c2);case'account':var _0x111ee4=_['cloneDeep'](_0x39577e);if(_0x5136db[_0xb858('0x35')]){var _0x5ccc2d={};_0x5ccc2d[_0x5136db[_0xb858('0x35')]]=_0x7021f6;_[_0xb858('0x2f')](_0x111ee4['$or'],_0x5ccc2d);}return _0xf8e934['sobject'](_0xb858('0x37'))['find'](_0x111ee4,_0xf174c2);default:return null;}})['then'](function(_0x4d50e0){if(_0x4d50e0&&_0x4d50e0['length']){var _0x143d9e=_[_0xb858('0x38')](_0x4d50e0);if(_0x143d9e){return BPromise[_0xb858('0x26')]({'id':_0x143d9e['Id'],'name':_0x143d9e[_0xb858('0x39')],'phone':_0x143d9e[_0xb858('0x3a')],'endUserType':_0x143d9e['attributes'][_0xb858('0x3b')]['toLowerCase']()});}}})[_0xb858('0x23')](function(_0x5f225d){if(_0x5f225d){logger['info'](_0xb858('0x3c'),_0x5f225d[_0xb858('0x13')],_0x7021f6);return BPromise[_0xb858('0x26')](_0x5f225d);}else{logger[_0xb858('0x1d')](_0xb858('0x3d'),_0x7021f6);var _0x56d828={'Phone':_0x7021f6};if(_0x5136db['moduleCreate']){if(_0x5136db[_0xb858('0x3e')]===_0xb858('0x14')){logger[_0xb858('0x1d')](_0xb858('0x3f'),_0x7021f6,_0x5136db[_0xb858('0x3e')]);_0x56d828[_0xb858('0x40')]=_0x3b364a!==''?_0x3b364a:util['format'](_0xb858('0x41'),_0x7021f6);}else if(_0x5136db[_0xb858('0x3e')]==='lead'){logger[_0xb858('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x7021f6,_0x5136db[_0xb858('0x3e')]);_0x56d828[_0xb858('0x40')]=_0x3b364a!==_0xb858('0x42')?_0x3b364a:util[_0xb858('0x43')](_0xb858('0x41'),_0x7021f6);_0x56d828[_0xb858('0x44')]=_0xb858('0x45');}else if(_0x5136db['moduleCreate']===_0xb858('0x1a')){logger[_0xb858('0x1d')](_0xb858('0x3f'),_0x7021f6,_0x5136db['moduleCreate']);_0x56d828[_0xb858('0x39')]=_0x3b364a!==_0xb858('0x42')?_0x3b364a:util[_0xb858('0x43')]('Caller\x20-\x20%s',_0x7021f6);}else{return null;}}return _0xf8e934[_0xb858('0x1f')](_[_0xb858('0x46')](_0x5136db[_0xb858('0x3e')]))[_0xb858('0x20')](_0x56d828)['then'](function(_0x3bcdb8){return BPromise['resolve']({'id':_0x3bcdb8['id'],'endUserType':_0x5136db['moduleCreate']});});}});}function getCustomFields(_0x4f673f,_0x2307f0){var _0x48eb0c={};if(_0x4f673f['length']>0x0){_[_0xb858('0x47')](_0x4f673f,function(_0x485544){if(_[_0xb858('0x48')](['string',_0xb858('0x49')],_0x485544[_0xb858('0x3b')])&&_0x485544[_0xb858('0x4a')]){_0x48eb0c[_0x485544[_0xb858('0x4a')]]=_0x485544[_0xb858('0x4b')][_0xb858('0x4c')]();}else if(_0x485544['type']==='variable'&&_0x485544[_0xb858('0x4d')]&&_0x485544[_0xb858('0x4a')]){_0x2307f0[_0x485544[_0xb858('0x4d')]]&&(_0x48eb0c[_0x485544['idField']]=_0x2307f0[_0x485544['variableName']][_0xb858('0x4c')]());}else if(_0x485544[_0xb858('0x3b')]===_0xb858('0x4e')&&_0x485544[_0xb858('0x4f')]&&_0x485544[_0xb858('0x4f')][_0xb858('0x50')]&&_0x485544[_0xb858('0x4a')]){_0x2307f0[_0x485544[_0xb858('0x4f')][_0xb858('0x50')][_0xb858('0x51')]()]&&(_0x48eb0c[_0x485544[_0xb858('0x4a')]]=_0x2307f0[_0x485544[_0xb858('0x4f')]['name']['toLowerCase']()][_0xb858('0x4c')]());}});}return _0x48eb0c;}function getConnection(_0x593b92){var _0x4afe24=_0x593b92[_0xb858('0x52')][_0xb858('0x53')](_0x593b92['securityToken']);var _0x33c15b=new jsforce[(_0xb858('0x54'))]({'oauth2':{'loginUrl':_0x593b92[_0xb858('0x55')]||_0xb858('0x56'),'clientId':_0x593b92[_0xb858('0x57')],'clientSecret':_0x593b92[_0xb858('0x58')]}});return _0x33c15b[_0xb858('0x59')](_0x593b92[_0xb858('0x5a')],_0x4afe24)[_0xb858('0x23')](function(){logger[_0xb858('0x1d')](_0xb858('0x5b'));return _0x33c15b;});}exports[_0xb858('0x5c')]=function(_0x5c317c,_0x3aee97,_0x3b2220,_0x379a9d,_0xa56d2d,_0x49e810){var _0x111cda,_0x3bf59a,_0x1ed865,_0x246385;_0x49e810[_0xb858('0x5d')]=intUtil[_0xb858('0x5e')](_0x49e810[_0xb858('0x5d')]);_0x49e810[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x49e810[_0xb858('0x55')]);if(_0xa56d2d&&_0xa56d2d[_0xb858('0x5f')]){logger[_0xb858('0x1d')](_0xb858('0x60'),_0xb858('0x61'));_0x3aee97['recordingURL']=util['format'](_0xb858('0x62'),_0x49e810[_0xb858('0x5d')],_0x3aee97[_0xb858('0x63')],md5(_0x3aee97[_0xb858('0x63')]));}else{_0x3aee97['recordingURL']='';}return getConnection(_0x49e810)[_0xb858('0x23')](function(_0x5718cc){_0x246385=_0x5718cc;return getUser(_0x49e810,_0x379a9d[_0xb858('0x64')],_0x246385);})[_0xb858('0x23')](function(_0x364c0b){_0x111cda=_0x364c0b;return getEndUser(_0x49e810,_0x3b2220,_0x3aee97[_0xb858('0x65')],_0x3aee97[_0xb858('0x66')],_0x246385);})[_0xb858('0x23')](function(_0x3a575b){_0x3bf59a=_0x3a575b;return getTicket(_0x49e810,_0x111cda,_0x3bf59a,_0x3b2220,_0x3aee97,_0x3b2220['Fields'],_0x246385,'queue');})[_0xb858('0x23')](function(_0x333d0b){_0x1ed865=_0x333d0b;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x1ed865['id']);logger[_0xb858('0x1d')](_0xb858('0x67'),_0x1ed865['id'],_0x379a9d[_0xb858('0x50')],_0x49e810[_0xb858('0x3b')]);switch(_0x49e810[_0xb858('0x3b')]){case _0xb858('0x68'):emit(util[_0xb858('0x43')]('user:%s',_0x379a9d[_0xb858('0x50')]),_0xb858('0x69'),{'recordId':_0x1ed865['id']});break;case _0xb858('0x6a'):emit(util[_0xb858('0x43')](_0xb858('0x6b'),_0x379a9d[_0xb858('0x50')]),'trigger:browser:url',{'uri':util['format'](_0xb858('0x6c'),_0x246385['instanceUrl'],_0x1ed865['id'])});break;default:logger[_0xb858('0x6d')](_0xb858('0x6e'));}})[_0xb858('0x6f')](function(_0x56a35a){logger[_0xb858('0x6d')](_0xb858('0x60'),_0x56a35a);});};exports[_0xb858('0x70')]=function(_0xdedccf,_0x408b5a,_0x2c128f,_0x3e1e97,_0x4f54da,_0x143c17,_0x48127f){var _0x46d02f,_0xc4c89e,_0x417067,_0x3dfa61;_0x143c17['serverUrl']=intUtil['stripTrailingSlash'](_0x143c17[_0xb858('0x5d')]);_0x143c17[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x143c17[_0xb858('0x55')]);if(_0x48127f&&_0x48127f[_0xb858('0x71')]&&_0x48127f['recordingFormat']!=='none'){logger[_0xb858('0x1d')](_0xb858('0x72'),'Recording\x20is\x20enabled!');_0x408b5a[_0xb858('0x73')]=util[_0xb858('0x43')](_0xb858('0x62'),_0x143c17[_0xb858('0x5d')],_0x408b5a[_0xb858('0x63')],md5(_0x408b5a['uniqueid']));}return getConnection(_0x143c17)[_0xb858('0x23')](function(_0x26117e){_0x3dfa61=_0x26117e;return getUser(_0x143c17,_0x3e1e97[_0xb858('0x64')],_0x3dfa61);})[_0xb858('0x23')](function(_0x5dfe87){_0x46d02f=_0x5dfe87;return getEndUser(_0x143c17,_0x2c128f,_0x408b5a['destcalleridname'],_0x408b5a['destcalleridnum'],_0x3dfa61);})[_0xb858('0x23')](function(_0x6a38c){_0xc4c89e=_0x6a38c;return getTicket(_0x143c17,_0x46d02f,_0xc4c89e,_0x2c128f,_0x408b5a,_0x2c128f[_0xb858('0x74')],_0x3dfa61,'outbound');})[_0xb858('0x23')](function(_0x42d527){_0x417067=_0x42d527;logger[_0xb858('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x417067['id']);logger[_0xb858('0x1d')](_0xb858('0x75'),_0x417067['id'],_0x3e1e97[_0xb858('0x50')],_0x143c17['type']);switch(_0x143c17['type']){case'integrationTab':emit(util[_0xb858('0x43')](_0xb858('0x6b'),_0x3e1e97[_0xb858('0x50')]),_0xb858('0x69'),{'recordId':_0x417067['id']});break;case _0xb858('0x6a'):emit(util['format'](_0xb858('0x6b'),_0x3e1e97[_0xb858('0x50')]),_0xb858('0x76'),{'uri':util[_0xb858('0x43')]('%s/%s/e',_0x3dfa61[_0xb858('0x77')],_0x417067['id'])});break;default:logger[_0xb858('0x6d')](_0xb858('0x72'),_0xb858('0x78'));}})[_0xb858('0x6f')](function(_0x2740fa){logger['error'](_0xb858('0x72'),_0x2740fa);});};exports[_0xb858('0x79')]=function(_0x434493,_0x2b43ef,_0x5b39a9,_0x1562e4,_0x4ef898,_0x432266){var _0x4a3182,_0x6bb8b2,_0x5a25dc,_0x5be504;_0x432266[_0xb858('0x5d')]=intUtil[_0xb858('0x5e')](_0x432266[_0xb858('0x5d')]);_0x432266[_0xb858('0x55')]=intUtil[_0xb858('0x5e')](_0x432266[_0xb858('0x55')]);if(_0x4ef898&&_0x4ef898[_0xb858('0x5f')]){logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2b43ef[_0xb858('0x73')]=util[_0xb858('0x43')](_0xb858('0x62'),_0x432266[_0xb858('0x5d')],_0x2b43ef[_0xb858('0x63')],md5(_0x2b43ef[_0xb858('0x63')]));}else{_0x2b43ef['recordingURL']='';}return getConnection(_0x432266)[_0xb858('0x23')](function(_0x3e5b5a){_0x5be504=_0x3e5b5a;if(!_[_0xb858('0x7b')](_0x1562e4)){return getUser(_0x432266,_0x1562e4[_0xb858('0x50')],_0x5be504);}else{return getUser(_0x432266,null,_0x5be504);}})[_0xb858('0x23')](function(_0x3a1e4f){_0x4a3182=_0x3a1e4f;return getEndUser(_0x432266,_0x5b39a9,_0x2b43ef['calleridname'],_0x2b43ef[_0xb858('0x66')],_0x5be504);})[_0xb858('0x23')](function(_0x1138dd){_0x6bb8b2=_0x1138dd;return getTicket(_0x432266,_0x4a3182,_0x6bb8b2,_0x5b39a9,_0x2b43ef,_0x5b39a9['Fields'],_0x5be504);})[_0xb858('0x23')](function(_0x3cde83){_0x5a25dc=_0x3cde83;logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')][_0xb858('0x7c')]()+_0xb858('0x7d'),_0x5a25dc['id']);logger[_0xb858('0x1d')]('['+_0x2b43ef[_0xb858('0x7a')]['toUpperCase']()+_0xb858('0x7e'),_0x432266['type']);})[_0xb858('0x6f')](function(_0x68412f){logger[_0xb858('0x6d')]('['+_0x2b43ef['lastevent'][_0xb858('0x7c')]()+']',_0x68412f);});}; \ No newline at end of file +var _0xe163=['additionalSearchAccount','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','upperFirst','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','Connection','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','assign','getString','Descriptions','ticketType','Task','ActivityDate','contact','endUserType','lead','account','Case','ContactId','info','sobject','create','isNil','validateEmail','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead'];(function(_0x9eb6c0,_0x4a1995){var _0x2a4010=function(_0x305652){while(--_0x305652){_0x9eb6c0['push'](_0x9eb6c0['shift']());}};_0x2a4010(++_0x4a1995);}(_0xe163,0xc0));var _0x3e16=function(_0xd572e9,_0xec9aa3){_0xd572e9=_0xd572e9-0x0;var _0x4dbd7c=_0xe163[_0xd572e9];return _0x4dbd7c;};'use strict';var _=require(_0x3e16('0x0'));var rp=require(_0x3e16('0x1'));var moment=require(_0x3e16('0x2'));var BPromise=require('bluebird');var md5=require(_0x3e16('0x3'));var jsforce=require(_0x3e16('0x4'));var util=require(_0x3e16('0x5'));var Redis=require(_0x3e16('0x6'));var intUtil=require('./util');var config=require(_0x3e16('0x7'));var logger=require(_0x3e16('0x8'))('salesforce');config[_0x3e16('0x9')]=_[_0x3e16('0xa')](config[_0x3e16('0x9')],{'host':_0x3e16('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3e16('0x9')]));function emit(_0x303d34,_0x445dd2,_0x399446){io['to'](_0x303d34)['emit'](_0x445dd2,_0x399446);}function getTicket(_0x11d2ed,_0x25a0fd,_0x4c6d25,_0x34acae,_0x1d3e9c,_0xd115ff,_0x584b5b,_0x2c15cc){var _0x1e9c49=Object[_0x3e16('0xc')]({},{'OwnerId':_0x25a0fd['id'],'Subject':intUtil[_0x3e16('0xd')](_0x34acae['Subjects'],_0x1d3e9c,'\x20'),'Description':intUtil[_0x3e16('0xd')](_0x34acae[_0x3e16('0xe')],_0x1d3e9c,'\x0a')},getCustomFields(_0xd115ff,_0x1d3e9c));if(_0x4c6d25){if(_0x34acae[_0x3e16('0xf')]===_0x3e16('0x10')){_0x1e9c49[_0x3e16('0x11')]=moment['utc']();_0x1e9c49['IsReminderSet']=![];_0x1e9c49['IsRecurrence']=![];if(_0x4c6d25['endUserType']===_0x3e16('0x12')||_0x4c6d25[_0x3e16('0x13')]===_0x3e16('0x14')){_0x1e9c49['WhoId']=_0x4c6d25['id'];}else if(_0x4c6d25[_0x3e16('0x13')]===_0x3e16('0x15')){_0x1e9c49['WhatId']=_0x4c6d25['id'];}}else if(_0x34acae[_0x3e16('0xf')]===_0x3e16('0x16')){if(_0x4c6d25[_0x3e16('0x13')]===_0x3e16('0x12')){_0x1e9c49[_0x3e16('0x17')]=_0x4c6d25['id'];}else if(_0x4c6d25[_0x3e16('0x13')]===_0x3e16('0x15')){_0x1e9c49['AccountId']=_0x4c6d25['id'];}else if(_0x4c6d25[_0x3e16('0x13')]===_0x3e16('0x14')&&_0x34acae['leadId']){_0x1e9c49[_0x34acae['leadId']]=_0x4c6d25['id'];}else{logger[_0x3e16('0x18')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x584b5b[_0x3e16('0x19')](_0x34acae[_0x3e16('0xf')])[_0x3e16('0x1a')](_0x1e9c49);}function getUser(_0x282537,_0x3a77db,_0x4b916b){if(!_[_0x3e16('0x1b')](_0x3a77db)&&intUtil[_0x3e16('0x1c')](_0x3a77db)){var _0x109299={'Email':_0x3a77db};var _0x1e020b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4b916b[_0x3e16('0x19')]('User')[_0x3e16('0x1d')](_0x109299,_0x1e020b)[_0x3e16('0x1e')]()[_0x3e16('0x1f')](function(_0x1f6cc6){if(_0x1f6cc6[_0x3e16('0x20')]){var _0x363ca9=_[_0x3e16('0x1d')](_0x1f6cc6,function(_0x533244){return _0x533244['Email']===_0x3a77db;});if(_0x363ca9){logger[_0x3e16('0x18')](_0x3e16('0x21'),_0x3a77db);return BPromise[_0x3e16('0x22')]({'id':_0x363ca9['Id'],'name':_0x363ca9[_0x3e16('0x23')]});}}else{logger[_0x3e16('0x18')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3a77db);return _0x4b916b[_0x3e16('0x24')]()['then'](function(_0x53b227){return BPromise[_0x3e16('0x22')]({'id':_0x53b227[_0x3e16('0x25')],'name':_0x53b227[_0x3e16('0x26')]});});}});}else{logger[_0x3e16('0x18')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3a77db);return _0x4b916b[_0x3e16('0x24')]()['then'](function(_0x5e72b6){return BPromise[_0x3e16('0x22')]({'id':_0x5e72b6[_0x3e16('0x25')],'name':_0x5e72b6[_0x3e16('0x26')]});});}}function getEndUser(_0x31cf89,_0x3a2142,_0x3f50d5,_0x277815,_0x25b1c5){var _0x4b59af={'$or':{'Phone':_0x277815}};var _0x1c0e4d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3e16('0x22')]()['then'](function(){logger[_0x3e16('0x18')](_0x3e16('0x27'),_0x277815,_0x3a2142[_0x3e16('0x28')]);switch(_0x3a2142['moduleSearch']){case _0x3e16('0x29'):var _0x361c69=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x2b')]){var _0x19b991={};_0x19b991[_0x3a2142[_0x3e16('0x2b')]]=_0x277815;_[_0x3e16('0x2c')](_0x361c69[_0x3e16('0x2d')],_0x19b991);}return _0x25b1c5[_0x3e16('0x19')](_0x3e16('0x2e'))[_0x3e16('0x1d')](_0x361c69,_0x1c0e4d)['execute']()[_0x3e16('0x1f')](function(_0x36b95b){if(_0x36b95b&&_0x36b95b[_0x3e16('0x20')]){return _0x36b95b;}else{var _0x5e0f5d=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x2f')]){var _0x37fc3f={};_0x37fc3f[_0x3a2142[_0x3e16('0x2f')]]=_0x277815;_[_0x3e16('0x2c')](_0x5e0f5d[_0x3e16('0x2d')],_0x37fc3f);}return _0x25b1c5['sobject'](_0x3e16('0x30'))[_0x3e16('0x1d')](_0x5e0f5d,_0x1c0e4d);}});case _0x3e16('0x31'):var _0x169b07=_['cloneDeep'](_0x4b59af);if(_0x3a2142[_0x3e16('0x32')]){var _0x19b991={};_0x19b991[_0x3a2142[_0x3e16('0x32')]]=_0x277815;_[_0x3e16('0x2c')](_0x169b07[_0x3e16('0x2d')],_0x19b991);}return _0x25b1c5['sobject']('Account')[_0x3e16('0x1d')](_0x169b07,_0x1c0e4d)[_0x3e16('0x1e')]()['then'](function(_0x2c5cf2){if(_0x2c5cf2&&_0x2c5cf2[_0x3e16('0x20')]){return _0x2c5cf2;}else{var _0x8daebc=_['cloneDeep'](_0x4b59af);if(_0x3a2142[_0x3e16('0x2b')]){var _0x33f72a={};_0x33f72a[_0x3a2142[_0x3e16('0x2b')]]=_0x277815;_['merge'](_0x8daebc['$or'],_0x33f72a);}return _0x25b1c5[_0x3e16('0x19')](_0x3e16('0x2e'))['find'](_0x8daebc,_0x1c0e4d)[_0x3e16('0x1f')](function(_0x5f4549){if(_0x5f4549&&_0x5f4549[_0x3e16('0x20')]){return _0x5f4549;}else{var _0x556c2e=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x2f')]){var _0x2027f6={};_0x2027f6[_0x3a2142[_0x3e16('0x2f')]]=_0x277815;_[_0x3e16('0x2c')](_0x556c2e[_0x3e16('0x2d')],_0x2027f6);}return _0x25b1c5[_0x3e16('0x19')](_0x3e16('0x30'))[_0x3e16('0x1d')](_0x556c2e,_0x1c0e4d);}});}});case _0x3e16('0x12'):var _0x361c69=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x2b')]){var _0x19b991={};_0x19b991[_0x3a2142[_0x3e16('0x2b')]]=_0x277815;_['merge'](_0x361c69[_0x3e16('0x2d')],_0x19b991);}return _0x25b1c5[_0x3e16('0x19')](_0x3e16('0x2e'))['find'](_0x361c69,_0x1c0e4d)[_0x3e16('0x1e')]();case _0x3e16('0x14'):var _0x626824=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x2f')]){var _0x19b991={};_0x19b991[_0x3a2142[_0x3e16('0x2f')]]=_0x277815;_[_0x3e16('0x2c')](_0x626824['$or'],_0x19b991);}return _0x25b1c5['sobject'](_0x3e16('0x30'))[_0x3e16('0x1d')](_0x626824,_0x1c0e4d);case _0x3e16('0x15'):var _0x169b07=_[_0x3e16('0x2a')](_0x4b59af);if(_0x3a2142[_0x3e16('0x32')]){var _0x19b991={};_0x19b991[_0x3a2142[_0x3e16('0x32')]]=_0x277815;_[_0x3e16('0x2c')](_0x169b07[_0x3e16('0x2d')],_0x19b991);}return _0x25b1c5[_0x3e16('0x19')]('Account')['find'](_0x169b07,_0x1c0e4d);default:return null;}})[_0x3e16('0x1f')](function(_0x2f0837){if(_0x2f0837&&_0x2f0837['length']){var _0x81c2a8=_[_0x3e16('0x33')](_0x2f0837);if(_0x81c2a8){return BPromise['resolve']({'id':_0x81c2a8['Id'],'name':_0x81c2a8[_0x3e16('0x23')],'phone':_0x81c2a8[_0x3e16('0x34')],'endUserType':_0x81c2a8['attributes'][_0x3e16('0x35')]['toLowerCase']()});}}})[_0x3e16('0x1f')](function(_0x4a80a1){if(_0x4a80a1){logger[_0x3e16('0x18')](_0x3e16('0x36'),_0x4a80a1[_0x3e16('0x13')],_0x277815);return BPromise[_0x3e16('0x22')](_0x4a80a1);}else{logger['info'](_0x3e16('0x37'),_0x277815);var _0x5bac47={'Phone':_0x277815};if(_0x3a2142[_0x3e16('0x38')]){if(_0x3a2142[_0x3e16('0x38')]==='contact'){logger[_0x3e16('0x18')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x277815,_0x3a2142[_0x3e16('0x38')]);_0x5bac47['LastName']=_0x3f50d5!==_0x3e16('0x39')?_0x3f50d5:util[_0x3e16('0x3a')](_0x3e16('0x3b'),_0x277815);}else if(_0x3a2142[_0x3e16('0x38')]==='lead'){logger[_0x3e16('0x18')](_0x3e16('0x3c'),_0x277815,_0x3a2142[_0x3e16('0x38')]);_0x5bac47[_0x3e16('0x3d')]=_0x3f50d5!==_0x3e16('0x39')?_0x3f50d5:util[_0x3e16('0x3a')]('Caller\x20-\x20%s',_0x277815);_0x5bac47[_0x3e16('0x3e')]=_0x3e16('0x3f');}else if(_0x3a2142['moduleCreate']==='account'){logger['info'](_0x3e16('0x3c'),_0x277815,_0x3a2142[_0x3e16('0x38')]);_0x5bac47['Name']=_0x3f50d5!==_0x3e16('0x39')?_0x3f50d5:util[_0x3e16('0x3a')](_0x3e16('0x3b'),_0x277815);}else{return null;}}return _0x25b1c5[_0x3e16('0x19')](_[_0x3e16('0x40')](_0x3a2142['moduleCreate']))[_0x3e16('0x1a')](_0x5bac47)['then'](function(_0x171c3f){return BPromise['resolve']({'id':_0x171c3f['id'],'endUserType':_0x3a2142[_0x3e16('0x38')]});});}});}function getCustomFields(_0x24f8d5,_0xd1e190){var _0x43785d={};if(_0x24f8d5[_0x3e16('0x20')]>0x0){_['forEach'](_0x24f8d5,function(_0xc0cb1d){if(_['includes']([_0x3e16('0x41'),_0x3e16('0x42')],_0xc0cb1d[_0x3e16('0x35')])&&_0xc0cb1d['idField']){_0x43785d[_0xc0cb1d[_0x3e16('0x43')]]=_0xc0cb1d[_0x3e16('0x44')][_0x3e16('0x45')]();}else if(_0xc0cb1d[_0x3e16('0x35')]===_0x3e16('0x46')&&_0xc0cb1d[_0x3e16('0x47')]&&_0xc0cb1d[_0x3e16('0x43')]){_0xd1e190[_0xc0cb1d['variableName']]&&(_0x43785d[_0xc0cb1d[_0x3e16('0x43')]]=_0xd1e190[_0xc0cb1d['variableName']]['toString']());}else if(_0xc0cb1d[_0x3e16('0x35')]===_0x3e16('0x48')&&_0xc0cb1d['Variable']&&_0xc0cb1d[_0x3e16('0x49')][_0x3e16('0x4a')]&&_0xc0cb1d[_0x3e16('0x43')]){_0xd1e190[_0xc0cb1d[_0x3e16('0x49')][_0x3e16('0x4a')][_0x3e16('0x4b')]()]&&(_0x43785d[_0xc0cb1d[_0x3e16('0x43')]]=_0xd1e190[_0xc0cb1d['Variable'][_0x3e16('0x4a')][_0x3e16('0x4b')]()]['toString']());}});}return _0x43785d;}function getConnection(_0x757c42){var _0xbe4d38=_0x757c42['password'][_0x3e16('0x4c')](_0x757c42['securityToken']);var _0x4f28d6=new jsforce[(_0x3e16('0x4d'))]({'oauth2':{'loginUrl':_0x757c42['remoteUri']||_0x3e16('0x4e'),'clientId':_0x757c42['clientId'],'clientSecret':_0x757c42[_0x3e16('0x4f')]}});return _0x4f28d6[_0x3e16('0x50')](_0x757c42[_0x3e16('0x51')],_0xbe4d38)[_0x3e16('0x1f')](function(){logger[_0x3e16('0x18')](_0x3e16('0x52'));return _0x4f28d6;});}exports[_0x3e16('0x53')]=function(_0x2c94ba,_0x5853e5,_0x37bfd8,_0x170be1,_0x250e9c,_0x160233){var _0x3e2df6,_0x5efe0b,_0x5d4810,_0x2abf99;_0x160233[_0x3e16('0x54')]=intUtil[_0x3e16('0x55')](_0x160233[_0x3e16('0x54')]);_0x160233['remoteUri']=intUtil['stripTrailingSlash'](_0x160233[_0x3e16('0x56')]);if(_0x250e9c&&_0x250e9c[_0x3e16('0x57')]){logger['info']('[QUEUE]',_0x3e16('0x58'));_0x5853e5['recordingURL']=util[_0x3e16('0x3a')](_0x3e16('0x59'),_0x160233[_0x3e16('0x54')],_0x5853e5[_0x3e16('0x5a')],md5(_0x5853e5[_0x3e16('0x5a')]));}else{_0x5853e5['recordingURL']='';}return getConnection(_0x160233)[_0x3e16('0x1f')](function(_0x292fa7){_0x2abf99=_0x292fa7;return getUser(_0x160233,_0x170be1['email'],_0x2abf99);})[_0x3e16('0x1f')](function(_0xc6a3a4){_0x3e2df6=_0xc6a3a4;return getEndUser(_0x160233,_0x37bfd8,_0x5853e5[_0x3e16('0x5b')],_0x5853e5[_0x3e16('0x5c')],_0x2abf99);})[_0x3e16('0x1f')](function(_0x3c6c9){_0x5efe0b=_0x3c6c9;return getTicket(_0x160233,_0x3e2df6,_0x5efe0b,_0x37bfd8,_0x5853e5,_0x37bfd8[_0x3e16('0x5d')],_0x2abf99,'queue');})[_0x3e16('0x1f')](function(_0x3753e8){_0x5d4810=_0x3753e8;logger[_0x3e16('0x18')](_0x3e16('0x5e'),_0x5d4810['id']);logger[_0x3e16('0x18')](_0x3e16('0x5f'),_0x5d4810['id'],_0x170be1[_0x3e16('0x4a')],_0x160233[_0x3e16('0x35')]);switch(_0x160233[_0x3e16('0x35')]){case _0x3e16('0x60'):emit(util[_0x3e16('0x3a')]('user:%s',_0x170be1[_0x3e16('0x4a')]),_0x3e16('0x61'),{'recordId':_0x5d4810['id']});break;case'newTab':emit(util[_0x3e16('0x3a')](_0x3e16('0x62'),_0x170be1['name']),_0x3e16('0x63'),{'uri':util['format'](_0x3e16('0x64'),_0x2abf99[_0x3e16('0x65')],_0x5d4810['id'])});break;default:logger[_0x3e16('0x66')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x3e16('0x67')](function(_0x2e5b1d){logger[_0x3e16('0x66')](_0x3e16('0x68'),_0x2e5b1d);});};exports[_0x3e16('0x69')]=function(_0x4deaef,_0x21eb47,_0x5b51a0,_0x1bcfa8,_0x46b531,_0x3fcca3,_0x2a2223){var _0x1a12bd,_0xb202d1,_0x498ff5,_0x82e76b;_0x3fcca3[_0x3e16('0x54')]=intUtil['stripTrailingSlash'](_0x3fcca3[_0x3e16('0x54')]);_0x3fcca3[_0x3e16('0x56')]=intUtil[_0x3e16('0x55')](_0x3fcca3[_0x3e16('0x56')]);if(_0x2a2223&&_0x2a2223[_0x3e16('0x6a')]&&_0x2a2223[_0x3e16('0x6a')]!==_0x3e16('0x6b')){logger['info'](_0x3e16('0x6c'),_0x3e16('0x58'));_0x21eb47[_0x3e16('0x6d')]=util[_0x3e16('0x3a')](_0x3e16('0x59'),_0x3fcca3[_0x3e16('0x54')],_0x21eb47['uniqueid'],md5(_0x21eb47[_0x3e16('0x5a')]));}return getConnection(_0x3fcca3)[_0x3e16('0x1f')](function(_0x4674e8){_0x82e76b=_0x4674e8;return getUser(_0x3fcca3,_0x1bcfa8[_0x3e16('0x6e')],_0x82e76b);})[_0x3e16('0x1f')](function(_0x232e6f){_0x1a12bd=_0x232e6f;return getEndUser(_0x3fcca3,_0x5b51a0,_0x21eb47[_0x3e16('0x6f')],_0x21eb47[_0x3e16('0x70')],_0x82e76b);})['then'](function(_0x803646){_0xb202d1=_0x803646;return getTicket(_0x3fcca3,_0x1a12bd,_0xb202d1,_0x5b51a0,_0x21eb47,_0x5b51a0[_0x3e16('0x5d')],_0x82e76b,_0x3e16('0x69'));})[_0x3e16('0x1f')](function(_0x56e161){_0x498ff5=_0x56e161;logger[_0x3e16('0x18')](_0x3e16('0x71'),_0x498ff5['id']);logger[_0x3e16('0x18')](_0x3e16('0x72'),_0x498ff5['id'],_0x1bcfa8['name'],_0x3fcca3[_0x3e16('0x35')]);switch(_0x3fcca3[_0x3e16('0x35')]){case _0x3e16('0x60'):emit(util[_0x3e16('0x3a')]('user:%s',_0x1bcfa8[_0x3e16('0x4a')]),_0x3e16('0x61'),{'recordId':_0x498ff5['id']});break;case _0x3e16('0x73'):emit(util[_0x3e16('0x3a')]('user:%s',_0x1bcfa8['name']),_0x3e16('0x63'),{'uri':util[_0x3e16('0x3a')](_0x3e16('0x64'),_0x82e76b[_0x3e16('0x65')],_0x498ff5['id'])});break;default:logger[_0x3e16('0x66')](_0x3e16('0x6c'),_0x3e16('0x74'));}})['catch'](function(_0xb31e0b){logger[_0x3e16('0x66')](_0x3e16('0x6c'),_0xb31e0b);});};exports[_0x3e16('0x75')]=function(_0x28c910,_0xd6212a,_0x2c974b,_0x1f1e60,_0x42b41f,_0x303a02){var _0x5c7a6a,_0x531cb7,_0x4dbfc6,_0x25d838;_0x303a02[_0x3e16('0x54')]=intUtil['stripTrailingSlash'](_0x303a02[_0x3e16('0x54')]);_0x303a02[_0x3e16('0x56')]=intUtil['stripTrailingSlash'](_0x303a02[_0x3e16('0x56')]);if(_0x42b41f&&_0x42b41f[_0x3e16('0x57')]){logger[_0x3e16('0x18')]('['+_0xd6212a[_0x3e16('0x76')][_0x3e16('0x77')]()+']',_0x3e16('0x58'));_0xd6212a[_0x3e16('0x6d')]=util['format'](_0x3e16('0x59'),_0x303a02['serverUrl'],_0xd6212a[_0x3e16('0x5a')],md5(_0xd6212a[_0x3e16('0x5a')]));}else{_0xd6212a[_0x3e16('0x6d')]='';}return getConnection(_0x303a02)[_0x3e16('0x1f')](function(_0x1adb89){_0x25d838=_0x1adb89;if(!_['isNil'](_0x1f1e60)){return getUser(_0x303a02,_0x1f1e60['name'],_0x25d838);}else{return getUser(_0x303a02,null,_0x25d838);}})[_0x3e16('0x1f')](function(_0x1d1bc5){_0x5c7a6a=_0x1d1bc5;return getEndUser(_0x303a02,_0x2c974b,_0xd6212a[_0x3e16('0x5b')],_0xd6212a[_0x3e16('0x5c')],_0x25d838);})[_0x3e16('0x1f')](function(_0x245250){_0x531cb7=_0x245250;return getTicket(_0x303a02,_0x5c7a6a,_0x531cb7,_0x2c974b,_0xd6212a,_0x2c974b['Fields'],_0x25d838);})[_0x3e16('0x1f')](function(_0x443c88){_0x4dbfc6=_0x443c88;logger['info']('['+_0xd6212a[_0x3e16('0x76')][_0x3e16('0x77')]()+_0x3e16('0x78'),_0x4dbfc6['id']);logger[_0x3e16('0x18')]('['+_0xd6212a['lastevent'][_0x3e16('0x77')]()+']\x20Integration\x20account\x20type\x20%s.',_0x303a02[_0x3e16('0x35')]);})[_0x3e16('0x67')](function(_0xb31c27){logger[_0x3e16('0x66')]('['+_0xd6212a[_0x3e16('0x76')][_0x3e16('0x77')]()+']',_0xb31c27);});}; \ 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 2904148..cdb5510 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 _0xc79d=['active','sys_id','adminEmail','],\x20getUser\x20crm','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity'];(function(_0x3f6221,_0x2712f3){var _0x361da9=function(_0x407093){while(--_0x407093){_0x3f6221['push'](_0x3f6221['shift']());}};_0x361da9(++_0x2712f3);}(_0xc79d,0xc4));var _0xdc79=function(_0x48b20d,_0x5261ef){_0x48b20d=_0x48b20d-0x0;var _0x17ecd1=_0xc79d[_0x48b20d];return _0x17ecd1;};'use strict';var _=require(_0xdc79('0x0'));var Promise=require('bluebird');var rp=require(_0xdc79('0x1'));var util=require(_0xdc79('0x2'));var md5=require(_0xdc79('0x3'));var Redis=require('ioredis');var intUtil=require(_0xdc79('0x4'));var config=require('../../../../config/environment');var logger=require(_0xdc79('0x5'))(_0xdc79('0x6'));config[_0xdc79('0x7')]=_['defaults'](config[_0xdc79('0x7')],{'host':_0xdc79('0x8'),'port':0x18eb});var io=require(_0xdc79('0x9'))(new Redis(config[_0xdc79('0x7')]));function getAdminUser(_0x4336e3,_0x38f767,_0x121d60,_0x1205d0,_0x46122e,_0x13e100){return new Promise(function(_0x38deab,_0x2f36d6){var _0x29246a={'method':_0xdc79('0xa'),'uri':_0x1205d0+_0xdc79('0xb')+'&'+_0x46122e+'&'+_0x13e100,'auth':_0x38f767,'json':!![]};return rp(_0x29246a)[_0xdc79('0xc')](function(_0x2862fe){if(_0x2862fe[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){_0x121d60[_0xdc79('0xf')]=_0x2862fe[_0xdc79('0xd')][0x0]['sys_id'];}logger[_0xdc79('0x10')]('['+[_0x4336e3[_0xdc79('0x11')]()]+'],\x20getAdminUser\x20crm',_0x121d60);_0x38deab(_0x121d60);})[_0xdc79('0x12')](function(_0x5270a8){logger[_0xdc79('0x13')]('['+[_0x4336e3[_0xdc79('0x11')]()]+']',_0x5270a8[_0xdc79('0x14')]);_0x2f36d6(_0x5270a8['message']);});});}function getUser(_0x3f1596,_0x3075b3,_0x3b0b83,_0x58814b,_0x5e1666){return function(_0x4b9da9){logger['info']('['+[_0x3f1596[_0xdc79('0x11')]()]+_0xdc79('0x15'),_0x4b9da9);return new Promise(function(_0x16c91e,_0x2f2997){if(intUtil[_0xdc79('0x16')](_0x4b9da9[_0xdc79('0x17')])){var _0x2d8375={'method':_0xdc79('0xa'),'uri':_0x3b0b83+_0xdc79('0x18')+_0x4b9da9[_0xdc79('0x17')]+'&'+_0x58814b+'&'+_0x5e1666,'auth':_0x3075b3,'json':!![]};logger['info']('['+[_0x3f1596['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x2d8375);return rp(_0x2d8375)[_0xdc79('0xc')](function(_0x5247ec){logger[_0xdc79('0x10')]('['+[_0x3f1596[_0xdc79('0x11')]()]+_0xdc79('0x19'),_0x5247ec);if(_0x5247ec['result']['length']>0x0&&String(_0x5247ec[_0xdc79('0xd')][0x0][_0xdc79('0x1a')])==='true'){_0x4b9da9['userId']=_0x5247ec[_0xdc79('0xd')][0x0][_0xdc79('0x1b')];}else{_0x4b9da9['userId']=_0x4b9da9['adminId'];_0x4b9da9[_0xdc79('0x17')]=_0x4b9da9[_0xdc79('0x1c')];}logger[_0xdc79('0x10')]('['+[_0x3f1596['toUpperCase']()]+_0xdc79('0x1d'),_0x4b9da9);_0x16c91e(_0x4b9da9);})[_0xdc79('0x12')](function(_0x51cf46){logger[_0xdc79('0x13')]('['+[_0x3f1596[_0xdc79('0x11')]()]+']',_0x51cf46[_0xdc79('0x14')]);_0x2f2997(_0x51cf46[_0xdc79('0x14')]);});}else{logger['info']('['+[_0x3f1596[_0xdc79('0x11')]()]+']\x20using\x20admin\x20profile');_0x4b9da9[_0xdc79('0x1e')]=_0x4b9da9[_0xdc79('0xf')];_0x4b9da9[_0xdc79('0x17')]=_0x4b9da9['adminEmail'];_0x16c91e(_0x4b9da9);}});};}function createEndUser(_0x29a752,_0x323a2a,_0x24e36f,_0x15b25f,_0x53e2f9){logger[_0xdc79('0x10')]('['+[_0x29a752[_0xdc79('0x11')]()]+_0xdc79('0x1f'),_0x24e36f);return new Promise(function(_0x4b98c1,_0x542986){var _0xbe0c1f={'method':_0xdc79('0x20'),'uri':_0x15b25f+_0xdc79('0x21')+_0x53e2f9,'body':{'user_name':_0x24e36f['endUserNumber'],'roles':_0xdc79('0x22'),'first_name':_0x24e36f[_0xdc79('0x23')],'active':_0xdc79('0x24'),'date_format':_0xdc79('0x25'),'phone':_0x24e36f[_0xdc79('0x23')]},'auth':_0x323a2a,'json':!![]};return rp(_0xbe0c1f)['then'](function(_0x327576){logger[_0xdc79('0x10')]('['+[_0x29a752[_0xdc79('0x11')]()]+_0xdc79('0x26'),_0x327576['result']);_0x24e36f[_0xdc79('0x27')]=_0x327576[_0xdc79('0xd')][_0xdc79('0x1b')];_0x4b98c1(_0x24e36f);})[_0xdc79('0x12')](function(_0x147d43){logger[_0xdc79('0x13')]('['+[_0x29a752[_0xdc79('0x11')]()]+']',_0x147d43[_0xdc79('0x14')]);_0x542986(_0x147d43[_0xdc79('0x14')]);});});}function getEndUser(_0x3a32af,_0x188cb9,_0x11071e,_0x14d50f,_0x21b64a){return function(_0x4de6cc){logger['info']('['+[_0x3a32af[_0xdc79('0x11')]()]+_0xdc79('0x28'),_0x4de6cc);return new Promise(function(_0xf841a4,_0x133958){var _0x5d3f20={'method':_0xdc79('0xa'),'uri':_0x11071e+_0xdc79('0x29')+_0x4de6cc[_0xdc79('0x23')]+'&'+_0x14d50f+'&'+_0x21b64a,'auth':_0x188cb9,'json':!![]};return rp(_0x5d3f20)['then'](function(_0x1ab7fb){if(_0x1ab7fb[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){_0x4de6cc[_0xdc79('0x27')]=_0x1ab7fb['result'][0x0][_0xdc79('0x1b')];logger[_0xdc79('0x10')]('['+[_0x3a32af[_0xdc79('0x11')]()]+_0xdc79('0x2a'),_0x4de6cc);_0xf841a4(_0x4de6cc);}else{return createEndUser(_0x3a32af,_0x188cb9,_0x4de6cc,_0x11071e,_0x14d50f)[_0xdc79('0xc')](function(_0x32974b){logger[_0xdc79('0x10')]('['+[_0x3a32af[_0xdc79('0x11')]()]+'],\x20createEndUser\x20crm',_0x32974b);_0xf841a4(_0x32974b);});}})['catch'](function(_0x44f5d6){logger['error']('['+[_0x3a32af[_0xdc79('0x11')]()]+']',_0x44f5d6[_0xdc79('0x14')]);_0x133958(_0x44f5d6[_0xdc79('0x14')]);});});};}function getCustomFields(_0x15cd1c,_0x404e3d){var _0x1674e9={};if(_0x15cd1c[_0xdc79('0xe')]>0x0){_[_0xdc79('0x2b')](_0x15cd1c,function(_0x33ded5){if(_[_0xdc79('0x2c')]([_0xdc79('0x2d'),_0xdc79('0x2e')],_0x33ded5[_0xdc79('0x2f')])&&_0x33ded5[_0xdc79('0x30')]&&!_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['nameField'][_0xdc79('0x32')]()]=_0x33ded5[_0xdc79('0x33')][_0xdc79('0x34')]();}else if(_[_0xdc79('0x2c')](['string','picklist'],_0x33ded5[_0xdc79('0x2f')])&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['idField'][_0xdc79('0x32')]()]=_0x33ded5[_0xdc79('0x33')][_0xdc79('0x34')]();}else if(_0x33ded5[_0xdc79('0x2f')]==='variable'&&_0x33ded5[_0xdc79('0x36')]&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5[_0xdc79('0x31')]){_0x1674e9[_0x33ded5['idField'][_0xdc79('0x32')]()]=_0x404e3d[_0x33ded5[_0xdc79('0x36')]][_0xdc79('0x34')]();}else if(_0x33ded5[_0xdc79('0x2f')]===_0xdc79('0x37')&&_0x33ded5[_0xdc79('0x38')]&&_0x33ded5[_0xdc79('0x38')][_0xdc79('0x39')]&&_0x33ded5[_0xdc79('0x35')]&&_0x33ded5['customField']){_0x1674e9[_0x33ded5[_0xdc79('0x35')][_0xdc79('0x32')]()]=_0x404e3d[_0x33ded5[_0xdc79('0x38')]['name'][_0xdc79('0x32')]()][_0xdc79('0x34')]();}});}return _0x1674e9;}function getTicket(_0x42ca07,_0x465079,_0x161c28,_0x25ea9c,_0x10eeb5,_0x44009a){return function(_0x18c8c4){logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x3a'),_0x18c8c4);return new Promise(function(_0x4c3686,_0x7c2833){var _0x1a607e=_0x42ca07[_0xdc79('0x32')]()==='outbound'?_0x18c8c4[_0xdc79('0x1e')]:_0x18c8c4[_0xdc79('0x27')];var _0x46e0d8={'method':_0xdc79('0x20'),'uri':_0x161c28+'incident'+'?'+_0x44009a,'body':Object[_0xdc79('0x3b')]({},{'active':_0xdc79('0x24'),'caller_id':_0x1a607e,'assigned_to':_0x18c8c4[_0xdc79('0x1e')],'short_description':intUtil[_0xdc79('0x3c')](_0x25ea9c[_0xdc79('0x3d')],_0x10eeb5,'\x20'),'description':intUtil[_0xdc79('0x3c')](_0x25ea9c[_0xdc79('0x3e')],_0x10eeb5,'\x0a')},getCustomFields(_0x25ea9c[_0xdc79('0x3f')],_0x10eeb5)),'auth':_0x465079,'json':!![]};return rp(_0x46e0d8)['then'](function(_0x22ebd5){logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x40'),_0x22ebd5['result']);_0x18c8c4[_0xdc79('0x41')]=_0x22ebd5['result'][_0xdc79('0x1b')];_0x18c8c4[_0xdc79('0x42')]=_0x22ebd5[_0xdc79('0xd')][_0xdc79('0x43')];logger[_0xdc79('0x10')]('['+[_0x42ca07[_0xdc79('0x11')]()]+_0xdc79('0x44'),_0x18c8c4);_0x4c3686(_0x18c8c4);})[_0xdc79('0x12')](function(_0x37d36c){logger[_0xdc79('0x13')]('['+[_0x42ca07['toUpperCase']()]+']',_0x37d36c['message']);_0x7c2833(_0x37d36c[_0xdc79('0x14')]);});});};}function createRemoteTag(_0x15ca10,_0x54b05a,_0x5dd46b,_0x37f848){return new Promise(function(_0xe07778,_0x10845c){var _0x2076ee={'method':_0xdc79('0x20'),'uri':_0x5dd46b+_0xdc79('0x45')+'?'+_0x37f848,'body':{'short_description':_0x15ca10,'global':!![],'active':!![],'name':_0x15ca10},'auth':_0x54b05a,'json':!![]};return rp(_0x2076ee)['then'](function(_0xca55d){var _0x50e02b=_0xca55d[_0xdc79('0xd')][_0xdc79('0x1b')];_0xe07778(_0x50e02b);});});}function getRemoteTag(_0x18be9b,_0x424f28,_0x59c460,_0x1811a9,_0x34e888){return new Promise(function(_0x3c5f8f,_0x72e125){var _0x33d0a7={'method':_0xdc79('0xa'),'uri':_0x59c460+_0xdc79('0x45')+_0xdc79('0x46')+_0x18be9b+'&'+_0x1811a9,'auth':_0x424f28,'json':!![]};return rp(_0x33d0a7)[_0xdc79('0xc')](function(_0x263bf3){if(_0x263bf3[_0xdc79('0xd')][_0xdc79('0xe')]>0x0){var _0x280218=_0x263bf3[_0xdc79('0xd')][0x0][_0xdc79('0x1b')];_0x3c5f8f(_0x280218);}else{return createRemoteTag(_0x18be9b,_0x424f28,_0x59c460,_0x1811a9)[_0xdc79('0xc')](function(_0x191490){_0x3c5f8f(_0x191490);});}});});}function assignTagToIncident(_0x536c04,_0x8fb059,_0x39b393,_0x1044b4,_0x425e09){return new Promise(function(_0x2acde7,_0x3e2d8c){var _0x9edf41={'method':_0xdc79('0x20'),'uri':_0x39b393+_0xdc79('0x47')+'?'+_0x425e09,'body':{'label':_0x536c04,'table':'incident','id_type':'Incident','table_key':_0x1044b4[_0xdc79('0x41')],'title':_0xdc79('0x48')+_0x1044b4[_0xdc79('0x42')],'id_display':_0x1044b4[_0xdc79('0x42')]},'auth':_0x8fb059,'json':!![]};return rp(_0x9edf41)[_0xdc79('0xc')](function(_0x60469e){_0x2acde7();})['catch'](function(){_0x2acde7();});});}function manageTags(_0x48d86c,_0x301b9b,_0x5d0792,_0x3382ad,_0x424d25,_0x569626,_0x1843d7){return new Promise(function(_0x435613,_0x406427){var _0x2da4db=[];_0x301b9b[_0xdc79('0x2b')](function(_0x1c85fd){_0x2da4db['push'](getRemoteTag(_0x1c85fd,_0x5d0792,_0x3382ad,_0x569626,_0x1843d7));});return Promise['all'](_0x2da4db)[_0xdc79('0xc')](function(_0x109065){if(_0x109065[_0xdc79('0xe')]){logger['info']('['+[_0x48d86c[_0xdc79('0x11')]()]+_0xdc79('0x49'),_0x109065);var _0x83652a=[];_0x109065[_0xdc79('0x2b')](function(_0x5b914c){_0x83652a[_0xdc79('0x4a')](assignTagToIncident(_0x5b914c,_0x5d0792,_0x3382ad,_0x424d25,_0x569626));});return Promise[_0xdc79('0x4b')](_0x83652a)['then'](function(){_0x435613();})[_0xdc79('0x12')](function(){_0x435613();});}else{_0x435613();}});});}function getTags(_0x92934a,_0x3a41e2,_0x57e332,_0x49d4f1,_0x1d1723,_0x48fd60){return function(_0x275791){return new Promise(function(_0x340638,_0x4cf449){var _0x2f96a3=[];var _0x34fe46=_0x49d4f1[_0xdc79('0x4c')];if(_0x34fe46&&_0x34fe46[_0xdc79('0xe')]>0x0){_0x2f96a3=_['map'](_0x34fe46,_0xdc79('0x39'));}if(_0x2f96a3['length']>0x0){return manageTags(_0x92934a,_0x2f96a3,_0x3a41e2,_0x57e332,_0x275791,_0x1d1723,_0x48fd60)[_0xdc79('0xc')](function(){_0x340638(_0x275791);});}else{_0x340638(_0x275791);}});};}function emit(_0x40a8e7,_0x466035,_0x3781ee){var _0xe4ed5f=_0xdc79('0x4d')+_0xdc79('0x4e')+_0xdc79('0x4f')+_0xdc79('0x50');var _0x532034={'uri':_0x40a8e7+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3781ee+_0xe4ed5f};io['to'](util[_0xdc79('0x51')](_0xdc79('0x52'),_0x466035))[_0xdc79('0x53')]('trigger:browser:url',_0x532034);}exports['cs']=function(_0x38d16b,_0x3e72fb,_0x4321ef,_0x32ca4e,_0x12eaee,_0x5de246,_0x2a6e12,_0x23e0ed){var _0x22c064={};var _0x1361ce={'user':_0x5de246[_0xdc79('0x54')],'pass':_0x5de246[_0xdc79('0x55')]};var _0x436112=_0xdc79('0x56');var _0x1480d3=_0xdc79('0x57');_0x5de246[_0xdc79('0x58')]=intUtil[_0xdc79('0x59')](_0x5de246[_0xdc79('0x58')]);_0x5de246[_0xdc79('0x5a')]=intUtil['stripTrailingSlash'](_0x5de246['serverUrl']);var _0x5996c4=util[_0xdc79('0x51')](_0xdc79('0x5b'),_0x5de246['remoteUri']);_0x22c064[_0xdc79('0x17')]=!_[_0xdc79('0x5c')](_0x32ca4e)?_0x32ca4e[_0xdc79('0x5d')]:null;_0x22c064[_0xdc79('0x1c')]=_0x5de246[_0xdc79('0x5d')];_0x22c064['endUserNumber']=_0x23e0ed[_0xdc79('0x32')]()===_0xdc79('0x5e')?_0x3e72fb[_0xdc79('0x5f')]:_0x3e72fb[_0xdc79('0x60')];_0x22c064[_0xdc79('0x61')]=_0x23e0ed==='queue'||_0x23e0ed==='unmanaged'?_0xdc79('0x62'):_0xdc79('0x5e');var _0x3d5f64=util[_0xdc79('0x51')](_0xdc79('0x63'),_0x5de246[_0xdc79('0x5a')],_0x3e72fb[_0xdc79('0x64')],md5(_0x3e72fb[_0xdc79('0x64')]));if(_0x12eaee&&_0x12eaee['monitor_format']){logger[_0xdc79('0x10')](_0xdc79('0x65'),'Recording\x20is\x20enabled!');_0x3e72fb['recordingURL']=_0x3d5f64;}else if(_0x2a6e12&&_0x2a6e12[_0xdc79('0x66')]&&_0x2a6e12[_0xdc79('0x66')]!==_0xdc79('0x67')){logger[_0xdc79('0x10')](_0xdc79('0x68'),'Recording\x20is\x20enabled!');_0x3e72fb[_0xdc79('0x69')]=_0x3d5f64;}else{_0x3e72fb[_0xdc79('0x69')]='';}return getAdminUser(_0x23e0ed,_0x1361ce,_0x22c064,_0x5996c4,_0x1480d3,_0x436112)[_0xdc79('0xc')](getUser(_0x23e0ed,_0x1361ce,_0x5996c4,_0x1480d3,_0x436112))[_0xdc79('0xc')](getEndUser(_0x23e0ed,_0x1361ce,_0x5996c4,_0x1480d3,_0x436112))[_0xdc79('0xc')](getTicket(_0x23e0ed,_0x1361ce,_0x5996c4,_0x4321ef,_0x3e72fb,_0x1480d3))[_0xdc79('0xc')](function(_0x475604){logger[_0xdc79('0x10')](util[_0xdc79('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x475604[_0xdc79('0x41')]));logger[_0xdc79('0x10')](util[_0xdc79('0x51')](_0xdc79('0x6a'),_0x23e0ed));if(_0x23e0ed!==_0xdc79('0x6b')){logger[_0xdc79('0x10')]('['+[_0x23e0ed[_0xdc79('0x11')]()]+']',_0xdc79('0x6c'));emit(_0x5de246[_0xdc79('0x58')],_0x32ca4e[_0xdc79('0x39')],_0x475604[_0xdc79('0x41')]);}})[_0xdc79('0x12')](function(_0x46a3fa){logger[_0xdc79('0x13')]('['+[_0x23e0ed[_0xdc79('0x11')]()]+_0xdc79('0x6d'),util[_0xdc79('0x6e')](_0x46a3fa,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0796=['Variable','name','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','catch','error','message','info','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','nameField','toLowerCase','toString','includes','picklist','type','idField','customField','content','variable','variableName','customVariable'];(function(_0x2086d0,_0x50617b){var _0x3baeea=function(_0x58d38a){while(--_0x58d38a){_0x2086d0['push'](_0x2086d0['shift']());}};_0x3baeea(++_0x50617b);}(_0x0796,0x10d));var _0x6079=function(_0x63e700,_0x26afc6){_0x63e700=_0x63e700-0x0;var _0x172e46=_0x0796[_0x63e700];return _0x172e46;};'use strict';var _=require(_0x6079('0x0'));var Promise=require(_0x6079('0x1'));var rp=require('request-promise');var util=require(_0x6079('0x2'));var md5=require(_0x6079('0x3'));var Redis=require(_0x6079('0x4'));var intUtil=require('./util');var config=require(_0x6079('0x5'));var logger=require(_0x6079('0x6'))(_0x6079('0x7'));config[_0x6079('0x8')]=_[_0x6079('0x9')](config[_0x6079('0x8')],{'host':_0x6079('0xa'),'port':0x18eb});var io=require(_0x6079('0xb'))(new Redis(config[_0x6079('0x8')]));function getAdminUser(_0x35b47e,_0x58e7e2,_0x1ea9ed,_0x1757c0,_0x174d8f,_0x582b4a){return new Promise(function(_0x3ffbcd,_0x4b6192){var _0x5abcf3={'method':'GET','uri':_0x1757c0+_0x6079('0xc')+'&'+_0x174d8f+'&'+_0x582b4a,'auth':_0x58e7e2,'json':!![]};return rp(_0x5abcf3)[_0x6079('0xd')](function(_0x4a3b28){if(_0x4a3b28[_0x6079('0xe')][_0x6079('0xf')]>0x0){_0x1ea9ed[_0x6079('0x10')]=_0x4a3b28[_0x6079('0xe')][0x0][_0x6079('0x11')];}logger['info']('['+[_0x35b47e[_0x6079('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1ea9ed);_0x3ffbcd(_0x1ea9ed);})[_0x6079('0x13')](function(_0x26cd74){logger[_0x6079('0x14')]('['+[_0x35b47e[_0x6079('0x12')]()]+']',_0x26cd74[_0x6079('0x15')]);_0x4b6192(_0x26cd74[_0x6079('0x15')]);});});}function getUser(_0x4bba3f,_0x4a13e5,_0x13abf6,_0xcc78f2,_0x62ef41){return function(_0x453157){logger[_0x6079('0x16')]('['+[_0x4bba3f[_0x6079('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x453157);return new Promise(function(_0x39f1f1,_0x51f312){if(intUtil[_0x6079('0x17')](_0x453157[_0x6079('0x18')])){var _0x46a65d={'method':_0x6079('0x19'),'uri':_0x13abf6+'sys_user?sysparm_query=email%3D'+_0x453157[_0x6079('0x18')]+'&'+_0xcc78f2+'&'+_0x62ef41,'auth':_0x4a13e5,'json':!![]};logger[_0x6079('0x16')]('['+[_0x4bba3f['toUpperCase']()]+_0x6079('0x1a'),_0x46a65d);return rp(_0x46a65d)[_0x6079('0xd')](function(_0x4f4eea){logger[_0x6079('0x16')]('['+[_0x4bba3f[_0x6079('0x12')]()]+_0x6079('0x1b'),_0x4f4eea);if(_0x4f4eea[_0x6079('0xe')]['length']>0x0&&String(_0x4f4eea[_0x6079('0xe')][0x0][_0x6079('0x1c')])===_0x6079('0x1d')){_0x453157[_0x6079('0x1e')]=_0x4f4eea[_0x6079('0xe')][0x0]['sys_id'];}else{_0x453157[_0x6079('0x1e')]=_0x453157[_0x6079('0x10')];_0x453157[_0x6079('0x18')]=_0x453157[_0x6079('0x1f')];}logger['info']('['+[_0x4bba3f[_0x6079('0x12')]()]+_0x6079('0x20'),_0x453157);_0x39f1f1(_0x453157);})[_0x6079('0x13')](function(_0x3ebeca){logger[_0x6079('0x14')]('['+[_0x4bba3f[_0x6079('0x12')]()]+']',_0x3ebeca['message']);_0x51f312(_0x3ebeca[_0x6079('0x15')]);});}else{logger[_0x6079('0x16')]('['+[_0x4bba3f[_0x6079('0x12')]()]+_0x6079('0x21'));_0x453157[_0x6079('0x1e')]=_0x453157[_0x6079('0x10')];_0x453157[_0x6079('0x18')]=_0x453157[_0x6079('0x1f')];_0x39f1f1(_0x453157);}});};}function createEndUser(_0x53f753,_0x3ec54a,_0xb731fb,_0x3ebd6b,_0x31fc07){logger['info']('['+[_0x53f753[_0x6079('0x12')]()]+_0x6079('0x22'),_0xb731fb);return new Promise(function(_0x327b41,_0x20357a){var _0x2ccca3={'method':_0x6079('0x23'),'uri':_0x3ebd6b+_0x6079('0x24')+_0x31fc07,'body':{'user_name':_0xb731fb[_0x6079('0x25')],'roles':_0x6079('0x26'),'first_name':_0xb731fb[_0x6079('0x25')],'active':'true','date_format':'System','phone':_0xb731fb[_0x6079('0x25')]},'auth':_0x3ec54a,'json':!![]};return rp(_0x2ccca3)[_0x6079('0xd')](function(_0xe02bec){logger['info']('['+[_0x53f753[_0x6079('0x12')]()]+_0x6079('0x27'),_0xe02bec[_0x6079('0xe')]);_0xb731fb[_0x6079('0x28')]=_0xe02bec[_0x6079('0xe')][_0x6079('0x11')];_0x327b41(_0xb731fb);})['catch'](function(_0x4fd185){logger[_0x6079('0x14')]('['+[_0x53f753['toUpperCase']()]+']',_0x4fd185[_0x6079('0x15')]);_0x20357a(_0x4fd185[_0x6079('0x15')]);});});}function getEndUser(_0x47348b,_0x6ace96,_0x3d788e,_0x4543c3,_0x187a79){return function(_0x219e19){logger[_0x6079('0x16')]('['+[_0x47348b[_0x6079('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x219e19);return new Promise(function(_0x28eb30,_0x5efa2d){var _0x248d6b={'method':_0x6079('0x19'),'uri':_0x3d788e+_0x6079('0x29')+_0x219e19[_0x6079('0x25')]+'&'+_0x4543c3+'&'+_0x187a79,'auth':_0x6ace96,'json':!![]};return rp(_0x248d6b)[_0x6079('0xd')](function(_0x4c064d){if(_0x4c064d[_0x6079('0xe')][_0x6079('0xf')]>0x0){_0x219e19['endUserId']=_0x4c064d['result'][0x0][_0x6079('0x11')];logger[_0x6079('0x16')]('['+[_0x47348b['toUpperCase']()]+_0x6079('0x2a'),_0x219e19);_0x28eb30(_0x219e19);}else{return createEndUser(_0x47348b,_0x6ace96,_0x219e19,_0x3d788e,_0x4543c3)[_0x6079('0xd')](function(_0x5b5410){logger['info']('['+[_0x47348b['toUpperCase']()]+_0x6079('0x2b'),_0x5b5410);_0x28eb30(_0x5b5410);});}})['catch'](function(_0x3bcba3){logger[_0x6079('0x14')]('['+[_0x47348b[_0x6079('0x12')]()]+']',_0x3bcba3[_0x6079('0x15')]);_0x5efa2d(_0x3bcba3[_0x6079('0x15')]);});});};}function getCustomFields(_0x190765,_0x22395a){var _0x9f0728={};if(_0x190765[_0x6079('0xf')]>0x0){_[_0x6079('0x2c')](_0x190765,function(_0x963627){if(_['includes']([_0x6079('0x2d'),'picklist'],_0x963627['type'])&&_0x963627[_0x6079('0x2e')]&&!_0x963627['customField']){_0x9f0728[_0x963627['nameField'][_0x6079('0x2f')]()]=_0x963627['content'][_0x6079('0x30')]();}else if(_[_0x6079('0x31')]([_0x6079('0x2d'),_0x6079('0x32')],_0x963627[_0x6079('0x33')])&&_0x963627[_0x6079('0x34')]&&_0x963627[_0x6079('0x35')]){_0x9f0728[_0x963627[_0x6079('0x34')][_0x6079('0x2f')]()]=_0x963627[_0x6079('0x36')][_0x6079('0x30')]();}else if(_0x963627[_0x6079('0x33')]===_0x6079('0x37')&&_0x963627['variableName']&&_0x963627[_0x6079('0x34')]&&_0x963627[_0x6079('0x35')]){_0x9f0728[_0x963627['idField'][_0x6079('0x2f')]()]=_0x22395a[_0x963627[_0x6079('0x38')]]['toString']();}else if(_0x963627['type']===_0x6079('0x39')&&_0x963627[_0x6079('0x3a')]&&_0x963627[_0x6079('0x3a')][_0x6079('0x3b')]&&_0x963627[_0x6079('0x34')]&&_0x963627['customField']){_0x9f0728[_0x963627[_0x6079('0x34')][_0x6079('0x2f')]()]=_0x22395a[_0x963627[_0x6079('0x3a')][_0x6079('0x3b')]['toLowerCase']()][_0x6079('0x30')]();}});}return _0x9f0728;}function getTicket(_0x506c0b,_0x46dfd1,_0x8e4902,_0x3cf7af,_0xf1454a,_0x2115e6){return function(_0x19b623){logger[_0x6079('0x16')]('['+[_0x506c0b[_0x6079('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x19b623);return new Promise(function(_0x59912c,_0x188080){var _0x37b940=_0x506c0b[_0x6079('0x2f')]()===_0x6079('0x3c')?_0x19b623['userId']:_0x19b623[_0x6079('0x28')];var _0x1d5bc8={'method':_0x6079('0x23'),'uri':_0x8e4902+_0x6079('0x3d')+'?'+_0x2115e6,'body':Object['assign']({},{'active':'true','caller_id':_0x37b940,'assigned_to':_0x19b623['userId'],'short_description':intUtil[_0x6079('0x3e')](_0x3cf7af['Subjects'],_0xf1454a,'\x20'),'description':intUtil['getString'](_0x3cf7af[_0x6079('0x3f')],_0xf1454a,'\x0a')},getCustomFields(_0x3cf7af[_0x6079('0x40')],_0xf1454a)),'auth':_0x46dfd1,'json':!![]};return rp(_0x1d5bc8)[_0x6079('0xd')](function(_0x1080c3){logger[_0x6079('0x16')]('['+[_0x506c0b[_0x6079('0x12')]()]+_0x6079('0x41'),_0x1080c3[_0x6079('0xe')]);_0x19b623[_0x6079('0x42')]=_0x1080c3[_0x6079('0xe')][_0x6079('0x11')];_0x19b623['ticketNumber']=_0x1080c3[_0x6079('0xe')][_0x6079('0x43')];logger['info']('['+[_0x506c0b[_0x6079('0x12')]()]+_0x6079('0x44'),_0x19b623);_0x59912c(_0x19b623);})[_0x6079('0x13')](function(_0x52b71d){logger[_0x6079('0x14')]('['+[_0x506c0b[_0x6079('0x12')]()]+']',_0x52b71d[_0x6079('0x15')]);_0x188080(_0x52b71d[_0x6079('0x15')]);});});};}function createRemoteTag(_0x1f4827,_0x292e8b,_0xabe6f7,_0x56c199){return new Promise(function(_0x1daee7,_0x3fe363){var _0x5aa6d8={'method':'POST','uri':_0xabe6f7+_0x6079('0x45')+'?'+_0x56c199,'body':{'short_description':_0x1f4827,'global':!![],'active':!![],'name':_0x1f4827},'auth':_0x292e8b,'json':!![]};return rp(_0x5aa6d8)[_0x6079('0xd')](function(_0x5ed753){var _0x1e0033=_0x5ed753[_0x6079('0xe')][_0x6079('0x11')];_0x1daee7(_0x1e0033);});});}function getRemoteTag(_0x598b5b,_0x38ad27,_0x43e98f,_0x3defd7,_0x53b3e2){return new Promise(function(_0x5d2305,_0x261f86){var _0x1e48c4={'method':_0x6079('0x19'),'uri':_0x43e98f+_0x6079('0x45')+_0x6079('0x46')+_0x598b5b+'&'+_0x3defd7,'auth':_0x38ad27,'json':!![]};return rp(_0x1e48c4)[_0x6079('0xd')](function(_0x105d09){if(_0x105d09[_0x6079('0xe')][_0x6079('0xf')]>0x0){var _0x13a31e=_0x105d09[_0x6079('0xe')][0x0][_0x6079('0x11')];_0x5d2305(_0x13a31e);}else{return createRemoteTag(_0x598b5b,_0x38ad27,_0x43e98f,_0x3defd7)['then'](function(_0x45e86a){_0x5d2305(_0x45e86a);});}});});}function assignTagToIncident(_0x4d2e58,_0x154a22,_0x58beca,_0x4d6e6c,_0x24a0a2){return new Promise(function(_0x5391b1,_0xe382e6){var _0x593a8a={'method':_0x6079('0x23'),'uri':_0x58beca+_0x6079('0x47')+'?'+_0x24a0a2,'body':{'label':_0x4d2e58,'table':_0x6079('0x3d'),'id_type':_0x6079('0x48'),'table_key':_0x4d6e6c[_0x6079('0x42')],'title':'Incident\x20-\x20'+_0x4d6e6c['ticketNumber'],'id_display':_0x4d6e6c[_0x6079('0x49')]},'auth':_0x154a22,'json':!![]};return rp(_0x593a8a)[_0x6079('0xd')](function(_0x13a852){_0x5391b1();})['catch'](function(){_0x5391b1();});});}function manageTags(_0x4a6734,_0x667b2e,_0x29aa17,_0x407dc4,_0x53714a,_0x3a0740,_0x150267){return new Promise(function(_0x5eb8ac,_0x5aebe7){var _0x16233b=[];_0x667b2e[_0x6079('0x2c')](function(_0x183d9f){_0x16233b[_0x6079('0x4a')](getRemoteTag(_0x183d9f,_0x29aa17,_0x407dc4,_0x3a0740,_0x150267));});return Promise[_0x6079('0x4b')](_0x16233b)[_0x6079('0xd')](function(_0x39adeb){if(_0x39adeb[_0x6079('0xf')]){logger[_0x6079('0x16')]('['+[_0x4a6734['toUpperCase']()]+_0x6079('0x4c'),_0x39adeb);var _0x4d9446=[];_0x39adeb[_0x6079('0x2c')](function(_0x3794d4){_0x4d9446['push'](assignTagToIncident(_0x3794d4,_0x29aa17,_0x407dc4,_0x53714a,_0x3a0740));});return Promise['all'](_0x4d9446)[_0x6079('0xd')](function(){_0x5eb8ac();})[_0x6079('0x13')](function(){_0x5eb8ac();});}else{_0x5eb8ac();}});});}function getTags(_0x4825eb,_0x41420f,_0x41ea92,_0x26f05d,_0x55218d,_0x767087){return function(_0x16d7ca){return new Promise(function(_0x53bbec,_0x5966b2){var _0x1d5d94=[];var _0x234103=_0x26f05d[_0x6079('0x4d')];if(_0x234103&&_0x234103[_0x6079('0xf')]>0x0){_0x1d5d94=_['map'](_0x234103,_0x6079('0x3b'));}if(_0x1d5d94[_0x6079('0xf')]>0x0){return manageTags(_0x4825eb,_0x1d5d94,_0x41420f,_0x41ea92,_0x16d7ca,_0x55218d,_0x767087)['then'](function(){_0x53bbec(_0x16d7ca);});}else{_0x53bbec(_0x16d7ca);}});};}function emit(_0x39a12e,_0x4b3fcf,_0x5dd760){var _0x23d3b6=_0x6079('0x4e')+_0x6079('0x4f')+_0x6079('0x50')+_0x6079('0x51');var _0x56b567={'uri':_0x39a12e+_0x6079('0x52')+_0x5dd760+_0x23d3b6};io['to'](util[_0x6079('0x53')](_0x6079('0x54'),_0x4b3fcf))['emit']('trigger:browser:url',_0x56b567);}exports['cs']=function(_0x57da5f,_0x5d77e5,_0x17c26f,_0x3eaa6d,_0xdb0a3,_0x1e55b4,_0x14f2d2,_0x373756){var _0xcd2544={};var _0x4c9d0f={'user':_0x1e55b4[_0x6079('0x55')],'pass':_0x1e55b4[_0x6079('0x56')]};var _0x1884a9=_0x6079('0x57');var _0x14f376=_0x6079('0x58');_0x1e55b4[_0x6079('0x59')]=intUtil[_0x6079('0x5a')](_0x1e55b4[_0x6079('0x59')]);_0x1e55b4[_0x6079('0x5b')]=intUtil[_0x6079('0x5a')](_0x1e55b4[_0x6079('0x5b')]);var _0x19cddb=util[_0x6079('0x53')](_0x6079('0x5c'),_0x1e55b4[_0x6079('0x59')]);_0xcd2544[_0x6079('0x18')]=!_[_0x6079('0x5d')](_0x3eaa6d)?_0x3eaa6d[_0x6079('0x5e')]:null;_0xcd2544[_0x6079('0x1f')]=_0x1e55b4[_0x6079('0x5e')];_0xcd2544['endUserNumber']=_0x373756[_0x6079('0x2f')]()===_0x6079('0x3c')?_0x5d77e5[_0x6079('0x5f')]:_0x5d77e5[_0x6079('0x60')];_0xcd2544['callDirection']=_0x373756===_0x6079('0x61')||_0x373756==='unmanaged'?_0x6079('0x61'):_0x6079('0x3c');var _0x53d382=util[_0x6079('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e55b4[_0x6079('0x5b')],_0x5d77e5[_0x6079('0x62')],md5(_0x5d77e5[_0x6079('0x62')]));if(_0xdb0a3&&_0xdb0a3[_0x6079('0x63')]){logger[_0x6079('0x16')]('[QUEUE]',_0x6079('0x64'));_0x5d77e5['recordingURL']=_0x53d382;}else if(_0x14f2d2&&_0x14f2d2[_0x6079('0x65')]&&_0x14f2d2['recordingFormat']!==_0x6079('0x66')){logger[_0x6079('0x16')](_0x6079('0x67'),_0x6079('0x64'));_0x5d77e5[_0x6079('0x68')]=_0x53d382;}else{_0x5d77e5[_0x6079('0x68')]='';}return getAdminUser(_0x373756,_0x4c9d0f,_0xcd2544,_0x19cddb,_0x14f376,_0x1884a9)['then'](getUser(_0x373756,_0x4c9d0f,_0x19cddb,_0x14f376,_0x1884a9))['then'](getEndUser(_0x373756,_0x4c9d0f,_0x19cddb,_0x14f376,_0x1884a9))[_0x6079('0xd')](getTicket(_0x373756,_0x4c9d0f,_0x19cddb,_0x17c26f,_0x5d77e5,_0x14f376))['then'](function(_0x5e9a6e){logger[_0x6079('0x16')](util[_0x6079('0x53')](_0x6079('0x69'),_0x5e9a6e[_0x6079('0x42')]));logger[_0x6079('0x16')](util[_0x6079('0x53')]('call\x20direction:\x20%s',_0x373756));if(_0x373756!==_0x6079('0x6a')){logger['info']('['+[_0x373756[_0x6079('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1e55b4[_0x6079('0x59')],_0x3eaa6d['name'],_0x5e9a6e[_0x6079('0x42')]);}})[_0x6079('0x13')](function(_0x235474){logger[_0x6079('0x14')]('['+[_0x373756[_0x6079('0x12')]()]+_0x6079('0x6b'),util[_0x6079('0x6c')](_0x235474,{'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 e019623..443a87e 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 _0x5751=['[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','request-promise','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','getString','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','nameField','toLowerCase','content','string','custom_fields','type','variable','customField','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none'];(function(_0x3640e9,_0x57bbee){var _0x38732c=function(_0x55963f){while(--_0x55963f){_0x3640e9['push'](_0x3640e9['shift']());}};_0x38732c(++_0x57bbee);}(_0x5751,0x86));var _0x1575=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5751[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var rp=require(_0x1575('0x0'));var BPromise=require('bluebird');var md5=require(_0x1575('0x1'));var util=require(_0x1575('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1575('0x3'));var logger=require(_0x1575('0x4'))(_0x1575('0x5'));config[_0x1575('0x6')]=_[_0x1575('0x7')](config[_0x1575('0x6')],{'host':_0x1575('0x8'),'port':0x18eb});var io=require(_0x1575('0x9'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2ddaf2,_0x4dd058,_0x148667){io['to'](_0x2ddaf2)[_0x1575('0xa')](_0x4dd058,_0x148667);}function getTicket(_0x3284fc,_0x140cba,_0x3c842b,_0x2ba4a1,_0x3985a3,_0x290f3d,_0x5e03f7,_0x139161){logger[_0x1575('0xb')](_0x1575('0xc'));var _0x3bcc64=new Date();var _0x432eb5=[{'name':_0x1575('0xd'),'value':intUtil['getString'](_0x2ba4a1[_0x1575('0xe')],_0x3985a3,'\x20')},{'name':_0x1575('0xf'),'value':_0x140cba['id']},{'name':'created_by','value':_0x140cba['id']},{'name':'description','value':intUtil[_0x1575('0x10')](_0x2ba4a1['Descriptions'],_0x3985a3,'\x0a')},{'name':_0x1575('0x11'),'value':_0x3bcc64['toISOString']()[_0x1575('0x12')](0x0,0x13)[_0x1575('0x13')]('T','\x20')},{'name':_0x1575('0x14'),'value':'0'},{'name':_0x1575('0x15'),'value':'15'},{'name':_0x1575('0x16'),'value':_0x3c842b['id']},{'name':_0x1575('0x17'),'value':_0x1575('0x18')},{'name':_0x1575('0x19'),'value':_0x3c842b['name']},{'name':_0x1575('0x1a'),'value':_0x139161}];if(_0x290f3d[_0x1575('0x1b')]){_['forEach'](_0x290f3d,function(_0x3489a6){if(_0x3985a3[_0x3489a6[_0x1575('0x1c')]]){_0x432eb5[_0x1575('0x1d')]({'name':_0x3489a6[_0x1575('0x1e')],'value':_0x3985a3[_0x3489a6[_0x1575('0x1c')]]});}});}return request({'form':{'method':_0x1575('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1575('0x20')]({'session':_0x5e03f7['id'],'module_name':_0x1575('0x21'),'name_value_list':_0x432eb5})}});}function getAuth(_0x51c29e){return util[_0x1575('0x22')](_0x1575('0x23'),new Buffer(_0x51c29e[_0x1575('0x24')]+':X')[_0x1575('0x25')](_0x1575('0x26')));}function getServerInfo(_0x44aeeb){return request({'form':{'method':'get_server_info','input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0x44aeeb['id']})}});}function getUser(_0x298160,_0xf324ae,_0xe91bd){if(!_[_0x1575('0x28')](_0xf324ae)){logger['info'](_0x1575('0x29'),_0xf324ae);return request({'form':{'method':_0x1575('0x2a'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0xe91bd['id'],'module_name':_0x1575('0x2b'),'query':util[_0x1575('0x22')](_0x1575('0x2c'),_0xf324ae),'order_by':'','offset':'0','select_fields':['id',_0x1575('0xd'),_0x1575('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5813f3){if(_0x5813f3[_0x1575('0x2e')][_0x1575('0x1b')]){var _0x174f5f=_[_0x1575('0x2f')](_0x5813f3[_0x1575('0x2e')],function(_0x35a2df){return _0x35a2df[_0x1575('0x30')][_0x1575('0x2d')][_0x1575('0x31')]===_0xf324ae;});if(_0x174f5f){logger[_0x1575('0xb')](_0x1575('0x32'));return BPromise[_0x1575('0x33')]({'id':_0x174f5f[_0x1575('0x30')]['id'][_0x1575('0x31')],'name':_0x174f5f[_0x1575('0x30')][_0x1575('0xd')][_0x1575('0x31')]});}}logger[_0x1575('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1575('0x33')]({'id':_0xe91bd[_0x1575('0x30')][_0x1575('0x34')]['value'],'name':_0xe91bd[_0x1575('0x30')][_0x1575('0x2d')]['value']});});}else{logger[_0x1575('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0xe91bd[_0x1575('0x30')][_0x1575('0x34')][_0x1575('0x31')],'name':_0xe91bd[_0x1575('0x30')]['user_name'][_0x1575('0x31')]});}}function getEndUser(_0x2f4a95,_0x51f585,_0x4d581f,_0x5c133d){logger[_0x1575('0xb')](_0x1575('0x35'),_0x4d581f);return request({'form':{'method':_0x1575('0x2a'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON['stringify']({'session':_0x5c133d['id'],'module_name':_0x1575('0x18'),'query':util[_0x1575('0x22')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4d581f),'order_by':'','offset':'0','select_fields':['id',_0x1575('0xd'),_0x1575('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3d1f7f){if(_0x3d1f7f['entry_list'][_0x1575('0x1b')]){var _0x22f409=_[_0x1575('0x2f')](_0x3d1f7f[_0x1575('0x2e')],function(_0xef926a){return _0xef926a[_0x1575('0x30')][_0x1575('0x36')]['value']===_0x4d581f;});if(_0x22f409){logger['info'](_0x1575('0x37'));return BPromise[_0x1575('0x33')]({'id':_0x22f409[_0x1575('0x30')]['id'][_0x1575('0x31')],'name':_0x22f409[_0x1575('0x30')]['name'][_0x1575('0x31')],'phone':_0x22f409[_0x1575('0x30')]['phone_home'][_0x1575('0x31')]});}}else{logger[_0x1575('0xb')](_0x1575('0x38'));return request({'form':{'method':_0x1575('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1575('0x20')]({'session':_0x5c133d['id'],'module_name':_0x1575('0x18'),'name_value_list':[{'name':_0x1575('0x39'),'value':_0x51f585!==_0x1575('0x3a')?_0x51f585:util[_0x1575('0x22')](_0x1575('0x3b'),_0x4d581f)},{'name':_0x1575('0x36'),'value':_0x4d581f}]})}})[_0x1575('0x3c')](function(_0x716918){logger[_0x1575('0xb')](_0x1575('0x3d'));return BPromise['resolve']({'id':_0x716918['id'],'name':_0x716918[_0x1575('0x2e')][_0x1575('0x39')][_0x1575('0x31')],'phone':_0x716918[_0x1575('0x2e')][_0x1575('0x36')][_0x1575('0x31')]});});}});}function request(_0x20bbec){logger[_0x1575('0x3e')](_0x1575('0x3f'),JSON[_0x1575('0x20')](_0x20bbec));return rp(_[_0x1575('0x40')](def,_0x20bbec));}function getTags(_0x158d1f,_0x270644){var _0x3e4823=[];if(_0x158d1f&&_0x158d1f[_0x1575('0x1b')]>0x0){_0x3e4823=_[_0x1575('0x41')](_0x158d1f,_0x270644);}return _0x3e4823;}function getCustomFields(_0x1e698f,_0x3c9f69){var _0x351f7f=[];var _0x3c9d25={'custom_fields':[]};if(_0x1e698f['length']>0x0){_[_0x1575('0x42')](_0x1e698f,function(_0x449c85){if(_0x449c85['type']==='string'&&_0x449c85[_0x1575('0x43')]&&!_0x449c85['customField']){_0x3c9d25[_0x449c85['nameField'][_0x1575('0x44')]()]=_0x449c85[_0x1575('0x45')][_0x1575('0x25')]();}else if(_0x449c85['type']===_0x1575('0x46')&&_0x449c85[_0x1575('0x1e')]&&_0x449c85['customField']){_0x3c9d25[_0x1575('0x47')]['push']({'id':_0x449c85[_0x1575('0x1e')],'value':_0x449c85[_0x1575('0x45')][_0x1575('0x25')]()});}else if(_0x449c85[_0x1575('0x48')]===_0x1575('0x49')&&_0x449c85[_0x1575('0x1c')]&&_0x449c85['idField']&&_0x449c85[_0x1575('0x4a')]){_0x3c9f69[_0x449c85[_0x1575('0x1c')]]&&_0x3c9d25[_0x1575('0x47')]['push']({'id':_0x449c85[_0x1575('0x1e')],'value':_0x3c9f69[_0x449c85[_0x1575('0x1c')]][_0x1575('0x25')]()});}else if(_0x449c85['type']==='customVariable'&&_0x449c85[_0x1575('0x4b')]&&_0x449c85[_0x1575('0x4b')]['name']&&_0x449c85['idField']&&_0x449c85['customField']){_0x3c9f69[_0x449c85[_0x1575('0x4b')]['name'][_0x1575('0x44')]()]&&_0x3c9d25['custom_fields'][_0x1575('0x1d')]({'id':_0x449c85[_0x1575('0x1e')],'value':_0x3c9f69[_0x449c85[_0x1575('0x4b')][_0x1575('0xd')][_0x1575('0x44')]()][_0x1575('0x25')]()});}});}return _0x3c9d25;}function getConnection(_0x1bf387){return request({'method':_0x1575('0x4c'),'form':{'method':_0x1575('0x4d'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1bf387[_0x1575('0x4e')],'password':_0x1bf387[_0x1575('0x4f')],'encryption':'PLAIN'},'application':_0x1575('0x50')})}})[_0x1575('0x3c')](function(_0x5bdd6e){var _0x1a8d6f=_0x5bdd6e;if(_0x1a8d6f['id']){def[_0x1575('0x51')]=_0x1a8d6f['id'];return BPromise['resolve'](_0x1a8d6f);}else{throw new Error(util[_0x1575('0x22')](_0x1575('0x52'),_0x1bf387['id']));}});}function setRelationship(_0x418e3e,_0x24aaa3,_0xc59405,_0x1a6507){return request({'form':{'method':_0x1575('0x53'),'input_type':_0x1575('0x27'),'response_type':_0x1575('0x27'),'rest_data':JSON[_0x1575('0x20')]({'session':_0x418e3e['id'],'module_name':_0x1575('0x21'),'module_id':_0xc59405['id'],'link_field_name':_0x1a6507,'related_ids':[_0x24aaa3['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1575('0x54')]=function(_0x2ce055,_0x585188,_0x42e081,_0x400ccc,_0x1e55e6,_0x4f7e1c){var _0x4b9caa,_0x7b331a,_0x18999d,_0x4bfb1d;_0x4f7e1c['remoteUri']=intUtil[_0x1575('0x55')](_0x4f7e1c[_0x1575('0x56')]);_0x4f7e1c[_0x1575('0x57')]=intUtil[_0x1575('0x55')](_0x4f7e1c[_0x1575('0x57')]);def[_0x1575('0x58')]=util['format'](_0x1575('0x59'),_0x4f7e1c[_0x1575('0x56')]);if(_0x1e55e6&&_0x1e55e6[_0x1575('0x5a')]){logger['info'](_0x1575('0x5b'),_0x1575('0x5c'));_0x585188[_0x1575('0x5d')]=util['format'](_0x1575('0x5e'),_0x4f7e1c[_0x1575('0x57')],_0x585188[_0x1575('0x5f')],md5(_0x585188[_0x1575('0x5f')]));}else{_0x585188[_0x1575('0x5d')]='';}return getConnection(_0x4f7e1c)['then'](function(_0x4f5d64){_0x4bfb1d=_0x4f5d64;return getUser(_0x4f7e1c,_0x400ccc[_0x1575('0xd')],_0x4bfb1d);})[_0x1575('0x3c')](function(_0x194b30){_0x4b9caa=_0x194b30;logger[_0x1575('0xb')](_0x1575('0x60'),_0x4b9caa['id']);return getEndUser(_0x4f7e1c,_0x585188[_0x1575('0x61')],_0x585188['calleridnum'],_0x4bfb1d);})[_0x1575('0x3c')](function(_0x166273){_0x7b331a=_0x166273;logger[_0x1575('0xb')](_0x1575('0x62'),_0x7b331a['id']);return getTicket(_0x4f7e1c,_0x4b9caa,_0x7b331a,_0x42e081,_0x585188,_0x42e081[_0x1575('0x63')],_0x4bfb1d,_0x1575('0x64'));})['then'](function(_0x31ae32){_0x18999d=_0x31ae32;logger[_0x1575('0xb')](_0x1575('0x65'));logger[_0x1575('0xb')]('The\x20Ticket\x20ID\x20is:',_0x18999d['id']);return setRelationship(_0x4bfb1d,_0x4b9caa,_0x18999d,_0x1575('0x66'));})[_0x1575('0x3c')](function(){return setRelationship(_0x4bfb1d,_0x7b331a,_0x18999d,_0x1575('0x67'));})[_0x1575('0x3c')](function(){return getServerInfo(_0x4bfb1d);})['then'](function(_0x37e265){var _0x3fed8b=parseInt(_0x37e265[_0x1575('0x68')][_0x1575('0x69')](0x0));var _0x3d4543=util['format'](_0x1575('0x6a'),_0x4f7e1c[_0x1575('0x56')],_0x18999d['id']);if(_0x3fed8b>0x6){_0x3d4543=util[_0x1575('0x22')](_0x1575('0x6b'),_0x4f7e1c[_0x1575('0x56')],_0x18999d['id']);}logger['info'](_0x1575('0x5b'),_0x1575('0x6c'));emit(util[_0x1575('0x22')]('user:%s',_0x400ccc[_0x1575('0xd')]),'trigger:browser:url',{'uri':_0x3d4543});})[_0x1575('0x6d')](function(_0x280278){logger[_0x1575('0x6e')](_0x1575('0x5b'),JSON['stringify'](_0x280278));});};exports[_0x1575('0x6f')]=function(_0x330a2a,_0x55adae,_0x3d04a0,_0x49ce76,_0x4bbf56,_0x3f2627,_0xe785a3){var _0x15a4d4,_0x3178db,_0x9676d4,_0x22298e;_0x3f2627['remoteUri']=intUtil[_0x1575('0x55')](_0x3f2627[_0x1575('0x56')]);_0x3f2627['serverUrl']=intUtil[_0x1575('0x55')](_0x3f2627[_0x1575('0x57')]);def['uri']=util['format'](_0x1575('0x59'),_0x3f2627[_0x1575('0x56')]);if(_0xe785a3&&_0xe785a3[_0x1575('0x70')]&&_0xe785a3[_0x1575('0x70')]!==_0x1575('0x71')){logger[_0x1575('0xb')](_0x1575('0x72'),'Recording\x20is\x20enabled!');_0x55adae[_0x1575('0x5d')]=util['format'](_0x1575('0x5e'),_0x3f2627[_0x1575('0x57')],_0x55adae[_0x1575('0x5f')],md5(_0x55adae[_0x1575('0x5f')]));}return getConnection(_0x3f2627)[_0x1575('0x3c')](function(_0xaabb7c){_0x22298e=_0xaabb7c;return getUser(_0x3f2627,_0x49ce76['name'],_0x22298e);})['then'](function(_0x446795){_0x15a4d4=_0x446795;logger['info']('The\x20User\x20ID\x20is:',_0x15a4d4['id']);return getEndUser(_0x3f2627,_0x55adae[_0x1575('0x73')],_0x55adae[_0x1575('0x74')],_0x22298e);})[_0x1575('0x3c')](function(_0x398f76){_0x3178db=_0x398f76;logger[_0x1575('0xb')](_0x1575('0x62'),_0x3178db['id']);return getTicket(_0x3f2627,_0x15a4d4,_0x3178db,_0x3d04a0,_0x55adae,_0x3d04a0[_0x1575('0x63')],_0x22298e,_0x1575('0x75'));})['then'](function(_0x492fec){_0x9676d4=_0x492fec;logger['info'](_0x1575('0x65'));logger['info'](_0x1575('0x76'),_0x9676d4['id']);return setRelationship(_0x22298e,_0x15a4d4,_0x9676d4,_0x1575('0x66'));})['then'](function(){return setRelationship(_0x22298e,_0x3178db,_0x9676d4,_0x1575('0x67'));})['then'](function(){return getServerInfo(_0x22298e);})[_0x1575('0x3c')](function(_0x295d5d){var _0x359c0f=parseInt(_0x295d5d['version']['charAt'](0x0));var _0x2b59ff=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3f2627['remoteUri'],_0x9676d4['id']);if(_0x359c0f>0x6){_0x2b59ff=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3f2627[_0x1575('0x56')],_0x9676d4['id']);}logger[_0x1575('0xb')](_0x1575('0x72'),_0x1575('0x6c'));emit(util['format'](_0x1575('0x77'),_0x49ce76[_0x1575('0xd')]),_0x1575('0x78'),{'uri':_0x2b59ff});})[_0x1575('0x6d')](function(_0x375b45){logger[_0x1575('0x6e')]('[OUTBOUND]',JSON['stringify'](_0x375b45));});};exports[_0x1575('0x79')]=function(_0x54a4e6,_0x51a82d,_0x66e86a,_0x405536,_0x36cf56,_0xcfe6ed){var _0x521fea,_0x55ee1f,_0x12cf9e,_0x7c1261;_0xcfe6ed['remoteUri']=intUtil[_0x1575('0x55')](_0xcfe6ed['remoteUri']);_0xcfe6ed[_0x1575('0x57')]=intUtil[_0x1575('0x55')](_0xcfe6ed[_0x1575('0x57')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0xcfe6ed['remoteUri']);if(_0x36cf56&&_0x36cf56[_0x1575('0x5a')]){logger[_0x1575('0xb')]('['+_0x51a82d[_0x1575('0x7a')][_0x1575('0x7b')]()+']',_0x1575('0x5c'));_0x51a82d[_0x1575('0x5d')]=util[_0x1575('0x22')](_0x1575('0x5e'),_0xcfe6ed[_0x1575('0x57')],_0x51a82d[_0x1575('0x5f')],md5(_0x51a82d[_0x1575('0x5f')]));}else{_0x51a82d[_0x1575('0x5d')]='';}return getConnection(_0xcfe6ed)[_0x1575('0x3c')](function(_0x53110c){_0x7c1261=_0x53110c;if(!_['isNil'](_0x405536)){return getUser(_0xcfe6ed,_0x405536[_0x1575('0xd')],_0x7c1261);}else{return getUser(_0xcfe6ed,null,_0x7c1261);}})[_0x1575('0x3c')](function(_0x5c6a2a){_0x521fea=_0x5c6a2a;logger['info']('The\x20User\x20ID\x20is:',_0x521fea['id']);return getEndUser(_0xcfe6ed,_0x51a82d[_0x1575('0x61')],_0x51a82d['calleridnum'],_0x7c1261);})[_0x1575('0x3c')](function(_0xb74bd5){_0x55ee1f=_0xb74bd5;logger[_0x1575('0xb')](_0x1575('0x62'),_0x55ee1f['id']);return getTicket(_0xcfe6ed,_0x521fea,_0x55ee1f,_0x66e86a,_0x51a82d,_0x66e86a['Fields'],_0x7c1261,_0x1575('0x64'));})[_0x1575('0x3c')](function(_0x2d54ad){_0x12cf9e=_0x2d54ad;logger['info'](_0x1575('0x65'));logger[_0x1575('0xb')](_0x1575('0x76'),_0x12cf9e['id']);return setRelationship(_0x7c1261,_0x521fea,_0x12cf9e,_0x1575('0x66'));})[_0x1575('0x3c')](function(){return setRelationship(_0x7c1261,_0x55ee1f,_0x12cf9e,_0x1575('0x67'));})[_0x1575('0x3c')](function(){return getServerInfo(_0x7c1261);})[_0x1575('0x6d')](function(_0x558a67){logger[_0x1575('0x6e')]('['+_0x51a82d[_0x1575('0x7a')][_0x1575('0x7b')]()+']',JSON[_0x1575('0x20')](_0x558a67));});}; \ No newline at end of file +var _0xff23=['user:%s','trigger:browser:url','catch','outbound','none','[OUTBOUND]','destcalleridname','Outbound','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','name','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_name','direction','length','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','Agent\x20found!','resolve','name_value_list','value','user_id','user_name','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','format','Caller\x20-\x20%s','debug','[HTTP]','merge','type','string','customField','custom_fields','content','variable','Variable','toLowerCase','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s'];(function(_0x4756a1,_0x3f8d1){var _0x177c4f=function(_0xddb5e2){while(--_0xddb5e2){_0x4756a1['push'](_0x4756a1['shift']());}};_0x177c4f(++_0x3f8d1);}(_0xff23,0xf9));var _0x3ff2=function(_0x36841f,_0x8aacf0){_0x36841f=_0x36841f-0x0;var _0xe71add=_0xff23[_0x36841f];return _0xe71add;};'use strict';var _=require('lodash');var rp=require(_0x3ff2('0x0'));var BPromise=require(_0x3ff2('0x1'));var md5=require('md5');var util=require(_0x3ff2('0x2'));var Redis=require(_0x3ff2('0x3'));var intUtil=require(_0x3ff2('0x4'));var config=require(_0x3ff2('0x5'));var logger=require(_0x3ff2('0x6'))(_0x3ff2('0x7'));config['redis']=_[_0x3ff2('0x8')](config[_0x3ff2('0x9')],{'host':_0x3ff2('0xa'),'port':0x18eb});var io=require(_0x3ff2('0xb'))(new Redis(config['redis']));var def={'method':_0x3ff2('0xc'),'json':!![]};function emit(_0x371e26,_0x3b9d56,_0x1aee51){io['to'](_0x371e26)[_0x3ff2('0xd')](_0x3b9d56,_0x1aee51);}function getTicket(_0x1809a8,_0x580d4d,_0x25559b,_0x66570a,_0x390e87,_0x58fdc3,_0xa1bbae,_0x19e1a3){logger[_0x3ff2('0xe')]('Creating\x20new\x20ticket...');var _0x3ea8d3=new Date();var _0x4a005f=[{'name':_0x3ff2('0xf'),'value':intUtil[_0x3ff2('0x10')](_0x66570a[_0x3ff2('0x11')],_0x390e87,'\x20')},{'name':_0x3ff2('0x12'),'value':_0x580d4d['id']},{'name':_0x3ff2('0x13'),'value':_0x580d4d['id']},{'name':'description','value':intUtil['getString'](_0x66570a['Descriptions'],_0x390e87,'\x0a')},{'name':_0x3ff2('0x14'),'value':_0x3ea8d3[_0x3ff2('0x15')]()['slice'](0x0,0x13)[_0x3ff2('0x16')]('T','\x20')},{'name':_0x3ff2('0x17'),'value':'0'},{'name':_0x3ff2('0x18'),'value':'15'},{'name':_0x3ff2('0x19'),'value':_0x25559b['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x3ff2('0x1a'),'value':_0x25559b['name']},{'name':_0x3ff2('0x1b'),'value':_0x19e1a3}];if(_0x58fdc3[_0x3ff2('0x1c')]){_['forEach'](_0x58fdc3,function(_0x36acf6){if(_0x390e87[_0x36acf6[_0x3ff2('0x1d')]]){_0x4a005f[_0x3ff2('0x1e')]({'name':_0x36acf6[_0x3ff2('0x1f')],'value':_0x390e87[_0x36acf6[_0x3ff2('0x1d')]]});}});}return request({'form':{'method':_0x3ff2('0x20'),'input_type':'JSON','response_type':_0x3ff2('0x21'),'rest_data':JSON['stringify']({'session':_0xa1bbae['id'],'module_name':_0x3ff2('0x22'),'name_value_list':_0x4a005f})}});}function getAuth(_0x2c5024){return util['format'](_0x3ff2('0x23'),new Buffer(_0x2c5024[_0x3ff2('0x24')]+':X')[_0x3ff2('0x25')](_0x3ff2('0x26')));}function getServerInfo(_0x18ae7e){return request({'form':{'method':_0x3ff2('0x27'),'input_type':_0x3ff2('0x21'),'response_type':_0x3ff2('0x21'),'rest_data':JSON[_0x3ff2('0x28')]({'session':_0x18ae7e['id']})}});}function getUser(_0x3ea24f,_0x507cde,_0x3ec70a){if(!_[_0x3ff2('0x29')](_0x507cde)){logger[_0x3ff2('0xe')](_0x3ff2('0x2a'),_0x507cde);return request({'form':{'method':_0x3ff2('0x2b'),'input_type':_0x3ff2('0x21'),'response_type':'JSON','rest_data':JSON[_0x3ff2('0x28')]({'session':_0x3ec70a['id'],'module_name':_0x3ff2('0x2c'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x507cde),'order_by':'','offset':'0','select_fields':['id',_0x3ff2('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3ff2('0x2d')](function(_0x5dfaed){if(_0x5dfaed[_0x3ff2('0x2e')][_0x3ff2('0x1c')]){var _0x1c7514=_[_0x3ff2('0x2f')](_0x5dfaed[_0x3ff2('0x2e')],function(_0x53d8f3){return _0x53d8f3['name_value_list']['user_name']['value']===_0x507cde;});if(_0x1c7514){logger['info'](_0x3ff2('0x30'));return BPromise[_0x3ff2('0x31')]({'id':_0x1c7514[_0x3ff2('0x32')]['id']['value'],'name':_0x1c7514[_0x3ff2('0x32')][_0x3ff2('0xf')][_0x3ff2('0x33')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3ff2('0x31')]({'id':_0x3ec70a[_0x3ff2('0x32')][_0x3ff2('0x34')][_0x3ff2('0x33')],'name':_0x3ec70a['name_value_list'][_0x3ff2('0x35')][_0x3ff2('0x33')]});});}else{logger['info'](_0x3ff2('0x36'));return BPromise[_0x3ff2('0x31')]({'id':_0x3ec70a[_0x3ff2('0x32')][_0x3ff2('0x34')][_0x3ff2('0x33')],'name':_0x3ec70a[_0x3ff2('0x32')][_0x3ff2('0x35')][_0x3ff2('0x33')]});}}function getEndUser(_0x50393b,_0x35dc9b,_0x847064,_0x16b11a){logger[_0x3ff2('0xe')]('Searching\x20enduser\x20with\x20phone',_0x847064);return request({'form':{'method':_0x3ff2('0x2b'),'input_type':_0x3ff2('0x21'),'response_type':'JSON','rest_data':JSON[_0x3ff2('0x28')]({'session':_0x16b11a['id'],'module_name':_0x3ff2('0x37'),'query':util['format'](_0x3ff2('0x38'),_0x847064),'order_by':'','offset':'0','select_fields':['id',_0x3ff2('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3ff2('0x2d')](function(_0x384965){if(_0x384965[_0x3ff2('0x2e')][_0x3ff2('0x1c')]){var _0x350e3c=_[_0x3ff2('0x2f')](_0x384965[_0x3ff2('0x2e')],function(_0x18c3a4){return _0x18c3a4[_0x3ff2('0x32')][_0x3ff2('0x39')][_0x3ff2('0x33')]===_0x847064;});if(_0x350e3c){logger[_0x3ff2('0xe')](_0x3ff2('0x3a'));return BPromise[_0x3ff2('0x31')]({'id':_0x350e3c[_0x3ff2('0x32')]['id'][_0x3ff2('0x33')],'name':_0x350e3c[_0x3ff2('0x32')][_0x3ff2('0xf')][_0x3ff2('0x33')],'phone':_0x350e3c['name_value_list'][_0x3ff2('0x39')][_0x3ff2('0x33')]});}}else{logger[_0x3ff2('0xe')](_0x3ff2('0x3b'));return request({'form':{'method':'set_entry','input_type':_0x3ff2('0x21'),'response_type':'JSON','rest_data':JSON[_0x3ff2('0x28')]({'session':_0x16b11a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3ff2('0x3c'),'value':_0x35dc9b!==''?_0x35dc9b:util[_0x3ff2('0x3d')](_0x3ff2('0x3e'),_0x847064)},{'name':_0x3ff2('0x39'),'value':_0x847064}]})}})[_0x3ff2('0x2d')](function(_0x1a08e9){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x1a08e9['id'],'name':_0x1a08e9[_0x3ff2('0x2e')][_0x3ff2('0x3c')][_0x3ff2('0x33')],'phone':_0x1a08e9[_0x3ff2('0x2e')]['phone_home']['value']});});}});}function request(_0x3d9b2d){logger[_0x3ff2('0x3f')](_0x3ff2('0x40'),JSON['stringify'](_0x3d9b2d));return rp(_[_0x3ff2('0x41')](def,_0x3d9b2d));}function getTags(_0x154313,_0x43b0e1){var _0x5cce77=[];if(_0x154313&&_0x154313[_0x3ff2('0x1c')]>0x0){_0x5cce77=_['map'](_0x154313,_0x43b0e1);}return _0x5cce77;}function getCustomFields(_0x193be9,_0x44f41e){var _0xcbed32=[];var _0x41ef4e={'custom_fields':[]};if(_0x193be9[_0x3ff2('0x1c')]>0x0){_['forEach'](_0x193be9,function(_0x2a8eb8){if(_0x2a8eb8[_0x3ff2('0x42')]===_0x3ff2('0x43')&&_0x2a8eb8['nameField']&&!_0x2a8eb8[_0x3ff2('0x44')]){_0x41ef4e[_0x2a8eb8['nameField']['toLowerCase']()]=_0x2a8eb8['content']['toString']();}else if(_0x2a8eb8[_0x3ff2('0x42')]===_0x3ff2('0x43')&&_0x2a8eb8[_0x3ff2('0x1f')]&&_0x2a8eb8[_0x3ff2('0x44')]){_0x41ef4e[_0x3ff2('0x45')][_0x3ff2('0x1e')]({'id':_0x2a8eb8[_0x3ff2('0x1f')],'value':_0x2a8eb8[_0x3ff2('0x46')]['toString']()});}else if(_0x2a8eb8[_0x3ff2('0x42')]===_0x3ff2('0x47')&&_0x2a8eb8[_0x3ff2('0x1d')]&&_0x2a8eb8['idField']&&_0x2a8eb8['customField']){_0x44f41e[_0x2a8eb8[_0x3ff2('0x1d')]]&&_0x41ef4e[_0x3ff2('0x45')][_0x3ff2('0x1e')]({'id':_0x2a8eb8['idField'],'value':_0x44f41e[_0x2a8eb8[_0x3ff2('0x1d')]][_0x3ff2('0x25')]()});}else if(_0x2a8eb8[_0x3ff2('0x42')]==='customVariable'&&_0x2a8eb8['Variable']&&_0x2a8eb8[_0x3ff2('0x48')][_0x3ff2('0xf')]&&_0x2a8eb8[_0x3ff2('0x1f')]&&_0x2a8eb8['customField']){_0x44f41e[_0x2a8eb8[_0x3ff2('0x48')][_0x3ff2('0xf')][_0x3ff2('0x49')]()]&&_0x41ef4e['custom_fields'][_0x3ff2('0x1e')]({'id':_0x2a8eb8[_0x3ff2('0x1f')],'value':_0x44f41e[_0x2a8eb8[_0x3ff2('0x48')][_0x3ff2('0xf')][_0x3ff2('0x49')]()][_0x3ff2('0x25')]()});}});}return _0x41ef4e;}function getConnection(_0x2ef06e){return request({'method':_0x3ff2('0xc'),'form':{'method':_0x3ff2('0x4a'),'input_type':_0x3ff2('0x21'),'response_type':_0x3ff2('0x21'),'rest_data':JSON[_0x3ff2('0x28')]({'user_auth':{'user_name':_0x2ef06e[_0x3ff2('0x4b')],'password':_0x2ef06e['password'],'encryption':'PLAIN'},'application':_0x3ff2('0x4c')})}})[_0x3ff2('0x2d')](function(_0x2dce8d){var _0x53eee8=_0x2dce8d;if(_0x53eee8['id']){def[_0x3ff2('0x4d')]=_0x53eee8['id'];return BPromise['resolve'](_0x53eee8);}else{throw new Error(util[_0x3ff2('0x3d')](_0x3ff2('0x4e'),_0x2ef06e['id']));}});}function setRelationship(_0x12b16a,_0x2242df,_0x38d85f,_0x2f1ae8){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x12b16a['id'],'module_name':'Calls','module_id':_0x38d85f['id'],'link_field_name':_0x2f1ae8,'related_ids':[_0x2242df['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3ff2('0x4f')]=function(_0x4175e8,_0x307dd2,_0x4adeb7,_0x587197,_0x54ff73,_0x3f27ea){var _0x1866ec,_0x21af5b,_0x14bc6b,_0x5bc9fc;_0x3f27ea[_0x3ff2('0x50')]=intUtil[_0x3ff2('0x51')](_0x3f27ea[_0x3ff2('0x50')]);_0x3f27ea[_0x3ff2('0x52')]=intUtil[_0x3ff2('0x51')](_0x3f27ea[_0x3ff2('0x52')]);def[_0x3ff2('0x53')]=util['format'](_0x3ff2('0x54'),_0x3f27ea[_0x3ff2('0x50')]);if(_0x54ff73&&_0x54ff73['monitor_format']){logger['info'](_0x3ff2('0x55'),_0x3ff2('0x56'));_0x307dd2['recordingURL']=util[_0x3ff2('0x3d')](_0x3ff2('0x57'),_0x3f27ea['serverUrl'],_0x307dd2[_0x3ff2('0x58')],md5(_0x307dd2[_0x3ff2('0x58')]));}else{_0x307dd2[_0x3ff2('0x59')]='';}return getConnection(_0x3f27ea)['then'](function(_0x2acf4c){_0x5bc9fc=_0x2acf4c;return getUser(_0x3f27ea,_0x587197[_0x3ff2('0xf')],_0x5bc9fc);})[_0x3ff2('0x2d')](function(_0x31aebb){_0x1866ec=_0x31aebb;logger[_0x3ff2('0xe')](_0x3ff2('0x5a'),_0x1866ec['id']);return getEndUser(_0x3f27ea,_0x307dd2[_0x3ff2('0x5b')],_0x307dd2[_0x3ff2('0x5c')],_0x5bc9fc);})['then'](function(_0x25c60a){_0x21af5b=_0x25c60a;logger[_0x3ff2('0xe')](_0x3ff2('0x5d'),_0x21af5b['id']);return getTicket(_0x3f27ea,_0x1866ec,_0x21af5b,_0x4adeb7,_0x307dd2,_0x4adeb7[_0x3ff2('0x5e')],_0x5bc9fc,_0x3ff2('0x5f'));})[_0x3ff2('0x2d')](function(_0x891d0b){_0x14bc6b=_0x891d0b;logger[_0x3ff2('0xe')](_0x3ff2('0x60'));logger['info'](_0x3ff2('0x61'),_0x14bc6b['id']);return setRelationship(_0x5bc9fc,_0x1866ec,_0x14bc6b,_0x3ff2('0x62'));})[_0x3ff2('0x2d')](function(){return setRelationship(_0x5bc9fc,_0x21af5b,_0x14bc6b,_0x3ff2('0x63'));})[_0x3ff2('0x2d')](function(){return getServerInfo(_0x5bc9fc);})[_0x3ff2('0x2d')](function(_0x4470d2){var _0x5bb322=parseInt(_0x4470d2[_0x3ff2('0x64')]['charAt'](0x0));var _0x2582a8=util[_0x3ff2('0x3d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3f27ea[_0x3ff2('0x50')],_0x14bc6b['id']);if(_0x5bb322>0x6){_0x2582a8=util[_0x3ff2('0x3d')](_0x3ff2('0x65'),_0x3f27ea['remoteUri'],_0x14bc6b['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3ff2('0x3d')](_0x3ff2('0x66'),_0x587197[_0x3ff2('0xf')]),_0x3ff2('0x67'),{'uri':_0x2582a8});})[_0x3ff2('0x68')](function(_0x13e30d){logger['error'](_0x3ff2('0x55'),JSON[_0x3ff2('0x28')](_0x13e30d));});};exports[_0x3ff2('0x69')]=function(_0x30041c,_0x3427d2,_0x522959,_0x339c65,_0x784253,_0x383d1a,_0x46067d){var _0x17a5fa,_0x108fdd,_0x27962c,_0x23e80c;_0x383d1a[_0x3ff2('0x50')]=intUtil['stripTrailingSlash'](_0x383d1a[_0x3ff2('0x50')]);_0x383d1a['serverUrl']=intUtil['stripTrailingSlash'](_0x383d1a[_0x3ff2('0x52')]);def[_0x3ff2('0x53')]=util[_0x3ff2('0x3d')]('%s/service/v4_1/rest.php',_0x383d1a['remoteUri']);if(_0x46067d&&_0x46067d['recordingFormat']&&_0x46067d['recordingFormat']!==_0x3ff2('0x6a')){logger[_0x3ff2('0xe')](_0x3ff2('0x6b'),_0x3ff2('0x56'));_0x3427d2['recordingURL']=util['format'](_0x3ff2('0x57'),_0x383d1a[_0x3ff2('0x52')],_0x3427d2[_0x3ff2('0x58')],md5(_0x3427d2[_0x3ff2('0x58')]));}return getConnection(_0x383d1a)[_0x3ff2('0x2d')](function(_0x129749){_0x23e80c=_0x129749;return getUser(_0x383d1a,_0x339c65[_0x3ff2('0xf')],_0x23e80c);})[_0x3ff2('0x2d')](function(_0x203622){_0x17a5fa=_0x203622;logger[_0x3ff2('0xe')]('The\x20User\x20ID\x20is:',_0x17a5fa['id']);return getEndUser(_0x383d1a,_0x3427d2[_0x3ff2('0x6c')],_0x3427d2['destcalleridnum'],_0x23e80c);})[_0x3ff2('0x2d')](function(_0x3874c7){_0x108fdd=_0x3874c7;logger['info'](_0x3ff2('0x5d'),_0x108fdd['id']);return getTicket(_0x383d1a,_0x17a5fa,_0x108fdd,_0x522959,_0x3427d2,_0x522959[_0x3ff2('0x5e')],_0x23e80c,_0x3ff2('0x6d'));})[_0x3ff2('0x2d')](function(_0x426c64){_0x27962c=_0x426c64;logger['info'](_0x3ff2('0x60'));logger[_0x3ff2('0xe')]('The\x20Ticket\x20ID\x20is:',_0x27962c['id']);return setRelationship(_0x23e80c,_0x17a5fa,_0x27962c,_0x3ff2('0x62'));})[_0x3ff2('0x2d')](function(){return setRelationship(_0x23e80c,_0x108fdd,_0x27962c,_0x3ff2('0x63'));})[_0x3ff2('0x2d')](function(){return getServerInfo(_0x23e80c);})[_0x3ff2('0x2d')](function(_0x2d329d){var _0x5411e9=parseInt(_0x2d329d[_0x3ff2('0x64')][_0x3ff2('0x6e')](0x0));var _0x5d13ca=util[_0x3ff2('0x3d')](_0x3ff2('0x6f'),_0x383d1a['remoteUri'],_0x27962c['id']);if(_0x5411e9>0x6){_0x5d13ca=util['format'](_0x3ff2('0x65'),_0x383d1a[_0x3ff2('0x50')],_0x27962c['id']);}logger[_0x3ff2('0xe')](_0x3ff2('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3ff2('0x3d')](_0x3ff2('0x66'),_0x339c65[_0x3ff2('0xf')]),_0x3ff2('0x67'),{'uri':_0x5d13ca});})[_0x3ff2('0x68')](function(_0x43daf9){logger[_0x3ff2('0x70')](_0x3ff2('0x6b'),JSON[_0x3ff2('0x28')](_0x43daf9));});};exports[_0x3ff2('0x71')]=function(_0x2eda8e,_0x38c516,_0x8e76b,_0x4b0048,_0x52d577,_0x45c3c8){var _0x4de73f,_0x2f0d34,_0x477131,_0x406366;_0x45c3c8[_0x3ff2('0x50')]=intUtil[_0x3ff2('0x51')](_0x45c3c8[_0x3ff2('0x50')]);_0x45c3c8[_0x3ff2('0x52')]=intUtil['stripTrailingSlash'](_0x45c3c8['serverUrl']);def[_0x3ff2('0x53')]=util['format'](_0x3ff2('0x54'),_0x45c3c8['remoteUri']);if(_0x52d577&&_0x52d577[_0x3ff2('0x72')]){logger[_0x3ff2('0xe')]('['+_0x38c516[_0x3ff2('0x73')][_0x3ff2('0x74')]()+']',_0x3ff2('0x56'));_0x38c516[_0x3ff2('0x59')]=util[_0x3ff2('0x3d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45c3c8[_0x3ff2('0x52')],_0x38c516[_0x3ff2('0x58')],md5(_0x38c516[_0x3ff2('0x58')]));}else{_0x38c516['recordingURL']='';}return getConnection(_0x45c3c8)['then'](function(_0x3a0086){_0x406366=_0x3a0086;if(!_['isNil'](_0x4b0048)){return getUser(_0x45c3c8,_0x4b0048[_0x3ff2('0xf')],_0x406366);}else{return getUser(_0x45c3c8,null,_0x406366);}})[_0x3ff2('0x2d')](function(_0x25fab9){_0x4de73f=_0x25fab9;logger[_0x3ff2('0xe')](_0x3ff2('0x5a'),_0x4de73f['id']);return getEndUser(_0x45c3c8,_0x38c516[_0x3ff2('0x5b')],_0x38c516['calleridnum'],_0x406366);})[_0x3ff2('0x2d')](function(_0x4c43a8){_0x2f0d34=_0x4c43a8;logger[_0x3ff2('0xe')](_0x3ff2('0x5d'),_0x2f0d34['id']);return getTicket(_0x45c3c8,_0x4de73f,_0x2f0d34,_0x8e76b,_0x38c516,_0x8e76b[_0x3ff2('0x5e')],_0x406366,_0x3ff2('0x5f'));})[_0x3ff2('0x2d')](function(_0x3db90e){_0x477131=_0x3db90e;logger[_0x3ff2('0xe')]('Ticket\x20created!');logger['info'](_0x3ff2('0x61'),_0x477131['id']);return setRelationship(_0x406366,_0x4de73f,_0x477131,_0x3ff2('0x62'));})[_0x3ff2('0x2d')](function(){return setRelationship(_0x406366,_0x2f0d34,_0x477131,'contacts');})[_0x3ff2('0x2d')](function(){return getServerInfo(_0x406366);})[_0x3ff2('0x68')](function(_0x528887){logger[_0x3ff2('0x70')]('['+_0x38c516['lastevent'][_0x3ff2('0x74')]()+']',JSON[_0x3ff2('0x28')](_0x528887));});}; \ 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 a978fd3..83a24eb 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 _0x0be7=['sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','format','%s:\x20%s','key','keyContent','keyType','join','stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString'];(function(_0x46becf,_0x14443c){var _0x315605=function(_0x523cf8){while(--_0x523cf8){_0x46becf['push'](_0x46becf['shift']());}};_0x315605(++_0x14443c);}(_0x0be7,0x14f));var _0x70be=function(_0x1ccd70,_0x5d606c){_0x1ccd70=_0x1ccd70-0x0;var _0x5ad0af=_0x0be7[_0x1ccd70];return _0x5ad0af;};'use strict';var _=require(_0x70be('0x0'));var util=require(_0x70be('0x1'));exports[_0x70be('0x2')]=function(_0x354344,_0x55e522,_0x5dd66c){var _0x123288=[];if(_0x354344['length']>0x0){var _0x1515b8=_[_0x70be('0x3')](_0x354344,['id']);for(var _0x3ffbb2=0x0;_0x3ffbb2<_0x1515b8['length'];_0x3ffbb2++){var _0x759251=_0x1515b8[_0x3ffbb2];if(_0x759251[_0x70be('0x4')]===_0x70be('0x5')){_0x123288[_0x70be('0x6')](_0x759251[_0x70be('0x7')]);}else if(_0x759251['type']===_0x70be('0x8')&&_0x759251['variableName']){_0x55e522[_0x759251[_0x70be('0x9')]]&&_0x123288[_0x70be('0x6')](_0x55e522[_0x759251[_0x70be('0x9')]][_0x70be('0xa')]());}else if(_0x759251['type']===_0x70be('0xb')&&_0x759251[_0x70be('0xc')]&&_0x759251['Variable'][_0x70be('0xd')]){_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')]['toLowerCase']()]&&_0x123288[_0x70be('0x6')](_0x55e522[_0x759251[_0x70be('0xc')]['name'][_0x70be('0xe')]()][_0x70be('0xa')]());}else if(_0x759251[_0x70be('0x4')]==='keyValue'){if(_0x759251['keyType']==='string'&&_0x759251['key']){_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251[_0x70be('0x11')],_0x759251[_0x70be('0x12')]));}else if(_0x759251[_0x70be('0x13')]==='variable'&&_0x759251[_0x70be('0x9')]&&_0x759251[_0x70be('0x11')]){_0x55e522[_0x759251['variableName']]&&_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251['key'],_0x55e522[_0x759251[_0x70be('0x9')]]));}else if(_0x759251[_0x70be('0x13')]===_0x70be('0xb')&&_0x759251[_0x70be('0xc')]&&_0x759251[_0x70be('0xc')][_0x70be('0xd')]&&_0x759251[_0x70be('0x11')]){_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')][_0x70be('0xe')]()]&&_0x123288[_0x70be('0x6')](util[_0x70be('0xf')](_0x70be('0x10'),_0x759251['key'],_0x55e522[_0x759251[_0x70be('0xc')][_0x70be('0xd')][_0x70be('0xe')]()]));}}}}return _0x123288[_0x70be('0x14')](_0x5dd66c);};exports[_0x70be('0x15')]=function(_0x324471){var _0xe20e5e=_0x324471[_0x70be('0x16')](-0x1);if(_0xe20e5e==='/'){_0x324471=_0x324471[_0x70be('0x17')](0x0,_0x324471['lastIndexOf'](_0xe20e5e));}return _0x324471;};exports[_0x70be('0x18')]=function(_0x32c06c){if(!_['isNil'](_0x32c06c)&&_0x32c06c!==''){var _0x254024=/^(([^<>()\[\]\\.,;:\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 _0x254024[_0x70be('0x19')](String(_0x32c06c)[_0x70be('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xf854=['keyContent','keyType','format','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xf854,0x1af));var _0x4f85=function(_0x45c15d,_0x4d6005){_0x45c15d=_0x45c15d-0x0;var _0x4acb88=_0xf854[_0x45c15d];return _0x4acb88;};'use strict';var _=require(_0x4f85('0x0'));var util=require(_0x4f85('0x1'));exports['getString']=function(_0x57e196,_0x7dcfba,_0x501713){var _0x4a6b5c=[];if(_0x57e196[_0x4f85('0x2')]>0x0){var _0x15b667=_[_0x4f85('0x3')](_0x57e196,['id']);for(var _0x594278=0x0;_0x594278<_0x15b667[_0x4f85('0x2')];_0x594278++){var _0x24ad9c=_0x15b667[_0x594278];if(_0x24ad9c['type']===_0x4f85('0x4')){_0x4a6b5c[_0x4f85('0x5')](_0x24ad9c[_0x4f85('0x6')]);}else if(_0x24ad9c[_0x4f85('0x7')]===_0x4f85('0x8')&&_0x24ad9c['variableName']){_0x7dcfba[_0x24ad9c[_0x4f85('0x9')]]&&_0x4a6b5c[_0x4f85('0x5')](_0x7dcfba[_0x24ad9c[_0x4f85('0x9')]][_0x4f85('0xa')]());}else if(_0x24ad9c[_0x4f85('0x7')]===_0x4f85('0xb')&&_0x24ad9c[_0x4f85('0xc')]&&_0x24ad9c[_0x4f85('0xc')][_0x4f85('0xd')]){_0x7dcfba[_0x24ad9c[_0x4f85('0xc')][_0x4f85('0xd')][_0x4f85('0xe')]()]&&_0x4a6b5c['push'](_0x7dcfba[_0x24ad9c[_0x4f85('0xc')][_0x4f85('0xd')]['toLowerCase']()][_0x4f85('0xa')]());}else if(_0x24ad9c[_0x4f85('0x7')]===_0x4f85('0xf')){if(_0x24ad9c['keyType']===_0x4f85('0x4')&&_0x24ad9c[_0x4f85('0x10')]){_0x4a6b5c['push'](util['format']('%s:\x20%s',_0x24ad9c['key'],_0x24ad9c[_0x4f85('0x11')]));}else if(_0x24ad9c[_0x4f85('0x12')]===_0x4f85('0x8')&&_0x24ad9c[_0x4f85('0x9')]&&_0x24ad9c[_0x4f85('0x10')]){_0x7dcfba[_0x24ad9c[_0x4f85('0x9')]]&&_0x4a6b5c[_0x4f85('0x5')](util[_0x4f85('0x13')](_0x4f85('0x14'),_0x24ad9c[_0x4f85('0x10')],_0x7dcfba[_0x24ad9c[_0x4f85('0x9')]]));}else if(_0x24ad9c['keyType']==='customVariable'&&_0x24ad9c[_0x4f85('0xc')]&&_0x24ad9c[_0x4f85('0xc')][_0x4f85('0xd')]&&_0x24ad9c[_0x4f85('0x10')]){_0x7dcfba[_0x24ad9c['Variable']['name'][_0x4f85('0xe')]()]&&_0x4a6b5c['push'](util[_0x4f85('0x13')](_0x4f85('0x14'),_0x24ad9c[_0x4f85('0x10')],_0x7dcfba[_0x24ad9c['Variable'][_0x4f85('0xd')][_0x4f85('0xe')]()]));}}}}return _0x4a6b5c[_0x4f85('0x15')](_0x501713);};exports[_0x4f85('0x16')]=function(_0x5d6017){var _0x3d9963=_0x5d6017[_0x4f85('0x17')](-0x1);if(_0x3d9963==='/'){_0x5d6017=_0x5d6017['substring'](0x0,_0x5d6017[_0x4f85('0x18')](_0x3d9963));}return _0x5d6017;};exports[_0x4f85('0x19')]=function(_0x5dc5a6){if(!_[_0x4f85('0x1a')](_0x5dc5a6)&&_0x5dc5a6!==''){var _0x20a489=/^(([^<>()\[\]\\.,;:\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 _0x20a489[_0x4f85('0x1b')](String(_0x5dc5a6)[_0x4f85('0xe')]());}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 9bdb919..5308d1c 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(_0x78c59,_0x46c42b){var _0x376423=function(_0x58a54d){while(--_0x58a54d){_0x78c59['push'](_0x78c59['shift']());}};_0x376423(++_0x46c42b);}(_0xe706,0xa3));var _0x6e70=function(_0x2c3483,_0x22f134){_0x2c3483=_0x2c3483-0x0;var _0x4e945f=_0xe706[_0x2c3483];return _0x4e945f;};'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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 8812006..d455558 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 _0x6554=['email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','then','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','[HTTP]','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization'];(function(_0x3915d9,_0x307b68){var _0x1f35d4=function(_0xf53b84){while(--_0xf53b84){_0x3915d9['push'](_0x3915d9['shift']());}};_0x1f35d4(++_0x307b68);}(_0x6554,0x171));var _0x4655=function(_0x1054c4,_0xda6074){_0x1054c4=_0x1054c4-0x0;var _0x4b6372=_0x6554[_0x1054c4];return _0x4b6372;};'use strict';var _=require('lodash');var rp=require(_0x4655('0x0'));var md5=require(_0x4655('0x1'));var util=require(_0x4655('0x2'));var Redis=require(_0x4655('0x3'));var intUtil=require(_0x4655('0x4'));var config=require(_0x4655('0x5'));var logger=require(_0x4655('0x6'))('zendesk');config[_0x4655('0x7')]=_[_0x4655('0x8')](config[_0x4655('0x7')],{'host':_0x4655('0x9'),'port':0x18eb});var io=require(_0x4655('0xa'))(new Redis(config[_0x4655('0x7')]));function emit(_0x29e80d,_0x267ba3,_0x496b86){io['to'](_0x29e80d)[_0x4655('0xb')](_0x267ba3,_0x496b86);}var headers={'Content-Type':_0x4655('0xc'),'Accept':'application/json'};function getTicket(_0xb870a2,_0x55b072,_0x45de5d,_0x584ed4,_0x47142e){logger[_0x4655('0xd')](_0x4655('0xe'));return request({'uri':util[_0x4655('0xf')](_0x4655('0x10'),_0xb870a2['remoteUri']),'method':_0x4655('0x11'),'body':{'ticket':_[_0x4655('0x12')]({'requester_id':_0x45de5d['id'],'submitter_id':_0x55b072?_0x55b072['id']:undefined,'assignee_id':_0x55b072?_0x55b072['id']:undefined,'tags':getTags(_0x584ed4[_0x4655('0x13')],_0x4655('0x14')),'subject':intUtil[_0x4655('0x15')](_0x584ed4[_0x4655('0x16')],_0x47142e,'\x20'),'description':intUtil[_0x4655('0x15')](_0x584ed4[_0x4655('0x17')],_0x47142e,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x584ed4['Descriptions'],_0x47142e,'\x0a')}},getCustomFields(_0x584ed4[_0x4655('0x18')],_0x47142e))}})['then'](function(_0x5e05e0){logger[_0x4655('0xd')](_0x4655('0x19'));return _0x5e05e0['ticket'];});}function getUser(_0x2d00dc,_0x20117c){if(intUtil[_0x4655('0x1a')](_0x20117c)){logger[_0x4655('0xd')](_0x4655('0x1b'),_0x20117c);return request({'uri':util['format'](_0x4655('0x1c'),_0x2d00dc[_0x4655('0x1d')]),'qs':{'query':util[_0x4655('0xf')](_0x4655('0x1e'),_0x20117c)}})['then'](function(_0x13e579){if(_0x13e579[_0x4655('0x1f')]){logger['info'](_0x4655('0x20'));return _[_0x4655('0x21')](_0x13e579[_0x4655('0x22')],{'email':_0x20117c,'role':_0x4655('0x23')});}else{logger[_0x4655('0xd')](_0x4655('0x24'));return request({'uri':util['format'](_0x4655('0x25'),_0x2d00dc[_0x4655('0x1d')])})['then'](function(_0x1a3ddb){logger[_0x4655('0xd')](_0x4655('0x26'));return _0x1a3ddb[_0x4655('0x27')];});}});}else{logger[_0x4655('0xd')](_0x4655('0x24'));return request({'uri':util[_0x4655('0xf')](_0x4655('0x25'),_0x2d00dc[_0x4655('0x1d')])})[_0x4655('0x28')](function(_0x23054f){logger[_0x4655('0xd')](_0x4655('0x26'));return _0x23054f[_0x4655('0x27')];});}}function getEndUser(_0x5237a5,_0x3c5b44,_0x5dabae){logger[_0x4655('0xd')]('Searching\x20enduser\x20with\x20phone',_0x5dabae);return request({'uri':util[_0x4655('0xf')]('%s/search.json',_0x5237a5['remoteUri']),'qs':{'query':util[_0x4655('0xf')](_0x4655('0x29'),_0x5dabae)}})[_0x4655('0x28')](function(_0x453cc0){var _0x503ee7;if(_0x453cc0['results']['length']){_0x453cc0['results']=_[_0x4655('0x2a')](_0x453cc0[_0x4655('0x22')],{'suspended':![],'role':'end-user'});if(_0x453cc0[_0x4655('0x22')][_0x4655('0x2b')]){_0x503ee7=_['first'](_0x453cc0[_0x4655('0x22')]);}}if(_0x503ee7){logger[_0x4655('0xd')](_0x4655('0x2c'));return _0x503ee7;}else{logger[_0x4655('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4655('0xf')](_0x4655('0x2d'),_0x5237a5[_0x4655('0x1d')]),'method':_0x4655('0x11'),'body':{'user':{'role':_0x4655('0x2e'),'name':util[_0x4655('0xf')](_0x4655('0x2f'),_0x3c5b44||_0x5dabae),'phone':_0x5dabae}}})[_0x4655('0x28')](function(_0x5b8cc3){logger[_0x4655('0xd')](_0x4655('0x30'));return _0x5b8cc3[_0x4655('0x27')];});}});}function getAuth(_0x2bf739){var _0x15b130;if(_0x2bf739[_0x4655('0x31')]===_0x4655('0x32')){_0x15b130=util['format'](_0x4655('0x33'),_0x2bf739[_0x4655('0x34')],_0x2bf739[_0x4655('0x32')]);}else if(_0x2bf739[_0x4655('0x31')]===_0x4655('0x35')){_0x15b130=util[_0x4655('0xf')](_0x4655('0x36'),_0x2bf739[_0x4655('0x34')],_0x2bf739['token']);}return util[_0x4655('0xf')](_0x4655('0x37'),new Buffer(_0x15b130)['toString']('base64'));}function request(_0x28ce40){logger['debug'](_0x4655('0x38'),JSON['stringify'](_0x28ce40));return rp(_[_0x4655('0x8')](_0x28ce40,{'method':_0x4655('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x5008b8,_0x264c67){var _0x33f097=[];if(_0x5008b8&&_0x5008b8['length']>0x0){_0x33f097=_['map'](_0x5008b8,_0x264c67);}return _0x33f097;}function getCustomFields(_0x57ffd9,_0x24bd0b){var _0x36192d=[];var _0x40c7e7={'custom_fields':[]};if(_0x57ffd9['length']>0x0){_[_0x4655('0x3a')](_0x57ffd9,function(_0x266779){if(_[_0x4655('0x3b')]([_0x4655('0x3c'),_0x4655('0x3d')],_0x266779[_0x4655('0x3e')])&&_0x266779[_0x4655('0x3f')]&&!_0x266779[_0x4655('0x40')]){_0x40c7e7[_0x266779[_0x4655('0x3f')][_0x4655('0x41')]()]=_0x266779[_0x4655('0x42')][_0x4655('0x43')]();}else if(_['includes'](['string',_0x4655('0x3d')],_0x266779[_0x4655('0x3e')])&&_0x266779[_0x4655('0x44')]&&_0x266779[_0x4655('0x40')]){_0x40c7e7[_0x4655('0x45')]['push']({'id':_0x266779[_0x4655('0x44')],'value':_0x266779[_0x4655('0x42')]['toString']()});}else if(_0x266779[_0x4655('0x3e')]===_0x4655('0x46')&&_0x266779[_0x4655('0x47')]&&_0x266779[_0x4655('0x44')]&&_0x266779[_0x4655('0x40')]){_0x24bd0b[_0x266779[_0x4655('0x47')]]&&_0x40c7e7[_0x4655('0x45')][_0x4655('0x48')]({'id':_0x266779[_0x4655('0x44')],'value':_0x24bd0b[_0x266779['variableName']][_0x4655('0x43')]()});}else if(_0x266779['type']===_0x4655('0x49')&&_0x266779['Variable']&&_0x266779[_0x4655('0x4a')][_0x4655('0x14')]&&_0x266779['idField']&&_0x266779[_0x4655('0x40')]){_0x24bd0b[_0x266779[_0x4655('0x4a')][_0x4655('0x14')]['toLowerCase']()]&&_0x40c7e7['custom_fields']['push']({'id':_0x266779['idField'],'value':_0x24bd0b[_0x266779[_0x4655('0x4a')][_0x4655('0x14')][_0x4655('0x41')]()][_0x4655('0x43')]()});}});}return _0x40c7e7;}exports[_0x4655('0x4b')]=function(_0x46b692,_0x460680,_0x20353e,_0x5dc217,_0x4fd666,_0xa58431){var _0x45f718,_0x4d2ade;_0xa58431[_0x4655('0x1d')]=intUtil[_0x4655('0x4c')](_0xa58431[_0x4655('0x1d')]);_0xa58431[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0xa58431[_0x4655('0x4d')]);if(_0x4fd666&&_0x4fd666[_0x4655('0x4e')]){logger[_0x4655('0xd')](_0x4655('0x4f'),'Recording\x20is\x20enabled!');_0x460680[_0x4655('0x50')]=util[_0x4655('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa58431[_0x4655('0x4d')],_0x460680[_0x4655('0x51')],md5(_0x460680['uniqueid']));}else{_0x460680[_0x4655('0x50')]='';}headers[_0x4655('0x52')]=getAuth(_0xa58431);return getUser(_0xa58431,_0x5dc217[_0x4655('0x53')])['then'](function(_0x528e03){_0x45f718=_0x528e03;logger[_0x4655('0xd')]('The\x20User\x20ID\x20is:',_0x45f718['id']);return getEndUser(_0xa58431,_0x460680['calleridname'],_0x460680[_0x4655('0x54')]);})[_0x4655('0x28')](function(_0x42e359){_0x4d2ade=_0x42e359;logger['info'](_0x4655('0x55'),_0x4d2ade['id']);return getTicket(_0xa58431,_0x45f718,_0x4d2ade,_0x20353e,_0x460680);})[_0x4655('0x28')](function(_0x5744b4){if(_0x5744b4){logger[_0x4655('0xd')](_0x4655('0x56'),_0x5744b4['id']);switch(_0xa58431[_0x4655('0x3e')]){case'integrationTab':logger['info'](_0x4655('0x4f'),_0x4655('0x57'));return request({'uri':util[_0x4655('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xa58431[_0x4655('0x1d')],_0x45f718['id'],_0x5744b4['id']),'method':_0x4655('0x11')});case'newTab':logger[_0x4655('0xd')](_0x4655('0x4f'),_0x4655('0x58'));emit(util[_0x4655('0xf')](_0x4655('0x59'),_0x5dc217[_0x4655('0x14')]),_0x4655('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0xa58431[_0x4655('0x1d')][_0x4655('0x5b')]('/api/v2',''),_0x5744b4['id'])});break;default:logger[_0x4655('0x5c')](_0x4655('0x4f'),_0x4655('0x5d'));}}})[_0x4655('0x5e')](function(_0x25c2fa){logger[_0x4655('0x5c')](_0x4655('0x5f'),util[_0x4655('0x60')](_0x25c2fa,{'showHidden':!![],'depth':null}));});};exports[_0x4655('0x61')]=function(_0x32f077,_0x33590b,_0x8c332a,_0x3dd611,_0x55e2d1,_0xfdecc3,_0x5dcbed){var _0x13b089,_0x552900;_0xfdecc3['remoteUri']=intUtil[_0x4655('0x4c')](_0xfdecc3[_0x4655('0x1d')]);_0xfdecc3[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0xfdecc3['serverUrl']);if(_0x5dcbed&&_0x5dcbed[_0x4655('0x62')]&&_0x5dcbed[_0x4655('0x62')]!=='none'){logger[_0x4655('0xd')](_0x4655('0x63'),_0x4655('0x64'));_0x33590b[_0x4655('0x50')]=util['format'](_0x4655('0x65'),_0xfdecc3['serverUrl'],_0x33590b[_0x4655('0x51')],md5(_0x33590b[_0x4655('0x51')]));}headers[_0x4655('0x52')]=getAuth(_0xfdecc3);return getUser(_0xfdecc3,_0x3dd611[_0x4655('0x53')])[_0x4655('0x28')](function(_0x347924){_0x13b089=_0x347924;logger['info'](_0x4655('0x66'),_0x13b089['id']);return getEndUser(_0xfdecc3,_0x33590b[_0x4655('0x67')],_0x33590b['destcalleridnum']);})['then'](function(_0x21eff6){_0x552900=_0x21eff6;logger[_0x4655('0xd')](_0x4655('0x55'),_0x552900['id']);return getTicket(_0xfdecc3,_0x13b089,_0x552900,_0x8c332a,_0x33590b);})[_0x4655('0x28')](function(_0x21f5fc){if(_0x21f5fc){logger[_0x4655('0xd')](_0x4655('0x56'),_0x21f5fc['id']);switch(_0xfdecc3[_0x4655('0x3e')]){case _0x4655('0x68'):logger[_0x4655('0xd')](_0x4655('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x4655('0x69'),_0xfdecc3[_0x4655('0x1d')],_0x13b089['id'],_0x21f5fc['id']),'method':_0x4655('0x11')});case _0x4655('0x6a'):logger['info'](_0x4655('0x63'),_0x4655('0x58'));emit(util[_0x4655('0xf')](_0x4655('0x59'),_0x3dd611[_0x4655('0x14')]),_0x4655('0x5a'),{'uri':util[_0x4655('0xf')](_0x4655('0x6b'),_0xfdecc3[_0x4655('0x1d')]['replace'](_0x4655('0x6c'),''),_0x21f5fc['id'])});break;default:logger[_0x4655('0x5c')](_0x4655('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4655('0x5e')](function(_0x5d9207){logger['error'](_0x4655('0x6d'),util[_0x4655('0x60')](_0x5d9207,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x491bbc,_0x87e3d7,_0x2df00a,_0x5d89f9,_0x3168de,_0x4d7f90){var _0x26e586,_0x4e2dc3;_0x4d7f90['remoteUri']=intUtil['stripTrailingSlash'](_0x4d7f90[_0x4655('0x1d')]);_0x4d7f90[_0x4655('0x4d')]=intUtil[_0x4655('0x4c')](_0x4d7f90['serverUrl']);if(_0x3168de&&_0x3168de[_0x4655('0x4e')]){logger[_0x4655('0xd')]('['+_0x87e3d7[_0x4655('0x6e')]['toUpperCase']()+']',_0x4655('0x64'));_0x87e3d7[_0x4655('0x50')]=util['format'](_0x4655('0x65'),_0x4d7f90['serverUrl'],_0x87e3d7[_0x4655('0x51')],md5(_0x87e3d7[_0x4655('0x51')]));}else{_0x87e3d7[_0x4655('0x50')]='';}headers[_0x4655('0x52')]=getAuth(_0x4d7f90);return getUser(_0x4d7f90)[_0x4655('0x28')](function(_0x1f37c2){_0x26e586=_0x1f37c2;logger[_0x4655('0xd')](_0x4655('0x66'),_0x26e586['id']);return getEndUser(_0x4d7f90,_0x87e3d7['calleridname'],_0x87e3d7[_0x4655('0x54')]);})[_0x4655('0x28')](function(_0x1e9701){_0x4e2dc3=_0x1e9701;logger['info'](_0x4655('0x55'),_0x4e2dc3['id']);return getTicket(_0x4d7f90,_0x26e586,_0x4e2dc3,_0x2df00a,_0x87e3d7);})['then'](function(_0x5b61f1){if(_0x5b61f1){logger[_0x4655('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5b61f1['id']);}})[_0x4655('0x5e')](function(_0x3fa8bb){logger[_0x4655('0x5c')]('['+_0x87e3d7['lastevent'][_0x4655('0x6f')]()+']'+_0x4655('0x70'),util[_0x4655('0x60')](_0x3fa8bb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe459=['custom_fields','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','Tags','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','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.','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','base64','debug','GET','map','forEach','includes','string','picklist','customField','nameField','toString','idField'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0xe459,0x18e));var _0x9e45=function(_0x33186b,_0x356479){_0x33186b=_0x33186b-0x0;var _0x3d7422=_0xe459[_0x33186b];return _0x3d7422;};'use strict';var _=require('lodash');var rp=require(_0x9e45('0x0'));var md5=require(_0x9e45('0x1'));var util=require(_0x9e45('0x2'));var Redis=require(_0x9e45('0x3'));var intUtil=require(_0x9e45('0x4'));var config=require(_0x9e45('0x5'));var logger=require(_0x9e45('0x6'))(_0x9e45('0x7'));config['redis']=_[_0x9e45('0x8')](config[_0x9e45('0x9')],{'host':_0x9e45('0xa'),'port':0x18eb});var io=require(_0x9e45('0xb'))(new Redis(config[_0x9e45('0x9')]));function emit(_0x19af83,_0x33860c,_0x3c26f0){io['to'](_0x19af83)[_0x9e45('0xc')](_0x33860c,_0x3c26f0);}var headers={'Content-Type':_0x9e45('0xd'),'Accept':_0x9e45('0xd')};function getTicket(_0x1495b3,_0x5e11bf,_0x285571,_0x4a2ce8,_0x32b851){logger[_0x9e45('0xe')](_0x9e45('0xf'));return request({'uri':util[_0x9e45('0x10')]('%s/tickets.json',_0x1495b3[_0x9e45('0x11')]),'method':_0x9e45('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x285571['id'],'submitter_id':_0x5e11bf?_0x5e11bf['id']:undefined,'assignee_id':_0x5e11bf?_0x5e11bf['id']:undefined,'tags':getTags(_0x4a2ce8[_0x9e45('0x13')],'name'),'subject':intUtil[_0x9e45('0x14')](_0x4a2ce8[_0x9e45('0x15')],_0x32b851,'\x20'),'description':intUtil[_0x9e45('0x14')](_0x4a2ce8[_0x9e45('0x16')],_0x32b851,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9e45('0x14')](_0x4a2ce8['Descriptions'],_0x32b851,'\x0a')}},getCustomFields(_0x4a2ce8['Fields'],_0x32b851))}})[_0x9e45('0x17')](function(_0x554938){logger['info'](_0x9e45('0x18'));return _0x554938[_0x9e45('0x19')];});}function getUser(_0x1dbd3e,_0x2fa1b4){if(intUtil[_0x9e45('0x1a')](_0x2fa1b4)){logger[_0x9e45('0xe')]('Getting\x20agent\x20with\x20email',_0x2fa1b4);return request({'uri':util['format'](_0x9e45('0x1b'),_0x1dbd3e[_0x9e45('0x11')]),'qs':{'query':util[_0x9e45('0x10')](_0x9e45('0x1c'),_0x2fa1b4)}})['then'](function(_0x5e8bd8){if(_0x5e8bd8[_0x9e45('0x1d')]){logger['info'](_0x9e45('0x1e'));return _[_0x9e45('0x1f')](_0x5e8bd8[_0x9e45('0x20')],{'email':_0x2fa1b4,'role':'agent'});}else{logger[_0x9e45('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9e45('0x10')](_0x9e45('0x21'),_0x1dbd3e[_0x9e45('0x11')])})[_0x9e45('0x17')](function(_0x306623){logger[_0x9e45('0xe')](_0x9e45('0x22'));return _0x306623[_0x9e45('0x23')];});}});}else{logger[_0x9e45('0xe')](_0x9e45('0x24'));return request({'uri':util[_0x9e45('0x10')](_0x9e45('0x21'),_0x1dbd3e[_0x9e45('0x11')])})['then'](function(_0x286aa6){logger[_0x9e45('0xe')]('Admin\x20account\x20selected.');return _0x286aa6[_0x9e45('0x23')];});}}function getEndUser(_0x23a1f2,_0x3da248,_0x36e286){logger[_0x9e45('0xe')](_0x9e45('0x25'),_0x36e286);return request({'uri':util['format'](_0x9e45('0x1b'),_0x23a1f2[_0x9e45('0x11')]),'qs':{'query':util['format'](_0x9e45('0x26'),_0x36e286)}})[_0x9e45('0x17')](function(_0x52ad2b){var _0x409bb1;if(_0x52ad2b[_0x9e45('0x20')][_0x9e45('0x27')]){_0x52ad2b[_0x9e45('0x20')]=_[_0x9e45('0x28')](_0x52ad2b[_0x9e45('0x20')],{'suspended':![],'role':_0x9e45('0x29')});if(_0x52ad2b[_0x9e45('0x20')][_0x9e45('0x27')]){_0x409bb1=_[_0x9e45('0x2a')](_0x52ad2b['results']);}}if(_0x409bb1){logger[_0x9e45('0xe')](_0x9e45('0x2b'));return _0x409bb1;}else{logger[_0x9e45('0xe')](_0x9e45('0x2c'));return request({'uri':util['format'](_0x9e45('0x2d'),_0x23a1f2['remoteUri']),'method':'POST','body':{'user':{'role':_0x9e45('0x29'),'name':util[_0x9e45('0x10')](_0x9e45('0x2e'),_0x3da248||_0x36e286),'phone':_0x36e286}}})[_0x9e45('0x17')](function(_0x4df5f0){logger[_0x9e45('0xe')](_0x9e45('0x2f'));return _0x4df5f0[_0x9e45('0x23')];});}});}function getAuth(_0x5dafda){var _0x446053;if(_0x5dafda['authType']==='password'){_0x446053=util[_0x9e45('0x10')](_0x9e45('0x30'),_0x5dafda['username'],_0x5dafda['password']);}else if(_0x5dafda[_0x9e45('0x31')]===_0x9e45('0x32')){_0x446053=util[_0x9e45('0x10')](_0x9e45('0x33'),_0x5dafda[_0x9e45('0x34')],_0x5dafda[_0x9e45('0x32')]);}return util[_0x9e45('0x10')](_0x9e45('0x35'),new Buffer(_0x446053)['toString'](_0x9e45('0x36')));}function request(_0x57ff05){logger[_0x9e45('0x37')]('[HTTP]',JSON['stringify'](_0x57ff05));return rp(_[_0x9e45('0x8')](_0x57ff05,{'method':_0x9e45('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x144591,_0x23fb59){var _0x4c613e=[];if(_0x144591&&_0x144591[_0x9e45('0x27')]>0x0){_0x4c613e=_[_0x9e45('0x39')](_0x144591,_0x23fb59);}return _0x4c613e;}function getCustomFields(_0x44b81f,_0x1badf2){var _0x292bc8=[];var _0x45ccd9={'custom_fields':[]};if(_0x44b81f[_0x9e45('0x27')]>0x0){_[_0x9e45('0x3a')](_0x44b81f,function(_0xaeedc3){if(_[_0x9e45('0x3b')]([_0x9e45('0x3c'),_0x9e45('0x3d')],_0xaeedc3['type'])&&_0xaeedc3['nameField']&&!_0xaeedc3[_0x9e45('0x3e')]){_0x45ccd9[_0xaeedc3[_0x9e45('0x3f')]['toLowerCase']()]=_0xaeedc3['content'][_0x9e45('0x40')]();}else if(_[_0x9e45('0x3b')]([_0x9e45('0x3c'),_0x9e45('0x3d')],_0xaeedc3['type'])&&_0xaeedc3[_0x9e45('0x41')]&&_0xaeedc3['customField']){_0x45ccd9[_0x9e45('0x42')][_0x9e45('0x43')]({'id':_0xaeedc3[_0x9e45('0x41')],'value':_0xaeedc3[_0x9e45('0x44')][_0x9e45('0x40')]()});}else if(_0xaeedc3[_0x9e45('0x45')]===_0x9e45('0x46')&&_0xaeedc3['variableName']&&_0xaeedc3['idField']&&_0xaeedc3[_0x9e45('0x3e')]){_0x1badf2[_0xaeedc3[_0x9e45('0x47')]]&&_0x45ccd9[_0x9e45('0x42')][_0x9e45('0x43')]({'id':_0xaeedc3['idField'],'value':_0x1badf2[_0xaeedc3[_0x9e45('0x47')]][_0x9e45('0x40')]()});}else if(_0xaeedc3[_0x9e45('0x45')]===_0x9e45('0x48')&&_0xaeedc3[_0x9e45('0x49')]&&_0xaeedc3[_0x9e45('0x49')][_0x9e45('0x4a')]&&_0xaeedc3[_0x9e45('0x41')]&&_0xaeedc3[_0x9e45('0x3e')]){_0x1badf2[_0xaeedc3[_0x9e45('0x49')]['name'][_0x9e45('0x4b')]()]&&_0x45ccd9[_0x9e45('0x42')][_0x9e45('0x43')]({'id':_0xaeedc3[_0x9e45('0x41')],'value':_0x1badf2[_0xaeedc3[_0x9e45('0x49')][_0x9e45('0x4a')][_0x9e45('0x4b')]()]['toString']()});}});}return _0x45ccd9;}exports[_0x9e45('0x4c')]=function(_0x1f8ac2,_0x4d23d7,_0x3edba9,_0xcb0c67,_0x351263,_0x35066c){var _0x3dbdfb,_0x60ce85;_0x35066c[_0x9e45('0x11')]=intUtil[_0x9e45('0x4d')](_0x35066c[_0x9e45('0x11')]);_0x35066c[_0x9e45('0x4e')]=intUtil[_0x9e45('0x4d')](_0x35066c[_0x9e45('0x4e')]);if(_0x351263&&_0x351263[_0x9e45('0x4f')]){logger[_0x9e45('0xe')](_0x9e45('0x50'),_0x9e45('0x51'));_0x4d23d7[_0x9e45('0x52')]=util[_0x9e45('0x10')](_0x9e45('0x53'),_0x35066c[_0x9e45('0x4e')],_0x4d23d7['uniqueid'],md5(_0x4d23d7[_0x9e45('0x54')]));}else{_0x4d23d7[_0x9e45('0x52')]='';}headers[_0x9e45('0x55')]=getAuth(_0x35066c);return getUser(_0x35066c,_0xcb0c67[_0x9e45('0x56')])['then'](function(_0x199126){_0x3dbdfb=_0x199126;logger[_0x9e45('0xe')](_0x9e45('0x57'),_0x3dbdfb['id']);return getEndUser(_0x35066c,_0x4d23d7[_0x9e45('0x58')],_0x4d23d7['calleridnum']);})[_0x9e45('0x17')](function(_0x5507cb){_0x60ce85=_0x5507cb;logger[_0x9e45('0xe')](_0x9e45('0x59'),_0x60ce85['id']);return getTicket(_0x35066c,_0x3dbdfb,_0x60ce85,_0x3edba9,_0x4d23d7);})[_0x9e45('0x17')](function(_0xb033f6){if(_0xb033f6){logger[_0x9e45('0xe')](_0x9e45('0x5a'),_0xb033f6['id']);switch(_0x35066c[_0x9e45('0x45')]){case _0x9e45('0x5b'):logger[_0x9e45('0xe')](_0x9e45('0x50'),_0x9e45('0x5c'));return request({'uri':util[_0x9e45('0x10')](_0x9e45('0x5d'),_0x35066c['remoteUri'],_0x3dbdfb['id'],_0xb033f6['id']),'method':_0x9e45('0x12')});case _0x9e45('0x5e'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0xcb0c67[_0x9e45('0x4a')]),_0x9e45('0x5f'),{'uri':util[_0x9e45('0x10')]('%s/agent/tickets/%s',_0x35066c['remoteUri'][_0x9e45('0x60')]('/api/v2',''),_0xb033f6['id'])});break;default:logger[_0x9e45('0x61')](_0x9e45('0x50'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x9e45('0x62')](function(_0x5b480d){logger[_0x9e45('0x61')](_0x9e45('0x63'),util[_0x9e45('0x64')](_0x5b480d,{'showHidden':!![],'depth':null}));});};exports[_0x9e45('0x65')]=function(_0x51db76,_0x21251f,_0x204a14,_0x30ef23,_0x22de11,_0x55bfde,_0xf7bca9){var _0x9c4126,_0x13f3ac;_0x55bfde[_0x9e45('0x11')]=intUtil[_0x9e45('0x4d')](_0x55bfde[_0x9e45('0x11')]);_0x55bfde[_0x9e45('0x4e')]=intUtil[_0x9e45('0x4d')](_0x55bfde[_0x9e45('0x4e')]);if(_0xf7bca9&&_0xf7bca9['recordingFormat']&&_0xf7bca9[_0x9e45('0x66')]!==_0x9e45('0x67')){logger[_0x9e45('0xe')](_0x9e45('0x68'),_0x9e45('0x51'));_0x21251f[_0x9e45('0x52')]=util[_0x9e45('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55bfde['serverUrl'],_0x21251f[_0x9e45('0x54')],md5(_0x21251f[_0x9e45('0x54')]));}headers['Authorization']=getAuth(_0x55bfde);return getUser(_0x55bfde,_0x30ef23[_0x9e45('0x56')])['then'](function(_0x580a2f){_0x9c4126=_0x580a2f;logger['info'](_0x9e45('0x57'),_0x9c4126['id']);return getEndUser(_0x55bfde,_0x21251f[_0x9e45('0x69')],_0x21251f[_0x9e45('0x6a')]);})['then'](function(_0x4df6cc){_0x13f3ac=_0x4df6cc;logger[_0x9e45('0xe')](_0x9e45('0x59'),_0x13f3ac['id']);return getTicket(_0x55bfde,_0x9c4126,_0x13f3ac,_0x204a14,_0x21251f);})[_0x9e45('0x17')](function(_0x5e5266){if(_0x5e5266){logger[_0x9e45('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5e5266['id']);switch(_0x55bfde[_0x9e45('0x45')]){case _0x9e45('0x5b'):logger[_0x9e45('0xe')](_0x9e45('0x68'),_0x9e45('0x5c'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x55bfde['remoteUri'],_0x9c4126['id'],_0x5e5266['id']),'method':_0x9e45('0x12')});case'newTab':logger[_0x9e45('0xe')](_0x9e45('0x68'),_0x9e45('0x6b'));emit(util['format'](_0x9e45('0x6c'),_0x30ef23[_0x9e45('0x4a')]),'trigger:browser:url',{'uri':util[_0x9e45('0x10')](_0x9e45('0x6d'),_0x55bfde[_0x9e45('0x11')][_0x9e45('0x60')](_0x9e45('0x6e'),''),_0x5e5266['id'])});break;default:logger[_0x9e45('0x61')]('[OUTBOUND]',_0x9e45('0x6f'));}}})[_0x9e45('0x62')](function(_0x141100){logger[_0x9e45('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x141100,{'showHidden':!![],'depth':null}));});};exports[_0x9e45('0x70')]=function(_0x4bbda0,_0x558e7a,_0x143a0e,_0x115db6,_0x4b240c,_0x1f2725){var _0x316c7c,_0x526a19;_0x1f2725[_0x9e45('0x11')]=intUtil[_0x9e45('0x4d')](_0x1f2725['remoteUri']);_0x1f2725[_0x9e45('0x4e')]=intUtil[_0x9e45('0x4d')](_0x1f2725[_0x9e45('0x4e')]);if(_0x4b240c&&_0x4b240c[_0x9e45('0x4f')]){logger[_0x9e45('0xe')]('['+_0x558e7a[_0x9e45('0x71')][_0x9e45('0x72')]()+']','Recording\x20is\x20enabled!');_0x558e7a['recordingURL']=util[_0x9e45('0x10')](_0x9e45('0x53'),_0x1f2725[_0x9e45('0x4e')],_0x558e7a['uniqueid'],md5(_0x558e7a[_0x9e45('0x54')]));}else{_0x558e7a['recordingURL']='';}headers[_0x9e45('0x55')]=getAuth(_0x1f2725);return getUser(_0x1f2725)['then'](function(_0x385fe7){_0x316c7c=_0x385fe7;logger[_0x9e45('0xe')]('The\x20User\x20ID\x20is:',_0x316c7c['id']);return getEndUser(_0x1f2725,_0x558e7a[_0x9e45('0x58')],_0x558e7a['calleridnum']);})['then'](function(_0x19e509){_0x526a19=_0x19e509;logger[_0x9e45('0xe')](_0x9e45('0x59'),_0x526a19['id']);return getTicket(_0x1f2725,_0x316c7c,_0x526a19,_0x143a0e,_0x558e7a);})[_0x9e45('0x17')](function(_0x10a65a){if(_0x10a65a){logger['info'](_0x9e45('0x5a'),_0x10a65a['id']);}})[_0x9e45('0x62')](function(_0x4db7dd){logger[_0x9e45('0x61')]('['+_0x558e7a[_0x9e45('0x71')][_0x9e45('0x72')]()+']'+_0x9e45('0x73'),util[_0x9e45('0x64')](_0x4db7dd,{'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 81fc6b3..420bf2c 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 _0x16a4=['recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','uniqueid','zoho.eu','destcalleridname','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','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','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','last_name','code','SUCCESS','details','startCase','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','Creating\x20new\x20call...','administrator','first_name','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','err','stack','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x4ccb31,_0x15cef9){var _0x4bce35=function(_0x4c9ac4){while(--_0x4c9ac4){_0x4ccb31['push'](_0x4ccb31['shift']());}};_0x4bce35(++_0x15cef9);}(_0x16a4,0xa5));var _0x416a=function(_0x44740d,_0x59ff15){_0x44740d=_0x44740d-0x0;var _0x1b89e2=_0x16a4[_0x44740d];return _0x1b89e2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x416a('0x0'));var util=require(_0x416a('0x1'));var intUtil=require(_0x416a('0x2'));var moment=require(_0x416a('0x3'));var Redis=require(_0x416a('0x4'));var BPromise=require(_0x416a('0x5'));var config=require(_0x416a('0x6'));var logger=require(_0x416a('0x7'))('zoho');config[_0x416a('0x8')]=_[_0x416a('0x9')](config[_0x416a('0x8')],{'host':_0x416a('0xa'),'port':0x18eb});var io=require(_0x416a('0xb'))(new Redis(config[_0x416a('0x8')]));function emit(_0x499534,_0x27ba9e,_0x4aed39){io['to'](_0x499534)[_0x416a('0xc')](_0x27ba9e,_0x4aed39);}function request(_0x246937){logger[_0x416a('0xd')](_0x416a('0xe'),JSON[_0x416a('0xf')](_0x246937));return rp(_0x246937);}function getCustomFields(_0x3d744e,_0x333e17){var _0x213bde={};if(_0x3d744e[_0x416a('0x10')]>0x0){_[_0x416a('0x11')](_0x3d744e,function(_0x5f16f4){if(_['includes']([_0x416a('0x12'),_0x416a('0x13')],_0x5f16f4[_0x416a('0x14')])&&_0x5f16f4[_0x416a('0x15')]){_0x213bde[_0x5f16f4[_0x416a('0x15')]]=_0x5f16f4[_0x416a('0x16')][_0x416a('0x17')]();}else if(_0x5f16f4[_0x416a('0x14')]==='variable'&&_0x5f16f4[_0x416a('0x18')]&&_0x5f16f4['idField']&&_0x333e17[_0x5f16f4[_0x416a('0x18')]]){_0x213bde[_0x5f16f4['idField']]=_0x333e17[_0x5f16f4[_0x416a('0x18')]][_0x416a('0x17')]();}else if(_0x5f16f4[_0x416a('0x14')]===_0x416a('0x19')&&_0x5f16f4['Variable']&&_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')]&&_0x5f16f4[_0x416a('0x15')]&&_0x333e17[_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')]['toLowerCase']()]){_0x213bde[_0x5f16f4[_0x416a('0x15')]]=_0x333e17[_0x5f16f4[_0x416a('0x1a')][_0x416a('0x1b')][_0x416a('0x1c')]()]['toString']();}});}return _0x213bde;}function getName(_0x1bf806){if(_0x1bf806[_0x416a('0x1d')]('\x20')>0x0){var _0x3de8c7=_0x1bf806['split'](/ (.+)/);if(_0x3de8c7[0x1]){return _0x3de8c7;}}return[_0x1bf806,_0x1bf806];}var accountsTokens={};function getAccessToken(_0x424be6){return new Promise(function(_0x30d772,_0x4dfb14){if(!_[_0x416a('0x1e')](accountsTokens[_0x424be6['id']])&&!_[_0x416a('0x1e')](accountsTokens[_0x424be6['id']][_0x416a('0x1f')])){if(moment()[_0x416a('0x20')](accountsTokens[_0x424be6['id']]['expires_in'])){_0x30d772(accountsTokens[_0x424be6['id']][_0x416a('0x1f')]);}}var _0x57ab32;switch(_0x424be6[_0x416a('0x21')]){case'US':_0x57ab32='https://accounts.zoho.com';break;case'AU':_0x57ab32=_0x416a('0x22');break;case'EU':_0x57ab32=_0x416a('0x23');break;case'IN':_0x57ab32=_0x416a('0x24');break;case'CN':_0x57ab32=_0x416a('0x25');break;default:_0x57ab32=_0x416a('0x23');break;}var _0x72828d={'method':_0x416a('0x26'),'uri':_0x57ab32+_0x416a('0x27'),'qs':{'refresh_token':_0x424be6[_0x416a('0x28')],'client_id':_0x424be6[_0x416a('0x29')],'client_secret':_0x424be6[_0x416a('0x2a')],'grant_type':_0x416a('0x2b')},'json':!![]};return rp(_0x72828d)[_0x416a('0x2c')](function(_0x40a074){accountsTokens[_0x424be6['id']]={'access_token':_0x40a074[_0x416a('0x1f')],'expires_in':moment()[_0x416a('0x2d')](_0x40a074[_0x416a('0x2e')],_0x416a('0x2f'))};_0x30d772(_0x40a074['access_token']);})[_0x416a('0x30')](function(_0x4e445d){logger['error'](_0x416a('0x31'),_0x4e445d['stack']);_0x4dfb14(_0x4e445d);});});}function getUser(_0x11c08b,_0x2e534a,_0x566f3c,_0x4a7d36){logger['info'](_0x416a('0x32'));return request({'method':_0x416a('0x33'),'uri':util[_0x416a('0x34')](_0x416a('0x35'),_0x2e534a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x416a('0x36')+_0x11c08b},'json':!![]})['then'](function(_0x2e4db9){if(_0x2e4db9[_0x416a('0x37')]){var _0x41cfc2=-0x1;if(_[_0x416a('0x38')](_0x2e4db9['users'])){if(!_[_0x416a('0x1e')](_0x4a7d36)){_0x41cfc2=_[_0x416a('0x39')](_0x2e4db9[_0x416a('0x37')],function(_0x216366){return _0x216366[_0x416a('0x3a')]===_0x4a7d36;});}if(_0x41cfc2>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x416a('0x3b')](_0x416a('0x3c'));_0x41cfc2=_[_0x416a('0x39')](_0x2e4db9[_0x416a('0x37')],function(_0x5ffe42){return _0x5ffe42['profile'][_0x416a('0x1b')]===_0x416a('0x3d');});}return _0x2e4db9['users'][_0x41cfc2];}else{if(_0x2e4db9[_0x416a('0x3e')][_0x416a('0x3f')][_0x416a('0x1b')]===_0x416a('0x3d')){logger[_0x416a('0x3b')](_0x416a('0x3c'));user=_0x2e4db9['user'];return user;}else{logger['error'](_0x416a('0x40'),JSON[_0x416a('0xf')](_0x2e4db9));throw new Error(_0x416a('0x41')+JSON['stringify'](_0x2e4db9));}}}else{logger[_0x416a('0x42')](_0x416a('0x40'),JSON[_0x416a('0xf')](_0x2e4db9));throw new Error(_0x416a('0x41')+JSON[_0x416a('0xf')](_0x2e4db9));}})['catch'](function(_0x4f1593){console[_0x416a('0x42')](_0x4f1593);});}function getZohoUser(_0x48922a,_0x26e52d){return new BPromise(function(_0x2722bd,_0x5f399a){request(_0x48922a)[_0x416a('0x2c')](function(_0x29b222){var _0x44623c=null;if(_0x29b222){_0x44623c=_0x29b222[_0x416a('0x43')][0x0];_0x44623c[_0x416a('0x44')]=_0x26e52d;}_0x2722bd(_0x44623c);})[_0x416a('0x30')](function(_0x38e380){_0x5f399a(_0x38e380);});});}function createEndUser(_0x29d084,_0x1a4552,_0x1c6b75,_0x3e8811,_0x21d949,_0x9205f5){var _0x1c6b75=getName(_0x1c6b75);return request({'method':_0x416a('0x26'),'uri':_0x416a('0x45')+_0x1a4552+_0x416a('0x46')+_['startCase'](_0x9205f5[_0x416a('0x47')])+'s','body':{'data':[{'Last_Name':_0x1c6b75[0x1],'First_Name':_0x1c6b75[0x0],'Phone':_0x3e8811,'Owner':{'name':!_['isNil'](_0x21d949[_0x416a('0x48')][_0x416a('0x1b')])?_0x21d949['role'][_0x416a('0x1b')]:!_[_0x416a('0x1e')](_0x21d949['first_name'])?_0x21d949['first_name']+'\x20'+_0x21d949[_0x416a('0x49')]:_0x21d949['last_name'],'id':_0x21d949['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x29d084},'json':!![]})['then'](function(_0x26c374){if(_0x26c374&&_0x26c374['data'][0x0][_0x416a('0x4a')]===_0x416a('0x4b')){var _0x175a51=_0x26c374[_0x416a('0x43')][0x0][_0x416a('0x4c')];_0x175a51['enduserType']=_[_0x416a('0x4d')](_0x9205f5[_0x416a('0x47')])+'s';return _0x175a51;}logger[_0x416a('0x42')](_0x416a('0x40'),JSON[_0x416a('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x416a('0x30')](function(_0x1a5340){console['log'](_0x416a('0x4e'),_0x1a5340);});}function getEndUser(_0x25c279,_0x37df6b,_0x1f3e0d,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad){var _0x5735b5={'method':_0x416a('0x33'),'uri':'','headers':{'Authorization':_0x416a('0x36')+_0x25c279},'json':!![]};switch(_0x171bad[_0x416a('0x4f')]){case'contact_lead':_0x5735b5[_0x416a('0x50')]='https://www.zohoapis.'+_0x37df6b+_0x416a('0x51')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Contacts')['then'](function(_0x168751){if(_0x168751)return _0x168751;_0x5735b5[_0x416a('0x50')]=_0x416a('0x45')+_0x37df6b+_0x416a('0x52')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Leads')[_0x416a('0x2c')](function(_0x3dadcd){if(_0x3dadcd)return _0x3dadcd;if(_0x171bad['moduleCreate']!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});});break;case _0x416a('0x53'):_0x5735b5[_0x416a('0x50')]='https://www.zohoapis.'+_0x37df6b+_0x416a('0x51')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Contacts')[_0x416a('0x2c')](function(_0x1c7899){if(_0x1c7899)return _0x1c7899;if(_0x171bad[_0x416a('0x47')]!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});break;case'lead':_0x5735b5[_0x416a('0x50')]=_0x416a('0x45')+_0x37df6b+_0x416a('0x52')+_0x49bd63+'))';return getZohoUser(_0x5735b5,'Leads')[_0x416a('0x2c')](function(_0x3032dc){if(_0x3032dc)return _0x3032dc;if(_0x171bad[_0x416a('0x47')]!='nothing'){return createEndUser(_0x25c279,_0x37df6b,_0x9cfd4c,_0x49bd63,_0x3b963e,_0x171bad);}else{return{};}});break;}}function getCall(_0x12e1bf,_0x5b44f4,_0x5ccf5f,_0x34d194,_0x4ea2b5,_0x32b260,_0x2843ff,_0x33628b){logger['info'](_0x416a('0x54'));var _0x14952d={};_0x14952d['Owner']={'name':!_[_0x416a('0x1e')](_0x34d194[_0x416a('0x48')][_0x416a('0x1b')])&&!_[_0x416a('0x1e')](_0x34d194[_0x416a('0x3f')][_0x416a('0x1b')])&&_0x34d194[_0x416a('0x3f')]['name']===_0x416a('0x55')?_0x34d194[_0x416a('0x48')][_0x416a('0x1b')]:!_['isNil'](_0x34d194[_0x416a('0x56')])?_0x34d194[_0x416a('0x56')]+'\x20'+_0x34d194['last_name']:_0x34d194[_0x416a('0x49')],'id':_0x34d194['id']};_0x14952d['Subject']=intUtil[_0x416a('0x57')](_0x32b260[_0x416a('0x58')],_0x2843ff,'\x20');_0x14952d[_0x416a('0x59')]=intUtil['getString'](_0x32b260[_0x416a('0x5a')],_0x2843ff,'\x0a');if(_0x4ea2b5[_0x416a('0x44')]===_0x416a('0x5b')){_0x14952d[_0x416a('0x5c')]={'name':!_[_0x416a('0x1e')](_0x4ea2b5[_0x416a('0x5d')])?_0x4ea2b5[_0x416a('0x5d')]:!_[_0x416a('0x1e')](_0x4ea2b5['First_Name'])?_0x4ea2b5[_0x416a('0x5e')]+'\x20'+_0x4ea2b5['Last_Name']:_0x4ea2b5[_0x416a('0x5f')],'id':_0x4ea2b5['id']};}if(_0x4ea2b5[_0x416a('0x44')]===_0x416a('0x60')){_0x14952d[_0x416a('0x61')]={'name':!_[_0x416a('0x1e')](_0x4ea2b5[_0x416a('0x5d')])?_0x4ea2b5[_0x416a('0x5d')]:!_[_0x416a('0x1e')](_0x4ea2b5['First_Name'])?_0x4ea2b5[_0x416a('0x5e')]+'\x20'+_0x4ea2b5[_0x416a('0x5f')]:_0x4ea2b5['Last_Name'],'id':_0x4ea2b5['id']};_0x14952d[_0x416a('0x62')]=_[_0x416a('0x4d')](_0x4ea2b5['enduserType']);}if(_0x2843ff[_0x416a('0x63')]){_0x14952d[_0x416a('0x64')]=moment[_0x416a('0x65')](parseInt(_0x2843ff['talktime'])*0x3e8)['format'](_0x416a('0x66'));}else if(_0x2843ff[_0x416a('0x67')]&&_0x2843ff[_0x416a('0x68')]){_0x14952d[_0x416a('0x64')]=moment['utc'](moment(_0x2843ff[_0x416a('0x68')],_0x416a('0x69'))['diff'](moment(_0x2843ff['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x416a('0x34')](_0x416a('0x66'));}switch(_0x2843ff[_0x416a('0x6a')]){case _0x416a('0x6b'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x6d');break;case'complete':case _0x416a('0x6e'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x6f');break;case _0x416a('0x70'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x71');break;case _0x416a('0x72'):_0x14952d[_0x416a('0x6c')]=_0x416a('0x73');break;case'timeout':_0x14952d[_0x416a('0x6c')]=_0x416a('0x74');default:}_0x14952d[_0x416a('0x75')]=(_0x33628b===_0x416a('0x76')?moment(_0x2843ff[_0x416a('0x77')])[_0x416a('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2843ff[_0x416a('0x78')])[_0x416a('0x34')](_0x416a('0x69')))||moment()[_0x416a('0x34')](_0x416a('0x69'));_0x14952d[_0x416a('0x79')]=_0x33628b||_0x416a('0x7a');_0x14952d=_['merge'](_0x14952d,getCustomFields(_0x32b260[_0x416a('0x7b')],_0x2843ff));return request({'method':'POST','uri':_0x416a('0x45')+_0x5b44f4+'/crm/v2/Calls','headers':{'Authorization':_0x416a('0x36')+_0x12e1bf},'body':{'data':[_0x14952d]},'json':!![]})[_0x416a('0x2c')](function(_0x427716){if(_0x427716&&_0x427716[_0x416a('0x43')][0x0][_0x416a('0x4a')]===_0x416a('0x4b')){logger[_0x416a('0x3b')]('Call\x20created!');return{'id':_0x427716[_0x416a('0x43')][0x0][_0x416a('0x4c')]['id']};}})[_0x416a('0x30')](function(_0x424fd1){logger['info'](_0x416a('0x7c'),_0x424fd1[_0x416a('0x7d')]);console['log'](_0x416a('0x7c'),_0x424fd1);});}exports['queue']=function(_0xf9079e,_0xae631,_0x480e5d,_0x17c106,_0x383c42,_0x346987){var _0x581c02,_0x495899,_0x59f2c4;_0x346987[_0x416a('0x7e')]=intUtil[_0x416a('0x7f')](_0x346987[_0x416a('0x7e')]);_0x346987['serverUrl']=intUtil[_0x416a('0x7f')](_0x346987[_0x416a('0x80')]);if(_0x383c42&&_0x383c42[_0x416a('0x81')]){logger['info'](_0x416a('0x82'),_0x416a('0x83'));_0xae631[_0x416a('0x84')]=_0x346987[_0x416a('0x80')]+'/api/voice/recordings/'+_0xae631['uniqueid']+_0x416a('0x85')+md5(_0xae631['uniqueid']);}else{_0xae631[_0x416a('0x84')]='';}var _0x15ebc=_0x346987[_0x416a('0x7e')]==='zoho.eu'?'eu':_0x416a('0x86');return getAccessToken(_0x346987)[_0x416a('0x2c')](function(_0x3e92bf){_0x59f2c4=_0x3e92bf;return getUser(_0x59f2c4,_0x15ebc,_0x346987,_0x17c106[_0x416a('0x3a')]);})[_0x416a('0x2c')](function(_0x199f44){_0x581c02=_0x199f44;logger['info'](_0x416a('0x87'),_0x581c02['id']);return getEndUser(_0x59f2c4,_0x15ebc,_0x346987,_0xae631[_0x416a('0x88')],_0xae631[_0x416a('0x89')],_0x581c02,_0x480e5d);})[_0x416a('0x2c')](function(_0x3676ef){_0x495899=_0x3676ef;return getCall(_0x59f2c4,_0x15ebc,_0x346987,_0x581c02,_0x495899,_0x480e5d,_0xae631,_0x416a('0x7a'));})[_0x416a('0x2c')](function(_0x493ccd){if(_0x493ccd){logger['info'](_0x416a('0x8a'),_0x493ccd['id']);logger[_0x416a('0x3b')](_0x416a('0x82'),_0x416a('0x8b'));emit(util[_0x416a('0x34')]('user:%s',_0x17c106[_0x416a('0x1b')]),_0x416a('0x8c'),{'uri':'https://crm.'+_0x346987['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x493ccd['id']});}})[_0x416a('0x30')](function(_0x4b70ae){logger[_0x416a('0x42')](_0x416a('0x82'),JSON['stringify'](_0x4b70ae));});};exports[_0x416a('0x76')]=function(_0x14c6fe,_0x2b7915,_0x41b71d,_0x567100,_0x3e1412,_0x39eeb3,_0xa657d2){var _0x4bac49,_0x3a685e,_0x1b5432;_0x39eeb3['host']=intUtil['stripTrailingSlash'](_0x39eeb3[_0x416a('0x7e')]);_0x39eeb3[_0x416a('0x80')]=intUtil['stripTrailingSlash'](_0x39eeb3[_0x416a('0x80')]);if(_0xa657d2&&_0xa657d2[_0x416a('0x8d')]&&_0xa657d2[_0x416a('0x8d')]!==_0x416a('0x8e')){logger[_0x416a('0x3b')](_0x416a('0x8f'),'Recording\x20is\x20enabled!');_0x2b7915[_0x416a('0x84')]=_0x39eeb3[_0x416a('0x80')]+_0x416a('0x90')+_0x2b7915[_0x416a('0x91')]+_0x416a('0x85')+md5(_0x2b7915[_0x416a('0x91')]);}var _0x1bac95=_0x39eeb3[_0x416a('0x7e')]===_0x416a('0x92')?'eu':_0x416a('0x86');return getAccessToken(_0x39eeb3)[_0x416a('0x2c')](function(_0x3b127b){_0x1b5432=_0x3b127b;return getUser(_0x1b5432,_0x1bac95,_0x39eeb3,_0x567100[_0x416a('0x3a')]);})['then'](function(_0x242389){_0x4bac49=_0x242389;logger[_0x416a('0x3b')](_0x416a('0x87'),_0x4bac49['id']);return getEndUser(_0x1b5432,_0x1bac95,_0x39eeb3,_0x2b7915[_0x416a('0x93')],_0x2b7915['destcalleridnum'],_0x4bac49,_0x41b71d);})[_0x416a('0x2c')](function(_0x4d85e9){_0x3a685e=_0x4d85e9;return getCall(_0x1b5432,_0x1bac95,_0x39eeb3,_0x4bac49,_0x3a685e,_0x41b71d,_0x2b7915,_0x416a('0x94'));})[_0x416a('0x2c')](function(_0x4acf3a){if(_0x4acf3a){logger['info']('The\x20Call\x20ID\x20is:',_0x4acf3a['id']);logger[_0x416a('0x3b')]('[OUTBOUND]',_0x416a('0x8b'));emit(util[_0x416a('0x34')](_0x416a('0x95'),_0x567100[_0x416a('0x1b')]),_0x416a('0x8c'),{'uri':'https://crm.'+_0x39eeb3[_0x416a('0x7e')]+_0x416a('0x96')+_0x4acf3a['id']});}})[_0x416a('0x30')](function(_0x430f49){logger[_0x416a('0x42')](_0x416a('0x8f'),JSON[_0x416a('0xf')](_0x430f49));});};exports[_0x416a('0x97')]=function(_0x231edf,_0x46646a,_0x16fefd,_0x32cf7d,_0x435f88,_0x5dc8ef){var _0x564aa9,_0x580c5b,_0x5682fa;_0x5dc8ef[_0x416a('0x7e')]=intUtil[_0x416a('0x7f')](_0x5dc8ef['host']);_0x5dc8ef['serverUrl']=intUtil[_0x416a('0x7f')](_0x5dc8ef['serverUrl']);if(_0x435f88&&_0x435f88[_0x416a('0x81')]){logger[_0x416a('0x3b')]('['+_0x46646a[_0x416a('0x6a')][_0x416a('0x98')]()+']',_0x416a('0x83'));_0x46646a[_0x416a('0x84')]=_0x5dc8ef[_0x416a('0x80')]+'/api/voice/recordings/'+_0x46646a[_0x416a('0x91')]+_0x416a('0x85')+md5(_0x46646a['uniqueid']);}else{_0x46646a[_0x416a('0x84')]='';}var _0x2ee9d2=_0x5dc8ef[_0x416a('0x7e')]==='zoho.eu'?'eu':_0x416a('0x86');return getAccessToken(_0x5dc8ef)[_0x416a('0x2c')](function(_0x529517){_0x5682fa=_0x529517;return getUser(_0x5682fa,_0x2ee9d2,_0x5dc8ef);})[_0x416a('0x2c')](function(_0x2e8685){_0x564aa9=_0x2e8685;logger[_0x416a('0x3b')](_0x416a('0x87'),_0x564aa9['id']);return getEndUser(_0x5682fa,_0x2ee9d2,_0x5dc8ef,_0x46646a[_0x416a('0x88')],_0x46646a['calleridnum'],_0x564aa9,_0x16fefd);})[_0x416a('0x2c')](function(_0x2b37ae){_0x580c5b=_0x2b37ae;return getCall(_0x5682fa,_0x2ee9d2,_0x5dc8ef,_0x564aa9,_0x580c5b,_0x16fefd,_0x46646a,_0x416a('0x7a'));})[_0x416a('0x2c')](function(_0x111c47){if(_0x111c47){logger[_0x416a('0x3b')](_0x416a('0x8a'),_0x111c47['id']);}})[_0x416a('0x30')](function(_0x35d980){logger['error']('['+_0x46646a[_0x416a('0x6a')][_0x416a('0x98')]()+']',JSON[_0x416a('0xf')](_0x35d980));});}; \ No newline at end of file +var _0x2cb4=['none','[OUTBOUND]','Recording\x20is\x20enabled!','zoho.eu','destcalleridnum','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','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','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','info','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','Subject','Description','getString','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','Rejected','Abandoned','timeout','Timeout','outbound','starttime','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.'];(function(_0x16a9af,_0x5cf0f6){var _0x587b8a=function(_0x3d7c6d){while(--_0x3d7c6d){_0x16a9af['push'](_0x16a9af['shift']());}};_0x587b8a(++_0x5cf0f6);}(_0x2cb4,0x13e));var _0x42cb=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x2cb4[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0x42cb('0x0'));var rp=require(_0x42cb('0x1'));var md5=require(_0x42cb('0x2'));var util=require(_0x42cb('0x3'));var intUtil=require(_0x42cb('0x4'));var moment=require(_0x42cb('0x5'));var Redis=require(_0x42cb('0x6'));var BPromise=require('bluebird');var config=require(_0x42cb('0x7'));var logger=require(_0x42cb('0x8'))(_0x42cb('0x9'));config[_0x42cb('0xa')]=_[_0x42cb('0xb')](config['redis'],{'host':_0x42cb('0xc'),'port':0x18eb});var io=require(_0x42cb('0xd'))(new Redis(config[_0x42cb('0xa')]));function emit(_0x2f0871,_0x54bc00,_0x2f7f59){io['to'](_0x2f0871)[_0x42cb('0xe')](_0x54bc00,_0x2f7f59);}function request(_0x33c7ca){logger[_0x42cb('0xf')](_0x42cb('0x10'),JSON[_0x42cb('0x11')](_0x33c7ca));return rp(_0x33c7ca);}function getCustomFields(_0x415b6f,_0x29a911){var _0x3c53bd={};if(_0x415b6f['length']>0x0){_['forEach'](_0x415b6f,function(_0x1d6c76){if(_[_0x42cb('0x12')]([_0x42cb('0x13'),_0x42cb('0x14')],_0x1d6c76[_0x42cb('0x15')])&&_0x1d6c76[_0x42cb('0x16')]){_0x3c53bd[_0x1d6c76[_0x42cb('0x16')]]=_0x1d6c76[_0x42cb('0x17')][_0x42cb('0x18')]();}else if(_0x1d6c76['type']===_0x42cb('0x19')&&_0x1d6c76[_0x42cb('0x1a')]&&_0x1d6c76[_0x42cb('0x16')]&&_0x29a911[_0x1d6c76[_0x42cb('0x1a')]]){_0x3c53bd[_0x1d6c76[_0x42cb('0x16')]]=_0x29a911[_0x1d6c76['variableName']][_0x42cb('0x18')]();}else if(_0x1d6c76[_0x42cb('0x15')]===_0x42cb('0x1b')&&_0x1d6c76[_0x42cb('0x1c')]&&_0x1d6c76[_0x42cb('0x1c')][_0x42cb('0x1d')]&&_0x1d6c76['idField']&&_0x29a911[_0x1d6c76[_0x42cb('0x1c')][_0x42cb('0x1d')][_0x42cb('0x1e')]()]){_0x3c53bd[_0x1d6c76['idField']]=_0x29a911[_0x1d6c76['Variable'][_0x42cb('0x1d')][_0x42cb('0x1e')]()][_0x42cb('0x18')]();}});}return _0x3c53bd;}function getName(_0x3b3ba5){if(_0x3b3ba5[_0x42cb('0x1f')]('\x20')>0x0){var _0x498253=_0x3b3ba5[_0x42cb('0x20')](/ (.+)/);if(_0x498253[0x1]){return _0x498253;}}return[_0x3b3ba5,_0x3b3ba5];}var accountsTokens={};function getAccessToken(_0x4919a3){return new Promise(function(_0x46b1c9,_0x12d2c0){if(!_[_0x42cb('0x21')](accountsTokens[_0x4919a3['id']])&&!_[_0x42cb('0x21')](accountsTokens[_0x4919a3['id']][_0x42cb('0x22')])){if(moment()[_0x42cb('0x23')](accountsTokens[_0x4919a3['id']][_0x42cb('0x24')])){_0x46b1c9(accountsTokens[_0x4919a3['id']][_0x42cb('0x22')]);}}var _0x1d1b8c;switch(_0x4919a3[_0x42cb('0x25')]){case'US':_0x1d1b8c=_0x42cb('0x26');break;case'AU':_0x1d1b8c=_0x42cb('0x27');break;case'EU':_0x1d1b8c=_0x42cb('0x28');break;case'IN':_0x1d1b8c='https://accounts.zoho.in';break;case'CN':_0x1d1b8c=_0x42cb('0x29');break;default:_0x1d1b8c='https://accounts.zoho.eu';break;}var _0x2294cd={'method':_0x42cb('0x2a'),'uri':_0x1d1b8c+_0x42cb('0x2b'),'qs':{'refresh_token':_0x4919a3[_0x42cb('0x2c')],'client_id':_0x4919a3[_0x42cb('0x2d')],'client_secret':_0x4919a3[_0x42cb('0x2e')],'grant_type':_0x42cb('0x2f')},'json':!![]};return rp(_0x2294cd)[_0x42cb('0x30')](function(_0x2053fc){accountsTokens[_0x4919a3['id']]={'access_token':_0x2053fc[_0x42cb('0x22')],'expires_in':moment()[_0x42cb('0x31')](_0x2053fc[_0x42cb('0x24')],'seconds')};_0x46b1c9(_0x2053fc[_0x42cb('0x22')]);})[_0x42cb('0x32')](function(_0x377fd6){logger[_0x42cb('0x33')](_0x42cb('0x34'),_0x377fd6[_0x42cb('0x35')]);_0x12d2c0(_0x377fd6);});});}function getUser(_0x3386c6,_0x55b28b,_0x2dd0ca,_0x521c52){logger['info'](_0x42cb('0x36'));return request({'method':'GET','uri':util[_0x42cb('0x37')](_0x42cb('0x38'),_0x55b28b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x42cb('0x39')+_0x3386c6},'json':!![]})['then'](function(_0x5d95e2){if(_0x5d95e2['users']){var _0x2b9af0=-0x1;if(_[_0x42cb('0x3a')](_0x5d95e2['users'])){if(!_[_0x42cb('0x21')](_0x521c52)){_0x2b9af0=_[_0x42cb('0x3b')](_0x5d95e2[_0x42cb('0x3c')],function(_0x132cf9){return _0x132cf9[_0x42cb('0x3d')]===_0x521c52;});}if(_0x2b9af0>=0x0){logger[_0x42cb('0x3e')]('Agent\x20found!');}else{logger['info']('Using\x20the\x20admin\x20account!');_0x2b9af0=_[_0x42cb('0x3b')](_0x5d95e2['users'],function(_0x2ebb4b){return _0x2ebb4b[_0x42cb('0x3f')]['name']===_0x42cb('0x40');});}return _0x5d95e2[_0x42cb('0x3c')][_0x2b9af0];}else{if(_0x5d95e2['user'][_0x42cb('0x3f')][_0x42cb('0x1d')]===_0x42cb('0x40')){logger[_0x42cb('0x3e')]('Using\x20the\x20admin\x20account!');user=_0x5d95e2[_0x42cb('0x41')];return user;}else{logger['error'](_0x42cb('0x42'),JSON[_0x42cb('0x11')](_0x5d95e2));throw new Error(_0x42cb('0x43')+JSON[_0x42cb('0x11')](_0x5d95e2));}}}else{logger[_0x42cb('0x33')](_0x42cb('0x42'),JSON[_0x42cb('0x11')](_0x5d95e2));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x42cb('0x11')](_0x5d95e2));}})[_0x42cb('0x32')](function(_0x325888){console[_0x42cb('0x33')](_0x325888);});}function getZohoUser(_0x414ecf,_0x265f33){return new BPromise(function(_0x26cad2,_0x7f4ca3){request(_0x414ecf)[_0x42cb('0x30')](function(_0x5e6cc1){var _0x498eeb=null;if(_0x5e6cc1){_0x498eeb=_0x5e6cc1[_0x42cb('0x44')][0x0];_0x498eeb[_0x42cb('0x45')]=_0x265f33;}_0x26cad2(_0x498eeb);})['catch'](function(_0x50114e){_0x7f4ca3(_0x50114e);});});}function createEndUser(_0x3bf9c6,_0x303ad6,_0x118e15,_0x5097a0,_0x277657,_0xd0a54){var _0x118e15=getName(_0x118e15);return request({'method':_0x42cb('0x2a'),'uri':_0x42cb('0x46')+_0x303ad6+'/crm/v2/'+_[_0x42cb('0x47')](_0xd0a54[_0x42cb('0x48')])+'s','body':{'data':[{'Last_Name':_0x118e15[0x1],'First_Name':_0x118e15[0x0],'Phone':_0x5097a0,'Owner':{'name':!_[_0x42cb('0x21')](_0x277657[_0x42cb('0x49')][_0x42cb('0x1d')])?_0x277657[_0x42cb('0x49')][_0x42cb('0x1d')]:!_[_0x42cb('0x21')](_0x277657[_0x42cb('0x4a')])?_0x277657[_0x42cb('0x4a')]+'\x20'+_0x277657[_0x42cb('0x4b')]:_0x277657[_0x42cb('0x4b')],'id':_0x277657['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3bf9c6},'json':!![]})[_0x42cb('0x30')](function(_0x4420f9){if(_0x4420f9&&_0x4420f9[_0x42cb('0x44')][0x0][_0x42cb('0x4c')]==='SUCCESS'){var _0x332cfe=_0x4420f9['data'][0x0][_0x42cb('0x4d')];_0x332cfe[_0x42cb('0x45')]=_['startCase'](_0xd0a54[_0x42cb('0x48')])+'s';return _0x332cfe;}logger[_0x42cb('0x33')]('The\x20failing\x20result\x20is',JSON[_0x42cb('0x11')](data));throw new Error(_0x42cb('0x4e')+JSON[_0x42cb('0x11')](data));})[_0x42cb('0x32')](function(_0x42b008){console[_0x42cb('0x4f')](_0x42cb('0x50'),_0x42b008);});}function getEndUser(_0x116844,_0xdf6a01,_0x1f7dd7,_0x48315f,_0x2ea7c2,_0x372f98,_0x42eb42){var _0x6e92ce={'method':_0x42cb('0x51'),'uri':'','headers':{'Authorization':_0x42cb('0x39')+_0x116844},'json':!![]};switch(_0x42eb42[_0x42cb('0x52')]){case _0x42cb('0x53'):_0x6e92ce[_0x42cb('0x54')]=_0x42cb('0x46')+_0xdf6a01+_0x42cb('0x55')+_0x2ea7c2+'))';return getZohoUser(_0x6e92ce,_0x42cb('0x56'))['then'](function(_0xe1aee0){if(_0xe1aee0)return _0xe1aee0;_0x6e92ce[_0x42cb('0x54')]='https://www.zohoapis.'+_0xdf6a01+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2ea7c2+'))';return getZohoUser(_0x6e92ce,_0x42cb('0x57'))['then'](function(_0x2c8326){if(_0x2c8326)return _0x2c8326;if(_0x42eb42[_0x42cb('0x48')]!=_0x42cb('0x58')){return createEndUser(_0x116844,_0xdf6a01,_0x48315f,_0x2ea7c2,_0x372f98,_0x42eb42);}else{return{};}});});break;case _0x42cb('0x59'):_0x6e92ce[_0x42cb('0x54')]=_0x42cb('0x46')+_0xdf6a01+_0x42cb('0x55')+_0x2ea7c2+'))';return getZohoUser(_0x6e92ce,'Contacts')[_0x42cb('0x30')](function(_0x36f613){if(_0x36f613)return _0x36f613;if(_0x42eb42['moduleCreate']!=_0x42cb('0x58')){return createEndUser(_0x116844,_0xdf6a01,_0x48315f,_0x2ea7c2,_0x372f98,_0x42eb42);}else{return{};}});break;case'lead':_0x6e92ce[_0x42cb('0x54')]=_0x42cb('0x46')+_0xdf6a01+_0x42cb('0x5a')+_0x2ea7c2+'))';return getZohoUser(_0x6e92ce,_0x42cb('0x57'))[_0x42cb('0x30')](function(_0x1c243b){if(_0x1c243b)return _0x1c243b;if(_0x42eb42[_0x42cb('0x48')]!=_0x42cb('0x58')){return createEndUser(_0x116844,_0xdf6a01,_0x48315f,_0x2ea7c2,_0x372f98,_0x42eb42);}else{return{};}});break;}}function getCall(_0x2e9fee,_0x3edb86,_0x241903,_0x29d7ae,_0x32e83a,_0x4662e3,_0x4c974a,_0x2b59ab){logger[_0x42cb('0x3e')]('Creating\x20new\x20call...');var _0x4fa8f5={};_0x4fa8f5[_0x42cb('0x5b')]={'name':!_['isNil'](_0x29d7ae[_0x42cb('0x49')][_0x42cb('0x1d')])&&!_[_0x42cb('0x21')](_0x29d7ae[_0x42cb('0x3f')][_0x42cb('0x1d')])&&_0x29d7ae[_0x42cb('0x3f')][_0x42cb('0x1d')]==='administrator'?_0x29d7ae[_0x42cb('0x49')]['name']:!_[_0x42cb('0x21')](_0x29d7ae[_0x42cb('0x4a')])?_0x29d7ae[_0x42cb('0x4a')]+'\x20'+_0x29d7ae[_0x42cb('0x4b')]:_0x29d7ae['last_name'],'id':_0x29d7ae['id']};_0x4fa8f5[_0x42cb('0x5c')]=intUtil['getString'](_0x4662e3['Subjects'],_0x4c974a,'\x20');_0x4fa8f5[_0x42cb('0x5d')]=intUtil[_0x42cb('0x5e')](_0x4662e3[_0x42cb('0x5f')],_0x4c974a,'\x0a');if(_0x32e83a[_0x42cb('0x45')]===_0x42cb('0x56')){_0x4fa8f5['Who_Id']={'name':!_[_0x42cb('0x21')](_0x32e83a['Full_Name'])?_0x32e83a[_0x42cb('0x60')]:!_['isNil'](_0x32e83a[_0x42cb('0x61')])?_0x32e83a[_0x42cb('0x61')]+'\x20'+_0x32e83a[_0x42cb('0x62')]:_0x32e83a['Last_Name'],'id':_0x32e83a['id']};}if(_0x32e83a[_0x42cb('0x45')]===_0x42cb('0x57')){_0x4fa8f5[_0x42cb('0x63')]={'name':!_[_0x42cb('0x21')](_0x32e83a['Full_Name'])?_0x32e83a['Full_Name']:!_[_0x42cb('0x21')](_0x32e83a[_0x42cb('0x61')])?_0x32e83a[_0x42cb('0x61')]+'\x20'+_0x32e83a[_0x42cb('0x62')]:_0x32e83a[_0x42cb('0x62')],'id':_0x32e83a['id']};_0x4fa8f5[_0x42cb('0x64')]=_['startCase'](_0x32e83a[_0x42cb('0x45')]);}if(_0x4c974a[_0x42cb('0x65')]){_0x4fa8f5[_0x42cb('0x66')]=moment[_0x42cb('0x67')](parseInt(_0x4c974a[_0x42cb('0x65')])*0x3e8)[_0x42cb('0x37')]('mm:ss');}else if(_0x4c974a[_0x42cb('0x68')]&&_0x4c974a[_0x42cb('0x69')]){_0x4fa8f5[_0x42cb('0x66')]=moment[_0x42cb('0x67')](moment(_0x4c974a['endtime'],_0x42cb('0x6a'))[_0x42cb('0x6b')](moment(_0x4c974a['starttime'],_0x42cb('0x6a'))))[_0x42cb('0x37')](_0x42cb('0x6c'));}switch(_0x4c974a[_0x42cb('0x6d')]){case _0x42cb('0x6e'):_0x4fa8f5[_0x42cb('0x6f')]=_0x42cb('0x70');break;case'complete':case _0x42cb('0x71'):_0x4fa8f5[_0x42cb('0x6f')]=_0x42cb('0x72');break;case'rejected':_0x4fa8f5[_0x42cb('0x6f')]=_0x42cb('0x73');break;case'abandoned':_0x4fa8f5[_0x42cb('0x6f')]=_0x42cb('0x74');break;case _0x42cb('0x75'):_0x4fa8f5[_0x42cb('0x6f')]=_0x42cb('0x76');default:}_0x4fa8f5['Call_Start_Time']=(_0x2b59ab===_0x42cb('0x77')?moment(_0x4c974a[_0x42cb('0x78')])[_0x42cb('0x37')](_0x42cb('0x6a')):moment(_0x4c974a['agentcalledAt'])[_0x42cb('0x37')](_0x42cb('0x6a')))||moment()[_0x42cb('0x37')](_0x42cb('0x6a'));_0x4fa8f5[_0x42cb('0x79')]=_0x2b59ab||_0x42cb('0x7a');_0x4fa8f5=_[_0x42cb('0x7b')](_0x4fa8f5,getCustomFields(_0x4662e3[_0x42cb('0x7c')],_0x4c974a));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x3edb86+'/crm/v2/Calls','headers':{'Authorization':_0x42cb('0x39')+_0x2e9fee},'body':{'data':[_0x4fa8f5]},'json':!![]})[_0x42cb('0x30')](function(_0x4889cb){if(_0x4889cb&&_0x4889cb['data'][0x0][_0x42cb('0x4c')]==='SUCCESS'){logger['info'](_0x42cb('0x7d'));return{'id':_0x4889cb[_0x42cb('0x44')][0x0][_0x42cb('0x4d')]['id']};}})['catch'](function(_0x2774d2){logger[_0x42cb('0x3e')](_0x42cb('0x7e'),_0x2774d2['stack']);console[_0x42cb('0x4f')](_0x42cb('0x7e'),_0x2774d2);});}exports[_0x42cb('0x7f')]=function(_0x2f4792,_0x2bd0bc,_0x121a73,_0x2afb3c,_0x39bdee,_0x30da5c){var _0x40955a,_0x11b061,_0x29d54c;_0x30da5c['host']=intUtil[_0x42cb('0x80')](_0x30da5c[_0x42cb('0x81')]);_0x30da5c[_0x42cb('0x82')]=intUtil[_0x42cb('0x80')](_0x30da5c[_0x42cb('0x82')]);if(_0x39bdee&&_0x39bdee[_0x42cb('0x83')]){logger[_0x42cb('0x3e')](_0x42cb('0x84'),'Recording\x20is\x20enabled!');_0x2bd0bc[_0x42cb('0x85')]=_0x30da5c[_0x42cb('0x82')]+_0x42cb('0x86')+_0x2bd0bc[_0x42cb('0x87')]+_0x42cb('0x88')+md5(_0x2bd0bc[_0x42cb('0x87')]);}else{_0x2bd0bc[_0x42cb('0x85')]='';}var _0x431898=_0x30da5c[_0x42cb('0x81')]==='zoho.eu'?'eu':_0x42cb('0x89');return getAccessToken(_0x30da5c)[_0x42cb('0x30')](function(_0x3bca67){_0x29d54c=_0x3bca67;return getUser(_0x29d54c,_0x431898,_0x30da5c,_0x2afb3c[_0x42cb('0x3d')]);})[_0x42cb('0x30')](function(_0x5b77de){_0x40955a=_0x5b77de;logger[_0x42cb('0x3e')](_0x42cb('0x8a'),_0x40955a['id']);return getEndUser(_0x29d54c,_0x431898,_0x30da5c,_0x2bd0bc[_0x42cb('0x8b')],_0x2bd0bc[_0x42cb('0x8c')],_0x40955a,_0x121a73);})[_0x42cb('0x30')](function(_0x400c98){_0x11b061=_0x400c98;return getCall(_0x29d54c,_0x431898,_0x30da5c,_0x40955a,_0x11b061,_0x121a73,_0x2bd0bc,_0x42cb('0x7a'));})[_0x42cb('0x30')](function(_0x37624c){if(_0x37624c){logger[_0x42cb('0x3e')]('The\x20Call\x20ID\x20is:',_0x37624c['id']);logger[_0x42cb('0x3e')]('[QUEUE]',_0x42cb('0x8d'));emit(util[_0x42cb('0x37')]('user:%s',_0x2afb3c[_0x42cb('0x1d')]),_0x42cb('0x8e'),{'uri':_0x42cb('0x8f')+_0x30da5c[_0x42cb('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x37624c['id']});}})[_0x42cb('0x32')](function(_0x45feec){logger[_0x42cb('0x33')](_0x42cb('0x84'),JSON['stringify'](_0x45feec));});};exports[_0x42cb('0x77')]=function(_0xe85bf0,_0x47d1f5,_0x1ed275,_0x34c6e9,_0x2a9875,_0x18c6ad,_0x23422c){var _0x5a6be5,_0x4d94aa,_0x54dceb;_0x18c6ad[_0x42cb('0x81')]=intUtil[_0x42cb('0x80')](_0x18c6ad[_0x42cb('0x81')]);_0x18c6ad[_0x42cb('0x82')]=intUtil[_0x42cb('0x80')](_0x18c6ad[_0x42cb('0x82')]);if(_0x23422c&&_0x23422c['recordingFormat']&&_0x23422c['recordingFormat']!==_0x42cb('0x90')){logger['info'](_0x42cb('0x91'),_0x42cb('0x92'));_0x47d1f5[_0x42cb('0x85')]=_0x18c6ad['serverUrl']+_0x42cb('0x86')+_0x47d1f5[_0x42cb('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x47d1f5[_0x42cb('0x87')]);}var _0x33ea65=_0x18c6ad[_0x42cb('0x81')]===_0x42cb('0x93')?'eu':_0x42cb('0x89');return getAccessToken(_0x18c6ad)[_0x42cb('0x30')](function(_0x173153){_0x54dceb=_0x173153;return getUser(_0x54dceb,_0x33ea65,_0x18c6ad,_0x34c6e9[_0x42cb('0x3d')]);})[_0x42cb('0x30')](function(_0x1bedae){_0x5a6be5=_0x1bedae;logger[_0x42cb('0x3e')](_0x42cb('0x8a'),_0x5a6be5['id']);return getEndUser(_0x54dceb,_0x33ea65,_0x18c6ad,_0x47d1f5['destcalleridname'],_0x47d1f5[_0x42cb('0x94')],_0x5a6be5,_0x1ed275);})[_0x42cb('0x30')](function(_0x2321e5){_0x4d94aa=_0x2321e5;return getCall(_0x54dceb,_0x33ea65,_0x18c6ad,_0x5a6be5,_0x4d94aa,_0x1ed275,_0x47d1f5,_0x42cb('0x95'));})[_0x42cb('0x30')](function(_0x51ee4c){if(_0x51ee4c){logger[_0x42cb('0x3e')]('The\x20Call\x20ID\x20is:',_0x51ee4c['id']);logger[_0x42cb('0x3e')](_0x42cb('0x91'),_0x42cb('0x8d'));emit(util[_0x42cb('0x37')](_0x42cb('0x96'),_0x34c6e9['name']),_0x42cb('0x8e'),{'uri':'https://crm.'+_0x18c6ad[_0x42cb('0x81')]+_0x42cb('0x97')+_0x51ee4c['id']});}})['catch'](function(_0x4cb449){logger['error'](_0x42cb('0x91'),JSON['stringify'](_0x4cb449));});};exports['unmanaged']=function(_0x78becd,_0x316c92,_0x2acb48,_0x5f1625,_0x283df3,_0x339228){var _0x467101,_0x3d2a55,_0x190b7f;_0x339228[_0x42cb('0x81')]=intUtil[_0x42cb('0x80')](_0x339228['host']);_0x339228[_0x42cb('0x82')]=intUtil[_0x42cb('0x80')](_0x339228[_0x42cb('0x82')]);if(_0x283df3&&_0x283df3[_0x42cb('0x83')]){logger[_0x42cb('0x3e')]('['+_0x316c92[_0x42cb('0x6d')][_0x42cb('0x98')]()+']',_0x42cb('0x92'));_0x316c92['recordingURL']=_0x339228[_0x42cb('0x82')]+_0x42cb('0x86')+_0x316c92[_0x42cb('0x87')]+_0x42cb('0x88')+md5(_0x316c92[_0x42cb('0x87')]);}else{_0x316c92['recordingURL']='';}var _0x53cf13=_0x339228['host']==='zoho.eu'?'eu':_0x42cb('0x89');return getAccessToken(_0x339228)[_0x42cb('0x30')](function(_0x1ab202){_0x190b7f=_0x1ab202;return getUser(_0x190b7f,_0x53cf13,_0x339228);})['then'](function(_0x54bff9){_0x467101=_0x54bff9;logger['info'](_0x42cb('0x8a'),_0x467101['id']);return getEndUser(_0x190b7f,_0x53cf13,_0x339228,_0x316c92['calleridname'],_0x316c92[_0x42cb('0x8c')],_0x467101,_0x2acb48);})[_0x42cb('0x30')](function(_0x5069eb){_0x3d2a55=_0x5069eb;return getCall(_0x190b7f,_0x53cf13,_0x339228,_0x467101,_0x3d2a55,_0x2acb48,_0x316c92,'Inbound');})[_0x42cb('0x30')](function(_0x3ac353){if(_0x3ac353){logger[_0x42cb('0x3e')](_0x42cb('0x99'),_0x3ac353['id']);}})['catch'](function(_0x25c32c){logger[_0x42cb('0x33')]('['+_0x316c92[_0x42cb('0x6d')]['toUpperCase']()+']',JSON['stringify'](_0x25c32c));});}; \ 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 1acc966..65ebd0c 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 _0x08db=['data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','mustache','trigger','data2','Script'];(function(_0x419e4a,_0x22f72e){var _0x325aa7=function(_0x371c4d){while(--_0x371c4d){_0x419e4a['push'](_0x419e4a['shift']());}};_0x325aa7(++_0x22f72e);}(_0x08db,0xd3));var _0xb08d=function(_0x4a679b,_0x17f960){_0x4a679b=_0x4a679b-0x0;var _0x454722=_0x08db[_0x4a679b];return _0x454722;};'use strict';var util=require(_0xb08d('0x0'));var sh=require('shelljs');var Mustache=require(_0xb08d('0x1'));var logger=require('../../../../config/logger')(_0xb08d('0x2'));exports['exec']=function(_0x3d53fb,_0x30bb95){var _0xdf8520=_0x3d53fb[_0xb08d('0x3')]?_0x3d53fb[_0xb08d('0x3')]:_0xb08d('0x4');var _0x518957=_0x3d53fb[_0xb08d('0x5')]?Mustache[_0xb08d('0x6')](_0x3d53fb['data3'],_0x30bb95):_0x30bb95;sh[_0xb08d('0x7')](_0x518957,function(_0x44bebd,_0x3b7ba2,_0x2bb918){if(_0x44bebd!==0x0){logger[_0xb08d('0x8')](util[_0xb08d('0x9')](_0xb08d('0xa'),_0xdf8520,_0x518957,_0x44bebd,_0x2bb918));}else{logger[_0xb08d('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xdf8520,_0x518957,_0x3b7ba2));}});}; \ No newline at end of file +var _0xc0ec=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x208b73,_0x103b19){var _0x1fa5b9=function(_0x20bb72){while(--_0x20bb72){_0x208b73['push'](_0x208b73['shift']());}};_0x1fa5b9(++_0x103b19);}(_0xc0ec,0x1a6));var _0xcc0e=function(_0x470dab,_0x39299e){_0x470dab=_0x470dab-0x0;var _0x192111=_0xc0ec[_0x470dab];return _0x192111;};'use strict';var util=require(_0xcc0e('0x0'));var sh=require(_0xcc0e('0x1'));var Mustache=require(_0xcc0e('0x2'));var logger=require(_0xcc0e('0x3'))(_0xcc0e('0x4'));exports[_0xcc0e('0x5')]=function(_0x4b7a28,_0x3ac1ec){var _0x2a3b45=_0x4b7a28[_0xcc0e('0x6')]?_0x4b7a28['data2']:'Script';var _0x94a959=_0x4b7a28['data3']?Mustache[_0xcc0e('0x7')](_0x4b7a28[_0xcc0e('0x8')],_0x3ac1ec):_0x3ac1ec;sh[_0xcc0e('0x5')](_0x94a959,function(_0x2d51bc,_0x1b342b,_0x55aac8){if(_0x2d51bc!==0x0){logger[_0xcc0e('0x9')](util[_0xcc0e('0xa')](_0xcc0e('0xb'),_0x2a3b45,_0x94a959,_0x2d51bc,_0x55aac8));}else{logger[_0xcc0e('0xc')](util[_0xcc0e('0xa')](_0xcc0e('0xd'),_0x2a3b45,_0x94a959,_0x1b342b));}});}; \ 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 e449675..16f302b 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 _0x653f=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','trigger','data1','render','data2','data5','number','headers','data6','error','toUpperCase','DELETE','POST','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x653f,0x1e0));var _0xf653=function(_0x42a075,_0x5355ee){_0x42a075=_0x42a075-0x0;var _0x43d01f=_0x653f[_0x42a075];return _0x43d01f;};'use strict';var rp=require(_0xf653('0x0'));var util=require(_0xf653('0x1'));var _=require(_0xf653('0x2'));var Mustache=require(_0xf653('0x3'));var logger=require('../../../../config/logger')(_0xf653('0x4'));exports['exec']=function(_0x2c53be,_0x5ca0bc){var _0x2dd334,_0x1896de;var _0x56fe33={'method':_0x2c53be[_0xf653('0x5')]['toUpperCase'](),'uri':Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0x7')],_0x5ca0bc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2c53be[_0xf653('0x8')])===_0xf653('0x9')&&parseInt(_0x2c53be[_0xf653('0x8')])>=0x1&&parseInt(_0x2c53be['data5'])<=0xa?parseInt(_0x2c53be[_0xf653('0x8')])*0x3e8:0x5*0x3e8};try{_0x56fe33[_0xf653('0xa')]=_0x2c53be[_0xf653('0xb')]?JSON['parse'](Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0xb')],_0x5ca0bc)):{};}catch(_0x28e4e2){logger[_0xf653('0xc')](_0x28e4e2['stack']);}switch(_0x2c53be[_0xf653('0x5')][_0xf653('0xd')]()){case'GET':case _0xf653('0xe'):_0x2dd334=null;_0x56fe33['qs']=_0x5ca0bc;break;case _0xf653('0xf'):case _0xf653('0x10'):if(_0x2c53be[_0xf653('0x11')]){try{_0x2dd334=JSON[_0xf653('0x12')](Mustache[_0xf653('0x6')](_0x2c53be[_0xf653('0x11')],_0x5ca0bc));_0x56fe33[_0xf653('0x13')]=_0x2dd334;}catch(_0x738de6){logger['error'](_0x738de6[_0xf653('0x14')]);logger['error'](_0xf653('0x15'));}}else{_0x2dd334=_0x5ca0bc;_0x56fe33[_0xf653('0x13')]=_0x2dd334;}break;}logger[_0xf653('0x16')](util[_0xf653('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],JSON[_0xf653('0x18')](_0x56fe33)));rp(_0x56fe33)[_0xf653('0x19')](function(_0x261e84){_0x2dd334=!_['isNil'](_0x2dd334)?_0xf653('0x1a')+_0x2dd334:'';_0x1896de=typeof _0x261e84[_0xf653('0x13')]===_0xf653('0x1b')?JSON[_0xf653('0x18')](_0x261e84[_0xf653('0x13')]):_0x261e84[_0xf653('0x13')];logger[_0xf653('0x16')](util[_0xf653('0x17')](_0xf653('0x1c'),_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],_0x261e84[_0xf653('0x1d')],_0x1896de));})[_0xf653('0x1e')](function(_0x459f2e){logger[_0xf653('0xc')](util[_0xf653('0x17')](_0xf653('0x1f'),_0x2c53be[_0xf653('0x5')],_0x2c53be[_0xf653('0x7')],_0x459f2e['statusCode'],_0x459f2e[_0xf653('0x20')],_0x459f2e[_0xf653('0x21')]));});}; \ No newline at end of file +var _0x86d4=['PUT','data7','render','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','catch','statusCode','name','message','util','lodash','mustache','trigger','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','stack','GET','POST'];(function(_0x397640,_0x5d5fef){var _0x22a385=function(_0x4b6d37){while(--_0x4b6d37){_0x397640['push'](_0x397640['shift']());}};_0x22a385(++_0x5d5fef);}(_0x86d4,0x144));var _0x486d=function(_0x5d693d,_0x2253b5){_0x5d693d=_0x5d693d-0x0;var _0x43dce1=_0x86d4[_0x5d693d];return _0x43dce1;};'use strict';var rp=require('request-promise');var util=require(_0x486d('0x0'));var _=require(_0x486d('0x1'));var Mustache=require(_0x486d('0x2'));var logger=require('../../../../config/logger')(_0x486d('0x3'));exports[_0x486d('0x4')]=function(_0xa9009b,_0x4ec7af){var _0x5e472e,_0x4530b0;var _0x5a6c6d={'method':_0xa9009b[_0x486d('0x5')][_0x486d('0x6')](),'uri':Mustache['render'](_0xa9009b[_0x486d('0x7')],_0x4ec7af),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa9009b[_0x486d('0x8')])===_0x486d('0x9')&&parseInt(_0xa9009b[_0x486d('0x8')])>=0x1&&parseInt(_0xa9009b[_0x486d('0x8')])<=0xa?parseInt(_0xa9009b['data5'])*0x3e8:0x5*0x3e8};try{_0x5a6c6d[_0x486d('0xa')]=_0xa9009b[_0x486d('0xb')]?JSON[_0x486d('0xc')](Mustache['render'](_0xa9009b[_0x486d('0xb')],_0x4ec7af)):{};}catch(_0x515616){logger['error'](_0x515616[_0x486d('0xd')]);}switch(_0xa9009b[_0x486d('0x5')]['toUpperCase']()){case _0x486d('0xe'):case'DELETE':_0x5e472e=null;_0x5a6c6d['qs']=_0x4ec7af;break;case _0x486d('0xf'):case _0x486d('0x10'):if(_0xa9009b[_0x486d('0x11')]){try{_0x5e472e=JSON[_0x486d('0xc')](Mustache[_0x486d('0x12')](_0xa9009b[_0x486d('0x11')],_0x4ec7af));_0x5a6c6d['body']=_0x5e472e;}catch(_0x1d5540){logger[_0x486d('0x13')](_0x1d5540[_0x486d('0xd')]);logger['error'](_0x486d('0x14'));}}else{_0x5e472e=_0x4ec7af;_0x5a6c6d[_0x486d('0x15')]=_0x5e472e;}break;}logger[_0x486d('0x16')](util[_0x486d('0x17')](_0x486d('0x18'),_0xa9009b[_0x486d('0x5')],_0xa9009b[_0x486d('0x7')],JSON[_0x486d('0x19')](_0x5a6c6d)));rp(_0x5a6c6d)[_0x486d('0x1a')](function(_0x4b8a3d){_0x5e472e=!_[_0x486d('0x1b')](_0x5e472e)?_0x486d('0x1c')+_0x5e472e:'';_0x4530b0=typeof _0x4b8a3d[_0x486d('0x15')]===_0x486d('0x1d')?JSON[_0x486d('0x19')](_0x4b8a3d[_0x486d('0x15')]):_0x4b8a3d[_0x486d('0x15')];logger['info'](util[_0x486d('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xa9009b[_0x486d('0x5')],_0xa9009b[_0x486d('0x7')],_0x4b8a3d['statusCode'],_0x4530b0));})[_0x486d('0x1e')](function(_0x34824d){logger['error'](util[_0x486d('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xa9009b[_0x486d('0x5')],_0xa9009b[_0x486d('0x7')],_0x34824d[_0x486d('0x1f')],_0x34824d[_0x486d('0x20')],_0x34824d[_0x486d('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index ca586da..5380f18 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 _0xef87=['exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','catch'];(function(_0x5a94ac,_0x57438d){var _0x1d6ff4=function(_0x3c0112){while(--_0x3c0112){_0x5a94ac['push'](_0x5a94ac['shift']());}};_0x1d6ff4(++_0x57438d);}(_0xef87,0x135));var _0x7ef8=function(_0x4ea451,_0x89372b){_0x4ea451=_0x4ea451-0x0;var _0x505a20=_0xef87[_0x4ea451];return _0x505a20;};'use strict';var jayson=require(_0x7ef8('0x0'));var BPromise=require('bluebird');var logger=require(_0x7ef8('0x1'))(_0x7ef8('0x2'));var client=jayson[_0x7ef8('0x3')][_0x7ef8('0x4')]({'port':0x2329});client[_0x7ef8('0x5')]=function(_0x460003,_0x5c87aa){return new BPromise(function(_0xd5f55,_0x34988f){return client[_0x7ef8('0x6')](_0x460003,_0x5c87aa)[_0x7ef8('0x7')](function(_0xc144d1){logger[_0x7ef8('0x8')](_0x7ef8('0x9'),_0x7ef8('0x2'),_0x460003,_0x5c87aa,_0xc144d1);if(_0xc144d1[_0x7ef8('0xa')]){logger[_0x7ef8('0xa')](_0x7ef8('0x9'),'routing',_0x460003,_0xc144d1[_0x7ef8('0xa')][_0x7ef8('0xb')],_0x5c87aa);return _0x34988f(_0xc144d1[_0x7ef8('0xa')][_0x7ef8('0xb')]);}else{return _0xd5f55(_0xc144d1['result']);}})[_0x7ef8('0xc')](function(_0x3b864f){logger['error'](_0x7ef8('0x9'),'routing',_0x460003,_0x3b864f,_0x5c87aa);return _0x34988f(_0x3b864f);});});};module[_0x7ef8('0xd')]=client; \ No newline at end of file +var _0x28a7=['../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','exports','jayson/promise','bluebird'];(function(_0x512932,_0x228246){var _0xb971ab=function(_0x46db09){while(--_0x46db09){_0x512932['push'](_0x512932['shift']());}};_0xb971ab(++_0x228246);}(_0x28a7,0xfd));var _0x728a=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x28a7[_0xbb091];return _0x467a04;};'use strict';var jayson=require(_0x728a('0x0'));var BPromise=require(_0x728a('0x1'));var logger=require(_0x728a('0x2'))(_0x728a('0x3'));var client=jayson[_0x728a('0x4')][_0x728a('0x5')]({'port':0x2329});client[_0x728a('0x6')]=function(_0x53f800,_0x5593bd){return new BPromise(function(_0x5b2dda,_0x36370a){return client[_0x728a('0x7')](_0x53f800,_0x5593bd)[_0x728a('0x8')](function(_0x578d49){logger[_0x728a('0x9')](_0x728a('0xa'),'routing',_0x53f800,_0x5593bd,_0x578d49);if(_0x578d49[_0x728a('0xb')]){logger['error'](_0x728a('0xa'),_0x728a('0x3'),_0x53f800,_0x578d49[_0x728a('0xb')][_0x728a('0xc')],_0x5593bd);return _0x36370a(_0x578d49[_0x728a('0xb')][_0x728a('0xc')]);}else{return _0x5b2dda(_0x578d49[_0x728a('0xd')]);}})['catch'](function(_0x3d71f2){logger['error'](_0x728a('0xa'),_0x728a('0x3'),_0x53f800,_0x3d71f2,_0x5593bd);return _0x36370a(_0x3d71f2);});});};module[_0x728a('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 56c59dd..5659260 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 _0x8014=['then','getMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./realtime','./lib/email','./rpc/mailAccount','resolve'];(function(_0x4f31a7,_0x5091df){var _0x1e74fd=function(_0x3e5cac){while(--_0x3e5cac){_0x4f31a7['push'](_0x4f31a7['shift']());}};_0x1e74fd(++_0x5091df);}(_0x8014,0x163));var _0x4801=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x8014[_0x324012];return _0x435cf2;};'use strict';var BPromise=require(_0x4801('0x0'));var server=require('./server');var Realtime=require(_0x4801('0x1'));var EmailChannel=require(_0x4801('0x2'));var mailAccount=require(_0x4801('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4801('0x4')]()[_0x4801('0x5')](mailAccount[_0x4801('0x6')]())[_0x4801('0x5')](realtime['initMailAccounts']())[_0x4801('0x5')](function(){email['refresh'](realtime[_0x4801('0x7')]);return realtime;});}function main(){return server[_0x4801('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x4801('0x5')](function(){return setting[_0x4801('0x9')]();})[_0x4801('0x5')](function(_0x459aa1){return setInterval(initRealtime,_0x459aa1[_0x4801('0xa')]*0x3e8);})[_0x4801('0xb')](function(_0x921c0f){console['log'](_0x921c0f);});}main(); \ No newline at end of file +var _0x5100=['then','initMailAccounts','refresh','mailAccounts','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x6cf622,_0x146e67){var _0x1887fe=function(_0xe16cbd){while(--_0xe16cbd){_0x6cf622['push'](_0x6cf622['shift']());}};_0x1887fe(++_0x146e67);}(_0x5100,0x132));var _0x0510=function(_0x478de7,_0x319ab7){_0x478de7=_0x478de7-0x0;var _0x10fb93=_0x5100[_0x478de7];return _0x10fb93;};'use strict';var BPromise=require(_0x0510('0x0'));var server=require(_0x0510('0x1'));var Realtime=require(_0x0510('0x2'));var EmailChannel=require(_0x0510('0x3'));var mailAccount=require(_0x0510('0x4'));var setting=require(_0x0510('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x0510('0x6')](mailAccount['getMailAccounts']())[_0x0510('0x6')](realtime[_0x0510('0x7')]())['then'](function(){email[_0x0510('0x8')](realtime[_0x0510('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x0510('0x6')](function(){return setting['getSettings']();})[_0x0510('0x6')](function(_0x78e742){return setInterval(initRealtime,_0x78e742[_0x0510('0xa')]*0x3e8);})[_0x0510('0xb')](function(_0x1bd2c5){console[_0x0510('0xc')](_0x1bd2c5);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 895f6c3..1d9e957 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 _0x337a=['ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x337a,0x14d));var _0xa337=function(_0xbcbdcb,_0x652b63){_0xbcbdcb=_0xbcbdcb-0x0;var _0x243fcd=_0x337a[_0xbcbdcb];return _0x243fcd;};'use strict';var _=require(_0xa337('0x0'));var moment=require(_0xa337('0x1'));var BPromise=require(_0xa337('0x2'));var md5=require('md5');var Redis=require(_0xa337('0x3'));var config=require(_0xa337('0x4'));var logger=require(_0xa337('0x5'))(_0xa337('0x6'));config['redis']=_[_0xa337('0x7')](config[_0xa337('0x8')],{'host':_0xa337('0x9'),'port':0x18eb});var io=require(_0xa337('0xa'))(new Redis(config[_0xa337('0x8')]));var EmailImap=require(_0xa337('0xb'));var EmailSmtp=require(_0xa337('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1bf8b6){logger[_0xa337('0xd')]('start\x20email\x20channel');this[_0xa337('0xe')]=_0x1bf8b6[_0xa337('0xe')];this[_0xa337('0xf')]={};this[_0xa337('0x10')]=new EmailSmtp();}EmailChannel[_0xa337('0x11')][_0xa337('0x12')]=function(_0x21f6c4){var _0x50044b=this[_0xa337('0xe')][_0x21f6c4];var _0x48b99a={'id':_0x50044b['id'],'name':_0x50044b[_0xa337('0x13')],'key':_0x50044b[_0xa337('0x14')],'active':_0x50044b[_0xa337('0x15')],'Imap':{'status':_0x50044b[_0xa337('0x16')][_0xa337('0x17')],'messageStatus':_0x50044b[_0xa337('0x16')][_0xa337('0x18')],'total':_0x50044b[_0xa337('0x16')][_0xa337('0x19')]}};if(_[_0xa337('0x1a')](md5Accounts[_0x21f6c4])){md5Accounts[_0x21f6c4]={};}var _0x31942a=md5(JSON[_0xa337('0x1b')](_0x48b99a));if(md5Accounts[_0x21f6c4][_0xa337('0x1c')]!==_0x31942a){md5Accounts[_0x21f6c4][_0xa337('0x1c')]=_0x31942a;io[_0xa337('0x12')](_0xa337('0x1d'),_0x48b99a);}};EmailChannel[_0xa337('0x11')][_0xa337('0x1e')]=function(_0x927d96){for(var _0x12c7d8 in _0x927d96){if(_0x927d96[_0xa337('0x1f')](_0x12c7d8)){if(_0x927d96[_0x12c7d8][_0xa337('0x16')]&&_0x927d96[_0x12c7d8]['active']){var _0x259529=_0x927d96[_0x12c7d8][_0xa337('0x16')];if(!this[_0xa337('0xf')][_0xa337('0x1f')](_0x259529['id'])){this[_0xa337('0xf')][_0x259529['id']]=new EmailImap(_0x259529,_0x927d96[_0x12c7d8][_0xa337('0x6')]);this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x20'),this[_0xa337('0x21')]['bind'](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on']('email',this[_0xa337('0x22')][_0xa337('0x23')](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x24'),this[_0xa337('0x25')]['bind'](this,_0x12c7d8));this[_0xa337('0xf')][_0x259529['id']]['on'](_0xa337('0x26'),this[_0xa337('0x27')][_0xa337('0x23')](this,_0x12c7d8));}}else{if(_[_0xa337('0x1a')](this[_0xa337('0xe')][_0x12c7d8][_0xa337('0x16')])){this[_0xa337('0xe')][_0x12c7d8][_0xa337('0x16')]={};}this['mailAccounts'][_0x12c7d8][_0xa337('0x16')][_0xa337('0x17')]='disabled';this['mailAccounts'][_0x12c7d8]['Imap'][_0xa337('0x18')]='';this['emit'](_0x12c7d8);}}}};EmailChannel[_0xa337('0x11')][_0xa337('0x21')]=function(_0x113d86,_0x17c033){if(this[_0xa337('0xe')][_0x113d86]){this[_0xa337('0xe')][_0x113d86][_0xa337('0x16')][_0xa337('0x17')]=_0xa337('0x28');this['mailAccounts'][_0x113d86][_0xa337('0x16')]['messageStatus']=_0x17c033[_0xa337('0x13')];if(_0x17c033[_0xa337('0x29')]){this[_0xa337('0xe')][_0x113d86]['Imap'][_0xa337('0x19')]=_0x17c033[_0xa337('0x29')]['total'];}return this[_0xa337('0x12')](_0x113d86);}};EmailChannel['prototype'][_0xa337('0x22')]=function(_0x2e2251,_0x3a5d14){logger[_0xa337('0xd')](_0xa337('0x2a'),_0x3a5d14[_0xa337('0x2b')],_0x3a5d14[_0xa337('0x2c')],_0x3a5d14['from'],_0x2e2251);if(this['mailAccounts'][_0x2e2251]){return mailAccount[_0xa337('0x2d')](_0x2e2251,_0x3a5d14)[_0xa337('0x2e')](function(_0xf91a76){if(_0xf91a76){logger[_0xa337('0xd')](_0xa337('0x2f'));}})[_0xa337('0x30')](function(_0x4aa630){logger[_0xa337('0x26')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xa337('0x1b')](_0x4aa630));});}};EmailChannel[_0xa337('0x11')][_0xa337('0x25')]=function(_0x2ef259){if(this[_0xa337('0xe')][_0x2ef259]&&this[_0xa337('0xe')][_0x2ef259][_0xa337('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x2ef259][_0xa337('0x16')]['id']]){delete this[_0xa337('0xf')][this[_0xa337('0xe')][_0x2ef259][_0xa337('0x16')]['id']];}this[_0xa337('0xe')][_0x2ef259]['Imap'][_0xa337('0x31')]=moment();this[_0xa337('0x12')](_0x2ef259);}};EmailChannel[_0xa337('0x11')][_0xa337('0x27')]=function(_0x508c71,_0x56efa9){if(this[_0xa337('0xe')][_0x508c71]){this[_0xa337('0xe')][_0x508c71]['Imap']['status']=_0xa337('0x26');this[_0xa337('0xe')][_0x508c71][_0xa337('0x16')][_0xa337('0x18')]=_0x56efa9;return this['emit'](_0x508c71);}};EmailChannel['prototype'][_0xa337('0x32')]=function(_0x5e07f4,_0x4bf416){return this[_0xa337('0x10')]['send'](_0x5e07f4,_0x4bf416);};EmailChannel[_0xa337('0x11')][_0xa337('0x33')]=function(_0x4bc1d6){var _0x47a454=this;if(this[_0xa337('0xe')][_0x4bc1d6['id']]){if(_[_0xa337('0x1a')](this[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')])){this['mailAccounts'][_0x4bc1d6['id']]['Smtp']={};}this[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')][_0xa337('0x31')]=moment();return new BPromise(function(_0x328cb0,_0x4be10c){return _0x47a454['smtp'][_0xa337('0x35')](_0x4bc1d6)[_0xa337('0x2e')](function(_0x241f1d){_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']][_0xa337('0x34')][_0xa337('0x17')]=_0xa337('0x36');_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x18')]='';_0x47a454[_0xa337('0x12')](_0x4bc1d6['id']);_0x328cb0(_0x241f1d);})[_0xa337('0x30')](function(_0x52f938){_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x17')]=_0xa337('0x26');_0x47a454[_0xa337('0xe')][_0x4bc1d6['id']]['Smtp'][_0xa337('0x18')]=_0x52f938;_0x47a454[_0xa337('0x12')](_0x4bc1d6['id']);_0x4be10c(_0x52f938);});});}return this[_0xa337('0x10')][_0xa337('0x35')](_0x4bc1d6);};module[_0xa337('0x37')]=EmailChannel; \ No newline at end of file +var _0x73ad=['md5','../../../config/environment','../../../config/logger','email','defaults','redis','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','stringify','mailAccount:update','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','isNil','disabled','total','messages','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','moment'];(function(_0x46ee2c,_0x199875){var _0x5a409b=function(_0x1cf9af){while(--_0x1cf9af){_0x46ee2c['push'](_0x46ee2c['shift']());}};_0x5a409b(++_0x199875);}(_0x73ad,0x103));var _0xd73a=function(_0x74b080,_0x4cc612){_0x74b080=_0x74b080-0x0;var _0x31c7f3=_0x73ad[_0x74b080];return _0x31c7f3;};'use strict';var _=require('lodash');var moment=require(_0xd73a('0x0'));var BPromise=require('bluebird');var md5=require(_0xd73a('0x1'));var Redis=require('ioredis');var config=require(_0xd73a('0x2'));var logger=require(_0xd73a('0x3'))(_0xd73a('0x4'));config['redis']=_[_0xd73a('0x5')](config[_0xd73a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd73a('0x7'))(new Redis(config[_0xd73a('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xd73a('0x8'));var mailAccount=require(_0xd73a('0x9'));var md5Accounts={};function EmailChannel(_0x471926){logger[_0xd73a('0xa')](_0xd73a('0xb'));this['mailAccounts']=_0x471926[_0xd73a('0xc')];this['imapAccounts']={};this[_0xd73a('0xd')]=new EmailSmtp();}EmailChannel[_0xd73a('0xe')][_0xd73a('0xf')]=function(_0x410497){var _0x47a4ce=this['mailAccounts'][_0x410497];var _0x201af0={'id':_0x47a4ce['id'],'name':_0x47a4ce[_0xd73a('0x10')],'key':_0x47a4ce[_0xd73a('0x11')],'active':_0x47a4ce[_0xd73a('0x12')],'Imap':{'status':_0x47a4ce[_0xd73a('0x13')][_0xd73a('0x14')],'messageStatus':_0x47a4ce[_0xd73a('0x13')][_0xd73a('0x15')],'total':_0x47a4ce['Imap']['total']}};if(_['isNil'](md5Accounts[_0x410497])){md5Accounts[_0x410497]={};}var _0x54e332=md5(JSON[_0xd73a('0x16')](_0x201af0));if(md5Accounts[_0x410497][_0xd73a('0x1')]!==_0x54e332){md5Accounts[_0x410497][_0xd73a('0x1')]=_0x54e332;io['emit'](_0xd73a('0x17'),_0x201af0);}};EmailChannel[_0xd73a('0xe')]['refresh']=function(_0x16911c){for(var _0x3c2bcb in _0x16911c){if(_0x16911c['hasOwnProperty'](_0x3c2bcb)){if(_0x16911c[_0x3c2bcb][_0xd73a('0x13')]&&_0x16911c[_0x3c2bcb][_0xd73a('0x12')]){var _0x551428=_0x16911c[_0x3c2bcb][_0xd73a('0x13')];if(!this[_0xd73a('0x18')]['hasOwnProperty'](_0x551428['id'])){this[_0xd73a('0x18')][_0x551428['id']]=new EmailImap(_0x551428,_0x16911c[_0x3c2bcb]['email']);this[_0xd73a('0x18')][_0x551428['id']]['on'](_0xd73a('0x19'),this[_0xd73a('0x1a')][_0xd73a('0x1b')](this,_0x3c2bcb));this[_0xd73a('0x18')][_0x551428['id']]['on'](_0xd73a('0x4'),this[_0xd73a('0x1c')][_0xd73a('0x1b')](this,_0x3c2bcb));this[_0xd73a('0x18')][_0x551428['id']]['on'](_0xd73a('0x1d'),this[_0xd73a('0x1e')]['bind'](this,_0x3c2bcb));this[_0xd73a('0x18')][_0x551428['id']]['on']('error',this['handleImapError'][_0xd73a('0x1b')](this,_0x3c2bcb));}}else{if(_[_0xd73a('0x1f')](this[_0xd73a('0xc')][_0x3c2bcb][_0xd73a('0x13')])){this[_0xd73a('0xc')][_0x3c2bcb][_0xd73a('0x13')]={};}this['mailAccounts'][_0x3c2bcb][_0xd73a('0x13')][_0xd73a('0x14')]=_0xd73a('0x20');this[_0xd73a('0xc')][_0x3c2bcb][_0xd73a('0x13')][_0xd73a('0x15')]='';this['emit'](_0x3c2bcb);}}}};EmailChannel[_0xd73a('0xe')][_0xd73a('0x1a')]=function(_0x466864,_0x56f792){if(this['mailAccounts'][_0x466864]){this[_0xd73a('0xc')][_0x466864]['Imap'][_0xd73a('0x14')]='connected';this[_0xd73a('0xc')][_0x466864][_0xd73a('0x13')][_0xd73a('0x15')]=_0x56f792[_0xd73a('0x10')];if(_0x56f792['messages']){this[_0xd73a('0xc')][_0x466864]['Imap'][_0xd73a('0x21')]=_0x56f792[_0xd73a('0x22')]['total'];}return this[_0xd73a('0xf')](_0x466864);}};EmailChannel[_0xd73a('0xe')][_0xd73a('0x1c')]=function(_0x59541e,_0x553946){logger[_0xd73a('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x553946[_0xd73a('0x23')],_0x553946[_0xd73a('0x24')],_0x553946[_0xd73a('0x25')],_0x59541e);if(this[_0xd73a('0xc')][_0x59541e]){return mailAccount[_0xd73a('0x26')](_0x59541e,_0x553946)['then'](function(_0x17c75a){if(_0x17c75a){logger['info'](_0xd73a('0x27'));}})[_0xd73a('0x28')](function(_0x17cc81){logger[_0xd73a('0x29')](_0xd73a('0x2a'),JSON[_0xd73a('0x16')](_0x17cc81));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x23ae9b){if(this[_0xd73a('0xc')][_0x23ae9b]&&this['mailAccounts'][_0x23ae9b][_0xd73a('0x13')]){if(this[_0xd73a('0x18')][this['mailAccounts'][_0x23ae9b][_0xd73a('0x13')]['id']]){delete this[_0xd73a('0x18')][this[_0xd73a('0xc')][_0x23ae9b][_0xd73a('0x13')]['id']];}this[_0xd73a('0xc')][_0x23ae9b][_0xd73a('0x13')][_0xd73a('0x2b')]=moment();this[_0xd73a('0xf')](_0x23ae9b);}};EmailChannel[_0xd73a('0xe')]['handleImapError']=function(_0x3dfd1f,_0x3516f9){if(this[_0xd73a('0xc')][_0x3dfd1f]){this['mailAccounts'][_0x3dfd1f][_0xd73a('0x13')][_0xd73a('0x14')]=_0xd73a('0x29');this['mailAccounts'][_0x3dfd1f][_0xd73a('0x13')]['messageStatus']=_0x3516f9;return this[_0xd73a('0xf')](_0x3dfd1f);}};EmailChannel['prototype'][_0xd73a('0x2c')]=function(_0x5665f9,_0x36d77a){return this[_0xd73a('0xd')][_0xd73a('0x2d')](_0x5665f9,_0x36d77a);};EmailChannel[_0xd73a('0xe')][_0xd73a('0x2e')]=function(_0x368ab2){var _0x55c723=this;if(this[_0xd73a('0xc')][_0x368ab2['id']]){if(_['isNil'](this[_0xd73a('0xc')][_0x368ab2['id']][_0xd73a('0x2f')])){this['mailAccounts'][_0x368ab2['id']][_0xd73a('0x2f')]={};}this[_0xd73a('0xc')][_0x368ab2['id']][_0xd73a('0x2f')][_0xd73a('0x2b')]=moment();return new BPromise(function(_0x2bf214,_0x2acfa0){return _0x55c723[_0xd73a('0xd')][_0xd73a('0x30')](_0x368ab2)[_0xd73a('0x31')](function(_0x3cc1a9){_0x55c723[_0xd73a('0xc')][_0x368ab2['id']][_0xd73a('0x2f')][_0xd73a('0x14')]=_0xd73a('0x32');_0x55c723[_0xd73a('0xc')][_0x368ab2['id']][_0xd73a('0x2f')]['messageStatus']='';_0x55c723[_0xd73a('0xf')](_0x368ab2['id']);_0x2bf214(_0x3cc1a9);})[_0xd73a('0x28')](function(_0x5daf65){_0x55c723[_0xd73a('0xc')][_0x368ab2['id']]['Smtp'][_0xd73a('0x14')]=_0xd73a('0x29');_0x55c723['mailAccounts'][_0x368ab2['id']][_0xd73a('0x2f')][_0xd73a('0x15')]=_0x5daf65;_0x55c723[_0xd73a('0xf')](_0x368ab2['id']);_0x2acfa0(_0x5daf65);});});}return this[_0xd73a('0xd')]['verify'](_0x368ab2);};module[_0xd73a('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8a3e670..659ece5 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 _0x9099=['fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','stringify','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length'];(function(_0x12b9ea,_0x58e480){var _0x165199=function(_0x237e6a){while(--_0x237e6a){_0x12b9ea['push'](_0x12b9ea['shift']());}};_0x165199(++_0x58e480);}(_0x9099,0x1ac));var _0x9909=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x9099[_0x202c61];return _0x540691;};'use strict';var fs=require('fs');var path=require(_0x9909('0x0'));var util=require('util');var Imap=require(_0x9909('0x1'));var _=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var simpleParser=require(_0x9909('0x4'))[_0x9909('0x5')];var Iconv=require(_0x9909('0x6'))[_0x9909('0x7')];var EventEmitter=require(_0x9909('0x8'))[_0x9909('0x9')];var utils=require(_0x9909('0xa'));var logger=require(_0x9909('0xb'))(_0x9909('0xc'));function EmailImap(_0x3b7391,_0x3dc2dd){this['mailbox']=_0x9909('0xd');this['account']=this['getAccount'](_0x3b7391,_0x3dc2dd);this['imap']=new Imap(this['account']);this[_0x9909('0x1')]['once'](_0x9909('0xe'),this[_0x9909('0xf')][_0x9909('0x10')](this));this['imap'][_0x9909('0x11')]('end',this[_0x9909('0x12')][_0x9909('0x10')](this));this[_0x9909('0x1')]['on'](_0x9909('0x13'),this[_0x9909('0x14')][_0x9909('0x10')](this));this[_0x9909('0x1')][_0x9909('0x15')]();}util[_0x9909('0x16')](EmailImap,EventEmitter);EmailImap[_0x9909('0x17')][_0x9909('0x18')]=function(_0x38c2e3,_0x4618eb){var _0x5699d8={'connTimeout':_0x38c2e3[_0x9909('0x19')]?_0x38c2e3['connTimeout']*0x3e8:0x2710,'authTimeout':_0x38c2e3[_0x9909('0x1a')]?_0x38c2e3['authTimeout']*0x3e8:0x1388};if(_[_0x9909('0x1b')](_0x38c2e3[_0x9909('0x1c')])){if(_0x38c2e3[_0x9909('0x1d')]){_0x5699d8['user']=_0x38c2e3[_0x9909('0x1e')];_0x5699d8[_0x9909('0x1f')]=_0x38c2e3[_0x9909('0x1f')];}_0x5699d8[_0x9909('0x20')]=_0x38c2e3[_0x9909('0x20')];_0x5699d8[_0x9909('0x21')]=_0x38c2e3[_0x9909('0x21')]||0x3e1;if(_0x38c2e3['tls']){_0x5699d8[_0x9909('0x22')]=!![];}else{_0x5699d8[_0x9909('0x22')]=![];_0x5699d8['autotls']=_0x9909('0x23');}}else{_0x5699d8[_0x9909('0x1e')]=_0x38c2e3[_0x9909('0x1e')];_0x5699d8[_0x9909('0x1f')]=_0x38c2e3[_0x9909('0x1f')];_0x5699d8[_0x9909('0x20')]=utils[_0x9909('0x24')](_0x38c2e3['service']);_0x5699d8[_0x9909('0x21')]=0x3e1;_0x5699d8[_0x9909('0x22')]=!![];}_0x5699d8['email']=_0x4618eb||_0x38c2e3['user']||_0x9909('0x25');return _0x5699d8;};EmailImap[_0x9909('0x17')][_0x9909('0xf')]=function(){this[_0x9909('0x1')][_0x9909('0x26')](this['mailbox'],![],this['handleOpenBox'][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x27')]=function(_0x1c7ee5,_0x52be17){if(_0x1c7ee5){this[_0x9909('0x14')](_0x1c7ee5,!![]);}else{this[_0x9909('0x28')](_0x9909('0x29'),_0x52be17);this[_0x9909('0x2a')]();}};EmailImap['prototype'][_0x9909('0x2b')]=function(_0x22ff12){if(_0x22ff12){this[_0x9909('0x14')](_0x22ff12,!![]);}else{this[_0x9909('0x1')]['end']();}};EmailImap[_0x9909('0x17')][_0x9909('0x2a')]=function(){this[_0x9909('0x1')][_0x9909('0x2c')]([_0x9909('0x2d')],this[_0x9909('0x2e')][_0x9909('0x10')](this));};EmailImap['prototype'][_0x9909('0x2e')]=function(_0x3a3f4f,_0x87ac8a){if(_0x3a3f4f){this[_0x9909('0x14')](_0x3a3f4f,!![]);}else{if(_0x87ac8a[_0x9909('0x2f')]){try{var _0x519066=this[_0x9909('0x1')][_0x9909('0x30')](_0x87ac8a,{'bodies':'','markSeen':!![]});_0x519066['on'](_0x9909('0x31'),this[_0x9909('0x32')][_0x9909('0x10')](this));_0x519066[_0x9909('0x11')](_0x9909('0x13'),this[_0x9909('0x33')]['bind'](this));_0x519066['once'](_0x9909('0x34'),this[_0x9909('0x35')]['bind'](this));}catch(_0x3f218f){logger[_0x9909('0x13')](_0x3f218f);}}else{this[_0x9909('0x1')][_0x9909('0x36')](!![],this[_0x9909('0x2b')][_0x9909('0x10')](this));}}};EmailImap[_0x9909('0x17')]['handleFetchMessage']=function(_0x17a7bd,_0x2686f3){_0x17a7bd['on'](_0x9909('0x37'),this[_0x9909('0x38')][_0x9909('0x10')](this));_0x17a7bd['once'](_0x9909('0x39'),this[_0x9909('0x3a')]['bind'](this));_0x17a7bd[_0x9909('0x11')](_0x9909('0x34'),this[_0x9909('0x3b')][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x38')]=function(_0x4e23ed,_0x21c1c8){simpleParser(_0x4e23ed,{'Iconv':Iconv},this[_0x9909('0x3c')][_0x9909('0x10')](this));};EmailImap[_0x9909('0x17')][_0x9909('0x3a')]=function(_0x1d1ad6){};EmailImap[_0x9909('0x17')][_0x9909('0x3b')]=function(){};EmailImap[_0x9909('0x17')][_0x9909('0x3c')]=function(_0x31fd11,_0x19d8b4){if(_0x31fd11){logger[_0x9909('0x13')](_0x31fd11);}else{var _0x3facb7=this;utils[_0x9909('0x3d')](this[_0x9909('0x3e')],_0x19d8b4,function(_0x42d63d){_0x3facb7[_0x9909('0x28')](_0x9909('0xc'),_0x42d63d);});}};EmailImap[_0x9909('0x17')][_0x9909('0x35')]=function(){this[_0x9909('0x1')][_0x9909('0x36')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x9909('0x17')]['handleFetchError']=function(_0x52724f){this[_0x9909('0x14')](_0x52724f);this[_0x9909('0x1')][_0x9909('0x36')](!![],this[_0x9909('0x2b')]['bind'](this));};EmailImap[_0x9909('0x17')][_0x9909('0x12')]=function(){this[_0x9909('0x28')]('end');};EmailImap[_0x9909('0x17')][_0x9909('0x14')]=function(_0x345ba0,_0x4b0a4c){logger[_0x9909('0x13')](_0x9909('0x14'),this[_0x9909('0x3e')][_0x9909('0xc')],JSON[_0x9909('0x3f')](_0x345ba0));var _0x856057='';if(_0x345ba0){if(_0x345ba0[_0x9909('0x40')]){_0x856057=_0x345ba0[_0x9909('0x40')];}else{for(var _0x4f88f4 in _0x345ba0){if(_0x345ba0[_0x9909('0x41')](_0x4f88f4)){_0x856057+=_[_0x9909('0x42')](_0x4f88f4)+':\x20'+_0x345ba0[_0x4f88f4]+'\x0a';}}}}if(_0x4b0a4c){this['imap'][_0x9909('0x34')]();}else{this[_0x9909('0x28')]('error',_0x856057);this['emit'](_0x9909('0x34'));}};module[_0x9909('0x43')]=EmailImap; \ No newline at end of file +var _0xf6c6=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','parser','stringify','hasOwnProperty','upperFirst','util','lodash','randomstring','mailparser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd'];(function(_0x4bfb05,_0x428bdb){var _0x3c17b3=function(_0x18acb2){while(--_0x18acb2){_0x4bfb05['push'](_0x4bfb05['shift']());}};_0x3c17b3(++_0x428bdb);}(_0xf6c6,0x154));var _0x6f6c=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xf6c6[_0x307d86];return _0x361745;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x6f6c('0x0'));var Imap=require('imap');var _=require(_0x6f6c('0x1'));var rs=require(_0x6f6c('0x2'));var simpleParser=require(_0x6f6c('0x3'))['simpleParser'];var Iconv=require(_0x6f6c('0x4'))[_0x6f6c('0x5')];var EventEmitter=require(_0x6f6c('0x6'))['EventEmitter'];var utils=require(_0x6f6c('0x7'));var logger=require(_0x6f6c('0x8'))(_0x6f6c('0x9'));function EmailImap(_0x40a1c0,_0x3feb60){this[_0x6f6c('0xa')]=_0x6f6c('0xb');this[_0x6f6c('0xc')]=this[_0x6f6c('0xd')](_0x40a1c0,_0x3feb60);this[_0x6f6c('0xe')]=new Imap(this[_0x6f6c('0xc')]);this[_0x6f6c('0xe')][_0x6f6c('0xf')](_0x6f6c('0x10'),this[_0x6f6c('0x11')][_0x6f6c('0x12')](this));this[_0x6f6c('0xe')][_0x6f6c('0xf')]('end',this[_0x6f6c('0x13')][_0x6f6c('0x12')](this));this['imap']['on'](_0x6f6c('0x14'),this[_0x6f6c('0x15')]['bind'](this));this['imap'][_0x6f6c('0x16')]();}util[_0x6f6c('0x17')](EmailImap,EventEmitter);EmailImap[_0x6f6c('0x18')][_0x6f6c('0xd')]=function(_0x525799,_0x56e278){var _0x16f49e={'connTimeout':_0x525799[_0x6f6c('0x19')]?_0x525799[_0x6f6c('0x19')]*0x3e8:0x2710,'authTimeout':_0x525799[_0x6f6c('0x1a')]?_0x525799[_0x6f6c('0x1a')]*0x3e8:0x1388};if(_[_0x6f6c('0x1b')](_0x525799[_0x6f6c('0x1c')])){if(_0x525799[_0x6f6c('0x1d')]){_0x16f49e[_0x6f6c('0x1e')]=_0x525799[_0x6f6c('0x1e')];_0x16f49e[_0x6f6c('0x1f')]=_0x525799['password'];}_0x16f49e[_0x6f6c('0x20')]=_0x525799[_0x6f6c('0x20')];_0x16f49e['port']=_0x525799[_0x6f6c('0x21')]||0x3e1;if(_0x525799[_0x6f6c('0x22')]){_0x16f49e[_0x6f6c('0x22')]=!![];}else{_0x16f49e[_0x6f6c('0x22')]=![];_0x16f49e[_0x6f6c('0x23')]=_0x6f6c('0x24');}}else{_0x16f49e['user']=_0x525799['user'];_0x16f49e[_0x6f6c('0x1f')]=_0x525799[_0x6f6c('0x1f')];_0x16f49e[_0x6f6c('0x20')]=utils[_0x6f6c('0x25')](_0x525799[_0x6f6c('0x1c')]);_0x16f49e[_0x6f6c('0x21')]=0x3e1;_0x16f49e[_0x6f6c('0x22')]=!![];}_0x16f49e['email']=_0x56e278||_0x525799[_0x6f6c('0x1e')]||_0x6f6c('0x26');return _0x16f49e;};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x11')]=function(){this[_0x6f6c('0xe')]['openBox'](this['mailbox'],![],this[_0x6f6c('0x27')][_0x6f6c('0x12')](this));};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x27')]=function(_0x25863f,_0x5c0adf){if(_0x25863f){this['handleError'](_0x25863f,!![]);}else{this[_0x6f6c('0x28')](_0x6f6c('0x29'),_0x5c0adf);this[_0x6f6c('0x2a')]();}};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x2b')]=function(_0x348328){if(_0x348328){this[_0x6f6c('0x15')](_0x348328,!![]);}else{this[_0x6f6c('0xe')]['end']();}};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x2a')]=function(){this[_0x6f6c('0xe')][_0x6f6c('0x2c')](['UNSEEN'],this[_0x6f6c('0x2d')][_0x6f6c('0x12')](this));};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x2d')]=function(_0x1b34e8,_0xca0504){if(_0x1b34e8){this[_0x6f6c('0x15')](_0x1b34e8,!![]);}else{if(_0xca0504['length']){try{var _0x47e733=this[_0x6f6c('0xe')]['fetch'](_0xca0504,{'bodies':'','markSeen':!![]});_0x47e733['on'](_0x6f6c('0x2e'),this[_0x6f6c('0x2f')]['bind'](this));_0x47e733[_0x6f6c('0xf')](_0x6f6c('0x14'),this[_0x6f6c('0x30')]['bind'](this));_0x47e733['once'](_0x6f6c('0x31'),this[_0x6f6c('0x32')][_0x6f6c('0x12')](this));}catch(_0xf48611){logger['error'](_0xf48611);}}else{this[_0x6f6c('0xe')][_0x6f6c('0x33')](!![],this[_0x6f6c('0x2b')][_0x6f6c('0x12')](this));}}};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x2f')]=function(_0x26e51b,_0x30b262){_0x26e51b['on'](_0x6f6c('0x34'),this['handleMessageBody'][_0x6f6c('0x12')](this));_0x26e51b['once'](_0x6f6c('0x35'),this[_0x6f6c('0x36')][_0x6f6c('0x12')](this));_0x26e51b['once'](_0x6f6c('0x31'),this[_0x6f6c('0x37')][_0x6f6c('0x12')](this));};EmailImap[_0x6f6c('0x18')]['handleMessageBody']=function(_0x3ba588,_0x892313){simpleParser(_0x3ba588,{'Iconv':Iconv},this['handleSimpleParser'][_0x6f6c('0x12')](this));};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x36')]=function(_0x5c8487){};EmailImap['prototype'][_0x6f6c('0x37')]=function(){};EmailImap[_0x6f6c('0x18')]['handleSimpleParser']=function(_0x2ef4b6,_0x5bab5f){if(_0x2ef4b6){logger[_0x6f6c('0x14')](_0x2ef4b6);}else{var _0x3aa904=this;utils[_0x6f6c('0x38')](this['account'],_0x5bab5f,function(_0x21020b){_0x3aa904[_0x6f6c('0x28')](_0x6f6c('0x9'),_0x21020b);});}};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x32')]=function(){this[_0x6f6c('0xe')][_0x6f6c('0x33')](!![],this[_0x6f6c('0x2b')][_0x6f6c('0x12')](this));};EmailImap[_0x6f6c('0x18')]['handleFetchError']=function(_0x1f1f4e){this['handleError'](_0x1f1f4e);this['imap'][_0x6f6c('0x33')](!![],this[_0x6f6c('0x2b')]['bind'](this));};EmailImap[_0x6f6c('0x18')][_0x6f6c('0x13')]=function(){this[_0x6f6c('0x28')](_0x6f6c('0x31'));};EmailImap['prototype'][_0x6f6c('0x15')]=function(_0x5278be,_0xc35931){logger[_0x6f6c('0x14')]('handleError',this[_0x6f6c('0xc')][_0x6f6c('0x9')],JSON[_0x6f6c('0x39')](_0x5278be));var _0x5bdebe='';if(_0x5278be){if(_0x5278be['textCode']){_0x5bdebe=_0x5278be['textCode'];}else{for(var _0x27bcf5 in _0x5278be){if(_0x5278be[_0x6f6c('0x3a')](_0x27bcf5)){_0x5bdebe+=_[_0x6f6c('0x3b')](_0x27bcf5)+':\x20'+_0x5278be[_0x27bcf5]+'\x0a';}}}}if(_0xc35931){this[_0x6f6c('0xe')][_0x6f6c('0x31')]();}else{this[_0x6f6c('0x28')]('error',_0x5bdebe);this[_0x6f6c('0x28')]('end');}};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 358bdfb..0fc548a 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 _0xe708=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe708,0xc2));var _0x8e70=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe708[_0x307d86];return _0x361745;};'use strict';var nodemailer=require(_0x8e70('0x0'));var BPromise=require(_0x8e70('0x1'));var inlineBase64=require(_0x8e70('0x2'));function EmailSmtp(){}EmailSmtp[_0x8e70('0x3')][_0x8e70('0x4')]=function(_0x5de661,_0x4e6ac1){return new BPromise(function(_0x44135f,_0xc19112){var _0x2b3016=nodemailer[_0x8e70('0x5')](_0x5de661);_0x2b3016[_0x8e70('0x6')](_0x8e70('0x7'),inlineBase64());_0x2b3016[_0x8e70('0x8')](_0x4e6ac1,function(_0x12f500,_0x86c3bf){if(_0x12f500){_0xc19112(_0x12f500[_0x8e70('0x9')]());}else{_0x44135f(_0x86c3bf);}});});};EmailSmtp[_0x8e70('0x3')]['verify']=function(_0x4ab1da){return new BPromise(function(_0x51a102,_0x41c0a1){var _0x278582=nodemailer[_0x8e70('0x5')](_0x4ab1da);_0x278582[_0x8e70('0xa')](function(_0x21dfec,_0x52e5cb){if(_0x21dfec){_0x41c0a1(_0x21dfec[_0x8e70('0x9')]());}else{if(_0x52e5cb){_0x51a102(_0x52e5cb);}else{_0x41c0a1(_0x8e70('0xb'));}}});});};module[_0x8e70('0xc')]=EmailSmtp; \ No newline at end of file +var _0xc326=['Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify'];(function(_0x5be2f3,_0x25b22d){var _0x31b0e5=function(_0x34f3e4){while(--_0x34f3e4){_0x5be2f3['push'](_0x5be2f3['shift']());}};_0x31b0e5(++_0x25b22d);}(_0xc326,0x198));var _0x6c32=function(_0x4fb926,_0x5daf04){_0x4fb926=_0x4fb926-0x0;var _0x4d0f4a=_0xc326[_0x4fb926];return _0x4d0f4a;};'use strict';var nodemailer=require(_0x6c32('0x0'));var BPromise=require(_0x6c32('0x1'));var inlineBase64=require(_0x6c32('0x2'));function EmailSmtp(){}EmailSmtp[_0x6c32('0x3')][_0x6c32('0x4')]=function(_0x2aa219,_0x16748d){return new BPromise(function(_0x2d779b,_0x48050e){var _0x4369e0=nodemailer[_0x6c32('0x5')](_0x2aa219);_0x4369e0[_0x6c32('0x6')](_0x6c32('0x7'),inlineBase64());_0x4369e0['sendMail'](_0x16748d,function(_0x1559d6,_0x53d88a){if(_0x1559d6){_0x48050e(_0x1559d6[_0x6c32('0x8')]());}else{_0x2d779b(_0x53d88a);}});});};EmailSmtp['prototype'][_0x6c32('0x9')]=function(_0x10f4eb){return new BPromise(function(_0x1aafa7,_0x4ef396){var _0x50a6d6=nodemailer[_0x6c32('0x5')](_0x10f4eb);_0x50a6d6[_0x6c32('0x9')](function(_0x40c538,_0x38d156){if(_0x40c538){_0x4ef396(_0x40c538[_0x6c32('0x8')]());}else{if(_0x38d156){_0x1aafa7(_0x38d156);}else{_0x4ef396(_0x6c32('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 5e488ed..d56d2be 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 _0x7031=['attachments','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','path','util','../../../config/logger','email','value','address','anonymous','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','includes','0x1?_0xf7acd4[_0x1703('0x10')](0x0,-0x1)[_0x1703('0x11')]('\x20'):_0x3acf9c[_0x1703('0xb')];}return _0x1703('0x12');}function getLastName(_0x1a3ff1){var _0x3de192=_['head'](_0x1a3ff1['value']);if(_0x3de192&&_0x3de192[_0x1703('0xb')]){var _0x467d31=_0x3de192['name'][_0x1703('0xe')](/\s+/);return _0x467d31[_0x1703('0xf')]>0x1?_0x467d31[_0x1703('0x13')]():'';}return'';}function getMails(_0x4c41a3,_0x404ae5){var _0x290ce1='';for(var _0x4d53d1=0x0;_0x4d53d1<_0x404ae5[_0x1703('0x6')][_0x1703('0xf')];_0x4d53d1+=0x1){if(_0x404ae5[_0x1703('0x6')][_0x4d53d1][_0x1703('0x7')]!==_0x4c41a3){if(!_[_0x1703('0x14')](_0x290ce1)){_0x290ce1+=',';}_0x290ce1+=_0x404ae5[_0x1703('0x6')][_0x4d53d1][_0x1703('0xb')]||_0x404ae5['value'][_0x4d53d1]['address']||'';_0x290ce1+='\x20<';_0x290ce1+=_0x404ae5['value'][_0x4d53d1][_0x1703('0x7')]?_0x404ae5['value'][_0x4d53d1][_0x1703('0x7')]:_0x1703('0x8')+random[_0x1703('0x9')](0x6)+'@xcally.com';_0x290ce1+='>';}}return _0x290ce1;}function parseEmail(_0x53f996,_0x3de8a8,_0x4fdf8e){if(_0x3de8a8[_0x1703('0x15')]){var _0x2bf640=/)<[^<]*)*<\/script>/gi;while(_0x2bf640['test'](_0x3de8a8[_0x1703('0x15')])){_0x3de8a8['html']=_0x3de8a8[_0x1703('0x15')][_0x1703('0x16')](_0x2bf640,'');}if(_0x3de8a8[_0x1703('0x15')][_0x1703('0x17')](_0x1703('0x18'))){var _0x49d7ab=[];_0x3de8a8['attachments'][_0x1703('0x19')](_0xc49ec=>{_0x49d7ab[_0x1703('0x1a')](_0xc49ec['filename']);});var _0x3c23ea=/]+>/g;var _0x2a6184=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2be6a7=_0x3de8a8[_0x1703('0x15')]['replace'](_0x2a6184,'_SRC');var _0x38afcf=_0x2be6a7[_0x1703('0x16')](_0x3c23ea,'_IMG');for(let _0xa68518=0x0;_0xa68518<_0x49d7ab[_0x1703('0xf')];_0xa68518++){var _0x2adee6=_0x38afcf[_0x1703('0x16')]('_IMG','\x20[Attachment:\x20'+_0x49d7ab[_0xa68518]+'\x20]');_0x38afcf=_0x2adee6;}_0x3de8a8[_0x1703('0x15')]=_0x38afcf;}_0x4fdf8e[_0x1703('0x1b')]=_0x3de8a8[_0x1703('0x15')];}else{_0x4fdf8e['body']=_0x3de8a8[_0x1703('0x1c')];}if(_0x4fdf8e[_0x1703('0x1b')]){_0x4fdf8e[_0x1703('0x1b')]=_0x4fdf8e[_0x1703('0x1b')][_0x1703('0x16')](/0x0){var _0x4f3dc6=['Auto-Submitted:\x20auto-replied',_0x1703('0x2e'),_0x1703('0x2f')];for(var _0x13e315=0x0;_0x13e315<_0x3de8a8['headerLines'][_0x1703('0xf')];_0x13e315++){var _0x31644e=_[_0x1703('0xd')](_0x4f3dc6,_0x3de8a8['headerLines'][_0x13e315][_0x1703('0x30')]);if(_0x31644e>=0x0){_0x4fdf8e[_0x1703('0x31')]=!![];}}}return _0x4fdf8e;}exports[_0x1703('0x32')]=function(_0x320723,_0x34b455,_0x3ae54e){var _0x48e424={'from':getAddress(_0x34b455['from']),'firstName':getFirstName(_0x34b455[_0x1703('0x33')]),'lastName':getLastName(_0x34b455['from']),'mapKey':_0x1703('0x5'),'message':{'from':getMails(_0x320723[_0x1703('0x5')],_0x34b455[_0x1703('0x33')]),'to':_0x320723[_0x1703('0x5')],'cc':'','subject':_0x34b455[_0x1703('0x34')]||'','messageId':_0x34b455[_0x1703('0x35')],'inReplyTo':_0x34b455[_0x1703('0x36')],'sentAt':moment(_0x34b455['date'])[_0x1703('0x25')](_0x1703('0x37')),'attach':![],'attachments':[]}};if(!_0x34b455[_0x1703('0x15')]&&!_0x34b455[_0x1703('0x1c')]){var _0x1f05ef=_[_0x1703('0x38')](_0x34b455['attachments'],{'contentType':_0x1703('0x39')});if(_0x1f05ef[_0x1703('0xf')]){logger['info'](util[_0x1703('0x25')](_0x1703('0x3a'),_0x34b455[_0x1703('0x35')]));tnef[_0x1703('0x3b')](_[_0x1703('0x3c')](_0x1f05ef)[_0x1703('0x2b')],function(_0x590ce3,_0x76ebd4){if(_0x76ebd4){_0x34b455['html']=_0x76ebd4[_0x1703('0x3d')]||_0x1703('0x3e');if(_0x76ebd4[_0x1703('0x3f')]){for(var _0x55d96f=0x0;_0x55d96f<_0x76ebd4['Attachments']['length'];_0x55d96f++){var _0x425f68=_0x76ebd4[_0x1703('0x3f')][_0x55d96f];_0x48e424[_0x1703('0x1f')]['attachments'][_0x1703('0x1a')]({'filename':_0x425f68[_0x1703('0x40')],'content':Buffer[_0x1703('0x33')](_0x425f68[_0x1703('0x41')])});}}}_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));});}else{_0x34b455[_0x1703('0x15')]=_0x1703('0x3e');_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));}}else{_0x3ae54e(parseEmail(_0x320723,_0x34b455,_0x48e424));}};exports[_0x1703('0x42')]=function(_0xf23be8){switch(_0xf23be8){case _0x1703('0x43'):return'imap.gmail.com';case _0x1703('0x44'):return _0x1703('0x45');case _0x1703('0x46'):return _0x1703('0x47');case _0x1703('0x48'):return _0x1703('0x49');}return'127.0.0.1';}; \ No newline at end of file +var _0x62f1=['body','message','originTo','originCc','bcc','attach','type','attachment-','now','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','from','subject','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','@xcally.com','value','name','substring','split','slice','join','Anonymous','length','pop','isEmpty','anonymous','html','test','replace','includes','','textAsHtml'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x62f1,0x112));var _0x162f=function(_0x523cba,_0xace434){_0x523cba=_0x523cba-0x0;var _0x5d52c7=_0x62f1[_0x523cba];return _0x5d52c7;};'use strict';var _=require(_0x162f('0x0'));var moment=require('moment');var random=require(_0x162f('0x1'));var fs=require('fs');var path=require(_0x162f('0x2'));var util=require(_0x162f('0x3'));var tnef=require(_0x162f('0x4'));var logger=require(_0x162f('0x5'))(_0x162f('0x6'));var config=require(_0x162f('0x7'));function getAddress(_0x223f35){var _0xfc0863=_[_0x162f('0x8')](_0x223f35['value']);return _0xfc0863&&_0xfc0863[_0x162f('0x9')]?_0xfc0863[_0x162f('0x9')]:'anonymous'+random[_0x162f('0xa')](0x6)+_0x162f('0xb');}function getFirstName(_0xcb0ac4){var _0x57d030=_[_0x162f('0x8')](_0xcb0ac4[_0x162f('0xc')]);if(_0x57d030&&_0x57d030[_0x162f('0xd')]){if(_0x57d030[_0x162f('0xd')]==_0x57d030['address']){return _0x57d030[_0x162f('0xd')][_0x162f('0xe')](0x0,_0x57d030[_0x162f('0xd')]['indexOf']('@'));}var _0x577238=_0x57d030['name'][_0x162f('0xf')](/\s+/);return _0x577238['length']>0x1?_0x577238[_0x162f('0x10')](0x0,-0x1)[_0x162f('0x11')]('\x20'):_0x57d030[_0x162f('0xd')];}return _0x162f('0x12');}function getLastName(_0x5f0689){var _0x3e4f60=_[_0x162f('0x8')](_0x5f0689[_0x162f('0xc')]);if(_0x3e4f60&&_0x3e4f60[_0x162f('0xd')]){var _0x567f37=_0x3e4f60[_0x162f('0xd')]['split'](/\s+/);return _0x567f37[_0x162f('0x13')]>0x1?_0x567f37[_0x162f('0x14')]():'';}return'';}function getMails(_0x40a284,_0x8990f3){var _0x55026b='';for(var _0x59e11d=0x0;_0x59e11d<_0x8990f3[_0x162f('0xc')][_0x162f('0x13')];_0x59e11d+=0x1){if(_0x8990f3[_0x162f('0xc')][_0x59e11d][_0x162f('0x9')]!==_0x40a284){if(!_[_0x162f('0x15')](_0x55026b)){_0x55026b+=',';}_0x55026b+=_0x8990f3[_0x162f('0xc')][_0x59e11d][_0x162f('0xd')]||_0x8990f3['value'][_0x59e11d][_0x162f('0x9')]||'';_0x55026b+='\x20<';_0x55026b+=_0x8990f3['value'][_0x59e11d][_0x162f('0x9')]?_0x8990f3[_0x162f('0xc')][_0x59e11d]['address']:_0x162f('0x16')+random[_0x162f('0xa')](0x6)+'@xcally.com';_0x55026b+='>';}}return _0x55026b;}function parseEmail(_0x225ec6,_0x436a5a,_0x3f3092){if(_0x436a5a[_0x162f('0x17')]){var _0x5dc1a7=/)<[^<]*)*<\/script>/gi;while(_0x5dc1a7[_0x162f('0x18')](_0x436a5a[_0x162f('0x17')])){_0x436a5a[_0x162f('0x17')]=_0x436a5a[_0x162f('0x17')][_0x162f('0x19')](_0x5dc1a7,'');}if(_0x436a5a[_0x162f('0x17')][_0x162f('0x1a')](_0x162f('0x1b'))){var _0x56fdda=[];_0x436a5a[_0x162f('0x1c')][_0x162f('0x1d')](_0x2dda84=>{_0x56fdda[_0x162f('0x1e')](_0x2dda84['filename']);});var _0x2fc293=/]+>/g;var _0x58af8a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1e25d5=_0x436a5a['html'][_0x162f('0x19')](_0x58af8a,'_SRC');var _0x1414dd=_0x1e25d5['replace'](_0x2fc293,_0x162f('0x1f'));for(let _0x14706e=0x0;_0x14706e<_0x56fdda[_0x162f('0x13')];_0x14706e++){var _0x50fb25=_0x1414dd['replace']('_IMG','\x20[Attachment:\x20'+_0x56fdda[_0x14706e]+_0x162f('0x20'));_0x1414dd=_0x50fb25;}_0x436a5a[_0x162f('0x17')]=_0x1414dd;}_0x3f3092['body']=_0x436a5a['html'];}else{_0x3f3092['body']=_0x436a5a[_0x162f('0x21')];}if(_0x3f3092['body']){_0x3f3092[_0x162f('0x22')]=_0x3f3092[_0x162f('0x22')]['replace'](/0x0){var _0x258eb6=[_0x162f('0x2f'),_0x162f('0x30'),_0x162f('0x31')];for(var _0x481dd7=0x0;_0x481dd7<_0x436a5a[_0x162f('0x2e')][_0x162f('0x13')];_0x481dd7++){var _0x364970=_[_0x162f('0x32')](_0x258eb6,_0x436a5a['headerLines'][_0x481dd7][_0x162f('0x33')]);if(_0x364970>=0x0){_0x3f3092[_0x162f('0x34')]=!![];}}}return _0x3f3092;}exports['parser']=function(_0x8c8443,_0x21dd30,_0x10d62f){var _0xdc4eaa={'from':getAddress(_0x21dd30[_0x162f('0x35')]),'firstName':getFirstName(_0x21dd30[_0x162f('0x35')]),'lastName':getLastName(_0x21dd30[_0x162f('0x35')]),'mapKey':'email','message':{'from':getMails(_0x8c8443[_0x162f('0x6')],_0x21dd30[_0x162f('0x35')]),'to':_0x8c8443['email'],'cc':'','subject':_0x21dd30[_0x162f('0x36')]||'','messageId':_0x21dd30[_0x162f('0x37')],'inReplyTo':_0x21dd30['inReplyTo'],'sentAt':moment(_0x21dd30[_0x162f('0x38')])[_0x162f('0x39')](_0x162f('0x3a')),'attach':![],'attachments':[]}};if(!_0x21dd30[_0x162f('0x17')]&&!_0x21dd30[_0x162f('0x21')]){var _0x1fb0a3=_[_0x162f('0x3b')](_0x21dd30[_0x162f('0x1c')],{'contentType':_0x162f('0x3c')});if(_0x1fb0a3[_0x162f('0x13')]){logger[_0x162f('0x3d')](util[_0x162f('0x39')](_0x162f('0x3e'),_0x21dd30[_0x162f('0x37')]));tnef['parseBuffer'](_[_0x162f('0x3f')](_0x1fb0a3)[_0x162f('0x2c')],function(_0x5d23cb,_0x518fa6){if(_0x518fa6){_0x21dd30[_0x162f('0x17')]=_0x518fa6['BodyHTML']||_0x162f('0x40');if(_0x518fa6['Attachments']){for(var _0x1e936b=0x0;_0x1e936b<_0x518fa6['Attachments'][_0x162f('0x13')];_0x1e936b++){var _0x2d97c7=_0x518fa6[_0x162f('0x41')][_0x1e936b];_0xdc4eaa[_0x162f('0x23')][_0x162f('0x1c')][_0x162f('0x1e')]({'filename':_0x2d97c7[_0x162f('0x42')],'content':Buffer[_0x162f('0x35')](_0x2d97c7[_0x162f('0x43')])});}}}_0x10d62f(parseEmail(_0x8c8443,_0x21dd30,_0xdc4eaa));});}else{_0x21dd30['html']=_0x162f('0x40');_0x10d62f(parseEmail(_0x8c8443,_0x21dd30,_0xdc4eaa));}}else{_0x10d62f(parseEmail(_0x8c8443,_0x21dd30,_0xdc4eaa));}};exports[_0x162f('0x44')]=function(_0x4c6833){switch(_0x4c6833){case _0x162f('0x45'):return _0x162f('0x46');case _0x162f('0x47'):return _0x162f('0x48');case _0x162f('0x49'):return'imap-mail.outlook.com';case _0x162f('0x4a'):return _0x162f('0x4b');}return _0x162f('0x4c');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b80e77e..2aeffb8 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 _0x619e=['key','SERV','active','Imap','Smtp','exports','name'];(function(_0x48530e,_0x14a74a){var _0x21ee5d=function(_0x4fd7ca){while(--_0x4fd7ca){_0x48530e['push'](_0x48530e['shift']());}};_0x21ee5d(++_0x14a74a);}(_0x619e,0x180));var _0xe619=function(_0x593f13,_0x4301b0){_0x593f13=_0x593f13-0x0;var _0x5e702c=_0x619e[_0x593f13];return _0x5e702c;};'use strict';var _=require('lodash');function MailAccount(_0x4b2c1e){this['id']=_0x4b2c1e['id']||0x0;this[_0xe619('0x0')]=_0x4b2c1e[_0xe619('0x0')]||'Service';this[_0xe619('0x1')]=_0x4b2c1e[_0xe619('0x1')]||_0xe619('0x2');this[_0xe619('0x3')]=_0x4b2c1e['active']||![];this[_0xe619('0x4')]=_0x4b2c1e[_0xe619('0x4')]||[];this[_0xe619('0x5')]=_0x4b2c1e['Smtp']||[];}module[_0xe619('0x6')]=MailAccount; \ No newline at end of file +var _0xef7c=['Smtp','exports','name','Service','key','active','Imap'];(function(_0x2d8207,_0x65db9){var _0x3200a7=function(_0x331064){while(--_0x331064){_0x2d8207['push'](_0x2d8207['shift']());}};_0x3200a7(++_0x65db9);}(_0xef7c,0x1a6));var _0xcef7=function(_0x55dc69,_0x422f96){_0x55dc69=_0x55dc69-0x0;var _0x530a33=_0xef7c[_0x55dc69];return _0x530a33;};'use strict';var _=require('lodash');function MailAccount(_0x2e73fc){this['id']=_0x2e73fc['id']||0x0;this[_0xcef7('0x0')]=_0x2e73fc[_0xcef7('0x0')]||_0xcef7('0x1');this[_0xcef7('0x2')]=_0x2e73fc[_0xcef7('0x2')]||'SERV';this[_0xcef7('0x3')]=_0x2e73fc[_0xcef7('0x3')]||![];this[_0xcef7('0x4')]=_0x2e73fc[_0xcef7('0x4')]||[];this[_0xcef7('0x5')]=_0x2e73fc[_0xcef7('0x5')]||[];}module[_0xcef7('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index c194dfa..c587ca4 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 _0xc9ed=['isUndefined','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0xc9ed,0x158));var _0xdc9e=function(_0x590649,_0x28f93d){_0x590649=_0x590649-0x0;var _0x4e1806=_0xc9ed[_0x590649];return _0x4e1806;};'use strict';var _=require(_0xdc9e('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xdc9e('0x1')]={};};function freeIsNotKey(_0x205be8,_0x323bb4,_0xcf7aa7){var _0x240f63=_[_0xdc9e('0x2')](_0x205be8,function(_0x437c6c,_0x4dcc39){return _0x437c6c[_0xcf7aa7];});for(var _0x337fab in _0x323bb4){if(_0x323bb4[_0xdc9e('0x3')](_0x337fab)){if(!_0x240f63[_0x337fab]){delete _0x323bb4[_0x337fab];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3f9202,_0x3825a3){for(var _0x33c850 in _0x3825a3){if(_0x3f9202[_0xdc9e('0x3')](_0x33c850)){_0x3f9202[_0x33c850]=_0x3825a3[_0x33c850];}}};Realtime[_0xdc9e('0x4')][_0xdc9e('0x5')]=function(){var _0x53be04=this;return function(_0xb7eb6b){if(_0xb7eb6b){freeIsNotKey(_0xb7eb6b,_0x53be04[_0xdc9e('0x1')],'id');for(var _0x303744=0x0,_0x36d375={},_0x539242={};_0x303744<_0xb7eb6b[_0xdc9e('0x6')];_0x303744+=0x1){_0x36d375=_0xb7eb6b[_0x303744];if(_[_0xdc9e('0x7')](_0x53be04[_0xdc9e('0x1')][_0x36d375['id']])){_0x53be04[_0xdc9e('0x1')][_0x36d375['id']]=new MailAccount(_0x36d375);}else{_['merge'](_0x53be04[_0xdc9e('0x1')][_0x36d375['id']],_0x36d375);}}}return _0x53be04['mailAccounts'];};};module[_0xdc9e('0x8')]=Realtime; \ No newline at end of file +var _0x7a1d=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x51c124,_0x4fd259){var _0x5e8969=function(_0x5d5977){while(--_0x5d5977){_0x51c124['push'](_0x51c124['shift']());}};_0x5e8969(++_0x4fd259);}(_0x7a1d,0x1a1));var _0xd7a1=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x7a1d[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0xd7a1('0x0'));var MailAccount=require(_0xd7a1('0x1'));var Realtime=function(){this[_0xd7a1('0x2')]={};};function freeIsNotKey(_0x32401f,_0x1df344,_0x9ac59c){var _0x2214ab=_[_0xd7a1('0x3')](_0x32401f,function(_0x39344c,_0x7efd27){return _0x39344c[_0x9ac59c];});for(var _0x5148ff in _0x1df344){if(_0x1df344[_0xd7a1('0x4')](_0x5148ff)){if(!_0x2214ab[_0x5148ff]){delete _0x1df344[_0x5148ff];}}}}Realtime[_0xd7a1('0x5')][_0xd7a1('0x6')]=function(_0x5820c3,_0x3226da){for(var _0x312f27 in _0x3226da){if(_0x5820c3['hasOwnProperty'](_0x312f27)){_0x5820c3[_0x312f27]=_0x3226da[_0x312f27];}}};Realtime[_0xd7a1('0x5')][_0xd7a1('0x7')]=function(){var _0x5f1663=this;return function(_0x420b20){if(_0x420b20){freeIsNotKey(_0x420b20,_0x5f1663[_0xd7a1('0x2')],'id');for(var _0x1cbaab=0x0,_0x4bb341={},_0x2207e9={};_0x1cbaab<_0x420b20[_0xd7a1('0x8')];_0x1cbaab+=0x1){_0x4bb341=_0x420b20[_0x1cbaab];if(_[_0xd7a1('0x9')](_0x5f1663['mailAccounts'][_0x4bb341['id']])){_0x5f1663[_0xd7a1('0x2')][_0x4bb341['id']]=new MailAccount(_0x4bb341);}else{_[_0xd7a1('0xa')](_0x5f1663[_0xd7a1('0x2')][_0x4bb341['id']],_0x4bb341);}}}return _0x5f1663[_0xd7a1('0x2')];};};module[_0xd7a1('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7de4302..b37740c 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 _0x7f7e=['getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','email','key','ListId','Imap','MailServerOut','Smtp'];(function(_0x994e65,_0x3c7807){var _0x1773d1=function(_0x15d7c2){while(--_0x15d7c2){_0x994e65['push'](_0x994e65['shift']());}};_0x1773d1(++_0x3c7807);}(_0x7f7e,0xc6));var _0xe7f7=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7f7e[_0x46698a];return _0x356db0;};'use strict';var client=require(_0xe7f7('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xe7f7('0x1')](_0xe7f7('0x2'),{'options':{'attributes':['id',_0xe7f7('0x3'),'service',_0xe7f7('0x4'),'active',_0xe7f7('0x5'),_0xe7f7('0x6'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xe7f7('0x7')},{'model':_0xe7f7('0x8'),'as':_0xe7f7('0x9')}]},'log':_0xe7f7('0xa')});};};exports[_0xe7f7('0xb')]=function(_0x4f7cbe,_0x1edbe6){return client[_0xe7f7('0x1')]('NotifyMailAccount',{'account':{'id':_0x4f7cbe},'body':_0x1edbe6,'log':_0xe7f7('0xc')});}; \ No newline at end of file +var _0xda91=['name','service','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','NotifyMailAccount','../client','Request','GetMailAccount'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xda91,0x72));var _0x1da9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xda91[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x1da9('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x1da9('0x1')](_0x1da9('0x2'),{'options':{'attributes':['id',_0x1da9('0x3'),_0x1da9('0x4'),'email','active',_0x1da9('0x5'),_0x1da9('0x6'),_0x1da9('0x7')],'raw':![],'include':[{'model':_0x1da9('0x8'),'as':_0x1da9('0x9')},{'model':_0x1da9('0xa'),'as':_0x1da9('0xb')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x213939,_0x55342e){return client[_0x1da9('0x1')](_0x1da9('0xc'),{'account':{'id':_0x213939},'body':_0x55342e,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2b80f19..a19f744 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 _0x6944=['ShowSetting','../client','getSettings'];(function(_0x3dcb8d,_0x3f9a35){var _0x3715f5=function(_0x440612){while(--_0x440612){_0x3dcb8d['push'](_0x3dcb8d['shift']());}};_0x3715f5(++_0x3f9a35);}(_0x6944,0x169));var _0x4694=function(_0x54d79f,_0x137980){_0x54d79f=_0x54d79f-0x0;var _0x4b6772=_0x6944[_0x54d79f];return _0x4b6772;};'use strict';var client=require(_0x4694('0x0'));exports[_0x4694('0x1')]=function(){return client['Request'](_0x4694('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x8280=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x8280,0x1e7));var _0x0828=function(_0x3766d5,_0x27c59d){_0x3766d5=_0x3766d5-0x0;var _0x40c5e9=_0x8280[_0x3766d5];return _0x40c5e9;};'use strict';var client=require(_0x0828('0x0'));exports[_0x0828('0x1')]=function(){return client[_0x0828('0x2')](_0x0828('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0828('0x4')]},'log':_0x0828('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 6f30024..dff4713 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 79e678f..3d76970 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 _0xdae5=['timeout','listen','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','ioredis'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xdae5,0x16c));var _0x5dae=function(_0x3900da,_0x3b01e8){_0x3900da=_0x3900da-0x0;var _0x357178=_0xdae5[_0x3900da];return _0x357178;};'use strict';var _=require(_0x5dae('0x0'));var http=require('http');var express=require(_0x5dae('0x1'));var sticky=require(_0x5dae('0x2'));var Redis=require(_0x5dae('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x5dae('0x4')]=0xdbba0;if(sticky[_0x5dae('0x5')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x5dae('0x6'),'polling']});config['redis']=_[_0x5dae('0x7')](config[_0x5dae('0x8')],{'host':_0x5dae('0x9'),'port':0x18eb});socketio[_0x5dae('0xa')](require(_0x5dae('0xb'))({'pubClient':new Redis(config[_0x5dae('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x5dae('0xc'))['default']();require(_0x5dae('0xd'))[_0x5dae('0xe')](socketio);require(_0x5dae('0xf'))[_0x5dae('0xe')](app);require(_0x5dae('0x10'))[_0x5dae('0xe')](app);}else{server[_0x5dae('0x11')](_0x5dae('0x12'),function(){console[_0x5dae('0x13')](_0x5dae('0x14'),config[_0x5dae('0x15')]);});}exports=module[_0x5dae('0x16')]=app; \ No newline at end of file +var _0xa659=['../../routes','once','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','port','socket.io','websocket','polling','defaults','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/express'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa659,0xa3));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a65('0x0'));var http=require('http');var express=require(_0x9a65('0x1'));var sticky=require(_0x9a65('0x2'));var Redis=require(_0x9a65('0x3'));var config=require(_0x9a65('0x4'));var app=express();var server=http[_0x9a65('0x5')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x9a65('0x6')])){var socketio=require(_0x9a65('0x7'))(server,{'transports':[_0x9a65('0x8'),_0x9a65('0x9')]});config['redis']=_[_0x9a65('0xa')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x9a65('0xb')](require(_0x9a65('0xc'))({'pubClient':new Redis(config[_0x9a65('0xd')]),'subClient':new Redis(config[_0x9a65('0xd')])}));require(_0x9a65('0xe'))[_0x9a65('0xf')]();require('../../config/socketio')[_0x9a65('0xf')](socketio);require(_0x9a65('0x10'))[_0x9a65('0xf')](app);require(_0x9a65('0x11'))[_0x9a65('0xf')](app);}else{server[_0x9a65('0x12')]('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x9a65('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fdd010f..84890be 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 _0x6111=['request','then','rpc','error','routing','message','catch','exports','jayson/promise','bluebird','Request'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x6111,0xad));var _0x1611=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6111[_0x19e35c];return _0x3e1fe8;};'use strict';var jayson=require(_0x1611('0x0'));var BPromise=require(_0x1611('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client']['http']({'port':0x2329});client[_0x1611('0x2')]=function(_0x4f06a1,_0x48078c){return new BPromise(function(_0x4fc4a6,_0x1d4fbc){return client[_0x1611('0x3')](_0x4f06a1,_0x48078c)[_0x1611('0x4')](function(_0x2c9b41){logger['debug'](_0x1611('0x5'),'routing',_0x4f06a1,_0x48078c,_0x2c9b41);if(_0x2c9b41[_0x1611('0x6')]){logger[_0x1611('0x6')](_0x1611('0x5'),_0x1611('0x7'),_0x4f06a1,_0x2c9b41[_0x1611('0x6')]['message'],_0x48078c);return _0x1d4fbc(_0x2c9b41[_0x1611('0x6')][_0x1611('0x8')]);}else{return _0x4fc4a6(_0x2c9b41['result']);}})[_0x1611('0x9')](function(_0x2c2b73){logger[_0x1611('0x6')](_0x1611('0x5'),_0x1611('0x7'),_0x4f06a1,_0x2c2b73,_0x48078c);return _0x1d4fbc(_0x2c2b73);});});};module[_0x1611('0xa')]=client; \ No newline at end of file +var _0x6b6d=['exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','debug','rpc','error','message','result','catch'];(function(_0x1844a1,_0x269961){var _0x56e90e=function(_0x380761){while(--_0x380761){_0x1844a1['push'](_0x1844a1['shift']());}};_0x56e90e(++_0x269961);}(_0x6b6d,0xb7));var _0xd6b6=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x6b6d[_0x209fcd];return _0x501d5e;};'use strict';var jayson=require(_0xd6b6('0x0'));var BPromise=require(_0xd6b6('0x1'));var logger=require(_0xd6b6('0x2'))(_0xd6b6('0x3'));var client=jayson['client'][_0xd6b6('0x4')]({'port':0x2329});client[_0xd6b6('0x5')]=function(_0x212d5f,_0x25b7ce){return new BPromise(function(_0x1f89ec,_0x149015){return client[_0xd6b6('0x6')](_0x212d5f,_0x25b7ce)['then'](function(_0x215f36){logger[_0xd6b6('0x7')](_0xd6b6('0x8'),_0xd6b6('0x3'),_0x212d5f,_0x25b7ce,_0x215f36);if(_0x215f36[_0xd6b6('0x9')]){logger[_0xd6b6('0x9')](_0xd6b6('0x8'),_0xd6b6('0x3'),_0x212d5f,_0x215f36['error'][_0xd6b6('0xa')],_0x25b7ce);return _0x149015(_0x215f36[_0xd6b6('0x9')][_0xd6b6('0xa')]);}else{return _0x1f89ec(_0x215f36[_0xd6b6('0xb')]);}})[_0xd6b6('0xc')](function(_0x3a7c2f){logger[_0xd6b6('0x9')](_0xd6b6('0x8'),_0xd6b6('0x3'),_0x212d5f,_0x3a7c2f,_0x25b7ce);return _0x149015(_0x3a7c2f);});});};module[_0xd6b6('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index d67faa6..027d98e 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 _0x2787=['initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues'];(function(_0x5cd1d6,_0x198b55){var _0x397fdc=function(_0x201d6b){while(--_0x201d6b){_0x5cd1d6['push'](_0x5cd1d6['shift']());}};_0x397fdc(++_0x198b55);}(_0x2787,0xf8));var _0x7278=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2787[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0x7278('0x0'));var server=require(_0x7278('0x1'));var Realtime=require(_0x7278('0x2'));var user=require(_0x7278('0x3'));var interval=require(_0x7278('0x4'));var openchannelQueue=require(_0x7278('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x7278('0x6'));var mailQueue=require(_0x7278('0x7'));var faxQueue=require(_0x7278('0x8'));var whatsappQueue=require(_0x7278('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7278('0xa')]()['then'](user[_0x7278('0xb')]())[_0x7278('0xc')](realtime[_0x7278('0xd')]())['then'](interval[_0x7278('0xe')]())[_0x7278('0xc')](realtime[_0x7278('0xf')]())[_0x7278('0xc')](openchannelQueue[_0x7278('0x10')]())[_0x7278('0xc')](realtime[_0x7278('0x11')]())[_0x7278('0xc')](chatQueue[_0x7278('0x12')]())[_0x7278('0xc')](realtime[_0x7278('0x13')]())[_0x7278('0xc')](smsQueue[_0x7278('0x14')]())['then'](realtime['initSmsQueues']())[_0x7278('0xc')](mailQueue['getMailQueues']())['then'](realtime[_0x7278('0x15')]())[_0x7278('0xc')](faxQueue['getFaxQueues']())['then'](realtime[_0x7278('0x16')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x7278('0xc')](realtime[_0x7278('0x17')]())[_0x7278('0xc')](function(){return realtime;});}function main(){return server[_0x7278('0x18')](realtime)[_0x7278('0xc')](function(_0x40c89a){return initRealtime();})[_0x7278('0xc')](function(_0x5e8d6a){return setInterval(initRealtime,0x1388);})[_0x7278('0x19')](function(_0x44af3f){console[_0x7278('0x1a')](_0x44af3f);});}main(); \ No newline at end of file +var _0x4f7f=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','bluebird','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x2b14c3,_0x1fa8b9){var _0x4afada=function(_0x3fc392){while(--_0x3fc392){_0x2b14c3['push'](_0x2b14c3['shift']());}};_0x4afada(++_0x1fa8b9);}(_0x4f7f,0xa4));var _0xf4f7=function(_0x3cd440,_0xd01e50){_0x3cd440=_0x3cd440-0x0;var _0x55ae8e=_0x4f7f[_0x3cd440];return _0x55ae8e;};'use strict';var BPromise=require(_0xf4f7('0x0'));var server=require(_0xf4f7('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xf4f7('0x2'));var openchannelQueue=require(_0xf4f7('0x3'));var chatQueue=require(_0xf4f7('0x4'));var smsQueue=require(_0xf4f7('0x5'));var mailQueue=require(_0xf4f7('0x6'));var faxQueue=require(_0xf4f7('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xf4f7('0x8')]()[_0xf4f7('0x9')](user['getAgents']())[_0xf4f7('0x9')](realtime[_0xf4f7('0xa')]())[_0xf4f7('0x9')](interval[_0xf4f7('0xb')]())[_0xf4f7('0x9')](realtime[_0xf4f7('0xc')]())[_0xf4f7('0x9')](openchannelQueue[_0xf4f7('0xd')]())['then'](realtime[_0xf4f7('0xe')]())[_0xf4f7('0x9')](chatQueue[_0xf4f7('0xf')]())[_0xf4f7('0x9')](realtime[_0xf4f7('0x10')]())['then'](smsQueue[_0xf4f7('0x11')]())[_0xf4f7('0x9')](realtime[_0xf4f7('0x12')]())[_0xf4f7('0x9')](mailQueue[_0xf4f7('0x13')]())[_0xf4f7('0x9')](realtime[_0xf4f7('0x14')]())[_0xf4f7('0x9')](faxQueue[_0xf4f7('0x15')]())['then'](realtime[_0xf4f7('0x16')]())[_0xf4f7('0x9')](whatsappQueue[_0xf4f7('0x17')]())[_0xf4f7('0x9')](realtime[_0xf4f7('0x18')]())[_0xf4f7('0x9')](function(){return realtime;});}function main(){return server[_0xf4f7('0x19')](realtime)[_0xf4f7('0x9')](function(_0x15fba8){return initRealtime();})[_0xf4f7('0x9')](function(_0x43789c){return setInterval(initRealtime,0x1388);})['catch'](function(_0x14141a){console['log'](_0x14141a);});}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 8aea705..cbe69bb 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x4d5eae,_0x1a3119){var _0x2ca824=function(_0x16a550){while(--_0x16a550){_0x4d5eae['push'](_0x4d5eae['shift']());}};_0x2ca824(++_0x1a3119);}(_0x7a54,0x106));var _0x47a5=function(_0x4a010c,_0x2dfcf7){_0x4a010c=_0x4a010c-0x0;var _0x409222=_0x7a54[_0x4a010c];return _0x409222;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0x1261[_0x451d04];return _0x32c6fe;};'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 cb6e05e..71182da 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 _0x9621=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x47a204,_0x24b906){var _0x5623fc=function(_0x4404ac){while(--_0x4404ac){_0x47a204['push'](_0x47a204['shift']());}};_0x5623fc(++_0x24b906);}(_0x9621,0xeb));var _0x1962=function(_0x1d3416,_0x3b6b97){_0x1d3416=_0x1d3416-0x0;var _0x448885=_0x9621[_0x1d3416];return _0x448885;};'use strict';var BPromise=require(_0x1962('0x0'));var jayson=require(_0x1962('0x1'));var client=jayson[_0x1962('0x2')][_0x1962('0x3')]({'port':0x232b});function request(_0x58ea4e,_0x87b128){return new BPromise(function(_0x34ba85,_0x109982){return client[_0x1962('0x4')](_0x58ea4e,_0x87b128)[_0x1962('0x5')](function(_0x302136){if(_0x302136[_0x1962('0x6')]){return _0x109982(_0x302136[_0x1962('0x6')][_0x1962('0x7')]);}else{return _0x34ba85(_0x302136['result']);}})['catch'](function(_0x4d4932){return _0x109982(_0x4d4932);});});}exports['sendMailMessage']=function(_0x266863,_0x17092a){return request(_0x1962('0x8'),{'account':_0x266863,'message':_0x17092a});}; \ No newline at end of file +var _0x3d9e=['bluebird','client','request','error','catch','sendMailMessage','SendMail'];(function(_0x52757d,_0x15565a){var _0x3b72dc=function(_0x2eaa33){while(--_0x2eaa33){_0x52757d['push'](_0x52757d['shift']());}};_0x3b72dc(++_0x15565a);}(_0x3d9e,0x1ce));var _0xe3d9=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x3d9e[_0x1fa841];return _0x384b67;};'use strict';var BPromise=require(_0xe3d9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xe3d9('0x1')]['http']({'port':0x232b});function request(_0x278696,_0x2cb8b2){return new BPromise(function(_0x4ec9cc,_0x4ff023){return client[_0xe3d9('0x2')](_0x278696,_0x2cb8b2)['then'](function(_0xa18b82){if(_0xa18b82[_0xe3d9('0x3')]){return _0x4ff023(_0xa18b82['error']['message']);}else{return _0x4ec9cc(_0xa18b82['result']);}})[_0xe3d9('0x4')](function(_0x15599a){return _0x4ff023(_0x15599a);});});}exports[_0xe3d9('0x5')]=function(_0x3b6a8d,_0x34e913){return request(_0xe3d9('0x6'),{'account':_0x3b6a8d,'message':_0x34e913});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index c6e3ff5..a1fdb28 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 _0x9a75=['smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','sms','Status','toNumber','chatCurrentCapacity','openchannelCurrentCapacity','emit','user:save','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9a75,0xf1));var _0x59a7=function(_0x312387,_0x4e0e85){_0x312387=_0x312387-0x0;var _0x224945=_0x9a75[_0x312387];return _0x224945;};'use strict';var _=require(_0x59a7('0x0'));var moment=require(_0x59a7('0x1'));var md5=require(_0x59a7('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x59a7('0x3')]=_[_0x59a7('0x4')](config[_0x59a7('0x3')],{'host':_0x59a7('0x5'),'port':0x18eb});var io=require(_0x59a7('0x6'))(new Redis(config[_0x59a7('0x3')]));function Agent(_0x5bc325){this['id']=_0x5bc325['id']||0x0;this[_0x59a7('0x7')]=_0x5bc325[_0x59a7('0x7')]||'';this['online']=_0x5bc325[_0x59a7('0x8')]||!![];this[_0x59a7('0x9')]=_0x5bc325[_0x59a7('0x9')]||![];this[_0x59a7('0xa')]=_0x5bc325[_0x59a7('0xa')]||![];this[_0x59a7('0xb')]=_0x5bc325[_0x59a7('0xb')]||![];this[_0x59a7('0xc')]=_0x5bc325[_0x59a7('0xc')]||![];this[_0x59a7('0xd')]=_0x5bc325['smsPause']||![];this[_0x59a7('0xe')]=_0x5bc325[_0x59a7('0xe')]||![];this[_0x59a7('0xf')]=_0x59a7('0x10');this[_0x59a7('0x11')]=0x0;this[_0x59a7('0x12')]=_0x5bc325[_0x59a7('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x59a7('0x13')]=_0x59a7('0x10');this[_0x59a7('0x14')]=0x0;this['mailCapacity']=_0x5bc325[_0x59a7('0x15')]||0x0;this[_0x59a7('0x16')]=0x0;this[_0x59a7('0x17')]=_0x59a7('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x5bc325[_0x59a7('0x18')]||0x0;this[_0x59a7('0x19')]=0x0;this[_0x59a7('0x1a')]=_0x59a7('0x10');this[_0x59a7('0x1b')]=0x0;this[_0x59a7('0x1c')]=_0x5bc325[_0x59a7('0x1c')]||0x0;this[_0x59a7('0x1d')]=0x0;this[_0x59a7('0x1e')]=_0x59a7('0x10');this[_0x59a7('0x1f')]=0x0;this[_0x59a7('0x20')]=_0x5bc325['whatsappCapacity']||0x0;this[_0x59a7('0x21')]=0x0;this[_0x59a7('0x22')]=_0x59a7('0x10');this[_0x59a7('0x23')]=0x0;this[_0x59a7('0x24')]=_0x5bc325['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x59a7('0x25')]=![];this[_0x59a7('0x26')]=undefined;this[_0x59a7('0x2')]='';this['updateRealtime']();}Agent[_0x59a7('0x27')][_0x59a7('0x28')]=function(_0x25843a){if(this[_0x25843a+_0x59a7('0x29')]>0x0){if(this[_0x25843a+_0x59a7('0x2a')]>0x0&&this[_0x25843a+_0x59a7('0x29')]>=this[_0x25843a+_0x59a7('0x2a')]){return _0x59a7('0x2b');}else{return _0x59a7('0x2c');}}else{return'idle';}};Agent[_0x59a7('0x27')][_0x59a7('0x2d')]=function(){var _0x30fca6=['mail',_0x59a7('0x2e'),'openchannel','fax',_0x59a7('0x2f'),'whatsapp'];for(var _0x272db9=0x0;_0x272db9<_0x30fca6['length'];_0x272db9+=0x1){var _0x1a618b=this['getChannelStatus'](_0x30fca6[_0x272db9]);if(this[_0x30fca6[_0x272db9]+_0x59a7('0x30')]!==_0x1a618b){this[_0x30fca6[_0x272db9]+'StatusTime']=_[_0x59a7('0x31')](moment()['format']('x'));}this[_0x30fca6[_0x272db9]+_0x59a7('0x30')]=_0x1a618b;}var _0x3fd9b7={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x59a7('0xa')],'mailPause':this[_0x59a7('0xb')],'smsPause':this[_0x59a7('0xd')],'faxPause':this[_0x59a7('0xc')],'openchannelPause':this[_0x59a7('0xe')],'chatStatus':this[_0x59a7('0xf')],'chatStatusTime':this[_0x59a7('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x59a7('0x32')],'mailStatus':this[_0x59a7('0x13')],'mailStatusTime':this[_0x59a7('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x59a7('0x16')],'faxStatus':this[_0x59a7('0x17')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x59a7('0x1a')],'smsStatusTime':this[_0x59a7('0x1b')],'smsCapacity':this[_0x59a7('0x1c')],'smsCurrentCapacity':this[_0x59a7('0x1d')],'whatsappStatus':this[_0x59a7('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x59a7('0x21')],'openchannelStatus':this[_0x59a7('0x22')],'openchannelStatusTime':this[_0x59a7('0x23')],'openchannelCapacity':this[_0x59a7('0x24')],'openchannelCurrentCapacity':this[_0x59a7('0x33')],'busy':this[_0x59a7('0x25')],'busyQueue':this['busyQueue']};var _0x5a5689=md5(JSON['stringify'](_0x3fd9b7));if(this[_0x59a7('0x2')]!==_0x5a5689){this['md5']=_0x5a5689;io[_0x59a7('0x34')](_0x59a7('0x35'),_0x3fd9b7);}};module['exports']=Agent; \ No newline at end of file +var _0xf2d0=['exports','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','fax','sms','whatsapp','StatusTime','toNumber','format','smsPause','faxStatus','faxCurrentCapacity','smsCurrentCapacity','openchannelCurrentCapacity','stringify','emit','user:save'];(function(_0x4d3329,_0x53e55b){var _0x3abb35=function(_0x10e135){while(--_0x10e135){_0x4d3329['push'](_0x4d3329['shift']());}};_0x3abb35(++_0x53e55b);}(_0xf2d0,0x137));var _0x0f2d=function(_0xc733c4,_0x4270bd){_0xc733c4=_0xc733c4-0x0;var _0x4bb13a=_0xf2d0[_0xc733c4];return _0x4bb13a;};'use strict';var _=require('lodash');var moment=require(_0x0f2d('0x0'));var md5=require(_0x0f2d('0x1'));var Redis=require(_0x0f2d('0x2'));var config=require(_0x0f2d('0x3'));config[_0x0f2d('0x4')]=_[_0x0f2d('0x5')](config[_0x0f2d('0x4')],{'host':_0x0f2d('0x6'),'port':0x18eb});var io=require(_0x0f2d('0x7'))(new Redis(config['redis']));function Agent(_0x27e73f){this['id']=_0x27e73f['id']||0x0;this[_0x0f2d('0x8')]=_0x27e73f[_0x0f2d('0x8')]||'';this[_0x0f2d('0x9')]=_0x27e73f[_0x0f2d('0x9')]||!![];this[_0x0f2d('0xa')]=_0x27e73f[_0x0f2d('0xa')]||![];this[_0x0f2d('0xb')]=_0x27e73f[_0x0f2d('0xb')]||![];this['mailPause']=_0x27e73f[_0x0f2d('0xc')]||![];this[_0x0f2d('0xd')]=_0x27e73f[_0x0f2d('0xd')]||![];this['smsPause']=_0x27e73f['smsPause']||![];this['openchannelPause']=_0x27e73f[_0x0f2d('0xe')]||![];this[_0x0f2d('0xf')]=_0x0f2d('0x10');this[_0x0f2d('0x11')]=0x0;this[_0x0f2d('0x12')]=_0x27e73f[_0x0f2d('0x12')]||0x0;this[_0x0f2d('0x13')]=0x0;this[_0x0f2d('0x14')]=_0x0f2d('0x10');this[_0x0f2d('0x15')]=0x0;this[_0x0f2d('0x16')]=_0x27e73f[_0x0f2d('0x16')]||0x0;this[_0x0f2d('0x17')]=0x0;this['faxStatus']=_0x0f2d('0x10');this[_0x0f2d('0x18')]=0x0;this[_0x0f2d('0x19')]=_0x27e73f[_0x0f2d('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x0f2d('0x1a')]=_0x0f2d('0x10');this[_0x0f2d('0x1b')]=0x0;this['smsCapacity']=_0x27e73f[_0x0f2d('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x0f2d('0x1d')]=_0x0f2d('0x10');this[_0x0f2d('0x1e')]=0x0;this[_0x0f2d('0x1f')]=_0x27e73f[_0x0f2d('0x1f')]||0x0;this[_0x0f2d('0x20')]=0x0;this[_0x0f2d('0x21')]='unknown';this[_0x0f2d('0x22')]=0x0;this[_0x0f2d('0x23')]=_0x27e73f[_0x0f2d('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x0f2d('0x24')]=![];this[_0x0f2d('0x25')]=undefined;this['md5']='';this[_0x0f2d('0x26')]();}Agent[_0x0f2d('0x27')][_0x0f2d('0x28')]=function(_0x1d868b){if(this[_0x1d868b+_0x0f2d('0x29')]>0x0){if(this[_0x1d868b+_0x0f2d('0x2a')]>0x0&&this[_0x1d868b+'CurrentCapacity']>=this[_0x1d868b+'Capacity']){return _0x0f2d('0x2b');}else{return _0x0f2d('0x2c');}}else{return _0x0f2d('0x2d');}};Agent['prototype'][_0x0f2d('0x26')]=function(){var _0x4c3571=['mail',_0x0f2d('0x2e'),'openchannel',_0x0f2d('0x2f'),_0x0f2d('0x30'),_0x0f2d('0x31')];for(var _0x58fa74=0x0;_0x58fa74<_0x4c3571['length'];_0x58fa74+=0x1){var _0x54c7f8=this[_0x0f2d('0x28')](_0x4c3571[_0x58fa74]);if(this[_0x4c3571[_0x58fa74]+'Status']!==_0x54c7f8){this[_0x4c3571[_0x58fa74]+_0x0f2d('0x32')]=_[_0x0f2d('0x33')](moment()[_0x0f2d('0x34')]('x'));}this[_0x4c3571[_0x58fa74]+'Status']=_0x54c7f8;}var _0x509295={'id':this['id'],'name':this[_0x0f2d('0x8')],'online':this[_0x0f2d('0x9')],'voicePause':this[_0x0f2d('0xa')],'chatPause':this[_0x0f2d('0xb')],'mailPause':this[_0x0f2d('0xc')],'smsPause':this[_0x0f2d('0x35')],'faxPause':this[_0x0f2d('0xd')],'openchannelPause':this[_0x0f2d('0xe')],'chatStatus':this[_0x0f2d('0xf')],'chatStatusTime':this[_0x0f2d('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x0f2d('0x14')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x0f2d('0x16')],'mailCurrentCapacity':this[_0x0f2d('0x17')],'faxStatus':this[_0x0f2d('0x36')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x0f2d('0x19')],'faxCurrentCapacity':this[_0x0f2d('0x37')],'smsStatus':this[_0x0f2d('0x1a')],'smsStatusTime':this[_0x0f2d('0x1b')],'smsCapacity':this[_0x0f2d('0x1c')],'smsCurrentCapacity':this[_0x0f2d('0x38')],'whatsappStatus':this[_0x0f2d('0x1d')],'whatsappStatusTime':this[_0x0f2d('0x1e')],'whatsappCapacity':this[_0x0f2d('0x1f')],'whatsappCurrentCapacity':this[_0x0f2d('0x20')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x0f2d('0x22')],'openchannelCapacity':this[_0x0f2d('0x23')],'openchannelCurrentCapacity':this[_0x0f2d('0x39')],'busy':this[_0x0f2d('0x24')],'busyQueue':this[_0x0f2d('0x25')]};var _0x3f0d91=md5(JSON[_0x0f2d('0x3a')](_0x509295));if(this['md5']!==_0x3f0d91){this['md5']=_0x3f0d91;io[_0x0f2d('0x3b')](_0x0f2d('0x3c'),_0x509295);}};module[_0x0f2d('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d89577b..96b87f7 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 _0x6cfa=['_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x594f66,_0x4dc536){var _0x188a49=function(_0x2a1985){while(--_0x2a1985){_0x594f66['push'](_0x594f66['shift']());}};_0x188a49(++_0x4dc536);}(_0x6cfa,0x1e8));var _0xa6cf=function(_0xf40652,_0xf47f4a){_0xf40652=_0xf40652-0x0;var _0xe23894=_0x6cfa[_0xf40652];return _0xe23894;};'use strict';var _=require(_0xa6cf('0x0'));var md5=require(_0xa6cf('0x1'));var util=require('util');var Redis=require(_0xa6cf('0x2'));var config=require(_0xa6cf('0x3'));config[_0xa6cf('0x4')]=_[_0xa6cf('0x5')](config[_0xa6cf('0x4')],{'host':_0xa6cf('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6cf('0x4')]));function ChatQueue(_0x1feb53){this['id']=_0x1feb53['id']||0x0;this[_0xa6cf('0x7')]=_0x1feb53[_0xa6cf('0x7')]||'';this[_0xa6cf('0x8')]=_0x1feb53[_0xa6cf('0x8')]||0xa;this['strategy']=_0x1feb53[_0xa6cf('0x9')]||_0xa6cf('0xa');this[_0xa6cf('0xb')]=_0x1feb53[_0xa6cf('0xb')];this[_0xa6cf('0xc')]={};this[_0xa6cf('0xd')]=0x0;this[_0xa6cf('0x1')]='';this[_0xa6cf('0xe')]();this[_0xa6cf('0xf')]();}ChatQueue['prototype'][_0xa6cf('0xe')]=function(){var _0x57a4d1=this[_0xa6cf('0xc')][_0xa6cf('0x10')];this[_0xa6cf('0xc')]=_[_0xa6cf('0x11')](this[_0xa6cf('0xb')],'id');this[_0xa6cf('0xc')]['_rr']=_0x57a4d1;};ChatQueue['prototype'][_0xa6cf('0xf')]=function(){this[_0xa6cf('0x12')]=0x0;this[_0xa6cf('0x13')]=0x0;for(var _0x1ec0b1=0x0;_0x1ec0b1=0x0?this[_0xa6cf('0x17')]:0x0;var _0x5a24d7={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xa6cf('0x13')],'waiting':this[_0xa6cf('0xd')]};var _0x342b75=md5(JSON[_0xa6cf('0x18')](_0x5a24d7));if(this['md5']!==_0x342b75){this[_0xa6cf('0x1')]=_0x342b75;io['to'](util[_0xa6cf('0x19')](_0xa6cf('0x1a'),_0x5a24d7[_0xa6cf('0x7')]))['emit'](_0xa6cf('0x1b'),_0x5a24d7);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x5794=['util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5'];(function(_0x104179,_0x24d559){var _0x531430=function(_0x419436){while(--_0x419436){_0x104179['push'](_0x104179['shift']());}};_0x531430(++_0x24d559);}(_0x5794,0xe6));var _0x4579=function(_0x2180a3,_0x526988){_0x2180a3=_0x2180a3-0x0;var _0xd1918=_0x5794[_0x2180a3];return _0xd1918;};'use strict';var _=require(_0x4579('0x0'));var md5=require(_0x4579('0x1'));var util=require(_0x4579('0x2'));var Redis=require(_0x4579('0x3'));var config=require(_0x4579('0x4'));config[_0x4579('0x5')]=_[_0x4579('0x6')](config[_0x4579('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4579('0x5')]));function ChatQueue(_0xf45a50){this['id']=_0xf45a50['id']||0x0;this[_0x4579('0x7')]=_0xf45a50['name']||'';this[_0x4579('0x8')]=_0xf45a50[_0x4579('0x8')]||0xa;this[_0x4579('0x9')]=_0xf45a50['strategy']||_0x4579('0xa');this[_0x4579('0xb')]=_0xf45a50['Agents'];this['mapAgentsId']={};this[_0x4579('0xc')]=0x0;this[_0x4579('0x1')]='';this[_0x4579('0xd')]();this[_0x4579('0xe')]();}ChatQueue[_0x4579('0xf')][_0x4579('0xd')]=function(){var _0x262758=this[_0x4579('0x10')][_0x4579('0x11')];this[_0x4579('0x10')]=_['map'](this['Agents'],'id');this[_0x4579('0x10')][_0x4579('0x11')]=_0x262758;};ChatQueue['prototype'][_0x4579('0xe')]=function(){this[_0x4579('0x12')]=0x0;this[_0x4579('0x13')]=0x0;for(var _0x1fd108=0x0;_0x1fd108=0x0?this[_0x4579('0x16')]:0x0;var _0x344b40={'id':this['id'],'available':this[_0x4579('0x16')],'loggedIn':this[_0x4579('0x12')],'name':this[_0x4579('0x7')],'paused':this[_0x4579('0x13')],'waiting':this[_0x4579('0xc')]};var _0x17d785=md5(JSON[_0x4579('0x17')](_0x344b40));if(this['md5']!==_0x17d785){this[_0x4579('0x1')]=_0x17d785;io['to'](util[_0x4579('0x18')](_0x4579('0x19'),_0x344b40['name']))[_0x4579('0x1a')](_0x4579('0x1b'),_0x344b40);}};module[_0x4579('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 5f67673..3f4a39d 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 _0x780d=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','faxPause','available','waiting','format','fax_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x23bac0,_0x313b98){var _0x413982=function(_0x13e9bb){while(--_0x13e9bb){_0x23bac0['push'](_0x23bac0['shift']());}};_0x413982(++_0x313b98);}(_0x780d,0x65));var _0xd780=function(_0x5e51c0,_0x481fc4){_0x5e51c0=_0x5e51c0-0x0;var _0x200337=_0x780d[_0x5e51c0];return _0x200337;};'use strict';var _=require('lodash');var md5=require(_0xd780('0x0'));var util=require(_0xd780('0x1'));var Redis=require('ioredis');var config=require(_0xd780('0x2'));config[_0xd780('0x3')]=_[_0xd780('0x4')](config[_0xd780('0x3')],{'host':_0xd780('0x5'),'port':0x18eb});var io=require(_0xd780('0x6'))(new Redis(config[_0xd780('0x3')]));function FaxQueue(_0x4bfd0d){this['id']=_0x4bfd0d['id']||0x0;this[_0xd780('0x7')]=_0x4bfd0d[_0xd780('0x7')]||'';this[_0xd780('0x8')]=_0x4bfd0d['timeout']||0xa;this[_0xd780('0x9')]=_0x4bfd0d[_0xd780('0x9')]||_0xd780('0xa');this[_0xd780('0xb')]=_0x4bfd0d[_0xd780('0xb')];this[_0xd780('0xc')]={};this['waiting']=0x0;this[_0xd780('0x0')]='';this[_0xd780('0xd')]();this[_0xd780('0xe')]();}FaxQueue['prototype'][_0xd780('0xd')]=function(){var _0xc53a80=this['mapAgentsId'][_0xd780('0xf')];this[_0xd780('0xc')]=_[_0xd780('0x10')](this[_0xd780('0xb')],'id');this[_0xd780('0xc')]['_rr']=_0xc53a80;};FaxQueue[_0xd780('0x11')][_0xd780('0xe')]=function(){this[_0xd780('0x12')]=0x0;this[_0xd780('0x13')]=0x0;for(var _0x3a2c35=0x0;_0x3a2c35=0x0?this['available']:0x0;var _0x24b458={'id':this['id'],'available':this[_0xd780('0x16')],'loggedIn':this[_0xd780('0x12')],'name':this[_0xd780('0x7')],'paused':this['paused'],'waiting':this[_0xd780('0x17')]};var _0x5f380e=md5(JSON['stringify'](_0x24b458));if(this[_0xd780('0x0')]!==_0x5f380e){this[_0xd780('0x0')]=_0x5f380e;io['to'](util[_0xd780('0x18')]('fax:queue:%s',_0x24b458[_0xd780('0x7')]))['emit'](_0xd780('0x19'),_0x24b458);}};module[_0xd780('0x1a')]=FaxQueue; \ No newline at end of file +var _0xb564=['updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting'];(function(_0x26271e,_0x515586){var _0x4321e4=function(_0x52f613){while(--_0x52f613){_0x26271e['push'](_0x26271e['shift']());}};_0x4321e4(++_0x515586);}(_0xb564,0x6b));var _0x4b56=function(_0x3ecc2c,_0x4d45dc){_0x3ecc2c=_0x3ecc2c-0x0;var _0xc04d51=_0xb564[_0x3ecc2c];return _0xc04d51;};'use strict';var _=require('lodash');var md5=require(_0x4b56('0x0'));var util=require('util');var Redis=require(_0x4b56('0x1'));var config=require(_0x4b56('0x2'));config[_0x4b56('0x3')]=_['defaults'](config['redis'],{'host':_0x4b56('0x4'),'port':0x18eb});var io=require(_0x4b56('0x5'))(new Redis(config[_0x4b56('0x3')]));function FaxQueue(_0x5bbd6b){this['id']=_0x5bbd6b['id']||0x0;this[_0x4b56('0x6')]=_0x5bbd6b['name']||'';this[_0x4b56('0x7')]=_0x5bbd6b[_0x4b56('0x7')]||0xa;this[_0x4b56('0x8')]=_0x5bbd6b[_0x4b56('0x8')]||_0x4b56('0x9');this[_0x4b56('0xa')]=_0x5bbd6b['Agents'];this['mapAgentsId']={};this[_0x4b56('0xb')]=0x0;this[_0x4b56('0x0')]='';this[_0x4b56('0xc')]();this[_0x4b56('0xd')]();}FaxQueue[_0x4b56('0xe')][_0x4b56('0xc')]=function(){var _0x5c6d02=this[_0x4b56('0xf')][_0x4b56('0x10')];this[_0x4b56('0xf')]=_[_0x4b56('0x11')](this['Agents'],'id');this[_0x4b56('0xf')][_0x4b56('0x10')]=_0x5c6d02;};FaxQueue[_0x4b56('0xe')][_0x4b56('0xd')]=function(){this[_0x4b56('0x12')]=0x0;this[_0x4b56('0x13')]=0x0;for(var _0x166fde=0x0;_0x166fde=0x0?this[_0x4b56('0x17')]:0x0;var _0x57c7a1={'id':this['id'],'available':this[_0x4b56('0x17')],'loggedIn':this[_0x4b56('0x12')],'name':this[_0x4b56('0x6')],'paused':this[_0x4b56('0x13')],'waiting':this[_0x4b56('0xb')]};var _0xe108f0=md5(JSON[_0x4b56('0x18')](_0x57c7a1));if(this[_0x4b56('0x0')]!==_0xe108f0){this[_0x4b56('0x0')]=_0xe108f0;io['to'](util[_0x4b56('0x19')](_0x4b56('0x1a'),_0x57c7a1[_0x4b56('0x6')]))[_0x4b56('0x1b')](_0x4b56('0x1c'),_0x57c7a1);}};module[_0x4b56('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 5f2d700..a8c9c50 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 _0xd6c1=['name','Intervals','exports'];(function(_0x4db8e5,_0x32bec6){var _0x4c4ac4=function(_0x320632){while(--_0x320632){_0x4db8e5['push'](_0x4db8e5['shift']());}};_0x4c4ac4(++_0x32bec6);}(_0xd6c1,0x96));var _0x1d6c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd6c1[_0x4a9fb1];return _0x348672;};'use strict';function Interval(_0xa24b71){this['id']=_0xa24b71['id']||0x0;this[_0x1d6c('0x0')]=_0xa24b71['name']||'';this[_0x1d6c('0x1')]=_0xa24b71[_0x1d6c('0x1')]||{};}module[_0x1d6c('0x2')]=Interval; \ No newline at end of file +var _0xf938=['Intervals','exports','name'];(function(_0x3404ea,_0x4a8325){var _0x6492fe=function(_0x2bc376){while(--_0x2bc376){_0x3404ea['push'](_0x3404ea['shift']());}};_0x6492fe(++_0x4a8325);}(_0xf938,0x1b8));var _0x8f93=function(_0x3126b6,_0x450061){_0x3126b6=_0x3126b6-0x0;var _0x116531=_0xf938[_0x3126b6];return _0x116531;};'use strict';function Interval(_0x4f06df){this['id']=_0x4f06df['id']||0x0;this[_0x8f93('0x0')]=_0x4f06df['name']||'';this['Intervals']=_0x4f06df[_0x8f93('0x1')]||{};}module[_0x8f93('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 ea663b2..75e7b18 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 _0xf572=['format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','length','online','available','paused','stringify'];(function(_0x332c5a,_0x27c928){var _0x33ec24=function(_0x3ed879){while(--_0x3ed879){_0x332c5a['push'](_0x332c5a['shift']());}};_0x33ec24(++_0x27c928);}(_0xf572,0x17d));var _0x2f57=function(_0x37d501,_0x5a3cd5){_0x37d501=_0x37d501-0x0;var _0x58052e=_0xf572[_0x37d501];return _0x58052e;};'use strict';var _=require('lodash');var md5=require(_0x2f57('0x0'));var util=require(_0x2f57('0x1'));var Redis=require(_0x2f57('0x2'));var config=require(_0x2f57('0x3'));config[_0x2f57('0x4')]=_[_0x2f57('0x5')](config[_0x2f57('0x4')],{'host':_0x2f57('0x6'),'port':0x18eb});var io=require(_0x2f57('0x7'))(new Redis(config[_0x2f57('0x4')]));function MailQueue(_0x375a42){this['id']=_0x375a42['id']||0x0;this[_0x2f57('0x8')]=_0x375a42['name']||'';this[_0x2f57('0x9')]=_0x375a42[_0x2f57('0x9')]||0xa;this[_0x2f57('0xa')]=_0x375a42['strategy']||_0x2f57('0xb');this[_0x2f57('0xc')]=_0x375a42[_0x2f57('0xc')];this['mapAgentsId']={};this[_0x2f57('0xd')]=0x0;this[_0x2f57('0x0')]='';this[_0x2f57('0xe')]();this[_0x2f57('0xf')]();}MailQueue[_0x2f57('0x10')]['updateRouting']=function(){var _0x21477a=this[_0x2f57('0x11')][_0x2f57('0x12')];this[_0x2f57('0x11')]=_['map'](this['Agents'],'id');this[_0x2f57('0x11')][_0x2f57('0x12')]=_0x21477a;};MailQueue[_0x2f57('0x10')][_0x2f57('0xf')]=function(){this[_0x2f57('0x13')]=0x0;this['paused']=0x0;for(var _0x396bae=0x0;_0x396bae=0x0?this[_0x2f57('0x16')]:0x0;var _0x4ea227={'id':this['id'],'available':this[_0x2f57('0x16')],'loggedIn':this[_0x2f57('0x13')],'name':this[_0x2f57('0x8')],'paused':this[_0x2f57('0x17')],'waiting':this[_0x2f57('0xd')]};var _0x5191f0=md5(JSON[_0x2f57('0x18')](_0x4ea227));if(this['md5']!==_0x5191f0){this[_0x2f57('0x0')]=_0x5191f0;io['to'](util[_0x2f57('0x19')](_0x2f57('0x1a'),_0x4ea227[_0x2f57('0x8')]))['emit'](_0x2f57('0x1b'),_0x4ea227);}};module[_0x2f57('0x1c')]=MailQueue; \ No newline at end of file +var _0x964b=['exports','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','mailPause','paused','available','stringify','md5','mail:queue:%s','emit','mail_queue:save'];(function(_0x38cda9,_0x553746){var _0x11e09b=function(_0x2e3973){while(--_0x2e3973){_0x38cda9['push'](_0x38cda9['shift']());}};_0x11e09b(++_0x553746);}(_0x964b,0x105));var _0xb964=function(_0x53bf62,_0x2e0914){_0x53bf62=_0x53bf62-0x0;var _0x111a57=_0x964b[_0x53bf62];return _0x111a57;};'use strict';var _=require(_0xb964('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xb964('0x1'));config[_0xb964('0x2')]=_[_0xb964('0x3')](config[_0xb964('0x2')],{'host':_0xb964('0x4'),'port':0x18eb});var io=require(_0xb964('0x5'))(new Redis(config[_0xb964('0x2')]));function MailQueue(_0x5b15b0){this['id']=_0x5b15b0['id']||0x0;this[_0xb964('0x6')]=_0x5b15b0[_0xb964('0x6')]||'';this[_0xb964('0x7')]=_0x5b15b0[_0xb964('0x7')]||0xa;this[_0xb964('0x8')]=_0x5b15b0[_0xb964('0x8')]||'beepall';this['Agents']=_0x5b15b0[_0xb964('0x9')];this[_0xb964('0xa')]={};this[_0xb964('0xb')]=0x0;this['md5']='';this[_0xb964('0xc')]();this['updateRealtime']();}MailQueue[_0xb964('0xd')][_0xb964('0xc')]=function(){var _0x28e117=this['mapAgentsId'][_0xb964('0xe')];this[_0xb964('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xb964('0xe')]=_0x28e117;};MailQueue[_0xb964('0xd')][_0xb964('0xf')]=function(){this[_0xb964('0x10')]=0x0;this['paused']=0x0;for(var _0x4010e3=0x0;_0x4010e3=0x0?this[_0xb964('0x13')]:0x0;var _0x50045b={'id':this['id'],'available':this[_0xb964('0x13')],'loggedIn':this[_0xb964('0x10')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb964('0xb')]};var _0x82d71e=md5(JSON[_0xb964('0x14')](_0x50045b));if(this[_0xb964('0x15')]!==_0x82d71e){this['md5']=_0x82d71e;io['to'](util['format'](_0xb964('0x16'),_0x50045b[_0xb964('0x6')]))[_0xb964('0x17')](_0xb964('0x18'),_0x50045b);}};module[_0xb964('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 9532a63..5f32842 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x13a145,_0x1597a4){var _0x187f6f=function(_0x3639c8){while(--_0x3639c8){_0x13a145['push'](_0x13a145['shift']());}};_0x187f6f(++_0x1597a4);}(_0x814b,0x1a2));var _0xb814=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x814b[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=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(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x1261,0x144));var _0x1126=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x1261[_0x10e983];return _0x324138;};'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 d98df8c..cc25be1 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 _0xb2b5=['md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','smsPause','available','paused','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xb2b5[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x5b2b('0x0'));config[_0x5b2b('0x1')]=_['defaults'](config['redis'],{'host':_0x5b2b('0x2'),'port':0x18eb});var io=require(_0x5b2b('0x3'))(new Redis(config[_0x5b2b('0x1')]));function SmsQueue(_0x3c073f){this['id']=_0x3c073f['id']||0x0;this['name']=_0x3c073f[_0x5b2b('0x4')]||'';this[_0x5b2b('0x5')]=_0x3c073f['timeout']||0xa;this['strategy']=_0x3c073f[_0x5b2b('0x6')]||_0x5b2b('0x7');this[_0x5b2b('0x8')]=_0x3c073f[_0x5b2b('0x8')];this[_0x5b2b('0x9')]={};this[_0x5b2b('0xa')]=0x0;this[_0x5b2b('0xb')]='';this[_0x5b2b('0xc')]();this['updateRealtime']();}SmsQueue[_0x5b2b('0xd')][_0x5b2b('0xc')]=function(){var _0x53e4ca=this[_0x5b2b('0x9')][_0x5b2b('0xe')];this['mapAgentsId']=_[_0x5b2b('0xf')](this[_0x5b2b('0x8')],'id');this[_0x5b2b('0x9')][_0x5b2b('0xe')]=_0x53e4ca;};SmsQueue[_0x5b2b('0xd')][_0x5b2b('0x10')]=function(){this[_0x5b2b('0x11')]=0x0;this['paused']=0x0;for(var _0x30e9a3=0x0;_0x30e9a3=0x0?this['available']:0x0;var _0x13eaa1={'id':this['id'],'available':this[_0x5b2b('0x15')],'loggedIn':this[_0x5b2b('0x11')],'name':this[_0x5b2b('0x4')],'paused':this[_0x5b2b('0x16')],'waiting':this['waiting']};var _0x35b589=md5(JSON[_0x5b2b('0x17')](_0x13eaa1));if(this[_0x5b2b('0xb')]!==_0x35b589){this[_0x5b2b('0xb')]=_0x35b589;io['to'](util[_0x5b2b('0x18')](_0x5b2b('0x19'),_0x13eaa1[_0x5b2b('0x4')]))[_0x5b2b('0x1a')](_0x5b2b('0x1b'),_0x13eaa1);}};module[_0x5b2b('0x1c')]=SmsQueue; \ No newline at end of file +var _0x3299=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','online','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment'];(function(_0x3b7de5,_0x9fb527){var _0x57578=function(_0xa2d11a){while(--_0xa2d11a){_0x3b7de5['push'](_0x3b7de5['shift']());}};_0x57578(++_0x9fb527);}(_0x3299,0x1bc));var _0x9329=function(_0xd20cf1,_0x700f1e){_0xd20cf1=_0xd20cf1-0x0;var _0x1066b2=_0x3299[_0xd20cf1];return _0x1066b2;};'use strict';var _=require('lodash');var md5=require(_0x9329('0x0'));var util=require(_0x9329('0x1'));var Redis=require(_0x9329('0x2'));var config=require(_0x9329('0x3'));config[_0x9329('0x4')]=_[_0x9329('0x5')](config[_0x9329('0x4')],{'host':_0x9329('0x6'),'port':0x18eb});var io=require(_0x9329('0x7'))(new Redis(config[_0x9329('0x4')]));function SmsQueue(_0x404689){this['id']=_0x404689['id']||0x0;this[_0x9329('0x8')]=_0x404689[_0x9329('0x8')]||'';this[_0x9329('0x9')]=_0x404689[_0x9329('0x9')]||0xa;this[_0x9329('0xa')]=_0x404689[_0x9329('0xa')]||'beepall';this[_0x9329('0xb')]=_0x404689[_0x9329('0xb')];this[_0x9329('0xc')]={};this[_0x9329('0xd')]=0x0;this[_0x9329('0x0')]='';this['updateRouting']();this[_0x9329('0xe')]();}SmsQueue[_0x9329('0xf')]['updateRouting']=function(){var _0x5604d8=this['mapAgentsId'][_0x9329('0x10')];this[_0x9329('0xc')]=_[_0x9329('0x11')](this[_0x9329('0xb')],'id');this[_0x9329('0xc')]['_rr']=_0x5604d8;};SmsQueue[_0x9329('0xf')][_0x9329('0xe')]=function(){this[_0x9329('0x12')]=0x0;this['paused']=0x0;for(var _0x1ee23e=0x0;_0x1ee23e=0x0?this[_0x9329('0x16')]:0x0;var _0x57718b={'id':this['id'],'available':this[_0x9329('0x16')],'loggedIn':this[_0x9329('0x12')],'name':this['name'],'paused':this[_0x9329('0x15')],'waiting':this['waiting']};var _0x21bdb=md5(JSON['stringify'](_0x57718b));if(this[_0x9329('0x0')]!==_0x21bdb){this['md5']=_0x21bdb;io['to'](util[_0x9329('0x17')](_0x9329('0x18'),_0x57718b[_0x9329('0x8')]))[_0x9329('0x19')](_0x9329('0x1a'),_0x57718b);}};module[_0x9329('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9f04b5d..77ae6cd 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 _0xdca0=['whatsapp_queue:save','lodash','md5','util','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','_rr','mapAgentsId','prototype','updateRealtime','loggedIn','paused','length','online','available','waiting','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdca0,0x178));var _0x0dca=function(_0x506a54,_0x43ec78){_0x506a54=_0x506a54-0x0;var _0x181ad5=_0xdca0[_0x506a54];return _0x181ad5;};'use strict';var _=require(_0x0dca('0x0'));var md5=require(_0x0dca('0x1'));var util=require(_0x0dca('0x2'));var Redis=require(_0x0dca('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x0dca('0x4')](config[_0x0dca('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x0dca('0x6'))(new Redis(config[_0x0dca('0x5')]));function WhatsappQueue(_0x554960){this['id']=_0x554960['id']||0x0;this[_0x0dca('0x7')]=_0x554960[_0x0dca('0x7')]||'';this[_0x0dca('0x8')]=_0x554960[_0x0dca('0x8')]||0xa;this[_0x0dca('0x9')]=_0x554960[_0x0dca('0x9')]||_0x0dca('0xa');this['Agents']=_0x554960[_0x0dca('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0dca('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue['prototype'][_0x0dca('0xc')]=function(){var _0x4290f6=this['mapAgentsId'][_0x0dca('0xd')];this[_0x0dca('0xe')]=_['map'](this[_0x0dca('0xb')],'id');this['mapAgentsId']['_rr']=_0x4290f6;};WhatsappQueue[_0x0dca('0xf')][_0x0dca('0x10')]=function(){this[_0x0dca('0x11')]=0x0;this[_0x0dca('0x12')]=0x0;for(var _0x573e97=0x0;_0x573e97=0x0?this[_0x0dca('0x15')]:0x0;var _0x1701f5={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x0dca('0x7')],'paused':this['paused'],'waiting':this[_0x0dca('0x16')]};var _0x82e245=md5(JSON['stringify'](_0x1701f5));if(this['md5']!==_0x82e245){this['md5']=_0x82e245;io['to'](util[_0x0dca('0x17')]('whatsapp:queue:%s',_0x1701f5['name']))['emit'](_0x0dca('0x18'),_0x1701f5);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xbfb4=['whatsapp_queue:save','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','emit'];(function(_0x535c27,_0xffdb1a){var _0x11ea38=function(_0x1653b6){while(--_0x1653b6){_0x535c27['push'](_0x535c27['shift']());}};_0x11ea38(++_0xffdb1a);}(_0xbfb4,0xbe));var _0x4bfb=function(_0x250603,_0x274b19){_0x250603=_0x250603-0x0;var _0x24eb8d=_0xbfb4[_0x250603];return _0x24eb8d;};'use strict';var _=require(_0x4bfb('0x0'));var md5=require(_0x4bfb('0x1'));var util=require('util');var Redis=require(_0x4bfb('0x2'));var config=require('../../../config/environment');config[_0x4bfb('0x3')]=_['defaults'](config[_0x4bfb('0x3')],{'host':_0x4bfb('0x4'),'port':0x18eb});var io=require(_0x4bfb('0x5'))(new Redis(config[_0x4bfb('0x3')]));function WhatsappQueue(_0x4eb612){this['id']=_0x4eb612['id']||0x0;this[_0x4bfb('0x6')]=_0x4eb612['name']||'';this[_0x4bfb('0x7')]=_0x4eb612[_0x4bfb('0x7')]||0xa;this[_0x4bfb('0x8')]=_0x4eb612[_0x4bfb('0x8')]||_0x4bfb('0x9');this['Agents']=_0x4eb612[_0x4bfb('0xa')];this[_0x4bfb('0xb')]={};this[_0x4bfb('0xc')]=0x0;this[_0x4bfb('0x1')]='';this['updateRouting']();this[_0x4bfb('0xd')]();}WhatsappQueue[_0x4bfb('0xe')]['updateRouting']=function(){var _0x27a0b2=this['mapAgentsId'][_0x4bfb('0xf')];this['mapAgentsId']=_[_0x4bfb('0x10')](this['Agents'],'id');this[_0x4bfb('0xb')][_0x4bfb('0xf')]=_0x27a0b2;};WhatsappQueue['prototype'][_0x4bfb('0xd')]=function(){this[_0x4bfb('0x11')]=0x0;this[_0x4bfb('0x12')]=0x0;for(var _0x674c04=0x0;_0x674c04=0x0?this[_0x4bfb('0x16')]:0x0;var _0x1d2000={'id':this['id'],'available':this[_0x4bfb('0x16')],'loggedIn':this[_0x4bfb('0x11')],'name':this[_0x4bfb('0x6')],'paused':this[_0x4bfb('0x12')],'waiting':this[_0x4bfb('0xc')]};var _0x593b5a=md5(JSON['stringify'](_0x1d2000));if(this[_0x4bfb('0x1')]!==_0x593b5a){this[_0x4bfb('0x1')]=_0x593b5a;io['to'](util[_0x4bfb('0x17')](_0x4bfb('0x18'),_0x1d2000[_0x4bfb('0x6')]))[_0x4bfb('0x19')](_0x4bfb('0x1a'),_0x1d2000);}};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 def2270..5957075 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(_0x18a4fb,_0x3891b9){var _0x5b1f95=function(_0x11b2fd){while(--_0x11b2fd){_0x18a4fb['push'](_0x18a4fb['shift']());}};_0x5b1f95(++_0x3891b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x282442,_0x135555){_0x282442=_0x282442-0x0;var _0xf97807=_0xb10b[_0x282442];return _0xf97807;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index aedb159..896ca16 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 _0xa695=['UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x1d79df,_0x29a662){var _0x140b59=function(_0x511f98){while(--_0x511f98){_0x1d79df['push'](_0x1d79df['shift']());}};_0x140b59(++_0x29a662);}(_0xa695,0x195));var _0x5a69=function(_0x3dbb93,_0x31a255){_0x3dbb93=_0x3dbb93-0x0;var _0x3ae2e3=_0xa695[_0x3dbb93];return _0x3ae2e3;};'use strict';var client=require('../client');exports['update']=function(_0x3bf93c,_0x5f51f5){return client['Request'](_0x5a69('0x0'),{'body':_0x5f51f5,'options':{'where':{'id':_0x3bf93c}},'log':_0x5a69('0x1')});};exports[_0x5a69('0x2')]=function(_0x5cffde,_0x2a3df7){return client[_0x5a69('0x3')]('AddTagsToChatInteraction',{'body':_0x2a3df7,'options':{'where':{'id':_0x5cffde}},'log':_0x5a69('0x4')});}; \ No newline at end of file +var _0x795d=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction','addTags'];(function(_0x5c3145,_0x4c2950){var _0x5f0a56=function(_0xfd835f){while(--_0xfd835f){_0x5c3145['push'](_0x5c3145['shift']());}};_0x5f0a56(++_0x4c2950);}(_0x795d,0xf8));var _0xd795=function(_0x117b82,_0x13554b){_0x117b82=_0x117b82-0x0;var _0x3a8975=_0x795d[_0x117b82];return _0x3a8975;};'use strict';var client=require('../client');exports[_0xd795('0x0')]=function(_0x5c1fcb,_0x2eab84){return client[_0xd795('0x1')](_0xd795('0x2'),{'body':_0x2eab84,'options':{'where':{'id':_0x5c1fcb}},'log':'updateChatInteraction'});};exports[_0xd795('0x3')]=function(_0x2ba68b,_0x1bdf4c){return client[_0xd795('0x1')](_0xd795('0x4'),{'body':_0x1bdf4c,'options':{'where':{'id':_0x2ba68b}},'log':_0xd795('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 3829824..d34452b 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 _0x5250=['createChatMessage','Request','CreateChatMessage'];(function(_0x374779,_0x3d43df){var _0x37675a=function(_0x55ef1e){while(--_0x55ef1e){_0x374779['push'](_0x374779['shift']());}};_0x37675a(++_0x3d43df);}(_0x5250,0x157));var _0x0525=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x5250[_0x208d75];return _0x382d27;};'use strict';var client=require('../client');exports['create']=function(_0x200bbc){return client[_0x0525('0x0')](_0x0525('0x1'),{'body':_0x200bbc,'log':_0x0525('0x2')});}; \ No newline at end of file +var _0x34bc=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x3fc59a,_0x5c0c1d){var _0x2af724=function(_0xa23f3e){while(--_0xa23f3e){_0x3fc59a['push'](_0x3fc59a['shift']());}};_0x2af724(++_0x5c0c1d);}(_0x34bc,0x121));var _0xc34b=function(_0x348531,_0x17c233){_0x348531=_0x348531-0x0;var _0x347cc7=_0x34bc[_0x348531];return _0x347cc7;};'use strict';var client=require('../client');exports[_0xc34b('0x0')]=function(_0x2dcd4a){return client[_0xc34b('0x1')](_0xc34b('0x2'),{'body':_0x2dcd4a,'log':_0xc34b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index a2bba62..e649b80 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 _0x85d0=['Agents','chatPause','name','timeout','strategy','User'];(function(_0x360f17,_0xf88d45){var _0x128eb3=function(_0x465432){while(--_0x465432){_0x360f17['push'](_0x360f17['shift']());}};_0x128eb3(++_0xf88d45);}(_0x85d0,0x164));var _0x085d=function(_0x429c8b,_0x31f238){_0x429c8b=_0x429c8b-0x0;var _0x473671=_0x85d0[_0x429c8b];return _0x473671;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x085d('0x0'),_0x085d('0x1'),_0x085d('0x2')],'include':[{'model':_0x085d('0x3'),'as':_0x085d('0x4'),'attributes':['id',_0x085d('0x0'),'online',_0x085d('0x5')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xac21=['Request','name','strategy','User','chatPause','getChatQueues'];(function(_0x4d12c0,_0x19f3af){var _0x216508=function(_0xbb45a){while(--_0xbb45a){_0x4d12c0['push'](_0x4d12c0['shift']());}};_0x216508(++_0x19f3af);}(_0xac21,0x1af));var _0x1ac2=function(_0x37b73e,_0x3ce320){_0x37b73e=_0x37b73e-0x0;var _0xfe7de1=_0xac21[_0x37b73e];return _0xfe7de1;};'use strict';var client=require('../client');exports[_0x1ac2('0x0')]=function(){return function(){return client[_0x1ac2('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x1ac2('0x2'),'timeout',_0x1ac2('0x3')],'include':[{'model':_0x1ac2('0x4'),'as':'Agents','attributes':['id',_0x1ac2('0x2'),'online',_0x1ac2('0x5')]}]},'log':_0x1ac2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 7387d8b..9ee5c2b 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 _0x330c=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x20174f,_0x44c8cb){var _0x30f03d=function(_0x37dc8b){while(--_0x37dc8b){_0x20174f['push'](_0x20174f['shift']());}};_0x30f03d(++_0x44c8cb);}(_0x330c,0x186));var _0xc330=function(_0x5313fa,_0x7242c5){_0x5313fa=_0x5313fa-0x0;var _0x5bac88=_0x330c[_0x5313fa];return _0x5bac88;};'use strict';var client=require(_0xc330('0x0'));exports[_0xc330('0x1')]=function(_0x38be68){return client[_0xc330('0x2')]('CreateChatQueueReport',{'body':_0x38be68,'log':_0xc330('0x3')});};exports[_0xc330('0x4')]=function(_0x4552ee,_0x207daa){return client[_0xc330('0x2')](_0xc330('0x5'),{'body':_0x207daa,'options':{'where':{'uniqueid':_0x4552ee},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xf109=['UpdateChatQueueReport','DESC','../client','create','update','Request'];(function(_0x44c340,_0x575719){var _0x2cd080=function(_0x1109ea){while(--_0x1109ea){_0x44c340['push'](_0x44c340['shift']());}};_0x2cd080(++_0x575719);}(_0xf109,0xce));var _0x9f10=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf109[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0x9f10('0x0'));exports[_0x9f10('0x1')]=function(_0x44c4f2){return client['Request']('CreateChatQueueReport',{'body':_0x44c4f2,'log':'CreateChatQueueReport'});};exports[_0x9f10('0x2')]=function(_0x74f517,_0x74d0ee){return client[_0x9f10('0x3')](_0x9f10('0x4'),{'body':_0x74d0ee,'options':{'where':{'uniqueid':_0x74f517},'order':[['id',_0x9f10('0x5')]],'limit':0x1},'log':_0x9f10('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 505ba54..6fbe7cf 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(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0x7a54,0x106));var _0x47a5=function(_0x21b8c,_0x1c10e6){_0x21b8c=_0x21b8c-0x0;var _0x5741bb=_0x7a54[_0x21b8c];return _0x5741bb;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x595953,_0x2b9942){var _0x1a54fb=function(_0x1ee211){while(--_0x1ee211){_0x595953['push'](_0x595953['shift']());}};_0x1a54fb(++_0x2b9942);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f02d241..314cdda 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 _0xff06=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x3e2fef,_0x29592e){var _0x1b5288=function(_0x4c8cb5){while(--_0x4c8cb5){_0x3e2fef['push'](_0x3e2fef['shift']());}};_0x1b5288(++_0x29592e);}(_0xff06,0x7f));var _0x6ff0=function(_0x34e481,_0x1f0d05){_0x34e481=_0x34e481-0x0;var _0x195d01=_0xff06[_0x34e481];return _0x195d01;};'use strict';var client=require(_0x6ff0('0x0'));exports[_0x6ff0('0x1')]=function(_0x5d91fc){return client['Request'](_0x6ff0('0x2'),{'body':_0x5d91fc,'log':_0x6ff0('0x3')});}; \ No newline at end of file +var _0x1317=['createFaxMessage','CreateFaxMessage'];(function(_0x440f75,_0x5b130e){var _0x321201=function(_0x212bd5){while(--_0x212bd5){_0x440f75['push'](_0x440f75['shift']());}};_0x321201(++_0x5b130e);}(_0x1317,0x1bf));var _0x7131=function(_0x5c2590,_0x3227ba){_0x5c2590=_0x5c2590-0x0;var _0x4f3d2a=_0x1317[_0x5c2590];return _0x4f3d2a;};'use strict';var client=require('../client');exports['create']=function(_0x547b6){return client['Request'](_0x7131('0x0'),{'body':_0x547b6,'log':_0x7131('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a42b76d..90b8282 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 _0xc8cb=['strategy','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x1c9438,_0x45e960){var _0x450f63=function(_0x2aefb4){while(--_0x2aefb4){_0x1c9438['push'](_0x1c9438['shift']());}};_0x450f63(++_0x45e960);}(_0xc8cb,0x174));var _0xbc8c=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xc8cb[_0x381589];return _0x2a075d;};'use strict';var client=require(_0xbc8c('0x0'));exports[_0xbc8c('0x1')]=function(){return function(){return client['Request'](_0xbc8c('0x2'),{'options':{'raw':![],'attributes':['id',_0xbc8c('0x3'),'timeout',_0xbc8c('0x4')],'include':[{'model':'User','as':_0xbc8c('0x5'),'attributes':['id','name',_0xbc8c('0x6'),_0xbc8c('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xaf10=['online','faxPause','../client','getFaxQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xaf10,0x160));var _0x0af1=function(_0x252cf5,_0x1e63ad){_0x252cf5=_0x252cf5-0x0;var _0xcdf565=_0xaf10[_0x252cf5];return _0xcdf565;};'use strict';var client=require(_0x0af1('0x0'));exports[_0x0af1('0x1')]=function(){return function(){return client[_0x0af1('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x0af1('0x3'),_0x0af1('0x4'),_0x0af1('0x5')],'include':[{'model':_0x0af1('0x6'),'as':_0x0af1('0x7'),'attributes':['id',_0x0af1('0x3'),_0x0af1('0x8'),_0x0af1('0x9')]}]},'log':_0x0af1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9595e43..90cc837 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 _0x4ed4=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x4ed4,0x1b3));var _0x44ed=function(_0x2a875,_0x40e43e){_0x2a875=_0x2a875-0x0;var _0x373fd0=_0x4ed4[_0x2a875];return _0x373fd0;};'use strict';var client=require(_0x44ed('0x0'));exports[_0x44ed('0x1')]=function(_0x4a1b05){return client[_0x44ed('0x2')](_0x44ed('0x3'),{'body':_0x4a1b05,'log':_0x44ed('0x3')});};exports[_0x44ed('0x4')]=function(_0x4c87b2,_0x3a14fd){return client['Request'](_0x44ed('0x5'),{'body':_0x3a14fd,'options':{'where':{'uniqueid':_0x4c87b2},'order':[['id',_0x44ed('0x6')]],'limit':0x1},'log':_0x44ed('0x5')});}; \ No newline at end of file +var _0xb2fe=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x34c3e8,_0x1a9e4d){var _0x54200d=function(_0x310012){while(--_0x310012){_0x34c3e8['push'](_0x34c3e8['shift']());}};_0x54200d(++_0x1a9e4d);}(_0xb2fe,0xfc));var _0xeb2f=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xb2fe[_0x349a9e];return _0x24c207;};'use strict';var client=require(_0xeb2f('0x0'));exports[_0xeb2f('0x1')]=function(_0x165fc3){return client[_0xeb2f('0x2')](_0xeb2f('0x3'),{'body':_0x165fc3,'log':_0xeb2f('0x3')});};exports[_0xeb2f('0x4')]=function(_0x286cd0,_0x2425f7){return client[_0xeb2f('0x2')](_0xeb2f('0x5'),{'body':_0x2425f7,'options':{'where':{'uniqueid':_0x286cd0},'order':[['id',_0xeb2f('0x6')]],'limit':0x1},'log':_0xeb2f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f2fd8f6..e70ff18 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 _0xd7e3=['Interval','name','interval','../client','getIntervals','Request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd7e3,0x1b9));var _0x3d7e=function(_0x21799b,_0x4694af){_0x21799b=_0x21799b-0x0;var _0x317530=_0xd7e3[_0x21799b];return _0x317530;};'use strict';var client=require(_0x3d7e('0x0'));exports[_0x3d7e('0x1')]=function(){return function(){return client[_0x3d7e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3d7e('0x3'),'as':'Intervals','attributes':['id',_0x3d7e('0x4'),_0x3d7e('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xfebb=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x2b3ff1,_0x1024a8){var _0x18cd66=function(_0x512586){while(--_0x512586){_0x2b3ff1['push'](_0x2b3ff1['shift']());}};_0x18cd66(++_0x1024a8);}(_0xfebb,0x145));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xbfeb('0x0'));exports[_0xbfeb('0x1')]=function(){return function(){return client[_0xbfeb('0x2')](_0xbfeb('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xbfeb('0x4')],'include':[{'model':_0xbfeb('0x5'),'as':_0xbfeb('0x6'),'attributes':['id','name',_0xbfeb('0x7')]}]},'log':_0xbfeb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a46e7d0..979bd3e 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 _0x0b0e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0x0b0e[_0x244862];return _0x2bce23;};'use strict';var client=require(_0xe0b0('0x0'));exports['update']=function(_0xc416e3,_0x536e9b){return client[_0xe0b0('0x1')](_0xe0b0('0x2'),{'body':_0x536e9b,'options':{'where':{'id':_0xc416e3}},'log':_0xe0b0('0x3')});};exports[_0xe0b0('0x4')]=function(_0x28040c,_0x38a058){return client[_0xe0b0('0x1')](_0xe0b0('0x5'),{'body':_0x38a058,'options':{'where':{'id':_0x28040c}},'log':_0xe0b0('0x6')});}; \ No newline at end of file +var _0x5c3c=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x3178c8,_0x148e1c){var _0x454723=function(_0x5a4846){while(--_0x5a4846){_0x3178c8['push'](_0x3178c8['shift']());}};_0x454723(++_0x148e1c);}(_0x5c3c,0x132));var _0xc5c3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x5c3c[_0x45f951];return _0x24756c;};'use strict';var client=require(_0xc5c3('0x0'));exports[_0xc5c3('0x1')]=function(_0x11705d,_0x32103c){return client['Request'](_0xc5c3('0x2'),{'body':_0x32103c,'options':{'where':{'id':_0x11705d}},'log':_0xc5c3('0x3')});};exports[_0xc5c3('0x4')]=function(_0x2a3649,_0x2535e0){return client[_0xc5c3('0x5')](_0xc5c3('0x6'),{'body':_0x2535e0,'options':{'where':{'id':_0x2a3649}},'log':_0xc5c3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 449cb97..22ab0b6 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 _0xa392=['CreateMailMessage','create','Request'];(function(_0x3703fb,_0x1c6a78){var _0x27181a=function(_0x280fee){while(--_0x280fee){_0x3703fb['push'](_0x3703fb['shift']());}};_0x27181a(++_0x1c6a78);}(_0xa392,0x1c0));var _0x2a39=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa392[_0x1928c9];return _0x51b5fb;};'use strict';var client=require('../client');exports[_0x2a39('0x0')]=function(_0x137f97){return client[_0x2a39('0x1')](_0x2a39('0x2'),{'body':_0x137f97,'log':'createMailMessage'});}; \ No newline at end of file +var _0x0a43=['Request','CreateMailMessage','../client','create'];(function(_0x312998,_0x93bb86){var _0x466e05=function(_0x29cc07){while(--_0x29cc07){_0x312998['push'](_0x312998['shift']());}};_0x466e05(++_0x93bb86);}(_0x0a43,0x10a));var _0x30a4=function(_0x4fb12f,_0x222097){_0x4fb12f=_0x4fb12f-0x0;var _0x5d97c9=_0x0a43[_0x4fb12f];return _0x5d97c9;};'use strict';var client=require(_0x30a4('0x0'));exports[_0x30a4('0x1')]=function(_0x7675f1){return client[_0x30a4('0x2')](_0x30a4('0x3'),{'body':_0x7675f1,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index bdb5216..e766c67 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 _0xc1ed=['getMailQueues','Request','GetMailQueue','name','User','Agents','online','mailPause'];(function(_0x2361a3,_0x24b613){var _0x40a829=function(_0x379565){while(--_0x379565){_0x2361a3['push'](_0x2361a3['shift']());}};_0x40a829(++_0x24b613);}(_0xc1ed,0xe0));var _0xdc1e=function(_0x4bf4d7,_0x17f6d2){_0x4bf4d7=_0x4bf4d7-0x0;var _0x3130c4=_0xc1ed[_0x4bf4d7];return _0x3130c4;};'use strict';var client=require('../client');exports[_0xdc1e('0x0')]=function(){return function(){return client[_0xdc1e('0x1')](_0xdc1e('0x2'),{'options':{'raw':![],'attributes':['id',_0xdc1e('0x3'),'timeout','strategy'],'include':[{'model':_0xdc1e('0x4'),'as':_0xdc1e('0x5'),'attributes':['id',_0xdc1e('0x3'),_0xdc1e('0x6'),_0xdc1e('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xc6ba=['Agents','name','online','mailPause','getMailQueues','GetMailQueue','timeout','User'];(function(_0x94d36a,_0x2233cf){var _0x27eafc=function(_0x14bffc){while(--_0x14bffc){_0x94d36a['push'](_0x94d36a['shift']());}};_0x27eafc(++_0x2233cf);}(_0xc6ba,0x74));var _0xac6b=function(_0xe3cc3,_0xe11f6f){_0xe3cc3=_0xe3cc3-0x0;var _0x103f20=_0xc6ba[_0xe3cc3];return _0x103f20;};'use strict';var client=require('../client');exports[_0xac6b('0x0')]=function(){return function(){return client['Request'](_0xac6b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xac6b('0x2'),'strategy'],'include':[{'model':_0xac6b('0x3'),'as':_0xac6b('0x4'),'attributes':['id',_0xac6b('0x5'),_0xac6b('0x6'),_0xac6b('0x7')]}]},'log':_0xac6b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index b884df1..80545b5 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 _0x0eb8=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client','create'];(function(_0x932a31,_0x4ca734){var _0x244dea=function(_0x5c137c){while(--_0x5c137c){_0x932a31['push'](_0x932a31['shift']());}};_0x244dea(++_0x4ca734);}(_0x0eb8,0xb4));var _0x80eb=function(_0x37fcc2,_0x25d689){_0x37fcc2=_0x37fcc2-0x0;var _0x186f58=_0x0eb8[_0x37fcc2];return _0x186f58;};'use strict';var client=require(_0x80eb('0x0'));exports[_0x80eb('0x1')]=function(_0x1147cc){return client['Request']('CreateMailQueueReport',{'body':_0x1147cc,'log':_0x80eb('0x2')});};exports[_0x80eb('0x3')]=function(_0x454232,_0x1c90eb){return client[_0x80eb('0x4')](_0x80eb('0x5'),{'body':_0x1c90eb,'options':{'where':{'uniqueid':_0x454232},'order':[['id',_0x80eb('0x6')]],'limit':0x1},'log':_0x80eb('0x5')});}; \ No newline at end of file +var _0x7e86=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0xa198f8,_0x16c0e7){var _0x98c663=function(_0x4e4e86){while(--_0x4e4e86){_0xa198f8['push'](_0xa198f8['shift']());}};_0x98c663(++_0x16c0e7);}(_0x7e86,0x95));var _0x67e8=function(_0x5cbd22,_0x4d52d6){_0x5cbd22=_0x5cbd22-0x0;var _0x40ffaa=_0x7e86[_0x5cbd22];return _0x40ffaa;};'use strict';var client=require(_0x67e8('0x0'));exports[_0x67e8('0x1')]=function(_0x1f49d6){return client[_0x67e8('0x2')](_0x67e8('0x3'),{'body':_0x1f49d6,'log':'CreateMailQueueReport'});};exports[_0x67e8('0x4')]=function(_0x39c7b0,_0x597602){return client['Request'](_0x67e8('0x5'),{'body':_0x597602,'options':{'where':{'uniqueid':_0x39c7b0},'order':[['id',_0x67e8('0x6')]],'limit':0x1},'log':_0x67e8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index fb001de..71d8838 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 _0x16d9=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x242782,_0x234e08){var _0x5a6057=function(_0x2c3906){while(--_0x2c3906){_0x242782['push'](_0x242782['shift']());}};_0x5a6057(++_0x234e08);}(_0x16d9,0x1ae));var _0x916d=function(_0xc17d60,_0x4d3616){_0xc17d60=_0xc17d60-0x0;var _0x462396=_0x16d9[_0xc17d60];return _0x462396;};'use strict';var client=require(_0x916d('0x0'));exports[_0x916d('0x1')]=function(_0x3c38e2,_0x4eec28){return client[_0x916d('0x2')](_0x916d('0x3'),{'body':_0x4eec28,'options':{'where':{'id':_0x3c38e2}},'log':_0x916d('0x4')});};exports[_0x916d('0x5')]=function(_0x3e3520,_0x93aace){return client[_0x916d('0x2')](_0x916d('0x6'),{'body':_0x93aace,'options':{'where':{'id':_0x3e3520}},'log':_0x916d('0x7')});}; \ No newline at end of file +var _0x96af=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xf295c4,_0x36d26e){var _0x5890c3=function(_0x4ed957){while(--_0x4ed957){_0xf295c4['push'](_0xf295c4['shift']());}};_0x5890c3(++_0x36d26e);}(_0x96af,0x1a1));var _0xf96a=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x96af[_0x16ea87];return _0x6e7b1c;};'use strict';var client=require(_0xf96a('0x0'));exports[_0xf96a('0x1')]=function(_0x32cb08,_0x7a0eb2){return client[_0xf96a('0x2')](_0xf96a('0x3'),{'body':_0x7a0eb2,'options':{'where':{'id':_0x32cb08}},'log':_0xf96a('0x4')});};exports['addTags']=function(_0x1cd17b,_0x1b5916){return client[_0xf96a('0x2')](_0xf96a('0x5'),{'body':_0x1b5916,'options':{'where':{'id':_0x1cd17b}},'log':_0xf96a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c05f65f..3ff5771 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 _0xb740=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb740,0xdf));var _0x0b74=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb740[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0b74('0x0'));exports['create']=function(_0x327f56){return client[_0x0b74('0x1')](_0x0b74('0x2'),{'body':_0x327f56,'log':_0x0b74('0x3')});}; \ No newline at end of file +var _0x46f9=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x43c1c5,_0x2401d1){var _0x5d0f4a=function(_0x286771){while(--_0x286771){_0x43c1c5['push'](_0x43c1c5['shift']());}};_0x5d0f4a(++_0x2401d1);}(_0x46f9,0x15a));var _0x946f=function(_0x36398b,_0x46a031){_0x36398b=_0x36398b-0x0;var _0x460e1d=_0x46f9[_0x36398b];return _0x460e1d;};'use strict';var client=require(_0x946f('0x0'));exports[_0x946f('0x1')]=function(_0x502ec3){return client[_0x946f('0x2')](_0x946f('0x3'),{'body':_0x502ec3,'log':_0x946f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 9779a71..6b5741f 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 _0x066f=['Agents','openchannelPause','getOpenchannelQueues','Request','name','timeout','User'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x066f,0x137));var _0xf066=function(_0x44e349,_0xb833a0){_0x44e349=_0x44e349-0x0;var _0x3d6486=_0x066f[_0x44e349];return _0x3d6486;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xf066('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xf066('0x1'),_0xf066('0x2'),'strategy'],'include':[{'model':_0xf066('0x3'),'as':_0xf066('0x4'),'attributes':['id',_0xf066('0x1'),'online',_0xf066('0x5')]}]},'log':_0xf066('0x6')});};}; \ No newline at end of file +var _0x7b00=['online','openchannelPause','../client','getOpenchannelQueues','Request','name','User','Agents'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7b00,0x1ba));var _0x07b0=function(_0x2cfd28,_0x27b113){_0x2cfd28=_0x2cfd28-0x0;var _0x3c1282=_0x7b00[_0x2cfd28];return _0x3c1282;};'use strict';var client=require(_0x07b0('0x0'));exports[_0x07b0('0x1')]=function(){return function(){return client[_0x07b0('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x07b0('0x3'),'timeout','strategy'],'include':[{'model':_0x07b0('0x4'),'as':_0x07b0('0x5'),'attributes':['id',_0x07b0('0x3'),_0x07b0('0x6'),_0x07b0('0x7')]}]},'log':_0x07b0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6f6c1b8..6db96c2 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 _0x0b1e=['../client','create','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x0b1e,0x1ef));var _0xe0b1=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x0b1e[_0x5ecadc];return _0x565037;};'use strict';var client=require(_0xe0b1('0x0'));exports[_0xe0b1('0x1')]=function(_0x2e9887){return client[_0xe0b1('0x2')](_0xe0b1('0x3'),{'body':_0x2e9887,'log':_0xe0b1('0x3')});};exports['update']=function(_0x40effc,_0x25cad1){return client[_0xe0b1('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x25cad1,'options':{'where':{'uniqueid':_0x40effc},'order':[['id',_0xe0b1('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x783c=['Request','CreateOpenchannelQueueReport','update','../client'];(function(_0x4dcc61,_0xdb4e11){var _0x10a2ba=function(_0x523a36){while(--_0x523a36){_0x4dcc61['push'](_0x4dcc61['shift']());}};_0x10a2ba(++_0xdb4e11);}(_0x783c,0xaf));var _0xc783=function(_0x17a015,_0x21164f){_0x17a015=_0x17a015-0x0;var _0x52f198=_0x783c[_0x17a015];return _0x52f198;};'use strict';var client=require(_0xc783('0x0'));exports['create']=function(_0x2d3072){return client[_0xc783('0x1')](_0xc783('0x2'),{'body':_0x2d3072,'log':'CreateOpenchannelQueueReport'});};exports[_0xc783('0x3')]=function(_0x5197d2,_0x19d54f){return client[_0xc783('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x19d54f,'options':{'where':{'uniqueid':_0x5197d2},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 68c0f71..643c9ce 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 _0xaab2=['addTags','AddTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2120e0,_0x591baf){var _0x116e96=function(_0xfc9bd){while(--_0xfc9bd){_0x2120e0['push'](_0x2120e0['shift']());}};_0x116e96(++_0x591baf);}(_0xaab2,0xca));var _0x2aab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaab2[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports[_0x2aab('0x0')]=function(_0x341c15,_0x1d1057){return client['Request'](_0x2aab('0x1'),{'body':_0x1d1057,'options':{'where':{'id':_0x341c15}},'log':_0x2aab('0x2')});};exports[_0x2aab('0x3')]=function(_0x342fe5,_0x3d6ee0){return client['Request'](_0x2aab('0x4'),{'body':_0x3d6ee0,'options':{'where':{'id':_0x342fe5}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x34e8=['update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','../client'];(function(_0x330d16,_0x417bd8){var _0x3caff7=function(_0x2ebd0e){while(--_0x2ebd0e){_0x330d16['push'](_0x330d16['shift']());}};_0x3caff7(++_0x417bd8);}(_0x34e8,0x12c));var _0x834e=function(_0x1d8b0b,_0x376b38){_0x1d8b0b=_0x1d8b0b-0x0;var _0x533fe5=_0x34e8[_0x1d8b0b];return _0x533fe5;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339,_0x35e6fb){return client['Request'](_0x834e('0x2'),{'body':_0x35e6fb,'options':{'where':{'id':_0x8b339}},'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x31bf20,_0x289ef2){return client[_0x834e('0x5')](_0x834e('0x6'),{'body':_0x289ef2,'options':{'where':{'id':_0x31bf20}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index ba14ca5..be48b33 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 _0xd83d=['../client','create','Request'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xd83d,0x13b));var _0xdd83=function(_0x13c738,_0x30dee6){_0x13c738=_0x13c738-0x0;var _0x2248fc=_0xd83d[_0x13c738];return _0x2248fc;};'use strict';var client=require(_0xdd83('0x0'));exports[_0xdd83('0x1')]=function(_0x41f881){return client[_0xdd83('0x2')]('CreateSmsMessage',{'body':_0x41f881,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xf930=['create','Request','../client'];(function(_0x3fcd69,_0x86753c){var _0x2c2692=function(_0xd345b5){while(--_0xd345b5){_0x3fcd69['push'](_0x3fcd69['shift']());}};_0x2c2692(++_0x86753c);}(_0xf930,0x1bb));var _0x0f93=function(_0x4bf1e7,_0x31069d){_0x4bf1e7=_0x4bf1e7-0x0;var _0x29c5e5=_0xf930[_0x4bf1e7];return _0x29c5e5;};'use strict';var client=require(_0x0f93('0x0'));exports[_0x0f93('0x1')]=function(_0x478a8a){return client[_0x0f93('0x2')]('CreateSmsMessage',{'body':_0x478a8a,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 08a2f4e..9716d33 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3b55a6,_0x36cd7c){var _0x2da6da=function(_0x64909a){while(--_0x64909a){_0x3b55a6['push'](_0x3b55a6['shift']());}};_0x2da6da(++_0x36cd7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0xcb91[_0x2a4095];return _0x52eeab;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x172997,_0x3b4228){var _0x138049=function(_0x259b86){while(--_0x259b86){_0x172997['push'](_0x172997['shift']());}};_0x138049(++_0x3b4228);}(_0x70e0,0x17b));var _0x070e=function(_0x4d34b9,_0x401a4d){_0x4d34b9=_0x4d34b9-0x0;var _0x2d104f=_0x70e0[_0x4d34b9];return _0x2d104f;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index de75097..eaf2d1b 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(_0x41d523,_0x5f2a67){var _0x3719cc=function(_0x109d4a){while(--_0x109d4a){_0x41d523['push'](_0x41d523['shift']());}};_0x3719cc(++_0x5f2a67);}(_0x55ca,0x126));var _0xa55c=function(_0x2ed51e,_0x20d606){_0x2ed51e=_0x2ed51e-0x0;var _0x44318c=_0x55ca[_0x2ed51e];return _0x44318c;};'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(_0x7c918b,_0x5e5621){var _0x20b03c=function(_0x6035e1){while(--_0x6035e1){_0x7c918b['push'](_0x7c918b['shift']());}};_0x20b03c(++_0x5e5621);}(_0x3e74,0x175));var _0x43e7=function(_0x16b359,_0x567f43){_0x16b359=_0x16b359-0x0;var _0x3db5cf=_0x3e74[_0x16b359];return _0x3db5cf;};'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 5142f48..2732390 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(_0x240776,_0xeefa88){var _0x58d284=function(_0x282097){while(--_0x282097){_0x240776['push'](_0x240776['shift']());}};_0x58d284(++_0xeefa88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x348c13,_0x492072){var _0x3528f7=function(_0x570007){while(--_0x570007){_0x348c13['push'](_0x348c13['shift']());}};_0x3528f7(++_0x492072);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 1097cad..df3e437 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 _0x5ae0=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','addTags'];(function(_0x227b64,_0x1c6f72){var _0xc84cb5=function(_0x12e690){while(--_0x12e690){_0x227b64['push'](_0x227b64['shift']());}};_0xc84cb5(++_0x1c6f72);}(_0x5ae0,0xf8));var _0x05ae=function(_0x1cac25,_0x292606){_0x1cac25=_0x1cac25-0x0;var _0x2695f4=_0x5ae0[_0x1cac25];return _0x2695f4;};'use strict';var client=require('../client');exports[_0x05ae('0x0')]=function(_0x267a88,_0x529b07){return client[_0x05ae('0x1')](_0x05ae('0x2'),{'body':_0x529b07,'options':{'where':{'id':_0x267a88}},'log':'updateWhatsappInteraction'});};exports[_0x05ae('0x3')]=function(_0xaae02b,_0x4aac85){return client['Request'](_0x05ae('0x4'),{'body':_0x4aac85,'options':{'where':{'id':_0xaae02b}},'log':_0x05ae('0x5')});}; \ No newline at end of file +var _0x972c=['Request','AddTagsToWhatsappInteraction','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x972c,0xf2));var _0xc972=function(_0x3e572e,_0xd91a7e){_0x3e572e=_0x3e572e-0x0;var _0x2f9740=_0x972c[_0x3e572e];return _0x2f9740;};'use strict';var client=require('../client');exports['update']=function(_0x3429a4,_0x19626d){return client['Request'](_0xc972('0x0'),{'body':_0x19626d,'options':{'where':{'id':_0x3429a4}},'log':_0xc972('0x1')});};exports['addTags']=function(_0x511ad4,_0x140e13){return client[_0xc972('0x2')](_0xc972('0x3'),{'body':_0x140e13,'options':{'where':{'id':_0x511ad4}},'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 d08ab9f..1f232f9 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 _0x8e40=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8e40,0x17c));var _0x08e4=function(_0x54a28a,_0x1ba1fe){_0x54a28a=_0x54a28a-0x0;var _0x3da1f1=_0x8e40[_0x54a28a];return _0x3da1f1;};'use strict';var client=require(_0x08e4('0x0'));exports[_0x08e4('0x1')]=function(_0x34dc3c){return client[_0x08e4('0x2')](_0x08e4('0x3'),{'body':_0x34dc3c,'log':_0x08e4('0x4')});}; \ No newline at end of file +var _0xf48d=['CreateWhatsappMessage','createWhatsappMessage','../client','Request'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xf48d,0x15a));var _0xdf48=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xf48d[_0xe1a3a5];return _0x362646;};'use strict';var client=require(_0xdf48('0x0'));exports['create']=function(_0x2cbe5a){return client[_0xdf48('0x1')](_0xdf48('0x2'),{'body':_0x2cbe5a,'log':_0xdf48('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 4a499c6..7059760 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 _0xdd4b=['timeout','User','Agents','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x225e24,_0x478574){var _0x526038=function(_0xfe2533){while(--_0xfe2533){_0x225e24['push'](_0x225e24['shift']());}};_0x526038(++_0x478574);}(_0xdd4b,0x164));var _0xbdd4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdd4b[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0xbdd4('0x0'));exports[_0xbdd4('0x1')]=function(){return function(){return client['Request'](_0xbdd4('0x2'),{'options':{'raw':![],'attributes':['id',_0xbdd4('0x3'),_0xbdd4('0x4'),'strategy'],'include':[{'model':_0xbdd4('0x5'),'as':_0xbdd4('0x6'),'attributes':['id',_0xbdd4('0x3'),'online',_0xbdd4('0x7')]}]},'log':_0xbdd4('0x1')});};}; \ No newline at end of file +var _0x0d82=['User','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy'];(function(_0x2a7f45,_0x25faad){var _0xac3368=function(_0x1826f5){while(--_0x1826f5){_0x2a7f45['push'](_0x2a7f45['shift']());}};_0xac3368(++_0x25faad);}(_0x0d82,0x7b));var _0x20d8=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x0d82[_0x5f09c5];return _0x426ad9;};'use strict';var client=require(_0x20d8('0x0'));exports[_0x20d8('0x1')]=function(){return function(){return client[_0x20d8('0x2')](_0x20d8('0x3'),{'options':{'raw':![],'attributes':['id',_0x20d8('0x4'),_0x20d8('0x5'),_0x20d8('0x6')],'include':[{'model':_0x20d8('0x7'),'as':_0x20d8('0x8'),'attributes':['id',_0x20d8('0x4'),'online',_0x20d8('0x9')]}]},'log':_0x20d8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 427f5e0..d6aaa70 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 _0x9132=['Request','UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','update'];(function(_0x3e973f,_0x318928){var _0x19e5ac=function(_0x215f17){while(--_0x215f17){_0x3e973f['push'](_0x3e973f['shift']());}};_0x19e5ac(++_0x318928);}(_0x9132,0x89));var _0x2913=function(_0x3c2d4f,_0x2b6c4c){_0x3c2d4f=_0x3c2d4f-0x0;var _0x380ed3=_0x9132[_0x3c2d4f];return _0x380ed3;};'use strict';var client=require('../client');exports[_0x2913('0x0')]=function(_0x3afd19){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3afd19,'log':_0x2913('0x1')});};exports[_0x2913('0x2')]=function(_0x1b8db8,_0x4441ba){return client[_0x2913('0x3')](_0x2913('0x4'),{'body':_0x4441ba,'options':{'where':{'uniqueid':_0x1b8db8},'order':[['id','DESC']],'limit':0x1},'log':_0x2913('0x4')});}; \ No newline at end of file +var _0x8efa=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x269ca5,_0x349069){var _0x3bac13=function(_0x4f460e){while(--_0x4f460e){_0x269ca5['push'](_0x269ca5['shift']());}};_0x3bac13(++_0x349069);}(_0x8efa,0xd0));var _0xa8ef=function(_0xb323c7,_0x12507b){_0xb323c7=_0xb323c7-0x0;var _0x2d4e5d=_0x8efa[_0xb323c7];return _0x2d4e5d;};'use strict';var client=require(_0xa8ef('0x0'));exports['create']=function(_0x3ed7d9){return client[_0xa8ef('0x1')](_0xa8ef('0x2'),{'body':_0x3ed7d9,'log':'CreateWhatsappQueueReport'});};exports[_0xa8ef('0x3')]=function(_0x44c584,_0x53085b){return client[_0xa8ef('0x1')](_0xa8ef('0x4'),{'body':_0x53085b,'options':{'where':{'uniqueid':_0x44c584},'order':[['id',_0xa8ef('0x5')]],'limit':0x1},'log':_0xa8ef('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 6a7c37b..adbb95a 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 _0x5ddb=['agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','find','agents','atimeout','channel','rules','end','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5ddb,0xec));var _0xb5dd=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x5ddb[_0x5f3f88];return _0xd08119;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xb5dd('0x0'));var seqqueue=require(_0xb5dd('0x1'));var logger=require(_0xb5dd('0x2'))(_0xb5dd('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb5dd('0x4'),'required':!![],'message':_0xb5dd('0x5')},'timeout':{'type':_0xb5dd('0x6'),'message':_0xb5dd('0x7')}});function writeLog(_0x4922c1,_0x8f50c1,_0x4c2b7b){return logger[_0xb5dd('0x8')](util[_0xb5dd('0x9')](_0xb5dd('0xa'),_0x4922c1,_0x8f50c1[_0xb5dd('0xb')],_0x4c2b7b));}function handleFindAgent(_0x216bb){return function(_0x3ce2cf){return _0x3ce2cf[_0xb5dd('0xb')][_0xb5dd('0xc')]()===_0x216bb[_0xb5dd('0xc')]();};}exports['consequence']=function(_0x54b298,_0x438a48,_0x4170cd,_0x2f46d1){return function(_0x609e6f){try{var _0x47370c={'name':_0x438a48[0x0],'timeout':_0x438a48[0x1]};var _0x2e76d5=queue['validate'](_0x47370c,{'typecast':!![]});if(_0x2e76d5[_0xb5dd('0xd')]){logger[_0xb5dd('0xe')](_0xb5dd('0xf'),_0x54b298,_[_0xb5dd('0x10')](_0x2e76d5,'message')['join'](',\x20'));_0x609e6f['stop']();}else{var _0x775b4e=_[_0xb5dd('0x11')](_0x4170cd[_0xb5dd('0x12')],handleFindAgent(_0x47370c[_0xb5dd('0xb')]));if(_0x775b4e){var _0x337ba0=(_0x47370c['timeout']||0xa)*0x3e8;var _0x22c538,_0x33aec7;var _0x3100fb=seqqueue['createQueue'](_0x337ba0);_0x3100fb['id']=_0x54b298;_0x3100fb[_0xb5dd('0x13')]=_0x337ba0;_0x3100fb['channel']=_0x2f46d1[_0xb5dd('0x14')];writeLog(_0x54b298,_0x775b4e,util['format']('START:%s',_0x337ba0));_0x4170cd[_0xb5dd('0x15')][_0x54b298]['on'](_0xb5dd('0x16'),function(){logger[_0xb5dd('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x54b298);clearTimeout(_0x33aec7);_0x33aec7=undefined;_0x3100fb[_0xb5dd('0x17')]();if(_0x4170cd[_0xb5dd('0x15')][_0x54b298]){delete _0x4170cd[_0xb5dd('0x15')][_0x54b298];}_0x609e6f[_0xb5dd('0x18')]();});_0x4170cd['rules'][_0x54b298]['on'](_0xb5dd('0x19'),function(){if(_0x4170cd['rules'][_0x54b298]){delete _0x4170cd['rules'][_0x54b298];}});_0x33aec7=setTimeout(function(){logger['info'](_0xb5dd('0x1a'),_0x54b298);clearTimeout(_0x33aec7);_0x3100fb[_0xb5dd('0x17')]();_0x609e6f[_0xb5dd('0x1b')]();},_0x337ba0);strategy[_0xb5dd('0x1c')](_0x3100fb,_0x775b4e,_0x4170cd,_0x2f46d1);}else{logger[_0xb5dd('0xe')](_0xb5dd('0x1d'),_0x54b298,_0x47370c[_0xb5dd('0xb')]);_0x609e6f['stop']();}}}catch(_0x19e764){console[_0xb5dd('0x1e')](_0x19e764);logger[_0xb5dd('0xe')](_0xb5dd('0x1f'),_0x54b298,_0x19e764[_0xb5dd('0x20')]);_0x609e6f[_0xb5dd('0x18')]();}};}; \ No newline at end of file +var _0x2b2d=['number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x1f2a29,_0x19a590){var _0x2ef3c8=function(_0x1f45fb){while(--_0x1f45fb){_0x1f2a29['push'](_0x1f2a29['shift']());}};_0x2ef3c8(++_0x19a590);}(_0x2b2d,0x18f));var _0xd2b2=function(_0x7c0646,_0x45d16b){_0x7c0646=_0x7c0646-0x0;var _0x32416d=_0x2b2d[_0x7c0646];return _0x32416d;};'use strict';var schema=require(_0xd2b2('0x0'));var _=require(_0xd2b2('0x1'));var util=require(_0xd2b2('0x2'));var seqqueue=require(_0xd2b2('0x3'));var logger=require('../../../../config/logger')(_0xd2b2('0x4'));var strategy=require(_0xd2b2('0x5'));var queue=schema({'name':{'type':_0xd2b2('0x6'),'required':!![],'message':_0xd2b2('0x7')},'timeout':{'type':_0xd2b2('0x8'),'message':_0xd2b2('0x9')}});function writeLog(_0xdfceb5,_0x2f24c3,_0x5ba84d){return logger['info'](util[_0xd2b2('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0xdfceb5,_0x2f24c3['name'],_0x5ba84d));}function handleFindAgent(_0x5513c0){return function(_0x32f132){return _0x32f132[_0xd2b2('0xb')][_0xd2b2('0xc')]()===_0x5513c0[_0xd2b2('0xc')]();};}exports[_0xd2b2('0xd')]=function(_0x4a94bb,_0x3544e6,_0xc04d8c,_0x4d859d){return function(_0x572cd6){try{var _0x48f794={'name':_0x3544e6[0x0],'timeout':_0x3544e6[0x1]};var _0x2f7483=queue['validate'](_0x48f794,{'typecast':!![]});if(_0x2f7483[_0xd2b2('0xe')]){logger[_0xd2b2('0xf')](_0xd2b2('0x10'),_0x4a94bb,_['map'](_0x2f7483,'message')[_0xd2b2('0x11')](',\x20'));_0x572cd6[_0xd2b2('0x12')]();}else{var _0x26e5d6=_[_0xd2b2('0x13')](_0xc04d8c[_0xd2b2('0x14')],handleFindAgent(_0x48f794[_0xd2b2('0xb')]));if(_0x26e5d6){var _0x32fda8=(_0x48f794[_0xd2b2('0x15')]||0xa)*0x3e8;var _0x521ec7,_0x2579da;var _0x3ec755=seqqueue[_0xd2b2('0x16')](_0x32fda8);_0x3ec755['id']=_0x4a94bb;_0x3ec755['atimeout']=_0x32fda8;_0x3ec755[_0xd2b2('0x17')]=_0x4d859d[_0xd2b2('0x17')];writeLog(_0x4a94bb,_0x26e5d6,util[_0xd2b2('0xa')](_0xd2b2('0x18'),_0x32fda8));_0xc04d8c[_0xd2b2('0x19')][_0x4a94bb]['on']('end',function(){logger[_0xd2b2('0x1a')](_0xd2b2('0x1b'),_0x4a94bb);clearTimeout(_0x2579da);_0x2579da=undefined;_0x3ec755[_0xd2b2('0x1c')]();if(_0xc04d8c['rules'][_0x4a94bb]){delete _0xc04d8c[_0xd2b2('0x19')][_0x4a94bb];}_0x572cd6[_0xd2b2('0x12')]();});_0xc04d8c[_0xd2b2('0x19')][_0x4a94bb]['on'](_0xd2b2('0x1d'),function(){if(_0xc04d8c[_0xd2b2('0x19')][_0x4a94bb]){delete _0xc04d8c[_0xd2b2('0x19')][_0x4a94bb];}});_0x2579da=setTimeout(function(){logger[_0xd2b2('0x1a')](_0xd2b2('0x1e'),_0x4a94bb);clearTimeout(_0x2579da);_0x3ec755[_0xd2b2('0x1c')]();_0x572cd6[_0xd2b2('0x1f')]();},_0x32fda8);strategy[_0xd2b2('0x20')](_0x3ec755,_0x26e5d6,_0xc04d8c,_0x4d859d);}else{logger[_0xd2b2('0xf')](_0xd2b2('0x21'),_0x4a94bb,_0x48f794[_0xd2b2('0xb')]);_0x572cd6['stop']();}}}catch(_0x1a5928){console[_0xd2b2('0x22')](_0x1a5928);logger[_0xd2b2('0xf')](_0xd2b2('0x23'),_0x4a94bb,_0x1a5928[_0xd2b2('0x24')]);_0x572cd6[_0xd2b2('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 9aed1cd..0f0e378 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 _0xd36f=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','next','message','amazonlex','providerName','providerResponse','dialogState','Failed','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','Message','create','then','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd36f,0x169));var _0xfd36=function(_0x2cd9ae,_0x42707b){_0x2cd9ae=_0x2cd9ae-0x0;var _0x1c3d31=_0xd36f[_0x2cd9ae];return _0x1c3d31;};'use strict';var _=require(_0xfd36('0x0'));var moment=require('moment');var AWS=require(_0xfd36('0x1'));var utils=require(_0xfd36('0x2'));var logger=require(_0xfd36('0x3'))(_0xfd36('0x4'));var rpc={'chatMessage':require(_0xfd36('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfd36('0x6')),'smsMessage':require(_0xfd36('0x7')),'faxMessage':require(_0xfd36('0x8')),'whatsappMessage':require(_0xfd36('0x9'))};exports['consequence']=function(_0x550c1c,_0x278f5d){return function(_0x3d670f){try{if(!_[_0xfd36('0xa')](this[_0xfd36('0xb')][_0xfd36('0xc')])){logger[_0xfd36('0xd')]('[%s][AMAZONLEX]\x20%s',_0x550c1c,_0xfd36('0xe'));return _0x3d670f['next']();}var _0x55abe4={'ContactId':this['contact']['id'],'sentAt':moment()[_0xfd36('0xf')](_0xfd36('0x10')),'direction':_0xfd36('0x11')};if(this['channel']===_0xfd36('0x12')||this[_0xfd36('0x13')]===_0xfd36('0x14')){_0x55abe4[_0xfd36('0x15')]=this['interaction'][_0xfd36('0x15')];}var _0x99db99=this['channel'];if(_0x99db99===_0xfd36('0x16')){_0x55abe4[_0xfd36('0x17')]=this['account']['id'];}else{_0x55abe4[_[_0xfd36('0x18')](_0x99db99)+_0xfd36('0x19')]=this[_0xfd36('0x1a')]['id'];}_0x55abe4[_[_0xfd36('0x18')](_0x99db99)+_0xfd36('0x1b')]=this[_0xfd36('0xb')]['id'];if(this[_0xfd36('0xb')][_0xfd36('0x1c')]){var _0x4159b2=_0x278f5d[0x4];if(!_['isEmpty'](_0x4159b2)){_0x55abe4[_0xfd36('0x1d')]=utils['getMustacheRender'](_0x4159b2,this);return rpc[_0x99db99+_0xfd36('0x1e')][_0xfd36('0x1f')](_0x55abe4)[_0xfd36('0x20')](function(_0x2a53ba){logger[_0xfd36('0xd')](_0xfd36('0x21'),_0x550c1c,_0x55abe4[_0xfd36('0x1d')]);})['catch'](function(_0x2257a5){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x2257a5));})[_0xfd36('0x24')](function(){logger[_0xfd36('0xd')](_0xfd36('0x25'),_0x550c1c);_0x3d670f[_0xfd36('0x26')]();});}else{logger['info'](_0xfd36('0x27'),_0x550c1c);_0x3d670f[_0xfd36('0x26')]();}}else{var _0x272808=this;var _0xc68815=new AWS[(_0xfd36('0x28'))]({'accessKeyId':_0x278f5d[0x0],'secretAccessKey':_0x278f5d[0x1],'region':_0x278f5d[0x2]});var _0x36009f={'botAlias':'$LATEST','botName':_0x278f5d[0x3],'inputText':this['message'][_0xfd36('0x1d')],'userId':this['channel']+':'+this[_0xfd36('0xb')]['id'][_0xfd36('0x29')]()};_0xc68815['postText'](_0x36009f,function(_0x7c1a35,_0x589c47){if(_0x7c1a35){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,_0x7c1a35['message']);_0x3d670f[_0xfd36('0x2a')]();}else if(_0x589c47&&_0x589c47[_0xfd36('0x2b')]){_0x272808[_0xfd36('0x1d')][_0xfd36('0x2c')]=_0x589c47;_0x55abe4[_0xfd36('0x1d')]=_0x589c47[_0xfd36('0x2b')];_0x55abe4[_0xfd36('0x2d')]='amazonlex';_0x55abe4[_0xfd36('0x2e')]=JSON[_0xfd36('0x23')](_0x589c47);return rpc[_0x99db99+_0xfd36('0x1e')][_0xfd36('0x1f')](_0x55abe4)[_0xfd36('0x20')](function(_0x1e6f65){logger['info'](_0xfd36('0x21'),_0x550c1c,_0x55abe4['body']);if(_0x589c47[_0xfd36('0x2f')]==_0xfd36('0x30')){_0x3d670f[_0xfd36('0x2a')]();}else{_0x3d670f[_0xfd36('0x26')]();}})[_0xfd36('0x31')](function(_0x1e2219){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x1e2219));_0x3d670f['next']();});}else{_0x3d670f[_0xfd36('0x2a')]();}});}}catch(_0x1c81b6){logger[_0xfd36('0x22')](_0xfd36('0x21'),_0x550c1c,JSON[_0xfd36('0x23')](_0x1c81b6));_0x3d670f[_0xfd36('0x26')]();}};}; \ No newline at end of file +var _0xd483=['isEmpty','create','then','info','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','postText','amazonlex','providerName','stringify','Message','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd483,0x17b));var _0x3d48=function(_0x1dbbfa,_0x267d75){_0x1dbbfa=_0x1dbbfa-0x0;var _0x36ba65=_0xd483[_0x1dbbfa];return _0x36ba65;};'use strict';var _=require('lodash');var moment=require(_0x3d48('0x0'));var AWS=require('aws-sdk');var utils=require(_0x3d48('0x1'));var logger=require(_0x3d48('0x2'))('routing');var rpc={'chatMessage':require(_0x3d48('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3d48('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3d48('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3d48('0x6')]=function(_0x377b43,_0x47c6da){return function(_0x900a90){try{if(!_[_0x3d48('0x7')](this[_0x3d48('0x8')][_0x3d48('0x9')])){logger['info'](_0x3d48('0xa'),_0x377b43,_0x3d48('0xb'));return _0x900a90[_0x3d48('0xc')]();}var _0x2980e1={'ContactId':this[_0x3d48('0xd')]['id'],'sentAt':moment()[_0x3d48('0xe')](_0x3d48('0xf')),'direction':_0x3d48('0x10')};if(this[_0x3d48('0x11')]==='sms'||this[_0x3d48('0x11')]===_0x3d48('0x12')){_0x2980e1[_0x3d48('0x13')]=this[_0x3d48('0x8')][_0x3d48('0x13')];}var _0x1955b8=this[_0x3d48('0x11')];if(_0x1955b8==='chat'){_0x2980e1[_0x3d48('0x14')]=this[_0x3d48('0x15')]['id'];}else{_0x2980e1[_[_0x3d48('0x16')](_0x1955b8)+_0x3d48('0x17')]=this['account']['id'];}_0x2980e1[_[_0x3d48('0x16')](_0x1955b8)+_0x3d48('0x18')]=this[_0x3d48('0x8')]['id'];if(this['interaction'][_0x3d48('0x19')]){var _0x533ad3=_0x47c6da[0x4];if(!_[_0x3d48('0x1a')](_0x533ad3)){_0x2980e1['body']=utils['getMustacheRender'](_0x533ad3,this);return rpc[_0x1955b8+'Message'][_0x3d48('0x1b')](_0x2980e1)[_0x3d48('0x1c')](function(_0x383e77){logger[_0x3d48('0x1d')](_0x3d48('0xa'),_0x377b43,_0x2980e1['body']);})[_0x3d48('0x1e')](function(_0x27097e){logger[_0x3d48('0x1f')](_0x3d48('0xa'),_0x377b43,JSON['stringify'](_0x27097e));})[_0x3d48('0x20')](function(){logger[_0x3d48('0x1d')](_0x3d48('0x21'),_0x377b43);_0x900a90['stop']();});}else{logger[_0x3d48('0x1d')](_0x3d48('0x22'),_0x377b43);_0x900a90[_0x3d48('0x23')]();}}else{var _0x923d04=this;var _0xf13966=new AWS[(_0x3d48('0x24'))]({'accessKeyId':_0x47c6da[0x0],'secretAccessKey':_0x47c6da[0x1],'region':_0x47c6da[0x2]});var _0x9b4205={'botAlias':_0x3d48('0x25'),'botName':_0x47c6da[0x3],'inputText':this[_0x3d48('0x26')][_0x3d48('0x27')],'userId':this[_0x3d48('0x11')]+':'+this[_0x3d48('0x8')]['id']['toString']()};_0xf13966[_0x3d48('0x28')](_0x9b4205,function(_0x578494,_0x5d142e){if(_0x578494){logger[_0x3d48('0x1f')](_0x3d48('0xa'),_0x377b43,_0x578494['message']);_0x900a90[_0x3d48('0xc')]();}else if(_0x5d142e&&_0x5d142e['message']){_0x923d04[_0x3d48('0x27')][_0x3d48('0x29')]=_0x5d142e;_0x2980e1[_0x3d48('0x27')]=_0x5d142e[_0x3d48('0x26')];_0x2980e1[_0x3d48('0x2a')]=_0x3d48('0x29');_0x2980e1['providerResponse']=JSON[_0x3d48('0x2b')](_0x5d142e);return rpc[_0x1955b8+_0x3d48('0x2c')]['create'](_0x2980e1)[_0x3d48('0x1c')](function(_0x2bd2a4){logger['info']('[%s][AMAZONLEX]\x20%s',_0x377b43,_0x2980e1[_0x3d48('0x27')]);if(_0x5d142e['dialogState']=='Failed'){_0x900a90[_0x3d48('0xc')]();}else{_0x900a90['stop']();}})['catch'](function(_0x10961a){logger[_0x3d48('0x1f')](_0x3d48('0xa'),_0x377b43,JSON[_0x3d48('0x2b')](_0x10961a));_0x900a90['next']();});}else{_0x900a90[_0x3d48('0xc')]();}});}}catch(_0x173dca){logger['error'](_0x3d48('0xa'),_0x377b43,JSON[_0x3d48('0x2b')](_0x173dca));_0x900a90['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 187bdf6..8449e1c 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 _0x8ca7=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','from','message','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','InteractionId','Message','account','Smtp','service','port','secure','authentication','pass','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify'];(function(_0x3bd269,_0x264451){var _0x38f86d=function(_0x35fed3){while(--_0x35fed3){_0x3bd269['push'](_0x3bd269['shift']());}};_0x38f86d(++_0x264451);}(_0x8ca7,0xf0));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var moment=require(_0x78ca('0x1'));var utils=require(_0x78ca('0x2'));var logger=require(_0x78ca('0x3'))('routing');var rpc={'chatMessage':require(_0x78ca('0x4')),'openchannelMessage':require(_0x78ca('0x5')),'mailMessage':require(_0x78ca('0x6')),'smsMessage':require(_0x78ca('0x7')),'faxMessage':require(_0x78ca('0x8')),'whatsappMessage':require(_0x78ca('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x78ca('0xa')),'mailInteraction':require(_0x78ca('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x78ca('0xc')),'whatsappInteraction':require(_0x78ca('0xd'))};var mailRpc=require(_0x78ca('0xe'));exports['consequence']=function(_0x435db9,_0x100913,_0x5e68ef,_0xa3ef3a){return function(_0x1c3495){try{var _0x341688=this[_0x78ca('0xf')];if(_0x341688===_0x78ca('0x10')&&_0xa3ef3a['body'][_0x78ca('0x11')]){logger['info'](_0x78ca('0x12'),_0x435db9,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1c3495['next']();}if(_0x100913[0x0]==='1'&&(_[_0x78ca('0x13')](this[_0x78ca('0x14')][_0x78ca('0x15')])||!this[_0x78ca('0x14')][_0x78ca('0x15')])){logger[_0x78ca('0x16')]('[%s][AUTOREPLY]\x20%s',_0x435db9,_0x78ca('0x17'));return _0x1c3495[_0x78ca('0x18')]();}if(_0x100913[0x0]==='2'&&this[_0x78ca('0x14')][_0x78ca('0x19')]){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,'One\x20Time\x20already\x20sent');return _0x1c3495['next']();}var _0x3940d0={'ContactId':this[_0x78ca('0x1b')]['id'],'sentAt':moment()[_0x78ca('0x1c')](_0x78ca('0x1d')),'direction':'out'};if(this['channel']===_0x78ca('0x10')){_0x3940d0[_0x78ca('0x1e')]=utils[_0x78ca('0x1f')](_0x100913[0x2],this);}else{_0x3940d0['body']=utils[_0x78ca('0x1f')](_0x100913[0x1],this);}if(this['message']){_0x3940d0['to']=this['message'][_0x78ca('0x20')]||'';if(this[_0x78ca('0xf')]===_0x78ca('0x10')&&_0x100913[0x1]==='1'){_0x3940d0['cc']=this[_0x78ca('0x21')]['cc']||'';}_0x3940d0[_0x78ca('0x20')]=this['message']['to']||'';_0x3940d0[_0x78ca('0x22')]=this['message']['phone']||'';_0x3940d0['read']=!![];if(this[_0x78ca('0x21')]['subject']){_0x3940d0[_0x78ca('0x23')]='';_0x3940d0[_0x78ca('0x23')]+=_[_0x78ca('0x24')](this[_0x78ca('0x21')]['subject'],_0x78ca('0x25'))?'':_0x78ca('0x26');_0x3940d0['subject']+=this[_0x78ca('0x21')][_0x78ca('0x23')];}}if(this[_0x78ca('0xf')]===_0x78ca('0x27')){_0x3940d0[_0x78ca('0x28')]=this['account']['id'];}else{_0x3940d0[_['upperFirst'](this['channel'])+_0x78ca('0x29')]=this['account']['id'];}_0x3940d0[_['upperFirst'](this['channel'])+_0x78ca('0x2a')]=this[_0x78ca('0x14')]['id'];var _0x5c86b7=this['interaction'];if(rpc[this['channel']+_0x78ca('0x2b')]){if(this['channel']===_0x78ca('0x10')){var _0x39588e={'tls':{'rejectUnauthorized':![]}};if(this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x2e')]){_0x39588e['service']=this[_0x78ca('0x2c')][_0x78ca('0x2d')]['service'];}else{_0x39588e['host']=this[_0x78ca('0x2c')][_0x78ca('0x2d')]['host'];_0x39588e['port']=this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x2f')];_0x39588e[_0x78ca('0x30')]=this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x30')];}if(this[_0x78ca('0x2c')][_0x78ca('0x2d')][_0x78ca('0x31')]){_0x39588e['auth']={'user':this['account'][_0x78ca('0x2d')]['user'],'pass':this['account'][_0x78ca('0x2d')][_0x78ca('0x32')]};}_0x3940d0[_0x78ca('0x33')]=this[_0x78ca('0x21')][_0x78ca('0x34')];_0x3940d0[_0x78ca('0x35')]=_0x78ca('0x36')+_[_0x78ca('0x37')](_0x3940d0[_0x78ca('0x1e')],_0x78ca('0x38'),_0x78ca('0x39'))+_0x78ca('0x3a');_0x3940d0[_0x78ca('0x3b')]={'Auto-Submitted':_0x78ca('0x3c'),'X-Auto-Response-Suppress':_0x78ca('0x3d'),'Precedence':_0x78ca('0x3e')};return mailRpc[_0x78ca('0x3f')](_0x39588e,_0x3940d0)[_0x78ca('0x40')](function(_0x4b3d8f){logger['info'](_0x78ca('0x41'),_0x435db9);_0x3940d0[_0x78ca('0x34')]=_0x4b3d8f[_0x78ca('0x21')]['messageId'];return rpc[_0x341688+_0x78ca('0x2b')][_0x78ca('0x42')](_0x3940d0);})[_0x78ca('0x40')](function(_0x469d7c){logger[_0x78ca('0x16')](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x469d7c));})[_0x78ca('0x44')](function(_0x194349){logger[_0x78ca('0x45')](_0x78ca('0x46'),_0x435db9,JSON['stringify'](_0x194349));})[_0x78ca('0x47')](function(){Promise[_0x78ca('0x48')]()[_0x78ca('0x40')](function(){if(_0x100913[0x0]!=='2'||_0x5c86b7[_0x78ca('0x19')])return;return rpc[_0x341688+_0x78ca('0x49')][_0x78ca('0x4a')](_0x5c86b7['id'],{'autoreplyExecuted':!![]})[_0x78ca('0x40')](function(_0xa3ec9){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,JSON[_0x78ca('0x43')](_0xa3ec9));})[_0x78ca('0x44')](function(_0x493e0f){logger[_0x78ca('0x45')](_0x78ca('0x4b'),_0x435db9,JSON['stringify'](_0x493e0f));});})[_0x78ca('0x40')](function(){_0x1c3495[_0x78ca('0x18')]();});});}else{return rpc[this['channel']+_0x78ca('0x2b')]['create'](_0x3940d0)[_0x78ca('0x40')](function(_0x271d0f){logger[_0x78ca('0x16')](_0x78ca('0x12'),_0x435db9,_0x3940d0[_0x78ca('0x1e')]);})[_0x78ca('0x44')](function(_0x3ec5cd){logger['error'](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x3ec5cd));})[_0x78ca('0x47')](function(){Promise[_0x78ca('0x48')]()[_0x78ca('0x40')](function(){if(_0x100913[0x0]!=='2'||_0x5c86b7[_0x78ca('0x19')])return;return rpc[_0x341688+'Interaction'][_0x78ca('0x4a')](_0x5c86b7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2a5d54){logger[_0x78ca('0x16')](_0x78ca('0x1a'),_0x435db9,JSON[_0x78ca('0x43')](_0x2a5d54));})[_0x78ca('0x44')](function(_0x46cabb){logger[_0x78ca('0x45')](_0x78ca('0x4b'),_0x435db9,JSON[_0x78ca('0x43')](_0x46cabb));});})[_0x78ca('0x40')](function(){_0x1c3495[_0x78ca('0x18')]();});});}}}catch(_0x42df1b){logger[_0x78ca('0x45')](_0x78ca('0x12'),_0x435db9,JSON[_0x78ca('0x43')](_0x42df1b));_0x1c3495[_0x78ca('0x4c')]();}};}; \ No newline at end of file +var _0x8493=['channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','account','service','Smtp','host','port','secure','user','pass','inReplyTo','messageId','','','headers','auto-replied','All','auto_reply','sendMailMessage','then','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8493,0x11c));var _0x3849=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x8493[_0x934425];return _0x31d596;};'use strict';var _=require(_0x3849('0x0'));var moment=require(_0x3849('0x1'));var utils=require(_0x3849('0x2'));var logger=require(_0x3849('0x3'))(_0x3849('0x4'));var rpc={'chatMessage':require(_0x3849('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3849('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3849('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x3849('0x8')),'openchannelInteraction':require(_0x3849('0x9')),'mailInteraction':require(_0x3849('0xa')),'smsInteraction':require(_0x3849('0xb')),'faxInteraction':require(_0x3849('0xc')),'whatsappInteraction':require(_0x3849('0xd'))};var mailRpc=require(_0x3849('0xe'));exports[_0x3849('0xf')]=function(_0x17ef0a,_0x19fd7b,_0x32bc6c,_0x318e5a){return function(_0x4fa3c5){try{var _0x55151d=this[_0x3849('0x10')];if(_0x55151d===_0x3849('0x11')&&_0x318e5a[_0x3849('0x12')][_0x3849('0x13')]){logger[_0x3849('0x14')](_0x3849('0x15'),_0x17ef0a,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4fa3c5[_0x3849('0x16')]();}if(_0x19fd7b[0x0]==='1'&&(_[_0x3849('0x17')](this[_0x3849('0x18')][_0x3849('0x19')])||!this[_0x3849('0x18')][_0x3849('0x19')])){logger[_0x3849('0x14')](_0x3849('0x15'),_0x17ef0a,_0x3849('0x1a'));return _0x4fa3c5[_0x3849('0x16')]();}if(_0x19fd7b[0x0]==='2'&&this[_0x3849('0x18')][_0x3849('0x1b')]){logger[_0x3849('0x14')](_0x3849('0x1c'),_0x17ef0a,_0x3849('0x1d'));return _0x4fa3c5[_0x3849('0x16')]();}var _0x575915={'ContactId':this[_0x3849('0x1e')]['id'],'sentAt':moment()['format'](_0x3849('0x1f')),'direction':_0x3849('0x20')};if(this[_0x3849('0x10')]===_0x3849('0x11')){_0x575915[_0x3849('0x12')]=utils[_0x3849('0x21')](_0x19fd7b[0x2],this);}else{_0x575915[_0x3849('0x12')]=utils[_0x3849('0x21')](_0x19fd7b[0x1],this);}if(this[_0x3849('0x22')]){_0x575915['to']=this['message'][_0x3849('0x23')]||'';if(this[_0x3849('0x10')]===_0x3849('0x11')&&_0x19fd7b[0x1]==='1'){_0x575915['cc']=this[_0x3849('0x22')]['cc']||'';}_0x575915['from']=this[_0x3849('0x22')]['to']||'';_0x575915[_0x3849('0x24')]=this[_0x3849('0x22')][_0x3849('0x24')]||'';_0x575915[_0x3849('0x25')]=!![];if(this[_0x3849('0x22')][_0x3849('0x26')]){_0x575915[_0x3849('0x26')]='';_0x575915[_0x3849('0x26')]+=_[_0x3849('0x27')](this[_0x3849('0x22')][_0x3849('0x26')],_0x3849('0x28'))?'':'Re:\x20';_0x575915[_0x3849('0x26')]+=this[_0x3849('0x22')][_0x3849('0x26')];}}if(this[_0x3849('0x10')]==='chat'){_0x575915[_0x3849('0x29')]=this['account']['id'];}else{_0x575915[_[_0x3849('0x2a')](this[_0x3849('0x10')])+_0x3849('0x2b')]=this['account']['id'];}_0x575915[_[_0x3849('0x2a')](this['channel'])+_0x3849('0x2c')]=this[_0x3849('0x18')]['id'];var _0xdb5e0f=this[_0x3849('0x18')];if(rpc[this['channel']+_0x3849('0x2d')]){if(this[_0x3849('0x10')]===_0x3849('0x11')){var _0x40958c={'tls':{'rejectUnauthorized':![]}};if(this[_0x3849('0x2e')]['Smtp'][_0x3849('0x2f')]){_0x40958c[_0x3849('0x2f')]=this[_0x3849('0x2e')][_0x3849('0x30')][_0x3849('0x2f')];}else{_0x40958c[_0x3849('0x31')]=this['account'][_0x3849('0x30')][_0x3849('0x31')];_0x40958c['port']=this[_0x3849('0x2e')][_0x3849('0x30')][_0x3849('0x32')];_0x40958c[_0x3849('0x33')]=this[_0x3849('0x2e')][_0x3849('0x30')][_0x3849('0x33')];}if(this[_0x3849('0x2e')][_0x3849('0x30')]['authentication']){_0x40958c['auth']={'user':this[_0x3849('0x2e')][_0x3849('0x30')][_0x3849('0x34')],'pass':this[_0x3849('0x2e')]['Smtp'][_0x3849('0x35')]};}_0x575915[_0x3849('0x36')]=this[_0x3849('0x22')][_0x3849('0x37')];_0x575915['html']=_0x3849('0x38')+_['replace'](_0x575915['body'],_0x3849('0x39'),']+(>|$)/g,''),'priorityTrue':_0x3888f1[0x1],'priorityFalse':_0x3888f1[0x2]};var _0x42f61b=gotoif['validate'](_0x3ca1c3,{'typecast':!![]});if(_0x42f61b[_0x0f30('0xc')]){logger[_0x0f30('0xd')](_0x0f30('0xe'),_0x946d97,_[_0x0f30('0xf')](_0x42f61b,_0x0f30('0x10'))['join'](',\x20'));_0x4796f8[_0x0f30('0x11')]();}else{try{var _0x4a178e=eval('('+_0x3ca1c3['condition']+')');var _0x59e3a5=_0x4a178e?_0x3ca1c3[_0x0f30('0x12')]:_0x3ca1c3[_0x0f30('0x13')];logger[_0x0f30('0x14')](_0x0f30('0x15'),_0x946d97,_0x3ca1c3[_0x0f30('0x16')],_0x4a178e,_0x59e3a5||_0x0f30('0x17'));if(_0x59e3a5){var _0x436b17=_[_0x0f30('0x18')](_0x4796f8[_0x0f30('0x19')](),{'p':_0x59e3a5});if(_0x436b17>=0x0){logger['info'](_0x0f30('0x1a'),_0x946d97,_0x59e3a5||_0x0f30('0x17'),_0x436b17);_0x4796f8[_0x0f30('0x17')](_0x436b17);}else{logger[_0x0f30('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x946d97,_0x59e3a5||'next');_0x4796f8[_0x0f30('0x11')]();}}else{_0x4796f8[_0x0f30('0x17')]();}}catch(_0x4ff3cd){logger[_0x0f30('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x946d97,_0x4ff3cd[_0x0f30('0x10')]);_0x4796f8['stop']();}}}catch(_0x41ef3d){logger['error'](_0x0f30('0xe'),_0x946d97,JSON['stringify'](_0x41ef3d));_0x4796f8[_0x0f30('0x11')]();}};}; \ No newline at end of file +var _0xea83=['html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xea83,0xca));var _0x3ea8=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xea83[_0x2bf888];return _0x3038d6;};'use strict';var schema=require('validate');var _=require(_0x3ea8('0x0'));var htmlToText=require(_0x3ea8('0x1'));var utils=require(_0x3ea8('0x2'));var logger=require(_0x3ea8('0x3'))(_0x3ea8('0x4'));var gotoif=schema({'condition':{'type':_0x3ea8('0x5'),'required':!![],'message':_0x3ea8('0x6')},'priorityTrue':{'type':_0x3ea8('0x7'),'message':_0x3ea8('0x8')},'priorityFalse':{'type':_0x3ea8('0x7'),'message':_0x3ea8('0x9')}});exports['consequence']=function(_0x3ce870,_0x6b4469){return function(_0x5bfdec){try{var _0x415d04={'condition':htmlToText['fromString'](utils[_0x3ea8('0xa')](_0x6b4469[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x6b4469[0x1],'priorityFalse':_0x6b4469[0x2]};var _0x53db29=gotoif[_0x3ea8('0xb')](_0x415d04,{'typecast':!![]});if(_0x53db29[_0x3ea8('0xc')]){logger[_0x3ea8('0xd')](_0x3ea8('0xe'),_0x3ce870,_[_0x3ea8('0xf')](_0x53db29,_0x3ea8('0x10'))[_0x3ea8('0x11')](',\x20'));_0x5bfdec[_0x3ea8('0x12')]();}else{try{var _0x57a94c=eval('('+_0x415d04[_0x3ea8('0x13')]+')');var _0x404651=_0x57a94c?_0x415d04[_0x3ea8('0x14')]:_0x415d04[_0x3ea8('0x15')];logger['info'](_0x3ea8('0x16'),_0x3ce870,_0x415d04[_0x3ea8('0x13')],_0x57a94c,_0x404651||_0x3ea8('0x17'));if(_0x404651){var _0x1060d4=_['findIndex'](_0x5bfdec[_0x3ea8('0x18')](),{'p':_0x404651});if(_0x1060d4>=0x0){logger[_0x3ea8('0x19')](_0x3ea8('0x1a'),_0x3ce870,_0x404651||_0x3ea8('0x17'),_0x1060d4);_0x5bfdec['next'](_0x1060d4);}else{logger[_0x3ea8('0x19')](_0x3ea8('0x1b'),_0x3ce870,_0x404651||_0x3ea8('0x17'));_0x5bfdec[_0x3ea8('0x12')]();}}else{_0x5bfdec['next']();}}catch(_0x36fa02){logger[_0x3ea8('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3ce870,_0x36fa02[_0x3ea8('0x10')]);_0x5bfdec[_0x3ea8('0x12')]();}}}catch(_0x3d2903){logger[_0x3ea8('0xd')](_0x3ea8('0xe'),_0x3ce870,JSON[_0x3ea8('0x1c')](_0x3d2903));_0x5bfdec['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 2f5a784..c684476 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 _0x82e0=['rules','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','priority','findIndex'];(function(_0x286480,_0x9181e8){var _0x26907b=function(_0x2017d5){while(--_0x2017d5){_0x286480['push'](_0x286480['shift']());}};_0x26907b(++_0x9181e8);}(_0x82e0,0x6a));var _0x082e=function(_0x104662,_0x53a7a7){_0x104662=_0x104662-0x0;var _0x19cba7=_0x82e0[_0x104662];return _0x19cba7;};'use strict';var schema=require('validate');var _=require(_0x082e('0x0'));var logger=require(_0x082e('0x1'))(_0x082e('0x2'));var gotop=schema({'priority':{'type':_0x082e('0x3'),'required':!![],'message':_0x082e('0x4')}});exports[_0x082e('0x5')]=function(_0x3557bc,_0x30a76a){return function(_0x22e3ac){try{var _0x4664d8={'priority':_0x30a76a[0x0]};var _0x21fb3e=gotop['validate'](_0x4664d8,{'typecast':!![]});if(_0x21fb3e['length']){logger[_0x082e('0x6')](_0x082e('0x7'),_0x3557bc,_['map'](_0x21fb3e,_0x082e('0x8'))[_0x082e('0x9')](',\x20'));_0x22e3ac[_0x082e('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x3557bc,_0x4664d8[_0x082e('0xb')]);if(_0x4664d8[_0x082e('0xb')]){var _0xfd8750=_[_0x082e('0xc')](_0x22e3ac[_0x082e('0xd')](),{'p':_0x4664d8[_0x082e('0xb')]});if(_0xfd8750>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3557bc,_0x4664d8[_0x082e('0xb')]||_0x082e('0xe'),_0xfd8750);_0x22e3ac[_0x082e('0xe')](_0xfd8750);}else{logger[_0x082e('0xf')](_0x082e('0x10'),_0x3557bc,_0x4664d8[_0x082e('0xb')]||'next');_0x22e3ac['stop']();}}else{_0x22e3ac['next']();}}}catch(_0x2d9c38){logger['error'](_0x082e('0x7'),_0x3557bc,JSON['stringify'](_0x2d9c38));_0x22e3ac[_0x082e('0xa')]();}};}; \ No newline at end of file +var _0x3e0d=['next','stringify','validate','lodash','routing','number','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x2d222d,_0x167240){var _0x3efcce=function(_0x5eda20){while(--_0x5eda20){_0x2d222d['push'](_0x2d222d['shift']());}};_0x3efcce(++_0x167240);}(_0x3e0d,0x1a0));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xd3e0('0x0'));var _=require(_0xd3e0('0x1'));var logger=require('../../../../config/logger')(_0xd3e0('0x2'));var gotop=schema({'priority':{'type':_0xd3e0('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xd3e0('0x4')]=function(_0x50f757,_0x297262){return function(_0xb2dc30){try{var _0x332a17={'priority':_0x297262[0x0]};var _0x471e8f=gotop[_0xd3e0('0x0')](_0x332a17,{'typecast':!![]});if(_0x471e8f['length']){logger[_0xd3e0('0x5')](_0xd3e0('0x6'),_0x50f757,_['map'](_0x471e8f,_0xd3e0('0x7'))[_0xd3e0('0x8')](',\x20'));_0xb2dc30[_0xd3e0('0x9')]();}else{logger['info'](_0xd3e0('0xa'),_0x50f757,_0x332a17[_0xd3e0('0xb')]);if(_0x332a17[_0xd3e0('0xb')]){var _0x30e011=_[_0xd3e0('0xc')](_0xb2dc30[_0xd3e0('0xd')](),{'p':_0x332a17[_0xd3e0('0xb')]});if(_0x30e011>=0x0){logger[_0xd3e0('0xe')](_0xd3e0('0xf'),_0x50f757,_0x332a17[_0xd3e0('0xb')]||_0xd3e0('0x10'),_0x30e011);_0xb2dc30[_0xd3e0('0x10')](_0x30e011);}else{logger[_0xd3e0('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x50f757,_0x332a17[_0xd3e0('0xb')]||'next');_0xb2dc30['stop']();}}else{_0xb2dc30[_0xd3e0('0x10')]();}}}catch(_0x442aab){logger[_0xd3e0('0x5')](_0xd3e0('0x6'),_0x50f757,JSON[_0xd3e0('0x11')](_0x442aab));_0xb2dc30[_0xd3e0('0x9')]();}};}; \ 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 baa0754..064b5c7 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 _0x4373=['stop','[%s][MESSAGE]\x20%s','lodash','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','ChatWebsiteId','account','channel','AccountId','interaction','Message','info','next','catch','error','stringify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4373,0xfe));var _0x3437=function(_0x3036c7,_0x1268d1){_0x3036c7=_0x3036c7-0x0;var _0x4bc963=_0x4373[_0x3036c7];return _0x4bc963;};'use strict';var _=require(_0x3437('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x3437('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3437('0x2')),'smsMessage':require(_0x3437('0x3')),'faxMessage':require(_0x3437('0x4')),'whatsappMessage':require(_0x3437('0x5'))};exports['consequence']=function(_0x21e3e5,_0x386e02){return function(_0x2a5840){try{var _0x3333db={'body':utils[_0x3437('0x6')](_0x386e02[0x0],this),'ContactId':this[_0x3437('0x7')]['id']};if(this['channel']==='chat'){_0x3333db[_0x3437('0x8')]=this[_0x3437('0x9')]['id'];}else{_0x3333db[_['upperFirst'](this[_0x3437('0xa')])+_0x3437('0xb')]=this[_0x3437('0x9')]['id'];}_0x3333db[_['upperFirst'](this[_0x3437('0xa')])+'InteractionId']=this[_0x3437('0xc')]['id'];if(rpc[this['channel']+_0x3437('0xd')]){return rpc[this[_0x3437('0xa')]+_0x3437('0xd')]['create'](_0x3333db)['then'](function(_0xbd1db7){logger[_0x3437('0xe')]('[%s][MESSAGE]\x20%s',_0x21e3e5,_0x3333db['body']);_0x2a5840[_0x3437('0xf')]();})[_0x3437('0x10')](function(_0x5cbe11){logger[_0x3437('0x11')]('[%s][MESSAGE]\x20%s',_0x21e3e5,JSON[_0x3437('0x12')](_0x5cbe11));_0x2a5840[_0x3437('0x13')]();});}}catch(_0x557d95){logger['error'](_0x3437('0x14'),_0x21e3e5,JSON[_0x3437('0x12')](_0x557d95));_0x2a5840['stop']();}};}; \ No newline at end of file +var _0x3237=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId'];(function(_0x1d9fc1,_0x1266cd){var _0x2857e9=function(_0x24a8cb){while(--_0x24a8cb){_0x1d9fc1['push'](_0x1d9fc1['shift']());}};_0x2857e9(++_0x1266cd);}(_0x3237,0x150));var _0x7323=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3237[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x7323('0x0'))(_0x7323('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7323('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7323('0x3')),'faxMessage':require(_0x7323('0x4')),'whatsappMessage':require(_0x7323('0x5'))};exports[_0x7323('0x6')]=function(_0x4f06b3,_0x1fbba0){return function(_0x2f4dd6){try{var _0xdfdb3c={'body':utils['getMustacheRender'](_0x1fbba0[0x0],this),'ContactId':this[_0x7323('0x7')]['id']};if(this['channel']===_0x7323('0x8')){_0xdfdb3c[_0x7323('0x9')]=this[_0x7323('0xa')]['id'];}else{_0xdfdb3c[_[_0x7323('0xb')](this[_0x7323('0xc')])+_0x7323('0xd')]=this[_0x7323('0xa')]['id'];}_0xdfdb3c[_[_0x7323('0xb')](this['channel'])+_0x7323('0xe')]=this[_0x7323('0xf')]['id'];if(rpc[this[_0x7323('0xc')]+_0x7323('0x10')]){return rpc[this[_0x7323('0xc')]+_0x7323('0x10')][_0x7323('0x11')](_0xdfdb3c)[_0x7323('0x12')](function(_0xc6acb9){logger[_0x7323('0x13')](_0x7323('0x14'),_0x4f06b3,_0xdfdb3c[_0x7323('0x15')]);_0x2f4dd6[_0x7323('0x16')]();})[_0x7323('0x17')](function(_0x3a9421){logger[_0x7323('0x18')]('[%s][MESSAGE]\x20%s',_0x4f06b3,JSON[_0x7323('0x19')](_0x3a9421));_0x2f4dd6[_0x7323('0x1a')]();});}}catch(_0x3ed608){logger[_0x7323('0x18')](_0x7323('0x14'),_0x4f06b3,JSON[_0x7323('0x19')](_0x3ed608));_0x2f4dd6[_0x7323('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index ba0d92f..49118e8 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 _0x8e37=['error','stringify','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x2ad3e4,_0x5e8d39){var _0x5015f1=function(_0xdabd05){while(--_0xdabd05){_0x2ad3e4['push'](_0x2ad3e4['shift']());}};_0x5015f1(++_0x5e8d39);}(_0x8e37,0x192));var _0x78e3=function(_0x398b0e,_0x14d102){_0x398b0e=_0x398b0e-0x0;var _0x3d03ea=_0x8e37[_0x398b0e];return _0x3d03ea;};'use strict';var utils=require(_0x78e3('0x0'));var logger=require(_0x78e3('0x1'))(_0x78e3('0x2'));exports[_0x78e3('0x3')]=function(_0x337d36,_0x52467a){return function(_0x5ea124){try{logger[_0x78e3('0x4')](_0x78e3('0x5'),_0x337d36,utils['getMustacheRender'](_0x52467a[0x0],this));_0x5ea124['next']();}catch(_0x22a818){logger[_0x78e3('0x6')](_0x78e3('0x5'),_0x337d36,JSON[_0x78e3('0x7')](_0x22a818));_0x5ea124['stop']();}};}; \ No newline at end of file +var _0x28c4=['info','[%s][NOOP]\x20%s','next','error','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0x250eea,_0x156409){var _0x31e824=function(_0x488c67){while(--_0x488c67){_0x250eea['push'](_0x250eea['shift']());}};_0x31e824(++_0x156409);}(_0x28c4,0x191));var _0x428c=function(_0xd6fcb5,_0x526523){_0xd6fcb5=_0xd6fcb5-0x0;var _0x278ac7=_0x28c4[_0xd6fcb5];return _0x278ac7;};'use strict';var utils=require(_0x428c('0x0'));var logger=require(_0x428c('0x1'))(_0x428c('0x2'));exports[_0x428c('0x3')]=function(_0x477593,_0x2c253c){return function(_0x18bc65){try{logger[_0x428c('0x4')](_0x428c('0x5'),_0x477593,utils['getMustacheRender'](_0x2c253c[0x0],this));_0x18bc65[_0x428c('0x6')]();}catch(_0x2a1b5f){logger[_0x428c('0x7')]('[%s][NOOP]\x20%s',_0x477593,JSON[_0x428c('0x8')](_0x2a1b5f));_0x18bc65['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 a17ea92..1cf4eb3 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 _0x37da=['format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','defaults','redis','localhost','account','queue','from','joinAt','emit','clone','queue_id','%sQueuesWaitingInteractions','pick'];(function(_0x464878,_0x2e315d){var _0x144c25=function(_0x4eeca0){while(--_0x4eeca0){_0x464878['push'](_0x464878['shift']());}};_0x144c25(++_0x2e315d);}(_0x37da,0x11f));var _0xa37d=function(_0x1c2b58,_0x458f68){_0x1c2b58=_0x1c2b58-0x0;var _0x109bc1=_0x37da[_0x1c2b58];return _0x109bc1;};'use strict';var schema=require(_0xa37d('0x0'));var _=require(_0xa37d('0x1'));var util=require(_0xa37d('0x2'));var seqqueue=require(_0xa37d('0x3'));var moment=require(_0xa37d('0x4'));var Redis=require(_0xa37d('0x5'));var config=require(_0xa37d('0x6'));var logger=require(_0xa37d('0x7'))('routing');var strategy=require(_0xa37d('0x8'));config['redis']=_[_0xa37d('0x9')](config[_0xa37d('0xa')],{'host':_0xa37d('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa37d('0xa')]));var attributes=['id','queue_id',_0xa37d('0xc'),_0xa37d('0xd'),_0xa37d('0xe'),_0xa37d('0xf')];function emit(_0x57b6d9,_0x26b72a,_0x250370){io['to'](_0x57b6d9)[_0xa37d('0x10')](_0x26b72a,_0x250370);}function emitChannelQueueInteraction(_0x21d9c1,_0x4caa89,_0x10c993,_0x53fef6,_0x5854ea,_0x433230,_0x2dbfd9,_0x4f2514){var _0x262390=_[_0xa37d('0x11')](_0x10c993);_0x262390[_0xa37d('0x12')]=_0x4f2514;_0x262390[_0xa37d('0xd')]=_0x4caa89;_0x262390[_0xa37d('0xc')]=_0x53fef6;_0x262390['id']=_0x5854ea;if(_0x433230){_0x2dbfd9[util['format'](_0xa37d('0x13'),_0x21d9c1)][_0x5854ea]=_[_0xa37d('0x14')](_0x262390,attributes);}else{delete _0x2dbfd9[util[_0xa37d('0x15')](_0xa37d('0x13'),_0x21d9c1)][_0x5854ea];}emit(util['format'](_0xa37d('0x16'),_0x21d9c1,_0x4caa89),util['format'](_0xa37d('0x17'),_0x21d9c1,_0x433230?_0xa37d('0x18'):_0xa37d('0x19')),_['pick'](_0x262390,attributes));}var rpc={'openchannelQueueReport':require(_0xa37d('0x1a')),'mailQueueReport':require(_0xa37d('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xa37d('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xa37d('0x1d')},'timeout':{'type':_0xa37d('0x1e'),'message':_0xa37d('0x1f')}});function startRouting(_0x3e26cc,_0x2e9441,_0x1beb0b,_0xb09e77){if(_0x3e26cc&&_0x2e9441&&_0x1beb0b){_0x2e9441[_0xa37d('0x20')]+=0x1;var _0x28244f={'uniqueid':_0x3e26cc,'from':_0x1beb0b[_0xa37d('0x21')]?_0x1beb0b[_0xa37d('0x21')]['from']:'','joinAt':moment()[_0xa37d('0x15')](_0xa37d('0x22')),'ContactId':_0x1beb0b[_0xa37d('0x23')]?_0x1beb0b[_0xa37d('0x23')]['id']:null,'ListId':_0x1beb0b['list']?_0x1beb0b[_0xa37d('0x24')]['id']:null};_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+_0xa37d('0x27')]=_0x2e9441['id']||null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+'InteractionId']=_0x1beb0b[_0xa37d('0x28')]?_0x1beb0b[_0xa37d('0x28')]['id']:null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+_0xa37d('0x29')]=_0x1beb0b['message']?_0x1beb0b[_0xa37d('0x2a')]['id']:null;_0x28244f[_[_0xa37d('0x25')](_0x1beb0b[_0xa37d('0x26')])+(_0x1beb0b[_0xa37d('0x26')]!==_0xa37d('0x2b')?'AccountId':_0xa37d('0x2c'))]=_0x1beb0b['account']?_0x1beb0b[_0xa37d('0xc')]['id']:null;logger[_0xa37d('0x2d')](util[_0xa37d('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x3e26cc,_0x2e9441[_0xa37d('0x2e')]));emitChannelQueueInteraction(_0x1beb0b[_0xa37d('0x26')],_0x2e9441['name'],_0x28244f,_0x1beb0b[_0xa37d('0xc')][_0xa37d('0x2e')],_0x1beb0b[_0xa37d('0x2a')]['id'],!![],_0xb09e77,_0x2e9441['id']);if(rpc[_0x1beb0b[_0xa37d('0x26')]+_0xa37d('0x2f')]){return rpc[_0x1beb0b[_0xa37d('0x26')]+_0xa37d('0x2f')]['create'](_0x28244f)[_0xa37d('0x30')](function(_0x17bb85){logger[_0xa37d('0x31')](_0xa37d('0x32'));});}}}function stopRouting(_0x456f96,_0x239b86,_0x47f726,_0x107e96){if(_0x456f96&&_0x239b86){_0x239b86[_0xa37d('0x20')]-=0x1;var _0x704ff8={'leaveAt':moment()[_0xa37d('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa37d('0x15')](_0xa37d('0x22')),'reason':_0xa37d('0x33')};logger[_0xa37d('0x2d')](util[_0xa37d('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x456f96,_0x239b86['name']));emitChannelQueueInteraction(_0x47f726[_0xa37d('0x26')],_0x239b86['name'],_0x47f726[_0xa37d('0x21')],_0x47f726['account']['name'],_0x47f726[_0xa37d('0x2a')]['id'],![],_0x107e96,_0x239b86['id']);if(rpc[_0x47f726[_0xa37d('0x26')]+'QueueReport']){return rpc[_0x47f726[_0xa37d('0x26')]+_0xa37d('0x2f')][_0xa37d('0x34')](_0x456f96,_0x704ff8)['catch'](function(_0x12b61f){logger[_0xa37d('0x31')](_0xa37d('0x35'));});}}}function endRouting(_0x482a08,_0x1613a5,_0x336743,_0x4af855){if(_0x482a08&&_0x1613a5){_0x1613a5[_0xa37d('0x20')]-=0x1;var _0x15eae2={'leaveAt':moment()['format'](_0xa37d('0x22')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa37d('0x36')};logger[_0xa37d('0x2d')](util[_0xa37d('0x15')](_0xa37d('0x37'),_0x482a08,_0x1613a5['name']));emitChannelQueueInteraction(_0x336743[_0xa37d('0x26')],_0x1613a5['name'],_0x336743[_0xa37d('0x21')],_0x336743[_0xa37d('0xc')]['name'],_0x336743[_0xa37d('0x2a')]['id'],![],_0x4af855);if(rpc[_0x336743['channel']+_0xa37d('0x2f')]){return rpc[_0x336743[_0xa37d('0x26')]+'QueueReport'][_0xa37d('0x34')](_0x482a08,_0x15eae2)[_0xa37d('0x30')](function(_0xae00e2){logger[_0xa37d('0x31')](_0xa37d('0x35'));});}}}function handleFindQueue(_0x570d70){return function(_0x1bcf8a){return _0x1bcf8a[_0xa37d('0x2e')][_0xa37d('0x38')]()===_0x570d70[_0xa37d('0x38')]();};}exports['consequence']=function(_0x4777da,_0x25953d,_0x31b9ea,_0x3caa65){return function(_0x1d680b){try{var _0x30b60f={'name':_0x25953d[0x0],'timeout':_0x25953d[0x1]};var _0x2d7470=queue[_0xa37d('0x0')](_0x30b60f,{'typecast':!![]});if(_0x2d7470[_0xa37d('0x39')]){logger['error'](_0xa37d('0x3a'),_0x4777da,_[_0xa37d('0x3b')](_0x2d7470,_0xa37d('0x2a'))['join'](',\x20'));_0x1d680b['stop']();}else{var _0x3093dc=_['find'](_0x31b9ea[_0x3caa65['channel']+_0xa37d('0x3c')],handleFindQueue(_0x30b60f[_0xa37d('0x2e')]));if(_0x3093dc){startRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);var _0x207804=(_0x3093dc[_0xa37d('0x36')]||0xa)*0x3e8;var _0x4c59c2=(_0x30b60f['timeout']||0x14)*0x3e8;var _0x3cf01e,_0xd156fb;if(_0x207804>_0x4c59c2){_0x4c59c2=_0x207804;}var _0xf6c234=seqqueue[_0xa37d('0x3d')](_0x207804);_0xf6c234['id']=_0x4777da;_0xf6c234[_0xa37d('0x3e')]=_0x207804;_0xf6c234[_0xa37d('0x3f')]=_0x4c59c2;_0xf6c234[_0xa37d('0x26')]=_0x3caa65[_0xa37d('0x26')];_0x31b9ea[_0xa37d('0x40')][_0x4777da]['on'](_0xa37d('0x41'),function(){logger[_0xa37d('0x2d')](_0xa37d('0x42'),_0x4777da);stopRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);clearTimeout(_0x3cf01e);_0x3cf01e=undefined;_0xf6c234[_0xa37d('0x43')](!![]);if(_0x31b9ea[_0xa37d('0x40')][_0x4777da]){delete _0x31b9ea[_0xa37d('0x40')][_0x4777da];}_0x1d680b[_0xa37d('0x44')]();});_0x31b9ea[_0xa37d('0x40')][_0x4777da]['on'](_0xa37d('0x45'),function(){if(_0x31b9ea[_0xa37d('0x40')][_0x4777da]){delete _0x31b9ea[_0xa37d('0x40')][_0x4777da];}});_0x3cf01e=setTimeout(function(){logger[_0xa37d('0x2d')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4777da);endRouting(_0x4777da,_0x3093dc,_0x3caa65,_0x31b9ea);clearTimeout(_0x3cf01e);_0xf6c234[_0xa37d('0x43')](!![]);_0x1d680b[_0xa37d('0x46')]();},_0x4c59c2);switch(_0x3093dc[_0xa37d('0x47')]){case _0xa37d('0x48'):strategy[_0xa37d('0x48')](_0xf6c234,_0x3093dc,_0x31b9ea,_0x3caa65);break;default:strategy[_0xa37d('0x49')](_0xf6c234,_0x3093dc,_0x31b9ea,_0x3caa65);}}else{logger[_0xa37d('0x31')](_0xa37d('0x4a'),_0x4777da,_0x30b60f[_0xa37d('0x2e')]);_0x1d680b[_0xa37d('0x44')]();}}}catch(_0x5895ba){console[_0xa37d('0x4b')](_0x5895ba);logger[_0xa37d('0x31')](_0xa37d('0x3a'),_0x4777da,_0x5895ba[_0xa37d('0x4c')]);_0x1d680b[_0xa37d('0x44')]();}};}; \ No newline at end of file +var _0x770f=['body','update','catch','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','queue_id','from','joinAt','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','name','QueueReport','create','error','create\x20queue\x20report','info'];(function(_0x3d7201,_0x180769){var _0xbbf68d=function(_0x21b0eb){while(--_0x21b0eb){_0x3d7201['push'](_0x3d7201['shift']());}};_0xbbf68d(++_0x180769);}(_0x770f,0xef));var _0xf770=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x770f[_0x25b24a];return _0x224e68;};'use strict';var schema=require(_0xf770('0x0'));var _=require(_0xf770('0x1'));var util=require(_0xf770('0x2'));var seqqueue=require(_0xf770('0x3'));var moment=require(_0xf770('0x4'));var Redis=require(_0xf770('0x5'));var config=require('../../../../config/environment');var logger=require(_0xf770('0x6'))(_0xf770('0x7'));var strategy=require('./strategy');config[_0xf770('0x8')]=_[_0xf770('0x9')](config[_0xf770('0x8')],{'host':_0xf770('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf770('0x8')]));var attributes=['id',_0xf770('0xb'),'account','queue',_0xf770('0xc'),_0xf770('0xd')];function emit(_0x12f41a,_0x458b14,_0x2d527c){io['to'](_0x12f41a)['emit'](_0x458b14,_0x2d527c);}function emitChannelQueueInteraction(_0x447ad1,_0x2a5855,_0x52acc8,_0x213f04,_0x5dac2e,_0x1dd601,_0x3ec894,_0x3e033d){var _0x3341d9=_['clone'](_0x52acc8);_0x3341d9[_0xf770('0xb')]=_0x3e033d;_0x3341d9['queue']=_0x2a5855;_0x3341d9[_0xf770('0xe')]=_0x213f04;_0x3341d9['id']=_0x5dac2e;if(_0x1dd601){_0x3ec894[util[_0xf770('0xf')](_0xf770('0x10'),_0x447ad1)][_0x5dac2e]=_['pick'](_0x3341d9,attributes);}else{delete _0x3ec894[util['format'](_0xf770('0x10'),_0x447ad1)][_0x5dac2e];}emit(util['format'](_0xf770('0x11'),_0x447ad1,_0x2a5855),util[_0xf770('0xf')](_0xf770('0x12'),_0x447ad1,_0x1dd601?_0xf770('0x13'):_0xf770('0x14')),_['pick'](_0x3341d9,attributes));}var rpc={'openchannelQueueReport':require(_0xf770('0x15')),'mailQueueReport':require(_0xf770('0x16')),'chatQueueReport':require(_0xf770('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf770('0x18'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf770('0x19')},'timeout':{'type':_0xf770('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x55ca1b,_0x17deb3,_0x2be64f,_0x2af0a3){if(_0x55ca1b&&_0x17deb3&&_0x2be64f){_0x17deb3[_0xf770('0x1b')]+=0x1;var _0x33216b={'uniqueid':_0x55ca1b,'from':_0x2be64f['body']?_0x2be64f['body'][_0xf770('0xc')]:'','joinAt':moment()[_0xf770('0xf')](_0xf770('0x1c')),'ContactId':_0x2be64f['contact']?_0x2be64f['contact']['id']:null,'ListId':_0x2be64f['list']?_0x2be64f[_0xf770('0x1d')]['id']:null};_0x33216b[_[_0xf770('0x1e')](_0x2be64f[_0xf770('0x1f')])+_0xf770('0x20')]=_0x17deb3['id']||null;_0x33216b[_[_0xf770('0x1e')](_0x2be64f[_0xf770('0x1f')])+_0xf770('0x21')]=_0x2be64f[_0xf770('0x22')]?_0x2be64f[_0xf770('0x22')]['id']:null;_0x33216b[_[_0xf770('0x1e')](_0x2be64f[_0xf770('0x1f')])+_0xf770('0x23')]=_0x2be64f['message']?_0x2be64f[_0xf770('0x24')]['id']:null;_0x33216b[_[_0xf770('0x1e')](_0x2be64f[_0xf770('0x1f')])+(_0x2be64f[_0xf770('0x1f')]!==_0xf770('0x25')?_0xf770('0x26'):'WebsiteId')]=_0x2be64f[_0xf770('0xe')]?_0x2be64f['account']['id']:null;logger['info'](util[_0xf770('0xf')]('[%s][START:QUEUE][NAME:%s]',_0x55ca1b,_0x17deb3[_0xf770('0x27')]));emitChannelQueueInteraction(_0x2be64f[_0xf770('0x1f')],_0x17deb3['name'],_0x33216b,_0x2be64f[_0xf770('0xe')][_0xf770('0x27')],_0x2be64f[_0xf770('0x24')]['id'],!![],_0x2af0a3,_0x17deb3['id']);if(rpc[_0x2be64f['channel']+_0xf770('0x28')]){return rpc[_0x2be64f[_0xf770('0x1f')]+_0xf770('0x28')][_0xf770('0x29')](_0x33216b)['catch'](function(_0x3adaf3){logger[_0xf770('0x2a')](_0xf770('0x2b'));});}}}function stopRouting(_0x41c302,_0xed59bd,_0x56714a,_0x3e0023){if(_0x41c302&&_0xed59bd){_0xed59bd[_0xf770('0x1b')]-=0x1;var _0x23330c={'leaveAt':moment()['format'](_0xf770('0x1c')),'acceptAt':moment()[_0xf770('0xf')](_0xf770('0x1c')),'reason':'accepted'};logger[_0xf770('0x2c')](util[_0xf770('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x41c302,_0xed59bd[_0xf770('0x27')]));emitChannelQueueInteraction(_0x56714a[_0xf770('0x1f')],_0xed59bd[_0xf770('0x27')],_0x56714a[_0xf770('0x2d')],_0x56714a[_0xf770('0xe')]['name'],_0x56714a['message']['id'],![],_0x3e0023,_0xed59bd['id']);if(rpc[_0x56714a[_0xf770('0x1f')]+_0xf770('0x28')]){return rpc[_0x56714a['channel']+_0xf770('0x28')][_0xf770('0x2e')](_0x41c302,_0x23330c)[_0xf770('0x2f')](function(_0x6de881){logger[_0xf770('0x2a')](_0xf770('0x30'));});}}}function endRouting(_0x507b5e,_0x9afdbf,_0x340c5e,_0x2809e1){if(_0x507b5e&&_0x9afdbf){_0x9afdbf[_0xf770('0x1b')]-=0x1;var _0x20bb59={'leaveAt':moment()[_0xf770('0xf')](_0xf770('0x1c')),'exitAt':moment()[_0xf770('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf770('0x31')};logger[_0xf770('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x507b5e,_0x9afdbf[_0xf770('0x27')]));emitChannelQueueInteraction(_0x340c5e[_0xf770('0x1f')],_0x9afdbf[_0xf770('0x27')],_0x340c5e[_0xf770('0x2d')],_0x340c5e['account'][_0xf770('0x27')],_0x340c5e[_0xf770('0x24')]['id'],![],_0x2809e1);if(rpc[_0x340c5e[_0xf770('0x1f')]+_0xf770('0x28')]){return rpc[_0x340c5e['channel']+_0xf770('0x28')]['update'](_0x507b5e,_0x20bb59)['catch'](function(_0x157210){logger['error'](_0xf770('0x30'));});}}}function handleFindQueue(_0xb21211){return function(_0x55fb50){return _0x55fb50[_0xf770('0x27')][_0xf770('0x32')]()===_0xb21211['toLowerCase']();};}exports[_0xf770('0x33')]=function(_0x4e02b6,_0x23b97d,_0x174408,_0x47953e){return function(_0x3d7b9b){try{var _0x30c4cf={'name':_0x23b97d[0x0],'timeout':_0x23b97d[0x1]};var _0x29b8c5=queue['validate'](_0x30c4cf,{'typecast':!![]});if(_0x29b8c5[_0xf770('0x34')]){logger['error'](_0xf770('0x35'),_0x4e02b6,_[_0xf770('0x36')](_0x29b8c5,'message')[_0xf770('0x37')](',\x20'));_0x3d7b9b[_0xf770('0x38')]();}else{var _0x2c014b=_[_0xf770('0x39')](_0x174408[_0x47953e['channel']+_0xf770('0x3a')],handleFindQueue(_0x30c4cf['name']));if(_0x2c014b){startRouting(_0x4e02b6,_0x2c014b,_0x47953e,_0x174408);var _0x108a20=(_0x2c014b[_0xf770('0x31')]||0xa)*0x3e8;var _0x3073b7=(_0x30c4cf['timeout']||0x14)*0x3e8;var _0x44eac9,_0x2db0cb;if(_0x108a20>_0x3073b7){_0x3073b7=_0x108a20;}var _0x144e7c=seqqueue[_0xf770('0x3b')](_0x108a20);_0x144e7c['id']=_0x4e02b6;_0x144e7c['atimeout']=_0x108a20;_0x144e7c[_0xf770('0x3c')]=_0x3073b7;_0x144e7c['channel']=_0x47953e[_0xf770('0x1f')];_0x174408['rules'][_0x4e02b6]['on'](_0xf770('0x3d'),function(){logger[_0xf770('0x2c')](_0xf770('0x3e'),_0x4e02b6);stopRouting(_0x4e02b6,_0x2c014b,_0x47953e,_0x174408);clearTimeout(_0x44eac9);_0x44eac9=undefined;_0x144e7c[_0xf770('0x3f')](!![]);if(_0x174408[_0xf770('0x40')][_0x4e02b6]){delete _0x174408[_0xf770('0x40')][_0x4e02b6];}_0x3d7b9b['stop']();});_0x174408['rules'][_0x4e02b6]['on']('complete',function(){if(_0x174408[_0xf770('0x40')][_0x4e02b6]){delete _0x174408[_0xf770('0x40')][_0x4e02b6];}});_0x44eac9=setTimeout(function(){logger[_0xf770('0x2c')](_0xf770('0x41'),_0x4e02b6);endRouting(_0x4e02b6,_0x2c014b,_0x47953e,_0x174408);clearTimeout(_0x44eac9);_0x144e7c[_0xf770('0x3f')](!![]);_0x3d7b9b[_0xf770('0x42')]();},_0x3073b7);switch(_0x2c014b['strategy']){case _0xf770('0x43'):strategy[_0xf770('0x43')](_0x144e7c,_0x2c014b,_0x174408,_0x47953e);break;default:strategy['beepall'](_0x144e7c,_0x2c014b,_0x174408,_0x47953e);}}else{logger[_0xf770('0x2a')](_0xf770('0x44'),_0x4e02b6,_0x30c4cf['name']);_0x3d7b9b[_0xf770('0x38')]();}}}catch(_0x3d2f4e){console[_0xf770('0x45')](_0x3d2f4e);logger[_0xf770('0x2a')](_0xf770('0x35'),_0x4e02b6,_0x3d2f4e[_0xf770('0x46')]);_0x3d7b9b[_0xf770('0x38')]();}};}; \ 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 bf8d521..d81afdf 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 _0x3ea0=['busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue','agent','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3ea0,0x153));var _0x03ea=function(_0x34edec,_0x228935){_0x34edec=_0x34edec-0x0;var _0x2d276d=_0x3ea0[_0x34edec];return _0x2d276d;};'use strict';var _=require('lodash');var uuid=require(_0x03ea('0x0'));var util=require(_0x03ea('0x1'));var logger=require('../../../../../config/logger')(_0x03ea('0x2'));var Agent=function(_0x47632e,_0x55f91f,_0x58952f,_0x14873d){this[_0x03ea('0x3')]=uuid['v4']();this[_0x03ea('0x4')]=_0x47632e;this[_0x03ea('0x5')]=_0x55f91f;this[_0x03ea('0x6')]=_0x58952f;this[_0x03ea('0x2')]=_0x14873d;this[_0x03ea('0x4')]['push'](this[_0x03ea('0x7')][_0x03ea('0x8')](this),this['handleTimeout']['bind'](this));this[_0x03ea('0x4')]['on'](_0x03ea('0x9'),this[_0x03ea('0xa')][_0x03ea('0x8')](this));this[_0x03ea('0x4')]['on'](_0x03ea('0xb'),this[_0x03ea('0xc')][_0x03ea('0x8')](this));};Agent[_0x03ea('0xd')][_0x03ea('0xe')]=function(){this[_0x03ea('0x4')][_0x03ea('0xe')](this[_0x03ea('0x7')][_0x03ea('0x8')](this),this[_0x03ea('0xa')][_0x03ea('0x8')](this));};Agent['prototype'][_0x03ea('0xc')]=function(){this[_0x03ea('0xa')](!![]);};Agent['prototype'][_0x03ea('0x7')]=function(_0x547329){logger['info'](_0x03ea('0xf'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);if(_[_0x03ea('0x10')](this['realtime'][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']])){logger[_0x03ea('0x12')](_0x03ea('0x13'),this[_0x03ea('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x03ea('0xe')][_0x03ea('0x8')](this),0x3e8);}else{if(this[_0x03ea('0x2')][_0x03ea('0x14')]||util[_0x03ea('0x15')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']],this['squeue'][_0x03ea('0x16')],![])){this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']][_0x03ea('0x17')]=!![];this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']][_0x03ea('0x18')]=undefined;util[_0x03ea('0x19')](this[_0x03ea('0x3')],this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']],null,this[_0x03ea('0x2')]);util[_0x03ea('0x1a')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']],_0x03ea('0x1b')+(this[_0x03ea('0x2')][_0x03ea('0x14')]?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x03ea('0x5')]['id']);setTimeout(this[_0x03ea('0xe')]['bind'](this),0x3e8);}}};Agent[_0x03ea('0xd')][_0x03ea('0xa')]=function(_0x308d0f){if(_[_0x03ea('0x10')](this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']])){return logger[_0x03ea('0x12')](_0x03ea('0x13'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);}else{logger[_0x03ea('0x12')](_0x03ea('0x1c'),this[_0x03ea('0x4')]['id'],this[_0x03ea('0x5')]['id']);util[_0x03ea('0x1d')](this[_0x03ea('0x3')],this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')][_0x03ea('0x11')][this['agent']['id']],null,this[_0x03ea('0x2')]);this[_0x03ea('0x6')][_0x03ea('0x11')][this[_0x03ea('0x5')]['id']]['busy']=![];this['realtime'][_0x03ea('0x11')][this['agent']['id']][_0x03ea('0x18')]=undefined;util[_0x03ea('0x1a')](this[_0x03ea('0x4')]['id'],this[_0x03ea('0x6')]['agents'][this[_0x03ea('0x5')]['id']],_0x308d0f?_0x03ea('0x1e'):_0x03ea('0x1f'));}if(!_0x308d0f){setTimeout(this[_0x03ea('0xe')][_0x03ea('0x8')](this),0x3e8);}};function agent(_0x4389a1,_0x29b0f8,_0x434f95,_0x2b7d35){return new Agent(_0x4389a1,_0x29b0f8,_0x434f95,_0x2b7d35);}module[_0x03ea('0x20')]=agent; \ No newline at end of file +var _0x3490=['drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout'];(function(_0x5b970b,_0x2b3de4){var _0x53b127=function(_0x153b67){while(--_0x153b67){_0x5b970b['push'](_0x5b970b['shift']());}};_0x53b127(++_0x2b3de4);}(_0x3490,0x83));var _0x0349=function(_0x4de24f,_0x53bacc){_0x4de24f=_0x4de24f-0x0;var _0x1daf89=_0x3490[_0x4de24f];return _0x1daf89;};'use strict';var _=require(_0x0349('0x0'));var uuid=require(_0x0349('0x1'));var util=require(_0x0349('0x2'));var logger=require(_0x0349('0x3'))(_0x0349('0x4'));var Agent=function(_0x9f87c0,_0x5a74e7,_0xc5bdf8,_0x4a444f){this[_0x0349('0x5')]=uuid['v4']();this[_0x0349('0x6')]=_0x9f87c0;this[_0x0349('0x7')]=_0x5a74e7;this[_0x0349('0x8')]=_0xc5bdf8;this[_0x0349('0x4')]=_0x4a444f;this[_0x0349('0x6')]['push'](this[_0x0349('0x9')]['bind'](this),this[_0x0349('0xa')][_0x0349('0xb')](this));this[_0x0349('0x6')]['on'](_0x0349('0xc'),this[_0x0349('0xa')][_0x0349('0xb')](this));this[_0x0349('0x6')]['on'](_0x0349('0xd'),this[_0x0349('0xe')][_0x0349('0xb')](this));};Agent[_0x0349('0xf')][_0x0349('0x10')]=function(){this[_0x0349('0x6')][_0x0349('0x10')](this['handleRun']['bind'](this),this[_0x0349('0xa')][_0x0349('0xb')](this));};Agent[_0x0349('0xf')][_0x0349('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x0349('0xf')][_0x0349('0x9')]=function(_0x21993e){logger[_0x0349('0x11')](_0x0349('0x12'),this[_0x0349('0x6')]['id'],this[_0x0349('0x7')]['id']);if(_[_0x0349('0x13')](this[_0x0349('0x8')]['agents'][this['agent']['id']])){logger[_0x0349('0x11')](_0x0349('0x14'),this[_0x0349('0x6')]['id'],this[_0x0349('0x7')]['id']);setTimeout(this[_0x0349('0x10')][_0x0349('0xb')](this),0x3e8);}else{if(this[_0x0349('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x0349('0x6')]['id'],this['realtime'][_0x0349('0x15')][this[_0x0349('0x7')]['id']],this[_0x0349('0x6')][_0x0349('0x16')],![])){this['realtime']['agents'][this[_0x0349('0x7')]['id']][_0x0349('0x17')]=!![];this[_0x0349('0x8')][_0x0349('0x15')][this[_0x0349('0x7')]['id']][_0x0349('0x18')]=undefined;util[_0x0349('0x19')](this[_0x0349('0x5')],this[_0x0349('0x6')]['id'],this[_0x0349('0x8')]['agents'][this[_0x0349('0x7')]['id']],null,this[_0x0349('0x4')]);util[_0x0349('0x1a')](this[_0x0349('0x6')]['id'],this['realtime'][_0x0349('0x15')][this[_0x0349('0x7')]['id']],_0x0349('0x1b')+(this[_0x0349('0x4')][_0x0349('0x1c')]?_0x0349('0x1d'):''));}else{logger[_0x0349('0x11')](_0x0349('0x1e'),this[_0x0349('0x6')]['id'],this[_0x0349('0x7')]['id']);setTimeout(this[_0x0349('0x10')][_0x0349('0xb')](this),0x3e8);}}};Agent[_0x0349('0xf')]['handleTimeout']=function(_0xfcf315){if(_[_0x0349('0x13')](this[_0x0349('0x8')][_0x0349('0x15')][this[_0x0349('0x7')]['id']])){return logger[_0x0349('0x11')](_0x0349('0x14'),this['squeue']['id'],this[_0x0349('0x7')]['id']);}else{logger['info'](_0x0349('0x1f'),this[_0x0349('0x6')]['id'],this[_0x0349('0x7')]['id']);util[_0x0349('0x20')](this[_0x0349('0x5')],this[_0x0349('0x6')]['id'],this['realtime']['agents'][this[_0x0349('0x7')]['id']],null,this[_0x0349('0x4')]);this[_0x0349('0x8')][_0x0349('0x15')][this['agent']['id']][_0x0349('0x17')]=![];this[_0x0349('0x8')][_0x0349('0x15')][this[_0x0349('0x7')]['id']][_0x0349('0x18')]=undefined;util[_0x0349('0x1a')](this[_0x0349('0x6')]['id'],this[_0x0349('0x8')][_0x0349('0x15')][this[_0x0349('0x7')]['id']],_0xfcf315?_0x0349('0x21'):_0x0349('0x22'));}if(!_0xfcf315){setTimeout(this['push'][_0x0349('0xb')](this),0x3e8);}};function agent(_0x78434,_0x5ab8c7,_0x331de8,_0x14ba0b){return new Agent(_0x78434,_0x5ab8c7,_0x331de8,_0x14ba0b);}module[_0x0349('0x23')]=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 e841e8a..c2c64b3 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 _0x2d17=['showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','busyQueue','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','queue','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','length','Agents','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','name'];(function(_0x4b5f83,_0x2dd2b9){var _0x1fa204=function(_0x509a63){while(--_0x509a63){_0x4b5f83['push'](_0x4b5f83['shift']());}};_0x1fa204(++_0x2dd2b9);}(_0x2d17,0x17e));var _0x72d1=function(_0x42ebf5,_0x1c236f){_0x42ebf5=_0x42ebf5-0x0;var _0x54cb38=_0x2d17[_0x42ebf5];return _0x54cb38;};'use strict';var _=require(_0x72d1('0x0'));var uuid=require(_0x72d1('0x1'));var util=require('./util');var logger=require(_0x72d1('0x2'))(_0x72d1('0x3'));var Beepall=function(_0x531f4e,_0x3687bc,_0x38fec7,_0x55b722){this[_0x72d1('0x4')]=uuid['v4']();this['squeue']=_0x531f4e;this[_0x72d1('0x5')]=_0x3687bc;this['realtime']=_0x38fec7;this[_0x72d1('0x3')]=_0x55b722;this[_0x72d1('0x6')]['push'](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xa'),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xb'),this[_0x72d1('0xc')][_0x72d1('0x8')](this));};Beepall[_0x72d1('0xd')][_0x72d1('0xe')]=function(){this[_0x72d1('0x6')][_0x72d1('0xe')](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this['handleTimeout'][_0x72d1('0x8')](this));};Beepall[_0x72d1('0xd')][_0x72d1('0xc')]=function(_0x115cd7){this[_0x72d1('0x9')](!![]);};Beepall[_0x72d1('0xd')][_0x72d1('0x7')]=function(_0x383bb){var _0x172fae=!![];if(!_[_0x72d1('0xf')](this[_0x72d1('0x5')])&&!_[_0x72d1('0xf')](this[_0x72d1('0x5')]['Agents'])&&this[_0x72d1('0x5')]['Agents'][_0x72d1('0x10')]>0x0){for(var _0x2c9851=0x0,_0x59d7b5;_0x2c98510x0){for(var _0x3c329e=0x0,_0xee091f;_0x3c329e0x0&&_0x286853[_0x4c2fca+_0x368b('0x29')]>=_0x286853[_0x4c2fca+_0x368b('0x28')]){writeLog(_0xc0f7af,_0x286853,_0x4c2fca[_0x368b('0x2a')]()+_0x368b('0x2b'));return![];}}return!![];};exports[_0x368b('0x2c')]=function(_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627){return sendNotification(!![],_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627);};exports[_0x368b('0x2d')]=function(_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52){return sendNotification(![],_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52);};exports[_0x368b('0x2e')]=writeLog; \ No newline at end of file +var _0x323f=['getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','\x20interaction','notificationSound','account','notificationShake','body','queue','msg'];(function(_0x4b1465,_0x126f34){var _0x37f095=function(_0x23345f){while(--_0x23345f){_0x4b1465['push'](_0x4b1465['shift']());}};_0x37f095(++_0x126f34);}(_0x323f,0x1ee));var _0xf323=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x323f[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var utils=require('../utils');var Mustache=require(_0xf323('0x1'));var Redis=require(_0xf323('0x2'));var config=require(_0xf323('0x3'));var logger=require(_0xf323('0x4'))(_0xf323('0x5'));config[_0xf323('0x6')]=_[_0xf323('0x7')](config[_0xf323('0x6')],{'host':_0xf323('0x8'),'port':0x18eb});var io=require(_0xf323('0x9'))(new Redis(config['redis']));function emit(_0xb9a667,_0x444cba,_0x1af70d){io['to'](_0xb9a667)[_0xf323('0xa')](_0x444cba,_0x1af70d);}function sendNotification(_0x8abeac,_0x3c416a,_0x105b93,_0x2b24a2,_0x10d1ff,_0x21e82e){io['to'](util[_0xf323('0xb')](_0xf323('0xc'),_0x2b24a2[_0xf323('0xd')]))[_0xf323('0xa')](_0xf323('0xe'),_0x2b24a2);var _0xb6ec37=_0x21e82e||{};var _0x11a363=_0x105b93['split']('.');var _0x1b6a09={'uniqueid':_0x3c416a,'channel':_0x11a363[0x0],'id':_0x11a363[0x1],'title':_0x11a363[0x0]+_0xf323('0xf'),'interactionId':_0x11a363[0x2],'queue':_0x10d1ff?_0x10d1ff[_0xf323('0xd')]:null,'sound':_0xb6ec37['account'][_0xf323('0x10')],'shake':_0xb6ec37[_0xf323('0x11')][_0xf323('0x12')]};try{if(!_0xb6ec37[_0xf323('0x13')]){_0xb6ec37[_0xf323('0x13')]={};}if(_0x10d1ff){_0xb6ec37[_0xf323('0x13')]['queue']=_0x10d1ff;}else if(_0xb6ec37['body'][_0xf323('0x14')]){delete _0xb6ec37[_0xf323('0x13')][_0xf323('0x14')];}_0x1b6a09[_0xf323('0x15')]=utils[_0xf323('0x16')](_0xb6ec37['account'][_0xf323('0x17')],_0xb6ec37);}catch(_0x1632ad){_0x1b6a09[_0xf323('0x15')]=_0xf323('0x18');logger['error'](util[_0xf323('0xb')](_0xf323('0x19'),_0x3c416a,_0x1632ad[_0xf323('0x1a')]));}io['to'](util[_0xf323('0xb')]('user:%s',_0x2b24a2[_0xf323('0xd')]))[_0xf323('0xa')](util['format'](_0xf323('0x1b'),_0x8abeac?_0xf323('0x1c'):_0xf323('0x1d')),_0x1b6a09);}function writeLog(_0x183ce0,_0x58e22b,_0xdc7891){return logger[_0xf323('0x1e')](util[_0xf323('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x183ce0,_0x58e22b[_0xf323('0xd')],_0xdc7891));}exports[_0xf323('0x1f')]=function(_0x3e1c49,_0x3450d6,_0x13ec1f,_0xa3362c){if(_0x3450d6[_0xf323('0x20')]){writeLog(_0x3e1c49,_0x3450d6,_0xf323('0x21'));return![];}if(!_0x3450d6[_0xf323('0x22')]){writeLog(_0x3e1c49,_0x3450d6,'OFFLINE');return![];}if(_0x3450d6[_0x13ec1f+_0xf323('0x23')]){writeLog(_0x3e1c49,_0x3450d6,_0xf323('0x24'));return![];}if(_0xa3362c&&_0x3450d6[_0xf323('0x25')](_0x13ec1f+_0xf323('0x26'))&&_0x3450d6[_0xf323('0x25')](_0x13ec1f+_0xf323('0x27'))){if(_0x3450d6[_0x13ec1f+'Capacity']>0x0&&_0x3450d6[_0x13ec1f+_0xf323('0x27')]>=_0x3450d6[_0x13ec1f+'Capacity']){writeLog(_0x3e1c49,_0x3450d6,_0x13ec1f[_0xf323('0x28')]()+_0xf323('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x46663b,_0x3c95ce,_0x2b6254,_0x3dcf65,_0x46e3b1){return sendNotification(!![],_0x46663b,_0x3c95ce,_0x2b6254,_0x3dcf65,_0x46e3b1);};exports['hideNotification']=function(_0x44c944,_0x34b536,_0x12c7d5,_0x30a5d7,_0x4260f3){return sendNotification(![],_0x44c944,_0x34b536,_0x12c7d5,_0x30a5d7,_0x4260f3);};exports[_0xf323('0x2a')]=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 6594496..3639996 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 _0x03cf=['[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','shelljs','lodash','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x03cf,0x64));var _0xf03c=function(_0x40814b,_0x1fe819){_0x40814b=_0x40814b-0x0;var _0x5c9dbb=_0x03cf[_0x40814b];return _0x5c9dbb;};'use strict';var schema=require('validate');var sh=require(_0xf03c('0x0'));var _=require(_0xf03c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf03c('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0xf03c('0x3')}});exports['consequence']=function(_0x18341c,_0x1129c9){return function(_0x404b44){try{var _0x4c2af5={'command':_0x1129c9[0x0]};var _0x11841d=system[_0xf03c('0x4')](_0x4c2af5,{'typecast':!![]});if(_0x11841d[_0xf03c('0x5')]){logger[_0xf03c('0x6')](_0xf03c('0x7'),_0x18341c,_[_0xf03c('0x8')](_0x11841d,'message')[_0xf03c('0x9')](',\x20'));logger[_0xf03c('0xa')](_0xf03c('0xb'),_0x18341c);_0x404b44[_0xf03c('0xc')]();}else{var _0x15d5c6=this;var _0x36c6c3=utils[_0xf03c('0xd')](_0x1129c9[0x0],this);logger[_0xf03c('0xa')](_0xf03c('0xe'),_0x18341c,_0x36c6c3);sh[_0xf03c('0xf')](_[_0xf03c('0x10')](_0x36c6c3),function(_0x3eab9c,_0x41081d){logger['info'](_0xf03c('0x11'),_0x18341c,_0x3eab9c);if(_0x3eab9c==0x0){var _0x41c4bf=_0x41081d[_0xf03c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xf03c('0x13')](_0x1129c9[0x1])||_['isEmpty'](_0x1129c9[0x1])){logger[_0xf03c('0xa')](_0xf03c('0x14'),_0x18341c);_0x15d5c6['body'][_0x1129c9[0x1]]=_0x41c4bf;}else{logger[_0xf03c('0xa')](_0xf03c('0x15'),_0x18341c,_0x1129c9[0x1],_0x41c4bf);_0x15d5c6[_0xf03c('0x16')][_0x1129c9[0x1]]=_0x41c4bf;}}_0x404b44['next']();});}}catch(_0x416f48){logger['error'](_0xf03c('0x7'),_0x18341c,_[_0xf03c('0x17')](_0x416f48)?JSON['stringify'](_0x416f48):_0x416f48);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x18341c);_0x404b44[_0xf03c('0xc')]();}};}; \ No newline at end of file +var _0xd1ab=['trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','validate','shelljs','lodash','../../../../config/logger','routing','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x54736,_0x157c7a){var _0x26e8f6=function(_0x5f52f4){while(--_0x5f52f4){_0x54736['push'](_0x54736['shift']());}};_0x26e8f6(++_0x157c7a);}(_0xd1ab,0x101));var _0xbd1a=function(_0x252c54,_0x595fe5){_0x252c54=_0x252c54-0x0;var _0x50e270=_0xd1ab[_0x252c54];return _0x50e270;};'use strict';var schema=require(_0xbd1a('0x0'));var sh=require(_0xbd1a('0x1'));var _=require(_0xbd1a('0x2'));var utils=require('./utils');var logger=require(_0xbd1a('0x3'))(_0xbd1a('0x4'));var system=schema({'command':{'type':_0xbd1a('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xbd1a('0x6')]=function(_0xd21de7,_0x4682f9){return function(_0x1312ef){try{var _0x1239ba={'command':_0x4682f9[0x0]};var _0x1cee8b=system[_0xbd1a('0x0')](_0x1239ba,{'typecast':!![]});if(_0x1cee8b[_0xbd1a('0x7')]){logger[_0xbd1a('0x8')](_0xbd1a('0x9'),_0xd21de7,_[_0xbd1a('0xa')](_0x1cee8b,'message')[_0xbd1a('0xb')](',\x20'));logger['info'](_0xbd1a('0xc'),_0xd21de7);_0x1312ef[_0xbd1a('0xd')]();}else{var _0x433981=this;var _0x1ebbea=utils[_0xbd1a('0xe')](_0x4682f9[0x0],this);logger[_0xbd1a('0xf')](_0xbd1a('0x10'),_0xd21de7,_0x1ebbea);sh[_0xbd1a('0x11')](_[_0xbd1a('0x12')](_0x1ebbea),function(_0xa6db83,_0x261c95){logger[_0xbd1a('0xf')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xd21de7,_0xa6db83);if(_0xa6db83==0x0){var _0x473630=_0x261c95[_0xbd1a('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xbd1a('0x14')](_0x4682f9[0x1])||_[_0xbd1a('0x15')](_0x4682f9[0x1])){logger[_0xbd1a('0xf')](_0xbd1a('0x16'),_0xd21de7);_0x433981[_0xbd1a('0x17')][_0x4682f9[0x1]]=_0x473630;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0xd21de7,_0x4682f9[0x1],_0x473630);_0x433981[_0xbd1a('0x17')][_0x4682f9[0x1]]=_0x473630;}}_0x1312ef[_0xbd1a('0xd')]();});}}catch(_0x431491){logger[_0xbd1a('0x8')](_0xbd1a('0x9'),_0xd21de7,_[_0xbd1a('0x18')](_0x431491)?JSON['stringify'](_0x431491):_0x431491);logger[_0xbd1a('0xf')](_0xbd1a('0xc'),_0xd21de7);_0x1312ef[_0xbd1a('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index b7a11a7..e57b2ce 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 _0xcbfc=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','message','info','next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xcbfc,0xa0));var _0xccbf=function(_0x3a8e7d,_0x1bfcd8){_0x3a8e7d=_0x3a8e7d-0x0;var _0x5d12db=_0xcbfc[_0x3a8e7d];return _0x5d12db;};'use strict';var schema=require(_0xccbf('0x0'));var _=require(_0xccbf('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xccbf('0x2')),'smsInteraction':require(_0xccbf('0x3')),'mailInteraction':require(_0xccbf('0x4')),'faxInteraction':require(_0xccbf('0x5')),'whatsappInteraction':require(_0xccbf('0x6'))};var logger=require('../../../../config/logger')(_0xccbf('0x7'));var tag=schema({'tag':{'type':_0xccbf('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xccbf('0x9')]=function(_0xbbdfc7,_0x5aae46,_0x45ec70,_0x14725c){return function(_0xbdecfc){try{var _0x5abaf7={'tag':_0x5aae46[0x0]};var _0x194be5=tag['validate'](_0x5abaf7,{'typecast':!![]});if(_0x194be5[_0xccbf('0xa')]){logger[_0xccbf('0xb')]('[%s][TAG]\x20%s',_0xbbdfc7,_['map'](_0x194be5,_0xccbf('0xc'))['join'](',\x20'));logger[_0xccbf('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xbbdfc7);_0xbdecfc[_0xccbf('0xe')]();}else{var _0x179a8d={'ids':[_0x5aae46[0x0]]};if(rpc[_0x14725c['channel']+_0xccbf('0xf')]){rpc[_0x14725c['channel']+_0xccbf('0xf')][_0xccbf('0x10')](_0x14725c[_0xccbf('0x11')]['id'],_0x179a8d)[_0xccbf('0x12')](function(_0x437f73){logger['info'](_0xccbf('0x13'),_0xbbdfc7,_0x5aae46[0x1],_0x14725c[_0xccbf('0x14')],_0x14725c[_0xccbf('0x11')]['id']);})[_0xccbf('0x15')](function(_0xb9bd73){logger[_0xccbf('0xb')](_0xccbf('0x16'),_0xbbdfc7,JSON[_0xccbf('0x17')](_0xb9bd73));logger[_0xccbf('0xd')](_0xccbf('0x18'),_0xbbdfc7);})[_0xccbf('0x19')](function(){_0xbdecfc[_0xccbf('0xe')]();});}}}catch(_0x29e947){logger[_0xccbf('0xb')]('[%s][TAG]\x20%s',_0xbbdfc7,_[_0xccbf('0x1a')](_0x29e947)?JSON[_0xccbf('0x17')](_0x29e947):_0x29e947);logger[_0xccbf('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xbbdfc7);_0xbdecfc[_0xccbf('0xe')]();}};}; \ No newline at end of file +var _0x91c4=['then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','message','join','info','next','channel','Interaction','addTags','interaction'];(function(_0x3ef6fe,_0x50df47){var _0x1e3e8c=function(_0x26fb33){while(--_0x26fb33){_0x3ef6fe['push'](_0x3ef6fe['shift']());}};_0x1e3e8c(++_0x50df47);}(_0x91c4,0x158));var _0x491c=function(_0x5bc8d3,_0x2fe93d){_0x5bc8d3=_0x5bc8d3-0x0;var _0x4d1662=_0x91c4[_0x5bc8d3];return _0x4d1662;};'use strict';var schema=require(_0x491c('0x0'));var _=require(_0x491c('0x1'));var rpc={'chatInteraction':require(_0x491c('0x2')),'openchannelInteraction':require(_0x491c('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x491c('0x4')),'faxInteraction':require(_0x491c('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x491c('0x6'))(_0x491c('0x7'));var tag=schema({'tag':{'type':_0x491c('0x8'),'required':!![],'message':_0x491c('0x9')}});exports[_0x491c('0xa')]=function(_0x1cbad4,_0x52acd9,_0x46152c,_0x2ad721){return function(_0x51203b){try{var _0x1e4637={'tag':_0x52acd9[0x0]};var _0x1ee998=tag[_0x491c('0x0')](_0x1e4637,{'typecast':!![]});if(_0x1ee998['length']){logger[_0x491c('0xb')]('[%s][TAG]\x20%s',_0x1cbad4,_['map'](_0x1ee998,_0x491c('0xc'))[_0x491c('0xd')](',\x20'));logger[_0x491c('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1cbad4);_0x51203b[_0x491c('0xf')]();}else{var _0x42a834={'ids':[_0x52acd9[0x0]]};if(rpc[_0x2ad721[_0x491c('0x10')]+_0x491c('0x11')]){rpc[_0x2ad721['channel']+_0x491c('0x11')][_0x491c('0x12')](_0x2ad721[_0x491c('0x13')]['id'],_0x42a834)[_0x491c('0x14')](function(_0xb791bc){logger[_0x491c('0xe')](_0x491c('0x15'),_0x1cbad4,_0x52acd9[0x1],_0x2ad721[_0x491c('0x10')],_0x2ad721[_0x491c('0x13')]['id']);})[_0x491c('0x16')](function(_0x31efad){logger['error'](_0x491c('0x17'),_0x1cbad4,JSON[_0x491c('0x18')](_0x31efad));logger[_0x491c('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1cbad4);})[_0x491c('0x19')](function(){_0x51203b[_0x491c('0xf')]();});}}}catch(_0x2ae9cf){logger[_0x491c('0xb')](_0x491c('0x17'),_0x1cbad4,_[_0x491c('0x1a')](_0x2ae9cf)?JSON['stringify'](_0x2ae9cf):_0x2ae9cf);logger[_0x491c('0xe')](_0x491c('0x1b'),_0x1cbad4);_0x51203b['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index e9651b4..ad78b1a 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0xd2062,_0x4a2c29){var _0x2a07fb=function(_0x21925e){while(--_0x21925e){_0xd2062['push'](_0xd2062['shift']());}};_0x2a07fb(++_0x4a2c29);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xb9dc6c,_0x25743e){var _0x51d3ac=function(_0x164605){while(--_0x164605){_0xb9dc6c['push'](_0xb9dc6c['shift']());}};_0x51d3ac(++_0x25743e);}(_0xe706,0xa3));var _0x6e70=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xe706[_0x2b5513];return _0x578fd2;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 972495c..39c8f00 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 _0x6f83=['interaction','applications','isArray','length','existsSync','join','.js','toLowerCase','autoreply','split','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','app','execute','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','catch','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6f83,0x154));var _0x36f8=function(_0x54dd6d,_0x85cc69){_0x54dd6d=_0x54dd6d-0x0;var _0x2aa5bb=_0x6f83[_0x54dd6d];return _0x2aa5bb;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x36f8('0x1'));var BPromise=require(_0x36f8('0x2'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x36f8('0x3'))(_0x36f8('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x36f8('0x5')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x36f8('0x6')),'faxQueueReport':require(_0x36f8('0x7')),'whatsappQueueReport':require(_0x36f8('0x8'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4e5419,_0xac949c,_0x1c2f57){return util[_0x36f8('0x9')](_0x36f8('0xa'),_0x4e5419,_0xac949c||0x0,_0x1c2f57||0x0);}function getIntervals(_0x3e76ab,_0x1b9f87){var _0x442a37=[];if(!_[_0x36f8('0xb')](_0x1b9f87['IntervalId'])&&!_[_0x36f8('0xb')](_0x3e76ab[_0x1b9f87[_0x36f8('0xc')]])&&!_['isNil'](_0x3e76ab[_0x1b9f87[_0x36f8('0xc')]][_0x36f8('0xd')])){_0x442a37=_[_0x36f8('0xe')](_0x3e76ab[_0x1b9f87['IntervalId']][_0x36f8('0xd')],'interval');}else if(!_[_0x36f8('0xb')](_0x1b9f87['interval'])){_0x442a37=[_0x1b9f87[_0x36f8('0xf')]];}return _0x442a37;}exports[_0x36f8('0x10')]=function(_0x1f618b){_0x1f618b[_0x36f8('0x11')]={};return new BPromise(function(_0x28f99a,_0x40560a){var _0x4278de={'Start':function(_0x4706ec){var _0xac3b22=this;return new Promise(function(_0x27704d,_0x3bec0d){if(_0x4706ec){try{var _0x3e06ef=[];var _0x2e1dbd=getId(_0x4706ec[_0x36f8('0x12')],_0x4706ec[_0x36f8('0x13')]?_0x4706ec[_0x36f8('0x13')]['id']:0x0,_0x4706ec[_0x36f8('0x14')]?_0x4706ec[_0x36f8('0x14')]['id']:0x0);if(_0x4706ec[_0x36f8('0x15')]&&_[_0x36f8('0x16')](_0x4706ec[_0x36f8('0x15')])&&_0x4706ec[_0x36f8('0x15')][_0x36f8('0x17')]){for(var _0xf2bbe5=0x0;_0xf2bbe5<_0x4706ec['applications'][_0x36f8('0x17')];_0xf2bbe5+=0x1){var _0x5bdb06=_0x4706ec['applications'][_0xf2bbe5];if(fs[_0x36f8('0x18')](path[_0x36f8('0x19')](__dirname,_0x36f8('0x15'),_0x5bdb06['app']+_0x36f8('0x1a')))){var _0x432667=[];switch(_0x5bdb06['app'][_0x36f8('0x1b')]()){case _0x36f8('0x1c'):var _0x4e369a=_0x5bdb06['appdata'][_0x36f8('0x1d')](',');if(_0x4706ec[_0x36f8('0x12')]==='mail'){_0x432667[_0x36f8('0x1e')](_0x4e369a[0x0]);_0x432667['push'](_0x4e369a[0x1]);_0x432667['push'](_0x4e369a[_0x36f8('0x1f')](0x2,_0x4e369a[_0x36f8('0x17')])[_0x36f8('0x19')](','));}else{_0x432667['push'](_0x4e369a[0x0]);_0x432667[_0x36f8('0x1e')](_0x4e369a[_0x36f8('0x1f')](0x1,_0x4e369a[_0x36f8('0x17')])['join'](','));}break;case _0x36f8('0x20'):var _0x13b828=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x13b828[0x0]);_0x432667[_0x36f8('0x1e')](_0x13b828[0x1]);_0x432667['push'](_0x13b828['slice'](0x2,_0x13b828['length'])[_0x36f8('0x19')](','));break;case _0x36f8('0x22'):var _0x5cd606=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x5cd606[0x0]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x1]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x2]);_0x432667[_0x36f8('0x1e')](_0x5cd606[0x3]);_0x432667[_0x36f8('0x1e')](_0x5cd606[_0x36f8('0x1f')](0x4,_0x5cd606[_0x36f8('0x17')])[_0x36f8('0x19')](','));break;case _0x36f8('0x23'):var _0x46fd55=_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');_0x432667[_0x36f8('0x1e')](_0x46fd55[0x0]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x1]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x2]);_0x432667[_0x36f8('0x1e')](_0x46fd55[0x3]);_0x432667[_0x36f8('0x1e')](_0x46fd55[_0x36f8('0x1f')](0x4,_0x46fd55['length'])[_0x36f8('0x19')](','));break;case _0x36f8('0x13'):_0x432667[_0x36f8('0x1e')](_0x5bdb06[_0x36f8('0x21')]);break;case _0x36f8('0x24'):_0x432667['push'](_0x5bdb06[_0x36f8('0x25')]);_0x432667[_0x36f8('0x1e')](_0x5bdb06[_0x36f8('0x21')]);break;default:_0x432667=_[_0x36f8('0xb')](_0x5bdb06[_0x36f8('0x21')])?[]:_0x5bdb06[_0x36f8('0x21')][_0x36f8('0x1d')](',');}var _0xd80543={'id':util['format'](_0x36f8('0x26'),_0x2e1dbd,_0x5bdb06['id'],_0x5bdb06['app']),'condition':require(_0x36f8('0x27'))['condition'](_0x2e1dbd,getIntervals(_0x1f618b[_0x36f8('0x28')],_0x5bdb06),_0x1f618b),'consequence':require(_0x36f8('0x29')+_0x5bdb06['app'])[_0x36f8('0x2a')](_0x2e1dbd,_0x432667,_0x1f618b,_0x4706ec),'p':_0x5bdb06[_0x36f8('0x2b')]||0x0};logger[_0x36f8('0x2c')](_0x36f8('0x2d'),_0xd80543['id'],_0x36f8('0x2e'),getIntervals(_0x1f618b['intervals'],_0x5bdb06)[_0x36f8('0x19')](_0x36f8('0x2f')));_0x3e06ef['push'](_0xd80543);}else{logger[_0x36f8('0x30')](_0x36f8('0x31'),path['join'](__dirname,'applications',_0x5bdb06[_0x36f8('0x32')]+_0x36f8('0x1a')));}}_0x1f618b[_0x36f8('0x11')][_0x2e1dbd]=new RuleEngine(_0x3e06ef);_0x1f618b['rules'][_0x2e1dbd][_0x36f8('0x33')](_0x4706ec,function(_0x2902bd){logger[_0x36f8('0x2c')]('Applications\x20executed',JSON[_0x36f8('0x34')](_0x2902bd[_0x36f8('0x35')]));if(_0x1f618b[_0x36f8('0x11')][_0x2e1dbd]){_0x1f618b[_0x36f8('0x11')][_0x2e1dbd][_0x36f8('0x36')]('complete');}});return _0x27704d({'code':0xc8,'message':_0x4706ec});}else{logger['info'](_0x36f8('0x37'));return _0x27704d({'code':0xc8,'message':_0x4706ec});}}catch(_0x4888b8){logger['error'](_0x4888b8['stack']);return _0x3bec0d(_0xac3b22[_0x36f8('0x30')](0x1f4,_0x4888b8));}}return _0x3bec0d(_0x36f8('0x38'));});},'AcceptMessage':function(_0x514e54){var _0x517a93=this;return new Promise(function(_0x1f6201,_0x9711a){if(_0x514e54[_0x36f8('0x39')]&&_0x514e54['agent']['id']){if(_0x1f618b['agents'][_0x514e54[_0x36f8('0x39')]['id']]){_0x1f618b[_0x36f8('0x3a')][_0x514e54[_0x36f8('0x39')]['id']][_0x36f8('0x3b')]=![];_0x1f618b[_0x36f8('0x3a')][_0x514e54[_0x36f8('0x39')]['id']][_0x36f8('0x3c')]=undefined;}}if(_0x514e54[_0x36f8('0x13')]&&_0x514e54['message']['id']){try{var _0xa8299a=getId(_0x514e54[_0x36f8('0x12')],_0x514e54[_0x36f8('0x13')]?_0x514e54[_0x36f8('0x13')]['id']:0x0,_0x514e54['interaction']?_0x514e54[_0x36f8('0x14')]['id']:0x0);if(_0x1f618b[_0x36f8('0x11')][_0xa8299a]){_0x1f618b[_0x36f8('0x11')][_0xa8299a][_0x36f8('0x36')]('end');if(rpc[_0x514e54[_0x36f8('0x12')]+_0x36f8('0x3d')]){rpc[_0x514e54[_0x36f8('0x12')]+_0x36f8('0x3d')][_0x36f8('0x3e')](_0xa8299a,{'UserId':_0x514e54['message']['UserId']})[_0x36f8('0x3f')](function(_0x12ace6){logger['error']('error\x20update\x20queue\x20report');});}}return _0x1f6201({'code':0xc8,'message':_0x514e54});}catch(_0x4ca7f6){logger[_0x36f8('0x30')](_0x4ca7f6[_0x36f8('0x40')]);return _0x9711a(_0x517a93[_0x36f8('0x30')](0x1f4,_0x4ca7f6));}}logger['error'](_0x36f8('0x41'));return _0x9711a(_0x517a93[_0x36f8('0x30')](0x1f4,_0x36f8('0x41')));});},'RejectMessage':function(_0x5d00b0){var _0x209adc=this;return new Promise(function(_0x2c0b39,_0x48f048){if(_0x5d00b0['agent']&&_0x5d00b0[_0x36f8('0x39')]['id']){try{if(_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']]){_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']][_0x36f8('0x3b')]=![];_0x1f618b[_0x36f8('0x3a')][_0x5d00b0[_0x36f8('0x39')]['id']]['busyQueue']=undefined;}return _0x2c0b39({'code':0xc8,'message':_0x5d00b0});}catch(_0x36c02a){logger[_0x36f8('0x30')](_0x36c02a['stack']);return _0x48f048(_0x209adc[_0x36f8('0x30')](0x1f4,_0x36c02a));}}logger[_0x36f8('0x30')](_0x36f8('0x41'));return _0x48f048(_0x209adc[_0x36f8('0x30')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2a06ee){var _0x2e7d7f=this;return new Promise(function(_0x4601d0,_0x25a787){if(_0x2a06ee[_0x36f8('0x12')]&&_0x2a06ee[_0x36f8('0x14')]&&_0x2a06ee[_0x36f8('0x14')]['id']){try{var _0x1f5a1e=getId(_0x2a06ee[_0x36f8('0x12')],_0x2a06ee[_0x36f8('0x13')]?_0x2a06ee[_0x36f8('0x13')]['id']:0x0,_0x2a06ee['interaction']?_0x2a06ee[_0x36f8('0x14')]['id']:0x0);if(_0x1f618b[_0x36f8('0x11')][_0x1f5a1e]){_0x1f618b[_0x36f8('0x11')][_0x1f5a1e]['emit']('end');}return _0x4601d0({'code':0xc8,'message':_0x2a06ee});}catch(_0x5cfcc5){logger[_0x36f8('0x30')](_0x5cfcc5[_0x36f8('0x40')]);return _0x25a787(_0x2e7d7f[_0x36f8('0x30')](0x1f4,_0x5cfcc5));}}logger[_0x36f8('0x30')](_0x36f8('0x41'));return _0x25a787(_0x2e7d7f[_0x36f8('0x30')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3a037e){var _0x49dcd5=this;return new Promise(function(_0x1a284d,_0x41da43){if(_0x1f618b[_0x36f8('0x3a')][_0x36f8('0x42')](_0x3a037e['id'])){for(var _0x514d01 in _0x3a037e[_0x36f8('0x43')]){if(_0x3a037e[_0x36f8('0x43')]['hasOwnProperty'](_0x514d01)){if(_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']][_0x36f8('0x42')](_0x514d01+_0x36f8('0x44'))){_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']][_0x514d01+_0x36f8('0x44')]=parseInt(_0x3a037e[_0x36f8('0x43')][_0x514d01],0xa);}}}_0x1f618b['agents'][_0x3a037e['id']][_0x36f8('0x45')]();return _0x1a284d({'code':0xc8,'message':_0x1f618b[_0x36f8('0x3a')][_0x3a037e['id']]});}else{return _0x41da43(_0x49dcd5[_0x36f8('0x30')](0x1f4,_0x36f8('0x46')));}});},'Agents':function(_0x6afd2f){return new Promise(function(_0x5e09aa,_0x28451d){var _0xbebe4c=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x3a')]);_0x5e09aa({'count':_0xbebe4c['length'],'rows':_0xbebe4c});});},'ChatQueues':function(_0x3f2d31){return new Promise(function(_0x340de5,_0x10dc35){var _0x20039c=[];for(var _0x25c6b0 in _0x1f618b[_0x36f8('0x48')]){if(_0x1f618b[_0x36f8('0x48')][_0x36f8('0x42')](_0x25c6b0)){var _0x49bc6c=_0x1f618b[_0x36f8('0x48')][_0x25c6b0];var _0x40f0cf={'id':_0x49bc6c['id'],'available':_0x49bc6c[_0x36f8('0x49')],'loggedIn':_0x49bc6c[_0x36f8('0x4a')],'name':_0x49bc6c[_0x36f8('0x4b')],'paused':_0x49bc6c[_0x36f8('0x4c')],'waiting':_0x49bc6c[_0x36f8('0x4d')]};_0x20039c['push'](_0x40f0cf);}}_0x340de5({'count':_0x20039c[_0x36f8('0x17')],'rows':_0x20039c});});},'MailQueues':function(_0xe2fd87){return new Promise(function(_0x366769,_0x3c6a4b){var _0x21f1e5=[];for(var _0x381f26 in _0x1f618b[_0x36f8('0x4e')]){if(_0x1f618b[_0x36f8('0x4e')][_0x36f8('0x42')](_0x381f26)){var _0xf3f9ad=_0x1f618b[_0x36f8('0x4e')][_0x381f26];var _0x3bcb6c={'id':_0xf3f9ad['id'],'available':_0xf3f9ad['available'],'loggedIn':_0xf3f9ad['loggedIn'],'name':_0xf3f9ad[_0x36f8('0x4b')],'paused':_0xf3f9ad[_0x36f8('0x4c')],'waiting':_0xf3f9ad[_0x36f8('0x4d')]};_0x21f1e5[_0x36f8('0x1e')](_0x3bcb6c);}}_0x366769({'count':_0x21f1e5['length'],'rows':_0x21f1e5});});},'OpenchannelQueues':function(_0x1d2bb8){return new Promise(function(_0x407749,_0x217ad9){var _0x4dfeef=[];for(var _0x132e5b in _0x1f618b[_0x36f8('0x4f')]){if(_0x1f618b['openchannelQueues']['hasOwnProperty'](_0x132e5b)){var _0x5279c8=_0x1f618b[_0x36f8('0x4f')][_0x132e5b];var _0x190c7e={'id':_0x5279c8['id'],'available':_0x5279c8[_0x36f8('0x49')],'loggedIn':_0x5279c8['loggedIn'],'name':_0x5279c8['name'],'paused':_0x5279c8[_0x36f8('0x4c')],'waiting':_0x5279c8[_0x36f8('0x4d')]};_0x4dfeef[_0x36f8('0x1e')](_0x190c7e);}}_0x407749({'count':_0x4dfeef[_0x36f8('0x17')],'rows':_0x4dfeef});});},'SmsQueues':function(_0x3bbece){return new Promise(function(_0x2624d2,_0x30a786){var _0x55f533=[];for(var _0x2ecfab in _0x1f618b[_0x36f8('0x50')]){if(_0x1f618b[_0x36f8('0x50')]['hasOwnProperty'](_0x2ecfab)){var _0x435ddf=_0x1f618b[_0x36f8('0x50')][_0x2ecfab];var _0x1278dd={'id':_0x435ddf['id'],'available':_0x435ddf[_0x36f8('0x49')],'loggedIn':_0x435ddf[_0x36f8('0x4a')],'name':_0x435ddf[_0x36f8('0x4b')],'paused':_0x435ddf[_0x36f8('0x4c')],'waiting':_0x435ddf[_0x36f8('0x4d')]};_0x55f533[_0x36f8('0x1e')](_0x1278dd);}}_0x2624d2({'count':_0x55f533[_0x36f8('0x17')],'rows':_0x55f533});});},'FaxQueues':function(_0x157c5b){return new Promise(function(_0x26fd93,_0x1f3522){var _0x3b7335=[];for(var _0x1ef70c in _0x1f618b[_0x36f8('0x51')]){if(_0x1f618b[_0x36f8('0x51')][_0x36f8('0x42')](_0x1ef70c)){var _0x4a2e48=_0x1f618b[_0x36f8('0x51')][_0x1ef70c];var _0x49bc9b={'id':_0x4a2e48['id'],'available':_0x4a2e48[_0x36f8('0x49')],'loggedIn':_0x4a2e48[_0x36f8('0x4a')],'name':_0x4a2e48[_0x36f8('0x4b')],'paused':_0x4a2e48['paused'],'waiting':_0x4a2e48['waiting']};_0x3b7335[_0x36f8('0x1e')](_0x49bc9b);}}_0x26fd93({'count':_0x3b7335[_0x36f8('0x17')],'rows':_0x3b7335});});},'WhatsappQueues':function(_0x27a387){return new Promise(function(_0xe21bd,_0x3e5a9c){var _0x1fa54e=[];for(var _0x560947 in _0x1f618b[_0x36f8('0x52')]){if(_0x1f618b[_0x36f8('0x52')][_0x36f8('0x42')](_0x560947)){var _0x358043=_0x1f618b[_0x36f8('0x52')][_0x560947];var _0x4499e3={'id':_0x358043['id'],'available':_0x358043[_0x36f8('0x49')],'loggedIn':_0x358043[_0x36f8('0x4a')],'name':_0x358043[_0x36f8('0x4b')],'paused':_0x358043[_0x36f8('0x4c')],'waiting':_0x358043[_0x36f8('0x4d')]};_0x1fa54e[_0x36f8('0x1e')](_0x4499e3);}}_0xe21bd({'count':_0x1fa54e[_0x36f8('0x17')],'rows':_0x1fa54e});});},'ChatQueuesWaitingInteractions':function(_0xae1a81){return new Promise(function(_0xc8252a,_0x474b5c){var _0x508629=_[_0x36f8('0x47')](_0x1f618b['chatQueuesWaitingInteractions']);_0xc8252a({'count':_0x508629['length'],'rows':_0x508629});});},'MailQueuesWaitingInteractions':function(_0x566a64){return new Promise(function(_0x5e7cab,_0x45854c){var _0x4e4e2b=_[_0x36f8('0x47')](_0x1f618b['mailQueuesWaitingInteractions']);_0x5e7cab({'count':_0x4e4e2b[_0x36f8('0x17')],'rows':_0x4e4e2b});});},'OpenchannelQueuesWaitingInteractions':function(_0x4581ea){return new Promise(function(_0x5e0d25,_0x748321){var _0x3149bf=_[_0x36f8('0x47')](_0x1f618b['openchannelQueuesWaitingInteractions']);_0x5e0d25({'count':_0x3149bf[_0x36f8('0x17')],'rows':_0x3149bf});});},'SmsQueuesWaitingInteractions':function(_0xd2c6ca){return new Promise(function(_0x4a7754,_0x27a370){var _0x43bf61=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x53')]);_0x4a7754({'count':_0x43bf61[_0x36f8('0x17')],'rows':_0x43bf61});});},'FaxQueuesWaitingInteractions':function(_0x1c4ac3){return new Promise(function(_0x5a9aa5,_0x57190e){var _0x3c589e=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x54')]);_0x5a9aa5({'count':_0x3c589e[_0x36f8('0x17')],'rows':_0x3c589e});});},'WhatsappQueuesWaitingInteractions':function(_0x247237){return new Promise(function(_0x9964b9,_0x385e16){var _0x2b4beb=_[_0x36f8('0x47')](_0x1f618b[_0x36f8('0x55')]);_0x9964b9({'count':_0x2b4beb['length'],'rows':_0x2b4beb});});}};var _0x4f89c1=jayson[_0x36f8('0x56')](_0x4278de)['http']();_0x4f89c1['on'](_0x36f8('0x30'),function(_0x4a2861){logger[_0x36f8('0x30')](JSON['stringify'](_0x4a2861));return _0x40560a(_0x4a2861);});_0x4f89c1[_0x36f8('0x10')](0x232c,_0x36f8('0x57'),function(){console['log'](_0x36f8('0x58'),0x232c);return _0x28f99a(_0x36f8('0x59')+0x232c);});});}; \ No newline at end of file +var _0x9dc3=['TagId','%s:%s:%s','./interval','condition','intervals','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','complete','stack','agent','agents','busy','channel','interaction','emit','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','message','isArray','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9dc3,0x93));var _0x39dc=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x9dc3[_0x51b1a5];return _0x15c738;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x39dc('0x0'));var fs=require('fs');var jayson=require(_0x39dc('0x1'));var BPromise=require(_0x39dc('0x2'));var uuid=require(_0x39dc('0x3'));var config=require(_0x39dc('0x4'));var logger=require(_0x39dc('0x5'))(_0x39dc('0x6'));var rpc={'openchannelQueueReport':require(_0x39dc('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x39dc('0x8')),'smsQueueReport':require(_0x39dc('0x9')),'faxQueueReport':require(_0x39dc('0xa')),'whatsappQueueReport':require(_0x39dc('0xb'))};var RuleEngine=require(_0x39dc('0xc'));function getId(_0xf87f56,_0x4fe9f8,_0x2a79b3){return util[_0x39dc('0xd')]('%s.%s.%s',_0xf87f56,_0x4fe9f8||0x0,_0x2a79b3||0x0);}function getIntervals(_0xacb1ef,_0x40d789){var _0x2103e6=[];if(!_[_0x39dc('0xe')](_0x40d789[_0x39dc('0xf')])&&!_[_0x39dc('0xe')](_0xacb1ef[_0x40d789[_0x39dc('0xf')]])&&!_[_0x39dc('0xe')](_0xacb1ef[_0x40d789[_0x39dc('0xf')]][_0x39dc('0x10')])){_0x2103e6=_[_0x39dc('0x11')](_0xacb1ef[_0x40d789[_0x39dc('0xf')]][_0x39dc('0x10')],_0x39dc('0x12'));}else if(!_[_0x39dc('0xe')](_0x40d789[_0x39dc('0x12')])){_0x2103e6=[_0x40d789[_0x39dc('0x12')]];}return _0x2103e6;}exports[_0x39dc('0x13')]=function(_0x4c63c4){_0x4c63c4[_0x39dc('0x14')]={};return new BPromise(function(_0x476e24,_0x51cb2a){var _0x240f4e={'Start':function(_0x2ad25c){var _0x179ae4=this;return new Promise(function(_0x41f2a5,_0x2b6547){if(_0x2ad25c){try{var _0x5cc05c=[];var _0x1c171c=getId(_0x2ad25c['channel'],_0x2ad25c[_0x39dc('0x15')]?_0x2ad25c['message']['id']:0x0,_0x2ad25c['interaction']?_0x2ad25c['interaction']['id']:0x0);if(_0x2ad25c['applications']&&_[_0x39dc('0x16')](_0x2ad25c['applications'])&&_0x2ad25c[_0x39dc('0x17')][_0x39dc('0x18')]){for(var _0x2abe03=0x0;_0x2abe03<_0x2ad25c['applications'][_0x39dc('0x18')];_0x2abe03+=0x1){var _0x223568=_0x2ad25c['applications'][_0x2abe03];if(fs[_0x39dc('0x19')](path[_0x39dc('0x1a')](__dirname,'applications',_0x223568[_0x39dc('0x1b')]+_0x39dc('0x1c')))){var _0x294356=[];switch(_0x223568[_0x39dc('0x1b')][_0x39dc('0x1d')]()){case'autoreply':var _0x4f25dc=_0x223568[_0x39dc('0x1e')][_0x39dc('0x1f')](',');if(_0x2ad25c['channel']===_0x39dc('0x20')){_0x294356[_0x39dc('0x21')](_0x4f25dc[0x0]);_0x294356['push'](_0x4f25dc[0x1]);_0x294356['push'](_0x4f25dc[_0x39dc('0x22')](0x2,_0x4f25dc[_0x39dc('0x18')])[_0x39dc('0x1a')](','));}else{_0x294356[_0x39dc('0x21')](_0x4f25dc[0x0]);_0x294356[_0x39dc('0x21')](_0x4f25dc['slice'](0x1,_0x4f25dc['length'])[_0x39dc('0x1a')](','));}break;case _0x39dc('0x23'):var _0x332221=_0x223568['appdata'][_0x39dc('0x1f')](',');_0x294356[_0x39dc('0x21')](_0x332221[0x0]);_0x294356[_0x39dc('0x21')](_0x332221[0x1]);_0x294356[_0x39dc('0x21')](_0x332221[_0x39dc('0x22')](0x2,_0x332221[_0x39dc('0x18')])[_0x39dc('0x1a')](','));break;case _0x39dc('0x24'):var _0x35cedf=_0x223568['appdata'][_0x39dc('0x1f')](',');_0x294356[_0x39dc('0x21')](_0x35cedf[0x0]);_0x294356[_0x39dc('0x21')](_0x35cedf[0x1]);_0x294356[_0x39dc('0x21')](_0x35cedf[0x2]);_0x294356[_0x39dc('0x21')](_0x35cedf[0x3]);_0x294356[_0x39dc('0x21')](_0x35cedf[_0x39dc('0x22')](0x4,_0x35cedf[_0x39dc('0x18')])[_0x39dc('0x1a')](','));break;case _0x39dc('0x25'):var _0x1f6be6=_0x223568[_0x39dc('0x1e')]['split'](',');_0x294356[_0x39dc('0x21')](_0x1f6be6[0x0]);_0x294356[_0x39dc('0x21')](_0x1f6be6[0x1]);_0x294356[_0x39dc('0x21')](_0x1f6be6[0x2]);_0x294356[_0x39dc('0x21')](_0x1f6be6[0x3]);_0x294356[_0x39dc('0x21')](_0x1f6be6['slice'](0x4,_0x1f6be6['length'])[_0x39dc('0x1a')](','));break;case'message':_0x294356[_0x39dc('0x21')](_0x223568[_0x39dc('0x1e')]);break;case _0x39dc('0x26'):_0x294356[_0x39dc('0x21')](_0x223568[_0x39dc('0x27')]);_0x294356['push'](_0x223568[_0x39dc('0x1e')]);break;default:_0x294356=_[_0x39dc('0xe')](_0x223568[_0x39dc('0x1e')])?[]:_0x223568[_0x39dc('0x1e')]['split'](',');}var _0x5d85f7={'id':util[_0x39dc('0xd')](_0x39dc('0x28'),_0x1c171c,_0x223568['id'],_0x223568[_0x39dc('0x1b')]),'condition':require(_0x39dc('0x29'))[_0x39dc('0x2a')](_0x1c171c,getIntervals(_0x4c63c4[_0x39dc('0x2b')],_0x223568),_0x4c63c4),'consequence':require('./applications/'+_0x223568[_0x39dc('0x1b')])['consequence'](_0x1c171c,_0x294356,_0x4c63c4,_0x2ad25c),'p':_0x223568['priority']||0x0};logger['info'](_0x39dc('0x2c'),_0x5d85f7['id'],_0x39dc('0x2d'),getIntervals(_0x4c63c4[_0x39dc('0x2b')],_0x223568)[_0x39dc('0x1a')]('\x20|\x20'));_0x5cc05c[_0x39dc('0x21')](_0x5d85f7);}else{logger[_0x39dc('0x2e')](_0x39dc('0x2f'),path['join'](__dirname,_0x39dc('0x17'),_0x223568[_0x39dc('0x1b')]+'.js'));}}_0x4c63c4[_0x39dc('0x14')][_0x1c171c]=new RuleEngine(_0x5cc05c);_0x4c63c4[_0x39dc('0x14')][_0x1c171c][_0x39dc('0x30')](_0x2ad25c,function(_0x34ee0c){logger[_0x39dc('0x31')]('Applications\x20executed',JSON[_0x39dc('0x32')](_0x34ee0c[_0x39dc('0x33')]));if(_0x4c63c4[_0x39dc('0x14')][_0x1c171c]){_0x4c63c4[_0x39dc('0x14')][_0x1c171c]['emit'](_0x39dc('0x34'));}});return _0x41f2a5({'code':0xc8,'message':_0x2ad25c});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x41f2a5({'code':0xc8,'message':_0x2ad25c});}}catch(_0x265f05){logger['error'](_0x265f05[_0x39dc('0x35')]);return _0x2b6547(_0x179ae4[_0x39dc('0x2e')](0x1f4,_0x265f05));}}return _0x2b6547('routing\x20is\x20empty');});},'AcceptMessage':function(_0x393955){var _0x19913d=this;return new Promise(function(_0x20c81b,_0x3ddf55){if(_0x393955['agent']&&_0x393955[_0x39dc('0x36')]['id']){if(_0x4c63c4[_0x39dc('0x37')][_0x393955['agent']['id']]){_0x4c63c4[_0x39dc('0x37')][_0x393955[_0x39dc('0x36')]['id']][_0x39dc('0x38')]=![];_0x4c63c4[_0x39dc('0x37')][_0x393955[_0x39dc('0x36')]['id']]['busyQueue']=undefined;}}if(_0x393955[_0x39dc('0x15')]&&_0x393955[_0x39dc('0x15')]['id']){try{var _0x46d2fb=getId(_0x393955[_0x39dc('0x39')],_0x393955[_0x39dc('0x15')]?_0x393955[_0x39dc('0x15')]['id']:0x0,_0x393955[_0x39dc('0x3a')]?_0x393955[_0x39dc('0x3a')]['id']:0x0);if(_0x4c63c4[_0x39dc('0x14')][_0x46d2fb]){_0x4c63c4[_0x39dc('0x14')][_0x46d2fb][_0x39dc('0x3b')]('end');if(rpc[_0x393955['channel']+'QueueReport']){rpc[_0x393955[_0x39dc('0x39')]+'QueueReport']['update'](_0x46d2fb,{'UserId':_0x393955[_0x39dc('0x15')][_0x39dc('0x3c')]})[_0x39dc('0x3d')](function(_0x2016e1){logger['error'](_0x39dc('0x3e'));});}}return _0x20c81b({'code':0xc8,'message':_0x393955});}catch(_0xe2409c){logger[_0x39dc('0x2e')](_0xe2409c[_0x39dc('0x35')]);return _0x3ddf55(_0x19913d[_0x39dc('0x2e')](0x1f4,_0xe2409c));}}logger[_0x39dc('0x2e')]('message\x20is\x20empty');return _0x3ddf55(_0x19913d[_0x39dc('0x2e')](0x1f4,_0x39dc('0x3f')));});},'RejectMessage':function(_0x40d6e6){var _0xd5ae5e=this;return new Promise(function(_0x152fa6,_0x376610){if(_0x40d6e6[_0x39dc('0x36')]&&_0x40d6e6[_0x39dc('0x36')]['id']){try{if(_0x4c63c4[_0x39dc('0x37')][_0x40d6e6[_0x39dc('0x36')]['id']]){_0x4c63c4['agents'][_0x40d6e6['agent']['id']][_0x39dc('0x38')]=![];_0x4c63c4['agents'][_0x40d6e6['agent']['id']][_0x39dc('0x40')]=undefined;}return _0x152fa6({'code':0xc8,'message':_0x40d6e6});}catch(_0x3d7223){logger['error'](_0x3d7223[_0x39dc('0x35')]);return _0x376610(_0xd5ae5e[_0x39dc('0x2e')](0x1f4,_0x3d7223));}}logger['error'](_0x39dc('0x3f'));return _0x376610(_0xd5ae5e['error'](0x1f4,_0x39dc('0x3f')));});},'AbandonInteraction':function(_0x4a911f){var _0x147292=this;return new Promise(function(_0x1fea37,_0x2a3f67){if(_0x4a911f[_0x39dc('0x39')]&&_0x4a911f[_0x39dc('0x3a')]&&_0x4a911f[_0x39dc('0x3a')]['id']){try{var _0x2fb157=getId(_0x4a911f[_0x39dc('0x39')],_0x4a911f[_0x39dc('0x15')]?_0x4a911f[_0x39dc('0x15')]['id']:0x0,_0x4a911f[_0x39dc('0x3a')]?_0x4a911f[_0x39dc('0x3a')]['id']:0x0);if(_0x4c63c4[_0x39dc('0x14')][_0x2fb157]){_0x4c63c4[_0x39dc('0x14')][_0x2fb157][_0x39dc('0x3b')](_0x39dc('0x41'));}return _0x1fea37({'code':0xc8,'message':_0x4a911f});}catch(_0x33aea9){logger[_0x39dc('0x2e')](_0x33aea9[_0x39dc('0x35')]);return _0x2a3f67(_0x147292['error'](0x1f4,_0x33aea9));}}logger[_0x39dc('0x2e')](_0x39dc('0x3f'));return _0x2a3f67(_0x147292['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x344186){var _0x578bf9=this;return new Promise(function(_0x2e851c,_0xdc0b4a){if(_0x4c63c4[_0x39dc('0x37')][_0x39dc('0x42')](_0x344186['id'])){for(var _0x4ada35 in _0x344186[_0x39dc('0x43')]){if(_0x344186['capacity'][_0x39dc('0x42')](_0x4ada35)){if(_0x4c63c4[_0x39dc('0x37')][_0x344186['id']][_0x39dc('0x42')](_0x4ada35+'CurrentCapacity')){_0x4c63c4[_0x39dc('0x37')][_0x344186['id']][_0x4ada35+_0x39dc('0x44')]=parseInt(_0x344186[_0x39dc('0x43')][_0x4ada35],0xa);}}}_0x4c63c4[_0x39dc('0x37')][_0x344186['id']][_0x39dc('0x45')]();return _0x2e851c({'code':0xc8,'message':_0x4c63c4['agents'][_0x344186['id']]});}else{return _0xdc0b4a(_0x578bf9[_0x39dc('0x2e')](0x1f4,_0x39dc('0x46')));}});},'Agents':function(_0x47e165){return new Promise(function(_0x2b4de9,_0x3028b1){var _0x4214e1=_[_0x39dc('0x47')](_0x4c63c4['agents']);_0x2b4de9({'count':_0x4214e1[_0x39dc('0x18')],'rows':_0x4214e1});});},'ChatQueues':function(_0x155c47){return new Promise(function(_0x311a5e,_0x2d2558){var _0x142d34=[];for(var _0x10b908 in _0x4c63c4[_0x39dc('0x48')]){if(_0x4c63c4[_0x39dc('0x48')][_0x39dc('0x42')](_0x10b908)){var _0x48325a=_0x4c63c4[_0x39dc('0x48')][_0x10b908];var _0x51bf43={'id':_0x48325a['id'],'available':_0x48325a['available'],'loggedIn':_0x48325a[_0x39dc('0x49')],'name':_0x48325a['name'],'paused':_0x48325a[_0x39dc('0x4a')],'waiting':_0x48325a[_0x39dc('0x4b')]};_0x142d34['push'](_0x51bf43);}}_0x311a5e({'count':_0x142d34[_0x39dc('0x18')],'rows':_0x142d34});});},'MailQueues':function(_0x5957aa){return new Promise(function(_0x467892,_0x29c418){var _0x1e1dc2=[];for(var _0x3e9c89 in _0x4c63c4['mailQueues']){if(_0x4c63c4['mailQueues'][_0x39dc('0x42')](_0x3e9c89)){var _0x5a9c67=_0x4c63c4[_0x39dc('0x4c')][_0x3e9c89];var _0x58ebf9={'id':_0x5a9c67['id'],'available':_0x5a9c67['available'],'loggedIn':_0x5a9c67[_0x39dc('0x49')],'name':_0x5a9c67[_0x39dc('0x4d')],'paused':_0x5a9c67[_0x39dc('0x4a')],'waiting':_0x5a9c67[_0x39dc('0x4b')]};_0x1e1dc2[_0x39dc('0x21')](_0x58ebf9);}}_0x467892({'count':_0x1e1dc2['length'],'rows':_0x1e1dc2});});},'OpenchannelQueues':function(_0x303a2f){return new Promise(function(_0x338401,_0x469734){var _0x39dabe=[];for(var _0x57cb19 in _0x4c63c4[_0x39dc('0x4e')]){if(_0x4c63c4['openchannelQueues']['hasOwnProperty'](_0x57cb19)){var _0x19cfd6=_0x4c63c4[_0x39dc('0x4e')][_0x57cb19];var _0x1301c7={'id':_0x19cfd6['id'],'available':_0x19cfd6[_0x39dc('0x4f')],'loggedIn':_0x19cfd6[_0x39dc('0x49')],'name':_0x19cfd6['name'],'paused':_0x19cfd6['paused'],'waiting':_0x19cfd6['waiting']};_0x39dabe[_0x39dc('0x21')](_0x1301c7);}}_0x338401({'count':_0x39dabe[_0x39dc('0x18')],'rows':_0x39dabe});});},'SmsQueues':function(_0x459492){return new Promise(function(_0x32e8d3,_0xefab10){var _0x18bc45=[];for(var _0x40a113 in _0x4c63c4[_0x39dc('0x50')]){if(_0x4c63c4[_0x39dc('0x50')][_0x39dc('0x42')](_0x40a113)){var _0x25b589=_0x4c63c4[_0x39dc('0x50')][_0x40a113];var _0x38a61e={'id':_0x25b589['id'],'available':_0x25b589['available'],'loggedIn':_0x25b589['loggedIn'],'name':_0x25b589[_0x39dc('0x4d')],'paused':_0x25b589[_0x39dc('0x4a')],'waiting':_0x25b589[_0x39dc('0x4b')]};_0x18bc45[_0x39dc('0x21')](_0x38a61e);}}_0x32e8d3({'count':_0x18bc45[_0x39dc('0x18')],'rows':_0x18bc45});});},'FaxQueues':function(_0x3a99ac){return new Promise(function(_0x5e7f4f,_0x4a8e03){var _0x50e2e0=[];for(var _0x2a53f9 in _0x4c63c4[_0x39dc('0x51')]){if(_0x4c63c4[_0x39dc('0x51')][_0x39dc('0x42')](_0x2a53f9)){var _0x11faf8=_0x4c63c4['faxQueues'][_0x2a53f9];var _0x464c0b={'id':_0x11faf8['id'],'available':_0x11faf8[_0x39dc('0x4f')],'loggedIn':_0x11faf8['loggedIn'],'name':_0x11faf8[_0x39dc('0x4d')],'paused':_0x11faf8['paused'],'waiting':_0x11faf8[_0x39dc('0x4b')]};_0x50e2e0[_0x39dc('0x21')](_0x464c0b);}}_0x5e7f4f({'count':_0x50e2e0[_0x39dc('0x18')],'rows':_0x50e2e0});});},'WhatsappQueues':function(_0x1c20f4){return new Promise(function(_0x2db3fe,_0x591b42){var _0x2f5beb=[];for(var _0x577578 in _0x4c63c4[_0x39dc('0x52')]){if(_0x4c63c4[_0x39dc('0x52')][_0x39dc('0x42')](_0x577578)){var _0xbe0015=_0x4c63c4['whatsappQueues'][_0x577578];var _0x2fc90c={'id':_0xbe0015['id'],'available':_0xbe0015[_0x39dc('0x4f')],'loggedIn':_0xbe0015[_0x39dc('0x49')],'name':_0xbe0015['name'],'paused':_0xbe0015[_0x39dc('0x4a')],'waiting':_0xbe0015[_0x39dc('0x4b')]};_0x2f5beb['push'](_0x2fc90c);}}_0x2db3fe({'count':_0x2f5beb[_0x39dc('0x18')],'rows':_0x2f5beb});});},'ChatQueuesWaitingInteractions':function(_0x1a7778){return new Promise(function(_0x59cdb7,_0x131642){var _0x50caf7=_[_0x39dc('0x47')](_0x4c63c4[_0x39dc('0x53')]);_0x59cdb7({'count':_0x50caf7[_0x39dc('0x18')],'rows':_0x50caf7});});},'MailQueuesWaitingInteractions':function(_0x1031be){return new Promise(function(_0x2be783,_0x15ba8d){var _0x2f9c7a=_[_0x39dc('0x47')](_0x4c63c4[_0x39dc('0x54')]);_0x2be783({'count':_0x2f9c7a[_0x39dc('0x18')],'rows':_0x2f9c7a});});},'OpenchannelQueuesWaitingInteractions':function(_0x5c71cc){return new Promise(function(_0xb28149,_0x5be1d5){var _0x4313ba=_[_0x39dc('0x47')](_0x4c63c4['openchannelQueuesWaitingInteractions']);_0xb28149({'count':_0x4313ba[_0x39dc('0x18')],'rows':_0x4313ba});});},'SmsQueuesWaitingInteractions':function(_0x4ed9ab){return new Promise(function(_0x2227c9,_0x3e1a93){var _0x1e27ba=_['values'](_0x4c63c4[_0x39dc('0x55')]);_0x2227c9({'count':_0x1e27ba[_0x39dc('0x18')],'rows':_0x1e27ba});});},'FaxQueuesWaitingInteractions':function(_0x59743b){return new Promise(function(_0x3047e0,_0x141458){var _0x379505=_['values'](_0x4c63c4[_0x39dc('0x56')]);_0x3047e0({'count':_0x379505['length'],'rows':_0x379505});});},'WhatsappQueuesWaitingInteractions':function(_0x5a8c43){return new Promise(function(_0x36a066,_0x1a7c8a){var _0x27d570=_['values'](_0x4c63c4[_0x39dc('0x57')]);_0x36a066({'count':_0x27d570[_0x39dc('0x18')],'rows':_0x27d570});});}};var _0x13e422=jayson[_0x39dc('0x58')](_0x240f4e)[_0x39dc('0x59')]();_0x13e422['on'](_0x39dc('0x2e'),function(_0x3bb2a6){logger[_0x39dc('0x2e')](JSON['stringify'](_0x3bb2a6));return _0x51cb2a(_0x3bb2a6);});_0x13e422[_0x39dc('0x13')](0x232c,'127.0.0.1',function(){console[_0x39dc('0x5a')](_0x39dc('0x5b'),0x232c);return _0x476e24(_0x39dc('0x5c')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 87895ba..d3e5038 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 _0xa3aa=['stack','util','lodash','../../../config/logger','routing','client','http','request','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','then','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log'];(function(_0x8a19ac,_0x5b1872){var _0x2cef9a=function(_0x107415){while(--_0x107415){_0x8a19ac['push'](_0x8a19ac['shift']());}};_0x2cef9a(++_0x5b1872);}(_0xa3aa,0x1c1));var _0xaa3a=function(_0x2f59fe,_0x538ea7){_0x2f59fe=_0x2f59fe-0x0;var _0x574db1=_0xa3aa[_0x2f59fe];return _0x574db1;};'use strict';var util=require(_0xaa3a('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xaa3a('0x1'));var logger=require(_0xaa3a('0x2'))(_0xaa3a('0x3'));var client=jayson[_0xaa3a('0x4')][_0xaa3a('0x5')]({'port':0x232a});function request(_0x8f34ba,_0x576a3c){return new BPromise(function(_0x47270d,_0x18c0cd){return client[_0xaa3a('0x6')](_0x8f34ba,_0x576a3c)['then'](function(_0x4e11a8){if(_0x4e11a8[_0xaa3a('0x7')]){return _0x18c0cd(_0x4e11a8[_0xaa3a('0x7')][_0xaa3a('0x8')]);}else{return _0x47270d(_0x4e11a8['result']);}})[_0xaa3a('0x9')](function(_0x189a55){return _0x18c0cd(_0x189a55);});});}exports[_0xaa3a('0xa')]=function(_0x10d004,_0xc6340,_0x410c16){return function(_0x2436cb){if(_0x410c16[_0xaa3a('0xb')]&&!_0x410c16[_0xaa3a('0xb')][_0x10d004]){logger[_0xaa3a('0xc')](_0xaa3a('0xd'),_0x10d004);return _0x2436cb[_0xaa3a('0xe')]();}var _0x5931ce=[];for(var _0x1a479d=0x0;_0x1a479d<_0xc6340[_0xaa3a('0xf')];_0x1a479d+=0x1){_0x5931ce['push'](request(_0xaa3a('0x10'),{'command':util[_0xaa3a('0x11')](_0xaa3a('0x12'),_0xc6340[_0x1a479d])})[_0xaa3a('0x13')](function(_0x37eae7){return _0x37eae7&&_0x37eae7[_0xaa3a('0x8')]&&_0x37eae7[_0xaa3a('0x8')][_0xaa3a('0x14')]('true')>=0x0?!![]:![];})[_0xaa3a('0x9')](function(_0xd33221){logger[_0xaa3a('0x7')](_0xaa3a('0x15'),_0x10d004,_0xc6340[_0x1a479d]);}));}BPromise[_0xaa3a('0x16')](_0x5931ce)['then'](function(_0x14a31b){var _0x44413f=_['some'](_0x14a31b);logger['info'](_0xaa3a('0x17'),_0x10d004,_0xc6340[_0xaa3a('0x18')](_0xaa3a('0x19')),_0x44413f);_0x2436cb['when'](_0x44413f);})[_0xaa3a('0x9')](function(_0x99f1fc){console[_0xaa3a('0x1a')](_0x99f1fc);logger[_0xaa3a('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x10d004,_0xc6340['join']('\x20|\x20'),_0x99f1fc[_0xaa3a('0x1b')]);_0x2436cb['stop']();});};}; \ No newline at end of file +var _0x411c=['lodash','../../../config/logger','routing','client','http','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','then','true','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stop','bluebird'];(function(_0x574f4f,_0x492596){var _0x6f4071=function(_0x8b477b){while(--_0x8b477b){_0x574f4f['push'](_0x574f4f['shift']());}};_0x6f4071(++_0x492596);}(_0x411c,0x11d));var _0xc411=function(_0x54776a,_0x3cebd1){_0x54776a=_0x54776a-0x0;var _0x50aa84=_0x411c[_0x54776a];return _0x50aa84;};'use strict';var util=require('util');var BPromise=require(_0xc411('0x0'));var jayson=require('jayson/promise');var _=require(_0xc411('0x1'));var logger=require(_0xc411('0x2'))(_0xc411('0x3'));var client=jayson[_0xc411('0x4')][_0xc411('0x5')]({'port':0x232a});function request(_0x43f04f,_0x4a9252){return new BPromise(function(_0xc3f400,_0x275835){return client['request'](_0x43f04f,_0x4a9252)['then'](function(_0x36c636){if(_0x36c636[_0xc411('0x6')]){return _0x275835(_0x36c636['error'][_0xc411('0x7')]);}else{return _0xc3f400(_0x36c636['result']);}})[_0xc411('0x8')](function(_0x33dbbc){return _0x275835(_0x33dbbc);});});}exports[_0xc411('0x9')]=function(_0x4a1b2,_0x4f0ce1,_0x21d92e){return function(_0xdcf59b){if(_0x21d92e[_0xc411('0xa')]&&!_0x21d92e[_0xc411('0xa')][_0x4a1b2]){logger['info'](_0xc411('0xb'),_0x4a1b2);return _0xdcf59b['stop']();}var _0x42f9e0=[];for(var _0x17376=0x0;_0x17376<_0x4f0ce1[_0xc411('0xc')];_0x17376+=0x1){_0x42f9e0['push'](request(_0xc411('0xd'),{'command':util[_0xc411('0xe')]('iftime\x20%s',_0x4f0ce1[_0x17376])})[_0xc411('0xf')](function(_0x44666a){return _0x44666a&&_0x44666a[_0xc411('0x7')]&&_0x44666a[_0xc411('0x7')]['indexOf'](_0xc411('0x10'))>=0x0?!![]:![];})[_0xc411('0x8')](function(_0x349ece){logger['error']('[%s][INTERVAL]\x20%s',_0x4a1b2,_0x4f0ce1[_0x17376]);}));}BPromise[_0xc411('0x11')](_0x42f9e0)[_0xc411('0xf')](function(_0x1948ee){var _0x351453=_[_0xc411('0x12')](_0x1948ee);logger[_0xc411('0x13')](_0xc411('0x14'),_0x4a1b2,_0x4f0ce1[_0xc411('0x15')](_0xc411('0x16')),_0x351453);_0xdcf59b[_0xc411('0x17')](_0x351453);})['catch'](function(_0x2f830d){console[_0xc411('0x18')](_0x2f830d);logger['error'](_0xc411('0x14'),_0x4a1b2,_0x4f0ce1[_0xc411('0x15')](_0xc411('0x16')),_0x2f830d['stack']);_0xdcf59b[_0xc411('0x19')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 9697ce4..aff5049 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 _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','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','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x3c77b7,_0x33d55d){var _0x594577=function(_0x37c52b){while(--_0x37c52b){_0x3c77b7['push'](_0x3c77b7['shift']());}};_0x594577(++_0x33d55d);}(_0xd3d1,0x172));var _0x1d3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3d1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}}; \ No newline at end of file +var _0xd8b0=['indexOf','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','talktime','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','reason','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','diffTime','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','transferexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s'];(function(_0xc4471b,_0x5ee219){var _0x293923=function(_0x57d5e0){while(--_0x57d5e0){_0xc4471b['push'](_0xc4471b['shift']());}};_0x293923(++_0x5ee219);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x585166,_0x4b72b0){utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x4'),_0x585166[_0x0d8b('0x5')],_0x585166[_0x0d8b('0x6')],_0x585166['queue'],_0x585166['membername'],_0x585166[_0x0d8b('0x7')],_0x585166[_0x0d8b('0x8')],_0x585166[_0x0d8b('0x9')],_0x585166['lastevent']));if(_0x585166[_0x0d8b('0xa')]){utils[_0x0d8b('0xb')](_0x585166['queue'])[_0x0d8b('0xc')](function(_0x348e65){if(_0x348e65){_0x585166[_0x0d8b('0xd')]=_0x348e65[_0x0d8b('0xd')];_0x585166[_0x0d8b('0xe')]=_0x585166[_0x0d8b('0xf')]?_0x348e65[_0x0d8b('0x10')]:![];_0x585166[_0x0d8b('0x11')]=_0x585166['agentacw']?_0x348e65[_0x0d8b('0x12')]:0x0;}utils['request'](_0x0d8b('0x13'),_0x585166);});}else{utils[_0x0d8b('0x14')](_0x0d8b('0x13'),_0x585166);}if(_0x4b72b0){delete transfers[_0x585166[_0x0d8b('0x5')]];}else{delete agents[_0x585166[_0x0d8b('0x15')]];}}exports[_0x0d8b('0x16')]=function(_0x15dd0f){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')](_0x0d8b('0x18'),_0x15dd0f[_0x0d8b('0x5')]),_0x15dd0f);agents[_0x15dd0f[_0x0d8b('0x15')]]=_0x15dd0f;agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x19')]=utils['now']();agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x1b');agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x9')]=null;agents[_0x15dd0f['destuniqueid']][_0x0d8b('0x1c')]=null;utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x1d'),_0x15dd0f[_0x0d8b('0x5')],agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x1e')],_0x15dd0f[_0x0d8b('0x15')]));}catch(_0x4a15bf){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x18'),_0x15dd0f[_0x0d8b('0x5')]),_0x4a15bf);}};exports[_0x0d8b('0x20')]=function(_0x5b709c){try{if(!_[_0x0d8b('0x21')](agents[_0x5b709c[_0x0d8b('0x15')]])){utils['debug'](util['format'](_0x0d8b('0x22'),_0x5b709c['uniqueid']),_0x5b709c);utils['info'](util['format'](_0x0d8b('0x23'),_0x5b709c[_0x0d8b('0x5')],agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x1e')],_0x5b709c[_0x0d8b('0x15')]));agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x20')]=!![];agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x24')]=utils['now']();agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x1a')]='timeout';agents[_0x5b709c[_0x0d8b('0x15')]]['reason']=_0x0d8b('0x25');agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x26')]=_0x5b709c['ringtime']?parseInt(_0x5b709c['ringtime'])/0x3e8:0x0;agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x27')]=0x0;unanswered['push'](_0x5b709c[_0x0d8b('0x15')]);}}catch(_0x59aa83){utils[_0x0d8b('0x1f')](util['format'](_0x0d8b('0x22'),_0x5b709c['uniqueid']),_0x59aa83);}};exports[_0x0d8b('0x28')]=function(_0x546bf6){try{_[_0x0d8b('0x29')](agents,function(_0x544735,_0x3c8887){if(_0x544735[_0x0d8b('0x5')]==_0x546bf6[_0x0d8b('0x5')]&&!_['includes'](unanswered,_0x544735['destuniqueid'])){utils['debug'](util[_0x0d8b('0x3')]('[%s][agents][queuecallerabandon]',_0x546bf6[_0x0d8b('0x5')]),_0x546bf6);utils['info'](util['format'](_0x0d8b('0x2a'),_0x546bf6[_0x0d8b('0x5')],_0x544735[_0x0d8b('0x1e')],_0x544735[_0x0d8b('0x15')]));_0x544735[_0x0d8b('0x20')]=!![];_0x544735[_0x0d8b('0x24')]=utils[_0x0d8b('0x2b')]();_0x544735[_0x0d8b('0x1a')]='abandoned';_0x544735[_0x0d8b('0x2c')]=_0x0d8b('0x2d');_0x544735['holdtime']=_0x546bf6[_0x0d8b('0x26')];_0x544735[_0x0d8b('0x27')]=0x0;writeDB(_0x544735);}});}catch(_0x18a905){utils['error'](util[_0x0d8b('0x3')](_0x0d8b('0x2e'),_0x546bf6[_0x0d8b('0x5')]),_0x18a905);}};exports[_0x0d8b('0x2f')]=function(_0x933e01){try{if(agents[_0x933e01['destuniqueid']]){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][agentconnect]',_0x933e01[_0x0d8b('0x5')]),_0x933e01);utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x30'),_0x933e01[_0x0d8b('0x5')],agents[_0x933e01['destuniqueid']]['membername'],_0x933e01[_0x0d8b('0x15')]));agents[_0x933e01['destuniqueid']]['agentconnectAt']=utils[_0x0d8b('0x2b')]();agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x9')]=_0x933e01[_0x0d8b('0x9')];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x1c')]=_0x933e01['connectedlinename'];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x26')]=_0x933e01[_0x0d8b('0x31')];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x32');_[_0x0d8b('0x29')](agents,function(_0x5c980b,_0x1d06b6){if(_0x5c980b[_0x0d8b('0x15')]!=_0x933e01[_0x0d8b('0x15')]&&_0x5c980b[_0x0d8b('0x5')]==_0x933e01['uniqueid']){_0x5c980b[_0x0d8b('0x27')]=0x0;_0x5c980b['holdtime']=_0x933e01[_0x0d8b('0x31')];_0x5c980b[_0x0d8b('0x20')]=!![];_0x5c980b[_0x0d8b('0x24')]=utils[_0x0d8b('0x2b')]();_0x5c980b[_0x0d8b('0x1a')]=_0x0d8b('0x33');_0x5c980b[_0x0d8b('0x2c')]=_0x0d8b('0x33');_0x5c980b[_0x0d8b('0x34')]=_0x933e01[_0x0d8b('0x15')];_0x5c980b['answeredelsewheremembername']=_0x933e01['membername'];writeDB(_0x5c980b);}});}}catch(_0x576050){utils['error'](util['format'](_0x0d8b('0x35'),_0x933e01[_0x0d8b('0x5')]),_0x576050);}};exports[_0x0d8b('0xf')]=function(_0x5100cf){try{if(!_['isNil'](agents[_0x5100cf[_0x0d8b('0x15')]])){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][agentcomplete]',_0x5100cf[_0x0d8b('0x5')]),_0x5100cf);utils[_0x0d8b('0x2')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5100cf[_0x0d8b('0x5')],agents[_0x5100cf['destuniqueid']][_0x0d8b('0x1e')],_0x5100cf['destuniqueid']));agents[_0x5100cf['destuniqueid']][_0x0d8b('0xf')]=!![];agents[_0x5100cf[_0x0d8b('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x5100cf['destuniqueid']]['talktime']=utils[_0x0d8b('0x36')](agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x37')],agents[_0x5100cf['destuniqueid']][_0x0d8b('0x38')]);agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x2c')]=_0x5100cf[_0x0d8b('0x2c')];agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x39');writeDB(agents[_0x5100cf[_0x0d8b('0x15')]]);}}catch(_0x384a5e){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x3a'),_0x5100cf[_0x0d8b('0x5')]),_0x384a5e);}};exports[_0x0d8b('0x3b')]=function(_0x570af8){try{if(!_[_0x0d8b('0x21')](agents[_0x570af8[_0x0d8b('0x3c')]])){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][blindtransfer]',_0x570af8[_0x0d8b('0x5')]),_0x570af8);utils['info'](util['format'](_0x0d8b('0x3d'),_0x570af8[_0x0d8b('0x5')],agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x1e')],agents[_0x570af8['transfereruniqueid']][_0x0d8b('0x5')]));agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x3e')]=!![];agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x3f')]='blind';agents[_0x570af8['transfereruniqueid']]['transferexten']=_0x570af8['extension'];agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x40')]=agents[_0x570af8['transfereruniqueid']]['uniqueid'];}}catch(_0x44c5c1){utils[_0x0d8b('0x1f')](util['format']('[%s][agents][blindtransfer]',_0x570af8[_0x0d8b('0x5')]),_0x44c5c1);}};exports[_0x0d8b('0x41')]=function(_0x3cd00a){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][attendedtransfer]',_0x3cd00a[_0x0d8b('0x42')]),_0x3cd00a);if(_0x3cd00a[_0x0d8b('0x42')]==_0x3cd00a['origtransfererlinkedid']){if(!_['isNil'](agents[_0x3cd00a[_0x0d8b('0x43')]])){utils[_0x0d8b('0x2')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x3cd00a[_0x0d8b('0x42')],agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x1e')]));agents[_0x3cd00a[_0x0d8b('0x43')]]['transfer']=!![];agents[_0x3cd00a[_0x0d8b('0x43')]]['transfertype']='ATTENDED';agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x44')]=_0x3cd00a['origtransfererexten'];agents[_0x3cd00a['secondtransfereruniqueid']][_0x0d8b('0x40')]=_0x3cd00a[_0x0d8b('0x42')];}if(_0x3cd00a[_0x0d8b('0x45')]&&agents[_0x3cd00a[_0x0d8b('0x45')]]){agents[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x46')]=0x1;transfers[_0x3cd00a[_0x0d8b('0x45')]]=_[_0x0d8b('0x47')](agents[_0x3cd00a['transfereeuniqueid']]);transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x8')]=agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x8')];transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x48')]=agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x48')];transfers[_0x3cd00a[_0x0d8b('0x45')]]['agentcalledAt']=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x38')]=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x45')]]['holdtime']=0x0;transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x46')]=0x2;}}else if(_0x3cd00a[_0x0d8b('0x43')]==_0x3cd00a[_0x0d8b('0x49')]){if(!_[_0x0d8b('0x21')](agents[_0x3cd00a['origtransfereruniqueid']])){utils['info'](util[_0x0d8b('0x3')](_0x0d8b('0x4a'),_0x3cd00a[_0x0d8b('0x42')],agents[_0x3cd00a[_0x0d8b('0x42')]]['membername']));agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x3e')]=!![];agents[_0x3cd00a[_0x0d8b('0x42')]]['transfertype']=_0x0d8b('0x4b');agents[_0x3cd00a['origtransfereruniqueid']][_0x0d8b('0x44')]=_0x3cd00a[_0x0d8b('0x4c')];agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x40')]=_0x3cd00a[_0x0d8b('0x43')];}if(_0x3cd00a[_0x0d8b('0x4d')]&&agents[_0x3cd00a['transfertargetuniqueid']]){agents[_0x3cd00a[_0x0d8b('0x4d')]]['agententerreason']=0x1;transfers[_0x3cd00a[_0x0d8b('0x4d')]]=_[_0x0d8b('0x47')](agents[_0x3cd00a[_0x0d8b('0x4d')]]);transfers[_0x3cd00a[_0x0d8b('0x4d')]]['calleridnum']=agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x8')];transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x48')]=agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x48')];transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x19')]=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x4d')]]['agentconnectAt']=utils['now']();transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x26')]=0x0;transfers[_0x3cd00a['transfertargetuniqueid']][_0x0d8b('0x46')]=0x2;}}}catch(_0x5ab1f7){utils['error'](util[_0x0d8b('0x3')](_0x0d8b('0x4e'),_0x3cd00a['origtransfereruniqueid']),_0x5ab1f7);}};exports['hangup']=function(_0x1900e3){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')](_0x0d8b('0x4f'),_0x1900e3[_0x0d8b('0x5')]),_0x1900e3);if(agents[_0x1900e3[_0x0d8b('0x5')]]&&agents[_0x1900e3[_0x0d8b('0x5')]]['reason']===_0x0d8b('0x25')){if(_0x1900e3['cause']==='21'){agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]=_0x0d8b('0x50');agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']=_0x0d8b('0x50');}utils['info'](util[_0x0d8b('0x3')](_0x0d8b('0x51'),_0x1900e3[_0x0d8b('0x5')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1a')]));writeDB(agents[_0x1900e3[_0x0d8b('0x5')]]);var _0x4eb07e=unanswered[_0x0d8b('0x52')](_0x1900e3['uniqueid']);if(_0x4eb07e>-0x1){unanswered[_0x0d8b('0x53')](_0x4eb07e,0x1);}}if(transfers[_0x1900e3[_0x0d8b('0x5')]]){transfers[_0x1900e3['uniqueid']][_0x0d8b('0xf')]=!![];transfers[_0x1900e3['uniqueid']][_0x0d8b('0x37')]=utils[_0x0d8b('0x2b')]();transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x27')]=utils[_0x0d8b('0x36')](transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')],transfers[_0x1900e3[_0x0d8b('0x5')]]['agentconnectAt']);transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]='agent';transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1a')]=_0x0d8b('0x39');utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x51'),_0x1900e3[_0x0d8b('0x5')],transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],transfers[_0x1900e3[_0x0d8b('0x5')]]['lastevent']));writeDB(transfers[_0x1900e3[_0x0d8b('0x5')]],!![]);}if(agents[_0x1900e3[_0x0d8b('0x5')]]&&agents[_0x1900e3[_0x0d8b('0x5')]]['agentconnectAt']){agents[_0x1900e3['uniqueid']][_0x0d8b('0xf')]=!![];agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')]=utils['now']();agents[_0x1900e3['uniqueid']][_0x0d8b('0x27')]=utils[_0x0d8b('0x36')](agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x38')]);agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]=agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x3e')]?_0x0d8b('0x3e'):_0x0d8b('0x54');agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']=_0x0d8b('0x39');utils[_0x0d8b('0x2')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1900e3[_0x0d8b('0x5')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']));writeDB(agents[_0x1900e3['uniqueid']]);}}catch(_0x581d8e){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x4f'),_0x1900e3[_0x0d8b('0x5')]),_0x581d8e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 34b4f35..a700eb5 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 _0xa085=['[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid'];(function(_0x37e799,_0x32625f){var _0x436718=function(_0x3e28a9){while(--_0x3e28a9){_0x37e799['push'](_0x37e799['shift']());}};_0x436718(++_0x32625f);}(_0xa085,0x79));var _0x5a08=function(_0x24e09a,_0x2b7371){_0x24e09a=_0x24e09a-0x0;var _0x42ea15=_0xa085[_0x24e09a];return _0x42ea15;};'use strict';var _=require(_0x5a08('0x0'));var util=require(_0x5a08('0x1'));var utils=require(_0x5a08('0x2'));var transfers=require(_0x5a08('0x3'));var dispositions=[_0x5a08('0x4'),_0x5a08('0x5'),'FAILED',_0x5a08('0x4'),_0x5a08('0x4'),'NO\x20ANSWER',_0x5a08('0x6'),_0x5a08('0x7'),_0x5a08('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0x37ebe8){var _0x5dfb40;if(transfers[_0x5a08('0x8')][_0x37ebe8[_0x5a08('0x9')]]){_0x5dfb40=_0x37ebe8[_0x5a08('0x9')];_0x37ebe8[_0x5a08('0x9')]=transfers[_0x5a08('0x8')][_0x37ebe8['uniqueid']][_0x5a08('0xa')];}utils['info'](util[_0x5a08('0xb')](_0x5a08('0xc'),_0x37ebe8[_0x5a08('0x9')],_0x37ebe8[_0x5a08('0xd')],_0x37ebe8[_0x5a08('0xe')],_0x37ebe8['membername'],_0x37ebe8[_0x5a08('0xf')],_0x37ebe8['calleridnum'],_0x37ebe8[_0x5a08('0x10')],_0x37ebe8[_0x5a08('0x11')]));if(_0x37ebe8[_0x5a08('0x12')]){utils[_0x5a08('0x13')](_0x37ebe8[_0x5a08('0x12')])[_0x5a08('0x14')](function(_0x215d18){if(_0x215d18){_0x37ebe8[_0x5a08('0x15')]=_0x215d18['id'];}utils[_0x5a08('0x16')](_0x5a08('0x17'),_0x37ebe8);});}else{utils[_0x5a08('0x16')](_0x5a08('0x17'),_0x37ebe8);}if(channels[_0x37ebe8[_0x5a08('0x9')]]){delete channels[_0x37ebe8[_0x5a08('0x9')]];}else if(_0x5dfb40&&channels[_0x5dfb40]){delete transfers['blinds'][_0x5dfb40];delete channels[_0x5dfb40];}}exports['newchannel']=function(_0x3fd2fc){try{utils[_0x5a08('0x18')](util['format']('[%s][calls][newchannel]',_0x3fd2fc[_0x5a08('0x9')]),_0x3fd2fc);if(_0x3fd2fc[_0x5a08('0x9')]==_0x3fd2fc[_0x5a08('0x19')]&&_0x3fd2fc['channel']!='OutgoingSpoolFailed'){utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x1b'),_0x3fd2fc['uniqueid'],_0x3fd2fc['context'],_0x3fd2fc[_0x5a08('0x1c')]));channels[_0x3fd2fc['uniqueid']]={'uniqueid':_0x3fd2fc[_0x5a08('0x9')],'accountcode':_0x3fd2fc[_0x5a08('0x12')],'source':_0x3fd2fc['calleridnum'],'destination':_0x3fd2fc[_0x5a08('0x1c')],'destinationcontext':_0x3fd2fc[_0x5a08('0x1d')],'channel':_0x3fd2fc[_0x5a08('0xd')],'starttime':utils[_0x5a08('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5a08('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x56d8ee){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x20'),_0x3fd2fc[_0x5a08('0x9')]),_0x56d8ee);}};exports[_0x5a08('0x21')]=function(_0x1e087c){try{utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x22'),_0x1e087c[_0x5a08('0x9')]),_0x1e087c);if(!_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x9')]])&&_0x1e087c[_0x5a08('0x24')]==0x6){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1e087c[_0x5a08('0x9')],_0x1e087c['context'],_0x1e087c[_0x5a08('0xd')]));if(_['isNil'](channels[_0x1e087c['uniqueid']][_0x5a08('0x25')])){channels[_0x1e087c[_0x5a08('0x9')]]['systemanswertime']=utils[_0x5a08('0x1e')]();}}else if(!_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x19')]])&&_0x1e087c[_0x5a08('0x24')]==0x6&&_0x1e087c[_0x5a08('0x1d')]!=_0x5a08('0x26')){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1e087c[_0x5a08('0x9')],_0x1e087c['linkedid'],_0x1e087c['context'],_0x1e087c[_0x5a08('0xd')]));channels[_0x1e087c[_0x5a08('0x19')]]['accountcode']=_0x1e087c[_0x5a08('0x12')];channels[_0x1e087c['linkedid']][_0x5a08('0x27')]=_0x1e087c[_0x5a08('0xd')];if(_[_0x5a08('0x23')](channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x28')])){channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x28')]=utils[_0x5a08('0x1e')]();}channels[_0x1e087c[_0x5a08('0x19')]][_0x5a08('0x29')]=dispositions[_[_0x5a08('0x2a')](_0x1e087c['channelstate'])]||_0x5a08('0x6');}}catch(_0x47a807){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x22'),_0x1e087c[_0x5a08('0x9')]),_0x47a807);}};exports[_0x5a08('0x2b')]=function(_0x30ab71){try{if(!_['isNil'](channels[_0x30ab71[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x2c'),_0x30ab71[_0x5a08('0x9')]),_0x30ab71);if(_['isNil'](channels[_0x30ab71[_0x5a08('0x9')]]['callerid'])){channels[_0x30ab71[_0x5a08('0x9')]]['callerid']=_0x30ab71['calleridname']+'\x20<'+_0x30ab71[_0x5a08('0x2d')]+'>';}utils['info'](util[_0x5a08('0xb')](_0x5a08('0x2e'),_0x30ab71[_0x5a08('0x9')],channels[_0x30ab71['uniqueid']][_0x5a08('0x2f')],_0x30ab71[_0x5a08('0x30')]));channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x31')]=utils[_0x5a08('0x1e')]();channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x32')]=utils[_0x5a08('0x33')](channels[_0x30ab71['uniqueid']][_0x5a08('0x31')],channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x34')]);channels[_0x30ab71['uniqueid']][_0x5a08('0x35')]=channels[_0x30ab71[_0x5a08('0x9')]]['answertime']?utils['diffTime'](channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x31')],channels[_0x30ab71[_0x5a08('0x9')]][_0x5a08('0x28')]):0x0;writeDB(channels[_0x30ab71[_0x5a08('0x9')]]);}}catch(_0xf7c928){utils[_0x5a08('0x1f')](util['format'](_0x5a08('0x2c'),_0x30ab71[_0x5a08('0x9')]),_0xf7c928);}};exports[_0x5a08('0x36')]=function(_0x2e4c1d){try{if(!_[_0x5a08('0x23')](channels[_0x2e4c1d['localtwolinkedid']])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x37'),_0x2e4c1d['origtransfereruniqueid']),_0x2e4c1d);if(channels[_0x2e4c1d[_0x5a08('0x38')]]['channel']==_0x2e4c1d['transfereechannel']){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x39'),_0x2e4c1d[_0x5a08('0x3a')],_0x2e4c1d[_0x5a08('0x38')],_0x2e4c1d['secondtransfererchannel']));channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x27')]=_0x2e4c1d[_0x5a08('0x3b')];channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x3c')]=_0x5a08('0x3d');}else if(channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0xd')]=_0x2e4c1d['transfertargetchannel']){utils['info'](util[_0x5a08('0xb')](_0x5a08('0x39'),_0x2e4c1d[_0x5a08('0x3a')],_0x2e4c1d[_0x5a08('0x38')],_0x2e4c1d['origtransfererchannel']));channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x27')]=_0x2e4c1d[_0x5a08('0x3e')];channels[_0x2e4c1d[_0x5a08('0x38')]][_0x5a08('0x3c')]='_attended';}}}catch(_0x5e49a2){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x37'),_0x2e4c1d[_0x5a08('0x3a')]),_0x5e49a2);}};exports['musiconholdstart']=function(_0x5936de){try{if(!_[_0x5a08('0x23')](channels[_0x5936de['uniqueid']])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x3f'),_0x5936de[_0x5a08('0x9')]),_0x5936de);channels[_0x5936de['uniqueid']]['musiconholdstartAt']=utils[_0x5a08('0x1e')]();utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x40'),_0x5936de['uniqueid'],channels[_0x5936de[_0x5a08('0x9')]]['musiconholdstartAt']));}}catch(_0x196b33){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')](_0x5a08('0x3f'),_0x5936de[_0x5a08('0x9')]),_0x196b33);}};exports[_0x5a08('0x41')]=function(_0x435855){try{if(!_['isNil'](channels[_0x435855[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util['format'](_0x5a08('0x42'),_0x435855[_0x5a08('0x9')]),_0x435855);if(!_['isNil'](channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')])){channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x44')]+=utils[_0x5a08('0x33')](utils['now'](),channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')]);utils[_0x5a08('0x1a')](util[_0x5a08('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x435855[_0x5a08('0x9')],channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x44')]));delete channels[_0x435855[_0x5a08('0x9')]][_0x5a08('0x43')];}}}catch(_0x331e70){utils['error'](util[_0x5a08('0xb')]('[%s][calls][musiconholdstop]',_0x435855[_0x5a08('0x9')]),_0x331e70);}};exports[_0x5a08('0x45')]=function(_0x2a9eea){try{if(!_['isNil'](channels[_0x2a9eea[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x46'),_0x2a9eea[_0x5a08('0x9')]),_0x2a9eea);if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x48')])){utils[_0x5a08('0x1a')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x4a')]=_0x2a9eea[_0x5a08('0x49')];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')]['xmd-phone'])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x4b'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]]['destination']=_0x2a9eea[_0x5a08('0x49')];channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x2f')]='\x22'+_0x2a9eea['value']+_0x5a08('0x4c')+_0x2a9eea['value']+'>';}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4d')])||!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4e')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x4f'),_0x2a9eea[_0x5a08('0x9')],!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x4d')])?_0x5a08('0x4d'):'xmd-callerid',_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea['uniqueid']][_0x5a08('0x2f')]=_0x2a9eea['value'];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x50')])||!_['isNil'](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x51')])){utils[_0x5a08('0x1a')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2a9eea[_0x5a08('0x9')],!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x50')])?_0x5a08('0x50'):'xmcs-queue',_0x2a9eea['value']));channels[_0x2a9eea[_0x5a08('0x9')]]['lastapplication']=_0x5a08('0x52');channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x53')]=_0x2a9eea[_0x5a08('0x49')];channels[_0x2a9eea['uniqueid']][_0x5a08('0xe')]=!![];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x54')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x55'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea['uniqueid']][_0x5a08('0x56')]=_0x2a9eea[_0x5a08('0x49')];}if(!_[_0x5a08('0x23')](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x57')])){utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x58'),_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x59')]=_0x2a9eea[_0x5a08('0x49')];}if(!_['isNil'](_0x2a9eea[_0x5a08('0x47')]['outboundrouteid'])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x5a'),_0x2a9eea[_0x5a08('0x9')],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x5b')]=_0x2a9eea['value'];}if(!_['isNil'](_0x2a9eea[_0x5a08('0x47')][_0x5a08('0x5c')])){utils[_0x5a08('0x1a')](util[_0x5a08('0xb')](_0x5a08('0x5d'),_0x2a9eea['uniqueid'],_0x2a9eea[_0x5a08('0x49')]));channels[_0x2a9eea[_0x5a08('0x9')]][_0x5a08('0x5c')]=_0x2a9eea[_0x5a08('0x49')];}}}catch(_0xa0dc8c){utils['error'](util['format'](_0x5a08('0x46'),_0x2a9eea[_0x5a08('0x9')]),_0xa0dc8c);}};exports[_0x5a08('0x5e')]=function(_0x101296){try{if(!_['isNil'](channels[_0x101296[_0x5a08('0x9')]])){utils[_0x5a08('0x18')](util[_0x5a08('0xb')](_0x5a08('0x5f'),_0x101296[_0x5a08('0x9')]),_0x101296);utils[_0x5a08('0x1a')](util['format'](_0x5a08('0x60'),_0x101296[_0x5a08('0x9')],_0x101296[_0x5a08('0x61')],_0x101296[_0x5a08('0x62')]));if(_0x101296[_0x5a08('0x61')][_0x5a08('0x63')]()==_0x5a08('0x64')&&_['startsWith'](_0x101296[_0x5a08('0x62')][_0x5a08('0x63')](),'cdr')){var _0x5584d3=_0x101296[_0x5a08('0x62')]['split']('=');var _0x228b91=_0x5584d3[0x0][_0x5a08('0x65')](_0x5584d3[0x0][_0x5a08('0x66')]('(')+0x1,_0x5584d3[0x0][_0x5a08('0x66')](')'));var _0x4735b9=_0x5584d3[0x1];channels[_0x101296[_0x5a08('0x9')]][_0x228b91]=_0x4735b9;}if(!_[_0x5a08('0x67')]([_0x5a08('0x2b'),_0x5a08('0x68'),_0x5a08('0x69'),_0x5a08('0x64'),_0x5a08('0x6a')],_0x101296[_0x5a08('0x61')][_0x5a08('0x63')]())){channels[_0x101296[_0x5a08('0x9')]]['lastapplication']=_0x101296[_0x5a08('0x61')];channels[_0x101296[_0x5a08('0x9')]][_0x5a08('0x53')]=_0x101296[_0x5a08('0x62')];}}}catch(_0x6949db){utils[_0x5a08('0x1f')](util[_0x5a08('0xb')]('[%s][calls][newexten]',_0x101296['uniqueid']),_0x6949db);}}; \ No newline at end of file +var _0x7fd6=['callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','secondtransfererchannel','userfield','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','origtransfereruniqueid','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7fd6,0x18c));var _0x67fd=function(_0x46fd30,_0x3afc57){_0x46fd30=_0x46fd30-0x0;var _0x9aab5f=_0x7fd6[_0x46fd30];return _0x9aab5f;};'use strict';var _=require(_0x67fd('0x0'));var util=require(_0x67fd('0x1'));var utils=require('./utils');var transfers=require(_0x67fd('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x67fd('0x3'),'NO\x20ANSWER',_0x67fd('0x4'),_0x67fd('0x4'),_0x67fd('0x5'),_0x67fd('0x6'),_0x67fd('0x3'),_0x67fd('0x3'),_0x67fd('0x3')];var channels={};function writeDB(_0x379dad){var _0x42ce16;if(transfers[_0x67fd('0x7')][_0x379dad[_0x67fd('0x8')]]){_0x42ce16=_0x379dad['uniqueid'];_0x379dad['uniqueid']=transfers['blinds'][_0x379dad[_0x67fd('0x8')]][_0x67fd('0x9')];}utils['info'](util[_0x67fd('0xa')](_0x67fd('0xb'),_0x379dad[_0x67fd('0x8')],_0x379dad[_0x67fd('0xc')],_0x379dad[_0x67fd('0xd')],_0x379dad[_0x67fd('0xe')],_0x379dad[_0x67fd('0xf')],_0x379dad[_0x67fd('0x10')],_0x379dad[_0x67fd('0x11')],_0x379dad[_0x67fd('0x12')]));if(_0x379dad[_0x67fd('0x13')]){utils[_0x67fd('0x14')](_0x379dad[_0x67fd('0x13')])[_0x67fd('0x15')](function(_0x465e1a){if(_0x465e1a){_0x379dad[_0x67fd('0x16')]=_0x465e1a['id'];}utils[_0x67fd('0x17')](_0x67fd('0x18'),_0x379dad);});}else{utils[_0x67fd('0x17')]('CreateVoiceCallReport',_0x379dad);}if(channels[_0x379dad[_0x67fd('0x8')]]){delete channels[_0x379dad[_0x67fd('0x8')]];}else if(_0x42ce16&&channels[_0x42ce16]){delete transfers[_0x67fd('0x7')][_0x42ce16];delete channels[_0x42ce16];}}exports[_0x67fd('0x19')]=function(_0xfe0fdd){try{utils[_0x67fd('0x1a')](util[_0x67fd('0xa')](_0x67fd('0x1b'),_0xfe0fdd[_0x67fd('0x8')]),_0xfe0fdd);if(_0xfe0fdd[_0x67fd('0x8')]==_0xfe0fdd[_0x67fd('0x1c')]&&_0xfe0fdd[_0x67fd('0xc')]!='OutgoingSpoolFailed'){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x1e'),_0xfe0fdd[_0x67fd('0x8')],_0xfe0fdd[_0x67fd('0x1f')],_0xfe0fdd[_0x67fd('0x20')]));channels[_0xfe0fdd[_0x67fd('0x8')]]={'uniqueid':_0xfe0fdd[_0x67fd('0x8')],'accountcode':_0xfe0fdd[_0x67fd('0x13')],'source':_0xfe0fdd[_0x67fd('0x10')],'destination':_0xfe0fdd['exten'],'destinationcontext':_0xfe0fdd[_0x67fd('0x1f')],'channel':_0xfe0fdd[_0x67fd('0xc')],'starttime':utils[_0x67fd('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x67fd('0x4'),'amaflags':_0x67fd('0x22')};}}catch(_0x29fa74){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x1b'),_0xfe0fdd[_0x67fd('0x8')]),_0x29fa74);}};exports[_0x67fd('0x24')]=function(_0x14a7a3){try{utils[_0x67fd('0x1a')](util[_0x67fd('0xa')](_0x67fd('0x25'),_0x14a7a3['uniqueid']),_0x14a7a3);if(!_['isNil'](channels[_0x14a7a3[_0x67fd('0x8')]])&&_0x14a7a3['channelstate']==0x6){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x26'),_0x14a7a3[_0x67fd('0x8')],_0x14a7a3[_0x67fd('0x1f')],_0x14a7a3[_0x67fd('0xc')]));if(_['isNil'](channels[_0x14a7a3['uniqueid']][_0x67fd('0x27')])){channels[_0x14a7a3[_0x67fd('0x8')]][_0x67fd('0x27')]=utils[_0x67fd('0x21')]();}}else if(!_[_0x67fd('0x28')](channels[_0x14a7a3[_0x67fd('0x1c')]])&&_0x14a7a3[_0x67fd('0x29')]==0x6&&_0x14a7a3[_0x67fd('0x1f')]!='transfer'){utils[_0x67fd('0x1d')](util['format'](_0x67fd('0x2a'),_0x14a7a3['uniqueid'],_0x14a7a3[_0x67fd('0x1c')],_0x14a7a3['context'],_0x14a7a3['channel']));channels[_0x14a7a3[_0x67fd('0x1c')]][_0x67fd('0x13')]=_0x14a7a3[_0x67fd('0x13')];channels[_0x14a7a3[_0x67fd('0x1c')]]['destinationchannel']=_0x14a7a3[_0x67fd('0xc')];if(_[_0x67fd('0x28')](channels[_0x14a7a3[_0x67fd('0x1c')]][_0x67fd('0x2b')])){channels[_0x14a7a3['linkedid']][_0x67fd('0x2b')]=utils[_0x67fd('0x21')]();}channels[_0x14a7a3[_0x67fd('0x1c')]][_0x67fd('0x2c')]=dispositions[_[_0x67fd('0x2d')](_0x14a7a3[_0x67fd('0x29')])]||_0x67fd('0x5');}}catch(_0x5f3cc9){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x25'),_0x14a7a3[_0x67fd('0x8')]),_0x5f3cc9);}};exports[_0x67fd('0x2e')]=function(_0x356acf){try{if(!_[_0x67fd('0x28')](channels[_0x356acf[_0x67fd('0x8')]])){utils['debug'](util[_0x67fd('0xa')](_0x67fd('0x2f'),_0x356acf[_0x67fd('0x8')]),_0x356acf);if(_[_0x67fd('0x28')](channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x30')])){channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x30')]=_0x356acf[_0x67fd('0x31')]+'\x20<'+_0x356acf['calleridnum']+'>';}utils['info'](util[_0x67fd('0xa')](_0x67fd('0x32'),_0x356acf[_0x67fd('0x8')],channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x30')],_0x356acf['cause-txt']));channels[_0x356acf['uniqueid']][_0x67fd('0x33')]=utils[_0x67fd('0x21')]();channels[_0x356acf['uniqueid']][_0x67fd('0x34')]=utils['diffTime'](channels[_0x356acf['uniqueid']][_0x67fd('0x33')],channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x35')]);channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x36')]=channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x2b')]?utils[_0x67fd('0x37')](channels[_0x356acf['uniqueid']][_0x67fd('0x33')],channels[_0x356acf[_0x67fd('0x8')]][_0x67fd('0x2b')]):0x0;writeDB(channels[_0x356acf['uniqueid']]);}}catch(_0x45981a){utils[_0x67fd('0x23')](util['format'](_0x67fd('0x2f'),_0x356acf[_0x67fd('0x8')]),_0x45981a);}};exports[_0x67fd('0x38')]=function(_0x9c26c1){try{if(!_['isNil'](channels[_0x9c26c1[_0x67fd('0x39')]])){utils[_0x67fd('0x1a')](util[_0x67fd('0xa')](_0x67fd('0x3a'),_0x9c26c1['origtransfereruniqueid']),_0x9c26c1);if(channels[_0x9c26c1[_0x67fd('0x39')]][_0x67fd('0xc')]==_0x9c26c1['transfereechannel']){utils[_0x67fd('0x1d')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x9c26c1['origtransfereruniqueid'],_0x9c26c1['localtwolinkedid'],_0x9c26c1[_0x67fd('0x3b')]));channels[_0x9c26c1[_0x67fd('0x39')]]['destinationchannel']=_0x9c26c1[_0x67fd('0x3b')];channels[_0x9c26c1[_0x67fd('0x39')]][_0x67fd('0x3c')]=_0x67fd('0x3d');}else if(channels[_0x9c26c1[_0x67fd('0x39')]][_0x67fd('0xc')]=_0x9c26c1['transfertargetchannel']){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x3e'),_0x9c26c1['origtransfereruniqueid'],_0x9c26c1[_0x67fd('0x39')],_0x9c26c1['origtransfererchannel']));channels[_0x9c26c1[_0x67fd('0x39')]][_0x67fd('0x3f')]=_0x9c26c1['origtransfererchannel'];channels[_0x9c26c1[_0x67fd('0x39')]][_0x67fd('0x3c')]='_attended';}}}catch(_0x443fa1){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x3a'),_0x9c26c1[_0x67fd('0x40')]),_0x443fa1);}};exports['musiconholdstart']=function(_0x2f4098){try{if(!_[_0x67fd('0x28')](channels[_0x2f4098[_0x67fd('0x8')]])){utils['debug'](util[_0x67fd('0xa')](_0x67fd('0x41'),_0x2f4098[_0x67fd('0x8')]),_0x2f4098);channels[_0x2f4098[_0x67fd('0x8')]][_0x67fd('0x42')]=utils[_0x67fd('0x21')]();utils['info'](util[_0x67fd('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x2f4098['uniqueid'],channels[_0x2f4098[_0x67fd('0x8')]][_0x67fd('0x42')]));}}catch(_0x310cb6){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x41'),_0x2f4098[_0x67fd('0x8')]),_0x310cb6);}};exports[_0x67fd('0x43')]=function(_0x54eed5){try{if(!_[_0x67fd('0x28')](channels[_0x54eed5['uniqueid']])){utils[_0x67fd('0x1a')](util['format'](_0x67fd('0x44'),_0x54eed5[_0x67fd('0x8')]),_0x54eed5);if(!_[_0x67fd('0x28')](channels[_0x54eed5['uniqueid']][_0x67fd('0x42')])){channels[_0x54eed5[_0x67fd('0x8')]][_0x67fd('0x45')]+=utils[_0x67fd('0x37')](utils['now'](),channels[_0x54eed5[_0x67fd('0x8')]][_0x67fd('0x42')]);utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x46'),_0x54eed5['uniqueid'],channels[_0x54eed5[_0x67fd('0x8')]][_0x67fd('0x45')]));delete channels[_0x54eed5[_0x67fd('0x8')]][_0x67fd('0x42')];}}}catch(_0x13093d){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x44'),_0x54eed5['uniqueid']),_0x13093d);}};exports[_0x67fd('0x47')]=function(_0x42758d){try{if(!_[_0x67fd('0x28')](channels[_0x42758d['uniqueid']])){utils[_0x67fd('0x1a')](util['format'](_0x67fd('0x48'),_0x42758d[_0x67fd('0x8')]),_0x42758d);if(!_['isNil'](_0x42758d['variable'][_0x67fd('0x49')])){utils[_0x67fd('0x1d')](util['format'](_0x67fd('0x4a'),_0x42758d['uniqueid'],_0x42758d['value']));channels[_0x42758d[_0x67fd('0x8')]]['source']=_0x42758d[_0x67fd('0x4b')];}if(!_[_0x67fd('0x28')](_0x42758d['variable']['xmd-phone'])){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x4c'),_0x42758d[_0x67fd('0x8')],_0x42758d[_0x67fd('0x4b')]));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x4d')]=_0x42758d[_0x67fd('0x4b')];channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x30')]='\x22'+_0x42758d[_0x67fd('0x4b')]+_0x67fd('0x4e')+_0x42758d['value']+'>';}if(!_[_0x67fd('0x28')](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x50')])||!_[_0x67fd('0x28')](_0x42758d[_0x67fd('0x4f')]['xmd-callerid'])){utils['info'](util[_0x67fd('0xa')](_0x67fd('0x51'),_0x42758d[_0x67fd('0x8')],!_[_0x67fd('0x28')](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x50')])?_0x67fd('0x50'):_0x67fd('0x52'),_0x42758d[_0x67fd('0x4b')]));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x30')]=_0x42758d[_0x67fd('0x4b')];}if(!_[_0x67fd('0x28')](_0x42758d['variable'][_0x67fd('0x53')])||!_['isNil'](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x54')])){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x42758d['uniqueid'],!_['isNil'](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x53')])?_0x67fd('0x53'):_0x67fd('0x54'),_0x42758d[_0x67fd('0x4b')]));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x55')]=_0x67fd('0x56');channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x57')]=_0x42758d[_0x67fd('0x4b')];channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0xd')]=!![];}if(!_['isNil'](_0x42758d['variable']['xmd-contactid'])){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x42758d[_0x67fd('0x8')],_0x42758d[_0x67fd('0x4b')]));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x58')]=_0x42758d['value'];}if(!_[_0x67fd('0x28')](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x59')])){utils[_0x67fd('0x1d')](util[_0x67fd('0xa')](_0x67fd('0x5a'),_0x42758d[_0x67fd('0x8')],_0x42758d['value']));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x5b')]=_0x42758d['value'];}if(!_['isNil'](_0x42758d[_0x67fd('0x4f')][_0x67fd('0x5c')])){utils['info'](util[_0x67fd('0xa')](_0x67fd('0x5d'),_0x42758d[_0x67fd('0x8')],_0x42758d[_0x67fd('0x4b')]));channels[_0x42758d[_0x67fd('0x8')]]['routeid']=_0x42758d[_0x67fd('0x4b')];}if(!_[_0x67fd('0x28')](_0x42758d[_0x67fd('0x4f')]['sipcallid'])){utils[_0x67fd('0x1d')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x42758d[_0x67fd('0x8')],_0x42758d['value']));channels[_0x42758d[_0x67fd('0x8')]][_0x67fd('0x5e')]=_0x42758d[_0x67fd('0x4b')];}}}catch(_0x20075c){utils[_0x67fd('0x23')](util[_0x67fd('0xa')]('[%s][calls][varset]',_0x42758d['uniqueid']),_0x20075c);}};exports[_0x67fd('0x5f')]=function(_0x290b74){try{if(!_[_0x67fd('0x28')](channels[_0x290b74[_0x67fd('0x8')]])){utils[_0x67fd('0x1a')](util[_0x67fd('0xa')](_0x67fd('0x60'),_0x290b74['uniqueid']),_0x290b74);utils['info'](util[_0x67fd('0xa')](_0x67fd('0x61'),_0x290b74[_0x67fd('0x8')],_0x290b74[_0x67fd('0x62')],_0x290b74[_0x67fd('0x63')]));if(_0x290b74['application'][_0x67fd('0x64')]()==_0x67fd('0x65')&&_[_0x67fd('0x66')](_0x290b74[_0x67fd('0x63')][_0x67fd('0x64')](),_0x67fd('0x67'))){var _0x28b745=_0x290b74[_0x67fd('0x63')][_0x67fd('0x68')]('=');var _0x56ad03=_0x28b745[0x0][_0x67fd('0x69')](_0x28b745[0x0][_0x67fd('0x6a')]('(')+0x1,_0x28b745[0x0][_0x67fd('0x6a')](')'));var _0xccc11b=_0x28b745[0x1];channels[_0x290b74['uniqueid']][_0x56ad03]=_0xccc11b;}if(!_[_0x67fd('0x6b')]([_0x67fd('0x2e'),_0x67fd('0x6c'),_0x67fd('0x6d'),_0x67fd('0x65'),_0x67fd('0x6e')],_0x290b74['application'][_0x67fd('0x64')]())){channels[_0x290b74[_0x67fd('0x8')]][_0x67fd('0x55')]=_0x290b74[_0x67fd('0x62')];channels[_0x290b74[_0x67fd('0x8')]]['lastdata']=_0x290b74[_0x67fd('0x63')];}}}catch(_0x378392){utils[_0x67fd('0x23')](util[_0x67fd('0xa')](_0x67fd('0x60'),_0x290b74[_0x67fd('0x8')]),_0x378392);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 44bca57..2b7de2d 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 _0xd93a=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','managerevent','info'];(function(_0x26edad,_0x77f137){var _0x45f29b=function(_0x5cf770){while(--_0x5cf770){_0x26edad['push'](_0x26edad['shift']());}};_0x45f29b(++_0x77f137);}(_0xd93a,0x1b7));var _0xad93=function(_0x24d43a,_0x160902){_0x24d43a=_0x24d43a-0x0;var _0x1e7919=_0xd93a[_0x24d43a];return _0x1e7919;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0xad93('0x0')]('[core]\x20connected');};exports[_0xad93('0x1')]=function(){utils[_0xad93('0x0')](_0xad93('0x2'));};exports[_0xad93('0x3')]=function(){utils[_0xad93('0x0')](_0xad93('0x4'));};exports['error']=function(_0x52745b){utils[_0xad93('0x5')](_0xad93('0x6'),_0x52745b);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0xad93('0x7')]=function(_0x1b5a88){}; \ No newline at end of file +var _0xc40b=['close','./utils','info','fullybooted','error','[core]\x20error'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0xc40b,0x79));var _0xbc40=function(_0x2e759c,_0x53617e){_0x2e759c=_0x2e759c-0x0;var _0x7d6016=_0xc40b[_0x2e759c];return _0x7d6016;};'use strict';var utils=require(_0xbc40('0x0'));exports['connect']=function(){utils[_0xbc40('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0xbc40('0x1')]('[core]\x20shutdown');};exports[_0xbc40('0x2')]=function(){utils[_0xbc40('0x1')]('[core]\x20fullybooted');};exports[_0xbc40('0x3')]=function(_0x3c20a8){utils[_0xbc40('0x3')](_0xbc40('0x4'),_0x3c20a8);};exports[_0xbc40('0x5')]=function(){utils[_0xbc40('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x394436){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f2b8f85..5d219c4 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 _0x2af3=['CreateVoiceDialReport','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','connect','answertime','[%s][dials][hangup]','calleridname','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request'];(function(_0x2836d3,_0xbd12c3){var _0x543043=function(_0x50ed3f){while(--_0x50ed3f){_0x2836d3['push'](_0x2836d3['shift']());}};_0x543043(++_0xbd12c3);}(_0x2af3,0x19d));var _0x32af=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0x2af3[_0xc4966b];return _0x1802bb;};'use strict';var _=require(_0x32af('0x0'));var util=require(_0x32af('0x1'));var utils=require(_0x32af('0x2'));var dials={};function writeDB(_0x25671f){utils[_0x32af('0x3')](util['format'](_0x32af('0x4'),_0x25671f[_0x32af('0x5')],_0x25671f['channel'],_0x25671f['dialstring'],_0x25671f[_0x32af('0x6')],_0x25671f[_0x32af('0x7')],_0x25671f[_0x32af('0x8')]));utils[_0x32af('0x9')](_0x32af('0xa'),_0x25671f);delete dials[_0x25671f[_0x32af('0x5')]];}exports['newexten']=function(_0x29cbc5){try{utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0xd'),_0x29cbc5['uniqueid']),_0x29cbc5);utils['info'](util[_0x32af('0xc')](_0x32af('0xe'),_0x29cbc5[_0x32af('0x5')],_0x29cbc5[_0x32af('0xf')],_0x29cbc5[_0x32af('0x10')]));if(_0x29cbc5['application'][_0x32af('0x11')]()==_0x32af('0x12')&&_[_0x32af('0x13')](_0x29cbc5[_0x32af('0x10')][_0x32af('0x11')](),_0x32af('0x14'))){var _0x58aec9=_0x29cbc5[_0x32af('0x10')][_0x32af('0x15')]('=');dials[_0x29cbc5[_0x32af('0x5')]]={'routeId':_0x58aec9[0x1]};}}catch(_0x7275ae){utils[_0x32af('0x16')](util[_0x32af('0xc')](_0x32af('0xd'),_0x29cbc5[_0x32af('0x5')]),_0x7275ae);}};exports[_0x32af('0x17')]=function(_0x414c2b){try{utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x18'),_0x414c2b['uniqueid']),_0x414c2b);if(!_[_0x32af('0x19')](_0x414c2b[_0x32af('0x1a')][_0x32af('0x1b')])){utils['info'](util['format'](_0x32af('0x1c'),_0x414c2b[_0x32af('0x5')],_0x414c2b[_0x32af('0x1d')]));dials[_0x414c2b[_0x32af('0x5')]]={'routeId':_0x414c2b[_0x32af('0x1d')]};}}catch(_0x4818c8){utils[_0x32af('0x16')](util[_0x32af('0xc')]('[%s][dials][varset]',_0x414c2b[_0x32af('0x5')]),_0x4818c8);}};exports['dialbegin']=function(_0x130807){try{if(!_[_0x32af('0x19')](dials[_0x130807[_0x32af('0x5')]])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x1e'),_0x130807[_0x32af('0x5')]),_0x130807);dials[_0x130807[_0x32af('0x5')]]=_[_0x32af('0x1f')](dials[_0x130807[_0x32af('0x5')]],_0x130807);dials[_0x130807[_0x32af('0x5')]][_0x32af('0x20')]=utils[_0x32af('0x21')]();dials[_0x130807[_0x32af('0x5')]][_0x32af('0x22')]=_0x32af('0x23');utils['info'](util[_0x32af('0xc')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x130807[_0x32af('0x5')],dials[_0x130807[_0x32af('0x5')]]['starttime']));}}catch(_0x4fdc8e){utils['error'](util[_0x32af('0xc')](_0x32af('0x1e'),_0x130807['uniqueid']),_0x4fdc8e);}};exports[_0x32af('0x24')]=function(_0x58f066){try{if(!_[_0x32af('0x19')](dials[_0x58f066['uniqueid']])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x25'),_0x58f066[_0x32af('0x5')]),_0x58f066);dials[_0x58f066['uniqueid']][_0x32af('0x8')]=_0x58f066[_0x32af('0x8')];if(_0x58f066[_0x32af('0x8')]=='ANSWER'){dials[_0x58f066['uniqueid']]=_[_0x32af('0x1f')](dials[_0x58f066[_0x32af('0x5')]],_0x58f066);dials[_0x58f066[_0x32af('0x5')]]['answertime']=utils[_0x32af('0x21')]();dials[_0x58f066[_0x32af('0x5')]][_0x32af('0x22')]=_0x32af('0x26');utils[_0x32af('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x58f066[_0x32af('0x5')],_0x58f066['dialstatus'],dials[_0x58f066[_0x32af('0x5')]][_0x32af('0x27')]));}else{utils[_0x32af('0x3')](util[_0x32af('0xc')]('[%s][dials][dialend]\x20dialstatus:%s',_0x58f066[_0x32af('0x5')],_0x58f066['dialstatus']));}}}catch(_0x3bfd1e){utils[_0x32af('0x16')](util[_0x32af('0xc')]('[%s][dials][dialend]',_0x58f066[_0x32af('0x5')]),_0x3bfd1e);}};exports['hangup']=function(_0x4d1b11){try{if(!_[_0x32af('0x19')](dials[_0x4d1b11['uniqueid']])){utils[_0x32af('0xb')](util[_0x32af('0xc')](_0x32af('0x28'),_0x4d1b11[_0x32af('0x5')]),_0x4d1b11);utils['info'](util[_0x32af('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4d1b11['uniqueid'],_0x4d1b11[_0x32af('0x6')],_0x4d1b11[_0x32af('0x29')],_0x4d1b11['cause-txt']));dials[_0x4d1b11[_0x32af('0x5')]]=_['assign'](dials[_0x4d1b11[_0x32af('0x5')]],{'endtime':utils[_0x32af('0x21')](),'lastevent':_0x32af('0x2a')});dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2b')]=utils[_0x32af('0x2c')](dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2d')],dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x20')]);dials[_0x4d1b11[_0x32af('0x5')]]['holdtime']=utils[_0x32af('0x2c')](dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x27')]||dials[_0x4d1b11['uniqueid']][_0x32af('0x2d')],dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x20')]);dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x2e')]=dials[_0x4d1b11[_0x32af('0x5')]][_0x32af('0x27')]?utils[_0x32af('0x2c')](dials[_0x4d1b11['uniqueid']][_0x32af('0x2d')],dials[_0x4d1b11['uniqueid']][_0x32af('0x27')]):0x0;writeDB(dials[_0x4d1b11['uniqueid']]);}}catch(_0xeb3357){utils[_0x32af('0x16')](util[_0x32af('0xc')](_0x32af('0x28'),_0x4d1b11['uniqueid']),_0xeb3357);}}; \ No newline at end of file +var _0xdec6=['debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten'];(function(_0x306546,_0x5fe4ac){var _0x490e77=function(_0x3497a5){while(--_0x3497a5){_0x306546['push'](_0x306546['shift']());}};_0x490e77(++_0x5fe4ac);}(_0xdec6,0x142));var _0x6dec=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xdec6[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x6dec('0x0'));var util=require(_0x6dec('0x1'));var utils=require(_0x6dec('0x2'));var dials={};function writeDB(_0x464b97){utils[_0x6dec('0x3')](util[_0x6dec('0x4')](_0x6dec('0x5'),_0x464b97[_0x6dec('0x6')],_0x464b97[_0x6dec('0x7')],_0x464b97[_0x6dec('0x8')],_0x464b97[_0x6dec('0x9')],_0x464b97[_0x6dec('0xa')],_0x464b97[_0x6dec('0xb')]));utils['request'](_0x6dec('0xc'),_0x464b97);delete dials[_0x464b97[_0x6dec('0x6')]];}exports[_0x6dec('0xd')]=function(_0x493214){try{utils[_0x6dec('0xe')](util[_0x6dec('0x4')](_0x6dec('0xf'),_0x493214[_0x6dec('0x6')]),_0x493214);utils[_0x6dec('0x3')](util['format'](_0x6dec('0x10'),_0x493214[_0x6dec('0x6')],_0x493214[_0x6dec('0x11')],_0x493214[_0x6dec('0x12')]));if(_0x493214[_0x6dec('0x11')][_0x6dec('0x13')]()==_0x6dec('0x14')&&_['startsWith'](_0x493214[_0x6dec('0x12')][_0x6dec('0x13')](),_0x6dec('0x15'))){var _0x30181c=_0x493214['appdata'][_0x6dec('0x16')]('=');dials[_0x493214[_0x6dec('0x6')]]={'routeId':_0x30181c[0x1]};}}catch(_0x502358){utils[_0x6dec('0x17')](util['format'](_0x6dec('0xf'),_0x493214['uniqueid']),_0x502358);}};exports[_0x6dec('0x18')]=function(_0x166504){try{utils[_0x6dec('0xe')](util['format']('[%s][dials][varset]',_0x166504[_0x6dec('0x6')]),_0x166504);if(!_[_0x6dec('0x19')](_0x166504[_0x6dec('0x1a')][_0x6dec('0x1b')])){utils[_0x6dec('0x3')](util['format'](_0x6dec('0x1c'),_0x166504['uniqueid'],_0x166504[_0x6dec('0x1d')]));dials[_0x166504[_0x6dec('0x6')]]={'routeId':_0x166504[_0x6dec('0x1d')]};}}catch(_0x58abfc){utils['error'](util[_0x6dec('0x4')]('[%s][dials][varset]',_0x166504[_0x6dec('0x6')]),_0x58abfc);}};exports[_0x6dec('0x1e')]=function(_0x27738c){try{if(!_['isNil'](dials[_0x27738c[_0x6dec('0x6')]])){utils['debug'](util[_0x6dec('0x4')]('[%s][dials][dialbegin]',_0x27738c[_0x6dec('0x6')]),_0x27738c);dials[_0x27738c['uniqueid']]=_[_0x6dec('0x1f')](dials[_0x27738c['uniqueid']],_0x27738c);dials[_0x27738c[_0x6dec('0x6')]][_0x6dec('0x20')]=utils[_0x6dec('0x21')]();dials[_0x27738c['uniqueid']]['lastevent']=_0x6dec('0x22');utils[_0x6dec('0x3')](util[_0x6dec('0x4')](_0x6dec('0x23'),_0x27738c[_0x6dec('0x6')],dials[_0x27738c['uniqueid']][_0x6dec('0x20')]));}}catch(_0x355132){utils['error'](util[_0x6dec('0x4')](_0x6dec('0x24'),_0x27738c['uniqueid']),_0x355132);}};exports[_0x6dec('0x25')]=function(_0x4cb94e){try{if(!_[_0x6dec('0x19')](dials[_0x4cb94e[_0x6dec('0x6')]])){utils[_0x6dec('0xe')](util['format']('[%s][dials][dialend]',_0x4cb94e[_0x6dec('0x6')]),_0x4cb94e);dials[_0x4cb94e[_0x6dec('0x6')]][_0x6dec('0xb')]=_0x4cb94e['dialstatus'];if(_0x4cb94e[_0x6dec('0xb')]==_0x6dec('0x26')){dials[_0x4cb94e['uniqueid']]=_[_0x6dec('0x1f')](dials[_0x4cb94e['uniqueid']],_0x4cb94e);dials[_0x4cb94e[_0x6dec('0x6')]][_0x6dec('0x27')]=utils[_0x6dec('0x21')]();dials[_0x4cb94e[_0x6dec('0x6')]][_0x6dec('0x28')]=_0x6dec('0x29');utils[_0x6dec('0x3')](util[_0x6dec('0x4')](_0x6dec('0x2a'),_0x4cb94e[_0x6dec('0x6')],_0x4cb94e['dialstatus'],dials[_0x4cb94e[_0x6dec('0x6')]][_0x6dec('0x27')]));}else{utils[_0x6dec('0x3')](util['format'](_0x6dec('0x2b'),_0x4cb94e['uniqueid'],_0x4cb94e[_0x6dec('0xb')]));}}}catch(_0x259e90){utils[_0x6dec('0x17')](util[_0x6dec('0x4')](_0x6dec('0x2c'),_0x4cb94e[_0x6dec('0x6')]),_0x259e90);}};exports[_0x6dec('0x2d')]=function(_0x41b76d){try{if(!_['isNil'](dials[_0x41b76d[_0x6dec('0x6')]])){utils['debug'](util['format'](_0x6dec('0x2e'),_0x41b76d['uniqueid']),_0x41b76d);utils[_0x6dec('0x3')](util[_0x6dec('0x4')](_0x6dec('0x2f'),_0x41b76d[_0x6dec('0x6')],_0x41b76d['calleridnum'],_0x41b76d[_0x6dec('0x30')],_0x41b76d[_0x6dec('0x31')]));dials[_0x41b76d[_0x6dec('0x6')]]=_[_0x6dec('0x1f')](dials[_0x41b76d[_0x6dec('0x6')]],{'endtime':utils['now'](),'lastevent':_0x6dec('0x32')});dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x33')]=utils[_0x6dec('0x34')](dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x35')],dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x20')]);dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x36')]=utils[_0x6dec('0x34')](dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x27')]||dials[_0x41b76d['uniqueid']][_0x6dec('0x35')],dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x20')]);dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x37')]=dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x27')]?utils[_0x6dec('0x34')](dials[_0x41b76d['uniqueid']][_0x6dec('0x35')],dials[_0x41b76d[_0x6dec('0x6')]][_0x6dec('0x27')]):0x0;writeDB(dials[_0x41b76d['uniqueid']]);}}catch(_0x8f4271){utils[_0x6dec('0x17')](util[_0x6dec('0x4')](_0x6dec('0x2e'),_0x41b76d[_0x6dec('0x6')]),_0x8f4271);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9839ec4..0d31059 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 _0x9882=['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]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x140f23,_0xa0fccf){var _0x522939=function(_0x273437){while(--_0x273437){_0x140f23['push'](_0x140f23['shift']());}};_0x522939(++_0xa0fccf);}(_0x9882,0xa7));var _0x2988=function(_0x4e0bae,_0x4b9ebb){_0x4e0bae=_0x4e0bae-0x0;var _0x5b3f73=_0x9882[_0x4e0bae];return _0x5b3f73;};var AsteriskManager=require(_0x2988('0x0'));var config=require(_0x2988('0x1'));var utils=require(_0x2988('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x2988('0x3')][_0x2988('0x4')],config[_0x2988('0x3')]['ip'],config[_0x2988('0x3')][_0x2988('0x5')],config[_0x2988('0x3')][_0x2988('0x6')],!![]);ami[_0x2988('0x7')]();if(config['xdr']&&config['xdr'][_0x2988('0x8')]){utils[_0x2988('0x9')](_0x2988('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x2988('0xb'));var queues=require(_0x2988('0xc'));var recordings=require(_0x2988('0xd'));var members=require(_0x2988('0xe'));var dials=require('./dials.controller');var transfers=require(_0x2988('0xf'));var core=require(_0x2988('0x10'));ami['on'](_0x2988('0x11'),core[_0x2988('0x11')]);ami['on']('shutdown',core[_0x2988('0x12')]);ami['on'](_0x2988('0x13'),core[_0x2988('0x13')]);ami['on']('error',core[_0x2988('0x14')]);ami['on']('close',core[_0x2988('0x15')]);ami['on'](_0x2988('0x16'),core[_0x2988('0x16')]);ami['on']('devicestatechange',function(_0x3914aa){try{utils[_0x2988('0x17')](util[_0x2988('0x18')]('[%s][index][devicestatechange]',_0x3914aa[_0x2988('0x19')]),_0x3914aa);members['devicestatechange'](_0x3914aa);}catch(_0xdb25ba){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x1a'),_0x3914aa[_0x2988('0x19')]),_0xdb25ba);}});ami['on'](_0x2988('0x1b'),function(_0x189174){try{utils['debug'](util[_0x2988('0x18')]('[%s][index][agentcalled]',_0x189174['uniqueid']),_0x189174);agents['agentcalled'](_0x189174);}catch(_0x44f1b0){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x1c'),_0x189174[_0x2988('0x1d')]),_0x44f1b0);}});ami['on'](_0x2988('0x1e'),function(_0x2081e4){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x1f'),_0x2081e4[_0x2988('0x1d')]),_0x2081e4);agents[_0x2988('0x1e')](_0x2081e4);}catch(_0x5b2216){utils['error'](util[_0x2988('0x18')](_0x2988('0x1f'),_0x2081e4[_0x2988('0x1d')]),_0x5b2216);}});ami['on'](_0x2988('0x20'),function(_0x1cf198){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x21'),_0x1cf198[_0x2988('0x1d')]),_0x1cf198);agents[_0x2988('0x20')](_0x1cf198);queues[_0x2988('0x20')](_0x1cf198);}catch(_0x3c52cd){utils[_0x2988('0x14')](util['format'](_0x2988('0x21'),_0x1cf198[_0x2988('0x1d')]),_0x3c52cd);}});ami['on'](_0x2988('0x22'),function(_0x21faa7){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x23'),_0x21faa7[_0x2988('0x1d')]),_0x21faa7);agents['agentcomplete'](_0x21faa7);queues[_0x2988('0x22')](_0x21faa7);members['agentcomplete'](_0x21faa7);}catch(_0xeb1f7){utils['error'](util[_0x2988('0x18')](_0x2988('0x23'),_0x21faa7[_0x2988('0x1d')]),_0xeb1f7);}});ami['on'](_0x2988('0x24'),function(_0x55e6ec){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x25'),_0x55e6ec[_0x2988('0x1d')]),_0x55e6ec);agents['queuecallerabandon'](_0x55e6ec);queues[_0x2988('0x24')](_0x55e6ec);}catch(_0x42f405){utils[_0x2988('0x14')](util['format']('[%s][index][queuecallerabandon]',_0x55e6ec[_0x2988('0x1d')]),_0x42f405);}});ami['on'](_0x2988('0x26'),function(_0x17cc2d){try{utils[_0x2988('0x17')](util['format']('[%s][index][queuecallerjoin]',_0x17cc2d['uniqueid']),_0x17cc2d);queues['queuecallerjoin'](_0x17cc2d);recordings[_0x2988('0x26')](_0x17cc2d);}catch(_0x241c14){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x27'),_0x17cc2d[_0x2988('0x1d')]),_0x241c14);}});ami['on'](_0x2988('0x28'),function(_0xe3c713){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x29'),_0xe3c713[_0x2988('0x1d')]),_0xe3c713);queues[_0x2988('0x28')](_0xe3c713);}catch(_0x4690bf){utils['error'](util[_0x2988('0x18')](_0x2988('0x29'),_0xe3c713[_0x2988('0x1d')]),_0x4690bf);}});ami['on'](_0x2988('0x2a'),function(_0x53ec70){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x2b'),_0x53ec70['uniqueid']),_0x53ec70);queues[_0x2988('0x2a')](_0x53ec70);calls[_0x2988('0x2a')](_0x53ec70);}catch(_0x10525a){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][musiconholdstart]',_0x53ec70[_0x2988('0x1d')]),_0x10525a);}});ami['on'](_0x2988('0x2c'),function(_0x4f44b2){try{utils[_0x2988('0x17')](util['format']('[%s][index][musiconholdstop]',_0x4f44b2[_0x2988('0x1d')]),_0x4f44b2);queues[_0x2988('0x2c')](_0x4f44b2);calls['musiconholdstop'](_0x4f44b2);}catch(_0x11b9fd){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][musiconholdstop]',_0x4f44b2[_0x2988('0x1d')]),_0x11b9fd);}});ami['on'](_0x2988('0x2d'),function(_0x1a76c9){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x2e'),_0x1a76c9[_0x2988('0x1d')]),_0x1a76c9);calls['newstate'](_0x1a76c9);recordings[_0x2988('0x2d')](_0x1a76c9);}catch(_0xc4ee0c){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x2e'),_0x1a76c9[_0x2988('0x1d')]),_0xc4ee0c);}});ami['on'](_0x2988('0x2f'),function(_0x40586c){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x30'),_0x40586c['uniqueid']),_0x40586c);calls['hangup'](_0x40586c);recordings[_0x2988('0x2f')](_0x40586c);dials[_0x2988('0x2f')](_0x40586c);agents[_0x2988('0x2f')](_0x40586c);queues[_0x2988('0x2f')](_0x40586c);}catch(_0x1cf7e5){utils[_0x2988('0x14')](util['format'](_0x2988('0x30'),_0x40586c[_0x2988('0x1d')]),_0x1cf7e5);}});ami['on'](_0x2988('0x31'),function(_0x471e4e){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x32'),_0x471e4e[_0x2988('0x1d')]),_0x471e4e);members['cdr'](_0x471e4e);}catch(_0x86276c){utils['error'](util[_0x2988('0x18')](_0x2988('0x32'),_0x471e4e[_0x2988('0x1d')]),_0x86276c);}});ami['on'](_0x2988('0x33'),function(_0x31dc5b){try{utils['debug'](util[_0x2988('0x18')](_0x2988('0x34'),_0x31dc5b[_0x2988('0x1d')]),_0x31dc5b);queues[_0x2988('0x33')](_0x31dc5b);agents[_0x2988('0x33')](_0x31dc5b);transfers[_0x2988('0x33')](_0x31dc5b);}catch(_0x354725){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x34'),_0x31dc5b[_0x2988('0x1d')]),_0x354725);}});ami['on']('attendedtransfer',function(_0x24f489){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x35'),_0x24f489[_0x2988('0x36')]),_0x24f489);queues[_0x2988('0x37')](_0x24f489);transfers['attendedtransfer'](_0x24f489);agents[_0x2988('0x37')](_0x24f489);calls[_0x2988('0x37')](_0x24f489);}catch(_0x34647c){utils[_0x2988('0x14')](util[_0x2988('0x18')]('[%s][index][attendedtransfer]',_0x24f489[_0x2988('0x36')]),_0x34647c);}});ami['on'](_0x2988('0x38'),function(_0x25004c){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x39'),_0x25004c[_0x2988('0x1d')]),_0x25004c);queues[_0x2988('0x38')](_0x25004c);recordings[_0x2988('0x38')](_0x25004c);calls[_0x2988('0x38')](_0x25004c);dials[_0x2988('0x38')](_0x25004c);}catch(_0x4d3f3c){utils['error'](util[_0x2988('0x18')]('[%s][index][varset]',_0x25004c[_0x2988('0x1d')]),_0x4d3f3c);}});ami['on'](_0x2988('0x3a'),function(_0xbe176){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3b'),_0xbe176[_0x2988('0x1d')]),_0xbe176);calls[_0x2988('0x3a')](_0xbe176);recordings[_0x2988('0x3a')](_0xbe176);dials[_0x2988('0x3a')](_0xbe176);}catch(_0x251087){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x3b'),_0xbe176['uniqueid']),_0x251087);}});ami['on'](_0x2988('0x3c'),function(_0x5e15ee){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3d'),_0x5e15ee[_0x2988('0x1d')]),_0x5e15ee);calls[_0x2988('0x3c')](_0x5e15ee);recordings['newchannel'](_0x5e15ee);}catch(_0x5dcf2f){utils[_0x2988('0x14')](util['format'](_0x2988('0x3d'),_0x5e15ee[_0x2988('0x1d')]),_0x5dcf2f);}});ami['on'](_0x2988('0x3e'),function(_0x122aa1){try{utils[_0x2988('0x17')](util[_0x2988('0x18')](_0x2988('0x3f'),_0x122aa1['uniqueid']),_0x122aa1);dials[_0x2988('0x3e')](_0x122aa1);}catch(_0x28fb5b){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x40'),_0x122aa1['uniqueid']),_0x28fb5b);}});ami['on'](_0x2988('0x41'),function(_0x42f16f){try{utils[_0x2988('0x17')](util['format'](_0x2988('0x42'),_0x42f16f['uniqueid']),_0x42f16f);dials['dialend'](_0x42f16f);}catch(_0x2efba1){utils[_0x2988('0x14')](util[_0x2988('0x18')](_0x2988('0x42'),_0x42f16f[_0x2988('0x1d')]),_0x2efba1);}});} \ No newline at end of file +var _0x2073=['format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug'];(function(_0x2c39dc,_0x38fda8){var _0xff9108=function(_0xfa9160){while(--_0xfa9160){_0x2c39dc['push'](_0x2c39dc['shift']());}};_0xff9108(++_0x38fda8);}(_0x2073,0xfe));var _0x3207=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0x2073[_0x34750b];return _0x244258;};var AsteriskManager=require(_0x3207('0x0'));var config=require(_0x3207('0x1'));var utils=require('./utils');var util=require(_0x3207('0x2'));var ami=new AsteriskManager(config[_0x3207('0x3')][_0x3207('0x4')],config[_0x3207('0x3')]['ip'],config['asterisk'][_0x3207('0x5')],config[_0x3207('0x3')][_0x3207('0x6')],!![]);ami[_0x3207('0x7')]();if(config[_0x3207('0x8')]&&config[_0x3207('0x8')][_0x3207('0x9')]){utils[_0x3207('0xa')](_0x3207('0xb'));}else{var agents=require(_0x3207('0xc'));var calls=require(_0x3207('0xd'));var queues=require('./queues.controller');var recordings=require(_0x3207('0xe'));var members=require(_0x3207('0xf'));var dials=require('./dials.controller');var transfers=require(_0x3207('0x10'));var core=require(_0x3207('0x11'));ami['on'](_0x3207('0x12'),core[_0x3207('0x12')]);ami['on'](_0x3207('0x13'),core[_0x3207('0x13')]);ami['on'](_0x3207('0x14'),core[_0x3207('0x14')]);ami['on']('error',core[_0x3207('0x15')]);ami['on'](_0x3207('0x16'),core[_0x3207('0x16')]);ami['on']('managerevent',core[_0x3207('0x17')]);ami['on'](_0x3207('0x18'),function(_0x17c70a){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x1b'),_0x17c70a[_0x3207('0x1c')]),_0x17c70a);members[_0x3207('0x18')](_0x17c70a);}catch(_0x230cba){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x1b'),_0x17c70a[_0x3207('0x1c')]),_0x230cba);}});ami['on'](_0x3207('0x1d'),function(_0x23f648){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')]('[%s][index][agentcalled]',_0x23f648[_0x3207('0x1e')]),_0x23f648);agents['agentcalled'](_0x23f648);}catch(_0x2fdd38){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x1f'),_0x23f648['uniqueid']),_0x2fdd38);}});ami['on'](_0x3207('0x20'),function(_0x594092){try{utils['debug'](util[_0x3207('0x1a')](_0x3207('0x21'),_0x594092[_0x3207('0x1e')]),_0x594092);agents[_0x3207('0x20')](_0x594092);}catch(_0x369ef4){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x21'),_0x594092['uniqueid']),_0x369ef4);}});ami['on']('agentconnect',function(_0x277798){try{utils[_0x3207('0x19')](util['format'](_0x3207('0x22'),_0x277798[_0x3207('0x1e')]),_0x277798);agents['agentconnect'](_0x277798);queues[_0x3207('0x23')](_0x277798);}catch(_0x1365dd){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x22'),_0x277798['uniqueid']),_0x1365dd);}});ami['on']('agentcomplete',function(_0x38105b){try{utils['debug'](util[_0x3207('0x1a')]('[%s][index][agentcomplete]',_0x38105b['uniqueid']),_0x38105b);agents['agentcomplete'](_0x38105b);queues[_0x3207('0x24')](_0x38105b);members['agentcomplete'](_0x38105b);}catch(_0x25fe34){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x25'),_0x38105b[_0x3207('0x1e')]),_0x25fe34);}});ami['on'](_0x3207('0x26'),function(_0x246f67){try{utils['debug'](util[_0x3207('0x1a')](_0x3207('0x27'),_0x246f67[_0x3207('0x1e')]),_0x246f67);agents['queuecallerabandon'](_0x246f67);queues[_0x3207('0x26')](_0x246f67);}catch(_0x2db80e){utils['error'](util[_0x3207('0x1a')](_0x3207('0x27'),_0x246f67[_0x3207('0x1e')]),_0x2db80e);}});ami['on'](_0x3207('0x28'),function(_0x180b46){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x29'),_0x180b46[_0x3207('0x1e')]),_0x180b46);queues[_0x3207('0x28')](_0x180b46);recordings[_0x3207('0x28')](_0x180b46);}catch(_0x24b204){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x29'),_0x180b46[_0x3207('0x1e')]),_0x24b204);}});ami['on'](_0x3207('0x2a'),function(_0x31539a){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x2b'),_0x31539a[_0x3207('0x1e')]),_0x31539a);queues[_0x3207('0x2a')](_0x31539a);}catch(_0x4f9c4e){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x2b'),_0x31539a[_0x3207('0x1e')]),_0x4f9c4e);}});ami['on']('musiconholdstart',function(_0x2c1a7a){try{utils['debug'](util[_0x3207('0x1a')]('[%s][index][musiconholdstart]',_0x2c1a7a[_0x3207('0x1e')]),_0x2c1a7a);queues[_0x3207('0x2c')](_0x2c1a7a);calls['musiconholdstart'](_0x2c1a7a);}catch(_0x151987){utils[_0x3207('0x15')](util['format'](_0x3207('0x2d'),_0x2c1a7a[_0x3207('0x1e')]),_0x151987);}});ami['on'](_0x3207('0x2e'),function(_0x5f0bb7){try{utils[_0x3207('0x19')](util['format'](_0x3207('0x2f'),_0x5f0bb7[_0x3207('0x1e')]),_0x5f0bb7);queues['musiconholdstop'](_0x5f0bb7);calls[_0x3207('0x2e')](_0x5f0bb7);}catch(_0x4c6da7){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x2f'),_0x5f0bb7[_0x3207('0x1e')]),_0x4c6da7);}});ami['on'](_0x3207('0x30'),function(_0x2b5533){try{utils['debug'](util[_0x3207('0x1a')](_0x3207('0x31'),_0x2b5533[_0x3207('0x1e')]),_0x2b5533);calls[_0x3207('0x30')](_0x2b5533);recordings['newstate'](_0x2b5533);}catch(_0x3d20f9){utils[_0x3207('0x15')](util['format'](_0x3207('0x31'),_0x2b5533[_0x3207('0x1e')]),_0x3d20f9);}});ami['on'](_0x3207('0x32'),function(_0xc07dd6){try{utils['debug'](util[_0x3207('0x1a')]('[%s][index][hangup]',_0xc07dd6[_0x3207('0x1e')]),_0xc07dd6);calls[_0x3207('0x32')](_0xc07dd6);recordings[_0x3207('0x32')](_0xc07dd6);dials[_0x3207('0x32')](_0xc07dd6);agents[_0x3207('0x32')](_0xc07dd6);queues[_0x3207('0x32')](_0xc07dd6);}catch(_0xd13ea){utils[_0x3207('0x15')](util['format'](_0x3207('0x33'),_0xc07dd6['uniqueid']),_0xd13ea);}});ami['on']('cdr',function(_0x1a7cc0){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x34'),_0x1a7cc0[_0x3207('0x1e')]),_0x1a7cc0);members[_0x3207('0x35')](_0x1a7cc0);}catch(_0x4043e4){utils['error'](util['format'](_0x3207('0x34'),_0x1a7cc0['uniqueid']),_0x4043e4);}});ami['on'](_0x3207('0x36'),function(_0x5c6f71){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x37'),_0x5c6f71[_0x3207('0x1e')]),_0x5c6f71);queues[_0x3207('0x36')](_0x5c6f71);agents[_0x3207('0x36')](_0x5c6f71);transfers[_0x3207('0x36')](_0x5c6f71);}catch(_0x418280){utils[_0x3207('0x15')](util['format'](_0x3207('0x37'),_0x5c6f71[_0x3207('0x1e')]),_0x418280);}});ami['on'](_0x3207('0x38'),function(_0x4c4d5c){try{utils['debug'](util['format'](_0x3207('0x39'),_0x4c4d5c[_0x3207('0x3a')]),_0x4c4d5c);queues['attendedtransfer'](_0x4c4d5c);transfers[_0x3207('0x38')](_0x4c4d5c);agents[_0x3207('0x38')](_0x4c4d5c);calls[_0x3207('0x38')](_0x4c4d5c);}catch(_0x4825da){utils['error'](util['format'](_0x3207('0x39'),_0x4c4d5c['origtransfereruniqueid']),_0x4825da);}});ami['on'](_0x3207('0x3b'),function(_0x53f44d){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x3c'),_0x53f44d[_0x3207('0x1e')]),_0x53f44d);queues[_0x3207('0x3b')](_0x53f44d);recordings[_0x3207('0x3b')](_0x53f44d);calls[_0x3207('0x3b')](_0x53f44d);dials[_0x3207('0x3b')](_0x53f44d);}catch(_0x37d501){utils[_0x3207('0x15')](util['format'](_0x3207('0x3c'),_0x53f44d[_0x3207('0x1e')]),_0x37d501);}});ami['on'](_0x3207('0x3d'),function(_0x559ee3){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')]('[%s][index][newexten]',_0x559ee3[_0x3207('0x1e')]),_0x559ee3);calls[_0x3207('0x3d')](_0x559ee3);recordings[_0x3207('0x3d')](_0x559ee3);dials[_0x3207('0x3d')](_0x559ee3);}catch(_0x321e71){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x3e'),_0x559ee3[_0x3207('0x1e')]),_0x321e71);}});ami['on'](_0x3207('0x3f'),function(_0x1f6fa9){try{utils[_0x3207('0x19')](util[_0x3207('0x1a')](_0x3207('0x40'),_0x1f6fa9[_0x3207('0x1e')]),_0x1f6fa9);calls[_0x3207('0x3f')](_0x1f6fa9);recordings[_0x3207('0x3f')](_0x1f6fa9);}catch(_0xeccd26){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x40'),_0x1f6fa9[_0x3207('0x1e')]),_0xeccd26);}});ami['on'](_0x3207('0x41'),function(_0x43c973){try{utils['debug'](util[_0x3207('0x1a')](_0x3207('0x42'),_0x43c973['uniqueid']),_0x43c973);dials[_0x3207('0x41')](_0x43c973);}catch(_0x163dfb){utils['error'](util[_0x3207('0x1a')](_0x3207('0x43'),_0x43c973['uniqueid']),_0x163dfb);}});ami['on'](_0x3207('0x44'),function(_0x2ac25e){try{utils['debug'](util['format']('[%s][index][dialend]',_0x2ac25e[_0x3207('0x1e')]),_0x2ac25e);dials[_0x3207('0x44')](_0x2ac25e);}catch(_0x3c4b02){utils[_0x3207('0x15')](util[_0x3207('0x1a')](_0x3207('0x45'),_0x2ac25e[_0x3207('0x1e')]),_0x3c4b02);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 69b0d0c..d823b70 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 _0xe18e=['now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','destination','destinationchannel','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','split','internal','catch','error','uniqueid','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe18e,0xe5));var _0xee18=function(_0x5e5fdd,_0x2e238a){_0x5e5fdd=_0x5e5fdd-0x0;var _0x5aece7=_0xe18e[_0x5e5fdd];return _0x5aece7;};'use strict';var _=require(_0xee18('0x0'));var util=require(_0xee18('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xee18('0x2')];function writeDB(_0x8330e){utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x5'),_0x8330e['uniqueid'],_0x8330e[_0xee18('0x6')],_0x8330e[_0xee18('0x7')],_0x8330e[_0xee18('0x8')],_0x8330e[_0xee18('0x9')],_0x8330e[_0xee18('0xa')]));if(_0x8330e[_0xee18('0x6')]){utils[_0xee18('0xb')](_0x8330e[_0xee18('0x6')])[_0xee18('0xc')](function(_0xe8b1d7){if(_0xe8b1d7){_0x8330e['membername']=_0xe8b1d7[_0xee18('0xd')];_0x8330e['internal']=_0xe8b1d7['internal'];utils[_0xee18('0xe')](_0xee18('0xf'),_0x8330e);}else{utils[_0xee18('0x10')](_0x8330e[_0xee18('0x6')][_0xee18('0x11')]('/')[0x1])[_0xee18('0xc')](function(_0x19f558){if(_0x19f558){_0x8330e[_0xee18('0x9')]=_0x19f558[_0xee18('0xd')];_0x8330e[_0xee18('0x12')]=_0x19f558['internal'];utils[_0xee18('0xe')](_0xee18('0xf'),_0x8330e);}});}})[_0xee18('0x13')](function(_0xfdc91c){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][writeDB]',_0x8330e[_0xee18('0x15')]),_0xfdc91c);});}delete members[_0x8330e['interface']];}function startsWith(_0x143a95,_0x265c7d){return _['some'](_0x143a95,function(_0x2a56dd){return _['startsWith'](_0x265c7d,_0x2a56dd);});}exports[_0xee18('0x16')]=function(_0x467f62){try{utils[_0xee18('0x17')](util[_0xee18('0x4')](_0xee18('0x18'),members[_0x467f62['device']]?members[_0x467f62[_0xee18('0x19')]][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')]),_0x467f62);utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x1a'),members[_0x467f62[_0xee18('0x19')]]?members[_0x467f62['device']][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')],_0x467f62[_0xee18('0x1b')],_0x467f62['device']));switch(_0x467f62[_0xee18('0x1b')]){case'INUSE':case _0xee18('0x1c'):if(!startsWith(exclude,_0x467f62[_0xee18('0x19')])){members[_0x467f62[_0xee18('0x19')]]={'channel':_0xee18('0x1d'),'interface':_0x467f62[_0xee18('0x19')],'type':_0xee18('0x1e'),'enterAt':utils[_0xee18('0x1f')](),'role':_0xee18('0x20')};}break;case _0xee18('0x21'):if(!_[_0xee18('0x22')](members[_0x467f62['device']])){members[_0x467f62[_0xee18('0x19')]][_0xee18('0x23')]=utils[_0xee18('0x1f')]();members[_0x467f62[_0xee18('0x19')]][_0xee18('0x24')]=utils[_0xee18('0x25')](members[_0x467f62[_0xee18('0x19')]]['exitAt'],members[_0x467f62[_0xee18('0x19')]][_0xee18('0x26')]);if(members[_0x467f62['device']]['uniqueid']){writeDB(members[_0x467f62['device']]);}}break;default:break;}}catch(_0x2778a3){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][devicestatechange]',members[_0x467f62[_0xee18('0x19')]]?members[_0x467f62[_0xee18('0x19')]][_0xee18('0x15')]:_0x467f62[_0xee18('0x19')]),_0x2778a3);}};exports[_0xee18('0x27')]=function(_0x2d57a0){try{if(!_[_0xee18('0x22')](members[_0x2d57a0[_0xee18('0x6')]])){utils['debug'](util[_0xee18('0x4')](_0xee18('0x28'),_0x2d57a0[_0xee18('0x15')]),_0x2d57a0);utils[_0xee18('0x3')](util[_0xee18('0x4')](_0xee18('0x29'),_0x2d57a0[_0xee18('0x15')],_0x2d57a0[_0xee18('0x6')],_0x2d57a0[_0xee18('0x2a')]));members[_0x2d57a0['interface']]=_[_0xee18('0x2b')](members[_0x2d57a0['interface']],{'data4':_0x2d57a0[_0xee18('0x2a')],'uniqueid':_0x2d57a0[_0xee18('0x15')]});}}catch(_0x44cc1d){utils[_0xee18('0x14')](util[_0xee18('0x4')]('[%s][members][agentcomplete]',_0x2d57a0[_0xee18('0x15')]),_0x44cc1d);}};exports[_0xee18('0x2c')]=function(_0x4320d9){try{utils[_0xee18('0x17')](util['format'](_0xee18('0x2d'),_0x4320d9['uniqueid']),_0x4320d9);if(_0x4320d9['channel']){var _0xf04f97=_0x4320d9[_0xee18('0x7')][_0xee18('0x11')]('-')[0x0];if(!_[_0xee18('0x22')](members[_0xf04f97])){members[_0xf04f97]=_[_0xee18('0x2b')](members[_0xf04f97],{'data1':members[_0xf04f97][_0xee18('0x2e')]||_0x4320d9[_0xee18('0xa')],'data2':members[_0xf04f97][_0xee18('0x8')]||_0x4320d9['source'],'data3':members[_0xf04f97]['data3']||_0x4320d9[_0xee18('0x2f')],'uniqueid':members[_0xf04f97][_0xee18('0x15')]||_0x4320d9[_0xee18('0x15')]});utils[_0xee18('0x3')](util[_0xee18('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4320d9[_0xee18('0x15')],members[_0xf04f97][_0xee18('0x2e')],members[_0xf04f97][_0xee18('0x8')],members[_0xf04f97]['data3']));if(members[_0xf04f97][_0xee18('0x23')]){writeDB(members[_0xf04f97]);}}}if(_0x4320d9[_0xee18('0x30')]){var _0x30fbc9=_0x4320d9[_0xee18('0x30')][_0xee18('0x11')]('-')[0x0];if(!_[_0xee18('0x22')](members[_0x30fbc9])){members[_0x30fbc9]=_[_0xee18('0x2b')](members[_0x30fbc9],{'data1':members[_0x30fbc9][_0xee18('0x2e')]||_0x4320d9[_0xee18('0xa')],'data2':members[_0x30fbc9][_0xee18('0x8')]||_0x4320d9[_0xee18('0x31')],'data3':members[_0x30fbc9][_0xee18('0x32')]||_0x4320d9[_0xee18('0x2f')],'uniqueid':members[_0x30fbc9][_0xee18('0x15')]||_0x4320d9[_0xee18('0x15')]});utils['info'](util['format'](_0xee18('0x33'),_0x4320d9['uniqueid'],members[_0x30fbc9]['data1'],members[_0x30fbc9]['data2'],members[_0x30fbc9][_0xee18('0x32')]));if(members[_0x30fbc9][_0xee18('0x23')]){writeDB(members[_0x30fbc9]);}}}}catch(_0x22da51){utils[_0xee18('0x14')](util[_0xee18('0x4')](_0xee18('0x2d'),_0x4320d9[_0xee18('0x15')]),_0x22da51);}}; \ No newline at end of file +var _0x67ae=['interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','isNil','exitAt','now','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','assign','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','source','util','./utils','Local/_attended@transfer','Queue:','format','uniqueid'];(function(_0x8b009c,_0x6b83c2){var _0x385f8d=function(_0x1a5632){while(--_0x1a5632){_0x8b009c['push'](_0x8b009c['shift']());}};_0x385f8d(++_0x6b83c2);}(_0x67ae,0xbe));var _0xe67a=function(_0x3cab38,_0x15804f){_0x3cab38=_0x3cab38-0x0;var _0x5744ff=_0x67ae[_0x3cab38];return _0x5744ff;};'use strict';var _=require('lodash');var util=require(_0xe67a('0x0'));var utils=require(_0xe67a('0x1'));var members={};var exclude=[_0xe67a('0x2'),_0xe67a('0x3')];function writeDB(_0xd4ce72){utils['info'](util[_0xe67a('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xd4ce72[_0xe67a('0x5')],_0xd4ce72[_0xe67a('0x6')],_0xd4ce72[_0xe67a('0x7')],_0xd4ce72[_0xe67a('0x8')],_0xd4ce72[_0xe67a('0x9')],_0xd4ce72[_0xe67a('0xa')]));if(_0xd4ce72['interface']){utils[_0xe67a('0xb')](_0xd4ce72[_0xe67a('0x6')])[_0xe67a('0xc')](function(_0x194d9d){if(_0x194d9d){_0xd4ce72[_0xe67a('0x9')]=_0x194d9d[_0xe67a('0xd')];_0xd4ce72[_0xe67a('0xe')]=_0x194d9d[_0xe67a('0xe')];utils[_0xe67a('0xf')]('CreateMemberReport',_0xd4ce72);}else{utils['getUserByName'](_0xd4ce72[_0xe67a('0x6')][_0xe67a('0x10')]('/')[0x1])[_0xe67a('0xc')](function(_0x5f1815){if(_0x5f1815){_0xd4ce72[_0xe67a('0x9')]=_0x5f1815[_0xe67a('0xd')];_0xd4ce72[_0xe67a('0xe')]=_0x5f1815['internal'];utils['request']('CreateMemberReport',_0xd4ce72);}});}})[_0xe67a('0x11')](function(_0x517fb5){utils[_0xe67a('0x12')](util[_0xe67a('0x4')](_0xe67a('0x13'),_0xd4ce72[_0xe67a('0x5')]),_0x517fb5);});}delete members[_0xd4ce72[_0xe67a('0x6')]];}function startsWith(_0x4914de,_0x2b4417){return _[_0xe67a('0x14')](_0x4914de,function(_0x4de166){return _[_0xe67a('0x15')](_0x2b4417,_0x4de166);});}exports[_0xe67a('0x16')]=function(_0x443407){try{utils[_0xe67a('0x17')](util[_0xe67a('0x4')](_0xe67a('0x18'),members[_0x443407[_0xe67a('0x19')]]?members[_0x443407[_0xe67a('0x19')]][_0xe67a('0x5')]:_0x443407[_0xe67a('0x19')]),_0x443407);utils[_0xe67a('0x1a')](util[_0xe67a('0x4')](_0xe67a('0x1b'),members[_0x443407[_0xe67a('0x19')]]?members[_0x443407[_0xe67a('0x19')]]['uniqueid']:_0x443407[_0xe67a('0x19')],_0x443407['state'],_0x443407[_0xe67a('0x19')]));switch(_0x443407[_0xe67a('0x1c')]){case _0xe67a('0x1d'):case _0xe67a('0x1e'):if(!startsWith(exclude,_0x443407[_0xe67a('0x19')])){members[_0x443407['device']]={'channel':_0xe67a('0x1f'),'interface':_0x443407[_0xe67a('0x19')],'type':'TALKING','enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xe67a('0x20')](members[_0x443407[_0xe67a('0x19')]])){members[_0x443407[_0xe67a('0x19')]][_0xe67a('0x21')]=utils[_0xe67a('0x22')]();members[_0x443407[_0xe67a('0x19')]][_0xe67a('0x23')]=utils[_0xe67a('0x24')](members[_0x443407[_0xe67a('0x19')]][_0xe67a('0x21')],members[_0x443407['device']]['enterAt']);if(members[_0x443407[_0xe67a('0x19')]][_0xe67a('0x5')]){writeDB(members[_0x443407['device']]);}}break;default:break;}}catch(_0x4fd367){utils[_0xe67a('0x12')](util[_0xe67a('0x4')](_0xe67a('0x18'),members[_0x443407[_0xe67a('0x19')]]?members[_0x443407[_0xe67a('0x19')]]['uniqueid']:_0x443407[_0xe67a('0x19')]),_0x4fd367);}};exports[_0xe67a('0x25')]=function(_0x567b87){try{if(!_[_0xe67a('0x20')](members[_0x567b87[_0xe67a('0x6')]])){utils[_0xe67a('0x17')](util[_0xe67a('0x4')](_0xe67a('0x26'),_0x567b87['uniqueid']),_0x567b87);utils[_0xe67a('0x1a')](util[_0xe67a('0x4')](_0xe67a('0x27'),_0x567b87[_0xe67a('0x5')],_0x567b87['interface'],_0x567b87['queue']));members[_0x567b87[_0xe67a('0x6')]]=_['assign'](members[_0x567b87[_0xe67a('0x6')]],{'data4':_0x567b87[_0xe67a('0x28')],'uniqueid':_0x567b87[_0xe67a('0x5')]});}}catch(_0x2b61aa){utils[_0xe67a('0x12')](util['format'](_0xe67a('0x26'),_0x567b87['uniqueid']),_0x2b61aa);}};exports[_0xe67a('0x29')]=function(_0x34d847){try{utils['debug'](util[_0xe67a('0x4')](_0xe67a('0x2a'),_0x34d847[_0xe67a('0x5')]),_0x34d847);if(_0x34d847[_0xe67a('0x7')]){var _0x19df12=_0x34d847[_0xe67a('0x7')][_0xe67a('0x10')]('-')[0x0];if(!_[_0xe67a('0x20')](members[_0x19df12])){members[_0x19df12]=_[_0xe67a('0x2b')](members[_0x19df12],{'data1':members[_0x19df12]['data1']||_0x34d847['type'],'data2':members[_0x19df12][_0xe67a('0x8')]||_0x34d847['source'],'data3':members[_0x19df12][_0xe67a('0x2c')]||_0x34d847['destination'],'uniqueid':members[_0x19df12][_0xe67a('0x5')]||_0x34d847[_0xe67a('0x5')]});utils[_0xe67a('0x1a')](util[_0xe67a('0x4')](_0xe67a('0x2d'),_0x34d847[_0xe67a('0x5')],members[_0x19df12][_0xe67a('0x2e')],members[_0x19df12][_0xe67a('0x8')],members[_0x19df12][_0xe67a('0x2c')]));if(members[_0x19df12]['exitAt']){writeDB(members[_0x19df12]);}}}if(_0x34d847['destinationchannel']){var _0x3f1306=_0x34d847[_0xe67a('0x2f')]['split']('-')[0x0];if(!_[_0xe67a('0x20')](members[_0x3f1306])){members[_0x3f1306]=_[_0xe67a('0x2b')](members[_0x3f1306],{'data1':members[_0x3f1306]['data1']||_0x34d847['type'],'data2':members[_0x3f1306][_0xe67a('0x8')]||_0x34d847[_0xe67a('0x30')],'data3':members[_0x3f1306][_0xe67a('0x2c')]||_0x34d847['destination'],'uniqueid':members[_0x3f1306]['uniqueid']||_0x34d847[_0xe67a('0x5')]});utils[_0xe67a('0x1a')](util[_0xe67a('0x4')](_0xe67a('0x2d'),_0x34d847[_0xe67a('0x5')],members[_0x3f1306][_0xe67a('0x2e')],members[_0x3f1306][_0xe67a('0x8')],members[_0x3f1306]['data3']));if(members[_0x3f1306][_0xe67a('0x21')]){writeDB(members[_0x3f1306]);}}}}catch(_0x1282e8){utils[_0xe67a('0x12')](util[_0xe67a('0x4')](_0xe67a('0x2a'),_0x34d847[_0xe67a('0x5')]),_0x1282e8);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index eddf5f2..3872d74 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 _0x0ee0=['error','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason'];(function(_0x2b6620,_0x482784){var _0x1153cb=function(_0x18780a){while(--_0x18780a){_0x2b6620['push'](_0x2b6620['shift']());}};_0x1153cb(++_0x482784);}(_0x0ee0,0x1ec));var _0x00ee=function(_0x299624,_0x29e829){_0x299624=_0x299624-0x0;var _0x7a49f3=_0x0ee0[_0x299624];return _0x7a49f3;};'use strict';var _=require(_0x00ee('0x0'));var util=require(_0x00ee('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1f13a3){utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x4'),_0x1f13a3[_0x00ee('0x5')],_0x1f13a3['channel'],_0x1f13a3[_0x00ee('0x6')],_0x1f13a3['lastAssignedTo'],_0x1f13a3[_0x00ee('0x7')],_0x1f13a3[_0x00ee('0x8')],_0x1f13a3[_0x00ee('0x9')]));if(_0x1f13a3[_0x00ee('0x6')]){utils['getVoiceQueueByName'](_0x1f13a3[_0x00ee('0x6')])[_0x00ee('0xa')](function(_0x451bcb){if(_0x451bcb){_0x1f13a3['type']=_0x451bcb[_0x00ee('0xb')];}utils[_0x00ee('0xc')](_0x00ee('0xd'),_0x1f13a3);});}else{utils[_0x00ee('0xc')](_0x00ee('0xd'),_0x1f13a3);}if(_0x1f13a3['transfereduniqueid']){delete queues[_0x1f13a3[_0x00ee('0xe')]];}else{delete queues[_0x1f13a3[_0x00ee('0x5')]];}}exports[_0x00ee('0xf')]=function(_0xf36659){try{utils[_0x00ee('0x10')](util[_0x00ee('0x3')]('[%s][queues][queuecallerjoin]',_0xf36659[_0x00ee('0x5')]),_0xf36659);utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x11'),_0xf36659['uniqueid'],_0xf36659[_0x00ee('0x6')],_0xf36659[_0x00ee('0x12')]));queues[_0xf36659[_0x00ee('0x5')]]=_[_0x00ee('0x13')](_0xf36659,{'originalposition':_0xf36659[_0x00ee('0x12')],'queuecallerjoinAt':utils[_0x00ee('0x14')](),'mohtime':0x0});}catch(_0x3bb823){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x15'),_0xf36659[_0x00ee('0x5')]),_0x3bb823);}};exports['hangup']=function(_0x1310bc){try{if(!_[_0x00ee('0x16')](queues[_0x1310bc['uniqueid']])){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x17'),_0x1310bc['uniqueid']),_0x1310bc);if(queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x18')]){if(!queues[_0x1310bc['uniqueid']][_0x00ee('0x19')]&&!queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1a')]){queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1b')]=!![];queues[_0x1310bc[_0x00ee('0x5')]]['queuecallercompleteAt']=utils[_0x00ee('0x14')]();queues[_0x1310bc['uniqueid']][_0x00ee('0x9')]=_0x00ee('0x1c');}utils['info'](util[_0x00ee('0x3')](_0x00ee('0x1d'),_0x1310bc[_0x00ee('0x5')],queues[_0x1310bc['uniqueid']][_0x00ee('0x1e')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x1310bc[_0x00ee('0x5')]]);}else if(queues[_0x1310bc[_0x00ee('0x5')]]['transfereduniqueid']){utils[_0x00ee('0x2')](util['format'](_0x00ee('0x1f'),_0x1310bc[_0x00ee('0x5')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]));queues[queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]]=queues[_0x1310bc[_0x00ee('0x5')]];queues[queues[_0x1310bc[_0x00ee('0x5')]][_0x00ee('0xe')]][_0x00ee('0x20')]=0x2;delete queues[_0x1310bc[_0x00ee('0x5')]];}}}catch(_0x5d2fca){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x17'),_0x1310bc[_0x00ee('0x5')]),_0x5d2fca);}};exports[_0x00ee('0x22')]=function(_0x1f72be){try{utils[_0x00ee('0x10')](util['format'](_0x00ee('0x23'),_0x1f72be['uniqueid']),_0x1f72be);if(!_[_0x00ee('0x16')](_0x1f72be['variable'][_0x00ee('0x24')])&&_0x1f72be[_0x00ee('0x25')][_0x00ee('0x26')]()!==_0x00ee('0x27')){if(!_[_0x00ee('0x16')](queues[_0x1f72be[_0x00ee('0x5')]])){queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x1a')]=!![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x29')]=utils[_0x00ee('0x14')]();queues[_0x1f72be[_0x00ee('0x5')]]['queuecallerexitreason']=_0x1f72be['value']['toUpperCase']();utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x2a'),_0x1f72be['uniqueid'],queues[_0x1f72be['uniqueid']]['name'],_0x1f72be[_0x00ee('0x25')],queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x1f72be[_0x00ee('0x5')]]);}}else if(!_['isNil'](_0x1f72be[_0x00ee('0x2b')][_0x00ee('0x2c')])){if(!_['isNil'](queues[_0x1f72be[_0x00ee('0x5')]])&&!queues[_0x1f72be['uniqueid']][_0x00ee('0x19')]){queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x1a')]=!![];queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x29')]=utils[_0x00ee('0x14')]();queues[_0x1f72be[_0x00ee('0x5')]]['queuecallerexitreason']=_0x00ee('0x2d');utils[_0x00ee('0x2')](util['format'](_0x00ee('0x2e'),_0x1f72be[_0x00ee('0x5')],queues[_0x1f72be['uniqueid']][_0x00ee('0x1e')],_0x1f72be[_0x00ee('0x25')],queues[_0x1f72be[_0x00ee('0x5')]][_0x00ee('0x9')]));}}}catch(_0x3c3641){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x23'),_0x1f72be[_0x00ee('0x5')]),_0x3c3641);}};exports[_0x00ee('0x19')]=function(_0x4f0885){try{if(!_[_0x00ee('0x16')](queues[_0x4f0885[_0x00ee('0x5')]])){utils['debug'](util['format'](_0x00ee('0x2f'),_0x4f0885[_0x00ee('0x5')]),_0x4f0885);queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x1a')]=![];queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x4f0885['uniqueid']][_0x00ee('0x19')]=!![];queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x28')]=utils[_0x00ee('0x14')]();queues[_0x4f0885[_0x00ee('0x5')]]['queuecallerexitreason']=_0x00ee('0x30');utils[_0x00ee('0x2')](util['format'](_0x00ee('0x31'),_0x4f0885['uniqueid'],queues[_0x4f0885[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x4f0885['uniqueid']][_0x00ee('0x9')]));}}catch(_0x403eee){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x2f'),_0x4f0885[_0x00ee('0x5')]),_0x403eee);}};exports[_0x00ee('0x32')]=function(_0x33c5c9){try{if(!_['isNil'](queues[_0x33c5c9[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util[_0x00ee('0x3')]('[%s][queues][queuecallerleave]',_0x33c5c9[_0x00ee('0x5')]),_0x33c5c9);utils['info'](util['format'](_0x00ee('0x33'),_0x33c5c9[_0x00ee('0x5')],queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x33c5c9[_0x00ee('0x34')],_0x33c5c9[_0x00ee('0x35')]));queues[_0x33c5c9['uniqueid']][_0x00ee('0x32')]=!![];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x36')]=utils[_0x00ee('0x37')](queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x18')],queues[_0x33c5c9['uniqueid']][_0x00ee('0x38')]);queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x12')]=_0x33c5c9[_0x00ee('0x12')];queues[_0x33c5c9['uniqueid']][_0x00ee('0x39')]=_0x33c5c9[_0x00ee('0x39')];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x34')]=_0x33c5c9[_0x00ee('0x34')];queues[_0x33c5c9[_0x00ee('0x5')]][_0x00ee('0x35')]=_0x33c5c9[_0x00ee('0x35')];}}catch(_0x5d7113){utils[_0x00ee('0x21')](util[_0x00ee('0x3')](_0x00ee('0x3a'),_0x33c5c9[_0x00ee('0x5')]),_0x5d7113);}};exports['agentconnect']=function(_0x2bbaed){try{if(!_[_0x00ee('0x16')](queues[_0x2bbaed[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util['format'](_0x00ee('0x3b'),_0x2bbaed['uniqueid']),_0x2bbaed);utils[_0x00ee('0x2')](util['format'](_0x00ee('0x3c'),_0x2bbaed[_0x00ee('0x5')],queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x2bbaed[_0x00ee('0x3d')],_0x2bbaed[_0x00ee('0x3e')]));queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x28')]=null;queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x1a')]=![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x9')]=null;queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x2bbaed['uniqueid']][_0x00ee('0x3f')]=!![];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x8')]=_0x2bbaed[_0x00ee('0x3e')];queues[_0x2bbaed[_0x00ee('0x5')]][_0x00ee('0x40')]=_0x2bbaed[_0x00ee('0x3d')];}}catch(_0x33fd89){utils[_0x00ee('0x21')](util[_0x00ee('0x3')]('[%s][queues][agentconnect]',_0x2bbaed[_0x00ee('0x5')]),_0x33fd89);}};exports[_0x00ee('0x41')]=function(_0x97d15f){try{if(!_[_0x00ee('0x16')](queues[_0x97d15f[_0x00ee('0x5')]])){if(queues[_0x97d15f['uniqueid']]['queuecallerleaveAt']){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x42'),_0x97d15f[_0x00ee('0x5')]),_0x97d15f);queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x19')]=![];queues[_0x97d15f[_0x00ee('0x5')]]['queuecallerabandonAt']=null;queues[_0x97d15f[_0x00ee('0x5')]]['queuecallerexit']=![];queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x29')]=null;queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x3f')]=!![];queues[_0x97d15f['uniqueid']][_0x00ee('0x40')]=_0x97d15f[_0x00ee('0x3d')];queues[_0x97d15f[_0x00ee('0x5')]]['queuecallercomplete']=!![];queues[_0x97d15f['uniqueid']][_0x00ee('0x43')]=utils[_0x00ee('0x14')]();if(_0x97d15f[_0x00ee('0x44')]==_0x00ee('0x45')){if(!queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x45')]){queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x9')]=_0x00ee('0x46');}}else{queues[_0x97d15f['uniqueid']][_0x00ee('0x9')]=_0x00ee('0x47')+_0x97d15f[_0x00ee('0x44')][_0x00ee('0x26')]();}utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x48'),_0x97d15f[_0x00ee('0x5')],queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x1e')],_0x97d15f[_0x00ee('0x3d')],queues[_0x97d15f[_0x00ee('0x5')]][_0x00ee('0x9')]));writeDB(queues[_0x97d15f[_0x00ee('0x5')]]);}}}catch(_0xd713cc){utils[_0x00ee('0x21')](util['format'](_0x00ee('0x42'),_0x97d15f['uniqueid']),_0xd713cc);}};exports['blindtransfer']=function(_0x42209b){try{if(!_['isNil'](queues[_0x42209b['transfereeuniqueid']])){utils['debug'](util[_0x00ee('0x3')](_0x00ee('0x49'),_0x42209b['uniqueid']),_0x42209b);queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x45')]=!![];queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x4b')]=_0x00ee('0x4c');queues[_0x42209b[_0x00ee('0x4a')]]['transferexten']=_0x42209b[_0x00ee('0x4d')];queues[_0x42209b[_0x00ee('0x4a')]][_0x00ee('0x4e')]=_0x42209b[_0x00ee('0x4a')];queues[_0x42209b[_0x00ee('0x4a')]]['queuecallerexitreason']=_0x00ee('0x4f');utils[_0x00ee('0x2')](util[_0x00ee('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x42209b[_0x00ee('0x5')],queues[_0x42209b['transfereeuniqueid']][_0x00ee('0x1e')],_0x42209b[_0x00ee('0x4a')],_0x42209b[_0x00ee('0x4d')]));}}catch(_0x1be62d){utils[_0x00ee('0x21')](util[_0x00ee('0x3')](_0x00ee('0x49'),_0x42209b[_0x00ee('0x5')]),_0x1be62d);}};exports['attendedtransfer']=function(_0x5e5ce6){try{utils[_0x00ee('0x10')](util[_0x00ee('0x3')](_0x00ee('0x50'),_0x5e5ce6['origtransfereruniqueid']),_0x5e5ce6);if(_0x5e5ce6[_0x00ee('0x51')]==_0x5e5ce6[_0x00ee('0x52')]){if(!_['isNil'](queues[_0x5e5ce6[_0x00ee('0x53')]])){utils[_0x00ee('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x54')]));queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x45')]=!![];queues[_0x5e5ce6[_0x00ee('0x53')]]['transfertype']=_0x00ee('0x55');queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x56')]=_0x5e5ce6['origtransfererexten'];queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x4e')]=_0x5e5ce6[_0x00ee('0x51')];queues[_0x5e5ce6['secondtransfererlinkedid']][_0x00ee('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x00ee('0x16')](queues[_0x5e5ce6[_0x00ee('0x52')]])){if(_0x5e5ce6[_0x00ee('0x57')]&&queues[_0x5e5ce6[_0x00ee('0x57')]]){queues[_0x5e5ce6[_0x00ee('0x57')]][_0x00ee('0x20')]=0x1;queues[_0x5e5ce6[_0x00ee('0x4a')]]=_[_0x00ee('0x58')](queues[_0x5e5ce6[_0x00ee('0x57')]]);queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0xe')]=_0x5e5ce6['transfertargetuniqueid'];queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x20')]=0x2;queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x7')]=queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x7')];queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x59')]=queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x59')];queues[_0x5e5ce6[_0x00ee('0x4a')]]['queuecallerjoinAt']=utils[_0x00ee('0x14')]();queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x5e5ce6['transfereeuniqueid']][_0x00ee('0x36')]=0x0;queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x5a')]=0x0;utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x5b'),_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6['transfereeuniqueid']]['name'],queues[_0x5e5ce6[_0x00ee('0x4a')]][_0x00ee('0x7')],queues[_0x5e5ce6[_0x00ee('0x4a')]]['calleridname']));}else{utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x5c'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x53')]));queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x53')];}}}else if(_0x5e5ce6[_0x00ee('0x5d')]==_0x5e5ce6[_0x00ee('0x53')]){if(!_[_0x00ee('0x16')](queues[_0x5e5ce6['origtransfererlinkedid']])){utils[_0x00ee('0x2')](util['format'](_0x00ee('0x5e'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x1e')],_0x5e5ce6[_0x00ee('0x5d')],_0x5e5ce6[_0x00ee('0x5f')]));queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x45')]=!![];queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x4b')]=_0x00ee('0x55');queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x56')]=_0x5e5ce6[_0x00ee('0x5f')];queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x4e')]=_0x5e5ce6[_0x00ee('0x5d')];queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x9')]=_0x00ee('0x60');}if(!_[_0x00ee('0x16')](queues[_0x5e5ce6[_0x00ee('0x53')]])){if(_0x5e5ce6['transfertargetlinkedid']&&queues[_0x5e5ce6[_0x00ee('0x61')]]){queues[_0x5e5ce6[_0x00ee('0x61')]][_0x00ee('0x20')]=0x1;queues[_0x5e5ce6[_0x00ee('0x62')]]=_[_0x00ee('0x58')](queues[_0x5e5ce6[_0x00ee('0x61')]]);queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x62')];queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x20')]=0x2;queues[_0x5e5ce6[_0x00ee('0x62')]]['calleridnum']=queues[_0x5e5ce6[_0x00ee('0x52')]][_0x00ee('0x7')];queues[_0x5e5ce6[_0x00ee('0x62')]]['calleridname']=queues[_0x5e5ce6['origtransfererlinkedid']][_0x00ee('0x59')];queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x38')]=utils['now']();queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x18')]=utils[_0x00ee('0x14')]();queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x36')]=0x0;queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x5a')]=0x0;utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x63'),_0x5e5ce6['origtransfereruniqueid'],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x1e')],queues[_0x5e5ce6['transfertargetuniqueid']][_0x00ee('0xe')],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x7')],queues[_0x5e5ce6[_0x00ee('0x62')]][_0x00ee('0x59')]));}else{utils[_0x00ee('0x2')](util['format'](_0x00ee('0x5c'),_0x5e5ce6[_0x00ee('0x51')],queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0x1e')],_0x5e5ce6['origtransfererlinkedid']));queues[_0x5e5ce6[_0x00ee('0x53')]][_0x00ee('0xe')]=_0x5e5ce6[_0x00ee('0x52')];}}}}catch(_0x50c6e7){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x50'),_0x5e5ce6[_0x00ee('0x51')]),_0x50c6e7);}};exports['musiconholdstart']=function(_0x3a2b5a){try{if(!_[_0x00ee('0x16')](queues[_0x3a2b5a[_0x00ee('0x5')]])){utils[_0x00ee('0x10')](util['format']('[%s][queues][musiconholdstart]',_0x3a2b5a['uniqueid']),_0x3a2b5a);queues[_0x3a2b5a[_0x00ee('0x5')]]['musiconholdstartAt']=utils[_0x00ee('0x14')]();utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x64'),_0x3a2b5a[_0x00ee('0x5')],queues[_0x3a2b5a[_0x00ee('0x5')]][_0x00ee('0x1e')],queues[_0x3a2b5a[_0x00ee('0x5')]][_0x00ee('0x65')]));}}catch(_0x15ac30){utils[_0x00ee('0x21')](util[_0x00ee('0x3')]('[%s][queues][musiconholdstart]',_0x3a2b5a[_0x00ee('0x5')]),_0x15ac30);}};exports[_0x00ee('0x66')]=function(_0x1cb21d){try{if(!_[_0x00ee('0x16')](queues[_0x1cb21d[_0x00ee('0x5')]])){if(!_['isNil'](queues[_0x1cb21d['uniqueid']][_0x00ee('0x65')])){utils[_0x00ee('0x10')](util['format']('[%s][queues][musiconholdstop]',_0x1cb21d['uniqueid']),_0x1cb21d);queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x5a')]+=utils[_0x00ee('0x37')](utils[_0x00ee('0x14')](),queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x65')]);utils[_0x00ee('0x2')](util[_0x00ee('0x3')](_0x00ee('0x67'),_0x1cb21d[_0x00ee('0x5')],queues[_0x1cb21d['uniqueid']]['name'],queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x5a')]));delete queues[_0x1cb21d[_0x00ee('0x5')]][_0x00ee('0x65')];}}}catch(_0x347aa4){utils['error'](util[_0x00ee('0x3')](_0x00ee('0x68'),_0x1cb21d['uniqueid']),_0x347aa4);}}; \ No newline at end of file +var _0xd128=['transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport'];(function(_0x45ccb5,_0x5554db){var _0x462989=function(_0x2e4e67){while(--_0x2e4e67){_0x45ccb5['push'](_0x45ccb5['shift']());}};_0x462989(++_0x5554db);}(_0xd128,0xc4));var _0x8d12=function(_0x4d44df,_0x183572){_0x4d44df=_0x4d44df-0x0;var _0x43adb1=_0xd128[_0x4d44df];return _0x43adb1;};'use strict';var _=require(_0x8d12('0x0'));var util=require(_0x8d12('0x1'));var utils=require(_0x8d12('0x2'));var queues={};function writeDB(_0x3f58a8){utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x5'),_0x3f58a8['uniqueid'],_0x3f58a8[_0x8d12('0x6')],_0x3f58a8[_0x8d12('0x7')],_0x3f58a8[_0x8d12('0x8')],_0x3f58a8['calleridnum'],_0x3f58a8[_0x8d12('0x9')],_0x3f58a8[_0x8d12('0xa')]));if(_0x3f58a8[_0x8d12('0x7')]){utils[_0x8d12('0xb')](_0x3f58a8[_0x8d12('0x7')])[_0x8d12('0xc')](function(_0xa50b91){if(_0xa50b91){_0x3f58a8[_0x8d12('0xd')]=_0xa50b91[_0x8d12('0xd')];}utils[_0x8d12('0xe')](_0x8d12('0xf'),_0x3f58a8);});}else{utils[_0x8d12('0xe')](_0x8d12('0xf'),_0x3f58a8);}if(_0x3f58a8[_0x8d12('0x10')]){delete queues[_0x3f58a8[_0x8d12('0x10')]];}else{delete queues[_0x3f58a8[_0x8d12('0x11')]];}}exports['queuecallerjoin']=function(_0x2783e3){try{utils[_0x8d12('0x12')](util[_0x8d12('0x4')](_0x8d12('0x13'),_0x2783e3[_0x8d12('0x11')]),_0x2783e3);utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x14'),_0x2783e3[_0x8d12('0x11')],_0x2783e3[_0x8d12('0x7')],_0x2783e3['position']));queues[_0x2783e3[_0x8d12('0x11')]]=_['assign'](_0x2783e3,{'originalposition':_0x2783e3[_0x8d12('0x15')],'queuecallerjoinAt':utils[_0x8d12('0x16')](),'mohtime':0x0});}catch(_0x46e65d){utils['error'](util[_0x8d12('0x4')](_0x8d12('0x13'),_0x2783e3[_0x8d12('0x11')]),_0x46e65d);}};exports['hangup']=function(_0x23c278){try{if(!_[_0x8d12('0x17')](queues[_0x23c278[_0x8d12('0x11')]])){utils[_0x8d12('0x12')](util[_0x8d12('0x4')](_0x8d12('0x18'),_0x23c278[_0x8d12('0x11')]),_0x23c278);if(queues[_0x23c278[_0x8d12('0x11')]]['queuecallerleaveAt']){if(!queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x19')]&&!queues[_0x23c278['uniqueid']][_0x8d12('0x1a')]){queues[_0x23c278['uniqueid']][_0x8d12('0x1b')]=!![];queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x1c')]=utils['now']();queues[_0x23c278['uniqueid']][_0x8d12('0xa')]=_0x8d12('0x1d');}utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x1e'),_0x23c278['uniqueid'],queues[_0x23c278[_0x8d12('0x11')]]['name'],queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0xa')]));writeDB(queues[_0x23c278[_0x8d12('0x11')]]);}else if(queues[_0x23c278[_0x8d12('0x11')]]['transfereduniqueid']){utils['info'](util['format'](_0x8d12('0x1f'),_0x23c278[_0x8d12('0x11')],queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x20')],queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x10')]));queues[queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x10')]]=queues[_0x23c278['uniqueid']];queues[queues[_0x23c278[_0x8d12('0x11')]][_0x8d12('0x10')]][_0x8d12('0x21')]=0x2;delete queues[_0x23c278[_0x8d12('0x11')]];}}}catch(_0x389255){utils[_0x8d12('0x22')](util[_0x8d12('0x4')](_0x8d12('0x18'),_0x23c278[_0x8d12('0x11')]),_0x389255);}};exports[_0x8d12('0x23')]=function(_0x340761){try{utils[_0x8d12('0x12')](util[_0x8d12('0x4')]('[%s][queues][varset]',_0x340761[_0x8d12('0x11')]),_0x340761);if(!_[_0x8d12('0x17')](_0x340761[_0x8d12('0x24')][_0x8d12('0x25')])&&_0x340761['value'][_0x8d12('0x26')]()!==_0x8d12('0x27')){if(!_[_0x8d12('0x17')](queues[_0x340761[_0x8d12('0x11')]])){queues[_0x340761['uniqueid']][_0x8d12('0x19')]=![];queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x28')]=null;queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x1a')]=!![];queues[_0x340761['uniqueid']]['queuecallerexitAt']=utils[_0x8d12('0x16')]();queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0xa')]=_0x340761[_0x8d12('0x29')][_0x8d12('0x26')]();utils['info'](util['format'](_0x8d12('0x2a'),_0x340761[_0x8d12('0x11')],queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x20')],_0x340761[_0x8d12('0x29')],queues[_0x340761['uniqueid']][_0x8d12('0xa')]));writeDB(queues[_0x340761[_0x8d12('0x11')]]);}}else if(!_[_0x8d12('0x17')](_0x340761['variable'][_0x8d12('0x2b')])){if(!_['isNil'](queues[_0x340761[_0x8d12('0x11')]])&&!queues[_0x340761[_0x8d12('0x11')]]['queuecallerabandon']){queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x19')]=![];queues[_0x340761[_0x8d12('0x11')]]['queuecallerabandonAt']=null;queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x1a')]=!![];queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x2c')]=utils['now']();queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0xa')]=_0x8d12('0x2d');utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x2e'),_0x340761[_0x8d12('0x11')],queues[_0x340761[_0x8d12('0x11')]][_0x8d12('0x20')],_0x340761[_0x8d12('0x29')],queues[_0x340761['uniqueid']][_0x8d12('0xa')]));}}}catch(_0x488c0d){utils[_0x8d12('0x22')](util['format'](_0x8d12('0x2f'),_0x340761[_0x8d12('0x11')]),_0x488c0d);}};exports['queuecallerabandon']=function(_0x269a0d){try{if(!_[_0x8d12('0x17')](queues[_0x269a0d['uniqueid']])){utils['debug'](util['format'](_0x8d12('0x30'),_0x269a0d[_0x8d12('0x11')]),_0x269a0d);queues[_0x269a0d['uniqueid']][_0x8d12('0x1a')]=![];queues[_0x269a0d['uniqueid']][_0x8d12('0x2c')]=null;queues[_0x269a0d[_0x8d12('0x11')]][_0x8d12('0x19')]=!![];queues[_0x269a0d[_0x8d12('0x11')]][_0x8d12('0x28')]=utils['now']();queues[_0x269a0d[_0x8d12('0x11')]]['queuecallerexitreason']=_0x8d12('0x31');utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x32'),_0x269a0d['uniqueid'],queues[_0x269a0d[_0x8d12('0x11')]][_0x8d12('0x20')],queues[_0x269a0d[_0x8d12('0x11')]][_0x8d12('0xa')]));}}catch(_0x38518d){utils[_0x8d12('0x22')](util['format'](_0x8d12('0x30'),_0x269a0d['uniqueid']),_0x38518d);}};exports['queuecallerleave']=function(_0x289db3){try{if(!_[_0x8d12('0x17')](queues[_0x289db3[_0x8d12('0x11')]])){utils['debug'](util[_0x8d12('0x4')]('[%s][queues][queuecallerleave]',_0x289db3[_0x8d12('0x11')]),_0x289db3);utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x33'),_0x289db3[_0x8d12('0x11')],queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x20')],_0x289db3[_0x8d12('0x34')],_0x289db3[_0x8d12('0x35')]));queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x36')]=!![];queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x37')]=utils[_0x8d12('0x16')]();queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x38')]=utils[_0x8d12('0x39')](queues[_0x289db3['uniqueid']][_0x8d12('0x37')],queues[_0x289db3[_0x8d12('0x11')]]['queuecallerjoinAt']);queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x15')]=_0x289db3['position'];queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x3a')]=_0x289db3[_0x8d12('0x3a')];queues[_0x289db3[_0x8d12('0x11')]][_0x8d12('0x34')]=_0x289db3['connectedlinenum'];queues[_0x289db3[_0x8d12('0x11')]]['connectedlinename']=_0x289db3[_0x8d12('0x35')];}}catch(_0x4cf978){utils[_0x8d12('0x22')](util[_0x8d12('0x4')](_0x8d12('0x3b'),_0x289db3['uniqueid']),_0x4cf978);}};exports[_0x8d12('0x3c')]=function(_0x15261e){try{if(!_['isNil'](queues[_0x15261e['uniqueid']])){utils['debug'](util[_0x8d12('0x4')](_0x8d12('0x3d'),_0x15261e[_0x8d12('0x11')]),_0x15261e);utils[_0x8d12('0x3')](util['format'](_0x8d12('0x3e'),_0x15261e['uniqueid'],queues[_0x15261e[_0x8d12('0x11')]][_0x8d12('0x20')],_0x15261e[_0x8d12('0x3f')],_0x15261e[_0x8d12('0x40')]));queues[_0x15261e[_0x8d12('0x11')]][_0x8d12('0x19')]=![];queues[_0x15261e[_0x8d12('0x11')]][_0x8d12('0x19')]=![];queues[_0x15261e[_0x8d12('0x11')]][_0x8d12('0x28')]=null;queues[_0x15261e['uniqueid']][_0x8d12('0x1a')]=![];queues[_0x15261e['uniqueid']][_0x8d12('0xa')]=null;queues[_0x15261e['uniqueid']][_0x8d12('0x2c')]=null;queues[_0x15261e['uniqueid']]['assigned']=!![];queues[_0x15261e['uniqueid']][_0x8d12('0x9')]=_0x15261e['destaccountcode'];queues[_0x15261e[_0x8d12('0x11')]][_0x8d12('0x8')]=_0x15261e[_0x8d12('0x3f')];}}catch(_0x3f4e32){utils['error'](util[_0x8d12('0x4')](_0x8d12('0x3d'),_0x15261e[_0x8d12('0x11')]),_0x3f4e32);}};exports[_0x8d12('0x41')]=function(_0x1d9880){try{if(!_[_0x8d12('0x17')](queues[_0x1d9880[_0x8d12('0x11')]])){if(queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x37')]){utils[_0x8d12('0x12')](util[_0x8d12('0x4')](_0x8d12('0x42'),_0x1d9880[_0x8d12('0x11')]),_0x1d9880);queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x19')]=![];queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x19')]=![];queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x28')]=null;queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x1a')]=![];queues[_0x1d9880['uniqueid']][_0x8d12('0x2c')]=null;queues[_0x1d9880[_0x8d12('0x11')]]['assigned']=!![];queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x8')]=_0x1d9880['membername'];queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x1b')]=!![];queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x1c')]=utils[_0x8d12('0x16')]();if(_0x1d9880[_0x8d12('0x43')]==_0x8d12('0x44')){if(!queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x44')]){queues[_0x1d9880[_0x8d12('0x11')]]['queuecallerexitreason']=_0x8d12('0x45');}}else{queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0xa')]=_0x8d12('0x46')+_0x1d9880[_0x8d12('0x43')]['toUpperCase']();}utils[_0x8d12('0x3')](util['format'](_0x8d12('0x47'),_0x1d9880[_0x8d12('0x11')],queues[_0x1d9880[_0x8d12('0x11')]][_0x8d12('0x20')],_0x1d9880[_0x8d12('0x3f')],queues[_0x1d9880['uniqueid']][_0x8d12('0xa')]));writeDB(queues[_0x1d9880['uniqueid']]);}}}catch(_0x730d31){utils[_0x8d12('0x22')](util[_0x8d12('0x4')](_0x8d12('0x42'),_0x1d9880[_0x8d12('0x11')]),_0x730d31);}};exports['blindtransfer']=function(_0x1ca0d5){try{if(!_[_0x8d12('0x17')](queues[_0x1ca0d5[_0x8d12('0x48')]])){utils['debug'](util[_0x8d12('0x4')](_0x8d12('0x49'),_0x1ca0d5['uniqueid']),_0x1ca0d5);queues[_0x1ca0d5[_0x8d12('0x48')]][_0x8d12('0x44')]=!![];queues[_0x1ca0d5[_0x8d12('0x48')]][_0x8d12('0x4a')]=_0x8d12('0x4b');queues[_0x1ca0d5[_0x8d12('0x48')]][_0x8d12('0x4c')]=_0x1ca0d5[_0x8d12('0x4d')];queues[_0x1ca0d5[_0x8d12('0x48')]][_0x8d12('0x4e')]=_0x1ca0d5[_0x8d12('0x48')];queues[_0x1ca0d5[_0x8d12('0x48')]][_0x8d12('0xa')]=_0x8d12('0x4f');utils[_0x8d12('0x3')](util[_0x8d12('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1ca0d5['uniqueid'],queues[_0x1ca0d5['transfereeuniqueid']][_0x8d12('0x20')],_0x1ca0d5[_0x8d12('0x48')],_0x1ca0d5['extension']));}}catch(_0x27212b){utils[_0x8d12('0x22')](util['format'](_0x8d12('0x49'),_0x1ca0d5[_0x8d12('0x11')]),_0x27212b);}};exports['attendedtransfer']=function(_0x1ce572){try{utils[_0x8d12('0x12')](util[_0x8d12('0x4')](_0x8d12('0x50'),_0x1ce572[_0x8d12('0x51')]),_0x1ce572);if(_0x1ce572[_0x8d12('0x51')]==_0x1ce572[_0x8d12('0x52')]){if(!_[_0x8d12('0x17')](queues[_0x1ce572[_0x8d12('0x53')]])){utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x54'),_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572[_0x8d12('0x53')]]['name'],_0x1ce572['origtransfererexten']));queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0x44')]=!![];queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0x4a')]=_0x8d12('0x55');queues[_0x1ce572[_0x8d12('0x53')]]['transferexten']=_0x1ce572[_0x8d12('0x56')];queues[_0x1ce572[_0x8d12('0x53')]]['transferuniqueid']=_0x1ce572[_0x8d12('0x51')];queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0xa')]=_0x8d12('0x57');}if(!_[_0x8d12('0x17')](queues[_0x1ce572['origtransfererlinkedid']])){if(_0x1ce572['transfereelinkedid']&&queues[_0x1ce572[_0x8d12('0x58')]]){queues[_0x1ce572[_0x8d12('0x58')]]['queuecallerenterreason']=0x1;queues[_0x1ce572['transfereeuniqueid']]=_[_0x8d12('0x59')](queues[_0x1ce572['transfereelinkedid']]);queues[_0x1ce572[_0x8d12('0x48')]]['transfereduniqueid']=_0x1ce572[_0x8d12('0x5a')];queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x21')]=0x2;queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x5b')]=queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0x5b')];queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x5c')]=queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0x5c')];queues[_0x1ce572[_0x8d12('0x48')]]['queuecallerjoinAt']=utils[_0x8d12('0x16')]();queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x37')]=utils['now']();queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x38')]=0x0;queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x5d')]=0x0;utils[_0x8d12('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572['transfereeuniqueid']][_0x8d12('0x20')],queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x5b')],queues[_0x1ce572[_0x8d12('0x48')]][_0x8d12('0x5c')]));}else{utils['info'](util[_0x8d12('0x4')](_0x8d12('0x5e'),_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572['origtransfererlinkedid']][_0x8d12('0x20')],_0x1ce572[_0x8d12('0x53')]));queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x10')]=_0x1ce572['secondtransfererlinkedid'];}}}else if(_0x1ce572[_0x8d12('0x5f')]==_0x1ce572[_0x8d12('0x53')]){if(!_['isNil'](queues[_0x1ce572[_0x8d12('0x52')]])){utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x60'),_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572['origtransfererlinkedid']][_0x8d12('0x20')],_0x1ce572['secondtransfereruniqueid'],_0x1ce572[_0x8d12('0x61')]));queues[_0x1ce572['origtransfererlinkedid']][_0x8d12('0x44')]=!![];queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x4a')]='ATTENDED';queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x4c')]=_0x1ce572['secondtransfererexten'];queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x4e')]=_0x1ce572['secondtransfereruniqueid'];queues[_0x1ce572['origtransfererlinkedid']][_0x8d12('0xa')]=_0x8d12('0x57');}if(!_[_0x8d12('0x17')](queues[_0x1ce572['secondtransfererlinkedid']])){if(_0x1ce572['transfertargetlinkedid']&&queues[_0x1ce572[_0x8d12('0x62')]]){queues[_0x1ce572[_0x8d12('0x62')]][_0x8d12('0x21')]=0x1;queues[_0x1ce572[_0x8d12('0x5a')]]=_[_0x8d12('0x59')](queues[_0x1ce572[_0x8d12('0x62')]]);queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x10')]=_0x1ce572[_0x8d12('0x5a')];queues[_0x1ce572[_0x8d12('0x5a')]]['queuecallerenterreason']=0x2;queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x5b')]=queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x5b')];queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x5c')]=queues[_0x1ce572[_0x8d12('0x52')]][_0x8d12('0x5c')];queues[_0x1ce572['transfertargetuniqueid']][_0x8d12('0x63')]=utils[_0x8d12('0x16')]();queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x37')]=utils[_0x8d12('0x16')]();queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x38')]=0x0;queues[_0x1ce572['transfertargetuniqueid']][_0x8d12('0x5d')]=0x0;utils[_0x8d12('0x3')](util[_0x8d12('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x20')],queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x10')],queues[_0x1ce572['transfertargetuniqueid']]['calleridnum'],queues[_0x1ce572[_0x8d12('0x5a')]][_0x8d12('0x5c')]));}else{utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x5e'),_0x1ce572[_0x8d12('0x51')],queues[_0x1ce572['secondtransfererlinkedid']]['name'],_0x1ce572[_0x8d12('0x52')]));queues[_0x1ce572[_0x8d12('0x53')]][_0x8d12('0x10')]=_0x1ce572[_0x8d12('0x52')];}}}}catch(_0x4c2eb6){utils['error'](util[_0x8d12('0x4')]('[%s][queues][attendedtransfer]',_0x1ce572[_0x8d12('0x51')]),_0x4c2eb6);}};exports[_0x8d12('0x64')]=function(_0x5e238d){try{if(!_[_0x8d12('0x17')](queues[_0x5e238d[_0x8d12('0x11')]])){utils['debug'](util[_0x8d12('0x4')](_0x8d12('0x65'),_0x5e238d['uniqueid']),_0x5e238d);queues[_0x5e238d[_0x8d12('0x11')]]['musiconholdstartAt']=utils[_0x8d12('0x16')]();utils[_0x8d12('0x3')](util['format'](_0x8d12('0x66'),_0x5e238d[_0x8d12('0x11')],queues[_0x5e238d[_0x8d12('0x11')]][_0x8d12('0x20')],queues[_0x5e238d['uniqueid']][_0x8d12('0x67')]));}}catch(_0x4ea74d){utils[_0x8d12('0x22')](util[_0x8d12('0x4')](_0x8d12('0x65'),_0x5e238d[_0x8d12('0x11')]),_0x4ea74d);}};exports['musiconholdstop']=function(_0x3bdd25){try{if(!_[_0x8d12('0x17')](queues[_0x3bdd25[_0x8d12('0x11')]])){if(!_[_0x8d12('0x17')](queues[_0x3bdd25[_0x8d12('0x11')]][_0x8d12('0x67')])){utils[_0x8d12('0x12')](util[_0x8d12('0x4')](_0x8d12('0x68'),_0x3bdd25[_0x8d12('0x11')]),_0x3bdd25);queues[_0x3bdd25[_0x8d12('0x11')]][_0x8d12('0x5d')]+=utils[_0x8d12('0x39')](utils[_0x8d12('0x16')](),queues[_0x3bdd25[_0x8d12('0x11')]][_0x8d12('0x67')]);utils[_0x8d12('0x3')](util[_0x8d12('0x4')](_0x8d12('0x69'),_0x3bdd25[_0x8d12('0x11')],queues[_0x3bdd25[_0x8d12('0x11')]][_0x8d12('0x20')],queues[_0x3bdd25[_0x8d12('0x11')]][_0x8d12('0x5d')]));delete queues[_0x3bdd25[_0x8d12('0x11')]]['musiconholdstartAt'];}}}catch(_0x49f00d){utils[_0x8d12('0x22')](util['format'](_0x8d12('0x68'),_0x3bdd25[_0x8d12('0x11')]),_0x49f00d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 9de1b9f..9b5cfa9 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 _0x9558=['find','monitors','push','debug','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','exten','context','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9558,0xf2));var _0x8955=function(_0xb5da76,_0x272ceb){_0xb5da76=_0xb5da76-0x0;var _0x443e26=_0x9558[_0xb5da76];return _0x443e26;};'use strict';var _=require(_0x8955('0x0'));var util=require(_0x8955('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x3d804d){utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x4'),_0x3d804d[_0x8955('0x5')]));if(_0x3d804d[_0x8955('0x6')]){utils[_0x8955('0x7')](_0x3d804d[_0x8955('0x6')])[_0x8955('0x8')](function(_0x381aaf){if(_0x381aaf){_0x3d804d['membername']=_0x381aaf['name'];_0x3d804d['UserId']=_0x381aaf['id'];}utils[_0x8955('0x9')](_0x8955('0xa'),_0x3d804d);});}else{utils[_0x8955('0x9')](_0x8955('0xa'),_0x3d804d);}}exports[_0x8955('0xb')]=function(_0x2dc5fd){try{utils['debug'](util[_0x8955('0x3')](_0x8955('0xc'),_0x2dc5fd[_0x8955('0x5')]),_0x2dc5fd);if(_0x2dc5fd['uniqueid']==_0x2dc5fd[_0x8955('0xd')]){utils[_0x8955('0x2')](util[_0x8955('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2dc5fd[_0x8955('0x5')],_0x2dc5fd['context'],_0x2dc5fd['exten']));recordings[_0x2dc5fd[_0x8955('0x5')]]={'uniqueid':_0x2dc5fd[_0x8955('0x5')],'accountcode':_0x2dc5fd[_0x8955('0x6')],'exten':_0x2dc5fd[_0x8955('0xe')],'context':_0x2dc5fd[_0x8955('0xf')],'channel':_0x2dc5fd[_0x8955('0x10')],'monitors':[]};}}catch(_0x56bdd4){utils[_0x8955('0x11')](util[_0x8955('0x3')](_0x8955('0xc'),_0x2dc5fd['uniqueid']),_0x56bdd4);}};exports['newstate']=function(_0x2c456a){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x2c456a[_0x8955('0x5')]),_0x2c456a);if(!_[_0x8955('0x12')](recordings[_0x2c456a[_0x8955('0x5')]])&&_0x2c456a[_0x8955('0x13')]==0x6){utils[_0x8955('0x2')](util[_0x8955('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2c456a['uniqueid'],_0x2c456a[_0x8955('0xf')],_0x2c456a[_0x8955('0x10')]));}else if(!_['isNil'](recordings[_0x2c456a[_0x8955('0xd')]])&&_0x2c456a[_0x8955('0x13')]==0x6&&_0x2c456a[_0x8955('0xf')]!='transfer'){utils['info'](util['format'](_0x8955('0x14'),_0x2c456a[_0x8955('0x5')],_0x2c456a[_0x8955('0xd')],_0x2c456a[_0x8955('0xf')],_0x2c456a[_0x8955('0x10')]));recordings[_0x2c456a[_0x8955('0xd')]]['accountcode']=_0x2c456a[_0x8955('0x6')];}}catch(_0x14ae16){utils[_0x8955('0x11')](util['format']('[%s][recordings][newstate]',_0x2c456a['uniqueid']),_0x14ae16);}};exports['varset']=function(_0xf5b3fb){try{if(!_['isNil'](_0xf5b3fb[_0x8955('0x15')])&&!_[_0x8955('0x12')](_0xf5b3fb[_0x8955('0x15')]['mixmonitor_filename'])){utils['debug'](util[_0x8955('0x3')](_0x8955('0x16'),_0xf5b3fb[_0x8955('0x5')]),_0xf5b3fb);utils[_0x8955('0x2')](util['format'](_0x8955('0x17'),_0xf5b3fb[_0x8955('0x5')],_0xf5b3fb[_0x8955('0x15')],_0xf5b3fb[_0x8955('0x18')]));if(_[_0x8955('0x19')](_0xf5b3fb['value'],_0x8955('0x1a'))){_0xf5b3fb[_0x8955('0x18')]=_0xf5b3fb['value'][_0x8955('0x1b')]('.wav49','.WAV');}if(recordings[_0xf5b3fb[_0x8955('0xd')]]){var _0x6b8be5=_[_0x8955('0x1c')](recordings[_0xf5b3fb['linkedid']][_0x8955('0x1d')],{'value':_0xf5b3fb[_0x8955('0x18')]});if(_[_0x8955('0x12')](_0x6b8be5)){recordings[_0xf5b3fb[_0x8955('0xd')]][_0x8955('0x1d')][_0x8955('0x1e')]({'value':_0xf5b3fb[_0x8955('0x18')]});}}}}catch(_0x3a1b29){utils[_0x8955('0x11')](util['format'](_0x8955('0x16'),_0xf5b3fb[_0x8955('0x5')]),_0x3a1b29);}};exports['hangup']=function(_0x39fb2e){try{if(!_['isNil'](recordings[_0x39fb2e[_0x8955('0x5')]])){utils[_0x8955('0x1f')](util[_0x8955('0x3')]('[%s][recordings][hangup]',_0x39fb2e[_0x8955('0x5')]),_0x39fb2e);utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x20'),_0x39fb2e[_0x8955('0x5')],_0x39fb2e[_0x8955('0x21')],_0x39fb2e[_0x8955('0x22')],_0x39fb2e['cause-txt']));recordings[_0x39fb2e['uniqueid']][_0x8955('0x21')]=_0x39fb2e['calleridnum'];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x22')]=_0x39fb2e[_0x8955('0x22')];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x23')]=_0x39fb2e['connectedlinenum'];recordings[_0x39fb2e[_0x8955('0x5')]]['connectedlinename']=_0x39fb2e[_0x8955('0x24')];if(recordings[_0x39fb2e['uniqueid']][_0x8955('0x25')]=='outbound'&&recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x6')]){recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x23')]=recordings[_0x39fb2e['uniqueid']]['accountcode'];recordings[_0x39fb2e[_0x8955('0x5')]][_0x8955('0x24')]='';}recordings[_0x39fb2e['uniqueid']][_0x8955('0x1d')][_0x8955('0x26')](function(_0x1cebc0){var _0x5a9a6a=_['clone'](recordings[_0x39fb2e[_0x8955('0x5')]]);_0x5a9a6a[_0x8955('0x18')]=_0x1cebc0['value'];writeDB(_0x5a9a6a);});delete recordings[_0x39fb2e[_0x8955('0x5')]];}}catch(_0xacceac){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][hangup]',_0x39fb2e['uniqueid']),_0xacceac);}};exports[_0x8955('0x27')]=function(_0x2be81b){try{if(!_[_0x8955('0x12')](recordings[_0x2be81b['uniqueid']])){utils[_0x8955('0x1f')](util[_0x8955('0x3')](_0x8955('0x28'),_0x2be81b[_0x8955('0x5')]),_0x2be81b);utils[_0x8955('0x2')](util[_0x8955('0x3')](_0x8955('0x29'),_0x2be81b[_0x8955('0x5')],_0x2be81b[_0x8955('0x2a')],_0x2be81b['appdata']));if(_0x2be81b[_0x8955('0x2a')]['toLowerCase']()==_0x8955('0x2b')&&_[_0x8955('0x2c')](_0x2be81b[_0x8955('0x2d')][_0x8955('0x2e')](),'cdr')){var _0x419915=_0x2be81b[_0x8955('0x2d')][_0x8955('0x2f')]('=');var _0x12a813=_0x419915[0x0][_0x8955('0x30')](_0x419915[0x0]['lastIndexOf']('(')+0x1,_0x419915[0x0][_0x8955('0x31')](')'));var _0x160385=_0x419915[0x1];recordings[_0x2be81b[_0x8955('0x5')]][_0x12a813]=_0x160385;}}}catch(_0x320b40){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][newexten]',_0x2be81b[_0x8955('0x5')]),_0x320b40);}};exports[_0x8955('0x32')]=function(_0x2c4439){try{if(!_['isNil'](recordings[_0x2c4439[_0x8955('0x5')]])){utils[_0x8955('0x1f')](util[_0x8955('0x3')](_0x8955('0x33'),_0x2c4439[_0x8955('0x5')]),_0x2c4439);utils['info'](util['format'](_0x8955('0x34'),_0x2c4439[_0x8955('0x5')],_0x2c4439[_0x8955('0x35')]));recordings[_0x2c4439[_0x8955('0x5')]]['queue']=_0x2c4439['queue'];}}catch(_0x2ad1e7){utils[_0x8955('0x11')](util[_0x8955('0x3')]('[%s][recordings][queuecallerjoin]',_0x2c4439[_0x8955('0x5')]),_0x2ad1e7);}}; \ No newline at end of file +var _0x049f=['error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','./utils','accountcode','getUserByInternal','then','UserId','CreateVoiceRecording','request','[%s][recordings][newchannel]','uniqueid','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer'];(function(_0x474241,_0xaa4c69){var _0x510a20=function(_0x65b231){while(--_0x65b231){_0x474241['push'](_0x474241['shift']());}};_0x510a20(++_0xaa4c69);}(_0x049f,0x185));var _0xf049=function(_0x4cf0b7,_0x560029){_0x4cf0b7=_0x4cf0b7-0x0;var _0x545f10=_0x049f[_0x4cf0b7];return _0x545f10;};'use strict';var _=require('lodash');var util=require(_0xf049('0x0'));var utils=require(_0xf049('0x1'));var recordings={};function writeDB(_0x4f44f4){utils['info'](util['format']('[%s][recordings][writeDB]',_0x4f44f4['uniqueid']));if(_0x4f44f4[_0xf049('0x2')]){utils[_0xf049('0x3')](_0x4f44f4[_0xf049('0x2')])[_0xf049('0x4')](function(_0x557731){if(_0x557731){_0x4f44f4['membername']=_0x557731['name'];_0x4f44f4[_0xf049('0x5')]=_0x557731['id'];}utils['request'](_0xf049('0x6'),_0x4f44f4);});}else{utils[_0xf049('0x7')](_0xf049('0x6'),_0x4f44f4);}}exports['newchannel']=function(_0x5ef46c){try{utils['debug'](util['format'](_0xf049('0x8'),_0x5ef46c[_0xf049('0x9')]),_0x5ef46c);if(_0x5ef46c[_0xf049('0x9')]==_0x5ef46c[_0xf049('0xa')]){utils['info'](util[_0xf049('0xb')](_0xf049('0xc'),_0x5ef46c[_0xf049('0x9')],_0x5ef46c[_0xf049('0xd')],_0x5ef46c[_0xf049('0xe')]));recordings[_0x5ef46c[_0xf049('0x9')]]={'uniqueid':_0x5ef46c[_0xf049('0x9')],'accountcode':_0x5ef46c[_0xf049('0x2')],'exten':_0x5ef46c[_0xf049('0xe')],'context':_0x5ef46c[_0xf049('0xd')],'channel':_0x5ef46c[_0xf049('0xf')],'monitors':[]};}}catch(_0x4512b8){utils['error'](util[_0xf049('0xb')](_0xf049('0x8'),_0x5ef46c['uniqueid']),_0x4512b8);}};exports[_0xf049('0x10')]=function(_0x33093e){try{utils[_0xf049('0x11')](util[_0xf049('0xb')](_0xf049('0x12'),_0x33093e[_0xf049('0x9')]),_0x33093e);if(!_[_0xf049('0x13')](recordings[_0x33093e[_0xf049('0x9')]])&&_0x33093e[_0xf049('0x14')]==0x6){utils[_0xf049('0x15')](util['format'](_0xf049('0x16'),_0x33093e['uniqueid'],_0x33093e[_0xf049('0xd')],_0x33093e[_0xf049('0xf')]));}else if(!_['isNil'](recordings[_0x33093e['linkedid']])&&_0x33093e[_0xf049('0x14')]==0x6&&_0x33093e[_0xf049('0xd')]!=_0xf049('0x17')){utils[_0xf049('0x15')](util[_0xf049('0xb')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x33093e['uniqueid'],_0x33093e['linkedid'],_0x33093e[_0xf049('0xd')],_0x33093e['channel']));recordings[_0x33093e[_0xf049('0xa')]][_0xf049('0x2')]=_0x33093e['accountcode'];}}catch(_0x1c8b5b){utils[_0xf049('0x18')](util[_0xf049('0xb')]('[%s][recordings][newstate]',_0x33093e[_0xf049('0x9')]),_0x1c8b5b);}};exports[_0xf049('0x19')]=function(_0x35e032){try{if(!_['isNil'](_0x35e032[_0xf049('0x1a')])&&!_[_0xf049('0x13')](_0x35e032[_0xf049('0x1a')][_0xf049('0x1b')])){utils['debug'](util[_0xf049('0xb')](_0xf049('0x1c'),_0x35e032['uniqueid']),_0x35e032);utils[_0xf049('0x15')](util[_0xf049('0xb')](_0xf049('0x1d'),_0x35e032[_0xf049('0x9')],_0x35e032['variable'],_0x35e032['value']));if(_[_0xf049('0x1e')](_0x35e032[_0xf049('0x1f')],_0xf049('0x20'))){_0x35e032[_0xf049('0x1f')]=_0x35e032[_0xf049('0x1f')]['replace'](_0xf049('0x20'),'.WAV');}if(recordings[_0x35e032[_0xf049('0xa')]]){var _0x4d798b=_[_0xf049('0x21')](recordings[_0x35e032[_0xf049('0xa')]]['monitors'],{'value':_0x35e032[_0xf049('0x1f')]});if(_[_0xf049('0x13')](_0x4d798b)){recordings[_0x35e032[_0xf049('0xa')]][_0xf049('0x22')]['push']({'value':_0x35e032[_0xf049('0x1f')]});}}}}catch(_0x4b6562){utils['error'](util['format'](_0xf049('0x1c'),_0x35e032['uniqueid']),_0x4b6562);}};exports[_0xf049('0x23')]=function(_0x1d9510){try{if(!_[_0xf049('0x13')](recordings[_0x1d9510[_0xf049('0x9')]])){utils[_0xf049('0x11')](util[_0xf049('0xb')](_0xf049('0x24'),_0x1d9510['uniqueid']),_0x1d9510);utils['info'](util[_0xf049('0xb')](_0xf049('0x25'),_0x1d9510['uniqueid'],_0x1d9510[_0xf049('0x26')],_0x1d9510[_0xf049('0x27')],_0x1d9510[_0xf049('0x28')]));recordings[_0x1d9510['uniqueid']][_0xf049('0x26')]=_0x1d9510[_0xf049('0x26')];recordings[_0x1d9510[_0xf049('0x9')]][_0xf049('0x27')]=_0x1d9510[_0xf049('0x27')];recordings[_0x1d9510['uniqueid']]['connectedlinenum']=_0x1d9510[_0xf049('0x29')];recordings[_0x1d9510[_0xf049('0x9')]][_0xf049('0x2a')]=_0x1d9510[_0xf049('0x2a')];if(recordings[_0x1d9510[_0xf049('0x9')]][_0xf049('0x2b')]==_0xf049('0x2c')&&recordings[_0x1d9510['uniqueid']][_0xf049('0x2')]){recordings[_0x1d9510[_0xf049('0x9')]]['connectedlinenum']=recordings[_0x1d9510['uniqueid']][_0xf049('0x2')];recordings[_0x1d9510[_0xf049('0x9')]][_0xf049('0x2a')]='';}recordings[_0x1d9510[_0xf049('0x9')]]['monitors']['forEach'](function(_0x22e977){var _0x17df9d=_[_0xf049('0x2d')](recordings[_0x1d9510[_0xf049('0x9')]]);_0x17df9d[_0xf049('0x1f')]=_0x22e977[_0xf049('0x1f')];writeDB(_0x17df9d);});delete recordings[_0x1d9510[_0xf049('0x9')]];}}catch(_0x37f632){utils[_0xf049('0x18')](util[_0xf049('0xb')](_0xf049('0x24'),_0x1d9510['uniqueid']),_0x37f632);}};exports['newexten']=function(_0x5cad81){try{if(!_['isNil'](recordings[_0x5cad81[_0xf049('0x9')]])){utils[_0xf049('0x11')](util[_0xf049('0xb')](_0xf049('0x2e'),_0x5cad81['uniqueid']),_0x5cad81);utils['info'](util[_0xf049('0xb')](_0xf049('0x2f'),_0x5cad81[_0xf049('0x9')],_0x5cad81[_0xf049('0x30')],_0x5cad81[_0xf049('0x31')]));if(_0x5cad81[_0xf049('0x30')][_0xf049('0x32')]()==_0xf049('0x33')&&_[_0xf049('0x34')](_0x5cad81[_0xf049('0x31')][_0xf049('0x32')](),'cdr')){var _0x2271d4=_0x5cad81[_0xf049('0x31')][_0xf049('0x35')]('=');var _0x31ff85=_0x2271d4[0x0][_0xf049('0x36')](_0x2271d4[0x0][_0xf049('0x37')]('(')+0x1,_0x2271d4[0x0][_0xf049('0x37')](')'));var _0x242461=_0x2271d4[0x1];recordings[_0x5cad81[_0xf049('0x9')]][_0x31ff85]=_0x242461;}}}catch(_0x5e0bb1){utils[_0xf049('0x18')](util[_0xf049('0xb')](_0xf049('0x2e'),_0x5cad81[_0xf049('0x9')]),_0x5e0bb1);}};exports[_0xf049('0x38')]=function(_0x378829){try{if(!_[_0xf049('0x13')](recordings[_0x378829[_0xf049('0x9')]])){utils[_0xf049('0x11')](util['format'](_0xf049('0x39'),_0x378829[_0xf049('0x9')]),_0x378829);utils['info'](util[_0xf049('0xb')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x378829['uniqueid'],_0x378829[_0xf049('0x3a')]));recordings[_0x378829[_0xf049('0x9')]][_0xf049('0x3a')]=_0x378829[_0xf049('0x3a')];}}catch(_0x49b39c){utils[_0xf049('0x18')](util[_0xf049('0xb')]('[%s][recordings][queuecallerjoin]',_0x378829[_0xf049('0x9')]),_0x49b39c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e405bf3..5e58a60 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 _0x93cf=['[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','util','info','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x93cf,0x179));var _0xf93c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93cf[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xf93c('0x0'));var utils=require('./utils');function writeDB(_0x3c91e0){utils[_0xf93c('0x1')](util[_0xf93c('0x2')](_0xf93c('0x3'),_0x3c91e0[_0xf93c('0x4')]===_0xf93c('0x5')?_0x3c91e0[_0xf93c('0x6')]:_0x3c91e0['uniqueid'],_0x3c91e0[_0xf93c('0x4')]));utils[_0xf93c('0x7')](_0xf93c('0x8'),_0x3c91e0);}exports['blinds']={};exports['blindtransfer']=function(_0x124778){try{utils['debug'](util['format'](_0xf93c('0x9'),_0x124778['uniqueid']),_0x124778);utils[_0xf93c('0x1')](util['format'](_0xf93c('0xa'),_0x124778[_0xf93c('0xb')],_0x124778[_0xf93c('0xc')],_0x124778[_0xf93c('0xd')],_0x124778['transfereecalleridnum'],_0x124778[_0xf93c('0xe')]));_0x124778[_0xf93c('0x4')]=_0xf93c('0xf');exports[_0xf93c('0x10')][_0x124778[_0xf93c('0x11')]]=_0x124778;writeDB(_0x124778);}catch(_0x3ed422){utils[_0xf93c('0x12')](util[_0xf93c('0x2')](_0xf93c('0x9'),_0x124778[_0xf93c('0xb')]),_0x3ed422);}};exports[_0xf93c('0x13')]=function(_0x120694){try{utils['debug'](util[_0xf93c('0x2')](_0xf93c('0x14'),_0x120694[_0xf93c('0x6')]),_0x120694);utils[_0xf93c('0x1')](util[_0xf93c('0x2')](_0xf93c('0x15'),_0x120694['origtransfereruniqueid'],_0x120694['origtransferercalleridnum'],_0x120694[_0xf93c('0x16')],_0x120694[_0xf93c('0x17')],_0x120694[_0xf93c('0x18')]));_0x120694=_[_0xf93c('0x19')](_0x120694,{'transfererchannel':_0x120694[_0xf93c('0x1a')],'transferercalleridnum':_0x120694[_0xf93c('0x1b')],'transferercalleridname':_0x120694[_0xf93c('0x16')],'transfererconnectedlinenum':_0x120694['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x120694[_0xf93c('0x1c')],'transfereraccountcode':_0x120694[_0xf93c('0x1d')],'transferercontext':_0x120694[_0xf93c('0x1e')],'transfererexten':_0x120694['secondtransfererexten'],'transfererlinkedid':_0x120694['origtransfererlinkedid'],'context':_0x120694[_0xf93c('0x1f')],'extension':_0x120694[_0xf93c('0x20')],'type':_0xf93c('0x5')});if(_[_0xf93c('0x21')](_0x120694[_0xf93c('0x22')])){_0x120694=_[_0xf93c('0x19')](_0x120694,{'transfereechannel':_0x120694['transfertargetchannel'],'transfereecalleridnum':_0x120694[_0xf93c('0x17')],'transfereecalleridname':_0x120694['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x120694[_0xf93c('0x23')],'transfereeconnectedlinename':_0x120694['transfertargetconnectedlinename'],'transfereeaccountcode':_0x120694[_0xf93c('0x24')],'transfereecontext':_0x120694['transfertargetcontext'],'transfereeexten':_0x120694['transfertargetexten'],'transfereelinkedid':_0x120694[_0xf93c('0x25')]});}writeDB(_0x120694);}catch(_0xe114c8){utils[_0xf93c('0x12')](util[_0xf93c('0x2')](_0xf93c('0x14'),_0x120694[_0xf93c('0x6')]),_0xe114c8);}}; \ No newline at end of file +var _0x7e79=['transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','type','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','attendedtransfer','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetaccountcode'];(function(_0x441b31,_0x1e005b){var _0x4120ab=function(_0x422ef9){while(--_0x422ef9){_0x441b31['push'](_0x441b31['shift']());}};_0x4120ab(++_0x1e005b);}(_0x7e79,0xee));var _0x97e7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7e79[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x97e7('0x0'));var util=require(_0x97e7('0x1'));var utils=require(_0x97e7('0x2'));function writeDB(_0x56f538){utils[_0x97e7('0x3')](util[_0x97e7('0x4')](_0x97e7('0x5'),_0x56f538['type']==='attended'?_0x56f538[_0x97e7('0x6')]:_0x56f538['uniqueid'],_0x56f538[_0x97e7('0x7')]));utils['request']('CreateVoiceTransferReport',_0x56f538);}exports['blinds']={};exports[_0x97e7('0x8')]=function(_0x5b3871){try{utils[_0x97e7('0x9')](util[_0x97e7('0x4')](_0x97e7('0xa'),_0x5b3871['uniqueid']),_0x5b3871);utils[_0x97e7('0x3')](util[_0x97e7('0x4')](_0x97e7('0xb'),_0x5b3871[_0x97e7('0xc')],_0x5b3871[_0x97e7('0xd')],_0x5b3871[_0x97e7('0xe')],_0x5b3871['transfereecalleridnum'],_0x5b3871[_0x97e7('0xf')]));_0x5b3871[_0x97e7('0x7')]=_0x97e7('0x10');exports[_0x97e7('0x11')][_0x5b3871['transfereruniqueid']]=_0x5b3871;writeDB(_0x5b3871);}catch(_0x4c6fc7){utils['error'](util['format'](_0x97e7('0xa'),_0x5b3871['uniqueid']),_0x4c6fc7);}};exports[_0x97e7('0x12')]=function(_0x163819){try{utils[_0x97e7('0x9')](util[_0x97e7('0x4')]('[%s][transfers][attendedtransfer]',_0x163819['origtransfereruniqueid']),_0x163819);utils[_0x97e7('0x3')](util[_0x97e7('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x163819[_0x97e7('0x6')],_0x163819[_0x97e7('0x13')],_0x163819['origtransferercalleridname'],_0x163819[_0x97e7('0x14')],_0x163819[_0x97e7('0x15')]));_0x163819=_[_0x97e7('0x16')](_0x163819,{'transfererchannel':_0x163819['origtransfererchannel'],'transferercalleridnum':_0x163819['origtransferercalleridnum'],'transferercalleridname':_0x163819[_0x97e7('0x17')],'transfererconnectedlinenum':_0x163819['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x163819[_0x97e7('0x18')],'transfereraccountcode':_0x163819[_0x97e7('0x19')],'transferercontext':_0x163819[_0x97e7('0x1a')],'transfererexten':_0x163819[_0x97e7('0x1b')],'transfererlinkedid':_0x163819[_0x97e7('0x1c')],'context':_0x163819[_0x97e7('0x1d')],'extension':_0x163819[_0x97e7('0x1e')],'type':_0x97e7('0x1f')});if(_[_0x97e7('0x20')](_0x163819[_0x97e7('0x21')])){_0x163819=_[_0x97e7('0x16')](_0x163819,{'transfereechannel':_0x163819['transfertargetchannel'],'transfereecalleridnum':_0x163819['transfertargetcalleridnum'],'transfereecalleridname':_0x163819[_0x97e7('0x15')],'transfereeconnectedlinenum':_0x163819['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x163819['transfertargetconnectedlinename'],'transfereeaccountcode':_0x163819[_0x97e7('0x22')],'transfereecontext':_0x163819[_0x97e7('0x23')],'transfereeexten':_0x163819['transfertargetexten'],'transfereelinkedid':_0x163819[_0x97e7('0x24')]});}writeDB(_0x163819);}catch(_0x2b7a98){utils[_0x97e7('0x25')](util[_0x97e7('0x4')](_0x97e7('0x26'),_0x163819['origtransfereruniqueid']),_0x2b7a98);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 519ca7e..461dec2 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 _0x4745=['result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','internal','name','interface'];(function(_0x4576aa,_0x46c8a8){var _0x1ec6ba=function(_0x356675){while(--_0x356675){_0x4576aa['push'](_0x4576aa['shift']());}};_0x1ec6ba(++_0x46c8a8);}(_0x4745,0x1e7));var _0x5474=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4745[_0x13ea00];return _0x1f7347;};'use strict';var BPromise=require(_0x5474('0x0'));var jayson=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var util=require(_0x5474('0x3'));var client=jayson[_0x5474('0x4')][_0x5474('0x5')]({'port':0x2329});var logger=require(_0x5474('0x6'))(_0x5474('0x7'));exports[_0x5474('0x8')]=function(_0x39fb9b,_0x45a895){logger[_0x5474('0x8')](_0x39fb9b,_0x45a895?util['inspect'](_0x45a895,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0x9')]=function(_0x431f81,_0x57add7){logger[_0x5474('0x9')](_0x431f81,_0x57add7?util['inspect'](_0x57add7,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0xa')]=function(_0x3c8860,_0x4fae2b){logger[_0x5474('0xa')](_0x3c8860,_0x4fae2b?util[_0x5474('0xb')](_0x4fae2b,{'showHidden':![],'depth':null}):'');};exports[_0x5474('0xc')]=function(_0x26cceb,_0x4444dd){return client[_0x5474('0xc')](_0x26cceb,{'body':_0x4444dd})[_0x5474('0xd')](function(_0x2fc637){logger['debug'](_0x5474('0xe'),_0x26cceb,_0x2fc637?util[_0x5474('0xb')](_0x2fc637,{'showHidden':![],'depth':null}):'');})[_0x5474('0xf')](function(_0x12cd7f){logger[_0x5474('0xa')](_0x5474('0xe'),_0x26cceb,_0x12cd7f?util[_0x5474('0xb')](_0x12cd7f,{'showHidden':![],'depth':null}):'');});};function getUser(_0xc05a28){return client[_0x5474('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5474('0x10'),_0x5474('0x11'),_0x5474('0x12')],'where':_0xc05a28,'limit':0x1}})[_0x5474('0xd')](function(_0x5a6353){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0xc05a28),_0x5a6353?util[_0x5474('0xb')](_0x5a6353,{'showHidden':![],'depth':null}):'');return _0x5a6353[_0x5474('0x13')][_0x5474('0x14')]?_0x5a6353['result'][0x0]:null;});}exports[_0x5474('0x15')]=function(_0x2be746){return new BPromise(function(_0x56dbfa,_0x22b37d){if(_0x2be746){return getUser({'internal':_0x2be746})[_0x5474('0xd')](function(_0x18b0fe){logger[_0x5474('0x8')](_0x5474('0x16'),_0x2be746,_0x18b0fe?'found':_0x5474('0x17'));return _0x56dbfa(_0x18b0fe);})['catch'](function(_0x3023cd){logger[_0x5474('0xa')]('[utils][getUserByInternal]',_0x3023cd?util['inspect'](_0x3023cd,{'showHidden':![],'depth':null}):'');return _0x56dbfa(null);});}return _0x56dbfa(null);});};exports['getUserByInterface']=function(_0x1f81d6){return new BPromise(function(_0x2c7593,_0x475374){if(_0x1f81d6){return getUser({'interface':_0x1f81d6})[_0x5474('0xd')](function(_0x36b389){logger[_0x5474('0x8')](_0x5474('0x18'),_0x1f81d6,_0x36b389?_0x5474('0x19'):_0x5474('0x17'));return _0x2c7593(_0x36b389);})[_0x5474('0xf')](function(_0x542d1f){logger['error'](_0x5474('0x1a'),_0x542d1f?util[_0x5474('0xb')](_0x542d1f,{'showHidden':![],'depth':null}):'');return _0x2c7593(null);});}return _0x2c7593(null);});};exports[_0x5474('0x1b')]=function(_0x4b40e0){return new BPromise(function(_0x24997a,_0x49f691){if(_0x4b40e0){return getUser({'name':_0x4b40e0})[_0x5474('0xd')](function(_0x23dbc5){logger['info'](_0x5474('0x1c'),_0x4b40e0,_0x23dbc5?'found':_0x5474('0x17'));return _0x24997a(_0x23dbc5);})['catch'](function(_0xe9dcbf){logger[_0x5474('0xa')](_0x5474('0x1d'),_0xe9dcbf?util['inspect'](_0xe9dcbf,{'showHidden':![],'depth':null}):'');return _0x24997a(null);});}return _0x24997a(null);});};exports[_0x5474('0x1e')]=function(_0x42b99a){return new BPromise(function(_0x479e44,_0x57731b){if(_0x42b99a){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5474('0x11'),_0x5474('0x1f'),'acw',_0x5474('0x20')],'where':{'name':_0x42b99a},'limit':0x1}})['then'](function(_0xc1e0ce){logger['debug'](_0x5474('0x21'),_0x42b99a,_0xc1e0ce?util['inspect'](_0xc1e0ce,{'showHidden':![],'depth':null}):'');logger[_0x5474('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x42b99a,_0xc1e0ce?_0x5474('0x19'):_0x5474('0x17'));return _0x479e44(_0xc1e0ce[_0x5474('0x13')][_0x5474('0x14')]?_0xc1e0ce['result'][0x0]:null);})['catch'](function(_0x44e089){logger[_0x5474('0xa')](_0x5474('0x22'),_0x44e089?util[_0x5474('0xb')](_0x44e089,{'showHidden':![],'depth':null}):'');return _0x479e44(null);});}return _0x479e44(null);});};exports['addTime']=function(_0x5e001d,_0x258d66){return moment(_0x5e001d)[_0x5474('0x23')](_0x258d66,'seconds')[_0x5474('0x24')](_0x5474('0x25'));};exports[_0x5474('0x26')]=function(_0xc5fb7,_0x4d32ce){return moment(_0xc5fb7)[_0x5474('0x27')](_0x4d32ce,_0x5474('0x28'))[_0x5474('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5474('0x29')]=function(_0x2b8d66,_0xc3d6af){return moment(_0x2b8d66)[_0x5474('0x2a')](moment(_0xc3d6af),'seconds');};exports['sumTime']=function(_0x30d4a2,_0x3eccef){return parseInt(_0x30d4a2,0xa)+parseInt(_0x3eccef,0xa);};exports[_0x5474('0x2b')]=function(){return moment()[_0x5474('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5474('0x2c')]=function(_0x42a122,_0x13b56b){if(_0x13b56b){return moment(_0x42a122)[_0x5474('0x2c')](_0x13b56b);}return!![];};exports['isBefore']=function(_0x5b1b70,_0x573c28){if(_0x573c28){return moment(_0x5b1b70)[_0x5474('0x2d')](_0x573c28);}else if(_0x5b1b70){return!![];}return![];}; \ No newline at end of file +var _0xfff8=['name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diff','sumTime','isBefore','bluebird','jayson/promise','moment','util','../../config/logger','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue'];(function(_0x380374,_0x63ef4b){var _0x59e0c4=function(_0xe408ba){while(--_0xe408ba){_0x380374['push'](_0x380374['shift']());}};_0x59e0c4(++_0x63ef4b);}(_0xfff8,0xe2));var _0x8fff=function(_0x51922d,_0x4f1e4d){_0x51922d=_0x51922d-0x0;var _0x2c0555=_0xfff8[_0x51922d];return _0x2c0555;};'use strict';var BPromise=require(_0x8fff('0x0'));var jayson=require(_0x8fff('0x1'));var moment=require(_0x8fff('0x2'));var util=require(_0x8fff('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x8fff('0x4'))('xdr');exports[_0x8fff('0x5')]=function(_0x140b74,_0x4bb981){logger['info'](_0x140b74,_0x4bb981?util[_0x8fff('0x6')](_0x4bb981,{'showHidden':![],'depth':null}):'');};exports[_0x8fff('0x7')]=function(_0x969a8c,_0x5a3a83){logger[_0x8fff('0x7')](_0x969a8c,_0x5a3a83?util[_0x8fff('0x6')](_0x5a3a83,{'showHidden':![],'depth':null}):'');};exports[_0x8fff('0x8')]=function(_0x4f65fa,_0x2262d8){logger[_0x8fff('0x8')](_0x4f65fa,_0x2262d8?util[_0x8fff('0x6')](_0x2262d8,{'showHidden':![],'depth':null}):'');};exports[_0x8fff('0x9')]=function(_0x5b458c,_0x8ced0a){return client['request'](_0x5b458c,{'body':_0x8ced0a})['then'](function(_0x4a04a1){logger[_0x8fff('0x7')](_0x8fff('0xa'),_0x5b458c,_0x4a04a1?util[_0x8fff('0x6')](_0x4a04a1,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2f1f76){logger[_0x8fff('0x8')](_0x8fff('0xa'),_0x5b458c,_0x2f1f76?util[_0x8fff('0x6')](_0x2f1f76,{'showHidden':![],'depth':null}):'');});};function getUser(_0x547aff){return client['request'](_0x8fff('0xb'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x8fff('0xc')],'where':_0x547aff,'limit':0x1}})[_0x8fff('0xd')](function(_0x59478c){logger[_0x8fff('0x7')](_0x8fff('0xe'),JSON[_0x8fff('0xf')](_0x547aff),_0x59478c?util[_0x8fff('0x6')](_0x59478c,{'showHidden':![],'depth':null}):'');return _0x59478c[_0x8fff('0x10')][_0x8fff('0x11')]?_0x59478c[_0x8fff('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x516f47){return new BPromise(function(_0x2a13d2,_0x359c08){if(_0x516f47){return getUser({'internal':_0x516f47})[_0x8fff('0xd')](function(_0x1cbc36){logger[_0x8fff('0x5')](_0x8fff('0x12'),_0x516f47,_0x1cbc36?_0x8fff('0x13'):_0x8fff('0x14'));return _0x2a13d2(_0x1cbc36);})[_0x8fff('0x15')](function(_0x3f0272){logger[_0x8fff('0x8')]('[utils][getUserByInternal]',_0x3f0272?util[_0x8fff('0x6')](_0x3f0272,{'showHidden':![],'depth':null}):'');return _0x2a13d2(null);});}return _0x2a13d2(null);});};exports[_0x8fff('0x16')]=function(_0x42430b){return new BPromise(function(_0x533a16,_0x5c036c){if(_0x42430b){return getUser({'interface':_0x42430b})['then'](function(_0x4ac8f1){logger[_0x8fff('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x42430b,_0x4ac8f1?_0x8fff('0x13'):'notfound');return _0x533a16(_0x4ac8f1);})[_0x8fff('0x15')](function(_0x5393cb){logger[_0x8fff('0x8')]('[utils][getUserByInterface]',_0x5393cb?util[_0x8fff('0x6')](_0x5393cb,{'showHidden':![],'depth':null}):'');return _0x533a16(null);});}return _0x533a16(null);});};exports[_0x8fff('0x17')]=function(_0x4e8ea5){return new BPromise(function(_0x3b153a,_0x5247f8){if(_0x4e8ea5){return getUser({'name':_0x4e8ea5})['then'](function(_0x2a4e5e){logger['info'](_0x8fff('0x18'),_0x4e8ea5,_0x2a4e5e?_0x8fff('0x13'):_0x8fff('0x14'));return _0x3b153a(_0x2a4e5e);})[_0x8fff('0x15')](function(_0x2e3b6e){logger[_0x8fff('0x8')]('[utils][getUserByName]',_0x2e3b6e?util['inspect'](_0x2e3b6e,{'showHidden':![],'depth':null}):'');return _0x3b153a(null);});}return _0x3b153a(null);});};exports['getVoiceQueueByName']=function(_0x5804fb){return new BPromise(function(_0x582881,_0x5c05cb){if(_0x5804fb){return client[_0x8fff('0x9')](_0x8fff('0x19'),{'options':{'raw':!![],'attributes':['id',_0x8fff('0x1a'),_0x8fff('0x1b'),_0x8fff('0x1c'),_0x8fff('0x1d')],'where':{'name':_0x5804fb},'limit':0x1}})[_0x8fff('0xd')](function(_0x5db05e){logger['debug'](_0x8fff('0x1e'),_0x5804fb,_0x5db05e?util['inspect'](_0x5db05e,{'showHidden':![],'depth':null}):'');logger[_0x8fff('0x5')](_0x8fff('0x1f'),_0x5804fb,_0x5db05e?_0x8fff('0x13'):_0x8fff('0x14'));return _0x582881(_0x5db05e[_0x8fff('0x10')][_0x8fff('0x11')]?_0x5db05e['result'][0x0]:null);})['catch'](function(_0x3bf088){logger[_0x8fff('0x8')](_0x8fff('0x20'),_0x3bf088?util[_0x8fff('0x6')](_0x3bf088,{'showHidden':![],'depth':null}):'');return _0x582881(null);});}return _0x582881(null);});};exports[_0x8fff('0x21')]=function(_0x1d68d2,_0x3867a9){return moment(_0x1d68d2)[_0x8fff('0x22')](_0x3867a9,_0x8fff('0x23'))['format'](_0x8fff('0x24'));};exports['subtractTime']=function(_0x31d252,_0x335b45){return moment(_0x31d252)[_0x8fff('0x25')](_0x335b45,_0x8fff('0x23'))[_0x8fff('0x26')](_0x8fff('0x24'));};exports['diffTime']=function(_0x366dec,_0x15fcaa){return moment(_0x366dec)[_0x8fff('0x27')](moment(_0x15fcaa),'seconds');};exports[_0x8fff('0x28')]=function(_0x1585ad,_0x151983){return parseInt(_0x1585ad,0xa)+parseInt(_0x151983,0xa);};exports['now']=function(){return moment()[_0x8fff('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x33b3c8,_0x31a921){if(_0x31a921){return moment(_0x33b3c8)['isAfter'](_0x31a921);}return!![];};exports[_0x8fff('0x29')]=function(_0x5cf0ef,_0x6c9dac){if(_0x6c9dac){return moment(_0x5cf0ef)['isBefore'](_0x6c9dac);}else if(_0x5cf0ef){return!![];}return![];}; \ No newline at end of file